@camstack/addon-admin-ui 0.1.11 → 0.1.12
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,613 +0,0 @@
|
|
|
1
|
-
var q7=Object.defineProperty;var y2=t=>{throw TypeError(t)};var H7=(t,e,n)=>e in t?q7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Gp=(t,e,n)=>H7(t,typeof e!="symbol"?e+"":e,n),Yy=(t,e,n)=>e.has(t)||y2("Cannot "+n);var Q=(t,e,n)=>(Yy(t,e,"read from private field"),n?n.call(t):e.get(t)),qe=(t,e,n)=>e.has(t)?y2("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),Me=(t,e,n,s)=>(Yy(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Je=(t,e,n)=>(Yy(t,e,"access private method"),n);var U0=(t,e,n,s)=>({set _(i){Me(t,e,i,n)},get _(){return Q(t,e,s)}});function Gb(t,e){for(var n=0;n<e.length;n++){const s=e[n];if(typeof s!="string"&&!Array.isArray(s)){for(const i in s)if(i!=="default"&&!(i in t)){const o=Object.getOwnPropertyDescriptor(s,i);o&&Object.defineProperty(t,i,o.get?o:{enumerable:!0,get:()=>s[i]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))s(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const d of o.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&s(d)}).observe(document,{childList:!0,subtree:!0});function n(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerPolicy&&(o.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?o.credentials="include":i.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function s(i){if(i.ep)return;i.ep=!0;const o=n(i);fetch(i.href,o)}})();function k1(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Vy={exports:{}},Pp={};/**
|
|
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 x2;function B7(){if(x2)return Pp;x2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function n(s,i,o){var d=null;if(o!==void 0&&(d=""+o),i.key!==void 0&&(d=""+i.key),"key"in i){o={};for(var f in i)f!=="key"&&(o[f]=i[f])}else o=i;return i=o.ref,{$$typeof:t,type:s,key:d,ref:i!==void 0?i:null,props:o}}return Pp.Fragment=e,Pp.jsx=n,Pp.jsxs=n,Pp}var b2;function G7(){return b2||(b2=1,Vy.exports=B7()),Vy.exports}var h=G7(),Qy={exports:{}},lt={};/**
|
|
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 v2;function P7(){if(v2)return lt;v2=1;var t=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),d=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),v=Symbol.for("react.activity"),_=Symbol.iterator;function C(G){return G===null||typeof G!="object"?null:(G=_&&G[_]||G["@@iterator"],typeof G=="function"?G:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,R={};function O(G,W,fe){this.props=G,this.context=W,this.refs=R,this.updater=fe||w}O.prototype.isReactComponent={},O.prototype.setState=function(G,W){if(typeof G!="object"&&typeof G!="function"&&G!=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,G,W,"setState")},O.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function M(){}M.prototype=O.prototype;function z(G,W,fe){this.props=G,this.context=W,this.refs=R,this.updater=fe||w}var k=z.prototype=new M;k.constructor=z,T(k,O.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function q(){}var L={H:null,A:null,T:null,S:null},U=Object.prototype.hasOwnProperty;function V(G,W,fe){var be=fe.ref;return{$$typeof:t,type:G,key:W,ref:be!==void 0?be:null,props:fe}}function F(G,W){return V(G.type,W,G.props)}function re(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ne(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(fe){return W[fe]})}var J=/\/+/g;function ie(G,W){return typeof G=="object"&&G!==null&&G.key!=null?ne(""+G.key):W.toString(36)}function ce(G){switch(G.status){case"fulfilled":return G.value;case"rejected":throw G.reason;default:switch(typeof G.status=="string"?G.then(q,q):(G.status="pending",G.then(function(W){G.status==="pending"&&(G.status="fulfilled",G.value=W)},function(W){G.status==="pending"&&(G.status="rejected",G.reason=W)})),G.status){case"fulfilled":return G.value;case"rejected":throw G.reason}}throw G}function Y(G,W,fe,be,_e){var me=typeof G;(me==="undefined"||me==="boolean")&&(G=null);var we=!1;if(G===null)we=!0;else switch(me){case"bigint":case"string":case"number":we=!0;break;case"object":switch(G.$$typeof){case t:case e:we=!0;break;case b:return we=G._init,Y(we(G._payload),W,fe,be,_e)}}if(we)return _e=_e(G),we=be===""?"."+ie(G,0):be,P(_e)?(fe="",we!=null&&(fe=we.replace(J,"$&/")+"/"),Y(_e,W,fe,"",function(Vt){return Vt})):_e!=null&&(re(_e)&&(_e=F(_e,fe+(_e.key==null||G&&G.key===_e.key?"":(""+_e.key).replace(J,"$&/")+"/")+we)),W.push(_e)),1;we=0;var nt=be===""?".":be+":";if(P(G))for(var ze=0;ze<G.length;ze++)be=G[ze],me=nt+ie(be,ze),we+=Y(be,W,fe,me,_e);else if(ze=C(G),typeof ze=="function")for(G=ze.call(G),ze=0;!(be=G.next()).done;)be=be.value,me=nt+ie(be,ze++),we+=Y(be,W,fe,me,_e);else if(me==="object"){if(typeof G.then=="function")return Y(ce(G),W,fe,be,_e);throw W=String(G),Error("Objects are not valid as a React child (found: "+(W==="[object Object]"?"object with keys {"+Object.keys(G).join(", ")+"}":W)+"). If you meant to render a collection of children, use an array instead.")}return we}function $(G,W,fe){if(G==null)return G;var be=[],_e=0;return Y(G,be,"","",function(me){return W.call(fe,me,_e++)}),be}function ae(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(fe){(G._status===0||G._status===-1)&&(G._status=1,G._result=fe)},function(fe){(G._status===0||G._status===-1)&&(G._status=2,G._result=fe)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var je=typeof reportError=="function"?reportError:function(G){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var W=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof G=="object"&&G!==null&&typeof G.message=="string"?String(G.message):String(G),error:G});if(!window.dispatchEvent(W))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",G);return}console.error(G)},he={map:$,forEach:function(G,W,fe){$(G,function(){W.apply(this,arguments)},fe)},count:function(G){var W=0;return $(G,function(){W++}),W},toArray:function(G){return $(G,function(W){return W})||[]},only:function(G){if(!re(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return lt.Activity=v,lt.Children=he,lt.Component=O,lt.Fragment=n,lt.Profiler=i,lt.PureComponent=z,lt.StrictMode=s,lt.Suspense=p,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,lt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return L.H.useMemoCache(G)}},lt.cache=function(G){return function(){return G.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(G,W,fe){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var be=T({},G.props),_e=G.key;if(W!=null)for(me in W.key!==void 0&&(_e=""+W.key),W)!U.call(W,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&W.ref===void 0||(be[me]=W[me]);var me=arguments.length-2;if(me===1)be.children=fe;else if(1<me){for(var we=Array(me),nt=0;nt<me;nt++)we[nt]=arguments[nt+2];be.children=we}return V(G.type,_e,be)},lt.createContext=function(G){return G={$$typeof:d,_currentValue:G,_currentValue2:G,_threadCount:0,Provider:null,Consumer:null},G.Provider=G,G.Consumer={$$typeof:o,_context:G},G},lt.createElement=function(G,W,fe){var be,_e={},me=null;if(W!=null)for(be in W.key!==void 0&&(me=""+W.key),W)U.call(W,be)&&be!=="key"&&be!=="__self"&&be!=="__source"&&(_e[be]=W[be]);var we=arguments.length-2;if(we===1)_e.children=fe;else if(1<we){for(var nt=Array(we),ze=0;ze<we;ze++)nt[ze]=arguments[ze+2];_e.children=nt}if(G&&G.defaultProps)for(be in we=G.defaultProps,we)_e[be]===void 0&&(_e[be]=we[be]);return V(G,me,_e)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(G){return{$$typeof:f,render:G}},lt.isValidElement=re,lt.lazy=function(G){return{$$typeof:b,_payload:{_status:-1,_result:G},_init:ae}},lt.memo=function(G,W){return{$$typeof:y,type:G,compare:W===void 0?null:W}},lt.startTransition=function(G){var W=L.T,fe={};L.T=fe;try{var be=G(),_e=L.S;_e!==null&&_e(fe,be),typeof be=="object"&&be!==null&&typeof be.then=="function"&&be.then(q,je)}catch(me){je(me)}finally{W!==null&&fe.types!==null&&(W.types=fe.types),L.T=W}},lt.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},lt.use=function(G){return L.H.use(G)},lt.useActionState=function(G,W,fe){return L.H.useActionState(G,W,fe)},lt.useCallback=function(G,W){return L.H.useCallback(G,W)},lt.useContext=function(G){return L.H.useContext(G)},lt.useDebugValue=function(){},lt.useDeferredValue=function(G,W){return L.H.useDeferredValue(G,W)},lt.useEffect=function(G,W){return L.H.useEffect(G,W)},lt.useEffectEvent=function(G){return L.H.useEffectEvent(G)},lt.useId=function(){return L.H.useId()},lt.useImperativeHandle=function(G,W,fe){return L.H.useImperativeHandle(G,W,fe)},lt.useInsertionEffect=function(G,W){return L.H.useInsertionEffect(G,W)},lt.useLayoutEffect=function(G,W){return L.H.useLayoutEffect(G,W)},lt.useMemo=function(G,W){return L.H.useMemo(G,W)},lt.useOptimistic=function(G,W){return L.H.useOptimistic(G,W)},lt.useReducer=function(G,W,fe){return L.H.useReducer(G,W,fe)},lt.useRef=function(G){return L.H.useRef(G)},lt.useState=function(G){return L.H.useState(G)},lt.useSyncExternalStore=function(G,W,fe){return L.H.useSyncExternalStore(G,W,fe)},lt.useTransition=function(){return L.H.useTransition()},lt.version="19.2.4",lt}var S2;function pl(){return S2||(S2=1,Qy.exports=P7()),Qy.exports}var D=pl();const en=k1(D),Y7=Gb({__proto__:null,default:en},[D]);var Ky={exports:{}},xs={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* react-dom.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 N2;function V7(){if(N2)return xs;N2=1;var t=pl();function e(p){var y="https://react.dev/errors/"+p;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)y+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+p+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function n(){}var s={d:{f:n,r:function(){throw Error(e(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},i=Symbol.for("react.portal");function o(p,y,b){var v=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:v==null?null:""+v,children:p,containerInfo:y,implementation:b}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(p,y){if(p==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return xs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,xs.createPortal=function(p,y){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(e(299));return o(p,y,null,b)},xs.flushSync=function(p){var y=d.T,b=s.p;try{if(d.T=null,s.p=2,p)return p()}finally{d.T=y,s.p=b,s.d.f()}},xs.preconnect=function(p,y){typeof p=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(p,y))},xs.prefetchDNS=function(p){typeof p=="string"&&s.d.D(p)},xs.preinit=function(p,y){if(typeof p=="string"&&y&&typeof y.as=="string"){var b=y.as,v=f(b,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,C=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;b==="style"?s.d.S(p,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:v,integrity:_,fetchPriority:C}):b==="script"&&s.d.X(p,{crossOrigin:v,integrity:_,fetchPriority:C,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},xs.preinitModule=function(p,y){if(typeof p=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var b=f(y.as,y.crossOrigin);s.d.M(p,{crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(p)},xs.preload=function(p,y){if(typeof p=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var b=y.as,v=f(b,y.crossOrigin);s.d.L(p,b,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},xs.preloadModule=function(p,y){if(typeof p=="string")if(y){var b=f(y.as,y.crossOrigin);s.d.m(p,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:b,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(p)},xs.requestFormReset=function(p){s.d.r(p)},xs.unstable_batchedUpdates=function(p,y){return p(y)},xs.useFormState=function(p,y,b){return d.H.useFormState(p,y,b)},xs.useFormStatus=function(){return d.H.useHostTransitionStatus()},xs.version="19.2.4",xs}var _2;function L1(){if(_2)return Ky.exports;_2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Ky.exports=V7(),Ky.exports}var b4=L1();const Q7=k1(b4),K7=Gb({__proto__:null,default:Q7},[b4]);var Xy={exports:{}},Yp={},Fy={exports:{}},Zy={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* scheduler.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 X7(){return j2||(j2=1,(function(t){function e(Y,$){var ae=Y.length;Y.push($);e:for(;0<ae;){var je=ae-1>>>1,he=Y[je];if(0<i(he,$))Y[je]=$,Y[ae]=he,ae=je;else break e}}function n(Y){return Y.length===0?null:Y[0]}function s(Y){if(Y.length===0)return null;var $=Y[0],ae=Y.pop();if(ae!==$){Y[0]=ae;e:for(var je=0,he=Y.length,G=he>>>1;je<G;){var W=2*(je+1)-1,fe=Y[W],be=W+1,_e=Y[be];if(0>i(fe,ae))be<he&&0>i(_e,fe)?(Y[je]=_e,Y[be]=ae,je=be):(Y[je]=fe,Y[W]=ae,je=W);else if(be<he&&0>i(_e,ae))Y[je]=_e,Y[be]=ae,je=be;else break e}}return $}function i(Y,$){var ae=Y.sortIndex-$.sortIndex;return ae!==0?ae:Y.id-$.id}if(t.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;t.unstable_now=function(){return o.now()}}else{var d=Date,f=d.now();t.unstable_now=function(){return d.now()-f}}var p=[],y=[],b=1,v=null,_=3,C=!1,w=!1,T=!1,R=!1,O=typeof setTimeout=="function"?setTimeout:null,M=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function k(Y){for(var $=n(y);$!==null;){if($.callback===null)s(y);else if($.startTime<=Y)s(y),$.sortIndex=$.expirationTime,e(p,$);else break;$=n(y)}}function P(Y){if(T=!1,k(Y),!w)if(n(p)!==null)w=!0,q||(q=!0,ne());else{var $=n(y);$!==null&&ce(P,$.startTime-Y)}}var q=!1,L=-1,U=5,V=-1;function F(){return R?!0:!(t.unstable_now()-V<U)}function re(){if(R=!1,q){var Y=t.unstable_now();V=Y;var $=!0;try{e:{w=!1,T&&(T=!1,M(L),L=-1),C=!0;var ae=_;try{t:{for(k(Y),v=n(p);v!==null&&!(v.expirationTime>Y&&F());){var je=v.callback;if(typeof je=="function"){v.callback=null,_=v.priorityLevel;var he=je(v.expirationTime<=Y);if(Y=t.unstable_now(),typeof he=="function"){v.callback=he,k(Y),$=!0;break t}v===n(p)&&s(p),k(Y)}else s(p);v=n(p)}if(v!==null)$=!0;else{var G=n(y);G!==null&&ce(P,G.startTime-Y),$=!1}}break e}finally{v=null,_=ae,C=!1}$=void 0}}finally{$?ne():q=!1}}}var ne;if(typeof z=="function")ne=function(){z(re)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,ie=J.port2;J.port1.onmessage=re,ne=function(){ie.postMessage(null)}}else ne=function(){O(re,0)};function ce(Y,$){L=O(function(){Y(t.unstable_now())},$)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(Y){Y.callback=null},t.unstable_forceFrameRate=function(Y){0>Y||125<Y?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<Y?Math.floor(1e3/Y):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_next=function(Y){switch(_){case 1:case 2:case 3:var $=3;break;default:$=_}var ae=_;_=$;try{return Y()}finally{_=ae}},t.unstable_requestPaint=function(){R=!0},t.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ae=_;_=Y;try{return $()}finally{_=ae}},t.unstable_scheduleCallback=function(Y,$,ae){var je=t.unstable_now();switch(typeof ae=="object"&&ae!==null?(ae=ae.delay,ae=typeof ae=="number"&&0<ae?je+ae:je):ae=je,Y){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=ae+he,Y={id:b++,callback:$,priorityLevel:Y,startTime:ae,expirationTime:he,sortIndex:-1},ae>je?(Y.sortIndex=ae,e(y,Y),n(p)===null&&Y===n(y)&&(T?(M(L),L=-1):T=!0,ce(P,ae-je))):(Y.sortIndex=he,e(p,Y),w||C||(w=!0,q||(q=!0,ne()))),Y},t.unstable_shouldYield=F,t.unstable_wrapCallback=function(Y){var $=_;return function(){var ae=_;_=$;try{return Y.apply(this,arguments)}finally{_=ae}}}})(Zy)),Zy}var C2;function Pb(){return C2||(C2=1,Fy.exports=X7()),Fy.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 w2;function F7(){if(w2)return Yp;w2=1;var t=Pb(),e=pl(),n=L1();function s(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)r+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function o(a){var r=a,u=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(u=r.return),a=r.return;while(a)}return r.tag===3?u:null}function d(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function f(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function p(a){if(o(a)!==a)throw Error(s(188))}function y(a){var r=a.alternate;if(!r){if(r=o(a),r===null)throw Error(s(188));return r!==a?null:a}for(var u=a,m=r;;){var S=u.return;if(S===null)break;var N=S.alternate;if(N===null){if(m=S.return,m!==null){u=m;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===u)return p(S),a;if(N===m)return p(S),r;N=N.sibling}throw Error(s(188))}if(u.return!==m.return)u=S,m=N;else{for(var A=!1,B=S.child;B;){if(B===u){A=!0,u=S,m=N;break}if(B===m){A=!0,m=S,u=N;break}B=B.sibling}if(!A){for(B=N.child;B;){if(B===u){A=!0,u=N,m=S;break}if(B===m){A=!0,m=N,u=S;break}B=B.sibling}if(!A)throw Error(s(189))}}if(u.alternate!==m)throw Error(s(190))}if(u.tag!==3)throw Error(s(188));return u.stateNode.current===u?a:r}function b(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=b(a),r!==null)return r;a=a.sibling}return null}var v=Object.assign,_=Symbol.for("react.element"),C=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),T=Symbol.for("react.fragment"),R=Symbol.for("react.strict_mode"),O=Symbol.for("react.profiler"),M=Symbol.for("react.consumer"),z=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),U=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),F=Symbol.for("react.memo_cache_sentinel"),re=Symbol.iterator;function ne(a){return a===null||typeof a!="object"?null:(a=re&&a[re]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function ie(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===J?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case T:return"Fragment";case O:return"Profiler";case R:return"StrictMode";case P:return"Suspense";case q:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case z:return a.displayName||"Context";case M:return(a._context.displayName||"Context")+".Consumer";case k:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case L:return r=a.displayName||null,r!==null?r:ie(a.type)||"Memo";case U:r=a._payload,a=a._init;try{return ie(a(r))}catch{}}return null}var ce=Array.isArray,Y=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae={pending:!1,data:null,method:null,action:null},je=[],he=-1;function G(a){return{current:a}}function W(a){0>he||(a.current=je[he],je[he]=null,he--)}function fe(a,r){he++,je[he]=a.current,a.current=r}var be=G(null),_e=G(null),me=G(null),we=G(null);function nt(a,r){switch(fe(me,r),fe(_e,a),fe(be,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?Bv(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=Bv(r),a=Gv(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}W(be),fe(be,a)}function ze(){W(be),W(_e),W(me)}function Vt(a){a.memoizedState!==null&&fe(we,a);var r=be.current,u=Gv(r,a.type);r!==u&&(fe(_e,a),fe(be,u))}function $e(a){_e.current===a&&(W(be),W(_e)),we.current===a&&(W(we),Up._currentValue=ae)}var Mt,Ht;function En(a){if(Mt===void 0)try{throw Error()}catch(u){var r=u.stack.trim().match(/\n( *(at )?)/);Mt=r&&r[1]||"",Ht=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+Mt+a+Ht}var Kn=!1;function Gt(a,r){if(!a||Kn)return"";Kn=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(r){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(ye){var de=ye}Reflect.construct(a,[],Se)}else{try{Se.call()}catch(ye){de=ye}a.call(Se.prototype)}}else{try{throw Error()}catch(ye){de=ye}(Se=a())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(ye){if(ye&&de&&typeof ye.stack=="string")return[ye.stack,de.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=m.DetermineComponentFrameRoot(),A=N[0],B=N[1];if(A&&B){var X=A.split(`
|
|
44
|
-
`),oe=B.split(`
|
|
45
|
-
`);for(S=m=0;m<X.length&&!X[m].includes("DetermineComponentFrameRoot");)m++;for(;S<oe.length&&!oe[S].includes("DetermineComponentFrameRoot");)S++;if(m===X.length||S===oe.length)for(m=X.length-1,S=oe.length-1;1<=m&&0<=S&&X[m]!==oe[S];)S--;for(;1<=m&&0<=S;m--,S--)if(X[m]!==oe[S]){if(m!==1||S!==1)do if(m--,S--,0>S||X[m]!==oe[S]){var xe=`
|
|
46
|
-
`+X[m].replace(" at new "," at ");return a.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",a.displayName)),xe}while(1<=m&&0<=S);break}}}finally{Kn=!1,Error.prepareStackTrace=u}return(u=a?a.displayName||a.name:"")?En(u):""}function fn(a,r){switch(a.tag){case 26:case 27:case 5:return En(a.type);case 16:return En("Lazy");case 13:return a.child!==r&&r!==null?En("Suspense Fallback"):En("Suspense");case 19:return En("SuspenseList");case 0:case 15:return Gt(a.type,!1);case 11:return Gt(a.type.render,!1);case 1:return Gt(a.type,!0);case 31:return En("Activity");default:return""}}function ur(a){try{var r="",u=null;do r+=fn(a,u),u=a,a=a.return;while(a);return r}catch(m){return`
|
|
47
|
-
Error generating stack: `+m.message+`
|
|
48
|
-
`+m.stack}}var Zt=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,qn=t.unstable_cancelCallback,hn=t.unstable_shouldYield,It=t.unstable_requestPaint,Xn=t.unstable_now,Ss=t.unstable_getCurrentPriorityLevel,dr=t.unstable_ImmediatePriority,Qa=t.unstable_UserBlockingPriority,la=t.unstable_NormalPriority,Ea=t.unstable_LowPriority,rs=t.unstable_IdlePriority,fr=t.log,Ns=t.unstable_setDisableYieldValue,Hs=null,ta=null;function is(a){if(typeof fr=="function"&&Ns(a),ta&&typeof ta.setStrictMode=="function")try{ta.setStrictMode(Hs,a)}catch{}}var ba=Math.clz32?Math.clz32:Sl,Ta=Math.log,Pc=Math.LN2;function Sl(a){return a>>>=0,a===0?32:31-(Ta(a)/Pc|0)|0}var _s=256,hr=262144,yt=4194304;function mt(a){var r=a&42;if(r!==0)return r;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 Qt(a,r,u){var m=a.pendingLanes;if(m===0)return 0;var S=0,N=a.suspendedLanes,A=a.pingedLanes;a=a.warmLanes;var B=m&134217727;return B!==0?(m=B&~N,m!==0?S=mt(m):(A&=B,A!==0?S=mt(A):u||(u=B&~a,u!==0&&(S=mt(u))))):(B=m&~N,B!==0?S=mt(B):A!==0?S=mt(A):u||(u=m&~a,u!==0&&(S=mt(u)))),S===0?0:r!==0&&r!==S&&(r&N)===0&&(N=S&-S,u=r&-r,N>=u||N===32&&(u&4194048)!==0)?r:S}function At(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function Hn(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+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 r+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 rn(){var a=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),a}function Fn(a){for(var r=[],u=0;31>u;u++)r.push(a);return r}function yn(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Ra(a,r,u,m,S,N){var A=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 B=a.entanglements,X=a.expirationTimes,oe=a.hiddenUpdates;for(u=A&~u;0<u;){var xe=31-ba(u),Se=1<<xe;B[xe]=0,X[xe]=-1;var de=oe[xe];if(de!==null)for(oe[xe]=null,xe=0;xe<de.length;xe++){var ye=de[xe];ye!==null&&(ye.lane&=-536870913)}u&=~Se}m!==0&&oa(a,m,0),N!==0&&S===0&&a.tag!==0&&(a.suspendedLanes|=N&~(A&~r))}function oa(a,r,u){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-ba(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|u&261930}function ls(a,r){var u=a.entangledLanes|=r;for(a=a.entanglements;u;){var m=31-ba(u),S=1<<m;S&r|a[m]&r&&(a[m]|=r),u&=~S}}function Bs(a,r){var u=r&-r;return u=(u&42)!==0?1:Ue(u),(u&(a.suspendedLanes|r))!==0?0:u}function Ue(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 et(a){return a&=-a,2<a?8<a?(a&134217727)!==0?32:268435456:8:2}function Ve(){var a=$.p;return a!==0?a:(a=window.event,a===void 0?32:u2(a.type))}function ct(a,r){var u=$.p;try{return $.p=a,r()}finally{$.p=u}}var xt=Math.random().toString(36).slice(2),Fe="__reactFiber$"+xt,ut="__reactProps$"+xt,sn="__reactContainer$"+xt,Tt="__reactEvents$"+xt,pn="__reactListeners$"+xt,Rr="__reactHandles$"+xt,os="__reactResources$"+xt,Ka="__reactMarker$"+xt;function Gs(a){delete a[Fe],delete a[ut],delete a[Tt],delete a[pn],delete a[Rr]}function Pt(a){var r=a[Fe];if(r)return r;for(var u=a.parentNode;u;){if(r=u[sn]||u[Fe]){if(u=r.alternate,r.child!==null||u!==null&&u.child!==null)for(a=Fv(a);a!==null;){if(u=a[Fe])return u;a=Fv(a)}return r}a=u,u=a.parentNode}return null}function pr(a){if(a=a[Fe]||a[sn]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function mr(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(s(33))}function js(a){var r=a[os];return r||(r=a[os]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Tn(a){a[Ka]=!0}var Cs=new Set,ud={};function Mi(a,r){ws(a,r),ws(a+"Capture",r)}function ws(a,r){for(ud[a]=r,a=0;a<r.length;a++)Cs.add(r[a])}var Es=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]*$"),Yc={},Rn={};function hh(a){return Zt.call(Rn,a)?!0:Zt.call(Yc,a)?!1:Es.test(a)?Rn[a]=!0:(Yc[a]=!0,!1)}function xo(a,r,u){if(hh(r))if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+u)}}function Vc(a,r,u){if(u===null)a.removeAttribute(r);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+u)}}function Or(a,r,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(r,u,""+m)}}function Ps(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function dd(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function ph(a,r,u){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var S=m.get,N=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return S.call(this)},set:function(A){u=""+A,N.call(this,A)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Qc(a){if(!a._valueTracker){var r=dd(a)?"checked":"value";a._valueTracker=ph(a,r,""+a[r])}}function qa(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var u=r.getValue(),m="";return a&&(m=dd(a)?a.checked?"true":"false":a.value),a=m,a!==u?(r.setValue(a),!0):!1}function xn(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 fd=/[\n"\\]/g;function Ha(a){return a.replace(fd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function bo(a,r,u,m,S,N,A,B){a.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?a.type=A:a.removeAttribute("type"),r!=null?A==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ps(r)):a.value!==""+Ps(r)&&(a.value=""+Ps(r)):A!=="submit"&&A!=="reset"||a.removeAttribute("value"),r!=null?gr(a,A,Ps(r)):u!=null?gr(a,A,Ps(u)):m!=null&&a.removeAttribute("value"),S==null&&N!=null&&(a.defaultChecked=!!N),S!=null&&(a.checked=S&&typeof S!="function"&&typeof S!="symbol"),B!=null&&typeof B!="function"&&typeof B!="symbol"&&typeof B!="boolean"?a.name=""+Ps(B):a.removeAttribute("name")}function hd(a,r,u,m,S,N,A,B){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.type=N),r!=null||u!=null){if(!(N!=="submit"&&N!=="reset"||r!=null)){Qc(a);return}u=u!=null?""+Ps(u):"",r=r!=null?""+Ps(r):u,B||r===a.value||(a.value=r),a.defaultValue=r}m=m??S,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=B?a.checked:!!m,a.defaultChecked=!!m,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(a.name=A),Qc(a)}function gr(a,r,u){r==="number"&&xn(a.ownerDocument)===a||a.defaultValue===""+u||(a.defaultValue=""+u)}function li(a,r,u,m){if(a=a.options,r){r={};for(var S=0;S<u.length;S++)r["$"+u[S]]=!0;for(u=0;u<a.length;u++)S=r.hasOwnProperty("$"+a[u].value),a[u].selected!==S&&(a[u].selected=S),S&&m&&(a[u].defaultSelected=!0)}else{for(u=""+Ps(u),r=null,S=0;S<a.length;S++){if(a[S].value===u){a[S].selected=!0,m&&(a[S].defaultSelected=!0);return}r!==null||a[S].disabled||(r=a[S])}r!==null&&(r.selected=!0)}}function pd(a,r,u){if(r!=null&&(r=""+Ps(r),r!==a.value&&(a.value=r),u==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=u!=null?""+Ps(u):""}function md(a,r,u,m){if(r==null){if(m!=null){if(u!=null)throw Error(s(92));if(ce(m)){if(1<m.length)throw Error(s(93));m=m[0]}u=m}u==null&&(u=""),r=u}u=Ps(r),a.defaultValue=u,m=a.textContent,m===u&&m!==""&&m!==null&&(a.value=m),Qc(a)}function Nl(a,r){if(r){var u=a.firstChild;if(u&&u===a.lastChild&&u.nodeType===3){u.nodeValue=r;return}}a.textContent=r}var $m=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 mh(a,r,u){var m=r.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,u):typeof u!="number"||u===0||$m.has(r)?r==="float"?a.cssFloat=u:a[r]=(""+u).trim():a[r]=u+"px"}function gh(a,r,u){if(r!=null&&typeof r!="object")throw Error(s(62));if(a=a.style,u!=null){for(var m in u)!u.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var S in r)m=r[S],r.hasOwnProperty(S)&&u[S]!==m&&mh(a,S,m)}else for(var N in r)r.hasOwnProperty(N)&&mh(a,N,r[N])}function gd(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 eg=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"]]),yh=/^[\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 Kc(a){return yh.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function oi(){}var yd=null;function xd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var _l=null,Ai=null;function xh(a){var r=pr(a);if(r&&(a=r.stateNode)){var u=a[ut]||null;e:switch(a=r.stateNode,r.type){case"input":if(bo(a,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),r=u.name,u.type==="radio"&&r!=null){for(u=a;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+Ha(""+r)+'"][type="radio"]'),r=0;r<u.length;r++){var m=u[r];if(m!==a&&m.form===a.form){var S=m[ut]||null;if(!S)throw Error(s(90));bo(m,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<u.length;r++)m=u[r],m.form===a.form&&qa(m)}break e;case"textarea":pd(a,u.value,u.defaultValue);break e;case"select":r=u.value,r!=null&&li(a,!!u.multiple,r,!1)}}}var bd=!1;function bh(a,r,u){if(bd)return a(r,u);bd=!0;try{var m=a(r);return m}finally{if(bd=!1,(_l!==null||Ai!==null)&&(Sr(),_l&&(r=_l,a=Ai,Ai=_l=null,xh(r),a)))for(r=0;r<a.length;r++)xh(a[r])}}function vo(a,r){var u=a.stateNode;if(u===null)return null;var m=u[ut]||null;if(m===null)return null;u=m[r];e:switch(r){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(s(231,r,typeof u));return u}var Mr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),vh=!1;if(Mr)try{var So={};Object.defineProperty(So,"passive",{get:function(){vh=!0}}),window.addEventListener("test",So,So),window.removeEventListener("test",So,So)}catch{vh=!1}var Ts=null,vd=null,jl=null;function Xc(){if(jl)return jl;var a,r=vd,u=r.length,m,S="value"in Ts?Ts.value:Ts.textContent,N=S.length;for(a=0;a<u&&r[a]===S[a];a++);var A=u-a;for(m=1;m<=A&&r[u-m]===S[N-m];m++);return jl=S.slice(a,1<m?1-m:void 0)}function Fc(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function No(){return!0}function tg(){return!1}function Xa(a){function r(u,m,S,N,A){this._reactName=u,this._targetInst=S,this.type=m,this.nativeEvent=N,this.target=A,this.currentTarget=null;for(var B in a)a.hasOwnProperty(B)&&(u=a[B],this[B]=u?u(N):N[B]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?No:tg,this.isPropagationStopped=tg,this}return v(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=No)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=No)},persist:function(){},isPersistent:No}),r}var Di={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zc=Xa(Di),_o=v({},Di,{view:0,detail:0}),ng=Xa(_o),Ic,Sd,jo,Co=v({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Cd,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!==jo&&(jo&&a.type==="mousemove"?(Ic=a.screenX-jo.screenX,Sd=a.screenY-jo.screenY):Sd=Ic=0,jo=a),Ic)},movementY:function(a){return"movementY"in a?a.movementY:Sd}}),Sh=Xa(Co),ag=v({},Co,{dataTransfer:0}),sg=Xa(ag),Nh=v({},_o,{relatedTarget:0}),Nd=Xa(Nh),rg=v({},Di,{animationName:0,elapsedTime:0,pseudoElement:0}),cy=Xa(rg),uy=v({},Di,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),ig=Xa(uy),Jc=v({},Di,{data:0}),_d=Xa(Jc),jd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},lg={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"},og={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function _h(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=og[a])?!!r[a]:!1}function Cd(){return _h}var cg=v({},_o,{key:function(a){if(a.key){var r=jd[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Fc(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?lg[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Cd,charCode:function(a){return a.type==="keypress"?Fc(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Fc(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),Cl=Xa(cg),wd=v({},Co,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Xa(wd),Ch=v({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Cd}),ug=Xa(Ch),dg=v({},Di,{propertyName:0,elapsedTime:0,pseudoElement:0}),dy=Xa(dg),Oa=v({},Co,{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}),fg=Xa(Oa),hg=v({},Di,{newState:0,oldState:0}),pg=Xa(hg),mg=[9,13,27,32],wl=Mr&&"CompositionEvent"in window,wo=null;Mr&&"documentMode"in document&&(wo=document.documentMode);var Ed=Mr&&"TextEvent"in window&&!wo,wh=Mr&&(!wl||wo&&8<wo&&11>=wo),gg=" ",Wc=!1;function Td(a,r){switch(a){case"keyup":return mg.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Eh(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var El=!1;function yg(a,r){switch(a){case"compositionend":return Eh(r);case"keypress":return r.which!==32?null:(Wc=!0,gg);case"textInput":return a=r.data,a===gg&&Wc?null:a;default:return null}}function Th(a,r){if(El)return a==="compositionend"||!wl&&Td(a,r)?(a=Xc(),jl=vd=Ts=null,El=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return wh&&r.locale!=="ko"?null:r.data;default:return null}}var Rh={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 Oh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Rh[a.type]:r==="textarea"}function Rd(a,r,u,m){_l?Ai?Ai.push(m):Ai=[m]:_l=m,r=N0(r,"onChange"),0<r.length&&(u=new Zc("onChange","change",null,u,m),a.push({event:u,listeners:r}))}var zi=null,Tl=null;function xg(a){zv(a,0)}function Eo(a){var r=mr(a);if(qa(r))return a}function Mh(a,r){if(a==="change")return r}var Ar=!1;if(Mr){var $c;if(Mr){var Ah="oninput"in document;if(!Ah){var Dh=document.createElement("div");Dh.setAttribute("oninput","return;"),Ah=typeof Dh.oninput=="function"}$c=Ah}else $c=!1;Ar=$c&&(!document.documentMode||9<document.documentMode)}function Ys(){zi&&(zi.detachEvent("onpropertychange",eu),Tl=zi=null)}function eu(a){if(a.propertyName==="value"&&Eo(Tl)){var r=[];Rd(r,Tl,a,xd(a)),bh(xg,r)}}function bg(a,r,u){a==="focusin"?(Ys(),zi=r,Tl=u,zi.attachEvent("onpropertychange",eu)):a==="focusout"&&Ys()}function zh(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Eo(Tl)}function vg(a,r){if(a==="click")return Eo(r)}function Sg(a,r){if(a==="input"||a==="change")return Eo(r)}function kh(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Fa=typeof Object.is=="function"?Object.is:kh;function To(a,r){if(Fa(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var u=Object.keys(a),m=Object.keys(r);if(u.length!==m.length)return!1;for(m=0;m<u.length;m++){var S=u[m];if(!Zt.call(r,S)||!Fa(a[S],r[S]))return!1}return!0}function tu(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Ro(a,r){var u=tu(a);a=0;for(var m;u;){if(u.nodeType===3){if(m=a+u.textContent.length,a<=r&&m>=r)return{node:u,offset:r-a};a=m}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=tu(u)}}function ln(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?ln(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Ng(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=xn(a.document);r instanceof a.HTMLIFrameElement;){try{var u=typeof r.contentWindow.location.href=="string"}catch{u=!1}if(u)a=r.contentWindow;else break;r=xn(a.document)}return r}function Lh(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var _g=Mr&&"documentMode"in document&&11>=document.documentMode,Dr=null,zr=null,Oo=null,Od=!1;function Mo(a,r,u){var m=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Od||Dr==null||Dr!==xn(m)||(m=Dr,"selectionStart"in m&&Lh(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}),Oo&&To(Oo,m)||(Oo=m,m=N0(zr,"onSelect"),0<m.length&&(r=new Zc("onSelect","select",null,r,u),a.push({event:r,listeners:m}),r.target=Dr)))}function Ba(a,r){var u={};return u[a.toLowerCase()]=r.toLowerCase(),u["Webkit"+a]="webkit"+r,u["Moz"+a]="moz"+r,u}var Rl={animationend:Ba("Animation","AnimationEnd"),animationiteration:Ba("Animation","AnimationIteration"),animationstart:Ba("Animation","AnimationStart"),transitionrun:Ba("Transition","TransitionRun"),transitionstart:Ba("Transition","TransitionStart"),transitioncancel:Ba("Transition","TransitionCancel"),transitionend:Ba("Transition","TransitionEnd")},nu={},Uh={};Mr&&(Uh=document.createElement("div").style,"AnimationEvent"in window||(delete Rl.animationend.animation,delete Rl.animationiteration.animation,delete Rl.animationstart.animation),"TransitionEvent"in window||delete Rl.transitionend.transition);function ci(a){if(nu[a])return nu[a];if(!Rl[a])return a;var r=Rl[a],u;for(u in r)if(r.hasOwnProperty(u)&&u in Uh)return nu[a]=r[u];return a}var Md=ci("animationend"),au=ci("animationiteration"),qh=ci("animationstart"),jg=ci("transitionrun"),fy=ci("transitionstart"),Cg=ci("transitioncancel"),Hh=ci("transitionend"),Vs=new Map,su="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(" ");su.push("scrollEnd");function Qs(a,r){Vs.set(a,r),Mi(r,[a])}var ru=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=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(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},Ks=[],ui=0,va=0;function iu(){for(var a=ui,r=va=ui=0;r<a;){var u=Ks[r];Ks[r++]=null;var m=Ks[r];Ks[r++]=null;var S=Ks[r];Ks[r++]=null;var N=Ks[r];if(Ks[r++]=null,m!==null&&S!==null){var A=m.pending;A===null?S.next=S:(S.next=A.next,A.next=S),m.pending=S}N!==0&&ki(u,S,N)}}function Sa(a,r,u,m){Ks[ui++]=a,Ks[ui++]=r,Ks[ui++]=u,Ks[ui++]=m,va|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function Ad(a,r,u,m){return Sa(a,r,u,m),Xs(a)}function Za(a,r){return Sa(a,null,null,r),Xs(a)}function ki(a,r,u){a.lanes|=u;var m=a.alternate;m!==null&&(m.lanes|=u);for(var S=!1,N=a.return;N!==null;)N.childLanes|=u,m=N.alternate,m!==null&&(m.childLanes|=u),N.tag===22&&(a=N.stateNode,a===null||a._visibility&1||(S=!0)),a=N,N=N.return;return a.tag===3?(N=a.stateNode,S&&r!==null&&(S=31-ba(u),a=N.hiddenUpdates,m=a[S],m===null?a[S]=[r]:m.push(r),r.lane=u|536870912),N):null}function Xs(a){if(50<el)throw el=0,Fl=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Li={};function Bh(a,r,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=r,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 On(a,r,u,m){return new Bh(a,r,u,m)}function Dd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function cs(a,r){var u=a.alternate;return u===null?(u=On(a.tag,r,a.key,a.mode),u.elementType=a.elementType,u.type=a.type,u.stateNode=a.stateNode,u.alternate=a,a.alternate=u):(u.pendingProps=r,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,r=a.dependencies,u.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},u.sibling=a.sibling,u.index=a.index,u.ref=a.ref,u.refCleanup=a.refCleanup,u}function Ao(a,r){a.flags&=65011714;var u=a.alternate;return u===null?(a.childLanes=0,a.lanes=r,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,r=u.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function kr(a,r,u,m,S,N){var A=0;if(m=a,typeof a=="function")Dd(a)&&(A=1);else if(typeof a=="string")A=w7(a,u,be.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=On(31,u,r,S),a.elementType=V,a.lanes=N,a;case T:return Ui(u.children,S,N,r);case R:A=8,S|=24;break;case O:return a=On(12,u,r,S|2),a.elementType=O,a.lanes=N,a;case P:return a=On(13,u,r,S),a.elementType=P,a.lanes=N,a;case q:return a=On(19,u,r,S),a.elementType=q,a.lanes=N,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:A=10;break e;case M:A=9;break e;case k:A=11;break e;case L:A=14;break e;case U:A=16,m=null;break e}A=29,u=Error(s(130,a===null?"null":typeof a,"")),m=null}return r=On(A,u,r,S),r.elementType=a,r.type=m,r.lanes=N,r}function Ui(a,r,u,m){return a=On(7,a,m,r),a.lanes=u,a}function zd(a,r,u){return a=On(6,a,null,r),a.lanes=u,a}function Do(a){var r=On(18,null,null,0);return r.stateNode=a,r}function kd(a,r,u){return r=On(4,a.children!==null?a.children:[],a.key,r),r.lanes=u,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var lu=new WeakMap;function Rs(a,r){if(typeof a=="object"&&a!==null){var u=lu.get(a);return u!==void 0?u:(r={value:a,source:r,stack:ur(r)},lu.set(a,r),r)}return{value:a,source:r,stack:ur(r)}}var qi=[],Hi=0,zo=null,ko=0,us=[],bn=0,di=null,Mn=1,yr="";function Lr(a,r){qi[Hi++]=ko,qi[Hi++]=zo,zo=a,ko=r}function wg(a,r,u){us[bn++]=Mn,us[bn++]=yr,us[bn++]=di,di=a;var m=Mn;a=yr;var S=32-ba(m)-1;m&=~(1<<S),u+=1;var N=32-ba(r)+S;if(30<N){var A=S-S%5;N=(m&(1<<A)-1).toString(32),m>>=A,S-=A,Mn=1<<32-ba(r)+S|u<<S|m,yr=N+a}else Mn=1<<N|u<<S|m,yr=a}function Ur(a){a.return!==null&&(Lr(a,1),wg(a,1,0))}function Ld(a){for(;a===zo;)zo=qi[--Hi],qi[Hi]=null,ko=qi[--Hi],qi[Hi]=null;for(;a===di;)di=us[--bn],us[bn]=null,yr=us[--bn],us[bn]=null,Mn=us[--bn],us[bn]=null}function Ud(a,r){us[bn++]=Mn,us[bn++]=yr,us[bn++]=di,Mn=r.id,yr=r.overflow,di=a}var Bn=null,on=null,Ct=!1,fi=null,Os=!1,Lo=Error(s(519));function qr(a){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Hr(Rs(r,a)),Lo}function Eg(a){var r=a.stateNode,u=a.type,m=a.memoizedProps;switch(r[Fe]=a,r[ut]=m,u){case"dialog":Ot("cancel",r),Ot("close",r);break;case"iframe":case"object":case"embed":Ot("load",r);break;case"video":case"audio":for(u=0;u<ir.length;u++)Ot(ir[u],r);break;case"source":Ot("error",r);break;case"img":case"image":case"link":Ot("error",r),Ot("load",r);break;case"details":Ot("toggle",r);break;case"input":Ot("invalid",r),hd(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":Ot("invalid",r);break;case"textarea":Ot("invalid",r),md(r,m.value,m.defaultValue,m.children)}u=m.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||r.textContent===""+u||m.suppressHydrationWarning===!0||qv(r.textContent,u)?(m.popover!=null&&(Ot("beforetoggle",r),Ot("toggle",r)),m.onScroll!=null&&Ot("scroll",r),m.onScrollEnd!=null&&Ot("scrollend",r),m.onClick!=null&&(r.onclick=oi),r=!0):r=!1,r||qr(a,!0)}function Tg(a){for(Bn=a.return;Bn;)switch(Bn.tag){case 5:case 31:case 13:Os=!1;return;case 27:case 3:Os=!0;return;default:Bn=Bn.return}}function Uo(a){if(a!==Bn)return!1;if(!Ct)return Tg(a),Ct=!0,!1;var r=a.tag,u;if((u=r!==3&&r!==27)&&((u=r===5)&&(u=a.type,u=!(u!=="form"&&u!=="button")||Ty(a.type,a.memoizedProps)),u=!u),u&&on&&qr(a),Tg(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Xv(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));on=Xv(a)}else r===27?(r=on,ac(a.type)?(a=Dy,Dy=null,on=a):on=r):on=Bn?$r(a.stateNode.nextSibling):null;return!0}function Bi(){on=Bn=null,Ct=!1}function qd(){var a=fi;return a!==null&&(Pn===null?Pn=a:Pn.push.apply(Pn,a),fi=null),a}function Hr(a){fi===null?fi=[a]:fi.push(a)}var qo=G(null),Gi=null,Br=null;function hi(a,r,u){fe(qo,r._currentValue),r._currentValue=u}function Gr(a){a._currentValue=qo.current,W(qo)}function Hd(a,r,u){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===u)break;a=a.return}}function Bd(a,r,u,m){var S=a.child;for(S!==null&&(S.return=a);S!==null;){var N=S.dependencies;if(N!==null){var A=S.child;N=N.firstContext;e:for(;N!==null;){var B=N;N=S;for(var X=0;X<r.length;X++)if(B.context===r[X]){N.lanes|=u,B=N.alternate,B!==null&&(B.lanes|=u),Hd(N.return,u,a),m||(A=null);break e}N=B.next}}else if(S.tag===18){if(A=S.return,A===null)throw Error(s(341));A.lanes|=u,N=A.alternate,N!==null&&(N.lanes|=u),Hd(A,u,a),A=null}else A=S.child;if(A!==null)A.return=S;else for(A=S;A!==null;){if(A===a){A=null;break}if(S=A.sibling,S!==null){S.return=A.return,A=S;break}A=A.return}S=A}}function Pr(a,r,u,m){a=null;for(var S=r,N=!1;S!==null;){if(!N){if((S.flags&524288)!==0)N=!0;else if((S.flags&262144)!==0)break}if(S.tag===10){var A=S.alternate;if(A===null)throw Error(s(387));if(A=A.memoizedProps,A!==null){var B=S.type;Fa(S.pendingProps.value,A.value)||(a!==null?a.push(B):a=[B])}}else if(S===we.current){if(A=S.alternate,A===null)throw Error(s(387));A.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(a!==null?a.push(Up):a=[Up])}S=S.return}a!==null&&Bd(r,a,u,m),r.flags|=262144}function ou(a){for(a=a.firstContext;a!==null;){if(!Fa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Pi(a){Gi=a,Br=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function We(a){return Rg(Gi,a)}function Ho(a,r){return Gi===null&&Pi(a),Rg(a,r)}function Rg(a,r){var u=r._currentValue;if(r={context:r,memoizedValue:u,next:null},Br===null){if(a===null)throw Error(s(308));Br=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Br=Br.next=r;return u}var Og=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(u,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(u){return u()})}},hy=t.unstable_scheduleCallback,py=t.unstable_NormalPriority,na={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Gh(){return{controller:new Og,data:new Map,refCount:0}}function Ol(a){a.refCount--,a.refCount===0&&hy(py,function(){a.controller.abort()})}var Ms=null,Gd=0,pi=0,Fs=null;function Ph(a,r){if(Ms===null){var u=Ms=[];Gd=0,pi=pe(),Fs={status:"pending",value:void 0,then:function(m){u.push(m)}}}return Gd++,r.then(Yh,Yh),r}function Yh(){if(--Gd===0&&Ms!==null){Fs!==null&&(Fs.status="fulfilled");var a=Ms;Ms=null,pi=0,Fs=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Vh(a,r){var u=[],m={status:"pending",value:null,reason:null,then:function(S){u.push(S)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var S=0;S<u.length;S++)(0,u[S])(r)},function(S){for(m.status="rejected",m.reason=S,S=0;S<u.length;S++)(0,u[S])(void 0)}),m}var Mg=Y.S;Y.S=function(a,r){Mp=Xn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Ph(a,r),Mg!==null&&Mg(a,r)};var Yi=G(null);function Pd(){var a=Yi.current;return a!==null?a:tt.pooledCache}function cu(a,r){r===null?fe(Yi,Yi.current):fe(Yi,r.pool)}function Qh(){var a=Pd();return a===null?null:{parent:na._currentValue,pool:a}}var Ml=Error(s(460)),uu=Error(s(474)),ft=Error(s(542)),Yd={then:function(){}};function ds(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Vd(a,r,u){switch(u=a[u],u===void 0?a.push(r):u!==r&&(r.then(oi,oi),r=u),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,zl(a),a;default:if(typeof r.status=="string")r.then(oi,oi);else{if(a=tt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=m}},function(m){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,zl(a),a}throw Yr=r,Ml}}function Al(a){try{var r=a._init;return r(a._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?(Yr=u,Ml):u}}var Yr=null;function Dl(){if(Yr===null)throw Error(s(459));var a=Yr;return Yr=null,a}function zl(a){if(a===Ml||a===ft)throw Error(s(483))}var kl=null,Ll=0;function du(a){var r=Ll;return Ll+=1,kl===null&&(kl=[]),Vd(kl,a,r)}function Zs(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Bo(a,r){throw r.$$typeof===_?Error(s(525)):(a=Object.prototype.toString.call(r),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function Qd(a){function r(te,I){if(a){var le=te.deletions;le===null?(te.deletions=[I],te.flags|=16):le.push(I)}}function u(te,I){if(!a)return null;for(;I!==null;)r(te,I),I=I.sibling;return null}function m(te){for(var I=new Map;te!==null;)te.key!==null?I.set(te.key,te):I.set(te.index,te),te=te.sibling;return I}function S(te,I){return te=cs(te,I),te.index=0,te.sibling=null,te}function N(te,I,le){return te.index=le,a?(le=te.alternate,le!==null?(le=le.index,le<I?(te.flags|=67108866,I):le):(te.flags|=67108866,I)):(te.flags|=1048576,I)}function A(te){return a&&te.alternate===null&&(te.flags|=67108866),te}function B(te,I,le,ve){return I===null||I.tag!==6?(I=zd(le,te.mode,ve),I.return=te,I):(I=S(I,le),I.return=te,I)}function X(te,I,le,ve){var Ke=le.type;return Ke===T?xe(te,I,le.props.children,ve,le.key):I!==null&&(I.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===U&&Al(Ke)===I.type)?(I=S(I,le.props),Zs(I,le),I.return=te,I):(I=kr(le.type,le.key,le.props,null,te.mode,ve),Zs(I,le),I.return=te,I)}function oe(te,I,le,ve){return I===null||I.tag!==4||I.stateNode.containerInfo!==le.containerInfo||I.stateNode.implementation!==le.implementation?(I=kd(le,te.mode,ve),I.return=te,I):(I=S(I,le.children||[]),I.return=te,I)}function xe(te,I,le,ve,Ke){return I===null||I.tag!==7?(I=Ui(le,te.mode,ve,Ke),I.return=te,I):(I=S(I,le),I.return=te,I)}function Se(te,I,le){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=zd(""+I,te.mode,le),I.return=te,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case C:return le=kr(I.type,I.key,I.props,null,te.mode,le),Zs(le,I),le.return=te,le;case w:return I=kd(I,te.mode,le),I.return=te,I;case U:return I=Al(I),Se(te,I,le)}if(ce(I)||ne(I))return I=Ui(I,te.mode,le,null),I.return=te,I;if(typeof I.then=="function")return Se(te,du(I),le);if(I.$$typeof===z)return Se(te,Ho(te,I),le);Bo(te,I)}return null}function de(te,I,le,ve){var Ke=I!==null?I.key:null;if(typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint")return Ke!==null?null:B(te,I,""+le,ve);if(typeof le=="object"&&le!==null){switch(le.$$typeof){case C:return le.key===Ke?X(te,I,le,ve):null;case w:return le.key===Ke?oe(te,I,le,ve):null;case U:return le=Al(le),de(te,I,le,ve)}if(ce(le)||ne(le))return Ke!==null?null:xe(te,I,le,ve,null);if(typeof le.then=="function")return de(te,I,du(le),ve);if(le.$$typeof===z)return de(te,I,Ho(te,le),ve);Bo(te,le)}return null}function ye(te,I,le,ve,Ke){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return te=te.get(le)||null,B(I,te,""+ve,Ke);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case C:return te=te.get(ve.key===null?le:ve.key)||null,X(I,te,ve,Ke);case w:return te=te.get(ve.key===null?le:ve.key)||null,oe(I,te,ve,Ke);case U:return ve=Al(ve),ye(te,I,le,ve,Ke)}if(ce(ve)||ne(ve))return te=te.get(le)||null,xe(I,te,ve,Ke,null);if(typeof ve.then=="function")return ye(te,I,le,du(ve),Ke);if(ve.$$typeof===z)return ye(te,I,le,Ho(I,ve),Ke);Bo(I,ve)}return null}function He(te,I,le,ve){for(var Ke=null,Kt=null,Pe=I,gt=I=0,zt=null;Pe!==null&><le.length;gt++){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var Xt=de(te,Pe,le[gt],ve);if(Xt===null){Pe===null&&(Pe=zt);break}a&&Pe&&Xt.alternate===null&&r(te,Pe),I=N(Xt,I,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt,Pe=zt}if(gt===le.length)return u(te,Pe),Ct&&Lr(te,gt),Ke;if(Pe===null){for(;gt<le.length;gt++)Pe=Se(te,le[gt],ve),Pe!==null&&(I=N(Pe,I,gt),Kt===null?Ke=Pe:Kt.sibling=Pe,Kt=Pe);return Ct&&Lr(te,gt),Ke}for(Pe=m(Pe);gt<le.length;gt++)zt=ye(Pe,te,gt,le[gt],ve),zt!==null&&(a&&zt.alternate!==null&&Pe.delete(zt.key===null?gt:zt.key),I=N(zt,I,gt),Kt===null?Ke=zt:Kt.sibling=zt,Kt=zt);return a&&Pe.forEach(function(oc){return r(te,oc)}),Ct&&Lr(te,gt),Ke}function Ie(te,I,le,ve){if(le==null)throw Error(s(151));for(var Ke=null,Kt=null,Pe=I,gt=I=0,zt=null,Xt=le.next();Pe!==null&&!Xt.done;gt++,Xt=le.next()){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var oc=de(te,Pe,Xt.value,ve);if(oc===null){Pe===null&&(Pe=zt);break}a&&Pe&&oc.alternate===null&&r(te,Pe),I=N(oc,I,gt),Kt===null?Ke=oc:Kt.sibling=oc,Kt=oc,Pe=zt}if(Xt.done)return u(te,Pe),Ct&&Lr(te,gt),Ke;if(Pe===null){for(;!Xt.done;gt++,Xt=le.next())Xt=Se(te,Xt.value,ve),Xt!==null&&(I=N(Xt,I,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt);return Ct&&Lr(te,gt),Ke}for(Pe=m(Pe);!Xt.done;gt++,Xt=le.next())Xt=ye(Pe,te,gt,Xt.value,ve),Xt!==null&&(a&&Xt.alternate!==null&&Pe.delete(Xt.key===null?gt:Xt.key),I=N(Xt,I,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt);return a&&Pe.forEach(function(U7){return r(te,U7)}),Ct&&Lr(te,gt),Ke}function dn(te,I,le,ve){if(typeof le=="object"&&le!==null&&le.type===T&&le.key===null&&(le=le.props.children),typeof le=="object"&&le!==null){switch(le.$$typeof){case C:e:{for(var Ke=le.key;I!==null;){if(I.key===Ke){if(Ke=le.type,Ke===T){if(I.tag===7){u(te,I.sibling),ve=S(I,le.props.children),ve.return=te,te=ve;break e}}else if(I.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===U&&Al(Ke)===I.type){u(te,I.sibling),ve=S(I,le.props),Zs(ve,le),ve.return=te,te=ve;break e}u(te,I);break}else r(te,I);I=I.sibling}le.type===T?(ve=Ui(le.props.children,te.mode,ve,le.key),ve.return=te,te=ve):(ve=kr(le.type,le.key,le.props,null,te.mode,ve),Zs(ve,le),ve.return=te,te=ve)}return A(te);case w:e:{for(Ke=le.key;I!==null;){if(I.key===Ke)if(I.tag===4&&I.stateNode.containerInfo===le.containerInfo&&I.stateNode.implementation===le.implementation){u(te,I.sibling),ve=S(I,le.children||[]),ve.return=te,te=ve;break e}else{u(te,I);break}else r(te,I);I=I.sibling}ve=kd(le,te.mode,ve),ve.return=te,te=ve}return A(te);case U:return le=Al(le),dn(te,I,le,ve)}if(ce(le))return He(te,I,le,ve);if(ne(le)){if(Ke=ne(le),typeof Ke!="function")throw Error(s(150));return le=Ke.call(le),Ie(te,I,le,ve)}if(typeof le.then=="function")return dn(te,I,du(le),ve);if(le.$$typeof===z)return dn(te,I,Ho(te,le),ve);Bo(te,le)}return typeof le=="string"&&le!==""||typeof le=="number"||typeof le=="bigint"?(le=""+le,I!==null&&I.tag===6?(u(te,I.sibling),ve=S(I,le),ve.return=te,te=ve):(u(te,I),ve=zd(le,te.mode,ve),ve.return=te,te=ve),A(te)):u(te,I)}return function(te,I,le,ve){try{Ll=0;var Ke=dn(te,I,le,ve);return kl=null,Ke}catch(Pe){if(Pe===Ml||Pe===ft)throw Pe;var Kt=On(29,Pe,null,te.mode);return Kt.lanes=ve,Kt.return=te,Kt}finally{}}}var mi=Qd(!0),Kd=Qd(!1),Ia=!1;function fu(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Kh(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function gi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Vi(a,r,u){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,(Ye&2)!==0){var S=m.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),m.pending=r,r=Xs(a),ki(a,null,u),r}return Sa(a,m,r,u),Xs(a)}function Qi(a,r,u){if(r=r.updateQueue,r!==null&&(r=r.shared,(u&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,u|=m,r.lanes=u,ls(a,u)}}function Qe(a,r){var u=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,u===m)){var S=null,N=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};N===null?S=N=A:N=N.next=A,u=u.next}while(u!==null);N===null?S=N=r:N=N.next=r}else S=N=r;u={baseState:m.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:m.shared,callbacks:m.callbacks},a.updateQueue=u;return}a=u.lastBaseUpdate,a===null?u.firstBaseUpdate=r:a.next=r,u.lastBaseUpdate=r}var Xh=!1;function hu(){if(Xh){var a=Fs;if(a!==null)throw a}}function Go(a,r,u,m){Xh=!1;var S=a.updateQueue;Ia=!1;var N=S.firstBaseUpdate,A=S.lastBaseUpdate,B=S.shared.pending;if(B!==null){S.shared.pending=null;var X=B,oe=X.next;X.next=null,A===null?N=oe:A.next=oe,A=X;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,B=xe.lastBaseUpdate,B!==A&&(B===null?xe.firstBaseUpdate=oe:B.next=oe,xe.lastBaseUpdate=X))}if(N!==null){var Se=S.baseState;A=0,xe=oe=X=null,B=N;do{var de=B.lane&-536870913,ye=de!==B.lane;if(ye?(dt&de)===de:(m&de)===de){de!==0&&de===pi&&(Xh=!0),xe!==null&&(xe=xe.next={lane:0,tag:B.tag,payload:B.payload,callback:null,next:null});e:{var He=a,Ie=B;de=r;var dn=u;switch(Ie.tag){case 1:if(He=Ie.payload,typeof He=="function"){Se=He.call(dn,Se,de);break e}Se=He;break e;case 3:He.flags=He.flags&-65537|128;case 0:if(He=Ie.payload,de=typeof He=="function"?He.call(dn,Se,de):He,de==null)break e;Se=v({},Se,de);break e;case 2:Ia=!0}}de=B.callback,de!==null&&(a.flags|=64,ye&&(a.flags|=8192),ye=S.callbacks,ye===null?S.callbacks=[de]:ye.push(de))}else ye={lane:de,tag:B.tag,payload:B.payload,callback:B.callback,next:null},xe===null?(oe=xe=ye,X=Se):xe=xe.next=ye,A|=de;if(B=B.next,B===null){if(B=S.shared.pending,B===null)break;ye=B,B=ye.next,ye.next=null,S.lastBaseUpdate=ye,S.shared.pending=null}}while(!0);xe===null&&(X=Se),S.baseState=X,S.firstBaseUpdate=oe,S.lastBaseUpdate=xe,N===null&&(S.shared.lanes=0),Ir|=A,a.lanes=A,a.memoizedState=Se}}function Po(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Ag(a,r){var u=a.callbacks;if(u!==null)for(a.callbacks=null,a=0;a<u.length;a++)Po(u[a],r)}var Yo=G(null),Xd=G(0);function Dg(a,r){a=ks,fe(Xd,a),fe(Yo,r),ks=a|r.baseLanes}function Fh(){fe(Xd,ks),fe(Yo,Yo.current)}function pu(){ks=Xd.current,W(Yo),W(Xd)}var fs=G(null),Ja=null;function yi(a){var r=a.alternate;fe(wt,wt.current&1),fe(fs,a),Ja===null&&(r===null||Yo.current!==null||r.memoizedState!==null)&&(Ja=a)}function Zh(a){fe(wt,wt.current),fe(fs,a),Ja===null&&(Ja=a)}function zg(a){a.tag===22?(fe(wt,wt.current),fe(fs,a),Ja===null&&(Ja=a)):hs()}function hs(){fe(wt,wt.current),fe(fs,fs.current)}function Zn(a){W(fs),Ja===a&&(Ja=null),W(wt)}var wt=G(0);function As(a){for(var r=a;r!==null;){if(r.tag===13){var u=r.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||My(u)||Ay(u)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var vn=0,rt=null,tn=null,St=null,Is=!1,Vo=!1,Ul=!1,Fd=0,mu=0,Qo=null,Ih=0;function An(){throw Error(s(321))}function Jh(a,r){if(r===null)return!1;for(var u=0;u<r.length&&u<a.length;u++)if(!Fa(a[u],r[u]))return!1;return!0}function Zd(a,r,u,m,S,N){return vn=N,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Y.H=a===null||a.memoizedState===null?f0:yp,Ul=!1,N=u(m,S),Ul=!1,Vo&&(N=ql(r,u,m,S)),kg(a),N}function kg(a){Y.H=Ko;var r=tn!==null&&tn.next!==null;if(vn=0,St=tn=rt=null,Is=!1,mu=0,Qo=null,r)throw Error(s(300));a===null||aa||(a=a.dependencies,a!==null&&ou(a)&&(aa=!0))}function ql(a,r,u,m){rt=a;var S=0;do{if(Vo&&(Qo=null),mu=0,Vo=!1,25<=S)throw Error(s(301));if(S+=1,St=tn=null,a.updateQueue!=null){var N=a.updateQueue;N.lastEffect=null,N.events=null,N.stores=null,N.memoCache!=null&&(N.memoCache.index=0)}Y.H=Js,N=r(u,m)}while(Vo);return N}function Hl(){var a=Y.H,r=a.useState()[0];return r=typeof r.then=="function"?gu(r):r,a=a.useState()[0],(tn!==null?tn.memoizedState:null)!==a&&(rt.flags|=1024),r}function Wh(){var a=Fd!==0;return Fd=0,a}function $h(a,r,u){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~u}function ep(a){if(Is){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Is=!1}vn=0,St=tn=rt=null,Vo=!1,mu=Fd=0,Qo=null}function ca(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return St===null?rt.memoizedState=St=a:St=St.next=a,St}function In(){if(tn===null){var a=rt.alternate;a=a!==null?a.memoizedState:null}else a=tn.next;var r=St===null?rt.memoizedState:St.next;if(r!==null)St=r,tn=a;else{if(a===null)throw rt.alternate===null?Error(s(467)):Error(s(310));tn=a,a={memoizedState:tn.memoizedState,baseState:tn.baseState,baseQueue:tn.baseQueue,queue:tn.queue,next:null},St===null?rt.memoizedState=St=a:St=St.next=a}return St}function Id(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gu(a){var r=mu;return mu+=1,Qo===null&&(Qo=[]),a=Vd(Qo,a,r),r=rt,(St===null?r.memoizedState:St.next)===null&&(r=r.alternate,Y.H=r===null||r.memoizedState===null?f0:yp),a}function Ki(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gu(a);if(a.$$typeof===z)return We(a)}throw Error(s(438,String(a)))}function tp(a){var r=null,u=rt.updateQueue;if(u!==null&&(r=u.memoCache),r==null){var m=rt.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),u===null&&(u=Id(),rt.updateQueue=u),u.memoCache=r,u=r.data[r.index],u===void 0)for(u=r.data[r.index]=Array(a),m=0;m<a;m++)u[m]=F;return r.index++,u}function xi(a,r){return typeof r=="function"?r(a):r}function Jd(a){var r=In();return np(r,tn,a)}function np(a,r,u){var m=a.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=u;var S=a.baseQueue,N=m.pending;if(N!==null){if(S!==null){var A=S.next;S.next=N.next,N.next=A}r.baseQueue=S=N,m.pending=null}if(N=a.baseState,S===null)a.memoizedState=N;else{r=S.next;var B=A=null,X=null,oe=r,xe=!1;do{var Se=oe.lane&-536870913;if(Se!==oe.lane?(dt&Se)===Se:(vn&Se)===Se){var de=oe.revertLane;if(de===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),Se===pi&&(xe=!0);else if((vn&de)===de){oe=oe.next,de===pi&&(xe=!0);continue}else Se={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(B=X=Se,A=N):X=X.next=Se,rt.lanes|=de,Ir|=de;Se=oe.action,Ul&&u(N,Se),N=oe.hasEagerState?oe.eagerState:u(N,Se)}else de={lane:Se,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(B=X=de,A=N):X=X.next=de,rt.lanes|=Se,Ir|=Se;oe=oe.next}while(oe!==null&&oe!==r);if(X===null?A=N:X.next=B,!Fa(N,a.memoizedState)&&(aa=!0,xe&&(u=Fs,u!==null)))throw u;a.memoizedState=N,a.baseState=A,a.baseQueue=X,m.lastRenderedState=N}return S===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function ap(a){var r=In(),u=r.queue;if(u===null)throw Error(s(311));u.lastRenderedReducer=a;var m=u.dispatch,S=u.pending,N=r.memoizedState;if(S!==null){u.pending=null;var A=S=S.next;do N=a(N,A.action),A=A.next;while(A!==S);Fa(N,r.memoizedState)||(aa=!0),r.memoizedState=N,r.baseQueue===null&&(r.baseState=N),u.lastRenderedState=N}return[N,m]}function Lg(a,r,u){var m=rt,S=In(),N=Ct;if(N){if(u===void 0)throw Error(s(407));u=u()}else u=r();var A=!Fa((tn||S).memoizedState,u);if(A&&(S.memoizedState=u,aa=!0),S=S.queue,dp(Hg.bind(null,m,S,a),[a]),S.getSnapshot!==r||A||St!==null&&St.memoizedState.tag&1){if(m.flags|=2048,Xi(9,{destroy:void 0},qg.bind(null,m,S,u,r),null),tt===null)throw Error(s(349));N||(vn&127)!==0||Ug(m,r,u)}return u}function Ug(a,r,u){a.flags|=16384,a={getSnapshot:r,value:u},r=rt.updateQueue,r===null?(r=Id(),rt.updateQueue=r,r.stores=[a]):(u=r.stores,u===null?r.stores=[a]:u.push(a))}function qg(a,r,u,m){r.value=u,r.getSnapshot=m,Bg(r)&&Gg(a)}function Hg(a,r,u){return u(function(){Bg(r)&&Gg(a)})}function Bg(a){var r=a.getSnapshot;a=a.value;try{var u=r();return!Fa(a,u)}catch{return!0}}function Gg(a){var r=Za(a,2);r!==null&&pt(r,a,2)}function sp(a){var r=ca();if(typeof a=="function"){var u=a;if(a=u(),Ul){is(!0);try{u()}finally{is(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:a},r}function rp(a,r,u,m){return a.baseState=u,np(a,tn,typeof m=="function"?m:xi)}function my(a,r,u,m,S){if(tf(a))throw Error(s(485));if(a=r.action,a!==null){var N={payload:S,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){N.listeners.push(A)}};Y.T!==null?u(!0):N.isTransition=!1,m(N),u=r.pending,u===null?(N.next=r.pending=N,Pg(r,N)):(N.next=u.next,r.pending=u.next=N)}}function Pg(a,r){var u=r.action,m=r.payload,S=a.state;if(r.isTransition){var N=Y.T,A={};Y.T=A;try{var B=u(S,m),X=Y.S;X!==null&&X(A,B),Yg(a,r,B)}catch(oe){ip(a,r,oe)}finally{N!==null&&A.types!==null&&(N.types=A.types),Y.T=N}}else try{N=u(S,m),Yg(a,r,N)}catch(oe){ip(a,r,oe)}}function Yg(a,r,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(m){Vg(a,r,m)},function(m){return ip(a,r,m)}):Vg(a,r,u)}function Vg(a,r,u){r.status="fulfilled",r.value=u,Qg(r),a.state=u,r=a.pending,r!==null&&(u=r.next,u===r?a.pending=null:(u=u.next,r.next=u,Pg(a,u)))}function ip(a,r,u){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=u,Qg(r),r=r.next;while(r!==m)}a.action=null}function Qg(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function lp(a,r){return r}function op(a,r){if(Ct){var u=tt.formState;if(u!==null){e:{var m=rt;if(Ct){if(on){t:{for(var S=on,N=Os;S.nodeType!==8;){if(!N){S=null;break t}if(S=$r(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){on=$r(S.nextSibling),m=S.data==="F!";break e}}qr(m)}m=!1}m&&(r=u[0])}}return u=ca(),u.memoizedState=u.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:lp,lastRenderedState:r},u.queue=m,u=c0.bind(null,rt,m),m.dispatch=u,m=sp(!1),N=gp.bind(null,rt,!1,m.queue),m=ca(),S={state:r,dispatch:null,action:a,pending:null},m.queue=S,u=my.bind(null,rt,S,N,u),S.dispatch=u,m.memoizedState=a,[r,u,!1]}function Kg(a){var r=In();return cp(r,tn,a)}function cp(a,r,u){if(r=np(a,r,lp)[0],a=Jd(xi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=gu(r)}catch(A){throw A===Ml?ft:A}else m=r;r=In();var S=r.queue,N=S.dispatch;return u!==r.memoizedState&&(rt.flags|=2048,Xi(9,{destroy:void 0},Xg.bind(null,S,u),null)),[m,N,a]}function Xg(a,r){a.action=r}function up(a){var r=In(),u=tn;if(u!==null)return cp(r,u,a);In(),r=r.memoizedState,u=In();var m=u.queue.dispatch;return u.memoizedState=a,[r,m,!1]}function Xi(a,r,u,m){return a={tag:a,create:u,deps:m,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Id(),rt.updateQueue=r),u=r.lastEffect,u===null?r.lastEffect=a.next=a:(m=u.next,u.next=a,a.next=m,r.lastEffect=a),a}function Wd(){return In().memoizedState}function $d(a,r,u,m){var S=ca();rt.flags|=a,S.memoizedState=Xi(1|r,{destroy:void 0},u,m===void 0?null:m)}function ef(a,r,u,m){var S=In();m=m===void 0?null:m;var N=S.memoizedState.inst;tn!==null&&m!==null&&Jh(m,tn.memoizedState.deps)?S.memoizedState=Xi(r,N,u,m):(rt.flags|=a,S.memoizedState=Xi(1|r,N,u,m))}function Fg(a,r){$d(8390656,8,a,r)}function dp(a,r){ef(2048,8,a,r)}function Zg(a){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Id(),rt.updateQueue=r,r.events=[a];else{var u=r.events;u===null?r.events=[a]:u.push(a)}}function Ig(a){var r=In().memoizedState;return Zg({ref:r,nextImpl:a}),function(){if((Ye&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Jg(a,r){return ef(4,2,a,r)}function Wg(a,r){return ef(4,4,a,r)}function $g(a,r){if(typeof r=="function"){a=a();var u=r(a);return function(){typeof u=="function"?u():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function e0(a,r,u){u=u!=null?u.concat([a]):null,ef(4,4,$g.bind(null,r,a),u)}function fp(){}function t0(a,r){var u=In();r=r===void 0?null:r;var m=u.memoizedState;return r!==null&&Jh(r,m[1])?m[0]:(u.memoizedState=[a,r],a)}function n0(a,r){var u=In();r=r===void 0?null:r;var m=u.memoizedState;if(r!==null&&Jh(r,m[1]))return m[0];if(m=a(),Ul){is(!0);try{a()}finally{is(!1)}}return u.memoizedState=[m,r],m}function hp(a,r,u){return u===void 0||(vn&1073741824)!==0&&(dt&261930)===0?a.memoizedState=r:(a.memoizedState=u,a=bt(),rt.lanes|=a,Ir|=a,u)}function a0(a,r,u,m){return Fa(u,r)?u:Yo.current!==null?(a=hp(a,u,m),Fa(a,r)||(aa=!0),a):(vn&42)===0||(vn&1073741824)!==0&&(dt&261930)===0?(aa=!0,a.memoizedState=u):(a=bt(),rt.lanes|=a,Ir|=a,r)}function s0(a,r,u,m,S){var N=$.p;$.p=N!==0&&8>N?N:8;var A=Y.T,B={};Y.T=B,gp(a,!1,r,u);try{var X=S(),oe=Y.S;if(oe!==null&&oe(B,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var xe=Vh(X,m);yu(a,r,xe,Us(a))}else yu(a,r,m,Us(a))}catch(Se){yu(a,r,{then:function(){},status:"rejected",reason:Se},Us())}finally{$.p=N,A!==null&&B.types!==null&&(A.types=B.types),Y.T=A}}function gy(){}function pp(a,r,u,m){if(a.tag!==5)throw Error(s(476));var S=r0(a).queue;s0(a,S,r,ae,u===null?gy:function(){return i0(a),u(m)})}function r0(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ae,baseState:ae,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:ae},next:null};var u={};return r.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xi,lastRenderedState:u},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function i0(a){var r=r0(a);r.next===null&&(r=a.alternate.memoizedState),yu(a,r.next.queue,{},Us())}function mp(){return We(Up)}function l0(){return In().memoizedState}function o0(){return In().memoizedState}function yy(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var u=Us();a=gi(u);var m=Vi(r,a,u);m!==null&&(pt(m,r,u),Qi(m,r,u)),r={cache:Gh()},a.payload=r;return}r=r.return}}function xy(a,r,u){var m=Us();u={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},tf(a)?u0(r,u):(u=Ad(a,r,u,m),u!==null&&(pt(u,a,m),d0(u,r,m)))}function c0(a,r,u){var m=Us();yu(a,r,u,m)}function yu(a,r,u,m){var S={lane:m,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(tf(a))u0(r,S);else{var N=a.alternate;if(a.lanes===0&&(N===null||N.lanes===0)&&(N=r.lastRenderedReducer,N!==null))try{var A=r.lastRenderedState,B=N(A,u);if(S.hasEagerState=!0,S.eagerState=B,Fa(B,A))return Sa(a,r,S,0),tt===null&&iu(),!1}catch{}finally{}if(u=Ad(a,r,S,m),u!==null)return pt(u,a,m),d0(u,r,m),!0}return!1}function gp(a,r,u,m){if(m={lane:2,revertLane:pe(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},tf(a)){if(r)throw Error(s(479))}else r=Ad(a,u,m,2),r!==null&&pt(r,a,2)}function tf(a){var r=a.alternate;return a===rt||r!==null&&r===rt}function u0(a,r){Vo=Is=!0;var u=a.pending;u===null?r.next=r:(r.next=u.next,u.next=r),a.pending=r}function d0(a,r,u){if((u&4194048)!==0){var m=r.lanes;m&=a.pendingLanes,u|=m,r.lanes=u,ls(a,u)}}var Ko={readContext:We,use:Ki,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};Ko.useEffectEvent=An;var f0={readContext:We,use:Ki,useCallback:function(a,r){return ca().memoizedState=[a,r===void 0?null:r],a},useContext:We,useEffect:Fg,useImperativeHandle:function(a,r,u){u=u!=null?u.concat([a]):null,$d(4194308,4,$g.bind(null,r,a),u)},useLayoutEffect:function(a,r){return $d(4194308,4,a,r)},useInsertionEffect:function(a,r){$d(4,2,a,r)},useMemo:function(a,r){var u=ca();r=r===void 0?null:r;var m=a();if(Ul){is(!0);try{a()}finally{is(!1)}}return u.memoizedState=[m,r],m},useReducer:function(a,r,u){var m=ca();if(u!==void 0){var S=u(r);if(Ul){is(!0);try{u(r)}finally{is(!1)}}}else S=r;return m.memoizedState=m.baseState=S,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:S},m.queue=a,a=a.dispatch=xy.bind(null,rt,a),[m.memoizedState,a]},useRef:function(a){var r=ca();return a={current:a},r.memoizedState=a},useState:function(a){a=sp(a);var r=a.queue,u=c0.bind(null,rt,r);return r.dispatch=u,[a.memoizedState,u]},useDebugValue:fp,useDeferredValue:function(a,r){var u=ca();return hp(u,a,r)},useTransition:function(){var a=sp(!1);return a=s0.bind(null,rt,a.queue,!0,!1),ca().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,u){var m=rt,S=ca();if(Ct){if(u===void 0)throw Error(s(407));u=u()}else{if(u=r(),tt===null)throw Error(s(349));(dt&127)!==0||Ug(m,r,u)}S.memoizedState=u;var N={value:u,getSnapshot:r};return S.queue=N,Fg(Hg.bind(null,m,N,a),[a]),m.flags|=2048,Xi(9,{destroy:void 0},qg.bind(null,m,N,u,r),null),u},useId:function(){var a=ca(),r=tt.identifierPrefix;if(Ct){var u=yr,m=Mn;u=(m&~(1<<32-ba(m)-1)).toString(32)+u,r="_"+r+"R_"+u,u=Fd++,0<u&&(r+="H"+u.toString(32)),r+="_"}else u=Ih++,r="_"+r+"r_"+u.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:mp,useFormState:op,useActionState:op,useOptimistic:function(a){var r=ca();r.memoizedState=r.baseState=a;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=u,r=gp.bind(null,rt,!0,u),u.dispatch=r,[a,r]},useMemoCache:tp,useCacheRefresh:function(){return ca().memoizedState=yy.bind(null,rt)},useEffectEvent:function(a){var r=ca(),u={impl:a};return r.memoizedState=u,function(){if((Ye&2)!==0)throw Error(s(440));return u.impl.apply(void 0,arguments)}}},yp={readContext:We,use:Ki,useCallback:t0,useContext:We,useEffect:dp,useImperativeHandle:e0,useInsertionEffect:Jg,useLayoutEffect:Wg,useMemo:n0,useReducer:Jd,useRef:Wd,useState:function(){return Jd(xi)},useDebugValue:fp,useDeferredValue:function(a,r){var u=In();return a0(u,tn.memoizedState,a,r)},useTransition:function(){var a=Jd(xi)[0],r=In().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Lg,useId:l0,useHostTransitionStatus:mp,useFormState:Kg,useActionState:Kg,useOptimistic:function(a,r){var u=In();return rp(u,tn,a,r)},useMemoCache:tp,useCacheRefresh:o0};yp.useEffectEvent=Ig;var Js={readContext:We,use:Ki,useCallback:t0,useContext:We,useEffect:dp,useImperativeHandle:e0,useInsertionEffect:Jg,useLayoutEffect:Wg,useMemo:n0,useReducer:ap,useRef:Wd,useState:function(){return ap(xi)},useDebugValue:fp,useDeferredValue:function(a,r){var u=In();return tn===null?hp(u,a,r):a0(u,tn.memoizedState,a,r)},useTransition:function(){var a=ap(xi)[0],r=In().memoizedState;return[typeof a=="boolean"?a:gu(a),r]},useSyncExternalStore:Lg,useId:l0,useHostTransitionStatus:mp,useFormState:up,useActionState:up,useOptimistic:function(a,r){var u=In();return tn!==null?rp(u,tn,a,r):(u.baseState=a,[a,u.queue.dispatch])},useMemoCache:tp,useCacheRefresh:o0};Js.useEffectEvent=Ig;function nf(a,r,u,m){r=a.memoizedState,u=u(m,r),u=u==null?r:v({},r,u),a.memoizedState=u,a.lanes===0&&(a.updateQueue.baseState=u)}var xu={enqueueSetState:function(a,r,u){a=a._reactInternals;var m=Us(),S=gi(m);S.payload=r,u!=null&&(S.callback=u),r=Vi(a,S,m),r!==null&&(pt(r,a,m),Qi(r,a,m))},enqueueReplaceState:function(a,r,u){a=a._reactInternals;var m=Us(),S=gi(m);S.tag=1,S.payload=r,u!=null&&(S.callback=u),r=Vi(a,S,m),r!==null&&(pt(r,a,m),Qi(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var u=Us(),m=gi(u);m.tag=2,r!=null&&(m.callback=r),r=Vi(a,m,u),r!==null&&(pt(r,a,u),Qi(r,a,u))}};function xp(a,r,u,m,S,N,A){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,N,A):r.prototype&&r.prototype.isPureReactComponent?!To(u,m)||!To(S,N):!0}function bp(a,r,u,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(u,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(u,m),r.state!==a&&xu.enqueueReplaceState(r,r.state,null)}function Fi(a,r){var u=r;if("ref"in r){u={};for(var m in r)m!=="ref"&&(u[m]=r[m])}if(a=a.defaultProps){u===r&&(u=v({},u));for(var S in a)u[S]===void 0&&(u[S]=a[S])}return u}function h0(a){ru(a)}function vp(a){console.error(a)}function Sp(a){ru(a)}function af(a,r){try{var u=a.onUncaughtError;u(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function p0(a,r,u){try{var m=a.onCaughtError;m(u.value,{componentStack:u.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function Np(a,r,u){return u=gi(u),u.tag=3,u.payload={element:null},u.callback=function(){af(a,r)},u}function _p(a){return a=gi(a),a.tag=3,a}function m0(a,r,u,m){var S=u.type.getDerivedStateFromError;if(typeof S=="function"){var N=m.value;a.payload=function(){return S(N)},a.callback=function(){p0(r,u,m)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(a.callback=function(){p0(r,u,m),typeof S!="function"&&($n===null?$n=new Set([this]):$n.add(this));var B=m.stack;this.componentDidCatch(m.value,{componentStack:B!==null?B:""})})}function ua(a,r,u,m,S){if(u.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=u.alternate,r!==null&&Pr(r,u,S,!0),u=fs.current,u!==null){switch(u.tag){case 31:case 13:return Ja===null?$o():u.alternate===null&&Dn===0&&(Dn=3),u.flags&=-257,u.flags|=65536,u.lanes=S,m===Yd?u.flags|=16384:(r=u.updateQueue,r===null?u.updateQueue=new Set([m]):r.add(m),Ou(a,m,S)),!1;case 22:return u.flags|=65536,m===Yd?u.flags|=16384:(r=u.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},u.updateQueue=r):(u=r.retryQueue,u===null?r.retryQueue=new Set([m]):u.add(m)),Ou(a,m,S)),!1}throw Error(s(435,u.tag))}return Ou(a,m,S),$o(),!1}if(Ct)return r=fs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,m!==Lo&&(a=Error(s(422),{cause:m}),Hr(Rs(a,u)))):(m!==Lo&&(r=Error(s(423),{cause:m}),Hr(Rs(r,u))),a=a.current.alternate,a.flags|=65536,S&=-S,a.lanes|=S,m=Rs(m,u),S=Np(a.stateNode,m,S),Qe(a,S),Dn!==4&&(Dn=2)),!1;var N=Error(s(520),{cause:m});if(N=Rs(N,u),Xl===null?Xl=[N]:Xl.push(N),Dn!==4&&(Dn=2),r===null)return!0;m=Rs(m,u),u=r;do{switch(u.tag){case 3:return u.flags|=65536,a=S&-S,u.lanes|=a,a=Np(u.stateNode,m,a),Qe(u,a),!1;case 1:if(r=u.type,N=u.stateNode,(u.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&($n===null||!$n.has(N))))return u.flags|=65536,S&=-S,u.lanes|=S,S=_p(S),m0(S,a,u,m),Qe(u,S),!1}u=u.return}while(u!==null);return!1}var sf=Error(s(461)),aa=!1;function Na(a,r,u,m){r.child=a===null?Kd(r,null,u,m):mi(r,a.child,u,m)}function jp(a,r,u,m,S){u=u.render;var N=r.ref;if("ref"in m){var A={};for(var B in m)B!=="ref"&&(A[B]=m[B])}else A=m;return Pi(r),m=Zd(a,r,u,A,N,S),B=Wh(),a!==null&&!aa?($h(a,r,S),Jn(a,r,S)):(Ct&&B&&Ur(r),r.flags|=1,Na(a,r,m,S),r.child)}function Bl(a,r,u,m,S){if(a===null){var N=u.type;return typeof N=="function"&&!Dd(N)&&N.defaultProps===void 0&&u.compare===null?(r.tag=15,r.type=N,rf(a,r,N,m,S)):(a=kr(u.type,null,m,r,r.mode,S),a.ref=r.ref,a.return=r,r.child=a)}if(N=a.child,!ff(a,S)){var A=N.memoizedProps;if(u=u.compare,u=u!==null?u:To,u(A,m)&&a.ref===r.ref)return Jn(a,r,S)}return r.flags|=1,a=cs(N,m),a.ref=r.ref,a.return=r,r.child=a}function rf(a,r,u,m,S){if(a!==null){var N=a.memoizedProps;if(To(N,m)&&a.ref===r.ref)if(aa=!1,r.pendingProps=m=N,ff(a,S))(a.flags&131072)!==0&&(aa=!0);else return r.lanes=a.lanes,Jn(a,r,S)}return Xo(a,r,u,m,S)}function Gl(a,r,u,m){var S=m.children,N=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if((r.flags&128)!==0){if(N=N!==null?N.baseLanes|u:u,a!==null){for(m=r.child=a.child,S=0;m!==null;)S=S|m.lanes|m.childLanes,m=m.sibling;m=S&~N}else m=0,r.child=null;return ps(a,r,N,u,m)}if((u&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&cu(r,N!==null?N.cachePool:null),N!==null?Dg(r,N):Fh(),zg(r);else return m=r.lanes=536870912,ps(a,r,N!==null?N.baseLanes|u:u,u,m)}else N!==null?(cu(r,N.cachePool),Dg(r,N),hs(),r.memoizedState=null):(a!==null&&cu(r,null),Fh(),hs());return Na(a,r,S,u),r.child}function Vr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ps(a,r,u,m,S){var N=Pd();return N=N===null?null:{parent:na._currentValue,pool:N},r.memoizedState={baseLanes:u,cachePool:N},a!==null&&cu(r,null),Fh(),zg(r),a!==null&&Pr(a,r,m,!0),r.childLanes=S,null}function lf(a,r){return r=df({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function g0(a,r,u){return mi(r,a.child,null,u),a=lf(r,r.pendingProps),a.flags|=2,Zn(r),r.memoizedState=null,a}function of(a,r,u){var m=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(Ct){if(m.mode==="hidden")return a=lf(r,m),r.lanes=536870912,Vr(null,a);if(Zh(r),(a=on)?(a=Kv(a,Os),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:di!==null?{id:Mn,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},u=Do(a),u.return=r,r.child=u,Bn=r,on=null)):a=null,a===null)throw qr(r);return r.lanes=536870912,null}return lf(r,m)}var N=a.memoizedState;if(N!==null){var A=N.dehydrated;if(Zh(r),S)if(r.flags&256)r.flags&=-257,r=g0(a,r,u);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(aa||Pr(a,r,u,!1),S=(u&a.childLanes)!==0,aa||S){if(m=tt,m!==null&&(A=Bs(m,u),A!==0&&A!==N.retryLane))throw N.retryLane=A,Za(a,A),pt(m,a,A),sf;$o(),r=g0(a,r,u)}else a=N.treeContext,on=$r(A.nextSibling),Bn=r,Ct=!0,fi=null,Os=!1,a!==null&&Ud(r,a),r=lf(r,m),r.flags|=4096;return r}return a=cs(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Pl(a,r){var u=r.ref;if(u===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(s(284));(a===null||a.ref!==u)&&(r.flags|=4194816)}}function Xo(a,r,u,m,S){return Pi(r),u=Zd(a,r,u,m,void 0,S),m=Wh(),a!==null&&!aa?($h(a,r,S),Jn(a,r,S)):(Ct&&m&&Ur(r),r.flags|=1,Na(a,r,u,S),r.child)}function bu(a,r,u,m,S,N){return Pi(r),r.updateQueue=null,u=ql(r,m,u,S),kg(a),m=Wh(),a!==null&&!aa?($h(a,r,N),Jn(a,r,N)):(Ct&&m&&Ur(r),r.flags|=1,Na(a,r,u,N),r.child)}function cf(a,r,u,m,S){if(Pi(r),r.stateNode===null){var N=Li,A=u.contextType;typeof A=="object"&&A!==null&&(N=We(A)),N=new u(m,N),r.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=xu,r.stateNode=N,N._reactInternals=r,N=r.stateNode,N.props=m,N.state=r.memoizedState,N.refs={},fu(r),A=u.contextType,N.context=typeof A=="object"&&A!==null?We(A):Li,N.state=r.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(nf(r,u,A,m),N.state=r.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(A=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),A!==N.state&&xu.enqueueReplaceState(N,N.state,null),Go(r,m,N,S),hu(),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){N=r.stateNode;var B=r.memoizedProps,X=Fi(u,B);N.props=X;var oe=N.context,xe=u.contextType;A=Li,typeof xe=="object"&&xe!==null&&(A=We(xe));var Se=u.getDerivedStateFromProps;xe=typeof Se=="function"||typeof N.getSnapshotBeforeUpdate=="function",B=r.pendingProps!==B,xe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(B||oe!==A)&&bp(r,N,m,A),Ia=!1;var de=r.memoizedState;N.state=de,Go(r,m,N,S),hu(),oe=r.memoizedState,B||de!==oe||Ia?(typeof Se=="function"&&(nf(r,u,Se,m),oe=r.memoizedState),(X=Ia||xp(r,u,X,m,de,oe,A))?(xe||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount()),typeof N.componentDidMount=="function"&&(r.flags|=4194308)):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=oe),N.props=m,N.state=oe,N.context=A,m=X):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{N=r.stateNode,Kh(a,r),A=r.memoizedProps,xe=Fi(u,A),N.props=xe,Se=r.pendingProps,de=N.context,oe=u.contextType,X=Li,typeof oe=="object"&&oe!==null&&(X=We(oe)),B=u.getDerivedStateFromProps,(oe=typeof B=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(A!==Se||de!==X)&&bp(r,N,m,X),Ia=!1,de=r.memoizedState,N.state=de,Go(r,m,N,S),hu();var ye=r.memoizedState;A!==Se||de!==ye||Ia||a!==null&&a.dependencies!==null&&ou(a.dependencies)?(typeof B=="function"&&(nf(r,u,B,m),ye=r.memoizedState),(xe=Ia||xp(r,u,xe,m,de,ye,X)||a!==null&&a.dependencies!==null&&ou(a.dependencies))?(oe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(m,ye,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(m,ye,X)),typeof N.componentDidUpdate=="function"&&(r.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof N.componentDidUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=ye),N.props=m,N.state=ye,N.context=X,m=xe):(typeof N.componentDidUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||A===a.memoizedProps&&de===a.memoizedState||(r.flags|=1024),m=!1)}return N=m,Pl(a,r),m=(r.flags&128)!==0,N||m?(N=r.stateNode,u=m&&typeof u.getDerivedStateFromError!="function"?null:N.render(),r.flags|=1,a!==null&&m?(r.child=mi(r,a.child,null,S),r.child=mi(r,null,u,S)):Na(a,r,u,S),r.memoizedState=N.state,a=r.child):a=Jn(a,r,S),a}function y0(a,r,u,m){return Bi(),r.flags|=256,Na(a,r,u,m),r.child}var Cp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ga(a){return{baseLanes:a,cachePool:Qh()}}function uf(a,r,u){return a=a!==null?a.childLanes&~u:0,r&&(a|=ts),a}function x0(a,r,u){var m=r.pendingProps,S=!1,N=(r.flags&128)!==0,A;if((A=N)||(A=a!==null&&a.memoizedState===null?!1:(wt.current&2)!==0),A&&(S=!0,r.flags&=-129),A=(r.flags&32)!==0,r.flags&=-33,a===null){if(Ct){if(S?yi(r):hs(),(a=on)?(a=Kv(a,Os),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:di!==null?{id:Mn,overflow:yr}:null,retryLane:536870912,hydrationErrors:null},u=Do(a),u.return=r,r.child=u,Bn=r,on=null)):a=null,a===null)throw qr(r);return Ay(a)?r.lanes=32:r.lanes=536870912,null}var B=m.children;return m=m.fallback,S?(hs(),S=r.mode,B=df({mode:"hidden",children:B},S),m=Ui(m,S,u,null),B.return=r,m.return=r,B.sibling=m,r.child=B,m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Cp,Vr(null,m)):(yi(r),vu(r,B))}var X=a.memoizedState;if(X!==null&&(B=X.dehydrated,B!==null)){if(N)r.flags&256?(yi(r),r.flags&=-257,r=wp(a,r,u)):r.memoizedState!==null?(hs(),r.child=a.child,r.flags|=128,r=null):(hs(),B=m.fallback,S=r.mode,m=df({mode:"visible",children:m.children},S),B=Ui(B,S,u,null),B.flags|=2,m.return=r,B.return=r,m.sibling=B,r.child=m,mi(r,a.child,null,u),m=r.child,m.memoizedState=Ga(u),m.childLanes=uf(a,A,u),r.memoizedState=Cp,r=Vr(null,m));else if(yi(r),Ay(B)){if(A=B.nextSibling&&B.nextSibling.dataset,A)var oe=A.dgst;A=oe,m=Error(s(419)),m.stack="",m.digest=A,Hr({value:m,source:null,stack:null}),r=wp(a,r,u)}else if(aa||Pr(a,r,u,!1),A=(u&a.childLanes)!==0,aa||A){if(A=tt,A!==null&&(m=Bs(A,u),m!==0&&m!==X.retryLane))throw X.retryLane=m,Za(a,m),pt(A,a,m),sf;My(B)||$o(),r=wp(a,r,u)}else My(B)?(r.flags|=192,r.child=a.child,r=null):(a=X.treeContext,on=$r(B.nextSibling),Bn=r,Ct=!0,fi=null,Os=!1,a!==null&&Ud(r,a),r=vu(r,m.children),r.flags|=4096);return r}return S?(hs(),B=m.fallback,S=r.mode,X=a.child,oe=X.sibling,m=cs(X,{mode:"hidden",children:m.children}),m.subtreeFlags=X.subtreeFlags&65011712,oe!==null?B=cs(oe,B):(B=Ui(B,S,u,null),B.flags|=2),B.return=r,m.return=r,m.sibling=B,r.child=m,Vr(null,m),m=r.child,B=a.child.memoizedState,B===null?B=Ga(u):(S=B.cachePool,S!==null?(X=na._currentValue,S=S.parent!==X?{parent:X,pool:X}:S):S=Qh(),B={baseLanes:B.baseLanes|u,cachePool:S}),m.memoizedState=B,m.childLanes=uf(a,A,u),r.memoizedState=Cp,Vr(a.child,m)):(yi(r),u=a.child,a=u.sibling,u=cs(u,{mode:"visible",children:m.children}),u.return=r,u.sibling=null,a!==null&&(A=r.deletions,A===null?(r.deletions=[a],r.flags|=16):A.push(a)),r.child=u,r.memoizedState=null,u)}function vu(a,r){return r=df({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function df(a,r){return a=On(22,a,null,r),a.lanes=0,a}function wp(a,r,u){return mi(r,a.child,null,u),a=vu(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function b0(a,r,u){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),Hd(a.return,r,u)}function Yl(a,r,u,m,S,N){var A=a.memoizedState;A===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:u,tailMode:S,treeForkCount:N}:(A.isBackwards=r,A.rendering=null,A.renderingStartTime=0,A.last=m,A.tail=u,A.tailMode=S,A.treeForkCount=N)}function ms(a,r,u){var m=r.pendingProps,S=m.revealOrder,N=m.tail;m=m.children;var A=wt.current,B=(A&2)!==0;if(B?(A=A&1|2,r.flags|=128):A&=1,fe(wt,A),Na(a,r,m,u),m=Ct?ko:0,!B&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&b0(a,u,r);else if(a.tag===19)b0(a,u,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(S){case"forwards":for(u=r.child,S=null;u!==null;)a=u.alternate,a!==null&&As(a)===null&&(S=u),u=u.sibling;u=S,u===null?(S=r.child,r.child=null):(S=u.sibling,u.sibling=null),Yl(r,!1,S,u,N,m);break;case"backwards":case"unstable_legacy-backwards":for(u=null,S=r.child,r.child=null;S!==null;){if(a=S.alternate,a!==null&&As(a)===null){r.child=S;break}a=S.sibling,S.sibling=u,u=S,S=a}Yl(r,!0,u,null,N,m);break;case"together":Yl(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function Jn(a,r,u){if(a!==null&&(r.dependencies=a.dependencies),Ir|=r.lanes,(u&r.childLanes)===0)if(a!==null){if(Pr(a,r,u,!1),(u&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(s(153));if(r.child!==null){for(a=r.child,u=cs(a,a.pendingProps),r.child=u,u.return=r;a.sibling!==null;)a=a.sibling,u=u.sibling=cs(a,a.pendingProps),u.return=r;u.sibling=null}return r.child}function ff(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&ou(a)))}function by(a,r,u){switch(r.tag){case 3:nt(r,r.stateNode.containerInfo),hi(r,na,a.memoizedState.cache),Bi();break;case 27:case 5:Vt(r);break;case 4:nt(r,r.stateNode.containerInfo);break;case 10:hi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Zh(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(yi(r),r.flags|=128,null):(u&r.child.childLanes)!==0?x0(a,r,u):(yi(r),a=Jn(a,r,u),a!==null?a.sibling:null);yi(r);break;case 19:var S=(a.flags&128)!==0;if(m=(u&r.childLanes)!==0,m||(Pr(a,r,u,!1),m=(u&r.childLanes)!==0),S){if(m)return ms(a,r,u);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),fe(wt,wt.current),m)break;return null;case 22:return r.lanes=0,Gl(a,r,u,r.pendingProps);case 24:hi(r,na,a.memoizedState.cache)}return Jn(a,r,u)}function hf(a,r,u){if(a!==null)if(a.memoizedProps!==r.pendingProps)aa=!0;else{if(!ff(a,u)&&(r.flags&128)===0)return aa=!1,by(a,r,u);aa=(a.flags&131072)!==0}else aa=!1,Ct&&(r.flags&1048576)!==0&&wg(r,ko,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Al(r.elementType),r.type=a,typeof a=="function")Dd(a)?(m=Fi(a,m),r.tag=1,r=cf(null,r,a,m,u)):(r.tag=0,r=Xo(null,r,a,m,u));else{if(a!=null){var S=a.$$typeof;if(S===k){r.tag=11,r=jp(null,r,a,m,u);break e}else if(S===L){r.tag=14,r=Bl(null,r,a,m,u);break e}}throw r=ie(a)||a,Error(s(306,r,""))}}return r;case 0:return Xo(a,r,r.type,r.pendingProps,u);case 1:return m=r.type,S=Fi(m,r.pendingProps),cf(a,r,m,S,u);case 3:e:{if(nt(r,r.stateNode.containerInfo),a===null)throw Error(s(387));m=r.pendingProps;var N=r.memoizedState;S=N.element,Kh(a,r),Go(r,m,null,u);var A=r.memoizedState;if(m=A.cache,hi(r,na,m),m!==N.cache&&Bd(r,[na],u,!0),hu(),m=A.element,N.isDehydrated)if(N={element:m,isDehydrated:!1,cache:A.cache},r.updateQueue.baseState=N,r.memoizedState=N,r.flags&256){r=y0(a,r,m,u);break e}else if(m!==S){S=Rs(Error(s(424)),r),Hr(S),r=y0(a,r,m,u);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(on=$r(a.firstChild),Bn=r,Ct=!0,fi=null,Os=!0,u=Kd(r,null,m,u),r.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Bi(),m===S){r=Jn(a,r,u);break e}Na(a,r,m,u)}r=r.child}return r;case 26:return Pl(a,r),a===null?(u=Wv(r.type,null,r.pendingProps,null))?r.memoizedState=u:Ct||(u=r.type,a=r.pendingProps,m=_0(me.current).createElement(u),m[Fe]=r,m[ut]=a,as(m,u,a),Tn(m),r.stateNode=m):r.memoizedState=Wv(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Vt(r),a===null&&Ct&&(m=r.stateNode=Zv(r.type,r.pendingProps,me.current),Bn=r,Os=!0,S=on,ac(r.type)?(Dy=S,on=$r(m.firstChild)):on=S),Na(a,r,r.pendingProps.children,u),Pl(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&Ct&&((S=m=on)&&(m=h7(m,r.type,r.pendingProps,Os),m!==null?(r.stateNode=m,Bn=r,on=$r(m.firstChild),Os=!1,S=!0):S=!1),S||qr(r)),Vt(r),S=r.type,N=r.pendingProps,A=a!==null?a.memoizedProps:null,m=N.children,Ty(S,N)?m=null:A!==null&&Ty(S,A)&&(r.flags|=32),r.memoizedState!==null&&(S=Zd(a,r,Hl,null,null,u),Up._currentValue=S),Pl(a,r),Na(a,r,m,u),r.child;case 6:return a===null&&Ct&&((a=u=on)&&(u=p7(u,r.pendingProps,Os),u!==null?(r.stateNode=u,Bn=r,on=null,a=!0):a=!1),a||qr(r)),null;case 13:return x0(a,r,u);case 4:return nt(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=mi(r,null,m,u):Na(a,r,m,u),r.child;case 11:return jp(a,r,r.type,r.pendingProps,u);case 7:return Na(a,r,r.pendingProps,u),r.child;case 8:return Na(a,r,r.pendingProps.children,u),r.child;case 12:return Na(a,r,r.pendingProps.children,u),r.child;case 10:return m=r.pendingProps,hi(r,r.type,m.value),Na(a,r,m.children,u),r.child;case 9:return S=r.type._context,m=r.pendingProps.children,Pi(r),S=We(S),m=m(S),r.flags|=1,Na(a,r,m,u),r.child;case 14:return Bl(a,r,r.type,r.pendingProps,u);case 15:return rf(a,r,r.type,r.pendingProps,u);case 19:return ms(a,r,u);case 31:return of(a,r,u);case 22:return Gl(a,r,u,r.pendingProps);case 24:return Pi(r),m=We(na),a===null?(S=Pd(),S===null&&(S=tt,N=Gh(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=u),S=N),r.memoizedState={parent:m,cache:S},fu(r),hi(r,na,S)):((a.lanes&u)!==0&&(Kh(a,r),Go(r,null,null,u),hu()),S=a.memoizedState,N=r.memoizedState,S.parent!==m?(S={parent:m,cache:m},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),hi(r,na,m)):(m=N.cache,hi(r,na,m),m!==S.cache&&Bd(r,[na],u,!0))),Na(a,r,r.pendingProps.children,u),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Qr(a){a.flags|=4}function Su(a,r,u,m,S){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(S&335544128)===S)if(a.stateNode.complete)a.flags|=8192;else if(kn())a.flags|=8192;else throw Yr=Yd,uu}else a.flags&=-16777217}function Ep(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!a2(r))if(kn())a.flags|=8192;else throw Yr=Yd,uu}function bi(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?rn():536870912,a.lanes|=r,mn|=r)}function Kr(a,r){if(!Ct)switch(a.tailMode){case"hidden":r=a.tail;for(var u=null;r!==null;)r.alternate!==null&&(u=r),r=r.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?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function nn(a){var r=a.alternate!==null&&a.alternate.child===a.child,u=0,m=0;if(r)for(var S=a.child;S!==null;)u|=S.lanes|S.childLanes,m|=S.subtreeFlags&65011712,m|=S.flags&65011712,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)u|=S.lanes|S.childLanes,m|=S.subtreeFlags,m|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=m,a.childLanes=u,r}function Nu(a,r,u){var m=r.pendingProps;switch(Ld(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(r),null;case 1:return nn(r),null;case 3:return u=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),Gr(na),ze(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(a===null||a.child===null)&&(Uo(r)?Qr(r):a===null||a.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,qd())),nn(r),null;case 26:var S=r.type,N=r.memoizedState;return a===null?(Qr(r),N!==null?(nn(r),Ep(r,N)):(nn(r),Su(r,S,null,m,u))):N?N!==a.memoizedState?(Qr(r),nn(r),Ep(r,N)):(nn(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&Qr(r),nn(r),Su(r,S,a,m,u)),null;case 27:if($e(r),u=me.current,S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return nn(r),null}a=be.current,Uo(r)?Eg(r):(a=Zv(S,m,u),r.stateNode=a,Qr(r))}return nn(r),null;case 5:if($e(r),S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return nn(r),null}if(N=be.current,Uo(r))Eg(r);else{var A=_0(me.current);switch(N){case 1:N=A.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=A.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=A.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=A.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":N=A.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof m.is=="string"?A.createElement("select",{is:m.is}):A.createElement("select"),m.multiple?N.multiple=!0:m.size&&(N.size=m.size);break;default:N=typeof m.is=="string"?A.createElement(S,{is:m.is}):A.createElement(S)}}N[Fe]=r,N[ut]=m;e:for(A=r.child;A!==null;){if(A.tag===5||A.tag===6)N.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===r)break e;for(;A.sibling===null;){if(A.return===null||A.return===r)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}r.stateNode=N;e:switch(as(N,S,m),S){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&Qr(r)}}return nn(r),Su(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,u),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&Qr(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(s(166));if(a=me.current,Uo(r)){if(a=r.stateNode,u=r.memoizedProps,m=null,S=Bn,S!==null)switch(S.tag){case 27:case 5:m=S.memoizedProps}a[Fe]=r,a=!!(a.nodeValue===u||m!==null&&m.suppressHydrationWarning===!0||qv(a.nodeValue,u)),a||qr(r,!0)}else a=_0(a).createTextNode(m),a[Fe]=r,r.stateNode=a}return nn(r),null;case 31:if(u=r.memoizedState,a===null||a.memoizedState!==null){if(m=Uo(r),u!==null){if(a===null){if(!m)throw Error(s(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[Fe]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),a=!1}else u=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=u),a=!0;if(!a)return r.flags&256?(Zn(r),r):(Zn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return nn(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(S=Uo(r),m!==null&&m.dehydrated!==null){if(a===null){if(!S)throw Error(s(318));if(S=r.memoizedState,S=S!==null?S.dehydrated:null,!S)throw Error(s(317));S[Fe]=r}else Bi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),S=!1}else S=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=S),S=!0;if(!S)return r.flags&256?(Zn(r),r):(Zn(r),null)}return Zn(r),(r.flags&128)!==0?(r.lanes=u,r):(u=m!==null,a=a!==null&&a.memoizedState!==null,u&&(m=r.child,S=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(S=m.alternate.memoizedState.cachePool.pool),N=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(N=m.memoizedState.cachePool.pool),N!==S&&(m.flags|=2048)),u!==a&&u&&(r.child.flags|=8192),bi(r,r.updateQueue),nn(r),null);case 4:return ze(),a===null&&_y(r.stateNode.containerInfo),nn(r),null;case 10:return Gr(r.type),nn(r),null;case 19:if(W(wt),m=r.memoizedState,m===null)return nn(r),null;if(S=(r.flags&128)!==0,N=m.rendering,N===null)if(S)Kr(m,!1);else{if(Dn!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(N=As(a),N!==null){for(r.flags|=128,Kr(m,!1),a=N.updateQueue,r.updateQueue=a,bi(r,a),r.subtreeFlags=0,a=u,u=r.child;u!==null;)Ao(u,a),u=u.sibling;return fe(wt,wt.current&1|2),Ct&&Lr(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&Xn()>Wn&&(r.flags|=128,S=!0,Kr(m,!1),r.lanes=4194304)}else{if(!S)if(a=As(N),a!==null){if(r.flags|=128,S=!0,a=a.updateQueue,r.updateQueue=a,bi(r,a),Kr(m,!0),m.tail===null&&m.tailMode==="hidden"&&!N.alternate&&!Ct)return nn(r),null}else 2*Xn()-m.renderingStartTime>Wn&&u!==536870912&&(r.flags|=128,S=!0,Kr(m,!1),r.lanes=4194304);m.isBackwards?(N.sibling=r.child,r.child=N):(a=m.last,a!==null?a.sibling=N:r.child=N,m.last=N)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=Xn(),a.sibling=null,u=wt.current,fe(wt,S?u&1|2:u&1),Ct&&Lr(r,m.treeForkCount),a):(nn(r),null);case 22:case 23:return Zn(r),pu(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?(u&536870912)!==0&&(r.flags&128)===0&&(nn(r),r.subtreeFlags&6&&(r.flags|=8192)):nn(r),u=r.updateQueue,u!==null&&bi(r,u.retryQueue),u=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==u&&(r.flags|=2048),a!==null&&W(Yi),null;case 24:return u=null,a!==null&&(u=a.memoizedState.cache),r.memoizedState.cache!==u&&(r.flags|=2048),Gr(na),nn(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function Ws(a,r){switch(Ld(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Gr(na),ze(),a=r.flags,(a&65536)!==0&&(a&128)===0?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return $e(r),null;case 31:if(r.memoizedState!==null){if(Zn(r),r.alternate===null)throw Error(s(340));Bi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Zn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Bi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return W(wt),null;case 4:return ze(),null;case 10:return Gr(r.type),null;case 22:case 23:return Zn(r),pu(),a!==null&&W(Yi),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Gr(na),null;case 25:return null;default:return null}}function Ds(a,r){switch(Ld(r),r.tag){case 3:Gr(na),ze();break;case 26:case 27:case 5:$e(r);break;case 4:ze();break;case 31:r.memoizedState!==null&&Zn(r);break;case 13:Zn(r);break;case 19:W(wt);break;case 10:Gr(r.type);break;case 22:case 23:Zn(r),pu(),a!==null&&W(Yi);break;case 24:Gr(na)}}function $s(a,r){try{var u=r.updateQueue,m=u!==null?u.lastEffect:null;if(m!==null){var S=m.next;u=S;do{if((u.tag&a)===a){m=void 0;var N=u.create,A=u.inst;m=N(),A.destroy=m}u=u.next}while(u!==S)}}catch(B){Ut(r,r.return,B)}}function Ma(a,r,u){try{var m=r.updateQueue,S=m!==null?m.lastEffect:null;if(S!==null){var N=S.next;m=N;do{if((m.tag&a)===a){var A=m.inst,B=A.destroy;if(B!==void 0){A.destroy=void 0,S=r;var X=u,oe=B;try{oe()}catch(xe){Ut(S,X,xe)}}}m=m.next}while(m!==N)}}catch(xe){Ut(r,r.return,xe)}}function xr(a){var r=a.updateQueue;if(r!==null){var u=a.stateNode;try{Ag(r,u)}catch(m){Ut(a,a.return,m)}}}function _a(a,r,u){u.props=Fi(a.type,a.memoizedProps),u.state=a.memoizedState;try{u.componentWillUnmount()}catch(m){Ut(a,r,m)}}function vi(a,r){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(S){Ut(a,r,S)}}function Aa(a,r){var u=a.ref,m=a.refCleanup;if(u!==null)if(typeof m=="function")try{m()}catch(S){Ut(a,r,S)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(S){Ut(a,r,S)}else u.current=null}function _u(a){var r=a.type,u=a.memoizedProps,m=a.stateNode;try{e:switch(r){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(S){Ut(a,a.return,S)}}function da(a,r,u){try{var m=a.stateNode;l7(m,a.type,u,r),m[ut]=r}catch(S){Ut(a,a.return,S)}}function Sn(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&ac(a.type)||a.tag===4}function Nt(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Sn(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&&ac(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 Xr(a,r,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(a,r):(r=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,r.appendChild(a),u=u._reactRootContainer,u!=null||r.onclick!==null||(r.onclick=oi));else if(m!==4&&(m===27&&ac(a.type)&&(u=a.stateNode,r=null),a=a.child,a!==null))for(Xr(a,r,u),a=a.sibling;a!==null;)Xr(a,r,u),a=a.sibling}function Wa(a,r,u){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?u.insertBefore(a,r):u.appendChild(a);else if(m!==4&&(m===27&&ac(a.type)&&(u=a.stateNode),a=a.child,a!==null))for(Wa(a,r,u),a=a.sibling;a!==null;)Wa(a,r,u),a=a.sibling}function pf(a){var r=a.stateNode,u=a.memoizedProps;try{for(var m=a.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);as(r,m,u),r[Fe]=a,r[ut]=u}catch(N){Ut(a,a.return,N)}}var er=!1,cn=!1,br=!1,v0=typeof WeakSet=="function"?WeakSet:Set,ja=null;function vy(a,r){if(a=a.containerInfo,wy=O0,a=Ng(a),Lh(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 S=m.anchorOffset,N=m.focusNode;m=m.focusOffset;try{u.nodeType,N.nodeType}catch{u=null;break e}var A=0,B=-1,X=-1,oe=0,xe=0,Se=a,de=null;t:for(;;){for(var ye;Se!==u||S!==0&&Se.nodeType!==3||(B=A+S),Se!==N||m!==0&&Se.nodeType!==3||(X=A+m),Se.nodeType===3&&(A+=Se.nodeValue.length),(ye=Se.firstChild)!==null;)de=Se,Se=ye;for(;;){if(Se===a)break t;if(de===u&&++oe===S&&(B=A),de===N&&++xe===m&&(X=A),(ye=Se.nextSibling)!==null)break;Se=de,de=Se.parentNode}Se=ye}u=B===-1||X===-1?null:{start:B,end:X}}else u=null}u=u||{start:0,end:0}}else u=null;for(Ey={focusedElem:a,selectionRange:u},O0=!1,ja=r;ja!==null;)if(r=ja,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,ja=a;else for(;ja!==null;){switch(r=ja,N=r.alternate,a=r.flags,r.tag){case 0:if((a&4)!==0&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(u=0;u<a.length;u++)S=a[u],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&N!==null){a=void 0,u=r,S=N.memoizedProps,N=N.memoizedState,m=u.stateNode;try{var He=Fi(u.type,S);a=m.getSnapshotBeforeUpdate(He,N),m.__reactInternalSnapshotBeforeUpdate=a}catch(Ie){Ut(u,u.return,Ie)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,u=a.nodeType,u===9)Oy(a);else if(u===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Oy(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(s(163))}if(a=r.sibling,a!==null){a.return=r.return,ja=a;break}ja=r.return}}function Nn(a,r,u){var m=u.flags;switch(u.tag){case 0:case 11:case 15:ar(a,u),m&4&&$s(5,u);break;case 1:if(ar(a,u),m&4)if(a=u.stateNode,r===null)try{a.componentDidMount()}catch(A){Ut(u,u.return,A)}else{var S=Fi(u.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(S,r,a.__reactInternalSnapshotBeforeUpdate)}catch(A){Ut(u,u.return,A)}}m&64&&xr(u),m&512&&vi(u,u.return);break;case 3:if(ar(a,u),m&64&&(a=u.updateQueue,a!==null)){if(r=null,u.child!==null)switch(u.child.tag){case 27:case 5:r=u.child.stateNode;break;case 1:r=u.child.stateNode}try{Ag(a,r)}catch(A){Ut(u,u.return,A)}}break;case 27:r===null&&m&4&&pf(u);case 26:case 5:ar(a,u),r===null&&m&4&&_u(u),m&512&&vi(u,u.return);break;case 12:ar(a,u);break;case 31:ar(a,u),m&4&&Zi(a,u);break;case 13:ar(a,u),m&4&&Fo(a,u),m&64&&(a=u.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(u=g.bind(null,u),m7(a,u))));break;case 22:if(m=u.memoizedState!==null||er,!m){r=r!==null&&r.memoizedState!==null||cn,S=er;var N=cn;er=m,(cn=r)&&!N?$a(a,u,(u.subtreeFlags&8772)!==0):ar(a,u),er=S,cn=N}break;case 30:break;default:ar(a,u)}}function ju(a){var r=a.alternate;r!==null&&(a.alternate=null,ju(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Gs(r)),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 Jt=null,Pa=!1;function tr(a,r,u){for(u=u.child;u!==null;)mf(a,r,u),u=u.sibling}function mf(a,r,u){if(ta&&typeof ta.onCommitFiberUnmount=="function")try{ta.onCommitFiberUnmount(Hs,u)}catch{}switch(u.tag){case 26:cn||Aa(u,r),tr(a,r,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:cn||Aa(u,r);var m=Jt,S=Pa;ac(u.type)&&(Jt=u.stateNode,Pa=!1),tr(a,r,u),zp(u.stateNode),Jt=m,Pa=S;break;case 5:cn||Aa(u,r);case 6:if(m=Jt,S=Pa,Jt=null,tr(a,r,u),Jt=m,Pa=S,Jt!==null)if(Pa)try{(Jt.nodeType===9?Jt.body:Jt.nodeName==="HTML"?Jt.ownerDocument.body:Jt).removeChild(u.stateNode)}catch(N){Ut(u,r,N)}else try{Jt.removeChild(u.stateNode)}catch(N){Ut(u,r,N)}break;case 18:Jt!==null&&(Pa?(a=Jt,Vv(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,u.stateNode),_f(a)):Vv(Jt,u.stateNode));break;case 4:m=Jt,S=Pa,Jt=u.stateNode.containerInfo,Pa=!0,tr(a,r,u),Jt=m,Pa=S;break;case 0:case 11:case 14:case 15:Ma(2,u,r),cn||Ma(4,u,r),tr(a,r,u);break;case 1:cn||(Aa(u,r),m=u.stateNode,typeof m.componentWillUnmount=="function"&&_a(u,r,m)),tr(a,r,u);break;case 21:tr(a,r,u);break;case 22:cn=(m=cn)||u.memoizedState!==null,tr(a,r,u),cn=m;break;default:tr(a,r,u)}}function Zi(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{_f(a)}catch(u){Ut(r,r.return,u)}}}function Fo(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{_f(a)}catch(u){Ut(r,r.return,u)}}function Tp(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new v0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new v0),r;default:throw Error(s(435,a.tag))}}function Si(a,r){var u=Tp(a);r.forEach(function(m){if(!u.has(m)){u.add(m);var S=x.bind(null,a,m);m.then(S,S)}})}function fa(a,r){var u=r.deletions;if(u!==null)for(var m=0;m<u.length;m++){var S=u[m],N=a,A=r,B=A;e:for(;B!==null;){switch(B.tag){case 27:if(ac(B.type)){Jt=B.stateNode,Pa=!1;break e}break;case 5:Jt=B.stateNode,Pa=!1;break e;case 3:case 4:Jt=B.stateNode.containerInfo,Pa=!0;break e}B=B.return}if(Jt===null)throw Error(s(160));mf(N,A,S),Jt=null,Pa=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Ii(r,a),r=r.sibling}var nr=null;function Ii(a,r){var u=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:fa(r,a),ha(a),m&4&&(Ma(3,a,a.return),$s(3,a),Ma(5,a,a.return));break;case 1:fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),m&64&&er&&(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 S=nr;if(fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),m&4){var N=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,S=S.ownerDocument||S;t:switch(m){case"title":N=S.getElementsByTagName("title")[0],(!N||N[Ka]||N[Fe]||N.namespaceURI==="http://www.w3.org/2000/svg"||N.hasAttribute("itemprop"))&&(N=S.createElement(m),S.head.insertBefore(N,S.querySelector("head > title"))),as(N,m,u),N[Fe]=a,Tn(N),m=N;break e;case"link":var A=t2("link","href",S).get(m+(u.href||""));if(A){for(var B=0;B<A.length;B++)if(N=A[B],N.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&N.getAttribute("rel")===(u.rel==null?null:u.rel)&&N.getAttribute("title")===(u.title==null?null:u.title)&&N.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(B,1);break t}}N=S.createElement(m),as(N,m,u),S.head.appendChild(N);break;case"meta":if(A=t2("meta","content",S).get(m+(u.content||""))){for(B=0;B<A.length;B++)if(N=A[B],N.getAttribute("content")===(u.content==null?null:""+u.content)&&N.getAttribute("name")===(u.name==null?null:u.name)&&N.getAttribute("property")===(u.property==null?null:u.property)&&N.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&N.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(B,1);break t}}N=S.createElement(m),as(N,m,u),S.head.appendChild(N);break;default:throw Error(s(468,m))}N[Fe]=a,Tn(N),m=N}a.stateNode=m}else n2(S,a.type,a.stateNode);else a.stateNode=e2(S,m,a.memoizedProps);else N!==m?(N===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):N.count--,m===null?n2(S,a.type,a.stateNode):e2(S,m,a.memoizedProps)):m===null&&a.stateNode!==null&&da(a,a.memoizedProps,u.memoizedProps)}break;case 27:fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),u!==null&&m&4&&da(a,a.memoizedProps,u.memoizedProps);break;case 5:if(fa(r,a),ha(a),m&512&&(cn||u===null||Aa(u,u.return)),a.flags&32){S=a.stateNode;try{Nl(S,"")}catch(He){Ut(a,a.return,He)}}m&4&&a.stateNode!=null&&(S=a.memoizedProps,da(a,S,u!==null?u.memoizedProps:S)),m&1024&&(br=!0);break;case 6:if(fa(r,a),ha(a),m&4){if(a.stateNode===null)throw Error(s(162));m=a.memoizedProps,u=a.stateNode;try{u.nodeValue=m}catch(He){Ut(a,a.return,He)}}break;case 3:if(w0=null,S=nr,nr=j0(r.containerInfo),fa(r,a),nr=S,ha(a),m&4&&u!==null&&u.memoizedState.isDehydrated)try{_f(r.containerInfo)}catch(He){Ut(a,a.return,He)}br&&(br=!1,gf(a));break;case 4:m=nr,nr=j0(a.stateNode.containerInfo),fa(r,a),ha(a),nr=m;break;case 12:fa(r,a),ha(a);break;case 31:fa(r,a),ha(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 13:fa(r,a),ha(a),a.child.flags&8192&&a.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Zo=Xn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 22:S=a.memoizedState!==null;var X=u!==null&&u.memoizedState!==null,oe=er,xe=cn;if(er=oe||S,cn=xe||X,fa(r,a),cn=xe,er=oe,ha(a),m&8192)e:for(r=a.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(u===null||X||er||cn||Fr(a)),u=null,r=a;;){if(r.tag===5||r.tag===26){if(u===null){X=u=r;try{if(N=X.stateNode,S)A=N.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{B=X.stateNode;var Se=X.memoizedProps.style,de=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;B.style.display=de==null||typeof de=="boolean"?"":(""+de).trim()}}catch(He){Ut(X,X.return,He)}}}else if(r.tag===6){if(u===null){X=r;try{X.stateNode.nodeValue=S?"":X.memoizedProps}catch(He){Ut(X,X.return,He)}}}else if(r.tag===18){if(u===null){X=r;try{var ye=X.stateNode;S?Qv(ye,!0):Qv(X.stateNode,!1)}catch(He){Ut(X,X.return,He)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;u===r&&(u=null),r=r.return}u===r&&(u=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(u=m.retryQueue,u!==null&&(m.retryQueue=null,Si(a,u))));break;case 19:fa(r,a),ha(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,Si(a,m)));break;case 30:break;case 21:break;default:fa(r,a),ha(a)}}function ha(a){var r=a.flags;if(r&2){try{for(var u,m=a.return;m!==null;){if(Sn(m)){u=m;break}m=m.return}if(u==null)throw Error(s(160));switch(u.tag){case 27:var S=u.stateNode,N=Nt(a);Wa(a,N,S);break;case 5:var A=u.stateNode;u.flags&32&&(Nl(A,""),u.flags&=-33);var B=Nt(a);Wa(a,B,A);break;case 3:case 4:var X=u.stateNode.containerInfo,oe=Nt(a);Xr(a,oe,X);break;default:throw Error(s(161))}}catch(xe){Ut(a,a.return,xe)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function gf(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;gf(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function ar(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Nn(a,r.alternate,r),r=r.sibling}function Fr(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Ma(4,r,r.return),Fr(r);break;case 1:Aa(r,r.return);var u=r.stateNode;typeof u.componentWillUnmount=="function"&&_a(r,r.return,u),Fr(r);break;case 27:zp(r.stateNode);case 26:case 5:Aa(r,r.return),Fr(r);break;case 22:r.memoizedState===null&&Fr(r);break;case 30:Fr(r);break;default:Fr(r)}a=a.sibling}}function $a(a,r,u){for(u=u&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,S=a,N=r,A=N.flags;switch(N.tag){case 0:case 11:case 15:$a(S,N,u),$s(4,N);break;case 1:if($a(S,N,u),m=N,S=m.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(oe){Ut(m,m.return,oe)}if(m=N,S=m.updateQueue,S!==null){var B=m.stateNode;try{var X=S.shared.hiddenCallbacks;if(X!==null)for(S.shared.hiddenCallbacks=null,S=0;S<X.length;S++)Po(X[S],B)}catch(oe){Ut(m,m.return,oe)}}u&&A&64&&xr(N),vi(N,N.return);break;case 27:pf(N);case 26:case 5:$a(S,N,u),u&&m===null&&A&4&&_u(N),vi(N,N.return);break;case 12:$a(S,N,u);break;case 31:$a(S,N,u),u&&A&4&&Zi(S,N);break;case 13:$a(S,N,u),u&&A&4&&Fo(S,N);break;case 22:N.memoizedState===null&&$a(S,N,u),vi(N,N.return);break;case 30:break;default:$a(S,N,u)}r=r.sibling}}function Ji(a,r){var u=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(u=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==u&&(a!=null&&a.refCount++,u!=null&&Ol(u))}function Vl(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ol(a))}function Da(a,r,u,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Rp(a,r,u,m),r=r.sibling}function Rp(a,r,u,m){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Da(a,r,u,m),S&2048&&$s(9,r);break;case 1:Da(a,r,u,m);break;case 3:Da(a,r,u,m),S&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Ol(a)));break;case 12:if(S&2048){Da(a,r,u,m),a=r.stateNode;try{var N=r.memoizedProps,A=N.id,B=N.onPostCommit;typeof B=="function"&&B(A,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(X){Ut(r,r.return,X)}}else Da(a,r,u,m);break;case 31:Da(a,r,u,m);break;case 13:Da(a,r,u,m);break;case 23:break;case 22:N=r.stateNode,A=r.alternate,r.memoizedState!==null?N._visibility&2?Da(a,r,u,m):Zr(a,r):N._visibility&2?Da(a,r,u,m):(N._visibility|=2,za(a,r,u,m,(r.subtreeFlags&10256)!==0||!1)),S&2048&&Ji(A,r);break;case 24:Da(a,r,u,m),S&2048&&Vl(r.alternate,r);break;default:Da(a,r,u,m)}}function za(a,r,u,m,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var N=a,A=r,B=u,X=m,oe=A.flags;switch(A.tag){case 0:case 11:case 15:za(N,A,B,X,S),$s(8,A);break;case 23:break;case 22:var xe=A.stateNode;A.memoizedState!==null?xe._visibility&2?za(N,A,B,X,S):Zr(N,A):(xe._visibility|=2,za(N,A,B,X,S)),S&&oe&2048&&Ji(A.alternate,A);break;case 24:za(N,A,B,X,S),S&&oe&2048&&Vl(A.alternate,A);break;default:za(N,A,B,X,S)}r=r.sibling}}function Zr(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var u=a,m=r,S=m.flags;switch(m.tag){case 22:Zr(u,m),S&2048&&Ji(m.alternate,m);break;case 24:Zr(u,m),S&2048&&Vl(m.alternate,m);break;default:Zr(u,m)}r=r.sibling}}var Ql=8192;function zs(a,r,u){if(a.subtreeFlags&Ql)for(a=a.child;a!==null;)yf(a,r,u),a=a.sibling}function yf(a,r,u){switch(a.tag){case 26:zs(a,r,u),a.flags&Ql&&a.memoizedState!==null&&E7(u,nr,a.memoizedState,a.memoizedProps);break;case 5:zs(a,r,u);break;case 3:case 4:var m=nr;nr=j0(a.stateNode.containerInfo),zs(a,r,u),nr=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=Ql,Ql=16777216,zs(a,r,u),Ql=m):zs(a,r,u));break;default:zs(a,r,u)}}function Kl(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function Wi(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var m=r[u];ja=m,Gn(m,a)}Kl(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)gs(a),a=a.sibling}function gs(a){switch(a.tag){case 0:case 11:case 15:Wi(a),a.flags&2048&&Ma(9,a,a.return);break;case 3:Wi(a);break;case 12:Wi(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,es(a)):Wi(a);break;default:Wi(a)}}function es(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var u=0;u<r.length;u++){var m=r[u];ja=m,Gn(m,a)}Kl(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Ma(8,r,r.return),es(r);break;case 22:u=r.stateNode,u._visibility&2&&(u._visibility&=-3,es(r));break;default:es(r)}a=a.sibling}}function Gn(a,r){for(;ja!==null;){var u=ja;switch(u.tag){case 0:case 11:case 15:Ma(8,u,r);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:Ol(u.memoizedState.cache)}if(m=u.child,m!==null)m.return=u,ja=m;else e:for(u=a;ja!==null;){m=ja;var S=m.sibling,N=m.return;if(ju(m),m===u){ja=null;break e}if(S!==null){S.return=N,ja=S;break e}ja=N}}}var Ni={getCacheForType:function(a){var r=We(na),u=r.data.get(a);return u===void 0&&(u=a(),r.data.set(a,u)),u},cacheSignal:function(){return We(na).controller.signal}},it=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,ht=null,dt=0,Rt=0,Ya=null,sr=!1,vr=!1,Op=!1,ks=0,Dn=0,Ir=0,$i=0,Cu=0,ts=0,mn=0,Xl=null,Pn=null,Yn=!1,Zo=0,Mp=0,Wn=1/0,zn=null,$n=null,Wt=0,Ls=null,Io=null,rr=0,Jo=0,Wo=null,wu=null,el=0,Fl=null;function Us(){return(Ye&2)!==0&&dt!==0?dt&-dt:Y.T!==null?pe():Ve()}function bt(){if(ts===0)if((dt&536870912)===0||Ct){var a=hr;hr<<=1,(hr&3932160)===0&&(hr=262144),ts=a}else ts=536870912;return a=fs.current,a!==null&&(a.flags|=32),ts}function pt(a,r,u){(a===tt&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)&&(nl(a,0),sa(a,dt,ts,!1)),yn(a,u),((Ye&2)===0||a!==tt)&&(a===tt&&((Ye&2)===0&&($i|=u),Dn===4&&sa(a,dt,ts,!1)),Ce(a))}function vt(a,r,u){if((Ye&6)!==0)throw Error(s(327));var m=!u&&(r&127)===0&&(r&a.expiredLanes)===0||At(a,r),S=m?Eu(a,r):ns(a,r,!0),N=m;do{if(S===0){vr&&!m&&sa(a,r,0,!1);break}else{if(u=a.current.alternate,N&&!$t(u)){S=ns(a,r,!1),N=!1;continue}if(S===2){if(N=r,a.errorRecoveryDisabledLanes&N)var A=0;else A=a.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){r=A;e:{var B=a;S=Xl;var X=B.current.memoizedState.isDehydrated;if(X&&(nl(B,A).flags|=256),A=ns(B,A,!1),A!==2){if(Op&&!X){B.errorRecoveryDisabledLanes|=N,$i|=N,S=4;break e}N=Pn,Pn=S,N!==null&&(Pn===null?Pn=N:Pn.push.apply(Pn,N))}S=A}if(N=!1,S!==2)continue}}if(S===1){nl(a,0),sa(a,r,0,!0);break}e:{switch(m=a,N=S,N){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:sa(m,r,ts,!sr);break e;case 2:Pn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(S=Zo+300-Xn(),10<S)){if(sa(m,r,ts,!sr),Qt(m,0,!0)!==0)break e;rr=r,m.timeoutHandle=Pv(_t.bind(null,m,u,Pn,zn,Yn,r,ts,$i,mn,sr,N,"Throttled",-0,0),S);break e}_t(m,u,Pn,zn,Yn,r,ts,$i,mn,sr,N,null,-0,0)}}break}while(!0);Ce(a)}function _t(a,r,u,m,S,N,A,B,X,oe,xe,Se,de,ye){if(a.timeoutHandle=-1,Se=r.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:oi},yf(r,N,Se);var He=(N&62914560)===N?Zo-Xn():(N&4194048)===N?Mp-Xn():0;if(He=T7(Se,He),He!==null){rr=N,a.cancelPendingCommit=He(ji.bind(null,a,r,N,u,m,S,A,B,X,xe,Se,null,de,ye)),sa(a,N,A,!oe);return}}ji(a,r,N,u,m,S,A,B,X)}function $t(a){for(var r=a;;){var u=r.tag;if((u===0||u===11||u===15)&&r.flags&16384&&(u=r.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var m=0;m<u.length;m++){var S=u[m],N=S.getSnapshot;S=S.value;try{if(!Fa(N(),S))return!1}catch{return!1}}if(u=r.child,r.subtreeFlags&16384&&u!==null)u.return=r,r=u;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function sa(a,r,u,m){r&=~Cu,r&=~$i,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var S=r;0<S;){var N=31-ba(S),A=1<<N;m[N]=-1,S&=~A}u!==0&&oa(a,u,r)}function Sr(){return(Ye&6)===0?(Le(0),!1):!0}function tl(){if(ht!==null){if(Rt===0)var a=ht.return;else a=ht,Br=Gi=null,ep(a),kl=null,Ll=0,a=ht;for(;a!==null;)Ds(a.alternate,a),a=a.return;ht=null}}function nl(a,r){var u=a.timeoutHandle;u!==-1&&(a.timeoutHandle=-1,u7(u)),u=a.cancelPendingCommit,u!==null&&(a.cancelPendingCommit=null,u()),rr=0,tl(),tt=a,ht=u=cs(a.current,null),dt=r,Rt=0,Ya=null,sr=!1,vr=At(a,r),Op=!1,mn=ts=Cu=$i=Ir=Dn=0,Pn=Xl=null,Yn=!1,(r&8)!==0&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var S=31-ba(m),N=1<<S;r|=a[S],m&=~N}return ks=r,iu(),u}function Jr(a,r){rt=null,Y.H=Ko,r===Ml||r===ft?(r=Dl(),Rt=3):r===uu?(r=Dl(),Rt=4):Rt=r===sf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ya=r,ht===null&&(Dn=1,af(a,Rs(r,a.current)))}function kn(){var a=fs.current;return a===null?!0:(dt&4194048)===dt?Ja===null:(dt&62914560)===dt||(dt&536870912)!==0?a===Ja:!1}function _i(){var a=Y.H;return Y.H=Ko,a===null?Ko:a}function al(){var a=Y.A;return Y.A=Ni,a}function $o(){Dn=4,sr||(dt&4194048)!==dt&&fs.current!==null||(vr=!0),(Ir&134217727)===0&&($i&134217727)===0||tt===null||sa(tt,dt,ts,!1)}function ns(a,r,u){var m=Ye;Ye|=2;var S=_i(),N=al();(tt!==a||dt!==r)&&(zn=null,nl(a,r)),r=!1;var A=Dn;e:do try{if(Rt!==0&&ht!==null){var B=ht,X=Ya;switch(Rt){case 8:tl(),A=6;break e;case 3:case 2:case 9:case 6:fs.current===null&&(r=!0);var oe=Rt;if(Rt=0,Ya=null,Zl(a,B,X,oe),u&&vr){A=0;break e}break;default:oe=Rt,Rt=0,Ya=null,Zl(a,B,X,oe)}}ec(),A=Dn;break}catch(xe){Jr(a,xe)}while(!0);return r&&a.shellSuspendCounter++,Br=Gi=null,Ye=m,Y.H=S,Y.A=N,ht===null&&(tt=null,dt=0,iu()),A}function ec(){for(;ht!==null;)xf(ht)}function Eu(a,r){var u=Ye;Ye|=2;var m=_i(),S=al();tt!==a||dt!==r?(zn=null,Wn=Xn()+500,nl(a,r)):vr=At(a,r);e:do try{if(Rt!==0&&ht!==null){r=ht;var N=Ya;t:switch(Rt){case 1:Rt=0,Ya=null,Zl(a,r,N,1);break;case 2:case 9:if(ds(N)){Rt=0,Ya=null,Tu(r);break}r=function(){Rt!==2&&Rt!==9||tt!==a||(Rt=7),Ce(a)},N.then(r,r);break e;case 3:Rt=7;break e;case 4:Rt=5;break e;case 7:ds(N)?(Rt=0,Ya=null,Tu(r)):(Rt=0,Ya=null,Zl(a,r,N,7));break;case 5:var A=null;switch(ht.tag){case 26:A=ht.memoizedState;case 5:case 27:var B=ht;if(A?a2(A):B.stateNode.complete){Rt=0,Ya=null;var X=B.sibling;if(X!==null)ht=X;else{var oe=B.return;oe!==null?(ht=oe,sl(oe)):ht=null}break t}}Rt=0,Ya=null,Zl(a,r,N,5);break;case 6:Rt=0,Ya=null,Zl(a,r,N,6);break;case 8:tl(),Dn=6;break e;default:throw Error(s(462))}}ys();break}catch(xe){Jr(a,xe)}while(!0);return Br=Gi=null,Y.H=m,Y.A=S,Ye=u,ht!==null?0:(tt=null,dt=0,iu(),Dn)}function ys(){for(;ht!==null&&!hn();)xf(ht)}function xf(a){var r=hf(a.alternate,a,ks);a.memoizedProps=a.pendingProps,r===null?sl(a):ht=r}function Tu(a){var r=a,u=r.alternate;switch(r.tag){case 15:case 0:r=bu(u,r,r.pendingProps,r.type,void 0,dt);break;case 11:r=bu(u,r,r.pendingProps,r.type.render,r.ref,dt);break;case 5:ep(r);default:Ds(u,r),r=ht=Ao(r,ks),r=hf(u,r,ks)}a.memoizedProps=a.pendingProps,r===null?sl(a):ht=r}function Zl(a,r,u,m){Br=Gi=null,ep(r),kl=null,Ll=0;var S=r.return;try{if(ua(a,S,r,u,dt)){Dn=1,af(a,Rs(u,a.current)),ht=null;return}}catch(N){if(S!==null)throw ht=S,N;Dn=1,af(a,Rs(u,a.current)),ht=null;return}r.flags&32768?(Ct||m===1?a=!0:vr||(dt&536870912)!==0?a=!1:(sr=a=!0,(m===2||m===9||m===3||m===6)&&(m=fs.current,m!==null&&m.tag===13&&(m.flags|=16384))),Ru(r,a)):sl(r)}function sl(a){var r=a;do{if((r.flags&32768)!==0){Ru(r,sr);return}a=r.return;var u=Nu(r.alternate,r,ks);if(u!==null){ht=u;return}if(r=r.sibling,r!==null){ht=r;return}ht=r=a}while(r!==null);Dn===0&&(Dn=5)}function Ru(a,r){do{var u=Ws(a.alternate,a);if(u!==null){u.flags&=32767,ht=u;return}if(u=a.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!r&&(a=a.sibling,a!==null)){ht=a;return}ht=a=u}while(a!==null);Dn=6,ht=null}function ji(a,r,u,m,S,N,A,B,X){a.cancelPendingCommit=null;do tc();while(Wt!==0);if((Ye&6)!==0)throw Error(s(327));if(r!==null){if(r===a.current)throw Error(s(177));if(N=r.lanes|r.childLanes,N|=va,Ra(a,u,N,A,B,X),a===tt&&(ht=tt=null,dt=0),Io=r,Ls=a,rr=u,Jo=N,Wo=S,wu=m,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,j(la,function(){return bf(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||m){m=Y.T,Y.T=null,S=$.p,$.p=2,A=Ye,Ye|=4;try{vy(a,r,u)}finally{Ye=A,$.p=S,Y.T=m}}Wt=1,ra(),Ci(),Il()}}function ra(){if(Wt===1){Wt=0;var a=Ls,r=Io,u=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var S=Ye;Ye|=4;try{Ii(r,a);var N=Ey,A=Ng(a.containerInfo),B=N.focusedElem,X=N.selectionRange;if(A!==B&&B&&B.ownerDocument&&ln(B.ownerDocument.documentElement,B)){if(X!==null&&Lh(B)){var oe=X.start,xe=X.end;if(xe===void 0&&(xe=oe),"selectionStart"in B)B.selectionStart=oe,B.selectionEnd=Math.min(xe,B.value.length);else{var Se=B.ownerDocument||document,de=Se&&Se.defaultView||window;if(de.getSelection){var ye=de.getSelection(),He=B.textContent.length,Ie=Math.min(X.start,He),dn=X.end===void 0?Ie:Math.min(X.end,He);!ye.extend&&Ie>dn&&(A=dn,dn=Ie,Ie=A);var te=Ro(B,Ie),I=Ro(B,dn);if(te&&I&&(ye.rangeCount!==1||ye.anchorNode!==te.node||ye.anchorOffset!==te.offset||ye.focusNode!==I.node||ye.focusOffset!==I.offset)){var le=Se.createRange();le.setStart(te.node,te.offset),ye.removeAllRanges(),Ie>dn?(ye.addRange(le),ye.extend(I.node,I.offset)):(le.setEnd(I.node,I.offset),ye.addRange(le))}}}}for(Se=[],ye=B;ye=ye.parentNode;)ye.nodeType===1&&Se.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof B.focus=="function"&&B.focus(),B=0;B<Se.length;B++){var ve=Se[B];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}O0=!!wy,Ey=wy=null}finally{Ye=S,$.p=m,Y.T=u}}a.current=r,Wt=2}}function Ci(){if(Wt===2){Wt=0;var a=Ls,r=Io,u=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||u){u=Y.T,Y.T=null;var m=$.p;$.p=2;var S=Ye;Ye|=4;try{Nn(a,r.alternate,r)}finally{Ye=S,$.p=m,Y.T=u}}Wt=3}}function Il(){if(Wt===4||Wt===3){Wt=0,It();var a=Ls,r=Io,u=rr,m=wu;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Wt=5:(Wt=0,Io=Ls=null,Wr(a,a.pendingLanes));var S=a.pendingLanes;if(S===0&&($n=null),et(u),r=r.stateNode,ta&&typeof ta.onCommitFiberRoot=="function")try{ta.onCommitFiberRoot(Hs,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=Y.T,S=$.p,$.p=2,Y.T=null;try{for(var N=a.onRecoverableError,A=0;A<m.length;A++){var B=m[A];N(B.value,{componentStack:B.stack})}}finally{Y.T=r,$.p=S}}(rr&3)!==0&&tc(),Ce(a),S=a.pendingLanes,(u&261930)!==0&&(S&42)!==0?a===Fl?el++:(el=0,Fl=a):el=0,Le(0)}}function Wr(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Ol(r)))}function tc(){return ra(),Ci(),Il(),bf()}function bf(){if(Wt!==5)return!1;var a=Ls,r=Jo;Jo=0;var u=et(rr),m=Y.T,S=$.p;try{$.p=32>u?32:u,Y.T=null,u=Wo,Wo=null;var N=Ls,A=rr;if(Wt=0,Io=Ls=null,rr=0,(Ye&6)!==0)throw Error(s(331));var B=Ye;if(Ye|=4,gs(N.current),Rp(N,N.current,A,u),Ye=B,Le(0,!1),ta&&typeof ta.onPostCommitFiberRoot=="function")try{ta.onPostCommitFiberRoot(Hs,N)}catch{}return!0}finally{$.p=S,Y.T=m,Wr(a,r)}}function Ap(a,r,u){r=Rs(u,r),r=Np(a.stateNode,r,2),a=Vi(a,r,2),a!==null&&(yn(a,2),Ce(a))}function Ut(a,r,u){if(a.tag===3)Ap(a,a,u);else for(;r!==null;){if(r.tag===3){Ap(r,a,u);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&($n===null||!$n.has(m))){a=Rs(u,a),u=_p(2),m=Vi(r,u,2),m!==null&&(m0(u,m,r,a),yn(m,2),Ce(m));break}}r=r.return}}function Ou(a,r,u){var m=a.pingCache;if(m===null){m=a.pingCache=new it;var S=new Set;m.set(r,S)}else S=m.get(r),S===void 0&&(S=new Set,m.set(r,S));S.has(u)||(Op=!0,S.add(u),a=l.bind(null,a,r,u),r.then(a,a))}function l(a,r,u){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&u,a.warmLanes&=~u,tt===a&&(dt&u)===u&&(Dn===4||Dn===3&&(dt&62914560)===dt&&300>Xn()-Zo?(Ye&2)===0&&nl(a,0):Cu|=u,mn===dt&&(mn=0)),Ce(a)}function c(a,r){r===0&&(r=rn()),a=Za(a,r),a!==null&&(yn(a,r),Ce(a))}function g(a){var r=a.memoizedState,u=0;r!==null&&(u=r.retryLane),c(a,u)}function x(a,r){var u=0;switch(a.tag){case 31:case 13:var m=a.stateNode,S=a.memoizedState;S!==null&&(u=S.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(r),c(a,u)}function j(a,r){return Et(a,r)}var E=null,H=null,Z=!1,ge=!1,Ne=!1,Oe=0;function Ce(a){a!==H&&a.next===null&&(H===null?E=H=a:H=H.next=a),ge=!0,Z||(Z=!0,se())}function Le(a,r){if(!Ne&&ge){Ne=!0;do for(var u=!1,m=E;m!==null;){if(a!==0){var S=m.pendingLanes;if(S===0)var N=0;else{var A=m.suspendedLanes,B=m.pingedLanes;N=(1<<31-ba(42|a)+1)-1,N&=S&~(A&~B),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(u=!0,ue(m,N))}else N=dt,N=Qt(m,m===tt?N:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),(N&3)===0||At(m,N)||(u=!0,ue(m,N));m=m.next}while(u);Ne=!1}}function st(){Ca()}function Ca(){ge=Z=!1;var a=0;Oe!==0&&c7()&&(a=Oe);for(var r=Xn(),u=null,m=E;m!==null;){var S=m.next,N=nc(m,r);N===0?(m.next=null,u===null?E=S:u.next=S,S===null&&(H=u)):(u=m,(a!==0||(N&3)!==0)&&(ge=!0)),m=S}Wt!==0&&Wt!==5||Le(a),Oe!==0&&(Oe=0)}function nc(a,r){for(var u=a.suspendedLanes,m=a.pingedLanes,S=a.expirationTimes,N=a.pendingLanes&-62914561;0<N;){var A=31-ba(N),B=1<<A,X=S[A];X===-1?((B&u)===0||(B&m)!==0)&&(S[A]=Hn(B,r)):X<=r&&(a.expiredLanes|=B),N&=~B}if(r=tt,u=dt,u=Qt(a,a===r?u:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,u===0||a===r&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&qn(m),a.callbackNode=null,a.callbackPriority=0;if((u&3)===0||At(a,u)){if(r=u&-u,r===a.callbackPriority)return r;switch(m!==null&&qn(m),et(u)){case 2:case 8:u=Qa;break;case 32:u=la;break;case 268435456:u=rs;break;default:u=la}return m=rl.bind(null,a),u=Et(u,m),a.callbackPriority=r,a.callbackNode=u,r}return m!==null&&m!==null&&qn(m),a.callbackPriority=2,a.callbackNode=null,2}function rl(a,r){if(Wt!==0&&Wt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var u=a.callbackNode;if(tc()&&a.callbackNode!==u)return null;var m=dt;return m=Qt(a,a===tt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(vt(a,m,r),nc(a,Xn()),a.callbackNode!=null&&a.callbackNode===u?rl.bind(null,a):null)}function ue(a,r){if(tc())return null;vt(a,r,!0)}function se(){d7(function(){(Ye&6)!==0?Et(dr,st):Ca()})}function pe(){if(Oe===0){var a=pi;a===0&&(a=_s,_s<<=1,(_s&261888)===0&&(_s=256)),Oe=a}return Oe}function Te(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Kc(""+a)}function Xe(a,r){var u=r.ownerDocument.createElement("input");return u.name=r.name,u.value=r.value,a.id&&u.setAttribute("form",a.id),r.parentNode.insertBefore(u,r),a=new FormData(a),u.parentNode.removeChild(u),a}function Ln(a,r,u,m,S){if(r==="submit"&&u&&u.stateNode===S){var N=Te((S[ut]||null).action),A=m.submitter;A&&(r=(r=A[ut]||null)?Te(r.formAction):A.getAttribute("formAction"),r!==null&&(N=r,A=null));var B=new Zc("action","action",null,m,S);a.push({event:B,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(Oe!==0){var X=A?Xe(S,A):new FormData(S);pp(u,{pending:!0,data:X,method:S.method,action:N},null,X)}}else typeof N=="function"&&(B.preventDefault(),X=A?Xe(S,A):new FormData(S),pp(u,{pending:!0,data:X,method:S.method,action:N},N,X))},currentTarget:S}]})}}for(var Ze=0;Ze<su.length;Ze++){var Dt=su[Ze],wa=Dt.toLowerCase(),Bt=Dt[0].toUpperCase()+Dt.slice(1);Qs(wa,"on"+Bt)}Qs(Md,"onAnimationEnd"),Qs(au,"onAnimationIteration"),Qs(qh,"onAnimationStart"),Qs("dblclick","onDoubleClick"),Qs("focusin","onFocus"),Qs("focusout","onBlur"),Qs(jg,"onTransitionRun"),Qs(fy,"onTransitionStart"),Qs(Cg,"onTransitionCancel"),Qs(Hh,"onTransitionEnd"),ws("onMouseEnter",["mouseout","mouseover"]),ws("onMouseLeave",["mouseout","mouseover"]),ws("onPointerEnter",["pointerout","pointerover"]),ws("onPointerLeave",["pointerout","pointerover"]),Mi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Mi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Mi("onBeforeInput",["compositionend","keypress","textInput","paste"]),Mi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Mi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="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(" "),Sy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ir));function zv(a,r){r=(r&4)!==0;for(var u=0;u<a.length;u++){var m=a[u],S=m.event;m=m.listeners;e:{var N=void 0;if(r)for(var A=m.length-1;0<=A;A--){var B=m[A],X=B.instance,oe=B.currentTarget;if(B=B.listener,X!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(xe){ru(xe)}S.currentTarget=null,N=X}else for(A=0;A<m.length;A++){if(B=m[A],X=B.instance,oe=B.currentTarget,B=B.listener,X!==N&&S.isPropagationStopped())break e;N=B,S.currentTarget=oe;try{N(S)}catch(xe){ru(xe)}S.currentTarget=null,N=X}}}}function Ot(a,r){var u=r[Tt];u===void 0&&(u=r[Tt]=new Set);var m=a+"__bubble";u.has(m)||(kv(r,a,2,!1),u.add(m))}function Ny(a,r,u){var m=0;r&&(m|=4),kv(u,a,m,r)}var S0="_reactListening"+Math.random().toString(36).slice(2);function _y(a){if(!a[S0]){a[S0]=!0,Cs.forEach(function(u){u!=="selectionchange"&&(Sy.has(u)||Ny(u,!1,a),Ny(u,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[S0]||(r[S0]=!0,Ny("selectionchange",!1,r))}}function kv(a,r,u,m){switch(u2(r)){case 2:var S=M7;break;case 8:S=A7;break;default:S=qy}u=S.bind(null,r,u,a),S=void 0,!vh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),m?S!==void 0?a.addEventListener(r,u,{capture:!0,passive:S}):a.addEventListener(r,u,!0):S!==void 0?a.addEventListener(r,u,{passive:S}):a.addEventListener(r,u,!1)}function jy(a,r,u,m,S){var N=m;if((r&1)===0&&(r&2)===0&&m!==null)e:for(;;){if(m===null)return;var A=m.tag;if(A===3||A===4){var B=m.stateNode.containerInfo;if(B===S)break;if(A===4)for(A=m.return;A!==null;){var X=A.tag;if((X===3||X===4)&&A.stateNode.containerInfo===S)return;A=A.return}for(;B!==null;){if(A=Pt(B),A===null)return;if(X=A.tag,X===5||X===6||X===26||X===27){m=N=A;continue e}B=B.parentNode}}m=m.return}bh(function(){var oe=N,xe=xd(u),Se=[];e:{var de=Vs.get(a);if(de!==void 0){var ye=Zc,He=a;switch(a){case"keypress":if(Fc(u)===0)break e;case"keydown":case"keyup":ye=Cl;break;case"focusin":He="focus",ye=Nd;break;case"focusout":He="blur",ye=Nd;break;case"beforeblur":case"afterblur":ye=Nd;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":ye=Sh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=sg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=ug;break;case Md:case au:case qh:ye=cy;break;case Hh:ye=dy;break;case"scroll":case"scrollend":ye=ng;break;case"wheel":ye=fg;break;case"copy":case"cut":case"paste":ye=ig;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ye=jh;break;case"toggle":case"beforetoggle":ye=pg}var Ie=(r&4)!==0,dn=!Ie&&(a==="scroll"||a==="scrollend"),te=Ie?de!==null?de+"Capture":null:de;Ie=[];for(var I=oe,le;I!==null;){var ve=I;if(le=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||le===null||te===null||(ve=vo(I,te),ve!=null&&Ie.push(Dp(I,ve,le))),dn)break;I=I.return}0<Ie.length&&(de=new ye(de,He,null,u,xe),Se.push({event:de,listeners:Ie}))}}if((r&7)===0){e:{if(de=a==="mouseover"||a==="pointerover",ye=a==="mouseout"||a==="pointerout",de&&u!==yd&&(He=u.relatedTarget||u.fromElement)&&(Pt(He)||He[sn]))break e;if((ye||de)&&(de=xe.window===xe?xe:(de=xe.ownerDocument)?de.defaultView||de.parentWindow:window,ye?(He=u.relatedTarget||u.toElement,ye=oe,He=He?Pt(He):null,He!==null&&(dn=o(He),Ie=He.tag,He!==dn||Ie!==5&&Ie!==27&&Ie!==6)&&(He=null)):(ye=null,He=oe),ye!==He)){if(Ie=Sh,ve="onMouseLeave",te="onMouseEnter",I="mouse",(a==="pointerout"||a==="pointerover")&&(Ie=jh,ve="onPointerLeave",te="onPointerEnter",I="pointer"),dn=ye==null?de:mr(ye),le=He==null?de:mr(He),de=new Ie(ve,I+"leave",ye,u,xe),de.target=dn,de.relatedTarget=le,ve=null,Pt(xe)===oe&&(Ie=new Ie(te,I+"enter",He,u,xe),Ie.target=le,Ie.relatedTarget=dn,ve=Ie),dn=ve,ye&&He)t:{for(Ie=s7,te=ye,I=He,le=0,ve=te;ve;ve=Ie(ve))le++;ve=0;for(var Ke=I;Ke;Ke=Ie(Ke))ve++;for(;0<le-ve;)te=Ie(te),le--;for(;0<ve-le;)I=Ie(I),ve--;for(;le--;){if(te===I||I!==null&&te===I.alternate){Ie=te;break t}te=Ie(te),I=Ie(I)}Ie=null}else Ie=null;ye!==null&&Lv(Se,de,ye,Ie,!1),He!==null&&dn!==null&&Lv(Se,dn,He,Ie,!0)}}e:{if(de=oe?mr(oe):window,ye=de.nodeName&&de.nodeName.toLowerCase(),ye==="select"||ye==="input"&&de.type==="file")var Kt=Mh;else if(Oh(de))if(Ar)Kt=Sg;else{Kt=zh;var Pe=bg}else ye=de.nodeName,!ye||ye.toLowerCase()!=="input"||de.type!=="checkbox"&&de.type!=="radio"?oe&&gd(oe.elementType)&&(Kt=Mh):Kt=vg;if(Kt&&(Kt=Kt(a,oe))){Rd(Se,Kt,u,xe);break e}Pe&&Pe(a,de,oe),a==="focusout"&&oe&&de.type==="number"&&oe.memoizedProps.value!=null&&gr(de,"number",de.value)}switch(Pe=oe?mr(oe):window,a){case"focusin":(Oh(Pe)||Pe.contentEditable==="true")&&(Dr=Pe,zr=oe,Oo=null);break;case"focusout":Oo=zr=Dr=null;break;case"mousedown":Od=!0;break;case"contextmenu":case"mouseup":case"dragend":Od=!1,Mo(Se,u,xe);break;case"selectionchange":if(_g)break;case"keydown":case"keyup":Mo(Se,u,xe)}var gt;if(wl)e:{switch(a){case"compositionstart":var zt="onCompositionStart";break e;case"compositionend":zt="onCompositionEnd";break e;case"compositionupdate":zt="onCompositionUpdate";break e}zt=void 0}else El?Td(a,u)&&(zt="onCompositionEnd"):a==="keydown"&&u.keyCode===229&&(zt="onCompositionStart");zt&&(wh&&u.locale!=="ko"&&(El||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&El&&(gt=Xc()):(Ts=xe,vd="value"in Ts?Ts.value:Ts.textContent,El=!0)),Pe=N0(oe,zt),0<Pe.length&&(zt=new _d(zt,a,null,u,xe),Se.push({event:zt,listeners:Pe}),gt?zt.data=gt:(gt=Eh(u),gt!==null&&(zt.data=gt)))),(gt=Ed?yg(a,u):Th(a,u))&&(zt=N0(oe,"onBeforeInput"),0<zt.length&&(Pe=new _d("onBeforeInput","beforeinput",null,u,xe),Se.push({event:Pe,listeners:zt}),Pe.data=gt)),Ln(Se,a,oe,u,xe)}zv(Se,r)})}function Dp(a,r,u){return{instance:a,listener:r,currentTarget:u}}function N0(a,r){for(var u=r+"Capture",m=[];a!==null;){var S=a,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=vo(a,u),S!=null&&m.unshift(Dp(a,S,N)),S=vo(a,r),S!=null&&m.push(Dp(a,S,N))),a.tag===3)return m;a=a.return}return[]}function s7(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Lv(a,r,u,m,S){for(var N=r._reactName,A=[];u!==null&&u!==m;){var B=u,X=B.alternate,oe=B.stateNode;if(B=B.tag,X!==null&&X===m)break;B!==5&&B!==26&&B!==27||oe===null||(X=oe,S?(oe=vo(u,N),oe!=null&&A.unshift(Dp(u,oe,X))):S||(oe=vo(u,N),oe!=null&&A.push(Dp(u,oe,X)))),u=u.return}A.length!==0&&a.push({event:r,listeners:A})}var r7=/\r\n?/g,i7=/\u0000|\uFFFD/g;function Uv(a){return(typeof a=="string"?a:""+a).replace(r7,`
|
|
49
|
-
`).replace(i7,"")}function qv(a,r){return r=Uv(r),Uv(a)===r}function un(a,r,u,m,S,N){switch(u){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&Nl(a,""+m);break;case"className":Vc(a,"class",m);break;case"tabIndex":Vc(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Vc(a,u,m);break;case"style":gh(a,m,N);break;case"data":if(r!=="object"){Vc(a,"data",m);break}case"src":case"href":if(m===""&&(r!=="a"||u!=="href")){a.removeAttribute(u);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Kc(""+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 N=="function"&&(u==="formAction"?(r!=="input"&&un(a,r,"name",S.name,S,null),un(a,r,"formEncType",S.formEncType,S,null),un(a,r,"formMethod",S.formMethod,S,null),un(a,r,"formTarget",S.formTarget,S,null)):(un(a,r,"encType",S.encType,S,null),un(a,r,"method",S.method,S,null),un(a,r,"target",S.target,S,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(u);break}m=Kc(""+m),a.setAttribute(u,m);break;case"onClick":m!=null&&(a.onclick=oi);break;case"onScroll":m!=null&&Ot("scroll",a);break;case"onScrollEnd":m!=null&&Ot("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(u=m.__html,u!=null){if(S.children!=null)throw Error(s(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=Kc(""+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":Ot("beforetoggle",a),Ot("toggle",a),xo(a,"popover",m);break;case"xlinkActuate":Or(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Or(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Or(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Or(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Or(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Or(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Or(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Or(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Or(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":xo(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=eg.get(u)||u,xo(a,u,m))}}function Cy(a,r,u,m,S,N){switch(u){case"style":gh(a,m,N);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(u=m.__html,u!=null){if(S.children!=null)throw Error(s(60));a.innerHTML=u}}break;case"children":typeof m=="string"?Nl(a,m):(typeof m=="number"||typeof m=="bigint")&&Nl(a,""+m);break;case"onScroll":m!=null&&Ot("scroll",a);break;case"onScrollEnd":m!=null&&Ot("scrollend",a);break;case"onClick":m!=null&&(a.onclick=oi);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ud.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(S=u.endsWith("Capture"),r=u.slice(2,S?u.length-7:void 0),N=a[ut]||null,N=N!=null?N[u]:null,typeof N=="function"&&a.removeEventListener(r,N,S),typeof m=="function")){typeof N!="function"&&N!==null&&(u in a?a[u]=null:a.hasAttribute(u)&&a.removeAttribute(u)),a.addEventListener(r,m,S);break e}u in a?a[u]=m:m===!0?a.setAttribute(u,""):xo(a,u,m)}}}function as(a,r,u){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ot("error",a),Ot("load",a);var m=!1,S=!1,N;for(N in u)if(u.hasOwnProperty(N)){var A=u[N];if(A!=null)switch(N){case"src":m=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:un(a,r,N,A,u,null)}}S&&un(a,r,"srcSet",u.srcSet,u,null),m&&un(a,r,"src",u.src,u,null);return;case"input":Ot("invalid",a);var B=N=A=S=null,X=null,oe=null;for(m in u)if(u.hasOwnProperty(m)){var xe=u[m];if(xe!=null)switch(m){case"name":S=xe;break;case"type":A=xe;break;case"checked":X=xe;break;case"defaultChecked":oe=xe;break;case"value":N=xe;break;case"defaultValue":B=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,r));break;default:un(a,r,m,xe,u,null)}}hd(a,N,B,X,oe,A,S,!1);return;case"select":Ot("invalid",a),m=A=N=null;for(S in u)if(u.hasOwnProperty(S)&&(B=u[S],B!=null))switch(S){case"value":N=B;break;case"defaultValue":A=B;break;case"multiple":m=B;default:un(a,r,S,B,u,null)}r=N,u=A,a.multiple=!!m,r!=null?li(a,!!m,r,!1):u!=null&&li(a,!!m,u,!0);return;case"textarea":Ot("invalid",a),N=S=m=null;for(A in u)if(u.hasOwnProperty(A)&&(B=u[A],B!=null))switch(A){case"value":m=B;break;case"defaultValue":S=B;break;case"children":N=B;break;case"dangerouslySetInnerHTML":if(B!=null)throw Error(s(91));break;default:un(a,r,A,B,u,null)}md(a,m,S,N);return;case"option":for(X in u)if(u.hasOwnProperty(X)&&(m=u[X],m!=null))switch(X){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:un(a,r,X,m,u,null)}return;case"dialog":Ot("beforetoggle",a),Ot("toggle",a),Ot("cancel",a),Ot("close",a);break;case"iframe":case"object":Ot("load",a);break;case"video":case"audio":for(m=0;m<ir.length;m++)Ot(ir[m],a);break;case"image":Ot("error",a),Ot("load",a);break;case"details":Ot("toggle",a);break;case"embed":case"source":case"link":Ot("error",a),Ot("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(oe in u)if(u.hasOwnProperty(oe)&&(m=u[oe],m!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:un(a,r,oe,m,u,null)}return;default:if(gd(r)){for(xe in u)u.hasOwnProperty(xe)&&(m=u[xe],m!==void 0&&Cy(a,r,xe,m,u,void 0));return}}for(B in u)u.hasOwnProperty(B)&&(m=u[B],m!=null&&un(a,r,B,m,u,null))}function l7(a,r,u,m){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var S=null,N=null,A=null,B=null,X=null,oe=null,xe=null;for(ye in u){var Se=u[ye];if(u.hasOwnProperty(ye)&&Se!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":X=Se;default:m.hasOwnProperty(ye)||un(a,r,ye,null,m,Se)}}for(var de in m){var ye=m[de];if(Se=u[de],m.hasOwnProperty(de)&&(ye!=null||Se!=null))switch(de){case"type":N=ye;break;case"name":S=ye;break;case"checked":oe=ye;break;case"defaultChecked":xe=ye;break;case"value":A=ye;break;case"defaultValue":B=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,r));break;default:ye!==Se&&un(a,r,de,ye,m,Se)}}bo(a,A,B,X,oe,xe,N,S);return;case"select":ye=A=B=de=null;for(N in u)if(X=u[N],u.hasOwnProperty(N)&&X!=null)switch(N){case"value":break;case"multiple":ye=X;default:m.hasOwnProperty(N)||un(a,r,N,null,m,X)}for(S in m)if(N=m[S],X=u[S],m.hasOwnProperty(S)&&(N!=null||X!=null))switch(S){case"value":de=N;break;case"defaultValue":B=N;break;case"multiple":A=N;default:N!==X&&un(a,r,S,N,m,X)}r=B,u=A,m=ye,de!=null?li(a,!!u,de,!1):!!m!=!!u&&(r!=null?li(a,!!u,r,!0):li(a,!!u,u?[]:"",!1));return;case"textarea":ye=de=null;for(B in u)if(S=u[B],u.hasOwnProperty(B)&&S!=null&&!m.hasOwnProperty(B))switch(B){case"value":break;case"children":break;default:un(a,r,B,null,m,S)}for(A in m)if(S=m[A],N=u[A],m.hasOwnProperty(A)&&(S!=null||N!=null))switch(A){case"value":de=S;break;case"defaultValue":ye=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:S!==N&&un(a,r,A,S,m,N)}pd(a,de,ye);return;case"option":for(var He in u)if(de=u[He],u.hasOwnProperty(He)&&de!=null&&!m.hasOwnProperty(He))switch(He){case"selected":a.selected=!1;break;default:un(a,r,He,null,m,de)}for(X in m)if(de=m[X],ye=u[X],m.hasOwnProperty(X)&&de!==ye&&(de!=null||ye!=null))switch(X){case"selected":a.selected=de&&typeof de!="function"&&typeof de!="symbol";break;default:un(a,r,X,de,m,ye)}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 Ie in u)de=u[Ie],u.hasOwnProperty(Ie)&&de!=null&&!m.hasOwnProperty(Ie)&&un(a,r,Ie,null,m,de);for(oe in m)if(de=m[oe],ye=u[oe],m.hasOwnProperty(oe)&&de!==ye&&(de!=null||ye!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(de!=null)throw Error(s(137,r));break;default:un(a,r,oe,de,m,ye)}return;default:if(gd(r)){for(var dn in u)de=u[dn],u.hasOwnProperty(dn)&&de!==void 0&&!m.hasOwnProperty(dn)&&Cy(a,r,dn,void 0,m,de);for(xe in m)de=m[xe],ye=u[xe],!m.hasOwnProperty(xe)||de===ye||de===void 0&&ye===void 0||Cy(a,r,xe,de,m,ye);return}}for(var te in u)de=u[te],u.hasOwnProperty(te)&&de!=null&&!m.hasOwnProperty(te)&&un(a,r,te,null,m,de);for(Se in m)de=m[Se],ye=u[Se],!m.hasOwnProperty(Se)||de===ye||de==null&&ye==null||un(a,r,Se,de,m,ye)}function Hv(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function o7(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,u=performance.getEntriesByType("resource"),m=0;m<u.length;m++){var S=u[m],N=S.transferSize,A=S.initiatorType,B=S.duration;if(N&&B&&Hv(A)){for(A=0,B=S.responseEnd,m+=1;m<u.length;m++){var X=u[m],oe=X.startTime;if(oe>B)break;var xe=X.transferSize,Se=X.initiatorType;xe&&Hv(Se)&&(X=X.responseEnd,A+=xe*(X<B?1:(B-oe)/(X-oe)))}if(--m,r+=8*(N+A)/(S.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var wy=null,Ey=null;function _0(a){return a.nodeType===9?a:a.ownerDocument}function Bv(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 Gv(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Ty(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var Ry=null;function c7(){var a=window.event;return a&&a.type==="popstate"?a===Ry?!1:(Ry=a,!0):(Ry=null,!1)}var Pv=typeof setTimeout=="function"?setTimeout:void 0,u7=typeof clearTimeout=="function"?clearTimeout:void 0,Yv=typeof Promise=="function"?Promise:void 0,d7=typeof queueMicrotask=="function"?queueMicrotask:typeof Yv<"u"?function(a){return Yv.resolve(null).then(a).catch(f7)}:Pv;function f7(a){setTimeout(function(){throw a})}function ac(a){return a==="head"}function Vv(a,r){var u=r,m=0;do{var S=u.nextSibling;if(a.removeChild(u),S&&S.nodeType===8)if(u=S.data,u==="/$"||u==="/&"){if(m===0){a.removeChild(S),_f(r);return}m--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")m++;else if(u==="html")zp(a.ownerDocument.documentElement);else if(u==="head"){u=a.ownerDocument.head,zp(u);for(var N=u.firstChild;N;){var A=N.nextSibling,B=N.nodeName;N[Ka]||B==="SCRIPT"||B==="STYLE"||B==="LINK"&&N.rel.toLowerCase()==="stylesheet"||u.removeChild(N),N=A}}else u==="body"&&zp(a.ownerDocument.body);u=S}while(u);_f(r)}function Qv(a,r){var u=a;a=0;do{var m=u.nextSibling;if(u.nodeType===1?r?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(r?(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 Oy(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var u=r;switch(r=r.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":Oy(u),Gs(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}a.removeChild(u)}}function h7(a,r,u,m){for(;a.nodeType===1;){var S=u;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Ka])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(N=a.getAttribute("rel"),N==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(N!==S.rel||a.getAttribute("href")!==(S.href==null||S.href===""?null:S.href)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin)||a.getAttribute("title")!==(S.title==null?null:S.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(N=a.getAttribute("src"),(N!==(S.src==null?null:S.src)||a.getAttribute("type")!==(S.type==null?null:S.type)||a.getAttribute("crossorigin")!==(S.crossOrigin==null?null:S.crossOrigin))&&N&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var N=S.name==null?null:""+S.name;if(S.type==="hidden"&&a.getAttribute("name")===N)return a}else return a;if(a=$r(a.nextSibling),a===null)break}return null}function p7(a,r,u){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!u||(a=$r(a.nextSibling),a===null))return null;return a}function Kv(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=$r(a.nextSibling),a===null))return null;return a}function My(a){return a.data==="$?"||a.data==="$~"}function Ay(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function m7(a,r){var u=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||u.readyState!=="loading")r();else{var m=function(){r(),u.removeEventListener("DOMContentLoaded",m)};u.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function $r(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var Dy=null;function Xv(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="/$"||u==="/&"){if(r===0)return $r(a.nextSibling);r--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||r++}a=a.nextSibling}return null}function Fv(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var u=a.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(r===0)return a;r--}else u!=="/$"&&u!=="/&"||r++}a=a.previousSibling}return null}function Zv(a,r,u){switch(r=_0(u),a){case"html":if(a=r.documentElement,!a)throw Error(s(452));return a;case"head":if(a=r.head,!a)throw Error(s(453));return a;case"body":if(a=r.body,!a)throw Error(s(454));return a;default:throw Error(s(451))}}function zp(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Gs(a)}var ei=new Map,Iv=new Set;function j0(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Jl=$.d;$.d={f:g7,r:y7,D:x7,C:b7,L:v7,m:S7,X:_7,S:N7,M:j7};function g7(){var a=Jl.f(),r=Sr();return a||r}function y7(a){var r=pr(a);r!==null&&r.tag===5&&r.type==="form"?i0(r):Jl.r(a)}var vf=typeof document>"u"?null:document;function Jv(a,r,u){var m=vf;if(m&&typeof r=="string"&&r){var S=Ha(r);S='link[rel="'+a+'"][href="'+S+'"]',typeof u=="string"&&(S+='[crossorigin="'+u+'"]'),Iv.has(S)||(Iv.add(S),a={rel:a,crossOrigin:u,href:r},m.querySelector(S)===null&&(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function x7(a){Jl.D(a),Jv("dns-prefetch",a,null)}function b7(a,r){Jl.C(a,r),Jv("preconnect",a,r)}function v7(a,r,u){Jl.L(a,r,u);var m=vf;if(m&&a&&r){var S='link[rel="preload"][as="'+Ha(r)+'"]';r==="image"&&u&&u.imageSrcSet?(S+='[imagesrcset="'+Ha(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(S+='[imagesizes="'+Ha(u.imageSizes)+'"]')):S+='[href="'+Ha(a)+'"]';var N=S;switch(r){case"style":N=Sf(a);break;case"script":N=Nf(a)}ei.has(N)||(a=v({rel:"preload",href:r==="image"&&u&&u.imageSrcSet?void 0:a,as:r},u),ei.set(N,a),m.querySelector(S)!==null||r==="style"&&m.querySelector(kp(N))||r==="script"&&m.querySelector(Lp(N))||(r=m.createElement("link"),as(r,"link",a),Tn(r),m.head.appendChild(r)))}}function S7(a,r){Jl.m(a,r);var u=vf;if(u&&a){var m=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+Ha(m)+'"][href="'+Ha(a)+'"]',N=S;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=Nf(a)}if(!ei.has(N)&&(a=v({rel:"modulepreload",href:a},r),ei.set(N,a),u.querySelector(S)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Lp(N)))return}m=u.createElement("link"),as(m,"link",a),Tn(m),u.head.appendChild(m)}}}function N7(a,r,u){Jl.S(a,r,u);var m=vf;if(m&&a){var S=js(m).hoistableStyles,N=Sf(a);r=r||"default";var A=S.get(N);if(!A){var B={loading:0,preload:null};if(A=m.querySelector(kp(N)))B.loading=5;else{a=v({rel:"stylesheet",href:a,"data-precedence":r},u),(u=ei.get(N))&&zy(a,u);var X=A=m.createElement("link");Tn(X),as(X,"link",a),X._p=new Promise(function(oe,xe){X.onload=oe,X.onerror=xe}),X.addEventListener("load",function(){B.loading|=1}),X.addEventListener("error",function(){B.loading|=2}),B.loading|=4,C0(A,r,m)}A={type:"stylesheet",instance:A,count:1,state:B},S.set(N,A)}}}function _7(a,r){Jl.X(a,r);var u=vf;if(u&&a){var m=js(u).hoistableScripts,S=Nf(a),N=m.get(S);N||(N=u.querySelector(Lp(S)),N||(a=v({src:a,async:!0},r),(r=ei.get(S))&&ky(a,r),N=u.createElement("script"),Tn(N),as(N,"link",a),u.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},m.set(S,N))}}function j7(a,r){Jl.M(a,r);var u=vf;if(u&&a){var m=js(u).hoistableScripts,S=Nf(a),N=m.get(S);N||(N=u.querySelector(Lp(S)),N||(a=v({src:a,async:!0,type:"module"},r),(r=ei.get(S))&&ky(a,r),N=u.createElement("script"),Tn(N),as(N,"link",a),u.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},m.set(S,N))}}function Wv(a,r,u,m){var S=(S=me.current)?j0(S):null;if(!S)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(r=Sf(u.href),u=js(S).hoistableStyles,m=u.get(r),m||(m={type:"style",instance:null,count:0,state:null},u.set(r,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=Sf(u.href);var N=js(S).hoistableStyles,A=N.get(a);if(A||(S=S.ownerDocument||S,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(a,A),(N=S.querySelector(kp(a)))&&!N._p&&(A.instance=N,A.state.loading=5),ei.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},ei.set(a,u),N||C7(S,a,u,A.state))),r&&m===null)throw Error(s(528,""));return A}if(r&&m!==null)throw Error(s(529,""));return null;case"script":return r=u.async,u=u.src,typeof u=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=Nf(u),u=js(S).hoistableScripts,m=u.get(r),m||(m={type:"script",instance:null,count:0,state:null},u.set(r,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function Sf(a){return'href="'+Ha(a)+'"'}function kp(a){return'link[rel="stylesheet"]['+a+"]"}function $v(a){return v({},a,{"data-precedence":a.precedence,precedence:null})}function C7(a,r,u,m){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?m.loading=1:(r=a.createElement("link"),m.preload=r,r.addEventListener("load",function(){return m.loading|=1}),r.addEventListener("error",function(){return m.loading|=2}),as(r,"link",u),Tn(r),a.head.appendChild(r))}function Nf(a){return'[src="'+Ha(a)+'"]'}function Lp(a){return"script[async]"+a}function e2(a,r,u){if(r.count++,r.instance===null)switch(r.type){case"style":var m=a.querySelector('style[data-href~="'+Ha(u.href)+'"]');if(m)return r.instance=m,Tn(m),m;var S=v({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Tn(m),as(m,"style",S),C0(m,u.precedence,a),r.instance=m;case"stylesheet":S=Sf(u.href);var N=a.querySelector(kp(S));if(N)return r.state.loading|=4,r.instance=N,Tn(N),N;m=$v(u),(S=ei.get(S))&&zy(m,S),N=(a.ownerDocument||a).createElement("link"),Tn(N);var A=N;return A._p=new Promise(function(B,X){A.onload=B,A.onerror=X}),as(N,"link",m),r.state.loading|=4,C0(N,u.precedence,a),r.instance=N;case"script":return N=Nf(u.src),(S=a.querySelector(Lp(N)))?(r.instance=S,Tn(S),S):(m=u,(S=ei.get(N))&&(m=v({},u),ky(m,S)),a=a.ownerDocument||a,S=a.createElement("script"),Tn(S),as(S,"link",m),a.head.appendChild(S),r.instance=S);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&(r.state.loading&4)===0&&(m=r.instance,r.state.loading|=4,C0(m,u.precedence,a));return r.instance}function C0(a,r,u){for(var m=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=m.length?m[m.length-1]:null,N=S,A=0;A<m.length;A++){var B=m[A];if(B.dataset.precedence===r)N=B;else if(N!==S)break}N?N.parentNode.insertBefore(a,N.nextSibling):(r=u.nodeType===9?u.head:u,r.insertBefore(a,r.firstChild))}function zy(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function ky(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var w0=null;function t2(a,r,u){if(w0===null){var m=new Map,S=w0=new Map;S.set(u,m)}else S=w0,m=S.get(u),m||(m=new Map,S.set(u,m));if(m.has(a))return m;for(m.set(a,null),u=u.getElementsByTagName(a),S=0;S<u.length;S++){var N=u[S];if(!(N[Ka]||N[Fe]||a==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var A=N.getAttribute(r)||"";A=a+A;var B=m.get(A);B?B.push(N):m.set(A,[N])}}return m}function n2(a,r,u){a=a.ownerDocument||a,a.head.insertBefore(u,r==="title"?a.querySelector("head > title"):null)}function w7(a,r,u){if(u===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function a2(a){return!(a.type==="stylesheet"&&(a.state.loading&3)===0)}function E7(a,r,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 S=Sf(m.href),N=r.querySelector(kp(S));if(N){r=N._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=E0.bind(a),r.then(a,a)),u.state.loading|=4,u.instance=N,Tn(N);return}N=r.ownerDocument||r,m=$v(m),(S=ei.get(S))&&zy(m,S),N=N.createElement("link"),Tn(N);var A=N;A._p=new Promise(function(B,X){A.onload=B,A.onerror=X}),as(N,"link",m),u.instance=N}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(u,r),(r=u.state.preload)&&(u.state.loading&3)===0&&(a.count++,u=E0.bind(a),r.addEventListener("load",u),r.addEventListener("error",u))}}var Ly=0;function T7(a,r){return a.stylesheets&&a.count===0&&R0(a,a.stylesheets),0<a.count||0<a.imgCount?function(u){var m=setTimeout(function(){if(a.stylesheets&&R0(a,a.stylesheets),a.unsuspend){var N=a.unsuspend;a.unsuspend=null,N()}},6e4+r);0<a.imgBytes&&Ly===0&&(Ly=62500*o7());var S=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&R0(a,a.stylesheets),a.unsuspend)){var N=a.unsuspend;a.unsuspend=null,N()}},(a.imgBytes>Ly?50:800)+r);return a.unsuspend=u,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(S)}}:null}function E0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)R0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var T0=null;function R0(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,T0=new Map,r.forEach(R7,a),T0=null,E0.call(a))}function R7(a,r){if(!(r.state.loading&4)){var u=T0.get(a);if(u)var m=u.get(null);else{u=new Map,T0.set(a,u);for(var S=a.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var A=S[N];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),m=A)}m&&u.set(null,m)}S=r.instance,A=S.getAttribute("data-precedence"),N=u.get(A)||m,N===m&&u.set(null,S),u.set(A,S),this.count++,m=E0.bind(this),S.addEventListener("load",m),S.addEventListener("error",m),N?N.parentNode.insertBefore(S,N.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(S,a.firstChild)),r.state.loading|=4}}var Up={$$typeof:z,Provider:null,Consumer:null,_currentValue:ae,_currentValue2:ae,_threadCount:0};function O7(a,r,u,m,S,N,A,B,X){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=Fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fn(0),this.hiddenUpdates=Fn(null),this.identifierPrefix=m,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function s2(a,r,u,m,S,N,A,B,X,oe,xe,Se){return a=new O7(a,r,u,A,X,oe,xe,Se,B),r=1,N===!0&&(r|=24),N=On(3,null,null,r),a.current=N,N.stateNode=a,r=Gh(),r.refCount++,a.pooledCache=r,r.refCount++,N.memoizedState={element:m,isDehydrated:u,cache:r},fu(N),a}function r2(a){return a?(a=Li,a):Li}function i2(a,r,u,m,S,N){S=r2(S),m.context===null?m.context=S:m.pendingContext=S,m=gi(r),m.payload={element:u},N=N===void 0?null:N,N!==null&&(m.callback=N),u=Vi(a,m,r),u!==null&&(pt(u,a,r),Qi(u,a,r))}function l2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var u=a.retryLane;a.retryLane=u!==0&&u<r?u:r}}function Uy(a,r){l2(a,r),(a=a.alternate)&&l2(a,r)}function o2(a){if(a.tag===13||a.tag===31){var r=Za(a,67108864);r!==null&&pt(r,a,67108864),Uy(a,67108864)}}function c2(a){if(a.tag===13||a.tag===31){var r=Us();r=Ue(r);var u=Za(a,r);u!==null&&pt(u,a,r),Uy(a,r)}}var O0=!0;function M7(a,r,u,m){var S=Y.T;Y.T=null;var N=$.p;try{$.p=2,qy(a,r,u,m)}finally{$.p=N,Y.T=S}}function A7(a,r,u,m){var S=Y.T;Y.T=null;var N=$.p;try{$.p=8,qy(a,r,u,m)}finally{$.p=N,Y.T=S}}function qy(a,r,u,m){if(O0){var S=Hy(m);if(S===null)jy(a,r,m,M0,u),d2(a,m);else if(z7(S,a,r,u,m))m.stopPropagation();else if(d2(a,m),r&4&&-1<D7.indexOf(a)){for(;S!==null;){var N=pr(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var A=mt(N.pendingLanes);if(A!==0){var B=N;for(B.pendingLanes|=2,B.entangledLanes|=2;A;){var X=1<<31-ba(A);B.entanglements[1]|=X,A&=~X}Ce(N),(Ye&6)===0&&(Wn=Xn()+500,Le(0))}}break;case 31:case 13:B=Za(N,2),B!==null&&pt(B,N,2),Sr(),Uy(N,2)}if(N=Hy(m),N===null&&jy(a,r,m,M0,u),N===S)break;S=N}S!==null&&m.stopPropagation()}else jy(a,r,m,null,u)}}function Hy(a){return a=xd(a),By(a)}var M0=null;function By(a){if(M0=null,a=Pt(a),a!==null){var r=o(a);if(r===null)a=null;else{var u=r.tag;if(u===13){if(a=d(r),a!==null)return a;a=null}else if(u===31){if(a=f(r),a!==null)return a;a=null}else if(u===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return M0=a,null}function u2(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(Ss()){case dr:return 2;case Qa:return 8;case la:case Ea:return 32;case rs:return 268435456;default:return 32}default:return 32}}var Gy=!1,sc=null,rc=null,ic=null,qp=new Map,Hp=new Map,lc=[],D7="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 d2(a,r){switch(a){case"focusin":case"focusout":sc=null;break;case"dragenter":case"dragleave":rc=null;break;case"mouseover":case"mouseout":ic=null;break;case"pointerover":case"pointerout":qp.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Hp.delete(r.pointerId)}}function Bp(a,r,u,m,S,N){return a===null||a.nativeEvent!==N?(a={blockedOn:r,domEventName:u,eventSystemFlags:m,nativeEvent:N,targetContainers:[S]},r!==null&&(r=pr(r),r!==null&&o2(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),a)}function z7(a,r,u,m,S){switch(r){case"focusin":return sc=Bp(sc,a,r,u,m,S),!0;case"dragenter":return rc=Bp(rc,a,r,u,m,S),!0;case"mouseover":return ic=Bp(ic,a,r,u,m,S),!0;case"pointerover":var N=S.pointerId;return qp.set(N,Bp(qp.get(N)||null,a,r,u,m,S)),!0;case"gotpointercapture":return N=S.pointerId,Hp.set(N,Bp(Hp.get(N)||null,a,r,u,m,S)),!0}return!1}function f2(a){var r=Pt(a.target);if(r!==null){var u=o(r);if(u!==null){if(r=u.tag,r===13){if(r=d(u),r!==null){a.blockedOn=r,ct(a.priority,function(){c2(u)});return}}else if(r===31){if(r=f(u),r!==null){a.blockedOn=r,ct(a.priority,function(){c2(u)});return}}else if(r===3&&u.stateNode.current.memoizedState.isDehydrated){a.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}a.blockedOn=null}function A0(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var u=Hy(a.nativeEvent);if(u===null){u=a.nativeEvent;var m=new u.constructor(u.type,u);yd=m,u.target.dispatchEvent(m),yd=null}else return r=pr(u),r!==null&&o2(r),a.blockedOn=u,!1;r.shift()}return!0}function h2(a,r,u){A0(a)&&u.delete(r)}function k7(){Gy=!1,sc!==null&&A0(sc)&&(sc=null),rc!==null&&A0(rc)&&(rc=null),ic!==null&&A0(ic)&&(ic=null),qp.forEach(h2),Hp.forEach(h2)}function D0(a,r){a.blockedOn===r&&(a.blockedOn=null,Gy||(Gy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,k7)))}var z0=null;function p2(a){z0!==a&&(z0=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){z0===a&&(z0=null);for(var r=0;r<a.length;r+=3){var u=a[r],m=a[r+1],S=a[r+2];if(typeof m!="function"){if(By(m||u)===null)continue;break}var N=pr(u);N!==null&&(a.splice(r,3),r-=3,pp(N,{pending:!0,data:S,method:u.method,action:m},m,S))}}))}function _f(a){function r(X){return D0(X,a)}sc!==null&&D0(sc,a),rc!==null&&D0(rc,a),ic!==null&&D0(ic,a),qp.forEach(r),Hp.forEach(r);for(var u=0;u<lc.length;u++){var m=lc[u];m.blockedOn===a&&(m.blockedOn=null)}for(;0<lc.length&&(u=lc[0],u.blockedOn===null);)f2(u),u.blockedOn===null&&lc.shift();if(u=(a.ownerDocument||a).$$reactFormReplay,u!=null)for(m=0;m<u.length;m+=3){var S=u[m],N=u[m+1],A=S[ut]||null;if(typeof N=="function")A||p2(u);else if(A){var B=null;if(N&&N.hasAttribute("formAction")){if(S=N,A=N[ut]||null)B=A.formAction;else if(By(S)!==null)continue}else B=A.action;typeof B=="function"?u[m+1]=B:(u.splice(m,3),m-=3),p2(u)}}}function m2(){function a(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(A){return S=A})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),m||setTimeout(u,20)}function u(){if(!m&&!navigation.transition){var N=navigation.currentEntry;N&&N.url!=null&&navigation.navigate(N.url,{state:N.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,S=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(u,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function Py(a){this._internalRoot=a}k0.prototype.render=Py.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var u=r.current,m=Us();i2(u,m,a,r,null,null)},k0.prototype.unmount=Py.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;i2(a.current,2,null,a,null,null),Sr(),r[sn]=null}};function k0(a){this._internalRoot=a}k0.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ve();a={blockedOn:null,target:a,priority:r};for(var u=0;u<lc.length&&r!==0&&r<lc[u].priority;u++);lc.splice(u,0,a),u===0&&f2(a)}};var g2=e.version;if(g2!=="19.2.4")throw Error(s(527,g2,"19.2.4"));$.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=y(r),a=a!==null?b(a):null,a=a===null?null:a.stateNode,a};var L7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var L0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!L0.isDisabled&&L0.supportsFiber)try{Hs=L0.inject(L7),ta=L0}catch{}}return Yp.createRoot=function(a,r){if(!i(a))throw Error(s(299));var u=!1,m="",S=h0,N=vp,A=Sp;return r!=null&&(r.unstable_strictMode===!0&&(u=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(A=r.onRecoverableError)),r=s2(a,1,!1,null,null,u,m,null,S,N,A,m2),a[sn]=r.current,_y(a),new Py(r)},Yp.hydrateRoot=function(a,r,u){if(!i(a))throw Error(s(299));var m=!1,S="",N=h0,A=vp,B=Sp,X=null;return u!=null&&(u.unstable_strictMode===!0&&(m=!0),u.identifierPrefix!==void 0&&(S=u.identifierPrefix),u.onUncaughtError!==void 0&&(N=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(B=u.onRecoverableError),u.formState!==void 0&&(X=u.formState)),r=s2(a,1,!0,r,u??null,m,S,X,N,A,B,m2),r.context=r2(null),u=r.current,m=Us(),m=Ue(m),S=gi(m),S.callback=null,Vi(u,S,m),u=m,r.current.lanes=u,yn(r,u),Ce(r),a[sn]=r.current,_y(a),new k0(r)},Yp.version="19.2.4",Yp}var E2;function Z7(){if(E2)return Xy.exports;E2=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(e){console.error(e)}}return t(),Xy.exports=F7(),Xy.exports}var Yb=Z7();const I7=k1(Yb),v4=Gb({__proto__:null,default:I7},[Yb]);var $u=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hu,bc,Lf,l4,J7=(l4=class extends $u{constructor(){super();qe(this,Hu);qe(this,bc);qe(this,Lf);Me(this,Lf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,bc)||this.setEventListener(Q(this,Lf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,bc))==null||e.call(this),Me(this,bc,void 0))}setEventListener(e){var n;Me(this,Lf,e),(n=Q(this,bc))==null||n.call(this),Me(this,bc,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Q(this,Hu)!==e&&(Me(this,Hu,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Q(this,Hu)=="boolean"?Q(this,Hu):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Hu=new WeakMap,bc=new WeakMap,Lf=new WeakMap,l4),U1=new J7,W7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},vc,Bb,o4,$7=(o4=class{constructor(){qe(this,vc,W7);qe(this,Bb,!1)}setTimeoutProvider(t){Me(this,vc,t)}setTimeout(t,e){return Q(this,vc).setTimeout(t,e)}clearTimeout(t){Q(this,vc).clearTimeout(t)}setInterval(t,e){return Q(this,vc).setInterval(t,e)}clearInterval(t){Q(this,vc).clearInterval(t)}},vc=new WeakMap,Bb=new WeakMap,o4),Rc=new $7;function e9(t){setTimeout(t,0)}var S4=typeof window>"u"||"Deno"in globalThis;function ma(){}function t9(t,e){return typeof t=="function"?t(e):t}function Lx(t){return typeof t=="number"&&t>=0&&t!==1/0}function N4(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Oc(t,e){return typeof t=="function"?t(e):t}function ai(t,e){return typeof t=="function"?t(e):t}function Ux(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:d,stale:f}=t;if(d){if(s){if(e.queryHash!==Vb(d,e.options))return!1}else if(!Jf(e.queryKey,d))return!1}if(n!=="all"){const p=e.isActive();if(n==="active"&&!p||n==="inactive"&&p)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||i&&i!==e.state.fetchStatus||o&&!o(e))}function qx(t,e){const{exact:n,status:s,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Ac(e.options.mutationKey)!==Ac(o))return!1}else if(!Jf(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Vb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Ac)(t)}function Ac(t){return JSON.stringify(t,(e,n)=>Hx(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Jf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Jf(t[n],e[n])):!1}var n9=Object.prototype.hasOwnProperty;function Vm(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=T2(t)&&T2(e);if(!s&&!(Hx(t)&&Hx(e)))return e;const o=(s?t:Object.keys(t)).length,d=s?e:Object.keys(e),f=d.length,p=s?new Array(f):{};let y=0;for(let b=0;b<f;b++){const v=s?b:d[b],_=t[v],C=e[v];if(_===C){p[v]=_,(s?b<o:n9.call(t,v))&&y++;continue}if(_===null||C===null||typeof _!="object"||typeof C!="object"){p[v]=C;continue}const w=Vm(_,C,n+1);p[v]=w,w===_&&y++}return o===f&&y===o?t:p}function Nm(t,e){if(!e||Object.keys(t).length!==Object.keys(e).length)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function T2(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function Hx(t){if(!R2(t))return!1;const e=t.constructor;if(e===void 0)return!0;const n=e.prototype;return!(!R2(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function R2(t){return Object.prototype.toString.call(t)==="[object Object]"}function a9(t){return new Promise(e=>{Rc.setTimeout(e,t)})}function Bx(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Vm(t,e):e}function s9(t){return t}function _4(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function r9(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var q1=Symbol();function j4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===q1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function H1(t,e){return typeof t=="function"?t(...e):!!t}function C4(t,e,n){let s=!1,i;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(i??(i=e()),s||(s=!0,i.aborted?n():i.addEventListener("abort",n,{once:!0})),i)}),t}var Wf=(()=>{let t=()=>S4;return{isServer(){return t()},setIsServer(e){t=e}}})();function Gx(){let t,e;const n=new Promise((i,o)=>{t=i,e=o});n.status="pending",n.catch(()=>{});function s(i){Object.assign(n,i),delete n.resolve,delete n.reject}return n.resolve=i=>{s({status:"fulfilled",value:i}),t(i)},n.reject=i=>{s({status:"rejected",reason:i}),e(i)},n}function i9(t){var n;let e;if((n=t.then(s=>(e=s,s),ma))==null||n.catch(ma),e!==void 0)return{data:e}}function w4(t){return t}function l9(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function o9(t,e,n){const s=()=>{var o;const i=(o=t.promise)==null?void 0:o.then(e).catch(d=>n(d)?Promise.reject(new Error("redacted")):Promise.reject(d));return i==null||i.catch(ma),i};return{dehydratedAt:Date.now(),state:{...t.state,...t.state.data!==void 0&&{data:e(t.state.data)}},queryKey:t.queryKey,queryHash:t.queryHash,...t.state.status==="pending"&&{promise:s()},...t.meta&&{meta:t.meta}}}function E4(t){return t.state.isPaused}function T4(t){return t.state.status==="success"}function c9(t){return!0}function u9(t,e={}){var p,y,b,v;const n=e.shouldDehydrateMutation??((p=t.getDefaultOptions().dehydrate)==null?void 0:p.shouldDehydrateMutation)??E4,s=t.getMutationCache().getAll().flatMap(_=>n(_)?[l9(_)]:[]),i=e.shouldDehydrateQuery??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateQuery)??T4,o=e.shouldRedactErrors??((b=t.getDefaultOptions().dehydrate)==null?void 0:b.shouldRedactErrors)??c9,d=e.serializeData??((v=t.getDefaultOptions().dehydrate)==null?void 0:v.serializeData)??w4,f=t.getQueryCache().getAll().flatMap(_=>i(_)?[o9(_,d,o)]:[]);return{mutations:s,queries:f}}function Px(t,e,n){var p,y;if(typeof e!="object"||e===null)return;const s=t.getMutationCache(),i=t.getQueryCache(),o=((p=n==null?void 0:n.defaultOptions)==null?void 0:p.deserializeData)??((y=t.getDefaultOptions().hydrate)==null?void 0:y.deserializeData)??w4,d=e.mutations||[],f=e.queries||[];d.forEach(({state:b,...v})=>{var _,C;s.build(t,{...(_=t.getDefaultOptions().hydrate)==null?void 0:_.mutations,...(C=n==null?void 0:n.defaultOptions)==null?void 0:C.mutations,...v},b)}),f.forEach(({queryKey:b,state:v,queryHash:_,meta:C,promise:w,dehydratedAt:T})=>{var q,L;const R=w?i9(w):void 0,O=v.data===void 0?R==null?void 0:R.data:v.data,M=O===void 0?O:o(O);let z=i.get(_);const k=(z==null?void 0:z.state.status)==="pending",P=(z==null?void 0:z.state.fetchStatus)==="fetching";if(z){const U=R&&T!==void 0&&T>z.state.dataUpdatedAt;if(v.dataUpdatedAt>z.state.dataUpdatedAt||U){const{fetchStatus:V,...F}=v;z.setState({...F,data:M})}}else z=i.build(t,{...(q=t.getDefaultOptions().hydrate)==null?void 0:q.queries,...(L=n==null?void 0:n.defaultOptions)==null?void 0:L.queries,queryKey:b,queryHash:_,meta:C},{...v,data:M,fetchStatus:"idle",status:M!==void 0?"success":v.status});w&&!k&&!P&&(T===void 0||T>z.state.dataUpdatedAt)&&z.fetch(void 0,{initialPromise:Promise.resolve(w).then(o)}).catch(ma)})}var R4=e9;function d9(){let t=[],e=0,n=f=>{f()},s=f=>{f()},i=R4;const o=f=>{e?t.push(f):i(()=>{n(f)})},d=()=>{const f=t;t=[],f.length&&i(()=>{s(()=>{f.forEach(p=>{n(p)})})})};return{batch:f=>{let p;e++;try{p=f()}finally{e--,e||d()}return p},batchCalls:f=>(...p)=>{o(()=>{f(...p)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var Un=d9(),Uf,Sc,qf,c4,f9=(c4=class extends $u{constructor(){super();qe(this,Uf,!0);qe(this,Sc);qe(this,qf);Me(this,qf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e(!0),s=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",s,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",s)}}})}onSubscribe(){Q(this,Sc)||this.setEventListener(Q(this,qf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,Sc))==null||e.call(this),Me(this,Sc,void 0))}setEventListener(e){var n;Me(this,qf,e),(n=Q(this,Sc))==null||n.call(this),Me(this,Sc,e(this.setOnline.bind(this)))}setOnline(e){Q(this,Uf)!==e&&(Me(this,Uf,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Q(this,Uf)}},Uf=new WeakMap,Sc=new WeakMap,qf=new WeakMap,c4),_m=new f9;function h9(t){return Math.min(1e3*2**t,3e4)}function O4(t){return(t??"online")==="online"?_m.isOnline():!0}var jm=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function p9(t){return t instanceof jm}function M4(t){let e=!1,n=0,s;const i=Gx(),o=()=>i.status!=="pending",d=T=>{var R;if(!o()){const O=new jm(T);_(O),(R=t.onCancel)==null||R.call(t,O)}},f=()=>{e=!0},p=()=>{e=!1},y=()=>U1.isFocused()&&(t.networkMode==="always"||_m.isOnline())&&t.canRun(),b=()=>O4(t.networkMode)&&t.canRun(),v=T=>{o()||(s==null||s(),i.resolve(T))},_=T=>{o()||(s==null||s(),i.reject(T))},C=()=>new Promise(T=>{var R;s=O=>{(o()||y())&&T(O)},(R=t.onPause)==null||R.call(t)}).then(()=>{var T;s=void 0,o()||(T=t.onContinue)==null||T.call(t)}),w=()=>{if(o())return;let T;const R=n===0?t.initialPromise:void 0;try{T=R??t.fn()}catch(O){T=Promise.reject(O)}Promise.resolve(T).then(v).catch(O=>{var q;if(o())return;const M=t.retry??(Wf.isServer()?0:3),z=t.retryDelay??h9,k=typeof z=="function"?z(n,O):z,P=M===!0||typeof M=="number"&&n<M||typeof M=="function"&&M(n,O);if(e||!P){_(O);return}n++,(q=t.onFail)==null||q.call(t,n,O),a9(k).then(()=>y()?void 0:C()).then(()=>{e?_(O):w()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:p,canStart:b,start:()=>(b()?w():C().then(w),i)}}var Bu,u4,A4=(u4=class{constructor(){qe(this,Bu)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Lx(this.gcTime)&&Me(this,Bu,Rc.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Wf.isServer()?1/0:300*1e3))}clearGcTimeout(){Q(this,Bu)&&(Rc.clearTimeout(Q(this,Bu)),Me(this,Bu,void 0))}},Bu=new WeakMap,u4),Gu,Hf,ti,Pu,Va,km,Yu,_r,z4,no,d4,D4=(d4=class extends A4{constructor(e){super();qe(this,_r);qe(this,Gu);qe(this,Hf);qe(this,ti);qe(this,Pu);qe(this,Va);qe(this,km);qe(this,Yu);Me(this,Yu,!1),Me(this,km,e.defaultOptions),this.setOptions(e.options),this.observers=[],Me(this,Pu,e.client),Me(this,ti,Q(this,Pu).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Me(this,Gu,M2(this.options)),this.state=e.state??Q(this,Gu),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var e;return(e=Q(this,Va))==null?void 0:e.promise}setOptions(e){if(this.options={...Q(this,km),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=M2(this.options);n.data!==void 0&&(this.setState(O2(n.data,n.dataUpdatedAt)),Me(this,Gu,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,ti).remove(this)}setData(e,n){const s=Bx(this.state.data,e,this.options);return Je(this,_r,no).call(this,{data:s,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),s}setState(e,n){Je(this,_r,no).call(this,{type:"setState",state:e,setStateOptions:n})}cancel(e){var s,i;const n=(s=Q(this,Va))==null?void 0:s.promise;return(i=Q(this,Va))==null||i.cancel(e),n?n.then(ma).catch(ma):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return Q(this,Gu)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ai(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===q1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Oc(e.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e==="static"?!1:this.state.isInvalidated?!0:!N4(this.state.dataUpdatedAt,e)}onFocus(){var n;const e=this.observers.find(s=>s.shouldFetchOnWindowFocus());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}onOnline(){var n;const e=this.observers.find(s=>s.shouldFetchOnReconnect());e==null||e.refetch({cancelRefetch:!1}),(n=Q(this,Va))==null||n.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),Q(this,ti).notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(Q(this,Va)&&(Q(this,Yu)||Je(this,_r,z4).call(this)?Q(this,Va).cancel({revert:!0}):Q(this,Va).cancelRetry()),this.scheduleGc()),Q(this,ti).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,_r,no).call(this,{type:"invalidate"})}async fetch(e,n){var p,y,b,v,_,C,w,T,R,O,M,z;if(this.state.fetchStatus!=="idle"&&((p=Q(this,Va))==null?void 0:p.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(Q(this,Va))return Q(this,Va).continueRetry(),Q(this,Va).promise}if(e&&this.setOptions(e),!this.options.queryFn){const k=this.observers.find(P=>P.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(Me(this,Yu,!0),s.signal)})},o=()=>{const k=j4(this.options,n),q=(()=>{const L={client:Q(this,Pu),queryKey:this.queryKey,meta:this.meta};return i(L),L})();return Me(this,Yu,!1),this.options.persister?this.options.persister(k,q,this):k(q)},f=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,Pu),state:this.state,fetchFn:o};return i(k),k})();(y=this.options.behavior)==null||y.onFetch(f,this),Me(this,Hf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((b=f.fetchOptions)==null?void 0:b.meta))&&Je(this,_r,no).call(this,{type:"fetch",meta:(v=f.fetchOptions)==null?void 0:v.meta}),Me(this,Va,M4({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:k=>{k instanceof jm&&k.revert&&this.setState({...Q(this,Hf),fetchStatus:"idle"}),s.abort()},onFail:(k,P)=>{Je(this,_r,no).call(this,{type:"failed",failureCount:k,error:P})},onPause:()=>{Je(this,_r,no).call(this,{type:"pause"})},onContinue:()=>{Je(this,_r,no).call(this,{type:"continue"})},retry:f.options.retry,retryDelay:f.options.retryDelay,networkMode:f.options.networkMode,canRun:()=>!0}));try{const k=await Q(this,Va).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(C=(_=Q(this,ti).config).onSuccess)==null||C.call(_,k,this),(T=(w=Q(this,ti).config).onSettled)==null||T.call(w,k,this.state.error,this),k}catch(k){if(k instanceof jm){if(k.silent)return Q(this,Va).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw Je(this,_r,no).call(this,{type:"error",error:k}),(O=(R=Q(this,ti).config).onError)==null||O.call(R,k,this),(z=(M=Q(this,ti).config).onSettled)==null||z.call(M,this.state.data,k,this),k}finally{this.scheduleGc()}}},Gu=new WeakMap,Hf=new WeakMap,ti=new WeakMap,Pu=new WeakMap,Va=new WeakMap,km=new WeakMap,Yu=new WeakMap,_r=new WeakSet,z4=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},no=function(e){const n=s=>{switch(e.type){case"failed":return{...s,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...k4(s.data,this.options),fetchMeta:e.meta??null};case"success":const i={...s,...O2(e.data,e.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Me(this,Hf,e.manual?i:void 0),i;case"error":const o=e.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...e.state}}};this.state=n(this.state),Un.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Q(this,ti).notify({query:this,type:"updated",action:e})})},d4);function k4(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:O4(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function O2(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function M2(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,s=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?s??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}var or,qt,Lm,qs,Vu,Bf,ro,Nc,Um,Gf,Pf,Qu,Ku,_c,Yf,an,lm,Yx,Vx,Qx,Kx,Xx,Fx,Zx,L4,f4,sh=(f4=class extends $u{constructor(e,n){super();qe(this,an);qe(this,or);qe(this,qt);qe(this,Lm);qe(this,qs);qe(this,Vu);qe(this,Bf);qe(this,ro);qe(this,Nc);qe(this,Um);qe(this,Gf);qe(this,Pf);qe(this,Qu);qe(this,Ku);qe(this,_c);qe(this,Yf,new Set);this.options=n,Me(this,or,e),Me(this,Nc,null),Me(this,ro,Gx()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,qt).addObserver(this),A2(Q(this,qt),this.options)?Je(this,an,lm).call(this):this.updateResult(),Je(this,an,Kx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Ix(Q(this,qt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Ix(Q(this,qt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,an,Xx).call(this),Je(this,an,Fx).call(this),Q(this,qt).removeObserver(this)}setOptions(e){const n=this.options,s=Q(this,qt);if(this.options=Q(this,or).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ai(this.options.enabled,Q(this,qt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,an,Zx).call(this),Q(this,qt).setOptions(this.options),n._defaulted&&!Nm(this.options,n)&&Q(this,or).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,qt),observer:this});const i=this.hasListeners();i&&D2(Q(this,qt),s,this.options,n)&&Je(this,an,lm).call(this),this.updateResult(),i&&(Q(this,qt)!==s||ai(this.options.enabled,Q(this,qt))!==ai(n.enabled,Q(this,qt))||Oc(this.options.staleTime,Q(this,qt))!==Oc(n.staleTime,Q(this,qt)))&&Je(this,an,Yx).call(this);const o=Je(this,an,Vx).call(this);i&&(Q(this,qt)!==s||ai(this.options.enabled,Q(this,qt))!==ai(n.enabled,Q(this,qt))||o!==Q(this,_c))&&Je(this,an,Qx).call(this,o)}getOptimisticResult(e){const n=Q(this,or).getQueryCache().build(Q(this,or),e),s=this.createResult(n,e);return g9(this,s)&&(Me(this,qs,s),Me(this,Bf,this.options),Me(this,Vu,Q(this,qt).state)),s}getCurrentResult(){return Q(this,qs)}trackResult(e,n){return new Proxy(e,{get:(s,i)=>(this.trackProp(i),n==null||n(i),i==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&Q(this,ro).status==="pending"&&Q(this,ro).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(e){Q(this,Yf).add(e)}getCurrentQuery(){return Q(this,qt)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Q(this,or).defaultQueryOptions(e),s=Q(this,or).getQueryCache().build(Q(this,or),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return Je(this,an,lm).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,qs)))}createResult(e,n){var V;const s=Q(this,qt),i=this.options,o=Q(this,qs),d=Q(this,Vu),f=Q(this,Bf),y=e!==s?e.state:Q(this,Lm),{state:b}=e;let v={...b},_=!1,C;if(n._optimisticResults){const F=this.hasListeners(),re=!F&&A2(e,n),ne=F&&D2(e,s,n,i);(re||ne)&&(v={...v,...k4(b.data,e.options)}),n._optimisticResults==="isRestoring"&&(v.fetchStatus="idle")}let{error:w,errorUpdatedAt:T,status:R}=v;C=v.data;let O=!1;if(n.placeholderData!==void 0&&C===void 0&&R==="pending"){let F;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(F=o.data,O=!0):F=typeof n.placeholderData=="function"?n.placeholderData((V=Q(this,Pf))==null?void 0:V.state.data,Q(this,Pf)):n.placeholderData,F!==void 0&&(R="success",C=Bx(o==null?void 0:o.data,F,n),_=!0)}if(n.select&&C!==void 0&&!O)if(o&&C===(d==null?void 0:d.data)&&n.select===Q(this,Um))C=Q(this,Gf);else try{Me(this,Um,n.select),C=n.select(C),C=Bx(o==null?void 0:o.data,C,n),Me(this,Gf,C),Me(this,Nc,null)}catch(F){Me(this,Nc,F)}Q(this,Nc)&&(w=Q(this,Nc),C=Q(this,Gf),T=Date.now(),R="error");const M=v.fetchStatus==="fetching",z=R==="pending",k=R==="error",P=z&&M,q=C!==void 0,U={status:R,fetchStatus:v.fetchStatus,isPending:z,isSuccess:R==="success",isError:k,isInitialLoading:P,isLoading:P,data:C,dataUpdatedAt:v.dataUpdatedAt,error:w,errorUpdatedAt:T,failureCount:v.fetchFailureCount,failureReason:v.fetchFailureReason,errorUpdateCount:v.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:v.dataUpdateCount>y.dataUpdateCount||v.errorUpdateCount>y.errorUpdateCount,isFetching:M,isRefetching:M&&!z,isLoadingError:k&&!q,isPaused:v.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:k&&q,isStale:Qb(e,n),refetch:this.refetch,promise:Q(this,ro),isEnabled:ai(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const F=U.data!==void 0,re=U.status==="error"&&!F,ne=ce=>{re?ce.reject(U.error):F&&ce.resolve(U.data)},J=()=>{const ce=Me(this,ro,U.promise=Gx());ne(ce)},ie=Q(this,ro);switch(ie.status){case"pending":e.queryHash===s.queryHash&&ne(ie);break;case"fulfilled":(re||U.data!==ie.value)&&J();break;case"rejected":(!re||U.error!==ie.reason)&&J();break}}return U}updateResult(){const e=Q(this,qs),n=this.createResult(Q(this,qt),this.options);if(Me(this,Vu,Q(this,qt).state),Me(this,Bf,this.options),Q(this,Vu).data!==void 0&&Me(this,Pf,Q(this,qt)),Nm(n,e))return;Me(this,qs,n);const s=()=>{if(!e)return!0;const{notifyOnChangeProps:i}=this.options,o=typeof i=="function"?i():i;if(o==="all"||!o&&!Q(this,Yf).size)return!0;const d=new Set(o??Q(this,Yf));return this.options.throwOnError&&d.add("error"),Object.keys(Q(this,qs)).some(f=>{const p=f;return Q(this,qs)[p]!==e[p]&&d.has(p)})};Je(this,an,L4).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,an,Kx).call(this)}},or=new WeakMap,qt=new WeakMap,Lm=new WeakMap,qs=new WeakMap,Vu=new WeakMap,Bf=new WeakMap,ro=new WeakMap,Nc=new WeakMap,Um=new WeakMap,Gf=new WeakMap,Pf=new WeakMap,Qu=new WeakMap,Ku=new WeakMap,_c=new WeakMap,Yf=new WeakMap,an=new WeakSet,lm=function(e){Je(this,an,Zx).call(this);let n=Q(this,qt).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ma)),n},Yx=function(){Je(this,an,Xx).call(this);const e=Oc(this.options.staleTime,Q(this,qt));if(Wf.isServer()||Q(this,qs).isStale||!Lx(e))return;const s=N4(Q(this,qs).dataUpdatedAt,e)+1;Me(this,Qu,Rc.setTimeout(()=>{Q(this,qs).isStale||this.updateResult()},s))},Vx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,qt)):this.options.refetchInterval)??!1},Qx=function(e){Je(this,an,Fx).call(this),Me(this,_c,e),!(Wf.isServer()||ai(this.options.enabled,Q(this,qt))===!1||!Lx(Q(this,_c))||Q(this,_c)===0)&&Me(this,Ku,Rc.setInterval(()=>{(this.options.refetchIntervalInBackground||U1.isFocused())&&Je(this,an,lm).call(this)},Q(this,_c)))},Kx=function(){Je(this,an,Yx).call(this),Je(this,an,Qx).call(this,Je(this,an,Vx).call(this))},Xx=function(){Q(this,Qu)&&(Rc.clearTimeout(Q(this,Qu)),Me(this,Qu,void 0))},Fx=function(){Q(this,Ku)&&(Rc.clearInterval(Q(this,Ku)),Me(this,Ku,void 0))},Zx=function(){const e=Q(this,or).getQueryCache().build(Q(this,or),this.options);if(e===Q(this,qt))return;const n=Q(this,qt);Me(this,qt,e),Me(this,Lm,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},L4=function(e){Un.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(Q(this,qs))}),Q(this,or).getQueryCache().notify({query:Q(this,qt),type:"observerResultsUpdated"})})},f4);function m9(t,e){return ai(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function A2(t,e){return m9(t,e)||t.state.data!==void 0&&Ix(t,e,e.refetchOnMount)}function Ix(t,e,n){if(ai(e.enabled,t)!==!1&&Oc(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Qb(t,e)}return!1}function D2(t,e,n,s){return(t!==e||ai(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Qb(t,n)}function Qb(t,e){return ai(e.enabled,t)!==!1&&t.isStaleByTime(Oc(e.staleTime,t))}function g9(t,e){return!Nm(t.getCurrentResult(),e)}function b1(t){return{onFetch:(e,n)=>{var b,v,_,C,w;const s=e.options,i=(_=(v=(b=e.fetchOptions)==null?void 0:b.meta)==null?void 0:v.fetchMore)==null?void 0:_.direction,o=((C=e.state.data)==null?void 0:C.pages)||[],d=((w=e.state.data)==null?void 0:w.pageParams)||[];let f={pages:[],pageParams:[]},p=0;const y=async()=>{let T=!1;const R=z=>{C4(z,()=>e.signal,()=>T=!0)},O=j4(e.options,e.fetchOptions),M=async(z,k,P)=>{if(T)return Promise.reject();if(k==null&&z.pages.length)return Promise.resolve(z);const L=(()=>{const re={client:e.client,queryKey:e.queryKey,pageParam:k,direction:P?"backward":"forward",meta:e.options.meta};return R(re),re})(),U=await O(L),{maxPages:V}=e.options,F=P?r9:_4;return{pages:F(z.pages,U,V),pageParams:F(z.pageParams,k,V)}};if(i&&o.length){const z=i==="backward",k=z?U4:Jx,P={pages:o,pageParams:d},q=k(s,P);f=await M(P,q,z)}else{const z=t??o.length;do{const k=p===0?d[0]??s.initialPageParam:Jx(s,f);if(p>0&&k==null)break;f=await M(f,k),p++}while(p<z)}return f};e.options.persister?e.fetchFn=()=>{var T,R;return(R=(T=e.options).persister)==null?void 0:R.call(T,y,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=y}}}function Jx(t,{pages:e,pageParams:n}){const s=e.length-1;return e.length>0?t.getNextPageParam(e[s],e,n[s],n):void 0}function U4(t,{pages:e,pageParams:n}){var s;return e.length>0?(s=t.getPreviousPageParam)==null?void 0:s.call(t,e[0],e,n[0],n):void 0}function y9(t,e){return e?Jx(t,e)!=null:!1}function x9(t,e){return!e||!t.getPreviousPageParam?!1:U4(t,e)!=null}var Kb=class extends sh{constructor(t,e){super(t,e)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(t){super.setOptions({...t,behavior:b1()})}getOptimisticResult(t){return t.behavior=b1(),super.getOptimisticResult(t)}fetchNextPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(t){return this.fetch({...t,meta:{fetchMore:{direction:"backward"}}})}createResult(t,e){var w,T;const{state:n}=t,s=super.createResult(t,e),{isFetching:i,isRefetching:o,isError:d,isRefetchError:f}=s,p=(T=(w=n.fetchMeta)==null?void 0:w.fetchMore)==null?void 0:T.direction,y=d&&p==="forward",b=i&&p==="forward",v=d&&p==="backward",_=i&&p==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:y9(e,n.data),hasPreviousPage:x9(e,n.data),isFetchNextPageError:y,isFetchingNextPage:b,isFetchPreviousPageError:v,isFetchingPreviousPage:_,isRefetchError:f&&!y&&!v,isRefetching:o&&!b&&!_}}},qm,cl,bs,Xu,ul,hc,h4,q4=(h4=class extends A4{constructor(e){super();qe(this,ul);qe(this,qm);qe(this,cl);qe(this,bs);qe(this,Xu);Me(this,qm,e.client),this.mutationId=e.mutationId,Me(this,bs,e.mutationCache),Me(this,cl,[]),this.state=e.state||H4(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){Q(this,cl).includes(e)||(Q(this,cl).push(e),this.clearGcTimeout(),Q(this,bs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Me(this,cl,Q(this,cl).filter(n=>n!==e)),this.scheduleGc(),Q(this,bs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,cl).length||(this.state.status==="pending"?this.scheduleGc():Q(this,bs).remove(this))}continue(){var e;return((e=Q(this,Xu))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,f,p,y,b,v,_,C,w,T,R,O,M,z,k,P,q,L;const n=()=>{Je(this,ul,hc).call(this,{type:"continue"})},s={client:Q(this,qm),meta:this.options.meta,mutationKey:this.options.mutationKey};Me(this,Xu,M4({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(U,V)=>{Je(this,ul,hc).call(this,{type:"failed",failureCount:U,error:V})},onPause:()=>{Je(this,ul,hc).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,bs).canRun(this)}));const i=this.state.status==="pending",o=!Q(this,Xu).canStart();try{if(i)n();else{Je(this,ul,hc).call(this,{type:"pending",variables:e,isPaused:o}),Q(this,bs).config.onMutate&&await Q(this,bs).config.onMutate(e,this,s);const V=await((f=(d=this.options).onMutate)==null?void 0:f.call(d,e,s));V!==this.state.context&&Je(this,ul,hc).call(this,{type:"pending",context:V,variables:e,isPaused:o})}const U=await Q(this,Xu).start();return await((y=(p=Q(this,bs).config).onSuccess)==null?void 0:y.call(p,U,e,this.state.context,this,s)),await((v=(b=this.options).onSuccess)==null?void 0:v.call(b,U,e,this.state.context,s)),await((C=(_=Q(this,bs).config).onSettled)==null?void 0:C.call(_,U,null,this.state.variables,this.state.context,this,s)),await((T=(w=this.options).onSettled)==null?void 0:T.call(w,U,null,e,this.state.context,s)),Je(this,ul,hc).call(this,{type:"success",data:U}),U}catch(U){try{await((O=(R=Q(this,bs).config).onError)==null?void 0:O.call(R,U,e,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((z=(M=this.options).onError)==null?void 0:z.call(M,U,e,this.state.context,s))}catch(V){Promise.reject(V)}try{await((P=(k=Q(this,bs).config).onSettled)==null?void 0:P.call(k,void 0,U,this.state.variables,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((L=(q=this.options).onSettled)==null?void 0:L.call(q,void 0,U,e,this.state.context,s))}catch(V){Promise.reject(V)}throw Je(this,ul,hc).call(this,{type:"error",error:U}),U}finally{Q(this,bs).runNext(this)}}},qm=new WeakMap,cl=new WeakMap,bs=new WeakMap,Xu=new WeakMap,ul=new WeakSet,hc=function(e){const n=s=>{switch(e.type){case"failed":return{...s,failureCount:e.failureCount,failureReason:e.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:"pending",variables:e.variables,submittedAt:Date.now()};case"success":return{...s,data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:e.error,failureCount:s.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"}}};this.state=n(this.state),Un.batch(()=>{Q(this,cl).forEach(s=>{s.onMutationUpdate(e)}),Q(this,bs).notify({mutation:this,type:"updated",action:e})})},h4);function H4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var io,wi,Hm,p4,B4=(p4=class extends $u{constructor(e={}){super();qe(this,io);qe(this,wi);qe(this,Hm);this.config=e,Me(this,io,new Set),Me(this,wi,new Map),Me(this,Hm,0)}build(e,n,s){const i=new q4({client:e,mutationCache:this,mutationId:++U0(this,Hm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){Q(this,io).add(e);const n=q0(e);if(typeof n=="string"){const s=Q(this,wi).get(n);s?s.push(e):Q(this,wi).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Q(this,io).delete(e)){const n=q0(e);if(typeof n=="string"){const s=Q(this,wi).get(n);if(s)if(s.length>1){const i=s.indexOf(e);i!==-1&&s.splice(i,1)}else s[0]===e&&Q(this,wi).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=q0(e);if(typeof n=="string"){const s=Q(this,wi).get(n),i=s==null?void 0:s.find(o=>o.state.status==="pending");return!i||i===e}else return!0}runNext(e){var s;const n=q0(e);if(typeof n=="string"){const i=(s=Q(this,wi).get(n))==null?void 0:s.find(o=>o!==e&&o.state.isPaused);return(i==null?void 0:i.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Un.batch(()=>{Q(this,io).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,io).clear(),Q(this,wi).clear()})}getAll(){return Array.from(Q(this,io))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>qx(n,s))}findAll(e={}){return this.getAll().filter(n=>qx(e,n))}notify(e){Un.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Un.batch(()=>Promise.all(e.map(n=>n.continue().catch(ma))))}},io=new WeakMap,wi=new WeakMap,Hm=new WeakMap,p4);function q0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var lo,jc,cr,oo,fo,d1,Wx,m4,G4=(m4=class extends $u{constructor(n,s){super();qe(this,fo);qe(this,lo);qe(this,jc);qe(this,cr);qe(this,oo);Me(this,lo,n),this.setOptions(s),this.bindMethods(),Je(this,fo,d1).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var i;const s=this.options;this.options=Q(this,lo).defaultMutationOptions(n),Nm(this.options,s)||Q(this,lo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Ac(s.mutationKey)!==Ac(this.options.mutationKey)?this.reset():((i=Q(this,cr))==null?void 0:i.state.status)==="pending"&&Q(this,cr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=Q(this,cr))==null||n.removeObserver(this)}onMutationUpdate(n){Je(this,fo,d1).call(this),Je(this,fo,Wx).call(this,n)}getCurrentResult(){return Q(this,jc)}reset(){var n;(n=Q(this,cr))==null||n.removeObserver(this),Me(this,cr,void 0),Je(this,fo,d1).call(this),Je(this,fo,Wx).call(this)}mutate(n,s){var i;return Me(this,oo,s),(i=Q(this,cr))==null||i.removeObserver(this),Me(this,cr,Q(this,lo).getMutationCache().build(Q(this,lo),this.options)),Q(this,cr).addObserver(this),Q(this,cr).execute(n)}},lo=new WeakMap,jc=new WeakMap,cr=new WeakMap,oo=new WeakMap,fo=new WeakSet,d1=function(){var s;const n=((s=Q(this,cr))==null?void 0:s.state)??H4();Me(this,jc,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Wx=function(n){Un.batch(()=>{var s,i,o,d,f,p,y,b;if(Q(this,oo)&&this.hasListeners()){const v=Q(this,jc).variables,_=Q(this,jc).context,C={client:Q(this,lo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=Q(this,oo)).onSuccess)==null||i.call(s,n.data,v,_,C)}catch(w){Promise.reject(w)}try{(d=(o=Q(this,oo)).onSettled)==null||d.call(o,n.data,null,v,_,C)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(p=(f=Q(this,oo)).onError)==null||p.call(f,n.error,v,_,C)}catch(w){Promise.reject(w)}try{(b=(y=Q(this,oo)).onSettled)==null||b.call(y,void 0,n.error,v,_,C)}catch(w){Promise.reject(w)}}}this.listeners.forEach(v=>{v(Q(this,jc))})})},m4);function z2(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function b9(t,e,n){const s=t.slice(0);return s[e]=n,s}var Vf,Nr,Qf,Kf,ni,Cc,Bm,Gm,Pm,Ym,ss,$x,eb,tb,nb,ab,g4,P4=(g4=class extends $u{constructor(e,n,s){super();qe(this,ss);qe(this,Vf);qe(this,Nr);qe(this,Qf);qe(this,Kf);qe(this,ni);qe(this,Cc);qe(this,Bm);qe(this,Gm);qe(this,Pm);qe(this,Ym,[]);Me(this,Vf,e),Me(this,Kf,s),Me(this,Qf,[]),Me(this,ni,[]),Me(this,Nr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Q(this,ni).forEach(e=>{e.subscribe(n=>{Je(this,ss,nb).call(this,e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Q(this,ni).forEach(e=>{e.destroy()})}setQueries(e,n){Me(this,Qf,e),Me(this,Kf,n),Un.batch(()=>{const s=Q(this,ni),i=Je(this,ss,tb).call(this,Q(this,Qf));i.forEach(v=>v.observer.setOptions(v.defaultedQueryOptions));const o=i.map(v=>v.observer),d=o.map(v=>v.getCurrentResult()),f=s.length!==o.length,p=o.some((v,_)=>v!==s[_]),y=f||p,b=y?!0:d.some((v,_)=>{const C=Q(this,Nr)[_];return!C||!Nm(v,C)});!y&&!b||(y&&(Me(this,Ym,i),Me(this,ni,o)),Me(this,Nr,d),this.hasListeners()&&(y&&(z2(s,o).forEach(v=>{v.destroy()}),z2(o,s).forEach(v=>{v.subscribe(_=>{Je(this,ss,nb).call(this,v,_)})})),Je(this,ss,ab).call(this)))})}getCurrentResult(){return Q(this,Nr)}getQueries(){return Q(this,ni).map(e=>e.getCurrentQuery())}getObservers(){return Q(this,ni)}getOptimisticResult(e,n){const s=Je(this,ss,tb).call(this,e),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>Je(this,ss,eb).call(this,d??i,n,o),()=>Je(this,ss,$x).call(this,i,s)]}},Vf=new WeakMap,Nr=new WeakMap,Qf=new WeakMap,Kf=new WeakMap,ni=new WeakMap,Cc=new WeakMap,Bm=new WeakMap,Gm=new WeakMap,Pm=new WeakMap,Ym=new WeakMap,ss=new WeakSet,$x=function(e,n){return n.map((s,i)=>{const o=e[i];return s.defaultedQueryOptions.notifyOnChangeProps?o:s.observer.trackResult(o,d=>{n.forEach(f=>{f.observer.trackProp(d)})})})},eb=function(e,n,s){if(n){const i=Q(this,Pm),o=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!Q(this,Cc)||Q(this,Nr)!==Q(this,Gm)||o||n!==Q(this,Bm))&&(Me(this,Bm,n),Me(this,Gm,Q(this,Nr)),s!==void 0&&Me(this,Pm,s),Me(this,Cc,Vm(Q(this,Cc),n(e)))),Q(this,Cc)}return e},tb=function(e){const n=new Map;Q(this,ni).forEach(i=>{const o=i.options.queryHash;if(!o)return;const d=n.get(o);d?d.push(i):n.set(o,[i])});const s=[];return e.forEach(i=>{var p;const o=Q(this,Vf).defaultQueryOptions(i),f=((p=n.get(o.queryHash))==null?void 0:p.shift())??new sh(Q(this,Vf),o);s.push({defaultedQueryOptions:o,observer:f})}),s},nb=function(e,n){const s=Q(this,ni).indexOf(e);s!==-1&&(Me(this,Nr,b9(Q(this,Nr),s,n)),Je(this,ss,ab).call(this))},ab=function(){var e;if(this.hasListeners()){const n=Q(this,Cc),s=Je(this,ss,$x).call(this,Q(this,Nr),Q(this,Ym)),i=Je(this,ss,eb).call(this,s,(e=Q(this,Kf))==null?void 0:e.combine);n!==i&&Un.batch(()=>{this.listeners.forEach(o=>{o(Q(this,Nr))})})}},g4),dl,y4,Y4=(y4=class extends $u{constructor(e={}){super();qe(this,dl);this.config=e,Me(this,dl,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??Vb(i,n);let d=this.get(o);return d||(d=new D4({client:e,queryKey:i,queryHash:o,options:e.defaultQueryOptions(n),state:s,defaultOptions:e.getQueryDefaults(i)}),this.add(d)),d}add(e){Q(this,dl).has(e.queryHash)||(Q(this,dl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,dl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,dl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Un.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,dl).get(e)}getAll(){return[...Q(this,dl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>Ux(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>Ux(e,s)):n}notify(e){Un.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Un.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Un.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},dl=new WeakMap,y4),ia,wc,Ec,Xf,Ff,Tc,Zf,If,x4,V4=(x4=class{constructor(t={}){qe(this,ia);qe(this,wc);qe(this,Ec);qe(this,Xf);qe(this,Ff);qe(this,Tc);qe(this,Zf);qe(this,If);Me(this,ia,t.queryCache||new Y4),Me(this,wc,t.mutationCache||new B4),Me(this,Ec,t.defaultOptions||{}),Me(this,Xf,new Map),Me(this,Ff,new Map),Me(this,Tc,0)}mount(){U0(this,Tc)._++,Q(this,Tc)===1&&(Me(this,Zf,U1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ia).onFocus())})),Me(this,If,_m.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ia).onOnline())})))}unmount(){var t,e;U0(this,Tc)._--,Q(this,Tc)===0&&((t=Q(this,Zf))==null||t.call(this),Me(this,Zf,void 0),(e=Q(this,If))==null||e.call(this),Me(this,If,void 0))}isFetching(t){return Q(this,ia).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Q(this,wc).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ia).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,ia).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Oc(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return Q(this,ia).findAll(t).map(({queryKey:e,state:n})=>{const s=n.data;return[e,s]})}setQueryData(t,e,n){const s=this.defaultQueryOptions({queryKey:t}),i=Q(this,ia).get(s.queryHash),o=i==null?void 0:i.state.data,d=t9(e,o);if(d!==void 0)return Q(this,ia).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(t,e,n){return Un.batch(()=>Q(this,ia).findAll(t).map(({queryKey:s})=>[s,this.setQueryData(s,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ia).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,ia);Un.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,ia);return Un.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Un.batch(()=>Q(this,ia).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(ma).catch(ma)}invalidateQueries(t,e={}){return Un.batch(()=>(Q(this,ia).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},s=Un.batch(()=>Q(this,ia).findAll(t).filter(i=>!i.isDisabled()&&!i.isStatic()).map(i=>{let o=i.fetch(void 0,n);return n.throwOnError||(o=o.catch(ma)),i.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(s).then(ma)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=Q(this,ia).build(this,e);return n.isStaleByTime(Oc(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(ma).catch(ma)}fetchInfiniteQuery(t){return t.behavior=b1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ma).catch(ma)}ensureInfiniteQueryData(t){return t.behavior=b1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return _m.isOnline()?Q(this,wc).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,ia)}getMutationCache(){return Q(this,wc)}getDefaultOptions(){return Q(this,Ec)}setDefaultOptions(t){Me(this,Ec,t)}setQueryDefaults(t,e){Q(this,Xf).set(Ac(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Q(this,Xf).values()],n={};return e.forEach(s=>{Jf(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){Q(this,Ff).set(Ac(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Q(this,Ff).values()],n={};return e.forEach(s=>{Jf(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Q(this,Ec).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Vb(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===q1&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Q(this,Ec).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Q(this,ia).clear(),Q(this,wc).clear()}},ia=new WeakMap,wc=new WeakMap,Ec=new WeakMap,Xf=new WeakMap,Ff=new WeakMap,Tc=new WeakMap,Zf=new WeakMap,If=new WeakMap,x4);function v9({streamFn:t,refetchMode:e="reset",reducer:n=(i,o)=>_4(i,o),initialValue:s=[]}){return async i=>{const o=i.client.getQueryCache().find({queryKey:i.queryKey,exact:!0}),d=!!o&&o.isFetched();d&&e==="reset"&&o.setState({...o.resetState,fetchStatus:"fetching"});let f=s,p=!1;const y=C4({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>p=!0),b=await t(y),v=d&&e==="replace";for await(const _ of b){if(p)break;v?f=n(f,_):i.client.setQueryData(i.queryKey,C=>n(C===void 0?s:C,_))}return v&&!p&&i.client.setQueryData(i.queryKey,f),i.client.getQueryData(i.queryKey)??s}}var S9=Symbol("dataTagSymbol"),N9=Symbol("dataTagErrorSymbol"),_9=Symbol("unsetMarker"),Xb=D.createContext(void 0),ga=t=>{const e=D.useContext(Xb);if(t)return t;if(!e)throw new Error("No QueryClient set, use QueryClientProvider to set one");return e},Q4=({client:t,children:e})=>(D.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),h.jsx(Xb.Provider,{value:t,children:e})),K4=D.createContext(!1),Fb=()=>D.useContext(K4),j9=K4.Provider;function X4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var F4=D.createContext(X4()),Zb=()=>D.useContext(F4),C9=({children:t})=>{const[e]=D.useState(()=>X4());return h.jsx(F4.Provider,{value:e,children:typeof t=="function"?t(e):t})},Z4=(t,e,n)=>{const s=n!=null&&n.state.error&&typeof t.throwOnError=="function"?H1(t.throwOnError,[n.state.error,n]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||s)&&(e.isReset()||(t.retryOnMount=!1))},I4=t=>{D.useEffect(()=>{t.clearReset()},[t])},J4=({result:t,errorResetBoundary:e,throwOnError:n,query:s,suspense:i})=>t.isError&&!e.isReset()&&!t.isFetching&&s&&(i&&t.data===void 0||H1(n,[t.error,s])),Ib=(t,e)=>e.state.data===void 0,W4=t=>{if(t.suspense){const n=i=>i==="static"?i:Math.max(i??1e3,1e3),s=t.staleTime;t.staleTime=typeof s=="function"?(...i)=>n(s(...i)):n(s),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},w9=(t,e)=>t.isLoading&&t.isFetching&&!e,sb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,rb=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function $4({queries:t,...e},n){const s=ga(n),i=Fb(),o=Zb(),d=D.useMemo(()=>t.map(T=>{const R=s.defaultQueryOptions(T);return R._optimisticResults=i?"isRestoring":"optimistic",R}),[t,s,i]);d.forEach(T=>{W4(T);const R=s.getQueryCache().get(T.queryHash);Z4(T,o,R)}),I4(o);const[f]=D.useState(()=>new P4(s,d,e)),[p,y,b]=f.getOptimisticResult(d,e.combine),v=!i&&e.subscribed!==!1;D.useSyncExternalStore(D.useCallback(T=>v?f.subscribe(Un.batchCalls(T)):ma,[f,v]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),D.useEffect(()=>{f.setQueries(d,e)},[d,e,f]);const C=p.some((T,R)=>sb(d[R],T))?p.flatMap((T,R)=>{const O=d[R];if(O&&sb(O,T)){const M=new sh(s,O);return rb(O,M,o)}return[]}):[];if(C.length>0)throw Promise.all(C);const w=p.find((T,R)=>{const O=d[R];return O&&J4({result:T,errorResetBoundary:o,throwOnError:O.throwOnError,query:s.getQueryCache().get(O.queryHash),suspense:O.suspense})});if(w!=null&&w.error)throw w.error;return y(b())}function B1(t,e,n){var _,C,w,T;const s=Fb(),i=Zb(),o=ga(n),d=o.defaultQueryOptions(t);(C=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||C.call(_,d);const f=o.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",W4(d),Z4(d,i,f),I4(i);const p=!o.getQueryCache().get(d.queryHash),[y]=D.useState(()=>new e(o,d)),b=y.getOptimisticResult(d),v=!s&&t.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(R=>{const O=v?y.subscribe(Un.batchCalls(R)):ma;return y.updateResult(),O},[y,v]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),D.useEffect(()=>{y.setOptions(d)},[d,y]),sb(d,b))throw rb(d,y,i);if(J4({result:b,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw b.error;if((T=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||T.call(w,d,b),d.experimental_prefetchInRender&&!Wf.isServer()&&w9(b,s)){const R=p?rb(d,y,i):f==null?void 0:f.promise;R==null||R.catch(ma).finally(()=>{y.updateResult()})}return d.notifyOnChangeProps?b:y.trackResult(b)}function ot(t,e){return B1(t,sh,e)}function E9(t,e){return B1({...t,enabled:!0,suspense:!0,throwOnError:Ib,placeholderData:void 0},sh,e)}function T9(t,e){return B1({...t,enabled:!0,suspense:!0,throwOnError:Ib},Kb,e)}function R9(t,e){return $4({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Ib,enabled:!0,placeholderData:void 0}))},e)}function O9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchQuery(t)}function M9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchInfiniteQuery(t)}function A9(t){return t}function D9(t){return t}var z9=({children:t,options:e={},state:n,queryClient:s})=>{const i=ga(s),o=D.useRef(e);D.useEffect(()=>{o.current=e});const d=D.useMemo(()=>{if(n){if(typeof n!="object")return;const f=i.getQueryCache(),p=n.queries||[],y=[],b=[];for(const v of p){const _=f.get(v.queryHash);_?(v.state.dataUpdatedAt>_.state.dataUpdatedAt||v.promise&&_.state.status!=="pending"&&_.state.fetchStatus!=="fetching"&&v.dehydratedAt!==void 0&&v.dehydratedAt>_.state.dataUpdatedAt)&&b.push(v):y.push(v)}if(y.length>0&&Px(i,{queries:y},o.current),b.length>0)return b}},[i,n]);return D.useEffect(()=>{d&&Px(i,{queries:d},o.current)},[i,d]),t};function k9(t,e){const n=ga(e),s=n.getQueryCache();return D.useSyncExternalStore(D.useCallback(i=>s.subscribe(Un.batchCalls(i)),[s]),()=>n.isFetching(t),()=>n.isFetching(t))}function L9(t,e){const n=ga(e);return eS({filters:{...t,status:"pending"}},n).length}function k2(t,e){return t.findAll(e.filters).map(n=>e.select?e.select(n):n.state)}function eS(t={},e){const n=ga(e).getMutationCache(),s=D.useRef(t),i=D.useRef(null);return i.current===null&&(i.current=k2(n,t)),D.useEffect(()=>{s.current=t}),D.useSyncExternalStore(D.useCallback(o=>n.subscribe(()=>{const d=Vm(i.current,k2(n,s.current));i.current!==d&&(i.current=d,Un.schedule(o))}),[n]),()=>i.current,()=>i.current)}function Cn(t,e){const n=ga(e),[s]=D.useState(()=>new G4(n,t));D.useEffect(()=>{s.setOptions(t)},[s,t]);const i=D.useSyncExternalStore(D.useCallback(d=>s.subscribe(Un.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=D.useCallback((d,f)=>{s.mutate(d,f).catch(ma)},[s]);if(i.error&&H1(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function U9(t){return t}function q9(t,e){return B1(t,Kb,e)}const H9=Object.freeze(Object.defineProperty({__proto__:null,CancelledError:jm,HydrationBoundary:z9,InfiniteQueryObserver:Kb,IsRestoringProvider:j9,Mutation:q4,MutationCache:B4,MutationObserver:G4,QueriesObserver:P4,Query:D4,QueryCache:Y4,QueryClient:V4,QueryClientContext:Xb,QueryClientProvider:Q4,QueryErrorResetBoundary:C9,QueryObserver:sh,dataTagErrorSymbol:N9,dataTagSymbol:S9,defaultScheduler:R4,defaultShouldDehydrateMutation:E4,defaultShouldDehydrateQuery:T4,dehydrate:u9,environmentManager:Wf,experimental_streamedQuery:v9,focusManager:U1,hashKey:Ac,hydrate:Px,infiniteQueryOptions:D9,isCancelledError:p9,isServer:S4,keepPreviousData:s9,matchMutation:qx,matchQuery:Ux,mutationOptions:U9,noop:ma,notifyManager:Un,onlineManager:_m,partialMatchKey:Jf,queryOptions:A9,replaceEqualDeep:Vm,shouldThrowError:H1,skipToken:q1,timeoutManager:Rc,unsetMarker:_9,useInfiniteQuery:q9,useIsFetching:k9,useIsMutating:L9,useIsRestoring:Fb,useMutation:Cn,useMutationState:eS,usePrefetchInfiniteQuery:M9,usePrefetchQuery:O9,useQueries:$4,useQuery:ot,useQueryClient:ga,useQueryErrorResetBoundary:Zb,useSuspenseInfiniteQuery:T9,useSuspenseQueries:R9,useSuspenseQuery:E9},Symbol.toStringTag,{value:"Module"}));function B9(){window.__camstack={React:en,ReactDOM:v4,ReactQuery:H9}}/**
|
|
50
|
-
* react-router v7.13.1
|
|
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 L2="popstate";function U2(t){return typeof t=="object"&&t!=null&&"pathname"in t&&"search"in t&&"hash"in t&&"state"in t&&"key"in t}function G9(t={}){function e(s,i){var y;let o=(y=i.state)==null?void 0:y.masked,{pathname:d,search:f,hash:p}=o||s.location;return ib("",{pathname:d,search:f,hash:p},i.state&&i.state.usr||null,i.state&&i.state.key||"default",o?{pathname:s.location.pathname,search:s.location.search,hash:s.location.hash}:void 0)}function n(s,i){return typeof i=="string"?i:Cm(i)}return Y9(e,n,null,t)}function Vn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ei(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function P9(){return Math.random().toString(36).substring(2,10)}function q2(t,e){return{usr:t.state,key:t.key,idx:e,masked:t.unstable_mask?{pathname:t.pathname,search:t.search,hash:t.hash}:void 0}}function ib(t,e,n=null,s,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?rh(e):e,state:n,key:e&&e.key||s||P9(),unstable_mask:i}}function Cm({pathname:t="/",search:e="",hash:n=""}){return e&&e!=="?"&&(t+=e.charAt(0)==="?"?e:"?"+e),n&&n!=="#"&&(t+=n.charAt(0)==="#"?n:"#"+n),t}function rh(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substring(n),t=t.substring(0,n));let s=t.indexOf("?");s>=0&&(e.search=t.substring(s),t=t.substring(0,s)),t&&(e.pathname=t)}return e}function Y9(t,e,n,s={}){let{window:i=document.defaultView,v5Compat:o=!1}=s,d=i.history,f="POP",p=null,y=b();y==null&&(y=0,d.replaceState({...d.state,idx:y},""));function b(){return(d.state||{idx:null}).idx}function v(){f="POP";let R=b(),O=R==null?null:R-y;y=R,p&&p({action:f,location:T.location,delta:O})}function _(R,O){f="PUSH";let M=U2(R)?R:ib(T.location,R,O);y=b()+1;let z=q2(M,y),k=T.createHref(M.unstable_mask||M);try{d.pushState(z,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(k)}o&&p&&p({action:f,location:T.location,delta:1})}function C(R,O){f="REPLACE";let M=U2(R)?R:ib(T.location,R,O);y=b();let z=q2(M,y),k=T.createHref(M.unstable_mask||M);d.replaceState(z,"",k),o&&p&&p({action:f,location:T.location,delta:0})}function w(R){return V9(R)}let T={get action(){return f},get location(){return t(i,d)},listen(R){if(p)throw new Error("A history only accepts one active listener");return i.addEventListener(L2,v),p=R,()=>{i.removeEventListener(L2,v),p=null}},createHref(R){return e(i,R)},createURL:w,encodeLocation(R){let O=w(R);return{pathname:O.pathname,search:O.search,hash:O.hash}},push:_,replace:C,go(R){return d.go(R)}};return T}function V9(t,e=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Vn(n,"No window.location.(origin|href) available to create URL");let s=typeof t=="string"?t:Cm(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function tS(t,e,n="/"){return Q9(t,e,n,!1)}function Q9(t,e,n,s){let i=typeof e=="string"?rh(e):e,o=ho(i.pathname||"/",n);if(o==null)return null;let d=nS(t);K9(d);let f=null;for(let p=0;f==null&&p<d.length;++p){let y=aN(o);f=tN(d[p],y,s)}return f}function nS(t,e=[],n=[],s="",i=!1){let o=(d,f,p=i,y)=>{let b={relativePath:y===void 0?d.path||"":y,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(b.relativePath.startsWith("/")){if(!b.relativePath.startsWith(s)&&p)return;Vn(b.relativePath.startsWith(s),`Absolute route path "${b.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),b.relativePath=b.relativePath.slice(s.length)}let v=hl([s,b.relativePath]),_=n.concat(b);d.children&&d.children.length>0&&(Vn(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${v}".`),nS(d.children,e,_,v,p)),!(d.path==null&&!d.index)&&e.push({path:v,score:$9(v,d.index),routesMeta:_})};return t.forEach((d,f)=>{var p;if(d.path===""||!((p=d.path)!=null&&p.includes("?")))o(d,f);else for(let y of aS(d.path))o(d,f,!0,y)}),e}function aS(t){let e=t.split("/");if(e.length===0)return[];let[n,...s]=e,i=n.endsWith("?"),o=n.replace(/\?$/,"");if(s.length===0)return i?[o,""]:[o];let d=aS(s.join("/")),f=[];return f.push(...d.map(p=>p===""?o:[o,p].join("/"))),i&&f.push(...d),f.map(p=>t.startsWith("/")&&p===""?"/":p)}function K9(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:eN(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var X9=/^:[\w-]+$/,F9=3,Z9=2,I9=1,J9=10,W9=-2,H2=t=>t==="*";function $9(t,e){let n=t.split("/"),s=n.length;return n.some(H2)&&(s+=W9),e&&(s+=Z9),n.filter(i=>!H2(i)).reduce((i,o)=>i+(X9.test(o)?F9:o===""?I9:J9),s)}function eN(t,e){return t.length===e.length&&t.slice(0,-1).every((s,i)=>s===e[i])?t[t.length-1]-e[e.length-1]:0}function tN(t,e,n=!1){let{routesMeta:s}=t,i={},o="/",d=[];for(let f=0;f<s.length;++f){let p=s[f],y=f===s.length-1,b=o==="/"?e:e.slice(o.length)||"/",v=v1({path:p.relativePath,caseSensitive:p.caseSensitive,end:y},b),_=p.route;if(!v&&y&&n&&!s[s.length-1].route.index&&(v=v1({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},b)),!v)return null;Object.assign(i,v.params),d.push({params:i,pathname:hl([o,v.pathname]),pathnameBase:lN(hl([o,v.pathnameBase])),route:_}),v.pathnameBase!=="/"&&(o=hl([o,v.pathnameBase]))}return d}function v1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=nN(t.path,t.caseSensitive,t.end),i=e.match(n);if(!i)return null;let o=i[0],d=o.replace(/(.)\/+$/,"$1"),f=i.slice(1);return{params:s.reduce((y,{paramName:b,isOptional:v},_)=>{if(b==="*"){let w=f[_]||"";d=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const C=f[_];return v&&!C?y[b]=void 0:y[b]=(C||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:d,pattern:t}}function nN(t,e=!1,n=!0){Ei(t==="*"||!t.endsWith("*")||t.endsWith("/*"),`Route path "${t}" will be treated as if it were "${t.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${t.replace(/\*$/,"/*")}".`);let s=[],i="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,f,p,y,b)=>{if(s.push({paramName:f,isOptional:p!=null}),p){let v=b.charAt(y+d.length);return v&&v!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return t.endsWith("*")?(s.push({paramName:"*"}),i+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?i+="\\/*$":t!==""&&t!=="/"&&(i+="(?:(?=\\/|$))"),[new RegExp(i,e?void 0:"i"),s]}function aN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ei(!1,`The URL path "${t}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),t}}function ho(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,s=t.charAt(n);return s&&s!=="/"?null:t.slice(n)||"/"}var sN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function rN(t,e="/"){let{pathname:n,search:s="",hash:i=""}=typeof t=="string"?rh(t):t,o;return n?(n=n.replace(/\/\/+/g,"/"),n.startsWith("/")?o=B2(n.substring(1),"/"):o=B2(n,e)):o=e,{pathname:o,search:oN(s),hash:cN(i)}}function B2(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(i=>{i===".."?n.length>1&&n.pop():i!=="."&&n.push(i)}),n.length>1?n.join("/"):"/"}function Iy(t,e,n,s){return`Cannot include a '${t}' character in a manually specified \`to.${e}\` field [${JSON.stringify(s)}]. 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 iN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Jb(t){let e=iN(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function G1(t,e,n,s=!1){let i;typeof t=="string"?i=rh(t):(i={...t},Vn(!i.pathname||!i.pathname.includes("?"),Iy("?","pathname","search",i)),Vn(!i.pathname||!i.pathname.includes("#"),Iy("#","pathname","hash",i)),Vn(!i.search||!i.search.includes("#"),Iy("#","search","hash",i)));let o=t===""||i.pathname==="",d=o?"/":i.pathname,f;if(d==null)f=n;else{let v=e.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),v-=1;i.pathname=_.join("/")}f=v>=0?e[v]:"/"}let p=rN(i,f),y=d&&d!=="/"&&d.endsWith("/"),b=(o||d===".")&&n.endsWith("/");return!p.pathname.endsWith("/")&&(y||b)&&(p.pathname+="/"),p}var hl=t=>t.join("/").replace(/\/\/+/g,"/"),lN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),oN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,cN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,uN=class{constructor(t,e,n,s=!1){this.status=t,this.statusText=e||"",this.internal=s,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function dN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function fN(t){return t.map(e=>e.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var sS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function rS(t,e){let n=t;if(typeof n!="string"||!sN.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let s=n,i=!1;if(sS)try{let o=new URL(window.location.href),d=n.startsWith("//")?new URL(o.protocol+n):new URL(n),f=ho(d.pathname,e);d.origin===o.origin&&f!=null?n=f+d.search+d.hash:i=!0}catch{Ei(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:s,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iS=["POST","PUT","PATCH","DELETE"];new Set(iS);var hN=["GET",...iS];new Set(hN);var ih=D.createContext(null);ih.displayName="DataRouter";var P1=D.createContext(null);P1.displayName="DataRouterState";var pN=D.createContext(!1),lS=D.createContext({isTransitioning:!1});lS.displayName="ViewTransition";var mN=D.createContext(new Map);mN.displayName="Fetchers";var gN=D.createContext(null);gN.displayName="Await";var wr=D.createContext(null);wr.displayName="Navigation";var Qm=D.createContext(null);Qm.displayName="Location";var ii=D.createContext({outlet:null,matches:[],isDataRoute:!1});ii.displayName="Route";var Wb=D.createContext(null);Wb.displayName="RouteError";var oS="REACT_ROUTER_ERROR",yN="REDIRECT",xN="ROUTE_ERROR_RESPONSE";function bN(t){if(t.startsWith(`${oS}:${yN}:{`))try{let e=JSON.parse(t.slice(28));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.location=="string"&&typeof e.reloadDocument=="boolean"&&typeof e.replace=="boolean")return e}catch{}}function vN(t){if(t.startsWith(`${oS}:${xN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new uN(e.status,e.statusText,e.data)}catch{}}function SN(t,{relative:e}={}){Vn(lh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=D.useContext(wr),{hash:i,pathname:o,search:d}=Km(t,{relative:e}),f=o;return n!=="/"&&(f=o==="/"?n:hl([n,o])),s.createHref({pathname:f,search:d,hash:i})}function lh(){return D.useContext(Qm)!=null}function ml(){return Vn(lh(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Qm).location}var cS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function uS(t){D.useContext(wr).static||D.useLayoutEffect(t)}function gl(){let{isDataRoute:t}=D.useContext(ii);return t?LN():NN()}function NN(){Vn(lh(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(ih),{basename:e,navigator:n}=D.useContext(wr),{matches:s}=D.useContext(ii),{pathname:i}=ml(),o=JSON.stringify(Jb(s)),d=D.useRef(!1);return uS(()=>{d.current=!0}),D.useCallback((p,y={})=>{if(Ei(d.current,cS),!d.current)return;if(typeof p=="number"){n.go(p);return}let b=G1(p,JSON.parse(o),i,y.relative==="path");t==null&&e!=="/"&&(b.pathname=b.pathname==="/"?e:hl([e,b.pathname])),(y.replace?n.replace:n.push)(b,y.state,y)},[e,n,o,i,t])}var _N=D.createContext(null);function jN(t){let e=D.useContext(ii).outlet;return D.useMemo(()=>e&&D.createElement(_N.Provider,{value:t},e),[e,t])}function $b(){let{matches:t}=D.useContext(ii),e=t[t.length-1];return e?e.params:{}}function Km(t,{relative:e}={}){let{matches:n}=D.useContext(ii),{pathname:s}=ml(),i=JSON.stringify(Jb(n));return D.useMemo(()=>G1(t,JSON.parse(i),s,e==="path"),[t,i,s,e])}function CN(t,e){return dS(t,e)}function dS(t,e,n){var R;Vn(lh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=D.useContext(wr),{matches:i}=D.useContext(ii),o=i[i.length-1],d=o?o.params:{},f=o?o.pathname:"/",p=o?o.pathnameBase:"/",y=o&&o.route;{let O=y&&y.path||"";hS(f,!y||O.endsWith("*")||O.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${O}">) 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.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${O}"> to <Route path="${O==="/"?"*":`${O}/*`}">.`)}let b=ml(),v;if(e){let O=typeof e=="string"?rh(e):e;Vn(p==="/"||((R=O.pathname)==null?void 0:R.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${O.pathname}" was given in the \`location\` prop.`),v=O}else v=b;let _=v.pathname||"/",C=_;if(p!=="/"){let O=p.replace(/^\//,"").split("/");C="/"+_.replace(/^\//,"").split("/").slice(O.length).join("/")}let w=tS(t,{pathname:C});Ei(y||w!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Ei(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.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.`);let T=ON(w&&w.map(O=>Object.assign({},O,{params:Object.assign({},d,O.params),pathname:hl([p,s.encodeLocation?s.encodeLocation(O.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathname]),pathnameBase:O.pathnameBase==="/"?p:hl([p,s.encodeLocation?s.encodeLocation(O.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:O.pathnameBase])})),i,n);return e&&T?D.createElement(Qm.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...v},navigationType:"POP"}},T):T}function wN(){let t=kN(),e=dN(t)?`${t.status} ${t.statusText}`:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s="rgba(200,200,200, 0.5)",i={padding:"0.5rem",backgroundColor:s},o={padding:"2px 4px",backgroundColor:s},d=null;return console.error("Error handled by React Router default ErrorBoundary:",t),d=D.createElement(D.Fragment,null,D.createElement("p",null,"💿 Hey developer 👋"),D.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",D.createElement("code",{style:o},"ErrorBoundary")," or"," ",D.createElement("code",{style:o},"errorElement")," prop on your route.")),D.createElement(D.Fragment,null,D.createElement("h2",null,"Unexpected Application Error!"),D.createElement("h3",{style:{fontStyle:"italic"}},e),n?D.createElement("pre",{style:i},n):null,d)}var EN=D.createElement(wN,null),fS=class extends D.Component{constructor(t){super(t),this.state={location:t.location,revalidation:t.revalidation,error:t.error}}static getDerivedStateFromError(t){return{error:t}}static getDerivedStateFromProps(t,e){return e.location!==t.location||e.revalidation!=="idle"&&t.revalidation==="idle"?{error:t.error,location:t.location,revalidation:t.revalidation}:{error:t.error!==void 0?t.error:e.error,location:e.location,revalidation:t.revalidation||e.revalidation}}componentDidCatch(t,e){this.props.onError?this.props.onError(t,e):console.error("React Router caught the following error during render",t)}render(){let t=this.state.error;if(this.context&&typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){const n=vN(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(ii.Provider,{value:this.props.routeContext},D.createElement(Wb.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(TN,{error:t},e):e}};fS.contextType=pN;var Jy=new WeakMap;function TN({children:t,error:e}){let{basename:n}=D.useContext(wr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=bN(e.digest);if(s){let i=Jy.get(e);if(i)throw i;let o=rS(s.location,n);if(sS&&!Jy.get(e))if(o.isExternal||s.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const d=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:s.replace}));throw Jy.set(e,d),d}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function RN({routeContext:t,match:e,children:n}){let s=D.useContext(ih);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),D.createElement(ii.Provider,{value:t},n)}function ON(t,e=[],n){let s=n==null?void 0:n.state;if(t==null){if(!s)return null;if(s.errors)t=s.matches;else if(e.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let i=t,o=s==null?void 0:s.errors;if(o!=null){let b=i.findIndex(v=>v.route.id&&(o==null?void 0:o[v.route.id])!==void 0);Vn(b>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,b+1))}let d=!1,f=-1;if(n&&s){d=s.renderFallback;for(let b=0;b<i.length;b++){let v=i[b];if((v.route.HydrateFallback||v.route.hydrateFallbackElement)&&(f=b),v.route.id){let{loaderData:_,errors:C}=s,w=v.route.loader&&!_.hasOwnProperty(v.route.id)&&(!C||C[v.route.id]===void 0);if(v.route.lazy||w){n.isStatic&&(d=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let p=n==null?void 0:n.onError,y=s&&p?(b,v)=>{var _,C;p(b,{location:s.location,params:((C=(_=s.matches)==null?void 0:_[0])==null?void 0:C.params)??{},unstable_pattern:fN(s.matches),errorInfo:v})}:void 0;return i.reduceRight((b,v,_)=>{let C,w=!1,T=null,R=null;s&&(C=o&&v.route.id?o[v.route.id]:void 0,T=v.route.errorElement||EN,d&&(f<0&&_===0?(hS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,R=null):f===_&&(w=!0,R=v.route.hydrateFallbackElement||null)));let O=e.concat(i.slice(0,_+1)),M=()=>{let z;return C?z=T:w?z=R:v.route.Component?z=D.createElement(v.route.Component,null):v.route.element?z=v.route.element:z=b,D.createElement(RN,{match:v,routeContext:{outlet:b,matches:O,isDataRoute:s!=null},children:z})};return s&&(v.route.ErrorBoundary||v.route.errorElement||_===0)?D.createElement(fS,{location:s.location,revalidation:s.revalidation,component:T,error:C,children:M(),routeContext:{outlet:null,matches:O,isDataRoute:!0},onError:y}):M()},null)}function ev(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function MN(t){let e=D.useContext(ih);return Vn(e,ev(t)),e}function AN(t){let e=D.useContext(P1);return Vn(e,ev(t)),e}function DN(t){let e=D.useContext(ii);return Vn(e,ev(t)),e}function tv(t){let e=DN(t),n=e.matches[e.matches.length-1];return Vn(n.route.id,`${t} can only be used on routes that contain a unique "id"`),n.route.id}function zN(){return tv("useRouteId")}function kN(){var s;let t=D.useContext(Wb),e=AN("useRouteError"),n=tv("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function LN(){let{router:t}=MN("useNavigate"),e=tv("useNavigate"),n=D.useRef(!1);return uS(()=>{n.current=!0}),D.useCallback(async(i,o={})=>{Ei(n.current,cS),n.current&&(typeof i=="number"?await t.navigate(i):await t.navigate(i,{fromRouteId:e,...o}))},[t,e])}var G2={};function hS(t,e,n){!e&&!G2[t]&&(G2[t]=!0,Ei(!1,n))}D.memo(UN);function UN({routes:t,future:e,state:n,isStatic:s,onError:i}){return dS(t,void 0,{state:n,isStatic:s,onError:i})}function lb({to:t,replace:e,state:n,relative:s}){Vn(lh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=D.useContext(wr);Ei(!i,"<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:o}=D.useContext(ii),{pathname:d}=ml(),f=gl(),p=G1(t,Jb(o),d,s==="path"),y=JSON.stringify(p);return D.useEffect(()=>{f(JSON.parse(y),{replace:e,state:n,relative:s})},[f,y,s,e,n]),null}function qN(t){return jN(t.context)}function La(t){Vn(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function HN({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:i,static:o=!1,unstable_useTransitions:d}){Vn(!lh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),p=D.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:d,future:{}}),[f,i,o,d]);typeof n=="string"&&(n=rh(n));let{pathname:y="/",search:b="",hash:v="",state:_=null,key:C="default",unstable_mask:w}=n,T=D.useMemo(()=>{let R=ho(y,f);return R==null?null:{location:{pathname:R,search:b,hash:v,state:_,key:C,unstable_mask:w},navigationType:s}},[f,y,b,v,_,C,s,w]);return Ei(T!=null,`<Router basename="${f}"> is not able to match the URL "${y}${b}${v}" because it does not start with the basename, so the <Router> won't render anything.`),T==null?null:D.createElement(wr.Provider,{value:p},D.createElement(Qm.Provider,{children:e,value:T}))}function BN({children:t,location:e}){return CN(ob(t),e)}function ob(t,e=[]){let n=[];return D.Children.forEach(t,(s,i)=>{if(!D.isValidElement(s))return;let o=[...e,i];if(s.type===D.Fragment){n.push.apply(n,ob(s.props.children,o));return}Vn(s.type===La,`[${typeof s.type=="string"?s.type:s.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Vn(!s.props.index||!s.props.children,"An index route cannot have child routes.");let d={id:s.props.id||o.join("-"),caseSensitive:s.props.caseSensitive,element:s.props.element,Component:s.props.Component,index:s.props.index,path:s.props.path,middleware:s.props.middleware,loader:s.props.loader,action:s.props.action,hydrateFallbackElement:s.props.hydrateFallbackElement,HydrateFallback:s.props.HydrateFallback,errorElement:s.props.errorElement,ErrorBoundary:s.props.ErrorBoundary,hasErrorBoundary:s.props.hasErrorBoundary===!0||s.props.ErrorBoundary!=null||s.props.errorElement!=null,shouldRevalidate:s.props.shouldRevalidate,handle:s.props.handle,lazy:s.props.lazy};s.props.children&&(d.children=ob(s.props.children,o)),n.push(d)}),n}var f1="get",h1="application/x-www-form-urlencoded";function Y1(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function GN(t){return Y1(t)&&t.tagName.toLowerCase()==="button"}function PN(t){return Y1(t)&&t.tagName.toLowerCase()==="form"}function YN(t){return Y1(t)&&t.tagName.toLowerCase()==="input"}function VN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function QN(t,e){return t.button===0&&(!e||e==="_self")&&!VN(t)}var H0=null;function KN(){if(H0===null)try{new FormData(document.createElement("form"),0),H0=!1}catch{H0=!0}return H0}var XN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Wy(t){return t!=null&&!XN.has(t)?(Ei(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${h1}"`),null):t}function FN(t,e){let n,s,i,o,d;if(PN(t)){let f=t.getAttribute("action");s=f?ho(f,e):null,n=t.getAttribute("method")||f1,i=Wy(t.getAttribute("enctype"))||h1,o=new FormData(t)}else if(GN(t)||YN(t)&&(t.type==="submit"||t.type==="image")){let f=t.form;if(f==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=t.getAttribute("formaction")||f.getAttribute("action");if(s=p?ho(p,e):null,n=t.getAttribute("formmethod")||f.getAttribute("method")||f1,i=Wy(t.getAttribute("formenctype"))||Wy(f.getAttribute("enctype"))||h1,o=new FormData(f,t),!KN()){let{name:y,type:b,value:v}=t;if(b==="image"){let _=y?`${y}.`:"";o.append(`${_}x`,"0"),o.append(`${_}y`,"0")}else y&&o.append(y,v)}}else{if(Y1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=f1,s=null,i=h1,d=t}return o&&i==="text/plain"&&(d=o,o=void 0),{action:s,method:n.toLowerCase(),encType:i,formData:o,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function nv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function ZN(t,e,n,s){let i=typeof t=="string"?new URL(t,typeof window>"u"?"server://singlefetch/":window.location.origin):t;return n?i.pathname.endsWith("/")?i.pathname=`${i.pathname}_.${s}`:i.pathname=`${i.pathname}.${s}`:i.pathname==="/"?i.pathname=`_root.${s}`:e&&ho(i.pathname,e)==="/"?i.pathname=`${e.replace(/\/$/,"")}/_root.${s}`:i.pathname=`${i.pathname.replace(/\/$/,"")}.${s}`,i}async function IN(t,e){if(t.id in e)return e[t.id];try{let n=await import(t.module);return e[t.id]=n,n}catch(n){return console.error(`Error loading route module \`${t.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function JN(t){return t==null?!1:t.href==null?t.rel==="preload"&&typeof t.imageSrcSet=="string"&&typeof t.imageSizes=="string":typeof t.rel=="string"&&typeof t.href=="string"}async function WN(t,e,n){let s=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let d=await IN(o,n);return d.links?d.links():[]}return[]}));return n_(s.flat(1).filter(JN).filter(i=>i.rel==="stylesheet"||i.rel==="preload").map(i=>i.rel==="stylesheet"?{...i,rel:"prefetch",as:"style"}:{...i,rel:"prefetch"}))}function P2(t,e,n,s,i,o){let d=(p,y)=>n[y]?p.route.id!==n[y].route.id:!0,f=(p,y)=>{var b;return n[y].pathname!==p.pathname||((b=n[y].route.path)==null?void 0:b.endsWith("*"))&&n[y].params["*"]!==p.params["*"]};return o==="assets"?e.filter((p,y)=>d(p,y)||f(p,y)):o==="data"?e.filter((p,y)=>{var v;let b=s.routes[p.route.id];if(!b||!b.hasLoader)return!1;if(d(p,y)||f(p,y))return!0;if(p.route.shouldRevalidate){let _=p.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((v=n[0])==null?void 0:v.params)||{},nextUrl:new URL(t,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function $N(t,e,{includeHydrateFallback:n}={}){return e_(t.map(s=>{let i=e.routes[s.route.id];if(!i)return[];let o=[i.module];return i.clientActionModule&&(o=o.concat(i.clientActionModule)),i.clientLoaderModule&&(o=o.concat(i.clientLoaderModule)),n&&i.hydrateFallbackModule&&(o=o.concat(i.hydrateFallbackModule)),i.imports&&(o=o.concat(i.imports)),o}).flat(1))}function e_(t){return[...new Set(t)]}function t_(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function n_(t,e){let n=new Set;return new Set(e),t.reduce((s,i)=>{let o=JSON.stringify(t_(i));return n.has(o)||(n.add(o),s.push({key:o,link:i})),s},[])}function pS(){let t=D.useContext(ih);return nv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function a_(){let t=D.useContext(P1);return nv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var av=D.createContext(void 0);av.displayName="FrameworkContext";function mS(){let t=D.useContext(av);return nv(t,"You must render this element inside a <HydratedRouter> element"),t}function s_(t,e){let n=D.useContext(av),[s,i]=D.useState(!1),[o,d]=D.useState(!1),{onFocus:f,onBlur:p,onMouseEnter:y,onMouseLeave:b,onTouchStart:v}=e,_=D.useRef(null);D.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let T=O=>{O.forEach(M=>{d(M.isIntersecting)})},R=new IntersectionObserver(T,{threshold:.5});return _.current&&R.observe(_.current),()=>{R.disconnect()}}},[t]),D.useEffect(()=>{if(s){let T=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(T)}}},[s]);let C=()=>{i(!0)},w=()=>{i(!1),d(!1)};return n?t!=="intent"?[o,_,{}]:[o,_,{onFocus:Vp(f,C),onBlur:Vp(p,w),onMouseEnter:Vp(y,C),onMouseLeave:Vp(b,w),onTouchStart:Vp(v,C)}]:[!1,_,{}]}function Vp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function r_({page:t,...e}){let{router:n}=pS(),s=D.useMemo(()=>tS(n.routes,t,n.basename),[n.routes,t,n.basename]);return s?D.createElement(l_,{page:t,matches:s,...e}):null}function i_(t){let{manifest:e,routeModules:n}=mS(),[s,i]=D.useState([]);return D.useEffect(()=>{let o=!1;return WN(t,e,n).then(d=>{o||i(d)}),()=>{o=!0}},[t,e,n]),s}function l_({page:t,matches:e,...n}){let s=ml(),{future:i,manifest:o,routeModules:d}=mS(),{basename:f}=pS(),{loaderData:p,matches:y}=a_(),b=D.useMemo(()=>P2(t,e,y,o,s,"data"),[t,e,y,o,s]),v=D.useMemo(()=>P2(t,e,y,o,s,"assets"),[t,e,y,o,s]),_=D.useMemo(()=>{if(t===s.pathname+s.search+s.hash)return[];let T=new Set,R=!1;if(e.forEach(M=>{var k;let z=o.routes[M.route.id];!z||!z.hasLoader||(!b.some(P=>P.route.id===M.route.id)&&M.route.id in p&&((k=d[M.route.id])!=null&&k.shouldRevalidate)||z.hasClientLoader?R=!0:T.add(M.route.id))}),T.size===0)return[];let O=ZN(t,f,i.unstable_trailingSlashAwareDataRequests,"data");return R&&T.size>0&&O.searchParams.set("_routes",e.filter(M=>T.has(M.route.id)).map(M=>M.route.id).join(",")),[O.pathname+O.search]},[f,i.unstable_trailingSlashAwareDataRequests,p,s,o,b,e,t,d]),C=D.useMemo(()=>$N(v,o),[v,o]),w=i_(v);return D.createElement(D.Fragment,null,_.map(T=>D.createElement("link",{key:T,rel:"prefetch",as:"fetch",href:T,...n})),C.map(T=>D.createElement("link",{key:T,rel:"modulepreload",href:T,...n})),w.map(({key:T,link:R})=>D.createElement("link",{key:T,nonce:n.nonce,...R,crossOrigin:R.crossOrigin??n.crossOrigin})))}function o_(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var c_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{c_&&(window.__reactRouterVersion="7.13.1")}catch{}function u_({basename:t,children:e,unstable_useTransitions:n,window:s}){let i=D.useRef();i.current==null&&(i.current=G9({window:s,v5Compat:!0}));let o=i.current,[d,f]=D.useState({action:o.action,location:o.location}),p=D.useCallback(y=>{n===!1?f(y):D.startTransition(()=>f(y))},[n]);return D.useLayoutEffect(()=>o.listen(p),[o,p]),D.createElement(HN,{basename:t,children:e,location:d.location,navigationType:d.action,navigator:o,unstable_useTransitions:n})}var gS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,sv=D.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:i,reloadDocument:o,replace:d,unstable_mask:f,state:p,target:y,to:b,preventScrollReset:v,viewTransition:_,unstable_defaultShouldRevalidate:C,...w},T){let{basename:R,navigator:O,unstable_useTransitions:M}=D.useContext(wr),z=typeof b=="string"&&gS.test(b),k=rS(b,R);b=k.to;let P=SN(b,{relative:i}),q=ml(),L=null;if(f){let ce=G1(f,[],q.unstable_mask?q.unstable_mask.pathname:"/",!0);R!=="/"&&(ce.pathname=ce.pathname==="/"?R:hl([R,ce.pathname])),L=O.createHref(ce)}let[U,V,F]=s_(s,w),re=p_(b,{replace:d,unstable_mask:f,state:p,target:y,preventScrollReset:v,relative:i,viewTransition:_,unstable_defaultShouldRevalidate:C,unstable_useTransitions:M});function ne(ce){e&&e(ce),ce.defaultPrevented||re(ce)}let J=!(k.isExternal||o),ie=D.createElement("a",{...w,...F,href:(J?L:void 0)||k.absoluteURL||P,onClick:J?ne:e,ref:o_(T,V),target:y,"data-discover":!z&&n==="render"?"true":void 0});return U&&!z?D.createElement(D.Fragment,null,ie,D.createElement(r_,{page:P})):ie});sv.displayName="Link";var d_=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:i=!1,style:o,to:d,viewTransition:f,children:p,...y},b){let v=Km(d,{relative:y.relative}),_=ml(),C=D.useContext(P1),{navigator:w,basename:T}=D.useContext(wr),R=C!=null&&b_(v)&&f===!0,O=w.encodeLocation?w.encodeLocation(v).pathname:v.pathname,M=_.pathname,z=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;n||(M=M.toLowerCase(),z=z?z.toLowerCase():null,O=O.toLowerCase()),z&&T&&(z=ho(z,T)||z);const k=O!=="/"&&O.endsWith("/")?O.length-1:O.length;let P=M===O||!i&&M.startsWith(O)&&M.charAt(k)==="/",q=z!=null&&(z===O||!i&&z.startsWith(O)&&z.charAt(O.length)==="/"),L={isActive:P,isPending:q,isTransitioning:R},U=P?e:void 0,V;typeof s=="function"?V=s(L):V=[s,P?"active":null,q?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let F=typeof o=="function"?o(L):o;return D.createElement(sv,{...y,"aria-current":U,className:V,ref:b,style:F,to:d,viewTransition:f},typeof p=="function"?p(L):p)});d_.displayName="NavLink";var f_=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:i,state:o,method:d=f1,action:f,onSubmit:p,relative:y,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:_,...C},w)=>{let{unstable_useTransitions:T}=D.useContext(wr),R=y_(),O=x_(f,{relative:y}),M=d.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&gS.test(f),k=P=>{if(p&&p(P),P.defaultPrevented)return;P.preventDefault();let q=P.nativeEvent.submitter,L=(q==null?void 0:q.getAttribute("formmethod"))||d,U=()=>R(q||P.currentTarget,{fetcherKey:e,method:L,navigate:n,replace:i,state:o,relative:y,preventScrollReset:b,viewTransition:v,unstable_defaultShouldRevalidate:_});T&&n!==!1?D.startTransition(()=>U()):U()};return D.createElement("form",{ref:w,method:M,action:O,onSubmit:s?p:k,...C,"data-discover":!z&&t==="render"?"true":void 0})});f_.displayName="Form";function h_(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function yS(t){let e=D.useContext(ih);return Vn(e,h_(t)),e}function p_(t,{target:e,replace:n,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:y}={}){let b=gl(),v=ml(),_=Km(t,{relative:d});return D.useCallback(C=>{if(QN(C,e)){C.preventDefault();let w=n!==void 0?n:Cm(v)===Cm(_),T=()=>b(t,{replace:w,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p});y?D.startTransition(()=>T()):T()}},[v,b,_,n,s,i,e,t,o,d,f,p,y])}var m_=0,g_=()=>`__${String(++m_)}__`;function y_(){let{router:t}=yS("useSubmit"),{basename:e}=D.useContext(wr),n=zN(),s=t.fetch,i=t.navigate;return D.useCallback(async(o,d={})=>{let{action:f,method:p,encType:y,formData:b,body:v}=FN(o,e);if(d.navigate===!1){let _=d.fetcherKey||g_();await s(_,n,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:v,formMethod:d.method||p,formEncType:d.encType||y,flushSync:d.flushSync})}else await i(d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:b,body:v,formMethod:d.method||p,formEncType:d.encType||y,replace:d.replace,state:d.state,fromRouteId:n,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,e,n])}function x_(t,{relative:e}={}){let{basename:n}=D.useContext(wr),s=D.useContext(ii);Vn(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),o={...Km(t||".",{relative:e})},d=ml();if(t==null){o.search=d.search;let f=new URLSearchParams(o.search),p=f.getAll("index");if(p.some(b=>b==="")){f.delete("index"),p.filter(v=>v).forEach(v=>f.append("index",v));let b=f.toString();o.search=b?`?${b}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:hl([n,o.pathname])),Cm(o)}function b_(t,{relative:e}={}){let n=D.useContext(lS);Vn(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:s}=yS("useViewTransitionState"),i=Km(t,{relative:e});if(!n.isTransitioning)return!1;let o=ho(n.currentLocation.pathname,s)||n.currentLocation.pathname,d=ho(n.nextLocation.pathname,s)||n.nextLocation.pathname;return v1(i.pathname,d)!=null||v1(i.pathname,o)!=null}const xS=D.createContext(null),$y=["dark","light","system"];function bS(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function v_(t,e){if(typeof window>"u")return e;const n=localStorage.getItem(t);return n==="dark"||n==="light"||n==="system"?n:e}function Y2(t){return t==="system"?bS():t}function S_({children:t,defaultMode:e="system",storageKey:n="camstack-theme-mode"}){const[s,i]=D.useState(()=>v_(n,e)),[o,d]=D.useState(()=>Y2(s)),f=D.useCallback(b=>{i(b),d(Y2(b)),typeof window<"u"&&localStorage.setItem(n,b)},[n]),p=D.useCallback(()=>{const v=($y.indexOf(s)+1)%$y.length;f($y[v]??"dark")},[s,f]);D.useEffect(()=>{if(typeof document>"u")return;const b=document.documentElement;b.classList.remove("dark","light"),b.classList.add(o)},[s,o]),D.useEffect(()=>{if(typeof window>"u"||s!=="system")return;const b=window.matchMedia("(prefers-color-scheme: dark)"),v=()=>{d(bS())};return b.addEventListener("change",v),()=>b.removeEventListener("change",v)},[s]);const y=D.useMemo(()=>({mode:s,resolvedMode:o,setMode:f,toggleMode:p}),[s,o,f,p]);return h.jsx(xS.Provider,{value:y,children:t})}function vS(){const t=D.useContext(xS);if(!t)throw new Error("useThemeMode must be used within a ThemeProvider");return t}function SS(t){var e,n,s="";if(typeof t=="string"||typeof t=="number")s+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=SS(t[e]))&&(s&&(s+=" "),s+=n)}else for(n in t)t[n]&&(s&&(s+=" "),s+=n);return s}function V1(){for(var t,e,n=0,s="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=SS(t))&&(s&&(s+=" "),s+=e);return s}const N_=(t,e)=>{const n=new Array(t.length+e.length);for(let s=0;s<t.length;s++)n[s]=t[s];for(let s=0;s<e.length;s++)n[t.length+s]=e[s];return n},__=(t,e)=>({classGroupId:t,validator:e}),NS=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),S1="-",V2=[],j_="arbitrary..",C_=t=>{const e=E_(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return w_(d);const f=d.split(S1),p=f[0]===""&&f.length>1?1:0;return _S(f,p,e)},getConflictingClassGroupIds:(d,f)=>{if(f){const p=s[d],y=n[d];return p?y?N_(y,p):p:y||V2}return n[d]||V2}}},_S=(t,e,n)=>{if(t.length-e===0)return n.classGroupId;const i=t[e],o=n.nextPart.get(i);if(o){const y=_S(t,e+1,o);if(y)return y}const d=n.validators;if(d===null)return;const f=e===0?t.join(S1):t.slice(e).join(S1),p=d.length;for(let y=0;y<p;y++){const b=d[y];if(b.validator(f))return b.classGroupId}},w_=t=>t.slice(1,-1).indexOf(":")===-1?void 0:(()=>{const e=t.slice(1,-1),n=e.indexOf(":"),s=e.slice(0,n);return s?j_+s:void 0})(),E_=t=>{const{theme:e,classGroups:n}=t;return T_(n,e)},T_=(t,e)=>{const n=NS();for(const s in t){const i=t[s];rv(i,n,s,e)}return n},rv=(t,e,n,s)=>{const i=t.length;for(let o=0;o<i;o++){const d=t[o];R_(d,e,n,s)}},R_=(t,e,n,s)=>{if(typeof t=="string"){O_(t,e,n);return}if(typeof t=="function"){M_(t,e,n,s);return}A_(t,e,n,s)},O_=(t,e,n)=>{const s=t===""?e:jS(e,t);s.classGroupId=n},M_=(t,e,n,s)=>{if(D_(t)){rv(t(s),e,n,s);return}e.validators===null&&(e.validators=[]),e.validators.push(__(n,t))},A_=(t,e,n,s)=>{const i=Object.entries(t),o=i.length;for(let d=0;d<o;d++){const[f,p]=i[d];rv(p,jS(e,f),n,s)}},jS=(t,e)=>{let n=t;const s=e.split(S1),i=s.length;for(let o=0;o<i;o++){const d=s[o];let f=n.nextPart.get(d);f||(f=NS(),n.nextPart.set(d,f)),n=f}return n},D_=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,z_=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=Object.create(null),s=Object.create(null);const i=(o,d)=>{n[o]=d,e++,e>t&&(e=0,s=n,n=Object.create(null))};return{get(o){let d=n[o];if(d!==void 0)return d;if((d=s[o])!==void 0)return i(o,d),d},set(o,d){o in n?n[o]=d:i(o,d)}}},cb="!",Q2=":",k_=[],K2=(t,e,n,s,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),L_=t=>{const{prefix:e,experimentalParseClassName:n}=t;let s=i=>{const o=[];let d=0,f=0,p=0,y;const b=i.length;for(let T=0;T<b;T++){const R=i[T];if(d===0&&f===0){if(R===Q2){o.push(i.slice(p,T)),p=T+1;continue}if(R==="/"){y=T;continue}}R==="["?d++:R==="]"?d--:R==="("?f++:R===")"&&f--}const v=o.length===0?i:i.slice(p);let _=v,C=!1;v.endsWith(cb)?(_=v.slice(0,-1),C=!0):v.startsWith(cb)&&(_=v.slice(1),C=!0);const w=y&&y>p?y-p:void 0;return K2(o,C,_,w)};if(e){const i=e+Q2,o=s;s=d=>d.startsWith(i)?o(d.slice(i.length)):K2(k_,!1,d,void 0,!0)}if(n){const i=s;s=o=>n({className:o,parseClassName:i})}return s},U_=t=>{const e=new Map;return t.orderSensitiveModifiers.forEach((n,s)=>{e.set(n,1e6+s)}),n=>{const s=[];let i=[];for(let o=0;o<n.length;o++){const d=n[o],f=d[0]==="[",p=e.has(d);f||p?(i.length>0&&(i.sort(),s.push(...i),i=[]),s.push(d)):i.push(d)}return i.length>0&&(i.sort(),s.push(...i)),s}},q_=t=>({cache:z_(t.cacheSize),parseClassName:L_(t),sortModifiers:U_(t),...C_(t)}),H_=/\s+/,B_=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:o}=e,d=[],f=t.trim().split(H_);let p="";for(let y=f.length-1;y>=0;y-=1){const b=f[y],{isExternal:v,modifiers:_,hasImportantModifier:C,baseClassName:w,maybePostfixModifierPosition:T}=n(b);if(v){p=b+(p.length>0?" "+p:p);continue}let R=!!T,O=s(R?w.substring(0,T):w);if(!O){if(!R){p=b+(p.length>0?" "+p:p);continue}if(O=s(w),!O){p=b+(p.length>0?" "+p:p);continue}R=!1}const M=_.length===0?"":_.length===1?_[0]:o(_).join(":"),z=C?M+cb:M,k=z+O;if(d.indexOf(k)>-1)continue;d.push(k);const P=i(O,R);for(let q=0;q<P.length;++q){const L=P[q];d.push(z+L)}p=b+(p.length>0?" "+p:p)}return p},G_=(...t)=>{let e=0,n,s,i="";for(;e<t.length;)(n=t[e++])&&(s=CS(n))&&(i&&(i+=" "),i+=s);return i},CS=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=CS(t[s]))&&(n&&(n+=" "),n+=e);return n},P_=(t,...e)=>{let n,s,i,o;const d=p=>{const y=e.reduce((b,v)=>v(b),t());return n=q_(y),s=n.cache.get,i=n.cache.set,o=f,f(p)},f=p=>{const y=s(p);if(y)return y;const b=B_(p,n);return i(p,b),b};return o=d,(...p)=>o(G_(...p))},Y_=[],ka=t=>{const e=n=>n[t]||Y_;return e.isThemeGetter=!0,e},wS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ES=/^\((?:(\w[\w-]*):)?(.+)\)$/i,V_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Q_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,K_=/\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$/,X_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,F_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,Z_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cc=t=>V_.test(t),jt=t=>!!t&&!Number.isNaN(Number(t)),uc=t=>!!t&&Number.isInteger(Number(t)),ex=t=>t.endsWith("%")&&jt(t.slice(0,-1)),Wl=t=>Q_.test(t),TS=()=>!0,I_=t=>K_.test(t)&&!X_.test(t),iv=()=>!1,J_=t=>F_.test(t),W_=t=>Z_.test(t),$_=t=>!Be(t)&&!Ge(t),ej=t=>kc(t,MS,iv),Be=t=>wS.test(t),Mu=t=>kc(t,AS,I_),X2=t=>kc(t,oj,jt),tj=t=>kc(t,zS,TS),nj=t=>kc(t,DS,iv),F2=t=>kc(t,RS,iv),aj=t=>kc(t,OS,W_),B0=t=>kc(t,kS,J_),Ge=t=>ES.test(t),Qp=t=>ed(t,AS),sj=t=>ed(t,DS),Z2=t=>ed(t,RS),rj=t=>ed(t,MS),ij=t=>ed(t,OS),G0=t=>ed(t,kS,!0),lj=t=>ed(t,zS,!0),kc=(t,e,n)=>{const s=wS.exec(t);return s?s[1]?e(s[1]):n(s[2]):!1},ed=(t,e,n=!1)=>{const s=ES.exec(t);return s?s[1]?e(s[1]):n:!1},RS=t=>t==="position"||t==="percentage",OS=t=>t==="image"||t==="url",MS=t=>t==="length"||t==="size"||t==="bg-size",AS=t=>t==="length",oj=t=>t==="number",DS=t=>t==="family-name",zS=t=>t==="number"||t==="weight",kS=t=>t==="shadow",cj=()=>{const t=ka("color"),e=ka("font"),n=ka("text"),s=ka("font-weight"),i=ka("tracking"),o=ka("leading"),d=ka("breakpoint"),f=ka("container"),p=ka("spacing"),y=ka("radius"),b=ka("shadow"),v=ka("inset-shadow"),_=ka("text-shadow"),C=ka("drop-shadow"),w=ka("blur"),T=ka("perspective"),R=ka("aspect"),O=ka("ease"),M=ka("animate"),z=()=>["auto","avoid","all","avoid-page","page","left","right","column"],k=()=>["center","top","bottom","left","right","top-left","left-top","top-right","right-top","bottom-right","right-bottom","bottom-left","left-bottom"],P=()=>[...k(),Ge,Be],q=()=>["auto","hidden","clip","visible","scroll"],L=()=>["auto","contain","none"],U=()=>[Ge,Be,p],V=()=>[cc,"full","auto",...U()],F=()=>[uc,"none","subgrid",Ge,Be],re=()=>["auto",{span:["full",uc,Ge,Be]},uc,Ge,Be],ne=()=>[uc,"auto",Ge,Be],J=()=>["auto","min","max","fr",Ge,Be],ie=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...U()],$=()=>[cc,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...U()],ae=()=>[cc,"screen","full","dvw","lvw","svw","min","max","fit",...U()],je=()=>[cc,"screen","full","lh","dvh","lvh","svh","min","max","fit",...U()],he=()=>[t,Ge,Be],G=()=>[...k(),Z2,F2,{position:[Ge,Be]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],fe=()=>["auto","cover","contain",rj,ej,{size:[Ge,Be]}],be=()=>[ex,Qp,Mu],_e=()=>["","none","full",y,Ge,Be],me=()=>["",jt,Qp,Mu],we=()=>["solid","dashed","dotted","double"],nt=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ze=()=>[jt,ex,Z2,F2],Vt=()=>["","none",w,Ge,Be],$e=()=>["none",jt,Ge,Be],Mt=()=>["none",jt,Ge,Be],Ht=()=>[jt,Ge,Be],En=()=>[cc,"full",...U()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[Wl],breakpoint:[Wl],color:[TS],container:[Wl],"drop-shadow":[Wl],ease:["in","out","in-out"],font:[$_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[Wl],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[Wl],shadow:[Wl],spacing:["px",jt],text:[Wl],"text-shadow":[Wl],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cc,Be,Ge,R]}],container:["container"],columns:[{columns:[jt,Be,Ge,f]}],"break-after":[{"break-after":z()}],"break-before":[{"break-before":z()}],"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:P()}],overflow:[{overflow:q()}],"overflow-x":[{"overflow-x":q()}],"overflow-y":[{"overflow-y":q()}],overscroll:[{overscroll:L()}],"overscroll-x":[{"overscroll-x":L()}],"overscroll-y":[{"overscroll-y":L()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:V()}],"inset-x":[{"inset-x":V()}],"inset-y":[{"inset-y":V()}],start:[{"inset-s":V(),start:V()}],end:[{"inset-e":V(),end:V()}],"inset-bs":[{"inset-bs":V()}],"inset-be":[{"inset-be":V()}],top:[{top:V()}],right:[{right:V()}],bottom:[{bottom:V()}],left:[{left:V()}],visibility:["visible","invisible","collapse"],z:[{z:[uc,"auto",Ge,Be]}],basis:[{basis:[cc,"full","auto",f,...U()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[jt,cc,"auto","initial","none",Be]}],grow:[{grow:["",jt,Ge,Be]}],shrink:[{shrink:["",jt,Ge,Be]}],order:[{order:[uc,"first","last","none",Ge,Be]}],"grid-cols":[{"grid-cols":F()}],"col-start-end":[{col:re()}],"col-start":[{"col-start":ne()}],"col-end":[{"col-end":ne()}],"grid-rows":[{"grid-rows":F()}],"row-start-end":[{row:re()}],"row-start":[{"row-start":ne()}],"row-end":[{"row-end":ne()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:U()}],"gap-x":[{"gap-x":U()}],"gap-y":[{"gap-y":U()}],"justify-content":[{justify:[...ie(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...ie()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":ie()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:U()}],px:[{px:U()}],py:[{py:U()}],ps:[{ps:U()}],pe:[{pe:U()}],pbs:[{pbs:U()}],pbe:[{pbe:U()}],pt:[{pt:U()}],pr:[{pr:U()}],pb:[{pb:U()}],pl:[{pl:U()}],m:[{m:Y()}],mx:[{mx:Y()}],my:[{my:Y()}],ms:[{ms:Y()}],me:[{me:Y()}],mbs:[{mbs:Y()}],mbe:[{mbe:Y()}],mt:[{mt:Y()}],mr:[{mr:Y()}],mb:[{mb:Y()}],ml:[{ml:Y()}],"space-x":[{"space-x":U()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":U()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...ae()]}],"min-inline-size":[{"min-inline":["auto",...ae()]}],"max-inline-size":[{"max-inline":["none",...ae()]}],"block-size":[{block:["auto",...je()]}],"min-block-size":[{"min-block":["auto",...je()]}],"max-block-size":[{"max-block":["none",...je()]}],w:[{w:[f,"screen",...$()]}],"min-w":[{"min-w":[f,"screen","none",...$()]}],"max-w":[{"max-w":[f,"screen","none","prose",{screen:[d]},...$()]}],h:[{h:["screen","lh",...$()]}],"min-h":[{"min-h":["screen","lh","none",...$()]}],"max-h":[{"max-h":["screen","lh",...$()]}],"font-size":[{text:["base",n,Qp,Mu]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,lj,tj]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",ex,Be]}],"font-family":[{font:[sj,nj,e]}],"font-features":[{"font-features":[Be]}],"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:[i,Ge,Be]}],"line-clamp":[{"line-clamp":[jt,"none",Ge,X2]}],leading:[{leading:[o,...U()]}],"list-image":[{"list-image":["none",Ge,Be]}],"list-style-position":[{list:["inside","outside"]}],"list-style-type":[{list:["disc","decimal","none",Ge,Be]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"placeholder-color":[{placeholder:he()}],"text-color":[{text:he()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...we(),"wavy"]}],"text-decoration-thickness":[{decoration:[jt,"from-font","auto",Ge,Mu]}],"text-decoration-color":[{decoration:he()}],"underline-offset":[{"underline-offset":[jt,"auto",Ge,Be]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:U()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ge,Be]}],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",Ge,Be]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:G()}],"bg-repeat":[{bg:W()}],"bg-size":[{bg:fe()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},uc,Ge,Be],radial:["",Ge,Be],conic:[uc,Ge,Be]},ij,aj]}],"bg-color":[{bg:he()}],"gradient-from-pos":[{from:be()}],"gradient-via-pos":[{via:be()}],"gradient-to-pos":[{to:be()}],"gradient-from":[{from:he()}],"gradient-via":[{via:he()}],"gradient-to":[{to:he()}],rounded:[{rounded:_e()}],"rounded-s":[{"rounded-s":_e()}],"rounded-e":[{"rounded-e":_e()}],"rounded-t":[{"rounded-t":_e()}],"rounded-r":[{"rounded-r":_e()}],"rounded-b":[{"rounded-b":_e()}],"rounded-l":[{"rounded-l":_e()}],"rounded-ss":[{"rounded-ss":_e()}],"rounded-se":[{"rounded-se":_e()}],"rounded-ee":[{"rounded-ee":_e()}],"rounded-es":[{"rounded-es":_e()}],"rounded-tl":[{"rounded-tl":_e()}],"rounded-tr":[{"rounded-tr":_e()}],"rounded-br":[{"rounded-br":_e()}],"rounded-bl":[{"rounded-bl":_e()}],"border-w":[{border:me()}],"border-w-x":[{"border-x":me()}],"border-w-y":[{"border-y":me()}],"border-w-s":[{"border-s":me()}],"border-w-e":[{"border-e":me()}],"border-w-bs":[{"border-bs":me()}],"border-w-be":[{"border-be":me()}],"border-w-t":[{"border-t":me()}],"border-w-r":[{"border-r":me()}],"border-w-b":[{"border-b":me()}],"border-w-l":[{"border-l":me()}],"divide-x":[{"divide-x":me()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":me()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...we(),"hidden","none"]}],"divide-style":[{divide:[...we(),"hidden","none"]}],"border-color":[{border:he()}],"border-color-x":[{"border-x":he()}],"border-color-y":[{"border-y":he()}],"border-color-s":[{"border-s":he()}],"border-color-e":[{"border-e":he()}],"border-color-bs":[{"border-bs":he()}],"border-color-be":[{"border-be":he()}],"border-color-t":[{"border-t":he()}],"border-color-r":[{"border-r":he()}],"border-color-b":[{"border-b":he()}],"border-color-l":[{"border-l":he()}],"divide-color":[{divide:he()}],"outline-style":[{outline:[...we(),"none","hidden"]}],"outline-offset":[{"outline-offset":[jt,Ge,Be]}],"outline-w":[{outline:["",jt,Qp,Mu]}],"outline-color":[{outline:he()}],shadow:[{shadow:["","none",b,G0,B0]}],"shadow-color":[{shadow:he()}],"inset-shadow":[{"inset-shadow":["none",v,G0,B0]}],"inset-shadow-color":[{"inset-shadow":he()}],"ring-w":[{ring:me()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:he()}],"ring-offset-w":[{"ring-offset":[jt,Mu]}],"ring-offset-color":[{"ring-offset":he()}],"inset-ring-w":[{"inset-ring":me()}],"inset-ring-color":[{"inset-ring":he()}],"text-shadow":[{"text-shadow":["none",_,G0,B0]}],"text-shadow-color":[{"text-shadow":he()}],opacity:[{opacity:[jt,Ge,Be]}],"mix-blend":[{"mix-blend":[...nt(),"plus-darker","plus-lighter"]}],"bg-blend":[{"bg-blend":nt()}],"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":[jt]}],"mask-image-linear-from-pos":[{"mask-linear-from":ze()}],"mask-image-linear-to-pos":[{"mask-linear-to":ze()}],"mask-image-linear-from-color":[{"mask-linear-from":he()}],"mask-image-linear-to-color":[{"mask-linear-to":he()}],"mask-image-t-from-pos":[{"mask-t-from":ze()}],"mask-image-t-to-pos":[{"mask-t-to":ze()}],"mask-image-t-from-color":[{"mask-t-from":he()}],"mask-image-t-to-color":[{"mask-t-to":he()}],"mask-image-r-from-pos":[{"mask-r-from":ze()}],"mask-image-r-to-pos":[{"mask-r-to":ze()}],"mask-image-r-from-color":[{"mask-r-from":he()}],"mask-image-r-to-color":[{"mask-r-to":he()}],"mask-image-b-from-pos":[{"mask-b-from":ze()}],"mask-image-b-to-pos":[{"mask-b-to":ze()}],"mask-image-b-from-color":[{"mask-b-from":he()}],"mask-image-b-to-color":[{"mask-b-to":he()}],"mask-image-l-from-pos":[{"mask-l-from":ze()}],"mask-image-l-to-pos":[{"mask-l-to":ze()}],"mask-image-l-from-color":[{"mask-l-from":he()}],"mask-image-l-to-color":[{"mask-l-to":he()}],"mask-image-x-from-pos":[{"mask-x-from":ze()}],"mask-image-x-to-pos":[{"mask-x-to":ze()}],"mask-image-x-from-color":[{"mask-x-from":he()}],"mask-image-x-to-color":[{"mask-x-to":he()}],"mask-image-y-from-pos":[{"mask-y-from":ze()}],"mask-image-y-to-pos":[{"mask-y-to":ze()}],"mask-image-y-from-color":[{"mask-y-from":he()}],"mask-image-y-to-color":[{"mask-y-to":he()}],"mask-image-radial":[{"mask-radial":[Ge,Be]}],"mask-image-radial-from-pos":[{"mask-radial-from":ze()}],"mask-image-radial-to-pos":[{"mask-radial-to":ze()}],"mask-image-radial-from-color":[{"mask-radial-from":he()}],"mask-image-radial-to-color":[{"mask-radial-to":he()}],"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":k()}],"mask-image-conic-pos":[{"mask-conic":[jt]}],"mask-image-conic-from-pos":[{"mask-conic-from":ze()}],"mask-image-conic-to-pos":[{"mask-conic-to":ze()}],"mask-image-conic-from-color":[{"mask-conic-from":he()}],"mask-image-conic-to-color":[{"mask-conic-to":he()}],"mask-mode":[{mask:["alpha","luminance","match"]}],"mask-origin":[{"mask-origin":["border","padding","content","fill","stroke","view"]}],"mask-position":[{mask:G()}],"mask-repeat":[{mask:W()}],"mask-size":[{mask:fe()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Be]}],filter:[{filter:["","none",Ge,Be]}],blur:[{blur:Vt()}],brightness:[{brightness:[jt,Ge,Be]}],contrast:[{contrast:[jt,Ge,Be]}],"drop-shadow":[{"drop-shadow":["","none",C,G0,B0]}],"drop-shadow-color":[{"drop-shadow":he()}],grayscale:[{grayscale:["",jt,Ge,Be]}],"hue-rotate":[{"hue-rotate":[jt,Ge,Be]}],invert:[{invert:["",jt,Ge,Be]}],saturate:[{saturate:[jt,Ge,Be]}],sepia:[{sepia:["",jt,Ge,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Be]}],"backdrop-blur":[{"backdrop-blur":Vt()}],"backdrop-brightness":[{"backdrop-brightness":[jt,Ge,Be]}],"backdrop-contrast":[{"backdrop-contrast":[jt,Ge,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",jt,Ge,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[jt,Ge,Be]}],"backdrop-invert":[{"backdrop-invert":["",jt,Ge,Be]}],"backdrop-opacity":[{"backdrop-opacity":[jt,Ge,Be]}],"backdrop-saturate":[{"backdrop-saturate":[jt,Ge,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",jt,Ge,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":U()}],"border-spacing-x":[{"border-spacing-x":U()}],"border-spacing-y":[{"border-spacing-y":U()}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["","all","colors","opacity","shadow","transform","none",Ge,Be]}],"transition-behavior":[{transition:["normal","discrete"]}],duration:[{duration:[jt,"initial",Ge,Be]}],ease:[{ease:["linear","initial",O,Ge,Be]}],delay:[{delay:[jt,Ge,Be]}],animate:[{animate:["none",M,Ge,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[T,Ge,Be]}],"perspective-origin":[{"perspective-origin":P()}],rotate:[{rotate:$e()}],"rotate-x":[{"rotate-x":$e()}],"rotate-y":[{"rotate-y":$e()}],"rotate-z":[{"rotate-z":$e()}],scale:[{scale:Mt()}],"scale-x":[{"scale-x":Mt()}],"scale-y":[{"scale-y":Mt()}],"scale-z":[{"scale-z":Mt()}],"scale-3d":["scale-3d"],skew:[{skew:Ht()}],"skew-x":[{"skew-x":Ht()}],"skew-y":[{"skew-y":Ht()}],transform:[{transform:[Ge,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:En()}],"translate-x":[{"translate-x":En()}],"translate-y":[{"translate-y":En()}],"translate-z":[{"translate-z":En()}],"translate-none":["translate-none"],accent:[{accent:he()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:he()}],"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",Ge,Be]}],"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":U()}],"scroll-mx":[{"scroll-mx":U()}],"scroll-my":[{"scroll-my":U()}],"scroll-ms":[{"scroll-ms":U()}],"scroll-me":[{"scroll-me":U()}],"scroll-mbs":[{"scroll-mbs":U()}],"scroll-mbe":[{"scroll-mbe":U()}],"scroll-mt":[{"scroll-mt":U()}],"scroll-mr":[{"scroll-mr":U()}],"scroll-mb":[{"scroll-mb":U()}],"scroll-ml":[{"scroll-ml":U()}],"scroll-p":[{"scroll-p":U()}],"scroll-px":[{"scroll-px":U()}],"scroll-py":[{"scroll-py":U()}],"scroll-ps":[{"scroll-ps":U()}],"scroll-pe":[{"scroll-pe":U()}],"scroll-pbs":[{"scroll-pbs":U()}],"scroll-pbe":[{"scroll-pbe":U()}],"scroll-pt":[{"scroll-pt":U()}],"scroll-pr":[{"scroll-pr":U()}],"scroll-pb":[{"scroll-pb":U()}],"scroll-pl":[{"scroll-pl":U()}],"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",Ge,Be]}],fill:[{fill:["none",...he()]}],"stroke-w":[{stroke:[jt,Qp,Mu,X2]}],stroke:[{stroke:["none",...he()]}],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","inset-bs","inset-be","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","pbs","pbe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mbs","mbe","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-bs","border-w-be","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-bs","border-color-be","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-mbs","scroll-mbe","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-pbs","scroll-pbe","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"]}},uj=P_(cj);function Qn(...t){return uj(V1(t))}/**
|
|
61
|
-
* @license lucide-react v0.576.0 - ISC
|
|
62
|
-
*
|
|
63
|
-
* This source code is licensed under the ISC license.
|
|
64
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
65
|
-
*/const LS=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim();/**
|
|
66
|
-
* @license lucide-react v0.576.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const dj=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
71
|
-
* @license lucide-react v0.576.0 - ISC
|
|
72
|
-
*
|
|
73
|
-
* This source code is licensed under the ISC license.
|
|
74
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
75
|
-
*/const fj=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase());/**
|
|
76
|
-
* @license lucide-react v0.576.0 - ISC
|
|
77
|
-
*
|
|
78
|
-
* This source code is licensed under the ISC license.
|
|
79
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
80
|
-
*/const I2=t=>{const e=fj(t);return e.charAt(0).toUpperCase()+e.slice(1)};/**
|
|
81
|
-
* @license lucide-react v0.576.0 - ISC
|
|
82
|
-
*
|
|
83
|
-
* This source code is licensed under the ISC license.
|
|
84
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
85
|
-
*/var hj={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"};/**
|
|
86
|
-
* @license lucide-react v0.576.0 - ISC
|
|
87
|
-
*
|
|
88
|
-
* This source code is licensed under the ISC license.
|
|
89
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
90
|
-
*/const pj=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0;return!1};/**
|
|
91
|
-
* @license lucide-react v0.576.0 - ISC
|
|
92
|
-
*
|
|
93
|
-
* This source code is licensed under the ISC license.
|
|
94
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
95
|
-
*/const mj=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},p)=>D.createElement("svg",{ref:p,...hj,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:LS("lucide",i),...!o&&!pj(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,b])=>D.createElement(y,b)),...Array.isArray(o)?o:[o]]));/**
|
|
96
|
-
* @license lucide-react v0.576.0 - ISC
|
|
97
|
-
*
|
|
98
|
-
* This source code is licensed under the ISC license.
|
|
99
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
100
|
-
*/const td=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(mj,{ref:o,iconNode:e,className:LS(`lucide-${dj(I2(t))}`,`lucide-${t}`,s),...i}));return n.displayName=I2(t),n};/**
|
|
101
|
-
* @license lucide-react v0.576.0 - ISC
|
|
102
|
-
*
|
|
103
|
-
* This source code is licensed under the ISC license.
|
|
104
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
105
|
-
*/const gj=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],US=td("chevron-down",gj);/**
|
|
106
|
-
* @license lucide-react v0.576.0 - ISC
|
|
107
|
-
*
|
|
108
|
-
* This source code is licensed under the ISC license.
|
|
109
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
110
|
-
*/const yj=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],xj=td("chevron-right",yj);/**
|
|
111
|
-
* @license lucide-react v0.576.0 - ISC
|
|
112
|
-
*
|
|
113
|
-
* This source code is licensed under the ISC license.
|
|
114
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
115
|
-
*/const bj=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],vj=td("circle-plus",bj);/**
|
|
116
|
-
* @license lucide-react v0.576.0 - ISC
|
|
117
|
-
*
|
|
118
|
-
* This source code is licensed under the ISC license.
|
|
119
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
120
|
-
*/const Sj=[["line",{x1:"15",x2:"15",y1:"12",y2:"18",key:"1p7wdc"}],["line",{x1:"12",x2:"18",y1:"15",y2:"15",key:"1nscbv"}],["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"}]],Nj=td("copy-plus",Sj);/**
|
|
121
|
-
* @license lucide-react v0.576.0 - ISC
|
|
122
|
-
*
|
|
123
|
-
* This source code is licensed under the ISC license.
|
|
124
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
125
|
-
*/const _j=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],jj=td("save",_j);/**
|
|
126
|
-
* @license lucide-react v0.576.0 - ISC
|
|
127
|
-
*
|
|
128
|
-
* This source code is licensed under the ISC license.
|
|
129
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
130
|
-
*/const Cj=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],wj=td("trash-2",Cj);/**
|
|
131
|
-
* @license lucide-react v0.576.0 - ISC
|
|
132
|
-
*
|
|
133
|
-
* This source code is licensed under the ISC license.
|
|
134
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
135
|
-
*/const Ej=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Tj=td("x",Ej),J2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W2=V1,nd=(t,e)=>n=>{var s;if((e==null?void 0:e.variants)==null)return W2(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:i,defaultVariants:o}=e,d=Object.keys(i).map(y=>{const b=n==null?void 0:n[y],v=o==null?void 0:o[y];if(b===null)return null;const _=J2(b)||J2(v);return i[y][_]}),f=n&&Object.entries(n).reduce((y,b)=>{let[v,_]=b;return _===void 0||(y[v]=_),y},{}),p=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((y,b)=>{let{class:v,className:_,...C}=b;return Object.entries(C).every(w=>{let[T,R]=w;return Array.isArray(R)?R.includes({...o,...f}[T]):{...o,...f}[T]===R})?[...y,v,_]:y},[]);return W2(t,d,p,n==null?void 0:n.class,n==null?void 0:n.className)},Rj=nd("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 px-2.5 text-xs gap-1.5",md:"h-8 px-3 text-sm gap-2",lg:"h-9 px-4 text-sm gap-2"}},defaultVariants:{variant:"primary",size:"sm"}}),Oj=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:Qn(Rj({variant:e,size:n}),t),...s}));Oj.displayName="Button";const Mj=nd("inline-flex items-center justify-center rounded-md font-medium transition-colors disabled:opacity-50 disabled:pointer-events-none",{variants:{variant:{primary:"bg-primary text-primary-foreground hover:bg-primary/90",secondary:"bg-surface text-foreground hover:bg-surface-hover",ghost:"hover:bg-surface-hover text-foreground-muted",danger:"bg-danger text-white hover:bg-danger/90",outline:"border border-border bg-transparent hover:bg-surface-hover"},size:{sm:"h-7 w-7",md:"h-8 w-8",lg:"h-9 w-9"}},defaultVariants:{variant:"primary",size:"sm"}}),Aj=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:Qn(Mj({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));Aj.displayName="IconButton";const Dj=nd("inline-flex items-center rounded-full text-xs font-medium px-2 py-0.5",{variants:{variant:{default:"bg-surface-hover text-foreground",success:"bg-success/15 text-success",warning:"bg-warning/15 text-warning",danger:"bg-danger/15 text-danger",info:"bg-info/15 text-info"},styleVariant:{solid:"",outline:"border bg-transparent"}},defaultVariants:{variant:"default",styleVariant:"solid"}}),zj=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:Qn(Dj({variant:e,styleVariant:n}),t),...s}));zj.displayName="Badge";const kj=nd("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),Lj=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:Qn(kj({variant:e}),t),...n}));Lj.displayName="Card";const Uj=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:Qn("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));Uj.displayName="Label";const qj=nd("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),Hj=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:Qn(qj({orientation:e}),t),...n}));Hj.displayName="Separator";const Bj=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:Qn("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));Bj.displayName="Skeleton";const $2=nd("h-7 w-full px-2.5 text-xs bg-surface border rounded-md text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary transition-colors",{variants:{state:{default:"border-border",error:"border-danger"}},defaultVariants:{state:"default"}}),Gj=D.forwardRef(({className:t,state:e,leftSlot:n,rightSlot:s,...i},o)=>n||s?h.jsxs("div",{className:"relative flex items-center w-full",children:[n&&h.jsx("div",{className:"absolute left-2.5 flex items-center pointer-events-none",children:n}),h.jsx("input",{ref:o,className:Qn($2({state:e}),n?"pl-7":"",s?"pr-7":"",t),...i}),s&&h.jsx("div",{className:"absolute right-2.5 flex items-center pointer-events-none",children:s})]}):h.jsx("input",{ref:o,className:Qn($2({state:e}),t),...i}));Gj.displayName="Input";const Pj=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:Qn("h-7 w-full px-2.5 text-xs bg-surface border border-border rounded-md text-foreground appearance-none pr-7 focus:outline-none focus:ring-1 focus:ring-primary",t),...n,children:e.map(i=>h.jsx("option",{value:i.value,children:i.label},i.value))}),h.jsx("div",{className:"absolute right-2 top-1/2 -translate-y-1/2 pointer-events-none text-foreground-muted",children:h.jsx(US,{className:"h-3.5 w-3.5"})})]}));Pj.displayName="Select";const Yj=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:Qn("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));Yj.displayName="Checkbox";const Vj=D.forwardRef(({className:t,checked:e,onCheckedChange:n,label:s,...i},o)=>h.jsxs("button",{ref:o,role:"switch","aria-checked":e,type:"button",onClick:()=>n(!e),className:Qn("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:Qn("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:Qn("block w-3.5 h-3.5 rounded-full bg-white transition-transform",e?"translate-x-4":"translate-x-0.5")})}),s&&h.jsx("span",{className:"text-xs text-foreground",children:s})]}));Vj.displayName="Switch";const Qj=D.createContext(null);function Kj(){const t=D.useContext(Qj);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}const Xj=nd("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm max-w-[calc(100vw-2rem)] max-h-[calc(100dvh-2rem)] overflow-y-auto",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),Fj=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=Kj(),p=D.useRef(null),y=i??p;D.useEffect(()=>{const v=y.current;v&&(o&&!v.open&&v.showModal(),!o&&v.open&&v.close())},[o,y]);const b=v=>{v.target===v.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:Qn(Xj({width:e}),"w-full",t),onClick:b,onClose:()=>d(!1),...s,children:n})});Fj.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);const Zj=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:Qn("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));Zj.displayName="ScrollArea";const qS="(max-width: 767px)";function Ij(t){const e=window.matchMedia(qS);return e.addEventListener("change",t),()=>e.removeEventListener("change",t)}function Jj(){return window.matchMedia(qS).matches}function Wj(){return!1}function $j(){return D.useSyncExternalStore(Ij,Jj,Wj)}function eC({open:t,onClose:e,children:n,className:s,width:i="w-64"}){const o=D.useRef(null);return D.useEffect(()=>{if(!t)return;const d=f=>{f.key==="Escape"&&e()};return document.addEventListener("keydown",d),document.body.style.overflow="hidden",()=>{document.removeEventListener("keydown",d),document.body.style.overflow=""}},[t,e]),h.jsxs(h.Fragment,{children:[h.jsx("div",{className:Qn("fixed inset-0 z-40 bg-black/50 backdrop-blur-sm transition-opacity duration-200",t?"opacity-100":"pointer-events-none opacity-0"),onClick:e,"aria-hidden":"true"}),h.jsx("div",{ref:o,role:"dialog","aria-modal":"true",className:Qn("fixed inset-y-0 left-0 z-50 flex flex-col bg-surface border-r border-border shadow-2xl transition-transform duration-200 ease-out",i,t?"translate-x-0":"-translate-x-full",s),children:n})]})}const tC={"object-detection":"border-l-blue-500","motion-detection":"border-l-amber-500","face-detection":"border-l-purple-500","face-recognition":"border-l-violet-500","plate-detection":"border-l-pink-500","plate-recognition":"border-l-rose-500","animal-classifier":"border-l-lime-500","bird-nabirds-classifier":"border-l-emerald-500","bird-global-classifier":"border-l-teal-500","audio-classification":"border-l-green-500","segmentation-refiner":"border-l-cyan-500"},nC={detector:"border-l-blue-500",cropper:"border-l-purple-500",classifier:"border-l-lime-500",refiner:"border-l-cyan-500"};function aC(t,e){return tC[t]??nC[e]??"border-l-primary"}const sC={cpu:"onnx",coreml:"coreml",openvino:"openvino",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt"};function rC(t,e,n){const s=t==="node"?e.runtimes.node.backends:e.runtimes.python.backends;if(!n)return s;const i=new Set;for(const o of n.models)for(const d of Object.keys(o.formats))i.add(d);return t==="node"&&i.add("onnx"),s.map(o=>{const d=sC[o.id]??"onnx",f=i.has(d);return{...o,available:o.available&&f}})}function iC(t,e,n,s){var o;if(!t)return[];const i=e==="node"?"onnx":((o=s.runtimes.python.backends.find(d=>d.id===n))==null?void 0:o.modelFormat)??"onnx";return t.models.filter(d=>d.formats[i]).map(d=>{var f;return{id:d.id,name:d.name,downloaded:((f=d.formats[i])==null?void 0:f.downloaded)??!1}})}function lC(t){const e=[{id:"node",label:"Node.js (ONNX)",available:!0}];return t.runtimes.python.available&&t.runtimes.python.backends.some(n=>n.available)&&e.unshift({id:"python",label:"Python",available:!0}),e}function tx({step:t,schema:e,allSchemas:n,capabilities:s,depth:i=0,onChange:o,onDelete:d,readOnly:f=!1}){var R;const[p,y]=D.useState(!1),b=aC(t.addonId,t.slot),v=rC(t.runtime,s,e),_=lC(s);if(!(((R=v.find(O=>O.id===t.backend))==null?void 0:R.available)??!1)&&!f){const O=v.find(M=>M.available);O&&O.id!==t.backend&&queueMicrotask(()=>o({...t,backend:O.id}))}const w=iC(e,t.runtime,t.backend,s);if(w.length>0&&!w.some(O=>O.id===t.modelId)&&!f){const M=(e!=null&&e.defaultModelId?w.find(z=>z.id===e.defaultModelId):null)??w[0];M&&M.id!==t.modelId&&queueMicrotask(()=>o({...t,modelId:M.id}))}function T(O){O.target.closest(".step-config")||y(M=>!M)}return h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:Qn("rounded-xl border border-border bg-surface overflow-hidden border-l-4 shadow-sm",b,!t.enabled&&"opacity-[0.45]"),children:[h.jsxs("div",{className:"flex items-center gap-2.5 px-3 py-2.5 cursor-pointer select-none",onClick:T,children:[h.jsx("span",{className:"text-foreground-subtle",children:p?h.jsx(US,{className:"h-4 w-4"}):h.jsx(xj,{className:"h-4 w-4"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wider font-medium text-foreground-subtle/60 block leading-none",children:t.slot}),h.jsx("span",{className:"text-sm font-semibold text-foreground truncate block leading-tight",children:t.addonName}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(O=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/12 text-blue-400",children:O},O)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),t.outputClasses.map(O=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/12 text-green-400",children:O},O))]})]}),h.jsx("button",{onClick:O=>{O.stopPropagation(),o({...t,enabled:!t.enabled})},className:Qn("relative inline-flex h-6 w-11 shrink-0 items-center rounded-full transition-colors",t.enabled?"bg-success":"bg-foreground-subtle/30"),children:h.jsx("span",{className:Qn("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",t.enabled?"translate-x-6":"translate-x-1")})})]}),p&&h.jsxs("div",{className:"step-config border-t border-border bg-background px-4 py-4 space-y-3",children:[h.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[h.jsx(P0,{label:"Agent",value:t.agentId,disabled:f,options:[{value:t.agentId||"hub",label:t.agentId||"Hub (local)"}],onChange:O=>o({...t,agentId:O})}),h.jsx(P0,{label:"Runtime",value:t.runtime,disabled:f,options:_.map(O=>({value:O.id,label:O.label,disabled:!O.available})),onChange:O=>o({...t,runtime:O})}),h.jsx(P0,{label:"Backend",value:t.backend,disabled:f,options:v.map(O=>({value:O.id,label:O.label,disabled:!O.available})),onChange:O=>o({...t,backend:O})}),h.jsx(P0,{label:"Model",value:t.modelId,disabled:f,options:w.map(O=>({value:O.id,label:`${O.name}${O.downloaded?" ✓":""}`})),onChange:O=>o({...t,modelId:O})})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("span",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide",children:"Confidence"}),h.jsxs("span",{className:"text-xs font-medium text-foreground tabular-nums",children:[(t.confidence*100).toFixed(0),"%"]})]}),h.jsx("input",{type:"range",min:0,max:1,step:.01,value:t.confidence,disabled:f,onChange:O=>o({...t,confidence:Number(O.target.value)}),className:"w-full accent-primary h-1.5"})]})]})]})})}function P0({label:t,value:e,options:n,disabled:s,onChange:i}){return h.jsxs("div",{children:[h.jsx("label",{className:"block text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:t}),h.jsxs("select",{value:e,onChange:o=>i(o.target.value),disabled:s,className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground focus:outline-none focus:border-primary/50",children:[n.length===0&&h.jsx("option",{value:e,children:e||"default"}),n.map(o=>h.jsx("option",{value:o.value,disabled:o.disabled,children:o.label},o.value))]})]})}function oC(t,e){const n=new Set(e.slots.flatMap(d=>d.addons.map(f=>f.id))),s=[];function i(d){if(!n.has(d.addonId))return s.push(`Addon "${d.addonId}" is no longer available — step removed`),null;const f=e.slots.flatMap(b=>b.addons).find(b=>b.id===d.addonId);let p=d.modelId;if(f&&!f.models.some(b=>b.id===p)){const b=f.defaultModelId;s.push(`Model "${p}" not available for ${d.addonId} — using "${b}"`),p=b}const y=d.children.map(b=>i(b)).filter(b=>b!==null);return{...d,modelId:p,children:y}}const o=t.map(d=>i(d)).filter(d=>d!==null);return{valid:s.length===0,steps:o,warnings:s}}function cC(t){const e=new Map;for(const n of t.slots)for(const s of n.addons)e.set(s.id,s);return e}function nx(t,e,n){return{addonId:t.id,addonName:t.name,slot:t.slot,inputClasses:[...t.inputClasses],outputClasses:[...t.outputClasses],enabled:!0,agentId:"hub",runtime:t.defaultRuntime??e??"node",backend:t.defaultBackend??n??"cpu",modelId:t.defaultModelId,confidence:t.defaultConfidence,classFilters:[...t.inputClasses],children:[]}}function ax({addon:t,onClick:e}){return h.jsx("button",{type:"button",onClick:e,className:"w-full rounded-xl border-2 border-dashed border-border/60 px-4 py-3 text-left transition-all hover:border-primary/30 hover:bg-surface/60 group",children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(vj,{className:"h-[18px] w-[18px] text-foreground-subtle/30 group-hover:text-primary/60 shrink-0"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("span",{className:"text-[13px] font-medium text-foreground-subtle/50 group-hover:text-foreground-subtle block truncate",children:t.name}),h.jsxs("div",{className:"flex items-center gap-1 mt-0.5 flex-wrap",children:[t.inputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-blue-500/8 text-blue-400/50",children:n},n)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/25 text-[10px]",children:"→"}),t.outputClasses.map(n=>h.jsx("span",{className:"text-[9px] uppercase font-semibold tracking-wide px-1.5 py-0.5 rounded bg-green-500/8 text-green-400/50",children:n},n))]})]})]})})}function uC({schema:t,capabilities:e,steps:n,onChange:s,templates:i,selectedTemplateId:o,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:p,onDeleteTemplate:y,readOnly:b=!1,excludeAddons:v=[]}){var $,ae,je,he;const _=D.useMemo(()=>new Set(v),[v]),C=D.useMemo(()=>cC(t),[t]),[w,T]=D.useState([]),R=($=e.platformScores)==null?void 0:$.find(G=>G.available),O=e.runtimes.python.available&&e.runtimes.python.backends.some(G=>G.available),M=(R==null?void 0:R.runtime)??(O?"python":"node"),z=(R==null?void 0:R.backend)??(O?((ae=e.runtimes.python.backends.find(G=>G.available))==null?void 0:ae.id)??"cpu":((je=e.runtimes.node.backends.find(G=>G.available&&G.id!=="cpu"))==null?void 0:je.id)??"cpu"),k=o?JSON.stringify(n)!==JSON.stringify((he=i.find(G=>G.id===o))==null?void 0:he.steps):!1;function P(G){const W=G.target.value||null;if(W){const fe=i.find(be=>be.id===W);if(fe){const be=oC(fe.steps,t);T([...be.warnings])}}else T([]);d(W)}function q(){o&&p(o,n)}function L(){const G=window.prompt("Template name:");G!=null&&G.trim()&&f(G.trim(),n)}function U(){if(!o)return;const G=i.find(W=>W.id===o);G&&window.confirm(`Delete template "${G.name}"?`)&&y(o)}function V(G){s(n.map(W=>W.addonId!==G.addonId?W:F(G)))}function F(G){const W=G.children.some(fe=>fe.enabled||fe.children.some(be=>be.enabled));return{...G,enabled:G.enabled||W,children:G.children.map(fe=>{const be=fe.children.some(_e=>_e.enabled);return{...fe,enabled:fe.enabled||be}})}}function re(G,W){const fe=nx(W,M,z);s(n.map(be=>be.addonId!==G?be:{...be,children:[...be.children,fe]}))}function ne(G){const W=new Set;for(const fe of G){W.add(fe.addonId);for(const _e of fe.children)W.add(_e.addonId);const be=ne(fe.children);for(const _e of be)W.add(_e)}return W}const J=ne(n);function ie(G){const W=C.get(G.addonId);if(!W)return[];const fe=W.childSlots,be=new Set(G.children.map(me=>me.addonId)),_e=[];for(const me of t.slots)if(fe.includes(me.id))for(const we of me.addons){if(be.has(we.id)||_.has(we.id))continue;we.inputClasses.some(ze=>G.outputClasses.includes(ze))&&_e.push(we)}return _e}function ce(G){const W=ie(G);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(tx,{step:G,schema:C.get(G.addonId)??null,allSchemas:C,capabilities:e,onChange:V,onDelete:b?void 0:fe=>s(n.filter(be=>be.addonId!==fe)),readOnly:b}),(G.children.length>0||W.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/40 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/40",children:"Slot: Cropper / Classifier"}),G.children.map(fe=>{const be=ie(fe);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(tx,{step:fe,schema:C.get(fe.addonId)??null,allSchemas:C,capabilities:e,depth:1,onChange:_e=>{V({...G,children:G.children.map(me=>me.addonId===_e.addonId?_e:me)})},onDelete:b?void 0:_e=>{V({...G,children:G.children.filter(me=>me.addonId!==_e)})},readOnly:b}),(fe.children.length>0||be.length>0)&&h.jsxs("div",{className:"ml-6 pl-4 border-l-2 border-dashed border-border/30 space-y-1.5",children:[h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/30",children:"Slot: Recognizer"}),fe.children.map(_e=>h.jsx(tx,{step:_e,schema:C.get(_e.addonId)??null,allSchemas:C,capabilities:e,depth:2,onChange:me=>{V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:we.children.map(nt=>nt.addonId===me.addonId?me:nt)}:we)})},onDelete:b?void 0:me=>{V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:we.children.filter(nt=>nt.addonId!==me)}:we)})},readOnly:b},_e.addonId)),!b&&be.map(_e=>h.jsx(ax,{addon:_e,onClick:()=>{const me=nx(_e,M,z);V({...G,children:G.children.map(we=>we.addonId===fe.addonId?{...we,children:[...we.children,me]}:we)})}},_e.id))]})]},fe.addonId)}),!b&&W.map(fe=>h.jsx(ax,{addon:fe,onClick:()=>re(G.addonId,fe)},fe.id))]})]},G.addonId)}const Y=t.slots.filter(G=>G.parentSlot===null).sort((G,W)=>G.priority-W.priority);return h.jsxs("div",{className:"space-y-4",children:[h.jsx("div",{className:"rounded-xl border border-border bg-surface p-3",children:h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:"relative flex-1 min-w-0",children:h.jsxs("select",{value:o??"",onChange:P,className:"w-full rounded-lg border border-border bg-background px-3 py-2 text-sm text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"",children:"No template"}),i.map(G=>h.jsx("option",{value:G.id,children:G.name},G.id))]})}),k&&h.jsx("span",{className:"h-1.5 w-1.5 rounded-full bg-amber-500 shrink-0"}),h.jsx("button",{onClick:q,disabled:!o||b,title:"Save",className:Qn("p-2 rounded-lg border border-border transition-colors",o&&!b?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(jj,{className:"h-4 w-4"})}),h.jsx("button",{onClick:L,disabled:b,title:"Save As",className:Qn("p-2 rounded-lg border border-border transition-colors",b?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:h.jsx(Nj,{className:"h-4 w-4"})}),h.jsx("button",{onClick:U,disabled:!o||b,title:"Delete",className:Qn("p-2 rounded-lg border border-border transition-colors",o&&!b?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(wj,{className:"h-4 w-4"})})]})}),w.length>0&&h.jsxs("div",{className:"rounded-lg border border-amber-500/30 bg-amber-500/5 p-3 text-xs text-amber-400 space-y-1",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"font-medium",children:"Template loaded with warnings:"}),h.jsx("button",{onClick:()=>T([]),className:"text-amber-400/60 hover:text-amber-400",children:h.jsx(Tj,{className:"h-3.5 w-3.5"})})]}),w.map((G,W)=>h.jsxs("div",{children:["• ",G]},W))]}),Y.map(G=>{const W=n.filter(be=>be.slot===G.id&&!_.has(be.addonId)),fe=G.addons.filter(be=>!J.has(be.id)&&!_.has(be.id));return h.jsxs("div",{className:"space-y-2",children:[h.jsxs("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/50",children:["Slot: ",G.label]}),W.map(be=>ce(be)),!b&&fe.map(be=>h.jsx(ax,{addon:be,onClick:()=>{s([...n,nx(be,M,z)])}},be.id))]},G.id)})]})}var dC=Object.create,HS=Object.defineProperty,fC=Object.getOwnPropertyDescriptor,BS=Object.getOwnPropertyNames,hC=Object.getPrototypeOf,pC=Object.prototype.hasOwnProperty,yl=(t,e)=>function(){return e||(0,t[BS(t)[0]])((e={exports:{}}).exports,e),e.exports},mC=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=BS(e),o=0,d=i.length,f;o<d;o++)f=i[o],!pC.call(t,f)&&f!==n&&HS(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=fC(e,f))||s.enumerable});return t},ya=(t,e,n)=>(n=t!=null?dC(hC(t)):{},mC(HS(n,"default",{value:t,enumerable:!0}),t)),GS=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),gC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=GS().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),yC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=GS().default,s=gC();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),ad=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=yC();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ti=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=ad();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function xC(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(p){var y;i||(y=n.next)===null||y===void 0||y.call(n,p)},error(p){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,p),f())},complete(){var p;i||(i=!0,(p=n.complete)===null||p===void 0||p.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(bC,e)}};return e}function bC(t,e){return e(t)}function vC(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=xC(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}ya(ad());ya(Ti());ya(Ti());ya(Ti());ya(Ti());ya(Ti());const PS=(t,...e)=>typeof t=="function"?t(...e):t;ya(ad());function SC(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function NC(t){const e=await PS(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function _C(t,e){const n={method:"connectionParams",data:await PS(t)};return e.encode(n)}ya(ad());var pc=ya(ad());function jC(t){const{promise:e,resolve:n,reject:s}=SC();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function CC(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:p})=>{clearTimeout(s),o(),p==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var wC=class ub{constructor(e){var n;if((0,pc.default)(this,"id",++ub.connectCount),(0,pc.default)(this,"WebSocketPonyfill",void 0),(0,pc.default)(this,"urlOptions",void 0),(0,pc.default)(this,"keepAliveOpts",void 0),(0,pc.default)(this,"encoder",void 0),(0,pc.default)(this,"wsObservable",vC(null)),(0,pc.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++ub.connectCount;const n=NC(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&CC(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await jC(s),e.urlOptions.connectionParams&&s.send(await _C(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,pc.default)(wC,"connectCount",0);ya(ad());ya(Ti());ya(ad());ya(Ti());ya(Ti());ya(Ti());var EC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,p=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);p--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(p){return{value:p,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var p=this.s.return;return p===void 0?Promise.resolve({value:f,done:!0}):o(p.apply(this.s,arguments))},throw:function(f){var p=this.s.return;return p===void 0?Promise.reject(f):o(p.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ya(EC());ya(Ti());var TC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,p){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=p,y},i={},o=[];function d(f,p){if(p!=null){if(Object(p)!==p)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=p[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=p[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var b=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");b&&(y=function(){try{b.call(p)}catch(_){return Promise.reject(_)}}),o.push({v:p,d:y,a:f})}else f&&o.push({d:p,a:f});return p}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var p,y=this.e,b=0;function v(){for(;p=o.pop();)try{if(!p.a&&b===1)return b=0,o.push(p),Promise.resolve().then(v);if(p.d){var C=p.d.call(p.v);if(p.a)return b|=2,Promise.resolve(C).then(v,_)}else b|=1}catch(w){return _(w)}if(b===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(C){return y=y!==i?new s(C,y):C,v()}return v()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),YS=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),RC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=YS();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),OC=yl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=YS();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(b,v){try{var _=o[b](v),C=_.value,w=C instanceof n;Promise.resolve(w?C.v:C).then(function(T){if(w){var R=b==="return"?"return":"next";if(!C.k||T.done)return p(R,T);T=o[R](T).value}y(_.done?"return":"normal",T)},function(T){p("throw",T)})}catch(T){y("throw",T)}}function y(b,v){switch(b){case"return":d.resolve({value:v,done:!0});break;case"throw":d.reject(v);break;default:d.resolve({value:v,done:!1})}(d=d.next)?p(d.key,d.arg):f=null}this._invoke=function(b,v){return new Promise(function(_,C){var w={key:b,arg:v,resolve:_,reject:C,next:null};f?f=f.next=w:(d=f=w,p(b,v))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});ya(TC());ya(RC());ya(OC());ya(Ti());class MC{constructor(){this.keyToValue=new Map,this.valueToKey=new Map}set(e,n){this.keyToValue.set(e,n),this.valueToKey.set(n,e)}getByKey(e){return this.keyToValue.get(e)}getByValue(e){return this.valueToKey.get(e)}clear(){this.keyToValue.clear(),this.valueToKey.clear()}}class VS{constructor(e){this.generateIdentifier=e,this.kv=new MC}register(e,n){this.kv.getByValue(e)||(n||(n=this.generateIdentifier(e)),this.kv.set(n,e))}clear(){this.kv.clear()}getIdentifier(e){return this.kv.getByValue(e)}getValue(e){return this.kv.getByKey(e)}}class AC extends VS{constructor(){super(e=>e.name),this.classToAllowedProps=new Map}register(e,n){typeof n=="object"?(n.allowProps&&this.classToAllowedProps.set(e,n.allowProps),super.register(e,n.identifier)):super.register(e,n)}getAllowedProps(e){return this.classToAllowedProps.get(e)}}function DC(t){if("values"in Object)return Object.values(t);const e=[];for(const n in t)t.hasOwnProperty(n)&&e.push(t[n]);return e}function zC(t,e){const n=DC(t);if("find"in n)return n.find(e);const s=n;for(let i=0;i<s.length;i++){const o=s[i];if(e(o))return o}}function $f(t,e){Object.entries(t).forEach(([n,s])=>e(s,n))}function p1(t,e){return t.indexOf(e)!==-1}function e3(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(e(s))return s}}class kC{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return zC(this.transfomers,n=>n.isApplicable(e))}findByName(e){return this.transfomers[e]}}const LC=t=>Object.prototype.toString.call(t).slice(8,-1),QS=t=>typeof t>"u",UC=t=>t===null,wm=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,db=t=>wm(t)&&Object.keys(t).length===0,Dc=t=>Array.isArray(t),qC=t=>typeof t=="string",HC=t=>typeof t=="number"&&!isNaN(t),BC=t=>typeof t=="boolean",GC=t=>t instanceof RegExp,Em=t=>t instanceof Map,Tm=t=>t instanceof Set,KS=t=>LC(t)==="Symbol",PC=t=>t instanceof Date&&!isNaN(t.valueOf()),XS=t=>t instanceof Error,t3=t=>typeof t=="number"&&isNaN(t),YC=t=>BC(t)||UC(t)||QS(t)||HC(t)||qC(t)||KS(t),VC=t=>typeof t=="bigint",QC=t=>t===1/0||t===-1/0,KC=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),XC=t=>t instanceof URL,fb=t=>t.replace(/\\/g,"\\\\").replace(/\./g,"\\."),sx=t=>t.map(String).map(fb).join("."),hm=(t,e)=>{const n=[];let s="";for(let o=0;o<t.length;o++){let d=t.charAt(o);if(!e&&d==="\\"){const y=t.charAt(o+1);if(y==="\\"){s+="\\",o++;continue}else if(y!==".")throw Error("invalid path")}if(d==="\\"&&t.charAt(o+1)==="."){s+=".",o++;continue}if(d==="."){n.push(s),s="";continue}s+=d}const i=s;return n.push(i),n};function il(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const FS=[il(QS,"undefined",()=>null,()=>{}),il(VC,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),il(PC,"Date",t=>t.toISOString(),t=>new Date(t)),il(XS,"Error",(t,e)=>{const n={name:t.name,message:t.message};return"cause"in t&&(n.cause=t.cause),e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n},(t,e)=>{const n=new Error(t.message,{cause:t.cause});return n.name=t.name,n.stack=t.stack,e.allowedErrorProps.forEach(s=>{n[s]=t[s]}),n}),il(GC,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),n=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,n)}),il(Tm,"set",t=>[...t.values()],t=>new Set(t)),il(Em,"map",t=>[...t.entries()],t=>new Map(t)),il(t=>t3(t)||QC(t),"number",t=>t3(t)?"NaN":t>0?"Infinity":"-Infinity",Number),il(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),il(XC,"URL",t=>t.toString(),t=>new URL(t))];function Q1(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const ZS=Q1((t,e)=>KS(t)?!!e.symbolRegistry.getIdentifier(t):!1,(t,e)=>["symbol",e.symbolRegistry.getIdentifier(t)],t=>t.description,(t,e,n)=>{const s=n.symbolRegistry.getValue(e[1]);if(!s)throw new Error("Trying to deserialize unknown symbol");return s}),FC=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),IS=Q1(KC,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const n=FC[e[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(t)});function JS(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const WS=Q1(JS,(t,e)=>["class",e.classRegistry.getIdentifier(t.constructor)],(t,e)=>{const n=e.classRegistry.getAllowedProps(t.constructor);if(!n)return{...t};const s={};return n.forEach(i=>{s[i]=t[i]}),s},(t,e,n)=>{const s=n.classRegistry.getValue(e[1]);if(!s)throw new Error(`Trying to deserialize unknown class '${e[1]}' - check https://github.com/blitz-js/superjson/issues/116#issuecomment-773996564`);return Object.assign(Object.create(s.prototype),t)}),$S=Q1((t,e)=>!!e.customTransformerRegistry.findApplicable(t),(t,e)=>["custom",e.customTransformerRegistry.findApplicable(t).name],(t,e)=>e.customTransformerRegistry.findApplicable(t).serialize(t),(t,e,n)=>{const s=n.customTransformerRegistry.findByName(e[1]);if(!s)throw new Error("Trying to deserialize unknown custom value");return s.deserialize(t)}),ZC=[WS,ZS,$S,IS],n3=(t,e)=>{const n=e3(ZC,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation(t,e)};const s=e3(FS,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation}},e6={};FS.forEach(t=>{e6[t.annotation]=t});const IC=(t,e,n)=>{if(Dc(e))switch(e[0]){case"symbol":return ZS.untransform(t,e,n);case"class":return WS.untransform(t,e,n);case"custom":return $S.untransform(t,e,n);case"typed-array":return IS.untransform(t,e,n);default:throw new Error("Unknown transformation: "+e)}else{const s=e6[e];if(!s)throw new Error("Unknown transformation: "+e);return s.untransform(t,n)}},Of=(t,e)=>{if(e>t.size)throw new Error("index out of bounds");const n=t.keys();for(;e>0;)n.next(),e--;return n.next().value};function t6(t){if(p1(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(p1(t,"prototype"))throw new Error("prototype is not allowed as a property");if(p1(t,"constructor"))throw new Error("constructor is not allowed as a property")}const JC=(t,e)=>{t6(e);for(let n=0;n<e.length;n++){const s=e[n];if(Tm(t))t=Of(t,+s);else if(Em(t)){const i=+s,o=+e[++n]==0?"key":"value",d=Of(t,i);switch(o){case"key":t=d;break;case"value":t=t.get(d);break}}else t=t[s]}return t},hb=(t,e,n)=>{if(t6(e),e.length===0)return n(t);let s=t;for(let o=0;o<e.length-1;o++){const d=e[o];if(Dc(s)){const f=+d;s=s[f]}else if(wm(s))s=s[d];else if(Tm(s)){const f=+d;s=Of(s,f)}else if(Em(s)){if(o===e.length-2)break;const p=+d,y=+e[++o]==0?"key":"value",b=Of(s,p);switch(y){case"key":s=b;break;case"value":s=s.get(b);break}}}const i=e[e.length-1];if(Dc(s)?s[+i]=n(s[+i]):wm(s)&&(s[i]=n(s[i])),Tm(s)){const o=Of(s,+i),d=n(o);o!==d&&(s.delete(o),s.add(d))}if(Em(s)){const o=+e[e.length-2],d=Of(s,o);switch(+i==0?"key":"value"){case"key":{const p=n(d);s.set(p,s.get(d)),p!==d&&s.delete(d);break}case"value":{s.set(d,n(s.get(d)));break}}}return t},n6=t=>t<1;function pb(t,e,n,s=[]){if(!t)return;const i=n6(n);if(!Dc(t)){$f(t,(f,p)=>pb(f,e,n,[...s,...hm(p,i)]));return}const[o,d]=t;d&&$f(d,(f,p)=>{pb(f,e,n,[...s,...hm(p,i)])}),e(o,s)}function WC(t,e,n,s){return pb(e,(i,o)=>{t=hb(t,o,d=>IC(d,i,s))},n),t}function $C(t,e,n){const s=n6(n);function i(o,d){const f=JC(t,hm(d,s));o.map(p=>hm(p,s)).forEach(p=>{t=hb(t,p,()=>f)})}if(Dc(e)){const[o,d]=e;o.forEach(f=>{t=hb(t,hm(f,s),()=>t)}),d&&$f(d,i)}else $f(e,i);return t}const ew=(t,e)=>wm(t)||Dc(t)||Em(t)||Tm(t)||XS(t)||JS(t,e);function tw(t,e,n){const s=n.get(t);s?s.push(e):n.set(t,[e])}function nw(t,e){const n={};let s;return t.forEach(i=>{if(i.length<=1)return;e||(i=i.map(f=>f.map(String)).sort((f,p)=>f.length-p.length));const[o,...d]=i;o.length===0?s=d.map(sx):n[sx(o)]=d.map(sx)}),s?db(n)?[s]:[s,n]:db(n)?void 0:n}const a6=(t,e,n,s,i=[],o=[],d=new Map)=>{const f=YC(t);if(!f){tw(t,i,e);const C=d.get(t);if(C)return s?{transformedValue:null}:C}if(!ew(t,n)){const C=n3(t,n),w=C?{transformedValue:C.value,annotations:[C.type]}:{transformedValue:t};return f||d.set(t,w),w}if(p1(o,t))return{transformedValue:null};const p=n3(t,n),y=(p==null?void 0:p.value)??t,b=Dc(y)?[]:{},v={};$f(y,(C,w)=>{if(w==="__proto__"||w==="constructor"||w==="prototype")throw new Error(`Detected property ${w}. This is a prototype pollution risk, please remove it from your object.`);const T=a6(C,e,n,s,[...i,w],[...o,t],d);b[w]=T.transformedValue,Dc(T.annotations)?v[fb(w)]=T.annotations:wm(T.annotations)&&$f(T.annotations,(R,O)=>{v[fb(w)+"."+O]=R})});const _=db(v)?{transformedValue:b,annotations:p?[p.type]:void 0}:{transformedValue:b,annotations:p?[p.type,v]:v};return f||d.set(t,_),_};function s6(t){return Object.prototype.toString.call(t).slice(8,-1)}function a3(t){return s6(t)==="Array"}function aw(t){if(s6(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function sw(t,e,n,s,i){const o={}.propertyIsEnumerable.call(s,e)?"enumerable":"nonenumerable";o==="enumerable"&&(t[e]=n),i&&o==="nonenumerable"&&Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}function mb(t,e={}){if(a3(t))return t.map(i=>mb(i,e));if(!aw(t))return t;const n=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return[...n,...s].reduce((i,o)=>{if(o==="__proto__"||a3(e.props)&&!e.props.includes(o))return i;const d=t[o],f=mb(d,e);return sw(i,o,f,t,e.nonenumerable),i},{})}class kt{constructor({dedupe:e=!1}={}){this.classRegistry=new AC,this.symbolRegistry=new VS(n=>n.description??""),this.customTransformerRegistry=new kC,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const n=new Map,s=a6(e,n,this,this.dedupe),i={json:s.transformedValue};s.annotations&&(i.meta={...i.meta,values:s.annotations});const o=nw(n,this.dedupe);return o&&(i.meta={...i.meta,referentialEqualities:o}),i.meta&&(i.meta.v=1),i}deserialize(e,n){const{json:s,meta:i}=e;let o=n!=null&&n.inPlace?s:mb(s);return i!=null&&i.values&&(o=WC(o,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(o=$C(o,i.referentialEqualities,i.v??0)),o}stringify(e){return JSON.stringify(this.serialize(e))}parse(e){return this.deserialize(JSON.parse(e),{inPlace:!0})}registerClass(e,n){this.classRegistry.register(e,n)}registerSymbol(e,n){this.symbolRegistry.register(e,n)}registerCustom(e,n){this.customTransformerRegistry.register({name:n,...e})}allowErrorProps(...e){this.allowedErrorProps.push(...e)}}kt.defaultInstance=new kt;kt.serialize=kt.defaultInstance.serialize.bind(kt.defaultInstance);kt.deserialize=kt.defaultInstance.deserialize.bind(kt.defaultInstance);kt.stringify=kt.defaultInstance.stringify.bind(kt.defaultInstance);kt.parse=kt.defaultInstance.parse.bind(kt.defaultInstance);kt.registerClass=kt.defaultInstance.registerClass.bind(kt.defaultInstance);kt.registerSymbol=kt.defaultInstance.registerSymbol.bind(kt.defaultInstance);kt.registerCustom=kt.defaultInstance.registerCustom.bind(kt.defaultInstance);kt.allowErrorProps=kt.defaultInstance.allowErrorProps.bind(kt.defaultInstance);kt.serialize;kt.deserialize;kt.stringify;kt.parse;kt.registerClass;kt.registerCustom;kt.registerSymbol;kt.allowErrorProps;D.createContext(null);var rw=Object.create,r6=Object.defineProperty,iw=Object.getOwnPropertyDescriptor,i6=Object.getOwnPropertyNames,lw=Object.getPrototypeOf,ow=Object.prototype.hasOwnProperty,xl=(t,e)=>function(){return e||(0,t[i6(t)[0]])((e={exports:{}}).exports,e),e.exports},cw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=i6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!ow.call(t,f)&&f!==n&&r6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=iw(e,f))||s.enumerable});return t},xa=(t,e,n)=>(n=t!=null?rw(lw(t)):{},cw(e||!t||!t.__esModule?r6(n,"default",{value:t,enumerable:!0}):n,t)),l6=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),uw=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=l6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),dw=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=l6().default,s=uw();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),sd=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=dw();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Ri=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=sd();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function oh(t){const e={subscribe(n){let s=null,i=!1,o=!1,d=!1;function f(){if(s===null){d=!0;return}o||(o=!0,typeof s=="function"?s():s&&s.unsubscribe())}return s=t({next(p){var y;i||(y=n.next)===null||y===void 0||y.call(n,p)},error(p){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,p),f())},complete(){var p;i||(i=!0,(p=n.complete)===null||p===void 0||p.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(fw,e)}};return e}function fw(t,e){return e(t)}function hw(t){const e=new AbortController;return new Promise((s,i)=>{let o=!1;function d(){o||(o=!0,f.unsubscribe())}e.signal.addEventListener("abort",()=>{i(e.signal.reason)});const f=t.subscribe({next(p){o=!0,s(p),d()},error(p){i(p)},complete(){e.abort(),d()}})})}function pw(t){return e=>{let n=0,s=null;const i=[];function o(){s||(s=e.subscribe({next(f){for(const y of i){var p;(p=y.next)===null||p===void 0||p.call(y,f)}},error(f){for(const y of i){var p;(p=y.error)===null||p===void 0||p.call(y,f)}},complete(){for(const p of i){var f;(f=p.complete)===null||f===void 0||f.call(p)}}}))}function d(){if(n===0&&s){const f=s;s=null,f.unsubscribe()}}return oh(f=>(n++,i.push(f),o(),{unsubscribe(){n--,d();const p=i.findIndex(y=>y===f);p>-1&&i.splice(p,1)}}))}}function o6(t){let e=t;const n=[],s=d=>{e!==void 0&&d.next(e),n.push(d)},i=d=>{n.splice(n.indexOf(d),1)},o=oh(d=>(s(d),()=>{i(d)}));return o.next=d=>{if(e!==d){e=d;for(const f of n)f.next(d)}},o.get=()=>e,o}function mw(t){return oh(e=>{function n(i=0,o=t.op){const d=t.links[i];if(!d)throw new Error("No more links to execute - did you forget to add an ending link?");return d({op:o,next(p){return n(i+1,p)}})}return n().subscribe(e)})}function Rm(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function gw(){return Object.create(null)}const s3=t=>t();function r3(t=0){return new Promise(e=>setTimeout(e,t))}var yw=Object.create,c6=Object.defineProperty,xw=Object.getOwnPropertyDescriptor,u6=Object.getOwnPropertyNames,bw=Object.getPrototypeOf,vw=Object.prototype.hasOwnProperty,Xm=(t,e)=>function(){return e||(0,t[u6(t)[0]])((e={exports:{}}).exports,e),e.exports},Sw=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=u6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!vw.call(t,f)&&f!==n&&c6(t,f,{get:(p=>e[p]).bind(null,f),enumerable:!(s=xw(e,f))||s.enumerable});return t},K1=(t,e,n)=>(n=t!=null?yw(bw(t)):{},Sw(c6(n,"default",{value:t,enumerable:!0}),t));const d6=()=>{},i3=t=>{Object.freeze&&Object.freeze(t)};function f6(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(d6,{get(o,d){if(!(typeof d!="string"||d==="then"))return f6(t,[...e,d],n)},apply(o,d,f){const p=e[e.length-1];let y={args:f,path:e};return p==="call"?y={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:p==="apply"&&(y={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),i3(y.args),i3(y.path),t(y)}})),n[i]}const Nw=t=>f6(t,[],gw()),_w=t=>new Proxy(d6,{get(e,n){if(n!=="then")return t(n)}});var h6=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(t,e){function n(s){"@babel/helpers - typeof";return e.exports=n=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(i){return typeof i}:function(i){return i&&typeof Symbol=="function"&&i.constructor===Symbol&&i!==Symbol.prototype?"symbol":typeof i},e.exports.__esModule=!0,e.exports.default=e.exports,n(s)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),jw=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=h6().default;function s(i,o){if(n(i)!="object"||!i)return i;var d=i[Symbol.toPrimitive];if(d!==void 0){var f=d.call(i,o||"default");if(n(f)!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(i)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Cw=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=h6().default,s=jw();function i(o){var d=s(o,"string");return n(d)=="symbol"?d:d+""}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}}),p6=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=Cw();function s(i,o,d){return(o=n(o))in i?Object.defineProperty(i,o,{value:d,enumerable:!0,configurable:!0,writable:!0}):i[o]=d,i}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),lv=Xm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=p6();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var p=Object.getOwnPropertySymbols(o);d&&(p=p.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,p)}return f}function i(o){for(var d=1;d<arguments.length;d++){var f=arguments[d]!=null?arguments[d]:{};d%2?s(Object(f),!0).forEach(function(p){n(o,p,f[p])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(p){Object.defineProperty(o,p,Object.getOwnPropertyDescriptor(f,p))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});K1(lv());K1(p6());var Y0=K1(lv());function ww(t,e){if("error"in t){const s=e.deserialize(t.error);return{ok:!1,error:(0,Y0.default)((0,Y0.default)({},t),{},{error:s})}}return{ok:!0,result:(0,Y0.default)((0,Y0.default)({},t.result),(!t.result.type||t.result.type==="data")&&{type:"data",data:e.deserialize(t.result.data)})}}var rx=class extends Error{constructor(){super("Unable to transform response from server")}};function m6(t,e){let n;try{n=ww(t,e)}catch{throw new rx}if(!n.ok&&(!Rm(n.error.error)||typeof n.error.error.code!="number"))throw new rx;if(n.ok&&!Rm(n.result))throw new rx;return n}K1(lv());var V0=xa(sd(),1),jf=xa(Ri(),1);function Ew(t){return t instanceof co}function Tw(t){return Rm(t)&&Rm(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function Rw(t,e){return typeof t=="string"?t:Rm(t)&&typeof t.message=="string"?t.message:e}var co=class m1 extends Error{constructor(e,n){var s,i;const o=n==null?void 0:n.cause;super(e,{cause:o}),(0,V0.default)(this,"cause",void 0),(0,V0.default)(this,"shape",void 0),(0,V0.default)(this,"data",void 0),(0,V0.default)(this,"meta",void 0),this.meta=n==null?void 0:n.meta,this.cause=o,this.shape=n==null||(s=n.result)===null||s===void 0?void 0:s.error,this.data=n==null||(i=n.result)===null||i===void 0?void 0:i.error.data,this.name="TRPCClientError",Object.setPrototypeOf(this,m1.prototype)}static from(e,n={}){const s=e;return Ew(s)?(n.meta&&(s.meta=(0,jf.default)((0,jf.default)({},s.meta),n.meta)),s):Tw(s)?new m1(s.error.message,(0,jf.default)((0,jf.default)({},n),{},{result:s,cause:n.cause})):new m1(Rw(s,"Unknown error"),(0,jf.default)((0,jf.default)({},n),{},{cause:s}))}};function g6(t){const e=t;return e?"input"in e?e:{input:e,output:e}:{input:{serialize:n=>n,deserialize:n=>n},output:{serialize:n=>n,deserialize:n=>n}}}const l3=t=>typeof t=="function";function Ow(t){if(t)return t;if(typeof window<"u"&&l3(window.fetch))return window.fetch;if(typeof globalThis<"u"&&l3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var pm=xa(Ri());function Mw(t){return{url:t.url.toString(),fetch:t.fetch,transformer:g6(t.transformer),methodOverride:t.methodOverride}}function Aw(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const Dw={query:"GET",mutation:"POST",subscription:"PATCH"};function y6(t){return"input"in t?t.transformer.input.serialize(t.input):Aw(t.inputs.map(e=>t.transformer.input.serialize(e)))}const gb=t=>{const e=t.url.split("?");let s=e[0].replace(/\/$/,"")+"/"+t.path;const i=[];if(e[1]&&i.push(e[1]),"inputs"in t&&i.push("batch=1"),t.type==="query"||t.type==="subscription"){const o=y6(t);o!==void 0&&t.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(s+="?"+i.join("&")),s},zw=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=y6(t);return e!==void 0?JSON.stringify(e):void 0},kw=t=>yb((0,pm.default)((0,pm.default)({},t),{},{contentTypeHeader:"application/json",getUrl:gb,getBody:zw}));var Lw=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const Uw=t=>{var e;if(t!=null&&t.aborted)throw(e=t.throwIfAborted)===null||e===void 0||e.call(t),typeof DOMException<"u"?new DOMException("AbortError","AbortError"):new Lw};async function qw(t){var e,n;Uw(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:Dw[t.type],d=await(async()=>{const p=await t.headers();return Symbol.iterator in p?Object.fromEntries(p):p})(),f=(0,pm.default)((0,pm.default)((0,pm.default)({},t.contentTypeHeader&&o!=="GET"?{"content-type":t.contentTypeHeader}:{}),t.trpcAcceptHeader?{[(n=t.trpcAcceptHeaderKey)!==null&&n!==void 0?n:"trpc-accept"]:t.trpcAcceptHeader}:void 0),d);return Ow(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:f})}async function yb(t){const e={},n=await qw(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}function Hw(t){return t instanceof Uint8Array||t instanceof Blob}function Bw(t){return t instanceof FormData}var Mf=xa(Ri(),1);const Gw=t=>{if("input"in t){const{input:e}=t;if(Bw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return yb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:void 0,getUrl:gb,getBody:()=>e}))}if(Hw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return yb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:"application/octet-stream",getUrl:gb,getBody:()=>e}))}}return kw(t)};function Pw(t){const e=Mw(t);return()=>n=>{const{op:s}=n;return oh(i=>{const{path:o,input:d,type:f}=s;/* istanbul ignore if -- @preserve */if(f==="subscription")throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");const p=Gw((0,Mf.default)((0,Mf.default)({},e),{},{type:f,path:o,input:d,signal:s.signal,headers(){return t.headers?typeof t.headers=="function"?t.headers({op:s}):t.headers:{}}}));let y;return p.then(b=>{y=b.meta;const v=m6(b.json,e.transformer.output);if(!v.ok){i.error(co.from(v.error,{meta:y}));return}i.next({context:b.meta,result:v.result}),i.complete()}).catch(b=>{i.error(co.from(b,{meta:y}))}),()=>{}})}}xa(Ri(),1);xa(Ri(),1);const Yw={encode:t=>JSON.stringify(t),decode:t=>{if(typeof t!="string")throw new Error("jsonEncoder received binary data. JSON uses text frames. Use a binary encoder for binary data.");return JSON.parse(t)}},Vw={enabled:!1,closeMs:0},Qw={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},Kw=t=>t===0?0:Math.min(1e3*2**t,3e4),x6=(t,...e)=>typeof t=="function"?t(...e):t;var Xw=xa(sd(),1),Cf=class b6 extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,b6.prototype)}},Fw=class{constructor(t,e){this.onTimeout=t,this.timeoutMs=e,(0,Xw.default)(this,"timeout",void 0)}reset(){this.timeout&&(clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs))}start(){clearTimeout(this.timeout),this.timeout=setTimeout(this.onTimeout,this.timeoutMs)}stop(){clearTimeout(this.timeout),this.timeout=void 0}};function v6(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Zw(t){const e=await x6(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function Iw(t,e){const n={method:"connectionParams",data:await x6(t)};return e.encode(n)}var o3=xa(sd(),1),Jw=class{constructor(){(0,o3.default)(this,"outgoingRequests",new Array),(0,o3.default)(this,"pendingRequests",{})}register(t,e){const{promise:n,resolve:s}=v6();return this.outgoingRequests.push({id:String(t.id),message:t,end:n,callbacks:{next:e.next,complete:()=>{e.complete(),s()},error:i=>{e.error(i),s()}}}),()=>{this.delete(t.id),e.complete(),s()}}delete(t){t!==null&&(this.outgoingRequests=this.outgoingRequests.filter(({id:e})=>e!==String(t)),delete this.pendingRequests[String(t)])}flush(){const t=this.outgoingRequests;this.outgoingRequests=[];for(const e of t)this.pendingRequests[e.id]=e;return t}getPendingRequests(){return Object.values(this.pendingRequests)}getPendingRequest(t){return t===null?null:this.pendingRequests[String(t)]}getOutgoingRequests(){return this.outgoingRequests}getRequests(){return[...this.getOutgoingRequests().map(t=>({state:"outgoing",message:t.message,end:t.end,callbacks:t.callbacks})),...this.getPendingRequests().map(t=>({state:"pending",message:t.message,end:t.end,callbacks:t.callbacks}))]}hasPendingRequests(){return this.getPendingRequests().length>0}hasPendingSubscriptions(){return this.getPendingRequests().some(t=>t.message.method==="subscription")}hasOutgoingRequests(){return this.outgoingRequests.length>0}},mc=xa(sd(),1);function Ww(t){const{promise:e,resolve:n,reject:s}=v6();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function $w(t,{intervalMs:e,pongTimeoutMs:n}){let s,i;function o(){s=setTimeout(()=>{t.send("PING"),i=setTimeout(()=>{t.close()},n)},e)}function d(){clearTimeout(s),o()}function f(){clearTimeout(i),d()}t.addEventListener("open",o),t.addEventListener("message",({data:p})=>{clearTimeout(s),o(),p==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var S6=class xb{constructor(e){var n;if((0,mc.default)(this,"id",++xb.connectCount),(0,mc.default)(this,"WebSocketPonyfill",void 0),(0,mc.default)(this,"urlOptions",void 0),(0,mc.default)(this,"keepAliveOpts",void 0),(0,mc.default)(this,"encoder",void 0),(0,mc.default)(this,"wsObservable",o6(null)),(0,mc.default)(this,"openPromise",null),this.WebSocketPonyfill=(n=e.WebSocketPonyfill)!==null&&n!==void 0?n:WebSocket,!this.WebSocketPonyfill)throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");this.urlOptions=e.urlOptions,this.keepAliveOpts=e.keepAlive,this.encoder=e.encoder}get ws(){return this.wsObservable.get()}set ws(e){this.wsObservable.next(e)}isOpen(){return!!this.ws&&this.ws.readyState===this.WebSocketPonyfill.OPEN&&!this.openPromise}isClosed(){return!!this.ws&&(this.ws.readyState===this.WebSocketPonyfill.CLOSING||this.ws.readyState===this.WebSocketPonyfill.CLOSED)}async open(){var e=this;if(e.openPromise)return e.openPromise;e.id=++xb.connectCount;const n=Zw(e.urlOptions).then(s=>new e.WebSocketPonyfill(s));e.openPromise=n.then(async s=>{e.ws=s,s.binaryType="arraybuffer",s.addEventListener("message",function({data:i}){i==="PING"&&this.send("PONG")}),e.keepAliveOpts.enabled&&$w(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Ww(s),e.urlOptions.connectionParams&&s.send(await Iw(e.urlOptions.connectionParams,e.encoder))});try{await e.openPromise}finally{e.openPromise=null}}async close(){var e=this;try{await e.openPromise}finally{var n;(n=e.ws)===null||n===void 0||n.close()}}};(0,mc.default)(S6,"connectCount",0);function eE(t){return t.isOpen()?{id:t.id,state:"open",ws:t.ws}:t.isClosed()?{id:t.id,state:"closed",ws:t.ws}:t.ws?{id:t.id,state:"connecting",ws:t.ws}:null}var ll=xa(sd(),1),wf=xa(Ri(),1),tE=class{constructor(t){var e,n;(0,ll.default)(this,"connectionState",void 0),(0,ll.default)(this,"allowReconnect",!1),(0,ll.default)(this,"requestManager",new Jw),(0,ll.default)(this,"activeConnection",void 0),(0,ll.default)(this,"reconnectRetryDelay",void 0),(0,ll.default)(this,"inactivityTimeout",void 0),(0,ll.default)(this,"callbacks",void 0),(0,ll.default)(this,"lazyMode",void 0),(0,ll.default)(this,"encoder",void 0),(0,ll.default)(this,"reconnecting",null),this.encoder=(e=t.experimental_encoder)!==null&&e!==void 0?e:Yw,this.callbacks={onOpen:t.onOpen,onClose:t.onClose,onError:t.onError};const s=(0,wf.default)((0,wf.default)({},Vw),t.lazy);this.inactivityTimeout=new Fw(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},s.closeMs),this.activeConnection=new S6({WebSocketPonyfill:t.WebSocket,urlOptions:t,keepAlive:(0,wf.default)((0,wf.default)({},Qw),t.keepAlive),encoder:this.encoder}),this.activeConnection.wsObservable.subscribe({next:i=>{i&&this.setupWebSocketListeners(i)}}),this.reconnectRetryDelay=(n=t.retryDelayMs)!==null&&n!==void 0?n:Kw,this.lazyMode=s.enabled,this.connectionState=o6({type:"state",state:s.enabled?"idle":"connecting",error:null}),this.lazyMode||this.open().catch(()=>null)}async open(){var t=this;t.allowReconnect=!0,t.connectionState.get().state==="idle"&&t.connectionState.next({type:"state",state:"connecting",error:null});try{await t.activeConnection.open()}catch(e){return t.reconnect(new Cf({message:"Initialization error",cause:e})),t.reconnecting}}async close(){var t=this;t.allowReconnect=!1,t.inactivityTimeout.stop();const e=[];for(const n of t.requestManager.getRequests())n.message.method==="subscription"?n.callbacks.complete():n.state==="outgoing"?n.callbacks.error(co.from(new Cf({message:"Closed before connection was established"}))):e.push(n.end);await Promise.all(e).catch(()=>null),await t.activeConnection.close().catch(()=>null),t.connectionState.next({type:"state",state:"idle",error:null})}request({op:{id:t,type:e,path:n,input:s,signal:i},transformer:o,lastEventId:d}){return oh(f=>{const p=this.batchSend({id:t,method:e,params:{input:o.input.serialize(s),path:n,lastEventId:d}},(0,wf.default)((0,wf.default)({},f),{},{next(y){const b=m6(y,o.output);if(!b.ok){f.error(co.from(b.error));return}f.next({result:b.result})}}));return()=>{p(),e==="subscription"&&this.activeConnection.isOpen()&&this.send({id:t,method:"subscription.stop"}),i==null||i.removeEventListener("abort",p)}})}get connection(){return eE(this.activeConnection)}reconnect(t){var e=this;if(this.connectionState.next({type:"state",state:"connecting",error:co.from(t)}),this.reconnecting)return;const n=async s=>{try{await r3(e.reconnectRetryDelay(s)),e.allowReconnect&&(await e.activeConnection.close(),await e.activeConnection.open(),e.requestManager.hasPendingRequests()&&e.send(e.requestManager.getPendingRequests().map(({message:i})=>i))),e.reconnecting=null}catch{await n(s+1)}};this.reconnecting=n(0)}setupWebSocketListeners(t){var e=this;const n=s=>{const i=this.requestManager.getPendingRequests();for(const{message:o,callbacks:d}of i)o.method!=="subscription"&&(d.error(co.from(s??new Cf({message:"WebSocket closed",cause:s}))),this.requestManager.delete(o.id))};t.addEventListener("open",()=>{s3(async()=>{var s,i;e.lazyMode&&e.inactivityTimeout.start(),(s=(i=e.callbacks).onOpen)===null||s===void 0||s.call(i),e.connectionState.next({type:"state",state:"pending",error:null})}).catch(s=>{t.close(3e3),n(s)})}),t.addEventListener("message",({data:s})=>{if(this.inactivityTimeout.reset(),["PING","PONG"].includes(s))return;const i=this.encoder.decode(s);if("method"in i){this.handleIncomingRequest(i);return}this.handleResponseMessage(i)}),t.addEventListener("close",s=>{var i,o;n(s),(i=(o=this.callbacks).onClose)===null||i===void 0||i.call(o,s),(!this.lazyMode||this.requestManager.hasPendingSubscriptions())&&this.reconnect(new Cf({message:"WebSocket closed",cause:s}))}),t.addEventListener("error",s=>{var i,o;n(s),(i=(o=this.callbacks).onError)===null||i===void 0||i.call(o,s),this.reconnect(new Cf({message:"WebSocket closed",cause:s}))})}handleResponseMessage(t){const e=this.requestManager.getPendingRequest(t.id);if(!e)return;e.callbacks.next(t);let n=!0;"result"in t&&e.message.method==="subscription"&&(t.result.type==="data"&&(e.message.params.lastEventId=t.result.id),t.result.type!=="stopped"&&(n=!1)),n&&(e.callbacks.complete(),this.requestManager.delete(t.id))}handleIncomingRequest(t){t.method==="reconnect"&&this.reconnect(new Cf({message:"Server requested reconnect"}))}send(t){if(!this.activeConnection.isOpen())throw new Error("Active connection is not open");const e=t instanceof Array?t:[t];this.activeConnection.ws.send(this.encoder.encode(e.length===1?e[0]:e))}batchSend(t,e){var n=this;return this.inactivityTimeout.reset(),s3(async()=>{n.activeConnection.isOpen()||await n.open(),await r3(0),n.requestManager.hasOutgoingRequests()&&n.send(n.requestManager.flush().map(({message:s})=>s))}).catch(s=>{this.requestManager.delete(t.id),e.error(co.from(s))}),this.requestManager.register(t,e)}};function nE(t){return new tE(t)}function aE(t){const{client:e}=t,n=g6(t.transformer);return()=>({op:s})=>oh(i=>{const o=s.type==="subscription"?e.connectionState.subscribe({next(f){i.next({result:f,context:s.context})}}):null,d=e.request({op:s,transformer:n}).subscribe(i);return()=>{d.unsubscribe(),o==null||o.unsubscribe()}})}var ix=xa(sd(),1),c3=xa(Ri(),1),sE=class{constructor(t){(0,ix.default)(this,"links",void 0),(0,ix.default)(this,"runtime",void 0),(0,ix.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return mw({links:this.links,op:(0,c3.default)((0,c3.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(pw())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await hw(n)).result.data}catch(n){throw co.from(n)}}query(t,e,n){return this.requestAsPromise({type:"query",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}mutation(t,e,n){return this.requestAsPromise({type:"mutation",path:t,input:e,context:n==null?void 0:n.context,signal:n==null?void 0:n.signal})}subscription(t,e,n){return this.$request({type:"subscription",path:t,input:e,context:n.context,signal:n.signal}).subscribe({next(i){switch(i.result.type){case"state":{var o;(o=n.onConnectionStateChange)===null||o===void 0||o.call(n,i.result);break}case"started":{var d;(d=n.onStarted)===null||d===void 0||d.call(n,{context:i.context});break}case"stopped":{var f;(f=n.onStopped)===null||f===void 0||f.call(n);break}case"data":case void 0:{var p;(p=n.onData)===null||p===void 0||p.call(n,i.result.data);break}}},error(i){var o;(o=n.onError)===null||o===void 0||o.call(n,i)},complete(){var i;(i=n.onComplete)===null||i===void 0||i.call(n)}})}};const rE=Symbol.for("trpc_untypedClient"),iE={query:"query",mutate:"mutation",subscribe:"subscription"},lE=t=>iE[t];function oE(t){const e=Nw(({path:n,args:s})=>{const i=[...n],o=lE(i.pop()),d=i.join(".");return t[o](d,...s)});return _w(n=>n===rE?t:e[n])}function u3(t){const e=new sE(t);return oE(e)}xa(Ri(),1);xa(Ri(),1);var cE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(t,e){function n(i){var o,d,f,p=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);p--;){if(d&&(o=i[d])!=null)return o.call(i);if(f&&(o=i[f])!=null)return new s(o.call(i));d="@@asyncIterator",f="@@iterator"}throw new TypeError("Object is not async iterable")}function s(i){function o(d){if(Object(d)!==d)return Promise.reject(new TypeError(d+" is not an object."));var f=d.done;return Promise.resolve(d.value).then(function(p){return{value:p,done:f}})}return s=function(f){this.s=f,this.n=f.next},s.prototype={s:null,n:null,next:function(){return o(this.n.apply(this.s,arguments))},return:function(f){var p=this.s.return;return p===void 0?Promise.resolve({value:f,done:!0}):o(p.apply(this.s,arguments))},throw:function(f){var p=this.s.return;return p===void 0?Promise.reject(f):o(p.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});xa(cE(),1);xa(Ri(),1);var uE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(t,e){function n(){var s=typeof SuppressedError=="function"?SuppressedError:function(f,p){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=p,y},i={},o=[];function d(f,p){if(p!=null){if(Object(p)!==p)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=p[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=p[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var b=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");b&&(y=function(){try{b.call(p)}catch(_){return Promise.reject(_)}}),o.push({v:p,d:y,a:f})}else f&&o.push({d:p,a:f});return p}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var p,y=this.e,b=0;function v(){for(;p=o.pop();)try{if(!p.a&&b===1)return b=0,o.push(p),Promise.resolve().then(v);if(p.d){var C=p.d.call(p.v);if(p.a)return b|=2,Promise.resolve(C).then(v,_)}else b|=1}catch(w){return _(w)}if(b===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(C){return y=y!==i?new s(C,y):C,v()}return v()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),N6=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(t,e){function n(s,i){this.v=s,this.k=i}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),dE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=N6();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),fE=xl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=N6();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function p(b,v){try{var _=o[b](v),C=_.value,w=C instanceof n;Promise.resolve(w?C.v:C).then(function(T){if(w){var R=b==="return"?"return":"next";if(!C.k||T.done)return p(R,T);T=o[R](T).value}y(_.done?"return":"normal",T)},function(T){p("throw",T)})}catch(T){y("throw",T)}}function y(b,v){switch(b){case"return":d.resolve({value:v,done:!0});break;case"throw":d.reject(v);break;default:d.resolve({value:v,done:!1})}(d=d.next)?p(d.key,d.arg):f=null}this._invoke=function(b,v){return new Promise(function(_,C){var w={key:b,arg:v,resolve:_,reject:C,next:null};f?f=f.next=w:(d=f=w,p(b,v))})},typeof o.return!="function"&&(this.return=void 0)}i.prototype[typeof Symbol=="function"&&Symbol.asyncIterator||"@@asyncIterator"]=function(){return this},i.prototype.next=function(o){return this._invoke("next",o)},i.prototype.throw=function(o){return this._invoke("throw",o)},i.prototype.return=function(o){return this._invoke("return",o)},e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}});xa(uE(),1);xa(dE(),1);xa(fE(),1);xa(Ri(),1);class hE{constructor(e){Gp(this,"trpc");Gp(this,"serverUrl");Gp(this,"token");Gp(this,"wsClient",null);this.serverUrl=e.serverUrl.replace(/\/+$/,""),this.token=e.token;const n=typeof window<"u",s=e.useWebSocket??n,i=()=>{const o={};return this.token&&(o.Authorization=`Bearer ${this.token}`),o};if(s){const o=this.serverUrl.replace(/^http/,"ws")+"/trpc";this.wsClient=nE({url:o,connectionParams:()=>({token:this.token}),retryDelayMs:()=>2e3}),this.trpc=u3({links:[aE({client:this.wsClient,transformer:kt})]})}else this.trpc=u3({links:[Pw({url:`${this.serverUrl}/trpc`,headers:i,transformer:kt})]})}setToken(e){this.token=e}close(){var e;(e=this.wsClient)==null||e.close()}async login(e,n){return this.trpc.auth.login.mutate({username:e,password:n})}async getMe(){return this.trpc.auth.me.query()}async logout(){return this.trpc.auth.logout.mutate()}async getSystemInfo(){return this.trpc.system.info.query()}async getFeatureFlags(){return this.trpc.system.featureFlags.query()}async listProviders(){return this.trpc.providers.list.query()}async getProvider(e){return this.trpc.providers.get.query({id:e})}async startProvider(e){return this.trpc.providers.start.mutate({id:e})}async stopProvider(e){return this.trpc.providers.stop.mutate({id:e})}async listProviderTypes(){return this.trpc.providerConfig.getAvailableTypes.query()}async listDevices(){return this.trpc.devices.list.query()}async getDevice(e){return this.trpc.devices.get.query({id:e})}async discoverDevices(e){return this.trpc.devices.discoverDevices.query({providerId:e})}async adoptDevice(e,n){return this.trpc.devices.adoptDevice.mutate({providerId:e,externalId:n})}async createDevice(e,n){return this.trpc.devices.createDevice.mutate({providerId:e,config:n})}getAddonAssetUrl(e,n){return`/api/addon-assets/${e}/${n}`}async listAddons(){return this.trpc.addons.list.query()}async getAddonConfigSchema(e){return this.trpc.addons.getConfigSchema.query({addonId:e})}async getAddonConfig(e){return this.trpc.addons.getConfig.query({addonId:e})}async updateAddonConfig(e,n){return this.trpc.addons.updateConfig.mutate({addonId:e,config:n})}async getAddonLogs(e,n){return this.trpc.addons.getLogs.query({addonId:e,...n})}async listKnownFaces(){return this.trpc.knownFaces.list.query()}async registerFace(e,n,s){return this.trpc.knownFaces.register.mutate({label:e,cropBase64:n,group:s})}async listPipelines(){return this.trpc.bridgePipeline.listAddons.query()}async getPipelineStatus(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async listAgents(){return this.trpc.agents.listAgents.query()}async dispatchTask(e,n){return this.trpc.agents.dispatchTask.mutate({capability:e,input:n})}async getProcessTree(){return this.trpc.agent.processTree.query()}async bridgeListAddons(){return this.trpc.bridgePipeline.listAddons.query()}async bridgeGetPipeline(e){return this.trpc.bridgePipeline.getPipeline.query({deviceId:e})}async bridgeSetPipeline(e,n){return this.trpc.bridgePipeline.setPipeline.mutate({deviceId:e,config:n})}async bridgeValidatePipeline(e){return this.trpc.bridgePipeline.validatePipeline.query(e)}async bridgeGetAddonConfig(e){return this.trpc.bridgePipeline.getAddonConfig.query({addonId:e})}async bridgeSetAddonConfig(e,n){return this.trpc.bridgePipeline.setAddonConfig.mutate({addonId:e,config:n})}async bridgeListPackages(){return this.trpc.addons.listPackages.query()}async bridgeListAddonsPackages(){return this.trpc.addons.list.query()}async bridgeInstallPackage(e,n){return this.trpc.addons.installPackage.mutate({packageName:e,version:n})}async bridgeUninstallPackage(e){return this.trpc.addons.uninstallPackage.mutate({packageName:e})}async getRecordingConfig(e){return this.trpc.recording.getConfig.query({deviceId:e})}async getRecordingPolicy(e){return this.trpc.recording.getPolicy.query({deviceId:e})}async getRecordingPolicyStatus(e){return this.trpc.recording.getPolicyStatus.query({deviceId:e})}async getRecordingSegments(e,n,s,i){return this.trpc.recording.getSegments.query({deviceId:e,streamId:n,startTime:s,endTime:i})}async getEvents(e,n){return this.trpc.events.query.query({deviceId:e,...n})}async getLogs(e){return this.trpc.logs.query.query(e??{})}async replEval(e,n){return this.trpc.repl.execute.mutate({code:e,scope:n??{type:"system"}})}async listUsers(){return this.trpc.users.list.query()}async createUser(e,n,s){return this.trpc.users.create.mutate({username:e,password:n,role:s})}async getTrackingSessions(e){return this.trpc.session.getActiveTracks.query({deviceId:e})}async listProcesses(){return this.trpc.processes.listProcesses.query()}async enableProvider(e){return this.trpc.processes.enableProvider.mutate({id:e})}async disableProvider(e){return this.trpc.processes.disableProvider.mutate({id:e})}async getSettingsSchema(e){return this.trpc.settings.getSchema.query({section:e})}async getSettings(e){return this.trpc.settings.get.query({section:e})}async updateSettings(e,n){return this.trpc.settings.update.mutate({section:e,data:n})}}var _6=(t=>(t.Motion="motion",t.Person="person",t.Vehicle="vehicle",t.Animal="animal",t.Audio="audio",t.Face="face",t.Plate="plate",t.Package="package",t.Doorbell="doorbell",t.Sensor="sensor",t))(_6||{});const pE=["animal","dog_cat","dog","cat","horse","sheep","cow","elephant","bear","zebra","giraffe","mouse","rabbit","deer","lion","tiger","bird","eagle","owl","pigeon","fish","whale","dolphin","snake","turtle","lizard"],mE=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],gE=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],yE=["face","eyes","nose","mouth","ears","eyebrows","left_eye","right_eye","pupil","iris","eyelid","eye_corner","upper_lip","lower_lip","teeth","chin","cheek","forehead","jaw","glasses","sunglasses","facial_hair","beard","mustache","facial_landmark","facial_keypoint"],xE=["plate","license_plate","front_plate","rear_plate","motorcycle_plate","temporary_plate","dealer_plate","licensePlate","plate_number","plate_character","plate_digit","plate_letter","plate_symbol","plate_region","plate_country_identifier","plate_frame","plate_bolt","plate_sticker","plate_validation_tag","damaged_plate","obscured_plate","dirty_plate"],bE=["motion","movement","other"],vE=["package","packet"],SE=["audio"],NE=["speech","scream","babbling","yell","bellow","whoop","whispering","laughter","snicker","crying","cry","sigh","singing","choir","chant","mantra","child_singing","rapping","humming","groan","grunt","whistling","breathing","wheeze","snoring","gasp","pant","snort","cough","throat_clearing","sneeze","sniff","cheering","applause","chatter","crowd","children_playing","bark","yip","howl","bow-wow","growling","whimper_dog","purr","meow","hiss","caterwaul","pets","livestock","doorbell","ding-dong","door","slam","knock","alarm","telephone","music","dog","dogs"],_E=["doorbell","ring"],jE=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...pE.reduce((t,e)=>({...t,[e]:"animal"}),{}),...mE.reduce((t,e)=>({...t,[e]:"person"}),{}),...gE.reduce((t,e)=>({...t,[e]:"vehicle"}),{}),...bE.reduce((t,e)=>({...t,[e]:"motion"}),{}),...vE.reduce((t,e)=>({...t,[e]:"package"}),{}),...yE.reduce((t,e)=>({...t,[e]:"face"}),{}),...xE.reduce((t,e)=>({...t,[e]:"plate"}),{}),...SE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...NE.reduce((t,e)=>({...t,[e]:"audio"}),{}),..._E.reduce((t,e)=>({...t,[e]:"doorbell"}),{}),...jE.reduce((t,e)=>({...t,[e]:"sensor"}),{})});const CE=Object.values(_6),wE=CE.filter(t=>t!=="motion");[...wE];const EE=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(EE);const TE=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(TE);let g1=null;function Om(){if(!g1){const t=window.location.origin,e=localStorage.getItem("camstack_admin_token")??void 0;g1=new hE({serverUrl:t,token:e})}return g1}function d3(){g1=null}const j6=D.createContext(null);function f3(t){try{const e=JSON.parse(atob(t.split(".")[1]));return{username:e.username??"unknown",role:e.role??"viewer",exp:e.exp??0}}catch{return null}}function RE({children:t}){const[e,n]=D.useState(null),[s,i]=D.useState(!0);D.useEffect(()=>{const f=localStorage.getItem("camstack_admin_token");if(!f){i(!1);return}const p=f3(f);if(!p||p.exp*1e3<Date.now()){localStorage.removeItem("camstack_admin_token"),i(!1);return}Om().getSystemInfo().then(()=>n(p)).catch(b=>{var _;const v=(_=b==null?void 0:b.data)==null?void 0:_.code;v==="UNAUTHORIZED"||v==="FORBIDDEN"?(localStorage.removeItem("camstack_admin_token"),d3()):n(p)}).finally(()=>i(!1))},[]);const o=D.useCallback(async(f,p)=>{const y=Om(),v=(await y.login(f,p)).token;localStorage.setItem("camstack_admin_token",v),y.setToken(v),n(f3(v))},[]),d=D.useCallback(()=>{localStorage.removeItem("camstack_admin_token"),d3(),n(null)},[]);return h.jsx(j6.Provider,{value:{user:e,loading:s,login:o,logout:d},children:t})}function ov(){const t=D.useContext(j6);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function Au({children:t,requiredRole:e}){const{user:n,loading:s}=ov();return s?h.jsx("div",{className:"flex h-screen items-center justify-center bg-background text-foreground-subtle",children:"Loading..."}):n?e==="admin"&&n.role!=="admin"&&n.role!=="super_admin"?h.jsx(lb,{to:"/access-denied",replace:!0}):h.jsx(h.Fragment,{children:t}):h.jsx(lb,{to:"/login",replace:!0})}/**
|
|
136
|
-
* @license lucide-react v0.511.0 - ISC
|
|
137
|
-
*
|
|
138
|
-
* This source code is licensed under the ISC license.
|
|
139
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
140
|
-
*/const OE=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),ME=t=>t.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,n,s)=>s?s.toUpperCase():n.toLowerCase()),h3=t=>{const e=ME(t);return e.charAt(0).toUpperCase()+e.slice(1)},C6=(...t)=>t.filter((e,n,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===n).join(" ").trim(),AE=t=>{for(const e in t)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
|
|
141
|
-
* @license lucide-react v0.511.0 - ISC
|
|
142
|
-
*
|
|
143
|
-
* This source code is licensed under the ISC license.
|
|
144
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
145
|
-
*/var DE={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"};/**
|
|
146
|
-
* @license lucide-react v0.511.0 - ISC
|
|
147
|
-
*
|
|
148
|
-
* This source code is licensed under the ISC license.
|
|
149
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
150
|
-
*/const zE=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},p)=>D.createElement("svg",{ref:p,...DE,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:C6("lucide",i),...!o&&!AE(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,b])=>D.createElement(y,b)),...Array.isArray(o)?o:[o]]));/**
|
|
151
|
-
* @license lucide-react v0.511.0 - ISC
|
|
152
|
-
*
|
|
153
|
-
* This source code is licensed under the ISC license.
|
|
154
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
155
|
-
*/const ke=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(zE,{ref:o,iconNode:e,className:C6(`lucide-${OE(h3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=h3(t),n};/**
|
|
156
|
-
* @license lucide-react v0.511.0 - ISC
|
|
157
|
-
*
|
|
158
|
-
* This source code is licensed under the ISC license.
|
|
159
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
160
|
-
*/const kE=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],cv=ke("activity",kE);/**
|
|
161
|
-
* @license lucide-react v0.511.0 - ISC
|
|
162
|
-
*
|
|
163
|
-
* This source code is licensed under the ISC license.
|
|
164
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
165
|
-
*/const LE=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],UE=ke("arrow-down-to-line",LE);/**
|
|
166
|
-
* @license lucide-react v0.511.0 - ISC
|
|
167
|
-
*
|
|
168
|
-
* This source code is licensed under the ISC license.
|
|
169
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
170
|
-
*/const qE=[["path",{d:"M5 3h14",key:"7usisc"}],["path",{d:"m18 13-6-6-6 6",key:"1kf1n9"}],["path",{d:"M12 7v14",key:"1akyts"}]],HE=ke("arrow-up-to-line",qE);/**
|
|
171
|
-
* @license lucide-react v0.511.0 - ISC
|
|
172
|
-
*
|
|
173
|
-
* This source code is licensed under the ISC license.
|
|
174
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
175
|
-
*/const BE=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],uv=ke("bell",BE);/**
|
|
176
|
-
* @license lucide-react v0.511.0 - ISC
|
|
177
|
-
*
|
|
178
|
-
* This source code is licensed under the ISC license.
|
|
179
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
180
|
-
*/const GE=[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]],bb=ke("bot",GE);/**
|
|
181
|
-
* @license lucide-react v0.511.0 - ISC
|
|
182
|
-
*
|
|
183
|
-
* This source code is licensed under the ISC license.
|
|
184
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
185
|
-
*/const PE=[["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"}]],YE=ke("box",PE);/**
|
|
186
|
-
* @license lucide-react v0.511.0 - ISC
|
|
187
|
-
*
|
|
188
|
-
* This source code is licensed under the ISC license.
|
|
189
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
190
|
-
*/const VE=[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]],QE=ke("bug",VE);/**
|
|
191
|
-
* @license lucide-react v0.511.0 - ISC
|
|
192
|
-
*
|
|
193
|
-
* This source code is licensed under the ISC license.
|
|
194
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
195
|
-
*/const KE=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],XE=ke("calendar",KE);/**
|
|
196
|
-
* @license lucide-react v0.511.0 - ISC
|
|
197
|
-
*
|
|
198
|
-
* This source code is licensed under the ISC license.
|
|
199
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
200
|
-
*/const FE=[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]],Lc=ke("camera",FE);/**
|
|
201
|
-
* @license lucide-react v0.511.0 - ISC
|
|
202
|
-
*
|
|
203
|
-
* This source code is licensed under the ISC license.
|
|
204
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
205
|
-
*/const ZE=[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]],IE=ke("car",ZE);/**
|
|
206
|
-
* @license lucide-react v0.511.0 - ISC
|
|
207
|
-
*
|
|
208
|
-
* This source code is licensed under the ISC license.
|
|
209
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
210
|
-
*/const JE=[["path",{d:"M16.75 12h3.632a1 1 0 0 1 .894 1.447l-2.034 4.069a1 1 0 0 1-1.708.134l-2.124-2.97",key:"ir91b5"}],["path",{d:"M17.106 9.053a1 1 0 0 1 .447 1.341l-3.106 6.211a1 1 0 0 1-1.342.447L3.61 12.3a2.92 2.92 0 0 1-1.3-3.91L3.69 5.6a2.92 2.92 0 0 1 3.92-1.3z",key:"jlp8i1"}],["path",{d:"M2 19h3.76a2 2 0 0 0 1.8-1.1L9 15",key:"19bib8"}],["path",{d:"M2 21v-4",key:"l40lih"}],["path",{d:"M7 9h.01",key:"19b3jx"}]],WE=ke("cctv",JE);/**
|
|
211
|
-
* @license lucide-react v0.511.0 - ISC
|
|
212
|
-
*
|
|
213
|
-
* This source code is licensed under the ISC license.
|
|
214
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
215
|
-
*/const $E=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Fm=ke("check",$E);/**
|
|
216
|
-
* @license lucide-react v0.511.0 - ISC
|
|
217
|
-
*
|
|
218
|
-
* This source code is licensed under the ISC license.
|
|
219
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
220
|
-
*/const eT=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Mc=ke("chevron-down",eT);/**
|
|
221
|
-
* @license lucide-react v0.511.0 - ISC
|
|
222
|
-
*
|
|
223
|
-
* This source code is licensed under the ISC license.
|
|
224
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
225
|
-
*/const tT=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],nT=ke("chevron-left",tT);/**
|
|
226
|
-
* @license lucide-react v0.511.0 - ISC
|
|
227
|
-
*
|
|
228
|
-
* This source code is licensed under the ISC license.
|
|
229
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
230
|
-
*/const aT=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zu=ke("chevron-right",aT);/**
|
|
231
|
-
* @license lucide-react v0.511.0 - ISC
|
|
232
|
-
*
|
|
233
|
-
* This source code is licensed under the ISC license.
|
|
234
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
235
|
-
*/const sT=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],N1=ke("chevron-up",sT);/**
|
|
236
|
-
* @license lucide-react v0.511.0 - ISC
|
|
237
|
-
*
|
|
238
|
-
* This source code is licensed under the ISC license.
|
|
239
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
240
|
-
*/const rT=[["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"}]],w6=ke("circle-alert",rT);/**
|
|
241
|
-
* @license lucide-react v0.511.0 - ISC
|
|
242
|
-
*
|
|
243
|
-
* This source code is licensed under the ISC license.
|
|
244
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
245
|
-
*/const iT=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],lT=ke("circle-check-big",iT);/**
|
|
246
|
-
* @license lucide-react v0.511.0 - ISC
|
|
247
|
-
*
|
|
248
|
-
* This source code is licensed under the ISC license.
|
|
249
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
250
|
-
*/const oT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],E6=ke("circle-dot",oT);/**
|
|
251
|
-
* @license lucide-react v0.511.0 - ISC
|
|
252
|
-
*
|
|
253
|
-
* This source code is licensed under the ISC license.
|
|
254
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
255
|
-
*/const cT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["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"}]],p3=ke("circle-help",cT);/**
|
|
256
|
-
* @license lucide-react v0.511.0 - ISC
|
|
257
|
-
*
|
|
258
|
-
* This source code is licensed under the ISC license.
|
|
259
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
260
|
-
*/const uT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],T6=ke("clock",uT);/**
|
|
261
|
-
* @license lucide-react v0.511.0 - ISC
|
|
262
|
-
*
|
|
263
|
-
* This source code is licensed under the ISC license.
|
|
264
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
265
|
-
*/const dT=[["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"}]],fT=ke("copy",dT);/**
|
|
266
|
-
* @license lucide-react v0.511.0 - ISC
|
|
267
|
-
*
|
|
268
|
-
* This source code is licensed under the ISC license.
|
|
269
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
270
|
-
*/const hT=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],zf=ke("cpu",hT);/**
|
|
271
|
-
* @license lucide-react v0.511.0 - ISC
|
|
272
|
-
*
|
|
273
|
-
* This source code is licensed under the ISC license.
|
|
274
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
275
|
-
*/const pT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"22",x2:"18",y1:"12",y2:"12",key:"l9bcsi"}],["line",{x1:"6",x2:"2",y1:"12",y2:"12",key:"13hhkx"}],["line",{x1:"12",x2:"12",y1:"6",y2:"2",key:"10w3f3"}],["line",{x1:"12",x2:"12",y1:"22",y2:"18",key:"15g9kq"}]],mT=ke("crosshair",pT);/**
|
|
276
|
-
* @license lucide-react v0.511.0 - ISC
|
|
277
|
-
*
|
|
278
|
-
* This source code is licensed under the ISC license.
|
|
279
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
280
|
-
*/const gT=[["path",{d:"M11.25 16.25h1.5L12 17z",key:"w7jh35"}],["path",{d:"M16 14v.5",key:"1lajdz"}],["path",{d:"M4.42 11.247A13.152 13.152 0 0 0 4 14.556C4 18.728 7.582 21 12 21s8-2.272 8-6.444a11.702 11.702 0 0 0-.493-3.309",key:"u7s9ue"}],["path",{d:"M8 14v.5",key:"1nzgdb"}],["path",{d:"M8.5 8.5c-.384 1.05-1.083 2.028-2.344 2.5-1.931.722-3.576-.297-3.656-1-.113-.994 1.177-6.53 4-7 1.923-.321 3.651.845 3.651 2.235A7.497 7.497 0 0 1 14 5.277c0-1.39 1.844-2.598 3.767-2.277 2.823.47 4.113 6.006 4 7-.08.703-1.725 1.722-3.656 1-1.261-.472-1.855-1.45-2.239-2.5",key:"v8hric"}]],yT=ke("dog",gT);/**
|
|
281
|
-
* @license lucide-react v0.511.0 - ISC
|
|
282
|
-
*
|
|
283
|
-
* This source code is licensed under the ISC license.
|
|
284
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
285
|
-
*/const xT=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],_1=ke("download",xT);/**
|
|
286
|
-
* @license lucide-react v0.511.0 - ISC
|
|
287
|
-
*
|
|
288
|
-
* This source code is licensed under the ISC license.
|
|
289
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
290
|
-
*/const bT=[["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"}]],vT=ke("external-link",bT);/**
|
|
291
|
-
* @license lucide-react v0.511.0 - ISC
|
|
292
|
-
*
|
|
293
|
-
* This source code is licensed under the ISC license.
|
|
294
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
295
|
-
*/const ST=[["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"}]],R6=ke("eye-off",ST);/**
|
|
296
|
-
* @license lucide-react v0.511.0 - ISC
|
|
297
|
-
*
|
|
298
|
-
* This source code is licensed under the ISC license.
|
|
299
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
300
|
-
*/const NT=[["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"}]],ch=ke("eye",NT);/**
|
|
301
|
-
* @license lucide-react v0.511.0 - ISC
|
|
302
|
-
*
|
|
303
|
-
* This source code is licensed under the ISC license.
|
|
304
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
305
|
-
*/const _T=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M3 7.5h4",key:"zfgn84"}],["path",{d:"M3 12h18",key:"1i2n21"}],["path",{d:"M3 16.5h4",key:"1230mu"}],["path",{d:"M17 3v18",key:"in4fa5"}],["path",{d:"M17 7.5h4",key:"myr1c1"}],["path",{d:"M17 16.5h4",key:"go4c1d"}]],O6=ke("film",_T);/**
|
|
306
|
-
* @license lucide-react v0.511.0 - ISC
|
|
307
|
-
*
|
|
308
|
-
* This source code is licensed under the ISC license.
|
|
309
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
310
|
-
*/const jT=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],CT=ke("flask-conical",jT);/**
|
|
311
|
-
* @license lucide-react v0.511.0 - ISC
|
|
312
|
-
*
|
|
313
|
-
* This source code is licensed under the ISC license.
|
|
314
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
315
|
-
*/const wT=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],ET=ke("funnel",wT);/**
|
|
316
|
-
* @license lucide-react v0.511.0 - ISC
|
|
317
|
-
*
|
|
318
|
-
* This source code is licensed under the ISC license.
|
|
319
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
320
|
-
*/const TT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],RT=ke("gauge",TT);/**
|
|
321
|
-
* @license lucide-react v0.511.0 - ISC
|
|
322
|
-
*
|
|
323
|
-
* This source code is licensed under the ISC license.
|
|
324
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
325
|
-
*/const OT=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],X1=ke("git-branch",OT);/**
|
|
326
|
-
* @license lucide-react v0.511.0 - ISC
|
|
327
|
-
*
|
|
328
|
-
* This source code is licensed under the ISC license.
|
|
329
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
330
|
-
*/const MT=[["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"}]],AT=ke("grip-vertical",MT);/**
|
|
331
|
-
* @license lucide-react v0.511.0 - ISC
|
|
332
|
-
*
|
|
333
|
-
* This source code is licensed under the ISC license.
|
|
334
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
335
|
-
*/const DT=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}]],mm=ke("hard-drive",DT);/**
|
|
336
|
-
* @license lucide-react v0.511.0 - ISC
|
|
337
|
-
*
|
|
338
|
-
* This source code is licensed under the ISC license.
|
|
339
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
340
|
-
*/const zT=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]],kT=ke("house",zT);/**
|
|
341
|
-
* @license lucide-react v0.511.0 - ISC
|
|
342
|
-
*
|
|
343
|
-
* This source code is licensed under the ISC license.
|
|
344
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
345
|
-
*/const LT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],j1=ke("info",LT);/**
|
|
346
|
-
* @license lucide-react v0.511.0 - ISC
|
|
347
|
-
*
|
|
348
|
-
* This source code is licensed under the ISC license.
|
|
349
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
350
|
-
*/const UT=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],qT=ke("languages",UT);/**
|
|
351
|
-
* @license lucide-react v0.511.0 - ISC
|
|
352
|
-
*
|
|
353
|
-
* This source code is licensed under the ISC license.
|
|
354
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
355
|
-
*/const HT=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],M6=ke("layout-dashboard",HT);/**
|
|
356
|
-
* @license lucide-react v0.511.0 - ISC
|
|
357
|
-
*
|
|
358
|
-
* This source code is licensed under the ISC license.
|
|
359
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
360
|
-
*/const BT=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],GT=ke("lightbulb",BT);/**
|
|
361
|
-
* @license lucide-react v0.511.0 - ISC
|
|
362
|
-
*
|
|
363
|
-
* This source code is licensed under the ISC license.
|
|
364
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
365
|
-
*/const PT=[["rect",{x:"3",y:"5",width:"6",height:"6",rx:"1",key:"1defrl"}],["path",{d:"m3 17 2 2 4-4",key:"1jhpwq"}],["path",{d:"M13 6h8",key:"15sg57"}],["path",{d:"M13 12h8",key:"h98zly"}],["path",{d:"M13 18h8",key:"oe0vm4"}]],YT=ke("list-todo",PT);/**
|
|
366
|
-
* @license lucide-react v0.511.0 - ISC
|
|
367
|
-
*
|
|
368
|
-
* This source code is licensed under the ISC license.
|
|
369
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
370
|
-
*/const VT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],uo=ke("loader-circle",VT);/**
|
|
371
|
-
* @license lucide-react v0.511.0 - ISC
|
|
372
|
-
*
|
|
373
|
-
* This source code is licensed under the ISC license.
|
|
374
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
375
|
-
*/const QT=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],KT=ke("log-out",QT);/**
|
|
376
|
-
* @license lucide-react v0.511.0 - ISC
|
|
377
|
-
*
|
|
378
|
-
* This source code is licensed under the ISC license.
|
|
379
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
380
|
-
*/const XT=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],FT=ke("menu",XT);/**
|
|
381
|
-
* @license lucide-react v0.511.0 - ISC
|
|
382
|
-
*
|
|
383
|
-
* This source code is licensed under the ISC license.
|
|
384
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
385
|
-
*/const ZT=[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]],A6=ke("mic",ZT);/**
|
|
386
|
-
* @license lucide-react v0.511.0 - ISC
|
|
387
|
-
*
|
|
388
|
-
* This source code is licensed under the ISC license.
|
|
389
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
390
|
-
*/const IT=[["path",{d:"M5 12h14",key:"1ays0h"}]],JT=ke("minus",IT);/**
|
|
391
|
-
* @license lucide-react v0.511.0 - ISC
|
|
392
|
-
*
|
|
393
|
-
* This source code is licensed under the ISC license.
|
|
394
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
395
|
-
*/const WT=[["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"}]],C1=ke("monitor",WT);/**
|
|
396
|
-
* @license lucide-react v0.511.0 - ISC
|
|
397
|
-
*
|
|
398
|
-
* This source code is licensed under the ISC license.
|
|
399
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
400
|
-
*/const $T=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],eR=ke("moon",$T);/**
|
|
401
|
-
* @license lucide-react v0.511.0 - ISC
|
|
402
|
-
*
|
|
403
|
-
* This source code is licensed under the ISC license.
|
|
404
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
405
|
-
*/const tR=[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 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.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]],Mm=ke("package",tR);/**
|
|
406
|
-
* @license lucide-react v0.511.0 - ISC
|
|
407
|
-
*
|
|
408
|
-
* This source code is licensed under the ISC license.
|
|
409
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
410
|
-
*/const nR=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],aR=ke("pause",nR);/**
|
|
411
|
-
* @license lucide-react v0.511.0 - ISC
|
|
412
|
-
*
|
|
413
|
-
* This source code is licensed under the ISC license.
|
|
414
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
415
|
-
*/const sR=[["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"}]],rR=ke("pencil",sR);/**
|
|
416
|
-
* @license lucide-react v0.511.0 - ISC
|
|
417
|
-
*
|
|
418
|
-
* This source code is licensed under the ISC license.
|
|
419
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
420
|
-
*/const iR=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],dv=ke("play",iR);/**
|
|
421
|
-
* @license lucide-react v0.511.0 - ISC
|
|
422
|
-
*
|
|
423
|
-
* This source code is licensed under the ISC license.
|
|
424
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
425
|
-
*/const lR=[["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"}]],D6=ke("plug",lR);/**
|
|
426
|
-
* @license lucide-react v0.511.0 - ISC
|
|
427
|
-
*
|
|
428
|
-
* This source code is licensed under the ISC license.
|
|
429
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
430
|
-
*/const oR=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=ke("plus",oR);/**
|
|
431
|
-
* @license lucide-react v0.511.0 - ISC
|
|
432
|
-
*
|
|
433
|
-
* This source code is licensed under the ISC license.
|
|
434
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
435
|
-
*/const cR=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],w1=ke("puzzle",cR);/**
|
|
436
|
-
* @license lucide-react v0.511.0 - ISC
|
|
437
|
-
*
|
|
438
|
-
* This source code is licensed under the ISC license.
|
|
439
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
440
|
-
*/const uR=[["path",{d:"M4.9 19.1C1 15.2 1 8.8 4.9 4.9",key:"1vaf9d"}],["path",{d:"M7.8 16.2c-2.3-2.3-2.3-6.1 0-8.5",key:"u1ii0m"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M16.2 7.8c2.3 2.3 2.3 6.1 0 8.5",key:"1j5fej"}],["path",{d:"M19.1 4.9C23 8.8 23 15.1 19.1 19",key:"10b0cb"}]],fv=ke("radio",uR);/**
|
|
441
|
-
* @license lucide-react v0.511.0 - ISC
|
|
442
|
-
*
|
|
443
|
-
* This source code is licensed under the ISC license.
|
|
444
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
445
|
-
*/const dR=[["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"}]],Am=ke("refresh-cw",dR);/**
|
|
446
|
-
* @license lucide-react v0.511.0 - ISC
|
|
447
|
-
*
|
|
448
|
-
* This source code is licensed under the ISC license.
|
|
449
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
450
|
-
*/const fR=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],z6=ke("save",fR);/**
|
|
451
|
-
* @license lucide-react v0.511.0 - ISC
|
|
452
|
-
*
|
|
453
|
-
* This source code is licensed under the ISC license.
|
|
454
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
455
|
-
*/const hR=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Zm=ke("scroll-text",hR);/**
|
|
456
|
-
* @license lucide-react v0.511.0 - ISC
|
|
457
|
-
*
|
|
458
|
-
* This source code is licensed under the ISC license.
|
|
459
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
460
|
-
*/const pR=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],hv=ke("search",pR);/**
|
|
461
|
-
* @license lucide-react v0.511.0 - ISC
|
|
462
|
-
*
|
|
463
|
-
* This source code is licensed under the ISC license.
|
|
464
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
465
|
-
*/const mR=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],E1=ke("server",mR);/**
|
|
466
|
-
* @license lucide-react v0.511.0 - ISC
|
|
467
|
-
*
|
|
468
|
-
* This source code is licensed under the ISC license.
|
|
469
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
470
|
-
*/const gR=[["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"}]],Im=ke("settings",gR);/**
|
|
471
|
-
* @license lucide-react v0.511.0 - ISC
|
|
472
|
-
*
|
|
473
|
-
* This source code is licensed under the ISC license.
|
|
474
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
475
|
-
*/const yR=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m14.5 9.5-5 5",key:"17q4r4"}],["path",{d:"m9.5 9.5 5 5",key:"18nt4w"}]],xR=ke("shield-x",yR);/**
|
|
476
|
-
* @license lucide-react v0.511.0 - ISC
|
|
477
|
-
*
|
|
478
|
-
* This source code is licensed under the ISC license.
|
|
479
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
480
|
-
*/const bR=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],k6=ke("square",bR);/**
|
|
481
|
-
* @license lucide-react v0.511.0 - ISC
|
|
482
|
-
*
|
|
483
|
-
* This source code is licensed under the ISC license.
|
|
484
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
485
|
-
*/const vR=[["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"}]],SR=ke("sun",vR);/**
|
|
486
|
-
* @license lucide-react v0.511.0 - ISC
|
|
487
|
-
*
|
|
488
|
-
* This source code is licensed under the ISC license.
|
|
489
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
490
|
-
*/const NR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],_R=ke("terminal",NR);/**
|
|
491
|
-
* @license lucide-react v0.511.0 - ISC
|
|
492
|
-
*
|
|
493
|
-
* This source code is licensed under the ISC license.
|
|
494
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
495
|
-
*/const jR=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],CR=ke("toggle-left",jR);/**
|
|
496
|
-
* @license lucide-react v0.511.0 - ISC
|
|
497
|
-
*
|
|
498
|
-
* This source code is licensed under the ISC license.
|
|
499
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
500
|
-
*/const wR=[["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"}]],Jm=ke("trash-2",wR);/**
|
|
501
|
-
* @license lucide-react v0.511.0 - ISC
|
|
502
|
-
*
|
|
503
|
-
* This source code is licensed under the ISC license.
|
|
504
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
505
|
-
*/const ER=[["path",{d:"m17 14 3 3.3a1 1 0 0 1-.7 1.7H4.7a1 1 0 0 1-.7-1.7L7 14h-.3a1 1 0 0 1-.7-1.7L9 9h-.2A1 1 0 0 1 8 7.3L12 3l4 4.3a1 1 0 0 1-.8 1.7H15l3 3.3a1 1 0 0 1-.7 1.7H17Z",key:"cpyugq"}],["path",{d:"M12 22v-3",key:"kmzjlo"}]],TR=ke("tree-pine",ER);/**
|
|
506
|
-
* @license lucide-react v0.511.0 - ISC
|
|
507
|
-
*
|
|
508
|
-
* This source code is licensed under the ISC license.
|
|
509
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
510
|
-
*/const RR=[["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"}]],pv=ke("triangle-alert",RR);/**
|
|
511
|
-
* @license lucide-react v0.511.0 - ISC
|
|
512
|
-
*
|
|
513
|
-
* This source code is licensed under the ISC license.
|
|
514
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
515
|
-
*/const OR=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],L6=ke("upload",OR);/**
|
|
516
|
-
* @license lucide-react v0.511.0 - ISC
|
|
517
|
-
*
|
|
518
|
-
* This source code is licensed under the ISC license.
|
|
519
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
520
|
-
*/const MR=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],AR=ke("user",MR);/**
|
|
521
|
-
* @license lucide-react v0.511.0 - ISC
|
|
522
|
-
*
|
|
523
|
-
* This source code is licensed under the ISC license.
|
|
524
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
525
|
-
*/const DR=[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["path",{d:"M16 3.128a4 4 0 0 1 0 7.744",key:"16gr8j"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}]],zR=ke("users",DR);/**
|
|
526
|
-
* @license lucide-react v0.511.0 - ISC
|
|
527
|
-
*
|
|
528
|
-
* This source code is licensed under the ISC license.
|
|
529
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
530
|
-
*/const kR=[["path",{d:"m16 13 5.223 3.482a.5.5 0 0 0 .777-.416V7.87a.5.5 0 0 0-.752-.432L16 10.5",key:"ftymec"}],["rect",{x:"2",y:"6",width:"14",height:"12",rx:"2",key:"158x01"}]],LR=ke("video",kR);/**
|
|
531
|
-
* @license lucide-react v0.511.0 - ISC
|
|
532
|
-
*
|
|
533
|
-
* This source code is licensed under the ISC license.
|
|
534
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
535
|
-
*/const UR=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}],["path",{d:"M5 12.859a10 10 0 0 1 5.17-2.69",key:"1dl1wf"}],["path",{d:"M19 12.859a10 10 0 0 0-2.007-1.523",key:"4k23kn"}],["path",{d:"M2 8.82a15 15 0 0 1 4.177-2.643",key:"1grhjp"}],["path",{d:"M22 8.82a15 15 0 0 0-11.288-3.764",key:"z3jwby"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],qR=ke("wifi-off",UR);/**
|
|
536
|
-
* @license lucide-react v0.511.0 - ISC
|
|
537
|
-
*
|
|
538
|
-
* This source code is licensed under the ISC license.
|
|
539
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
540
|
-
*/const HR=[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]],m3=ke("wifi",HR);/**
|
|
541
|
-
* @license lucide-react v0.511.0 - ISC
|
|
542
|
-
*
|
|
543
|
-
* This source code is licensed under the ISC license.
|
|
544
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
545
|
-
*/const BR=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],GR=ke("workflow",BR);/**
|
|
546
|
-
* @license lucide-react v0.511.0 - ISC
|
|
547
|
-
*
|
|
548
|
-
* This source code is licensed under the ISC license.
|
|
549
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
550
|
-
*/const PR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],bl=ke("x",PR);/**
|
|
551
|
-
* @license lucide-react v0.511.0 - ISC
|
|
552
|
-
*
|
|
553
|
-
* This source code is licensed under the ISC license.
|
|
554
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
555
|
-
*/const YR=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]],U6=ke("wrench",YR);var g3={};const at=t=>typeof t=="string",Kp=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},y3=t=>t==null?"":""+t,VR=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},QR=/###/g,x3=t=>t&&t.indexOf("###")>-1?t.replace(QR,"."):t,b3=t=>!t||at(t),gm=(t,e,n)=>{const s=at(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(b3(t))return{};const o=x3(s[i]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++i}return b3(t)?{}:{obj:t,k:x3(s[i])}},v3=(t,e,n)=>{const{obj:s,k:i}=gm(t,e,Object);if(s!==void 0||e.length===1){s[i]=n;return}let o=e[e.length-1],d=e.slice(0,e.length-1),f=gm(t,d,Object);for(;f.obj===void 0&&d.length;)o=`${d[d.length-1]}.${o}`,d=d.slice(0,d.length-1),f=gm(t,d,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},KR=(t,e,n,s)=>{const{obj:i,k:o}=gm(t,e,Object);i[o]=i[o]||[],i[o].push(n)},T1=(t,e)=>{const{obj:n,k:s}=gm(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},XR=(t,e,n)=>{const s=T1(t,n);return s!==void 0?s:T1(e,n)},q6=(t,e,n)=>{for(const s in e)s!=="__proto__"&&s!=="constructor"&&(s in t?at(t[s])||t[s]instanceof String||at(e[s])||e[s]instanceof String?n&&(t[s]=e[s]):q6(t[s],e[s],n):t[s]=e[s]);return t},Du=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var FR={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const ZR=t=>at(t)?t.replace(/[&<>"'\/]/g,e=>FR[e]):t;class IR{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const s=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,s),this.regExpQueue.push(e),s}}const JR=[" ",",","?","!",";"],WR=new IR(20),$R=(t,e,n)=>{e=e||"",n=n||"";const s=JR.filter(d=>e.indexOf(d)<0&&n.indexOf(d)<0);if(s.length===0)return!0;const i=WR.getRegExp(`(${s.map(d=>d==="?"?"\\?":d).join("|")})`);let o=!i.test(t);if(!o){const d=t.indexOf(n);d>0&&!i.test(t.substring(0,d))&&(o=!0)}return o},vb=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const s=e.split(n);let i=t;for(let o=0;o<s.length;){if(!i||typeof i!="object")return;let d,f="";for(let p=o;p<s.length;++p)if(p!==o&&(f+=n),f+=s[p],d=i[f],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&p<s.length-1)continue;o+=p-o+1;break}i=d}return i},Dm=t=>t==null?void 0:t.replace(/_/g,"-"),eO={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,s;(s=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||s.call(n,console,e)}};class R1{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||eO,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,s,i){return i&&!this.debug?null:(at(e[0])&&(e[0]=`${s}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new R1(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new R1(this.logger,e)}}var fl=new R1;class F1{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(s=>{this.observers[s]||(this.observers[s]=new Map);const i=this.observers[s].get(n)||0;this.observers[s].set(n,i+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([i,o])=>{for(let d=0;d<o;d++)i.apply(i,[e,...n])})}}class S3 extends F1{constructor(e,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=e||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(e){this.options.ns.indexOf(e)<0&&this.options.ns.push(e)}removeNamespaces(e){const n=this.options.ns.indexOf(e);n>-1&&this.options.ns.splice(n,1)}getResource(e,n,s,i={}){var y,b;const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,d=i.ignoreJSONStructure!==void 0?i.ignoreJSONStructure:this.options.ignoreJSONStructure;let f;e.indexOf(".")>-1?f=e.split("."):(f=[e,n],s&&(Array.isArray(s)?f.push(...s):at(s)&&o?f.push(...s.split(o)):f.push(s)));const p=T1(this.data,f);return!p&&!n&&!s&&e.indexOf(".")>-1&&(e=f[0],n=f[1],s=f.slice(2).join(".")),p||!d||!at(s)?p:vb((b=(y=this.data)==null?void 0:y[e])==null?void 0:b[n],s,o)}addResource(e,n,s,i,o={silent:!1}){const d=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let f=[e,n];s&&(f=f.concat(d?s.split(d):s)),e.indexOf(".")>-1&&(f=e.split("."),i=n,n=f[1]),this.addNamespaces(n),v3(this.data,f,i),o.silent||this.emit("added",e,n,s,i)}addResources(e,n,s,i={silent:!1}){for(const o in s)(at(s[o])||Array.isArray(s[o]))&&this.addResource(e,n,o,s[o],{silent:!0});i.silent||this.emit("added",e,n,s)}addResourceBundle(e,n,s,i,o,d={silent:!1,skipCopy:!1}){let f=[e,n];e.indexOf(".")>-1&&(f=e.split("."),i=s,s=n,n=f[1]),this.addNamespaces(n);let p=T1(this.data,f)||{};d.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?q6(p,s,o):p={...p,...s},v3(this.data,f,p),d.silent||this.emit("added",e,n,s)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(i=>n[i]&&Object.keys(n[i]).length>0)}toJSON(){return this.data}}var H6={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,s,i){return t.forEach(o=>{var d;e=((d=this.processors[o])==null?void 0:d.process(e,n,s,i))??e}),e}};const B6=Symbol("i18next/PATH_KEY");function tO(){const t=[],e=Object.create(null);let n;return e.get=(s,i)=>{var o;return(o=n==null?void 0:n.revoke)==null||o.call(n),i===B6?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function kf(t,e){const{[B6]:n}=t(tO()),s=(e==null?void 0:e.keySeparator)??".",i=(e==null?void 0:e.nsSeparator)??":";if(n.length>1&&i){const o=e==null?void 0:e.ns,d=Array.isArray(o)?o:null;if(d&&d.length>1&&d.slice(1).includes(n[0]))return`${n[0]}${i}${n.slice(1).join(s)}`}return n.join(s)}const N3={},lx=t=>!at(t)&&typeof t!="boolean"&&typeof t!="number";class O1 extends F1{constructor(e,n={}){super(),VR(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=fl.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const s={...n};if(e==null)return!1;const i=this.resolve(e,s);if((i==null?void 0:i.res)===void 0)return!1;const o=lx(i.res);return!(s.returnObjects===!1&&o)}extractFromKey(e,n){let s=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;s===void 0&&(s=":");const i=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const d=s&&e.indexOf(s)>-1,f=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!$R(e,s,i);if(d&&!f){const p=e.match(this.interpolator.nestingRegexp);if(p&&p.length>0)return{key:e,namespaces:at(o)?[o]:o};const y=e.split(s);(s!==i||s===i&&this.options.ns.indexOf(y[0])>-1)&&(o=y.shift()),e=y.join(i)}return{key:e,namespaces:at(o)?[o]:o}}translate(e,n,s){let i=typeof n=="object"?{...n}:n;if(typeof i!="object"&&this.options.overloadTranslationOptionHandler&&(i=this.options.overloadTranslationOptionHandler(arguments)),typeof i=="object"&&(i={...i}),i||(i={}),e==null)return"";typeof e=="function"&&(e=kf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(J=>typeof J=="function"?kf(J,{...this.options,...i}):String(J));const o=i.returnDetails!==void 0?i.returnDetails:this.options.returnDetails,d=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator,{key:f,namespaces:p}=this.extractFromKey(e[e.length-1],i),y=p[p.length-1];let b=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;b===void 0&&(b=":");const v=i.lng||this.language,_=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((v==null?void 0:v.toLowerCase())==="cimode")return _?o?{res:`${y}${b}${f}`,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:`${y}${b}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:v,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:f;const C=this.resolve(e,i);let w=C==null?void 0:C.res;const T=(C==null?void 0:C.usedKey)||f,R=(C==null?void 0:C.exactUsedKey)||f,O=["[object Number]","[object Function]","[object RegExp]"],M=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!at(i.count),P=O1.hasDefaultValue(i),q=k?this.pluralResolver.getSuffix(v,i.count,i):"",L=i.ordinal&&k?this.pluralResolver.getSuffix(v,i.count,{ordinal:!1}):"",U=k&&!i.ordinal&&i.count===0,V=U&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${q}`]||i[`defaultValue${L}`]||i.defaultValue;let F=w;z&&!w&&P&&(F=V);const re=lx(F),ne=Object.prototype.toString.apply(F);if(z&&F&&re&&O.indexOf(ne)<0&&!(at(M)&&Array.isArray(F))){if(!i.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const J=this.options.returnedObjectHandler?this.options.returnedObjectHandler(T,F,{...i,ns:p}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(C.res=J,C.usedParams=this.getUsedParamsDetails(i),C):J}if(d){const J=Array.isArray(F),ie=J?[]:{},ce=J?R:T;for(const Y in F)if(Object.prototype.hasOwnProperty.call(F,Y)){const $=`${ce}${d}${Y}`;P&&!w?ie[Y]=this.translate($,{...i,defaultValue:lx(V)?V[Y]:void 0,joinArrays:!1,ns:p}):ie[Y]=this.translate($,{...i,joinArrays:!1,ns:p}),ie[Y]===$&&(ie[Y]=F[Y])}w=ie}}else if(z&&at(M)&&Array.isArray(w))w=w.join(M),w&&(w=this.extendTranslation(w,e,i,s));else{let J=!1,ie=!1;!this.isValidLookup(w)&&P&&(J=!0,w=V),this.isValidLookup(w)||(ie=!0,w=f);const Y=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&ie?void 0:w,$=P&&V!==w&&this.options.updateMissing;if(ie||J||$){if(this.logger.log($?"updateKey":"missingKey",v,y,f,$?V:w),d){const G=this.resolve(f,{...i,keySeparator:!1});G&&G.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let ae=[];const je=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&je&&je[0])for(let G=0;G<je.length;G++)ae.push(je[G]);else this.options.saveMissingTo==="all"?ae=this.languageUtils.toResolveHierarchy(i.lng||this.language):ae.push(i.lng||this.language);const he=(G,W,fe)=>{var _e;const be=P&&fe!==w?fe:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(G,y,W,be,$,i):(_e=this.backendConnector)!=null&&_e.saveMissing&&this.backendConnector.saveMissing(G,y,W,be,$,i),this.emit("missingKey",G,y,W,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ae.forEach(G=>{const W=this.pluralResolver.getSuffixes(G,i);U&&i[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(fe=>{he([G],f+fe,i[`defaultValue${fe}`]||V)})}):he(ae,f,V))}w=this.extendTranslation(w,e,i,C,s),ie&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${y}${b}${f}`),(ie||J)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${b}${f}`:f,J?w:void 0,i))}return o?(C.res=w,C.usedParams=this.getUsedParamsDetails(i),C):w}extendTranslation(e,n,s,i,o){var p,y;if((p=this.i18nFormat)!=null&&p.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...s},s.lng||this.language||i.usedLng,i.usedNS,i.usedKey,{resolved:i});else if(!s.skipInterpolation){s.interpolation&&this.interpolator.init({...s,interpolation:{...this.options.interpolation,...s.interpolation}});const b=at(e)&&(((y=s==null?void 0:s.interpolation)==null?void 0:y.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let v;if(b){const C=e.match(this.interpolator.nestingRegexp);v=C&&C.length}let _=s.replace&&!at(s.replace)?s.replace:s;if(this.options.interpolation.defaultVariables&&(_={...this.options.interpolation.defaultVariables,..._}),e=this.interpolator.interpolate(e,_,s.lng||this.language||i.usedLng,s),b){const C=e.match(this.interpolator.nestingRegexp),w=C&&C.length;v<w&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...C)=>(o==null?void 0:o[0])===C[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${C[0]} in key: ${n[0]}`),null):this.translate(...C,n),s)),s.interpolation&&this.interpolator.reset()}const d=s.postProcess||this.options.postProcess,f=at(d)?[d]:d;return e!=null&&(f!=null&&f.length)&&s.applyPostProcessor!==!1&&(e=H6.handle(f,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...i,usedParams:this.getUsedParamsDetails(s)},...s}:s,this)),e}resolve(e,n={}){let s,i,o,d,f;return at(e)&&(e=[e]),Array.isArray(e)&&(e=e.map(p=>typeof p=="function"?kf(p,{...this.options,...n}):p)),e.forEach(p=>{if(this.isValidLookup(s))return;const y=this.extractFromKey(p,n),b=y.key;i=b;let v=y.namespaces;this.options.fallbackNS&&(v=v.concat(this.options.fallbackNS));const _=n.count!==void 0&&!at(n.count),C=_&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",T=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);v.forEach(R=>{var O,M;this.isValidLookup(s)||(f=R,!N3[`${T[0]}-${R}`]&&((O=this.utils)!=null&&O.hasLoadedNamespace)&&!((M=this.utils)!=null&&M.hasLoadedNamespace(f))&&(N3[`${T[0]}-${R}`]=!0,this.logger.warn(`key "${i}" for languages "${T.join(", ")}" won't get resolved as namespace "${f}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),T.forEach(z=>{var q;if(this.isValidLookup(s))return;d=z;const k=[b];if((q=this.i18nFormat)!=null&&q.addLookupKeys)this.i18nFormat.addLookupKeys(k,b,z,R,n);else{let L;_&&(L=this.pluralResolver.getSuffix(z,n.count,n));const U=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(n.ordinal&&L.indexOf(V)===0&&k.push(b+L.replace(V,this.options.pluralSeparator)),k.push(b+L),C&&k.push(b+U)),w){const F=`${b}${this.options.contextSeparator||"_"}${n.context}`;k.push(F),_&&(n.ordinal&&L.indexOf(V)===0&&k.push(F+L.replace(V,this.options.pluralSeparator)),k.push(F+L),C&&k.push(F+U))}}let P;for(;P=k.pop();)this.isValidLookup(s)||(o=P,s=this.getResource(z,R,P,n))}))})}),{res:s,usedKey:i,exactUsedKey:o,usedLng:d,usedNS:f}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,s,i={}){var o;return(o=this.i18nFormat)!=null&&o.getResource?this.i18nFormat.getResource(e,n,s,i):this.resourceStore.getResource(e,n,s,i)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],s=e.replace&&!at(e.replace);let i=s?e.replace:e;if(s&&typeof e.count<"u"&&(i.count=e.count),this.options.interpolation.defaultVariables&&(i={...this.options.interpolation.defaultVariables,...i}),!s){i={...i};for(const o of n)delete i[o]}return i}static hasDefaultValue(e){const n="defaultValue";for(const s in e)if(Object.prototype.hasOwnProperty.call(e,s)&&n===s.substring(0,n.length)&&e[s]!==void 0)return!0;return!1}}class _3{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=fl.create("languageUtils")}getScriptPartFromCode(e){if(e=Dm(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=Dm(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(at(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(s=>{if(n)return;const i=this.formatLanguageCode(s);(!this.options.supportedLngs||this.isSupportedCode(i))&&(n=i)}),!n&&this.options.supportedLngs&&e.forEach(s=>{if(n)return;const i=this.getScriptPartFromCode(s);if(this.isSupportedCode(i))return n=i;const o=this.getLanguagePartFromCode(s);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(d=>{if(d===o)return d;if(!(d.indexOf("-")<0&&o.indexOf("-")<0)&&(d.indexOf("-")>0&&o.indexOf("-")<0&&d.substring(0,d.indexOf("-"))===o||d.indexOf(o)===0&&o.length>1))return d})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),at(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let s=e[n];return s||(s=e[this.getScriptPartFromCode(n)]),s||(s=e[this.formatLanguageCode(n)]),s||(s=e[this.getLanguagePartFromCode(n)]),s||(s=e.default),s||[]}toResolveHierarchy(e,n){const s=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),i=[],o=d=>{d&&(this.isSupportedCode(d)?i.push(d):this.logger.warn(`rejecting language code not found in supportedLngs: ${d}`))};return at(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(e))):at(e)&&o(this.formatLanguageCode(e)),s.forEach(d=>{i.indexOf(d)<0&&o(this.formatLanguageCode(d))}),i}}const j3={zero:0,one:1,two:2,few:3,many:4,other:5},C3={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class nO{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=fl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=Dm(e==="dev"?"en":e),i=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:s,type:i});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let d;try{d=new Intl.PluralRules(s,{type:i})}catch{if(typeof Intl>"u")return this.logger.error("No Intl support, please use an Intl polyfill!"),C3;if(!e.match(/-|_/))return C3;const p=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(p,n)}return this.pluralRulesCache[o]=d,d}needsPlural(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),(s==null?void 0:s.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,s={}){return this.getSuffixes(e,s).map(i=>`${n}${i}`)}getSuffixes(e,n={}){let s=this.getRule(e,n);return s||(s=this.getRule("dev",n)),s?s.resolvedOptions().pluralCategories.sort((i,o)=>j3[i]-j3[o]).map(i=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${i}`):[]}getSuffix(e,n,s={}){const i=this.getRule(e,s);return i?`${this.options.prepend}${s.ordinal?`ordinal${this.options.prepend}`:""}${i.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,s))}}const w3=(t,e,n,s=".",i=!0)=>{let o=XR(t,e,n);return!o&&i&&at(n)&&(o=vb(t,n,s),o===void 0&&(o=vb(e,n,s))),o},ox=t=>t.replace(/\$/g,"$$$$");class E3{constructor(e={}){var n;this.logger=fl.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(s=>s),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:s,useRawValueToEscape:i,prefix:o,prefixEscaped:d,suffix:f,suffixEscaped:p,formatSeparator:y,unescapeSuffix:b,unescapePrefix:v,nestingPrefix:_,nestingPrefixEscaped:C,nestingSuffix:w,nestingSuffixEscaped:T,nestingOptionsSeparator:R,maxReplaces:O,alwaysFormat:M}=e.interpolation;this.escape=n!==void 0?n:ZR,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Du(o):d||"{{",this.suffix=f?Du(f):p||"}}",this.formatSeparator=y||",",this.unescapePrefix=b?"":v||"-",this.unescapeSuffix=this.unescapePrefix?"":b||"",this.nestingPrefix=_?Du(_):C||Du("$t("),this.nestingSuffix=w?Du(w):T||Du(")"),this.nestingOptionsSeparator=R||",",this.maxReplaces=O||1e3,this.alwaysFormat=M!==void 0?M:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,s)=>(n==null?void 0:n.source)===s?(n.lastIndex=0,n):new RegExp(s,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,s,i){var C;let o,d,f;const p=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=w=>{if(w.indexOf(this.formatSeparator)<0){const M=w3(n,p,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(M,void 0,s,{...i,...n,interpolationkey:w}):M}const T=w.split(this.formatSeparator),R=T.shift().trim(),O=T.join(this.formatSeparator).trim();return this.format(w3(n,p,R,this.options.keySeparator,this.options.ignoreJSONStructure),O,s,{...i,...n,interpolationkey:R})};this.resetRegExp();const b=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,v=((C=i==null?void 0:i.interpolation)==null?void 0:C.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>ox(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?ox(this.escape(w)):ox(w)}].forEach(w=>{for(f=0;o=w.regex.exec(e);){const T=o[1].trim();if(d=y(T),d===void 0)if(typeof b=="function"){const O=b(e,o,i);d=at(O)?O:""}else if(i&&Object.prototype.hasOwnProperty.call(i,T))d="";else if(v){d=o[0];continue}else this.logger.warn(`missed to pass in variable ${T} for interpolating ${e}`),d="";else!at(d)&&!this.useRawValueToEscape&&(d=y3(d));const R=w.safeValue(d);if(e=e.replace(o[0],R),v?(w.regex.lastIndex+=d.length,w.regex.lastIndex-=o[0].length):w.regex.lastIndex=0,f++,f>=this.maxReplaces)break}}),e}nest(e,n,s={}){let i,o,d;const f=(p,y)=>{const b=this.nestingOptionsSeparator;if(p.indexOf(b)<0)return p;const v=p.split(new RegExp(`${Du(b)}[ ]*{`));let _=`{${v[1]}`;p=v[0],_=this.interpolate(_,d);const C=_.match(/'/g),w=_.match(/"/g);(((C==null?void 0:C.length)??0)%2===0&&!w||((w==null?void 0:w.length)??0)%2!==0)&&(_=_.replace(/'/g,'"'));try{d=JSON.parse(_),y&&(d={...y,...d})}catch(T){return this.logger.warn(`failed parsing options string in nesting for key ${p}`,T),`${p}${b}${_}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,p};for(;i=this.nestingRegexp.exec(e);){let p=[];d={...s},d=d.replace&&!at(d.replace)?d.replace:d,d.applyPostProcessor=!1,delete d.defaultValue;const y=/{.*}/.test(i[1])?i[1].lastIndexOf("}")+1:i[1].indexOf(this.formatSeparator);if(y!==-1&&(p=i[1].slice(y).split(this.formatSeparator).map(b=>b.trim()).filter(Boolean),i[1]=i[1].slice(0,y)),o=n(f.call(this,i[1].trim(),d),d),o&&i[0]===e&&!at(o))return o;at(o)||(o=y3(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),p.length&&(o=p.reduce((b,v)=>this.format(b,v,s.lng,{...s,interpolationkey:i[1].trim()}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const aO=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const s=t.split("(");e=s[0].toLowerCase().trim();const i=s[1].substring(0,s[1].length-1);e==="currency"&&i.indexOf(":")<0?n.currency||(n.currency=i.trim()):e==="relativetime"&&i.indexOf(":")<0?n.range||(n.range=i.trim()):i.split(";").forEach(d=>{if(d){const[f,...p]=d.split(":"),y=p.join(":").trim().replace(/^'+|'+$/g,""),b=f.trim();n[b]||(n[b]=y),y==="false"&&(n[b]=!1),y==="true"&&(n[b]=!0),isNaN(y)||(n[b]=parseInt(y,10))}})}return{formatName:e,formatOptions:n}},T3=t=>{const e={};return(n,s,i)=>{let o=i;i&&i.interpolationkey&&i.formatParams&&i.formatParams[i.interpolationkey]&&i[i.interpolationkey]&&(o={...o,[i.interpolationkey]:void 0});const d=s+JSON.stringify(o);let f=e[d];return f||(f=t(Dm(s),i),e[d]=f),f(n)}},sO=t=>(e,n,s)=>t(Dm(n),s)(e);class rO{constructor(e={}){this.logger=fl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?T3:sO;this.formats={number:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o});return f=>d.format(f)}),currency:s((i,o)=>{const d=new Intl.NumberFormat(i,{...o,style:"currency"});return f=>d.format(f)}),datetime:s((i,o)=>{const d=new Intl.DateTimeFormat(i,{...o});return f=>d.format(f)}),relativetime:s((i,o)=>{const d=new Intl.RelativeTimeFormat(i,{...o});return f=>d.format(f,o.range||"day")}),list:s((i,o)=>{const d=new Intl.ListFormat(i,{...o});return f=>d.format(f)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=T3(n)}format(e,n,s,i={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(f=>f.indexOf(")")>-1)){const f=o.findIndex(p=>p.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,p)=>{var v;const{formatName:y,formatOptions:b}=aO(p);if(this.formats[y]){let _=f;try{const C=((v=i==null?void 0:i.formatParams)==null?void 0:v[i.interpolationkey])||{},w=C.locale||C.lng||i.locale||i.lng||s;_=this.formats[y](f,w,{...b,...i,...C})}catch(C){this.logger.warn(C)}return _}else this.logger.warn(`there was no format function for ${y}`);return f},e)}}const iO=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class lO extends F1{constructor(e,n,s,i={}){var o,d;super(),this.backend=e,this.store=n,this.services=s,this.languageUtils=s.languageUtils,this.options=i,this.logger=fl.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=i.maxParallelReads||10,this.readingCalls=0,this.maxRetries=i.maxRetries>=0?i.maxRetries:5,this.retryTimeout=i.retryTimeout>=1?i.retryTimeout:350,this.state={},this.queue=[],(d=(o=this.backend)==null?void 0:o.init)==null||d.call(o,s,i.backend,i)}queueLoad(e,n,s,i){const o={},d={},f={},p={};return e.forEach(y=>{let b=!0;n.forEach(v=>{const _=`${y}|${v}`;!s.reload&&this.store.hasResourceBundle(y,v)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?d[_]===void 0&&(d[_]=!0):(this.state[_]=1,b=!1,d[_]===void 0&&(d[_]=!0),o[_]===void 0&&(o[_]=!0),p[v]===void 0&&(p[v]=!0)))}),b||(f[y]=!0)}),(Object.keys(o).length||Object.keys(d).length)&&this.queue.push({pending:d,pendingCount:Object.keys(d).length,loaded:{},errors:[],callback:i}),{toLoad:Object.keys(o),pending:Object.keys(d),toLoadLanguages:Object.keys(f),toLoadNamespaces:Object.keys(p)}}loaded(e,n,s){const i=e.split("|"),o=i[0],d=i[1];n&&this.emit("failedLoading",o,d,n),!n&&s&&this.store.addResourceBundle(o,d,s,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&s&&(this.state[e]=0);const f={};this.queue.forEach(p=>{KR(p.loaded,[o],d),iO(p,e),n&&p.errors.push(n),p.pendingCount===0&&!p.done&&(Object.keys(p.loaded).forEach(y=>{f[y]||(f[y]={});const b=p.loaded[y];b.length&&b.forEach(v=>{f[y][v]===void 0&&(f[y][v]=!0)})}),p.done=!0,p.errors.length?p.callback(p.errors):p.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(p=>!p.done)}read(e,n,s,i=0,o=this.retryTimeout,d){if(!e.length)return d(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:s,tried:i,wait:o,callback:d});return}this.readingCalls++;const f=(y,b)=>{if(this.readingCalls--,this.waitingReads.length>0){const v=this.waitingReads.shift();this.read(v.lng,v.ns,v.fcName,v.tried,v.wait,v.callback)}if(y&&b&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,o*2,d)},o);return}d(y,b)},p=this.backend[s].bind(this.backend);if(p.length===2){try{const y=p(e,n);y&&typeof y.then=="function"?y.then(b=>f(null,b)).catch(f):f(null,y)}catch(y){f(y)}return}return p(e,n,f)}prepareLoading(e,n,s={},i){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),i&&i();at(e)&&(e=this.languageUtils.toResolveHierarchy(e)),at(n)&&(n=[n]);const o=this.queueLoad(e,n,s,i);if(!o.toLoad.length)return o.pending.length||i(),null;o.toLoad.forEach(d=>{this.loadOne(d)})}load(e,n,s){this.prepareLoading(e,n,{},s)}reload(e,n,s){this.prepareLoading(e,n,{reload:!0},s)}loadOne(e,n=""){const s=e.split("|"),i=s[0],o=s[1];this.read(i,o,"read",void 0,void 0,(d,f)=>{d&&this.logger.warn(`${n}loading namespace ${o} for language ${i} failed`,d),!d&&f&&this.logger.log(`${n}loaded namespace ${o} for language ${i}`,f),this.loaded(e,d,f)})}saveMissing(e,n,s,i,o,d={},f=()=>{}){var p,y,b,v,_;if((y=(p=this.services)==null?void 0:p.utils)!=null&&y.hasLoadedNamespace&&!((v=(b=this.services)==null?void 0:b.utils)!=null&&v.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${s}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(s==null||s==="")){if((_=this.backend)!=null&&_.create){const C={...d,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let T;w.length===5?T=w(e,n,s,i,C):T=w(e,n,s,i),T&&typeof T.then=="function"?T.then(R=>f(null,R)).catch(f):f(null,T)}catch(T){f(T)}else w(e,n,s,i,f,C)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const cx=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),at(t[1])&&(e.defaultValue=t[1]),at(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(s=>{e[s]=n[s]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),R3=t=>{var e,n;return at(t.ns)&&(t.ns=[t.ns]),at(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),at(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},Q0=()=>{},oO=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},G6="__i18next_supportNoticeShown",cO=()=>!!(typeof globalThis<"u"&&globalThis[G6]||typeof process<"u"&&g3&&g3.I18NEXT_NO_SUPPORT_NOTICE),uO=()=>{typeof globalThis<"u"&&(globalThis[G6]=!0)},dO=t=>{var e,n,s,i,o,d,f,p,y,b,v,_,C;return!!(((s=(n=(e=t==null?void 0:t.modules)==null?void 0:e.backend)==null?void 0:n.name)==null?void 0:s.indexOf("Locize"))>0||((f=(d=(o=(i=t==null?void 0:t.modules)==null?void 0:i.backend)==null?void 0:o.constructor)==null?void 0:d.name)==null?void 0:f.indexOf("Locize"))>0||(y=(p=t==null?void 0:t.options)==null?void 0:p.backend)!=null&&y.backends&&t.options.backend.backends.some(w=>{var T,R,O;return((T=w==null?void 0:w.name)==null?void 0:T.indexOf("Locize"))>0||((O=(R=w==null?void 0:w.constructor)==null?void 0:R.name)==null?void 0:O.indexOf("Locize"))>0})||(v=(b=t==null?void 0:t.options)==null?void 0:b.backend)!=null&&v.projectId||(C=(_=t==null?void 0:t.options)==null?void 0:_.backend)!=null&&C.backendOptions&&t.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class ym extends F1{constructor(e={},n){if(super(),this.options=R3(e),this.services={},this.logger=fl,this.modules={external:[]},oO(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(at(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const s=cx();this.options={...s,...this.options,...R3(e)},this.options.interpolation={...s.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=s.overloadTranslationOptionHandler),this.options.showSupportNotice!==!1&&!dO(this)&&!cO()&&(typeof console<"u"&&typeof console.info<"u"&&console.info("🌐 i18next is made possible by our own product, Locize — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com 💙"),uO());const i=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?fl.init(i(this.modules.logger),this.options):fl.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=rO;const b=new _3(this.options);this.store=new S3(this.options.resources,this.options);const v=this.services;v.logger=fl,v.resourceStore=this.store,v.languageUtils=b,v.pluralResolver=new nO(b,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==s.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),y&&(!this.options.interpolation.format||this.options.interpolation.format===s.interpolation.format)&&(v.formatter=i(y),v.formatter.init&&v.formatter.init(v,this.options),this.options.interpolation.format=v.formatter.format.bind(v.formatter)),v.interpolator=new E3(this.options),v.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},v.backendConnector=new lO(i(this.modules.backend),v.resourceStore,v,this.options),v.backendConnector.on("*",(C,...w)=>{this.emit(C,...w)}),this.modules.languageDetector&&(v.languageDetector=i(this.modules.languageDetector),v.languageDetector.init&&v.languageDetector.init(v,this.options.detection,this.options)),this.modules.i18nFormat&&(v.i18nFormat=i(this.modules.i18nFormat),v.i18nFormat.init&&v.i18nFormat.init(this)),this.translator=new O1(this.services,this.options),this.translator.on("*",(C,...w)=>{this.emit(C,...w)}),this.modules.external.forEach(C=>{C.init&&C.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Q0),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const y=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);y.length>0&&y[0]!=="dev"&&(this.options.lng=y[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(y=>{this[y]=(...b)=>this.store[y](...b)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...b)=>(this.store[y](...b),this)});const f=Kp(),p=()=>{const y=(b,v)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),f.resolve(v),n(b,v)};if(this.languages&&!this.isInitialized)return y(null,this.t.bind(this));this.changeLanguage(this.options.lng,y)};return this.options.resources||!this.options.initAsync?p():setTimeout(p,0),f}loadResources(e,n=Q0){var o,d;let s=n;const i=at(e)?e:this.language;if(typeof e=="function"&&(s=e),!this.options.resources||this.options.partialBundledLanguages){if((i==null?void 0:i.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return s();const f=[],p=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(v=>{v!=="cimode"&&f.indexOf(v)<0&&f.push(v)})};i?p(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(b=>p(b)),(d=(o=this.options.preload)==null?void 0:o.forEach)==null||d.call(o,y=>p(y)),this.services.backendConnector.load(f,this.options.ns,y=>{!y&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),s(y)})}else s(null)}reloadResources(e,n,s){const i=Kp();return typeof e=="function"&&(s=e,e=void 0),typeof n=="function"&&(s=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),s||(s=Q0),this.services.backendConnector.reload(e,n,o=>{i.resolve(),s(o)}),i}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&H6.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n<this.languages.length;n++){const s=this.languages[n];if(!(["cimode","dev"].indexOf(s)>-1)&&this.store.hasLanguageSomeTranslations(s)){this.resolvedLanguage=s;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const s=Kp();this.emit("languageChanging",e);const i=f=>{this.language=f,this.languages=this.services.languageUtils.toResolveHierarchy(f),this.resolvedLanguage=void 0,this.setResolvedLanguage(f)},o=(f,p)=>{p?this.isLanguageChangingTo===e&&(i(p),this.translator.changeLanguage(p),this.isLanguageChangingTo=void 0,this.emit("languageChanged",p),this.logger.log("languageChanged",p)):this.isLanguageChangingTo=void 0,s.resolve((...y)=>this.t(...y)),n&&n(f,(...y)=>this.t(...y))},d=f=>{var b,v;!e&&!f&&this.services.languageDetector&&(f=[]);const p=at(f)?f:f&&f[0],y=this.store.hasLanguageSomeTranslations(p)?p:this.services.languageUtils.getBestMatchFromCodes(at(f)?[f]:f);y&&(this.language||i(y),this.translator.language||this.translator.changeLanguage(y),(v=(b=this.services.languageDetector)==null?void 0:b.cacheUserLanguage)==null||v.call(b,y)),this.loadResources(y,_=>{o(_,y)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?d(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(d):this.services.languageDetector.detect(d):d(e),s}getFixedT(e,n,s){const i=(o,d,...f)=>{let p;typeof d!="object"?p=this.options.overloadTranslationOptionHandler([o,d].concat(f)):p={...d},p.lng=p.lng||i.lng,p.lngs=p.lngs||i.lngs,p.ns=p.ns||i.ns,p.keyPrefix!==""&&(p.keyPrefix=p.keyPrefix||s||i.keyPrefix);const y={...this.options,...p};typeof p.keyPrefix=="function"&&(p.keyPrefix=kf(p.keyPrefix,y));const b=this.options.keySeparator||".";let v;return p.keyPrefix&&Array.isArray(o)?v=o.map(_=>(typeof _=="function"&&(_=kf(_,y)),`${p.keyPrefix}${b}${_}`)):(typeof o=="function"&&(o=kf(o,y)),v=p.keyPrefix?`${p.keyPrefix}${b}${o}`:o),this.t(v,p)};return at(e)?i.lng=e:i.lngs=e,i.ns=n,i.keyPrefix=s,i}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const s=n.lng||this.resolvedLanguage||this.languages[0],i=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(s.toLowerCase()==="cimode")return!0;const d=(f,p)=>{const y=this.services.backendConnector.state[`${f}|${p}`];return y===-1||y===0||y===2};if(n.precheck){const f=n.precheck(this,d);if(f!==void 0)return f}return!!(this.hasResourceBundle(s,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||d(s,e)&&(!i||d(o,e)))}loadNamespaces(e,n){const s=Kp();return this.options.ns?(at(e)&&(e=[e]),e.forEach(i=>{this.options.ns.indexOf(i)<0&&this.options.ns.push(i)}),this.loadResources(i=>{s.resolve(),n&&n(i)}),s):(n&&n(),Promise.resolve())}loadLanguages(e,n){const s=Kp();at(e)&&(e=[e]);const i=this.options.preload||[],o=e.filter(d=>i.indexOf(d)<0&&this.services.languageUtils.isSupportedCode(d));return o.length?(this.options.preload=i.concat(o),this.loadResources(d=>{s.resolve(),n&&n(d)}),s):(n&&n(),Promise.resolve())}dir(e){var i,o;if(e||(e=this.resolvedLanguage||(((i=this.languages)==null?void 0:i.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const d=new Intl.Locale(e);if(d&&d.getTextInfo){const f=d.getTextInfo();if(f&&f.direction)return f.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],s=((o=this.services)==null?void 0:o.languageUtils)||new _3(cx());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(s.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){const s=new ym(e,n);return s.createInstance=ym.createInstance,s}cloneInstance(e={},n=Q0){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new ym(i);if((e.debug!==void 0||e.prefix!==void 0)&&(o.logger=o.logger.clone(e)),["store","services","language"].forEach(f=>{o[f]=this[f]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},s){const f=Object.keys(this.store.data).reduce((p,y)=>(p[y]={...this.store.data[y]},p[y]=Object.keys(p[y]).reduce((b,v)=>(b[v]={...p[y][v]},b),p[y]),p),{});o.store=new S3(f,i),o.services.resourceStore=o.store}if(e.interpolation){const p={...cx().interpolation,...this.options.interpolation,...e.interpolation},y={...i,interpolation:p};o.services.interpolator=new E3(y)}return o.translator=new O1(o.services,i),o.translator.on("*",(f,...p)=>{o.emit(f,...p)}),o.init(i,n),o.translator.options=i,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const vs=ym.createInstance();vs.createInstance;vs.dir;vs.init;vs.loadResources;vs.reloadResources;vs.use;vs.changeLanguage;vs.getFixedT;vs.t;vs.exists;vs.setDefaultNamespace;vs.hasLoadedNamespace;vs.loadNamespaces;vs.loadLanguages;const fO=(t,e,n,s)=>{var o,d,f,p;const i=[n,{code:e,...s||{}}];if((d=(o=t==null?void 0:t.services)==null?void 0:o.logger)!=null&&d.forward)return t.services.logger.forward(i,"warn","react-i18next::",!0);Iu(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(p=(f=t==null?void 0:t.services)==null?void 0:f.logger)!=null&&p.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},O3={},Sb=(t,e,n,s)=>{Iu(n)&&O3[n]||(Iu(n)&&(O3[n]=new Date),fO(t,e,n,s))},P6=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},Nb=(t,e,n)=>{t.loadNamespaces(e,P6(t,n))},M3=(t,e,n,s)=>{if(Iu(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return Nb(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,P6(t,s))},hO=(t,e,n={})=>!e.languages||!e.languages.length?(Sb(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(s,i)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&s.services.backendConnector.backend&&s.isLanguageChangingTo&&!i(s.isLanguageChangingTo,t))return!1}}),Iu=t=>typeof t=="string",pO=t=>typeof t=="object"&&t!==null,mO=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,gO={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},yO=t=>gO[t],xO=t=>t.replace(mO,yO);let _b={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:xO,transDefaultProps:void 0};const bO=(t={})=>{_b={..._b,...t}},vO=()=>_b;let Y6;const SO=t=>{Y6=t},NO=()=>Y6,_O={type:"3rdParty",init(t){bO(t.options.react),SO(t)}},jO=D.createContext();class CO{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var ux={exports:{}},dx={};/**
|
|
556
|
-
* @license React
|
|
557
|
-
* use-sync-external-store-shim.production.js
|
|
558
|
-
*
|
|
559
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
560
|
-
*
|
|
561
|
-
* This source code is licensed under the MIT license found in the
|
|
562
|
-
* LICENSE file in the root directory of this source tree.
|
|
563
|
-
*/var A3;function wO(){if(A3)return dx;A3=1;var t=pl();function e(v,_){return v===_&&(v!==0||1/v===1/_)||v!==v&&_!==_}var n=typeof Object.is=="function"?Object.is:e,s=t.useState,i=t.useEffect,o=t.useLayoutEffect,d=t.useDebugValue;function f(v,_){var C=_(),w=s({inst:{value:C,getSnapshot:_}}),T=w[0].inst,R=w[1];return o(function(){T.value=C,T.getSnapshot=_,p(T)&&R({inst:T})},[v,C,_]),i(function(){return p(T)&&R({inst:T}),v(function(){p(T)&&R({inst:T})})},[v]),d(C),C}function p(v){var _=v.getSnapshot;v=v.value;try{var C=_();return!n(v,C)}catch{return!0}}function y(v,_){return _()}var b=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return dx.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:b,dx}var D3;function EO(){return D3||(D3=1,ux.exports=wO()),ux.exports}var TO=EO();const RO=(t,e)=>{if(Iu(e))return e;if(pO(e)&&Iu(e.defaultValue))return e.defaultValue;if(typeof t=="function")return"";if(Array.isArray(t)){const n=t[t.length-1];return typeof n=="function"?"":n}return t},OO={t:RO,ready:!1},MO=()=>()=>{},Er=(t,e={})=>{var V,F,re;const{i18n:n}=e,{i18n:s,defaultNS:i}=D.useContext(jO)||{},o=n||s||NO();o&&!o.reportNamespaces&&(o.reportNamespaces=new CO),o||Sb(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=D.useMemo(()=>{var ne;return{...vO(),...(ne=o==null?void 0:o.options)==null?void 0:ne.react,...e}},[o,e]),{useSuspense:f,keyPrefix:p}=d,y=i||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),b=Iu(y)?[y]:y||["translation"],v=D.useMemo(()=>b,b);(re=(F=o==null?void 0:o.reportNamespaces)==null?void 0:F.addUsedNamespaces)==null||re.call(F,v);const _=D.useRef(0),C=D.useCallback(ne=>{if(!o)return MO;const{bindI18n:J,bindI18nStore:ie}=d,ce=()=>{_.current+=1,ne()};return J&&o.on(J,ce),ie&&o.store.on(ie,ce),()=>{J&&J.split(" ").forEach(Y=>o.off(Y,ce)),ie&&ie.split(" ").forEach(Y=>o.store.off(Y,ce))}},[o,d]),w=D.useRef(),T=D.useCallback(()=>{if(!o)return OO;const ne=!!(o.isInitialized||o.initializedStoreOnce)&&v.every(ae=>hO(ae,o,d)),J=e.lng||o.language,ie=_.current,ce=w.current;if(ce&&ce.ready===ne&&ce.lng===J&&ce.keyPrefix===p&&ce.revision===ie)return ce;const $={t:o.getFixedT(J,d.nsMode==="fallback"?v:v[0],p),ready:ne,lng:J,keyPrefix:p,revision:ie};return w.current=$,$},[o,v,p,d,e.lng]),[R,O]=D.useState(0),{t:M,ready:z}=TO.useSyncExternalStore(C,T,T);D.useEffect(()=>{if(o&&!z&&!f){const ne=()=>O(J=>J+1);e.lng?M3(o,e.lng,v,ne):Nb(o,v,ne)}},[o,e.lng,v,z,f,R]);const k=o||{},P=D.useRef(null),q=D.useRef(),L=ne=>{const J=Object.getOwnPropertyDescriptors(ne);J.__original&&delete J.__original;const ie=Object.create(Object.getPrototypeOf(ne),J);if(!Object.prototype.hasOwnProperty.call(ie,"__original"))try{Object.defineProperty(ie,"__original",{value:ne,writable:!1,enumerable:!1,configurable:!1})}catch{}return ie},U=D.useMemo(()=>{const ne=k,J=ne==null?void 0:ne.language;let ie=ne;ne&&(P.current&&P.current.__original===ne?q.current!==J?(ie=L(ne),P.current=ie,q.current=J):ie=P.current:(ie=L(ne),P.current=ie,q.current=J));const ce=!z&&!f?(...$)=>(Sb(o,"USE_T_BEFORE_READY","useTranslation: t was called before ready. When using useSuspense: false, make sure to check the ready flag before using t."),M(...$)):M,Y=[ce,ie,z];return Y.t=ce,Y.i18n=ie,Y.ready=z,Y},[M,k,z,k.resolvedLanguage,k.language,k.languages]);if(o&&f&&!z)throw new Promise(ne=>{const J=()=>ne();e.lng?M3(o,e.lng,v,J):Nb(o,v,J)});return U};function V6(t){return t.map(e=>({id:e.page.id,addonId:e.addonId,label:e.page.label,icon:e.page.icon,path:e.page.path,bundle:e.page.bundle,bundleUrl:e.bundleUrl}))}const z3=new Map;function AO(){const{pagePath:t}=$b(),e=Om(),{data:n}=ot({queryKey:["addon-pages"],queryFn:async()=>{const p=await e.trpc.addonPages.listPages.query();return V6(p)},staleTime:6e4}),s=n==null?void 0:n.find(p=>p.path===`/addon/${t}`),[i,o]=D.useState(null),[d,f]=D.useState(null);return D.useEffect(()=>{if(!s)return;const p=`${s.addonId}/${s.bundle}`,y=z3.get(p);if(y){o(()=>y);return}f(null),o(null);const b=s.bundleUrl;import(b).then(v=>{const _=v.default;if(typeof _!="function")throw new Error(`Addon page "${s.id}" does not export a default React component`);z3.set(p,_),o(()=>_)}).catch(v=>{console.error(`[AddonPageLoader] Failed to load ${b}:`,v),f(`Failed to load addon page: ${v.message}`)})},[s]),n?s?d?h.jsx("div",{className:"flex items-center justify-center h-full text-red-400 text-sm",children:d}):i?h.jsx(i,{trpc:e.trpc,theme:{isDark:document.documentElement.classList.contains("dark")},navigate:p=>{window.location.href=p}}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})}):h.jsx("div",{className:"flex items-center justify-center h-full text-foreground-subtle",children:"Addon page not found"}):h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"animate-spin h-6 w-6 border-2 border-primary border-t-transparent rounded-full"})})}const DO={dark:eR,light:SR,system:C1},zO={gauge:RT,puzzle:w1,bot:bb,cpu:zf,terminal:_R,box:YE,wrench:U6,activity:cv,plug:D6};function kO(){const t=ml(),e=gl(),{user:n,logout:s}=ov(),i=vS(),{t:o,i18n:d}=Er(),f=Om(),p=$j(),[y,b]=D.useState(!1),{data:v=0}=ot({queryKey:["updates","count"],queryFn:async()=>(await f.trpc.addons.listUpdates.query()).length,staleTime:3e4,refetchInterval:3e4}),{data:_}=ot({queryKey:["addon-pages"],queryFn:async()=>{const P=await f.trpc.addonPages.listPages.query();return V6(P)},staleTime:6e4}),C=()=>{s(),e("/login")},w=P=>t.pathname===P||t.pathname.startsWith(P+"/"),T=()=>{const P=d.language==="en"?"it":"en";d.changeLanguage(P)},R=[{label:o("nav.cameras","Cameras"),icon:Lc,path:"/cameras"},{label:o("nav.integrations"),icon:D6,path:"/integrations"},{label:o("nav.timeline","Timeline"),icon:T6,path:"/timeline"},{label:o("nav.pipeline","Pipeline"),icon:X1,path:"/pipeline"}],O=[{label:o("system.addons"),icon:w1,path:"/system/addons"},{label:o("system.agents","Agents & Processes"),icon:E1,path:"/system/agents"},{label:o("system.logs"),icon:Zm,path:"/system/logs"},{label:o("system.users"),icon:zR,path:"/system/users"},{label:o("system.settings"),icon:U6,path:"/system/settings"}],M=(i==null?void 0:i.mode)??"system",z={dark:o("theme.dark"),light:o("theme.light"),system:o("theme.system")},k=h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"flex h-14 items-center px-3 border-b border-border",children:h.jsx("img",{src:(i==null?void 0:i.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-9"})}),h.jsxs("nav",{className:"flex-1 overflow-y-auto py-3 px-2 space-y-0.5",children:[(()=>{const P=w("/dashboard");return h.jsxs("button",{onClick:()=>{e("/dashboard"),b(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-all ${P?"bg-primary/12 text-primary shadow-sm shadow-primary/5":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(M6,{className:`h-4 w-4 shrink-0 ${P?"text-primary":""}`}),o("nav.dashboard")]})})(),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.camerasSection","Cameras")})}),R.map(P=>{const q=P.icon,L=w(P.path);return h.jsxs("button",{onClick:()=>{e(P.path),b(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${L?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(q,{className:`h-3.5 w-3.5 shrink-0 ${L?"text-primary":""}`}),P.label]},P.path)}),h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("system.title")})}),O.map(P=>{const q=P.icon,L=w(P.path),U=P.path==="/system/addons";return h.jsxs("button",{onClick:()=>{e(P.path),b(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${L?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(q,{className:`h-3.5 w-3.5 shrink-0 ${L?"text-primary":""}`}),h.jsx("span",{className:"flex-1 text-left",children:P.label}),U&&v>0&&h.jsx("span",{className:"ml-auto rounded-full bg-primary px-1.5 py-0.5 text-[9px] font-bold text-primary-foreground leading-none",children:v})]},P.path)}),_&&_.length>0&&h.jsx("div",{className:"pt-4 pb-1.5 px-2.5",children:h.jsx("span",{className:"text-[10px] font-semibold uppercase tracking-widest text-foreground-subtle/60",children:o("nav.addonPages","Addon Pages")})}),_==null?void 0:_.map(P=>{const q=w(P.path),L=zO[P.icon]??w1;return h.jsxs("button",{onClick:()=>{e(P.path),b(!1)},className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${q?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(L,{className:`h-3.5 w-3.5 shrink-0 ${q?"text-primary":""}`}),P.label]},P.id)})]}),h.jsxs("div",{className:"border-t border-border p-2 space-y-0.5",children:[h.jsxs("button",{onClick:T,title:o("language.select"),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[h.jsx(qT,{className:"h-3.5 w-3.5 shrink-0"}),h.jsx("span",{children:d.language==="en"?o("language.en"):o("language.it")})]}),h.jsxs("button",{onClick:()=>i==null?void 0:i.toggleMode(),className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",children:[(()=>{const P=DO[M];return h.jsx(P,{className:"h-3.5 w-3.5"})})(),h.jsx("span",{children:z[M]})]}),h.jsxs("button",{onClick:C,className:"flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] text-foreground-subtle hover:bg-surface-hover hover:text-danger transition-colors",children:[h.jsx(KT,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate",children:(n==null?void 0:n.username)??"User"})]})]})]});return h.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[!p&&h.jsx("aside",{className:"flex w-48 flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0",children:k}),p&&h.jsx(eC,{open:y,onClose:()=>b(!1),width:"w-64",children:k}),h.jsxs("div",{className:"flex flex-1 flex-col min-w-0",children:[p&&h.jsxs("header",{className:"flex items-center h-12 border-b border-border px-3 shrink-0 bg-surface/80 backdrop-blur-sm",children:[h.jsx("button",{onClick:()=>b(!0),className:"p-1.5 -ml-1.5 rounded-md hover:bg-surface-hover text-foreground-muted transition-colors","aria-label":"Open menu",children:h.jsx(FT,{className:"h-5 w-5"})}),h.jsx("div",{className:"flex-1 flex justify-center",children:h.jsx("img",{src:(i==null?void 0:i.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack",className:"h-7"})}),h.jsx("div",{className:"w-8"})]}),h.jsx("main",{className:"flex-1 overflow-auto bg-background",children:h.jsx(qN,{})})]})]})}function LO(){const{login:t}=ov(),e=vS(),n=gl(),[s,i]=D.useState(""),[o,d]=D.useState(""),[f,p]=D.useState(!1),[y,b]=D.useState(""),[v,_]=D.useState(!1),C=async w=>{w.preventDefault(),b(""),_(!0);try{await t(s,o),n("/dashboard",{replace:!0})}catch(T){b(T instanceof Error?T.message:"Login failed")}finally{_(!1)}};return h.jsx("div",{className:"flex min-h-screen items-center justify-center bg-background p-4",children:h.jsxs("div",{className:"w-full max-w-sm",children:[h.jsx("div",{className:"flex justify-center mb-8",children:h.jsx("img",{src:(e==null?void 0:e.resolvedMode)==="light"?"/brand/logo-horizontal-light.svg":"/brand/logo-horizontal-dark.svg",alt:"CamStack Admin",className:"h-12"})}),h.jsxs("form",{onSubmit:C,className:"space-y-4 rounded-xl border border-border bg-surface p-6 shadow-xl shadow-black/10",children:[y&&h.jsx("div",{className:"rounded-md bg-danger/10 border border-danger/20 px-3 py-2 text-xs text-danger",children:y}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Username"}),h.jsx("input",{type:"text",placeholder:"admin",value:s,onChange:w=>i(w.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all",autoFocus:!0})]}),h.jsxs("div",{className:"space-y-1.5",children:[h.jsx("label",{className:"text-xs font-medium text-foreground-subtle",children:"Password"}),h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:f?"text":"password",placeholder:"Enter password",value:o,onChange:w=>d(w.target.value),className:"w-full rounded-lg border border-border bg-background px-3 py-2.5 pr-10 text-sm text-foreground placeholder:text-foreground-disabled focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none transition-all"}),h.jsx("button",{type:"button",onClick:()=>p(!f),className:"absolute right-2.5 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground transition-colors",tabIndex:-1,children:f?h.jsx(R6,{className:"h-4 w-4"}):h.jsx(ch,{className:"h-4 w-4"})})]})]}),h.jsx("button",{type:"submit",disabled:v||!s||!o,className:"w-full rounded-lg bg-primary px-4 py-2.5 text-sm font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg hover:shadow-primary/30 disabled:opacity-50 disabled:shadow-none transition-all",children:v?h.jsxs("span",{className:"flex items-center justify-center gap-2",children:[h.jsx("span",{className:"h-4 w-4 animate-spin rounded-full border-2 border-primary-foreground/30 border-t-primary-foreground"}),"Logging in..."]}):"Log in"})]}),h.jsx("p",{className:"mt-6 text-center text-[10px] text-foreground-subtle/50",children:"CamStack v0.1.0"})]})})}function UO(){const t=gl();return h.jsxs("div",{className:"flex min-h-screen flex-col items-center justify-center bg-background text-foreground p-4",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-danger/10 mb-4",children:h.jsx(xR,{className:"h-8 w-8 text-danger"})}),h.jsx("h1",{className:"text-xl font-bold",children:"Access Denied"}),h.jsx("p",{className:"mt-2 text-sm text-foreground-subtle",children:"You don't have permission to access this page."}),h.jsx("button",{onClick:()=>t("/dashboard"),className:"mt-6 rounded-lg bg-primary px-5 py-2.5 text-sm font-medium text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all",children:"Go to Dashboard"})]})}const mv=new Map;function gv(t){mv.set(t.id,t)}function k3(t){return mv.get(t)}function qO(){return Array.from(mv.values())}function Ft(){return D.useMemo(()=>Om(),[])}function HO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({queryKey:["system-info"],queryFn:()=>n.getSystemInfo(),refetchInterval:1e4});if(i)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),h.jsx("span",{children:"Connecting to server..."})]});if(o)return h.jsxs("div",{className:"flex items-center gap-2 text-xs text-danger",children:[h.jsx(pv,{className:"h-3.5 w-3.5"}),h.jsx("span",{children:"Unable to reach server"})]});const d=s;return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex items-center gap-1.5 mb-2",children:[h.jsx(lT,{className:"h-3.5 w-3.5 text-success"}),h.jsx("span",{className:"text-success font-medium",children:"Online"})]}),h.jsx(K0,{label:"Version",value:String((d==null?void 0:d.version)??"N/A")}),h.jsx(K0,{label:"Uptime",value:BO(d==null?void 0:d.uptime)}),h.jsx(K0,{label:"Memory",value:`${GO(d==null?void 0:d.memoryUsage)} MB`}),h.jsx(K0,{label:"Platform",value:String((d==null?void 0:d.platform)??"N/A")})]})}function K0({label:t,value:e}){return h.jsxs("div",{className:"flex justify-between items-center",children:[h.jsx("span",{className:"text-foreground-subtle",children:t}),h.jsx("span",{className:"text-foreground font-medium tabular-nums",children:e})]})}function BO(t){if(!t)return"N/A";const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return e>0?`${e}h ${n}m`:`${n}m`}function GO(t){return t?(t/1024/1024).toFixed(0):"N/A"}const PO=["class-filter","tracker","sub-detection","recognition","zone-analysis","event-generation","object-snapshot"];function YO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({queryKey:["pipelines"],queryFn:()=>n.listPipelines(),refetchInterval:5e3});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load pipelines"});const d=s??[];return h.jsxs("div",{className:"space-y-2 text-xs",children:[h.jsxs("div",{className:"flex justify-between text-foreground-subtle",children:[h.jsx("span",{children:"Active pipelines"}),h.jsx("span",{className:"font-medium text-foreground",children:d.length})]}),h.jsx("div",{className:"space-y-0.5",children:PO.map(f=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("div",{className:"h-1.5 w-1.5 rounded-full bg-success shrink-0"}),h.jsx("span",{className:"text-foreground-subtle",children:f})]},f))})]})}function VO(t){if(t<60)return`${Math.floor(t)}s`;if(t<3600)return`${Math.floor(t/60)}m`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function QO({config:t,size:e}){const n=Ft(),{data:s,isLoading:i,error:o}=ot({queryKey:["system-info"],queryFn:async()=>await n.getSystemInfo(),refetchInterval:3e4}),{data:d}=ot({queryKey:["storage-addons"],queryFn:()=>n.listAddons(),refetchInterval:6e4});if(i)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."});if(o)return h.jsx("div",{className:"text-xs text-danger",children:"Failed to load system info"});const f=d??[];return h.jsxs("div",{className:"space-y-1.5 text-xs",children:[h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Platform"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.platform)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Uptime"}),h.jsx("span",{className:"text-foreground font-medium",children:(s==null?void 0:s.uptime)!=null?VO(s.uptime):"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Node"}),h.jsx("span",{className:"text-foreground font-medium font-mono",children:(s==null?void 0:s.nodeVersion)??"N/A"})]}),h.jsxs("div",{className:"flex justify-between",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Addons"}),h.jsxs("span",{className:"text-foreground font-medium",children:[f.length," installed"]})]})]})}gv({id:"system-status",name:"System Status",icon:C1,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:HO});gv({id:"pipeline-stages",name:"Pipeline Stages",icon:GR,defaultSize:{w:4,h:3},minSize:{w:3,h:2},component:YO});gv({id:"storage",name:"Storage",icon:mm,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:QO});function uh(t){const{margin:e,containerPadding:n,containerWidth:s,cols:i}=t;return(s-e[0]*(i-1)-n[0]*2)/i}function eh(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Xp(t,e,n,s,i,o,d){const{margin:f,containerPadding:p,rowHeight:y}=t,b=uh(t);let v,_,C,w;if(d?(v=Math.round(d.width),_=Math.round(d.height)):(v=eh(s,b,f[0]),_=eh(i,y,f[1])),o?(C=Math.round(o.top),w=Math.round(o.left)):d?(C=Math.round(d.top),w=Math.round(d.left)):(C=Math.round((y+f[1])*n+p[1]),w=Math.round((b+f[0])*e+p[0])),!o&&!d){if(Number.isFinite(s)){const R=Math.round((b+f[0])*(e+s)+p[0])-w-v;R!==f[0]&&(v+=R-f[0])}if(Number.isFinite(i)){const R=Math.round((y+f[1])*(n+i)+p[1])-C-_;R!==f[1]&&(_+=R-f[1])}}return{top:C,left:w,width:v,height:_}}function KO(t,e,n,s,i){const{margin:o,containerPadding:d,cols:f,rowHeight:p,maxRows:y}=t,b=uh(t);let v=Math.round((n-d[0])/(b+o[0])),_=Math.round((e-d[1])/(p+o[1]));return v=M1(v,0,f-s),_=M1(_,0,y-i),{x:v,y:_}}function X0(t,e,n){const{margin:s,containerPadding:i,rowHeight:o}=t,d=uh(t),f=Math.round((n-i[0])/(d+s[0])),p=Math.round((e-i[1])/(o+s[1]));return{x:f,y:p}}function XO(t,e,n){const{margin:s,rowHeight:i}=t,o=uh(t),d=Math.max(1,Math.round((e+s[0])/(o+s[0]))),f=Math.max(1,Math.round((n+s[1])/(i+s[1])));return{w:d,h:f}}function M1(t,e,n){return Math.max(Math.min(t,n),e)}function yv(t,e){return!(t.i===e.i||t.x+t.w<=e.x||t.x>=e.x+e.w||t.y+t.h<=e.y||t.y>=e.y+e.h)}function Fu(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&yv(s,e))return s}}function Q6(t,e){return t.filter(n=>yv(n,e))}function FO(t,e){return e==="horizontal"?K6(t):e==="vertical"||e==="wrap"?jb(t):[...t]}function jb(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function K6(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function Z1(t){let e=0;for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0){const i=s.y+s.h;i>e&&(e=i)}}return e}function Lu(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&s.i===e)return s}}function I1(t){return t.filter(e=>e.static===!0)}function Ju(t){return{i:t.i,x:t.x,y:t.y,w:t.w,h:t.h,minW:t.minW,maxW:t.maxW,minH:t.minH,maxH:t.maxH,moved:!!t.moved,static:!!t.static,isDraggable:t.isDraggable,isResizable:t.isResizable,resizeHandles:t.resizeHandles,constraints:t.constraints,isBounded:t.isBounded}}function zc(t){const e=new Array(t.length);for(let n=0;n<t.length;n++){const s=t[n];s!==void 0&&(e[n]=Ju(s))}return e}function ZO(t,e){const n=new Array(t.length);for(let s=0;s<t.length;s++){const i=t[s];i!==void 0&&(e.i===i.i?n[s]=e:n[s]=i)}return n}function IO(t,e,n){let s=Lu(t,e);return s?(s=n(Ju(s)),[ZO(t,s),s]):[[...t],null]}function xv(t,e){const n=I1(t);for(let s=0;s<t.length;s++){const i=t[s];if(i!==void 0)if(i.x+i.w>e.cols&&(i.x=e.cols-i.w),i.x<0&&(i.x=0,i.w=e.cols),!i.static)n.push(i);else for(;Fu(n,i);)i.y++}return t}function Uu(t,e,n,s,i,o,d,f,p){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===s&&e.x===n)return[...t];const y=e.x,b=e.y;typeof n=="number"&&(e.x=n),typeof s=="number"&&(e.y=s),e.moved=!0;let v=FO(t,d);(d==="vertical"&&typeof s=="number"?b>=s:d==="horizontal"&&typeof n=="number"?y>=n:!1)&&(v=v.reverse());const C=Q6(v,e),w=C.length>0;if(w&&p)return zc(t);if(w&&o)return e.x=y,e.y=b,e.moved=!1,t;let T=[...t];for(let R=0;R<C.length;R++){const O=C[R];O!==void 0&&(O.moved||(O.static?T=L3(T,O,e,i,d):T=L3(T,e,O,i,d)))}return T}function L3(t,e,n,s,i,o){const d=i==="horizontal",f=i==="vertical",p=e.static;if(s){s=!1;const v={x:d?Math.max(e.x-n.w,0):n.x,y:f?Math.max(e.y-n.h,0):n.y,w:n.w,h:n.h,i:"-1"},_=Fu(t,v),C=_!==void 0&&_.y+_.h>e.y,w=_!==void 0&&e.x+e.w>_.x;if(!_)return Uu(t,n,d?v.x:void 0,f?v.y:void 0,s,p,i);if(C&&f)return Uu(t,n,void 0,n.y+1,s,p,i);if(C&&i===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(w&&d)return Uu(t,e,n.x,void 0,s,p,i)}const y=d?n.x+1:void 0,b=f?n.y+1:void 0;return y===void 0&&b===void 0?[...t]:Uu(t,n,y,b,s,p,i)}function Af(t,e,n){return Math.max(e,Math.min(n,t))}var JO={name:"gridBounds",constrainPosition(t,e,n,{cols:s,maxRows:i}){return{x:Af(e,0,Math.max(0,s-t.w)),y:Af(n,0,Math.max(0,i-t.h))}},constrainSize(t,e,n,s,{cols:i,maxRows:o}){const d=s==="w"||s==="nw"||s==="sw"?t.x+t.w:i-t.x,f=s==="n"||s==="nw"||s==="ne"?t.y+t.h:o-t.y;return{w:Af(e,1,Math.max(1,d)),h:Af(n,1,Math.max(1,f))}}},WO={name:"minMaxSize",constrainSize(t,e,n){return{w:Af(e,t.minW??1,t.maxW??1/0),h:Af(n,t.minH??1,t.maxH??1/0)}}},X6=[JO,WO];function F0(t,e,n,s,i){let o={x:n,y:s};for(const d of t)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));if(e.constraints)for(const d of e.constraints)d.constrainPosition&&(o=d.constrainPosition(e,o.x,o.y,i));return o}function $O(t,e,n,s,i,o){let d={w:n,h:s};for(const f of t)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));if(e.constraints)for(const f of e.constraints)f.constrainSize&&(d=f.constrainSize(e,d.w,d.h,i,o));return d}function F6({top:t,left:e,width:n,height:s}){const i=`translate(${e}px,${t}px)`;return{transform:i,WebkitTransform:i,MozTransform:i,msTransform:i,OTransform:i,width:`${n}px`,height:`${s}px`,position:"absolute"}}function eM({top:t,left:e,width:n,height:s}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${s}px`,position:"absolute"}}function U3(t){return t*100+"%"}function tM(t,e,n,s){return t+n>s?e:n}function Z6(t,e,n){return t<0?e:n}function nM(t){return Math.max(0,t)}function A1(t){return Math.max(0,t)}var bv=(t,e,n)=>{const{left:s,height:i,width:o}=e,d=t.top-(i-t.height);return{left:s,width:o,height:Z6(d,t.height,i),top:A1(d)}},vv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{top:s,height:o,width:tM(t.left,t.width,d,n),left:nM(i)}},Sv=(t,e,n)=>{const{top:s,height:i,width:o}=e,d=t.left+t.width-o;return d<0?{height:i,width:t.left+t.width,top:A1(s),left:0}:{height:i,width:o,top:A1(s),left:d}},Nv=(t,e,n)=>{const{top:s,left:i,height:o,width:d}=e;return{width:d,left:i,height:Z6(s,t.height,o),top:A1(s)}},aM=(t,e,n)=>bv(t,vv(t,e,n)),sM=(t,e,n)=>bv(t,Sv(t,e)),rM=(t,e,n)=>Nv(t,vv(t,e,n)),iM=(t,e,n)=>Nv(t,Sv(t,e)),lM={n:bv,ne:aM,e:vv,se:rM,s:Nv,sw:iM,w:Sv,nw:sM};function oM(t,e,n,s){const i=lM[t];return i?i(e,{...e,...n},s):n}var cM={type:"transform",scale:1,calcStyle(t){return F6(t)}},uM=cM,dM={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},fM={enabled:!0,bounded:!1,threshold:3},hM={enabled:!0,handles:["se"]},pM={enabled:!1,defaultItem:{w:1,h:1}};function _v(t,e,n,s,i){const o=s==="x"?"w":"h";e[s]+=1;const d=t.findIndex(p=>p.i===e.i),f=i??I1(t).length>0;for(let p=d+1;p<t.length;p++){const y=t[p];if(y!==void 0&&!y.static){if(!f&&y.y>e.y+e.h)break;yv(e,y)&&_v(t,y,n+e[o],s,f)}}e[s]=n}function mM(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0),e.y=Math.min(s,e.y);e.y>0&&!Fu(t,e);)e.y--;let i;for(;(i=Fu(t,e))!==void 0;)_v(n,e,i.y+i.h,"y");return e.y=Math.max(e.y,0),e}function gM(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!Fu(t,e);)e.x--;let i;for(;(i=Fu(t,e))!==void 0;)if(_v(s,e,i.x+i.w,"x"),e.x+e.w>n)for(e.x=n-e.w,e.y++;e.x>0&&!Fu(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var I6={type:"vertical",allowOverlap:!1,compact(t,e){const n=I1(t);let s=Z1(n);const i=jb(t),o=new Array(t.length);for(let d=0;d<i.length;d++){const f=i[d];if(f===void 0)continue;let p=Ju(f);p.static||(p=mM(n,p,i,s),s=Math.max(s,p.y+p.h),n.push(p));const y=t.indexOf(f);o[y]=p,p.moved=!1}return o}},J6={type:"horizontal",allowOverlap:!1,compact(t,e){const n=I1(t),s=K6(t),i=new Array(t.length);for(let o=0;o<s.length;o++){const d=s[o];if(d===void 0)continue;let f=Ju(d);f.static||(f=gM(n,f,e,s),n.push(f));const p=t.indexOf(d);i[p]=f,f.moved=!1}return i}},W6={type:null,allowOverlap:!1,compact(t,e){return zc(t)}},yM={...I6,allowOverlap:!0,compact(t,e){return zc(t)}},xM={...J6,allowOverlap:!0,compact(t,e){return zc(t)}},bM={...W6,allowOverlap:!0};function jv(t,e=!1,n=!1){let s;return e?t==="vertical"?s=yM:t==="horizontal"?s=xM:s=bM:t==="vertical"?s=I6:t==="horizontal"?s=J6:s=W6,n?{...s,preventCollision:n}:s}function $6(t){return Object.keys(t).sort((n,s)=>t[n]-t[s])}function q3(t,e){const n=$6(t);let s=n[0];if(s===void 0)throw new Error("No breakpoints defined");for(let i=1;i<n.length;i++){const o=n[i];if(o===void 0)continue;const d=t[o];e>d&&(s=o)}return s}function H3(t,e){const n=e[t];if(n===void 0)throw new Error(`ResponsiveReactGridLayout: \`cols\` entry for breakpoint ${String(t)} is missing!`);return n}function fx(t,e,n,s,i,o){const d=t[n];if(d)return zc(d);let f=t[s];const p=$6(e),y=p.slice(p.indexOf(n));for(let C=0;C<y.length;C++){const w=y[C];if(w===void 0)continue;const T=t[w];if(T){f=T;break}}const b=zc(f||[]),v=xv(b,{cols:i});return(typeof o=="object"&&o!==null?o:jv(o)).compact(v,i)}function Z0(t,e){if(Array.isArray(t))return t;const n=t,s=n[e];if(s!==void 0)return s;const i=Object.keys(n);for(const o of i){const d=n[o];if(d!==void 0)return d}return[10,10]}function e8(t){return function(n,s,i,o,d,f,p){return t(n,s,p)}}function J1(t){return function(n,s,i,o){if(!n||!s||typeof n!="object"||typeof s!="object")return t(n,s,i,o);var d=o.get(n),f=o.get(s);if(d&&f)return d===s&&f===n;o.set(n,s),o.set(s,n);var p=t(n,s,i,o);return o.delete(n),o.delete(s),p}}function t8(t,e){var n={};for(var s in t)n[s]=t[s];for(var s in e)n[s]=e[s];return n}function B3(t){return t.constructor===Object||t.constructor==null}function G3(t){return typeof t.then=="function"}function W1(t,e){return t===e||t!==t&&e!==e}var vM="[object Arguments]",SM="[object Boolean]",NM="[object Date]",_M="[object RegExp]",jM="[object Map]",CM="[object Number]",wM="[object Object]",EM="[object Set]",TM="[object String]",P3=Object.prototype.toString;function $1(t){var e=t.areArraysEqual,n=t.areDatesEqual,s=t.areMapsEqual,i=t.areObjectsEqual,o=t.areRegExpsEqual,d=t.areSetsEqual,f=t.createIsNestedEqual,p=f(y);function y(b,v,_){if(b===v)return!0;if(!b||!v||typeof b!="object"||typeof v!="object")return b!==b&&v!==v;if(B3(b)&&B3(v))return i(b,v,p,_);var C=Array.isArray(b),w=Array.isArray(v);if(C||w)return C===w&&e(b,v,p,_);var T=P3.call(b);return T!==P3.call(v)?!1:T===NM?n(b,v,p,_):T===_M?o(b,v,p,_):T===jM?s(b,v,p,_):T===EM?d(b,v,p,_):T===wM||T===vM?G3(b)||G3(v)?!1:i(b,v,p,_):T===SM||T===CM||T===TM?W1(b.valueOf(),v.valueOf()):!1}return y}function n8(t,e,n,s){var i=t.length;if(e.length!==i)return!1;for(;i-- >0;)if(!n(t[i],e[i],i,i,t,e,s))return!1;return!0}var RM=J1(n8);function a8(t,e){return W1(t.valueOf(),e.valueOf())}function s8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={},d=0;return t.forEach(function(f,p){if(i){var y=!1,b=0;e.forEach(function(v,_){!y&&!o[b]&&(y=n(p,_,d,b,t,e,s)&&n(f,v,p,_,t,e,s))&&(o[b]=!0),b++}),d++,i=y}}),i}var OM=J1(s8),MM="_owner",AM=Object.prototype.hasOwnProperty;function r8(t,e,n,s){var i=Object.keys(t),o=i.length;if(Object.keys(e).length!==o)return!1;for(var d;o-- >0;){if(d=i[o],d===MM){var f=!!t.$$typeof,p=!!e.$$typeof;if((f||p)&&f!==p)return!1}if(!AM.call(e,d)||!n(t[d],e[d],d,d,t,e,s))return!1}return!0}var DM=J1(r8);function i8(t,e){return t.source===e.source&&t.flags===e.flags}function l8(t,e,n,s){var i=t.size===e.size;if(!i)return!1;if(!t.size)return!0;var o={};return t.forEach(function(d,f){if(i){var p=!1,y=0;e.forEach(function(b,v){!p&&!o[y]&&(p=n(d,b,f,v,t,e,s))&&(o[y]=!0),y++}),i=p}}),i}var zM=J1(l8),o8=Object.freeze({areArraysEqual:n8,areDatesEqual:a8,areMapsEqual:s8,areObjectsEqual:r8,areRegExpsEqual:i8,areSetsEqual:l8,createIsNestedEqual:e8}),c8=Object.freeze({areArraysEqual:RM,areDatesEqual:a8,areMapsEqual:OM,areObjectsEqual:DM,areRegExpsEqual:i8,areSetsEqual:zM,createIsNestedEqual:e8}),kM=$1(o8);function so(t,e){return kM(t,e,void 0)}$1(t8(o8,{createIsNestedEqual:function(){return W1}}));$1(c8);$1(t8(c8,{createIsNestedEqual:function(){return W1}}));var Fp={exports:{}},hx={},px={exports:{}},mx,Y3;function LM(){if(Y3)return mx;Y3=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return mx=t,mx}var gx,V3;function UM(){if(V3)return gx;V3=1;var t=LM();function e(){}function n(){}return n.resetWarningCache=e,gx=function(){function s(d,f,p,y,b,v){if(v!==t){var _=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw _.name="Invariant Violation",_}}s.isRequired=s;function i(){return s}var o={array:s,bigint:s,bool:s,func:s,number:s,object:s,string:s,symbol:s,any:s,arrayOf:i,element:s,elementType:s,instanceOf:i,node:s,objectOf:i,oneOf:i,oneOfType:i,shape:i,exact:i,checkPropTypes:n,resetWarningCache:e};return o.PropTypes=o,o},gx}var Q3;function ey(){return Q3||(Q3=1,px.exports=UM()()),px.exports}var I0={exports:{}},K3;function qM(){if(K3)return I0.exports;K3=1;function t(n){var s,i,o="";if(typeof n=="string"||typeof n=="number")o+=n;else if(typeof n=="object")if(Array.isArray(n)){var d=n.length;for(s=0;s<d;s++)n[s]&&(i=t(n[s]))&&(o&&(o+=" "),o+=i)}else for(i in n)n[i]&&(o&&(o+=" "),o+=i);return o}function e(){for(var n,s,i=0,o="",d=arguments.length;i<d;i++)(n=arguments[i])&&(s=t(n))&&(o&&(o+=" "),o+=s);return o}return I0.exports=e,I0.exports.clsx=e,I0.exports}var pa={},dc={},X3;function ty(){if(X3)return dc;X3=1,Object.defineProperty(dc,"__esModule",{value:!0}),dc.dontSetMe=i,dc.findInArray=t,dc.int=s,dc.isFunction=e,dc.isNum=n;function t(o,d){for(let f=0,p=o.length;f<p;f++)if(d.apply(d,[o[f],f,o]))return o[f]}function e(o){return typeof o=="function"||Object.prototype.toString.call(o)==="[object Function]"}function n(o){return typeof o=="number"&&!isNaN(o)}function s(o){return parseInt(o,10)}function i(o,d,f){if(o[d])return new Error(`Invalid prop ${d} passed to ${f} - do not set this, set it on the child.`)}return dc}var fc={},F3;function HM(){if(F3)return fc;F3=1,Object.defineProperty(fc,"__esModule",{value:!0}),fc.browserPrefixToKey=n,fc.browserPrefixToStyle=s,fc.default=void 0,fc.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var f,p;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const d=(p=(f=window.document)==null?void 0:f.documentElement)==null?void 0:p.style;if(!d||o in d)return"";for(let y=0;y<t.length;y++)if(n(o,t[y])in d)return t[y];return""}function n(o,d){return d?`${d}${i(o)}`:o}function s(o,d){return d?`-${d.toLowerCase()}-${o}`:o}function i(o){let d="",f=!0;for(let p=0;p<o.length;p++)f?(d+=o[p].toUpperCase(),f=!1):o[p]==="-"?f=!0:d+=o[p];return d}return fc.default=e(),fc}var Z3;function Cv(){if(Z3)return pa;Z3=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.addClassName=P,pa.addEvent=d,pa.addUserSelectStyles=M,pa.createCSSTransform=C,pa.createSVGTransform=w,pa.getTouch=R,pa.getTouchIdentifier=O,pa.getTranslation=T,pa.innerHeight=b,pa.innerWidth=v,pa.matchesSelector=i,pa.matchesSelectorAndParentsTo=o,pa.offsetXYFromParent=_,pa.outerHeight=p,pa.outerWidth=y,pa.removeClassName=q,pa.removeEvent=f,pa.scheduleRemoveUserSelectStyles=z;var t=ty(),e=n(HM());function n(L,U){if(typeof WeakMap=="function")var V=new WeakMap,F=new WeakMap;return(n=function(re,ne){if(!ne&&re&&re.__esModule)return re;var J,ie,ce={__proto__:null,default:re};if(re===null||typeof re!="object"&&typeof re!="function")return ce;if(J=ne?F:V){if(J.has(re))return J.get(re);J.set(re,ce)}for(const Y in re)Y!=="default"&&{}.hasOwnProperty.call(re,Y)&&((ie=(J=Object.defineProperty)&&Object.getOwnPropertyDescriptor(re,Y))&&(ie.get||ie.set)?J(ce,Y,ie):ce[Y]=re[Y]);return ce})(L,U)}let s="";function i(L,U){return s||(s=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(V){return(0,t.isFunction)(L[V])})),(0,t.isFunction)(L[s])?L[s](U):!1}function o(L,U,V){let F=L;do{if(i(F,U))return!0;if(F===V)return!1;F=F.parentNode}while(F);return!1}function d(L,U,V,F){if(!L)return;const re={capture:!0,...F};L.addEventListener?L.addEventListener(U,V,re):L.attachEvent?L.attachEvent("on"+U,V):L["on"+U]=V}function f(L,U,V,F){if(!L)return;const re={capture:!0,...F};L.removeEventListener?L.removeEventListener(U,V,re):L.detachEvent?L.detachEvent("on"+U,V):L["on"+U]=null}function p(L){let U=L.clientHeight;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U+=(0,t.int)(V.borderTopWidth),U+=(0,t.int)(V.borderBottomWidth),U}function y(L){let U=L.clientWidth;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U+=(0,t.int)(V.borderLeftWidth),U+=(0,t.int)(V.borderRightWidth),U}function b(L){let U=L.clientHeight;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U-=(0,t.int)(V.paddingTop),U-=(0,t.int)(V.paddingBottom),U}function v(L){let U=L.clientWidth;const V=L.ownerDocument.defaultView.getComputedStyle(L);return U-=(0,t.int)(V.paddingLeft),U-=(0,t.int)(V.paddingRight),U}function _(L,U,V){const re=U===U.ownerDocument.body?{left:0,top:0}:U.getBoundingClientRect(),ne=(L.clientX+U.scrollLeft-re.left)/V,J=(L.clientY+U.scrollTop-re.top)/V;return{x:ne,y:J}}function C(L,U){const V=T(L,U,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:V}}function w(L,U){return T(L,U,"")}function T(L,U,V){let{x:F,y:re}=L,ne=`translate(${F}${V},${re}${V})`;if(U){const J=`${typeof U.x=="string"?U.x:U.x+V}`,ie=`${typeof U.y=="string"?U.y:U.y+V}`;ne=`translate(${J}, ${ie})`+ne}return ne}function R(L,U){return L.targetTouches&&(0,t.findInArray)(L.targetTouches,V=>U===V.identifier)||L.changedTouches&&(0,t.findInArray)(L.changedTouches,V=>U===V.identifier)}function O(L){if(L.targetTouches&&L.targetTouches[0])return L.targetTouches[0].identifier;if(L.changedTouches&&L.changedTouches[0])return L.changedTouches[0].identifier}function M(L){if(!L)return;let U=L.getElementById("react-draggable-style-el");U||(U=L.createElement("style"),U.type="text/css",U.id="react-draggable-style-el",U.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
564
|
-
`,U.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
565
|
-
`,L.getElementsByTagName("head")[0].appendChild(U)),L.body&&P(L.body,"react-draggable-transparent-selection")}function z(L){window.requestAnimationFrame?window.requestAnimationFrame(()=>{k(L)}):k(L)}function k(L){if(L)try{if(L.body&&q(L.body,"react-draggable-transparent-selection"),L.selection)L.selection.empty();else{const U=(L.defaultView||window).getSelection();U&&U.type!=="Caret"&&U.removeAllRanges()}}catch{}}function P(L,U){L.classList?L.classList.add(U):L.className.match(new RegExp(`(?:^|\\s)${U}(?!\\S)`))||(L.className+=` ${U}`)}function q(L,U){L.classList?L.classList.remove(U):L.className=L.className.replace(new RegExp(`(?:^|\\s)${U}(?!\\S)`,"g"),"")}return pa}var ol={},I3;function u8(){if(I3)return ol;I3=1,Object.defineProperty(ol,"__esModule",{value:!0}),ol.canDragX=i,ol.canDragY=o,ol.createCoreData=f,ol.createDraggableData=p,ol.getBoundPosition=n,ol.getControlPosition=d,ol.snapToGrid=s;var t=ty(),e=Cv();function n(v,_,C){if(!v.props.bounds)return[_,C];let{bounds:w}=v.props;w=typeof w=="string"?w:y(w);const T=b(v);if(typeof w=="string"){const{ownerDocument:R}=T,O=R.defaultView;let M;if(w==="parent"?M=T.parentNode:M=T.getRootNode().querySelector(w),!(M instanceof O.HTMLElement))throw new Error('Bounds selector "'+w+'" could not find an element.');const z=M,k=O.getComputedStyle(T),P=O.getComputedStyle(z);w={left:-T.offsetLeft+(0,t.int)(P.paddingLeft)+(0,t.int)(k.marginLeft),top:-T.offsetTop+(0,t.int)(P.paddingTop)+(0,t.int)(k.marginTop),right:(0,e.innerWidth)(z)-(0,e.outerWidth)(T)-T.offsetLeft+(0,t.int)(P.paddingRight)-(0,t.int)(k.marginRight),bottom:(0,e.innerHeight)(z)-(0,e.outerHeight)(T)-T.offsetTop+(0,t.int)(P.paddingBottom)-(0,t.int)(k.marginBottom)}}return(0,t.isNum)(w.right)&&(_=Math.min(_,w.right)),(0,t.isNum)(w.bottom)&&(C=Math.min(C,w.bottom)),(0,t.isNum)(w.left)&&(_=Math.max(_,w.left)),(0,t.isNum)(w.top)&&(C=Math.max(C,w.top)),[_,C]}function s(v,_,C){const w=Math.round(_/v[0])*v[0],T=Math.round(C/v[1])*v[1];return[w,T]}function i(v){return v.props.axis==="both"||v.props.axis==="x"}function o(v){return v.props.axis==="both"||v.props.axis==="y"}function d(v,_,C){const w=typeof _=="number"?(0,e.getTouch)(v,_):null;if(typeof _=="number"&&!w)return null;const T=b(C),R=C.props.offsetParent||T.offsetParent||T.ownerDocument.body;return(0,e.offsetXYFromParent)(w||v,R,C.props.scale)}function f(v,_,C){const w=!(0,t.isNum)(v.lastX),T=b(v);return w?{node:T,deltaX:0,deltaY:0,lastX:_,lastY:C,x:_,y:C}:{node:T,deltaX:_-v.lastX,deltaY:C-v.lastY,lastX:v.lastX,lastY:v.lastY,x:_,y:C}}function p(v,_){const C=v.props.scale;return{node:_.node,x:v.state.x+_.deltaX/C,y:v.state.y+_.deltaY/C,deltaX:_.deltaX/C,deltaY:_.deltaY/C,lastX:v.state.x,lastY:v.state.y}}function y(v){return{left:v.left,top:v.top,right:v.right,bottom:v.bottom}}function b(v){const _=v.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return ol}var Zp={},J0={},J3;function d8(){if(J3)return J0;J3=1,Object.defineProperty(J0,"__esModule",{value:!0}),J0.default=t;function t(){}return J0}var W3;function BM(){if(W3)return Zp;W3=1,Object.defineProperty(Zp,"__esModule",{value:!0}),Zp.default=void 0;var t=p(pl()),e=f(ey()),n=f(L1()),s=Cv(),i=u8(),o=ty(),d=f(d8());function f(T){return T&&T.__esModule?T:{default:T}}function p(T,R){if(typeof WeakMap=="function")var O=new WeakMap,M=new WeakMap;return(p=function(z,k){if(!k&&z&&z.__esModule)return z;var P,q,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(P=k?M:O){if(P.has(z))return P.get(z);P.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((q=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(q.get||q.set)?P(L,U,q):L[U]=z[U]);return L})(T,R)}function y(T,R,O){return(R=b(R))in T?Object.defineProperty(T,R,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[R]=O,T}function b(T){var R=v(T,"string");return typeof R=="symbol"?R:R+""}function v(T,R){if(typeof T!="object"||!T)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var M=O.call(T,R);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(T)}const _={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let C=_.mouse,w=class extends t.Component{constructor(){super(...arguments),y(this,"dragging",!1),y(this,"lastX",NaN),y(this,"lastY",NaN),y(this,"touchIdentifier",null),y(this,"mounted",!1),y(this,"handleDragStart",R=>{if(this.props.onMouseDown(R),!this.props.allowAnyClick&&typeof R.button=="number"&&R.button!==0)return!1;const O=this.findDOMNode();if(!O||!O.ownerDocument||!O.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:M}=O;if(this.props.disabled||!(R.target instanceof M.defaultView.Node)||this.props.handle&&!(0,s.matchesSelectorAndParentsTo)(R.target,this.props.handle,O)||this.props.cancel&&(0,s.matchesSelectorAndParentsTo)(R.target,this.props.cancel,O))return;R.type==="touchstart"&&!this.props.allowMobileScroll&&R.preventDefault();const z=(0,s.getTouchIdentifier)(R);this.touchIdentifier=z;const k=(0,i.getControlPosition)(R,z,this);if(k==null)return;const{x:P,y:q}=k,L=(0,i.createCoreData)(this,P,q);(0,d.default)("DraggableCore: handleDragStart: %j",L),(0,d.default)("calling",this.props.onStart),!(this.props.onStart(R,L)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,s.addUserSelectStyles)(M),this.dragging=!0,this.lastX=P,this.lastY=q,(0,s.addEvent)(M,C.move,this.handleDrag),(0,s.addEvent)(M,C.stop,this.handleDragStop))}),y(this,"handleDrag",R=>{const O=(0,i.getControlPosition)(R,this.touchIdentifier,this);if(O==null)return;let{x:M,y:z}=O;if(Array.isArray(this.props.grid)){let q=M-this.lastX,L=z-this.lastY;if([q,L]=(0,i.snapToGrid)(this.props.grid,q,L),!q&&!L)return;M=this.lastX+q,z=this.lastY+L}const k=(0,i.createCoreData)(this,M,z);if((0,d.default)("DraggableCore: handleDrag: %j",k),this.props.onDrag(R,k)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const L=document.createEvent("MouseEvents");L.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(L)}return}this.lastX=M,this.lastY=z}),y(this,"handleDragStop",R=>{if(!this.dragging)return;const O=(0,i.getControlPosition)(R,this.touchIdentifier,this);if(O==null)return;let{x:M,y:z}=O;if(Array.isArray(this.props.grid)){let L=M-this.lastX||0,U=z-this.lastY||0;[L,U]=(0,i.snapToGrid)(this.props.grid,L,U),M=this.lastX+L,z=this.lastY+U}const k=(0,i.createCoreData)(this,M,z);if(this.props.onStop(R,k)===!1||this.mounted===!1)return!1;const q=this.findDOMNode();q&&this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(q.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",k),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,q&&((0,d.default)("DraggableCore: Removing handlers"),(0,s.removeEvent)(q.ownerDocument,C.move,this.handleDrag),(0,s.removeEvent)(q.ownerDocument,C.stop,this.handleDragStop))}),y(this,"onMouseDown",R=>(C=_.mouse,this.handleDragStart(R))),y(this,"onMouseUp",R=>(C=_.mouse,this.handleDragStop(R))),y(this,"onTouchStart",R=>(C=_.touch,this.handleDragStart(R))),y(this,"onTouchEnd",R=>(C=_.touch,this.handleDragStop(R)))}componentDidMount(){this.mounted=!0;const R=this.findDOMNode();R&&(0,s.addEvent)(R,_.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const R=this.findDOMNode();if(R){const{ownerDocument:O}=R;(0,s.removeEvent)(O,_.mouse.move,this.handleDrag),(0,s.removeEvent)(O,_.touch.move,this.handleDrag),(0,s.removeEvent)(O,_.mouse.stop,this.handleDragStop),(0,s.removeEvent)(O,_.touch.stop,this.handleDragStop),(0,s.removeEvent)(R,_.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(O)}}findDOMNode(){var R,O,M;return(R=this.props)!=null&&R.nodeRef?(M=(O=this.props)==null?void 0:O.nodeRef)==null?void 0:M.current:n.default.findDOMNode(this)}render(){return t.cloneElement(t.Children.only(this.props.children),{onMouseDown:this.onMouseDown,onMouseUp:this.onMouseUp,onTouchEnd:this.onTouchEnd})}};return Zp.default=w,y(w,"displayName","DraggableCore"),y(w,"propTypes",{allowAnyClick:e.default.bool,allowMobileScroll:e.default.bool,children:e.default.node.isRequired,disabled:e.default.bool,enableUserSelectHack:e.default.bool,offsetParent:function(T,R){if(T[R]&&T[R].nodeType!==1)throw new Error("Draggable's offsetParent must be a DOM Node.")},grid:e.default.arrayOf(e.default.number),handle:e.default.string,cancel:e.default.string,nodeRef:e.default.object,onStart:e.default.func,onDrag:e.default.func,onStop:e.default.func,onMouseDown:e.default.func,scale:e.default.number,className:o.dontSetMe,style:o.dontSetMe,transform:o.dontSetMe}),y(w,"defaultProps",{allowAnyClick:!1,allowMobileScroll:!1,disabled:!1,enableUserSelectHack:!0,onStart:function(){},onDrag:function(){},onStop:function(){},onMouseDown:function(){},scale:1}),Zp}var $3;function GM(){return $3||($3=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return p.default}}),t.default=void 0;var e=v(pl()),n=b(ey()),s=b(L1()),i=qM(),o=Cv(),d=u8(),f=ty(),p=b(BM()),y=b(d8());function b(O){return O&&O.__esModule?O:{default:O}}function v(O,M){if(typeof WeakMap=="function")var z=new WeakMap,k=new WeakMap;return(v=function(P,q){if(!q&&P&&P.__esModule)return P;var L,U,V={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return V;if(L=q?k:z){if(L.has(P))return L.get(P);L.set(P,V)}for(const F in P)F!=="default"&&{}.hasOwnProperty.call(P,F)&&((U=(L=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,F))&&(U.get||U.set)?L(V,F,U):V[F]=P[F]);return V})(O,M)}function _(){return _=Object.assign?Object.assign.bind():function(O){for(var M=1;M<arguments.length;M++){var z=arguments[M];for(var k in z)({}).hasOwnProperty.call(z,k)&&(O[k]=z[k])}return O},_.apply(null,arguments)}function C(O,M,z){return(M=w(M))in O?Object.defineProperty(O,M,{value:z,enumerable:!0,configurable:!0,writable:!0}):O[M]=z,O}function w(O){var M=T(O,"string");return typeof M=="symbol"?M:M+""}function T(O,M){if(typeof O!="object"||!O)return O;var z=O[Symbol.toPrimitive];if(z!==void 0){var k=z.call(O,M);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(M==="string"?String:Number)(O)}class R extends e.Component{static getDerivedStateFromProps(M,z){let{position:k}=M,{prevPropsPosition:P}=z;return k&&(!P||k.x!==P.x||k.y!==P.y)?((0,y.default)("Draggable: getDerivedStateFromProps %j",{position:k,prevPropsPosition:P}),{x:k.x,y:k.y,prevPropsPosition:{...k}}):null}constructor(M){super(M),C(this,"onDragStart",(z,k)=>{if((0,y.default)("Draggable: onDragStart: %j",k),this.props.onStart(z,(0,d.createDraggableData)(this,k))===!1)return!1;this.setState({dragging:!0,dragged:!0})}),C(this,"onDrag",(z,k)=>{if(!this.state.dragging)return!1;(0,y.default)("Draggable: onDrag: %j",k);const P=(0,d.createDraggableData)(this,k),q={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:U,y:V}=q;q.x+=this.state.slackX,q.y+=this.state.slackY;const[F,re]=(0,d.getBoundPosition)(this,q.x,q.y);q.x=F,q.y=re,q.slackX=this.state.slackX+(U-q.x),q.slackY=this.state.slackY+(V-q.y),P.x=q.x,P.y=q.y,P.deltaX=q.x-this.state.x,P.deltaY=q.y-this.state.y}if(this.props.onDrag(z,P)===!1)return!1;this.setState(q)}),C(this,"onDragStop",(z,k)=>{if(!this.state.dragging||this.props.onStop(z,(0,d.createDraggableData)(this,k))===!1)return!1;(0,y.default)("Draggable: onDragStop: %j",k);const q={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:U,y:V}=this.props.position;q.x=U,q.y=V}this.setState(q)}),this.state={dragging:!1,dragged:!1,x:M.position?M.position.x:M.defaultPosition.x,y:M.position?M.position.y:M.defaultPosition.y,prevPropsPosition:{...M.position},slackX:0,slackY:0,isElementSVG:!1},M.position&&!(M.onDrag||M.onStop)&&console.warn("A `position` was applied to this <Draggable>, without drag handlers. This will make this component effectively undraggable. Please attach `onDrag` or `onStop` handlers so you can adjust the `position` of this element.")}componentDidMount(){typeof window.SVGElement<"u"&&this.findDOMNode()instanceof window.SVGElement&&this.setState({isElementSVG:!0})}componentWillUnmount(){this.state.dragging&&this.setState({dragging:!1})}findDOMNode(){var M,z;return((z=(M=this.props)==null?void 0:M.nodeRef)==null?void 0:z.current)??s.default.findDOMNode(this)}render(){const{axis:M,bounds:z,children:k,defaultPosition:P,defaultClassName:q,defaultClassNameDragging:L,defaultClassNameDragged:U,position:V,positionOffset:F,scale:re,...ne}=this.props;let J={},ie=null;const Y=!!!V||this.state.dragging,$=V||P,ae={x:(0,d.canDragX)(this)&&Y?this.state.x:$.x,y:(0,d.canDragY)(this)&&Y?this.state.y:$.y};this.state.isElementSVG?ie=(0,o.createSVGTransform)(ae,F):J=(0,o.createCSSTransform)(ae,F);const je=(0,i.clsx)(k.props.className||"",q,{[L]:this.state.dragging,[U]:this.state.dragged});return e.createElement(p.default,_({},ne,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(k),{className:je,style:{...k.props.style,...J},transform:ie}))}}t.default=R,C(R,"displayName","Draggable"),C(R,"propTypes",{...p.default.propTypes,axis:n.default.oneOf(["both","x","y","none"]),bounds:n.default.oneOfType([n.default.shape({left:n.default.number,right:n.default.number,top:n.default.number,bottom:n.default.number}),n.default.string,n.default.oneOf([!1])]),defaultClassName:n.default.string,defaultClassNameDragging:n.default.string,defaultClassNameDragged:n.default.string,defaultPosition:n.default.shape({x:n.default.number,y:n.default.number}),positionOffset:n.default.shape({x:n.default.oneOfType([n.default.number,n.default.string]),y:n.default.oneOfType([n.default.number,n.default.string])}),position:n.default.shape({x:n.default.number,y:n.default.number}),className:f.dontSetMe,style:f.dontSetMe,transform:f.dontSetMe}),C(R,"defaultProps",{...p.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(hx)),hx}var e5;function wv(){if(e5)return Fp.exports;e5=1;const{default:t,DraggableCore:e}=GM();return Fp.exports=t,Fp.exports.default=t,Fp.exports.DraggableCore=e,Fp.exports}var PM=wv(),Ip={exports:{}},Jp={},W0={},t5;function YM(){if(t5)return W0;t5=1,W0.__esModule=!0,W0.cloneElement=f;var t=e(pl());function e(p){return p&&p.__esModule?p:{default:p}}function n(p,y){var b=Object.keys(p);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(p);y&&(v=v.filter(function(_){return Object.getOwnPropertyDescriptor(p,_).enumerable})),b.push.apply(b,v)}return b}function s(p){for(var y=1;y<arguments.length;y++){var b=arguments[y]!=null?arguments[y]:{};y%2?n(Object(b),!0).forEach(function(v){i(p,v,b[v])}):Object.getOwnPropertyDescriptors?Object.defineProperties(p,Object.getOwnPropertyDescriptors(b)):n(Object(b)).forEach(function(v){Object.defineProperty(p,v,Object.getOwnPropertyDescriptor(b,v))})}return p}function i(p,y,b){return(y=o(y))in p?Object.defineProperty(p,y,{value:b,enumerable:!0,configurable:!0,writable:!0}):p[y]=b,p}function o(p){var y=d(p,"string");return typeof y=="symbol"?y:y+""}function d(p,y){if(typeof p!="object"||!p)return p;var b=p[Symbol.toPrimitive];if(b!==void 0){var v=b.call(p,y);if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(p)}function f(p,y){return y.style&&p.props.style&&(y.style=s(s({},p.props.style),y.style)),y.className&&p.props.className&&(y.className=`${p.props.className} ${y.className}`),t.default.cloneElement(p,y)}return W0}var Wp={},n5;function f8(){if(n5)return Wp;n5=1,Wp.__esModule=!0,Wp.resizableProps=void 0;var t=e(ey());wv();function e(n){return n&&n.__esModule?n:{default:n}}return Wp.resizableProps={axis:t.default.oneOf(["both","x","y","none"]),className:t.default.string,children:t.default.element.isRequired,draggableOpts:t.default.shape({allowAnyClick:t.default.bool,cancel:t.default.string,children:t.default.node,disabled:t.default.bool,enableUserSelectHack:t.default.bool,offsetParent:typeof Element<"u"?t.default.instanceOf(Element):t.default.any,grid:t.default.arrayOf(t.default.number),handle:t.default.string,nodeRef:t.default.object,onStart:t.default.func,onDrag:t.default.func,onStop:t.default.func,onMouseDown:t.default.func,scale:t.default.number}),height:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="y"?t.default.number.isRequired(...s):t.default.number(...s)},handle:t.default.oneOfType([t.default.node,t.default.func]),handleSize:t.default.arrayOf(t.default.number),lockAspectRatio:t.default.bool,maxConstraints:t.default.arrayOf(t.default.number),minConstraints:t.default.arrayOf(t.default.number),onResizeStop:t.default.func,onResizeStart:t.default.func,onResize:t.default.func,resizeHandles:t.default.arrayOf(t.default.oneOf(["s","w","e","n","sw","nw","se","ne"])),transformScale:t.default.number,width:function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];const[o]=s;return o.axis==="both"||o.axis==="x"?t.default.number.isRequired(...s):t.default.number(...s)}},Wp}var a5;function h8(){if(a5)return Jp;a5=1,Jp.__esModule=!0,Jp.default=void 0;var t=o(pl()),e=wv(),n=YM(),s=f8();const i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(T,R){if(typeof WeakMap=="function")var O=new WeakMap,M=new WeakMap;return(o=function(z,k){if(!k&&z&&z.__esModule)return z;var P,q,L={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return L;if(P=k?M:O){if(P.has(z))return P.get(z);P.set(z,L)}for(const U in z)U!=="default"&&{}.hasOwnProperty.call(z,U)&&((q=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,U))&&(q.get||q.set)?P(L,U,q):L[U]=z[U]);return L})(T,R)}function d(){return d=Object.assign?Object.assign.bind():function(T){for(var R=1;R<arguments.length;R++){var O=arguments[R];for(var M in O)({}).hasOwnProperty.call(O,M)&&(T[M]=O[M])}return T},d.apply(null,arguments)}function f(T,R){if(T==null)return{};var O,M,z=p(T,R);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(T);for(M=0;M<k.length;M++)O=k[M],R.indexOf(O)===-1&&{}.propertyIsEnumerable.call(T,O)&&(z[O]=T[O])}return z}function p(T,R){if(T==null)return{};var O={};for(var M in T)if({}.hasOwnProperty.call(T,M)){if(R.indexOf(M)!==-1)continue;O[M]=T[M]}return O}function y(T,R){var O=Object.keys(T);if(Object.getOwnPropertySymbols){var M=Object.getOwnPropertySymbols(T);R&&(M=M.filter(function(z){return Object.getOwnPropertyDescriptor(T,z).enumerable})),O.push.apply(O,M)}return O}function b(T){for(var R=1;R<arguments.length;R++){var O=arguments[R]!=null?arguments[R]:{};R%2?y(Object(O),!0).forEach(function(M){v(T,M,O[M])}):Object.getOwnPropertyDescriptors?Object.defineProperties(T,Object.getOwnPropertyDescriptors(O)):y(Object(O)).forEach(function(M){Object.defineProperty(T,M,Object.getOwnPropertyDescriptor(O,M))})}return T}function v(T,R,O){return(R=_(R))in T?Object.defineProperty(T,R,{value:O,enumerable:!0,configurable:!0,writable:!0}):T[R]=O,T}function _(T){var R=C(T,"string");return typeof R=="symbol"?R:R+""}function C(T,R){if(typeof T!="object"||!T)return T;var O=T[Symbol.toPrimitive];if(O!==void 0){var M=O.call(T,R);if(typeof M!="object")return M;throw new TypeError("@@toPrimitive must return a primitive value.")}return(R==="string"?String:Number)(T)}let w=class extends t.Component{constructor(){super(...arguments),this.handleRefs={},this.lastHandleRect=null,this.slack=null,this.lastSize=null}componentWillUnmount(){this.resetData()}resetData(){this.lastHandleRect=this.slack=this.lastSize=null}runConstraints(R,O){const{minConstraints:M,maxConstraints:z,lockAspectRatio:k}=this.props;if(!M&&!z&&!k)return[R,O];if(k){const V=this.props.width/this.props.height,F=R-this.props.width,re=O-this.props.height;Math.abs(F)>Math.abs(re*V)?O=R/V:R=O*V}const[P,q]=[R,O];let[L,U]=this.slack||[0,0];return R+=L,O+=U,M&&(R=Math.max(M[0],R),O=Math.max(M[1],O)),z&&(R=Math.min(z[0],R),O=Math.min(z[1],O)),this.slack=[L+(P-R),U+(q-O)],[R,O]}resizeHandler(R,O){return(M,z)=>{var $;let{node:k,deltaX:P,deltaY:q}=z;R==="onResizeStart"&&this.resetData();const L=(this.props.axis==="both"||this.props.axis==="x")&&O!=="n"&&O!=="s",U=(this.props.axis==="both"||this.props.axis==="y")&&O!=="e"&&O!=="w";if(!L&&!U)return;const V=O[0],F=O[O.length-1],re=k.getBoundingClientRect();if(this.lastHandleRect!=null){if(F==="w"){const ae=re.left-this.lastHandleRect.left;P+=ae}if(V==="n"){const ae=re.top-this.lastHandleRect.top;q+=ae}}this.lastHandleRect=re,F==="w"&&(P=-P),V==="n"&&(q=-q);let ne=this.props.width+(L?P/this.props.transformScale:0),J=this.props.height+(U?q/this.props.transformScale:0);[ne,J]=this.runConstraints(ne,J),R==="onResizeStop"&&this.lastSize&&({width:ne,height:J}=this.lastSize);const ie=ne!==this.props.width||J!==this.props.height;R!=="onResizeStop"&&(this.lastSize={width:ne,height:J});const ce=typeof this.props[R]=="function"?this.props[R]:null;ce&&!(R==="onResize"&&!ie)&&(($=M.persist)==null||$.call(M),ce(M,{node:k,size:{width:ne,height:J},handle:O})),R==="onResizeStop"&&this.resetData()}}renderResizeHandle(R,O){const{handle:M}=this.props;if(!M)return t.createElement("span",{className:`react-resizable-handle react-resizable-handle-${R}`,ref:O});if(typeof M=="function")return M(R,O);const z=typeof M.type=="string",k=b({ref:O},z?{}:{handleAxis:R});return t.cloneElement(M,k)}render(){const R=this.props,{children:O,className:M,draggableOpts:z,width:k,height:P,handle:q,handleSize:L,lockAspectRatio:U,axis:V,minConstraints:F,maxConstraints:re,onResize:ne,onResizeStop:J,onResizeStart:ie,resizeHandles:ce,transformScale:Y}=R,$=f(R,i);return(0,n.cloneElement)(O,b(b({},$),{},{className:`${M?`${M} `:""}react-resizable`,children:[...t.Children.toArray(O.props.children),...ce.map(ae=>{const je=this.handleRefs[ae]??(this.handleRefs[ae]=t.createRef());return t.createElement(e.DraggableCore,d({},z,{nodeRef:je,key:`resizableHandle-${ae}`,onStop:this.resizeHandler("onResizeStop",ae),onStart:this.resizeHandler("onResizeStart",ae),onDrag:this.resizeHandler("onResize",ae)}),this.renderResizeHandle(ae,je))})]}))}};return Jp.default=w,w.propTypes=s.resizableProps,w.defaultProps={axis:"both",handleSize:[20,20],lockAspectRatio:!1,minConstraints:[20,20],maxConstraints:[1/0,1/0],resizeHandles:["se"],transformScale:1},Jp}var $p={},s5;function VM(){if(s5)return $p;s5=1,$p.__esModule=!0,$p.default=void 0;var t=d(pl()),e=o(ey()),n=o(h8()),s=f8();const i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(R){return R&&R.__esModule?R:{default:R}}function d(R,O){if(typeof WeakMap=="function")var M=new WeakMap,z=new WeakMap;return(d=function(k,P){if(!P&&k&&k.__esModule)return k;var q,L,U={__proto__:null,default:k};if(k===null||typeof k!="object"&&typeof k!="function")return U;if(q=P?z:M){if(q.has(k))return q.get(k);q.set(k,U)}for(const V in k)V!=="default"&&{}.hasOwnProperty.call(k,V)&&((L=(q=Object.defineProperty)&&Object.getOwnPropertyDescriptor(k,V))&&(L.get||L.set)?q(U,V,L):U[V]=k[V]);return U})(R,O)}function f(){return f=Object.assign?Object.assign.bind():function(R){for(var O=1;O<arguments.length;O++){var M=arguments[O];for(var z in M)({}).hasOwnProperty.call(M,z)&&(R[z]=M[z])}return R},f.apply(null,arguments)}function p(R,O){var M=Object.keys(R);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(R);O&&(z=z.filter(function(k){return Object.getOwnPropertyDescriptor(R,k).enumerable})),M.push.apply(M,z)}return M}function y(R){for(var O=1;O<arguments.length;O++){var M=arguments[O]!=null?arguments[O]:{};O%2?p(Object(M),!0).forEach(function(z){b(R,z,M[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(M)):p(Object(M)).forEach(function(z){Object.defineProperty(R,z,Object.getOwnPropertyDescriptor(M,z))})}return R}function b(R,O,M){return(O=v(O))in R?Object.defineProperty(R,O,{value:M,enumerable:!0,configurable:!0,writable:!0}):R[O]=M,R}function v(R){var O=_(R,"string");return typeof O=="symbol"?O:O+""}function _(R,O){if(typeof R!="object"||!R)return R;var M=R[Symbol.toPrimitive];if(M!==void 0){var z=M.call(R,O);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}function C(R,O){if(R==null)return{};var M,z,k=w(R,O);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(R);for(z=0;z<P.length;z++)M=P[z],O.indexOf(M)===-1&&{}.propertyIsEnumerable.call(R,M)&&(k[M]=R[M])}return k}function w(R,O){if(R==null)return{};var M={};for(var z in R)if({}.hasOwnProperty.call(R,z)){if(O.indexOf(z)!==-1)continue;M[z]=R[z]}return M}let T=class extends t.Component{constructor(){super(...arguments),this.state={width:this.props.width,height:this.props.height,propsWidth:this.props.width,propsHeight:this.props.height},this.onResize=(O,M)=>{var k;const{size:z}=M;this.props.onResize?((k=O.persist)==null||k.call(O),this.setState(z,()=>this.props.onResize&&this.props.onResize(O,M))):this.setState(z)}}static getDerivedStateFromProps(O,M){return M.propsWidth!==O.width||M.propsHeight!==O.height?{width:O.width,height:O.height,propsWidth:O.width,propsHeight:O.height}:null}render(){const O=this.props,{handle:M,handleSize:z,onResize:k,onResizeStart:P,onResizeStop:q,draggableOpts:L,minConstraints:U,maxConstraints:V,lockAspectRatio:F,axis:re,width:ne,height:J,resizeHandles:ie,style:ce,transformScale:Y}=O,$=C(O,i);return t.createElement(n.default,{axis:re,draggableOpts:L,handle:M,handleSize:z,height:this.state.height,lockAspectRatio:F,maxConstraints:V,minConstraints:U,onResizeStart:P,onResize:this.onResize,onResizeStop:q,resizeHandles:ie,transformScale:Y,width:this.state.width},t.createElement("div",f({},$,{style:y(y({},ce),{},{width:this.state.width+"px",height:this.state.height+"px"})})))}};return $p.default=T,T.propTypes=y(y({},s.resizableProps),{},{children:e.default.element}),$p}var r5;function QM(){return r5||(r5=1,Ip.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Ip.exports.Resizable=h8().default,Ip.exports.ResizableBox=VM().default),Ip.exports}var KM=QM();function i5(t){const{children:e,cols:n,containerWidth:s,margin:i,containerPadding:o,rowHeight:d,maxRows:f,isDraggable:p,isResizable:y,isBounded:b,static:v,useCSSTransforms:_=!0,usePercentages:C=!1,transformScale:w=1,positionStrategy:T,dragThreshold:R=0,droppingPosition:O,className:M="",style:z,handle:k="",cancel:P="",x:q,y:L,w:U,h:V,minW:F=1,maxW:re=1/0,minH:ne=1,maxH:J=1/0,i:ie,resizeHandles:ce,resizeHandle:Y,constraints:$=X6,layoutItem:ae,layout:je=[],onDragStart:he,onDrag:G,onDragStop:W,onResizeStart:fe,onResize:be,onResizeStop:_e}=t,[me,we]=D.useState(!1),[nt,ze]=D.useState(!1),Vt=D.useRef(null),$e=D.useRef({left:0,top:0}),Mt=D.useRef({top:0,left:0,width:0,height:0}),Ht=D.useRef(void 0),En=D.useRef(je);En.current=je;const Kn=D.useRef(null),Gt=D.useRef(null),fn=D.useRef(!1),ur=D.useRef({x:0,y:0}),Zt=D.useRef(!1),Et=D.useMemo(()=>({cols:n,containerPadding:o,containerWidth:s,margin:i,maxRows:f,rowHeight:d}),[n,o,s,i,f,d]),qn=D.useMemo(()=>({cols:n,maxRows:f,containerWidth:s,containerHeight:0,rowHeight:d,margin:i,layout:[]}),[n,f,s,d,i]),hn=D.useCallback(()=>({...qn,layout:En.current}),[qn]),It=D.useMemo(()=>ae??{i:ie,x:q,y:L,w:U,h:V,minW:F,maxW:re,minH:ne,maxH:J},[ae,ie,q,L,U,V,F,re,ne,J]),Xn=D.useCallback(yt=>{if(T!=null&&T.calcStyle)return T.calcStyle(yt);if(_)return F6(yt);const mt=eM(yt);return C?{...mt,left:U3(yt.left/s),width:U3(yt.width/s)}:mt},[T,_,C,s]),Ss=D.useCallback((yt,{node:mt})=>{if(!he)return;const{offsetParent:Qt}=mt;if(!Qt)return;const At=Qt.getBoundingClientRect(),Hn=mt.getBoundingClientRect(),rn=Hn.left/w,Fn=At.left/w,yn=Hn.top/w,Ra=At.top/w;let oa;if(T!=null&&T.calcDragPosition){const et=yt;oa=T.calcDragPosition(et.clientX,et.clientY,et.clientX-Hn.left,et.clientY-Hn.top)}else oa={left:rn-Fn+Qt.scrollLeft,top:yn-Ra+Qt.scrollTop};if($e.current=oa,R>0){const et=yt;ur.current={x:et.clientX,y:et.clientY},fn.current=!0,Zt.current=!1,we(!0);return}we(!0);const ls=X0(Et,oa.top,oa.left),{x:Bs,y:Ue}=F0($,It,ls.x,ls.y,hn());he(ie,Bs,Ue,{e:yt,node:mt,newPosition:oa})},[he,w,Et,T,R,$,It,hn,ie]),dr=D.useCallback((yt,{node:mt,deltaX:Qt,deltaY:At})=>{if(!G||!me)return;const Hn=yt;if(fn.current&&!Zt.current){const Bs=Hn.clientX-ur.current.x,Ue=Hn.clientY-ur.current.y;if(Math.hypot(Bs,Ue)<R)return;if(Zt.current=!0,fn.current=!1,he){const Ve=X0(Et,$e.current.top,$e.current.left),{x:ct,y:xt}=F0($,It,Ve.x,Ve.y,hn());he(ie,ct,xt,{e:yt,node:mt,newPosition:$e.current})}}let rn=$e.current.top+At,Fn=$e.current.left+Qt;if(b){const{offsetParent:Bs}=mt;if(Bs){const Ue=Bs.clientHeight-eh(V,d,i[1]);rn=M1(rn,0,Ue);const et=uh(Et),Ve=s-eh(U,et,i[0]);Fn=M1(Fn,0,Ve)}}const yn={top:rn,left:Fn};$e.current=yn;const Ra=X0(Et,rn,Fn),{x:oa,y:ls}=F0($,It,Ra.x,Ra.y,hn());G(ie,oa,ls,{e:yt,node:mt,newPosition:yn})},[G,he,me,R,b,V,d,i,Et,s,U,ie,$,It,hn]),Qa=D.useCallback((yt,{node:mt})=>{if(!W||!me)return;const Qt=fn.current;if(fn.current=!1,Zt.current=!1,ur.current={x:0,y:0},Qt){we(!1),$e.current={left:0,top:0};return}const{left:At,top:Hn}=$e.current,rn={top:Hn,left:At};we(!1),$e.current={left:0,top:0};const Fn=X0(Et,Hn,At),{x:yn,y:Ra}=F0($,It,Fn.x,Fn.y,hn());W(ie,yn,Ra,{e:yt,node:mt,newPosition:rn})},[W,me,Et,$,It,hn,ie]);Kn.current=Ss,Gt.current=dr;const la=D.useCallback((yt,{node:mt,size:Qt,handle:At},Hn,rn)=>{const Fn=rn==="onResizeStart"?fe:rn==="onResize"?be:_e;if(!Fn)return;let yn;mt?yn=oM(At,Hn,Qt,s):yn={...Qt,top:Hn.top,left:Hn.left},Mt.current=yn;const Ra=XO(Et,yn.width,yn.height),{w:oa,h:ls}=$O($,It,Ra.w,Ra.h,At,hn());Fn(ie,oa,ls,{e:yt.nativeEvent,node:mt,size:yn,handle:At})},[fe,be,_e,s,Et,ie,$,It,hn]),Ea=D.useCallback((yt,mt)=>{ze(!0);const Qt=Xp(Et,q,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStart")},[la,Et,q,L,U,V]),rs=D.useCallback((yt,mt)=>{const Qt=Xp(Et,q,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResize")},[la,Et,q,L,U,V]),fr=D.useCallback((yt,mt)=>{ze(!1),Mt.current={top:0,left:0,width:0,height:0};const Qt=Xp(Et,q,L,U,V),At={...mt,handle:mt.handle};la(yt,At,Qt,"onResizeStop")},[la,Et,q,L,U,V]);D.useEffect(()=>{var At,Hn;if(!O)return;const yt=Vt.current;if(!yt)return;const mt=Ht.current||{left:0,top:0},Qt=me&&(O.left!==mt.left||O.top!==mt.top);if(me){if(Qt){const rn=O.left-$e.current.left,Fn=O.top-$e.current.top,yn={node:yt,deltaX:rn,deltaY:Fn,lastX:$e.current.left,lastY:$e.current.top,x:O.left,y:O.top};(Hn=Gt.current)==null||Hn.call(Gt,O.e,yn)}}else{const rn={node:yt,deltaX:O.left,deltaY:O.top,lastX:0,lastY:0,x:O.left,y:O.top};(At=Kn.current)==null||At.call(Kn,O.e,rn)}Ht.current=O},[O,me,ie]);const Ns=Xp(Et,q,L,U,V,me?$e.current:null,nt?Mt.current:null),Hs=en.Children.only(e),ta=Xp(Et,0,0,1,1),is=[ta.width,ta.height],ba=[1/0,1/0],Ta=Hs.props,Pc=Ta.className,Sl=Ta.style;let _s=en.cloneElement(Hs,{ref:Vt,className:V1("react-grid-item",Pc,M,{static:v,resizing:nt,"react-draggable":p,"react-draggable-dragging":me,dropping:!!O,cssTransforms:_}),style:{...z,...Sl,...Xn(Ns)}});const hr=Y;return _s=h.jsx(KM.Resizable,{draggableOpts:{disabled:!y},className:y?void 0:"react-resizable-hide",width:Ns.width,height:Ns.height,minConstraints:is,maxConstraints:ba,onResizeStart:Ea,onResize:rs,onResizeStop:fr,transformScale:w,resizeHandles:ce,handle:hr,children:_s}),_s=h.jsx(PM.DraggableCore,{disabled:!p,onStart:Ss,onDrag:dr,onStop:Qa,handle:k,cancel:".react-resizable-handle"+(P?","+P:""),scale:w,nodeRef:Vt,children:_s}),_s}var $l=()=>{},l5="react-grid-layout",p8=!1;try{p8=/firefox/i.test(navigator.userAgent)}catch{}function XM(t,e){const n=en.Children.toArray(t),s=en.Children.toArray(e);if(n.length!==s.length)return!1;for(let i=0;i<n.length;i++){const o=n[i],d=s[i];if((o==null?void 0:o.key)!==(d==null?void 0:d.key))return!1}return!0}function o5(t,e,n,s){const i=[],o=new Set;en.Children.forEach(e,f=>{if(!en.isValidElement(f)||f.key===null)return;const p=String(f.key);o.add(p);const y=t.find(b=>b.i===p);if(y)i.push(Ju(y));else{const v=f.props["data-grid"];v?i.push({i:p,x:v.x??0,y:v.y??0,w:v.w??1,h:v.h??1,minW:v.minW,maxW:v.maxW,minH:v.minH,maxH:v.maxH,static:v.static,isDraggable:v.isDraggable,isResizable:v.isResizable,resizeHandles:v.resizeHandles,isBounded:v.isBounded}):i.push({i:p,x:0,y:Z1(i),w:1,h:1})}});const d=xv(i,{cols:n});return s.compact(d,n)}function FM(t){const{children:e,width:n,gridConfig:s,dragConfig:i,resizeConfig:o,dropConfig:d,positionStrategy:f=uM,compactor:p,constraints:y=X6,layout:b=[],droppingItem:v,autoSize:_=!0,className:C="",style:w={},innerRef:T,onLayoutChange:R=$l,onDragStart:O=$l,onDrag:M=$l,onDragStop:z=$l,onResizeStart:k=$l,onResize:P=$l,onResizeStop:q=$l,onDrop:L=$l,onDropDragOver:U=$l}=t,V=D.useMemo(()=>({...dM,...s}),[s]),F=D.useMemo(()=>({...fM,...i}),[i]),re=D.useMemo(()=>({...hM,...o}),[o]),ne=D.useMemo(()=>({...pM,...d}),[d]),{cols:J,rowHeight:ie,maxRows:ce,margin:Y,containerPadding:$}=V,{enabled:ae,bounded:je,handle:he,cancel:G,threshold:W}=F,{enabled:fe,handles:be,handleComponent:_e}=re,{enabled:me,defaultItem:we,onDragOver:nt}=ne,ze=p??jv("vertical"),Vt=ze.type,$e=ze.allowOverlap,Mt=ze.preventCollision??!1,Ht=D.useMemo(()=>v??{i:"__dropping-elem__",...we},[v,we]),En=f.type==="transform",Kn=f.scale,Gt=$??Y,[fn,ur]=D.useState(!1),[Zt,Et]=D.useState(()=>o5(b,e,J,ze)),[qn,hn]=D.useState(null),[It,Xn]=D.useState(!1),[Ss,dr]=D.useState(null),[Qa,la]=D.useState(),Ea=D.useRef(null),rs=D.useRef(null),fr=D.useRef(null),Ns=D.useRef(0),Hs=D.useRef(Zt),ta=D.useRef(b),is=D.useRef(e),ba=D.useRef(Vt),Ta=D.useRef(Zt);Ta.current=Zt,D.useEffect(()=>{ur(!0),so(Zt,b)||R(Zt)},[]),D.useEffect(()=>{if(qn||Ss)return;const Ue=!so(b,ta.current),et=!XM(e,is.current),Ve=Vt!==ba.current;if(Ue||et||Ve){const xt=o5(Ue?b:Zt,e,J,ze);so(xt,Zt)||Et(xt)}ta.current=b,is.current=e,ba.current=Vt},[b,e,J,Vt,ze,qn,Ss,Zt]),D.useEffect(()=>{if(!qn&&!so(Zt,Hs.current)){Hs.current=Zt;const Ue=Zt.filter(et=>et.i!==Ht.i);R(Ue)}},[Zt,qn,R,Ht.i]);const Pc=D.useMemo(()=>{if(!_)return;const Ue=Z1(Zt),et=Gt[1];return Ue*ie+(Ue-1)*Y[1]+et*2+"px"},[_,Zt,ie,Y,Gt]),Sl=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Lu(xt,Ue);if(!Fe)return;const ut={w:Fe.w,h:Fe.h,x:Fe.x,y:Fe.y,i:Ue};Ea.current=Ju(Fe),fr.current=xt,hn(ut),O(xt,Fe,Fe,null,ct.e,ct.node)},[O]),_s=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Ea.current,ut=Lu(xt,Ue);if(!ut)return;const sn={w:ut.w,h:ut.h,x:ut.x,y:ut.y,i:Ue},Tt=Uu(xt,ut,et,Ve,!0,Mt,Vt,J,$e);M(Tt,Fe,ut,sn,ct.e,ct.node),Et(ze.compact(Tt,J)),hn(sn)},[Mt,Vt,J,$e,ze,M]),hr=D.useCallback((Ue,et,Ve,ct)=>{if(!qn)return;const xt=Ta.current,Fe=Ea.current,ut=Lu(xt,Ue);if(!ut)return;const sn=Uu(xt,ut,et,Ve,!0,Mt,Vt,J,$e),Tt=ze.compact(sn,J);z(Tt,Fe,ut,null,ct.e,ct.node);const pn=fr.current;Ea.current=null,fr.current=null,hn(null),Et(Tt),pn&&!so(pn,Tt)&&R(Tt)},[qn,Mt,Vt,J,$e,ze,z,R]),yt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=Lu(xt,Ue);Fe&&(rs.current=Ju(Fe),fr.current=xt,Xn(!0),k(xt,Fe,Fe,null,ct.e,ct.node))},[k]),mt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=rs.current,{handle:ut}=ct;let sn=!1,Tt,pn;const[Rr,os]=IO(xt,Ue,Pt=>(Tt=Pt.x,pn=Pt.y,["sw","w","nw","n","ne"].includes(ut)&&(["sw","nw","w"].includes(ut)&&(Tt=Pt.x+(Pt.w-et),et=Pt.x!==Tt&&Tt<0?Pt.w:et,Tt=Tt<0?0:Tt),["ne","n","nw"].includes(ut)&&(pn=Pt.y+(Pt.h-Ve),Ve=Pt.y!==pn&&pn<0?Pt.h:Ve,pn=pn<0?0:pn),sn=!0),Mt&&!$e&&Q6(xt,{...Pt,w:et,h:Ve,x:Tt??Pt.x,y:pn??Pt.y}).filter(mr=>mr.i!==Pt.i).length>0&&(pn=Pt.y,Ve=Pt.h,Tt=Pt.x,et=Pt.w,sn=!1),Pt.w=et,Pt.h=Ve,Pt));if(!os)return;let Ka=Rr;sn&&Tt!==void 0&&pn!==void 0&&(Ka=Uu(Rr,os,Tt,pn,!0,Mt,Vt,J,$e));const Gs={w:os.w,h:os.h,x:os.x,y:os.y,i:Ue,static:!0};P(Ka,Fe,os,Gs,ct.e,ct.node),Et(ze.compact(Ka,J)),hn(Gs)},[Mt,Vt,J,$e,ze,P]),Qt=D.useCallback((Ue,et,Ve,ct)=>{const xt=Ta.current,Fe=rs.current,ut=Lu(xt,Ue),sn=ze.compact(xt,J);q(sn,Fe,ut??null,null,ct.e,ct.node);const Tt=fr.current;rs.current=null,fr.current=null,hn(null),Xn(!1),Et(sn),Tt&&!so(Tt,sn)&&R(sn)},[J,ze,q,R]),At=D.useCallback(()=>{const Ue=Ta.current;if(!Ue.some(ct=>ct.i===Ht.i)){dr(null),hn(null),la(void 0);return}const Ve=ze.compact(Ue.filter(ct=>ct.i!==Ht.i),J);Et(Ve),dr(null),hn(null),la(void 0)},[Ht.i,J,ze]),Hn=D.useCallback(Ue=>{var Tn;if(Ue.preventDefault(),Ue.stopPropagation(),p8&&!((Tn=Ue.nativeEvent.target)!=null&&Tn.classList.contains(l5)))return!1;const et=nt?nt(Ue.nativeEvent):U(Ue);if(et===!1)return Ss&&At(),!1;const{dragOffsetX:Ve=0,dragOffsetY:ct=0,...xt}=et??{},Fe={...Ht,...xt},ut=Ue.currentTarget.getBoundingClientRect(),sn={cols:J,margin:Y,maxRows:ce,rowHeight:ie,containerWidth:n,containerPadding:Gt},Tt=uh(sn),pn=eh(Fe.w,Tt,Y[0]),Rr=eh(Fe.h,ie,Y[1]),os=pn/2,Ka=Rr/2,Gs=Ue.clientX-ut.left+Ve-os,Pt=Ue.clientY-ut.top+ct-Ka,pr=Math.max(0,Gs),mr=Math.max(0,Pt),js={left:pr/Kn,top:mr/Kn,e:Ue.nativeEvent};if(Ss)Qa&&(Qa.left!==js.left||Qa.top!==js.top)&&la(js);else{const Cs=KO(sn,mr,pr,Fe.w,Fe.h);dr(h.jsx("div",{},Fe.i)),la(js),Et([...Ta.current,{...Fe,x:Cs.x,y:Cs.y,static:!1,isDraggable:!0}])}},[Ss,Qa,Ht,nt,U,At,Kn,J,Y,ce,ie,n,Gt]),rn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ns.current--,Ns.current<0&&(Ns.current=0),Ns.current===0&&At()},[At]),Fn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),Ns.current++},[]),yn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation();const et=Ta.current,Ve=et.find(ct=>ct.i===Ht.i);Ns.current=0,At(),L(et,Ve,Ue.nativeEvent)},[Ht.i,At,L]),Ra=D.useCallback((Ue,et)=>{if(!Ue||!Ue.key)return null;const Ve=Lu(Zt,String(Ue.key));if(!Ve)return null;const ct=typeof Ve.isDraggable=="boolean"?Ve.isDraggable:!Ve.static&&ae,xt=typeof Ve.isResizable=="boolean"?Ve.isResizable:!Ve.static&&fe,Fe=Ve.resizeHandles||[...be],ut=ct&&je&&Ve.isBounded!==!1,sn=_e;return h.jsx(i5,{containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,cancel:G,handle:he,onDragStart:Sl,onDrag:_s,onDragStop:hr,onResizeStart:yt,onResize:mt,onResizeStop:Qt,isDraggable:ct,isResizable:xt,isBounded:ut,useCSSTransforms:En&&fn,usePercentages:!fn,transformScale:Kn,positionStrategy:f,dragThreshold:W,w:Ve.w,h:Ve.h,x:Ve.x,y:Ve.y,i:Ve.i,minH:Ve.minH,minW:Ve.minW,maxH:Ve.maxH,maxW:Ve.maxW,static:Ve.static,droppingPosition:et?Qa:void 0,resizeHandles:Fe,resizeHandle:sn,constraints:y,layoutItem:Ve,layout:Zt,children:Ue},Ve.i)},[Zt,n,J,Y,Gt,ce,ie,G,he,Sl,_s,hr,yt,mt,Qt,ae,fe,je,En,fn,Kn,f,W,Qa,be,_e,y]),oa=()=>qn?h.jsx(i5,{w:qn.w,h:qn.h,x:qn.x,y:qn.y,i:qn.i,className:`react-grid-placeholder ${It?"placeholder-resizing":""}`,containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:ie,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:En,transformScale:Kn,constraints:y,layout:Zt,children:h.jsx("div",{})}):null,ls=V1(l5,C),Bs={height:Pc,...w};return h.jsxs("div",{ref:T,className:ls,style:Bs,onDrop:me?yn:void 0,onDragLeave:me?rn:void 0,onDragEnter:me?Fn:void 0,onDragOver:me?Hn:void 0,children:[en.Children.map(e,Ue=>en.isValidElement(Ue)?Ra(Ue):null),me&&Ss&&Ra(Ss,!0),oa()]})}var ZM={lg:1200,md:996,sm:768,xs:480,xxs:0},IM={lg:12,md:10,sm:6,xs:4,xxs:2},yx=()=>{};function JM(t,e,n,s){const i=[];en.Children.forEach(e,d=>{if(!en.isValidElement(d)||d.key===null)return;const f=String(d.key),p=t.find(y=>y.i===f);if(p)i.push({...p,i:f});else{const b=d.props["data-grid"];b?i.push({i:f,x:b.x??0,y:b.y??0,w:b.w??1,h:b.h??1,minW:b.minW,maxW:b.maxW,minH:b.minH,maxH:b.maxH,static:b.static,isDraggable:b.isDraggable,isResizable:b.isResizable,resizeHandles:b.resizeHandles,isBounded:b.isBounded}):i.push({i:f,x:0,y:Z1(i),w:1,h:1})}});const o=xv(i,{cols:n});return s.compact(o,n)}function WM(t){const{children:e,width:n,breakpoint:s,breakpoints:i=ZM,cols:o=IM,layouts:d={},rowHeight:f=150,maxRows:p=1/0,margin:y=[10,10],containerPadding:b=null,compactor:v,onBreakpointChange:_=yx,onLayoutChange:C=yx,onWidthChange:w=yx,...T}=t,R=v??jv("vertical"),O=R.type,M=R.allowOverlap,z=D.useMemo(()=>s??q3(i,n),[]),k=D.useMemo(()=>H3(z,o),[z,o]),P=D.useMemo(()=>fx(d,i,z,z,k,O),[]),[q,L]=D.useState(z),[U,V]=D.useState(k),[F,re]=D.useState(P),[ne,J]=D.useState(d),ie=D.useRef(n),ce=D.useRef(s),Y=D.useRef(i),$=D.useRef(o),ae=D.useRef(d),je=D.useRef(O),he=D.useRef(ne);D.useEffect(()=>{he.current=ne},[ne]);const G=D.useMemo(()=>so(d,ae.current)?null:fx(d,i,q,q,U,R),[d,i,q,U,R]),W=G??F;D.useEffect(()=>{G!==null&&(re(G),J(d),he.current=d,ae.current=d)},[G,d]),D.useEffect(()=>{if(O!==je.current){const we=R.compact(zc(W),U),nt={...he.current,[q]:we};re(we),J(nt),he.current=nt,C(we,nt),je.current=O}},[O,R,W,U,M,q,C]),D.useEffect(()=>{const we=n!==ie.current,nt=s!==ce.current,ze=!so(i,Y.current),Vt=!so(o,$.current);if(we||nt||ze||Vt){const $e=s??q3(i,n),Mt=H3($e,o),Ht=q;if(Ht!==$e||ze||Vt){const Gt={...he.current};Gt[Ht]||(Gt[Ht]=zc(F));let fn=fx(Gt,i,$e,Ht,Mt,R);fn=JM(fn,e,Mt,R),Gt[$e]=fn,L($e),V(Mt),re(fn),J(Gt),he.current=Gt,_($e,Mt),C(fn,Gt)}const En=Z0(y,$e),Kn=b?Z0(b,$e):null;w(n,En,Mt,Kn),ie.current=n,ce.current=s,Y.current=i,$.current=o}},[n,s,i,o,q,U,F,e,R,O,M,y,b,_,C,w]);const fe=D.useCallback(we=>{const ze={...he.current,[q]:we};re(we),J(ze),he.current=ze,C(we,ze)},[q,C]),be=D.useMemo(()=>Z0(y,q),[y,q]),_e=D.useMemo(()=>b===null?null:Z0(b,q),[b,q]),me=D.useMemo(()=>({cols:U,rowHeight:f,maxRows:p,margin:be,containerPadding:_e}),[U,f,p,be,_e]);return h.jsx(FM,{...T,width:n,gridConfig:me,compactor:R,onLayoutChange:fe,layout:W,children:e})}function $M({block:t,config:e,size:n,onRemove:s,onConfigChange:i}){const[o,d]=D.useState(!1),f=t.component,p=t.icon;return h.jsxs("div",{className:"flex flex-col h-full rounded-lg border border-border bg-surface shadow-sm shadow-black/5 overflow-hidden hover:shadow-md hover:shadow-black/8 transition-shadow",children:[h.jsxs("div",{className:"drag-handle flex items-center h-8 px-2 border-b border-border bg-surface/80 shrink-0 cursor-move group",children:[h.jsx(AT,{className:"h-3 w-3 text-foreground-subtle/30 group-hover:text-foreground-subtle transition-colors mr-1"}),h.jsx(p,{className:"h-3 w-3 text-primary/70 mr-1.5 shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground/80 truncate flex-1",children:t.name}),h.jsxs("div",{className:"flex items-center gap-0.5 opacity-0 group-hover:opacity-100 transition-opacity",children:[t.configSchema&&t.configSchema.length>0&&h.jsx("button",{onClick:y=>{y.stopPropagation(),d(!o)},className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(Im,{className:"h-3 w-3"})}),h.jsx("button",{onClick:y=>{y.stopPropagation(),s()},className:"p-1 rounded-md hover:bg-danger/10 text-foreground-subtle hover:text-danger transition-colors",children:h.jsx(bl,{className:"h-3 w-3"})})]})]}),o&&t.configSchema&&h.jsx("div",{className:"p-2.5 border-b border-border bg-background/50 space-y-2",children:t.configSchema.map(y=>{var b;return h.jsxs("label",{className:"flex items-center gap-2 text-[11px]",children:[h.jsx("span",{className:"text-foreground-subtle w-20 shrink-0",children:y.label}),y.type==="number"&&h.jsx("input",{type:"number",value:e[y.key]??y.defaultValue??"",onChange:v=>i({...e,[y.key]:Number(v.target.value)}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="text"&&h.jsx("input",{type:"text",value:e[y.key]??y.defaultValue??"",onChange:v=>i({...e,[y.key]:v.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none"}),y.type==="boolean"&&h.jsx("input",{type:"checkbox",checked:e[y.key]??y.defaultValue??!1,onChange:v=>i({...e,[y.key]:v.target.checked}),className:"accent-primary"}),y.type==="select"&&h.jsx("select",{value:e[y.key]??y.defaultValue??"",onChange:v=>i({...e,[y.key]:v.target.value}),className:"flex-1 rounded-md border border-border bg-surface px-2 py-1 text-foreground text-[11px] focus:border-primary outline-none",children:(b=y.options)==null?void 0:b.map(v=>h.jsx("option",{value:v.value,children:v.label},v.value))})]},y.key)})}),h.jsx("div",{className:"flex-1 overflow-auto p-3",children:h.jsx(f,{config:e,size:n})})]})}function eA({open:t,onClose:e,onSelect:n}){if(!t)return null;const s=qO();return h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/60 backdrop-blur-sm",onClick:e,children:h.jsxs("div",{className:"w-full max-w-md rounded-xl border border-border bg-surface p-5 shadow-2xl shadow-black/20",onClick:i=>i.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Add Block"}),h.jsx("button",{onClick:e,className:"p-1 rounded-md hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(bl,{className:"h-4 w-4"})})]}),h.jsx("div",{className:"grid grid-cols-2 gap-2",children:s.map(i=>{const o=i.icon;return h.jsxs("button",{onClick:()=>{n(i),e()},className:"flex items-center gap-3 rounded-lg border border-border p-3 text-left hover:bg-surface-hover hover:border-primary/30 transition-all group",children:[h.jsx("div",{className:"flex h-8 w-8 items-center justify-center rounded-md bg-primary/10 group-hover:bg-primary/15 transition-colors shrink-0",children:h.jsx(o,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{children:[h.jsx("span",{className:"text-xs font-medium text-foreground block",children:i.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.defaultSize.w,"x",i.defaultSize.h]})]})]},i.id)})})]})})}const tA=WM,m8="camstack-dashboard-state",nA={lg:1200,md:996,sm:768,xs:0},aA={lg:12,md:8,sm:4,xs:2};function sA(){try{const t=localStorage.getItem(m8);if(t)return JSON.parse(t)}catch{}return{items:[]}}function rA(t){localStorage.setItem(m8,JSON.stringify(t))}let c5=0;function iA(){const[t,e]=D.useState(sA),[n,s]=D.useState(!1),i=D.useCallback(b=>{e(b),rA(b)},[]),o=D.useCallback(b=>{var w;c5++;const v=`${b.id}-${c5}`,_={};(w=b.configSchema)==null||w.forEach(T=>{T.defaultValue!==void 0&&(_[T.key]=T.defaultValue)});const C={i:v,blockId:b.id,x:0,y:1/0,w:b.defaultSize.w,h:b.defaultSize.h,config:_};i({items:[...t.items,C]})},[t,i]),d=D.useCallback(b=>{i({items:t.items.filter(v=>v.i!==b)})},[t,i]),f=D.useCallback((b,v)=>{i({items:t.items.map(_=>_.i===b?{..._,config:v}:_)})},[t,i]),p=D.useCallback(b=>{i({items:t.items.map(v=>{const _=b.find(C=>C.i===v.i);return _?{...v,x:_.x,y:_.y,w:_.w,h:_.h}:v})})},[t,i]),y=t.items.map(b=>{var _,C;const v=k3(b.blockId);return{i:b.i,x:b.x,y:b.y,w:b.w,h:b.h,minW:((_=v==null?void 0:v.minSize)==null?void 0:_.w)??2,minH:((C=v==null?void 0:v.minSize)==null?void 0:C.h)??2}});return h.jsxs("div",{className:"p-4",children:[h.jsxs("div",{className:"flex items-center justify-between mb-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Dashboard"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add Block"]})]}),t.items.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-24 text-foreground-subtle",children:[h.jsx("div",{className:"flex h-16 w-16 items-center justify-center rounded-2xl bg-surface border border-border mb-4",children:h.jsx(M6,{className:"h-8 w-8 text-foreground-subtle/40"})}),h.jsx("p",{className:"text-sm font-medium text-foreground/70",children:"Your dashboard is empty"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-1 mb-4",children:"Add blocks to monitor your cameras and system"}),h.jsxs("button",{onClick:()=>s(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-4 py-2 text-xs font-semibold text-primary-foreground shadow-md shadow-primary/20 hover:shadow-lg transition-all",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Add your first block"]})]}):h.jsx(tA,{layouts:{lg:y},breakpoints:nA,cols:aA,rowHeight:60,draggableHandle:".drag-handle",onLayoutChange:p,isResizable:!0,isDraggable:!0,children:t.items.map(b=>{const v=k3(b.blockId);return v?h.jsx("div",{children:h.jsx($M,{block:v,config:b.config,size:{w:b.w,h:b.h},onRemove:()=>d(b.i),onConfigChange:_=>f(b.i,_)})},b.i):h.jsx("div",{},b.i)})}),h.jsx(eA,{open:n,onClose:()=>s(!1),onSelect:o})]})}function lA(){return h.jsx(iA,{})}const Cb={frigate:{icon:WE,color:"#3b82f6",label:"Frigate"},scrypted:{icon:E1,color:"#a855f7",label:"Scrypted"},reolink:{icon:fv,color:"#06b6d4",label:"Reolink"},homeassistant:{icon:kT,color:"#22d3ee",label:"Home Assistant"},rtsp:{icon:m3,color:"#78716c",label:"RTSP"},onvif:{icon:m3,color:"#78716c",label:"ONVIF"}},oA={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},cA={sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"};function ny({type:t,size:e="md",showLabel:n}){const s=Cb[t]??Cb.rtsp,i=s.icon;return h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("div",{className:`flex items-center justify-center rounded-lg ${cA[e]}`,style:{backgroundColor:`${s.color}15`},children:h.jsx(i,{className:oA[e],style:{color:s.color}})}),n&&h.jsx("span",{className:"text-xs font-medium text-foreground-subtle",children:s.label})]})}function g8(t){var e;return((e=Cb[t])==null?void 0:e.label)??t}const u5={running:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Running"},stopped:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Stopped"},error:{bg:"bg-danger/10",text:"text-danger",dot:"bg-danger",label:"Error"},online:{bg:"bg-success/10",text:"text-success",dot:"bg-success",label:"Online"},offline:{bg:"bg-foreground-subtle/10",text:"text-foreground-subtle",dot:"bg-foreground-subtle",label:"Offline"},idle:{bg:"bg-info/10",text:"text-info",dot:"bg-info",label:"Idle"}};function th({status:t}){const e=u5[t]??u5.stopped;return h.jsxs("span",{className:`inline-flex items-center gap-1.5 rounded-full px-2 py-0.5 text-[10px] font-medium ${e.bg} ${e.text}`,children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${e.dot}`}),e.label]})}const d5={online:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},running:{label:"ACTIVE",bg:"bg-success/15",text:"text-success"},watching:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},idle:{label:"WATCHING",bg:"bg-warning/15",text:"text-warning"},offline:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},stopped:{label:"OFFLINE",bg:"bg-foreground-subtle/10",text:"text-foreground-subtle"},error:{label:"OFFLINE",bg:"bg-danger/15",text:"text-danger"}};function uA({id:t,name:e,status:n,detectionsToday:s,inferenceMs:i}){const o=gl(),d=d5[n]??d5.offline;return h.jsxs("button",{onClick:()=>o(`/devices/${t}`),className:"group flex flex-col rounded-lg border border-border bg-surface text-left hover:border-primary/30 hover:shadow-md hover:shadow-black/5 transition-all w-full overflow-hidden",children:[h.jsxs("div",{className:"relative aspect-video w-full bg-background flex items-center justify-center",children:[h.jsx(Lc,{className:"h-8 w-8 text-foreground-subtle/20"}),h.jsx("span",{className:`absolute top-2 right-2 inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-bold tracking-wider ${d.bg} ${d.text}`,children:d.label})]}),h.jsxs("div",{className:"px-3 py-2.5 space-y-1.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground truncate group-hover:text-primary transition-colors",children:e}),h.jsxs("div",{className:"flex items-center gap-3 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(ch,{className:"h-3 w-3"}),s," today"]}),h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx(cv,{className:"h-3 w-3"}),i,"ms"]})]})]})]})}function dA({providerType:t,providerName:e,providerStatus:n,devices:s}){return h.jsxs("section",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(ny,{type:t,size:"md"}),h.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground truncate",children:e||g8(t)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:[s.length," camera",s.length!==1?"s":""]})]}),h.jsx(th,{status:n})]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:s.map(i=>h.jsx(uA,{id:i.id,name:i.name,status:i.status,detectionsToday:0,inferenceMs:0},i.id))})]})}function fA(){const{t}=Er(),e=Ft(),[n,s]=D.useState(""),{data:i,isLoading:o}=ot({queryKey:["devices"],queryFn:()=>e.listDevices(),refetchInterval:5e3}),{data:d,isLoading:f}=ot({queryKey:["providers"],queryFn:()=>e.listProviders()}),p=i??[],y=d??[],b=D.useMemo(()=>{const C=n.toLowerCase();return p.filter(w=>{const T=(w.type??"").toLowerCase(),R=w.capabilities??[];return T==="camera"||T.includes("camera")||R.some(k=>k.toLowerCase().includes("video")||k.toLowerCase().includes("stream"))||!T||T==="—"?C?(w.name??w.id??"").toLowerCase().includes(C):!0:!1})},[p,n]),v=D.useMemo(()=>{const C=new Map;for(const w of b){const T=w.providerId??"";C.has(T)||C.set(T,[]),C.get(T).push(w)}return C},[b]),_=o||f;return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.cameras","Cameras")}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsxs("div",{className:"relative",children:[h.jsx(hv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:n,onChange:C=>s(C.target.value),placeholder:"Search cameras...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsxs("span",{className:"text-[11px] text-foreground-subtle",children:[b.length," camera",b.length!==1?"s":""]})]})]}),_&&h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3",children:[1,2,3,4,5,6].map(C=>h.jsx("div",{className:"aspect-[16/12] rounded-lg border border-border bg-surface animate-pulse"},C))}),!_&&b.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx(Lc,{className:"h-12 w-12 mb-4 opacity-20"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"No cameras found"}),h.jsx("p",{className:"text-xs mt-1",children:n?"Try a different search term":"Add an integration to discover cameras"})]}),!_&&Array.from(v.entries()).map(([C,w])=>{var R;const T=y.find(O=>O.id===C);return h.jsx(dA,{providerType:(T==null?void 0:T.type)??"rtsp",providerName:(T==null?void 0:T.name)??C,providerStatus:(R=T==null?void 0:T.status)!=null&&R.connected?"running":"stopped",devices:w.map(O=>{var M;return{id:O.id,name:O.name??O.id,status:(M=O.state)!=null&&M.online?"online":"offline"}})},C)})]})}function hA({onSelect:t,onClose:e}){const{t:n}=Er(),s=Ft(),i=gl(),{data:o,isLoading:d}=ot({queryKey:["provider-types"],queryFn:()=>s.listProviderTypes()});return d?h.jsx("div",{className:"space-y-2 p-2",children:[1,2,3].map(f=>h.jsx("div",{className:"h-14 rounded-lg bg-surface animate-pulse"},f))}):h.jsxs("div",{className:"space-y-2",children:[(o??[]).map(f=>{const p=f.instanceMode==="unique"&&f.existingInstances.length>0;return h.jsxs("button",{onClick:()=>{if(p){const y=f.existingInstances[0].id;e(),i(`/integrations/${y}`)}else t(f.addonId,f.instanceMode,f.discoveryMode)},className:"flex w-full items-center gap-3 rounded-lg border border-border bg-surface p-3 text-left hover:border-foreground-subtle/30 transition-colors",children:[f.iconUrl?h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("img",{src:f.iconUrl,alt:"",className:"h-5 w-5"})}):h.jsx("div",{className:"flex h-9 w-9 items-center justify-center rounded-lg flex-shrink-0",style:{backgroundColor:`${f.color}15`},children:h.jsx("span",{className:"text-sm",style:{color:f.color},children:"◉"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:f.name}),f.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 truncate",children:f.description})]}),p?h.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium text-foreground-subtle",children:[h.jsx(Im,{className:"h-3 w-3"}),n("integrations.manage")]}):h.jsx(Zu,{className:"h-4 w-4 text-foreground-subtle flex-shrink-0"})]},f.addonId)}),(o??[]).length===0&&h.jsx("div",{className:"py-8 text-center text-xs text-foreground-subtle",children:n("integrations.noProviders")})]})}function pA({tabs:t,active:e,onChange:n}){return h.jsx("div",{className:"flex rounded-lg border border-border bg-surface p-0.5 gap-0.5",children:t.map(s=>h.jsx("button",{type:"button",onClick:()=>n(s.id),className:["flex-1 rounded-md px-3 py-1.5 text-xs font-medium transition-colors",e===s.id?"bg-primary/12 text-primary":"text-foreground-subtle hover:text-foreground hover:bg-surface-hover"].join(" "),children:s.label},s.id))})}function mA(t){const e=t.formats;if(!e)return"";const n=Object.values(e).filter(o=>o!==void 0&&o.sizeMB>0).map(o=>o.sizeMB);if(n.length===0)return"";const s=Math.min(...n),i=Math.max(...n);return s===i?`${s} MB`:`${s}-${i} MB`}function gA(t){return`${t.inputSize.width}x${t.inputSize.height}`}function yA(t){return t.formats?Object.keys(t.formats).filter(e=>t.formats[e]!==void 0):[]}function xA({entry:t,selected:e,onSelect:n,disabled:s}){const i=mA(t),o=gA(t),d=yA(t);return h.jsxs("button",{type:"button",onClick:n,disabled:s,className:["w-full text-left rounded-lg border p-3 transition-all",e?"border-primary bg-primary/5 ring-1 ring-primary/30":"border-border bg-background hover:border-foreground-subtle/40 hover:bg-surface-hover/50",s?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:[h.jsx("div",{className:"flex items-start justify-between gap-2",children:h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-semibold text-foreground truncate",children:t.name}),e&&h.jsx(Fm,{className:"h-3.5 w-3.5 text-primary shrink-0"})]}),h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-2",children:t.description})]})}),h.jsxs("div",{className:"flex items-center gap-3 mt-2 flex-wrap",children:[h.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(zf,{className:"h-3 w-3"}),o]}),i&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:i}),d.length>0&&h.jsx("div",{className:"flex gap-1",children:d.map(f=>h.jsx("span",{className:"text-[9px] uppercase rounded bg-surface border border-border px-1 py-0.5 text-foreground-subtle font-mono",children:f},f))}),t.labels.length>0&&h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.labels.length," label",t.labels.length!==1?"s":""]})]})]})}function bA({field:t,value:e,onChange:n,disabled:s}){const i=t.catalog??[],o=i.length>0,d=t.allowCustomPath!==!1||t.allowCustom===!0,f=[...o?[{id:"catalog",label:`Models (${i.length})`}]:[],...d?[{id:"custom",label:"Custom Path"}]:[]],[p,y]=D.useState(o?"catalog":"custom"),b=e==null?"":String(e);return h.jsxs("div",{className:"space-y-3",children:[f.length>1&&h.jsx(pA,{tabs:f,active:p,onChange:y}),p==="catalog"&&o&&h.jsx("div",{className:"space-y-1.5 max-h-[320px] overflow-y-auto pr-1",children:i.map(v=>h.jsx(xA,{entry:v,selected:b===v.id,onSelect:()=>n(v.id),disabled:s||t.disabled},v.id))}),p==="catalog"&&!o&&h.jsxs("div",{className:"rounded-md border border-info/30 bg-info/5 px-3 py-2 flex items-start gap-2",children:[h.jsx(j1,{className:"h-3.5 w-3.5 text-info shrink-0 mt-0.5"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle leading-relaxed",children:"No predefined models available. Use the Custom Path tab to specify a model file path or URL."})]}),p==="custom"&&d&&h.jsxs("div",{className:"space-y-2",children:[h.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50",placeholder:"Enter path like /data/models/custom.onnx or https://...",value:b,disabled:s||t.disabled,onChange:v=>n(v.target.value)}),t.acceptFormats&&t.acceptFormats.length>0&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:["Accepted formats: ",t.acceptFormats.join(", ")]})]}),(t.compatibilityNote||t.conversionGuideUrl)&&h.jsxs("div",{className:"flex items-start justify-between gap-3 pt-1",children:[t.compatibilityNote&&h.jsxs("p",{className:"flex items-start gap-1 text-[10px] text-foreground-subtle",children:[h.jsx(j1,{className:"h-3 w-3 mt-0.5 shrink-0"}),t.compatibilityNote]}),t.conversionGuideUrl&&h.jsxs("a",{href:t.conversionGuideUrl,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-[11px] text-primary hover:underline shrink-0",children:["How to convert your model",h.jsx(vT,{className:"h-3 w-3"})]})]})]})}const dh="w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none disabled:opacity-50 disabled:cursor-not-allowed",y8="block text-xs font-medium text-foreground mb-1",vA="text-[10px] text-foreground-subtle mt-0.5";function ri({label:t,description:e,required:n,span:s,children:i,translationFn:o}){const d=s===2?"col-span-2":s===3?"col-span-3":s===4?"col-span-4":"col-span-1",f=Wu(t,o),p=Wu(e,o);return h.jsxs("div",{className:d,children:[f!==void 0&&h.jsxs("label",{className:y8,children:[f,n&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),i,p&&h.jsx("p",{className:vA,children:p})]})}function SA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("input",{type:t.inputType??"text",className:dh,value:e==null?"":String(e),placeholder:t.placeholder,maxLength:t.maxLength,pattern:t.pattern,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function NA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-1",children:[h.jsx("input",{type:"number",className:dh,value:e==null?"":String(e),placeholder:t.placeholder,min:t.min,max:t.max,step:t.step,disabled:s||t.disabled,onChange:o=>n(o.target.value===""?void 0:Number(o.target.value))}),t.unit&&h.jsx("span",{className:"text-xs text-foreground-subtle whitespace-nowrap",children:t.unit})]})})}function _A({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=!!e,d=s||t.disabled;return t.style==="checkbox"?h.jsx(ri,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",checked:o,disabled:d,onChange:f=>n(f.target.checked)}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:Wu(t.label,i)}),t.required&&h.jsx("span",{className:"text-danger",children:"*"})]})}):h.jsx(ri,{label:void 0,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("span",{className:y8+" mb-0",children:[Wu(t.label,i),t.required&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),h.jsx("button",{type:"button",role:"switch","aria-checked":o,disabled:d,onClick:()=>!d&&n(!o),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150",o?"bg-primary":"bg-foreground-subtle/30",d?"opacity-50 cursor-not-allowed":"cursor-pointer"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",o?"translate-x-4":"translate-x-0.5"].join(" ")})})]})})}function jA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("select",{className:dh,value:e==null?"":String(e),disabled:s||t.disabled,onChange:o=>n(o.target.value),children:[!t.required&&h.jsx("option",{value:"",children:"— Select —"}),t.options.map(o=>h.jsx("option",{value:o.value,children:o.label},o.value))]})})}function CA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],d=f=>{if(o.includes(f))n(o.filter(p=>p!==f));else{if(t.maxItems!==void 0&&o.length>=t.maxItems)return;n([...o,f])}};return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("div",{className:"flex flex-wrap gap-2",children:t.options.map(f=>{const p=o.includes(f.value);return h.jsxs("label",{className:["flex items-center gap-1.5 rounded-md border px-2 py-1 text-xs cursor-pointer select-none transition-colors",p?"border-primary bg-primary/10 text-primary":"border-border bg-background text-foreground hover:bg-surface",s||t.disabled?"opacity-50 cursor-not-allowed":""].join(" "),children:[h.jsx("input",{type:"checkbox",className:"sr-only",checked:p,disabled:s||t.disabled,onChange:()=>d(f.value)}),f.label]},f.value)})})})}function wA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(!1),f=t.showToggle!==!1;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"relative",children:[h.jsx("input",{type:o?"text":"password",className:dh+(f?" pr-9":""),value:e==null?"":String(e),placeholder:t.placeholder,disabled:s||t.disabled,onChange:p=>n(p.target.value)}),f&&h.jsx("button",{type:"button",className:"absolute right-2 top-1/2 -translate-y-1/2 text-foreground-subtle hover:text-foreground",tabIndex:-1,onClick:()=>d(p=>!p),children:o?h.jsx(R6,{className:"h-3.5 w-3.5"}):h.jsx(ch,{className:"h-3.5 w-3.5"})})]})})}function EA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("textarea",{className:dh+" resize-y min-h-[60px]",value:e==null?"":String(e),placeholder:t.placeholder,rows:t.rows??3,maxLength:t.maxLength,disabled:s||t.disabled,onChange:o=>n(o.target.value)})})}function TA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?t.min:Number(e),d=t.showValue!==!1;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer disabled:opacity-50",min:t.min,max:t.max,step:t.step??1,value:o,disabled:s||t.disabled,onChange:f=>n(Number(f.target.value))}),d&&h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[2.5rem] text-right",children:[o,t.unit?` ${t.unit}`:""]})]})})}function RA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],[d,f]=D.useState(""),p=D.useRef(null),y=D.useCallback(C=>{const w=C.trim();!w||o.includes(w)||t.maxTags!==void 0&&o.length>=t.maxTags||(n([...o,w]),f(""))},[o,t.maxTags,n]),b=C=>n(o.filter(w=>w!==C)),v=C=>{C.key==="Enter"||C.key===","?(C.preventDefault(),y(d)):C.key==="Backspace"&&d===""&&o.length>0&&b(o[o.length-1])},_=s||t.disabled;return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("div",{className:["flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px] cursor-text","focus-within:border-primary focus-within:ring-1 focus-within:ring-primary/30",_?"opacity-50 cursor-not-allowed":""].join(" "),onClick:()=>{var C;return!_&&((C=p.current)==null?void 0:C.focus())},children:[o.map(C=>h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:[C,!_&&h.jsx("button",{type:"button",onClick:()=>b(C),className:"hover:text-danger",children:h.jsx(bl,{className:"h-2.5 w-2.5"})})]},C)),h.jsx("input",{ref:p,type:"text",className:"flex-1 min-w-[80px] bg-transparent text-sm text-foreground outline-none placeholder:text-foreground-disabled",value:d,placeholder:o.length===0?t.placeholder??"Add tags…":"",disabled:_,list:`tags-suggestions-${t.key}`,onChange:C=>f(C.target.value),onKeyDown:v,onBlur:()=>{d.trim()&&y(d)}}),t.suggestions&&h.jsx("datalist",{id:`tags-suggestions-${t.key}`,children:t.suggestions.map(C=>h.jsx("option",{value:C},C))})]})})}function OA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?"#000000":String(e);return h.jsxs(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-9 w-9 rounded-md border border-border bg-background cursor-pointer p-0.5 disabled:opacity-50",value:o,disabled:s||t.disabled,onChange:d=>n(d.target.value)}),h.jsx("input",{type:"text",className:dh+" flex-1 font-mono",value:o,placeholder:"#000000",disabled:s||t.disabled,onChange:d=>n(d.target.value)})]}),t.presets&&t.presets.length>0&&h.jsx("div",{className:"flex gap-1.5 mt-1.5",children:t.presets.map(d=>h.jsx("button",{type:"button",className:"h-5 w-5 rounded-md border border-border hover:scale-110 transition-transform disabled:opacity-50",style:{backgroundColor:d},disabled:s||t.disabled,title:d,onClick:()=>n(d)},d))})]})}function MA({field:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",p=t.span===2?"col-span-2":t.span===3?"col-span-3":t.span===4?"col-span-4":"col-span-1";return h.jsx("div",{className:p,children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface/50 overflow-hidden",children:[h.jsxs("div",{className:["px-3 py-2 flex items-center justify-between",f?"cursor-pointer hover:bg-surface":""].join(" "),onClick:f?()=>d(y=>!y):void 0,children:[h.jsx("span",{className:"text-xs font-semibold text-foreground",children:Wu(t.label,i)}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:"px-3 pb-3 grid grid-cols-2 gap-x-4 gap-y-3",children:t.fields.map(y=>h.jsx(x8,{field:y,values:e,onChange:n,disabled:s,translationFn:i},y.key))})]})})}function AA({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(ri,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx(bA,{field:t,value:e,onChange:n,disabled:s})})}function DA({span:t}){const e=t===2?"col-span-2":t===3?"col-span-3":t===4?"col-span-4":"col-span-full";return h.jsx("div",{className:e,children:h.jsx("hr",{className:"border-border"})})}const f5={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}};function zA({field:t}){const e=t.variant??"info",n=f5[e]??f5.info;return h.jsx("div",{className:"col-span-full",children:h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${n.border} ${n.bg}`,children:[t.label&&h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${n.text}`,children:t.label}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:t.content})]})})}function x8({field:t,values:e,onChange:n,disabled:s,translationFn:i}){if("showWhen"in t&&t.showWhen){const f=t.showWhen,p=e[f.field];let y=!0;if(f.equals!==void 0?y=p===f.equals:f.notEquals!==void 0?y=p!==f.notEquals:f.in!==void 0?y=f.in.includes(p):f.notIn!==void 0&&(y=!f.notIn.includes(p)),!y)return null}const o=e[t.key],d=f=>n(t.key,f);switch(t.type){case"text":return h.jsx(SA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"number":return h.jsx(NA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"boolean":return h.jsx(_A,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"select":return h.jsx(jA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"multiselect":return h.jsx(CA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"password":return h.jsx(wA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"textarea":return h.jsx(EA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"slider":return h.jsx(TA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"tags":return h.jsx(RA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"color":return h.jsx(OA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"group":return h.jsx(MA,{field:t,values:e,onChange:n,disabled:s,translationFn:i});case"separator":return h.jsx(DA,{});case"info":return h.jsx(zA,{field:t});case"model-selector":return h.jsx(AA,{field:t,value:o,onChange:d,disabled:s,translationFn:i});default:return null}}function kA(t){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(t)}function Wu(t,e){if(t!==void 0)return e&&kA(t)?e(t):t}function LA({section:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",p=t.columns??2,y=p===1?"grid-cols-1":p===3?"grid-cols-3":p===4?"grid-cols-4":"grid-cols-2";return h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsxs("div",{className:["flex items-center justify-between mb-3",f?"cursor-pointer":""].join(" "),onClick:f?()=>d(b=>!b):void 0,children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:Wu(t.title,i)}),t.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:Wu(t.description,i)})]}),f&&h.jsx("span",{className:"text-foreground-subtle text-xs ml-2",children:o?"▸":"▾"})]}),!o&&h.jsx("div",{className:`grid ${y} gap-x-4 gap-y-3`,children:t.fields.map(b=>h.jsx(x8,{field:b,values:e,onChange:n,disabled:s,translationFn:i},b.key))})]})}function ay({schema:t,values:e,onChange:n,disabled:s,translationFn:i}){const o=(d,f)=>{n({...e,[d]:f})};return h.jsx("div",{className:"space-y-4",children:t.sections.map(d=>h.jsx(LA,{section:d,values:e,onChange:o,disabled:s,translationFn:i},d.id))})}function UA({addonId:t,configSchema:e,onSave:n,onBack:s}){const{t:i}=Er(),o=Ft(),[d,f]=D.useState(""),[p,y]=D.useState({}),[b,v]=D.useState(null),_=Cn({mutationFn:()=>o.trpc.providerConfig.testConnection.mutate({type:t,url:String(p.url??""),username:p.username?String(p.username):void 0,password:p.password?String(p.password):void 0}),onSuccess:C=>v(C),onError:C=>v({success:!1,error:String(C)})});return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:i("integrations.integrationName")}),h.jsx("input",{type:"text",value:d,onChange:C=>f(C.target.value),placeholder:i("integrations.integrationNamePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),e&&h.jsx(ay,{schema:e,values:p,onChange:y}),b&&h.jsx("div",{className:`rounded-lg border px-3 py-2 text-xs ${b.success?"border-success/30 bg-success/5 text-success":"border-danger/30 bg-danger/5 text-danger"}`,children:b.success?i("integrations.connectionSuccess"):`${i("integrations.errorPrefix")} ${b.error}`}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:s,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:i("integrations.back")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>_.mutate(),disabled:_.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:_.isPending?i("integrations.testing"):i("integrations.testConnection")}),h.jsx("button",{onClick:()=>n({name:d,config:p}),disabled:!d.trim(),className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:i("integrations.forward")})]})]})]})}function qA({providerId:t,onImport:e,onSkip:n}){const{t:s}=Er(),i=Ft(),[o,d]=D.useState(new Set),{data:f,isLoading:p}=ot({queryKey:["discover-devices",t],queryFn:()=>i.discoverDevices(t)});function y(v){d(_=>{const C=new Set(_);return C.has(v)?C.delete(v):C.add(v),C})}if(p)return h.jsxs("div",{className:"flex flex-col items-center py-12",children:[h.jsx("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),h.jsx("p",{className:"mt-3 text-xs text-foreground-subtle",children:s("integrations.searchingDevices")})]});const b=f??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-xs text-foreground-subtle",children:b.length>0?s("integrations.foundDevices",{count:b.length}):s("integrations.noDevicesFound")}),b.length>0&&h.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:b.map(v=>{const _=v.externalId,C=v.name??_,w=o.has(_);return h.jsxs("button",{onClick:()=>y(_),className:`flex w-full items-center gap-3 rounded-lg border p-3 text-left transition-colors ${w?"border-primary/40 bg-primary/5":"border-border bg-surface hover:border-foreground-subtle/30"}`,children:[h.jsx("div",{className:`flex h-5 w-5 items-center justify-center rounded border flex-shrink-0 ${w?"border-primary bg-primary":"border-border"}`,children:w&&h.jsx(Fm,{className:"h-3 w-3 text-primary-foreground"})}),h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:C})]},_)})}),h.jsxs("div",{className:"flex items-center justify-between pt-2",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.skip")}),b.length>0&&h.jsxs("button",{onClick:()=>e(Array.from(o)),disabled:o.size===0,className:"rounded-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:[s("integrations.importSelected")," (",o.size,")"]})]})]})}function HA({open:t,onClose:e}){const{t:n}=Er(),s=Ft(),i=gl(),o=ga(),[d,f]=D.useState("picker"),[p,y]=D.useState(null),[b,v]=D.useState(null),[_,C]=D.useState("manual"),{data:w}=ot({queryKey:["addon-config-schema",p],queryFn:()=>s.getAddonConfigSchema(p),enabled:p!=null}),T=Cn({mutationFn:U=>s.trpc.providerConfig.addProvider.mutate({id:U.id,type:U.type,name:U.name,...U.config}),onSuccess:()=>o.invalidateQueries({queryKey:["providers"]})}),R=Cn({mutationFn:U=>s.adoptDevice(b,U),onSuccess:()=>o.invalidateQueries({queryKey:["devices"]})});async function O(U,V,F){if(y(U),C(F),V==="unique"){const re=`${U}-${Date.now()}`;try{await T.mutateAsync({id:re,type:U,name:U,config:{}}),e(),P(),i(`/integrations/${re}`)}catch{}return}f("config")}async function M(U){if(!p)return;const V=`${p}-${Date.now()}`;try{await T.mutateAsync({id:V,type:p,name:U.name,config:U.config}),v(V),_==="auto"||_==="both"?f("discovery"):k(V)}catch{}}async function z(U){for(const V of U)await R.mutateAsync(V);k()}function k(U){const V=U??b??p;e(),P(),V&&i(`/integrations/${V}`)}function P(){f("picker"),y(null),v(null),C("manual")}function q(){e(),P()}if(!t)return null;const L={picker:n("integrations.newIntegration"),config:n("integrations.configureIntegration"),discovery:n("integrations.importDevices")};return h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:q}),h.jsxs("div",{className:"relative z-10 w-full max-w-lg rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:L[d]}),h.jsx("button",{onClick:q,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(bl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4",children:[d==="picker"&&h.jsx(hA,{onSelect:O,onClose:q}),d==="config"&&p&&h.jsx(UA,{addonId:p,configSchema:w??null,onSave:M,onBack:()=>f("picker")}),d==="discovery"&&b&&h.jsx(qA,{providerId:b,onImport:z,onSkip:k})]})]})]})}const BA=[{id:"all",label:"All",icon:p3},{id:"camera",label:"Camera",icon:Lc},{id:"sensor",label:"Sensor",icon:fv},{id:"light",label:"Light",icon:GT},{id:"switch",label:"Switch",icon:CR},{id:"other",label:"Other",icon:p3}];function xx(t){const e=(t.type??"").toLowerCase();return e.includes("camera")||e==="camera"?"camera":e.includes("sensor")?"sensor":e.includes("light")?"light":e.includes("switch")?"switch":e?"other":"camera"}function GA(){const t=Ft(),e=ga(),n=gl(),[s,i]=D.useState(!1),[o,d]=D.useState(""),[f,p]=D.useState("all"),[y,b]=D.useState("provider"),[v,_]=D.useState(new Set(["__all__"])),{data:C,isLoading:w}=ot({queryKey:["providers"],queryFn:()=>t.listProviders(),refetchInterval:5e3}),{data:T,isLoading:R}=ot({queryKey:["devices"],queryFn:()=>t.listDevices(),refetchInterval:5e3});Cn({mutationFn:F=>t.startProvider(F),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})}),Cn({mutationFn:F=>t.stopProvider(F),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})});const O=C??[],M=T??[],z=D.useMemo(()=>{const F=o.toLowerCase();return M.filter(re=>!(f!=="all"&&xx(re)!==f||F&&!(re.name??re.id??"").toLowerCase().includes(F)))},[M,f,o]),k=D.useMemo(()=>{var re;const F=new Map;for(const ne of z){let J;switch(y){case"provider":J=ne.providerId??"unknown";break;case"type":J=xx(ne);break;case"status":J=(re=ne.state)!=null&&re.online?"online":"offline";break}F.has(J)||F.set(J,[]),F.get(J).push(ne)}return F},[z,y]);function P(F){_(re=>{const ne=new Set(re);return ne.has(F)?ne.delete(F):ne.add(F),ne})}function q(F){if(y==="provider"){const re=O.find(ne=>ne.id===F);return re?re.name??F:F}return F.charAt(0).toUpperCase()+F.slice(1)}function L(F){if(y==="provider"){const re=O.find(ne=>ne.id===F);return(re==null?void 0:re.type)??"rtsp"}return"rtsp"}function U(F){var re;if(y==="provider"){const ne=O.find(J=>J.id===F);return(re=ne==null?void 0:ne.status)!=null&&re.connected?"running":"stopped"}return""}const V=w||R;return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Integrations"}),h.jsxs("button",{onClick:()=>i(!0),className:"flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"New Integration"]})]}),h.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[h.jsxs("div",{className:"relative",children:[h.jsx(hv,{className:"absolute left-2.5 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:o,onChange:F=>d(F.target.value),placeholder:"Search devices...",className:"rounded-lg border border-border bg-surface pl-8 pr-3 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50 w-48"})]}),h.jsx("div",{className:"flex items-center gap-1",children:BA.map(({id:F,label:re})=>h.jsx("button",{onClick:()=>p(F),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${f===F?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:re},F))}),h.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Group by:"}),h.jsxs("select",{value:y,onChange:F=>b(F.target.value),className:"rounded-lg border border-border bg-surface px-2 py-1 text-[11px] text-foreground focus:outline-none focus:border-primary/50",children:[h.jsx("option",{value:"provider",children:"Provider"}),h.jsx("option",{value:"type",children:"Type"}),h.jsx("option",{value:"status",children:"Status"})]})]})]}),V&&h.jsx("div",{className:"space-y-2",children:[1,2,3].map(F=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},F))}),!V&&z.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"No devices found."}),h.jsx("p",{className:"text-xs mt-1",children:o||f!=="all"?"Try adjusting your filters":"Start an integration to discover devices."})]}),!V&&Array.from(k.entries()).map(([F,re])=>{const ne=v.has(F)||v.has("__all__"),J=L(F),ie=U(F),ce=y==="provider"?F:null;return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>P(F),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-surface-hover transition-colors",children:[ne?h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Zu,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),y==="provider"&&h.jsx(ny,{type:J,size:"sm"}),y==="provider"?h.jsx("span",{className:"text-xs font-semibold text-foreground hover:text-primary hover:underline cursor-pointer",onClick:Y=>{Y.stopPropagation(),n(`/integrations/${F}`)},children:q(F)}):h.jsx("span",{className:"text-xs font-semibold text-foreground",children:q(F)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[re.length," device",re.length!==1?"s":""]}),ie&&h.jsx(th,{status:ie}),h.jsx("div",{className:"ml-auto flex items-center gap-1",onClick:Y=>Y.stopPropagation(),children:ce&&h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Provider settings",children:h.jsx(Im,{className:"h-3.5 w-3.5"})})})]}),ne&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2 text-[10px] font-medium text-foreground-subtle uppercase tracking-wider border-b border-border bg-background",children:[h.jsx("span",{children:"Name"}),h.jsx("span",{children:"Type"}),h.jsx("span",{children:"Status"}),h.jsx("span",{children:"Phase"}),h.jsx("span",{children:"Today"}),h.jsx("span",{children:"Last Event"})]}),re.map(Y=>{var W;const $=Y.id,ae=Y.name??Y.id,je=xx(Y),he=(W=Y.state)!=null&&W.online?"online":"offline",G=Y.phase??"—";return h.jsxs("button",{onClick:()=>n(`/devices/${$}`),className:"w-full grid grid-cols-[1fr_80px_80px_80px_100px_100px] gap-2 px-4 py-2.5 text-left hover:bg-surface-hover transition-colors border-b border-border last:border-b-0",children:[h.jsx("span",{className:"text-xs font-medium text-foreground truncate",children:ae}),h.jsx("span",{className:"text-[11px] text-foreground-subtle capitalize",children:je}),h.jsx("span",{children:h.jsx(th,{status:he})}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:G}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"}),h.jsx("span",{className:"text-[11px] text-foreground-subtle",children:"—"})]},$)})]})]},F)}),h.jsx(HA,{open:s,onClose:()=>i(!1)})]})}function PA({deviceName:t,snapshotUrl:e,status:n,resolution:s,codec:i,fps:o,lastSnapshot:d}){const{t:f}=Er(),[p,y]=D.useState(!1);return h.jsxs("div",{className:"relative flex-shrink-0",onMouseEnter:()=>y(!0),onMouseLeave:()=>y(!1),children:[h.jsx("button",{className:"flex h-6 w-6 items-center justify-center rounded text-foreground-subtle hover:bg-surface-hover hover:text-foreground transition-colors",title:f("integrations.preview"),children:h.jsx(ch,{className:"h-3.5 w-3.5"})}),p&&h.jsxs("div",{className:"absolute bottom-full right-0 mb-2 w-72 rounded-lg border border-border bg-surface shadow-lg shadow-black/30 z-50 overflow-hidden",children:[h.jsx("div",{className:"h-40 bg-background flex items-center justify-center",children:e&&n!=="offline"?h.jsx("img",{src:e,alt:t,className:"h-full w-full object-cover",onError:b=>{b.target.style.display="none"}}):h.jsx("span",{className:"text-xs text-foreground-subtle",children:f(n==="offline"?"integrations.snapshotUnavailable":"integrations.noSnapshot")})}),h.jsxs("div",{className:"px-3 py-2 space-y-0.5",children:[h.jsx("p",{className:"text-xs font-semibold text-foreground",children:t}),(s||i||o)&&h.jsx("p",{className:"text-[10px] text-foreground-subtle",children:[i,s,o?`${o}fps`:null].filter(Boolean).join(" · ")}),d&&h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[f("integrations.lastSnapshot")," ",d]}),n==="offline"&&h.jsx("p",{className:"text-[10px] text-danger",children:f("integrations.offline")})]})]})]})}function YA({id:t,name:e,status:n,snapshotUrl:s,resolution:i,codec:o,fps:d,lastSnapshot:f}){const p=gl();return h.jsxs("div",{onClick:()=>p(`/devices/${t}`),className:"flex items-center gap-2 rounded-lg border border-border bg-surface px-3 py-2.5 cursor-pointer hover:border-foreground-subtle/30 transition-colors",children:[h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-semibold text-foreground flex-1 truncate",children:e}),h.jsx(PA,{deviceName:e,snapshotUrl:s,status:n,resolution:i,codec:o,fps:d,lastSnapshot:f}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full flex-shrink-0 ${n==="online"?"bg-success":"bg-danger"}`,title:n==="online"?"Online":"Offline"})]})}function VA({name:t,externalId:e,onImport:n,importing:s}){const{t:i}=Er();return h.jsxs("div",{className:"flex items-center gap-2 rounded-lg border border-dashed border-border bg-surface px-3 py-2.5 opacity-70",children:[h.jsx(Lc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[11px] font-medium text-foreground flex-1 truncate",children:t}),h.jsx("button",{onClick:()=>n(e),disabled:s,className:"flex-shrink-0 rounded bg-primary/15 border border-primary/25 px-2 py-0.5 text-[9px] font-semibold text-primary hover:bg-primary/25 transition-colors disabled:opacity-50",children:s?"...":i("integrations.import")})]})}function QA({activeDevices:t,discoveredDevices:e,onImport:n,importingIds:s}){const{t:i}=Er(),o=e&&e.length>0;return h.jsxs("div",{className:"space-y-4",children:[t.length>0&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.active")," (",t.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:t.map(d=>h.jsx(YA,{id:d.id,name:d.name,status:d.status,snapshotUrl:d.snapshotUrl},d.id))})]}),t.length===0&&!o&&h.jsxs("div",{className:"flex flex-col items-center py-16 text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:i("integrations.noDevices")}),h.jsx("p",{className:"text-xs mt-1",children:i("integrations.addFirstDevice")})]}),o&&h.jsxs("div",{children:[h.jsxs("p",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider mb-2",children:[i("integrations.available")," (",e.length,")"]}),h.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-2",children:e.map(d=>h.jsx(VA,{name:d.name,externalId:d.externalId,onImport:n??(()=>{}),importing:s==null?void 0:s.has(d.externalId)},d.externalId))})]})]})}function KA({open:t,providerId:e,onClose:n}){const{t:s}=Er(),i=Ft(),o=ga(),[d,f]=D.useState(""),[p,y]=D.useState(""),[b,v]=D.useState([""]),[_,C]=D.useState({}),w=Cn({mutationFn:k=>i.createDevice(e,k),onSuccess:()=>{o.invalidateQueries({queryKey:["devices"]})}}),T=Cn({mutationFn:async()=>{const k={};for(let P=0;P<b.length;P++){const q=b[P];if(q.trim())try{await i.trpc.providerConfig.testConnection.mutate({type:"rtsp",url:q}),k[P]={codec:"OK",resolution:"Connected"}}catch(L){k[P]={error:String(L)}}}C(k)}});function R(){v(k=>[...k,""])}function O(k){v(P=>P.filter((q,L)=>L!==k))}function M(k,P){v(q=>q.map((L,U)=>U===k?P:L))}async function z(k){const P={name:d,snapshotUrl:p||void 0,streams:b.filter(q=>q.trim())};await w.mutateAsync(P),k?(f(""),y(""),v([""])):n()}return t?h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/60",onClick:n}),h.jsxs("div",{className:"relative z-10 w-full max-w-md rounded-xl border border-border bg-background shadow-2xl",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-5 py-4",children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground",children:s("integrations.addDevice")}),h.jsx("button",{onClick:n,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(bl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4 space-y-3",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.name")}),h.jsx("input",{type:"text",value:d,onChange:k=>f(k.target.value),placeholder:s("integrations.namePlaceholder"),className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-[11px] font-medium text-foreground mb-1",children:s("integrations.snapshotUrlOptional")}),h.jsx("input",{type:"text",value:p,onChange:k=>y(k.target.value),placeholder:"http://192.168.1.100/snapshot.jpg",className:"w-full rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"})]}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[11px] font-medium text-foreground",children:s("integrations.streamUrls")}),h.jsxs("button",{onClick:R,className:"flex items-center gap-1 text-[10px] text-primary hover:text-primary/80 transition-colors",children:[h.jsx(po,{className:"h-3 w-3"})," ",s("integrations.addStream")]})]}),h.jsx("div",{className:"space-y-2",children:b.map((k,P)=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:k,onChange:q=>M(P,q.target.value),placeholder:"rtsp://192.168.1.100:554/stream1",className:"flex-1 rounded-lg border border-border bg-surface px-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-primary/50"}),b.length>1&&h.jsx("button",{onClick:()=>O(P),className:"rounded-md p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",children:h.jsx(Jm,{className:"h-3.5 w-3.5"})})]},P))})]}),Object.keys(_).length>0&&h.jsx("div",{className:"space-y-1",children:Object.entries(_).map(([k,P])=>h.jsx("div",{className:`rounded-lg border px-3 py-1.5 text-[10px] ${P.error?"border-danger/30 bg-danger/5 text-danger":"border-success/30 bg-success/5 text-success"}`,children:P.error?`${s("integrations.stream",{number:Number(k)+1})} ${P.error}`:`${s("integrations.stream",{number:Number(k)+1})} ${P.codec} · ${P.resolution}`},k))})]}),h.jsxs("div",{className:"flex items-center justify-between border-t border-border px-5 py-3",children:[h.jsx("button",{onClick:n,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground-subtle hover:text-foreground transition-colors",children:s("integrations.cancel")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>T.mutate(),disabled:b.every(k=>!k.trim())||T.isPending,className:"rounded-lg border border-border px-3 py-1.5 text-xs text-foreground hover:bg-surface-hover transition-colors disabled:opacity-50",children:T.isPending?s("integrations.testing"):s("integrations.test")}),h.jsx("button",{onClick:()=>z(!1),disabled:!d.trim()||b.every(k=>!k.trim())||w.isPending,className:"rounded-l-lg bg-primary px-4 py-1.5 text-xs font-medium text-primary-foreground shadow-sm disabled:opacity-50",children:w.isPending?s("integrations.saving"):s("integrations.save")}),h.jsxs("div",{className:"relative group",children:[h.jsx("button",{disabled:!d.trim()||b.every(k=>!k.trim()),className:"rounded-r-lg border-l border-primary-foreground/20 bg-primary px-2 py-1.5 text-primary-foreground disabled:opacity-50",children:h.jsx(Mc,{className:"h-3 w-3"})}),h.jsx("div",{className:"absolute right-0 bottom-full mb-1 hidden group-hover:block",children:h.jsx("button",{onClick:()=>z(!0),disabled:!d.trim()||b.every(k=>!k.trim()),className:"whitespace-nowrap rounded-lg border border-border bg-surface px-3 py-1.5 text-xs text-foreground shadow-lg hover:bg-surface-hover disabled:opacity-50",children:s("integrations.saveAndNew")})})]})]})]})]})]}):null}function XA(){const{t}=Er(),{integrationId:e}=$b(),n=Ft(),s=ga(),[i,o]=D.useState(!1),[d,f]=D.useState(!1),{data:p,isLoading:y}=ot({queryKey:["provider",e],queryFn:()=>n.getProvider(e),enabled:!!e}),{data:b}=ot({queryKey:["devices"],queryFn:()=>n.listDevices(),refetchInterval:5e3}),{data:v,refetch:_}=ot({queryKey:["discover-devices",e],queryFn:()=>n.discoverDevices(e),enabled:!!e&&(p==null?void 0:p.discoveryMode)!=="manual"}),C=Cn({mutationFn:()=>n.startProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),w=Cn({mutationFn:()=>n.stopProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),T=Cn({mutationFn:V=>n.adoptDevice(e,V),onSuccess:()=>{s.invalidateQueries({queryKey:["devices"]}),s.invalidateQueries({queryKey:["discover-devices",e]})}}),[R,O]=D.useState(new Set);async function M(V){O(F=>new Set([...F,V]));try{await T.mutateAsync(V)}finally{O(F=>{const re=new Set(F);return re.delete(V),re})}}if(y)return h.jsxs("div",{className:"p-6",children:[h.jsx("div",{className:"h-16 rounded-lg bg-surface animate-pulse mb-4"}),h.jsx("div",{className:"h-40 rounded-lg bg-surface animate-pulse"})]});if(!p)return h.jsx("div",{className:"flex items-center justify-center py-20 text-foreground-subtle text-sm",children:t("integrations.integrationNotFound")});const k=(b??[]).filter(V=>V.providerId===e).map(V=>{var F;return{id:V.id,name:V.name??V.id,status:(F=V.state)!=null&&F.online?"online":"offline",snapshotUrl:null}}),P=(v??[]).map(V=>({externalId:V.externalId,name:V.name??V.externalId})),q=p.status.connected?"running":"stopped",L=p.discoveryMode!=="manual",U=p.discoveryMode==="manual";return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("img",{src:n.getAddonAssetUrl(p.type,"assets/icon.svg"),alt:"",className:"h-8 w-8 rounded-lg",onError:V=>{V.target.style.display="none"}}),h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:p.name}),h.jsxs("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:[p.type," · ",k.length," ",t("integrations.devices")]})]}),h.jsx(th,{status:q})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[L&&h.jsxs("button",{onClick:()=>_(),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(Am,{className:"h-3 w-3"}),t("integrations.rediscover")]}),h.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-1.5 rounded-lg border border-border bg-surface px-3 py-1.5 text-[11px] text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(Im,{className:"h-3 w-3"}),t("integrations.config")]}),q==="running"?h.jsx("button",{onClick:()=>w.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",title:"Stop",children:h.jsx(k6,{className:"h-3.5 w-3.5"})}):h.jsx("button",{onClick:()=>C.mutate(),className:"rounded-lg border border-border bg-surface p-1.5 text-foreground-subtle hover:text-success hover:bg-success/10 transition-colors",title:"Start",children:h.jsx(dv,{className:"h-3.5 w-3.5"})})]})]}),h.jsx(QA,{activeDevices:k,discoveredDevices:L?P:void 0,onImport:M,importingIds:R}),h.jsx("button",{onClick:()=>{U?o(!0):_()},className:"fixed bottom-6 right-6 flex h-12 w-12 items-center justify-center rounded-full bg-primary shadow-lg shadow-primary/30 hover:shadow-primary/40 transition-shadow",title:t(U?"integrations.addDevice":"integrations.rediscover"),children:U?h.jsx(po,{className:"h-5 w-5 text-primary-foreground"}):h.jsx(Am,{className:"h-5 w-5 text-primary-foreground"})}),i&&e&&h.jsx(KA,{open:i,providerId:e,onClose:()=>o(!1)}),d&&h.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50",onClick:()=>f(!1),children:h.jsxs("div",{className:"rounded-xl border border-border bg-surface p-6 shadow-xl w-80",onClick:V=>V.stopPropagation(),children:[h.jsx("h2",{className:"text-sm font-semibold text-foreground mb-2",children:t("integrations.providerConfig")}),h.jsx("p",{className:"text-[11px] text-foreground-subtle",children:t("integrations.configComingSoon")}),h.jsx("button",{onClick:()=>f(!1),className:"mt-4 w-full rounded-lg bg-primary px-3 py-1.5 text-[11px] text-primary-foreground hover:bg-primary/90 transition-colors",children:"Close"})]})})]})}function FA({label:t,color:e,title:n,style:s}){return h.jsxs("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 z-10 group cursor-pointer",style:s,title:n,children:[h.jsx("div",{className:"h-2.5 w-2.5 rounded-full border-2 border-background shadow-sm transition-transform group-hover:scale-150",style:{backgroundColor:e}}),n&&h.jsx("div",{className:"absolute bottom-full left-1/2 -translate-x-1/2 mb-1.5 hidden group-hover:block z-20 pointer-events-none",children:h.jsxs("div",{className:"bg-surface border border-border rounded px-2 py-1 text-[10px] text-foreground whitespace-nowrap shadow-lg",children:[h.jsx("span",{className:"inline-block h-1.5 w-1.5 rounded-full mr-1 align-middle",style:{backgroundColor:e}}),t]})})]})}const bx=36e5;function ZA(t){return String(t).padStart(2,"0")}function IA(t){const e=new Date(t);return`${ZA(e.getHours())}:00`}function JA({startMs:t,endMs:e,segments:n,events:s,playheadMs:i,onSeek:o}){const d=D.useRef(null),f=e-t,p=D.useCallback(C=>Math.max(0,Math.min(100,(C-t)/f*100)),[t,f]);function y(C){if(!d.current)return;const w=d.current.getBoundingClientRect(),T=Math.max(0,Math.min(1,(C.clientX-w.left)/w.width));o(Math.round(t+T*f))}const b=[],v=Math.floor(t/bx),_=Math.ceil(e/bx);for(let C=v;C<=_;C++){const w=C*bx;w<t||w>e||b.push({percent:p(w),label:IA(w)})}return h.jsxs("div",{className:"select-none",children:[h.jsx("div",{className:"relative h-5 mb-1",children:b.map(({percent:C,label:w})=>h.jsx("span",{className:"absolute -translate-x-1/2 text-[10px] text-foreground-subtle",style:{left:`${C}%`},children:w},w))}),h.jsxs("div",{ref:d,className:"relative h-8 rounded bg-surface-hover cursor-pointer overflow-hidden border border-border",onClick:y,onPointerMove:C=>{C.buttons===1&&y(C)},children:[n.map((C,w)=>{const T=p(C.startMs),R=p(C.endMs)-T;return h.jsx("div",{className:"absolute top-1 bottom-1 rounded-sm bg-success/60",style:{left:`${T}%`,width:`${Math.max(R,.1)}%`}},w)}),s.map(C=>h.jsx(FA,{label:C.label,color:C.color,title:`${C.label} — ${new Date(C.timestampMs).toLocaleTimeString()}`,style:{left:`${p(C.timestampMs)}%`}},C.id)),h.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-danger z-20 pointer-events-none",style:{left:`${p(i)}%`},children:h.jsx("div",{className:"absolute -top-0.5 left-1/2 -translate-x-1/2 w-2.5 h-2.5 bg-danger rotate-45"})})]})]})}const h5={person:"#f59e0b",vehicle:"#3b82f6",car:"#3b82f6",face:"#a855f7",plate:"#ec4899",animal:"#10b981",motion:"#ef4444",unknown:"#6b7280"};function wb(t){return h5[t.toLowerCase()]??h5.unknown}function WA(t){const e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}function $A(t){return new Date(t).toISOString().slice(0,10)}function eD(t){return new Date(t+"T00:00:00").getTime()}function tD(t){return[{startMs:t+0*36e5,endMs:t+4*36e5},{startMs:t+6*36e5,endMs:t+10*36e5},{startMs:t+12*36e5,endMs:t+16*36e5},{startMs:t+18*36e5,endMs:t+23*36e5}]}function nD(t){const e=["person","vehicle","face","motion"];return Array.from({length:24},(n,s)=>({id:`placeholder-${s}`,timestampMs:t+Math.floor(Math.random()*24*36e5),label:e[s%e.length],color:wb(e[s%e.length])})).sort((n,s)=>n.timestampMs-s.timestampMs)}function aD(){var k,P;const{t}=Er(),e=Ft(),n=WA(new Date),[s,i]=D.useState(n),[o,d]=D.useState(null),[f,p]=D.useState(n+12*36e5),y=s,b=s+24*36e5,{data:v,isLoading:_}=ot({queryKey:["devices"],queryFn:()=>e.listDevices(),staleTime:3e4}),C=v??[],w=D.useMemo(()=>C.filter(L=>{const U=String(L.type??"").toLowerCase(),V=L.capabilities??[];return U==="camera"||U.includes("camera")||V.some(F=>F.toLowerCase().includes("video")||F.toLowerCase().includes("stream"))}).map(L=>({id:String(L.id),name:String(L.name??L.id)})),[C]),T=o??((k=w[0])==null?void 0:k.id)??null,{data:R}=ot({queryKey:["events",T,y],queryFn:()=>T?e.getEvents(T,{limit:200}):Promise.resolve(null),enabled:!!T,staleTime:6e4}),O=D.useMemo(()=>{const q=R,U=Array.isArray(q)?q:q!=null&&typeof q=="object"&&Array.isArray(q.events)?q.events:[];return U.length===0?T?nD(y):[]:U.map((V,F)=>{const re=String(V.class??V.type??V.label??"unknown").toLowerCase(),ne=typeof V.timestamp=="number"?V.timestamp:y;return{id:String(V.id??F),timestampMs:ne,label:re,color:wb(re)}})},[R,T,y]),M=D.useMemo(()=>T?tD(y):[],[T,y]);function z(q){i(L=>L+q*24*36e5),p(L=>L+q*24*36e5)}return h.jsxs("div",{className:"flex flex-col h-full p-6 gap-5 overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 shrink-0",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.timeline","Timeline")}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("button",{onClick:()=>z(-1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(nT,{className:"h-4 w-4"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx(XE,{className:"absolute left-2 h-3.5 w-3.5 text-foreground-subtle pointer-events-none"}),h.jsx("input",{type:"date",value:$A(s),onChange:q=>{if(q.target.value){const L=eD(q.target.value);i(L),p(L+12*36e5)}},className:"rounded-lg border border-border bg-surface pl-7 pr-3 py-1.5 text-xs text-foreground focus:outline-none focus:border-primary/50"})]}),h.jsx("button",{onClick:()=>z(1),className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",disabled:s>=n,children:h.jsx(Zu,{className:"h-4 w-4"})})]})]}),h.jsxs("div",{className:"flex gap-1.5 shrink-0 overflow-x-auto pb-1",children:[_&&h.jsx("div",{className:"h-8 w-48 rounded-lg bg-surface animate-pulse"}),!_&&w.length===0&&h.jsx("span",{className:"text-xs text-foreground-subtle",children:"No cameras found"}),w.map(q=>{const L=q.id===T;return h.jsx("button",{onClick:()=>d(q.id),className:`shrink-0 rounded-lg px-3 py-1.5 text-[12px] font-medium transition-all border ${L?"bg-primary/12 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border hover:bg-surface-hover hover:text-foreground"}`,children:q.name},q.id)})]}),h.jsxs("div",{className:"relative rounded-xl border border-border bg-black shrink-0 overflow-hidden",style:{aspectRatio:"16/9",maxHeight:"45vh"},children:[h.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center gap-3 text-foreground-subtle",children:[h.jsx(O6,{className:"h-12 w-12 opacity-20"}),h.jsx("p",{className:"text-sm opacity-50",children:T?`${((P=w.find(q=>q.id===T))==null?void 0:P.name)??T} — seek to play`:"Select a camera"})]}),h.jsx("div",{className:"absolute top-3 left-3 rounded bg-black/60 px-2 py-1 text-[11px] text-white font-mono",children:new Date(f).toLocaleTimeString()})]}),h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 pt-3 pb-4 shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-4 mb-3",children:[h.jsx("span",{className:"text-[10px] font-semibold text-foreground-subtle uppercase tracking-wider",children:"Timeline"}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2 w-4 rounded-sm bg-success/60"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Recording"})]}),Array.from(new Set(O.map(q=>q.label))).slice(0,5).map(q=>h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx("span",{className:"inline-block h-2.5 w-2.5 rounded-full",style:{backgroundColor:wb(q)}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle capitalize",children:q})]},q))]}),T?h.jsx(JA,{startMs:y,endMs:b,segments:M,events:O,playheadMs:f,onSeek:p}):h.jsx("div",{className:"h-8 rounded bg-surface-hover flex items-center justify-center text-xs text-foreground-subtle",children:"Select a camera to view timeline"})]})]})}function vx({label:t,value:e,min:n,max:s,step:i=1,unit:o,hint:d,onChange:f}){return h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:t}),d&&h.jsx("span",{className:"text-[9px] text-foreground-subtle/50",children:d})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:n,max:s,step:i,value:e,onChange:p=>f(Number(p.target.value))}),h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:[e,o?` ${o}`:""]})]})]})}function sD({motionFps:t,detectionFps:e,cooldownMs:n,maxConcurrentInferences:s,onMotionFpsChange:i,onDetectionFpsChange:o,onCooldownMsChange:d,onMaxConcurrentInferencesChange:f}){const p=s===null;return h.jsxs("div",{className:"space-y-4",children:[h.jsx("h3",{className:"text-[10px] font-semibold text-foreground uppercase tracking-wider",children:"Orchestrator"}),h.jsx(vx,{label:"Motion FPS",value:t,min:1,max:15,onChange:i,unit:"fps",hint:"Frame-diff rate"}),h.jsx(vx,{label:"Detection FPS",value:e,min:1,max:30,onChange:o,unit:"fps",hint:"Inference rate"}),h.jsx(vx,{label:"Motion Cooldown",value:n/1e3,min:1,max:60,onChange:y=>d(y*1e3),unit:"s",hint:"No motion → idle"}),h.jsxs("div",{children:[h.jsxs("div",{className:"flex items-center justify-between mb-1",children:[h.jsx("label",{className:"text-[10px] font-medium text-foreground-subtle",children:"Max Parallel"}),h.jsx("button",{type:"button",onClick:()=>f(p?2:null),className:`text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors ${p?"bg-primary/15 text-primary":"bg-surface text-foreground-subtle hover:text-foreground"}`,children:p?"Auto":"Manual"})]}),p?h.jsx("p",{className:"text-[10px] text-foreground-subtle/60",children:"Auto-detected from hardware (CPU cores, GPU)"}):h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx("input",{type:"range",className:"flex-1 h-1 accent-primary cursor-pointer",min:1,max:8,value:s,onChange:y=>f(Number(y.target.value))}),h.jsx("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:s})]})]})]})}const rD={motionFps:2,detectionFps:5,cooldownMs:1e4,maxConcurrentInferences:null};function iD(){const{t}=Er(),e=Ft(),[n,s]=D.useState(!0),[i,o]=D.useState(null),[d,f]=D.useState(null),[p,y]=D.useState([]),[b,v]=D.useState([]),[_,C]=D.useState(null),[w,T]=D.useState(rD),[R,O]=D.useState(!1),[M,z]=D.useState(!1),[k,P]=D.useState(!0);D.useEffect(()=>{var ie,ce,Y,$,ae,je,he,G,W,fe,be,_e,me,we,nt;const J=e.trpc;if(!J){s(!1);return}Promise.all([(Y=(ce=(ie=J.pipeline)==null?void 0:ie.getSchema)==null?void 0:ce.query)==null?void 0:Y.call(ce).catch(()=>null),(je=(ae=($=J.inference)==null?void 0:$.getCapabilities)==null?void 0:ae.query)==null?void 0:je.call(ae).catch(()=>null),(W=(G=(he=J.pipeline)==null?void 0:he.getGlobalSteps)==null?void 0:G.query)==null?void 0:W.call(G).catch(()=>null),(_e=(be=(fe=J.pipeline)==null?void 0:fe.getOrchestratorSettings)==null?void 0:be.query)==null?void 0:_e.call(be).catch(()=>null),(nt=(we=(me=J.pipeline)==null?void 0:me.listTemplates)==null?void 0:we.query)==null?void 0:nt.call(we).catch(()=>[])]).then(([ze,Vt,$e,Mt,Ht])=>{ze&&o(ze),Vt&&f(Vt),$e&&y($e),Mt&&T(Mt),v(Ht??[]),s(!1)}).catch(()=>s(!1))},[e]);const q=D.useCallback(J=>{y(J),O(!0)},[]),L=D.useCallback(J=>{if(C(J),J&&i){const ie=b.find(ce=>ce.id===J);if(ie!=null&&ie.steps){const ce=new Map(i.slots.flatMap($=>$.addons.map(ae=>[ae.id,ae]))),Y=$=>{const ae=ce.get($.addonId);return{addonId:$.addonId,addonName:(ae==null?void 0:ae.name)??$.addonId,slot:(ae==null?void 0:ae.slot)??"detector",inputClasses:ae?[...ae.inputClasses]:[],outputClasses:ae?[...ae.outputClasses]:[],enabled:$.enabled??!0,agentId:$.agentId??"hub",runtime:$.runtime??"node",backend:$.backend??"cpu",modelId:$.modelId??(ae==null?void 0:ae.defaultModelId)??"",confidence:$.confidence??(ae==null?void 0:ae.defaultConfidence)??.3,classFilters:$.classFilters?[...$.classFilters]:[],children:($.children??[]).map(Y)}};y(ie.steps.map(Y))}}},[i,b]),U=D.useCallback(async(J,ie)=>{try{const Y=await e.trpc.pipeline.saveTemplate.mutate({name:J,steps:ie});v($=>[Y,...$]),C(Y.id)}catch{}},[e]),V=D.useCallback(async(J,ie)=>{try{const Y=await e.trpc.pipeline.updateTemplate.mutate({id:J,steps:ie});v($=>$.map(ae=>ae.id===J?Y:ae))}catch{}},[e]),F=D.useCallback(async J=>{try{await e.trpc.pipeline.deleteTemplate.mutate({id:J}),v(ce=>ce.filter(Y=>Y.id!==J)),_===J&&C(null)}catch{}},[e,_]);async function re(){z(!0);try{const J=e.trpc;await Promise.all([J.pipeline.setGlobalSteps.mutate({steps:p}),J.pipeline.setOrchestratorSettings.mutate(w)]),O(!1)}catch{}finally{z(!1)}}function ne(J,ie){T(ce=>({...ce,[J]:ie})),O(!0)}return n?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle animate-pulse",children:"Loading pipeline schema…"})}):!i||!d?h.jsx("div",{className:"flex items-center justify-center h-full",children:h.jsx("div",{className:"text-sm text-foreground-subtle",children:"Pipeline schema not available. Make sure detection addons are loaded."})}):h.jsxs("div",{className:"flex h-full overflow-hidden",children:[h.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between gap-4 px-6 py-4 border-b border-border shrink-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(X1,{className:"h-4 w-4 text-foreground-subtle"}),h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:t("nav.pipeline","Pipeline Config")})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[R&&h.jsx("span",{className:"text-[10px] text-amber-400 font-medium",children:"Unsaved changes"}),h.jsxs("button",{onClick:re,disabled:!R||M,className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${R&&!M?"bg-primary text-white hover:bg-primary/90":"bg-surface text-foreground-subtle border border-border cursor-not-allowed"}`,children:[h.jsx(z6,{className:"h-3.5 w-3.5"}),M?"Saving…":"Save Pipeline"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx(uC,{schema:i,capabilities:d,steps:p,onChange:q,templates:b,selectedTemplateId:_,onSelectTemplate:L,onSaveTemplate:U,onUpdateTemplate:V,onDeleteTemplate:F})})]}),h.jsxs("aside",{className:"w-72 shrink-0 border-l border-border flex flex-col overflow-hidden bg-surface/40",children:[h.jsxs("button",{onClick:()=>P(!k),className:"flex items-center justify-between gap-2 px-4 py-3 border-b border-border text-xs font-semibold text-foreground uppercase tracking-wider hover:bg-surface-hover transition-colors",children:[h.jsx("span",{children:"Settings"}),h.jsx(Mc,{className:`h-3.5 w-3.5 text-foreground-subtle transition-transform ${k?"":"-rotate-90"}`})]}),k&&h.jsx("div",{className:"flex-1 overflow-y-auto p-4",children:h.jsx(sD,{motionFps:w.motionFps,detectionFps:w.detectionFps,cooldownMs:w.cooldownMs,maxConcurrentInferences:w.maxConcurrentInferences,onMotionFpsChange:J=>ne("motionFps",J),onDetectionFpsChange:J=>ne("detectionFps",J),onCooldownMsChange:J=>ne("cooldownMs",J),onMaxConcurrentInferencesChange:J=>ne("maxConcurrentInferences",J)})})]})]})}const lD=["WebRTC","HLS","MJPEG","go2rtc"],oD=["BBox","Segm","Zones","Trail"];function cD({deviceName:t,detectionsToday:e,inferenceMs:n,activeTracks:s,storageGb:i}){const[o,d]=D.useState("WebRTC"),[f,p]=D.useState(new Set);function y(b){p(v=>{const _=new Set(v);return _.has(b)?_.delete(b):_.add(b),_})}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"relative w-full max-w-[320px] aspect-video bg-background rounded-lg border border-border flex items-center justify-center overflow-hidden",children:[h.jsx(Lc,{className:"h-10 w-10 text-foreground-subtle/20"}),h.jsx("div",{className:"absolute bottom-2 left-2 text-[10px] text-foreground-subtle bg-background/80 rounded px-1.5 py-0.5",children:t})]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Source:"}),lD.map(b=>h.jsx("button",{onClick:()=>d(b),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${o===b?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:b},b))]}),h.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle mr-1 self-center",children:"Overlay:"}),oD.map(b=>{const v=f.has(b);return h.jsx("button",{onClick:()=>y(b),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${v?"bg-info/15 text-info border border-info/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:b},b)})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsx($0,{icon:ch,label:"Today",value:String(e)}),h.jsx($0,{icon:cv,label:"Inference",value:`${n}ms`}),h.jsx($0,{icon:mT,label:"Tracks",value:String(s)}),h.jsx($0,{icon:mm,label:"Storage",value:`${i.toFixed(1)}GB`})]})]})}function $0({icon:t,label:e,value:n}){return h.jsxs("div",{className:"flex flex-col items-center gap-1 rounded-lg border border-border bg-surface px-2 py-2",children:[h.jsx(t,{className:"h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("span",{className:"text-xs font-semibold text-foreground",children:n}),h.jsx("span",{className:"text-[9px] text-foreground-subtle",children:e})]})}const Sx={DETECT:{bg:"bg-success/15",text:"text-success"},PHASE:{bg:"bg-info/15",text:"text-info"},MOTION:{bg:"bg-warning/15",text:"text-warning"},REC:{bg:"bg-danger/15",text:"text-danger"},STATE:{bg:"bg-primary/15",text:"text-primary"},AUDIO:{bg:"bg-purple-500/15",text:"text-purple-400"}};function uD({deviceId:t}){const[e]=D.useState([]);return h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-2",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("span",{className:"relative flex h-2 w-2",children:[h.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-success opacity-75"}),h.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-success"})]}),h.jsx("h3",{className:"text-[11px] font-semibold text-foreground uppercase tracking-wider",children:"Live Events"})]}),h.jsx("button",{title:"Float panel",className:"p-1 rounded hover:bg-surface-hover text-foreground-subtle hover:text-foreground transition-colors",children:h.jsx(N1,{className:"h-3.5 w-3.5"})})]}),h.jsx("div",{className:"flex flex-wrap gap-1.5 px-3 py-2 border-b border-border",children:Object.entries(Sx).map(([n,s])=>h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n},n))}),h.jsx("div",{className:"flex-1 overflow-y-auto",children:e.length===0?h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(uv,{className:"h-6 w-6 mb-2 opacity-30"}),h.jsx("p",{className:"text-[11px]",children:"Waiting for events..."}),h.jsx("p",{className:"text-[10px] mt-0.5 opacity-70",children:"Events will stream in real-time"})]}):h.jsx("div",{className:"divide-y divide-border",children:e.map(n=>{const s=Sx[n.type]??Sx.DETECT;return h.jsxs("div",{className:"px-3 py-2 hover:bg-surface-hover transition-colors",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:`inline-flex items-center rounded px-1.5 py-0.5 text-[9px] font-medium ${s.bg} ${s.text}`,children:n.type}),h.jsx("span",{className:"text-[10px] text-foreground-subtle ml-auto",children:n.timestamp})]}),h.jsx("p",{className:"text-[11px] text-foreground mt-1",children:n.message})]},n.id)})})})]})}const p5={person:{color:"text-success",borderColor:"border-l-success",icon:AR},vehicle:{color:"text-info",borderColor:"border-l-info",icon:IE},animal:{color:"text-warning",borderColor:"border-l-warning",icon:yT},audio:{color:"text-danger",borderColor:"border-l-danger",icon:A6},other:{color:"text-foreground-subtle",borderColor:"border-l-foreground-subtle",icon:uv}};function dD(t){const e=String(t.label??t.type??"").toLowerCase();return e.includes("person")||e.includes("face")?"person":e.includes("vehicle")||e.includes("car")||e.includes("truck")?"vehicle":e.includes("animal")||e.includes("dog")||e.includes("cat")?"animal":e.includes("audio")||e.includes("sound")?"audio":"other"}function fD({deviceId:t}){const e=Ft(),{data:n,isLoading:s}=ot({queryKey:["events",t],queryFn:()=>e.getEvents(t,{limit:50}),enabled:!!t,refetchInterval:5e3}),i=n??[];return s?h.jsx("div",{className:"space-y-2",children:[1,2,3,4].map(o=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},o))}):h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Detection Events"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[i.length," event",i.length!==1?"s":""]})]}),h.jsx("div",{className:"flex flex-wrap gap-3",children:Object.entries(p5).map(([o,d])=>{const f=d.icon;return h.jsxs("span",{className:`inline-flex items-center gap-1 text-[10px] ${d.color}`,children:[h.jsx(f,{className:"h-3 w-3"}),o]},o)})}),i.length===0?h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(uv,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No events yet"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Detection events will appear here as they occur"})]})}):h.jsx("div",{className:"space-y-1.5",children:i.map((o,d)=>{const f=dD(o),p=p5[f],y=p.icon,b=String(o.label??o.type??"Unknown"),v=o.score!=null?Number(o.score):null,_=o.zone?String(o.zone):null,C=o.trackId?String(o.trackId):null,w=o.timestamp?new Date(o.timestamp).toLocaleTimeString("en-GB",{hour12:!1}):"";return h.jsxs("div",{className:`flex items-start gap-3 rounded-lg border border-border border-l-4 ${p.borderColor} bg-surface px-3 py-2.5 hover:bg-surface-hover transition-colors`,children:[h.jsx("div",{className:"h-10 w-10 rounded bg-background flex items-center justify-center flex-shrink-0",children:h.jsx(y,{className:`h-4 w-4 ${p.color}`})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-xs font-medium text-foreground capitalize",children:b}),v!=null&&h.jsxs("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:[(v*100).toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle",children:[C&&h.jsxs("span",{children:["Track: ",C]}),_&&h.jsxs("span",{children:["Zone: ",_]})]})]}),h.jsx("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:w})]},o.id?String(o.id):d)})})]})}function hD({deviceId:t}){const e=Ft(),[n,s]=D.useState(new Set),{data:i,isLoading:o}=ot({queryKey:["pipeline",t],queryFn:()=>e.bridgeGetPipeline(t),enabled:!!t}),d=i,f=(d==null?void 0:d.video)??[];function p(y){s(b=>{const v=new Set(b);return v.has(y)?v.delete(y):v.add(y),v})}return o?h.jsx("div",{className:"space-y-3",children:[1,2,3].map(y=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},y))}):f.length?h.jsxs("div",{className:"space-y-2",children:[h.jsxs("div",{className:"flex items-center justify-between mb-3",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Steps"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," step",f.length!==1?"s":""," — read-only"]})]}),f.map((y,b)=>{const v=n.has(y.id??String(b)),_=y.id??String(b);return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>p(_),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-surface-hover transition-colors",children:[v?h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Zu,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),h.jsx("span",{className:"text-[10px] text-foreground-subtle w-5",children:b+1}),h.jsx("span",{className:"text-xs font-medium text-foreground flex-1 truncate",children:y.name||y.type||`Step ${b+1}`}),h.jsx("span",{className:"text-[10px] text-foreground-subtle bg-surface-hover rounded px-1.5 py-0.5",children:y.type||"unknown"}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${y.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`})]}),v&&h.jsx("div",{className:"border-t border-border px-4 py-3 bg-background",children:h.jsx("pre",{className:"text-[11px] font-mono text-foreground-subtle whitespace-pre-wrap break-all",children:JSON.stringify(y.config??y,null,2)})})]},_)})]}):h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Pipeline Config"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(X1,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No pipeline configured"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Pipeline steps will appear here once configured"})]})]})}function pD(){return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recording Status"})}),h.jsxs("div",{className:"px-4 py-4 flex items-center gap-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-full p-2 bg-foreground-subtle/10",children:h.jsx(E6,{className:"h-5 w-5 text-foreground-subtle"})}),h.jsxs("div",{children:[h.jsx("p",{className:"text-sm font-medium text-foreground-subtle",children:"Not Recording"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"No active recording session"})]})]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Recorded Segments"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-foreground-subtle",children:[h.jsx(O6,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No recorded segments"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Recorded clips will appear here"})]})]})]})}const mD=Math.PI/180;function gD(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const qu=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},De={_global:qu,version:"10.2.3",isBrowser:gD(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return De.angleDeg?t*mD:t},enableTrace:!1,pointerEventsEnabled:!0,autoDrawEnabled:!0,hitOnDragEnabled:!1,capturePointerEventsEnabled:!1,_mouseListenClick:!1,_touchListenClick:!1,_pointerListenClick:!1,_mouseInDblClickWindow:!1,_touchInDblClickWindow:!1,_pointerInDblClickWindow:!1,_mouseDblClickPointerId:null,_touchDblClickPointerId:null,_pointerDblClickPointerId:null,_renderBackend:"web",legacyTextRendering:!1,pixelRatio:typeof window<"u"&&window.devicePixelRatio||1,dragDistance:3,angleDeg:!0,showWarnings:!0,dragButtons:[0,1],isDragging(){return De.DD.isDragging},isTransforming(){var t,e;return(e=(t=De.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!De.DD.node},releaseCanvasOnDestroy:!0,document:qu.document,_injectGlobal(t){typeof qu.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),qu.Konva=t}},ea=t=>{De[t.prototype.getClassName()]=t};De._injectGlobal(De);const yD=`Konva.js unsupported environment.
|
|
566
|
-
|
|
567
|
-
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
568
|
-
|
|
569
|
-
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
570
|
-
|
|
571
|
-
bash: npm install canvas
|
|
572
|
-
js: import "konva/canvas-backend";
|
|
573
|
-
|
|
574
|
-
or
|
|
575
|
-
|
|
576
|
-
bash: npm install skia-canvas
|
|
577
|
-
js: import "konva/skia-backend";
|
|
578
|
-
`,m5=()=>{if(typeof document>"u")throw new Error(yD)};class jr{constructor(e=[1,0,0,1,0,0]){this.dirty=!1,this.m=e&&e.slice()||[1,0,0,1,0,0]}reset(){this.m[0]=1,this.m[1]=0,this.m[2]=0,this.m[3]=1,this.m[4]=0,this.m[5]=0}copy(){return new jr(this.m)}copyInto(e){e.m[0]=this.m[0],e.m[1]=this.m[1],e.m[2]=this.m[2],e.m[3]=this.m[3],e.m[4]=this.m[4],e.m[5]=this.m[5]}point(e){const n=this.m;return{x:n[0]*e.x+n[2]*e.y+n[4],y:n[1]*e.x+n[3]*e.y+n[5]}}translate(e,n){return this.m[4]+=this.m[0]*e+this.m[2]*n,this.m[5]+=this.m[1]*e+this.m[3]*n,this}scale(e,n){return this.m[0]*=e,this.m[1]*=e,this.m[2]*=n,this.m[3]*=n,this}rotate(e){const n=Math.cos(e),s=Math.sin(e),i=this.m[0]*n+this.m[2]*s,o=this.m[1]*n+this.m[3]*s,d=this.m[0]*-s+this.m[2]*n,f=this.m[1]*-s+this.m[3]*n;return this.m[0]=i,this.m[1]=o,this.m[2]=d,this.m[3]=f,this}getTranslation(){return{x:this.m[4],y:this.m[5]}}skew(e,n){const s=this.m[0]+this.m[2]*n,i=this.m[1]+this.m[3]*n,o=this.m[2]+this.m[0]*e,d=this.m[3]+this.m[1]*e;return this.m[0]=s,this.m[1]=i,this.m[2]=o,this.m[3]=d,this}multiply(e){const n=this.m[0]*e.m[0]+this.m[2]*e.m[1],s=this.m[1]*e.m[0]+this.m[3]*e.m[1],i=this.m[0]*e.m[2]+this.m[2]*e.m[3],o=this.m[1]*e.m[2]+this.m[3]*e.m[3],d=this.m[0]*e.m[4]+this.m[2]*e.m[5]+this.m[4],f=this.m[1]*e.m[4]+this.m[3]*e.m[5]+this.m[5];return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}invert(){const e=1/(this.m[0]*this.m[3]-this.m[1]*this.m[2]),n=this.m[3]*e,s=-this.m[1]*e,i=-this.m[2]*e,o=this.m[0]*e,d=e*(this.m[2]*this.m[5]-this.m[3]*this.m[4]),f=e*(this.m[1]*this.m[4]-this.m[0]*this.m[5]);return this.m[0]=n,this.m[1]=s,this.m[2]=i,this.m[3]=o,this.m[4]=d,this.m[5]=f,this}getMatrix(){return this.m}decompose(){const e=this.m[0],n=this.m[1],s=this.m[2],i=this.m[3],o=this.m[4],d=this.m[5],f=e*i-n*s,p={x:o,y:d,rotation:0,scaleX:0,scaleY:0,skewX:0,skewY:0};if(e!=0||n!=0){const y=Math.sqrt(e*e+n*n);p.rotation=n>0?Math.acos(e/y):-Math.acos(e/y),p.scaleX=y,p.scaleY=f/y,p.skewX=(e*s+n*i)/f,p.skewY=0}else if(s!=0||i!=0){const y=Math.sqrt(s*s+i*i);p.rotation=Math.PI/2-(i>0?Math.acos(-s/y):-Math.acos(s/y)),p.scaleX=f/y,p.scaleY=y,p.skewX=0,p.skewY=(e*s+n*i)/f}return p.rotation=ee._getRotation(p.rotation),p}}const xD="[object Array]",bD="[object Number]",vD="[object String]",SD="[object Boolean]",ND=Math.PI/180,_D=180/Math.PI,em="#",jD="",CD="0",wD="Konva warning: ",g5="Konva error: ",ED="rgb(",Nx={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,132,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,255,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,203],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[119,128,144],slategrey:[119,128,144],snow:[255,255,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],transparent:[255,255,255,0],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,5]},TD=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let e1=[],tm=null;const RD=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,16)},ee={_isElement(t){return!!(t&&t.nodeType==1)},_isFunction(t){return!!(t&&t.constructor&&t.call&&t.apply)},_isPlainObject(t){return!!t&&t.constructor===Object},_isArray(t){return Object.prototype.toString.call(t)===xD},_isNumber(t){return Object.prototype.toString.call(t)===bD&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===vD},_isBoolean(t){return Object.prototype.toString.call(t)===SD},isObject(t){return t instanceof Object},isValidSelector(t){if(typeof t!="string")return!1;const e=t[0];return e==="#"||e==="."||e===e.toUpperCase()},_sign(t){return t===0||t>0?1:-1},requestAnimFrame(t){e1.push(t),e1.length===1&&RD(function(){const e=e1;e1=[],e.forEach(function(n){n()})})},createCanvasElement(){m5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return m5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const n=ee.createImageElement();n.onload=function(){e(n)},n.src=t},_rgbToHex(t,e,n){return((1<<24)+(t<<16)+(e<<8)+n).toString(16).slice(1)},_hexToRgb(t){t=t.replace(em,jD);const e=parseInt(t,16);return{r:e>>16&255,g:e>>8&255,b:e&255}},getRandomColor(){let t=(Math.random()*16777215<<0).toString(16);for(;t.length<6;)t=CD+t;return em+t},isCanvasFarblingActive(){if(tm!==null)return tm;if(typeof document>"u")return tm=!1,!1;const t=this.createCanvasElement();t.width=10,t.height=10;const e=t.getContext("2d",{willReadFrequently:!0});e.clearRect(0,0,10,10),e.fillStyle="#282828",e.fillRect(0,0,10,10);const n=e.getImageData(0,0,10,10).data;let s=!1;for(let i=0;i<100;i++)if(n[i*4]!==40||n[i*4+1]!==40||n[i*4+2]!==40||n[i*4+3]!==255){s=!0;break}return tm=s,this.releaseCanvas(t),tm},getHitColor(){const t=this.getRandomColor();return this.isCanvasFarblingActive()?this.getSnappedHexColor(t):t},getHitColorKey(t,e,n){return this.isCanvasFarblingActive()&&(t=Math.round(t/5)*5,e=Math.round(e/5)*5,n=Math.round(n/5)*5),em+this._rgbToHex(t,e,n)},getSnappedHexColor(t){const e=this._hexToRgb(t);return em+this._rgbToHex(Math.round(e.r/5)*5,Math.round(e.g/5)*5,Math.round(e.b/5)*5)},getRGB(t){let e;return t in Nx?(e=Nx[t],{r:e[0],g:e[1],b:e[2]}):t[0]===em?this._hexToRgb(t.substring(1)):t.substr(0,4)===ED?(e=TD.exec(t.replace(/ /g,"")),{r:parseInt(e[1],10),g:parseInt(e[2],10),b:parseInt(e[3],10)}):{r:0,g:0,b:0}},colorToRGBA(t){return t=t||"black",ee._namedColorToRBA(t)||ee._hex3ColorToRGBA(t)||ee._hex4ColorToRGBA(t)||ee._hex6ColorToRGBA(t)||ee._hex8ColorToRGBA(t)||ee._rgbColorToRGBA(t)||ee._rgbaColorToRGBA(t)||ee._hslColorToRGBA(t)},_namedColorToRBA(t){const e=Nx[t.toLowerCase()];return e?{r:e[0],g:e[1],b:e[2],a:1}:null},_rgbColorToRGBA(t){if(t.indexOf("rgb(")===0){t=t.match(/rgb\(([^)]+)\)/)[1];const e=t.split(/ *, */).map(Number);return{r:e[0],g:e[1],b:e[2],a:1}}},_rgbaColorToRGBA(t){if(t.indexOf("rgba(")===0){t=t.match(/rgba\(([^)]+)\)/)[1];const e=t.split(/ *, */).map((n,s)=>n.slice(-1)==="%"?s===3?parseInt(n)/100:parseInt(n)/100*255:Number(n));return{r:e[0],g:e[1],b:e[2],a:e[3]}}},_hex8ColorToRGBA(t){if(t[0]==="#"&&t.length===9)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:parseInt(t.slice(7,9),16)/255}},_hex6ColorToRGBA(t){if(t[0]==="#"&&t.length===7)return{r:parseInt(t.slice(1,3),16),g:parseInt(t.slice(3,5),16),b:parseInt(t.slice(5,7),16),a:1}},_hex4ColorToRGBA(t){if(t[0]==="#"&&t.length===5)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:parseInt(t[4]+t[4],16)/255}},_hex3ColorToRGBA(t){if(t[0]==="#"&&t.length===4)return{r:parseInt(t[1]+t[1],16),g:parseInt(t[2]+t[2],16),b:parseInt(t[3]+t[3],16),a:1}},_hslColorToRGBA(t){if(/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.test(t)){const[e,...n]=/hsl\((\d+),\s*([\d.]+)%,\s*([\d.]+)%\)/g.exec(t),s=Number(n[0])/360,i=Number(n[1])/100,o=Number(n[2])/100;let d,f,p;if(i===0)return p=o*255,{r:Math.round(p),g:Math.round(p),b:Math.round(p),a:1};o<.5?d=o*(1+i):d=o+i-o*i;const y=2*o-d,b=[0,0,0];for(let v=0;v<3;v++)f=s+1/3*-(v-1),f<0&&f++,f>1&&f--,6*f<1?p=y+(d-y)*6*f:2*f<1?p=d:3*f<2?p=y+(d-y)*(2/3-f)*6:p=y,b[v]=p*255;return{r:Math.round(b[0]),g:Math.round(b[1]),b:Math.round(b[2]),a:1}}},haveIntersection(t,e){return!(e.x>t.x+t.width||e.x+e.width<t.x||e.y>t.y+t.height||e.y+e.height<t.y)},cloneObject(t){const e={};for(const n in t)this._isPlainObject(t[n])?e[n]=this.cloneObject(t[n]):this._isArray(t[n])?e[n]=this.cloneArray(t[n]):e[n]=t[n];return e},cloneArray(t){return t.slice(0)},degToRad(t){return t*ND},radToDeg(t){return t*_D},_degToRad(t){return ee.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),ee.degToRad(t)},_radToDeg(t){return ee.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),ee.radToDeg(t)},_getRotation(t){return De.angleDeg?ee.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(g5+t)},error(t){console.error(g5+t)},warn(t){De.showWarnings&&console.warn(wD+t)},each(t,e){for(const n in t)e(n,t[n])},_inRange(t,e,n){return e<=t&&t<n},_getProjectionToSegment(t,e,n,s,i,o){let d,f,p;const y=(t-n)*(t-n)+(e-s)*(e-s);if(y==0)d=t,f=e,p=(i-n)*(i-n)+(o-s)*(o-s);else{const b=((i-t)*(n-t)+(o-e)*(s-e))/y;b<0?(d=t,f=e,p=(t-i)*(t-i)+(e-o)*(e-o)):b>1?(d=n,f=s,p=(n-i)*(n-i)+(s-o)*(s-o)):(d=t+b*(n-t),f=e+b*(s-e),p=(d-i)*(d-i)+(f-o)*(f-o))}return[d,f,p]},_getProjectionToLine(t,e,n){const s=ee.cloneObject(t);let i=Number.MAX_VALUE;return e.forEach(function(o,d){if(!n&&d===e.length-1)return;const f=e[(d+1)%e.length],p=ee._getProjectionToSegment(o.x,o.y,f.x,f.y,t.x,t.y),y=p[0],b=p[1],v=p[2];v<i&&(s.x=y,s.y=b,i=v)}),s},_prepareArrayForTween(t,e,n){const s=[],i=[];if(t.length>e.length){const d=e;e=t,t=d}for(let d=0;d<t.length;d+=2)s.push({x:t[d],y:t[d+1]});for(let d=0;d<e.length;d+=2)i.push({x:e[d],y:e[d+1]});const o=[];return i.forEach(function(d){const f=ee._getProjectionToLine(d,s,n);o.push(f.x),o.push(f.y)}),o},_prepareToStringify(t){let e;t.visitedByCircularReferenceRemoval=!0;for(const n in t)if(t.hasOwnProperty(n)&&t[n]&&typeof t[n]=="object"){if(e=Object.getOwnPropertyDescriptor(t,n),t[n].visitedByCircularReferenceRemoval||ee._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(ee._prepareToStringify(t[n])===null)if(e.configurable)delete t[n];else return null}return delete t.visitedByCircularReferenceRemoval,t},_assign(t,e){for(const n in e)t[n]=e[n];return t},_getFirstPointerId(t){return t.touches?t.changedTouches[0].identifier:t.pointerId||999},releaseCanvas(...t){De.releaseCanvasOnDestroy&&t.forEach(e=>{e.width=0,e.height=0})},drawRoundedRectPath(t,e,n,s){let i=e<0?e:0,o=n<0?n:0;e=Math.abs(e),n=Math.abs(n);let d=0,f=0,p=0,y=0;typeof s=="number"?d=f=p=y=Math.min(s,e/2,n/2):(d=Math.min(s[0]||0,e/2,n/2),f=Math.min(s[1]||0,e/2,n/2),y=Math.min(s[2]||0,e/2,n/2),p=Math.min(s[3]||0,e/2,n/2)),t.moveTo(i+d,o),t.lineTo(i+e-f,o),t.arc(i+e-f,o+f,f,Math.PI*3/2,0,!1),t.lineTo(i+e,o+n-y),t.arc(i+e-y,o+n-y,y,0,Math.PI/2,!1),t.lineTo(i+p,o+n),t.arc(i+p,o+n-p,p,Math.PI/2,Math.PI,!1),t.lineTo(i,o+d),t.arc(i+d,o+d,d,Math.PI,Math.PI*3/2,!1)},drawRoundedPolygonPath(t,e,n,s,i){s=Math.abs(s);for(let o=0;o<n;o++){const d=e[(o-1+n)%n],f=e[o],p=e[(o+1)%n],y={x:f.x-d.x,y:f.y-d.y},b={x:p.x-f.x,y:p.y-f.y},v=Math.hypot(y.x,y.y),_=Math.hypot(b.x,b.y);let C;typeof i=="number"?C=i:C=o<i.length?i[o]:0,C=s*Math.cos(Math.PI/n)*Math.min(1,C/s*2);const T={x:y.x/v,y:y.y/v},R={x:b.x/_,y:b.y/_},O={x:f.x-T.x*C,y:f.y-T.y*C},M={x:f.x+R.x*C,y:f.y+R.y*C};o===0?t.moveTo(O.x,O.y):t.lineTo(O.x,O.y),t.arcTo(f.x,f.y,M.x,M.y,C)}}};function OD(t){const e=[],n=t.length,s=ee;for(let i=0;i<n;i++){let o=t[i];s._isNumber(o)?o=Math.round(o*1e3)/1e3:s._isString(o)||(o=o+""),e.push(o)}return e}const y5=",",MD="(",AD=")",DD="([",zD="])",kD=";",LD="()",UD="=",x5=["arc","arcTo","beginPath","bezierCurveTo","clearRect","clip","closePath","createLinearGradient","createPattern","createRadialGradient","drawImage","ellipse","fill","fillText","getImageData","createImageData","lineTo","moveTo","putImageData","quadraticCurveTo","rect","roundRect","restore","rotate","save","scale","setLineDash","setTransform","stroke","strokeText","transform","translate"],qD=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],HD=100;let t1=null;function b5(){if(t1!==null)return t1;try{const e=ee.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(t1=!1,!1)}catch{return t1=!1,!1}}class sy{constructor(e){this.canvas=e,De.enableTrace&&(this.traceArr=[],this._enableTrace())}fillShape(e){e.fillEnabled()&&this._fill(e)}_fill(e){}strokeShape(e){e.hasStroke()&&this._stroke(e)}_stroke(e){}fillStrokeShape(e){e.attrs.fillAfterStrokeEnabled?(this.strokeShape(e),this.fillShape(e)):(this.fillShape(e),this.strokeShape(e))}getTrace(e,n){let s=this.traceArr,i=s.length,o="",d,f,p,y;for(d=0;d<i;d++)f=s[d],p=f.method,p?(y=f.args,o+=p,e?o+=LD:ee._isArray(y[0])?o+=DD+y.join(y5)+zD:(n&&(y=y.map(b=>typeof b=="number"?Math.floor(b):b)),o+=MD+y.join(y5)+AD)):(o+=f.property,e||(o+=UD+f.val)),o+=kD;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,s;n.push(e),s=n.length,s>=HD&&n.shift()}reset(){const e=this.getCanvas().getPixelRatio();this.setTransform(1*e,0,0,1*e,0,0)}getCanvas(){return this.canvas}clear(e){const n=this.getCanvas();e?this.clearRect(e.x||0,e.y||0,e.width||0,e.height||0):this.clearRect(0,0,n.getWidth()/n.pixelRatio,n.getHeight()/n.pixelRatio)}_applyLineCap(e){const n=e.attrs.lineCap;n&&this.setAttr("lineCap",n)}_applyOpacity(e){const n=e.getAbsoluteOpacity();n!==1&&this.setAttr("globalAlpha",n)}_applyLineJoin(e){const n=e.attrs.lineJoin;n&&this.setAttr("lineJoin",n)}_applyMiterLimit(e){const n=e.attrs.miterLimit;n!=null&&this.setAttr("miterLimit",n)}setAttr(e,n){this._context[e]=n}arc(e,n,s,i,o,d){this._context.arc(e,n,s,i,o,d)}arcTo(e,n,s,i,o){this._context.arcTo(e,n,s,i,o)}beginPath(){this._context.beginPath()}bezierCurveTo(e,n,s,i,o,d){this._context.bezierCurveTo(e,n,s,i,o,d)}clearRect(e,n,s,i){this._context.clearRect(e,n,s,i)}clip(...e){this._context.clip.apply(this._context,e)}closePath(){this._context.closePath()}createImageData(e,n){const s=arguments;if(s.length===2)return this._context.createImageData(e,n);if(s.length===1)return this._context.createImageData(e)}createLinearGradient(e,n,s,i){return this._context.createLinearGradient(e,n,s,i)}createPattern(e,n){return this._context.createPattern(e,n)}createRadialGradient(e,n,s,i,o,d){return this._context.createRadialGradient(e,n,s,i,o,d)}drawImage(e,n,s,i,o,d,f,p,y){const b=arguments,v=this._context;b.length===3?v.drawImage(e,n,s):b.length===5?v.drawImage(e,n,s,i,o):b.length===9&&v.drawImage(e,n,s,i,o,d,f,p,y)}ellipse(e,n,s,i,o,d,f,p){this._context.ellipse(e,n,s,i,o,d,f,p)}isPointInPath(e,n,s,i){return s?this._context.isPointInPath(s,e,n,i):this._context.isPointInPath(e,n,i)}fill(...e){this._context.fill.apply(this._context,e)}fillRect(e,n,s,i){this._context.fillRect(e,n,s,i)}strokeRect(e,n,s,i){this._context.strokeRect(e,n,s,i)}fillText(e,n,s,i){i?this._context.fillText(e,n,s,i):this._context.fillText(e,n,s)}measureText(e){return this._context.measureText(e)}getImageData(e,n,s,i){return this._context.getImageData(e,n,s,i)}lineTo(e,n){this._context.lineTo(e,n)}moveTo(e,n){this._context.moveTo(e,n)}rect(e,n,s,i){this._context.rect(e,n,s,i)}roundRect(e,n,s,i,o){this._context.roundRect(e,n,s,i,o)}putImageData(e,n,s){this._context.putImageData(e,n,s)}quadraticCurveTo(e,n,s,i){this._context.quadraticCurveTo(e,n,s,i)}restore(){this._context.restore()}rotate(e){this._context.rotate(e)}save(){this._context.save()}scale(e,n){this._context.scale(e,n)}setLineDash(e){this._context.setLineDash?this._context.setLineDash(e):"mozDash"in this._context?this._context.mozDash=e:"webkitLineDash"in this._context&&(this._context.webkitLineDash=e)}getLineDash(){return this._context.getLineDash()}setTransform(e,n,s,i,o,d){this._context.setTransform(e,n,s,i,o,d)}stroke(e){e?this._context.stroke(e):this._context.stroke()}strokeText(e,n,s,i){this._context.strokeText(e,n,s,i)}transform(e,n,s,i,o,d){this._context.transform(e,n,s,i,o,d)}translate(e,n){this._context.translate(e,n)}_enableTrace(){let e=this,n=x5.length,s=this.setAttr,i,o;const d=function(f){let p=e[f],y;e[f]=function(){return o=OD(Array.prototype.slice.call(arguments,0)),y=p.apply(e,arguments),e._trace({method:f,args:o}),y}};for(i=0;i<n;i++)d(x5[i]);e.setAttr=function(){s.apply(e,arguments);const f=arguments[0];let p=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(p=p/this.canvas.getPixelRatio()),e._trace({property:f,val:p})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}qD.forEach(function(t){Object.defineProperty(sy.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class BD extends sy{constructor(e,{willReadFrequently:n=!1}={}){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:n})}_fillColor(e){const n=e.fill();this.setAttr("fillStyle",n),e._fillFunc(this)}_fillPattern(e){this.setAttr("fillStyle",e._getFillPattern()),e._fillFunc(this)}_fillLinearGradient(e){const n=e._getLinearGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fillRadialGradient(e){const n=e._getRadialGradient();n&&(this.setAttr("fillStyle",n),e._fillFunc(this))}_fill(e){const n=e.fill(),s=e.getFillPriority();if(n&&s==="color"){this._fillColor(e);return}const i=e.getFillPatternImage();if(i&&s==="pattern"){this._fillPattern(e);return}const o=e.getFillLinearGradientColorStops();if(o&&s==="linear-gradient"){this._fillLinearGradient(e);return}const d=e.getFillRadialGradientColorStops();if(d&&s==="radial-gradient"){this._fillRadialGradient(e);return}n?this._fillColor(e):i?this._fillPattern(e):o?this._fillLinearGradient(e):d&&this._fillRadialGradient(e)}_strokeLinearGradient(e){const n=e.getStrokeLinearGradientStartPoint(),s=e.getStrokeLinearGradientEndPoint(),i=e.getStrokeLinearGradientColorStops(),o=this.createLinearGradient(n.x,n.y,s.x,s.y);if(i){for(let d=0;d<i.length;d+=2)o.addColorStop(i[d],i[d+1]);this.setAttr("strokeStyle",o)}}_stroke(e){const n=e.dash(),s=e.getStrokeScaleEnabled();if(e.hasStroke()){if(!s){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e),n&&e.dashEnabled()&&(this.setLineDash(n),this.setAttr("lineDashOffset",e.dashOffset())),this.setAttr("lineWidth",e.strokeWidth()),e.getShadowForStrokeEnabled()||this.setAttr("shadowColor","rgba(0,0,0,0)"),e.getStrokeLinearGradientColorStops()?this._strokeLinearGradient(e):this.setAttr("strokeStyle",e.stroke()),e._strokeFunc(this),s||this.restore()}}_applyShadow(e){var n,s,i;const o=(n=e.getShadowRGBA())!==null&&n!==void 0?n:"black",d=(s=e.getShadowBlur())!==null&&s!==void 0?s:5,f=(i=e.getShadowOffset())!==null&&i!==void 0?i:{x:0,y:0},p=e.getAbsoluteScale(),y=this.canvas.getPixelRatio(),b=p.x*y,v=p.y*y;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",d*Math.min(Math.abs(b),Math.abs(v))),this.setAttr("shadowOffsetX",f.x*b),this.setAttr("shadowOffsetY",f.y*v)}}class GD extends sy{constructor(e){super(e),this._context=e._canvas.getContext("2d",{willReadFrequently:!0})}_fill(e){this.save(),this.setAttr("fillStyle",e.colorKey),e._fillFuncHit(this),this.restore()}strokeShape(e){e.hasHitStroke()&&this._stroke(e)}_stroke(e){if(e.hasHitStroke()){const n=e.getStrokeScaleEnabled();if(!n){this.save();const o=this.getCanvas().getPixelRatio();this.setTransform(o,0,0,o,0,0)}this._applyLineCap(e);const s=e.hitStrokeWidth(),i=s==="auto"?e.strokeWidth():s;this.setAttr("lineWidth",i),this.setAttr("strokeStyle",e.colorKey),e._strokeFuncHit(this),n||this.restore()}}}let n1;function PD(){if(n1)return n1;const t=ee.createCanvasElement(),e=t.getContext("2d");return n1=(function(){const n=De._global.devicePixelRatio||1,s=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/s})(),ee.releaseCanvas(t),n1}class Ev{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(e||{}).pixelRatio||De.pixelRatio||PD();this.pixelRatio=s,this._canvas=ee.createCanvasElement(),this._canvas.style.padding="0",this._canvas.style.margin="0",this._canvas.style.border="0",this._canvas.style.background="transparent",this._canvas.style.position="absolute",this._canvas.style.top="0",this._canvas.style.left="0"}getContext(){return this.context}getPixelRatio(){return this.pixelRatio}setPixelRatio(e){const n=this.pixelRatio;this.pixelRatio=e,this.setSize(this.getWidth()/n,this.getHeight()/n)}setWidth(e){this.width=this._canvas.width=e*this.pixelRatio,this._canvas.style.width=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}setHeight(e){this.height=this._canvas.height=e*this.pixelRatio,this._canvas.style.height=e+"px";const n=this.pixelRatio;this.getContext()._context.scale(n,n)}getWidth(){return this.width}getHeight(){return this.height}setSize(e,n){this.setWidth(e||0),this.setHeight(n||0)}toDataURL(e,n){try{return this._canvas.toDataURL(e,n)}catch{try{return this._canvas.toDataURL()}catch(i){return ee.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class xc extends Ev{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new BD(this,{willReadFrequently:e.willReadFrequently}),this.setSize(e.width,e.height)}}class Tv extends Ev{constructor(e={width:0,height:0}){super(e),this.hitCanvas=!0,this.context=new GD(this),this.setSize(e.width,e.height)}}const Yt={get isDragging(){let t=!1;return Yt._dragElements.forEach(e=>{e.dragStatus==="dragging"&&(t=!0)}),t},justDragged:!1,get node(){let t;return Yt._dragElements.forEach(e=>{t=e.node}),t},_dragElements:new Map,_drag(t){const e=[];Yt._dragElements.forEach((n,s)=>{const{node:i}=n,o=i.getStage();o.setPointersPositions(t),n.pointerId===void 0&&(n.pointerId=ee._getFirstPointerId(t));const d=o._changedPointerPositions.find(f=>f.id===n.pointerId);if(d){if(n.dragStatus!=="dragging"){const f=i.dragDistance();if(Math.max(Math.abs(d.x-n.startPointerPos.x),Math.abs(d.y-n.startPointerPos.y))<f||(i.startDrag({evt:t}),!i.isDragging()))return}i._setDragPosition(t,n),e.push(i)}}),e.forEach(n=>{n.getStage()&&n.fire("dragmove",{type:"dragmove",target:n,evt:t},!0)})},_endDragBefore(t){const e=[];Yt._dragElements.forEach(n=>{const{node:s}=n,i=s.getStage();if(t&&i.setPointersPositions(t),!i._changedPointerPositions.find(f=>f.id===n.pointerId))return;(n.dragStatus==="dragging"||n.dragStatus==="stopped")&&(Yt.justDragged=!0,De._mouseListenClick=!1,De._touchListenClick=!1,De._pointerListenClick=!1,n.dragStatus="stopped");const d=n.node.getLayer()||n.node instanceof De.Stage&&n.node;d&&e.indexOf(d)===-1&&e.push(d)}),e.forEach(n=>{n.draw()})},_endDragAfter(t){Yt._dragElements.forEach((e,n)=>{e.dragStatus==="stopped"&&e.node.fire("dragend",{type:"dragend",target:e.node,evt:t},!0),e.dragStatus!=="dragging"&&Yt._dragElements.delete(n)})}};De.isBrowser&&(window.addEventListener("mouseup",Yt._endDragBefore,!0),window.addEventListener("touchend",Yt._endDragBefore,!0),window.addEventListener("touchcancel",Yt._endDragBefore,!0),window.addEventListener("mousemove",Yt._drag),window.addEventListener("touchmove",Yt._drag),window.addEventListener("mouseup",Yt._endDragAfter,!1),window.addEventListener("touchend",Yt._endDragAfter,!1),window.addEventListener("touchcancel",Yt._endDragAfter,!1));function Uc(t){return ee._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||ee._isBoolean(t)?t:Object.prototype.toString.call(t)}function b8(t){return t>255?255:t<0?0:Math.round(t)}function Re(){if(De.isUnminified)return function(t,e){return ee._isNumber(t)||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function ry(t){if(De.isUnminified)return function(e,n){let s=ee._isNumber(e),i=ee._isArray(e)&&e.length==t;return!s&&!i&&ee.warn(Uc(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Rv(){if(De.isUnminified)return function(t,e){return ee._isNumber(t)||t==="auto"||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function rd(){if(De.isUnminified)return function(t,e){return ee._isString(t)||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function v8(){if(De.isUnminified)return function(t,e){const n=ee._isString(t),s=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||s||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function YD(){if(De.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(ee._isArray(t)?t.forEach(function(s){ee._isNumber(s)||ee.warn('"'+e+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Oi(){if(De.isUnminified)return function(t,e){return t===!0||t===!1||ee.warn(Uc(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function VD(t){if(De.isUnminified)return function(e,n){return e==null||ee.isObject(e)||ee.warn(Uc(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}const nm="get",am="set",K={addGetterSetter(t,e,n,s,i){K.addGetter(t,e,n),K.addSetter(t,e,s,i),K.addOverloadedGetterSetter(t,e)},addGetter(t,e,n){const s=nm+ee._capitalize(e);t.prototype[s]=t.prototype[s]||function(){const i=this.attrs[e];return i===void 0?n:i}},addSetter(t,e,n,s){const i=am+ee._capitalize(e);t.prototype[i]||K.overWriteSetter(t,e,n,s)},overWriteSetter(t,e,n,s){const i=am+ee._capitalize(e);t.prototype[i]=function(o){return n&&o!==void 0&&o!==null&&(o=n.call(this,o,e)),this._setAttr(e,o),s&&s.call(this),this}},addComponentsGetterSetter(t,e,n,s,i){const o=n.length,d=ee._capitalize,f=nm+d(e),p=am+d(e);t.prototype[f]=function(){const b={};for(let v=0;v<o;v++){const _=n[v];b[_]=this.getAttr(e+d(_))}return b};const y=VD(n);t.prototype[p]=function(b){const v=this.attrs[e];s&&(b=s.call(this,b,e)),y&&y.call(this,b,e);for(const _ in b)b.hasOwnProperty(_)&&this._setAttr(e+d(_),b[_]);return b||n.forEach(_=>{this._setAttr(e+d(_),void 0)}),this._fireChangeEvent(e,v,b),i&&i.call(this),this},K.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=ee._capitalize(e),s=am+n,i=nm+n;t.prototype[e]=function(){return arguments.length?(this[s](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,s){ee.error("Adding deprecated "+e);const i=nm+ee._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){ee.error(o);const d=this.attrs[e];return d===void 0?n:d},K.addSetter(t,e,s,function(){ee.error(o)}),K.addOverloadedGetterSetter(t,e)},backCompat(t,e){ee.each(e,function(n,s){const i=t.prototype[s],o=nm+ee._capitalize(n),d=am+ee._capitalize(n);function f(){i.apply(this,arguments),ee.error('"'+n+'" method is deprecated and will be removed soon. Use ""'+s+'" instead.')}t.prototype[n]=f,t.prototype[o]=f,t.prototype[d]=f})},afterSetFilter(){this._filterUpToDate=!1}};function QD(t){const e=/(\w+)\(([^)]+)\)/g;let n;for(;(n=e.exec(t))!==null;){const[,s,i]=n;switch(s){case"blur":{const o=parseFloat(i.replace("px",""));return function(d){this.blurRadius(o*.5);const f=De.Filters;f&&f.Blur&&f.Blur.call(this,d)}}case"brightness":{const o=i.includes("%")?parseFloat(i)/100:parseFloat(i);return function(d){this.brightness(o);const f=De.Filters;f&&f.Brightness&&f.Brightness.call(this,d)}}case"contrast":{const o=parseFloat(i);return function(d){const f=100*(Math.sqrt(o)-1);this.contrast(f);const p=De.Filters;p&&p.Contrast&&p.Contrast.call(this,d)}}case"grayscale":return function(o){const d=De.Filters;d&&d.Grayscale&&d.Grayscale.call(this,o)};case"sepia":return function(o){const d=De.Filters;d&&d.Sepia&&d.Sepia.call(this,o)};case"invert":return function(o){const d=De.Filters;d&&d.Invert&&d.Invert.call(this,o)};default:ee.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const y1="absoluteOpacity",v5="allEventListeners",ao="absoluteTransform",S5="absoluteScale",zu="canvas",KD="Change",XD="children",FD="konva",Eb="listening",ZD="mouseenter",ID="mouseleave",JD="pointerenter",WD="pointerleave",$D="touchenter",ez="touchleave",N5="set",_5="Shape",x1=" ",j5="stage",gc="transform",tz="Stage",Tb="visible",nz=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(x1);let az=1;class Ae{constructor(e){this._id=az++,this.eventListeners={},this.attrs={},this.index=0,this._allEventListeners=null,this.parent=null,this._cache=new Map,this._attachedDepsListeners=new Map,this._lastPos=null,this._batchingTransformChange=!1,this._needClearTransformCache=!1,this._filterUpToDate=!1,this._isUnderCache=!1,this._dragEventId=null,this._shouldFireChangeEvents=!1,this.setAttrs(e),this._shouldFireChangeEvents=!0}hasChildren(){return!1}_clearCache(e){(e===gc||e===ao)&&this._cache.get(e)?this._cache.get(e).dirty=!0:e?this._cache.delete(e):this._cache.clear()}_getCache(e,n){let s=this._cache.get(e);return(s===void 0||(e===gc||e===ao)&&s.dirty===!0)&&(s=n.call(this),this._cache.set(e,s)),s}_calculate(e,n,s){if(!this._attachedDepsListeners.get(e)){const i=n.map(o=>o+"Change.konva").join(x1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,s)}_getCanvasCache(){return this._cache.get(zu)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===ao&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(zu)){const{scene:e,filter:n,hit:s}=this._cache.get(zu);ee.releaseCanvas(e._canvas,n._canvas,s._canvas),this._cache.delete(zu)}return this._clearSelfAndDescendantCache(),this._requestDraw(),this}cache(e){const n=e||{};let s={};(n.x===void 0||n.y===void 0||n.width===void 0||n.height===void 0)&&(s=this.getClientRect({skipTransform:!0,relativeTo:this.getParent()||void 0}));let i=Math.ceil(n.width||s.width),o=Math.ceil(n.height||s.height),d=n.pixelRatio,f=n.x===void 0?Math.floor(s.x):n.x,p=n.y===void 0?Math.floor(s.y):n.y,y=n.offset||0,b=n.drawBorder||!1,v=n.hitCanvasPixelRatio||1;if(!i||!o){ee.error("Can not cache the node. Width or height of the node equals 0. Caching is skipped.");return}const _=Math.abs(Math.round(s.x)-f)>.5?1:0,C=Math.abs(Math.round(s.y)-p)>.5?1:0;i+=y*2+_,o+=y*2+C,f-=y,p-=y;const w=new xc({pixelRatio:d,width:i,height:o}),T=new xc({pixelRatio:d,width:0,height:0,willReadFrequently:!0}),R=new Tv({pixelRatio:v,width:i,height:o}),O=w.getContext(),M=R.getContext(),z=new xc({width:w.width/w.pixelRatio+Math.abs(f),height:w.height/w.pixelRatio+Math.abs(p),pixelRatio:w.pixelRatio}),k=z.getContext();return R.isCache=!0,w.isCache=!0,this._cache.delete(zu),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(w.getContext()._context.imageSmoothingEnabled=!1,T.getContext()._context.imageSmoothingEnabled=!1),O.save(),M.save(),k.save(),O.translate(-f,-p),M.translate(-f,-p),k.translate(-f,-p),z.x=f,z.y=p,this._isUnderCache=!0,this._clearSelfAndDescendantCache(y1),this._clearSelfAndDescendantCache(S5),this.drawScene(w,this,z),this.drawHit(R,this),this._isUnderCache=!1,O.restore(),M.restore(),b&&(O.save(),O.beginPath(),O.rect(0,0,i,o),O.closePath(),O.setAttr("strokeStyle","red"),O.setAttr("lineWidth",5),O.stroke(),O.restore()),ee.releaseCanvas(z._canvas),this._cache.set(zu,{scene:w,filter:T,hit:R,x:f,y:p}),this._requestDraw(),this}isCached(){return this._cache.has(zu)}getClientRect(e){throw new Error('abstract "getClientRect" method call')}_transformedRect(e,n){const s=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}];let i=1/0,o=1/0,d=-1/0,f=-1/0;const p=this.getAbsoluteTransform(n);return s.forEach(function(y){const b=p.point(y);i===void 0&&(i=d=b.x,o=f=b.y),i=Math.min(i,b.x),o=Math.min(o,b.y),d=Math.max(d,b.x),f=Math.max(f,b.y)}),{x:i,y:o,width:d-i,height:f-o}}_drawCachedSceneCanvas(e){e.save(),e._applyOpacity(this),e._applyGlobalCompositeOperation(this);const n=this._getCanvasCache();e.translate(n.x,n.y);const s=this._getCachedSceneCanvas(),i=s.pixelRatio;e.drawImage(s._canvas,0,0,s.width/i,s.height/i),e.restore()}_drawCachedHitCanvas(e){const n=this._getCanvasCache(),s=n.hit;e.save(),e.translate(n.x,n.y),e.drawImage(s._canvas,0,0,s.width/s.pixelRatio,s.height/s.pixelRatio),e.restore()}_getCachedSceneCanvas(){let e=this.filters(),n=this._getCanvasCache(),s=n.scene,i=n.filter,o=i.getContext(),d,f,p,y;if(!e||e.length===0)return s;if(this._filterUpToDate)return i;let b=!0;for(let _=0;_<e.length;_++)if(typeof e[_]=="string"&&b5(),typeof e[_]!="string"||!b5()){b=!1;break}const v=s.pixelRatio;if(i.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),b){const _=e.join(" ");return o.save(),o.setAttr("filter",_),o.drawImage(s._canvas,0,0,s.getWidth()/v,s.getHeight()/v),o.restore(),this._filterUpToDate=!0,i}try{for(d=e.length,o.clear(),o.drawImage(s._canvas,0,0,s.getWidth()/v,s.getHeight()/v),f=o.getImageData(0,0,i.getWidth(),i.getHeight()),p=0;p<d;p++)y=e[p],typeof y=="string"&&(y=QD(y)),y.call(this,f),o.putImageData(f,0,0)}catch(_){ee.error("Unable to apply filter. "+_.message+" This post my help you https://konvajs.org/docs/posts/Tainted_Canvas.html.")}return this._filterUpToDate=!0,i}on(...e){const n=e[0],s=e[1];if(e[2],this._cache&&this._cache.delete(v5),e.length===3)return this._delegate.apply(this,e);const i=n.split(x1);for(let o=0;o<i.length;o++){const f=i[o].split("."),p=f[0],y=f[1]||"";this.eventListeners[p]||(this.eventListeners[p]=[]),this.eventListeners[p].push({name:y,handler:s})}return this}off(e,n){let s=(e||"").split(x1),i=s.length,o,d,f,p,y,b;if(this._cache&&this._cache.delete(v5),!e)for(d in this.eventListeners)this._off(d);for(o=0;o<i;o++)if(f=s[o],p=f.split("."),y=p[0],b=p[1],y)this.eventListeners[y]&&this._off(y,b,n);else for(d in this.eventListeners)this._off(d,b,n);return this}dispatchEvent(e){const n={target:this,type:e.type,evt:e};return this.fire(e.type,n),this}addEventListener(e,n){return this.on(e,function(s){n.call(this,s.evt)}),this}removeEventListener(e){return this.off(e),this}_delegate(e,n,s){const i=this;return this.on(e,function(o){const d=o.target.findAncestors(n,!0,i);for(let f=0;f<d.length;f++)o=ee.cloneObject(o),o.currentTarget=d[f],s.call(d[f],o)}),this}remove(){return this.isDragging()&&this.stopDrag(),Yt._dragElements.delete(this._id),Yt._dragElements.forEach((e,n)=>{this.isAncestorOf(e.node)&&Yt._dragElements.delete(n)}),this._remove(),this}_clearCaches(){this._clearSelfAndDescendantCache(ao),this._clearSelfAndDescendantCache(y1),this._clearSelfAndDescendantCache(S5),this._clearSelfAndDescendantCache(j5),this._clearSelfAndDescendantCache(Tb),this._clearSelfAndDescendantCache(Eb)}_remove(){this._clearCaches();const e=this.getParent();e&&e.children&&(e.children.splice(this.index,1),e._setChildrenIndices(),this.parent=null)}destroy(){return this.remove(),this.clearCache(),this}getAttr(e){const n="get"+ee._capitalize(e);return ee._isFunction(this[n])?this[n]():this.attrs[e]}getAncestors(){let e=this.getParent(),n=[];for(;e;)n.push(e),e=e.getParent();return n}getAttrs(){return this.attrs||{}}setAttrs(e){return this._batchTransformChanges(()=>{let n,s;if(!e)return this;for(n in e)n!==XD&&(s=N5+ee._capitalize(n),ee._isFunction(this[s])?this[s](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(Eb,this._isListening)}_isListening(e){if(!this.listening())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isListening(e):!0}isVisible(){return this._getCache(Tb,this._isVisible)}_isVisible(e){if(!this.visible())return!1;const s=this.getParent();return s&&s!==e&&this!==e?s._isVisible(e):!0}shouldDrawHit(e,n=!1){if(e)return this._isVisible(e)&&this._isListening(e);const s=this.getLayer();let i=!1;Yt._dragElements.forEach(d=>{d.dragStatus==="dragging"&&(d.node.nodeType==="Stage"||d.node.getLayer()===s)&&(i=!0)});const o=!n&&!De.hitOnDragEnabled&&(i||De.isTransforming());return this.isListening()&&this.isVisible()&&!o}show(){return this.visible(!0),this}hide(){return this.visible(!1),this}getZIndex(){return this.index||0}getAbsoluteZIndex(){let e=this.getDepth(),n=this,s=0,i,o,d,f;function p(b){for(i=[],o=b.length,d=0;d<o;d++)f=b[d],s++,f.nodeType!==_5&&(i=i.concat(f.getChildren().slice())),f._id===n._id&&(d=o);i.length>0&&i[0].getDepth()<=e&&p(i)}const y=this.getStage();return n.nodeType!==tz&&y&&p(y.getChildren()),s}getDepth(){let e=0,n=this.parent;for(;n;)e++,n=n.parent;return e}_batchTransformChanges(e){this._batchingTransformChange=!0,e(),this._batchingTransformChange=!1,this._needClearTransformCache&&(this._clearCache(gc),this._clearSelfAndDescendantCache(ao)),this._needClearTransformCache=!1}setPosition(e){return this._batchTransformChanges(()=>{this.x(e.x),this.y(e.y)}),this}getPosition(){return{x:this.x(),y:this.y()}}getRelativePointerPosition(){const e=this.getStage();if(!e)return null;const n=e.getPointerPosition();if(!n)return null;const s=this.getAbsoluteTransform().copy();return s.invert(),s.point(n)}getAbsolutePosition(e){let n=!1,s=this.parent;for(;s;){if(s.isCached()){n=!0;break}s=s.parent}n&&!e&&(e=!0);const i=this.getAbsoluteTransform(e).getMatrix(),o=new jr,d=this.offset();return o.m=i.slice(),o.translate(d.x,d.y),o.getTranslation()}setAbsolutePosition(e){const{x:n,y:s,...i}=this._clearTransform();this.attrs.x=n,this.attrs.y=s,this._clearCache(gc);const o=this._getAbsoluteTransform().copy();return o.invert(),o.translate(e.x,e.y),e={x:this.attrs.x+o.getTranslation().x,y:this.attrs.y+o.getTranslation().y},this._setTransform(i),this.setPosition({x:e.x,y:e.y}),this._clearCache(gc),this._clearSelfAndDescendantCache(ao),this}_setTransform(e){let n;for(n in e)this.attrs[n]=e[n]}_clearTransform(){const e={x:this.x(),y:this.y(),rotation:this.rotation(),scaleX:this.scaleX(),scaleY:this.scaleY(),offsetX:this.offsetX(),offsetY:this.offsetY(),skewX:this.skewX(),skewY:this.skewY()};return this.attrs.x=0,this.attrs.y=0,this.attrs.rotation=0,this.attrs.scaleX=1,this.attrs.scaleY=1,this.attrs.offsetX=0,this.attrs.offsetY=0,this.attrs.skewX=0,this.attrs.skewY=0,e}move(e){let n=e.x,s=e.y,i=this.x(),o=this.y();return n!==void 0&&(i+=n),s!==void 0&&(o+=s),this.setPosition({x:i,y:o}),this}_eachAncestorReverse(e,n){let s=[],i=this.getParent(),o,d;if(!(n&&n._id===this._id)){for(s.unshift(this);i&&(!n||i._id!==n._id);)s.unshift(i),i=i.parent;for(o=s.length,d=0;d<o;d++)e(s[d])}}rotate(e){return this.rotation(this.rotation()+e),this}moveToTop(){if(!this.parent)return ee.warn("Node has no parent. moveToTop function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.push(this),this.parent._setChildrenIndices(),!0):!1}moveUp(){if(!this.parent)return ee.warn("Node has no parent. moveUp function is ignored."),!1;const e=this.index,n=this.parent.getChildren().length;return e<n-1?(this.parent.children.splice(e,1),this.parent.children.splice(e+1,0,this),this.parent._setChildrenIndices(),!0):!1}moveDown(){if(!this.parent)return ee.warn("Node has no parent. moveDown function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.splice(e-1,0,this),this.parent._setChildrenIndices(),!0):!1}moveToBottom(){if(!this.parent)return ee.warn("Node has no parent. moveToBottom function is ignored."),!1;const e=this.index;return e>0?(this.parent.children.splice(e,1),this.parent.children.unshift(this),this.parent._setChildrenIndices(),!0):!1}setZIndex(e){if(!this.parent)return ee.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&ee.warn("Unexpected value "+e+" for zIndex property. zIndex is just index of a node in children of its parent. Expected value is from 0 to "+(this.parent.children.length-1)+".");const n=this.index;return this.parent.children.splice(n,1),this.parent.children.splice(e,0,this),this.parent._setChildrenIndices(),this}getAbsoluteOpacity(){return this._getCache(y1,this._getAbsoluteOpacity)}_getAbsoluteOpacity(){let e=this.opacity();const n=this.getParent();return n&&!n._isUnderCache&&(e*=n.getAbsoluteOpacity()),e}moveTo(e){return this.getParent()!==e&&(this._remove(),e.add(this)),this}toObject(){let e=this.getAttrs(),n,s,i,o,d;const f={attrs:{},className:this.getClassName()};for(n in e)s=e[n],d=ee.isObject(s)&&!ee._isPlainObject(s)&&!ee._isArray(s),!d&&(i=typeof this[n]=="function"&&this[n],delete e[n],o=i?i.call(this):null,e[n]=s,o!==s&&(f.attrs[n]=s));return ee._prepareToStringify(f)}toJSON(){return JSON.stringify(this.toObject())}getParent(){return this.parent}findAncestors(e,n,s){const i=[];n&&this._isMatch(e)&&i.push(this);let o=this.parent;for(;o;){if(o===s)return i;o._isMatch(e)&&i.push(o),o=o.parent}return i}isAncestorOf(e){return!1}findAncestor(e,n,s){return this.findAncestors(e,n,s)[0]}_isMatch(e){if(!e)return!1;if(typeof e=="function")return e(this);let n=e.replace(/ /g,"").split(","),s=n.length,i,o;for(i=0;i<s;i++)if(o=n[i],ee.isValidSelector(o)||(ee.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),ee.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),ee.warn("Konva is awesome, right?")),o.charAt(0)==="#"){if(this.id()===o.slice(1))return!0}else if(o.charAt(0)==="."){if(this.hasName(o.slice(1)))return!0}else if(this.className===o||this.nodeType===o)return!0;return!1}getLayer(){const e=this.getParent();return e?e.getLayer():null}getStage(){return this._getCache(j5,this._getStage)}_getStage(){const e=this.getParent();return e?e.getStage():null}fire(e,n={},s){return n.target=n.target||this,s?this._fireAndBubble(e,n):this._fire(e,n),this}getAbsoluteTransform(e){return e?this._getAbsoluteTransform(e):this._getCache(ao,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new jr,this._eachAncestorReverse(function(s){const i=s.transformsEnabled();i==="all"?n.multiply(s.getTransform()):i==="position"&&n.translate(s.x()-s.offsetX(),s.y()-s.offsetY())},e),n;{n=this._cache.get(ao)||new jr,this.parent?this.parent.getAbsoluteTransform().copyInto(n):n.reset();const s=this.transformsEnabled();if(s==="all")n.multiply(this.getTransform());else if(s==="position"){const i=this.attrs.x||0,o=this.attrs.y||0,d=this.attrs.offsetX||0,f=this.attrs.offsetY||0;n.translate(i-d,o-f)}return n.dirty=!1,n}}getAbsoluteScale(e){let n=this;for(;n;)n._isUnderCache&&(e=n),n=n.getParent();const i=this.getAbsoluteTransform(e).decompose();return{x:i.scaleX,y:i.scaleY}}getAbsoluteRotation(){return this.getAbsoluteTransform().decompose().rotation}getTransform(){return this._getCache(gc,this._getTransform)}_getTransform(){var e,n;const s=this._cache.get(gc)||new jr;s.reset();const i=this.x(),o=this.y(),d=De.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,p=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,y=this.attrs.skewX||0,b=this.attrs.skewY||0,v=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||o!==0)&&s.translate(i,o),d!==0&&s.rotate(d),(y!==0||b!==0)&&s.skew(y,b),(f!==1||p!==1)&&s.scale(f,p),(v!==0||_!==0)&&s.translate(-1*v,-1*_),s.dirty=!1,s}clone(e){let n=ee.cloneObject(this.attrs),s,i,o,d,f;for(s in e)n[s]=e[s];const p=new this.constructor(n);for(s in this.eventListeners)for(i=this.eventListeners[s],o=i.length,d=0;d<o;d++)f=i[d],f.name.indexOf(FD)<0&&(p.eventListeners[s]||(p.eventListeners[s]=[]),p.eventListeners[s].push(f));return p}_toKonvaCanvas(e){e=e||{};const n=this.getClientRect(),s=this.getStage(),i=e.x!==void 0?e.x:Math.floor(n.x),o=e.y!==void 0?e.y:Math.floor(n.y),d=e.pixelRatio||1,f=new xc({width:e.width||Math.ceil(n.width)||(s?s.width():0),height:e.height||Math.ceil(n.height)||(s?s.height():0),pixelRatio:d}),p=f.getContext(),y=new xc({width:f.width/f.pixelRatio+Math.abs(i),height:f.height/f.pixelRatio+Math.abs(o),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(p._context.imageSmoothingEnabled=!1),p.save(),(i||o)&&p.translate(-1*i,-1*o),this.drawScene(f,void 0,y),p.restore(),f}toCanvas(e){return this._toKonvaCanvas(e)._canvas}toDataURL(e){e=e||{};const n=e.mimeType||null,s=e.quality||null,i=this._toKonvaCanvas(e).toDataURL(n,s);return e.callback&&e.callback(i),i}toImage(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,ee._urlToImage(this.toDataURL(e),function(o){n(o),i==null||i(o)})}catch(i){s(i)}})}toBlob(e){return new Promise((n,s)=>{try{const i=e==null?void 0:e.callback;i&&delete e.callback,this.toCanvas(e).toBlob(o=>{n(o),i==null||i(o)},e==null?void 0:e.mimeType,e==null?void 0:e.quality)}catch(i){s(i)}})}setSize(e){return this.width(e.width),this.height(e.height),this}getSize(){return{width:this.width(),height:this.height()}}getClassName(){return this.className||this.nodeType}getType(){return this.nodeType}getDragDistance(){return this.attrs.dragDistance!==void 0?this.attrs.dragDistance:this.parent?this.parent.getDragDistance():De.dragDistance}_off(e,n,s){let i=this.eventListeners[e],o,d,f;for(o=0;o<i.length;o++)if(d=i[o].name,f=i[o].handler,(d!=="konva"||n==="konva")&&(!n||d===n)&&(!s||s===f)){if(i.splice(o,1),i.length===0){delete this.eventListeners[e];break}o--}}_fireChangeEvent(e,n,s){this._fire(e+KD,{oldVal:n,newVal:s})}addName(e){if(!this.hasName(e)){const n=this.name(),s=n?n+" "+e:e;this.name(s)}return this}hasName(e){if(!e)return!1;const n=this.name();return n?(n||"").split(/\s/g).indexOf(e)!==-1:!1}removeName(e){const n=(this.name()||"").split(/\s/g),s=n.indexOf(e);return s!==-1&&(n.splice(s,1),this.name(n.join(" "))),this}setAttr(e,n){const s=this[N5+ee._capitalize(e)];return ee._isFunction(s)?s.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(De.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const s=this.attrs[e];s===n&&!ee.isObject(n)||(n==null?delete this.attrs[e]:this.attrs[e]=n,this._shouldFireChangeEvents&&this._fireChangeEvent(e,s,n),this._requestDraw())}_setComponentAttr(e,n,s){let i;s!==void 0&&(i=this.attrs[e],i||(this.attrs[e]=this.getAttr(e)),this.attrs[e][n]=s,this._fireChangeEvent(e,i,s))}_fireAndBubble(e,n,s){n&&this.nodeType===_5&&(n.target=this);const i=[ZD,ID,JD,WD,$D,ez];if(!(i.indexOf(e)!==-1&&(s&&(this===s||this.isAncestorOf&&this.isAncestorOf(s))||this.nodeType==="Stage"&&!s))){this._fire(e,n);const d=i.indexOf(e)!==-1&&s&&s.isAncestorOf&&s.isAncestorOf(this)&&!s.isAncestorOf(this.parent);(n&&!n.cancelBubble||!n)&&this.parent&&this.parent.isListening()&&!d&&(s&&s.parent?this._fireAndBubble.call(this.parent,e,n,s):this._fireAndBubble.call(this.parent,e,n))}}_getProtoListeners(e){var n,s;const{nodeType:i}=this,o=Ae.protoListenerMap.get(i)||{};let d=o==null?void 0:o[e];if(d===void 0){d=[];let f=Object.getPrototypeOf(this);for(;f;){const p=(s=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:[];d.push(...p),f=Object.getPrototypeOf(f)}o[e]=d,Ae.protoListenerMap.set(i,o)}return d}_fire(e,n){n=n||{},n.currentTarget=this,n.type=e;const s=this._getProtoListeners(e);if(s)for(let o=0;o<s.length;o++)s[o].handler.call(this,n);const i=this.eventListeners[e];if(i)for(let o=0;o<i.length;o++)i[o].handler.call(this,n)}draw(){return this.drawScene(),this.drawHit(),this}_createDragElement(e){const n=e?e.pointerId:void 0,s=this.getStage(),i=this.getAbsolutePosition();if(!s)return;const o=s._getPointerById(n)||s._changedPointerPositions[0]||i;Yt._dragElements.set(this._id,{node:this,startPointerPos:o,offset:{x:o.x-i.x,y:o.y-i.y},dragStatus:"ready",pointerId:n,startEvent:e})}startDrag(e,n=!0){Yt._dragElements.has(this._id)||this._createDragElement(e);const s=Yt._dragElements.get(this._id);s.dragStatus="dragging",this.fire("dragstart",{type:"dragstart",target:this,evt:s.startEvent&&s.startEvent.evt||e&&e.evt},n)}_setDragPosition(e,n){const s=this.getStage()._getPointerById(n.pointerId);if(!s)return;let i={x:s.x-n.offset.x,y:s.y-n.offset.y};const o=this.dragBoundFunc();if(o!==void 0){const d=o.call(this,i,e);d?i=d:ee.warn("dragBoundFunc did not return any value. That is unexpected behavior. You must return new absolute position from dragBoundFunc.")}(!this._lastPos||this._lastPos.x!==i.x||this._lastPos.y!==i.y)&&(this.setAbsolutePosition(i),this._requestDraw()),this._lastPos=i}stopDrag(e){const n=Yt._dragElements.get(this._id);n&&(n.dragStatus="stopped"),Yt._endDragBefore(e),Yt._endDragAfter(e)}setDraggable(e){this._setAttr("draggable",e),this._dragChange()}isDragging(){const e=Yt._dragElements.get(this._id);return e?e.dragStatus==="dragging":!1}_listenDrag(){this._dragCleanup(),this.on("mousedown.konva touchstart.konva",function(e){if(!(!(e.evt.button!==void 0)||De.dragButtons.indexOf(e.evt.button)>=0)||this.isDragging())return;let i=!1;Yt._dragElements.forEach(o=>{this.isAncestorOf(o.node)&&(i=!0)}),i||this._createDragElement(e)})}_dragChange(){if(this.attrs.draggable)this._listenDrag();else{if(this._dragCleanup(),!this.getStage())return;const n=Yt._dragElements.get(this._id),s=n&&n.dragStatus==="dragging",i=n&&n.dragStatus==="ready";s?this.stopDrag():i&&Yt._dragElements.delete(this._id)}}_dragCleanup(){this.off("mousedown.konva"),this.off("touchstart.konva")}isClientRectOnScreen(e={x:0,y:0}){const n=this.getStage();if(!n)return!1;const s={x:-e.x,y:-e.y,width:n.width()+2*e.x,height:n.height()+2*e.y};return ee.haveIntersection(s,this.getClientRect())}static create(e,n){return ee._isString(e)&&(e=JSON.parse(e)),this._createNode(e,n)}static _createNode(e,n){let s=Ae.prototype.getClassName.call(e),i=e.children,o,d,f;n&&(e.attrs.container=n),De[s]||(ee.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const p=De[s];if(o=new p(e.attrs),i)for(d=i.length,f=0;f<d;f++)o.add(Ae._createNode(i[f]));return o}}Ae.protoListenerMap=new Map;Ae.prototype.nodeType="Node";Ae.prototype._attrsAffectingSize=[];Ae.prototype.eventListeners={};Ae.prototype.on(nz,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(gc),this._clearSelfAndDescendantCache(ao)});Ae.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(Tb)});Ae.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(Eb)});Ae.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(y1)});const gn=K.addGetterSetter;gn(Ae,"zIndex");gn(Ae,"absolutePosition");gn(Ae,"position");gn(Ae,"x",0,Re());gn(Ae,"y",0,Re());gn(Ae,"globalCompositeOperation","source-over",rd());gn(Ae,"opacity",1,Re());gn(Ae,"name","",rd());gn(Ae,"id","",rd());gn(Ae,"rotation",0,Re());K.addComponentsGetterSetter(Ae,"scale",["x","y"]);gn(Ae,"scaleX",1,Re());gn(Ae,"scaleY",1,Re());K.addComponentsGetterSetter(Ae,"skew",["x","y"]);gn(Ae,"skewX",0,Re());gn(Ae,"skewY",0,Re());K.addComponentsGetterSetter(Ae,"offset",["x","y"]);gn(Ae,"offsetX",0,Re());gn(Ae,"offsetY",0,Re());gn(Ae,"dragDistance",void 0,Re());gn(Ae,"width",0,Re());gn(Ae,"height",0,Re());gn(Ae,"listening",!0,Oi());gn(Ae,"preventDefault",!0,Oi());gn(Ae,"filters",void 0,function(t){return this._filterUpToDate=!1,t});gn(Ae,"visible",!0,Oi());gn(Ae,"transformsEnabled","all",rd());gn(Ae,"size");gn(Ae,"dragBoundFunc");gn(Ae,"draggable",!1,Oi());K.backCompat(Ae,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Cr extends Ae{constructor(){super(...arguments),this.children=[]}getChildren(e){const n=this.children||[];return e?n.filter(e):n}hasChildren(){return this.getChildren().length>0}removeChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.remove()}),this.children=[],this._requestDraw(),this}destroyChildren(){return this.getChildren().forEach(e=>{e.parent=null,e.index=0,e.destroy()}),this.children=[],this._requestDraw(),this}add(...e){if(e.length===0)return this;if(e.length>1){for(let s=0;s<e.length;s++)this.add(e[s]);return this}const n=e[0];return n.getParent()?(n.moveTo(this),this):(this._validateAdd(n),n.index=this.getChildren().length,n.parent=this,n._clearCaches(),this.getChildren().push(n),this._fire("add",{child:n}),this._requestDraw(),this)}destroy(){return this.hasChildren()&&this.destroyChildren(),super.destroy(),this}find(e){return this._generalFind(e,!1)}findOne(e){const n=this._generalFind(e,!0);return n.length>0?n[0]:void 0}_generalFind(e,n){const s=[];return this._descendants(i=>{const o=i._isMatch(e);return o&&s.push(i),!!(o&&n)}),s}_descendants(e){let n=!1;const s=this.getChildren();for(const i of s){if(n=e(i),n)return!0;if(i.hasChildren()&&(n=i._descendants(e),n))return!0}return!1}toObject(){const e=Ae.prototype.toObject.call(this);return e.children=[],this.getChildren().forEach(n=>{e.children.push(n.toObject())}),e}isAncestorOf(e){let n=e.getParent();for(;n;){if(n._id===this._id)return!0;n=n.getParent()}return!1}clone(e){const n=Ae.prototype.clone.call(this,e);return this.getChildren().forEach(function(s){n.add(s.clone())}),n}getAllIntersections(e){const n=[];return this.find("Shape").forEach(s=>{s.isVisible()&&s.intersects(e)&&n.push(s)}),n}_clearSelfAndDescendantCache(e){var n;super._clearSelfAndDescendantCache(e),!this.isCached()&&((n=this.children)===null||n===void 0||n.forEach(function(s){s._clearSelfAndDescendantCache(e)}))}_setChildrenIndices(){var e;(e=this.children)===null||e===void 0||e.forEach(function(n,s){n.index=s}),this._requestDraw()}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas(),d=o&&o.getContext(),f=this._getCanvasCache(),p=f&&f.scene,y=o&&o.isCache;if(!this.isVisible()&&!y)return this;if(p){d.save();const b=this.getAbsoluteTransform(n).getMatrix();d.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedSceneCanvas(d),d.restore()}else this._drawChildren("drawScene",o,n,s);return this}drawHit(e,n){if(!this.shouldDrawHit(n))return this;const s=this.getLayer(),i=e||s&&s.hitCanvas,o=i&&i.getContext(),d=this._getCanvasCache();if(d&&d.hit){o.save();const p=this.getAbsoluteTransform(n).getMatrix();o.transform(p[0],p[1],p[2],p[3],p[4],p[5]),this._drawCachedHitCanvas(o),o.restore()}else this._drawChildren("drawHit",i,n);return this}_drawChildren(e,n,s,i){var o;const d=n&&n.getContext(),f=this.clipWidth(),p=this.clipHeight(),y=this.clipFunc(),b=typeof f=="number"&&typeof p=="number"||y,v=s===this;if(b){d.save();const C=this.getAbsoluteTransform(s);let w=C.getMatrix();d.transform(w[0],w[1],w[2],w[3],w[4],w[5]),d.beginPath();let T;if(y)T=y.call(this,d,this);else{const R=this.clipX(),O=this.clipY();d.rect(R||0,O||0,f,p)}d.clip.apply(d,T),w=C.copy().invert().getMatrix(),d.transform(w[0],w[1],w[2],w[3],w[4],w[5])}const _=!v&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";_&&(d.save(),d._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(C){C[e](n,s,i)}),_&&d.restore(),b&&d.restore()}getClientRect(e={}){var n;const s=e.skipTransform,i=e.relativeTo;let o,d,f,p,y={x:1/0,y:1/0,width:0,height:0};const b=this;(n=this.children)===null||n===void 0||n.forEach(function(C){if(!C.visible())return;const w=C.getClientRect({relativeTo:b,skipShadow:e.skipShadow,skipStroke:e.skipStroke});w.width===0&&w.height===0||(o===void 0?(o=w.x,d=w.y,f=w.x+w.width,p=w.y+w.height):(o=Math.min(o,w.x),d=Math.min(d,w.y),f=Math.max(f,w.x+w.width),p=Math.max(p,w.y+w.height)))});const v=this.find("Shape");let _=!1;for(let C=0;C<v.length;C++)if(v[C]._isVisible(this)){_=!0;break}return _&&o!==void 0?y={x:o,y:d,width:f-o,height:p-d}:y={x:0,y:0,width:0,height:0},s?y:this._transformedRect(y,i)}}K.addComponentsGetterSetter(Cr,"clip",["x","y","width","height"]);K.addGetterSetter(Cr,"clipX",void 0,Re());K.addGetterSetter(Cr,"clipY",void 0,Re());K.addGetterSetter(Cr,"clipWidth",void 0,Re());K.addGetterSetter(Cr,"clipHeight",void 0,Re());K.addGetterSetter(Cr,"clipFunc");const zm=new Map,S8=De._global.PointerEvent!==void 0;function _x(t){return zm.get(t)}function Ov(t){return{evt:t,pointerId:t.pointerId}}function N8(t,e){return zm.get(t)===e}function _8(t,e){xm(t),e.getStage()&&(zm.set(t,e),S8&&e._fire("gotpointercapture",Ov(new PointerEvent("gotpointercapture"))))}function xm(t,e){const n=zm.get(t);if(!n)return;const s=n.getStage();s&&s.content,zm.delete(t),S8&&n._fire("lostpointercapture",Ov(new PointerEvent("lostpointercapture")))}const sz="Stage",rz="string",C5="px",iz="mouseout",j8="mouseleave",C8="mouseover",w8="mouseenter",E8="mousemove",T8="mousedown",R8="mouseup",om="pointermove",cm="pointerdown",Df="pointerup",um="pointercancel",lz="lostpointercapture",a1="pointerout",dm="pointerleave",s1="pointerover",r1="pointerenter",Rb="contextmenu",O8="touchstart",M8="touchend",A8="touchmove",D8="touchcancel",Ob="wheel",oz=5,cz=[[w8,"_pointerenter"],[T8,"_pointerdown"],[E8,"_pointermove"],[R8,"_pointerup"],[j8,"_pointerleave"],[O8,"_pointerdown"],[A8,"_pointermove"],[M8,"_pointerup"],[D8,"_pointercancel"],[C8,"_pointerover"],[Ob,"_wheel"],[Rb,"_contextmenu"],[cm,"_pointerdown"],[om,"_pointermove"],[Df,"_pointerup"],[um,"_pointercancel"],[dm,"_pointerleave"],[lz,"_lostpointercapture"]],jx={mouse:{[a1]:iz,[dm]:j8,[s1]:C8,[r1]:w8,[om]:E8,[cm]:T8,[Df]:R8,[um]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[a1]:"touchout",[dm]:"touchleave",[s1]:"touchover",[r1]:"touchenter",[om]:A8,[cm]:O8,[Df]:M8,[um]:D8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[a1]:a1,[dm]:dm,[s1]:s1,[r1]:r1,[om]:om,[cm]:cm,[Df]:Df,[um]:um,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},fm=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Ef=t=>{const e=fm(t);if(e==="pointer")return De.pointerEventsEnabled&&jx.pointer;if(e==="touch")return jx.touch;if(e==="mouse")return jx.mouse};function w5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&ee.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const uz="Pointer position is missing and not registered by the stage. Looks like it is outside of the stage container. You can set it manually from event: stage.setPointersPositions(event);",bm=[];let iy=class extends Cr{constructor(e){super(w5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),bm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{w5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",s=e.getType()==="FastLayer";n||s||ee.throw("You may only add layers to the stage.")}_checkVisibility(){if(!this.content)return;const e=this.visible()?"":"none";this.content.style.display=e}setContainer(e){if(typeof e===rz){let n;if(e.charAt(0)==="."){const s=e.slice(1);e=document.getElementsByClassName(s)[0]}else e.charAt(0)!=="#"?n=e:n=e.slice(1),e=document.getElementById(n);if(!e)throw"Can not find container in document with id "+n}return this._setAttr("container",e),this.content&&(this.content.parentElement&&this.content.parentElement.removeChild(this.content),e.appendChild(this.content)),this}shouldDrawHit(){return!0}clear(){const e=this.children,n=e.length;for(let s=0;s<n;s++)e[s].clear();return this}clone(e){return e||(e={}),e.container=typeof document<"u"&&document.createElement("div"),Cr.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&ee._isInDocument(e)&&this.container().removeChild(e);const n=bm.indexOf(this);return n>-1&&bm.splice(n,1),ee.releaseCanvas(this.bufferCanvas._canvas,this.bufferHitCanvas._canvas),this}getPointerPosition(){const e=this._pointerPositions[0]||this._changedPointerPositions[0];return e?{x:e.x,y:e.y}:(ee.warn(uz),null)}_getPointerById(e){return this._pointerPositions.find(n=>n.id===e)}getPointersPositions(){return this._pointerPositions}getStage(){return this}getContent(){return this.content}_toKonvaCanvas(e){e={...e},e.x=e.x||0,e.y=e.y||0,e.width=e.width||this.width(),e.height=e.height||this.height();const n=new xc({width:e.width,height:e.height,pixelRatio:e.pixelRatio||1}),s=n.getContext()._context,i=this.children;return(e.x||e.y)&&s.translate(-1*e.x,-1*e.y),i.forEach(function(o){if(!o.isVisible())return;const d=o._toKonvaCanvas(e);s.drawImage(d._canvas,e.x,e.y,d.getWidth()/d.getPixelRatio(),d.getHeight()/d.getPixelRatio())}),n}getIntersection(e){if(!e)return null;const n=this.children,s=n.length,i=s-1;for(let o=i;o>=0;o--){const d=n[o].getIntersection(e);if(d)return d}return null}_resizeDOM(){const e=this.width(),n=this.height();this.content&&(this.content.style.width=e+C5,this.content.style.height=n+C5),this.bufferCanvas.setSize(e,n),this.bufferHitCanvas.setSize(e,n),this.children.forEach(s=>{s.setSize({width:e,height:n}),s.draw()})}add(e,...n){if(arguments.length>1){for(let i=0;i<arguments.length;i++)this.add(arguments[i]);return this}super.add(e);const s=this.children.length;return s>oz&&ee.warn("The stage has "+s+" layers. Recommended maximum number of layers is 3-5. Adding more layers into the stage may drop the performance. Rethink your tree structure, you can use Konva.Group."),e.setSize({width:this.width(),height:this.height()}),e.draw(),De.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return N8(e,this)}setPointerCapture(e){_8(e,this)}releaseCapture(e){xm(e)}getLayers(){return this.children}_bindContentEvents(){De.isBrowser&&cz.forEach(([e,n])=>{this.content.addEventListener(e,s=>{this[n](s)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Ef(e.type);n&&this._fire(n.pointerover,{evt:e,target:this,currentTarget:this})}_getTargetShape(e){let n=this[e+"targetShape"];return n&&!n.getStage()&&(n=null),n}_pointerleave(e){const n=Ef(e.type),s=fm(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(s),o=!(De.isDragging()||De.isTransforming())||De.hitOnDragEnabled;i&&o?(i._fireAndBubble(n.pointerout,{evt:e}),i._fireAndBubble(n.pointerleave,{evt:e}),this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this[s+"targetShape"]=null):o&&(this._fire(n.pointerleave,{evt:e,target:this,currentTarget:this}),this._fire(n.pointerout,{evt:e,target:this,currentTarget:this})),this.pointerPos=null,this._pointerPositions=[]}_pointerdown(e){const n=Ef(e.type),s=fm(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(o=>{const d=this.getIntersection(o);if(Yt.justDragged=!1,De["_"+s+"ListenClick"]=!0,!d||!d.isListening()){this[s+"ClickStartShape"]=void 0;return}De.capturePointerEventsEnabled&&d.setPointerCapture(o.id),this[s+"ClickStartShape"]=d,d._fireAndBubble(n.pointerdown,{evt:e,pointerId:o.id}),i=!0;const f=e.type.indexOf("touch")>=0;d.preventDefault()&&e.cancelable&&f&&e.preventDefault()}),i||this._fire(n.pointerdown,{evt:e,target:this,currentTarget:this,pointerId:this._pointerPositions[0].id})}_pointermove(e){const n=Ef(e.type),s=fm(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(De.isDragging()&&Yt.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(De.isDragging()||De.isTransforming())||De.hitOnDragEnabled))return;const d={};let f=!1;const p=this._getTargetShape(s);this._changedPointerPositions.forEach(y=>{const b=_x(y.id)||this.getIntersection(y),v=y.id,_={evt:e,pointerId:v},C=p!==b;if(C&&p&&(p._fireAndBubble(n.pointerout,{..._},b),p._fireAndBubble(n.pointerleave,{..._},b)),b){if(d[b._id])return;d[b._id]=!0}b&&b.isListening()?(f=!0,C&&(b._fireAndBubble(n.pointerover,{..._},p),b._fireAndBubble(n.pointerenter,{..._},p),this[s+"targetShape"]=b),b._fireAndBubble(n.pointermove,{..._})):p&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:v}),this[s+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Ef(e.type),s=fm(e.type);if(!n)return;this.setPointersPositions(e);const i=this[s+"ClickStartShape"],o=this[s+"ClickEndShape"],d={};let f=!1;this._changedPointerPositions.forEach(p=>{const y=_x(p.id)||this.getIntersection(p);if(y){if(y.releaseCapture(p.id),d[y._id])return;d[y._id]=!0}const b=p.id,v={evt:e,pointerId:b};let _=!1;De["_"+s+"InDblClickWindow"]?(_=!0,clearTimeout(this[s+"DblTimeout"])):Yt.justDragged||(De["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){De["_"+s+"InDblClickWindow"]=!1},De.dblClickWindow),y&&y.isListening()?(f=!0,this[s+"ClickEndShape"]=y,y._fireAndBubble(n.pointerup,{...v}),De["_"+s+"ListenClick"]&&i&&i===y&&(y._fireAndBubble(n.pointerclick,{...v}),_&&o&&o===y&&y._fireAndBubble(n.pointerdblclick,{...v}))):(this[s+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),De["_"+s+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:b}),_&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:b}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),De["_"+s+"ListenClick"]=!1,e.cancelable&&s!=="touch"&&s!=="pointer"&&e.preventDefault()}_contextmenu(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Rb,{evt:e}):this._fire(Rb,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Ob,{evt:e}):this._fire(Ob,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=_x(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(Df,Ov(e)),xm(e.pointerId)}_lostpointercapture(e){xm(e.pointerId)}setPointersPositions(e){const n=this._getContentPosition();let s=null,i=null;e=e||window.event,e.touches!==void 0?(this._pointerPositions=[],this._changedPointerPositions=[],Array.prototype.forEach.call(e.touches,o=>{this._pointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})}),Array.prototype.forEach.call(e.changedTouches||e.touches,o=>{this._changedPointerPositions.push({id:o.identifier,x:(o.clientX-n.left)/n.scaleX,y:(o.clientY-n.top)/n.scaleY})})):(s=(e.clientX-n.left)/n.scaleX,i=(e.clientY-n.top)/n.scaleY,this.pointerPos={x:s,y:i},this._pointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}],this._changedPointerPositions=[{x:s,y:i,id:ee._getFirstPointerId(e)}])}_setPointerPosition(e){ee.warn('Method _setPointerPosition is deprecated. Use "stage.setPointersPositions(event)" instead.'),this.setPointersPositions(e)}_getContentPosition(){if(!this.content||!this.content.getBoundingClientRect)return{top:0,left:0,scaleX:1,scaleY:1};const e=this.content.getBoundingClientRect();return{top:e.top,left:e.left,scaleX:e.width/this.content.clientWidth||1,scaleY:e.height/this.content.clientHeight||1}}_buildDOM(){if(this.bufferCanvas=new xc({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Tv({pixelRatio:1,width:this.width(),height:this.height()}),!De.isBrowser)return;const e=this.container();if(!e)throw"Stage has no container. A container is required.";e.innerHTML="",this.content=document.createElement("div"),this.content.style.position="relative",this.content.style.userSelect="none",this.content.className="konvajs-content",this.content.setAttribute("role","presentation"),e.appendChild(this.content),this._resizeDOM()}cache(){return ee.warn("Cache function is not allowed for stage. You may use cache only for layers, groups and shapes."),this}clearCache(){return this}batchDraw(){return this.getChildren().forEach(function(e){e.batchDraw()}),this}};iy.prototype.nodeType=sz;ea(iy);K.addGetterSetter(iy,"container");De.isBrowser&&document.addEventListener("visibilitychange",()=>{bm.forEach(t=>{t.batchDraw()})});const z8="hasShadow",k8="shadowRGBA",L8="patternImage",U8="linearGradient",q8="radialGradient";let i1;function Cx(){return i1||(i1=ee.createCanvasElement().getContext("2d"),i1)}const vm={};function dz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function fz(t){t.stroke()}function hz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function pz(t){t.stroke()}function mz(){this._clearCache(z8)}function gz(){this._clearCache(k8)}function yz(){this._clearCache(L8)}function xz(){this._clearCache(U8)}function bz(){this._clearCache(q8)}class Ee extends Ae{constructor(e){super(e);let n,s=0;for(;n=ee.getHitColor(),!(n&&!(n in vm));)if(s++,s>=1e4){ee.warn("Failed to find a unique color key for a shape. Konva may work incorrectly. Most likely your browser is using canvas farbling. Consider disabling it."),n=ee.getRandomColor();break}this.colorKey=n,vm[n]=this}getContext(){return ee.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return ee.warn("shape.getCanvas() method is deprecated. Please do not use it."),this.getLayer().getCanvas()}getSceneFunc(){return this.attrs.sceneFunc||this._sceneFunc}getHitFunc(){return this.attrs.hitFunc||this._hitFunc}hasShadow(){return this._getCache(z8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(L8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Cx().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new jr;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(De.getAngle(this.fillPatternRotation())),s.scale(this.fillPatternScaleX(),this.fillPatternScaleY()),s.translate(-1*this.fillPatternOffsetX(),-1*this.fillPatternOffsetY());const i=s.getMatrix(),o=typeof DOMMatrix>"u"?{a:i[0],b:i[1],c:i[2],d:i[3],e:i[4],f:i[5]}:new DOMMatrix(i);n.setTransform(o)}return n}}_getLinearGradient(){return this._getCache(U8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Cx(),s=this.fillLinearGradientStartPoint(),i=this.fillLinearGradientEndPoint(),o=n.createLinearGradient(s.x,s.y,i.x,i.y);for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}_getRadialGradient(){return this._getCache(q8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Cx(),s=this.fillRadialGradientStartPoint(),i=this.fillRadialGradientEndPoint(),o=n.createRadialGradient(s.x,s.y,this.fillRadialGradientStartRadius(),i.x,i.y,this.fillRadialGradientEndRadius());for(let d=0;d<e.length;d+=2)o.addColorStop(e[d],e[d+1]);return o}}getShadowRGBA(){return this._getCache(k8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=ee.colorToRGBA(this.shadowColor());if(e)return"rgba("+e.r+","+e.g+","+e.b+","+e.a*(this.shadowOpacity()||1)+")"}hasFill(){return this._calculate("hasFill",["fillEnabled","fill","fillPatternImage","fillLinearGradientColorStops","fillRadialGradientColorStops"],()=>this.fillEnabled()&&!!(this.fill()||this.fillPatternImage()||this.fillLinearGradientColorStops()||this.fillRadialGradientColorStops()))}hasStroke(){return this._calculate("hasStroke",["strokeEnabled","strokeWidth","stroke","strokeLinearGradientColorStops"],()=>this.strokeEnabled()&&this.strokeWidth()&&!!(this.stroke()||this.strokeLinearGradientColorStops()))}hasHitStroke(){const e=this.hitStrokeWidth();return e==="auto"?this.hasStroke():this.strokeEnabled()&&!!e}intersects(e){const n=this.getStage();if(!n)return!1;const s=n.bufferHitCanvas;return s.getContext().clear(),this.drawHit(s,void 0,!0),s.context.getImageData(Math.round(e.x),Math.round(e.y),1,1).data[3]>0}destroy(){return Ae.prototype.destroy.call(this),delete vm[this.colorKey],delete this.colorKey,this}_useBufferCanvas(e){var n;if(!((n=this.attrs.perfectDrawEnabled)!==null&&n!==void 0?n:!0))return!1;const i=e||this.hasFill(),o=this.hasStroke(),d=this.getAbsoluteOpacity()!==1;if(i&&o&&d)return!0;const f=this.hasShadow(),p=this.shadowForStrokeEnabled();return!!(i&&o&&f&&p)}setStrokeHitEnabled(e){ee.warn("strokeHitEnabled property is deprecated. Please use hitStrokeWidth instead."),e?this.hitStrokeWidth("auto"):this.hitStrokeWidth(0)}getStrokeHitEnabled(){return this.hitStrokeWidth()!==0}getSelfRect(){const e=this.size();return{x:this._centroid?-e.width/2:0,y:this._centroid?-e.height/2:0,width:e.width,height:e.height}}getClientRect(e={}){let n=!1,s=this.getParent();for(;s;){if(s.isCached()){n=!0;break}s=s.getParent()}const i=e.skipTransform,o=e.relativeTo||n&&this.getStage()||void 0,d=this.getSelfRect(),p=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,y=d.width+p,b=d.height+p,v=!e.skipShadow&&this.hasShadow(),_=v?this.shadowOffsetX():0,C=v?this.shadowOffsetY():0,w=y+Math.abs(_),T=b+Math.abs(C),R=v&&this.shadowBlur()||0,O=w+R*2,M=T+R*2,z={width:O,height:M,x:-(p/2+R)+Math.min(_,0)+d.x,y:-(p/2+R)+Math.min(C,0)+d.y};return i?z:this._transformedRect(z,o)}drawScene(e,n,s){const i=this.getLayer(),o=e||i.getCanvas(),d=o.getContext(),f=this._getCanvasCache(),p=this.getSceneFunc(),y=this.hasShadow();let b;const v=n===this;if(!this.isVisible()&&!v)return this;if(f){d.save();const _=this.getAbsoluteTransform(n).getMatrix();return d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),this._drawCachedSceneCanvas(d),d.restore(),this}if(!p)return this;if(d.save(),this._useBufferCanvas()){b=this.getStage();const _=s||b.bufferCanvas,C=_.getContext();s?(C.save(),C.setTransform(1,0,0,1,0,0),C.clearRect(0,0,_.width,_.height),C.restore()):C.clear(),C.save(),C._applyLineJoin(this),C._applyMiterLimit(this);const w=this.getAbsoluteTransform(n).getMatrix();C.transform(w[0],w[1],w[2],w[3],w[4],w[5]),p.call(this,C,this),C.restore();const T=_.pixelRatio;y&&d._applyShadow(this),v||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(_._canvas,_.x||0,_.y||0,_.width/T,_.height/T)}else{if(d._applyLineJoin(this),d._applyMiterLimit(this),!v){const _=this.getAbsoluteTransform(n).getMatrix();d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),d._applyOpacity(this),d._applyGlobalCompositeOperation(this)}y&&d._applyShadow(this),p.call(this,d,this)}return d.restore(),this}drawHit(e,n,s=!1){if(!this.shouldDrawHit(n,s))return this;const i=this.getLayer(),o=e||i.hitCanvas,d=o&&o.getContext(),f=this.hitFunc()||this.sceneFunc(),p=this._getCanvasCache(),y=p&&p.hit;if(this.colorKey||ee.warn("Looks like your canvas has a destroyed shape in it. Do not reuse shape after you destroyed it. If you want to reuse shape you should call remove() instead of destroy()"),y){d.save();const v=this.getAbsoluteTransform(n).getMatrix();return d.transform(v[0],v[1],v[2],v[3],v[4],v[5]),this._drawCachedHitCanvas(d),d.restore(),this}if(!f)return this;if(d.save(),d._applyLineJoin(this),d._applyMiterLimit(this),!(this===n)){const v=this.getAbsoluteTransform(n).getMatrix();d.transform(v[0],v[1],v[2],v[3],v[4],v[5])}return f.call(this,d,this),d.restore(),this}drawHitFromCache(e=0){const n=this._getCanvasCache(),s=this._getCachedSceneCanvas(),i=n.hit,o=i.getContext(),d=i.getWidth(),f=i.getHeight();o.clear(),o.drawImage(s._canvas,0,0,d,f);try{const p=o.getImageData(0,0,d,f),y=p.data,b=y.length,v=ee._hexToRgb(this.colorKey);for(let _=0;_<b;_+=4)y[_+3]>e?(y[_]=v.r,y[_+1]=v.g,y[_+2]=v.b,y[_+3]=255):y[_+3]=0;o.putImageData(p,0,0)}catch(p){ee.error("Unable to draw hit graph from cached scene canvas. "+p.message)}return this}hasPointerCapture(e){return N8(e,this)}setPointerCapture(e){_8(e,this)}releaseCapture(e){xm(e)}}Ee.prototype._fillFunc=dz;Ee.prototype._strokeFunc=fz;Ee.prototype._fillFuncHit=hz;Ee.prototype._strokeFuncHit=pz;Ee.prototype._centroid=!1;Ee.prototype.nodeType="Shape";ea(Ee);Ee.prototype.eventListeners={};Ee.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",mz);Ee.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",gz);Ee.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",yz);Ee.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",xz);Ee.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",bz);K.addGetterSetter(Ee,"stroke",void 0,v8());K.addGetterSetter(Ee,"strokeWidth",2,Re());K.addGetterSetter(Ee,"fillAfterStrokeEnabled",!1);K.addGetterSetter(Ee,"hitStrokeWidth","auto",Rv());K.addGetterSetter(Ee,"strokeHitEnabled",!0,Oi());K.addGetterSetter(Ee,"perfectDrawEnabled",!0,Oi());K.addGetterSetter(Ee,"shadowForStrokeEnabled",!0,Oi());K.addGetterSetter(Ee,"lineJoin");K.addGetterSetter(Ee,"lineCap");K.addGetterSetter(Ee,"miterLimit");K.addGetterSetter(Ee,"sceneFunc");K.addGetterSetter(Ee,"hitFunc");K.addGetterSetter(Ee,"dash");K.addGetterSetter(Ee,"dashOffset",0,Re());K.addGetterSetter(Ee,"shadowColor",void 0,rd());K.addGetterSetter(Ee,"shadowBlur",0,Re());K.addGetterSetter(Ee,"shadowOpacity",1,Re());K.addComponentsGetterSetter(Ee,"shadowOffset",["x","y"]);K.addGetterSetter(Ee,"shadowOffsetX",0,Re());K.addGetterSetter(Ee,"shadowOffsetY",0,Re());K.addGetterSetter(Ee,"fillPatternImage");K.addGetterSetter(Ee,"fill",void 0,v8());K.addGetterSetter(Ee,"fillPatternX",0,Re());K.addGetterSetter(Ee,"fillPatternY",0,Re());K.addGetterSetter(Ee,"fillLinearGradientColorStops");K.addGetterSetter(Ee,"strokeLinearGradientColorStops");K.addGetterSetter(Ee,"fillRadialGradientStartRadius",0);K.addGetterSetter(Ee,"fillRadialGradientEndRadius",0);K.addGetterSetter(Ee,"fillRadialGradientColorStops");K.addGetterSetter(Ee,"fillPatternRepeat","repeat");K.addGetterSetter(Ee,"fillEnabled",!0);K.addGetterSetter(Ee,"strokeEnabled",!0);K.addGetterSetter(Ee,"shadowEnabled",!0);K.addGetterSetter(Ee,"dashEnabled",!0);K.addGetterSetter(Ee,"strokeScaleEnabled",!0);K.addGetterSetter(Ee,"fillPriority","color");K.addComponentsGetterSetter(Ee,"fillPatternOffset",["x","y"]);K.addGetterSetter(Ee,"fillPatternOffsetX",0,Re());K.addGetterSetter(Ee,"fillPatternOffsetY",0,Re());K.addComponentsGetterSetter(Ee,"fillPatternScale",["x","y"]);K.addGetterSetter(Ee,"fillPatternScaleX",1,Re());K.addGetterSetter(Ee,"fillPatternScaleY",1,Re());K.addComponentsGetterSetter(Ee,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(Ee,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(Ee,"fillLinearGradientStartPointX",0);K.addGetterSetter(Ee,"strokeLinearGradientStartPointX",0);K.addGetterSetter(Ee,"fillLinearGradientStartPointY",0);K.addGetterSetter(Ee,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(Ee,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(Ee,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(Ee,"fillLinearGradientEndPointX",0);K.addGetterSetter(Ee,"strokeLinearGradientEndPointX",0);K.addGetterSetter(Ee,"fillLinearGradientEndPointY",0);K.addGetterSetter(Ee,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(Ee,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(Ee,"fillRadialGradientStartPointX",0);K.addGetterSetter(Ee,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(Ee,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(Ee,"fillRadialGradientEndPointX",0);K.addGetterSetter(Ee,"fillRadialGradientEndPointY",0);K.addGetterSetter(Ee,"fillPatternRotation",0);K.addGetterSetter(Ee,"fillRule",void 0,rd());K.backCompat(Ee,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const vz="beforeDraw",Sz="draw",H8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Nz=H8.length;let id=class extends Cr{constructor(e){super(e),this.canvas=new xc,this.hitCanvas=new Tv({pixelRatio:1}),this._waitingForDraw=!1,this.on("visibleChange.konva",this._checkVisibility),this._checkVisibility(),this.on("imageSmoothingEnabledChange.konva",this._setSmoothEnabled),this._setSmoothEnabled()}createPNGStream(){return this.canvas._canvas.createPNGStream()}getCanvas(){return this.canvas}getNativeCanvasElement(){return this.canvas._canvas}getHitCanvas(){return this.hitCanvas}getContext(){return this.getCanvas().getContext()}clear(e){return this.getContext().clear(e),this.getHitCanvas().getContext().clear(e),this}setZIndex(e){super.setZIndex(e);const n=this.getStage();return n&&n.content&&(n.content.removeChild(this.getNativeCanvasElement()),e<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[e+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement())),this}moveToTop(){Ae.prototype.moveToTop.call(this);const e=this.getStage();return e&&e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.appendChild(this.getNativeCanvasElement())),!0}moveUp(){if(!Ae.prototype.moveUp.call(this))return!1;const n=this.getStage();return!n||!n.content?!1:(n.content.removeChild(this.getNativeCanvasElement()),this.index<n.children.length-1?n.content.insertBefore(this.getNativeCanvasElement(),n.children[this.index+1].getCanvas()._canvas):n.content.appendChild(this.getNativeCanvasElement()),!0)}moveDown(){if(Ae.prototype.moveDown.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[this.index+1].getCanvas()._canvas))}return!0}return!1}moveToBottom(){if(Ae.prototype.moveToBottom.call(this)){const e=this.getStage();if(e){const n=e.children;e.content&&(e.content.removeChild(this.getNativeCanvasElement()),e.content.insertBefore(this.getNativeCanvasElement(),n[1].getCanvas()._canvas))}return!0}return!1}getLayer(){return this}remove(){const e=this.getNativeCanvasElement();return Ae.prototype.remove.call(this),e&&e.parentNode&&ee._isInDocument(e)&&e.parentNode.removeChild(e),this}getStage(){return this.parent}setSize({width:e,height:n}){return this.canvas.setSize(e,n),this.hitCanvas.setSize(e,n),this._setSmoothEnabled(),this}_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to a layer.")}_toKonvaCanvas(e){return e={...e},e.width=e.width||this.getWidth(),e.height=e.height||this.getHeight(),e.x=e.x!==void 0?e.x:this.x(),e.y=e.y!==void 0?e.y:this.y(),Ae.prototype._toKonvaCanvas.call(this,e)}_checkVisibility(){this.visible()?this.canvas._canvas.style.display="block":this.canvas._canvas.style.display="none"}_setSmoothEnabled(){this.getContext()._context.imageSmoothingEnabled=this.imageSmoothingEnabled()}getWidth(){if(this.parent)return this.parent.width()}setWidth(){ee.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){ee.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,ee.requestAnimFrame(()=>{this.draw(),this._waitingForDraw=!1})),this}getIntersection(e){if(!this.isListening()||!this.isVisible())return null;let n=1,s=!1;for(;;){for(let i=0;i<Nz;i++){const o=H8[i],d=this._getIntersection({x:e.x+o.x*n,y:e.y+o.y*n}),f=d.shape;if(f)return f;if(s=!!d.antialiased,!d.antialiased)break}if(s)n+=1;else return null}}_getIntersection(e){const n=this.hitCanvas.pixelRatio,s=this.hitCanvas.context.getImageData(Math.round(e.x*n),Math.round(e.y*n),1,1).data,i=s[3];if(i===255){const o=ee.getHitColorKey(s[0],s[1],s[2]),d=vm[o];return d?{shape:d}:{antialiased:!0}}else if(i>0)return{antialiased:!0};return{}}drawScene(e,n,s){const i=this.getLayer(),o=e||i&&i.getCanvas();return this._fire(vz,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),Cr.prototype.drawScene.call(this,o,n,s),this._fire(Sz,{node:this}),this}drawHit(e,n){const s=this.getLayer(),i=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Cr.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return ee.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening()}toggleHitCanvas(){if(!this.parent||!this.parent.content)return;const e=this.parent;!!this.hitCanvas._canvas.parentNode?e.content.removeChild(this.hitCanvas._canvas):e.content.appendChild(this.hitCanvas._canvas)}destroy(){return ee.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};id.prototype.nodeType="Layer";ea(id);K.addGetterSetter(id,"imageSmoothingEnabled",!0);K.addGetterSetter(id,"clearBeforeDraw",!0);K.addGetterSetter(id,"hitGraphEnabled",!0,Oi());class Mv extends id{constructor(e){super(e),this.listening(!1),ee.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Mv.prototype.nodeType="FastLayer";ea(Mv);let nh=class extends Cr{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&ee.throw("You may only add groups and shapes to groups.")}};nh.prototype.nodeType="Group";ea(nh);const wx=(function(){return qu.performance&&qu.performance.now?function(){return qu.performance.now()}:function(){return new Date().getTime()}})();class si{constructor(e,n){this.id=si.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:wx(),frameRate:0},this.func=e,this.setLayers(n)}setLayers(e){let n=[];return e&&(n=Array.isArray(e)?e:[e]),this.layers=n,this}getLayers(){return this.layers}addLayer(e){const n=this.layers,s=n.length;for(let i=0;i<s;i++)if(n[i]._id===e._id)return!1;return this.layers.push(e),!0}isRunning(){const n=si.animations,s=n.length;for(let i=0;i<s;i++)if(n[i].id===this.id)return!0;return!1}start(){return this.stop(),this.frame.timeDiff=0,this.frame.lastTime=wx(),si._addAnimation(this),this}stop(){return si._removeAnimation(this),this}_updateFrameObject(e){this.frame.timeDiff=e-this.frame.lastTime,this.frame.lastTime=e,this.frame.time+=this.frame.timeDiff,this.frame.frameRate=1e3/this.frame.timeDiff}static _addAnimation(e){this.animations.push(e),this._handleAnimation()}static _removeAnimation(e){const n=e.id,s=this.animations,i=s.length;for(let o=0;o<i;o++)if(s[o].id===n){this.animations.splice(o,1);break}}static _runFrames(){const e={},n=this.animations;for(let s=0;s<n.length;s++){const i=n[s],o=i.layers,d=i.func;i._updateFrameObject(wx());const f=o.length;let p;if(d?p=d.call(i,i.frame)!==!1:p=!0,!!p)for(let y=0;y<f;y++){const b=o[y];b._id!==void 0&&(e[b._id]=b)}}for(const s in e)e.hasOwnProperty(s)&&e[s].batchDraw()}static _animationLoop(){const e=si;e.animations.length?(e._runFrames(),ee.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,ee.requestAnimFrame(this._animationLoop))}}si.animations=[];si.animIdCounter=0;si.animRunning=!1;const _z={node:1,duration:1,easing:1,onFinish:1,yoyo:1},jz=1,E5=2,T5=3,R5=["fill","stroke","shadowColor"];let Cz=0;class wz{constructor(e,n,s,i,o,d,f){this.prop=e,this.propFunc=n,this.begin=i,this._pos=i,this.duration=d,this._change=0,this.prevPos=0,this.yoyo=f,this._time=0,this._position=0,this._startTime=0,this._finish=0,this.func=s,this._change=o-this.begin,this.pause()}fire(e){const n=this[e];n&&n()}setTime(e){e>this.duration?this.yoyo?(this._time=this.duration,this.reverse()):this.finish():e<0?this.yoyo?(this._time=0,this.play()):this.reset():(this._time=e,this.update())}getTime(){return this._time}setPosition(e){this.prevPos=this._pos,this.propFunc(e),this._pos=e}getPosition(e){return e===void 0&&(e=this._time),this.func(e,this.begin,this._change,this.duration)}play(){this.state=E5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=T5,this._time=this.duration-this._time,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onReverse")}seek(e){this.pause(),this._time=e,this.update(),this.fire("onSeek")}reset(){this.pause(),this._time=0,this.update(),this.fire("onReset")}finish(){this.pause(),this._time=this.duration,this.update(),this.fire("onFinish")}update(){this.setPosition(this.getPosition(this._time)),this.fire("onUpdate")}onEnterFrame(){const e=this.getTimer()-this._startTime;this.state===E5?this.setTime(e):this.state===T5&&this.setTime(this.duration-e)}pause(){this.state=jz,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _n{constructor(e){const n=this,s=e.node,i=s._id,o=e.easing||Sm.Linear,d=!!e.yoyo;let f,p;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=s,this._id=Cz++;const y=s.getLayer()||(s instanceof De.Stage?s.getLayers():null);y||ee.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new si(function(){n.tween.onEnterFrame()},y),this.tween=new wz(p,function(b){n._tweenFunc(b)},o,0,1,f*1e3,d),this._addListeners(),_n.attrs[i]||(_n.attrs[i]={}),_n.attrs[i][this._id]||(_n.attrs[i][this._id]={}),_n.tweens[i]||(_n.tweens[i]={});for(p in e)_z[p]===void 0&&this._addAttr(p,e[p]);this.reset(),this.onFinish=e.onFinish,this.onReset=e.onReset,this.onUpdate=e.onUpdate}_addAttr(e,n){const s=this.node,i=s._id;let o,d,f,p,y;const b=_n.tweens[i][e];b&&delete _n.attrs[i][b][e];let v=s.getAttr(e);if(ee._isArray(n))if(o=[],d=Math.max(n.length,v.length),e==="points"&&n.length!==v.length&&(n.length>v.length?(p=v,v=ee._prepareArrayForTween(v,n,s.closed())):(f=n,n=ee._prepareArrayForTween(n,v,s.closed()))),e.indexOf("fill")===0)for(let _=0;_<d;_++)if(_%2===0)o.push(n[_]-v[_]);else{const C=ee.colorToRGBA(v[_]);y=ee.colorToRGBA(n[_]),v[_]=C,o.push({r:y.r-C.r,g:y.g-C.g,b:y.b-C.b,a:y.a-C.a})}else for(let _=0;_<d;_++)o.push(n[_]-v[_]);else R5.indexOf(e)!==-1?(v=ee.colorToRGBA(v),y=ee.colorToRGBA(n),o={r:y.r-v.r,g:y.g-v.g,b:y.b-v.b,a:y.a-v.a}):o=n-v;_n.attrs[i][this._id][e]={start:v,diff:o,end:n,trueEnd:f,trueStart:p},_n.tweens[i][e]=this._id}_tweenFunc(e){const n=this.node,s=_n.attrs[n._id][this._id];let i,o,d,f,p,y,b,v;for(i in s){if(o=s[i],d=o.start,f=o.diff,v=o.end,ee._isArray(d))if(p=[],b=Math.max(d.length,v.length),i.indexOf("fill")===0)for(y=0;y<b;y++)y%2===0?p.push((d[y]||0)+f[y]*e):p.push("rgba("+Math.round(d[y].r+f[y].r*e)+","+Math.round(d[y].g+f[y].g*e)+","+Math.round(d[y].b+f[y].b*e)+","+(d[y].a+f[y].a*e)+")");else for(y=0;y<b;y++)p.push((d[y]||0)+f[y]*e);else R5.indexOf(i)!==-1?p="rgba("+Math.round(d.r+f.r*e)+","+Math.round(d.g+f.g*e)+","+Math.round(d.b+f.b*e)+","+(d.a+f.a*e)+")":p=d+f*e;n.setAttr(i,p)}}_addListeners(){this.tween.onPlay=()=>{this.anim.start()},this.tween.onReverse=()=>{this.anim.start()},this.tween.onPause=()=>{this.anim.stop()},this.tween.onFinish=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueEnd&&e.setAttr("points",n.points.trueEnd),this.onFinish&&this.onFinish.call(this)},this.tween.onReset=()=>{const e=this.node,n=_n.attrs[e._id][this._id];n.points&&n.points.trueStart&&e.points(n.points.trueStart),this.onReset&&this.onReset()},this.tween.onUpdate=()=>{this.onUpdate&&this.onUpdate.call(this)}}play(){return this.tween.play(),this}reverse(){return this.tween.reverse(),this}reset(){return this.tween.reset(),this}seek(e){return this.tween.seek(e*1e3),this}pause(){return this.tween.pause(),this}finish(){return this.tween.finish(),this}destroy(){const e=this.node._id,n=this._id,s=_n.tweens[e];this.pause(),this.anim&&this.anim.stop();for(const i in s)delete _n.tweens[e][i];delete _n.attrs[e][n],_n.tweens[e]&&(Object.keys(_n.tweens[e]).length===0&&delete _n.tweens[e],Object.keys(_n.attrs[e]).length===0&&delete _n.attrs[e])}}_n.attrs={};_n.tweens={};Ae.prototype.to=function(t){const e=t.onFinish;t.node=this,t.onFinish=function(){this.destroy(),e&&e()},new _n(t).play()};const Sm={BackEaseIn(t,e,n,s){return n*(t/=s)*t*((1.70158+1)*t-1.70158)+e},BackEaseOut(t,e,n,s){return n*((t=t/s-1)*t*((1.70158+1)*t+1.70158)+1)+e},BackEaseInOut(t,e,n,s){let i=1.70158;return(t/=s/2)<1?n/2*(t*t*(((i*=1.525)+1)*t-i))+e:n/2*((t-=2)*t*(((i*=1.525)+1)*t+i)+2)+e},ElasticEaseIn(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),-(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e)},ElasticEaseOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s)===1?e+n:(o||(o=s*.3),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),i*Math.pow(2,-10*t)*Math.sin((t*s-d)*(2*Math.PI)/o)+n+e)},ElasticEaseInOut(t,e,n,s,i,o){let d=0;return t===0?e:(t/=s/2)===2?e+n:(o||(o=s*(.3*1.5)),!i||i<Math.abs(n)?(i=n,d=o/4):d=o/(2*Math.PI)*Math.asin(n/i),t<1?-.5*(i*Math.pow(2,10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o))+e:i*Math.pow(2,-10*(t-=1))*Math.sin((t*s-d)*(2*Math.PI)/o)*.5+n+e)},BounceEaseOut(t,e,n,s){return(t/=s)<1/2.75?n*(7.5625*t*t)+e:t<2/2.75?n*(7.5625*(t-=1.5/2.75)*t+.75)+e:t<2.5/2.75?n*(7.5625*(t-=2.25/2.75)*t+.9375)+e:n*(7.5625*(t-=2.625/2.75)*t+.984375)+e},BounceEaseIn(t,e,n,s){return n-Sm.BounceEaseOut(s-t,0,n,s)+e},BounceEaseInOut(t,e,n,s){return t<s/2?Sm.BounceEaseIn(t*2,0,n,s)*.5+e:Sm.BounceEaseOut(t*2-s,0,n,s)*.5+n*.5+e},EaseIn(t,e,n,s){return n*(t/=s)*t+e},EaseOut(t,e,n,s){return-n*(t/=s)*(t-2)+e},EaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t+e:-n/2*(--t*(t-2)-1)+e},StrongEaseIn(t,e,n,s){return n*(t/=s)*t*t*t*t+e},StrongEaseOut(t,e,n,s){return n*((t=t/s-1)*t*t*t*t+1)+e},StrongEaseInOut(t,e,n,s){return(t/=s/2)<1?n/2*t*t*t*t*t+e:n/2*((t-=2)*t*t*t*t+2)+e},Linear(t,e,n,s){return n*t/s+e}},ah=ee._assign(De,{Util:ee,Transform:jr,Node:Ae,Container:Cr,Stage:iy,stages:bm,Layer:id,FastLayer:Mv,Group:nh,DD:Yt,Shape:Ee,shapes:vm,Animation:si,Tween:_n,Easings:Sm,Context:sy,Canvas:Ev});class mo extends Ee{_sceneFunc(e){const n=De.getAngle(this.angle()),s=this.clockwise();e.beginPath(),e.arc(0,0,this.outerRadius(),0,n,s),e.arc(0,0,this.innerRadius(),n,0,!s),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}getSelfRect(){const e=this.innerRadius(),n=this.outerRadius(),s=this.clockwise(),i=De.getAngle(s?360-this.angle():this.angle()),o=Math.cos(Math.min(i,Math.PI)),d=1,f=Math.sin(Math.min(Math.max(Math.PI,i),3*Math.PI/2)),p=Math.sin(Math.min(i,Math.PI/2)),y=o*(o>0?e:n),b=d*n,v=f*(f>0?e:n),_=p*(p>0?n:e);return{x:y,y:s?-1*_:v,width:b-y,height:_-v}}}mo.prototype._centroid=!0;mo.prototype.className="Arc";mo.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];ea(mo);K.addGetterSetter(mo,"innerRadius",0,Re());K.addGetterSetter(mo,"outerRadius",0,Re());K.addGetterSetter(mo,"angle",0,Re());K.addGetterSetter(mo,"clockwise",!1,Oi());function Mb(t,e,n,s,i,o,d){const f=Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2)),p=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-s,2)),y=d*f/(f+p),b=d*p/(f+p),v=n-y*(i-t),_=s-y*(o-e),C=n+b*(i-t),w=s+b*(o-e);return[v,_,C,w]}function O5(t,e){const n=t.length,s=[];for(let i=2;i<n-2;i+=2){const o=Mb(t[i-2],t[i-1],t[i],t[i+1],t[i+2],t[i+3],e);isNaN(o[0])||(s.push(o[0]),s.push(o[1]),s.push(t[i]),s.push(t[i+1]),s.push(o[2]),s.push(o[3]))}return s}function Ez(t){const e=[[t[0],t[2],t[4],t[6]],[t[1],t[3],t[5],t[7]]],n=[];for(const s of e){const i=-3*s[0]+9*s[1]-9*s[2]+3*s[3];if(i!==0){const o=6*s[0]-12*s[1]+6*s[2],d=-3*s[0]+3*s[1],f=o*o-4*i*d;if(f>=0){const p=Math.sqrt(f);n.push((-o+p)/(2*i)),n.push((-o-p)/(2*i))}}}return n.filter(s=>s>0&&s<1).flatMap(s=>e.map(i=>{const o=1-s;return o*o*o*i[0]+3*o*o*s*i[1]+3*o*s*s*i[2]+s*s*s*i[3]}))}let go=class extends Ee{constructor(e){super(e),this.on("pointsChange.konva tensionChange.konva closedChange.konva bezierChange.konva",function(){this._clearCache("tensionPoints")})}_sceneFunc(e){const n=this.points(),s=n.length,i=this.tension(),o=this.closed(),d=this.bezier();if(!s)return;let f=0;if(e.beginPath(),e.moveTo(n[0],n[1]),i!==0&&s>4){const p=this.getTensionPoints(),y=p.length;for(f=o?0:4,o||e.quadraticCurveTo(p[0],p[1],p[2],p[3]);f<y-2;)e.bezierCurveTo(p[f++],p[f++],p[f++],p[f++],p[f++],p[f++]);o||e.quadraticCurveTo(p[y-2],p[y-1],n[s-2],n[s-1])}else if(d)for(f=2;f<s;)e.bezierCurveTo(n[f++],n[f++],n[f++],n[f++],n[f++],n[f++]);else for(f=2;f<s;f+=2)e.lineTo(n[f],n[f+1]);o?(e.closePath(),e.fillStrokeShape(this)):e.strokeShape(this)}getTensionPoints(){return this._getCache("tensionPoints",this._getTensionPoints)}_getTensionPoints(){return this.closed()?this._getTensionPointsClosed():O5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,s=this.tension(),i=Mb(e[n-2],e[n-1],e[0],e[1],e[2],e[3],s),o=Mb(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],s),d=O5(e,s);return[i[2],i[3]].concat(d).concat([o[0],o[1],e[n-2],e[n-1],o[2],o[3],i[0],i[1],e[0],e[1]])}getWidth(){return this.getSelfRect().width}getHeight(){return this.getSelfRect().height}getSelfRect(){let e=this.points();if(e.length<4)return{x:e[0]||0,y:e[1]||0,width:0,height:0};this.tension()!==0?e=[e[0],e[1],...this._getTensionPoints(),e[e.length-2],e[e.length-1]]:this.bezier()?e=[e[0],e[1],...Ez(this.points()),e[e.length-2],e[e.length-1]]:e=this.points();let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let p=0;p<e.length/2;p++)d=e[p*2],f=e[p*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);return{x:n,y:i,width:s-n,height:o-i}}};go.prototype.className="Line";go.prototype._attrsAffectingSize=["points","bezier","tension"];ea(go);K.addGetterSetter(go,"closed",!1);K.addGetterSetter(go,"bezier",!1);K.addGetterSetter(go,"tension",0,Re());K.addGetterSetter(go,"points",[],YD());const Tz=[[],[],[-.5773502691896257,.5773502691896257],[0,-.7745966692414834,.7745966692414834],[-.33998104358485626,.33998104358485626,-.8611363115940526,.8611363115940526],[0,-.5384693101056831,.5384693101056831,-.906179845938664,.906179845938664],[.6612093864662645,-.6612093864662645,-.2386191860831969,.2386191860831969,-.932469514203152,.932469514203152],[0,.4058451513773972,-.4058451513773972,-.7415311855993945,.7415311855993945,-.9491079123427585,.9491079123427585],[-.1834346424956498,.1834346424956498,-.525532409916329,.525532409916329,-.7966664774136267,.7966664774136267,-.9602898564975363,.9602898564975363],[0,-.8360311073266358,.8360311073266358,-.9681602395076261,.9681602395076261,-.3242534234038089,.3242534234038089,-.6133714327005904,.6133714327005904],[-.14887433898163122,.14887433898163122,-.4333953941292472,.4333953941292472,-.6794095682990244,.6794095682990244,-.8650633666889845,.8650633666889845,-.9739065285171717,.9739065285171717],[0,-.26954315595234496,.26954315595234496,-.5190961292068118,.5190961292068118,-.7301520055740494,.7301520055740494,-.8870625997680953,.8870625997680953,-.978228658146057,.978228658146057],[-.1252334085114689,.1252334085114689,-.3678314989981802,.3678314989981802,-.5873179542866175,.5873179542866175,-.7699026741943047,.7699026741943047,-.9041172563704749,.9041172563704749,-.9815606342467192,.9815606342467192],[0,-.2304583159551348,.2304583159551348,-.44849275103644687,.44849275103644687,-.6423493394403402,.6423493394403402,-.8015780907333099,.8015780907333099,-.9175983992229779,.9175983992229779,-.9841830547185881,.9841830547185881],[-.10805494870734367,.10805494870734367,-.31911236892788974,.31911236892788974,-.5152486363581541,.5152486363581541,-.6872929048116855,.6872929048116855,-.827201315069765,.827201315069765,-.9284348836635735,.9284348836635735,-.9862838086968123,.9862838086968123],[0,-.20119409399743451,.20119409399743451,-.3941513470775634,.3941513470775634,-.5709721726085388,.5709721726085388,-.7244177313601701,.7244177313601701,-.8482065834104272,.8482065834104272,-.937273392400706,.937273392400706,-.9879925180204854,.9879925180204854],[-.09501250983763744,.09501250983763744,-.2816035507792589,.2816035507792589,-.45801677765722737,.45801677765722737,-.6178762444026438,.6178762444026438,-.755404408355003,.755404408355003,-.8656312023878318,.8656312023878318,-.9445750230732326,.9445750230732326,-.9894009349916499,.9894009349916499],[0,-.17848418149584785,.17848418149584785,-.3512317634538763,.3512317634538763,-.5126905370864769,.5126905370864769,-.6576711592166907,.6576711592166907,-.7815140038968014,.7815140038968014,-.8802391537269859,.8802391537269859,-.9506755217687678,.9506755217687678,-.9905754753144174,.9905754753144174],[-.0847750130417353,.0847750130417353,-.2518862256915055,.2518862256915055,-.41175116146284263,.41175116146284263,-.5597708310739475,.5597708310739475,-.6916870430603532,.6916870430603532,-.8037049589725231,.8037049589725231,-.8926024664975557,.8926024664975557,-.9558239495713977,.9558239495713977,-.9915651684209309,.9915651684209309],[0,-.16035864564022537,.16035864564022537,-.31656409996362983,.31656409996362983,-.46457074137596094,.46457074137596094,-.600545304661681,.600545304661681,-.7209661773352294,.7209661773352294,-.8227146565371428,.8227146565371428,-.9031559036148179,.9031559036148179,-.96020815213483,.96020815213483,-.9924068438435844,.9924068438435844],[-.07652652113349734,.07652652113349734,-.22778585114164507,.22778585114164507,-.37370608871541955,.37370608871541955,-.5108670019508271,.5108670019508271,-.636053680726515,.636053680726515,-.7463319064601508,.7463319064601508,-.8391169718222188,.8391169718222188,-.912234428251326,.912234428251326,-.9639719272779138,.9639719272779138,-.9931285991850949,.9931285991850949],[0,-.1455618541608951,.1455618541608951,-.2880213168024011,.2880213168024011,-.4243421202074388,.4243421202074388,-.5516188358872198,.5516188358872198,-.6671388041974123,.6671388041974123,-.7684399634756779,.7684399634756779,-.8533633645833173,.8533633645833173,-.9200993341504008,.9200993341504008,-.9672268385663063,.9672268385663063,-.9937521706203895,.9937521706203895],[-.06973927331972223,.06973927331972223,-.20786042668822127,.20786042668822127,-.34193582089208424,.34193582089208424,-.469355837986757,.469355837986757,-.5876404035069116,.5876404035069116,-.6944872631866827,.6944872631866827,-.7878168059792081,.7878168059792081,-.8658125777203002,.8658125777203002,-.926956772187174,.926956772187174,-.9700604978354287,.9700604978354287,-.9942945854823992,.9942945854823992],[0,-.1332568242984661,.1332568242984661,-.26413568097034495,.26413568097034495,-.3903010380302908,.3903010380302908,-.5095014778460075,.5095014778460075,-.6196098757636461,.6196098757636461,-.7186613631319502,.7186613631319502,-.8048884016188399,.8048884016188399,-.8767523582704416,.8767523582704416,-.9329710868260161,.9329710868260161,-.9725424712181152,.9725424712181152,-.9947693349975522,.9947693349975522],[-.06405689286260563,.06405689286260563,-.1911188674736163,.1911188674736163,-.3150426796961634,.3150426796961634,-.4337935076260451,.4337935076260451,-.5454214713888396,.5454214713888396,-.6480936519369755,.6480936519369755,-.7401241915785544,.7401241915785544,-.820001985973903,.820001985973903,-.8864155270044011,.8864155270044011,-.9382745520027328,.9382745520027328,-.9747285559713095,.9747285559713095,-.9951872199970213,.9951872199970213]],Rz=[[],[],[1,1],[.8888888888888888,.5555555555555556,.5555555555555556],[.6521451548625461,.6521451548625461,.34785484513745385,.34785484513745385],[.5688888888888889,.47862867049936647,.47862867049936647,.23692688505618908,.23692688505618908],[.3607615730481386,.3607615730481386,.46791393457269104,.46791393457269104,.17132449237917036,.17132449237917036],[.4179591836734694,.3818300505051189,.3818300505051189,.27970539148927664,.27970539148927664,.1294849661688697,.1294849661688697],[.362683783378362,.362683783378362,.31370664587788727,.31370664587788727,.22238103445337448,.22238103445337448,.10122853629037626,.10122853629037626],[.3302393550012598,.1806481606948574,.1806481606948574,.08127438836157441,.08127438836157441,.31234707704000286,.31234707704000286,.26061069640293544,.26061069640293544],[.29552422471475287,.29552422471475287,.26926671930999635,.26926671930999635,.21908636251598204,.21908636251598204,.1494513491505806,.1494513491505806,.06667134430868814,.06667134430868814],[.2729250867779006,.26280454451024665,.26280454451024665,.23319376459199048,.23319376459199048,.18629021092773426,.18629021092773426,.1255803694649046,.1255803694649046,.05566856711617366,.05566856711617366],[.24914704581340277,.24914704581340277,.2334925365383548,.2334925365383548,.20316742672306592,.20316742672306592,.16007832854334622,.16007832854334622,.10693932599531843,.10693932599531843,.04717533638651183,.04717533638651183],[.2325515532308739,.22628318026289723,.22628318026289723,.2078160475368885,.2078160475368885,.17814598076194574,.17814598076194574,.13887351021978725,.13887351021978725,.09212149983772845,.09212149983772845,.04048400476531588,.04048400476531588],[.2152638534631578,.2152638534631578,.2051984637212956,.2051984637212956,.18553839747793782,.18553839747793782,.15720316715819355,.15720316715819355,.12151857068790319,.12151857068790319,.08015808715976021,.08015808715976021,.03511946033175186,.03511946033175186],[.2025782419255613,.19843148532711158,.19843148532711158,.1861610000155622,.1861610000155622,.16626920581699392,.16626920581699392,.13957067792615432,.13957067792615432,.10715922046717194,.10715922046717194,.07036604748810812,.07036604748810812,.03075324199611727,.03075324199611727],[.1894506104550685,.1894506104550685,.18260341504492358,.18260341504492358,.16915651939500254,.16915651939500254,.14959598881657674,.14959598881657674,.12462897125553388,.12462897125553388,.09515851168249279,.09515851168249279,.062253523938647894,.062253523938647894,.027152459411754096,.027152459411754096],[.17944647035620653,.17656270536699264,.17656270536699264,.16800410215645004,.16800410215645004,.15404576107681028,.15404576107681028,.13513636846852548,.13513636846852548,.11188384719340397,.11188384719340397,.08503614831717918,.08503614831717918,.0554595293739872,.0554595293739872,.02414830286854793,.02414830286854793],[.1691423829631436,.1691423829631436,.16427648374583273,.16427648374583273,.15468467512626524,.15468467512626524,.14064291467065065,.14064291467065065,.12255520671147846,.12255520671147846,.10094204410628717,.10094204410628717,.07642573025488905,.07642573025488905,.0497145488949698,.0497145488949698,.02161601352648331,.02161601352648331],[.1610544498487837,.15896884339395434,.15896884339395434,.15276604206585967,.15276604206585967,.1426067021736066,.1426067021736066,.12875396253933621,.12875396253933621,.11156664554733399,.11156664554733399,.09149002162245,.09149002162245,.06904454273764123,.06904454273764123,.0448142267656996,.0448142267656996,.019461788229726478,.019461788229726478],[.15275338713072584,.15275338713072584,.14917298647260374,.14917298647260374,.14209610931838204,.14209610931838204,.13168863844917664,.13168863844917664,.11819453196151841,.11819453196151841,.10193011981724044,.10193011981724044,.08327674157670475,.08327674157670475,.06267204833410907,.06267204833410907,.04060142980038694,.04060142980038694,.017614007139152118,.017614007139152118],[.14608113364969041,.14452440398997005,.14452440398997005,.13988739479107315,.13988739479107315,.13226893863333747,.13226893863333747,.12183141605372853,.12183141605372853,.10879729916714838,.10879729916714838,.09344442345603386,.09344442345603386,.0761001136283793,.0761001136283793,.057134425426857205,.057134425426857205,.036953789770852494,.036953789770852494,.016017228257774335,.016017228257774335],[.13925187285563198,.13925187285563198,.13654149834601517,.13654149834601517,.13117350478706238,.13117350478706238,.12325237681051242,.12325237681051242,.11293229608053922,.11293229608053922,.10041414444288096,.10041414444288096,.08594160621706773,.08594160621706773,.06979646842452049,.06979646842452049,.052293335152683286,.052293335152683286,.03377490158481415,.03377490158481415,.0146279952982722,.0146279952982722],[.13365457218610619,.1324620394046966,.1324620394046966,.12890572218808216,.12890572218808216,.12304908430672953,.12304908430672953,.11499664022241136,.11499664022241136,.10489209146454141,.10489209146454141,.09291576606003515,.09291576606003515,.07928141177671895,.07928141177671895,.06423242140852585,.06423242140852585,.04803767173108467,.04803767173108467,.030988005856979445,.030988005856979445,.013411859487141771,.013411859487141771],[.12793819534675216,.12793819534675216,.1258374563468283,.1258374563468283,.12167047292780339,.12167047292780339,.1155056680537256,.1155056680537256,.10744427011596563,.10744427011596563,.09761865210411388,.09761865210411388,.08619016153195327,.08619016153195327,.0733464814110803,.0733464814110803,.05929858491543678,.05929858491543678,.04427743881741981,.04427743881741981,.028531388628933663,.028531388628933663,.0123412297999872,.0123412297999872]],Oz=[[1],[1,1],[1,2,1],[1,3,3,1]],M5=(t,e,n)=>{let s,i;const d=n/2;s=0;for(let f=0;f<20;f++)i=d*Tz[20][f]+d,s+=Rz[20][f]*Mz(t,e,i);return d*s},A5=(t,e,n)=>{n===void 0&&(n=1);const s=t[0]-2*t[1]+t[2],i=e[0]-2*e[1]+e[2],o=2*t[1]-2*t[0],d=2*e[1]-2*e[0],f=4*(s*s+i*i),p=4*(s*o+i*d),y=o*o+d*d;if(f===0)return n*Math.sqrt(Math.pow(t[2]-t[0],2)+Math.pow(e[2]-e[0],2));const b=p/(2*f),v=y/f,_=n+b,C=v-b*b,w=_*_+C>0?Math.sqrt(_*_+C):0,T=b*b+C>0?Math.sqrt(b*b+C):0,R=b+Math.sqrt(b*b+C)!==0?C*Math.log(Math.abs((_+w)/(b+T))):0;return Math.sqrt(f)/2*(_*w-b*T+R)};function Mz(t,e,n){const s=Ab(1,n,t),i=Ab(1,n,e),o=s*s+i*i;return Math.sqrt(o)}const Ab=(t,e,n)=>{const s=n.length-1;let i,o;if(s===0)return 0;if(t===0){o=0;for(let d=0;d<=s;d++)o+=Oz[s][d]*Math.pow(1-e,s-d)*Math.pow(e,d)*n[d];return o}else{i=new Array(s);for(let d=0;d<s;d++)i[d]=s*(n[d+1]-n[d]);return Ab(t-1,e,i)}},D5=(t,e,n)=>{let s=1,i=t/e,o=(t-n(i))/e,d=0;for(;s>.001;){const f=n(i+o),p=Math.abs(t-f)/e;if(p<s)s=p,i+=o;else{const y=n(i-o),b=Math.abs(t-y)/e;b<s?(s=b,i-=o):o/=2}if(d++,d>500)break}return i};class jn extends Ee{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=jn.parsePathData(this.data()),this.pathLength=jn.getPathLength(this.dataArray)}_sceneFunc(e){const n=this.dataArray;e.beginPath();let s=!1;for(let i=0;i<n.length;i++){const o=n[i].command,d=n[i].points;switch(o){case"L":e.lineTo(d[0],d[1]);break;case"M":e.moveTo(d[0],d[1]);break;case"C":e.bezierCurveTo(d[0],d[1],d[2],d[3],d[4],d[5]);break;case"Q":e.quadraticCurveTo(d[0],d[1],d[2],d[3]);break;case"A":const f=d[0],p=d[1],y=d[2],b=d[3],v=d[4],_=d[5],C=d[6],w=d[7],T=y>b?y:b,R=y>b?1:y/b,O=y>b?b/y:1;e.translate(f,p),e.rotate(C),e.scale(R,O),e.arc(0,0,T,v,v+_,1-w),e.scale(1/R,1/O),e.rotate(-C),e.translate(-f,-p);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(p){if(p.command==="A"){const y=p.points[4],b=p.points[5],v=p.points[4]+b;let _=Math.PI/180;if(Math.abs(y-v)<_&&(_=Math.abs(y-v)),b<0)for(let C=y-_;C>v;C-=_){const w=jn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],C,0);e.push(w.x,w.y)}else for(let C=y+_;C<v;C+=_){const w=jn.getPointOnEllipticalArc(p.points[0],p.points[1],p.points[2],p.points[3],C,0);e.push(w.x,w.y)}}else if(p.command==="C")for(let y=0;y<=1;y+=.01){const b=jn.getPointOnCubicBezier(y,p.start.x,p.start.y,p.points[0],p.points[1],p.points[2],p.points[3],p.points[4],p.points[5]);e.push(b.x,b.y)}else e=e.concat(p.points)});let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let p=0;p<e.length/2;p++)d=e[p*2],f=e[p*2+1],isNaN(d)||(n=Math.min(n,d),s=Math.max(s,d)),isNaN(f)||(i=Math.min(i,f),o=Math.max(o,f));return{x:n,y:i,width:s-n,height:o-i}}getLength(){return this.pathLength}getPointAtLength(e){return jn.getPointAtLengthOfDataArray(e,this.dataArray)}static getLineLength(e,n,s,i){return Math.sqrt((s-e)*(s-e)+(i-n)*(i-n))}static getPathLength(e){let n=0;for(let s=0;s<e.length;++s)n+=e[s].pathLength;return n}static getPointAtLengthOfDataArray(e,n){let s,i=0,o=n.length;if(!o)return null;for(;i<o&&e>n[i].pathLength;)e-=n[i].pathLength,++i;if(i===o)return s=n[i-1].points.slice(-2),{x:s[0],y:s[1]};if(e<.01)return n[i].command==="M"?(s=n[i].points.slice(0,2),{x:s[0],y:s[1]}):{x:n[i].start.x,y:n[i].start.y};const d=n[i],f=d.points;switch(d.command){case"L":return jn.getPointOnLine(e,d.start.x,d.start.y,f[0],f[1]);case"C":return jn.getPointOnCubicBezier(D5(e,jn.getPathLength(n),T=>M5([d.start.x,f[0],f[2],f[4]],[d.start.y,f[1],f[3],f[5]],T)),d.start.x,d.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return jn.getPointOnQuadraticBezier(D5(e,jn.getPathLength(n),T=>A5([d.start.x,f[0],f[2]],[d.start.y,f[1],f[3]],T)),d.start.x,d.start.y,f[0],f[1],f[2],f[3]);case"A":const p=f[0],y=f[1],b=f[2],v=f[3],_=f[5],C=f[6];let w=f[4];return w+=_*e/d.pathLength,jn.getPointOnEllipticalArc(p,y,b,v,w,C)}return null}static getPointOnLine(e,n,s,i,o,d,f){d=d??n,f=f??s;const p=this.getLineLength(n,s,i,o);if(p<1e-10)return{x:n,y:s};if(i===n)return{x:d,y:f+(o>s?e:-e)};const y=(o-s)/(i-n),b=Math.sqrt(e*e/(1+y*y))*(i<n?-1:1),v=y*b;if(Math.abs(f-s-y*(d-n))<1e-10)return{x:d+b,y:f+v};const _=((d-n)*(i-n)+(f-s)*(o-s))/(p*p),C=n+_*(i-n),w=s+_*(o-s),T=this.getLineLength(d,f,C,w),R=Math.sqrt(e*e-T*T),O=Math.sqrt(R*R/(1+y*y))*(i<n?-1:1),M=y*O;return{x:C+O,y:w+M}}static getPointOnCubicBezier(e,n,s,i,o,d,f,p,y){function b(R){return R*R*R}function v(R){return 3*R*R*(1-R)}function _(R){return 3*R*(1-R)*(1-R)}function C(R){return(1-R)*(1-R)*(1-R)}const w=p*b(e)+d*v(e)+i*_(e)+n*C(e),T=y*b(e)+f*v(e)+o*_(e)+s*C(e);return{x:w,y:T}}static getPointOnQuadraticBezier(e,n,s,i,o,d,f){function p(C){return C*C}function y(C){return 2*C*(1-C)}function b(C){return(1-C)*(1-C)}const v=d*p(e)+i*y(e)+n*b(e),_=f*p(e)+o*y(e)+s*b(e);return{x:v,y:_}}static getPointOnEllipticalArc(e,n,s,i,o,d){const f=Math.cos(d),p=Math.sin(d),y={x:s*Math.cos(o),y:i*Math.sin(o)};return{x:e+(y.x*f-y.y*p),y:n+(y.x*p+y.y*f)}}static parsePathData(e){if(!e)return[];let n=e;const s=["m","M","l","L","v","V","h","H","z","Z","c","C","q","Q","t","T","s","S","a","A"];n=n.replace(new RegExp(" ","g"),",");for(let v=0;v<s.length;v++)n=n.replace(new RegExp(s[v],"g"),"|"+s[v]);const i=n.split("|"),o=[],d=[];let f=0,p=0;const y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let b;for(let v=1;v<i.length;v++){let _=i[v],C=_.charAt(0);for(_=_.slice(1),d.length=0;b=y.exec(_);)d.push(b[0]);let w=[],T=C==="A"||C==="a"?0:-1;for(let R=0,O=d.length;R<O;R++){const M=d[R];if(M==="00"){w.push(0,0),T>=0&&(T+=2,T>=7&&(T-=7));continue}if(T>=0){if(T===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(M)){w.push(parseInt(M[0],10)),w.push(parseInt(M[1],10)),w.push(parseFloat(M.slice(2))),T+=3,T>=7&&(T-=7);continue}if(M==="11"||M==="10"||M==="01"){w.push(parseInt(M[0],10)),w.push(parseInt(M[1],10)),T+=2,T>=7&&(T-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),T+=1,T>=7&&(T-=7);continue}}else if(T===4){if(/^[01]\d+(?:\.\d+)?$/.test(M)){w.push(parseInt(M[0],10)),w.push(parseFloat(M.slice(1))),T+=2,T>=7&&(T-=7);continue}if(M==="0"||M==="1"){w.push(parseInt(M,10)),T+=1,T>=7&&(T-=7);continue}}const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z),T+=1,T>=7&&(T-=7)}else{const z=parseFloat(M);isNaN(z)?w.push(0):w.push(z)}}for(;w.length>0&&!isNaN(w[0]);){let R="",O=[];const M=f,z=p;let k,P,q,L,U,V,F,re,ne,J;switch(C){case"l":f+=w.shift(),p+=w.shift(),R="L",O.push(f,p);break;case"L":f=w.shift(),p=w.shift(),O.push(f,p);break;case"m":const ie=w.shift(),ce=w.shift();if(f+=ie,p+=ce,R="M",o.length>2&&o[o.length-1].command==="z"){for(let Y=o.length-2;Y>=0;Y--)if(o[Y].command==="M"){f=o[Y].points[0]+ie,p=o[Y].points[1]+ce;break}}O.push(f,p),C="l";break;case"M":f=w.shift(),p=w.shift(),R="M",O.push(f,p),C="L";break;case"h":f+=w.shift(),R="L",O.push(f,p);break;case"H":f=w.shift(),R="L",O.push(f,p);break;case"v":p+=w.shift(),R="L",O.push(f,p);break;case"V":p=w.shift(),R="L",O.push(f,p);break;case"C":O.push(w.shift(),w.shift(),w.shift(),w.shift()),f=w.shift(),p=w.shift(),O.push(f,p);break;case"c":O.push(f+w.shift(),p+w.shift(),f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),R="C",O.push(f,p);break;case"S":P=f,q=p,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),q=p+(p-k.points[3])),O.push(P,q,w.shift(),w.shift()),f=w.shift(),p=w.shift(),R="C",O.push(f,p);break;case"s":P=f,q=p,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),q=p+(p-k.points[3])),O.push(P,q,f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),R="C",O.push(f,p);break;case"Q":O.push(w.shift(),w.shift()),f=w.shift(),p=w.shift(),O.push(f,p);break;case"q":O.push(f+w.shift(),p+w.shift()),f+=w.shift(),p+=w.shift(),R="Q",O.push(f,p);break;case"T":P=f,q=p,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),q=p+(p-k.points[1])),f=w.shift(),p=w.shift(),R="Q",O.push(P,q,f,p);break;case"t":P=f,q=p,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),q=p+(p-k.points[1])),f+=w.shift(),p+=w.shift(),R="Q",O.push(P,q,f,p);break;case"A":L=w.shift(),U=w.shift(),V=w.shift(),F=w.shift(),re=w.shift(),ne=f,J=p,f=w.shift(),p=w.shift(),R="A",O=this.convertEndpointToCenterParameterization(ne,J,f,p,F,re,L,U,V);break;case"a":L=w.shift(),U=w.shift(),V=w.shift(),F=w.shift(),re=w.shift(),ne=f,J=p,f+=w.shift(),p+=w.shift(),R="A",O=this.convertEndpointToCenterParameterization(ne,J,f,p,F,re,L,U,V);break}o.push({command:R||C,points:O,start:{x:M,y:z},pathLength:this.calcLength(M,z,R||C,O)})}(C==="z"||C==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,s,i){let o,d,f,p;const y=jn;switch(s){case"L":return y.getLineLength(e,n,i[0],i[1]);case"C":return M5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return A5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const b=i[4],v=i[5],_=i[4]+v;let C=Math.PI/180;if(Math.abs(b-_)<C&&(C=Math.abs(b-_)),d=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],b,0),v<0)for(p=b-C;p>_;p-=C)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;else for(p=b+C;p<_;p+=C)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],p,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;return f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],_,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),o}return 0}static convertEndpointToCenterParameterization(e,n,s,i,o,d,f,p,y){const b=y*(Math.PI/180),v=Math.cos(b)*(e-s)/2+Math.sin(b)*(n-i)/2,_=-1*Math.sin(b)*(e-s)/2+Math.cos(b)*(n-i)/2,C=v*v/(f*f)+_*_/(p*p);C>1&&(f*=Math.sqrt(C),p*=Math.sqrt(C));let w=Math.sqrt((f*f*(p*p)-f*f*(_*_)-p*p*(v*v))/(f*f*(_*_)+p*p*(v*v)));o===d&&(w*=-1),isNaN(w)&&(w=0);const T=w*f*_/p,R=w*-p*v/f,O=(e+s)/2+Math.cos(b)*T-Math.sin(b)*R,M=(n+i)/2+Math.sin(b)*T+Math.cos(b)*R,z=function(F){return Math.sqrt(F[0]*F[0]+F[1]*F[1])},k=function(F,re){return(F[0]*re[0]+F[1]*re[1])/(z(F)*z(re))},P=function(F,re){return(F[0]*re[1]<F[1]*re[0]?-1:1)*Math.acos(k(F,re))},q=P([1,0],[(v-T)/f,(_-R)/p]),L=[(v-T)/f,(_-R)/p],U=[(-1*v-T)/f,(-1*_-R)/p];let V=P(L,U);return k(L,U)<=-1&&(V=Math.PI),k(L,U)>=1&&(V=0),d===0&&V>0&&(V=V-2*Math.PI),d===1&&V<0&&(V=V+2*Math.PI),[O,M,f,p,q,V,b,d]}}jn.prototype.className="Path";jn.prototype._attrsAffectingSize=["data"];ea(jn);K.addGetterSetter(jn,"data");let ld=class extends go{_sceneFunc(e){super._sceneFunc(e);const n=Math.PI*2,s=this.points();let i=s;const o=this.tension()!==0&&s.length>4;o&&(i=this.getTensionPoints());const d=this.pointerLength(),f=s.length;let p,y;if(o){const _=[i[i.length-4],i[i.length-3],i[i.length-2],i[i.length-1],s[f-2],s[f-1]],C=jn.calcLength(i[i.length-4],i[i.length-3],"C",_),w=jn.getPointOnQuadraticBezier(Math.min(1,1-d/C),_[0],_[1],_[2],_[3],_[4],_[5]);p=s[f-2]-w.x,y=s[f-1]-w.y}else p=s[f-2]-s[f-4],y=s[f-1]-s[f-3];const b=(Math.atan2(y,p)+n)%n,v=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(s[f-2],s[f-1]),e.rotate(b),e.moveTo(0,0),e.lineTo(-d,v/2),e.lineTo(-d,-v/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(s[0],s[1]),o?(p=(i[0]+i[2])/2-s[0],y=(i[1]+i[3])/2-s[1]):(p=s[2]-s[0],y=s[3]-s[1]),e.rotate((Math.atan2(-y,-p)+n)%n),e.moveTo(0,0),e.lineTo(-d,v/2),e.lineTo(-d,-v/2),e.closePath(),e.restore(),this.__fillStroke(e))}__fillStroke(e){const n=this.dashEnabled();n&&(this.attrs.dashEnabled=!1,e.setLineDash([])),e.fillStrokeShape(this),n&&(this.attrs.dashEnabled=!0)}getSelfRect(){const e=super.getSelfRect(),n=this.pointerWidth()/2;return{x:e.x,y:e.y-n,width:e.width,height:e.height+n*2}}};ld.prototype.className="Arrow";ea(ld);K.addGetterSetter(ld,"pointerLength",10,Re());K.addGetterSetter(ld,"pointerWidth",10,Re());K.addGetterSetter(ld,"pointerAtBeginning",!1);K.addGetterSetter(ld,"pointerAtEnding",!0);let fh=class extends Ee{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.attrs.radius||0,0,Math.PI*2,!1),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius()!==e/2&&this.radius(e/2)}setHeight(e){this.radius()!==e/2&&this.radius(e/2)}};fh.prototype._centroid=!0;fh.prototype.className="Circle";fh.prototype._attrsAffectingSize=["radius"];ea(fh);K.addGetterSetter(fh,"radius",0,Re());class qc extends Ee{_sceneFunc(e){const n=this.radiusX(),s=this.radiusY();e.beginPath(),e.save(),n!==s&&e.scale(1,s/n),e.arc(0,0,n,0,Math.PI*2,!1),e.restore(),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radiusX()*2}getHeight(){return this.radiusY()*2}setWidth(e){this.radiusX(e/2)}setHeight(e){this.radiusY(e/2)}}qc.prototype.className="Ellipse";qc.prototype._centroid=!0;qc.prototype._attrsAffectingSize=["radiusX","radiusY"];ea(qc);K.addComponentsGetterSetter(qc,"radius",["x","y"]);K.addGetterSetter(qc,"radiusX",0,Re());K.addGetterSetter(qc,"radiusY",0,Re());class Tr extends Ee{constructor(e){super(e),this._loadListener=()=>{this._requestDraw()},this.on("imageChange.konva",n=>{this._removeImageLoad(n.oldVal),this._setImageLoad()}),this._setImageLoad()}_setImageLoad(){const e=this.image();e&&e.complete||e&&e.readyState===4||e&&e.addEventListener&&e.addEventListener("load",this._loadListener)}_removeImageLoad(e){e&&e.removeEventListener&&e.removeEventListener("load",this._loadListener)}destroy(){return this._removeImageLoad(this.image()),super.destroy(),this}_useBufferCanvas(){const e=!!this.cornerRadius(),n=this.hasShadow();return e&&n?!0:super._useBufferCanvas(!0)}_sceneFunc(e){const n=this.getWidth(),s=this.getHeight(),i=this.cornerRadius(),o=this.attrs.image;let d;if(o){const f=this.attrs.cropWidth,p=this.attrs.cropHeight;f&&p?d=[o,this.cropX(),this.cropY(),f,p,0,0,n,s]:d=[o,0,0,n,s]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)),o&&(i&&e.clip(),e.drawImage.apply(e,d))}_hitFunc(e){const n=this.width(),s=this.height(),i=this.cornerRadius();e.beginPath(),i?ee.drawRoundedRectPath(e,n,s,i):e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}getWidth(){var e,n,s;return(s=(e=this.attrs.width)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.width)!==null&&s!==void 0?s:0}getHeight(){var e,n,s;return(s=(e=this.attrs.height)!==null&&e!==void 0?e:(n=this.image())===null||n===void 0?void 0:n.height)!==null&&s!==void 0?s:0}static fromURL(e,n,s=null){const i=ee.createImageElement();i.onload=function(){const o=new Tr({image:i});n(o)},i.onerror=s,i.crossOrigin="Anonymous",i.src=e}}Tr.prototype.className="Image";Tr.prototype._attrsAffectingSize=["image"];ea(Tr);K.addGetterSetter(Tr,"cornerRadius",0,ry(4));K.addGetterSetter(Tr,"image");K.addComponentsGetterSetter(Tr,"crop",["x","y","width","height"]);K.addGetterSetter(Tr,"cropX",0,Re());K.addGetterSetter(Tr,"cropY",0,Re());K.addGetterSetter(Tr,"cropWidth",0,Re());K.addGetterSetter(Tr,"cropHeight",0,Re());const B8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Az="Change.konva",Dz="none",Db="up",zb="right",kb="down",Lb="left",zz=B8.length;class Av extends nh{constructor(e){super(e),this.on("add.konva",function(n){this._addListeners(n.child),this._sync()})}getText(){return this.find("Text")[0]}getTag(){return this.find("Tag")[0]}_addListeners(e){let n=this,s;const i=function(){n._sync()};for(s=0;s<zz;s++)e.on(B8[s]+Az,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),s,i,o,d,f,p,y;if(e&&n){switch(s=e.width(),i=e.height(),o=n.pointerDirection(),d=n.pointerWidth(),y=n.pointerHeight(),f=0,p=0,o){case Db:f=s/2,p=-1*y;break;case zb:f=s+d,p=i/2;break;case kb:f=s/2,p=i+y;break;case Lb:f=-1*d,p=i/2;break}n.setAttrs({x:-1*f,y:-1*p,width:s,height:i}),e.setAttrs({x:-1*f,y:-1*p})}}}Av.prototype.className="Label";ea(Av);class od extends Ee{_sceneFunc(e){const n=this.width(),s=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),d=this.pointerHeight(),f=this.cornerRadius();let p=0,y=0,b=0,v=0;typeof f=="number"?p=y=b=v=Math.min(f,n/2,s/2):(p=Math.min(f[0]||0,n/2,s/2),y=Math.min(f[1]||0,n/2,s/2),v=Math.min(f[2]||0,n/2,s/2),b=Math.min(f[3]||0,n/2,s/2)),e.beginPath(),e.moveTo(p,0),i===Db&&(e.lineTo((n-o)/2,0),e.lineTo(n/2,-1*d),e.lineTo((n+o)/2,0)),e.lineTo(n-y,0),e.arc(n-y,y,y,Math.PI*3/2,0,!1),i===zb&&(e.lineTo(n,(s-d)/2),e.lineTo(n+o,s/2),e.lineTo(n,(s+d)/2)),e.lineTo(n,s-v),e.arc(n-v,s-v,v,0,Math.PI/2,!1),i===kb&&(e.lineTo((n+o)/2,s),e.lineTo(n/2,s+d),e.lineTo((n-o)/2,s)),e.lineTo(b,s),e.arc(b,s-b,b,Math.PI/2,Math.PI,!1),i===Lb&&(e.lineTo(0,(s+d)/2),e.lineTo(-1*o,s/2),e.lineTo(0,(s-d)/2)),e.lineTo(0,p),e.arc(p,p,p,Math.PI,Math.PI*3/2,!1),e.closePath(),e.fillStrokeShape(this)}getSelfRect(){let e=0,n=0,s=this.pointerWidth(),i=this.pointerHeight(),o=this.pointerDirection(),d=this.width(),f=this.height();return o===Db?(n-=i,f+=i):o===kb?f+=i:o===Lb?(e-=s*1.5,d+=s):o===zb&&(d+=s*1.5),{x:e,y:n,width:d,height:f}}}od.prototype.className="Tag";ea(od);K.addGetterSetter(od,"pointerDirection",Dz);K.addGetterSetter(od,"pointerWidth",0,Re());K.addGetterSetter(od,"pointerHeight",0,Re());K.addGetterSetter(od,"cornerRadius",0,ry(4));class Wm extends Ee{_sceneFunc(e){const n=this.cornerRadius(),s=this.width(),i=this.height();e.beginPath(),n?ee.drawRoundedRectPath(e,s,i,n):e.rect(0,0,s,i),e.closePath(),e.fillStrokeShape(this)}}Wm.prototype.className="Rect";ea(Wm);K.addGetterSetter(Wm,"cornerRadius",0,ry(4));class Hc extends Ee{_sceneFunc(e){const n=this._getPoints(),s=this.radius(),i=this.sides(),o=this.cornerRadius();if(e.beginPath(),o)ee.drawRoundedPolygonPath(e,n,i,s,o);else{e.moveTo(n[0].x,n[0].y);for(let d=1;d<n.length;d++)e.lineTo(n[d].x,n[d].y)}e.closePath(),e.fillStrokeShape(this)}_getPoints(){const e=this.attrs.sides,n=this.attrs.radius||0,s=[];for(let i=0;i<e;i++)s.push({x:n*Math.sin(i*2*Math.PI/e),y:-1*n*Math.cos(i*2*Math.PI/e)});return s}getSelfRect(){const e=this._getPoints();let n=e[0].x,s=e[0].x,i=e[0].y,o=e[0].y;return e.forEach(d=>{n=Math.min(n,d.x),s=Math.max(s,d.x),i=Math.min(i,d.y),o=Math.max(o,d.y)}),{x:n,y:i,width:s-n,height:o-i}}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}Hc.prototype.className="RegularPolygon";Hc.prototype._centroid=!0;Hc.prototype._attrsAffectingSize=["radius"];ea(Hc);K.addGetterSetter(Hc,"radius",0,Re());K.addGetterSetter(Hc,"sides",0,Re());K.addGetterSetter(Hc,"cornerRadius",0,ry(4));const z5=Math.PI*2;class cd extends Ee{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,z5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),z5,0,!0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}cd.prototype.className="Ring";cd.prototype._centroid=!0;cd.prototype._attrsAffectingSize=["innerRadius","outerRadius"];ea(cd);K.addGetterSetter(cd,"innerRadius",0,Re());K.addGetterSetter(cd,"outerRadius",0,Re());class vl extends Ee{constructor(e){super(e),this._updated=!0,this.anim=new si(()=>{const n=this._updated;return this._updated=!1,n}),this.on("animationChange.konva",function(){this.frameIndex(0)}),this.on("frameIndexChange.konva",function(){this._updated=!0}),this.on("frameRateChange.konva",function(){this.anim.isRunning()&&(clearInterval(this.interval),this._setInterval())})}_sceneFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+0],p=o[i+1],y=o[i+2],b=o[i+3],v=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,y,b),e.closePath(),e.fillStrokeShape(this)),v)if(d){const _=d[n],C=s*2;e.drawImage(v,f,p,y,b,_[C+0],_[C+1],y,b)}else e.drawImage(v,f,p,y,b,0,0,y,b)}_hitFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+2],p=o[i+3];if(e.beginPath(),d){const y=d[n],b=s*2;e.rect(y[b+0],y[b+1],f,p)}else e.rect(0,0,f,p);e.closePath(),e.fillShape(this)}_useBufferCanvas(){return super._useBufferCanvas(!0)}_setInterval(){const e=this;this.interval=setInterval(function(){e._updateIndex()},1e3/this.frameRate())}start(){if(this.isRunning())return;const e=this.getLayer();this.anim.setLayers(e),this._setInterval(),this.anim.start()}stop(){this.anim.stop(),clearInterval(this.interval)}isRunning(){return this.anim.isRunning()}_updateIndex(){const e=this.frameIndex(),n=this.animation(),s=this.animations(),i=s[n],o=i.length/4;e<o-1?this.frameIndex(e+1):this.frameIndex(0)}}vl.prototype.className="Sprite";ea(vl);K.addGetterSetter(vl,"animation");K.addGetterSetter(vl,"animations");K.addGetterSetter(vl,"frameOffsets");K.addGetterSetter(vl,"image");K.addGetterSetter(vl,"frameIndex",0,Re());K.addGetterSetter(vl,"frameRate",17,Re());K.backCompat(vl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Bc extends Ee{_sceneFunc(e){const n=this.innerRadius(),s=this.outerRadius(),i=this.numPoints();e.beginPath(),e.moveTo(0,0-s);for(let o=1;o<i*2;o++){const d=o%2===0?s:n,f=d*Math.sin(o*Math.PI/i),p=-1*d*Math.cos(o*Math.PI/i);e.lineTo(f,p)}e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.outerRadius()*2}getHeight(){return this.outerRadius()*2}setWidth(e){this.outerRadius(e/2)}setHeight(e){this.outerRadius(e/2)}}Bc.prototype.className="Star";Bc.prototype._centroid=!0;Bc.prototype._attrsAffectingSize=["innerRadius","outerRadius"];ea(Bc);K.addGetterSetter(Bc,"numPoints",5,Re());K.addGetterSetter(Bc,"innerRadius",0,Re());K.addGetterSetter(Bc,"outerRadius",0,Re());function yc(t){return[...t].reduce((e,n,s,i)=>{if(new RegExp("\\p{Emoji}","u").test(n)){const o=i[s+1];o&&new RegExp("\\p{Emoji_Modifier}|\\u200D","u").test(o)?(e.push(n+o),i[s+1]=""):e.push(n)}else new RegExp("\\p{Regional_Indicator}{2}","u").test(n+(i[s+1]||""))?e.push(n+i[s+1]):s>0&&new RegExp("\\p{Mn}|\\p{Me}|\\p{Mc}","u").test(n)?e[e.length-1]+=n:n&&e.push(n);return e},[])}const Tf="auto",kz="center",G8="inherit",sm="justify",Lz="Change.konva",Uz="2d",k5="-",P8="left",qz="text",Hz="Text",Bz="top",Gz="bottom",L5="middle",Y8="normal",Pz="px ",l1=" ",Yz="right",U5="rtl",Vz="word",Qz="char",q5="none",Ex="…",V8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],Kz=V8.length;function Xz(t){return t.split(",").map(e=>{e=e.trim();const n=e.indexOf(" ")>=0,s=e.indexOf('"')>=0||e.indexOf("'")>=0;return n&&!s&&(e=`"${e}"`),e}).join(", ")}let o1;function Tx(){return o1||(o1=ee.createCanvasElement().getContext(Uz),o1)}function Fz(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function Zz(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function Iz(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let wn=class extends Ee{constructor(e){super(Iz(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<Kz;n++)this.on(V8[n]+Lz,this._setTextData);this._setTextData()}_sceneFunc(e){var n,s;const i=this.textArr,o=i.length;if(!this.text())return;let d=this.padding(),f=this.fontSize(),p=this.lineHeight()*f,y=this.verticalAlign(),b=this.direction(),v=0,_=this.align(),C=this.getWidth(),w=this.letterSpacing(),T=this.charRenderFunc(),R=this.fill(),O=this.textDecoration(),M=this.underlineOffset(),z=O.indexOf("underline")!==-1,k=O.indexOf("line-through")!==-1,P;b=b===G8?e.direction:b;let q=p/2,L=L5;if(!De.legacyTextRendering){const U=this.measureSize("M");L="alphabetic";const V=(n=U.fontBoundingBoxAscent)!==null&&n!==void 0?n:U.actualBoundingBoxAscent,F=(s=U.fontBoundingBoxDescent)!==null&&s!==void 0?s:U.actualBoundingBoxDescent;q=(V-F)/2+p/2}for(b===U5&&e.setAttr("direction",b),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",L),e.setAttr("textAlign",P8),y===L5?v=(this.getHeight()-o*p-d*2)/2:y===Gz&&(v=this.getHeight()-o*p-d*2),e.translate(d,v+d),P=0;P<o;P++){let U=0,V=0;const F=i[P],re=F.text,ne=F.width,J=F.lastInParagraph;if(e.save(),_===Yz?U+=C-ne-d*2:_===kz&&(U+=(C-ne-d*2)/2),z){e.save(),e.beginPath();const ce=M??(De.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Y=U,$=q+V+ce;e.moveTo(Y,$);const ae=_===sm&&!J?C-d*2:ne;e.lineTo(Y+Math.round(ae),$),e.lineWidth=f/15;const je=this._getLinearGradient();e.strokeStyle=je||R,e.stroke(),e.restore()}const ie=U;if(b!==U5&&(w!==0||_===sm||T)){const ce=re.split(" ").length-1,Y=yc(re);for(let $=0;$<Y.length;$++){const ae=Y[$];if(ae===" "&&!J&&_===sm&&(U+=(C-d*2-ne)/ce),this._partialTextX=U,this._partialTextY=q+V,this._partialText=ae,T){e.save();const he=i.slice(0,P).reduce((W,fe)=>W+yc(fe.text).length,0),G=$+he;T({char:ae,index:G,x:U,y:q+V,lineIndex:P,column:$,isLastInLine:J,width:this.measureSize(ae).width,context:e})}e.fillStrokeShape(this),T&&e.restore(),U+=this.measureSize(ae).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=U,this._partialTextY=q+V,this._partialText=re,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const ce=De.legacyTextRendering?0:-Math.round(f/4),Y=ie;e.moveTo(Y,q+V+ce);const $=_===sm&&!J?C-d*2:ne;e.lineTo(Y+Math.round($),q+V+ce),e.lineWidth=f/15;const ae=this._getLinearGradient();e.strokeStyle=ae||R,e.stroke(),e.restore()}e.restore(),o>1&&(q+=p)}}_hitFunc(e){const n=this.getWidth(),s=this.getHeight();e.beginPath(),e.rect(0,0,n,s),e.closePath(),e.fillStrokeShape(this)}setText(e){const n=ee._isString(e)?e:e==null?"":e+"";return this._setAttr(qz,n),this}getWidth(){return this.attrs.width===Tf||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Tf||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}measureSize(e){var n,s,i,o,d,f,p,y,b,v,_;let C=Tx(),w=this.fontSize(),T;C.save(),C.font=this._getContextFont(),T=C.measureText(e),C.restore();const R=w/100;return{actualBoundingBoxAscent:(n=T.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*R,actualBoundingBoxDescent:(s=T.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(i=T.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*R,actualBoundingBoxRight:(o=T.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*R,alphabeticBaseline:(d=T.alphabeticBaseline)!==null&&d!==void 0?d:0,emHeightAscent:(f=T.emHeightAscent)!==null&&f!==void 0?f:100*R,emHeightDescent:(p=T.emHeightDescent)!==null&&p!==void 0?p:-20*R,fontBoundingBoxAscent:(y=T.fontBoundingBoxAscent)!==null&&y!==void 0?y:91*R,fontBoundingBoxDescent:(b=T.fontBoundingBoxDescent)!==null&&b!==void 0?b:21*R,hangingBaseline:(v=T.hangingBaseline)!==null&&v!==void 0?v:72.80000305175781*R,ideographicBaseline:(_=T.ideographicBaseline)!==null&&_!==void 0?_:-21*R,width:T.width,height:w}}_getContextFont(){return this.fontStyle()+l1+this.fontVariant()+l1+(this.fontSize()+Pz)+Xz(this.fontFamily())}_addTextLine(e){this.align()===sm&&(e=e.trim());const s=this._getTextWidth(e);return this.textArr.push({text:e,width:s,lastInParagraph:!1})}_getTextWidth(e){const n=this.letterSpacing(),s=e.length;return Tx().measureText(e).width+n*s}_setTextData(){let e=this.text().split(`
|
|
579
|
-
`),n=+this.fontSize(),s=0,i=this.lineHeight()*n,o=this.attrs.width,d=this.attrs.height,f=o!==Tf&&o!==void 0,p=d!==Tf&&d!==void 0,y=this.padding(),b=o-y*2,v=d-y*2,_=0,C=this.wrap(),w=C!==q5,T=C!==Qz&&w,R=this.ellipsis();this.textArr=[],Tx().font=this._getContextFont();const O=R?this._getTextWidth(Ex):0;for(let M=0,z=e.length;M<z;++M){let k=e[M],P=this._getTextWidth(k);if(f&&P>b)for(;k.length>0;){let q=0,L=yc(k).length,U="",V=0;for(;q<L;){const F=q+L>>>1,re=yc(k),ne=re.slice(0,F+1).join(""),J=this._getTextWidth(ne);(R&&p&&_+i>v?J+O:J)<=b?(q=F+1,U=ne,V=J):L=F}if(U){if(T){const ne=yc(k),J=yc(U),ie=ne[J.length],ce=ie===l1||ie===k5;let Y;if(ce&&V<=b)Y=J.length;else{const $=J.lastIndexOf(l1),ae=J.lastIndexOf(k5);Y=Math.max($,ae)+1}Y>0&&(q=Y,U=ne.slice(0,q).join(""),V=this._getTextWidth(U))}if(U=U.trimRight(),this._addTextLine(U),s=Math.max(s,V),_+=i,this._shouldHandleEllipsis(_)){this._tryToAddEllipsisToLastLine();break}if(k=yc(k).slice(q).join("").trimLeft(),k.length>0&&(P=this._getTextWidth(k),P<=b)){this._addTextLine(k),_+=i,s=Math.max(s,P);break}}else break}else this._addTextLine(k),_+=i,s=Math.max(s,P),this._shouldHandleEllipsis(_)&&M<z-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),p&&_+i>v)break}this.textHeight=n,this.textWidth=s}_shouldHandleEllipsis(e){const n=+this.fontSize(),s=this.lineHeight()*n,i=this.attrs.height,o=i!==Tf&&i!==void 0,d=this.padding(),f=i-d*2;return!(this.wrap()!==q5)||o&&e+s>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Tf&&e!==void 0,s=this.padding(),i=e-s*2,o=this.ellipsis(),d=this.textArr[this.textArr.length-1];!d||!o||(n&&(this._getTextWidth(d.text+Ex)<i||(d.text=d.text.slice(0,d.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(d.text+Ex))}getStrokeScaleEnabled(){return!0}_useBufferCanvas(){const e=this.textDecoration().indexOf("underline")!==-1||this.textDecoration().indexOf("line-through")!==-1,n=this.hasShadow();return e&&n?!0:super._useBufferCanvas()}};wn.prototype._fillFunc=Fz;wn.prototype._strokeFunc=Zz;wn.prototype.className=Hz;wn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];ea(wn);K.overWriteSetter(wn,"width",Rv());K.overWriteSetter(wn,"height",Rv());K.addGetterSetter(wn,"direction",G8);K.addGetterSetter(wn,"fontFamily","Arial");K.addGetterSetter(wn,"fontSize",12,Re());K.addGetterSetter(wn,"fontStyle",Y8);K.addGetterSetter(wn,"fontVariant",Y8);K.addGetterSetter(wn,"padding",0,Re());K.addGetterSetter(wn,"align",P8);K.addGetterSetter(wn,"verticalAlign",Bz);K.addGetterSetter(wn,"lineHeight",1,Re());K.addGetterSetter(wn,"wrap",Vz);K.addGetterSetter(wn,"ellipsis",!1,Oi());K.addGetterSetter(wn,"letterSpacing",0,Re());K.addGetterSetter(wn,"text","",rd());K.addGetterSetter(wn,"textDecoration","");K.addGetterSetter(wn,"underlineOffset",void 0,Re());K.addGetterSetter(wn,"charRenderFunc",void 0);const Jz="",Q8="normal";function K8(t){t.fillText(this.partialText,0,0)}function X8(t){t.strokeText(this.partialText,0,0)}class Ua extends Ee{constructor(e){super(e),this.dummyCanvas=ee.createCanvasElement(),this.dataArray=[],this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute(),this._setTextData()}),this.on("textChange.konva alignChange.konva letterSpacingChange.konva kerningFuncChange.konva fontSizeChange.konva fontFamilyChange.konva",this._setTextData),this._setTextData()}_getTextPathLength(){return jn.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:jn.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=jn.parsePathData(this.attrs.data),this.pathLength=this._getTextPathLength()}_sceneFunc(e){e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",this.textBaseline()),e.setAttr("textAlign","left"),e.save();const n=this.textDecoration(),s=this.fill(),i=this.fontSize(),o=this.glyphInfo,d=n.indexOf("underline")!==-1,f=n.indexOf("line-through")!==-1;d&&e.beginPath();for(let p=0;p<o.length;p++){e.save();const y=o[p].p0;e.translate(y.x,y.y),e.rotate(o[p].rotation),this.partialText=o[p].text,e.fillStrokeShape(this),d&&(p===0&&e.moveTo(0,i/2+1),e.lineTo(o[p].width,i/2+1)),e.restore()}if(d&&(e.strokeStyle=s,e.lineWidth=i/20,e.stroke()),f){e.beginPath();for(let p=0;p<o.length;p++){e.save();const y=o[p].p0;e.translate(y.x,y.y),e.rotate(o[p].rotation),p===0&&e.moveTo(0,0),e.lineTo(o[p].width,0),e.restore()}e.strokeStyle=s,e.lineWidth=i/20,e.stroke()}e.restore()}_hitFunc(e){e.beginPath();const n=this.glyphInfo;if(n.length>=1){const s=n[0].p0;e.moveTo(s.x,s.y)}for(let s=0;s<n.length;s++){const i=n[s].p1;e.lineTo(i.x,i.y)}e.setAttr("lineWidth",this.fontSize()),e.setAttr("strokeStyle",this.colorKey),e.stroke()}getTextWidth(){return this.textWidth}getTextHeight(){return ee.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return wn.prototype.setText.call(this,e)}_getContextFont(){return wn.prototype._getContextFont.call(this)}_getTextSize(e){const s=this.dummyCanvas.getContext("2d");s.save(),s.font=this._getContextFont();const i=s.measureText(e);return s.restore(),{width:i.width,height:parseInt(`${this.fontSize()}`,10)}}_setTextData(){const e=yc(this.text()),n=[];let s=0;for(let C=0;C<e.length;C++)n.push({char:e[C],width:this._getTextSize(e[C]).width}),s+=n[C].width;const{width:i,height:o}=this._getTextSize(this.attrs.text);if(this.textWidth=s,this.textHeight=o,this.glyphInfo=[],!this.attrs.data)return null;const d=this.letterSpacing(),f=this.align(),p=this.kerningFunc(),y=Math.max(0,s-i),b=Math.max(this.textWidth+((this.attrs.text||"").length-1)*d,0);let v=0;f==="center"&&(v=Math.max(0,this.pathLength/2-b/2)),f==="right"&&(v=Math.max(0,this.pathLength-b));let _=v;for(let C=0;C<n.length;C++){const w=this._getPointAtLength(_);if(!w)return;const T=n[C].char;let R=n[C].width+d;if(T===" "&&f==="justify"){const L=this.text().split(" ").length-1;R+=(this.pathLength-b)/L}const O=_+R,M=this._getPointAtLength(O>this.pathLength&&O-this.pathLength<=y?this.pathLength:O);if(!M)return;const z=jn.getLineLength(w.x,w.y,M.x,M.y);let k=0;if(p)try{k=p(n[C-1].char,T)*this.fontSize()}catch{k=0}w.x+=k,M.x+=k,this.textWidth+=k;const P=jn.getPointOnLine(k+z/2,w.x,w.y,M.x,M.y),q=Math.atan2(M.y-w.y,M.x-w.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:e[C],rotation:q,p0:w,p1:M,width:z}),_+=R}}getSelfRect(){if(!this.glyphInfo.length)return{x:0,y:0,width:0,height:0};const e=[];this.glyphInfo.forEach(function(y){e.push(y.p0.x),e.push(y.p0.y),e.push(y.p1.x),e.push(y.p1.y)});let n=e[0]||0,s=e[0]||0,i=e[1]||0,o=e[1]||0,d,f;for(let y=0;y<e.length/2;y++)d=e[y*2],f=e[y*2+1],n=Math.min(n,d),s=Math.max(s,d),i=Math.min(i,f),o=Math.max(o,f);const p=this.fontSize();return{x:n-p/2,y:i-p/2,width:s-n+p,height:o-i+p}}destroy(){return ee.releaseCanvas(this.dummyCanvas),super.destroy()}}Ua.prototype._fillFunc=K8;Ua.prototype._strokeFunc=X8;Ua.prototype._fillFuncHit=K8;Ua.prototype._strokeFuncHit=X8;Ua.prototype.className="TextPath";Ua.prototype._attrsAffectingSize=["text","fontSize","data"];ea(Ua);K.addGetterSetter(Ua,"data");K.addGetterSetter(Ua,"fontFamily","Arial");K.addGetterSetter(Ua,"fontSize",12,Re());K.addGetterSetter(Ua,"fontStyle",Q8);K.addGetterSetter(Ua,"align","left");K.addGetterSetter(Ua,"letterSpacing",0,Re());K.addGetterSetter(Ua,"textBaseline","middle");K.addGetterSetter(Ua,"fontVariant",Q8);K.addGetterSetter(Ua,"text",Jz);K.addGetterSetter(Ua,"textDecoration","");K.addGetterSetter(Ua,"kerningFunc",void 0);const F8="tr-konva",Wz=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${F8}`).join(" "),H5="nodesRect",$z=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],ek={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},tk="ontouchstart"in De._global;function nk(t,e,n){if(t==="rotater")return n;e+=ee.degToRad(ek[t]||0);const s=(ee.radToDeg(e)%360+360)%360;return ee._inRange(s,315+22.5,360)||ee._inRange(s,0,22.5)?"ns-resize":ee._inRange(s,45-22.5,45+22.5)?"nesw-resize":ee._inRange(s,90-22.5,90+22.5)?"ew-resize":ee._inRange(s,135-22.5,135+22.5)?"nwse-resize":ee._inRange(s,180-22.5,180+22.5)?"ns-resize":ee._inRange(s,225-22.5,225+22.5)?"nesw-resize":ee._inRange(s,270-22.5,270+22.5)?"ew-resize":ee._inRange(s,315-22.5,315+22.5)?"nwse-resize":(ee.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const D1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function ak(t){return{x:t.x+t.width/2*Math.cos(t.rotation)+t.height/2*Math.sin(-t.rotation),y:t.y+t.height/2*Math.cos(t.rotation)+t.width/2*Math.sin(t.rotation)}}function Z8(t,e,n){const s=n.x+(t.x-n.x)*Math.cos(e)-(t.y-n.y)*Math.sin(e),i=n.y+(t.x-n.x)*Math.sin(e)+(t.y-n.y)*Math.cos(e);return{...t,rotation:t.rotation+e,x:s,y:i}}function sk(t,e){const n=ak(t);return Z8(t,e,n)}function rk(t,e,n){let s=e;for(let i=0;i<t.length;i++){const o=De.getAngle(t[i]),d=Math.abs(o-e)%(Math.PI*2);Math.min(d,Math.PI*2-d)<n&&(s=o)}return s}let Ub=0;class Lt extends nh{constructor(e){super(e),this._movingAnchorName=null,this._transforming=!1,this._elementsCreated=!1,this._createElements(),this._handleMouseMove=this._handleMouseMove.bind(this),this._handleMouseUp=this._handleMouseUp.bind(this),this.update=this.update.bind(this),this.on(Wz,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return ee.warn("tr.setNode(shape), tr.node(shape) and tr.attachTo(shape) methods are deprecated. Please use tr.nodes(nodesArray) instead."),this.setNodes([e])}getNode(){return this._nodes&&this._nodes[0]}_getEventNamespace(){return F8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(ee.error("Konva.Transformer cannot be an a child of the node you are trying to attach"),!1):!0);return this._nodes=e=n,e.length===1&&this.useSingleNodeRotation()?this.rotation(e[0].getAbsoluteRotation()):this.rotation(0),this._nodes.forEach(i=>{const o=()=>{this.nodes().length===1&&this.useSingleNodeRotation()&&this.rotation(this.nodes()[0].getAbsoluteRotation()),this._resetTransformCache(),!this._transforming&&!this.isDragging()&&this.update()};if(i._attrsAffectingSize.length){const d=i._attrsAffectingSize.map(f=>f+"Change."+this._getEventNamespace()).join(" ");i.on(d,o)}i.on($z.map(d=>d+`.${this._getEventNamespace()}`).join(" "),o),i.on(`absoluteTransformChange.${this._getEventNamespace()}`,o),this._proxyDrag(i)}),this._resetTransformCache(),!!this.findOne(".top-left")&&this.update(),this}_proxyDrag(e){let n;e.on(`dragstart.${this._getEventNamespace()}`,s=>{n=e.getAbsolutePosition(),!this.isDragging()&&e!==this.findOne(".back")&&this.startDrag(s,!1)}),e.on(`dragmove.${this._getEventNamespace()}`,s=>{if(!n)return;const i=e.getAbsolutePosition(),o=i.x-n.x,d=i.y-n.y;this.nodes().forEach(f=>{if(f===e||f.isDragging())return;const p=f.getAbsolutePosition();f.setAbsolutePosition({x:p.x+o,y:p.y+d}),f.startDrag(s)}),n=null})}getNodes(){return this._nodes||[]}getActiveAnchor(){return this._movingAnchorName}detach(){this._nodes&&this._nodes.forEach(e=>{e.off("."+this._getEventNamespace())}),this._nodes=[],this._resetTransformCache()}_resetTransformCache(){this._clearCache(H5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(H5,this.__getNodeRect)}__getNodeShape(e,n=this.rotation(),s){const i=e.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),o=e.getAbsoluteScale(s),d=e.getAbsolutePosition(s),f=i.x*o.x-e.offsetX()*o.x,p=i.y*o.y-e.offsetY()*o.y,y=(De.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),b={x:d.x+f*Math.cos(y)+p*Math.sin(-y),y:d.y+p*Math.cos(y)+f*Math.sin(y),width:i.width*o.x,height:i.height*o.y,rotation:y};return Z8(b,-De.getAngle(n),{x:0,y:0})}__getNodeRect(){if(!this.getNode())return{x:-1e8,y:-1e8,width:0,height:0,rotation:0};const n=[];this.nodes().map(y=>{const b=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),v=[{x:b.x,y:b.y},{x:b.x+b.width,y:b.y},{x:b.x+b.width,y:b.y+b.height},{x:b.x,y:b.y+b.height}],_=y.getAbsoluteTransform();v.forEach(function(C){const w=_.point(C);n.push(w)})});const s=new jr;s.rotate(-De.getAngle(this.rotation()));let i=1/0,o=1/0,d=-1/0,f=-1/0;n.forEach(function(y){const b=s.point(y);i===void 0&&(i=d=b.x,o=f=b.y),i=Math.min(i,b.x),o=Math.min(o,b.y),d=Math.max(d,b.x),f=Math.max(f,b.y)}),s.invert();const p=s.point({x:i,y:o});return{x:p.x,y:p.y,width:d-i,height:f-o,rotation:De.getAngle(this.rotation())}}getX(){return this._getNodeRect().x}getY(){return this._getNodeRect().y}getWidth(){return this._getNodeRect().width}getHeight(){return this._getNodeRect().height}_createElements(){this._createBack(),D1.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new Wm({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:tk?10:"auto"}),s=this;n.on("mousedown touchstart",function(i){s._handleMouseDown(i)}),n.on("dragstart",i=>{n.stopDrag(),i.cancelBubble=!0}),n.on("dragend",i=>{i.cancelBubble=!0}),n.on("mouseenter",()=>{const i=De.getAngle(this.rotation()),o=this.rotateAnchorCursor(),d=nk(e,i,o);n.getStage().content&&(n.getStage().content.style.cursor=d),this._cursorChange=!0}),n.on("mouseout",()=>{n.getStage().content&&(n.getStage().content.style.cursor=""),this._cursorChange=!1}),this.add(n)}_createBack(){const e=new Ee({name:"back",width:0,height:0,sceneFunc(n,s){const i=s.getParent(),o=i.padding(),d=s.width(),f=s.height();if(n.beginPath(),n.rect(-o,-o,d+o*2,f+o*2),i.rotateEnabled()&&i.rotateLineVisible()){const p=i.rotateAnchorAngle(),y=i.rotateAnchorOffset(),b=ee.degToRad(p),v=Math.sin(b),_=-Math.cos(b),C=d/2,w=f/2;let T=1/0;_<0?T=Math.min(T,-w/_):_>0&&(T=Math.min(T,(f-w)/_)),v<0?T=Math.min(T,-C/v):v>0&&(T=Math.min(T,(d-C)/v));const R=C+v*T,O=w+_*T,M=ee._sign(f),z=R+v*y*M,k=O+_*y*M;n.moveTo(R,O),n.lineTo(z,k)}n.fillStrokeShape(s)},hitFunc:(n,s)=>{if(!this.shouldOverdrawWholeArea())return;const i=this.padding();n.beginPath(),n.rect(-i,-i,s.width()+i*2,s.height()+i*2),n.fillStrokeShape(s)}});this.add(e),this._proxyDrag(e),e.on("dragstart",n=>{n.cancelBubble=!0}),e.on("dragmove",n=>{n.cancelBubble=!0}),e.on("dragend",n=>{n.cancelBubble=!0}),this.on("dragmove",n=>{this.update()})}_handleMouseDown(e){if(this._transforming)return;this._movingAnchorName=e.target.name().split(" ")[0];const n=this._getNodeRect(),s=n.width,i=n.height,o=Math.sqrt(Math.pow(s,2)+Math.pow(i,2));this.sin=Math.abs(i/o),this.cos=Math.abs(s/o),typeof window<"u"&&(window.addEventListener("mousemove",this._handleMouseMove),window.addEventListener("touchmove",this._handleMouseMove),window.addEventListener("mouseup",this._handleMouseUp,!0),window.addEventListener("touchend",this._handleMouseUp,!0)),this._transforming=!0;const d=e.target.getAbsolutePosition(),f=e.target.getStage().getPointerPosition();this._anchorDragOffset={x:f.x-d.x,y:f.y-d.y},Ub++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(p=>{p._fire("transformstart",{evt:e.evt,target:p})})}_handleMouseMove(e){let n,s,i;const o=this.findOne("."+this._movingAnchorName),d=o.getStage();d.setPointersPositions(e);const f=d.getPointerPosition();let p={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const y=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(p=this.anchorDragBoundFunc()(y,p,e)),o.setAbsolutePosition(p);const b=o.getAbsolutePosition();if(y.x===b.x&&y.y===b.y)return;if(this._movingAnchorName==="rotater"){const M=this._getNodeRect();n=o.x()-M.width/2,s=-o.y()+M.height/2;const z=De.getAngle(this.rotateAnchorAngle());let k=Math.atan2(-s,n)+Math.PI/2-z;M.height<0&&(k-=Math.PI);const q=De.getAngle(this.rotation())+k,L=De.getAngle(this.rotationSnapTolerance()),V=rk(this.rotationSnaps(),q,L)-M.rotation,F=sk(M,V);this._fitNodesInto(F,e);return}const v=this.shiftBehavior();let _;v==="inverted"?_=this.keepRatio()&&!e.shiftKey:v==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;let C=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-right").x(),y:this.findOne(".bottom-right").y()};i=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(M.y-o.y(),2));const z=this.findOne(".top-left").x()>M.x?-1:1,k=this.findOne(".top-left").y()>M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-left").x(M.x-n),this.findOne(".top-left").y(M.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(_){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".bottom-left").x(),y:this.findOne(".bottom-left").y()};i=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(M.y-o.y(),2));const z=this.findOne(".top-right").x()<M.x?-1:1,k=this.findOne(".top-right").y()>M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-right").x(M.x+n),this.findOne(".top-right").y(M.y-s)}var w=o.position();this.findOne(".top-left").y(w.y),this.findOne(".bottom-right").x(w.x)}else if(this._movingAnchorName==="middle-left")this.findOne(".top-left").x(o.x());else if(this._movingAnchorName==="middle-right")this.findOne(".bottom-right").x(o.x());else if(this._movingAnchorName==="bottom-left"){if(_){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-right").x(),y:this.findOne(".top-right").y()};i=Math.sqrt(Math.pow(M.x-o.x(),2)+Math.pow(o.y()-M.y,2));const z=M.x<o.x()?-1:1,k=o.y()<M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,o.x(M.x-n),o.y(M.y+s)}w=o.position(),this.findOne(".top-left").x(w.x),this.findOne(".bottom-right").y(w.y)}else if(this._movingAnchorName==="bottom-center")this.findOne(".bottom-right").y(o.y());else if(this._movingAnchorName==="bottom-right"){if(_){const M=C?{x:this.width()/2,y:this.height()/2}:{x:this.findOne(".top-left").x(),y:this.findOne(".top-left").y()};i=Math.sqrt(Math.pow(o.x()-M.x,2)+Math.pow(o.y()-M.y,2));const z=this.findOne(".bottom-right").x()<M.x?-1:1,k=this.findOne(".bottom-right").y()<M.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".bottom-right").x(M.x+n),this.findOne(".bottom-right").y(M.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(C=this.centeredScaling()||e.altKey,C){const M=this.findOne(".top-left"),z=this.findOne(".bottom-right"),k=M.x(),P=M.y(),q=this.getWidth()-z.x(),L=this.getHeight()-z.y();z.move({x:-k,y:-P}),M.move({x:q,y:L})}const T=this.findOne(".top-left").getAbsolutePosition();n=T.x,s=T.y;const R=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),O=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:s,width:R,height:O,rotation:De.getAngle(this.rotation())},e)}_handleMouseUp(e){this._removeEvents(e)}getAbsoluteTransform(){return this.getTransform()}_removeEvents(e){var n;if(this._transforming){this._transforming=!1,typeof window<"u"&&(window.removeEventListener("mousemove",this._handleMouseMove),window.removeEventListener("touchmove",this._handleMouseMove),window.removeEventListener("mouseup",this._handleMouseUp,!0),window.removeEventListener("touchend",this._handleMouseUp,!0));const s=this.getNode();Ub--,this._fire("transformend",{evt:e,target:s}),(n=this.getLayer())===null||n===void 0||n.batchDraw(),s&&this._nodes.forEach(i=>{var o;i._fire("transformend",{evt:e,target:i}),(o=i.getLayer())===null||o===void 0||o.batchDraw()}),this._movingAnchorName=null}}_fitNodesInto(e,n){const s=this._getNodeRect(),i=1;if(ee._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(ee._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new jr;if(o.rotate(De.getAngle(this.rotation())),this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("left")>=0){const _=o.point({x:-this.padding()*2,y:0});e.x+=_.x,e.y+=_.y,e.width+=this.padding()*2,this._movingAnchorName=this._movingAnchorName.replace("left","right"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y}else if(this._movingAnchorName&&e.width<0&&this._movingAnchorName.indexOf("right")>=0){const _=o.point({x:this.padding()*2,y:0});this._movingAnchorName=this._movingAnchorName.replace("right","left"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.width+=this.padding()*2}if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("top")>=0){const _=o.point({x:0,y:-this.padding()*2});e.x+=_.x,e.y+=_.y,this._movingAnchorName=this._movingAnchorName.replace("top","bottom"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}else if(this._movingAnchorName&&e.height<0&&this._movingAnchorName.indexOf("bottom")>=0){const _=o.point({x:0,y:this.padding()*2});this._movingAnchorName=this._movingAnchorName.replace("bottom","top"),this._anchorDragOffset.x-=_.x,this._anchorDragOffset.y-=_.y,e.height+=this.padding()*2}if(this.boundBoxFunc()){const _=this.boundBoxFunc()(s,e);_?e=_:ee.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const d=1e7,f=new jr;f.translate(s.x,s.y),f.rotate(s.rotation),f.scale(s.width/d,s.height/d);const p=new jr,y=e.width/d,b=e.height/d;this.flipEnabled()===!1?(p.translate(e.x,e.y),p.rotate(e.rotation),p.translate(e.width<0?e.width:0,e.height<0?e.height:0),p.scale(Math.abs(y),Math.abs(b))):(p.translate(e.x,e.y),p.rotate(e.rotation),p.scale(y,b));const v=p.multiply(f.invert());this._nodes.forEach(_=>{var C;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),T=_.getTransform().copy();T.translate(_.offsetX(),_.offsetY());const R=new jr;R.multiply(w.copy().invert()).multiply(v).multiply(w).multiply(T);const O=R.decompose();_.setAttrs(O),(C=_.getLayer())===null||C===void 0||C.batchDraw()}),this.rotation(ee._getRotation(e.rotation)),this._nodes.forEach(_=>{this._fire("transform",{evt:n,target:_}),_._fire("transform",{evt:n,target:_})}),this._resetTransformCache(),this.update(),this.getLayer().batchDraw()}forceUpdate(){this._resetTransformCache(),this.update()}_batchChangeChild(e,n){this.findOne(e).setAttrs(n)}update(){var e;const n=this._getNodeRect();this.rotation(ee._getRotation(n.rotation));const s=n.width,i=n.height,o=this.enabledAnchors(),d=this.resizeEnabled(),f=this.padding(),p=this.anchorSize(),y=this.find("._anchor");y.forEach(q=>{q.setAttrs({width:p,height:p,offsetX:p/2,offsetY:p/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:p/2+f,offsetY:p/2+f,visible:d&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:p/2+f,visible:d&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:p/2-f,offsetY:p/2+f,visible:d&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:p/2+f,visible:d&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:i/2,offsetX:p/2-f,visible:d&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:p/2+f,offsetY:p/2-f,visible:d&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:i,offsetY:p/2-f,visible:d&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:i,offsetX:p/2-f,offsetY:p/2-f,visible:d&&o.indexOf("bottom-right")>=0});const b=this.rotateAnchorAngle(),v=this.rotateAnchorOffset(),_=ee.degToRad(b),C=Math.sin(_),w=-Math.cos(_),T=s/2,R=i/2;let O=1/0;w<0?O=Math.min(O,-R/w):w>0&&(O=Math.min(O,(i-R)/w)),C<0?O=Math.min(O,-T/C):C>0&&(O=Math.min(O,(s-T)/C));const M=T+C*O,z=R+w*O,k=ee._sign(i);this._batchChangeChild(".rotater",{x:M+C*v*k,y:z+w*v*k-f*w,visible:this.rotateEnabled()}),this._batchChangeChild(".back",{width:s,height:i,visible:this.borderEnabled(),stroke:this.borderStroke(),strokeWidth:this.borderStrokeWidth(),dash:this.borderDash(),draggable:this.nodes().some(q=>q.draggable()),x:0,y:0});const P=this.anchorStyleFunc();P&&y.forEach(q=>{P(q)}),(e=this.getLayer())===null||e===void 0||e.batchDraw()}isTransforming(){return this._transforming}stopTransform(){if(this._transforming){this._removeEvents();const e=this.findOne("."+this._movingAnchorName);e&&e.stopDrag()}}destroy(){return this.getStage()&&this._cursorChange&&this.getStage().content&&(this.getStage().content.style.cursor=""),nh.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(ee.error("You cannot add external nodes to the Transformer. Use tr.nodes([node]) instead."),this):super.add(...e)}toObject(){return Ae.prototype.toObject.call(this)}clone(e){return Ae.prototype.clone.call(this,e)}getClientRect(){return this.nodes().length>0?super.getClientRect():{x:0,y:0,width:0,height:0}}}Lt.isTransforming=()=>Ub>0;function ik(t){return t instanceof Array||ee.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){D1.indexOf(e)===-1&&ee.warn("Unknown anchor name: "+e+". Available names are: "+D1.join(", "))}),t||[]}Lt.prototype.className="Transformer";ea(Lt);K.addGetterSetter(Lt,"enabledAnchors",D1,ik);K.addGetterSetter(Lt,"flipEnabled",!0,Oi());K.addGetterSetter(Lt,"resizeEnabled",!0);K.addGetterSetter(Lt,"anchorSize",10,Re());K.addGetterSetter(Lt,"rotateEnabled",!0);K.addGetterSetter(Lt,"rotateLineVisible",!0);K.addGetterSetter(Lt,"rotationSnaps",[]);K.addGetterSetter(Lt,"rotateAnchorOffset",50,Re());K.addGetterSetter(Lt,"rotateAnchorAngle",0,Re());K.addGetterSetter(Lt,"rotateAnchorCursor","crosshair");K.addGetterSetter(Lt,"rotationSnapTolerance",5,Re());K.addGetterSetter(Lt,"borderEnabled",!0);K.addGetterSetter(Lt,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"anchorStrokeWidth",1,Re());K.addGetterSetter(Lt,"anchorFill","white");K.addGetterSetter(Lt,"anchorCornerRadius",0,Re());K.addGetterSetter(Lt,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"borderStrokeWidth",1,Re());K.addGetterSetter(Lt,"borderDash");K.addGetterSetter(Lt,"keepRatio",!0);K.addGetterSetter(Lt,"shiftBehavior","default");K.addGetterSetter(Lt,"centeredScaling",!1);K.addGetterSetter(Lt,"ignoreStroke",!1);K.addGetterSetter(Lt,"padding",0,Re());K.addGetterSetter(Lt,"nodes");K.addGetterSetter(Lt,"node");K.addGetterSetter(Lt,"boundBoxFunc");K.addGetterSetter(Lt,"anchorDragBoundFunc");K.addGetterSetter(Lt,"anchorStyleFunc");K.addGetterSetter(Lt,"shouldOverdrawWholeArea",!1);K.addGetterSetter(Lt,"useSingleNodeRotation",!0);K.backCompat(Lt,{lineEnabled:"borderEnabled",rotateHandlerOffset:"rotateAnchorOffset",enabledHandlers:"enabledAnchors"});class yo extends Ee{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,De.getAngle(this.angle()),this.clockwise()),e.lineTo(0,0),e.closePath(),e.fillStrokeShape(this)}getWidth(){return this.radius()*2}getHeight(){return this.radius()*2}setWidth(e){this.radius(e/2)}setHeight(e){this.radius(e/2)}}yo.prototype.className="Wedge";yo.prototype._centroid=!0;yo.prototype._attrsAffectingSize=["radius"];ea(yo);K.addGetterSetter(yo,"radius",0,Re());K.addGetterSetter(yo,"angle",0,Re());K.addGetterSetter(yo,"clockwise",!1);K.backCompat(yo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function B5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const lk=[512,512,456,512,328,456,335,512,405,328,271,456,388,335,292,512,454,405,364,328,298,271,496,456,420,388,360,335,312,292,273,512,482,454,428,405,383,364,345,328,312,298,284,271,259,496,475,456,437,420,404,388,374,360,347,335,323,312,302,292,282,273,265,512,497,482,468,454,441,428,417,405,394,383,373,364,354,345,337,328,320,312,305,298,291,284,278,271,265,259,507,496,485,475,465,456,446,437,428,420,412,404,396,388,381,374,367,360,354,347,341,335,329,323,318,312,307,302,297,292,287,282,278,273,269,265,261,512,505,497,489,482,475,468,461,454,447,441,435,428,422,417,411,405,399,394,389,383,378,373,368,364,359,354,350,345,341,337,332,328,324,320,316,312,309,305,301,298,294,291,287,284,281,278,274,271,268,265,262,259,257,507,501,496,491,485,480,475,470,465,460,456,451,446,442,437,433,428,424,420,416,412,408,404,400,396,392,388,385,381,377,374,370,367,363,360,357,354,350,347,344,341,338,335,332,329,326,323,320,318,315,312,310,307,304,302,299,297,294,292,289,287,285,282,280,278,275,273,271,269,267,265,263,261,259],ok=[9,11,12,13,13,14,14,15,15,15,15,16,16,16,16,17,17,17,17,17,17,17,18,18,18,18,18,18,18,18,18,19,19,19,19,19,19,19,19,19,19,19,19,19,19,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,20,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,22,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,23,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24,24];function ck(t,e){const n=t.data,s=t.width,i=t.height;let o,d,f,p,y,b,v,_,C,w,T,R,O,M,z,k,P,q,L,U;const V=e+e+1,F=s-1,re=i-1,ne=e+1,J=ne*(ne+1)/2,ie=new B5,ce=lk[e],Y=ok[e];let $=null,ae=ie,je=null,he=null;for(let G=1;G<V;G++)ae=ae.next=new B5,G===ne&&($=ae);ae.next=ie,f=d=0;for(let G=0;G<i;G++){R=O=M=z=p=y=b=v=0,_=ne*(k=n[d]),C=ne*(P=n[d+1]),w=ne*(q=n[d+2]),T=ne*(L=n[d+3]),p+=J*k,y+=J*P,b+=J*q,v+=J*L,ae=ie;for(let W=0;W<ne;W++)ae.r=k,ae.g=P,ae.b=q,ae.a=L,ae=ae.next;for(let W=1;W<ne;W++)o=d+((F<W?F:W)<<2),p+=(ae.r=k=n[o])*(U=ne-W),y+=(ae.g=P=n[o+1])*U,b+=(ae.b=q=n[o+2])*U,v+=(ae.a=L=n[o+3])*U,R+=k,O+=P,M+=q,z+=L,ae=ae.next;je=ie,he=$;for(let W=0;W<s;W++)n[d+3]=L=v*ce>>Y,L!==0?(L=255/L,n[d]=(p*ce>>Y)*L,n[d+1]=(y*ce>>Y)*L,n[d+2]=(b*ce>>Y)*L):n[d]=n[d+1]=n[d+2]=0,p-=_,y-=C,b-=w,v-=T,_-=je.r,C-=je.g,w-=je.b,T-=je.a,o=f+((o=W+e+1)<F?o:F)<<2,R+=je.r=n[o],O+=je.g=n[o+1],M+=je.b=n[o+2],z+=je.a=n[o+3],p+=R,y+=O,b+=M,v+=z,je=je.next,_+=k=he.r,C+=P=he.g,w+=q=he.b,T+=L=he.a,R-=k,O-=P,M-=q,z-=L,he=he.next,d+=4;f+=s}for(let G=0;G<s;G++){O=M=z=R=y=b=v=p=0,d=G<<2,_=ne*(k=n[d]),C=ne*(P=n[d+1]),w=ne*(q=n[d+2]),T=ne*(L=n[d+3]),p+=J*k,y+=J*P,b+=J*q,v+=J*L,ae=ie;for(let fe=0;fe<ne;fe++)ae.r=k,ae.g=P,ae.b=q,ae.a=L,ae=ae.next;let W=s;for(let fe=1;fe<=e;fe++)d=W+G<<2,p+=(ae.r=k=n[d])*(U=ne-fe),y+=(ae.g=P=n[d+1])*U,b+=(ae.b=q=n[d+2])*U,v+=(ae.a=L=n[d+3])*U,R+=k,O+=P,M+=q,z+=L,ae=ae.next,fe<re&&(W+=s);d=G,je=ie,he=$;for(let fe=0;fe<i;fe++)o=d<<2,n[o+3]=L=v*ce>>Y,L>0?(L=255/L,n[o]=(p*ce>>Y)*L,n[o+1]=(y*ce>>Y)*L,n[o+2]=(b*ce>>Y)*L):n[o]=n[o+1]=n[o+2]=0,p-=_,y-=C,b-=w,v-=T,_-=je.r,C-=je.g,w-=je.b,T-=je.a,o=G+((o=fe+ne)<re?o:re)*s<<2,p+=R+=je.r=n[o],y+=O+=je.g=n[o+1],b+=M+=je.b=n[o+2],v+=z+=je.a=n[o+3],je=je.next,_+=k=he.r,C+=P=he.g,w+=q=he.b,T+=L=he.a,R-=k,O-=P,M-=q,z-=L,he=he.next,d+=s}}const uk=function(e){const n=Math.round(this.blurRadius());n>0&&ck(e,n)};K.addGetterSetter(Ae,"blurRadius",0,Re(),K.afterSetFilter);const dk=function(t){const e=this.brightness()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]+=e,n[i+1]+=e,n[i+2]+=e};K.addGetterSetter(Ae,"brightness",0,Re(),K.afterSetFilter);const fk=function(t){const e=this.brightness(),n=t.data,s=n.length;for(let i=0;i<s;i+=4)n[i]=Math.min(255,n[i]*e),n[i+1]=Math.min(255,n[i+1]*e),n[i+2]=Math.min(255,n[i+2]*e)},hk=function(t){const e=Math.pow((this.contrast()+100)/100,2),n=t.data,s=n.length;let i=150,o=150,d=150;for(let f=0;f<s;f+=4)i=n[f],o=n[f+1],d=n[f+2],i/=255,i-=.5,i*=e,i+=.5,i*=255,o/=255,o-=.5,o*=e,o+=.5,o*=255,d/=255,d-=.5,d*=e,d+=.5,d*=255,i=i<0?0:i>255?255:i,o=o<0?0:o>255?255:o,d=d<0?0:d>255?255:d,n[f]=i,n[f+1]=o,n[f+2]=d};K.addGetterSetter(Ae,"contrast",0,Re(),K.afterSetFilter);const pk=function(t){var e,n,s,i,o,d,f,p,y;const b=t.data,v=t.width,_=t.height,C=Math.min(1,Math.max(0,(n=(e=this.embossStrength)===null||e===void 0?void 0:e.call(this))!==null&&n!==void 0?n:.5)),w=Math.min(1,Math.max(0,(i=(s=this.embossWhiteLevel)===null||s===void 0?void 0:s.call(this))!==null&&i!==void 0?i:.5)),R=(f={"top-left":315,top:270,"top-right":225,right:180,"bottom-right":135,bottom:90,"bottom-left":45,left:0}[(d=(o=this.embossDirection)===null||o===void 0?void 0:o.call(this))!==null&&d!==void 0?d:"top-left"])!==null&&f!==void 0?f:315,O=!!((y=(p=this.embossBlend)===null||p===void 0?void 0:p.call(this))!==null&&y!==void 0&&y),M=C*10,z=w*255,k=R*Math.PI/180,P=Math.cos(k),q=Math.sin(k),L=128/1020*M,U=new Uint8ClampedArray(b),V=new Float32Array(v*_);for(let ie=0,ce=0;ce<b.length;ce+=4,ie++)V[ie]=.2126*U[ce]+.7152*U[ce+1]+.0722*U[ce+2];const F=[-1,0,1,-2,0,2,-1,0,1],re=[-1,-2,-1,0,0,0,1,2,1],ne=[-v-1,-v,-v+1,-1,0,1,v-1,v,v+1],J=ie=>ie<0?0:ie>255?255:ie;for(let ie=1;ie<_-1;ie++)for(let ce=1;ce<v-1;ce++){const Y=ie*v+ce;let $=0,ae=0;$+=V[Y+ne[0]]*F[0],ae+=V[Y+ne[0]]*re[0],$+=V[Y+ne[1]]*F[1],ae+=V[Y+ne[1]]*re[1],$+=V[Y+ne[2]]*F[2],ae+=V[Y+ne[2]]*re[2],$+=V[Y+ne[3]]*F[3],ae+=V[Y+ne[3]]*re[3],$+=V[Y+ne[5]]*F[5],ae+=V[Y+ne[5]]*re[5],$+=V[Y+ne[6]]*F[6],ae+=V[Y+ne[6]]*re[6],$+=V[Y+ne[7]]*F[7],ae+=V[Y+ne[7]]*re[7],$+=V[Y+ne[8]]*F[8],ae+=V[Y+ne[8]]*re[8];const je=P*$+q*ae,he=J(z+je*L),G=Y*4;if(O){const W=he-z;b[G]=J(U[G]+W),b[G+1]=J(U[G+1]+W),b[G+2]=J(U[G+2]+W),b[G+3]=U[G+3]}else b[G]=b[G+1]=b[G+2]=he,b[G+3]=U[G+3]}for(let ie=0;ie<v;ie++){let ce=ie*4,Y=((_-1)*v+ie)*4;b[ce]=U[ce],b[ce+1]=U[ce+1],b[ce+2]=U[ce+2],b[ce+3]=U[ce+3],b[Y]=U[Y],b[Y+1]=U[Y+1],b[Y+2]=U[Y+2],b[Y+3]=U[Y+3]}for(let ie=1;ie<_-1;ie++){let ce=ie*v*4,Y=(ie*v+(v-1))*4;b[ce]=U[ce],b[ce+1]=U[ce+1],b[ce+2]=U[ce+2],b[ce+3]=U[ce+3],b[Y]=U[Y],b[Y+1]=U[Y+1],b[Y+2]=U[Y+2],b[Y+3]=U[Y+3]}return t};K.addGetterSetter(Ae,"embossStrength",.5,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"embossWhiteLevel",.5,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"embossDirection","top-left",void 0,K.afterSetFilter);K.addGetterSetter(Ae,"embossBlend",!1,void 0,K.afterSetFilter);function Rx(t,e,n,s,i){const o=n-e,d=i-s;if(o===0)return s+d/2;if(d===0)return s;let f=(t-e)/o;return f=d*f+s,f}const mk=function(t){const e=t.data,n=e.length;let s=e[0],i=s,o,d=e[1],f=d,p,y=e[2],b=y,v;const _=this.enhance();if(_===0)return;for(let z=0;z<n;z+=4)o=e[z+0],o<s?s=o:o>i&&(i=o),p=e[z+1],p<d?d=p:p>f&&(f=p),v=e[z+2],v<y?y=v:v>b&&(b=v);i===s&&(i=255,s=0),f===d&&(f=255,d=0),b===y&&(b=255,y=0);let C,w,T,R,O,M;if(_>0)C=i+_*(255-i),w=s-_*(s-0),T=f+_*(255-f),R=d-_*(d-0),O=b+_*(255-b),M=y-_*(y-0);else{const z=(i+s)*.5;C=i+_*(i-z),w=s+_*(s-z);const k=(f+d)*.5;T=f+_*(f-k),R=d+_*(d-k);const P=(b+y)*.5;O=b+_*(b-P),M=y+_*(y-P)}for(let z=0;z<n;z+=4)e[z+0]=Rx(e[z+0],s,i,w,C),e[z+1]=Rx(e[z+1],d,f,R,T),e[z+2]=Rx(e[z+2],y,b,M,O)};K.addGetterSetter(Ae,"enhance",0,Re(),K.afterSetFilter);const gk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=.34*e[s]+.5*e[s+1]+.16*e[s+2];e[s]=i,e[s+1]=i,e[s+2]=i}};K.addGetterSetter(Ae,"hue",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"luminance",0,Re(),K.afterSetFilter);const yk=function(t){const e=t.data,n=e.length,s=1,i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=this.luminance()*127,f=s*i*Math.cos(o*Math.PI/180),p=s*i*Math.sin(o*Math.PI/180),y=.299*s+.701*f+.167*p,b=.587*s-.587*f+.33*p,v=.114*s-.114*f-.497*p,_=.299*s-.299*f-.328*p,C=.587*s+.413*f+.035*p,w=.114*s-.114*f+.293*p,T=.299*s-.3*f+1.25*p,R=.587*s-.586*f-1.05*p,O=.114*s+.886*f-.2*p;let M,z,k,P;for(let q=0;q<n;q+=4)M=e[q+0],z=e[q+1],k=e[q+2],P=e[q+3],e[q+0]=y*M+b*z+v*k+d,e[q+1]=_*M+C*z+w*k+d,e[q+2]=T*M+R*z+O*k+d,e[q+3]=P},xk=function(t){const e=t.data,n=e.length,s=Math.pow(2,this.value()),i=Math.pow(2,this.saturation()),o=Math.abs(this.hue()+360)%360,d=s*i*Math.cos(o*Math.PI/180),f=s*i*Math.sin(o*Math.PI/180),p=.299*s+.701*d+.167*f,y=.587*s-.587*d+.33*f,b=.114*s-.114*d-.497*f,v=.299*s-.299*d-.328*f,_=.587*s+.413*d+.035*f,C=.114*s-.114*d+.293*f,w=.299*s-.3*d+1.25*f,T=.587*s-.586*d-1.05*f,R=.114*s+.886*d-.2*f;for(let O=0;O<n;O+=4){const M=e[O+0],z=e[O+1],k=e[O+2],P=e[O+3];e[O+0]=p*M+y*z+b*k,e[O+1]=v*M+_*z+C*k,e[O+2]=w*M+T*z+R*k,e[O+3]=P}};K.addGetterSetter(Ae,"hue",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"value",0,Re(),K.afterSetFilter);const bk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4)e[s]=255-e[s],e[s+1]=255-e[s+1],e[s+2]=255-e[s+2]},vk=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,p=n.polarCenterY||d/2;let y=Math.sqrt(f*f+p*p),b=o-f,v=d-p;const _=Math.sqrt(b*b+v*v);y=_>y?_:y;const C=d,w=o,T=360/w*Math.PI/180;for(let R=0;R<w;R+=1){const O=Math.sin(R*T),M=Math.cos(R*T);for(let z=0;z<C;z+=1){b=Math.floor(f+y*z/C*M),v=Math.floor(p+y*z/C*O);let k=(v*o+b)*4;const P=s[k+0],q=s[k+1],L=s[k+2],U=s[k+3];k=(R+z*o)*4,i[k+0]=P,i[k+1]=q,i[k+2]=L,i[k+3]=U}}},Sk=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,p=n.polarCenterY||d/2;let y=Math.sqrt(f*f+p*p),b=o-f,v=d-p;const _=Math.sqrt(b*b+v*v);y=_>y?_:y;const C=d,w=o,T=0;let R,O;for(b=0;b<o;b+=1)for(v=0;v<d;v+=1){const M=b-f,z=v-p,k=Math.sqrt(M*M+z*z)*C/y;let P=(Math.atan2(z,M)*180/Math.PI+360+T)%360;P=P*w/360,R=Math.floor(P),O=Math.floor(k);let q=(O*o+R)*4;const L=s[q+0],U=s[q+1],V=s[q+2],F=s[q+3];q=(v*o+b)*4,i[q+0]=L,i[q+1]=U,i[q+2]=V,i[q+3]=F}},Nk=function(t){const e=t.width,n=t.height;let s,i,o,d,f,p,y,b,v,_,C=Math.round(this.kaleidoscopePower());const w=Math.round(this.kaleidoscopeAngle()),T=Math.floor(e*(w%360)/360);if(C<1)return;const R=ee.createCanvasElement();R.width=e,R.height=n;const O=R.getContext("2d").getImageData(0,0,e,n);ee.releaseCanvas(R),vk(t,O,{polarCenterX:e/2,polarCenterY:n/2});let M=e/Math.pow(2,C);for(;M<=8;)M=M*2,C-=1;M=Math.ceil(M);let z=M,k=0,P=z,q=1;for(T+M>e&&(k=z,P=0,q=-1),i=0;i<n;i+=1)for(s=k;s!==P;s+=q)o=Math.round(s+T)%e,v=(e*i+o)*4,f=O.data[v+0],p=O.data[v+1],y=O.data[v+2],b=O.data[v+3],_=(e*i+s)*4,O.data[_+0]=f,O.data[_+1]=p,O.data[_+2]=y,O.data[_+3]=b;for(i=0;i<n;i+=1)for(z=Math.floor(M),d=0;d<C;d+=1){for(s=0;s<z+1;s+=1)v=(e*i+s)*4,f=O.data[v+0],p=O.data[v+1],y=O.data[v+2],b=O.data[v+3],_=(e*i+z*2-s-1)*4,O.data[_+0]=f,O.data[_+1]=p,O.data[_+2]=y,O.data[_+3]=b;z*=2}Sk(O,t,{})};K.addGetterSetter(Ae,"kaleidoscopePower",2,Re(),K.afterSetFilter);K.addGetterSetter(Ae,"kaleidoscopeAngle",0,Re(),K.afterSetFilter);function c1(t,e,n){let s=(n*t.width+e)*4;const i=[];return i.push(t.data[s++],t.data[s++],t.data[s++],t.data[s++]),i}function rm(t,e){return Math.sqrt(Math.pow(t[0]-e[0],2)+Math.pow(t[1]-e[1],2)+Math.pow(t[2]-e[2],2))}function _k(t){const e=[0,0,0];for(let n=0;n<t.length;n++)e[0]+=t[n][0],e[1]+=t[n][1],e[2]+=t[n][2];return e[0]/=t.length,e[1]/=t.length,e[2]/=t.length,e}function jk(t,e){const n=c1(t,0,0),s=c1(t,t.width-1,0),i=c1(t,0,t.height-1),o=c1(t,t.width-1,t.height-1),d=e||10;if(rm(n,s)<d&&rm(s,o)<d&&rm(o,i)<d&&rm(i,n)<d){const f=_k([s,n,o,i]),p=[];for(let y=0;y<t.width*t.height;y++){const b=rm(f,[t.data[y*4],t.data[y*4+1],t.data[y*4+2]]);p[y]=b<d?0:255}return p}}function Ck(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function wk(t,e,n){const s=[1,1,1,1,0,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let b=0;for(let v=0;v<i;v++)for(let _=0;_<i;_++){const C=f+v-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const T=C*e+w,R=s[v*i+_];b+=t[T]*R}}d[y]=b===2040?255:0}return d}function Ek(t,e,n){const s=[1,1,1,1,1,1,1,1,1],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let b=0;for(let v=0;v<i;v++)for(let _=0;_<i;_++){const C=f+v-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const T=C*e+w,R=s[v*i+_];b+=t[T]*R}}d[y]=b>=1020?255:0}return d}function Tk(t,e,n){const s=[.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111,.1111111111111111],i=Math.round(Math.sqrt(s.length)),o=Math.floor(i/2),d=[];for(let f=0;f<n;f++)for(let p=0;p<e;p++){const y=f*e+p;let b=0;for(let v=0;v<i;v++)for(let _=0;_<i;_++){const C=f+v-o,w=p+_-o;if(C>=0&&C<n&&w>=0&&w<e){const T=C*e+w,R=s[v*i+_];b+=t[T]*R}}d[y]=b}return d}const Rk=function(t){const e=this.threshold();let n=jk(t,e);return n&&(n=wk(n,t.width,t.height),n=Ek(n,t.width,t.height),n=Tk(n,t.width,t.height),Ck(t,n)),t};K.addGetterSetter(Ae,"threshold",0,Re(),K.afterSetFilter);const Ok=function(t){const e=this.noise()*255,n=t.data,s=n.length,i=e/2;for(let o=0;o<s;o+=4)n[o+0]+=i-2*i*Math.random(),n[o+1]+=i-2*i*Math.random(),n[o+2]+=i-2*i*Math.random()};K.addGetterSetter(Ae,"noise",.2,Re(),K.afterSetFilter);const Mk=function(t){let e=Math.ceil(this.pixelSize()),n=t.width,s=t.height,i=Math.ceil(n/e),o=Math.ceil(s/e),d=t.data;if(e<=0){ee.error("pixelSize value can not be <= 0");return}for(let f=0;f<i;f+=1)for(let p=0;p<o;p+=1){let y=0,b=0,v=0,_=0;const C=f*e,w=C+e,T=p*e,R=T+e;let O=0;for(let M=C;M<w;M+=1)if(!(M>=n))for(let z=T;z<R;z+=1){if(z>=s)continue;const k=(n*z+M)*4;y+=d[k+0],b+=d[k+1],v+=d[k+2],_+=d[k+3],O+=1}y=y/O,b=b/O,v=v/O,_=_/O;for(let M=C;M<w;M+=1)if(!(M>=n))for(let z=T;z<R;z+=1){if(z>=s)continue;const k=(n*z+M)*4;d[k+0]=y,d[k+1]=b,d[k+2]=v,d[k+3]=_}}};K.addGetterSetter(Ae,"pixelSize",8,Re(),K.afterSetFilter);const Ak=function(t){const e=Math.round(this.levels()*254)+1,n=t.data,s=n.length,i=255/e;for(let o=0;o<s;o+=1)n[o]=Math.floor(n[o]/i)*i};K.addGetterSetter(Ae,"levels",.5,Re(),K.afterSetFilter);const Dk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue();for(let d=0;d<n;d+=4){const f=(.34*e[d]+.5*e[d+1]+.16*e[d+2])/255;e[d]=f*s,e[d+1]=f*i,e[d+2]=f*o,e[d+3]=e[d+3]}};K.addGetterSetter(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"blue",0,b8,K.afterSetFilter);const zk=function(t){const e=t.data,n=e.length,s=this.red(),i=this.green(),o=this.blue(),d=this.alpha();for(let f=0;f<n;f+=4){const p=1-d;e[f]=s*d+e[f]*p,e[f+1]=i*d+e[f+1]*p,e[f+2]=o*d+e[f+2]*p}};K.addGetterSetter(Ae,"red",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"green",0,function(t){return this._filterUpToDate=!1,t>255?255:t<0?0:Math.round(t)});K.addGetterSetter(Ae,"blue",0,b8,K.afterSetFilter);K.addGetterSetter(Ae,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const kk=function(t){const e=t.data,n=e.length;for(let s=0;s<n;s+=4){const i=e[s+0],o=e[s+1],d=e[s+2];e[s+0]=Math.min(255,i*.393+o*.769+d*.189),e[s+1]=Math.min(255,i*.349+o*.686+d*.168),e[s+2]=Math.min(255,i*.272+o*.534+d*.131)}},Lk=function(t){const n=t.data;for(let s=0;s<n.length;s+=4){const i=n[s],o=n[s+1],d=n[s+2];.2126*i+.7152*o+.0722*d>=128&&(n[s]=255-i,n[s+1]=255-o,n[s+2]=255-d)}return t},Uk=function(t){const e=this.threshold()*255,n=t.data,s=n.length;for(let i=0;i<s;i+=1)n[i]=n[i]<e?0:255};K.addGetterSetter(Ae,"threshold",.5,Re(),K.afterSetFilter);ah.Util._assign(ah,{Arc:mo,Arrow:ld,Circle:fh,Ellipse:qc,Image:Tr,Label:Av,Tag:od,Line:go,Path:jn,Rect:Wm,RegularPolygon:Hc,Ring:cd,Sprite:vl,Star:Bc,Text:wn,TextPath:Ua,Transformer:Lt,Wedge:yo,Filters:{Blur:uk,Brightness:fk,Brighten:dk,Contrast:hk,Emboss:pk,Enhance:mk,Grayscale:gk,HSL:yk,HSV:xk,Invert:bk,Kaleidoscope:Nk,Mask:Rk,Noise:Ok,Pixelate:Mk,Posterize:Ak,RGB:Dk,RGBA:zk,Sepia:kk,Solarize:Lk,Threshold:Uk}});var Ox={exports:{}},Mx={exports:{}};/**
|
|
580
|
-
* @license React
|
|
581
|
-
* react-reconciler.production.js
|
|
582
|
-
*
|
|
583
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
584
|
-
*
|
|
585
|
-
* This source code is licensed under the MIT license found in the
|
|
586
|
-
* LICENSE file in the root directory of this source tree.
|
|
587
|
-
*/var G5;function qk(){return G5||(G5=1,(function(t){t.exports=function(e){function n(l,c,g,x){return new Gh(l,c,g,x)}function s(){}function i(l){var c="https://react.dev/errors/"+l;if(1<arguments.length){c+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)c+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+c+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){var c=l,g=l;if(l.alternate)for(;c.return;)c=c.return;else{l=c;do c=l,(c.flags&4098)!==0&&(g=c.return),l=c.return;while(l)}return c.tag===3?g:null}function d(l){if(o(l)!==l)throw Error(i(188))}function f(l){var c=l.alternate;if(!c){if(c=o(l),c===null)throw Error(i(188));return c!==l?null:l}for(var g=l,x=c;;){var j=g.return;if(j===null)break;var E=j.alternate;if(E===null){if(x=j.return,x!==null){g=x;continue}break}if(j.child===E.child){for(E=j.child;E;){if(E===g)return d(j),l;if(E===x)return d(j),c;E=E.sibling}throw Error(i(188))}if(g.return!==x.return)g=j,x=E;else{for(var H=!1,Z=j.child;Z;){if(Z===g){H=!0,g=j,x=E;break}if(Z===x){H=!0,x=j,g=E;break}Z=Z.sibling}if(!H){for(Z=E.child;Z;){if(Z===g){H=!0,g=E,x=j;break}if(Z===x){H=!0,x=E,g=j;break}Z=Z.sibling}if(!H)throw Error(i(189))}}if(g.alternate!==x)throw Error(i(190))}if(g.tag!==3)throw Error(i(188));return g.stateNode.current===g?l:c}function p(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(c=p(l),c!==null)return c;l=l.sibling}return null}function y(l){var c=l.tag;if(c===5||c===26||c===27||c===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(c=y(l),c!==null))return c;l=l.sibling}return null}function b(l){return l===null||typeof l!="object"?null:(l=gi&&l[gi]||l["@@iterator"],typeof l=="function"?l:null)}function v(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Vi?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case zl:return"Fragment";case Ll:return"Profiler";case kl:return"StrictMode";case Qd:return"Suspense";case mi:return"SuspenseList";case fu:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case Dl:return"Portal";case Zs:return l.displayName||"Context";case du:return(l._context.displayName||"Context")+".Consumer";case Bo:var c=l.render;return l=l.displayName,l||(l=c.displayName||c.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Kd:return c=l.displayName||null,c!==null?c:v(l.type)||"Memo";case Ia:c=l._payload,l=l._init;try{return v(l(c))}catch{}}return null}function _(l){return{current:l}}function C(l){0>Gl||(l.current=rf[Gl],rf[Gl]=null,Gl--)}function w(l,c){Gl++,rf[Gl]=l.current,l.current=c}function T(l){return l>>>=0,l===0?32:31-(lf(l)/g0|0)|0}function R(l){var c=l&42;if(c!==0)return c;switch(l&-l){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 l&261888;case 262144:case 524288:case 1048576:case 2097152:return l&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return l&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return l}}function O(l,c,g){var x=l.pendingLanes;if(x===0)return 0;var j=0,E=l.suspendedLanes,H=l.pingedLanes;l=l.warmLanes;var Z=x&134217727;return Z!==0?(x=Z&~E,x!==0?j=R(x):(H&=Z,H!==0?j=R(H):g||(g=Z&~l,g!==0&&(j=R(g))))):(Z=x&~E,Z!==0?j=R(Z):H!==0?j=R(H):g||(g=x&~l,g!==0&&(j=R(g)))),j===0?0:c!==0&&c!==j&&(c&E)===0&&(E=j&-j,g=c&-c,E>=g||E===32&&(g&4194048)!==0)?c:j}function M(l,c){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&c)===0}function z(l,c){switch(l){case 1:case 2:case 4:case 8:case 64:return c+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 c+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 k(){var l=Xo;return Xo<<=1,(Xo&62914560)===0&&(Xo=4194304),l}function P(l){for(var c=[],g=0;31>g;g++)c.push(l);return c}function q(l,c){l.pendingLanes|=c,c!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function L(l,c,g,x,j,E){var H=l.pendingLanes;l.pendingLanes=g,l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0,l.expiredLanes&=g,l.entangledLanes&=g,l.errorRecoveryDisabledLanes&=g,l.shellSuspendCounter=0;var Z=l.entanglements,ge=l.expirationTimes,Ne=l.hiddenUpdates;for(g=H&~g;0<g;){var Oe=31-ps(g),Ce=1<<Oe;Z[Oe]=0,ge[Oe]=-1;var Le=Ne[Oe];if(Le!==null)for(Ne[Oe]=null,Oe=0;Oe<Le.length;Oe++){var st=Le[Oe];st!==null&&(st.lane&=-536870913)}g&=~Ce}x!==0&&U(l,x,0),E!==0&&j===0&&l.tag!==0&&(l.suspendedLanes|=E&~(H&~c))}function U(l,c,g){l.pendingLanes|=c,l.suspendedLanes&=~c;var x=31-ps(c);l.entangledLanes|=c,l.entanglements[x]=l.entanglements[x]|1073741824|g&261930}function V(l,c){var g=l.entangledLanes|=c;for(l=l.entanglements;g;){var x=31-ps(g),j=1<<x;j&c|l[x]&c&&(l[x]|=c),g&=~j}}function F(l,c){var g=c&-c;return g=(g&42)!==0?1:re(g),(g&(l.suspendedLanes|c))!==0?0:g}function re(l){switch(l){case 2:l=1;break;case 8:l=4;break;case 32:l=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:l=128;break;case 268435456:l=134217728;break;default:l=0}return l}function ne(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function J(l){if(typeof wp=="function"&&b0(l),ms&&typeof ms.setStrictMode=="function")try{ms.setStrictMode(Yl,l)}catch{}}function ie(l,c){return l===c&&(l!==0||1/l===1/c)||l!==l&&c!==c}function ce(l){if(hf===void 0)try{throw Error()}catch(g){var c=g.stack.trim().match(/\n( *(at )?)/);hf=c&&c[1]||"",Qr=-1<g.stack.indexOf(`
|
|
588
|
-
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
589
|
-
`+hf+l+Qr}function Y(l,c){if(!l||Su)return"";Su=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(c){var Ce=function(){throw Error()};if(Object.defineProperty(Ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ce,[])}catch(st){var Le=st}Reflect.construct(l,[],Ce)}else{try{Ce.call()}catch(st){Le=st}l.call(Ce.prototype)}}else{try{throw Error()}catch(st){Le=st}(Ce=l())&&typeof Ce.catch=="function"&&Ce.catch(function(){})}}catch(st){if(st&&Le&&typeof st.stack=="string")return[st.stack,Le.stack]}return[null,null]}};x.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var j=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");j&&j.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),H=E[0],Z=E[1];if(H&&Z){var ge=H.split(`
|
|
590
|
-
`),Ne=Z.split(`
|
|
591
|
-
`);for(j=x=0;x<ge.length&&!ge[x].includes("DetermineComponentFrameRoot");)x++;for(;j<Ne.length&&!Ne[j].includes("DetermineComponentFrameRoot");)j++;if(x===ge.length||j===Ne.length)for(x=ge.length-1,j=Ne.length-1;1<=x&&0<=j&&ge[x]!==Ne[j];)j--;for(;1<=x&&0<=j;x--,j--)if(ge[x]!==Ne[j]){if(x!==1||j!==1)do if(x--,j--,0>j||ge[x]!==Ne[j]){var Oe=`
|
|
592
|
-
`+ge[x].replace(" at new "," at ");return l.displayName&&Oe.includes("<anonymous>")&&(Oe=Oe.replace("<anonymous>",l.displayName)),Oe}while(1<=x&&0<=j);break}}}finally{Su=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?ce(g):""}function $(l,c){switch(l.tag){case 26:case 27:case 5:return ce(l.type);case 16:return ce("Lazy");case 13:return l.child!==c&&c!==null?ce("Suspense Fallback"):ce("Suspense");case 19:return ce("SuspenseList");case 0:case 15:return Y(l.type,!1);case 11:return Y(l.type.render,!1);case 1:return Y(l.type,!0);case 31:return ce("Activity");default:return""}}function ae(l){try{var c="",g=null;do c+=$(l,g),g=l,l=l.return;while(l);return c}catch(x){return`
|
|
593
|
-
Error generating stack: `+x.message+`
|
|
594
|
-
`+x.stack}}function je(l,c){if(typeof l=="object"&&l!==null){var g=Ep.get(l);return g!==void 0?g:(c={value:l,source:c,stack:ae(c)},Ep.set(l,c),c)}return{value:l,source:c,stack:ae(c)}}function he(l,c){bi[Kr++]=Nu,bi[Kr++]=nn,nn=l,Nu=c}function G(l,c,g){Ws[Ds++]=Ma,Ws[Ds++]=xr,Ws[Ds++]=$s,$s=l;var x=Ma;l=xr;var j=32-ps(x)-1;x&=~(1<<j),g+=1;var E=32-ps(c)+j;if(30<E){var H=j-j%5;E=(x&(1<<H)-1).toString(32),x>>=H,j-=H,Ma=1<<32-ps(c)+j|g<<j|x,xr=E+l}else Ma=1<<E|g<<j|x,xr=l}function W(l){l.return!==null&&(he(l,1),G(l,1,0))}function fe(l){for(;l===nn;)nn=bi[--Kr],bi[Kr]=null,Nu=bi[--Kr],bi[Kr]=null;for(;l===$s;)$s=Ws[--Ds],Ws[Ds]=null,xr=Ws[--Ds],Ws[Ds]=null,Ma=Ws[--Ds],Ws[Ds]=null}function be(l,c){Ws[Ds++]=Ma,Ws[Ds++]=xr,Ws[Ds++]=$s,Ma=c.id,xr=c.overflow,$s=l}function _e(l,c){w(Aa,c),w(vi,l),w(_a,null),l=Ag(c),C(_a),w(_a,l)}function me(){C(_a),C(vi),C(Aa)}function we(l){l.memoizedState!==null&&w(_u,l);var c=_a.current,g=Yo(c,l.type);c!==g&&(w(vi,l),w(_a,g))}function nt(l){vi.current===l&&(C(_a),C(vi)),_u.current===l&&(C(_u),Zn?Hl._currentValue=ql:Hl._currentValue2=ql)}function ze(l){var c=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Kn(je(c,l)),pf}function Vt(l,c){if(!vn)throw Error(i(175));s0(l.stateNode,l.type,l.memoizedProps,c,l)||ze(l,!0)}function $e(l){for(da=l.return;da;)switch(da.tag){case 5:case 31:case 13:Wa=!1;return;case 27:case 3:Wa=!0;return;default:da=da.return}}function Mt(l){if(!vn||l!==da)return!1;if(!Nt)return $e(l),Nt=!0,!1;var c=l.tag;if(ua?c!==3&&c!==27&&(c!==5||Ko(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l):c!==3&&(c!==5||Ko(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l),$e(l),c===13){if(!vn)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=mp(l)}else if(c===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=i0(l)}else Sn=ua&&c===27?Ig(l.type,Sn):da?Zg(l.stateNode):null;return!0}function Ht(){vn&&(Sn=da=null,Nt=!1)}function En(){var l=Xr;return l!==null&&(ys===null?ys=l:ys.push.apply(ys,l),Xr=null),l}function Kn(l){Xr===null?Xr=[l]:Xr.push(l)}function Gt(l,c,g){Zn?(w(er,c._currentValue),c._currentValue=g):(w(er,c._currentValue2),c._currentValue2=g)}function fn(l){var c=er.current;Zn?l._currentValue=c:l._currentValue2=c,C(er)}function ur(l,c,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&c)!==c?(l.childLanes|=c,x!==null&&(x.childLanes|=c)):x!==null&&(x.childLanes&c)!==c&&(x.childLanes|=c),l===g)break;l=l.return}}function Zt(l,c,g,x){var j=l.child;for(j!==null&&(j.return=l);j!==null;){var E=j.dependencies;if(E!==null){var H=j.child;E=E.firstContext;e:for(;E!==null;){var Z=E;E=j;for(var ge=0;ge<c.length;ge++)if(Z.context===c[ge]){E.lanes|=g,Z=E.alternate,Z!==null&&(Z.lanes|=g),ur(E.return,g,l),x||(H=null);break e}E=Z.next}}else if(j.tag===18){if(H=j.return,H===null)throw Error(i(341));H.lanes|=g,E=H.alternate,E!==null&&(E.lanes|=g),ur(H,g,l),H=null}else H=j.child;if(H!==null)H.return=j;else for(H=j;H!==null;){if(H===l){H=null;break}if(j=H.sibling,j!==null){j.return=H.return,H=j;break}H=H.return}j=H}}function Et(l,c,g,x){l=null;for(var j=c,E=!1;j!==null;){if(!E){if((j.flags&524288)!==0)E=!0;else if((j.flags&262144)!==0)break}if(j.tag===10){var H=j.alternate;if(H===null)throw Error(i(387));if(H=H.memoizedProps,H!==null){var Z=j.type;Jn(j.pendingProps.value,H.value)||(l!==null?l.push(Z):l=[Z])}}else if(j===_u.current){if(H=j.alternate,H===null)throw Error(i(387));H.memoizedState.memoizedState!==j.memoizedState.memoizedState&&(l!==null?l.push(Hl):l=[Hl])}j=j.return}l!==null&&Zt(c,l,g,x),c.flags|=262144}function qn(l){for(l=l.firstContext;l!==null;){var c=l.context;if(!Jn(Zn?c._currentValue:c._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function hn(l){cn=l,br=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function It(l){return Ss(cn,l)}function Xn(l,c){return cn===null&&hn(l),Ss(l,c)}function Ss(l,c){var g=Zn?c._currentValue:c._currentValue2;if(c={context:c,memoizedValue:g,next:null},br===null){if(l===null)throw Error(i(308));br=c,l.dependencies={lanes:0,firstContext:c},l.flags|=524288}else br=br.next=c;return g}function dr(){return{controller:new v0,data:new Map,refCount:0}}function Qa(l){l.refCount--,l.refCount===0&&ja(vy,function(){l.controller.abort()})}function la(){}function Ea(l){l!==Jt&&l.next===null&&(Jt===null?ju=Jt=l:Jt=Jt.next=l),tr=!0,Pa||(Pa=!0,ba())}function rs(l,c){if(!mf&&tr){mf=!0;do for(var g=!1,x=ju;x!==null;){if(l!==0){var j=x.pendingLanes;if(j===0)var E=0;else{var H=x.suspendedLanes,Z=x.pingedLanes;E=(1<<31-ps(42|l)+1)-1,E&=j&~(H&~Z),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,is(x,E))}else E=_t,E=O(x,x===pt?E:0,x.cancelPendingCommit!==null||x.timeoutHandle!==hs),(E&3)===0||M(x,E)||(g=!0,is(x,E));x=x.next}while(g);mf=!1}}function fr(){Ns()}function Ns(){tr=Pa=!1;var l=0;Zi!==0&&Ul()&&(l=Zi);for(var c=Ga(),g=null,x=ju;x!==null;){var j=x.next,E=Hs(x,c);E===0?(x.next=null,g===null?ju=j:g.next=j,j===null&&(Jt=g)):(g=x,(l!==0||(E&3)!==0)&&(tr=!0)),x=j}ra!==0&&ra!==5||rs(l),Zi!==0&&(Zi=0)}function Hs(l,c){for(var g=l.suspendedLanes,x=l.pingedLanes,j=l.expirationTimes,E=l.pendingLanes&-62914561;0<E;){var H=31-ps(E),Z=1<<H,ge=j[H];ge===-1?((Z&g)===0||(Z&x)!==0)&&(j[H]=z(Z,c)):ge<=c&&(l.expiredLanes|=Z),E&=~Z}if(c=pt,g=_t,g=O(l,l===c?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==hs),x=l.callbackNode,g===0||l===c&&($t===2||$t===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&cf(x),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||M(l,g)){if(c=g&-g,c===l.callbackPriority)return c;switch(x!==null&&cf(x),ne(g)){case 2:case 8:g=x0;break;case 32:g=vu;break;case 268435456:g=df;break;default:g=vu}return x=ta.bind(null,l),g=bu(g,x),l.callbackPriority=c,l.callbackNode=g,c}return x!==null&&x!==null&&cf(x),l.callbackPriority=2,l.callbackNode=null,2}function ta(l,c){if(ra!==0&&ra!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(Pr()&&l.callbackNode!==g)return null;var x=_t;return x=O(l,l===pt?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==hs),x===0?null:(yr(l,x,c),Hs(l,Ga()),l.callbackNode!=null&&l.callbackNode===g?ta.bind(null,l):null)}function is(l,c){if(Pr())return null;yr(l,c,!0)}function ba(){$h?ep(function(){(bt&6)!==0?bu(uf,fr):Ns()}):bu(uf,fr)}function Ta(){if(Zi===0){var l=Si;l===0&&(l=of,of<<=1,(of&261888)===0&&(of=256)),Zi=l}return Zi}function Pc(l,c){if(Fo===null){var g=Fo=[];Tp=0,Si=Ta(),fa={status:"pending",value:void 0,then:function(x){g.push(x)}}}return Tp++,c.then(Sl,Sl),c}function Sl(){if(--Tp===0&&Fo!==null){fa!==null&&(fa.status="fulfilled");var l=Fo;Fo=null,Si=0,fa=null;for(var c=0;c<l.length;c++)(0,l[c])()}}function _s(l,c){var g=[],x={status:"pending",value:null,reason:null,then:function(j){g.push(j)}};return l.then(function(){x.status="fulfilled",x.value=c;for(var j=0;j<g.length;j++)(0,g[j])(c)},function(j){for(x.status="rejected",x.reason=j,j=0;j<g.length;j++)(0,g[j])(void 0)}),x}function hr(){var l=Ii.current;return l!==null?l:pt.pooledCache}function yt(l,c){c===null?w(Ii,Ii.current):w(Ii,c.pool)}function mt(){var l=hr();return l===null?null:{parent:Zn?Nn._currentValue:Nn._currentValue2,pool:l}}function Qt(l,c){if(Jn(l,c))return!0;if(typeof l!="object"||l===null||typeof c!="object"||c===null)return!1;var g=Object.keys(l),x=Object.keys(c);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var j=g[x];if(!by.call(c,j)||!Jn(l[j],c[j]))return!1}return!0}function At(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Hn(l,c,g){switch(g=l[g],g===void 0?l.push(c):g!==c&&(c.then(la,la),c=g),c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,yn(l),l;default:if(typeof c.status=="string")c.then(la,la);else{if(l=pt,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=c,l.status="pending",l.then(function(x){if(c.status==="pending"){var j=c;j.status="fulfilled",j.value=x}},function(x){if(c.status==="pending"){var j=c;j.status="rejected",j.reason=x}})}switch(c.status){case"fulfilled":return c.value;case"rejected":throw l=c.reason,yn(l),l}throw $a=c,ha}}function rn(l){try{var c=l._init;return c(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?($a=g,ha):g}}function Fn(){if($a===null)throw Error(i(459));var l=$a;return $a=null,l}function yn(l){if(l===ha||l===ar)throw Error(i(483))}function Ra(l){var c=Vl;return Vl+=1,Ji===null&&(Ji=[]),Hn(Ji,l,c)}function oa(l,c){c=c.props.ref,l.ref=c!==void 0?c:null}function ls(l,c){throw c.$$typeof===Al?Error(i(525)):(l=Object.prototype.toString.call(c),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(c).join(", ")+"}":l)))}function Bs(l){function c(ue,se){if(l){var pe=ue.deletions;pe===null?(ue.deletions=[se],ue.flags|=16):pe.push(se)}}function g(ue,se){if(!l)return null;for(;se!==null;)c(ue,se),se=se.sibling;return null}function x(ue){for(var se=new Map;ue!==null;)ue.key!==null?se.set(ue.key,ue):se.set(ue.index,ue),ue=ue.sibling;return se}function j(ue,se){return ue=Ms(ue,se),ue.index=0,ue.sibling=null,ue}function E(ue,se,pe){return ue.index=pe,l?(pe=ue.alternate,pe!==null?(pe=pe.index,pe<se?(ue.flags|=67108866,se):pe):(ue.flags|=67108866,se)):(ue.flags|=1048576,se)}function H(ue){return l&&ue.alternate===null&&(ue.flags|=67108866),ue}function Z(ue,se,pe,Te){return se===null||se.tag!==6?(se=Ph(pe,ue.mode,Te),se.return=ue,se):(se=j(se,pe),se.return=ue,se)}function ge(ue,se,pe,Te){var Xe=pe.type;return Xe===zl?Oe(ue,se,pe.props.children,Te,pe.key):se!==null&&(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ia&&rn(Xe)===se.type)?(se=j(se,pe.props),oa(se,pe),se.return=ue,se):(se=pi(pe.type,pe.key,pe.props,null,ue.mode,Te),oa(se,pe),se.return=ue,se)}function Ne(ue,se,pe,Te){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=Vh(pe,ue.mode,Te),se.return=ue,se):(se=j(se,pe.children||[]),se.return=ue,se)}function Oe(ue,se,pe,Te,Xe){return se===null||se.tag!==7?(se=Fs(pe,ue.mode,Te,Xe),se.return=ue,se):(se=j(se,pe),se.return=ue,se)}function Ce(ue,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Ph(""+se,ue.mode,pe),se.return=ue,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Yr:return pe=pi(se.type,se.key,se.props,null,ue.mode,pe),oa(pe,se),pe.return=ue,pe;case Dl:return se=Vh(se,ue.mode,pe),se.return=ue,se;case Ia:return se=rn(se),Ce(ue,se,pe)}if(Qi(se)||b(se))return se=Fs(se,ue.mode,pe,null),se.return=ue,se;if(typeof se.then=="function")return Ce(ue,Ra(se),pe);if(se.$$typeof===Zs)return Ce(ue,Xn(ue,se),pe);ls(ue,se)}return null}function Le(ue,se,pe,Te){var Xe=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Xe!==null?null:Z(ue,se,""+pe,Te);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Yr:return pe.key===Xe?ge(ue,se,pe,Te):null;case Dl:return pe.key===Xe?Ne(ue,se,pe,Te):null;case Ia:return pe=rn(pe),Le(ue,se,pe,Te)}if(Qi(pe)||b(pe))return Xe!==null?null:Oe(ue,se,pe,Te,null);if(typeof pe.then=="function")return Le(ue,se,Ra(pe),Te);if(pe.$$typeof===Zs)return Le(ue,se,Xn(ue,pe),Te);ls(ue,pe)}return null}function st(ue,se,pe,Te,Xe){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ue=ue.get(pe)||null,Z(se,ue,""+Te,Xe);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case Yr:return ue=ue.get(Te.key===null?pe:Te.key)||null,ge(se,ue,Te,Xe);case Dl:return ue=ue.get(Te.key===null?pe:Te.key)||null,Ne(se,ue,Te,Xe);case Ia:return Te=rn(Te),st(ue,se,pe,Te,Xe)}if(Qi(Te)||b(Te))return ue=ue.get(pe)||null,Oe(se,ue,Te,Xe,null);if(typeof Te.then=="function")return st(ue,se,pe,Ra(Te),Xe);if(Te.$$typeof===Zs)return st(ue,se,pe,Xn(se,Te),Xe);ls(se,Te)}return null}function Ca(ue,se,pe,Te){for(var Xe=null,Ln=null,Ze=se,Dt=se=0,wa=null;Ze!==null&&Dt<pe.length;Dt++){Ze.index>Dt?(wa=Ze,Ze=null):wa=Ze.sibling;var Bt=Le(ue,Ze,pe[Dt],Te);if(Bt===null){Ze===null&&(Ze=wa);break}l&&Ze&&Bt.alternate===null&&c(ue,Ze),se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt,Ze=wa}if(Dt===pe.length)return g(ue,Ze),Nt&&he(ue,Dt),Xe;if(Ze===null){for(;Dt<pe.length;Dt++)Ze=Ce(ue,pe[Dt],Te),Ze!==null&&(se=E(Ze,se,Dt),Ln===null?Xe=Ze:Ln.sibling=Ze,Ln=Ze);return Nt&&he(ue,Dt),Xe}for(Ze=x(Ze);Dt<pe.length;Dt++)wa=st(Ze,ue,Dt,pe[Dt],Te),wa!==null&&(l&&wa.alternate!==null&&Ze.delete(wa.key===null?Dt:wa.key),se=E(wa,se,Dt),Ln===null?Xe=wa:Ln.sibling=wa,Ln=wa);return l&&Ze.forEach(function(ir){return c(ue,ir)}),Nt&&he(ue,Dt),Xe}function nc(ue,se,pe,Te){if(pe==null)throw Error(i(151));for(var Xe=null,Ln=null,Ze=se,Dt=se=0,wa=null,Bt=pe.next();Ze!==null&&!Bt.done;Dt++,Bt=pe.next()){Ze.index>Dt?(wa=Ze,Ze=null):wa=Ze.sibling;var ir=Le(ue,Ze,Bt.value,Te);if(ir===null){Ze===null&&(Ze=wa);break}l&&Ze&&ir.alternate===null&&c(ue,Ze),se=E(ir,se,Dt),Ln===null?Xe=ir:Ln.sibling=ir,Ln=ir,Ze=wa}if(Bt.done)return g(ue,Ze),Nt&&he(ue,Dt),Xe;if(Ze===null){for(;!Bt.done;Dt++,Bt=pe.next())Bt=Ce(ue,Bt.value,Te),Bt!==null&&(se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt);return Nt&&he(ue,Dt),Xe}for(Ze=x(Ze);!Bt.done;Dt++,Bt=pe.next())Bt=st(Ze,ue,Dt,Bt.value,Te),Bt!==null&&(l&&Bt.alternate!==null&&Ze.delete(Bt.key===null?Dt:Bt.key),se=E(Bt,se,Dt),Ln===null?Xe=Bt:Ln.sibling=Bt,Ln=Bt);return l&&Ze.forEach(function(Sy){return c(ue,Sy)}),Nt&&he(ue,Dt),Xe}function rl(ue,se,pe,Te){if(typeof pe=="object"&&pe!==null&&pe.type===zl&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Yr:e:{for(var Xe=pe.key;se!==null;){if(se.key===Xe){if(Xe=pe.type,Xe===zl){if(se.tag===7){g(ue,se.sibling),Te=j(se,pe.props.children),Te.return=ue,ue=Te;break e}}else if(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ia&&rn(Xe)===se.type){g(ue,se.sibling),Te=j(se,pe.props),oa(Te,pe),Te.return=ue,ue=Te;break e}g(ue,se);break}else c(ue,se);se=se.sibling}pe.type===zl?(Te=Fs(pe.props.children,ue.mode,Te,pe.key),Te.return=ue,ue=Te):(Te=pi(pe.type,pe.key,pe.props,null,ue.mode,Te),oa(Te,pe),Te.return=ue,ue=Te)}return H(ue);case Dl:e:{for(Xe=pe.key;se!==null;){if(se.key===Xe)if(se.tag===4&&se.stateNode.containerInfo===pe.containerInfo&&se.stateNode.implementation===pe.implementation){g(ue,se.sibling),Te=j(se,pe.children||[]),Te.return=ue,ue=Te;break e}else{g(ue,se);break}else c(ue,se);se=se.sibling}Te=Vh(pe,ue.mode,Te),Te.return=ue,ue=Te}return H(ue);case Ia:return pe=rn(pe),rl(ue,se,pe,Te)}if(Qi(pe))return Ca(ue,se,pe,Te);if(b(pe)){if(Xe=b(pe),typeof Xe!="function")throw Error(i(150));return pe=Xe.call(pe),nc(ue,se,pe,Te)}if(typeof pe.then=="function")return rl(ue,se,Ra(pe),Te);if(pe.$$typeof===Zs)return rl(ue,se,Xn(ue,pe),Te);ls(ue,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(g(ue,se.sibling),Te=j(se,pe),Te.return=ue,ue=Te):(g(ue,se),Te=Ph(pe,ue.mode,Te),Te.return=ue,ue=Te),H(ue)):g(ue,se)}return function(ue,se,pe,Te){try{Vl=0;var Xe=rl(ue,se,pe,Te);return Ji=null,Xe}catch(Ze){if(Ze===ha||Ze===ar)throw Ze;var Ln=n(29,Ze,null,ue.mode);return Ln.lanes=Te,Ln.return=ue,Ln}finally{}}}function Ue(){for(var l=Zr,c=Ql=Zr=0;c<l;){var g=za[c];za[c++]=null;var x=za[c];za[c++]=null;var j=za[c];za[c++]=null;var E=za[c];if(za[c++]=null,x!==null&&j!==null){var H=x.pending;H===null?j.next=j:(j.next=H.next,H.next=j),x.pending=j}E!==0&&xt(g,j,E)}}function et(l,c,g,x){za[Zr++]=l,za[Zr++]=c,za[Zr++]=g,za[Zr++]=x,Ql|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Ve(l,c,g,x){return et(l,c,g,x),Fe(l)}function ct(l,c){return et(l,null,null,c),Fe(l)}function xt(l,c,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var j=!1,E=l.return;E!==null;)E.childLanes|=g,x=E.alternate,x!==null&&(x.childLanes|=g),E.tag===22&&(l=E.stateNode,l===null||l._visibility&1||(j=!0)),l=E,E=E.return;return l.tag===3?(E=l.stateNode,j&&c!==null&&(j=31-ps(g),l=E.hiddenUpdates,x=l[j],x===null?l[j]=[c]:x.push(c),c.lane=g|536870912),E):null}function Fe(l){if(50<Ut)throw Ut=0,Ou=null,Error(i(185));for(var c=l.return;c!==null;)l=c,c=l.return;return l.tag===3?l.stateNode:null}function ut(l){l.updateQueue={baseState:l.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sn(l,c){l=l.updateQueue,c.updateQueue===l&&(c.updateQueue={baseState:l.baseState,firstBaseUpdate:l.firstBaseUpdate,lastBaseUpdate:l.lastBaseUpdate,shared:l.shared,callbacks:null})}function Tt(l){return{lane:l,tag:0,payload:null,callback:null,next:null}}function pn(l,c,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(bt&2)!==0){var j=x.pending;return j===null?c.next=c:(c.next=j.next,j.next=c),x.pending=c,c=Fe(l),xt(l,null,g),c}return et(l,x,c,g),Fe(l)}function Rr(l,c,g){if(c=c.updateQueue,c!==null&&(c=c.shared,(g&4194048)!==0)){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,V(l,g)}}function os(l,c){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var j=null,E=null;if(g=g.firstBaseUpdate,g!==null){do{var H={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};E===null?j=E=H:E=E.next=H,g=g.next}while(g!==null);E===null?j=E=c:E=E.next=c}else j=E=c;g={baseState:x.baseState,firstBaseUpdate:j,lastBaseUpdate:E,shared:x.shared,callbacks:x.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=c:l.next=c,g.lastBaseUpdate=c}function Ka(){if(yf){var l=fa;if(l!==null)throw l}}function Gs(l,c,g,x){yf=!1;var j=l.updateQueue;zs=!1;var E=j.firstBaseUpdate,H=j.lastBaseUpdate,Z=j.shared.pending;if(Z!==null){j.shared.pending=null;var ge=Z,Ne=ge.next;ge.next=null,H===null?E=Ne:H.next=Ne,H=ge;var Oe=l.alternate;Oe!==null&&(Oe=Oe.updateQueue,Z=Oe.lastBaseUpdate,Z!==H&&(Z===null?Oe.firstBaseUpdate=Ne:Z.next=Ne,Oe.lastBaseUpdate=ge))}if(E!==null){var Ce=j.baseState;H=0,Oe=Ne=ge=null,Z=E;do{var Le=Z.lane&-536870913,st=Le!==Z.lane;if(st?(_t&Le)===Le:(x&Le)===Le){Le!==0&&Le===Si&&(yf=!0),Oe!==null&&(Oe=Oe.next={lane:0,tag:Z.tag,payload:Z.payload,callback:null,next:null});e:{var Ca=l,nc=Z;Le=c;var rl=g;switch(nc.tag){case 1:if(Ca=nc.payload,typeof Ca=="function"){Ce=Ca.call(rl,Ce,Le);break e}Ce=Ca;break e;case 3:Ca.flags=Ca.flags&-65537|128;case 0:if(Ca=nc.payload,Le=typeof Ca=="function"?Ca.call(rl,Ce,Le):Ca,Le==null)break e;Ce=Vd({},Ce,Le);break e;case 2:zs=!0}}Le=Z.callback,Le!==null&&(l.flags|=64,st&&(l.flags|=8192),st=j.callbacks,st===null?j.callbacks=[Le]:st.push(Le))}else st={lane:Le,tag:Z.tag,payload:Z.payload,callback:Z.callback,next:null},Oe===null?(Ne=Oe=st,ge=Ce):Oe=Oe.next=st,H|=Le;if(Z=Z.next,Z===null){if(Z=j.shared.pending,Z===null)break;st=Z,Z=st.next,st.next=null,j.lastBaseUpdate=st,j.shared.pending=null}}while(!0);Oe===null&&(ge=Ce),j.baseState=ge,j.firstBaseUpdate=Ne,j.lastBaseUpdate=Oe,E===null&&(j.shared.lanes=0),_i|=H,l.lanes=H,l.memoizedState=Ce}}function Pt(l,c){if(typeof l!="function")throw Error(i(191,l));l.call(c)}function pr(l,c){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Pt(g[l],c)}function mr(l,c){l=Jr,w(Wi,l),w(Kl,c),Jr=l|c.baseLanes}function js(){w(Wi,Jr),w(Kl,Kl.current)}function Tn(){Jr=Wi.current,C(Kl),C(Wi)}function Cs(l){var c=l.alternate;w(Gn,Gn.current&1),w(gs,l),es===null&&(c===null||Kl.current!==null||c.memoizedState!==null)&&(es=l)}function ud(l){w(Gn,Gn.current),w(gs,l),es===null&&(es=l)}function Mi(l){l.tag===22?(w(Gn,Gn.current),w(gs,l),es===null&&(es=l)):ws()}function ws(){w(Gn,Gn.current),w(gs,gs.current)}function Es(l){C(gs),es===l&&(es=null),C(Gn)}function Yc(l){for(var c=l;c!==null;){if(c.tag===13){var g=c.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Xi(g)||Wd(g)))return c}else if(c.tag===19&&(c.memoizedProps.revealOrder==="forwards"||c.memoizedProps.revealOrder==="backwards"||c.memoizedProps.revealOrder==="unstable_legacy-backwards"||c.memoizedProps.revealOrder==="together")){if((c.flags&128)!==0)return c}else if(c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return null;c=c.return}c.sibling.return=c.return,c=c.sibling}return null}function Rn(){throw Error(i(321))}function hh(l,c){if(c===null)return!1;for(var g=0;g<c.length&&g<l.length;g++)if(!Jn(l[g],c[g]))return!1;return!0}function xo(l,c,g,x,j,E){return Ni=E,it=c,c.memoizedState=null,c.updateQueue=null,c.lanes=0,Qe.H=l===null||l.memoizedState===null?Dn:Ir,Rt=!1,E=g(x,j),Rt=!1,dt&&(E=Or(c,g,x,j)),Vc(l),E}function Vc(l){Qe.H=ks;var c=Ye!==null&&Ye.next!==null;if(Ni=0,tt=Ye=it=null,ht=!1,sr=0,vr=null,c)throw Error(i(300));l===null||mn||(l=l.dependencies,l!==null&&qn(l)&&(mn=!0))}function Or(l,c,g,x){it=l;var j=0;do{if(dt&&(vr=null),sr=0,dt=!1,25<=j)throw Error(i(301));if(j+=1,tt=Ye=null,l.updateQueue!=null){var E=l.updateQueue;E.lastEffect=null,E.events=null,E.stores=null,E.memoCache!=null&&(E.memoCache.index=0)}Qe.H=$i,E=c(g,x)}while(dt);return E}function Ps(){var l=Qe.H,c=l.useState()[0];return c=typeof c.then=="function"?Ha(c):c,l=l.useState()[0],(Ye!==null?Ye.memoizedState:null)!==l&&(it.flags|=1024),c}function dd(){var l=Ya!==0;return Ya=0,l}function ph(l,c,g){c.updateQueue=l.updateQueue,c.flags&=-2053,l.lanes&=~g}function Qc(l){if(ht){for(l=l.memoizedState;l!==null;){var c=l.queue;c!==null&&(c.pending=null),l=l.next}ht=!1}Ni=0,tt=Ye=it=null,dt=!1,sr=Ya=0,vr=null}function qa(){var l={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return tt===null?it.memoizedState=tt=l:tt=tt.next=l,tt}function xn(){if(Ye===null){var l=it.alternate;l=l!==null?l.memoizedState:null}else l=Ye.next;var c=tt===null?it.memoizedState:tt.next;if(c!==null)tt=c,Ye=l;else{if(l===null)throw it.alternate===null?Error(i(467)):Error(i(310));Ye=l,l={memoizedState:Ye.memoizedState,baseState:Ye.baseState,baseQueue:Ye.baseQueue,queue:Ye.queue,next:null},tt===null?it.memoizedState=tt=l:tt=tt.next=l}return tt}function fd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ha(l){var c=sr;return sr+=1,vr===null&&(vr=[]),l=Hn(vr,l,c),c=it,(tt===null?c.memoizedState:tt.next)===null&&(c=c.alternate,Qe.H=c===null||c.memoizedState===null?Dn:Ir),l}function bo(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return Ha(l);if(l.$$typeof===Zs)return It(l)}throw Error(i(438,String(l)))}function hd(l){var c=null,g=it.updateQueue;if(g!==null&&(c=g.memoCache),c==null){var x=it.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(c={data:x.data.map(function(j){return j.slice()}),index:0})))}if(c==null&&(c={data:[],index:0}),g===null&&(g=fd(),it.updateQueue=g),g.memoCache=c,g=c.data[c.index],g===void 0)for(g=c.data[c.index]=Array(l),x=0;x<l;x++)g[x]=Kh;return c.index++,g}function gr(l,c){return typeof c=="function"?c(l):c}function li(l){var c=xn();return pd(c,Ye,l)}function pd(l,c,g){var x=l.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var j=l.baseQueue,E=x.pending;if(E!==null){if(j!==null){var H=j.next;j.next=E.next,E.next=H}c.baseQueue=j=E,x.pending=null}if(E=l.baseState,j===null)l.memoizedState=E;else{c=j.next;var Z=H=null,ge=null,Ne=c,Oe=!1;do{var Ce=Ne.lane&-536870913;if(Ce!==Ne.lane?(_t&Ce)===Ce:(Ni&Ce)===Ce){var Le=Ne.revertLane;if(Le===0)ge!==null&&(ge=ge.next={lane:0,revertLane:0,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),Ce===Si&&(Oe=!0);else if((Ni&Le)===Le){Ne=Ne.next,Le===Si&&(Oe=!0);continue}else Ce={lane:0,revertLane:Ne.revertLane,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(Z=ge=Ce,H=E):ge=ge.next=Ce,it.lanes|=Le,_i|=Le;Ce=Ne.action,Rt&&g(E,Ce),E=Ne.hasEagerState?Ne.eagerState:g(E,Ce)}else Le={lane:Ce,revertLane:Ne.revertLane,gesture:Ne.gesture,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ge===null?(Z=ge=Le,H=E):ge=ge.next=Le,it.lanes|=Ce,_i|=Ce;Ne=Ne.next}while(Ne!==null&&Ne!==c);if(ge===null?H=E:ge.next=Z,!Jn(E,l.memoizedState)&&(mn=!0,Oe&&(g=fa,g!==null)))throw g;l.memoizedState=E,l.baseState=H,l.baseQueue=ge,x.lastRenderedState=E}return j===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function md(l){var c=xn(),g=c.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var x=g.dispatch,j=g.pending,E=c.memoizedState;if(j!==null){g.pending=null;var H=j=j.next;do E=l(E,H.action),H=H.next;while(H!==j);Jn(E,c.memoizedState)||(mn=!0),c.memoizedState=E,c.baseQueue===null&&(c.baseState=E),g.lastRenderedState=E}return[E,x]}function Nl(l,c,g){var x=it,j=xn(),E=Nt;if(E){if(g===void 0)throw Error(i(407));g=g()}else g=c();var H=!Jn((Ye||j).memoizedState,g);if(H&&(j.memoizedState=g,mn=!0),j=j.queue,No(gh.bind(null,x,j,l),[l]),j.getSnapshot!==c||H||tt!==null&&tt.memoizedState.tag&1){if(x.flags|=2048,Ts(9,{destroy:void 0},mh.bind(null,x,j,g,c),null),pt===null)throw Error(i(349));E||(Ni&127)!==0||$m(x,c,g)}return g}function $m(l,c,g){l.flags|=16384,l={getSnapshot:c,value:g},c=it.updateQueue,c===null?(c=fd(),it.updateQueue=c,c.stores=[l]):(g=c.stores,g===null?c.stores=[l]:g.push(l))}function mh(l,c,g,x){c.value=g,c.getSnapshot=x,gd(c)&&eg(l)}function gh(l,c,g){return g(function(){gd(c)&&eg(l)})}function gd(l){var c=l.getSnapshot;l=l.value;try{var g=c();return!Jn(l,g)}catch{return!0}}function eg(l){var c=ct(l,2);c!==null&&Mn(c,l,2)}function yh(l){var c=qa();if(typeof l=="function"){var g=l;if(l=g(),Rt){J(!0);try{g()}finally{J(!1)}}}return c.memoizedState=c.baseState=l,c.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:l},c}function Kc(l,c,g,x){return l.baseState=g,pd(l,Ye,typeof x=="function"?x:gr)}function oi(l,c,g,x,j){if(jd(l))throw Error(i(485));if(l=c.action,l!==null){var E={payload:j,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(H){E.listeners.push(H)}};Qe.T!==null?g(!0):E.isTransition=!1,x(E),g=c.pending,g===null?(E.next=c.pending=E,yd(c,E)):(E.next=g.next,c.pending=g.next=E)}}function yd(l,c){var g=c.action,x=c.payload,j=l.state;if(c.isTransition){var E=Qe.T,H={};Qe.T=H;try{var Z=g(j,x),ge=Qe.S;ge!==null&&ge(H,Z),xd(l,c,Z)}catch(Ne){Ai(l,c,Ne)}finally{E!==null&&H.types!==null&&(E.types=H.types),Qe.T=E}}else try{E=g(j,x),xd(l,c,E)}catch(Ne){Ai(l,c,Ne)}}function xd(l,c,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){_l(l,c,x)},function(x){return Ai(l,c,x)}):_l(l,c,g)}function _l(l,c,g){c.status="fulfilled",c.value=g,xh(c),l.state=g,c=l.pending,c!==null&&(g=c.next,g===c?l.pending=null:(g=g.next,c.next=g,yd(l,g)))}function Ai(l,c,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do c.status="rejected",c.reason=g,xh(c),c=c.next;while(c!==x)}l.action=null}function xh(l){l=l.listeners;for(var c=0;c<l.length;c++)(0,l[c])()}function bd(l,c){return c}function bh(l,c){if(Nt){var g=pt.formState;if(g!==null){e:{var x=it;if(Nt){if(Sn){var j=Fg(Sn,Wa);if(j){Sn=Zg(j),x=dp(j);break e}}ze(x)}x=!1}x&&(c=g[0])}}g=qa(),g.memoizedState=g.baseState=c,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:bd,lastRenderedState:c},g.queue=x,g=ig.bind(null,it,x),x.dispatch=g,x=yh(!1);var E=_d.bind(null,it,!1,x.queue);return x=qa(),j={state:c,dispatch:null,action:l,pending:null},x.queue=j,g=oi.bind(null,it,j,E,g),j.dispatch=g,x.memoizedState=l,[c,g,!1]}function vo(l){var c=xn();return Mr(c,Ye,l)}function Mr(l,c,g){if(c=pd(l,c,bd)[0],l=li(gr)[0],typeof c=="object"&&c!==null&&typeof c.then=="function")try{var x=Ha(c)}catch(H){throw H===ha?ar:H}else x=c;c=xn();var j=c.queue,E=j.dispatch;return g!==c.memoizedState&&(it.flags|=2048,Ts(9,{destroy:void 0},vh.bind(null,j,g),null)),[x,E,l]}function vh(l,c){l.action=c}function So(l){var c=xn(),g=Ye;if(g!==null)return Mr(c,g,l);xn(),c=c.memoizedState,g=xn();var x=g.queue.dispatch;return g.memoizedState=l,[c,x,!1]}function Ts(l,c,g,x){return l={tag:l,create:g,deps:x,inst:c,next:null},c=it.updateQueue,c===null&&(c=fd(),it.updateQueue=c),g=c.lastEffect,g===null?c.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,c.lastEffect=l),l}function vd(){return xn().memoizedState}function jl(l,c,g,x){var j=qa();it.flags|=l,j.memoizedState=Ts(1|c,{destroy:void 0},g,x===void 0?null:x)}function Xc(l,c,g,x){var j=xn();x=x===void 0?null:x;var E=j.memoizedState.inst;Ye!==null&&x!==null&&hh(x,Ye.memoizedState.deps)?j.memoizedState=Ts(c,E,g,x):(it.flags|=l,j.memoizedState=Ts(1|c,E,g,x))}function Fc(l,c){jl(8390656,8,l,c)}function No(l,c){Xc(2048,8,l,c)}function tg(l){it.flags|=4;var c=it.updateQueue;if(c===null)c=fd(),it.updateQueue=c,c.events=[l];else{var g=c.events;g===null?c.events=[l]:g.push(l)}}function Xa(l){var c=xn().memoizedState;return tg({ref:c,nextImpl:l}),function(){if((bt&2)!==0)throw Error(i(440));return c.impl.apply(void 0,arguments)}}function Di(l,c){return Xc(4,2,l,c)}function Zc(l,c){return Xc(4,4,l,c)}function _o(l,c){if(typeof c=="function"){l=l();var g=c(l);return function(){typeof g=="function"?g():c(null)}}if(c!=null)return l=l(),c.current=l,function(){c.current=null}}function ng(l,c,g){g=g!=null?g.concat([l]):null,Xc(4,4,_o.bind(null,c,l),g)}function Ic(){}function Sd(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;return c!==null&&hh(c,x[1])?x[0]:(g.memoizedState=[l,c],l)}function jo(l,c){var g=xn();c=c===void 0?null:c;var x=g.memoizedState;if(c!==null&&hh(c,x[1]))return x[0];if(x=l(),Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,c],x}function Co(l,c,g){return g===void 0||(Ni&1073741824)!==0&&(_t&261930)===0?l.memoizedState=c:(l.memoizedState=g,l=di(),it.lanes|=l,_i|=l,g)}function Sh(l,c,g,x){return Jn(g,c)?g:Kl.current!==null?(l=Co(l,g,x),Jn(l,c)||(mn=!0),l):(Ni&42)===0||(Ni&1073741824)!==0&&(_t&261930)===0?(mn=!0,l.memoizedState=g):(l=di(),it.lanes|=l,_i|=l,c)}function ag(l,c,g,x,j){var E=Is();St(E!==0&&8>E?E:8);var H=Qe.T,Z={};Qe.T=Z,_d(l,!1,c,g);try{var ge=j(),Ne=Qe.S;if(Ne!==null&&Ne(Z,ge),ge!==null&&typeof ge=="object"&&typeof ge.then=="function"){var Oe=_s(ge,x);Jc(l,c,Oe,bn(l))}else Jc(l,c,x,bn(l))}catch(Ce){Jc(l,c,{then:function(){},status:"rejected",reason:Ce},bn())}finally{St(E),H!==null&&Z.types!==null&&(H.types=Z.types),Qe.T=H}}function sg(l){var c=l.memoizedState;if(c!==null)return c;c={memoizedState:ql,baseState:ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:ql},next:null};var g={};return c.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:gr,lastRenderedState:g},next:null},l.memoizedState=c,l=l.alternate,l!==null&&(l.memoizedState=c),c}function Nh(){return It(Hl)}function Nd(){return xn().memoizedState}function rg(){return xn().memoizedState}function cy(l){for(var c=l.return;c!==null;){switch(c.tag){case 24:case 3:var g=bn();l=Tt(g);var x=pn(c,l,g);x!==null&&(Mn(x,c,g),Rr(x,c,g)),c={cache:dr()},l.payload=c;return}c=c.return}}function uy(l,c,g){var x=bn();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},jd(l)?lg(c,g):(g=Ve(l,c,g,x),g!==null&&(Mn(g,l,x),og(g,c,x)))}function ig(l,c,g){var x=bn();Jc(l,c,g,x)}function Jc(l,c,g,x){var j={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(jd(l))lg(c,j);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=c.lastRenderedReducer,E!==null))try{var H=c.lastRenderedState,Z=E(H,g);if(j.hasEagerState=!0,j.eagerState=Z,Jn(Z,H))return et(l,c,j,0),pt===null&&Ue(),!1}catch{}finally{}if(g=Ve(l,c,j,x),g!==null)return Mn(g,l,x),og(g,c,x),!0}return!1}function _d(l,c,g,x){if(x={lane:2,revertLane:Ta(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},jd(l)){if(c)throw Error(i(479))}else c=Ve(l,g,x,2),c!==null&&Mn(c,l,2)}function jd(l){var c=l.alternate;return l===it||c!==null&&c===it}function lg(l,c){dt=ht=!0;var g=l.pending;g===null?c.next=c:(c.next=g.next,g.next=c),l.pending=c}function og(l,c,g){if((g&4194048)!==0){var x=c.lanes;x&=l.pendingLanes,g|=x,c.lanes=g,V(l,g)}}function _h(l,c,g,x){c=l.memoizedState,g=g(x,c),g=g==null?c:Vd({},c,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}function Cd(l,c,g,x,j,E,H){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,E,H):c.prototype&&c.prototype.isPureReactComponent?!Qt(g,x)||!Qt(j,E):!0}function cg(l,c,g,x){l=c.state,typeof c.componentWillReceiveProps=="function"&&c.componentWillReceiveProps(g,x),typeof c.UNSAFE_componentWillReceiveProps=="function"&&c.UNSAFE_componentWillReceiveProps(g,x),c.state!==l&&Cu.enqueueReplaceState(c,c.state,null)}function Cl(l,c){var g=c;if("ref"in c){g={};for(var x in c)x!=="ref"&&(g[x]=c[x])}if(l=l.defaultProps){g===c&&(g=Vd({},g));for(var j in l)g[j]===void 0&&(g[j]=l[j])}return g}function wd(l,c){try{var g=l.onUncaughtError;g(c.value,{componentStack:c.stack})}catch(x){setTimeout(function(){throw x})}}function jh(l,c,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:c.tag===1?c.stateNode:null})}catch(j){setTimeout(function(){throw j})}}function Ch(l,c,g){return g=Tt(g),g.tag=3,g.payload={element:null},g.callback=function(){wd(l,c)},g}function ug(l){return l=Tt(l),l.tag=3,l}function dg(l,c,g,x){var j=g.type.getDerivedStateFromError;if(typeof j=="function"){var E=x.value;l.payload=function(){return j(E)},l.callback=function(){jh(c,g,x)}}var H=g.stateNode;H!==null&&typeof H.componentDidCatch=="function"&&(l.callback=function(){jh(c,g,x),typeof j!="function"&&(ji===null?ji=new Set([this]):ji.add(this));var Z=x.stack;this.componentDidCatch(x.value,{componentStack:Z!==null?Z:""})})}function dy(l,c,g,x,j){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(c=g.alternate,c!==null&&Et(c,g,j,!0),g=gs.current,g!==null){switch(g.tag){case 31:case 13:return es===null?Lo():g.alternate===null&&kn===0&&(kn=3),g.flags&=-257,g.flags|=65536,g.lanes=j,x===Fr?g.flags|=16384:(c=g.updateQueue,c===null?g.updateQueue=new Set([x]):c.add(x),Ho(l,x,j)),!1;case 22:return g.flags|=65536,x===Fr?g.flags|=16384:(c=g.updateQueue,c===null?(c={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=c):(g=c.retryQueue,g===null?c.retryQueue=new Set([x]):g.add(x)),Ho(l,x,j)),!1}throw Error(i(435,g.tag))}return Ho(l,x,j),Lo(),!1}if(Nt)return c=gs.current,c!==null?((c.flags&65536)===0&&(c.flags|=256),c.flags|=65536,c.lanes=j,x!==pf&&(l=Error(i(422),{cause:x}),Kn(je(l,g)))):(x!==pf&&(c=Error(i(423),{cause:x}),Kn(je(c,g))),l=l.current.alternate,l.flags|=65536,j&=-j,l.lanes|=j,x=je(x,g),j=Ch(l.stateNode,x,j),os(l,j),kn!==4&&(kn=2)),!1;var E=Error(i(520),{cause:x});if(E=je(E,g),Eu===null?Eu=[E]:Eu.push(E),kn!==4&&(kn=2),c===null)return!0;x=je(x,g),g=c;do{switch(g.tag){case 3:return g.flags|=65536,l=j&-j,g.lanes|=l,l=Ch(g.stateNode,x,l),os(g,l),!1;case 1:if(c=g.type,E=g.stateNode,(g.flags&128)===0&&(typeof c.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(ji===null||!ji.has(E))))return g.flags|=65536,j&=-j,g.lanes|=j,j=ug(j),dg(j,l,g,x),os(g,j),!1}g=g.return}while(g!==null);return!1}function Oa(l,c,g,x){c.child=l===null?Rp(c,null,g,x):Da(c,l.child,g,x)}function fg(l,c,g,x,j){g=g.render;var E=c.ref;if("ref"in x){var H={};for(var Z in x)Z!=="ref"&&(H[Z]=x[Z])}else H=x;return hn(c),x=xo(l,c,g,H,E,j),Z=dd(),l!==null&&!mn?(ph(l,c,j),Ar(l,c,j)):(Nt&&Z&&W(c),c.flags|=1,Oa(l,c,x,j),c.child)}function hg(l,c,g,x,j){if(l===null){var E=g.type;return typeof E=="function"&&!Ol(E)&&E.defaultProps===void 0&&g.compare===null?(c.tag=15,c.type=E,pg(l,c,E,x,j)):(l=pi(g.type,null,x,c,c.mode,j),l.ref=c.ref,l.return=c,c.child=l)}if(E=l.child,!$c(l,j)){var H=E.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(H,x)&&l.ref===c.ref)return Ar(l,c,j)}return c.flags|=1,l=Ms(E,x),l.ref=c.ref,l.return=c,c.child=l}function pg(l,c,g,x,j){if(l!==null){var E=l.memoizedProps;if(Qt(E,x)&&l.ref===c.ref)if(mn=!1,c.pendingProps=x=E,$c(l,j))(l.flags&131072)!==0&&(mn=!0);else return c.lanes=l.lanes,Ar(l,c,j)}return Td(l,c,g,x,j)}function mg(l,c,g,x){var j=x.children,E=l!==null?l.memoizedState:null;if(l===null&&c.stateNode===null&&(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((c.flags&128)!==0){if(E=E!==null?E.baseLanes|g:g,l!==null){for(x=c.child=l.child,j=0;x!==null;)j=j|x.lanes|x.childLanes,x=x.sibling;x=j&~E}else x=0,c.child=null;return wo(l,c,E,g,x)}if((g&536870912)!==0)c.memoizedState={baseLanes:0,cachePool:null},l!==null&&yt(c,E!==null?E.cachePool:null),E!==null?mr(c,E):js(),Mi(c);else return x=c.lanes=536870912,wo(l,c,E!==null?E.baseLanes|g:g,g,x)}else E!==null?(yt(c,E.cachePool),mr(c,E),ws(),c.memoizedState=null):(l!==null&&yt(c,null),js(),ws());return Oa(l,c,j,g),c.child}function wl(l,c){return l!==null&&l.tag===22||c.stateNode!==null||(c.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.sibling}function wo(l,c,g,x,j){var E=hr();return E=E===null?null:{parent:Zn?Nn._currentValue:Nn._currentValue2,pool:E},c.memoizedState={baseLanes:g,cachePool:E},l!==null&&yt(c,null),js(),Mi(c),l!==null&&Et(l,c,x,!0),c.childLanes=j,null}function Ed(l,c){return c=zi({mode:c.mode,children:c.children},l.mode),c.ref=l.ref,l.child=c,c.return=l,c}function wh(l,c,g){return Da(c,l.child,null,g),l=Ed(c,c.pendingProps),l.flags|=2,Es(c),c.memoizedState=null,l}function gg(l,c,g){var x=c.pendingProps,j=(c.flags&128)!==0;if(c.flags&=-129,l===null){if(Nt){if(x.mode==="hidden")return l=Ed(c,x),c.lanes=536870912,wl(null,l);if(ud(c),(l=Sn)?(l=hp(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Yh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw ze(c);return c.lanes=536870912,null}return Ed(c,x)}var E=l.memoizedState;if(E!==null){var H=E.dehydrated;if(ud(c),j)if(c.flags&256)c.flags&=-257,c=wh(l,c,g);else if(c.memoizedState!==null)c.child=l.child,c.flags|=128,c=null;else throw Error(i(558));else if(mn||Et(l,c,g,!1),j=(g&l.childLanes)!==0,mn||j){if(x=pt,x!==null&&(H=F(x,g),H!==0&&H!==E.retryLane))throw E.retryLane=H,ct(l,H),Mn(x,l,H),ts;Lo(),c=wh(l,c,g)}else l=E.treeContext,vn&&(Sn=$g(H),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&be(c,l)),c=Ed(c,x),c.flags|=4096;return c}return l=Ms(l.child,{mode:x.mode,children:x.children}),l.ref=c.ref,c.child=l,l.return=c,l}function Wc(l,c){var g=c.ref;if(g===null)l!==null&&l.ref!==null&&(c.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(l===null||l.ref!==g)&&(c.flags|=4194816)}}function Td(l,c,g,x,j){return hn(c),g=xo(l,c,g,x,void 0,j),x=dd(),l!==null&&!mn?(ph(l,c,j),Ar(l,c,j)):(Nt&&x&&W(c),c.flags|=1,Oa(l,c,g,j),c.child)}function Eh(l,c,g,x,j,E){return hn(c),c.updateQueue=null,g=Or(c,x,g,j),Vc(l),x=dd(),l!==null&&!mn?(ph(l,c,E),Ar(l,c,E)):(Nt&&x&&W(c),c.flags|=1,Oa(l,c,g,E),c.child)}function El(l,c,g,x,j){if(hn(c),c.stateNode===null){var E=Vr,H=g.contextType;typeof H=="object"&&H!==null&&(E=It(H)),E=new g(x,E),c.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=Cu,c.stateNode=E,E._reactInternals=c,E=c.stateNode,E.props=x,E.state=c.memoizedState,E.refs={},ut(c),H=g.contextType,E.context=typeof H=="object"&&H!==null?It(H):Vr,E.state=c.memoizedState,H=g.getDerivedStateFromProps,typeof H=="function"&&(_h(c,g,H,x),E.state=c.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(H=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),H!==E.state&&Cu.enqueueReplaceState(E,E.state,null),Gs(c,x,E,j),Ka(),E.state=c.memoizedState),typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!0}else if(l===null){E=c.stateNode;var Z=c.memoizedProps,ge=Cl(g,Z);E.props=ge;var Ne=E.context,Oe=g.contextType;H=Vr,typeof Oe=="object"&&Oe!==null&&(H=It(Oe));var Ce=g.getDerivedStateFromProps;Oe=typeof Ce=="function"||typeof E.getSnapshotBeforeUpdate=="function",Z=c.pendingProps!==Z,Oe||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(Z||Ne!==H)&&cg(c,E,x,H),zs=!1;var Le=c.memoizedState;E.state=Le,Gs(c,x,E,j),Ka(),Ne=c.memoizedState,Z||Le!==Ne||zs?(typeof Ce=="function"&&(_h(c,g,Ce,x),Ne=c.memoizedState),(ge=zs||Cd(c,g,ge,x,Le,Ne,H))?(Oe||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount()),typeof E.componentDidMount=="function"&&(c.flags|=4194308)):(typeof E.componentDidMount=="function"&&(c.flags|=4194308),c.memoizedProps=x,c.memoizedState=Ne),E.props=x,E.state=Ne,E.context=H,x=ge):(typeof E.componentDidMount=="function"&&(c.flags|=4194308),x=!1)}else{E=c.stateNode,sn(l,c),H=c.memoizedProps,Oe=Cl(g,H),E.props=Oe,Ce=c.pendingProps,Le=E.context,Ne=g.contextType,ge=Vr,typeof Ne=="object"&&Ne!==null&&(ge=It(Ne)),Z=g.getDerivedStateFromProps,(Ne=typeof Z=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(H!==Ce||Le!==ge)&&cg(c,E,x,ge),zs=!1,Le=c.memoizedState,E.state=Le,Gs(c,x,E,j),Ka();var st=c.memoizedState;H!==Ce||Le!==st||zs||l!==null&&l.dependencies!==null&&qn(l.dependencies)?(typeof Z=="function"&&(_h(c,g,Z,x),st=c.memoizedState),(Oe=zs||Cd(c,g,Oe,x,Le,st,ge)||l!==null&&l.dependencies!==null&&qn(l.dependencies))?(Ne||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(x,st,ge),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(x,st,ge)),typeof E.componentDidUpdate=="function"&&(c.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(c.flags|=1024)):(typeof E.componentDidUpdate!="function"||H===l.memoizedProps&&Le===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||H===l.memoizedProps&&Le===l.memoizedState||(c.flags|=1024),c.memoizedProps=x,c.memoizedState=st),E.props=x,E.state=st,E.context=ge,x=Oe):(typeof E.componentDidUpdate!="function"||H===l.memoizedProps&&Le===l.memoizedState||(c.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||H===l.memoizedProps&&Le===l.memoizedState||(c.flags|=1024),x=!1)}return E=x,Wc(l,c),x=(c.flags&128)!==0,E||x?(E=c.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:E.render(),c.flags|=1,l!==null&&x?(c.child=Da(c,l.child,null,j),c.child=Da(c,null,g,j)):Oa(l,c,g,j),c.memoizedState=E.state,l=c.child):l=Ar(l,c,j),l}function yg(l,c,g,x){return Ht(),c.flags|=256,Oa(l,c,g,x),c.child}function Th(l){return{baseLanes:l,cachePool:mt()}}function Rh(l,c,g){return l=l!==null?l.childLanes&~g:0,c&&(l|=ns),l}function Oh(l,c,g){var x=c.pendingProps,j=!1,E=(c.flags&128)!==0,H;if((H=E)||(H=l!==null&&l.memoizedState===null?!1:(Gn.current&2)!==0),H&&(j=!0,c.flags&=-129),H=(c.flags&32)!==0,c.flags&=-33,l===null){if(Nt){if(j?Cs(c):ws(),(l=Sn)?(l=a0(l,Wa),l!==null&&(c.memoizedState={dehydrated:l,treeContext:$s!==null?{id:Ma,overflow:xr}:null,retryLane:536870912,hydrationErrors:null},g=Yh(l),g.return=c,c.child=g,da=c,Sn=null)):l=null,l===null)throw ze(c);return Wd(l)?c.lanes=32:c.lanes=536870912,null}var Z=x.children;return x=x.fallback,j?(ws(),j=c.mode,Z=zi({mode:"hidden",children:Z},j),x=Fs(x,j,g,null),Z.return=c,x.return=c,Z.sibling=x,c.child=Z,x=c.child,x.memoizedState=Th(g),x.childLanes=Rh(l,H,g),c.memoizedState=Xl,wl(null,x)):(Cs(c),Rd(c,Z))}var ge=l.memoizedState;if(ge!==null&&(Z=ge.dehydrated,Z!==null)){if(E)c.flags&256?(Cs(c),c.flags&=-257,c=Tl(l,c,g)):c.memoizedState!==null?(ws(),c.child=l.child,c.flags|=128,c=null):(ws(),Z=x.fallback,j=c.mode,x=zi({mode:"visible",children:x.children},j),Z=Fs(Z,j,g,null),Z.flags|=2,x.return=c,Z.return=c,x.sibling=Z,c.child=x,Da(c,l.child,null,g),x=c.child,x.memoizedState=Th(g),x.childLanes=Rh(l,H,g),c.memoizedState=Xl,c=wl(null,x));else if(Cs(c),Wd(Z))H=$d(Z).digest,x=Error(i(419)),x.stack="",x.digest=H,Kn({value:x,source:null,stack:null}),c=Tl(l,c,g);else if(mn||Et(l,c,g,!1),H=(g&l.childLanes)!==0,mn||H){if(H=pt,H!==null&&(x=F(H,g),x!==0&&x!==ge.retryLane))throw ge.retryLane=x,ct(l,x),Mn(H,l,x),ts;Xi(Z)||Lo(),c=Tl(l,c,g)}else Xi(Z)?(c.flags|=192,c.child=l.child,c=null):(l=ge.treeContext,vn&&(Sn=e0(Z),da=c,Nt=!0,Xr=null,Wa=!1,l!==null&&be(c,l)),c=Rd(c,x.children),c.flags|=4096);return c}return j?(ws(),Z=x.fallback,j=c.mode,ge=l.child,E=ge.sibling,x=Ms(ge,{mode:"hidden",children:x.children}),x.subtreeFlags=ge.subtreeFlags&65011712,E!==null?Z=Ms(E,Z):(Z=Fs(Z,j,g,null),Z.flags|=2),Z.return=c,x.return=c,x.sibling=Z,c.child=x,wl(null,x),x=c.child,Z=l.child.memoizedState,Z===null?Z=Th(g):(j=Z.cachePool,j!==null?(ge=Zn?Nn._currentValue:Nn._currentValue2,j=j.parent!==ge?{parent:ge,pool:ge}:j):j=mt(),Z={baseLanes:Z.baseLanes|g,cachePool:j}),x.memoizedState=Z,x.childLanes=Rh(l,H,g),c.memoizedState=Xl,wl(l.child,x)):(Cs(c),g=l.child,l=g.sibling,g=Ms(g,{mode:"visible",children:x.children}),g.return=c,g.sibling=null,l!==null&&(H=c.deletions,H===null?(c.deletions=[l],c.flags|=16):H.push(l)),c.child=g,c.memoizedState=null,g)}function Rd(l,c){return c=zi({mode:"visible",children:c},l.mode),c.return=l,l.child=c}function zi(l,c){return l=n(22,l,null,c),l.lanes=0,l}function Tl(l,c,g){return Da(c,l.child,null,g),l=Rd(c,c.pendingProps.children),l.flags|=2,c.memoizedState=null,l}function xg(l,c,g){l.lanes|=c;var x=l.alternate;x!==null&&(x.lanes|=c),ur(l.return,c,g)}function Eo(l,c,g,x,j,E){var H=l.memoizedState;H===null?l.memoizedState={isBackwards:c,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:j,treeForkCount:E}:(H.isBackwards=c,H.rendering=null,H.renderingStartTime=0,H.last=x,H.tail=g,H.tailMode=j,H.treeForkCount=E)}function Mh(l,c,g){var x=c.pendingProps,j=x.revealOrder,E=x.tail;x=x.children;var H=Gn.current,Z=(H&2)!==0;if(Z?(H=H&1|2,c.flags|=128):H&=1,w(Gn,H),Oa(l,c,x,g),x=Nt?Nu:0,!Z&&l!==null&&(l.flags&128)!==0)e:for(l=c.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&xg(l,g,c);else if(l.tag===19)xg(l,g,c);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===c)break e;for(;l.sibling===null;){if(l.return===null||l.return===c)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(j){case"forwards":for(g=c.child,j=null;g!==null;)l=g.alternate,l!==null&&Yc(l)===null&&(j=g),g=g.sibling;g=j,g===null?(j=c.child,c.child=null):(j=g.sibling,g.sibling=null),Eo(c,!1,j,g,E,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,j=c.child,c.child=null;j!==null;){if(l=j.alternate,l!==null&&Yc(l)===null){c.child=j;break}l=j.sibling,j.sibling=g,g=j,j=l}Eo(c,!0,g,null,E,x);break;case"together":Eo(c,!1,null,null,void 0,x);break;default:c.memoizedState=null}return c.child}function Ar(l,c,g){if(l!==null&&(c.dependencies=l.dependencies),_i|=c.lanes,(g&c.childLanes)===0)if(l!==null){if(Et(l,c,g,!1),(g&c.childLanes)===0)return null}else return null;if(l!==null&&c.child!==l.child)throw Error(i(153));if(c.child!==null){for(l=c.child,g=Ms(l,l.pendingProps),c.child=g,g.return=c;l.sibling!==null;)l=l.sibling,g=g.sibling=Ms(l,l.pendingProps),g.return=c;g.sibling=null}return c.child}function $c(l,c){return(l.lanes&c)!==0?!0:(l=l.dependencies,!!(l!==null&&qn(l)))}function Ah(l,c,g){switch(c.tag){case 3:_e(c,c.stateNode.containerInfo),Gt(c,Nn,l.memoizedState.cache),Ht();break;case 27:case 5:we(c);break;case 4:_e(c,c.stateNode.containerInfo);break;case 10:Gt(c,c.type,c.memoizedProps.value);break;case 31:if(c.memoizedState!==null)return c.flags|=128,ud(c),null;break;case 13:var x=c.memoizedState;if(x!==null)return x.dehydrated!==null?(Cs(c),c.flags|=128,null):(g&c.child.childLanes)!==0?Oh(l,c,g):(Cs(c),l=Ar(l,c,g),l!==null?l.sibling:null);Cs(c);break;case 19:var j=(l.flags&128)!==0;if(x=(g&c.childLanes)!==0,x||(Et(l,c,g,!1),x=(g&c.childLanes)!==0),j){if(x)return Mh(l,c,g);c.flags|=128}if(j=c.memoizedState,j!==null&&(j.rendering=null,j.tail=null,j.lastEffect=null),w(Gn,Gn.current),x)break;return null;case 22:return c.lanes=0,mg(l,c,g,c.pendingProps);case 24:Gt(c,Nn,l.memoizedState.cache)}return Ar(l,c,g)}function Dh(l,c,g){if(l!==null)if(l.memoizedProps!==c.pendingProps)mn=!0;else{if(!$c(l,g)&&(c.flags&128)===0)return mn=!1,Ah(l,c,g);mn=(l.flags&131072)!==0}else mn=!1,Nt&&(c.flags&1048576)!==0&&G(c,Nu,c.index);switch(c.lanes=0,c.tag){case 16:e:{var x=c.pendingProps;if(l=rn(c.elementType),c.type=l,typeof l=="function")Ol(l)?(x=Cl(l,x),c.tag=1,c=El(null,c,l,x,g)):(c.tag=0,c=Td(null,c,l,x,g));else{if(l!=null){var j=l.$$typeof;if(j===Bo){c.tag=11,c=fg(null,c,l,x,g);break e}else if(j===Kd){c.tag=14,c=hg(null,c,l,x,g);break e}}throw c=v(l)||l,Error(i(306,c,""))}}return c;case 0:return Td(l,c,c.type,c.pendingProps,g);case 1:return x=c.type,j=Cl(x,c.pendingProps),El(l,c,x,j,g);case 3:e:{if(_e(c,c.stateNode.containerInfo),l===null)throw Error(i(387));var E=c.pendingProps;j=c.memoizedState,x=j.element,sn(l,c),Gs(c,E,null,g);var H=c.memoizedState;if(E=H.cache,Gt(c,Nn,E),E!==j.cache&&Zt(c,[Nn],g,!0),Ka(),E=H.element,vn&&j.isDehydrated)if(j={element:E,isDehydrated:!1,cache:H.cache},c.updateQueue.baseState=j,c.memoizedState=j,c.flags&256){c=yg(l,c,E,g);break e}else if(E!==x){x=je(Error(i(424)),c),Kn(x),c=yg(l,c,E,g);break e}else for(vn&&(Sn=Wg(c.stateNode.containerInfo),da=c,Nt=!0,Xr=null,Wa=!0),g=Rp(c,null,E,g),c.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(Ht(),E===x){c=Ar(l,c,g);break e}Oa(l,c,E,g)}c=c.child}return c;case 26:if(Js)return Wc(l,c),l===null?(g=xp(c.type,null,c.pendingProps,null))?c.memoizedState=g:Nt||(c.stateNode=af(c.type,c.pendingProps,Aa.current,c)):c.memoizedState=xp(c.type,l.memoizedProps,c.pendingProps,l.memoizedState),null;case 27:if(ua)return we(c),l===null&&ua&&Nt&&(x=c.stateNode=sf(c.type,c.pendingProps,Aa.current,_a.current,!1),da=c,Wa=!0,Sn=fp(c.type,x,Sn)),Oa(l,c,c.pendingProps.children,g),Wc(l,c),l===null&&(c.flags|=4194304),c.child;case 5:return l===null&&Nt&&(f0(c.type,c.pendingProps,_a.current),(j=x=Sn)&&(x=t0(x,c.type,c.pendingProps,Wa),x!==null?(c.stateNode=x,da=c,Sn=Jg(x),Wa=!1,j=!0):j=!1),j||ze(c)),we(c),j=c.type,E=c.pendingProps,H=l!==null?l.memoizedProps:null,x=E.children,Ja(j,E)?x=null:H!==null&&Ja(j,H)&&(c.flags|=32),c.memoizedState!==null&&(j=xo(l,c,Ps,null,null,g),Zn?Hl._currentValue=j:Hl._currentValue2=j),Wc(l,c),Oa(l,c,x,g),c.child;case 6:return l===null&&Nt&&(yp(c.pendingProps,_a.current),(l=g=Sn)&&(g=n0(g,c.pendingProps,Wa),g!==null?(c.stateNode=g,da=c,Sn=null,l=!0):l=!1),l||ze(c)),null;case 13:return Oh(l,c,g);case 4:return _e(c,c.stateNode.containerInfo),x=c.pendingProps,l===null?c.child=Da(c,null,x,g):Oa(l,c,x,g),c.child;case 11:return fg(l,c,c.type,c.pendingProps,g);case 7:return Oa(l,c,c.pendingProps,g),c.child;case 8:return Oa(l,c,c.pendingProps.children,g),c.child;case 12:return Oa(l,c,c.pendingProps.children,g),c.child;case 10:return x=c.pendingProps,Gt(c,c.type,x.value),Oa(l,c,x.children,g),c.child;case 9:return j=c.type._context,x=c.pendingProps.children,hn(c),j=It(j),x=x(j),c.flags|=1,Oa(l,c,x,g),c.child;case 14:return hg(l,c,c.type,c.pendingProps,g);case 15:return pg(l,c,c.type,c.pendingProps,g);case 19:return Mh(l,c,g);case 31:return gg(l,c,g);case 22:return mg(l,c,g,c.pendingProps);case 24:return hn(c),x=It(Nn),l===null?(j=hr(),j===null&&(j=pt,E=dr(),j.pooledCache=E,E.refCount++,E!==null&&(j.pooledCacheLanes|=g),j=E),c.memoizedState={parent:x,cache:j},ut(c),Gt(c,Nn,j)):((l.lanes&g)!==0&&(sn(l,c),Gs(c,null,null,g),Ka()),j=l.memoizedState,E=c.memoizedState,j.parent!==x?(j={parent:x,cache:x},c.memoizedState=j,c.lanes===0&&(c.memoizedState=c.updateQueue.baseState=j),Gt(c,Nn,x)):(x=E.cache,Gt(c,Nn,x),x!==j.cache&&Zt(c,[Nn],g,!0))),Oa(l,c,c.pendingProps.children,g),c.child;case 29:throw c.pendingProps}throw Error(i(156,c.tag))}function Ys(l){l.flags|=4}function eu(l){As&&(l.flags|=8)}function bg(l,c){if(l!==null&&l.child===c.child)return!1;if((c.flags&16)!==0)return!0;for(l=c.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function zh(l,c,g,x){if(wt)for(g=c.child;g!==null;){if(g.tag===5||g.tag===6)pu(l,g.stateNode);else if(!(g.tag===4||ua&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===c)break;for(;g.sibling===null;){if(g.return===null||g.return===c)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(As)for(var j=c.child;j!==null;){if(j.tag===5){var E=j.stateNode;g&&x&&(E=Xg(E,j.type,j.memoizedProps)),pu(l,E)}else if(j.tag===6)E=j.stateNode,g&&x&&(E=up(E,j.memoizedProps)),pu(l,E);else if(j.tag!==4){if(j.tag===22&&j.memoizedState!==null)E=j.child,E!==null&&(E.return=j),zh(l,j,!0,!0);else if(j.child!==null){j.child.return=j,j=j.child;continue}}if(j===c)break;for(;j.sibling===null;){if(j.return===null||j.return===c)return;j=j.return}j.sibling.return=j.return,j=j.sibling}}function vg(l,c,g,x){var j=!1;if(As)for(var E=c.child;E!==null;){if(E.tag===5){var H=E.stateNode;g&&x&&(H=Xg(H,E.type,E.memoizedProps)),op(l,H)}else if(E.tag===6)H=E.stateNode,g&&x&&(H=up(H,E.memoizedProps)),op(l,H);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)j=E.child,j!==null&&(j.return=E),vg(l,E,!0,!0),j=!0;else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===c)break;for(;E.sibling===null;){if(E.return===null||E.return===c)return j;E=E.return}E.sibling.return=E.return,E=E.sibling}return j}function Sg(l,c){if(As&&bg(l,c)){l=c.stateNode;var g=l.containerInfo,x=lp();vg(x,c,!1,!1),l.pendingChildren=x,Ys(c),Kg(g,x)}}function kh(l,c,g,x){if(wt)l.memoizedProps!==x&&Ys(c);else if(As){var j=l.stateNode,E=l.memoizedProps;if((l=bg(l,c))||E!==x){var H=_a.current;E=Qg(j,g,E,x,!l,null),E===j?c.stateNode=j:(eu(c),fs(E,g,x,H)&&Ys(c),c.stateNode=E,l&&zh(E,c,!1,!1))}else c.stateNode=j}}function Fa(l,c,g,x,j){if((l.mode&32)!==0&&(g===null?mu(c,x):Qo(c,g,x))){if(l.flags|=16777216,(j&335544128)===j||Ih(c,x))if(An(l.stateNode,c,x))l.flags|=8192;else if(Ct())l.flags|=8192;else throw $a=Fr,gf}else l.flags&=-16777217}function To(l,c){if(Np(c)){if(l.flags|=16777216,!_p(c))if(Ct())l.flags|=8192;else throw $a=Fr,gf}else l.flags&=-16777217}function tu(l,c){c!==null&&(l.flags|=4),l.flags&16384&&(c=l.tag!==22?k():536870912,l.lanes|=c,ec|=c)}function Ro(l,c){if(!Nt)switch(l.tailMode){case"hidden":c=l.tail;for(var g=null;c!==null;)c.alternate!==null&&(g=c),c=c.sibling;g===null?l.tail=null:g.sibling=null;break;case"collapsed":g=l.tail;for(var x=null;g!==null;)g.alternate!==null&&(x=g),g=g.sibling;x===null?c||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function ln(l){var c=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(c)for(var j=l.child;j!==null;)g|=j.lanes|j.childLanes,x|=j.subtreeFlags&65011712,x|=j.flags&65011712,j.return=l,j=j.sibling;else for(j=l.child;j!==null;)g|=j.lanes|j.childLanes,x|=j.subtreeFlags,x|=j.flags,j.return=l,j=j.sibling;return l.subtreeFlags|=x,l.childLanes=g,c}function Ng(l,c,g){var x=c.pendingProps;switch(fe(c),c.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(c),null;case 1:return ln(c),null;case 3:return g=c.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),c.memoizedState.cache!==x&&(c.flags|=2048),fn(Nn),me(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(Mt(c)?Ys(c):l===null||l.memoizedState.isDehydrated&&(c.flags&256)===0||(c.flags|=1024,En())),Sg(l,c),ln(c),null;case 26:if(Js){var j=c.type,E=c.memoizedState;return l===null?(Ys(c),E!==null?(ln(c),To(c,E)):(ln(c),Fa(c,j,null,x,g))):E?E!==l.memoizedState?(Ys(c),ln(c),To(c,E)):(ln(c),c.flags&=-16777217):(E=l.memoizedProps,wt?E!==x&&Ys(c):kh(l,c,j,x),ln(c),Fa(c,j,E,x,g)),null}case 27:if(ua){if(nt(c),g=Aa.current,j=c.type,l!==null&&c.stateNode!=null)wt?l.memoizedProps!==x&&Ys(c):kh(l,c,j,x);else{if(!x){if(c.stateNode===null)throw Error(i(166));return ln(c),null}l=_a.current,Mt(c)?Vt(c,l):(l=sf(j,x,g,l,!0),c.stateNode=l,Ys(c))}return ln(c),null}case 5:if(nt(c),j=c.type,l!==null&&c.stateNode!=null)kh(l,c,j,x);else{if(!x){if(c.stateNode===null)throw Error(i(166));return ln(c),null}if(E=_a.current,Mt(c))Vt(c,E),c0(c.stateNode,j,x,E)&&(c.flags|=64);else{var H=Fh(j,x,Aa.current,E,c);eu(c),zh(H,c,!1,!1),c.stateNode=H,fs(H,j,x,E)&&Ys(c)}}return ln(c),Fa(c,c.type,l===null?null:l.memoizedProps,c.pendingProps,g),null;case 6:if(l&&c.stateNode!=null)g=l.memoizedProps,wt?g!==x&&Ys(c):As&&(g!==x?(l=Aa.current,g=_a.current,eu(c),c.stateNode=yi(x,l,g,c)):c.stateNode=l.stateNode);else{if(typeof x!="string"&&c.stateNode===null)throw Error(i(166));if(l=Aa.current,g=_a.current,Mt(c)){if(!vn)throw Error(i(176));if(l=c.stateNode,g=c.memoizedProps,x=null,j=da,j!==null)switch(j.tag){case 27:case 5:x=j.memoizedProps}gy(l,g,c,x)||ze(c,!0)}else eu(c),c.stateNode=yi(x,l,g,c)}return ln(c),null;case 31:if(g=c.memoizedState,l===null||l.memoizedState!==null){if(x=Mt(c),g!==null){if(l===null){if(!x)throw Error(i(318));if(!vn)throw Error(i(556));if(l=c.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));pp(l,c)}else Ht(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ln(c),l=!1}else g=En(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return c.flags&256?(Es(c),c):(Es(c),null);if((c.flags&128)!==0)throw Error(i(558))}return ln(c),null;case 13:if(x=c.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(j=Mt(c),x!==null&&x.dehydrated!==null){if(l===null){if(!j)throw Error(i(318));if(!vn)throw Error(i(344));if(j=c.memoizedState,j=j!==null?j.dehydrated:null,!j)throw Error(i(317));r0(j,c)}else Ht(),(c.flags&128)===0&&(c.memoizedState=null),c.flags|=4;ln(c),j=!1}else j=En(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=j),j=!0;if(!j)return c.flags&256?(Es(c),c):(Es(c),null)}return Es(c),(c.flags&128)!==0?(c.lanes=g,c):(g=x!==null,l=l!==null&&l.memoizedState!==null,g&&(x=c.child,j=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(j=x.alternate.memoizedState.cachePool.pool),E=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(E=x.memoizedState.cachePool.pool),E!==j&&(x.flags|=2048)),g!==l&&g&&(c.child.flags|=8192),tu(c,c.updateQueue),ln(c),null);case 4:return me(),Sg(l,c),l===null&&tn(c.stateNode.containerInfo),ln(c),null;case 10:return fn(c.type),ln(c),null;case 19:if(C(Gn),x=c.memoizedState,x===null)return ln(c),null;if(j=(c.flags&128)!==0,E=x.rendering,E===null)if(j)Ro(x,!1);else{if(kn!==0||l!==null&&(l.flags&128)!==0)for(l=c.child;l!==null;){if(E=Yc(l),E!==null){for(c.flags|=128,Ro(x,!1),l=E.updateQueue,c.updateQueue=l,tu(c,l),c.subtreeFlags=0,l=g,g=c.child;g!==null;)Gd(g,l),g=g.sibling;return w(Gn,Gn.current&1|2),Nt&&he(c,x.treeForkCount),c.child}l=l.sibling}x.tail!==null&&Ga()>sl&&(c.flags|=128,j=!0,Ro(x,!1),c.lanes=4194304)}else{if(!j)if(l=Yc(E),l!==null){if(c.flags|=128,j=!0,l=l.updateQueue,c.updateQueue=l,tu(c,l),Ro(x,!0),x.tail===null&&x.tailMode==="hidden"&&!E.alternate&&!Nt)return ln(c),null}else 2*Ga()-x.renderingStartTime>sl&&g!==536870912&&(c.flags|=128,j=!0,Ro(x,!1),c.lanes=4194304);x.isBackwards?(E.sibling=c.child,c.child=E):(l=x.last,l!==null?l.sibling=E:c.child=E,x.last=E)}return x.tail!==null?(l=x.tail,x.rendering=l,x.tail=l.sibling,x.renderingStartTime=Ga(),l.sibling=null,g=Gn.current,w(Gn,j?g&1|2:g&1),Nt&&he(c,x.treeForkCount),l):(ln(c),null);case 22:case 23:return Es(c),Tn(),x=c.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(c.flags|=8192):x&&(c.flags|=8192),x?(g&536870912)!==0&&(c.flags&128)===0&&(ln(c),c.subtreeFlags&6&&(c.flags|=8192)):ln(c),g=c.updateQueue,g!==null&&tu(c,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),x=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(x=c.memoizedState.cachePool.pool),x!==g&&(c.flags|=2048),l!==null&&C(Ii),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),c.memoizedState.cache!==g&&(c.flags|=2048),fn(Nn),ln(c),null;case 25:return null;case 30:return null}throw Error(i(156,c.tag))}function Lh(l,c){switch(fe(c),c.tag){case 1:return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 3:return fn(Nn),me(),l=c.flags,(l&65536)!==0&&(l&128)===0?(c.flags=l&-65537|128,c):null;case 26:case 27:case 5:return nt(c),null;case 31:if(c.memoizedState!==null){if(Es(c),c.alternate===null)throw Error(i(340));Ht()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 13:if(Es(c),l=c.memoizedState,l!==null&&l.dehydrated!==null){if(c.alternate===null)throw Error(i(340));Ht()}return l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 19:return C(Gn),null;case 4:return me(),null;case 10:return fn(c.type),null;case 22:case 23:return Es(c),Tn(),l!==null&&C(Ii),l=c.flags,l&65536?(c.flags=l&-65537|128,c):null;case 24:return fn(Nn),null;case 25:return null;default:return null}}function _g(l,c){switch(fe(c),c.tag){case 3:fn(Nn),me();break;case 26:case 27:case 5:nt(c);break;case 4:me();break;case 31:c.memoizedState!==null&&Es(c);break;case 13:Es(c);break;case 19:C(Gn);break;case 10:fn(c.type);break;case 22:case 23:Es(c),Tn(),l!==null&&C(Ii);break;case 24:fn(Nn)}}function Dr(l,c){try{var g=c.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var j=x.next;g=j;do{if((g.tag&l)===l){x=void 0;var E=g.create,H=g.inst;x=E(),H.destroy=x}g=g.next}while(g!==j)}}catch(Z){We(c,c.return,Z)}}function zr(l,c,g){try{var x=c.updateQueue,j=x!==null?x.lastEffect:null;if(j!==null){var E=j.next;x=E;do{if((x.tag&l)===l){var H=x.inst,Z=H.destroy;if(Z!==void 0){H.destroy=void 0,j=c;var ge=g,Ne=Z;try{Ne()}catch(Oe){We(j,ge,Oe)}}}x=x.next}while(x!==E)}}catch(Oe){We(c,c.return,Oe)}}function Oo(l){var c=l.updateQueue;if(c!==null){var g=l.stateNode;try{pr(c,g)}catch(x){We(l,l.return,x)}}}function Od(l,c,g){g.props=Cl(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){We(l,c,x)}}function Mo(l,c){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var x=Po(l.stateNode);break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof g=="function"?l.refCleanup=g(x):g.current=x}}catch(j){We(l,c,j)}}function Ba(l,c){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(j){We(l,c,j)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(j){We(l,c,j)}else g.current=null}function Rl(l){var c=l.type,g=l.memoizedProps,x=l.stateNode;try{Ug(x,c,g,l)}catch(j){We(l,l.return,j)}}function nu(l,c,g){try{qg(l.stateNode,l.type,g,c,l)}catch(x){We(l,l.return,x)}}function Uh(l){return l.tag===5||l.tag===3||(Js?l.tag===26:!1)||(ua?l.tag===27&&Bl(l.type):!1)||l.tag===4}function ci(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Uh(l.return))return null;l=l.return}for(l.sibling.return=l.return,l=l.sibling;l.tag!==5&&l.tag!==6&&l.tag!==18;){if(ua&&l.tag===27&&Bl(l.type)||l.flags&2||l.child===null||l.tag===4)continue e;l.child.return=l,l=l.child}if(!(l.flags&2))return l.stateNode}}function Md(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?Bg(g,l,c):ap(g,l);else if(x!==4&&(ua&&x===27&&Bl(l.type)&&(g=l.stateNode,c=null),l=l.child,l!==null))for(Md(l,c,g),l=l.sibling;l!==null;)Md(l,c,g),l=l.sibling}function au(l,c,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,c?Hg(g,l,c):np(g,l);else if(x!==4&&(ua&&x===27&&Bl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(au(l,c,g),l=l.sibling;l!==null;)au(l,c,g),l=l.sibling}function qh(l,c,g){l=l.containerInfo;try{cp(l,g)}catch(x){We(c,c.return,x)}}function jg(l){var c=l.stateNode,g=l.memoizedProps;try{aa(l.type,g,c,l)}catch(x){We(l,l.return,x)}}function fy(l,c){for(Xd(l.containerInfo),Wn=c;Wn!==null;)if(l=Wn,c=l.child,(l.subtreeFlags&1028)!==0&&c!==null)c.return=l,Wn=c;else for(;Wn!==null;){l=Wn;var g=l.alternate;switch(c=l.flags,l.tag){case 0:if((c&4)!==0&&(c=l.updateQueue,c=c!==null?c.events:null,c!==null))for(var x=0;x<c.length;x++){var j=c[x];j.ref.impl=j.nextImpl}break;case 11:case 15:break;case 1:if((c&1024)!==0&&g!==null){c=void 0,x=l,j=g.memoizedProps,g=g.memoizedState;var E=x.stateNode;try{var H=Cl(x.type,j);c=E.getSnapshotBeforeUpdate(H,g),E.__reactInternalSnapshotBeforeUpdate=c}catch(Z){We(x,x.return,Z)}}break;case 3:(c&1024)!==0&&wt&&ip(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((c&1024)!==0)throw Error(i(163))}if(c=l.sibling,c!==null){c.return=l.return,Wn=c;break}Wn=l.return}}function Cg(l,c,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Za(l,g),x&4&&Dr(5,g);break;case 1:if(Za(l,g),x&4)if(l=g.stateNode,c===null)try{l.componentDidMount()}catch(H){We(g,g.return,H)}else{var j=Cl(g.type,c.memoizedProps);c=c.memoizedState;try{l.componentDidUpdate(j,c,l.__reactInternalSnapshotBeforeUpdate)}catch(H){We(g,g.return,H)}}x&64&&Oo(g),x&512&&Mo(g,g.return);break;case 3:if(Za(l,g),x&64&&(x=g.updateQueue,x!==null)){if(l=null,g.child!==null)switch(g.child.tag){case 27:case 5:l=Po(g.child.stateNode);break;case 1:l=g.child.stateNode}try{pr(x,l)}catch(H){We(g,g.return,H)}}break;case 27:ua&&c===null&&x&4&&jg(g);case 26:case 5:if(Za(l,g),c===null){if(x&4)Rl(g);else if(x&64){l=g.type,c=g.memoizedProps,j=g.stateNode;try{l0(j,l,c,g)}catch(H){We(g,g.return,H)}}}x&512&&Mo(g,g.return);break;case 12:Za(l,g);break;case 31:Za(l,g),x&4&&Qs(l,g);break;case 13:Za(l,g),x&4&&ru(l,g),x&64&&(x=g.memoizedState,x!==null&&(x=x.dehydrated,x!==null&&(g=hy.bind(null,g),ef(x,g))));break;case 22:if(x=g.memoizedState!==null||Pn,!x){c=c!==null&&c.memoizedState!==null||Yn,j=Pn;var E=Yn;Pn=x,(Yn=c)&&!E?Xs(l,g,(g.subtreeFlags&8772)!==0):Za(l,g),Pn=j,Yn=E}break;case 30:break;default:Za(l,g)}}function Hh(l){var c=l.alternate;c!==null&&(l.alternate=null,Hh(c)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(c=l.stateNode,c!==null&&Fd(c)),l.stateNode=null,l.return=null,l.dependencies=null,l.memoizedProps=null,l.memoizedState=null,l.pendingProps=null,l.stateNode=null,l.updateQueue=null}function Vs(l,c,g){for(g=g.child;g!==null;)su(l,c,g),g=g.sibling}function su(l,c,g){if(ms&&typeof ms.onCommitFiberUnmount=="function")try{ms.onCommitFiberUnmount(Yl,g)}catch{}switch(g.tag){case 26:if(Js){Yn||Ba(g,c),Vs(l,c,g),g.memoizedState?Fi(g.memoizedState):g.stateNode&&Sp(g.stateNode);break}case 27:if(ua){Yn||Ba(g,c);var x=zn,j=$n;Bl(g.type)&&(zn=g.stateNode,$n=!1),Vs(l,c,g),Na(g.stateNode),zn=x,$n=j;break}case 5:Yn||Ba(g,c);case 6:if(wt){if(x=zn,j=$n,zn=null,Vs(l,c,g),zn=x,$n=j,zn!==null)if($n)try{sp(zn,g.stateNode)}catch(E){We(g,c,E)}else try{Gg(zn,g.stateNode)}catch(E){We(g,c,E)}}else Vs(l,c,g);break;case 18:wt&&zn!==null&&($n?tf(zn,g.stateNode):gp(zn,g.stateNode));break;case 4:wt?(x=zn,j=$n,zn=g.stateNode.containerInfo,$n=!0,Vs(l,c,g),zn=x,$n=j):(As&&qh(g.stateNode,g,lp()),Vs(l,c,g));break;case 0:case 11:case 14:case 15:zr(2,g,c),Yn||zr(4,g,c),Vs(l,c,g);break;case 1:Yn||(Ba(g,c),x=g.stateNode,typeof x.componentWillUnmount=="function"&&Od(g,c,x)),Vs(l,c,g);break;case 21:Vs(l,c,g);break;case 22:Yn=(x=Yn)||g.memoizedState!==null,Vs(l,c,g),Yn=x;break;default:Vs(l,c,g)}}function Qs(l,c){if(vn&&c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{yy(l)}catch(g){We(c,c.return,g)}}}function ru(l,c){if(vn&&c.memoizedState===null&&(l=c.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{xy(l)}catch(g){We(c,c.return,g)}}function Ks(l){switch(l.tag){case 31:case 13:case 19:var c=l.stateNode;return c===null&&(c=l.stateNode=new Mp),c;case 22:return l=l.stateNode,c=l._retryCache,c===null&&(c=l._retryCache=new Mp),c;default:throw Error(i(435,l.tag))}}function ui(l,c){var g=Ks(l);c.forEach(function(x){if(!g.has(x)){g.add(x);var j=py.bind(null,l,x);x.then(j,j)}})}function va(l,c){var g=c.deletions;if(g!==null)for(var x=0;x<g.length;x++){var j=g[x],E=l,H=c;if(wt){var Z=H;e:for(;Z!==null;){switch(Z.tag){case 27:if(ua){if(Bl(Z.type)){zn=Z.stateNode,$n=!1;break e}break}case 5:zn=Z.stateNode,$n=!1;break e;case 3:case 4:zn=Z.stateNode.containerInfo,$n=!0;break e}Z=Z.return}if(zn===null)throw Error(i(160));su(E,H,j),zn=null,$n=!1}else su(E,H,j);E=j.alternate,E!==null&&(E.return=null),j.return=null}if(c.subtreeFlags&13886)for(c=c.child;c!==null;)iu(c,l),c=c.sibling}function iu(l,c){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:va(c,l),Sa(l),x&4&&(zr(3,l,l.return),Dr(3,l),zr(5,l,l.return));break;case 1:va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),x&64&&Pn&&(l=l.updateQueue,l!==null&&(x=l.callbacks,x!==null&&(g=l.shared.hiddenCallbacks,l.shared.hiddenCallbacks=g===null?x:g.concat(x))));break;case 26:if(Js){var j=Wt;if(va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),x&4){x=g!==null?g.memoizedState:null;var E=l.memoizedState;g===null?E===null?l.stateNode===null?l.stateNode=h0(j,l.type,l.memoizedProps,l):vp(j,l.type,l.stateNode):l.stateNode=bp(j,E,l.memoizedProps):x!==E?(x===null?g.stateNode!==null&&Sp(g.stateNode):Fi(x),E===null?vp(j,l.type,l.stateNode):bp(j,E,l.memoizedProps)):E===null&&l.stateNode!==null&&nu(l,l.memoizedProps,g.memoizedProps)}break}case 27:if(ua){va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),g!==null&&x&4&&nu(l,l.memoizedProps,g.memoizedProps);break}case 5:if(va(c,l),Sa(l),x&512&&(Yn||g===null||Ba(g,g.return)),wt){if(l.flags&32){j=l.stateNode;try{rp(j)}catch(Ce){We(l,l.return,Ce)}}x&4&&l.stateNode!=null&&(j=l.memoizedProps,nu(l,j,g!==null?g.memoizedProps:j)),x&1024&&(Zo=!0)}else As&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(va(c,l),Sa(l),x&4&&wt){if(l.stateNode===null)throw Error(i(162));x=l.memoizedProps,g=g!==null?g.memoizedProps:x,j=l.stateNode;try{Lg(j,g,x)}catch(Ce){We(l,l.return,Ce)}}break;case 3:if(Js?(p0(),j=Wt,Wt=xu(c.containerInfo),va(c,l),Wt=j):va(c,l),Sa(l),x&4){if(wt&&vn&&g!==null&&g.memoizedState.isDehydrated)try{o0(c.containerInfo)}catch(Ce){We(l,l.return,Ce)}if(As){x=c.containerInfo,g=c.pendingChildren;try{cp(x,g)}catch(Ce){We(l,l.return,Ce)}}}Zo&&(Zo=!1,Ad(l));break;case 4:Js?(g=Wt,Wt=xu(l.stateNode.containerInfo),va(c,l),Sa(l),Wt=g):(va(c,l),Sa(l)),x&4&&As&&qh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:va(c,l),Sa(l);break;case 31:va(c,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 13:va(c,l),Sa(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Tu=Ga()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 22:j=l.memoizedState!==null;var H=g!==null&&g.memoizedState!==null,Z=Pn,ge=Yn;if(Pn=Z||j,Yn=ge||H,va(c,l),Yn=ge,Pn=Z,Sa(l),x&8192&&(c=l.stateNode,c._visibility=j?c._visibility&-2:c._visibility|1,j&&(g===null||H||Pn||Yn||ki(l)),wt)){e:if(g=null,wt)for(c=l;;){if(c.tag===5||Js&&c.tag===26){if(g===null){H=g=c;try{E=H.stateNode,j?my(E):Yg(H.stateNode,H.memoizedProps)}catch(Ce){We(H,H.return,Ce)}}}else if(c.tag===6){if(g===null){H=c;try{var Ne=H.stateNode;j?Pg(Ne):Vg(Ne,H.memoizedProps)}catch(Ce){We(H,H.return,Ce)}}}else if(c.tag===18){if(g===null){H=c;try{var Oe=H.stateNode;j?u0(Oe):d0(H.stateNode)}catch(Ce){We(H,H.return,Ce)}}}else if((c.tag!==22&&c.tag!==23||c.memoizedState===null||c===l)&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===l)break e;for(;c.sibling===null;){if(c.return===null||c.return===l)break e;g===c&&(g=null),c=c.return}g===c&&(g=null),c.sibling.return=c.return,c=c.sibling}}x&4&&(x=l.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,ui(l,g))));break;case 19:va(c,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,ui(l,x)));break;case 30:break;case 21:break;default:va(c,l),Sa(l)}}function Sa(l){var c=l.flags;if(c&2){try{for(var g,x=l.return;x!==null;){if(Uh(x)){g=x;break}x=x.return}if(wt){if(g==null)throw Error(i(160));switch(g.tag){case 27:if(ua){var j=g.stateNode,E=ci(l);au(l,E,j);break}case 5:var H=g.stateNode;g.flags&32&&(rp(H),g.flags&=-33);var Z=ci(l);au(l,Z,H);break;case 3:case 4:var ge=g.stateNode.containerInfo,Ne=ci(l);Md(l,Ne,ge);break;default:throw Error(i(161))}}}catch(Oe){We(l,l.return,Oe)}l.flags&=-3}c&4096&&(l.flags&=-4097)}function Ad(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var c=l;Ad(c),c.tag===5&&c.flags&1024&&Wh(c.stateNode),l=l.sibling}}function Za(l,c){if(c.subtreeFlags&8772)for(c=c.child;c!==null;)Cg(l,c.alternate,c),c=c.sibling}function ki(l){for(l=l.child;l!==null;){var c=l;switch(c.tag){case 0:case 11:case 14:case 15:zr(4,c,c.return),ki(c);break;case 1:Ba(c,c.return);var g=c.stateNode;typeof g.componentWillUnmount=="function"&&Od(c,c.return,g),ki(c);break;case 27:ua&&Na(c.stateNode);case 26:case 5:Ba(c,c.return),ki(c);break;case 22:c.memoizedState===null&&ki(c);break;case 30:ki(c);break;default:ki(c)}l=l.sibling}}function Xs(l,c,g){for(g=g&&(c.subtreeFlags&8772)!==0,c=c.child;c!==null;){var x=c.alternate,j=l,E=c,H=E.flags;switch(E.tag){case 0:case 11:case 15:Xs(j,E,g),Dr(4,E);break;case 1:if(Xs(j,E,g),x=E,j=x.stateNode,typeof j.componentDidMount=="function")try{j.componentDidMount()}catch(Ne){We(x,x.return,Ne)}if(x=E,j=x.updateQueue,j!==null){var Z=x.stateNode;try{var ge=j.shared.hiddenCallbacks;if(ge!==null)for(j.shared.hiddenCallbacks=null,j=0;j<ge.length;j++)Pt(ge[j],Z)}catch(Ne){We(x,x.return,Ne)}}g&&H&64&&Oo(E),Mo(E,E.return);break;case 27:ua&&jg(E);case 26:case 5:Xs(j,E,g),g&&x===null&&H&4&&Rl(E),Mo(E,E.return);break;case 12:Xs(j,E,g);break;case 31:Xs(j,E,g),g&&H&4&&Qs(j,E);break;case 13:Xs(j,E,g),g&&H&4&&ru(j,E);break;case 22:E.memoizedState===null&&Xs(j,E,g),Mo(E,E.return);break;case 30:break;default:Xs(j,E,g)}c=c.sibling}}function Li(l,c){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(l=c.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&Qa(g))}function Bh(l,c){l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Qa(l))}function On(l,c,g,x){if(c.subtreeFlags&10256)for(c=c.child;c!==null;)Dd(l,c,g,x),c=c.sibling}function Dd(l,c,g,x){var j=c.flags;switch(c.tag){case 0:case 11:case 15:On(l,c,g,x),j&2048&&Dr(9,c);break;case 1:On(l,c,g,x);break;case 3:On(l,c,g,x),j&2048&&(l=null,c.alternate!==null&&(l=c.alternate.memoizedState.cache),c=c.memoizedState.cache,c!==l&&(c.refCount++,l!=null&&Qa(l)));break;case 12:if(j&2048){On(l,c,g,x),l=c.stateNode;try{var E=c.memoizedProps,H=E.id,Z=E.onPostCommit;typeof Z=="function"&&Z(H,c.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(ge){We(c,c.return,ge)}}else On(l,c,g,x);break;case 31:On(l,c,g,x);break;case 13:On(l,c,g,x);break;case 23:break;case 22:E=c.stateNode,H=c.alternate,c.memoizedState!==null?E._visibility&2?On(l,c,g,x):Ao(l,c):E._visibility&2?On(l,c,g,x):(E._visibility|=2,cs(l,c,g,x,(c.subtreeFlags&10256)!==0||!1)),j&2048&&Li(H,c);break;case 24:On(l,c,g,x),j&2048&&Bh(c.alternate,c);break;default:On(l,c,g,x)}}function cs(l,c,g,x,j){for(j=j&&((c.subtreeFlags&10256)!==0||!1),c=c.child;c!==null;){var E=l,H=c,Z=g,ge=x,Ne=H.flags;switch(H.tag){case 0:case 11:case 15:cs(E,H,Z,ge,j),Dr(8,H);break;case 23:break;case 22:var Oe=H.stateNode;H.memoizedState!==null?Oe._visibility&2?cs(E,H,Z,ge,j):Ao(E,H):(Oe._visibility|=2,cs(E,H,Z,ge,j)),j&&Ne&2048&&Li(H.alternate,H);break;case 24:cs(E,H,Z,ge,j),j&&Ne&2048&&Bh(H.alternate,H);break;default:cs(E,H,Z,ge,j)}c=c.sibling}}function Ao(l,c){if(c.subtreeFlags&10256)for(c=c.child;c!==null;){var g=l,x=c,j=x.flags;switch(x.tag){case 22:Ao(g,x),j&2048&&Li(x.alternate,x);break;case 24:Ao(g,x),j&2048&&Bh(x.alternate,x);break;default:Ao(g,x)}c=c.sibling}}function kr(l,c,g){if(l.subtreeFlags&Ls)for(l=l.child;l!==null;)Ui(l,c,g),l=l.sibling}function Ui(l,c,g){switch(l.tag){case 26:if(kr(l,c,g),l.flags&Ls)if(l.memoizedState!==null)m0(g,Wt,l.memoizedState,l.memoizedProps);else{var x=l.stateNode,j=l.type;l=l.memoizedProps,((c&335544128)===c||Ih(j,l))&&Zd(g,x,j,l)}break;case 5:kr(l,c,g),l.flags&Ls&&(x=l.stateNode,j=l.type,l=l.memoizedProps,((c&335544128)===c||Ih(j,l))&&Zd(g,x,j,l));break;case 3:case 4:Js?(x=Wt,Wt=xu(l.stateNode.containerInfo),kr(l,c,g),Wt=x):kr(l,c,g);break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=Ls,Ls=16777216,kr(l,c,g),Ls=x):kr(l,c,g));break;default:kr(l,c,g)}}function zd(l){var c=l.alternate;if(c!==null&&(l=c.child,l!==null)){c.child=null;do c=l.sibling,l.sibling=null,l=c;while(l!==null)}}function Do(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var x=c[g];Wn=x,Rs(x,l)}zd(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)kd(l),l=l.sibling}function kd(l){switch(l.tag){case 0:case 11:case 15:Do(l),l.flags&2048&&zr(9,l,l.return);break;case 3:Do(l);break;case 12:Do(l);break;case 22:var c=l.stateNode;l.memoizedState!==null&&c._visibility&2&&(l.return===null||l.return.tag!==13)?(c._visibility&=-3,lu(l)):Do(l);break;default:Do(l)}}function lu(l){var c=l.deletions;if((l.flags&16)!==0){if(c!==null)for(var g=0;g<c.length;g++){var x=c[g];Wn=x,Rs(x,l)}zd(l)}for(l=l.child;l!==null;){switch(c=l,c.tag){case 0:case 11:case 15:zr(8,c,c.return),lu(c);break;case 22:g=c.stateNode,g._visibility&2&&(g._visibility&=-3,lu(c));break;default:lu(c)}l=l.sibling}}function Rs(l,c){for(;Wn!==null;){var g=Wn;switch(g.tag){case 0:case 11:case 15:zr(8,g,c);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var x=g.memoizedState.cachePool.pool;x!=null&&x.refCount++}break;case 24:Qa(g.memoizedState.cache)}if(x=g.child,x!==null)x.return=g,Wn=x;else e:for(g=l;Wn!==null;){x=Wn;var j=x.sibling,E=x.return;if(Hh(x),x===g){Wn=null;break e}if(j!==null){j.return=E,Wn=j;break e}Wn=E}}}function qi(l){var c=rt(l);if(c!=null){if(typeof c.memoizedProps["data-testname"]!="string")throw Error(i(364));return c}if(l=In(l),l===null)throw Error(i(362));return l.stateNode.current}function Hi(l,c){var g=l.tag;switch(c.$$typeof){case rr:if(l.type===c.value)return!0;break;case Jo:e:{for(c=c.value,l=[l,0],g=0;g<l.length;){var x=l[g++],j=x.tag,E=l[g++],H=c[E];if(j!==5&&j!==26&&j!==27||!Ki(x)){for(;H!=null&&Hi(x,H);)E++,H=c[E];if(E===c.length){c=!0;break e}else for(x=x.child;x!==null;)l.push(x,E),x=x.sibling}}c=!1}return c;case Wo:if((g===5||g===26||g===27)&&tp(l.stateNode,c.value))return!0;break;case el:if((g===5||g===6||g===26||g===27)&&(l=gu(l),l!==null&&0<=l.indexOf(c.value)))return!0;break;case wu:if((g===5||g===26||g===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===c.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function zo(l){switch(l.$$typeof){case rr:return"<"+(v(l.value)||"Unknown")+">";case Jo:return":has("+(zo(l)||"")+")";case Wo:return'[role="'+l.value+'"]';case el:return'"'+l.value+'"';case wu:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function ko(l,c){var g=[];l=[l,0];for(var x=0;x<l.length;){var j=l[x++],E=j.tag,H=l[x++],Z=c[H];if(E!==5&&E!==26&&E!==27||!Ki(j)){for(;Z!=null&&Hi(j,Z);)H++,Z=c[H];if(H===c.length)g.push(j);else for(j=j.child;j!==null;)l.push(j,H),j=j.sibling}}return g}function us(l,c){if(!ca)throw Error(i(363));l=qi(l),l=ko(l,c),c=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++],j=x.tag;if(j===5||j===26||j===27)Ki(x)||c.push(x.stateNode);else for(x=x.child;x!==null;)l.push(x),x=x.sibling}return c}function bn(){return(bt&2)!==0&&_t!==0?_t&-_t:Qe.T!==null?Ta():Vo()}function di(){if(ns===0)if((_t&536870912)===0||Nt){var l=Pl;Pl<<=1,(Pl&3932160)===0&&(Pl=262144),ns=l}else ns=536870912;return l=gs.current,l!==null&&(l.flags|=32),ns}function Mn(l,c,g){(l===pt&&($t===2||$t===9)||l.cancelPendingCommit!==null)&&(Bn(l,0),Ur(l,_t,ns,!1)),q(l,g),((bt&2)===0||l!==pt)&&(l===pt&&((bt&2)===0&&(al|=g),kn===4&&Ur(l,_t,ns,!1)),Ea(l))}function yr(l,c,g){if((bt&6)!==0)throw Error(i(327));var x=!g&&(c&127)===0&&(c&l.expiredLanes)===0||M(l,c),j=x?Tg(l,c):qr(l,c,!0),E=x;do{if(j===0){tl&&!x&&Ur(l,c,0,!1);break}else{if(g=l.current.alternate,E&&!wg(g)){j=qr(l,c,!1),E=!1;continue}if(j===2){if(E=c,l.errorRecoveryDisabledLanes&E)var H=0;else H=l.pendingLanes&-536870913,H=H!==0?H:H&536870912?536870912:0;if(H!==0){c=H;e:{var Z=l;j=Eu;var ge=vn&&Z.current.memoizedState.isDehydrated;if(ge&&(Bn(Z,H).flags|=256),H=qr(Z,H,!1),H!==2){if(nl&&!ge){Z.errorRecoveryDisabledLanes|=E,al|=E,j=4;break e}E=ys,ys=j,E!==null&&(ys===null?ys=E:ys.push.apply(ys,E))}j=H}if(E=!1,j!==2)continue}}if(j===1){Bn(l,0),Ur(l,c,0,!0);break}e:{switch(x=l,E=j,E){case 0:case 1:throw Error(i(345));case 4:if((c&4194048)!==c)break;case 6:Ur(x,c,ns,!Sr);break e;case 2:ys=null;break;case 3:case 5:break;default:throw Error(i(329))}if((c&62914560)===c&&(j=Tu+300-Ga(),10<j)){if(Ur(x,c,ns,!Sr),O(x,0,!0)!==0)break e;Wr=c,x.timeoutHandle=Zh(Lr.bind(null,x,g,ys,Ru,xf,c,ns,al,ec,Sr,E,"Throttled",-0,0),j);break e}Lr(x,g,ys,Ru,xf,c,ns,al,ec,Sr,E,null,-0,0)}}break}while(!0);Ea(l)}function Lr(l,c,g,x,j,E,H,Z,ge,Ne,Oe,Ce,Le,st){if(l.timeoutHandle=hs,Ce=c.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce=Jh(),Ui(c,E,Ce);var Ca=(E&62914560)===E?Tu-Ga():(E&4194048)===E?Zl-Ga():0;if(Ca=kg(Ce,Ca),Ca!==null){Wr=E,l.cancelPendingCommit=Ca(Br.bind(null,l,c,E,g,x,j,H,Z,ge,Oe,Ce,null,Le,st)),Ur(l,E,H,!Ne);return}}Br(l,c,E,g,x,j,H,Z,ge)}function wg(l){for(var c=l;;){var g=c.tag;if((g===0||g===11||g===15)&&c.flags&16384&&(g=c.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var j=g[x],E=j.getSnapshot;j=j.value;try{if(!Jn(E(),j))return!1}catch{return!1}}if(g=c.child,c.subtreeFlags&16384&&g!==null)g.return=c,c=g;else{if(c===l)break;for(;c.sibling===null;){if(c.return===null||c.return===l)return!0;c=c.return}c.sibling.return=c.return,c=c.sibling}}return!0}function Ur(l,c,g,x){c&=~$o,c&=~al,l.suspendedLanes|=c,l.pingedLanes&=~c,x&&(l.warmLanes|=c),x=l.expirationTimes;for(var j=c;0<j;){var E=31-ps(j),H=1<<E;x[E]=-1,j&=~H}g!==0&&U(l,g,c)}function Ld(){return(bt&6)===0?(rs(0),!1):!0}function Ud(){if(vt!==null){if($t===0)var l=vt.return;else l=vt,br=cn=null,Qc(l),Ji=null,Vl=0,l=vt;for(;l!==null;)_g(l.alternate,l),l=l.return;vt=null}}function Bn(l,c){var g=l.timeoutHandle;g!==hs&&(l.timeoutHandle=hs,zg(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),Wr=0,Ud(),pt=l,vt=g=Ms(l.current,null),_t=c,$t=0,sa=null,Sr=!1,tl=M(l,c),nl=!1,ec=ns=$o=al=_i=kn=0,ys=Eu=null,xf=!1,(c&8)!==0&&(c|=c&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=c;0<x;){var j=31-ps(x),E=1<<j;c|=l[j],x&=~E}return Jr=c,Ue(),g}function on(l,c){it=null,Qe.H=ks,c===ha||c===ar?(c=Fn(),$t=3):c===gf?(c=Fn(),$t=4):$t=c===ts?8:c!==null&&typeof c=="object"&&typeof c.then=="function"?6:1,sa=c,vt===null&&(kn=1,wd(l,je(c,l.current)))}function Ct(){var l=gs.current;return l===null?!0:(_t&4194048)===_t?es===null:(_t&62914560)===_t||(_t&536870912)!==0?l===es:!1}function fi(){var l=Qe.H;return Qe.H=ks,l===null?ks:l}function Os(){var l=Qe.A;return Qe.A=Io,l}function Lo(){kn=4,Sr||(_t&4194048)!==_t&&gs.current!==null||(tl=!0),(_i&134217727)===0&&(al&134217727)===0||pt===null||Ur(pt,_t,ns,!1)}function qr(l,c,g){var x=bt;bt|=2;var j=fi(),E=Os();(pt!==l||_t!==c)&&(Ru=null,Bn(l,c)),c=!1;var H=kn;e:do try{if($t!==0&&vt!==null){var Z=vt,ge=sa;switch($t){case 8:Ud(),H=6;break e;case 3:case 2:case 9:case 6:gs.current===null&&(c=!0);var Ne=$t;if($t=0,sa=null,Hr(l,Z,ge,Ne),g&&tl){H=0;break e}break;default:Ne=$t,$t=0,sa=null,Hr(l,Z,ge,Ne)}}Eg(),H=kn;break}catch(Oe){on(l,Oe)}while(!0);return c&&l.shellSuspendCounter++,br=cn=null,bt=x,Qe.H=j,Qe.A=E,vt===null&&(pt=null,_t=0,Ue()),H}function Eg(){for(;vt!==null;)Bi(vt)}function Tg(l,c){var g=bt;bt|=2;var x=fi(),j=Os();pt!==l||_t!==c?(Ru=null,sl=Ga()+500,Bn(l,c)):tl=M(l,c);e:do try{if($t!==0&&vt!==null){c=vt;var E=sa;t:switch($t){case 1:$t=0,sa=null,Hr(l,c,E,1);break;case 2:case 9:if(At(E)){$t=0,sa=null,qd(c);break}c=function(){$t!==2&&$t!==9||pt!==l||($t=7),Ea(l)},E.then(c,c);break e;case 3:$t=7;break e;case 4:$t=5;break e;case 7:At(E)?($t=0,sa=null,qd(c)):($t=0,sa=null,Hr(l,c,E,7));break;case 5:var H=null;switch(vt.tag){case 26:H=vt.memoizedState;case 5:case 27:var Z=vt,ge=Z.type,Ne=Z.pendingProps;if(H?_p(H):An(Z.stateNode,ge,Ne)){$t=0,sa=null;var Oe=Z.sibling;if(Oe!==null)vt=Oe;else{var Ce=Z.return;Ce!==null?(vt=Ce,qo(Ce)):vt=null}break t}}$t=0,sa=null,Hr(l,c,E,5);break;case 6:$t=0,sa=null,Hr(l,c,E,6);break;case 8:Ud(),kn=6;break e;default:throw Error(i(462))}}Uo();break}catch(Le){on(l,Le)}while(!0);return br=cn=null,Qe.H=x,Qe.A=j,bt=g,vt!==null?0:(pt=null,_t=0,Ue(),kn)}function Uo(){for(;vt!==null&&!y0();)Bi(vt)}function Bi(l){var c=Dh(l.alternate,l,Jr);l.memoizedProps=l.pendingProps,c===null?qo(l):vt=c}function qd(l){var c=l,g=c.alternate;switch(c.tag){case 15:case 0:c=Eh(g,c,c.pendingProps,c.type,void 0,_t);break;case 11:c=Eh(g,c,c.pendingProps,c.type.render,c.ref,_t);break;case 5:Qc(c);default:_g(g,c),c=vt=Gd(c,Jr),c=Dh(g,c,Jr)}l.memoizedProps=l.pendingProps,c===null?qo(l):vt=c}function Hr(l,c,g,x){br=cn=null,Qc(c),Ji=null,Vl=0;var j=c.return;try{if(dy(l,j,c,g,_t)){kn=1,wd(l,je(g,l.current)),vt=null;return}}catch(E){if(j!==null)throw vt=j,E;kn=1,wd(l,je(g,l.current)),vt=null;return}c.flags&32768?(Nt||x===1?l=!0:tl||(_t&536870912)!==0?l=!1:(Sr=l=!0,(x===2||x===9||x===3||x===6)&&(x=gs.current,x!==null&&x.tag===13&&(x.flags|=16384))),Gi(c,l)):qo(c)}function qo(l){var c=l;do{if((c.flags&32768)!==0){Gi(c,Sr);return}l=c.return;var g=Ng(c.alternate,c,Jr);if(g!==null){vt=g;return}if(c=c.sibling,c!==null){vt=c;return}vt=c=l}while(c!==null);kn===0&&(kn=5)}function Gi(l,c){do{var g=Lh(l.alternate,l);if(g!==null){g.flags&=32767,vt=g;return}if(g=l.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!c&&(l=l.sibling,l!==null)){vt=l;return}vt=l=g}while(l!==null);kn=6,vt=null}function Br(l,c,g,x,j,E,H,Z,ge){l.cancelPendingCommit=null;do Pr();while(ra!==0);if((bt&6)!==0)throw Error(i(327));if(c!==null){if(c===l.current)throw Error(i(177));if(E=c.lanes|c.childLanes,E|=Ql,L(l,g,E,H,Z,ge),l===pt&&(vt=pt=null,_t=0),Il=c,Ci=l,Wr=g,tc=E,bf=j,Ap=x,(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,na(vu,function(){return ou(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(c.flags&13878)!==0,(c.subtreeFlags&13878)!==0||x){x=Qe.T,Qe.T=null,j=Is(),St(2),H=bt,bt|=4;try{fy(l,c,g)}finally{bt=H,St(j),Qe.T=x}}ra=1,hi(),Gr(),Hd()}}function hi(){if(ra===1){ra=0;var l=Ci,c=Il,g=(c.flags&13878)!==0;if((c.subtreeFlags&13878)!==0||g){g=Qe.T,Qe.T=null;var x=Is();St(2);var j=bt;bt|=4;try{iu(c,l),Dg(l.containerInfo)}finally{bt=j,St(x),Qe.T=g}}l.current=c,ra=2}}function Gr(){if(ra===2){ra=0;var l=Ci,c=Il,g=(c.flags&8772)!==0;if((c.subtreeFlags&8772)!==0||g){g=Qe.T,Qe.T=null;var x=Is();St(2);var j=bt;bt|=4;try{Cg(l,c.alternate,c)}finally{bt=j,St(x),Qe.T=g}}ra=3}}function Hd(){if(ra===4||ra===3){ra=0,Cp();var l=Ci,c=Il,g=Wr,x=Ap;(c.subtreeFlags&10256)!==0||(c.flags&10256)!==0?ra=5:(ra=0,Il=Ci=null,Bd(l,l.pendingLanes));var j=l.pendingLanes;if(j===0&&(ji=null),ne(g),c=c.stateNode,ms&&typeof ms.onCommitFiberRoot=="function")try{ms.onCommitFiberRoot(Yl,c,void 0,(c.current.flags&128)===128)}catch{}if(x!==null){c=Qe.T,j=Is(),St(2),Qe.T=null;try{for(var E=l.onRecoverableError,H=0;H<x.length;H++){var Z=x[H];E(Z.value,{componentStack:Z.stack})}}finally{Qe.T=c,St(j)}}(Wr&3)!==0&&Pr(),Ea(l),j=l.pendingLanes,(g&261930)!==0&&(j&42)!==0?l===Ou?Ut++:(Ut=0,Ou=l):Ut=0,vn&&yu(),rs(0)}}function Bd(l,c){(l.pooledCacheLanes&=c)===0&&(c=l.pooledCache,c!=null&&(l.pooledCache=null,Qa(c)))}function Pr(){return hi(),Gr(),Hd(),ou()}function ou(){if(ra!==5)return!1;var l=Ci,c=tc;tc=0;var g=ne(Wr),x=32>g?32:g;g=Qe.T;var j=Is();try{St(x),Qe.T=null,x=bf,bf=null;var E=Ci,H=Wr;if(ra=0,Il=Ci=null,Wr=0,(bt&6)!==0)throw Error(i(331));var Z=bt;if(bt|=4,kd(E.current),Dd(E,E.current,H,x),bt=Z,rs(0,!1),ms&&typeof ms.onPostCommitFiberRoot=="function")try{ms.onPostCommitFiberRoot(Yl,E)}catch{}return!0}finally{St(j),Qe.T=g,Bd(l,c)}}function Pi(l,c,g){c=je(g,c),c=Ch(l.stateNode,c,2),l=pn(l,c,2),l!==null&&(q(l,2),Ea(l))}function We(l,c,g){if(l.tag===3)Pi(l,l,g);else for(;c!==null;){if(c.tag===3){Pi(c,l,g);break}else if(c.tag===1){var x=c.stateNode;if(typeof c.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(ji===null||!ji.has(x))){l=je(g,l),g=ug(2),x=pn(c,g,2),x!==null&&(dg(g,x,c,l),q(x,2),Ea(x));break}}c=c.return}}function Ho(l,c,g){var x=l.pingCache;if(x===null){x=l.pingCache=new Us;var j=new Set;x.set(c,j)}else j=x.get(c),j===void 0&&(j=new Set,x.set(c,j));j.has(g)||(nl=!0,j.add(g),l=Rg.bind(null,l,c,g),c.then(l,l))}function Rg(l,c,g){var x=l.pingCache;x!==null&&x.delete(c),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,pt===l&&(_t&g)===g&&(kn===4||kn===3&&(_t&62914560)===_t&&300>Ga()-Tu?(bt&2)===0&&Bn(l,0):$o|=g,ec===_t&&(ec=0)),Ea(l)}function Og(l,c){c===0&&(c=k()),l=ct(l,c),l!==null&&(q(l,c),Ea(l))}function hy(l){var c=l.memoizedState,g=0;c!==null&&(g=c.retryLane),Og(l,g)}function py(l,c){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,j=l.memoizedState;j!==null&&(g=j.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(i(314))}x!==null&&x.delete(c),Og(l,g)}function na(l,c){return bu(l,c)}function Gh(l,c,g,x){this.tag=l,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=c,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=x,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ol(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ms(l,c){var g=l.alternate;return g===null?(g=n(l.tag,c,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=c,g.type=l.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=l.flags&65011712,g.childLanes=l.childLanes,g.lanes=l.lanes,g.child=l.child,g.memoizedProps=l.memoizedProps,g.memoizedState=l.memoizedState,g.updateQueue=l.updateQueue,c=l.dependencies,g.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Gd(l,c){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=c,l.child=null,l.subtreeFlags=0,l.memoizedProps=null,l.memoizedState=null,l.updateQueue=null,l.dependencies=null,l.stateNode=null):(l.childLanes=g.childLanes,l.lanes=g.lanes,l.child=g.child,l.subtreeFlags=0,l.deletions=null,l.memoizedProps=g.memoizedProps,l.memoizedState=g.memoizedState,l.updateQueue=g.updateQueue,l.type=g.type,c=g.dependencies,l.dependencies=c===null?null:{lanes:c.lanes,firstContext:c.firstContext}),l}function pi(l,c,g,x,j,E){var H=0;if(x=l,typeof l=="function")Ol(l)&&(H=1);else if(typeof l=="string")H=Js&&ua?nf(l,g,_a.current)?26:jp(l)?27:5:Js?nf(l,g,_a.current)?26:5:ua&&jp(l)?27:5;else e:switch(l){case fu:return l=n(31,g,c,j),l.elementType=fu,l.lanes=E,l;case zl:return Fs(g.children,j,E,c);case kl:H=8,j|=24;break;case Ll:return l=n(12,g,c,j|2),l.elementType=Ll,l.lanes=E,l;case Qd:return l=n(13,g,c,j),l.elementType=Qd,l.lanes=E,l;case mi:return l=n(19,g,c,j),l.elementType=mi,l.lanes=E,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Zs:H=10;break e;case du:H=9;break e;case Bo:H=11;break e;case Kd:H=14;break e;case Ia:H=16,x=null;break e}H=29,g=Error(i(130,l===null?"null":typeof l,"")),x=null}return c=n(H,g,c,j),c.elementType=l,c.type=x,c.lanes=E,c}function Fs(l,c,g,x){return l=n(7,l,x,c),l.lanes=g,l}function Ph(l,c,g){return l=n(6,l,null,c),l.lanes=g,l}function Yh(l){var c=n(18,null,null,0);return c.stateNode=l,c}function Vh(l,c,g){return c=n(4,l.children!==null?l.children:[],l.key,c),c.lanes=g,c.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},c}function Mg(l,c,g,x,j,E,H,Z,ge){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=hs,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=P(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=P(0),this.hiddenUpdates=P(null),this.identifierPrefix=x,this.onUncaughtError=j,this.onCaughtError=E,this.onRecoverableError=H,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ge,this.incompleteTransitions=new Map}function Yi(l,c,g,x,j,E,H,Z,ge,Ne,Oe,Ce){return l=new Mg(l,c,g,H,ge,Ne,Oe,Ce,Z),c=1,E===!0&&(c|=24),E=n(3,null,null,c),l.current=E,E.stateNode=l,c=dr(),c.refCount++,l.pooledCache=c,c.refCount++,E.memoizedState={element:x,isDehydrated:g,cache:c},ut(E),l}function Pd(l){return l?(l=Vr,l):Vr}function cu(l){var c=l._reactInternals;if(c===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=f(c),l=l!==null?p(l):null,l===null?null:Po(l.stateNode)}function Qh(l,c,g,x,j,E){j=Pd(j),x.context===null?x.context=j:x.pendingContext=j,x=Tt(c),x.payload={element:g},E=E===void 0?null:E,E!==null&&(x.callback=E),g=pn(l,x,c),g!==null&&(Mn(g,l,c),Rr(g,l,c))}function Ml(l,c){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<c?g:c}}function uu(l,c){Ml(l,c),(l=l.alternate)&&Ml(l,c)}var ft={},Yd=pl(),ds=Pb(),Vd=Object.assign,Al=Symbol.for("react.element"),Yr=Symbol.for("react.transitional.element"),Dl=Symbol.for("react.portal"),zl=Symbol.for("react.fragment"),kl=Symbol.for("react.strict_mode"),Ll=Symbol.for("react.profiler"),du=Symbol.for("react.consumer"),Zs=Symbol.for("react.context"),Bo=Symbol.for("react.forward_ref"),Qd=Symbol.for("react.suspense"),mi=Symbol.for("react.suspense_list"),Kd=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),fu=Symbol.for("react.activity"),Kh=Symbol.for("react.memo_cache_sentinel"),gi=Symbol.iterator,Vi=Symbol.for("react.client.reference"),Qi=Array.isArray,Qe=Yd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Xh=e.rendererVersion,hu=e.rendererPackageName,Go=e.extraDevToolsConfig,Po=e.getPublicInstance,Ag=e.getRootHostContext,Yo=e.getChildHostContext,Xd=e.prepareForCommit,Dg=e.resetAfterCommit,Fh=e.createInstance;e.cloneMutableInstance;var pu=e.appendInitialChild,fs=e.finalizeInitialChildren,Ja=e.shouldSetTextContent,yi=e.createTextInstance;e.cloneMutableTextInstance;var Zh=e.scheduleTimeout,zg=e.cancelTimeout,hs=e.noTimeout,Zn=e.isPrimaryRenderer;e.warnsIfNotActing;var wt=e.supportsMutation,As=e.supportsPersistence,vn=e.supportsHydration,rt=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var tn=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var St=e.setCurrentUpdatePriority,Is=e.getCurrentUpdatePriority,Vo=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Ul=e.shouldAttemptEagerTransition,Fd=e.detachDeletedInstance;e.requestPostPaintCallback;var mu=e.maySuspendCommit,Qo=e.maySuspendCommitOnUpdate,Ih=e.maySuspendCommitInSyncRender,An=e.preloadInstance,Jh=e.startSuspendingCommit,Zd=e.suspendInstance;e.suspendOnActiveViewTransition;var kg=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ql=e.NotPendingTransition,Hl=e.HostTransitionContext,Wh=e.resetFormInstance;e.bindToConsole;var $h=e.supportsMicrotasks,ep=e.scheduleMicrotask,ca=e.supportsTestSelectors,In=e.findFiberRoot,Id=e.getBoundingRect,gu=e.getTextContent,Ki=e.isHiddenSubtree,tp=e.matchAccessibilityRole,xi=e.setFocusIfFocusable,Jd=e.setupIntersectionObserver,np=e.appendChild,ap=e.appendChildToContainer,Lg=e.commitTextUpdate,Ug=e.commitMount,qg=e.commitUpdate,Hg=e.insertBefore,Bg=e.insertInContainerBefore,Gg=e.removeChild,sp=e.removeChildFromContainer,rp=e.resetTextContent,my=e.hideInstance,Pg=e.hideTextInstance,Yg=e.unhideInstance,Vg=e.unhideTextInstance;e.cancelViewTransitionName,e.cancelRootViewTransitionName,e.restoreRootViewTransitionName,e.cloneRootViewTransitionContainer,e.removeRootViewTransitionClone,e.measureClonedInstance,e.hasInstanceChanged,e.hasInstanceAffectedParent,e.startViewTransition,e.startGestureTransition,e.stopViewTransition,e.getCurrentGestureOffset,e.createViewTransitionInstance;var ip=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Qg=e.cloneInstance,lp=e.createContainerChildSet,op=e.appendChildToContainerChildSet,Kg=e.finalizeContainerChildren,cp=e.replaceContainerChildren,Xg=e.cloneHiddenInstance,up=e.cloneHiddenTextInstance,Xi=e.isSuspenseInstancePending,Wd=e.isSuspenseInstanceFallback,$d=e.getSuspenseInstanceFallbackErrorDetails,ef=e.registerSuspenseInstanceRetry,Fg=e.canHydrateFormStateMarker,dp=e.isFormStateMarkerMatching,Zg=e.getNextHydratableSibling,Ig=e.getNextHydratableSiblingAfterSingleton,Jg=e.getFirstHydratableChild,Wg=e.getFirstHydratableChildWithinContainer,$g=e.getFirstHydratableChildWithinActivityInstance,e0=e.getFirstHydratableChildWithinSuspenseInstance,fp=e.getFirstHydratableChildWithinSingleton,t0=e.canHydrateInstance,n0=e.canHydrateTextInstance,hp=e.canHydrateActivityInstance,a0=e.canHydrateSuspenseInstance,s0=e.hydrateInstance,gy=e.hydrateTextInstance,pp=e.hydrateActivityInstance,r0=e.hydrateSuspenseInstance,i0=e.getNextHydratableInstanceAfterActivityInstance,mp=e.getNextHydratableInstanceAfterSuspenseInstance,l0=e.commitHydratedInstance,o0=e.commitHydratedContainer,yy=e.commitHydratedActivityInstance,xy=e.commitHydratedSuspenseInstance,c0=e.finalizeHydratedChildren,yu=e.flushHydrationEvents;e.clearActivityBoundary;var gp=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var tf=e.clearSuspenseBoundaryFromContainer,u0=e.hideDehydratedBoundary,d0=e.unhideDehydratedBoundary,Ko=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var f0=e.validateHydratableInstance,yp=e.validateHydratableTextInstance,Js=e.supportsResources,nf=e.isHostHoistableType,xu=e.getHoistableRoot,xp=e.getResource,bp=e.acquireResource,Fi=e.releaseResource,h0=e.hydrateHoistable,vp=e.mountHoistable,Sp=e.unmountHoistable,af=e.createHoistableInstance,p0=e.prepareToCommitHoistables,Np=e.mayResourceSuspendCommit,_p=e.preloadResource,m0=e.suspendResource,ua=e.supportsSingletons,sf=e.resolveSingletonInstance,aa=e.acquireSingletonInstance,Na=e.releaseSingletonInstance,jp=e.isHostSingletonType,Bl=e.isSingletonScope,rf=[],Gl=-1,Vr={},ps=Math.clz32?Math.clz32:T,lf=Math.log,g0=Math.LN2,of=256,Pl=262144,Xo=4194304,bu=ds.unstable_scheduleCallback,cf=ds.unstable_cancelCallback,y0=ds.unstable_shouldYield,Cp=ds.unstable_requestPaint,Ga=ds.unstable_now,uf=ds.unstable_ImmediatePriority,x0=ds.unstable_UserBlockingPriority,vu=ds.unstable_NormalPriority,df=ds.unstable_IdlePriority,wp=ds.log,b0=ds.unstable_setDisableYieldValue,Yl=null,ms=null,Jn=typeof Object.is=="function"?Object.is:ie,ff=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var c=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(c))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},by=Object.prototype.hasOwnProperty,hf,Qr,Su=!1,Ep=new WeakMap,bi=[],Kr=0,nn=null,Nu=0,Ws=[],Ds=0,$s=null,Ma=1,xr="",_a=_(null),vi=_(null),Aa=_(null),_u=_(null),da=null,Sn=null,Nt=!1,Xr=null,Wa=!1,pf=Error(i(519)),er=_(null),cn=null,br=null,v0=typeof AbortController<"u"?AbortController:function(){var l=[],c=this.signal={aborted:!1,addEventListener:function(g,x){l.push(x)}};this.abort=function(){c.aborted=!0,l.forEach(function(g){return g()})}},ja=ds.unstable_scheduleCallback,vy=ds.unstable_NormalPriority,Nn={$$typeof:Zs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},ju=null,Jt=null,Pa=!1,tr=!1,mf=!1,Zi=0,Fo=null,Tp=0,Si=0,fa=null,nr=Qe.S;Qe.S=function(l,c){Zl=Ga(),typeof c=="object"&&c!==null&&typeof c.then=="function"&&Pc(l,c),nr!==null&&nr(l,c)};var Ii=_(null),ha=Error(i(460)),gf=Error(i(474)),ar=Error(i(542)),Fr={then:function(){}},$a=null,Ji=null,Vl=0,Da=Bs(!0),Rp=Bs(!1),za=[],Zr=0,Ql=0,zs=!1,yf=!1,Kl=_(null),Wi=_(0),gs=_(null),es=null,Gn=_(0),Ni=0,it=null,Ye=null,tt=null,ht=!1,dt=!1,Rt=!1,Ya=0,sr=0,vr=null,Op=0,ks={readContext:It,use:bo,useCallback:Rn,useContext:Rn,useEffect:Rn,useImperativeHandle:Rn,useLayoutEffect:Rn,useInsertionEffect:Rn,useMemo:Rn,useReducer:Rn,useRef:Rn,useState:Rn,useDebugValue:Rn,useDeferredValue:Rn,useTransition:Rn,useSyncExternalStore:Rn,useId:Rn,useHostTransitionStatus:Rn,useFormState:Rn,useActionState:Rn,useOptimistic:Rn,useMemoCache:Rn,useCacheRefresh:Rn};ks.useEffectEvent=Rn;var Dn={readContext:It,use:bo,useCallback:function(l,c){return qa().memoizedState=[l,c===void 0?null:c],l},useContext:It,useEffect:Fc,useImperativeHandle:function(l,c,g){g=g!=null?g.concat([l]):null,jl(4194308,4,_o.bind(null,c,l),g)},useLayoutEffect:function(l,c){return jl(4194308,4,l,c)},useInsertionEffect:function(l,c){jl(4,2,l,c)},useMemo:function(l,c){var g=qa();c=c===void 0?null:c;var x=l();if(Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,c],x},useReducer:function(l,c,g){var x=qa();if(g!==void 0){var j=g(c);if(Rt){J(!0);try{g(c)}finally{J(!1)}}}else j=c;return x.memoizedState=x.baseState=j,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:j},x.queue=l,l=l.dispatch=uy.bind(null,it,l),[x.memoizedState,l]},useRef:function(l){var c=qa();return l={current:l},c.memoizedState=l},useState:function(l){l=yh(l);var c=l.queue,g=ig.bind(null,it,c);return c.dispatch=g,[l.memoizedState,g]},useDebugValue:Ic,useDeferredValue:function(l,c){var g=qa();return Co(g,l,c)},useTransition:function(){var l=yh(!1);return l=ag.bind(null,it,l.queue,!0,!1),qa().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,c,g){var x=it,j=qa();if(Nt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=c(),pt===null)throw Error(i(349));(_t&127)!==0||$m(x,c,g)}j.memoizedState=g;var E={value:g,getSnapshot:c};return j.queue=E,Fc(gh.bind(null,x,E,l),[l]),x.flags|=2048,Ts(9,{destroy:void 0},mh.bind(null,x,E,g,c),null),g},useId:function(){var l=qa(),c=pt.identifierPrefix;if(Nt){var g=xr,x=Ma;g=(x&~(1<<32-ps(x)-1)).toString(32)+g,c="_"+c+"R_"+g,g=Ya++,0<g&&(c+="H"+g.toString(32)),c+="_"}else g=Op++,c="_"+c+"r_"+g.toString(32)+"_";return l.memoizedState=c},useHostTransitionStatus:Nh,useFormState:bh,useActionState:bh,useOptimistic:function(l){var c=qa();c.memoizedState=c.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return c.queue=g,c=_d.bind(null,it,!0,g),g.dispatch=c,[l,c]},useMemoCache:hd,useCacheRefresh:function(){return qa().memoizedState=cy.bind(null,it)},useEffectEvent:function(l){var c=qa(),g={impl:l};return c.memoizedState=g,function(){if((bt&2)!==0)throw Error(i(440));return g.impl.apply(void 0,arguments)}}},Ir={readContext:It,use:bo,useCallback:Sd,useContext:It,useEffect:No,useImperativeHandle:ng,useInsertionEffect:Di,useLayoutEffect:Zc,useMemo:jo,useReducer:li,useRef:vd,useState:function(){return li(gr)},useDebugValue:Ic,useDeferredValue:function(l,c){var g=xn();return Sh(g,Ye.memoizedState,l,c)},useTransition:function(){var l=li(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:Nl,useId:Nd,useHostTransitionStatus:Nh,useFormState:vo,useActionState:vo,useOptimistic:function(l,c){var g=xn();return Kc(g,Ye,l,c)},useMemoCache:hd,useCacheRefresh:rg};Ir.useEffectEvent=Xa;var $i={readContext:It,use:bo,useCallback:Sd,useContext:It,useEffect:No,useImperativeHandle:ng,useInsertionEffect:Di,useLayoutEffect:Zc,useMemo:jo,useReducer:md,useRef:vd,useState:function(){return md(gr)},useDebugValue:Ic,useDeferredValue:function(l,c){var g=xn();return Ye===null?Co(g,l,c):Sh(g,Ye.memoizedState,l,c)},useTransition:function(){var l=md(gr)[0],c=xn().memoizedState;return[typeof l=="boolean"?l:Ha(l),c]},useSyncExternalStore:Nl,useId:Nd,useHostTransitionStatus:Nh,useFormState:So,useActionState:So,useOptimistic:function(l,c){var g=xn();return Ye!==null?Kc(g,Ye,l,c):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:hd,useCacheRefresh:rg};$i.useEffectEvent=Xa;var Cu={enqueueSetState:function(l,c,g){l=l._reactInternals;var x=bn(),j=Tt(x);j.payload=c,g!=null&&(j.callback=g),c=pn(l,j,x),c!==null&&(Mn(c,l,x),Rr(c,l,x))},enqueueReplaceState:function(l,c,g){l=l._reactInternals;var x=bn(),j=Tt(x);j.tag=1,j.payload=c,g!=null&&(j.callback=g),c=pn(l,j,x),c!==null&&(Mn(c,l,x),Rr(c,l,x))},enqueueForceUpdate:function(l,c){l=l._reactInternals;var g=bn(),x=Tt(g);x.tag=2,c!=null&&(x.callback=c),c=pn(l,x,g),c!==null&&(Mn(c,l,g),Rr(c,l,g))}},ts=Error(i(461)),mn=!1,Xl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Pn=!1,Yn=!1,Zo=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,Wn=null,zn=null,$n=!1,Wt=null,Ls=8192,Io={getCacheForType:function(l){var c=It(Nn),g=c.data.get(l);return g===void 0&&(g=l(),c.data.set(l,g)),g},cacheSignal:function(){return It(Nn).controller.signal}},rr=0,Jo=1,Wo=2,wu=3,el=4;if(typeof Symbol=="function"&&Symbol.for){var Fl=Symbol.for;rr=Fl("selector.component"),Jo=Fl("selector.has_pseudo_class"),Wo=Fl("selector.role"),wu=Fl("selector.test_id"),el=Fl("selector.text")}var Us=typeof WeakMap=="function"?WeakMap:Map,bt=0,pt=null,vt=null,_t=0,$t=0,sa=null,Sr=!1,tl=!1,nl=!1,Jr=0,kn=0,_i=0,al=0,$o=0,ns=0,ec=0,Eu=null,ys=null,xf=!1,Tu=0,Zl=0,sl=1/0,Ru=null,ji=null,ra=0,Ci=null,Il=null,Wr=0,tc=0,bf=null,Ap=null,Ut=0,Ou=null;return ft.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var c=ct(l,67108864);c!==null&&Mn(c,l,67108864),uu(l,67108864)}},ft.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var c=bn();c=re(c);var g=ct(l,c);g!==null&&Mn(g,l,c),uu(l,c)}},ft.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var c=R(l.pendingLanes);if(c!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;c;){var g=1<<31-ps(c);l.entanglements[1]|=g,c&=~g}Ea(l),(bt&6)===0&&(sl=Ga()+500,rs(0))}}break;case 31:case 13:c=ct(l,2),c!==null&&Mn(c,l,2),Ld(),uu(l,2)}},ft.batchedUpdates=function(l,c){return l(c)},ft.createComponentSelector=function(l){return{$$typeof:rr,value:l}},ft.createContainer=function(l,c,g,x,j,E,H,Z,ge,Ne){return Yi(l,c,!1,null,g,x,E,null,H,Z,ge,Ne)},ft.createHasPseudoClassSelector=function(l){return{$$typeof:Jo,value:l}},ft.createHydrationContainer=function(l,c,g,x,j,E,H,Z,ge,Ne,Oe,Ce,Le,st){return l=Yi(g,x,!0,l,j,E,Z,st,ge,Ne,Oe,Ce),l.context=Pd(null),g=l.current,x=bn(),x=re(x),j=Tt(x),j.callback=c??null,pn(g,j,x),c=x,l.current.lanes=c,q(l,c),Ea(l),l},ft.createPortal=function(l,c,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:Dl,key:x==null?null:""+x,children:l,containerInfo:c,implementation:g}},ft.createRoleSelector=function(l){return{$$typeof:Wo,value:l}},ft.createTestNameSelector=function(l){return{$$typeof:wu,value:l}},ft.createTextSelector=function(l){return{$$typeof:el,value:l}},ft.defaultOnCaughtError=function(l){console.error(l)},ft.defaultOnRecoverableError=function(l){ff(l)},ft.defaultOnUncaughtError=function(l){ff(l)},ft.deferredUpdates=function(l){var c=Qe.T,g=Is();try{return St(32),Qe.T=null,l()}finally{St(g),Qe.T=c}},ft.discreteUpdates=function(l,c,g,x,j){var E=Qe.T,H=Is();try{return St(2),Qe.T=null,l(c,g,x,j)}finally{St(H),Qe.T=E,bt===0&&(sl=Ga()+500)}},ft.findAllNodes=us,ft.findBoundingRects=function(l,c){if(!ca)throw Error(i(363));c=us(l,c),l=[];for(var g=0;g<c.length;g++)l.push(Id(c[g]));for(c=l.length-1;0<c;c--){g=l[c];for(var x=g.x,j=x+g.width,E=g.y,H=E+g.height,Z=c-1;0<=Z;Z--)if(c!==Z){var ge=l[Z],Ne=ge.x,Oe=Ne+ge.width,Ce=ge.y,Le=Ce+ge.height;if(x>=Ne&&E>=Ce&&j<=Oe&&H<=Le){l.splice(c,1);break}else if(x!==Ne||g.width!==ge.width||Le<E||Ce>H){if(!(E!==Ce||g.height!==ge.height||Oe<x||Ne>j)){Ne>x&&(ge.width+=Ne-x,ge.x=x),Oe<j&&(ge.width=j-Ne),l.splice(c,1);break}}else{Ce>E&&(ge.height+=Ce-E,ge.y=E),Le<H&&(ge.height=H-Ce),l.splice(c,1);break}}}return l},ft.findHostInstance=cu,ft.findHostInstanceWithNoPortals=function(l){return l=f(l),l=l!==null?y(l):null,l===null?null:Po(l.stateNode)},ft.findHostInstanceWithWarning=function(l){return cu(l)},ft.flushPassiveEffects=Pr,ft.flushSyncFromReconciler=function(l){var c=bt;bt|=1;var g=Qe.T,x=Is();try{if(St(2),Qe.T=null,l)return l()}finally{St(x),Qe.T=g,bt=c,(bt&6)===0&&rs(0)}},ft.flushSyncWork=Ld,ft.focusWithin=function(l,c){if(!ca)throw Error(i(363));for(l=qi(l),c=ko(l,c),c=Array.from(c),l=0;l<c.length;){var g=c[l++],x=g.tag;if(!Ki(g)){if((x===5||x===26||x===27)&&xi(g.stateNode))return!0;for(g=g.child;g!==null;)c.push(g),g=g.sibling}}return!1},ft.getFindAllNodesFailureDescription=function(l,c){if(!ca)throw Error(i(363));var g=0,x=[];l=[qi(l),0];for(var j=0;j<l.length;){var E=l[j++],H=E.tag,Z=l[j++],ge=c[Z];if((H!==5&&H!==26&&H!==27||!Ki(E))&&(Hi(E,ge)&&(x.push(zo(ge)),Z++,Z>g&&(g=Z)),Z<c.length))for(E=E.child;E!==null;)l.push(E,Z),E=E.sibling}if(g<c.length){for(l=[];g<c.length;g++)l.push(zo(c[g]));return`findAllNodes was able to match part of the selector:
|
|
595
|
-
`+(x.join(" > ")+`
|
|
596
|
-
|
|
597
|
-
No matching component was found for:
|
|
598
|
-
`)+l.join(" > ")}return null},ft.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Po(l.child.stateNode);default:return l.child.stateNode}},ft.injectIntoDevTools=function(){var l={bundleType:0,version:Xh,rendererPackageName:hu,currentDispatcherRef:Qe,reconcilerVersion:"19.2.0"};if(Go!==null&&(l.rendererConfig=Go),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var c=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(c.isDisabled||!c.supportsFiber)l=!0;else{try{Yl=c.inject(l),ms=c}catch{}l=!!c.checkDCE}}return l},ft.isAlreadyRendering=function(){return(bt&6)!==0},ft.observeVisibleRects=function(l,c,g,x){if(!ca)throw Error(i(363));l=us(l,c);var j=Jd(l,g,x).disconnect;return{disconnect:function(){j()}}},ft.shouldError=function(){return null},ft.shouldSuspend=function(){return!1},ft.startHostTransition=function(l,c,g,x){if(l.tag!==5)throw Error(i(476));var j=sg(l).queue;ag(l,j,c,ql,g===null?s:function(){var E=sg(l);return E.next===null&&(E=l.alternate.memoizedState),Jc(l,E.next.queue,{},bn()),g(x)})},ft.updateContainer=function(l,c,g,x){var j=c.current,E=bn();return Qh(j,E,l,c,g,x),E},ft.updateContainerSync=function(l,c,g,x){return Qh(c.current,2,l,c,g,x),2},ft},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Mx)),Mx.exports}var P5;function Hk(){return P5||(P5=1,Ox.exports=qk()),Ox.exports}var Bk=Hk();const Gk=k1(Bk);var Ax={exports:{}},eo={};/**
|
|
599
|
-
* @license React
|
|
600
|
-
* react-reconciler-constants.production.js
|
|
601
|
-
*
|
|
602
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
603
|
-
*
|
|
604
|
-
* This source code is licensed under the MIT license found in the
|
|
605
|
-
* LICENSE file in the root directory of this source tree.
|
|
606
|
-
*/var Y5;function Pk(){return Y5||(Y5=1,eo.ConcurrentRoot=1,eo.ContinuousEventPriority=8,eo.DefaultEventPriority=32,eo.DiscreteEventPriority=2,eo.IdleEventPriority=268435456,eo.LegacyRoot=0,eo.NoEventPriority=0),eo}var V5;function Yk(){return V5||(V5=1,Ax.exports=Pk()),Ax.exports}var ly=Yk();const Q5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let K5=!1,X5=!1;const z1=".react-konva-event",Vk=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
607
|
-
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
608
|
-
Consider to add onDragMove or onDragEnd events.
|
|
609
|
-
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
610
|
-
`,Qk=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
611
|
-
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
612
|
-
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
613
|
-
`,Kk={};function oy(t,e,n=Kk){if(!K5&&"zIndex"in e&&(console.warn(Qk),K5=!0),!X5&&e.draggable){var s=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;s&&!i&&(console.warn(Vk),X5=!0)}for(var o in n)if(!Q5[o]){var d=o.slice(0,2)==="on",f=n[o]!==e[o];if(d&&f){var p=o.substr(2).toLowerCase();p.substr(0,7)==="content"&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),t.off(p,n[o])}var y=!e.hasOwnProperty(o);y&&t.setAttr(o,void 0)}var b=e._useStrictMode,v={},_=!1;const C={};for(var o in e)if(!Q5[o]){var d=o.slice(0,2)==="on",w=n[o]!==e[o];if(d&&w){var p=o.substr(2).toLowerCase();p.substr(0,7)==="content"&&(p="content"+p.substr(7,1).toUpperCase()+p.substr(8)),e[o]&&(C[p]=e[o])}!d&&(e[o]!==n[o]||b&&e[o]!==t.getAttr(o))&&(_=!0,v[o]=e[o])}_&&(t.setAttrs(v),Gc(t));for(var p in C)t.off(p+z1),t.on(p+z1,C[p])}function Gc(t){if(!De.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Dx=Pb();const I8={},Xk={};ah.Node.prototype._applyProps=oy;let J8=ly.DefaultEventPriority;function Fk(t,e){if(typeof e=="string"){console.error(`Do not use plain text as child of Konva.Node. You are using text: ${e}`);return}t.add(e),Gc(t)}function Zk(t,e,n){let s=ah[t];s||(console.error(`Konva has no node with the type ${t}. Group will be used instead. If you use minimal version of react-konva, just import required nodes into Konva: "import "konva/lib/shapes/${t}" If you want to render DOM elements as part of canvas tree take a look into this demo: https://konvajs.github.io/docs/react/DOM_Portal.html`),s=ah.Group);const i={},o={};for(var d in e)if(d!=="ref"){var f=d.slice(0,2)==="on";f?o[d]=e[d]:i[d]=e[d]}const p=new s(i);return oy(p,o),p}function Ik(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function Jk(t,e,n){return!1}function Wk(t){return t}function $k(){return null}function eL(){return null}function tL(t,e,n,s){return Xk}function nL(){}function aL(t){}function sL(t,e){return!1}function rL(){return I8}function iL(){return I8}const lL=setTimeout,oL=clearTimeout,cL=!0,uL=t=>{t()},dL=-1;function fL(t,e){return!1}const hL=!1,pL=!1,mL=!0,gL=!1,yL=!1;function xL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function bL(t,e){e.parent===t?e.moveToTop():t.add(e),Gc(t)}function W8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Gc(t)}function vL(t,e,n){W8(t,e,n)}function SL(t,e){e.destroy(),e.off(z1),Gc(t)}function NL(t,e){e.destroy(),e.off(z1),Gc(t)}function _L(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function jL(t,e,n){}function CL(t,e,n,s){oy(t,s,n)}function wL(t){t.hide(),Gc(t)}function EL(t){}function TL(t,e){(e.visible==null||e.visible)&&t.show()}function RL(t,e){}function OL(t){}function ML(){}function AL(){return null}function DL(){}function zL(){}function kL(){return ly.DefaultEventPriority}function LL(){}function UL(){return null}function qL(t){J8=t}function HL(){return J8}function BL(){return ly.DiscreteEventPriority}function GL(){return!1}function PL(){}function YL(){return null}function VL(){return-1.1}function QL(){}function KL(){return!1}function XL(){return!0}function FL(){}function ZL(){}function IL(){return null}const JL=null,WL=en.createContext(null);function $L(){}const eU=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:WL,NotPendingTransition:JL,afterActiveInstanceBlur:zL,appendChild:xL,appendChildToContainer:bL,appendInitialChild:Fk,beforeActiveInstanceBlur:DL,cancelTimeout:oL,clearContainer:OL,commitMount:jL,commitTextUpdate:_L,commitUpdate:CL,createInstance:Zk,createTextInstance:Ik,detachDeletedInstance:ML,finalizeInitialChildren:Jk,getChildHostContext:iL,getCurrentEventPriority:kL,getCurrentUpdatePriority:HL,getInstanceFromNode:AL,getInstanceFromScope:UL,getPublicInstance:Wk,getRootHostContext:rL,hideInstance:wL,hideTextInstance:EL,idlePriority:Dx.unstable_IdlePriority,insertBefore:W8,insertInContainerBefore:vL,isPrimaryRenderer:hL,maySuspendCommit:KL,noTimeout:dL,now:Dx.unstable_now,preloadInstance:XL,prepareForCommit:$k,preparePortalMount:eL,prepareScopeUpdate:LL,prepareUpdate:tL,removeChild:SL,removeChildFromContainer:NL,requestPostPaintCallback:QL,resetAfterCommit:nL,resetFormInstance:$L,resetTextContent:aL,resolveEventTimeStamp:VL,resolveEventType:YL,resolveUpdatePriority:BL,run:Dx.unstable_runWithPriority,scheduleMicrotask:uL,scheduleTimeout:lL,setCurrentUpdatePriority:qL,shouldAttemptEagerTransition:GL,shouldDeprioritizeSubtree:sL,shouldSetTextContent:fL,startSuspendingCommit:FL,supportsHydration:yL,supportsMicrotasks:cL,supportsMutation:mL,supportsPersistence:gL,suspendInstance:ZL,trackSchedulerEvent:PL,unhideInstance:TL,unhideTextInstance:RL,waitForCommitToBeReady:IL,warnsIfNotActing:pL},Symbol.toStringTag,{value:"Module"}));function $8(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const i=$8(s,e,n);if(i)return i;s=s.sibling}}function e7(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Dv=e7(D.createContext(null));class t7 extends D.Component{render(){return D.createElement(Dv.Provider,{value:this._reactInternals},this.props.children)}}function tU(){const t=D.useContext(Dv);if(t===null)throw new Error("its-fine: useFiber must be called within a <FiberProvider />!");const e=D.useId();return D.useMemo(()=>{for(const n of[t,t==null?void 0:t.alternate]){if(!n)continue;const s=$8(n,!1,i=>{let o=i.memoizedState;for(;o;){if(o.memoizedState===e)return!0;o=o.next}});if(s)return s}},[t,e])}const nU=Symbol.for("react.context"),aU=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===nU;function sU(){const t=tU(),[e]=D.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;aU(s)&&s!==Dv&&!e.has(s)&&e.set(s,D.use(e7(s))),n=n.return}return e}function rU(){const t=sU();return D.useMemo(()=>Array.from(t.keys()).reduce((e,n)=>s=>D.createElement(e,null,D.createElement(n.Provider,{...s,value:t.get(n)})),e=>D.createElement(t7,{...e})),[t])}if(en.version.indexOf("19")===-1)throw new Error("react-konva version 19 is only compatible with React 19. Make sure to have the last version of react-konva and react or downgrade react-konva to version 18.");function iU(t){const e=en.useRef({});return en.useLayoutEffect(()=>{e.current=t}),en.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const lU=()=>{const t=en.useRef(0);return en.useMemo(()=>{t.current++},[]),t.current>1},oU=t=>{const e=en.useRef(null),n=en.useRef(null),s=en.useRef(null),i=iU(t),o=rU(),d=en.useRef(null),f=b=>{const{forwardedRef:v}=t;v&&(typeof v=="function"?v(b):v.current=b)},p=lU(),y=()=>{var b;f(null),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(null,s.current,null)}),(b=n.current)==null||b.destroy(),n.current=null};return en.useLayoutEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),n.current?f(n.current):(n.current=new ah.Stage({width:t.width,height:t.height,container:e.current}),f(n.current),s.current=Rf.createContainer(n.current,ly.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Rf.updateContainer(en.createElement(o,{},t.children),s.current,null,()=>{})),()=>{p?d.current=setTimeout(y,0):y()}),[]),en.useLayoutEffect(()=>{f(n.current),oy(n.current,t,i),Rf.flushSyncFromReconciler(()=>{Rf.updateContainer(en.createElement(o,{},t.children),s.current,null)})}),en.createElement("div",{ref:e,id:t.id,accessKey:t.accessKey,className:t.className,role:t.role,style:t.style,tabIndex:t.tabIndex,title:t.title})},zx="Layer",F5="Group",Z5="Circle",ku="Line",cU="Text",uU="Arrow",Rf=Gk(eU),dU=en.forwardRef((t,e)=>en.createElement(t7,{},en.createElement(oU,{...t,forwardedRef:e})));function im(t,e,n){return{x:t.x*e,y:t.y*n}}function I5(t,e,n){return{x:t.x/e,y:t.y/n}}function J5(t,e,n){return t.flatMap(s=>[s.x*e,s.y*n])}function fU(t,e){return e?"#6366f1":t.color}const W5=16,$5=9;function hU({zones:t,selectedZoneId:e,onSelectZone:n,onZonePointsChange:s,onZoneComplete:i,drawingType:o}){const d=D.useRef(null),[f,p]=D.useState({w:800,h:450}),[y,b]=D.useState([]),[v,_]=D.useState(null);D.useEffect(()=>{const M=d.current;if(!M)return;const z=new ResizeObserver(k=>{const P=k[0];if(P){const{width:q}=P.contentRect;p({w:q,h:q*9/16})}});return z.observe(M),()=>z.disconnect()},[]);const C=o!==null,w=D.useCallback(M=>{if(!C){n(null);return}const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();if(!k)return;const P=I5(k,f.w,f.h),q=o==="tripwire";if(y.length===0){b([P]);return}if(q&&y.length===1){const L=[...y,P],U={id:crypto.randomUUID(),name:"Tripwire",type:"tripwire",color:"#f59e0b",points:L};i(U),b([]);return}if(y.length>=3&&!q){const L=im(y[0],f.w,f.h);if(Math.hypot(k.x-L.x,k.y-L.y)<12){const V={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(V),b([]);return}}b(L=>[...L,P])},[C,y,f,o,i,n]),T=D.useCallback(M=>{if(!C||o==="tripwire"||y.length<3)return;M.cancelBubble=!0;const z={id:crypto.randomUUID(),name:o==="package-watch"?"Package Watch":"Zone",type:o,color:o==="package-watch"?"#10b981":"#3b82f6",points:y};i(z),b([])},[C,o,y,i]),R=D.useCallback(M=>{const z=M.target.getStage();if(!z)return;const k=z.getPointerPosition();_(k??null)},[]),O=[];for(let M=1;M<W5;M++){const z=f.w/W5*M;O.push(h.jsx(ku,{points:[z,0,z,f.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${M}`))}for(let M=1;M<$5;M++){const z=f.h/$5*M;O.push(h.jsx(ku,{points:[0,z,f.w,z],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gh-${M}`))}return h.jsxs("div",{ref:d,className:"w-full bg-zinc-900 rounded-lg overflow-hidden",style:{cursor:C?"crosshair":"default"},children:[h.jsxs(dU,{width:f.w,height:f.h,onClick:w,onDblClick:T,onMouseMove:R,children:[h.jsxs(zx,{children:[h.jsx(ku,{points:[0,0,f.w,0,f.w,f.h,0,f.h,0,0],stroke:"transparent",strokeWidth:0}),O]}),h.jsx(zx,{children:t.map(M=>{const z=M.id===e,k=fU(M,z),P=J5(M.points,f.w,f.h),q=M.type==="tripwire";return h.jsxs(F5,{onClick:L=>{L.cancelBubble=!0,C||n(M.id)},children:[q?h.jsx(uU,{points:P,stroke:k,strokeWidth:z?3:2,fill:k,pointerLength:10,pointerWidth:8,opacity:z?1:.8}):h.jsx(ku,{points:P,closed:!0,fill:k+"33",stroke:k,strokeWidth:z?2.5:1.5,opacity:z?1:.85}),M.points.length>0&&h.jsx(cU,{x:im(M.points[0],f.w,f.h).x+4,y:im(M.points[0],f.w,f.h).y+4,text:M.name,fontSize:11,fill:k,fontStyle:"bold"}),z&&M.points.map((L,U)=>{const V=im(L,f.w,f.h);return h.jsx(Z5,{x:V.x,y:V.y,radius:5,fill:k,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:F=>{const re=I5({x:F.target.x(),y:F.target.y()},f.w,f.h),ne=M.points.map((J,ie)=>ie===U?re:J);s(M.id,ne)}},U)})]},M.id)})}),h.jsx(zx,{children:C&&y.length>0&&h.jsxs(F5,{children:[y.length>=2&&o!=="tripwire"&&h.jsx(ku,{points:J5(y,f.w,f.h),stroke:"#6366f1",strokeWidth:1.5,dash:[6,3],opacity:.8}),y.length===1&&o==="tripwire"&&v&&h.jsx(ku,{points:[y[0].x*f.w,y[0].y*f.h,v.x,v.y],stroke:"#f59e0b",strokeWidth:1.5,dash:[6,3],opacity:.7}),v&&y.length>=1&&o!=="tripwire"&&h.jsx(ku,{points:[y[y.length-1].x*f.w,y[y.length-1].y*f.h,v.x,v.y],stroke:"#6366f1",strokeWidth:1,dash:[4,4],opacity:.5}),y.map((M,z)=>{const k=im(M,f.w,f.h),P=z===0;return h.jsx(Z5,{x:k.x,y:k.y,radius:P&&y.length>=3?7:4,fill:P&&y.length>=3?"#6366f1":"#ffffff",stroke:"#6366f1",strokeWidth:1.5,opacity:.9},z)})]})})]}),C&&h.jsx("div",{className:"px-3 py-1.5 bg-zinc-800/80 text-[11px] text-zinc-400 border-t border-zinc-700",children:o==="tripwire"?"Click to set start point, click again to complete the tripwire":y.length<3?"Click to add points (min 3). Double-click or click first point to close.":"Continue adding points. Double-click or click first point to close."})]})}const pU={intrusion:"Intrusion","package-watch":"Package",tripwire:"Tripwire"},mU={intrusion:"bg-danger/10 text-danger","package-watch":"bg-success/10 text-success",tripwire:"bg-warning/10 text-warning"};function gU({zones:t,selectedZoneId:e,drawingType:n,onSelectZone:s,onDeleteZone:i,onStartDraw:o,onCancelDraw:d}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("div",{className:"flex flex-col gap-1.5",children:n?h.jsxs("button",{type:"button",onClick:d,className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-3 py-1.5 text-xs font-medium text-warning hover:bg-warning/20 transition-colors",children:[h.jsx(JT,{className:"h-3 w-3"}),"Cancel drawing"]}):h.jsxs(h.Fragment,{children:[h.jsxs("button",{type:"button",onClick:()=>o("intrusion"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Zone"]}),h.jsxs("button",{type:"button",onClick:()=>o("tripwire"),className:"w-full flex items-center justify-center gap-1.5 rounded-md border border-border bg-surface px-3 py-1.5 text-xs font-medium text-foreground hover:bg-surface-hover transition-colors",children:[h.jsx(po,{className:"h-3 w-3"}),"Add Tripwire"]})]})}),t.length===0?h.jsx("p",{className:"text-center text-[11px] text-foreground-subtle py-4",children:'No zones yet. Click "Add Zone" or "Add Tripwire" to start.'}):h.jsx("div",{className:"flex flex-col gap-1",children:t.map(f=>{const p=f.id===e;return h.jsxs("div",{className:["flex items-center gap-2 rounded-md border px-2 py-1.5 cursor-pointer transition-colors",p?"border-primary/50 bg-primary/10":"border-border bg-surface hover:bg-surface-hover"].join(" "),onClick:()=>s(p?null:f.id),children:[h.jsx("div",{className:"h-3 w-3 rounded-sm flex-shrink-0",style:{backgroundColor:f.color}}),h.jsx("span",{className:"flex-1 truncate text-xs font-medium text-foreground",children:f.name}),h.jsx("span",{className:`inline-flex items-center rounded-full px-1.5 py-0.5 text-[9px] font-medium flex-shrink-0 ${mU[f.type]}`,children:pU[f.type]}),h.jsxs("div",{className:"flex items-center gap-0.5 flex-shrink-0",children:[h.jsx("button",{type:"button",title:"Select",className:"p-0.5 text-foreground-subtle hover:text-primary rounded transition-colors",onClick:y=>{y.stopPropagation(),s(f.id)},children:h.jsx(rR,{className:"h-3 w-3"})}),h.jsx("button",{type:"button",title:"Delete",className:"p-0.5 text-foreground-subtle hover:text-danger rounded transition-colors",onClick:y=>{y.stopPropagation(),i(f.id)},children:h.jsx(Jm,{className:"h-3 w-3"})})]})]},f.id)})})]})}const yU=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#f97316","#ec4899"],xU=[{value:"intrusion",label:"Intrusion"},{value:"package-watch",label:"Package Watch"},{value:"tripwire",label:"Tripwire"}],kx="w-full rounded-md border border-border bg-background px-3 py-1.5 text-sm text-foreground focus:border-primary focus:ring-1 focus:ring-primary/30 outline-none";function bU({zone:t,onChange:e,onDelete:n}){return h.jsxs("div",{className:"flex flex-col gap-3",children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:"Edit Zone"}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Name"}),h.jsx("input",{type:"text",className:kx,value:t.name,onChange:s=>e({...t,name:s.target.value}),placeholder:"Zone name"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Type"}),h.jsx("select",{className:kx,value:t.type,onChange:s=>e({...t,type:s.target.value}),children:xU.map(s=>h.jsx("option",{value:s.value,children:s.label},s.value))})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1.5",children:"Color"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 mb-2",children:yU.map(s=>h.jsx("button",{type:"button",title:s,className:["h-5 w-5 rounded-md border-2 transition-transform hover:scale-110",t.color===s?"border-white scale-110":"border-transparent"].join(" "),style:{backgroundColor:s},onClick:()=>e({...t,color:s})},s))}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"color",className:"h-7 w-7 rounded border border-border bg-background cursor-pointer p-0.5",value:t.color,onChange:s=>e({...t,color:s.target.value})}),h.jsx("input",{type:"text",className:kx+" font-mono flex-1",value:t.color,placeholder:"#000000",onChange:s=>e({...t,color:s.target.value})})]})]}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[t.type==="tripwire"?"Tripwire: 2 points":`Polygon: ${t.points.length} points`,t.points.length>0&&" — drag handles on canvas to reshape"]}),h.jsxs("button",{type:"button",onClick:n,className:"mt-1 flex items-center justify-center gap-1.5 w-full rounded-md border border-danger/40 bg-danger/10 px-3 py-1.5 text-xs font-medium text-danger hover:bg-danger/20 transition-colors",children:[h.jsx(Jm,{className:"h-3 w-3"}),"Delete zone"]})]})}function vU(){const[t,e]=D.useState([]),[n,s]=D.useState(null),[i,o]=D.useState(null),d=t.find(_=>_.id===n)??null,f=_=>{e(C=>[...C,_]),s(_.id),o(null)},p=(_,C)=>{e(w=>w.map(T=>T.id===_?{...T,points:C}:T))},y=_=>{e(C=>C.map(w=>w.id===_.id?_:w))},b=_=>{e(C=>C.filter(w=>w.id!==_)),n===_&&s(null)},v=_=>{s(null),o(_)};return h.jsx("div",{className:"space-y-4",children:h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Zone Editor"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Define detection zones and tripwire lines"})]}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[t.length," zone",t.length!==1?"s":""]})]}),h.jsxs("div",{className:"flex flex-col lg:flex-row",children:[h.jsx("div",{className:"flex-1 p-4",children:h.jsx(hU,{zones:t,selectedZoneId:n,onSelectZone:s,onZonePointsChange:p,onZoneComplete:f,drawingType:i})}),h.jsxs("div",{className:"w-full lg:w-64 border-t lg:border-t-0 lg:border-l border-border p-4 flex flex-col gap-4",children:[h.jsx(gU,{zones:t,selectedZoneId:n,drawingType:i,onSelectZone:s,onDeleteZone:b,onStartDraw:v,onCancelDraw:()=>o(null)}),d&&!i&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t border-border"}),h.jsx(bU,{zone:d,onChange:y,onDelete:()=>b(d.id)})]})]})]})]})})}function SU(t){return{id:t.id,name:t.packageName??t.id,type:t.slot??"addon",enabled:!0}}function NU({deviceId:t}){const e=Ft(),{data:n,isLoading:s}=ot({queryKey:["bridge-addons"],queryFn:()=>e.bridgeListAddons()}),o=(n??[]).map(SU),d=o.filter(p=>p.type==="vision"||p.type==="detection"||p.type==="inference");if(s)return h.jsx("div",{className:"space-y-2",children:[1,2,3].map(p=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},p))});if(!d.length&&!o.length)return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"})}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(Mm,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm",children:"No vision addons installed"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Install addons to enable detection and inference"})]})]});const f=d.length>0?d:o;return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Vision Addons"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[f.length," addon",f.length!==1?"s":""]})]}),h.jsx("div",{className:"space-y-2",children:f.map(p=>h.jsxs("div",{className:"flex items-center gap-3 rounded-lg border border-border bg-surface px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-primary/10 flex-shrink-0",children:h.jsx(Mm,{className:"h-4 w-4 text-primary"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("p",{className:"text-xs font-medium text-foreground truncate",children:p.name||p.id}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[p.type," ",p.version?`v${p.version}`:""]})]}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${p.enabled!==!1?"bg-success":"bg-foreground-subtle/30"}`}),h.jsx("button",{className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",title:"Settings",children:h.jsx(Im,{className:"h-3.5 w-3.5"})})]},p.id))})]})}function _U({deviceId:t}){const e=Ft(),[n,s]=D.useState(null),{data:i}=ot({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t}),o=e.serverUrl??window.location.origin,d=[{id:"webrtc",label:"WebRTC",resolution:"Native",codec:"H.264",url:`${o}/webrtc/${t}`},{id:"hls",label:"HLS",resolution:"Native",codec:"H.264",url:`${o}/hls/${t}/index.m3u8`},{id:"mjpeg",label:"MJPEG",resolution:"Scaled",codec:"MJPEG",url:`${o}/mjpeg/${t}`}];async function f(p){try{await navigator.clipboard.writeText(p),s(p),setTimeout(()=>s(null),2e3)}catch{}}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Available Streams"}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[d.length," streams"]})]}),h.jsx("div",{className:"divide-y divide-border",children:d.map(p=>h.jsxs("div",{className:"flex items-center gap-3 px-4 py-3",children:[h.jsx("div",{className:"flex items-center justify-center rounded-lg h-8 w-8 bg-info/10 flex-shrink-0",children:h.jsx(fv,{className:"h-4 w-4 text-info"})}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("p",{className:"text-xs font-medium text-foreground",children:p.label}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:p.resolution}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:p.codec})]}),h.jsx("p",{className:"text-[10px] font-mono text-foreground-subtle mt-0.5 truncate",children:p.url})]}),h.jsx("button",{onClick:()=>f(p.url),className:"p-1.5 rounded-md text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors flex-shrink-0",title:"Copy URL",children:n===p.url?h.jsx(Fm,{className:"h-3.5 w-3.5 text-success"}):h.jsx(fT,{className:"h-3.5 w-3.5"})})]},p.id))})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Restreamer"})}),h.jsxs("div",{className:"px-4 py-8 flex flex-col items-center text-center text-foreground-subtle",children:[h.jsx("p",{className:"text-sm",children:"Restreamer URLs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Restreamer endpoints will be displayed here when a restreamer is configured"})]})]})]})}function jU(){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"border-b border-border px-4 py-2.5 flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:"Device Logs"}),h.jsx("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:"Scoped log stream for this device"})]}),h.jsx("span",{className:"inline-flex items-center gap-1.5 rounded-full bg-info/10 px-2.5 py-0.5 text-[10px] font-medium text-info",children:"Coming with backend integration"})]}),h.jsxs("div",{className:"flex flex-col items-center justify-center py-16 text-foreground-subtle",children:[h.jsx(Zm,{className:"h-8 w-8 mb-3 opacity-30"}),h.jsx("p",{className:"text-sm font-medium text-foreground",children:"Device logs"}),h.jsx("p",{className:"text-xs mt-1 opacity-70",children:"Device logs — coming with backend integration"})]})]})}let e4=0;function CU({deviceId:t}){const e=Ft(),[n,s]=D.useState(""),[i,o]=D.useState([]),d=D.useRef(null),f=Cn({mutationFn:v=>e.replEval(v,{type:"device",deviceId:t}),onSuccess:(v,_)=>{const C=typeof v=="string"?v:JSON.stringify(v,null,2);o(w=>[...w,{id:++e4,code:_,result:C,error:!1,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}]),s("")},onError:(v,_)=>{const C=v instanceof Error?v.message:String(v);o(w=>[...w,{id:++e4,code:_,result:C,error:!0,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}])}});function p(){const v=n.trim();v&&f.mutate(v)}function y(v){(v.metaKey||v.ctrlKey)&&v.key==="Enter"&&(v.preventDefault(),p())}function b(v){var _;s(v),(_=d.current)==null||_.focus()}return h.jsxs("div",{className:"space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("p",{className:"text-xs text-foreground-subtle",children:["Scoped to device: ",h.jsx("span",{className:"font-mono text-foreground",children:t})]}),i.length>0&&h.jsxs("button",{onClick:()=>o([]),className:"inline-flex items-center gap-1 text-[10px] text-foreground-subtle hover:text-foreground",children:[h.jsx(Jm,{className:"h-3 w-3"}),"Clear history"]})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-center justify-between border-b border-border px-3 py-1.5",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle font-mono",children:"JavaScript — Ctrl+Enter to run"}),h.jsxs("button",{onClick:p,disabled:f.isPending||!n.trim(),className:"inline-flex items-center gap-1.5 rounded px-2.5 py-1 text-[10px] font-medium bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:[h.jsx(dv,{className:"h-3 w-3"}),f.isPending?"Running...":"Execute"]})]}),h.jsx("textarea",{ref:d,value:n,onChange:v=>s(v.target.value),onKeyDown:y,rows:5,placeholder:"// Enter JavaScript code scoped to this device...",className:"w-full resize-y bg-background p-3 font-mono text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none",spellCheck:!1})]}),i.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No evaluations yet"}),i.length>0&&h.jsx("div",{className:"space-y-3",children:[...i].reverse().map(v=>h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start justify-between gap-2 border-b border-border bg-background px-3 py-2",children:[h.jsx("pre",{className:"font-mono text-xs text-foreground whitespace-pre-wrap break-all flex-1",children:v.code}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:v.ts}),h.jsx("button",{onClick:()=>b(v.code),title:"Reuse",className:"text-foreground-subtle hover:text-foreground",children:h.jsx(N1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("pre",{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-all ${v.error?"text-danger":"text-success"}`,children:v.result})]},v.id))})]})}const wU=[{id:"events",label:"Events"},{id:"pipeline",label:"Pipeline"},{id:"recording",label:"Recording"},{id:"zones",label:"Zones"},{id:"addons",label:"Addons"},{id:"streams",label:"Streams"},{id:"logs",label:"Logs"},{id:"repl",label:"REPL"}];function EU(){const{deviceId:t}=$b(),e=Ft(),[n,s]=D.useState("events"),{data:i,isLoading:o}=ot({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t,refetchInterval:5e3}),d=i??{},f=String(d.name??t??"Device"),p=String(d.status??"offline"),y=String(d.providerId??d.provider??"rtsp"),b=String(d.phase??"—"),v=d.priority!=null?String(d.priority):null;function _(){if(!t)return null;switch(n){case"events":return h.jsx(fD,{deviceId:t});case"pipeline":return h.jsx(hD,{deviceId:t});case"recording":return h.jsx(pD,{});case"zones":return h.jsx(vU,{});case"addons":return h.jsx(NU,{deviceId:t});case"streams":return h.jsx(_U,{deviceId:t});case"logs":return h.jsx(jU,{});case"repl":return h.jsx(CU,{deviceId:t});default:return null}}return o?h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsx("div",{className:"h-4 w-48 rounded bg-surface-hover animate-pulse mb-3"}),h.jsx("div",{className:"h-8 w-64 rounded bg-surface-hover animate-pulse"})]}),h.jsx("div",{className:"flex-1 p-6",children:h.jsx("div",{className:"h-40 rounded-lg border border-border bg-surface animate-pulse"})})]}):h.jsxs("div",{className:"flex flex-col h-full",children:[h.jsxs("div",{className:"border-b border-border bg-surface px-6 py-4",children:[h.jsxs("nav",{className:"flex items-center gap-1 text-[11px] text-foreground-subtle mb-3",children:[h.jsx(sv,{to:"/cameras",className:"hover:text-foreground transition-colors",children:"Cameras"}),h.jsx(Zu,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground-subtle",children:g8(y)}),h.jsx(Zu,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground",children:f})]}),h.jsxs("div",{className:"flex items-center gap-3",children:[h.jsx(ny,{type:y,size:"lg"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("h1",{className:"text-base font-semibold text-foreground truncate",children:f}),h.jsx(th,{status:p})]}),h.jsxs("div",{className:"flex items-center gap-3 mt-1 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{className:"inline-flex items-center gap-1",children:[h.jsx("span",{className:`h-1.5 w-1.5 rounded-full ${p==="online"||p==="running"?"bg-success":"bg-foreground-subtle/30"}`}),p==="online"||p==="running"?"Online":"Offline"]}),h.jsxs("span",{children:["Phase: ",h.jsx("span",{className:"text-foreground",children:b})]}),v&&h.jsxs("span",{children:["Priority: ",h.jsx("span",{className:"text-foreground",children:v})]})]})]})]})]}),h.jsxs("div",{className:"flex border-b border-border",children:[h.jsx("div",{className:"flex-1 p-4 border-r border-border",children:h.jsx(cD,{deviceName:f,detectionsToday:0,inferenceMs:0,activeTracks:0,storageGb:0})}),h.jsx("div",{className:"w-[300px] flex-shrink-0 bg-surface",children:h.jsx(uD,{deviceId:t??""})})]}),h.jsx("div",{className:"border-b border-border bg-surface px-6",children:h.jsx("div",{className:"flex items-center gap-0 overflow-x-auto",children:wU.map(C=>{const w=n===C.id;return h.jsxs("button",{onClick:()=>s(C.id),className:`relative flex-shrink-0 px-4 py-3 text-xs font-medium transition-colors ${w?"text-primary":"text-foreground-subtle hover:text-foreground"}`,children:[C.label,w&&h.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-primary"})]},C.id)})})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_()})]})}const n7=D.createContext(null);function TU(){const t=D.useContext(n7);if(!t)throw new Error("useConfirm must be used within ConfirmDialogProvider");return t.confirm}function RU({children:t}){const[e,n]=D.useState(null),s=D.useCallback(p=>new Promise(y=>{n({...p,resolve:y})}),[]),i=()=>{e==null||e.resolve(!0),n(null)},o=()=>{e==null||e.resolve(!1),n(null)},d={danger:{icon:"text-red-400",button:"bg-red-500 hover:bg-red-600 text-white"},warning:{icon:"text-orange-400",button:"bg-orange-500 hover:bg-orange-600 text-white"},default:{icon:"text-primary",button:"bg-primary hover:bg-primary/90 text-white"}},f=e?d[e.variant??"default"]:d.default;return h.jsxs(n7.Provider,{value:{confirm:s},children:[t,e&&h.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[h.jsx("div",{className:"absolute inset-0 bg-black/50 backdrop-blur-sm",onClick:o}),h.jsxs("div",{className:"relative z-10 w-full max-w-sm mx-4 rounded-xl border border-border bg-surface shadow-2xl overflow-hidden animate-in fade-in zoom-in-95 duration-150",onClick:p=>p.stopPropagation(),children:[h.jsxs("div",{className:"px-5 pt-5 pb-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground",children:e.title}),h.jsx("p",{className:"mt-2 text-xs text-foreground-subtle leading-relaxed",children:e.message})]}),h.jsxs("div",{className:"flex justify-end gap-2 px-5 py-3 border-t border-border bg-surface-hover/30",children:[h.jsx("button",{type:"button",onClick:o,className:"px-3 py-1.5 text-xs font-medium rounded-md border border-border text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:e.cancelLabel??"Cancel"}),h.jsx("button",{type:"button",onClick:i,className:`px-3 py-1.5 text-xs font-medium rounded-md transition-colors ${f.button}`,children:e.confirmLabel??"Confirm"})]})]})]})]})}function OU({packageName:t,currentVersion:e,onInstall:n,onClose:s}){const i=Ft(),{data:o,isLoading:d}=ot({queryKey:["addon-versions",t],queryFn:()=>i.trpc.addons.getVersions.query({name:t}),staleTime:5*6e4});return h.jsxs("div",{className:"fixed z-50 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden",style:{top:"auto",bottom:"auto"},ref:f=>{var v;if(!f)return;const p=(v=f.parentElement)==null?void 0:v.getBoundingClientRect();if(!p)return;const y=window.innerHeight-p.bottom,b=p.top;y<280&&b>y?(f.style.bottom=`${window.innerHeight-p.top+4}px`,f.style.top="auto"):(f.style.top=`${p.bottom+4}px`,f.style.bottom="auto"),f.style.right=`${window.innerWidth-p.right}px`},onClick:f=>f.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-3 py-2 border-b border-border",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Versions"}),h.jsx("button",{type:"button",onClick:s,className:"text-foreground-subtle hover:text-foreground",children:h.jsx(bl,{className:"h-3 w-3"})})]}),d&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-[10px] text-foreground-subtle",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),"Loading versions..."]}),o&&h.jsx("div",{className:"max-h-64 overflow-auto divide-y divide-border",children:o.map(f=>{const p=f.version===e,y=/-(alpha|beta|rc|dev|canary|next)/i.test(f.version);return h.jsxs("div",{className:`flex items-center gap-2 px-3 py-2 text-[11px] ${p?"bg-primary/5":"hover:bg-surface-hover"} transition-colors`,children:[h.jsx("span",{className:`font-mono flex-1 ${p?"text-primary font-semibold":y?"text-amber-400":"text-foreground"}`,children:f.version}),f.distTags.map(b=>h.jsx("span",{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${b==="latest"?"bg-emerald-500/15 text-emerald-400":b==="beta"?"bg-amber-500/15 text-amber-400":"bg-gray-500/15 text-gray-400"}`,children:b},b)),f.deprecated&&h.jsx("span",{className:"text-[9px] text-red-400 line-through",children:"deprecated"}),h.jsx("span",{className:"text-[9px] text-foreground-subtle shrink-0",children:new Date(f.publishedAt).toLocaleDateString()}),p?h.jsx(Fm,{className:"h-3 w-3 text-primary shrink-0"}):h.jsx("button",{type:"button",onClick:()=>n(f.version),className:"shrink-0 rounded p-0.5 hover:bg-primary/20 text-foreground-subtle hover:text-primary transition-colors",title:`Install ${f.version}`,children:h.jsx(_1,{className:"h-3 w-3"})})]},f.version)})}),o&&o.length===0&&h.jsx("div",{className:"py-4 text-center text-[10px] text-foreground-subtle",children:"No versions found"})]})}const t4={error:{icon:w6,color:"text-red-400"},warn:{icon:pv,color:"text-amber-400"},info:{icon:j1,color:"text-blue-400"},debug:{icon:QE,color:"text-gray-500"}},MU=["all","error","warn","info","debug"];function AU({addonId:t,onClose:e}){const n=Ft(),[s,i]=D.useState(void 0),[o]=D.useState(100),[d,f]=D.useState([]),[p,y]=D.useState(!0),b=D.useRef(null),{data:v,isLoading:_}=ot({queryKey:["addon-logs",t,s,o],queryFn:()=>n.trpc.addons.getLogs.query({addonId:t,limit:o,level:s}),staleTime:3e4});D.useEffect(()=>{f([])},[s]),D.useEffect(()=>{const T=n.trpc.addons.onAddonLogs.subscribe({addonId:t,level:s},{onData:R=>{f(O=>[...O,R])},onError:R=>{console.error("Log subscription error:",R)}});return()=>{T.unsubscribe()}},[n,t,s]),D.useEffect(()=>{p&&b.current&&b.current.scrollTo({top:0})},[d,p]);const C=D.useMemo(()=>[...[...(v??[]).map(R=>({timestamp:typeof R.timestamp=="string"?R.timestamp:new Date(R.timestamp).toISOString(),level:R.level,message:R.message,scope:R.scope})),...d]].reverse(),[v,d]),w=D.useCallback(T=>{i(T==="all"?void 0:T)},[]);return h.jsxs("div",{className:"border-t border-border",onClick:T=>T.stopPropagation(),children:[h.jsxs("div",{className:"flex items-center justify-between px-4 py-2 bg-surface-hover/30",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[10px] uppercase tracking-wide text-foreground-subtle font-medium",children:"Logs"}),h.jsx("div",{className:"flex rounded border border-border overflow-hidden text-[9px]",children:MU.map(T=>h.jsx("button",{type:"button",onClick:()=>w(T),className:`px-1.5 py-0.5 capitalize transition-colors ${T==="all"&&!s||s===T?"bg-primary/10 text-primary":"text-foreground-subtle hover:bg-surface-hover"} ${T!=="all"?"border-l border-border":""}`,children:T},T))}),h.jsxs("button",{type:"button",onClick:()=>{y(T=>!T),!p&&b.current&&b.current.scrollTo({top:0,behavior:"smooth"})},className:`inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded border transition-colors ${p?"border-border text-foreground-subtle hover:text-foreground":"border-amber-500/30 bg-amber-500/10 text-amber-400"}`,title:p?"Auto-scroll to newest is ON":"Auto-scroll to newest is OFF — click to re-enable",children:[h.jsx(HE,{className:"h-2.5 w-2.5"}),p?"Auto-scroll top":"Auto-scroll off"]}),d.length>0&&h.jsxs("span",{className:"text-[9px] text-emerald-400 font-medium",children:["+",d.length," live"]})]}),h.jsx("button",{type:"button",onClick:e,className:"text-foreground-subtle hover:text-foreground",children:h.jsx(bl,{className:"h-3.5 w-3.5"})})]}),h.jsxs("div",{ref:b,className:"max-h-64 overflow-auto font-mono text-[10px]",children:[_&&h.jsxs("div",{className:"flex items-center justify-center gap-2 py-6 text-foreground-subtle",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),"Loading logs..."]}),!_&&C.length===0&&h.jsx("div",{className:"py-4 text-center text-foreground-subtle",children:"No logs found"}),C.length>0&&h.jsx("table",{className:"w-full",children:h.jsx("tbody",{children:C.map((T,R)=>{const O=t4[T.level]??t4.info,M=O.icon;return h.jsxs("tr",{className:"hover:bg-surface-hover/30 border-b border-border/30",children:[h.jsx("td",{className:"px-2 py-1 text-foreground-subtle whitespace-nowrap align-top w-[140px]",children:new Date(T.timestamp).toLocaleTimeString()}),h.jsx("td",{className:`px-1 py-1 align-top w-5 ${O.color}`,children:h.jsx(M,{className:"h-3 w-3"})}),h.jsx("td",{className:"px-2 py-1 text-foreground break-all",children:T.message})]},R)})})})]})]})}function DU({isBundle:t,installSource:e}){const n=t?"bg-indigo-500/20 text-indigo-300":"bg-purple-500/20 text-purple-300";return h.jsxs("div",{className:"relative flex-shrink-0",children:[h.jsx("div",{className:`h-9 w-9 rounded-lg flex items-center justify-center ${n}`,children:t?h.jsx(Mm,{className:"h-4 w-4"}):h.jsx(w1,{className:"h-4 w-4"})}),e==="workspace"&&h.jsx("span",{className:"absolute -top-1.5 -left-1.5 text-[7px] font-bold leading-none bg-orange-500 text-white px-1 py-0.5 rounded -rotate-12 shadow-sm",children:"DEV"}),e==="npm"&&h.jsx("span",{className:"absolute -top-1 -left-1 w-4 h-4 rounded bg-[#cb3837] flex items-center justify-center -rotate-12 shadow-sm",children:h.jsx("svg",{viewBox:"0 0 780 250",className:"w-[11px] h-[11px]",children:h.jsx("path",{fill:"#fff",d:"M240 250h100V50h100v200h340V0H0v250z"})})}),e==="upload"&&h.jsx("span",{className:"absolute -top-1.5 -left-1.5 flex items-center justify-center h-4 w-4 rounded bg-cyan-500 -rotate-12 shadow-sm",children:h.jsx(L6,{className:"h-2.5 w-2.5 text-white"})})]})}function zU({addonId:t}){const e=Ft(),n=ga(),{data:s="inherit"}=ot({queryKey:["addon-auto-update",t],queryFn:()=>e.trpc.addons.getAddonAutoUpdate.query({addonId:t}),staleTime:3e4}),i=Cn({mutationFn:o=>e.trpc.addons.setAddonAutoUpdate.mutate({addonId:t,channel:o}),onSuccess:()=>{n.invalidateQueries({queryKey:["addon-auto-update",t]})}});return h.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-[10px] font-medium",children:["inherit","off","latest","beta"].map(o=>h.jsx("button",{type:"button",onClick:d=>{d.stopPropagation(),i.mutate(o)},disabled:i.isPending,className:`px-2.5 py-1 transition-colors capitalize ${s===o?o==="inherit"?"bg-gray-700/50 text-gray-300":o==="off"?"bg-gray-700 text-gray-200":o==="latest"?"bg-blue-500/20 text-blue-400":"bg-amber-500/20 text-amber-400":"bg-transparent text-foreground-subtle hover:bg-surface-hover"} ${o!=="inherit"?"border-l border-border":""}`,children:o},o))})}function qb({addon:t,agents:e=[],hideVersion:n,availableUpdate:s,onUpdate:i,isUpdating:o,bundle:d}){var be,_e;const[f,p]=D.useState(!1),[y,b]=D.useState(!1),[v,_]=D.useState(!1),[C,w]=D.useState(!1),T=Ft(),R=ga(),O=TU(),{manifest:M}=t,z=t.installedOn??[],k=!d&&!M.protected&&M.removable!==!1,P=!!d,q=(d==null?void 0:d.displayName)??M.name,L=(d==null?void 0:d.packageName)??M.packageName,U=(d==null?void 0:d.version)??M.packageVersion??M.version,V=(d==null?void 0:d.installSource)??t.installSource,F=d?(be=d.addons[0])==null?void 0:be.manifest.description:M.description,re=!d&&(t.hasConfigSchema||M.components&&M.components.length>0||e.length>=2),{data:ne,isLoading:J}=ot({queryKey:["addon-config-schema",M.id],queryFn:()=>T.trpc.addons.getConfigSchema.query({addonId:M.id}),enabled:!P&&f&&t.hasConfigSchema,staleTime:6e4}),{data:ie}=ot({queryKey:["addon-config",M.id],queryFn:()=>T.trpc.addons.getConfig.query({addonId:M.id}),enabled:!P&&f&&t.hasConfigSchema,staleTime:3e4}),[ce,Y]=D.useState({}),[$,ae]=D.useState(!1);D.useEffect(()=>{ie&&(Y(ie),ae(!1))},[ie]);const je=me=>{Y(me),ae(!0)},he=Cn({mutationFn:()=>T.trpc.addons.updateConfig.mutate({addonId:M.id,config:ce}),onSuccess:()=>{ae(!1),R.invalidateQueries({queryKey:["addon-config",M.id]})}}),G=Cn({mutationFn:()=>(console.log(`[AddonCard] Uninstalling ${M.packageName}`),T.trpc.addons.uninstallPackage.mutate({packageName:M.packageName})),onSuccess:()=>{console.log(`[AddonCard] Uninstalled ${M.packageName}`),R.invalidateQueries({queryKey:["addons"]}),R.invalidateQueries({queryKey:["addon-pages"]}),R.invalidateQueries({queryKey:["capabilities"]})},onError:me=>{console.error("[AddonCard] Uninstall failed:",me)}}),W=Cn({mutationFn:()=>T.trpc.addons.restartAddon.mutate({addonId:M.id}),onSuccess:()=>{R.invalidateQueries({queryKey:["addons"]})}}),fe=Cn({mutationFn:me=>T.trpc.addons.installPackage.mutate({packageName:L,version:me}),onSuccess:()=>{R.invalidateQueries({queryKey:["addons"]}),R.invalidateQueries({queryKey:["addon-pages"]}),R.invalidateQueries({queryKey:["capabilities"]})}});return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"flex items-start gap-3 px-4 py-3",children:[h.jsx(DU,{isBundle:P||!!M.components&&M.components.length>1,installSource:V}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:q}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle font-mono shrink-0",children:["(",L,")"]}),P&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium shrink-0 inline-flex items-center gap-1",children:[h.jsx(Mm,{className:"h-3 w-3"}),d.addons.length]})]}),F&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-1",children:F})]}),!n&&h.jsxs("div",{className:"relative inline-flex items-center shrink-0 pt-0.5",children:[V!=="workspace"?h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),_(we=>!we)},className:["inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-bold font-mono border transition-colors",s?"border-border text-foreground-subtle hover:text-foreground hover:border-primary/30":"border-emerald-500/30 bg-emerald-500/10 text-emerald-400 hover:bg-emerald-500/20"].join(" "),title:"View all versions",children:[U,h.jsx(Mc,{className:"h-3 w-3 opacity-50"})]}):h.jsx("span",{className:"inline-flex items-center rounded-md px-2 py-1 text-[10px] font-bold font-mono border border-emerald-500/30 bg-emerald-500/10 text-emerald-400",children:U}),v&&h.jsx(OU,{packageName:L,currentVersion:U,onInstall:me=>{_(!1),fe.mutate(me)},onClose:()=>_(!1)})]})]}),!P&&!n&&h.jsxs("div",{className:"flex items-center gap-1 px-4 py-1.5 border-t border-border/50 bg-surface-hover/20",children:[h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),W.mutate()},disabled:W.isPending,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-blue-400 hover:border-blue-500/30 hover:bg-blue-500/10 disabled:opacity-50 transition-colors",children:[h.jsx(Am,{className:`h-3 w-3 ${W.isPending?"animate-spin":""}`}),"Restart"]}),h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),w(we=>!we)},className:`inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border transition-colors ${C?"border-primary/30 bg-primary/10 text-primary":"border-border text-foreground-subtle hover:text-foreground hover:border-primary/30 hover:bg-primary/10"}`,children:[h.jsx(Zm,{className:"h-3 w-3"}),"Logs"]}),o?h.jsxs("span",{className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400",children:[h.jsx(uo,{className:"h-3 w-3 animate-spin"}),"Updating..."]}):s&&i?h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),i()},className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-blue-500/30 bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-colors",children:[h.jsx(_1,{className:"h-3 w-3"}),"Update to ",s]}):null,h.jsx("div",{className:"flex-1"}),k&&h.jsxs("button",{type:"button",onClick:async me=>{me.stopPropagation(),await O({title:`Uninstall ${M.name}?`,message:"This will remove the addon package and all its data. This action cannot be undone.",confirmLabel:"Uninstall",variant:"danger"})&&G.mutate()},disabled:G.isPending,className:"inline-flex items-center gap-1 rounded-md px-2 py-1 text-[10px] font-medium border border-border text-foreground-subtle hover:text-red-400 hover:border-red-500/30 hover:bg-red-500/10 disabled:opacity-50 transition-colors",children:[h.jsx(Jm,{className:"h-3 w-3"}),G.isPending?"Removing...":"Uninstall"]}),re&&h.jsx("button",{type:"button",onClick:me=>{me.stopPropagation(),p(we=>!we)},className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:f?h.jsx(N1,{className:"h-3.5 w-3.5"}):h.jsx(Mc,{className:"h-3.5 w-3.5"})})]}),C&&!P&&h.jsx(AU,{addonId:M.id,onClose:()=>w(!1)}),P&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>p(me=>!me),className:"w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors",children:f?h.jsx(N1,{className:"h-3.5 w-3.5 text-foreground-subtle"}):h.jsx(Mc,{className:"h-3.5 w-3.5 text-foreground-subtle"})}),f&&h.jsx("div",{className:"border-t border-border px-3 py-2 space-y-2",children:d.addons.map(me=>h.jsx(qb,{addon:me,agents:e,hideVersion:!0},me.manifest.id))})]}),!P&&f&&h.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-4",children:[t.hasConfigSchema&&h.jsxs("div",{children:[J&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle py-2",children:[h.jsx(uo,{className:"h-3.5 w-3.5 animate-spin"}),"Loading configuration..."]}),ne&&((_e=ne.sections)==null?void 0:_e.some(me=>{var we;return((we=me.fields)==null?void 0:we.length)>0}))&&h.jsxs("div",{className:"space-y-3",children:[h.jsx(ay,{schema:ne,values:ce,onChange:je}),$&&h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),he.mutate()},disabled:he.isPending,className:"flex items-center gap-1.5 rounded-md bg-primary px-3 py-1.5 text-xs text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors",children:[he.isPending?h.jsx(uo,{className:"h-3 w-3 animate-spin"}):h.jsx(z6,{className:"h-3 w-3"}),he.isPending?"Saving...":"Save"]})]}),he.isError&&h.jsxs("div",{className:"text-[10px] text-red-400",children:["Save failed: ",he.error instanceof Error?he.error.message:"Unknown error"]})]})]}),V!=="workspace"&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:"Auto-Update"}),h.jsx(zU,{addonId:M.id})]}),M.components&&M.components.length>0&&h.jsxs("div",{children:[h.jsxs("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:["Components (",M.components.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1",children:M.components.map(me=>h.jsx("span",{className:"text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono",children:me},me))})]}),e.length>=2&&h.jsxs("div",{children:[h.jsx("div",{className:"text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-2",children:"Installed on"}),h.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[z.length===0&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Hub (local)"}),z.map(me=>h.jsx("span",{className:"rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle",children:me},me)),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:me=>{me.stopPropagation(),b(we=>!we)},className:"inline-flex items-center gap-1 rounded-full border border-dashed border-border px-2 py-0.5 text-[10px] text-foreground-subtle hover:text-foreground hover:border-primary transition-colors",title:"Install on more agents",children:[h.jsx(po,{className:"h-3 w-3"}),"Add agent"]}),y&&h.jsxs("div",{className:"absolute left-0 top-full mt-1 z-10 min-w-[160px] rounded-md border border-border bg-surface shadow-lg overflow-hidden",children:[e.filter(me=>!me.isHub&&!z.includes(me.name)).map(me=>h.jsx("button",{type:"button",onClick:we=>{we.stopPropagation(),b(!1)},className:"w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors",children:me.name},me.id)),e.filter(me=>!me.isHub&&!z.includes(me.name)).length===0&&h.jsx("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle",children:"No available agents"})]})]})]})]})]})]})}const kU=".tgz,.tar.gz,.zip";function LU({onUploadSuccess:t}){const[e,n]=D.useState(!1),s=D.useRef(null),i=D.useCallback(async d=>{n(!0);const f=new FormData;f.append("file",d);const p=localStorage.getItem("camstack_admin_token")??"";try{(await(await fetch("/api/addons/upload",{method:"POST",headers:{Authorization:`Bearer ${p}`},body:f})).json()).success&&t()}finally{n(!1)}},[t]),o=D.useCallback(d=>{var p;const f=(p=d.target.files)==null?void 0:p[0];f&&i(f),d.target.value=""},[i]);return h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:s,type:"file",accept:kU,onChange:o,className:"hidden"}),h.jsxs("button",{type:"button",onClick:()=>{var d;return(d=s.current)==null?void 0:d.click()},disabled:e,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[e?h.jsx(uo,{className:"w-3.5 h-3.5 animate-spin"}):h.jsx(L6,{className:"w-3.5 h-3.5"}),e?"Uploading...":"Upload"]})]})}function UU(t){return t!=null&&t.manifest?{manifest:{...t.manifest,capabilities:t.manifest.capabilities??[]},enabled:!0,hasConfigSchema:t.hasConfigSchema??!1,source:t.source,installSource:t.installSource,installedOn:[]}:null}function qU(t){const e=new Map,n=[];for(const i of t){const o=i.manifest.packageName;if(!o){n.push(i);continue}const d=e.get(o);d?d.addons.push(i):e.set(o,{packageName:o,displayName:i.manifest.packageDisplayName??i.manifest.name,version:i.manifest.packageVersion,installSource:i.installSource,addons:[i]})}const s=[];for(const i of e.values())i.addons.length>=2?s.push({bundle:i,representative:i.addons[0]}):s.push(i.addons[0]);return s.push(...n),s}function HU(t){return"bundle"in t}function BU({addons:t,agents:e,onRefresh:n,isRefreshing:s}){const i=Ft(),o=ga(),[d,f]=D.useState(""),p=D.useDeferredValue(d),[y,b]=D.useState(!1),{data:v}=ot({queryKey:["updates"],queryFn:()=>i.trpc.addons.listUpdates.query(),staleTime:5*6e4}),_=D.useMemo(()=>{const L=new Map;for(const U of v??[])L.set(U.name,U.latestVersion);return L},[v]),[C,w]=D.useState(null),T=Cn({mutationFn:({name:L,version:U})=>(w(L),i.trpc.addons.updatePackage.mutate({name:L,version:U})),onSuccess:()=>{w(null),o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["updates"]})},onError:()=>{w(null)}}),{data:R}=ot({queryKey:["auto-update-settings"],queryFn:()=>i.trpc.addons.getAutoUpdateSettings.query(),staleTime:3e4}),O=Cn({mutationFn:L=>i.trpc.addons.applyAutoUpdateToAll.mutate({channel:L}),onSuccess:()=>{o.invalidateQueries({queryKey:["auto-update-settings"]})}}),{data:M,isFetching:z}=ot({queryKey:["addon-search",p],queryFn:()=>i.trpc.addons.searchAvailable.query({query:p||void 0}),enabled:y,staleTime:6e4}),k=Cn({mutationFn:async()=>{const L=v??[];for(const U of L)await i.trpc.addons.updatePackage.mutate({name:U.name,version:U.latestVersion})},onSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["updates"]})}}),P=Cn({mutationFn:L=>i.trpc.addons.installPackage.mutate({packageName:L}),onSuccess:(L,U)=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["addon-search"]}),o.invalidateQueries({queryKey:["addon-pages"]}),o.invalidateQueries({queryKey:["capabilities"]}),console.log(`[Addons] Installed ${U}`)},onError:(L,U)=>{console.error(`[Addons] Install failed for ${U}:`,L)}}),q=qU(t);return h.jsxs("div",{className:"space-y-6",children:[h.jsxs("div",{className:"flex items-center justify-between rounded-lg border border-border bg-surface px-4 py-2.5",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(Am,{className:"h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Auto-Update"})]}),h.jsx("div",{className:"flex rounded-lg border border-border overflow-hidden text-[10px] font-medium",children:["off","latest","beta"].map(L=>h.jsx("button",{type:"button",onClick:()=>O.mutate(L),disabled:O.isPending,className:`px-3 py-1.5 transition-colors capitalize ${(R==null?void 0:R.channel)===L?L==="off"?"bg-gray-700 text-gray-200":L==="latest"?"bg-blue-500/20 text-blue-400":"bg-amber-500/20 text-amber-400":"bg-transparent text-foreground-subtle hover:bg-surface-hover"} ${L!=="off"?"border-l border-border":""}`,children:L},L))})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(hv,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle"}),h.jsx("input",{type:"text",value:d,onChange:L=>{f(L.target.value),b(!0)},onFocus:()=>b(!0),onBlur:()=>{setTimeout(()=>b(!1),200)},placeholder:"Search addons on npm...",className:"w-full rounded-md border border-border bg-background pl-9 pr-3 py-2 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"}),z&&h.jsx(uo,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle animate-spin"}),y&&M&&M.length>0&&h.jsxs("div",{className:"absolute left-0 right-0 top-full mt-1 z-40 rounded-lg border border-border bg-surface shadow-xl overflow-hidden",children:[h.jsxs("div",{className:"px-3 py-1.5 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border",children:["npm results (",M.length,")"]}),h.jsx("div",{className:"max-h-72 overflow-auto divide-y divide-border",children:M.map(L=>h.jsxs("div",{className:"flex items-center gap-3 px-3 py-2 hover:bg-surface-hover transition-colors",children:[h.jsx("div",{className:"w-6 h-6 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[9px] font-bold shrink-0",children:L.name.replace("@camstack/addon-","").charAt(0).toUpperCase()}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("span",{className:"text-[11px] font-semibold truncate",children:L.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:["v",L.version]})]}),L.description&&h.jsx("div",{className:"text-[10px] text-foreground-subtle truncate",children:L.description})]}),L.installed?h.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md border border-emerald-500/30 bg-emerald-500/10 text-emerald-400 shrink-0",children:[h.jsx(Fm,{className:"h-3 w-3"}),L.installedVersion??"Installed"]}):h.jsxs("button",{type:"button",onClick:()=>P.mutate(L.name),disabled:P.isPending,className:"inline-flex items-center gap-1 px-2 py-1 text-[10px] font-medium rounded-md bg-primary text-primary-foreground hover:bg-primary/90 disabled:opacity-50 transition-colors shrink-0",children:[P.isPending?h.jsx(uo,{className:"h-3 w-3 animate-spin"}):h.jsx(_1,{className:"h-3 w-3"}),"Install"]})]},L.name))})]})]}),h.jsx(LU,{onUploadSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),n()}}),((v==null?void 0:v.length)??0)>0&&h.jsxs("button",{type:"button",onClick:()=>k.mutate(),disabled:k.isPending,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 border border-blue-500/30 disabled:opacity-50 transition-colors font-medium",children:[h.jsx(_1,{className:`w-3.5 h-3.5 ${k.isPending?"animate-bounce":""}`}),"Update All (",v.length,")"]}),h.jsxs("button",{type:"button",onClick:n,disabled:s,className:"flex items-center gap-1.5 px-3 py-1.5 text-xs rounded-md bg-surface hover:bg-surface-hover border border-border disabled:opacity-50 transition-colors",children:[h.jsx(Am,{className:`w-3.5 h-3.5 ${s?"animate-spin":""}`}),"Refresh"]})]}),t.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No addons installed"}),h.jsx("div",{className:"space-y-2",children:q.map(L=>{if(HU(L)){const F=L.bundle.packageName,re=_.get(F);return h.jsx(qb,{addon:L.representative,agents:e,bundle:L.bundle,availableUpdate:re,isUpdating:C===F,onUpdate:re?()=>T.mutate({name:F,version:re}):void 0},F)}const U=L.manifest.packageName,V=_.get(U);return h.jsx(qb,{addon:L,agents:e,availableUpdate:V,isUpdating:C===U,onUpdate:V?()=>T.mutate({name:L.manifest.packageName,version:V}):void 0},L.manifest.id)})})]})}function GU(){const t=Ft(),e=ga(),{data:n,isLoading:s,isError:i}=ot({queryKey:["addons","list"],queryFn:()=>t.listAddons()}),{data:o=[]}=ot({queryKey:["agents","list"],queryFn:()=>t.listAgents(),staleTime:3e4}),d=D.useMemo(()=>o.map(y=>({id:y.info.id,name:y.info.name??y.info.id,isHub:y.isHub})),[o]),f=Cn({mutationFn:async()=>{await t.trpc.addons.forceRefresh.mutate(),await t.trpc.addons.reloadPackages.mutate()},onSuccess:()=>{e.invalidateQueries({queryKey:["addons"]}),e.invalidateQueries({queryKey:["updates"]})}}),p=(n??[]).map(UU).filter(y=>y!==null);return h.jsxs("div",{className:"p-6 space-y-5",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Addons"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Manage installed addons and explore capability providers."})]}),!s&&!i&&h.jsxs("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:[p.length," installed"]})]}),s&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading…"}),i&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load addons"}),!s&&!i&&h.jsx(BU,{addons:p,agents:d,onRefresh:()=>f.mutate(),isRefreshing:f.isPending})]})}function Hb(t){return t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}function PU(t){const e=Math.floor((Date.now()-t)/1e3);if(e<60)return`${e}s`;if(e<3600)return`${Math.floor(e/60)}m`;const n=Math.floor(e/3600),s=Math.floor(e%3600/60);return`${n}h ${s}m`}function YU(t){if(t<60)return`${t}s`;if(t<3600)return`${Math.floor(t/60)}m ${t%60}s`;const e=Math.floor(t/3600),n=Math.floor(t%3600/60);return`${e}h ${n}m`}function VU(t){return new Date(t).toLocaleString("en-GB",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!1})}function QU(t){switch(t){case"running":return"bg-green-400";case"stopped":return"bg-foreground-subtle";case"crashed":return"bg-red-400";default:return"bg-foreground-subtle"}}function KU({proc:t,isLast:e}){return h.jsxs("div",{className:"flex items-center gap-2 text-[10px] text-foreground-subtle pl-6 py-1",children:[h.jsx("span",{className:"text-foreground-subtle/40 font-mono select-none",children:e?"└──":"├──"}),h.jsx("span",{className:`h-1.5 w-1.5 rounded-full shrink-0 ${QU(t.state)}`}),h.jsx("span",{className:"font-mono text-foreground truncate",children:t.name}),h.jsxs("span",{className:"text-foreground-subtle/60",children:["PID ",t.pid]}),h.jsxs("span",{children:["CPU ",t.cpuPercent.toFixed(1),"%"]}),h.jsx("span",{children:Hb(t.memoryRss/1024/1024)}),t.uptimeSeconds>0&&h.jsxs("span",{className:"text-foreground-subtle/60",children:["up ",YU(t.uptimeSeconds)]})]})}function XU({entry:t,isSelected:e,onSelectAgent:n}){const[s,i]=D.useState(t.isHub);return h.jsxs("div",{className:"border border-border rounded-lg bg-surface overflow-hidden",children:[h.jsxs("button",{type:"button",className:"w-full flex items-start justify-between gap-3 px-4 py-3 hover:bg-primary/5 transition-colors text-left",onClick:()=>i(o=>!o),children:[h.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[s?h.jsx(Mc,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}):h.jsx(Zu,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}),h.jsx("span",{className:`h-2.5 w-2.5 rounded-full shrink-0 ${t.state==="running"?"bg-green-400":"bg-red-400"}`}),h.jsx(E1,{className:"h-4 w-4 shrink-0 text-foreground-subtle"}),h.jsxs("div",{className:"min-w-0",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx("span",{className:"text-sm font-semibold text-foreground truncate",children:t.name}),t.isHub&&h.jsx("span",{className:"rounded-full bg-primary/10 text-primary px-2 py-0.5 text-[10px] font-medium shrink-0",children:"HUB"})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle flex-wrap",children:[t.host&&h.jsx("span",{className:"font-mono",children:t.host}),h.jsxs("span",{children:[t.platform,"/",t.arch]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(zf,{className:"h-2.5 w-2.5"}),t.cpuPercent.toFixed(0),"%"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(mm,{className:"h-2.5 w-2.5"}),t.memoryPercent.toFixed(0),"% (",Hb(t.memoryMB),")"]})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{children:["up ",PU(t.connectedSince)]}),t.subProcesses.length>0&&h.jsxs("span",{className:"rounded-full bg-info/10 text-info px-2 py-0.5 font-medium",children:[t.subProcesses.length," proc",t.subProcesses.length!==1?"s":""]}),n&&h.jsxs("button",{type:"button",onClick:o=>{o.stopPropagation(),n(t.isHub?"Hub":t.name)},className:`inline-flex items-center gap-1 rounded-lg border px-2 py-0.5 text-[10px] font-medium transition-colors ${e?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground hover:bg-primary/5"}`,title:"View logs for this agent",children:[h.jsx(Zm,{className:"h-3 w-3"}),"Logs"]})]})]}),!s&&h.jsxs("div",{className:"px-4 pb-2 space-y-1",children:[h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsx("div",{className:"h-1.5 w-full rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})})]}),s&&h.jsxs("div",{className:"border-t border-border",children:[h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(E1,{className:"h-3 w-3"}),"System Details"]}),h.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-x-4 gap-y-1 text-[10px] text-foreground-subtle",children:[h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(C1,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Platform: ",h.jsx("span",{className:"text-foreground font-medium",children:t.platform})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Arch: ",h.jsx("span",{className:"text-foreground font-medium",children:t.arch})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(mm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Memory: ",h.jsx("span",{className:"text-foreground font-medium",children:Hb(t.memoryMB)})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(zf,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["CPU: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.cpuPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(mm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Mem usage: ",h.jsxs("span",{className:"text-foreground font-medium",children:[t.memoryPercent.toFixed(1),"%"]})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(T6,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Connected: ",h.jsx("span",{className:"text-foreground font-medium",children:VU(t.connectedSince)})]})]})]}),h.jsxs("div",{className:"mt-2 space-y-1",children:[h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"CPU"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-blue-400 transition-all",style:{width:`${Math.min(100,t.cpuPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.cpuPercent.toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 text-[9px] text-foreground-subtle",children:[h.jsx("span",{className:"w-8",children:"MEM"}),h.jsx("div",{className:"flex-1 h-1.5 rounded-full bg-border overflow-hidden",children:h.jsx("div",{className:"h-full rounded-full bg-purple-400 transition-all",style:{width:`${Math.min(100,t.memoryPercent)}%`}})}),h.jsxs("span",{className:"w-8 text-right",children:[t.memoryPercent.toFixed(0),"%"]})]})]})]}),t.installedAddons.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(Mm,{className:"h-3 w-3"}),"Installed Addons (",t.installedAddons.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.installedAddons.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-primary/10 text-primary",children:o},o))})]}),t.capabilities.length>0&&h.jsxs("div",{className:"px-4 py-2 border-b border-border",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(C1,{className:"h-3 w-3"}),"Capabilities (",t.capabilities.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1.5",children:t.capabilities.map(o=>h.jsx("span",{className:"inline-flex rounded-md px-1.5 py-0.5 text-[10px] font-medium bg-green-500/10 text-green-400",children:o},o))})]}),t.subProcesses.length>0&&h.jsxs("div",{className:"px-4 py-2",children:[h.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] font-medium text-foreground-subtle uppercase tracking-wide mb-1.5",children:[h.jsx(X1,{className:"h-3 w-3"}),"Sub-Processes (",t.subProcesses.length,")"]}),t.subProcesses.map((o,d)=>h.jsx(KU,{proc:o,isLast:d===t.subProcesses.length-1},o.pid))]}),t.subProcesses.length===0&&t.installedAddons.length===0&&t.capabilities.length===0&&h.jsx("div",{className:"px-4 py-3 text-[10px] text-foreground-subtle italic",children:"No sub-processes or addons reported"})]})]})}function FU({entries:t,isLoading:e,selectedAgentName:n,onSelectAgent:s}){if(e)return h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading process tree..."});if(t.length===0)return h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No agents connected"});const i=[...t].sort((o,d)=>o.isHub&&!d.isHub?-1:!o.isHub&&d.isHub?1:o.name.localeCompare(d.name));return h.jsx("div",{className:"space-y-2",children:i.map(o=>h.jsx(XU,{entry:o,isSelected:n===o.name,onSelectAgent:s},o.id))})}const n4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function ZU({agentNames:t,addonNames:e,preselectedAgent:n}){const s=Ft(),[i,o]=D.useState("all"),[d,f]=D.useState(n??"all"),[p,y]=D.useState("all"),b=D.useRef(n);D.useEffect(()=>{n!==b.current&&(f(n??"all"),b.current=n)},[n]);const[v,_]=D.useState(!0),C=D.useRef(null),w=D.useMemo(()=>{const q=[];return d!=="all"&&q.push(d),p!=="all"&&q.push(p),q.length>0?q:void 0},[d,p]),{data:T,isLoading:R,isError:O}=ot({queryKey:["agent-logs",i,d,p],queryFn:()=>s.getLogs({...i!=="all"?{level:i}:{},limit:300,...w?{scope:w}:{}}),refetchInterval:3e3}),M=T??[],z=D.useMemo(()=>[...M].reverse(),[M]);D.useEffect(()=>{var q;v&&((q=C.current)==null||q.scrollTo({top:0,behavior:"smooth"}))},[z,v]);const k=D.useCallback(()=>{const q=C.current;if(!q)return;const L=q.scrollTop<40;_(L)},[]);function P(q){return q?new Date(typeof q=="number"?q:String(q)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"--"}return h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[h.jsx(ET,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),h.jsxs("select",{value:d,onChange:q=>f(q.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All agents"}),h.jsx("option",{value:"Hub",children:"Hub"}),t.map(q=>h.jsx("option",{value:q,children:q},q))]}),h.jsxs("select",{value:p,onChange:q=>y(q.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All addons"}),e.map(q=>h.jsx("option",{value:q,children:q},q))]}),h.jsxs("select",{value:i,onChange:q=>o(q.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{type:"button",onClick:()=>{var L;const q=!v;_(q),q&&((L=C.current)==null||L.scrollTo({top:0,behavior:"smooth"}))},className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${v?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[h.jsx(UE,{className:"h-3.5 w-3.5"}),"Auto-scroll: ",v?"ON":"OFF"]})]}),R&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading logs..."}),O&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load logs"}),!R&&!O&&z.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle italic",children:"No logs match the current filters"}),z.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsx("div",{ref:C,onScroll:k,className:"max-h-[400px] overflow-y-auto",children:h.jsxs("table",{className:"w-full text-[10px]",children:[h.jsx("thead",{className:"sticky top-0",children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-24",children:"Time"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-14",children:"Level"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border w-28",children:"Scope"}),h.jsx("th",{className:"text-left px-2.5 py-1.5 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:z.map((q,L)=>{const U=String(q.level??"info").toLowerCase(),V=n4[U]??n4.info,F=String(q.message??q.msg??q.text??""),re=Array.isArray(q.scope)?q.scope.join(" > "):String(q.scope??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-2.5 py-1 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:P(q.timestamp??q.ts??q.time)}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-1.5 py-0.5 text-[9px] font-medium uppercase ${V.badge}`,children:U})}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border text-foreground-subtle font-mono truncate max-w-[180px]",title:re,children:re||"--"}),h.jsx("td",{className:`px-2.5 py-1 border-b border-border font-mono ${V.text} break-all`,children:F})]},L)})})]})})})]})}function IU(t){const e=t.info??t,n=t.status??{};return{id:String(e.id??t.id??""),name:String(e.name??t.name??""),pid:Number(t.pid??0),state:String(t.state??"running"),cpuPercent:Number(n.cpuPercent??t.cpuPercent??0),memoryPercent:Number(n.memoryPercent??t.memoryPercent??0),memoryMB:Number(e.memoryMB??t.memoryMB??0),isHub:!!(t.isHub??!1),platform:String(e.platform??t.platform??""),arch:String(e.arch??t.arch??""),host:String(e.host??t.host??""),capabilities:e.capabilities??t.capabilities??[],installedAddons:e.installedAddons??t.installedAddons??[],pythonRuntimes:e.pythonRuntimes??t.pythonRuntimes??[],connectedSince:Number(t.connectedSince??Date.now()),subProcesses:JU(t.subProcesses)}}function JU(t){return Array.isArray(t)?t.map(e=>({pid:Number(e.pid??0),name:String(e.name??""),command:String(e.command??""),state:e.state??"running",cpuPercent:Number(e.cpuPercent??0),memoryRss:Number(e.memoryRss??0),uptimeSeconds:Number(e.uptimeSeconds??0)})):[]}function u1({icon:t,label:e,value:n,color:s}){return h.jsxs("div",{className:"rounded-xl border border-border bg-surface px-4 py-3 flex items-center gap-3",children:[h.jsx("div",{className:`flex-shrink-0 h-9 w-9 rounded-lg flex items-center justify-center ${s}`,children:h.jsx(t,{className:"h-4 w-4"})}),h.jsxs("div",{children:[h.jsx("div",{className:"text-xl font-bold text-foreground leading-none",children:n}),h.jsx("div",{className:"text-[10px] text-foreground-subtle mt-0.5",children:e})]})]})}function a4({tab:t,active:e,icon:n,label:s,onClick:i}){return h.jsxs("button",{type:"button",onClick:i,className:`inline-flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-colors ${e?"bg-primary/10 text-primary border border-primary/30":"bg-surface text-foreground-subtle border border-border hover:text-foreground hover:bg-primary/5"}`,children:[h.jsx(n,{className:"h-3.5 w-3.5"}),s]})}function WU(){const t=Ft(),e=ga(),[n,s]=D.useState("tree"),[i,o]=D.useState(null),{data:d}=ot({queryKey:["agents","testWorker","status"],queryFn:()=>t.trpc.agents.isTestWorkerRunning.query(),refetchInterval:5e3}),f=(d==null?void 0:d.running)??!1,p=Cn({mutationFn:()=>t.trpc.agents.startTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),y=Cn({mutationFn:()=>t.trpc.agents.stopTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),{data:b=[],isLoading:v}=ot({queryKey:["agent","processTree"],queryFn:()=>t.trpc.agent.processTree.query(),refetchInterval:5e3}),{data:_=[]}=ot({queryKey:["agents","list"],queryFn:()=>t.listAgents(),refetchInterval:5e3}),C=D.useMemo(()=>b.map(IU),[b]),w=C.length,T=C.reduce((z,k)=>z+k.subProcesses.length,0),R=C.reduce((z,k)=>z+k.installedAddons.length,0),O=D.useMemo(()=>C.filter(z=>!z.isHub).map(z=>z.name),[C]),M=D.useMemo(()=>{const z=new Set;for(const k of C)for(const P of k.installedAddons)z.add(P);return[...z].sort()},[C]);return h.jsxs("div",{className:"p-6 space-y-6",children:[h.jsxs("div",{className:"flex items-start justify-between gap-4",children:[h.jsxs("div",{children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Agents & Process Tree"}),h.jsx("p",{className:"text-xs text-foreground-subtle mt-0.5",children:"Distributed processing agents, sub-processes, and system logs."})]}),h.jsx("div",{className:"shrink-0",children:f?h.jsxs("button",{type:"button",onClick:()=>y.mutate(),disabled:y.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-danger/30 bg-danger/10 text-danger px-3 py-1.5 text-xs font-medium hover:bg-danger/20 transition-colors disabled:opacity-50",children:[h.jsx(k6,{className:"h-3.5 w-3.5"}),y.isPending?"Stopping...":"Stop Test Agent"]}):h.jsxs("button",{type:"button",onClick:()=>p.mutate(),disabled:p.isPending,className:"inline-flex items-center gap-1.5 rounded-lg border border-border bg-surface text-foreground-subtle px-3 py-1.5 text-xs font-medium hover:text-foreground hover:bg-primary/5 transition-colors disabled:opacity-50",children:[h.jsx(CT,{className:"h-3.5 w-3.5"}),p.isPending?"Starting...":"Start Test Agent"]})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-3",children:[h.jsx(u1,{icon:bb,label:"Agents online",value:w,color:"bg-green-500/10 text-green-400"}),h.jsx(u1,{icon:zf,label:"Sub-processes",value:T,color:"bg-blue-500/10 text-blue-400"}),h.jsx(u1,{icon:YT,label:"Installed addons",value:R,color:"bg-purple-500/10 text-purple-400"}),h.jsx(u1,{icon:bb,label:"Capabilities",value:[...new Set(C.flatMap(z=>z.capabilities))].length,color:"bg-cyan-500/10 text-cyan-400"})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx(a4,{tab:"tree",active:n==="tree",icon:TR,label:"Process Tree",onClick:()=>s("tree")}),h.jsx(a4,{tab:"logs",active:n==="logs",icon:Zm,label:"Logs",onClick:()=>s("logs")})]}),n==="tree"&&h.jsxs(h.Fragment,{children:[w===0&&!v&&h.jsxs("div",{className:"flex flex-col items-center justify-center rounded-xl border border-border bg-surface py-12 text-foreground-subtle",children:[h.jsx(qR,{className:"h-8 w-8 mb-2 opacity-40"}),h.jsx("div",{className:"text-sm",children:"No agents connected"}),h.jsxs("div",{className:"text-xs mt-1 opacity-70",children:["Run"," ",h.jsx("code",{className:"font-mono bg-border px-1 rounded",children:"camstack --agent --hub wss://<host>:4443"})," ","to connect one."]})]}),h.jsx(FU,{entries:C,isLoading:v,selectedAgentName:i,onSelectAgent:z=>{o(z),s("logs")}})]}),n==="logs"&&h.jsxs(h.Fragment,{children:[i&&h.jsxs("div",{className:"flex items-center gap-2 text-xs",children:[h.jsx("span",{className:"text-foreground-subtle",children:"Filtered to agent:"}),h.jsx("span",{className:"font-semibold text-foreground",children:i}),h.jsxs("button",{type:"button",onClick:()=>o(null),className:"inline-flex items-center gap-1 rounded-lg border border-border bg-surface px-2 py-1 text-xs text-foreground-subtle hover:text-foreground hover:bg-primary/5 transition-colors",children:[h.jsx(bl,{className:"h-3 w-3"}),"Clear selection"]})]}),h.jsx(ZU,{agentNames:O,addonNames:M,preselectedAgent:i??void 0})]})]})}const s4={debug:{badge:"bg-foreground-subtle/10 text-foreground-subtle",text:"text-foreground-subtle"},info:{badge:"bg-info/10 text-info",text:"text-info"},warn:{badge:"bg-warning/10 text-warning",text:"text-warning"},error:{badge:"bg-danger/10 text-danger",text:"text-danger"}};function $U(){const t=Ft(),[e,n]=D.useState("all"),[s,i]=D.useState(!1),o=D.useRef(null),{data:d,isLoading:f,isError:p}=ot({queryKey:["logs",e],queryFn:()=>t.getLogs(e!=="all"?{level:e,limit:500}:{limit:500}),refetchInterval:s?!1:3e3}),y=d??[],b=D.useMemo(()=>[...y].reverse(),[y]);D.useEffect(()=>{var _;s||(_=o.current)==null||_.scrollIntoView({behavior:"smooth"})},[b,s]);function v(_){return _?new Date(typeof _=="number"?_:String(_)).toLocaleTimeString("en-GB",{hour12:!1,hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3}):"—"}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Logs"}),h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsxs("select",{value:e,onChange:_=>n(_.target.value),className:"rounded-lg border border-border bg-surface text-xs text-foreground px-2 py-1.5 focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"all",children:"All levels"}),h.jsx("option",{value:"debug",children:"Debug"}),h.jsx("option",{value:"info",children:"Info"}),h.jsx("option",{value:"warn",children:"Warn"}),h.jsx("option",{value:"error",children:"Error"})]}),h.jsxs("button",{onClick:()=>i(_=>!_),className:`inline-flex items-center gap-1.5 rounded-lg border px-2.5 py-1.5 text-xs font-medium transition-colors ${s?"border-primary/30 bg-primary/10 text-primary hover:bg-primary/20":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[s?h.jsx(dv,{className:"h-3.5 w-3.5"}):h.jsx(aR,{className:"h-3.5 w-3.5"}),s?"Resume":"Pause"]})]})]}),f&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),p&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!f&&!p&&b.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),b.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("div",{className:"max-h-[calc(100vh-220px)] overflow-y-auto",children:[h.jsx("div",{ref:o}),h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{className:"sticky top-0",children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border w-36",children:"Time"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border w-16",children:"Level"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Message"})]})}),h.jsx("tbody",{children:b.map((_,C)=>{const w=String(_.level??"info").toLowerCase(),T=s4[w]??s4.info,R=String(_.message??_.msg??_.text??"");return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-1.5 text-foreground-subtle border-b border-border font-mono whitespace-nowrap",children:v(_.timestamp??_.ts??_.time)}),h.jsx("td",{className:"px-3 py-1.5 border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium uppercase ${T.badge}`,children:w})}),h.jsx("td",{className:`px-3 py-1.5 border-b border-border font-mono ${T.text} break-all`,children:R})]},C)})})]})]})})]})}const r4={super_admin:"bg-danger/10 text-danger",admin:"bg-primary/10 text-primary",viewer:"bg-foreground-subtle/10 text-foreground-subtle"};function eq(){const t=Ft(),e=ga(),[n,s]=D.useState(!1),[i,o]=D.useState(""),[d,f]=D.useState(""),[p,y]=D.useState("viewer"),[b,v]=D.useState(null),{data:_,isLoading:C,isError:w}=ot({queryKey:["users"],queryFn:()=>t.listUsers()}),T=Cn({mutationFn:()=>t.createUser(i,d,p),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),s(!1),o(""),f(""),y("viewer"),v(null)},onError:M=>{v(M instanceof Error?M.message:"Failed to create user")}}),R=_??[];function O(M){return M?new Date(typeof M=="number"?M:String(M)).toLocaleDateString("en-GB",{day:"2-digit",month:"short",year:"numeric"}):"—"}return h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Users"}),h.jsxs("button",{onClick:()=>s(!0),className:"inline-flex items-center gap-1.5 rounded-lg bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground shadow-sm hover:bg-primary/90",children:[h.jsx(po,{className:"h-3.5 w-3.5"}),"Create User"]})]}),n&&h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4 space-y-3",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"New User"}),h.jsx("button",{onClick:()=>s(!1),className:"text-foreground-subtle hover:text-foreground",children:h.jsx(bl,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Username"}),h.jsx("input",{type:"text",value:i,onChange:M=>o(M.target.value),placeholder:"john",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Password"}),h.jsx("input",{type:"password",value:d,onChange:M=>f(M.target.value),placeholder:"••••••••",className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground placeholder:text-foreground-subtle focus:outline-none focus:ring-1 focus:ring-primary"})]}),h.jsxs("div",{className:"space-y-1",children:[h.jsx("label",{className:"text-[10px] text-foreground-subtle uppercase tracking-wide",children:"Role"}),h.jsxs("select",{value:p,onChange:M=>y(M.target.value),className:"w-full rounded border border-border bg-background px-2 py-1.5 text-xs text-foreground focus:outline-none focus:ring-1 focus:ring-primary",children:[h.jsx("option",{value:"viewer",children:"Viewer"}),h.jsx("option",{value:"admin",children:"Admin"}),h.jsx("option",{value:"super_admin",children:"Super Admin"})]})]})]}),b&&h.jsx("p",{className:"text-[10px] text-danger",children:b}),h.jsxs("div",{className:"flex justify-end gap-2",children:[h.jsx("button",{onClick:()=>s(!1),className:"rounded px-3 py-1.5 text-xs text-foreground-subtle border border-border hover:text-foreground",children:"Cancel"}),h.jsx("button",{onClick:()=>T.mutate(),disabled:T.isPending||!i||!d,className:"rounded bg-primary px-3 py-1.5 text-xs font-medium text-primary-foreground hover:bg-primary/90 disabled:opacity-50",children:T.isPending?"Creating...":"Create"})]})]}),C&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),w&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!C&&!w&&R.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),R.length>0&&h.jsx("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:h.jsxs("table",{className:"w-full text-xs",children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Username"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Role"}),h.jsx("th",{className:"text-left px-3 py-2 text-foreground-subtle font-medium bg-surface border-b border-border",children:"Created"})]})}),h.jsx("tbody",{children:R.map(M=>{const z=String(M.role??"viewer"),k=r4[z]??r4.viewer;return h.jsxs("tr",{className:"hover:bg-primary/5",children:[h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:String(M.username??M.name??"")}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border",children:h.jsx("span",{className:`inline-flex rounded-full px-2 py-0.5 text-[10px] font-medium ${k}`,children:z.replace("_"," ")})}),h.jsx("td",{className:"px-3 py-2 text-foreground border-b border-border text-foreground-subtle",children:O(M.createdAt??M.created_at??M.createdAt)})]},String(M.id??M.username))})})]})})]})}function tq({section:t}){var O,M,z;const e=Ft(),n=ga(),[s,i]=D.useState(null),[o,d]=D.useState(!1),[f,p]=D.useState(null),y=ot({queryKey:["settings-schema",t],queryFn:()=>e.getSettingsSchema(t),staleTime:1/0}),b=ot({queryKey:["settings",t],queryFn:()=>e.getSettings(t)}),v=(O=y.data)==null?void 0:O.schema,_=((M=y.data)==null?void 0:M.readOnly)??!1,C=((z=b.data)==null?void 0:z.data)??{},w=s??C,T=s!==null,R=Cn({mutationFn:k=>e.updateSettings(t,k),onSuccess:()=>{d(!0),p(null),i(null),n.invalidateQueries({queryKey:["settings",t]}),setTimeout(()=>d(!1),2e3)},onError:k=>{p(k instanceof Error?k.message:"Failed to save")}});return y.isLoading||b.isLoading?h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse py-4",children:"Loading..."}):y.isError||b.isError?h.jsx("div",{className:"text-xs text-danger py-4",children:"Failed to load settings"}):!v||v.sections.length===0?h.jsx("div",{className:"text-xs text-foreground-subtle py-4",children:"No configurable settings for this section."}):h.jsxs("div",{className:"space-y-4",children:[h.jsx(ay,{schema:v,values:w,onChange:k=>i(k),disabled:_}),!_&&h.jsxs("div",{className:"flex items-center justify-end gap-3",children:[o&&h.jsx("span",{className:"text-xs text-success",children:"Saved successfully"}),f&&h.jsx("span",{className:"text-xs text-danger",children:f}),T&&h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsx("button",{type:"button",onClick:()=>R.mutate(w),disabled:R.isPending||!T,className:"rounded-md bg-primary px-4 py-1.5 text-xs font-medium text-white hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-colors",children:R.isPending?"Saving...":"Save"})]})]})}function nq(){var d;const t=Ft(),e=ot({queryKey:["settings-schema-all"],queryFn:()=>t.getSettingsSchema(),staleTime:1/0}),n=((d=e.data)==null?void 0:d.tabs)??[],[s,i]=D.useState(null),o=s??(n.length>0?n[0].id:null);return e.isLoading?h.jsx("div",{className:"p-6",children:h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading settings..."})}):h.jsxs("div",{className:"p-6 space-y-4",children:[h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("h1",{className:"text-lg font-semibold text-foreground",children:"Settings"}),h.jsx("span",{className:"text-[10px] rounded-full bg-primary/10 text-primary px-2 py-0.5 font-medium",children:"system"})]}),h.jsx("div",{className:"flex gap-1 border-b border-border overflow-x-auto scrollbar-hide",children:n.map(f=>h.jsx("button",{onClick:()=>i(f.id),className:["px-3 py-1.5 text-xs font-medium rounded-t transition-colors whitespace-nowrap",o===f.id?"text-primary border-b-2 border-primary -mb-px bg-surface":"text-foreground-subtle hover:text-foreground"].join(" "),children:f.label},f.id))}),o&&h.jsx(tq,{section:o},o)]})}const aq={streaming:{icon:LR,label:"Stream"},detection:{icon:ch,label:"Detection"},recording:{icon:E6,label:"Recording"},audio:{icon:A6,label:"Audio"}};function sq({capabilities:t}){return h.jsx("div",{className:"flex items-center gap-1",children:t.map(e=>{const n=aq[e];if(!n)return null;const s=n.icon;return h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-surface-hover px-1.5 py-0.5 text-[10px] text-foreground-subtle",title:n.label,children:h.jsx(s,{className:"h-3 w-3"})},e)})})}function to({title:t,children:e}){return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsx("div",{className:"border-b border-border px-4 py-2.5",children:h.jsx("h2",{className:"text-xs font-semibold text-foreground uppercase tracking-wider",children:t})}),h.jsx("div",{className:"p-4",children:e})]})}function lr({name:t,cssVar:e,hex:n}){const s=e?`var(${e})`:n;return h.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[h.jsx("div",{className:"h-10 w-10 rounded-lg border border-border shadow-inner",style:{backgroundColor:s}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle text-center leading-tight",children:t})]})}const rq={sections:[{id:"demo",title:"Demo Fields",columns:2,fields:[{key:"name",type:"text",label:"Name",placeholder:"Enter name"},{key:"count",type:"number",label:"Count",min:0,max:100,unit:"items"},{key:"enabled",type:"boolean",label:"Enabled"},{key:"mode",type:"select",label:"Mode",options:[{value:"a",label:"Alpha"},{value:"b",label:"Beta"}]},{key:"tags",type:"tags",label:"Tags",span:2,suggestions:["camera","zone","alert"]},{key:"confidence",type:"slider",label:"Confidence",min:0,max:100,step:5,unit:"%",span:2},{key:"info",type:"info",label:"Note",content:"This is an informational message for the user.",variant:"info"}]}]};function iq(){const[t,e]=D.useState({name:"Example",count:10,enabled:!0,mode:"a",tags:["camera"],confidence:60});return h.jsxs("div",{className:"p-6 space-y-6 max-w-5xl mx-auto",children:[h.jsxs("div",{className:"mb-6",children:[h.jsx("h1",{className:"text-xl font-bold text-foreground",children:"Component Showroom"}),h.jsx("p",{className:"text-sm text-foreground-subtle mt-1",children:"All UI components at a glance"})]}),h.jsx(to,{title:"Typography",children:h.jsxs("div",{className:"space-y-3",children:[h.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Heading 1 — Display title"}),h.jsx("h2",{className:"text-xl font-semibold text-foreground",children:"Heading 2 — Section title"}),h.jsx("h3",{className:"text-base font-semibold text-foreground",children:"Heading 3 — Card title"}),h.jsx("h4",{className:"text-sm font-semibold text-foreground",children:"Heading 4 — Sub-section"}),h.jsx("p",{className:"text-sm text-foreground",children:"Body text — Regular paragraph content goes here. It uses the foreground color."}),h.jsx("p",{className:"text-sm text-foreground-subtle",children:"Subtle text — Secondary/descriptive text with reduced emphasis."}),h.jsx("p",{className:"text-xs text-foreground-subtle uppercase tracking-wider font-semibold",children:"Label / Caption"}),h.jsx("p",{className:"text-xs text-foreground-disabled",children:"Disabled / placeholder text"})]})}),h.jsx(to,{title:"Colors",children:h.jsxs("div",{className:"flex flex-wrap gap-4",children:[h.jsx(lr,{name:"primary",cssVar:"--color-primary"}),h.jsx(lr,{name:"background",cssVar:"--color-background"}),h.jsx(lr,{name:"surface",cssVar:"--color-surface"}),h.jsx(lr,{name:"foreground",cssVar:"--color-foreground"}),h.jsx(lr,{name:"success",cssVar:"--color-success"}),h.jsx(lr,{name:"warning",cssVar:"--color-warning"}),h.jsx(lr,{name:"danger",cssVar:"--color-danger"}),h.jsx(lr,{name:"info",cssVar:"--color-info"}),h.jsx(lr,{name:"border",cssVar:"--color-border"}),h.jsx("div",{className:"w-px"}),h.jsx(lr,{name:"frigate",hex:"#3b82f6"}),h.jsx(lr,{name:"scrypted",hex:"#a855f7"}),h.jsx(lr,{name:"reolink",hex:"#06b6d4"}),h.jsx(lr,{name:"ha",hex:"#22d3ee"}),h.jsx(lr,{name:"rtsp",hex:"#78716c"})]})}),h.jsx(to,{title:"Buttons",children:h.jsxs("div",{className:"flex flex-wrap gap-3",children:[h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white hover:opacity-90 transition-opacity",children:"Primary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-border bg-surface px-4 py-2 text-sm font-medium text-foreground hover:bg-surface-hover transition-colors",children:"Secondary"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-danger/40 bg-danger/10 px-4 py-2 text-sm font-medium text-danger hover:bg-danger/20 transition-colors",children:"Danger"}),h.jsx("button",{disabled:!0,className:"inline-flex items-center gap-1.5 rounded-md bg-primary px-4 py-2 text-sm font-medium text-white opacity-40 cursor-not-allowed",children:"Disabled"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-warning/40 bg-warning/10 px-4 py-2 text-sm font-medium text-warning hover:bg-warning/20 transition-colors",children:"Warning"}),h.jsx("button",{className:"inline-flex items-center gap-1.5 rounded-md border border-success/40 bg-success/10 px-4 py-2 text-sm font-medium text-success hover:bg-success/20 transition-colors",children:"Success"})]})}),h.jsx(to,{title:"Inputs",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Text input"}),h.jsx("input",{type:"text",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"Type something..."})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Number input"}),h.jsx("input",{type:"number",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"0"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Password input"}),h.jsx("input",{type:"password",className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",placeholder:"••••••••"})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Select"}),h.jsxs("select",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30",children:[h.jsx("option",{children:"Option A"}),h.jsx("option",{children:"Option B"}),h.jsx("option",{children:"Option C"})]})]}),h.jsxs("div",{className:"md:col-span-2",children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Textarea"}),h.jsx("textarea",{className:"w-full rounded-md border border-border bg-background px-3 py-2 text-sm text-foreground outline-none focus:border-primary focus:ring-1 focus:ring-primary/30 resize-y min-h-[60px]",placeholder:"Enter multi-line text...",rows:3})]}),h.jsx("div",{children:h.jsxs("label",{className:"flex items-center gap-2 cursor-pointer select-none",children:[h.jsx("input",{type:"checkbox",className:"h-3.5 w-3.5 rounded border-border accent-primary",defaultChecked:!0}),h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Checkbox (checked)"})]})}),h.jsx("div",{children:h.jsxs("div",{className:"flex items-center justify-between",children:[h.jsx("span",{className:"text-xs font-medium text-foreground",children:"Toggle switch"}),h.jsx(lq,{})]})}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Slider"}),h.jsx("input",{type:"range",className:"w-full h-1 accent-primary cursor-pointer",min:0,max:100,defaultValue:60})]}),h.jsxs("div",{children:[h.jsx("label",{className:"block text-xs font-medium text-foreground mb-1",children:"Tags example"}),h.jsx("div",{className:"flex flex-wrap gap-1.5 rounded-md border border-border bg-background px-2 py-1.5 min-h-[38px]",children:["camera","zone","alert"].map(n=>h.jsx("span",{className:"inline-flex items-center gap-1 rounded-md bg-primary/10 px-1.5 py-0.5 text-xs text-primary",children:n},n))})]})]})}),h.jsx(to,{title:"Badges",children:h.jsxs("div",{className:"space-y-3",children:[h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"StatusBadge"}),h.jsx("div",{className:"flex flex-wrap gap-2",children:["running","stopped","error","online","offline","idle"].map(n=>h.jsx(th,{status:n},n))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"CapabilityBadges"}),h.jsx(sq,{capabilities:["streaming","detection","recording","audio"]})]})]})}),h.jsx(to,{title:"Cards",children:h.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[h.jsxs("div",{className:"rounded-lg bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Surface card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-surface`. Default card background."})]}),h.jsxs("div",{className:"rounded-lg border border-border bg-surface p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Bordered card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `border border-border bg-surface`."})]}),h.jsxs("div",{className:"rounded-lg border border-primary/30 bg-primary/5 p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-primary mb-1",children:"Accent card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Highlighted with primary color."})]}),h.jsxs("div",{className:"rounded-lg bg-background p-4",children:[h.jsx("h3",{className:"text-sm font-semibold text-foreground mb-1",children:"Background card"}),h.jsx("p",{className:"text-xs text-foreground-subtle",children:"Uses `bg-background`. Inset card."})]})]})}),h.jsx(to,{title:"Provider Icons",children:h.jsx("div",{className:"flex flex-wrap gap-4",children:["frigate","scrypted","reolink","homeassistant","rtsp","onvif"].map(n=>h.jsx(ny,{type:n,size:"lg",showLabel:!0},n))})}),h.jsxs(to,{title:"Form Builder Demo",children:[h.jsx(ay,{schema:rq,values:t,onChange:e}),h.jsxs("details",{className:"mt-3",children:[h.jsx("summary",{className:"text-[10px] text-foreground-subtle cursor-pointer hover:text-foreground",children:"View current values"}),h.jsx("pre",{className:"mt-2 rounded-md bg-background p-3 text-[10px] text-foreground-subtle overflow-auto",children:JSON.stringify(t,null,2)})]})]}),h.jsx(to,{title:"Info Boxes",children:h.jsx("div",{className:"space-y-2",children:[{variant:"info",label:"Info",content:"This is an informational message. Use it for tips and hints."},{variant:"warning",label:"Warning",content:"This action may have side effects. Proceed with caution."},{variant:"success",label:"Success",content:"Operation completed successfully. All systems are green."},{variant:"danger",label:"Danger",content:"This operation is irreversible. Data will be permanently deleted."}].map(({variant:n,label:s,content:i})=>{const d={info:{border:"border-info",bg:"bg-info/5",text:"text-info"},warning:{border:"border-warning",bg:"bg-warning/5",text:"text-warning"},success:{border:"border-success",bg:"bg-success/5",text:"text-success"},danger:{border:"border-danger",bg:"bg-danger/5",text:"text-danger"}}[n];return h.jsxs("div",{className:`rounded-md border-l-4 px-3 py-2.5 ${d.border} ${d.bg}`,children:[h.jsx("p",{className:`text-xs font-semibold mb-0.5 ${d.text}`,children:s}),h.jsx("p",{className:"text-xs text-foreground-subtle leading-relaxed",children:i})]},n)})})})]})}function lq(){const[t,e]=D.useState(!0);return h.jsx("button",{type:"button",role:"switch","aria-checked":t,onClick:()=>e(n=>!n),className:["relative inline-flex h-4 w-8 shrink-0 items-center rounded-full transition-colors duration-150 cursor-pointer",t?"bg-primary":"bg-foreground-subtle/30"].join(" "),children:h.jsx("span",{className:["inline-block h-3 w-3 rounded-full bg-white shadow transition-transform duration-150",t?"translate-x-4":"translate-x-0.5"].join(" ")})})}const i4={info:{bg:"bg-blue-500/10",border:"border-blue-500/30",icon:j1},warning:{bg:"bg-orange-500/10",border:"border-orange-500/30",icon:pv},critical:{bg:"bg-red-500/10",border:"border-red-500/30",icon:w6}};function oq({toast:t,onDismiss:e}){const n=i4[t.severity]??i4.info,s=n.icon;return D.useEffect(()=>{const i=t.duration??5e3;if(i<=0)return;const o=setTimeout(()=>e(t.id),i);return()=>clearTimeout(o)},[t.id,t.duration,e]),h.jsxs("div",{className:`flex items-start gap-3 px-4 py-3 rounded-lg border ${n.border} ${n.bg} shadow-lg backdrop-blur-sm animate-in slide-in-from-right-5 fade-in duration-200`,children:[h.jsx(s,{className:"h-4 w-4 shrink-0 mt-0.5 text-foreground-subtle"}),h.jsxs("div",{className:"flex-1 min-w-0",children:[h.jsx("div",{className:"text-xs font-semibold text-foreground",children:t.title}),h.jsx("div",{className:"text-[11px] text-foreground-subtle mt-0.5",children:t.message})]}),h.jsx("button",{type:"button",onClick:()=>e(t.id),className:"shrink-0 p-0.5 rounded hover:bg-surface-hover transition-colors",children:h.jsx(bl,{className:"h-3.5 w-3.5 text-foreground-subtle"})})]})}function cq(){const[t,e]=D.useState([]),n=Ft(),s=D.useCallback(i=>{e(o=>o.filter(d=>d.id!==i))},[]);return D.useEffect(()=>{var o;let i=null;try{const d=(o=n.trpc.toast)==null?void 0:o.onToast.subscribe(void 0,{onData:f=>{const p=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(y=>[...y,{...f,id:p,timestamp:Date.now()}])},onError:f=>{console.warn("[ToastContainer] Subscription error:",f)}});i=()=>d==null?void 0:d.unsubscribe()}catch{}return()=>i==null?void 0:i()},[n]),t.length===0?null:h.jsx("div",{className:"fixed bottom-4 right-4 z-50 flex flex-col gap-2 max-w-sm w-full pointer-events-none",children:t.map(i=>h.jsx("div",{className:"pointer-events-auto",children:h.jsx(oq,{toast:i,onDismiss:s})},i.id))})}const uq=new V4({defaultOptions:{queries:{staleTime:3e4,retry:!1,refetchOnWindowFocus:!1}}});function dq(){return h.jsx(S_,{defaultMode:"dark",children:h.jsx(Q4,{client:uq,children:h.jsx(RU,{children:h.jsxs(RE,{children:[h.jsx(u_,{children:h.jsxs(BN,{children:[h.jsx(La,{path:"/login",element:h.jsx(LO,{})}),h.jsx(La,{path:"/access-denied",element:h.jsx(UO,{})}),h.jsx(La,{path:"/showroom",element:h.jsx(iq,{})}),h.jsxs(La,{element:h.jsx(Au,{children:h.jsx(kO,{})}),children:[h.jsx(La,{index:!0,element:h.jsx(lb,{to:"/dashboard",replace:!0})}),h.jsx(La,{path:"/dashboard",element:h.jsx(lA,{})}),h.jsx(La,{path:"/cameras",element:h.jsx(fA,{})}),h.jsx(La,{path:"/integrations",element:h.jsx(GA,{})}),h.jsx(La,{path:"/integrations/:integrationId",element:h.jsx(XA,{})}),h.jsx(La,{path:"/timeline",element:h.jsx(aD,{})}),h.jsx(La,{path:"/pipeline",element:h.jsx(iD,{})}),h.jsx(La,{path:"/devices/:deviceId",element:h.jsx(EU,{})}),h.jsx(La,{path:"/system/agents",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(WU,{})})}),h.jsx(La,{path:"/system/logs",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx($U,{})})}),h.jsx(La,{path:"/system/users",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(eq,{})})}),h.jsx(La,{path:"/system/settings",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(nq,{})})}),h.jsx(La,{path:"/system/addons",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(GU,{})})}),h.jsx(La,{path:"/addon/:pagePath",element:h.jsx(Au,{requiredRole:"admin",children:h.jsx(AO,{})})})]})]})}),h.jsx(cq,{})]})})})})}const fq={dashboard:"Dashboard",integrations:"Integrations",metrics:"Metrics"},hq={title:"System",addons:"Addons",agents:"Agents",processes:"Processes",logs:"Logs",users:"Users",settings:"Settings",repl:"REPL",models:"Models"},pq={save:"Save",cancel:"Cancel",delete:"Delete",enable:"Enable",disable:"Disable",edit:"Edit",add:"Add",remove:"Remove",confirm:"Confirm",close:"Close",back:"Back",next:"Next",search:"Search",filter:"Filter",reset:"Reset",apply:"Apply",submit:"Submit",loading:"Loading…",error:"Error",success:"Success",warning:"Warning",info:"Info",noData:"No data available",noResults:"No results found",retry:"Retry",refresh:"Refresh",copy:"Copy",copied:"Copied!",yes:"Yes",no:"No"},mq={online:"Online",offline:"Offline",connecting:"Connecting",error:"Error",disabled:"Disabled",enabled:"Enabled",active:"Active",inactive:"Inactive",running:"Running",stopped:"Stopped",pending:"Pending",unknown:"Unknown"},gq={login:"Login",logout:"Logout",username:"Username",password:"Password",signIn:"Sign In",invalidCredentials:"Invalid username or password"},yq={dark:"Dark",light:"Light",system:"System"},xq={select:"Language",en:"English",it:"Italian"},bq={dashboard:{title:"Dashboard",subtitle:"Overview of all devices and their status"},integrations:{title:"Integrations",subtitle:"Manage camera sources and provider connections"},metrics:{title:"Metrics",subtitle:"System performance and usage statistics"},agents:{title:"Agents",subtitle:"Manage distributed processing agents"},addons:{title:"Addons",subtitle:"Extend functionality with addon modules"},settings:{title:"Settings",subtitle:"Configure system-wide preferences"},users:{title:"Users",subtitle:"Manage user accounts and permissions"},logs:{title:"Logs",subtitle:"View system and device logs"}},vq={preview:"Preview",snapshotUnavailable:"Snapshot unavailable",noSnapshot:"No snapshot",lastSnapshot:"Last snapshot:",offline:"Offline",active:"Active",available:"Available",noDevices:"No devices.",addFirstDevice:"Add your first device to get started.",import:"+ Import",noProviders:"No providers available. Install a provider addon.",manage:"Manage",integrationName:"Integration name",integrationNamePlaceholder:"e.g. Garage Server",connectionSuccess:"Connection successful!",errorPrefix:"Error:",back:"Back",testing:"Testing...",testConnection:"Test connection",forward:"Next",searchingDevices:"Searching for devices...",foundDevices:"Found {{count}} devices. Select the ones to import.",noDevicesFound:"No devices found.",skip:"Skip",importSelected:"Import selected",newIntegration:"New Integration",configureIntegration:"Configure Integration",importDevices:"Import Devices",addDevice:"Add device",name:"Name",namePlaceholder:"e.g. Entrance Camera",snapshotUrlOptional:"Snapshot URL (optional)",streamUrls:"Stream URLs",addStream:"Add stream",cancel:"Cancel",saving:"Saving...",save:"Save",saveAndNew:"Save and new",test:"Test",stream:"Stream {{number}}:",devices:"devices",rediscover:"Rediscover",config:"Config",integrationNotFound:"Integration not found.",configComingSoon:"Config coming soon.",providerConfig:"Provider Config"},Sq={nav:fq,system:hq,common:pq,status:mq,auth:gq,theme:yq,language:xq,pages:bq,integrations:vq},Nq={dashboard:"Dashboard",integrations:"Integrazioni",metrics:"Metriche"},_q={title:"Sistema",addons:"Addon",agents:"Agenti",processes:"Processi",logs:"Log",users:"Utenti",settings:"Impostazioni",repl:"REPL",models:"Modelli"},jq={save:"Salva",cancel:"Annulla",delete:"Elimina",enable:"Abilita",disable:"Disabilita",edit:"Modifica",add:"Aggiungi",remove:"Rimuovi",confirm:"Conferma",close:"Chiudi",back:"Indietro",next:"Avanti",search:"Cerca",filter:"Filtra",reset:"Reimposta",apply:"Applica",submit:"Invia",loading:"Caricamento…",error:"Errore",success:"Successo",warning:"Avviso",info:"Info",noData:"Nessun dato disponibile",noResults:"Nessun risultato trovato",retry:"Riprova",refresh:"Aggiorna",copy:"Copia",copied:"Copiato!",yes:"Sì",no:"No"},Cq={online:"Online",offline:"Offline",connecting:"Connessione in corso",error:"Errore",disabled:"Disabilitato",enabled:"Abilitato",active:"Attivo",inactive:"Inattivo",running:"In esecuzione",stopped:"Fermato",pending:"In attesa",unknown:"Sconosciuto"},wq={login:"Accesso",logout:"Esci",username:"Nome utente",password:"Password",signIn:"Accedi",invalidCredentials:"Nome utente o password non validi"},Eq={dark:"Scuro",light:"Chiaro",system:"Sistema"},Tq={select:"Lingua",en:"Inglese",it:"Italiano"},Rq={dashboard:{title:"Dashboard",subtitle:"Panoramica di tutti i dispositivi e il loro stato"},integrations:{title:"Integrazioni",subtitle:"Gestisci le sorgenti video e le connessioni ai provider"},metrics:{title:"Metriche",subtitle:"Statistiche di prestazioni e utilizzo del sistema"},agents:{title:"Agenti",subtitle:"Gestisci gli agenti di elaborazione distribuita"},addons:{title:"Addon",subtitle:"Estendi le funzionalità con moduli addon"},settings:{title:"Impostazioni",subtitle:"Configura le preferenze di sistema"},users:{title:"Utenti",subtitle:"Gestisci gli account utente e i permessi"},logs:{title:"Log",subtitle:"Visualizza i log di sistema e dei dispositivi"}},Oq={preview:"Anteprima",snapshotUnavailable:"Snapshot non disponibile",noSnapshot:"Nessuno snapshot",lastSnapshot:"Ultimo snapshot:",offline:"Offline",active:"Attivi",available:"Disponibili",noDevices:"Nessun dispositivo.",addFirstDevice:"Aggiungi il primo dispositivo per iniziare.",import:"+ Importa",noProviders:"Nessun provider disponibile. Installa un addon provider.",manage:"Gestisci",integrationName:"Nome integrazione",integrationNamePlaceholder:"es. Server Garage",connectionSuccess:"Connessione riuscita!",errorPrefix:"Errore:",back:"Indietro",testing:"Test...",testConnection:"Test connessione",forward:"Avanti",searchingDevices:"Ricerca dispositivi in corso...",foundDevices:"Trovati {{count}} dispositivi. Seleziona quelli da importare.",noDevicesFound:"Nessun dispositivo trovato.",skip:"Salta",importSelected:"Importa selezionati",newIntegration:"Nuova Integrazione",configureIntegration:"Configura Integrazione",importDevices:"Importa Dispositivi",addDevice:"Aggiungi dispositivo",name:"Nome",namePlaceholder:"es. Camera Ingresso",snapshotUrlOptional:"Snapshot URL (opzionale)",streamUrls:"Stream URLs",addStream:"Aggiungi stream",cancel:"Annulla",saving:"Salvataggio...",save:"Salva",saveAndNew:"Salva e nuova",test:"Test",stream:"Stream {{number}}:",devices:"dispositivi",rediscover:"Riscopri",config:"Config",integrationNotFound:"Integrazione non trovata.",configComingSoon:"Config coming soon.",providerConfig:"Provider Config"},Mq={nav:Nq,system:_q,common:jq,status:Cq,auth:wq,theme:Eq,language:Tq,pages:Rq,integrations:Oq},a7="camstack_language",Aq=localStorage.getItem(a7)??"en";vs.use(_O).init({resources:{en:{translation:Sq},it:{translation:Mq}},lng:Aq,fallbackLng:"en",interpolation:{escapeValue:!1}});vs.on("languageChanged",t=>{localStorage.setItem(a7,t)});window.__camstackReact=Y7;window.__camstackReactDOM=K7;window.__camstackReactDOMClient=v4;B9();Yb.createRoot(document.getElementById("root")).render(h.jsx(D.StrictMode,{children:h.jsx(dq,{})}));
|