@camstack/addon-admin-ui 0.1.8 → 0.1.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/assets/index-BbEvgN5F.js +613 -0
- package/dist/assets/index-fcPqrJOJ.css +1 -0
- package/dist/icons/apple-touch-icon.png +0 -0
- package/dist/icons/icon-192.png +0 -0
- package/dist/icons/icon-512.png +0 -0
- package/dist/index.html +11 -4
- package/dist/manifest.webmanifest +27 -0
- package/dist/registerSW.js +1 -0
- package/dist/sw.js +1 -0
- package/dist/vendor/react-dom-client.mjs +4 -0
- package/dist/vendor/react-dom.mjs +7 -0
- package/dist/workbox-b20fbdff.js +1 -0
- package/package.json +3 -2
- package/dist/assets/index-CKL6Q9ld.js +0 -598
- package/dist/assets/index-DPLlWe1U.css +0 -1
|
@@ -1,598 +0,0 @@
|
|
|
1
|
-
var U7=Object.defineProperty;var y2=t=>{throw TypeError(t)};var H7=(t,e,n)=>e in t?U7(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Pp=(t,e,n)=>H7(t,typeof e!="symbol"?e+"":e,n),By=(t,e,n)=>e.has(t)||y2("Cannot "+n);var Q=(t,e,n)=>(By(t,e,"read from private field"),n?n.call(t):e.get(t)),He=(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),Oe=(t,e,n,s)=>(By(t,e,"write to private field"),s?s.call(t,n):e.set(t,n),n),Je=(t,e,n)=>(By(t,e,"access private method"),n);var H0=(t,e,n,s)=>({set _(i){Oe(t,e,i,n)},get _(){return Q(t,e,s)}});function v4(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 qb(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Gy={exports:{}},Yp={};/**
|
|
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 q7(){if(x2)return Yp;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 Yp.Fragment=e,Yp.jsx=n,Yp.jsxs=n,Yp}var b2;function B7(){return b2||(b2=1,Gy.exports=q7()),Gy.exports}var h=B7(),Py={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 G7(){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"),m=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),b=Symbol.for("react.activity"),_=Symbol.iterator;function j(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(){}},R=Object.assign,O={};function T(G,W,he){this.props=G,this.context=W,this.refs=O,this.updater=he||w}T.prototype.isReactComponent={},T.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")},T.prototype.forceUpdate=function(G){this.updater.enqueueForceUpdate(this,G,"forceUpdate")};function A(){}A.prototype=T.prototype;function z(G,W,he){this.props=G,this.context=W,this.refs=O,this.updater=he||w}var k=z.prototype=new A;k.constructor=z,R(k,T.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function H(){}var B={H:null,A:null,T:null,S:null},L=Object.prototype.hasOwnProperty;function V(G,W,he){var re=he.ref;return{$$typeof:t,type:G,key:W,ref:re!==void 0?re:null,props:he}}function Z(G,W){return V(G.type,W,G.props)}function ue(G){return typeof G=="object"&&G!==null&&G.$$typeof===t}function ae(G){var W={"=":"=0",":":"=2"};return"$"+G.replace(/[=:]/g,function(he){return W[he]})}var J=/\/+/g;function le(G,W){return typeof G=="object"&&G!==null&&G.key!=null?ae(""+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(H,H):(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,he,re,Se){var je=typeof G;(je==="undefined"||je==="boolean")&&(G=null);var De=!1;if(G===null)De=!0;else switch(je){case"bigint":case"string":case"number":De=!0;break;case"object":switch(G.$$typeof){case t:case e:De=!0;break;case v:return De=G._init,Y(De(G._payload),W,he,re,Se)}}if(De)return Se=Se(G),De=re===""?"."+le(G,0):re,P(Se)?(he="",De!=null&&(he=De.replace(J,"$&/")+"/"),Y(Se,W,he,"",function(Vt){return Vt})):Se!=null&&(ue(Se)&&(Se=Z(Se,he+(Se.key==null||G&&G.key===Se.key?"":(""+Se.key).replace(J,"$&/")+"/")+De)),W.push(Se)),1;De=0;var nt=re===""?".":re+":";if(P(G))for(var ze=0;ze<G.length;ze++)re=G[ze],je=nt+le(re,ze),De+=Y(re,W,he,je,Se);else if(ze=j(G),typeof ze=="function")for(G=ze.call(G),ze=0;!(re=G.next()).done;)re=re.value,je=nt+le(re,ze++),De+=Y(re,W,he,je,Se);else if(je==="object"){if(typeof G.then=="function")return Y(ce(G),W,he,re,Se);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 De}function $(G,W,he){if(G==null)return G;var re=[],Se=0;return Y(G,re,"","",function(je){return W.call(he,je,Se++)}),re}function ee(G){if(G._status===-1){var W=G._result;W=W(),W.then(function(he){(G._status===0||G._status===-1)&&(G._status=1,G._result=he)},function(he){(G._status===0||G._status===-1)&&(G._status=2,G._result=he)}),G._status===-1&&(G._status=0,G._result=W)}if(G._status===1)return G._result.default;throw G._result}var _e=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)},ge={map:$,forEach:function(G,W,he){$(G,function(){W.apply(this,arguments)},he)},count:function(G){var W=0;return $(G,function(){W++}),W},toArray:function(G){return $(G,function(W){return W})||[]},only:function(G){if(!ue(G))throw Error("React.Children.only expected to receive a single React element child.");return G}};return lt.Activity=b,lt.Children=ge,lt.Component=T,lt.Fragment=n,lt.Profiler=i,lt.PureComponent=z,lt.StrictMode=s,lt.Suspense=m,lt.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=B,lt.__COMPILER_RUNTIME={__proto__:null,c:function(G){return B.H.useMemoCache(G)}},lt.cache=function(G){return function(){return G.apply(null,arguments)}},lt.cacheSignal=function(){return null},lt.cloneElement=function(G,W,he){if(G==null)throw Error("The argument must be a React element, but you passed "+G+".");var re=R({},G.props),Se=G.key;if(W!=null)for(je in W.key!==void 0&&(Se=""+W.key),W)!L.call(W,je)||je==="key"||je==="__self"||je==="__source"||je==="ref"&&W.ref===void 0||(re[je]=W[je]);var je=arguments.length-2;if(je===1)re.children=he;else if(1<je){for(var De=Array(je),nt=0;nt<je;nt++)De[nt]=arguments[nt+2];re.children=De}return V(G.type,Se,re)},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,he){var re,Se={},je=null;if(W!=null)for(re in W.key!==void 0&&(je=""+W.key),W)L.call(W,re)&&re!=="key"&&re!=="__self"&&re!=="__source"&&(Se[re]=W[re]);var De=arguments.length-2;if(De===1)Se.children=he;else if(1<De){for(var nt=Array(De),ze=0;ze<De;ze++)nt[ze]=arguments[ze+2];Se.children=nt}if(G&&G.defaultProps)for(re in De=G.defaultProps,De)Se[re]===void 0&&(Se[re]=De[re]);return V(G,je,Se)},lt.createRef=function(){return{current:null}},lt.forwardRef=function(G){return{$$typeof:f,render:G}},lt.isValidElement=ue,lt.lazy=function(G){return{$$typeof:v,_payload:{_status:-1,_result:G},_init:ee}},lt.memo=function(G,W){return{$$typeof:y,type:G,compare:W===void 0?null:W}},lt.startTransition=function(G){var W=B.T,he={};B.T=he;try{var re=G(),Se=B.S;Se!==null&&Se(he,re),typeof re=="object"&&re!==null&&typeof re.then=="function"&&re.then(H,_e)}catch(je){_e(je)}finally{W!==null&&he.types!==null&&(W.types=he.types),B.T=W}},lt.unstable_useCacheRefresh=function(){return B.H.useCacheRefresh()},lt.use=function(G){return B.H.use(G)},lt.useActionState=function(G,W,he){return B.H.useActionState(G,W,he)},lt.useCallback=function(G,W){return B.H.useCallback(G,W)},lt.useContext=function(G){return B.H.useContext(G)},lt.useDebugValue=function(){},lt.useDeferredValue=function(G,W){return B.H.useDeferredValue(G,W)},lt.useEffect=function(G,W){return B.H.useEffect(G,W)},lt.useEffectEvent=function(G){return B.H.useEffectEvent(G)},lt.useId=function(){return B.H.useId()},lt.useImperativeHandle=function(G,W,he){return B.H.useImperativeHandle(G,W,he)},lt.useInsertionEffect=function(G,W){return B.H.useInsertionEffect(G,W)},lt.useLayoutEffect=function(G,W){return B.H.useLayoutEffect(G,W)},lt.useMemo=function(G,W){return B.H.useMemo(G,W)},lt.useOptimistic=function(G,W){return B.H.useOptimistic(G,W)},lt.useReducer=function(G,W,he){return B.H.useReducer(G,W,he)},lt.useRef=function(G){return B.H.useRef(G)},lt.useState=function(G){return B.H.useState(G)},lt.useSyncExternalStore=function(G,W,he){return B.H.useSyncExternalStore(G,W,he)},lt.useTransition=function(){return B.H.useTransition()},lt.version="19.2.4",lt}var S2;function gl(){return S2||(S2=1,Py.exports=G7()),Py.exports}var D=gl();const $t=qb(D),P7=v4({__proto__:null,default:$t},[D]);var Yy={exports:{}},Vp={},Vy={exports:{}},Qy={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
22
|
-
*
|
|
23
|
-
* This source code is licensed under the MIT license found in the
|
|
24
|
-
* LICENSE file in the root directory of this source tree.
|
|
25
|
-
*/var N2;function Y7(){return N2||(N2=1,(function(t){function e(Y,$){var ee=Y.length;Y.push($);e:for(;0<ee;){var _e=ee-1>>>1,ge=Y[_e];if(0<i(ge,$))Y[_e]=$,Y[ee]=ge,ee=_e;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],ee=Y.pop();if(ee!==$){Y[0]=ee;e:for(var _e=0,ge=Y.length,G=ge>>>1;_e<G;){var W=2*(_e+1)-1,he=Y[W],re=W+1,Se=Y[re];if(0>i(he,ee))re<ge&&0>i(Se,he)?(Y[_e]=Se,Y[re]=ee,_e=re):(Y[_e]=he,Y[W]=ee,_e=W);else if(re<ge&&0>i(Se,ee))Y[_e]=Se,Y[re]=ee,_e=re;else break e}}return $}function i(Y,$){var ee=Y.sortIndex-$.sortIndex;return ee!==0?ee: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 m=[],y=[],v=1,b=null,_=3,j=!1,w=!1,R=!1,O=!1,T=typeof setTimeout=="function"?setTimeout:null,A=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(m,$);else break;$=n(y)}}function P(Y){if(R=!1,k(Y),!w)if(n(m)!==null)w=!0,H||(H=!0,ae());else{var $=n(y);$!==null&&ce(P,$.startTime-Y)}}var H=!1,B=-1,L=5,V=-1;function Z(){return O?!0:!(t.unstable_now()-V<L)}function ue(){if(O=!1,H){var Y=t.unstable_now();V=Y;var $=!0;try{e:{w=!1,R&&(R=!1,A(B),B=-1),j=!0;var ee=_;try{t:{for(k(Y),b=n(m);b!==null&&!(b.expirationTime>Y&&Z());){var _e=b.callback;if(typeof _e=="function"){b.callback=null,_=b.priorityLevel;var ge=_e(b.expirationTime<=Y);if(Y=t.unstable_now(),typeof ge=="function"){b.callback=ge,k(Y),$=!0;break t}b===n(m)&&s(m),k(Y)}else s(m);b=n(m)}if(b!==null)$=!0;else{var G=n(y);G!==null&&ce(P,G.startTime-Y),$=!1}}break e}finally{b=null,_=ee,j=!1}$=void 0}}finally{$?ae():H=!1}}}var ae;if(typeof z=="function")ae=function(){z(ue)};else if(typeof MessageChannel<"u"){var J=new MessageChannel,le=J.port2;J.port1.onmessage=ue,ae=function(){le.postMessage(null)}}else ae=function(){T(ue,0)};function ce(Y,$){B=T(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"):L=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 ee=_;_=$;try{return Y()}finally{_=ee}},t.unstable_requestPaint=function(){O=!0},t.unstable_runWithPriority=function(Y,$){switch(Y){case 1:case 2:case 3:case 4:case 5:break;default:Y=3}var ee=_;_=Y;try{return $()}finally{_=ee}},t.unstable_scheduleCallback=function(Y,$,ee){var _e=t.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?_e+ee:_e):ee=_e,Y){case 1:var ge=-1;break;case 2:ge=250;break;case 5:ge=1073741823;break;case 4:ge=1e4;break;default:ge=5e3}return ge=ee+ge,Y={id:v++,callback:$,priorityLevel:Y,startTime:ee,expirationTime:ge,sortIndex:-1},ee>_e?(Y.sortIndex=ee,e(y,Y),n(m)===null&&Y===n(y)&&(R?(A(B),B=-1):R=!0,ce(P,ee-_e))):(Y.sortIndex=ge,e(m,Y),w||j||(w=!0,H||(H=!0,ae()))),Y},t.unstable_shouldYield=Z,t.unstable_wrapCallback=function(Y){var $=_;return function(){var ee=_;_=$;try{return Y.apply(this,arguments)}finally{_=ee}}}})(Qy)),Qy}var _2;function Bb(){return _2||(_2=1,Vy.exports=Y7()),Vy.exports}var Ky={exports:{}},bs={};/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
30
|
-
*
|
|
31
|
-
* This source code is licensed under the MIT license found in the
|
|
32
|
-
* LICENSE file in the root directory of this source tree.
|
|
33
|
-
*/var C2;function V7(){if(C2)return bs;C2=1;var t=gl();function e(m){var y="https://react.dev/errors/"+m;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)y+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+m+"; 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(m,y,v){var b=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:i,key:b==null?null:""+b,children:m,containerInfo:y,implementation:v}}var d=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function f(m,y){if(m==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return bs.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=s,bs.createPortal=function(m,y){var v=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(m,y,null,v)},bs.flushSync=function(m){var y=d.T,v=s.p;try{if(d.T=null,s.p=2,m)return m()}finally{d.T=y,s.p=v,s.d.f()}},bs.preconnect=function(m,y){typeof m=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,s.d.C(m,y))},bs.prefetchDNS=function(m){typeof m=="string"&&s.d.D(m)},bs.preinit=function(m,y){if(typeof m=="string"&&y&&typeof y.as=="string"){var v=y.as,b=f(v,y.crossOrigin),_=typeof y.integrity=="string"?y.integrity:void 0,j=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;v==="style"?s.d.S(m,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:b,integrity:_,fetchPriority:j}):v==="script"&&s.d.X(m,{crossOrigin:b,integrity:_,fetchPriority:j,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},bs.preinitModule=function(m,y){if(typeof m=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var v=f(y.as,y.crossOrigin);s.d.M(m,{crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&s.d.M(m)},bs.preload=function(m,y){if(typeof m=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var v=y.as,b=f(v,y.crossOrigin);s.d.L(m,v,{crossOrigin:b,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})}},bs.preloadModule=function(m,y){if(typeof m=="string")if(y){var v=f(y.as,y.crossOrigin);s.d.m(m,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:v,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else s.d.m(m)},bs.requestFormReset=function(m){s.d.r(m)},bs.unstable_batchedUpdates=function(m,y){return m(y)},bs.useFormState=function(m,y,v){return d.H.useFormState(m,y,v)},bs.useFormStatus=function(){return d.H.useHostTransitionStatus()},bs.version="19.2.4",bs}var j2;function Gb(){if(j2)return Ky.exports;j2=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}/**
|
|
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 Q7(){if(w2)return Vp;w2=1;var t=Bb(),e=gl(),n=Gb();function s(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}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,c=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,(r.flags&4098)!==0&&(c=r.return),a=r.return;while(a)}return r.tag===3?c: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 m(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 c=a,p=r;;){var S=c.return;if(S===null)break;var N=S.alternate;if(N===null){if(p=S.return,p!==null){c=p;continue}break}if(S.child===N.child){for(N=S.child;N;){if(N===c)return m(S),a;if(N===p)return m(S),r;N=N.sibling}throw Error(s(188))}if(c.return!==p.return)c=S,p=N;else{for(var M=!1,q=S.child;q;){if(q===c){M=!0,c=S,p=N;break}if(q===p){M=!0,p=S,c=N;break}q=q.sibling}if(!M){for(q=N.child;q;){if(q===c){M=!0,c=N,p=S;break}if(q===p){M=!0,p=N,c=S;break}q=q.sibling}if(!M)throw Error(s(189))}}if(c.alternate!==p)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?a:r}function v(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=v(a),r!==null)return r;a=a.sibling}return null}var b=Object.assign,_=Symbol.for("react.element"),j=Symbol.for("react.transitional.element"),w=Symbol.for("react.portal"),R=Symbol.for("react.fragment"),O=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),A=Symbol.for("react.consumer"),z=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),H=Symbol.for("react.suspense_list"),B=Symbol.for("react.memo"),L=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),Z=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function ae(a){return a===null||typeof a!="object"?null:(a=ue&&a[ue]||a["@@iterator"],typeof a=="function"?a:null)}var J=Symbol.for("react.client.reference");function le(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 R:return"Fragment";case T:return"Profiler";case O:return"StrictMode";case P:return"Suspense";case H:return"SuspenseList";case V:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case w:return"Portal";case z:return a.displayName||"Context";case A: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 B:return r=a.displayName||null,r!==null?r:le(a.type)||"Memo";case L:r=a._payload,a=a._init;try{return le(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,ee={pending:!1,data:null,method:null,action:null},_e=[],ge=-1;function G(a){return{current:a}}function W(a){0>ge||(a.current=_e[ge],_e[ge]=null,ge--)}function he(a,r){ge++,_e[ge]=a.current,a.current=r}var re=G(null),Se=G(null),je=G(null),De=G(null);function nt(a,r){switch(he(je,r),he(Se,a),he(re,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(re),he(re,a)}function ze(){W(re),W(Se),W(je)}function Vt(a){a.memoizedState!==null&&he(De,a);var r=re.current,c=Gv(r,a.type);r!==c&&(he(Se,a),he(re,c))}function $e(a){Se.current===a&&(W(re),W(Se)),De.current===a&&(W(De),Hp._currentValue=ee)}var At,qt;function wn(a){if(At===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);At=r&&r[1]||"",qt=-1<c.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+At+a+qt}var Qn=!1;function Gt(a,r){if(!a||Qn)return"";Qn=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(r){var ve=function(){throw Error()};if(Object.defineProperty(ve.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ve,[])}catch(ye){var fe=ye}Reflect.construct(a,[],ve)}else{try{ve.call()}catch(ye){fe=ye}a.call(ve.prototype)}}else{try{throw Error()}catch(ye){fe=ye}(ve=a())&&typeof ve.catch=="function"&&ve.catch(function(){})}}catch(ye){if(ye&&fe&&typeof ye.stack=="string")return[ye.stack,fe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var S=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");S&&S.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var N=p.DetermineComponentFrameRoot(),M=N[0],q=N[1];if(M&&q){var X=M.split(`
|
|
44
|
-
`),oe=q.split(`
|
|
45
|
-
`);for(S=p=0;p<X.length&&!X[p].includes("DetermineComponentFrameRoot");)p++;for(;S<oe.length&&!oe[S].includes("DetermineComponentFrameRoot");)S++;if(p===X.length||S===oe.length)for(p=X.length-1,S=oe.length-1;1<=p&&0<=S&&X[p]!==oe[S];)S--;for(;1<=p&&0<=S;p--,S--)if(X[p]!==oe[S]){if(p!==1||S!==1)do if(p--,S--,0>S||X[p]!==oe[S]){var xe=`
|
|
46
|
-
`+X[p].replace(" at new "," at ");return a.displayName&&xe.includes("<anonymous>")&&(xe=xe.replace("<anonymous>",a.displayName)),xe}while(1<=p&&0<=S);break}}}finally{Qn=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?wn(c):""}function fn(a,r){switch(a.tag){case 26:case 27:case 5:return wn(a.type);case 16:return wn("Lazy");case 13:return a.child!==r&&r!==null?wn("Suspense Fallback"):wn("Suspense");case 19:return wn("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 wn("Activity");default:return""}}function fr(a){try{var r="",c=null;do r+=fn(a,c),c=a,a=a.return;while(a);return r}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var Ft=Object.prototype.hasOwnProperty,Et=t.unstable_scheduleCallback,Un=t.unstable_cancelCallback,hn=t.unstable_shouldYield,Zt=t.unstable_requestPaint,Kn=t.unstable_now,Ns=t.unstable_getCurrentPriorityLevel,hr=t.unstable_ImmediatePriority,Qa=t.unstable_UserBlockingPriority,la=t.unstable_NormalPriority,Ea=t.unstable_LowPriority,is=t.unstable_IdlePriority,pr=t.log,_s=t.unstable_setDisableYieldValue,Bs=null,ea=null;function ls(a){if(typeof pr=="function"&&_s(a),ea&&typeof ea.setStrictMode=="function")try{ea.setStrictMode(Bs,a)}catch{}}var ba=Math.clz32?Math.clz32:Nl,Ta=Math.log,Pu=Math.LN2;function Nl(a){return a>>>=0,a===0?32:31-(Ta(a)/Pu|0)|0}var Cs=256,mr=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,c){var p=a.pendingLanes;if(p===0)return 0;var S=0,N=a.suspendedLanes,M=a.pingedLanes;a=a.warmLanes;var q=p&134217727;return q!==0?(p=q&~N,p!==0?S=mt(p):(M&=q,M!==0?S=mt(M):c||(c=q&~a,c!==0&&(S=mt(c))))):(q=p&~N,q!==0?S=mt(q):M!==0?S=mt(M):c||(c=p&~a,c!==0&&(S=mt(c)))),S===0?0:r!==0&&r!==S&&(r&N)===0&&(N=S&-S,c=r&-r,N>=c||N===32&&(c&4194048)!==0)?r:S}function Mt(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 Xn(a){for(var r=[],c=0;31>c;c++)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,c,p,S,N){var M=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var q=a.entanglements,X=a.expirationTimes,oe=a.hiddenUpdates;for(c=M&~c;0<c;){var xe=31-ba(c),ve=1<<xe;q[xe]=0,X[xe]=-1;var fe=oe[xe];if(fe!==null)for(oe[xe]=null,xe=0;xe<fe.length;xe++){var ye=fe[xe];ye!==null&&(ye.lane&=-536870913)}c&=~ve}p!==0&&oa(a,p,0),N!==0&&S===0&&a.tag!==0&&(a.suspendedLanes|=N&~(M&~r))}function oa(a,r,c){a.pendingLanes|=r,a.suspendedLanes&=~r;var p=31-ba(r);a.entangledLanes|=r,a.entanglements[p]=a.entanglements[p]|1073741824|c&261930}function os(a,r){var c=a.entangledLanes|=r;for(a=a.entanglements;c;){var p=31-ba(c),S=1<<p;S&r|a[p]&r&&(a[p]|=r),c&=~S}}function Gs(a,r){var c=r&-r;return c=(c&42)!==0?1:Ue(c),(c&(a.suspendedLanes|r))!==0?0:c}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:c2(a.type))}function ot(a,r){var c=$.p;try{return $.p=a,r()}finally{$.p=c}}var xt=Math.random().toString(36).slice(2),Fe="__reactFiber$"+xt,ut="__reactProps$"+xt,sn="__reactContainer$"+xt,Tt="__reactEvents$"+xt,pn="__reactListeners$"+xt,Ar="__reactHandles$"+xt,us="__reactResources$"+xt,Ka="__reactMarker$"+xt;function Ps(a){delete a[Fe],delete a[ut],delete a[Tt],delete a[pn],delete a[Ar]}function Pt(a){var r=a[Fe];if(r)return r;for(var c=a.parentNode;c;){if(r=c[sn]||c[Fe]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(a=Fv(a);a!==null;){if(c=a[Fe])return c;a=Fv(a)}return r}a=c,c=a.parentNode}return null}function gr(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 yr(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[us];return r||(r=a[us]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function En(a){a[Ka]=!0}var ws=new Set,dd={};function Di(a,r){Es(a,r),Es(a+"Capture",r)}function Es(a,r){for(dd[a]=r,a=0;a<r.length;a++)ws.add(r[a])}var Ts=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]*$"),Yu={},Tn={};function ph(a){return Ft.call(Tn,a)?!0:Ft.call(Yu,a)?!1:Ts.test(a)?Tn[a]=!0:(Yu[a]=!0,!1)}function bo(a,r,c){if(ph(r))if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var p=r.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+c)}}function Vu(a,r,c){if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+c)}}function Mr(a,r,c,p){if(p===null)a.removeAttribute(c);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(r,c,""+p)}}function Ys(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function fd(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function mh(a,r,c){var p=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var S=p.get,N=p.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return S.call(this)},set:function(M){c=""+M,N.call(this,M)}}),Object.defineProperty(a,r,{enumerable:p.enumerable}),{getValue:function(){return c},setValue:function(M){c=""+M},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function Qu(a){if(!a._valueTracker){var r=fd(a)?"checked":"value";a._valueTracker=mh(a,r,""+a[r])}}function Ha(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var c=r.getValue(),p="";return a&&(p=fd(a)?a.checked?"true":"false":a.value),a=p,a!==c?(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 hd=/[\n"\\]/g;function qa(a){return a.replace(hd,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function vo(a,r,c,p,S,N,M,q){a.name="",M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"?a.type=M:a.removeAttribute("type"),r!=null?M==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Ys(r)):a.value!==""+Ys(r)&&(a.value=""+Ys(r)):M!=="submit"&&M!=="reset"||a.removeAttribute("value"),r!=null?xr(a,M,Ys(r)):c!=null?xr(a,M,Ys(c)):p!=null&&a.removeAttribute("value"),S==null&&N!=null&&(a.defaultChecked=!!N),S!=null&&(a.checked=S&&typeof S!="function"&&typeof S!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?a.name=""+Ys(q):a.removeAttribute("name")}function pd(a,r,c,p,S,N,M,q){if(N!=null&&typeof N!="function"&&typeof N!="symbol"&&typeof N!="boolean"&&(a.type=N),r!=null||c!=null){if(!(N!=="submit"&&N!=="reset"||r!=null)){Qu(a);return}c=c!=null?""+Ys(c):"",r=r!=null?""+Ys(r):c,q||r===a.value||(a.value=r),a.defaultValue=r}p=p??S,p=typeof p!="function"&&typeof p!="symbol"&&!!p,a.checked=q?a.checked:!!p,a.defaultChecked=!!p,M!=null&&typeof M!="function"&&typeof M!="symbol"&&typeof M!="boolean"&&(a.name=M),Qu(a)}function xr(a,r,c){r==="number"&&xn(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function ui(a,r,c,p){if(a=a.options,r){r={};for(var S=0;S<c.length;S++)r["$"+c[S]]=!0;for(c=0;c<a.length;c++)S=r.hasOwnProperty("$"+a[c].value),a[c].selected!==S&&(a[c].selected=S),S&&p&&(a[c].defaultSelected=!0)}else{for(c=""+Ys(c),r=null,S=0;S<a.length;S++){if(a[S].value===c){a[S].selected=!0,p&&(a[S].defaultSelected=!0);return}r!==null||a[S].disabled||(r=a[S])}r!==null&&(r.selected=!0)}}function md(a,r,c){if(r!=null&&(r=""+Ys(r),r!==a.value&&(a.value=r),c==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=c!=null?""+Ys(c):""}function gd(a,r,c,p){if(r==null){if(p!=null){if(c!=null)throw Error(s(92));if(ce(p)){if(1<p.length)throw Error(s(93));p=p[0]}c=p}c==null&&(c=""),r=c}c=Ys(r),a.defaultValue=c,p=a.textContent,p===c&&p!==""&&p!==null&&(a.value=p),Qu(a)}function _l(a,r){if(r){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=r;return}}a.textContent=r}var eg=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 gh(a,r,c){var p=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?p?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":p?a.setProperty(r,c):typeof c!="number"||c===0||eg.has(r)?r==="float"?a.cssFloat=c:a[r]=(""+c).trim():a[r]=c+"px"}function yh(a,r,c){if(r!=null&&typeof r!="object")throw Error(s(62));if(a=a.style,c!=null){for(var p in c)!c.hasOwnProperty(p)||r!=null&&r.hasOwnProperty(p)||(p.indexOf("--")===0?a.setProperty(p,""):p==="float"?a.cssFloat="":a[p]="");for(var S in r)p=r[S],r.hasOwnProperty(S)&&c[S]!==p&&gh(a,S,p)}else for(var N in r)r.hasOwnProperty(N)&&gh(a,N,r[N])}function yd(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 tg=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"]]),xh=/^[\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 Ku(a){return xh.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function ci(){}var xd=null;function bd(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var Cl=null,zi=null;function bh(a){var r=gr(a);if(r&&(a=r.stateNode)){var c=a[ut]||null;e:switch(a=r.stateNode,r.type){case"input":if(vo(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+qa(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var p=c[r];if(p!==a&&p.form===a.form){var S=p[ut]||null;if(!S)throw Error(s(90));vo(p,S.value,S.defaultValue,S.defaultValue,S.checked,S.defaultChecked,S.type,S.name)}}for(r=0;r<c.length;r++)p=c[r],p.form===a.form&&Ha(p)}break e;case"textarea":md(a,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&ui(a,!!c.multiple,r,!1)}}}var vd=!1;function vh(a,r,c){if(vd)return a(r,c);vd=!0;try{var p=a(r);return p}finally{if(vd=!1,(Cl!==null||zi!==null)&&(_r(),Cl&&(r=Cl,a=zi,zi=Cl=null,bh(r),a)))for(r=0;r<a.length;r++)bh(a[r])}}function So(a,r){var c=a.stateNode;if(c===null)return null;var p=c[ut]||null;if(p===null)return null;c=p[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":(p=!p.disabled)||(a=a.type,p=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!p;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(s(231,r,typeof c));return c}var Dr=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sh=!1;if(Dr)try{var No={};Object.defineProperty(No,"passive",{get:function(){Sh=!0}}),window.addEventListener("test",No,No),window.removeEventListener("test",No,No)}catch{Sh=!1}var Rs=null,Sd=null,jl=null;function Xu(){if(jl)return jl;var a,r=Sd,c=r.length,p,S="value"in Rs?Rs.value:Rs.textContent,N=S.length;for(a=0;a<c&&r[a]===S[a];a++);var M=c-a;for(p=1;p<=M&&r[c-p]===S[N-p];p++);return jl=S.slice(a,1<p?1-p:void 0)}function Fu(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 _o(){return!0}function ng(){return!1}function Xa(a){function r(c,p,S,N,M){this._reactName=c,this._targetInst=S,this.type=p,this.nativeEvent=N,this.target=M,this.currentTarget=null;for(var q in a)a.hasOwnProperty(q)&&(c=a[q],this[q]=c?c(N):N[q]);return this.isDefaultPrevented=(N.defaultPrevented!=null?N.defaultPrevented:N.returnValue===!1)?_o:ng,this.isPropagationStopped=ng,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=_o)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=_o)},persist:function(){},isPersistent:_o}),r}var ki={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Zu=Xa(ki),Co=b({},ki,{view:0,detail:0}),ag=Xa(Co),Iu,Nd,jo,wo=b({},Co,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:wd,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"?(Iu=a.screenX-jo.screenX,Nd=a.screenY-jo.screenY):Nd=Iu=0,jo=a),Iu)},movementY:function(a){return"movementY"in a?a.movementY:Nd}}),Nh=Xa(wo),sg=b({},wo,{dataTransfer:0}),rg=Xa(sg),_h=b({},Co,{relatedTarget:0}),_d=Xa(_h),ig=b({},ki,{animationName:0,elapsedTime:0,pseudoElement:0}),iy=Xa(ig),ly=b({},ki,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),lg=Xa(ly),Ju=b({},ki,{data:0}),Cd=Xa(Ju),jd={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},og={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"},ug={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ch(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=ug[a])?!!r[a]:!1}function wd(){return Ch}var cg=b({},Co,{key:function(a){if(a.key){var r=jd[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Fu(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?og[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:wd,charCode:function(a){return a.type==="keypress"?Fu(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Fu(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),wl=Xa(cg),Ed=b({},wo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),jh=Xa(Ed),wh=b({},Co,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:wd}),dg=Xa(wh),fg=b({},ki,{propertyName:0,elapsedTime:0,pseudoElement:0}),oy=Xa(fg),Oa=b({},wo,{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}),hg=Xa(Oa),pg=b({},ki,{newState:0,oldState:0}),mg=Xa(pg),gg=[9,13,27,32],El=Dr&&"CompositionEvent"in window,Eo=null;Dr&&"documentMode"in document&&(Eo=document.documentMode);var Td=Dr&&"TextEvent"in window&&!Eo,Eh=Dr&&(!El||Eo&&8<Eo&&11>=Eo),yg=" ",Wu=!1;function Rd(a,r){switch(a){case"keyup":return gg.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Th(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var Tl=!1;function xg(a,r){switch(a){case"compositionend":return Th(r);case"keypress":return r.which!==32?null:(Wu=!0,yg);case"textInput":return a=r.data,a===yg&&Wu?null:a;default:return null}}function Rh(a,r){if(Tl)return a==="compositionend"||!El&&Rd(a,r)?(a=Xu(),jl=Sd=Rs=null,Tl=!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 Eh&&r.locale!=="ko"?null:r.data;default:return null}}var Oh={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 Ah(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!Oh[a.type]:r==="textarea"}function Od(a,r,c,p){Cl?zi?zi.push(p):zi=[p]:Cl=p,r=_0(r,"onChange"),0<r.length&&(c=new Zu("onChange","change",null,c,p),a.push({event:c,listeners:r}))}var Li=null,Rl=null;function bg(a){zv(a,0)}function To(a){var r=yr(a);if(Ha(r))return a}function Mh(a,r){if(a==="change")return r}var zr=!1;if(Dr){var $u;if(Dr){var Dh="oninput"in document;if(!Dh){var zh=document.createElement("div");zh.setAttribute("oninput","return;"),Dh=typeof zh.oninput=="function"}$u=Dh}else $u=!1;zr=$u&&(!document.documentMode||9<document.documentMode)}function Vs(){Li&&(Li.detachEvent("onpropertychange",ec),Rl=Li=null)}function ec(a){if(a.propertyName==="value"&&To(Rl)){var r=[];Od(r,Rl,a,bd(a)),vh(bg,r)}}function vg(a,r,c){a==="focusin"?(Vs(),Li=r,Rl=c,Li.attachEvent("onpropertychange",ec)):a==="focusout"&&Vs()}function kh(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return To(Rl)}function Sg(a,r){if(a==="click")return To(r)}function Ng(a,r){if(a==="input"||a==="change")return To(r)}function Lh(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Fa=typeof Object.is=="function"?Object.is:Lh;function Ro(a,r){if(Fa(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var c=Object.keys(a),p=Object.keys(r);if(c.length!==p.length)return!1;for(p=0;p<c.length;p++){var S=c[p];if(!Ft.call(r,S)||!Fa(a[S],r[S]))return!1}return!0}function tc(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function Oo(a,r){var c=tc(a);a=0;for(var p;c;){if(c.nodeType===3){if(p=a+c.textContent.length,a<=r&&p>=r)return{node:c,offset:r-a};a=p}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=tc(c)}}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 _g(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 c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)a=r.contentWindow;else break;r=xn(a.document)}return r}function Uh(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 Cg=Dr&&"documentMode"in document&&11>=document.documentMode,kr=null,Lr=null,Ao=null,Ad=!1;function Mo(a,r,c){var p=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ad||kr==null||kr!==xn(p)||(p=kr,"selectionStart"in p&&Uh(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),Ao&&Ro(Ao,p)||(Ao=p,p=_0(Lr,"onSelect"),0<p.length&&(r=new Zu("onSelect","select",null,r,c),a.push({event:r,listeners:p}),r.target=kr)))}function Ba(a,r){var c={};return c[a.toLowerCase()]=r.toLowerCase(),c["Webkit"+a]="webkit"+r,c["Moz"+a]="moz"+r,c}var Ol={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")},nc={},Hh={};Dr&&(Hh=document.createElement("div").style,"AnimationEvent"in window||(delete Ol.animationend.animation,delete Ol.animationiteration.animation,delete Ol.animationstart.animation),"TransitionEvent"in window||delete Ol.transitionend.transition);function di(a){if(nc[a])return nc[a];if(!Ol[a])return a;var r=Ol[a],c;for(c in r)if(r.hasOwnProperty(c)&&c in Hh)return nc[a]=r[c];return a}var Md=di("animationend"),ac=di("animationiteration"),qh=di("animationstart"),jg=di("transitionrun"),uy=di("transitionstart"),wg=di("transitioncancel"),Bh=di("transitionend"),Qs=new Map,sc="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(" ");sc.push("scrollEnd");function Ks(a,r){Qs.set(a,r),Di(r,[a])}var rc=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)},Xs=[],fi=0,va=0;function ic(){for(var a=fi,r=va=fi=0;r<a;){var c=Xs[r];Xs[r++]=null;var p=Xs[r];Xs[r++]=null;var S=Xs[r];Xs[r++]=null;var N=Xs[r];if(Xs[r++]=null,p!==null&&S!==null){var M=p.pending;M===null?S.next=S:(S.next=M.next,M.next=S),p.pending=S}N!==0&&Ui(c,S,N)}}function Sa(a,r,c,p){Xs[fi++]=a,Xs[fi++]=r,Xs[fi++]=c,Xs[fi++]=p,va|=p,a.lanes|=p,a=a.alternate,a!==null&&(a.lanes|=p)}function Dd(a,r,c,p){return Sa(a,r,c,p),Fs(a)}function Za(a,r){return Sa(a,null,null,r),Fs(a)}function Ui(a,r,c){a.lanes|=c;var p=a.alternate;p!==null&&(p.lanes|=c);for(var S=!1,N=a.return;N!==null;)N.childLanes|=c,p=N.alternate,p!==null&&(p.childLanes|=c),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(c),a=N.hiddenUpdates,p=a[S],p===null?a[S]=[r]:p.push(r),r.lane=c|536870912),N):null}function Fs(a){if(50<nl)throw nl=0,Zl=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Hi={};function Gh(a,r,c,p){this.tag=a,this.key=c,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=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(a,r,c,p){return new Gh(a,r,c,p)}function zd(a){return a=a.prototype,!(!a||!a.isReactComponent)}function cs(a,r){var c=a.alternate;return c===null?(c=Rn(a.tag,r,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=r,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,r=a.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function Do(a,r){a.flags&=65011714;var c=a.alternate;return c===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=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,r=c.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function Ur(a,r,c,p,S,N){var M=0;if(p=a,typeof a=="function")zd(a)&&(M=1);else if(typeof a=="string")M=j7(a,c,re.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case V:return a=Rn(31,c,r,S),a.elementType=V,a.lanes=N,a;case R:return qi(c.children,S,N,r);case O:M=8,S|=24;break;case T:return a=Rn(12,c,r,S|2),a.elementType=T,a.lanes=N,a;case P:return a=Rn(13,c,r,S),a.elementType=P,a.lanes=N,a;case H:return a=Rn(19,c,r,S),a.elementType=H,a.lanes=N,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:M=10;break e;case A:M=9;break e;case k:M=11;break e;case B:M=14;break e;case L:M=16,p=null;break e}M=29,c=Error(s(130,a===null?"null":typeof a,"")),p=null}return r=Rn(M,c,r,S),r.elementType=a,r.type=p,r.lanes=N,r}function qi(a,r,c,p){return a=Rn(7,a,p,r),a.lanes=c,a}function kd(a,r,c){return a=Rn(6,a,null,r),a.lanes=c,a}function zo(a){var r=Rn(18,null,null,0);return r.stateNode=a,r}function Ld(a,r,c){return r=Rn(4,a.children!==null?a.children:[],a.key,r),r.lanes=c,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var lc=new WeakMap;function Os(a,r){if(typeof a=="object"&&a!==null){var c=lc.get(a);return c!==void 0?c:(r={value:a,source:r,stack:fr(r)},lc.set(a,r),r)}return{value:a,source:r,stack:fr(r)}}var Bi=[],Gi=0,ko=null,Lo=0,ds=[],bn=0,hi=null,On=1,br="";function Hr(a,r){Bi[Gi++]=Lo,Bi[Gi++]=ko,ko=a,Lo=r}function Eg(a,r,c){ds[bn++]=On,ds[bn++]=br,ds[bn++]=hi,hi=a;var p=On;a=br;var S=32-ba(p)-1;p&=~(1<<S),c+=1;var N=32-ba(r)+S;if(30<N){var M=S-S%5;N=(p&(1<<M)-1).toString(32),p>>=M,S-=M,On=1<<32-ba(r)+S|c<<S|p,br=N+a}else On=1<<N|c<<S|p,br=a}function qr(a){a.return!==null&&(Hr(a,1),Eg(a,1,0))}function Ud(a){for(;a===ko;)ko=Bi[--Gi],Bi[Gi]=null,Lo=Bi[--Gi],Bi[Gi]=null;for(;a===hi;)hi=ds[--bn],ds[bn]=null,br=ds[--bn],ds[bn]=null,On=ds[--bn],ds[bn]=null}function Hd(a,r){ds[bn++]=On,ds[bn++]=br,ds[bn++]=hi,On=r.id,br=r.overflow,hi=a}var qn=null,on=null,jt=!1,pi=null,As=!1,Uo=Error(s(519));function Br(a){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Gr(Os(r,a)),Uo}function Tg(a){var r=a.stateNode,c=a.type,p=a.memoizedProps;switch(r[Fe]=a,r[ut]=p,c){case"dialog":Ot("cancel",r),Ot("close",r);break;case"iframe":case"object":case"embed":Ot("load",r);break;case"video":case"audio":for(c=0;c<lr.length;c++)Ot(lr[c],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),pd(r,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":Ot("invalid",r);break;case"textarea":Ot("invalid",r),gd(r,p.value,p.defaultValue,p.children)}c=p.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||p.suppressHydrationWarning===!0||Hv(r.textContent,c)?(p.popover!=null&&(Ot("beforetoggle",r),Ot("toggle",r)),p.onScroll!=null&&Ot("scroll",r),p.onScrollEnd!=null&&Ot("scrollend",r),p.onClick!=null&&(r.onclick=ci),r=!0):r=!1,r||Br(a,!0)}function Rg(a){for(qn=a.return;qn;)switch(qn.tag){case 5:case 31:case 13:As=!1;return;case 27:case 3:As=!0;return;default:qn=qn.return}}function Ho(a){if(a!==qn)return!1;if(!jt)return Rg(a),jt=!0,!1;var r=a.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||jy(a.type,a.memoizedProps)),c=!c),c&&on&&Br(a),Rg(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,su(a.type)?(a=Oy,Oy=null,on=a):on=r):on=qn?ti(a.stateNode.nextSibling):null;return!0}function Pi(){on=qn=null,jt=!1}function qd(){var a=pi;return a!==null&&(Gn===null?Gn=a:Gn.push.apply(Gn,a),pi=null),a}function Gr(a){pi===null?pi=[a]:pi.push(a)}var qo=G(null),Yi=null,Pr=null;function mi(a,r,c){he(qo,r._currentValue),r._currentValue=c}function Yr(a){a._currentValue=qo.current,W(qo)}function Bd(a,r,c){for(;a!==null;){var p=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,p!==null&&(p.childLanes|=r)):p!==null&&(p.childLanes&r)!==r&&(p.childLanes|=r),a===c)break;a=a.return}}function Gd(a,r,c,p){var S=a.child;for(S!==null&&(S.return=a);S!==null;){var N=S.dependencies;if(N!==null){var M=S.child;N=N.firstContext;e:for(;N!==null;){var q=N;N=S;for(var X=0;X<r.length;X++)if(q.context===r[X]){N.lanes|=c,q=N.alternate,q!==null&&(q.lanes|=c),Bd(N.return,c,a),p||(M=null);break e}N=q.next}}else if(S.tag===18){if(M=S.return,M===null)throw Error(s(341));M.lanes|=c,N=M.alternate,N!==null&&(N.lanes|=c),Bd(M,c,a),M=null}else M=S.child;if(M!==null)M.return=S;else for(M=S;M!==null;){if(M===a){M=null;break}if(S=M.sibling,S!==null){S.return=M.return,M=S;break}M=M.return}S=M}}function Vr(a,r,c,p){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 M=S.alternate;if(M===null)throw Error(s(387));if(M=M.memoizedProps,M!==null){var q=S.type;Fa(S.pendingProps.value,M.value)||(a!==null?a.push(q):a=[q])}}else if(S===De.current){if(M=S.alternate,M===null)throw Error(s(387));M.memoizedState.memoizedState!==S.memoizedState.memoizedState&&(a!==null?a.push(Hp):a=[Hp])}S=S.return}a!==null&&Gd(r,a,c,p),r.flags|=262144}function oc(a){for(a=a.firstContext;a!==null;){if(!Fa(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function Vi(a){Yi=a,Pr=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function We(a){return Og(Yi,a)}function Bo(a,r){return Yi===null&&Vi(a),Og(a,r)}function Og(a,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Pr===null){if(a===null)throw Error(s(308));Pr=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Pr=Pr.next=r;return c}var Ag=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(c,p){a.push(p)}};this.abort=function(){r.aborted=!0,a.forEach(function(c){return c()})}},cy=t.unstable_scheduleCallback,dy=t.unstable_NormalPriority,ta={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ph(){return{controller:new Ag,data:new Map,refCount:0}}function Al(a){a.refCount--,a.refCount===0&&cy(dy,function(){a.controller.abort()})}var Ms=null,Pd=0,gi=0,Zs=null;function Yh(a,r){if(Ms===null){var c=Ms=[];Pd=0,gi=pe(),Zs={status:"pending",value:void 0,then:function(p){c.push(p)}}}return Pd++,r.then(Vh,Vh),r}function Vh(){if(--Pd===0&&Ms!==null){Zs!==null&&(Zs.status="fulfilled");var a=Ms;Ms=null,gi=0,Zs=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Qh(a,r){var c=[],p={status:"pending",value:null,reason:null,then:function(S){c.push(S)}};return a.then(function(){p.status="fulfilled",p.value=r;for(var S=0;S<c.length;S++)(0,c[S])(r)},function(S){for(p.status="rejected",p.reason=S,S=0;S<c.length;S++)(0,c[S])(void 0)}),p}var Mg=Y.S;Y.S=function(a,r){Mp=Kn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&Yh(a,r),Mg!==null&&Mg(a,r)};var Qi=G(null);function Yd(){var a=Qi.current;return a!==null?a:tt.pooledCache}function uc(a,r){r===null?he(Qi,Qi.current):he(Qi,r.pool)}function Kh(){var a=Yd();return a===null?null:{parent:ta._currentValue,pool:a}}var Ml=Error(s(460)),cc=Error(s(474)),dt=Error(s(542)),Vd={then:function(){}};function fs(a){return a=a.status,a==="fulfilled"||a==="rejected"}function Qd(a,r,c){switch(c=a[c],c===void 0?a.push(r):c!==r&&(r.then(ci,ci),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a;default:if(typeof r.status=="string")r.then(ci,ci);else{if(a=tt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(p){if(r.status==="pending"){var S=r;S.status="fulfilled",S.value=p}},function(p){if(r.status==="pending"){var S=r;S.status="rejected",S.reason=p}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,kl(a),a}throw Qr=r,Ml}}function Dl(a){try{var r=a._init;return r(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(Qr=c,Ml):c}}var Qr=null;function zl(){if(Qr===null)throw Error(s(459));var a=Qr;return Qr=null,a}function kl(a){if(a===Ml||a===dt)throw Error(s(483))}var Ll=null,Ul=0;function dc(a){var r=Ul;return Ul+=1,Ll===null&&(Ll=[]),Qd(Ll,a,r)}function Is(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function Go(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 Kd(a){function r(ne,I){if(a){var ie=ne.deletions;ie===null?(ne.deletions=[I],ne.flags|=16):ie.push(I)}}function c(ne,I){if(!a)return null;for(;I!==null;)r(ne,I),I=I.sibling;return null}function p(ne){for(var I=new Map;ne!==null;)ne.key!==null?I.set(ne.key,ne):I.set(ne.index,ne),ne=ne.sibling;return I}function S(ne,I){return ne=cs(ne,I),ne.index=0,ne.sibling=null,ne}function N(ne,I,ie){return ne.index=ie,a?(ie=ne.alternate,ie!==null?(ie=ie.index,ie<I?(ne.flags|=67108866,I):ie):(ne.flags|=67108866,I)):(ne.flags|=1048576,I)}function M(ne){return a&&ne.alternate===null&&(ne.flags|=67108866),ne}function q(ne,I,ie,be){return I===null||I.tag!==6?(I=kd(ie,ne.mode,be),I.return=ne,I):(I=S(I,ie),I.return=ne,I)}function X(ne,I,ie,be){var Ke=ie.type;return Ke===R?xe(ne,I,ie.props.children,be,ie.key):I!==null&&(I.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===L&&Dl(Ke)===I.type)?(I=S(I,ie.props),Is(I,ie),I.return=ne,I):(I=Ur(ie.type,ie.key,ie.props,null,ne.mode,be),Is(I,ie),I.return=ne,I)}function oe(ne,I,ie,be){return I===null||I.tag!==4||I.stateNode.containerInfo!==ie.containerInfo||I.stateNode.implementation!==ie.implementation?(I=Ld(ie,ne.mode,be),I.return=ne,I):(I=S(I,ie.children||[]),I.return=ne,I)}function xe(ne,I,ie,be,Ke){return I===null||I.tag!==7?(I=qi(ie,ne.mode,be,Ke),I.return=ne,I):(I=S(I,ie),I.return=ne,I)}function ve(ne,I,ie){if(typeof I=="string"&&I!==""||typeof I=="number"||typeof I=="bigint")return I=kd(""+I,ne.mode,ie),I.return=ne,I;if(typeof I=="object"&&I!==null){switch(I.$$typeof){case j:return ie=Ur(I.type,I.key,I.props,null,ne.mode,ie),Is(ie,I),ie.return=ne,ie;case w:return I=Ld(I,ne.mode,ie),I.return=ne,I;case L:return I=Dl(I),ve(ne,I,ie)}if(ce(I)||ae(I))return I=qi(I,ne.mode,ie,null),I.return=ne,I;if(typeof I.then=="function")return ve(ne,dc(I),ie);if(I.$$typeof===z)return ve(ne,Bo(ne,I),ie);Go(ne,I)}return null}function fe(ne,I,ie,be){var Ke=I!==null?I.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return Ke!==null?null:q(ne,I,""+ie,be);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case j:return ie.key===Ke?X(ne,I,ie,be):null;case w:return ie.key===Ke?oe(ne,I,ie,be):null;case L:return ie=Dl(ie),fe(ne,I,ie,be)}if(ce(ie)||ae(ie))return Ke!==null?null:xe(ne,I,ie,be,null);if(typeof ie.then=="function")return fe(ne,I,dc(ie),be);if(ie.$$typeof===z)return fe(ne,I,Bo(ne,ie),be);Go(ne,ie)}return null}function ye(ne,I,ie,be,Ke){if(typeof be=="string"&&be!==""||typeof be=="number"||typeof be=="bigint")return ne=ne.get(ie)||null,q(I,ne,""+be,Ke);if(typeof be=="object"&&be!==null){switch(be.$$typeof){case j:return ne=ne.get(be.key===null?ie:be.key)||null,X(I,ne,be,Ke);case w:return ne=ne.get(be.key===null?ie:be.key)||null,oe(I,ne,be,Ke);case L:return be=Dl(be),ye(ne,I,ie,be,Ke)}if(ce(be)||ae(be))return ne=ne.get(ie)||null,xe(I,ne,be,Ke,null);if(typeof be.then=="function")return ye(ne,I,ie,dc(be),Ke);if(be.$$typeof===z)return ye(ne,I,ie,Bo(I,be),Ke);Go(I,be)}return null}function qe(ne,I,ie,be){for(var Ke=null,Kt=null,Pe=I,gt=I=0,zt=null;Pe!==null&><ie.length;gt++){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var Xt=fe(ne,Pe,ie[gt],be);if(Xt===null){Pe===null&&(Pe=zt);break}a&&Pe&&Xt.alternate===null&&r(ne,Pe),I=N(Xt,I,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt,Pe=zt}if(gt===ie.length)return c(ne,Pe),jt&&Hr(ne,gt),Ke;if(Pe===null){for(;gt<ie.length;gt++)Pe=ve(ne,ie[gt],be),Pe!==null&&(I=N(Pe,I,gt),Kt===null?Ke=Pe:Kt.sibling=Pe,Kt=Pe);return jt&&Hr(ne,gt),Ke}for(Pe=p(Pe);gt<ie.length;gt++)zt=ye(Pe,ne,gt,ie[gt],be),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(uu){return r(ne,uu)}),jt&&Hr(ne,gt),Ke}function Ie(ne,I,ie,be){if(ie==null)throw Error(s(151));for(var Ke=null,Kt=null,Pe=I,gt=I=0,zt=null,Xt=ie.next();Pe!==null&&!Xt.done;gt++,Xt=ie.next()){Pe.index>gt?(zt=Pe,Pe=null):zt=Pe.sibling;var uu=fe(ne,Pe,Xt.value,be);if(uu===null){Pe===null&&(Pe=zt);break}a&&Pe&&uu.alternate===null&&r(ne,Pe),I=N(uu,I,gt),Kt===null?Ke=uu:Kt.sibling=uu,Kt=uu,Pe=zt}if(Xt.done)return c(ne,Pe),jt&&Hr(ne,gt),Ke;if(Pe===null){for(;!Xt.done;gt++,Xt=ie.next())Xt=ve(ne,Xt.value,be),Xt!==null&&(I=N(Xt,I,gt),Kt===null?Ke=Xt:Kt.sibling=Xt,Kt=Xt);return jt&&Hr(ne,gt),Ke}for(Pe=p(Pe);!Xt.done;gt++,Xt=ie.next())Xt=ye(Pe,ne,gt,Xt.value,be),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(L7){return r(ne,L7)}),jt&&Hr(ne,gt),Ke}function dn(ne,I,ie,be){if(typeof ie=="object"&&ie!==null&&ie.type===R&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case j:e:{for(var Ke=ie.key;I!==null;){if(I.key===Ke){if(Ke=ie.type,Ke===R){if(I.tag===7){c(ne,I.sibling),be=S(I,ie.props.children),be.return=ne,ne=be;break e}}else if(I.elementType===Ke||typeof Ke=="object"&&Ke!==null&&Ke.$$typeof===L&&Dl(Ke)===I.type){c(ne,I.sibling),be=S(I,ie.props),Is(be,ie),be.return=ne,ne=be;break e}c(ne,I);break}else r(ne,I);I=I.sibling}ie.type===R?(be=qi(ie.props.children,ne.mode,be,ie.key),be.return=ne,ne=be):(be=Ur(ie.type,ie.key,ie.props,null,ne.mode,be),Is(be,ie),be.return=ne,ne=be)}return M(ne);case w:e:{for(Ke=ie.key;I!==null;){if(I.key===Ke)if(I.tag===4&&I.stateNode.containerInfo===ie.containerInfo&&I.stateNode.implementation===ie.implementation){c(ne,I.sibling),be=S(I,ie.children||[]),be.return=ne,ne=be;break e}else{c(ne,I);break}else r(ne,I);I=I.sibling}be=Ld(ie,ne.mode,be),be.return=ne,ne=be}return M(ne);case L:return ie=Dl(ie),dn(ne,I,ie,be)}if(ce(ie))return qe(ne,I,ie,be);if(ae(ie)){if(Ke=ae(ie),typeof Ke!="function")throw Error(s(150));return ie=Ke.call(ie),Ie(ne,I,ie,be)}if(typeof ie.then=="function")return dn(ne,I,dc(ie),be);if(ie.$$typeof===z)return dn(ne,I,Bo(ne,ie),be);Go(ne,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,I!==null&&I.tag===6?(c(ne,I.sibling),be=S(I,ie),be.return=ne,ne=be):(c(ne,I),be=kd(ie,ne.mode,be),be.return=ne,ne=be),M(ne)):c(ne,I)}return function(ne,I,ie,be){try{Ul=0;var Ke=dn(ne,I,ie,be);return Ll=null,Ke}catch(Pe){if(Pe===Ml||Pe===dt)throw Pe;var Kt=Rn(29,Pe,null,ne.mode);return Kt.lanes=be,Kt.return=ne,Kt}finally{}}}var yi=Kd(!0),Xd=Kd(!1),Ia=!1;function fc(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xh(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 xi(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function Ki(a,r,c){var p=a.updateQueue;if(p===null)return null;if(p=p.shared,(Ye&2)!==0){var S=p.pending;return S===null?r.next=r:(r.next=S.next,S.next=r),p.pending=r,r=Fs(a),Ui(a,null,c),r}return Sa(a,p,r,c),Fs(a)}function Xi(a,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var p=r.lanes;p&=a.pendingLanes,c|=p,r.lanes=c,os(a,c)}}function Qe(a,r){var c=a.updateQueue,p=a.alternate;if(p!==null&&(p=p.updateQueue,c===p)){var S=null,N=null;if(c=c.firstBaseUpdate,c!==null){do{var M={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};N===null?S=N=M:N=N.next=M,c=c.next}while(c!==null);N===null?S=N=r:N=N.next=r}else S=N=r;c={baseState:p.baseState,firstBaseUpdate:S,lastBaseUpdate:N,shared:p.shared,callbacks:p.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=r:a.next=r,c.lastBaseUpdate=r}var Fh=!1;function hc(){if(Fh){var a=Zs;if(a!==null)throw a}}function Po(a,r,c,p){Fh=!1;var S=a.updateQueue;Ia=!1;var N=S.firstBaseUpdate,M=S.lastBaseUpdate,q=S.shared.pending;if(q!==null){S.shared.pending=null;var X=q,oe=X.next;X.next=null,M===null?N=oe:M.next=oe,M=X;var xe=a.alternate;xe!==null&&(xe=xe.updateQueue,q=xe.lastBaseUpdate,q!==M&&(q===null?xe.firstBaseUpdate=oe:q.next=oe,xe.lastBaseUpdate=X))}if(N!==null){var ve=S.baseState;M=0,xe=oe=X=null,q=N;do{var fe=q.lane&-536870913,ye=fe!==q.lane;if(ye?(ct&fe)===fe:(p&fe)===fe){fe!==0&&fe===gi&&(Fh=!0),xe!==null&&(xe=xe.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var qe=a,Ie=q;fe=r;var dn=c;switch(Ie.tag){case 1:if(qe=Ie.payload,typeof qe=="function"){ve=qe.call(dn,ve,fe);break e}ve=qe;break e;case 3:qe.flags=qe.flags&-65537|128;case 0:if(qe=Ie.payload,fe=typeof qe=="function"?qe.call(dn,ve,fe):qe,fe==null)break e;ve=b({},ve,fe);break e;case 2:Ia=!0}}fe=q.callback,fe!==null&&(a.flags|=64,ye&&(a.flags|=8192),ye=S.callbacks,ye===null?S.callbacks=[fe]:ye.push(fe))}else ye={lane:fe,tag:q.tag,payload:q.payload,callback:q.callback,next:null},xe===null?(oe=xe=ye,X=ve):xe=xe.next=ye,M|=fe;if(q=q.next,q===null){if(q=S.shared.pending,q===null)break;ye=q,q=ye.next,ye.next=null,S.lastBaseUpdate=ye,S.shared.pending=null}}while(!0);xe===null&&(X=ve),S.baseState=X,S.firstBaseUpdate=oe,S.lastBaseUpdate=xe,N===null&&(S.shared.lanes=0),Wr|=M,a.lanes=M,a.memoizedState=ve}}function Yo(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Dg(a,r){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)Yo(c[a],r)}var Vo=G(null),Fd=G(0);function zg(a,r){a=Ls,he(Fd,a),he(Vo,r),Ls=a|r.baseLanes}function Zh(){he(Fd,Ls),he(Vo,Vo.current)}function pc(){Ls=Fd.current,W(Vo),W(Fd)}var hs=G(null),Ja=null;function bi(a){var r=a.alternate;he(wt,wt.current&1),he(hs,a),Ja===null&&(r===null||Vo.current!==null||r.memoizedState!==null)&&(Ja=a)}function Ih(a){he(wt,wt.current),he(hs,a),Ja===null&&(Ja=a)}function kg(a){a.tag===22?(he(wt,wt.current),he(hs,a),Ja===null&&(Ja=a)):ps()}function ps(){he(wt,wt.current),he(hs,hs.current)}function Fn(a){W(hs),Ja===a&&(Ja=null),W(wt)}var wt=G(0);function Ds(a){for(var r=a;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||Ty(c)||Ry(c)))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,Js=!1,Qo=!1,Hl=!1,Zd=0,mc=0,Ko=null,Jh=0;function An(){throw Error(s(321))}function Wh(a,r){if(r===null)return!1;for(var c=0;c<r.length&&c<a.length;c++)if(!Fa(a[c],r[c]))return!1;return!0}function Id(a,r,c,p,S,N){return vn=N,rt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Y.H=a===null||a.memoizedState===null?h0:xp,Hl=!1,N=c(p,S),Hl=!1,Qo&&(N=ql(r,c,p,S)),Lg(a),N}function Lg(a){Y.H=Xo;var r=tn!==null&&tn.next!==null;if(vn=0,St=tn=rt=null,Js=!1,mc=0,Ko=null,r)throw Error(s(300));a===null||na||(a=a.dependencies,a!==null&&oc(a)&&(na=!0))}function ql(a,r,c,p){rt=a;var S=0;do{if(Qo&&(Ko=null),mc=0,Qo=!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=Ws,N=r(c,p)}while(Qo);return N}function Bl(){var a=Y.H,r=a.useState()[0];return r=typeof r.then=="function"?gc(r):r,a=a.useState()[0],(tn!==null?tn.memoizedState:null)!==a&&(rt.flags|=1024),r}function $h(){var a=Zd!==0;return Zd=0,a}function ep(a,r,c){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~c}function tp(a){if(Js){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Js=!1}vn=0,St=tn=rt=null,Qo=!1,mc=Zd=0,Ko=null}function ua(){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 Zn(){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 Jd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function gc(a){var r=mc;return mc+=1,Ko===null&&(Ko=[]),a=Qd(Ko,a,r),r=rt,(St===null?r.memoizedState:St.next)===null&&(r=r.alternate,Y.H=r===null||r.memoizedState===null?h0:xp),a}function Fi(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return gc(a);if(a.$$typeof===z)return We(a)}throw Error(s(438,String(a)))}function np(a){var r=null,c=rt.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var p=rt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(r={data:p.data.map(function(S){return S.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=Jd(),rt.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(a),p=0;p<a;p++)c[p]=Z;return r.index++,c}function vi(a,r){return typeof r=="function"?r(a):r}function Wd(a){var r=Zn();return ap(r,tn,a)}function ap(a,r,c){var p=a.queue;if(p===null)throw Error(s(311));p.lastRenderedReducer=c;var S=a.baseQueue,N=p.pending;if(N!==null){if(S!==null){var M=S.next;S.next=N.next,N.next=M}r.baseQueue=S=N,p.pending=null}if(N=a.baseState,S===null)a.memoizedState=N;else{r=S.next;var q=M=null,X=null,oe=r,xe=!1;do{var ve=oe.lane&-536870913;if(ve!==oe.lane?(ct&ve)===ve:(vn&ve)===ve){var fe=oe.revertLane;if(fe===0)X!==null&&(X=X.next={lane:0,revertLane:0,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null}),ve===gi&&(xe=!0);else if((vn&fe)===fe){oe=oe.next,fe===gi&&(xe=!0);continue}else ve={lane:0,revertLane:oe.revertLane,gesture:null,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(q=X=ve,M=N):X=X.next=ve,rt.lanes|=fe,Wr|=fe;ve=oe.action,Hl&&c(N,ve),N=oe.hasEagerState?oe.eagerState:c(N,ve)}else fe={lane:ve,revertLane:oe.revertLane,gesture:oe.gesture,action:oe.action,hasEagerState:oe.hasEagerState,eagerState:oe.eagerState,next:null},X===null?(q=X=fe,M=N):X=X.next=fe,rt.lanes|=ve,Wr|=ve;oe=oe.next}while(oe!==null&&oe!==r);if(X===null?M=N:X.next=q,!Fa(N,a.memoizedState)&&(na=!0,xe&&(c=Zs,c!==null)))throw c;a.memoizedState=N,a.baseState=M,a.baseQueue=X,p.lastRenderedState=N}return S===null&&(p.lanes=0),[a.memoizedState,p.dispatch]}function sp(a){var r=Zn(),c=r.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=a;var p=c.dispatch,S=c.pending,N=r.memoizedState;if(S!==null){c.pending=null;var M=S=S.next;do N=a(N,M.action),M=M.next;while(M!==S);Fa(N,r.memoizedState)||(na=!0),r.memoizedState=N,r.baseQueue===null&&(r.baseState=N),c.lastRenderedState=N}return[N,p]}function Ug(a,r,c){var p=rt,S=Zn(),N=jt;if(N){if(c===void 0)throw Error(s(407));c=c()}else c=r();var M=!Fa((tn||S).memoizedState,c);if(M&&(S.memoizedState=c,na=!0),S=S.queue,fp(Bg.bind(null,p,S,a),[a]),S.getSnapshot!==r||M||St!==null&&St.memoizedState.tag&1){if(p.flags|=2048,Zi(9,{destroy:void 0},qg.bind(null,p,S,c,r),null),tt===null)throw Error(s(349));N||(vn&127)!==0||Hg(p,r,c)}return c}function Hg(a,r,c){a.flags|=16384,a={getSnapshot:r,value:c},r=rt.updateQueue,r===null?(r=Jd(),rt.updateQueue=r,r.stores=[a]):(c=r.stores,c===null?r.stores=[a]:c.push(a))}function qg(a,r,c,p){r.value=c,r.getSnapshot=p,Gg(r)&&Pg(a)}function Bg(a,r,c){return c(function(){Gg(r)&&Pg(a)})}function Gg(a){var r=a.getSnapshot;a=a.value;try{var c=r();return!Fa(a,c)}catch{return!0}}function Pg(a){var r=Za(a,2);r!==null&&ht(r,a,2)}function rp(a){var r=ua();if(typeof a=="function"){var c=a;if(a=c(),Hl){ls(!0);try{c()}finally{ls(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:a},r}function ip(a,r,c,p){return a.baseState=c,ap(a,tn,typeof p=="function"?p:vi)}function fy(a,r,c,p,S){if(nf(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(M){N.listeners.push(M)}};Y.T!==null?c(!0):N.isTransition=!1,p(N),c=r.pending,c===null?(N.next=r.pending=N,Yg(r,N)):(N.next=c.next,r.pending=c.next=N)}}function Yg(a,r){var c=r.action,p=r.payload,S=a.state;if(r.isTransition){var N=Y.T,M={};Y.T=M;try{var q=c(S,p),X=Y.S;X!==null&&X(M,q),Vg(a,r,q)}catch(oe){lp(a,r,oe)}finally{N!==null&&M.types!==null&&(N.types=M.types),Y.T=N}}else try{N=c(S,p),Vg(a,r,N)}catch(oe){lp(a,r,oe)}}function Vg(a,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(p){Qg(a,r,p)},function(p){return lp(a,r,p)}):Qg(a,r,c)}function Qg(a,r,c){r.status="fulfilled",r.value=c,Kg(r),a.state=c,r=a.pending,r!==null&&(c=r.next,c===r?a.pending=null:(c=c.next,r.next=c,Yg(a,c)))}function lp(a,r,c){var p=a.pending;if(a.pending=null,p!==null){p=p.next;do r.status="rejected",r.reason=c,Kg(r),r=r.next;while(r!==p)}a.action=null}function Kg(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function op(a,r){return r}function up(a,r){if(jt){var c=tt.formState;if(c!==null){e:{var p=rt;if(jt){if(on){t:{for(var S=on,N=As;S.nodeType!==8;){if(!N){S=null;break t}if(S=ti(S.nextSibling),S===null){S=null;break t}}N=S.data,S=N==="F!"||N==="F"?S:null}if(S){on=ti(S.nextSibling),p=S.data==="F!";break e}}Br(p)}p=!1}p&&(r=c[0])}}return c=ua(),c.memoizedState=c.baseState=r,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:op,lastRenderedState:r},c.queue=p,c=c0.bind(null,rt,p),p.dispatch=c,p=rp(!1),N=yp.bind(null,rt,!1,p.queue),p=ua(),S={state:r,dispatch:null,action:a,pending:null},p.queue=S,c=fy.bind(null,rt,S,N,c),S.dispatch=c,p.memoizedState=a,[r,c,!1]}function Xg(a){var r=Zn();return cp(r,tn,a)}function cp(a,r,c){if(r=ap(a,r,op)[0],a=Wd(vi)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var p=gc(r)}catch(M){throw M===Ml?dt:M}else p=r;r=Zn();var S=r.queue,N=S.dispatch;return c!==r.memoizedState&&(rt.flags|=2048,Zi(9,{destroy:void 0},Fg.bind(null,S,c),null)),[p,N,a]}function Fg(a,r){a.action=r}function dp(a){var r=Zn(),c=tn;if(c!==null)return cp(r,c,a);Zn(),r=r.memoizedState,c=Zn();var p=c.queue.dispatch;return c.memoizedState=a,[r,p,!1]}function Zi(a,r,c,p){return a={tag:a,create:c,deps:p,inst:r,next:null},r=rt.updateQueue,r===null&&(r=Jd(),rt.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=a.next=a:(p=c.next,c.next=a,a.next=p,r.lastEffect=a),a}function $d(){return Zn().memoizedState}function ef(a,r,c,p){var S=ua();rt.flags|=a,S.memoizedState=Zi(1|r,{destroy:void 0},c,p===void 0?null:p)}function tf(a,r,c,p){var S=Zn();p=p===void 0?null:p;var N=S.memoizedState.inst;tn!==null&&p!==null&&Wh(p,tn.memoizedState.deps)?S.memoizedState=Zi(r,N,c,p):(rt.flags|=a,S.memoizedState=Zi(1|r,N,c,p))}function Zg(a,r){ef(8390656,8,a,r)}function fp(a,r){tf(2048,8,a,r)}function Ig(a){rt.flags|=4;var r=rt.updateQueue;if(r===null)r=Jd(),rt.updateQueue=r,r.events=[a];else{var c=r.events;c===null?r.events=[a]:c.push(a)}}function Jg(a){var r=Zn().memoizedState;return Ig({ref:r,nextImpl:a}),function(){if((Ye&2)!==0)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Wg(a,r){return tf(4,2,a,r)}function $g(a,r){return tf(4,4,a,r)}function e0(a,r){if(typeof r=="function"){a=a();var c=r(a);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function t0(a,r,c){c=c!=null?c.concat([a]):null,tf(4,4,e0.bind(null,r,a),c)}function hp(){}function n0(a,r){var c=Zn();r=r===void 0?null:r;var p=c.memoizedState;return r!==null&&Wh(r,p[1])?p[0]:(c.memoizedState=[a,r],a)}function a0(a,r){var c=Zn();r=r===void 0?null:r;var p=c.memoizedState;if(r!==null&&Wh(r,p[1]))return p[0];if(p=a(),Hl){ls(!0);try{a()}finally{ls(!1)}}return c.memoizedState=[p,r],p}function pp(a,r,c){return c===void 0||(vn&1073741824)!==0&&(ct&261930)===0?a.memoizedState=r:(a.memoizedState=c,a=bt(),rt.lanes|=a,Wr|=a,c)}function s0(a,r,c,p){return Fa(c,r)?c:Vo.current!==null?(a=pp(a,c,p),Fa(a,r)||(na=!0),a):(vn&42)===0||(vn&1073741824)!==0&&(ct&261930)===0?(na=!0,a.memoizedState=c):(a=bt(),rt.lanes|=a,Wr|=a,r)}function r0(a,r,c,p,S){var N=$.p;$.p=N!==0&&8>N?N:8;var M=Y.T,q={};Y.T=q,yp(a,!1,r,c);try{var X=S(),oe=Y.S;if(oe!==null&&oe(q,X),X!==null&&typeof X=="object"&&typeof X.then=="function"){var xe=Qh(X,p);yc(a,r,xe,Hs(a))}else yc(a,r,p,Hs(a))}catch(ve){yc(a,r,{then:function(){},status:"rejected",reason:ve},Hs())}finally{$.p=N,M!==null&&q.types!==null&&(M.types=q.types),Y.T=M}}function hy(){}function mp(a,r,c,p){if(a.tag!==5)throw Error(s(476));var S=i0(a).queue;r0(a,S,r,ee,c===null?hy:function(){return l0(a),c(p)})}function i0(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:ee},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vi,lastRenderedState:c},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function l0(a){var r=i0(a);r.next===null&&(r=a.alternate.memoizedState),yc(a,r.next.queue,{},Hs())}function gp(){return We(Hp)}function o0(){return Zn().memoizedState}function u0(){return Zn().memoizedState}function py(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var c=Hs();a=xi(c);var p=Ki(r,a,c);p!==null&&(ht(p,r,c),Xi(p,r,c)),r={cache:Ph()},a.payload=r;return}r=r.return}}function my(a,r,c){var p=Hs();c={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},nf(a)?d0(r,c):(c=Dd(a,r,c,p),c!==null&&(ht(c,a,p),f0(c,r,p)))}function c0(a,r,c){var p=Hs();yc(a,r,c,p)}function yc(a,r,c,p){var S={lane:p,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(nf(a))d0(r,S);else{var N=a.alternate;if(a.lanes===0&&(N===null||N.lanes===0)&&(N=r.lastRenderedReducer,N!==null))try{var M=r.lastRenderedState,q=N(M,c);if(S.hasEagerState=!0,S.eagerState=q,Fa(q,M))return Sa(a,r,S,0),tt===null&&ic(),!1}catch{}finally{}if(c=Dd(a,r,S,p),c!==null)return ht(c,a,p),f0(c,r,p),!0}return!1}function yp(a,r,c,p){if(p={lane:2,revertLane:pe(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},nf(a)){if(r)throw Error(s(479))}else r=Dd(a,c,p,2),r!==null&&ht(r,a,2)}function nf(a){var r=a.alternate;return a===rt||r!==null&&r===rt}function d0(a,r){Qo=Js=!0;var c=a.pending;c===null?r.next=r:(r.next=c.next,c.next=r),a.pending=r}function f0(a,r,c){if((c&4194048)!==0){var p=r.lanes;p&=a.pendingLanes,c|=p,r.lanes=c,os(a,c)}}var Xo={readContext:We,use:Fi,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};Xo.useEffectEvent=An;var h0={readContext:We,use:Fi,useCallback:function(a,r){return ua().memoizedState=[a,r===void 0?null:r],a},useContext:We,useEffect:Zg,useImperativeHandle:function(a,r,c){c=c!=null?c.concat([a]):null,ef(4194308,4,e0.bind(null,r,a),c)},useLayoutEffect:function(a,r){return ef(4194308,4,a,r)},useInsertionEffect:function(a,r){ef(4,2,a,r)},useMemo:function(a,r){var c=ua();r=r===void 0?null:r;var p=a();if(Hl){ls(!0);try{a()}finally{ls(!1)}}return c.memoizedState=[p,r],p},useReducer:function(a,r,c){var p=ua();if(c!==void 0){var S=c(r);if(Hl){ls(!0);try{c(r)}finally{ls(!1)}}}else S=r;return p.memoizedState=p.baseState=S,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:S},p.queue=a,a=a.dispatch=my.bind(null,rt,a),[p.memoizedState,a]},useRef:function(a){var r=ua();return a={current:a},r.memoizedState=a},useState:function(a){a=rp(a);var r=a.queue,c=c0.bind(null,rt,r);return r.dispatch=c,[a.memoizedState,c]},useDebugValue:hp,useDeferredValue:function(a,r){var c=ua();return pp(c,a,r)},useTransition:function(){var a=rp(!1);return a=r0.bind(null,rt,a.queue,!0,!1),ua().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,c){var p=rt,S=ua();if(jt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=r(),tt===null)throw Error(s(349));(ct&127)!==0||Hg(p,r,c)}S.memoizedState=c;var N={value:c,getSnapshot:r};return S.queue=N,Zg(Bg.bind(null,p,N,a),[a]),p.flags|=2048,Zi(9,{destroy:void 0},qg.bind(null,p,N,c,r),null),c},useId:function(){var a=ua(),r=tt.identifierPrefix;if(jt){var c=br,p=On;c=(p&~(1<<32-ba(p)-1)).toString(32)+c,r="_"+r+"R_"+c,c=Zd++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=Jh++,r="_"+r+"r_"+c.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:gp,useFormState:up,useActionState:up,useOptimistic:function(a){var r=ua();r.memoizedState=r.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=yp.bind(null,rt,!0,c),c.dispatch=r,[a,r]},useMemoCache:np,useCacheRefresh:function(){return ua().memoizedState=py.bind(null,rt)},useEffectEvent:function(a){var r=ua(),c={impl:a};return r.memoizedState=c,function(){if((Ye&2)!==0)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},xp={readContext:We,use:Fi,useCallback:n0,useContext:We,useEffect:fp,useImperativeHandle:t0,useInsertionEffect:Wg,useLayoutEffect:$g,useMemo:a0,useReducer:Wd,useRef:$d,useState:function(){return Wd(vi)},useDebugValue:hp,useDeferredValue:function(a,r){var c=Zn();return s0(c,tn.memoizedState,a,r)},useTransition:function(){var a=Wd(vi)[0],r=Zn().memoizedState;return[typeof a=="boolean"?a:gc(a),r]},useSyncExternalStore:Ug,useId:o0,useHostTransitionStatus:gp,useFormState:Xg,useActionState:Xg,useOptimistic:function(a,r){var c=Zn();return ip(c,tn,a,r)},useMemoCache:np,useCacheRefresh:u0};xp.useEffectEvent=Jg;var Ws={readContext:We,use:Fi,useCallback:n0,useContext:We,useEffect:fp,useImperativeHandle:t0,useInsertionEffect:Wg,useLayoutEffect:$g,useMemo:a0,useReducer:sp,useRef:$d,useState:function(){return sp(vi)},useDebugValue:hp,useDeferredValue:function(a,r){var c=Zn();return tn===null?pp(c,a,r):s0(c,tn.memoizedState,a,r)},useTransition:function(){var a=sp(vi)[0],r=Zn().memoizedState;return[typeof a=="boolean"?a:gc(a),r]},useSyncExternalStore:Ug,useId:o0,useHostTransitionStatus:gp,useFormState:dp,useActionState:dp,useOptimistic:function(a,r){var c=Zn();return tn!==null?ip(c,tn,a,r):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:np,useCacheRefresh:u0};Ws.useEffectEvent=Jg;function af(a,r,c,p){r=a.memoizedState,c=c(p,r),c=c==null?r:b({},r,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var xc={enqueueSetState:function(a,r,c){a=a._reactInternals;var p=Hs(),S=xi(p);S.payload=r,c!=null&&(S.callback=c),r=Ki(a,S,p),r!==null&&(ht(r,a,p),Xi(r,a,p))},enqueueReplaceState:function(a,r,c){a=a._reactInternals;var p=Hs(),S=xi(p);S.tag=1,S.payload=r,c!=null&&(S.callback=c),r=Ki(a,S,p),r!==null&&(ht(r,a,p),Xi(r,a,p))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var c=Hs(),p=xi(c);p.tag=2,r!=null&&(p.callback=r),r=Ki(a,p,c),r!==null&&(ht(r,a,c),Xi(r,a,c))}};function bp(a,r,c,p,S,N,M){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(p,N,M):r.prototype&&r.prototype.isPureReactComponent?!Ro(c,p)||!Ro(S,N):!0}function vp(a,r,c,p){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,p),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,p),r.state!==a&&xc.enqueueReplaceState(r,r.state,null)}function Ii(a,r){var c=r;if("ref"in r){c={};for(var p in r)p!=="ref"&&(c[p]=r[p])}if(a=a.defaultProps){c===r&&(c=b({},c));for(var S in a)c[S]===void 0&&(c[S]=a[S])}return c}function p0(a){rc(a)}function Sp(a){console.error(a)}function Np(a){rc(a)}function sf(a,r){try{var c=a.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(p){setTimeout(function(){throw p})}}function m0(a,r,c){try{var p=a.onCaughtError;p(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(S){setTimeout(function(){throw S})}}function _p(a,r,c){return c=xi(c),c.tag=3,c.payload={element:null},c.callback=function(){sf(a,r)},c}function Cp(a){return a=xi(a),a.tag=3,a}function g0(a,r,c,p){var S=c.type.getDerivedStateFromError;if(typeof S=="function"){var N=p.value;a.payload=function(){return S(N)},a.callback=function(){m0(r,c,p)}}var M=c.stateNode;M!==null&&typeof M.componentDidCatch=="function"&&(a.callback=function(){m0(r,c,p),typeof S!="function"&&(Wn===null?Wn=new Set([this]):Wn.add(this));var q=p.stack;this.componentDidCatch(p.value,{componentStack:q!==null?q:""})})}function ca(a,r,c,p,S){if(c.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(r=c.alternate,r!==null&&Vr(r,c,S,!0),c=hs.current,c!==null){switch(c.tag){case 31:case 13:return Ja===null?eu():c.alternate===null&&Mn===0&&(Mn=3),c.flags&=-257,c.flags|=65536,c.lanes=S,p===Vd?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([p]):r.add(p),Oc(a,p,S)),!1;case 22:return c.flags|=65536,p===Vd?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([p])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([p]):c.add(p)),Oc(a,p,S)),!1}throw Error(s(435,c.tag))}return Oc(a,p,S),eu(),!1}if(jt)return r=hs.current,r!==null?((r.flags&65536)===0&&(r.flags|=256),r.flags|=65536,r.lanes=S,p!==Uo&&(a=Error(s(422),{cause:p}),Gr(Os(a,c)))):(p!==Uo&&(r=Error(s(423),{cause:p}),Gr(Os(r,c))),a=a.current.alternate,a.flags|=65536,S&=-S,a.lanes|=S,p=Os(p,c),S=_p(a.stateNode,p,S),Qe(a,S),Mn!==4&&(Mn=2)),!1;var N=Error(s(520),{cause:p});if(N=Os(N,c),Fl===null?Fl=[N]:Fl.push(N),Mn!==4&&(Mn=2),r===null)return!0;p=Os(p,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,a=S&-S,c.lanes|=a,a=_p(c.stateNode,p,a),Qe(c,a),!1;case 1:if(r=c.type,N=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||N!==null&&typeof N.componentDidCatch=="function"&&(Wn===null||!Wn.has(N))))return c.flags|=65536,S&=-S,c.lanes|=S,S=Cp(S),g0(S,a,c,p),Qe(c,S),!1}c=c.return}while(c!==null);return!1}var rf=Error(s(461)),na=!1;function Na(a,r,c,p){r.child=a===null?Xd(r,null,c,p):yi(r,a.child,c,p)}function jp(a,r,c,p,S){c=c.render;var N=r.ref;if("ref"in p){var M={};for(var q in p)q!=="ref"&&(M[q]=p[q])}else M=p;return Vi(r),p=Id(a,r,c,M,N,S),q=$h(),a!==null&&!na?(ep(a,r,S),In(a,r,S)):(jt&&q&&qr(r),r.flags|=1,Na(a,r,p,S),r.child)}function Gl(a,r,c,p,S){if(a===null){var N=c.type;return typeof N=="function"&&!zd(N)&&N.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=N,lf(a,r,N,p,S)):(a=Ur(c.type,null,p,r,r.mode,S),a.ref=r.ref,a.return=r,r.child=a)}if(N=a.child,!hf(a,S)){var M=N.memoizedProps;if(c=c.compare,c=c!==null?c:Ro,c(M,p)&&a.ref===r.ref)return In(a,r,S)}return r.flags|=1,a=cs(N,p),a.ref=r.ref,a.return=r,r.child=a}function lf(a,r,c,p,S){if(a!==null){var N=a.memoizedProps;if(Ro(N,p)&&a.ref===r.ref)if(na=!1,r.pendingProps=p=N,hf(a,S))(a.flags&131072)!==0&&(na=!0);else return r.lanes=a.lanes,In(a,r,S)}return Fo(a,r,c,p,S)}function Pl(a,r,c,p){var S=p.children,N=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((r.flags&128)!==0){if(N=N!==null?N.baseLanes|c:c,a!==null){for(p=r.child=a.child,S=0;p!==null;)S=S|p.lanes|p.childLanes,p=p.sibling;p=S&~N}else p=0,r.child=null;return ms(a,r,N,c,p)}if((c&536870912)!==0)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&uc(r,N!==null?N.cachePool:null),N!==null?zg(r,N):Zh(),kg(r);else return p=r.lanes=536870912,ms(a,r,N!==null?N.baseLanes|c:c,c,p)}else N!==null?(uc(r,N.cachePool),zg(r,N),ps(),r.memoizedState=null):(a!==null&&uc(r,null),Zh(),ps());return Na(a,r,S,c),r.child}function Kr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function ms(a,r,c,p,S){var N=Yd();return N=N===null?null:{parent:ta._currentValue,pool:N},r.memoizedState={baseLanes:c,cachePool:N},a!==null&&uc(r,null),Zh(),kg(r),a!==null&&Vr(a,r,p,!0),r.childLanes=S,null}function of(a,r){return r=ff({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function y0(a,r,c){return yi(r,a.child,null,c),a=of(r,r.pendingProps),a.flags|=2,Fn(r),r.memoizedState=null,a}function uf(a,r,c){var p=r.pendingProps,S=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(jt){if(p.mode==="hidden")return a=of(r,p),r.lanes=536870912,Kr(null,a);if(Ih(r),(a=on)?(a=Kv(a,As),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:hi!==null?{id:On,overflow:br}:null,retryLane:536870912,hydrationErrors:null},c=zo(a),c.return=r,r.child=c,qn=r,on=null)):a=null,a===null)throw Br(r);return r.lanes=536870912,null}return of(r,p)}var N=a.memoizedState;if(N!==null){var M=N.dehydrated;if(Ih(r),S)if(r.flags&256)r.flags&=-257,r=y0(a,r,c);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(na||Vr(a,r,c,!1),S=(c&a.childLanes)!==0,na||S){if(p=tt,p!==null&&(M=Gs(p,c),M!==0&&M!==N.retryLane))throw N.retryLane=M,Za(a,M),ht(p,a,M),rf;eu(),r=y0(a,r,c)}else a=N.treeContext,on=ti(M.nextSibling),qn=r,jt=!0,pi=null,As=!1,a!==null&&Hd(r,a),r=of(r,p),r.flags|=4096;return r}return a=cs(a.child,{mode:p.mode,children:p.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Yl(a,r){var c=r.ref;if(c===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(a===null||a.ref!==c)&&(r.flags|=4194816)}}function Fo(a,r,c,p,S){return Vi(r),c=Id(a,r,c,p,void 0,S),p=$h(),a!==null&&!na?(ep(a,r,S),In(a,r,S)):(jt&&p&&qr(r),r.flags|=1,Na(a,r,c,S),r.child)}function bc(a,r,c,p,S,N){return Vi(r),r.updateQueue=null,c=ql(r,p,c,S),Lg(a),p=$h(),a!==null&&!na?(ep(a,r,N),In(a,r,N)):(jt&&p&&qr(r),r.flags|=1,Na(a,r,c,N),r.child)}function cf(a,r,c,p,S){if(Vi(r),r.stateNode===null){var N=Hi,M=c.contextType;typeof M=="object"&&M!==null&&(N=We(M)),N=new c(p,N),r.memoizedState=N.state!==null&&N.state!==void 0?N.state:null,N.updater=xc,r.stateNode=N,N._reactInternals=r,N=r.stateNode,N.props=p,N.state=r.memoizedState,N.refs={},fc(r),M=c.contextType,N.context=typeof M=="object"&&M!==null?We(M):Hi,N.state=r.memoizedState,M=c.getDerivedStateFromProps,typeof M=="function"&&(af(r,c,M,p),N.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof N.getSnapshotBeforeUpdate=="function"||typeof N.UNSAFE_componentWillMount!="function"&&typeof N.componentWillMount!="function"||(M=N.state,typeof N.componentWillMount=="function"&&N.componentWillMount(),typeof N.UNSAFE_componentWillMount=="function"&&N.UNSAFE_componentWillMount(),M!==N.state&&xc.enqueueReplaceState(N,N.state,null),Po(r,p,N,S),hc(),N.state=r.memoizedState),typeof N.componentDidMount=="function"&&(r.flags|=4194308),p=!0}else if(a===null){N=r.stateNode;var q=r.memoizedProps,X=Ii(c,q);N.props=X;var oe=N.context,xe=c.contextType;M=Hi,typeof xe=="object"&&xe!==null&&(M=We(xe));var ve=c.getDerivedStateFromProps;xe=typeof ve=="function"||typeof N.getSnapshotBeforeUpdate=="function",q=r.pendingProps!==q,xe||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(q||oe!==M)&&vp(r,N,p,M),Ia=!1;var fe=r.memoizedState;N.state=fe,Po(r,p,N,S),hc(),oe=r.memoizedState,q||fe!==oe||Ia?(typeof ve=="function"&&(af(r,c,ve,p),oe=r.memoizedState),(X=Ia||bp(r,c,X,p,fe,oe,M))?(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=p,r.memoizedState=oe),N.props=p,N.state=oe,N.context=M,p=X):(typeof N.componentDidMount=="function"&&(r.flags|=4194308),p=!1)}else{N=r.stateNode,Xh(a,r),M=r.memoizedProps,xe=Ii(c,M),N.props=xe,ve=r.pendingProps,fe=N.context,oe=c.contextType,X=Hi,typeof oe=="object"&&oe!==null&&(X=We(oe)),q=c.getDerivedStateFromProps,(oe=typeof q=="function"||typeof N.getSnapshotBeforeUpdate=="function")||typeof N.UNSAFE_componentWillReceiveProps!="function"&&typeof N.componentWillReceiveProps!="function"||(M!==ve||fe!==X)&&vp(r,N,p,X),Ia=!1,fe=r.memoizedState,N.state=fe,Po(r,p,N,S),hc();var ye=r.memoizedState;M!==ve||fe!==ye||Ia||a!==null&&a.dependencies!==null&&oc(a.dependencies)?(typeof q=="function"&&(af(r,c,q,p),ye=r.memoizedState),(xe=Ia||bp(r,c,xe,p,fe,ye,X)||a!==null&&a.dependencies!==null&&oc(a.dependencies))?(oe||typeof N.UNSAFE_componentWillUpdate!="function"&&typeof N.componentWillUpdate!="function"||(typeof N.componentWillUpdate=="function"&&N.componentWillUpdate(p,ye,X),typeof N.UNSAFE_componentWillUpdate=="function"&&N.UNSAFE_componentWillUpdate(p,ye,X)),typeof N.componentDidUpdate=="function"&&(r.flags|=4),typeof N.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof N.componentDidUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),r.memoizedProps=p,r.memoizedState=ye),N.props=p,N.state=ye,N.context=X,p=xe):(typeof N.componentDidUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=4),typeof N.getSnapshotBeforeUpdate!="function"||M===a.memoizedProps&&fe===a.memoizedState||(r.flags|=1024),p=!1)}return N=p,Yl(a,r),p=(r.flags&128)!==0,N||p?(N=r.stateNode,c=p&&typeof c.getDerivedStateFromError!="function"?null:N.render(),r.flags|=1,a!==null&&p?(r.child=yi(r,a.child,null,S),r.child=yi(r,null,c,S)):Na(a,r,c,S),r.memoizedState=N.state,a=r.child):a=In(a,r,S),a}function x0(a,r,c,p){return Pi(),r.flags|=256,Na(a,r,c,p),r.child}var wp={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ga(a){return{baseLanes:a,cachePool:Kh()}}function df(a,r,c){return a=a!==null?a.childLanes&~c:0,r&&(a|=ts),a}function b0(a,r,c){var p=r.pendingProps,S=!1,N=(r.flags&128)!==0,M;if((M=N)||(M=a!==null&&a.memoizedState===null?!1:(wt.current&2)!==0),M&&(S=!0,r.flags&=-129),M=(r.flags&32)!==0,r.flags&=-33,a===null){if(jt){if(S?bi(r):ps(),(a=on)?(a=Kv(a,As),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:hi!==null?{id:On,overflow:br}:null,retryLane:536870912,hydrationErrors:null},c=zo(a),c.return=r,r.child=c,qn=r,on=null)):a=null,a===null)throw Br(r);return Ry(a)?r.lanes=32:r.lanes=536870912,null}var q=p.children;return p=p.fallback,S?(ps(),S=r.mode,q=ff({mode:"hidden",children:q},S),p=qi(p,S,c,null),q.return=r,p.return=r,q.sibling=p,r.child=q,p=r.child,p.memoizedState=Ga(c),p.childLanes=df(a,M,c),r.memoizedState=wp,Kr(null,p)):(bi(r),vc(r,q))}var X=a.memoizedState;if(X!==null&&(q=X.dehydrated,q!==null)){if(N)r.flags&256?(bi(r),r.flags&=-257,r=Ep(a,r,c)):r.memoizedState!==null?(ps(),r.child=a.child,r.flags|=128,r=null):(ps(),q=p.fallback,S=r.mode,p=ff({mode:"visible",children:p.children},S),q=qi(q,S,c,null),q.flags|=2,p.return=r,q.return=r,p.sibling=q,r.child=p,yi(r,a.child,null,c),p=r.child,p.memoizedState=Ga(c),p.childLanes=df(a,M,c),r.memoizedState=wp,r=Kr(null,p));else if(bi(r),Ry(q)){if(M=q.nextSibling&&q.nextSibling.dataset,M)var oe=M.dgst;M=oe,p=Error(s(419)),p.stack="",p.digest=M,Gr({value:p,source:null,stack:null}),r=Ep(a,r,c)}else if(na||Vr(a,r,c,!1),M=(c&a.childLanes)!==0,na||M){if(M=tt,M!==null&&(p=Gs(M,c),p!==0&&p!==X.retryLane))throw X.retryLane=p,Za(a,p),ht(M,a,p),rf;Ty(q)||eu(),r=Ep(a,r,c)}else Ty(q)?(r.flags|=192,r.child=a.child,r=null):(a=X.treeContext,on=ti(q.nextSibling),qn=r,jt=!0,pi=null,As=!1,a!==null&&Hd(r,a),r=vc(r,p.children),r.flags|=4096);return r}return S?(ps(),q=p.fallback,S=r.mode,X=a.child,oe=X.sibling,p=cs(X,{mode:"hidden",children:p.children}),p.subtreeFlags=X.subtreeFlags&65011712,oe!==null?q=cs(oe,q):(q=qi(q,S,c,null),q.flags|=2),q.return=r,p.return=r,p.sibling=q,r.child=p,Kr(null,p),p=r.child,q=a.child.memoizedState,q===null?q=Ga(c):(S=q.cachePool,S!==null?(X=ta._currentValue,S=S.parent!==X?{parent:X,pool:X}:S):S=Kh(),q={baseLanes:q.baseLanes|c,cachePool:S}),p.memoizedState=q,p.childLanes=df(a,M,c),r.memoizedState=wp,Kr(a.child,p)):(bi(r),c=a.child,a=c.sibling,c=cs(c,{mode:"visible",children:p.children}),c.return=r,c.sibling=null,a!==null&&(M=r.deletions,M===null?(r.deletions=[a],r.flags|=16):M.push(a)),r.child=c,r.memoizedState=null,c)}function vc(a,r){return r=ff({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function ff(a,r){return a=Rn(22,a,null,r),a.lanes=0,a}function Ep(a,r,c){return yi(r,a.child,null,c),a=vc(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function v0(a,r,c){a.lanes|=r;var p=a.alternate;p!==null&&(p.lanes|=r),Bd(a.return,r,c)}function Vl(a,r,c,p,S,N){var M=a.memoizedState;M===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:p,tail:c,tailMode:S,treeForkCount:N}:(M.isBackwards=r,M.rendering=null,M.renderingStartTime=0,M.last=p,M.tail=c,M.tailMode=S,M.treeForkCount=N)}function gs(a,r,c){var p=r.pendingProps,S=p.revealOrder,N=p.tail;p=p.children;var M=wt.current,q=(M&2)!==0;if(q?(M=M&1|2,r.flags|=128):M&=1,he(wt,M),Na(a,r,p,c),p=jt?Lo:0,!q&&a!==null&&(a.flags&128)!==0)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&v0(a,c,r);else if(a.tag===19)v0(a,c,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(c=r.child,S=null;c!==null;)a=c.alternate,a!==null&&Ds(a)===null&&(S=c),c=c.sibling;c=S,c===null?(S=r.child,r.child=null):(S=c.sibling,c.sibling=null),Vl(r,!1,S,c,N,p);break;case"backwards":case"unstable_legacy-backwards":for(c=null,S=r.child,r.child=null;S!==null;){if(a=S.alternate,a!==null&&Ds(a)===null){r.child=S;break}a=S.sibling,S.sibling=c,c=S,S=a}Vl(r,!0,c,null,N,p);break;case"together":Vl(r,!1,null,null,void 0,p);break;default:r.memoizedState=null}return r.child}function In(a,r,c){if(a!==null&&(r.dependencies=a.dependencies),Wr|=r.lanes,(c&r.childLanes)===0)if(a!==null){if(Vr(a,r,c,!1),(c&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,c=cs(a,a.pendingProps),r.child=c,c.return=r;a.sibling!==null;)a=a.sibling,c=c.sibling=cs(a,a.pendingProps),c.return=r;c.sibling=null}return r.child}function hf(a,r){return(a.lanes&r)!==0?!0:(a=a.dependencies,!!(a!==null&&oc(a)))}function gy(a,r,c){switch(r.tag){case 3:nt(r,r.stateNode.containerInfo),mi(r,ta,a.memoizedState.cache),Pi();break;case 27:case 5:Vt(r);break;case 4:nt(r,r.stateNode.containerInfo);break;case 10:mi(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,Ih(r),null;break;case 13:var p=r.memoizedState;if(p!==null)return p.dehydrated!==null?(bi(r),r.flags|=128,null):(c&r.child.childLanes)!==0?b0(a,r,c):(bi(r),a=In(a,r,c),a!==null?a.sibling:null);bi(r);break;case 19:var S=(a.flags&128)!==0;if(p=(c&r.childLanes)!==0,p||(Vr(a,r,c,!1),p=(c&r.childLanes)!==0),S){if(p)return gs(a,r,c);r.flags|=128}if(S=r.memoizedState,S!==null&&(S.rendering=null,S.tail=null,S.lastEffect=null),he(wt,wt.current),p)break;return null;case 22:return r.lanes=0,Pl(a,r,c,r.pendingProps);case 24:mi(r,ta,a.memoizedState.cache)}return In(a,r,c)}function pf(a,r,c){if(a!==null)if(a.memoizedProps!==r.pendingProps)na=!0;else{if(!hf(a,c)&&(r.flags&128)===0)return na=!1,gy(a,r,c);na=(a.flags&131072)!==0}else na=!1,jt&&(r.flags&1048576)!==0&&Eg(r,Lo,r.index);switch(r.lanes=0,r.tag){case 16:e:{var p=r.pendingProps;if(a=Dl(r.elementType),r.type=a,typeof a=="function")zd(a)?(p=Ii(a,p),r.tag=1,r=cf(null,r,a,p,c)):(r.tag=0,r=Fo(null,r,a,p,c));else{if(a!=null){var S=a.$$typeof;if(S===k){r.tag=11,r=jp(null,r,a,p,c);break e}else if(S===B){r.tag=14,r=Gl(null,r,a,p,c);break e}}throw r=le(a)||a,Error(s(306,r,""))}}return r;case 0:return Fo(a,r,r.type,r.pendingProps,c);case 1:return p=r.type,S=Ii(p,r.pendingProps),cf(a,r,p,S,c);case 3:e:{if(nt(r,r.stateNode.containerInfo),a===null)throw Error(s(387));p=r.pendingProps;var N=r.memoizedState;S=N.element,Xh(a,r),Po(r,p,null,c);var M=r.memoizedState;if(p=M.cache,mi(r,ta,p),p!==N.cache&&Gd(r,[ta],c,!0),hc(),p=M.element,N.isDehydrated)if(N={element:p,isDehydrated:!1,cache:M.cache},r.updateQueue.baseState=N,r.memoizedState=N,r.flags&256){r=x0(a,r,p,c);break e}else if(p!==S){S=Os(Error(s(424)),r),Gr(S),r=x0(a,r,p,c);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=ti(a.firstChild),qn=r,jt=!0,pi=null,As=!0,c=Xd(r,null,p,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Pi(),p===S){r=In(a,r,c);break e}Na(a,r,p,c)}r=r.child}return r;case 26:return Yl(a,r),a===null?(c=Wv(r.type,null,r.pendingProps,null))?r.memoizedState=c:jt||(c=r.type,a=r.pendingProps,p=C0(je.current).createElement(c),p[Fe]=r,p[ut]=a,as(p,c,a),En(p),r.stateNode=p):r.memoizedState=Wv(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return Vt(r),a===null&&jt&&(p=r.stateNode=Zv(r.type,r.pendingProps,je.current),qn=r,As=!0,S=on,su(r.type)?(Oy=S,on=ti(p.firstChild)):on=S),Na(a,r,r.pendingProps.children,c),Yl(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&jt&&((S=p=on)&&(p=f7(p,r.type,r.pendingProps,As),p!==null?(r.stateNode=p,qn=r,on=ti(p.firstChild),As=!1,S=!0):S=!1),S||Br(r)),Vt(r),S=r.type,N=r.pendingProps,M=a!==null?a.memoizedProps:null,p=N.children,jy(S,N)?p=null:M!==null&&jy(S,M)&&(r.flags|=32),r.memoizedState!==null&&(S=Id(a,r,Bl,null,null,c),Hp._currentValue=S),Yl(a,r),Na(a,r,p,c),r.child;case 6:return a===null&&jt&&((a=c=on)&&(c=h7(c,r.pendingProps,As),c!==null?(r.stateNode=c,qn=r,on=null,a=!0):a=!1),a||Br(r)),null;case 13:return b0(a,r,c);case 4:return nt(r,r.stateNode.containerInfo),p=r.pendingProps,a===null?r.child=yi(r,null,p,c):Na(a,r,p,c),r.child;case 11:return jp(a,r,r.type,r.pendingProps,c);case 7:return Na(a,r,r.pendingProps,c),r.child;case 8:return Na(a,r,r.pendingProps.children,c),r.child;case 12:return Na(a,r,r.pendingProps.children,c),r.child;case 10:return p=r.pendingProps,mi(r,r.type,p.value),Na(a,r,p.children,c),r.child;case 9:return S=r.type._context,p=r.pendingProps.children,Vi(r),S=We(S),p=p(S),r.flags|=1,Na(a,r,p,c),r.child;case 14:return Gl(a,r,r.type,r.pendingProps,c);case 15:return lf(a,r,r.type,r.pendingProps,c);case 19:return gs(a,r,c);case 31:return uf(a,r,c);case 22:return Pl(a,r,c,r.pendingProps);case 24:return Vi(r),p=We(ta),a===null?(S=Yd(),S===null&&(S=tt,N=Ph(),S.pooledCache=N,N.refCount++,N!==null&&(S.pooledCacheLanes|=c),S=N),r.memoizedState={parent:p,cache:S},fc(r),mi(r,ta,S)):((a.lanes&c)!==0&&(Xh(a,r),Po(r,null,null,c),hc()),S=a.memoizedState,N=r.memoizedState,S.parent!==p?(S={parent:p,cache:p},r.memoizedState=S,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=S),mi(r,ta,p)):(p=N.cache,mi(r,ta,p),p!==S.cache&&Gd(r,[ta],c,!0))),Na(a,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function Xr(a){a.flags|=4}function Sc(a,r,c,p,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(zn())a.flags|=8192;else throw Qr=Vd,cc}else a.flags&=-16777217}function Tp(a,r){if(r.type!=="stylesheet"||(r.state.loading&4)!==0)a.flags&=-16777217;else if(a.flags|=16777216,!a2(r))if(zn())a.flags|=8192;else throw Qr=Vd,cc}function Si(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?rn():536870912,a.lanes|=r,mn|=r)}function Fr(a,r){if(!jt)switch(a.tailMode){case"hidden":r=a.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var p=null;c!==null;)c.alternate!==null&&(p=c),c=c.sibling;p===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:p.sibling=null}}function nn(a){var r=a.alternate!==null&&a.alternate.child===a.child,c=0,p=0;if(r)for(var S=a.child;S!==null;)c|=S.lanes|S.childLanes,p|=S.subtreeFlags&65011712,p|=S.flags&65011712,S.return=a,S=S.sibling;else for(S=a.child;S!==null;)c|=S.lanes|S.childLanes,p|=S.subtreeFlags,p|=S.flags,S.return=a,S=S.sibling;return a.subtreeFlags|=p,a.childLanes=c,r}function Nc(a,r,c){var p=r.pendingProps;switch(Ud(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 c=r.stateNode,p=null,a!==null&&(p=a.memoizedState.cache),r.memoizedState.cache!==p&&(r.flags|=2048),Yr(ta),ze(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(Ho(r)?Xr(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?(Xr(r),N!==null?(nn(r),Tp(r,N)):(nn(r),Sc(r,S,null,p,c))):N?N!==a.memoizedState?(Xr(r),nn(r),Tp(r,N)):(nn(r),r.flags&=-16777217):(a=a.memoizedProps,a!==p&&Xr(r),nn(r),Sc(r,S,a,p,c)),null;case 27:if($e(r),c=je.current,S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==p&&Xr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return nn(r),null}a=re.current,Ho(r)?Tg(r):(a=Zv(S,p,c),r.stateNode=a,Xr(r))}return nn(r),null;case 5:if($e(r),S=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==p&&Xr(r);else{if(!p){if(r.stateNode===null)throw Error(s(166));return nn(r),null}if(N=re.current,Ho(r))Tg(r);else{var M=C0(je.current);switch(N){case 1:N=M.createElementNS("http://www.w3.org/2000/svg",S);break;case 2:N=M.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;default:switch(S){case"svg":N=M.createElementNS("http://www.w3.org/2000/svg",S);break;case"math":N=M.createElementNS("http://www.w3.org/1998/Math/MathML",S);break;case"script":N=M.createElement("div"),N.innerHTML="<script><\/script>",N=N.removeChild(N.firstChild);break;case"select":N=typeof p.is=="string"?M.createElement("select",{is:p.is}):M.createElement("select"),p.multiple?N.multiple=!0:p.size&&(N.size=p.size);break;default:N=typeof p.is=="string"?M.createElement(S,{is:p.is}):M.createElement(S)}}N[Fe]=r,N[ut]=p;e:for(M=r.child;M!==null;){if(M.tag===5||M.tag===6)N.appendChild(M.stateNode);else if(M.tag!==4&&M.tag!==27&&M.child!==null){M.child.return=M,M=M.child;continue}if(M===r)break e;for(;M.sibling===null;){if(M.return===null||M.return===r)break e;M=M.return}M.sibling.return=M.return,M=M.sibling}r.stateNode=N;e:switch(as(N,S,p),S){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Xr(r)}}return nn(r),Sc(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,c),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==p&&Xr(r);else{if(typeof p!="string"&&r.stateNode===null)throw Error(s(166));if(a=je.current,Ho(r)){if(a=r.stateNode,c=r.memoizedProps,p=null,S=qn,S!==null)switch(S.tag){case 27:case 5:p=S.memoizedProps}a[Fe]=r,a=!!(a.nodeValue===c||p!==null&&p.suppressHydrationWarning===!0||Hv(a.nodeValue,c)),a||Br(r,!0)}else a=C0(a).createTextNode(p),a[Fe]=r,r.stateNode=a}return nn(r),null;case 31:if(c=r.memoizedState,a===null||a.memoizedState!==null){if(p=Ho(r),c!==null){if(a===null){if(!p)throw Error(s(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[Fe]=r}else Pi(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;nn(r),a=!1}else c=qd(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return r.flags&256?(Fn(r),r):(Fn(r),null);if((r.flags&128)!==0)throw Error(s(558))}return nn(r),null;case 13:if(p=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(S=Ho(r),p!==null&&p.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 Pi(),(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?(Fn(r),r):(Fn(r),null)}return Fn(r),(r.flags&128)!==0?(r.lanes=c,r):(c=p!==null,a=a!==null&&a.memoizedState!==null,c&&(p=r.child,S=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(S=p.alternate.memoizedState.cachePool.pool),N=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(N=p.memoizedState.cachePool.pool),N!==S&&(p.flags|=2048)),c!==a&&c&&(r.child.flags|=8192),Si(r,r.updateQueue),nn(r),null);case 4:return ze(),a===null&&vy(r.stateNode.containerInfo),nn(r),null;case 10:return Yr(r.type),nn(r),null;case 19:if(W(wt),p=r.memoizedState,p===null)return nn(r),null;if(S=(r.flags&128)!==0,N=p.rendering,N===null)if(S)Fr(p,!1);else{if(Mn!==0||a!==null&&(a.flags&128)!==0)for(a=r.child;a!==null;){if(N=Ds(a),N!==null){for(r.flags|=128,Fr(p,!1),a=N.updateQueue,r.updateQueue=a,Si(r,a),r.subtreeFlags=0,a=c,c=r.child;c!==null;)Do(c,a),c=c.sibling;return he(wt,wt.current&1|2),jt&&Hr(r,p.treeForkCount),r.child}a=a.sibling}p.tail!==null&&Kn()>Jn&&(r.flags|=128,S=!0,Fr(p,!1),r.lanes=4194304)}else{if(!S)if(a=Ds(N),a!==null){if(r.flags|=128,S=!0,a=a.updateQueue,r.updateQueue=a,Si(r,a),Fr(p,!0),p.tail===null&&p.tailMode==="hidden"&&!N.alternate&&!jt)return nn(r),null}else 2*Kn()-p.renderingStartTime>Jn&&c!==536870912&&(r.flags|=128,S=!0,Fr(p,!1),r.lanes=4194304);p.isBackwards?(N.sibling=r.child,r.child=N):(a=p.last,a!==null?a.sibling=N:r.child=N,p.last=N)}return p.tail!==null?(a=p.tail,p.rendering=a,p.tail=a.sibling,p.renderingStartTime=Kn(),a.sibling=null,c=wt.current,he(wt,S?c&1|2:c&1),jt&&Hr(r,p.treeForkCount),a):(nn(r),null);case 22:case 23:return Fn(r),pc(),p=r.memoizedState!==null,a!==null?a.memoizedState!==null!==p&&(r.flags|=8192):p&&(r.flags|=8192),p?(c&536870912)!==0&&(r.flags&128)===0&&(nn(r),r.subtreeFlags&6&&(r.flags|=8192)):nn(r),c=r.updateQueue,c!==null&&Si(r,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),p=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(p=r.memoizedState.cachePool.pool),p!==c&&(r.flags|=2048),a!==null&&W(Qi),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Yr(ta),nn(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function $s(a,r){switch(Ud(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Yr(ta),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(Fn(r),r.alternate===null)throw Error(s(340));Pi()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Fn(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Pi()}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 Yr(r.type),null;case 22:case 23:return Fn(r),pc(),a!==null&&W(Qi),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Yr(ta),null;case 25:return null;default:return null}}function zs(a,r){switch(Ud(r),r.tag){case 3:Yr(ta),ze();break;case 26:case 27:case 5:$e(r);break;case 4:ze();break;case 31:r.memoizedState!==null&&Fn(r);break;case 13:Fn(r);break;case 19:W(wt);break;case 10:Yr(r.type);break;case 22:case 23:Fn(r),pc(),a!==null&&W(Qi);break;case 24:Yr(ta)}}function er(a,r){try{var c=r.updateQueue,p=c!==null?c.lastEffect:null;if(p!==null){var S=p.next;c=S;do{if((c.tag&a)===a){p=void 0;var N=c.create,M=c.inst;p=N(),M.destroy=p}c=c.next}while(c!==S)}}catch(q){Ut(r,r.return,q)}}function Aa(a,r,c){try{var p=r.updateQueue,S=p!==null?p.lastEffect:null;if(S!==null){var N=S.next;p=N;do{if((p.tag&a)===a){var M=p.inst,q=M.destroy;if(q!==void 0){M.destroy=void 0,S=r;var X=c,oe=q;try{oe()}catch(xe){Ut(S,X,xe)}}}p=p.next}while(p!==N)}}catch(xe){Ut(r,r.return,xe)}}function vr(a){var r=a.updateQueue;if(r!==null){var c=a.stateNode;try{Dg(r,c)}catch(p){Ut(a,a.return,p)}}}function _a(a,r,c){c.props=Ii(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(p){Ut(a,r,p)}}function Ni(a,r){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var p=a.stateNode;break;case 30:p=a.stateNode;break;default:p=a.stateNode}typeof c=="function"?a.refCleanup=c(p):c.current=p}}catch(S){Ut(a,r,S)}}function Ma(a,r){var c=a.ref,p=a.refCleanup;if(c!==null)if(typeof p=="function")try{p()}catch(S){Ut(a,r,S)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(S){Ut(a,r,S)}else c.current=null}function _c(a){var r=a.type,c=a.memoizedProps,p=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&p.focus();break e;case"img":c.src?p.src=c.src:c.srcSet&&(p.srcset=c.srcSet)}}catch(S){Ut(a,a.return,S)}}function da(a,r,c){try{var p=a.stateNode;i7(p,a.type,c,r),p[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&&su(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&&su(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 Zr(a,r,c){var p=a.tag;if(p===5||p===6)a=a.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(a),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=ci));else if(p!==4&&(p===27&&su(a.type)&&(c=a.stateNode,r=null),a=a.child,a!==null))for(Zr(a,r,c),a=a.sibling;a!==null;)Zr(a,r,c),a=a.sibling}function Wa(a,r,c){var p=a.tag;if(p===5||p===6)a=a.stateNode,r?c.insertBefore(a,r):c.appendChild(a);else if(p!==4&&(p===27&&su(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(Wa(a,r,c),a=a.sibling;a!==null;)Wa(a,r,c),a=a.sibling}function mf(a){var r=a.stateNode,c=a.memoizedProps;try{for(var p=a.type,S=r.attributes;S.length;)r.removeAttributeNode(S[0]);as(r,p,c),r[Fe]=a,r[ut]=c}catch(N){Ut(a,a.return,N)}}var tr=!1,un=!1,Sr=!1,S0=typeof WeakSet=="function"?WeakSet:Set,Ca=null;function yy(a,r){if(a=a.containerInfo,_y=A0,a=_g(a),Uh(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var p=c.getSelection&&c.getSelection();if(p&&p.rangeCount!==0){c=p.anchorNode;var S=p.anchorOffset,N=p.focusNode;p=p.focusOffset;try{c.nodeType,N.nodeType}catch{c=null;break e}var M=0,q=-1,X=-1,oe=0,xe=0,ve=a,fe=null;t:for(;;){for(var ye;ve!==c||S!==0&&ve.nodeType!==3||(q=M+S),ve!==N||p!==0&&ve.nodeType!==3||(X=M+p),ve.nodeType===3&&(M+=ve.nodeValue.length),(ye=ve.firstChild)!==null;)fe=ve,ve=ye;for(;;){if(ve===a)break t;if(fe===c&&++oe===S&&(q=M),fe===N&&++xe===p&&(X=M),(ye=ve.nextSibling)!==null)break;ve=fe,fe=ve.parentNode}ve=ye}c=q===-1||X===-1?null:{start:q,end:X}}else c=null}c=c||{start:0,end:0}}else c=null;for(Cy={focusedElem:a,selectionRange:c},A0=!1,Ca=r;Ca!==null;)if(r=Ca,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,Ca=a;else for(;Ca!==null;){switch(r=Ca,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(c=0;c<a.length;c++)S=a[c],S.ref.impl=S.nextImpl;break;case 11:case 15:break;case 1:if((a&1024)!==0&&N!==null){a=void 0,c=r,S=N.memoizedProps,N=N.memoizedState,p=c.stateNode;try{var qe=Ii(c.type,S);a=p.getSnapshotBeforeUpdate(qe,N),p.__reactInternalSnapshotBeforeUpdate=a}catch(Ie){Ut(c,c.return,Ie)}}break;case 3:if((a&1024)!==0){if(a=r.stateNode.containerInfo,c=a.nodeType,c===9)Ey(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Ey(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,Ca=a;break}Ca=r.return}}function Nn(a,r,c){var p=c.flags;switch(c.tag){case 0:case 11:case 15:sr(a,c),p&4&&er(5,c);break;case 1:if(sr(a,c),p&4)if(a=c.stateNode,r===null)try{a.componentDidMount()}catch(M){Ut(c,c.return,M)}else{var S=Ii(c.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(S,r,a.__reactInternalSnapshotBeforeUpdate)}catch(M){Ut(c,c.return,M)}}p&64&&vr(c),p&512&&Ni(c,c.return);break;case 3:if(sr(a,c),p&64&&(a=c.updateQueue,a!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{Dg(a,r)}catch(M){Ut(c,c.return,M)}}break;case 27:r===null&&p&4&&mf(c);case 26:case 5:sr(a,c),r===null&&p&4&&_c(c),p&512&&Ni(c,c.return);break;case 12:sr(a,c);break;case 31:sr(a,c),p&4&&Ji(a,c);break;case 13:sr(a,c),p&4&&Zo(a,c),p&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=g.bind(null,c),p7(a,c))));break;case 22:if(p=c.memoizedState!==null||tr,!p){r=r!==null&&r.memoizedState!==null||un,S=tr;var N=un;tr=p,(un=r)&&!N?$a(a,c,(c.subtreeFlags&8772)!==0):sr(a,c),tr=S,un=N}break;case 30:break;default:sr(a,c)}}function Cc(a){var r=a.alternate;r!==null&&(a.alternate=null,Cc(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Ps(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 It=null,Pa=!1;function nr(a,r,c){for(c=c.child;c!==null;)gf(a,r,c),c=c.sibling}function gf(a,r,c){if(ea&&typeof ea.onCommitFiberUnmount=="function")try{ea.onCommitFiberUnmount(Bs,c)}catch{}switch(c.tag){case 26:un||Ma(c,r),nr(a,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:un||Ma(c,r);var p=It,S=Pa;su(c.type)&&(It=c.stateNode,Pa=!1),nr(a,r,c),kp(c.stateNode),It=p,Pa=S;break;case 5:un||Ma(c,r);case 6:if(p=It,S=Pa,It=null,nr(a,r,c),It=p,Pa=S,It!==null)if(Pa)try{(It.nodeType===9?It.body:It.nodeName==="HTML"?It.ownerDocument.body:It).removeChild(c.stateNode)}catch(N){Ut(c,r,N)}else try{It.removeChild(c.stateNode)}catch(N){Ut(c,r,N)}break;case 18:It!==null&&(Pa?(a=It,Vv(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),Cf(a)):Vv(It,c.stateNode));break;case 4:p=It,S=Pa,It=c.stateNode.containerInfo,Pa=!0,nr(a,r,c),It=p,Pa=S;break;case 0:case 11:case 14:case 15:Aa(2,c,r),un||Aa(4,c,r),nr(a,r,c);break;case 1:un||(Ma(c,r),p=c.stateNode,typeof p.componentWillUnmount=="function"&&_a(c,r,p)),nr(a,r,c);break;case 21:nr(a,r,c);break;case 22:un=(p=un)||c.memoizedState!==null,nr(a,r,c),un=p;break;default:nr(a,r,c)}}function Ji(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Cf(a)}catch(c){Ut(r,r.return,c)}}}function Zo(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Cf(a)}catch(c){Ut(r,r.return,c)}}function Rp(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new S0),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new S0),r;default:throw Error(s(435,a.tag))}}function _i(a,r){var c=Rp(a);r.forEach(function(p){if(!c.has(p)){c.add(p);var S=x.bind(null,a,p);p.then(S,S)}})}function fa(a,r){var c=r.deletions;if(c!==null)for(var p=0;p<c.length;p++){var S=c[p],N=a,M=r,q=M;e:for(;q!==null;){switch(q.tag){case 27:if(su(q.type)){It=q.stateNode,Pa=!1;break e}break;case 5:It=q.stateNode,Pa=!1;break e;case 3:case 4:It=q.stateNode.containerInfo,Pa=!0;break e}q=q.return}if(It===null)throw Error(s(160));gf(N,M,S),It=null,Pa=!1,N=S.alternate,N!==null&&(N.return=null),S.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)Wi(r,a),r=r.sibling}var ar=null;function Wi(a,r){var c=a.alternate,p=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:fa(r,a),ha(a),p&4&&(Aa(3,a,a.return),er(3,a),Aa(5,a,a.return));break;case 1:fa(r,a),ha(a),p&512&&(un||c===null||Ma(c,c.return)),p&64&&tr&&(a=a.updateQueue,a!==null&&(p=a.callbacks,p!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?p:c.concat(p))));break;case 26:var S=ar;if(fa(r,a),ha(a),p&512&&(un||c===null||Ma(c,c.return)),p&4){var N=c!==null?c.memoizedState:null;if(p=a.memoizedState,c===null)if(p===null)if(a.stateNode===null){e:{p=a.type,c=a.memoizedProps,S=S.ownerDocument||S;t:switch(p){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(p),S.head.insertBefore(N,S.querySelector("head > title"))),as(N,p,c),N[Fe]=a,En(N),p=N;break e;case"link":var M=t2("link","href",S).get(p+(c.href||""));if(M){for(var q=0;q<M.length;q++)if(N=M[q],N.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&N.getAttribute("rel")===(c.rel==null?null:c.rel)&&N.getAttribute("title")===(c.title==null?null:c.title)&&N.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){M.splice(q,1);break t}}N=S.createElement(p),as(N,p,c),S.head.appendChild(N);break;case"meta":if(M=t2("meta","content",S).get(p+(c.content||""))){for(q=0;q<M.length;q++)if(N=M[q],N.getAttribute("content")===(c.content==null?null:""+c.content)&&N.getAttribute("name")===(c.name==null?null:c.name)&&N.getAttribute("property")===(c.property==null?null:c.property)&&N.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&N.getAttribute("charset")===(c.charSet==null?null:c.charSet)){M.splice(q,1);break t}}N=S.createElement(p),as(N,p,c),S.head.appendChild(N);break;default:throw Error(s(468,p))}N[Fe]=a,En(N),p=N}a.stateNode=p}else n2(S,a.type,a.stateNode);else a.stateNode=e2(S,p,a.memoizedProps);else N!==p?(N===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):N.count--,p===null?n2(S,a.type,a.stateNode):e2(S,p,a.memoizedProps)):p===null&&a.stateNode!==null&&da(a,a.memoizedProps,c.memoizedProps)}break;case 27:fa(r,a),ha(a),p&512&&(un||c===null||Ma(c,c.return)),c!==null&&p&4&&da(a,a.memoizedProps,c.memoizedProps);break;case 5:if(fa(r,a),ha(a),p&512&&(un||c===null||Ma(c,c.return)),a.flags&32){S=a.stateNode;try{_l(S,"")}catch(qe){Ut(a,a.return,qe)}}p&4&&a.stateNode!=null&&(S=a.memoizedProps,da(a,S,c!==null?c.memoizedProps:S)),p&1024&&(Sr=!0);break;case 6:if(fa(r,a),ha(a),p&4){if(a.stateNode===null)throw Error(s(162));p=a.memoizedProps,c=a.stateNode;try{c.nodeValue=p}catch(qe){Ut(a,a.return,qe)}}break;case 3:if(E0=null,S=ar,ar=j0(r.containerInfo),fa(r,a),ar=S,ha(a),p&4&&c!==null&&c.memoizedState.isDehydrated)try{Cf(r.containerInfo)}catch(qe){Ut(a,a.return,qe)}Sr&&(Sr=!1,yf(a));break;case 4:p=ar,ar=j0(a.stateNode.containerInfo),fa(r,a),ha(a),ar=p;break;case 12:fa(r,a),ha(a);break;case 31:fa(r,a),ha(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));break;case 13:fa(r,a),ha(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Io=Kn()),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));break;case 22:S=a.memoizedState!==null;var X=c!==null&&c.memoizedState!==null,oe=tr,xe=un;if(tr=oe||S,un=xe||X,fa(r,a),un=xe,tr=oe,ha(a),p&8192)e:for(r=a.stateNode,r._visibility=S?r._visibility&-2:r._visibility|1,S&&(c===null||X||tr||un||Ir(a)),c=null,r=a;;){if(r.tag===5||r.tag===26){if(c===null){X=c=r;try{if(N=X.stateNode,S)M=N.style,typeof M.setProperty=="function"?M.setProperty("display","none","important"):M.display="none";else{q=X.stateNode;var ve=X.memoizedProps.style,fe=ve!=null&&ve.hasOwnProperty("display")?ve.display:null;q.style.display=fe==null||typeof fe=="boolean"?"":(""+fe).trim()}}catch(qe){Ut(X,X.return,qe)}}}else if(r.tag===6){if(c===null){X=r;try{X.stateNode.nodeValue=S?"":X.memoizedProps}catch(qe){Ut(X,X.return,qe)}}}else if(r.tag===18){if(c===null){X=r;try{var ye=X.stateNode;S?Qv(ye,!0):Qv(X.stateNode,!1)}catch(qe){Ut(X,X.return,qe)}}}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;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}p&4&&(p=a.updateQueue,p!==null&&(c=p.retryQueue,c!==null&&(p.retryQueue=null,_i(a,c))));break;case 19:fa(r,a),ha(a),p&4&&(p=a.updateQueue,p!==null&&(a.updateQueue=null,_i(a,p)));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 c,p=a.return;p!==null;){if(Sn(p)){c=p;break}p=p.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var S=c.stateNode,N=Nt(a);Wa(a,N,S);break;case 5:var M=c.stateNode;c.flags&32&&(_l(M,""),c.flags&=-33);var q=Nt(a);Wa(a,q,M);break;case 3:case 4:var X=c.stateNode.containerInfo,oe=Nt(a);Zr(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 yf(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;yf(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function sr(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Nn(a,r.alternate,r),r=r.sibling}function Ir(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Aa(4,r,r.return),Ir(r);break;case 1:Ma(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&_a(r,r.return,c),Ir(r);break;case 27:kp(r.stateNode);case 26:case 5:Ma(r,r.return),Ir(r);break;case 22:r.memoizedState===null&&Ir(r);break;case 30:Ir(r);break;default:Ir(r)}a=a.sibling}}function $a(a,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var p=r.alternate,S=a,N=r,M=N.flags;switch(N.tag){case 0:case 11:case 15:$a(S,N,c),er(4,N);break;case 1:if($a(S,N,c),p=N,S=p.stateNode,typeof S.componentDidMount=="function")try{S.componentDidMount()}catch(oe){Ut(p,p.return,oe)}if(p=N,S=p.updateQueue,S!==null){var q=p.stateNode;try{var X=S.shared.hiddenCallbacks;if(X!==null)for(S.shared.hiddenCallbacks=null,S=0;S<X.length;S++)Yo(X[S],q)}catch(oe){Ut(p,p.return,oe)}}c&&M&64&&vr(N),Ni(N,N.return);break;case 27:mf(N);case 26:case 5:$a(S,N,c),c&&p===null&&M&4&&_c(N),Ni(N,N.return);break;case 12:$a(S,N,c);break;case 31:$a(S,N,c),c&&M&4&&Ji(S,N);break;case 13:$a(S,N,c),c&&M&4&&Zo(S,N);break;case 22:N.memoizedState===null&&$a(S,N,c),Ni(N,N.return);break;case 30:break;default:$a(S,N,c)}r=r.sibling}}function $i(a,r){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Al(c))}function Ql(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Al(a))}function Da(a,r,c,p){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Op(a,r,c,p),r=r.sibling}function Op(a,r,c,p){var S=r.flags;switch(r.tag){case 0:case 11:case 15:Da(a,r,c,p),S&2048&&er(9,r);break;case 1:Da(a,r,c,p);break;case 3:Da(a,r,c,p),S&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Al(a)));break;case 12:if(S&2048){Da(a,r,c,p),a=r.stateNode;try{var N=r.memoizedProps,M=N.id,q=N.onPostCommit;typeof q=="function"&&q(M,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(X){Ut(r,r.return,X)}}else Da(a,r,c,p);break;case 31:Da(a,r,c,p);break;case 13:Da(a,r,c,p);break;case 23:break;case 22:N=r.stateNode,M=r.alternate,r.memoizedState!==null?N._visibility&2?Da(a,r,c,p):Jr(a,r):N._visibility&2?Da(a,r,c,p):(N._visibility|=2,za(a,r,c,p,(r.subtreeFlags&10256)!==0||!1)),S&2048&&$i(M,r);break;case 24:Da(a,r,c,p),S&2048&&Ql(r.alternate,r);break;default:Da(a,r,c,p)}}function za(a,r,c,p,S){for(S=S&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var N=a,M=r,q=c,X=p,oe=M.flags;switch(M.tag){case 0:case 11:case 15:za(N,M,q,X,S),er(8,M);break;case 23:break;case 22:var xe=M.stateNode;M.memoizedState!==null?xe._visibility&2?za(N,M,q,X,S):Jr(N,M):(xe._visibility|=2,za(N,M,q,X,S)),S&&oe&2048&&$i(M.alternate,M);break;case 24:za(N,M,q,X,S),S&&oe&2048&&Ql(M.alternate,M);break;default:za(N,M,q,X,S)}r=r.sibling}}function Jr(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=a,p=r,S=p.flags;switch(p.tag){case 22:Jr(c,p),S&2048&&$i(p.alternate,p);break;case 24:Jr(c,p),S&2048&&Ql(p.alternate,p);break;default:Jr(c,p)}r=r.sibling}}var Kl=8192;function ks(a,r,c){if(a.subtreeFlags&Kl)for(a=a.child;a!==null;)xf(a,r,c),a=a.sibling}function xf(a,r,c){switch(a.tag){case 26:ks(a,r,c),a.flags&Kl&&a.memoizedState!==null&&w7(c,ar,a.memoizedState,a.memoizedProps);break;case 5:ks(a,r,c);break;case 3:case 4:var p=ar;ar=j0(a.stateNode.containerInfo),ks(a,r,c),ar=p;break;case 22:a.memoizedState===null&&(p=a.alternate,p!==null&&p.memoizedState!==null?(p=Kl,Kl=16777216,ks(a,r,c),Kl=p):ks(a,r,c));break;default:ks(a,r,c)}}function Xl(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 el(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];Ca=p,Bn(p,a)}Xl(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)ys(a),a=a.sibling}function ys(a){switch(a.tag){case 0:case 11:case 15:el(a),a.flags&2048&&Aa(9,a,a.return);break;case 3:el(a);break;case 12:el(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)):el(a);break;default:el(a)}}function es(a){var r=a.deletions;if((a.flags&16)!==0){if(r!==null)for(var c=0;c<r.length;c++){var p=r[c];Ca=p,Bn(p,a)}Xl(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Aa(8,r,r.return),es(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,es(r));break;default:es(r)}a=a.sibling}}function Bn(a,r){for(;Ca!==null;){var c=Ca;switch(c.tag){case 0:case 11:case 15:Aa(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var p=c.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:Al(c.memoizedState.cache)}if(p=c.child,p!==null)p.return=c,Ca=p;else e:for(c=a;Ca!==null;){p=Ca;var S=p.sibling,N=p.return;if(Cc(p),p===c){Ca=null;break e}if(S!==null){S.return=N,Ca=S;break e}Ca=N}}}var Ci={getCacheForType:function(a){var r=We(ta),c=r.data.get(a);return c===void 0&&(c=a(),r.data.set(a,c)),c},cacheSignal:function(){return We(ta).controller.signal}},it=typeof WeakMap=="function"?WeakMap:Map,Ye=0,tt=null,ft=null,ct=0,Rt=0,Ya=null,rr=!1,Nr=!1,Ap=!1,Ls=0,Mn=0,Wr=0,tl=0,jc=0,ts=0,mn=0,Fl=null,Gn=null,Pn=!1,Io=0,Mp=0,Jn=1/0,Dn=null,Wn=null,Jt=0,Us=null,Jo=null,ir=0,Wo=0,$o=null,wc=null,nl=0,Zl=null;function Hs(){return(Ye&2)!==0&&ct!==0?ct&-ct:Y.T!==null?pe():Ve()}function bt(){if(ts===0)if((ct&536870912)===0||jt){var a=mr;mr<<=1,(mr&3932160)===0&&(mr=262144),ts=a}else ts=536870912;return a=hs.current,a!==null&&(a.flags|=32),ts}function ht(a,r,c){(a===tt&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)&&(sl(a,0),aa(a,ct,ts,!1)),yn(a,c),((Ye&2)===0||a!==tt)&&(a===tt&&((Ye&2)===0&&(tl|=c),Mn===4&&aa(a,ct,ts,!1)),Ce(a))}function vt(a,r,c){if((Ye&6)!==0)throw Error(s(327));var p=!c&&(r&127)===0&&(r&a.expiredLanes)===0||Mt(a,r),S=p?Ec(a,r):ns(a,r,!0),N=p;do{if(S===0){Nr&&!p&&aa(a,r,0,!1);break}else{if(c=a.current.alternate,N&&!Wt(c)){S=ns(a,r,!1),N=!1;continue}if(S===2){if(N=r,a.errorRecoveryDisabledLanes&N)var M=0;else M=a.pendingLanes&-536870913,M=M!==0?M:M&536870912?536870912:0;if(M!==0){r=M;e:{var q=a;S=Fl;var X=q.current.memoizedState.isDehydrated;if(X&&(sl(q,M).flags|=256),M=ns(q,M,!1),M!==2){if(Ap&&!X){q.errorRecoveryDisabledLanes|=N,tl|=N,S=4;break e}N=Gn,Gn=S,N!==null&&(Gn===null?Gn=N:Gn.push.apply(Gn,N))}S=M}if(N=!1,S!==2)continue}}if(S===1){sl(a,0),aa(a,r,0,!0);break}e:{switch(p=a,N=S,N){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:aa(p,r,ts,!rr);break e;case 2:Gn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(S=Io+300-Kn(),10<S)){if(aa(p,r,ts,!rr),Qt(p,0,!0)!==0)break e;ir=r,p.timeoutHandle=Pv(_t.bind(null,p,c,Gn,Dn,Pn,r,ts,tl,mn,rr,N,"Throttled",-0,0),S);break e}_t(p,c,Gn,Dn,Pn,r,ts,tl,mn,rr,N,null,-0,0)}}break}while(!0);Ce(a)}function _t(a,r,c,p,S,N,M,q,X,oe,xe,ve,fe,ye){if(a.timeoutHandle=-1,ve=r.subtreeFlags,ve&8192||(ve&16785408)===16785408){ve={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ci},xf(r,N,ve);var qe=(N&62914560)===N?Io-Kn():(N&4194048)===N?Mp-Kn():0;if(qe=E7(ve,qe),qe!==null){ir=N,a.cancelPendingCommit=qe(wi.bind(null,a,r,N,c,p,S,M,q,X,xe,ve,null,fe,ye)),aa(a,N,M,!oe);return}}wi(a,r,N,c,p,S,M,q,X)}function Wt(a){for(var r=a;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var p=0;p<c.length;p++){var S=c[p],N=S.getSnapshot;S=S.value;try{if(!Fa(N(),S))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;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 aa(a,r,c,p){r&=~jc,r&=~tl,a.suspendedLanes|=r,a.pingedLanes&=~r,p&&(a.warmLanes|=r),p=a.expirationTimes;for(var S=r;0<S;){var N=31-ba(S),M=1<<N;p[N]=-1,S&=~M}c!==0&&oa(a,c,r)}function _r(){return(Ye&6)===0?(Le(0),!1):!0}function al(){if(ft!==null){if(Rt===0)var a=ft.return;else a=ft,Pr=Yi=null,tp(a),Ll=null,Ul=0,a=ft;for(;a!==null;)zs(a.alternate,a),a=a.return;ft=null}}function sl(a,r){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,u7(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),ir=0,al(),tt=a,ft=c=cs(a.current,null),ct=r,Rt=0,Ya=null,rr=!1,Nr=Mt(a,r),Ap=!1,mn=ts=jc=tl=Wr=Mn=0,Gn=Fl=null,Pn=!1,(r&8)!==0&&(r|=r&32);var p=a.entangledLanes;if(p!==0)for(a=a.entanglements,p&=r;0<p;){var S=31-ba(p),N=1<<S;r|=a[S],p&=~N}return Ls=r,ic(),c}function $r(a,r){rt=null,Y.H=Xo,r===Ml||r===dt?(r=zl(),Rt=3):r===cc?(r=zl(),Rt=4):Rt=r===rf?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ya=r,ft===null&&(Mn=1,sf(a,Os(r,a.current)))}function zn(){var a=hs.current;return a===null?!0:(ct&4194048)===ct?Ja===null:(ct&62914560)===ct||(ct&536870912)!==0?a===Ja:!1}function ji(){var a=Y.H;return Y.H=Xo,a===null?Xo:a}function rl(){var a=Y.A;return Y.A=Ci,a}function eu(){Mn=4,rr||(ct&4194048)!==ct&&hs.current!==null||(Nr=!0),(Wr&134217727)===0&&(tl&134217727)===0||tt===null||aa(tt,ct,ts,!1)}function ns(a,r,c){var p=Ye;Ye|=2;var S=ji(),N=rl();(tt!==a||ct!==r)&&(Dn=null,sl(a,r)),r=!1;var M=Mn;e:do try{if(Rt!==0&&ft!==null){var q=ft,X=Ya;switch(Rt){case 8:al(),M=6;break e;case 3:case 2:case 9:case 6:hs.current===null&&(r=!0);var oe=Rt;if(Rt=0,Ya=null,Il(a,q,X,oe),c&&Nr){M=0;break e}break;default:oe=Rt,Rt=0,Ya=null,Il(a,q,X,oe)}}tu(),M=Mn;break}catch(xe){$r(a,xe)}while(!0);return r&&a.shellSuspendCounter++,Pr=Yi=null,Ye=p,Y.H=S,Y.A=N,ft===null&&(tt=null,ct=0,ic()),M}function tu(){for(;ft!==null;)bf(ft)}function Ec(a,r){var c=Ye;Ye|=2;var p=ji(),S=rl();tt!==a||ct!==r?(Dn=null,Jn=Kn()+500,sl(a,r)):Nr=Mt(a,r);e:do try{if(Rt!==0&&ft!==null){r=ft;var N=Ya;t:switch(Rt){case 1:Rt=0,Ya=null,Il(a,r,N,1);break;case 2:case 9:if(fs(N)){Rt=0,Ya=null,Tc(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:fs(N)?(Rt=0,Ya=null,Tc(r)):(Rt=0,Ya=null,Il(a,r,N,7));break;case 5:var M=null;switch(ft.tag){case 26:M=ft.memoizedState;case 5:case 27:var q=ft;if(M?a2(M):q.stateNode.complete){Rt=0,Ya=null;var X=q.sibling;if(X!==null)ft=X;else{var oe=q.return;oe!==null?(ft=oe,il(oe)):ft=null}break t}}Rt=0,Ya=null,Il(a,r,N,5);break;case 6:Rt=0,Ya=null,Il(a,r,N,6);break;case 8:al(),Mn=6;break e;default:throw Error(s(462))}}xs();break}catch(xe){$r(a,xe)}while(!0);return Pr=Yi=null,Y.H=p,Y.A=S,Ye=c,ft!==null?0:(tt=null,ct=0,ic(),Mn)}function xs(){for(;ft!==null&&!hn();)bf(ft)}function bf(a){var r=pf(a.alternate,a,Ls);a.memoizedProps=a.pendingProps,r===null?il(a):ft=r}function Tc(a){var r=a,c=r.alternate;switch(r.tag){case 15:case 0:r=bc(c,r,r.pendingProps,r.type,void 0,ct);break;case 11:r=bc(c,r,r.pendingProps,r.type.render,r.ref,ct);break;case 5:tp(r);default:zs(c,r),r=ft=Do(r,Ls),r=pf(c,r,Ls)}a.memoizedProps=a.pendingProps,r===null?il(a):ft=r}function Il(a,r,c,p){Pr=Yi=null,tp(r),Ll=null,Ul=0;var S=r.return;try{if(ca(a,S,r,c,ct)){Mn=1,sf(a,Os(c,a.current)),ft=null;return}}catch(N){if(S!==null)throw ft=S,N;Mn=1,sf(a,Os(c,a.current)),ft=null;return}r.flags&32768?(jt||p===1?a=!0:Nr||(ct&536870912)!==0?a=!1:(rr=a=!0,(p===2||p===9||p===3||p===6)&&(p=hs.current,p!==null&&p.tag===13&&(p.flags|=16384))),Rc(r,a)):il(r)}function il(a){var r=a;do{if((r.flags&32768)!==0){Rc(r,rr);return}a=r.return;var c=Nc(r.alternate,r,Ls);if(c!==null){ft=c;return}if(r=r.sibling,r!==null){ft=r;return}ft=r=a}while(r!==null);Mn===0&&(Mn=5)}function Rc(a,r){do{var c=$s(a.alternate,a);if(c!==null){c.flags&=32767,ft=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(a=a.sibling,a!==null)){ft=a;return}ft=a=c}while(a!==null);Mn=6,ft=null}function wi(a,r,c,p,S,N,M,q,X){a.cancelPendingCommit=null;do nu();while(Jt!==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,c,N,M,q,X),a===tt&&(ft=tt=null,ct=0),Jo=r,Us=a,ir=c,Wo=N,$o=S,wc=p,(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?(a.callbackNode=null,a.callbackPriority=0,C(la,function(){return vf(),null})):(a.callbackNode=null,a.callbackPriority=0),p=(r.flags&13878)!==0,(r.subtreeFlags&13878)!==0||p){p=Y.T,Y.T=null,S=$.p,$.p=2,M=Ye,Ye|=4;try{yy(a,r,c)}finally{Ye=M,$.p=S,Y.T=p}}Jt=1,sa(),Ei(),Jl()}}function sa(){if(Jt===1){Jt=0;var a=Us,r=Jo,c=(r.flags&13878)!==0;if((r.subtreeFlags&13878)!==0||c){c=Y.T,Y.T=null;var p=$.p;$.p=2;var S=Ye;Ye|=4;try{Wi(r,a);var N=Cy,M=_g(a.containerInfo),q=N.focusedElem,X=N.selectionRange;if(M!==q&&q&&q.ownerDocument&&ln(q.ownerDocument.documentElement,q)){if(X!==null&&Uh(q)){var oe=X.start,xe=X.end;if(xe===void 0&&(xe=oe),"selectionStart"in q)q.selectionStart=oe,q.selectionEnd=Math.min(xe,q.value.length);else{var ve=q.ownerDocument||document,fe=ve&&ve.defaultView||window;if(fe.getSelection){var ye=fe.getSelection(),qe=q.textContent.length,Ie=Math.min(X.start,qe),dn=X.end===void 0?Ie:Math.min(X.end,qe);!ye.extend&&Ie>dn&&(M=dn,dn=Ie,Ie=M);var ne=Oo(q,Ie),I=Oo(q,dn);if(ne&&I&&(ye.rangeCount!==1||ye.anchorNode!==ne.node||ye.anchorOffset!==ne.offset||ye.focusNode!==I.node||ye.focusOffset!==I.offset)){var ie=ve.createRange();ie.setStart(ne.node,ne.offset),ye.removeAllRanges(),Ie>dn?(ye.addRange(ie),ye.extend(I.node,I.offset)):(ie.setEnd(I.node,I.offset),ye.addRange(ie))}}}}for(ve=[],ye=q;ye=ye.parentNode;)ye.nodeType===1&&ve.push({element:ye,left:ye.scrollLeft,top:ye.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<ve.length;q++){var be=ve[q];be.element.scrollLeft=be.left,be.element.scrollTop=be.top}}A0=!!_y,Cy=_y=null}finally{Ye=S,$.p=p,Y.T=c}}a.current=r,Jt=2}}function Ei(){if(Jt===2){Jt=0;var a=Us,r=Jo,c=(r.flags&8772)!==0;if((r.subtreeFlags&8772)!==0||c){c=Y.T,Y.T=null;var p=$.p;$.p=2;var S=Ye;Ye|=4;try{Nn(a,r.alternate,r)}finally{Ye=S,$.p=p,Y.T=c}}Jt=3}}function Jl(){if(Jt===4||Jt===3){Jt=0,Zt();var a=Us,r=Jo,c=ir,p=wc;(r.subtreeFlags&10256)!==0||(r.flags&10256)!==0?Jt=5:(Jt=0,Jo=Us=null,ei(a,a.pendingLanes));var S=a.pendingLanes;if(S===0&&(Wn=null),et(c),r=r.stateNode,ea&&typeof ea.onCommitFiberRoot=="function")try{ea.onCommitFiberRoot(Bs,r,void 0,(r.current.flags&128)===128)}catch{}if(p!==null){r=Y.T,S=$.p,$.p=2,Y.T=null;try{for(var N=a.onRecoverableError,M=0;M<p.length;M++){var q=p[M];N(q.value,{componentStack:q.stack})}}finally{Y.T=r,$.p=S}}(ir&3)!==0&&nu(),Ce(a),S=a.pendingLanes,(c&261930)!==0&&(S&42)!==0?a===Zl?nl++:(nl=0,Zl=a):nl=0,Le(0)}}function ei(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Al(r)))}function nu(){return sa(),Ei(),Jl(),vf()}function vf(){if(Jt!==5)return!1;var a=Us,r=Wo;Wo=0;var c=et(ir),p=Y.T,S=$.p;try{$.p=32>c?32:c,Y.T=null,c=$o,$o=null;var N=Us,M=ir;if(Jt=0,Jo=Us=null,ir=0,(Ye&6)!==0)throw Error(s(331));var q=Ye;if(Ye|=4,ys(N.current),Op(N,N.current,M,c),Ye=q,Le(0,!1),ea&&typeof ea.onPostCommitFiberRoot=="function")try{ea.onPostCommitFiberRoot(Bs,N)}catch{}return!0}finally{$.p=S,Y.T=p,ei(a,r)}}function Dp(a,r,c){r=Os(c,r),r=_p(a.stateNode,r,2),a=Ki(a,r,2),a!==null&&(yn(a,2),Ce(a))}function Ut(a,r,c){if(a.tag===3)Dp(a,a,c);else for(;r!==null;){if(r.tag===3){Dp(r,a,c);break}else if(r.tag===1){var p=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Wn===null||!Wn.has(p))){a=Os(c,a),c=Cp(2),p=Ki(r,c,2),p!==null&&(g0(c,p,r,a),yn(p,2),Ce(p));break}}r=r.return}}function Oc(a,r,c){var p=a.pingCache;if(p===null){p=a.pingCache=new it;var S=new Set;p.set(r,S)}else S=p.get(r),S===void 0&&(S=new Set,p.set(r,S));S.has(c)||(Ap=!0,S.add(c),a=l.bind(null,a,r,c),r.then(a,a))}function l(a,r,c){var p=a.pingCache;p!==null&&p.delete(r),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,tt===a&&(ct&c)===c&&(Mn===4||Mn===3&&(ct&62914560)===ct&&300>Kn()-Io?(Ye&2)===0&&sl(a,0):jc|=c,mn===ct&&(mn=0)),Ce(a)}function u(a,r){r===0&&(r=rn()),a=Za(a,r),a!==null&&(yn(a,r),Ce(a))}function g(a){var r=a.memoizedState,c=0;r!==null&&(c=r.retryLane),u(a,c)}function x(a,r){var c=0;switch(a.tag){case 31:case 13:var p=a.stateNode,S=a.memoizedState;S!==null&&(c=S.retryLane);break;case 19:p=a.stateNode;break;case 22:p=a.stateNode._retryCache;break;default:throw Error(s(314))}p!==null&&p.delete(r),u(a,c)}function C(a,r){return Et(a,r)}var E=null,U=null,F=!1,me=!1,Ne=!1,Re=0;function Ce(a){a!==U&&a.next===null&&(U===null?E=U=a:U=U.next=a),me=!0,F||(F=!0,se())}function Le(a,r){if(!Ne&&me){Ne=!0;do for(var c=!1,p=E;p!==null;){if(a!==0){var S=p.pendingLanes;if(S===0)var N=0;else{var M=p.suspendedLanes,q=p.pingedLanes;N=(1<<31-ba(42|a)+1)-1,N&=S&~(M&~q),N=N&201326741?N&201326741|1:N?N|2:0}N!==0&&(c=!0,de(p,N))}else N=ct,N=Qt(p,p===tt?N:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(N&3)===0||Mt(p,N)||(c=!0,de(p,N));p=p.next}while(c);Ne=!1}}function st(){ja()}function ja(){me=F=!1;var a=0;Re!==0&&o7()&&(a=Re);for(var r=Kn(),c=null,p=E;p!==null;){var S=p.next,N=au(p,r);N===0?(p.next=null,c===null?E=S:c.next=S,S===null&&(U=c)):(c=p,(a!==0||(N&3)!==0)&&(me=!0)),p=S}Jt!==0&&Jt!==5||Le(a),Re!==0&&(Re=0)}function au(a,r){for(var c=a.suspendedLanes,p=a.pingedLanes,S=a.expirationTimes,N=a.pendingLanes&-62914561;0<N;){var M=31-ba(N),q=1<<M,X=S[M];X===-1?((q&c)===0||(q&p)!==0)&&(S[M]=Hn(q,r)):X<=r&&(a.expiredLanes|=q),N&=~q}if(r=tt,c=ct,c=Qt(a,a===r?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p=a.callbackNode,c===0||a===r&&(Rt===2||Rt===9)||a.cancelPendingCommit!==null)return p!==null&&p!==null&&Un(p),a.callbackNode=null,a.callbackPriority=0;if((c&3)===0||Mt(a,c)){if(r=c&-c,r===a.callbackPriority)return r;switch(p!==null&&Un(p),et(c)){case 2:case 8:c=Qa;break;case 32:c=la;break;case 268435456:c=is;break;default:c=la}return p=ll.bind(null,a),c=Et(c,p),a.callbackPriority=r,a.callbackNode=c,r}return p!==null&&p!==null&&Un(p),a.callbackPriority=2,a.callbackNode=null,2}function ll(a,r){if(Jt!==0&&Jt!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(nu()&&a.callbackNode!==c)return null;var p=ct;return p=Qt(a,a===tt?p:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),p===0?null:(vt(a,p,r),au(a,Kn()),a.callbackNode!=null&&a.callbackNode===c?ll.bind(null,a):null)}function de(a,r){if(nu())return null;vt(a,r,!0)}function se(){c7(function(){(Ye&6)!==0?Et(hr,st):ja()})}function pe(){if(Re===0){var a=gi;a===0&&(a=Cs,Cs<<=1,(Cs&261888)===0&&(Cs=256)),Re=a}return Re}function Ee(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Ku(""+a)}function Xe(a,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,a.id&&c.setAttribute("form",a.id),r.parentNode.insertBefore(c,r),a=new FormData(a),c.parentNode.removeChild(c),a}function kn(a,r,c,p,S){if(r==="submit"&&c&&c.stateNode===S){var N=Ee((S[ut]||null).action),M=p.submitter;M&&(r=(r=M[ut]||null)?Ee(r.formAction):M.getAttribute("formAction"),r!==null&&(N=r,M=null));var q=new Zu("action","action",null,p,S);a.push({event:q,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Re!==0){var X=M?Xe(S,M):new FormData(S);mp(c,{pending:!0,data:X,method:S.method,action:N},null,X)}}else typeof N=="function"&&(q.preventDefault(),X=M?Xe(S,M):new FormData(S),mp(c,{pending:!0,data:X,method:S.method,action:N},N,X))},currentTarget:S}]})}}for(var Ze=0;Ze<sc.length;Ze++){var Dt=sc[Ze],wa=Dt.toLowerCase(),Bt=Dt[0].toUpperCase()+Dt.slice(1);Ks(wa,"on"+Bt)}Ks(Md,"onAnimationEnd"),Ks(ac,"onAnimationIteration"),Ks(qh,"onAnimationStart"),Ks("dblclick","onDoubleClick"),Ks("focusin","onFocus"),Ks("focusout","onBlur"),Ks(jg,"onTransitionRun"),Ks(uy,"onTransitionStart"),Ks(wg,"onTransitionCancel"),Ks(Bh,"onTransitionEnd"),Es("onMouseEnter",["mouseout","mouseover"]),Es("onMouseLeave",["mouseout","mouseover"]),Es("onPointerEnter",["pointerout","pointerover"]),Es("onPointerLeave",["pointerout","pointerover"]),Di("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Di("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Di("onBeforeInput",["compositionend","keypress","textInput","paste"]),Di("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Di("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var lr="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(" "),xy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(lr));function zv(a,r){r=(r&4)!==0;for(var c=0;c<a.length;c++){var p=a[c],S=p.event;p=p.listeners;e:{var N=void 0;if(r)for(var M=p.length-1;0<=M;M--){var q=p[M],X=q.instance,oe=q.currentTarget;if(q=q.listener,X!==N&&S.isPropagationStopped())break e;N=q,S.currentTarget=oe;try{N(S)}catch(xe){rc(xe)}S.currentTarget=null,N=X}else for(M=0;M<p.length;M++){if(q=p[M],X=q.instance,oe=q.currentTarget,q=q.listener,X!==N&&S.isPropagationStopped())break e;N=q,S.currentTarget=oe;try{N(S)}catch(xe){rc(xe)}S.currentTarget=null,N=X}}}}function Ot(a,r){var c=r[Tt];c===void 0&&(c=r[Tt]=new Set);var p=a+"__bubble";c.has(p)||(kv(r,a,2,!1),c.add(p))}function by(a,r,c){var p=0;r&&(p|=4),kv(c,a,p,r)}var N0="_reactListening"+Math.random().toString(36).slice(2);function vy(a){if(!a[N0]){a[N0]=!0,ws.forEach(function(c){c!=="selectionchange"&&(xy.has(c)||by(c,!1,a),by(c,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[N0]||(r[N0]=!0,by("selectionchange",!1,r))}}function kv(a,r,c,p){switch(c2(r)){case 2:var S=O7;break;case 8:S=A7;break;default:S=ky}c=S.bind(null,r,c,a),S=void 0,!Sh||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(S=!0),p?S!==void 0?a.addEventListener(r,c,{capture:!0,passive:S}):a.addEventListener(r,c,!0):S!==void 0?a.addEventListener(r,c,{passive:S}):a.addEventListener(r,c,!1)}function Sy(a,r,c,p,S){var N=p;if((r&1)===0&&(r&2)===0&&p!==null)e:for(;;){if(p===null)return;var M=p.tag;if(M===3||M===4){var q=p.stateNode.containerInfo;if(q===S)break;if(M===4)for(M=p.return;M!==null;){var X=M.tag;if((X===3||X===4)&&M.stateNode.containerInfo===S)return;M=M.return}for(;q!==null;){if(M=Pt(q),M===null)return;if(X=M.tag,X===5||X===6||X===26||X===27){p=N=M;continue e}q=q.parentNode}}p=p.return}vh(function(){var oe=N,xe=bd(c),ve=[];e:{var fe=Qs.get(a);if(fe!==void 0){var ye=Zu,qe=a;switch(a){case"keypress":if(Fu(c)===0)break e;case"keydown":case"keyup":ye=wl;break;case"focusin":qe="focus",ye=_d;break;case"focusout":qe="blur",ye=_d;break;case"beforeblur":case"afterblur":ye=_d;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ye=Nh;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ye=rg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ye=dg;break;case Md:case ac:case qh:ye=iy;break;case Bh:ye=oy;break;case"scroll":case"scrollend":ye=ag;break;case"wheel":ye=hg;break;case"copy":case"cut":case"paste":ye=lg;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=mg}var Ie=(r&4)!==0,dn=!Ie&&(a==="scroll"||a==="scrollend"),ne=Ie?fe!==null?fe+"Capture":null:fe;Ie=[];for(var I=oe,ie;I!==null;){var be=I;if(ie=be.stateNode,be=be.tag,be!==5&&be!==26&&be!==27||ie===null||ne===null||(be=So(I,ne),be!=null&&Ie.push(zp(I,be,ie))),dn)break;I=I.return}0<Ie.length&&(fe=new ye(fe,qe,null,c,xe),ve.push({event:fe,listeners:Ie}))}}if((r&7)===0){e:{if(fe=a==="mouseover"||a==="pointerover",ye=a==="mouseout"||a==="pointerout",fe&&c!==xd&&(qe=c.relatedTarget||c.fromElement)&&(Pt(qe)||qe[sn]))break e;if((ye||fe)&&(fe=xe.window===xe?xe:(fe=xe.ownerDocument)?fe.defaultView||fe.parentWindow:window,ye?(qe=c.relatedTarget||c.toElement,ye=oe,qe=qe?Pt(qe):null,qe!==null&&(dn=o(qe),Ie=qe.tag,qe!==dn||Ie!==5&&Ie!==27&&Ie!==6)&&(qe=null)):(ye=null,qe=oe),ye!==qe)){if(Ie=Nh,be="onMouseLeave",ne="onMouseEnter",I="mouse",(a==="pointerout"||a==="pointerover")&&(Ie=jh,be="onPointerLeave",ne="onPointerEnter",I="pointer"),dn=ye==null?fe:yr(ye),ie=qe==null?fe:yr(qe),fe=new Ie(be,I+"leave",ye,c,xe),fe.target=dn,fe.relatedTarget=ie,be=null,Pt(xe)===oe&&(Ie=new Ie(ne,I+"enter",qe,c,xe),Ie.target=ie,Ie.relatedTarget=dn,be=Ie),dn=be,ye&&qe)t:{for(Ie=a7,ne=ye,I=qe,ie=0,be=ne;be;be=Ie(be))ie++;be=0;for(var Ke=I;Ke;Ke=Ie(Ke))be++;for(;0<ie-be;)ne=Ie(ne),ie--;for(;0<be-ie;)I=Ie(I),be--;for(;ie--;){if(ne===I||I!==null&&ne===I.alternate){Ie=ne;break t}ne=Ie(ne),I=Ie(I)}Ie=null}else Ie=null;ye!==null&&Lv(ve,fe,ye,Ie,!1),qe!==null&&dn!==null&&Lv(ve,dn,qe,Ie,!0)}}e:{if(fe=oe?yr(oe):window,ye=fe.nodeName&&fe.nodeName.toLowerCase(),ye==="select"||ye==="input"&&fe.type==="file")var Kt=Mh;else if(Ah(fe))if(zr)Kt=Ng;else{Kt=kh;var Pe=vg}else ye=fe.nodeName,!ye||ye.toLowerCase()!=="input"||fe.type!=="checkbox"&&fe.type!=="radio"?oe&&yd(oe.elementType)&&(Kt=Mh):Kt=Sg;if(Kt&&(Kt=Kt(a,oe))){Od(ve,Kt,c,xe);break e}Pe&&Pe(a,fe,oe),a==="focusout"&&oe&&fe.type==="number"&&oe.memoizedProps.value!=null&&xr(fe,"number",fe.value)}switch(Pe=oe?yr(oe):window,a){case"focusin":(Ah(Pe)||Pe.contentEditable==="true")&&(kr=Pe,Lr=oe,Ao=null);break;case"focusout":Ao=Lr=kr=null;break;case"mousedown":Ad=!0;break;case"contextmenu":case"mouseup":case"dragend":Ad=!1,Mo(ve,c,xe);break;case"selectionchange":if(Cg)break;case"keydown":case"keyup":Mo(ve,c,xe)}var gt;if(El)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 Tl?Rd(a,c)&&(zt="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(zt="onCompositionStart");zt&&(Eh&&c.locale!=="ko"&&(Tl||zt!=="onCompositionStart"?zt==="onCompositionEnd"&&Tl&&(gt=Xu()):(Rs=xe,Sd="value"in Rs?Rs.value:Rs.textContent,Tl=!0)),Pe=_0(oe,zt),0<Pe.length&&(zt=new Cd(zt,a,null,c,xe),ve.push({event:zt,listeners:Pe}),gt?zt.data=gt:(gt=Th(c),gt!==null&&(zt.data=gt)))),(gt=Td?xg(a,c):Rh(a,c))&&(zt=_0(oe,"onBeforeInput"),0<zt.length&&(Pe=new Cd("onBeforeInput","beforeinput",null,c,xe),ve.push({event:Pe,listeners:zt}),Pe.data=gt)),kn(ve,a,oe,c,xe)}zv(ve,r)})}function zp(a,r,c){return{instance:a,listener:r,currentTarget:c}}function _0(a,r){for(var c=r+"Capture",p=[];a!==null;){var S=a,N=S.stateNode;if(S=S.tag,S!==5&&S!==26&&S!==27||N===null||(S=So(a,c),S!=null&&p.unshift(zp(a,S,N)),S=So(a,r),S!=null&&p.push(zp(a,S,N))),a.tag===3)return p;a=a.return}return[]}function a7(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,c,p,S){for(var N=r._reactName,M=[];c!==null&&c!==p;){var q=c,X=q.alternate,oe=q.stateNode;if(q=q.tag,X!==null&&X===p)break;q!==5&&q!==26&&q!==27||oe===null||(X=oe,S?(oe=So(c,N),oe!=null&&M.unshift(zp(c,oe,X))):S||(oe=So(c,N),oe!=null&&M.push(zp(c,oe,X)))),c=c.return}M.length!==0&&a.push({event:r,listeners:M})}var s7=/\r\n?/g,r7=/\u0000|\uFFFD/g;function Uv(a){return(typeof a=="string"?a:""+a).replace(s7,`
|
|
49
|
-
`).replace(r7,"")}function Hv(a,r){return r=Uv(r),Uv(a)===r}function cn(a,r,c,p,S,N){switch(c){case"children":typeof p=="string"?r==="body"||r==="textarea"&&p===""||_l(a,p):(typeof p=="number"||typeof p=="bigint")&&r!=="body"&&_l(a,""+p);break;case"className":Vu(a,"class",p);break;case"tabIndex":Vu(a,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Vu(a,c,p);break;case"style":yh(a,p,N);break;case"data":if(r!=="object"){Vu(a,"data",p);break}case"src":case"href":if(p===""&&(r!=="a"||c!=="href")){a.removeAttribute(c);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(c);break}p=Ku(""+p),a.setAttribute(c,p);break;case"action":case"formAction":if(typeof p=="function"){a.setAttribute(c,"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"&&(c==="formAction"?(r!=="input"&&cn(a,r,"name",S.name,S,null),cn(a,r,"formEncType",S.formEncType,S,null),cn(a,r,"formMethod",S.formMethod,S,null),cn(a,r,"formTarget",S.formTarget,S,null)):(cn(a,r,"encType",S.encType,S,null),cn(a,r,"method",S.method,S,null),cn(a,r,"target",S.target,S,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){a.removeAttribute(c);break}p=Ku(""+p),a.setAttribute(c,p);break;case"onClick":p!=null&&(a.onclick=ci);break;case"onScroll":p!=null&&Ot("scroll",a);break;case"onScrollEnd":p!=null&&Ot("scrollend",a);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(c=p.__html,c!=null){if(S.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"multiple":a.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":a.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){a.removeAttribute("xlink:href");break}c=Ku(""+p),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,""+p):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":p&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":p===!0?a.setAttribute(c,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?a.setAttribute(c,p):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?a.setAttribute(c,p):a.removeAttribute(c);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?a.removeAttribute(c):a.setAttribute(c,p);break;case"popover":Ot("beforetoggle",a),Ot("toggle",a),bo(a,"popover",p);break;case"xlinkActuate":Mr(a,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Mr(a,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Mr(a,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Mr(a,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Mr(a,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Mr(a,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Mr(a,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":bo(a,"is",p);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=tg.get(c)||c,bo(a,c,p))}}function Ny(a,r,c,p,S,N){switch(c){case"style":yh(a,p,N);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(s(61));if(c=p.__html,c!=null){if(S.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"children":typeof p=="string"?_l(a,p):(typeof p=="number"||typeof p=="bigint")&&_l(a,""+p);break;case"onScroll":p!=null&&Ot("scroll",a);break;case"onScrollEnd":p!=null&&Ot("scrollend",a);break;case"onClick":p!=null&&(a.onclick=ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!dd.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(S=c.endsWith("Capture"),r=c.slice(2,S?c.length-7:void 0),N=a[ut]||null,N=N!=null?N[c]:null,typeof N=="function"&&a.removeEventListener(r,N,S),typeof p=="function")){typeof N!="function"&&N!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(r,p,S);break e}c in a?a[c]=p:p===!0?a.setAttribute(c,""):bo(a,c,p)}}}function as(a,r,c){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 p=!1,S=!1,N;for(N in c)if(c.hasOwnProperty(N)){var M=c[N];if(M!=null)switch(N){case"src":p=!0;break;case"srcSet":S=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:cn(a,r,N,M,c,null)}}S&&cn(a,r,"srcSet",c.srcSet,c,null),p&&cn(a,r,"src",c.src,c,null);return;case"input":Ot("invalid",a);var q=N=M=S=null,X=null,oe=null;for(p in c)if(c.hasOwnProperty(p)){var xe=c[p];if(xe!=null)switch(p){case"name":S=xe;break;case"type":M=xe;break;case"checked":X=xe;break;case"defaultChecked":oe=xe;break;case"value":N=xe;break;case"defaultValue":q=xe;break;case"children":case"dangerouslySetInnerHTML":if(xe!=null)throw Error(s(137,r));break;default:cn(a,r,p,xe,c,null)}}pd(a,N,q,X,oe,M,S,!1);return;case"select":Ot("invalid",a),p=M=N=null;for(S in c)if(c.hasOwnProperty(S)&&(q=c[S],q!=null))switch(S){case"value":N=q;break;case"defaultValue":M=q;break;case"multiple":p=q;default:cn(a,r,S,q,c,null)}r=N,c=M,a.multiple=!!p,r!=null?ui(a,!!p,r,!1):c!=null&&ui(a,!!p,c,!0);return;case"textarea":Ot("invalid",a),N=S=p=null;for(M in c)if(c.hasOwnProperty(M)&&(q=c[M],q!=null))switch(M){case"value":p=q;break;case"defaultValue":S=q;break;case"children":N=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(s(91));break;default:cn(a,r,M,q,c,null)}gd(a,p,S,N);return;case"option":for(X in c)if(c.hasOwnProperty(X)&&(p=c[X],p!=null))switch(X){case"selected":a.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:cn(a,r,X,p,c,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(p=0;p<lr.length;p++)Ot(lr[p],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 c)if(c.hasOwnProperty(oe)&&(p=c[oe],p!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:cn(a,r,oe,p,c,null)}return;default:if(yd(r)){for(xe in c)c.hasOwnProperty(xe)&&(p=c[xe],p!==void 0&&Ny(a,r,xe,p,c,void 0));return}}for(q in c)c.hasOwnProperty(q)&&(p=c[q],p!=null&&cn(a,r,q,p,c,null))}function i7(a,r,c,p){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,M=null,q=null,X=null,oe=null,xe=null;for(ye in c){var ve=c[ye];if(c.hasOwnProperty(ye)&&ve!=null)switch(ye){case"checked":break;case"value":break;case"defaultValue":X=ve;default:p.hasOwnProperty(ye)||cn(a,r,ye,null,p,ve)}}for(var fe in p){var ye=p[fe];if(ve=c[fe],p.hasOwnProperty(fe)&&(ye!=null||ve!=null))switch(fe){case"type":N=ye;break;case"name":S=ye;break;case"checked":oe=ye;break;case"defaultChecked":xe=ye;break;case"value":M=ye;break;case"defaultValue":q=ye;break;case"children":case"dangerouslySetInnerHTML":if(ye!=null)throw Error(s(137,r));break;default:ye!==ve&&cn(a,r,fe,ye,p,ve)}}vo(a,M,q,X,oe,xe,N,S);return;case"select":ye=M=q=fe=null;for(N in c)if(X=c[N],c.hasOwnProperty(N)&&X!=null)switch(N){case"value":break;case"multiple":ye=X;default:p.hasOwnProperty(N)||cn(a,r,N,null,p,X)}for(S in p)if(N=p[S],X=c[S],p.hasOwnProperty(S)&&(N!=null||X!=null))switch(S){case"value":fe=N;break;case"defaultValue":q=N;break;case"multiple":M=N;default:N!==X&&cn(a,r,S,N,p,X)}r=q,c=M,p=ye,fe!=null?ui(a,!!c,fe,!1):!!p!=!!c&&(r!=null?ui(a,!!c,r,!0):ui(a,!!c,c?[]:"",!1));return;case"textarea":ye=fe=null;for(q in c)if(S=c[q],c.hasOwnProperty(q)&&S!=null&&!p.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:cn(a,r,q,null,p,S)}for(M in p)if(S=p[M],N=c[M],p.hasOwnProperty(M)&&(S!=null||N!=null))switch(M){case"value":fe=S;break;case"defaultValue":ye=S;break;case"children":break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(s(91));break;default:S!==N&&cn(a,r,M,S,p,N)}md(a,fe,ye);return;case"option":for(var qe in c)if(fe=c[qe],c.hasOwnProperty(qe)&&fe!=null&&!p.hasOwnProperty(qe))switch(qe){case"selected":a.selected=!1;break;default:cn(a,r,qe,null,p,fe)}for(X in p)if(fe=p[X],ye=c[X],p.hasOwnProperty(X)&&fe!==ye&&(fe!=null||ye!=null))switch(X){case"selected":a.selected=fe&&typeof fe!="function"&&typeof fe!="symbol";break;default:cn(a,r,X,fe,p,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 c)fe=c[Ie],c.hasOwnProperty(Ie)&&fe!=null&&!p.hasOwnProperty(Ie)&&cn(a,r,Ie,null,p,fe);for(oe in p)if(fe=p[oe],ye=c[oe],p.hasOwnProperty(oe)&&fe!==ye&&(fe!=null||ye!=null))switch(oe){case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(s(137,r));break;default:cn(a,r,oe,fe,p,ye)}return;default:if(yd(r)){for(var dn in c)fe=c[dn],c.hasOwnProperty(dn)&&fe!==void 0&&!p.hasOwnProperty(dn)&&Ny(a,r,dn,void 0,p,fe);for(xe in p)fe=p[xe],ye=c[xe],!p.hasOwnProperty(xe)||fe===ye||fe===void 0&&ye===void 0||Ny(a,r,xe,fe,p,ye);return}}for(var ne in c)fe=c[ne],c.hasOwnProperty(ne)&&fe!=null&&!p.hasOwnProperty(ne)&&cn(a,r,ne,null,p,fe);for(ve in p)fe=p[ve],ye=c[ve],!p.hasOwnProperty(ve)||fe===ye||fe==null&&ye==null||cn(a,r,ve,fe,p,ye)}function qv(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function l7(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,c=performance.getEntriesByType("resource"),p=0;p<c.length;p++){var S=c[p],N=S.transferSize,M=S.initiatorType,q=S.duration;if(N&&q&&qv(M)){for(M=0,q=S.responseEnd,p+=1;p<c.length;p++){var X=c[p],oe=X.startTime;if(oe>q)break;var xe=X.transferSize,ve=X.initiatorType;xe&&qv(ve)&&(X=X.responseEnd,M+=xe*(X<q?1:(q-oe)/(X-oe)))}if(--p,r+=8*(N+M)/(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 _y=null,Cy=null;function C0(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 jy(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 wy=null;function o7(){var a=window.event;return a&&a.type==="popstate"?a===wy?!1:(wy=a,!0):(wy=null,!1)}var Pv=typeof setTimeout=="function"?setTimeout:void 0,u7=typeof clearTimeout=="function"?clearTimeout:void 0,Yv=typeof Promise=="function"?Promise:void 0,c7=typeof queueMicrotask=="function"?queueMicrotask:typeof Yv<"u"?function(a){return Yv.resolve(null).then(a).catch(d7)}:Pv;function d7(a){setTimeout(function(){throw a})}function su(a){return a==="head"}function Vv(a,r){var c=r,p=0;do{var S=c.nextSibling;if(a.removeChild(c),S&&S.nodeType===8)if(c=S.data,c==="/$"||c==="/&"){if(p===0){a.removeChild(S),Cf(r);return}p--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")p++;else if(c==="html")kp(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,kp(c);for(var N=c.firstChild;N;){var M=N.nextSibling,q=N.nodeName;N[Ka]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&N.rel.toLowerCase()==="stylesheet"||c.removeChild(N),N=M}}else c==="body"&&kp(a.ownerDocument.body);c=S}while(c);Cf(r)}function Qv(a,r){var c=a;a=0;do{var p=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),p&&p.nodeType===8)if(c=p.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=p}while(c)}function Ey(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Ey(c),Ps(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function f7(a,r,c,p){for(;a.nodeType===1;){var S=c;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!p&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(p){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=ti(a.nextSibling),a===null)break}return null}function h7(a,r,c){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=ti(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=ti(a.nextSibling),a===null))return null;return a}function Ty(a){return a.data==="$?"||a.data==="$~"}function Ry(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function p7(a,r){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||c.readyState!=="loading")r();else{var p=function(){r(),c.removeEventListener("DOMContentLoaded",p)};c.addEventListener("DOMContentLoaded",p),a._reactRetry=p}}function ti(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 Oy=null;function Xv(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(r===0)return ti(a.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}a=a.nextSibling}return null}function Fv(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return a;r--}else c!=="/$"&&c!=="/&"||r++}a=a.previousSibling}return null}function Zv(a,r,c){switch(r=C0(c),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 kp(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Ps(a)}var ni=new Map,Iv=new Set;function j0(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var Wl=$.d;$.d={f:m7,r:g7,D:y7,C:x7,L:b7,m:v7,X:N7,S:S7,M:_7};function m7(){var a=Wl.f(),r=_r();return a||r}function g7(a){var r=gr(a);r!==null&&r.tag===5&&r.type==="form"?l0(r):Wl.r(a)}var Sf=typeof document>"u"?null:document;function Jv(a,r,c){var p=Sf;if(p&&typeof r=="string"&&r){var S=qa(r);S='link[rel="'+a+'"][href="'+S+'"]',typeof c=="string"&&(S+='[crossorigin="'+c+'"]'),Iv.has(S)||(Iv.add(S),a={rel:a,crossOrigin:c,href:r},p.querySelector(S)===null&&(r=p.createElement("link"),as(r,"link",a),En(r),p.head.appendChild(r)))}}function y7(a){Wl.D(a),Jv("dns-prefetch",a,null)}function x7(a,r){Wl.C(a,r),Jv("preconnect",a,r)}function b7(a,r,c){Wl.L(a,r,c);var p=Sf;if(p&&a&&r){var S='link[rel="preload"][as="'+qa(r)+'"]';r==="image"&&c&&c.imageSrcSet?(S+='[imagesrcset="'+qa(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(S+='[imagesizes="'+qa(c.imageSizes)+'"]')):S+='[href="'+qa(a)+'"]';var N=S;switch(r){case"style":N=Nf(a);break;case"script":N=_f(a)}ni.has(N)||(a=b({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:a,as:r},c),ni.set(N,a),p.querySelector(S)!==null||r==="style"&&p.querySelector(Lp(N))||r==="script"&&p.querySelector(Up(N))||(r=p.createElement("link"),as(r,"link",a),En(r),p.head.appendChild(r)))}}function v7(a,r){Wl.m(a,r);var c=Sf;if(c&&a){var p=r&&typeof r.as=="string"?r.as:"script",S='link[rel="modulepreload"][as="'+qa(p)+'"][href="'+qa(a)+'"]',N=S;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":N=_f(a)}if(!ni.has(N)&&(a=b({rel:"modulepreload",href:a},r),ni.set(N,a),c.querySelector(S)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Up(N)))return}p=c.createElement("link"),as(p,"link",a),En(p),c.head.appendChild(p)}}}function S7(a,r,c){Wl.S(a,r,c);var p=Sf;if(p&&a){var S=js(p).hoistableStyles,N=Nf(a);r=r||"default";var M=S.get(N);if(!M){var q={loading:0,preload:null};if(M=p.querySelector(Lp(N)))q.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":r},c),(c=ni.get(N))&&Ay(a,c);var X=M=p.createElement("link");En(X),as(X,"link",a),X._p=new Promise(function(oe,xe){X.onload=oe,X.onerror=xe}),X.addEventListener("load",function(){q.loading|=1}),X.addEventListener("error",function(){q.loading|=2}),q.loading|=4,w0(M,r,p)}M={type:"stylesheet",instance:M,count:1,state:q},S.set(N,M)}}}function N7(a,r){Wl.X(a,r);var c=Sf;if(c&&a){var p=js(c).hoistableScripts,S=_f(a),N=p.get(S);N||(N=c.querySelector(Up(S)),N||(a=b({src:a,async:!0},r),(r=ni.get(S))&&My(a,r),N=c.createElement("script"),En(N),as(N,"link",a),c.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},p.set(S,N))}}function _7(a,r){Wl.M(a,r);var c=Sf;if(c&&a){var p=js(c).hoistableScripts,S=_f(a),N=p.get(S);N||(N=c.querySelector(Up(S)),N||(a=b({src:a,async:!0,type:"module"},r),(r=ni.get(S))&&My(a,r),N=c.createElement("script"),En(N),as(N,"link",a),c.head.appendChild(N)),N={type:"script",instance:N,count:1,state:null},p.set(S,N))}}function Wv(a,r,c,p){var S=(S=je.current)?j0(S):null;if(!S)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Nf(c.href),c=js(S).hoistableStyles,p=c.get(r),p||(p={type:"style",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Nf(c.href);var N=js(S).hoistableStyles,M=N.get(a);if(M||(S=S.ownerDocument||S,M={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},N.set(a,M),(N=S.querySelector(Lp(a)))&&!N._p&&(M.instance=N,M.state.loading=5),ni.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ni.set(a,c),N||C7(S,a,c,M.state))),r&&p===null)throw Error(s(528,""));return M}if(r&&p!==null)throw Error(s(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=_f(c),c=js(S).hoistableScripts,p=c.get(r),p||(p={type:"script",instance:null,count:0,state:null},c.set(r,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function Nf(a){return'href="'+qa(a)+'"'}function Lp(a){return'link[rel="stylesheet"]['+a+"]"}function $v(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function C7(a,r,c,p){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?p.loading=1:(r=a.createElement("link"),p.preload=r,r.addEventListener("load",function(){return p.loading|=1}),r.addEventListener("error",function(){return p.loading|=2}),as(r,"link",c),En(r),a.head.appendChild(r))}function _f(a){return'[src="'+qa(a)+'"]'}function Up(a){return"script[async]"+a}function e2(a,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var p=a.querySelector('style[data-href~="'+qa(c.href)+'"]');if(p)return r.instance=p,En(p),p;var S=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return p=(a.ownerDocument||a).createElement("style"),En(p),as(p,"style",S),w0(p,c.precedence,a),r.instance=p;case"stylesheet":S=Nf(c.href);var N=a.querySelector(Lp(S));if(N)return r.state.loading|=4,r.instance=N,En(N),N;p=$v(c),(S=ni.get(S))&&Ay(p,S),N=(a.ownerDocument||a).createElement("link"),En(N);var M=N;return M._p=new Promise(function(q,X){M.onload=q,M.onerror=X}),as(N,"link",p),r.state.loading|=4,w0(N,c.precedence,a),r.instance=N;case"script":return N=_f(c.src),(S=a.querySelector(Up(N)))?(r.instance=S,En(S),S):(p=c,(S=ni.get(N))&&(p=b({},c),My(p,S)),a=a.ownerDocument||a,S=a.createElement("script"),En(S),as(S,"link",p),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&&(p=r.instance,r.state.loading|=4,w0(p,c.precedence,a));return r.instance}function w0(a,r,c){for(var p=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),S=p.length?p[p.length-1]:null,N=S,M=0;M<p.length;M++){var q=p[M];if(q.dataset.precedence===r)N=q;else if(N!==S)break}N?N.parentNode.insertBefore(a,N.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(a,r.firstChild))}function Ay(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function My(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var E0=null;function t2(a,r,c){if(E0===null){var p=new Map,S=E0=new Map;S.set(c,p)}else S=E0,p=S.get(c),p||(p=new Map,S.set(c,p));if(p.has(a))return p;for(p.set(a,null),c=c.getElementsByTagName(a),S=0;S<c.length;S++){var N=c[S];if(!(N[Ka]||N[Fe]||a==="link"&&N.getAttribute("rel")==="stylesheet")&&N.namespaceURI!=="http://www.w3.org/2000/svg"){var M=N.getAttribute(r)||"";M=a+M;var q=p.get(M);q?q.push(N):p.set(M,[N])}}return p}function n2(a,r,c){a=a.ownerDocument||a,a.head.insertBefore(c,r==="title"?a.querySelector("head > title"):null)}function j7(a,r,c){if(c===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 w7(a,r,c,p){if(c.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(c.state.loading&4)===0){if(c.instance===null){var S=Nf(p.href),N=r.querySelector(Lp(S));if(N){r=N._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=T0.bind(a),r.then(a,a)),c.state.loading|=4,c.instance=N,En(N);return}N=r.ownerDocument||r,p=$v(p),(S=ni.get(S))&&Ay(p,S),N=N.createElement("link"),En(N);var M=N;M._p=new Promise(function(q,X){M.onload=q,M.onerror=X}),as(N,"link",p),c.instance=N}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,r),(r=c.state.preload)&&(c.state.loading&3)===0&&(a.count++,c=T0.bind(a),r.addEventListener("load",c),r.addEventListener("error",c))}}var Dy=0;function E7(a,r){return a.stylesheets&&a.count===0&&O0(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var p=setTimeout(function(){if(a.stylesheets&&O0(a,a.stylesheets),a.unsuspend){var N=a.unsuspend;a.unsuspend=null,N()}},6e4+r);0<a.imgBytes&&Dy===0&&(Dy=62500*l7());var S=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&O0(a,a.stylesheets),a.unsuspend)){var N=a.unsuspend;a.unsuspend=null,N()}},(a.imgBytes>Dy?50:800)+r);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(p),clearTimeout(S)}}:null}function T0(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)O0(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var R0=null;function O0(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,R0=new Map,r.forEach(T7,a),R0=null,T0.call(a))}function T7(a,r){if(!(r.state.loading&4)){var c=R0.get(a);if(c)var p=c.get(null);else{c=new Map,R0.set(a,c);for(var S=a.querySelectorAll("link[data-precedence],style[data-precedence]"),N=0;N<S.length;N++){var M=S[N];(M.nodeName==="LINK"||M.getAttribute("media")!=="not all")&&(c.set(M.dataset.precedence,M),p=M)}p&&c.set(null,p)}S=r.instance,M=S.getAttribute("data-precedence"),N=c.get(M)||p,N===p&&c.set(null,S),c.set(M,S),this.count++,p=T0.bind(this),S.addEventListener("load",p),S.addEventListener("error",p),N?N.parentNode.insertBefore(S,N.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(S,a.firstChild)),r.state.loading|=4}}var Hp={$$typeof:z,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function R7(a,r,c,p,S,N,M,q,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=Xn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xn(0),this.hiddenUpdates=Xn(null),this.identifierPrefix=p,this.onUncaughtError=S,this.onCaughtError=N,this.onRecoverableError=M,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=X,this.incompleteTransitions=new Map}function s2(a,r,c,p,S,N,M,q,X,oe,xe,ve){return a=new R7(a,r,c,M,X,oe,xe,ve,q),r=1,N===!0&&(r|=24),N=Rn(3,null,null,r),a.current=N,N.stateNode=a,r=Ph(),r.refCount++,a.pooledCache=r,r.refCount++,N.memoizedState={element:p,isDehydrated:c,cache:r},fc(N),a}function r2(a){return a?(a=Hi,a):Hi}function i2(a,r,c,p,S,N){S=r2(S),p.context===null?p.context=S:p.pendingContext=S,p=xi(r),p.payload={element:c},N=N===void 0?null:N,N!==null&&(p.callback=N),c=Ki(a,p,r),c!==null&&(ht(c,a,r),Xi(c,a,r))}function l2(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<r?c:r}}function zy(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&&ht(r,a,67108864),zy(a,67108864)}}function u2(a){if(a.tag===13||a.tag===31){var r=Hs();r=Ue(r);var c=Za(a,r);c!==null&&ht(c,a,r),zy(a,r)}}var A0=!0;function O7(a,r,c,p){var S=Y.T;Y.T=null;var N=$.p;try{$.p=2,ky(a,r,c,p)}finally{$.p=N,Y.T=S}}function A7(a,r,c,p){var S=Y.T;Y.T=null;var N=$.p;try{$.p=8,ky(a,r,c,p)}finally{$.p=N,Y.T=S}}function ky(a,r,c,p){if(A0){var S=Ly(p);if(S===null)Sy(a,r,p,M0,c),d2(a,p);else if(D7(S,a,r,c,p))p.stopPropagation();else if(d2(a,p),r&4&&-1<M7.indexOf(a)){for(;S!==null;){var N=gr(S);if(N!==null)switch(N.tag){case 3:if(N=N.stateNode,N.current.memoizedState.isDehydrated){var M=mt(N.pendingLanes);if(M!==0){var q=N;for(q.pendingLanes|=2,q.entangledLanes|=2;M;){var X=1<<31-ba(M);q.entanglements[1]|=X,M&=~X}Ce(N),(Ye&6)===0&&(Jn=Kn()+500,Le(0))}}break;case 31:case 13:q=Za(N,2),q!==null&&ht(q,N,2),_r(),zy(N,2)}if(N=Ly(p),N===null&&Sy(a,r,p,M0,c),N===S)break;S=N}S!==null&&p.stopPropagation()}else Sy(a,r,p,null,c)}}function Ly(a){return a=bd(a),Uy(a)}var M0=null;function Uy(a){if(M0=null,a=Pt(a),a!==null){var r=o(a);if(r===null)a=null;else{var c=r.tag;if(c===13){if(a=d(r),a!==null)return a;a=null}else if(c===31){if(a=f(r),a!==null)return a;a=null}else if(c===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 c2(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(Ns()){case hr:return 2;case Qa:return 8;case la:case Ea:return 32;case is:return 268435456;default:return 32}default:return 32}}var Hy=!1,ru=null,iu=null,lu=null,qp=new Map,Bp=new Map,ou=[],M7="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":ru=null;break;case"dragenter":case"dragleave":iu=null;break;case"mouseover":case"mouseout":lu=null;break;case"pointerover":case"pointerout":qp.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Bp.delete(r.pointerId)}}function Gp(a,r,c,p,S,N){return a===null||a.nativeEvent!==N?(a={blockedOn:r,domEventName:c,eventSystemFlags:p,nativeEvent:N,targetContainers:[S]},r!==null&&(r=gr(r),r!==null&&o2(r)),a):(a.eventSystemFlags|=p,r=a.targetContainers,S!==null&&r.indexOf(S)===-1&&r.push(S),a)}function D7(a,r,c,p,S){switch(r){case"focusin":return ru=Gp(ru,a,r,c,p,S),!0;case"dragenter":return iu=Gp(iu,a,r,c,p,S),!0;case"mouseover":return lu=Gp(lu,a,r,c,p,S),!0;case"pointerover":var N=S.pointerId;return qp.set(N,Gp(qp.get(N)||null,a,r,c,p,S)),!0;case"gotpointercapture":return N=S.pointerId,Bp.set(N,Gp(Bp.get(N)||null,a,r,c,p,S)),!0}return!1}function f2(a){var r=Pt(a.target);if(r!==null){var c=o(r);if(c!==null){if(r=c.tag,r===13){if(r=d(c),r!==null){a.blockedOn=r,ot(a.priority,function(){u2(c)});return}}else if(r===31){if(r=f(c),r!==null){a.blockedOn=r,ot(a.priority,function(){u2(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function D0(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var c=Ly(a.nativeEvent);if(c===null){c=a.nativeEvent;var p=new c.constructor(c.type,c);xd=p,c.target.dispatchEvent(p),xd=null}else return r=gr(c),r!==null&&o2(r),a.blockedOn=c,!1;r.shift()}return!0}function h2(a,r,c){D0(a)&&c.delete(r)}function z7(){Hy=!1,ru!==null&&D0(ru)&&(ru=null),iu!==null&&D0(iu)&&(iu=null),lu!==null&&D0(lu)&&(lu=null),qp.forEach(h2),Bp.forEach(h2)}function z0(a,r){a.blockedOn===r&&(a.blockedOn=null,Hy||(Hy=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,z7)))}var k0=null;function p2(a){k0!==a&&(k0=a,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){k0===a&&(k0=null);for(var r=0;r<a.length;r+=3){var c=a[r],p=a[r+1],S=a[r+2];if(typeof p!="function"){if(Uy(p||c)===null)continue;break}var N=gr(c);N!==null&&(a.splice(r,3),r-=3,mp(N,{pending:!0,data:S,method:c.method,action:p},p,S))}}))}function Cf(a){function r(X){return z0(X,a)}ru!==null&&z0(ru,a),iu!==null&&z0(iu,a),lu!==null&&z0(lu,a),qp.forEach(r),Bp.forEach(r);for(var c=0;c<ou.length;c++){var p=ou[c];p.blockedOn===a&&(p.blockedOn=null)}for(;0<ou.length&&(c=ou[0],c.blockedOn===null);)f2(c),c.blockedOn===null&&ou.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(p=0;p<c.length;p+=3){var S=c[p],N=c[p+1],M=S[ut]||null;if(typeof N=="function")M||p2(c);else if(M){var q=null;if(N&&N.hasAttribute("formAction")){if(S=N,M=N[ut]||null)q=M.formAction;else if(Uy(S)!==null)continue}else q=M.action;typeof q=="function"?c[p+1]=q:(c.splice(p,3),p-=3),p2(c)}}}function m2(){function a(N){N.canIntercept&&N.info==="react-transition"&&N.intercept({handler:function(){return new Promise(function(M){return S=M})},focusReset:"manual",scroll:"manual"})}function r(){S!==null&&(S(),S=null),p||setTimeout(c,20)}function c(){if(!p&&!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 p=!1,S=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){p=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),S!==null&&(S(),S=null)}}}function qy(a){this._internalRoot=a}L0.prototype.render=qy.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var c=r.current,p=Hs();i2(c,p,a,r,null,null)},L0.prototype.unmount=qy.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),_r(),r[sn]=null}};function L0(a){this._internalRoot=a}L0.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ve();a={blockedOn:null,target:a,priority:r};for(var c=0;c<ou.length&&r!==0&&r<ou[c].priority;c++);ou.splice(c,0,a),c===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?v(a):null,a=a===null?null:a.stateNode,a};var k7={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:Y,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var U0=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!U0.isDisabled&&U0.supportsFiber)try{Bs=U0.inject(k7),ea=U0}catch{}}return Vp.createRoot=function(a,r){if(!i(a))throw Error(s(299));var c=!1,p="",S=p0,N=Sp,M=Np;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(p=r.identifierPrefix),r.onUncaughtError!==void 0&&(S=r.onUncaughtError),r.onCaughtError!==void 0&&(N=r.onCaughtError),r.onRecoverableError!==void 0&&(M=r.onRecoverableError)),r=s2(a,1,!1,null,null,c,p,null,S,N,M,m2),a[sn]=r.current,vy(a),new qy(r)},Vp.hydrateRoot=function(a,r,c){if(!i(a))throw Error(s(299));var p=!1,S="",N=p0,M=Sp,q=Np,X=null;return c!=null&&(c.unstable_strictMode===!0&&(p=!0),c.identifierPrefix!==void 0&&(S=c.identifierPrefix),c.onUncaughtError!==void 0&&(N=c.onUncaughtError),c.onCaughtError!==void 0&&(M=c.onCaughtError),c.onRecoverableError!==void 0&&(q=c.onRecoverableError),c.formState!==void 0&&(X=c.formState)),r=s2(a,1,!0,r,c??null,p,S,X,N,M,q,m2),r.context=r2(null),c=r.current,p=Hs(),p=Ue(p),S=xi(p),S.callback=null,Ki(c,S,p),c=p,r.current.lanes=c,yn(r,c),Ce(r),a[sn]=r.current,vy(a),new L0(r)},Vp.version="19.2.4",Vp}var E2;function K7(){if(E2)return Yy.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(),Yy.exports=Q7(),Yy.exports}var Pb=K7();const X7=qb(Pb),F7=v4({__proto__:null,default:X7},[Pb]);var td=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(){}},qc,vu,Uf,o4,Z7=(o4=class extends td{constructor(){super();He(this,qc);He(this,vu);He(this,Uf);Oe(this,Uf,e=>{if(typeof window<"u"&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){Q(this,vu)||this.setEventListener(Q(this,Uf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,vu))==null||e.call(this),Oe(this,vu,void 0))}setEventListener(e){var n;Oe(this,Uf,e),(n=Q(this,vu))==null||n.call(this),Oe(this,vu,e(s=>{typeof s=="boolean"?this.setFocused(s):this.onFocus()}))}setFocused(e){Q(this,qc)!==e&&(Oe(this,qc,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof Q(this,qc)=="boolean"?Q(this,qc):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},qc=new WeakMap,vu=new WeakMap,Uf=new WeakMap,o4),z1=new Z7,I7={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},Su,Hb,u4,J7=(u4=class{constructor(){He(this,Su,I7);He(this,Hb,!1)}setTimeoutProvider(t){Oe(this,Su,t)}setTimeout(t,e){return Q(this,Su).setTimeout(t,e)}clearTimeout(t){Q(this,Su).clearTimeout(t)}setInterval(t,e){return Q(this,Su).setInterval(t,e)}clearInterval(t){Q(this,Su).clearInterval(t)}},Su=new WeakMap,Hb=new WeakMap,u4),Ou=new J7;function W7(t){setTimeout(t,0)}var S4=typeof window>"u"||"Deno"in globalThis;function ma(){}function $7(t,e){return typeof t=="function"?t(e):t}function Dx(t){return typeof t=="number"&&t>=0&&t!==1/0}function N4(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Au(t,e){return typeof t=="function"?t(e):t}function ri(t,e){return typeof t=="function"?t(e):t}function zx(t,e){const{type:n="all",exact:s,fetchStatus:i,predicate:o,queryKey:d,stale:f}=t;if(d){if(s){if(e.queryHash!==Yb(d,e.options))return!1}else if(!Wf(e.queryKey,d))return!1}if(n!=="all"){const m=e.isActive();if(n==="active"&&!m||n==="inactive"&&m)return!1}return!(typeof f=="boolean"&&e.isStale()!==f||i&&i!==e.state.fetchStatus||o&&!o(e))}function kx(t,e){const{exact:n,status:s,predicate:i,mutationKey:o}=t;if(o){if(!e.options.mutationKey)return!1;if(n){if(Mu(e.options.mutationKey)!==Mu(o))return!1}else if(!Wf(e.options.mutationKey,o))return!1}return!(s&&e.state.status!==s||i&&!i(e))}function Yb(t,e){return((e==null?void 0:e.queryKeyHashFn)||Mu)(t)}function Mu(t){return JSON.stringify(t,(e,n)=>Lx(n)?Object.keys(n).sort().reduce((s,i)=>(s[i]=n[i],s),{}):n)}function Wf(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Wf(t[n],e[n])):!1}var e9=Object.prototype.hasOwnProperty;function Qm(t,e,n=0){if(t===e)return t;if(n>500)return e;const s=T2(t)&&T2(e);if(!s&&!(Lx(t)&&Lx(e)))return e;const o=(s?t:Object.keys(t)).length,d=s?e:Object.keys(e),f=d.length,m=s?new Array(f):{};let y=0;for(let v=0;v<f;v++){const b=s?v:d[v],_=t[b],j=e[b];if(_===j){m[b]=_,(s?v<o:e9.call(t,b))&&y++;continue}if(_===null||j===null||typeof _!="object"||typeof j!="object"){m[b]=j;continue}const w=Qm(_,j,n+1);m[b]=w,w===_&&y++}return o===f&&y===o?t:m}function _m(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 Lx(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 t9(t){return new Promise(e=>{Ou.setTimeout(e,t)})}function Ux(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Qm(t,e):e}function n9(t){return t}function _4(t,e,n=0){const s=[...t,e];return n&&s.length>n?s.slice(1):s}function a9(t,e,n=0){const s=[e,...t];return n&&s.length>n?s.slice(0,-1):s}var k1=Symbol();function C4(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===k1?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function L1(t,e){return typeof t=="function"?t(...e):!!t}function j4(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 $f=(()=>{let t=()=>S4;return{isServer(){return t()},setIsServer(e){t=e}}})();function Hx(){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 s9(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 r9(t){return{mutationKey:t.options.mutationKey,state:t.state,...t.options.scope&&{scope:t.options.scope},...t.meta&&{meta:t.meta}}}function i9(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 l9(t){return!0}function o9(t,e={}){var m,y,v,b;const n=e.shouldDehydrateMutation??((m=t.getDefaultOptions().dehydrate)==null?void 0:m.shouldDehydrateMutation)??E4,s=t.getMutationCache().getAll().flatMap(_=>n(_)?[r9(_)]:[]),i=e.shouldDehydrateQuery??((y=t.getDefaultOptions().dehydrate)==null?void 0:y.shouldDehydrateQuery)??T4,o=e.shouldRedactErrors??((v=t.getDefaultOptions().dehydrate)==null?void 0:v.shouldRedactErrors)??l9,d=e.serializeData??((b=t.getDefaultOptions().dehydrate)==null?void 0:b.serializeData)??w4,f=t.getQueryCache().getAll().flatMap(_=>i(_)?[i9(_,d,o)]:[]);return{mutations:s,queries:f}}function qx(t,e,n){var m,y;if(typeof e!="object"||e===null)return;const s=t.getMutationCache(),i=t.getQueryCache(),o=((m=n==null?void 0:n.defaultOptions)==null?void 0:m.deserializeData)??((y=t.getDefaultOptions().hydrate)==null?void 0:y.deserializeData)??w4,d=e.mutations||[],f=e.queries||[];d.forEach(({state:v,...b})=>{var _,j;s.build(t,{...(_=t.getDefaultOptions().hydrate)==null?void 0:_.mutations,...(j=n==null?void 0:n.defaultOptions)==null?void 0:j.mutations,...b},v)}),f.forEach(({queryKey:v,state:b,queryHash:_,meta:j,promise:w,dehydratedAt:R})=>{var H,B;const O=w?s9(w):void 0,T=b.data===void 0?O==null?void 0:O.data:b.data,A=T===void 0?T:o(T);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 L=O&&R!==void 0&&R>z.state.dataUpdatedAt;if(b.dataUpdatedAt>z.state.dataUpdatedAt||L){const{fetchStatus:V,...Z}=b;z.setState({...Z,data:A})}}else z=i.build(t,{...(H=t.getDefaultOptions().hydrate)==null?void 0:H.queries,...(B=n==null?void 0:n.defaultOptions)==null?void 0:B.queries,queryKey:v,queryHash:_,meta:j},{...b,data:A,fetchStatus:"idle",status:A!==void 0?"success":b.status});w&&!k&&!P&&(R===void 0||R>z.state.dataUpdatedAt)&&z.fetch(void 0,{initialPromise:Promise.resolve(w).then(o)}).catch(ma)})}var R4=W7;function u9(){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(m=>{n(m)})})})};return{batch:f=>{let m;e++;try{m=f()}finally{e--,e||d()}return m},batchCalls:f=>(...m)=>{o(()=>{f(...m)})},schedule:o,setNotifyFunction:f=>{n=f},setBatchNotifyFunction:f=>{s=f},setScheduler:f=>{i=f}}}var Ln=u9(),Hf,Nu,qf,c4,c9=(c4=class extends td{constructor(){super();He(this,Hf,!0);He(this,Nu);He(this,qf);Oe(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,Nu)||this.setEventListener(Q(this,qf))}onUnsubscribe(){var e;this.hasListeners()||((e=Q(this,Nu))==null||e.call(this),Oe(this,Nu,void 0))}setEventListener(e){var n;Oe(this,qf,e),(n=Q(this,Nu))==null||n.call(this),Oe(this,Nu,e(this.setOnline.bind(this)))}setOnline(e){Q(this,Hf)!==e&&(Oe(this,Hf,e),this.listeners.forEach(s=>{s(e)}))}isOnline(){return Q(this,Hf)}},Hf=new WeakMap,Nu=new WeakMap,qf=new WeakMap,c4),Cm=new c9;function d9(t){return Math.min(1e3*2**t,3e4)}function O4(t){return(t??"online")==="online"?Cm.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 f9(t){return t instanceof jm}function A4(t){let e=!1,n=0,s;const i=Hx(),o=()=>i.status!=="pending",d=R=>{var O;if(!o()){const T=new jm(R);_(T),(O=t.onCancel)==null||O.call(t,T)}},f=()=>{e=!0},m=()=>{e=!1},y=()=>z1.isFocused()&&(t.networkMode==="always"||Cm.isOnline())&&t.canRun(),v=()=>O4(t.networkMode)&&t.canRun(),b=R=>{o()||(s==null||s(),i.resolve(R))},_=R=>{o()||(s==null||s(),i.reject(R))},j=()=>new Promise(R=>{var O;s=T=>{(o()||y())&&R(T)},(O=t.onPause)==null||O.call(t)}).then(()=>{var R;s=void 0,o()||(R=t.onContinue)==null||R.call(t)}),w=()=>{if(o())return;let R;const O=n===0?t.initialPromise:void 0;try{R=O??t.fn()}catch(T){R=Promise.reject(T)}Promise.resolve(R).then(b).catch(T=>{var H;if(o())return;const A=t.retry??($f.isServer()?0:3),z=t.retryDelay??d9,k=typeof z=="function"?z(n,T):z,P=A===!0||typeof A=="number"&&n<A||typeof A=="function"&&A(n,T);if(e||!P){_(T);return}n++,(H=t.onFail)==null||H.call(t,n,T),t9(k).then(()=>y()?void 0:j()).then(()=>{e?_(T):w()})})};return{promise:i,status:()=>i.status,cancel:d,continue:()=>(s==null||s(),i),cancelRetry:f,continueRetry:m,canStart:v,start:()=>(v()?w():j().then(w),i)}}var Bc,d4,M4=(d4=class{constructor(){He(this,Bc)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Dx(this.gcTime)&&Oe(this,Bc,Ou.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??($f.isServer()?1/0:300*1e3))}clearGcTimeout(){Q(this,Bc)&&(Ou.clearTimeout(Q(this,Bc)),Oe(this,Bc,void 0))}},Bc=new WeakMap,d4),Gc,Bf,ai,Pc,Va,Lm,Yc,jr,z4,ao,f4,D4=(f4=class extends M4{constructor(e){super();He(this,jr);He(this,Gc);He(this,Bf);He(this,ai);He(this,Pc);He(this,Va);He(this,Lm);He(this,Yc);Oe(this,Yc,!1),Oe(this,Lm,e.defaultOptions),this.setOptions(e.options),this.observers=[],Oe(this,Pc,e.client),Oe(this,ai,Q(this,Pc).getQueryCache()),this.queryKey=e.queryKey,this.queryHash=e.queryHash,Oe(this,Gc,A2(this.options)),this.state=e.state??Q(this,Gc),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,Lm),...e},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=A2(this.options);n.data!==void 0&&(this.setState(O2(n.data,n.dataUpdatedAt)),Oe(this,Gc,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&Q(this,ai).remove(this)}setData(e,n){const s=Ux(this.state.data,e,this.options);return Je(this,jr,ao).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,jr,ao).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,Gc)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>ri(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===k1||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(e=>Au(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,ai).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,Yc)||Je(this,jr,z4).call(this)?Q(this,Va).cancel({revert:!0}):Q(this,Va).cancelRetry()),this.scheduleGc()),Q(this,ai).notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Je(this,jr,ao).call(this,{type:"invalidate"})}async fetch(e,n){var m,y,v,b,_,j,w,R,O,T,A,z;if(this.state.fetchStatus!=="idle"&&((m=Q(this,Va))==null?void 0:m.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:()=>(Oe(this,Yc,!0),s.signal)})},o=()=>{const k=C4(this.options,n),H=(()=>{const B={client:Q(this,Pc),queryKey:this.queryKey,meta:this.meta};return i(B),B})();return Oe(this,Yc,!1),this.options.persister?this.options.persister(k,H,this):k(H)},f=(()=>{const k={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:Q(this,Pc),state:this.state,fetchFn:o};return i(k),k})();(y=this.options.behavior)==null||y.onFetch(f,this),Oe(this,Bf,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((v=f.fetchOptions)==null?void 0:v.meta))&&Je(this,jr,ao).call(this,{type:"fetch",meta:(b=f.fetchOptions)==null?void 0:b.meta}),Oe(this,Va,A4({initialPromise:n==null?void 0:n.initialPromise,fn:f.fetchFn,onCancel:k=>{k instanceof jm&&k.revert&&this.setState({...Q(this,Bf),fetchStatus:"idle"}),s.abort()},onFail:(k,P)=>{Je(this,jr,ao).call(this,{type:"failed",failureCount:k,error:P})},onPause:()=>{Je(this,jr,ao).call(this,{type:"pause"})},onContinue:()=>{Je(this,jr,ao).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),(j=(_=Q(this,ai).config).onSuccess)==null||j.call(_,k,this),(R=(w=Q(this,ai).config).onSettled)==null||R.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,jr,ao).call(this,{type:"error",error:k}),(T=(O=Q(this,ai).config).onError)==null||T.call(O,k,this),(z=(A=Q(this,ai).config).onSettled)==null||z.call(A,this.state.data,k,this),k}finally{this.scheduleGc()}}},Gc=new WeakMap,Bf=new WeakMap,ai=new WeakMap,Pc=new WeakMap,Va=new WeakMap,Lm=new WeakMap,Yc=new WeakMap,jr=new WeakSet,z4=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ao=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 Oe(this,Bf,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),Ln.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),Q(this,ai).notify({query:this,type:"updated",action:e})})},f4);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 A2(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 ur,Ht,Um,qs,Vc,Gf,io,_u,Hm,Pf,Yf,Qc,Kc,Cu,Vf,an,om,Bx,Gx,Px,Yx,Vx,Qx,Kx,L4,h4,rh=(h4=class extends td{constructor(e,n){super();He(this,an);He(this,ur);He(this,Ht);He(this,Um);He(this,qs);He(this,Vc);He(this,Gf);He(this,io);He(this,_u);He(this,Hm);He(this,Pf);He(this,Yf);He(this,Qc);He(this,Kc);He(this,Cu);He(this,Vf,new Set);this.options=n,Oe(this,ur,e),Oe(this,_u,null),Oe(this,io,Hx()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(Q(this,Ht).addObserver(this),M2(Q(this,Ht),this.options)?Je(this,an,om).call(this):this.updateResult(),Je(this,an,Yx).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Xx(Q(this,Ht),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Xx(Q(this,Ht),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Je(this,an,Vx).call(this),Je(this,an,Qx).call(this),Q(this,Ht).removeObserver(this)}setOptions(e){const n=this.options,s=Q(this,Ht);if(this.options=Q(this,ur).defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof ri(this.options.enabled,Q(this,Ht))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Je(this,an,Kx).call(this),Q(this,Ht).setOptions(this.options),n._defaulted&&!_m(this.options,n)&&Q(this,ur).getQueryCache().notify({type:"observerOptionsUpdated",query:Q(this,Ht),observer:this});const i=this.hasListeners();i&&D2(Q(this,Ht),s,this.options,n)&&Je(this,an,om).call(this),this.updateResult(),i&&(Q(this,Ht)!==s||ri(this.options.enabled,Q(this,Ht))!==ri(n.enabled,Q(this,Ht))||Au(this.options.staleTime,Q(this,Ht))!==Au(n.staleTime,Q(this,Ht)))&&Je(this,an,Bx).call(this);const o=Je(this,an,Gx).call(this);i&&(Q(this,Ht)!==s||ri(this.options.enabled,Q(this,Ht))!==ri(n.enabled,Q(this,Ht))||o!==Q(this,Cu))&&Je(this,an,Px).call(this,o)}getOptimisticResult(e){const n=Q(this,ur).getQueryCache().build(Q(this,ur),e),s=this.createResult(n,e);return p9(this,s)&&(Oe(this,qs,s),Oe(this,Gf,this.options),Oe(this,Vc,Q(this,Ht).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,io).status==="pending"&&Q(this,io).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(s,i))})}trackProp(e){Q(this,Vf).add(e)}getCurrentQuery(){return Q(this,Ht)}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){const n=Q(this,ur).defaultQueryOptions(e),s=Q(this,ur).getQueryCache().build(Q(this,ur),n);return s.fetch().then(()=>this.createResult(s,n))}fetch(e){return Je(this,an,om).call(this,{...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),Q(this,qs)))}createResult(e,n){var V;const s=Q(this,Ht),i=this.options,o=Q(this,qs),d=Q(this,Vc),f=Q(this,Gf),y=e!==s?e.state:Q(this,Um),{state:v}=e;let b={...v},_=!1,j;if(n._optimisticResults){const Z=this.hasListeners(),ue=!Z&&M2(e,n),ae=Z&&D2(e,s,n,i);(ue||ae)&&(b={...b,...k4(v.data,e.options)}),n._optimisticResults==="isRestoring"&&(b.fetchStatus="idle")}let{error:w,errorUpdatedAt:R,status:O}=b;j=b.data;let T=!1;if(n.placeholderData!==void 0&&j===void 0&&O==="pending"){let Z;o!=null&&o.isPlaceholderData&&n.placeholderData===(f==null?void 0:f.placeholderData)?(Z=o.data,T=!0):Z=typeof n.placeholderData=="function"?n.placeholderData((V=Q(this,Yf))==null?void 0:V.state.data,Q(this,Yf)):n.placeholderData,Z!==void 0&&(O="success",j=Ux(o==null?void 0:o.data,Z,n),_=!0)}if(n.select&&j!==void 0&&!T)if(o&&j===(d==null?void 0:d.data)&&n.select===Q(this,Hm))j=Q(this,Pf);else try{Oe(this,Hm,n.select),j=n.select(j),j=Ux(o==null?void 0:o.data,j,n),Oe(this,Pf,j),Oe(this,_u,null)}catch(Z){Oe(this,_u,Z)}Q(this,_u)&&(w=Q(this,_u),j=Q(this,Pf),R=Date.now(),O="error");const A=b.fetchStatus==="fetching",z=O==="pending",k=O==="error",P=z&&A,H=j!==void 0,L={status:O,fetchStatus:b.fetchStatus,isPending:z,isSuccess:O==="success",isError:k,isInitialLoading:P,isLoading:P,data:j,dataUpdatedAt:b.dataUpdatedAt,error:w,errorUpdatedAt:R,failureCount:b.fetchFailureCount,failureReason:b.fetchFailureReason,errorUpdateCount:b.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:b.dataUpdateCount>y.dataUpdateCount||b.errorUpdateCount>y.errorUpdateCount,isFetching:A,isRefetching:A&&!z,isLoadingError:k&&!H,isPaused:b.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:k&&H,isStale:Vb(e,n),refetch:this.refetch,promise:Q(this,io),isEnabled:ri(n.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){const Z=L.data!==void 0,ue=L.status==="error"&&!Z,ae=ce=>{ue?ce.reject(L.error):Z&&ce.resolve(L.data)},J=()=>{const ce=Oe(this,io,L.promise=Hx());ae(ce)},le=Q(this,io);switch(le.status){case"pending":e.queryHash===s.queryHash&&ae(le);break;case"fulfilled":(ue||L.data!==le.value)&&J();break;case"rejected":(!ue||L.error!==le.reason)&&J();break}}return L}updateResult(){const e=Q(this,qs),n=this.createResult(Q(this,Ht),this.options);if(Oe(this,Vc,Q(this,Ht).state),Oe(this,Gf,this.options),Q(this,Vc).data!==void 0&&Oe(this,Yf,Q(this,Ht)),_m(n,e))return;Oe(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,Vf).size)return!0;const d=new Set(o??Q(this,Vf));return this.options.throwOnError&&d.add("error"),Object.keys(Q(this,qs)).some(f=>{const m=f;return Q(this,qs)[m]!==e[m]&&d.has(m)})};Je(this,an,L4).call(this,{listeners:s()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Je(this,an,Yx).call(this)}},ur=new WeakMap,Ht=new WeakMap,Um=new WeakMap,qs=new WeakMap,Vc=new WeakMap,Gf=new WeakMap,io=new WeakMap,_u=new WeakMap,Hm=new WeakMap,Pf=new WeakMap,Yf=new WeakMap,Qc=new WeakMap,Kc=new WeakMap,Cu=new WeakMap,Vf=new WeakMap,an=new WeakSet,om=function(e){Je(this,an,Kx).call(this);let n=Q(this,Ht).fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(ma)),n},Bx=function(){Je(this,an,Vx).call(this);const e=Au(this.options.staleTime,Q(this,Ht));if($f.isServer()||Q(this,qs).isStale||!Dx(e))return;const s=N4(Q(this,qs).dataUpdatedAt,e)+1;Oe(this,Qc,Ou.setTimeout(()=>{Q(this,qs).isStale||this.updateResult()},s))},Gx=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(Q(this,Ht)):this.options.refetchInterval)??!1},Px=function(e){Je(this,an,Qx).call(this),Oe(this,Cu,e),!($f.isServer()||ri(this.options.enabled,Q(this,Ht))===!1||!Dx(Q(this,Cu))||Q(this,Cu)===0)&&Oe(this,Kc,Ou.setInterval(()=>{(this.options.refetchIntervalInBackground||z1.isFocused())&&Je(this,an,om).call(this)},Q(this,Cu)))},Yx=function(){Je(this,an,Bx).call(this),Je(this,an,Px).call(this,Je(this,an,Gx).call(this))},Vx=function(){Q(this,Qc)&&(Ou.clearTimeout(Q(this,Qc)),Oe(this,Qc,void 0))},Qx=function(){Q(this,Kc)&&(Ou.clearInterval(Q(this,Kc)),Oe(this,Kc,void 0))},Kx=function(){const e=Q(this,ur).getQueryCache().build(Q(this,ur),this.options);if(e===Q(this,Ht))return;const n=Q(this,Ht);Oe(this,Ht,e),Oe(this,Um,e.state),this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))},L4=function(e){Ln.batch(()=>{e.listeners&&this.listeners.forEach(n=>{n(Q(this,qs))}),Q(this,ur).getQueryCache().notify({query:Q(this,Ht),type:"observerResultsUpdated"})})},h4);function h9(t,e){return ri(e.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&e.retryOnMount===!1)}function M2(t,e){return h9(t,e)||t.state.data!==void 0&&Xx(t,e,e.refetchOnMount)}function Xx(t,e,n){if(ri(e.enabled,t)!==!1&&Au(e.staleTime,t)!=="static"){const s=typeof n=="function"?n(t):n;return s==="always"||s!==!1&&Vb(t,e)}return!1}function D2(t,e,n,s){return(t!==e||ri(s.enabled,t)===!1)&&(!n.suspense||t.state.status!=="error")&&Vb(t,n)}function Vb(t,e){return ri(e.enabled,t)!==!1&&t.isStaleByTime(Au(e.staleTime,t))}function p9(t,e){return!_m(t.getCurrentResult(),e)}function v1(t){return{onFetch:(e,n)=>{var v,b,_,j,w;const s=e.options,i=(_=(b=(v=e.fetchOptions)==null?void 0:v.meta)==null?void 0:b.fetchMore)==null?void 0:_.direction,o=((j=e.state.data)==null?void 0:j.pages)||[],d=((w=e.state.data)==null?void 0:w.pageParams)||[];let f={pages:[],pageParams:[]},m=0;const y=async()=>{let R=!1;const O=z=>{j4(z,()=>e.signal,()=>R=!0)},T=C4(e.options,e.fetchOptions),A=async(z,k,P)=>{if(R)return Promise.reject();if(k==null&&z.pages.length)return Promise.resolve(z);const B=(()=>{const ue={client:e.client,queryKey:e.queryKey,pageParam:k,direction:P?"backward":"forward",meta:e.options.meta};return O(ue),ue})(),L=await T(B),{maxPages:V}=e.options,Z=P?a9:_4;return{pages:Z(z.pages,L,V),pageParams:Z(z.pageParams,k,V)}};if(i&&o.length){const z=i==="backward",k=z?U4:Fx,P={pages:o,pageParams:d},H=k(s,P);f=await A(P,H,z)}else{const z=t??o.length;do{const k=m===0?d[0]??s.initialPageParam:Fx(s,f);if(m>0&&k==null)break;f=await A(f,k),m++}while(m<z)}return f};e.options.persister?e.fetchFn=()=>{var R,O;return(O=(R=e.options).persister)==null?void 0:O.call(R,y,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=y}}}function Fx(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 m9(t,e){return e?Fx(t,e)!=null:!1}function g9(t,e){return!e||!t.getPreviousPageParam?!1:U4(t,e)!=null}var Qb=class extends rh{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:v1()})}getOptimisticResult(t){return t.behavior=v1(),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,R;const{state:n}=t,s=super.createResult(t,e),{isFetching:i,isRefetching:o,isError:d,isRefetchError:f}=s,m=(R=(w=n.fetchMeta)==null?void 0:w.fetchMore)==null?void 0:R.direction,y=d&&m==="forward",v=i&&m==="forward",b=d&&m==="backward",_=i&&m==="backward";return{...s,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:m9(e,n.data),hasPreviousPage:g9(e,n.data),isFetchNextPageError:y,isFetchingNextPage:v,isFetchPreviousPageError:b,isFetchingPreviousPage:_,isRefetchError:f&&!y&&!b,isRefetching:o&&!v&&!_}}},qm,dl,vs,Xc,fl,pu,p4,H4=(p4=class extends M4{constructor(e){super();He(this,fl);He(this,qm);He(this,dl);He(this,vs);He(this,Xc);Oe(this,qm,e.client),this.mutationId=e.mutationId,Oe(this,vs,e.mutationCache),Oe(this,dl,[]),this.state=e.state||q4(),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,dl).includes(e)||(Q(this,dl).push(e),this.clearGcTimeout(),Q(this,vs).notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){Oe(this,dl,Q(this,dl).filter(n=>n!==e)),this.scheduleGc(),Q(this,vs).notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){Q(this,dl).length||(this.state.status==="pending"?this.scheduleGc():Q(this,vs).remove(this))}continue(){var e;return((e=Q(this,Xc))==null?void 0:e.continue())??this.execute(this.state.variables)}async execute(e){var d,f,m,y,v,b,_,j,w,R,O,T,A,z,k,P,H,B;const n=()=>{Je(this,fl,pu).call(this,{type:"continue"})},s={client:Q(this,qm),meta:this.options.meta,mutationKey:this.options.mutationKey};Oe(this,Xc,A4({fn:()=>this.options.mutationFn?this.options.mutationFn(e,s):Promise.reject(new Error("No mutationFn found")),onFail:(L,V)=>{Je(this,fl,pu).call(this,{type:"failed",failureCount:L,error:V})},onPause:()=>{Je(this,fl,pu).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>Q(this,vs).canRun(this)}));const i=this.state.status==="pending",o=!Q(this,Xc).canStart();try{if(i)n();else{Je(this,fl,pu).call(this,{type:"pending",variables:e,isPaused:o}),Q(this,vs).config.onMutate&&await Q(this,vs).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,fl,pu).call(this,{type:"pending",context:V,variables:e,isPaused:o})}const L=await Q(this,Xc).start();return await((y=(m=Q(this,vs).config).onSuccess)==null?void 0:y.call(m,L,e,this.state.context,this,s)),await((b=(v=this.options).onSuccess)==null?void 0:b.call(v,L,e,this.state.context,s)),await((j=(_=Q(this,vs).config).onSettled)==null?void 0:j.call(_,L,null,this.state.variables,this.state.context,this,s)),await((R=(w=this.options).onSettled)==null?void 0:R.call(w,L,null,e,this.state.context,s)),Je(this,fl,pu).call(this,{type:"success",data:L}),L}catch(L){try{await((T=(O=Q(this,vs).config).onError)==null?void 0:T.call(O,L,e,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((z=(A=this.options).onError)==null?void 0:z.call(A,L,e,this.state.context,s))}catch(V){Promise.reject(V)}try{await((P=(k=Q(this,vs).config).onSettled)==null?void 0:P.call(k,void 0,L,this.state.variables,this.state.context,this,s))}catch(V){Promise.reject(V)}try{await((B=(H=this.options).onSettled)==null?void 0:B.call(H,void 0,L,e,this.state.context,s))}catch(V){Promise.reject(V)}throw Je(this,fl,pu).call(this,{type:"error",error:L}),L}finally{Q(this,vs).runNext(this)}}},qm=new WeakMap,dl=new WeakMap,vs=new WeakMap,Xc=new WeakMap,fl=new WeakSet,pu=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),Ln.batch(()=>{Q(this,dl).forEach(s=>{s.onMutationUpdate(e)}),Q(this,vs).notify({mutation:this,type:"updated",action:e})})},p4);function q4(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var lo,Ti,Bm,m4,B4=(m4=class extends td{constructor(e={}){super();He(this,lo);He(this,Ti);He(this,Bm);this.config=e,Oe(this,lo,new Set),Oe(this,Ti,new Map),Oe(this,Bm,0)}build(e,n,s){const i=new H4({client:e,mutationCache:this,mutationId:++H0(this,Bm)._,options:e.defaultMutationOptions(n),state:s});return this.add(i),i}add(e){Q(this,lo).add(e);const n=q0(e);if(typeof n=="string"){const s=Q(this,Ti).get(n);s?s.push(e):Q(this,Ti).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(Q(this,lo).delete(e)){const n=q0(e);if(typeof n=="string"){const s=Q(this,Ti).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,Ti).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=q0(e);if(typeof n=="string"){const s=Q(this,Ti).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,Ti).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(){Ln.batch(()=>{Q(this,lo).forEach(e=>{this.notify({type:"removed",mutation:e})}),Q(this,lo).clear(),Q(this,Ti).clear()})}getAll(){return Array.from(Q(this,lo))}find(e){const n={exact:!0,...e};return this.getAll().find(s=>kx(n,s))}findAll(e={}){return this.getAll().filter(n=>kx(e,n))}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return Ln.batch(()=>Promise.all(e.map(n=>n.continue().catch(ma))))}},lo=new WeakMap,Ti=new WeakMap,Bm=new WeakMap,m4);function q0(t){var e;return(e=t.options.scope)==null?void 0:e.id}var oo,ju,cr,uo,fo,f1,Zx,g4,G4=(g4=class extends td{constructor(n,s){super();He(this,fo);He(this,oo);He(this,ju);He(this,cr);He(this,uo);Oe(this,oo,n),this.setOptions(s),this.bindMethods(),Je(this,fo,f1).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,oo).defaultMutationOptions(n),_m(this.options,s)||Q(this,oo).getMutationCache().notify({type:"observerOptionsUpdated",mutation:Q(this,cr),observer:this}),s!=null&&s.mutationKey&&this.options.mutationKey&&Mu(s.mutationKey)!==Mu(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,f1).call(this),Je(this,fo,Zx).call(this,n)}getCurrentResult(){return Q(this,ju)}reset(){var n;(n=Q(this,cr))==null||n.removeObserver(this),Oe(this,cr,void 0),Je(this,fo,f1).call(this),Je(this,fo,Zx).call(this)}mutate(n,s){var i;return Oe(this,uo,s),(i=Q(this,cr))==null||i.removeObserver(this),Oe(this,cr,Q(this,oo).getMutationCache().build(Q(this,oo),this.options)),Q(this,cr).addObserver(this),Q(this,cr).execute(n)}},oo=new WeakMap,ju=new WeakMap,cr=new WeakMap,uo=new WeakMap,fo=new WeakSet,f1=function(){var s;const n=((s=Q(this,cr))==null?void 0:s.state)??q4();Oe(this,ju,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},Zx=function(n){Ln.batch(()=>{var s,i,o,d,f,m,y,v;if(Q(this,uo)&&this.hasListeners()){const b=Q(this,ju).variables,_=Q(this,ju).context,j={client:Q(this,oo),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(i=(s=Q(this,uo)).onSuccess)==null||i.call(s,n.data,b,_,j)}catch(w){Promise.reject(w)}try{(d=(o=Q(this,uo)).onSettled)==null||d.call(o,n.data,null,b,_,j)}catch(w){Promise.reject(w)}}else if((n==null?void 0:n.type)==="error"){try{(m=(f=Q(this,uo)).onError)==null||m.call(f,n.error,b,_,j)}catch(w){Promise.reject(w)}try{(v=(y=Q(this,uo)).onSettled)==null||v.call(y,void 0,n.error,b,_,j)}catch(w){Promise.reject(w)}}}this.listeners.forEach(b=>{b(Q(this,ju))})})},g4);function z2(t,e){const n=new Set(e);return t.filter(s=>!n.has(s))}function y9(t,e,n){const s=t.slice(0);return s[e]=n,s}var Qf,Cr,Kf,Xf,si,wu,Gm,Pm,Ym,Vm,rs,Ix,Jx,Wx,$x,eb,y4,P4=(y4=class extends td{constructor(e,n,s){super();He(this,rs);He(this,Qf);He(this,Cr);He(this,Kf);He(this,Xf);He(this,si);He(this,wu);He(this,Gm);He(this,Pm);He(this,Ym);He(this,Vm,[]);Oe(this,Qf,e),Oe(this,Xf,s),Oe(this,Kf,[]),Oe(this,si,[]),Oe(this,Cr,[]),this.setQueries(n)}onSubscribe(){this.listeners.size===1&&Q(this,si).forEach(e=>{e.subscribe(n=>{Je(this,rs,$x).call(this,e,n)})})}onUnsubscribe(){this.listeners.size||this.destroy()}destroy(){this.listeners=new Set,Q(this,si).forEach(e=>{e.destroy()})}setQueries(e,n){Oe(this,Kf,e),Oe(this,Xf,n),Ln.batch(()=>{const s=Q(this,si),i=Je(this,rs,Wx).call(this,Q(this,Kf));i.forEach(b=>b.observer.setOptions(b.defaultedQueryOptions));const o=i.map(b=>b.observer),d=o.map(b=>b.getCurrentResult()),f=s.length!==o.length,m=o.some((b,_)=>b!==s[_]),y=f||m,v=y?!0:d.some((b,_)=>{const j=Q(this,Cr)[_];return!j||!_m(b,j)});!y&&!v||(y&&(Oe(this,Vm,i),Oe(this,si,o)),Oe(this,Cr,d),this.hasListeners()&&(y&&(z2(s,o).forEach(b=>{b.destroy()}),z2(o,s).forEach(b=>{b.subscribe(_=>{Je(this,rs,$x).call(this,b,_)})})),Je(this,rs,eb).call(this)))})}getCurrentResult(){return Q(this,Cr)}getQueries(){return Q(this,si).map(e=>e.getCurrentQuery())}getObservers(){return Q(this,si)}getOptimisticResult(e,n){const s=Je(this,rs,Wx).call(this,e),i=s.map(d=>d.observer.getOptimisticResult(d.defaultedQueryOptions)),o=s.map(d=>d.defaultedQueryOptions.queryHash);return[i,d=>Je(this,rs,Jx).call(this,d??i,n,o),()=>Je(this,rs,Ix).call(this,i,s)]}},Qf=new WeakMap,Cr=new WeakMap,Kf=new WeakMap,Xf=new WeakMap,si=new WeakMap,wu=new WeakMap,Gm=new WeakMap,Pm=new WeakMap,Ym=new WeakMap,Vm=new WeakMap,rs=new WeakSet,Ix=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)})})})},Jx=function(e,n,s){if(n){const i=Q(this,Ym),o=s!==void 0&&i!==void 0&&(i.length!==s.length||s.some((d,f)=>d!==i[f]));return(!Q(this,wu)||Q(this,Cr)!==Q(this,Pm)||o||n!==Q(this,Gm))&&(Oe(this,Gm,n),Oe(this,Pm,Q(this,Cr)),s!==void 0&&Oe(this,Ym,s),Oe(this,wu,Qm(Q(this,wu),n(e)))),Q(this,wu)}return e},Wx=function(e){const n=new Map;Q(this,si).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 m;const o=Q(this,Qf).defaultQueryOptions(i),f=((m=n.get(o.queryHash))==null?void 0:m.shift())??new rh(Q(this,Qf),o);s.push({defaultedQueryOptions:o,observer:f})}),s},$x=function(e,n){const s=Q(this,si).indexOf(e);s!==-1&&(Oe(this,Cr,y9(Q(this,Cr),s,n)),Je(this,rs,eb).call(this))},eb=function(){var e;if(this.hasListeners()){const n=Q(this,wu),s=Je(this,rs,Ix).call(this,Q(this,Cr),Q(this,Vm)),i=Je(this,rs,Jx).call(this,s,(e=Q(this,Xf))==null?void 0:e.combine);n!==i&&Ln.batch(()=>{this.listeners.forEach(o=>{o(Q(this,Cr))})})}},y4),hl,x4,Y4=(x4=class extends td{constructor(e={}){super();He(this,hl);this.config=e,Oe(this,hl,new Map)}build(e,n,s){const i=n.queryKey,o=n.queryHash??Yb(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,hl).has(e.queryHash)||(Q(this,hl).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=Q(this,hl).get(e.queryHash);n&&(e.destroy(),n===e&&Q(this,hl).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){Ln.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return Q(this,hl).get(e)}getAll(){return[...Q(this,hl).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(s=>zx(n,s))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(s=>zx(e,s)):n}notify(e){Ln.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ln.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},hl=new WeakMap,x4),ra,Eu,Tu,Ff,Zf,Ru,If,Jf,b4,V4=(b4=class{constructor(t={}){He(this,ra);He(this,Eu);He(this,Tu);He(this,Ff);He(this,Zf);He(this,Ru);He(this,If);He(this,Jf);Oe(this,ra,t.queryCache||new Y4),Oe(this,Eu,t.mutationCache||new B4),Oe(this,Tu,t.defaultOptions||{}),Oe(this,Ff,new Map),Oe(this,Zf,new Map),Oe(this,Ru,0)}mount(){H0(this,Ru)._++,Q(this,Ru)===1&&(Oe(this,If,z1.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ra).onFocus())})),Oe(this,Jf,Cm.subscribe(async t=>{t&&(await this.resumePausedMutations(),Q(this,ra).onOnline())})))}unmount(){var t,e;H0(this,Ru)._--,Q(this,Ru)===0&&((t=Q(this,If))==null||t.call(this),Oe(this,If,void 0),(e=Q(this,Jf))==null||e.call(this),Oe(this,Jf,void 0))}isFetching(t){return Q(this,ra).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return Q(this,Eu).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=Q(this,ra).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=Q(this,ra).build(this,e),s=n.state.data;return s===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(Au(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(s))}getQueriesData(t){return Q(this,ra).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,ra).get(s.queryHash),o=i==null?void 0:i.state.data,d=$7(e,o);if(d!==void 0)return Q(this,ra).build(this,s).setData(d,{...n,manual:!0})}setQueriesData(t,e,n){return Ln.batch(()=>Q(this,ra).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,ra).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=Q(this,ra);Ln.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=Q(this,ra);return Ln.batch(()=>(n.findAll(t).forEach(s=>{s.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},s=Ln.batch(()=>Q(this,ra).findAll(t).map(i=>i.cancel(n)));return Promise.all(s).then(ma).catch(ma)}invalidateQueries(t,e={}){return Ln.batch(()=>(Q(this,ra).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=Ln.batch(()=>Q(this,ra).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,ra).build(this,e);return n.isStaleByTime(Au(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=v1(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(ma).catch(ma)}ensureInfiniteQueryData(t){return t.behavior=v1(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Cm.isOnline()?Q(this,Eu).resumePausedMutations():Promise.resolve()}getQueryCache(){return Q(this,ra)}getMutationCache(){return Q(this,Eu)}getDefaultOptions(){return Q(this,Tu)}setDefaultOptions(t){Oe(this,Tu,t)}setQueryDefaults(t,e){Q(this,Ff).set(Mu(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...Q(this,Ff).values()],n={};return e.forEach(s=>{Wf(t,s.queryKey)&&Object.assign(n,s.defaultOptions)}),n}setMutationDefaults(t,e){Q(this,Zf).set(Mu(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...Q(this,Zf).values()],n={};return e.forEach(s=>{Wf(t,s.mutationKey)&&Object.assign(n,s.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...Q(this,Tu).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=Yb(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===k1&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...Q(this,Tu).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){Q(this,ra).clear(),Q(this,Eu).clear()}},ra=new WeakMap,Eu=new WeakMap,Tu=new WeakMap,Ff=new WeakMap,Zf=new WeakMap,Ru=new WeakMap,If=new WeakMap,Jf=new WeakMap,b4);function x9({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,m=!1;const y=j4({client:i.client,meta:i.meta,queryKey:i.queryKey,pageParam:i.pageParam,direction:i.direction},()=>i.signal,()=>m=!0),v=await t(y),b=d&&e==="replace";for await(const _ of v){if(m)break;b?f=n(f,_):i.client.setQueryData(i.queryKey,j=>n(j===void 0?s:j,_))}return b&&!m&&i.client.setQueryData(i.queryKey,f),i.client.getQueryData(i.queryKey)??s}}var b9=Symbol("dataTagSymbol"),v9=Symbol("dataTagErrorSymbol"),S9=Symbol("unsetMarker"),Kb=D.createContext(void 0),ga=t=>{const e=D.useContext(Kb);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(Kb.Provider,{value:t,children:e})),K4=D.createContext(!1),Xb=()=>D.useContext(K4),N9=K4.Provider;function X4(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var F4=D.createContext(X4()),Fb=()=>D.useContext(F4),_9=({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"?L1(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||L1(n,[t.error,s])),Zb=(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))}},C9=(t,e)=>t.isLoading&&t.isFetching&&!e,tb=(t,e)=>(t==null?void 0:t.suspense)&&e.isPending,nb=(t,e,n)=>e.fetchOptimistic(t).catch(()=>{n.clearReset()});function $4({queries:t,...e},n){const s=ga(n),i=Xb(),o=Fb(),d=D.useMemo(()=>t.map(R=>{const O=s.defaultQueryOptions(R);return O._optimisticResults=i?"isRestoring":"optimistic",O}),[t,s,i]);d.forEach(R=>{W4(R);const O=s.getQueryCache().get(R.queryHash);Z4(R,o,O)}),I4(o);const[f]=D.useState(()=>new P4(s,d,e)),[m,y,v]=f.getOptimisticResult(d,e.combine),b=!i&&e.subscribed!==!1;D.useSyncExternalStore(D.useCallback(R=>b?f.subscribe(Ln.batchCalls(R)):ma,[f,b]),()=>f.getCurrentResult(),()=>f.getCurrentResult()),D.useEffect(()=>{f.setQueries(d,e)},[d,e,f]);const j=m.some((R,O)=>tb(d[O],R))?m.flatMap((R,O)=>{const T=d[O];if(T&&tb(T,R)){const A=new rh(s,T);return nb(T,A,o)}return[]}):[];if(j.length>0)throw Promise.all(j);const w=m.find((R,O)=>{const T=d[O];return T&&J4({result:R,errorResetBoundary:o,throwOnError:T.throwOnError,query:s.getQueryCache().get(T.queryHash),suspense:T.suspense})});if(w!=null&&w.error)throw w.error;return y(v())}function U1(t,e,n){var _,j,w,R;const s=Xb(),i=Fb(),o=ga(n),d=o.defaultQueryOptions(t);(j=(_=o.getDefaultOptions().queries)==null?void 0:_._experimental_beforeQuery)==null||j.call(_,d);const f=o.getQueryCache().get(d.queryHash);d._optimisticResults=s?"isRestoring":"optimistic",W4(d),Z4(d,i,f),I4(i);const m=!o.getQueryCache().get(d.queryHash),[y]=D.useState(()=>new e(o,d)),v=y.getOptimisticResult(d),b=!s&&t.subscribed!==!1;if(D.useSyncExternalStore(D.useCallback(O=>{const T=b?y.subscribe(Ln.batchCalls(O)):ma;return y.updateResult(),T},[y,b]),()=>y.getCurrentResult(),()=>y.getCurrentResult()),D.useEffect(()=>{y.setOptions(d)},[d,y]),tb(d,v))throw nb(d,y,i);if(J4({result:v,errorResetBoundary:i,throwOnError:d.throwOnError,query:f,suspense:d.suspense}))throw v.error;if((R=(w=o.getDefaultOptions().queries)==null?void 0:w._experimental_afterQuery)==null||R.call(w,d,v),d.experimental_prefetchInRender&&!$f.isServer()&&C9(v,s)){const O=m?nb(d,y,i):f==null?void 0:f.promise;O==null||O.catch(ma).finally(()=>{y.updateResult()})}return d.notifyOnChangeProps?v:y.trackResult(v)}function pt(t,e){return U1(t,rh,e)}function j9(t,e){return U1({...t,enabled:!0,suspense:!0,throwOnError:Zb,placeholderData:void 0},rh,e)}function w9(t,e){return U1({...t,enabled:!0,suspense:!0,throwOnError:Zb},Qb,e)}function E9(t,e){return $4({...t,queries:t.queries.map(n=>({...n,suspense:!0,throwOnError:Zb,enabled:!0,placeholderData:void 0}))},e)}function T9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchQuery(t)}function R9(t,e){const n=ga(e);n.getQueryState(t.queryKey)||n.prefetchInfiniteQuery(t)}function O9(t){return t}function A9(t){return t}var M9=({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(),m=n.queries||[],y=[],v=[];for(const b of m){const _=f.get(b.queryHash);_?(b.state.dataUpdatedAt>_.state.dataUpdatedAt||b.promise&&_.state.status!=="pending"&&_.state.fetchStatus!=="fetching"&&b.dehydratedAt!==void 0&&b.dehydratedAt>_.state.dataUpdatedAt)&&v.push(b):y.push(b)}if(y.length>0&&qx(i,{queries:y},o.current),v.length>0)return v}},[i,n]);return D.useEffect(()=>{d&&qx(i,{queries:d},o.current)},[i,d]),t};function D9(t,e){const n=ga(e),s=n.getQueryCache();return D.useSyncExternalStore(D.useCallback(i=>s.subscribe(Ln.batchCalls(i)),[s]),()=>n.isFetching(t),()=>n.isFetching(t))}function z9(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=Qm(i.current,k2(n,s.current));i.current!==d&&(i.current=d,Ln.schedule(o))}),[n]),()=>i.current,()=>i.current)}function Yn(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(Ln.batchCalls(d)),[s]),()=>s.getCurrentResult(),()=>s.getCurrentResult()),o=D.useCallback((d,f)=>{s.mutate(d,f).catch(ma)},[s]);if(i.error&&L1(s.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:o,mutateAsync:i.mutate}}function k9(t){return t}function L9(t,e){return U1(t,Qb,e)}const U9=Object.freeze(Object.defineProperty({__proto__:null,CancelledError:jm,HydrationBoundary:M9,InfiniteQueryObserver:Qb,IsRestoringProvider:N9,Mutation:H4,MutationCache:B4,MutationObserver:G4,QueriesObserver:P4,Query:D4,QueryCache:Y4,QueryClient:V4,QueryClientContext:Kb,QueryClientProvider:Q4,QueryErrorResetBoundary:_9,QueryObserver:rh,dataTagErrorSymbol:v9,dataTagSymbol:b9,defaultScheduler:R4,defaultShouldDehydrateMutation:E4,defaultShouldDehydrateQuery:T4,dehydrate:o9,environmentManager:$f,experimental_streamedQuery:x9,focusManager:z1,hashKey:Mu,hydrate:qx,infiniteQueryOptions:A9,isCancelledError:f9,isServer:S4,keepPreviousData:n9,matchMutation:kx,matchQuery:zx,mutationOptions:k9,noop:ma,notifyManager:Ln,onlineManager:Cm,partialMatchKey:Wf,queryOptions:O9,replaceEqualDeep:Qm,shouldThrowError:L1,skipToken:k1,timeoutManager:Ou,unsetMarker:S9,useInfiniteQuery:L9,useIsFetching:D9,useIsMutating:z9,useIsRestoring:Xb,useMutation:Yn,useMutationState:eS,usePrefetchInfiniteQuery:R9,usePrefetchQuery:T9,useQueries:$4,useQuery:pt,useQueryClient:ga,useQueryErrorResetBoundary:Fb,useSuspenseInfiniteQuery:w9,useSuspenseQueries:E9,useSuspenseQuery:j9},Symbol.toStringTag,{value:"Module"}));function H9(){window.__camstack={React:$t,ReactDOM:F7,ReactQuery:U9}}/**
|
|
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 q9(t={}){function e(s,i){var y;let o=(y=i.state)==null?void 0:y.masked,{pathname:d,search:f,hash:m}=o||s.location;return ab("",{pathname:d,search:f,hash:m},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:wm(i)}return G9(e,n,null,t)}function Vn(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function Ri(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function B9(){return Math.random().toString(36).substring(2,10)}function H2(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 ab(t,e,n=null,s,i){return{pathname:typeof t=="string"?t:t.pathname,search:"",hash:"",...typeof e=="string"?ih(e):e,state:n,key:e&&e.key||s||B9(),unstable_mask:i}}function wm({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 ih(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 G9(t,e,n,s={}){let{window:i=document.defaultView,v5Compat:o=!1}=s,d=i.history,f="POP",m=null,y=v();y==null&&(y=0,d.replaceState({...d.state,idx:y},""));function v(){return(d.state||{idx:null}).idx}function b(){f="POP";let O=v(),T=O==null?null:O-y;y=O,m&&m({action:f,location:R.location,delta:T})}function _(O,T){f="PUSH";let A=U2(O)?O:ab(R.location,O,T);y=v()+1;let z=H2(A,y),k=R.createHref(A.unstable_mask||A);try{d.pushState(z,"",k)}catch(P){if(P instanceof DOMException&&P.name==="DataCloneError")throw P;i.location.assign(k)}o&&m&&m({action:f,location:R.location,delta:1})}function j(O,T){f="REPLACE";let A=U2(O)?O:ab(R.location,O,T);y=v();let z=H2(A,y),k=R.createHref(A.unstable_mask||A);d.replaceState(z,"",k),o&&m&&m({action:f,location:R.location,delta:0})}function w(O){return P9(O)}let R={get action(){return f},get location(){return t(i,d)},listen(O){if(m)throw new Error("A history only accepts one active listener");return i.addEventListener(L2,b),m=O,()=>{i.removeEventListener(L2,b),m=null}},createHref(O){return e(i,O)},createURL:w,encodeLocation(O){let T=w(O);return{pathname:T.pathname,search:T.search,hash:T.hash}},push:_,replace:j,go(O){return d.go(O)}};return R}function P9(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:wm(t);return s=s.replace(/ $/,"%20"),!e&&s.startsWith("//")&&(s=n+s),new URL(s,n)}function tS(t,e,n="/"){return Y9(t,e,n,!1)}function Y9(t,e,n,s){let i=typeof e=="string"?ih(e):e,o=ho(i.pathname||"/",n);if(o==null)return null;let d=nS(t);V9(d);let f=null;for(let m=0;f==null&&m<d.length;++m){let y=tN(o);f=$9(d[m],y,s)}return f}function nS(t,e=[],n=[],s="",i=!1){let o=(d,f,m=i,y)=>{let v={relativePath:y===void 0?d.path||"":y,caseSensitive:d.caseSensitive===!0,childrenIndex:f,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(s)&&m)return;Vn(v.relativePath.startsWith(s),`Absolute route path "${v.relativePath}" nested under path "${s}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(s.length)}let b=ml([s,v.relativePath]),_=n.concat(v);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 "${b}".`),nS(d.children,e,_,b,m)),!(d.path==null&&!d.index)&&e.push({path:b,score:J9(b,d.index),routesMeta:_})};return t.forEach((d,f)=>{var m;if(d.path===""||!((m=d.path)!=null&&m.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(m=>m===""?o:[o,m].join("/"))),i&&f.push(...d),f.map(m=>t.startsWith("/")&&m===""?"/":m)}function V9(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:W9(e.routesMeta.map(s=>s.childrenIndex),n.routesMeta.map(s=>s.childrenIndex)))}var Q9=/^:[\w-]+$/,K9=3,X9=2,F9=1,Z9=10,I9=-2,q2=t=>t==="*";function J9(t,e){let n=t.split("/"),s=n.length;return n.some(q2)&&(s+=I9),e&&(s+=X9),n.filter(i=>!q2(i)).reduce((i,o)=>i+(Q9.test(o)?K9:o===""?F9:Z9),s)}function W9(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 $9(t,e,n=!1){let{routesMeta:s}=t,i={},o="/",d=[];for(let f=0;f<s.length;++f){let m=s[f],y=f===s.length-1,v=o==="/"?e:e.slice(o.length)||"/",b=S1({path:m.relativePath,caseSensitive:m.caseSensitive,end:y},v),_=m.route;if(!b&&y&&n&&!s[s.length-1].route.index&&(b=S1({path:m.relativePath,caseSensitive:m.caseSensitive,end:!1},v)),!b)return null;Object.assign(i,b.params),d.push({params:i,pathname:ml([o,b.pathname]),pathnameBase:rN(ml([o,b.pathnameBase])),route:_}),b.pathnameBase!=="/"&&(o=ml([o,b.pathnameBase]))}return d}function S1(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[n,s]=eN(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:v,isOptional:b},_)=>{if(v==="*"){let w=f[_]||"";d=o.slice(0,o.length-w.length).replace(/(.)\/+$/,"$1")}const j=f[_];return b&&!j?y[v]=void 0:y[v]=(j||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:d,pattern:t}}function eN(t,e=!1,n=!0){Ri(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,m,y,v)=>{if(s.push({paramName:f,isOptional:m!=null}),m){let b=v.charAt(y+d.length);return b&&b!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}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 tN(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Ri(!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 nN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function aN(t,e="/"){let{pathname:n,search:s="",hash:i=""}=typeof t=="string"?ih(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:iN(s),hash:lN(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 Xy(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 sN(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function Ib(t){let e=sN(t);return e.map((n,s)=>s===e.length-1?n.pathname:n.pathnameBase)}function H1(t,e,n,s=!1){let i;typeof t=="string"?i=ih(t):(i={...t},Vn(!i.pathname||!i.pathname.includes("?"),Xy("?","pathname","search",i)),Vn(!i.pathname||!i.pathname.includes("#"),Xy("#","pathname","hash",i)),Vn(!i.search||!i.search.includes("#"),Xy("#","search","hash",i)));let o=t===""||i.pathname==="",d=o?"/":i.pathname,f;if(d==null)f=n;else{let b=e.length-1;if(!s&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),b-=1;i.pathname=_.join("/")}f=b>=0?e[b]:"/"}let m=aN(i,f),y=d&&d!=="/"&&d.endsWith("/"),v=(o||d===".")&&n.endsWith("/");return!m.pathname.endsWith("/")&&(y||v)&&(m.pathname+="/"),m}var ml=t=>t.join("/").replace(/\/\/+/g,"/"),rN=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),iN=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,lN=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t,oN=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 uN(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}function cN(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"||!nN.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{Ri(!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 dN=["GET",...iS];new Set(dN);var lh=D.createContext(null);lh.displayName="DataRouter";var q1=D.createContext(null);q1.displayName="DataRouterState";var fN=D.createContext(!1),lS=D.createContext({isTransitioning:!1});lS.displayName="ViewTransition";var hN=D.createContext(new Map);hN.displayName="Fetchers";var pN=D.createContext(null);pN.displayName="Await";var Tr=D.createContext(null);Tr.displayName="Navigation";var Km=D.createContext(null);Km.displayName="Location";var oi=D.createContext({outlet:null,matches:[],isDataRoute:!1});oi.displayName="Route";var Jb=D.createContext(null);Jb.displayName="RouteError";var oS="REACT_ROUTER_ERROR",mN="REDIRECT",gN="ROUTE_ERROR_RESPONSE";function yN(t){if(t.startsWith(`${oS}:${mN}:{`))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 xN(t){if(t.startsWith(`${oS}:${gN}:{`))try{let e=JSON.parse(t.slice(40));if(typeof e=="object"&&e&&typeof e.status=="number"&&typeof e.statusText=="string")return new oN(e.status,e.statusText,e.data)}catch{}}function bN(t,{relative:e}={}){Vn(oh(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:s}=D.useContext(Tr),{hash:i,pathname:o,search:d}=Xm(t,{relative:e}),f=o;return n!=="/"&&(f=o==="/"?n:ml([n,o])),s.createHref({pathname:f,search:d,hash:i})}function oh(){return D.useContext(Km)!=null}function yl(){return Vn(oh(),"useLocation() may be used only in the context of a <Router> component."),D.useContext(Km).location}var uS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cS(t){D.useContext(Tr).static||D.useLayoutEffect(t)}function xl(){let{isDataRoute:t}=D.useContext(oi);return t?zN():vN()}function vN(){Vn(oh(),"useNavigate() may be used only in the context of a <Router> component.");let t=D.useContext(lh),{basename:e,navigator:n}=D.useContext(Tr),{matches:s}=D.useContext(oi),{pathname:i}=yl(),o=JSON.stringify(Ib(s)),d=D.useRef(!1);return cS(()=>{d.current=!0}),D.useCallback((m,y={})=>{if(Ri(d.current,uS),!d.current)return;if(typeof m=="number"){n.go(m);return}let v=H1(m,JSON.parse(o),i,y.relative==="path");t==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:ml([e,v.pathname])),(y.replace?n.replace:n.push)(v,y.state,y)},[e,n,o,i,t])}var SN=D.createContext(null);function NN(t){let e=D.useContext(oi).outlet;return D.useMemo(()=>e&&D.createElement(SN.Provider,{value:t},e),[e,t])}function Wb(){let{matches:t}=D.useContext(oi),e=t[t.length-1];return e?e.params:{}}function Xm(t,{relative:e}={}){let{matches:n}=D.useContext(oi),{pathname:s}=yl(),i=JSON.stringify(Ib(n));return D.useMemo(()=>H1(t,JSON.parse(i),s,e==="path"),[t,i,s,e])}function _N(t,e){return dS(t,e)}function dS(t,e,n){var O;Vn(oh(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=D.useContext(Tr),{matches:i}=D.useContext(oi),o=i[i.length-1],d=o?o.params:{},f=o?o.pathname:"/",m=o?o.pathnameBase:"/",y=o&&o.route;{let T=y&&y.path||"";hS(f,!y||T.endsWith("*")||T.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${f}" (under <Route path="${T}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
59
|
-
|
|
60
|
-
Please change the parent <Route path="${T}"> to <Route path="${T==="/"?"*":`${T}/*`}">.`)}let v=yl(),b;if(e){let T=typeof e=="string"?ih(e):e;Vn(m==="/"||((O=T.pathname)==null?void 0:O.startsWith(m)),`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 "${m}" but pathname "${T.pathname}" was given in the \`location\` prop.`),b=T}else b=v;let _=b.pathname||"/",j=_;if(m!=="/"){let T=m.replace(/^\//,"").split("/");j="/"+_.replace(/^\//,"").split("/").slice(T.length).join("/")}let w=tS(t,{pathname:j});Ri(y||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Ri(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 "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=TN(w&&w.map(T=>Object.assign({},T,{params:Object.assign({},d,T.params),pathname:ml([m,s.encodeLocation?s.encodeLocation(T.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathname]),pathnameBase:T.pathnameBase==="/"?m:ml([m,s.encodeLocation?s.encodeLocation(T.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:T.pathnameBase])})),i,n);return e&&R?D.createElement(Km.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...b},navigationType:"POP"}},R):R}function CN(){let t=DN(),e=uN(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 jN=D.createElement(CN,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=xN(t.digest);n&&(t=n)}let e=t!==void 0?D.createElement(oi.Provider,{value:this.props.routeContext},D.createElement(Jb.Provider,{value:t,children:this.props.component})):this.props.children;return this.context?D.createElement(wN,{error:t},e):e}};fS.contextType=fN;var Fy=new WeakMap;function wN({children:t,error:e}){let{basename:n}=D.useContext(Tr);if(typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){let s=yN(e.digest);if(s){let i=Fy.get(e);if(i)throw i;let o=rS(s.location,n);if(sS&&!Fy.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 Fy.set(e,d),d}return D.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return t}function EN({routeContext:t,match:e,children:n}){let s=D.useContext(lh);return s&&s.static&&s.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=e.route.id),D.createElement(oi.Provider,{value:t},n)}function TN(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 v=i.findIndex(b=>b.route.id&&(o==null?void 0:o[b.route.id])!==void 0);Vn(v>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),i=i.slice(0,Math.min(i.length,v+1))}let d=!1,f=-1;if(n&&s){d=s.renderFallback;for(let v=0;v<i.length;v++){let b=i[v];if((b.route.HydrateFallback||b.route.hydrateFallbackElement)&&(f=v),b.route.id){let{loaderData:_,errors:j}=s,w=b.route.loader&&!_.hasOwnProperty(b.route.id)&&(!j||j[b.route.id]===void 0);if(b.route.lazy||w){n.isStatic&&(d=!0),f>=0?i=i.slice(0,f+1):i=[i[0]];break}}}}let m=n==null?void 0:n.onError,y=s&&m?(v,b)=>{var _,j;m(v,{location:s.location,params:((j=(_=s.matches)==null?void 0:_[0])==null?void 0:j.params)??{},unstable_pattern:cN(s.matches),errorInfo:b})}:void 0;return i.reduceRight((v,b,_)=>{let j,w=!1,R=null,O=null;s&&(j=o&&b.route.id?o[b.route.id]:void 0,R=b.route.errorElement||jN,d&&(f<0&&_===0?(hS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),w=!0,O=null):f===_&&(w=!0,O=b.route.hydrateFallbackElement||null)));let T=e.concat(i.slice(0,_+1)),A=()=>{let z;return j?z=R:w?z=O:b.route.Component?z=D.createElement(b.route.Component,null):b.route.element?z=b.route.element:z=v,D.createElement(EN,{match:b,routeContext:{outlet:v,matches:T,isDataRoute:s!=null},children:z})};return s&&(b.route.ErrorBoundary||b.route.errorElement||_===0)?D.createElement(fS,{location:s.location,revalidation:s.revalidation,component:R,error:j,children:A(),routeContext:{outlet:null,matches:T,isDataRoute:!0},onError:y}):A()},null)}function $b(t){return`${t} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function RN(t){let e=D.useContext(lh);return Vn(e,$b(t)),e}function ON(t){let e=D.useContext(q1);return Vn(e,$b(t)),e}function AN(t){let e=D.useContext(oi);return Vn(e,$b(t)),e}function ev(t){let e=AN(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 MN(){return ev("useRouteId")}function DN(){var s;let t=D.useContext(Jb),e=ON("useRouteError"),n=ev("useRouteError");return t!==void 0?t:(s=e.errors)==null?void 0:s[n]}function zN(){let{router:t}=RN("useNavigate"),e=ev("useNavigate"),n=D.useRef(!1);return cS(()=>{n.current=!0}),D.useCallback(async(i,o={})=>{Ri(n.current,uS),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,Ri(!1,n))}D.memo(kN);function kN({routes:t,future:e,state:n,isStatic:s,onError:i}){return dS(t,void 0,{state:n,isStatic:s,onError:i})}function sb({to:t,replace:e,state:n,relative:s}){Vn(oh(),"<Navigate> may be used only in the context of a <Router> component.");let{static:i}=D.useContext(Tr);Ri(!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(oi),{pathname:d}=yl(),f=xl(),m=H1(t,Ib(o),d,s==="path"),y=JSON.stringify(m);return D.useEffect(()=>{f(JSON.parse(y),{replace:e,state:n,relative:s})},[f,y,s,e,n]),null}function LN(t){return NN(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 UN({basename:t="/",children:e=null,location:n,navigationType:s="POP",navigator:i,static:o=!1,unstable_useTransitions:d}){Vn(!oh(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let f=t.replace(/^\/*/,"/"),m=D.useMemo(()=>({basename:f,navigator:i,static:o,unstable_useTransitions:d,future:{}}),[f,i,o,d]);typeof n=="string"&&(n=ih(n));let{pathname:y="/",search:v="",hash:b="",state:_=null,key:j="default",unstable_mask:w}=n,R=D.useMemo(()=>{let O=ho(y,f);return O==null?null:{location:{pathname:O,search:v,hash:b,state:_,key:j,unstable_mask:w},navigationType:s}},[f,y,v,b,_,j,s,w]);return Ri(R!=null,`<Router basename="${f}"> is not able to match the URL "${y}${v}${b}" because it does not start with the basename, so the <Router> won't render anything.`),R==null?null:D.createElement(Tr.Provider,{value:m},D.createElement(Km.Provider,{children:e,value:R}))}function HN({children:t,location:e}){return _N(rb(t),e)}function rb(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,rb(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=rb(s.props.children,o)),n.push(d)}),n}var h1="get",p1="application/x-www-form-urlencoded";function B1(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement}function qN(t){return B1(t)&&t.tagName.toLowerCase()==="button"}function BN(t){return B1(t)&&t.tagName.toLowerCase()==="form"}function GN(t){return B1(t)&&t.tagName.toLowerCase()==="input"}function PN(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function YN(t,e){return t.button===0&&(!e||e==="_self")&&!PN(t)}var B0=null;function VN(){if(B0===null)try{new FormData(document.createElement("form"),0),B0=!1}catch{B0=!0}return B0}var QN=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Zy(t){return t!=null&&!QN.has(t)?(Ri(!1,`"${t}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${p1}"`),null):t}function KN(t,e){let n,s,i,o,d;if(BN(t)){let f=t.getAttribute("action");s=f?ho(f,e):null,n=t.getAttribute("method")||h1,i=Zy(t.getAttribute("enctype"))||p1,o=new FormData(t)}else if(qN(t)||GN(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 m=t.getAttribute("formaction")||f.getAttribute("action");if(s=m?ho(m,e):null,n=t.getAttribute("formmethod")||f.getAttribute("method")||h1,i=Zy(t.getAttribute("formenctype"))||Zy(f.getAttribute("enctype"))||p1,o=new FormData(f,t),!VN()){let{name:y,type:v,value:b}=t;if(v==="image"){let _=y?`${y}.`:"";o.append(`${_}x`,"0"),o.append(`${_}y`,"0")}else y&&o.append(y,b)}}else{if(B1(t))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=h1,s=null,i=p1,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 tv(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function XN(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 FN(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 ZN(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 IN(t,e,n){let s=await Promise.all(t.map(async i=>{let o=e.routes[i.route.id];if(o){let d=await FN(o,n);return d.links?d.links():[]}return[]}));return e_(s.flat(1).filter(ZN).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=(m,y)=>n[y]?m.route.id!==n[y].route.id:!0,f=(m,y)=>{var v;return n[y].pathname!==m.pathname||((v=n[y].route.path)==null?void 0:v.endsWith("*"))&&n[y].params["*"]!==m.params["*"]};return o==="assets"?e.filter((m,y)=>d(m,y)||f(m,y)):o==="data"?e.filter((m,y)=>{var b;let v=s.routes[m.route.id];if(!v||!v.hasLoader)return!1;if(d(m,y)||f(m,y))return!0;if(m.route.shouldRevalidate){let _=m.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:((b=n[0])==null?void 0:b.params)||{},nextUrl:new URL(t,window.origin),nextParams:m.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function JN(t,e,{includeHydrateFallback:n}={}){return WN(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 WN(t){return[...new Set(t)]}function $N(t){let e={},n=Object.keys(t).sort();for(let s of n)e[s]=t[s];return e}function e_(t,e){let n=new Set;return new Set(e),t.reduce((s,i)=>{let o=JSON.stringify($N(i));return n.has(o)||(n.add(o),s.push({key:o,link:i})),s},[])}function pS(){let t=D.useContext(lh);return tv(t,"You must render this element inside a <DataRouterContext.Provider> element"),t}function t_(){let t=D.useContext(q1);return tv(t,"You must render this element inside a <DataRouterStateContext.Provider> element"),t}var nv=D.createContext(void 0);nv.displayName="FrameworkContext";function mS(){let t=D.useContext(nv);return tv(t,"You must render this element inside a <HydratedRouter> element"),t}function n_(t,e){let n=D.useContext(nv),[s,i]=D.useState(!1),[o,d]=D.useState(!1),{onFocus:f,onBlur:m,onMouseEnter:y,onMouseLeave:v,onTouchStart:b}=e,_=D.useRef(null);D.useEffect(()=>{if(t==="render"&&d(!0),t==="viewport"){let R=T=>{T.forEach(A=>{d(A.isIntersecting)})},O=new IntersectionObserver(R,{threshold:.5});return _.current&&O.observe(_.current),()=>{O.disconnect()}}},[t]),D.useEffect(()=>{if(s){let R=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(R)}}},[s]);let j=()=>{i(!0)},w=()=>{i(!1),d(!1)};return n?t!=="intent"?[o,_,{}]:[o,_,{onFocus:Qp(f,j),onBlur:Qp(m,w),onMouseEnter:Qp(y,j),onMouseLeave:Qp(v,w),onTouchStart:Qp(b,j)}]:[!1,_,{}]}function Qp(t,e){return n=>{t&&t(n),n.defaultPrevented||e(n)}}function a_({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(r_,{page:t,matches:s,...e}):null}function s_(t){let{manifest:e,routeModules:n}=mS(),[s,i]=D.useState([]);return D.useEffect(()=>{let o=!1;return IN(t,e,n).then(d=>{o||i(d)}),()=>{o=!0}},[t,e,n]),s}function r_({page:t,matches:e,...n}){let s=yl(),{future:i,manifest:o,routeModules:d}=mS(),{basename:f}=pS(),{loaderData:m,matches:y}=t_(),v=D.useMemo(()=>P2(t,e,y,o,s,"data"),[t,e,y,o,s]),b=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 R=new Set,O=!1;if(e.forEach(A=>{var k;let z=o.routes[A.route.id];!z||!z.hasLoader||(!v.some(P=>P.route.id===A.route.id)&&A.route.id in m&&((k=d[A.route.id])!=null&&k.shouldRevalidate)||z.hasClientLoader?O=!0:R.add(A.route.id))}),R.size===0)return[];let T=XN(t,f,i.unstable_trailingSlashAwareDataRequests,"data");return O&&R.size>0&&T.searchParams.set("_routes",e.filter(A=>R.has(A.route.id)).map(A=>A.route.id).join(",")),[T.pathname+T.search]},[f,i.unstable_trailingSlashAwareDataRequests,m,s,o,v,e,t,d]),j=D.useMemo(()=>JN(b,o),[b,o]),w=s_(b);return D.createElement(D.Fragment,null,_.map(R=>D.createElement("link",{key:R,rel:"prefetch",as:"fetch",href:R,...n})),j.map(R=>D.createElement("link",{key:R,rel:"modulepreload",href:R,...n})),w.map(({key:R,link:O})=>D.createElement("link",{key:R,nonce:n.nonce,...O,crossOrigin:O.crossOrigin??n.crossOrigin})))}function i_(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}var l_=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{l_&&(window.__reactRouterVersion="7.13.1")}catch{}function o_({basename:t,children:e,unstable_useTransitions:n,window:s}){let i=D.useRef();i.current==null&&(i.current=q9({window:s,v5Compat:!0}));let o=i.current,[d,f]=D.useState({action:o.action,location:o.location}),m=D.useCallback(y=>{n===!1?f(y):D.startTransition(()=>f(y))},[n]);return D.useLayoutEffect(()=>o.listen(m),[o,m]),D.createElement(UN,{basename:t,children:e,location:d.location,navigationType:d.action,navigator:o,unstable_useTransitions:n})}var gS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,av=D.forwardRef(function({onClick:e,discover:n="render",prefetch:s="none",relative:i,reloadDocument:o,replace:d,unstable_mask:f,state:m,target:y,to:v,preventScrollReset:b,viewTransition:_,unstable_defaultShouldRevalidate:j,...w},R){let{basename:O,navigator:T,unstable_useTransitions:A}=D.useContext(Tr),z=typeof v=="string"&&gS.test(v),k=rS(v,O);v=k.to;let P=bN(v,{relative:i}),H=yl(),B=null;if(f){let ce=H1(f,[],H.unstable_mask?H.unstable_mask.pathname:"/",!0);O!=="/"&&(ce.pathname=ce.pathname==="/"?O:ml([O,ce.pathname])),B=T.createHref(ce)}let[L,V,Z]=n_(s,w),ue=f_(v,{replace:d,unstable_mask:f,state:m,target:y,preventScrollReset:b,relative:i,viewTransition:_,unstable_defaultShouldRevalidate:j,unstable_useTransitions:A});function ae(ce){e&&e(ce),ce.defaultPrevented||ue(ce)}let J=!(k.isExternal||o),le=D.createElement("a",{...w,...Z,href:(J?B:void 0)||k.absoluteURL||P,onClick:J?ae:e,ref:i_(R,V),target:y,"data-discover":!z&&n==="render"?"true":void 0});return L&&!z?D.createElement(D.Fragment,null,le,D.createElement(a_,{page:P})):le});av.displayName="Link";var u_=D.forwardRef(function({"aria-current":e="page",caseSensitive:n=!1,className:s="",end:i=!1,style:o,to:d,viewTransition:f,children:m,...y},v){let b=Xm(d,{relative:y.relative}),_=yl(),j=D.useContext(q1),{navigator:w,basename:R}=D.useContext(Tr),O=j!=null&&y_(b)&&f===!0,T=w.encodeLocation?w.encodeLocation(b).pathname:b.pathname,A=_.pathname,z=j&&j.navigation&&j.navigation.location?j.navigation.location.pathname:null;n||(A=A.toLowerCase(),z=z?z.toLowerCase():null,T=T.toLowerCase()),z&&R&&(z=ho(z,R)||z);const k=T!=="/"&&T.endsWith("/")?T.length-1:T.length;let P=A===T||!i&&A.startsWith(T)&&A.charAt(k)==="/",H=z!=null&&(z===T||!i&&z.startsWith(T)&&z.charAt(T.length)==="/"),B={isActive:P,isPending:H,isTransitioning:O},L=P?e:void 0,V;typeof s=="function"?V=s(B):V=[s,P?"active":null,H?"pending":null,O?"transitioning":null].filter(Boolean).join(" ");let Z=typeof o=="function"?o(B):o;return D.createElement(av,{...y,"aria-current":L,className:V,ref:v,style:Z,to:d,viewTransition:f},typeof m=="function"?m(B):m)});u_.displayName="NavLink";var c_=D.forwardRef(({discover:t="render",fetcherKey:e,navigate:n,reloadDocument:s,replace:i,state:o,method:d=h1,action:f,onSubmit:m,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_,...j},w)=>{let{unstable_useTransitions:R}=D.useContext(Tr),O=m_(),T=g_(f,{relative:y}),A=d.toLowerCase()==="get"?"get":"post",z=typeof f=="string"&&gS.test(f),k=P=>{if(m&&m(P),P.defaultPrevented)return;P.preventDefault();let H=P.nativeEvent.submitter,B=(H==null?void 0:H.getAttribute("formmethod"))||d,L=()=>O(H||P.currentTarget,{fetcherKey:e,method:B,navigate:n,replace:i,state:o,relative:y,preventScrollReset:v,viewTransition:b,unstable_defaultShouldRevalidate:_});R&&n!==!1?D.startTransition(()=>L()):L()};return D.createElement("form",{ref:w,method:A,action:T,onSubmit:s?m:k,...j,"data-discover":!z&&t==="render"?"true":void 0})});c_.displayName="Form";function d_(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(lh);return Vn(e,d_(t)),e}function f_(t,{target:e,replace:n,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:m,unstable_useTransitions:y}={}){let v=xl(),b=yl(),_=Xm(t,{relative:d});return D.useCallback(j=>{if(YN(j,e)){j.preventDefault();let w=n!==void 0?n:wm(b)===wm(_),R=()=>v(t,{replace:w,unstable_mask:s,state:i,preventScrollReset:o,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:m});y?D.startTransition(()=>R()):R()}},[b,v,_,n,s,i,e,t,o,d,f,m,y])}var h_=0,p_=()=>`__${String(++h_)}__`;function m_(){let{router:t}=yS("useSubmit"),{basename:e}=D.useContext(Tr),n=MN(),s=t.fetch,i=t.navigate;return D.useCallback(async(o,d={})=>{let{action:f,method:m,encType:y,formData:v,body:b}=KN(o,e);if(d.navigate===!1){let _=d.fetcherKey||p_();await s(_,n,d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||m,formEncType:d.encType||y,flushSync:d.flushSync})}else await i(d.action||f,{unstable_defaultShouldRevalidate:d.unstable_defaultShouldRevalidate,preventScrollReset:d.preventScrollReset,formData:v,body:b,formMethod:d.method||m,formEncType:d.encType||y,replace:d.replace,state:d.state,fromRouteId:n,flushSync:d.flushSync,viewTransition:d.viewTransition})},[s,i,e,n])}function g_(t,{relative:e}={}){let{basename:n}=D.useContext(Tr),s=D.useContext(oi);Vn(s,"useFormAction must be used inside a RouteContext");let[i]=s.matches.slice(-1),o={...Xm(t||".",{relative:e})},d=yl();if(t==null){o.search=d.search;let f=new URLSearchParams(o.search),m=f.getAll("index");if(m.some(v=>v==="")){f.delete("index"),m.filter(b=>b).forEach(b=>f.append("index",b));let v=f.toString();o.search=v?`?${v}`:""}}return(!t||t===".")&&i.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ml([n,o.pathname])),wm(o)}function y_(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=Xm(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 S1(i.pathname,d)!=null||S1(i.pathname,o)!=null}const xS=D.createContext(null),Iy=["dark","light","system"];function bS(){return typeof window>"u"||window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}function x_(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 b_({children:t,defaultMode:e="system",storageKey:n="camstack-theme-mode"}){const[s,i]=D.useState(()=>x_(n,e)),[o,d]=D.useState(()=>Y2(s)),f=D.useCallback(v=>{i(v),d(Y2(v)),typeof window<"u"&&localStorage.setItem(n,v)},[n]),m=D.useCallback(()=>{const b=(Iy.indexOf(s)+1)%Iy.length;f(Iy[b]??"dark")},[s,f]);D.useEffect(()=>{if(typeof document>"u")return;const v=document.documentElement;v.classList.remove("dark","light"),v.classList.add(o)},[s,o]),D.useEffect(()=>{if(typeof window>"u"||s!=="system")return;const v=window.matchMedia("(prefers-color-scheme: dark)"),b=()=>{d(bS())};return v.addEventListener("change",b),()=>v.removeEventListener("change",b)},[s]);const y=D.useMemo(()=>({mode:s,resolvedMode:o,setMode:f,toggleMode:m}),[s,o,f,m]);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 Fm(){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 v_=(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},S_=(t,e)=>({classGroupId:t,validator:e}),NS=(t=new Map,e=null,n)=>({nextPart:t,validators:e,classGroupId:n}),N1="-",V2=[],N_="arbitrary..",__=t=>{const e=j_(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:s}=t;return{getClassGroupId:d=>{if(d.startsWith("[")&&d.endsWith("]"))return C_(d);const f=d.split(N1),m=f[0]===""&&f.length>1?1:0;return _S(f,m,e)},getConflictingClassGroupIds:(d,f)=>{if(f){const m=s[d],y=n[d];return m?y?v_(y,m):m: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(N1):t.slice(e).join(N1),m=d.length;for(let y=0;y<m;y++){const v=d[y];if(v.validator(f))return v.classGroupId}},C_=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?N_+s:void 0})(),j_=t=>{const{theme:e,classGroups:n}=t;return w_(n,e)},w_=(t,e)=>{const n=NS();for(const s in t){const i=t[s];sv(i,n,s,e)}return n},sv=(t,e,n,s)=>{const i=t.length;for(let o=0;o<i;o++){const d=t[o];E_(d,e,n,s)}},E_=(t,e,n,s)=>{if(typeof t=="string"){T_(t,e,n);return}if(typeof t=="function"){R_(t,e,n,s);return}O_(t,e,n,s)},T_=(t,e,n)=>{const s=t===""?e:CS(e,t);s.classGroupId=n},R_=(t,e,n,s)=>{if(A_(t)){sv(t(s),e,n,s);return}e.validators===null&&(e.validators=[]),e.validators.push(S_(n,t))},O_=(t,e,n,s)=>{const i=Object.entries(t),o=i.length;for(let d=0;d<o;d++){const[f,m]=i[d];sv(m,CS(e,f),n,s)}},CS=(t,e)=>{let n=t;const s=e.split(N1),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},A_=t=>"isThemeGetter"in t&&t.isThemeGetter===!0,M_=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)}}},ib="!",Q2=":",D_=[],K2=(t,e,n,s,i)=>({modifiers:t,hasImportantModifier:e,baseClassName:n,maybePostfixModifierPosition:s,isExternal:i}),z_=t=>{const{prefix:e,experimentalParseClassName:n}=t;let s=i=>{const o=[];let d=0,f=0,m=0,y;const v=i.length;for(let R=0;R<v;R++){const O=i[R];if(d===0&&f===0){if(O===Q2){o.push(i.slice(m,R)),m=R+1;continue}if(O==="/"){y=R;continue}}O==="["?d++:O==="]"?d--:O==="("?f++:O===")"&&f--}const b=o.length===0?i:i.slice(m);let _=b,j=!1;b.endsWith(ib)?(_=b.slice(0,-1),j=!0):b.startsWith(ib)&&(_=b.slice(1),j=!0);const w=y&&y>m?y-m:void 0;return K2(o,j,_,w)};if(e){const i=e+Q2,o=s;s=d=>d.startsWith(i)?o(d.slice(i.length)):K2(D_,!1,d,void 0,!0)}if(n){const i=s;s=o=>n({className:o,parseClassName:i})}return s},k_=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]==="[",m=e.has(d);f||m?(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}},L_=t=>({cache:M_(t.cacheSize),parseClassName:z_(t),sortModifiers:k_(t),...__(t)}),U_=/\s+/,H_=(t,e)=>{const{parseClassName:n,getClassGroupId:s,getConflictingClassGroupIds:i,sortModifiers:o}=e,d=[],f=t.trim().split(U_);let m="";for(let y=f.length-1;y>=0;y-=1){const v=f[y],{isExternal:b,modifiers:_,hasImportantModifier:j,baseClassName:w,maybePostfixModifierPosition:R}=n(v);if(b){m=v+(m.length>0?" "+m:m);continue}let O=!!R,T=s(O?w.substring(0,R):w);if(!T){if(!O){m=v+(m.length>0?" "+m:m);continue}if(T=s(w),!T){m=v+(m.length>0?" "+m:m);continue}O=!1}const A=_.length===0?"":_.length===1?_[0]:o(_).join(":"),z=j?A+ib:A,k=z+T;if(d.indexOf(k)>-1)continue;d.push(k);const P=i(T,O);for(let H=0;H<P.length;++H){const B=P[H];d.push(z+B)}m=v+(m.length>0?" "+m:m)}return m},q_=(...t)=>{let e=0,n,s,i="";for(;e<t.length;)(n=t[e++])&&(s=jS(n))&&(i&&(i+=" "),i+=s);return i},jS=t=>{if(typeof t=="string")return t;let e,n="";for(let s=0;s<t.length;s++)t[s]&&(e=jS(t[s]))&&(n&&(n+=" "),n+=e);return n},B_=(t,...e)=>{let n,s,i,o;const d=m=>{const y=e.reduce((v,b)=>b(v),t());return n=L_(y),s=n.cache.get,i=n.cache.set,o=f,f(m)},f=m=>{const y=s(m);if(y)return y;const v=H_(m,n);return i(m,v),v};return o=d,(...m)=>o(q_(...m))},G_=[],ka=t=>{const e=n=>n[t]||G_;return e.isThemeGetter=!0,e},wS=/^\[(?:(\w[\w-]*):)?(.+)\]$/i,ES=/^\((?:(\w[\w-]*):)?(.+)\)$/i,P_=/^\d+(?:\.\d+)?\/\d+(?:\.\d+)?$/,Y_=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,V_=/\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$/,Q_=/^(rgba?|hsla?|hwb|(ok)?(lab|lch)|color-mix)\(.+\)$/,K_=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,X_=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,cu=t=>P_.test(t),Ct=t=>!!t&&!Number.isNaN(Number(t)),du=t=>!!t&&Number.isInteger(Number(t)),Jy=t=>t.endsWith("%")&&Ct(t.slice(0,-1)),$l=t=>Y_.test(t),TS=()=>!0,F_=t=>V_.test(t)&&!Q_.test(t),rv=()=>!1,Z_=t=>K_.test(t),I_=t=>X_.test(t),J_=t=>!Be(t)&&!Ge(t),W_=t=>ku(t,AS,rv),Be=t=>wS.test(t),Ac=t=>ku(t,MS,F_),X2=t=>ku(t,iC,Ct),$_=t=>ku(t,zS,TS),eC=t=>ku(t,DS,rv),F2=t=>ku(t,RS,rv),tC=t=>ku(t,OS,I_),G0=t=>ku(t,kS,Z_),Ge=t=>ES.test(t),Kp=t=>nd(t,MS),nC=t=>nd(t,DS),Z2=t=>nd(t,RS),aC=t=>nd(t,AS),sC=t=>nd(t,OS),P0=t=>nd(t,kS,!0),rC=t=>nd(t,zS,!0),ku=(t,e,n)=>{const s=wS.exec(t);return s?s[1]?e(s[1]):n(s[2]):!1},nd=(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",AS=t=>t==="length"||t==="size"||t==="bg-size",MS=t=>t==="length",iC=t=>t==="number",DS=t=>t==="family-name",zS=t=>t==="number"||t==="weight",kS=t=>t==="shadow",lC=()=>{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"),m=ka("spacing"),y=ka("radius"),v=ka("shadow"),b=ka("inset-shadow"),_=ka("text-shadow"),j=ka("drop-shadow"),w=ka("blur"),R=ka("perspective"),O=ka("aspect"),T=ka("ease"),A=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],H=()=>["auto","hidden","clip","visible","scroll"],B=()=>["auto","contain","none"],L=()=>[Ge,Be,m],V=()=>[cu,"full","auto",...L()],Z=()=>[du,"none","subgrid",Ge,Be],ue=()=>["auto",{span:["full",du,Ge,Be]},du,Ge,Be],ae=()=>[du,"auto",Ge,Be],J=()=>["auto","min","max","fr",Ge,Be],le=()=>["start","end","center","between","around","evenly","stretch","baseline","center-safe","end-safe"],ce=()=>["start","end","center","stretch","center-safe","end-safe"],Y=()=>["auto",...L()],$=()=>[cu,"auto","full","dvw","dvh","lvw","lvh","svw","svh","min","max","fit",...L()],ee=()=>[cu,"screen","full","dvw","lvw","svw","min","max","fit",...L()],_e=()=>[cu,"screen","full","lh","dvh","lvh","svh","min","max","fit",...L()],ge=()=>[t,Ge,Be],G=()=>[...k(),Z2,F2,{position:[Ge,Be]}],W=()=>["no-repeat",{repeat:["","x","y","space","round"]}],he=()=>["auto","cover","contain",aC,W_,{size:[Ge,Be]}],re=()=>[Jy,Kp,Ac],Se=()=>["","none","full",y,Ge,Be],je=()=>["",Ct,Kp,Ac],De=()=>["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=()=>[Ct,Jy,Z2,F2],Vt=()=>["","none",w,Ge,Be],$e=()=>["none",Ct,Ge,Be],At=()=>["none",Ct,Ge,Be],qt=()=>[Ct,Ge,Be],wn=()=>[cu,"full",...L()];return{cacheSize:500,theme:{animate:["spin","ping","pulse","bounce"],aspect:["video"],blur:[$l],breakpoint:[$l],color:[TS],container:[$l],"drop-shadow":[$l],ease:["in","out","in-out"],font:[J_],"font-weight":["thin","extralight","light","normal","medium","semibold","bold","extrabold","black"],"inset-shadow":[$l],leading:["none","tight","snug","normal","relaxed","loose"],perspective:["dramatic","near","normal","midrange","distant","none"],radius:[$l],shadow:[$l],spacing:["px",Ct],text:[$l],"text-shadow":[$l],tracking:["tighter","tight","normal","wide","wider","widest"]},classGroups:{aspect:[{aspect:["auto","square",cu,Be,Ge,O]}],container:["container"],columns:[{columns:[Ct,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:H()}],"overflow-x":[{"overflow-x":H()}],"overflow-y":[{"overflow-y":H()}],overscroll:[{overscroll:B()}],"overscroll-x":[{"overscroll-x":B()}],"overscroll-y":[{"overscroll-y":B()}],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:[du,"auto",Ge,Be]}],basis:[{basis:[cu,"full","auto",f,...L()]}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["nowrap","wrap","wrap-reverse"]}],flex:[{flex:[Ct,cu,"auto","initial","none",Be]}],grow:[{grow:["",Ct,Ge,Be]}],shrink:[{shrink:["",Ct,Ge,Be]}],order:[{order:[du,"first","last","none",Ge,Be]}],"grid-cols":[{"grid-cols":Z()}],"col-start-end":[{col:ue()}],"col-start":[{"col-start":ae()}],"col-end":[{"col-end":ae()}],"grid-rows":[{"grid-rows":Z()}],"row-start-end":[{row:ue()}],"row-start":[{"row-start":ae()}],"row-end":[{"row-end":ae()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":J()}],"auto-rows":[{"auto-rows":J()}],gap:[{gap:L()}],"gap-x":[{"gap-x":L()}],"gap-y":[{"gap-y":L()}],"justify-content":[{justify:[...le(),"normal"]}],"justify-items":[{"justify-items":[...ce(),"normal"]}],"justify-self":[{"justify-self":["auto",...ce()]}],"align-content":[{content:["normal",...le()]}],"align-items":[{items:[...ce(),{baseline:["","last"]}]}],"align-self":[{self:["auto",...ce(),{baseline:["","last"]}]}],"place-content":[{"place-content":le()}],"place-items":[{"place-items":[...ce(),"baseline"]}],"place-self":[{"place-self":["auto",...ce()]}],p:[{p:L()}],px:[{px:L()}],py:[{py:L()}],ps:[{ps:L()}],pe:[{pe:L()}],pbs:[{pbs:L()}],pbe:[{pbe:L()}],pt:[{pt:L()}],pr:[{pr:L()}],pb:[{pb:L()}],pl:[{pl:L()}],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":L()}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":L()}],"space-y-reverse":["space-y-reverse"],size:[{size:$()}],"inline-size":[{inline:["auto",...ee()]}],"min-inline-size":[{"min-inline":["auto",...ee()]}],"max-inline-size":[{"max-inline":["none",...ee()]}],"block-size":[{block:["auto",..._e()]}],"min-block-size":[{"min-block":["auto",..._e()]}],"max-block-size":[{"max-block":["none",..._e()]}],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,Kp,Ac]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:[s,rC,$_]}],"font-stretch":[{"font-stretch":["ultra-condensed","extra-condensed","condensed","semi-condensed","normal","semi-expanded","expanded","extra-expanded","ultra-expanded",Jy,Be]}],"font-family":[{font:[nC,eC,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":[Ct,"none",Ge,X2]}],leading:[{leading:[o,...L()]}],"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:ge()}],"text-color":[{text:ge()}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...De(),"wavy"]}],"text-decoration-thickness":[{decoration:[Ct,"from-font","auto",Ge,Ac]}],"text-decoration-color":[{decoration:ge()}],"underline-offset":[{"underline-offset":[Ct,"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:L()}],"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:he()}],"bg-image":[{bg:["none",{linear:[{to:["t","tr","r","br","b","bl","l","tl"]},du,Ge,Be],radial:["",Ge,Be],conic:[du,Ge,Be]},sC,tC]}],"bg-color":[{bg:ge()}],"gradient-from-pos":[{from:re()}],"gradient-via-pos":[{via:re()}],"gradient-to-pos":[{to:re()}],"gradient-from":[{from:ge()}],"gradient-via":[{via:ge()}],"gradient-to":[{to:ge()}],rounded:[{rounded:Se()}],"rounded-s":[{"rounded-s":Se()}],"rounded-e":[{"rounded-e":Se()}],"rounded-t":[{"rounded-t":Se()}],"rounded-r":[{"rounded-r":Se()}],"rounded-b":[{"rounded-b":Se()}],"rounded-l":[{"rounded-l":Se()}],"rounded-ss":[{"rounded-ss":Se()}],"rounded-se":[{"rounded-se":Se()}],"rounded-ee":[{"rounded-ee":Se()}],"rounded-es":[{"rounded-es":Se()}],"rounded-tl":[{"rounded-tl":Se()}],"rounded-tr":[{"rounded-tr":Se()}],"rounded-br":[{"rounded-br":Se()}],"rounded-bl":[{"rounded-bl":Se()}],"border-w":[{border:je()}],"border-w-x":[{"border-x":je()}],"border-w-y":[{"border-y":je()}],"border-w-s":[{"border-s":je()}],"border-w-e":[{"border-e":je()}],"border-w-bs":[{"border-bs":je()}],"border-w-be":[{"border-be":je()}],"border-w-t":[{"border-t":je()}],"border-w-r":[{"border-r":je()}],"border-w-b":[{"border-b":je()}],"border-w-l":[{"border-l":je()}],"divide-x":[{"divide-x":je()}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":je()}],"divide-y-reverse":["divide-y-reverse"],"border-style":[{border:[...De(),"hidden","none"]}],"divide-style":[{divide:[...De(),"hidden","none"]}],"border-color":[{border:ge()}],"border-color-x":[{"border-x":ge()}],"border-color-y":[{"border-y":ge()}],"border-color-s":[{"border-s":ge()}],"border-color-e":[{"border-e":ge()}],"border-color-bs":[{"border-bs":ge()}],"border-color-be":[{"border-be":ge()}],"border-color-t":[{"border-t":ge()}],"border-color-r":[{"border-r":ge()}],"border-color-b":[{"border-b":ge()}],"border-color-l":[{"border-l":ge()}],"divide-color":[{divide:ge()}],"outline-style":[{outline:[...De(),"none","hidden"]}],"outline-offset":[{"outline-offset":[Ct,Ge,Be]}],"outline-w":[{outline:["",Ct,Kp,Ac]}],"outline-color":[{outline:ge()}],shadow:[{shadow:["","none",v,P0,G0]}],"shadow-color":[{shadow:ge()}],"inset-shadow":[{"inset-shadow":["none",b,P0,G0]}],"inset-shadow-color":[{"inset-shadow":ge()}],"ring-w":[{ring:je()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:ge()}],"ring-offset-w":[{"ring-offset":[Ct,Ac]}],"ring-offset-color":[{"ring-offset":ge()}],"inset-ring-w":[{"inset-ring":je()}],"inset-ring-color":[{"inset-ring":ge()}],"text-shadow":[{"text-shadow":["none",_,P0,G0]}],"text-shadow-color":[{"text-shadow":ge()}],opacity:[{opacity:[Ct,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":[Ct]}],"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":ge()}],"mask-image-linear-to-color":[{"mask-linear-to":ge()}],"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":ge()}],"mask-image-t-to-color":[{"mask-t-to":ge()}],"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":ge()}],"mask-image-r-to-color":[{"mask-r-to":ge()}],"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":ge()}],"mask-image-b-to-color":[{"mask-b-to":ge()}],"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":ge()}],"mask-image-l-to-color":[{"mask-l-to":ge()}],"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":ge()}],"mask-image-x-to-color":[{"mask-x-to":ge()}],"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":ge()}],"mask-image-y-to-color":[{"mask-y-to":ge()}],"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":ge()}],"mask-image-radial-to-color":[{"mask-radial-to":ge()}],"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":[Ct]}],"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":ge()}],"mask-image-conic-to-color":[{"mask-conic-to":ge()}],"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:he()}],"mask-type":[{"mask-type":["alpha","luminance"]}],"mask-image":[{mask:["none",Ge,Be]}],filter:[{filter:["","none",Ge,Be]}],blur:[{blur:Vt()}],brightness:[{brightness:[Ct,Ge,Be]}],contrast:[{contrast:[Ct,Ge,Be]}],"drop-shadow":[{"drop-shadow":["","none",j,P0,G0]}],"drop-shadow-color":[{"drop-shadow":ge()}],grayscale:[{grayscale:["",Ct,Ge,Be]}],"hue-rotate":[{"hue-rotate":[Ct,Ge,Be]}],invert:[{invert:["",Ct,Ge,Be]}],saturate:[{saturate:[Ct,Ge,Be]}],sepia:[{sepia:["",Ct,Ge,Be]}],"backdrop-filter":[{"backdrop-filter":["","none",Ge,Be]}],"backdrop-blur":[{"backdrop-blur":Vt()}],"backdrop-brightness":[{"backdrop-brightness":[Ct,Ge,Be]}],"backdrop-contrast":[{"backdrop-contrast":[Ct,Ge,Be]}],"backdrop-grayscale":[{"backdrop-grayscale":["",Ct,Ge,Be]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[Ct,Ge,Be]}],"backdrop-invert":[{"backdrop-invert":["",Ct,Ge,Be]}],"backdrop-opacity":[{"backdrop-opacity":[Ct,Ge,Be]}],"backdrop-saturate":[{"backdrop-saturate":[Ct,Ge,Be]}],"backdrop-sepia":[{"backdrop-sepia":["",Ct,Ge,Be]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":L()}],"border-spacing-x":[{"border-spacing-x":L()}],"border-spacing-y":[{"border-spacing-y":L()}],"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:[Ct,"initial",Ge,Be]}],ease:[{ease:["linear","initial",T,Ge,Be]}],delay:[{delay:[Ct,Ge,Be]}],animate:[{animate:["none",A,Ge,Be]}],backface:[{backface:["hidden","visible"]}],perspective:[{perspective:[R,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:At()}],"scale-x":[{"scale-x":At()}],"scale-y":[{"scale-y":At()}],"scale-z":[{"scale-z":At()}],"scale-3d":["scale-3d"],skew:[{skew:qt()}],"skew-x":[{"skew-x":qt()}],"skew-y":[{"skew-y":qt()}],transform:[{transform:[Ge,Be,"","none","gpu","cpu"]}],"transform-origin":[{origin:P()}],"transform-style":[{transform:["3d","flat"]}],translate:[{translate:wn()}],"translate-x":[{"translate-x":wn()}],"translate-y":[{"translate-y":wn()}],"translate-z":[{"translate-z":wn()}],"translate-none":["translate-none"],accent:[{accent:ge()}],appearance:[{appearance:["none","auto"]}],"caret-color":[{caret:ge()}],"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":L()}],"scroll-mx":[{"scroll-mx":L()}],"scroll-my":[{"scroll-my":L()}],"scroll-ms":[{"scroll-ms":L()}],"scroll-me":[{"scroll-me":L()}],"scroll-mbs":[{"scroll-mbs":L()}],"scroll-mbe":[{"scroll-mbe":L()}],"scroll-mt":[{"scroll-mt":L()}],"scroll-mr":[{"scroll-mr":L()}],"scroll-mb":[{"scroll-mb":L()}],"scroll-ml":[{"scroll-ml":L()}],"scroll-p":[{"scroll-p":L()}],"scroll-px":[{"scroll-px":L()}],"scroll-py":[{"scroll-py":L()}],"scroll-ps":[{"scroll-ps":L()}],"scroll-pe":[{"scroll-pe":L()}],"scroll-pbs":[{"scroll-pbs":L()}],"scroll-pbe":[{"scroll-pbe":L()}],"scroll-pt":[{"scroll-pt":L()}],"scroll-pr":[{"scroll-pr":L()}],"scroll-pb":[{"scroll-pb":L()}],"scroll-pl":[{"scroll-pl":L()}],"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",...ge()]}],"stroke-w":[{stroke:[Ct,Kp,Ac,X2]}],stroke:[{stroke:["none",...ge()]}],"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"]}},LS=B_(lC);function ss(...t){return LS(Fm(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 US=(...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 oC=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 uC=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=uC(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 cC={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 dC=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 fC=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},m)=>D.createElement("svg",{ref:m,...cC,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:US("lucide",i),...!o&&!dC(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...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 ad=(t,e)=>{const n=D.forwardRef(({className:s,...i},o)=>D.createElement(fC,{ref:o,iconNode:e,className:US(`lucide-${oC(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 hC=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],iv=ad("chevron-down",hC);/**
|
|
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 pC=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],mC=ad("chevron-right",pC);/**
|
|
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 gC=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],yC=ad("circle-plus",gC);/**
|
|
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 xC=[["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"}]],bC=ad("copy-plus",xC);/**
|
|
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 vC=[["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"}]],SC=ad("save",vC);/**
|
|
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 NC=[["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"}]],_C=ad("trash-2",NC);/**
|
|
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 CC=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],jC=ad("x",CC),J2=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W2=Fm,dr=(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 v=n==null?void 0:n[y],b=o==null?void 0:o[y];if(v===null)return null;const _=J2(v)||J2(b);return i[y][_]}),f=n&&Object.entries(n).reduce((y,v)=>{let[b,_]=v;return _===void 0||(y[b]=_),y},{}),m=e==null||(s=e.compoundVariants)===null||s===void 0?void 0:s.reduce((y,v)=>{let{class:b,className:_,...j}=v;return Object.entries(j).every(w=>{let[R,O]=w;return Array.isArray(O)?O.includes({...o,...f}[R]):{...o,...f}[R]===O})?[...y,b,_]:y},[]);return W2(t,d,m,n==null?void 0:n.class,n==null?void 0:n.className)},wC=dr("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"}}),EC=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:ss(wC({variant:e,size:n}),t),...s}));EC.displayName="Button";const TC=dr("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"}}),RC=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:ss(TC({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));RC.displayName="IconButton";const OC=dr("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"}}),AC=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:ss(OC({variant:e,styleVariant:n}),t),...s}));AC.displayName="Badge";const MC=dr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),DC=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:ss(MC({variant:e}),t),...n}));DC.displayName="Card";const zC=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:ss("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));zC.displayName="Label";const kC=dr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),LC=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:ss(kC({orientation:e}),t),...n}));LC.displayName="Separator";const UC=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ss("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));UC.displayName="Skeleton";const $2=dr("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"}}),HC=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:ss($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:ss($2({state:e}),t),...i}));HC.displayName="Input";const qC=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:ss("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(iv,{className:"h-3.5 w-3.5"})})]}));qC.displayName="Select";const BC=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:ss("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));BC.displayName="Checkbox";const GC=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:ss("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:ss("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:ss("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})]}));GC.displayName="Switch";const PC=D.createContext(null);function YC(){const t=D.useContext(PC);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}const VC=dr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),QC=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=YC(),m=D.useRef(null),y=i??m;D.useEffect(()=>{const b=y.current;b&&(o&&!b.open&&b.showModal(),!o&&b.open&&b.close())},[o,y]);const v=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:ss(VC({width:e}),"w-full",t),onClick:v,onClose:()=>d(!1),...s,children:n})});QC.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);const KC=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ss("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));KC.displayName="ScrollArea";const XC={success:"bg-emerald-400 text-emerald-950",warning:"bg-amber-400 text-amber-950",danger:"bg-red-400 text-red-950",info:"bg-blue-400 text-blue-950",neutral:"bg-foreground-subtle/20 text-foreground"};function FC({children:t,variant:e="neutral",mono:n,className:s}){return h.jsx("span",{className:ss("inline-flex items-center rounded-md px-2 py-0.5 text-[11px] font-bold leading-tight",n&&"font-mono",XC[e],s),children:t})}function e3({version:t,preRelease:e,className:n}){const s=e??/-(alpha|beta|rc|dev|canary|next)/i.test(t);return h.jsx(FC,{variant:s?"warning":"success",mono:!0,className:n,children:t})}var ZC=Object.create,HS=Object.defineProperty,IC=Object.getOwnPropertyDescriptor,qS=Object.getOwnPropertyNames,JC=Object.getPrototypeOf,WC=Object.prototype.hasOwnProperty,bl=(t,e)=>function(){return e||(0,t[qS(t)[0]])((e={exports:{}}).exports,e),e.exports},$C=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=qS(e),o=0,d=i.length,f;o<d;o++)f=i[o],!WC.call(t,f)&&f!==n&&HS(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=IC(e,f))||s.enumerable});return t},ya=(t,e,n)=>(n=t!=null?ZC(JC(t)):{},$C(HS(n,"default",{value:t,enumerable:!0}),t)),BS=bl({"../../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}}),ej=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=BS().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}}),tj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=BS().default,s=ej();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=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=tj();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}}),Oi=bl({"../../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 m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}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(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function nj(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(m){var y;i||(y=n.next)===null||y===void 0||y.call(n,m)},error(m){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,m),f())},complete(){var m;i||(i=!0,(m=n.complete)===null||m===void 0||m.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(aj,e)}};return e}function aj(t,e){return e(t)}function sj(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=nj(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(sd());ya(Oi());ya(Oi());ya(Oi());ya(Oi());ya(Oi());const GS=(t,...e)=>typeof t=="function"?t(...e):t;ya(sd());function rj(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function ij(t){const e=await GS(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function lj(t,e){const n={method:"connectionParams",data:await GS(t)};return e.encode(n)}ya(sd());var mu=ya(sd());function oj(t){const{promise:e,resolve:n,reject:s}=rj();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function uj(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:m})=>{clearTimeout(s),o(),m==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var cj=class lb{constructor(e){var n;if((0,mu.default)(this,"id",++lb.connectCount),(0,mu.default)(this,"WebSocketPonyfill",void 0),(0,mu.default)(this,"urlOptions",void 0),(0,mu.default)(this,"keepAliveOpts",void 0),(0,mu.default)(this,"encoder",void 0),(0,mu.default)(this,"wsObservable",sj(null)),(0,mu.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=++lb.connectCount;const n=ij(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&&uj(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await oj(s),e.urlOptions.connectionParams&&s.send(await lj(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,mu.default)(cj,"connectCount",0);ya(sd());ya(Oi());ya(sd());ya(Oi());ya(Oi());ya(Oi());var dj=bl({"../../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,m=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);m--;){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(m){return{value:m,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 m=this.s.return;return m===void 0?Promise.resolve({value:f,done:!0}):o(m.apply(this.s,arguments))},throw:function(f){var m=this.s.return;return m===void 0?Promise.reject(f):o(m.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});ya(dj());ya(Oi());var fj=bl({"../../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,m){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=m,y},i={},o=[];function d(f,m){if(m!=null){if(Object(m)!==m)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=m[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=m[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.call(m)}catch(_){return Promise.reject(_)}}),o.push({v:m,d:y,a:f})}else f&&o.push({d:m,a:f});return m}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var m,y=this.e,v=0;function b(){for(;m=o.pop();)try{if(!m.a&&v===1)return v=0,o.push(m),Promise.resolve().then(b);if(m.d){var j=m.d.call(m.v);if(m.a)return v|=2,Promise.resolve(j).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),PS=bl({"../../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}}),hj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=PS();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),pj=bl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=PS();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function m(v,b){try{var _=o[v](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(R){if(w){var O=v==="return"?"return":"next";if(!j.k||R.done)return m(O,R);R=o[O](R).value}y(_.done?"return":"normal",R)},function(R){m("throw",R)})}catch(R){y("throw",R)}}function y(v,b){switch(v){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?m(d.key,d.arg):f=null}this._invoke=function(v,b){return new Promise(function(_,j){var w={key:v,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,m(v,b))})},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(fj());ya(hj());ya(pj());ya(Oi());class mj{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 YS{constructor(e){this.generateIdentifier=e,this.kv=new mj}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 gj extends YS{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 yj(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 xj(t,e){const n=yj(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 eh(t,e){Object.entries(t).forEach(([n,s])=>e(s,n))}function m1(t,e){return t.indexOf(e)!==-1}function t3(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(e(s))return s}}class bj{constructor(){this.transfomers={}}register(e){this.transfomers[e.name]=e}findApplicable(e){return xj(this.transfomers,n=>n.isApplicable(e))}findByName(e){return this.transfomers[e]}}const vj=t=>Object.prototype.toString.call(t).slice(8,-1),VS=t=>typeof t>"u",Sj=t=>t===null,Em=t=>typeof t!="object"||t===null||t===Object.prototype?!1:Object.getPrototypeOf(t)===null?!0:Object.getPrototypeOf(t)===Object.prototype,ob=t=>Em(t)&&Object.keys(t).length===0,Du=t=>Array.isArray(t),Nj=t=>typeof t=="string",_j=t=>typeof t=="number"&&!isNaN(t),Cj=t=>typeof t=="boolean",jj=t=>t instanceof RegExp,Tm=t=>t instanceof Map,Rm=t=>t instanceof Set,QS=t=>vj(t)==="Symbol",wj=t=>t instanceof Date&&!isNaN(t.valueOf()),KS=t=>t instanceof Error,n3=t=>typeof t=="number"&&isNaN(t),Ej=t=>Cj(t)||Sj(t)||VS(t)||_j(t)||Nj(t)||QS(t),Tj=t=>typeof t=="bigint",Rj=t=>t===1/0||t===-1/0,Oj=t=>ArrayBuffer.isView(t)&&!(t instanceof DataView),Aj=t=>t instanceof URL,ub=t=>t.replace(/\\/g,"\\\\").replace(/\./g,"\\."),Wy=t=>t.map(String).map(ub).join("."),pm=(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 ol(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const XS=[ol(VS,"undefined",()=>null,()=>{}),ol(Tj,"bigint",t=>t.toString(),t=>typeof BigInt<"u"?BigInt(t):(console.error("Please add a BigInt polyfill."),t)),ol(wj,"Date",t=>t.toISOString(),t=>new Date(t)),ol(KS,"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}),ol(jj,"regexp",t=>""+t,t=>{const e=t.slice(1,t.lastIndexOf("/")),n=t.slice(t.lastIndexOf("/")+1);return new RegExp(e,n)}),ol(Rm,"set",t=>[...t.values()],t=>new Set(t)),ol(Tm,"map",t=>[...t.entries()],t=>new Map(t)),ol(t=>n3(t)||Rj(t),"number",t=>n3(t)?"NaN":t>0?"Infinity":"-Infinity",Number),ol(t=>t===0&&1/t===-1/0,"number",()=>"-0",Number),ol(Aj,"URL",t=>t.toString(),t=>new URL(t))];function G1(t,e,n,s){return{isApplicable:t,annotation:e,transform:n,untransform:s}}const FS=G1((t,e)=>QS(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}),Mj=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array,Uint8ClampedArray].reduce((t,e)=>(t[e.name]=e,t),{}),ZS=G1(Oj,t=>["typed-array",t.constructor.name],t=>[...t],(t,e)=>{const n=Mj[e[1]];if(!n)throw new Error("Trying to deserialize unknown typed array");return new n(t)});function IS(t,e){return t!=null&&t.constructor?!!e.classRegistry.getIdentifier(t.constructor):!1}const JS=G1(IS,(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)}),WS=G1((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)}),Dj=[JS,FS,WS,ZS],a3=(t,e)=>{const n=t3(Dj,i=>i.isApplicable(t,e));if(n)return{value:n.transform(t,e),type:n.annotation(t,e)};const s=t3(XS,i=>i.isApplicable(t,e));if(s)return{value:s.transform(t,e),type:s.annotation}},$S={};XS.forEach(t=>{$S[t.annotation]=t});const zj=(t,e,n)=>{if(Du(e))switch(e[0]){case"symbol":return FS.untransform(t,e,n);case"class":return JS.untransform(t,e,n);case"custom":return WS.untransform(t,e,n);case"typed-array":return ZS.untransform(t,e,n);default:throw new Error("Unknown transformation: "+e)}else{const s=$S[e];if(!s)throw new Error("Unknown transformation: "+e);return s.untransform(t,n)}},Af=(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 e6(t){if(m1(t,"__proto__"))throw new Error("__proto__ is not allowed as a property");if(m1(t,"prototype"))throw new Error("prototype is not allowed as a property");if(m1(t,"constructor"))throw new Error("constructor is not allowed as a property")}const kj=(t,e)=>{e6(e);for(let n=0;n<e.length;n++){const s=e[n];if(Rm(t))t=Af(t,+s);else if(Tm(t)){const i=+s,o=+e[++n]==0?"key":"value",d=Af(t,i);switch(o){case"key":t=d;break;case"value":t=t.get(d);break}}else t=t[s]}return t},cb=(t,e,n)=>{if(e6(e),e.length===0)return n(t);let s=t;for(let o=0;o<e.length-1;o++){const d=e[o];if(Du(s)){const f=+d;s=s[f]}else if(Em(s))s=s[d];else if(Rm(s)){const f=+d;s=Af(s,f)}else if(Tm(s)){if(o===e.length-2)break;const m=+d,y=+e[++o]==0?"key":"value",v=Af(s,m);switch(y){case"key":s=v;break;case"value":s=s.get(v);break}}}const i=e[e.length-1];if(Du(s)?s[+i]=n(s[+i]):Em(s)&&(s[i]=n(s[i])),Rm(s)){const o=Af(s,+i),d=n(o);o!==d&&(s.delete(o),s.add(d))}if(Tm(s)){const o=+e[e.length-2],d=Af(s,o);switch(+i==0?"key":"value"){case"key":{const m=n(d);s.set(m,s.get(d)),m!==d&&s.delete(d);break}case"value":{s.set(d,n(s.get(d)));break}}}return t},t6=t=>t<1;function db(t,e,n,s=[]){if(!t)return;const i=t6(n);if(!Du(t)){eh(t,(f,m)=>db(f,e,n,[...s,...pm(m,i)]));return}const[o,d]=t;d&&eh(d,(f,m)=>{db(f,e,n,[...s,...pm(m,i)])}),e(o,s)}function Lj(t,e,n,s){return db(e,(i,o)=>{t=cb(t,o,d=>zj(d,i,s))},n),t}function Uj(t,e,n){const s=t6(n);function i(o,d){const f=kj(t,pm(d,s));o.map(m=>pm(m,s)).forEach(m=>{t=cb(t,m,()=>f)})}if(Du(e)){const[o,d]=e;o.forEach(f=>{t=cb(t,pm(f,s),()=>t)}),d&&eh(d,i)}else eh(e,i);return t}const Hj=(t,e)=>Em(t)||Du(t)||Tm(t)||Rm(t)||KS(t)||IS(t,e);function qj(t,e,n){const s=n.get(t);s?s.push(e):n.set(t,[e])}function Bj(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,m)=>f.length-m.length));const[o,...d]=i;o.length===0?s=d.map(Wy):n[Wy(o)]=d.map(Wy)}),s?ob(n)?[s]:[s,n]:ob(n)?void 0:n}const n6=(t,e,n,s,i=[],o=[],d=new Map)=>{const f=Ej(t);if(!f){qj(t,i,e);const j=d.get(t);if(j)return s?{transformedValue:null}:j}if(!Hj(t,n)){const j=a3(t,n),w=j?{transformedValue:j.value,annotations:[j.type]}:{transformedValue:t};return f||d.set(t,w),w}if(m1(o,t))return{transformedValue:null};const m=a3(t,n),y=(m==null?void 0:m.value)??t,v=Du(y)?[]:{},b={};eh(y,(j,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 R=n6(j,e,n,s,[...i,w],[...o,t],d);v[w]=R.transformedValue,Du(R.annotations)?b[ub(w)]=R.annotations:Em(R.annotations)&&eh(R.annotations,(O,T)=>{b[ub(w)+"."+T]=O})});const _=ob(b)?{transformedValue:v,annotations:m?[m.type]:void 0}:{transformedValue:v,annotations:m?[m.type,b]:b};return f||d.set(t,_),_};function a6(t){return Object.prototype.toString.call(t).slice(8,-1)}function s3(t){return a6(t)==="Array"}function Gj(t){if(a6(t)!=="Object")return!1;const e=Object.getPrototypeOf(t);return!!e&&e.constructor===Object&&e===Object.prototype}function Pj(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 fb(t,e={}){if(s3(t))return t.map(i=>fb(i,e));if(!Gj(t))return t;const n=Object.getOwnPropertyNames(t),s=Object.getOwnPropertySymbols(t);return[...n,...s].reduce((i,o)=>{if(o==="__proto__"||s3(e.props)&&!e.props.includes(o))return i;const d=t[o],f=fb(d,e);return Pj(i,o,f,t,e.nonenumerable),i},{})}class kt{constructor({dedupe:e=!1}={}){this.classRegistry=new gj,this.symbolRegistry=new YS(n=>n.description??""),this.customTransformerRegistry=new bj,this.allowedErrorProps=[],this.dedupe=e}serialize(e){const n=new Map,s=n6(e,n,this,this.dedupe),i={json:s.transformedValue};s.annotations&&(i.meta={...i.meta,values:s.annotations});const o=Bj(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:fb(s);return i!=null&&i.values&&(o=Lj(o,i.values,i.v??0,this)),i!=null&&i.referentialEqualities&&(o=Uj(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 Yj=Object.create,s6=Object.defineProperty,Vj=Object.getOwnPropertyDescriptor,r6=Object.getOwnPropertyNames,Qj=Object.getPrototypeOf,Kj=Object.prototype.hasOwnProperty,vl=(t,e)=>function(){return e||(0,t[r6(t)[0]])((e={exports:{}}).exports,e),e.exports},Xj=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(var i=r6(e),o=0,d=i.length,f;o<d;o++)f=i[o],!Kj.call(t,f)&&f!==n&&s6(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=Vj(e,f))||s.enumerable});return t},xa=(t,e,n)=>(n=t!=null?Yj(Qj(t)):{},Xj(e||!t||!t.__esModule?s6(n,"default",{value:t,enumerable:!0}):n,t)),i6=vl({"../../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}}),Fj=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=i6().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}}),Zj=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=i6().default,s=Fj();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}}),rd=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=Zj();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}}),Ai=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=rd();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}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(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});function uh(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(m){var y;i||(y=n.next)===null||y===void 0||y.call(n,m)},error(m){var y;i||(i=!0,(y=n.error)===null||y===void 0||y.call(n,m),f())},complete(){var m;i||(i=!0,(m=n.complete)===null||m===void 0||m.call(n),f())}}),d&&f(),{unsubscribe:f}},pipe(...n){return n.reduce(Ij,e)}};return e}function Ij(t,e){return e(t)}function Jj(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(m){o=!0,s(m),d()},error(m){i(m)},complete(){e.abort(),d()}})})}function Wj(t){return e=>{let n=0,s=null;const i=[];function o(){s||(s=e.subscribe({next(f){for(const y of i){var m;(m=y.next)===null||m===void 0||m.call(y,f)}},error(f){for(const y of i){var m;(m=y.error)===null||m===void 0||m.call(y,f)}},complete(){for(const m of i){var f;(f=m.complete)===null||f===void 0||f.call(m)}}}))}function d(){if(n===0&&s){const f=s;s=null,f.unsubscribe()}}return uh(f=>(n++,i.push(f),o(),{unsubscribe(){n--,d();const m=i.findIndex(y=>y===f);m>-1&&i.splice(m,1)}}))}}function l6(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=uh(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 $j(t){return uh(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(m){return n(i+1,m)}})}return n().subscribe(e)})}function Om(t){return!!t&&!Array.isArray(t)&&typeof t=="object"}function ew(){return Object.create(null)}const r3=t=>t();function i3(t=0){return new Promise(e=>setTimeout(e,t))}var tw=Object.create,o6=Object.defineProperty,nw=Object.getOwnPropertyDescriptor,u6=Object.getOwnPropertyNames,aw=Object.getPrototypeOf,sw=Object.prototype.hasOwnProperty,Zm=(t,e)=>function(){return e||(0,t[u6(t)[0]])((e={exports:{}}).exports,e),e.exports},rw=(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],!sw.call(t,f)&&f!==n&&o6(t,f,{get:(m=>e[m]).bind(null,f),enumerable:!(s=nw(e,f))||s.enumerable});return t},P1=(t,e,n)=>(n=t!=null?tw(aw(t)):{},rw(o6(n,"default",{value:t,enumerable:!0}),t));const c6=()=>{},l3=t=>{Object.freeze&&Object.freeze(t)};function d6(t,e,n){var s;const i=e.join(".");return(s=n[i])!==null&&s!==void 0||(n[i]=new Proxy(c6,{get(o,d){if(!(typeof d!="string"||d==="then"))return d6(t,[...e,d],n)},apply(o,d,f){const m=e[e.length-1];let y={args:f,path:e};return m==="call"?y={args:f.length>=2?[f[1]]:[],path:e.slice(0,-1)}:m==="apply"&&(y={args:f.length>=2?f[1]:[],path:e.slice(0,-1)}),l3(y.args),l3(y.path),t(y)}})),n[i]}const iw=t=>d6(t,[],ew()),lw=t=>new Proxy(c6,{get(e,n){if(n!=="then")return t(n)}});var f6=Zm({"../../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}}),ow=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(t,e){var n=f6().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}}),uw=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(t,e){var n=f6().default,s=ow();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}}),h6=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(t,e){var n=uw();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=Zm({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(t,e){var n=h6();function s(o,d){var f=Object.keys(o);if(Object.getOwnPropertySymbols){var m=Object.getOwnPropertySymbols(o);d&&(m=m.filter(function(y){return Object.getOwnPropertyDescriptor(o,y).enumerable})),f.push.apply(f,m)}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(m){n(o,m,f[m])}):Object.getOwnPropertyDescriptors?Object.defineProperties(o,Object.getOwnPropertyDescriptors(f)):s(Object(f)).forEach(function(m){Object.defineProperty(o,m,Object.getOwnPropertyDescriptor(f,m))})}return o}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports}});P1(lv());P1(h6());var Y0=P1(lv());function cw(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 $y=class extends Error{constructor(){super("Unable to transform response from server")}};function p6(t,e){let n;try{n=cw(t,e)}catch{throw new $y}if(!n.ok&&(!Om(n.error.error)||typeof n.error.error.code!="number"))throw new $y;if(n.ok&&!Om(n.result))throw new $y;return n}P1(lv());var V0=xa(rd(),1),jf=xa(Ai(),1);function dw(t){return t instanceof co}function fw(t){return Om(t)&&Om(t.error)&&typeof t.error.code=="number"&&typeof t.error.message=="string"}function hw(t,e){return typeof t=="string"?t:Om(t)&&typeof t.message=="string"?t.message:e}var co=class g1 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,g1.prototype)}static from(e,n={}){const s=e;return dw(s)?(n.meta&&(s.meta=(0,jf.default)((0,jf.default)({},s.meta),n.meta)),s):fw(s)?new g1(s.error.message,(0,jf.default)((0,jf.default)({},n),{},{result:s,cause:n.cause})):new g1(hw(s,"Unknown error"),(0,jf.default)((0,jf.default)({},n),{},{cause:s}))}};function m6(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 o3=t=>typeof t=="function";function pw(t){if(t)return t;if(typeof window<"u"&&o3(window.fetch))return window.fetch;if(typeof globalThis<"u"&&o3(globalThis.fetch))return globalThis.fetch;throw new Error("No fetch implementation found")}var mm=xa(Ai());function mw(t){return{url:t.url.toString(),fetch:t.fetch,transformer:m6(t.transformer),methodOverride:t.methodOverride}}function gw(t){const e={};for(let n=0;n<t.length;n++){const s=t[n];e[n]=s}return e}const yw={query:"GET",mutation:"POST",subscription:"PATCH"};function g6(t){return"input"in t?t.transformer.input.serialize(t.input):gw(t.inputs.map(e=>t.transformer.input.serialize(e)))}const hb=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=g6(t);o!==void 0&&t.methodOverride!=="POST"&&i.push(`input=${encodeURIComponent(JSON.stringify(o))}`)}return i.length&&(s+="?"+i.join("&")),s},xw=t=>{if(t.type==="query"&&t.methodOverride!=="POST")return;const e=g6(t);return e!==void 0?JSON.stringify(e):void 0},bw=t=>pb((0,mm.default)((0,mm.default)({},t),{},{contentTypeHeader:"application/json",getUrl:hb,getBody:xw}));var vw=class extends Error{constructor(){const t="AbortError";super(t),this.name=t,this.message=t}};const Sw=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 vw};async function Nw(t){var e,n;Sw(t.signal);const s=t.getUrl(t),i=t.getBody(t),o=(e=t.methodOverride)!==null&&e!==void 0?e:yw[t.type],d=await(async()=>{const m=await t.headers();return Symbol.iterator in m?Object.fromEntries(m):m})(),f=(0,mm.default)((0,mm.default)((0,mm.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 pw(t.fetch)(s,{method:o,signal:t.signal,body:i,headers:f})}async function pb(t){const e={},n=await Nw(t);e.response=n;const s=await n.json();return e.responseJSON=s,{json:s,meta:e}}function _w(t){return t instanceof Uint8Array||t instanceof Blob}function Cw(t){return t instanceof FormData}var Mf=xa(Ai(),1);const jw=t=>{if("input"in t){const{input:e}=t;if(Cw(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("FormData is only supported for mutations");return pb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:void 0,getUrl:hb,getBody:()=>e}))}if(_w(e)){if(t.type!=="mutation"&&t.methodOverride!=="POST")throw new Error("Octet type input is only supported for mutations");return pb((0,Mf.default)((0,Mf.default)({},t),{},{contentTypeHeader:"application/octet-stream",getUrl:hb,getBody:()=>e}))}}return bw(t)};function ww(t){const e=mw(t);return()=>n=>{const{op:s}=n;return uh(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 m=jw((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 m.then(v=>{y=v.meta;const b=p6(v.json,e.transformer.output);if(!b.ok){i.error(co.from(b.error,{meta:y}));return}i.next({context:v.meta,result:b.result}),i.complete()}).catch(v=>{i.error(co.from(v,{meta:y}))}),()=>{}})}}xa(Ai(),1);xa(Ai(),1);const Ew={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)}},Tw={enabled:!1,closeMs:0},Rw={enabled:!1,pongTimeoutMs:1e3,intervalMs:5e3},Ow=t=>t===0?0:Math.min(1e3*2**t,3e4),y6=(t,...e)=>typeof t=="function"?t(...e):t;var Aw=xa(rd(),1),wf=class x6 extends Error{constructor(e){super(e.message,{cause:e.cause}),this.name="TRPCWebSocketClosedError",Object.setPrototypeOf(this,x6.prototype)}},Mw=class{constructor(t,e){this.onTimeout=t,this.timeoutMs=e,(0,Aw.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 b6(){let t,e;return{promise:new Promise((s,i)=>{t=s,e=i}),resolve:t,reject:e}}async function Dw(t){const e=await y6(t.url);if(!t.connectionParams)return e;const s=`${e.includes("?")?"&":"?"}connectionParams=1`;return e+s}async function zw(t,e){const n={method:"connectionParams",data:await y6(t)};return e.encode(n)}var u3=xa(rd(),1),kw=class{constructor(){(0,u3.default)(this,"outgoingRequests",new Array),(0,u3.default)(this,"pendingRequests",{})}register(t,e){const{promise:n,resolve:s}=b6();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}},gu=xa(rd(),1);function Lw(t){const{promise:e,resolve:n,reject:s}=b6();return t.addEventListener("open",()=>{t.removeEventListener("error",s),n()}),t.addEventListener("error",s),e}function Uw(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:m})=>{clearTimeout(s),o(),m==="PONG"&&f()}),t.addEventListener("close",()=>{clearTimeout(s),clearTimeout(i)})}var v6=class mb{constructor(e){var n;if((0,gu.default)(this,"id",++mb.connectCount),(0,gu.default)(this,"WebSocketPonyfill",void 0),(0,gu.default)(this,"urlOptions",void 0),(0,gu.default)(this,"keepAliveOpts",void 0),(0,gu.default)(this,"encoder",void 0),(0,gu.default)(this,"wsObservable",l6(null)),(0,gu.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=++mb.connectCount;const n=Dw(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&&Uw(s,e.keepAliveOpts),s.addEventListener("close",()=>{e.ws===s&&(e.ws=null)}),await Lw(s),e.urlOptions.connectionParams&&s.send(await zw(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,gu.default)(v6,"connectCount",0);function Hw(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 ul=xa(rd(),1),Ef=xa(Ai(),1),qw=class{constructor(t){var e,n;(0,ul.default)(this,"connectionState",void 0),(0,ul.default)(this,"allowReconnect",!1),(0,ul.default)(this,"requestManager",new kw),(0,ul.default)(this,"activeConnection",void 0),(0,ul.default)(this,"reconnectRetryDelay",void 0),(0,ul.default)(this,"inactivityTimeout",void 0),(0,ul.default)(this,"callbacks",void 0),(0,ul.default)(this,"lazyMode",void 0),(0,ul.default)(this,"encoder",void 0),(0,ul.default)(this,"reconnecting",null),this.encoder=(e=t.experimental_encoder)!==null&&e!==void 0?e:Ew,this.callbacks={onOpen:t.onOpen,onClose:t.onClose,onError:t.onError};const s=(0,Ef.default)((0,Ef.default)({},Tw),t.lazy);this.inactivityTimeout=new Mw(()=>{if(this.requestManager.hasOutgoingRequests()||this.requestManager.hasPendingRequests()){this.inactivityTimeout.reset();return}this.close().catch(()=>null)},s.closeMs),this.activeConnection=new v6({WebSocketPonyfill:t.WebSocket,urlOptions:t,keepAlive:(0,Ef.default)((0,Ef.default)({},Rw),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:Ow,this.lazyMode=s.enabled,this.connectionState=l6({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 wf({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 wf({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 uh(f=>{const m=this.batchSend({id:t,method:e,params:{input:o.input.serialize(s),path:n,lastEventId:d}},(0,Ef.default)((0,Ef.default)({},f),{},{next(y){const v=p6(y,o.output);if(!v.ok){f.error(co.from(v.error));return}f.next({result:v.result})}}));return()=>{m(),e==="subscription"&&this.activeConnection.isOpen()&&this.send({id:t,method:"subscription.stop"}),i==null||i.removeEventListener("abort",m)}})}get connection(){return Hw(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 i3(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 wf({message:"WebSocket closed",cause:s}))),this.requestManager.delete(o.id))};t.addEventListener("open",()=>{r3(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 wf({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 wf({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 wf({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(),r3(async()=>{n.activeConnection.isOpen()||await n.open(),await i3(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 Bw(t){return new qw(t)}function Gw(t){const{client:e}=t,n=m6(t.transformer);return()=>({op:s})=>uh(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 ex=xa(rd(),1),c3=xa(Ai(),1),Pw=class{constructor(t){(0,ex.default)(this,"links",void 0),(0,ex.default)(this,"runtime",void 0),(0,ex.default)(this,"requestId",void 0),this.requestId=0,this.runtime={},this.links=t.links.map(e=>e(this.runtime))}$request(t){var e;return $j({links:this.links,op:(0,c3.default)((0,c3.default)({},t),{},{context:(e=t.context)!==null&&e!==void 0?e:{},id:++this.requestId})}).pipe(Wj())}async requestAsPromise(t){var e=this;try{const n=e.$request(t);return(await Jj(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 m;(m=n.onData)===null||m===void 0||m.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 Yw=Symbol.for("trpc_untypedClient"),Vw={query:"query",mutate:"mutation",subscribe:"subscription"},Qw=t=>Vw[t];function Kw(t){const e=iw(({path:n,args:s})=>{const i=[...n],o=Qw(i.pop()),d=i.join(".");return t[o](d,...s)});return lw(n=>n===Yw?t:e[n])}function d3(t){const e=new Pw(t);return Kw(e)}xa(Ai(),1);xa(Ai(),1);var Xw=vl({"../../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,m=2;for(typeof Symbol<"u"&&(d=Symbol.asyncIterator,f=Symbol.iterator);m--;){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(m){return{value:m,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 m=this.s.return;return m===void 0?Promise.resolve({value:f,done:!0}):o(m.apply(this.s,arguments))},throw:function(f){var m=this.s.return;return m===void 0?Promise.reject(f):o(m.apply(this.s,arguments))}},new s(i)}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}});xa(Xw(),1);xa(Ai(),1);var Fw=vl({"../../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,m){var y=Error();return y.name="SuppressedError",y.error=f,y.suppressed=m,y},i={},o=[];function d(f,m){if(m!=null){if(Object(m)!==m)throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");if(f)var y=m[Symbol.asyncDispose||Symbol.for("Symbol.asyncDispose")];if(y===void 0&&(y=m[Symbol.dispose||Symbol.for("Symbol.dispose")],f))var v=y;if(typeof y!="function")throw new TypeError("Object is not disposable.");v&&(y=function(){try{v.call(m)}catch(_){return Promise.reject(_)}}),o.push({v:m,d:y,a:f})}else f&&o.push({d:m,a:f});return m}return{e:i,u:d.bind(null,!1),a:d.bind(null,!0),d:function(){var m,y=this.e,v=0;function b(){for(;m=o.pop();)try{if(!m.a&&v===1)return v=0,o.push(m),Promise.resolve().then(b);if(m.d){var j=m.d.call(m.v);if(m.a)return v|=2,Promise.resolve(j).then(b,_)}else v|=1}catch(w){return _(w)}if(v===1)return y!==i?Promise.reject(y):Promise.resolve();if(y!==i)throw y}function _(j){return y=y!==i?new s(j,y):j,b()}return b()}}}e.exports=n,e.exports.__esModule=!0,e.exports.default=e.exports}}),S6=vl({"../../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}}),Zw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(t,e){var n=S6();function s(i){return new n(i,0)}e.exports=s,e.exports.__esModule=!0,e.exports.default=e.exports}}),Iw=vl({"../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(t,e){var n=S6();function s(o){return function(){return new i(o.apply(this,arguments))}}function i(o){var d,f;function m(v,b){try{var _=o[v](b),j=_.value,w=j instanceof n;Promise.resolve(w?j.v:j).then(function(R){if(w){var O=v==="return"?"return":"next";if(!j.k||R.done)return m(O,R);R=o[O](R).value}y(_.done?"return":"normal",R)},function(R){m("throw",R)})}catch(R){y("throw",R)}}function y(v,b){switch(v){case"return":d.resolve({value:b,done:!0});break;case"throw":d.reject(b);break;default:d.resolve({value:b,done:!1})}(d=d.next)?m(d.key,d.arg):f=null}this._invoke=function(v,b){return new Promise(function(_,j){var w={key:v,arg:b,resolve:_,reject:j,next:null};f?f=f.next=w:(d=f=w,m(v,b))})},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(Fw(),1);xa(Zw(),1);xa(Iw(),1);xa(Ai(),1);class Jw{constructor(e){Pp(this,"trpc");Pp(this,"serverUrl");Pp(this,"token");Pp(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=Bw({url:o,connectionParams:()=>({token:this.token}),retryDelayMs:()=>2e3}),this.trpc=d3({links:[Gw({client:this.wsClient,transformer:kt})]})}else this.trpc=d3({links:[ww({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 N6=(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))(N6||{});const Ww=["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"],$w=["person","people","pedestrian","rider","driver","cyclist","skier","skateboarder","face","hand","head","body"],eE=["vehicle","car","truck","bus","motorcycle","bicycle","van","ambulance","police_car","fire_truck","train","subway","tram","airplane","boat","ship","helicopter"],tE=["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"],nE=["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"],aE=["motion","movement","other"],sE=["package","packet"],rE=["audio"],iE=["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"],lE=["doorbell","ring"],oE=["lock","binary","flood","entry","door","leak","door_open","flooded","entry_open"];({...Ww.reduce((t,e)=>({...t,[e]:"animal"}),{}),...$w.reduce((t,e)=>({...t,[e]:"person"}),{}),...eE.reduce((t,e)=>({...t,[e]:"vehicle"}),{}),...aE.reduce((t,e)=>({...t,[e]:"motion"}),{}),...sE.reduce((t,e)=>({...t,[e]:"package"}),{}),...tE.reduce((t,e)=>({...t,[e]:"face"}),{}),...nE.reduce((t,e)=>({...t,[e]:"plate"}),{}),...rE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...iE.reduce((t,e)=>({...t,[e]:"audio"}),{}),...lE.reduce((t,e)=>({...t,[e]:"doorbell"}),{}),...oE.reduce((t,e)=>({...t,[e]:"sensor"}),{})});const uE=Object.values(N6),cE=uE.filter(t=>t!=="motion");[...cE];const dE=["Entry","Light","Switch","Lock","SecuritySystem","Buttons","WindowCovering","Siren","Sensor","Select","Program"];new Set(dE);const fE=["light","switch","input_boolean","cover","lock","alarm_control_panel","input_button","button","input_select","select","siren","media_player","script"];new Set(fE);let y1=null;function Am(){if(!y1){const t=window.location.origin,e=localStorage.getItem("camstack_admin_token")??void 0;y1=new Jw({serverUrl:t,token:e})}return y1}function f3(){y1=null}const _6=D.createContext(null);function h3(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 hE({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 m=h3(f);if(!m||m.exp*1e3<Date.now()){localStorage.removeItem("camstack_admin_token"),i(!1);return}Am().getSystemInfo().then(()=>n(m)).catch(v=>{var _;const b=(_=v==null?void 0:v.data)==null?void 0:_.code;b==="UNAUTHORIZED"||b==="FORBIDDEN"?(localStorage.removeItem("camstack_admin_token"),f3()):n(m)}).finally(()=>i(!1))},[]);const o=D.useCallback(async(f,m)=>{const y=Am(),b=(await y.login(f,m)).token;localStorage.setItem("camstack_admin_token",b),y.setToken(b),n(h3(b))},[]),d=D.useCallback(()=>{localStorage.removeItem("camstack_admin_token"),f3(),n(null)},[]);return h.jsx(_6.Provider,{value:{user:e,loading:s,login:o,logout:d},children:t})}function ov(){const t=D.useContext(_6);if(!t)throw new Error("useAuth must be used within AuthProvider");return t}function Mc({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(sb,{to:"/access-denied",replace:!0}):h.jsx(h.Fragment,{children:t}):h.jsx(sb,{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 pE=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()),p3=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(),gE=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 yE={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 xE=D.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:s,className:i="",children:o,iconNode:d,...f},m)=>D.createElement("svg",{ref:m,...yE,width:e,height:e,stroke:t,strokeWidth:s?Number(n)*24/Number(e):n,className:C6("lucide",i),...!o&&!gE(f)&&{"aria-hidden":"true"},...f},[...d.map(([y,v])=>D.createElement(y,v)),...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(xE,{ref:o,iconNode:e,className:C6(`lucide-${pE(p3(t))}`,`lucide-${t}`,s),...i}));return n.displayName=p3(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 bE=[["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"}]],uv=ke("activity",bE);/**
|
|
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 vE=[["path",{d:"M12 17V3",key:"1cwfxf"}],["path",{d:"m6 11 6 6 6-6",key:"12ii2o"}],["path",{d:"M19 21H5",key:"150jfl"}]],SE=ke("arrow-down-to-line",vE);/**
|
|
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 NE=[["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"}]],cv=ke("bell",NE);/**
|
|
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 _E=[["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"}]],gb=ke("bot",_E);/**
|
|
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 CE=[["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"}]],jE=ke("box",CE);/**
|
|
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 wE=[["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"}]],EE=ke("calendar",wE);/**
|
|
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 TE=[["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"}]],Lu=ke("camera",TE);/**
|
|
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 RE=[["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"}]],OE=ke("car",RE);/**
|
|
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 AE=[["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"}]],ME=ke("cctv",AE);/**
|
|
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 DE=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Im=ke("check",DE);/**
|
|
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 zE=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Zc=ke("chevron-down",zE);/**
|
|
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 kE=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],LE=ke("chevron-left",kE);/**
|
|
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 UE=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Ic=ke("chevron-right",UE);/**
|
|
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 HE=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],_1=ke("chevron-up",HE);/**
|
|
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 qE=[["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"}]],BE=ke("circle-alert",qE);/**
|
|
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 GE=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],PE=ke("circle-check-big",GE);/**
|
|
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 YE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]],j6=ke("circle-dot",YE);/**
|
|
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 VE=[["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"}]],m3=ke("circle-help",VE);/**
|
|
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 QE=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]],w6=ke("clock",QE);/**
|
|
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 KE=[["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"}]],XE=ke("copy",KE);/**
|
|
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 FE=[["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"}]],kf=ke("cpu",FE);/**
|
|
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 ZE=[["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"}]],IE=ke("crosshair",ZE);/**
|
|
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 JE=[["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"}]],WE=ke("dog",JE);/**
|
|
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 $E=[["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"}]],dv=ke("download",$E);/**
|
|
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 eT=[["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"}]],tT=ke("external-link",eT);/**
|
|
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 nT=[["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"}]],E6=ke("eye-off",nT);/**
|
|
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 aT=[["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",aT);/**
|
|
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=[["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"}]],T6=ke("film",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 rT=[["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"}]],iT=ke("flask-conical",rT);/**
|
|
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 lT=[["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"}]],oT=ke("funnel",lT);/**
|
|
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 uT=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],cT=ke("gauge",uT);/**
|
|
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 dT=[["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"}]],Y1=ke("git-branch",dT);/**
|
|
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 fT=[["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"}]],hT=ke("grip-vertical",fT);/**
|
|
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 pT=[["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"}]],gm=ke("hard-drive",pT);/**
|
|
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=[["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"}]],gT=ke("house",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 yT=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],yb=ke("info",yT);/**
|
|
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 xT=[["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"}]],bT=ke("languages",xT);/**
|
|
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 vT=[["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"}]],R6=ke("layout-dashboard",vT);/**
|
|
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 ST=[["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"}]],NT=ke("lightbulb",ST);/**
|
|
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 _T=[["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"}]],CT=ke("list-todo",_T);/**
|
|
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 jT=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Jc=ke("loader-circle",jT);/**
|
|
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 wT=[["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"}]],ET=ke("log-out",wT);/**
|
|
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 TT=[["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"}]],O6=ke("mic",TT);/**
|
|
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 RT=[["path",{d:"M5 12h14",key:"1ays0h"}]],OT=ke("minus",RT);/**
|
|
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 AT=[["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",AT);/**
|
|
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 MT=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],DT=ke("moon",MT);/**
|
|
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 zT=[["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",zT);/**
|
|
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 kT=[["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"}]],LT=ke("pause",kT);/**
|
|
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 UT=[["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"}]],HT=ke("pencil",UT);/**
|
|
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 qT=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],fv=ke("play",qT);/**
|
|
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 BT=[["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"}]],A6=ke("plug",BT);/**
|
|
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 GT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],po=ke("plus",GT);/**
|
|
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 PT=[["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"}]],j1=ke("puzzle",PT);/**
|
|
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 YT=[["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"}]],hv=ke("radio",YT);/**
|
|
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 VT=[["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"}]],Dm=ke("refresh-cw",VT);/**
|
|
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 QT=[["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"}]],M6=ke("save",QT);/**
|
|
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 KT=[["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"}]],V1=ke("scroll-text",KT);/**
|
|
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 XT=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],pv=ke("search",XT);/**
|
|
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 FT=[["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"}]],w1=ke("server",FT);/**
|
|
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 ZT=[["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"}]],Jm=ke("settings",ZT);/**
|
|
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 IT=[["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"}]],JT=ke("shield-x",IT);/**
|
|
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 WT=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],D6=ke("square",WT);/**
|
|
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 $T=[["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"}]],eR=ke("sun",$T);/**
|
|
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 tR=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],nR=ke("terminal",tR);/**
|
|
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 aR=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],sR=ke("toggle-left",aR);/**
|
|
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 rR=[["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"}]],Wm=ke("trash-2",rR);/**
|
|
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 iR=[["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"}]],lR=ke("tree-pine",iR);/**
|
|
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 oR=[["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"}]],z6=ke("triangle-alert",oR);/**
|
|
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 uR=[["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"}]],k6=ke("upload",uR);/**
|
|
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 cR=[["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"}]],dR=ke("user",cR);/**
|
|
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 fR=[["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"}]],hR=ke("users",fR);/**
|
|
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 pR=[["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"}]],mR=ke("video",pR);/**
|
|
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 gR=[["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"}]],yR=ke("wifi-off",gR);/**
|
|
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 xR=[["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"}]],g3=ke("wifi",xR);/**
|
|
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 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"}]],vR=ke("workflow",bR);/**
|
|
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 SR=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],mo=ke("x",SR);/**
|
|
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 NR=[["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"}]],L6=ke("wrench",NR);var y3={};const at=t=>typeof t=="string",Xp=()=>{let t,e;const n=new Promise((s,i)=>{t=s,e=i});return n.resolve=t,n.reject=e,n},x3=t=>t==null?"":""+t,_R=(t,e,n)=>{t.forEach(s=>{e[s]&&(n[s]=e[s])})},CR=/###/g,b3=t=>t&&t.indexOf("###")>-1?t.replace(CR,"."):t,v3=t=>!t||at(t),ym=(t,e,n)=>{const s=at(e)?e.split("."):e;let i=0;for(;i<s.length-1;){if(v3(t))return{};const o=b3(s[i]);!t[o]&&n&&(t[o]=new n),Object.prototype.hasOwnProperty.call(t,o)?t=t[o]:t={},++i}return v3(t)?{}:{obj:t,k:b3(s[i])}},S3=(t,e,n)=>{const{obj:s,k:i}=ym(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=ym(t,d,Object);for(;f.obj===void 0&&d.length;)o=`${d[d.length-1]}.${o}`,d=d.slice(0,d.length-1),f=ym(t,d,Object),f!=null&&f.obj&&typeof f.obj[`${f.k}.${o}`]<"u"&&(f.obj=void 0);f.obj[`${f.k}.${o}`]=n},jR=(t,e,n,s)=>{const{obj:i,k:o}=ym(t,e,Object);i[o]=i[o]||[],i[o].push(n)},E1=(t,e)=>{const{obj:n,k:s}=ym(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,s))return n[s]},wR=(t,e,n)=>{const s=E1(t,n);return s!==void 0?s:E1(e,n)},U6=(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]):U6(t[s],e[s],n):t[s]=e[s]);return t},Dc=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var ER={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const TR=t=>at(t)?t.replace(/[&<>"'\/]/g,e=>ER[e]):t;class RR{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 OR=[" ",",","?","!",";"],AR=new RR(20),MR=(t,e,n)=>{e=e||"",n=n||"";const s=OR.filter(d=>e.indexOf(d)<0&&n.indexOf(d)<0);if(s.length===0)return!0;const i=AR.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},xb=(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 m=o;m<s.length;++m)if(m!==o&&(f+=n),f+=s[m],d=i[f],d!==void 0){if(["string","number","boolean"].indexOf(typeof d)>-1&&m<s.length-1)continue;o+=m-o+1;break}i=d}return i},zm=t=>t==null?void 0:t.replace(/_/g,"-"),DR={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 T1{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||DR,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 T1(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new T1(this.logger,e)}}var pl=new T1;class Q1{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 N3 extends Q1{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,v;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 m=E1(this.data,f);return!m&&!n&&!s&&e.indexOf(".")>-1&&(e=f[0],n=f[1],s=f.slice(2).join(".")),m||!d||!at(s)?m:xb((v=(y=this.data)==null?void 0:y[e])==null?void 0:v[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),S3(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 m=E1(this.data,f)||{};d.skipCopy||(s=JSON.parse(JSON.stringify(s))),i?U6(m,s,o):m={...m,...s},S3(this.data,f,m),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 q6=Symbol("i18next/PATH_KEY");function zR(){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===q6?t:(t.push(i),n=Proxy.revocable(s,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function Lf(t,e){const{[q6]:n}=t(zR()),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 _3={},tx=t=>!at(t)&&typeof t!="boolean"&&typeof t!="number";class R1 extends Q1{constructor(e,n={}){super(),_R(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=pl.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=tx(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&&!MR(e,s,i);if(d&&!f){const m=e.match(this.interpolator.nestingRegexp);if(m&&m.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=Lf(e,{...this.options,...i})),Array.isArray(e)||(e=[String(e)]),e=e.map(J=>typeof J=="function"?Lf(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:m}=this.extractFromKey(e[e.length-1],i),y=m[m.length-1];let v=i.nsSeparator!==void 0?i.nsSeparator:this.options.nsSeparator;v===void 0&&(v=":");const b=i.lng||this.language,_=i.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((b==null?void 0:b.toLowerCase())==="cimode")return _?o?{res:`${y}${v}${f}`,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:`${y}${v}${f}`:o?{res:f,usedKey:f,exactUsedKey:f,usedLng:b,usedNS:y,usedParams:this.getUsedParamsDetails(i)}:f;const j=this.resolve(e,i);let w=j==null?void 0:j.res;const R=(j==null?void 0:j.usedKey)||f,O=(j==null?void 0:j.exactUsedKey)||f,T=["[object Number]","[object Function]","[object RegExp]"],A=i.joinArrays!==void 0?i.joinArrays:this.options.joinArrays,z=!this.i18nFormat||this.i18nFormat.handleAsObject,k=i.count!==void 0&&!at(i.count),P=R1.hasDefaultValue(i),H=k?this.pluralResolver.getSuffix(b,i.count,i):"",B=i.ordinal&&k?this.pluralResolver.getSuffix(b,i.count,{ordinal:!1}):"",L=k&&!i.ordinal&&i.count===0,V=L&&i[`defaultValue${this.options.pluralSeparator}zero`]||i[`defaultValue${H}`]||i[`defaultValue${B}`]||i.defaultValue;let Z=w;z&&!w&&P&&(Z=V);const ue=tx(Z),ae=Object.prototype.toString.apply(Z);if(z&&Z&&ue&&T.indexOf(ae)<0&&!(at(A)&&Array.isArray(Z))){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(R,Z,{...i,ns:m}):`key '${f} (${this.language})' returned an object instead of string.`;return o?(j.res=J,j.usedParams=this.getUsedParamsDetails(i),j):J}if(d){const J=Array.isArray(Z),le=J?[]:{},ce=J?O:R;for(const Y in Z)if(Object.prototype.hasOwnProperty.call(Z,Y)){const $=`${ce}${d}${Y}`;P&&!w?le[Y]=this.translate($,{...i,defaultValue:tx(V)?V[Y]:void 0,joinArrays:!1,ns:m}):le[Y]=this.translate($,{...i,joinArrays:!1,ns:m}),le[Y]===$&&(le[Y]=Z[Y])}w=le}}else if(z&&at(A)&&Array.isArray(w))w=w.join(A),w&&(w=this.extendTranslation(w,e,i,s));else{let J=!1,le=!1;!this.isValidLookup(w)&&P&&(J=!0,w=V),this.isValidLookup(w)||(le=!0,w=f);const Y=(i.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&le?void 0:w,$=P&&V!==w&&this.options.updateMissing;if(le||J||$){if(this.logger.log($?"updateKey":"missingKey",b,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 ee=[];const _e=this.languageUtils.getFallbackCodes(this.options.fallbackLng,i.lng||this.language);if(this.options.saveMissingTo==="fallback"&&_e&&_e[0])for(let G=0;G<_e.length;G++)ee.push(_e[G]);else this.options.saveMissingTo==="all"?ee=this.languageUtils.toResolveHierarchy(i.lng||this.language):ee.push(i.lng||this.language);const ge=(G,W,he)=>{var Se;const re=P&&he!==w?he:Y;this.options.missingKeyHandler?this.options.missingKeyHandler(G,y,W,re,$,i):(Se=this.backendConnector)!=null&&Se.saveMissing&&this.backendConnector.saveMissing(G,y,W,re,$,i),this.emit("missingKey",G,y,W,w)};this.options.saveMissing&&(this.options.saveMissingPlurals&&k?ee.forEach(G=>{const W=this.pluralResolver.getSuffixes(G,i);L&&i[`defaultValue${this.options.pluralSeparator}zero`]&&W.indexOf(`${this.options.pluralSeparator}zero`)<0&&W.push(`${this.options.pluralSeparator}zero`),W.forEach(he=>{ge([G],f+he,i[`defaultValue${he}`]||V)})}):ge(ee,f,V))}w=this.extendTranslation(w,e,i,j,s),le&&w===f&&this.options.appendNamespaceToMissingKey&&(w=`${y}${v}${f}`),(le||J)&&this.options.parseMissingKeyHandler&&(w=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${y}${v}${f}`:f,J?w:void 0,i))}return o?(j.res=w,j.usedParams=this.getUsedParamsDetails(i),j):w}extendTranslation(e,n,s,i,o){var m,y;if((m=this.i18nFormat)!=null&&m.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 v=at(e)&&(((y=s==null?void 0:s.interpolation)==null?void 0:y.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let b;if(v){const j=e.match(this.interpolator.nestingRegexp);b=j&&j.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),v){const j=e.match(this.interpolator.nestingRegexp),w=j&&j.length;b<w&&(s.nest=!1)}!s.lng&&i&&i.res&&(s.lng=this.language||i.usedLng),s.nest!==!1&&(e=this.interpolator.nest(e,(...j)=>(o==null?void 0:o[0])===j[0]&&!s.context?(this.logger.warn(`It seems you are nesting recursively key: ${j[0]} in key: ${n[0]}`),null):this.translate(...j,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(m=>typeof m=="function"?Lf(m,{...this.options,...n}):m)),e.forEach(m=>{if(this.isValidLookup(s))return;const y=this.extractFromKey(m,n),v=y.key;i=v;let b=y.namespaces;this.options.fallbackNS&&(b=b.concat(this.options.fallbackNS));const _=n.count!==void 0&&!at(n.count),j=_&&!n.ordinal&&n.count===0,w=n.context!==void 0&&(at(n.context)||typeof n.context=="number")&&n.context!=="",R=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);b.forEach(O=>{var T,A;this.isValidLookup(s)||(f=O,!_3[`${R[0]}-${O}`]&&((T=this.utils)!=null&&T.hasLoadedNamespace)&&!((A=this.utils)!=null&&A.hasLoadedNamespace(f))&&(_3[`${R[0]}-${O}`]=!0,this.logger.warn(`key "${i}" for languages "${R.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!!!")),R.forEach(z=>{var H;if(this.isValidLookup(s))return;d=z;const k=[v];if((H=this.i18nFormat)!=null&&H.addLookupKeys)this.i18nFormat.addLookupKeys(k,v,z,O,n);else{let B;_&&(B=this.pluralResolver.getSuffix(z,n.count,n));const L=`${this.options.pluralSeparator}zero`,V=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(_&&(n.ordinal&&B.indexOf(V)===0&&k.push(v+B.replace(V,this.options.pluralSeparator)),k.push(v+B),j&&k.push(v+L)),w){const Z=`${v}${this.options.contextSeparator||"_"}${n.context}`;k.push(Z),_&&(n.ordinal&&B.indexOf(V)===0&&k.push(Z+B.replace(V,this.options.pluralSeparator)),k.push(Z+B),j&&k.push(Z+L))}}let P;for(;P=k.pop();)this.isValidLookup(s)||(o=P,s=this.getResource(z,O,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 C3{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=pl.create("languageUtils")}getScriptPartFromCode(e){if(e=zm(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=zm(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},w3={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class kR{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=pl.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const s=zm(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!"),w3;if(!e.match(/-|_/))return w3;const m=this.languageUtils.getLanguagePartFromCode(e);d=this.getRule(m,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 E3=(t,e,n,s=".",i=!0)=>{let o=wR(t,e,n);return!o&&i&&at(n)&&(o=xb(t,n,s),o===void 0&&(o=xb(e,n,s))),o},nx=t=>t.replace(/\$/g,"$$$$");class T3{constructor(e={}){var n;this.logger=pl.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:m,formatSeparator:y,unescapeSuffix:v,unescapePrefix:b,nestingPrefix:_,nestingPrefixEscaped:j,nestingSuffix:w,nestingSuffixEscaped:R,nestingOptionsSeparator:O,maxReplaces:T,alwaysFormat:A}=e.interpolation;this.escape=n!==void 0?n:TR,this.escapeValue=s!==void 0?s:!0,this.useRawValueToEscape=i!==void 0?i:!1,this.prefix=o?Dc(o):d||"{{",this.suffix=f?Dc(f):m||"}}",this.formatSeparator=y||",",this.unescapePrefix=v?"":b||"-",this.unescapeSuffix=this.unescapePrefix?"":v||"",this.nestingPrefix=_?Dc(_):j||Dc("$t("),this.nestingSuffix=w?Dc(w):R||Dc(")"),this.nestingOptionsSeparator=O||",",this.maxReplaces=T||1e3,this.alwaysFormat=A!==void 0?A:!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 j;let o,d,f;const m=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},y=w=>{if(w.indexOf(this.formatSeparator)<0){const A=E3(n,m,w,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(A,void 0,s,{...i,...n,interpolationkey:w}):A}const R=w.split(this.formatSeparator),O=R.shift().trim(),T=R.join(this.formatSeparator).trim();return this.format(E3(n,m,O,this.options.keySeparator,this.options.ignoreJSONStructure),T,s,{...i,...n,interpolationkey:O})};this.resetRegExp();const v=(i==null?void 0:i.missingInterpolationHandler)||this.options.missingInterpolationHandler,b=((j=i==null?void 0:i.interpolation)==null?void 0:j.skipOnVariables)!==void 0?i.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:w=>nx(w)},{regex:this.regexp,safeValue:w=>this.escapeValue?nx(this.escape(w)):nx(w)}].forEach(w=>{for(f=0;o=w.regex.exec(e);){const R=o[1].trim();if(d=y(R),d===void 0)if(typeof v=="function"){const T=v(e,o,i);d=at(T)?T:""}else if(i&&Object.prototype.hasOwnProperty.call(i,R))d="";else if(b){d=o[0];continue}else this.logger.warn(`missed to pass in variable ${R} for interpolating ${e}`),d="";else!at(d)&&!this.useRawValueToEscape&&(d=x3(d));const O=w.safeValue(d);if(e=e.replace(o[0],O),b?(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=(m,y)=>{const v=this.nestingOptionsSeparator;if(m.indexOf(v)<0)return m;const b=m.split(new RegExp(`${Dc(v)}[ ]*{`));let _=`{${b[1]}`;m=b[0],_=this.interpolate(_,d);const j=_.match(/'/g),w=_.match(/"/g);(((j==null?void 0:j.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(R){return this.logger.warn(`failed parsing options string in nesting for key ${m}`,R),`${m}${v}${_}`}return d.defaultValue&&d.defaultValue.indexOf(this.prefix)>-1&&delete d.defaultValue,m};for(;i=this.nestingRegexp.exec(e);){let m=[];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&&(m=i[1].slice(y).split(this.formatSeparator).map(v=>v.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=x3(o)),o||(this.logger.warn(`missed to resolve ${i[1]} for nesting ${e}`),o=""),m.length&&(o=m.reduce((v,b)=>this.format(v,b,s.lng,{...s,interpolationkey:i[1].trim()}),o.trim())),e=e.replace(i[0],o),this.regexp.lastIndex=0}return e}}const LR=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,...m]=d.split(":"),y=m.join(":").trim().replace(/^'+|'+$/g,""),v=f.trim();n[v]||(n[v]=y),y==="false"&&(n[v]=!1),y==="true"&&(n[v]=!0),isNaN(y)||(n[v]=parseInt(y,10))}})}return{formatName:e,formatOptions:n}},R3=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(zm(s),i),e[d]=f),f(n)}},UR=t=>(e,n,s)=>t(zm(n),s)(e);class HR{constructor(e={}){this.logger=pl.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const s=n.cacheInBuiltFormats?R3:UR;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()]=R3(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(m=>m.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,f)].join(this.formatSeparator)}return o.reduce((f,m)=>{var b;const{formatName:y,formatOptions:v}=LR(m);if(this.formats[y]){let _=f;try{const j=((b=i==null?void 0:i.formatParams)==null?void 0:b[i.interpolationkey])||{},w=j.locale||j.lng||i.locale||i.lng||s;_=this.formats[y](f,w,{...v,...i,...j})}catch(j){this.logger.warn(j)}return _}else this.logger.warn(`there was no format function for ${y}`);return f},e)}}const qR=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class BR extends Q1{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=pl.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={},m={};return e.forEach(y=>{let v=!0;n.forEach(b=>{const _=`${y}|${b}`;!s.reload&&this.store.hasResourceBundle(y,b)?this.state[_]=2:this.state[_]<0||(this.state[_]===1?d[_]===void 0&&(d[_]=!0):(this.state[_]=1,v=!1,d[_]===void 0&&(d[_]=!0),o[_]===void 0&&(o[_]=!0),m[b]===void 0&&(m[b]=!0)))}),v||(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(m)}}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(m=>{jR(m.loaded,[o],d),qR(m,e),n&&m.errors.push(n),m.pendingCount===0&&!m.done&&(Object.keys(m.loaded).forEach(y=>{f[y]||(f[y]={});const v=m.loaded[y];v.length&&v.forEach(b=>{f[y][b]===void 0&&(f[y][b]=!0)})}),m.done=!0,m.errors.length?m.callback(m.errors):m.callback())}),this.emit("loaded",f),this.queue=this.queue.filter(m=>!m.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,v)=>{if(this.readingCalls--,this.waitingReads.length>0){const b=this.waitingReads.shift();this.read(b.lng,b.ns,b.fcName,b.tried,b.wait,b.callback)}if(y&&v&&i<this.maxRetries){setTimeout(()=>{this.read.call(this,e,n,s,i+1,o*2,d)},o);return}d(y,v)},m=this.backend[s].bind(this.backend);if(m.length===2){try{const y=m(e,n);y&&typeof y.then=="function"?y.then(v=>f(null,v)).catch(f):f(null,y)}catch(y){f(y)}return}return m(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 m,y,v,b,_;if((y=(m=this.services)==null?void 0:m.utils)!=null&&y.hasLoadedNamespace&&!((b=(v=this.services)==null?void 0:v.utils)!=null&&b.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 j={...d,isUpdate:o},w=this.backend.create.bind(this.backend);if(w.length<6)try{let R;w.length===5?R=w(e,n,s,i,j):R=w(e,n,s,i),R&&typeof R.then=="function"?R.then(O=>f(null,O)).catch(f):f(null,R)}catch(R){f(R)}else w(e,n,s,i,f,j)}!e||!e[0]||this.store.addResource(e[0],n,s,i)}}}const ax=()=>({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}),O3=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=()=>{},GR=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})},B6="__i18next_supportNoticeShown",PR=()=>!!(typeof globalThis<"u"&&globalThis[B6]||typeof process<"u"&&y3&&y3.I18NEXT_NO_SUPPORT_NOTICE),YR=()=>{typeof globalThis<"u"&&(globalThis[B6]=!0)},VR=t=>{var e,n,s,i,o,d,f,m,y,v,b,_,j;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=(m=t==null?void 0:t.options)==null?void 0:m.backend)!=null&&y.backends&&t.options.backend.backends.some(w=>{var R,O,T;return((R=w==null?void 0:w.name)==null?void 0:R.indexOf("Locize"))>0||((T=(O=w==null?void 0:w.constructor)==null?void 0:O.name)==null?void 0:T.indexOf("Locize"))>0})||(b=(v=t==null?void 0:t.options)==null?void 0:v.backend)!=null&&b.projectId||(j=(_=t==null?void 0:t.options)==null?void 0:_.backend)!=null&&j.backendOptions&&t.options.backend.backendOptions.some(w=>w==null?void 0:w.projectId))};class xm extends Q1{constructor(e={},n){if(super(),this.options=O3(e),this.services={},this.logger=pl,this.modules={external:[]},GR(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=ax();this.options={...s,...this.options,...O3(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&&!VR(this)&&!PR()&&(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 💙"),YR());const i=y=>y?typeof y=="function"?new y:y:null;if(!this.options.isClone){this.modules.logger?pl.init(i(this.modules.logger),this.options):pl.init(null,this.options);let y;this.modules.formatter?y=this.modules.formatter:y=HR;const v=new C3(this.options);this.store=new N3(this.options.resources,this.options);const b=this.services;b.logger=pl,b.resourceStore=this.store,b.languageUtils=v,b.pluralResolver=new kR(v,{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)&&(b.formatter=i(y),b.formatter.init&&b.formatter.init(b,this.options),this.options.interpolation.format=b.formatter.format.bind(b.formatter)),b.interpolator=new T3(this.options),b.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},b.backendConnector=new BR(i(this.modules.backend),b.resourceStore,b,this.options),b.backendConnector.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.languageDetector&&(b.languageDetector=i(this.modules.languageDetector),b.languageDetector.init&&b.languageDetector.init(b,this.options.detection,this.options)),this.modules.i18nFormat&&(b.i18nFormat=i(this.modules.i18nFormat),b.i18nFormat.init&&b.i18nFormat.init(this)),this.translator=new R1(this.services,this.options),this.translator.on("*",(j,...w)=>{this.emit(j,...w)}),this.modules.external.forEach(j=>{j.init&&j.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]=(...v)=>this.store[y](...v)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(y=>{this[y]=(...v)=>(this.store[y](...v),this)});const f=Xp(),m=()=>{const y=(v,b)=>{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(b),n(v,b)};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?m():setTimeout(m,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=[],m=y=>{if(!y||y==="cimode")return;this.services.languageUtils.toResolveHierarchy(y).forEach(b=>{b!=="cimode"&&f.indexOf(b)<0&&f.push(b)})};i?m(i):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(v=>m(v)),(d=(o=this.options.preload)==null?void 0:o.forEach)==null||d.call(o,y=>m(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=Xp();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=Xp();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,m)=>{m?this.isLanguageChangingTo===e&&(i(m),this.translator.changeLanguage(m),this.isLanguageChangingTo=void 0,this.emit("languageChanged",m),this.logger.log("languageChanged",m)):this.isLanguageChangingTo=void 0,s.resolve((...y)=>this.t(...y)),n&&n(f,(...y)=>this.t(...y))},d=f=>{var v,b;!e&&!f&&this.services.languageDetector&&(f=[]);const m=at(f)?f:f&&f[0],y=this.store.hasLanguageSomeTranslations(m)?m:this.services.languageUtils.getBestMatchFromCodes(at(f)?[f]:f);y&&(this.language||i(y),this.translator.language||this.translator.changeLanguage(y),(b=(v=this.services.languageDetector)==null?void 0:v.cacheUserLanguage)==null||b.call(v,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 m;typeof d!="object"?m=this.options.overloadTranslationOptionHandler([o,d].concat(f)):m={...d},m.lng=m.lng||i.lng,m.lngs=m.lngs||i.lngs,m.ns=m.ns||i.ns,m.keyPrefix!==""&&(m.keyPrefix=m.keyPrefix||s||i.keyPrefix);const y={...this.options,...m};typeof m.keyPrefix=="function"&&(m.keyPrefix=Lf(m.keyPrefix,y));const v=this.options.keySeparator||".";let b;return m.keyPrefix&&Array.isArray(o)?b=o.map(_=>(typeof _=="function"&&(_=Lf(_,y)),`${m.keyPrefix}${v}${_}`)):(typeof o=="function"&&(o=Lf(o,y)),b=m.keyPrefix?`${m.keyPrefix}${v}${o}`:o),this.t(b,m)};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,m)=>{const y=this.services.backendConnector.state[`${f}|${m}`];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=Xp();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=Xp();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 C3(ax());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 xm(e,n);return s.createInstance=xm.createInstance,s}cloneInstance(e={},n=Q0){const s=e.forkResourceStore;s&&delete e.forkResourceStore;const i={...this.options,...e,isClone:!0},o=new xm(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((m,y)=>(m[y]={...this.store.data[y]},m[y]=Object.keys(m[y]).reduce((v,b)=>(v[b]={...m[y][b]},v),m[y]),m),{});o.store=new N3(f,i),o.services.resourceStore=o.store}if(e.interpolation){const m={...ax().interpolation,...this.options.interpolation,...e.interpolation},y={...i,interpolation:m};o.services.interpolator=new T3(y)}return o.translator=new R1(o.services,i),o.translator.on("*",(f,...m)=>{o.emit(f,...m)}),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 Ss=xm.createInstance();Ss.createInstance;Ss.dir;Ss.init;Ss.loadResources;Ss.reloadResources;Ss.use;Ss.changeLanguage;Ss.getFixedT;Ss.t;Ss.exists;Ss.setDefaultNamespace;Ss.hasLoadedNamespace;Ss.loadNamespaces;Ss.loadLanguages;const QR=(t,e,n,s)=>{var o,d,f,m;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);Wc(i[0])&&(i[0]=`react-i18next:: ${i[0]}`),(m=(f=t==null?void 0:t.services)==null?void 0:f.logger)!=null&&m.warn?t.services.logger.warn(...i):console!=null&&console.warn&&console.warn(...i)},A3={},bb=(t,e,n,s)=>{Wc(n)&&A3[n]||(Wc(n)&&(A3[n]=new Date),QR(t,e,n,s))},G6=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},vb=(t,e,n)=>{t.loadNamespaces(e,G6(t,n))},M3=(t,e,n,s)=>{if(Wc(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return vb(t,n,s);n.forEach(i=>{t.options.ns.indexOf(i)<0&&t.options.ns.push(i)}),t.loadLanguages(e,G6(t,s))},KR=(t,e,n={})=>!e.languages||!e.languages.length?(bb(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}}),Wc=t=>typeof t=="string",XR=t=>typeof t=="object"&&t!==null,FR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,ZR={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},IR=t=>ZR[t],JR=t=>t.replace(FR,IR);let Sb={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:JR,transDefaultProps:void 0};const WR=(t={})=>{Sb={...Sb,...t}},$R=()=>Sb;let P6;const eO=t=>{P6=t},tO=()=>P6,nO={type:"3rdParty",init(t){WR(t.options.react),eO(t)}},aO=D.createContext();class sO{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var sx={exports:{}},rx={};/**
|
|
541
|
-
* @license React
|
|
542
|
-
* use-sync-external-store-shim.production.js
|
|
543
|
-
*
|
|
544
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
545
|
-
*
|
|
546
|
-
* This source code is licensed under the MIT license found in the
|
|
547
|
-
* LICENSE file in the root directory of this source tree.
|
|
548
|
-
*/var D3;function rO(){if(D3)return rx;D3=1;var t=gl();function e(b,_){return b===_&&(b!==0||1/b===1/_)||b!==b&&_!==_}var n=typeof Object.is=="function"?Object.is:e,s=t.useState,i=t.useEffect,o=t.useLayoutEffect,d=t.useDebugValue;function f(b,_){var j=_(),w=s({inst:{value:j,getSnapshot:_}}),R=w[0].inst,O=w[1];return o(function(){R.value=j,R.getSnapshot=_,m(R)&&O({inst:R})},[b,j,_]),i(function(){return m(R)&&O({inst:R}),b(function(){m(R)&&O({inst:R})})},[b]),d(j),j}function m(b){var _=b.getSnapshot;b=b.value;try{var j=_();return!n(b,j)}catch{return!0}}function y(b,_){return _()}var v=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?y:f;return rx.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:v,rx}var z3;function iO(){return z3||(z3=1,sx.exports=rO()),sx.exports}var lO=iO();const oO=(t,e)=>{if(Wc(e))return e;if(XR(e)&&Wc(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},uO={t:oO,ready:!1},cO=()=>()=>{},Rr=(t,e={})=>{var V,Z,ue;const{i18n:n}=e,{i18n:s,defaultNS:i}=D.useContext(aO)||{},o=n||s||tO();o&&!o.reportNamespaces&&(o.reportNamespaces=new sO),o||bb(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const d=D.useMemo(()=>{var ae;return{...$R(),...(ae=o==null?void 0:o.options)==null?void 0:ae.react,...e}},[o,e]),{useSuspense:f,keyPrefix:m}=d,y=i||((V=o==null?void 0:o.options)==null?void 0:V.defaultNS),v=Wc(y)?[y]:y||["translation"],b=D.useMemo(()=>v,v);(ue=(Z=o==null?void 0:o.reportNamespaces)==null?void 0:Z.addUsedNamespaces)==null||ue.call(Z,b);const _=D.useRef(0),j=D.useCallback(ae=>{if(!o)return cO;const{bindI18n:J,bindI18nStore:le}=d,ce=()=>{_.current+=1,ae()};return J&&o.on(J,ce),le&&o.store.on(le,ce),()=>{J&&J.split(" ").forEach(Y=>o.off(Y,ce)),le&&le.split(" ").forEach(Y=>o.store.off(Y,ce))}},[o,d]),w=D.useRef(),R=D.useCallback(()=>{if(!o)return uO;const ae=!!(o.isInitialized||o.initializedStoreOnce)&&b.every(ee=>KR(ee,o,d)),J=e.lng||o.language,le=_.current,ce=w.current;if(ce&&ce.ready===ae&&ce.lng===J&&ce.keyPrefix===m&&ce.revision===le)return ce;const $={t:o.getFixedT(J,d.nsMode==="fallback"?b:b[0],m),ready:ae,lng:J,keyPrefix:m,revision:le};return w.current=$,$},[o,b,m,d,e.lng]),[O,T]=D.useState(0),{t:A,ready:z}=lO.useSyncExternalStore(j,R,R);D.useEffect(()=>{if(o&&!z&&!f){const ae=()=>T(J=>J+1);e.lng?M3(o,e.lng,b,ae):vb(o,b,ae)}},[o,e.lng,b,z,f,O]);const k=o||{},P=D.useRef(null),H=D.useRef(),B=ae=>{const J=Object.getOwnPropertyDescriptors(ae);J.__original&&delete J.__original;const le=Object.create(Object.getPrototypeOf(ae),J);if(!Object.prototype.hasOwnProperty.call(le,"__original"))try{Object.defineProperty(le,"__original",{value:ae,writable:!1,enumerable:!1,configurable:!1})}catch{}return le},L=D.useMemo(()=>{const ae=k,J=ae==null?void 0:ae.language;let le=ae;ae&&(P.current&&P.current.__original===ae?H.current!==J?(le=B(ae),P.current=le,H.current=J):le=P.current:(le=B(ae),P.current=le,H.current=J));const ce=!z&&!f?(...$)=>(bb(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."),A(...$)):A,Y=[ce,le,z];return Y.t=ce,Y.i18n=le,Y.ready=z,Y},[A,k,z,k.resolvedLanguage,k.language,k.languages]);if(o&&f&&!z)throw new Promise(ae=>{const J=()=>ae();e.lng?M3(o,e.lng,b,J):vb(o,b,J)});return L};function Y6(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 k3=new Map;function dO(){const{pagePath:t}=Wb(),e=Am(),{data:n}=pt({queryKey:["addon-pages"],queryFn:async()=>{const m=await e.trpc.addonPages.listPages.query();return Y6(m)},staleTime:6e4}),s=n==null?void 0:n.find(m=>m.path===`/addon/${t}`),[i,o]=D.useState(null),[d,f]=D.useState(null);return D.useEffect(()=>{if(!s)return;const m=`${s.addonId}/${s.bundle}`,y=k3.get(m);if(y){o(()=>y);return}f(null),o(null);const v=s.bundleUrl;import(v).then(b=>{const _=b.default;if(typeof _!="function")throw new Error(`Addon page "${s.id}" does not export a default React component`);k3.set(m,_),o(()=>_)}).catch(b=>{console.error(`[AddonPageLoader] Failed to load ${v}:`,b),f(`Failed to load addon page: ${b.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:m=>{window.location.href=m}}):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 fO={dark:DT,light:eR,system:C1},hO={gauge:cT,puzzle:j1,bot:gb,cpu:kf,terminal:nR,box:jE,wrench:L6,activity:uv,plug:A6};function pO(){const t=yl(),e=xl(),{user:n,logout:s}=ov(),i=vS(),{t:o,i18n:d}=Rr(),f=Am(),{data:m=0}=pt({queryKey:["updates","count"],queryFn:async()=>(await f.trpc.addons.listUpdates.query()).length,staleTime:3e4,refetchInterval:3e4}),{data:y}=pt({queryKey:["addon-pages"],queryFn:async()=>{const T=await f.trpc.addonPages.listPages.query();return Y6(T)},staleTime:6e4}),v=()=>{s(),e("/login")},b=T=>t.pathname===T||t.pathname.startsWith(T+"/"),_=()=>{const T=d.language==="en"?"it":"en";d.changeLanguage(T)},j=[{label:o("nav.cameras","Cameras"),icon:Lu,path:"/cameras"},{label:o("nav.integrations"),icon:A6,path:"/integrations"},{label:o("nav.timeline","Timeline"),icon:w6,path:"/timeline"},{label:o("nav.pipeline","Pipeline"),icon:Y1,path:"/pipeline"}],w=[{label:o("system.addons"),icon:j1,path:"/system/addons"},{label:o("system.agents","Agents & Processes"),icon:w1,path:"/system/agents"},{label:o("system.logs"),icon:V1,path:"/system/logs"},{label:o("system.users"),icon:hR,path:"/system/users"},{label:o("system.settings"),icon:L6,path:"/system/settings"}],R=(i==null?void 0:i.mode)??"system",O={dark:o("theme.dark"),light:o("theme.light"),system:o("theme.system")};return h.jsxs("div",{className:"flex h-screen bg-background text-foreground",children:[h.jsxs("aside",{className:"flex w-48 flex-col border-r border-border bg-surface/80 backdrop-blur-sm shrink-0",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 T=b("/dashboard");return h.jsxs("button",{onClick:()=>e("/dashboard"),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-all ${T?"bg-primary/12 text-primary shadow-sm shadow-primary/5":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(R6,{className:`h-4 w-4 shrink-0 ${T?"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")})}),j.map(T=>{const A=T.icon,z=b(T.path);return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(A,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),T.label]},T.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")})}),w.map(T=>{const A=T.icon,z=b(T.path),k=T.path==="/system/addons";return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${z?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(A,{className:`h-3.5 w-3.5 shrink-0 ${z?"text-primary":""}`}),h.jsx("span",{className:"flex-1 text-left",children:T.label}),k&&m>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:m})]},T.path)}),y&&y.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")})}),y==null?void 0:y.map(T=>{const A=b(T.path),z=hO[T.icon]??j1;return h.jsxs("button",{onClick:()=>e(T.path),className:`flex w-full items-center gap-2.5 rounded-md px-2.5 py-1.5 text-[12px] transition-all ${A?"bg-primary/12 text-primary":"text-foreground-subtle hover:bg-surface-hover hover:text-foreground"}`,children:[h.jsx(z,{className:`h-3.5 w-3.5 shrink-0 ${A?"text-primary":""}`}),T.label]},T.id)})]}),h.jsxs("div",{className:"border-t border-border p-2 space-y-0.5",children:[h.jsxs("button",{onClick:_,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(bT,{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 T=fO[R];return h.jsx(T,{className:"h-3.5 w-3.5"})})(),h.jsx("span",{children:O[R]})]}),h.jsxs("button",{onClick:v,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(ET,{className:"h-3.5 w-3.5"}),h.jsx("span",{className:"truncate",children:(n==null?void 0:n.username)??"User"})]})]})]}),h.jsx("main",{className:"flex-1 overflow-auto bg-background",children:h.jsx(LN,{})})]})}function mO(){const{login:t}=ov(),e=vS(),n=xl(),[s,i]=D.useState(""),[o,d]=D.useState(""),[f,m]=D.useState(!1),[y,v]=D.useState(""),[b,_]=D.useState(!1),j=async w=>{w.preventDefault(),v(""),_(!0);try{await t(s,o),n("/dashboard",{replace:!0})}catch(R){v(R instanceof Error?R.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:j,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:()=>m(!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(E6,{className:"h-4 w-4"}):h.jsx(ch,{className:"h-4 w-4"})})]})]}),h.jsx("button",{type:"submit",disabled:b||!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:b?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 gO(){const t=xl();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(JT,{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 L3(t){return mv.get(t)}function yO(){return Array.from(mv.values())}function en(){return D.useMemo(()=>Am(),[])}function xO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=pt({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(Jc,{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(z6,{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(PE,{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:`${vO(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 vO(t){return t?(t/1024/1024).toFixed(0):"N/A"}const SO=["class-filter","tracker","sub-detection","recognition","zone-analysis","event-generation","object-snapshot"];function NO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=pt({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:SO.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 _O(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 CO({config:t,size:e}){const n=en(),{data:s,isLoading:i,error:o}=pt({queryKey:["system-info"],queryFn:async()=>await n.getSystemInfo(),refetchInterval:3e4}),{data:d}=pt({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?_O(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:xO});gv({id:"pipeline-stages",name:"Pipeline Stages",icon:vR,defaultSize:{w:4,h:3},minSize:{w:3,h:2},component:NO});gv({id:"storage",name:"Storage",icon:gm,defaultSize:{w:4,h:2},minSize:{w:2,h:2},component:CO});function dh(t){const{margin:e,containerPadding:n,containerWidth:s,cols:i}=t;return(s-e[0]*(i-1)-n[0]*2)/i}function th(t,e,n){return Number.isFinite(t)?Math.round(e*t+Math.max(0,t-1)*n):t}function Fp(t,e,n,s,i,o,d){const{margin:f,containerPadding:m,rowHeight:y}=t,v=dh(t);let b,_,j,w;if(d?(b=Math.round(d.width),_=Math.round(d.height)):(b=th(s,v,f[0]),_=th(i,y,f[1])),o?(j=Math.round(o.top),w=Math.round(o.left)):d?(j=Math.round(d.top),w=Math.round(d.left)):(j=Math.round((y+f[1])*n+m[1]),w=Math.round((v+f[0])*e+m[0])),!o&&!d){if(Number.isFinite(s)){const O=Math.round((v+f[0])*(e+s)+m[0])-w-b;O!==f[0]&&(b+=O-f[0])}if(Number.isFinite(i)){const O=Math.round((y+f[1])*(n+i)+m[1])-j-_;O!==f[1]&&(_+=O-f[1])}}return{top:j,left:w,width:b,height:_}}function jO(t,e,n,s,i){const{margin:o,containerPadding:d,cols:f,rowHeight:m,maxRows:y}=t,v=dh(t);let b=Math.round((n-d[0])/(v+o[0])),_=Math.round((e-d[1])/(m+o[1]));return b=O1(b,0,f-s),_=O1(_,0,y-i),{x:b,y:_}}function X0(t,e,n){const{margin:s,containerPadding:i,rowHeight:o}=t,d=dh(t),f=Math.round((n-i[0])/(d+s[0])),m=Math.round((e-i[1])/(o+s[1]));return{x:f,y:m}}function wO(t,e,n){const{margin:s,rowHeight:i}=t,o=dh(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 O1(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 Fc(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&yv(s,e))return s}}function V6(t,e){return t.filter(n=>yv(n,e))}function EO(t,e){return e==="horizontal"?Q6(t):e==="vertical"||e==="wrap"?Nb(t):[...t]}function Nb(t){return[...t].sort((e,n)=>e.y!==n.y?e.y-n.y:e.x-n.x)}function Q6(t){return[...t].sort((e,n)=>e.x!==n.x?e.x-n.x:e.y-n.y)}function K1(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 Lc(t,e){for(let n=0;n<t.length;n++){const s=t[n];if(s!==void 0&&s.i===e)return s}}function X1(t){return t.filter(e=>e.static===!0)}function $c(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 zu(t){const e=new Array(t.length);for(let n=0;n<t.length;n++){const s=t[n];s!==void 0&&(e[n]=$c(s))}return e}function TO(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 RO(t,e,n){let s=Lc(t,e);return s?(s=n($c(s)),[TO(t,s),s]):[[...t],null]}function xv(t,e){const n=X1(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(;Fc(n,i);)i.y++}return t}function Uc(t,e,n,s,i,o,d,f,m){if(e.static&&e.isDraggable!==!0)return[...t];if(e.y===s&&e.x===n)return[...t];const y=e.x,v=e.y;typeof n=="number"&&(e.x=n),typeof s=="number"&&(e.y=s),e.moved=!0;let b=EO(t,d);(d==="vertical"&&typeof s=="number"?v>=s:d==="horizontal"&&typeof n=="number"?y>=n:!1)&&(b=b.reverse());const j=V6(b,e),w=j.length>0;if(w&&m)return zu(t);if(w&&o)return e.x=y,e.y=v,e.moved=!1,t;let R=[...t];for(let O=0;O<j.length;O++){const T=j[O];T!==void 0&&(T.moved||(T.static?R=U3(R,T,e,i,d):R=U3(R,e,T,i,d)))}return R}function U3(t,e,n,s,i,o){const d=i==="horizontal",f=i==="vertical",m=e.static;if(s){s=!1;const b={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"},_=Fc(t,b),j=_!==void 0&&_.y+_.h>e.y,w=_!==void 0&&e.x+e.w>_.x;if(!_)return Uc(t,n,d?b.x:void 0,f?b.y:void 0,s,m,i);if(j&&f)return Uc(t,n,void 0,n.y+1,s,m,i);if(j&&i===null)return e.y=n.y,n.y=n.y+n.h,[...t];if(w&&d)return Uc(t,e,n.x,void 0,s,m,i)}const y=d?n.x+1:void 0,v=f?n.y+1:void 0;return y===void 0&&v===void 0?[...t]:Uc(t,n,y,v,s,m,i)}function Df(t,e,n){return Math.max(e,Math.min(n,t))}var OO={name:"gridBounds",constrainPosition(t,e,n,{cols:s,maxRows:i}){return{x:Df(e,0,Math.max(0,s-t.w)),y:Df(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:Df(e,1,Math.max(1,d)),h:Df(n,1,Math.max(1,f))}}},AO={name:"minMaxSize",constrainSize(t,e,n){return{w:Df(e,t.minW??1,t.maxW??1/0),h:Df(n,t.minH??1,t.maxH??1/0)}}},K6=[OO,AO];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 MO(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 X6({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 DO({top:t,left:e,width:n,height:s}){return{top:`${t}px`,left:`${e}px`,width:`${n}px`,height:`${s}px`,position:"absolute"}}function H3(t){return t*100+"%"}function zO(t,e,n,s){return t+n>s?e:n}function F6(t,e,n){return t<0?e:n}function kO(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:F6(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:zO(t.left,t.width,d,n),left:kO(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:F6(s,t.height,o),top:A1(s)}},LO=(t,e,n)=>bv(t,vv(t,e,n)),UO=(t,e,n)=>bv(t,Sv(t,e)),HO=(t,e,n)=>Nv(t,vv(t,e,n)),qO=(t,e,n)=>Nv(t,Sv(t,e)),BO={n:bv,ne:LO,e:vv,se:HO,s:Nv,sw:qO,w:Sv,nw:UO};function GO(t,e,n,s){const i=BO[t];return i?i(e,{...e,...n},s):n}var PO={type:"transform",scale:1,calcStyle(t){return X6(t)}},YO=PO,VO={cols:12,rowHeight:150,margin:[10,10],containerPadding:null,maxRows:1/0},QO={enabled:!0,bounded:!1,threshold:3},KO={enabled:!0,handles:["se"]},XO={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(m=>m.i===e.i),f=i??X1(t).length>0;for(let m=d+1;m<t.length;m++){const y=t[m];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 FO(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&&!Fc(t,e);)e.y--;let i;for(;(i=Fc(t,e))!==void 0;)_v(n,e,i.y+i.h,"y");return e.y=Math.max(e.y,0),e}function ZO(t,e,n,s){for(e.x=Math.max(e.x,0),e.y=Math.max(e.y,0);e.x>0&&!Fc(t,e);)e.x--;let i;for(;(i=Fc(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&&!Fc(t,e);)e.x--;return e.x=Math.max(e.x,0),e}var Z6={type:"vertical",allowOverlap:!1,compact(t,e){const n=X1(t);let s=K1(n);const i=Nb(t),o=new Array(t.length);for(let d=0;d<i.length;d++){const f=i[d];if(f===void 0)continue;let m=$c(f);m.static||(m=FO(n,m,i,s),s=Math.max(s,m.y+m.h),n.push(m));const y=t.indexOf(f);o[y]=m,m.moved=!1}return o}},I6={type:"horizontal",allowOverlap:!1,compact(t,e){const n=X1(t),s=Q6(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=$c(d);f.static||(f=ZO(n,f,e,s),n.push(f));const m=t.indexOf(d);i[m]=f,f.moved=!1}return i}},J6={type:null,allowOverlap:!1,compact(t,e){return zu(t)}},IO={...Z6,allowOverlap:!0,compact(t,e){return zu(t)}},JO={...I6,allowOverlap:!0,compact(t,e){return zu(t)}},WO={...J6,allowOverlap:!0};function Cv(t,e=!1,n=!1){let s;return e?t==="vertical"?s=IO:t==="horizontal"?s=JO:s=WO:t==="vertical"?s=Z6:t==="horizontal"?s=I6:s=J6,n?{...s,preventCollision:n}:s}function W6(t){return Object.keys(t).sort((n,s)=>t[n]-t[s])}function q3(t,e){const n=W6(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 B3(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 ix(t,e,n,s,i,o){const d=t[n];if(d)return zu(d);let f=t[s];const m=W6(e),y=m.slice(m.indexOf(n));for(let j=0;j<y.length;j++){const w=y[j];if(w===void 0)continue;const R=t[w];if(R){f=R;break}}const v=zu(f||[]),b=xv(v,{cols:i});return(typeof o=="object"&&o!==null?o:Cv(o)).compact(b,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 $6(t){return function(n,s,i,o,d,f,m){return t(n,s,m)}}function F1(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 m=t(n,s,i,o);return o.delete(n),o.delete(s),m}}function e8(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 G3(t){return t.constructor===Object||t.constructor==null}function P3(t){return typeof t.then=="function"}function Z1(t,e){return t===e||t!==t&&e!==e}var $O="[object Arguments]",eA="[object Boolean]",tA="[object Date]",nA="[object RegExp]",aA="[object Map]",sA="[object Number]",rA="[object Object]",iA="[object Set]",lA="[object String]",Y3=Object.prototype.toString;function I1(t){var e=t.areArraysEqual,n=t.areDatesEqual,s=t.areMapsEqual,i=t.areObjectsEqual,o=t.areRegExpsEqual,d=t.areSetsEqual,f=t.createIsNestedEqual,m=f(y);function y(v,b,_){if(v===b)return!0;if(!v||!b||typeof v!="object"||typeof b!="object")return v!==v&&b!==b;if(G3(v)&&G3(b))return i(v,b,m,_);var j=Array.isArray(v),w=Array.isArray(b);if(j||w)return j===w&&e(v,b,m,_);var R=Y3.call(v);return R!==Y3.call(b)?!1:R===tA?n(v,b,m,_):R===nA?o(v,b,m,_):R===aA?s(v,b,m,_):R===iA?d(v,b,m,_):R===rA||R===$O?P3(v)||P3(b)?!1:i(v,b,m,_):R===eA||R===sA||R===lA?Z1(v.valueOf(),b.valueOf()):!1}return y}function t8(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 oA=F1(t8);function n8(t,e){return Z1(t.valueOf(),e.valueOf())}function a8(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,m){if(i){var y=!1,v=0;e.forEach(function(b,_){!y&&!o[v]&&(y=n(m,_,d,v,t,e,s)&&n(f,b,m,_,t,e,s))&&(o[v]=!0),v++}),d++,i=y}}),i}var uA=F1(a8),cA="_owner",dA=Object.prototype.hasOwnProperty;function s8(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===cA){var f=!!t.$$typeof,m=!!e.$$typeof;if((f||m)&&f!==m)return!1}if(!dA.call(e,d)||!n(t[d],e[d],d,d,t,e,s))return!1}return!0}var fA=F1(s8);function r8(t,e){return t.source===e.source&&t.flags===e.flags}function i8(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 m=!1,y=0;e.forEach(function(v,b){!m&&!o[y]&&(m=n(d,v,f,b,t,e,s))&&(o[y]=!0),y++}),i=m}}),i}var hA=F1(i8),l8=Object.freeze({areArraysEqual:t8,areDatesEqual:n8,areMapsEqual:a8,areObjectsEqual:s8,areRegExpsEqual:r8,areSetsEqual:i8,createIsNestedEqual:$6}),o8=Object.freeze({areArraysEqual:oA,areDatesEqual:n8,areMapsEqual:uA,areObjectsEqual:fA,areRegExpsEqual:r8,areSetsEqual:hA,createIsNestedEqual:$6}),pA=I1(l8);function ro(t,e){return pA(t,e,void 0)}I1(e8(l8,{createIsNestedEqual:function(){return Z1}}));I1(o8);I1(e8(o8,{createIsNestedEqual:function(){return Z1}}));var Zp={exports:{}},lx={},ox={exports:{}},ux,V3;function mA(){if(V3)return ux;V3=1;var t="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return ux=t,ux}var cx,Q3;function gA(){if(Q3)return cx;Q3=1;var t=mA();function e(){}function n(){}return n.resetWarningCache=e,cx=function(){function s(d,f,m,y,v,b){if(b!==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},cx}var K3;function J1(){return K3||(K3=1,ox.exports=gA()()),ox.exports}var I0={exports:{}},X3;function yA(){if(X3)return I0.exports;X3=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={},fu={},F3;function W1(){if(F3)return fu;F3=1,Object.defineProperty(fu,"__esModule",{value:!0}),fu.dontSetMe=i,fu.findInArray=t,fu.int=s,fu.isFunction=e,fu.isNum=n;function t(o,d){for(let f=0,m=o.length;f<m;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 fu}var hu={},Z3;function xA(){if(Z3)return hu;Z3=1,Object.defineProperty(hu,"__esModule",{value:!0}),hu.browserPrefixToKey=n,hu.browserPrefixToStyle=s,hu.default=void 0,hu.getPrefix=e;const t=["Moz","Webkit","O","ms"];function e(){var f,m;let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"transform";if(typeof window>"u")return"";const d=(m=(f=window.document)==null?void 0:f.documentElement)==null?void 0:m.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 m=0;m<o.length;m++)f?(d+=o[m].toUpperCase(),f=!1):o[m]==="-"?f=!0:d+=o[m];return d}return hu.default=e(),hu}var I3;function jv(){if(I3)return pa;I3=1,Object.defineProperty(pa,"__esModule",{value:!0}),pa.addClassName=P,pa.addEvent=d,pa.addUserSelectStyles=A,pa.createCSSTransform=j,pa.createSVGTransform=w,pa.getTouch=O,pa.getTouchIdentifier=T,pa.getTranslation=R,pa.innerHeight=v,pa.innerWidth=b,pa.matchesSelector=i,pa.matchesSelectorAndParentsTo=o,pa.offsetXYFromParent=_,pa.outerHeight=m,pa.outerWidth=y,pa.removeClassName=H,pa.removeEvent=f,pa.scheduleRemoveUserSelectStyles=z;var t=W1(),e=n(xA());function n(B,L){if(typeof WeakMap=="function")var V=new WeakMap,Z=new WeakMap;return(n=function(ue,ae){if(!ae&&ue&&ue.__esModule)return ue;var J,le,ce={__proto__:null,default:ue};if(ue===null||typeof ue!="object"&&typeof ue!="function")return ce;if(J=ae?Z:V){if(J.has(ue))return J.get(ue);J.set(ue,ce)}for(const Y in ue)Y!=="default"&&{}.hasOwnProperty.call(ue,Y)&&((le=(J=Object.defineProperty)&&Object.getOwnPropertyDescriptor(ue,Y))&&(le.get||le.set)?J(ce,Y,le):ce[Y]=ue[Y]);return ce})(B,L)}let s="";function i(B,L){return s||(s=(0,t.findInArray)(["matches","webkitMatchesSelector","mozMatchesSelector","msMatchesSelector","oMatchesSelector"],function(V){return(0,t.isFunction)(B[V])})),(0,t.isFunction)(B[s])?B[s](L):!1}function o(B,L,V){let Z=B;do{if(i(Z,L))return!0;if(Z===V)return!1;Z=Z.parentNode}while(Z);return!1}function d(B,L,V,Z){if(!B)return;const ue={capture:!0,...Z};B.addEventListener?B.addEventListener(L,V,ue):B.attachEvent?B.attachEvent("on"+L,V):B["on"+L]=V}function f(B,L,V,Z){if(!B)return;const ue={capture:!0,...Z};B.removeEventListener?B.removeEventListener(L,V,ue):B.detachEvent?B.detachEvent("on"+L,V):B["on"+L]=null}function m(B){let L=B.clientHeight;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,t.int)(V.borderTopWidth),L+=(0,t.int)(V.borderBottomWidth),L}function y(B){let L=B.clientWidth;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L+=(0,t.int)(V.borderLeftWidth),L+=(0,t.int)(V.borderRightWidth),L}function v(B){let L=B.clientHeight;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,t.int)(V.paddingTop),L-=(0,t.int)(V.paddingBottom),L}function b(B){let L=B.clientWidth;const V=B.ownerDocument.defaultView.getComputedStyle(B);return L-=(0,t.int)(V.paddingLeft),L-=(0,t.int)(V.paddingRight),L}function _(B,L,V){const ue=L===L.ownerDocument.body?{left:0,top:0}:L.getBoundingClientRect(),ae=(B.clientX+L.scrollLeft-ue.left)/V,J=(B.clientY+L.scrollTop-ue.top)/V;return{x:ae,y:J}}function j(B,L){const V=R(B,L,"px");return{[(0,e.browserPrefixToKey)("transform",e.default)]:V}}function w(B,L){return R(B,L,"")}function R(B,L,V){let{x:Z,y:ue}=B,ae=`translate(${Z}${V},${ue}${V})`;if(L){const J=`${typeof L.x=="string"?L.x:L.x+V}`,le=`${typeof L.y=="string"?L.y:L.y+V}`;ae=`translate(${J}, ${le})`+ae}return ae}function O(B,L){return B.targetTouches&&(0,t.findInArray)(B.targetTouches,V=>L===V.identifier)||B.changedTouches&&(0,t.findInArray)(B.changedTouches,V=>L===V.identifier)}function T(B){if(B.targetTouches&&B.targetTouches[0])return B.targetTouches[0].identifier;if(B.changedTouches&&B.changedTouches[0])return B.changedTouches[0].identifier}function A(B){if(!B)return;let L=B.getElementById("react-draggable-style-el");L||(L=B.createElement("style"),L.type="text/css",L.id="react-draggable-style-el",L.innerHTML=`.react-draggable-transparent-selection *::-moz-selection {all: inherit;}
|
|
549
|
-
`,L.innerHTML+=`.react-draggable-transparent-selection *::selection {all: inherit;}
|
|
550
|
-
`,B.getElementsByTagName("head")[0].appendChild(L)),B.body&&P(B.body,"react-draggable-transparent-selection")}function z(B){window.requestAnimationFrame?window.requestAnimationFrame(()=>{k(B)}):k(B)}function k(B){if(B)try{if(B.body&&H(B.body,"react-draggable-transparent-selection"),B.selection)B.selection.empty();else{const L=(B.defaultView||window).getSelection();L&&L.type!=="Caret"&&L.removeAllRanges()}}catch{}}function P(B,L){B.classList?B.classList.add(L):B.className.match(new RegExp(`(?:^|\\s)${L}(?!\\S)`))||(B.className+=` ${L}`)}function H(B,L){B.classList?B.classList.remove(L):B.className=B.className.replace(new RegExp(`(?:^|\\s)${L}(?!\\S)`,"g"),"")}return pa}var cl={},J3;function u8(){if(J3)return cl;J3=1,Object.defineProperty(cl,"__esModule",{value:!0}),cl.canDragX=i,cl.canDragY=o,cl.createCoreData=f,cl.createDraggableData=m,cl.getBoundPosition=n,cl.getControlPosition=d,cl.snapToGrid=s;var t=W1(),e=jv();function n(b,_,j){if(!b.props.bounds)return[_,j];let{bounds:w}=b.props;w=typeof w=="string"?w:y(w);const R=v(b);if(typeof w=="string"){const{ownerDocument:O}=R,T=O.defaultView;let A;if(w==="parent"?A=R.parentNode:A=R.getRootNode().querySelector(w),!(A instanceof T.HTMLElement))throw new Error('Bounds selector "'+w+'" could not find an element.');const z=A,k=T.getComputedStyle(R),P=T.getComputedStyle(z);w={left:-R.offsetLeft+(0,t.int)(P.paddingLeft)+(0,t.int)(k.marginLeft),top:-R.offsetTop+(0,t.int)(P.paddingTop)+(0,t.int)(k.marginTop),right:(0,e.innerWidth)(z)-(0,e.outerWidth)(R)-R.offsetLeft+(0,t.int)(P.paddingRight)-(0,t.int)(k.marginRight),bottom:(0,e.innerHeight)(z)-(0,e.outerHeight)(R)-R.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)&&(j=Math.min(j,w.bottom)),(0,t.isNum)(w.left)&&(_=Math.max(_,w.left)),(0,t.isNum)(w.top)&&(j=Math.max(j,w.top)),[_,j]}function s(b,_,j){const w=Math.round(_/b[0])*b[0],R=Math.round(j/b[1])*b[1];return[w,R]}function i(b){return b.props.axis==="both"||b.props.axis==="x"}function o(b){return b.props.axis==="both"||b.props.axis==="y"}function d(b,_,j){const w=typeof _=="number"?(0,e.getTouch)(b,_):null;if(typeof _=="number"&&!w)return null;const R=v(j),O=j.props.offsetParent||R.offsetParent||R.ownerDocument.body;return(0,e.offsetXYFromParent)(w||b,O,j.props.scale)}function f(b,_,j){const w=!(0,t.isNum)(b.lastX),R=v(b);return w?{node:R,deltaX:0,deltaY:0,lastX:_,lastY:j,x:_,y:j}:{node:R,deltaX:_-b.lastX,deltaY:j-b.lastY,lastX:b.lastX,lastY:b.lastY,x:_,y:j}}function m(b,_){const j=b.props.scale;return{node:_.node,x:b.state.x+_.deltaX/j,y:b.state.y+_.deltaY/j,deltaX:_.deltaX/j,deltaY:_.deltaY/j,lastX:b.state.x,lastY:b.state.y}}function y(b){return{left:b.left,top:b.top,right:b.right,bottom:b.bottom}}function v(b){const _=b.findDOMNode();if(!_)throw new Error("<DraggableCore>: Unmounted during event!");return _}return cl}var Ip={},J0={},W3;function c8(){if(W3)return J0;W3=1,Object.defineProperty(J0,"__esModule",{value:!0}),J0.default=t;function t(){}return J0}var $3;function bA(){if($3)return Ip;$3=1,Object.defineProperty(Ip,"__esModule",{value:!0}),Ip.default=void 0;var t=m(gl()),e=f(J1()),n=f(Gb()),s=jv(),i=u8(),o=W1(),d=f(c8());function f(R){return R&&R.__esModule?R:{default:R}}function m(R,O){if(typeof WeakMap=="function")var T=new WeakMap,A=new WeakMap;return(m=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,B={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return B;if(P=k?A:T){if(P.has(z))return P.get(z);P.set(z,B)}for(const L in z)L!=="default"&&{}.hasOwnProperty.call(z,L)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,L))&&(H.get||H.set)?P(B,L,H):B[L]=z[L]);return B})(R,O)}function y(R,O,T){return(O=v(O))in R?Object.defineProperty(R,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):R[O]=T,R}function v(R){var O=b(R,"string");return typeof O=="symbol"?O:O+""}function b(R,O){if(typeof R!="object"||!R)return R;var T=R[Symbol.toPrimitive];if(T!==void 0){var A=T.call(R,O);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}const _={touch:{start:"touchstart",move:"touchmove",stop:"touchend"},mouse:{start:"mousedown",move:"mousemove",stop:"mouseup"}};let j=_.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",O=>{if(this.props.onMouseDown(O),!this.props.allowAnyClick&&typeof O.button=="number"&&O.button!==0)return!1;const T=this.findDOMNode();if(!T||!T.ownerDocument||!T.ownerDocument.body)throw new Error("<DraggableCore> not mounted on DragStart!");const{ownerDocument:A}=T;if(this.props.disabled||!(O.target instanceof A.defaultView.Node)||this.props.handle&&!(0,s.matchesSelectorAndParentsTo)(O.target,this.props.handle,T)||this.props.cancel&&(0,s.matchesSelectorAndParentsTo)(O.target,this.props.cancel,T))return;O.type==="touchstart"&&!this.props.allowMobileScroll&&O.preventDefault();const z=(0,s.getTouchIdentifier)(O);this.touchIdentifier=z;const k=(0,i.getControlPosition)(O,z,this);if(k==null)return;const{x:P,y:H}=k,B=(0,i.createCoreData)(this,P,H);(0,d.default)("DraggableCore: handleDragStart: %j",B),(0,d.default)("calling",this.props.onStart),!(this.props.onStart(O,B)===!1||this.mounted===!1)&&(this.props.enableUserSelectHack&&(0,s.addUserSelectStyles)(A),this.dragging=!0,this.lastX=P,this.lastY=H,(0,s.addEvent)(A,j.move,this.handleDrag),(0,s.addEvent)(A,j.stop,this.handleDragStop))}),y(this,"handleDrag",O=>{const T=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(T==null)return;let{x:A,y:z}=T;if(Array.isArray(this.props.grid)){let H=A-this.lastX,B=z-this.lastY;if([H,B]=(0,i.snapToGrid)(this.props.grid,H,B),!H&&!B)return;A=this.lastX+H,z=this.lastY+B}const k=(0,i.createCoreData)(this,A,z);if((0,d.default)("DraggableCore: handleDrag: %j",k),this.props.onDrag(O,k)===!1||this.mounted===!1){try{this.handleDragStop(new MouseEvent("mouseup"))}catch{const B=document.createEvent("MouseEvents");B.initMouseEvent("mouseup",!0,!0,window,0,0,0,0,0,!1,!1,!1,!1,0,null),this.handleDragStop(B)}return}this.lastX=A,this.lastY=z}),y(this,"handleDragStop",O=>{if(!this.dragging)return;const T=(0,i.getControlPosition)(O,this.touchIdentifier,this);if(T==null)return;let{x:A,y:z}=T;if(Array.isArray(this.props.grid)){let B=A-this.lastX||0,L=z-this.lastY||0;[B,L]=(0,i.snapToGrid)(this.props.grid,B,L),A=this.lastX+B,z=this.lastY+L}const k=(0,i.createCoreData)(this,A,z);if(this.props.onStop(O,k)===!1||this.mounted===!1)return!1;const H=this.findDOMNode();H&&this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(H.ownerDocument),(0,d.default)("DraggableCore: handleDragStop: %j",k),this.dragging=!1,this.lastX=NaN,this.lastY=NaN,H&&((0,d.default)("DraggableCore: Removing handlers"),(0,s.removeEvent)(H.ownerDocument,j.move,this.handleDrag),(0,s.removeEvent)(H.ownerDocument,j.stop,this.handleDragStop))}),y(this,"onMouseDown",O=>(j=_.mouse,this.handleDragStart(O))),y(this,"onMouseUp",O=>(j=_.mouse,this.handleDragStop(O))),y(this,"onTouchStart",O=>(j=_.touch,this.handleDragStart(O))),y(this,"onTouchEnd",O=>(j=_.touch,this.handleDragStop(O)))}componentDidMount(){this.mounted=!0;const O=this.findDOMNode();O&&(0,s.addEvent)(O,_.touch.start,this.onTouchStart,{passive:!1})}componentWillUnmount(){this.mounted=!1;const O=this.findDOMNode();if(O){const{ownerDocument:T}=O;(0,s.removeEvent)(T,_.mouse.move,this.handleDrag),(0,s.removeEvent)(T,_.touch.move,this.handleDrag),(0,s.removeEvent)(T,_.mouse.stop,this.handleDragStop),(0,s.removeEvent)(T,_.touch.stop,this.handleDragStop),(0,s.removeEvent)(O,_.touch.start,this.onTouchStart,{passive:!1}),this.props.enableUserSelectHack&&(0,s.scheduleRemoveUserSelectStyles)(T)}}findDOMNode(){var O,T,A;return(O=this.props)!=null&&O.nodeRef?(A=(T=this.props)==null?void 0:T.nodeRef)==null?void 0:A.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 Ip.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(R,O){if(R[O]&&R[O].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}),Ip}var e5;function vA(){return e5||(e5=1,(function(t){Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DraggableCore",{enumerable:!0,get:function(){return m.default}}),t.default=void 0;var e=b(gl()),n=v(J1()),s=v(Gb()),i=yA(),o=jv(),d=u8(),f=W1(),m=v(bA()),y=v(c8());function v(T){return T&&T.__esModule?T:{default:T}}function b(T,A){if(typeof WeakMap=="function")var z=new WeakMap,k=new WeakMap;return(b=function(P,H){if(!H&&P&&P.__esModule)return P;var B,L,V={__proto__:null,default:P};if(P===null||typeof P!="object"&&typeof P!="function")return V;if(B=H?k:z){if(B.has(P))return B.get(P);B.set(P,V)}for(const Z in P)Z!=="default"&&{}.hasOwnProperty.call(P,Z)&&((L=(B=Object.defineProperty)&&Object.getOwnPropertyDescriptor(P,Z))&&(L.get||L.set)?B(V,Z,L):V[Z]=P[Z]);return V})(T,A)}function _(){return _=Object.assign?Object.assign.bind():function(T){for(var A=1;A<arguments.length;A++){var z=arguments[A];for(var k in z)({}).hasOwnProperty.call(z,k)&&(T[k]=z[k])}return T},_.apply(null,arguments)}function j(T,A,z){return(A=w(A))in T?Object.defineProperty(T,A,{value:z,enumerable:!0,configurable:!0,writable:!0}):T[A]=z,T}function w(T){var A=R(T,"string");return typeof A=="symbol"?A:A+""}function R(T,A){if(typeof T!="object"||!T)return T;var z=T[Symbol.toPrimitive];if(z!==void 0){var k=z.call(T,A);if(typeof k!="object")return k;throw new TypeError("@@toPrimitive must return a primitive value.")}return(A==="string"?String:Number)(T)}class O extends e.Component{static getDerivedStateFromProps(A,z){let{position:k}=A,{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(A){super(A),j(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})}),j(this,"onDrag",(z,k)=>{if(!this.state.dragging)return!1;(0,y.default)("Draggable: onDrag: %j",k);const P=(0,d.createDraggableData)(this,k),H={x:P.x,y:P.y,slackX:0,slackY:0};if(this.props.bounds){const{x:L,y:V}=H;H.x+=this.state.slackX,H.y+=this.state.slackY;const[Z,ue]=(0,d.getBoundPosition)(this,H.x,H.y);H.x=Z,H.y=ue,H.slackX=this.state.slackX+(L-H.x),H.slackY=this.state.slackY+(V-H.y),P.x=H.x,P.y=H.y,P.deltaX=H.x-this.state.x,P.deltaY=H.y-this.state.y}if(this.props.onDrag(z,P)===!1)return!1;this.setState(H)}),j(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 H={dragging:!1,slackX:0,slackY:0};if(!!this.props.position){const{x:L,y:V}=this.props.position;H.x=L,H.y=V}this.setState(H)}),this.state={dragging:!1,dragged:!1,x:A.position?A.position.x:A.defaultPosition.x,y:A.position?A.position.y:A.defaultPosition.y,prevPropsPosition:{...A.position},slackX:0,slackY:0,isElementSVG:!1},A.position&&!(A.onDrag||A.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 A,z;return((z=(A=this.props)==null?void 0:A.nodeRef)==null?void 0:z.current)??s.default.findDOMNode(this)}render(){const{axis:A,bounds:z,children:k,defaultPosition:P,defaultClassName:H,defaultClassNameDragging:B,defaultClassNameDragged:L,position:V,positionOffset:Z,scale:ue,...ae}=this.props;let J={},le=null;const Y=!!!V||this.state.dragging,$=V||P,ee={x:(0,d.canDragX)(this)&&Y?this.state.x:$.x,y:(0,d.canDragY)(this)&&Y?this.state.y:$.y};this.state.isElementSVG?le=(0,o.createSVGTransform)(ee,Z):J=(0,o.createCSSTransform)(ee,Z);const _e=(0,i.clsx)(k.props.className||"",H,{[B]:this.state.dragging,[L]:this.state.dragged});return e.createElement(m.default,_({},ae,{onStart:this.onDragStart,onDrag:this.onDrag,onStop:this.onDragStop}),e.cloneElement(e.Children.only(k),{className:_e,style:{...k.props.style,...J},transform:le}))}}t.default=O,j(O,"displayName","Draggable"),j(O,"propTypes",{...m.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}),j(O,"defaultProps",{...m.default.defaultProps,axis:"both",bounds:!1,defaultClassName:"react-draggable",defaultClassNameDragging:"react-draggable-dragging",defaultClassNameDragged:"react-draggable-dragged",defaultPosition:{x:0,y:0},scale:1})})(lx)),lx}var t5;function wv(){if(t5)return Zp.exports;t5=1;const{default:t,DraggableCore:e}=vA();return Zp.exports=t,Zp.exports.default=t,Zp.exports.DraggableCore=e,Zp.exports}var SA=wv(),Jp={exports:{}},Wp={},W0={},n5;function NA(){if(n5)return W0;n5=1,W0.__esModule=!0,W0.cloneElement=f;var t=e(gl());function e(m){return m&&m.__esModule?m:{default:m}}function n(m,y){var v=Object.keys(m);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(m);y&&(b=b.filter(function(_){return Object.getOwnPropertyDescriptor(m,_).enumerable})),v.push.apply(v,b)}return v}function s(m){for(var y=1;y<arguments.length;y++){var v=arguments[y]!=null?arguments[y]:{};y%2?n(Object(v),!0).forEach(function(b){i(m,b,v[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(m,Object.getOwnPropertyDescriptors(v)):n(Object(v)).forEach(function(b){Object.defineProperty(m,b,Object.getOwnPropertyDescriptor(v,b))})}return m}function i(m,y,v){return(y=o(y))in m?Object.defineProperty(m,y,{value:v,enumerable:!0,configurable:!0,writable:!0}):m[y]=v,m}function o(m){var y=d(m,"string");return typeof y=="symbol"?y:y+""}function d(m,y){if(typeof m!="object"||!m)return m;var v=m[Symbol.toPrimitive];if(v!==void 0){var b=v.call(m,y);if(typeof b!="object")return b;throw new TypeError("@@toPrimitive must return a primitive value.")}return(y==="string"?String:Number)(m)}function f(m,y){return y.style&&m.props.style&&(y.style=s(s({},m.props.style),y.style)),y.className&&m.props.className&&(y.className=`${m.props.className} ${y.className}`),t.default.cloneElement(m,y)}return W0}var $p={},a5;function d8(){if(a5)return $p;a5=1,$p.__esModule=!0,$p.resizableProps=void 0;var t=e(J1());wv();function e(n){return n&&n.__esModule?n:{default:n}}return $p.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)}},$p}var s5;function f8(){if(s5)return Wp;s5=1,Wp.__esModule=!0,Wp.default=void 0;var t=o(gl()),e=wv(),n=NA(),s=d8();const i=["children","className","draggableOpts","width","height","handle","handleSize","lockAspectRatio","axis","minConstraints","maxConstraints","onResize","onResizeStop","onResizeStart","resizeHandles","transformScale"];function o(R,O){if(typeof WeakMap=="function")var T=new WeakMap,A=new WeakMap;return(o=function(z,k){if(!k&&z&&z.__esModule)return z;var P,H,B={__proto__:null,default:z};if(z===null||typeof z!="object"&&typeof z!="function")return B;if(P=k?A:T){if(P.has(z))return P.get(z);P.set(z,B)}for(const L in z)L!=="default"&&{}.hasOwnProperty.call(z,L)&&((H=(P=Object.defineProperty)&&Object.getOwnPropertyDescriptor(z,L))&&(H.get||H.set)?P(B,L,H):B[L]=z[L]);return B})(R,O)}function d(){return d=Object.assign?Object.assign.bind():function(R){for(var O=1;O<arguments.length;O++){var T=arguments[O];for(var A in T)({}).hasOwnProperty.call(T,A)&&(R[A]=T[A])}return R},d.apply(null,arguments)}function f(R,O){if(R==null)return{};var T,A,z=m(R,O);if(Object.getOwnPropertySymbols){var k=Object.getOwnPropertySymbols(R);for(A=0;A<k.length;A++)T=k[A],O.indexOf(T)===-1&&{}.propertyIsEnumerable.call(R,T)&&(z[T]=R[T])}return z}function m(R,O){if(R==null)return{};var T={};for(var A in R)if({}.hasOwnProperty.call(R,A)){if(O.indexOf(A)!==-1)continue;T[A]=R[A]}return T}function y(R,O){var T=Object.keys(R);if(Object.getOwnPropertySymbols){var A=Object.getOwnPropertySymbols(R);O&&(A=A.filter(function(z){return Object.getOwnPropertyDescriptor(R,z).enumerable})),T.push.apply(T,A)}return T}function v(R){for(var O=1;O<arguments.length;O++){var T=arguments[O]!=null?arguments[O]:{};O%2?y(Object(T),!0).forEach(function(A){b(R,A,T[A])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(T)):y(Object(T)).forEach(function(A){Object.defineProperty(R,A,Object.getOwnPropertyDescriptor(T,A))})}return R}function b(R,O,T){return(O=_(O))in R?Object.defineProperty(R,O,{value:T,enumerable:!0,configurable:!0,writable:!0}):R[O]=T,R}function _(R){var O=j(R,"string");return typeof O=="symbol"?O:O+""}function j(R,O){if(typeof R!="object"||!R)return R;var T=R[Symbol.toPrimitive];if(T!==void 0){var A=T.call(R,O);if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}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(O,T){const{minConstraints:A,maxConstraints:z,lockAspectRatio:k}=this.props;if(!A&&!z&&!k)return[O,T];if(k){const V=this.props.width/this.props.height,Z=O-this.props.width,ue=T-this.props.height;Math.abs(Z)>Math.abs(ue*V)?T=O/V:O=T*V}const[P,H]=[O,T];let[B,L]=this.slack||[0,0];return O+=B,T+=L,A&&(O=Math.max(A[0],O),T=Math.max(A[1],T)),z&&(O=Math.min(z[0],O),T=Math.min(z[1],T)),this.slack=[B+(P-O),L+(H-T)],[O,T]}resizeHandler(O,T){return(A,z)=>{var $;let{node:k,deltaX:P,deltaY:H}=z;O==="onResizeStart"&&this.resetData();const B=(this.props.axis==="both"||this.props.axis==="x")&&T!=="n"&&T!=="s",L=(this.props.axis==="both"||this.props.axis==="y")&&T!=="e"&&T!=="w";if(!B&&!L)return;const V=T[0],Z=T[T.length-1],ue=k.getBoundingClientRect();if(this.lastHandleRect!=null){if(Z==="w"){const ee=ue.left-this.lastHandleRect.left;P+=ee}if(V==="n"){const ee=ue.top-this.lastHandleRect.top;H+=ee}}this.lastHandleRect=ue,Z==="w"&&(P=-P),V==="n"&&(H=-H);let ae=this.props.width+(B?P/this.props.transformScale:0),J=this.props.height+(L?H/this.props.transformScale:0);[ae,J]=this.runConstraints(ae,J),O==="onResizeStop"&&this.lastSize&&({width:ae,height:J}=this.lastSize);const le=ae!==this.props.width||J!==this.props.height;O!=="onResizeStop"&&(this.lastSize={width:ae,height:J});const ce=typeof this.props[O]=="function"?this.props[O]:null;ce&&!(O==="onResize"&&!le)&&(($=A.persist)==null||$.call(A),ce(A,{node:k,size:{width:ae,height:J},handle:T})),O==="onResizeStop"&&this.resetData()}}renderResizeHandle(O,T){const{handle:A}=this.props;if(!A)return t.createElement("span",{className:`react-resizable-handle react-resizable-handle-${O}`,ref:T});if(typeof A=="function")return A(O,T);const z=typeof A.type=="string",k=v({ref:T},z?{}:{handleAxis:O});return t.cloneElement(A,k)}render(){const O=this.props,{children:T,className:A,draggableOpts:z,width:k,height:P,handle:H,handleSize:B,lockAspectRatio:L,axis:V,minConstraints:Z,maxConstraints:ue,onResize:ae,onResizeStop:J,onResizeStart:le,resizeHandles:ce,transformScale:Y}=O,$=f(O,i);return(0,n.cloneElement)(T,v(v({},$),{},{className:`${A?`${A} `:""}react-resizable`,children:[...t.Children.toArray(T.props.children),...ce.map(ee=>{const _e=this.handleRefs[ee]??(this.handleRefs[ee]=t.createRef());return t.createElement(e.DraggableCore,d({},z,{nodeRef:_e,key:`resizableHandle-${ee}`,onStop:this.resizeHandler("onResizeStop",ee),onStart:this.resizeHandler("onResizeStart",ee),onDrag:this.resizeHandler("onResize",ee)}),this.renderResizeHandle(ee,_e))})]}))}};return Wp.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},Wp}var em={},r5;function _A(){if(r5)return em;r5=1,em.__esModule=!0,em.default=void 0;var t=d(gl()),e=o(J1()),n=o(f8()),s=d8();const i=["handle","handleSize","onResize","onResizeStart","onResizeStop","draggableOpts","minConstraints","maxConstraints","lockAspectRatio","axis","width","height","resizeHandles","style","transformScale"];function o(O){return O&&O.__esModule?O:{default:O}}function d(O,T){if(typeof WeakMap=="function")var A=new WeakMap,z=new WeakMap;return(d=function(k,P){if(!P&&k&&k.__esModule)return k;var H,B,L={__proto__:null,default:k};if(k===null||typeof k!="object"&&typeof k!="function")return L;if(H=P?z:A){if(H.has(k))return H.get(k);H.set(k,L)}for(const V in k)V!=="default"&&{}.hasOwnProperty.call(k,V)&&((B=(H=Object.defineProperty)&&Object.getOwnPropertyDescriptor(k,V))&&(B.get||B.set)?H(L,V,B):L[V]=k[V]);return L})(O,T)}function f(){return f=Object.assign?Object.assign.bind():function(O){for(var T=1;T<arguments.length;T++){var A=arguments[T];for(var z in A)({}).hasOwnProperty.call(A,z)&&(O[z]=A[z])}return O},f.apply(null,arguments)}function m(O,T){var A=Object.keys(O);if(Object.getOwnPropertySymbols){var z=Object.getOwnPropertySymbols(O);T&&(z=z.filter(function(k){return Object.getOwnPropertyDescriptor(O,k).enumerable})),A.push.apply(A,z)}return A}function y(O){for(var T=1;T<arguments.length;T++){var A=arguments[T]!=null?arguments[T]:{};T%2?m(Object(A),!0).forEach(function(z){v(O,z,A[z])}):Object.getOwnPropertyDescriptors?Object.defineProperties(O,Object.getOwnPropertyDescriptors(A)):m(Object(A)).forEach(function(z){Object.defineProperty(O,z,Object.getOwnPropertyDescriptor(A,z))})}return O}function v(O,T,A){return(T=b(T))in O?Object.defineProperty(O,T,{value:A,enumerable:!0,configurable:!0,writable:!0}):O[T]=A,O}function b(O){var T=_(O,"string");return typeof T=="symbol"?T:T+""}function _(O,T){if(typeof O!="object"||!O)return O;var A=O[Symbol.toPrimitive];if(A!==void 0){var z=A.call(O,T);if(typeof z!="object")return z;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(O)}function j(O,T){if(O==null)return{};var A,z,k=w(O,T);if(Object.getOwnPropertySymbols){var P=Object.getOwnPropertySymbols(O);for(z=0;z<P.length;z++)A=P[z],T.indexOf(A)===-1&&{}.propertyIsEnumerable.call(O,A)&&(k[A]=O[A])}return k}function w(O,T){if(O==null)return{};var A={};for(var z in O)if({}.hasOwnProperty.call(O,z)){if(T.indexOf(z)!==-1)continue;A[z]=O[z]}return A}let R=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=(T,A)=>{var k;const{size:z}=A;this.props.onResize?((k=T.persist)==null||k.call(T),this.setState(z,()=>this.props.onResize&&this.props.onResize(T,A))):this.setState(z)}}static getDerivedStateFromProps(T,A){return A.propsWidth!==T.width||A.propsHeight!==T.height?{width:T.width,height:T.height,propsWidth:T.width,propsHeight:T.height}:null}render(){const T=this.props,{handle:A,handleSize:z,onResize:k,onResizeStart:P,onResizeStop:H,draggableOpts:B,minConstraints:L,maxConstraints:V,lockAspectRatio:Z,axis:ue,width:ae,height:J,resizeHandles:le,style:ce,transformScale:Y}=T,$=j(T,i);return t.createElement(n.default,{axis:ue,draggableOpts:B,handle:A,handleSize:z,height:this.state.height,lockAspectRatio:Z,maxConstraints:V,minConstraints:L,onResizeStart:P,onResize:this.onResize,onResizeStop:H,resizeHandles:le,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 em.default=R,R.propTypes=y(y({},s.resizableProps),{},{children:e.default.element}),em}var i5;function CA(){return i5||(i5=1,Jp.exports=function(){throw new Error("Don't instantiate Resizable directly! Use require('react-resizable').Resizable")},Jp.exports.Resizable=f8().default,Jp.exports.ResizableBox=_A().default),Jp.exports}var jA=CA();function l5(t){const{children:e,cols:n,containerWidth:s,margin:i,containerPadding:o,rowHeight:d,maxRows:f,isDraggable:m,isResizable:y,isBounded:v,static:b,useCSSTransforms:_=!0,usePercentages:j=!1,transformScale:w=1,positionStrategy:R,dragThreshold:O=0,droppingPosition:T,className:A="",style:z,handle:k="",cancel:P="",x:H,y:B,w:L,h:V,minW:Z=1,maxW:ue=1/0,minH:ae=1,maxH:J=1/0,i:le,resizeHandles:ce,resizeHandle:Y,constraints:$=K6,layoutItem:ee,layout:_e=[],onDragStart:ge,onDrag:G,onDragStop:W,onResizeStart:he,onResize:re,onResizeStop:Se}=t,[je,De]=D.useState(!1),[nt,ze]=D.useState(!1),Vt=D.useRef(null),$e=D.useRef({left:0,top:0}),At=D.useRef({top:0,left:0,width:0,height:0}),qt=D.useRef(void 0),wn=D.useRef(_e);wn.current=_e;const Qn=D.useRef(null),Gt=D.useRef(null),fn=D.useRef(!1),fr=D.useRef({x:0,y:0}),Ft=D.useRef(!1),Et=D.useMemo(()=>({cols:n,containerPadding:o,containerWidth:s,margin:i,maxRows:f,rowHeight:d}),[n,o,s,i,f,d]),Un=D.useMemo(()=>({cols:n,maxRows:f,containerWidth:s,containerHeight:0,rowHeight:d,margin:i,layout:[]}),[n,f,s,d,i]),hn=D.useCallback(()=>({...Un,layout:wn.current}),[Un]),Zt=D.useMemo(()=>ee??{i:le,x:H,y:B,w:L,h:V,minW:Z,maxW:ue,minH:ae,maxH:J},[ee,le,H,B,L,V,Z,ue,ae,J]),Kn=D.useCallback(yt=>{if(R!=null&&R.calcStyle)return R.calcStyle(yt);if(_)return X6(yt);const mt=DO(yt);return j?{...mt,left:H3(yt.left/s),width:H3(yt.width/s)}:mt},[R,_,j,s]),Ns=D.useCallback((yt,{node:mt})=>{if(!ge)return;const{offsetParent:Qt}=mt;if(!Qt)return;const Mt=Qt.getBoundingClientRect(),Hn=mt.getBoundingClientRect(),rn=Hn.left/w,Xn=Mt.left/w,yn=Hn.top/w,Ra=Mt.top/w;let oa;if(R!=null&&R.calcDragPosition){const et=yt;oa=R.calcDragPosition(et.clientX,et.clientY,et.clientX-Hn.left,et.clientY-Hn.top)}else oa={left:rn-Xn+Qt.scrollLeft,top:yn-Ra+Qt.scrollTop};if($e.current=oa,O>0){const et=yt;fr.current={x:et.clientX,y:et.clientY},fn.current=!0,Ft.current=!1,De(!0);return}De(!0);const os=X0(Et,oa.top,oa.left),{x:Gs,y:Ue}=F0($,Zt,os.x,os.y,hn());ge(le,Gs,Ue,{e:yt,node:mt,newPosition:oa})},[ge,w,Et,R,O,$,Zt,hn,le]),hr=D.useCallback((yt,{node:mt,deltaX:Qt,deltaY:Mt})=>{if(!G||!je)return;const Hn=yt;if(fn.current&&!Ft.current){const Gs=Hn.clientX-fr.current.x,Ue=Hn.clientY-fr.current.y;if(Math.hypot(Gs,Ue)<O)return;if(Ft.current=!0,fn.current=!1,ge){const Ve=X0(Et,$e.current.top,$e.current.left),{x:ot,y:xt}=F0($,Zt,Ve.x,Ve.y,hn());ge(le,ot,xt,{e:yt,node:mt,newPosition:$e.current})}}let rn=$e.current.top+Mt,Xn=$e.current.left+Qt;if(v){const{offsetParent:Gs}=mt;if(Gs){const Ue=Gs.clientHeight-th(V,d,i[1]);rn=O1(rn,0,Ue);const et=dh(Et),Ve=s-th(L,et,i[0]);Xn=O1(Xn,0,Ve)}}const yn={top:rn,left:Xn};$e.current=yn;const Ra=X0(Et,rn,Xn),{x:oa,y:os}=F0($,Zt,Ra.x,Ra.y,hn());G(le,oa,os,{e:yt,node:mt,newPosition:yn})},[G,ge,je,O,v,V,d,i,Et,s,L,le,$,Zt,hn]),Qa=D.useCallback((yt,{node:mt})=>{if(!W||!je)return;const Qt=fn.current;if(fn.current=!1,Ft.current=!1,fr.current={x:0,y:0},Qt){De(!1),$e.current={left:0,top:0};return}const{left:Mt,top:Hn}=$e.current,rn={top:Hn,left:Mt};De(!1),$e.current={left:0,top:0};const Xn=X0(Et,Hn,Mt),{x:yn,y:Ra}=F0($,Zt,Xn.x,Xn.y,hn());W(le,yn,Ra,{e:yt,node:mt,newPosition:rn})},[W,je,Et,$,Zt,hn,le]);Qn.current=Ns,Gt.current=hr;const la=D.useCallback((yt,{node:mt,size:Qt,handle:Mt},Hn,rn)=>{const Xn=rn==="onResizeStart"?he:rn==="onResize"?re:Se;if(!Xn)return;let yn;mt?yn=GO(Mt,Hn,Qt,s):yn={...Qt,top:Hn.top,left:Hn.left},At.current=yn;const Ra=wO(Et,yn.width,yn.height),{w:oa,h:os}=MO($,Zt,Ra.w,Ra.h,Mt,hn());Xn(le,oa,os,{e:yt.nativeEvent,node:mt,size:yn,handle:Mt})},[he,re,Se,s,Et,le,$,Zt,hn]),Ea=D.useCallback((yt,mt)=>{ze(!0);const Qt=Fp(Et,H,B,L,V),Mt={...mt,handle:mt.handle};la(yt,Mt,Qt,"onResizeStart")},[la,Et,H,B,L,V]),is=D.useCallback((yt,mt)=>{const Qt=Fp(Et,H,B,L,V),Mt={...mt,handle:mt.handle};la(yt,Mt,Qt,"onResize")},[la,Et,H,B,L,V]),pr=D.useCallback((yt,mt)=>{ze(!1),At.current={top:0,left:0,width:0,height:0};const Qt=Fp(Et,H,B,L,V),Mt={...mt,handle:mt.handle};la(yt,Mt,Qt,"onResizeStop")},[la,Et,H,B,L,V]);D.useEffect(()=>{var Mt,Hn;if(!T)return;const yt=Vt.current;if(!yt)return;const mt=qt.current||{left:0,top:0},Qt=je&&(T.left!==mt.left||T.top!==mt.top);if(je){if(Qt){const rn=T.left-$e.current.left,Xn=T.top-$e.current.top,yn={node:yt,deltaX:rn,deltaY:Xn,lastX:$e.current.left,lastY:$e.current.top,x:T.left,y:T.top};(Hn=Gt.current)==null||Hn.call(Gt,T.e,yn)}}else{const rn={node:yt,deltaX:T.left,deltaY:T.top,lastX:0,lastY:0,x:T.left,y:T.top};(Mt=Qn.current)==null||Mt.call(Qn,T.e,rn)}qt.current=T},[T,je,le]);const _s=Fp(Et,H,B,L,V,je?$e.current:null,nt?At.current:null),Bs=$t.Children.only(e),ea=Fp(Et,0,0,1,1),ls=[ea.width,ea.height],ba=[1/0,1/0],Ta=Bs.props,Pu=Ta.className,Nl=Ta.style;let Cs=$t.cloneElement(Bs,{ref:Vt,className:Fm("react-grid-item",Pu,A,{static:b,resizing:nt,"react-draggable":m,"react-draggable-dragging":je,dropping:!!T,cssTransforms:_}),style:{...z,...Nl,...Kn(_s)}});const mr=Y;return Cs=h.jsx(jA.Resizable,{draggableOpts:{disabled:!y},className:y?void 0:"react-resizable-hide",width:_s.width,height:_s.height,minConstraints:ls,maxConstraints:ba,onResizeStart:Ea,onResize:is,onResizeStop:pr,transformScale:w,resizeHandles:ce,handle:mr,children:Cs}),Cs=h.jsx(SA.DraggableCore,{disabled:!m,onStart:Ns,onDrag:hr,onStop:Qa,handle:k,cancel:".react-resizable-handle"+(P?","+P:""),scale:w,nodeRef:Vt,children:Cs}),Cs}var eo=()=>{},o5="react-grid-layout",h8=!1;try{h8=/firefox/i.test(navigator.userAgent)}catch{}function wA(t,e){const n=$t.Children.toArray(t),s=$t.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 u5(t,e,n,s){const i=[],o=new Set;$t.Children.forEach(e,f=>{if(!$t.isValidElement(f)||f.key===null)return;const m=String(f.key);o.add(m);const y=t.find(v=>v.i===m);if(y)i.push($c(y));else{const b=f.props["data-grid"];b?i.push({i:m,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:m,x:0,y:K1(i),w:1,h:1})}});const d=xv(i,{cols:n});return s.compact(d,n)}function EA(t){const{children:e,width:n,gridConfig:s,dragConfig:i,resizeConfig:o,dropConfig:d,positionStrategy:f=YO,compactor:m,constraints:y=K6,layout:v=[],droppingItem:b,autoSize:_=!0,className:j="",style:w={},innerRef:R,onLayoutChange:O=eo,onDragStart:T=eo,onDrag:A=eo,onDragStop:z=eo,onResizeStart:k=eo,onResize:P=eo,onResizeStop:H=eo,onDrop:B=eo,onDropDragOver:L=eo}=t,V=D.useMemo(()=>({...VO,...s}),[s]),Z=D.useMemo(()=>({...QO,...i}),[i]),ue=D.useMemo(()=>({...KO,...o}),[o]),ae=D.useMemo(()=>({...XO,...d}),[d]),{cols:J,rowHeight:le,maxRows:ce,margin:Y,containerPadding:$}=V,{enabled:ee,bounded:_e,handle:ge,cancel:G,threshold:W}=Z,{enabled:he,handles:re,handleComponent:Se}=ue,{enabled:je,defaultItem:De,onDragOver:nt}=ae,ze=m??Cv("vertical"),Vt=ze.type,$e=ze.allowOverlap,At=ze.preventCollision??!1,qt=D.useMemo(()=>b??{i:"__dropping-elem__",...De},[b,De]),wn=f.type==="transform",Qn=f.scale,Gt=$??Y,[fn,fr]=D.useState(!1),[Ft,Et]=D.useState(()=>u5(v,e,J,ze)),[Un,hn]=D.useState(null),[Zt,Kn]=D.useState(!1),[Ns,hr]=D.useState(null),[Qa,la]=D.useState(),Ea=D.useRef(null),is=D.useRef(null),pr=D.useRef(null),_s=D.useRef(0),Bs=D.useRef(Ft),ea=D.useRef(v),ls=D.useRef(e),ba=D.useRef(Vt),Ta=D.useRef(Ft);Ta.current=Ft,D.useEffect(()=>{fr(!0),ro(Ft,v)||O(Ft)},[]),D.useEffect(()=>{if(Un||Ns)return;const Ue=!ro(v,ea.current),et=!wA(e,ls.current),Ve=Vt!==ba.current;if(Ue||et||Ve){const xt=u5(Ue?v:Ft,e,J,ze);ro(xt,Ft)||Et(xt)}ea.current=v,ls.current=e,ba.current=Vt},[v,e,J,Vt,ze,Un,Ns,Ft]),D.useEffect(()=>{if(!Un&&!ro(Ft,Bs.current)){Bs.current=Ft;const Ue=Ft.filter(et=>et.i!==qt.i);O(Ue)}},[Ft,Un,O,qt.i]);const Pu=D.useMemo(()=>{if(!_)return;const Ue=K1(Ft),et=Gt[1];return Ue*le+(Ue-1)*Y[1]+et*2+"px"},[_,Ft,le,Y,Gt]),Nl=D.useCallback((Ue,et,Ve,ot)=>{const xt=Ta.current,Fe=Lc(xt,Ue);if(!Fe)return;const ut={w:Fe.w,h:Fe.h,x:Fe.x,y:Fe.y,i:Ue};Ea.current=$c(Fe),pr.current=xt,hn(ut),T(xt,Fe,Fe,null,ot.e,ot.node)},[T]),Cs=D.useCallback((Ue,et,Ve,ot)=>{const xt=Ta.current,Fe=Ea.current,ut=Lc(xt,Ue);if(!ut)return;const sn={w:ut.w,h:ut.h,x:ut.x,y:ut.y,i:Ue},Tt=Uc(xt,ut,et,Ve,!0,At,Vt,J,$e);A(Tt,Fe,ut,sn,ot.e,ot.node),Et(ze.compact(Tt,J)),hn(sn)},[At,Vt,J,$e,ze,A]),mr=D.useCallback((Ue,et,Ve,ot)=>{if(!Un)return;const xt=Ta.current,Fe=Ea.current,ut=Lc(xt,Ue);if(!ut)return;const sn=Uc(xt,ut,et,Ve,!0,At,Vt,J,$e),Tt=ze.compact(sn,J);z(Tt,Fe,ut,null,ot.e,ot.node);const pn=pr.current;Ea.current=null,pr.current=null,hn(null),Et(Tt),pn&&!ro(pn,Tt)&&O(Tt)},[Un,At,Vt,J,$e,ze,z,O]),yt=D.useCallback((Ue,et,Ve,ot)=>{const xt=Ta.current,Fe=Lc(xt,Ue);Fe&&(is.current=$c(Fe),pr.current=xt,Kn(!0),k(xt,Fe,Fe,null,ot.e,ot.node))},[k]),mt=D.useCallback((Ue,et,Ve,ot)=>{const xt=Ta.current,Fe=is.current,{handle:ut}=ot;let sn=!1,Tt,pn;const[Ar,us]=RO(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),At&&!$e&&V6(xt,{...Pt,w:et,h:Ve,x:Tt??Pt.x,y:pn??Pt.y}).filter(yr=>yr.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(!us)return;let Ka=Ar;sn&&Tt!==void 0&&pn!==void 0&&(Ka=Uc(Ar,us,Tt,pn,!0,At,Vt,J,$e));const Ps={w:us.w,h:us.h,x:us.x,y:us.y,i:Ue,static:!0};P(Ka,Fe,us,Ps,ot.e,ot.node),Et(ze.compact(Ka,J)),hn(Ps)},[At,Vt,J,$e,ze,P]),Qt=D.useCallback((Ue,et,Ve,ot)=>{const xt=Ta.current,Fe=is.current,ut=Lc(xt,Ue),sn=ze.compact(xt,J);H(sn,Fe,ut??null,null,ot.e,ot.node);const Tt=pr.current;is.current=null,pr.current=null,hn(null),Kn(!1),Et(sn),Tt&&!ro(Tt,sn)&&O(sn)},[J,ze,H,O]),Mt=D.useCallback(()=>{const Ue=Ta.current;if(!Ue.some(ot=>ot.i===qt.i)){hr(null),hn(null),la(void 0);return}const Ve=ze.compact(Ue.filter(ot=>ot.i!==qt.i),J);Et(Ve),hr(null),hn(null),la(void 0)},[qt.i,J,ze]),Hn=D.useCallback(Ue=>{var En;if(Ue.preventDefault(),Ue.stopPropagation(),h8&&!((En=Ue.nativeEvent.target)!=null&&En.classList.contains(o5)))return!1;const et=nt?nt(Ue.nativeEvent):L(Ue);if(et===!1)return Ns&&Mt(),!1;const{dragOffsetX:Ve=0,dragOffsetY:ot=0,...xt}=et??{},Fe={...qt,...xt},ut=Ue.currentTarget.getBoundingClientRect(),sn={cols:J,margin:Y,maxRows:ce,rowHeight:le,containerWidth:n,containerPadding:Gt},Tt=dh(sn),pn=th(Fe.w,Tt,Y[0]),Ar=th(Fe.h,le,Y[1]),us=pn/2,Ka=Ar/2,Ps=Ue.clientX-ut.left+Ve-us,Pt=Ue.clientY-ut.top+ot-Ka,gr=Math.max(0,Ps),yr=Math.max(0,Pt),js={left:gr/Qn,top:yr/Qn,e:Ue.nativeEvent};if(Ns)Qa&&(Qa.left!==js.left||Qa.top!==js.top)&&la(js);else{const ws=jO(sn,yr,gr,Fe.w,Fe.h);hr(h.jsx("div",{},Fe.i)),la(js),Et([...Ta.current,{...Fe,x:ws.x,y:ws.y,static:!1,isDraggable:!0}])}},[Ns,Qa,qt,nt,L,Mt,Qn,J,Y,ce,le,n,Gt]),rn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),_s.current--,_s.current<0&&(_s.current=0),_s.current===0&&Mt()},[Mt]),Xn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation(),_s.current++},[]),yn=D.useCallback(Ue=>{Ue.preventDefault(),Ue.stopPropagation();const et=Ta.current,Ve=et.find(ot=>ot.i===qt.i);_s.current=0,Mt(),B(et,Ve,Ue.nativeEvent)},[qt.i,Mt,B]),Ra=D.useCallback((Ue,et)=>{if(!Ue||!Ue.key)return null;const Ve=Lc(Ft,String(Ue.key));if(!Ve)return null;const ot=typeof Ve.isDraggable=="boolean"?Ve.isDraggable:!Ve.static&&ee,xt=typeof Ve.isResizable=="boolean"?Ve.isResizable:!Ve.static&&he,Fe=Ve.resizeHandles||[...re],ut=ot&&_e&&Ve.isBounded!==!1,sn=Se;return h.jsx(l5,{containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:le,cancel:G,handle:ge,onDragStart:Nl,onDrag:Cs,onDragStop:mr,onResizeStart:yt,onResize:mt,onResizeStop:Qt,isDraggable:ot,isResizable:xt,isBounded:ut,useCSSTransforms:wn&&fn,usePercentages:!fn,transformScale:Qn,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:Ft,children:Ue},Ve.i)},[Ft,n,J,Y,Gt,ce,le,G,ge,Nl,Cs,mr,yt,mt,Qt,ee,he,_e,wn,fn,Qn,f,W,Qa,re,Se,y]),oa=()=>Un?h.jsx(l5,{w:Un.w,h:Un.h,x:Un.x,y:Un.y,i:Un.i,className:`react-grid-placeholder ${Zt?"placeholder-resizing":""}`,containerWidth:n,cols:J,margin:Y,containerPadding:Gt,maxRows:ce,rowHeight:le,isDraggable:!1,isResizable:!1,isBounded:!1,useCSSTransforms:wn,transformScale:Qn,constraints:y,layout:Ft,children:h.jsx("div",{})}):null,os=Fm(o5,j),Gs={height:Pu,...w};return h.jsxs("div",{ref:R,className:os,style:Gs,onDrop:je?yn:void 0,onDragLeave:je?rn:void 0,onDragEnter:je?Xn:void 0,onDragOver:je?Hn:void 0,children:[$t.Children.map(e,Ue=>$t.isValidElement(Ue)?Ra(Ue):null),je&&Ns&&Ra(Ns,!0),oa()]})}var TA={lg:1200,md:996,sm:768,xs:480,xxs:0},RA={lg:12,md:10,sm:6,xs:4,xxs:2},dx=()=>{};function OA(t,e,n,s){const i=[];$t.Children.forEach(e,d=>{if(!$t.isValidElement(d)||d.key===null)return;const f=String(d.key),m=t.find(y=>y.i===f);if(m)i.push({...m,i:f});else{const v=d.props["data-grid"];v?i.push({i:f,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:f,x:0,y:K1(i),w:1,h:1})}});const o=xv(i,{cols:n});return s.compact(o,n)}function AA(t){const{children:e,width:n,breakpoint:s,breakpoints:i=TA,cols:o=RA,layouts:d={},rowHeight:f=150,maxRows:m=1/0,margin:y=[10,10],containerPadding:v=null,compactor:b,onBreakpointChange:_=dx,onLayoutChange:j=dx,onWidthChange:w=dx,...R}=t,O=b??Cv("vertical"),T=O.type,A=O.allowOverlap,z=D.useMemo(()=>s??q3(i,n),[]),k=D.useMemo(()=>B3(z,o),[z,o]),P=D.useMemo(()=>ix(d,i,z,z,k,T),[]),[H,B]=D.useState(z),[L,V]=D.useState(k),[Z,ue]=D.useState(P),[ae,J]=D.useState(d),le=D.useRef(n),ce=D.useRef(s),Y=D.useRef(i),$=D.useRef(o),ee=D.useRef(d),_e=D.useRef(T),ge=D.useRef(ae);D.useEffect(()=>{ge.current=ae},[ae]);const G=D.useMemo(()=>ro(d,ee.current)?null:ix(d,i,H,H,L,O),[d,i,H,L,O]),W=G??Z;D.useEffect(()=>{G!==null&&(ue(G),J(d),ge.current=d,ee.current=d)},[G,d]),D.useEffect(()=>{if(T!==_e.current){const De=O.compact(zu(W),L),nt={...ge.current,[H]:De};ue(De),J(nt),ge.current=nt,j(De,nt),_e.current=T}},[T,O,W,L,A,H,j]),D.useEffect(()=>{const De=n!==le.current,nt=s!==ce.current,ze=!ro(i,Y.current),Vt=!ro(o,$.current);if(De||nt||ze||Vt){const $e=s??q3(i,n),At=B3($e,o),qt=H;if(qt!==$e||ze||Vt){const Gt={...ge.current};Gt[qt]||(Gt[qt]=zu(Z));let fn=ix(Gt,i,$e,qt,At,O);fn=OA(fn,e,At,O),Gt[$e]=fn,B($e),V(At),ue(fn),J(Gt),ge.current=Gt,_($e,At),j(fn,Gt)}const wn=Z0(y,$e),Qn=v?Z0(v,$e):null;w(n,wn,At,Qn),le.current=n,ce.current=s,Y.current=i,$.current=o}},[n,s,i,o,H,L,Z,e,O,T,A,y,v,_,j,w]);const he=D.useCallback(De=>{const ze={...ge.current,[H]:De};ue(De),J(ze),ge.current=ze,j(De,ze)},[H,j]),re=D.useMemo(()=>Z0(y,H),[y,H]),Se=D.useMemo(()=>v===null?null:Z0(v,H),[v,H]),je=D.useMemo(()=>({cols:L,rowHeight:f,maxRows:m,margin:re,containerPadding:Se}),[L,f,m,re,Se]);return h.jsx(EA,{...R,width:n,gridConfig:je,compactor:O,onLayoutChange:he,layout:W,children:e})}function MA({block:t,config:e,size:n,onRemove:s,onConfigChange:i}){const[o,d]=D.useState(!1),f=t.component,m=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(hT,{className:"h-3 w-3 text-foreground-subtle/30 group-hover:text-foreground-subtle transition-colors mr-1"}),h.jsx(m,{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(Jm,{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(mo,{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 v;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:b=>i({...e,[y.key]:Number(b.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:b=>i({...e,[y.key]:b.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:b=>i({...e,[y.key]:b.target.checked}),className:"accent-primary"}),y.type==="select"&&h.jsx("select",{value:e[y.key]??y.defaultValue??"",onChange:b=>i({...e,[y.key]:b.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:(v=y.options)==null?void 0:v.map(b=>h.jsx("option",{value:b.value,children:b.label},b.value))})]},y.key)})}),h.jsx("div",{className:"flex-1 overflow-auto p-3",children:h.jsx(f,{config:e,size:n})})]})}function DA({open:t,onClose:e,onSelect:n}){if(!t)return null;const s=yO();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(mo,{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 zA=AA,p8="camstack-dashboard-state",kA={lg:1200,md:996,sm:768,xs:0},LA={lg:12,md:8,sm:4,xs:2};function UA(){try{const t=localStorage.getItem(p8);if(t)return JSON.parse(t)}catch{}return{items:[]}}function HA(t){localStorage.setItem(p8,JSON.stringify(t))}let c5=0;function qA(){const[t,e]=D.useState(UA),[n,s]=D.useState(!1),i=D.useCallback(v=>{e(v),HA(v)},[]),o=D.useCallback(v=>{var w;c5++;const b=`${v.id}-${c5}`,_={};(w=v.configSchema)==null||w.forEach(R=>{R.defaultValue!==void 0&&(_[R.key]=R.defaultValue)});const j={i:b,blockId:v.id,x:0,y:1/0,w:v.defaultSize.w,h:v.defaultSize.h,config:_};i({items:[...t.items,j]})},[t,i]),d=D.useCallback(v=>{i({items:t.items.filter(b=>b.i!==v)})},[t,i]),f=D.useCallback((v,b)=>{i({items:t.items.map(_=>_.i===v?{..._,config:b}:_)})},[t,i]),m=D.useCallback(v=>{i({items:t.items.map(b=>{const _=v.find(j=>j.i===b.i);return _?{...b,x:_.x,y:_.y,w:_.w,h:_.h}:b})})},[t,i]),y=t.items.map(v=>{var _,j;const b=L3(v.blockId);return{i:v.i,x:v.x,y:v.y,w:v.w,h:v.h,minW:((_=b==null?void 0:b.minSize)==null?void 0:_.w)??2,minH:((j=b==null?void 0:b.minSize)==null?void 0:j.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(R6,{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(zA,{layouts:{lg:y},breakpoints:kA,cols:LA,rowHeight:60,draggableHandle:".drag-handle",onLayoutChange:m,isResizable:!0,isDraggable:!0,children:t.items.map(v=>{const b=L3(v.blockId);return b?h.jsx("div",{children:h.jsx(MA,{block:b,config:v.config,size:{w:v.w,h:v.h},onRemove:()=>d(v.i),onConfigChange:_=>f(v.i,_)})},v.i):h.jsx("div",{},v.i)})}),h.jsx(DA,{open:n,onClose:()=>s(!1),onSelect:o})]})}function BA(){return h.jsx(qA,{})}const _b={frigate:{icon:ME,color:"#3b82f6",label:"Frigate"},scrypted:{icon:w1,color:"#a855f7",label:"Scrypted"},reolink:{icon:hv,color:"#06b6d4",label:"Reolink"},homeassistant:{icon:gT,color:"#22d3ee",label:"Home Assistant"},rtsp:{icon:g3,color:"#78716c",label:"RTSP"},onvif:{icon:g3,color:"#78716c",label:"ONVIF"}},GA={sm:"h-4 w-4",md:"h-5 w-5",lg:"h-6 w-6"},PA={sm:"h-7 w-7",md:"h-8 w-8",lg:"h-10 w-10"};function $1({type:t,size:e="md",showLabel:n}){const s=_b[t]??_b.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 ${PA[e]}`,style:{backgroundColor:`${s.color}15`},children:h.jsx(i,{className:GA[e],style:{color:s.color}})}),n&&h.jsx("span",{className:"text-xs font-medium text-foreground-subtle",children:s.label})]})}function m8(t){var e;return((e=_b[t])==null?void 0:e.label)??t}const d5={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 nh({status:t}){const e=d5[t]??d5.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 f5={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 YA({id:t,name:e,status:n,detectionsToday:s,inferenceMs:i}){const o=xl(),d=f5[n]??f5.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(Lu,{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(uv,{className:"h-3 w-3"}),i,"ms"]})]})]})]})}function VA({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($1,{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||m8(t)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle flex-shrink-0",children:[s.length," camera",s.length!==1?"s":""]})]}),h.jsx(nh,{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(YA,{id:i.id,name:i.name,status:i.status,detectionsToday:0,inferenceMs:0},i.id))})]})}function QA(){const{t}=Rr(),e=en(),[n,s]=D.useState(""),{data:i,isLoading:o}=pt({queryKey:["devices"],queryFn:()=>e.listDevices(),refetchInterval:5e3}),{data:d,isLoading:f}=pt({queryKey:["providers"],queryFn:()=>e.listProviders()}),m=i??[],y=d??[],v=D.useMemo(()=>{const j=n.toLowerCase();return m.filter(w=>{const R=(w.type??"").toLowerCase(),O=w.capabilities??[];return R==="camera"||R.includes("camera")||O.some(k=>k.toLowerCase().includes("video")||k.toLowerCase().includes("stream"))||!R||R==="—"?j?(w.name??w.id??"").toLowerCase().includes(j):!0:!1})},[m,n]),b=D.useMemo(()=>{const j=new Map;for(const w of v){const R=w.providerId??"";j.has(R)||j.set(R,[]),j.get(R).push(w)}return j},[v]),_=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(pv,{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:j=>s(j.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:[v.length," camera",v.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(j=>h.jsx("div",{className:"aspect-[16/12] rounded-lg border border-border bg-surface animate-pulse"},j))}),!_&&v.length===0&&h.jsxs("div",{className:"flex flex-col items-center py-20 text-foreground-subtle",children:[h.jsx(Lu,{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(b.entries()).map(([j,w])=>{var O;const R=y.find(T=>T.id===j);return h.jsx(VA,{providerType:(R==null?void 0:R.type)??"rtsp",providerName:(R==null?void 0:R.name)??j,providerStatus:(O=R==null?void 0:R.status)!=null&&O.connected?"running":"stopped",devices:w.map(T=>{var A;return{id:T.id,name:T.name??T.id,status:(A=T.state)!=null&&A.online?"online":"offline"}})},j)})]})}function KA({onSelect:t,onClose:e}){const{t:n}=Rr(),s=en(),i=xl(),{data:o,isLoading:d}=pt({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 m=f.instanceMode==="unique"&&f.existingInstances.length>0;return h.jsxs("button",{onClick:()=>{if(m){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})]}),m?h.jsxs("span",{className:"flex items-center gap-1 text-[10px] font-medium text-foreground-subtle",children:[h.jsx(Jm,{className:"h-3 w-3"}),n("integrations.manage")]}):h.jsx(Ic,{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 XA({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 FA(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 ZA(t){return`${t.inputSize.width}x${t.inputSize.height}`}function IA(t){return t.formats?Object.keys(t.formats).filter(e=>t.formats[e]!==void 0):[]}function JA({entry:t,selected:e,onSelect:n,disabled:s}){const i=FA(t),o=ZA(t),d=IA(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(Im,{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(kf,{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 WA({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"}]:[]],[m,y]=D.useState(o?"catalog":"custom"),v=e==null?"":String(e);return h.jsxs("div",{className:"space-y-3",children:[f.length>1&&h.jsx(XA,{tabs:f,active:m,onChange:y}),m==="catalog"&&o&&h.jsx("div",{className:"space-y-1.5 max-h-[320px] overflow-y-auto pr-1",children:i.map(b=>h.jsx(JA,{entry:b,selected:v===b.id,onSelect:()=>n(b.id),disabled:s||t.disabled},b.id))}),m==="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(yb,{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."})]}),m==="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:v,disabled:s||t.disabled,onChange:b=>n(b.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(yb,{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(tT,{className:"h-3 w-3"})]})]})]})}const fh="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",g8="block text-xs font-medium text-foreground mb-1",$A="text-[10px] text-foreground-subtle mt-0.5";function li({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=ed(t,o),m=ed(e,o);return h.jsxs("div",{className:d,children:[f!==void 0&&h.jsxs("label",{className:g8,children:[f,n&&h.jsx("span",{className:"text-danger ml-0.5",children:"*"})]}),i,m&&h.jsx("p",{className:$A,children:m})]})}function eM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("input",{type:t.inputType??"text",className:fh,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 tM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{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:fh,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 nM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=!!e,d=s||t.disabled;return t.style==="checkbox"?h.jsx(li,{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:ed(t.label,i)}),t.required&&h.jsx("span",{className:"text-danger",children:"*"})]})}):h.jsx(li,{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:g8+" mb-0",children:[ed(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 aM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsxs("select",{className:fh,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 sM({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(m=>m!==f));else{if(t.maxItems!==void 0&&o.length>=t.maxItems)return;n([...o,f])}};return h.jsx(li,{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 m=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",m?"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:m,disabled:s||t.disabled,onChange:()=>d(f.value)}),f.label]},f.value)})})})}function rM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(!1),f=t.showToggle!==!1;return h.jsx(li,{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:fh+(f?" pr-9":""),value:e==null?"":String(e),placeholder:t.placeholder,disabled:s||t.disabled,onChange:m=>n(m.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(m=>!m),children:o?h.jsx(E6,{className:"h-3.5 w-3.5"}):h.jsx(ch,{className:"h-3.5 w-3.5"})})]})})}function iM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx("textarea",{className:fh+" 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 lM({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(li,{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 oM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=Array.isArray(e)?e:[],[d,f]=D.useState(""),m=D.useRef(null),y=D.useCallback(j=>{const w=j.trim();!w||o.includes(w)||t.maxTags!==void 0&&o.length>=t.maxTags||(n([...o,w]),f(""))},[o,t.maxTags,n]),v=j=>n(o.filter(w=>w!==j)),b=j=>{j.key==="Enter"||j.key===","?(j.preventDefault(),y(d)):j.key==="Backspace"&&d===""&&o.length>0&&v(o[o.length-1])},_=s||t.disabled;return h.jsx(li,{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 j;return!_&&((j=m.current)==null?void 0:j.focus())},children:[o.map(j=>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:[j,!_&&h.jsx("button",{type:"button",onClick:()=>v(j),className:"hover:text-danger",children:h.jsx(mo,{className:"h-2.5 w-2.5"})})]},j)),h.jsx("input",{ref:m,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:j=>f(j.target.value),onKeyDown:b,onBlur:()=>{d.trim()&&y(d)}}),t.suggestions&&h.jsx("datalist",{id:`tags-suggestions-${t.key}`,children:t.suggestions.map(j=>h.jsx("option",{value:j},j))})]})})}function uM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){const o=e==null?"#000000":String(e);return h.jsxs(li,{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:fh+" 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 cM({field:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",m=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:m,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:ed(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(y8,{field:y,values:e,onChange:n,disabled:s,translationFn:i},y.key))})]})})}function dM({field:t,value:e,onChange:n,disabled:s,translationFn:i}){return h.jsx(li,{label:t.label,description:t.description,required:t.required,span:t.span,translationFn:i,children:h.jsx(WA,{field:t,value:e,onChange:n,disabled:s})})}function fM({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 h5={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 hM({field:t}){const e=t.variant??"info",n=h5[e]??h5.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 y8({field:t,values:e,onChange:n,disabled:s,translationFn:i}){if("showWhen"in t&&t.showWhen){const f=t.showWhen,m=e[f.field];let y=!0;if(f.equals!==void 0?y=m===f.equals:f.notEquals!==void 0?y=m!==f.notEquals:f.in!==void 0?y=f.in.includes(m):f.notIn!==void 0&&(y=!f.notIn.includes(m)),!y)return null}const o=e[t.key],d=f=>n(t.key,f);switch(t.type){case"text":return h.jsx(eM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"number":return h.jsx(tM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"boolean":return h.jsx(nM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"select":return h.jsx(aM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"multiselect":return h.jsx(sM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"password":return h.jsx(rM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"textarea":return h.jsx(iM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"slider":return h.jsx(lM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"tags":return h.jsx(oM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"color":return h.jsx(uM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});case"group":return h.jsx(cM,{field:t,values:e,onChange:n,disabled:s,translationFn:i});case"separator":return h.jsx(fM,{});case"info":return h.jsx(hM,{field:t});case"model-selector":return h.jsx(dM,{field:t,value:o,onChange:d,disabled:s,translationFn:i});default:return null}}function pM(t){return/^[a-zA-Z0-9_]+(\.[a-zA-Z0-9_]+)+$/.test(t)}function ed(t,e){if(t!==void 0)return e&&pM(t)?e(t):t}function mM({section:t,values:e,onChange:n,disabled:s,translationFn:i}){const[o,d]=D.useState(t.defaultCollapsed??!1),f=t.style==="accordion",m=t.columns??2,y=m===1?"grid-cols-1":m===3?"grid-cols-3":m===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(v=>!v):void 0,children:[h.jsxs("div",{children:[h.jsx("h3",{className:"text-xs font-semibold text-foreground-subtle uppercase tracking-wider",children:ed(t.title,i)}),t.description&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5",children:ed(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(v=>h.jsx(y8,{field:v,values:e,onChange:n,disabled:s,translationFn:i},v.key))})]})}function ey({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(mM,{section:d,values:e,onChange:o,disabled:s,translationFn:i},d.id))})}function gM({addonId:t,configSchema:e,onSave:n,onBack:s}){const{t:i}=Rr(),o=en(),[d,f]=D.useState(""),[m,y]=D.useState({}),[v,b]=D.useState(null),_=Yn({mutationFn:()=>o.trpc.providerConfig.testConnection.mutate({type:t,url:String(m.url??""),username:m.username?String(m.username):void 0,password:m.password?String(m.password):void 0}),onSuccess:j=>b(j),onError:j=>b({success:!1,error:String(j)})});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:j=>f(j.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(ey,{schema:e,values:m,onChange:y}),v&&h.jsx("div",{className:`rounded-lg border px-3 py-2 text-xs ${v.success?"border-success/30 bg-success/5 text-success":"border-danger/30 bg-danger/5 text-danger"}`,children:v.success?i("integrations.connectionSuccess"):`${i("integrations.errorPrefix")} ${v.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:m}),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 yM({providerId:t,onImport:e,onSkip:n}){const{t:s}=Rr(),i=en(),[o,d]=D.useState(new Set),{data:f,isLoading:m}=pt({queryKey:["discover-devices",t],queryFn:()=>i.discoverDevices(t)});function y(b){d(_=>{const j=new Set(_);return j.has(b)?j.delete(b):j.add(b),j})}if(m)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 v=f??[];return h.jsxs("div",{className:"space-y-4",children:[h.jsx("p",{className:"text-xs text-foreground-subtle",children:v.length>0?s("integrations.foundDevices",{count:v.length}):s("integrations.noDevicesFound")}),v.length>0&&h.jsx("div",{className:"space-y-1.5 max-h-64 overflow-y-auto",children:v.map(b=>{const _=b.externalId,j=b.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(Im,{className:"h-3 w-3 text-primary-foreground"})}),h.jsx(Lu,{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:j})]},_)})}),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")}),v.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 xM({open:t,onClose:e}){const{t:n}=Rr(),s=en(),i=xl(),o=ga(),[d,f]=D.useState("picker"),[m,y]=D.useState(null),[v,b]=D.useState(null),[_,j]=D.useState("manual"),{data:w}=pt({queryKey:["addon-config-schema",m],queryFn:()=>s.getAddonConfigSchema(m),enabled:m!=null}),R=Yn({mutationFn:L=>s.trpc.providerConfig.addProvider.mutate({id:L.id,type:L.type,name:L.name,...L.config}),onSuccess:()=>o.invalidateQueries({queryKey:["providers"]})}),O=Yn({mutationFn:L=>s.adoptDevice(v,L),onSuccess:()=>o.invalidateQueries({queryKey:["devices"]})});async function T(L,V,Z){if(y(L),j(Z),V==="unique"){const ue=`${L}-${Date.now()}`;try{await R.mutateAsync({id:ue,type:L,name:L,config:{}}),e(),P(),i(`/integrations/${ue}`)}catch{}return}f("config")}async function A(L){if(!m)return;const V=`${m}-${Date.now()}`;try{await R.mutateAsync({id:V,type:m,name:L.name,config:L.config}),b(V),_==="auto"||_==="both"?f("discovery"):k(V)}catch{}}async function z(L){for(const V of L)await O.mutateAsync(V);k()}function k(L){const V=L??v??m;e(),P(),V&&i(`/integrations/${V}`)}function P(){f("picker"),y(null),b(null),j("manual")}function H(){e(),P()}if(!t)return null;const B={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:H}),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:B[d]}),h.jsx("button",{onClick:H,className:"rounded-md p-1 text-foreground-subtle hover:text-foreground hover:bg-surface-hover transition-colors",children:h.jsx(mo,{className:"h-4 w-4"})})]}),h.jsxs("div",{className:"px-5 py-4",children:[d==="picker"&&h.jsx(KA,{onSelect:T,onClose:H}),d==="config"&&m&&h.jsx(gM,{addonId:m,configSchema:w??null,onSave:A,onBack:()=>f("picker")}),d==="discovery"&&v&&h.jsx(yM,{providerId:v,onImport:z,onSkip:k})]})]})]})}const bM=[{id:"all",label:"All",icon:m3},{id:"camera",label:"Camera",icon:Lu},{id:"sensor",label:"Sensor",icon:hv},{id:"light",label:"Light",icon:NT},{id:"switch",label:"Switch",icon:sR},{id:"other",label:"Other",icon:m3}];function fx(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 vM(){const t=en(),e=ga(),n=xl(),[s,i]=D.useState(!1),[o,d]=D.useState(""),[f,m]=D.useState("all"),[y,v]=D.useState("provider"),[b,_]=D.useState(new Set(["__all__"])),{data:j,isLoading:w}=pt({queryKey:["providers"],queryFn:()=>t.listProviders(),refetchInterval:5e3}),{data:R,isLoading:O}=pt({queryKey:["devices"],queryFn:()=>t.listDevices(),refetchInterval:5e3});Yn({mutationFn:Z=>t.startProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})}),Yn({mutationFn:Z=>t.stopProvider(Z),onSuccess:()=>e.invalidateQueries({queryKey:["providers"]})});const T=j??[],A=R??[],z=D.useMemo(()=>{const Z=o.toLowerCase();return A.filter(ue=>!(f!=="all"&&fx(ue)!==f||Z&&!(ue.name??ue.id??"").toLowerCase().includes(Z)))},[A,f,o]),k=D.useMemo(()=>{var ue;const Z=new Map;for(const ae of z){let J;switch(y){case"provider":J=ae.providerId??"unknown";break;case"type":J=fx(ae);break;case"status":J=(ue=ae.state)!=null&&ue.online?"online":"offline";break}Z.has(J)||Z.set(J,[]),Z.get(J).push(ae)}return Z},[z,y]);function P(Z){_(ue=>{const ae=new Set(ue);return ae.has(Z)?ae.delete(Z):ae.add(Z),ae})}function H(Z){if(y==="provider"){const ue=T.find(ae=>ae.id===Z);return ue?ue.name??Z:Z}return Z.charAt(0).toUpperCase()+Z.slice(1)}function B(Z){if(y==="provider"){const ue=T.find(ae=>ae.id===Z);return(ue==null?void 0:ue.type)??"rtsp"}return"rtsp"}function L(Z){var ue;if(y==="provider"){const ae=T.find(J=>J.id===Z);return(ue=ae==null?void 0:ae.status)!=null&&ue.connected?"running":"stopped"}return""}const V=w||O;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(pv,{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:Z=>d(Z.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:bM.map(({id:Z,label:ue})=>h.jsx("button",{onClick:()=>m(Z),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${f===Z?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:ue},Z))}),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:Z=>v(Z.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(Z=>h.jsx("div",{className:"h-14 rounded-lg border border-border bg-surface animate-pulse"},Z))}),!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(([Z,ue])=>{const ae=b.has(Z)||b.has("__all__"),J=B(Z),le=L(Z),ce=y==="provider"?Z:null;return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>P(Z),className:"w-full flex items-center gap-3 px-4 py-3 hover:bg-surface-hover transition-colors",children:[ae?h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Ic,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}),y==="provider"&&h.jsx($1,{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/${Z}`)},children:H(Z)}):h.jsx("span",{className:"text-xs font-semibold text-foreground",children:H(Z)}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:[ue.length," device",ue.length!==1?"s":""]}),le&&h.jsx(nh,{status:le}),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(Jm,{className:"h-3.5 w-3.5"})})})]}),ae&&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"})]}),ue.map(Y=>{var W;const $=Y.id,ee=Y.name??Y.id,_e=fx(Y),ge=(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:ee}),h.jsx("span",{className:"text-[11px] text-foreground-subtle capitalize",children:_e}),h.jsx("span",{children:h.jsx(nh,{status:ge})}),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:"—"})]},$)})]})]},Z)}),h.jsx(xM,{open:s,onClose:()=>i(!1)})]})}function SM({deviceName:t,snapshotUrl:e,status:n,resolution:s,codec:i,fps:o,lastSnapshot:d}){const{t:f}=Rr(),[m,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"})}),m&&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:v=>{v.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 NM({id:t,name:e,status:n,snapshotUrl:s,resolution:i,codec:o,fps:d,lastSnapshot:f}){const m=xl();return h.jsxs("div",{onClick:()=>m(`/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(Lu,{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(SM,{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 _M({name:t,externalId:e,onImport:n,importing:s}){const{t:i}=Rr();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(Lu,{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 CM({activeDevices:t,discoveredDevices:e,onImport:n,importingIds:s}){const{t:i}=Rr(),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(NM,{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(_M,{name:d.name,externalId:d.externalId,onImport:n??(()=>{}),importing:s==null?void 0:s.has(d.externalId)},d.externalId))})]})]})}function jM({open:t,providerId:e,onClose:n}){const{t:s}=Rr(),i=en(),o=ga(),[d,f]=D.useState(""),[m,y]=D.useState(""),[v,b]=D.useState([""]),[_,j]=D.useState({}),w=Yn({mutationFn:k=>i.createDevice(e,k),onSuccess:()=>{o.invalidateQueries({queryKey:["devices"]})}}),R=Yn({mutationFn:async()=>{const k={};for(let P=0;P<v.length;P++){const H=v[P];if(H.trim())try{await i.trpc.providerConfig.testConnection.mutate({type:"rtsp",url:H}),k[P]={codec:"OK",resolution:"Connected"}}catch(B){k[P]={error:String(B)}}}j(k)}});function O(){b(k=>[...k,""])}function T(k){b(P=>P.filter((H,B)=>B!==k))}function A(k,P){b(H=>H.map((B,L)=>L===k?P:B))}async function z(k){const P={name:d,snapshotUrl:m||void 0,streams:v.filter(H=>H.trim())};await w.mutateAsync(P),k?(f(""),y(""),b([""])):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(mo,{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:m,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:O,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:v.map((k,P)=>h.jsxs("div",{className:"flex items-center gap-2",children:[h.jsx("input",{type:"text",value:k,onChange:H=>A(P,H.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"}),v.length>1&&h.jsx("button",{onClick:()=>T(P),className:"rounded-md p-1.5 text-foreground-subtle hover:text-danger hover:bg-danger/10 transition-colors",children:h.jsx(Wm,{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:()=>R.mutate(),disabled:v.every(k=>!k.trim())||R.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:R.isPending?s("integrations.testing"):s("integrations.test")}),h.jsx("button",{onClick:()=>z(!1),disabled:!d.trim()||v.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()||v.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(Zc,{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()||v.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 wM(){const{t}=Rr(),{integrationId:e}=Wb(),n=en(),s=ga(),[i,o]=D.useState(!1),[d,f]=D.useState(!1),{data:m,isLoading:y}=pt({queryKey:["provider",e],queryFn:()=>n.getProvider(e),enabled:!!e}),{data:v}=pt({queryKey:["devices"],queryFn:()=>n.listDevices(),refetchInterval:5e3}),{data:b,refetch:_}=pt({queryKey:["discover-devices",e],queryFn:()=>n.discoverDevices(e),enabled:!!e&&(m==null?void 0:m.discoveryMode)!=="manual"}),j=Yn({mutationFn:()=>n.startProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),w=Yn({mutationFn:()=>n.stopProvider(e),onSuccess:()=>s.invalidateQueries({queryKey:["provider",e]})}),R=Yn({mutationFn:V=>n.adoptDevice(e,V),onSuccess:()=>{s.invalidateQueries({queryKey:["devices"]}),s.invalidateQueries({queryKey:["discover-devices",e]})}}),[O,T]=D.useState(new Set);async function A(V){T(Z=>new Set([...Z,V]));try{await R.mutateAsync(V)}finally{T(Z=>{const ue=new Set(Z);return ue.delete(V),ue})}}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(!m)return h.jsx("div",{className:"flex items-center justify-center py-20 text-foreground-subtle text-sm",children:t("integrations.integrationNotFound")});const k=(v??[]).filter(V=>V.providerId===e).map(V=>{var Z;return{id:V.id,name:V.name??V.id,status:(Z=V.state)!=null&&Z.online?"online":"offline",snapshotUrl:null}}),P=(b??[]).map(V=>({externalId:V.externalId,name:V.name??V.externalId})),H=m.status.connected?"running":"stopped",B=m.discoveryMode!=="manual",L=m.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(m.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:m.name}),h.jsxs("p",{className:"text-[11px] text-foreground-subtle mt-0.5",children:[m.type," · ",k.length," ",t("integrations.devices")]})]}),h.jsx(nh,{status:H})]}),h.jsxs("div",{className:"flex items-center gap-2",children:[B&&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(Dm,{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(Jm,{className:"h-3 w-3"}),t("integrations.config")]}),H==="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(D6,{className:"h-3.5 w-3.5"})}):h.jsx("button",{onClick:()=>j.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(fv,{className:"h-3.5 w-3.5"})})]})]}),h.jsx(CM,{activeDevices:k,discoveredDevices:B?P:void 0,onImport:A,importingIds:O}),h.jsx("button",{onClick:()=>{L?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(L?"integrations.addDevice":"integrations.rediscover"),children:L?h.jsx(po,{className:"h-5 w-5 text-primary-foreground"}):h.jsx(Dm,{className:"h-5 w-5 text-primary-foreground"})}),i&&e&&h.jsx(jM,{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 EM({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 hx=36e5;function TM(t){return String(t).padStart(2,"0")}function RM(t){const e=new Date(t);return`${TM(e.getHours())}:00`}function OM({startMs:t,endMs:e,segments:n,events:s,playheadMs:i,onSeek:o}){const d=D.useRef(null),f=e-t,m=D.useCallback(j=>Math.max(0,Math.min(100,(j-t)/f*100)),[t,f]);function y(j){if(!d.current)return;const w=d.current.getBoundingClientRect(),R=Math.max(0,Math.min(1,(j.clientX-w.left)/w.width));o(Math.round(t+R*f))}const v=[],b=Math.floor(t/hx),_=Math.ceil(e/hx);for(let j=b;j<=_;j++){const w=j*hx;w<t||w>e||v.push({percent:m(w),label:RM(w)})}return h.jsxs("div",{className:"select-none",children:[h.jsx("div",{className:"relative h-5 mb-1",children:v.map(({percent:j,label:w})=>h.jsx("span",{className:"absolute -translate-x-1/2 text-[10px] text-foreground-subtle",style:{left:`${j}%`},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:j=>{j.buttons===1&&y(j)},children:[n.map((j,w)=>{const R=m(j.startMs),O=m(j.endMs)-R;return h.jsx("div",{className:"absolute top-1 bottom-1 rounded-sm bg-success/60",style:{left:`${R}%`,width:`${Math.max(O,.1)}%`}},w)}),s.map(j=>h.jsx(EM,{label:j.label,color:j.color,title:`${j.label} — ${new Date(j.timestampMs).toLocaleTimeString()}`,style:{left:`${m(j.timestampMs)}%`}},j.id)),h.jsx("div",{className:"absolute top-0 bottom-0 w-0.5 bg-danger z-20 pointer-events-none",style:{left:`${m(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 p5={person:"#f59e0b",vehicle:"#3b82f6",car:"#3b82f6",face:"#a855f7",plate:"#ec4899",animal:"#10b981",motion:"#ef4444",unknown:"#6b7280"};function Cb(t){return p5[t.toLowerCase()]??p5.unknown}function AM(t){const e=new Date(t);return e.setHours(0,0,0,0),e.getTime()}function MM(t){return new Date(t).toISOString().slice(0,10)}function DM(t){return new Date(t+"T00:00:00").getTime()}function zM(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 kM(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:Cb(e[s%e.length])})).sort((n,s)=>n.timestampMs-s.timestampMs)}function LM(){var k,P;const{t}=Rr(),e=en(),n=AM(new Date),[s,i]=D.useState(n),[o,d]=D.useState(null),[f,m]=D.useState(n+12*36e5),y=s,v=s+24*36e5,{data:b,isLoading:_}=pt({queryKey:["devices"],queryFn:()=>e.listDevices(),staleTime:3e4}),j=b??[],w=D.useMemo(()=>j.filter(B=>{const L=String(B.type??"").toLowerCase(),V=B.capabilities??[];return L==="camera"||L.includes("camera")||V.some(Z=>Z.toLowerCase().includes("video")||Z.toLowerCase().includes("stream"))}).map(B=>({id:String(B.id),name:String(B.name??B.id)})),[j]),R=o??((k=w[0])==null?void 0:k.id)??null,{data:O}=pt({queryKey:["events",R,y],queryFn:()=>R?e.getEvents(R,{limit:200}):Promise.resolve(null),enabled:!!R,staleTime:6e4}),T=D.useMemo(()=>{const H=O,L=Array.isArray(H)?H:H!=null&&typeof H=="object"&&Array.isArray(H.events)?H.events:[];return L.length===0?R?kM(y):[]:L.map((V,Z)=>{const ue=String(V.class??V.type??V.label??"unknown").toLowerCase(),ae=typeof V.timestamp=="number"?V.timestamp:y;return{id:String(V.id??Z),timestampMs:ae,label:ue,color:Cb(ue)}})},[O,R,y]),A=D.useMemo(()=>R?zM(y):[],[R,y]);function z(H){i(B=>B+H*24*36e5),m(B=>B+H*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(LE,{className:"h-4 w-4"})}),h.jsxs("div",{className:"relative flex items-center",children:[h.jsx(EE,{className:"absolute left-2 h-3.5 w-3.5 text-foreground-subtle pointer-events-none"}),h.jsx("input",{type:"date",value:MM(s),onChange:H=>{if(H.target.value){const B=DM(H.target.value);i(B),m(B+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(Ic,{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(H=>{const B=H.id===R;return h.jsx("button",{onClick:()=>d(H.id),className:`shrink-0 rounded-lg px-3 py-1.5 text-[12px] font-medium transition-all border ${B?"bg-primary/12 text-primary border-primary/30":"bg-surface text-foreground-subtle border-border hover:bg-surface-hover hover:text-foreground"}`,children:H.name},H.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(T6,{className:"h-12 w-12 opacity-20"}),h.jsx("p",{className:"text-sm opacity-50",children:R?`${((P=w.find(H=>H.id===R))==null?void 0:P.name)??R} — 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(T.map(H=>H.label))).slice(0,5).map(H=>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:Cb(H)}}),h.jsx("span",{className:"text-[10px] text-foreground-subtle capitalize",children:H})]},H))]}),R?h.jsx(OM,{startMs:y,endMs:v,segments:A,events:T,playheadMs:f,onSeek:m}):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"})]})]})}D.createContext(null);function ia(...t){return LS(Fm(t))}var UM=dr("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"}}),HM=D.forwardRef(({className:t,variant:e,size:n,...s},i)=>h.jsx("button",{ref:i,className:ia(UM({variant:e,size:n}),t),...s}));HM.displayName="Button";var qM=dr("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"}}),BM=D.forwardRef(({className:t,variant:e,size:n,icon:s,...i},o)=>h.jsx("button",{ref:o,className:ia(qM({variant:e,size:n}),t),...i,children:h.jsx(s,{className:"h-4 w-4"})}));BM.displayName="IconButton";var GM=dr("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"}}),PM=D.forwardRef(({className:t,variant:e,style:n,...s},i)=>h.jsx("span",{ref:i,className:ia(GM({variant:e,styleVariant:n}),t),...s}));PM.displayName="Badge";var YM=dr("rounded-lg p-3",{variants:{variant:{flat:"bg-surface",bordered:"bg-surface border border-border"}},defaultVariants:{variant:"bordered"}}),VM=D.forwardRef(({className:t,variant:e,...n},s)=>h.jsx("div",{ref:s,className:ia(YM({variant:e}),t),...n}));VM.displayName="Card";var QM=D.forwardRef(({className:t,...e},n)=>h.jsx("label",{ref:n,className:ia("text-[10px] uppercase tracking-wider text-foreground-muted font-medium",t),...e}));QM.displayName="Label";var KM=dr("",{variants:{orientation:{horizontal:"h-px w-full bg-border-subtle",vertical:"w-px h-full bg-border-subtle"}},defaultVariants:{orientation:"horizontal"}}),XM=D.forwardRef(({className:t,orientation:e,...n},s)=>h.jsx("div",{ref:s,role:"separator",className:ia(KM({orientation:e}),t),...n}));XM.displayName="Separator";var FM=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ia("animate-pulse bg-surface-hover rounded-md h-4 w-full",t),...e}));FM.displayName="Skeleton";var m5=dr("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"}}),ZM=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:ia(m5({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:ia(m5({state:e}),t),...i}));ZM.displayName="Input";var IM=D.forwardRef(({className:t,options:e,...n},s)=>h.jsxs("div",{className:"relative w-full",children:[h.jsx("select",{ref:s,className:ia("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(iv,{className:"h-3.5 w-3.5"})})]}));IM.displayName="Select";var JM=D.forwardRef(({className:t,...e},n)=>h.jsx("input",{ref:n,type:"checkbox",className:ia("w-3.5 h-3.5 rounded-sm border border-border accent-primary",t),...e}));JM.displayName="Checkbox";var WM=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:ia("inline-flex items-center gap-2",t),...i,children:[h.jsx("span",{className:ia("w-8 h-4 rounded-full transition-colors",e?"bg-primary":"bg-surface-hover"),children:h.jsx("span",{className:ia("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})]}));WM.displayName="Switch";var $M=D.createContext(null);function eD(){const t=D.useContext($M);if(!t)throw new Error("Dialog compound components must be used within <Dialog>");return t}var tD=dr("bg-background-elevated border border-border rounded-lg p-4 backdrop:bg-black/50 backdrop:backdrop-blur-sm",{variants:{width:{sm:"max-w-sm",md:"max-w-md",lg:"max-w-lg"}},defaultVariants:{width:"md"}}),nD=D.forwardRef(({className:t,width:e,children:n,...s},i)=>{const{open:o,setOpen:d,contentId:f}=eD(),m=D.useRef(null),y=i??m;D.useEffect(()=>{const b=y.current;b&&(o&&!b.open&&b.showModal(),!o&&b.open&&b.close())},[o,y]);const v=b=>{b.target===b.currentTarget&&d(!1)};return h.jsx("dialog",{ref:y,id:f,className:ia(tD({width:e}),"w-full",t),onClick:v,onClose:()=>d(!1),...s,children:n})});nD.displayName="DialogContent";D.createContext(null);D.createContext(null);D.createContext(null);D.createContext(null);var aD=D.forwardRef(({className:t,...e},n)=>h.jsx("div",{ref:n,className:ia("overflow-auto [&::-webkit-scrollbar]:w-1 [&::-webkit-scrollbar-track]:bg-transparent [&::-webkit-scrollbar-thumb]:bg-surface-hover [&::-webkit-scrollbar-thumb]:rounded-full",t),...e}));aD.displayName="ScrollArea";var sD={"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"},rD={detector:"border-l-blue-500",cropper:"border-l-purple-500",classifier:"border-l-lime-500",refiner:"border-l-cyan-500"};function iD(t,e){return sD[t]??rD[e]??"border-l-primary"}var lD={cpu:"onnx",coreml:"coreml",openvino:"openvino",cuda:"onnx",tensorrt:"onnx","onnx-py":"onnx",pytorch:"pt"};function oD(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=lD[o.id]??"onnx",f=i.has(d);return{...o,available:o.available&&f}})}function uD(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 cD(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 px({step:t,schema:e,allSchemas:n,capabilities:s,depth:i=0,onChange:o,onDelete:d,readOnly:f=!1}){var O;const[m,y]=D.useState(!1),v=iD(t.addonId,t.slot),b=oD(t.runtime,s,e),_=cD(s);if(!(((O=b.find(T=>T.id===t.backend))==null?void 0:O.available)??!1)&&!f){const T=b.find(A=>A.available);T&&T.id!==t.backend&&queueMicrotask(()=>o({...t,backend:T.id}))}const w=uD(e,t.runtime,t.backend,s);if(w.length>0&&!w.some(T=>T.id===t.modelId)&&!f){const A=(e!=null&&e.defaultModelId?w.find(z=>z.id===e.defaultModelId):null)??w[0];A&&A.id!==t.modelId&&queueMicrotask(()=>o({...t,modelId:A.id}))}function R(T){T.target.closest(".step-config")||y(A=>!A)}return h.jsx("div",{className:"space-y-2",children:h.jsxs("div",{className:ia("rounded-xl border border-border bg-surface overflow-hidden border-l-4 shadow-sm",v,!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:R,children:[h.jsx("span",{className:"text-foreground-subtle",children:m?h.jsx(iv,{className:"h-4 w-4"}):h.jsx(mC,{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(T=>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:T},T)),t.inputClasses.length>0&&t.outputClasses.length>0&&h.jsx("span",{className:"text-foreground-subtle/40 text-[10px]",children:"→"}),t.outputClasses.map(T=>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:T},T))]})]}),h.jsx("button",{onClick:T=>{T.stopPropagation(),o({...t,enabled:!t.enabled})},className:ia("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:ia("inline-block h-4 w-4 rounded-full bg-white shadow transition-transform",t.enabled?"translate-x-6":"translate-x-1")})})]}),m&&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($0,{label:"Agent",value:t.agentId,disabled:f,options:[{value:t.agentId||"hub",label:t.agentId||"Hub (local)"}],onChange:T=>o({...t,agentId:T})}),h.jsx($0,{label:"Runtime",value:t.runtime,disabled:f,options:_.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,runtime:T})}),h.jsx($0,{label:"Backend",value:t.backend,disabled:f,options:b.map(T=>({value:T.id,label:T.label,disabled:!T.available})),onChange:T=>o({...t,backend:T})}),h.jsx($0,{label:"Model",value:t.modelId,disabled:f,options:w.map(T=>({value:T.id,label:`${T.name}${T.downloaded?" ✓":""}`})),onChange:T=>o({...t,modelId:T})})]}),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:T=>o({...t,confidence:Number(T.target.value)}),className:"w-full accent-primary h-1.5"})]})]})]})})}function $0({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 dD(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(v=>v.addons).find(v=>v.id===d.addonId);let m=d.modelId;if(f&&!f.models.some(v=>v.id===m)){const v=f.defaultModelId;s.push(`Model "${m}" not available for ${d.addonId} — using "${v}"`),m=v}const y=d.children.map(v=>i(v)).filter(v=>v!==null);return{...d,modelId:m,children:y}}const o=t.map(d=>i(d)).filter(d=>d!==null);return{valid:s.length===0,steps:o,warnings:s}}function fD(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 mx(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 gx({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(yC,{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 hD({schema:t,capabilities:e,steps:n,onChange:s,templates:i,selectedTemplateId:o,onSelectTemplate:d,onSaveTemplate:f,onUpdateTemplate:m,onDeleteTemplate:y,readOnly:v=!1,excludeAddons:b=[]}){var $,ee,_e,ge;const _=D.useMemo(()=>new Set(b),[b]),j=D.useMemo(()=>fD(t),[t]),[w,R]=D.useState([]),O=($=e.platformScores)==null?void 0:$.find(G=>G.available),T=e.runtimes.python.available&&e.runtimes.python.backends.some(G=>G.available),A=(O==null?void 0:O.runtime)??(T?"python":"node"),z=(O==null?void 0:O.backend)??(T?((ee=e.runtimes.python.backends.find(G=>G.available))==null?void 0:ee.id)??"cpu":((_e=e.runtimes.node.backends.find(G=>G.available&&G.id!=="cpu"))==null?void 0:_e.id)??"cpu"),k=o?JSON.stringify(n)!==JSON.stringify((ge=i.find(G=>G.id===o))==null?void 0:ge.steps):!1;function P(G){const W=G.target.value||null;if(W){const he=i.find(re=>re.id===W);if(he){const re=dD(he.steps,t);R([...re.warnings])}}else R([]);d(W)}function H(){o&&m(o,n)}function B(){const G=window.prompt("Template name:");G!=null&&G.trim()&&f(G.trim(),n)}function L(){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:Z(G)))}function Z(G){const W=G.children.some(he=>he.enabled||he.children.some(re=>re.enabled));return{...G,enabled:G.enabled||W,children:G.children.map(he=>{const re=he.children.some(Se=>Se.enabled);return{...he,enabled:he.enabled||re}})}}function ue(G,W){const he=mx(W,A,z);s(n.map(re=>re.addonId!==G?re:{...re,children:[...re.children,he]}))}function ae(G){const W=new Set;for(const he of G){W.add(he.addonId);for(const Se of he.children)W.add(Se.addonId);const re=ae(he.children);for(const Se of re)W.add(Se)}return W}const J=ae(n);function le(G){const W=j.get(G.addonId);if(!W)return[];const he=W.childSlots,re=new Set(G.children.map(je=>je.addonId)),Se=[];for(const je of t.slots)if(he.includes(je.id))for(const De of je.addons){if(re.has(De.id)||_.has(De.id))continue;De.inputClasses.some(ze=>G.outputClasses.includes(ze))&&Se.push(De)}return Se}function ce(G){const W=le(G);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(px,{step:G,schema:j.get(G.addonId)??null,allSchemas:j,capabilities:e,onChange:V,onDelete:v?void 0:he=>s(n.filter(re=>re.addonId!==he)),readOnly:v}),(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(he=>{const re=le(he);return h.jsxs("div",{className:"space-y-1.5",children:[h.jsx(px,{step:he,schema:j.get(he.addonId)??null,allSchemas:j,capabilities:e,depth:1,onChange:Se=>{V({...G,children:G.children.map(je=>je.addonId===Se.addonId?Se:je)})},onDelete:v?void 0:Se=>{V({...G,children:G.children.filter(je=>je.addonId!==Se)})},readOnly:v}),(he.children.length>0||re.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"}),he.children.map(Se=>h.jsx(px,{step:Se,schema:j.get(Se.addonId)??null,allSchemas:j,capabilities:e,depth:2,onChange:je=>{V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:De.children.map(nt=>nt.addonId===je.addonId?je:nt)}:De)})},onDelete:v?void 0:je=>{V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:De.children.filter(nt=>nt.addonId!==je)}:De)})},readOnly:v},Se.addonId)),!v&&re.map(Se=>h.jsx(gx,{addon:Se,onClick:()=>{const je=mx(Se,A,z);V({...G,children:G.children.map(De=>De.addonId===he.addonId?{...De,children:[...De.children,je]}:De)})}},Se.id))]})]},he.addonId)}),!v&&W.map(he=>h.jsx(gx,{addon:he,onClick:()=>ue(G.addonId,he)},he.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:H,disabled:!o||v,title:"Save",className:ia("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:bg-surface-hover":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(SC,{className:"h-4 w-4"})}),h.jsx("button",{onClick:B,disabled:v,title:"Save As",className:ia("p-2 rounded-lg border border-border transition-colors",v?"text-foreground-subtle/30 cursor-not-allowed":"text-foreground-subtle hover:bg-surface-hover"),children:h.jsx(bC,{className:"h-4 w-4"})}),h.jsx("button",{onClick:L,disabled:!o||v,title:"Delete",className:ia("p-2 rounded-lg border border-border transition-colors",o&&!v?"text-foreground-subtle hover:text-danger":"text-foreground-subtle/30 cursor-not-allowed"),children:h.jsx(_C,{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:()=>R([]),className:"text-amber-400/60 hover:text-amber-400",children:h.jsx(jC,{className:"h-3.5 w-3.5"})})]}),w.map((G,W)=>h.jsxs("div",{children:["• ",G]},W))]}),Y.map(G=>{const W=n.filter(re=>re.slot===G.id&&!_.has(re.addonId)),he=G.addons.filter(re=>!J.has(re.id)&&!_.has(re.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(re=>ce(re)),!v&&he.map(re=>h.jsx(gx,{addon:re,onClick:()=>{s([...n,mx(re,A,z)])}},re.id))]},G.id)})]})}D.createContext(null);function yx({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:m=>f(Number(m.target.value))}),h.jsxs("span",{className:"text-xs text-foreground tabular-nums min-w-[3rem] text-right",children:[e,o?` ${o}`:""]})]})]})}function pD({motionFps:t,detectionFps:e,cooldownMs:n,maxConcurrentInferences:s,onMotionFpsChange:i,onDetectionFpsChange:o,onCooldownMsChange:d,onMaxConcurrentInferencesChange:f}){const m=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(yx,{label:"Motion FPS",value:t,min:1,max:15,onChange:i,unit:"fps",hint:"Frame-diff rate"}),h.jsx(yx,{label:"Detection FPS",value:e,min:1,max:30,onChange:o,unit:"fps",hint:"Inference rate"}),h.jsx(yx,{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(m?2:null),className:`text-[9px] font-medium px-1.5 py-0.5 rounded transition-colors ${m?"bg-primary/15 text-primary":"bg-surface text-foreground-subtle hover:text-foreground"}`,children:m?"Auto":"Manual"})]}),m?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 mD={motionFps:2,detectionFps:5,cooldownMs:1e4,maxConcurrentInferences:null};function gD(){const{t}=Rr(),e=en(),[n,s]=D.useState(!0),[i,o]=D.useState(null),[d,f]=D.useState(null),[m,y]=D.useState([]),[v,b]=D.useState([]),[_,j]=D.useState(null),[w,R]=D.useState(mD),[O,T]=D.useState(!1),[A,z]=D.useState(!1),[k,P]=D.useState(!0);D.useEffect(()=>{var le,ce,Y,$,ee,_e,ge,G,W,he,re,Se,je,De,nt;const J=e.trpc;if(!J){s(!1);return}Promise.all([(Y=(ce=(le=J.pipeline)==null?void 0:le.getSchema)==null?void 0:ce.query)==null?void 0:Y.call(ce).catch(()=>null),(_e=(ee=($=J.inference)==null?void 0:$.getCapabilities)==null?void 0:ee.query)==null?void 0:_e.call(ee).catch(()=>null),(W=(G=(ge=J.pipeline)==null?void 0:ge.getGlobalSteps)==null?void 0:G.query)==null?void 0:W.call(G).catch(()=>null),(Se=(re=(he=J.pipeline)==null?void 0:he.getOrchestratorSettings)==null?void 0:re.query)==null?void 0:Se.call(re).catch(()=>null),(nt=(De=(je=J.pipeline)==null?void 0:je.listTemplates)==null?void 0:De.query)==null?void 0:nt.call(De).catch(()=>[])]).then(([ze,Vt,$e,At,qt])=>{ze&&o(ze),Vt&&f(Vt),$e&&y($e),At&&R(At),b(qt??[]),s(!1)}).catch(()=>s(!1))},[e]);const H=D.useCallback(J=>{y(J),T(!0)},[]),B=D.useCallback(J=>{if(j(J),J&&i){const le=v.find(ce=>ce.id===J);if(le!=null&&le.steps){const ce=new Map(i.slots.flatMap($=>$.addons.map(ee=>[ee.id,ee]))),Y=$=>{const ee=ce.get($.addonId);return{addonId:$.addonId,addonName:(ee==null?void 0:ee.name)??$.addonId,slot:(ee==null?void 0:ee.slot)??"detector",inputClasses:ee?[...ee.inputClasses]:[],outputClasses:ee?[...ee.outputClasses]:[],enabled:$.enabled??!0,agentId:$.agentId??"hub",runtime:$.runtime??"node",backend:$.backend??"cpu",modelId:$.modelId??(ee==null?void 0:ee.defaultModelId)??"",confidence:$.confidence??(ee==null?void 0:ee.defaultConfidence)??.3,classFilters:$.classFilters?[...$.classFilters]:[],children:($.children??[]).map(Y)}};y(le.steps.map(Y))}}},[i,v]),L=D.useCallback(async(J,le)=>{try{const Y=await e.trpc.pipeline.saveTemplate.mutate({name:J,steps:le});b($=>[Y,...$]),j(Y.id)}catch{}},[e]),V=D.useCallback(async(J,le)=>{try{const Y=await e.trpc.pipeline.updateTemplate.mutate({id:J,steps:le});b($=>$.map(ee=>ee.id===J?Y:ee))}catch{}},[e]),Z=D.useCallback(async J=>{try{await e.trpc.pipeline.deleteTemplate.mutate({id:J}),b(ce=>ce.filter(Y=>Y.id!==J)),_===J&&j(null)}catch{}},[e,_]);async function ue(){z(!0);try{const J=e.trpc;await Promise.all([J.pipeline.setGlobalSteps.mutate({steps:m}),J.pipeline.setOrchestratorSettings.mutate(w)]),T(!1)}catch{}finally{z(!1)}}function ae(J,le){R(ce=>({...ce,[J]:le})),T(!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(Y1,{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:[O&&h.jsx("span",{className:"text-[10px] text-amber-400 font-medium",children:"Unsaved changes"}),h.jsxs("button",{onClick:ue,disabled:!O||A,className:`flex items-center gap-1.5 rounded-lg px-3 py-1.5 text-xs font-medium transition-all ${O&&!A?"bg-primary text-white hover:bg-primary/90":"bg-surface text-foreground-subtle border border-border cursor-not-allowed"}`,children:[h.jsx(M6,{className:"h-3.5 w-3.5"}),A?"Saving…":"Save Pipeline"]})]})]}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:h.jsx(hD,{schema:i,capabilities:d,steps:m,onChange:H,templates:v,selectedTemplateId:_,onSelectTemplate:B,onSaveTemplate:L,onUpdateTemplate:V,onDeleteTemplate:Z})})]}),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(Zc,{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(pD,{motionFps:w.motionFps,detectionFps:w.detectionFps,cooldownMs:w.cooldownMs,maxConcurrentInferences:w.maxConcurrentInferences,onMotionFpsChange:J=>ae("motionFps",J),onDetectionFpsChange:J=>ae("detectionFps",J),onCooldownMsChange:J=>ae("cooldownMs",J),onMaxConcurrentInferencesChange:J=>ae("maxConcurrentInferences",J)})})]})]})}const yD=["WebRTC","HLS","MJPEG","go2rtc"],xD=["BBox","Segm","Zones","Trail"];function bD({deviceName:t,detectionsToday:e,inferenceMs:n,activeTracks:s,storageGb:i}){const[o,d]=D.useState("WebRTC"),[f,m]=D.useState(new Set);function y(v){m(b=>{const _=new Set(b);return _.has(v)?_.delete(v):_.add(v),_})}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(Lu,{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:"}),yD.map(v=>h.jsx("button",{onClick:()=>d(v),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${o===v?"bg-primary/15 text-primary border border-primary/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:v},v))]}),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:"}),xD.map(v=>{const b=f.has(v);return h.jsx("button",{onClick:()=>y(v),className:`rounded-full px-2.5 py-1 text-[10px] font-medium transition-colors ${b?"bg-info/15 text-info border border-info/30":"bg-surface border border-border text-foreground-subtle hover:text-foreground"}`,children:v},v)})]}),h.jsxs("div",{className:"grid grid-cols-4 gap-2",children:[h.jsx(e1,{icon:ch,label:"Today",value:String(e)}),h.jsx(e1,{icon:uv,label:"Inference",value:`${n}ms`}),h.jsx(e1,{icon:IE,label:"Tracks",value:String(s)}),h.jsx(e1,{icon:gm,label:"Storage",value:`${i.toFixed(1)}GB`})]})]})}function e1({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 xx={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 vD({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(_1,{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(xx).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(cv,{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=xx[n.type]??xx.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 g5={person:{color:"text-success",borderColor:"border-l-success",icon:dR},vehicle:{color:"text-info",borderColor:"border-l-info",icon:OE},animal:{color:"text-warning",borderColor:"border-l-warning",icon:WE},audio:{color:"text-danger",borderColor:"border-l-danger",icon:O6},other:{color:"text-foreground-subtle",borderColor:"border-l-foreground-subtle",icon:cv}};function SD(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 ND({deviceId:t}){const e=en(),{data:n,isLoading:s}=pt({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(g5).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(cv,{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=SD(o),m=g5[f],y=m.icon,v=String(o.label??o.type??"Unknown"),b=o.score!=null?Number(o.score):null,_=o.zone?String(o.zone):null,j=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 ${m.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 ${m.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:v}),b!=null&&h.jsxs("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:[(b*100).toFixed(0),"%"]})]}),h.jsxs("div",{className:"flex items-center gap-2 mt-0.5 text-[10px] text-foreground-subtle",children:[j&&h.jsxs("span",{children:["Track: ",j]}),_&&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 _D({deviceId:t}){const e=en(),[n,s]=D.useState(new Set),{data:i,isLoading:o}=pt({queryKey:["pipeline",t],queryFn:()=>e.bridgeGetPipeline(t),enabled:!!t}),d=i,f=(d==null?void 0:d.video)??[];function m(y){s(v=>{const b=new Set(v);return b.has(y)?b.delete(y):b.add(y),b})}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,v)=>{const b=n.has(y.id??String(v)),_=y.id??String(v);return h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("button",{onClick:()=>m(_),className:"w-full flex items-center gap-3 px-4 py-3 text-left hover:bg-surface-hover transition-colors",children:[b?h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle flex-shrink-0"}):h.jsx(Ic,{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:v+1}),h.jsx("span",{className:"text-xs font-medium text-foreground flex-1 truncate",children:y.name||y.type||`Step ${v+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"}`})]}),b&&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(Y1,{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 CD(){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(j6,{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(T6,{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 jD=Math.PI/180;function wD(){return typeof window<"u"&&({}.toString.call(window)==="[object Window]"||{}.toString.call(window)==="[object global]")}const Hc=typeof global<"u"?global:typeof window<"u"?window:typeof WorkerGlobalScope<"u"?self:{},Me={_global:Hc,version:"10.2.3",isBrowser:wD(),isUnminified:/param/.test((function(t){}).toString()),dblClickWindow:400,getAngle(t){return Me.angleDeg?t*jD: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 Me.DD.isDragging},isTransforming(){var t,e;return(e=(t=Me.Transformer)===null||t===void 0?void 0:t.isTransforming())!==null&&e!==void 0?e:!1},isDragReady(){return!!Me.DD.node},releaseCanvasOnDestroy:!0,document:Hc.document,_injectGlobal(t){typeof Hc.Konva<"u"&&console.error("Several Konva instances detected. It is not recommended to use multiple Konva instances in the same environment."),Hc.Konva=t}},$n=t=>{Me[t.prototype.getClassName()]=t};Me._injectGlobal(Me);const ED=`Konva.js unsupported environment.
|
|
551
|
-
|
|
552
|
-
Looks like you are trying to use Konva.js in Node.js environment. because "document" object is undefined.
|
|
553
|
-
|
|
554
|
-
To use Konva.js in Node.js environment, you need to use the "canvas-backend" or "skia-backend" module.
|
|
555
|
-
|
|
556
|
-
bash: npm install canvas
|
|
557
|
-
js: import "konva/canvas-backend";
|
|
558
|
-
|
|
559
|
-
or
|
|
560
|
-
|
|
561
|
-
bash: npm install skia-canvas
|
|
562
|
-
js: import "konva/skia-backend";
|
|
563
|
-
`,y5=()=>{if(typeof document>"u")throw new Error(ED)};class wr{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 wr(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,m={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);m.rotation=n>0?Math.acos(e/y):-Math.acos(e/y),m.scaleX=y,m.scaleY=f/y,m.skewX=(e*s+n*i)/f,m.skewY=0}else if(s!=0||i!=0){const y=Math.sqrt(s*s+i*i);m.rotation=Math.PI/2-(i>0?Math.acos(-s/y):-Math.acos(s/y)),m.scaleX=f/y,m.scaleY=y,m.skewX=0,m.skewY=(e*s+n*i)/f}return m.rotation=te._getRotation(m.rotation),m}}const TD="[object Array]",RD="[object Number]",OD="[object String]",AD="[object Boolean]",MD=Math.PI/180,DD=180/Math.PI,tm="#",zD="",kD="0",LD="Konva warning: ",x5="Konva error: ",UD="rgb(",bx={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]},HD=/rgb\((\d{1,3}),(\d{1,3}),(\d{1,3})\)/;let t1=[],nm=null;const qD=typeof requestAnimationFrame<"u"&&requestAnimationFrame||function(t){setTimeout(t,16)},te={_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)===TD},_isNumber(t){return Object.prototype.toString.call(t)===RD&&!isNaN(t)&&isFinite(t)},_isString(t){return Object.prototype.toString.call(t)===OD},_isBoolean(t){return Object.prototype.toString.call(t)===AD},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){t1.push(t),t1.length===1&&qD(function(){const e=t1;t1=[],e.forEach(function(n){n()})})},createCanvasElement(){y5();const t=document.createElement("canvas");try{t.style=t.style||{}}catch{}return t},createImageElement(){return y5(),document.createElement("img")},_isInDocument(t){for(;t=t.parentNode;)if(t==document)return!0;return!1},_urlToImage(t,e){const n=te.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(tm,zD);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=kD+t;return tm+t},isCanvasFarblingActive(){if(nm!==null)return nm;if(typeof document>"u")return nm=!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 nm=s,this.releaseCanvas(t),nm},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),tm+this._rgbToHex(t,e,n)},getSnappedHexColor(t){const e=this._hexToRgb(t);return tm+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 bx?(e=bx[t],{r:e[0],g:e[1],b:e[2]}):t[0]===tm?this._hexToRgb(t.substring(1)):t.substr(0,4)===UD?(e=HD.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",te._namedColorToRBA(t)||te._hex3ColorToRGBA(t)||te._hex4ColorToRGBA(t)||te._hex6ColorToRGBA(t)||te._hex8ColorToRGBA(t)||te._rgbColorToRGBA(t)||te._rgbaColorToRGBA(t)||te._hslColorToRGBA(t)},_namedColorToRBA(t){const e=bx[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,m;if(i===0)return m=o*255,{r:Math.round(m),g:Math.round(m),b:Math.round(m),a:1};o<.5?d=o*(1+i):d=o+i-o*i;const y=2*o-d,v=[0,0,0];for(let b=0;b<3;b++)f=s+1/3*-(b-1),f<0&&f++,f>1&&f--,6*f<1?m=y+(d-y)*6*f:2*f<1?m=d:3*f<2?m=y+(d-y)*(2/3-f)*6:m=y,v[b]=m*255;return{r:Math.round(v[0]),g:Math.round(v[1]),b:Math.round(v[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*MD},radToDeg(t){return t*DD},_degToRad(t){return te.warn("Util._degToRad is removed. Please use public Util.degToRad instead."),te.degToRad(t)},_radToDeg(t){return te.warn("Util._radToDeg is removed. Please use public Util.radToDeg instead."),te.radToDeg(t)},_getRotation(t){return Me.angleDeg?te.radToDeg(t):t},_capitalize(t){return t.charAt(0).toUpperCase()+t.slice(1)},throw(t){throw new Error(x5+t)},error(t){console.error(x5+t)},warn(t){Me.showWarnings&&console.warn(LD+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,m;const y=(t-n)*(t-n)+(e-s)*(e-s);if(y==0)d=t,f=e,m=(i-n)*(i-n)+(o-s)*(o-s);else{const v=((i-t)*(n-t)+(o-e)*(s-e))/y;v<0?(d=t,f=e,m=(t-i)*(t-i)+(e-o)*(e-o)):v>1?(d=n,f=s,m=(n-i)*(n-i)+(s-o)*(s-o)):(d=t+v*(n-t),f=e+v*(s-e),m=(d-i)*(d-i)+(f-o)*(f-o))}return[d,f,m]},_getProjectionToLine(t,e,n){const s=te.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],m=te._getProjectionToSegment(o.x,o.y,f.x,f.y,t.x,t.y),y=m[0],v=m[1],b=m[2];b<i&&(s.x=y,s.y=v,i=b)}),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=te._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||te._isElement(t[n]))if(e.configurable)delete t[n];else return null;else if(te._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){Me.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,m=0,y=0;typeof s=="number"?d=f=m=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),m=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+m,o+n),t.arc(i+m,o+n-m,m,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],m=e[(o+1)%n],y={x:f.x-d.x,y:f.y-d.y},v={x:m.x-f.x,y:m.y-f.y},b=Math.hypot(y.x,y.y),_=Math.hypot(v.x,v.y);let j;typeof i=="number"?j=i:j=o<i.length?i[o]:0,j=s*Math.cos(Math.PI/n)*Math.min(1,j/s*2);const R={x:y.x/b,y:y.y/b},O={x:v.x/_,y:v.y/_},T={x:f.x-R.x*j,y:f.y-R.y*j},A={x:f.x+O.x*j,y:f.y+O.y*j};o===0?t.moveTo(T.x,T.y):t.lineTo(T.x,T.y),t.arcTo(f.x,f.y,A.x,A.y,j)}}};function BD(t){const e=[],n=t.length,s=te;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 b5=",",GD="(",PD=")",YD="([",VD="])",QD=";",KD="()",XD="=",v5=["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"],FD=["fillStyle","strokeStyle","shadowColor","shadowBlur","shadowOffsetX","shadowOffsetY","letterSpacing","lineCap","lineDashOffset","lineJoin","lineWidth","miterLimit","direction","font","textAlign","textBaseline","globalAlpha","globalCompositeOperation","imageSmoothingEnabled","filter"],ZD=100;let n1=null;function S5(){if(n1!==null)return n1;try{const e=te.createCanvasElement().getContext("2d");return e?!!e&&"filter"in e:(n1=!1,!1)}catch{return n1=!1,!1}}class ty{constructor(e){this.canvas=e,Me.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,m,y;for(d=0;d<i;d++)f=s[d],m=f.method,m?(y=f.args,o+=m,e?o+=KD:te._isArray(y[0])?o+=YD+y.join(b5)+VD:(n&&(y=y.map(v=>typeof v=="number"?Math.floor(v):v)),o+=GD+y.join(b5)+PD)):(o+=f.property,e||(o+=XD+f.val)),o+=QD;return o}clearTrace(){this.traceArr=[]}_trace(e){let n=this.traceArr,s;n.push(e),s=n.length,s>=ZD&&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,m,y){const v=arguments,b=this._context;v.length===3?b.drawImage(e,n,s):v.length===5?b.drawImage(e,n,s,i,o):v.length===9&&b.drawImage(e,n,s,i,o,d,f,m,y)}ellipse(e,n,s,i,o,d,f,m){this._context.ellipse(e,n,s,i,o,d,f,m)}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=v5.length,s=this.setAttr,i,o;const d=function(f){let m=e[f],y;e[f]=function(){return o=BD(Array.prototype.slice.call(arguments,0)),y=m.apply(e,arguments),e._trace({method:f,args:o}),y}};for(i=0;i<n;i++)d(v5[i]);e.setAttr=function(){s.apply(e,arguments);const f=arguments[0];let m=arguments[1];(f==="shadowOffsetX"||f==="shadowOffsetY"||f==="shadowBlur")&&(m=m/this.canvas.getPixelRatio()),e._trace({property:f,val:m})}}_applyGlobalCompositeOperation(e){const n=e.attrs.globalCompositeOperation;!n||n==="source-over"||this.setAttr("globalCompositeOperation",n)}}FD.forEach(function(t){Object.defineProperty(ty.prototype,t,{get(){return this._context[t]},set(e){this._context[t]=e}})});class ID extends ty{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},m=e.getAbsoluteScale(),y=this.canvas.getPixelRatio(),v=m.x*y,b=m.y*y;this.setAttr("shadowColor",o),this.setAttr("shadowBlur",d*Math.min(Math.abs(v),Math.abs(b))),this.setAttr("shadowOffsetX",f.x*v),this.setAttr("shadowOffsetY",f.y*b)}}class JD extends ty{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 a1;function WD(){if(a1)return a1;const t=te.createCanvasElement(),e=t.getContext("2d");return a1=(function(){const n=Me._global.devicePixelRatio||1,s=e.webkitBackingStorePixelRatio||e.mozBackingStorePixelRatio||e.msBackingStorePixelRatio||e.oBackingStorePixelRatio||e.backingStorePixelRatio||1;return n/s})(),te.releaseCanvas(t),a1}class Ev{constructor(e){this.pixelRatio=1,this.width=0,this.height=0,this.isCache=!1;const s=(e||{}).pixelRatio||Me.pixelRatio||WD();this.pixelRatio=s,this._canvas=te.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 te.error("Unable to get data URL. "+i.message+" For more info read https://konvajs.org/docs/posts/Tainted_Canvas.html."),""}}}}class bu extends Ev{constructor(e={width:0,height:0,willReadFrequently:!1}){super(e),this.context=new ID(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 JD(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=te._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,Me._mouseListenClick=!1,Me._touchListenClick=!1,Me._pointerListenClick=!1,n.dragStatus="stopped");const d=n.node.getLayer()||n.node instanceof Me.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)})}};Me.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 Uu(t){return te._isString(t)?'"'+t+'"':Object.prototype.toString.call(t)==="[object Number]"||te._isBoolean(t)?t:Object.prototype.toString.call(t)}function x8(t){return t>255?255:t<0?0:Math.round(t)}function Te(){if(Me.isUnminified)return function(t,e){return te._isNumber(t)||te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a number.'),t}}function ny(t){if(Me.isUnminified)return function(e,n){let s=te._isNumber(e),i=te._isArray(e)&&e.length==t;return!s&&!i&&te.warn(Uu(e)+' is a not valid value for "'+n+'" attribute. The value should be a number or Array<number>('+t+")"),e}}function Rv(){if(Me.isUnminified)return function(t,e){return te._isNumber(t)||t==="auto"||te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a number or "auto".'),t}}function id(){if(Me.isUnminified)return function(t,e){return te._isString(t)||te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a string.'),t}}function b8(){if(Me.isUnminified)return function(t,e){const n=te._isString(t),s=Object.prototype.toString.call(t)==="[object CanvasGradient]"||t&&t.addColorStop;return n||s||te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a string or a native gradient.'),t}}function $D(){if(Me.isUnminified)return function(t,e){const n=Int8Array?Object.getPrototypeOf(Int8Array):null;return n&&t instanceof n||(te._isArray(t)?t.forEach(function(s){te._isNumber(s)||te.warn('"'+e+'" attribute has non numeric element '+s+". Make sure that all elements are numbers.")}):te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a array of numbers.')),t}}function Mi(){if(Me.isUnminified)return function(t,e){return t===!0||t===!1||te.warn(Uu(t)+' is a not valid value for "'+e+'" attribute. The value should be a boolean.'),t}}function ez(t){if(Me.isUnminified)return function(e,n){return e==null||te.isObject(e)||te.warn(Uu(e)+' is a not valid value for "'+n+'" attribute. The value should be an object with properties '+t),e}}const am="get",sm="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=am+te._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=sm+te._capitalize(e);t.prototype[i]||K.overWriteSetter(t,e,n,s)},overWriteSetter(t,e,n,s){const i=sm+te._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=te._capitalize,f=am+d(e),m=sm+d(e);t.prototype[f]=function(){const v={};for(let b=0;b<o;b++){const _=n[b];v[_]=this.getAttr(e+d(_))}return v};const y=ez(n);t.prototype[m]=function(v){const b=this.attrs[e];s&&(v=s.call(this,v,e)),y&&y.call(this,v,e);for(const _ in v)v.hasOwnProperty(_)&&this._setAttr(e+d(_),v[_]);return v||n.forEach(_=>{this._setAttr(e+d(_),void 0)}),this._fireChangeEvent(e,b,v),i&&i.call(this),this},K.addOverloadedGetterSetter(t,e)},addOverloadedGetterSetter(t,e){const n=te._capitalize(e),s=sm+n,i=am+n;t.prototype[e]=function(){return arguments.length?(this[s](arguments[0]),this):this[i]()}},addDeprecatedGetterSetter(t,e,n,s){te.error("Adding deprecated "+e);const i=am+te._capitalize(e),o=e+" property is deprecated and will be removed soon. Look at Konva change log for more information.";t.prototype[i]=function(){te.error(o);const d=this.attrs[e];return d===void 0?n:d},K.addSetter(t,e,s,function(){te.error(o)}),K.addOverloadedGetterSetter(t,e)},backCompat(t,e){te.each(e,function(n,s){const i=t.prototype[s],o=am+te._capitalize(n),d=sm+te._capitalize(n);function f(){i.apply(this,arguments),te.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 tz(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=Me.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=Me.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 m=Me.Filters;m&&m.Contrast&&m.Contrast.call(this,d)}}case"grayscale":return function(o){const d=Me.Filters;d&&d.Grayscale&&d.Grayscale.call(this,o)};case"sepia":return function(o){const d=Me.Filters;d&&d.Sepia&&d.Sepia.call(this,o)};case"invert":return function(o){const d=Me.Filters;d&&d.Invert&&d.Invert.call(this,o)};default:te.warn(`CSS filter "${s}" is not supported in fallback mode. Consider using function filters for better compatibility.`);break}}return()=>{}}const x1="absoluteOpacity",N5="allEventListeners",so="absoluteTransform",_5="absoluteScale",zc="canvas",nz="Change",az="children",sz="konva",jb="listening",rz="mouseenter",iz="mouseleave",lz="pointerenter",oz="pointerleave",uz="touchenter",cz="touchleave",C5="set",j5="Shape",b1=" ",w5="stage",yu="transform",dz="Stage",wb="visible",fz=["xChange.konva","yChange.konva","scaleXChange.konva","scaleYChange.konva","skewXChange.konva","skewYChange.konva","rotationChange.konva","offsetXChange.konva","offsetYChange.konva","transformsEnabledChange.konva"].join(b1);let hz=1;class Ae{constructor(e){this._id=hz++,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===yu||e===so)&&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===yu||e===so)&&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(b1);this.on(i,()=>{this._clearCache(e)}),this._attachedDepsListeners.set(e,!0)}return this._getCache(e,s)}_getCanvasCache(){return this._cache.get(zc)}_clearSelfAndDescendantCache(e){this._clearCache(e),e===so&&this.fire("absoluteTransformChange")}clearCache(){if(this._cache.has(zc)){const{scene:e,filter:n,hit:s}=this._cache.get(zc);te.releaseCanvas(e._canvas,n._canvas,s._canvas),this._cache.delete(zc)}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,m=n.y===void 0?Math.floor(s.y):n.y,y=n.offset||0,v=n.drawBorder||!1,b=n.hitCanvasPixelRatio||1;if(!i||!o){te.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,j=Math.abs(Math.round(s.y)-m)>.5?1:0;i+=y*2+_,o+=y*2+j,f-=y,m-=y;const w=new bu({pixelRatio:d,width:i,height:o}),R=new bu({pixelRatio:d,width:0,height:0,willReadFrequently:!0}),O=new Tv({pixelRatio:b,width:i,height:o}),T=w.getContext(),A=O.getContext(),z=new bu({width:w.width/w.pixelRatio+Math.abs(f),height:w.height/w.pixelRatio+Math.abs(m),pixelRatio:w.pixelRatio}),k=z.getContext();return O.isCache=!0,w.isCache=!0,this._cache.delete(zc),this._filterUpToDate=!1,n.imageSmoothingEnabled===!1&&(w.getContext()._context.imageSmoothingEnabled=!1,R.getContext()._context.imageSmoothingEnabled=!1),T.save(),A.save(),k.save(),T.translate(-f,-m),A.translate(-f,-m),k.translate(-f,-m),z.x=f,z.y=m,this._isUnderCache=!0,this._clearSelfAndDescendantCache(x1),this._clearSelfAndDescendantCache(_5),this.drawScene(w,this,z),this.drawHit(O,this),this._isUnderCache=!1,T.restore(),A.restore(),v&&(T.save(),T.beginPath(),T.rect(0,0,i,o),T.closePath(),T.setAttr("strokeStyle","red"),T.setAttr("lineWidth",5),T.stroke(),T.restore()),te.releaseCanvas(z._canvas),this._cache.set(zc,{scene:w,filter:R,hit:O,x:f,y:m}),this._requestDraw(),this}isCached(){return this._cache.has(zc)}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 m=this.getAbsoluteTransform(n);return s.forEach(function(y){const v=m.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.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,m,y;if(!e||e.length===0)return s;if(this._filterUpToDate)return i;let v=!0;for(let _=0;_<e.length;_++)if(typeof e[_]=="string"&&S5(),typeof e[_]!="string"||!S5()){v=!1;break}const b=s.pixelRatio;if(i.setSize(s.width/s.pixelRatio,s.height/s.pixelRatio),v){const _=e.join(" ");return o.save(),o.setAttr("filter",_),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),o.restore(),this._filterUpToDate=!0,i}try{for(d=e.length,o.clear(),o.drawImage(s._canvas,0,0,s.getWidth()/b,s.getHeight()/b),f=o.getImageData(0,0,i.getWidth(),i.getHeight()),m=0;m<d;m++)y=e[m],typeof y=="string"&&(y=tz(y)),y.call(this,f),o.putImageData(f,0,0)}catch(_){te.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(N5),e.length===3)return this._delegate.apply(this,e);const i=n.split(b1);for(let o=0;o<i.length;o++){const f=i[o].split("."),m=f[0],y=f[1]||"";this.eventListeners[m]||(this.eventListeners[m]=[]),this.eventListeners[m].push({name:y,handler:s})}return this}off(e,n){let s=(e||"").split(b1),i=s.length,o,d,f,m,y,v;if(this._cache&&this._cache.delete(N5),!e)for(d in this.eventListeners)this._off(d);for(o=0;o<i;o++)if(f=s[o],m=f.split("."),y=m[0],v=m[1],y)this.eventListeners[y]&&this._off(y,v,n);else for(d in this.eventListeners)this._off(d,v,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=te.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(so),this._clearSelfAndDescendantCache(x1),this._clearSelfAndDescendantCache(_5),this._clearSelfAndDescendantCache(w5),this._clearSelfAndDescendantCache(wb),this._clearSelfAndDescendantCache(jb)}_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"+te._capitalize(e);return te._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!==az&&(s=C5+te._capitalize(n),te._isFunction(this[s])?this[s](e[n]):this._setAttr(n,e[n]))}),this}isListening(){return this._getCache(jb,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(wb,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&&!Me.hitOnDragEnabled&&(i||Me.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 m(v){for(i=[],o=v.length,d=0;d<o;d++)f=v[d],s++,f.nodeType!==j5&&(i=i.concat(f.getChildren().slice())),f._id===n._id&&(d=o);i.length>0&&i[0].getDepth()<=e&&m(i)}const y=this.getStage();return n.nodeType!==dz&&y&&m(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(yu),this._clearSelfAndDescendantCache(so)),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 wr,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(yu);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(yu),this._clearSelfAndDescendantCache(so),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 te.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 te.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 te.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 te.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 te.warn("Node has no parent. zIndex parameter is ignored."),this;(e<0||e>=this.parent.children.length)&&te.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(x1,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=te.isObject(s)&&!te._isPlainObject(s)&&!te._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 te._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],te.isValidSelector(o)||(te.warn('Selector "'+o+'" is invalid. Allowed selectors examples are "#foo", ".bar" or "Group".'),te.warn('If you have a custom shape with such className, please change it to start with upper letter like "Triangle".'),te.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(w5,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(so,this._getAbsoluteTransform)}_getAbsoluteTransform(e){let n;if(e)return n=new wr,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(so)||new wr,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(yu,this._getTransform)}_getTransform(){var e,n;const s=this._cache.get(yu)||new wr;s.reset();const i=this.x(),o=this.y(),d=Me.getAngle(this.rotation()),f=(e=this.attrs.scaleX)!==null&&e!==void 0?e:1,m=(n=this.attrs.scaleY)!==null&&n!==void 0?n:1,y=this.attrs.skewX||0,v=this.attrs.skewY||0,b=this.attrs.offsetX||0,_=this.attrs.offsetY||0;return(i!==0||o!==0)&&s.translate(i,o),d!==0&&s.rotate(d),(y!==0||v!==0)&&s.skew(y,v),(f!==1||m!==1)&&s.scale(f,m),(b!==0||_!==0)&&s.translate(-1*b,-1*_),s.dirty=!1,s}clone(e){let n=te.cloneObject(this.attrs),s,i,o,d,f;for(s in e)n[s]=e[s];const m=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(sz)<0&&(m.eventListeners[s]||(m.eventListeners[s]=[]),m.eventListeners[s].push(f));return m}_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 bu({width:e.width||Math.ceil(n.width)||(s?s.width():0),height:e.height||Math.ceil(n.height)||(s?s.height():0),pixelRatio:d}),m=f.getContext(),y=new bu({width:f.width/f.pixelRatio+Math.abs(i),height:f.height/f.pixelRatio+Math.abs(o),pixelRatio:f.pixelRatio});return e.imageSmoothingEnabled===!1&&(m._context.imageSmoothingEnabled=!1),m.save(),(i||o)&&m.translate(-1*i,-1*o),this.drawScene(f,void 0,y),m.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,te._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():Me.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+nz,{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[C5+te._capitalize(e)];return te._isFunction(s)?s.call(this,n):this._setAttr(e,n),this}_requestDraw(){if(Me.autoDrawEnabled){const e=this.getLayer()||this.getStage();e==null||e.batchDraw()}}_setAttr(e,n){const s=this.attrs[e];s===n&&!te.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===j5&&(n.target=this);const i=[rz,iz,lz,oz,uz,cz];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 m=(s=(n=f.eventListeners)===null||n===void 0?void 0:n[e])!==null&&s!==void 0?s:[];d.push(...m),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:te.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)||Me.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 te.haveIntersection(s,this.getClientRect())}static create(e,n){return te._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),Me[s]||(te.warn('Can not find a node with class name "'+s+'". Fallback to "Shape".'),s="Shape");const m=Me[s];if(o=new m(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(fz,function(){if(this._batchingTransformChange){this._needClearTransformCache=!0;return}this._clearCache(yu),this._clearSelfAndDescendantCache(so)});Ae.prototype.on("visibleChange.konva",function(){this._clearSelfAndDescendantCache(wb)});Ae.prototype.on("listeningChange.konva",function(){this._clearSelfAndDescendantCache(jb)});Ae.prototype.on("opacityChange.konva",function(){this._clearSelfAndDescendantCache(x1)});const gn=K.addGetterSetter;gn(Ae,"zIndex");gn(Ae,"absolutePosition");gn(Ae,"position");gn(Ae,"x",0,Te());gn(Ae,"y",0,Te());gn(Ae,"globalCompositeOperation","source-over",id());gn(Ae,"opacity",1,Te());gn(Ae,"name","",id());gn(Ae,"id","",id());gn(Ae,"rotation",0,Te());K.addComponentsGetterSetter(Ae,"scale",["x","y"]);gn(Ae,"scaleX",1,Te());gn(Ae,"scaleY",1,Te());K.addComponentsGetterSetter(Ae,"skew",["x","y"]);gn(Ae,"skewX",0,Te());gn(Ae,"skewY",0,Te());K.addComponentsGetterSetter(Ae,"offset",["x","y"]);gn(Ae,"offsetX",0,Te());gn(Ae,"offsetY",0,Te());gn(Ae,"dragDistance",void 0,Te());gn(Ae,"width",0,Te());gn(Ae,"height",0,Te());gn(Ae,"listening",!0,Mi());gn(Ae,"preventDefault",!0,Mi());gn(Ae,"filters",void 0,function(t){return this._filterUpToDate=!1,t});gn(Ae,"visible",!0,Mi());gn(Ae,"transformsEnabled","all",id());gn(Ae,"size");gn(Ae,"dragBoundFunc");gn(Ae,"draggable",!1,Mi());K.backCompat(Ae,{rotateDeg:"rotate",setRotationDeg:"setRotation",getRotationDeg:"getRotation"});class Er 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(),m=f&&f.scene,y=o&&o.isCache;if(!this.isVisible()&&!y)return this;if(m){d.save();const v=this.getAbsoluteTransform(n).getMatrix();d.transform(v[0],v[1],v[2],v[3],v[4],v[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 m=this.getAbsoluteTransform(n).getMatrix();o.transform(m[0],m[1],m[2],m[3],m[4],m[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(),m=this.clipHeight(),y=this.clipFunc(),v=typeof f=="number"&&typeof m=="number"||y,b=s===this;if(v){d.save();const j=this.getAbsoluteTransform(s);let w=j.getMatrix();d.transform(w[0],w[1],w[2],w[3],w[4],w[5]),d.beginPath();let R;if(y)R=y.call(this,d,this);else{const O=this.clipX(),T=this.clipY();d.rect(O||0,T||0,f,m)}d.clip.apply(d,R),w=j.copy().invert().getMatrix(),d.transform(w[0],w[1],w[2],w[3],w[4],w[5])}const _=!b&&this.globalCompositeOperation()!=="source-over"&&e==="drawScene";_&&(d.save(),d._applyGlobalCompositeOperation(this)),(o=this.children)===null||o===void 0||o.forEach(function(j){j[e](n,s,i)}),_&&d.restore(),v&&d.restore()}getClientRect(e={}){var n;const s=e.skipTransform,i=e.relativeTo;let o,d,f,m,y={x:1/0,y:1/0,width:0,height:0};const v=this;(n=this.children)===null||n===void 0||n.forEach(function(j){if(!j.visible())return;const w=j.getClientRect({relativeTo:v,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,m=w.y+w.height):(o=Math.min(o,w.x),d=Math.min(d,w.y),f=Math.max(f,w.x+w.width),m=Math.max(m,w.y+w.height)))});const b=this.find("Shape");let _=!1;for(let j=0;j<b.length;j++)if(b[j]._isVisible(this)){_=!0;break}return _&&o!==void 0?y={x:o,y:d,width:f-o,height:m-d}:y={x:0,y:0,width:0,height:0},s?y:this._transformedRect(y,i)}}K.addComponentsGetterSetter(Er,"clip",["x","y","width","height"]);K.addGetterSetter(Er,"clipX",void 0,Te());K.addGetterSetter(Er,"clipY",void 0,Te());K.addGetterSetter(Er,"clipWidth",void 0,Te());K.addGetterSetter(Er,"clipHeight",void 0,Te());K.addGetterSetter(Er,"clipFunc");const km=new Map,v8=Me._global.PointerEvent!==void 0;function vx(t){return km.get(t)}function Ov(t){return{evt:t,pointerId:t.pointerId}}function S8(t,e){return km.get(t)===e}function N8(t,e){bm(t),e.getStage()&&(km.set(t,e),v8&&e._fire("gotpointercapture",Ov(new PointerEvent("gotpointercapture"))))}function bm(t,e){const n=km.get(t);if(!n)return;const s=n.getStage();s&&s.content,km.delete(t),v8&&n._fire("lostpointercapture",Ov(new PointerEvent("lostpointercapture")))}const pz="Stage",mz="string",E5="px",gz="mouseout",_8="mouseleave",C8="mouseover",j8="mouseenter",w8="mousemove",E8="mousedown",T8="mouseup",um="pointermove",cm="pointerdown",zf="pointerup",dm="pointercancel",yz="lostpointercapture",s1="pointerout",fm="pointerleave",r1="pointerover",i1="pointerenter",Eb="contextmenu",R8="touchstart",O8="touchend",A8="touchmove",M8="touchcancel",Tb="wheel",xz=5,bz=[[j8,"_pointerenter"],[E8,"_pointerdown"],[w8,"_pointermove"],[T8,"_pointerup"],[_8,"_pointerleave"],[R8,"_pointerdown"],[A8,"_pointermove"],[O8,"_pointerup"],[M8,"_pointercancel"],[C8,"_pointerover"],[Tb,"_wheel"],[Eb,"_contextmenu"],[cm,"_pointerdown"],[um,"_pointermove"],[zf,"_pointerup"],[dm,"_pointercancel"],[fm,"_pointerleave"],[yz,"_lostpointercapture"]],Sx={mouse:{[s1]:gz,[fm]:_8,[r1]:C8,[i1]:j8,[um]:w8,[cm]:E8,[zf]:T8,[dm]:"mousecancel",pointerclick:"click",pointerdblclick:"dblclick"},touch:{[s1]:"touchout",[fm]:"touchleave",[r1]:"touchover",[i1]:"touchenter",[um]:A8,[cm]:R8,[zf]:O8,[dm]:M8,pointerclick:"tap",pointerdblclick:"dbltap"},pointer:{[s1]:s1,[fm]:fm,[r1]:r1,[i1]:i1,[um]:um,[cm]:cm,[zf]:zf,[dm]:dm,pointerclick:"pointerclick",pointerdblclick:"pointerdblclick"}},hm=t=>t.indexOf("pointer")>=0?"pointer":t.indexOf("touch")>=0?"touch":"mouse",Tf=t=>{const e=hm(t);if(e==="pointer")return Me.pointerEventsEnabled&&Sx.pointer;if(e==="touch")return Sx.touch;if(e==="mouse")return Sx.mouse};function T5(t={}){return(t.clipFunc||t.clipWidth||t.clipHeight)&&te.warn("Stage does not support clipping. Please use clip for Layers or Groups."),t}const vz="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);",vm=[];let ay=class extends Er{constructor(e){super(T5(e)),this._pointerPositions=[],this._changedPointerPositions=[],this._buildDOM(),this._bindContentEvents(),vm.push(this),this.on("widthChange.konva heightChange.konva",this._resizeDOM),this.on("visibleChange.konva",this._checkVisibility),this.on("clipWidthChange.konva clipHeightChange.konva clipFuncChange.konva",()=>{T5(this.attrs)}),this._checkVisibility()}_validateAdd(e){const n=e.getType()==="Layer",s=e.getType()==="FastLayer";n||s||te.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===mz){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"),Er.prototype.clone.call(this,e)}destroy(){super.destroy();const e=this.content;e&&te._isInDocument(e)&&this.container().removeChild(e);const n=vm.indexOf(this);return n>-1&&vm.splice(n,1),te.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}:(te.warn(vz),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 bu({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+E5,this.content.style.height=n+E5),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>xz&&te.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(),Me.isBrowser&&this.content.appendChild(e.canvas._canvas),this}getParent(){return null}getLayer(){return null}hasPointerCapture(e){return S8(e,this)}setPointerCapture(e){N8(e,this)}releaseCapture(e){bm(e)}getLayers(){return this.children}_bindContentEvents(){Me.isBrowser&&bz.forEach(([e,n])=>{this.content.addEventListener(e,s=>{this[n](s)},{passive:!1})})}_pointerenter(e){this.setPointersPositions(e);const n=Tf(e.type);n&&this._fire(n.pointerenter,{evt:e,target:this,currentTarget:this})}_pointerover(e){this.setPointersPositions(e);const n=Tf(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=Tf(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);const i=this._getTargetShape(s),o=!(Me.isDragging()||Me.isTransforming())||Me.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=Tf(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);let i=!1;this._changedPointerPositions.forEach(o=>{const d=this.getIntersection(o);if(Yt.justDragged=!1,Me["_"+s+"ListenClick"]=!0,!d||!d.isListening()){this[s+"ClickStartShape"]=void 0;return}Me.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=Tf(e.type),s=hm(e.type);if(!n)return;const i=e.type.indexOf("touch")>=0||e.pointerType==="touch";if(Me.isDragging()&&Yt.node.preventDefault()&&e.cancelable&&i&&e.preventDefault(),this.setPointersPositions(e),!(!(Me.isDragging()||Me.isTransforming())||Me.hitOnDragEnabled))return;const d={};let f=!1;const m=this._getTargetShape(s);this._changedPointerPositions.forEach(y=>{const v=vx(y.id)||this.getIntersection(y),b=y.id,_={evt:e,pointerId:b},j=m!==v;if(j&&m&&(m._fireAndBubble(n.pointerout,{..._},v),m._fireAndBubble(n.pointerleave,{..._},v)),v){if(d[v._id])return;d[v._id]=!0}v&&v.isListening()?(f=!0,j&&(v._fireAndBubble(n.pointerover,{..._},m),v._fireAndBubble(n.pointerenter,{..._},m),this[s+"targetShape"]=v),v._fireAndBubble(n.pointermove,{..._})):m&&(this._fire(n.pointerover,{evt:e,target:this,currentTarget:this,pointerId:b}),this[s+"targetShape"]=null)}),f||this._fire(n.pointermove,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id})}_pointerup(e){const n=Tf(e.type),s=hm(e.type);if(!n)return;this.setPointersPositions(e);const i=this[s+"ClickStartShape"],o=this[s+"ClickEndShape"],d={};let f=!1;this._changedPointerPositions.forEach(m=>{const y=vx(m.id)||this.getIntersection(m);if(y){if(y.releaseCapture(m.id),d[y._id])return;d[y._id]=!0}const v=m.id,b={evt:e,pointerId:v};let _=!1;Me["_"+s+"InDblClickWindow"]?(_=!0,clearTimeout(this[s+"DblTimeout"])):Yt.justDragged||(Me["_"+s+"InDblClickWindow"]=!0,clearTimeout(this[s+"DblTimeout"])),this[s+"DblTimeout"]=setTimeout(function(){Me["_"+s+"InDblClickWindow"]=!1},Me.dblClickWindow),y&&y.isListening()?(f=!0,this[s+"ClickEndShape"]=y,y._fireAndBubble(n.pointerup,{...b}),Me["_"+s+"ListenClick"]&&i&&i===y&&(y._fireAndBubble(n.pointerclick,{...b}),_&&o&&o===y&&y._fireAndBubble(n.pointerdblclick,{...b}))):(this[s+"ClickEndShape"]=null,f||(this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),f=!0),Me["_"+s+"ListenClick"]&&this._fire(n.pointerclick,{evt:e,target:this,currentTarget:this,pointerId:v}),_&&this._fire(n.pointerdblclick,{evt:e,target:this,currentTarget:this,pointerId:v}))}),f||this._fire(n.pointerup,{evt:e,target:this,currentTarget:this,pointerId:this._changedPointerPositions[0].id}),Me["_"+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(Eb,{evt:e}):this._fire(Eb,{evt:e,target:this,currentTarget:this})}_wheel(e){this.setPointersPositions(e);const n=this.getIntersection(this.getPointerPosition());n&&n.isListening()?n._fireAndBubble(Tb,{evt:e}):this._fire(Tb,{evt:e,target:this,currentTarget:this})}_pointercancel(e){this.setPointersPositions(e);const n=vx(e.pointerId)||this.getIntersection(this.getPointerPosition());n&&n._fireAndBubble(zf,Ov(e)),bm(e.pointerId)}_lostpointercapture(e){bm(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:te._getFirstPointerId(e)}],this._changedPointerPositions=[{x:s,y:i,id:te._getFirstPointerId(e)}])}_setPointerPosition(e){te.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 bu({width:this.width(),height:this.height()}),this.bufferHitCanvas=new Tv({pixelRatio:1,width:this.width(),height:this.height()}),!Me.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 te.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}};ay.prototype.nodeType=pz;$n(ay);K.addGetterSetter(ay,"container");Me.isBrowser&&document.addEventListener("visibilitychange",()=>{vm.forEach(t=>{t.batchDraw()})});const D8="hasShadow",z8="shadowRGBA",k8="patternImage",L8="linearGradient",U8="radialGradient";let l1;function Nx(){return l1||(l1=te.createCanvasElement().getContext("2d"),l1)}const Sm={};function Sz(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function Nz(t){t.stroke()}function _z(t){const e=this.attrs.fillRule;e?t.fill(e):t.fill()}function Cz(t){t.stroke()}function jz(){this._clearCache(D8)}function wz(){this._clearCache(z8)}function Ez(){this._clearCache(k8)}function Tz(){this._clearCache(L8)}function Rz(){this._clearCache(U8)}class we extends Ae{constructor(e){super(e);let n,s=0;for(;n=te.getHitColor(),!(n&&!(n in Sm));)if(s++,s>=1e4){te.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=te.getRandomColor();break}this.colorKey=n,Sm[n]=this}getContext(){return te.warn("shape.getContext() method is deprecated. Please do not use it."),this.getLayer().getContext()}getCanvas(){return te.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(D8,this._hasShadow)}_hasShadow(){return this.shadowEnabled()&&this.shadowOpacity()!==0&&!!(this.shadowColor()||this.shadowBlur()||this.shadowOffsetX()||this.shadowOffsetY())}_getFillPattern(){return this._getCache(k8,this.__getFillPattern)}__getFillPattern(){if(this.fillPatternImage()){const n=Nx().createPattern(this.fillPatternImage(),this.fillPatternRepeat()||"repeat");if(n&&n.setTransform){const s=new wr;s.translate(this.fillPatternX(),this.fillPatternY()),s.rotate(Me.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(L8,this.__getLinearGradient)}__getLinearGradient(){const e=this.fillLinearGradientColorStops();if(e){const n=Nx(),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(U8,this.__getRadialGradient)}__getRadialGradient(){const e=this.fillRadialGradientColorStops();if(e){const n=Nx(),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(z8,this._getShadowRGBA)}_getShadowRGBA(){if(!this.hasShadow())return;const e=te.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 Sm[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(),m=this.shadowForStrokeEnabled();return!!(i&&o&&f&&m)}setStrokeHitEnabled(e){te.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(),m=!e.skipStroke&&this.hasStroke()&&this.strokeWidth()||0,y=d.width+m,v=d.height+m,b=!e.skipShadow&&this.hasShadow(),_=b?this.shadowOffsetX():0,j=b?this.shadowOffsetY():0,w=y+Math.abs(_),R=v+Math.abs(j),O=b&&this.shadowBlur()||0,T=w+O*2,A=R+O*2,z={width:T,height:A,x:-(m/2+O)+Math.min(_,0)+d.x,y:-(m/2+O)+Math.min(j,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(),m=this.getSceneFunc(),y=this.hasShadow();let v;const b=n===this;if(!this.isVisible()&&!b)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(!m)return this;if(d.save(),this._useBufferCanvas()){v=this.getStage();const _=s||v.bufferCanvas,j=_.getContext();s?(j.save(),j.setTransform(1,0,0,1,0,0),j.clearRect(0,0,_.width,_.height),j.restore()):j.clear(),j.save(),j._applyLineJoin(this),j._applyMiterLimit(this);const w=this.getAbsoluteTransform(n).getMatrix();j.transform(w[0],w[1],w[2],w[3],w[4],w[5]),m.call(this,j,this),j.restore();const R=_.pixelRatio;y&&d._applyShadow(this),b||(d._applyOpacity(this),d._applyGlobalCompositeOperation(this)),d.drawImage(_._canvas,_.x||0,_.y||0,_.width/R,_.height/R)}else{if(d._applyLineJoin(this),d._applyMiterLimit(this),!b){const _=this.getAbsoluteTransform(n).getMatrix();d.transform(_[0],_[1],_[2],_[3],_[4],_[5]),d._applyOpacity(this),d._applyGlobalCompositeOperation(this)}y&&d._applyShadow(this),m.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(),m=this._getCanvasCache(),y=m&&m.hit;if(this.colorKey||te.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 b=this.getAbsoluteTransform(n).getMatrix();return d.transform(b[0],b[1],b[2],b[3],b[4],b[5]),this._drawCachedHitCanvas(d),d.restore(),this}if(!f)return this;if(d.save(),d._applyLineJoin(this),d._applyMiterLimit(this),!(this===n)){const b=this.getAbsoluteTransform(n).getMatrix();d.transform(b[0],b[1],b[2],b[3],b[4],b[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 m=o.getImageData(0,0,d,f),y=m.data,v=y.length,b=te._hexToRgb(this.colorKey);for(let _=0;_<v;_+=4)y[_+3]>e?(y[_]=b.r,y[_+1]=b.g,y[_+2]=b.b,y[_+3]=255):y[_+3]=0;o.putImageData(m,0,0)}catch(m){te.error("Unable to draw hit graph from cached scene canvas. "+m.message)}return this}hasPointerCapture(e){return S8(e,this)}setPointerCapture(e){N8(e,this)}releaseCapture(e){bm(e)}}we.prototype._fillFunc=Sz;we.prototype._strokeFunc=Nz;we.prototype._fillFuncHit=_z;we.prototype._strokeFuncHit=Cz;we.prototype._centroid=!1;we.prototype.nodeType="Shape";$n(we);we.prototype.eventListeners={};we.prototype.on("shadowColorChange.konva shadowBlurChange.konva shadowOffsetChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",jz);we.prototype.on("shadowColorChange.konva shadowOpacityChange.konva shadowEnabledChange.konva",wz);we.prototype.on("fillPriorityChange.konva fillPatternImageChange.konva fillPatternRepeatChange.konva fillPatternScaleXChange.konva fillPatternScaleYChange.konva fillPatternOffsetXChange.konva fillPatternOffsetYChange.konva fillPatternXChange.konva fillPatternYChange.konva fillPatternRotationChange.konva",Ez);we.prototype.on("fillPriorityChange.konva fillLinearGradientColorStopsChange.konva fillLinearGradientStartPointXChange.konva fillLinearGradientStartPointYChange.konva fillLinearGradientEndPointXChange.konva fillLinearGradientEndPointYChange.konva",Tz);we.prototype.on("fillPriorityChange.konva fillRadialGradientColorStopsChange.konva fillRadialGradientStartPointXChange.konva fillRadialGradientStartPointYChange.konva fillRadialGradientEndPointXChange.konva fillRadialGradientEndPointYChange.konva fillRadialGradientStartRadiusChange.konva fillRadialGradientEndRadiusChange.konva",Rz);K.addGetterSetter(we,"stroke",void 0,b8());K.addGetterSetter(we,"strokeWidth",2,Te());K.addGetterSetter(we,"fillAfterStrokeEnabled",!1);K.addGetterSetter(we,"hitStrokeWidth","auto",Rv());K.addGetterSetter(we,"strokeHitEnabled",!0,Mi());K.addGetterSetter(we,"perfectDrawEnabled",!0,Mi());K.addGetterSetter(we,"shadowForStrokeEnabled",!0,Mi());K.addGetterSetter(we,"lineJoin");K.addGetterSetter(we,"lineCap");K.addGetterSetter(we,"miterLimit");K.addGetterSetter(we,"sceneFunc");K.addGetterSetter(we,"hitFunc");K.addGetterSetter(we,"dash");K.addGetterSetter(we,"dashOffset",0,Te());K.addGetterSetter(we,"shadowColor",void 0,id());K.addGetterSetter(we,"shadowBlur",0,Te());K.addGetterSetter(we,"shadowOpacity",1,Te());K.addComponentsGetterSetter(we,"shadowOffset",["x","y"]);K.addGetterSetter(we,"shadowOffsetX",0,Te());K.addGetterSetter(we,"shadowOffsetY",0,Te());K.addGetterSetter(we,"fillPatternImage");K.addGetterSetter(we,"fill",void 0,b8());K.addGetterSetter(we,"fillPatternX",0,Te());K.addGetterSetter(we,"fillPatternY",0,Te());K.addGetterSetter(we,"fillLinearGradientColorStops");K.addGetterSetter(we,"strokeLinearGradientColorStops");K.addGetterSetter(we,"fillRadialGradientStartRadius",0);K.addGetterSetter(we,"fillRadialGradientEndRadius",0);K.addGetterSetter(we,"fillRadialGradientColorStops");K.addGetterSetter(we,"fillPatternRepeat","repeat");K.addGetterSetter(we,"fillEnabled",!0);K.addGetterSetter(we,"strokeEnabled",!0);K.addGetterSetter(we,"shadowEnabled",!0);K.addGetterSetter(we,"dashEnabled",!0);K.addGetterSetter(we,"strokeScaleEnabled",!0);K.addGetterSetter(we,"fillPriority","color");K.addComponentsGetterSetter(we,"fillPatternOffset",["x","y"]);K.addGetterSetter(we,"fillPatternOffsetX",0,Te());K.addGetterSetter(we,"fillPatternOffsetY",0,Te());K.addComponentsGetterSetter(we,"fillPatternScale",["x","y"]);K.addGetterSetter(we,"fillPatternScaleX",1,Te());K.addGetterSetter(we,"fillPatternScaleY",1,Te());K.addComponentsGetterSetter(we,"fillLinearGradientStartPoint",["x","y"]);K.addComponentsGetterSetter(we,"strokeLinearGradientStartPoint",["x","y"]);K.addGetterSetter(we,"fillLinearGradientStartPointX",0);K.addGetterSetter(we,"strokeLinearGradientStartPointX",0);K.addGetterSetter(we,"fillLinearGradientStartPointY",0);K.addGetterSetter(we,"strokeLinearGradientStartPointY",0);K.addComponentsGetterSetter(we,"fillLinearGradientEndPoint",["x","y"]);K.addComponentsGetterSetter(we,"strokeLinearGradientEndPoint",["x","y"]);K.addGetterSetter(we,"fillLinearGradientEndPointX",0);K.addGetterSetter(we,"strokeLinearGradientEndPointX",0);K.addGetterSetter(we,"fillLinearGradientEndPointY",0);K.addGetterSetter(we,"strokeLinearGradientEndPointY",0);K.addComponentsGetterSetter(we,"fillRadialGradientStartPoint",["x","y"]);K.addGetterSetter(we,"fillRadialGradientStartPointX",0);K.addGetterSetter(we,"fillRadialGradientStartPointY",0);K.addComponentsGetterSetter(we,"fillRadialGradientEndPoint",["x","y"]);K.addGetterSetter(we,"fillRadialGradientEndPointX",0);K.addGetterSetter(we,"fillRadialGradientEndPointY",0);K.addGetterSetter(we,"fillPatternRotation",0);K.addGetterSetter(we,"fillRule",void 0,id());K.backCompat(we,{dashArray:"dash",getDashArray:"getDash",setDashArray:"getDash",drawFunc:"sceneFunc",getDrawFunc:"getSceneFunc",setDrawFunc:"setSceneFunc",drawHitFunc:"hitFunc",getDrawHitFunc:"getHitFunc",setDrawHitFunc:"setHitFunc"});const Oz="beforeDraw",Az="draw",H8=[{x:0,y:0},{x:-1,y:-1},{x:1,y:-1},{x:1,y:1},{x:-1,y:1}],Mz=H8.length;let ld=class extends Er{constructor(e){super(e),this.canvas=new bu,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&&te._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"&&te.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(){te.warn('Can not change width of layer. Use "stage.width(value)" function instead.')}getHeight(){if(this.parent)return this.parent.height()}setHeight(){te.warn('Can not change height of layer. Use "stage.height(value)" function instead.')}batchDraw(){return this._waitingForDraw||(this._waitingForDraw=!0,te.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<Mz;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=te.getHitColorKey(s[0],s[1],s[2]),d=Sm[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(Oz,{node:this}),this.clearBeforeDraw()&&o.getContext().clear(),Er.prototype.drawScene.call(this,o,n,s),this._fire(Az,{node:this}),this}drawHit(e,n){const s=this.getLayer(),i=e||s&&s.hitCanvas;return s&&s.clearBeforeDraw()&&s.getHitCanvas().getContext().clear(),Er.prototype.drawHit.call(this,i,n),this}enableHitGraph(){return this.hitGraphEnabled(!0),this}disableHitGraph(){return this.hitGraphEnabled(!1),this}setHitGraphEnabled(e){te.warn("hitGraphEnabled method is deprecated. Please use layer.listening() instead."),this.listening(e)}getHitGraphEnabled(e){return te.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 te.releaseCanvas(this.getNativeCanvasElement(),this.getHitCanvas()._canvas),super.destroy()}};ld.prototype.nodeType="Layer";$n(ld);K.addGetterSetter(ld,"imageSmoothingEnabled",!0);K.addGetterSetter(ld,"clearBeforeDraw",!0);K.addGetterSetter(ld,"hitGraphEnabled",!0,Mi());class Av extends ld{constructor(e){super(e),this.listening(!1),te.warn('Konva.Fast layer is deprecated. Please use "new Konva.Layer({ listening: false })" instead.')}}Av.prototype.nodeType="FastLayer";$n(Av);let ah=class extends Er{_validateAdd(e){const n=e.getType();n!=="Group"&&n!=="Shape"&&te.throw("You may only add groups and shapes to groups.")}};ah.prototype.nodeType="Group";$n(ah);const _x=(function(){return Hc.performance&&Hc.performance.now?function(){return Hc.performance.now()}:function(){return new Date().getTime()}})();class ii{constructor(e,n){this.id=ii.animIdCounter++,this.frame={time:0,timeDiff:0,lastTime:_x(),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=ii.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=_x(),ii._addAnimation(this),this}stop(){return ii._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(_x());const f=o.length;let m;if(d?m=d.call(i,i.frame)!==!1:m=!0,!!m)for(let y=0;y<f;y++){const v=o[y];v._id!==void 0&&(e[v._id]=v)}}for(const s in e)e.hasOwnProperty(s)&&e[s].batchDraw()}static _animationLoop(){const e=ii;e.animations.length?(e._runFrames(),te.requestAnimFrame(e._animationLoop)):e.animRunning=!1}static _handleAnimation(){this.animRunning||(this.animRunning=!0,te.requestAnimFrame(this._animationLoop))}}ii.animations=[];ii.animIdCounter=0;ii.animRunning=!1;const Dz={node:1,duration:1,easing:1,onFinish:1,yoyo:1},zz=1,R5=2,O5=3,A5=["fill","stroke","shadowColor"];let kz=0;class Lz{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=R5,this._startTime=this.getTimer()-this._time,this.onEnterFrame(),this.fire("onPlay")}reverse(){this.state=O5,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===R5?this.setTime(e):this.state===O5&&this.setTime(this.duration-e)}pause(){this.state=zz,this.fire("onPause")}getTimer(){return new Date().getTime()}}class _n{constructor(e){const n=this,s=e.node,i=s._id,o=e.easing||Nm.Linear,d=!!e.yoyo;let f,m;typeof e.duration>"u"?f=.3:e.duration===0?f=.001:f=e.duration,this.node=s,this._id=kz++;const y=s.getLayer()||(s instanceof Me.Stage?s.getLayers():null);y||te.error("Tween constructor have `node` that is not in a layer. Please add node into layer first."),this.anim=new ii(function(){n.tween.onEnterFrame()},y),this.tween=new Lz(m,function(v){n._tweenFunc(v)},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(m in e)Dz[m]===void 0&&this._addAttr(m,e[m]);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,m,y;const v=_n.tweens[i][e];v&&delete _n.attrs[i][v][e];let b=s.getAttr(e);if(te._isArray(n))if(o=[],d=Math.max(n.length,b.length),e==="points"&&n.length!==b.length&&(n.length>b.length?(m=b,b=te._prepareArrayForTween(b,n,s.closed())):(f=n,n=te._prepareArrayForTween(n,b,s.closed()))),e.indexOf("fill")===0)for(let _=0;_<d;_++)if(_%2===0)o.push(n[_]-b[_]);else{const j=te.colorToRGBA(b[_]);y=te.colorToRGBA(n[_]),b[_]=j,o.push({r:y.r-j.r,g:y.g-j.g,b:y.b-j.b,a:y.a-j.a})}else for(let _=0;_<d;_++)o.push(n[_]-b[_]);else A5.indexOf(e)!==-1?(b=te.colorToRGBA(b),y=te.colorToRGBA(n),o={r:y.r-b.r,g:y.g-b.g,b:y.b-b.b,a:y.a-b.a}):o=n-b;_n.attrs[i][this._id][e]={start:b,diff:o,end:n,trueEnd:f,trueStart:m},_n.tweens[i][e]=this._id}_tweenFunc(e){const n=this.node,s=_n.attrs[n._id][this._id];let i,o,d,f,m,y,v,b;for(i in s){if(o=s[i],d=o.start,f=o.diff,b=o.end,te._isArray(d))if(m=[],v=Math.max(d.length,b.length),i.indexOf("fill")===0)for(y=0;y<v;y++)y%2===0?m.push((d[y]||0)+f[y]*e):m.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<v;y++)m.push((d[y]||0)+f[y]*e);else A5.indexOf(i)!==-1?m="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)+")":m=d+f*e;n.setAttr(i,m)}}_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 Nm={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-Nm.BounceEaseOut(s-t,0,n,s)+e},BounceEaseInOut(t,e,n,s){return t<s/2?Nm.BounceEaseIn(t*2,0,n,s)*.5+e:Nm.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}},sh=te._assign(Me,{Util:te,Transform:wr,Node:Ae,Container:Er,Stage:ay,stages:vm,Layer:ld,FastLayer:Av,Group:ah,DD:Yt,Shape:we,shapes:Sm,Animation:ii,Tween:_n,Easings:Nm,Context:ty,Canvas:Ev});class go extends we{_sceneFunc(e){const n=Me.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=Me.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)),m=Math.sin(Math.min(i,Math.PI/2)),y=o*(o>0?e:n),v=d*n,b=f*(f>0?e:n),_=m*(m>0?n:e);return{x:y,y:s?-1*_:b,width:v-y,height:_-b}}}go.prototype._centroid=!0;go.prototype.className="Arc";go.prototype._attrsAffectingSize=["innerRadius","outerRadius","angle","clockwise"];$n(go);K.addGetterSetter(go,"innerRadius",0,Te());K.addGetterSetter(go,"outerRadius",0,Te());K.addGetterSetter(go,"angle",0,Te());K.addGetterSetter(go,"clockwise",!1,Mi());function Rb(t,e,n,s,i,o,d){const f=Math.sqrt(Math.pow(n-t,2)+Math.pow(s-e,2)),m=Math.sqrt(Math.pow(i-n,2)+Math.pow(o-s,2)),y=d*f/(f+m),v=d*m/(f+m),b=n-y*(i-t),_=s-y*(o-e),j=n+v*(i-t),w=s+v*(o-e);return[b,_,j,w]}function M5(t,e){const n=t.length,s=[];for(let i=2;i<n-2;i+=2){const o=Rb(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 Uz(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 m=Math.sqrt(f);n.push((-o+m)/(2*i)),n.push((-o-m)/(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 yo=class extends we{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 m=this.getTensionPoints(),y=m.length;for(f=o?0:4,o||e.quadraticCurveTo(m[0],m[1],m[2],m[3]);f<y-2;)e.bezierCurveTo(m[f++],m[f++],m[f++],m[f++],m[f++],m[f++]);o||e.quadraticCurveTo(m[y-2],m[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():M5(this.points(),this.tension())}_getTensionPointsClosed(){const e=this.points(),n=e.length,s=this.tension(),i=Rb(e[n-2],e[n-1],e[0],e[1],e[2],e[3],s),o=Rb(e[n-4],e[n-3],e[n-2],e[n-1],e[0],e[1],s),d=M5(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],...Uz(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 m=0;m<e.length/2;m++)d=e[m*2],f=e[m*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}}};yo.prototype.className="Line";yo.prototype._attrsAffectingSize=["points","bezier","tension"];$n(yo);K.addGetterSetter(yo,"closed",!1);K.addGetterSetter(yo,"bezier",!1);K.addGetterSetter(yo,"tension",0,Te());K.addGetterSetter(yo,"points",[],$D());const Hz=[[],[],[-.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]],qz=[[],[],[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]],Bz=[[1],[1,1],[1,2,1],[1,3,3,1]],D5=(t,e,n)=>{let s,i;const d=n/2;s=0;for(let f=0;f<20;f++)i=d*Hz[20][f]+d,s+=qz[20][f]*Gz(t,e,i);return d*s},z5=(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),m=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 v=m/(2*f),b=y/f,_=n+v,j=b-v*v,w=_*_+j>0?Math.sqrt(_*_+j):0,R=v*v+j>0?Math.sqrt(v*v+j):0,O=v+Math.sqrt(v*v+j)!==0?j*Math.log(Math.abs((_+w)/(v+R))):0;return Math.sqrt(f)/2*(_*w-v*R+O)};function Gz(t,e,n){const s=Ob(1,n,t),i=Ob(1,n,e),o=s*s+i*i;return Math.sqrt(o)}const Ob=(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+=Bz[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 Ob(t-1,e,i)}},k5=(t,e,n)=>{let s=1,i=t/e,o=(t-n(i))/e,d=0;for(;s>.001;){const f=n(i+o),m=Math.abs(t-f)/e;if(m<s)s=m,i+=o;else{const y=n(i-o),v=Math.abs(t-y)/e;v<s?(s=v,i-=o):o/=2}if(d++,d>500)break}return i};class Cn extends we{constructor(e){super(e),this.dataArray=[],this.pathLength=0,this._readDataAttribute(),this.on("dataChange.konva",function(){this._readDataAttribute()})}_readDataAttribute(){this.dataArray=Cn.parsePathData(this.data()),this.pathLength=Cn.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],m=d[1],y=d[2],v=d[3],b=d[4],_=d[5],j=d[6],w=d[7],R=y>v?y:v,O=y>v?1:y/v,T=y>v?v/y:1;e.translate(f,m),e.rotate(j),e.scale(O,T),e.arc(0,0,R,b,b+_,1-w),e.scale(1/O,1/T),e.rotate(-j),e.translate(-f,-m);break;case"z":s=!0,e.closePath();break}}!s&&!this.hasFill()?e.strokeShape(this):e.fillStrokeShape(this)}getSelfRect(){let e=[];this.dataArray.forEach(function(m){if(m.command==="A"){const y=m.points[4],v=m.points[5],b=m.points[4]+v;let _=Math.PI/180;if(Math.abs(y-b)<_&&(_=Math.abs(y-b)),v<0)for(let j=y-_;j>b;j-=_){const w=Cn.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],j,0);e.push(w.x,w.y)}else for(let j=y+_;j<b;j+=_){const w=Cn.getPointOnEllipticalArc(m.points[0],m.points[1],m.points[2],m.points[3],j,0);e.push(w.x,w.y)}}else if(m.command==="C")for(let y=0;y<=1;y+=.01){const v=Cn.getPointOnCubicBezier(y,m.start.x,m.start.y,m.points[0],m.points[1],m.points[2],m.points[3],m.points[4],m.points[5]);e.push(v.x,v.y)}else e=e.concat(m.points)});let n=e[0],s=e[0],i=e[1],o=e[1],d,f;for(let m=0;m<e.length/2;m++)d=e[m*2],f=e[m*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 Cn.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 Cn.getPointOnLine(e,d.start.x,d.start.y,f[0],f[1]);case"C":return Cn.getPointOnCubicBezier(k5(e,Cn.getPathLength(n),R=>D5([d.start.x,f[0],f[2],f[4]],[d.start.y,f[1],f[3],f[5]],R)),d.start.x,d.start.y,f[0],f[1],f[2],f[3],f[4],f[5]);case"Q":return Cn.getPointOnQuadraticBezier(k5(e,Cn.getPathLength(n),R=>z5([d.start.x,f[0],f[2]],[d.start.y,f[1],f[3]],R)),d.start.x,d.start.y,f[0],f[1],f[2],f[3]);case"A":const m=f[0],y=f[1],v=f[2],b=f[3],_=f[5],j=f[6];let w=f[4];return w+=_*e/d.pathLength,Cn.getPointOnEllipticalArc(m,y,v,b,w,j)}return null}static getPointOnLine(e,n,s,i,o,d,f){d=d??n,f=f??s;const m=this.getLineLength(n,s,i,o);if(m<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),v=Math.sqrt(e*e/(1+y*y))*(i<n?-1:1),b=y*v;if(Math.abs(f-s-y*(d-n))<1e-10)return{x:d+v,y:f+b};const _=((d-n)*(i-n)+(f-s)*(o-s))/(m*m),j=n+_*(i-n),w=s+_*(o-s),R=this.getLineLength(d,f,j,w),O=Math.sqrt(e*e-R*R),T=Math.sqrt(O*O/(1+y*y))*(i<n?-1:1),A=y*T;return{x:j+T,y:w+A}}static getPointOnCubicBezier(e,n,s,i,o,d,f,m,y){function v(O){return O*O*O}function b(O){return 3*O*O*(1-O)}function _(O){return 3*O*(1-O)*(1-O)}function j(O){return(1-O)*(1-O)*(1-O)}const w=m*v(e)+d*b(e)+i*_(e)+n*j(e),R=y*v(e)+f*b(e)+o*_(e)+s*j(e);return{x:w,y:R}}static getPointOnQuadraticBezier(e,n,s,i,o,d,f){function m(j){return j*j}function y(j){return 2*j*(1-j)}function v(j){return(1-j)*(1-j)}const b=d*m(e)+i*y(e)+n*v(e),_=f*m(e)+o*y(e)+s*v(e);return{x:b,y:_}}static getPointOnEllipticalArc(e,n,s,i,o,d){const f=Math.cos(d),m=Math.sin(d),y={x:s*Math.cos(o),y:i*Math.sin(o)};return{x:e+(y.x*f-y.y*m),y:n+(y.x*m+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 b=0;b<s.length;b++)n=n.replace(new RegExp(s[b],"g"),"|"+s[b]);const i=n.split("|"),o=[],d=[];let f=0,m=0;const y=/([-+]?((\d+\.\d+)|((\d+)|(\.\d+)))(?:e[-+]?\d+)?)/gi;let v;for(let b=1;b<i.length;b++){let _=i[b],j=_.charAt(0);for(_=_.slice(1),d.length=0;v=y.exec(_);)d.push(v[0]);let w=[],R=j==="A"||j==="a"?0:-1;for(let O=0,T=d.length;O<T;O++){const A=d[O];if(A==="00"){w.push(0,0),R>=0&&(R+=2,R>=7&&(R-=7));continue}if(R>=0){if(R===3){if(/^[01]{2}\d+(?:\.\d+)?$/.test(A)){w.push(parseInt(A[0],10)),w.push(parseInt(A[1],10)),w.push(parseFloat(A.slice(2))),R+=3,R>=7&&(R-=7);continue}if(A==="11"||A==="10"||A==="01"){w.push(parseInt(A[0],10)),w.push(parseInt(A[1],10)),R+=2,R>=7&&(R-=7);continue}if(A==="0"||A==="1"){w.push(parseInt(A,10)),R+=1,R>=7&&(R-=7);continue}}else if(R===4){if(/^[01]\d+(?:\.\d+)?$/.test(A)){w.push(parseInt(A[0],10)),w.push(parseFloat(A.slice(1))),R+=2,R>=7&&(R-=7);continue}if(A==="0"||A==="1"){w.push(parseInt(A,10)),R+=1,R>=7&&(R-=7);continue}}const z=parseFloat(A);isNaN(z)?w.push(0):w.push(z),R+=1,R>=7&&(R-=7)}else{const z=parseFloat(A);isNaN(z)?w.push(0):w.push(z)}}for(;w.length>0&&!isNaN(w[0]);){let O="",T=[];const A=f,z=m;let k,P,H,B,L,V,Z,ue,ae,J;switch(j){case"l":f+=w.shift(),m+=w.shift(),O="L",T.push(f,m);break;case"L":f=w.shift(),m=w.shift(),T.push(f,m);break;case"m":const le=w.shift(),ce=w.shift();if(f+=le,m+=ce,O="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]+le,m=o[Y].points[1]+ce;break}}T.push(f,m),j="l";break;case"M":f=w.shift(),m=w.shift(),O="M",T.push(f,m),j="L";break;case"h":f+=w.shift(),O="L",T.push(f,m);break;case"H":f=w.shift(),O="L",T.push(f,m);break;case"v":m+=w.shift(),O="L",T.push(f,m);break;case"V":m=w.shift(),O="L",T.push(f,m);break;case"C":T.push(w.shift(),w.shift(),w.shift(),w.shift()),f=w.shift(),m=w.shift(),T.push(f,m);break;case"c":T.push(f+w.shift(),m+w.shift(),f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),O="C",T.push(f,m);break;case"S":P=f,H=m,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=m+(m-k.points[3])),T.push(P,H,w.shift(),w.shift()),f=w.shift(),m=w.shift(),O="C",T.push(f,m);break;case"s":P=f,H=m,k=o[o.length-1],k.command==="C"&&(P=f+(f-k.points[2]),H=m+(m-k.points[3])),T.push(P,H,f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),O="C",T.push(f,m);break;case"Q":T.push(w.shift(),w.shift()),f=w.shift(),m=w.shift(),T.push(f,m);break;case"q":T.push(f+w.shift(),m+w.shift()),f+=w.shift(),m+=w.shift(),O="Q",T.push(f,m);break;case"T":P=f,H=m,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=m+(m-k.points[1])),f=w.shift(),m=w.shift(),O="Q",T.push(P,H,f,m);break;case"t":P=f,H=m,k=o[o.length-1],k.command==="Q"&&(P=f+(f-k.points[0]),H=m+(m-k.points[1])),f+=w.shift(),m+=w.shift(),O="Q",T.push(P,H,f,m);break;case"A":B=w.shift(),L=w.shift(),V=w.shift(),Z=w.shift(),ue=w.shift(),ae=f,J=m,f=w.shift(),m=w.shift(),O="A",T=this.convertEndpointToCenterParameterization(ae,J,f,m,Z,ue,B,L,V);break;case"a":B=w.shift(),L=w.shift(),V=w.shift(),Z=w.shift(),ue=w.shift(),ae=f,J=m,f+=w.shift(),m+=w.shift(),O="A",T=this.convertEndpointToCenterParameterization(ae,J,f,m,Z,ue,B,L,V);break}o.push({command:O||j,points:T,start:{x:A,y:z},pathLength:this.calcLength(A,z,O||j,T)})}(j==="z"||j==="Z")&&o.push({command:"z",points:[],start:void 0,pathLength:0})}return o}static calcLength(e,n,s,i){let o,d,f,m;const y=Cn;switch(s){case"L":return y.getLineLength(e,n,i[0],i[1]);case"C":return D5([e,i[0],i[2],i[4]],[n,i[1],i[3],i[5]],1);case"Q":return z5([e,i[0],i[2]],[n,i[1],i[3]],1);case"A":o=0;const v=i[4],b=i[5],_=i[4]+b;let j=Math.PI/180;if(Math.abs(v-_)<j&&(j=Math.abs(v-_)),d=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],v,0),b<0)for(m=v-j;m>_;m-=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],m,0),o+=y.getLineLength(d.x,d.y,f.x,f.y),d=f;else for(m=v+j;m<_;m+=j)f=y.getPointOnEllipticalArc(i[0],i[1],i[2],i[3],m,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,m,y){const v=y*(Math.PI/180),b=Math.cos(v)*(e-s)/2+Math.sin(v)*(n-i)/2,_=-1*Math.sin(v)*(e-s)/2+Math.cos(v)*(n-i)/2,j=b*b/(f*f)+_*_/(m*m);j>1&&(f*=Math.sqrt(j),m*=Math.sqrt(j));let w=Math.sqrt((f*f*(m*m)-f*f*(_*_)-m*m*(b*b))/(f*f*(_*_)+m*m*(b*b)));o===d&&(w*=-1),isNaN(w)&&(w=0);const R=w*f*_/m,O=w*-m*b/f,T=(e+s)/2+Math.cos(v)*R-Math.sin(v)*O,A=(n+i)/2+Math.sin(v)*R+Math.cos(v)*O,z=function(Z){return Math.sqrt(Z[0]*Z[0]+Z[1]*Z[1])},k=function(Z,ue){return(Z[0]*ue[0]+Z[1]*ue[1])/(z(Z)*z(ue))},P=function(Z,ue){return(Z[0]*ue[1]<Z[1]*ue[0]?-1:1)*Math.acos(k(Z,ue))},H=P([1,0],[(b-R)/f,(_-O)/m]),B=[(b-R)/f,(_-O)/m],L=[(-1*b-R)/f,(-1*_-O)/m];let V=P(B,L);return k(B,L)<=-1&&(V=Math.PI),k(B,L)>=1&&(V=0),d===0&&V>0&&(V=V-2*Math.PI),d===1&&V<0&&(V=V+2*Math.PI),[T,A,f,m,H,V,v,d]}}Cn.prototype.className="Path";Cn.prototype._attrsAffectingSize=["data"];$n(Cn);K.addGetterSetter(Cn,"data");let od=class extends yo{_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 m,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]],j=Cn.calcLength(i[i.length-4],i[i.length-3],"C",_),w=Cn.getPointOnQuadraticBezier(Math.min(1,1-d/j),_[0],_[1],_[2],_[3],_[4],_[5]);m=s[f-2]-w.x,y=s[f-1]-w.y}else m=s[f-2]-s[f-4],y=s[f-1]-s[f-3];const v=(Math.atan2(y,m)+n)%n,b=this.pointerWidth();this.pointerAtEnding()&&(e.save(),e.beginPath(),e.translate(s[f-2],s[f-1]),e.rotate(v),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/2),e.closePath(),e.restore(),this.__fillStroke(e)),this.pointerAtBeginning()&&(e.save(),e.beginPath(),e.translate(s[0],s[1]),o?(m=(i[0]+i[2])/2-s[0],y=(i[1]+i[3])/2-s[1]):(m=s[2]-s[0],y=s[3]-s[1]),e.rotate((Math.atan2(-y,-m)+n)%n),e.moveTo(0,0),e.lineTo(-d,b/2),e.lineTo(-d,-b/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}}};od.prototype.className="Arrow";$n(od);K.addGetterSetter(od,"pointerLength",10,Te());K.addGetterSetter(od,"pointerWidth",10,Te());K.addGetterSetter(od,"pointerAtBeginning",!1);K.addGetterSetter(od,"pointerAtEnding",!0);let hh=class extends we{_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)}};hh.prototype._centroid=!0;hh.prototype.className="Circle";hh.prototype._attrsAffectingSize=["radius"];$n(hh);K.addGetterSetter(hh,"radius",0,Te());class Hu extends we{_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)}}Hu.prototype.className="Ellipse";Hu.prototype._centroid=!0;Hu.prototype._attrsAffectingSize=["radiusX","radiusY"];$n(Hu);K.addComponentsGetterSetter(Hu,"radius",["x","y"]);K.addGetterSetter(Hu,"radiusX",0,Te());K.addGetterSetter(Hu,"radiusY",0,Te());class Or extends we{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,m=this.attrs.cropHeight;f&&m?d=[o,this.cropX(),this.cropY(),f,m,0,0,n,s]:d=[o,0,0,n,s]}(this.hasFill()||this.hasStroke()||i)&&(e.beginPath(),i?te.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?te.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=te.createImageElement();i.onload=function(){const o=new Or({image:i});n(o)},i.onerror=s,i.crossOrigin="Anonymous",i.src=e}}Or.prototype.className="Image";Or.prototype._attrsAffectingSize=["image"];$n(Or);K.addGetterSetter(Or,"cornerRadius",0,ny(4));K.addGetterSetter(Or,"image");K.addComponentsGetterSetter(Or,"crop",["x","y","width","height"]);K.addGetterSetter(Or,"cropX",0,Te());K.addGetterSetter(Or,"cropY",0,Te());K.addGetterSetter(Or,"cropWidth",0,Te());K.addGetterSetter(Or,"cropHeight",0,Te());const q8=["fontFamily","fontSize","fontStyle","padding","lineHeight","text","width","height","pointerDirection","pointerWidth","pointerHeight"],Pz="Change.konva",Yz="none",Ab="up",Mb="right",Db="down",zb="left",Vz=q8.length;class Mv extends ah{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<Vz;s++)e.on(q8[s]+Pz,i)}getWidth(){return this.getText().width()}getHeight(){return this.getText().height()}_sync(){let e=this.getText(),n=this.getTag(),s,i,o,d,f,m,y;if(e&&n){switch(s=e.width(),i=e.height(),o=n.pointerDirection(),d=n.pointerWidth(),y=n.pointerHeight(),f=0,m=0,o){case Ab:f=s/2,m=-1*y;break;case Mb:f=s+d,m=i/2;break;case Db:f=s/2,m=i+y;break;case zb:f=-1*d,m=i/2;break}n.setAttrs({x:-1*f,y:-1*m,width:s,height:i}),e.setAttrs({x:-1*f,y:-1*m})}}}Mv.prototype.className="Label";$n(Mv);class ud extends we{_sceneFunc(e){const n=this.width(),s=this.height(),i=this.pointerDirection(),o=this.pointerWidth(),d=this.pointerHeight(),f=this.cornerRadius();let m=0,y=0,v=0,b=0;typeof f=="number"?m=y=v=b=Math.min(f,n/2,s/2):(m=Math.min(f[0]||0,n/2,s/2),y=Math.min(f[1]||0,n/2,s/2),b=Math.min(f[2]||0,n/2,s/2),v=Math.min(f[3]||0,n/2,s/2)),e.beginPath(),e.moveTo(m,0),i===Ab&&(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===Mb&&(e.lineTo(n,(s-d)/2),e.lineTo(n+o,s/2),e.lineTo(n,(s+d)/2)),e.lineTo(n,s-b),e.arc(n-b,s-b,b,0,Math.PI/2,!1),i===Db&&(e.lineTo((n+o)/2,s),e.lineTo(n/2,s+d),e.lineTo((n-o)/2,s)),e.lineTo(v,s),e.arc(v,s-v,v,Math.PI/2,Math.PI,!1),i===zb&&(e.lineTo(0,(s+d)/2),e.lineTo(-1*o,s/2),e.lineTo(0,(s-d)/2)),e.lineTo(0,m),e.arc(m,m,m,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===Ab?(n-=i,f+=i):o===Db?f+=i:o===zb?(e-=s*1.5,d+=s):o===Mb&&(d+=s*1.5),{x:e,y:n,width:d,height:f}}}ud.prototype.className="Tag";$n(ud);K.addGetterSetter(ud,"pointerDirection",Yz);K.addGetterSetter(ud,"pointerWidth",0,Te());K.addGetterSetter(ud,"pointerHeight",0,Te());K.addGetterSetter(ud,"cornerRadius",0,ny(4));class $m extends we{_sceneFunc(e){const n=this.cornerRadius(),s=this.width(),i=this.height();e.beginPath(),n?te.drawRoundedRectPath(e,s,i,n):e.rect(0,0,s,i),e.closePath(),e.fillStrokeShape(this)}}$m.prototype.className="Rect";$n($m);K.addGetterSetter($m,"cornerRadius",0,ny(4));class qu extends we{_sceneFunc(e){const n=this._getPoints(),s=this.radius(),i=this.sides(),o=this.cornerRadius();if(e.beginPath(),o)te.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)}}qu.prototype.className="RegularPolygon";qu.prototype._centroid=!0;qu.prototype._attrsAffectingSize=["radius"];$n(qu);K.addGetterSetter(qu,"radius",0,Te());K.addGetterSetter(qu,"sides",0,Te());K.addGetterSetter(qu,"cornerRadius",0,ny(4));const L5=Math.PI*2;class cd extends we{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.innerRadius(),0,L5,!1),e.moveTo(this.outerRadius(),0),e.arc(0,0,this.outerRadius(),L5,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"];$n(cd);K.addGetterSetter(cd,"innerRadius",0,Te());K.addGetterSetter(cd,"outerRadius",0,Te());class Sl extends we{constructor(e){super(e),this._updated=!0,this.anim=new ii(()=>{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],m=o[i+1],y=o[i+2],v=o[i+3],b=this.image();if((this.hasFill()||this.hasStroke())&&(e.beginPath(),e.rect(0,0,y,v),e.closePath(),e.fillStrokeShape(this)),b)if(d){const _=d[n],j=s*2;e.drawImage(b,f,m,y,v,_[j+0],_[j+1],y,v)}else e.drawImage(b,f,m,y,v,0,0,y,v)}_hitFunc(e){const n=this.animation(),s=this.frameIndex(),i=s*4,o=this.animations()[n],d=this.frameOffsets(),f=o[i+2],m=o[i+3];if(e.beginPath(),d){const y=d[n],v=s*2;e.rect(y[v+0],y[v+1],f,m)}else e.rect(0,0,f,m);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)}}Sl.prototype.className="Sprite";$n(Sl);K.addGetterSetter(Sl,"animation");K.addGetterSetter(Sl,"animations");K.addGetterSetter(Sl,"frameOffsets");K.addGetterSetter(Sl,"image");K.addGetterSetter(Sl,"frameIndex",0,Te());K.addGetterSetter(Sl,"frameRate",17,Te());K.backCompat(Sl,{index:"frameIndex",getIndex:"getFrameIndex",setIndex:"setFrameIndex"});class Bu extends we{_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),m=-1*d*Math.cos(o*Math.PI/i);e.lineTo(f,m)}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)}}Bu.prototype.className="Star";Bu.prototype._centroid=!0;Bu.prototype._attrsAffectingSize=["innerRadius","outerRadius"];$n(Bu);K.addGetterSetter(Bu,"numPoints",5,Te());K.addGetterSetter(Bu,"innerRadius",0,Te());K.addGetterSetter(Bu,"outerRadius",0,Te());function xu(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 Rf="auto",Qz="center",B8="inherit",rm="justify",Kz="Change.konva",Xz="2d",U5="-",G8="left",Fz="text",Zz="Text",Iz="top",Jz="bottom",H5="middle",P8="normal",Wz="px ",o1=" ",$z="right",q5="rtl",ek="word",tk="char",B5="none",Cx="…",Y8=["direction","fontFamily","fontSize","fontStyle","fontVariant","padding","align","verticalAlign","lineHeight","text","width","height","wrap","ellipsis","letterSpacing"],nk=Y8.length;function ak(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 u1;function jx(){return u1||(u1=te.createCanvasElement().getContext(Xz),u1)}function sk(t){t.fillText(this._partialText,this._partialTextX,this._partialTextY)}function rk(t){t.setAttr("miterLimit",2),t.strokeText(this._partialText,this._partialTextX,this._partialTextY)}function ik(t){return t=t||{},!t.fillLinearGradientColorStops&&!t.fillRadialGradientColorStops&&!t.fillPatternImage&&(t.fill=t.fill||"black"),t}let jn=class extends we{constructor(e){super(ik(e)),this._partialTextX=0,this._partialTextY=0;for(let n=0;n<nk;n++)this.on(Y8[n]+Kz,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(),m=this.lineHeight()*f,y=this.verticalAlign(),v=this.direction(),b=0,_=this.align(),j=this.getWidth(),w=this.letterSpacing(),R=this.charRenderFunc(),O=this.fill(),T=this.textDecoration(),A=this.underlineOffset(),z=T.indexOf("underline")!==-1,k=T.indexOf("line-through")!==-1,P;v=v===B8?e.direction:v;let H=m/2,B=H5;if(!Me.legacyTextRendering){const L=this.measureSize("M");B="alphabetic";const V=(n=L.fontBoundingBoxAscent)!==null&&n!==void 0?n:L.actualBoundingBoxAscent,Z=(s=L.fontBoundingBoxDescent)!==null&&s!==void 0?s:L.actualBoundingBoxDescent;H=(V-Z)/2+m/2}for(v===q5&&e.setAttr("direction",v),e.setAttr("font",this._getContextFont()),e.setAttr("textBaseline",B),e.setAttr("textAlign",G8),y===H5?b=(this.getHeight()-o*m-d*2)/2:y===Jz&&(b=this.getHeight()-o*m-d*2),e.translate(d,b+d),P=0;P<o;P++){let L=0,V=0;const Z=i[P],ue=Z.text,ae=Z.width,J=Z.lastInParagraph;if(e.save(),_===$z?L+=j-ae-d*2:_===Qz&&(L+=(j-ae-d*2)/2),z){e.save(),e.beginPath();const ce=A??(Me.legacyTextRendering?Math.round(f/2):Math.round(f/4)),Y=L,$=H+V+ce;e.moveTo(Y,$);const ee=_===rm&&!J?j-d*2:ae;e.lineTo(Y+Math.round(ee),$),e.lineWidth=f/15;const _e=this._getLinearGradient();e.strokeStyle=_e||O,e.stroke(),e.restore()}const le=L;if(v!==q5&&(w!==0||_===rm||R)){const ce=ue.split(" ").length-1,Y=xu(ue);for(let $=0;$<Y.length;$++){const ee=Y[$];if(ee===" "&&!J&&_===rm&&(L+=(j-d*2-ae)/ce),this._partialTextX=L,this._partialTextY=H+V,this._partialText=ee,R){e.save();const ge=i.slice(0,P).reduce((W,he)=>W+xu(he.text).length,0),G=$+ge;R({char:ee,index:G,x:L,y:H+V,lineIndex:P,column:$,isLastInLine:J,width:this.measureSize(ee).width,context:e})}e.fillStrokeShape(this),R&&e.restore(),L+=this.measureSize(ee).width+w}}else w!==0&&e.setAttr("letterSpacing",`${w}px`),this._partialTextX=L,this._partialTextY=H+V,this._partialText=ue,e.fillStrokeShape(this);if(k){e.save(),e.beginPath();const ce=Me.legacyTextRendering?0:-Math.round(f/4),Y=le;e.moveTo(Y,H+V+ce);const $=_===rm&&!J?j-d*2:ae;e.lineTo(Y+Math.round($),H+V+ce),e.lineWidth=f/15;const ee=this._getLinearGradient();e.strokeStyle=ee||O,e.stroke(),e.restore()}e.restore(),o>1&&(H+=m)}}_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=te._isString(e)?e:e==null?"":e+"";return this._setAttr(Fz,n),this}getWidth(){return this.attrs.width===Rf||this.attrs.width===void 0?this.getTextWidth()+this.padding()*2:this.attrs.width}getHeight(){return this.attrs.height===Rf||this.attrs.height===void 0?this.fontSize()*this.textArr.length*this.lineHeight()+this.padding()*2:this.attrs.height}getTextWidth(){return this.textWidth}getTextHeight(){return te.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,m,y,v,b,_;let j=jx(),w=this.fontSize(),R;j.save(),j.font=this._getContextFont(),R=j.measureText(e),j.restore();const O=w/100;return{actualBoundingBoxAscent:(n=R.actualBoundingBoxAscent)!==null&&n!==void 0?n:71.58203125*O,actualBoundingBoxDescent:(s=R.actualBoundingBoxDescent)!==null&&s!==void 0?s:0,actualBoundingBoxLeft:(i=R.actualBoundingBoxLeft)!==null&&i!==void 0?i:-7.421875*O,actualBoundingBoxRight:(o=R.actualBoundingBoxRight)!==null&&o!==void 0?o:75.732421875*O,alphabeticBaseline:(d=R.alphabeticBaseline)!==null&&d!==void 0?d:0,emHeightAscent:(f=R.emHeightAscent)!==null&&f!==void 0?f:100*O,emHeightDescent:(m=R.emHeightDescent)!==null&&m!==void 0?m:-20*O,fontBoundingBoxAscent:(y=R.fontBoundingBoxAscent)!==null&&y!==void 0?y:91*O,fontBoundingBoxDescent:(v=R.fontBoundingBoxDescent)!==null&&v!==void 0?v:21*O,hangingBaseline:(b=R.hangingBaseline)!==null&&b!==void 0?b:72.80000305175781*O,ideographicBaseline:(_=R.ideographicBaseline)!==null&&_!==void 0?_:-21*O,width:R.width,height:w}}_getContextFont(){return this.fontStyle()+o1+this.fontVariant()+o1+(this.fontSize()+Wz)+ak(this.fontFamily())}_addTextLine(e){this.align()===rm&&(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 jx().measureText(e).width+n*s}_setTextData(){let e=this.text().split(`
|
|
564
|
-
`),n=+this.fontSize(),s=0,i=this.lineHeight()*n,o=this.attrs.width,d=this.attrs.height,f=o!==Rf&&o!==void 0,m=d!==Rf&&d!==void 0,y=this.padding(),v=o-y*2,b=d-y*2,_=0,j=this.wrap(),w=j!==B5,R=j!==tk&&w,O=this.ellipsis();this.textArr=[],jx().font=this._getContextFont();const T=O?this._getTextWidth(Cx):0;for(let A=0,z=e.length;A<z;++A){let k=e[A],P=this._getTextWidth(k);if(f&&P>v)for(;k.length>0;){let H=0,B=xu(k).length,L="",V=0;for(;H<B;){const Z=H+B>>>1,ue=xu(k),ae=ue.slice(0,Z+1).join(""),J=this._getTextWidth(ae);(O&&m&&_+i>b?J+T:J)<=v?(H=Z+1,L=ae,V=J):B=Z}if(L){if(R){const ae=xu(k),J=xu(L),le=ae[J.length],ce=le===o1||le===U5;let Y;if(ce&&V<=v)Y=J.length;else{const $=J.lastIndexOf(o1),ee=J.lastIndexOf(U5);Y=Math.max($,ee)+1}Y>0&&(H=Y,L=ae.slice(0,H).join(""),V=this._getTextWidth(L))}if(L=L.trimRight(),this._addTextLine(L),s=Math.max(s,V),_+=i,this._shouldHandleEllipsis(_)){this._tryToAddEllipsisToLastLine();break}if(k=xu(k).slice(H).join("").trimLeft(),k.length>0&&(P=this._getTextWidth(k),P<=v)){this._addTextLine(k),_+=i,s=Math.max(s,P);break}}else break}else this._addTextLine(k),_+=i,s=Math.max(s,P),this._shouldHandleEllipsis(_)&&A<z-1&&this._tryToAddEllipsisToLastLine();if(this.textArr[this.textArr.length-1]&&(this.textArr[this.textArr.length-1].lastInParagraph=!0),m&&_+i>b)break}this.textHeight=n,this.textWidth=s}_shouldHandleEllipsis(e){const n=+this.fontSize(),s=this.lineHeight()*n,i=this.attrs.height,o=i!==Rf&&i!==void 0,d=this.padding(),f=i-d*2;return!(this.wrap()!==B5)||o&&e+s>f}_tryToAddEllipsisToLastLine(){const e=this.attrs.width,n=e!==Rf&&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+Cx)<i||(d.text=d.text.slice(0,d.text.length-3))),this.textArr.splice(this.textArr.length-1,1),this._addTextLine(d.text+Cx))}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()}};jn.prototype._fillFunc=sk;jn.prototype._strokeFunc=rk;jn.prototype.className=Zz;jn.prototype._attrsAffectingSize=["text","fontSize","padding","wrap","lineHeight","letterSpacing"];$n(jn);K.overWriteSetter(jn,"width",Rv());K.overWriteSetter(jn,"height",Rv());K.addGetterSetter(jn,"direction",B8);K.addGetterSetter(jn,"fontFamily","Arial");K.addGetterSetter(jn,"fontSize",12,Te());K.addGetterSetter(jn,"fontStyle",P8);K.addGetterSetter(jn,"fontVariant",P8);K.addGetterSetter(jn,"padding",0,Te());K.addGetterSetter(jn,"align",G8);K.addGetterSetter(jn,"verticalAlign",Iz);K.addGetterSetter(jn,"lineHeight",1,Te());K.addGetterSetter(jn,"wrap",ek);K.addGetterSetter(jn,"ellipsis",!1,Mi());K.addGetterSetter(jn,"letterSpacing",0,Te());K.addGetterSetter(jn,"text","",id());K.addGetterSetter(jn,"textDecoration","");K.addGetterSetter(jn,"underlineOffset",void 0,Te());K.addGetterSetter(jn,"charRenderFunc",void 0);const lk="",V8="normal";function Q8(t){t.fillText(this.partialText,0,0)}function K8(t){t.strokeText(this.partialText,0,0)}class Ua extends we{constructor(e){super(e),this.dummyCanvas=te.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 Cn.getPathLength(this.dataArray)}_getPointAtLength(e){if(!this.attrs.data)return null;const n=this.pathLength;return e>n?null:Cn.getPointAtLengthOfDataArray(e,this.dataArray)}_readDataAttribute(){this.dataArray=Cn.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 m=0;m<o.length;m++){e.save();const y=o[m].p0;e.translate(y.x,y.y),e.rotate(o[m].rotation),this.partialText=o[m].text,e.fillStrokeShape(this),d&&(m===0&&e.moveTo(0,i/2+1),e.lineTo(o[m].width,i/2+1)),e.restore()}if(d&&(e.strokeStyle=s,e.lineWidth=i/20,e.stroke()),f){e.beginPath();for(let m=0;m<o.length;m++){e.save();const y=o[m].p0;e.translate(y.x,y.y),e.rotate(o[m].rotation),m===0&&e.moveTo(0,0),e.lineTo(o[m].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 te.warn("text.getTextHeight() method is deprecated. Use text.height() - for full height and text.fontSize() - for one line height."),this.textHeight}setText(e){return jn.prototype.setText.call(this,e)}_getContextFont(){return jn.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=xu(this.text()),n=[];let s=0;for(let j=0;j<e.length;j++)n.push({char:e[j],width:this._getTextSize(e[j]).width}),s+=n[j].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(),m=this.kerningFunc(),y=Math.max(0,s-i),v=Math.max(this.textWidth+((this.attrs.text||"").length-1)*d,0);let b=0;f==="center"&&(b=Math.max(0,this.pathLength/2-v/2)),f==="right"&&(b=Math.max(0,this.pathLength-v));let _=b;for(let j=0;j<n.length;j++){const w=this._getPointAtLength(_);if(!w)return;const R=n[j].char;let O=n[j].width+d;if(R===" "&&f==="justify"){const B=this.text().split(" ").length-1;O+=(this.pathLength-v)/B}const T=_+O,A=this._getPointAtLength(T>this.pathLength&&T-this.pathLength<=y?this.pathLength:T);if(!A)return;const z=Cn.getLineLength(w.x,w.y,A.x,A.y);let k=0;if(m)try{k=m(n[j-1].char,R)*this.fontSize()}catch{k=0}w.x+=k,A.x+=k,this.textWidth+=k;const P=Cn.getPointOnLine(k+z/2,w.x,w.y,A.x,A.y),H=Math.atan2(A.y-w.y,A.x-w.x);this.glyphInfo.push({transposeX:P.x,transposeY:P.y,text:e[j],rotation:H,p0:w,p1:A,width:z}),_+=O}}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 m=this.fontSize();return{x:n-m/2,y:i-m/2,width:s-n+m,height:o-i+m}}destroy(){return te.releaseCanvas(this.dummyCanvas),super.destroy()}}Ua.prototype._fillFunc=Q8;Ua.prototype._strokeFunc=K8;Ua.prototype._fillFuncHit=Q8;Ua.prototype._strokeFuncHit=K8;Ua.prototype.className="TextPath";Ua.prototype._attrsAffectingSize=["text","fontSize","data"];$n(Ua);K.addGetterSetter(Ua,"data");K.addGetterSetter(Ua,"fontFamily","Arial");K.addGetterSetter(Ua,"fontSize",12,Te());K.addGetterSetter(Ua,"fontStyle",V8);K.addGetterSetter(Ua,"align","left");K.addGetterSetter(Ua,"letterSpacing",0,Te());K.addGetterSetter(Ua,"textBaseline","middle");K.addGetterSetter(Ua,"fontVariant",V8);K.addGetterSetter(Ua,"text",lk);K.addGetterSetter(Ua,"textDecoration","");K.addGetterSetter(Ua,"kerningFunc",void 0);const X8="tr-konva",ok=["resizeEnabledChange","rotateAnchorOffsetChange","rotateAnchorAngleChange","rotateEnabledChange","enabledAnchorsChange","anchorSizeChange","borderEnabledChange","borderStrokeChange","borderStrokeWidthChange","borderDashChange","anchorStrokeChange","anchorStrokeWidthChange","anchorFillChange","anchorCornerRadiusChange","ignoreStrokeChange","anchorStyleFuncChange"].map(t=>t+`.${X8}`).join(" "),G5="nodesRect",uk=["widthChange","heightChange","scaleXChange","scaleYChange","skewXChange","skewYChange","rotationChange","offsetXChange","offsetYChange","transformsEnabledChange","strokeWidthChange","draggableChange"],ck={"top-left":-45,"top-center":0,"top-right":45,"middle-right":-90,"middle-left":90,"bottom-left":-135,"bottom-center":180,"bottom-right":135},dk="ontouchstart"in Me._global;function fk(t,e,n){if(t==="rotater")return n;e+=te.degToRad(ck[t]||0);const s=(te.radToDeg(e)%360+360)%360;return te._inRange(s,315+22.5,360)||te._inRange(s,0,22.5)?"ns-resize":te._inRange(s,45-22.5,45+22.5)?"nesw-resize":te._inRange(s,90-22.5,90+22.5)?"ew-resize":te._inRange(s,135-22.5,135+22.5)?"nwse-resize":te._inRange(s,180-22.5,180+22.5)?"ns-resize":te._inRange(s,225-22.5,225+22.5)?"nesw-resize":te._inRange(s,270-22.5,270+22.5)?"ew-resize":te._inRange(s,315-22.5,315+22.5)?"nwse-resize":(te.error("Transformer has unknown angle for cursor detection: "+s),"pointer")}const M1=["top-left","top-center","top-right","middle-right","middle-left","bottom-left","bottom-center","bottom-right"];function hk(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 F8(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 pk(t,e){const n=hk(t);return F8(t,e,n)}function mk(t,e,n){let s=e;for(let i=0;i<t.length;i++){const o=Me.getAngle(t[i]),d=Math.abs(o-e)%(Math.PI*2);Math.min(d,Math.PI*2-d)<n&&(s=o)}return s}let kb=0;class Lt extends ah{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(ok,this.update),this.getNode()&&this.update()}attachTo(e){return this.setNode(e),this}setNode(e){return te.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 X8+this._id}setNodes(e=[]){this._nodes&&this._nodes.length&&this.detach();const n=e.filter(i=>i.isAncestorOf(this)?(te.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(uk.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 m=f.getAbsolutePosition();f.setAbsolutePosition({x:m.x+o,y:m.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(G5),this._clearCache("transform"),this._clearSelfAndDescendantCache("absoluteTransform")}_getNodeRect(){return this._getCache(G5,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,m=i.y*o.y-e.offsetY()*o.y,y=(Me.getAngle(e.getAbsoluteRotation())+Math.PI*2)%(Math.PI*2),v={x:d.x+f*Math.cos(y)+m*Math.sin(-y),y:d.y+m*Math.cos(y)+f*Math.sin(y),width:i.width*o.x,height:i.height*o.y,rotation:y};return F8(v,-Me.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 v=y.getClientRect({skipTransform:!0,skipShadow:!0,skipStroke:this.ignoreStroke()}),b=[{x:v.x,y:v.y},{x:v.x+v.width,y:v.y},{x:v.x+v.width,y:v.y+v.height},{x:v.x,y:v.y+v.height}],_=y.getAbsoluteTransform();b.forEach(function(j){const w=_.point(j);n.push(w)})});const s=new wr;s.rotate(-Me.getAngle(this.rotation()));let i=1/0,o=1/0,d=-1/0,f=-1/0;n.forEach(function(y){const v=s.point(y);i===void 0&&(i=d=v.x,o=f=v.y),i=Math.min(i,v.x),o=Math.min(o,v.y),d=Math.max(d,v.x),f=Math.max(f,v.y)}),s.invert();const m=s.point({x:i,y:o});return{x:m.x,y:m.y,width:d-i,height:f-o,rotation:Me.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(),M1.forEach(e=>{this._createAnchor(e)}),this._createAnchor("rotater"),this._elementsCreated=!0}_createAnchor(e){const n=new $m({stroke:"rgb(0, 161, 255)",fill:"white",strokeWidth:1,name:e+" _anchor",dragDistance:0,draggable:!0,hitStrokeWidth:dk?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=Me.getAngle(this.rotation()),o=this.rotateAnchorCursor(),d=fk(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 we({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 m=i.rotateAnchorAngle(),y=i.rotateAnchorOffset(),v=te.degToRad(m),b=Math.sin(v),_=-Math.cos(v),j=d/2,w=f/2;let R=1/0;_<0?R=Math.min(R,-w/_):_>0&&(R=Math.min(R,(f-w)/_)),b<0?R=Math.min(R,-j/b):b>0&&(R=Math.min(R,(d-j)/b));const O=j+b*R,T=w+_*R,A=te._sign(f),z=O+b*y*A,k=T+_*y*A;n.moveTo(O,T),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},kb++,this._fire("transformstart",{evt:e.evt,target:this.getNode()}),this._nodes.forEach(m=>{m._fire("transformstart",{evt:e.evt,target:m})})}_handleMouseMove(e){let n,s,i;const o=this.findOne("."+this._movingAnchorName),d=o.getStage();d.setPointersPositions(e);const f=d.getPointerPosition();let m={x:f.x-this._anchorDragOffset.x,y:f.y-this._anchorDragOffset.y};const y=o.getAbsolutePosition();this.anchorDragBoundFunc()&&(m=this.anchorDragBoundFunc()(y,m,e)),o.setAbsolutePosition(m);const v=o.getAbsolutePosition();if(y.x===v.x&&y.y===v.y)return;if(this._movingAnchorName==="rotater"){const A=this._getNodeRect();n=o.x()-A.width/2,s=-o.y()+A.height/2;const z=Me.getAngle(this.rotateAnchorAngle());let k=Math.atan2(-s,n)+Math.PI/2-z;A.height<0&&(k-=Math.PI);const H=Me.getAngle(this.rotation())+k,B=Me.getAngle(this.rotationSnapTolerance()),V=mk(this.rotationSnaps(),H,B)-A.rotation,Z=pk(A,V);this._fitNodesInto(Z,e);return}const b=this.shiftBehavior();let _;b==="inverted"?_=this.keepRatio()&&!e.shiftKey:b==="none"?_=this.keepRatio():_=this.keepRatio()||e.shiftKey;let j=this.centeredScaling()||e.altKey;if(this._movingAnchorName==="top-left"){if(_){const A=j?{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(A.x-o.x(),2)+Math.pow(A.y-o.y(),2));const z=this.findOne(".top-left").x()>A.x?-1:1,k=this.findOne(".top-left").y()>A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-left").x(A.x-n),this.findOne(".top-left").y(A.y-s)}}else if(this._movingAnchorName==="top-center")this.findOne(".top-left").y(o.y());else if(this._movingAnchorName==="top-right"){if(_){const A=j?{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()-A.x,2)+Math.pow(A.y-o.y(),2));const z=this.findOne(".top-right").x()<A.x?-1:1,k=this.findOne(".top-right").y()>A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".top-right").x(A.x+n),this.findOne(".top-right").y(A.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 A=j?{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(A.x-o.x(),2)+Math.pow(o.y()-A.y,2));const z=A.x<o.x()?-1:1,k=o.y()<A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,o.x(A.x-n),o.y(A.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 A=j?{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()-A.x,2)+Math.pow(o.y()-A.y,2));const z=this.findOne(".bottom-right").x()<A.x?-1:1,k=this.findOne(".bottom-right").y()<A.y?-1:1;n=i*this.cos*z,s=i*this.sin*k,this.findOne(".bottom-right").x(A.x+n),this.findOne(".bottom-right").y(A.y+s)}}else console.error(new Error("Wrong position argument of selection resizer: "+this._movingAnchorName));if(j=this.centeredScaling()||e.altKey,j){const A=this.findOne(".top-left"),z=this.findOne(".bottom-right"),k=A.x(),P=A.y(),H=this.getWidth()-z.x(),B=this.getHeight()-z.y();z.move({x:-k,y:-P}),A.move({x:H,y:B})}const R=this.findOne(".top-left").getAbsolutePosition();n=R.x,s=R.y;const O=this.findOne(".bottom-right").x()-this.findOne(".top-left").x(),T=this.findOne(".bottom-right").y()-this.findOne(".top-left").y();this._fitNodesInto({x:n,y:s,width:O,height:T,rotation:Me.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();kb--,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(te._inRange(e.width,-this.padding()*2-i,i)){this.update();return}if(te._inRange(e.height,-this.padding()*2-i,i)){this.update();return}const o=new wr;if(o.rotate(Me.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=_:te.warn("boundBoxFunc returned falsy. You should return new bound rect from it!")}const d=1e7,f=new wr;f.translate(s.x,s.y),f.rotate(s.rotation),f.scale(s.width/d,s.height/d);const m=new wr,y=e.width/d,v=e.height/d;this.flipEnabled()===!1?(m.translate(e.x,e.y),m.rotate(e.rotation),m.translate(e.width<0?e.width:0,e.height<0?e.height:0),m.scale(Math.abs(y),Math.abs(v))):(m.translate(e.x,e.y),m.rotate(e.rotation),m.scale(y,v));const b=m.multiply(f.invert());this._nodes.forEach(_=>{var j;if(!_.getStage())return;const w=_.getParent().getAbsoluteTransform(),R=_.getTransform().copy();R.translate(_.offsetX(),_.offsetY());const O=new wr;O.multiply(w.copy().invert()).multiply(b).multiply(w).multiply(R);const T=O.decompose();_.setAttrs(T),(j=_.getLayer())===null||j===void 0||j.batchDraw()}),this.rotation(te._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(te._getRotation(n.rotation));const s=n.width,i=n.height,o=this.enabledAnchors(),d=this.resizeEnabled(),f=this.padding(),m=this.anchorSize(),y=this.find("._anchor");y.forEach(H=>{H.setAttrs({width:m,height:m,offsetX:m/2,offsetY:m/2,stroke:this.anchorStroke(),strokeWidth:this.anchorStrokeWidth(),fill:this.anchorFill(),cornerRadius:this.anchorCornerRadius()})}),this._batchChangeChild(".top-left",{x:0,y:0,offsetX:m/2+f,offsetY:m/2+f,visible:d&&o.indexOf("top-left")>=0}),this._batchChangeChild(".top-center",{x:s/2,y:0,offsetY:m/2+f,visible:d&&o.indexOf("top-center")>=0}),this._batchChangeChild(".top-right",{x:s,y:0,offsetX:m/2-f,offsetY:m/2+f,visible:d&&o.indexOf("top-right")>=0}),this._batchChangeChild(".middle-left",{x:0,y:i/2,offsetX:m/2+f,visible:d&&o.indexOf("middle-left")>=0}),this._batchChangeChild(".middle-right",{x:s,y:i/2,offsetX:m/2-f,visible:d&&o.indexOf("middle-right")>=0}),this._batchChangeChild(".bottom-left",{x:0,y:i,offsetX:m/2+f,offsetY:m/2-f,visible:d&&o.indexOf("bottom-left")>=0}),this._batchChangeChild(".bottom-center",{x:s/2,y:i,offsetY:m/2-f,visible:d&&o.indexOf("bottom-center")>=0}),this._batchChangeChild(".bottom-right",{x:s,y:i,offsetX:m/2-f,offsetY:m/2-f,visible:d&&o.indexOf("bottom-right")>=0});const v=this.rotateAnchorAngle(),b=this.rotateAnchorOffset(),_=te.degToRad(v),j=Math.sin(_),w=-Math.cos(_),R=s/2,O=i/2;let T=1/0;w<0?T=Math.min(T,-O/w):w>0&&(T=Math.min(T,(i-O)/w)),j<0?T=Math.min(T,-R/j):j>0&&(T=Math.min(T,(s-R)/j));const A=R+j*T,z=O+w*T,k=te._sign(i);this._batchChangeChild(".rotater",{x:A+j*b*k,y:z+w*b*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(H=>H.draggable()),x:0,y:0});const P=this.anchorStyleFunc();P&&y.forEach(H=>{P(H)}),(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=""),ah.prototype.destroy.call(this),this.detach(),this._removeEvents(),this}add(...e){return this._elementsCreated?(te.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=()=>kb>0;function gk(t){return t instanceof Array||te.warn("enabledAnchors value should be an array"),t instanceof Array&&t.forEach(function(e){M1.indexOf(e)===-1&&te.warn("Unknown anchor name: "+e+". Available names are: "+M1.join(", "))}),t||[]}Lt.prototype.className="Transformer";$n(Lt);K.addGetterSetter(Lt,"enabledAnchors",M1,gk);K.addGetterSetter(Lt,"flipEnabled",!0,Mi());K.addGetterSetter(Lt,"resizeEnabled",!0);K.addGetterSetter(Lt,"anchorSize",10,Te());K.addGetterSetter(Lt,"rotateEnabled",!0);K.addGetterSetter(Lt,"rotateLineVisible",!0);K.addGetterSetter(Lt,"rotationSnaps",[]);K.addGetterSetter(Lt,"rotateAnchorOffset",50,Te());K.addGetterSetter(Lt,"rotateAnchorAngle",0,Te());K.addGetterSetter(Lt,"rotateAnchorCursor","crosshair");K.addGetterSetter(Lt,"rotationSnapTolerance",5,Te());K.addGetterSetter(Lt,"borderEnabled",!0);K.addGetterSetter(Lt,"anchorStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"anchorStrokeWidth",1,Te());K.addGetterSetter(Lt,"anchorFill","white");K.addGetterSetter(Lt,"anchorCornerRadius",0,Te());K.addGetterSetter(Lt,"borderStroke","rgb(0, 161, 255)");K.addGetterSetter(Lt,"borderStrokeWidth",1,Te());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,Te());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 xo extends we{_sceneFunc(e){e.beginPath(),e.arc(0,0,this.radius(),0,Me.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)}}xo.prototype.className="Wedge";xo.prototype._centroid=!0;xo.prototype._attrsAffectingSize=["radius"];$n(xo);K.addGetterSetter(xo,"radius",0,Te());K.addGetterSetter(xo,"angle",0,Te());K.addGetterSetter(xo,"clockwise",!1);K.backCompat(xo,{angleDeg:"angle",getAngleDeg:"getAngle",setAngleDeg:"setAngle"});function P5(){this.r=0,this.g=0,this.b=0,this.a=0,this.next=null}const yk=[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],xk=[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 bk(t,e){const n=t.data,s=t.width,i=t.height;let o,d,f,m,y,v,b,_,j,w,R,O,T,A,z,k,P,H,B,L;const V=e+e+1,Z=s-1,ue=i-1,ae=e+1,J=ae*(ae+1)/2,le=new P5,ce=yk[e],Y=xk[e];let $=null,ee=le,_e=null,ge=null;for(let G=1;G<V;G++)ee=ee.next=new P5,G===ae&&($=ee);ee.next=le,f=d=0;for(let G=0;G<i;G++){O=T=A=z=m=y=v=b=0,_=ae*(k=n[d]),j=ae*(P=n[d+1]),w=ae*(H=n[d+2]),R=ae*(B=n[d+3]),m+=J*k,y+=J*P,v+=J*H,b+=J*B,ee=le;for(let W=0;W<ae;W++)ee.r=k,ee.g=P,ee.b=H,ee.a=B,ee=ee.next;for(let W=1;W<ae;W++)o=d+((Z<W?Z:W)<<2),m+=(ee.r=k=n[o])*(L=ae-W),y+=(ee.g=P=n[o+1])*L,v+=(ee.b=H=n[o+2])*L,b+=(ee.a=B=n[o+3])*L,O+=k,T+=P,A+=H,z+=B,ee=ee.next;_e=le,ge=$;for(let W=0;W<s;W++)n[d+3]=B=b*ce>>Y,B!==0?(B=255/B,n[d]=(m*ce>>Y)*B,n[d+1]=(y*ce>>Y)*B,n[d+2]=(v*ce>>Y)*B):n[d]=n[d+1]=n[d+2]=0,m-=_,y-=j,v-=w,b-=R,_-=_e.r,j-=_e.g,w-=_e.b,R-=_e.a,o=f+((o=W+e+1)<Z?o:Z)<<2,O+=_e.r=n[o],T+=_e.g=n[o+1],A+=_e.b=n[o+2],z+=_e.a=n[o+3],m+=O,y+=T,v+=A,b+=z,_e=_e.next,_+=k=ge.r,j+=P=ge.g,w+=H=ge.b,R+=B=ge.a,O-=k,T-=P,A-=H,z-=B,ge=ge.next,d+=4;f+=s}for(let G=0;G<s;G++){T=A=z=O=y=v=b=m=0,d=G<<2,_=ae*(k=n[d]),j=ae*(P=n[d+1]),w=ae*(H=n[d+2]),R=ae*(B=n[d+3]),m+=J*k,y+=J*P,v+=J*H,b+=J*B,ee=le;for(let he=0;he<ae;he++)ee.r=k,ee.g=P,ee.b=H,ee.a=B,ee=ee.next;let W=s;for(let he=1;he<=e;he++)d=W+G<<2,m+=(ee.r=k=n[d])*(L=ae-he),y+=(ee.g=P=n[d+1])*L,v+=(ee.b=H=n[d+2])*L,b+=(ee.a=B=n[d+3])*L,O+=k,T+=P,A+=H,z+=B,ee=ee.next,he<ue&&(W+=s);d=G,_e=le,ge=$;for(let he=0;he<i;he++)o=d<<2,n[o+3]=B=b*ce>>Y,B>0?(B=255/B,n[o]=(m*ce>>Y)*B,n[o+1]=(y*ce>>Y)*B,n[o+2]=(v*ce>>Y)*B):n[o]=n[o+1]=n[o+2]=0,m-=_,y-=j,v-=w,b-=R,_-=_e.r,j-=_e.g,w-=_e.b,R-=_e.a,o=G+((o=he+ae)<ue?o:ue)*s<<2,m+=O+=_e.r=n[o],y+=T+=_e.g=n[o+1],v+=A+=_e.b=n[o+2],b+=z+=_e.a=n[o+3],_e=_e.next,_+=k=ge.r,j+=P=ge.g,w+=H=ge.b,R+=B=ge.a,O-=k,T-=P,A-=H,z-=B,ge=ge.next,d+=s}}const vk=function(e){const n=Math.round(this.blurRadius());n>0&&bk(e,n)};K.addGetterSetter(Ae,"blurRadius",0,Te(),K.afterSetFilter);const Sk=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,Te(),K.afterSetFilter);const Nk=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)},_k=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,Te(),K.afterSetFilter);const Ck=function(t){var e,n,s,i,o,d,f,m,y;const v=t.data,b=t.width,_=t.height,j=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)),O=(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,T=!!((y=(m=this.embossBlend)===null||m===void 0?void 0:m.call(this))!==null&&y!==void 0&&y),A=j*10,z=w*255,k=O*Math.PI/180,P=Math.cos(k),H=Math.sin(k),B=128/1020*A,L=new Uint8ClampedArray(v),V=new Float32Array(b*_);for(let le=0,ce=0;ce<v.length;ce+=4,le++)V[le]=.2126*L[ce]+.7152*L[ce+1]+.0722*L[ce+2];const Z=[-1,0,1,-2,0,2,-1,0,1],ue=[-1,-2,-1,0,0,0,1,2,1],ae=[-b-1,-b,-b+1,-1,0,1,b-1,b,b+1],J=le=>le<0?0:le>255?255:le;for(let le=1;le<_-1;le++)for(let ce=1;ce<b-1;ce++){const Y=le*b+ce;let $=0,ee=0;$+=V[Y+ae[0]]*Z[0],ee+=V[Y+ae[0]]*ue[0],$+=V[Y+ae[1]]*Z[1],ee+=V[Y+ae[1]]*ue[1],$+=V[Y+ae[2]]*Z[2],ee+=V[Y+ae[2]]*ue[2],$+=V[Y+ae[3]]*Z[3],ee+=V[Y+ae[3]]*ue[3],$+=V[Y+ae[5]]*Z[5],ee+=V[Y+ae[5]]*ue[5],$+=V[Y+ae[6]]*Z[6],ee+=V[Y+ae[6]]*ue[6],$+=V[Y+ae[7]]*Z[7],ee+=V[Y+ae[7]]*ue[7],$+=V[Y+ae[8]]*Z[8],ee+=V[Y+ae[8]]*ue[8];const _e=P*$+H*ee,ge=J(z+_e*B),G=Y*4;if(T){const W=ge-z;v[G]=J(L[G]+W),v[G+1]=J(L[G+1]+W),v[G+2]=J(L[G+2]+W),v[G+3]=L[G+3]}else v[G]=v[G+1]=v[G+2]=ge,v[G+3]=L[G+3]}for(let le=0;le<b;le++){let ce=le*4,Y=((_-1)*b+le)*4;v[ce]=L[ce],v[ce+1]=L[ce+1],v[ce+2]=L[ce+2],v[ce+3]=L[ce+3],v[Y]=L[Y],v[Y+1]=L[Y+1],v[Y+2]=L[Y+2],v[Y+3]=L[Y+3]}for(let le=1;le<_-1;le++){let ce=le*b*4,Y=(le*b+(b-1))*4;v[ce]=L[ce],v[ce+1]=L[ce+1],v[ce+2]=L[ce+2],v[ce+3]=L[ce+3],v[Y]=L[Y],v[Y+1]=L[Y+1],v[Y+2]=L[Y+2],v[Y+3]=L[Y+3]}return t};K.addGetterSetter(Ae,"embossStrength",.5,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"embossWhiteLevel",.5,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"embossDirection","top-left",void 0,K.afterSetFilter);K.addGetterSetter(Ae,"embossBlend",!1,void 0,K.afterSetFilter);function wx(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 jk=function(t){const e=t.data,n=e.length;let s=e[0],i=s,o,d=e[1],f=d,m,y=e[2],v=y,b;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),m=e[z+1],m<d?d=m:m>f&&(f=m),b=e[z+2],b<y?y=b:b>v&&(v=b);i===s&&(i=255,s=0),f===d&&(f=255,d=0),v===y&&(v=255,y=0);let j,w,R,O,T,A;if(_>0)j=i+_*(255-i),w=s-_*(s-0),R=f+_*(255-f),O=d-_*(d-0),T=v+_*(255-v),A=y-_*(y-0);else{const z=(i+s)*.5;j=i+_*(i-z),w=s+_*(s-z);const k=(f+d)*.5;R=f+_*(f-k),O=d+_*(d-k);const P=(v+y)*.5;T=v+_*(v-P),A=y+_*(y-P)}for(let z=0;z<n;z+=4)e[z+0]=wx(e[z+0],s,i,w,j),e[z+1]=wx(e[z+1],d,f,O,R),e[z+2]=wx(e[z+2],y,v,A,T)};K.addGetterSetter(Ae,"enhance",0,Te(),K.afterSetFilter);const wk=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,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"luminance",0,Te(),K.afterSetFilter);const Ek=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),m=s*i*Math.sin(o*Math.PI/180),y=.299*s+.701*f+.167*m,v=.587*s-.587*f+.33*m,b=.114*s-.114*f-.497*m,_=.299*s-.299*f-.328*m,j=.587*s+.413*f+.035*m,w=.114*s-.114*f+.293*m,R=.299*s-.3*f+1.25*m,O=.587*s-.586*f-1.05*m,T=.114*s+.886*f-.2*m;let A,z,k,P;for(let H=0;H<n;H+=4)A=e[H+0],z=e[H+1],k=e[H+2],P=e[H+3],e[H+0]=y*A+v*z+b*k+d,e[H+1]=_*A+j*z+w*k+d,e[H+2]=R*A+O*z+T*k+d,e[H+3]=P},Tk=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),m=.299*s+.701*d+.167*f,y=.587*s-.587*d+.33*f,v=.114*s-.114*d-.497*f,b=.299*s-.299*d-.328*f,_=.587*s+.413*d+.035*f,j=.114*s-.114*d+.293*f,w=.299*s-.3*d+1.25*f,R=.587*s-.586*d-1.05*f,O=.114*s+.886*d-.2*f;for(let T=0;T<n;T+=4){const A=e[T+0],z=e[T+1],k=e[T+2],P=e[T+3];e[T+0]=m*A+y*z+v*k,e[T+1]=b*A+_*z+j*k,e[T+2]=w*A+R*z+O*k,e[T+3]=P}};K.addGetterSetter(Ae,"hue",0,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"saturation",0,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"value",0,Te(),K.afterSetFilter);const Rk=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]},Ok=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,m=n.polarCenterY||d/2;let y=Math.sqrt(f*f+m*m),v=o-f,b=d-m;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const j=d,w=o,R=360/w*Math.PI/180;for(let O=0;O<w;O+=1){const T=Math.sin(O*R),A=Math.cos(O*R);for(let z=0;z<j;z+=1){v=Math.floor(f+y*z/j*A),b=Math.floor(m+y*z/j*T);let k=(b*o+v)*4;const P=s[k+0],H=s[k+1],B=s[k+2],L=s[k+3];k=(O+z*o)*4,i[k+0]=P,i[k+1]=H,i[k+2]=B,i[k+3]=L}}},Ak=function(t,e,n){const s=t.data,i=e.data,o=t.width,d=t.height,f=n.polarCenterX||o/2,m=n.polarCenterY||d/2;let y=Math.sqrt(f*f+m*m),v=o-f,b=d-m;const _=Math.sqrt(v*v+b*b);y=_>y?_:y;const j=d,w=o,R=0;let O,T;for(v=0;v<o;v+=1)for(b=0;b<d;b+=1){const A=v-f,z=b-m,k=Math.sqrt(A*A+z*z)*j/y;let P=(Math.atan2(z,A)*180/Math.PI+360+R)%360;P=P*w/360,O=Math.floor(P),T=Math.floor(k);let H=(T*o+O)*4;const B=s[H+0],L=s[H+1],V=s[H+2],Z=s[H+3];H=(b*o+v)*4,i[H+0]=B,i[H+1]=L,i[H+2]=V,i[H+3]=Z}},Mk=function(t){const e=t.width,n=t.height;let s,i,o,d,f,m,y,v,b,_,j=Math.round(this.kaleidoscopePower());const w=Math.round(this.kaleidoscopeAngle()),R=Math.floor(e*(w%360)/360);if(j<1)return;const O=te.createCanvasElement();O.width=e,O.height=n;const T=O.getContext("2d").getImageData(0,0,e,n);te.releaseCanvas(O),Ok(t,T,{polarCenterX:e/2,polarCenterY:n/2});let A=e/Math.pow(2,j);for(;A<=8;)A=A*2,j-=1;A=Math.ceil(A);let z=A,k=0,P=z,H=1;for(R+A>e&&(k=z,P=0,H=-1),i=0;i<n;i+=1)for(s=k;s!==P;s+=H)o=Math.round(s+R)%e,b=(e*i+o)*4,f=T.data[b+0],m=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+s)*4,T.data[_+0]=f,T.data[_+1]=m,T.data[_+2]=y,T.data[_+3]=v;for(i=0;i<n;i+=1)for(z=Math.floor(A),d=0;d<j;d+=1){for(s=0;s<z+1;s+=1)b=(e*i+s)*4,f=T.data[b+0],m=T.data[b+1],y=T.data[b+2],v=T.data[b+3],_=(e*i+z*2-s-1)*4,T.data[_+0]=f,T.data[_+1]=m,T.data[_+2]=y,T.data[_+3]=v;z*=2}Ak(T,t,{})};K.addGetterSetter(Ae,"kaleidoscopePower",2,Te(),K.afterSetFilter);K.addGetterSetter(Ae,"kaleidoscopeAngle",0,Te(),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 im(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 Dk(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 zk(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(im(n,s)<d&&im(s,o)<d&&im(o,i)<d&&im(i,n)<d){const f=Dk([s,n,o,i]),m=[];for(let y=0;y<t.width*t.height;y++){const v=im(f,[t.data[y*4],t.data[y*4+1],t.data[y*4+2]]);m[y]=v<d?0:255}return m}}function kk(t,e){for(let n=0;n<t.width*t.height;n++)t.data[4*n+3]=e[n]}function Lk(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 m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const R=j*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v===2040?255:0}return d}function Uk(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 m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const R=j*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v>=1020?255:0}return d}function Hk(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 m=0;m<e;m++){const y=f*e+m;let v=0;for(let b=0;b<i;b++)for(let _=0;_<i;_++){const j=f+b-o,w=m+_-o;if(j>=0&&j<n&&w>=0&&w<e){const R=j*e+w,O=s[b*i+_];v+=t[R]*O}}d[y]=v}return d}const qk=function(t){const e=this.threshold();let n=zk(t,e);return n&&(n=Lk(n,t.width,t.height),n=Uk(n,t.width,t.height),n=Hk(n,t.width,t.height),kk(t,n)),t};K.addGetterSetter(Ae,"threshold",0,Te(),K.afterSetFilter);const Bk=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,Te(),K.afterSetFilter);const Gk=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){te.error("pixelSize value can not be <= 0");return}for(let f=0;f<i;f+=1)for(let m=0;m<o;m+=1){let y=0,v=0,b=0,_=0;const j=f*e,w=j+e,R=m*e,O=R+e;let T=0;for(let A=j;A<w;A+=1)if(!(A>=n))for(let z=R;z<O;z+=1){if(z>=s)continue;const k=(n*z+A)*4;y+=d[k+0],v+=d[k+1],b+=d[k+2],_+=d[k+3],T+=1}y=y/T,v=v/T,b=b/T,_=_/T;for(let A=j;A<w;A+=1)if(!(A>=n))for(let z=R;z<O;z+=1){if(z>=s)continue;const k=(n*z+A)*4;d[k+0]=y,d[k+1]=v,d[k+2]=b,d[k+3]=_}}};K.addGetterSetter(Ae,"pixelSize",8,Te(),K.afterSetFilter);const Pk=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,Te(),K.afterSetFilter);const Yk=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,x8,K.afterSetFilter);const Vk=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 m=1-d;e[f]=s*d+e[f]*m,e[f+1]=i*d+e[f+1]*m,e[f+2]=o*d+e[f+2]*m}};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,x8,K.afterSetFilter);K.addGetterSetter(Ae,"alpha",1,function(t){return this._filterUpToDate=!1,t>1?1:t<0?0:t});const Qk=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)}},Kk=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},Xk=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,Te(),K.afterSetFilter);sh.Util._assign(sh,{Arc:go,Arrow:od,Circle:hh,Ellipse:Hu,Image:Or,Label:Mv,Tag:ud,Line:yo,Path:Cn,Rect:$m,RegularPolygon:qu,Ring:cd,Sprite:Sl,Star:Bu,Text:jn,TextPath:Ua,Transformer:Lt,Wedge:xo,Filters:{Blur:vk,Brightness:Nk,Brighten:Sk,Contrast:_k,Emboss:Ck,Enhance:jk,Grayscale:wk,HSL:Ek,HSV:Tk,Invert:Rk,Kaleidoscope:Mk,Mask:qk,Noise:Bk,Pixelate:Gk,Posterize:Pk,RGB:Yk,RGBA:Vk,Sepia:Qk,Solarize:Kk,Threshold:Xk}});var Ex={exports:{}},Tx={exports:{}};/**
|
|
565
|
-
* @license React
|
|
566
|
-
* react-reconciler.production.js
|
|
567
|
-
*
|
|
568
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
569
|
-
*
|
|
570
|
-
* This source code is licensed under the MIT license found in the
|
|
571
|
-
* LICENSE file in the root directory of this source tree.
|
|
572
|
-
*/var Y5;function Fk(){return Y5||(Y5=1,(function(t){t.exports=function(e){function n(l,u,g,x){return new Ph(l,u,g,x)}function s(){}function i(l){var u="https://react.dev/errors/"+l;if(1<arguments.length){u+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)u+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+l+"; visit "+u+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(l){var u=l,g=l;if(l.alternate)for(;u.return;)u=u.return;else{l=u;do u=l,(u.flags&4098)!==0&&(g=u.return),l=u.return;while(l)}return u.tag===3?g:null}function d(l){if(o(l)!==l)throw Error(i(188))}function f(l){var u=l.alternate;if(!u){if(u=o(l),u===null)throw Error(i(188));return u!==l?null:l}for(var g=l,x=u;;){var C=g.return;if(C===null)break;var E=C.alternate;if(E===null){if(x=C.return,x!==null){g=x;continue}break}if(C.child===E.child){for(E=C.child;E;){if(E===g)return d(C),l;if(E===x)return d(C),u;E=E.sibling}throw Error(i(188))}if(g.return!==x.return)g=C,x=E;else{for(var U=!1,F=C.child;F;){if(F===g){U=!0,g=C,x=E;break}if(F===x){U=!0,x=C,g=E;break}F=F.sibling}if(!U){for(F=E.child;F;){if(F===g){U=!0,g=E,x=C;break}if(F===x){U=!0,x=E,g=C;break}F=F.sibling}if(!U)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:u}function m(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(u=m(l),u!==null)return u;l=l.sibling}return null}function y(l){var u=l.tag;if(u===5||u===26||u===27||u===6)return l;for(l=l.child;l!==null;){if(l.tag!==4&&(u=y(l),u!==null))return u;l=l.sibling}return null}function v(l){return l===null||typeof l!="object"?null:(l=xi&&l[xi]||l["@@iterator"],typeof l=="function"?l:null)}function b(l){if(l==null)return null;if(typeof l=="function")return l.$$typeof===Ki?null:l.displayName||l.name||null;if(typeof l=="string")return l;switch(l){case kl:return"Fragment";case Ul:return"Profiler";case Ll:return"StrictMode";case Kd:return"Suspense";case yi:return"SuspenseList";case fc:return"Activity"}if(typeof l=="object")switch(l.$$typeof){case zl:return"Portal";case Is:return l.displayName||"Context";case dc:return(l._context.displayName||"Context")+".Consumer";case Go:var u=l.render;return l=l.displayName,l||(l=u.displayName||u.name||"",l=l!==""?"ForwardRef("+l+")":"ForwardRef"),l;case Xd:return u=l.displayName||null,u!==null?u:b(l.type)||"Memo";case Ia:u=l._payload,l=l._init;try{return b(l(u))}catch{}}return null}function _(l){return{current:l}}function j(l){0>Pl||(l.current=lf[Pl],lf[Pl]=null,Pl--)}function w(l,u){Pl++,lf[Pl]=l.current,l.current=u}function R(l){return l>>>=0,l===0?32:31-(of(l)/y0|0)|0}function O(l){var u=l&42;if(u!==0)return u;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 T(l,u,g){var x=l.pendingLanes;if(x===0)return 0;var C=0,E=l.suspendedLanes,U=l.pingedLanes;l=l.warmLanes;var F=x&134217727;return F!==0?(x=F&~E,x!==0?C=O(x):(U&=F,U!==0?C=O(U):g||(g=F&~l,g!==0&&(C=O(g))))):(F=x&~E,F!==0?C=O(F):U!==0?C=O(U):g||(g=x&~l,g!==0&&(C=O(g)))),C===0?0:u!==0&&u!==C&&(u&E)===0&&(E=C&-C,g=u&-u,E>=g||E===32&&(g&4194048)!==0)?u:C}function A(l,u){return(l.pendingLanes&~(l.suspendedLanes&~l.pingedLanes)&u)===0}function z(l,u){switch(l){case 1:case 2:case 4:case 8:case 64:return u+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 u+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=Fo;return Fo<<=1,(Fo&62914560)===0&&(Fo=4194304),l}function P(l){for(var u=[],g=0;31>g;g++)u.push(l);return u}function H(l,u){l.pendingLanes|=u,u!==268435456&&(l.suspendedLanes=0,l.pingedLanes=0,l.warmLanes=0)}function B(l,u,g,x,C,E){var U=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 F=l.entanglements,me=l.expirationTimes,Ne=l.hiddenUpdates;for(g=U&~g;0<g;){var Re=31-ms(g),Ce=1<<Re;F[Re]=0,me[Re]=-1;var Le=Ne[Re];if(Le!==null)for(Ne[Re]=null,Re=0;Re<Le.length;Re++){var st=Le[Re];st!==null&&(st.lane&=-536870913)}g&=~Ce}x!==0&&L(l,x,0),E!==0&&C===0&&l.tag!==0&&(l.suspendedLanes|=E&~(U&~u))}function L(l,u,g){l.pendingLanes|=u,l.suspendedLanes&=~u;var x=31-ms(u);l.entangledLanes|=u,l.entanglements[x]=l.entanglements[x]|1073741824|g&261930}function V(l,u){var g=l.entangledLanes|=u;for(l=l.entanglements;g;){var x=31-ms(g),C=1<<x;C&u|l[x]&u&&(l[x]|=u),g&=~C}}function Z(l,u){var g=u&-u;return g=(g&42)!==0?1:ue(g),(g&(l.suspendedLanes|u))!==0?0:g}function ue(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 ae(l){return l&=-l,2<l?8<l?(l&134217727)!==0?32:268435456:8:2}function J(l){if(typeof Ep=="function"&&v0(l),gs&&typeof gs.setStrictMode=="function")try{gs.setStrictMode(Vl,l)}catch{}}function le(l,u){return l===u&&(l!==0||1/l===1/u)||l!==l&&u!==u}function ce(l){if(pf===void 0)try{throw Error()}catch(g){var u=g.stack.trim().match(/\n( *(at )?)/);pf=u&&u[1]||"",Xr=-1<g.stack.indexOf(`
|
|
573
|
-
at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
574
|
-
`+pf+l+Xr}function Y(l,u){if(!l||Sc)return"";Sc=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var x={DetermineComponentFrameRoot:function(){try{if(u){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 C=Object.getOwnPropertyDescriptor(x.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(x.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var E=x.DetermineComponentFrameRoot(),U=E[0],F=E[1];if(U&&F){var me=U.split(`
|
|
575
|
-
`),Ne=F.split(`
|
|
576
|
-
`);for(C=x=0;x<me.length&&!me[x].includes("DetermineComponentFrameRoot");)x++;for(;C<Ne.length&&!Ne[C].includes("DetermineComponentFrameRoot");)C++;if(x===me.length||C===Ne.length)for(x=me.length-1,C=Ne.length-1;1<=x&&0<=C&&me[x]!==Ne[C];)C--;for(;1<=x&&0<=C;x--,C--)if(me[x]!==Ne[C]){if(x!==1||C!==1)do if(x--,C--,0>C||me[x]!==Ne[C]){var Re=`
|
|
577
|
-
`+me[x].replace(" at new "," at ");return l.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",l.displayName)),Re}while(1<=x&&0<=C);break}}}finally{Sc=!1,Error.prepareStackTrace=g}return(g=l?l.displayName||l.name:"")?ce(g):""}function $(l,u){switch(l.tag){case 26:case 27:case 5:return ce(l.type);case 16:return ce("Lazy");case 13:return l.child!==u&&u!==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 ee(l){try{var u="",g=null;do u+=$(l,g),g=l,l=l.return;while(l);return u}catch(x){return`
|
|
578
|
-
Error generating stack: `+x.message+`
|
|
579
|
-
`+x.stack}}function _e(l,u){if(typeof l=="object"&&l!==null){var g=Tp.get(l);return g!==void 0?g:(u={value:l,source:u,stack:ee(u)},Tp.set(l,u),u)}return{value:l,source:u,stack:ee(u)}}function ge(l,u){Si[Fr++]=Nc,Si[Fr++]=nn,nn=l,Nc=u}function G(l,u,g){$s[zs++]=Aa,$s[zs++]=vr,$s[zs++]=er,er=l;var x=Aa;l=vr;var C=32-ms(x)-1;x&=~(1<<C),g+=1;var E=32-ms(u)+C;if(30<E){var U=C-C%5;E=(x&(1<<U)-1).toString(32),x>>=U,C-=U,Aa=1<<32-ms(u)+C|g<<C|x,vr=E+l}else Aa=1<<E|g<<C|x,vr=l}function W(l){l.return!==null&&(ge(l,1),G(l,1,0))}function he(l){for(;l===nn;)nn=Si[--Fr],Si[Fr]=null,Nc=Si[--Fr],Si[Fr]=null;for(;l===er;)er=$s[--zs],$s[zs]=null,vr=$s[--zs],$s[zs]=null,Aa=$s[--zs],$s[zs]=null}function re(l,u){$s[zs++]=Aa,$s[zs++]=vr,$s[zs++]=er,Aa=u.id,vr=u.overflow,er=l}function Se(l,u){w(Ma,u),w(Ni,l),w(_a,null),l=Dg(u),j(_a),w(_a,l)}function je(){j(_a),j(Ni),j(Ma)}function De(l){l.memoizedState!==null&&w(_c,l);var u=_a.current,g=Vo(u,l.type);u!==g&&(w(Ni,l),w(_a,g))}function nt(l){Ni.current===l&&(j(_a),j(Ni)),_c.current===l&&(j(_c),Fn?Bl._currentValue=ql:Bl._currentValue2=ql)}function ze(l){var u=Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Qn(_e(u,l)),mf}function Vt(l,u){if(!vn)throw Error(i(175));r0(l.stateNode,l.type,l.memoizedProps,u,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 At(l){if(!vn||l!==da)return!1;if(!Nt)return $e(l),Nt=!0,!1;var u=l.tag;if(ca?u!==3&&u!==27&&(u!==5||Xo(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l):u!==3&&(u!==5||Xo(l.type)&&!Ja(l.type,l.memoizedProps))&&Sn&&ze(l),$e(l),u===13){if(!vn)throw Error(i(316));if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=gp(l)}else if(u===31){if(l=l.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(317));Sn=l0(l)}else Sn=ca&&u===27?Jg(l.type,Sn):da?Ig(l.stateNode):null;return!0}function qt(){vn&&(Sn=da=null,Nt=!1)}function wn(){var l=Zr;return l!==null&&(xs===null?xs=l:xs.push.apply(xs,l),Zr=null),l}function Qn(l){Zr===null?Zr=[l]:Zr.push(l)}function Gt(l,u,g){Fn?(w(tr,u._currentValue),u._currentValue=g):(w(tr,u._currentValue2),u._currentValue2=g)}function fn(l){var u=tr.current;Fn?l._currentValue=u:l._currentValue2=u,j(tr)}function fr(l,u,g){for(;l!==null;){var x=l.alternate;if((l.childLanes&u)!==u?(l.childLanes|=u,x!==null&&(x.childLanes|=u)):x!==null&&(x.childLanes&u)!==u&&(x.childLanes|=u),l===g)break;l=l.return}}function Ft(l,u,g,x){var C=l.child;for(C!==null&&(C.return=l);C!==null;){var E=C.dependencies;if(E!==null){var U=C.child;E=E.firstContext;e:for(;E!==null;){var F=E;E=C;for(var me=0;me<u.length;me++)if(F.context===u[me]){E.lanes|=g,F=E.alternate,F!==null&&(F.lanes|=g),fr(E.return,g,l),x||(U=null);break e}E=F.next}}else if(C.tag===18){if(U=C.return,U===null)throw Error(i(341));U.lanes|=g,E=U.alternate,E!==null&&(E.lanes|=g),fr(U,g,l),U=null}else U=C.child;if(U!==null)U.return=C;else for(U=C;U!==null;){if(U===l){U=null;break}if(C=U.sibling,C!==null){C.return=U.return,U=C;break}U=U.return}C=U}}function Et(l,u,g,x){l=null;for(var C=u,E=!1;C!==null;){if(!E){if((C.flags&524288)!==0)E=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var U=C.alternate;if(U===null)throw Error(i(387));if(U=U.memoizedProps,U!==null){var F=C.type;In(C.pendingProps.value,U.value)||(l!==null?l.push(F):l=[F])}}else if(C===_c.current){if(U=C.alternate,U===null)throw Error(i(387));U.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(l!==null?l.push(Bl):l=[Bl])}C=C.return}l!==null&&Ft(u,l,g,x),u.flags|=262144}function Un(l){for(l=l.firstContext;l!==null;){var u=l.context;if(!In(Fn?u._currentValue:u._currentValue2,l.memoizedValue))return!0;l=l.next}return!1}function hn(l){un=l,Sr=null,l=l.dependencies,l!==null&&(l.firstContext=null)}function Zt(l){return Ns(un,l)}function Kn(l,u){return un===null&&hn(l),Ns(l,u)}function Ns(l,u){var g=Fn?u._currentValue:u._currentValue2;if(u={context:u,memoizedValue:g,next:null},Sr===null){if(l===null)throw Error(i(308));Sr=u,l.dependencies={lanes:0,firstContext:u},l.flags|=524288}else Sr=Sr.next=u;return g}function hr(){return{controller:new S0,data:new Map,refCount:0}}function Qa(l){l.refCount--,l.refCount===0&&Ca(yy,function(){l.controller.abort()})}function la(){}function Ea(l){l!==It&&l.next===null&&(It===null?Cc=It=l:It=It.next=l),nr=!0,Pa||(Pa=!0,ba())}function is(l,u){if(!gf&&nr){gf=!0;do for(var g=!1,x=Cc;x!==null;){if(l!==0){var C=x.pendingLanes;if(C===0)var E=0;else{var U=x.suspendedLanes,F=x.pingedLanes;E=(1<<31-ms(42|l)+1)-1,E&=C&~(U&~F),E=E&201326741?E&201326741|1:E?E|2:0}E!==0&&(g=!0,ls(x,E))}else E=_t,E=T(x,x===ht?E:0,x.cancelPendingCommit!==null||x.timeoutHandle!==ps),(E&3)===0||A(x,E)||(g=!0,ls(x,E));x=x.next}while(g);gf=!1}}function pr(){_s()}function _s(){nr=Pa=!1;var l=0;Ji!==0&&Hl()&&(l=Ji);for(var u=Ga(),g=null,x=Cc;x!==null;){var C=x.next,E=Bs(x,u);E===0?(x.next=null,g===null?Cc=C:g.next=C,C===null&&(It=g)):(g=x,(l!==0||(E&3)!==0)&&(nr=!0)),x=C}sa!==0&&sa!==5||is(l),Ji!==0&&(Ji=0)}function Bs(l,u){for(var g=l.suspendedLanes,x=l.pingedLanes,C=l.expirationTimes,E=l.pendingLanes&-62914561;0<E;){var U=31-ms(E),F=1<<U,me=C[U];me===-1?((F&g)===0||(F&x)!==0)&&(C[U]=z(F,u)):me<=u&&(l.expiredLanes|=F),E&=~F}if(u=ht,g=_t,g=T(l,l===u?g:0,l.cancelPendingCommit!==null||l.timeoutHandle!==ps),x=l.callbackNode,g===0||l===u&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)return x!==null&&x!==null&&cf(x),l.callbackNode=null,l.callbackPriority=0;if((g&3)===0||A(l,g)){if(u=g&-g,u===l.callbackPriority)return u;switch(x!==null&&cf(x),ae(g)){case 2:case 8:g=b0;break;case 32:g=vc;break;case 268435456:g=ff;break;default:g=vc}return x=ea.bind(null,l),g=bc(g,x),l.callbackPriority=u,l.callbackNode=g,u}return x!==null&&x!==null&&cf(x),l.callbackPriority=2,l.callbackNode=null,2}function ea(l,u){if(sa!==0&&sa!==5)return l.callbackNode=null,l.callbackPriority=0,null;var g=l.callbackNode;if(Vr()&&l.callbackNode!==g)return null;var x=_t;return x=T(l,l===ht?x:0,l.cancelPendingCommit!==null||l.timeoutHandle!==ps),x===0?null:(br(l,x,u),Bs(l,Ga()),l.callbackNode!=null&&l.callbackNode===g?ea.bind(null,l):null)}function ls(l,u){if(Vr())return null;br(l,u,!0)}function ba(){ep?tp(function(){(bt&6)!==0?bc(df,pr):_s()}):bc(df,pr)}function Ta(){if(Ji===0){var l=_i;l===0&&(l=uf,uf<<=1,(uf&261888)===0&&(uf=256)),Ji=l}return Ji}function Pu(l,u){if(Zo===null){var g=Zo=[];Rp=0,_i=Ta(),fa={status:"pending",value:void 0,then:function(x){g.push(x)}}}return Rp++,u.then(Nl,Nl),u}function Nl(){if(--Rp===0&&Zo!==null){fa!==null&&(fa.status="fulfilled");var l=Zo;Zo=null,_i=0,fa=null;for(var u=0;u<l.length;u++)(0,l[u])()}}function Cs(l,u){var g=[],x={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return l.then(function(){x.status="fulfilled",x.value=u;for(var C=0;C<g.length;C++)(0,g[C])(u)},function(C){for(x.status="rejected",x.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),x}function mr(){var l=Wi.current;return l!==null?l:ht.pooledCache}function yt(l,u){u===null?w(Wi,Wi.current):w(Wi,u.pool)}function mt(){var l=mr();return l===null?null:{parent:Fn?Nn._currentValue:Nn._currentValue2,pool:l}}function Qt(l,u){if(In(l,u))return!0;if(typeof l!="object"||l===null||typeof u!="object"||u===null)return!1;var g=Object.keys(l),x=Object.keys(u);if(g.length!==x.length)return!1;for(x=0;x<g.length;x++){var C=g[x];if(!gy.call(u,C)||!In(l[C],u[C]))return!1}return!0}function Mt(l){return l=l.status,l==="fulfilled"||l==="rejected"}function Hn(l,u,g){switch(g=l[g],g===void 0?l.push(u):g!==u&&(u.then(la,la),u=g),u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,yn(l),l;default:if(typeof u.status=="string")u.then(la,la);else{if(l=ht,l!==null&&100<l.shellSuspendCounter)throw Error(i(482));l=u,l.status="pending",l.then(function(x){if(u.status==="pending"){var C=u;C.status="fulfilled",C.value=x}},function(x){if(u.status==="pending"){var C=u;C.status="rejected",C.reason=x}})}switch(u.status){case"fulfilled":return u.value;case"rejected":throw l=u.reason,yn(l),l}throw $a=u,ha}}function rn(l){try{var u=l._init;return u(l._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?($a=g,ha):g}}function Xn(){if($a===null)throw Error(i(459));var l=$a;return $a=null,l}function yn(l){if(l===ha||l===sr)throw Error(i(483))}function Ra(l){var u=Ql;return Ql+=1,$i===null&&($i=[]),Hn($i,l,u)}function oa(l,u){u=u.props.ref,l.ref=u!==void 0?u:null}function os(l,u){throw u.$$typeof===Dl?Error(i(525)):(l=Object.prototype.toString.call(u),Error(i(31,l==="[object Object]"?"object with keys {"+Object.keys(u).join(", ")+"}":l)))}function Gs(l){function u(de,se){if(l){var pe=de.deletions;pe===null?(de.deletions=[se],de.flags|=16):pe.push(se)}}function g(de,se){if(!l)return null;for(;se!==null;)u(de,se),se=se.sibling;return null}function x(de){for(var se=new Map;de!==null;)de.key!==null?se.set(de.key,de):se.set(de.index,de),de=de.sibling;return se}function C(de,se){return de=Ms(de,se),de.index=0,de.sibling=null,de}function E(de,se,pe){return de.index=pe,l?(pe=de.alternate,pe!==null?(pe=pe.index,pe<se?(de.flags|=67108866,se):pe):(de.flags|=67108866,se)):(de.flags|=1048576,se)}function U(de){return l&&de.alternate===null&&(de.flags|=67108866),de}function F(de,se,pe,Ee){return se===null||se.tag!==6?(se=Yh(pe,de.mode,Ee),se.return=de,se):(se=C(se,pe),se.return=de,se)}function me(de,se,pe,Ee){var Xe=pe.type;return Xe===kl?Re(de,se,pe.props.children,Ee,pe.key):se!==null&&(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ia&&rn(Xe)===se.type)?(se=C(se,pe.props),oa(se,pe),se.return=de,se):(se=gi(pe.type,pe.key,pe.props,null,de.mode,Ee),oa(se,pe),se.return=de,se)}function Ne(de,se,pe,Ee){return se===null||se.tag!==4||se.stateNode.containerInfo!==pe.containerInfo||se.stateNode.implementation!==pe.implementation?(se=Qh(pe,de.mode,Ee),se.return=de,se):(se=C(se,pe.children||[]),se.return=de,se)}function Re(de,se,pe,Ee,Xe){return se===null||se.tag!==7?(se=Zs(pe,de.mode,Ee,Xe),se.return=de,se):(se=C(se,pe),se.return=de,se)}function Ce(de,se,pe){if(typeof se=="string"&&se!==""||typeof se=="number"||typeof se=="bigint")return se=Yh(""+se,de.mode,pe),se.return=de,se;if(typeof se=="object"&&se!==null){switch(se.$$typeof){case Qr:return pe=gi(se.type,se.key,se.props,null,de.mode,pe),oa(pe,se),pe.return=de,pe;case zl:return se=Qh(se,de.mode,pe),se.return=de,se;case Ia:return se=rn(se),Ce(de,se,pe)}if(Xi(se)||v(se))return se=Zs(se,de.mode,pe,null),se.return=de,se;if(typeof se.then=="function")return Ce(de,Ra(se),pe);if(se.$$typeof===Is)return Ce(de,Kn(de,se),pe);os(de,se)}return null}function Le(de,se,pe,Ee){var Xe=se!==null?se.key:null;if(typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint")return Xe!==null?null:F(de,se,""+pe,Ee);if(typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Qr:return pe.key===Xe?me(de,se,pe,Ee):null;case zl:return pe.key===Xe?Ne(de,se,pe,Ee):null;case Ia:return pe=rn(pe),Le(de,se,pe,Ee)}if(Xi(pe)||v(pe))return Xe!==null?null:Re(de,se,pe,Ee,null);if(typeof pe.then=="function")return Le(de,se,Ra(pe),Ee);if(pe.$$typeof===Is)return Le(de,se,Kn(de,pe),Ee);os(de,pe)}return null}function st(de,se,pe,Ee,Xe){if(typeof Ee=="string"&&Ee!==""||typeof Ee=="number"||typeof Ee=="bigint")return de=de.get(pe)||null,F(se,de,""+Ee,Xe);if(typeof Ee=="object"&&Ee!==null){switch(Ee.$$typeof){case Qr:return de=de.get(Ee.key===null?pe:Ee.key)||null,me(se,de,Ee,Xe);case zl:return de=de.get(Ee.key===null?pe:Ee.key)||null,Ne(se,de,Ee,Xe);case Ia:return Ee=rn(Ee),st(de,se,pe,Ee,Xe)}if(Xi(Ee)||v(Ee))return de=de.get(pe)||null,Re(se,de,Ee,Xe,null);if(typeof Ee.then=="function")return st(de,se,pe,Ra(Ee),Xe);if(Ee.$$typeof===Is)return st(de,se,pe,Kn(se,Ee),Xe);os(se,Ee)}return null}function ja(de,se,pe,Ee){for(var Xe=null,kn=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(de,Ze,pe[Dt],Ee);if(Bt===null){Ze===null&&(Ze=wa);break}l&&Ze&&Bt.alternate===null&&u(de,Ze),se=E(Bt,se,Dt),kn===null?Xe=Bt:kn.sibling=Bt,kn=Bt,Ze=wa}if(Dt===pe.length)return g(de,Ze),Nt&&ge(de,Dt),Xe;if(Ze===null){for(;Dt<pe.length;Dt++)Ze=Ce(de,pe[Dt],Ee),Ze!==null&&(se=E(Ze,se,Dt),kn===null?Xe=Ze:kn.sibling=Ze,kn=Ze);return Nt&&ge(de,Dt),Xe}for(Ze=x(Ze);Dt<pe.length;Dt++)wa=st(Ze,de,Dt,pe[Dt],Ee),wa!==null&&(l&&wa.alternate!==null&&Ze.delete(wa.key===null?Dt:wa.key),se=E(wa,se,Dt),kn===null?Xe=wa:kn.sibling=wa,kn=wa);return l&&Ze.forEach(function(lr){return u(de,lr)}),Nt&&ge(de,Dt),Xe}function au(de,se,pe,Ee){if(pe==null)throw Error(i(151));for(var Xe=null,kn=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 lr=Le(de,Ze,Bt.value,Ee);if(lr===null){Ze===null&&(Ze=wa);break}l&&Ze&&lr.alternate===null&&u(de,Ze),se=E(lr,se,Dt),kn===null?Xe=lr:kn.sibling=lr,kn=lr,Ze=wa}if(Bt.done)return g(de,Ze),Nt&&ge(de,Dt),Xe;if(Ze===null){for(;!Bt.done;Dt++,Bt=pe.next())Bt=Ce(de,Bt.value,Ee),Bt!==null&&(se=E(Bt,se,Dt),kn===null?Xe=Bt:kn.sibling=Bt,kn=Bt);return Nt&&ge(de,Dt),Xe}for(Ze=x(Ze);!Bt.done;Dt++,Bt=pe.next())Bt=st(Ze,de,Dt,Bt.value,Ee),Bt!==null&&(l&&Bt.alternate!==null&&Ze.delete(Bt.key===null?Dt:Bt.key),se=E(Bt,se,Dt),kn===null?Xe=Bt:kn.sibling=Bt,kn=Bt);return l&&Ze.forEach(function(xy){return u(de,xy)}),Nt&&ge(de,Dt),Xe}function ll(de,se,pe,Ee){if(typeof pe=="object"&&pe!==null&&pe.type===kl&&pe.key===null&&(pe=pe.props.children),typeof pe=="object"&&pe!==null){switch(pe.$$typeof){case Qr:e:{for(var Xe=pe.key;se!==null;){if(se.key===Xe){if(Xe=pe.type,Xe===kl){if(se.tag===7){g(de,se.sibling),Ee=C(se,pe.props.children),Ee.return=de,de=Ee;break e}}else if(se.elementType===Xe||typeof Xe=="object"&&Xe!==null&&Xe.$$typeof===Ia&&rn(Xe)===se.type){g(de,se.sibling),Ee=C(se,pe.props),oa(Ee,pe),Ee.return=de,de=Ee;break e}g(de,se);break}else u(de,se);se=se.sibling}pe.type===kl?(Ee=Zs(pe.props.children,de.mode,Ee,pe.key),Ee.return=de,de=Ee):(Ee=gi(pe.type,pe.key,pe.props,null,de.mode,Ee),oa(Ee,pe),Ee.return=de,de=Ee)}return U(de);case zl: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(de,se.sibling),Ee=C(se,pe.children||[]),Ee.return=de,de=Ee;break e}else{g(de,se);break}else u(de,se);se=se.sibling}Ee=Qh(pe,de.mode,Ee),Ee.return=de,de=Ee}return U(de);case Ia:return pe=rn(pe),ll(de,se,pe,Ee)}if(Xi(pe))return ja(de,se,pe,Ee);if(v(pe)){if(Xe=v(pe),typeof Xe!="function")throw Error(i(150));return pe=Xe.call(pe),au(de,se,pe,Ee)}if(typeof pe.then=="function")return ll(de,se,Ra(pe),Ee);if(pe.$$typeof===Is)return ll(de,se,Kn(de,pe),Ee);os(de,pe)}return typeof pe=="string"&&pe!==""||typeof pe=="number"||typeof pe=="bigint"?(pe=""+pe,se!==null&&se.tag===6?(g(de,se.sibling),Ee=C(se,pe),Ee.return=de,de=Ee):(g(de,se),Ee=Yh(pe,de.mode,Ee),Ee.return=de,de=Ee),U(de)):g(de,se)}return function(de,se,pe,Ee){try{Ql=0;var Xe=ll(de,se,pe,Ee);return $i=null,Xe}catch(Ze){if(Ze===ha||Ze===sr)throw Ze;var kn=n(29,Ze,null,de.mode);return kn.lanes=Ee,kn.return=de,kn}finally{}}}function Ue(){for(var l=Jr,u=Kl=Jr=0;u<l;){var g=za[u];za[u++]=null;var x=za[u];za[u++]=null;var C=za[u];za[u++]=null;var E=za[u];if(za[u++]=null,x!==null&&C!==null){var U=x.pending;U===null?C.next=C:(C.next=U.next,U.next=C),x.pending=C}E!==0&&xt(g,C,E)}}function et(l,u,g,x){za[Jr++]=l,za[Jr++]=u,za[Jr++]=g,za[Jr++]=x,Kl|=x,l.lanes|=x,l=l.alternate,l!==null&&(l.lanes|=x)}function Ve(l,u,g,x){return et(l,u,g,x),Fe(l)}function ot(l,u){return et(l,null,null,u),Fe(l)}function xt(l,u,g){l.lanes|=g;var x=l.alternate;x!==null&&(x.lanes|=g);for(var C=!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||(C=!0)),l=E,E=E.return;return l.tag===3?(E=l.stateNode,C&&u!==null&&(C=31-ms(g),l=E.hiddenUpdates,x=l[C],x===null?l[C]=[u]:x.push(u),u.lane=g|536870912),E):null}function Fe(l){if(50<Ut)throw Ut=0,Oc=null,Error(i(185));for(var u=l.return;u!==null;)l=u,u=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,u){l=l.updateQueue,u.updateQueue===l&&(u.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,u,g){var x=l.updateQueue;if(x===null)return null;if(x=x.shared,(bt&2)!==0){var C=x.pending;return C===null?u.next=u:(u.next=C.next,C.next=u),x.pending=u,u=Fe(l),xt(l,null,g),u}return et(l,x,u,g),Fe(l)}function Ar(l,u,g){if(u=u.updateQueue,u!==null&&(u=u.shared,(g&4194048)!==0)){var x=u.lanes;x&=l.pendingLanes,g|=x,u.lanes=g,V(l,g)}}function us(l,u){var g=l.updateQueue,x=l.alternate;if(x!==null&&(x=x.updateQueue,g===x)){var C=null,E=null;if(g=g.firstBaseUpdate,g!==null){do{var U={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};E===null?C=E=U:E=E.next=U,g=g.next}while(g!==null);E===null?C=E=u:E=E.next=u}else C=E=u;g={baseState:x.baseState,firstBaseUpdate:C,lastBaseUpdate:E,shared:x.shared,callbacks:x.callbacks},l.updateQueue=g;return}l=g.lastBaseUpdate,l===null?g.firstBaseUpdate=u:l.next=u,g.lastBaseUpdate=u}function Ka(){if(xf){var l=fa;if(l!==null)throw l}}function Ps(l,u,g,x){xf=!1;var C=l.updateQueue;ks=!1;var E=C.firstBaseUpdate,U=C.lastBaseUpdate,F=C.shared.pending;if(F!==null){C.shared.pending=null;var me=F,Ne=me.next;me.next=null,U===null?E=Ne:U.next=Ne,U=me;var Re=l.alternate;Re!==null&&(Re=Re.updateQueue,F=Re.lastBaseUpdate,F!==U&&(F===null?Re.firstBaseUpdate=Ne:F.next=Ne,Re.lastBaseUpdate=me))}if(E!==null){var Ce=C.baseState;U=0,Re=Ne=me=null,F=E;do{var Le=F.lane&-536870913,st=Le!==F.lane;if(st?(_t&Le)===Le:(x&Le)===Le){Le!==0&&Le===_i&&(xf=!0),Re!==null&&(Re=Re.next={lane:0,tag:F.tag,payload:F.payload,callback:null,next:null});e:{var ja=l,au=F;Le=u;var ll=g;switch(au.tag){case 1:if(ja=au.payload,typeof ja=="function"){Ce=ja.call(ll,Ce,Le);break e}Ce=ja;break e;case 3:ja.flags=ja.flags&-65537|128;case 0:if(ja=au.payload,Le=typeof ja=="function"?ja.call(ll,Ce,Le):ja,Le==null)break e;Ce=Qd({},Ce,Le);break e;case 2:ks=!0}}Le=F.callback,Le!==null&&(l.flags|=64,st&&(l.flags|=8192),st=C.callbacks,st===null?C.callbacks=[Le]:st.push(Le))}else st={lane:Le,tag:F.tag,payload:F.payload,callback:F.callback,next:null},Re===null?(Ne=Re=st,me=Ce):Re=Re.next=st,U|=Le;if(F=F.next,F===null){if(F=C.shared.pending,F===null)break;st=F,F=st.next,st.next=null,C.lastBaseUpdate=st,C.shared.pending=null}}while(!0);Re===null&&(me=Ce),C.baseState=me,C.firstBaseUpdate=Ne,C.lastBaseUpdate=Re,E===null&&(C.shared.lanes=0),ji|=U,l.lanes=U,l.memoizedState=Ce}}function Pt(l,u){if(typeof l!="function")throw Error(i(191,l));l.call(u)}function gr(l,u){var g=l.callbacks;if(g!==null)for(l.callbacks=null,l=0;l<g.length;l++)Pt(g[l],u)}function yr(l,u){l=$r,w(el,l),w(Xl,u),$r=l|u.baseLanes}function js(){w(el,$r),w(Xl,Xl.current)}function En(){$r=el.current,j(Xl),j(el)}function ws(l){var u=l.alternate;w(Bn,Bn.current&1),w(ys,l),es===null&&(u===null||Xl.current!==null||u.memoizedState!==null)&&(es=l)}function dd(l){w(Bn,Bn.current),w(ys,l),es===null&&(es=l)}function Di(l){l.tag===22?(w(Bn,Bn.current),w(ys,l),es===null&&(es=l)):Es()}function Es(){w(Bn,Bn.current),w(ys,ys.current)}function Ts(l){j(ys),es===l&&(es=null),j(Bn)}function Yu(l){for(var u=l;u!==null;){if(u.tag===13){var g=u.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||Zi(g)||$d(g)))return u}else if(u.tag===19&&(u.memoizedProps.revealOrder==="forwards"||u.memoizedProps.revealOrder==="backwards"||u.memoizedProps.revealOrder==="unstable_legacy-backwards"||u.memoizedProps.revealOrder==="together")){if((u.flags&128)!==0)return u}else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return null;u=u.return}u.sibling.return=u.return,u=u.sibling}return null}function Tn(){throw Error(i(321))}function ph(l,u){if(u===null)return!1;for(var g=0;g<u.length&&g<l.length;g++)if(!In(l[g],u[g]))return!1;return!0}function bo(l,u,g,x,C,E){return Ci=E,it=u,u.memoizedState=null,u.updateQueue=null,u.lanes=0,Qe.H=l===null||l.memoizedState===null?Mn:Wr,Rt=!1,E=g(x,C),Rt=!1,ct&&(E=Mr(u,g,x,C)),Vu(l),E}function Vu(l){Qe.H=Ls;var u=Ye!==null&&Ye.next!==null;if(Ci=0,tt=Ye=it=null,ft=!1,rr=0,Nr=null,u)throw Error(i(300));l===null||mn||(l=l.dependencies,l!==null&&Un(l)&&(mn=!0))}function Mr(l,u,g,x){it=l;var C=0;do{if(ct&&(Nr=null),rr=0,ct=!1,25<=C)throw Error(i(301));if(C+=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=tl,E=u(g,x)}while(ct);return E}function Ys(){var l=Qe.H,u=l.useState()[0];return u=typeof u.then=="function"?qa(u):u,l=l.useState()[0],(Ye!==null?Ye.memoizedState:null)!==l&&(it.flags|=1024),u}function fd(){var l=Ya!==0;return Ya=0,l}function mh(l,u,g){u.updateQueue=l.updateQueue,u.flags&=-2053,l.lanes&=~g}function Qu(l){if(ft){for(l=l.memoizedState;l!==null;){var u=l.queue;u!==null&&(u.pending=null),l=l.next}ft=!1}Ci=0,tt=Ye=it=null,ct=!1,rr=Ya=0,Nr=null}function Ha(){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 u=tt===null?it.memoizedState:tt.next;if(u!==null)tt=u,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 hd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function qa(l){var u=rr;return rr+=1,Nr===null&&(Nr=[]),l=Hn(Nr,l,u),u=it,(tt===null?u.memoizedState:tt.next)===null&&(u=u.alternate,Qe.H=u===null||u.memoizedState===null?Mn:Wr),l}function vo(l){if(l!==null&&typeof l=="object"){if(typeof l.then=="function")return qa(l);if(l.$$typeof===Is)return Zt(l)}throw Error(i(438,String(l)))}function pd(l){var u=null,g=it.updateQueue;if(g!==null&&(u=g.memoCache),u==null){var x=it.alternate;x!==null&&(x=x.updateQueue,x!==null&&(x=x.memoCache,x!=null&&(u={data:x.data.map(function(C){return C.slice()}),index:0})))}if(u==null&&(u={data:[],index:0}),g===null&&(g=hd(),it.updateQueue=g),g.memoCache=u,g=u.data[u.index],g===void 0)for(g=u.data[u.index]=Array(l),x=0;x<l;x++)g[x]=Xh;return u.index++,g}function xr(l,u){return typeof u=="function"?u(l):u}function ui(l){var u=xn();return md(u,Ye,l)}function md(l,u,g){var x=l.queue;if(x===null)throw Error(i(311));x.lastRenderedReducer=g;var C=l.baseQueue,E=x.pending;if(E!==null){if(C!==null){var U=C.next;C.next=E.next,E.next=U}u.baseQueue=C=E,x.pending=null}if(E=l.baseState,C===null)l.memoizedState=E;else{u=C.next;var F=U=null,me=null,Ne=u,Re=!1;do{var Ce=Ne.lane&-536870913;if(Ce!==Ne.lane?(_t&Ce)===Ce:(Ci&Ce)===Ce){var Le=Ne.revertLane;if(Le===0)me!==null&&(me=me.next={lane:0,revertLane:0,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),Ce===_i&&(Re=!0);else if((Ci&Le)===Le){Ne=Ne.next,Le===_i&&(Re=!0);continue}else Ce={lane:0,revertLane:Ne.revertLane,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},me===null?(F=me=Ce,U=E):me=me.next=Ce,it.lanes|=Le,ji|=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},me===null?(F=me=Le,U=E):me=me.next=Le,it.lanes|=Ce,ji|=Ce;Ne=Ne.next}while(Ne!==null&&Ne!==u);if(me===null?U=E:me.next=F,!In(E,l.memoizedState)&&(mn=!0,Re&&(g=fa,g!==null)))throw g;l.memoizedState=E,l.baseState=U,l.baseQueue=me,x.lastRenderedState=E}return C===null&&(x.lanes=0),[l.memoizedState,x.dispatch]}function gd(l){var u=xn(),g=u.queue;if(g===null)throw Error(i(311));g.lastRenderedReducer=l;var x=g.dispatch,C=g.pending,E=u.memoizedState;if(C!==null){g.pending=null;var U=C=C.next;do E=l(E,U.action),U=U.next;while(U!==C);In(E,u.memoizedState)||(mn=!0),u.memoizedState=E,u.baseQueue===null&&(u.baseState=E),g.lastRenderedState=E}return[E,x]}function _l(l,u,g){var x=it,C=xn(),E=Nt;if(E){if(g===void 0)throw Error(i(407));g=g()}else g=u();var U=!In((Ye||C).memoizedState,g);if(U&&(C.memoizedState=g,mn=!0),C=C.queue,_o(yh.bind(null,x,C,l),[l]),C.getSnapshot!==u||U||tt!==null&&tt.memoizedState.tag&1){if(x.flags|=2048,Rs(9,{destroy:void 0},gh.bind(null,x,C,g,u),null),ht===null)throw Error(i(349));E||(Ci&127)!==0||eg(x,u,g)}return g}function eg(l,u,g){l.flags|=16384,l={getSnapshot:u,value:g},u=it.updateQueue,u===null?(u=hd(),it.updateQueue=u,u.stores=[l]):(g=u.stores,g===null?u.stores=[l]:g.push(l))}function gh(l,u,g,x){u.value=g,u.getSnapshot=x,yd(u)&&tg(l)}function yh(l,u,g){return g(function(){yd(u)&&tg(l)})}function yd(l){var u=l.getSnapshot;l=l.value;try{var g=u();return!In(l,g)}catch{return!0}}function tg(l){var u=ot(l,2);u!==null&&On(u,l,2)}function xh(l){var u=Ha();if(typeof l=="function"){var g=l;if(l=g(),Rt){J(!0);try{g()}finally{J(!1)}}}return u.memoizedState=u.baseState=l,u.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:l},u}function Ku(l,u,g,x){return l.baseState=g,md(l,Ye,typeof x=="function"?x:xr)}function ci(l,u,g,x,C){if(jd(l))throw Error(i(485));if(l=u.action,l!==null){var E={payload:C,action:l,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(U){E.listeners.push(U)}};Qe.T!==null?g(!0):E.isTransition=!1,x(E),g=u.pending,g===null?(E.next=u.pending=E,xd(u,E)):(E.next=g.next,u.pending=g.next=E)}}function xd(l,u){var g=u.action,x=u.payload,C=l.state;if(u.isTransition){var E=Qe.T,U={};Qe.T=U;try{var F=g(C,x),me=Qe.S;me!==null&&me(U,F),bd(l,u,F)}catch(Ne){zi(l,u,Ne)}finally{E!==null&&U.types!==null&&(E.types=U.types),Qe.T=E}}else try{E=g(C,x),bd(l,u,E)}catch(Ne){zi(l,u,Ne)}}function bd(l,u,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(x){Cl(l,u,x)},function(x){return zi(l,u,x)}):Cl(l,u,g)}function Cl(l,u,g){u.status="fulfilled",u.value=g,bh(u),l.state=g,u=l.pending,u!==null&&(g=u.next,g===u?l.pending=null:(g=g.next,u.next=g,xd(l,g)))}function zi(l,u,g){var x=l.pending;if(l.pending=null,x!==null){x=x.next;do u.status="rejected",u.reason=g,bh(u),u=u.next;while(u!==x)}l.action=null}function bh(l){l=l.listeners;for(var u=0;u<l.length;u++)(0,l[u])()}function vd(l,u){return u}function vh(l,u){if(Nt){var g=ht.formState;if(g!==null){e:{var x=it;if(Nt){if(Sn){var C=Zg(Sn,Wa);if(C){Sn=Ig(C),x=fp(C);break e}}ze(x)}x=!1}x&&(u=g[0])}}g=Ha(),g.memoizedState=g.baseState=u,x={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:u},g.queue=x,g=lg.bind(null,it,x),x.dispatch=g,x=xh(!1);var E=Cd.bind(null,it,!1,x.queue);return x=Ha(),C={state:u,dispatch:null,action:l,pending:null},x.queue=C,g=ci.bind(null,it,C,E,g),C.dispatch=g,x.memoizedState=l,[u,g,!1]}function So(l){var u=xn();return Dr(u,Ye,l)}function Dr(l,u,g){if(u=md(l,u,vd)[0],l=ui(xr)[0],typeof u=="object"&&u!==null&&typeof u.then=="function")try{var x=qa(u)}catch(U){throw U===ha?sr:U}else x=u;u=xn();var C=u.queue,E=C.dispatch;return g!==u.memoizedState&&(it.flags|=2048,Rs(9,{destroy:void 0},Sh.bind(null,C,g),null)),[x,E,l]}function Sh(l,u){l.action=u}function No(l){var u=xn(),g=Ye;if(g!==null)return Dr(u,g,l);xn(),u=u.memoizedState,g=xn();var x=g.queue.dispatch;return g.memoizedState=l,[u,x,!1]}function Rs(l,u,g,x){return l={tag:l,create:g,deps:x,inst:u,next:null},u=it.updateQueue,u===null&&(u=hd(),it.updateQueue=u),g=u.lastEffect,g===null?u.lastEffect=l.next=l:(x=g.next,g.next=l,l.next=x,u.lastEffect=l),l}function Sd(){return xn().memoizedState}function jl(l,u,g,x){var C=Ha();it.flags|=l,C.memoizedState=Rs(1|u,{destroy:void 0},g,x===void 0?null:x)}function Xu(l,u,g,x){var C=xn();x=x===void 0?null:x;var E=C.memoizedState.inst;Ye!==null&&x!==null&&ph(x,Ye.memoizedState.deps)?C.memoizedState=Rs(u,E,g,x):(it.flags|=l,C.memoizedState=Rs(1|u,E,g,x))}function Fu(l,u){jl(8390656,8,l,u)}function _o(l,u){Xu(2048,8,l,u)}function ng(l){it.flags|=4;var u=it.updateQueue;if(u===null)u=hd(),it.updateQueue=u,u.events=[l];else{var g=u.events;g===null?u.events=[l]:g.push(l)}}function Xa(l){var u=xn().memoizedState;return ng({ref:u,nextImpl:l}),function(){if((bt&2)!==0)throw Error(i(440));return u.impl.apply(void 0,arguments)}}function ki(l,u){return Xu(4,2,l,u)}function Zu(l,u){return Xu(4,4,l,u)}function Co(l,u){if(typeof u=="function"){l=l();var g=u(l);return function(){typeof g=="function"?g():u(null)}}if(u!=null)return l=l(),u.current=l,function(){u.current=null}}function ag(l,u,g){g=g!=null?g.concat([l]):null,Xu(4,4,Co.bind(null,u,l),g)}function Iu(){}function Nd(l,u){var g=xn();u=u===void 0?null:u;var x=g.memoizedState;return u!==null&&ph(u,x[1])?x[0]:(g.memoizedState=[l,u],l)}function jo(l,u){var g=xn();u=u===void 0?null:u;var x=g.memoizedState;if(u!==null&&ph(u,x[1]))return x[0];if(x=l(),Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,u],x}function wo(l,u,g){return g===void 0||(Ci&1073741824)!==0&&(_t&261930)===0?l.memoizedState=u:(l.memoizedState=g,l=hi(),it.lanes|=l,ji|=l,g)}function Nh(l,u,g,x){return In(g,u)?g:Xl.current!==null?(l=wo(l,g,x),In(l,u)||(mn=!0),l):(Ci&42)===0||(Ci&1073741824)!==0&&(_t&261930)===0?(mn=!0,l.memoizedState=g):(l=hi(),it.lanes|=l,ji|=l,u)}function sg(l,u,g,x,C){var E=Js();St(E!==0&&8>E?E:8);var U=Qe.T,F={};Qe.T=F,Cd(l,!1,u,g);try{var me=C(),Ne=Qe.S;if(Ne!==null&&Ne(F,me),me!==null&&typeof me=="object"&&typeof me.then=="function"){var Re=Cs(me,x);Ju(l,u,Re,bn(l))}else Ju(l,u,x,bn(l))}catch(Ce){Ju(l,u,{then:function(){},status:"rejected",reason:Ce},bn())}finally{St(E),U!==null&&F.types!==null&&(U.types=F.types),Qe.T=U}}function rg(l){var u=l.memoizedState;if(u!==null)return u;u={memoizedState:ql,baseState:ql,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:ql},next:null};var g={};return u.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:xr,lastRenderedState:g},next:null},l.memoizedState=u,l=l.alternate,l!==null&&(l.memoizedState=u),u}function _h(){return Zt(Bl)}function _d(){return xn().memoizedState}function ig(){return xn().memoizedState}function iy(l){for(var u=l.return;u!==null;){switch(u.tag){case 24:case 3:var g=bn();l=Tt(g);var x=pn(u,l,g);x!==null&&(On(x,u,g),Ar(x,u,g)),u={cache:hr()},l.payload=u;return}u=u.return}}function ly(l,u,g){var x=bn();g={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},jd(l)?og(u,g):(g=Ve(l,u,g,x),g!==null&&(On(g,l,x),ug(g,u,x)))}function lg(l,u,g){var x=bn();Ju(l,u,g,x)}function Ju(l,u,g,x){var C={lane:x,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(jd(l))og(u,C);else{var E=l.alternate;if(l.lanes===0&&(E===null||E.lanes===0)&&(E=u.lastRenderedReducer,E!==null))try{var U=u.lastRenderedState,F=E(U,g);if(C.hasEagerState=!0,C.eagerState=F,In(F,U))return et(l,u,C,0),ht===null&&Ue(),!1}catch{}finally{}if(g=Ve(l,u,C,x),g!==null)return On(g,l,x),ug(g,u,x),!0}return!1}function Cd(l,u,g,x){if(x={lane:2,revertLane:Ta(),gesture:null,action:x,hasEagerState:!1,eagerState:null,next:null},jd(l)){if(u)throw Error(i(479))}else u=Ve(l,g,x,2),u!==null&&On(u,l,2)}function jd(l){var u=l.alternate;return l===it||u!==null&&u===it}function og(l,u){ct=ft=!0;var g=l.pending;g===null?u.next=u:(u.next=g.next,g.next=u),l.pending=u}function ug(l,u,g){if((g&4194048)!==0){var x=u.lanes;x&=l.pendingLanes,g|=x,u.lanes=g,V(l,g)}}function Ch(l,u,g,x){u=l.memoizedState,g=g(x,u),g=g==null?u:Qd({},u,g),l.memoizedState=g,l.lanes===0&&(l.updateQueue.baseState=g)}function wd(l,u,g,x,C,E,U){return l=l.stateNode,typeof l.shouldComponentUpdate=="function"?l.shouldComponentUpdate(x,E,U):u.prototype&&u.prototype.isPureReactComponent?!Qt(g,x)||!Qt(C,E):!0}function cg(l,u,g,x){l=u.state,typeof u.componentWillReceiveProps=="function"&&u.componentWillReceiveProps(g,x),typeof u.UNSAFE_componentWillReceiveProps=="function"&&u.UNSAFE_componentWillReceiveProps(g,x),u.state!==l&&jc.enqueueReplaceState(u,u.state,null)}function wl(l,u){var g=u;if("ref"in u){g={};for(var x in u)x!=="ref"&&(g[x]=u[x])}if(l=l.defaultProps){g===u&&(g=Qd({},g));for(var C in l)g[C]===void 0&&(g[C]=l[C])}return g}function Ed(l,u){try{var g=l.onUncaughtError;g(u.value,{componentStack:u.stack})}catch(x){setTimeout(function(){throw x})}}function jh(l,u,g){try{var x=l.onCaughtError;x(g.value,{componentStack:g.stack,errorBoundary:u.tag===1?u.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function wh(l,u,g){return g=Tt(g),g.tag=3,g.payload={element:null},g.callback=function(){Ed(l,u)},g}function dg(l){return l=Tt(l),l.tag=3,l}function fg(l,u,g,x){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var E=x.value;l.payload=function(){return C(E)},l.callback=function(){jh(u,g,x)}}var U=g.stateNode;U!==null&&typeof U.componentDidCatch=="function"&&(l.callback=function(){jh(u,g,x),typeof C!="function"&&(wi===null?wi=new Set([this]):wi.add(this));var F=x.stack;this.componentDidCatch(x.value,{componentStack:F!==null?F:""})})}function oy(l,u,g,x,C){if(g.flags|=32768,x!==null&&typeof x=="object"&&typeof x.then=="function"){if(u=g.alternate,u!==null&&Et(u,g,C,!0),g=ys.current,g!==null){switch(g.tag){case 31:case 13:return es===null?Uo():g.alternate===null&&zn===0&&(zn=3),g.flags&=-257,g.flags|=65536,g.lanes=C,x===Ir?g.flags|=16384:(u=g.updateQueue,u===null?g.updateQueue=new Set([x]):u.add(x),Bo(l,x,C)),!1;case 22:return g.flags|=65536,x===Ir?g.flags|=16384:(u=g.updateQueue,u===null?(u={transitions:null,markerInstances:null,retryQueue:new Set([x])},g.updateQueue=u):(g=u.retryQueue,g===null?u.retryQueue=new Set([x]):g.add(x)),Bo(l,x,C)),!1}throw Error(i(435,g.tag))}return Bo(l,x,C),Uo(),!1}if(Nt)return u=ys.current,u!==null?((u.flags&65536)===0&&(u.flags|=256),u.flags|=65536,u.lanes=C,x!==mf&&(l=Error(i(422),{cause:x}),Qn(_e(l,g)))):(x!==mf&&(u=Error(i(423),{cause:x}),Qn(_e(u,g))),l=l.current.alternate,l.flags|=65536,C&=-C,l.lanes|=C,x=_e(x,g),C=wh(l.stateNode,x,C),us(l,C),zn!==4&&(zn=2)),!1;var E=Error(i(520),{cause:x});if(E=_e(E,g),Ec===null?Ec=[E]:Ec.push(E),zn!==4&&(zn=2),u===null)return!0;x=_e(x,g),g=u;do{switch(g.tag){case 3:return g.flags|=65536,l=C&-C,g.lanes|=l,l=wh(g.stateNode,x,l),us(g,l),!1;case 1:if(u=g.type,E=g.stateNode,(g.flags&128)===0&&(typeof u.getDerivedStateFromError=="function"||E!==null&&typeof E.componentDidCatch=="function"&&(wi===null||!wi.has(E))))return g.flags|=65536,C&=-C,g.lanes|=C,C=dg(C),fg(C,l,g,x),us(g,C),!1}g=g.return}while(g!==null);return!1}function Oa(l,u,g,x){u.child=l===null?Op(u,null,g,x):Da(u,l.child,g,x)}function hg(l,u,g,x,C){g=g.render;var E=u.ref;if("ref"in x){var U={};for(var F in x)F!=="ref"&&(U[F]=x[F])}else U=x;return hn(u),x=bo(l,u,g,U,E,C),F=fd(),l!==null&&!mn?(mh(l,u,C),zr(l,u,C)):(Nt&&F&&W(u),u.flags|=1,Oa(l,u,x,C),u.child)}function pg(l,u,g,x,C){if(l===null){var E=g.type;return typeof E=="function"&&!Al(E)&&E.defaultProps===void 0&&g.compare===null?(u.tag=15,u.type=E,mg(l,u,E,x,C)):(l=gi(g.type,null,x,u,u.mode,C),l.ref=u.ref,l.return=u,u.child=l)}if(E=l.child,!$u(l,C)){var U=E.memoizedProps;if(g=g.compare,g=g!==null?g:Qt,g(U,x)&&l.ref===u.ref)return zr(l,u,C)}return u.flags|=1,l=Ms(E,x),l.ref=u.ref,l.return=u,u.child=l}function mg(l,u,g,x,C){if(l!==null){var E=l.memoizedProps;if(Qt(E,x)&&l.ref===u.ref)if(mn=!1,u.pendingProps=x=E,$u(l,C))(l.flags&131072)!==0&&(mn=!0);else return u.lanes=l.lanes,zr(l,u,C)}return Rd(l,u,g,x,C)}function gg(l,u,g,x){var C=x.children,E=l!==null?l.memoizedState:null;if(l===null&&u.stateNode===null&&(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),x.mode==="hidden"){if((u.flags&128)!==0){if(E=E!==null?E.baseLanes|g:g,l!==null){for(x=u.child=l.child,C=0;x!==null;)C=C|x.lanes|x.childLanes,x=x.sibling;x=C&~E}else x=0,u.child=null;return Eo(l,u,E,g,x)}if((g&536870912)!==0)u.memoizedState={baseLanes:0,cachePool:null},l!==null&&yt(u,E!==null?E.cachePool:null),E!==null?yr(u,E):js(),Di(u);else return x=u.lanes=536870912,Eo(l,u,E!==null?E.baseLanes|g:g,g,x)}else E!==null?(yt(u,E.cachePool),yr(u,E),Es(),u.memoizedState=null):(l!==null&&yt(u,null),js(),Es());return Oa(l,u,C,g),u.child}function El(l,u){return l!==null&&l.tag===22||u.stateNode!==null||(u.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),u.sibling}function Eo(l,u,g,x,C){var E=mr();return E=E===null?null:{parent:Fn?Nn._currentValue:Nn._currentValue2,pool:E},u.memoizedState={baseLanes:g,cachePool:E},l!==null&&yt(u,null),js(),Di(u),l!==null&&Et(l,u,x,!0),u.childLanes=C,null}function Td(l,u){return u=Li({mode:u.mode,children:u.children},l.mode),u.ref=l.ref,l.child=u,u.return=l,u}function Eh(l,u,g){return Da(u,l.child,null,g),l=Td(u,u.pendingProps),l.flags|=2,Ts(u),u.memoizedState=null,l}function yg(l,u,g){var x=u.pendingProps,C=(u.flags&128)!==0;if(u.flags&=-129,l===null){if(Nt){if(x.mode==="hidden")return l=Td(u,x),u.lanes=536870912,El(null,l);if(dd(u),(l=Sn)?(l=pp(l,Wa),l!==null&&(u.memoizedState={dehydrated:l,treeContext:er!==null?{id:Aa,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},g=Vh(l),g.return=u,u.child=g,da=u,Sn=null)):l=null,l===null)throw ze(u);return u.lanes=536870912,null}return Td(u,x)}var E=l.memoizedState;if(E!==null){var U=E.dehydrated;if(dd(u),C)if(u.flags&256)u.flags&=-257,u=Eh(l,u,g);else if(u.memoizedState!==null)u.child=l.child,u.flags|=128,u=null;else throw Error(i(558));else if(mn||Et(l,u,g,!1),C=(g&l.childLanes)!==0,mn||C){if(x=ht,x!==null&&(U=Z(x,g),U!==0&&U!==E.retryLane))throw E.retryLane=U,ot(l,U),On(x,l,U),ts;Uo(),u=Eh(l,u,g)}else l=E.treeContext,vn&&(Sn=e0(U),da=u,Nt=!0,Zr=null,Wa=!1,l!==null&&re(u,l)),u=Td(u,x),u.flags|=4096;return u}return l=Ms(l.child,{mode:x.mode,children:x.children}),l.ref=u.ref,u.child=l,l.return=u,l}function Wu(l,u){var g=u.ref;if(g===null)l!==null&&l.ref!==null&&(u.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(i(284));(l===null||l.ref!==g)&&(u.flags|=4194816)}}function Rd(l,u,g,x,C){return hn(u),g=bo(l,u,g,x,void 0,C),x=fd(),l!==null&&!mn?(mh(l,u,C),zr(l,u,C)):(Nt&&x&&W(u),u.flags|=1,Oa(l,u,g,C),u.child)}function Th(l,u,g,x,C,E){return hn(u),u.updateQueue=null,g=Mr(u,x,g,C),Vu(l),x=fd(),l!==null&&!mn?(mh(l,u,E),zr(l,u,E)):(Nt&&x&&W(u),u.flags|=1,Oa(l,u,g,E),u.child)}function Tl(l,u,g,x,C){if(hn(u),u.stateNode===null){var E=Kr,U=g.contextType;typeof U=="object"&&U!==null&&(E=Zt(U)),E=new g(x,E),u.memoizedState=E.state!==null&&E.state!==void 0?E.state:null,E.updater=jc,u.stateNode=E,E._reactInternals=u,E=u.stateNode,E.props=x,E.state=u.memoizedState,E.refs={},ut(u),U=g.contextType,E.context=typeof U=="object"&&U!==null?Zt(U):Kr,E.state=u.memoizedState,U=g.getDerivedStateFromProps,typeof U=="function"&&(Ch(u,g,U,x),E.state=u.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof E.getSnapshotBeforeUpdate=="function"||typeof E.UNSAFE_componentWillMount!="function"&&typeof E.componentWillMount!="function"||(U=E.state,typeof E.componentWillMount=="function"&&E.componentWillMount(),typeof E.UNSAFE_componentWillMount=="function"&&E.UNSAFE_componentWillMount(),U!==E.state&&jc.enqueueReplaceState(E,E.state,null),Ps(u,x,E,C),Ka(),E.state=u.memoizedState),typeof E.componentDidMount=="function"&&(u.flags|=4194308),x=!0}else if(l===null){E=u.stateNode;var F=u.memoizedProps,me=wl(g,F);E.props=me;var Ne=E.context,Re=g.contextType;U=Kr,typeof Re=="object"&&Re!==null&&(U=Zt(Re));var Ce=g.getDerivedStateFromProps;Re=typeof Ce=="function"||typeof E.getSnapshotBeforeUpdate=="function",F=u.pendingProps!==F,Re||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(F||Ne!==U)&&cg(u,E,x,U),ks=!1;var Le=u.memoizedState;E.state=Le,Ps(u,x,E,C),Ka(),Ne=u.memoizedState,F||Le!==Ne||ks?(typeof Ce=="function"&&(Ch(u,g,Ce,x),Ne=u.memoizedState),(me=ks||wd(u,g,me,x,Le,Ne,U))?(Re||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"&&(u.flags|=4194308)):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),u.memoizedProps=x,u.memoizedState=Ne),E.props=x,E.state=Ne,E.context=U,x=me):(typeof E.componentDidMount=="function"&&(u.flags|=4194308),x=!1)}else{E=u.stateNode,sn(l,u),U=u.memoizedProps,Re=wl(g,U),E.props=Re,Ce=u.pendingProps,Le=E.context,Ne=g.contextType,me=Kr,typeof Ne=="object"&&Ne!==null&&(me=Zt(Ne)),F=g.getDerivedStateFromProps,(Ne=typeof F=="function"||typeof E.getSnapshotBeforeUpdate=="function")||typeof E.UNSAFE_componentWillReceiveProps!="function"&&typeof E.componentWillReceiveProps!="function"||(U!==Ce||Le!==me)&&cg(u,E,x,me),ks=!1,Le=u.memoizedState,E.state=Le,Ps(u,x,E,C),Ka();var st=u.memoizedState;U!==Ce||Le!==st||ks||l!==null&&l.dependencies!==null&&Un(l.dependencies)?(typeof F=="function"&&(Ch(u,g,F,x),st=u.memoizedState),(Re=ks||wd(u,g,Re,x,Le,st,me)||l!==null&&l.dependencies!==null&&Un(l.dependencies))?(Ne||typeof E.UNSAFE_componentWillUpdate!="function"&&typeof E.componentWillUpdate!="function"||(typeof E.componentWillUpdate=="function"&&E.componentWillUpdate(x,st,me),typeof E.UNSAFE_componentWillUpdate=="function"&&E.UNSAFE_componentWillUpdate(x,st,me)),typeof E.componentDidUpdate=="function"&&(u.flags|=4),typeof E.getSnapshotBeforeUpdate=="function"&&(u.flags|=1024)):(typeof E.componentDidUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=1024),u.memoizedProps=x,u.memoizedState=st),E.props=x,E.state=st,E.context=me,x=Re):(typeof E.componentDidUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=4),typeof E.getSnapshotBeforeUpdate!="function"||U===l.memoizedProps&&Le===l.memoizedState||(u.flags|=1024),x=!1)}return E=x,Wu(l,u),x=(u.flags&128)!==0,E||x?(E=u.stateNode,g=x&&typeof g.getDerivedStateFromError!="function"?null:E.render(),u.flags|=1,l!==null&&x?(u.child=Da(u,l.child,null,C),u.child=Da(u,null,g,C)):Oa(l,u,g,C),u.memoizedState=E.state,l=u.child):l=zr(l,u,C),l}function xg(l,u,g,x){return qt(),u.flags|=256,Oa(l,u,g,x),u.child}function Rh(l){return{baseLanes:l,cachePool:mt()}}function Oh(l,u,g){return l=l!==null?l.childLanes&~g:0,u&&(l|=ns),l}function Ah(l,u,g){var x=u.pendingProps,C=!1,E=(u.flags&128)!==0,U;if((U=E)||(U=l!==null&&l.memoizedState===null?!1:(Bn.current&2)!==0),U&&(C=!0,u.flags&=-129),U=(u.flags&32)!==0,u.flags&=-33,l===null){if(Nt){if(C?ws(u):Es(),(l=Sn)?(l=s0(l,Wa),l!==null&&(u.memoizedState={dehydrated:l,treeContext:er!==null?{id:Aa,overflow:vr}:null,retryLane:536870912,hydrationErrors:null},g=Vh(l),g.return=u,u.child=g,da=u,Sn=null)):l=null,l===null)throw ze(u);return $d(l)?u.lanes=32:u.lanes=536870912,null}var F=x.children;return x=x.fallback,C?(Es(),C=u.mode,F=Li({mode:"hidden",children:F},C),x=Zs(x,C,g,null),F.return=u,x.return=u,F.sibling=x,u.child=F,x=u.child,x.memoizedState=Rh(g),x.childLanes=Oh(l,U,g),u.memoizedState=Fl,El(null,x)):(ws(u),Od(u,F))}var me=l.memoizedState;if(me!==null&&(F=me.dehydrated,F!==null)){if(E)u.flags&256?(ws(u),u.flags&=-257,u=Rl(l,u,g)):u.memoizedState!==null?(Es(),u.child=l.child,u.flags|=128,u=null):(Es(),F=x.fallback,C=u.mode,x=Li({mode:"visible",children:x.children},C),F=Zs(F,C,g,null),F.flags|=2,x.return=u,F.return=u,x.sibling=F,u.child=x,Da(u,l.child,null,g),x=u.child,x.memoizedState=Rh(g),x.childLanes=Oh(l,U,g),u.memoizedState=Fl,u=El(null,x));else if(ws(u),$d(F))U=ef(F).digest,x=Error(i(419)),x.stack="",x.digest=U,Qn({value:x,source:null,stack:null}),u=Rl(l,u,g);else if(mn||Et(l,u,g,!1),U=(g&l.childLanes)!==0,mn||U){if(U=ht,U!==null&&(x=Z(U,g),x!==0&&x!==me.retryLane))throw me.retryLane=x,ot(l,x),On(U,l,x),ts;Zi(F)||Uo(),u=Rl(l,u,g)}else Zi(F)?(u.flags|=192,u.child=l.child,u=null):(l=me.treeContext,vn&&(Sn=t0(F),da=u,Nt=!0,Zr=null,Wa=!1,l!==null&&re(u,l)),u=Od(u,x.children),u.flags|=4096);return u}return C?(Es(),F=x.fallback,C=u.mode,me=l.child,E=me.sibling,x=Ms(me,{mode:"hidden",children:x.children}),x.subtreeFlags=me.subtreeFlags&65011712,E!==null?F=Ms(E,F):(F=Zs(F,C,g,null),F.flags|=2),F.return=u,x.return=u,x.sibling=F,u.child=x,El(null,x),x=u.child,F=l.child.memoizedState,F===null?F=Rh(g):(C=F.cachePool,C!==null?(me=Fn?Nn._currentValue:Nn._currentValue2,C=C.parent!==me?{parent:me,pool:me}:C):C=mt(),F={baseLanes:F.baseLanes|g,cachePool:C}),x.memoizedState=F,x.childLanes=Oh(l,U,g),u.memoizedState=Fl,El(l.child,x)):(ws(u),g=l.child,l=g.sibling,g=Ms(g,{mode:"visible",children:x.children}),g.return=u,g.sibling=null,l!==null&&(U=u.deletions,U===null?(u.deletions=[l],u.flags|=16):U.push(l)),u.child=g,u.memoizedState=null,g)}function Od(l,u){return u=Li({mode:"visible",children:u},l.mode),u.return=l,l.child=u}function Li(l,u){return l=n(22,l,null,u),l.lanes=0,l}function Rl(l,u,g){return Da(u,l.child,null,g),l=Od(u,u.pendingProps.children),l.flags|=2,u.memoizedState=null,l}function bg(l,u,g){l.lanes|=u;var x=l.alternate;x!==null&&(x.lanes|=u),fr(l.return,u,g)}function To(l,u,g,x,C,E){var U=l.memoizedState;U===null?l.memoizedState={isBackwards:u,rendering:null,renderingStartTime:0,last:x,tail:g,tailMode:C,treeForkCount:E}:(U.isBackwards=u,U.rendering=null,U.renderingStartTime=0,U.last=x,U.tail=g,U.tailMode=C,U.treeForkCount=E)}function Mh(l,u,g){var x=u.pendingProps,C=x.revealOrder,E=x.tail;x=x.children;var U=Bn.current,F=(U&2)!==0;if(F?(U=U&1|2,u.flags|=128):U&=1,w(Bn,U),Oa(l,u,x,g),x=Nt?Nc:0,!F&&l!==null&&(l.flags&128)!==0)e:for(l=u.child;l!==null;){if(l.tag===13)l.memoizedState!==null&&bg(l,g,u);else if(l.tag===19)bg(l,g,u);else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===u)break e;for(;l.sibling===null;){if(l.return===null||l.return===u)break e;l=l.return}l.sibling.return=l.return,l=l.sibling}switch(C){case"forwards":for(g=u.child,C=null;g!==null;)l=g.alternate,l!==null&&Yu(l)===null&&(C=g),g=g.sibling;g=C,g===null?(C=u.child,u.child=null):(C=g.sibling,g.sibling=null),To(u,!1,C,g,E,x);break;case"backwards":case"unstable_legacy-backwards":for(g=null,C=u.child,u.child=null;C!==null;){if(l=C.alternate,l!==null&&Yu(l)===null){u.child=C;break}l=C.sibling,C.sibling=g,g=C,C=l}To(u,!0,g,null,E,x);break;case"together":To(u,!1,null,null,void 0,x);break;default:u.memoizedState=null}return u.child}function zr(l,u,g){if(l!==null&&(u.dependencies=l.dependencies),ji|=u.lanes,(g&u.childLanes)===0)if(l!==null){if(Et(l,u,g,!1),(g&u.childLanes)===0)return null}else return null;if(l!==null&&u.child!==l.child)throw Error(i(153));if(u.child!==null){for(l=u.child,g=Ms(l,l.pendingProps),u.child=g,g.return=u;l.sibling!==null;)l=l.sibling,g=g.sibling=Ms(l,l.pendingProps),g.return=u;g.sibling=null}return u.child}function $u(l,u){return(l.lanes&u)!==0?!0:(l=l.dependencies,!!(l!==null&&Un(l)))}function Dh(l,u,g){switch(u.tag){case 3:Se(u,u.stateNode.containerInfo),Gt(u,Nn,l.memoizedState.cache),qt();break;case 27:case 5:De(u);break;case 4:Se(u,u.stateNode.containerInfo);break;case 10:Gt(u,u.type,u.memoizedProps.value);break;case 31:if(u.memoizedState!==null)return u.flags|=128,dd(u),null;break;case 13:var x=u.memoizedState;if(x!==null)return x.dehydrated!==null?(ws(u),u.flags|=128,null):(g&u.child.childLanes)!==0?Ah(l,u,g):(ws(u),l=zr(l,u,g),l!==null?l.sibling:null);ws(u);break;case 19:var C=(l.flags&128)!==0;if(x=(g&u.childLanes)!==0,x||(Et(l,u,g,!1),x=(g&u.childLanes)!==0),C){if(x)return Mh(l,u,g);u.flags|=128}if(C=u.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),w(Bn,Bn.current),x)break;return null;case 22:return u.lanes=0,gg(l,u,g,u.pendingProps);case 24:Gt(u,Nn,l.memoizedState.cache)}return zr(l,u,g)}function zh(l,u,g){if(l!==null)if(l.memoizedProps!==u.pendingProps)mn=!0;else{if(!$u(l,g)&&(u.flags&128)===0)return mn=!1,Dh(l,u,g);mn=(l.flags&131072)!==0}else mn=!1,Nt&&(u.flags&1048576)!==0&&G(u,Nc,u.index);switch(u.lanes=0,u.tag){case 16:e:{var x=u.pendingProps;if(l=rn(u.elementType),u.type=l,typeof l=="function")Al(l)?(x=wl(l,x),u.tag=1,u=Tl(null,u,l,x,g)):(u.tag=0,u=Rd(null,u,l,x,g));else{if(l!=null){var C=l.$$typeof;if(C===Go){u.tag=11,u=hg(null,u,l,x,g);break e}else if(C===Xd){u.tag=14,u=pg(null,u,l,x,g);break e}}throw u=b(l)||l,Error(i(306,u,""))}}return u;case 0:return Rd(l,u,u.type,u.pendingProps,g);case 1:return x=u.type,C=wl(x,u.pendingProps),Tl(l,u,x,C,g);case 3:e:{if(Se(u,u.stateNode.containerInfo),l===null)throw Error(i(387));var E=u.pendingProps;C=u.memoizedState,x=C.element,sn(l,u),Ps(u,E,null,g);var U=u.memoizedState;if(E=U.cache,Gt(u,Nn,E),E!==C.cache&&Ft(u,[Nn],g,!0),Ka(),E=U.element,vn&&C.isDehydrated)if(C={element:E,isDehydrated:!1,cache:U.cache},u.updateQueue.baseState=C,u.memoizedState=C,u.flags&256){u=xg(l,u,E,g);break e}else if(E!==x){x=_e(Error(i(424)),u),Qn(x),u=xg(l,u,E,g);break e}else for(vn&&(Sn=$g(u.stateNode.containerInfo),da=u,Nt=!0,Zr=null,Wa=!0),g=Op(u,null,E,g),u.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling;else{if(qt(),E===x){u=zr(l,u,g);break e}Oa(l,u,E,g)}u=u.child}return u;case 26:if(Ws)return Wu(l,u),l===null?(g=bp(u.type,null,u.pendingProps,null))?u.memoizedState=g:Nt||(u.stateNode=sf(u.type,u.pendingProps,Ma.current,u)):u.memoizedState=bp(u.type,l.memoizedProps,u.pendingProps,l.memoizedState),null;case 27:if(ca)return De(u),l===null&&ca&&Nt&&(x=u.stateNode=rf(u.type,u.pendingProps,Ma.current,_a.current,!1),da=u,Wa=!0,Sn=hp(u.type,x,Sn)),Oa(l,u,u.pendingProps.children,g),Wu(l,u),l===null&&(u.flags|=4194304),u.child;case 5:return l===null&&Nt&&(h0(u.type,u.pendingProps,_a.current),(C=x=Sn)&&(x=n0(x,u.type,u.pendingProps,Wa),x!==null?(u.stateNode=x,da=u,Sn=Wg(x),Wa=!1,C=!0):C=!1),C||ze(u)),De(u),C=u.type,E=u.pendingProps,U=l!==null?l.memoizedProps:null,x=E.children,Ja(C,E)?x=null:U!==null&&Ja(C,U)&&(u.flags|=32),u.memoizedState!==null&&(C=bo(l,u,Ys,null,null,g),Fn?Bl._currentValue=C:Bl._currentValue2=C),Wu(l,u),Oa(l,u,x,g),u.child;case 6:return l===null&&Nt&&(xp(u.pendingProps,_a.current),(l=g=Sn)&&(g=a0(g,u.pendingProps,Wa),g!==null?(u.stateNode=g,da=u,Sn=null,l=!0):l=!1),l||ze(u)),null;case 13:return Ah(l,u,g);case 4:return Se(u,u.stateNode.containerInfo),x=u.pendingProps,l===null?u.child=Da(u,null,x,g):Oa(l,u,x,g),u.child;case 11:return hg(l,u,u.type,u.pendingProps,g);case 7:return Oa(l,u,u.pendingProps,g),u.child;case 8:return Oa(l,u,u.pendingProps.children,g),u.child;case 12:return Oa(l,u,u.pendingProps.children,g),u.child;case 10:return x=u.pendingProps,Gt(u,u.type,x.value),Oa(l,u,x.children,g),u.child;case 9:return C=u.type._context,x=u.pendingProps.children,hn(u),C=Zt(C),x=x(C),u.flags|=1,Oa(l,u,x,g),u.child;case 14:return pg(l,u,u.type,u.pendingProps,g);case 15:return mg(l,u,u.type,u.pendingProps,g);case 19:return Mh(l,u,g);case 31:return yg(l,u,g);case 22:return gg(l,u,g,u.pendingProps);case 24:return hn(u),x=Zt(Nn),l===null?(C=mr(),C===null&&(C=ht,E=hr(),C.pooledCache=E,E.refCount++,E!==null&&(C.pooledCacheLanes|=g),C=E),u.memoizedState={parent:x,cache:C},ut(u),Gt(u,Nn,C)):((l.lanes&g)!==0&&(sn(l,u),Ps(u,null,null,g),Ka()),C=l.memoizedState,E=u.memoizedState,C.parent!==x?(C={parent:x,cache:x},u.memoizedState=C,u.lanes===0&&(u.memoizedState=u.updateQueue.baseState=C),Gt(u,Nn,x)):(x=E.cache,Gt(u,Nn,x),x!==C.cache&&Ft(u,[Nn],g,!0))),Oa(l,u,u.pendingProps.children,g),u.child;case 29:throw u.pendingProps}throw Error(i(156,u.tag))}function Vs(l){l.flags|=4}function ec(l){Ds&&(l.flags|=8)}function vg(l,u){if(l!==null&&l.child===u.child)return!1;if((u.flags&16)!==0)return!0;for(l=u.child;l!==null;){if((l.flags&8218)!==0||(l.subtreeFlags&8218)!==0)return!0;l=l.sibling}return!1}function kh(l,u,g,x){if(wt)for(g=u.child;g!==null;){if(g.tag===5||g.tag===6)pc(l,g.stateNode);else if(!(g.tag===4||ca&&g.tag===27)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===u)break;for(;g.sibling===null;){if(g.return===null||g.return===u)return;g=g.return}g.sibling.return=g.return,g=g.sibling}else if(Ds)for(var C=u.child;C!==null;){if(C.tag===5){var E=C.stateNode;g&&x&&(E=Fg(E,C.type,C.memoizedProps)),pc(l,E)}else if(C.tag===6)E=C.stateNode,g&&x&&(E=dp(E,C.memoizedProps)),pc(l,E);else if(C.tag!==4){if(C.tag===22&&C.memoizedState!==null)E=C.child,E!==null&&(E.return=C),kh(l,C,!0,!0);else if(C.child!==null){C.child.return=C,C=C.child;continue}}if(C===u)break;for(;C.sibling===null;){if(C.return===null||C.return===u)return;C=C.return}C.sibling.return=C.return,C=C.sibling}}function Sg(l,u,g,x){var C=!1;if(Ds)for(var E=u.child;E!==null;){if(E.tag===5){var U=E.stateNode;g&&x&&(U=Fg(U,E.type,E.memoizedProps)),up(l,U)}else if(E.tag===6)U=E.stateNode,g&&x&&(U=dp(U,E.memoizedProps)),up(l,U);else if(E.tag!==4){if(E.tag===22&&E.memoizedState!==null)C=E.child,C!==null&&(C.return=E),Sg(l,E,!0,!0),C=!0;else if(E.child!==null){E.child.return=E,E=E.child;continue}}if(E===u)break;for(;E.sibling===null;){if(E.return===null||E.return===u)return C;E=E.return}E.sibling.return=E.return,E=E.sibling}return C}function Ng(l,u){if(Ds&&vg(l,u)){l=u.stateNode;var g=l.containerInfo,x=op();Sg(x,u,!1,!1),l.pendingChildren=x,Vs(u),Xg(g,x)}}function Lh(l,u,g,x){if(wt)l.memoizedProps!==x&&Vs(u);else if(Ds){var C=l.stateNode,E=l.memoizedProps;if((l=vg(l,u))||E!==x){var U=_a.current;E=Kg(C,g,E,x,!l,null),E===C?u.stateNode=C:(ec(u),hs(E,g,x,U)&&Vs(u),u.stateNode=E,l&&kh(E,u,!1,!1))}else u.stateNode=C}}function Fa(l,u,g,x,C){if((l.mode&32)!==0&&(g===null?mc(u,x):Ko(u,g,x))){if(l.flags|=16777216,(C&335544128)===C||Jh(u,x))if(An(l.stateNode,u,x))l.flags|=8192;else if(jt())l.flags|=8192;else throw $a=Ir,yf}else l.flags&=-16777217}function Ro(l,u){if(_p(u)){if(l.flags|=16777216,!Cp(u))if(jt())l.flags|=8192;else throw $a=Ir,yf}else l.flags&=-16777217}function tc(l,u){u!==null&&(l.flags|=4),l.flags&16384&&(u=l.tag!==22?k():536870912,l.lanes|=u,tu|=u)}function Oo(l,u){if(!Nt)switch(l.tailMode){case"hidden":u=l.tail;for(var g=null;u!==null;)u.alternate!==null&&(g=u),u=u.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?u||l.tail===null?l.tail=null:l.tail.sibling=null:x.sibling=null}}function ln(l){var u=l.alternate!==null&&l.alternate.child===l.child,g=0,x=0;if(u)for(var C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags&65011712,x|=C.flags&65011712,C.return=l,C=C.sibling;else for(C=l.child;C!==null;)g|=C.lanes|C.childLanes,x|=C.subtreeFlags,x|=C.flags,C.return=l,C=C.sibling;return l.subtreeFlags|=x,l.childLanes=g,u}function _g(l,u,g){var x=u.pendingProps;switch(he(u),u.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return ln(u),null;case 1:return ln(u),null;case 3:return g=u.stateNode,x=null,l!==null&&(x=l.memoizedState.cache),u.memoizedState.cache!==x&&(u.flags|=2048),fn(Nn),je(),g.pendingContext&&(g.context=g.pendingContext,g.pendingContext=null),(l===null||l.child===null)&&(At(u)?Vs(u):l===null||l.memoizedState.isDehydrated&&(u.flags&256)===0||(u.flags|=1024,wn())),Ng(l,u),ln(u),null;case 26:if(Ws){var C=u.type,E=u.memoizedState;return l===null?(Vs(u),E!==null?(ln(u),Ro(u,E)):(ln(u),Fa(u,C,null,x,g))):E?E!==l.memoizedState?(Vs(u),ln(u),Ro(u,E)):(ln(u),u.flags&=-16777217):(E=l.memoizedProps,wt?E!==x&&Vs(u):Lh(l,u,C,x),ln(u),Fa(u,C,E,x,g)),null}case 27:if(ca){if(nt(u),g=Ma.current,C=u.type,l!==null&&u.stateNode!=null)wt?l.memoizedProps!==x&&Vs(u):Lh(l,u,C,x);else{if(!x){if(u.stateNode===null)throw Error(i(166));return ln(u),null}l=_a.current,At(u)?Vt(u,l):(l=rf(C,x,g,l,!0),u.stateNode=l,Vs(u))}return ln(u),null}case 5:if(nt(u),C=u.type,l!==null&&u.stateNode!=null)Lh(l,u,C,x);else{if(!x){if(u.stateNode===null)throw Error(i(166));return ln(u),null}if(E=_a.current,At(u))Vt(u,E),c0(u.stateNode,C,x,E)&&(u.flags|=64);else{var U=Zh(C,x,Ma.current,E,u);ec(u),kh(U,u,!1,!1),u.stateNode=U,hs(U,C,x,E)&&Vs(u)}}return ln(u),Fa(u,u.type,l===null?null:l.memoizedProps,u.pendingProps,g),null;case 6:if(l&&u.stateNode!=null)g=l.memoizedProps,wt?g!==x&&Vs(u):Ds&&(g!==x?(l=Ma.current,g=_a.current,ec(u),u.stateNode=bi(x,l,g,u)):u.stateNode=l.stateNode);else{if(typeof x!="string"&&u.stateNode===null)throw Error(i(166));if(l=Ma.current,g=_a.current,At(u)){if(!vn)throw Error(i(176));if(l=u.stateNode,g=u.memoizedProps,x=null,C=da,C!==null)switch(C.tag){case 27:case 5:x=C.memoizedProps}hy(l,g,u,x)||ze(u,!0)}else ec(u),u.stateNode=bi(x,l,g,u)}return ln(u),null;case 31:if(g=u.memoizedState,l===null||l.memoizedState!==null){if(x=At(u),g!==null){if(l===null){if(!x)throw Error(i(318));if(!vn)throw Error(i(556));if(l=u.memoizedState,l=l!==null?l.dehydrated:null,!l)throw Error(i(557));mp(l,u)}else qt(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ln(u),l=!1}else g=wn(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=g),l=!0;if(!l)return u.flags&256?(Ts(u),u):(Ts(u),null);if((u.flags&128)!==0)throw Error(i(558))}return ln(u),null;case 13:if(x=u.memoizedState,l===null||l.memoizedState!==null&&l.memoizedState.dehydrated!==null){if(C=At(u),x!==null&&x.dehydrated!==null){if(l===null){if(!C)throw Error(i(318));if(!vn)throw Error(i(344));if(C=u.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(i(317));i0(C,u)}else qt(),(u.flags&128)===0&&(u.memoizedState=null),u.flags|=4;ln(u),C=!1}else C=wn(),l!==null&&l.memoizedState!==null&&(l.memoizedState.hydrationErrors=C),C=!0;if(!C)return u.flags&256?(Ts(u),u):(Ts(u),null)}return Ts(u),(u.flags&128)!==0?(u.lanes=g,u):(g=x!==null,l=l!==null&&l.memoizedState!==null,g&&(x=u.child,C=null,x.alternate!==null&&x.alternate.memoizedState!==null&&x.alternate.memoizedState.cachePool!==null&&(C=x.alternate.memoizedState.cachePool.pool),E=null,x.memoizedState!==null&&x.memoizedState.cachePool!==null&&(E=x.memoizedState.cachePool.pool),E!==C&&(x.flags|=2048)),g!==l&&g&&(u.child.flags|=8192),tc(u,u.updateQueue),ln(u),null);case 4:return je(),Ng(l,u),l===null&&tn(u.stateNode.containerInfo),ln(u),null;case 10:return fn(u.type),ln(u),null;case 19:if(j(Bn),x=u.memoizedState,x===null)return ln(u),null;if(C=(u.flags&128)!==0,E=x.rendering,E===null)if(C)Oo(x,!1);else{if(zn!==0||l!==null&&(l.flags&128)!==0)for(l=u.child;l!==null;){if(E=Yu(l),E!==null){for(u.flags|=128,Oo(x,!1),l=E.updateQueue,u.updateQueue=l,tc(u,l),u.subtreeFlags=0,l=g,g=u.child;g!==null;)Pd(g,l),g=g.sibling;return w(Bn,Bn.current&1|2),Nt&&ge(u,x.treeForkCount),u.child}l=l.sibling}x.tail!==null&&Ga()>il&&(u.flags|=128,C=!0,Oo(x,!1),u.lanes=4194304)}else{if(!C)if(l=Yu(E),l!==null){if(u.flags|=128,C=!0,l=l.updateQueue,u.updateQueue=l,tc(u,l),Oo(x,!0),x.tail===null&&x.tailMode==="hidden"&&!E.alternate&&!Nt)return ln(u),null}else 2*Ga()-x.renderingStartTime>il&&g!==536870912&&(u.flags|=128,C=!0,Oo(x,!1),u.lanes=4194304);x.isBackwards?(E.sibling=u.child,u.child=E):(l=x.last,l!==null?l.sibling=E:u.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=Bn.current,w(Bn,C?g&1|2:g&1),Nt&&ge(u,x.treeForkCount),l):(ln(u),null);case 22:case 23:return Ts(u),En(),x=u.memoizedState!==null,l!==null?l.memoizedState!==null!==x&&(u.flags|=8192):x&&(u.flags|=8192),x?(g&536870912)!==0&&(u.flags&128)===0&&(ln(u),u.subtreeFlags&6&&(u.flags|=8192)):ln(u),g=u.updateQueue,g!==null&&tc(u,g.retryQueue),g=null,l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),x=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(x=u.memoizedState.cachePool.pool),x!==g&&(u.flags|=2048),l!==null&&j(Wi),null;case 24:return g=null,l!==null&&(g=l.memoizedState.cache),u.memoizedState.cache!==g&&(u.flags|=2048),fn(Nn),ln(u),null;case 25:return null;case 30:return null}throw Error(i(156,u.tag))}function Uh(l,u){switch(he(u),u.tag){case 1:return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 3:return fn(Nn),je(),l=u.flags,(l&65536)!==0&&(l&128)===0?(u.flags=l&-65537|128,u):null;case 26:case 27:case 5:return nt(u),null;case 31:if(u.memoizedState!==null){if(Ts(u),u.alternate===null)throw Error(i(340));qt()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 13:if(Ts(u),l=u.memoizedState,l!==null&&l.dehydrated!==null){if(u.alternate===null)throw Error(i(340));qt()}return l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 19:return j(Bn),null;case 4:return je(),null;case 10:return fn(u.type),null;case 22:case 23:return Ts(u),En(),l!==null&&j(Wi),l=u.flags,l&65536?(u.flags=l&-65537|128,u):null;case 24:return fn(Nn),null;case 25:return null;default:return null}}function Cg(l,u){switch(he(u),u.tag){case 3:fn(Nn),je();break;case 26:case 27:case 5:nt(u);break;case 4:je();break;case 31:u.memoizedState!==null&&Ts(u);break;case 13:Ts(u);break;case 19:j(Bn);break;case 10:fn(u.type);break;case 22:case 23:Ts(u),En(),l!==null&&j(Wi);break;case 24:fn(Nn)}}function kr(l,u){try{var g=u.updateQueue,x=g!==null?g.lastEffect:null;if(x!==null){var C=x.next;g=C;do{if((g.tag&l)===l){x=void 0;var E=g.create,U=g.inst;x=E(),U.destroy=x}g=g.next}while(g!==C)}}catch(F){We(u,u.return,F)}}function Lr(l,u,g){try{var x=u.updateQueue,C=x!==null?x.lastEffect:null;if(C!==null){var E=C.next;x=E;do{if((x.tag&l)===l){var U=x.inst,F=U.destroy;if(F!==void 0){U.destroy=void 0,C=u;var me=g,Ne=F;try{Ne()}catch(Re){We(C,me,Re)}}}x=x.next}while(x!==E)}}catch(Re){We(u,u.return,Re)}}function Ao(l){var u=l.updateQueue;if(u!==null){var g=l.stateNode;try{gr(u,g)}catch(x){We(l,l.return,x)}}}function Ad(l,u,g){g.props=wl(l.type,l.memoizedProps),g.state=l.memoizedState;try{g.componentWillUnmount()}catch(x){We(l,u,x)}}function Mo(l,u){try{var g=l.ref;if(g!==null){switch(l.tag){case 26:case 27:case 5:var x=Yo(l.stateNode);break;case 30:x=l.stateNode;break;default:x=l.stateNode}typeof g=="function"?l.refCleanup=g(x):g.current=x}}catch(C){We(l,u,C)}}function Ba(l,u){var g=l.ref,x=l.refCleanup;if(g!==null)if(typeof x=="function")try{x()}catch(C){We(l,u,C)}finally{l.refCleanup=null,l=l.alternate,l!=null&&(l.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){We(l,u,C)}else g.current=null}function Ol(l){var u=l.type,g=l.memoizedProps,x=l.stateNode;try{Hg(x,u,g,l)}catch(C){We(l,l.return,C)}}function nc(l,u,g){try{qg(l.stateNode,l.type,g,u,l)}catch(x){We(l,l.return,x)}}function Hh(l){return l.tag===5||l.tag===3||(Ws?l.tag===26:!1)||(ca?l.tag===27&&Gl(l.type):!1)||l.tag===4}function di(l){e:for(;;){for(;l.sibling===null;){if(l.return===null||Hh(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(ca&&l.tag===27&&Gl(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,u,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,u?Gg(g,l,u):sp(g,l);else if(x!==4&&(ca&&x===27&&Gl(l.type)&&(g=l.stateNode,u=null),l=l.child,l!==null))for(Md(l,u,g),l=l.sibling;l!==null;)Md(l,u,g),l=l.sibling}function ac(l,u,g){var x=l.tag;if(x===5||x===6)l=l.stateNode,u?Bg(g,l,u):ap(g,l);else if(x!==4&&(ca&&x===27&&Gl(l.type)&&(g=l.stateNode),l=l.child,l!==null))for(ac(l,u,g),l=l.sibling;l!==null;)ac(l,u,g),l=l.sibling}function qh(l,u,g){l=l.containerInfo;try{cp(l,g)}catch(x){We(u,u.return,x)}}function jg(l){var u=l.stateNode,g=l.memoizedProps;try{na(l.type,g,u,l)}catch(x){We(l,l.return,x)}}function uy(l,u){for(Fd(l.containerInfo),Jn=u;Jn!==null;)if(l=Jn,u=l.child,(l.subtreeFlags&1028)!==0&&u!==null)u.return=l,Jn=u;else for(;Jn!==null;){l=Jn;var g=l.alternate;switch(u=l.flags,l.tag){case 0:if((u&4)!==0&&(u=l.updateQueue,u=u!==null?u.events:null,u!==null))for(var x=0;x<u.length;x++){var C=u[x];C.ref.impl=C.nextImpl}break;case 11:case 15:break;case 1:if((u&1024)!==0&&g!==null){u=void 0,x=l,C=g.memoizedProps,g=g.memoizedState;var E=x.stateNode;try{var U=wl(x.type,C);u=E.getSnapshotBeforeUpdate(U,g),E.__reactInternalSnapshotBeforeUpdate=u}catch(F){We(x,x.return,F)}}break;case 3:(u&1024)!==0&&wt&&lp(l.stateNode.containerInfo);break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(i(163))}if(u=l.sibling,u!==null){u.return=l.return,Jn=u;break}Jn=l.return}}function wg(l,u,g){var x=g.flags;switch(g.tag){case 0:case 11:case 15:Za(l,g),x&4&&kr(5,g);break;case 1:if(Za(l,g),x&4)if(l=g.stateNode,u===null)try{l.componentDidMount()}catch(U){We(g,g.return,U)}else{var C=wl(g.type,u.memoizedProps);u=u.memoizedState;try{l.componentDidUpdate(C,u,l.__reactInternalSnapshotBeforeUpdate)}catch(U){We(g,g.return,U)}}x&64&&Ao(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=Yo(g.child.stateNode);break;case 1:l=g.child.stateNode}try{gr(x,l)}catch(U){We(g,g.return,U)}}break;case 27:ca&&u===null&&x&4&&jg(g);case 26:case 5:if(Za(l,g),u===null){if(x&4)Ol(g);else if(x&64){l=g.type,u=g.memoizedProps,C=g.stateNode;try{o0(C,l,u,g)}catch(U){We(g,g.return,U)}}}x&512&&Mo(g,g.return);break;case 12:Za(l,g);break;case 31:Za(l,g),x&4&&Ks(l,g);break;case 13:Za(l,g),x&4&&rc(l,g),x&64&&(x=g.memoizedState,x!==null&&(x=x.dehydrated,x!==null&&(g=cy.bind(null,g),tf(x,g))));break;case 22:if(x=g.memoizedState!==null||Gn,!x){u=u!==null&&u.memoizedState!==null||Pn,C=Gn;var E=Pn;Gn=x,(Pn=u)&&!E?Fs(l,g,(g.subtreeFlags&8772)!==0):Za(l,g),Gn=C,Pn=E}break;case 30:break;default:Za(l,g)}}function Bh(l){var u=l.alternate;u!==null&&(l.alternate=null,Bh(u)),l.child=null,l.deletions=null,l.sibling=null,l.tag===5&&(u=l.stateNode,u!==null&&Zd(u)),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 Qs(l,u,g){for(g=g.child;g!==null;)sc(l,u,g),g=g.sibling}function sc(l,u,g){if(gs&&typeof gs.onCommitFiberUnmount=="function")try{gs.onCommitFiberUnmount(Vl,g)}catch{}switch(g.tag){case 26:if(Ws){Pn||Ba(g,u),Qs(l,u,g),g.memoizedState?Ii(g.memoizedState):g.stateNode&&Np(g.stateNode);break}case 27:if(ca){Pn||Ba(g,u);var x=Dn,C=Wn;Gl(g.type)&&(Dn=g.stateNode,Wn=!1),Qs(l,u,g),Na(g.stateNode),Dn=x,Wn=C;break}case 5:Pn||Ba(g,u);case 6:if(wt){if(x=Dn,C=Wn,Dn=null,Qs(l,u,g),Dn=x,Wn=C,Dn!==null)if(Wn)try{rp(Dn,g.stateNode)}catch(E){We(g,u,E)}else try{Pg(Dn,g.stateNode)}catch(E){We(g,u,E)}}else Qs(l,u,g);break;case 18:wt&&Dn!==null&&(Wn?nf(Dn,g.stateNode):yp(Dn,g.stateNode));break;case 4:wt?(x=Dn,C=Wn,Dn=g.stateNode.containerInfo,Wn=!0,Qs(l,u,g),Dn=x,Wn=C):(Ds&&qh(g.stateNode,g,op()),Qs(l,u,g));break;case 0:case 11:case 14:case 15:Lr(2,g,u),Pn||Lr(4,g,u),Qs(l,u,g);break;case 1:Pn||(Ba(g,u),x=g.stateNode,typeof x.componentWillUnmount=="function"&&Ad(g,u,x)),Qs(l,u,g);break;case 21:Qs(l,u,g);break;case 22:Pn=(x=Pn)||g.memoizedState!==null,Qs(l,u,g),Pn=x;break;default:Qs(l,u,g)}}function Ks(l,u){if(vn&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null))){l=l.dehydrated;try{py(l)}catch(g){We(u,u.return,g)}}}function rc(l,u){if(vn&&u.memoizedState===null&&(l=u.alternate,l!==null&&(l=l.memoizedState,l!==null&&(l=l.dehydrated,l!==null))))try{my(l)}catch(g){We(u,u.return,g)}}function Xs(l){switch(l.tag){case 31:case 13:case 19:var u=l.stateNode;return u===null&&(u=l.stateNode=new Mp),u;case 22:return l=l.stateNode,u=l._retryCache,u===null&&(u=l._retryCache=new Mp),u;default:throw Error(i(435,l.tag))}}function fi(l,u){var g=Xs(l);u.forEach(function(x){if(!g.has(x)){g.add(x);var C=dy.bind(null,l,x);x.then(C,C)}})}function va(l,u){var g=u.deletions;if(g!==null)for(var x=0;x<g.length;x++){var C=g[x],E=l,U=u;if(wt){var F=U;e:for(;F!==null;){switch(F.tag){case 27:if(ca){if(Gl(F.type)){Dn=F.stateNode,Wn=!1;break e}break}case 5:Dn=F.stateNode,Wn=!1;break e;case 3:case 4:Dn=F.stateNode.containerInfo,Wn=!0;break e}F=F.return}if(Dn===null)throw Error(i(160));sc(E,U,C),Dn=null,Wn=!1}else sc(E,U,C);E=C.alternate,E!==null&&(E.return=null),C.return=null}if(u.subtreeFlags&13886)for(u=u.child;u!==null;)ic(u,l),u=u.sibling}function ic(l,u){var g=l.alternate,x=l.flags;switch(l.tag){case 0:case 11:case 14:case 15:va(u,l),Sa(l),x&4&&(Lr(3,l,l.return),kr(3,l),Lr(5,l,l.return));break;case 1:va(u,l),Sa(l),x&512&&(Pn||g===null||Ba(g,g.return)),x&64&&Gn&&(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(Ws){var C=Jt;if(va(u,l),Sa(l),x&512&&(Pn||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=p0(C,l.type,l.memoizedProps,l):Sp(C,l.type,l.stateNode):l.stateNode=vp(C,E,l.memoizedProps):x!==E?(x===null?g.stateNode!==null&&Np(g.stateNode):Ii(x),E===null?Sp(C,l.type,l.stateNode):vp(C,E,l.memoizedProps)):E===null&&l.stateNode!==null&&nc(l,l.memoizedProps,g.memoizedProps)}break}case 27:if(ca){va(u,l),Sa(l),x&512&&(Pn||g===null||Ba(g,g.return)),g!==null&&x&4&&nc(l,l.memoizedProps,g.memoizedProps);break}case 5:if(va(u,l),Sa(l),x&512&&(Pn||g===null||Ba(g,g.return)),wt){if(l.flags&32){C=l.stateNode;try{ip(C)}catch(Ce){We(l,l.return,Ce)}}x&4&&l.stateNode!=null&&(C=l.memoizedProps,nc(l,C,g!==null?g.memoizedProps:C)),x&1024&&(Io=!0)}else Ds&&l.alternate!==null&&(l.alternate.stateNode=l.stateNode);break;case 6:if(va(u,l),Sa(l),x&4&&wt){if(l.stateNode===null)throw Error(i(162));x=l.memoizedProps,g=g!==null?g.memoizedProps:x,C=l.stateNode;try{Ug(C,g,x)}catch(Ce){We(l,l.return,Ce)}}break;case 3:if(Ws?(m0(),C=Jt,Jt=xc(u.containerInfo),va(u,l),Jt=C):va(u,l),Sa(l),x&4){if(wt&&vn&&g!==null&&g.memoizedState.isDehydrated)try{u0(u.containerInfo)}catch(Ce){We(l,l.return,Ce)}if(Ds){x=u.containerInfo,g=u.pendingChildren;try{cp(x,g)}catch(Ce){We(l,l.return,Ce)}}}Io&&(Io=!1,Dd(l));break;case 4:Ws?(g=Jt,Jt=xc(l.stateNode.containerInfo),va(u,l),Sa(l),Jt=g):(va(u,l),Sa(l)),x&4&&Ds&&qh(l.stateNode,l,l.stateNode.pendingChildren);break;case 12:va(u,l),Sa(l);break;case 31:va(u,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 13:va(u,l),Sa(l),l.child.flags&8192&&l.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(Tc=Ga()),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 22:C=l.memoizedState!==null;var U=g!==null&&g.memoizedState!==null,F=Gn,me=Pn;if(Gn=F||C,Pn=me||U,va(u,l),Pn=me,Gn=F,Sa(l),x&8192&&(u=l.stateNode,u._visibility=C?u._visibility&-2:u._visibility|1,C&&(g===null||U||Gn||Pn||Ui(l)),wt)){e:if(g=null,wt)for(u=l;;){if(u.tag===5||Ws&&u.tag===26){if(g===null){U=g=u;try{E=U.stateNode,C?fy(E):Vg(U.stateNode,U.memoizedProps)}catch(Ce){We(U,U.return,Ce)}}}else if(u.tag===6){if(g===null){U=u;try{var Ne=U.stateNode;C?Yg(Ne):Qg(Ne,U.memoizedProps)}catch(Ce){We(U,U.return,Ce)}}}else if(u.tag===18){if(g===null){U=u;try{var Re=U.stateNode;C?d0(Re):f0(U.stateNode)}catch(Ce){We(U,U.return,Ce)}}}else if((u.tag!==22&&u.tag!==23||u.memoizedState===null||u===l)&&u.child!==null){u.child.return=u,u=u.child;continue}if(u===l)break e;for(;u.sibling===null;){if(u.return===null||u.return===l)break e;g===u&&(g=null),u=u.return}g===u&&(g=null),u.sibling.return=u.return,u=u.sibling}}x&4&&(x=l.updateQueue,x!==null&&(g=x.retryQueue,g!==null&&(x.retryQueue=null,fi(l,g))));break;case 19:va(u,l),Sa(l),x&4&&(x=l.updateQueue,x!==null&&(l.updateQueue=null,fi(l,x)));break;case 30:break;case 21:break;default:va(u,l),Sa(l)}}function Sa(l){var u=l.flags;if(u&2){try{for(var g,x=l.return;x!==null;){if(Hh(x)){g=x;break}x=x.return}if(wt){if(g==null)throw Error(i(160));switch(g.tag){case 27:if(ca){var C=g.stateNode,E=di(l);ac(l,E,C);break}case 5:var U=g.stateNode;g.flags&32&&(ip(U),g.flags&=-33);var F=di(l);ac(l,F,U);break;case 3:case 4:var me=g.stateNode.containerInfo,Ne=di(l);Md(l,Ne,me);break;default:throw Error(i(161))}}}catch(Re){We(l,l.return,Re)}l.flags&=-3}u&4096&&(l.flags&=-4097)}function Dd(l){if(l.subtreeFlags&1024)for(l=l.child;l!==null;){var u=l;Dd(u),u.tag===5&&u.flags&1024&&$h(u.stateNode),l=l.sibling}}function Za(l,u){if(u.subtreeFlags&8772)for(u=u.child;u!==null;)wg(l,u.alternate,u),u=u.sibling}function Ui(l){for(l=l.child;l!==null;){var u=l;switch(u.tag){case 0:case 11:case 14:case 15:Lr(4,u,u.return),Ui(u);break;case 1:Ba(u,u.return);var g=u.stateNode;typeof g.componentWillUnmount=="function"&&Ad(u,u.return,g),Ui(u);break;case 27:ca&&Na(u.stateNode);case 26:case 5:Ba(u,u.return),Ui(u);break;case 22:u.memoizedState===null&&Ui(u);break;case 30:Ui(u);break;default:Ui(u)}l=l.sibling}}function Fs(l,u,g){for(g=g&&(u.subtreeFlags&8772)!==0,u=u.child;u!==null;){var x=u.alternate,C=l,E=u,U=E.flags;switch(E.tag){case 0:case 11:case 15:Fs(C,E,g),kr(4,E);break;case 1:if(Fs(C,E,g),x=E,C=x.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Ne){We(x,x.return,Ne)}if(x=E,C=x.updateQueue,C!==null){var F=x.stateNode;try{var me=C.shared.hiddenCallbacks;if(me!==null)for(C.shared.hiddenCallbacks=null,C=0;C<me.length;C++)Pt(me[C],F)}catch(Ne){We(x,x.return,Ne)}}g&&U&64&&Ao(E),Mo(E,E.return);break;case 27:ca&&jg(E);case 26:case 5:Fs(C,E,g),g&&x===null&&U&4&&Ol(E),Mo(E,E.return);break;case 12:Fs(C,E,g);break;case 31:Fs(C,E,g),g&&U&4&&Ks(C,E);break;case 13:Fs(C,E,g),g&&U&4&&rc(C,E);break;case 22:E.memoizedState===null&&Fs(C,E,g),Mo(E,E.return);break;case 30:break;default:Fs(C,E,g)}u=u.sibling}}function Hi(l,u){var g=null;l!==null&&l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(g=l.memoizedState.cachePool.pool),l=null,u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(l=u.memoizedState.cachePool.pool),l!==g&&(l!=null&&l.refCount++,g!=null&&Qa(g))}function Gh(l,u){l=null,u.alternate!==null&&(l=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==l&&(u.refCount++,l!=null&&Qa(l))}function Rn(l,u,g,x){if(u.subtreeFlags&10256)for(u=u.child;u!==null;)zd(l,u,g,x),u=u.sibling}function zd(l,u,g,x){var C=u.flags;switch(u.tag){case 0:case 11:case 15:Rn(l,u,g,x),C&2048&&kr(9,u);break;case 1:Rn(l,u,g,x);break;case 3:Rn(l,u,g,x),C&2048&&(l=null,u.alternate!==null&&(l=u.alternate.memoizedState.cache),u=u.memoizedState.cache,u!==l&&(u.refCount++,l!=null&&Qa(l)));break;case 12:if(C&2048){Rn(l,u,g,x),l=u.stateNode;try{var E=u.memoizedProps,U=E.id,F=E.onPostCommit;typeof F=="function"&&F(U,u.alternate===null?"mount":"update",l.passiveEffectDuration,-0)}catch(me){We(u,u.return,me)}}else Rn(l,u,g,x);break;case 31:Rn(l,u,g,x);break;case 13:Rn(l,u,g,x);break;case 23:break;case 22:E=u.stateNode,U=u.alternate,u.memoizedState!==null?E._visibility&2?Rn(l,u,g,x):Do(l,u):E._visibility&2?Rn(l,u,g,x):(E._visibility|=2,cs(l,u,g,x,(u.subtreeFlags&10256)!==0||!1)),C&2048&&Hi(U,u);break;case 24:Rn(l,u,g,x),C&2048&&Gh(u.alternate,u);break;default:Rn(l,u,g,x)}}function cs(l,u,g,x,C){for(C=C&&((u.subtreeFlags&10256)!==0||!1),u=u.child;u!==null;){var E=l,U=u,F=g,me=x,Ne=U.flags;switch(U.tag){case 0:case 11:case 15:cs(E,U,F,me,C),kr(8,U);break;case 23:break;case 22:var Re=U.stateNode;U.memoizedState!==null?Re._visibility&2?cs(E,U,F,me,C):Do(E,U):(Re._visibility|=2,cs(E,U,F,me,C)),C&&Ne&2048&&Hi(U.alternate,U);break;case 24:cs(E,U,F,me,C),C&&Ne&2048&&Gh(U.alternate,U);break;default:cs(E,U,F,me,C)}u=u.sibling}}function Do(l,u){if(u.subtreeFlags&10256)for(u=u.child;u!==null;){var g=l,x=u,C=x.flags;switch(x.tag){case 22:Do(g,x),C&2048&&Hi(x.alternate,x);break;case 24:Do(g,x),C&2048&&Gh(x.alternate,x);break;default:Do(g,x)}u=u.sibling}}function Ur(l,u,g){if(l.subtreeFlags&Us)for(l=l.child;l!==null;)qi(l,u,g),l=l.sibling}function qi(l,u,g){switch(l.tag){case 26:if(Ur(l,u,g),l.flags&Us)if(l.memoizedState!==null)g0(g,Jt,l.memoizedState,l.memoizedProps);else{var x=l.stateNode,C=l.type;l=l.memoizedProps,((u&335544128)===u||Jh(C,l))&&Id(g,x,C,l)}break;case 5:Ur(l,u,g),l.flags&Us&&(x=l.stateNode,C=l.type,l=l.memoizedProps,((u&335544128)===u||Jh(C,l))&&Id(g,x,C,l));break;case 3:case 4:Ws?(x=Jt,Jt=xc(l.stateNode.containerInfo),Ur(l,u,g),Jt=x):Ur(l,u,g);break;case 22:l.memoizedState===null&&(x=l.alternate,x!==null&&x.memoizedState!==null?(x=Us,Us=16777216,Ur(l,u,g),Us=x):Ur(l,u,g));break;default:Ur(l,u,g)}}function kd(l){var u=l.alternate;if(u!==null&&(l=u.child,l!==null)){u.child=null;do u=l.sibling,l.sibling=null,l=u;while(l!==null)}}function zo(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var x=u[g];Jn=x,Os(x,l)}kd(l)}if(l.subtreeFlags&10256)for(l=l.child;l!==null;)Ld(l),l=l.sibling}function Ld(l){switch(l.tag){case 0:case 11:case 15:zo(l),l.flags&2048&&Lr(9,l,l.return);break;case 3:zo(l);break;case 12:zo(l);break;case 22:var u=l.stateNode;l.memoizedState!==null&&u._visibility&2&&(l.return===null||l.return.tag!==13)?(u._visibility&=-3,lc(l)):zo(l);break;default:zo(l)}}function lc(l){var u=l.deletions;if((l.flags&16)!==0){if(u!==null)for(var g=0;g<u.length;g++){var x=u[g];Jn=x,Os(x,l)}kd(l)}for(l=l.child;l!==null;){switch(u=l,u.tag){case 0:case 11:case 15:Lr(8,u,u.return),lc(u);break;case 22:g=u.stateNode,g._visibility&2&&(g._visibility&=-3,lc(u));break;default:lc(u)}l=l.sibling}}function Os(l,u){for(;Jn!==null;){var g=Jn;switch(g.tag){case 0:case 11:case 15:Lr(8,g,u);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,Jn=x;else e:for(g=l;Jn!==null;){x=Jn;var C=x.sibling,E=x.return;if(Bh(x),x===g){Jn=null;break e}if(C!==null){C.return=E,Jn=C;break e}Jn=E}}}function Bi(l){var u=rt(l);if(u!=null){if(typeof u.memoizedProps["data-testname"]!="string")throw Error(i(364));return u}if(l=Zn(l),l===null)throw Error(i(362));return l.stateNode.current}function Gi(l,u){var g=l.tag;switch(u.$$typeof){case ir:if(l.type===u.value)return!0;break;case Wo:e:{for(u=u.value,l=[l,0],g=0;g<l.length;){var x=l[g++],C=x.tag,E=l[g++],U=u[E];if(C!==5&&C!==26&&C!==27||!Fi(x)){for(;U!=null&&Gi(x,U);)E++,U=u[E];if(E===u.length){u=!0;break e}else for(x=x.child;x!==null;)l.push(x,E),x=x.sibling}}u=!1}return u;case $o:if((g===5||g===26||g===27)&&np(l.stateNode,u.value))return!0;break;case nl:if((g===5||g===6||g===26||g===27)&&(l=gc(l),l!==null&&0<=l.indexOf(u.value)))return!0;break;case wc:if((g===5||g===26||g===27)&&(l=l.memoizedProps["data-testname"],typeof l=="string"&&l.toLowerCase()===u.value.toLowerCase()))return!0;break;default:throw Error(i(365))}return!1}function ko(l){switch(l.$$typeof){case ir:return"<"+(b(l.value)||"Unknown")+">";case Wo:return":has("+(ko(l)||"")+")";case $o:return'[role="'+l.value+'"]';case nl:return'"'+l.value+'"';case wc:return'[data-testname="'+l.value+'"]';default:throw Error(i(365))}}function Lo(l,u){var g=[];l=[l,0];for(var x=0;x<l.length;){var C=l[x++],E=C.tag,U=l[x++],F=u[U];if(E!==5&&E!==26&&E!==27||!Fi(C)){for(;F!=null&&Gi(C,F);)U++,F=u[U];if(U===u.length)g.push(C);else for(C=C.child;C!==null;)l.push(C,U),C=C.sibling}}return g}function ds(l,u){if(!ua)throw Error(i(363));l=Bi(l),l=Lo(l,u),u=[],l=Array.from(l);for(var g=0;g<l.length;){var x=l[g++],C=x.tag;if(C===5||C===26||C===27)Fi(x)||u.push(x.stateNode);else for(x=x.child;x!==null;)l.push(x),x=x.sibling}return u}function bn(){return(bt&2)!==0&&_t!==0?_t&-_t:Qe.T!==null?Ta():Qo()}function hi(){if(ns===0)if((_t&536870912)===0||Nt){var l=Yl;Yl<<=1,(Yl&3932160)===0&&(Yl=262144),ns=l}else ns=536870912;return l=ys.current,l!==null&&(l.flags|=32),ns}function On(l,u,g){(l===ht&&(Wt===2||Wt===9)||l.cancelPendingCommit!==null)&&(qn(l,0),qr(l,_t,ns,!1)),H(l,g),((bt&2)===0||l!==ht)&&(l===ht&&((bt&2)===0&&(rl|=g),zn===4&&qr(l,_t,ns,!1)),Ea(l))}function br(l,u,g){if((bt&6)!==0)throw Error(i(327));var x=!g&&(u&127)===0&&(u&l.expiredLanes)===0||A(l,u),C=x?Rg(l,u):Br(l,u,!0),E=x;do{if(C===0){al&&!x&&qr(l,u,0,!1);break}else{if(g=l.current.alternate,E&&!Eg(g)){C=Br(l,u,!1),E=!1;continue}if(C===2){if(E=u,l.errorRecoveryDisabledLanes&E)var U=0;else U=l.pendingLanes&-536870913,U=U!==0?U:U&536870912?536870912:0;if(U!==0){u=U;e:{var F=l;C=Ec;var me=vn&&F.current.memoizedState.isDehydrated;if(me&&(qn(F,U).flags|=256),U=Br(F,U,!1),U!==2){if(sl&&!me){F.errorRecoveryDisabledLanes|=E,rl|=E,C=4;break e}E=xs,xs=C,E!==null&&(xs===null?xs=E:xs.push.apply(xs,E))}C=U}if(E=!1,C!==2)continue}}if(C===1){qn(l,0),qr(l,u,0,!0);break}e:{switch(x=l,E=C,E){case 0:case 1:throw Error(i(345));case 4:if((u&4194048)!==u)break;case 6:qr(x,u,ns,!_r);break e;case 2:xs=null;break;case 3:case 5:break;default:throw Error(i(329))}if((u&62914560)===u&&(C=Tc+300-Ga(),10<C)){if(qr(x,u,ns,!_r),T(x,0,!0)!==0)break e;ei=u,x.timeoutHandle=Ih(Hr.bind(null,x,g,xs,Rc,bf,u,ns,rl,tu,_r,E,"Throttled",-0,0),C);break e}Hr(x,g,xs,Rc,bf,u,ns,rl,tu,_r,E,null,-0,0)}}break}while(!0);Ea(l)}function Hr(l,u,g,x,C,E,U,F,me,Ne,Re,Ce,Le,st){if(l.timeoutHandle=ps,Ce=u.subtreeFlags,Ce&8192||(Ce&16785408)===16785408){Ce=Wh(),qi(u,E,Ce);var ja=(E&62914560)===E?Tc-Ga():(E&4194048)===E?Il-Ga():0;if(ja=Lg(Ce,ja),ja!==null){ei=E,l.cancelPendingCommit=ja(Pr.bind(null,l,u,E,g,x,C,U,F,me,Re,Ce,null,Le,st)),qr(l,E,U,!Ne);return}}Pr(l,u,E,g,x,C,U,F,me)}function Eg(l){for(var u=l;;){var g=u.tag;if((g===0||g===11||g===15)&&u.flags&16384&&(g=u.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var x=0;x<g.length;x++){var C=g[x],E=C.getSnapshot;C=C.value;try{if(!In(E(),C))return!1}catch{return!1}}if(g=u.child,u.subtreeFlags&16384&&g!==null)g.return=u,u=g;else{if(u===l)break;for(;u.sibling===null;){if(u.return===null||u.return===l)return!0;u=u.return}u.sibling.return=u.return,u=u.sibling}}return!0}function qr(l,u,g,x){u&=~eu,u&=~rl,l.suspendedLanes|=u,l.pingedLanes&=~u,x&&(l.warmLanes|=u),x=l.expirationTimes;for(var C=u;0<C;){var E=31-ms(C),U=1<<E;x[E]=-1,C&=~U}g!==0&&L(l,g,u)}function Ud(){return(bt&6)===0?(is(0),!1):!0}function Hd(){if(vt!==null){if(Wt===0)var l=vt.return;else l=vt,Sr=un=null,Qu(l),$i=null,Ql=0,l=vt;for(;l!==null;)Cg(l.alternate,l),l=l.return;vt=null}}function qn(l,u){var g=l.timeoutHandle;g!==ps&&(l.timeoutHandle=ps,kg(g)),g=l.cancelPendingCommit,g!==null&&(l.cancelPendingCommit=null,g()),ei=0,Hd(),ht=l,vt=g=Ms(l.current,null),_t=u,Wt=0,aa=null,_r=!1,al=A(l,u),sl=!1,tu=ns=eu=rl=ji=zn=0,xs=Ec=null,bf=!1,(u&8)!==0&&(u|=u&32);var x=l.entangledLanes;if(x!==0)for(l=l.entanglements,x&=u;0<x;){var C=31-ms(x),E=1<<C;u|=l[C],x&=~E}return $r=u,Ue(),g}function on(l,u){it=null,Qe.H=Ls,u===ha||u===sr?(u=Xn(),Wt=3):u===yf?(u=Xn(),Wt=4):Wt=u===ts?8:u!==null&&typeof u=="object"&&typeof u.then=="function"?6:1,aa=u,vt===null&&(zn=1,Ed(l,_e(u,l.current)))}function jt(){var l=ys.current;return l===null?!0:(_t&4194048)===_t?es===null:(_t&62914560)===_t||(_t&536870912)!==0?l===es:!1}function pi(){var l=Qe.H;return Qe.H=Ls,l===null?Ls:l}function As(){var l=Qe.A;return Qe.A=Jo,l}function Uo(){zn=4,_r||(_t&4194048)!==_t&&ys.current!==null||(al=!0),(ji&134217727)===0&&(rl&134217727)===0||ht===null||qr(ht,_t,ns,!1)}function Br(l,u,g){var x=bt;bt|=2;var C=pi(),E=As();(ht!==l||_t!==u)&&(Rc=null,qn(l,u)),u=!1;var U=zn;e:do try{if(Wt!==0&&vt!==null){var F=vt,me=aa;switch(Wt){case 8:Hd(),U=6;break e;case 3:case 2:case 9:case 6:ys.current===null&&(u=!0);var Ne=Wt;if(Wt=0,aa=null,Gr(l,F,me,Ne),g&&al){U=0;break e}break;default:Ne=Wt,Wt=0,aa=null,Gr(l,F,me,Ne)}}Tg(),U=zn;break}catch(Re){on(l,Re)}while(!0);return u&&l.shellSuspendCounter++,Sr=un=null,bt=x,Qe.H=C,Qe.A=E,vt===null&&(ht=null,_t=0,Ue()),U}function Tg(){for(;vt!==null;)Pi(vt)}function Rg(l,u){var g=bt;bt|=2;var x=pi(),C=As();ht!==l||_t!==u?(Rc=null,il=Ga()+500,qn(l,u)):al=A(l,u);e:do try{if(Wt!==0&&vt!==null){u=vt;var E=aa;t:switch(Wt){case 1:Wt=0,aa=null,Gr(l,u,E,1);break;case 2:case 9:if(Mt(E)){Wt=0,aa=null,qd(u);break}u=function(){Wt!==2&&Wt!==9||ht!==l||(Wt=7),Ea(l)},E.then(u,u);break e;case 3:Wt=7;break e;case 4:Wt=5;break e;case 7:Mt(E)?(Wt=0,aa=null,qd(u)):(Wt=0,aa=null,Gr(l,u,E,7));break;case 5:var U=null;switch(vt.tag){case 26:U=vt.memoizedState;case 5:case 27:var F=vt,me=F.type,Ne=F.pendingProps;if(U?Cp(U):An(F.stateNode,me,Ne)){Wt=0,aa=null;var Re=F.sibling;if(Re!==null)vt=Re;else{var Ce=F.return;Ce!==null?(vt=Ce,qo(Ce)):vt=null}break t}}Wt=0,aa=null,Gr(l,u,E,5);break;case 6:Wt=0,aa=null,Gr(l,u,E,6);break;case 8:Hd(),zn=6;break e;default:throw Error(i(462))}}Ho();break}catch(Le){on(l,Le)}while(!0);return Sr=un=null,Qe.H=x,Qe.A=C,bt=g,vt!==null?0:(ht=null,_t=0,Ue(),zn)}function Ho(){for(;vt!==null&&!x0();)Pi(vt)}function Pi(l){var u=zh(l.alternate,l,$r);l.memoizedProps=l.pendingProps,u===null?qo(l):vt=u}function qd(l){var u=l,g=u.alternate;switch(u.tag){case 15:case 0:u=Th(g,u,u.pendingProps,u.type,void 0,_t);break;case 11:u=Th(g,u,u.pendingProps,u.type.render,u.ref,_t);break;case 5:Qu(u);default:Cg(g,u),u=vt=Pd(u,$r),u=zh(g,u,$r)}l.memoizedProps=l.pendingProps,u===null?qo(l):vt=u}function Gr(l,u,g,x){Sr=un=null,Qu(u),$i=null,Ql=0;var C=u.return;try{if(oy(l,C,u,g,_t)){zn=1,Ed(l,_e(g,l.current)),vt=null;return}}catch(E){if(C!==null)throw vt=C,E;zn=1,Ed(l,_e(g,l.current)),vt=null;return}u.flags&32768?(Nt||x===1?l=!0:al||(_t&536870912)!==0?l=!1:(_r=l=!0,(x===2||x===9||x===3||x===6)&&(x=ys.current,x!==null&&x.tag===13&&(x.flags|=16384))),Yi(u,l)):qo(u)}function qo(l){var u=l;do{if((u.flags&32768)!==0){Yi(u,_r);return}l=u.return;var g=_g(u.alternate,u,$r);if(g!==null){vt=g;return}if(u=u.sibling,u!==null){vt=u;return}vt=u=l}while(u!==null);zn===0&&(zn=5)}function Yi(l,u){do{var g=Uh(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),!u&&(l=l.sibling,l!==null)){vt=l;return}vt=l=g}while(l!==null);zn=6,vt=null}function Pr(l,u,g,x,C,E,U,F,me){l.cancelPendingCommit=null;do Vr();while(sa!==0);if((bt&6)!==0)throw Error(i(327));if(u!==null){if(u===l.current)throw Error(i(177));if(E=u.lanes|u.childLanes,E|=Kl,B(l,g,E,U,F,me),l===ht&&(vt=ht=null,_t=0),Jl=u,Ei=l,ei=g,nu=E,vf=C,Dp=x,(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?(l.callbackNode=null,l.callbackPriority=0,ta(vc,function(){return oc(),null})):(l.callbackNode=null,l.callbackPriority=0),x=(u.flags&13878)!==0,(u.subtreeFlags&13878)!==0||x){x=Qe.T,Qe.T=null,C=Js(),St(2),U=bt,bt|=4;try{uy(l,u,g)}finally{bt=U,St(C),Qe.T=x}}sa=1,mi(),Yr(),Bd()}}function mi(){if(sa===1){sa=0;var l=Ei,u=Jl,g=(u.flags&13878)!==0;if((u.subtreeFlags&13878)!==0||g){g=Qe.T,Qe.T=null;var x=Js();St(2);var C=bt;bt|=4;try{ic(u,l),zg(l.containerInfo)}finally{bt=C,St(x),Qe.T=g}}l.current=u,sa=2}}function Yr(){if(sa===2){sa=0;var l=Ei,u=Jl,g=(u.flags&8772)!==0;if((u.subtreeFlags&8772)!==0||g){g=Qe.T,Qe.T=null;var x=Js();St(2);var C=bt;bt|=4;try{wg(l,u.alternate,u)}finally{bt=C,St(x),Qe.T=g}}sa=3}}function Bd(){if(sa===4||sa===3){sa=0,wp();var l=Ei,u=Jl,g=ei,x=Dp;(u.subtreeFlags&10256)!==0||(u.flags&10256)!==0?sa=5:(sa=0,Jl=Ei=null,Gd(l,l.pendingLanes));var C=l.pendingLanes;if(C===0&&(wi=null),ae(g),u=u.stateNode,gs&&typeof gs.onCommitFiberRoot=="function")try{gs.onCommitFiberRoot(Vl,u,void 0,(u.current.flags&128)===128)}catch{}if(x!==null){u=Qe.T,C=Js(),St(2),Qe.T=null;try{for(var E=l.onRecoverableError,U=0;U<x.length;U++){var F=x[U];E(F.value,{componentStack:F.stack})}}finally{Qe.T=u,St(C)}}(ei&3)!==0&&Vr(),Ea(l),C=l.pendingLanes,(g&261930)!==0&&(C&42)!==0?l===Oc?Ut++:(Ut=0,Oc=l):Ut=0,vn&&yc(),is(0)}}function Gd(l,u){(l.pooledCacheLanes&=u)===0&&(u=l.pooledCache,u!=null&&(l.pooledCache=null,Qa(u)))}function Vr(){return mi(),Yr(),Bd(),oc()}function oc(){if(sa!==5)return!1;var l=Ei,u=nu;nu=0;var g=ae(ei),x=32>g?32:g;g=Qe.T;var C=Js();try{St(x),Qe.T=null,x=vf,vf=null;var E=Ei,U=ei;if(sa=0,Jl=Ei=null,ei=0,(bt&6)!==0)throw Error(i(331));var F=bt;if(bt|=4,Ld(E.current),zd(E,E.current,U,x),bt=F,is(0,!1),gs&&typeof gs.onPostCommitFiberRoot=="function")try{gs.onPostCommitFiberRoot(Vl,E)}catch{}return!0}finally{St(C),Qe.T=g,Gd(l,u)}}function Vi(l,u,g){u=_e(g,u),u=wh(l.stateNode,u,2),l=pn(l,u,2),l!==null&&(H(l,2),Ea(l))}function We(l,u,g){if(l.tag===3)Vi(l,l,g);else for(;u!==null;){if(u.tag===3){Vi(u,l,g);break}else if(u.tag===1){var x=u.stateNode;if(typeof u.type.getDerivedStateFromError=="function"||typeof x.componentDidCatch=="function"&&(wi===null||!wi.has(x))){l=_e(g,l),g=dg(2),x=pn(u,g,2),x!==null&&(fg(g,x,u,l),H(x,2),Ea(x));break}}u=u.return}}function Bo(l,u,g){var x=l.pingCache;if(x===null){x=l.pingCache=new Hs;var C=new Set;x.set(u,C)}else C=x.get(u),C===void 0&&(C=new Set,x.set(u,C));C.has(g)||(sl=!0,C.add(g),l=Og.bind(null,l,u,g),u.then(l,l))}function Og(l,u,g){var x=l.pingCache;x!==null&&x.delete(u),l.pingedLanes|=l.suspendedLanes&g,l.warmLanes&=~g,ht===l&&(_t&g)===g&&(zn===4||zn===3&&(_t&62914560)===_t&&300>Ga()-Tc?(bt&2)===0&&qn(l,0):eu|=g,tu===_t&&(tu=0)),Ea(l)}function Ag(l,u){u===0&&(u=k()),l=ot(l,u),l!==null&&(H(l,u),Ea(l))}function cy(l){var u=l.memoizedState,g=0;u!==null&&(g=u.retryLane),Ag(l,g)}function dy(l,u){var g=0;switch(l.tag){case 31:case 13:var x=l.stateNode,C=l.memoizedState;C!==null&&(g=C.retryLane);break;case 19:x=l.stateNode;break;case 22:x=l.stateNode._retryCache;break;default:throw Error(i(314))}x!==null&&x.delete(u),Ag(l,g)}function ta(l,u){return bc(l,u)}function Ph(l,u,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=u,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 Al(l){return l=l.prototype,!(!l||!l.isReactComponent)}function Ms(l,u){var g=l.alternate;return g===null?(g=n(l.tag,u,l.key,l.mode),g.elementType=l.elementType,g.type=l.type,g.stateNode=l.stateNode,g.alternate=l,l.alternate=g):(g.pendingProps=u,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,u=l.dependencies,g.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext},g.sibling=l.sibling,g.index=l.index,g.ref=l.ref,g.refCleanup=l.refCleanup,g}function Pd(l,u){l.flags&=65011714;var g=l.alternate;return g===null?(l.childLanes=0,l.lanes=u,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,u=g.dependencies,l.dependencies=u===null?null:{lanes:u.lanes,firstContext:u.firstContext}),l}function gi(l,u,g,x,C,E){var U=0;if(x=l,typeof l=="function")Al(l)&&(U=1);else if(typeof l=="string")U=Ws&&ca?af(l,g,_a.current)?26:jp(l)?27:5:Ws?af(l,g,_a.current)?26:5:ca&&jp(l)?27:5;else e:switch(l){case fc:return l=n(31,g,u,C),l.elementType=fc,l.lanes=E,l;case kl:return Zs(g.children,C,E,u);case Ll:U=8,C|=24;break;case Ul:return l=n(12,g,u,C|2),l.elementType=Ul,l.lanes=E,l;case Kd:return l=n(13,g,u,C),l.elementType=Kd,l.lanes=E,l;case yi:return l=n(19,g,u,C),l.elementType=yi,l.lanes=E,l;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Is:U=10;break e;case dc:U=9;break e;case Go:U=11;break e;case Xd:U=14;break e;case Ia:U=16,x=null;break e}U=29,g=Error(i(130,l===null?"null":typeof l,"")),x=null}return u=n(U,g,u,C),u.elementType=l,u.type=x,u.lanes=E,u}function Zs(l,u,g,x){return l=n(7,l,x,u),l.lanes=g,l}function Yh(l,u,g){return l=n(6,l,null,u),l.lanes=g,l}function Vh(l){var u=n(18,null,null,0);return u.stateNode=l,u}function Qh(l,u,g){return u=n(4,l.children!==null?l.children:[],l.key,u),u.lanes=g,u.stateNode={containerInfo:l.containerInfo,pendingChildren:null,implementation:l.implementation},u}function Mg(l,u,g,x,C,E,U,F,me){this.tag=1,this.containerInfo=l,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=ps,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=C,this.onCaughtError=E,this.onRecoverableError=U,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=me,this.incompleteTransitions=new Map}function Qi(l,u,g,x,C,E,U,F,me,Ne,Re,Ce){return l=new Mg(l,u,g,U,me,Ne,Re,Ce,F),u=1,E===!0&&(u|=24),E=n(3,null,null,u),l.current=E,E.stateNode=l,u=hr(),u.refCount++,l.pooledCache=u,u.refCount++,E.memoizedState={element:x,isDehydrated:g,cache:u},ut(E),l}function Yd(l){return l?(l=Kr,l):Kr}function uc(l){var u=l._reactInternals;if(u===void 0)throw typeof l.render=="function"?Error(i(188)):(l=Object.keys(l).join(","),Error(i(268,l)));return l=f(u),l=l!==null?m(l):null,l===null?null:Yo(l.stateNode)}function Kh(l,u,g,x,C,E){C=Yd(C),x.context===null?x.context=C:x.pendingContext=C,x=Tt(u),x.payload={element:g},E=E===void 0?null:E,E!==null&&(x.callback=E),g=pn(l,x,u),g!==null&&(On(g,l,u),Ar(g,l,u))}function Ml(l,u){if(l=l.memoizedState,l!==null&&l.dehydrated!==null){var g=l.retryLane;l.retryLane=g!==0&&g<u?g:u}}function cc(l,u){Ml(l,u),(l=l.alternate)&&Ml(l,u)}var dt={},Vd=gl(),fs=Bb(),Qd=Object.assign,Dl=Symbol.for("react.element"),Qr=Symbol.for("react.transitional.element"),zl=Symbol.for("react.portal"),kl=Symbol.for("react.fragment"),Ll=Symbol.for("react.strict_mode"),Ul=Symbol.for("react.profiler"),dc=Symbol.for("react.consumer"),Is=Symbol.for("react.context"),Go=Symbol.for("react.forward_ref"),Kd=Symbol.for("react.suspense"),yi=Symbol.for("react.suspense_list"),Xd=Symbol.for("react.memo"),Ia=Symbol.for("react.lazy"),fc=Symbol.for("react.activity"),Xh=Symbol.for("react.memo_cache_sentinel"),xi=Symbol.iterator,Ki=Symbol.for("react.client.reference"),Xi=Array.isArray,Qe=Vd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Fh=e.rendererVersion,hc=e.rendererPackageName,Po=e.extraDevToolsConfig,Yo=e.getPublicInstance,Dg=e.getRootHostContext,Vo=e.getChildHostContext,Fd=e.prepareForCommit,zg=e.resetAfterCommit,Zh=e.createInstance;e.cloneMutableInstance;var pc=e.appendInitialChild,hs=e.finalizeInitialChildren,Ja=e.shouldSetTextContent,bi=e.createTextInstance;e.cloneMutableTextInstance;var Ih=e.scheduleTimeout,kg=e.cancelTimeout,ps=e.noTimeout,Fn=e.isPrimaryRenderer;e.warnsIfNotActing;var wt=e.supportsMutation,Ds=e.supportsPersistence,vn=e.supportsHydration,rt=e.getInstanceFromNode;e.beforeActiveInstanceBlur;var tn=e.preparePortalMount;e.prepareScopeUpdate,e.getInstanceFromScope;var St=e.setCurrentUpdatePriority,Js=e.getCurrentUpdatePriority,Qo=e.resolveUpdatePriority;e.trackSchedulerEvent,e.resolveEventType,e.resolveEventTimeStamp;var Hl=e.shouldAttemptEagerTransition,Zd=e.detachDeletedInstance;e.requestPostPaintCallback;var mc=e.maySuspendCommit,Ko=e.maySuspendCommitOnUpdate,Jh=e.maySuspendCommitInSyncRender,An=e.preloadInstance,Wh=e.startSuspendingCommit,Id=e.suspendInstance;e.suspendOnActiveViewTransition;var Lg=e.waitForCommitToBeReady;e.getSuspendedCommitReason;var ql=e.NotPendingTransition,Bl=e.HostTransitionContext,$h=e.resetFormInstance;e.bindToConsole;var ep=e.supportsMicrotasks,tp=e.scheduleMicrotask,ua=e.supportsTestSelectors,Zn=e.findFiberRoot,Jd=e.getBoundingRect,gc=e.getTextContent,Fi=e.isHiddenSubtree,np=e.matchAccessibilityRole,vi=e.setFocusIfFocusable,Wd=e.setupIntersectionObserver,ap=e.appendChild,sp=e.appendChildToContainer,Ug=e.commitTextUpdate,Hg=e.commitMount,qg=e.commitUpdate,Bg=e.insertBefore,Gg=e.insertInContainerBefore,Pg=e.removeChild,rp=e.removeChildFromContainer,ip=e.resetTextContent,fy=e.hideInstance,Yg=e.hideTextInstance,Vg=e.unhideInstance,Qg=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 lp=e.clearContainer;e.createFragmentInstance,e.updateFragmentInstanceFiber,e.commitNewChildToFragmentInstance,e.deleteChildFromFragmentInstance;var Kg=e.cloneInstance,op=e.createContainerChildSet,up=e.appendChildToContainerChildSet,Xg=e.finalizeContainerChildren,cp=e.replaceContainerChildren,Fg=e.cloneHiddenInstance,dp=e.cloneHiddenTextInstance,Zi=e.isSuspenseInstancePending,$d=e.isSuspenseInstanceFallback,ef=e.getSuspenseInstanceFallbackErrorDetails,tf=e.registerSuspenseInstanceRetry,Zg=e.canHydrateFormStateMarker,fp=e.isFormStateMarkerMatching,Ig=e.getNextHydratableSibling,Jg=e.getNextHydratableSiblingAfterSingleton,Wg=e.getFirstHydratableChild,$g=e.getFirstHydratableChildWithinContainer,e0=e.getFirstHydratableChildWithinActivityInstance,t0=e.getFirstHydratableChildWithinSuspenseInstance,hp=e.getFirstHydratableChildWithinSingleton,n0=e.canHydrateInstance,a0=e.canHydrateTextInstance,pp=e.canHydrateActivityInstance,s0=e.canHydrateSuspenseInstance,r0=e.hydrateInstance,hy=e.hydrateTextInstance,mp=e.hydrateActivityInstance,i0=e.hydrateSuspenseInstance,l0=e.getNextHydratableInstanceAfterActivityInstance,gp=e.getNextHydratableInstanceAfterSuspenseInstance,o0=e.commitHydratedInstance,u0=e.commitHydratedContainer,py=e.commitHydratedActivityInstance,my=e.commitHydratedSuspenseInstance,c0=e.finalizeHydratedChildren,yc=e.flushHydrationEvents;e.clearActivityBoundary;var yp=e.clearSuspenseBoundary;e.clearActivityBoundaryFromContainer;var nf=e.clearSuspenseBoundaryFromContainer,d0=e.hideDehydratedBoundary,f0=e.unhideDehydratedBoundary,Xo=e.shouldDeleteUnhydratedTailInstances;e.diffHydratedPropsForDevWarnings,e.diffHydratedTextForDevWarnings,e.describeHydratableInstanceForDevWarnings;var h0=e.validateHydratableInstance,xp=e.validateHydratableTextInstance,Ws=e.supportsResources,af=e.isHostHoistableType,xc=e.getHoistableRoot,bp=e.getResource,vp=e.acquireResource,Ii=e.releaseResource,p0=e.hydrateHoistable,Sp=e.mountHoistable,Np=e.unmountHoistable,sf=e.createHoistableInstance,m0=e.prepareToCommitHoistables,_p=e.mayResourceSuspendCommit,Cp=e.preloadResource,g0=e.suspendResource,ca=e.supportsSingletons,rf=e.resolveSingletonInstance,na=e.acquireSingletonInstance,Na=e.releaseSingletonInstance,jp=e.isHostSingletonType,Gl=e.isSingletonScope,lf=[],Pl=-1,Kr={},ms=Math.clz32?Math.clz32:R,of=Math.log,y0=Math.LN2,uf=256,Yl=262144,Fo=4194304,bc=fs.unstable_scheduleCallback,cf=fs.unstable_cancelCallback,x0=fs.unstable_shouldYield,wp=fs.unstable_requestPaint,Ga=fs.unstable_now,df=fs.unstable_ImmediatePriority,b0=fs.unstable_UserBlockingPriority,vc=fs.unstable_NormalPriority,ff=fs.unstable_IdlePriority,Ep=fs.log,v0=fs.unstable_setDisableYieldValue,Vl=null,gs=null,In=typeof Object.is=="function"?Object.is:le,hf=typeof reportError=="function"?reportError:function(l){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var u=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(u))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",l);return}console.error(l)},gy=Object.prototype.hasOwnProperty,pf,Xr,Sc=!1,Tp=new WeakMap,Si=[],Fr=0,nn=null,Nc=0,$s=[],zs=0,er=null,Aa=1,vr="",_a=_(null),Ni=_(null),Ma=_(null),_c=_(null),da=null,Sn=null,Nt=!1,Zr=null,Wa=!1,mf=Error(i(519)),tr=_(null),un=null,Sr=null,S0=typeof AbortController<"u"?AbortController:function(){var l=[],u=this.signal={aborted:!1,addEventListener:function(g,x){l.push(x)}};this.abort=function(){u.aborted=!0,l.forEach(function(g){return g()})}},Ca=fs.unstable_scheduleCallback,yy=fs.unstable_NormalPriority,Nn={$$typeof:Is,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0},Cc=null,It=null,Pa=!1,nr=!1,gf=!1,Ji=0,Zo=null,Rp=0,_i=0,fa=null,ar=Qe.S;Qe.S=function(l,u){Il=Ga(),typeof u=="object"&&u!==null&&typeof u.then=="function"&&Pu(l,u),ar!==null&&ar(l,u)};var Wi=_(null),ha=Error(i(460)),yf=Error(i(474)),sr=Error(i(542)),Ir={then:function(){}},$a=null,$i=null,Ql=0,Da=Gs(!0),Op=Gs(!1),za=[],Jr=0,Kl=0,ks=!1,xf=!1,Xl=_(null),el=_(0),ys=_(null),es=null,Bn=_(0),Ci=0,it=null,Ye=null,tt=null,ft=!1,ct=!1,Rt=!1,Ya=0,rr=0,Nr=null,Ap=0,Ls={readContext:Zt,use:vo,useCallback:Tn,useContext:Tn,useEffect:Tn,useImperativeHandle:Tn,useLayoutEffect:Tn,useInsertionEffect:Tn,useMemo:Tn,useReducer:Tn,useRef:Tn,useState:Tn,useDebugValue:Tn,useDeferredValue:Tn,useTransition:Tn,useSyncExternalStore:Tn,useId:Tn,useHostTransitionStatus:Tn,useFormState:Tn,useActionState:Tn,useOptimistic:Tn,useMemoCache:Tn,useCacheRefresh:Tn};Ls.useEffectEvent=Tn;var Mn={readContext:Zt,use:vo,useCallback:function(l,u){return Ha().memoizedState=[l,u===void 0?null:u],l},useContext:Zt,useEffect:Fu,useImperativeHandle:function(l,u,g){g=g!=null?g.concat([l]):null,jl(4194308,4,Co.bind(null,u,l),g)},useLayoutEffect:function(l,u){return jl(4194308,4,l,u)},useInsertionEffect:function(l,u){jl(4,2,l,u)},useMemo:function(l,u){var g=Ha();u=u===void 0?null:u;var x=l();if(Rt){J(!0);try{l()}finally{J(!1)}}return g.memoizedState=[x,u],x},useReducer:function(l,u,g){var x=Ha();if(g!==void 0){var C=g(u);if(Rt){J(!0);try{g(u)}finally{J(!1)}}}else C=u;return x.memoizedState=x.baseState=C,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:l,lastRenderedState:C},x.queue=l,l=l.dispatch=ly.bind(null,it,l),[x.memoizedState,l]},useRef:function(l){var u=Ha();return l={current:l},u.memoizedState=l},useState:function(l){l=xh(l);var u=l.queue,g=lg.bind(null,it,u);return u.dispatch=g,[l.memoizedState,g]},useDebugValue:Iu,useDeferredValue:function(l,u){var g=Ha();return wo(g,l,u)},useTransition:function(){var l=xh(!1);return l=sg.bind(null,it,l.queue,!0,!1),Ha().memoizedState=l,[!1,l]},useSyncExternalStore:function(l,u,g){var x=it,C=Ha();if(Nt){if(g===void 0)throw Error(i(407));g=g()}else{if(g=u(),ht===null)throw Error(i(349));(_t&127)!==0||eg(x,u,g)}C.memoizedState=g;var E={value:g,getSnapshot:u};return C.queue=E,Fu(yh.bind(null,x,E,l),[l]),x.flags|=2048,Rs(9,{destroy:void 0},gh.bind(null,x,E,g,u),null),g},useId:function(){var l=Ha(),u=ht.identifierPrefix;if(Nt){var g=vr,x=Aa;g=(x&~(1<<32-ms(x)-1)).toString(32)+g,u="_"+u+"R_"+g,g=Ya++,0<g&&(u+="H"+g.toString(32)),u+="_"}else g=Ap++,u="_"+u+"r_"+g.toString(32)+"_";return l.memoizedState=u},useHostTransitionStatus:_h,useFormState:vh,useActionState:vh,useOptimistic:function(l){var u=Ha();u.memoizedState=u.baseState=l;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return u.queue=g,u=Cd.bind(null,it,!0,g),g.dispatch=u,[l,u]},useMemoCache:pd,useCacheRefresh:function(){return Ha().memoizedState=iy.bind(null,it)},useEffectEvent:function(l){var u=Ha(),g={impl:l};return u.memoizedState=g,function(){if((bt&2)!==0)throw Error(i(440));return g.impl.apply(void 0,arguments)}}},Wr={readContext:Zt,use:vo,useCallback:Nd,useContext:Zt,useEffect:_o,useImperativeHandle:ag,useInsertionEffect:ki,useLayoutEffect:Zu,useMemo:jo,useReducer:ui,useRef:Sd,useState:function(){return ui(xr)},useDebugValue:Iu,useDeferredValue:function(l,u){var g=xn();return Nh(g,Ye.memoizedState,l,u)},useTransition:function(){var l=ui(xr)[0],u=xn().memoizedState;return[typeof l=="boolean"?l:qa(l),u]},useSyncExternalStore:_l,useId:_d,useHostTransitionStatus:_h,useFormState:So,useActionState:So,useOptimistic:function(l,u){var g=xn();return Ku(g,Ye,l,u)},useMemoCache:pd,useCacheRefresh:ig};Wr.useEffectEvent=Xa;var tl={readContext:Zt,use:vo,useCallback:Nd,useContext:Zt,useEffect:_o,useImperativeHandle:ag,useInsertionEffect:ki,useLayoutEffect:Zu,useMemo:jo,useReducer:gd,useRef:Sd,useState:function(){return gd(xr)},useDebugValue:Iu,useDeferredValue:function(l,u){var g=xn();return Ye===null?wo(g,l,u):Nh(g,Ye.memoizedState,l,u)},useTransition:function(){var l=gd(xr)[0],u=xn().memoizedState;return[typeof l=="boolean"?l:qa(l),u]},useSyncExternalStore:_l,useId:_d,useHostTransitionStatus:_h,useFormState:No,useActionState:No,useOptimistic:function(l,u){var g=xn();return Ye!==null?Ku(g,Ye,l,u):(g.baseState=l,[l,g.queue.dispatch])},useMemoCache:pd,useCacheRefresh:ig};tl.useEffectEvent=Xa;var jc={enqueueSetState:function(l,u,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.payload=u,g!=null&&(C.callback=g),u=pn(l,C,x),u!==null&&(On(u,l,x),Ar(u,l,x))},enqueueReplaceState:function(l,u,g){l=l._reactInternals;var x=bn(),C=Tt(x);C.tag=1,C.payload=u,g!=null&&(C.callback=g),u=pn(l,C,x),u!==null&&(On(u,l,x),Ar(u,l,x))},enqueueForceUpdate:function(l,u){l=l._reactInternals;var g=bn(),x=Tt(g);x.tag=2,u!=null&&(x.callback=u),u=pn(l,x,g),u!==null&&(On(u,l,g),Ar(u,l,g))}},ts=Error(i(461)),mn=!1,Fl={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},Gn=!1,Pn=!1,Io=!1,Mp=typeof WeakSet=="function"?WeakSet:Set,Jn=null,Dn=null,Wn=!1,Jt=null,Us=8192,Jo={getCacheForType:function(l){var u=Zt(Nn),g=u.data.get(l);return g===void 0&&(g=l(),u.data.set(l,g)),g},cacheSignal:function(){return Zt(Nn).controller.signal}},ir=0,Wo=1,$o=2,wc=3,nl=4;if(typeof Symbol=="function"&&Symbol.for){var Zl=Symbol.for;ir=Zl("selector.component"),Wo=Zl("selector.has_pseudo_class"),$o=Zl("selector.role"),wc=Zl("selector.test_id"),nl=Zl("selector.text")}var Hs=typeof WeakMap=="function"?WeakMap:Map,bt=0,ht=null,vt=null,_t=0,Wt=0,aa=null,_r=!1,al=!1,sl=!1,$r=0,zn=0,ji=0,rl=0,eu=0,ns=0,tu=0,Ec=null,xs=null,bf=!1,Tc=0,Il=0,il=1/0,Rc=null,wi=null,sa=0,Ei=null,Jl=null,ei=0,nu=0,vf=null,Dp=null,Ut=0,Oc=null;return dt.attemptContinuousHydration=function(l){if(l.tag===13||l.tag===31){var u=ot(l,67108864);u!==null&&On(u,l,67108864),cc(l,67108864)}},dt.attemptHydrationAtCurrentPriority=function(l){if(l.tag===13||l.tag===31){var u=bn();u=ue(u);var g=ot(l,u);g!==null&&On(g,l,u),cc(l,u)}},dt.attemptSynchronousHydration=function(l){switch(l.tag){case 3:if(l=l.stateNode,l.current.memoizedState.isDehydrated){var u=O(l.pendingLanes);if(u!==0){for(l.pendingLanes|=2,l.entangledLanes|=2;u;){var g=1<<31-ms(u);l.entanglements[1]|=g,u&=~g}Ea(l),(bt&6)===0&&(il=Ga()+500,is(0))}}break;case 31:case 13:u=ot(l,2),u!==null&&On(u,l,2),Ud(),cc(l,2)}},dt.batchedUpdates=function(l,u){return l(u)},dt.createComponentSelector=function(l){return{$$typeof:ir,value:l}},dt.createContainer=function(l,u,g,x,C,E,U,F,me,Ne){return Qi(l,u,!1,null,g,x,E,null,U,F,me,Ne)},dt.createHasPseudoClassSelector=function(l){return{$$typeof:Wo,value:l}},dt.createHydrationContainer=function(l,u,g,x,C,E,U,F,me,Ne,Re,Ce,Le,st){return l=Qi(g,x,!0,l,C,E,F,st,me,Ne,Re,Ce),l.context=Yd(null),g=l.current,x=bn(),x=ue(x),C=Tt(x),C.callback=u??null,pn(g,C,x),u=x,l.current.lanes=u,H(l,u),Ea(l),l},dt.createPortal=function(l,u,g){var x=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:zl,key:x==null?null:""+x,children:l,containerInfo:u,implementation:g}},dt.createRoleSelector=function(l){return{$$typeof:$o,value:l}},dt.createTestNameSelector=function(l){return{$$typeof:wc,value:l}},dt.createTextSelector=function(l){return{$$typeof:nl,value:l}},dt.defaultOnCaughtError=function(l){console.error(l)},dt.defaultOnRecoverableError=function(l){hf(l)},dt.defaultOnUncaughtError=function(l){hf(l)},dt.deferredUpdates=function(l){var u=Qe.T,g=Js();try{return St(32),Qe.T=null,l()}finally{St(g),Qe.T=u}},dt.discreteUpdates=function(l,u,g,x,C){var E=Qe.T,U=Js();try{return St(2),Qe.T=null,l(u,g,x,C)}finally{St(U),Qe.T=E,bt===0&&(il=Ga()+500)}},dt.findAllNodes=ds,dt.findBoundingRects=function(l,u){if(!ua)throw Error(i(363));u=ds(l,u),l=[];for(var g=0;g<u.length;g++)l.push(Jd(u[g]));for(u=l.length-1;0<u;u--){g=l[u];for(var x=g.x,C=x+g.width,E=g.y,U=E+g.height,F=u-1;0<=F;F--)if(u!==F){var me=l[F],Ne=me.x,Re=Ne+me.width,Ce=me.y,Le=Ce+me.height;if(x>=Ne&&E>=Ce&&C<=Re&&U<=Le){l.splice(u,1);break}else if(x!==Ne||g.width!==me.width||Le<E||Ce>U){if(!(E!==Ce||g.height!==me.height||Re<x||Ne>C)){Ne>x&&(me.width+=Ne-x,me.x=x),Re<C&&(me.width=C-Ne),l.splice(u,1);break}}else{Ce>E&&(me.height+=Ce-E,me.y=E),Le<U&&(me.height=U-Ce),l.splice(u,1);break}}}return l},dt.findHostInstance=uc,dt.findHostInstanceWithNoPortals=function(l){return l=f(l),l=l!==null?y(l):null,l===null?null:Yo(l.stateNode)},dt.findHostInstanceWithWarning=function(l){return uc(l)},dt.flushPassiveEffects=Vr,dt.flushSyncFromReconciler=function(l){var u=bt;bt|=1;var g=Qe.T,x=Js();try{if(St(2),Qe.T=null,l)return l()}finally{St(x),Qe.T=g,bt=u,(bt&6)===0&&is(0)}},dt.flushSyncWork=Ud,dt.focusWithin=function(l,u){if(!ua)throw Error(i(363));for(l=Bi(l),u=Lo(l,u),u=Array.from(u),l=0;l<u.length;){var g=u[l++],x=g.tag;if(!Fi(g)){if((x===5||x===26||x===27)&&vi(g.stateNode))return!0;for(g=g.child;g!==null;)u.push(g),g=g.sibling}}return!1},dt.getFindAllNodesFailureDescription=function(l,u){if(!ua)throw Error(i(363));var g=0,x=[];l=[Bi(l),0];for(var C=0;C<l.length;){var E=l[C++],U=E.tag,F=l[C++],me=u[F];if((U!==5&&U!==26&&U!==27||!Fi(E))&&(Gi(E,me)&&(x.push(ko(me)),F++,F>g&&(g=F)),F<u.length))for(E=E.child;E!==null;)l.push(E,F),E=E.sibling}if(g<u.length){for(l=[];g<u.length;g++)l.push(ko(u[g]));return`findAllNodes was able to match part of the selector:
|
|
580
|
-
`+(x.join(" > ")+`
|
|
581
|
-
|
|
582
|
-
No matching component was found for:
|
|
583
|
-
`)+l.join(" > ")}return null},dt.getPublicRootInstance=function(l){if(l=l.current,!l.child)return null;switch(l.child.tag){case 27:case 5:return Yo(l.child.stateNode);default:return l.child.stateNode}},dt.injectIntoDevTools=function(){var l={bundleType:0,version:Fh,rendererPackageName:hc,currentDispatcherRef:Qe,reconcilerVersion:"19.2.0"};if(Po!==null&&(l.rendererConfig=Po),typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")l=!1;else{var u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(u.isDisabled||!u.supportsFiber)l=!0;else{try{Vl=u.inject(l),gs=u}catch{}l=!!u.checkDCE}}return l},dt.isAlreadyRendering=function(){return(bt&6)!==0},dt.observeVisibleRects=function(l,u,g,x){if(!ua)throw Error(i(363));l=ds(l,u);var C=Wd(l,g,x).disconnect;return{disconnect:function(){C()}}},dt.shouldError=function(){return null},dt.shouldSuspend=function(){return!1},dt.startHostTransition=function(l,u,g,x){if(l.tag!==5)throw Error(i(476));var C=rg(l).queue;sg(l,C,u,ql,g===null?s:function(){var E=rg(l);return E.next===null&&(E=l.alternate.memoizedState),Ju(l,E.next.queue,{},bn()),g(x)})},dt.updateContainer=function(l,u,g,x){var C=u.current,E=bn();return Kh(C,E,l,u,g,x),E},dt.updateContainerSync=function(l,u,g,x){return Kh(u.current,2,l,u,g,x),2},dt},t.exports.default=t.exports,Object.defineProperty(t.exports,"__esModule",{value:!0})})(Tx)),Tx.exports}var V5;function Zk(){return V5||(V5=1,Ex.exports=Fk()),Ex.exports}var Ik=Zk();const Jk=qb(Ik);var Rx={exports:{}},to={};/**
|
|
584
|
-
* @license React
|
|
585
|
-
* react-reconciler-constants.production.js
|
|
586
|
-
*
|
|
587
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
588
|
-
*
|
|
589
|
-
* This source code is licensed under the MIT license found in the
|
|
590
|
-
* LICENSE file in the root directory of this source tree.
|
|
591
|
-
*/var Q5;function Wk(){return Q5||(Q5=1,to.ConcurrentRoot=1,to.ContinuousEventPriority=8,to.DefaultEventPriority=32,to.DiscreteEventPriority=2,to.IdleEventPriority=268435456,to.LegacyRoot=0,to.NoEventPriority=0),to}var K5;function $k(){return K5||(K5=1,Rx.exports=Wk()),Rx.exports}var sy=$k();const X5={children:!0,ref:!0,key:!0,style:!0,forwardedRef:!0,unstable_applyCache:!0,unstable_applyDrawHitFromCache:!0};let F5=!1,Z5=!1;const D1=".react-konva-event",eL=`ReactKonva: You have a Konva node with draggable = true and position defined but no onDragMove or onDragEnd events are handled.
|
|
592
|
-
Position of a node will be changed during drag&drop, so you should update state of the react app as well.
|
|
593
|
-
Consider to add onDragMove or onDragEnd events.
|
|
594
|
-
For more info see: https://github.com/konvajs/react-konva/issues/256
|
|
595
|
-
`,tL=`ReactKonva: You are using "zIndex" attribute for a Konva node.
|
|
596
|
-
react-konva may get confused with ordering. Just define correct order of elements in your render function of a component.
|
|
597
|
-
For more info see: https://github.com/konvajs/react-konva/issues/194
|
|
598
|
-
`,nL={};function ry(t,e,n=nL){if(!F5&&"zIndex"in e&&(console.warn(tL),F5=!0),!Z5&&e.draggable){var s=e.x!==void 0||e.y!==void 0,i=e.onDragEnd||e.onDragMove;s&&!i&&(console.warn(eL),Z5=!0)}for(var o in n)if(!X5[o]){var d=o.slice(0,2)==="on",f=n[o]!==e[o];if(d&&f){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),t.off(m,n[o])}var y=!e.hasOwnProperty(o);y&&t.setAttr(o,void 0)}var v=e._useStrictMode,b={},_=!1;const j={};for(var o in e)if(!X5[o]){var d=o.slice(0,2)==="on",w=n[o]!==e[o];if(d&&w){var m=o.substr(2).toLowerCase();m.substr(0,7)==="content"&&(m="content"+m.substr(7,1).toUpperCase()+m.substr(8)),e[o]&&(j[m]=e[o])}!d&&(e[o]!==n[o]||v&&e[o]!==t.getAttr(o))&&(_=!0,b[o]=e[o])}_&&(t.setAttrs(b),Gu(t));for(var m in j)t.off(m+D1),t.on(m+D1,j[m])}function Gu(t){if(!Me.autoDrawEnabled){var e=t.getLayer()||t.getStage();e&&e.batchDraw()}}var Ox=Bb();const Z8={},aL={};sh.Node.prototype._applyProps=ry;let I8=sy.DefaultEventPriority;function sL(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),Gu(t)}function rL(t,e,n){let s=sh[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=sh.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 m=new s(i);return ry(m,o),m}function iL(t,e,n){console.error(`Text components are not supported for now in ReactKonva. Your text is: "${t}"`)}function lL(t,e,n){return!1}function oL(t){return t}function uL(){return null}function cL(){return null}function dL(t,e,n,s){return aL}function fL(){}function hL(t){}function pL(t,e){return!1}function mL(){return Z8}function gL(){return Z8}const yL=setTimeout,xL=clearTimeout,bL=!0,vL=t=>{t()},SL=-1;function NL(t,e){return!1}const _L=!1,CL=!1,jL=!0,wL=!1,EL=!1;function TL(t,e){e.parent===t?e.moveToTop():t.add(e),Gu(t)}function RL(t,e){e.parent===t?e.moveToTop():t.add(e),Gu(t)}function J8(t,e,n){e._remove(),t.add(e),e.setZIndex(n.getZIndex()),Gu(t)}function OL(t,e,n){J8(t,e,n)}function AL(t,e){e.destroy(),e.off(D1),Gu(t)}function ML(t,e){e.destroy(),e.off(D1),Gu(t)}function DL(t,e,n){console.error(`Text components are not yet supported in ReactKonva. You text is: "${n}"`)}function zL(t,e,n){}function kL(t,e,n,s){ry(t,s,n)}function LL(t){t.hide(),Gu(t)}function UL(t){}function HL(t,e){(e.visible==null||e.visible)&&t.show()}function qL(t,e){}function BL(t){}function GL(){}function PL(){return null}function YL(){}function VL(){}function QL(){return sy.DefaultEventPriority}function KL(){}function XL(){return null}function FL(t){I8=t}function ZL(){return I8}function IL(){return sy.DiscreteEventPriority}function JL(){return!1}function WL(){}function $L(){return null}function eU(){return-1.1}function tU(){}function nU(){return!1}function aU(){return!0}function sU(){}function rU(){}function iU(){return null}const lU=null,oU=$t.createContext(null);function uU(){}const cU=Object.freeze(Object.defineProperty({__proto__:null,HostTransitionContext:oU,NotPendingTransition:lU,afterActiveInstanceBlur:VL,appendChild:TL,appendChildToContainer:RL,appendInitialChild:sL,beforeActiveInstanceBlur:YL,cancelTimeout:xL,clearContainer:BL,commitMount:zL,commitTextUpdate:DL,commitUpdate:kL,createInstance:rL,createTextInstance:iL,detachDeletedInstance:GL,finalizeInitialChildren:lL,getChildHostContext:gL,getCurrentEventPriority:QL,getCurrentUpdatePriority:ZL,getInstanceFromNode:PL,getInstanceFromScope:XL,getPublicInstance:oL,getRootHostContext:mL,hideInstance:LL,hideTextInstance:UL,idlePriority:Ox.unstable_IdlePriority,insertBefore:J8,insertInContainerBefore:OL,isPrimaryRenderer:_L,maySuspendCommit:nU,noTimeout:SL,now:Ox.unstable_now,preloadInstance:aU,prepareForCommit:uL,preparePortalMount:cL,prepareScopeUpdate:KL,prepareUpdate:dL,removeChild:AL,removeChildFromContainer:ML,requestPostPaintCallback:tU,resetAfterCommit:fL,resetFormInstance:uU,resetTextContent:hL,resolveEventTimeStamp:eU,resolveEventType:$L,resolveUpdatePriority:IL,run:Ox.unstable_runWithPriority,scheduleMicrotask:vL,scheduleTimeout:yL,setCurrentUpdatePriority:FL,shouldAttemptEagerTransition:JL,shouldDeprioritizeSubtree:pL,shouldSetTextContent:NL,startSuspendingCommit:sU,supportsHydration:EL,supportsMicrotasks:bL,supportsMutation:jL,supportsPersistence:wL,suspendInstance:rU,trackSchedulerEvent:WL,unhideInstance:HL,unhideTextInstance:qL,waitForCommitToBeReady:iU,warnsIfNotActing:CL},Symbol.toStringTag,{value:"Module"}));function W8(t,e,n){if(!t)return;if(n(t)===!0)return t;let s=t.child;for(;s;){const i=W8(s,e,n);if(i)return i;s=s.sibling}}function $8(t){try{return Object.defineProperties(t,{_currentRenderer:{get(){return null},set(){}},_currentRenderer2:{get(){return null},set(){}}})}catch{return t}}const Dv=$8(D.createContext(null));class e7 extends D.Component{render(){return D.createElement(Dv.Provider,{value:this._reactInternals},this.props.children)}}function dU(){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=W8(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 fU=Symbol.for("react.context"),hU=t=>t!==null&&typeof t=="object"&&"$$typeof"in t&&t.$$typeof===fU;function pU(){const t=dU(),[e]=D.useState(()=>new Map);e.clear();let n=t;for(;n;){const s=n.type;hU(s)&&s!==Dv&&!e.has(s)&&e.set(s,D.use($8(s))),n=n.return}return e}function mU(){const t=pU();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(e7,{...e})),[t])}if($t.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 gU(t){const e=$t.useRef({});return $t.useLayoutEffect(()=>{e.current=t}),$t.useLayoutEffect(()=>()=>{e.current={}},[]),e.current}const yU=()=>{const t=$t.useRef(0);return $t.useMemo(()=>{t.current++},[]),t.current>1},xU=t=>{const e=$t.useRef(null),n=$t.useRef(null),s=$t.useRef(null),i=gU(t),o=mU(),d=$t.useRef(null),f=v=>{const{forwardedRef:b}=t;b&&(typeof b=="function"?b(v):b.current=v)},m=yU(),y=()=>{var v;f(null),Of.flushSyncFromReconciler(()=>{Of.updateContainer(null,s.current,null)}),(v=n.current)==null||v.destroy(),n.current=null};return $t.useLayoutEffect(()=>(d.current&&(clearTimeout(d.current),d.current=null),n.current?f(n.current):(n.current=new sh.Stage({width:t.width,height:t.height,container:e.current}),f(n.current),s.current=Of.createContainer(n.current,sy.ConcurrentRoot,null,!1,null,"",console.error,console.error,console.error,null),Of.updateContainer($t.createElement(o,{},t.children),s.current,null,()=>{})),()=>{m?d.current=setTimeout(y,0):y()}),[]),$t.useLayoutEffect(()=>{f(n.current),ry(n.current,t,i),Of.flushSyncFromReconciler(()=>{Of.updateContainer($t.createElement(o,{},t.children),s.current,null)})}),$t.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})},Ax="Layer",I5="Group",J5="Circle",kc="Line",bU="Text",vU="Arrow",Of=Jk(cU),SU=$t.forwardRef((t,e)=>$t.createElement(e7,{},$t.createElement(xU,{...t,forwardedRef:e})));function lm(t,e,n){return{x:t.x*e,y:t.y*n}}function W5(t,e,n){return{x:t.x/e,y:t.y/n}}function $5(t,e,n){return t.flatMap(s=>[s.x*e,s.y*n])}function NU(t,e){return e?"#6366f1":t.color}const e4=16,t4=9;function _U({zones:t,selectedZoneId:e,onSelectZone:n,onZonePointsChange:s,onZoneComplete:i,drawingType:o}){const d=D.useRef(null),[f,m]=D.useState({w:800,h:450}),[y,v]=D.useState([]),[b,_]=D.useState(null);D.useEffect(()=>{const A=d.current;if(!A)return;const z=new ResizeObserver(k=>{const P=k[0];if(P){const{width:H}=P.contentRect;m({w:H,h:H*9/16})}});return z.observe(A),()=>z.disconnect()},[]);const j=o!==null,w=D.useCallback(A=>{if(!j){n(null);return}const z=A.target.getStage();if(!z)return;const k=z.getPointerPosition();if(!k)return;const P=W5(k,f.w,f.h),H=o==="tripwire";if(y.length===0){v([P]);return}if(H&&y.length===1){const B=[...y,P],L={id:crypto.randomUUID(),name:"Tripwire",type:"tripwire",color:"#f59e0b",points:B};i(L),v([]);return}if(y.length>=3&&!H){const B=lm(y[0],f.w,f.h);if(Math.hypot(k.x-B.x,k.y-B.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),v([]);return}}v(B=>[...B,P])},[j,y,f,o,i,n]),R=D.useCallback(A=>{if(!j||o==="tripwire"||y.length<3)return;A.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),v([])},[j,o,y,i]),O=D.useCallback(A=>{const z=A.target.getStage();if(!z)return;const k=z.getPointerPosition();_(k??null)},[]),T=[];for(let A=1;A<e4;A++){const z=f.w/e4*A;T.push(h.jsx(kc,{points:[z,0,z,f.h],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gv-${A}`))}for(let A=1;A<t4;A++){const z=f.h/t4*A;T.push(h.jsx(kc,{points:[0,z,f.w,z],stroke:"#ffffff",strokeWidth:.5,opacity:.08},`gh-${A}`))}return h.jsxs("div",{ref:d,className:"w-full bg-zinc-900 rounded-lg overflow-hidden",style:{cursor:j?"crosshair":"default"},children:[h.jsxs(SU,{width:f.w,height:f.h,onClick:w,onDblClick:R,onMouseMove:O,children:[h.jsxs(Ax,{children:[h.jsx(kc,{points:[0,0,f.w,0,f.w,f.h,0,f.h,0,0],stroke:"transparent",strokeWidth:0}),T]}),h.jsx(Ax,{children:t.map(A=>{const z=A.id===e,k=NU(A,z),P=$5(A.points,f.w,f.h),H=A.type==="tripwire";return h.jsxs(I5,{onClick:B=>{B.cancelBubble=!0,j||n(A.id)},children:[H?h.jsx(vU,{points:P,stroke:k,strokeWidth:z?3:2,fill:k,pointerLength:10,pointerWidth:8,opacity:z?1:.8}):h.jsx(kc,{points:P,closed:!0,fill:k+"33",stroke:k,strokeWidth:z?2.5:1.5,opacity:z?1:.85}),A.points.length>0&&h.jsx(bU,{x:lm(A.points[0],f.w,f.h).x+4,y:lm(A.points[0],f.w,f.h).y+4,text:A.name,fontSize:11,fill:k,fontStyle:"bold"}),z&&A.points.map((B,L)=>{const V=lm(B,f.w,f.h);return h.jsx(J5,{x:V.x,y:V.y,radius:5,fill:k,stroke:"#ffffff",strokeWidth:1.5,draggable:!0,onDragMove:Z=>{const ue=W5({x:Z.target.x(),y:Z.target.y()},f.w,f.h),ae=A.points.map((J,le)=>le===L?ue:J);s(A.id,ae)}},L)})]},A.id)})}),h.jsx(Ax,{children:j&&y.length>0&&h.jsxs(I5,{children:[y.length>=2&&o!=="tripwire"&&h.jsx(kc,{points:$5(y,f.w,f.h),stroke:"#6366f1",strokeWidth:1.5,dash:[6,3],opacity:.8}),y.length===1&&o==="tripwire"&&b&&h.jsx(kc,{points:[y[0].x*f.w,y[0].y*f.h,b.x,b.y],stroke:"#f59e0b",strokeWidth:1.5,dash:[6,3],opacity:.7}),b&&y.length>=1&&o!=="tripwire"&&h.jsx(kc,{points:[y[y.length-1].x*f.w,y[y.length-1].y*f.h,b.x,b.y],stroke:"#6366f1",strokeWidth:1,dash:[4,4],opacity:.5}),y.map((A,z)=>{const k=lm(A,f.w,f.h),P=z===0;return h.jsx(J5,{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)})]})})]}),j&&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 CU={intrusion:"Intrusion","package-watch":"Package",tripwire:"Tripwire"},jU={intrusion:"bg-danger/10 text-danger","package-watch":"bg-success/10 text-success",tripwire:"bg-warning/10 text-warning"};function wU({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(OT,{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 m=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",m?"border-primary/50 bg-primary/10":"border-border bg-surface hover:bg-surface-hover"].join(" "),onClick:()=>s(m?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 ${jU[f.type]}`,children:CU[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(HT,{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(Wm,{className:"h-3 w-3"})})]})]},f.id)})})]})}const EU=["#3b82f6","#10b981","#f59e0b","#ef4444","#8b5cf6","#06b6d4","#f97316","#ec4899"],TU=[{value:"intrusion",label:"Intrusion"},{value:"package-watch",label:"Package Watch"},{value:"tripwire",label:"Tripwire"}],Mx="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 RU({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:Mx,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:Mx,value:t.type,onChange:s=>e({...t,type:s.target.value}),children:TU.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:EU.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:Mx+" 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(Wm,{className:"h-3 w-3"}),"Delete zone"]})]})}function OU(){const[t,e]=D.useState([]),[n,s]=D.useState(null),[i,o]=D.useState(null),d=t.find(_=>_.id===n)??null,f=_=>{e(j=>[...j,_]),s(_.id),o(null)},m=(_,j)=>{e(w=>w.map(R=>R.id===_?{...R,points:j}:R))},y=_=>{e(j=>j.map(w=>w.id===_.id?_:w))},v=_=>{e(j=>j.filter(w=>w.id!==_)),n===_&&s(null)},b=_=>{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(_U,{zones:t,selectedZoneId:n,onSelectZone:s,onZonePointsChange:m,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(wU,{zones:t,selectedZoneId:n,drawingType:i,onSelectZone:s,onDeleteZone:v,onStartDraw:b,onCancelDraw:()=>o(null)}),d&&!i&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"border-t border-border"}),h.jsx(RU,{zone:d,onChange:y,onDelete:()=>v(d.id)})]})]})]})]})})}function AU(t){return{id:t.id,name:t.packageName??t.id,type:t.slot??"addon",enabled:!0}}function MU({deviceId:t}){const e=en(),{data:n,isLoading:s}=pt({queryKey:["bridge-addons"],queryFn:()=>e.bridgeListAddons()}),o=(n??[]).map(AU),d=o.filter(m=>m.type==="vision"||m.type==="detection"||m.type==="inference");if(s)return h.jsx("div",{className:"space-y-2",children:[1,2,3].map(m=>h.jsx("div",{className:"h-16 rounded-lg border border-border bg-surface animate-pulse"},m))});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(m=>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:m.name||m.id}),h.jsxs("p",{className:"text-[10px] text-foreground-subtle",children:[m.type," ",m.version?`v${m.version}`:""]})]}),h.jsx("div",{className:`h-2 w-2 rounded-full flex-shrink-0 ${m.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(Jm,{className:"h-3.5 w-3.5"})})]},m.id))})]})}function DU({deviceId:t}){const e=en(),[n,s]=D.useState(null),{data:i}=pt({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(m){try{await navigator.clipboard.writeText(m),s(m),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(m=>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(hv,{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:m.label}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:m.resolution}),h.jsx("span",{className:"text-[9px] bg-surface-hover rounded px-1.5 py-0.5 text-foreground-subtle",children:m.codec})]}),h.jsx("p",{className:"text-[10px] font-mono text-foreground-subtle mt-0.5 truncate",children:m.url})]}),h.jsx("button",{onClick:()=>f(m.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===m.url?h.jsx(Im,{className:"h-3.5 w-3.5 text-success"}):h.jsx(XE,{className:"h-3.5 w-3.5"})})]},m.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 zU(){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(V1,{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 n4=0;function kU({deviceId:t}){const e=en(),[n,s]=D.useState(""),[i,o]=D.useState([]),d=D.useRef(null),f=Yn({mutationFn:b=>e.replEval(b,{type:"device",deviceId:t}),onSuccess:(b,_)=>{const j=typeof b=="string"?b:JSON.stringify(b,null,2);o(w=>[...w,{id:++n4,code:_,result:j,error:!1,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}]),s("")},onError:(b,_)=>{const j=b instanceof Error?b.message:String(b);o(w=>[...w,{id:++n4,code:_,result:j,error:!0,ts:new Date().toLocaleTimeString("en-GB",{hour12:!1})}])}});function m(){const b=n.trim();b&&f.mutate(b)}function y(b){(b.metaKey||b.ctrlKey)&&b.key==="Enter"&&(b.preventDefault(),m())}function v(b){var _;s(b),(_=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(Wm,{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:m,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(fv,{className:"h-3 w-3"}),f.isPending?"Running...":"Execute"]})]}),h.jsx("textarea",{ref:d,value:n,onChange:b=>s(b.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(b=>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:b.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:b.ts}),h.jsx("button",{onClick:()=>v(b.code),title:"Reuse",className:"text-foreground-subtle hover:text-foreground",children:h.jsx(_1,{className:"h-3.5 w-3.5"})})]})]}),h.jsx("pre",{className:`px-3 py-2 font-mono text-xs whitespace-pre-wrap break-all ${b.error?"text-danger":"text-success"}`,children:b.result})]},b.id))})]})}const LU=[{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 UU(){const{deviceId:t}=Wb(),e=en(),[n,s]=D.useState("events"),{data:i,isLoading:o}=pt({queryKey:["device",t],queryFn:()=>e.getDevice(t),enabled:!!t,refetchInterval:5e3}),d=i??{},f=String(d.name??t??"Device"),m=String(d.status??"offline"),y=String(d.providerId??d.provider??"rtsp"),v=String(d.phase??"—"),b=d.priority!=null?String(d.priority):null;function _(){if(!t)return null;switch(n){case"events":return h.jsx(ND,{deviceId:t});case"pipeline":return h.jsx(_D,{deviceId:t});case"recording":return h.jsx(CD,{});case"zones":return h.jsx(OU,{});case"addons":return h.jsx(MU,{deviceId:t});case"streams":return h.jsx(DU,{deviceId:t});case"logs":return h.jsx(zU,{});case"repl":return h.jsx(kU,{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(av,{to:"/cameras",className:"hover:text-foreground transition-colors",children:"Cameras"}),h.jsx(Ic,{className:"h-3 w-3"}),h.jsx("span",{className:"text-foreground-subtle",children:m8(y)}),h.jsx(Ic,{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($1,{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(nh,{status:m})]}),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 ${m==="online"||m==="running"?"bg-success":"bg-foreground-subtle/30"}`}),m==="online"||m==="running"?"Online":"Offline"]}),h.jsxs("span",{children:["Phase: ",h.jsx("span",{className:"text-foreground",children:v})]}),b&&h.jsxs("span",{children:["Priority: ",h.jsx("span",{className:"text-foreground",children:b})]})]})]})]})]}),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(bD,{deviceName:f,detectionsToday:0,inferenceMs:0,activeTracks:0,storageGb:0})}),h.jsx("div",{className:"w-[300px] flex-shrink-0 bg-surface",children:h.jsx(vD,{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:LU.map(j=>{const w=n===j.id;return h.jsxs("button",{onClick:()=>s(j.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:[j.label,w&&h.jsx("span",{className:"absolute bottom-0 left-0 right-0 h-0.5 rounded-full bg-primary"})]},j.id)})})}),h.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:_()})]})}const t7=D.createContext(null);function HU(){const t=D.useContext(t7);if(!t)throw new Error("useConfirm must be used within ConfirmDialogProvider");return t.confirm}function qU({children:t}){const[e,n]=D.useState(null),s=D.useCallback(m=>new Promise(y=>{n({...m,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(t7.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:m=>m.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 BU({packageName:t,currentVersion:e,onInstall:n,onClose:s}){const i=en(),{data:o,isLoading:d}=pt({queryKey:["addon-versions",t],queryFn:()=>i.trpc.addons.getVersions.query({name:t}),staleTime:5*6e4});return h.jsxs("div",{className:"absolute right-0 top-full mt-1 z-20 w-72 rounded-lg border border-border bg-surface shadow-xl overflow-hidden",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(mo,{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(Jc,{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 m=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] ${m?"bg-primary/5":"hover:bg-surface-hover"} transition-colors`,children:[h.jsx("span",{className:`font-mono flex-1 ${m?"text-primary font-semibold":y?"text-amber-400":"text-foreground"}`,children:f.version}),f.distTags.map(v=>h.jsx("span",{className:`text-[9px] rounded-full px-1.5 py-0.5 font-medium ${v==="latest"?"bg-emerald-500/15 text-emerald-400":v==="beta"?"bg-amber-500/15 text-amber-400":"bg-gray-500/15 text-gray-400"}`,children:v},v)),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()}),m?h.jsx(Im,{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(dv,{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"})]})}function GU({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(j1,{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(k6,{className:"h-2.5 w-2.5 text-white"})})]})}function PU({addonId:t}){const e=en(),n=ga(),{data:s="inherit"}=pt({queryKey:["addon-auto-update",t],queryFn:()=>e.trpc.addons.getAddonAutoUpdate.query({addonId:t}),staleTime:3e4}),i=Yn({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 Lb({addon:t,agents:e=[],hideVersion:n,availableUpdate:s,onUpdate:i,bundle:o}){var W,he;const[d,f]=D.useState(!1),[m,y]=D.useState(!1),[v,b]=D.useState(!1),_=en(),j=ga(),w=HU(),{manifest:R}=t,O=t.installedOn??[],T=!o&&!R.protected&&R.removable!==!1,A=!!o,z=(o==null?void 0:o.displayName)??R.name,k=(o==null?void 0:o.packageName)??R.packageName,P=(o==null?void 0:o.version)??R.version,H=(o==null?void 0:o.installSource)??t.installSource,B=o?(W=o.addons[0])==null?void 0:W.manifest.description:R.description,L=!o&&(t.hasConfigSchema||R.components&&R.components.length>0||e.length>=2),V=A||L,{data:Z,isLoading:ue}=pt({queryKey:["addon-config-schema",R.id],queryFn:()=>_.trpc.addons.getConfigSchema.query({addonId:R.id}),enabled:!A&&d&&t.hasConfigSchema,staleTime:6e4}),{data:ae}=pt({queryKey:["addon-config",R.id],queryFn:()=>_.trpc.addons.getConfig.query({addonId:R.id}),enabled:!A&&d&&t.hasConfigSchema,staleTime:3e4}),[J,le]=D.useState({}),[ce,Y]=D.useState(!1);D.useEffect(()=>{ae&&(le(ae),Y(!1))},[ae]);const $=re=>{le(re),Y(!0)},ee=Yn({mutationFn:()=>_.trpc.addons.updateConfig.mutate({addonId:R.id,config:J}),onSuccess:()=>{Y(!1),j.invalidateQueries({queryKey:["addon-config",R.id]})}}),_e=Yn({mutationFn:()=>(console.log(`[AddonCard] Uninstalling ${R.packageName}`),_.trpc.addons.uninstallPackage.mutate({packageName:R.packageName})),onSuccess:()=>{console.log(`[AddonCard] Uninstalled ${R.packageName}`),j.invalidateQueries({queryKey:["addons"]}),j.invalidateQueries({queryKey:["addon-pages"]}),j.invalidateQueries({queryKey:["capabilities"]})},onError:re=>{console.error("[AddonCard] Uninstall failed:",re)}}),ge=Yn({mutationFn:()=>_.trpc.addons.restartAddon.mutate({addonId:R.id}),onSuccess:()=>{j.invalidateQueries({queryKey:["addons"]})}}),G=Yn({mutationFn:re=>_.trpc.addons.installPackage.mutate({packageName:k,version:re}),onSuccess:()=>{j.invalidateQueries({queryKey:["addons"]}),j.invalidateQueries({queryKey:["addon-pages"]}),j.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 transition-colors",V&&!A?"cursor-pointer hover:bg-surface-hover/50":""].join(" "),onClick:()=>!A&&V&&f(re=>!re),children:[h.jsx(GU,{isBundle:A||!!R.components&&R.components.length>1,installSource:H}),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:z}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle font-mono shrink-0",children:["(",k,")"]}),A&&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"}),o.addons.length]})]}),B&&h.jsx("p",{className:"text-[10px] text-foreground-subtle mt-0.5 line-clamp-1",children:B})]}),h.jsxs("div",{className:"flex items-center gap-1.5 shrink-0 pt-0.5",children:[!A&&h.jsx("button",{type:"button",onClick:async re=>{re.stopPropagation(),await w({title:`Restart ${R.name}?`,message:"The addon will be briefly unavailable during restart.",confirmLabel:"Restart",variant:"default"})&&ge.mutate()},disabled:ge.isPending,className:"flex items-center gap-1 rounded-md px-1.5 py-1 text-[10px] text-blue-400 hover:bg-blue-500/10 disabled:opacity-50 transition-colors",title:`Restart ${R.name}`,children:h.jsx(Dm,{className:`h-3 w-3 ${ge.isPending?"animate-spin":""}`})}),s&&i&&h.jsxs("button",{type:"button",onClick:re=>{re.stopPropagation(),i()},className:"inline-flex items-center gap-1 rounded-full bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 px-2 py-0.5 text-[10px] font-medium transition-colors",title:`Update to v${s}`,children:[h.jsx(dv,{className:"h-3 w-3"}),s]}),T&&h.jsxs("button",{type:"button",onClick:async re=>{re.stopPropagation(),await w({title:`Uninstall ${R.name}?`,message:"This will remove the addon package and all its data. This action cannot be undone.",confirmLabel:"Uninstall",variant:"danger"})&&_e.mutate()},disabled:_e.isPending,className:"flex items-center gap-1 rounded-md px-2 py-1 text-[10px] text-red-400 hover:bg-red-500/10 disabled:opacity-50 transition-colors",title:`Uninstall ${R.name}`,children:[h.jsx(Wm,{className:"h-3 w-3"}),_e.isPending&&"Removing..."]}),L&&!A&&(d?h.jsx(_1,{className:"h-4 w-4 text-foreground-subtle"}):h.jsx(Zc,{className:"h-4 w-4 text-foreground-subtle"})),!n&&h.jsxs("div",{className:"relative inline-flex items-center",children:[H!=="workspace"?h.jsx("button",{type:"button",onClick:re=>{re.stopPropagation(),b(Se=>!Se)},className:"hover:ring-1 hover:ring-primary/30 rounded-md transition-all",title:"View all versions",children:h.jsx("span",{className:s?"opacity-60":"",children:h.jsx(e3,{version:P})})}):h.jsx(e3,{version:P}),v&&h.jsx(BU,{packageName:k,currentVersion:P,onInstall:re=>{b(!1),G.mutate(re)},onClose:()=>b(!1)})]})]})]}),A&&h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",onClick:()=>f(re=>!re),className:"w-full flex items-center justify-center border-t border-border py-1 hover:bg-surface-hover/50 transition-colors",children:d?h.jsx(_1,{className:"h-3.5 w-3.5 text-foreground-subtle"}):h.jsx(Zc,{className:"h-3.5 w-3.5 text-foreground-subtle"})}),d&&h.jsx("div",{className:"border-t border-border px-3 py-2 space-y-2",children:o.addons.map(re=>h.jsx(Lb,{addon:re,agents:e,hideVersion:!0},re.manifest.id))})]}),!A&&d&&h.jsxs("div",{className:"border-t border-border px-4 py-3 space-y-4",children:[t.hasConfigSchema&&h.jsxs("div",{children:[ue&&h.jsxs("div",{className:"flex items-center gap-2 text-xs text-foreground-subtle py-2",children:[h.jsx(Jc,{className:"h-3.5 w-3.5 animate-spin"}),"Loading configuration..."]}),Z&&((he=Z.sections)==null?void 0:he.some(re=>{var Se;return((Se=re.fields)==null?void 0:Se.length)>0}))&&h.jsxs("div",{className:"space-y-3",children:[h.jsx(ey,{schema:Z,values:J,onChange:$}),ce&&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:re=>{re.stopPropagation(),ee.mutate()},disabled:ee.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:[ee.isPending?h.jsx(Jc,{className:"h-3 w-3 animate-spin"}):h.jsx(M6,{className:"h-3 w-3"}),ee.isPending?"Saving...":"Save"]})]}),ee.isError&&h.jsxs("div",{className:"text-[10px] text-red-400",children:["Save failed: ",ee.error instanceof Error?ee.error.message:"Unknown error"]})]})]}),H!=="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(PU,{addonId:R.id})]}),R.components&&R.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 (",R.components.length,")"]}),h.jsx("div",{className:"flex flex-wrap gap-1",children:R.components.map(re=>h.jsx("span",{className:"text-[10px] rounded bg-background border border-border px-1.5 py-0.5 text-foreground-subtle font-mono",children:re},re))})]}),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:[O.length===0&&h.jsx("span",{className:"text-[10px] text-foreground-subtle",children:"Hub (local)"}),O.map(re=>h.jsx("span",{className:"rounded-full bg-surface-hover border border-border px-2 py-0.5 text-[10px] text-foreground-subtle",children:re},re)),h.jsxs("div",{className:"relative",children:[h.jsxs("button",{type:"button",onClick:re=>{re.stopPropagation(),y(Se=>!Se)},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"]}),m&&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(re=>!re.isHub&&!O.includes(re.name)).map(re=>h.jsx("button",{type:"button",onClick:Se=>{Se.stopPropagation(),y(!1)},className:"w-full text-left px-3 py-1.5 text-[10px] text-foreground hover:bg-surface-hover transition-colors",children:re.name},re.id)),e.filter(re=>!re.isHub&&!O.includes(re.name)).length===0&&h.jsx("div",{className:"px-3 py-1.5 text-[10px] text-foreground-subtle",children:"No available agents"})]})]})]})]})]})]})}const YU=".tgz,.tar.gz,.zip";function VU({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 m=localStorage.getItem("camstack_admin_token")??"";try{(await(await fetch("/api/addons/upload",{method:"POST",headers:{Authorization:`Bearer ${m}`},body:f})).json()).success&&t()}finally{n(!1)}},[t]),o=D.useCallback(d=>{var m;const f=(m=d.target.files)==null?void 0:m[0];f&&i(f),d.target.value=""},[i]);return h.jsxs(h.Fragment,{children:[h.jsx("input",{ref:s,type:"file",accept:YU,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(Jc,{className:"w-3.5 h-3.5 animate-spin"}):h.jsx(k6,{className:"w-3.5 h-3.5"}),e?"Uploading...":"Upload"]})]})}function QU(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 KU(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 XU(t){return"bundle"in t}function FU({addons:t,agents:e,onRefresh:n,isRefreshing:s}){const i=en(),o=ga(),[d,f]=D.useState(""),m=D.useDeferredValue(d),[y,v]=D.useState(!1),{data:b}=pt({queryKey:["auto-update-settings"],queryFn:()=>i.trpc.addons.getAutoUpdateSettings.query(),staleTime:3e4}),_=Yn({mutationFn:A=>i.trpc.addons.applyAutoUpdateToAll.mutate({channel:A}),onSuccess:()=>{o.invalidateQueries({queryKey:["auto-update-settings"]})}}),{data:j,isFetching:w}=pt({queryKey:["addon-search",m],queryFn:()=>i.trpc.addons.searchAvailable.query({query:m||void 0}),enabled:y,staleTime:6e4}),R=Yn({mutationFn:A=>i.trpc.addons.installPackage.mutate({packageName:A}),onSuccess:(A,z)=>{o.invalidateQueries({queryKey:["addons"]}),o.invalidateQueries({queryKey:["addon-search"]}),o.invalidateQueries({queryKey:["addon-pages"]}),o.invalidateQueries({queryKey:["capabilities"]}),console.log(`[Addons] Installed ${z}`)},onError:(A,z)=>{console.error(`[Addons] Install failed for ${z}:`,A)}}),O=KU(t),T=(j??[]).filter(A=>!A.installed);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(Dm,{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(A=>h.jsx("button",{type:"button",onClick:()=>_.mutate(A),disabled:_.isPending,className:`px-3 py-1.5 transition-colors capitalize ${(b==null?void 0:b.channel)===A?A==="off"?"bg-gray-700 text-gray-200":A==="latest"?"bg-blue-500/20 text-blue-400":"bg-amber-500/20 text-amber-400":"bg-transparent text-foreground-subtle hover:bg-surface-hover"} ${A!=="off"?"border-l border-border":""}`,children:A},A))})]}),h.jsxs("div",{className:"flex gap-2",children:[h.jsxs("div",{className:"relative flex-1",children:[h.jsx(pv,{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:A=>{f(A.target.value),v(!0)},onFocus:()=>v(!0),placeholder:"Search addons by name or capability...",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"}),w&&h.jsx(Jc,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-3.5 w-3.5 text-foreground-subtle animate-spin"})]}),h.jsx(VU,{onUploadSuccess:()=>{o.invalidateQueries({queryKey:["addons"]}),n()}}),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(Dm,{className:`w-3.5 h-3.5 ${s?"animate-spin":""}`}),"Refresh"]})]}),y&&T.length>0&&h.jsxs("div",{className:"rounded-lg border border-border bg-surface overflow-hidden",children:[h.jsxs("div",{className:"px-3 py-2 text-[10px] uppercase tracking-wide text-foreground-subtle border-b border-border flex justify-between",children:[h.jsxs("span",{children:["Available on npm (",T.length,")"]}),h.jsx("button",{type:"button",onClick:()=>v(!1),className:"text-foreground-subtle hover:text-foreground",children:"close"})]}),h.jsx("div",{className:"max-h-64 overflow-auto divide-y divide-border",children:T.map(A=>h.jsxs("div",{className:"flex items-center gap-3 px-3 py-2.5 hover:bg-surface-hover transition-colors",children:[h.jsx("div",{className:"w-7 h-7 rounded-md bg-primary/10 flex items-center justify-center text-primary text-[10px] font-bold shrink-0",children:A.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-xs font-semibold truncate",children:A.name}),h.jsxs("span",{className:"text-[10px] text-foreground-subtle",children:["v",A.version]})]}),h.jsx("div",{className:"text-[10px] text-foreground-subtle truncate",children:A.description}),A.keywords&&A.keywords.length>0&&h.jsx("div",{className:"flex gap-1 mt-0.5 flex-wrap",children:A.keywords.filter(z=>z!=="camstack"&&z!=="addon"&&z!=="camstack-addon").slice(0,5).map(z=>h.jsx("span",{className:"text-[9px] px-1.5 py-0 rounded bg-primary/5 text-foreground-subtle",children:z},z))})]}),h.jsxs("button",{type:"button",onClick:()=>R.mutate(A.name),disabled:R.isPending,className:"flex items-center gap-1 px-2.5 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:[R.isPending?h.jsx(Jc,{className:"h-3 w-3 animate-spin"}):h.jsx(dv,{className:"h-3 w-3"}),"Install"]})]},A.name))})]}),y&&j&&T.length===0&&j.length>0&&h.jsxs("div",{className:"text-xs text-foreground-subtle flex items-center gap-1.5 px-1",children:[h.jsx(Im,{className:"h-3.5 w-3.5 text-green-500"}),"All matching addons are already installed"]}),t.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No addons installed"}),h.jsx("div",{className:"space-y-2",children:O.map(A=>XU(A)?h.jsx(Lb,{addon:A.representative,agents:e,bundle:A.bundle},A.bundle.packageName):h.jsx(Lb,{addon:A,agents:e},A.manifest.id))})]})}function ZU(){const t=en(),e=ga(),{data:n,isLoading:s,isError:i}=pt({queryKey:["addons","list"],queryFn:()=>t.listAddons()}),{data:o=[]}=pt({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=Yn({mutationFn:async()=>{await t.trpc.addons.forceRefresh.mutate(),await t.trpc.addons.reloadPackages.mutate()},onSuccess:()=>{e.invalidateQueries({queryKey:["addons"]}),e.invalidateQueries({queryKey:["updates"]})}}),m=(n??[]).map(QU).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:[m.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(FU,{addons:m,agents:d,onRefresh:()=>f.mutate(),isRefreshing:f.isPending})]})}function Ub(t){return t>=1024?`${(t/1024).toFixed(1)} GB`:`${Math.round(t)} MB`}function IU(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 JU(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 WU(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 $U(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 eH({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 ${$U(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:Ub(t.memoryRss/1024/1024)}),t.uptimeSeconds>0&&h.jsxs("span",{className:"text-foreground-subtle/60",children:["up ",JU(t.uptimeSeconds)]})]})}function tH({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(Zc,{className:"h-3.5 w-3.5 shrink-0 text-foreground-subtle"}):h.jsx(Ic,{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(w1,{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(kf,{className:"h-2.5 w-2.5"}),t.cpuPercent.toFixed(0),"%"]}),h.jsxs("span",{className:"flex items-center gap-1",children:[h.jsx(gm,{className:"h-2.5 w-2.5"}),t.memoryPercent.toFixed(0),"% (",Ub(t.memoryMB),")"]})]})]})]}),h.jsxs("div",{className:"flex items-center gap-2 shrink-0 text-[10px] text-foreground-subtle",children:[h.jsxs("span",{children:["up ",IU(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(V1,{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(w1,{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(kf,{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(gm,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Memory: ",h.jsx("span",{className:"text-foreground font-medium",children:Ub(t.memoryMB)})]})]}),h.jsxs("div",{className:"flex items-center gap-1.5",children:[h.jsx(kf,{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(gm,{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(w6,{className:"h-3 w-3 shrink-0"}),h.jsxs("span",{children:["Connected: ",h.jsx("span",{className:"text-foreground font-medium",children:WU(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(Y1,{className:"h-3 w-3"}),"Sub-Processes (",t.subProcesses.length,")"]}),t.subProcesses.map((o,d)=>h.jsx(eH,{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 nH({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(tH,{entry:o,isSelected:n===o.name,onSelectAgent:s},o.id))})}const a4={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 aH({agentNames:t,addonNames:e,preselectedAgent:n}){const s=en(),[i,o]=D.useState("all"),[d,f]=D.useState(n??"all"),[m,y]=D.useState("all"),v=D.useRef(n);D.useEffect(()=>{n!==v.current&&(f(n??"all"),v.current=n)},[n]);const[b,_]=D.useState(!0),j=D.useRef(null),w=D.useMemo(()=>{const H=[];return d!=="all"&&H.push(d),m!=="all"&&H.push(m),H.length>0?H:void 0},[d,m]),{data:R,isLoading:O,isError:T}=pt({queryKey:["agent-logs",i,d,m],queryFn:()=>s.getLogs({...i!=="all"?{level:i}:{},limit:300,...w?{scope:w}:{}}),refetchInterval:3e3}),A=R??[],z=D.useMemo(()=>[...A].reverse(),[A]);D.useEffect(()=>{var H;b&&((H=j.current)==null||H.scrollTo({top:0,behavior:"smooth"}))},[z,b]);const k=D.useCallback(()=>{const H=j.current;if(!H)return;const B=H.scrollTop<40;_(B)},[]);function P(H){return H?new Date(typeof H=="number"?H:String(H)).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(oT,{className:"h-3.5 w-3.5 text-foreground-subtle shrink-0"}),h.jsxs("select",{value:d,onChange:H=>f(H.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(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:m,onChange:H=>y(H.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(H=>h.jsx("option",{value:H,children:H},H))]}),h.jsxs("select",{value:i,onChange:H=>o(H.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 B;const H=!b;_(H),H&&((B=j.current)==null||B.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 ${b?"border-primary/30 bg-primary/10 text-primary":"border-border bg-surface text-foreground-subtle hover:text-foreground"}`,children:[h.jsx(SE,{className:"h-3.5 w-3.5"}),"Auto-scroll: ",b?"ON":"OFF"]})]}),O&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading logs..."}),T&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load logs"}),!O&&!T&&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:j,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((H,B)=>{const L=String(H.level??"info").toLowerCase(),V=a4[L]??a4.info,Z=String(H.message??H.msg??H.text??""),ue=Array.isArray(H.scope)?H.scope.join(" > "):String(H.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(H.timestamp??H.ts??H.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:L})}),h.jsx("td",{className:"px-2.5 py-1 border-b border-border text-foreground-subtle font-mono truncate max-w-[180px]",title:ue,children:ue||"--"}),h.jsx("td",{className:`px-2.5 py-1 border-b border-border font-mono ${V.text} break-all`,children:Z})]},B)})})]})})})]})}function sH(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:rH(t.subProcesses)}}function rH(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 d1({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 s4({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 iH(){const t=en(),e=ga(),[n,s]=D.useState("tree"),[i,o]=D.useState(null),{data:d}=pt({queryKey:["agents","testWorker","status"],queryFn:()=>t.trpc.agents.isTestWorkerRunning.query(),refetchInterval:5e3}),f=(d==null?void 0:d.running)??!1,m=Yn({mutationFn:()=>t.trpc.agents.startTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),y=Yn({mutationFn:()=>t.trpc.agents.stopTestWorker.mutate(),onSuccess:()=>{e.invalidateQueries({queryKey:["agents"]}),e.invalidateQueries({queryKey:["agent"]})}}),{data:v=[],isLoading:b}=pt({queryKey:["agent","processTree"],queryFn:()=>t.trpc.agent.processTree.query(),refetchInterval:5e3}),{data:_=[]}=pt({queryKey:["agents","list"],queryFn:()=>t.listAgents(),refetchInterval:5e3}),j=D.useMemo(()=>v.map(sH),[v]),w=j.length,R=j.reduce((z,k)=>z+k.subProcesses.length,0),O=j.reduce((z,k)=>z+k.installedAddons.length,0),T=D.useMemo(()=>j.filter(z=>!z.isHub).map(z=>z.name),[j]),A=D.useMemo(()=>{const z=new Set;for(const k of j)for(const P of k.installedAddons)z.add(P);return[...z].sort()},[j]);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(D6,{className:"h-3.5 w-3.5"}),y.isPending?"Stopping...":"Stop Test Agent"]}):h.jsxs("button",{type:"button",onClick:()=>m.mutate(),disabled:m.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(iT,{className:"h-3.5 w-3.5"}),m.isPending?"Starting...":"Start Test Agent"]})})]}),h.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-4 gap-3",children:[h.jsx(d1,{icon:gb,label:"Agents online",value:w,color:"bg-green-500/10 text-green-400"}),h.jsx(d1,{icon:kf,label:"Sub-processes",value:R,color:"bg-blue-500/10 text-blue-400"}),h.jsx(d1,{icon:CT,label:"Installed addons",value:O,color:"bg-purple-500/10 text-purple-400"}),h.jsx(d1,{icon:gb,label:"Capabilities",value:[...new Set(j.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(s4,{tab:"tree",active:n==="tree",icon:lR,label:"Process Tree",onClick:()=>s("tree")}),h.jsx(s4,{tab:"logs",active:n==="logs",icon:V1,label:"Logs",onClick:()=>s("logs")})]}),n==="tree"&&h.jsxs(h.Fragment,{children:[w===0&&!b&&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(yR,{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(nH,{entries:j,isLoading:b,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(mo,{className:"h-3 w-3"}),"Clear selection"]})]}),h.jsx(aH,{agentNames:T,addonNames:A,preselectedAgent:i??void 0})]})]})}const r4={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 lH(){const t=en(),[e,n]=D.useState("all"),[s,i]=D.useState(!1),o=D.useRef(null),{data:d,isLoading:f,isError:m}=pt({queryKey:["logs",e],queryFn:()=>t.getLogs(e!=="all"?{level:e,limit:500}:{limit:500}),refetchInterval:s?!1:3e3}),y=d??[],v=D.useMemo(()=>[...y].reverse(),[y]);D.useEffect(()=>{var _;s||(_=o.current)==null||_.scrollIntoView({behavior:"smooth"})},[v,s]);function b(_){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(fv,{className:"h-3.5 w-3.5"}):h.jsx(LT,{className:"h-3.5 w-3.5"}),s?"Resume":"Pause"]})]})]}),f&&h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse",children:"Loading..."}),m&&h.jsx("div",{className:"text-xs text-danger",children:"Failed to load"}),!f&&!m&&v.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),v.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:v.map((_,j)=>{const w=String(_.level??"info").toLowerCase(),R=r4[w]??r4.info,O=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:b(_.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 ${R.badge}`,children:w})}),h.jsx("td",{className:`px-3 py-1.5 border-b border-border font-mono ${R.text} break-all`,children:O})]},j)})})]})]})})]})}const i4={super_admin:"bg-danger/10 text-danger",admin:"bg-primary/10 text-primary",viewer:"bg-foreground-subtle/10 text-foreground-subtle"};function oH(){const t=en(),e=ga(),[n,s]=D.useState(!1),[i,o]=D.useState(""),[d,f]=D.useState(""),[m,y]=D.useState("viewer"),[v,b]=D.useState(null),{data:_,isLoading:j,isError:w}=pt({queryKey:["users"],queryFn:()=>t.listUsers()}),R=Yn({mutationFn:()=>t.createUser(i,d,m),onSuccess:()=>{e.invalidateQueries({queryKey:["users"]}),s(!1),o(""),f(""),y("viewer"),b(null)},onError:A=>{b(A instanceof Error?A.message:"Failed to create user")}}),O=_??[];function T(A){return A?new Date(typeof A=="number"?A:String(A)).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(mo,{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:A=>o(A.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:A=>f(A.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:m,onChange:A=>y(A.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"})]})]})]}),v&&h.jsx("p",{className:"text-[10px] text-danger",children:v}),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:()=>R.mutate(),disabled:R.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:R.isPending?"Creating...":"Create"})]})]}),j&&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"}),!j&&!w&&O.length===0&&h.jsx("div",{className:"text-xs text-foreground-subtle",children:"No data"}),O.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:O.map(A=>{const z=String(A.role??"viewer"),k=i4[z]??i4.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(A.username??A.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:T(A.createdAt??A.created_at??A.createdAt)})]},String(A.id??A.username))})})]})})]})}function uH({section:t}){var T,A,z;const e=en(),n=ga(),[s,i]=D.useState(null),[o,d]=D.useState(!1),[f,m]=D.useState(null),y=pt({queryKey:["settings-schema",t],queryFn:()=>e.getSettingsSchema(t),staleTime:1/0}),v=pt({queryKey:["settings",t],queryFn:()=>e.getSettings(t)}),b=(T=y.data)==null?void 0:T.schema,_=((A=y.data)==null?void 0:A.readOnly)??!1,j=((z=v.data)==null?void 0:z.data)??{},w=s??j,R=s!==null,O=Yn({mutationFn:k=>e.updateSettings(t,k),onSuccess:()=>{d(!0),m(null),i(null),n.invalidateQueries({queryKey:["settings",t]}),setTimeout(()=>d(!1),2e3)},onError:k=>{m(k instanceof Error?k.message:"Failed to save")}});return y.isLoading||v.isLoading?h.jsx("div",{className:"text-xs text-foreground-subtle animate-pulse py-4",children:"Loading..."}):y.isError||v.isError?h.jsx("div",{className:"text-xs text-danger py-4",children:"Failed to load settings"}):!b||b.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(ey,{schema:b,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}),R&&h.jsx("span",{className:"text-[10px] text-orange-400",children:"Unsaved changes"}),h.jsx("button",{type:"button",onClick:()=>O.mutate(w),disabled:O.isPending||!R,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:O.isPending?"Saving...":"Save"})]})]})}function cH(){var d;const t=en(),e=pt({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(uH,{section:o},o)]})}const dH={streaming:{icon:mR,label:"Stream"},detection:{icon:ch,label:"Detection"},recording:{icon:j6,label:"Recording"},audio:{icon:O6,label:"Audio"}};function fH({capabilities:t}){return h.jsx("div",{className:"flex items-center gap-1",children:t.map(e=>{const n=dH[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 no({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 or({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 hH={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 pH(){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(no,{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(no,{title:"Colors",children:h.jsxs("div",{className:"flex flex-wrap gap-4",children:[h.jsx(or,{name:"primary",cssVar:"--color-primary"}),h.jsx(or,{name:"background",cssVar:"--color-background"}),h.jsx(or,{name:"surface",cssVar:"--color-surface"}),h.jsx(or,{name:"foreground",cssVar:"--color-foreground"}),h.jsx(or,{name:"success",cssVar:"--color-success"}),h.jsx(or,{name:"warning",cssVar:"--color-warning"}),h.jsx(or,{name:"danger",cssVar:"--color-danger"}),h.jsx(or,{name:"info",cssVar:"--color-info"}),h.jsx(or,{name:"border",cssVar:"--color-border"}),h.jsx("div",{className:"w-px"}),h.jsx(or,{name:"frigate",hex:"#3b82f6"}),h.jsx(or,{name:"scrypted",hex:"#a855f7"}),h.jsx(or,{name:"reolink",hex:"#06b6d4"}),h.jsx(or,{name:"ha",hex:"#22d3ee"}),h.jsx(or,{name:"rtsp",hex:"#78716c"})]})}),h.jsx(no,{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(no,{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(mH,{})]})}),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(no,{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(nh,{status:n},n))})]}),h.jsxs("div",{children:[h.jsx("p",{className:"text-xs text-foreground-subtle mb-2",children:"CapabilityBadges"}),h.jsx(fH,{capabilities:["streaming","detection","recording","audio"]})]})]})}),h.jsx(no,{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(no,{title:"Provider Icons",children:h.jsx("div",{className:"flex flex-wrap gap-4",children:["frigate","scrypted","reolink","homeassistant","rtsp","onvif"].map(n=>h.jsx($1,{type:n,size:"lg",showLabel:!0},n))})}),h.jsxs(no,{title:"Form Builder Demo",children:[h.jsx(ey,{schema:hH,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(no,{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 mH(){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 l4={info:{bg:"bg-blue-500/10",border:"border-blue-500/30",icon:yb},warning:{bg:"bg-orange-500/10",border:"border-orange-500/30",icon:z6},critical:{bg:"bg-red-500/10",border:"border-red-500/30",icon:BE}};function gH({toast:t,onDismiss:e}){const n=l4[t.severity]??l4.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(mo,{className:"h-3.5 w-3.5 text-foreground-subtle"})})]})}function yH(){const[t,e]=D.useState([]),n=en(),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 m=`toast-${Date.now()}-${Math.random().toString(36).slice(2,8)}`;e(y=>[...y,{...f,id:m,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(gH,{toast:i,onDismiss:s})},i.id))})}const xH=new V4({defaultOptions:{queries:{staleTime:3e4,retry:!1,refetchOnWindowFocus:!1}}});function bH(){return h.jsx(b_,{defaultMode:"dark",children:h.jsx(Q4,{client:xH,children:h.jsx(qU,{children:h.jsxs(hE,{children:[h.jsx(o_,{children:h.jsxs(HN,{children:[h.jsx(La,{path:"/login",element:h.jsx(mO,{})}),h.jsx(La,{path:"/access-denied",element:h.jsx(gO,{})}),h.jsx(La,{path:"/showroom",element:h.jsx(pH,{})}),h.jsxs(La,{element:h.jsx(Mc,{children:h.jsx(pO,{})}),children:[h.jsx(La,{index:!0,element:h.jsx(sb,{to:"/dashboard",replace:!0})}),h.jsx(La,{path:"/dashboard",element:h.jsx(BA,{})}),h.jsx(La,{path:"/cameras",element:h.jsx(QA,{})}),h.jsx(La,{path:"/integrations",element:h.jsx(vM,{})}),h.jsx(La,{path:"/integrations/:integrationId",element:h.jsx(wM,{})}),h.jsx(La,{path:"/timeline",element:h.jsx(LM,{})}),h.jsx(La,{path:"/pipeline",element:h.jsx(gD,{})}),h.jsx(La,{path:"/devices/:deviceId",element:h.jsx(UU,{})}),h.jsx(La,{path:"/system/agents",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(iH,{})})}),h.jsx(La,{path:"/system/logs",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(lH,{})})}),h.jsx(La,{path:"/system/users",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(oH,{})})}),h.jsx(La,{path:"/system/settings",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(cH,{})})}),h.jsx(La,{path:"/system/addons",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(ZU,{})})}),h.jsx(La,{path:"/addon/:pagePath",element:h.jsx(Mc,{requiredRole:"admin",children:h.jsx(dO,{})})})]})]})}),h.jsx(yH,{})]})})})})}const vH={dashboard:"Dashboard",integrations:"Integrations",metrics:"Metrics"},SH={title:"System",addons:"Addons",agents:"Agents",processes:"Processes",logs:"Logs",users:"Users",settings:"Settings",repl:"REPL",models:"Models"},NH={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"},_H={online:"Online",offline:"Offline",connecting:"Connecting",error:"Error",disabled:"Disabled",enabled:"Enabled",active:"Active",inactive:"Inactive",running:"Running",stopped:"Stopped",pending:"Pending",unknown:"Unknown"},CH={login:"Login",logout:"Logout",username:"Username",password:"Password",signIn:"Sign In",invalidCredentials:"Invalid username or password"},jH={dark:"Dark",light:"Light",system:"System"},wH={select:"Language",en:"English",it:"Italian"},EH={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"}},TH={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"},RH={nav:vH,system:SH,common:NH,status:_H,auth:CH,theme:jH,language:wH,pages:EH,integrations:TH},OH={dashboard:"Dashboard",integrations:"Integrazioni",metrics:"Metriche"},AH={title:"Sistema",addons:"Addon",agents:"Agenti",processes:"Processi",logs:"Log",users:"Utenti",settings:"Impostazioni",repl:"REPL",models:"Modelli"},MH={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"},DH={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"},zH={login:"Accesso",logout:"Esci",username:"Nome utente",password:"Password",signIn:"Accedi",invalidCredentials:"Nome utente o password non validi"},kH={dark:"Scuro",light:"Chiaro",system:"Sistema"},LH={select:"Lingua",en:"Inglese",it:"Italiano"},UH={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"}},HH={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"},qH={nav:OH,system:AH,common:MH,status:DH,auth:zH,theme:kH,language:LH,pages:UH,integrations:HH},n7="camstack_language",BH=localStorage.getItem(n7)??"en";Ss.use(nO).init({resources:{en:{translation:RH},it:{translation:qH}},lng:BH,fallbackLng:"en",interpolation:{escapeValue:!1}});Ss.on("languageChanged",t=>{localStorage.setItem(n7,t)});window.__camstackReact=P7;H9();Pb.createRoot(document.getElementById("root")).render(h.jsx(D.StrictMode,{children:h.jsx(bH,{})}));
|