figranium 0.9.2 → 0.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,15 +0,0 @@
1
- (function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const h of document.querySelectorAll('link[rel="modulepreload"]'))c(h);new MutationObserver(h=>{for(const d of h)if(d.type==="childList")for(const f of d.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&c(f)}).observe(document,{childList:!0,subtree:!0});function o(h){const d={};return h.integrity&&(d.integrity=h.integrity),h.referrerPolicy&&(d.referrerPolicy=h.referrerPolicy),h.crossOrigin==="use-credentials"?d.credentials="include":h.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function c(h){if(h.ep)return;h.ep=!0;const d=o(h);fetch(h.href,d)}})();var nr=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Fc(l){return l&&l.__esModule&&Object.prototype.hasOwnProperty.call(l,"default")?l.default:l}var kc={exports:{}},Li={};var Vh;function r0(){if(Vh)return Li;Vh=1;var l=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(c,h,d){var f=null;if(d!==void 0&&(f=""+d),h.key!==void 0&&(f=""+h.key),"key"in h){d={};for(var p in h)p!=="key"&&(d[p]=h[p])}else d=h;return h=d.ref,{$$typeof:l,type:c,key:f,ref:h!==void 0?h:null,props:d}}return Li.Fragment=u,Li.jsx=o,Li.jsxs=o,Li}var Gh;function o0(){return Gh||(Gh=1,kc.exports=r0()),kc.exports}var s=o0(),Ac={exports:{}},Ge={};var Kh;function c0(){if(Kh)return Ge;Kh=1;var l=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),c=Symbol.for("react.strict_mode"),h=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),f=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),k=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),T=Symbol.iterator;function S(A){return A===null||typeof A!="object"?null:(A=T&&A[T]||A["@@iterator"],typeof A=="function"?A:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,w={};function v(A,O,P){this.props=A,this.context=O,this.refs=w,this.updater=P||N}v.prototype.isReactComponent={},v.prototype.setState=function(A,O){if(typeof A!="object"&&typeof A!="function"&&A!=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,A,O,"setState")},v.prototype.forceUpdate=function(A){this.updater.enqueueForceUpdate(this,A,"forceUpdate")};function E(){}E.prototype=v.prototype;function C(A,O,P){this.props=A,this.context=O,this.refs=w,this.updater=P||N}var U=C.prototype=new E;U.constructor=C,m(U,v.prototype),U.isPureReactComponent=!0;var M=Array.isArray;function Q(){}var q={H:null,A:null,T:null,S:null},ne=Object.prototype.hasOwnProperty;function F(A,O,P){var W=P.ref;return{$$typeof:l,type:A,key:O,ref:W!==void 0?W:null,props:P}}function fe(A,O){return F(A.type,O,A.props)}function ue(A){return typeof A=="object"&&A!==null&&A.$$typeof===l}function B(A){var O={"=":"=0",":":"=2"};return"$"+A.replace(/[=:]/g,function(P){return O[P]})}var H=/\/+/g;function _(A,O){return typeof A=="object"&&A!==null&&A.key!=null?B(""+A.key):O.toString(36)}function ee(A){switch(A.status){case"fulfilled":return A.value;case"rejected":throw A.reason;default:switch(typeof A.status=="string"?A.then(Q,Q):(A.status="pending",A.then(function(O){A.status==="pending"&&(A.status="fulfilled",A.value=O)},function(O){A.status==="pending"&&(A.status="rejected",A.reason=O)})),A.status){case"fulfilled":return A.value;case"rejected":throw A.reason}}throw A}function K(A,O,P,W,ce){var Ce=typeof A;(Ce==="undefined"||Ce==="boolean")&&(A=null);var Oe=!1;if(A===null)Oe=!0;else switch(Ce){case"bigint":case"string":case"number":Oe=!0;break;case"object":switch(A.$$typeof){case l:case u:Oe=!0;break;case k:return Oe=A._init,K(Oe(A._payload),O,P,W,ce)}}if(Oe)return ce=ce(A),Oe=W===""?"."+_(A,0):W,M(ce)?(P="",Oe!=null&&(P=Oe.replace(H,"$&/")+"/"),K(ce,O,P,"",function(Ye){return Ye})):ce!=null&&(ue(ce)&&(ce=fe(ce,P+(ce.key==null||A&&A.key===ce.key?"":(""+ce.key).replace(H,"$&/")+"/")+Oe)),O.push(ce)),1;Oe=0;var Te=W===""?".":W+":";if(M(A))for(var ze=0;ze<A.length;ze++)W=A[ze],Ce=Te+_(W,ze),Oe+=K(W,O,P,Ce,ce);else if(ze=S(A),typeof ze=="function")for(A=ze.call(A),ze=0;!(W=A.next()).done;)W=W.value,Ce=Te+_(W,ze++),Oe+=K(W,O,P,Ce,ce);else if(Ce==="object"){if(typeof A.then=="function")return K(ee(A),O,P,W,ce);throw O=String(A),Error("Objects are not valid as a React child (found: "+(O==="[object Object]"?"object with keys {"+Object.keys(A).join(", ")+"}":O)+"). If you meant to render a collection of children, use an array instead.")}return Oe}function I(A,O,P){if(A==null)return A;var W=[],ce=0;return K(A,W,"","",function(Ce){return O.call(P,Ce,ce++)}),W}function we(A){if(A._status===-1){var O=A._result;O=O(),O.then(function(P){(A._status===0||A._status===-1)&&(A._status=1,A._result=P)},function(P){(A._status===0||A._status===-1)&&(A._status=2,A._result=P)}),A._status===-1&&(A._status=0,A._result=O)}if(A._status===1)return A._result.default;throw A._result}var G=typeof reportError=="function"?reportError:function(A){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var O=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(O))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",A);return}console.error(A)},he={map:I,forEach:function(A,O,P){I(A,function(){O.apply(this,arguments)},P)},count:function(A){var O=0;return I(A,function(){O++}),O},toArray:function(A){return I(A,function(O){return O})||[]},only:function(A){if(!ue(A))throw Error("React.Children.only expected to receive a single React element child.");return A}};return Ge.Activity=j,Ge.Children=he,Ge.Component=v,Ge.Fragment=o,Ge.Profiler=h,Ge.PureComponent=C,Ge.StrictMode=c,Ge.Suspense=x,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(A){return q.H.useMemoCache(A)}},Ge.cache=function(A){return function(){return A.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(A,O,P){if(A==null)throw Error("The argument must be a React element, but you passed "+A+".");var W=m({},A.props),ce=A.key;if(O!=null)for(Ce in O.key!==void 0&&(ce=""+O.key),O)!ne.call(O,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&O.ref===void 0||(W[Ce]=O[Ce]);var Ce=arguments.length-2;if(Ce===1)W.children=P;else if(1<Ce){for(var Oe=Array(Ce),Te=0;Te<Ce;Te++)Oe[Te]=arguments[Te+2];W.children=Oe}return F(A.type,ce,W)},Ge.createContext=function(A){return A={$$typeof:f,_currentValue:A,_currentValue2:A,_threadCount:0,Provider:null,Consumer:null},A.Provider=A,A.Consumer={$$typeof:d,_context:A},A},Ge.createElement=function(A,O,P){var W,ce={},Ce=null;if(O!=null)for(W in O.key!==void 0&&(Ce=""+O.key),O)ne.call(O,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(ce[W]=O[W]);var Oe=arguments.length-2;if(Oe===1)ce.children=P;else if(1<Oe){for(var Te=Array(Oe),ze=0;ze<Oe;ze++)Te[ze]=arguments[ze+2];ce.children=Te}if(A&&A.defaultProps)for(W in Oe=A.defaultProps,Oe)ce[W]===void 0&&(ce[W]=Oe[W]);return F(A,Ce,ce)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(A){return{$$typeof:p,render:A}},Ge.isValidElement=ue,Ge.lazy=function(A){return{$$typeof:k,_payload:{_status:-1,_result:A},_init:we}},Ge.memo=function(A,O){return{$$typeof:b,type:A,compare:O===void 0?null:O}},Ge.startTransition=function(A){var O=q.T,P={};q.T=P;try{var W=A(),ce=q.S;ce!==null&&ce(P,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(Q,G)}catch(Ce){G(Ce)}finally{O!==null&&P.types!==null&&(O.types=P.types),q.T=O}},Ge.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},Ge.use=function(A){return q.H.use(A)},Ge.useActionState=function(A,O,P){return q.H.useActionState(A,O,P)},Ge.useCallback=function(A,O){return q.H.useCallback(A,O)},Ge.useContext=function(A){return q.H.useContext(A)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(A,O){return q.H.useDeferredValue(A,O)},Ge.useEffect=function(A,O){return q.H.useEffect(A,O)},Ge.useEffectEvent=function(A){return q.H.useEffectEvent(A)},Ge.useId=function(){return q.H.useId()},Ge.useImperativeHandle=function(A,O,P){return q.H.useImperativeHandle(A,O,P)},Ge.useInsertionEffect=function(A,O){return q.H.useInsertionEffect(A,O)},Ge.useLayoutEffect=function(A,O){return q.H.useLayoutEffect(A,O)},Ge.useMemo=function(A,O){return q.H.useMemo(A,O)},Ge.useOptimistic=function(A,O){return q.H.useOptimistic(A,O)},Ge.useReducer=function(A,O,P){return q.H.useReducer(A,O,P)},Ge.useRef=function(A){return q.H.useRef(A)},Ge.useState=function(A){return q.H.useState(A)},Ge.useSyncExternalStore=function(A,O,P){return q.H.useSyncExternalStore(A,O,P)},Ge.useTransition=function(){return q.H.useTransition()},Ge.version="19.2.3",Ge}var Zh;function Pc(){return Zh||(Zh=1,Ac.exports=c0()),Ac.exports}var z=Pc();const qn=Fc(z);var zc={exports:{}},Hi={},Tc={exports:{}},Rc={};var Xh;function u0(){return Xh||(Xh=1,(function(l){function u(K,I){var we=K.length;K.push(I);e:for(;0<we;){var G=we-1>>>1,he=K[G];if(0<h(he,I))K[G]=I,K[we]=he,we=G;else break e}}function o(K){return K.length===0?null:K[0]}function c(K){if(K.length===0)return null;var I=K[0],we=K.pop();if(we!==I){K[0]=we;e:for(var G=0,he=K.length,A=he>>>1;G<A;){var O=2*(G+1)-1,P=K[O],W=O+1,ce=K[W];if(0>h(P,we))W<he&&0>h(ce,P)?(K[G]=ce,K[W]=we,G=W):(K[G]=P,K[O]=we,G=O);else if(W<he&&0>h(ce,we))K[G]=ce,K[W]=we,G=W;else break e}}return I}function h(K,I){var we=K.sortIndex-I.sortIndex;return we!==0?we:K.id-I.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;l.unstable_now=function(){return d.now()}}else{var f=Date,p=f.now();l.unstable_now=function(){return f.now()-p}}var x=[],b=[],k=1,j=null,T=3,S=!1,N=!1,m=!1,w=!1,v=typeof setTimeout=="function"?setTimeout:null,E=typeof clearTimeout=="function"?clearTimeout:null,C=typeof setImmediate<"u"?setImmediate:null;function U(K){for(var I=o(b);I!==null;){if(I.callback===null)c(b);else if(I.startTime<=K)c(b),I.sortIndex=I.expirationTime,u(x,I);else break;I=o(b)}}function M(K){if(m=!1,U(K),!N)if(o(x)!==null)N=!0,Q||(Q=!0,B());else{var I=o(b);I!==null&&ee(M,I.startTime-K)}}var Q=!1,q=-1,ne=5,F=-1;function fe(){return w?!0:!(l.unstable_now()-F<ne)}function ue(){if(w=!1,Q){var K=l.unstable_now();F=K;var I=!0;try{e:{N=!1,m&&(m=!1,E(q),q=-1),S=!0;var we=T;try{t:{for(U(K),j=o(x);j!==null&&!(j.expirationTime>K&&fe());){var G=j.callback;if(typeof G=="function"){j.callback=null,T=j.priorityLevel;var he=G(j.expirationTime<=K);if(K=l.unstable_now(),typeof he=="function"){j.callback=he,U(K),I=!0;break t}j===o(x)&&c(x),U(K)}else c(x);j=o(x)}if(j!==null)I=!0;else{var A=o(b);A!==null&&ee(M,A.startTime-K),I=!1}}break e}finally{j=null,T=we,S=!1}I=void 0}}finally{I?B():Q=!1}}}var B;if(typeof C=="function")B=function(){C(ue)};else if(typeof MessageChannel<"u"){var H=new MessageChannel,_=H.port2;H.port1.onmessage=ue,B=function(){_.postMessage(null)}}else B=function(){v(ue,0)};function ee(K,I){q=v(function(){K(l.unstable_now())},I)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(K){K.callback=null},l.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ne=0<K?Math.floor(1e3/K):5},l.unstable_getCurrentPriorityLevel=function(){return T},l.unstable_next=function(K){switch(T){case 1:case 2:case 3:var I=3;break;default:I=T}var we=T;T=I;try{return K()}finally{T=we}},l.unstable_requestPaint=function(){w=!0},l.unstable_runWithPriority=function(K,I){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var we=T;T=K;try{return I()}finally{T=we}},l.unstable_scheduleCallback=function(K,I,we){var G=l.unstable_now();switch(typeof we=="object"&&we!==null?(we=we.delay,we=typeof we=="number"&&0<we?G+we:G):we=G,K){case 1:var he=-1;break;case 2:he=250;break;case 5:he=1073741823;break;case 4:he=1e4;break;default:he=5e3}return he=we+he,K={id:k++,callback:I,priorityLevel:K,startTime:we,expirationTime:he,sortIndex:-1},we>G?(K.sortIndex=we,u(b,K),o(x)===null&&K===o(b)&&(m?(E(q),q=-1):m=!0,ee(M,we-G))):(K.sortIndex=he,u(x,K),N||S||(N=!0,Q||(Q=!0,B()))),K},l.unstable_shouldYield=fe,l.unstable_wrapCallback=function(K){var I=T;return function(){var we=T;T=I;try{return K.apply(this,arguments)}finally{T=we}}}})(Rc)),Rc}var Ih;function d0(){return Ih||(Ih=1,Tc.exports=u0()),Tc.exports}var Oc={exports:{}},Jt={};var Qh;function f0(){if(Qh)return Jt;Qh=1;var l=Pc();function u(x){var b="https://react.dev/errors/"+x;if(1<arguments.length){b+="?args[]="+encodeURIComponent(arguments[1]);for(var k=2;k<arguments.length;k++)b+="&args[]="+encodeURIComponent(arguments[k])}return"Minified React error #"+x+"; visit "+b+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var c={d:{f:o,r:function(){throw Error(u(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},h=Symbol.for("react.portal");function d(x,b,k){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:h,key:j==null?null:""+j,children:x,containerInfo:b,implementation:k}}var f=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(x,b){if(x==="font")return"";if(typeof b=="string")return b==="use-credentials"?b:""}return Jt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=c,Jt.createPortal=function(x,b){var k=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!b||b.nodeType!==1&&b.nodeType!==9&&b.nodeType!==11)throw Error(u(299));return d(x,b,null,k)},Jt.flushSync=function(x){var b=f.T,k=c.p;try{if(f.T=null,c.p=2,x)return x()}finally{f.T=b,c.p=k,c.d.f()}},Jt.preconnect=function(x,b){typeof x=="string"&&(b?(b=b.crossOrigin,b=typeof b=="string"?b==="use-credentials"?b:"":void 0):b=null,c.d.C(x,b))},Jt.prefetchDNS=function(x){typeof x=="string"&&c.d.D(x)},Jt.preinit=function(x,b){if(typeof x=="string"&&b&&typeof b.as=="string"){var k=b.as,j=p(k,b.crossOrigin),T=typeof b.integrity=="string"?b.integrity:void 0,S=typeof b.fetchPriority=="string"?b.fetchPriority:void 0;k==="style"?c.d.S(x,typeof b.precedence=="string"?b.precedence:void 0,{crossOrigin:j,integrity:T,fetchPriority:S}):k==="script"&&c.d.X(x,{crossOrigin:j,integrity:T,fetchPriority:S,nonce:typeof b.nonce=="string"?b.nonce:void 0})}},Jt.preinitModule=function(x,b){if(typeof x=="string")if(typeof b=="object"&&b!==null){if(b.as==null||b.as==="script"){var k=p(b.as,b.crossOrigin);c.d.M(x,{crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0})}}else b==null&&c.d.M(x)},Jt.preload=function(x,b){if(typeof x=="string"&&typeof b=="object"&&b!==null&&typeof b.as=="string"){var k=b.as,j=p(k,b.crossOrigin);c.d.L(x,k,{crossOrigin:j,integrity:typeof b.integrity=="string"?b.integrity:void 0,nonce:typeof b.nonce=="string"?b.nonce:void 0,type:typeof b.type=="string"?b.type:void 0,fetchPriority:typeof b.fetchPriority=="string"?b.fetchPriority:void 0,referrerPolicy:typeof b.referrerPolicy=="string"?b.referrerPolicy:void 0,imageSrcSet:typeof b.imageSrcSet=="string"?b.imageSrcSet:void 0,imageSizes:typeof b.imageSizes=="string"?b.imageSizes:void 0,media:typeof b.media=="string"?b.media:void 0})}},Jt.preloadModule=function(x,b){if(typeof x=="string")if(b){var k=p(b.as,b.crossOrigin);c.d.m(x,{as:typeof b.as=="string"&&b.as!=="script"?b.as:void 0,crossOrigin:k,integrity:typeof b.integrity=="string"?b.integrity:void 0})}else c.d.m(x)},Jt.requestFormReset=function(x){c.d.r(x)},Jt.unstable_batchedUpdates=function(x,b){return x(b)},Jt.useFormState=function(x,b,k){return f.H.useFormState(x,b,k)},Jt.useFormStatus=function(){return f.H.useHostTransitionStatus()},Jt.version="19.2.3",Jt}var $h;function wp(){if($h)return Oc.exports;$h=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(u){console.error(u)}}return l(),Oc.exports=f0(),Oc.exports}var Jh;function h0(){if(Jh)return Hi;Jh=1;var l=d0(),u=Pc(),o=wp();function c(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function h(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function d(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function f(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function p(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function x(e){if(d(e)!==e)throw Error(c(188))}function b(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(c(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var r=i.alternate;if(r===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===a)return x(i),e;if(r===n)return x(i),t;r=r.sibling}throw Error(c(188))}if(a.return!==n.return)a=i,n=r;else{for(var g=!1,R=i.child;R;){if(R===a){g=!0,a=i,n=r;break}if(R===n){g=!0,n=i,a=r;break}R=R.sibling}if(!g){for(R=r.child;R;){if(R===a){g=!0,a=r,n=i;break}if(R===n){g=!0,n=r,a=i;break}R=R.sibling}if(!g)throw Error(c(189))}}if(a.alternate!==n)throw Error(c(190))}if(a.tag!==3)throw Error(c(188));return a.stateNode.current===a?e:t}function k(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=k(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,T=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),v=Symbol.for("react.profiler"),E=Symbol.for("react.consumer"),C=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),F=Symbol.for("react.activity"),fe=Symbol.for("react.memo_cache_sentinel"),ue=Symbol.iterator;function B(e){return e===null||typeof e!="object"?null:(e=ue&&e[ue]||e["@@iterator"],typeof e=="function"?e:null)}var H=Symbol.for("react.client.reference");function _(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===H?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case v:return"Profiler";case w:return"StrictMode";case M:return"Suspense";case Q:return"SuspenseList";case F:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case C:return e.displayName||"Context";case E:return(e._context.displayName||"Context")+".Consumer";case U:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case q:return t=e.displayName||null,t!==null?t:_(e.type)||"Memo";case ne:t=e._payload,e=e._init;try{return _(e(t))}catch{}}return null}var ee=Array.isArray,K=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,I=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,we={pending:!1,data:null,method:null,action:null},G=[],he=-1;function A(e){return{current:e}}function O(e){0>he||(e.current=G[he],G[he]=null,he--)}function P(e,t){he++,G[he]=e.current,e.current=t}var W=A(null),ce=A(null),Ce=A(null),Oe=A(null);function Te(e,t){switch(P(Ce,t),P(ce,e),P(W,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?dh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=dh(t),e=fh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}O(W),P(W,e)}function ze(){O(W),O(ce),O(Ce)}function Ye(e){e.memoizedState!==null&&P(Oe,e);var t=W.current,a=fh(t,e.type);t!==a&&(P(ce,e),P(W,a))}function Fe(e){ce.current===e&&(O(W),O(ce)),Oe.current===e&&(O(Oe),Di._currentValue=we)}var Xe,mt;function y(e){if(Xe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Xe=t&&t[1]||"",mt=-1<a.stack.indexOf(`
2
- at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
- `+Xe+e+mt}var de=!1;function re(e,t){if(!e||de)return"";de=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var be=function(){throw Error()};if(Object.defineProperty(be.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(be,[])}catch(oe){var ie=oe}Reflect.construct(e,[],be)}else{try{be.call()}catch(oe){ie=oe}e.call(be.prototype)}}else{try{throw Error()}catch(oe){ie=oe}(be=e())&&typeof be.catch=="function"&&be.catch(function(){})}}catch(oe){if(oe&&ie&&typeof oe.stack=="string")return[oe.stack,ie.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),g=r[0],R=r[1];if(g&&R){var V=g.split(`
4
- `),le=R.split(`
5
- `);for(i=n=0;n<V.length&&!V[n].includes("DetermineComponentFrameRoot");)n++;for(;i<le.length&&!le[i].includes("DetermineComponentFrameRoot");)i++;if(n===V.length||i===le.length)for(n=V.length-1,i=le.length-1;1<=n&&0<=i&&V[n]!==le[i];)i--;for(;1<=n&&0<=i;n--,i--)if(V[n]!==le[i]){if(n!==1||i!==1)do if(n--,i--,0>i||V[n]!==le[i]){var pe=`
6
- `+V[n].replace(" at new "," at ");return e.displayName&&pe.includes("<anonymous>")&&(pe=pe.replace("<anonymous>",e.displayName)),pe}while(1<=n&&0<=i);break}}}finally{de=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?y(a):""}function L(e,t){switch(e.tag){case 26:case 27:case 5:return y(e.type);case 16:return y("Lazy");case 13:return e.child!==t&&t!==null?y("Suspense Fallback"):y("Suspense");case 19:return y("SuspenseList");case 0:case 15:return re(e.type,!1);case 11:return re(e.type.render,!1);case 1:return re(e.type,!0);case 31:return y("Activity");default:return""}}function D(e){try{var t="",a=null;do t+=L(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
7
- Error generating stack: `+n.message+`
8
- `+n.stack}}var $=Object.prototype.hasOwnProperty,me=l.unstable_scheduleCallback,se=l.unstable_cancelCallback,Y=l.unstable_shouldYield,ye=l.unstable_requestPaint,je=l.unstable_now,ge=l.unstable_getCurrentPriorityLevel,Re=l.unstable_ImmediatePriority,Ve=l.unstable_UserBlockingPriority,He=l.unstable_NormalPriority,st=l.unstable_LowPriority,Bt=l.unstable_IdlePriority,ht=l.log,Wt=l.unstable_setDisableYieldValue,We=null,xt=null;function Xt(e){if(typeof ht=="function"&&Wt(e),xt&&typeof xt.setStrictMode=="function")try{xt.setStrictMode(We,e)}catch{}}var it=Math.clz32?Math.clz32:Za,Ka=Math.log,ka=Math.LN2;function Za(e){return e>>>=0,e===0?32:31-(Ka(e)/ka|0)|0}var oa=256,ga=262144,rt=4194304;function wt(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ma(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,g=e.pingedLanes;e=e.warmLanes;var R=n&134217727;return R!==0?(n=R&~r,n!==0?i=wt(n):(g&=R,g!==0?i=wt(g):a||(a=R&~e,a!==0&&(i=wt(a))))):(R=n&~r,R!==0?i=wt(R):g!==0?i=wt(g):a||(a=n&~e,a!==0&&(i=wt(a)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:i}function Aa(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function hn(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vn(){var e=rt;return rt<<=1,(rt&62914560)===0&&(rt=4194304),e}function _t(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ve(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function _e(e,t,a,n,i,r){var g=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var R=e.entanglements,V=e.expirationTimes,le=e.hiddenUpdates;for(a=g&~a;0<a;){var pe=31-it(a),be=1<<pe;R[pe]=0,V[pe]=-1;var ie=le[pe];if(ie!==null)for(le[pe]=null,pe=0;pe<ie.length;pe++){var oe=ie[pe];oe!==null&&(oe.lane&=-536870913)}a&=~be}n!==0&&Ee(e,n,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(g&~t))}function Ee(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-it(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Ae(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-it(a),i=1<<n;i&t|e[n]&t&&(e[n]|=t),a&=~i}}function nt(e,t){var a=t&-t;return a=(a&42)!==0?1:Lt(a),(a&(e.suspendedLanes|t))!==0?0:a}function Lt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function rl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ii(){var e=I.p;return e!==0?e:(e=window.event,e===void 0?32:Mh(e.type))}function ca(e,t){var a=I.p;try{return I.p=e,t()}finally{I.p=a}}var za=Math.random().toString(36).slice(2),bt="__reactFiber$"+za,It="__reactProps$"+za,Xa="__reactContainer$"+za,Xl="__reactEvents$"+za,vr="__reactListeners$"+za,Il="__reactHandles$"+za,Ql="__reactResources$"+za,Ta="__reactMarker$"+za;function ol(e){delete e[bt],delete e[It],delete e[Xl],delete e[vr],delete e[Il]}function Ua(e){var t=e[bt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[Xa]||a[bt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=yh(e);e!==null;){if(a=e[bt])return a;e=yh(e)}return t}e=a,a=e.parentNode}return null}function pn(e){if(e=e[bt]||e[Xa]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Gn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(c(33))}function X(e){var t=e[Ql];return t||(t=e[Ql]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function te(e){e[Ta]=!0}var Se=new Set,ke={};function Be(e,t){qe(e,t),qe(e+"Capture",t)}function qe(e,t){for(ke[e]=t,e=0;e<t.length;e++)Se.add(t[e])}var gt=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]*$"),et={},jt={};function Mt(e){return $.call(jt,e)?!0:$.call(et,e)?!1:gt.test(e)?jt[e]=!0:(et[e]=!0,!1)}function qt(e,t,a){if(Mt(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function Qt(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function $t(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function ea(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function $l(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Jl(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(g){a=""+g,r.call(this,g)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(g){a=""+g},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function cl(e){if(!e._valueTracker){var t=$l(e)?"checked":"value";e._valueTracker=Jl(e,t,""+e[t])}}function Ft(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=$l(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function ta(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var mn=/[\n"\\]/g;function Yt(e){return e.replace(mn,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function wr(e,t,a,n,i,r,g,R){e.name="",g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"?e.type=g:e.removeAttribute("type"),t!=null?g==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+ea(t)):e.value!==""+ea(t)&&(e.value=""+ea(t)):g!=="submit"&&g!=="reset"||e.removeAttribute("value"),t!=null?Sr(e,g,ea(t)):a!=null?Sr(e,g,ea(a)):n!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),R!=null&&typeof R!="function"&&typeof R!="symbol"&&typeof R!="boolean"?e.name=""+ea(R):e.removeAttribute("name")}function lu(e,t,a,n,i,r,g,R){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||a!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){cl(e);return}a=a!=null?""+ea(a):"",t=t!=null?""+ea(t):a,R||t===e.value||(e.value=t),e.defaultValue=t}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=R?e.checked:!!n,e.defaultChecked=!!n,g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.name=g),cl(e)}function Sr(e,t,a){t==="number"&&ta(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function ul(e,t,a,n){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&n&&(e[a].defaultSelected=!0)}else{for(a=""+ea(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function iu(e,t,a){if(t!=null&&(t=""+ea(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+ea(a):""}function su(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(c(92));if(ee(n)){if(1<n.length)throw Error(c(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=ea(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),cl(e)}function dl(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var am=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 ru(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||am.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ou(e,t,a){if(t!=null&&typeof t!="object")throw Error(c(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&a[i]!==n&&ru(e,i,n)}else for(var r in t)t.hasOwnProperty(r)&&ru(e,r,t[r])}function _r(e){if(e.indexOf("-")===-1)return!1;switch(e){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 nm=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"]]),lm=/^[\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 Qi(e){return lm.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ia(){}var jr=null;function Nr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var fl=null,hl=null;function cu(e){var t=pn(e);if(t&&(e=t.stateNode)){var a=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(wr(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+Yt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var i=n[It]||null;if(!i)throw Error(c(90));wr(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&Ft(n)}break e;case"textarea":iu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&ul(e,!!a.multiple,t,!1)}}}var Er=!1;function uu(e,t,a){if(Er)return e(t,a);Er=!0;try{var n=e(t);return n}finally{if(Er=!1,(fl!==null||hl!==null)&&(Ms(),fl&&(t=fl,e=hl,hl=fl=null,cu(t),e)))for(t=0;t<e.length;t++)cu(e[t])}}function Fl(e,t){var a=e.stateNode;if(a===null)return null;var n=a[It]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(c(231,t,typeof a));return a}var Qa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cr=!1;if(Qa)try{var Pl={};Object.defineProperty(Pl,"passive",{get:function(){Cr=!0}}),window.addEventListener("test",Pl,Pl),window.removeEventListener("test",Pl,Pl)}catch{Cr=!1}var xn=null,kr=null,$i=null;function du(){if($i)return $i;var e,t=kr,a=t.length,n,i="value"in xn?xn.value:xn.textContent,r=i.length;for(e=0;e<a&&t[e]===i[e];e++);var g=a-e;for(n=1;n<=g&&t[a-n]===i[r-n];n++);return $i=i.slice(e,1<n?1-n:void 0)}function Ji(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Fi(){return!0}function fu(){return!1}function aa(e){function t(a,n,i,r,g){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=g,this.currentTarget=null;for(var R in e)e.hasOwnProperty(R)&&(a=e[R],this[R]=a?a(r):r[R]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Fi:fu,this.isPropagationStopped=fu,this}return j(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Fi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Fi)},persist:function(){},isPersistent:Fi}),t}var Kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Pi=aa(Kn),Wl=j({},Kn,{view:0,detail:0}),im=aa(Wl),Ar,zr,ei,Wi=j({},Wl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Rr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ei&&(ei&&e.type==="mousemove"?(Ar=e.screenX-ei.screenX,zr=e.screenY-ei.screenY):zr=Ar=0,ei=e),Ar)},movementY:function(e){return"movementY"in e?e.movementY:zr}}),hu=aa(Wi),sm=j({},Wi,{dataTransfer:0}),rm=aa(sm),om=j({},Wl,{relatedTarget:0}),Tr=aa(om),cm=j({},Kn,{animationName:0,elapsedTime:0,pseudoElement:0}),um=aa(cm),dm=j({},Kn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),fm=aa(dm),hm=j({},Kn,{data:0}),pu=aa(hm),pm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mm={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"},xm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function gm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=xm[e])?!!t[e]:!1}function Rr(){return gm}var bm=j({},Wl,{key:function(e){if(e.key){var t=pm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Ji(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?mm[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Rr,charCode:function(e){return e.type==="keypress"?Ji(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Ji(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ym=aa(bm),vm=j({},Wi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mu=aa(vm),wm=j({},Wl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Rr}),Sm=aa(wm),_m=j({},Kn,{propertyName:0,elapsedTime:0,pseudoElement:0}),jm=aa(_m),Nm=j({},Wi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Em=aa(Nm),Cm=j({},Kn,{newState:0,oldState:0}),km=aa(Cm),Am=[9,13,27,32],Or=Qa&&"CompositionEvent"in window,ti=null;Qa&&"documentMode"in document&&(ti=document.documentMode);var zm=Qa&&"TextEvent"in window&&!ti,xu=Qa&&(!Or||ti&&8<ti&&11>=ti),gu=" ",bu=!1;function yu(e,t){switch(e){case"keyup":return Am.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function vu(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var pl=!1;function Tm(e,t){switch(e){case"compositionend":return vu(t);case"keypress":return t.which!==32?null:(bu=!0,gu);case"textInput":return e=t.data,e===gu&&bu?null:e;default:return null}}function Rm(e,t){if(pl)return e==="compositionend"||!Or&&yu(e,t)?(e=du(),$i=kr=xn=null,pl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return xu&&t.locale!=="ko"?null:t.data;default:return null}}var Om={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 wu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Om[e.type]:t==="textarea"}function Su(e,t,a,n){fl?hl?hl.push(n):hl=[n]:fl=n,t=Vs(t,"onChange"),0<t.length&&(a=new Pi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var ai=null,ni=null;function Dm(e){ih(e,0)}function es(e){var t=Gn(e);if(Ft(t))return e}function _u(e,t){if(e==="change")return t}var ju=!1;if(Qa){var Dr;if(Qa){var Mr="oninput"in document;if(!Mr){var Nu=document.createElement("div");Nu.setAttribute("oninput","return;"),Mr=typeof Nu.oninput=="function"}Dr=Mr}else Dr=!1;ju=Dr&&(!document.documentMode||9<document.documentMode)}function Eu(){ai&&(ai.detachEvent("onpropertychange",Cu),ni=ai=null)}function Cu(e){if(e.propertyName==="value"&&es(ni)){var t=[];Su(t,ni,e,Nr(e)),uu(Dm,t)}}function Mm(e,t,a){e==="focusin"?(Eu(),ai=t,ni=a,ai.attachEvent("onpropertychange",Cu)):e==="focusout"&&Eu()}function Um(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return es(ni)}function Bm(e,t){if(e==="click")return es(t)}function Lm(e,t){if(e==="input"||e==="change")return es(t)}function Hm(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var ua=typeof Object.is=="function"?Object.is:Hm;function li(e,t){if(ua(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!$.call(t,i)||!ua(e[i],t[i]))return!1}return!0}function ku(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Au(e,t){var a=ku(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=ku(a)}}function zu(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?zu(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Tu(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=ta(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=ta(e.document)}return t}function Ur(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var qm=Qa&&"documentMode"in document&&11>=document.documentMode,ml=null,Br=null,ii=null,Lr=!1;function Ru(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Lr||ml==null||ml!==ta(n)||(n=ml,"selectionStart"in n&&Ur(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),ii&&li(ii,n)||(ii=n,n=Vs(Br,"onSelect"),0<n.length&&(t=new Pi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=ml)))}function Zn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var xl={animationend:Zn("Animation","AnimationEnd"),animationiteration:Zn("Animation","AnimationIteration"),animationstart:Zn("Animation","AnimationStart"),transitionrun:Zn("Transition","TransitionRun"),transitionstart:Zn("Transition","TransitionStart"),transitioncancel:Zn("Transition","TransitionCancel"),transitionend:Zn("Transition","TransitionEnd")},Hr={},Ou={};Qa&&(Ou=document.createElement("div").style,"AnimationEvent"in window||(delete xl.animationend.animation,delete xl.animationiteration.animation,delete xl.animationstart.animation),"TransitionEvent"in window||delete xl.transitionend.transition);function Xn(e){if(Hr[e])return Hr[e];if(!xl[e])return e;var t=xl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Ou)return Hr[e]=t[a];return e}var Du=Xn("animationend"),Mu=Xn("animationiteration"),Uu=Xn("animationstart"),Ym=Xn("transitionrun"),Vm=Xn("transitionstart"),Gm=Xn("transitioncancel"),Bu=Xn("transitionend"),Lu=new Map,qr="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(" ");qr.push("scrollEnd");function Ra(e,t){Lu.set(e,t),Be(t,[e])}var ts=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},ba=[],gl=0,Yr=0;function as(){for(var e=gl,t=Yr=gl=0;t<e;){var a=ba[t];ba[t++]=null;var n=ba[t];ba[t++]=null;var i=ba[t];ba[t++]=null;var r=ba[t];if(ba[t++]=null,n!==null&&i!==null){var g=n.pending;g===null?i.next=i:(i.next=g.next,g.next=i),n.pending=i}r!==0&&Hu(a,i,r)}}function ns(e,t,a,n){ba[gl++]=e,ba[gl++]=t,ba[gl++]=a,ba[gl++]=n,Yr|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Vr(e,t,a,n){return ns(e,t,a,n),ls(e)}function In(e,t){return ns(e,null,null,t),ls(e)}function Hu(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var i=!1,r=e.return;r!==null;)r.childLanes|=a,n=r.alternate,n!==null&&(n.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-it(a),e=r.hiddenUpdates,n=e[i],n===null?e[i]=[t]:n.push(t),t.lane=a|536870912),r):null}function ls(e){if(50<Ci)throw Ci=0,Po=null,Error(c(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var bl={};function Km(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function da(e,t,a,n){return new Km(e,t,a,n)}function Gr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function $a(e,t){var a=e.alternate;return a===null?(a=da(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function qu(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function is(e,t,a,n,i,r){var g=0;if(n=e,typeof e=="function")Gr(e)&&(g=1);else if(typeof e=="string")g=$x(e,a,W.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case F:return e=da(31,a,t,i),e.elementType=F,e.lanes=r,e;case m:return Qn(a.children,i,r,t);case w:g=8,i|=24;break;case v:return e=da(12,a,t,i|2),e.elementType=v,e.lanes=r,e;case M:return e=da(13,a,t,i),e.elementType=M,e.lanes=r,e;case Q:return e=da(19,a,t,i),e.elementType=Q,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case C:g=10;break e;case E:g=9;break e;case U:g=11;break e;case q:g=14;break e;case ne:g=16,n=null;break e}g=29,a=Error(c(130,e===null?"null":typeof e,"")),n=null}return t=da(g,a,t,i),t.elementType=e,t.type=n,t.lanes=r,t}function Qn(e,t,a,n){return e=da(7,e,n,t),e.lanes=a,e}function Kr(e,t,a){return e=da(6,e,null,t),e.lanes=a,e}function Yu(e){var t=da(18,null,null,0);return t.stateNode=e,t}function Zr(e,t,a){return t=da(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Vu=new WeakMap;function ya(e,t){if(typeof e=="object"&&e!==null){var a=Vu.get(e);return a!==void 0?a:(t={value:e,source:t,stack:D(t)},Vu.set(e,t),t)}return{value:e,source:t,stack:D(t)}}var yl=[],vl=0,ss=null,si=0,va=[],wa=0,gn=null,Ba=1,La="";function Ja(e,t){yl[vl++]=si,yl[vl++]=ss,ss=e,si=t}function Gu(e,t,a){va[wa++]=Ba,va[wa++]=La,va[wa++]=gn,gn=e;var n=Ba;e=La;var i=32-it(n)-1;n&=~(1<<i),a+=1;var r=32-it(t)+i;if(30<r){var g=i-i%5;r=(n&(1<<g)-1).toString(32),n>>=g,i-=g,Ba=1<<32-it(t)+i|a<<i|n,La=r+e}else Ba=1<<r|a<<i|n,La=e}function Xr(e){e.return!==null&&(Ja(e,1),Gu(e,1,0))}function Ir(e){for(;e===ss;)ss=yl[--vl],yl[vl]=null,si=yl[--vl],yl[vl]=null;for(;e===gn;)gn=va[--wa],va[wa]=null,La=va[--wa],va[wa]=null,Ba=va[--wa],va[wa]=null}function Ku(e,t){va[wa++]=Ba,va[wa++]=La,va[wa++]=gn,Ba=t.id,La=t.overflow,gn=e}var Vt=null,yt=null,Pe=!1,bn=null,Sa=!1,Qr=Error(c(519));function yn(e){var t=Error(c(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ri(ya(t,e)),Qr}function Zu(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[bt]=e,t[It]=n,a){case"dialog":Qe("cancel",t),Qe("close",t);break;case"iframe":case"object":case"embed":Qe("load",t);break;case"video":case"audio":for(a=0;a<Ai.length;a++)Qe(Ai[a],t);break;case"source":Qe("error",t);break;case"img":case"image":case"link":Qe("error",t),Qe("load",t);break;case"details":Qe("toggle",t);break;case"input":Qe("invalid",t),lu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Qe("invalid",t);break;case"textarea":Qe("invalid",t),su(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||ch(t.textContent,a)?(n.popover!=null&&(Qe("beforetoggle",t),Qe("toggle",t)),n.onScroll!=null&&Qe("scroll",t),n.onScrollEnd!=null&&Qe("scrollend",t),n.onClick!=null&&(t.onclick=Ia),t=!0):t=!1,t||yn(e,!0)}function Xu(e){for(Vt=e.return;Vt;)switch(Vt.tag){case 5:case 31:case 13:Sa=!1;return;case 27:case 3:Sa=!0;return;default:Vt=Vt.return}}function wl(e){if(e!==Vt)return!1;if(!Pe)return Xu(e),Pe=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||hc(e.type,e.memoizedProps)),a=!a),a&&yt&&yn(e),Xu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));yt=bh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(317));yt=bh(e)}else t===27?(t=yt,On(e.type)?(e=bc,bc=null,yt=e):yt=t):yt=Vt?ja(e.stateNode.nextSibling):null;return!0}function $n(){yt=Vt=null,Pe=!1}function $r(){var e=bn;return e!==null&&(sa===null?sa=e:sa.push.apply(sa,e),bn=null),e}function ri(e){bn===null?bn=[e]:bn.push(e)}var Jr=A(null),Jn=null,Fa=null;function vn(e,t,a){P(Jr,t._currentValue),t._currentValue=a}function Pa(e){e._currentValue=Jr.current,O(Jr)}function Fr(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function Pr(e,t,a,n){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var g=i.child;r=r.firstContext;e:for(;r!==null;){var R=r;r=i;for(var V=0;V<t.length;V++)if(R.context===t[V]){r.lanes|=a,R=r.alternate,R!==null&&(R.lanes|=a),Fr(r.return,a,e),n||(g=null);break e}r=R.next}}else if(i.tag===18){if(g=i.return,g===null)throw Error(c(341));g.lanes|=a,r=g.alternate,r!==null&&(r.lanes|=a),Fr(g,a,e),g=null}else g=i.child;if(g!==null)g.return=i;else for(g=i;g!==null;){if(g===e){g=null;break}if(i=g.sibling,i!==null){i.return=g.return,g=i;break}g=g.return}i=g}}function Sl(e,t,a,n){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var g=i.alternate;if(g===null)throw Error(c(387));if(g=g.memoizedProps,g!==null){var R=i.type;ua(i.pendingProps.value,g.value)||(e!==null?e.push(R):e=[R])}}else if(i===Oe.current){if(g=i.alternate,g===null)throw Error(c(387));g.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Di):e=[Di])}i=i.return}e!==null&&Pr(t,e,a,n),t.flags|=262144}function rs(e){for(e=e.firstContext;e!==null;){if(!ua(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Fn(e){Jn=e,Fa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Gt(e){return Iu(Jn,e)}function os(e,t){return Jn===null&&Fn(e),Iu(e,t)}function Iu(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Fa===null){if(e===null)throw Error(c(308));Fa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Fa=Fa.next=t;return a}var Zm=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Xm=l.unstable_scheduleCallback,Im=l.unstable_NormalPriority,Tt={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Wr(){return{controller:new Zm,data:new Map,refCount:0}}function oi(e){e.refCount--,e.refCount===0&&Xm(Im,function(){e.controller.abort()})}var ci=null,eo=0,_l=0,jl=null;function Qm(e,t){if(ci===null){var a=ci=[];eo=0,_l=lc(),jl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return eo++,t.then(Qu,Qu),t}function Qu(){if(--eo===0&&ci!==null){jl!==null&&(jl.status="fulfilled");var e=ci;ci=null,_l=0,jl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function $m(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(n.status="rejected",n.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var $u=K.S;K.S=function(e,t){Of=je(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Qm(e,t),$u!==null&&$u(e,t)};var Pn=A(null);function to(){var e=Pn.current;return e!==null?e:pt.pooledCache}function cs(e,t){t===null?P(Pn,Pn.current):P(Pn,t.pool)}function Ju(){var e=to();return e===null?null:{parent:Tt._currentValue,pool:e}}var Nl=Error(c(460)),ao=Error(c(474)),us=Error(c(542)),ds={then:function(){}};function Fu(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pu(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ia,Ia),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e;default:if(typeof t.status=="string")t.then(Ia,Ia);else{if(e=pt,e!==null&&100<e.shellSuspendCounter)throw Error(c(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=n}},function(n){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e}throw el=t,Nl}}function Wn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(el=a,Nl):a}}var el=null;function Wu(){if(el===null)throw Error(c(459));var e=el;return el=null,e}function ed(e){if(e===Nl||e===us)throw Error(c(483))}var El=null,ui=0;function fs(e){var t=ui;return ui+=1,El===null&&(El=[]),Pu(El,e,t)}function di(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function hs(e,t){throw t.$$typeof===T?Error(c(525)):(e=Object.prototype.toString.call(t),Error(c(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function td(e){function t(J,Z){if(e){var ae=J.deletions;ae===null?(J.deletions=[Z],J.flags|=16):ae.push(Z)}}function a(J,Z){if(!e)return null;for(;Z!==null;)t(J,Z),Z=Z.sibling;return null}function n(J){for(var Z=new Map;J!==null;)J.key!==null?Z.set(J.key,J):Z.set(J.index,J),J=J.sibling;return Z}function i(J,Z){return J=$a(J,Z),J.index=0,J.sibling=null,J}function r(J,Z,ae){return J.index=ae,e?(ae=J.alternate,ae!==null?(ae=ae.index,ae<Z?(J.flags|=67108866,Z):ae):(J.flags|=67108866,Z)):(J.flags|=1048576,Z)}function g(J){return e&&J.alternate===null&&(J.flags|=67108866),J}function R(J,Z,ae,xe){return Z===null||Z.tag!==6?(Z=Kr(ae,J.mode,xe),Z.return=J,Z):(Z=i(Z,ae),Z.return=J,Z)}function V(J,Z,ae,xe){var Ue=ae.type;return Ue===m?pe(J,Z,ae.props.children,xe,ae.key):Z!==null&&(Z.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&Wn(Ue)===Z.type)?(Z=i(Z,ae.props),di(Z,ae),Z.return=J,Z):(Z=is(ae.type,ae.key,ae.props,null,J.mode,xe),di(Z,ae),Z.return=J,Z)}function le(J,Z,ae,xe){return Z===null||Z.tag!==4||Z.stateNode.containerInfo!==ae.containerInfo||Z.stateNode.implementation!==ae.implementation?(Z=Zr(ae,J.mode,xe),Z.return=J,Z):(Z=i(Z,ae.children||[]),Z.return=J,Z)}function pe(J,Z,ae,xe,Ue){return Z===null||Z.tag!==7?(Z=Qn(ae,J.mode,xe,Ue),Z.return=J,Z):(Z=i(Z,ae),Z.return=J,Z)}function be(J,Z,ae){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Z=Kr(""+Z,J.mode,ae),Z.return=J,Z;if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case S:return ae=is(Z.type,Z.key,Z.props,null,J.mode,ae),di(ae,Z),ae.return=J,ae;case N:return Z=Zr(Z,J.mode,ae),Z.return=J,Z;case ne:return Z=Wn(Z),be(J,Z,ae)}if(ee(Z)||B(Z))return Z=Qn(Z,J.mode,ae,null),Z.return=J,Z;if(typeof Z.then=="function")return be(J,fs(Z),ae);if(Z.$$typeof===C)return be(J,os(J,Z),ae);hs(J,Z)}return null}function ie(J,Z,ae,xe){var Ue=Z!==null?Z.key:null;if(typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint")return Ue!==null?null:R(J,Z,""+ae,xe);if(typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:return ae.key===Ue?V(J,Z,ae,xe):null;case N:return ae.key===Ue?le(J,Z,ae,xe):null;case ne:return ae=Wn(ae),ie(J,Z,ae,xe)}if(ee(ae)||B(ae))return Ue!==null?null:pe(J,Z,ae,xe,null);if(typeof ae.then=="function")return ie(J,Z,fs(ae),xe);if(ae.$$typeof===C)return ie(J,Z,os(J,ae),xe);hs(J,ae)}return null}function oe(J,Z,ae,xe,Ue){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return J=J.get(ae)||null,R(Z,J,""+xe,Ue);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case S:return J=J.get(xe.key===null?ae:xe.key)||null,V(Z,J,xe,Ue);case N:return J=J.get(xe.key===null?ae:xe.key)||null,le(Z,J,xe,Ue);case ne:return xe=Wn(xe),oe(J,Z,ae,xe,Ue)}if(ee(xe)||B(xe))return J=J.get(ae)||null,pe(Z,J,xe,Ue,null);if(typeof xe.then=="function")return oe(J,Z,ae,fs(xe),Ue);if(xe.$$typeof===C)return oe(J,Z,ae,os(Z,xe),Ue);hs(Z,xe)}return null}function De(J,Z,ae,xe){for(var Ue=null,tt=null,Me=Z,Ze=Z=0,Je=null;Me!==null&&Ze<ae.length;Ze++){Me.index>Ze?(Je=Me,Me=null):Je=Me.sibling;var at=ie(J,Me,ae[Ze],xe);if(at===null){Me===null&&(Me=Je);break}e&&Me&&at.alternate===null&&t(J,Me),Z=r(at,Z,Ze),tt===null?Ue=at:tt.sibling=at,tt=at,Me=Je}if(Ze===ae.length)return a(J,Me),Pe&&Ja(J,Ze),Ue;if(Me===null){for(;Ze<ae.length;Ze++)Me=be(J,ae[Ze],xe),Me!==null&&(Z=r(Me,Z,Ze),tt===null?Ue=Me:tt.sibling=Me,tt=Me);return Pe&&Ja(J,Ze),Ue}for(Me=n(Me);Ze<ae.length;Ze++)Je=oe(Me,J,Ze,ae[Ze],xe),Je!==null&&(e&&Je.alternate!==null&&Me.delete(Je.key===null?Ze:Je.key),Z=r(Je,Z,Ze),tt===null?Ue=Je:tt.sibling=Je,tt=Je);return e&&Me.forEach(function(Ln){return t(J,Ln)}),Pe&&Ja(J,Ze),Ue}function Le(J,Z,ae,xe){if(ae==null)throw Error(c(151));for(var Ue=null,tt=null,Me=Z,Ze=Z=0,Je=null,at=ae.next();Me!==null&&!at.done;Ze++,at=ae.next()){Me.index>Ze?(Je=Me,Me=null):Je=Me.sibling;var Ln=ie(J,Me,at.value,xe);if(Ln===null){Me===null&&(Me=Je);break}e&&Me&&Ln.alternate===null&&t(J,Me),Z=r(Ln,Z,Ze),tt===null?Ue=Ln:tt.sibling=Ln,tt=Ln,Me=Je}if(at.done)return a(J,Me),Pe&&Ja(J,Ze),Ue;if(Me===null){for(;!at.done;Ze++,at=ae.next())at=be(J,at.value,xe),at!==null&&(Z=r(at,Z,Ze),tt===null?Ue=at:tt.sibling=at,tt=at);return Pe&&Ja(J,Ze),Ue}for(Me=n(Me);!at.done;Ze++,at=ae.next())at=oe(Me,J,Ze,at.value,xe),at!==null&&(e&&at.alternate!==null&&Me.delete(at.key===null?Ze:at.key),Z=r(at,Z,Ze),tt===null?Ue=at:tt.sibling=at,tt=at);return e&&Me.forEach(function(s0){return t(J,s0)}),Pe&&Ja(J,Ze),Ue}function ft(J,Z,ae,xe){if(typeof ae=="object"&&ae!==null&&ae.type===m&&ae.key===null&&(ae=ae.props.children),typeof ae=="object"&&ae!==null){switch(ae.$$typeof){case S:e:{for(var Ue=ae.key;Z!==null;){if(Z.key===Ue){if(Ue=ae.type,Ue===m){if(Z.tag===7){a(J,Z.sibling),xe=i(Z,ae.props.children),xe.return=J,J=xe;break e}}else if(Z.elementType===Ue||typeof Ue=="object"&&Ue!==null&&Ue.$$typeof===ne&&Wn(Ue)===Z.type){a(J,Z.sibling),xe=i(Z,ae.props),di(xe,ae),xe.return=J,J=xe;break e}a(J,Z);break}else t(J,Z);Z=Z.sibling}ae.type===m?(xe=Qn(ae.props.children,J.mode,xe,ae.key),xe.return=J,J=xe):(xe=is(ae.type,ae.key,ae.props,null,J.mode,xe),di(xe,ae),xe.return=J,J=xe)}return g(J);case N:e:{for(Ue=ae.key;Z!==null;){if(Z.key===Ue)if(Z.tag===4&&Z.stateNode.containerInfo===ae.containerInfo&&Z.stateNode.implementation===ae.implementation){a(J,Z.sibling),xe=i(Z,ae.children||[]),xe.return=J,J=xe;break e}else{a(J,Z);break}else t(J,Z);Z=Z.sibling}xe=Zr(ae,J.mode,xe),xe.return=J,J=xe}return g(J);case ne:return ae=Wn(ae),ft(J,Z,ae,xe)}if(ee(ae))return De(J,Z,ae,xe);if(B(ae)){if(Ue=B(ae),typeof Ue!="function")throw Error(c(150));return ae=Ue.call(ae),Le(J,Z,ae,xe)}if(typeof ae.then=="function")return ft(J,Z,fs(ae),xe);if(ae.$$typeof===C)return ft(J,Z,os(J,ae),xe);hs(J,ae)}return typeof ae=="string"&&ae!==""||typeof ae=="number"||typeof ae=="bigint"?(ae=""+ae,Z!==null&&Z.tag===6?(a(J,Z.sibling),xe=i(Z,ae),xe.return=J,J=xe):(a(J,Z),xe=Kr(ae,J.mode,xe),xe.return=J,J=xe),g(J)):a(J,Z)}return function(J,Z,ae,xe){try{ui=0;var Ue=ft(J,Z,ae,xe);return El=null,Ue}catch(Me){if(Me===Nl||Me===us)throw Me;var tt=da(29,Me,null,J.mode);return tt.lanes=xe,tt.return=J,tt}}}var tl=td(!0),ad=td(!1),wn=!1;function no(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function lo(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function _n(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(lt&2)!==0){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=ls(e),Hu(e,null,a),t}return ns(e,n,t,a),ls(e)}function fi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ae(e,a)}}function io(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var i=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var g={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?i=r=g:r=r.next=g,a=a.next}while(a!==null);r===null?i=r=t:r=r.next=t}else i=r=t;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var so=!1;function hi(){if(so){var e=jl;if(e!==null)throw e}}function pi(e,t,a,n){so=!1;var i=e.updateQueue;wn=!1;var r=i.firstBaseUpdate,g=i.lastBaseUpdate,R=i.shared.pending;if(R!==null){i.shared.pending=null;var V=R,le=V.next;V.next=null,g===null?r=le:g.next=le,g=V;var pe=e.alternate;pe!==null&&(pe=pe.updateQueue,R=pe.lastBaseUpdate,R!==g&&(R===null?pe.firstBaseUpdate=le:R.next=le,pe.lastBaseUpdate=V))}if(r!==null){var be=i.baseState;g=0,pe=le=V=null,R=r;do{var ie=R.lane&-536870913,oe=ie!==R.lane;if(oe?($e&ie)===ie:(n&ie)===ie){ie!==0&&ie===_l&&(so=!0),pe!==null&&(pe=pe.next={lane:0,tag:R.tag,payload:R.payload,callback:null,next:null});e:{var De=e,Le=R;ie=t;var ft=a;switch(Le.tag){case 1:if(De=Le.payload,typeof De=="function"){be=De.call(ft,be,ie);break e}be=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Le.payload,ie=typeof De=="function"?De.call(ft,be,ie):De,ie==null)break e;be=j({},be,ie);break e;case 2:wn=!0}}ie=R.callback,ie!==null&&(e.flags|=64,oe&&(e.flags|=8192),oe=i.callbacks,oe===null?i.callbacks=[ie]:oe.push(ie))}else oe={lane:ie,tag:R.tag,payload:R.payload,callback:R.callback,next:null},pe===null?(le=pe=oe,V=be):pe=pe.next=oe,g|=ie;if(R=R.next,R===null){if(R=i.shared.pending,R===null)break;oe=R,R=oe.next,oe.next=null,i.lastBaseUpdate=oe,i.shared.pending=null}}while(!0);pe===null&&(V=be),i.baseState=V,i.firstBaseUpdate=le,i.lastBaseUpdate=pe,r===null&&(i.shared.lanes=0),kn|=g,e.lanes=g,e.memoizedState=be}}function nd(e,t){if(typeof e!="function")throw Error(c(191,e));e.call(t)}function ld(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nd(a[e],t)}var Cl=A(null),ps=A(0);function id(e,t){e=on,P(ps,e),P(Cl,t),on=e|t.baseLanes}function ro(){P(ps,on),P(Cl,Cl.current)}function oo(){on=ps.current,O(Cl),O(ps)}var fa=A(null),_a=null;function jn(e){var t=e.alternate;P(kt,kt.current&1),P(fa,e),_a===null&&(t===null||Cl.current!==null||t.memoizedState!==null)&&(_a=e)}function co(e){P(kt,kt.current),P(fa,e),_a===null&&(_a=e)}function sd(e){e.tag===22?(P(kt,kt.current),P(fa,e),_a===null&&(_a=e)):Nn()}function Nn(){P(kt,kt.current),P(fa,fa.current)}function ha(e){O(fa),_a===e&&(_a=null),O(kt)}var kt=A(0);function ms(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||xc(a)||gc(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Wa=0,Ke=null,ut=null,Rt=null,xs=!1,kl=!1,al=!1,gs=0,mi=0,Al=null,Jm=0;function Et(){throw Error(c(321))}function uo(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!ua(e[a],t[a]))return!1;return!0}function fo(e,t,a,n,i,r){return Wa=r,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,K.H=e===null||e.memoizedState===null?Gd:Co,al=!1,r=a(n,i),al=!1,kl&&(r=od(t,a,n,i)),rd(e),r}function rd(e){K.H=bi;var t=ut!==null&&ut.next!==null;if(Wa=0,Rt=ut=Ke=null,xs=!1,mi=0,Al=null,t)throw Error(c(300));e===null||Ot||(e=e.dependencies,e!==null&&rs(e)&&(Ot=!0))}function od(e,t,a,n){Ke=e;var i=0;do{if(kl&&(Al=null),mi=0,kl=!1,25<=i)throw Error(c(301));if(i+=1,Rt=ut=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}K.H=Kd,r=t(a,n)}while(kl);return r}function Fm(){var e=K.H,t=e.useState()[0];return t=typeof t.then=="function"?xi(t):t,e=e.useState()[0],(ut!==null?ut.memoizedState:null)!==e&&(Ke.flags|=1024),t}function ho(){var e=gs!==0;return gs=0,e}function po(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function mo(e){if(xs){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}xs=!1}Wa=0,Rt=ut=Ke=null,kl=!1,mi=gs=0,Al=null}function Pt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Rt===null?Ke.memoizedState=Rt=e:Rt=Rt.next=e,Rt}function At(){if(ut===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=ut.next;var t=Rt===null?Ke.memoizedState:Rt.next;if(t!==null)Rt=t,ut=e;else{if(e===null)throw Ke.alternate===null?Error(c(467)):Error(c(310));ut=e,e={memoizedState:ut.memoizedState,baseState:ut.baseState,baseQueue:ut.baseQueue,queue:ut.queue,next:null},Rt===null?Ke.memoizedState=Rt=e:Rt=Rt.next=e}return Rt}function bs(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function xi(e){var t=mi;return mi+=1,Al===null&&(Al=[]),e=Pu(Al,e,t),t=Ke,(Rt===null?t.memoizedState:Rt.next)===null&&(t=t.alternate,K.H=t===null||t.memoizedState===null?Gd:Co),e}function ys(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return xi(e);if(e.$$typeof===C)return Gt(e)}throw Error(c(438,String(e)))}function xo(e){var t=null,a=Ke.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Ke.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=bs(),Ke.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=fe;return t.index++,a}function en(e,t){return typeof t=="function"?t(e):t}function vs(e){var t=At();return go(t,ut,e)}function go(e,t,a){var n=e.queue;if(n===null)throw Error(c(311));n.lastRenderedReducer=a;var i=e.baseQueue,r=n.pending;if(r!==null){if(i!==null){var g=i.next;i.next=r.next,r.next=g}t.baseQueue=i=r,n.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var R=g=null,V=null,le=t,pe=!1;do{var be=le.lane&-536870913;if(be!==le.lane?($e&be)===be:(Wa&be)===be){var ie=le.revertLane;if(ie===0)V!==null&&(V=V.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),be===_l&&(pe=!0);else if((Wa&ie)===ie){le=le.next,ie===_l&&(pe=!0);continue}else be={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},V===null?(R=V=be,g=r):V=V.next=be,Ke.lanes|=ie,kn|=ie;be=le.action,al&&a(r,be),r=le.hasEagerState?le.eagerState:a(r,be)}else ie={lane:be,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},V===null?(R=V=ie,g=r):V=V.next=ie,Ke.lanes|=be,kn|=be;le=le.next}while(le!==null&&le!==t);if(V===null?g=r:V.next=R,!ua(r,e.memoizedState)&&(Ot=!0,pe&&(a=jl,a!==null)))throw a;e.memoizedState=r,e.baseState=g,e.baseQueue=V,n.lastRenderedState=r}return i===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function bo(e){var t=At(),a=t.queue;if(a===null)throw Error(c(311));a.lastRenderedReducer=e;var n=a.dispatch,i=a.pending,r=t.memoizedState;if(i!==null){a.pending=null;var g=i=i.next;do r=e(r,g.action),g=g.next;while(g!==i);ua(r,t.memoizedState)||(Ot=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,n]}function cd(e,t,a){var n=Ke,i=At(),r=Pe;if(r){if(a===void 0)throw Error(c(407));a=a()}else a=t();var g=!ua((ut||i).memoizedState,a);if(g&&(i.memoizedState=a,Ot=!0),i=i.queue,wo(fd.bind(null,n,i,e),[e]),i.getSnapshot!==t||g||Rt!==null&&Rt.memoizedState.tag&1){if(n.flags|=2048,zl(9,{destroy:void 0},dd.bind(null,n,i,a,t),null),pt===null)throw Error(c(349));r||(Wa&127)!==0||ud(n,t,a)}return a}function ud(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Ke.updateQueue,t===null?(t=bs(),Ke.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function dd(e,t,a,n){t.value=a,t.getSnapshot=n,hd(t)&&pd(e)}function fd(e,t,a){return a(function(){hd(t)&&pd(e)})}function hd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!ua(e,a)}catch{return!0}}function pd(e){var t=In(e,2);t!==null&&ra(t,e,2)}function yo(e){var t=Pt();if(typeof e=="function"){var a=e;if(e=a(),al){Xt(!0);try{a()}finally{Xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},t}function md(e,t,a,n){return e.baseState=a,go(e,ut,typeof n=="function"?n:en)}function Pm(e,t,a,n,i){if(_s(e))throw Error(c(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(g){r.listeners.push(g)}};K.T!==null?a(!0):r.isTransition=!1,n(r),a=t.pending,a===null?(r.next=t.pending=r,xd(t,r)):(r.next=a.next,t.pending=a.next=r)}}function xd(e,t){var a=t.action,n=t.payload,i=e.state;if(t.isTransition){var r=K.T,g={};K.T=g;try{var R=a(i,n),V=K.S;V!==null&&V(g,R),gd(e,t,R)}catch(le){vo(e,t,le)}finally{r!==null&&g.types!==null&&(r.types=g.types),K.T=r}}else try{r=a(i,n),gd(e,t,r)}catch(le){vo(e,t,le)}}function gd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){bd(e,t,n)},function(n){return vo(e,t,n)}):bd(e,t,a)}function bd(e,t,a){t.status="fulfilled",t.value=a,yd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,xd(e,a)))}function vo(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,yd(t),t=t.next;while(t!==n)}e.action=null}function yd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function vd(e,t){return t}function wd(e,t){if(Pe){var a=pt.formState;if(a!==null){e:{var n=Ke;if(Pe){if(yt){t:{for(var i=yt,r=Sa;i.nodeType!==8;){if(!r){i=null;break t}if(i=ja(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){yt=ja(i.nextSibling),n=i.data==="F!";break e}}yn(n)}n=!1}n&&(t=a[0])}}return a=Pt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:t},a.queue=n,a=qd.bind(null,Ke,n),n.dispatch=a,n=yo(!1),r=Eo.bind(null,Ke,!1,n.queue),n=Pt(),i={state:t,dispatch:null,action:e,pending:null},n.queue=i,a=Pm.bind(null,Ke,i,r,a),i.dispatch=a,n.memoizedState=e,[t,a,!1]}function Sd(e){var t=At();return _d(t,ut,e)}function _d(e,t,a){if(t=go(e,t,vd)[0],e=vs(en)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=xi(t)}catch(g){throw g===Nl?us:g}else n=t;t=At();var i=t.queue,r=i.dispatch;return a!==t.memoizedState&&(Ke.flags|=2048,zl(9,{destroy:void 0},Wm.bind(null,i,a),null)),[n,r,e]}function Wm(e,t){e.action=t}function jd(e){var t=At(),a=ut;if(a!==null)return _d(t,a,e);At(),t=t.memoizedState,a=At();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Ke.updateQueue,t===null&&(t=bs(),Ke.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function Nd(){return At().memoizedState}function ws(e,t,a,n){var i=Pt();Ke.flags|=e,i.memoizedState=zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function Ss(e,t,a,n){var i=At();n=n===void 0?null:n;var r=i.memoizedState.inst;ut!==null&&n!==null&&uo(n,ut.memoizedState.deps)?i.memoizedState=zl(t,r,a,n):(Ke.flags|=e,i.memoizedState=zl(1|t,r,a,n))}function Ed(e,t){ws(8390656,8,e,t)}function wo(e,t){Ss(2048,8,e,t)}function ex(e){Ke.flags|=4;var t=Ke.updateQueue;if(t===null)t=bs(),Ke.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Cd(e){var t=At().memoizedState;return ex({ref:t,nextImpl:e}),function(){if((lt&2)!==0)throw Error(c(440));return t.impl.apply(void 0,arguments)}}function kd(e,t){return Ss(4,2,e,t)}function Ad(e,t){return Ss(4,4,e,t)}function zd(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Td(e,t,a){a=a!=null?a.concat([e]):null,Ss(4,4,zd.bind(null,t,e),a)}function So(){}function Rd(e,t){var a=At();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&uo(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Od(e,t){var a=At();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&uo(t,n[1]))return n[0];if(n=e(),al){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n}function _o(e,t,a){return a===void 0||(Wa&1073741824)!==0&&($e&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Mf(),Ke.lanes|=e,kn|=e,a)}function Dd(e,t,a,n){return ua(a,t)?a:Cl.current!==null?(e=_o(e,a,n),ua(e,t)||(Ot=!0),e):(Wa&42)===0||(Wa&1073741824)!==0&&($e&261930)===0?(Ot=!0,e.memoizedState=a):(e=Mf(),Ke.lanes|=e,kn|=e,t)}function Md(e,t,a,n,i){var r=I.p;I.p=r!==0&&8>r?r:8;var g=K.T,R={};K.T=R,Eo(e,!1,t,a);try{var V=i(),le=K.S;if(le!==null&&le(R,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var pe=$m(V,n);gi(e,t,pe,xa(e))}else gi(e,t,n,xa(e))}catch(be){gi(e,t,{then:function(){},status:"rejected",reason:be},xa())}finally{I.p=r,g!==null&&R.types!==null&&(g.types=R.types),K.T=g}}function tx(){}function jo(e,t,a,n){if(e.tag!==5)throw Error(c(476));var i=Ud(e).queue;Md(e,i,t,we,a===null?tx:function(){return Bd(e),a(n)})}function Ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:we,baseState:we,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:we},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bd(e){var t=Ud(e);t.next===null&&(t=e.alternate.memoizedState),gi(e,t.next.queue,{},xa())}function No(){return Gt(Di)}function Ld(){return At().memoizedState}function Hd(){return At().memoizedState}function ax(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=xa();e=Sn(a);var n=_n(t,e,a);n!==null&&(ra(n,t,a),fi(n,t,a)),t={cache:Wr()},e.payload=t;return}t=t.return}}function nx(e,t,a){var n=xa();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},_s(e)?Yd(t,a):(a=Vr(e,t,a,n),a!==null&&(ra(a,e,n),Vd(a,t,n)))}function qd(e,t,a){var n=xa();gi(e,t,a,n)}function gi(e,t,a,n){var i={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(_s(e))Yd(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var g=t.lastRenderedState,R=r(g,a);if(i.hasEagerState=!0,i.eagerState=R,ua(R,g))return ns(e,t,i,0),pt===null&&as(),!1}catch{}if(a=Vr(e,t,i,n),a!==null)return ra(a,e,n),Vd(a,t,n),!0}return!1}function Eo(e,t,a,n){if(n={lane:2,revertLane:lc(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},_s(e)){if(t)throw Error(c(479))}else t=Vr(e,a,n,2),t!==null&&ra(t,e,2)}function _s(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function Yd(e,t){kl=xs=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Vd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ae(e,a)}}var bi={readContext:Gt,use:ys,useCallback:Et,useContext:Et,useEffect:Et,useImperativeHandle:Et,useLayoutEffect:Et,useInsertionEffect:Et,useMemo:Et,useReducer:Et,useRef:Et,useState:Et,useDebugValue:Et,useDeferredValue:Et,useTransition:Et,useSyncExternalStore:Et,useId:Et,useHostTransitionStatus:Et,useFormState:Et,useActionState:Et,useOptimistic:Et,useMemoCache:Et,useCacheRefresh:Et};bi.useEffectEvent=Et;var Gd={readContext:Gt,use:ys,useCallback:function(e,t){return Pt().memoizedState=[e,t===void 0?null:t],e},useContext:Gt,useEffect:Ed,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,ws(4194308,4,zd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return ws(4194308,4,e,t)},useInsertionEffect:function(e,t){ws(4,2,e,t)},useMemo:function(e,t){var a=Pt();t=t===void 0?null:t;var n=e();if(al){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Pt();if(a!==void 0){var i=a(t);if(al){Xt(!0);try{a(t)}finally{Xt(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=nx.bind(null,Ke,e),[n.memoizedState,e]},useRef:function(e){var t=Pt();return e={current:e},t.memoizedState=e},useState:function(e){e=yo(e);var t=e.queue,a=qd.bind(null,Ke,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:So,useDeferredValue:function(e,t){var a=Pt();return _o(a,e,t)},useTransition:function(){var e=yo(!1);return e=Md.bind(null,Ke,e.queue,!0,!1),Pt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Ke,i=Pt();if(Pe){if(a===void 0)throw Error(c(407));a=a()}else{if(a=t(),pt===null)throw Error(c(349));($e&127)!==0||ud(n,t,a)}i.memoizedState=a;var r={value:a,getSnapshot:t};return i.queue=r,Ed(fd.bind(null,n,r,e),[e]),n.flags|=2048,zl(9,{destroy:void 0},dd.bind(null,n,r,a,t),null),a},useId:function(){var e=Pt(),t=pt.identifierPrefix;if(Pe){var a=La,n=Ba;a=(n&~(1<<32-it(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=gs++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Jm++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:No,useFormState:wd,useActionState:wd,useOptimistic:function(e){var t=Pt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Eo.bind(null,Ke,!0,a),a.dispatch=t,[e,t]},useMemoCache:xo,useCacheRefresh:function(){return Pt().memoizedState=ax.bind(null,Ke)},useEffectEvent:function(e){var t=Pt(),a={impl:e};return t.memoizedState=a,function(){if((lt&2)!==0)throw Error(c(440));return a.impl.apply(void 0,arguments)}}},Co={readContext:Gt,use:ys,useCallback:Rd,useContext:Gt,useEffect:wo,useImperativeHandle:Td,useInsertionEffect:kd,useLayoutEffect:Ad,useMemo:Od,useReducer:vs,useRef:Nd,useState:function(){return vs(en)},useDebugValue:So,useDeferredValue:function(e,t){var a=At();return Dd(a,ut.memoizedState,e,t)},useTransition:function(){var e=vs(en)[0],t=At().memoizedState;return[typeof e=="boolean"?e:xi(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:No,useFormState:Sd,useActionState:Sd,useOptimistic:function(e,t){var a=At();return md(a,ut,e,t)},useMemoCache:xo,useCacheRefresh:Hd};Co.useEffectEvent=Cd;var Kd={readContext:Gt,use:ys,useCallback:Rd,useContext:Gt,useEffect:wo,useImperativeHandle:Td,useInsertionEffect:kd,useLayoutEffect:Ad,useMemo:Od,useReducer:bo,useRef:Nd,useState:function(){return bo(en)},useDebugValue:So,useDeferredValue:function(e,t){var a=At();return ut===null?_o(a,e,t):Dd(a,ut.memoizedState,e,t)},useTransition:function(){var e=bo(en)[0],t=At().memoizedState;return[typeof e=="boolean"?e:xi(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:No,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var a=At();return ut!==null?md(a,ut,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:xo,useCacheRefresh:Hd};Kd.useEffectEvent=Cd;function ko(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:j({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Ao={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=xa(),i=Sn(n);i.payload=t,a!=null&&(i.callback=a),t=_n(e,i,n),t!==null&&(ra(t,e,n),fi(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=xa(),i=Sn(n);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=_n(e,i,n),t!==null&&(ra(t,e,n),fi(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=xa(),n=Sn(a);n.tag=2,t!=null&&(n.callback=t),t=_n(e,n,a),t!==null&&(ra(t,e,a),fi(t,e,a))}};function Zd(e,t,a,n,i,r,g){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,r,g):t.prototype&&t.prototype.isPureReactComponent?!li(a,n)||!li(i,r):!0}function Xd(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&Ao.enqueueReplaceState(t,t.state,null)}function nl(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=j({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Id(e){ts(e)}function Qd(e){console.error(e)}function $d(e){ts(e)}function js(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Jd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function zo(e,t,a){return a=Sn(a),a.tag=3,a.payload={element:null},a.callback=function(){js(e,t)},a}function Fd(e){return e=Sn(e),e.tag=3,e}function Pd(e,t,a,n){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var r=n.value;e.payload=function(){return i(r)},e.callback=function(){Jd(t,a,n)}}var g=a.stateNode;g!==null&&typeof g.componentDidCatch=="function"&&(e.callback=function(){Jd(t,a,n),typeof i!="function"&&(An===null?An=new Set([this]):An.add(this));var R=n.stack;this.componentDidCatch(n.value,{componentStack:R!==null?R:""})})}function lx(e,t,a,n,i){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Sl(t,a,i,!0),a=fa.current,a!==null){switch(a.tag){case 31:case 13:return _a===null?Us():a.alternate===null&&Ct===0&&(Ct=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===ds?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),tc(e,n,i)),!1;case 22:return a.flags|=65536,n===ds?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),tc(e,n,i)),!1}throw Error(c(435,a.tag))}return tc(e,n,i),Us(),!1}if(Pe)return t=fa.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==Qr&&(e=Error(c(422),{cause:n}),ri(ya(e,a)))):(n!==Qr&&(t=Error(c(423),{cause:n}),ri(ya(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,n=ya(n,a),i=zo(e.stateNode,n,i),io(e,i),Ct!==4&&(Ct=2)),!1;var r=Error(c(520),{cause:n});if(r=ya(r,a),Ei===null?Ei=[r]:Ei.push(r),Ct!==4&&(Ct=2),t===null)return!0;n=ya(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=zo(a.stateNode,n,e),io(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(An===null||!An.has(r))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Fd(i),Pd(i,e,a,n),io(a,i),!1}a=a.return}while(a!==null);return!1}var To=Error(c(461)),Ot=!1;function Kt(e,t,a,n){t.child=e===null?ad(t,null,a,n):tl(t,e.child,a,n)}function Wd(e,t,a,n,i){a=a.render;var r=t.ref;if("ref"in n){var g={};for(var R in n)R!=="ref"&&(g[R]=n[R])}else g=n;return Fn(t),n=fo(e,t,a,g,r,i),R=ho(),e!==null&&!Ot?(po(e,t,i),tn(e,t,i)):(Pe&&R&&Xr(t),t.flags|=1,Kt(e,t,n,i),t.child)}function ef(e,t,a,n,i){if(e===null){var r=a.type;return typeof r=="function"&&!Gr(r)&&r.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=r,tf(e,t,r,n,i)):(e=is(a.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!Ho(e,i)){var g=r.memoizedProps;if(a=a.compare,a=a!==null?a:li,a(g,n)&&e.ref===t.ref)return tn(e,t,i)}return t.flags|=1,e=$a(r,n),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,a,n,i){if(e!==null){var r=e.memoizedProps;if(li(r,n)&&e.ref===t.ref)if(Ot=!1,t.pendingProps=n=r,Ho(e,i))(e.flags&131072)!==0&&(Ot=!0);else return t.lanes=e.lanes,tn(e,t,i)}return Ro(e,t,a,n,i)}function af(e,t,a,n){var i=n.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|a:a,e!==null){for(n=t.child=e.child,i=0;n!==null;)i=i|n.lanes|n.childLanes,n=n.sibling;n=i&~r}else n=0,t.child=null;return nf(e,t,r,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&cs(t,r!==null?r.cachePool:null),r!==null?id(t,r):ro(),sd(t);else return n=t.lanes=536870912,nf(e,t,r!==null?r.baseLanes|a:a,a,n)}else r!==null?(cs(t,r.cachePool),id(t,r),Nn(),t.memoizedState=null):(e!==null&&cs(t,null),ro(),Nn());return Kt(e,t,i,a),t.child}function yi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nf(e,t,a,n,i){var r=to();return r=r===null?null:{parent:Tt._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&cs(t,null),ro(),sd(t),e!==null&&Sl(e,t,n,!0),t.childLanes=i,null}function Ns(e,t){return t=Cs({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function lf(e,t,a){return tl(t,e.child,null,a),e=Ns(t,t.pendingProps),e.flags|=2,ha(t),t.memoizedState=null,e}function ix(e,t,a){var n=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Pe){if(n.mode==="hidden")return e=Ns(t,n),t.lanes=536870912,yi(null,e);if(co(t),(e=yt)?(e=gh(e,Sa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Ba,overflow:La}:null,retryLane:536870912,hydrationErrors:null},a=Yu(e),a.return=t,t.child=a,Vt=t,yt=null)):e=null,e===null)throw yn(t);return t.lanes=536870912,null}return Ns(t,n)}var r=e.memoizedState;if(r!==null){var g=r.dehydrated;if(co(t),i)if(t.flags&256)t.flags&=-257,t=lf(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(c(558));else if(Ot||Sl(e,t,a,!1),i=(a&e.childLanes)!==0,Ot||i){if(n=pt,n!==null&&(g=nt(n,a),g!==0&&g!==r.retryLane))throw r.retryLane=g,In(e,g),ra(n,e,g),To;Us(),t=lf(e,t,a)}else e=r.treeContext,yt=ja(g.nextSibling),Vt=t,Pe=!0,bn=null,Sa=!1,e!==null&&Ku(t,e),t=Ns(t,n),t.flags|=4096;return t}return e=$a(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Es(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(c(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ro(e,t,a,n,i){return Fn(t),a=fo(e,t,a,n,void 0,i),n=ho(),e!==null&&!Ot?(po(e,t,i),tn(e,t,i)):(Pe&&n&&Xr(t),t.flags|=1,Kt(e,t,a,i),t.child)}function sf(e,t,a,n,i,r){return Fn(t),t.updateQueue=null,a=od(t,n,a,i),rd(e),n=ho(),e!==null&&!Ot?(po(e,t,r),tn(e,t,r)):(Pe&&n&&Xr(t),t.flags|=1,Kt(e,t,a,r),t.child)}function rf(e,t,a,n,i){if(Fn(t),t.stateNode===null){var r=bl,g=a.contextType;typeof g=="object"&&g!==null&&(r=Gt(g)),r=new a(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Ao,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},no(t),g=a.contextType,r.context=typeof g=="object"&&g!==null?Gt(g):bl,r.state=t.memoizedState,g=a.getDerivedStateFromProps,typeof g=="function"&&(ko(t,a,g,n),r.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(g=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),g!==r.state&&Ao.enqueueReplaceState(r,r.state,null),pi(t,n,r,i),hi(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var R=t.memoizedProps,V=nl(a,R);r.props=V;var le=r.context,pe=a.contextType;g=bl,typeof pe=="object"&&pe!==null&&(g=Gt(pe));var be=a.getDerivedStateFromProps;pe=typeof be=="function"||typeof r.getSnapshotBeforeUpdate=="function",R=t.pendingProps!==R,pe||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(R||le!==g)&&Xd(t,r,n,g),wn=!1;var ie=t.memoizedState;r.state=ie,pi(t,n,r,i),hi(),le=t.memoizedState,R||ie!==le||wn?(typeof be=="function"&&(ko(t,a,be,n),le=t.memoizedState),(V=wn||Zd(t,a,V,n,ie,le,g))?(pe||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=le),r.props=n,r.state=le,r.context=g,n=V):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,lo(e,t),g=t.memoizedProps,pe=nl(a,g),r.props=pe,be=t.pendingProps,ie=r.context,le=a.contextType,V=bl,typeof le=="object"&&le!==null&&(V=Gt(le)),R=a.getDerivedStateFromProps,(le=typeof R=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(g!==be||ie!==V)&&Xd(t,r,n,V),wn=!1,ie=t.memoizedState,r.state=ie,pi(t,n,r,i),hi();var oe=t.memoizedState;g!==be||ie!==oe||wn||e!==null&&e.dependencies!==null&&rs(e.dependencies)?(typeof R=="function"&&(ko(t,a,R,n),oe=t.memoizedState),(pe=wn||Zd(t,a,pe,n,ie,oe,V)||e!==null&&e.dependencies!==null&&rs(e.dependencies))?(le||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(n,oe,V),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(n,oe,V)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=oe),r.props=n,r.state=oe,r.context=V,n=pe):(typeof r.componentDidUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||g===e.memoizedProps&&ie===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,Es(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=tl(t,e.child,null,i),t.child=tl(t,null,a,i)):Kt(e,t,a,i),t.memoizedState=r.state,e=t.child):e=tn(e,t,i),e}function of(e,t,a,n){return $n(),t.flags|=256,Kt(e,t,a,n),t.child}var Oo={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Do(e){return{baseLanes:e,cachePool:Ju()}}function Mo(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ma),e}function cf(e,t,a){var n=t.pendingProps,i=!1,r=(t.flags&128)!==0,g;if((g=r)||(g=e!==null&&e.memoizedState===null?!1:(kt.current&2)!==0),g&&(i=!0,t.flags&=-129),g=(t.flags&32)!==0,t.flags&=-33,e===null){if(Pe){if(i?jn(t):Nn(),(e=yt)?(e=gh(e,Sa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:gn!==null?{id:Ba,overflow:La}:null,retryLane:536870912,hydrationErrors:null},a=Yu(e),a.return=t,t.child=a,Vt=t,yt=null)):e=null,e===null)throw yn(t);return gc(e)?t.lanes=32:t.lanes=536870912,null}var R=n.children;return n=n.fallback,i?(Nn(),i=t.mode,R=Cs({mode:"hidden",children:R},i),n=Qn(n,i,a,null),R.return=t,n.return=t,R.sibling=n,t.child=R,n=t.child,n.memoizedState=Do(a),n.childLanes=Mo(e,g,a),t.memoizedState=Oo,yi(null,n)):(jn(t),Uo(t,R))}var V=e.memoizedState;if(V!==null&&(R=V.dehydrated,R!==null)){if(r)t.flags&256?(jn(t),t.flags&=-257,t=Bo(e,t,a)):t.memoizedState!==null?(Nn(),t.child=e.child,t.flags|=128,t=null):(Nn(),R=n.fallback,i=t.mode,n=Cs({mode:"visible",children:n.children},i),R=Qn(R,i,a,null),R.flags|=2,n.return=t,R.return=t,n.sibling=R,t.child=n,tl(t,e.child,null,a),n=t.child,n.memoizedState=Do(a),n.childLanes=Mo(e,g,a),t.memoizedState=Oo,t=yi(null,n));else if(jn(t),gc(R)){if(g=R.nextSibling&&R.nextSibling.dataset,g)var le=g.dgst;g=le,n=Error(c(419)),n.stack="",n.digest=g,ri({value:n,source:null,stack:null}),t=Bo(e,t,a)}else if(Ot||Sl(e,t,a,!1),g=(a&e.childLanes)!==0,Ot||g){if(g=pt,g!==null&&(n=nt(g,a),n!==0&&n!==V.retryLane))throw V.retryLane=n,In(e,n),ra(g,e,n),To;xc(R)||Us(),t=Bo(e,t,a)}else xc(R)?(t.flags|=192,t.child=e.child,t=null):(e=V.treeContext,yt=ja(R.nextSibling),Vt=t,Pe=!0,bn=null,Sa=!1,e!==null&&Ku(t,e),t=Uo(t,n.children),t.flags|=4096);return t}return i?(Nn(),R=n.fallback,i=t.mode,V=e.child,le=V.sibling,n=$a(V,{mode:"hidden",children:n.children}),n.subtreeFlags=V.subtreeFlags&65011712,le!==null?R=$a(le,R):(R=Qn(R,i,a,null),R.flags|=2),R.return=t,n.return=t,n.sibling=R,t.child=n,yi(null,n),n=t.child,R=e.child.memoizedState,R===null?R=Do(a):(i=R.cachePool,i!==null?(V=Tt._currentValue,i=i.parent!==V?{parent:V,pool:V}:i):i=Ju(),R={baseLanes:R.baseLanes|a,cachePool:i}),n.memoizedState=R,n.childLanes=Mo(e,g,a),t.memoizedState=Oo,yi(e.child,n)):(jn(t),a=e.child,e=a.sibling,a=$a(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(g=t.deletions,g===null?(t.deletions=[e],t.flags|=16):g.push(e)),t.child=a,t.memoizedState=null,a)}function Uo(e,t){return t=Cs({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Cs(e,t){return e=da(22,e,null,t),e.lanes=0,e}function Bo(e,t,a){return tl(t,e.child,null,a),e=Uo(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function uf(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Fr(e.return,t,a)}function Lo(e,t,a,n,i,r){var g=e.memoizedState;g===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i,treeForkCount:r}:(g.isBackwards=t,g.rendering=null,g.renderingStartTime=0,g.last=n,g.tail=a,g.tailMode=i,g.treeForkCount=r)}function df(e,t,a){var n=t.pendingProps,i=n.revealOrder,r=n.tail;n=n.children;var g=kt.current,R=(g&2)!==0;if(R?(g=g&1|2,t.flags|=128):g&=1,P(kt,g),Kt(e,t,n,a),n=Pe?si:0,!R&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&uf(e,a,t);else if(e.tag===19)uf(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ms(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),Lo(t,!1,i,a,r,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ms(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}Lo(t,!0,a,null,r,n);break;case"together":Lo(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function tn(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),kn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Sl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(c(153));if(t.child!==null){for(e=t.child,a=$a(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=$a(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Ho(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&rs(e)))}function sx(e,t,a){switch(t.tag){case 3:Te(t,t.stateNode.containerInfo),vn(t,Tt,e.memoizedState.cache),$n();break;case 27:case 5:Ye(t);break;case 4:Te(t,t.stateNode.containerInfo);break;case 10:vn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,co(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(jn(t),t.flags|=128,null):(a&t.child.childLanes)!==0?cf(e,t,a):(jn(t),e=tn(e,t,a),e!==null?e.sibling:null);jn(t);break;case 19:var i=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Sl(e,t,a,!1),n=(a&t.childLanes)!==0),i){if(n)return df(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),P(kt,kt.current),n)break;return null;case 22:return t.lanes=0,af(e,t,a,t.pendingProps);case 24:vn(t,Tt,e.memoizedState.cache)}return tn(e,t,a)}function ff(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ot=!0;else{if(!Ho(e,a)&&(t.flags&128)===0)return Ot=!1,sx(e,t,a);Ot=(e.flags&131072)!==0}else Ot=!1,Pe&&(t.flags&1048576)!==0&&Gu(t,si,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Wn(t.elementType),t.type=e,typeof e=="function")Gr(e)?(n=nl(e,n),t.tag=1,t=rf(null,t,e,n,a)):(t.tag=0,t=Ro(null,t,e,n,a));else{if(e!=null){var i=e.$$typeof;if(i===U){t.tag=11,t=Wd(null,t,e,n,a);break e}else if(i===q){t.tag=14,t=ef(null,t,e,n,a);break e}}throw t=_(e)||e,Error(c(306,t,""))}}return t;case 0:return Ro(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,i=nl(n,t.pendingProps),rf(e,t,n,i,a);case 3:e:{if(Te(t,t.stateNode.containerInfo),e===null)throw Error(c(387));n=t.pendingProps;var r=t.memoizedState;i=r.element,lo(e,t),pi(t,n,null,a);var g=t.memoizedState;if(n=g.cache,vn(t,Tt,n),n!==r.cache&&Pr(t,[Tt],a,!0),hi(),n=g.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:g.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=of(e,t,n,a);break e}else if(n!==i){i=ya(Error(c(424)),t),ri(i),t=of(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,yt=ja(e.firstChild),Vt=t,Pe=!0,bn=null,Sa=!0,a=ad(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if($n(),n===i){t=tn(e,t,a);break e}Kt(e,t,n,a)}t=t.child}return t;case 26:return Es(e,t),e===null?(a=_h(t.type,null,t.pendingProps,null))?t.memoizedState=a:Pe||(a=t.type,e=t.pendingProps,n=Gs(Ce.current).createElement(a),n[bt]=t,n[It]=e,Zt(n,a,e),te(n),t.stateNode=n):t.memoizedState=_h(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Ye(t),e===null&&Pe&&(n=t.stateNode=vh(t.type,t.pendingProps,Ce.current),Vt=t,Sa=!0,i=yt,On(t.type)?(bc=i,yt=ja(n.firstChild)):yt=i),Kt(e,t,t.pendingProps.children,a),Es(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Pe&&((i=n=yt)&&(n=Ux(n,t.type,t.pendingProps,Sa),n!==null?(t.stateNode=n,Vt=t,yt=ja(n.firstChild),Sa=!1,i=!0):i=!1),i||yn(t)),Ye(t),i=t.type,r=t.pendingProps,g=e!==null?e.memoizedProps:null,n=r.children,hc(i,r)?n=null:g!==null&&hc(i,g)&&(t.flags|=32),t.memoizedState!==null&&(i=fo(e,t,Fm,null,null,a),Di._currentValue=i),Es(e,t),Kt(e,t,n,a),t.child;case 6:return e===null&&Pe&&((e=a=yt)&&(a=Bx(a,t.pendingProps,Sa),a!==null?(t.stateNode=a,Vt=t,yt=null,e=!0):e=!1),e||yn(t)),null;case 13:return cf(e,t,a);case 4:return Te(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=tl(t,null,n,a):Kt(e,t,n,a),t.child;case 11:return Wd(e,t,t.type,t.pendingProps,a);case 7:return Kt(e,t,t.pendingProps,a),t.child;case 8:return Kt(e,t,t.pendingProps.children,a),t.child;case 12:return Kt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,vn(t,t.type,n.value),Kt(e,t,n.children,a),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,Fn(t),i=Gt(i),n=n(i),t.flags|=1,Kt(e,t,n,a),t.child;case 14:return ef(e,t,t.type,t.pendingProps,a);case 15:return tf(e,t,t.type,t.pendingProps,a);case 19:return df(e,t,a);case 31:return ix(e,t,a);case 22:return af(e,t,a,t.pendingProps);case 24:return Fn(t),n=Gt(Tt),e===null?(i=to(),i===null&&(i=pt,r=Wr(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=a),i=r),t.memoizedState={parent:n,cache:i},no(t),vn(t,Tt,i)):((e.lanes&a)!==0&&(lo(e,t),pi(t,null,null,a),hi()),i=e.memoizedState,r=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),vn(t,Tt,n)):(n=r.cache,vn(t,Tt,n),n!==i.cache&&Pr(t,[Tt],a,!0))),Kt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(c(156,t.tag))}function an(e){e.flags|=4}function qo(e,t,a,n,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Hf())e.flags|=8192;else throw el=ds,ao}else e.flags&=-16777217}function hf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!kh(t))if(Hf())e.flags|=8192;else throw el=ds,ao}function ks(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Vn():536870912,e.lanes|=t,Dl|=t)}function vi(e,t){if(!Pe)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function vt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function rx(e,t,a){var n=t.pendingProps;switch(Ir(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return vt(t),null;case 1:return vt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Pa(Tt),ze(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(wl(t)?an(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,$r())),vt(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(an(t),r!==null?(vt(t),hf(t,r)):(vt(t),qo(t,i,null,n,a))):r?r!==e.memoizedState?(an(t),vt(t),hf(t,r)):(vt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&an(t),vt(t),qo(t,i,e,n,a)),null;case 27:if(Fe(t),a=Ce.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&an(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return vt(t),null}e=W.current,wl(t)?Zu(t):(e=vh(i,n,a),t.stateNode=e,an(t))}return vt(t),null;case 5:if(Fe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&an(t);else{if(!n){if(t.stateNode===null)throw Error(c(166));return vt(t),null}if(r=W.current,wl(t))Zu(t);else{var g=Gs(Ce.current);switch(r){case 1:r=g.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=g.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=g.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=g.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=g.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is=="string"?g.createElement("select",{is:n.is}):g.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is=="string"?g.createElement(i,{is:n.is}):g.createElement(i)}}r[bt]=t,r[It]=n;e:for(g=t.child;g!==null;){if(g.tag===5||g.tag===6)r.appendChild(g.stateNode);else if(g.tag!==4&&g.tag!==27&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===t)break e;for(;g.sibling===null;){if(g.return===null||g.return===t)break e;g=g.return}g.sibling.return=g.return,g=g.sibling}t.stateNode=r;e:switch(Zt(r,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&an(t)}}return vt(t),qo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&an(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(c(166));if(e=Ce.current,wl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,i=Vt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}e[bt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||ch(e.nodeValue,a)),e||yn(t,!0)}else e=Gs(e).createTextNode(n),e[bt]=t,t.stateNode=e}return vt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=wl(t),a!==null){if(e===null){if(!n)throw Error(c(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(c(557));e[bt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vt(t),e=!1}else a=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ha(t),t):(ha(t),null);if((t.flags&128)!==0)throw Error(c(558))}return vt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=wl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(c(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(c(317));i[bt]=t}else $n(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;vt(t),i=!1}else i=$r(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ha(t),t):(ha(t),null)}return ha(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==i&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),ks(t,t.updateQueue),vt(t),null);case 4:return ze(),e===null&&oc(t.stateNode.containerInfo),vt(t),null;case 10:return Pa(t.type),vt(t),null;case 19:if(O(kt),n=t.memoizedState,n===null)return vt(t),null;if(i=(t.flags&128)!==0,r=n.rendering,r===null)if(i)vi(n,!1);else{if(Ct!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=ms(e),r!==null){for(t.flags|=128,vi(n,!1),e=r.updateQueue,t.updateQueue=e,ks(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)qu(a,e),a=a.sibling;return P(kt,kt.current&1|2),Pe&&Ja(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&je()>Os&&(t.flags|=128,i=!0,vi(n,!1),t.lanes=4194304)}else{if(!i)if(e=ms(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,ks(t,e),vi(n,!0),n.tail===null&&n.tailMode==="hidden"&&!r.alternate&&!Pe)return vt(t),null}else 2*je()-n.renderingStartTime>Os&&a!==536870912&&(t.flags|=128,i=!0,vi(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=je(),e.sibling=null,a=kt.current,P(kt,i?a&1|2:a&1),Pe&&Ja(t,n.treeForkCount),e):(vt(t),null);case 22:case 23:return ha(t),oo(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(vt(t),t.subtreeFlags&6&&(t.flags|=8192)):vt(t),a=t.updateQueue,a!==null&&ks(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&O(Pn),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Pa(Tt),vt(t),null;case 25:return null;case 30:return null}throw Error(c(156,t.tag))}function ox(e,t){switch(Ir(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Pa(Tt),ze(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Fe(t),null;case 31:if(t.memoizedState!==null){if(ha(t),t.alternate===null)throw Error(c(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ha(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(c(340));$n()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return O(kt),null;case 4:return ze(),null;case 10:return Pa(t.type),null;case 22:case 23:return ha(t),oo(),e!==null&&O(Pn),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Pa(Tt),null;case 25:return null;default:return null}}function pf(e,t){switch(Ir(t),t.tag){case 3:Pa(Tt),ze();break;case 26:case 27:case 5:Fe(t);break;case 4:ze();break;case 31:t.memoizedState!==null&&ha(t);break;case 13:ha(t);break;case 19:O(kt);break;case 10:Pa(t.type);break;case 22:case 23:ha(t),oo(),e!==null&&O(Pn);break;case 24:Pa(Tt)}}function wi(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){n=void 0;var r=a.create,g=a.inst;n=r(),g.destroy=n}a=a.next}while(a!==i)}}catch(R){ct(t,t.return,R)}}function En(e,t,a){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){var g=n.inst,R=g.destroy;if(R!==void 0){g.destroy=void 0,i=t;var V=a,le=R;try{le()}catch(pe){ct(i,V,pe)}}}n=n.next}while(n!==r)}}catch(pe){ct(t,t.return,pe)}}function mf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ld(t,a)}catch(n){ct(e,e.return,n)}}}function xf(e,t,a){a.props=nl(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ct(e,t,n)}}function Si(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(i){ct(e,t,i)}}function Ha(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(i){ct(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){ct(e,t,i)}else a.current=null}function gf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){ct(e,e.return,i)}}function Yo(e,t,a){try{var n=e.stateNode;zx(n,e.type,a,t),n[It]=t}catch(i){ct(e,e.return,i)}}function bf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&On(e.type)||e.tag===4}function Vo(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||bf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&On(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Go(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ia));else if(n!==4&&(n===27&&On(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Go(e,t,a),e=e.sibling;e!==null;)Go(e,t,a),e=e.sibling}function As(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&On(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(As(e,t,a),e=e.sibling;e!==null;)As(e,t,a),e=e.sibling}function yf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Zt(t,n,a),t[bt]=e,t[It]=a}catch(r){ct(e,e.return,r)}}var nn=!1,Dt=!1,Ko=!1,vf=typeof WeakSet=="function"?WeakSet:Set,Ht=null;function cx(e,t){if(e=e.containerInfo,dc=Js,e=Tu(e),Ur(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var i=n.anchorOffset,r=n.focusNode;n=n.focusOffset;try{a.nodeType,r.nodeType}catch{a=null;break e}var g=0,R=-1,V=-1,le=0,pe=0,be=e,ie=null;t:for(;;){for(var oe;be!==a||i!==0&&be.nodeType!==3||(R=g+i),be!==r||n!==0&&be.nodeType!==3||(V=g+n),be.nodeType===3&&(g+=be.nodeValue.length),(oe=be.firstChild)!==null;)ie=be,be=oe;for(;;){if(be===e)break t;if(ie===a&&++le===i&&(R=g),ie===r&&++pe===n&&(V=g),(oe=be.nextSibling)!==null)break;be=ie,ie=be.parentNode}be=oe}a=R===-1||V===-1?null:{start:R,end:V}}else a=null}a=a||{start:0,end:0}}else a=null;for(fc={focusedElem:e,selectionRange:a},Js=!1,Ht=t;Ht!==null;)if(t=Ht,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ht=e;else for(;Ht!==null;){switch(t=Ht,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,a=t,i=r.memoizedProps,r=r.memoizedState,n=a.stateNode;try{var De=nl(a.type,i);e=n.getSnapshotBeforeUpdate(De,r),n.__reactInternalSnapshotBeforeUpdate=e}catch(Le){ct(a,a.return,Le)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)mc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":mc(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(c(163))}if(e=t.sibling,e!==null){e.return=t.return,Ht=e;break}Ht=t.return}}function wf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:sn(e,a),n&4&&wi(5,a);break;case 1:if(sn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(g){ct(a,a.return,g)}else{var i=nl(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(g){ct(a,a.return,g)}}n&64&&mf(a),n&512&&Si(a,a.return);break;case 3:if(sn(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{ld(e,t)}catch(g){ct(a,a.return,g)}}break;case 27:t===null&&n&4&&yf(a);case 26:case 5:sn(e,a),t===null&&n&4&&gf(a),n&512&&Si(a,a.return);break;case 12:sn(e,a);break;case 31:sn(e,a),n&4&&jf(e,a);break;case 13:sn(e,a),n&4&&Nf(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=bx.bind(null,a),Lx(e,a))));break;case 22:if(n=a.memoizedState!==null||nn,!n){t=t!==null&&t.memoizedState!==null||Dt,i=nn;var r=Dt;nn=n,(Dt=t)&&!r?rn(e,a,(a.subtreeFlags&8772)!==0):sn(e,a),nn=i,Dt=r}break;case 30:break;default:sn(e,a)}}function Sf(e){var t=e.alternate;t!==null&&(e.alternate=null,Sf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ol(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var St=null,na=!1;function ln(e,t,a){for(a=a.child;a!==null;)_f(e,t,a),a=a.sibling}function _f(e,t,a){if(xt&&typeof xt.onCommitFiberUnmount=="function")try{xt.onCommitFiberUnmount(We,a)}catch{}switch(a.tag){case 26:Dt||Ha(a,t),ln(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Dt||Ha(a,t);var n=St,i=na;On(a.type)&&(St=a.stateNode,na=!1),ln(e,t,a),Ti(a.stateNode),St=n,na=i;break;case 5:Dt||Ha(a,t);case 6:if(n=St,i=na,St=null,ln(e,t,a),St=n,na=i,St!==null)if(na)try{(St.nodeType===9?St.body:St.nodeName==="HTML"?St.ownerDocument.body:St).removeChild(a.stateNode)}catch(r){ct(a,t,r)}else try{St.removeChild(a.stateNode)}catch(r){ct(a,t,r)}break;case 18:St!==null&&(na?(e=St,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Vl(e)):mh(St,a.stateNode));break;case 4:n=St,i=na,St=a.stateNode.containerInfo,na=!0,ln(e,t,a),St=n,na=i;break;case 0:case 11:case 14:case 15:En(2,a,t),Dt||En(4,a,t),ln(e,t,a);break;case 1:Dt||(Ha(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&xf(a,t,n)),ln(e,t,a);break;case 21:ln(e,t,a);break;case 22:Dt=(n=Dt)||a.memoizedState!==null,ln(e,t,a),Dt=n;break;default:ln(e,t,a)}}function jf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Vl(e)}catch(a){ct(t,t.return,a)}}}function Nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Vl(e)}catch(a){ct(t,t.return,a)}}function ux(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new vf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new vf),t;default:throw Error(c(435,e.tag))}}function zs(e,t){var a=ux(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var i=yx.bind(null,e,n);n.then(i,i)}})}function la(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],r=e,g=t,R=g;e:for(;R!==null;){switch(R.tag){case 27:if(On(R.type)){St=R.stateNode,na=!1;break e}break;case 5:St=R.stateNode,na=!1;break e;case 3:case 4:St=R.stateNode.containerInfo,na=!0;break e}R=R.return}if(St===null)throw Error(c(160));_f(r,g,i),St=null,na=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Ef(t,e),t=t.sibling}var Oa=null;function Ef(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:la(t,e),ia(e),n&4&&(En(3,e,e.return),wi(3,e),En(5,e,e.return));break;case 1:la(t,e),ia(e),n&512&&(Dt||a===null||Ha(a,a.return)),n&64&&nn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=Oa;if(la(t,e),ia(e),n&512&&(Dt||a===null||Ha(a,a.return)),n&4){var r=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":r=i.getElementsByTagName("title")[0],(!r||r[Ta]||r[bt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(n),i.head.insertBefore(r,i.querySelector("head > title"))),Zt(r,n,a),r[bt]=e,te(r),n=r;break e;case"link":var g=Eh("link","href",i).get(n+(a.href||""));if(g){for(var R=0;R<g.length;R++)if(r=g[R],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){g.splice(R,1);break t}}r=i.createElement(n),Zt(r,n,a),i.head.appendChild(r);break;case"meta":if(g=Eh("meta","content",i).get(n+(a.content||""))){for(R=0;R<g.length;R++)if(r=g[R],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){g.splice(R,1);break t}}r=i.createElement(n),Zt(r,n,a),i.head.appendChild(r);break;default:throw Error(c(468,n))}r[bt]=e,te(r),n=r}e.stateNode=n}else Ch(i,e.type,e.stateNode);else e.stateNode=Nh(i,n,e.memoizedProps);else r!==n?(r===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):r.count--,n===null?Ch(i,e.type,e.stateNode):Nh(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Yo(e,e.memoizedProps,a.memoizedProps)}break;case 27:la(t,e),ia(e),n&512&&(Dt||a===null||Ha(a,a.return)),a!==null&&n&4&&Yo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(la(t,e),ia(e),n&512&&(Dt||a===null||Ha(a,a.return)),e.flags&32){i=e.stateNode;try{dl(i,"")}catch(De){ct(e,e.return,De)}}n&4&&e.stateNode!=null&&(i=e.memoizedProps,Yo(e,i,a!==null?a.memoizedProps:i)),n&1024&&(Ko=!0);break;case 6:if(la(t,e),ia(e),n&4){if(e.stateNode===null)throw Error(c(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(De){ct(e,e.return,De)}}break;case 3:if(Xs=null,i=Oa,Oa=Ks(t.containerInfo),la(t,e),Oa=i,ia(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Vl(t.containerInfo)}catch(De){ct(e,e.return,De)}Ko&&(Ko=!1,Cf(e));break;case 4:n=Oa,Oa=Ks(e.stateNode.containerInfo),la(t,e),ia(e),Oa=n;break;case 12:la(t,e),ia(e);break;case 31:la(t,e),ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zs(e,n)));break;case 13:la(t,e),ia(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(Rs=je()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zs(e,n)));break;case 22:i=e.memoizedState!==null;var V=a!==null&&a.memoizedState!==null,le=nn,pe=Dt;if(nn=le||i,Dt=pe||V,la(t,e),Dt=pe,nn=le,ia(e),n&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||V||nn||Dt||ll(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){V=a=t;try{if(r=V.stateNode,i)g=r.style,typeof g.setProperty=="function"?g.setProperty("display","none","important"):g.display="none";else{R=V.stateNode;var be=V.memoizedProps.style,ie=be!=null&&be.hasOwnProperty("display")?be.display:null;R.style.display=ie==null||typeof ie=="boolean"?"":(""+ie).trim()}}catch(De){ct(V,V.return,De)}}}else if(t.tag===6){if(a===null){V=t;try{V.stateNode.nodeValue=i?"":V.memoizedProps}catch(De){ct(V,V.return,De)}}}else if(t.tag===18){if(a===null){V=t;try{var oe=V.stateNode;i?xh(oe,!0):xh(V.stateNode,!1)}catch(De){ct(V,V.return,De)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,zs(e,a))));break;case 19:la(t,e),ia(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,zs(e,n)));break;case 30:break;case 21:break;default:la(t,e),ia(e)}}function ia(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(bf(n)){a=n;break}n=n.return}if(a==null)throw Error(c(160));switch(a.tag){case 27:var i=a.stateNode,r=Vo(e);As(e,r,i);break;case 5:var g=a.stateNode;a.flags&32&&(dl(g,""),a.flags&=-33);var R=Vo(e);As(e,R,g);break;case 3:case 4:var V=a.stateNode.containerInfo,le=Vo(e);Go(e,le,V);break;default:throw Error(c(161))}}catch(pe){ct(e,e.return,pe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Cf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Cf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function sn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wf(e,t.alternate,t),t=t.sibling}function ll(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:En(4,t,t.return),ll(t);break;case 1:Ha(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&xf(t,t.return,a),ll(t);break;case 27:Ti(t.stateNode);case 26:case 5:Ha(t,t.return),ll(t);break;case 22:t.memoizedState===null&&ll(t);break;case 30:ll(t);break;default:ll(t)}e=e.sibling}}function rn(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,i=e,r=t,g=r.flags;switch(r.tag){case 0:case 11:case 15:rn(i,r,a),wi(4,r);break;case 1:if(rn(i,r,a),n=r,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(le){ct(n,n.return,le)}if(n=r,i=n.updateQueue,i!==null){var R=n.stateNode;try{var V=i.shared.hiddenCallbacks;if(V!==null)for(i.shared.hiddenCallbacks=null,i=0;i<V.length;i++)nd(V[i],R)}catch(le){ct(n,n.return,le)}}a&&g&64&&mf(r),Si(r,r.return);break;case 27:yf(r);case 26:case 5:rn(i,r,a),a&&n===null&&g&4&&gf(r),Si(r,r.return);break;case 12:rn(i,r,a);break;case 31:rn(i,r,a),a&&g&4&&jf(i,r);break;case 13:rn(i,r,a),a&&g&4&&Nf(i,r);break;case 22:r.memoizedState===null&&rn(i,r,a),Si(r,r.return);break;case 30:break;default:rn(i,r,a)}t=t.sibling}}function Zo(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&oi(a))}function Xo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oi(e))}function Da(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)kf(e,t,a,n),t=t.sibling}function kf(e,t,a,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Da(e,t,a,n),i&2048&&wi(9,t);break;case 1:Da(e,t,a,n);break;case 3:Da(e,t,a,n),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&oi(e)));break;case 12:if(i&2048){Da(e,t,a,n),e=t.stateNode;try{var r=t.memoizedProps,g=r.id,R=r.onPostCommit;typeof R=="function"&&R(g,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(V){ct(t,t.return,V)}}else Da(e,t,a,n);break;case 31:Da(e,t,a,n);break;case 13:Da(e,t,a,n);break;case 23:break;case 22:r=t.stateNode,g=t.alternate,t.memoizedState!==null?r._visibility&2?Da(e,t,a,n):_i(e,t):r._visibility&2?Da(e,t,a,n):(r._visibility|=2,Tl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),i&2048&&Zo(g,t);break;case 24:Da(e,t,a,n),i&2048&&Xo(t.alternate,t);break;default:Da(e,t,a,n)}}function Tl(e,t,a,n,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,g=t,R=a,V=n,le=g.flags;switch(g.tag){case 0:case 11:case 15:Tl(r,g,R,V,i),wi(8,g);break;case 23:break;case 22:var pe=g.stateNode;g.memoizedState!==null?pe._visibility&2?Tl(r,g,R,V,i):_i(r,g):(pe._visibility|=2,Tl(r,g,R,V,i)),i&&le&2048&&Zo(g.alternate,g);break;case 24:Tl(r,g,R,V,i),i&&le&2048&&Xo(g.alternate,g);break;default:Tl(r,g,R,V,i)}t=t.sibling}}function _i(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,i=n.flags;switch(n.tag){case 22:_i(a,n),i&2048&&Zo(n.alternate,n);break;case 24:_i(a,n),i&2048&&Xo(n.alternate,n);break;default:_i(a,n)}t=t.sibling}}var ji=8192;function Rl(e,t,a){if(e.subtreeFlags&ji)for(e=e.child;e!==null;)Af(e,t,a),e=e.sibling}function Af(e,t,a){switch(e.tag){case 26:Rl(e,t,a),e.flags&ji&&e.memoizedState!==null&&Jx(a,Oa,e.memoizedState,e.memoizedProps);break;case 5:Rl(e,t,a);break;case 3:case 4:var n=Oa;Oa=Ks(e.stateNode.containerInfo),Rl(e,t,a),Oa=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=ji,ji=16777216,Rl(e,t,a),ji=n):Rl(e,t,a));break;default:Rl(e,t,a)}}function zf(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ni(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ht=n,Rf(n,e)}zf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Tf(e),e=e.sibling}function Tf(e){switch(e.tag){case 0:case 11:case 15:Ni(e),e.flags&2048&&En(9,e,e.return);break;case 3:Ni(e);break;case 12:Ni(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Ts(e)):Ni(e);break;default:Ni(e)}}function Ts(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];Ht=n,Rf(n,e)}zf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:En(8,t,t.return),Ts(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Ts(t));break;default:Ts(t)}e=e.sibling}}function Rf(e,t){for(;Ht!==null;){var a=Ht;switch(a.tag){case 0:case 11:case 15:En(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:oi(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Ht=n;else e:for(a=e;Ht!==null;){n=Ht;var i=n.sibling,r=n.return;if(Sf(n),n===a){Ht=null;break e}if(i!==null){i.return=r,Ht=i;break e}Ht=r}}}var dx={getCacheForType:function(e){var t=Gt(Tt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Gt(Tt).controller.signal}},fx=typeof WeakMap=="function"?WeakMap:Map,lt=0,pt=null,Ie=null,$e=0,ot=0,pa=null,Cn=!1,Ol=!1,Io=!1,on=0,Ct=0,kn=0,il=0,Qo=0,ma=0,Dl=0,Ei=null,sa=null,$o=!1,Rs=0,Of=0,Os=1/0,Ds=null,An=null,Ut=0,zn=null,Ml=null,cn=0,Jo=0,Fo=null,Df=null,Ci=0,Po=null;function xa(){return(lt&2)!==0&&$e!==0?$e&-$e:K.T!==null?lc():Ii()}function Mf(){if(ma===0)if(($e&536870912)===0||Pe){var e=ga;ga<<=1,(ga&3932160)===0&&(ga=262144),ma=e}else ma=536870912;return e=fa.current,e!==null&&(e.flags|=32),ma}function ra(e,t,a){(e===pt&&(ot===2||ot===9)||e.cancelPendingCommit!==null)&&(Ul(e,0),Tn(e,$e,ma,!1)),ve(e,a),((lt&2)===0||e!==pt)&&(e===pt&&((lt&2)===0&&(il|=a),Ct===4&&Tn(e,$e,ma,!1)),qa(e))}function Uf(e,t,a){if((lt&6)!==0)throw Error(c(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||Aa(e,t),i=n?mx(e,t):ec(e,t,!0),r=n;do{if(i===0){Ol&&!n&&Tn(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!hx(a)){i=ec(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var g=0;else g=e.pendingLanes&-536870913,g=g!==0?g:g&536870912?536870912:0;if(g!==0){t=g;e:{var R=e;i=Ei;var V=R.current.memoizedState.isDehydrated;if(V&&(Ul(R,g).flags|=256),g=ec(R,g,!1),g!==2){if(Io&&!V){R.errorRecoveryDisabledLanes|=r,il|=r,i=4;break e}r=sa,sa=i,r!==null&&(sa===null?sa=r:sa.push.apply(sa,r))}i=g}if(r=!1,i!==2)continue}}if(i===1){Ul(e,0),Tn(e,t,0,!0);break}e:{switch(n=e,r=i,r){case 0:case 1:throw Error(c(345));case 4:if((t&4194048)!==t)break;case 6:Tn(n,t,ma,!Cn);break e;case 2:sa=null;break;case 3:case 5:break;default:throw Error(c(329))}if((t&62914560)===t&&(i=Rs+300-je(),10<i)){if(Tn(n,t,ma,!Cn),Ma(n,0,!0)!==0)break e;cn=t,n.timeoutHandle=hh(Bf.bind(null,n,a,sa,Ds,$o,t,ma,il,Dl,Cn,r,"Throttled",-0,0),i);break e}Bf(n,a,sa,Ds,$o,t,ma,il,Dl,Cn,r,null,-0,0)}}break}while(!0);qa(e)}function Bf(e,t,a,n,i,r,g,R,V,le,pe,be,ie,oe){if(e.timeoutHandle=-1,be=t.subtreeFlags,be&8192||(be&16785408)===16785408){be={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ia},Af(t,r,be);var De=(r&62914560)===r?Rs-je():(r&4194048)===r?Of-je():0;if(De=Fx(be,De),De!==null){cn=r,e.cancelPendingCommit=De(Zf.bind(null,e,t,r,a,n,i,g,R,V,pe,be,null,ie,oe)),Tn(e,r,g,!le);return}}Zf(e,t,r,a,n,i,g,R,V)}function hx(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],r=i.getSnapshot;i=i.value;try{if(!ua(r(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Tn(e,t,a,n){t&=~Qo,t&=~il,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var r=31-it(i),g=1<<r;n[r]=-1,i&=~g}a!==0&&Ee(e,a,t)}function Ms(){return(lt&6)===0?(ki(0),!1):!0}function Wo(){if(Ie!==null){if(ot===0)var e=Ie.return;else e=Ie,Fa=Jn=null,mo(e),El=null,ui=0,e=Ie;for(;e!==null;)pf(e.alternate,e),e=e.return;Ie=null}}function Ul(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Ox(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),cn=0,Wo(),pt=e,Ie=a=$a(e.current,null),$e=t,ot=0,pa=null,Cn=!1,Ol=Aa(e,t),Io=!1,Dl=ma=Qo=il=kn=Ct=0,sa=Ei=null,$o=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-it(n),r=1<<i;t|=e[i],n&=~r}return on=t,as(),a}function Lf(e,t){Ke=null,K.H=bi,t===Nl||t===us?(t=Wu(),ot=3):t===ao?(t=Wu(),ot=4):ot=t===To?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pa=t,Ie===null&&(Ct=1,js(e,ya(t,e.current)))}function Hf(){var e=fa.current;return e===null?!0:($e&4194048)===$e?_a===null:($e&62914560)===$e||($e&536870912)!==0?e===_a:!1}function qf(){var e=K.H;return K.H=bi,e===null?bi:e}function Yf(){var e=K.A;return K.A=dx,e}function Us(){Ct=4,Cn||($e&4194048)!==$e&&fa.current!==null||(Ol=!0),(kn&134217727)===0&&(il&134217727)===0||pt===null||Tn(pt,$e,ma,!1)}function ec(e,t,a){var n=lt;lt|=2;var i=qf(),r=Yf();(pt!==e||$e!==t)&&(Ds=null,Ul(e,t)),t=!1;var g=Ct;e:do try{if(ot!==0&&Ie!==null){var R=Ie,V=pa;switch(ot){case 8:Wo(),g=6;break e;case 3:case 2:case 9:case 6:fa.current===null&&(t=!0);var le=ot;if(ot=0,pa=null,Bl(e,R,V,le),a&&Ol){g=0;break e}break;default:le=ot,ot=0,pa=null,Bl(e,R,V,le)}}px(),g=Ct;break}catch(pe){Lf(e,pe)}while(!0);return t&&e.shellSuspendCounter++,Fa=Jn=null,lt=n,K.H=i,K.A=r,Ie===null&&(pt=null,$e=0,as()),g}function px(){for(;Ie!==null;)Vf(Ie)}function mx(e,t){var a=lt;lt|=2;var n=qf(),i=Yf();pt!==e||$e!==t?(Ds=null,Os=je()+500,Ul(e,t)):Ol=Aa(e,t);e:do try{if(ot!==0&&Ie!==null){t=Ie;var r=pa;t:switch(ot){case 1:ot=0,pa=null,Bl(e,t,r,1);break;case 2:case 9:if(Fu(r)){ot=0,pa=null,Gf(t);break}t=function(){ot!==2&&ot!==9||pt!==e||(ot=7),qa(e)},r.then(t,t);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:Fu(r)?(ot=0,pa=null,Gf(t)):(ot=0,pa=null,Bl(e,t,r,7));break;case 5:var g=null;switch(Ie.tag){case 26:g=Ie.memoizedState;case 5:case 27:var R=Ie;if(g?kh(g):R.stateNode.complete){ot=0,pa=null;var V=R.sibling;if(V!==null)Ie=V;else{var le=R.return;le!==null?(Ie=le,Bs(le)):Ie=null}break t}}ot=0,pa=null,Bl(e,t,r,5);break;case 6:ot=0,pa=null,Bl(e,t,r,6);break;case 8:Wo(),Ct=6;break e;default:throw Error(c(462))}}xx();break}catch(pe){Lf(e,pe)}while(!0);return Fa=Jn=null,K.H=n,K.A=i,lt=a,Ie!==null?0:(pt=null,$e=0,as(),Ct)}function xx(){for(;Ie!==null&&!Y();)Vf(Ie)}function Vf(e){var t=ff(e.alternate,e,on);e.memoizedProps=e.pendingProps,t===null?Bs(e):Ie=t}function Gf(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=sf(a,t,t.pendingProps,t.type,void 0,$e);break;case 11:t=sf(a,t,t.pendingProps,t.type.render,t.ref,$e);break;case 5:mo(t);default:pf(a,t),t=Ie=qu(t,on),t=ff(a,t,on)}e.memoizedProps=e.pendingProps,t===null?Bs(e):Ie=t}function Bl(e,t,a,n){Fa=Jn=null,mo(t),El=null,ui=0;var i=t.return;try{if(lx(e,i,t,a,$e)){Ct=1,js(e,ya(a,e.current)),Ie=null;return}}catch(r){if(i!==null)throw Ie=i,r;Ct=1,js(e,ya(a,e.current)),Ie=null;return}t.flags&32768?(Pe||n===1?e=!0:Ol||($e&536870912)!==0?e=!1:(Cn=e=!0,(n===2||n===9||n===3||n===6)&&(n=fa.current,n!==null&&n.tag===13&&(n.flags|=16384))),Kf(t,e)):Bs(t)}function Bs(e){var t=e;do{if((t.flags&32768)!==0){Kf(t,Cn);return}e=t.return;var a=rx(t.alternate,t,on);if(a!==null){Ie=a;return}if(t=t.sibling,t!==null){Ie=t;return}Ie=t=e}while(t!==null);Ct===0&&(Ct=5)}function Kf(e,t){do{var a=ox(e.alternate,e);if(a!==null){a.flags&=32767,Ie=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ie=e;return}Ie=e=a}while(e!==null);Ct=6,Ie=null}function Zf(e,t,a,n,i,r,g,R,V){e.cancelPendingCommit=null;do Ls();while(Ut!==0);if((lt&6)!==0)throw Error(c(327));if(t!==null){if(t===e.current)throw Error(c(177));if(r=t.lanes|t.childLanes,r|=Yr,_e(e,a,r,g,R,V),e===pt&&(Ie=pt=null,$e=0),Ml=t,zn=e,cn=a,Jo=r,Fo=i,Df=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,vx(He,function(){return Jf(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=K.T,K.T=null,i=I.p,I.p=2,g=lt,lt|=4;try{cx(e,t,a)}finally{lt=g,I.p=i,K.T=n}}Ut=1,Xf(),If(),Qf()}}function Xf(){if(Ut===1){Ut=0;var e=zn,t=Ml,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=K.T,K.T=null;var n=I.p;I.p=2;var i=lt;lt|=4;try{Ef(t,e);var r=fc,g=Tu(e.containerInfo),R=r.focusedElem,V=r.selectionRange;if(g!==R&&R&&R.ownerDocument&&zu(R.ownerDocument.documentElement,R)){if(V!==null&&Ur(R)){var le=V.start,pe=V.end;if(pe===void 0&&(pe=le),"selectionStart"in R)R.selectionStart=le,R.selectionEnd=Math.min(pe,R.value.length);else{var be=R.ownerDocument||document,ie=be&&be.defaultView||window;if(ie.getSelection){var oe=ie.getSelection(),De=R.textContent.length,Le=Math.min(V.start,De),ft=V.end===void 0?Le:Math.min(V.end,De);!oe.extend&&Le>ft&&(g=ft,ft=Le,Le=g);var J=Au(R,Le),Z=Au(R,ft);if(J&&Z&&(oe.rangeCount!==1||oe.anchorNode!==J.node||oe.anchorOffset!==J.offset||oe.focusNode!==Z.node||oe.focusOffset!==Z.offset)){var ae=be.createRange();ae.setStart(J.node,J.offset),oe.removeAllRanges(),Le>ft?(oe.addRange(ae),oe.extend(Z.node,Z.offset)):(ae.setEnd(Z.node,Z.offset),oe.addRange(ae))}}}}for(be=[],oe=R;oe=oe.parentNode;)oe.nodeType===1&&be.push({element:oe,left:oe.scrollLeft,top:oe.scrollTop});for(typeof R.focus=="function"&&R.focus(),R=0;R<be.length;R++){var xe=be[R];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}Js=!!dc,fc=dc=null}finally{lt=i,I.p=n,K.T=a}}e.current=t,Ut=2}}function If(){if(Ut===2){Ut=0;var e=zn,t=Ml,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=K.T,K.T=null;var n=I.p;I.p=2;var i=lt;lt|=4;try{wf(e,t.alternate,t)}finally{lt=i,I.p=n,K.T=a}}Ut=3}}function Qf(){if(Ut===4||Ut===3){Ut=0,ye();var e=zn,t=Ml,a=cn,n=Df;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?Ut=5:(Ut=0,Ml=zn=null,$f(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(An=null),rl(a),t=t.stateNode,xt&&typeof xt.onCommitFiberRoot=="function")try{xt.onCommitFiberRoot(We,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=K.T,i=I.p,I.p=2,K.T=null;try{for(var r=e.onRecoverableError,g=0;g<n.length;g++){var R=n[g];r(R.value,{componentStack:R.stack})}}finally{K.T=t,I.p=i}}(cn&3)!==0&&Ls(),qa(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===Po?Ci++:(Ci=0,Po=e):Ci=0,ki(0)}}function $f(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,oi(t)))}function Ls(){return Xf(),If(),Qf(),Jf()}function Jf(){if(Ut!==5)return!1;var e=zn,t=Jo;Jo=0;var a=rl(cn),n=K.T,i=I.p;try{I.p=32>a?32:a,K.T=null,a=Fo,Fo=null;var r=zn,g=cn;if(Ut=0,Ml=zn=null,cn=0,(lt&6)!==0)throw Error(c(331));var R=lt;if(lt|=4,Tf(r.current),kf(r,r.current,g,a),lt=R,ki(0,!1),xt&&typeof xt.onPostCommitFiberRoot=="function")try{xt.onPostCommitFiberRoot(We,r)}catch{}return!0}finally{I.p=i,K.T=n,$f(e,t)}}function Ff(e,t,a){t=ya(a,t),t=zo(e.stateNode,t,2),e=_n(e,t,2),e!==null&&(ve(e,2),qa(e))}function ct(e,t,a){if(e.tag===3)Ff(e,e,a);else for(;t!==null;){if(t.tag===3){Ff(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(An===null||!An.has(n))){e=ya(a,e),a=Fd(2),n=_n(t,a,2),n!==null&&(Pd(a,n,t,e),ve(n,2),qa(n));break}}t=t.return}}function tc(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new fx;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(a)||(Io=!0,i.add(a),e=gx.bind(null,e,t,a),t.then(e,e))}function gx(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,pt===e&&($e&a)===a&&(Ct===4||Ct===3&&($e&62914560)===$e&&300>je()-Rs?(lt&2)===0&&Ul(e,0):Qo|=a,Dl===$e&&(Dl=0)),qa(e)}function Pf(e,t){t===0&&(t=Vn()),e=In(e,t),e!==null&&(ve(e,t),qa(e))}function bx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Pf(e,a)}function yx(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(c(314))}n!==null&&n.delete(t),Pf(e,a)}function vx(e,t){return me(e,t)}var Hs=null,Ll=null,ac=!1,qs=!1,nc=!1,Rn=0;function qa(e){e!==Ll&&e.next===null&&(Ll===null?Hs=Ll=e:Ll=Ll.next=e),qs=!0,ac||(ac=!0,Sx())}function ki(e,t){if(!nc&&qs){nc=!0;do for(var a=!1,n=Hs;n!==null;){if(e!==0){var i=n.pendingLanes;if(i===0)var r=0;else{var g=n.suspendedLanes,R=n.pingedLanes;r=(1<<31-it(42|e)+1)-1,r&=i&~(g&~R),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,ah(n,r))}else r=$e,r=Ma(n,n===pt?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||Aa(n,r)||(a=!0,ah(n,r));n=n.next}while(a);nc=!1}}function wx(){Wf()}function Wf(){qs=ac=!1;var e=0;Rn!==0&&Rx()&&(e=Rn);for(var t=je(),a=null,n=Hs;n!==null;){var i=n.next,r=eh(n,t);r===0?(n.next=null,a===null?Hs=i:a.next=i,i===null&&(Ll=a)):(a=n,(e!==0||(r&3)!==0)&&(qs=!0)),n=i}Ut!==0&&Ut!==5||ki(e),Rn!==0&&(Rn=0)}function eh(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var g=31-it(r),R=1<<g,V=i[g];V===-1?((R&a)===0||(R&n)!==0)&&(i[g]=hn(R,t)):V<=t&&(e.expiredLanes|=R),r&=~R}if(t=pt,a=$e,a=Ma(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(ot===2||ot===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&se(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||Aa(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&se(n),rl(a)){case 2:case 8:a=Ve;break;case 32:a=He;break;case 268435456:a=Bt;break;default:a=He}return n=th.bind(null,e),a=me(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&se(n),e.callbackPriority=2,e.callbackNode=null,2}function th(e,t){if(Ut!==0&&Ut!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Ls()&&e.callbackNode!==a)return null;var n=$e;return n=Ma(e,e===pt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Uf(e,n,t),eh(e,je()),e.callbackNode!=null&&e.callbackNode===a?th.bind(null,e):null)}function ah(e,t){if(Ls())return null;Uf(e,t,!0)}function Sx(){Dx(function(){(lt&6)!==0?me(Re,wx):Wf()})}function lc(){if(Rn===0){var e=_l;e===0&&(e=oa,oa<<=1,(oa&261888)===0&&(oa=256)),Rn=e}return Rn}function nh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Qi(""+e)}function lh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function _x(e,t,a,n,i){if(t==="submit"&&a&&a.stateNode===i){var r=nh((i[It]||null).action),g=n.submitter;g&&(t=(t=g[It]||null)?nh(t.formAction):g.getAttribute("formAction"),t!==null&&(r=t,g=null));var R=new Pi("action","action",null,n,i);e.push({event:R,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Rn!==0){var V=g?lh(i,g):new FormData(i);jo(a,{pending:!0,data:V,method:i.method,action:r},null,V)}}else typeof r=="function"&&(R.preventDefault(),V=g?lh(i,g):new FormData(i),jo(a,{pending:!0,data:V,method:i.method,action:r},r,V))},currentTarget:i}]})}}for(var ic=0;ic<qr.length;ic++){var sc=qr[ic],jx=sc.toLowerCase(),Nx=sc[0].toUpperCase()+sc.slice(1);Ra(jx,"on"+Nx)}Ra(Du,"onAnimationEnd"),Ra(Mu,"onAnimationIteration"),Ra(Uu,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(Ym,"onTransitionRun"),Ra(Vm,"onTransitionStart"),Ra(Gm,"onTransitionCancel"),Ra(Bu,"onTransitionEnd"),qe("onMouseEnter",["mouseout","mouseover"]),qe("onMouseLeave",["mouseout","mouseover"]),qe("onPointerEnter",["pointerout","pointerover"]),qe("onPointerLeave",["pointerout","pointerover"]),Be("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Be("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Be("onBeforeInput",["compositionend","keypress","textInput","paste"]),Be("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Be("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Be("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ai="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(" "),Ex=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ai));function ih(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],i=n.event;n=n.listeners;e:{var r=void 0;if(t)for(var g=n.length-1;0<=g;g--){var R=n[g],V=R.instance,le=R.currentTarget;if(R=R.listener,V!==r&&i.isPropagationStopped())break e;r=R,i.currentTarget=le;try{r(i)}catch(pe){ts(pe)}i.currentTarget=null,r=V}else for(g=0;g<n.length;g++){if(R=n[g],V=R.instance,le=R.currentTarget,R=R.listener,V!==r&&i.isPropagationStopped())break e;r=R,i.currentTarget=le;try{r(i)}catch(pe){ts(pe)}i.currentTarget=null,r=V}}}}function Qe(e,t){var a=t[Xl];a===void 0&&(a=t[Xl]=new Set);var n=e+"__bubble";a.has(n)||(sh(t,e,2,!1),a.add(n))}function rc(e,t,a){var n=0;t&&(n|=4),sh(a,e,n,t)}var Ys="_reactListening"+Math.random().toString(36).slice(2);function oc(e){if(!e[Ys]){e[Ys]=!0,Se.forEach(function(a){a!=="selectionchange"&&(Ex.has(a)||rc(a,!1,e),rc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ys]||(t[Ys]=!0,rc("selectionchange",!1,t))}}function sh(e,t,a,n){switch(Mh(t)){case 2:var i=e0;break;case 8:i=t0;break;default:i=_c}a=i.bind(null,t,a,e),i=void 0,!Cr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function cc(e,t,a,n,i){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var g=n.tag;if(g===3||g===4){var R=n.stateNode.containerInfo;if(R===i)break;if(g===4)for(g=n.return;g!==null;){var V=g.tag;if((V===3||V===4)&&g.stateNode.containerInfo===i)return;g=g.return}for(;R!==null;){if(g=Ua(R),g===null)return;if(V=g.tag,V===5||V===6||V===26||V===27){n=r=g;continue e}R=R.parentNode}}n=n.return}uu(function(){var le=r,pe=Nr(a),be=[];e:{var ie=Lu.get(e);if(ie!==void 0){var oe=Pi,De=e;switch(e){case"keypress":if(Ji(a)===0)break e;case"keydown":case"keyup":oe=ym;break;case"focusin":De="focus",oe=Tr;break;case"focusout":De="blur",oe=Tr;break;case"beforeblur":case"afterblur":oe=Tr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":oe=hu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":oe=rm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":oe=Sm;break;case Du:case Mu:case Uu:oe=um;break;case Bu:oe=jm;break;case"scroll":case"scrollend":oe=im;break;case"wheel":oe=Em;break;case"copy":case"cut":case"paste":oe=fm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":oe=mu;break;case"toggle":case"beforetoggle":oe=km}var Le=(t&4)!==0,ft=!Le&&(e==="scroll"||e==="scrollend"),J=Le?ie!==null?ie+"Capture":null:ie;Le=[];for(var Z=le,ae;Z!==null;){var xe=Z;if(ae=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ae===null||J===null||(xe=Fl(Z,J),xe!=null&&Le.push(zi(Z,xe,ae))),ft)break;Z=Z.return}0<Le.length&&(ie=new oe(ie,De,null,a,pe),be.push({event:ie,listeners:Le}))}}if((t&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",oe=e==="mouseout"||e==="pointerout",ie&&a!==jr&&(De=a.relatedTarget||a.fromElement)&&(Ua(De)||De[Xa]))break e;if((oe||ie)&&(ie=pe.window===pe?pe:(ie=pe.ownerDocument)?ie.defaultView||ie.parentWindow:window,oe?(De=a.relatedTarget||a.toElement,oe=le,De=De?Ua(De):null,De!==null&&(ft=d(De),Le=De.tag,De!==ft||Le!==5&&Le!==27&&Le!==6)&&(De=null)):(oe=null,De=le),oe!==De)){if(Le=hu,xe="onMouseLeave",J="onMouseEnter",Z="mouse",(e==="pointerout"||e==="pointerover")&&(Le=mu,xe="onPointerLeave",J="onPointerEnter",Z="pointer"),ft=oe==null?ie:Gn(oe),ae=De==null?ie:Gn(De),ie=new Le(xe,Z+"leave",oe,a,pe),ie.target=ft,ie.relatedTarget=ae,xe=null,Ua(pe)===le&&(Le=new Le(J,Z+"enter",De,a,pe),Le.target=ae,Le.relatedTarget=ft,xe=Le),ft=xe,oe&&De)t:{for(Le=Cx,J=oe,Z=De,ae=0,xe=J;xe;xe=Le(xe))ae++;xe=0;for(var Ue=Z;Ue;Ue=Le(Ue))xe++;for(;0<ae-xe;)J=Le(J),ae--;for(;0<xe-ae;)Z=Le(Z),xe--;for(;ae--;){if(J===Z||Z!==null&&J===Z.alternate){Le=J;break t}J=Le(J),Z=Le(Z)}Le=null}else Le=null;oe!==null&&rh(be,ie,oe,Le,!1),De!==null&&ft!==null&&rh(be,ft,De,Le,!0)}}e:{if(ie=le?Gn(le):window,oe=ie.nodeName&&ie.nodeName.toLowerCase(),oe==="select"||oe==="input"&&ie.type==="file")var tt=_u;else if(wu(ie))if(ju)tt=Lm;else{tt=Um;var Me=Mm}else oe=ie.nodeName,!oe||oe.toLowerCase()!=="input"||ie.type!=="checkbox"&&ie.type!=="radio"?le&&_r(le.elementType)&&(tt=_u):tt=Bm;if(tt&&(tt=tt(e,le))){Su(be,tt,a,pe);break e}Me&&Me(e,ie,le),e==="focusout"&&le&&ie.type==="number"&&le.memoizedProps.value!=null&&Sr(ie,"number",ie.value)}switch(Me=le?Gn(le):window,e){case"focusin":(wu(Me)||Me.contentEditable==="true")&&(ml=Me,Br=le,ii=null);break;case"focusout":ii=Br=ml=null;break;case"mousedown":Lr=!0;break;case"contextmenu":case"mouseup":case"dragend":Lr=!1,Ru(be,a,pe);break;case"selectionchange":if(qm)break;case"keydown":case"keyup":Ru(be,a,pe)}var Ze;if(Or)e:{switch(e){case"compositionstart":var Je="onCompositionStart";break e;case"compositionend":Je="onCompositionEnd";break e;case"compositionupdate":Je="onCompositionUpdate";break e}Je=void 0}else pl?yu(e,a)&&(Je="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Je="onCompositionStart");Je&&(xu&&a.locale!=="ko"&&(pl||Je!=="onCompositionStart"?Je==="onCompositionEnd"&&pl&&(Ze=du()):(xn=pe,kr="value"in xn?xn.value:xn.textContent,pl=!0)),Me=Vs(le,Je),0<Me.length&&(Je=new pu(Je,e,null,a,pe),be.push({event:Je,listeners:Me}),Ze?Je.data=Ze:(Ze=vu(a),Ze!==null&&(Je.data=Ze)))),(Ze=zm?Tm(e,a):Rm(e,a))&&(Je=Vs(le,"onBeforeInput"),0<Je.length&&(Me=new pu("onBeforeInput","beforeinput",null,a,pe),be.push({event:Me,listeners:Je}),Me.data=Ze)),_x(be,e,le,a,pe)}ih(be,t)})}function zi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Vs(e,t){for(var a=t+"Capture",n=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Fl(e,a),i!=null&&n.unshift(zi(e,i,r)),i=Fl(e,t),i!=null&&n.push(zi(e,i,r))),e.tag===3)return n;e=e.return}return[]}function Cx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function rh(e,t,a,n,i){for(var r=t._reactName,g=[];a!==null&&a!==n;){var R=a,V=R.alternate,le=R.stateNode;if(R=R.tag,V!==null&&V===n)break;R!==5&&R!==26&&R!==27||le===null||(V=le,i?(le=Fl(a,r),le!=null&&g.unshift(zi(a,le,V))):i||(le=Fl(a,r),le!=null&&g.push(zi(a,le,V)))),a=a.return}g.length!==0&&e.push({event:t,listeners:g})}var kx=/\r\n?/g,Ax=/\u0000|\uFFFD/g;function oh(e){return(typeof e=="string"?e:""+e).replace(kx,`
9
- `).replace(Ax,"")}function ch(e,t){return t=oh(t),oh(e)===t}function dt(e,t,a,n,i,r){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||dl(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&dl(e,""+n);break;case"className":Qt(e,"class",n);break;case"tabIndex":Qt(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Qt(e,a,n);break;case"style":ou(e,n,r);break;case"data":if(t!=="object"){Qt(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Qi(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 r=="function"&&(a==="formAction"?(t!=="input"&&dt(e,t,"name",i.name,i,null),dt(e,t,"formEncType",i.formEncType,i,null),dt(e,t,"formMethod",i.formMethod,i,null),dt(e,t,"formTarget",i.formTarget,i,null)):(dt(e,t,"encType",i.encType,i,null),dt(e,t,"method",i.method,i,null),dt(e,t,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Qi(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=Ia);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=Qi(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Qe("beforetoggle",e),Qe("toggle",e),qt(e,"popover",n);break;case"xlinkActuate":$t(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":$t(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":$t(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":$t(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":$t(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":$t(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":$t(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":$t(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":$t(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":qt(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=nm.get(a)||a,qt(e,a,n))}}function uc(e,t,a,n,i,r){switch(a){case"style":ou(e,n,r);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(c(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(c(60));e.innerHTML=a}}break;case"children":typeof n=="string"?dl(e,n):(typeof n=="number"||typeof n=="bigint")&&dl(e,""+n);break;case"onScroll":n!=null&&Qe("scroll",e);break;case"onScrollEnd":n!=null&&Qe("scrollend",e);break;case"onClick":n!=null&&(e.onclick=Ia);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ke.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),r=e[It]||null,r=r!=null?r[a]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof n=="function")){typeof r!="function"&&r!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,i);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):qt(e,a,n)}}}function Zt(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Qe("error",e),Qe("load",e);var n=!1,i=!1,r;for(r in a)if(a.hasOwnProperty(r)){var g=a[r];if(g!=null)switch(r){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:dt(e,t,r,g,a,null)}}i&&dt(e,t,"srcSet",a.srcSet,a,null),n&&dt(e,t,"src",a.src,a,null);return;case"input":Qe("invalid",e);var R=r=g=i=null,V=null,le=null;for(n in a)if(a.hasOwnProperty(n)){var pe=a[n];if(pe!=null)switch(n){case"name":i=pe;break;case"type":g=pe;break;case"checked":V=pe;break;case"defaultChecked":le=pe;break;case"value":r=pe;break;case"defaultValue":R=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(c(137,t));break;default:dt(e,t,n,pe,a,null)}}lu(e,r,R,V,le,g,i,!1);return;case"select":Qe("invalid",e),n=g=r=null;for(i in a)if(a.hasOwnProperty(i)&&(R=a[i],R!=null))switch(i){case"value":r=R;break;case"defaultValue":g=R;break;case"multiple":n=R;default:dt(e,t,i,R,a,null)}t=r,a=g,e.multiple=!!n,t!=null?ul(e,!!n,t,!1):a!=null&&ul(e,!!n,a,!0);return;case"textarea":Qe("invalid",e),r=i=n=null;for(g in a)if(a.hasOwnProperty(g)&&(R=a[g],R!=null))switch(g){case"value":n=R;break;case"defaultValue":i=R;break;case"children":r=R;break;case"dangerouslySetInnerHTML":if(R!=null)throw Error(c(91));break;default:dt(e,t,g,R,a,null)}su(e,n,i,r);return;case"option":for(V in a)a.hasOwnProperty(V)&&(n=a[V],n!=null)&&(V==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":dt(e,t,V,n,a,null));return;case"dialog":Qe("beforetoggle",e),Qe("toggle",e),Qe("cancel",e),Qe("close",e);break;case"iframe":case"object":Qe("load",e);break;case"video":case"audio":for(n=0;n<Ai.length;n++)Qe(Ai[n],e);break;case"image":Qe("error",e),Qe("load",e);break;case"details":Qe("toggle",e);break;case"embed":case"source":case"link":Qe("error",e),Qe("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(le in a)if(a.hasOwnProperty(le)&&(n=a[le],n!=null))switch(le){case"children":case"dangerouslySetInnerHTML":throw Error(c(137,t));default:dt(e,t,le,n,a,null)}return;default:if(_r(t)){for(pe in a)a.hasOwnProperty(pe)&&(n=a[pe],n!==void 0&&uc(e,t,pe,n,a,void 0));return}}for(R in a)a.hasOwnProperty(R)&&(n=a[R],n!=null&&dt(e,t,R,n,a,null))}function zx(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,g=null,R=null,V=null,le=null,pe=null;for(oe in a){var be=a[oe];if(a.hasOwnProperty(oe)&&be!=null)switch(oe){case"checked":break;case"value":break;case"defaultValue":V=be;default:n.hasOwnProperty(oe)||dt(e,t,oe,null,n,be)}}for(var ie in n){var oe=n[ie];if(be=a[ie],n.hasOwnProperty(ie)&&(oe!=null||be!=null))switch(ie){case"type":r=oe;break;case"name":i=oe;break;case"checked":le=oe;break;case"defaultChecked":pe=oe;break;case"value":g=oe;break;case"defaultValue":R=oe;break;case"children":case"dangerouslySetInnerHTML":if(oe!=null)throw Error(c(137,t));break;default:oe!==be&&dt(e,t,ie,oe,n,be)}}wr(e,g,R,V,le,pe,r,i);return;case"select":oe=g=R=ie=null;for(r in a)if(V=a[r],a.hasOwnProperty(r)&&V!=null)switch(r){case"value":break;case"multiple":oe=V;default:n.hasOwnProperty(r)||dt(e,t,r,null,n,V)}for(i in n)if(r=n[i],V=a[i],n.hasOwnProperty(i)&&(r!=null||V!=null))switch(i){case"value":ie=r;break;case"defaultValue":R=r;break;case"multiple":g=r;default:r!==V&&dt(e,t,i,r,n,V)}t=R,a=g,n=oe,ie!=null?ul(e,!!a,ie,!1):!!n!=!!a&&(t!=null?ul(e,!!a,t,!0):ul(e,!!a,a?[]:"",!1));return;case"textarea":oe=ie=null;for(R in a)if(i=a[R],a.hasOwnProperty(R)&&i!=null&&!n.hasOwnProperty(R))switch(R){case"value":break;case"children":break;default:dt(e,t,R,null,n,i)}for(g in n)if(i=n[g],r=a[g],n.hasOwnProperty(g)&&(i!=null||r!=null))switch(g){case"value":ie=i;break;case"defaultValue":oe=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(c(91));break;default:i!==r&&dt(e,t,g,i,n,r)}iu(e,ie,oe);return;case"option":for(var De in a)ie=a[De],a.hasOwnProperty(De)&&ie!=null&&!n.hasOwnProperty(De)&&(De==="selected"?e.selected=!1:dt(e,t,De,null,n,ie));for(V in n)ie=n[V],oe=a[V],n.hasOwnProperty(V)&&ie!==oe&&(ie!=null||oe!=null)&&(V==="selected"?e.selected=ie&&typeof ie!="function"&&typeof ie!="symbol":dt(e,t,V,ie,n,oe));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 Le in a)ie=a[Le],a.hasOwnProperty(Le)&&ie!=null&&!n.hasOwnProperty(Le)&&dt(e,t,Le,null,n,ie);for(le in n)if(ie=n[le],oe=a[le],n.hasOwnProperty(le)&&ie!==oe&&(ie!=null||oe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(ie!=null)throw Error(c(137,t));break;default:dt(e,t,le,ie,n,oe)}return;default:if(_r(t)){for(var ft in a)ie=a[ft],a.hasOwnProperty(ft)&&ie!==void 0&&!n.hasOwnProperty(ft)&&uc(e,t,ft,void 0,n,ie);for(pe in n)ie=n[pe],oe=a[pe],!n.hasOwnProperty(pe)||ie===oe||ie===void 0&&oe===void 0||uc(e,t,pe,ie,n,oe);return}}for(var J in a)ie=a[J],a.hasOwnProperty(J)&&ie!=null&&!n.hasOwnProperty(J)&&dt(e,t,J,null,n,ie);for(be in n)ie=n[be],oe=a[be],!n.hasOwnProperty(be)||ie===oe||ie==null&&oe==null||dt(e,t,be,ie,n,oe)}function uh(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Tx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var i=a[n],r=i.transferSize,g=i.initiatorType,R=i.duration;if(r&&R&&uh(g)){for(g=0,R=i.responseEnd,n+=1;n<a.length;n++){var V=a[n],le=V.startTime;if(le>R)break;var pe=V.transferSize,be=V.initiatorType;pe&&uh(be)&&(V=V.responseEnd,g+=pe*(V<R?1:(R-le)/(V-le)))}if(--n,t+=8*(r+g)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var dc=null,fc=null;function Gs(e){return e.nodeType===9?e:e.ownerDocument}function dh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function fh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function hc(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var pc=null;function Rx(){var e=window.event;return e&&e.type==="popstate"?e===pc?!1:(pc=e,!0):(pc=null,!1)}var hh=typeof setTimeout=="function"?setTimeout:void 0,Ox=typeof clearTimeout=="function"?clearTimeout:void 0,ph=typeof Promise=="function"?Promise:void 0,Dx=typeof queueMicrotask=="function"?queueMicrotask:typeof ph<"u"?function(e){return ph.resolve(null).then(e).catch(Mx)}:hh;function Mx(e){setTimeout(function(){throw e})}function On(e){return e==="head"}function mh(e,t){var a=t,n=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(i),Vl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")Ti(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Ti(a);for(var r=a.firstChild;r;){var g=r.nextSibling,R=r.nodeName;r[Ta]||R==="SCRIPT"||R==="STYLE"||R==="LINK"&&r.rel.toLowerCase()==="stylesheet"||a.removeChild(r),r=g}}else a==="body"&&Ti(e.ownerDocument.body);a=i}while(a);Vl(t)}function xh(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function mc(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":mc(a),ol(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Ux(e,t,a,n){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[Ta])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=ja(e.nextSibling),e===null)break}return null}function Bx(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ja(e.nextSibling),e===null))return null;return e}function gh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=ja(e.nextSibling),e===null))return null;return e}function xc(e){return e.data==="$?"||e.data==="$~"}function gc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Lx(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function ja(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var bc=null;function bh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return ja(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function yh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function vh(e,t,a){switch(t=Gs(a),e){case"html":if(e=t.documentElement,!e)throw Error(c(452));return e;case"head":if(e=t.head,!e)throw Error(c(453));return e;case"body":if(e=t.body,!e)throw Error(c(454));return e;default:throw Error(c(451))}}function Ti(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ol(e)}var Na=new Map,wh=new Set;function Ks(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var un=I.d;I.d={f:Hx,r:qx,D:Yx,C:Vx,L:Gx,m:Kx,X:Xx,S:Zx,M:Ix};function Hx(){var e=un.f(),t=Ms();return e||t}function qx(e){var t=pn(e);t!==null&&t.tag===5&&t.type==="form"?Bd(t):un.r(e)}var Hl=typeof document>"u"?null:document;function Sh(e,t,a){var n=Hl;if(n&&typeof t=="string"&&t){var i=Yt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),wh.has(i)||(wh.add(i),e={rel:e,crossOrigin:a,href:t},n.querySelector(i)===null&&(t=n.createElement("link"),Zt(t,"link",e),te(t),n.head.appendChild(t)))}}function Yx(e){un.D(e),Sh("dns-prefetch",e,null)}function Vx(e,t){un.C(e,t),Sh("preconnect",e,t)}function Gx(e,t,a){un.L(e,t,a);var n=Hl;if(n&&e&&t){var i='link[rel="preload"][as="'+Yt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+Yt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+Yt(a.imageSizes)+'"]')):i+='[href="'+Yt(e)+'"]';var r=i;switch(t){case"style":r=ql(e);break;case"script":r=Yl(e)}Na.has(r)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Na.set(r,e),n.querySelector(i)!==null||t==="style"&&n.querySelector(Ri(r))||t==="script"&&n.querySelector(Oi(r))||(t=n.createElement("link"),Zt(t,"link",e),te(t),n.head.appendChild(t)))}}function Kx(e,t){un.m(e,t);var a=Hl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+Yt(n)+'"][href="'+Yt(e)+'"]',r=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=Yl(e)}if(!Na.has(r)&&(e=j({rel:"modulepreload",href:e},t),Na.set(r,e),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(Oi(r)))return}n=a.createElement("link"),Zt(n,"link",e),te(n),a.head.appendChild(n)}}}function Zx(e,t,a){un.S(e,t,a);var n=Hl;if(n&&e){var i=X(n).hoistableStyles,r=ql(e);t=t||"default";var g=i.get(r);if(!g){var R={loading:0,preload:null};if(g=n.querySelector(Ri(r)))R.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Na.get(r))&&yc(e,a);var V=g=n.createElement("link");te(V),Zt(V,"link",e),V._p=new Promise(function(le,pe){V.onload=le,V.onerror=pe}),V.addEventListener("load",function(){R.loading|=1}),V.addEventListener("error",function(){R.loading|=2}),R.loading|=4,Zs(g,t,n)}g={type:"stylesheet",instance:g,count:1,state:R},i.set(r,g)}}}function Xx(e,t){un.X(e,t);var a=Hl;if(a&&e){var n=X(a).hoistableScripts,i=Yl(e),r=n.get(i);r||(r=a.querySelector(Oi(i)),r||(e=j({src:e,async:!0},t),(t=Na.get(i))&&vc(e,t),r=a.createElement("script"),te(r),Zt(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function Ix(e,t){un.M(e,t);var a=Hl;if(a&&e){var n=X(a).hoistableScripts,i=Yl(e),r=n.get(i);r||(r=a.querySelector(Oi(i)),r||(e=j({src:e,async:!0,type:"module"},t),(t=Na.get(i))&&vc(e,t),r=a.createElement("script"),te(r),Zt(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function _h(e,t,a,n){var i=(i=Ce.current)?Ks(i):null;if(!i)throw Error(c(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=ql(a.href),a=X(i).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ql(a.href);var r=X(i).hoistableStyles,g=r.get(e);if(g||(i=i.ownerDocument||i,g={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,g),(r=i.querySelector(Ri(e)))&&!r._p&&(g.instance=r,g.state.loading=5),Na.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Na.set(e,a),r||Qx(i,e,a,g.state))),t&&n===null)throw Error(c(528,""));return g}if(t&&n!==null)throw Error(c(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Yl(a),a=X(i).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(c(444,e))}}function ql(e){return'href="'+Yt(e)+'"'}function Ri(e){return'link[rel="stylesheet"]['+e+"]"}function jh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Qx(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),Zt(t,"link",a),te(t),e.head.appendChild(t))}function Yl(e){return'[src="'+Yt(e)+'"]'}function Oi(e){return"script[async]"+e}function Nh(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+Yt(a.href)+'"]');if(n)return t.instance=n,te(n),n;var i=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),te(n),Zt(n,"style",i),Zs(n,a.precedence,e),t.instance=n;case"stylesheet":i=ql(a.href);var r=e.querySelector(Ri(i));if(r)return t.state.loading|=4,t.instance=r,te(r),r;n=jh(a),(i=Na.get(i))&&yc(n,i),r=(e.ownerDocument||e).createElement("link"),te(r);var g=r;return g._p=new Promise(function(R,V){g.onload=R,g.onerror=V}),Zt(r,"link",n),t.state.loading|=4,Zs(r,a.precedence,e),t.instance=r;case"script":return r=Yl(a.src),(i=e.querySelector(Oi(r)))?(t.instance=i,te(i),i):(n=a,(i=Na.get(r))&&(n=j({},a),vc(n,i)),e=e.ownerDocument||e,i=e.createElement("script"),te(i),Zt(i,"link",n),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(c(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Zs(n,a.precedence,e));return t.instance}function Zs(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,r=i,g=0;g<n.length;g++){var R=n[g];if(R.dataset.precedence===t)r=R;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function yc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function vc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Xs=null;function Eh(e,t,a){if(Xs===null){var n=new Map,i=Xs=new Map;i.set(a,n)}else i=Xs,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var r=a[i];if(!(r[Ta]||r[bt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var g=r.getAttribute(t)||"";g=e+g;var R=n.get(g);R?R.push(r):n.set(g,[r])}}return n}function Ch(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function $x(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function kh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Jx(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=ql(n.href),r=t.querySelector(Ri(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Is.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,te(r);return}r=t.ownerDocument||t,n=jh(n),(i=Na.get(i))&&yc(n,i),r=r.createElement("link"),te(r);var g=r;g._p=new Promise(function(R,V){g.onload=R,g.onerror=V}),Zt(r,"link",n),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Is.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var wc=0;function Fx(e,t){return e.stylesheets&&e.count===0&&$s(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&$s(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&wc===0&&(wc=62500*Tx());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&$s(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>wc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function Is(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)$s(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Qs=null;function $s(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Qs=new Map,t.forEach(Px,e),Qs=null,Is.call(e))}function Px(e,t){if(!(t.state.loading&4)){var a=Qs.get(e);if(a)var n=a.get(null);else{a=new Map,Qs.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var g=i[r];(g.nodeName==="LINK"||g.getAttribute("media")!=="not all")&&(a.set(g.dataset.precedence,g),n=g)}n&&a.set(null,n)}i=t.instance,g=i.getAttribute("data-precedence"),r=a.get(g)||n,r===n&&a.set(null,i),a.set(g,i),this.count++,n=Is.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Di={$$typeof:C,Provider:null,Consumer:null,_currentValue:we,_currentValue2:we,_threadCount:0};function Wx(e,t,a,n,i,r,g,R,V){this.tag=1,this.containerInfo=e,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=_t(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_t(0),this.hiddenUpdates=_t(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=g,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=V,this.incompleteTransitions=new Map}function Ah(e,t,a,n,i,r,g,R,V,le,pe,be){return e=new Wx(e,t,a,g,V,le,pe,be,R),t=1,r===!0&&(t|=24),r=da(3,null,null,t),e.current=r,r.stateNode=e,t=Wr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:a,cache:t},no(r),e}function zh(e){return e?(e=bl,e):bl}function Th(e,t,a,n,i,r){i=zh(i),n.context===null?n.context=i:n.pendingContext=i,n=Sn(t),n.payload={element:a},r=r===void 0?null:r,r!==null&&(n.callback=r),a=_n(e,n,t),a!==null&&(ra(a,e,t),fi(a,e,t))}function Rh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Sc(e,t){Rh(e,t),(e=e.alternate)&&Rh(e,t)}function Oh(e){if(e.tag===13||e.tag===31){var t=In(e,67108864);t!==null&&ra(t,e,67108864),Sc(e,67108864)}}function Dh(e){if(e.tag===13||e.tag===31){var t=xa();t=Lt(t);var a=In(e,t);a!==null&&ra(a,e,t),Sc(e,t)}}var Js=!0;function e0(e,t,a,n){var i=K.T;K.T=null;var r=I.p;try{I.p=2,_c(e,t,a,n)}finally{I.p=r,K.T=i}}function t0(e,t,a,n){var i=K.T;K.T=null;var r=I.p;try{I.p=8,_c(e,t,a,n)}finally{I.p=r,K.T=i}}function _c(e,t,a,n){if(Js){var i=jc(n);if(i===null)cc(e,t,n,Fs,a),Uh(e,n);else if(n0(i,e,t,a,n))n.stopPropagation();else if(Uh(e,n),t&4&&-1<a0.indexOf(e)){for(;i!==null;){var r=pn(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var g=wt(r.pendingLanes);if(g!==0){var R=r;for(R.pendingLanes|=2,R.entangledLanes|=2;g;){var V=1<<31-it(g);R.entanglements[1]|=V,g&=~V}qa(r),(lt&6)===0&&(Os=je()+500,ki(0))}}break;case 31:case 13:R=In(r,2),R!==null&&ra(R,r,2),Ms(),Sc(r,2)}if(r=jc(n),r===null&&cc(e,t,n,Fs,a),r===i)break;i=r}i!==null&&n.stopPropagation()}else cc(e,t,n,null,a)}}function jc(e){return e=Nr(e),Nc(e)}var Fs=null;function Nc(e){if(Fs=null,e=Ua(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=f(t),e!==null)return e;e=null}else if(a===31){if(e=p(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Fs=e,null}function Mh(e){switch(e){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(ge()){case Re:return 2;case Ve:return 8;case He:case st:return 32;case Bt:return 268435456;default:return 32}default:return 32}}var Ec=!1,Dn=null,Mn=null,Un=null,Mi=new Map,Ui=new Map,Bn=[],a0="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 Uh(e,t){switch(e){case"focusin":case"focusout":Dn=null;break;case"dragenter":case"dragleave":Mn=null;break;case"mouseover":case"mouseout":Un=null;break;case"pointerover":case"pointerout":Mi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ui.delete(t.pointerId)}}function Bi(e,t,a,n,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:r,targetContainers:[i]},t!==null&&(t=pn(t),t!==null&&Oh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function n0(e,t,a,n,i){switch(t){case"focusin":return Dn=Bi(Dn,e,t,a,n,i),!0;case"dragenter":return Mn=Bi(Mn,e,t,a,n,i),!0;case"mouseover":return Un=Bi(Un,e,t,a,n,i),!0;case"pointerover":var r=i.pointerId;return Mi.set(r,Bi(Mi.get(r)||null,e,t,a,n,i)),!0;case"gotpointercapture":return r=i.pointerId,Ui.set(r,Bi(Ui.get(r)||null,e,t,a,n,i)),!0}return!1}function Bh(e){var t=Ua(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=f(a),t!==null){e.blockedOn=t,ca(e.priority,function(){Dh(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,ca(e.priority,function(){Dh(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ps(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=jc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);jr=n,a.target.dispatchEvent(n),jr=null}else return t=pn(a),t!==null&&Oh(t),e.blockedOn=a,!1;t.shift()}return!0}function Lh(e,t,a){Ps(e)&&a.delete(t)}function l0(){Ec=!1,Dn!==null&&Ps(Dn)&&(Dn=null),Mn!==null&&Ps(Mn)&&(Mn=null),Un!==null&&Ps(Un)&&(Un=null),Mi.forEach(Lh),Ui.forEach(Lh)}function Ws(e,t){e.blockedOn===t&&(e.blockedOn=null,Ec||(Ec=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,l0)))}var er=null;function Hh(e){er!==e&&(er=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){er===e&&(er=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],i=e[t+2];if(typeof n!="function"){if(Nc(n||a)===null)continue;break}var r=pn(a);r!==null&&(e.splice(t,3),t-=3,jo(r,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function Vl(e){function t(V){return Ws(V,e)}Dn!==null&&Ws(Dn,e),Mn!==null&&Ws(Mn,e),Un!==null&&Ws(Un,e),Mi.forEach(t),Ui.forEach(t);for(var a=0;a<Bn.length;a++){var n=Bn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Bn.length&&(a=Bn[0],a.blockedOn===null);)Bh(a),a.blockedOn===null&&Bn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],r=a[n+1],g=i[It]||null;if(typeof r=="function")g||Hh(a);else if(g){var R=null;if(r&&r.hasAttribute("formAction")){if(i=r,g=r[It]||null)R=g.formAction;else if(Nc(i)!==null)continue}else R=g.action;typeof R=="function"?a[n+1]=R:(a.splice(n,3),n-=3),Hh(a)}}}function qh(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(g){return i=g})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Cc(e){this._internalRoot=e}tr.prototype.render=Cc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(c(409));var a=t.current,n=xa();Th(a,n,e,t,null,null)},tr.prototype.unmount=Cc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Th(e.current,2,null,e,null,null),Ms(),t[Xa]=null}};function tr(e){this._internalRoot=e}tr.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ii();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Bn.length&&t!==0&&t<Bn[a].priority;a++);Bn.splice(a,0,e),a===0&&Bh(e)}};var Yh=u.version;if(Yh!=="19.2.3")throw Error(c(527,Yh,"19.2.3"));I.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(c(188)):(e=Object.keys(e).join(","),Error(c(268,e)));return e=b(t),e=e!==null?k(e):null,e=e===null?null:e.stateNode,e};var i0={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:K,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ar=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ar.isDisabled&&ar.supportsFiber)try{We=ar.inject(i0),xt=ar}catch{}}return Hi.createRoot=function(e,t){if(!h(e))throw Error(c(299));var a=!1,n="",i=Id,r=Qd,g=$d;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(g=t.onRecoverableError)),t=Ah(e,1,!1,null,null,a,n,null,i,r,g,qh),e[Xa]=t.current,oc(e),new Cc(t)},Hi.hydrateRoot=function(e,t,a){if(!h(e))throw Error(c(299));var n=!1,i="",r=Id,g=Qd,R=$d,V=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(g=a.onCaughtError),a.onRecoverableError!==void 0&&(R=a.onRecoverableError),a.formState!==void 0&&(V=a.formState)),t=Ah(e,1,!0,t,a??null,n,i,V,r,g,R,qh),t.context=zh(null),a=t.current,n=xa(),n=Lt(n),i=Sn(n),i.callback=null,_n(a,i,n),a=n,t.current.lanes=a,ve(t,a),qa(t),e[Xa]=t.current,oc(e),new tr(t)},Hi.version="19.2.3",Hi}var Fh;function p0(){if(Fh)return zc.exports;Fh=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(u){console.error(u)}}return l(),zc.exports=h0(),zc.exports}var m0=p0();const x0=Fc(m0);var Ph="popstate";function g0(l={}){function u(c,h){let{pathname:d,search:f,hash:p}=c.location;return Kc("",{pathname:d,search:f,hash:p},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function o(c,h){return typeof h=="string"?h:Vi(h)}return y0(u,o,null,l)}function Nt(l,u){if(l===!1||l===null||typeof l>"u")throw new Error(u)}function Va(l,u){if(!l){typeof console<"u"&&console.warn(u);try{throw new Error(u)}catch{}}}function b0(){return Math.random().toString(36).substring(2,10)}function Wh(l,u){return{usr:l.state,key:l.key,idx:u}}function Kc(l,u,o=null,c){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof u=="string"?Kl(u):u,state:o,key:u&&u.key||c||b0()}}function Vi({pathname:l="/",search:u="",hash:o=""}){return u&&u!=="?"&&(l+=u.charAt(0)==="?"?u:"?"+u),o&&o!=="#"&&(l+=o.charAt(0)==="#"?o:"#"+o),l}function Kl(l){let u={};if(l){let o=l.indexOf("#");o>=0&&(u.hash=l.substring(o),l=l.substring(0,o));let c=l.indexOf("?");c>=0&&(u.search=l.substring(c),l=l.substring(0,c)),l&&(u.pathname=l)}return u}function y0(l,u,o,c={}){let{window:h=document.defaultView,v5Compat:d=!1}=c,f=h.history,p="POP",x=null,b=k();b==null&&(b=0,f.replaceState({...f.state,idx:b},""));function k(){return(f.state||{idx:null}).idx}function j(){p="POP";let w=k(),v=w==null?null:w-b;b=w,x&&x({action:p,location:m.location,delta:v})}function T(w,v){p="PUSH";let E=Kc(m.location,w,v);b=k()+1;let C=Wh(E,b),U=m.createHref(E);try{f.pushState(C,"",U)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;h.location.assign(U)}d&&x&&x({action:p,location:m.location,delta:1})}function S(w,v){p="REPLACE";let E=Kc(m.location,w,v);b=k();let C=Wh(E,b),U=m.createHref(E);f.replaceState(C,"",U),d&&x&&x({action:p,location:m.location,delta:0})}function N(w){return v0(w)}let m={get action(){return p},get location(){return l(h,f)},listen(w){if(x)throw new Error("A history only accepts one active listener");return h.addEventListener(Ph,j),x=w,()=>{h.removeEventListener(Ph,j),x=null}},createHref(w){return u(h,w)},createURL:N,encodeLocation(w){let v=N(w);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:T,replace:S,go(w){return f.go(w)}};return m}function v0(l,u=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),Nt(o,"No window.location.(origin|href) available to create URL");let c=typeof l=="string"?l:Vi(l);return c=c.replace(/ $/,"%20"),!u&&c.startsWith("//")&&(c=o+c),new URL(c,o)}function Sp(l,u,o="/"){return w0(l,u,o,!1)}function w0(l,u,o,c){let h=typeof u=="string"?Kl(u):u,d=fn(h.pathname||"/",o);if(d==null)return null;let f=_p(l);S0(f);let p=null;for(let x=0;p==null&&x<f.length;++x){let b=O0(d);p=T0(f[x],b,c)}return p}function _p(l,u=[],o=[],c="",h=!1){let d=(f,p,x=h,b)=>{let k={relativePath:b===void 0?f.path||"":b,caseSensitive:f.caseSensitive===!0,childrenIndex:p,route:f};if(k.relativePath.startsWith("/")){if(!k.relativePath.startsWith(c)&&x)return;Nt(k.relativePath.startsWith(c),`Absolute route path "${k.relativePath}" nested under path "${c}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),k.relativePath=k.relativePath.slice(c.length)}let j=dn([c,k.relativePath]),T=o.concat(k);f.children&&f.children.length>0&&(Nt(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),_p(f.children,u,T,j,x)),!(f.path==null&&!f.index)&&u.push({path:j,score:A0(j,f.index),routesMeta:T})};return l.forEach((f,p)=>{if(f.path===""||!f.path?.includes("?"))d(f,p);else for(let x of jp(f.path))d(f,p,!0,x)}),u}function jp(l){let u=l.split("/");if(u.length===0)return[];let[o,...c]=u,h=o.endsWith("?"),d=o.replace(/\?$/,"");if(c.length===0)return h?[d,""]:[d];let f=jp(c.join("/")),p=[];return p.push(...f.map(x=>x===""?d:[d,x].join("/"))),h&&p.push(...f),p.map(x=>l.startsWith("/")&&x===""?"/":x)}function S0(l){l.sort((u,o)=>u.score!==o.score?o.score-u.score:z0(u.routesMeta.map(c=>c.childrenIndex),o.routesMeta.map(c=>c.childrenIndex)))}var _0=/^:[\w-]+$/,j0=3,N0=2,E0=1,C0=10,k0=-2,ep=l=>l==="*";function A0(l,u){let o=l.split("/"),c=o.length;return o.some(ep)&&(c+=k0),u&&(c+=N0),o.filter(h=>!ep(h)).reduce((h,d)=>h+(_0.test(d)?j0:d===""?E0:C0),c)}function z0(l,u){return l.length===u.length&&l.slice(0,-1).every((c,h)=>c===u[h])?l[l.length-1]-u[u.length-1]:0}function T0(l,u,o=!1){let{routesMeta:c}=l,h={},d="/",f=[];for(let p=0;p<c.length;++p){let x=c[p],b=p===c.length-1,k=d==="/"?u:u.slice(d.length)||"/",j=mr({path:x.relativePath,caseSensitive:x.caseSensitive,end:b},k),T=x.route;if(!j&&b&&o&&!c[c.length-1].route.index&&(j=mr({path:x.relativePath,caseSensitive:x.caseSensitive,end:!1},k)),!j)return null;Object.assign(h,j.params),f.push({params:h,pathname:dn([d,j.pathname]),pathnameBase:B0(dn([d,j.pathnameBase])),route:T}),j.pathnameBase!=="/"&&(d=dn([d,j.pathnameBase]))}return f}function mr(l,u){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[o,c]=R0(l.path,l.caseSensitive,l.end),h=u.match(o);if(!h)return null;let d=h[0],f=d.replace(/(.)\/+$/,"$1"),p=h.slice(1);return{params:c.reduce((b,{paramName:k,isOptional:j},T)=>{if(k==="*"){let N=p[T]||"";f=d.slice(0,d.length-N.length).replace(/(.)\/+$/,"$1")}const S=p[T];return j&&!S?b[k]=void 0:b[k]=(S||"").replace(/%2F/g,"/"),b},{}),pathname:d,pathnameBase:f,pattern:l}}function R0(l,u=!1,o=!0){Va(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let c=[],h="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,p,x)=>(c.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(c.push({paramName:"*"}),h+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?h+="\\/*$":l!==""&&l!=="/"&&(h+="(?:(?=\\/|$))"),[new RegExp(h,u?void 0:"i"),c]}function O0(l){try{return l.split("/").map(u=>decodeURIComponent(u).replace(/\//g,"%2F")).join("/")}catch(u){return Va(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${u}).`),l}}function fn(l,u){if(u==="/")return l;if(!l.toLowerCase().startsWith(u.toLowerCase()))return null;let o=u.endsWith("/")?u.length-1:u.length,c=l.charAt(o);return c&&c!=="/"?null:l.slice(o)||"/"}var D0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function M0(l,u="/"){let{pathname:o,search:c="",hash:h=""}=typeof l=="string"?Kl(l):l,d;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?d=tp(o.substring(1),"/"):d=tp(o,u)):d=u,{pathname:d,search:L0(c),hash:H0(h)}}function tp(l,u){let o=u.replace(/\/+$/,"").split("/");return l.split("/").forEach(h=>{h===".."?o.length>1&&o.pop():h!=="."&&o.push(h)}),o.length>1?o.join("/"):"/"}function Dc(l,u,o,c){return`Cannot include a '${l}' character in a manually specified \`to.${u}\` field [${JSON.stringify(c)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function U0(l){return l.filter((u,o)=>o===0||u.route.path&&u.route.path.length>0)}function Np(l){let u=U0(l);return u.map((o,c)=>c===u.length-1?o.pathname:o.pathnameBase)}function Ep(l,u,o,c=!1){let h;typeof l=="string"?h=Kl(l):(h={...l},Nt(!h.pathname||!h.pathname.includes("?"),Dc("?","pathname","search",h)),Nt(!h.pathname||!h.pathname.includes("#"),Dc("#","pathname","hash",h)),Nt(!h.search||!h.search.includes("#"),Dc("#","search","hash",h)));let d=l===""||h.pathname==="",f=d?"/":h.pathname,p;if(f==null)p=o;else{let j=u.length-1;if(!c&&f.startsWith("..")){let T=f.split("/");for(;T[0]==="..";)T.shift(),j-=1;h.pathname=T.join("/")}p=j>=0?u[j]:"/"}let x=M0(h,p),b=f&&f!=="/"&&f.endsWith("/"),k=(d||f===".")&&o.endsWith("/");return!x.pathname.endsWith("/")&&(b||k)&&(x.pathname+="/"),x}var dn=l=>l.join("/").replace(/\/\/+/g,"/"),B0=l=>l.replace(/\/+$/,"").replace(/^\/*/,"/"),L0=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,H0=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,q0=class{constructor(l,u,o,c=!1){this.status=l,this.statusText=u||"",this.internal=c,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function Y0(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function V0(l){return l.map(u=>u.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Cp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function kp(l,u){let o=l;if(typeof o!="string"||!D0.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let c=o,h=!1;if(Cp)try{let d=new URL(window.location.href),f=o.startsWith("//")?new URL(d.protocol+o):new URL(o),p=fn(f.pathname,u);f.origin===d.origin&&p!=null?o=p+f.search+f.hash:h=!0}catch{Va(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:c,isExternal:h,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Ap=["POST","PUT","PATCH","DELETE"];new Set(Ap);var G0=["GET",...Ap];new Set(G0);var Zl=z.createContext(null);Zl.displayName="DataRouter";var gr=z.createContext(null);gr.displayName="DataRouterState";var K0=z.createContext(!1),zp=z.createContext({isTransitioning:!1});zp.displayName="ViewTransition";var Z0=z.createContext(new Map);Z0.displayName="Fetchers";var X0=z.createContext(null);X0.displayName="Await";var Ca=z.createContext(null);Ca.displayName="Navigation";var Ki=z.createContext(null);Ki.displayName="Location";var Ga=z.createContext({outlet:null,matches:[],isDataRoute:!1});Ga.displayName="Route";var Wc=z.createContext(null);Wc.displayName="RouteError";var Tp="REACT_ROUTER_ERROR",I0="REDIRECT",Q0="ROUTE_ERROR_RESPONSE";function $0(l){if(l.startsWith(`${Tp}:${I0}:{`))try{let u=JSON.parse(l.slice(28));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string"&&typeof u.location=="string"&&typeof u.reloadDocument=="boolean"&&typeof u.replace=="boolean")return u}catch{}}function J0(l){if(l.startsWith(`${Tp}:${Q0}:{`))try{let u=JSON.parse(l.slice(40));if(typeof u=="object"&&u&&typeof u.status=="number"&&typeof u.statusText=="string")return new q0(u.status,u.statusText,u.data)}catch{}}function F0(l,{relative:u}={}){Nt(Zi(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:c}=z.useContext(Ca),{hash:h,pathname:d,search:f}=Xi(l,{relative:u}),p=d;return o!=="/"&&(p=d==="/"?o:dn([o,d])),c.createHref({pathname:p,search:f,hash:h})}function Zi(){return z.useContext(Ki)!=null}function Yn(){return Nt(Zi(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(Ki).location}var Rp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Op(l){z.useContext(Ca).static||z.useLayoutEffect(l)}function sl(){let{isDataRoute:l}=z.useContext(Ga);return l?ug():P0()}function P0(){Nt(Zi(),"useNavigate() may be used only in the context of a <Router> component.");let l=z.useContext(Zl),{basename:u,navigator:o}=z.useContext(Ca),{matches:c}=z.useContext(Ga),{pathname:h}=Yn(),d=JSON.stringify(Np(c)),f=z.useRef(!1);return Op(()=>{f.current=!0}),z.useCallback((x,b={})=>{if(Va(f.current,Rp),!f.current)return;if(typeof x=="number"){o.go(x);return}let k=Ep(x,JSON.parse(d),h,b.relative==="path");l==null&&u!=="/"&&(k.pathname=k.pathname==="/"?u:dn([u,k.pathname])),(b.replace?o.replace:o.push)(k,b.state,b)},[u,o,d,h,l])}z.createContext(null);function Dp(){let{matches:l}=z.useContext(Ga),u=l[l.length-1];return u?u.params:{}}function Xi(l,{relative:u}={}){let{matches:o}=z.useContext(Ga),{pathname:c}=Yn(),h=JSON.stringify(Np(o));return z.useMemo(()=>Ep(l,JSON.parse(h),c,u==="path"),[l,h,c,u])}function W0(l,u){return Mp(l,u)}function Mp(l,u,o,c,h){Nt(Zi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=z.useContext(Ca),{matches:f}=z.useContext(Ga),p=f[f.length-1],x=p?p.params:{},b=p?p.pathname:"/",k=p?p.pathnameBase:"/",j=p&&p.route;{let E=j&&j.path||"";Bp(b,!j||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${b}" (under <Route path="${E}">) 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.
10
-
11
- Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let T=Yn(),S;if(u){let E=typeof u=="string"?Kl(u):u;Nt(k==="/"||E.pathname?.startsWith(k),`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 "${k}" but pathname "${E.pathname}" was given in the \`location\` prop.`),S=E}else S=T;let N=S.pathname||"/",m=N;if(k!=="/"){let E=k.replace(/^\//,"").split("/");m="/"+N.replace(/^\//,"").split("/").slice(E.length).join("/")}let w=Sp(l,{pathname:m});Va(j||w!=null,`No routes matched location "${S.pathname}${S.search}${S.hash}" `),Va(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 "${S.pathname}${S.search}${S.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 v=lg(w&&w.map(E=>Object.assign({},E,{params:Object.assign({},x,E.params),pathname:dn([k,d.encodeLocation?d.encodeLocation(E.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?k:dn([k,d.encodeLocation?d.encodeLocation(E.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),f,o,c,h);return u&&v?z.createElement(Ki.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...S},navigationType:"POP"}},v):v}function eg(){let l=cg(),u=Y0(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),o=l instanceof Error?l.stack:null,c="rgba(200,200,200, 0.5)",h={padding:"0.5rem",backgroundColor:c},d={padding:"2px 4px",backgroundColor:c},f=null;return console.error("Error handled by React Router default ErrorBoundary:",l),f=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:d},"ErrorBoundary")," or"," ",z.createElement("code",{style:d},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},u),o?z.createElement("pre",{style:h},o):null,f)}var tg=z.createElement(eg,null),Up=class extends z.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,u){return u.location!==l.location||u.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:u.error,location:u.location,revalidation:l.revalidation||u.revalidation}}componentDidCatch(l,u){this.props.onError?this.props.onError(l,u):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const o=J0(l.digest);o&&(l=o)}let u=l!==void 0?z.createElement(Ga.Provider,{value:this.props.routeContext},z.createElement(Wc.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?z.createElement(ag,{error:l},u):u}};Up.contextType=K0;var Mc=new WeakMap;function ag({children:l,error:u}){let{basename:o}=z.useContext(Ca);if(typeof u=="object"&&u&&"digest"in u&&typeof u.digest=="string"){let c=$0(u.digest);if(c){let h=Mc.get(u);if(h)throw h;let d=kp(c.location,o);if(Cp&&!Mc.get(u))if(d.isExternal||c.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:c.replace}));throw Mc.set(u,f),f}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return l}function ng({routeContext:l,match:u,children:o}){let c=z.useContext(Zl);return c&&c.static&&c.staticContext&&(u.route.errorElement||u.route.ErrorBoundary)&&(c.staticContext._deepestRenderedBoundaryId=u.route.id),z.createElement(Ga.Provider,{value:l},o)}function lg(l,u=[],o=null,c=null,h=null){if(l==null){if(!o)return null;if(o.errors)l=o.matches;else if(u.length===0&&!o.initialized&&o.matches.length>0)l=o.matches;else return null}let d=l,f=o?.errors;if(f!=null){let k=d.findIndex(j=>j.route.id&&f?.[j.route.id]!==void 0);Nt(k>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),d=d.slice(0,Math.min(d.length,k+1))}let p=!1,x=-1;if(o)for(let k=0;k<d.length;k++){let j=d[k];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(x=k),j.route.id){let{loaderData:T,errors:S}=o,N=j.route.loader&&!T.hasOwnProperty(j.route.id)&&(!S||S[j.route.id]===void 0);if(j.route.lazy||N){p=!0,x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}let b=o&&c?(k,j)=>{c(k,{location:o.location,params:o.matches?.[0]?.params??{},unstable_pattern:V0(o.matches),errorInfo:j})}:void 0;return d.reduceRight((k,j,T)=>{let S,N=!1,m=null,w=null;o&&(S=f&&j.route.id?f[j.route.id]:void 0,m=j.route.errorElement||tg,p&&(x<0&&T===0?(Bp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,w=null):x===T&&(N=!0,w=j.route.hydrateFallbackElement||null)));let v=u.concat(d.slice(0,T+1)),E=()=>{let C;return S?C=m:N?C=w:j.route.Component?C=z.createElement(j.route.Component,null):j.route.element?C=j.route.element:C=k,z.createElement(ng,{match:j,routeContext:{outlet:k,matches:v,isDataRoute:o!=null},children:C})};return o&&(j.route.ErrorBoundary||j.route.errorElement||T===0)?z.createElement(Up,{location:o.location,revalidation:o.revalidation,component:m,error:S,children:E(),routeContext:{outlet:null,matches:v,isDataRoute:!0},onError:b}):E()},null)}function eu(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ig(l){let u=z.useContext(Zl);return Nt(u,eu(l)),u}function sg(l){let u=z.useContext(gr);return Nt(u,eu(l)),u}function rg(l){let u=z.useContext(Ga);return Nt(u,eu(l)),u}function tu(l){let u=rg(l),o=u.matches[u.matches.length-1];return Nt(o.route.id,`${l} can only be used on routes that contain a unique "id"`),o.route.id}function og(){return tu("useRouteId")}function cg(){let l=z.useContext(Wc),u=sg("useRouteError"),o=tu("useRouteError");return l!==void 0?l:u.errors?.[o]}function ug(){let{router:l}=ig("useNavigate"),u=tu("useNavigate"),o=z.useRef(!1);return Op(()=>{o.current=!0}),z.useCallback(async(h,d={})=>{Va(o.current,Rp),o.current&&(typeof h=="number"?await l.navigate(h):await l.navigate(h,{fromRouteId:u,...d}))},[l,u])}var ap={};function Bp(l,u,o){!u&&!ap[l]&&(ap[l]=!0,Va(!1,o))}z.memo(dg);function dg({routes:l,future:u,state:o,onError:c}){return Mp(l,void 0,o,c,u)}function Ya(l){Nt(!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 fg({basename:l="/",children:u=null,location:o,navigationType:c="POP",navigator:h,static:d=!1,unstable_useTransitions:f}){Nt(!Zi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=l.replace(/^\/*/,"/"),x=z.useMemo(()=>({basename:p,navigator:h,static:d,unstable_useTransitions:f,future:{}}),[p,h,d,f]);typeof o=="string"&&(o=Kl(o));let{pathname:b="/",search:k="",hash:j="",state:T=null,key:S="default"}=o,N=z.useMemo(()=>{let m=fn(b,p);return m==null?null:{location:{pathname:m,search:k,hash:j,state:T,key:S},navigationType:c}},[p,b,k,j,T,S,c]);return Va(N!=null,`<Router basename="${p}"> is not able to match the URL "${b}${k}${j}" because it does not start with the basename, so the <Router> won't render anything.`),N==null?null:z.createElement(Ca.Provider,{value:x},z.createElement(Ki.Provider,{children:u,value:N}))}function hg({children:l,location:u}){return W0(Zc(l),u)}function Zc(l,u=[]){let o=[];return z.Children.forEach(l,(c,h)=>{if(!z.isValidElement(c))return;let d=[...u,h];if(c.type===z.Fragment){o.push.apply(o,Zc(c.props.children,d));return}Nt(c.type===Ya,`[${typeof c.type=="string"?c.type:c.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Nt(!c.props.index||!c.props.children,"An index route cannot have child routes.");let f={id:c.props.id||d.join("-"),caseSensitive:c.props.caseSensitive,element:c.props.element,Component:c.props.Component,index:c.props.index,path:c.props.path,middleware:c.props.middleware,loader:c.props.loader,action:c.props.action,hydrateFallbackElement:c.props.hydrateFallbackElement,HydrateFallback:c.props.HydrateFallback,errorElement:c.props.errorElement,ErrorBoundary:c.props.ErrorBoundary,hasErrorBoundary:c.props.hasErrorBoundary===!0||c.props.ErrorBoundary!=null||c.props.errorElement!=null,shouldRevalidate:c.props.shouldRevalidate,handle:c.props.handle,lazy:c.props.lazy};c.props.children&&(f.children=Zc(c.props.children,d)),o.push(f)}),o}var hr="get",pr="application/x-www-form-urlencoded";function br(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function pg(l){return br(l)&&l.tagName.toLowerCase()==="button"}function mg(l){return br(l)&&l.tagName.toLowerCase()==="form"}function xg(l){return br(l)&&l.tagName.toLowerCase()==="input"}function gg(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function bg(l,u){return l.button===0&&(!u||u==="_self")&&!gg(l)}var lr=null;function yg(){if(lr===null)try{new FormData(document.createElement("form"),0),lr=!1}catch{lr=!0}return lr}var vg=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Uc(l){return l!=null&&!vg.has(l)?(Va(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${pr}"`),null):l}function wg(l,u){let o,c,h,d,f;if(mg(l)){let p=l.getAttribute("action");c=p?fn(p,u):null,o=l.getAttribute("method")||hr,h=Uc(l.getAttribute("enctype"))||pr,d=new FormData(l)}else if(pg(l)||xg(l)&&(l.type==="submit"||l.type==="image")){let p=l.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let x=l.getAttribute("formaction")||p.getAttribute("action");if(c=x?fn(x,u):null,o=l.getAttribute("formmethod")||p.getAttribute("method")||hr,h=Uc(l.getAttribute("formenctype"))||Uc(p.getAttribute("enctype"))||pr,d=new FormData(p,l),!yg()){let{name:b,type:k,value:j}=l;if(k==="image"){let T=b?`${b}.`:"";d.append(`${T}x`,"0"),d.append(`${T}y`,"0")}else b&&d.append(b,j)}}else{if(br(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=hr,c=null,h=pr,f=l}return d&&h==="text/plain"&&(f=d,d=void 0),{action:c,method:o.toLowerCase(),encType:h,formData:d,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function au(l,u){if(l===!1||l===null||typeof l>"u")throw new Error(u)}function Sg(l,u,o,c){let h=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return o?h.pathname.endsWith("/")?h.pathname=`${h.pathname}_.${c}`:h.pathname=`${h.pathname}.${c}`:h.pathname==="/"?h.pathname=`_root.${c}`:u&&fn(h.pathname,u)==="/"?h.pathname=`${u.replace(/\/$/,"")}/_root.${c}`:h.pathname=`${h.pathname.replace(/\/$/,"")}.${c}`,h}async function _g(l,u){if(l.id in u)return u[l.id];try{let o=await import(l.module);return u[l.id]=o,o}catch(o){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function jg(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function Ng(l,u,o){let c=await Promise.all(l.map(async h=>{let d=u.routes[h.route.id];if(d){let f=await _g(d,o);return f.links?f.links():[]}return[]}));return Ag(c.flat(1).filter(jg).filter(h=>h.rel==="stylesheet"||h.rel==="preload").map(h=>h.rel==="stylesheet"?{...h,rel:"prefetch",as:"style"}:{...h,rel:"prefetch"}))}function np(l,u,o,c,h,d){let f=(x,b)=>o[b]?x.route.id!==o[b].route.id:!0,p=(x,b)=>o[b].pathname!==x.pathname||o[b].route.path?.endsWith("*")&&o[b].params["*"]!==x.params["*"];return d==="assets"?u.filter((x,b)=>f(x,b)||p(x,b)):d==="data"?u.filter((x,b)=>{let k=c.routes[x.route.id];if(!k||!k.hasLoader)return!1;if(f(x,b)||p(x,b))return!0;if(x.route.shouldRevalidate){let j=x.route.shouldRevalidate({currentUrl:new URL(h.pathname+h.search+h.hash,window.origin),currentParams:o[0]?.params||{},nextUrl:new URL(l,window.origin),nextParams:x.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function Eg(l,u,{includeHydrateFallback:o}={}){return Cg(l.map(c=>{let h=u.routes[c.route.id];if(!h)return[];let d=[h.module];return h.clientActionModule&&(d=d.concat(h.clientActionModule)),h.clientLoaderModule&&(d=d.concat(h.clientLoaderModule)),o&&h.hydrateFallbackModule&&(d=d.concat(h.hydrateFallbackModule)),h.imports&&(d=d.concat(h.imports)),d}).flat(1))}function Cg(l){return[...new Set(l)]}function kg(l){let u={},o=Object.keys(l).sort();for(let c of o)u[c]=l[c];return u}function Ag(l,u){let o=new Set;return new Set(u),l.reduce((c,h)=>{let d=JSON.stringify(kg(h));return o.has(d)||(o.add(d),c.push({key:d,link:h})),c},[])}function Lp(){let l=z.useContext(Zl);return au(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function zg(){let l=z.useContext(gr);return au(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var nu=z.createContext(void 0);nu.displayName="FrameworkContext";function Hp(){let l=z.useContext(nu);return au(l,"You must render this element inside a <HydratedRouter> element"),l}function Tg(l,u){let o=z.useContext(nu),[c,h]=z.useState(!1),[d,f]=z.useState(!1),{onFocus:p,onBlur:x,onMouseEnter:b,onMouseLeave:k,onTouchStart:j}=u,T=z.useRef(null);z.useEffect(()=>{if(l==="render"&&f(!0),l==="viewport"){let m=v=>{v.forEach(E=>{f(E.isIntersecting)})},w=new IntersectionObserver(m,{threshold:.5});return T.current&&w.observe(T.current),()=>{w.disconnect()}}},[l]),z.useEffect(()=>{if(c){let m=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(m)}}},[c]);let S=()=>{h(!0)},N=()=>{h(!1),f(!1)};return o?l!=="intent"?[d,T,{}]:[d,T,{onFocus:qi(p,S),onBlur:qi(x,N),onMouseEnter:qi(b,S),onMouseLeave:qi(k,N),onTouchStart:qi(j,S)}]:[!1,T,{}]}function qi(l,u){return o=>{l&&l(o),o.defaultPrevented||u(o)}}function Rg({page:l,...u}){let{router:o}=Lp(),c=z.useMemo(()=>Sp(o.routes,l,o.basename),[o.routes,l,o.basename]);return c?z.createElement(Dg,{page:l,matches:c,...u}):null}function Og(l){let{manifest:u,routeModules:o}=Hp(),[c,h]=z.useState([]);return z.useEffect(()=>{let d=!1;return Ng(l,u,o).then(f=>{d||h(f)}),()=>{d=!0}},[l,u,o]),c}function Dg({page:l,matches:u,...o}){let c=Yn(),{future:h,manifest:d,routeModules:f}=Hp(),{basename:p}=Lp(),{loaderData:x,matches:b}=zg(),k=z.useMemo(()=>np(l,u,b,d,c,"data"),[l,u,b,d,c]),j=z.useMemo(()=>np(l,u,b,d,c,"assets"),[l,u,b,d,c]),T=z.useMemo(()=>{if(l===c.pathname+c.search+c.hash)return[];let m=new Set,w=!1;if(u.forEach(E=>{let C=d.routes[E.route.id];!C||!C.hasLoader||(!k.some(U=>U.route.id===E.route.id)&&E.route.id in x&&f[E.route.id]?.shouldRevalidate||C.hasClientLoader?w=!0:m.add(E.route.id))}),m.size===0)return[];let v=Sg(l,p,h.unstable_trailingSlashAwareDataRequests,"data");return w&&m.size>0&&v.searchParams.set("_routes",u.filter(E=>m.has(E.route.id)).map(E=>E.route.id).join(",")),[v.pathname+v.search]},[p,h.unstable_trailingSlashAwareDataRequests,x,c,d,k,u,l,f]),S=z.useMemo(()=>Eg(j,d),[j,d]),N=Og(j);return z.createElement(z.Fragment,null,T.map(m=>z.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...o})),S.map(m=>z.createElement("link",{key:m,rel:"modulepreload",href:m,...o})),N.map(({key:m,link:w})=>z.createElement("link",{key:m,nonce:o.nonce,...w,crossOrigin:w.crossOrigin??o.crossOrigin})))}function Mg(...l){return u=>{l.forEach(o=>{typeof o=="function"?o(u):o!=null&&(o.current=u)})}}var Ug=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Ug&&(window.__reactRouterVersion="7.13.0")}catch{}function Bg({basename:l,children:u,unstable_useTransitions:o,window:c}){let h=z.useRef();h.current==null&&(h.current=g0({window:c,v5Compat:!0}));let d=h.current,[f,p]=z.useState({action:d.action,location:d.location}),x=z.useCallback(b=>{o===!1?p(b):z.startTransition(()=>p(b))},[o]);return z.useLayoutEffect(()=>d.listen(x),[d,x]),z.createElement(fg,{basename:l,children:u,location:f.location,navigationType:f.action,navigator:d,unstable_useTransitions:o})}var qp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Yp=z.forwardRef(function({onClick:u,discover:o="render",prefetch:c="none",relative:h,reloadDocument:d,replace:f,state:p,target:x,to:b,preventScrollReset:k,viewTransition:j,unstable_defaultShouldRevalidate:T,...S},N){let{basename:m,unstable_useTransitions:w}=z.useContext(Ca),v=typeof b=="string"&&qp.test(b),E=kp(b,m);b=E.to;let C=F0(b,{relative:h}),[U,M,Q]=Tg(c,S),q=Yg(b,{replace:f,state:p,target:x,preventScrollReset:k,relative:h,viewTransition:j,unstable_defaultShouldRevalidate:T,unstable_useTransitions:w});function ne(fe){u&&u(fe),fe.defaultPrevented||q(fe)}let F=z.createElement("a",{...S,...Q,href:E.absoluteURL||C,onClick:E.isExternal||d?u:ne,ref:Mg(N,M),target:x,"data-discover":!v&&o==="render"?"true":void 0});return U&&!v?z.createElement(z.Fragment,null,F,z.createElement(Rg,{page:C})):F});Yp.displayName="Link";var Lg=z.forwardRef(function({"aria-current":u="page",caseSensitive:o=!1,className:c="",end:h=!1,style:d,to:f,viewTransition:p,children:x,...b},k){let j=Xi(f,{relative:b.relative}),T=Yn(),S=z.useContext(gr),{navigator:N,basename:m}=z.useContext(Ca),w=S!=null&&Xg(j)&&p===!0,v=N.encodeLocation?N.encodeLocation(j).pathname:j.pathname,E=T.pathname,C=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;o||(E=E.toLowerCase(),C=C?C.toLowerCase():null,v=v.toLowerCase()),C&&m&&(C=fn(C,m)||C);const U=v!=="/"&&v.endsWith("/")?v.length-1:v.length;let M=E===v||!h&&E.startsWith(v)&&E.charAt(U)==="/",Q=C!=null&&(C===v||!h&&C.startsWith(v)&&C.charAt(v.length)==="/"),q={isActive:M,isPending:Q,isTransitioning:w},ne=M?u:void 0,F;typeof c=="function"?F=c(q):F=[c,M?"active":null,Q?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let fe=typeof d=="function"?d(q):d;return z.createElement(Yp,{...b,"aria-current":ne,className:F,ref:k,style:fe,to:f,viewTransition:p},typeof x=="function"?x(q):x)});Lg.displayName="NavLink";var Hg=z.forwardRef(({discover:l="render",fetcherKey:u,navigate:o,reloadDocument:c,replace:h,state:d,method:f=hr,action:p,onSubmit:x,relative:b,preventScrollReset:k,viewTransition:j,unstable_defaultShouldRevalidate:T,...S},N)=>{let{unstable_useTransitions:m}=z.useContext(Ca),w=Kg(),v=Zg(p,{relative:b}),E=f.toLowerCase()==="get"?"get":"post",C=typeof p=="string"&&qp.test(p),U=M=>{if(x&&x(M),M.defaultPrevented)return;M.preventDefault();let Q=M.nativeEvent.submitter,q=Q?.getAttribute("formmethod")||f,ne=()=>w(Q||M.currentTarget,{fetcherKey:u,method:q,navigate:o,replace:h,state:d,relative:b,preventScrollReset:k,viewTransition:j,unstable_defaultShouldRevalidate:T});m&&o!==!1?z.startTransition(()=>ne()):ne()};return z.createElement("form",{ref:N,method:E,action:v,onSubmit:c?x:U,...S,"data-discover":!C&&l==="render"?"true":void 0})});Hg.displayName="Form";function qg(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vp(l){let u=z.useContext(Zl);return Nt(u,qg(l)),u}function Yg(l,{target:u,replace:o,state:c,preventScrollReset:h,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p,unstable_useTransitions:x}={}){let b=sl(),k=Yn(),j=Xi(l,{relative:d});return z.useCallback(T=>{if(bg(T,u)){T.preventDefault();let S=o!==void 0?o:Vi(k)===Vi(j),N=()=>b(l,{replace:S,state:c,preventScrollReset:h,relative:d,viewTransition:f,unstable_defaultShouldRevalidate:p});x?z.startTransition(()=>N()):N()}},[k,b,j,o,c,u,l,h,d,f,p,x])}var Vg=0,Gg=()=>`__${String(++Vg)}__`;function Kg(){let{router:l}=Vp("useSubmit"),{basename:u}=z.useContext(Ca),o=og(),c=l.fetch,h=l.navigate;return z.useCallback(async(d,f={})=>{let{action:p,method:x,encType:b,formData:k,body:j}=wg(d,u);if(f.navigate===!1){let T=f.fetcherKey||Gg();await c(T,o,f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:k,body:j,formMethod:f.method||x,formEncType:f.encType||b,flushSync:f.flushSync})}else await h(f.action||p,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:k,body:j,formMethod:f.method||x,formEncType:f.encType||b,replace:f.replace,state:f.state,fromRouteId:o,flushSync:f.flushSync,viewTransition:f.viewTransition})},[c,h,u,o])}function Zg(l,{relative:u}={}){let{basename:o}=z.useContext(Ca),c=z.useContext(Ga);Nt(c,"useFormAction must be used inside a RouteContext");let[h]=c.matches.slice(-1),d={...Xi(l||".",{relative:u})},f=Yn();if(l==null){d.search=f.search;let p=new URLSearchParams(d.search),x=p.getAll("index");if(x.some(k=>k==="")){p.delete("index"),x.filter(j=>j).forEach(j=>p.append("index",j));let k=p.toString();d.search=k?`?${k}`:""}}return(!l||l===".")&&h.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(d.pathname=d.pathname==="/"?o:dn([o,d.pathname])),Vi(d)}function Xg(l,{relative:u}={}){let o=z.useContext(zp);Nt(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:c}=Vp("useViewTransitionState"),h=Xi(l,{relative:u});if(!o.isTransitioning)return!1;let d=fn(o.currentLocation.pathname,c)||o.currentLocation.pathname,f=fn(o.nextLocation.pathname,c)||o.nextLocation.pathname;return mr(h.pathname,f)!=null||mr(h.pathname,d)!=null}var Ig=wp();const Ne=qn.memo(({name:l,className:u="",fill:o=!1})=>s.jsx("span",{className:`material-symbols-outlined ${u}`,style:{fontVariationSettings:o?"'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24":"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},"aria-hidden":"true",children:l})),Qg=({onNavigate:l,onNewTask:u,onLogout:o,currentScreen:c})=>s.jsxs("aside",{className:"w-20 h-full border-r border-white/10 glass flex flex-col items-center py-8 shrink-0 z-50",children:[s.jsx("button",{onClick:()=>l("dashboard"),className:"mb-12 hover:opacity-80 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg","aria-label":"Go to Dashboard",children:s.jsx("img",{src:"/figranium_icon.svg",alt:"Figranium Logo",className:"w-10 h-10",onError:h=>{h.currentTarget.src="/figranium_icon.svg"}})}),s.jsxs("div",{className:"flex-1 flex flex-col gap-6",children:[s.jsx("button",{onClick:u,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-white bg-white/5 hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"New Task","aria-label":"New Task",children:s.jsx(Ne,{name:"add",className:"text-2xl"})}),s.jsx("button",{onClick:()=>l("dashboard"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="dashboard"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Dashboard","aria-label":"Dashboard",children:s.jsx(Ne,{name:"home",className:"text-2xl"})}),s.jsx("button",{onClick:()=>l("settings"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="settings"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Settings","aria-label":"Settings",children:s.jsx(Ne,{name:"settings",className:"text-2xl"})}),s.jsx("button",{onClick:()=>l("executions"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="executions"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Executions","aria-label":"Executions",children:s.jsx(Ne,{name:"history",className:"text-2xl"})}),s.jsx("button",{onClick:()=>l("captures"),className:`w-12 h-12 rounded-2xl flex items-center justify-center transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c==="captures"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Captures","aria-label":"Captures",children:s.jsx(Ne,{name:"photo_camera",className:"text-2xl"})})]}),s.jsx("button",{onClick:o,className:"w-12 h-12 rounded-2xl flex items-center justify-center text-gray-500 hover:bg-red-500/10 hover:text-red-500 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Logout","aria-label":"Logout",children:s.jsx(Ne,{name:"logout",className:"text-2xl"})})]}),$g=qn.memo(Qg),Jg=({status:l,onSubmit:u,error:o,busy:c=!1})=>{const[h,d]=z.useState(""),[f,p]=z.useState(""),[x,b]=z.useState(""),[k,j]=z.useState(""),T=N=>{N.preventDefault(),u(f,x,h,k)},S=l==="setup"?c?"Creating account...":"Create Account":c?"Authenticating...":"Authenticate";return s.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#020202] flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),s.jsxs("div",{className:"w-[400px] glass-card p-10 rounded-[48px] space-y-8 relative",children:[s.jsxs("div",{className:"text-center space-y-3",children:[s.jsx("img",{src:"/figranium_logo.svg",alt:"Figranium",className:"h-24 mx-auto object-contain"}),s.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] leading-relaxed max-w-[200px] mx-auto",children:"Deterministic Control for an Agentic World"}),l==="setup"&&s.jsx("p",{className:"text-[10px] font-bold text-accent uppercase tracking-[0.3em]",children:"Initializing System"})]}),s.jsxs("form",{onSubmit:T,className:"space-y-8",children:[s.jsxs("div",{className:"space-y-4",children:[l==="setup"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"auth-name",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Name"}),s.jsx("input",{id:"auth-name",type:"text",value:h,onChange:N=>d(N.target.value),placeholder:"Full Name",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",autoComplete:"name"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"auth-email",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Email"}),s.jsx("input",{id:"auth-email",type:"email",value:f,onChange:N=>p(N.target.value),placeholder:"user@example.com",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:"email"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"auth-pass",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Password"}),s.jsx("input",{id:"auth-pass",type:"password",value:x,onChange:N=>b(N.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:l==="setup"?"new-password":"current-password"})]}),l==="setup"&&s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{htmlFor:"auth-pass-confirm",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Confirm Password"}),s.jsx("input",{id:"auth-pass-confirm",type:"password",value:k,onChange:N=>j(N.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 text-sm focus:outline-none focus:border-white/30 transition-all placeholder:text-gray-600",required:!0,autoComplete:"new-password"})]})]}),s.jsxs("button",{type:"submit",disabled:c,"aria-busy":c,className:"shine-effect w-full bg-white text-black py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase hover:scale-[1.02] active:scale-[0.98] transition-all disabled:opacity-60 disabled:cursor-default flex items-center justify-center gap-3",children:[c&&s.jsx("div",{className:"w-4 h-4 border-2 border-black/10 border-t-black rounded-full animate-spin"}),S]}),o&&s.jsx("div",{role:"alert",className:"text-[9px] font-bold text-red-500 text-center uppercase tracking-widest",children:o})]})]})]})};function Fg(l){return l>=1e6?`${(l/1e6).toFixed(1).replace(/\.0$/,"")}m`:l>=1e3?`${(l/1e3).toFixed(1).replace(/\.0$/,"")}k`:String(l)}const Pg=({className:l})=>s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:l,"aria-hidden":"true",children:s.jsx("path",{d:"M12 2C6.477 2 2 6.477 2 12c0 4.42 2.865 8.166 6.839 9.489.5.092.682-.217.682-.482 0-.237-.008-.866-.013-1.699-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.463-1.11-1.463-.908-.62.069-.608.069-.608 1.003.07 1.531 1.03 1.531 1.03.892 1.529 2.341 1.087 2.91.831.092-.646.35-1.086.636-1.336-2.22-.253-4.555-1.11-4.555-4.943 0-1.091.39-1.984 1.029-2.683-.103-.253-.446-1.27.098-2.647 0 0 .84-.269 2.75 1.025A9.564 9.564 0 0112 6.844c.85.004 1.705.114 2.504.336 1.909-1.294 2.747-1.025 2.747-1.025.546 1.379.202 2.394.1 2.647.64.699 1.028 1.592 1.028 2.683 0 3.842-2.339 4.687-4.566 4.935.359.309.678.919.678 1.852 0 1.336-.012 2.415-.012 2.743 0 .267.18.578.688.48C19.138 20.161 22 16.418 22 12c0-5.523-4.477-10-10-10z"})});function Gp({className:l=""}){const[u,o]=z.useState("—"),c=d=>{const f=d.currentTarget.getBoundingClientRect(),p=Math.min(1,Math.max(0,(d.clientX-f.left)/f.width)),x=Math.min(1,Math.max(0,(d.clientY-f.top)/f.height));d.currentTarget.style.setProperty("--beam-x",`${(p*100).toFixed(2)}%`),d.currentTarget.style.setProperty("--beam-y",`${(x*100).toFixed(2)}%`)},h=d=>{d.currentTarget.style.setProperty("--beam-x","50%"),d.currentTarget.style.setProperty("--beam-y","50%")};return z.useEffect(()=>{let d=!0;return fetch("https://api.github.com/repos/figranium/figranium").then(f=>f.ok?f.json():null).then(f=>{!d||!f?.stargazers_count||o(Fg(Number(f.stargazers_count)))}).catch(()=>{d&&o("—")}),()=>{d=!1}},[]),s.jsxs("a",{href:"https://github.com/figranium/figranium",target:"_blank",rel:"noreferrer",onPointerMove:c,onPointerLeave:h,className:`gh-pill beam-follow inline-flex items-center gap-2 rounded-full border border-white/10 bg-white/5 px-4 py-2 text-[11px] uppercase tracking-[0.25em] text-white/70 transition hover:border-white/20 hover:bg-white/10 hover:text-white ${l}`,"aria-label":"Star Figranium on GitHub",children:[s.jsx(Pg,{className:"h-4 w-4"}),"GitHub",s.jsx("span",{className:"mx-1 h-3 w-px bg-white/20","aria-hidden":"true"}),s.jsx(Ne,{name:"star",className:"text-base",fill:!0}),u]})}const Wg=({tasks:l,onNewTask:u,onEditTask:o,onDeleteTask:c,onExportTasks:h,onImportTasks:d})=>{const f=z.useRef(null),[p,x]=qn.useState(!1),[b,k]=qn.useState([]),j=m=>{try{return m?`https://www.google.com/s2/favicons?domain=${new URL(m).hostname}&sz=64`:null}catch{return null}},T=()=>{f.current?.click()},S=m=>{const w=m.target.files?.[0];w&&d(w),m.target.value=""},N=m=>{k(w=>w.includes(m)?w.filter(v=>v!==m):[...w,m])};return s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex-1 overflow-hidden animate-in fade-in duration-500 bg-black",children:s.jsxs("div",{className:"h-full flex flex-col px-12 py-12 max-w-7xl mx-auto space-y-12 w-full",children:[s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsx("div",{className:"space-y-2",children:s.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Dashboard"})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Gp,{}),s.jsxs("button",{onClick:()=>{k([]),x(!0)},className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[s.jsx(Ne,{name:"download",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Export"]}),s.jsxs("button",{onClick:T,className:"px-4 py-3 rounded-2xl border border-white/10 text-white text-[9px] font-bold uppercase tracking-[0.3em] hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[s.jsx(Ne,{name:"upload",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Import"]}),s.jsx("button",{onClick:u,className:"shine-effect bg-white text-black px-8 py-3 rounded-2xl font-bold text-[10px] tracking-[0.2em] uppercase transition-all hover:scale-105 active:scale-95 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"+ New Task"}),s.jsx("input",{ref:f,type:"file",accept:"application/json",className:"hidden",onChange:S})]})]}),s.jsxs("div",{className:"relative flex-1 min-h-0",children:[s.jsx("div",{className:"pointer-events-none absolute top-0 left-0 right-0 h-10 bg-gradient-to-b from-[#050505] via-[#050505]/50 to-transparent z-10"}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 xl:grid-cols-3 content-start gap-6 overflow-y-auto custom-scrollbar pb-12 pr-4 h-full",children:l.map(m=>{const w=j(m.url);return s.jsxs("div",{className:"bg-[#050505] border border-white/10 p-6 rounded-2xl flex flex-col gap-6 group hover:-translate-y-1 hover:border-white/30 transition-all shadow-xl hover:bg-[#0a0a0a]",children:[s.jsxs("div",{className:"flex justify-between items-start",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden",children:w?s.jsx("img",{src:w,alt:"",className:"w-6 h-6 object-contain grayscale opacity-100 group-hover:grayscale-0 transition-all duration-300",onError:v=>{v.target.style.display="none"}}):s.jsx(Ne,{name:"public",className:"text-gray-500 text-xl"})}),s.jsx("div",{className:"px-3 py-1 rounded-lg bg-white/5 text-[7px] font-bold uppercase tracking-widest text-white/60",children:m.mode})]}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-white truncate",children:m.name||"Untitled"}),s.jsx("p",{className:"text-[10px] text-gray-600 font-mono truncate mt-1",children:m.url||"Target undefined"})]}),s.jsxs("div",{className:"flex gap-3 pt-4 border-t border-white/5",children:[s.jsx("button",{onClick:()=>o(m),className:"flex-1 py-2 rounded-lg bg-white text-black text-[9px] font-bold uppercase tracking-widest hover:scale-105 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Edit Task"}),s.jsx("button",{onClick:()=>c(m.id),className:"w-10 h-10 rounded-lg bg-transparent border border-white/10 flex items-center justify-center hover:bg-red-500/10 hover:text-red-500 hover:border-red-500/30 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Delete task",title:"Delete task",children:s.jsx(Ne,{name:"close",className:"text-base"})})]})]},m.id)})})]}),l.length===0&&s.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",children:s.jsxs("button",{onClick:u,className:"w-full max-w-[400px] bg-[#0a0a0a] border border-dashed border-white/15 rounded-2xl p-8 hover:border-white/30 hover:bg-white/[0.03] transition-all flex flex-col items-center justify-center gap-4 group cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[s.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/5 group-hover:bg-white/10 transition-all flex items-center justify-center border border-white/5",children:s.jsx(Ne,{name:"add",className:"text-3xl text-gray-500 group-hover:text-white transition-colors"})}),s.jsxs("div",{className:"text-center space-y-2",children:[s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-white/70 group-hover:text-white transition-colors",children:"Create First Task"}),s.jsx("p",{className:"text-[10px] text-gray-500 max-w-[250px] mx-auto leading-relaxed group-hover:text-gray-400 transition-colors",children:"Get started by creating your first automation task. This will open the visual editor."})]})]})})]})}),p&&s.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 pb-20 sm:pb-6",children:[s.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm",onClick:()=>x(!1)}),s.jsxs("div",{className:"relative w-full max-w-lg bg-[#0a0a0a] border border-white/10 rounded-2xl shadow-2xl overflow-hidden flex flex-col max-h-full slide-up",children:[s.jsxs("div",{className:"p-6 sm:p-8 shrink-0",children:[s.jsx("h3",{className:"text-xl font-bold text-white tracking-tight",children:"Export Tasks"}),s.jsx("p",{className:"text-[11px] text-white/50 mt-2 font-mono",children:"Select the tasks you want to export."})]}),s.jsxs("div",{className:"px-6 sm:px-8 pb-4 flex items-center gap-3 shrink-0 border-b border-white/5",children:[s.jsx("button",{onClick:()=>k(l.map(m=>m.id)),className:"text-[10px] font-bold uppercase tracking-widest text-blue-400 hover:text-blue-300 transition-colors",children:"Select All"}),s.jsx("span",{className:"text-white/20",children:"|"}),s.jsx("button",{onClick:()=>k([]),className:"text-[10px] font-bold uppercase tracking-widest text-white/40 hover:text-white/80 transition-colors",children:"Deselect All"}),s.jsx("div",{className:"flex-1"}),s.jsxs("span",{className:"text-[10px] font-mono text-white/30",children:[b.length," selected"]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 sm:p-8 space-y-2",children:l.map(m=>s.jsxs("button",{onClick:()=>N(m.id),className:`w-full text-left p-4 rounded-2xl border transition-all flex items-center gap-4 ${b.includes(m.id)?"bg-blue-500/10 border-blue-500/30":"bg-white/5 border-white/5 hover:border-white/10"}`,children:[s.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center border transition-colors ${b.includes(m.id)?"bg-blue-500 border-blue-400 text-white":"border-white/20"}`,children:b.includes(m.id)&&s.jsx(Ne,{name:"check",className:"text-[14px]"})}),s.jsxs("div",{className:"flex-1 min-w-0",children:[s.jsx("div",{className:"text-sm font-bold text-white truncate",children:m.name||"Untitled"}),s.jsx("div",{className:"text-[10px] text-white/40 font-mono truncate",children:m.url||"No URL"})]})]},m.id))}),s.jsxs("div",{className:"p-6 sm:p-8 bg-black/40 border-t border-white/5 flex gap-3 shrink-0",children:[s.jsx("button",{onClick:()=>x(!1),className:"flex-1 px-4 py-3 rounded-xl border border-white/10 text-white text-[10px] font-bold uppercase tracking-widest hover:bg-white/5 transition-all",children:"Cancel"}),s.jsxs("button",{onClick:()=>{h(b),x(!1)},disabled:b.length===0,className:`flex-1 px-4 py-3 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all ${b.length>0?"bg-white text-black hover:scale-105":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:["Export (",b.length,")"]})]})]})]})]})},lp=z.memo(Wg),zt=l=>l.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;"),eb=new Set(["const","let","var","function","return","if","else","for","while","do","switch","case","break","continue","try","catch","finally","throw","new","class","extends","super","import","from","export","default","await","async","typeof","instanceof","in","of","this"]),Kp=(l,u)=>{const o=/\{\$(\w+)\}/g;let c="",h=0,d;const f=x=>!!u&&(x in u||x==="now"),p=x=>{if(x==="now")return!0;const b=u?u[x]:void 0;return b&&b.value!==""&&b.value!==void 0&&b.value!==null};for(;(d=o.exec(l))!==null;){d.index>h&&(c+=zt(l.substring(h,d.index)));const x=d[1],b=f(x),k=p(x);c+=`<span class="${b?k?"var-highlight-default":"var-highlight":"var-highlight-undefined"}">${zt(d[0])}</span>`,h=o.lastIndex}return c+=zt(l.substring(h)),c},tb=l=>{const u=/("(?:\\.|[^"\\])*")|(-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|\b(true|false|null)\b/g;let o="",c=0,h;for(;(h=u.exec(l))!==null;){h.index>c&&(o+=zt(l.substring(c,h.index)));const d=h[0];if(h[1]){let f=!1,p=h.index+d.length;for(;p<l.length&&/\s/.test(l[p]);)p+=1;l[p]===":"&&(f=!0),o+=`<span class="${f?"code-token-key":"code-token-string"}">${zt(d)}</span>`}else h[2]?o+=`<span class="code-token-number">${zt(d)}</span>`:o+=`<span class="code-token-boolean">${zt(d)}</span>`;c=u.lastIndex}return o+=zt(l.substring(c)),o},ab=(l,u)=>{const o=/(\{\$\w+\})|(\/\/[^\n]*|\/\*[\s\S]*?\*\/)|("(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|`(?:\\.|[^`\\])*`)|(\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|(\btrue\b|\bfalse\b|\bnull\b|\bundefined\b)|(\b[A-Za-z_]\w*\b)/g;let c="",h=0,d;for(;(d=o.exec(l))!==null;){d.index>h&&(c+=zt(l.substring(h,d.index)));const f=d[0];if(d[1])c+=Kp(f,u);else if(d[2])c+=`<span class="code-token-comment">${zt(f)}</span>`;else if(d[3])c+=`<span class="code-token-string">${zt(f)}</span>`;else if(d[4])c+=`<span class="code-token-number">${zt(f)}</span>`;else if(d[5])c+=`<span class="code-token-boolean">${zt(f)}</span>`;else if(d[6]){const p=eb.has(f)?"code-token-keyword":"code-token-identifier";c+=`<span class="${p}">${zt(f)}</span>`}else c+=zt(f);h=o.lastIndex}return c+=zt(l.substring(h)),c},nb=l=>{const u=/<\/?[^>]+>/g;let o="",c=0,h;for(;(h=u.exec(l))!==null;){h.index>c&&(o+=zt(l.substring(c,h.index)));const d=h[0],f=d.match(/^<(\/?[A-Za-z0-9-]+)([\s\S]*?)>$/);if(f){const p=f[1],x=f[2];let b=zt(p);b.startsWith("/")?b=`/<span class="code-token-tag">${b.substring(1)}</span>`:b=`<span class="code-token-tag">${b}</span>`;let k=zt(x);k=k.replace(/(\s)([A-Za-z0-9-:]+)(=)/g,'$1<span class="code-token-attr">$2</span>$3'),k=k.replace(/(&quot;.*?&quot;|&#39;.*?&#39;)/g,'<span class="code-token-string">$1</span>'),o+=`<span class="code-token-punct">&lt;${b}${k}&gt;</span>`}else o+=`<span class="code-token-punct">${zt(d)}</span>`;c=u.lastIndex}return o+=zt(l.substring(c)),o},Zp=(l,u,o)=>u==="javascript"?ab(l,o):u==="json"?tb(l):u==="html"?nb(l):Kp(l,o),Ea=({value:l,onChange:u,onBlur:o,placeholder:c,variables:h,className:d,syntax:f="plain"})=>{const p=z.useRef(null);return z.useEffect(()=>{if(p.current){const x=p.current.innerHTML,b=Zp(l,f,h);if(x!==b){const k=window.getSelection();let j=0;if(k&&k.rangeCount>0){const T=k.getRangeAt(0),S=T.cloneRange();S.selectNodeContents(p.current),S.setEnd(T.endContainer,T.endOffset),j=S.toString().length}if(p.current.innerHTML=b,j>0){const T=document.createTreeWalker(p.current,NodeFilter.SHOW_TEXT);let S=0,N=T.nextNode();for(;N;){const m=N.textContent?.length||0;if(S+m>=j){const w=document.createRange();w.setStart(N,j-S),w.collapse(!0),k?.removeAllRanges(),k?.addRange(w);break}S+=m,N=T.nextNode()}}}}},[l,h]),s.jsx("div",{ref:p,contentEditable:!0,className:`rich-input-content w-full bg-transparent focus:outline-none text-white min-h-[1.5rem] ${d}`,"data-placeholder":c,onInput:x=>u(x.currentTarget.textContent||""),onBlur:x=>{const b=x.currentTarget.textContent||"";u(b),o?.(b)}})},Gi=({value:l,onChange:u,onBlur:o,language:c,placeholder:h,className:d,readOnly:f,variables:p})=>{const x=z.useRef(null),b=z.useRef(null),k=l||h||"",j=!l&&!!h,T=z.useMemo(()=>Zp(k,c,p),[k,c,p]);return z.useEffect(()=>{const S=x.current,N=b.current;if(!S||!N)return;const m=()=>{N.scrollTop=S.scrollTop,N.scrollLeft=S.scrollLeft};return S.addEventListener("scroll",m),()=>{S.removeEventListener("scroll",m)}},[]),s.jsxs("div",{className:`code-editor ${d||""}`,onWheel:S=>{const N=x.current;N&&(N.scrollHeight<=N.clientHeight||(N.scrollTop+=S.deltaY,N.scrollLeft+=S.deltaX,N.focus(),S.preventDefault()))},children:[s.jsx("pre",{ref:b,className:`code-editor-pre ${j?"code-editor-placeholder":""}`,"aria-hidden":!0,dangerouslySetInnerHTML:{__html:T}}),s.jsx("textarea",{ref:x,value:l,onChange:S=>u?.(S.target.value),onBlur:S=>o?.(S.target.value),spellCheck:!1,wrap:"off",readOnly:f,className:`code-editor-textarea ${f?"code-editor-textarea-readonly":""}`,"aria-label":"Code editor",tabIndex:f?-1:0})]})},Xc=[{type:"click",label:"Click",description:"Click an element",icon:"ads_click"},{type:"type",label:"Type",description:"Type text into a field",icon:"text_format"},{type:"hover",label:"Hover",description:"Hover an element",icon:"my_location"},{type:"press",label:"Press",description:"Press a key",icon:"keyboard"},{type:"wait",label:"Wait",description:"Pause for seconds",icon:"schedule"},{type:"wait_selector",label:"Wait for Selector",description:"Wait until element appears",icon:"schedule"},{type:"wait_downloads",label:"Wait for Downloads",description:"Wait until downloads finish",icon:"download"},{type:"scroll",label:"Scroll",description:"Scroll the page or container",icon:"swap_vert"},{type:"javascript",label:"JavaScript",description:"Run custom JS",icon:"code"},{type:"csv",label:"CSV",description:"Parse CSV into rows",icon:"table_chart"},{type:"merge",label:"Merge",description:"Merge inputs into a single output",icon:"layers"},{type:"screenshot",label:"Screenshot",description:"Capture a screenshot",icon:"photo_camera"},{type:"navigate",label:"Navigate To",description:"Navigate to a URL",icon:"navigation"},{type:"if",label:"If",description:"Conditional block start",icon:"call_split"},{type:"else",label:"Else",description:"Conditional alternate path",icon:"call_split"},{type:"end",label:"End Block",description:"Close a block",icon:"subdirectory_arrow_right"},{type:"while",label:"While",description:"Loop while condition true",icon:"repeat"},{type:"repeat",label:"Repeat N",description:"Repeat block N times",icon:"repeat"},{type:"foreach",label:"For Each",description:"Loop through items",icon:"list"},{type:"set",label:"Set Variable",description:"Update variable value",icon:"data_object"},{type:"stop",label:"Stop Task",description:"Stop task with status",icon:"stop"},{type:"on_error",label:"On Error",description:"Run on failure",icon:"warning"},{type:"start",label:"Start Task",description:"Run another task",icon:"play_circle"}],lb=({open:l,query:u,onQueryChange:o,onClose:c,onSelect:h})=>{const d=z.useRef(null),f=z.useMemo(()=>{const p=u.trim().toLowerCase();return p?Xc.filter(x=>x.label.toLowerCase().includes(p)||x.description.toLowerCase().includes(p)):Xc},[u]);return l?s.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:c,children:s.jsxs("div",{className:"glass-card w-full max-w-xl rounded-[28px] border border-white/10 p-6 shadow-2xl",onClick:p=>p.stopPropagation(),children:[s.jsxs("div",{className:"flex items-center justify-between mb-4",children:[s.jsxs("div",{children:[s.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"Add Block"}),s.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Search actions and control flow blocks."})]}),s.jsx("button",{onClick:c,className:"p-2 rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all","aria-label":"Close",children:s.jsx(Ne,{name:"close",className:"text-base"})})]}),s.jsx("input",{ref:p=>{d.current=p,p&&p.focus()},value:u,onChange:p=>o(p.target.value),placeholder:"Type to filter (e.g., if, click, loop)",className:"w-full rounded-xl bg-black/40 border border-white/10 px-4 py-3 text-sm text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30"}),s.jsxs("div",{className:"mt-4 max-h-[400px] overflow-y-auto custom-scrollbar pr-2",children:[s.jsx("div",{className:"grid grid-cols-2 gap-3 pb-2",children:f.map(p=>s.jsxs("button",{onClick:()=>h(p.type),className:"flex flex-col items-start gap-2 text-left p-4 rounded-2xl border border-white/5 bg-white/[0.02] hover:bg-white/[0.08] hover:border-white/20 transition-all hover:scale-[1.02] active:scale-95 group focus:outline-none focus:ring-2 focus:ring-blue-500/50",children:[s.jsx(Ne,{name:p.icon||"extension",className:"text-2xl text-white/80 group-hover:text-white transition-colors shrink-0 mb-1"}),s.jsxs("div",{children:[s.jsx("div",{className:"text-[11px] font-bold uppercase tracking-widest text-white/90 group-hover:text-white mb-1",children:p.label}),s.jsx("div",{className:"text-[10px] text-gray-500 line-clamp-2 leading-relaxed",children:p.description})]})]},p.type))}),f.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No matches."})]})]})}):null};function Ic(){return Ic=Object.assign?Object.assign.bind():function(l){for(var u=1;u<arguments.length;u++){var o=arguments[u];for(var c in o)({}).hasOwnProperty.call(o,c)&&(l[c]=o[c])}return l},Ic.apply(null,arguments)}function ip(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function Qc(l,u){return Qc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(o,c){return o.__proto__=c,o},Qc(l,u)}function ib(l,u){l.prototype=Object.create(u.prototype),l.prototype.constructor=l,Qc(l,u)}var sp=Number.isNaN||function(u){return typeof u=="number"&&u!==u};function sb(l,u){return!!(l===u||sp(l)&&sp(u))}function rb(l,u){if(l.length!==u.length)return!1;for(var o=0;o<l.length;o++)if(!sb(l[o],u[o]))return!1;return!0}function Bc(l,u){u===void 0&&(u=rb);var o,c=[],h,d=!1;function f(){for(var p=[],x=0;x<arguments.length;x++)p[x]=arguments[x];return d&&o===this&&u(p,c)||(h=l.apply(this,p),d=!0,o=this,c=p),h}return f}var ob=typeof performance=="object"&&typeof performance.now=="function",rp=ob?function(){return performance.now()}:function(){return Date.now()};function op(l){cancelAnimationFrame(l.id)}function cb(l,u){var o=rp();function c(){rp()-o>=u?l.call(null):h.id=requestAnimationFrame(c)}var h={id:requestAnimationFrame(c)};return h}var Lc=-1;function cp(l){if(l===void 0&&(l=!1),Lc===-1||l){var u=document.createElement("div"),o=u.style;o.width="50px",o.height="50px",o.overflow="scroll",document.body.appendChild(u),Lc=u.offsetWidth-u.clientWidth,document.body.removeChild(u)}return Lc}var Gl=null;function up(l){if(l===void 0&&(l=!1),Gl===null||l){var u=document.createElement("div"),o=u.style;o.width="50px",o.height="50px",o.overflow="scroll",o.direction="rtl";var c=document.createElement("div"),h=c.style;return h.width="100px",h.height="100px",u.appendChild(c),document.body.appendChild(u),u.scrollLeft>0?Gl="positive-descending":(u.scrollLeft=1,u.scrollLeft===0?Gl="negative":Gl="positive-ascending"),document.body.removeChild(u),Gl}return Gl}var ub=150,db=function(u,o){return u};function fb(l){var u,o=l.getItemOffset,c=l.getEstimatedTotalSize,h=l.getItemSize,d=l.getOffsetForIndexAndAlignment,f=l.getStartIndexForOffset,p=l.getStopIndexForStartIndex,x=l.initInstanceProps,b=l.shouldResetStyleCacheOnItemSizeChange,k=l.validateProps;return u=(function(j){ib(T,j);function T(N){var m;return m=j.call(this,N)||this,m._instanceProps=x(m.props,ip(m)),m._outerRef=void 0,m._resetIsScrollingTimeoutId=null,m.state={instance:ip(m),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof m.props.initialScrollOffset=="number"?m.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},m._callOnItemsRendered=void 0,m._callOnItemsRendered=Bc(function(w,v,E,C){return m.props.onItemsRendered({overscanStartIndex:w,overscanStopIndex:v,visibleStartIndex:E,visibleStopIndex:C})}),m._callOnScroll=void 0,m._callOnScroll=Bc(function(w,v,E){return m.props.onScroll({scrollDirection:w,scrollOffset:v,scrollUpdateWasRequested:E})}),m._getItemStyle=void 0,m._getItemStyle=function(w){var v=m.props,E=v.direction,C=v.itemSize,U=v.layout,M=m._getItemStyleCache(b&&C,b&&U,b&&E),Q;if(M.hasOwnProperty(w))Q=M[w];else{var q=o(m.props,w,m._instanceProps),ne=h(m.props,w,m._instanceProps),F=E==="horizontal"||U==="horizontal",fe=E==="rtl",ue=F?q:0;M[w]=Q={position:"absolute",left:fe?void 0:ue,right:fe?ue:void 0,top:F?0:q,height:F?"100%":ne,width:F?ne:"100%"}}return Q},m._getItemStyleCache=void 0,m._getItemStyleCache=Bc(function(w,v,E){return{}}),m._onScrollHorizontal=function(w){var v=w.currentTarget,E=v.clientWidth,C=v.scrollLeft,U=v.scrollWidth;m.setState(function(M){if(M.scrollOffset===C)return null;var Q=m.props.direction,q=C;if(Q==="rtl")switch(up()){case"negative":q=-C;break;case"positive-descending":q=U-E-C;break}return q=Math.max(0,Math.min(q,U-E)),{isScrolling:!0,scrollDirection:M.scrollOffset<q?"forward":"backward",scrollOffset:q,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._onScrollVertical=function(w){var v=w.currentTarget,E=v.clientHeight,C=v.scrollHeight,U=v.scrollTop;m.setState(function(M){if(M.scrollOffset===U)return null;var Q=Math.max(0,Math.min(U,C-E));return{isScrolling:!0,scrollDirection:M.scrollOffset<Q?"forward":"backward",scrollOffset:Q,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._outerRefSetter=function(w){var v=m.props.outerRef;m._outerRef=w,typeof v=="function"?v(w):v!=null&&typeof v=="object"&&v.hasOwnProperty("current")&&(v.current=w)},m._resetIsScrollingDebounced=function(){m._resetIsScrollingTimeoutId!==null&&op(m._resetIsScrollingTimeoutId),m._resetIsScrollingTimeoutId=cb(m._resetIsScrolling,ub)},m._resetIsScrolling=function(){m._resetIsScrollingTimeoutId=null,m.setState({isScrolling:!1},function(){m._getItemStyleCache(-1,null)})},m}T.getDerivedStateFromProps=function(m,w){return hb(m,w),k(m),null};var S=T.prototype;return S.scrollTo=function(m){m=Math.max(0,m),this.setState(function(w){return w.scrollOffset===m?null:{scrollDirection:w.scrollOffset<m?"forward":"backward",scrollOffset:m,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},S.scrollToItem=function(m,w){w===void 0&&(w="auto");var v=this.props,E=v.itemCount,C=v.layout,U=this.state.scrollOffset;m=Math.max(0,Math.min(m,E-1));var M=0;if(this._outerRef){var Q=this._outerRef;C==="vertical"?M=Q.scrollWidth>Q.clientWidth?cp():0:M=Q.scrollHeight>Q.clientHeight?cp():0}this.scrollTo(d(this.props,m,w,U,this._instanceProps,M))},S.componentDidMount=function(){var m=this.props,w=m.direction,v=m.initialScrollOffset,E=m.layout;if(typeof v=="number"&&this._outerRef!=null){var C=this._outerRef;w==="horizontal"||E==="horizontal"?C.scrollLeft=v:C.scrollTop=v}this._callPropsCallbacks()},S.componentDidUpdate=function(){var m=this.props,w=m.direction,v=m.layout,E=this.state,C=E.scrollOffset,U=E.scrollUpdateWasRequested;if(U&&this._outerRef!=null){var M=this._outerRef;if(w==="horizontal"||v==="horizontal")if(w==="rtl")switch(up()){case"negative":M.scrollLeft=-C;break;case"positive-ascending":M.scrollLeft=C;break;default:var Q=M.clientWidth,q=M.scrollWidth;M.scrollLeft=q-Q-C;break}else M.scrollLeft=C;else M.scrollTop=C}this._callPropsCallbacks()},S.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&op(this._resetIsScrollingTimeoutId)},S.render=function(){var m=this.props,w=m.children,v=m.className,E=m.direction,C=m.height,U=m.innerRef,M=m.innerElementType,Q=m.innerTagName,q=m.itemCount,ne=m.itemData,F=m.itemKey,fe=F===void 0?db:F,ue=m.layout,B=m.outerElementType,H=m.outerTagName,_=m.style,ee=m.useIsScrolling,K=m.width,I=this.state.isScrolling,we=E==="horizontal"||ue==="horizontal",G=we?this._onScrollHorizontal:this._onScrollVertical,he=this._getRangeToRender(),A=he[0],O=he[1],P=[];if(q>0)for(var W=A;W<=O;W++)P.push(z.createElement(w,{data:ne,key:fe(W,ne),index:W,isScrolling:ee?I:void 0,style:this._getItemStyle(W)}));var ce=c(this.props,this._instanceProps);return z.createElement(B||H||"div",{className:v,onScroll:G,ref:this._outerRefSetter,style:Ic({position:"relative",height:C,width:K,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:E},_)},z.createElement(M||Q||"div",{children:P,ref:U,style:{height:we?"100%":ce,pointerEvents:I?"none":void 0,width:we?ce:"100%"}}))},S._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var m=this.props.itemCount;if(m>0){var w=this._getRangeToRender(),v=w[0],E=w[1],C=w[2],U=w[3];this._callOnItemsRendered(v,E,C,U)}}if(typeof this.props.onScroll=="function"){var M=this.state,Q=M.scrollDirection,q=M.scrollOffset,ne=M.scrollUpdateWasRequested;this._callOnScroll(Q,q,ne)}},S._getRangeToRender=function(){var m=this.props,w=m.itemCount,v=m.overscanCount,E=this.state,C=E.isScrolling,U=E.scrollDirection,M=E.scrollOffset;if(w===0)return[0,0,0,0];var Q=f(this.props,M,this._instanceProps),q=p(this.props,Q,M,this._instanceProps),ne=!C||U==="backward"?Math.max(1,v):1,F=!C||U==="forward"?Math.max(1,v):1;return[Math.max(0,Q-ne),Math.max(0,Math.min(w-1,q+F)),Q,q]},T})(z.PureComponent),u.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},u}var hb=function(u,o){u.children,u.direction,u.height,u.layout,u.innerTagName,u.outerTagName,u.width,o.instance},yr=fb({getItemOffset:function(u,o){var c=u.itemSize;return o*c},getItemSize:function(u,o){var c=u.itemSize;return c},getEstimatedTotalSize:function(u){var o=u.itemCount,c=u.itemSize;return c*o},getOffsetForIndexAndAlignment:function(u,o,c,h,d,f){var p=u.direction,x=u.height,b=u.itemCount,k=u.itemSize,j=u.layout,T=u.width,S=p==="horizontal"||j==="horizontal",N=S?T:x,m=Math.max(0,b*k-N),w=Math.min(m,o*k),v=Math.max(0,o*k-N+k+f);switch(c==="smart"&&(h>=v-N&&h<=w+N?c="auto":c="center"),c){case"start":return w;case"end":return v;case"center":{var E=Math.round(v+(w-v)/2);return E<Math.ceil(N/2)?0:E>m+Math.floor(N/2)?m:E}default:return h>=v&&h<=w?h:h<v?v:w}},getStartIndexForOffset:function(u,o){var c=u.itemCount,h=u.itemSize;return Math.max(0,Math.min(c-1,Math.floor(o/h)))},getStopIndexForStartIndex:function(u,o,c){var h=u.direction,d=u.height,f=u.itemCount,p=u.itemSize,x=u.layout,b=u.width,k=h==="horizontal"||x==="horizontal",j=o*p,T=k?b:d,S=Math.ceil((T+c-j)/p);return Math.max(0,Math.min(f-1,o+S-1))},initInstanceProps:function(u){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(u){u.itemSize}});const pb=async l=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(l),!0;{const u=document.createElement("textarea");u.value=l,u.style.position="fixed",u.style.left="-999999px",u.style.top="-999999px",document.body.appendChild(u),u.focus(),u.select();const o=document.execCommand("copy");return u.remove(),o}}catch(u){return console.error("Copy failed:",u),!1}},Xp=({text:l,label:u,className:o,iconClassName:c,onCopy:h,title:d,disabled:f=!1})=>{const[p,x]=z.useState(!1),b=async S=>{if(S.stopPropagation(),f)return;await pb(l)&&(x(!0),h?.(),setTimeout(()=>x(!1),2e3))},j=o||"flex items-center gap-2 px-3 py-2 rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all text-[9px] font-bold uppercase tracking-widest disabled:opacity-50 disabled:cursor-not-allowed",T=p?j.replace("border-white/10","border-green-400 text-green-400"):j;return s.jsxs("button",{onClick:b,disabled:f,className:T,title:d||(p?"Copied":"Copy"),type:"button","aria-label":u||d||"Copy to clipboard",children:[p?s.jsx(Ne,{name:"check",className:`${c||"text-sm"} text-green-400`}):s.jsx(Ne,{name:"content_copy",className:c||"text-sm"}),u&&s.jsx("span",{children:p?"Copied":u})]})},mb=(l,u=2)=>{if(l===0)return"0 B";const o=1024,c=u<0?0:u,h=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],d=Math.floor(Math.log(l)/Math.log(o));return parseFloat((l/Math.pow(o,d)).toFixed(c))+" "+h[d]},xb=({capture:l,onDelete:u})=>{const o=new URL(l.url,window.location.origin).toString();return s.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.02] overflow-hidden",children:[s.jsxs("div",{className:"p-3 border-b border-white/10 flex items-center justify-between",children:[s.jsx("div",{className:"text-[9px] font-bold text-white uppercase tracking-widest",children:l.type==="recording"?"Recording":"Screenshot"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx(Xp,{text:o,title:"Copy URL",className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all",iconClassName:"text-sm"}),s.jsx("a",{href:l.url,target:"_blank",rel:"noreferrer",className:"text-[9px] font-bold uppercase tracking-widest text-blue-300 hover:text-blue-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Open"}),u&&s.jsx("button",{onClick:()=>u(l.name),className:"text-[9px] font-bold uppercase tracking-widest text-red-300 hover:text-red-200 rounded focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Delete"})]})]}),s.jsx("div",{className:"bg-black relative group",children:l.type==="recording"?s.jsx("video",{src:l.url,controls:!0,className:"w-full h-64 object-contain bg-black"}):s.jsx("img",{src:l.url,className:"w-full h-64 object-contain bg-black",alt:`Screenshot of ${l.name}`})}),s.jsxs("div",{className:"p-3 border-t border-white/5 bg-white/[0.01]",children:[s.jsx("div",{className:"text-[9px] text-white font-bold uppercase tracking-widest truncate",title:l.name,children:l.name}),s.jsxs("div",{className:"flex items-center justify-between mt-1 text-[8px] text-gray-500 uppercase tracking-widest",children:[s.jsx("span",{children:mb(l.size)}),s.jsx("span",{children:new Date(l.modified).toLocaleDateString()})]})]})]})},Ip=qn.memo(xb);function ir(l){throw new Error('Could not dynamically require "'+l+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Hc={exports:{}};var dp;function gb(){return dp||(dp=1,(function(l,u){(function(o){l.exports=o()})(function(){return(function o(c,h,d){function f(b,k){if(!h[b]){if(!c[b]){var j=typeof ir=="function"&&ir;if(!k&&j)return j(b,!0);if(p)return p(b,!0);var T=new Error("Cannot find module '"+b+"'");throw T.code="MODULE_NOT_FOUND",T}var S=h[b]={exports:{}};c[b][0].call(S.exports,function(N){var m=c[b][1][N];return f(m||N)},S,S.exports,o,c,h,d)}return h[b].exports}for(var p=typeof ir=="function"&&ir,x=0;x<d.length;x++)f(d[x]);return f})({1:[function(o,c,h){var d=o("./utils"),f=o("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";h.encode=function(x){for(var b,k,j,T,S,N,m,w=[],v=0,E=x.length,C=E,U=d.getTypeOf(x)!=="string";v<x.length;)C=E-v,j=U?(b=x[v++],k=v<E?x[v++]:0,v<E?x[v++]:0):(b=x.charCodeAt(v++),k=v<E?x.charCodeAt(v++):0,v<E?x.charCodeAt(v++):0),T=b>>2,S=(3&b)<<4|k>>4,N=1<C?(15&k)<<2|j>>6:64,m=2<C?63&j:64,w.push(p.charAt(T)+p.charAt(S)+p.charAt(N)+p.charAt(m));return w.join("")},h.decode=function(x){var b,k,j,T,S,N,m=0,w=0,v="data:";if(x.substr(0,v.length)===v)throw new Error("Invalid base64 input, it looks like a data url.");var E,C=3*(x=x.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(x.charAt(x.length-1)===p.charAt(64)&&C--,x.charAt(x.length-2)===p.charAt(64)&&C--,C%1!=0)throw new Error("Invalid base64 input, bad content length.");for(E=f.uint8array?new Uint8Array(0|C):new Array(0|C);m<x.length;)b=p.indexOf(x.charAt(m++))<<2|(T=p.indexOf(x.charAt(m++)))>>4,k=(15&T)<<4|(S=p.indexOf(x.charAt(m++)))>>2,j=(3&S)<<6|(N=p.indexOf(x.charAt(m++))),E[w++]=b,S!==64&&(E[w++]=k),N!==64&&(E[w++]=j);return E}},{"./support":30,"./utils":32}],2:[function(o,c,h){var d=o("./external"),f=o("./stream/DataWorker"),p=o("./stream/Crc32Probe"),x=o("./stream/DataLengthProbe");function b(k,j,T,S,N){this.compressedSize=k,this.uncompressedSize=j,this.crc32=T,this.compression=S,this.compressedContent=N}b.prototype={getContentWorker:function(){var k=new f(d.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new x("data_length")),j=this;return k.on("end",function(){if(this.streamInfo.data_length!==j.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),k},getCompressedWorker:function(){return new f(d.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},b.createWorkerFrom=function(k,j,T){return k.pipe(new p).pipe(new x("uncompressedSize")).pipe(j.compressWorker(T)).pipe(new x("compressedSize")).withStreamInfo("compression",j)},c.exports=b},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,c,h){var d=o("./stream/GenericWorker");h.STORE={magic:"\0\0",compressWorker:function(){return new d("STORE compression")},uncompressWorker:function(){return new d("STORE decompression")}},h.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,c,h){var d=o("./utils"),f=(function(){for(var p,x=[],b=0;b<256;b++){p=b;for(var k=0;k<8;k++)p=1&p?3988292384^p>>>1:p>>>1;x[b]=p}return x})();c.exports=function(p,x){return p!==void 0&&p.length?d.getTypeOf(p)!=="string"?(function(b,k,j,T){var S=f,N=T+j;b^=-1;for(var m=T;m<N;m++)b=b>>>8^S[255&(b^k[m])];return-1^b})(0|x,p,p.length,0):(function(b,k,j,T){var S=f,N=T+j;b^=-1;for(var m=T;m<N;m++)b=b>>>8^S[255&(b^k.charCodeAt(m))];return-1^b})(0|x,p,p.length,0):0}},{"./utils":32}],5:[function(o,c,h){h.base64=!1,h.binary=!1,h.dir=!1,h.createFolders=!0,h.date=null,h.compression=null,h.compressionOptions=null,h.comment=null,h.unixPermissions=null,h.dosPermissions=null},{}],6:[function(o,c,h){var d=null;d=typeof Promise<"u"?Promise:o("lie"),c.exports={Promise:d}},{lie:37}],7:[function(o,c,h){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",f=o("pako"),p=o("./utils"),x=o("./stream/GenericWorker"),b=d?"uint8array":"array";function k(j,T){x.call(this,"FlateWorker/"+j),this._pako=null,this._pakoAction=j,this._pakoOptions=T,this.meta={}}h.magic="\b\0",p.inherits(k,x),k.prototype.processChunk=function(j){this.meta=j.meta,this._pako===null&&this._createPako(),this._pako.push(p.transformTo(b,j.data),!1)},k.prototype.flush=function(){x.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},k.prototype.cleanUp=function(){x.prototype.cleanUp.call(this),this._pako=null},k.prototype._createPako=function(){this._pako=new f[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var j=this;this._pako.onData=function(T){j.push({data:T,meta:j.meta})}},h.compressWorker=function(j){return new k("Deflate",j)},h.uncompressWorker=function(){return new k("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(o,c,h){function d(S,N){var m,w="";for(m=0;m<N;m++)w+=String.fromCharCode(255&S),S>>>=8;return w}function f(S,N,m,w,v,E){var C,U,M=S.file,Q=S.compression,q=E!==b.utf8encode,ne=p.transformTo("string",E(M.name)),F=p.transformTo("string",b.utf8encode(M.name)),fe=M.comment,ue=p.transformTo("string",E(fe)),B=p.transformTo("string",b.utf8encode(fe)),H=F.length!==M.name.length,_=B.length!==fe.length,ee="",K="",I="",we=M.dir,G=M.date,he={crc32:0,compressedSize:0,uncompressedSize:0};N&&!m||(he.crc32=S.crc32,he.compressedSize=S.compressedSize,he.uncompressedSize=S.uncompressedSize);var A=0;N&&(A|=8),q||!H&&!_||(A|=2048);var O=0,P=0;we&&(O|=16),v==="UNIX"?(P=798,O|=(function(ce,Ce){var Oe=ce;return ce||(Oe=Ce?16893:33204),(65535&Oe)<<16})(M.unixPermissions,we)):(P=20,O|=(function(ce){return 63&(ce||0)})(M.dosPermissions)),C=G.getUTCHours(),C<<=6,C|=G.getUTCMinutes(),C<<=5,C|=G.getUTCSeconds()/2,U=G.getUTCFullYear()-1980,U<<=4,U|=G.getUTCMonth()+1,U<<=5,U|=G.getUTCDate(),H&&(K=d(1,1)+d(k(ne),4)+F,ee+="up"+d(K.length,2)+K),_&&(I=d(1,1)+d(k(ue),4)+B,ee+="uc"+d(I.length,2)+I);var W="";return W+=`
12
- \0`,W+=d(A,2),W+=Q.magic,W+=d(C,2),W+=d(U,2),W+=d(he.crc32,4),W+=d(he.compressedSize,4),W+=d(he.uncompressedSize,4),W+=d(ne.length,2),W+=d(ee.length,2),{fileRecord:j.LOCAL_FILE_HEADER+W+ne+ee,dirRecord:j.CENTRAL_FILE_HEADER+d(P,2)+W+d(ue.length,2)+"\0\0\0\0"+d(O,4)+d(w,4)+ne+ee+ue}}var p=o("../utils"),x=o("../stream/GenericWorker"),b=o("../utf8"),k=o("../crc32"),j=o("../signature");function T(S,N,m,w){x.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=N,this.zipPlatform=m,this.encodeFileName=w,this.streamFiles=S,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}p.inherits(T,x),T.prototype.push=function(S){var N=S.meta.percent||0,m=this.entriesCount,w=this._sources.length;this.accumulate?this.contentBuffer.push(S):(this.bytesWritten+=S.data.length,x.prototype.push.call(this,{data:S.data,meta:{currentFile:this.currentFile,percent:m?(N+100*(m-w-1))/m:100}}))},T.prototype.openedSource=function(S){this.currentSourceOffset=this.bytesWritten,this.currentFile=S.file.name;var N=this.streamFiles&&!S.file.dir;if(N){var m=f(S,N,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},T.prototype.closedSource=function(S){this.accumulate=!1;var N=this.streamFiles&&!S.file.dir,m=f(S,N,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),N)this.push({data:(function(w){return j.DATA_DESCRIPTOR+d(w.crc32,4)+d(w.compressedSize,4)+d(w.uncompressedSize,4)})(S),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},T.prototype.flush=function(){for(var S=this.bytesWritten,N=0;N<this.dirRecords.length;N++)this.push({data:this.dirRecords[N],meta:{percent:100}});var m=this.bytesWritten-S,w=(function(v,E,C,U,M){var Q=p.transformTo("string",M(U));return j.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(v,2)+d(v,2)+d(E,4)+d(C,4)+d(Q.length,2)+Q})(this.dirRecords.length,m,S,this.zipComment,this.encodeFileName);this.push({data:w,meta:{percent:100}})},T.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},T.prototype.registerPrevious=function(S){this._sources.push(S);var N=this;return S.on("data",function(m){N.processChunk(m)}),S.on("end",function(){N.closedSource(N.previous.streamInfo),N._sources.length?N.prepareNextSource():N.end()}),S.on("error",function(m){N.error(m)}),this},T.prototype.resume=function(){return!!x.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},T.prototype.error=function(S){var N=this._sources;if(!x.prototype.error.call(this,S))return!1;for(var m=0;m<N.length;m++)try{N[m].error(S)}catch{}return!0},T.prototype.lock=function(){x.prototype.lock.call(this);for(var S=this._sources,N=0;N<S.length;N++)S[N].lock()},c.exports=T},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,c,h){var d=o("../compressions"),f=o("./ZipFileWorker");h.generateWorker=function(p,x,b){var k=new f(x.streamFiles,b,x.platform,x.encodeFileName),j=0;try{p.forEach(function(T,S){j++;var N=(function(E,C){var U=E||C,M=d[U];if(!M)throw new Error(U+" is not a valid compression method !");return M})(S.options.compression,x.compression),m=S.options.compressionOptions||x.compressionOptions||{},w=S.dir,v=S.date;S._compressWorker(N,m).withStreamInfo("file",{name:T,dir:w,date:v,comment:S.comment||"",unixPermissions:S.unixPermissions,dosPermissions:S.dosPermissions}).pipe(k)}),k.entriesCount=j}catch(T){k.error(T)}return k}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,c,h){function d(){if(!(this instanceof d))return new d;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var f=new d;for(var p in this)typeof this[p]!="function"&&(f[p]=this[p]);return f}}(d.prototype=o("./object")).loadAsync=o("./load"),d.support=o("./support"),d.defaults=o("./defaults"),d.version="3.10.1",d.loadAsync=function(f,p){return new d().loadAsync(f,p)},d.external=o("./external"),c.exports=d},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,c,h){var d=o("./utils"),f=o("./external"),p=o("./utf8"),x=o("./zipEntries"),b=o("./stream/Crc32Probe"),k=o("./nodejsUtils");function j(T){return new f.Promise(function(S,N){var m=T.decompressed.getContentWorker().pipe(new b);m.on("error",function(w){N(w)}).on("end",function(){m.streamInfo.crc32!==T.decompressed.crc32?N(new Error("Corrupted zip : CRC32 mismatch")):S()}).resume()})}c.exports=function(T,S){var N=this;return S=d.extend(S||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:p.utf8decode}),k.isNode&&k.isStream(T)?f.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):d.prepareContent("the loaded zip file",T,!0,S.optimizedBinaryString,S.base64).then(function(m){var w=new x(S);return w.load(m),w}).then(function(m){var w=[f.Promise.resolve(m)],v=m.files;if(S.checkCRC32)for(var E=0;E<v.length;E++)w.push(j(v[E]));return f.Promise.all(w)}).then(function(m){for(var w=m.shift(),v=w.files,E=0;E<v.length;E++){var C=v[E],U=C.fileNameStr,M=d.resolve(C.fileNameStr);N.file(M,C.decompressed,{binary:!0,optimizedBinaryString:!0,date:C.date,dir:C.dir,comment:C.fileCommentStr.length?C.fileCommentStr:null,unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions,createFolders:S.createFolders}),C.dir||(N.file(M).unsafeOriginalName=U)}return w.zipComment.length&&(N.comment=w.zipComment),N})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,c,h){var d=o("../utils"),f=o("../stream/GenericWorker");function p(x,b){f.call(this,"Nodejs stream input adapter for "+x),this._upstreamEnded=!1,this._bindStream(b)}d.inherits(p,f),p.prototype._bindStream=function(x){var b=this;(this._stream=x).pause(),x.on("data",function(k){b.push({data:k,meta:{percent:0}})}).on("error",function(k){b.isPaused?this.generatedError=k:b.error(k)}).on("end",function(){b.isPaused?b._upstreamEnded=!0:b.end()})},p.prototype.pause=function(){return!!f.prototype.pause.call(this)&&(this._stream.pause(),!0)},p.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},c.exports=p},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,c,h){var d=o("readable-stream").Readable;function f(p,x,b){d.call(this,x),this._helper=p;var k=this;p.on("data",function(j,T){k.push(j)||k._helper.pause(),b&&b(T)}).on("error",function(j){k.emit("error",j)}).on("end",function(){k.push(null)})}o("../utils").inherits(f,d),f.prototype._read=function(){this._helper.resume()},c.exports=f},{"../utils":32,"readable-stream":16}],14:[function(o,c,h){c.exports={isNode:typeof Buffer<"u",newBufferFrom:function(d,f){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(d,f);if(typeof d=="number")throw new Error('The "data" argument must not be a number');return new Buffer(d,f)},allocBuffer:function(d){if(Buffer.alloc)return Buffer.alloc(d);var f=new Buffer(d);return f.fill(0),f},isBuffer:function(d){return Buffer.isBuffer(d)},isStream:function(d){return d&&typeof d.on=="function"&&typeof d.pause=="function"&&typeof d.resume=="function"}}},{}],15:[function(o,c,h){function d(M,Q,q){var ne,F=p.getTypeOf(Q),fe=p.extend(q||{},k);fe.date=fe.date||new Date,fe.compression!==null&&(fe.compression=fe.compression.toUpperCase()),typeof fe.unixPermissions=="string"&&(fe.unixPermissions=parseInt(fe.unixPermissions,8)),fe.unixPermissions&&16384&fe.unixPermissions&&(fe.dir=!0),fe.dosPermissions&&16&fe.dosPermissions&&(fe.dir=!0),fe.dir&&(M=v(M)),fe.createFolders&&(ne=w(M))&&E.call(this,ne,!0);var ue=F==="string"&&fe.binary===!1&&fe.base64===!1;q&&q.binary!==void 0||(fe.binary=!ue),(Q instanceof j&&Q.uncompressedSize===0||fe.dir||!Q||Q.length===0)&&(fe.base64=!1,fe.binary=!0,Q="",fe.compression="STORE",F="string");var B=null;B=Q instanceof j||Q instanceof x?Q:N.isNode&&N.isStream(Q)?new m(M,Q):p.prepareContent(M,Q,fe.binary,fe.optimizedBinaryString,fe.base64);var H=new T(M,B,fe);this.files[M]=H}var f=o("./utf8"),p=o("./utils"),x=o("./stream/GenericWorker"),b=o("./stream/StreamHelper"),k=o("./defaults"),j=o("./compressedObject"),T=o("./zipObject"),S=o("./generate"),N=o("./nodejsUtils"),m=o("./nodejs/NodejsStreamInputAdapter"),w=function(M){M.slice(-1)==="/"&&(M=M.substring(0,M.length-1));var Q=M.lastIndexOf("/");return 0<Q?M.substring(0,Q):""},v=function(M){return M.slice(-1)!=="/"&&(M+="/"),M},E=function(M,Q){return Q=Q!==void 0?Q:k.createFolders,M=v(M),this.files[M]||d.call(this,M,null,{dir:!0,createFolders:Q}),this.files[M]};function C(M){return Object.prototype.toString.call(M)==="[object RegExp]"}var U={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(M){var Q,q,ne;for(Q in this.files)ne=this.files[Q],(q=Q.slice(this.root.length,Q.length))&&Q.slice(0,this.root.length)===this.root&&M(q,ne)},filter:function(M){var Q=[];return this.forEach(function(q,ne){M(q,ne)&&Q.push(ne)}),Q},file:function(M,Q,q){if(arguments.length!==1)return M=this.root+M,d.call(this,M,Q,q),this;if(C(M)){var ne=M;return this.filter(function(fe,ue){return!ue.dir&&ne.test(fe)})}var F=this.files[this.root+M];return F&&!F.dir?F:null},folder:function(M){if(!M)return this;if(C(M))return this.filter(function(F,fe){return fe.dir&&M.test(F)});var Q=this.root+M,q=E.call(this,Q),ne=this.clone();return ne.root=q.name,ne},remove:function(M){M=this.root+M;var Q=this.files[M];if(Q||(M.slice(-1)!=="/"&&(M+="/"),Q=this.files[M]),Q&&!Q.dir)delete this.files[M];else for(var q=this.filter(function(F,fe){return fe.name.slice(0,M.length)===M}),ne=0;ne<q.length;ne++)delete this.files[q[ne].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(M){var Q,q={};try{if((q=p.extend(M||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:f.utf8encode})).type=q.type.toLowerCase(),q.compression=q.compression.toUpperCase(),q.type==="binarystring"&&(q.type="string"),!q.type)throw new Error("No output type specified.");p.checkSupport(q.type),q.platform!=="darwin"&&q.platform!=="freebsd"&&q.platform!=="linux"&&q.platform!=="sunos"||(q.platform="UNIX"),q.platform==="win32"&&(q.platform="DOS");var ne=q.comment||this.comment||"";Q=S.generateWorker(this,q,ne)}catch(F){(Q=new x("error")).error(F)}return new b(Q,q.type||"string",q.mimeType)},generateAsync:function(M,Q){return this.generateInternalStream(M).accumulate(Q)},generateNodeStream:function(M,Q){return(M=M||{}).type||(M.type="nodebuffer"),this.generateInternalStream(M).toNodejsStream(Q)}};c.exports=U},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(o,c,h){c.exports=o("stream")},{stream:void 0}],17:[function(o,c,h){var d=o("./DataReader");function f(p){d.call(this,p);for(var x=0;x<this.data.length;x++)p[x]=255&p[x]}o("../utils").inherits(f,d),f.prototype.byteAt=function(p){return this.data[this.zero+p]},f.prototype.lastIndexOfSignature=function(p){for(var x=p.charCodeAt(0),b=p.charCodeAt(1),k=p.charCodeAt(2),j=p.charCodeAt(3),T=this.length-4;0<=T;--T)if(this.data[T]===x&&this.data[T+1]===b&&this.data[T+2]===k&&this.data[T+3]===j)return T-this.zero;return-1},f.prototype.readAndCheckSignature=function(p){var x=p.charCodeAt(0),b=p.charCodeAt(1),k=p.charCodeAt(2),j=p.charCodeAt(3),T=this.readData(4);return x===T[0]&&b===T[1]&&k===T[2]&&j===T[3]},f.prototype.readData=function(p){if(this.checkOffset(p),p===0)return[];var x=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,x},c.exports=f},{"../utils":32,"./DataReader":18}],18:[function(o,c,h){var d=o("../utils");function f(p){this.data=p,this.length=p.length,this.index=0,this.zero=0}f.prototype={checkOffset:function(p){this.checkIndex(this.index+p)},checkIndex:function(p){if(this.length<this.zero+p||p<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+p+"). Corrupted zip ?")},setIndex:function(p){this.checkIndex(p),this.index=p},skip:function(p){this.setIndex(this.index+p)},byteAt:function(){},readInt:function(p){var x,b=0;for(this.checkOffset(p),x=this.index+p-1;x>=this.index;x--)b=(b<<8)+this.byteAt(x);return this.index+=p,b},readString:function(p){return d.transformTo("string",this.readData(p))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var p=this.readInt(4);return new Date(Date.UTC(1980+(p>>25&127),(p>>21&15)-1,p>>16&31,p>>11&31,p>>5&63,(31&p)<<1))}},c.exports=f},{"../utils":32}],19:[function(o,c,h){var d=o("./Uint8ArrayReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.readData=function(p){this.checkOffset(p);var x=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,x},c.exports=f},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,c,h){var d=o("./DataReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.byteAt=function(p){return this.data.charCodeAt(this.zero+p)},f.prototype.lastIndexOfSignature=function(p){return this.data.lastIndexOf(p)-this.zero},f.prototype.readAndCheckSignature=function(p){return p===this.readData(4)},f.prototype.readData=function(p){this.checkOffset(p);var x=this.data.slice(this.zero+this.index,this.zero+this.index+p);return this.index+=p,x},c.exports=f},{"../utils":32,"./DataReader":18}],21:[function(o,c,h){var d=o("./ArrayReader");function f(p){d.call(this,p)}o("../utils").inherits(f,d),f.prototype.readData=function(p){if(this.checkOffset(p),p===0)return new Uint8Array(0);var x=this.data.subarray(this.zero+this.index,this.zero+this.index+p);return this.index+=p,x},c.exports=f},{"../utils":32,"./ArrayReader":17}],22:[function(o,c,h){var d=o("../utils"),f=o("../support"),p=o("./ArrayReader"),x=o("./StringReader"),b=o("./NodeBufferReader"),k=o("./Uint8ArrayReader");c.exports=function(j){var T=d.getTypeOf(j);return d.checkSupport(T),T!=="string"||f.uint8array?T==="nodebuffer"?new b(j):f.uint8array?new k(d.transformTo("uint8array",j)):new p(d.transformTo("array",j)):new x(j)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,c,h){h.LOCAL_FILE_HEADER="PK",h.CENTRAL_FILE_HEADER="PK",h.CENTRAL_DIRECTORY_END="PK",h.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",h.ZIP64_CENTRAL_DIRECTORY_END="PK",h.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(o,c,h){var d=o("./GenericWorker"),f=o("../utils");function p(x){d.call(this,"ConvertWorker to "+x),this.destType=x}f.inherits(p,d),p.prototype.processChunk=function(x){this.push({data:f.transformTo(this.destType,x.data),meta:x.meta})},c.exports=p},{"../utils":32,"./GenericWorker":28}],25:[function(o,c,h){var d=o("./GenericWorker"),f=o("../crc32");function p(){d.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(p,d),p.prototype.processChunk=function(x){this.streamInfo.crc32=f(x.data,this.streamInfo.crc32||0),this.push(x)},c.exports=p},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,c,h){var d=o("../utils"),f=o("./GenericWorker");function p(x){f.call(this,"DataLengthProbe for "+x),this.propName=x,this.withStreamInfo(x,0)}d.inherits(p,f),p.prototype.processChunk=function(x){if(x){var b=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=b+x.data.length}f.prototype.processChunk.call(this,x)},c.exports=p},{"../utils":32,"./GenericWorker":28}],27:[function(o,c,h){var d=o("../utils"),f=o("./GenericWorker");function p(x){f.call(this,"DataWorker");var b=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,x.then(function(k){b.dataIsReady=!0,b.data=k,b.max=k&&k.length||0,b.type=d.getTypeOf(k),b.isPaused||b._tickAndRepeat()},function(k){b.error(k)})}d.inherits(p,f),p.prototype.cleanUp=function(){f.prototype.cleanUp.call(this),this.data=null},p.prototype.resume=function(){return!!f.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,d.delay(this._tickAndRepeat,[],this)),!0)},p.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(d.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},p.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var x=null,b=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":x=this.data.substring(this.index,b);break;case"uint8array":x=this.data.subarray(this.index,b);break;case"array":case"nodebuffer":x=this.data.slice(this.index,b)}return this.index=b,this.push({data:x,meta:{percent:this.max?this.index/this.max*100:0}})},c.exports=p},{"../utils":32,"./GenericWorker":28}],28:[function(o,c,h){function d(f){this.name=f||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}d.prototype={push:function(f){this.emit("data",f)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(f){this.emit("error",f)}return!0},error:function(f){return!this.isFinished&&(this.isPaused?this.generatedError=f:(this.isFinished=!0,this.emit("error",f),this.previous&&this.previous.error(f),this.cleanUp()),!0)},on:function(f,p){return this._listeners[f].push(p),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(f,p){if(this._listeners[f])for(var x=0;x<this._listeners[f].length;x++)this._listeners[f][x].call(this,p)},pipe:function(f){return f.registerPrevious(this)},registerPrevious:function(f){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=f.streamInfo,this.mergeStreamInfo(),this.previous=f;var p=this;return f.on("data",function(x){p.processChunk(x)}),f.on("end",function(){p.end()}),f.on("error",function(x){p.error(x)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var f=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),f=!0),this.previous&&this.previous.resume(),!f},flush:function(){},processChunk:function(f){this.push(f)},withStreamInfo:function(f,p){return this.extraStreamInfo[f]=p,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var f in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,f)&&(this.streamInfo[f]=this.extraStreamInfo[f])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var f="Worker "+this.name;return this.previous?this.previous+" -> "+f:f}},c.exports=d},{}],29:[function(o,c,h){var d=o("../utils"),f=o("./ConvertWorker"),p=o("./GenericWorker"),x=o("../base64"),b=o("../support"),k=o("../external"),j=null;if(b.nodestream)try{j=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function T(N,m){return new k.Promise(function(w,v){var E=[],C=N._internalType,U=N._outputType,M=N._mimeType;N.on("data",function(Q,q){E.push(Q),m&&m(q)}).on("error",function(Q){E=[],v(Q)}).on("end",function(){try{var Q=(function(q,ne,F){switch(q){case"blob":return d.newBlob(d.transformTo("arraybuffer",ne),F);case"base64":return x.encode(ne);default:return d.transformTo(q,ne)}})(U,(function(q,ne){var F,fe=0,ue=null,B=0;for(F=0;F<ne.length;F++)B+=ne[F].length;switch(q){case"string":return ne.join("");case"array":return Array.prototype.concat.apply([],ne);case"uint8array":for(ue=new Uint8Array(B),F=0;F<ne.length;F++)ue.set(ne[F],fe),fe+=ne[F].length;return ue;case"nodebuffer":return Buffer.concat(ne);default:throw new Error("concat : unsupported type '"+q+"'")}})(C,E),M);w(Q)}catch(q){v(q)}E=[]}).resume()})}function S(N,m,w){var v=m;switch(m){case"blob":case"arraybuffer":v="uint8array";break;case"base64":v="string"}try{this._internalType=v,this._outputType=m,this._mimeType=w,d.checkSupport(v),this._worker=N.pipe(new f(v)),N.lock()}catch(E){this._worker=new p("error"),this._worker.error(E)}}S.prototype={accumulate:function(N){return T(this,N)},on:function(N,m){var w=this;return N==="data"?this._worker.on(N,function(v){m.call(w,v.data,v.meta)}):this._worker.on(N,function(){d.delay(m,arguments,w)}),this},resume:function(){return d.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(N){if(d.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new j(this,{objectMode:this._outputType!=="nodebuffer"},N)}},c.exports=S},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,c,h){if(h.base64=!0,h.array=!0,h.string=!0,h.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",h.nodebuffer=typeof Buffer<"u",h.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")h.blob=!1;else{var d=new ArrayBuffer(0);try{h.blob=new Blob([d],{type:"application/zip"}).size===0}catch{try{var f=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);f.append(d),h.blob=f.getBlob("application/zip").size===0}catch{h.blob=!1}}}try{h.nodestream=!!o("readable-stream").Readable}catch{h.nodestream=!1}},{"readable-stream":16}],31:[function(o,c,h){for(var d=o("./utils"),f=o("./support"),p=o("./nodejsUtils"),x=o("./stream/GenericWorker"),b=new Array(256),k=0;k<256;k++)b[k]=252<=k?6:248<=k?5:240<=k?4:224<=k?3:192<=k?2:1;b[254]=b[254]=1;function j(){x.call(this,"utf-8 decode"),this.leftOver=null}function T(){x.call(this,"utf-8 encode")}h.utf8encode=function(S){return f.nodebuffer?p.newBufferFrom(S,"utf-8"):(function(N){var m,w,v,E,C,U=N.length,M=0;for(E=0;E<U;E++)(64512&(w=N.charCodeAt(E)))==55296&&E+1<U&&(64512&(v=N.charCodeAt(E+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),E++),M+=w<128?1:w<2048?2:w<65536?3:4;for(m=f.uint8array?new Uint8Array(M):new Array(M),E=C=0;C<M;E++)(64512&(w=N.charCodeAt(E)))==55296&&E+1<U&&(64512&(v=N.charCodeAt(E+1)))==56320&&(w=65536+(w-55296<<10)+(v-56320),E++),w<128?m[C++]=w:(w<2048?m[C++]=192|w>>>6:(w<65536?m[C++]=224|w>>>12:(m[C++]=240|w>>>18,m[C++]=128|w>>>12&63),m[C++]=128|w>>>6&63),m[C++]=128|63&w);return m})(S)},h.utf8decode=function(S){return f.nodebuffer?d.transformTo("nodebuffer",S).toString("utf-8"):(function(N){var m,w,v,E,C=N.length,U=new Array(2*C);for(m=w=0;m<C;)if((v=N[m++])<128)U[w++]=v;else if(4<(E=b[v]))U[w++]=65533,m+=E-1;else{for(v&=E===2?31:E===3?15:7;1<E&&m<C;)v=v<<6|63&N[m++],E--;1<E?U[w++]=65533:v<65536?U[w++]=v:(v-=65536,U[w++]=55296|v>>10&1023,U[w++]=56320|1023&v)}return U.length!==w&&(U.subarray?U=U.subarray(0,w):U.length=w),d.applyFromCharCode(U)})(S=d.transformTo(f.uint8array?"uint8array":"array",S))},d.inherits(j,x),j.prototype.processChunk=function(S){var N=d.transformTo(f.uint8array?"uint8array":"array",S.data);if(this.leftOver&&this.leftOver.length){if(f.uint8array){var m=N;(N=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),N.set(m,this.leftOver.length)}else N=this.leftOver.concat(N);this.leftOver=null}var w=(function(E,C){var U;for((C=C||E.length)>E.length&&(C=E.length),U=C-1;0<=U&&(192&E[U])==128;)U--;return U<0||U===0?C:U+b[E[U]]>C?U:C})(N),v=N;w!==N.length&&(f.uint8array?(v=N.subarray(0,w),this.leftOver=N.subarray(w,N.length)):(v=N.slice(0,w),this.leftOver=N.slice(w,N.length))),this.push({data:h.utf8decode(v),meta:S.meta})},j.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:h.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},h.Utf8DecodeWorker=j,d.inherits(T,x),T.prototype.processChunk=function(S){this.push({data:h.utf8encode(S.data),meta:S.meta})},h.Utf8EncodeWorker=T},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,c,h){var d=o("./support"),f=o("./base64"),p=o("./nodejsUtils"),x=o("./external");function b(m){return m}function k(m,w){for(var v=0;v<m.length;++v)w[v]=255&m.charCodeAt(v);return w}o("setimmediate"),h.newBlob=function(m,w){h.checkSupport("blob");try{return new Blob([m],{type:w})}catch{try{var v=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return v.append(m),v.getBlob(w)}catch{throw new Error("Bug : can't construct the Blob.")}}};var j={stringifyByChunk:function(m,w,v){var E=[],C=0,U=m.length;if(U<=v)return String.fromCharCode.apply(null,m);for(;C<U;)w==="array"||w==="nodebuffer"?E.push(String.fromCharCode.apply(null,m.slice(C,Math.min(C+v,U)))):E.push(String.fromCharCode.apply(null,m.subarray(C,Math.min(C+v,U)))),C+=v;return E.join("")},stringifyByChar:function(m){for(var w="",v=0;v<m.length;v++)w+=String.fromCharCode(m[v]);return w},applyCanBeUsed:{uint8array:(function(){try{return d.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return d.nodebuffer&&String.fromCharCode.apply(null,p.allocBuffer(1)).length===1}catch{return!1}})()}};function T(m){var w=65536,v=h.getTypeOf(m),E=!0;if(v==="uint8array"?E=j.applyCanBeUsed.uint8array:v==="nodebuffer"&&(E=j.applyCanBeUsed.nodebuffer),E)for(;1<w;)try{return j.stringifyByChunk(m,v,w)}catch{w=Math.floor(w/2)}return j.stringifyByChar(m)}function S(m,w){for(var v=0;v<m.length;v++)w[v]=m[v];return w}h.applyFromCharCode=T;var N={};N.string={string:b,array:function(m){return k(m,new Array(m.length))},arraybuffer:function(m){return N.string.uint8array(m).buffer},uint8array:function(m){return k(m,new Uint8Array(m.length))},nodebuffer:function(m){return k(m,p.allocBuffer(m.length))}},N.array={string:T,array:b,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return p.newBufferFrom(m)}},N.arraybuffer={string:function(m){return T(new Uint8Array(m))},array:function(m){return S(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:b,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return p.newBufferFrom(new Uint8Array(m))}},N.uint8array={string:T,array:function(m){return S(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:b,nodebuffer:function(m){return p.newBufferFrom(m)}},N.nodebuffer={string:T,array:function(m){return S(m,new Array(m.length))},arraybuffer:function(m){return N.nodebuffer.uint8array(m).buffer},uint8array:function(m){return S(m,new Uint8Array(m.length))},nodebuffer:b},h.transformTo=function(m,w){if(w=w||"",!m)return w;h.checkSupport(m);var v=h.getTypeOf(w);return N[v][m](w)},h.resolve=function(m){for(var w=m.split("/"),v=[],E=0;E<w.length;E++){var C=w[E];C==="."||C===""&&E!==0&&E!==w.length-1||(C===".."?v.pop():v.push(C))}return v.join("/")},h.getTypeOf=function(m){return typeof m=="string"?"string":Object.prototype.toString.call(m)==="[object Array]"?"array":d.nodebuffer&&p.isBuffer(m)?"nodebuffer":d.uint8array&&m instanceof Uint8Array?"uint8array":d.arraybuffer&&m instanceof ArrayBuffer?"arraybuffer":void 0},h.checkSupport=function(m){if(!d[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},h.MAX_VALUE_16BITS=65535,h.MAX_VALUE_32BITS=-1,h.pretty=function(m){var w,v,E="";for(v=0;v<(m||"").length;v++)E+="\\x"+((w=m.charCodeAt(v))<16?"0":"")+w.toString(16).toUpperCase();return E},h.delay=function(m,w,v){setImmediate(function(){m.apply(v||null,w||[])})},h.inherits=function(m,w){function v(){}v.prototype=w.prototype,m.prototype=new v},h.extend=function(){var m,w,v={};for(m=0;m<arguments.length;m++)for(w in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],w)&&v[w]===void 0&&(v[w]=arguments[m][w]);return v},h.prepareContent=function(m,w,v,E,C){return x.Promise.resolve(w).then(function(U){return d.blob&&(U instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(U))!==-1)&&typeof FileReader<"u"?new x.Promise(function(M,Q){var q=new FileReader;q.onload=function(ne){M(ne.target.result)},q.onerror=function(ne){Q(ne.target.error)},q.readAsArrayBuffer(U)}):U}).then(function(U){var M=h.getTypeOf(U);return M?(M==="arraybuffer"?U=h.transformTo("uint8array",U):M==="string"&&(C?U=f.decode(U):v&&E!==!0&&(U=(function(Q){return k(Q,d.uint8array?new Uint8Array(Q.length):new Array(Q.length))})(U))),U):x.Promise.reject(new Error("Can't read the data of '"+m+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,c,h){var d=o("./reader/readerFor"),f=o("./utils"),p=o("./signature"),x=o("./zipEntry"),b=o("./support");function k(j){this.files=[],this.loadOptions=j}k.prototype={checkSignature:function(j){if(!this.reader.readAndCheckSignature(j)){this.reader.index-=4;var T=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+f.pretty(T)+", expected "+f.pretty(j)+")")}},isSignature:function(j,T){var S=this.reader.index;this.reader.setIndex(j);var N=this.reader.readString(4)===T;return this.reader.setIndex(S),N},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var j=this.reader.readData(this.zipCommentLength),T=b.uint8array?"uint8array":"array",S=f.transformTo(T,j);this.zipComment=this.loadOptions.decodeFileName(S)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var j,T,S,N=this.zip64EndOfCentralSize-44;0<N;)j=this.reader.readInt(2),T=this.reader.readInt(4),S=this.reader.readData(T),this.zip64ExtensibleData[j]={id:j,length:T,value:S}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var j,T;for(j=0;j<this.files.length;j++)T=this.files[j],this.reader.setIndex(T.localHeaderOffset),this.checkSignature(p.LOCAL_FILE_HEADER),T.readLocalPart(this.reader),T.handleUTF8(),T.processAttributes()},readCentralDir:function(){var j;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(p.CENTRAL_FILE_HEADER);)(j=new x({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(j);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var j=this.reader.lastIndexOfSignature(p.CENTRAL_DIRECTORY_END);if(j<0)throw this.isSignature(0,p.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(j);var T=j;if(this.checkSignature(p.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===f.MAX_VALUE_16BITS||this.diskWithCentralDirStart===f.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===f.MAX_VALUE_16BITS||this.centralDirRecords===f.MAX_VALUE_16BITS||this.centralDirSize===f.MAX_VALUE_32BITS||this.centralDirOffset===f.MAX_VALUE_32BITS){if(this.zip64=!0,(j=this.reader.lastIndexOfSignature(p.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(j),this.checkSignature(p.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,p.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(p.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(p.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var S=this.centralDirOffset+this.centralDirSize;this.zip64&&(S+=20,S+=12+this.zip64EndOfCentralSize);var N=T-S;if(0<N)this.isSignature(T,p.CENTRAL_FILE_HEADER)||(this.reader.zero=N);else if(N<0)throw new Error("Corrupted zip: missing "+Math.abs(N)+" bytes.")},prepareReader:function(j){this.reader=d(j)},load:function(j){this.prepareReader(j),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},c.exports=k},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,c,h){var d=o("./reader/readerFor"),f=o("./utils"),p=o("./compressedObject"),x=o("./crc32"),b=o("./utf8"),k=o("./compressions"),j=o("./support");function T(S,N){this.options=S,this.loadOptions=N}T.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(S){var N,m;if(S.skip(22),this.fileNameLength=S.readInt(2),m=S.readInt(2),this.fileName=S.readData(this.fileNameLength),S.skip(m),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((N=(function(w){for(var v in k)if(Object.prototype.hasOwnProperty.call(k,v)&&k[v].magic===w)return k[v];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+f.pretty(this.compressionMethod)+" unknown (inner file : "+f.transformTo("string",this.fileName)+")");this.decompressed=new p(this.compressedSize,this.uncompressedSize,this.crc32,N,S.readData(this.compressedSize))},readCentralPart:function(S){this.versionMadeBy=S.readInt(2),S.skip(2),this.bitFlag=S.readInt(2),this.compressionMethod=S.readString(2),this.date=S.readDate(),this.crc32=S.readInt(4),this.compressedSize=S.readInt(4),this.uncompressedSize=S.readInt(4);var N=S.readInt(2);if(this.extraFieldsLength=S.readInt(2),this.fileCommentLength=S.readInt(2),this.diskNumberStart=S.readInt(2),this.internalFileAttributes=S.readInt(2),this.externalFileAttributes=S.readInt(4),this.localHeaderOffset=S.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");S.skip(N),this.readExtraFields(S),this.parseZIP64ExtraField(S),this.fileComment=S.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var S=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),S==0&&(this.dosPermissions=63&this.externalFileAttributes),S==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var S=d(this.extraFields[1].value);this.uncompressedSize===f.MAX_VALUE_32BITS&&(this.uncompressedSize=S.readInt(8)),this.compressedSize===f.MAX_VALUE_32BITS&&(this.compressedSize=S.readInt(8)),this.localHeaderOffset===f.MAX_VALUE_32BITS&&(this.localHeaderOffset=S.readInt(8)),this.diskNumberStart===f.MAX_VALUE_32BITS&&(this.diskNumberStart=S.readInt(4))}},readExtraFields:function(S){var N,m,w,v=S.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});S.index+4<v;)N=S.readInt(2),m=S.readInt(2),w=S.readData(m),this.extraFields[N]={id:N,length:m,value:w};S.setIndex(v)},handleUTF8:function(){var S=j.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=b.utf8decode(this.fileName),this.fileCommentStr=b.utf8decode(this.fileComment);else{var N=this.findExtraFieldUnicodePath();if(N!==null)this.fileNameStr=N;else{var m=f.transformTo(S,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var w=this.findExtraFieldUnicodeComment();if(w!==null)this.fileCommentStr=w;else{var v=f.transformTo(S,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(v)}}},findExtraFieldUnicodePath:function(){var S=this.extraFields[28789];if(S){var N=d(S.value);return N.readInt(1)!==1||x(this.fileName)!==N.readInt(4)?null:b.utf8decode(N.readData(S.length-5))}return null},findExtraFieldUnicodeComment:function(){var S=this.extraFields[25461];if(S){var N=d(S.value);return N.readInt(1)!==1||x(this.fileComment)!==N.readInt(4)?null:b.utf8decode(N.readData(S.length-5))}return null}},c.exports=T},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,c,h){function d(N,m,w){this.name=N,this.dir=w.dir,this.date=w.date,this.comment=w.comment,this.unixPermissions=w.unixPermissions,this.dosPermissions=w.dosPermissions,this._data=m,this._dataBinary=w.binary,this.options={compression:w.compression,compressionOptions:w.compressionOptions}}var f=o("./stream/StreamHelper"),p=o("./stream/DataWorker"),x=o("./utf8"),b=o("./compressedObject"),k=o("./stream/GenericWorker");d.prototype={internalStream:function(N){var m=null,w="string";try{if(!N)throw new Error("No output type specified.");var v=(w=N.toLowerCase())==="string"||w==="text";w!=="binarystring"&&w!=="text"||(w="string"),m=this._decompressWorker();var E=!this._dataBinary;E&&!v&&(m=m.pipe(new x.Utf8EncodeWorker)),!E&&v&&(m=m.pipe(new x.Utf8DecodeWorker))}catch(C){(m=new k("error")).error(C)}return new f(m,w,"")},async:function(N,m){return this.internalStream(N).accumulate(m)},nodeStream:function(N,m){return this.internalStream(N||"nodebuffer").toNodejsStream(m)},_compressWorker:function(N,m){if(this._data instanceof b&&this._data.compression.magic===N.magic)return this._data.getCompressedWorker();var w=this._decompressWorker();return this._dataBinary||(w=w.pipe(new x.Utf8EncodeWorker)),b.createWorkerFrom(w,N,m)},_decompressWorker:function(){return this._data instanceof b?this._data.getContentWorker():this._data instanceof k?this._data:new p(this._data)}};for(var j=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],T=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},S=0;S<j.length;S++)d.prototype[j[S]]=T;c.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,c,h){(function(d){var f,p,x=d.MutationObserver||d.WebKitMutationObserver;if(x){var b=0,k=new x(N),j=d.document.createTextNode("");k.observe(j,{characterData:!0}),f=function(){j.data=b=++b%2}}else if(d.setImmediate||d.MessageChannel===void 0)f="document"in d&&"onreadystatechange"in d.document.createElement("script")?function(){var m=d.document.createElement("script");m.onreadystatechange=function(){N(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},d.document.documentElement.appendChild(m)}:function(){setTimeout(N,0)};else{var T=new d.MessageChannel;T.port1.onmessage=N,f=function(){T.port2.postMessage(0)}}var S=[];function N(){var m,w;p=!0;for(var v=S.length;v;){for(w=S,S=[],m=-1;++m<v;)w[m]();v=S.length}p=!1}c.exports=function(m){S.push(m)!==1||p||f()}}).call(this,typeof nr<"u"?nr:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,c,h){var d=o("immediate");function f(){}var p={},x=["REJECTED"],b=["FULFILLED"],k=["PENDING"];function j(v){if(typeof v!="function")throw new TypeError("resolver must be a function");this.state=k,this.queue=[],this.outcome=void 0,v!==f&&m(this,v)}function T(v,E,C){this.promise=v,typeof E=="function"&&(this.onFulfilled=E,this.callFulfilled=this.otherCallFulfilled),typeof C=="function"&&(this.onRejected=C,this.callRejected=this.otherCallRejected)}function S(v,E,C){d(function(){var U;try{U=E(C)}catch(M){return p.reject(v,M)}U===v?p.reject(v,new TypeError("Cannot resolve promise with itself")):p.resolve(v,U)})}function N(v){var E=v&&v.then;if(v&&(typeof v=="object"||typeof v=="function")&&typeof E=="function")return function(){E.apply(v,arguments)}}function m(v,E){var C=!1;function U(q){C||(C=!0,p.reject(v,q))}function M(q){C||(C=!0,p.resolve(v,q))}var Q=w(function(){E(M,U)});Q.status==="error"&&U(Q.value)}function w(v,E){var C={};try{C.value=v(E),C.status="success"}catch(U){C.status="error",C.value=U}return C}(c.exports=j).prototype.finally=function(v){if(typeof v!="function")return this;var E=this.constructor;return this.then(function(C){return E.resolve(v()).then(function(){return C})},function(C){return E.resolve(v()).then(function(){throw C})})},j.prototype.catch=function(v){return this.then(null,v)},j.prototype.then=function(v,E){if(typeof v!="function"&&this.state===b||typeof E!="function"&&this.state===x)return this;var C=new this.constructor(f);return this.state!==k?S(C,this.state===b?v:E,this.outcome):this.queue.push(new T(C,v,E)),C},T.prototype.callFulfilled=function(v){p.resolve(this.promise,v)},T.prototype.otherCallFulfilled=function(v){S(this.promise,this.onFulfilled,v)},T.prototype.callRejected=function(v){p.reject(this.promise,v)},T.prototype.otherCallRejected=function(v){S(this.promise,this.onRejected,v)},p.resolve=function(v,E){var C=w(N,E);if(C.status==="error")return p.reject(v,C.value);var U=C.value;if(U)m(v,U);else{v.state=b,v.outcome=E;for(var M=-1,Q=v.queue.length;++M<Q;)v.queue[M].callFulfilled(E)}return v},p.reject=function(v,E){v.state=x,v.outcome=E;for(var C=-1,U=v.queue.length;++C<U;)v.queue[C].callRejected(E);return v},j.resolve=function(v){return v instanceof this?v:p.resolve(new this(f),v)},j.reject=function(v){var E=new this(f);return p.reject(E,v)},j.all=function(v){var E=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,U=!1;if(!C)return this.resolve([]);for(var M=new Array(C),Q=0,q=-1,ne=new this(f);++q<C;)F(v[q],q);return ne;function F(fe,ue){E.resolve(fe).then(function(B){M[ue]=B,++Q!==C||U||(U=!0,p.resolve(ne,M))},function(B){U||(U=!0,p.reject(ne,B))})}},j.race=function(v){var E=this;if(Object.prototype.toString.call(v)!=="[object Array]")return this.reject(new TypeError("must be an array"));var C=v.length,U=!1;if(!C)return this.resolve([]);for(var M=-1,Q=new this(f);++M<C;)q=v[M],E.resolve(q).then(function(ne){U||(U=!0,p.resolve(Q,ne))},function(ne){U||(U=!0,p.reject(Q,ne))});var q;return Q}},{immediate:36}],38:[function(o,c,h){var d={};(0,o("./lib/utils/common").assign)(d,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),c.exports=d},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,c,h){var d=o("./zlib/deflate"),f=o("./utils/common"),p=o("./utils/strings"),x=o("./zlib/messages"),b=o("./zlib/zstream"),k=Object.prototype.toString,j=0,T=-1,S=0,N=8;function m(v){if(!(this instanceof m))return new m(v);this.options=f.assign({level:T,method:N,chunkSize:16384,windowBits:15,memLevel:8,strategy:S,to:""},v||{});var E=this.options;E.raw&&0<E.windowBits?E.windowBits=-E.windowBits:E.gzip&&0<E.windowBits&&E.windowBits<16&&(E.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new b,this.strm.avail_out=0;var C=d.deflateInit2(this.strm,E.level,E.method,E.windowBits,E.memLevel,E.strategy);if(C!==j)throw new Error(x[C]);if(E.header&&d.deflateSetHeader(this.strm,E.header),E.dictionary){var U;if(U=typeof E.dictionary=="string"?p.string2buf(E.dictionary):k.call(E.dictionary)==="[object ArrayBuffer]"?new Uint8Array(E.dictionary):E.dictionary,(C=d.deflateSetDictionary(this.strm,U))!==j)throw new Error(x[C]);this._dict_set=!0}}function w(v,E){var C=new m(E);if(C.push(v,!0),C.err)throw C.msg||x[C.err];return C.result}m.prototype.push=function(v,E){var C,U,M=this.strm,Q=this.options.chunkSize;if(this.ended)return!1;U=E===~~E?E:E===!0?4:0,typeof v=="string"?M.input=p.string2buf(v):k.call(v)==="[object ArrayBuffer]"?M.input=new Uint8Array(v):M.input=v,M.next_in=0,M.avail_in=M.input.length;do{if(M.avail_out===0&&(M.output=new f.Buf8(Q),M.next_out=0,M.avail_out=Q),(C=d.deflate(M,U))!==1&&C!==j)return this.onEnd(C),!(this.ended=!0);M.avail_out!==0&&(M.avail_in!==0||U!==4&&U!==2)||(this.options.to==="string"?this.onData(p.buf2binstring(f.shrinkBuf(M.output,M.next_out))):this.onData(f.shrinkBuf(M.output,M.next_out)))}while((0<M.avail_in||M.avail_out===0)&&C!==1);return U===4?(C=d.deflateEnd(this.strm),this.onEnd(C),this.ended=!0,C===j):U!==2||(this.onEnd(j),!(M.avail_out=0))},m.prototype.onData=function(v){this.chunks.push(v)},m.prototype.onEnd=function(v){v===j&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=v,this.msg=this.strm.msg},h.Deflate=m,h.deflate=w,h.deflateRaw=function(v,E){return(E=E||{}).raw=!0,w(v,E)},h.gzip=function(v,E){return(E=E||{}).gzip=!0,w(v,E)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,c,h){var d=o("./zlib/inflate"),f=o("./utils/common"),p=o("./utils/strings"),x=o("./zlib/constants"),b=o("./zlib/messages"),k=o("./zlib/zstream"),j=o("./zlib/gzheader"),T=Object.prototype.toString;function S(m){if(!(this instanceof S))return new S(m);this.options=f.assign({chunkSize:16384,windowBits:0,to:""},m||{});var w=this.options;w.raw&&0<=w.windowBits&&w.windowBits<16&&(w.windowBits=-w.windowBits,w.windowBits===0&&(w.windowBits=-15)),!(0<=w.windowBits&&w.windowBits<16)||m&&m.windowBits||(w.windowBits+=32),15<w.windowBits&&w.windowBits<48&&(15&w.windowBits)==0&&(w.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new k,this.strm.avail_out=0;var v=d.inflateInit2(this.strm,w.windowBits);if(v!==x.Z_OK)throw new Error(b[v]);this.header=new j,d.inflateGetHeader(this.strm,this.header)}function N(m,w){var v=new S(w);if(v.push(m,!0),v.err)throw v.msg||b[v.err];return v.result}S.prototype.push=function(m,w){var v,E,C,U,M,Q,q=this.strm,ne=this.options.chunkSize,F=this.options.dictionary,fe=!1;if(this.ended)return!1;E=w===~~w?w:w===!0?x.Z_FINISH:x.Z_NO_FLUSH,typeof m=="string"?q.input=p.binstring2buf(m):T.call(m)==="[object ArrayBuffer]"?q.input=new Uint8Array(m):q.input=m,q.next_in=0,q.avail_in=q.input.length;do{if(q.avail_out===0&&(q.output=new f.Buf8(ne),q.next_out=0,q.avail_out=ne),(v=d.inflate(q,x.Z_NO_FLUSH))===x.Z_NEED_DICT&&F&&(Q=typeof F=="string"?p.string2buf(F):T.call(F)==="[object ArrayBuffer]"?new Uint8Array(F):F,v=d.inflateSetDictionary(this.strm,Q)),v===x.Z_BUF_ERROR&&fe===!0&&(v=x.Z_OK,fe=!1),v!==x.Z_STREAM_END&&v!==x.Z_OK)return this.onEnd(v),!(this.ended=!0);q.next_out&&(q.avail_out!==0&&v!==x.Z_STREAM_END&&(q.avail_in!==0||E!==x.Z_FINISH&&E!==x.Z_SYNC_FLUSH)||(this.options.to==="string"?(C=p.utf8border(q.output,q.next_out),U=q.next_out-C,M=p.buf2string(q.output,C),q.next_out=U,q.avail_out=ne-U,U&&f.arraySet(q.output,q.output,C,U,0),this.onData(M)):this.onData(f.shrinkBuf(q.output,q.next_out)))),q.avail_in===0&&q.avail_out===0&&(fe=!0)}while((0<q.avail_in||q.avail_out===0)&&v!==x.Z_STREAM_END);return v===x.Z_STREAM_END&&(E=x.Z_FINISH),E===x.Z_FINISH?(v=d.inflateEnd(this.strm),this.onEnd(v),this.ended=!0,v===x.Z_OK):E!==x.Z_SYNC_FLUSH||(this.onEnd(x.Z_OK),!(q.avail_out=0))},S.prototype.onData=function(m){this.chunks.push(m)},S.prototype.onEnd=function(m){m===x.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=f.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},h.Inflate=S,h.inflate=N,h.inflateRaw=function(m,w){return(w=w||{}).raw=!0,N(m,w)},h.ungzip=N},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,c,h){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";h.assign=function(x){for(var b=Array.prototype.slice.call(arguments,1);b.length;){var k=b.shift();if(k){if(typeof k!="object")throw new TypeError(k+"must be non-object");for(var j in k)k.hasOwnProperty(j)&&(x[j]=k[j])}}return x},h.shrinkBuf=function(x,b){return x.length===b?x:x.subarray?x.subarray(0,b):(x.length=b,x)};var f={arraySet:function(x,b,k,j,T){if(b.subarray&&x.subarray)x.set(b.subarray(k,k+j),T);else for(var S=0;S<j;S++)x[T+S]=b[k+S]},flattenChunks:function(x){var b,k,j,T,S,N;for(b=j=0,k=x.length;b<k;b++)j+=x[b].length;for(N=new Uint8Array(j),b=T=0,k=x.length;b<k;b++)S=x[b],N.set(S,T),T+=S.length;return N}},p={arraySet:function(x,b,k,j,T){for(var S=0;S<j;S++)x[T+S]=b[k+S]},flattenChunks:function(x){return[].concat.apply([],x)}};h.setTyped=function(x){x?(h.Buf8=Uint8Array,h.Buf16=Uint16Array,h.Buf32=Int32Array,h.assign(h,f)):(h.Buf8=Array,h.Buf16=Array,h.Buf32=Array,h.assign(h,p))},h.setTyped(d)},{}],42:[function(o,c,h){var d=o("./common"),f=!0,p=!0;try{String.fromCharCode.apply(null,[0])}catch{f=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{p=!1}for(var x=new d.Buf8(256),b=0;b<256;b++)x[b]=252<=b?6:248<=b?5:240<=b?4:224<=b?3:192<=b?2:1;function k(j,T){if(T<65537&&(j.subarray&&p||!j.subarray&&f))return String.fromCharCode.apply(null,d.shrinkBuf(j,T));for(var S="",N=0;N<T;N++)S+=String.fromCharCode(j[N]);return S}x[254]=x[254]=1,h.string2buf=function(j){var T,S,N,m,w,v=j.length,E=0;for(m=0;m<v;m++)(64512&(S=j.charCodeAt(m)))==55296&&m+1<v&&(64512&(N=j.charCodeAt(m+1)))==56320&&(S=65536+(S-55296<<10)+(N-56320),m++),E+=S<128?1:S<2048?2:S<65536?3:4;for(T=new d.Buf8(E),m=w=0;w<E;m++)(64512&(S=j.charCodeAt(m)))==55296&&m+1<v&&(64512&(N=j.charCodeAt(m+1)))==56320&&(S=65536+(S-55296<<10)+(N-56320),m++),S<128?T[w++]=S:(S<2048?T[w++]=192|S>>>6:(S<65536?T[w++]=224|S>>>12:(T[w++]=240|S>>>18,T[w++]=128|S>>>12&63),T[w++]=128|S>>>6&63),T[w++]=128|63&S);return T},h.buf2binstring=function(j){return k(j,j.length)},h.binstring2buf=function(j){for(var T=new d.Buf8(j.length),S=0,N=T.length;S<N;S++)T[S]=j.charCodeAt(S);return T},h.buf2string=function(j,T){var S,N,m,w,v=T||j.length,E=new Array(2*v);for(S=N=0;S<v;)if((m=j[S++])<128)E[N++]=m;else if(4<(w=x[m]))E[N++]=65533,S+=w-1;else{for(m&=w===2?31:w===3?15:7;1<w&&S<v;)m=m<<6|63&j[S++],w--;1<w?E[N++]=65533:m<65536?E[N++]=m:(m-=65536,E[N++]=55296|m>>10&1023,E[N++]=56320|1023&m)}return k(E,N)},h.utf8border=function(j,T){var S;for((T=T||j.length)>j.length&&(T=j.length),S=T-1;0<=S&&(192&j[S])==128;)S--;return S<0||S===0?T:S+x[j[S]]>T?S:T}},{"./common":41}],43:[function(o,c,h){c.exports=function(d,f,p,x){for(var b=65535&d|0,k=d>>>16&65535|0,j=0;p!==0;){for(p-=j=2e3<p?2e3:p;k=k+(b=b+f[x++]|0)|0,--j;);b%=65521,k%=65521}return b|k<<16|0}},{}],44:[function(o,c,h){c.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(o,c,h){var d=(function(){for(var f,p=[],x=0;x<256;x++){f=x;for(var b=0;b<8;b++)f=1&f?3988292384^f>>>1:f>>>1;p[x]=f}return p})();c.exports=function(f,p,x,b){var k=d,j=b+x;f^=-1;for(var T=b;T<j;T++)f=f>>>8^k[255&(f^p[T])];return-1^f}},{}],46:[function(o,c,h){var d,f=o("../utils/common"),p=o("./trees"),x=o("./adler32"),b=o("./crc32"),k=o("./messages"),j=0,T=4,S=0,N=-2,m=-1,w=4,v=2,E=8,C=9,U=286,M=30,Q=19,q=2*U+1,ne=15,F=3,fe=258,ue=fe+F+1,B=42,H=113,_=1,ee=2,K=3,I=4;function we(y,de){return y.msg=k[de],de}function G(y){return(y<<1)-(4<y?9:0)}function he(y){for(var de=y.length;0<=--de;)y[de]=0}function A(y){var de=y.state,re=de.pending;re>y.avail_out&&(re=y.avail_out),re!==0&&(f.arraySet(y.output,de.pending_buf,de.pending_out,re,y.next_out),y.next_out+=re,de.pending_out+=re,y.total_out+=re,y.avail_out-=re,de.pending-=re,de.pending===0&&(de.pending_out=0))}function O(y,de){p._tr_flush_block(y,0<=y.block_start?y.block_start:-1,y.strstart-y.block_start,de),y.block_start=y.strstart,A(y.strm)}function P(y,de){y.pending_buf[y.pending++]=de}function W(y,de){y.pending_buf[y.pending++]=de>>>8&255,y.pending_buf[y.pending++]=255&de}function ce(y,de){var re,L,D=y.max_chain_length,$=y.strstart,me=y.prev_length,se=y.nice_match,Y=y.strstart>y.w_size-ue?y.strstart-(y.w_size-ue):0,ye=y.window,je=y.w_mask,ge=y.prev,Re=y.strstart+fe,Ve=ye[$+me-1],He=ye[$+me];y.prev_length>=y.good_match&&(D>>=2),se>y.lookahead&&(se=y.lookahead);do if(ye[(re=de)+me]===He&&ye[re+me-1]===Ve&&ye[re]===ye[$]&&ye[++re]===ye[$+1]){$+=2,re++;do;while(ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&ye[++$]===ye[++re]&&$<Re);if(L=fe-(Re-$),$=Re-fe,me<L){if(y.match_start=de,se<=(me=L))break;Ve=ye[$+me-1],He=ye[$+me]}}while((de=ge[de&je])>Y&&--D!=0);return me<=y.lookahead?me:y.lookahead}function Ce(y){var de,re,L,D,$,me,se,Y,ye,je,ge=y.w_size;do{if(D=y.window_size-y.lookahead-y.strstart,y.strstart>=ge+(ge-ue)){for(f.arraySet(y.window,y.window,ge,ge,0),y.match_start-=ge,y.strstart-=ge,y.block_start-=ge,de=re=y.hash_size;L=y.head[--de],y.head[de]=ge<=L?L-ge:0,--re;);for(de=re=ge;L=y.prev[--de],y.prev[de]=ge<=L?L-ge:0,--re;);D+=ge}if(y.strm.avail_in===0)break;if(me=y.strm,se=y.window,Y=y.strstart+y.lookahead,ye=D,je=void 0,je=me.avail_in,ye<je&&(je=ye),re=je===0?0:(me.avail_in-=je,f.arraySet(se,me.input,me.next_in,je,Y),me.state.wrap===1?me.adler=x(me.adler,se,je,Y):me.state.wrap===2&&(me.adler=b(me.adler,se,je,Y)),me.next_in+=je,me.total_in+=je,je),y.lookahead+=re,y.lookahead+y.insert>=F)for($=y.strstart-y.insert,y.ins_h=y.window[$],y.ins_h=(y.ins_h<<y.hash_shift^y.window[$+1])&y.hash_mask;y.insert&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[$+F-1])&y.hash_mask,y.prev[$&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=$,$++,y.insert--,!(y.lookahead+y.insert<F)););}while(y.lookahead<ue&&y.strm.avail_in!==0)}function Oe(y,de){for(var re,L;;){if(y.lookahead<ue){if(Ce(y),y.lookahead<ue&&de===j)return _;if(y.lookahead===0)break}if(re=0,y.lookahead>=F&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+F-1])&y.hash_mask,re=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),re!==0&&y.strstart-re<=y.w_size-ue&&(y.match_length=ce(y,re)),y.match_length>=F)if(L=p._tr_tally(y,y.strstart-y.match_start,y.match_length-F),y.lookahead-=y.match_length,y.match_length<=y.max_lazy_match&&y.lookahead>=F){for(y.match_length--;y.strstart++,y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+F-1])&y.hash_mask,re=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart,--y.match_length!=0;);y.strstart++}else y.strstart+=y.match_length,y.match_length=0,y.ins_h=y.window[y.strstart],y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+1])&y.hash_mask;else L=p._tr_tally(y,0,y.window[y.strstart]),y.lookahead--,y.strstart++;if(L&&(O(y,!1),y.strm.avail_out===0))return _}return y.insert=y.strstart<F-1?y.strstart:F-1,de===T?(O(y,!0),y.strm.avail_out===0?K:I):y.last_lit&&(O(y,!1),y.strm.avail_out===0)?_:ee}function Te(y,de){for(var re,L,D;;){if(y.lookahead<ue){if(Ce(y),y.lookahead<ue&&de===j)return _;if(y.lookahead===0)break}if(re=0,y.lookahead>=F&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+F-1])&y.hash_mask,re=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),y.prev_length=y.match_length,y.prev_match=y.match_start,y.match_length=F-1,re!==0&&y.prev_length<y.max_lazy_match&&y.strstart-re<=y.w_size-ue&&(y.match_length=ce(y,re),y.match_length<=5&&(y.strategy===1||y.match_length===F&&4096<y.strstart-y.match_start)&&(y.match_length=F-1)),y.prev_length>=F&&y.match_length<=y.prev_length){for(D=y.strstart+y.lookahead-F,L=p._tr_tally(y,y.strstart-1-y.prev_match,y.prev_length-F),y.lookahead-=y.prev_length-1,y.prev_length-=2;++y.strstart<=D&&(y.ins_h=(y.ins_h<<y.hash_shift^y.window[y.strstart+F-1])&y.hash_mask,re=y.prev[y.strstart&y.w_mask]=y.head[y.ins_h],y.head[y.ins_h]=y.strstart),--y.prev_length!=0;);if(y.match_available=0,y.match_length=F-1,y.strstart++,L&&(O(y,!1),y.strm.avail_out===0))return _}else if(y.match_available){if((L=p._tr_tally(y,0,y.window[y.strstart-1]))&&O(y,!1),y.strstart++,y.lookahead--,y.strm.avail_out===0)return _}else y.match_available=1,y.strstart++,y.lookahead--}return y.match_available&&(L=p._tr_tally(y,0,y.window[y.strstart-1]),y.match_available=0),y.insert=y.strstart<F-1?y.strstart:F-1,de===T?(O(y,!0),y.strm.avail_out===0?K:I):y.last_lit&&(O(y,!1),y.strm.avail_out===0)?_:ee}function ze(y,de,re,L,D){this.good_length=y,this.max_lazy=de,this.nice_length=re,this.max_chain=L,this.func=D}function Ye(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=E,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new f.Buf16(2*q),this.dyn_dtree=new f.Buf16(2*(2*M+1)),this.bl_tree=new f.Buf16(2*(2*Q+1)),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new f.Buf16(ne+1),this.heap=new f.Buf16(2*U+1),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new f.Buf16(2*U+1),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Fe(y){var de;return y&&y.state?(y.total_in=y.total_out=0,y.data_type=v,(de=y.state).pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?B:H,y.adler=de.wrap===2?0:1,de.last_flush=j,p._tr_init(de),S):we(y,N)}function Xe(y){var de=Fe(y);return de===S&&(function(re){re.window_size=2*re.w_size,he(re.head),re.max_lazy_match=d[re.level].max_lazy,re.good_match=d[re.level].good_length,re.nice_match=d[re.level].nice_length,re.max_chain_length=d[re.level].max_chain,re.strstart=0,re.block_start=0,re.lookahead=0,re.insert=0,re.match_length=re.prev_length=F-1,re.match_available=0,re.ins_h=0})(y.state),de}function mt(y,de,re,L,D,$){if(!y)return N;var me=1;if(de===m&&(de=6),L<0?(me=0,L=-L):15<L&&(me=2,L-=16),D<1||C<D||re!==E||L<8||15<L||de<0||9<de||$<0||w<$)return we(y,N);L===8&&(L=9);var se=new Ye;return(y.state=se).strm=y,se.wrap=me,se.gzhead=null,se.w_bits=L,se.w_size=1<<se.w_bits,se.w_mask=se.w_size-1,se.hash_bits=D+7,se.hash_size=1<<se.hash_bits,se.hash_mask=se.hash_size-1,se.hash_shift=~~((se.hash_bits+F-1)/F),se.window=new f.Buf8(2*se.w_size),se.head=new f.Buf16(se.hash_size),se.prev=new f.Buf16(se.w_size),se.lit_bufsize=1<<D+6,se.pending_buf_size=4*se.lit_bufsize,se.pending_buf=new f.Buf8(se.pending_buf_size),se.d_buf=1*se.lit_bufsize,se.l_buf=3*se.lit_bufsize,se.level=de,se.strategy=$,se.method=re,Xe(y)}d=[new ze(0,0,0,0,function(y,de){var re=65535;for(re>y.pending_buf_size-5&&(re=y.pending_buf_size-5);;){if(y.lookahead<=1){if(Ce(y),y.lookahead===0&&de===j)return _;if(y.lookahead===0)break}y.strstart+=y.lookahead,y.lookahead=0;var L=y.block_start+re;if((y.strstart===0||y.strstart>=L)&&(y.lookahead=y.strstart-L,y.strstart=L,O(y,!1),y.strm.avail_out===0)||y.strstart-y.block_start>=y.w_size-ue&&(O(y,!1),y.strm.avail_out===0))return _}return y.insert=0,de===T?(O(y,!0),y.strm.avail_out===0?K:I):(y.strstart>y.block_start&&(O(y,!1),y.strm.avail_out),_)}),new ze(4,4,8,4,Oe),new ze(4,5,16,8,Oe),new ze(4,6,32,32,Oe),new ze(4,4,16,16,Te),new ze(8,16,32,32,Te),new ze(8,16,128,128,Te),new ze(8,32,128,256,Te),new ze(32,128,258,1024,Te),new ze(32,258,258,4096,Te)],h.deflateInit=function(y,de){return mt(y,de,E,15,8,0)},h.deflateInit2=mt,h.deflateReset=Xe,h.deflateResetKeep=Fe,h.deflateSetHeader=function(y,de){return y&&y.state?y.state.wrap!==2?N:(y.state.gzhead=de,S):N},h.deflate=function(y,de){var re,L,D,$;if(!y||!y.state||5<de||de<0)return y?we(y,N):N;if(L=y.state,!y.output||!y.input&&y.avail_in!==0||L.status===666&&de!==T)return we(y,y.avail_out===0?-5:N);if(L.strm=y,re=L.last_flush,L.last_flush=de,L.status===B)if(L.wrap===2)y.adler=0,P(L,31),P(L,139),P(L,8),L.gzhead?(P(L,(L.gzhead.text?1:0)+(L.gzhead.hcrc?2:0)+(L.gzhead.extra?4:0)+(L.gzhead.name?8:0)+(L.gzhead.comment?16:0)),P(L,255&L.gzhead.time),P(L,L.gzhead.time>>8&255),P(L,L.gzhead.time>>16&255),P(L,L.gzhead.time>>24&255),P(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),P(L,255&L.gzhead.os),L.gzhead.extra&&L.gzhead.extra.length&&(P(L,255&L.gzhead.extra.length),P(L,L.gzhead.extra.length>>8&255)),L.gzhead.hcrc&&(y.adler=b(y.adler,L.pending_buf,L.pending,0)),L.gzindex=0,L.status=69):(P(L,0),P(L,0),P(L,0),P(L,0),P(L,0),P(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),P(L,3),L.status=H);else{var me=E+(L.w_bits-8<<4)<<8;me|=(2<=L.strategy||L.level<2?0:L.level<6?1:L.level===6?2:3)<<6,L.strstart!==0&&(me|=32),me+=31-me%31,L.status=H,W(L,me),L.strstart!==0&&(W(L,y.adler>>>16),W(L,65535&y.adler)),y.adler=1}if(L.status===69)if(L.gzhead.extra){for(D=L.pending;L.gzindex<(65535&L.gzhead.extra.length)&&(L.pending!==L.pending_buf_size||(L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),A(y),D=L.pending,L.pending!==L.pending_buf_size));)P(L,255&L.gzhead.extra[L.gzindex]),L.gzindex++;L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),L.gzindex===L.gzhead.extra.length&&(L.gzindex=0,L.status=73)}else L.status=73;if(L.status===73)if(L.gzhead.name){D=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),A(y),D=L.pending,L.pending===L.pending_buf_size)){$=1;break}$=L.gzindex<L.gzhead.name.length?255&L.gzhead.name.charCodeAt(L.gzindex++):0,P(L,$)}while($!==0);L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),$===0&&(L.gzindex=0,L.status=91)}else L.status=91;if(L.status===91)if(L.gzhead.comment){D=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),A(y),D=L.pending,L.pending===L.pending_buf_size)){$=1;break}$=L.gzindex<L.gzhead.comment.length?255&L.gzhead.comment.charCodeAt(L.gzindex++):0,P(L,$)}while($!==0);L.gzhead.hcrc&&L.pending>D&&(y.adler=b(y.adler,L.pending_buf,L.pending-D,D)),$===0&&(L.status=103)}else L.status=103;if(L.status===103&&(L.gzhead.hcrc?(L.pending+2>L.pending_buf_size&&A(y),L.pending+2<=L.pending_buf_size&&(P(L,255&y.adler),P(L,y.adler>>8&255),y.adler=0,L.status=H)):L.status=H),L.pending!==0){if(A(y),y.avail_out===0)return L.last_flush=-1,S}else if(y.avail_in===0&&G(de)<=G(re)&&de!==T)return we(y,-5);if(L.status===666&&y.avail_in!==0)return we(y,-5);if(y.avail_in!==0||L.lookahead!==0||de!==j&&L.status!==666){var se=L.strategy===2?(function(Y,ye){for(var je;;){if(Y.lookahead===0&&(Ce(Y),Y.lookahead===0)){if(ye===j)return _;break}if(Y.match_length=0,je=p._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++,je&&(O(Y,!1),Y.strm.avail_out===0))return _}return Y.insert=0,ye===T?(O(Y,!0),Y.strm.avail_out===0?K:I):Y.last_lit&&(O(Y,!1),Y.strm.avail_out===0)?_:ee})(L,de):L.strategy===3?(function(Y,ye){for(var je,ge,Re,Ve,He=Y.window;;){if(Y.lookahead<=fe){if(Ce(Y),Y.lookahead<=fe&&ye===j)return _;if(Y.lookahead===0)break}if(Y.match_length=0,Y.lookahead>=F&&0<Y.strstart&&(ge=He[Re=Y.strstart-1])===He[++Re]&&ge===He[++Re]&&ge===He[++Re]){Ve=Y.strstart+fe;do;while(ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&ge===He[++Re]&&Re<Ve);Y.match_length=fe-(Ve-Re),Y.match_length>Y.lookahead&&(Y.match_length=Y.lookahead)}if(Y.match_length>=F?(je=p._tr_tally(Y,1,Y.match_length-F),Y.lookahead-=Y.match_length,Y.strstart+=Y.match_length,Y.match_length=0):(je=p._tr_tally(Y,0,Y.window[Y.strstart]),Y.lookahead--,Y.strstart++),je&&(O(Y,!1),Y.strm.avail_out===0))return _}return Y.insert=0,ye===T?(O(Y,!0),Y.strm.avail_out===0?K:I):Y.last_lit&&(O(Y,!1),Y.strm.avail_out===0)?_:ee})(L,de):d[L.level].func(L,de);if(se!==K&&se!==I||(L.status=666),se===_||se===K)return y.avail_out===0&&(L.last_flush=-1),S;if(se===ee&&(de===1?p._tr_align(L):de!==5&&(p._tr_stored_block(L,0,0,!1),de===3&&(he(L.head),L.lookahead===0&&(L.strstart=0,L.block_start=0,L.insert=0))),A(y),y.avail_out===0))return L.last_flush=-1,S}return de!==T?S:L.wrap<=0?1:(L.wrap===2?(P(L,255&y.adler),P(L,y.adler>>8&255),P(L,y.adler>>16&255),P(L,y.adler>>24&255),P(L,255&y.total_in),P(L,y.total_in>>8&255),P(L,y.total_in>>16&255),P(L,y.total_in>>24&255)):(W(L,y.adler>>>16),W(L,65535&y.adler)),A(y),0<L.wrap&&(L.wrap=-L.wrap),L.pending!==0?S:1)},h.deflateEnd=function(y){var de;return y&&y.state?(de=y.state.status)!==B&&de!==69&&de!==73&&de!==91&&de!==103&&de!==H&&de!==666?we(y,N):(y.state=null,de===H?we(y,-3):S):N},h.deflateSetDictionary=function(y,de){var re,L,D,$,me,se,Y,ye,je=de.length;if(!y||!y.state||($=(re=y.state).wrap)===2||$===1&&re.status!==B||re.lookahead)return N;for($===1&&(y.adler=x(y.adler,de,je,0)),re.wrap=0,je>=re.w_size&&($===0&&(he(re.head),re.strstart=0,re.block_start=0,re.insert=0),ye=new f.Buf8(re.w_size),f.arraySet(ye,de,je-re.w_size,re.w_size,0),de=ye,je=re.w_size),me=y.avail_in,se=y.next_in,Y=y.input,y.avail_in=je,y.next_in=0,y.input=de,Ce(re);re.lookahead>=F;){for(L=re.strstart,D=re.lookahead-(F-1);re.ins_h=(re.ins_h<<re.hash_shift^re.window[L+F-1])&re.hash_mask,re.prev[L&re.w_mask]=re.head[re.ins_h],re.head[re.ins_h]=L,L++,--D;);re.strstart=L,re.lookahead=F-1,Ce(re)}return re.strstart+=re.lookahead,re.block_start=re.strstart,re.insert=re.lookahead,re.lookahead=0,re.match_length=re.prev_length=F-1,re.match_available=0,y.next_in=se,y.input=Y,y.avail_in=me,re.wrap=$,S},h.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,c,h){c.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(o,c,h){c.exports=function(d,f){var p,x,b,k,j,T,S,N,m,w,v,E,C,U,M,Q,q,ne,F,fe,ue,B,H,_,ee;p=d.state,x=d.next_in,_=d.input,b=x+(d.avail_in-5),k=d.next_out,ee=d.output,j=k-(f-d.avail_out),T=k+(d.avail_out-257),S=p.dmax,N=p.wsize,m=p.whave,w=p.wnext,v=p.window,E=p.hold,C=p.bits,U=p.lencode,M=p.distcode,Q=(1<<p.lenbits)-1,q=(1<<p.distbits)-1;e:do{C<15&&(E+=_[x++]<<C,C+=8,E+=_[x++]<<C,C+=8),ne=U[E&Q];t:for(;;){if(E>>>=F=ne>>>24,C-=F,(F=ne>>>16&255)===0)ee[k++]=65535&ne;else{if(!(16&F)){if((64&F)==0){ne=U[(65535&ne)+(E&(1<<F)-1)];continue t}if(32&F){p.mode=12;break e}d.msg="invalid literal/length code",p.mode=30;break e}fe=65535&ne,(F&=15)&&(C<F&&(E+=_[x++]<<C,C+=8),fe+=E&(1<<F)-1,E>>>=F,C-=F),C<15&&(E+=_[x++]<<C,C+=8,E+=_[x++]<<C,C+=8),ne=M[E&q];a:for(;;){if(E>>>=F=ne>>>24,C-=F,!(16&(F=ne>>>16&255))){if((64&F)==0){ne=M[(65535&ne)+(E&(1<<F)-1)];continue a}d.msg="invalid distance code",p.mode=30;break e}if(ue=65535&ne,C<(F&=15)&&(E+=_[x++]<<C,(C+=8)<F&&(E+=_[x++]<<C,C+=8)),S<(ue+=E&(1<<F)-1)){d.msg="invalid distance too far back",p.mode=30;break e}if(E>>>=F,C-=F,(F=k-j)<ue){if(m<(F=ue-F)&&p.sane){d.msg="invalid distance too far back",p.mode=30;break e}if(H=v,(B=0)===w){if(B+=N-F,F<fe){for(fe-=F;ee[k++]=v[B++],--F;);B=k-ue,H=ee}}else if(w<F){if(B+=N+w-F,(F-=w)<fe){for(fe-=F;ee[k++]=v[B++],--F;);if(B=0,w<fe){for(fe-=F=w;ee[k++]=v[B++],--F;);B=k-ue,H=ee}}}else if(B+=w-F,F<fe){for(fe-=F;ee[k++]=v[B++],--F;);B=k-ue,H=ee}for(;2<fe;)ee[k++]=H[B++],ee[k++]=H[B++],ee[k++]=H[B++],fe-=3;fe&&(ee[k++]=H[B++],1<fe&&(ee[k++]=H[B++]))}else{for(B=k-ue;ee[k++]=ee[B++],ee[k++]=ee[B++],ee[k++]=ee[B++],2<(fe-=3););fe&&(ee[k++]=ee[B++],1<fe&&(ee[k++]=ee[B++]))}break}}break}}while(x<b&&k<T);x-=fe=C>>3,E&=(1<<(C-=fe<<3))-1,d.next_in=x,d.next_out=k,d.avail_in=x<b?b-x+5:5-(x-b),d.avail_out=k<T?T-k+257:257-(k-T),p.hold=E,p.bits=C}},{}],49:[function(o,c,h){var d=o("../utils/common"),f=o("./adler32"),p=o("./crc32"),x=o("./inffast"),b=o("./inftrees"),k=1,j=2,T=0,S=-2,N=1,m=852,w=592;function v(B){return(B>>>24&255)+(B>>>8&65280)+((65280&B)<<8)+((255&B)<<24)}function E(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new d.Buf16(320),this.work=new d.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function C(B){var H;return B&&B.state?(H=B.state,B.total_in=B.total_out=H.total=0,B.msg="",H.wrap&&(B.adler=1&H.wrap),H.mode=N,H.last=0,H.havedict=0,H.dmax=32768,H.head=null,H.hold=0,H.bits=0,H.lencode=H.lendyn=new d.Buf32(m),H.distcode=H.distdyn=new d.Buf32(w),H.sane=1,H.back=-1,T):S}function U(B){var H;return B&&B.state?((H=B.state).wsize=0,H.whave=0,H.wnext=0,C(B)):S}function M(B,H){var _,ee;return B&&B.state?(ee=B.state,H<0?(_=0,H=-H):(_=1+(H>>4),H<48&&(H&=15)),H&&(H<8||15<H)?S:(ee.window!==null&&ee.wbits!==H&&(ee.window=null),ee.wrap=_,ee.wbits=H,U(B))):S}function Q(B,H){var _,ee;return B?(ee=new E,(B.state=ee).window=null,(_=M(B,H))!==T&&(B.state=null),_):S}var q,ne,F=!0;function fe(B){if(F){var H;for(q=new d.Buf32(512),ne=new d.Buf32(32),H=0;H<144;)B.lens[H++]=8;for(;H<256;)B.lens[H++]=9;for(;H<280;)B.lens[H++]=7;for(;H<288;)B.lens[H++]=8;for(b(k,B.lens,0,288,q,0,B.work,{bits:9}),H=0;H<32;)B.lens[H++]=5;b(j,B.lens,0,32,ne,0,B.work,{bits:5}),F=!1}B.lencode=q,B.lenbits=9,B.distcode=ne,B.distbits=5}function ue(B,H,_,ee){var K,I=B.state;return I.window===null&&(I.wsize=1<<I.wbits,I.wnext=0,I.whave=0,I.window=new d.Buf8(I.wsize)),ee>=I.wsize?(d.arraySet(I.window,H,_-I.wsize,I.wsize,0),I.wnext=0,I.whave=I.wsize):(ee<(K=I.wsize-I.wnext)&&(K=ee),d.arraySet(I.window,H,_-ee,K,I.wnext),(ee-=K)?(d.arraySet(I.window,H,_-ee,ee,0),I.wnext=ee,I.whave=I.wsize):(I.wnext+=K,I.wnext===I.wsize&&(I.wnext=0),I.whave<I.wsize&&(I.whave+=K))),0}h.inflateReset=U,h.inflateReset2=M,h.inflateResetKeep=C,h.inflateInit=function(B){return Q(B,15)},h.inflateInit2=Q,h.inflate=function(B,H){var _,ee,K,I,we,G,he,A,O,P,W,ce,Ce,Oe,Te,ze,Ye,Fe,Xe,mt,y,de,re,L,D=0,$=new d.Buf8(4),me=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!B||!B.state||!B.output||!B.input&&B.avail_in!==0)return S;(_=B.state).mode===12&&(_.mode=13),we=B.next_out,K=B.output,he=B.avail_out,I=B.next_in,ee=B.input,G=B.avail_in,A=_.hold,O=_.bits,P=G,W=he,de=T;e:for(;;)switch(_.mode){case N:if(_.wrap===0){_.mode=13;break}for(;O<16;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(2&_.wrap&&A===35615){$[_.check=0]=255&A,$[1]=A>>>8&255,_.check=p(_.check,$,2,0),O=A=0,_.mode=2;break}if(_.flags=0,_.head&&(_.head.done=!1),!(1&_.wrap)||(((255&A)<<8)+(A>>8))%31){B.msg="incorrect header check",_.mode=30;break}if((15&A)!=8){B.msg="unknown compression method",_.mode=30;break}if(O-=4,y=8+(15&(A>>>=4)),_.wbits===0)_.wbits=y;else if(y>_.wbits){B.msg="invalid window size",_.mode=30;break}_.dmax=1<<y,B.adler=_.check=1,_.mode=512&A?10:12,O=A=0;break;case 2:for(;O<16;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(_.flags=A,(255&_.flags)!=8){B.msg="unknown compression method",_.mode=30;break}if(57344&_.flags){B.msg="unknown header flags set",_.mode=30;break}_.head&&(_.head.text=A>>8&1),512&_.flags&&($[0]=255&A,$[1]=A>>>8&255,_.check=p(_.check,$,2,0)),O=A=0,_.mode=3;case 3:for(;O<32;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.head&&(_.head.time=A),512&_.flags&&($[0]=255&A,$[1]=A>>>8&255,$[2]=A>>>16&255,$[3]=A>>>24&255,_.check=p(_.check,$,4,0)),O=A=0,_.mode=4;case 4:for(;O<16;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.head&&(_.head.xflags=255&A,_.head.os=A>>8),512&_.flags&&($[0]=255&A,$[1]=A>>>8&255,_.check=p(_.check,$,2,0)),O=A=0,_.mode=5;case 5:if(1024&_.flags){for(;O<16;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.length=A,_.head&&(_.head.extra_len=A),512&_.flags&&($[0]=255&A,$[1]=A>>>8&255,_.check=p(_.check,$,2,0)),O=A=0}else _.head&&(_.head.extra=null);_.mode=6;case 6:if(1024&_.flags&&(G<(ce=_.length)&&(ce=G),ce&&(_.head&&(y=_.head.extra_len-_.length,_.head.extra||(_.head.extra=new Array(_.head.extra_len)),d.arraySet(_.head.extra,ee,I,ce,y)),512&_.flags&&(_.check=p(_.check,ee,ce,I)),G-=ce,I+=ce,_.length-=ce),_.length))break e;_.length=0,_.mode=7;case 7:if(2048&_.flags){if(G===0)break e;for(ce=0;y=ee[I+ce++],_.head&&y&&_.length<65536&&(_.head.name+=String.fromCharCode(y)),y&&ce<G;);if(512&_.flags&&(_.check=p(_.check,ee,ce,I)),G-=ce,I+=ce,y)break e}else _.head&&(_.head.name=null);_.length=0,_.mode=8;case 8:if(4096&_.flags){if(G===0)break e;for(ce=0;y=ee[I+ce++],_.head&&y&&_.length<65536&&(_.head.comment+=String.fromCharCode(y)),y&&ce<G;);if(512&_.flags&&(_.check=p(_.check,ee,ce,I)),G-=ce,I+=ce,y)break e}else _.head&&(_.head.comment=null);_.mode=9;case 9:if(512&_.flags){for(;O<16;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(A!==(65535&_.check)){B.msg="header crc mismatch",_.mode=30;break}O=A=0}_.head&&(_.head.hcrc=_.flags>>9&1,_.head.done=!0),B.adler=_.check=0,_.mode=12;break;case 10:for(;O<32;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}B.adler=_.check=v(A),O=A=0,_.mode=11;case 11:if(_.havedict===0)return B.next_out=we,B.avail_out=he,B.next_in=I,B.avail_in=G,_.hold=A,_.bits=O,2;B.adler=_.check=1,_.mode=12;case 12:if(H===5||H===6)break e;case 13:if(_.last){A>>>=7&O,O-=7&O,_.mode=27;break}for(;O<3;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}switch(_.last=1&A,O-=1,3&(A>>>=1)){case 0:_.mode=14;break;case 1:if(fe(_),_.mode=20,H!==6)break;A>>>=2,O-=2;break e;case 2:_.mode=17;break;case 3:B.msg="invalid block type",_.mode=30}A>>>=2,O-=2;break;case 14:for(A>>>=7&O,O-=7&O;O<32;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if((65535&A)!=(A>>>16^65535)){B.msg="invalid stored block lengths",_.mode=30;break}if(_.length=65535&A,O=A=0,_.mode=15,H===6)break e;case 15:_.mode=16;case 16:if(ce=_.length){if(G<ce&&(ce=G),he<ce&&(ce=he),ce===0)break e;d.arraySet(K,ee,I,ce,we),G-=ce,I+=ce,he-=ce,we+=ce,_.length-=ce;break}_.mode=12;break;case 17:for(;O<14;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(_.nlen=257+(31&A),A>>>=5,O-=5,_.ndist=1+(31&A),A>>>=5,O-=5,_.ncode=4+(15&A),A>>>=4,O-=4,286<_.nlen||30<_.ndist){B.msg="too many length or distance symbols",_.mode=30;break}_.have=0,_.mode=18;case 18:for(;_.have<_.ncode;){for(;O<3;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.lens[me[_.have++]]=7&A,A>>>=3,O-=3}for(;_.have<19;)_.lens[me[_.have++]]=0;if(_.lencode=_.lendyn,_.lenbits=7,re={bits:_.lenbits},de=b(0,_.lens,0,19,_.lencode,0,_.work,re),_.lenbits=re.bits,de){B.msg="invalid code lengths set",_.mode=30;break}_.have=0,_.mode=19;case 19:for(;_.have<_.nlen+_.ndist;){for(;ze=(D=_.lencode[A&(1<<_.lenbits)-1])>>>16&255,Ye=65535&D,!((Te=D>>>24)<=O);){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(Ye<16)A>>>=Te,O-=Te,_.lens[_.have++]=Ye;else{if(Ye===16){for(L=Te+2;O<L;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(A>>>=Te,O-=Te,_.have===0){B.msg="invalid bit length repeat",_.mode=30;break}y=_.lens[_.have-1],ce=3+(3&A),A>>>=2,O-=2}else if(Ye===17){for(L=Te+3;O<L;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}O-=Te,y=0,ce=3+(7&(A>>>=Te)),A>>>=3,O-=3}else{for(L=Te+7;O<L;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}O-=Te,y=0,ce=11+(127&(A>>>=Te)),A>>>=7,O-=7}if(_.have+ce>_.nlen+_.ndist){B.msg="invalid bit length repeat",_.mode=30;break}for(;ce--;)_.lens[_.have++]=y}}if(_.mode===30)break;if(_.lens[256]===0){B.msg="invalid code -- missing end-of-block",_.mode=30;break}if(_.lenbits=9,re={bits:_.lenbits},de=b(k,_.lens,0,_.nlen,_.lencode,0,_.work,re),_.lenbits=re.bits,de){B.msg="invalid literal/lengths set",_.mode=30;break}if(_.distbits=6,_.distcode=_.distdyn,re={bits:_.distbits},de=b(j,_.lens,_.nlen,_.ndist,_.distcode,0,_.work,re),_.distbits=re.bits,de){B.msg="invalid distances set",_.mode=30;break}if(_.mode=20,H===6)break e;case 20:_.mode=21;case 21:if(6<=G&&258<=he){B.next_out=we,B.avail_out=he,B.next_in=I,B.avail_in=G,_.hold=A,_.bits=O,x(B,W),we=B.next_out,K=B.output,he=B.avail_out,I=B.next_in,ee=B.input,G=B.avail_in,A=_.hold,O=_.bits,_.mode===12&&(_.back=-1);break}for(_.back=0;ze=(D=_.lencode[A&(1<<_.lenbits)-1])>>>16&255,Ye=65535&D,!((Te=D>>>24)<=O);){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(ze&&(240&ze)==0){for(Fe=Te,Xe=ze,mt=Ye;ze=(D=_.lencode[mt+((A&(1<<Fe+Xe)-1)>>Fe)])>>>16&255,Ye=65535&D,!(Fe+(Te=D>>>24)<=O);){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}A>>>=Fe,O-=Fe,_.back+=Fe}if(A>>>=Te,O-=Te,_.back+=Te,_.length=Ye,ze===0){_.mode=26;break}if(32&ze){_.back=-1,_.mode=12;break}if(64&ze){B.msg="invalid literal/length code",_.mode=30;break}_.extra=15&ze,_.mode=22;case 22:if(_.extra){for(L=_.extra;O<L;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.length+=A&(1<<_.extra)-1,A>>>=_.extra,O-=_.extra,_.back+=_.extra}_.was=_.length,_.mode=23;case 23:for(;ze=(D=_.distcode[A&(1<<_.distbits)-1])>>>16&255,Ye=65535&D,!((Te=D>>>24)<=O);){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if((240&ze)==0){for(Fe=Te,Xe=ze,mt=Ye;ze=(D=_.distcode[mt+((A&(1<<Fe+Xe)-1)>>Fe)])>>>16&255,Ye=65535&D,!(Fe+(Te=D>>>24)<=O);){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}A>>>=Fe,O-=Fe,_.back+=Fe}if(A>>>=Te,O-=Te,_.back+=Te,64&ze){B.msg="invalid distance code",_.mode=30;break}_.offset=Ye,_.extra=15&ze,_.mode=24;case 24:if(_.extra){for(L=_.extra;O<L;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}_.offset+=A&(1<<_.extra)-1,A>>>=_.extra,O-=_.extra,_.back+=_.extra}if(_.offset>_.dmax){B.msg="invalid distance too far back",_.mode=30;break}_.mode=25;case 25:if(he===0)break e;if(ce=W-he,_.offset>ce){if((ce=_.offset-ce)>_.whave&&_.sane){B.msg="invalid distance too far back",_.mode=30;break}Ce=ce>_.wnext?(ce-=_.wnext,_.wsize-ce):_.wnext-ce,ce>_.length&&(ce=_.length),Oe=_.window}else Oe=K,Ce=we-_.offset,ce=_.length;for(he<ce&&(ce=he),he-=ce,_.length-=ce;K[we++]=Oe[Ce++],--ce;);_.length===0&&(_.mode=21);break;case 26:if(he===0)break e;K[we++]=_.length,he--,_.mode=21;break;case 27:if(_.wrap){for(;O<32;){if(G===0)break e;G--,A|=ee[I++]<<O,O+=8}if(W-=he,B.total_out+=W,_.total+=W,W&&(B.adler=_.check=_.flags?p(_.check,K,W,we-W):f(_.check,K,W,we-W)),W=he,(_.flags?A:v(A))!==_.check){B.msg="incorrect data check",_.mode=30;break}O=A=0}_.mode=28;case 28:if(_.wrap&&_.flags){for(;O<32;){if(G===0)break e;G--,A+=ee[I++]<<O,O+=8}if(A!==(4294967295&_.total)){B.msg="incorrect length check",_.mode=30;break}O=A=0}_.mode=29;case 29:de=1;break e;case 30:de=-3;break e;case 31:return-4;default:return S}return B.next_out=we,B.avail_out=he,B.next_in=I,B.avail_in=G,_.hold=A,_.bits=O,(_.wsize||W!==B.avail_out&&_.mode<30&&(_.mode<27||H!==4))&&ue(B,B.output,B.next_out,W-B.avail_out)?(_.mode=31,-4):(P-=B.avail_in,W-=B.avail_out,B.total_in+=P,B.total_out+=W,_.total+=W,_.wrap&&W&&(B.adler=_.check=_.flags?p(_.check,K,W,B.next_out-W):f(_.check,K,W,B.next_out-W)),B.data_type=_.bits+(_.last?64:0)+(_.mode===12?128:0)+(_.mode===20||_.mode===15?256:0),(P==0&&W===0||H===4)&&de===T&&(de=-5),de)},h.inflateEnd=function(B){if(!B||!B.state)return S;var H=B.state;return H.window&&(H.window=null),B.state=null,T},h.inflateGetHeader=function(B,H){var _;return B&&B.state?(2&(_=B.state).wrap)==0?S:((_.head=H).done=!1,T):S},h.inflateSetDictionary=function(B,H){var _,ee=H.length;return B&&B.state?(_=B.state).wrap!==0&&_.mode!==11?S:_.mode===11&&f(1,H,ee,0)!==_.check?-3:ue(B,H,ee,ee)?(_.mode=31,-4):(_.havedict=1,T):S},h.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,c,h){var d=o("../utils/common"),f=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],p=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],x=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],b=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];c.exports=function(k,j,T,S,N,m,w,v){var E,C,U,M,Q,q,ne,F,fe,ue=v.bits,B=0,H=0,_=0,ee=0,K=0,I=0,we=0,G=0,he=0,A=0,O=null,P=0,W=new d.Buf16(16),ce=new d.Buf16(16),Ce=null,Oe=0;for(B=0;B<=15;B++)W[B]=0;for(H=0;H<S;H++)W[j[T+H]]++;for(K=ue,ee=15;1<=ee&&W[ee]===0;ee--);if(ee<K&&(K=ee),ee===0)return N[m++]=20971520,N[m++]=20971520,v.bits=1,0;for(_=1;_<ee&&W[_]===0;_++);for(K<_&&(K=_),B=G=1;B<=15;B++)if(G<<=1,(G-=W[B])<0)return-1;if(0<G&&(k===0||ee!==1))return-1;for(ce[1]=0,B=1;B<15;B++)ce[B+1]=ce[B]+W[B];for(H=0;H<S;H++)j[T+H]!==0&&(w[ce[j[T+H]]++]=H);if(q=k===0?(O=Ce=w,19):k===1?(O=f,P-=257,Ce=p,Oe-=257,256):(O=x,Ce=b,-1),B=_,Q=m,we=H=A=0,U=-1,M=(he=1<<(I=K))-1,k===1&&852<he||k===2&&592<he)return 1;for(;;){for(ne=B-we,fe=w[H]<q?(F=0,w[H]):w[H]>q?(F=Ce[Oe+w[H]],O[P+w[H]]):(F=96,0),E=1<<B-we,_=C=1<<I;N[Q+(A>>we)+(C-=E)]=ne<<24|F<<16|fe|0,C!==0;);for(E=1<<B-1;A&E;)E>>=1;if(E!==0?(A&=E-1,A+=E):A=0,H++,--W[B]==0){if(B===ee)break;B=j[T+w[H]]}if(K<B&&(A&M)!==U){for(we===0&&(we=K),Q+=_,G=1<<(I=B-we);I+we<ee&&!((G-=W[I+we])<=0);)I++,G<<=1;if(he+=1<<I,k===1&&852<he||k===2&&592<he)return 1;N[U=A&M]=K<<24|I<<16|Q-m|0}}return A!==0&&(N[Q+A]=B-we<<24|64<<16|0),v.bits=K,0}},{"../utils/common":41}],51:[function(o,c,h){c.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(o,c,h){var d=o("../utils/common"),f=0,p=1;function x(D){for(var $=D.length;0<=--$;)D[$]=0}var b=0,k=29,j=256,T=j+1+k,S=30,N=19,m=2*T+1,w=15,v=16,E=7,C=256,U=16,M=17,Q=18,q=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],ne=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],F=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],fe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ue=new Array(2*(T+2));x(ue);var B=new Array(2*S);x(B);var H=new Array(512);x(H);var _=new Array(256);x(_);var ee=new Array(k);x(ee);var K,I,we,G=new Array(S);function he(D,$,me,se,Y){this.static_tree=D,this.extra_bits=$,this.extra_base=me,this.elems=se,this.max_length=Y,this.has_stree=D&&D.length}function A(D,$){this.dyn_tree=D,this.max_code=0,this.stat_desc=$}function O(D){return D<256?H[D]:H[256+(D>>>7)]}function P(D,$){D.pending_buf[D.pending++]=255&$,D.pending_buf[D.pending++]=$>>>8&255}function W(D,$,me){D.bi_valid>v-me?(D.bi_buf|=$<<D.bi_valid&65535,P(D,D.bi_buf),D.bi_buf=$>>v-D.bi_valid,D.bi_valid+=me-v):(D.bi_buf|=$<<D.bi_valid&65535,D.bi_valid+=me)}function ce(D,$,me){W(D,me[2*$],me[2*$+1])}function Ce(D,$){for(var me=0;me|=1&D,D>>>=1,me<<=1,0<--$;);return me>>>1}function Oe(D,$,me){var se,Y,ye=new Array(w+1),je=0;for(se=1;se<=w;se++)ye[se]=je=je+me[se-1]<<1;for(Y=0;Y<=$;Y++){var ge=D[2*Y+1];ge!==0&&(D[2*Y]=Ce(ye[ge]++,ge))}}function Te(D){var $;for($=0;$<T;$++)D.dyn_ltree[2*$]=0;for($=0;$<S;$++)D.dyn_dtree[2*$]=0;for($=0;$<N;$++)D.bl_tree[2*$]=0;D.dyn_ltree[2*C]=1,D.opt_len=D.static_len=0,D.last_lit=D.matches=0}function ze(D){8<D.bi_valid?P(D,D.bi_buf):0<D.bi_valid&&(D.pending_buf[D.pending++]=D.bi_buf),D.bi_buf=0,D.bi_valid=0}function Ye(D,$,me,se){var Y=2*$,ye=2*me;return D[Y]<D[ye]||D[Y]===D[ye]&&se[$]<=se[me]}function Fe(D,$,me){for(var se=D.heap[me],Y=me<<1;Y<=D.heap_len&&(Y<D.heap_len&&Ye($,D.heap[Y+1],D.heap[Y],D.depth)&&Y++,!Ye($,se,D.heap[Y],D.depth));)D.heap[me]=D.heap[Y],me=Y,Y<<=1;D.heap[me]=se}function Xe(D,$,me){var se,Y,ye,je,ge=0;if(D.last_lit!==0)for(;se=D.pending_buf[D.d_buf+2*ge]<<8|D.pending_buf[D.d_buf+2*ge+1],Y=D.pending_buf[D.l_buf+ge],ge++,se===0?ce(D,Y,$):(ce(D,(ye=_[Y])+j+1,$),(je=q[ye])!==0&&W(D,Y-=ee[ye],je),ce(D,ye=O(--se),me),(je=ne[ye])!==0&&W(D,se-=G[ye],je)),ge<D.last_lit;);ce(D,C,$)}function mt(D,$){var me,se,Y,ye=$.dyn_tree,je=$.stat_desc.static_tree,ge=$.stat_desc.has_stree,Re=$.stat_desc.elems,Ve=-1;for(D.heap_len=0,D.heap_max=m,me=0;me<Re;me++)ye[2*me]!==0?(D.heap[++D.heap_len]=Ve=me,D.depth[me]=0):ye[2*me+1]=0;for(;D.heap_len<2;)ye[2*(Y=D.heap[++D.heap_len]=Ve<2?++Ve:0)]=1,D.depth[Y]=0,D.opt_len--,ge&&(D.static_len-=je[2*Y+1]);for($.max_code=Ve,me=D.heap_len>>1;1<=me;me--)Fe(D,ye,me);for(Y=Re;me=D.heap[1],D.heap[1]=D.heap[D.heap_len--],Fe(D,ye,1),se=D.heap[1],D.heap[--D.heap_max]=me,D.heap[--D.heap_max]=se,ye[2*Y]=ye[2*me]+ye[2*se],D.depth[Y]=(D.depth[me]>=D.depth[se]?D.depth[me]:D.depth[se])+1,ye[2*me+1]=ye[2*se+1]=Y,D.heap[1]=Y++,Fe(D,ye,1),2<=D.heap_len;);D.heap[--D.heap_max]=D.heap[1],(function(He,st){var Bt,ht,Wt,We,xt,Xt,it=st.dyn_tree,Ka=st.max_code,ka=st.stat_desc.static_tree,Za=st.stat_desc.has_stree,oa=st.stat_desc.extra_bits,ga=st.stat_desc.extra_base,rt=st.stat_desc.max_length,wt=0;for(We=0;We<=w;We++)He.bl_count[We]=0;for(it[2*He.heap[He.heap_max]+1]=0,Bt=He.heap_max+1;Bt<m;Bt++)rt<(We=it[2*it[2*(ht=He.heap[Bt])+1]+1]+1)&&(We=rt,wt++),it[2*ht+1]=We,Ka<ht||(He.bl_count[We]++,xt=0,ga<=ht&&(xt=oa[ht-ga]),Xt=it[2*ht],He.opt_len+=Xt*(We+xt),Za&&(He.static_len+=Xt*(ka[2*ht+1]+xt)));if(wt!==0){do{for(We=rt-1;He.bl_count[We]===0;)We--;He.bl_count[We]--,He.bl_count[We+1]+=2,He.bl_count[rt]--,wt-=2}while(0<wt);for(We=rt;We!==0;We--)for(ht=He.bl_count[We];ht!==0;)Ka<(Wt=He.heap[--Bt])||(it[2*Wt+1]!==We&&(He.opt_len+=(We-it[2*Wt+1])*it[2*Wt],it[2*Wt+1]=We),ht--)}})(D,$),Oe(ye,Ve,D.bl_count)}function y(D,$,me){var se,Y,ye=-1,je=$[1],ge=0,Re=7,Ve=4;for(je===0&&(Re=138,Ve=3),$[2*(me+1)+1]=65535,se=0;se<=me;se++)Y=je,je=$[2*(se+1)+1],++ge<Re&&Y===je||(ge<Ve?D.bl_tree[2*Y]+=ge:Y!==0?(Y!==ye&&D.bl_tree[2*Y]++,D.bl_tree[2*U]++):ge<=10?D.bl_tree[2*M]++:D.bl_tree[2*Q]++,ye=Y,Ve=(ge=0)===je?(Re=138,3):Y===je?(Re=6,3):(Re=7,4))}function de(D,$,me){var se,Y,ye=-1,je=$[1],ge=0,Re=7,Ve=4;for(je===0&&(Re=138,Ve=3),se=0;se<=me;se++)if(Y=je,je=$[2*(se+1)+1],!(++ge<Re&&Y===je)){if(ge<Ve)for(;ce(D,Y,D.bl_tree),--ge!=0;);else Y!==0?(Y!==ye&&(ce(D,Y,D.bl_tree),ge--),ce(D,U,D.bl_tree),W(D,ge-3,2)):ge<=10?(ce(D,M,D.bl_tree),W(D,ge-3,3)):(ce(D,Q,D.bl_tree),W(D,ge-11,7));ye=Y,Ve=(ge=0)===je?(Re=138,3):Y===je?(Re=6,3):(Re=7,4)}}x(G);var re=!1;function L(D,$,me,se){W(D,(b<<1)+(se?1:0),3),(function(Y,ye,je,ge){ze(Y),P(Y,je),P(Y,~je),d.arraySet(Y.pending_buf,Y.window,ye,je,Y.pending),Y.pending+=je})(D,$,me)}h._tr_init=function(D){re||((function(){var $,me,se,Y,ye,je=new Array(w+1);for(Y=se=0;Y<k-1;Y++)for(ee[Y]=se,$=0;$<1<<q[Y];$++)_[se++]=Y;for(_[se-1]=Y,Y=ye=0;Y<16;Y++)for(G[Y]=ye,$=0;$<1<<ne[Y];$++)H[ye++]=Y;for(ye>>=7;Y<S;Y++)for(G[Y]=ye<<7,$=0;$<1<<ne[Y]-7;$++)H[256+ye++]=Y;for(me=0;me<=w;me++)je[me]=0;for($=0;$<=143;)ue[2*$+1]=8,$++,je[8]++;for(;$<=255;)ue[2*$+1]=9,$++,je[9]++;for(;$<=279;)ue[2*$+1]=7,$++,je[7]++;for(;$<=287;)ue[2*$+1]=8,$++,je[8]++;for(Oe(ue,T+1,je),$=0;$<S;$++)B[2*$+1]=5,B[2*$]=Ce($,5);K=new he(ue,q,j+1,T,w),I=new he(B,ne,0,S,w),we=new he(new Array(0),F,0,N,E)})(),re=!0),D.l_desc=new A(D.dyn_ltree,K),D.d_desc=new A(D.dyn_dtree,I),D.bl_desc=new A(D.bl_tree,we),D.bi_buf=0,D.bi_valid=0,Te(D)},h._tr_stored_block=L,h._tr_flush_block=function(D,$,me,se){var Y,ye,je=0;0<D.level?(D.strm.data_type===2&&(D.strm.data_type=(function(ge){var Re,Ve=4093624447;for(Re=0;Re<=31;Re++,Ve>>>=1)if(1&Ve&&ge.dyn_ltree[2*Re]!==0)return f;if(ge.dyn_ltree[18]!==0||ge.dyn_ltree[20]!==0||ge.dyn_ltree[26]!==0)return p;for(Re=32;Re<j;Re++)if(ge.dyn_ltree[2*Re]!==0)return p;return f})(D)),mt(D,D.l_desc),mt(D,D.d_desc),je=(function(ge){var Re;for(y(ge,ge.dyn_ltree,ge.l_desc.max_code),y(ge,ge.dyn_dtree,ge.d_desc.max_code),mt(ge,ge.bl_desc),Re=N-1;3<=Re&&ge.bl_tree[2*fe[Re]+1]===0;Re--);return ge.opt_len+=3*(Re+1)+5+5+4,Re})(D),Y=D.opt_len+3+7>>>3,(ye=D.static_len+3+7>>>3)<=Y&&(Y=ye)):Y=ye=me+5,me+4<=Y&&$!==-1?L(D,$,me,se):D.strategy===4||ye===Y?(W(D,2+(se?1:0),3),Xe(D,ue,B)):(W(D,4+(se?1:0),3),(function(ge,Re,Ve,He){var st;for(W(ge,Re-257,5),W(ge,Ve-1,5),W(ge,He-4,4),st=0;st<He;st++)W(ge,ge.bl_tree[2*fe[st]+1],3);de(ge,ge.dyn_ltree,Re-1),de(ge,ge.dyn_dtree,Ve-1)})(D,D.l_desc.max_code+1,D.d_desc.max_code+1,je+1),Xe(D,D.dyn_ltree,D.dyn_dtree)),Te(D),se&&ze(D)},h._tr_tally=function(D,$,me){return D.pending_buf[D.d_buf+2*D.last_lit]=$>>>8&255,D.pending_buf[D.d_buf+2*D.last_lit+1]=255&$,D.pending_buf[D.l_buf+D.last_lit]=255&me,D.last_lit++,$===0?D.dyn_ltree[2*me]++:(D.matches++,$--,D.dyn_ltree[2*(_[me]+j+1)]++,D.dyn_dtree[2*O($)]++),D.last_lit===D.lit_bufsize-1},h._tr_align=function(D){W(D,2,3),ce(D,C,ue),(function($){$.bi_valid===16?(P($,$.bi_buf),$.bi_buf=0,$.bi_valid=0):8<=$.bi_valid&&($.pending_buf[$.pending++]=255&$.bi_buf,$.bi_buf>>=8,$.bi_valid-=8)})(D)}},{"../utils/common":41}],53:[function(o,c,h){c.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(o,c,h){(function(d){(function(f,p){if(!f.setImmediate){var x,b,k,j,T=1,S={},N=!1,m=f.document,w=Object.getPrototypeOf&&Object.getPrototypeOf(f);w=w&&w.setTimeout?w:f,x={}.toString.call(f.process)==="[object process]"?function(U){process.nextTick(function(){E(U)})}:(function(){if(f.postMessage&&!f.importScripts){var U=!0,M=f.onmessage;return f.onmessage=function(){U=!1},f.postMessage("","*"),f.onmessage=M,U}})()?(j="setImmediate$"+Math.random()+"$",f.addEventListener?f.addEventListener("message",C,!1):f.attachEvent("onmessage",C),function(U){f.postMessage(j+U,"*")}):f.MessageChannel?((k=new MessageChannel).port1.onmessage=function(U){E(U.data)},function(U){k.port2.postMessage(U)}):m&&"onreadystatechange"in m.createElement("script")?(b=m.documentElement,function(U){var M=m.createElement("script");M.onreadystatechange=function(){E(U),M.onreadystatechange=null,b.removeChild(M),M=null},b.appendChild(M)}):function(U){setTimeout(E,0,U)},w.setImmediate=function(U){typeof U!="function"&&(U=new Function(""+U));for(var M=new Array(arguments.length-1),Q=0;Q<M.length;Q++)M[Q]=arguments[Q+1];var q={callback:U,args:M};return S[T]=q,x(T),T++},w.clearImmediate=v}function v(U){delete S[U]}function E(U){if(N)setTimeout(E,0,U);else{var M=S[U];if(M){N=!0;try{(function(Q){var q=Q.callback,ne=Q.args;switch(ne.length){case 0:q();break;case 1:q(ne[0]);break;case 2:q(ne[0],ne[1]);break;case 3:q(ne[0],ne[1],ne[2]);break;default:q.apply(p,ne)}})(M)}finally{v(U),N=!1}}}}function C(U){U.source===f&&typeof U.data=="string"&&U.data.indexOf(j)===0&&E(+U.data.slice(j.length))}})(typeof self>"u"?d===void 0?this:d:self)}).call(this,typeof nr<"u"?nr:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Hc)),Hc.exports}var bb=gb();const yb=Fc(bb),vb=l=>{switch(l.split(".").pop()?.toLowerCase()||""){case"pdf":return"picture_as_pdf";case"csv":case"xls":case"xlsx":return"table_view";case"png":case"jpg":case"jpeg":case"gif":case"svg":return"image";case"txt":case"md":return"description";case"json":return"data_object";case"zip":case"tar":case"gz":return"folder_zip";default:return"insert_drive_file"}},sr=6e4,qc=200,fp=200,Yi=1e6,Yc=2e3,Vc=2e3,wb=360,Qp=12,rr=wb+Qp,Sb=4,_b=4,jb=({index:l,style:u,data:o})=>{const c=o[l];return c?s.jsx("div",{style:{...u,paddingBottom:Qp},children:s.jsx(Ip,{capture:c})}):null},Nb=l=>`${(l/(1024*1024)).toFixed(2)} MB`,Eb=l=>{if(typeof l=="boolean")return l;if(typeof l=="string"){const u=l.trim().toLowerCase();if(u==="true")return!0;if(u==="false")return!1}return null},or=(l,u)=>l.length<=u?{text:l,truncated:!1}:{text:l.slice(0,u),truncated:!0},Cb=l=>!l||l.data===void 0||l.data===null?{reason:"No data to copy."}:{raw:l.data},cr=(l,u,o)=>l.length<=u?l:(o.push(`first ${u.toLocaleString()} chars`),l.slice(0,u)),kb=l=>{const u=[];if(typeof l=="string")return{text:cr(l,Yi,u),truncated:u.length>0,reason:u.join(", ")};if(Array.isArray(l)){let c=l;l.length>Yc&&(c=l.slice(0,Yc),u.push(`first ${Yc.toLocaleString()} items`));let h="";try{h=JSON.stringify(c,null,2)}catch{h=String(c)}return h=cr(h,Yi,u),{text:h,truncated:u.length>0,reason:u.join(", ")}}if(l&&typeof l=="object"){let c=l;const h=Object.keys(l);h.length>Vc&&(c=h.slice(0,Vc).reduce((f,p)=>(f[p]=l[p],f),{}),u.push(`first ${Vc.toLocaleString()} keys`));let d="";try{d=JSON.stringify(c,null,2)}catch{d=String(c)}return d=cr(d,Yi,u),{text:d,truncated:u.length>0,reason:u.join(", ")}}return{text:cr(String(l),Yi,u),truncated:u.length>0,reason:u.join(", ")}},Ab=l=>{if(typeof l=="string")return l;try{return JSON.stringify(l,null,2)}catch{return String(l)}},hp=l=>{if(!l||l.data===void 0||l.data===null||l.data==="")return{text:"",truncated:!1,language:"plain"};const u=l.data;if(typeof u=="string"){const c=u.trim(),h=c.startsWith("<")&&c.includes(">")?"html":c.startsWith("{")||c.startsWith("[")?"json":"plain",d=or(u,sr);return{text:d.text,truncated:d.truncated,language:h}}if(Array.isArray(u)){const c=u.length>qc?u.slice(0,qc):u,h=JSON.stringify(c,null,2),d=or(h,sr);return{text:d.text,truncated:d.truncated||u.length>qc,language:"json"}}if(u&&typeof u=="object"){const c=Object.keys(u);let h=u,d=!1;c.length>fp&&(d=!0,h=c.slice(0,fp).reduce((x,b)=>(x[b]=u[b],x),{}));const f=JSON.stringify(h,null,2),p=or(f,sr);return{text:p.text,truncated:p.truncated||d,language:"json"}}const o=or(String(u),sr);return{text:o.text,truncated:o.truncated,language:"plain"}},zb=l=>{const u=[];let o=[],c="",h=!1;for(let d=0;d<l.length;d+=1){const f=l[d];h?f==='"'?l[d+1]==='"'?(c+='"',d+=1):h=!1:c+=f:f==='"'?h=!0:f===","?(o.push(c),c=""):f===`
13
- `?(o.push(c),u.push(o),o=[],c=""):f==="\r"||(c+=f)}return o.push(c),(o.length>1||o[0]!==""||u.length>0)&&u.push(o),u},Tb=l=>{if(!l)return null;if(typeof l=="string"){const u=l.trim();if(!u.includes(",")||!u.includes(`
14
- `))return null;const o=zb(u).filter(d=>d.some(f=>String(f||"").trim()!==""));if(o.length<2)return null;const c=o[0].map((d,f)=>String(d||"").trim()||`column_${f+1}`),h=o.slice(1);return c.length<2?null:{headers:c,rows:h}}if(Array.isArray(l)){if(l.length===0)return null;if(l.every(u=>u&&typeof u=="object"&&!Array.isArray(u))){const u=[];if(l.forEach(c=>{Object.keys(c).forEach(h=>{u.includes(h)||u.push(h)})}),u.length===0)return null;const o=l.map(c=>u.map(h=>c[h]??""));return{headers:u,rows:o}}if(l.every(u=>Array.isArray(u))){const u=Math.max(...l.map(c=>c.length));return{headers:Array.from({length:u},(c,h)=>`column_${h+1}`),rows:l}}return null}if(l&&typeof l=="object"){const u=Object.keys(l);return u.length===0?null:{headers:u,rows:[u.map(o=>l[o]??"")]}}return null},Rb=(l,u)=>l==null?null:typeof l=="string"?u?{content:l,mime:"text/csv",ext:"csv"}:{content:l,mime:"application/json",ext:"json"}:{content:JSON.stringify(l,null,2),mime:"application/json",ext:"json"},Ob=(l,u,o)=>{const c=new Blob([u],{type:o}),h=URL.createObjectURL(c),d=document.createElement("a");d.href=h,d.download=l,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(h)},Db=({results:l,pinnedResults:u,isExecuting:o,isHeadful:c,runId:h,onConfirm:d,onNotify:f,onPin:p,onUnpin:x,fullWidth:b,useNovnc:k})=>{const[j,T]=z.useState(null),[S,N]=z.useState("raw"),[m,w]=z.useState("data"),[v,E]=z.useState(()=>u&&!l?"pinned":"latest"),C=z.useMemo(()=>k===null?"checking":k?"novnc":"native",[k]),[U,M]=z.useState(!1),[Q,q]=z.useState(!1),[ne,F]=z.useState([]),fe=z.useRef(null),ue=v==="pinned"&&u?u:l,B=z.useMemo(()=>Tb(ue?.data),[ue?.data]),H=z.useMemo(()=>ue&&ue.data!==void 0&&ue.data!==null&&ue.data!==""?hp(ue):null,[ue]),_=z.useMemo(()=>ue?.screenshotUrl?`${ue.screenshotUrl}${v==="latest"?`?t=${Date.now()}`:""}`:null,[ue,v]),ee=G=>{const he=Eb(G);return he!==null?he?s.jsx(Ne,{name:"check",className:"text-xs text-blue-400"}):"":G??""},K=async()=>{q(!0);try{const G=h?`?runId=${encodeURIComponent(h)}`:"",he=await fetch(`/api/data/captures${G}`),A=he.ok?await he.json():{captures:[]};F(Array.isArray(A.captures)?A.captures:[])}catch{F([])}finally{q(!1)}};z.useEffect(()=>{N(B?"table":"raw"),!ue?.downloads||ue.downloads.length===0?w("data"):ue?.data||w("downloads")},[ue]),z.useEffect(()=>{if(l){E("latest");return}u&&E("pinned")},[l,u]),z.useEffect(()=>{!u&&v==="pinned"&&E("latest")},[u,v]);const I=async(G,he,A)=>{if(!G){f("Nothing to copy.","error");return}let O=G;try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(O);else{const P=document.createElement("textarea");P.value=O,P.style.position="fixed",P.style.left="-999999px",P.style.top="-999999px",document.body.appendChild(P),P.focus(),P.select(),document.execCommand("copy"),P.remove()}T(he),setTimeout(()=>T(null),2e3),A?.truncatedNotice?f("Copied truncated data.","success"):O.length!==G.length&&f("Copied a truncated preview.","success")}catch(P){console.error("Copy failed:",P),f("Copy failed.","error")}};if(c&&v==="latest"){const{origin:G,hostname:he}=window.location,A=`${G}/novnc.html?host=${he}&path=websockify`,O=()=>{const P=fe.current;if(P){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}P.requestFullscreen?.().catch(()=>{})}};return C==="native"?s.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex flex-col items-center justify-center p-8 text-center gap-4",children:[s.jsx("div",{className:"text-[12px] font-bold uppercase tracking-widest text-white",children:"Headful Session Active"}),s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-amber-500/80 max-w-lg leading-relaxed",children:"Figranium is not optimized for native browser windows. Please install the proper tools for stability (Xvfb, x11vnc, websockify) or simply use the Docker version."})]}):C==="checking"?s.jsx("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex items-center justify-center",children:s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-500",children:"Checking headful viewer..."})}):s.jsxs("div",{ref:fe,className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative",children:[s.jsx("button",{type:"button",onClick:O,className:"absolute top-4 right-4 z-10 px-3 py-2 rounded-xl border border-white/20 bg-black/40 text-[9px] font-bold uppercase tracking-widest text-white/80 hover:bg-black/60 transition-all",title:"Toggle fullscreen",children:"Fullscreen"}),s.jsx("iframe",{src:A,className:"absolute inset-0 w-full h-full",title:"Headful Browser"})]})}if(!ue&&!(o&&v==="latest"))return s.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-4 opacity-20",children:[s.jsx("div",{className:"w-16 h-16 border border-white/10 rounded-full flex items-center justify-center",children:s.jsx(Ne,{name:"terminal",className:"text-2xl text-white"})}),s.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.3em]",children:"Ready"})]});const we=b?"space-y-12 relative z-10 w-full":"space-y-12 relative z-10 max-w-5xl mx-auto";return s.jsxs("div",{className:we,children:[s.jsxs("div",{className:"flex items-end justify-between border-b border-white/5 pb-10",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Preview"}),s.jsx("h2",{className:"text-xl font-mono text-white truncate max-w-xl tracking-tight italic",children:ue?.finalUrl||ue?.url||""})]}),s.jsx("div",{className:`px-4 py-2 rounded-xl text-[9px] font-bold uppercase tracking-[0.2em] ${v==="pinned"?"bg-amber-500/10 text-amber-300":o?"bg-blue-500/10 text-blue-400 animate-pulse":"bg-green-500/10 text-green-400"}`,children:v==="pinned"?"Pinned":o?"Running":"Finished"})]}),s.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-8",children:[s.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden flex flex-col min-h-[400px]",children:[s.jsxs("div",{className:"p-6 border-b border-white/5 flex items-center justify-between text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:[s.jsx("span",{children:"Screenshot"}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-white/20",children:ue?.timestamp||"--:--:--"}),s.jsx("button",{type:"button",onClick:()=>{M(!0),K()},className:"px-3 py-2 rounded-xl border border-white/10 text-[8px] font-bold uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all",children:"View All Captures"})]})]}),s.jsx("div",{className:"relative bg-black flex-1 flex items-center justify-center overflow-hidden",children:_?s.jsx("img",{src:_,className:"absolute inset-0 w-full h-full object-contain transition-opacity duration-1000"}):s.jsx("div",{className:"text-[8px] font-bold text-white/5 uppercase tracking-widest",children:"Waiting for Frame..."})})]}),s.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col h-[400px]",children:[s.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest mb-6 border-b border-white/5 pb-4",children:"Activity Log"}),s.jsxs("div",{className:"flex-1 font-mono text-[10px] text-gray-400 space-y-2 overflow-y-auto custom-scrollbar pr-2",children:[ue?.logs?.map((G,he)=>s.jsxs("div",{className:"flex gap-2",children:[s.jsx("span",{className:"text-white/10 shrink-0",children:"›"})," ",s.jsx("span",{children:G})]},he)),o&&v==="latest"&&(!ue?.logs||ue?.logs.length===0)&&s.jsx("div",{className:"animate-pulse",children:"Connecting to kernel..."})]})]})]}),U&&s.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 flex items-center justify-center p-6",children:s.jsxs("div",{className:"glass-card rounded-[32px] w-full max-w-5xl max-h-[85vh] overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-widest",children:"Captures"}),s.jsx("div",{className:"text-sm font-bold text-white",children:"Recordings and Screenshots"})]}),s.jsx("button",{onClick:()=>M(!1),className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all bg-white/5 border-white/10 text-white hover:bg-white/10",children:"Close"})]}),s.jsxs("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:[Q&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!Q&&ne.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!Q&&ne.length>0&&s.jsx(yr,{height:Math.min(Math.max(rr,ne.length*rr),rr*Sb),width:"100%",itemCount:ne.length,itemSize:rr,overscanCount:_b,itemData:ne,className:"custom-scrollbar",children:jb})]})]})}),s.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col relative",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[s.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:m==="downloads"?"Downloads":"Data"}),s.jsxs("div",{className:"flex items-center gap-2",children:[ue?.downloads&&ue.downloads.length>0&&s.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["data","downloads"].map(G=>s.jsx("button",{onClick:()=>w(G),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${m===G?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:G},G))}),u&&s.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["latest","pinned"].map(G=>s.jsx("button",{onClick:()=>E(G),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${v===G?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:G},G))}),B&&m==="data"&&s.jsx("div",{className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["table","raw"].map(G=>s.jsx("button",{onClick:()=>N(G),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all ${S===G?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:G},G))}),v==="pinned"?s.jsx("button",{onClick:()=>{x?.(),E("latest")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-amber-200 hover:bg-white/10",title:"Unpin data",children:"Unpin"}):s.jsx("button",{onClick:()=>{if(!ue){f("No data to pin.","error");return}p?.(ue),E("pinned")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Pin data",children:u?"Update Pin":"Pin"}),m==="data"&&s.jsx("button",{onClick:()=>{const G=Rb(ue?.data,B);if(!G){f("No data to export.","error");return}const he=`doppelganger-data-${new Date().toISOString().replace(/[:.]/g,"-")}.${G.ext}`;Ob(he,G.content,G.mime),f(`Exported ${G.ext.toUpperCase()}.`,"success")},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:"Export extracted data",children:"Export"}),m==="downloads"&&s.jsxs("button",{onClick:async()=>{if(!(!ue?.downloads||ue.downloads.length===0)){if(ue.downloads.length===1){const G=ue.downloads[0],he=document.createElement("a");he.href=G.path,he.download=G.name,document.body.appendChild(he),he.click(),he.remove(),f(`Downloading ${G.name}`,"success");return}f("Generating ZIP...","success");try{const G=new yb;for(const P of ue.downloads){const ce=await(await fetch(P.path)).blob();G.file(P.name,ce)}const he=await G.generateAsync({type:"blob"}),A=URL.createObjectURL(he),O=document.createElement("a");O.href=A,O.download=`doppelganger-downloads-${new Date().toISOString().replace(/[:.]/g,"-")}.zip`,document.body.appendChild(O),O.click(),O.remove(),URL.revokeObjectURL(A)}catch(G){console.error("Failed to zip files:",G),f("Failed to zip files.","error")}}},className:"px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 bg-white/5 border-white/10 text-white hover:bg-white/10",title:ue?.downloads?.length===1?"Download File":"Download ZIP",children:[s.jsx(Ne,{name:"folder_zip",className:"text-[14px]"}),ue?.downloads?.length===1?"Download":"Download ZIP"]}),m==="data"&&s.jsxs("button",{onClick:async()=>{const G=Cb(ue);if(G.reason){f(G.reason||"Data too large to copy safely.","error");return}const he=hp(ue);let O=Ab(G.raw),P=!1;he.truncated&&(await d({message:"Preview is truncated for performance.",confirmLabel:"Copy full",cancelLabel:"Copy preview"})||(O=he.text||"",P=!0)),O.length>Yi&&(await d({message:`Copying ${Nb(O.length)} may freeze your browser.`,confirmLabel:"Copy full",cancelLabel:P?"Copy preview":"Copy truncated"})||(O=kb(G.raw).text,P=!0)),I(O,"data",{skipSizeConfirm:!0,truncatedNotice:P})},className:`px-3 py-2 border text-[9px] font-bold rounded-xl uppercase transition-all flex items-center gap-2 ${j==="data"?"bg-green-500/10 border-green-500/20 text-green-400":"bg-white/5 border-white/10 text-white hover:bg-white/10"}`,title:"Copy extracted data",children:[j==="data"?s.jsx(Ne,{name:"check",className:"text-sm"}):s.jsx(Ne,{name:"content_copy",className:"text-sm"}),j==="data"?"Copied":"Copy"]})]})]}),H?.truncated&&s.jsx("button",{type:"button",onClick:()=>f("Preview truncated for performance.","error"),className:"absolute top-5 right-5 h-2.5 w-2.5 rounded-full bg-amber-400 shadow-[0_0_8px_rgba(251,191,36,0.6)]",title:"Preview truncated","aria-label":"Preview truncated"}),s.jsx("div",{className:"max-h-[70vh] overflow-y-auto custom-scrollbar pr-2 relative",children:(()=>{const G=ue&&ue.data!==void 0&&ue.data!==null&&ue.data!=="",he=ue&&ue.downloads&&ue.downloads.length>0;return o&&v==="latest"&&(!ue||!G&&!he)?s.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"Buffering data stream..."}):!ue||!G&&!he?s.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"No data available."}):s.jsx("div",{className:"h-full",children:m==="downloads"?s.jsx("div",{className:"space-y-2",children:ue.downloads.map((A,O)=>s.jsxs("div",{className:"flex items-center justify-between bg-white/[0.02] border border-white/5 rounded-xl p-4 hover:bg-white/[0.04] transition-colors",children:[s.jsxs("div",{className:"flex items-center gap-4 overflow-hidden pr-4",children:[s.jsx("div",{className:"p-3 bg-white/5 rounded-lg border border-white/10 shrink-0",children:s.jsx(Ne,{name:vb(A.name),className:"text-2xl text-white/70"})}),s.jsxs("div",{className:"min-w-0",children:[s.jsx("h4",{className:"text-sm font-bold text-white truncate",children:A.name}),s.jsx("p",{className:"text-[10px] text-gray-500 truncate mt-1",children:A.url})]})]}),s.jsx("a",{href:A.path,download:A.name,className:"shrink-0 p-3 rounded-lg border border-white/10 bg-white/5 text-white/80 hover:bg-white/10 hover:text-white transition-all flex items-center justify-center",title:"Download file","aria-label":"Download file",children:s.jsx(Ne,{name:"download",className:"text-[18px]"})})]},O))}):B&&S==="table"?s.jsx("div",{className:"overflow-auto custom-scrollbar rounded-2xl border border-white/10",children:s.jsxs("table",{className:"min-w-full table-auto text-[10px] text-left text-white/80 font-mono",children:[s.jsx("thead",{className:"bg-white/5 text-[9px] uppercase tracking-widest text-white/50",children:s.jsx("tr",{children:B.headers.map(A=>s.jsx("th",{className:"px-3 py-2 border-b border-white/10 whitespace-nowrap",children:A},A))})}),s.jsx("tbody",{children:B.rows.map((A,O)=>s.jsx("tr",{className:"odd:bg-white/[0.02]",children:B.headers.map((P,W)=>s.jsx("td",{className:"px-3 py-2 border-b border-white/5 align-top whitespace-normal break-words",children:ee(A[W])},`${O}-${W}`))},O))})]})}):s.jsx(Gi,{readOnly:!0,value:H?.text||"",language:H?.language||"plain"})})})()})]})]})},$p=z.memo(Db),Mb=[{value:"Control",label:"Ctrl"},{value:"Shift",label:"Shift"},{value:"Alt",label:"Alt"},{value:"Meta",label:"Meta"}],Ub=["Enter","Tab","Escape","Space","Backspace","Delete","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5"].concat([...Array(10)].map((l,u)=>`${u}`)).concat(Array.from({length:26},(l,u)=>String.fromCharCode(65+u))),Bb=[{value:"replace",label:"Replace Text"},{value:"append",label:"Append Text"}],Lb=l=>{if(!l)return{modifiers:[],baseKey:""};const u=l.split("+"),o=u.pop()||"";return{modifiers:u,baseKey:o}},pp=(l,u)=>[...l.filter(Boolean),u].filter(Boolean).join("+"),mp=l=>{const u=(l||"").trim(),o=u.match(/^\{\$([\w.]+)\}$/);return o?o[1]:u},Hn={string:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"contains",label:"Contains"},{value:"starts_with",label:"Starts with"},{value:"ends_with",label:"Ends with"},{value:"matches",label:"Matches regex"}],number:[{value:"equals",label:"Equals"},{value:"not_equals",label:"Not equal"},{value:"gt",label:"Greater than"},{value:"gte",label:"Greater or equal"},{value:"lt",label:"Less than"},{value:"lte",label:"Less or equal"}],boolean:[{value:"is_true",label:"Is true"},{value:"is_false",label:"Is false"}]},xp=z.memo(({action:l,index:u,status:o,isDragging:c,isDragOver:h,translateY:d,variables:f,availableTasks:p,onUpdate:x,onAutoSave:b,onOpenPalette:k,onOpenContextMenu:j,onPointerDown:T,dragTransformY:S,onGenerateSelector:N,isSelected:m})=>{const[w,v]=z.useState(!1),[E,C]=z.useState(""),[U,M]=z.useState(!1),Q=z.useRef(null),[q,ne]=z.useState(!1);z.useEffect(()=>{const H=_=>{Q.current&&!Q.current.contains(_.target)&&v(!1)};return w&&document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[w]);const F=o==="running"?"border-yellow-400/60":o==="success"?"border-green-400/60":o==="error"?"border-red-400/70":o==="skipped"?"border-gray-500/40":"",fe=H=>{const _="text-[12px]";return H==="if"||H==="else"?s.jsx(Ne,{name:"call_split",className:`${_} text-white`}):H==="end"?s.jsx(Ne,{name:"subdirectory_arrow_right",className:`${_} text-gray-500`}):H==="while"||H==="repeat"?s.jsx(Ne,{name:"repeat",className:`${_} text-white`}):H==="foreach"?s.jsx(Ne,{name:"list",className:`${_} text-white`}):H==="on_error"?s.jsx(Ne,{name:"warning",className:`${_} text-red-400`}):H==="set"?s.jsx(Ne,{name:"data_object",className:`${_} text-white`}):H==="stop"?s.jsx(Ne,{name:"stop",className:`${_} text-white`}):H==="click"?s.jsx(Ne,{name:"ads_click",className:`${_} text-white`}):H==="type"?s.jsx(Ne,{name:"text_format",className:`${_} text-white`}):H==="hover"?s.jsx(Ne,{name:"my_location",className:`${_} text-white`}):H==="press"?s.jsx(Ne,{name:"keyboard",className:`${_} text-white`}):H==="wait"?s.jsx(Ne,{name:"schedule",className:`${_} text-white`}):H==="wait_selector"?s.jsx(Ne,{name:"schedule",className:`${_} text-white`}):H==="scroll"?s.jsx(Ne,{name:"swap_vert",className:`${_} text-white`}):H==="javascript"?s.jsx(Ne,{name:"code",className:`${_} text-white`}):H==="csv"?s.jsx(Ne,{name:"table_chart",className:`${_} text-white`}):H==="merge"?s.jsx(Ne,{name:"layers",className:`${_} text-white`}):H==="screenshot"?s.jsx(Ne,{name:"photo_camera",className:`${_} text-white`}):H==="start"?s.jsx(Ne,{name:"play_circle",className:`${_} text-white`}):H==="navigate"?s.jsx(Ne,{name:"navigation",className:`${_} text-white`}):s.jsx("span",{className:"text-[9px] text-white/20",children:"|"})},ue=H=>!H||!(H instanceof HTMLElement)?!1:!!H.closest('input, textarea, select, button, a, [contenteditable="true"], [data-no-drag="true"]'),B=c?`translateY(${S||0}px)`:d?`translateY(${d}px)`:void 0;return s.jsxs("div",{id:`action-${l.id}`,"data-action-id":l.id,onPointerDown:H=>{ue(H.target)||H.button===0&&(H.preventDefault(),T(H,l.id,u))},onContextMenu:H=>j(H,l.id),className:`bg-black min-w-[280px] w-full max-w-sm mx-auto border p-5 rounded-2xl space-y-4 group/item relative transition-[transform,box-shadow,opacity,filter,background-color,border-color] duration-150 ease-[cubic-bezier(0.22,1,0.36,1)] will-change-transform select-none touch-none ${F||(m?"border-blue-500 ring-2 ring-blue-500/50":"border-white/20")} ${c?"ring-2 ring-white/40 scale-[1.02] shadow-[0_30px_80px_rgba(0,0,0,0.45)] opacity-85 z-20 mx-auto":""} ${h&&!c?"ring-2 ring-blue-400/60 bg-blue-500/5":""} ${l.disabled?"opacity-40 grayscale":""}`,style:{transform:B,zIndex:w?40:void 0},children:[s.jsxs("div",{className:"flex items-center justify-between cursor-pointer",onClick:()=>ne(!q),children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"text-[8px] font-bold text-white/20 font-mono tracking-tighter",children:(u+1).toString().padStart(2,"0")}),s.jsx("div",{className:"w-4 h-4 flex items-center justify-center",children:fe(l.type)}),s.jsx("button",{onClick:H=>{H.stopPropagation(),k(l.id)},className:"action-type-select text-[10px] font-bold uppercase tracking-[0.2em] text-white focus:outline-none cursor-pointer rounded focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Change action type: ${l.type}`,children:Xc.find(H=>H.type===l.type)?.label||l.type})]}),s.jsx("div",{className:"flex items-center gap-2",children:s.jsx(Ne,{name:q?"expand_less":"expand_more",className:"text-base text-gray-600"})})]}),q&&s.jsxs(s.Fragment,{children:[(l.type==="click"||l.type==="type"||l.type==="hover"||l.type==="wait_selector"||l.type==="scroll")&&s.jsxs("div",{className:"space-y-1.5 relative",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1 block",children:l.type==="scroll"?"Selector (Optional)":"Selector"}),w&&s.jsxs("div",{ref:Q,className:"absolute right-0 top-6 z-30 w-64 bg-[#111] border border-white/10 rounded-xl shadow-2xl p-3 space-y-2",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-[8px] font-bold text-gray-400 uppercase tracking-widest block",children:"Describe Element"}),s.jsx("button",{onClick:()=>v(!1),className:"text-gray-500 hover:text-white transition-colors p-1 -mr-1",title:"Close","aria-label":"Close",children:s.jsx(Ne,{name:"close",className:"text-[12px]"})})]}),s.jsx("input",{autoFocus:!0,value:E,onChange:H=>C(H.target.value),onKeyDown:async H=>{if(H.key==="Enter"&&E.trim()&&!U&&N){M(!0);try{await N(l.id,E),v(!1),C("")}finally{M(!1)}}},disabled:U,placeholder:"e.g. The green submit button",className:"w-full bg-white/5 border border-white/10 rounded-lg px-2 py-1.5 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-purple-500/50 transition-colors disabled:opacity-50"}),s.jsx("div",{className:"flex justify-end pt-1",children:s.jsxs("button",{onClick:async()=>{if(E.trim()&&!U&&N){M(!0);try{await N(l.id,E),v(!1),C("")}finally{M(!1)}}},disabled:U||!E.trim(),className:"bg-purple-500/20 text-purple-300 hover:bg-purple-500/30 px-3 py-1 rounded border border-purple-500/30 text-[9px] font-bold uppercase tracking-widest transition-colors disabled:opacity-50 flex items-center gap-1",children:[U?s.jsx("div",{className:"w-2.5 h-2.5 border border-purple-300/30 border-t-purple-300 rounded-full animate-spin"}):s.jsx(Ne,{name:"search",className:"text-[10px]"}),"Find"]})})]}),s.jsxs("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all flex items-center gap-2 relative",children:[s.jsx("div",{className:"flex-1 min-w-0",children:s.jsx(Ea,{value:l.selector||"",onChange:H=>x(l.id,{selector:H}),onBlur:()=>b(),variables:f,placeholder:l.type==="scroll"?".scroll-container or leave empty":".btn-primary"})}),N&&s.jsx("button",{onClick:()=>v(!w),disabled:l.disabled,className:"text-purple-400 hover:text-purple-300 transition-colors focus:outline-none flex items-center justify-center opacity-50 hover:opacity-100 shrink-0 disabled:opacity-20 disabled:hover:opacity-20 disabled:cursor-not-allowed",title:"AI Selector Finder",children:s.jsx(Ne,{name:"auto_awesome",className:"text-lg"})})]})]}),l.type==="scroll"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Scroll Speed (ms)"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.key||"",onChange:H=>x(l.id,{key:H}),onBlur:()=>b(),variables:f,placeholder:"500"})})]}),(l.type==="navigate"||l.type==="type"||l.type==="wait"||l.type==="wait_selector"||l.type==="javascript"||l.type==="csv")&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:l.type==="navigate"?"URL":l.type==="type"?"Content":l.type==="wait"?"Seconds":l.type==="wait_selector"?"Timeout (Sec)":l.type==="csv"?"CSV Input":"Script"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:l.type==="javascript"?s.jsx(Gi,{value:l.value||"",onChange:H=>x(l.id,{value:H}),onBlur:()=>b(),language:"javascript",variables:f,className:"min-h-[120px]",placeholder:"return document.title"}):l.type==="csv"?s.jsx(Gi,{value:l.value||"",onChange:H=>x(l.id,{value:H}),onBlur:()=>b(),language:"plain",variables:f,className:"min-h-[120px]",placeholder:"name,age\\nAda,31"}):s.jsx(Ea,{value:l.value||"",onChange:H=>x(l.id,{value:H}),onBlur:()=>b(),variables:f,placeholder:l.type==="navigate"?"https://example.com":l.type==="type"?"Search keywords":l.type==="wait"?"3":l.type==="wait_selector"?"10":"400"})}),l.type==="type"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Mode"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx("select",{value:l.typeMode||"replace",onChange:H=>{x(l.id,{typeMode:H.target.value},!0)},className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:Bb.map(H=>s.jsx("option",{value:H.value,children:H.label},H.value))})})]})]}),l.type==="screenshot"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Label (Optional)"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.value||"",onChange:H=>x(l.id,{value:H}),onBlur:()=>b(),variables:f,placeholder:"checkout-step"})})]}),l.type==="press"&&(()=>{const{modifiers:H,baseKey:_}=Lb(l.key);return s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Key"}),s.jsx("div",{className:"grid grid-cols-2 gap-1 text-[10px] text-white",children:Mb.map(ee=>s.jsxs("label",{className:"inline-flex items-center space-x-1",children:[s.jsx("input",{type:"checkbox",checked:H.includes(ee.value),onChange:K=>{const I=K.target.checked?[...H,ee.value]:H.filter(we=>we!==ee.value);x(l.id,{key:pp(I,_)},!0)},className:"h-3 w-3 rounded border border-white/30 bg-black/80"}),s.jsx("span",{className:"uppercase text-[9px] text-white/70",children:ee.label})]},ee.value))}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsxs("select",{value:_,onChange:ee=>x(l.id,{key:pp(H,ee.target.value)},!0),className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:[s.jsx("option",{value:"",children:"Select key"}),Ub.map(ee=>s.jsx("option",{value:ee,children:ee},ee))]})})]})})(),l.type==="if"&&(()=>{const H=Object.keys(f||{}),_=mp(l.conditionVar||""),ee=_&&f?.[_]?.type,K=l.conditionVarType||ee||"string",I=Hn[K]||Hn.string,we=l.conditionOp||I[0].value;return s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),s.jsx("input",{type:"text",list:`if-var-${l.id}`,value:l.conditionVar||"",onChange:G=>x(l.id,{conditionVar:G.target.value}),onBlur:()=>b(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),H.length>0&&s.jsx("datalist",{id:`if-var-${l.id}`,children:H.map(G=>s.jsx("option",{value:G},G))})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),s.jsxs("select",{value:K,onChange:G=>{const he=G.target.value,A=Hn[he]||Hn.string;x(l.id,{conditionVarType:he,conditionOp:A[0].value,conditionValue:he==="boolean"?"":l.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[s.jsx("option",{value:"string",children:"String"}),s.jsx("option",{value:"number",children:"Number"}),s.jsx("option",{value:"boolean",children:"Boolean"})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),s.jsx("select",{value:we,onChange:G=>x(l.id,{conditionOp:G.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:I.map(G=>s.jsx("option",{value:G.value,children:G.label},G.value))})]})]}),K!=="boolean"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),s.jsx("input",{type:K==="number"?"number":"text",value:l.conditionValue||"",onChange:G=>x(l.id,{conditionValue:G.target.value}),onBlur:()=>b(),placeholder:K==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),l.type==="while"&&(()=>{const H=Object.keys(f||{}),_=mp(l.conditionVar||""),ee=_&&f?.[_]?.type,K=l.conditionVarType||ee||"string",I=Hn[K]||Hn.string,we=l.conditionOp||I[0].value;return s.jsxs("div",{className:"space-y-2",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-2",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),s.jsx("input",{type:"text",list:`while-var-${l.id}`,value:l.conditionVar||"",onChange:G=>x(l.id,{conditionVar:G.target.value}),onBlur:()=>b(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"}),H.length>0&&s.jsx("datalist",{id:`while-var-${l.id}`,children:H.map(G=>s.jsx("option",{value:G},G))})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),s.jsxs("select",{value:K,onChange:G=>{const he=G.target.value,A=Hn[he]||Hn.string;x(l.id,{conditionVarType:he,conditionOp:A[0].value,conditionValue:he==="boolean"?"":l.conditionValue||""},!0)},className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:[s.jsx("option",{value:"string",children:"String"}),s.jsx("option",{value:"number",children:"Number"}),s.jsx("option",{value:"boolean",children:"Boolean"})]})]}),s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),s.jsx("select",{value:we,onChange:G=>x(l.id,{conditionOp:G.target.value},!0),className:"custom-select w-full bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[8px] font-bold uppercase text-white/60",children:I.map(G=>s.jsx("option",{value:G.value,children:G.label},G.value))})]})]}),K!=="boolean"&&s.jsxs("div",{className:"space-y-1",children:[s.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),s.jsx("input",{type:K==="number"?"number":"text",value:l.conditionValue||"",onChange:G=>x(l.id,{conditionValue:G.target.value}),onBlur:()=>b(),placeholder:K==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white"})]})]})})(),l.type==="repeat"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Times"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.value||"",onChange:H=>x(l.id,{value:H}),variables:f,placeholder:"3"})})]}),l.type==="foreach"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Selector (Optional)"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.selector||"",onChange:H=>x(l.id,{selector:H}),variables:f,placeholder:".list-item"})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable (Array Name)"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.varName||"",onChange:H=>x(l.id,{varName:H}),variables:f,placeholder:"items"})})]})]}),l.type==="set"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Variable Name"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.varName||"",onChange:H=>x(l.id,{varName:H}),variables:f,placeholder:"status"})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Value"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.value||"",onChange:H=>x(l.id,{value:H}),variables:f,placeholder:"ready"})})]})]}),l.type==="merge"&&s.jsxs("div",{className:"space-y-3",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Sources"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.value||"",onChange:H=>x(l.id,{value:H}),variables:f,placeholder:"items, extraItems, {$block.output}"})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Target Variable (Optional)"}),s.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[11px] focus-within:border-white/20 transition-all",children:s.jsx(Ea,{value:l.varName||"",onChange:H=>x(l.id,{varName:H}),variables:f,placeholder:"allItems"})})]})]}),l.type==="stop"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Outcome"}),s.jsxs("select",{value:l.value||"success",onChange:H=>x(l.id,{value:H.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[s.jsx("option",{value:"success",children:"Success"}),s.jsx("option",{value:"error",children:"Error"})]})]}),l.type==="on_error"&&s.jsx("div",{className:"text-[8px] text-gray-600 uppercase tracking-widest",children:"Runs if any action fails."}),l.type==="start"&&s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Task"}),s.jsxs("select",{value:l.value||"",onChange:H=>x(l.id,{value:H.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[s.jsx("option",{value:"",disabled:!0,children:"Select task"}),p.length===0&&s.jsx("option",{value:"",disabled:!0,children:"No other tasks"}),p.map(H=>s.jsx("option",{value:H.id,children:H.name||H.id},H.id))]})]})]})]})}),Hb=({isOpen:l,onClose:u,currentTask:o,onUpdateTask:c,proxyListLoaded:h,proxyList:d,initialTab:f="mode",versions:p,versionsLoading:x,onRollback:b,onPreview:k})=>{const[j,T]=qn.useState(f);if(qn.useEffect(()=>{l&&T(f)},[l,f]),!l)return null;const S=h&&d.length===1&&d[0]?.id==="host",N=(C,U,M,Q)=>{const q={...o.variables};C!==U&&delete q[C],q[U]={type:M,value:Q},c({variables:q})},m=C=>{const U={...o.variables};delete U[C],c({variables:U})},w=()=>{const C=`var_${Object.keys(o.variables||{}).length+1}`;N(C,C,"string","")},v=C=>{c({stealth:{...o.stealth,[C]:!o.stealth[C]}})},E=(C,U,M)=>s.jsxs("button",{onClick:()=>T(C),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all ${j===C?"bg-white text-black shadow-lg shadow-white/10":"text-gray-500 hover:text-white hover:bg-white/5"}`,children:[s.jsx(Ne,{name:M,className:"text-sm"}),U]});return s.jsxs("div",{className:"fixed inset-y-0 right-0 w-[450px] z-[100] flex",children:[s.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px]",onClick:u}),s.jsxs("div",{className:"relative h-full w-full bg-[#080808]/90 border-l border-white/10 backdrop-blur-2xl shadow-[-20px_0_50px_rgba(0,0,0,0.5)] flex flex-col animate-in slide-in-from-right duration-300 ease-out p-8",children:[s.jsxs("div",{className:"flex items-center justify-between mb-8",children:[s.jsxs("div",{children:[s.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Task Settings"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-[0.2em] mt-1",children:o.name||"Untitled Task"})]}),s.jsx("button",{onClick:u,className:"w-10 h-10 rounded-full flex items-center justify-center hover:bg-white/5 text-gray-400 hover:text-white transition-colors",children:s.jsx(Ne,{name:"close"})})]}),s.jsxs("div",{className:"flex flex-wrap gap-2 mb-8 bg-black/40 p-1 rounded-2xl border border-white/5",children:[E("mode","Mode","settings_input_component"),E("variables","Vars","data_object"),E("behavior","Behavior","psychology"),E("extraction","Extract","terminal"),E("api","API","api"),E("history","History","history")]}),s.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar pr-2 -mr-2",children:[j==="mode"&&s.jsx("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:s.jsxs("div",{className:"space-y-4",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Execution Mode"}),s.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[s.jsxs("button",{onClick:()=>c({mode:"agent"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 ${o.mode==="agent"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:s.jsx(Ne,{name:"smart_toy",className:"text-white/60"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-bold text-white",children:"Agent Mode"}),s.jsx("div",{className:"text-[9px] text-gray-500",children:"Autonomous decision making"})]})]}),s.jsxs("button",{onClick:()=>c({mode:"scrape"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 ${o.mode==="scrape"?"bg-white/10 border-white/30 ring-1 ring-white/20":"bg-white/5 border-white/5 opacity-50 hover:opacity-100 hover:border-white/10"}`,children:[s.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:s.jsx(Ne,{name:"api",className:"text-white/60"})}),s.jsxs("div",{children:[s.jsx("div",{className:"text-xs font-bold text-white",children:"Scrape Mode"}),s.jsx("div",{className:"text-[9px] text-gray-500",children:"Fixed data extraction flow"})]})]})]})]})}),j==="variables"&&s.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Task Variables"}),s.jsx("button",{onClick:w,className:"px-3 py-1 rounded-lg bg-white/10 text-white text-[10px] font-bold uppercase tracking-wider hover:bg-white/20 transition-all border border-white/10",children:"+ Add Var"})]}),s.jsxs("div",{className:"space-y-3",children:[Object.entries(o.variables||{}).map(([C,U])=>s.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[s.jsxs("div",{className:"flex gap-2",children:[s.jsx("input",{type:"text",defaultValue:C,onBlur:M=>{M.target.value!==C&&N(C,M.target.value,U.type,U.value)},placeholder:"Name",className:"flex-1 bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white placeholder:text-gray-700"}),s.jsxs("select",{value:U.type,onChange:M=>N(C,C,M.target.value,U.value),className:"bg-black/40 border border-white/5 rounded-xl px-2 py-2 text-[10px] font-bold uppercase text-gray-500",children:[s.jsx("option",{value:"string",children:"String"}),s.jsx("option",{value:"number",children:"Number"}),s.jsx("option",{value:"boolean",children:"Bool"})]}),s.jsx("button",{onClick:()=>m(C),className:"text-red-500/50 hover:text-red-500 p-2",children:s.jsx(Ne,{name:"delete",className:"text-sm"})})]}),s.jsx("div",{className:"pl-1",children:U.type==="boolean"?s.jsxs("select",{value:String(U.value),onChange:M=>N(C,C,U.type,M.target.value==="true"),className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white",children:[s.jsx("option",{value:"true",children:"True"}),s.jsx("option",{value:"false",children:"False"})]}):s.jsx("input",{type:U.type==="number"?"number":"text",value:U.value,onChange:M=>N(C,C,U.type,U.type==="number"?parseFloat(M.target.value):M.target.value),placeholder:"Default Value",className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white"})})]},C)),Object.keys(o.variables||{}).length===0&&s.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:s.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No variables defined"})})]})]}),j==="behavior"&&s.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Runtime Flags"}),s.jsx("div",{className:"grid grid-cols-1 gap-2",children:[{label:"Stateless Execution",key:"statelessExecution",icon:"auto_delete"},{label:"Disable Recording",key:"disableRecording",icon:"videocam_off"},{label:"Rotate Proxies",key:"rotateProxies",icon:"vpn_lock",disabled:S},{label:"Rotate User Agents",key:"rotateUserAgents",icon:"person_search"},{label:"Rotate Viewport",key:"rotateViewport",icon:"screenshot_monitor"},{label:"Include Shadow DOM",key:"includeShadowDom",icon:"layers"}].map(C=>s.jsxs("button",{disabled:C.disabled,onClick:()=>c({[C.key]:!o[C.key]}),className:`flex items-center justify-between p-4 rounded-2xl border transition-all ${o[C.key]?"bg-white/10 border-white/30 text-white":"bg-white/5 border-white/5 text-gray-400 opacity-60 hover:opacity-100"} ${C.disabled?"opacity-20 cursor-not-allowed":""}`,children:[s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx(Ne,{name:C.icon,className:"text-sm opacity-70"}),s.jsx("span",{className:"text-xs font-medium",children:C.label})]}),s.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors ${o[C.key]?"bg-white":"bg-white/10"}`,children:s.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${o[C.key]?"right-1 bg-black":"left-1 bg-white/20"}`})})]},C.key))})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Stealth & Behavior"}),s.jsx("div",{className:"grid grid-cols-2 gap-2",children:[{label:"Human Typing",key:"naturalTyping",icon:"keyboard"},{label:"Cursor Glide",key:"cursorGlide",icon:"near_me"},{label:"Idle Moves",key:"idleMovements",icon:"mouse"},{label:"Dead Clicks",key:"deadClicks",icon:"ads_click"},{label:"Fatigue Sim",key:"fatigue",icon:"hourglass_empty"},{label:"Allow Typos",key:"allowTypos",icon:"spellcheck"},{label:"Random Clicks",key:"randomizeClicks",icon:"shuffle"},{label:"Overscroll",key:"overscroll",icon:"unfold_more"}].map(C=>s.jsxs("button",{onClick:()=>v(C.key),className:`flex flex-col gap-2 p-4 rounded-2xl border transition-all text-left ${o.stealth[C.key]?"bg-white/15 border-white/40 text-white":"bg-white/5 border-white/5 text-gray-500 opacity-60 hover:opacity-100"}`,children:[s.jsx(Ne,{name:C.icon,className:"text-sm opacity-70"}),s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-tight",children:C.label})]},C.key))})]})]}),j==="extraction"&&s.jsx("div",{className:"space-y-6 h-full flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300",children:s.jsxs("div",{className:"space-y-4 flex-1 flex flex-col",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Post-Execution Script"}),s.jsxs("select",{value:o.extractionFormat||"json",onChange:C=>c({extractionFormat:C.target.value}),className:"bg-black/40 border border-white/5 rounded-lg px-2 py-1 text-[8px] font-bold uppercase text-gray-500",children:[s.jsx("option",{value:"json",children:"JSON"}),s.jsx("option",{value:"csv",children:"CSV"})]})]}),s.jsx("div",{className:"flex-1 bg-black/40 border border-white/5 rounded-2xl overflow-hidden min-h-[300px]",children:s.jsx(Gi,{language:"javascript",value:o.extractionScript||"",onChange:C=>c({extractionScript:C}),placeholder:"// Example: return { title: document.title };",className:"h-full text-[11px]"})})]})}),j==="api"&&s.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[s.jsxs("div",{className:"space-y-4",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Trigger via API"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] text-gray-500",children:"Run this task from external tools using the endpoint below:"}),s.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-xl p-4 font-mono text-[10px] text-white/80 break-all border-dashed",children:["POST /api/tasks/",o.id,"/api"]})]})]}),s.jsxs("div",{className:"space-y-4",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Passing Variables"}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] text-gray-500",children:"You can override task variables in the request body:"}),s.jsx("div",{className:"bg-black/40 border border-white/5 rounded-xl p-4 font-mono text-[10px] text-white/60",children:s.jsx("pre",{children:JSON.stringify({variables:Object.fromEntries(Object.entries(o.variables||{}).slice(0,2).map(([C,U])=>[C,U.value]))},null,2)})})]})]})]}),j==="history"&&s.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Version History"}),x&&s.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),s.jsxs("div",{className:"space-y-2",children:[p.map(C=>s.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 flex items-center justify-between group hover:border-white/20 transition-all",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"text-xs font-bold text-white mb-0.5",children:new Date(C.timestamp).toLocaleString()}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/10 text-gray-400 font-bold uppercase tracking-widest",children:C.mode}),s.jsx("span",{className:"text-[9px] text-gray-600 truncate max-w-[150px]",children:C.name||"Untitled"})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>k(C.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all",title:"Preview version",children:s.jsx(Ne,{name:"visibility",className:"text-sm"})}),s.jsx("button",{onClick:()=>b(C.id),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/10 transition-all",title:"Rollback to this version",children:s.jsx(Ne,{name:"restore",className:"text-sm"})})]})]},C.id)),p.length===0&&!x&&s.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:s.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No previous versions found"})})]})]})]})]})]})},qb=new Set(["if","while","repeat","foreach","on_error"]),Jp=({currentTask:l,setCurrentTask:u,tasks:o=[],editorView:c,setEditorView:h,isExecuting:d,onSave:f,onRun:p,results:x,pinnedResults:b,onConfirm:k,onNotify:j,onPinResults:T,onUnpinResults:S,onRunSnapshot:N,runId:m,onStop:w,isHeadfulOpen:v,onOpenHeadful:E,onStopHeadful:C,useNovnc:U})=>{const[M,Q]=z.useState(null),[q,ne]=z.useState(null),F=z.useRef(null),fe=z.useRef(null),[,ue]=z.useState(null),[B,H]=z.useState(null),[_,ee]=z.useState(null),[K,I]=z.useState([]),[we,G]=z.useState(!1),[he,A]=z.useState(!1),[O,P]=z.useState(!1),[W,ce]=z.useState("mode"),Ce=(X="mode")=>{ce(X),X==="history"&&Ua(),P(!0)},[Oe,Te]=z.useState(new Set),[ze,Ye]=z.useState(null),[Fe,Xe]=z.useState(""),[mt,y]=z.useState(null),[de,re]=z.useState(null),[L,D]=z.useState(null),[$,me]=z.useState(!1),[se,Y]=z.useState({}),[ye,je]=z.useState([]),[ge,Re]=z.useState(!1),[Ve,He]=z.useState(!1),[st,Bt]=z.useState({x:0,y:0}),[ht,Wt]=z.useState(1),We=z.useRef(!1),xt=z.useRef({x:0,y:0,offsetX:0,offsetY:0}),Xt=z.useRef(!1),it=z.useRef(null),Ka=z.useRef(!1),[ka,Za]=z.useState(!1),oa=z.useRef(null),ga=z.useRef(ht);z.useEffect(()=>{ga.current=ht},[ht]);const rt=z.useRef([]),wt=z.useRef(-1),Ma=z.useRef(!1),Aa=z.useRef(""),hn=z.useRef(l);z.useEffect(()=>{hn.current=l},[l]);const Vn=z.useRef(v);z.useEffect(()=>{Vn.current=v},[v]),z.useEffect(()=>()=>{Vn.current&&C?.()},[C]);const _t=z.useCallback(X=>{f(X||hn.current,!1)},[f]),ve=()=>{try{const X=localStorage.getItem("doppelganger.layout.leftWidthPct");if(!X)return .3;const te=parseFloat(X);return Number.isNaN(te)?.3:Math.min(.75,Math.max(.25,te))}catch{return .3}},_e=X=>{const Se=Math.floor(window.innerWidth*.8);return Math.max(320,Math.min(Se,X))},[Ee,Ae]=z.useState(()=>{if(typeof window>"u")return 360;const X=ve();return _e(Math.round(window.innerWidth*X))}),nt=z.useRef(!1),Lt=z.useMemo(()=>o.filter(X=>String(X.id||"")!==String(l.id||"")),[o,l.id]),rl=ge&&ye.length===1&&ye[0]?.id==="host";z.useEffect(()=>{let X=!1;return(async()=>{try{const Se=await fetch("/api/settings/proxies",{credentials:"include"});if(!Se.ok)throw new Error("Failed to load proxies");const ke=await Se.json();if(X)return;je(Array.isArray(ke.proxies)?ke.proxies:[])}catch{X||je([])}finally{X||Re(!0)}})(),()=>{X=!0}},[]),z.useEffect(()=>{if(rl&&l.rotateProxies){const X={...l,rotateProxies:!1};u(X),_t(X)}},[rl,l]),z.useEffect(()=>{if(Ma.current){Ma.current=!1;return}const X=JSON.stringify(l);if(X===Aa.current)return;const te=setTimeout(()=>{Aa.current=X,wt.current<rt.current.length-1&&(rt.current=rt.current.slice(0,wt.current+1)),rt.current.push(JSON.parse(X)),wt.current=rt.current.length-1,rt.current.length>50&&(rt.current.shift(),wt.current-=1)},300);return()=>clearTimeout(te)},[l]),z.useMemo(()=>{let X=0;return l.actions.map(te=>{(te.type==="else"||te.type==="end")&&(X=Math.max(0,X-1));const Se=X;return(te.type==="else"||qb.has(te.type))&&(X+=1),Se})},[l.actions]);const Ii=X=>{const te={id:"act_"+Date.now(),type:X,selector:"",value:""};if(X==="set"&&(te.varName=""),X==="merge"&&(te.varName=""),X==="start"&&(te.value=""),X==="type"&&(te.typeMode="replace"),X==="if"&&(te.conditionVar="",te.conditionVarType="string",te.conditionOp="equals",te.conditionValue=""),X==="while"&&(te.conditionVar="",te.conditionVarType="string",te.conditionOp="equals",te.conditionValue=""),X==="wait_downloads"&&(te.value="30"),X==="if"||X==="while"){const Se={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""},ke={...l,actions:[...l.actions,te,Se]};u(ke),_t(ke)}else{const Se={...l,actions:[...l.actions,te]};u(Se),_t(Se)}},ca=z.useCallback((X,te)=>{A(!0),Xe(""),y(X||null),re(te!==void 0?te:null)},[]),za=z.useCallback(X=>{const te=hn.current;if(!te)return;const Se={...te,actions:te.actions.filter(ke=>ke.id!==X)};u(Se),f(Se,!1)},[u,f]),bt=z.useCallback((X,te,Se=!1)=>{if(Se){const ke=hn.current;if(!ke)return;const Be={...ke,actions:ke.actions.map(qe=>qe.id===X?{...qe,...te}:qe)};u(Be),f(Be,!1)}else u(ke=>ke?{...ke,actions:ke.actions.map(Be=>Be.id===X?{...Be,...te}:Be)}:null)},[u,f]),It=(X,te)=>{if(X===te)return;const Se=[...l.actions],ke=Se.findIndex(et=>et.id===X),Be=Se.findIndex(et=>et.id===te);if(ke===-1||Be===-1)return;const[qe]=Se.splice(ke,1);Se.splice(Be,0,qe);const gt={...l,actions:Se};u(gt),_t(gt)},Xa=async(X,te)=>{const Se=l.actions.findIndex(ke=>ke.id===X);if(Se!==-1)try{const ke=await fetch("/api/tasks/generate-selector",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({task:l,actionIndex:Se,prompt:te})});if(!ke.ok){const qe=await ke.json().catch(()=>({}));throw new Error(qe.error||"Failed to generate selector")}const Be=await ke.json();Be.selector&&(bt(X,{selector:Be.selector},!0),j("Selector generated by AI","success"))}catch(ke){throw j(ke.message||"Failed to generate selector","error"),ke}},Xl=(X,te,Se,ke)=>{if(Se!==void 0&&ke!==void 0&&Math.abs(X-ke)<14)return Se;const Be=l.actions;let qe=Be.length-1;for(let gt=0;gt<Be.length;gt++){if(Be[gt].id===te)continue;const et=document.getElementById(`action-${Be[gt].id}`);if(!et)continue;const jt=et.getBoundingClientRect(),Mt=jt.top+jt.height*.4;if(X<Mt){qe=gt;break}}return qe},vr=()=>{if(B){if(_!==null&&_!==B.index){const X=l.actions[_]?.id;X&&It(B.id,X)}H(null),ee(null),F.current=null}};z.useEffect(()=>{if(!B)return;const X=Se=>{if(F.current!==null&&Se.pointerId!==F.current)return;if(fe.current){const qe=fe.current.getBoundingClientRect();Se.clientY<qe.top+28&&(fe.current.scrollTop-=14),Se.clientY>qe.bottom-28&&(fe.current.scrollTop+=14)}const ke=B.originTop+B.height/2,Be=Xl(Se.clientY,B.id,B.index,ke);H(qe=>qe&&{...qe,currentY:Se.clientY}),ee(Be)},te=Se=>{F.current!==null&&Se.pointerId!==F.current||vr()};return window.addEventListener("pointermove",X),window.addEventListener("pointerup",te),window.addEventListener("pointercancel",te),()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te)}},[B,_,l.actions]);const Il=X=>({...X,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)}),Ql=z.useCallback((X,te)=>{X.preventDefault();const Se=8,ke=200,Be=190,qe=Math.min(Math.max(X.clientX+12,Se),window.innerWidth-ke-Se),gt=Math.min(Math.max(X.clientY+12,Se),window.innerHeight-Be-Se);ne({id:te,x:qe,y:gt})},[]),Ta=()=>ne(null);z.useEffect(()=>{if(!q)return;const X=Se=>{Se.target?.closest(".action-context-menu")||ne(null)},te=Se=>{Se.key==="Escape"&&ne(null)};return window.addEventListener("mousedown",X),window.addEventListener("keydown",te),window.addEventListener("scroll",X,!0),()=>{window.removeEventListener("mousedown",X),window.removeEventListener("keydown",te),window.removeEventListener("scroll",X,!0)}},[q]),z.useEffect(()=>{if(!m||l.mode!=="agent")return;Y({});const X=new EventSource(`/api/executions/stream?runId=${encodeURIComponent(m)}`,{withCredentials:!0});return X.onmessage=te=>{if(te.data)try{const Se=JSON.parse(te.data);Se&&Se.actionId&&Se.status&&Y(ke=>({...ke,[Se.actionId]:Se.status}))}catch{}},X.addEventListener("ready",()=>{}),X.onopen=()=>{},X.onerror=()=>{X.close()},()=>{X.close()}},[m,l.mode]),z.useEffect(()=>{if(typeof window>"u")return;const X=ve();Ae(_e(Math.round(window.innerWidth*X)))},[]);const ol=X=>{const te=X.tagName.toLowerCase();return te==="input"||te==="textarea"||X.isContentEditable||X.closest('[data-interactive-target="true"]')};z.useEffect(()=>{const X=te=>{if(!ol(te.target))if(te.key==="Backspace"||te.key==="Delete"){if(Oe.size>0){te.preventDefault();let Se=[...l.actions];Oe.forEach(Be=>{const qe=Se.findIndex(gt=>gt.id===Be);if(qe!==-1){const gt=Se[qe];if(gt.type==="if"||gt.type==="while"){let et=1;for(let jt=qe+1;jt<Se.length;jt++)if((Se[jt].type==="if"||Se[jt].type==="while")&&et++,Se[jt].type==="end"&&et--,et===0){Se.splice(jt,1);break}}Se.splice(qe,1)}});const ke={...l,actions:Se};u(ke),_t(ke),Te(new Set)}}else(te.ctrlKey||te.metaKey)&&te.key==="a"&&(te.preventDefault(),Te(new Set(l.actions.map(Se=>Se.id))))};return document.addEventListener("keydown",X),()=>document.removeEventListener("keydown",X)},[Oe,l,_t]),z.useEffect(()=>{const X=te=>{if((te.metaKey||te.ctrlKey)&&te.key==="k"&&(te.preventDefault(),he||ca()),(te.metaKey||te.ctrlKey)&&te.key.toLowerCase()==="z"){const Se=document.activeElement;if(Se){const ke=Se.tagName.toLowerCase(),Be=Se.getAttribute("contenteditable")==="true";if(ke==="input"||ke==="textarea"||Be)return}if(te.preventDefault(),te.shiftKey){if(wt.current<rt.current.length-1){wt.current+=1;const ke=rt.current[wt.current];Ma.current=!0,Aa.current=JSON.stringify(ke),u(ke),_t(ke)}}else if(wt.current>0){wt.current-=1;const ke=rt.current[wt.current];Ma.current=!0,Aa.current=JSON.stringify(ke),u(ke),_t(ke)}}};return window.addEventListener("keydown",X),()=>window.removeEventListener("keydown",X)},[he,ca,u,_t]),z.useEffect(()=>{const X=Se=>{if(!nt.current)return;const ke=_e(Se.clientX);Ae(ke)},te=()=>{nt.current=!1,document.body.style.cursor="",document.body.style.userSelect=""};return window.addEventListener("pointermove",X),window.addEventListener("pointerup",te),window.addEventListener("pointercancel",te),()=>{window.removeEventListener("pointermove",X),window.removeEventListener("pointerup",te),window.removeEventListener("pointercancel",te)}},[]);const Ua=async()=>{if(l.id){G(!0);try{const X=await fetch(`/api/tasks/${l.id}/versions`);if(!X.ok)throw new Error("Failed to load versions");const te=await X.json();I(Array.isArray(te.versions)?te.versions:[])}catch{I([])}finally{G(!1)}}},pn=async X=>{if(!(!l.id||!await k("Rollback to this version? Current changes will be saved as a new version.")))try{const Se=await fetch(`/api/tasks/${l.id}/rollback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({versionId:X})});if(!Se.ok)throw new Error("Rollback failed");const ke=await Se.json();u(ke),j("Rolled back to selected version.","success"),Ua()}catch{j("Rollback failed.","error")}},Gn=async X=>{if(l.id){me(!0);try{const te=await fetch(`/api/tasks/${l.id}/versions/${X}`);if(!te.ok)throw new Error("Failed to load version");const Se=await te.json();if(!Se?.snapshot)throw new Error("Missing snapshot");D({id:Se.metadata?.id||X,timestamp:Se.metadata?.timestamp||Date.now(),snapshot:Se.snapshot})}catch{j("Failed to load version snapshot.","error")}finally{me(!1)}}};return z.useEffect(()=>{c==="history"&&Ua()},[c,l.id]),z.useEffect(()=>{if(Ka.current)return;Ka.current=!0;const X=it.current;if(!X)return;const te=X.clientWidth;Bt({x:(te-400)/2,y:20})},[]),z.useEffect(()=>{const X=it.current;if(!X)return;const te=Se=>{if(Se.ctrlKey||Se.metaKey){Se.preventDefault();const ke=X.getBoundingClientRect(),Be=Se.clientX-ke.left,qe=Se.clientY-ke.top,gt=ga.current,et=Se.deltaY<0?1.1:.9,jt=Math.min(2,Math.max(.25,gt*et)),Mt=jt/gt;Bt(qt=>({x:Be-Mt*(Be-qt.x),y:qe-Mt*(qe-qt.y)})),Wt(jt)}else Bt(ke=>({x:ke.x-Se.deltaX,y:ke.y-Se.deltaY}))};return X.addEventListener("wheel",te,{passive:!1}),()=>X.removeEventListener("wheel",te)},[]),z.useCallback((X,te,Se)=>{const ke=X.currentTarget.getBoundingClientRect(),Be=X.clientY-ke.top;F.current=X.pointerId,X.currentTarget.setPointerCapture(X.pointerId),H({id:te,startY:X.clientY,currentY:X.clientY,height:ke.height,index:Se,originTop:ke.top,pointerOffset:Be}),ee(Se)},[]),s.jsxs("div",{className:"flex-1 flex overflow-hidden animate-in fade-in slide-in-from-bottom-4 duration-500 bg-black relative","data-editor-width":Ee,children:[s.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 w-full pointer-events-none",children:s.jsxs("div",{className:"glass-card flex items-center justify-between p-1 px-6 border-b border-white/10 backdrop-blur-xl pointer-events-auto",children:[s.jsx("div",{className:"flex-1 overflow-hidden flex justify-center",children:s.jsx("input",{type:"text",value:l.name||"",onChange:X=>u({...l,name:X.target.value}),onBlur:()=>_t(),placeholder:"Task name",className:"bg-transparent border-none text-[11px] font-bold text-white uppercase tracking-[0.25em] focus:outline-none w-full max-w-[400px] text-center placeholder:text-white/20 py-1"})}),s.jsx("div",{className:"flex items-center gap-1",children:s.jsx("button",{onClick:()=>Ce("history"),className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/5 transition-all",title:"Version History",children:s.jsx(Ne,{name:"history",className:"text-base"})})})]})}),s.jsx("div",{ref:it,className:"flex-1 overflow-hidden relative cursor-grab active:cursor-grabbing select-none",style:{touchAction:"none"},onPointerDown:X=>{X.button===1||X.button===0&&Xt.current?(X.preventDefault(),We.current=!0,xt.current={x:X.clientX,y:X.clientY,offsetX:st.x,offsetY:st.y},X.target.setPointerCapture?.(X.pointerId)):X.button===0&&!ol(X.target)&&(Ye({startX:X.clientX,startY:X.clientY,currentX:X.clientX,currentY:X.clientY}),!X.shiftKey&&!X.ctrlKey&&!X.metaKey&&Te(new Set),X.target.setPointerCapture?.(X.pointerId))},onPointerMove:X=>{if(We.current){const te=X.clientX-xt.current.x,Se=X.clientY-xt.current.y;Bt({x:xt.current.offsetX+te,y:xt.current.offsetY+Se})}else if(ze){if(Ye(Be=>Be?{...Be,currentX:X.clientX,currentY:X.clientY}:null),!ze)return;const te={left:Math.min(ze.startX,X.clientX),right:Math.max(ze.startX,X.clientX),top:Math.min(ze.startY,X.clientY),bottom:Math.max(ze.startY,X.clientY)},Se=document.querySelectorAll("[data-action-id]"),ke=new Set(X.shiftKey||X.ctrlKey||X.metaKey?Array.from(Oe):[]);Se.forEach(Be=>{const qe=Be.getBoundingClientRect();!(qe.right<te.left||qe.left>te.right||qe.bottom<te.top||qe.top>te.bottom)&&ke.add(Be.getAttribute("data-action-id"))}),Te(ke)}},onPointerUp:()=>{We.current=!1,Ye(null)},onPointerCancel:()=>{We.current=!1,Ye(null)},children:s.jsxs("div",{className:"absolute origin-top-left",style:{transform:`translate(${st.x}px, ${st.y}px) scale(${ht})`},children:[s.jsx("div",{className:"absolute pointer-events-none z-0",style:{inset:"-1000vw -1000vh",backgroundImage:`radial-gradient(circle, rgba(255,255,255,0.3) ${.8/ht}px, transparent 0)`,backgroundSize:"20px 20px"}}),s.jsxs("div",{className:"flex flex-col items-center",style:{paddingTop:"60px",minWidth:"500px"},children:[s.jsxs("div",{className:"w-[360px] bg-black border border-white/15 p-5 rounded-2xl shadow-2xl shadow-black/50 select-text cursor-auto relative z-10",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-3 cursor-pointer",onClick:()=>Za(!ka),children:[s.jsx(Ne,{name:"bolt",className:"text-white/40 text-base"}),s.jsx("h3",{className:"text-white/60 font-bold tracking-widest uppercase text-[10px]",children:"On Execution"}),s.jsx(Ne,{name:ka?"expand_less":"expand_more",className:"text-xs text-gray-600"})]}),s.jsx("button",{onClick:()=>Ce("mode"),className:"p-2 rounded-lg hover:bg-white/10 text-white/30 hover:text-white transition-all focus:outline-none",title:"Task Settings",children:s.jsx(Ne,{name:"settings",className:"text-lg"})})]}),ka&&s.jsxs("div",{className:"space-y-4 mt-4 pt-3 border-t border-white/10",children:[s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"URL"}),s.jsx("div",{className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus-within:border-white/30 transition-all",children:s.jsx(Ea,{value:l.url,onChange:X=>u({...l,url:X}),onBlur:()=>_t(),variables:l.variables,placeholder:"https://..."})})]}),s.jsxs("div",{className:"space-y-1.5",children:[s.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Wait (sec)"}),s.jsx("input",{type:"number",value:l.wait,onChange:X=>u({...l,wait:parseFloat(X.target.value)||0}),onBlur:()=>_t(),className:"w-full bg-[#111] border border-white/10 rounded-lg px-3 py-2 text-sm focus:outline-none focus:border-white/30 transition-all text-white"})]})]})]}),l.mode==="agent"&&s.jsx("div",{className:"w-px h-10 bg-white/25"}),l.mode==="agent"&&s.jsx("div",{className:"flex flex-col items-center w-full select-text cursor-auto",children:s.jsxs("div",{className:"space-y-6 w-full flex flex-col items-center relative",ref:fe,children:[(()=>{const X=(te,Se,ke=0)=>{const Be=[];let qe=te;for(;qe<Se;){const gt=qe,et=l.actions[gt];if(!et){qe++;continue}if(et.type==="if"||et.type==="while"){const jt=qe;let Mt=1,qt=qe+1,Qt=-1;for(;qt<Se&&Mt>0;){const Ft=l.actions[qt];if((Ft.type==="if"||Ft.type==="while")&&Mt++,Ft.type==="end"&&(Mt--,Mt===0))break;Ft.type==="else"&&Mt===1&&et.type==="if"&&(Qt=qt),qt++}const $t=qt,ea=jt+1,$l=Qt!==-1?Qt:$t,Jl=Qt!==-1?Qt+1:-1,cl=Qt!==-1?$t:-1;Be.push(s.jsxs("div",{className:"flex flex-col items-center w-full",children:[s.jsx("div",{className:"w-[360px]",children:s.jsx(xp,{action:et,index:gt,isDragOver:!1,isDragging:!1,isSelected:Oe.has(et.id),status:se[et.id],translateY:0,variables:l.variables,availableTasks:Lt,onUpdate:(Ft,ta,mn)=>bt(Ft,ta,mn),onAutoSave:_t,onOpenPalette:ca,onOpenContextMenu:Ql,onPointerDown:(Ft,ta)=>{Ft.shiftKey||Ft.ctrlKey||Ft.metaKey?Te(mn=>{const Yt=new Set(mn);return Yt.has(ta)?Yt.delete(ta):Yt.add(ta),Yt}):Te(new Set([ta]))},onGenerateSelector:Xa})}),s.jsxs("div",{className:"flex gap-16 mt-4 relative",children:[s.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[s.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:et.type==="while"?"Loop":"True"}),s.jsx("div",{className:"w-px h-6 bg-white/25"}),s.jsx("div",{className:"flex flex-col items-center gap-3",children:X(ea,$l,ke+1)}),s.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[s.jsx("div",{className:"w-px h-4 bg-white/20"}),s.jsx("button",{onClick:()=>ca(void 0,$l),className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:s.jsx(Ne,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]}),et.type==="if"&&s.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[s.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:"Otherwise"}),s.jsx("div",{className:"w-px h-6 bg-white/25"}),s.jsx("div",{className:"flex flex-col items-center gap-3",children:Jl!==-1?X(Jl,cl,ke+1):null}),s.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[s.jsx("div",{className:"w-px h-4 bg-white/20"}),s.jsx("button",{onClick:()=>{if(Jl!==-1)ca(void 0,cl);else{const Ft={id:"act_"+Date.now()+"_else",type:"else",selector:"",value:""},ta=[...l.actions];ta.splice($t,0,Ft);const mn={...l,actions:ta};u(mn),_t(mn),setTimeout(()=>ca(void 0,$t+1),50)}},className:"w-12 h-12 border border-dashed border-white/15 rounded-xl hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:s.jsx(Ne,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]})]}),s.jsxs("div",{className:"flex flex-col items-center mt-3",children:[s.jsx("div",{className:"w-px h-2 bg-white/25"}),s.jsx("button",{onClick:()=>ca(void 0,$t+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:s.jsx(Ne,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),s.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},et.id)),qe=$t+1}else et.type==="end"||et.type==="else"||Be.push(s.jsxs("div",{className:"flex flex-col items-center",children:[s.jsx("div",{className:"w-[360px]",children:s.jsx(xp,{action:et,index:gt,isDragOver:!1,isDragging:!1,isSelected:Oe.has(et.id),status:se[et.id],translateY:0,variables:l.variables,availableTasks:Lt,onUpdate:(jt,Mt,qt)=>bt(jt,Mt,qt),onAutoSave:_t,onOpenPalette:ca,onOpenContextMenu:Ql,onPointerDown:(jt,Mt)=>{jt.shiftKey||jt.ctrlKey||jt.metaKey?Te(qt=>{const Qt=new Set(qt);return Qt.has(Mt)?Qt.delete(Mt):Qt.add(Mt),Qt}):Te(new Set([Mt]))},onGenerateSelector:Xa})}),qe<Se-1&&l.actions[qe+1]?.type!=="end"&&s.jsxs("div",{className:"flex flex-col items-center my-1",children:[s.jsx("div",{className:"w-px h-2 bg-white/25"}),s.jsx("button",{onClick:()=>ca(void 0,gt+1),className:"w-8 h-8 border border-dashed border-white/10 rounded-lg hover:border-white/30 hover:bg-white/5 transition-all flex items-center justify-center group cursor-pointer",children:s.jsx(Ne,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),s.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},et.id)),qe++}return Be};return X(0,l.actions.length)})(),s.jsxs("div",{className:"pt-2 flex flex-col items-center",children:[s.jsx("div",{className:"w-px h-6 bg-white/10"}),s.jsxs("button",{onClick:()=>ca(),className:"w-[360px] bg-[#0a0a0a] border border-dashed border-white/15 rounded-2xl p-6 hover:border-white/30 hover:bg-white/[0.03] transition-all flex flex-col items-center justify-center gap-2 group cursor-pointer",children:[s.jsx("div",{className:"w-10 h-10 rounded-xl bg-white/5 group-hover:bg-white/10 transition-all flex items-center justify-center",children:s.jsx(Ne,{name:"add",className:"text-2xl text-gray-500 group-hover:text-white transition-colors"})}),s.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[0.2em] text-gray-500 group-hover:text-gray-300 transition-colors",children:"Add Action"})]})]})]})})]})]})}),s.jsxs("div",{className:"absolute bottom-24 left-6 z-30 flex flex-col gap-1 bg-[#111] border border-white/10 rounded-xl p-1 shadow-xl",children:[s.jsx("button",{onClick:()=>{const X=Math.min(2,ht*1.2);Wt(X)},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold",title:"Zoom In",children:"+"}),s.jsxs("div",{className:"text-[8px] text-center text-gray-500 font-bold select-none",children:[Math.round(ht*100),"%"]}),s.jsx("button",{onClick:()=>{const X=Math.max(.25,ht*.8);Wt(X)},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center text-sm font-bold",title:"Zoom Out",children:"−"}),s.jsx("button",{onClick:()=>{Wt(1);const X=it.current,te=X?X.clientWidth:1e3;Bt({x:(te-400)/2,y:20})},className:"w-8 h-8 rounded-lg text-white/60 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center",title:"Reset View",children:s.jsx(Ne,{name:"fit_screen",className:"text-sm"})})]}),ze&&s.jsx("div",{className:"fixed inset-0 pointer-events-none z-20 overflow-hidden",children:s.jsx("div",{className:"absolute bg-blue-500/10 border border-blue-400",style:{left:Math.min(ze.startX,ze.currentX),top:Math.min(ze.startY,ze.currentY),width:Math.abs(ze.currentX-ze.startX),height:Math.abs(ze.currentY-ze.startY)}})}),q&&(()=>{const X=l.actions.findIndex(Se=>Se.id===q.id),te=l.actions[X];return te?s.jsxs("div",{className:"action-context-menu fixed z-50 w-[200px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:q.x,top:q.y},children:[s.jsx("button",{onClick:()=>{bt(te.id,{disabled:!te.disabled},!0),Ta()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:te.disabled?"Enable":"Disable"}),s.jsx("button",{onClick:()=>{za(te.id),Ta()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400",children:"Delete"}),s.jsx("button",{onClick:()=>{ue(Il(te)),za(te.id),Ta()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Cut"}),s.jsx("button",{onClick:()=>{ue(Il(te)),Ta()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Copy"}),s.jsx("button",{onClick:()=>{const Se=Il(te),ke=[...l.actions];ke.splice(X+1,0,Se),u({...l,actions:ke}),Ta()},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors",children:"Duplicate"})]}):null})(),s.jsx(lb,{open:he,query:Fe,onQueryChange:Xe,onClose:()=>A(!1),onSelect:X=>{if(mt)X==="if"?bt(mt,{type:X,conditionVar:"",conditionVarType:"string",conditionOp:"equals",conditionValue:""},!0):X==="while"?bt(mt,{type:X,conditionVar:"",conditionVarType:"string",conditionOp:"equals",conditionValue:""},!0):bt(mt,{type:X},!0);else if(de!==null){const te={id:"act_"+Date.now(),type:X,selector:"",value:""};X==="set"&&(te.varName=""),X==="merge"&&(te.varName=""),X==="start"&&(te.value=""),X==="type"&&(te.typeMode="replace"),X==="if"&&(te.conditionVar="",te.conditionVarType="string",te.conditionOp="equals",te.conditionValue=""),X==="while"&&(te.conditionVar="",te.conditionVarType="string",te.conditionOp="equals",te.conditionValue=""),X==="wait_downloads"&&(te.value="30");const Se=[...l.actions];if(X==="if"||X==="while"){const Be={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""};Se.splice(de,0,te,Be)}else Se.splice(de,0,te);const ke={...l,actions:Se};u(ke),_t(ke)}else Ii(X);A(!1),re(null)}}),s.jsxs("div",{className:`fixed top-0 right-0 h-full w-[600px] max-w-[90vw] bg-[#080808] border-l border-white/10 shadow-2xl transition-transform duration-500 ease-in-out z-40 transform ${Ve?"translate-x-0":"translate-x-full"}`,children:[s.jsx("button",{onClick:()=>He(!Ve),className:"absolute top-1/2 -left-8 -translate-y-1/2 w-8 h-24 bg-[#111] border border-r-0 border-white/10 rounded-l-xl flex items-center justify-center cursor-pointer shadow-[-8px_0_15px_rgba(0,0,0,0.5)] transition-all hover:bg-white/5 hover:w-10 hover:-left-10",children:s.jsx(Ne,{name:"drag_indicator",className:`text-white/30 text-xl transition-transform duration-500 ${Ve?"rotate-180":""}`})}),s.jsx("div",{className:"h-full w-full overflow-y-auto custom-scrollbar p-6",children:s.jsx($p,{results:x,pinnedResults:b,isExecuting:d,isHeadful:v,runId:m,onConfirm:k,onNotify:j,onPin:T,onUnpin:S,fullWidth:!0,useNovnc:U})})]}),L&&s.jsx("div",{className:"fixed inset-0 z-[210] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:s.jsxs("div",{className:"glass-card w-full max-w-6xl rounded-[32px] border border-white/10 p-8 shadow-2xl flex flex-col max-h-[90vh]",children:[s.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Task Snapshot"}),s.jsx("div",{className:"text-lg font-bold text-white",children:L.snapshot.name}),s.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(L.timestamp).toLocaleString()," | ",L.snapshot.mode]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:()=>D(null),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Close"}),s.jsx("button",{onClick:()=>{N&&N(L.snapshot),D(null)},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white text-black hover:bg-white/90 transition-all",children:"Run Version"})]})]}),s.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-6 overflow-y-auto custom-scrollbar pr-2 flex-1 min-h-0",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Snapshot JSON"}),s.jsx(Gi,{readOnly:!0,value:JSON.stringify(L.snapshot,null,2),language:"json",className:"min-h-[320px]"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"}),s.jsx("div",{className:"glass-card rounded-2xl p-6 border border-white/10 text-[10px] text-gray-500",children:"No output captured for this snapshot yet. Run this version to see results."})]})]})]})}),v&&(()=>{const{origin:X,hostname:te}=window.location,Se=`${X}/novnc.html?host=${te}&path=websockify`,ke=()=>{const Be=oa.current;if(Be){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}Be.requestFullscreen?.().catch(()=>{})}};return s.jsx("div",{className:"fixed inset-0 z-[100] bg-black/40 backdrop-blur-md flex items-center justify-center p-8 pointer-events-auto",children:s.jsxs("div",{className:"w-full h-full max-w-6xl max-h-[800px] bg-black/60 backdrop-blur-3xl border border-white/20 rounded-[32px] shadow-2xl overflow-hidden flex flex-col",children:[s.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between px-6 py-4 border-b border-white/10 bg-black/20 gap-4",children:[s.jsxs("div",{className:"flex flex-col gap-1",children:[s.jsx("div",{className:"flex items-center gap-3",children:s.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-white",children:"Active Browser Session"})}),U===!1&&s.jsx("span",{className:"text-[10px] text-amber-500/80 max-w-md hidden sm:block",children:"Figranium is not optimized for native browser windows. Please install the proper tools for stability (Xvfb, x11vnc, websockify) or use Docker."})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:ke,className:"p-2 text-white/60 hover:text-white transition-colors",title:"Toggle fullscreen",children:s.jsx(Ne,{name:"fullscreen",className:"text-[16px]"})}),s.jsx("button",{onClick:()=>C?.(),className:"p-2 text-white/60 hover:text-white transition-colors",title:"Close Browser",children:s.jsx(Ne,{name:"close",className:"text-[16px]"})})]})]}),s.jsx("div",{ref:oa,className:"flex-1 relative bg-black",children:s.jsx("iframe",{src:Se,className:"absolute inset-0 w-full h-full border-0",title:"Headful Browser"})})]})})})(),s.jsxs("div",{className:"fixed bottom-8 left-1/2 -translate-x-1/2 z-50 flex items-center gap-3 bg-[#111] border border-white/10 p-2 rounded-3xl shadow-2xl backdrop-blur-xl",children:[s.jsxs("button",{onClick:()=>{He(!0),p()},disabled:d||v,className:"shine-effect bg-white text-black px-8 py-4 rounded-2xl font-bold text-[10px] tracking-[0.3em] uppercase transition-all shadow-xl shadow-white/5 flex items-center justify-center gap-3 disabled:opacity-50 disabled:cursor-not-allowed min-w-[200px]",children:[d?s.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):s.jsx(Ne,{name:"play_arrow",className:"text-sm text-black"}),s.jsx("span",{children:d?"Running...":"Run Task"})]}),d&&s.jsx("button",{onClick:()=>w?.(),className:"w-12 h-12 rounded-2xl border border-white/10 text-white/80 hover:text-white hover:bg-white/10 transition-all flex items-center justify-center",title:"Stop task","aria-label":"Stop task",children:s.jsx(Ne,{name:"stop",className:"text-base"})}),s.jsxs("button",{onClick:()=>{v?C?.():E?.(l.url||"https://www.google.com")},disabled:d,className:`px-4 h-12 rounded-2xl border text-[9px] font-bold uppercase tracking-widest transition-all flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed ${v?"border-blue-500/30 bg-blue-500/20 text-blue-400 hover:bg-blue-500/30":"border-white/10 text-white/80 hover:text-white hover:bg-white/10"}`,title:v?"Stop headful browser":"Open browser to log in",children:[s.jsx(Ne,{name:v?"stop":"open_in_browser",className:"text-base"}),v?"Close Browser":"Open Browser"]})]}),s.jsx(Hb,{isOpen:O,onClose:()=>P(!1),currentTask:l,onUpdateTask:X=>{const te={...l,...X};u(te),_t(te)},proxyListLoaded:ge,proxyList:ye,initialTab:W,versions:K,versionsLoading:we,onRollback:pn,onPreview:Gn})]})},Yb=({config:l,onConfirm:u})=>{const[o,c]=z.useState(l.startEditing||!1),[h,d]=z.useState(l.startEditing&&l.value||""),[f,p]=z.useState(!1),x=()=>{d(l.value||""),p(!1),c(!0)},b=()=>{c(!1),d(""),p(!1)},k=async()=>{const S=h.trim();await l.onSave(S),c(!1)},j=async()=>{l.onRegenerate&&await l.onRegenerate()},T=l.loading?"Loading...":l.value?"••••••••••••••••••••••••••••••••••••••••":"No key set";return s.jsxs("div",{className:"flex flex-col gap-4 py-4 border-b border-white/5 last:border-0",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-blue-400 overflow-hidden",children:l.iconUrl?s.jsx("img",{src:l.iconUrl,alt:l.name,className:"w-6 h-6 object-contain"}):l.iconComponent?s.jsx(l.iconComponent,{className:"w-5 h-5"}):s.jsx(Ne,{name:l.icon||"key",className:"text-xl"})}),s.jsxs("div",{children:[s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("h4",{className:"text-sm font-bold text-white uppercase tracking-widest",children:l.name}),l.badge&&s.jsx("span",{className:`text-[8px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full ${l.badge==="Primary"?"bg-blue-500/20 text-blue-400 border border-blue-500/30":"bg-white/10 text-white/50 border border-white/10"}`,children:l.badge})]}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:l.description})]})]}),o?s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsxs("div",{className:"flex-1 flex items-center gap-3 rounded-2xl bg-black/40 border border-white/30 focus-within:border-white px-4 py-2 transition-all",children:[s.jsx("input",{type:f?"text":"password",value:h,onChange:S=>d(S.target.value),disabled:l.saving,placeholder:"Enter new API key...",className:"flex-1 bg-transparent text-[10px] text-white font-mono focus:outline-none",autoFocus:!0}),s.jsx("button",{onClick:()=>p(!f),type:"button",className:"p-2 rounded-xl text-white/50 hover:text-white hover:bg-white/10 transition-all",title:f?"Hide value":"Show value","aria-label":f?"Hide value":"Show value",children:s.jsx(Ne,{name:f?"visibility_off":"visibility",className:"text-base"})})]}),s.jsx("button",{onClick:b,disabled:l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-transparent border border-white/20 text-white hover:bg-white/10 transition-all disabled:opacity-50",children:"Cancel"}),s.jsxs("button",{onClick:k,disabled:l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-blue-500 text-white hover:bg-blue-400 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[s.jsx(Ne,{name:"save",className:"text-base"}),l.saving?"Saving...":"Save"]})]}):s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex-1 rounded-2xl bg-black/40 border border-white/10 px-4 py-3 font-mono text-[10px] text-blue-200/80 break-all min-h-[44px] flex items-center",children:s.jsx("span",{className:"opacity-80 select-none",children:T})}),!l.readOnly&&s.jsxs("button",{onClick:x,disabled:l.loading||l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white/10 text-white hover:bg-white/20 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[s.jsx(Ne,{name:"edit",className:"text-base"}),"Edit"]}),l.onRegenerate&&s.jsxs("button",{onClick:j,disabled:l.loading||l.saving,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all disabled:opacity-50 disabled:hover:scale-100 disabled:cursor-not-allowed flex items-center gap-2",children:[s.jsx(Ne,{name:"autorenew",className:"text-base"}),l.saving?"Generating...":"Regenerate"]}),l.showCopyButton&&l.value&&s.jsx(Xp,{text:l.value,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",iconClassName:"text-base"}),l.onDelete&&s.jsx("button",{onClick:async()=>{(u?await u(`Are you sure you want to delete the ${l.name}?`):confirm(`Are you sure you want to delete the ${l.name}?`))&&await l.onDelete?.()},disabled:l.loading||l.saving,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-red-400 hover:bg-red-500/20 hover:border-red-500/30 transition-all disabled:opacity-50 disabled:cursor-not-allowed",title:"Delete Key","aria-label":"Delete Key",children:s.jsx(Ne,{name:"delete",className:"text-base"})})]})]})},Vb=({keys:l,availableProviders:u,onAddProvider:o,onConfirm:c})=>{const[h,d]=z.useState(!1);return z.useEffect(()=>{if(h){document.body.style.overflow="hidden";const f=document.querySelector("main");f&&(f.style.overflow="hidden")}else{document.body.style.overflow="";const f=document.querySelector("main");f&&(f.style.overflow="")}return()=>{document.body.style.overflow="";const f=document.querySelector("main");f&&(f.style.overflow="")}},[h]),s.jsxs("div",{className:"glass-card p-8 rounded-[40px]",children:[s.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-lg font-bold text-white uppercase tracking-widest",children:"API Keys"}),s.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-widest mt-1",children:"Manage external integrations and API access"})]}),u&&u.length>0&&o&&s.jsxs("div",{children:[s.jsxs("button",{onClick:()=>d(!0),className:"px-6 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-blue-500/10 text-blue-400 hover:bg-blue-500/20 transition-all flex items-center gap-2 border border-blue-500/10",children:[s.jsx(Ne,{name:"add",className:"text-base"}),"Add API Key"]}),h&&Ig.createPortal(s.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center p-4 bg-black/80 backdrop-blur-md animate-in fade-in duration-200",style:{position:"fixed",top:0,left:0,right:0,bottom:0},children:s.jsxs("div",{className:"glass-card max-w-2xl w-full p-10 rounded-[40px] shadow-2xl relative border border-white/10 animate-in zoom-in-95 duration-300 bg-gray-900/80",children:[s.jsx("button",{onClick:()=>d(!1),className:"absolute top-6 right-6 p-3 rounded-2xl text-white/50 hover:text-white hover:bg-white/10 transition-all","aria-label":"Close",children:s.jsx(Ne,{name:"close",className:"text-2xl"})}),s.jsx("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:"Select Provider"}),s.jsx("p",{className:"text-sm text-white/50 mb-8",children:"Choose an AI provider to add to your workspace."}),s.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:u.map(f=>s.jsxs("button",{onClick:()=>{f.disabled||(o(f.id),d(!1))},disabled:f.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${f.disabled?"border-white/5 bg-white/5 opacity-40 cursor-not-allowed grayscale":"border-white/10 hover:border-blue-400/30 hover:bg-blue-500/5 cursor-pointer group"}`,children:[s.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${f.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:f.iconUrl?s.jsx("img",{src:f.iconUrl,alt:f.name,className:"w-8 h-8 object-contain drop-shadow-md"}):f.iconComponent?s.jsx(f.iconComponent,{className:"w-6 h-6 text-white"}):s.jsx(Ne,{name:"api",className:"text-xl text-white"})}),s.jsxs("div",{className:"flex-1",children:[s.jsx("div",{className:"text-base font-bold text-white mb-1",children:f.name}),s.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:f.disabled?"Coming Soon":"Available"})]})]},f.id))})]})}),document.body)]})]}),s.jsx("div",{className:"flex flex-col",children:l.map(f=>s.jsx(Yb,{config:f,onConfirm:c},f.id))})]})},Gb=({onClearStorage:l})=>s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:s.jsx(Ne,{name:"delete",className:"text-xl"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Storage"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Manage stored data"})]})]}),s.jsxs("div",{className:"flex gap-4",children:[s.jsx("button",{onClick:()=>l("screenshots"),className:"flex-1 px-6 py-4 bg-red-500/5 border border-red-500/10 text-red-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-red-500/10 transition-all",children:"Clear Captures"}),s.jsx("button",{onClick:()=>l("cookies"),className:"flex-1 px-6 py-4 bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 rounded-2xl text-[9px] font-bold uppercase tracking-widest hover:bg-yellow-500/10 transition-all",children:"Reset Cookies"})]})]}),Kb=72,Fp=6,ur=Kb+Fp,Zb=5,Xb=2,Ib=({index:l,style:u,data:o})=>{const c=o.captures[l];return c?s.jsx("div",{style:{...u,paddingBottom:Fp},children:s.jsxs("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:[s.jsxs("div",{className:"space-y-1",children:[s.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:c.type==="recording"?"Recording":"Screenshot"}),s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:c.name})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("a",{href:c.url,target:"_blank",rel:"noreferrer",className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all","aria-label":`Open ${c.name}`,children:"Open"}),s.jsx("button",{onClick:()=>o.onDelete(c.name),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all",children:"Delete"})]})]})}):null},Qb=({captures:l,loading:u,onRefresh:o,onDelete:c})=>{const h=Math.min(Math.max(ur,l.length*ur),ur*Zb),d=z.useMemo(()=>({captures:l,onDelete:c}),[l,c]);return s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Captures"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Recordings and screenshots"})]}),s.jsx("button",{onClick:o,disabled:u,className:"px-4 py-2 border border-white/10 text-[9px] font-bold rounded-xl uppercase tracking-widest text-white/70 hover:text-white hover:bg-white/5 transition-all disabled:opacity-50",children:"Refresh"})]}),u&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!u&&l.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!u&&l.length>0&&s.jsx(yr,{height:h,width:"100%",itemCount:l.length,itemSize:ur,overscanCount:Xb,itemData:d,children:Ib})]})},Gc=l=>`${l.name}|${l.domain||""}|${l.path||""}|${l.expires||""}`,gp=l=>{if(!l)return!1;let u=0;for(let o=0;o<l.length;o+=1){const c=l.charCodeAt(o);(c===9||c===10||c===13||c>=32&&c<=126)&&(u+=1)}return u/l.length>=.85},$b=l=>{if(!l)return null;if(/%[0-9A-Fa-f]{2}/.test(l))try{const u=decodeURIComponent(l);if(u!==l&&gp(u))return{value:u,kind:"URL"}}catch{}if(/^[A-Za-z0-9+/=]+$/.test(l)&&l.length>=12&&l.length%4===0)try{const u=atob(l);if(u&&gp(u))return{value:u,kind:"Base64"}}catch{}return null},Jb=({cookies:l,originsCount:u,loading:o,onClear:c,onDelete:h})=>{const[d,f]=z.useState({}),[p,x]=z.useState({}),b=T=>{const S=Gc(T);f(N=>({...N,[S]:!N[S]}))},k=T=>{const S=Gc(T);x(N=>({...N,[S]:!N[S]}))},j=z.useMemo(()=>l.map(T=>{const S=Gc(T),N=T.value||"";return{cookie:T,key:S,value:N,decodedCandidate:$b(N)}}),[l]);return s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[s.jsxs("div",{className:"flex items-center justify-between",children:[s.jsxs("div",{className:"flex items-center gap-4",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:s.jsx(Ne,{name:"database",className:"text-xl"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Cookies"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Browser storage state"})]})]}),s.jsx("button",{onClick:c,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-yellow-500/5 border border-yellow-500/10 text-yellow-400 hover:bg-yellow-500/10 transition-all",children:"Clear Cookies"})]}),o&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading data..."}),!o&&l.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No cookies found."}),s.jsx("div",{className:"space-y-3",children:j.map(({cookie:T,key:S,value:N,decodedCandidate:m})=>{const w=!!d[S],v=!!m&&!!p[S],E=v&&m?m.value:N,C=w||E.length<=120?E:`${E.slice(0,120)}...`;return s.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsxs("div",{className:"min-w-0",children:[s.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:T.name}),s.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[T.domain||"local"," | ",T.path||"/",T.expires?` | ${new Date(T.expires*1e3).toLocaleString()}`:""]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[m&&s.jsx("button",{onClick:()=>k(T),className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all",children:v?"Show Raw":`Decode ${m.kind}`}),s.jsx("button",{onClick:()=>h(T),className:"px-3 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all",children:"Delete"})]})]}),s.jsx("div",{onClick:()=>b(T),className:"cursor-pointer rounded-xl bg-black/40 border border-white/10 px-3 py-2 font-mono text-[10px] text-blue-200/80 whitespace-pre-wrap break-words",title:"Click to expand/collapse",children:C||"(empty)"})]},S)})}),!o&&u>0&&s.jsxs("div",{className:"pt-2 text-[8px] text-gray-600 uppercase tracking-widest",children:["Origins stored: ",u]})]})},Fb=({tab:l,onTabChange:u})=>s.jsxs("div",{className:"flex items-end justify-between mb-8",children:[s.jsx("div",{className:"space-y-2",children:s.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Settings"})}),s.jsx("div",{className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["system","data","proxies"].map(o=>s.jsx("button",{onClick:()=>u(o),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all ${l===o?"bg-white text-black":"text-gray-500 hover:text-white"}`,children:o},o))})]}),Pb=({proxies:l,defaultProxyId:u,includeDefaultInRotation:o,rotationMode:c,loading:h,onRefresh:d,onAdd:f,onImport:p,onUpdate:x,onDelete:b,onDeleteMultiple:k,onSetDefault:j,onToggleIncludeDefault:T,onRotationModeChange:S})=>{const[N,m]=z.useState(""),[w,v]=z.useState(""),[E,C]=z.useState(""),[U,M]=z.useState(""),[Q,q]=z.useState(!1),[ne,F]=z.useState(""),[fe,ue]=z.useState(null),[B,H]=z.useState(""),[_,ee]=z.useState(""),[K,I]=z.useState(""),[we,G]=z.useState(""),[he,A]=z.useState(!1),[O,P]=z.useState(""),[W,ce]=z.useState(""),[Ce,Oe]=z.useState(new Set),[Te,ze]=z.useState(null),Ye=z.useRef(null),Fe=()=>{N.trim()&&(f({server:N.trim(),username:w.trim()||void 0,password:E.trim()||void 0,label:U.trim()||void 0,isRotatingPool:Q,estimatedPoolSize:ne?parseInt(ne,10):void 0}),m(""),v(""),C(""),M(""),q(!1),F(""))},Xe=Y=>{ue(Y.id),H(Y.server),ee(Y.username||""),I(""),G(Y.label||""),A(!!Y.isRotatingPool),P(Y.estimatedPoolSize?String(Y.estimatedPoolSize):"")},mt=()=>{ue(null),H(""),ee(""),I(""),G(""),A(!1),P("")},y=()=>{!fe||!B.trim()||(x(fe,{server:B.trim(),username:_.trim()||void 0,password:K.trim()||void 0,label:we.trim()||void 0,isRotatingPool:he,estimatedPoolSize:O?parseInt(O,10):void 0}),mt())},de=Y=>{const ye=Y.trim();if(!ye)return null;if(ye.includes("://"))return{server:ye};const je=ye.split(":");if(je.length<2)return null;const ge=je[0]?.trim(),Re=je[1]?.trim();if(!ge||!Re)return null;const Ve=je[2]?je[2].trim():"",He=je.length>3?je.slice(3).join(":").trim():"";return{server:`${ge}:${Re}`,username:Ve||void 0,password:He||void 0}},re=async Y=>{const ye=Array.from(Y.target.files||[]);if(ye.length)try{const Re=(await Promise.all(ye.map(Ve=>Ve.text()))).join(`
15
- `).split(/\r?\n/).flatMap(Ve=>Ve.split(/[,;]+/)).map(de).filter(Boolean);if(Re.length===0){ce("No valid proxies found in file.");return}ce(""),p(Re)}catch{ce("Failed to read file.")}finally{Ye.current&&(Ye.current.value="")}},L=(Y,ye)=>{Oe(je=>{const ge=new Set(je);if(ye?.shiftKey&&Te){const Re=l.filter(st=>st.id!=="host"),Ve=Re.findIndex(st=>st.id===Te),He=Re.findIndex(st=>st.id===Y);if(Ve!==-1&&He!==-1){const st=Math.min(Ve,He),Bt=Math.max(Ve,He);for(let ht=st;ht<=Bt;ht++)ge.add(Re[ht].id);return ge}}return ge.has(Y)?ge.delete(Y):ge.add(Y),ge}),ze(Y)},D=()=>{const Y=l.filter(ye=>ye.id!=="host");Ce.size>=Y.length&&Y.length>0?Oe(new Set):Oe(new Set(Y.map(ye=>ye.id)))},$=()=>{Ce.size>0&&(k(Array.from(Ce)),Oe(new Set))},me=l.filter(Y=>Y.id!=="host"),se=me.length>0&&Ce.size>=me.length;return s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:s.jsx(Ne,{name:"security",className:"text-xl"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Proxies"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Set defaults and rotate per task"})]}),s.jsx("div",{className:"ml-auto",children:s.jsxs("button",{onClick:d,disabled:h,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all disabled:opacity-50 inline-flex items-center gap-2",children:[s.jsx(Ne,{name:"sync",className:`text-base ${h?"animate-spin":""}`}),"Refresh"]})})]}),s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[s.jsx("input",{type:"text",placeholder:"Proxy server (host:port or scheme://host:port)",value:N,onChange:Y=>m(Y.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy server address"}),s.jsx("input",{type:"text",placeholder:"Label (optional)",value:U,onChange:Y=>M(Y.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy label"}),s.jsx("input",{type:"text",placeholder:"Username (optional)",value:w,onChange:Y=>v(Y.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy username"}),s.jsx("input",{type:"password",placeholder:"Password (optional)",value:E,onChange:Y=>C(Y.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Proxy password"}),s.jsxs("label",{className:"flex items-center gap-3 px-4 py-3 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:Q,onChange:Y=>q(Y.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),s.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),Q&&s.jsx("input",{type:"number",placeholder:"Estimated size (optional)",value:ne,onChange:Y=>F(Y.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("button",{onClick:Fe,className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all",children:"Add Proxy"}),s.jsx("button",{onClick:()=>Ye.current?.click(),className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 text-white hover:bg-white/5 transition-all",children:"Import"}),s.jsx("button",{onClick:()=>j("host"),className:`px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest border border-white/10 transition-all ${u?"text-white hover:bg-white/5":"bg-white/10 text-white"}`,children:"Use Host IP"})]}),(Ce.size>0||me.length>0)&&s.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.02] border border-white/5",children:[s.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[s.jsx("input",{type:"checkbox",checked:se,onChange:D,disabled:me.length===0,className:"w-4 h-4 rounded border-white/20 bg-transparent disabled:opacity-50"}),s.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white transition-colors",children:Ce.size>0?`${Ce.size} Selected`:"Select All"})]}),Ce.size>0&&s.jsxs("button",{onClick:$,className:"px-4 py-2 rounded-xl bg-red-500/10 border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-400 hover:bg-red-500/20 transition-all inline-flex items-center gap-2",children:[s.jsx(Ne,{name:"delete",className:"text-base"}),"Delete Selected"]})]}),s.jsx("input",{ref:Ye,type:"file",accept:".txt,text/plain",onChange:re,className:"hidden"}),W&&s.jsx("div",{className:"text-[9px] text-red-400 uppercase tracking-widest",children:W}),s.jsxs("label",{className:"flex items-center justify-between gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all group",children:[s.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Rotation mode"}),s.jsxs("select",{value:c,onChange:Y=>S(Y.target.value==="random"?"random":"round-robin"),className:"bg-white/[0.05] border border-white/10 rounded-xl px-3 py-2 text-[10px] text-white uppercase tracking-widest","aria-label":"Rotation mode",children:[s.jsx("option",{value:"round-robin",children:"Round robin"}),s.jsx("option",{value:"random",children:"Random"})]})]}),s.jsxs("label",{className:"flex items-center gap-3 p-3.5 rounded-2xl bg-white/[0.02] border border-white/5 hover:bg-white/[0.05] transition-all cursor-pointer group",children:[s.jsx("input",{type:"checkbox",checked:o,onChange:Y=>T(Y.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),s.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Include default IP in rotation pool"})]}),s.jsxs("div",{className:"space-y-3",children:[h&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading proxies..."}),!h&&l.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No proxies saved yet."}),!h&&l.map(Y=>{const ye=Y.id===u,je=Y.id===fe;return s.jsx("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:je?s.jsxs("div",{className:"w-full space-y-3",children:[s.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[s.jsx("input",{type:"text",value:B,onChange:ge=>H(ge.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Proxy server","aria-label":"Proxy server"}),s.jsx("input",{type:"text",value:we,onChange:ge=>G(ge.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Label","aria-label":"Label"}),s.jsx("input",{type:"text",value:_,onChange:ge=>ee(ge.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white",placeholder:"Username","aria-label":"Username"}),s.jsx("input",{type:"password",value:K,onChange:ge=>I(ge.target.value),placeholder:"Password (leave blank to keep)",className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Password"}),s.jsxs("label",{className:"flex items-center gap-3 px-4 py-2 rounded-xl bg-white/[0.05] border border-white/10 group cursor-pointer",children:[s.jsx("input",{type:"checkbox",checked:he,onChange:ge=>A(ge.target.checked),className:"w-3.5 h-3.5 rounded border-white/20 bg-transparent"}),s.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),he&&s.jsx("input",{type:"number",placeholder:"Estimated size",value:O,onChange:ge=>P(ge.target.value),className:"bg-white/[0.05] border border-white/10 rounded-xl px-4 py-2 text-[10px] text-white","aria-label":"Estimated pool size",min:"1"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsx("button",{onClick:y,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",children:"Save"}),s.jsx("button",{onClick:mt,className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white/70 hover:bg-white/5 transition-all",children:"Cancel"})]})]}):s.jsxs(s.Fragment,{children:[s.jsx("div",{className:"flex items-center gap-4 border-r border-white/10 pr-4 w-12 justify-center",children:Y.id!=="host"?s.jsx("input",{type:"checkbox",checked:Ce.has(Y.id),onChange:()=>{},onClick:ge=>{ge.stopPropagation(),L(Y.id,ge)},className:"w-4 h-4 rounded border-white/20 bg-transparent"}):s.jsx("div",{title:"Host IP (Cannot be deleted)",className:"flex items-center justify-center opacity-70",children:s.jsx(Ne,{name:"computer",className:"text-lg text-white"})})}),s.jsxs("div",{className:"flex-1 space-y-1",children:[s.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:Y.label||Y.server}),s.jsxs("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest flex items-center gap-2",children:[s.jsx("span",{children:Y.server}),Y.isRotatingPool&&s.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-white/10 text-white font-bold inline-flex items-center gap-1",children:[s.jsx(Ne,{name:"autorenew",className:"text-[10px]"}),"Pool",Y.estimatedPoolSize?`(~${Y.estimatedPoolSize})`:""]})]})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:()=>j(Y.id),className:`px-3 py-2 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all inline-flex items-center gap-2 ${ye?"bg-white text-black border-white":"border-white/10 text-white hover:bg-white/5"}`,children:[ye?s.jsx(Ne,{name:"star",className:"text-base"}):s.jsx(Ne,{name:"star_outline",className:"text-base"}),ye?"Default":"Set Default"]}),Y.id!=="host"&&s.jsxs(s.Fragment,{children:[s.jsx("button",{onClick:()=>Xe(Y),className:"px-3 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",children:"Edit"}),s.jsxs("button",{onClick:()=>b(Y.id),className:"px-3 py-2 rounded-xl border border-red-500/20 text-[9px] font-bold uppercase tracking-widest text-red-300 hover:bg-red-500/10 transition-all inline-flex items-center gap-2",children:[s.jsx(Ne,{name:"delete",className:"text-base"}),"Delete"]})]})]})]})},Y.id)})]})]})},Wb=({selection:l,options:u,loading:o,onChange:c})=>s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-4",children:[s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"User Agent"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Default browser identity"})]}),s.jsxs("div",{className:"space-y-2",children:[s.jsxs("select",{value:l,onChange:h=>c(h.target.value),disabled:o,className:"w-full bg-white/[0.05] border border-white/10 rounded-xl px-4 py-3 text-[10px] text-white uppercase tracking-widest disabled:opacity-60",children:[s.jsx("option",{value:"system",children:"System user agent (default)"}),u.map(h=>s.jsx("option",{value:h,children:h},h))]}),s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Applies when rotate UA is disabled in tasks."})]})]}),ey=({version:l})=>{const[u,o]=z.useState(!1),c=l?`v${l}`:"Unknown",h=async()=>{const d=l||c;try{if(typeof navigator<"u"&&navigator.clipboard&&typeof window<"u"&&window.isSecureContext)await navigator.clipboard.writeText(d);else if(typeof document<"u"){const p=document.createElement("textarea");p.value=d,p.style.position="fixed",p.style.opacity="0",document.body.appendChild(p),p.select(),document.execCommand("copy"),document.body.removeChild(p)}o(!0),setTimeout(()=>o(!1),1500)}catch{o(!1)}};return s.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[s.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:s.jsx(Ne,{name:"content_copy",className:"text-xl"})}),s.jsxs("div",{children:[s.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Version"}),s.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Package metadata"})]})]}),s.jsxs("div",{className:"flex items-center justify-between gap-4",children:[s.jsx("div",{className:"text-[9px] font-bold uppercase tracking-[0.3em] text-white",children:c}),s.jsx("button",{onClick:h,className:"px-4 py-2 rounded-xl border border-white/10 text-[9px] font-bold uppercase tracking-widest text-white hover:bg-white/5 transition-all",type:"button",children:u?"Copied":"Copy version"})]})]})},ty="0.9.1",ay={version:ty},$c=ay.version,ny=({onClearStorage:l,onConfirm:u,onNotify:o})=>{const[c,h]=z.useState("system"),[d,f]=z.useState([]),[p,x]=z.useState([]),[b,k]=z.useState([]),[j,T]=z.useState([]),[S,N]=z.useState(!1),[m,w]=z.useState(null),[v,E]=z.useState(!0),[C,U]=z.useState(!1),[M,Q]=z.useState([]),[q,ne]=z.useState(!0),[F,fe]=z.useState(!1),[ue,B]=z.useState([]),[H,_]=z.useState(!0),[ee,K]=z.useState(!1),[I,we]=z.useState([]),[G,he]=z.useState(!0),[A,O]=z.useState(!1),[P,W]=z.useState([]),[ce,Ce]=z.useState(null),[Oe,Te]=z.useState(!1),[ze,Ye]=z.useState("round-robin"),[Fe,Xe]=z.useState(!1),[mt,y]=z.useState("system"),[de,re]=z.useState([]),[L,D]=z.useState(!1),$=z.useCallback(async()=>{N(!0);try{const[ve,_e]=await Promise.all([fetch("/api/data/captures"),fetch("/api/data/cookies")]),Ee=ve.ok?await ve.json():{captures:[]},Ae=_e.ok?await _e.json():{cookies:[],origins:[]};x(Array.isArray(Ee.captures)?Ee.captures:[]),k(Array.isArray(Ae.cookies)?Ae.cookies:[]),T(Array.isArray(Ae.origins)?Ae.origins:[])}catch{x([]),k([]),T([])}finally{N(!1)}},[]),me=z.useCallback(async ve=>{if(!await u(`Delete capture ${ve}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(ve)}`,{method:"DELETE"})).ok?(o("Capture deleted.","success"),$()):o("Delete failed.","error")},[u,o,$]),se=z.useCallback(async ve=>{if(!await u(`Delete cookie ${ve.name}?`))return;(await fetch("/api/data/cookies/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:ve.name,domain:ve.domain,path:ve.path})})).ok?(o("Cookie deleted.","success"),$()):o("Delete failed.","error")},[u,o,$]),Y=async()=>{E(!0);try{const ve=await fetch("/api/settings/api-key",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),w(null);return}const _e=await ve.json();w(_e.apiKey||null)}catch{w(null)}finally{E(!1)}},ye=async()=>{ne(!0);try{const ve=await fetch("/api/settings/gemini-api-key",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),Q([]);return}const _e=await ve.json();Q(Array.isArray(_e.geminiApiKeys)?_e.geminiApiKeys:[])}catch{Q([])}finally{ne(!1)}},je=async()=>{_(!0);try{const ve=await fetch("/api/settings/openai-api-key",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),B([]);return}const _e=await ve.json();B(Array.isArray(_e.openAiApiKeys)?_e.openAiApiKeys:[])}catch{B([])}finally{_(!1)}},ge=async()=>{he(!0);try{const ve=await fetch("/api/settings/claude-api-key",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),we([]);return}const _e=await ve.json();we(Array.isArray(_e.claudeApiKeys)?_e.claudeApiKeys:[])}catch{we([])}finally{he(!1)}},Re=async()=>{Xe(!0);try{const ve=await fetch("/api/settings/proxies",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),W([]),Ce(null),Ye("round-robin");return}const _e=await ve.json();W(Array.isArray(_e.proxies)?_e.proxies:[]),Ce(_e.defaultProxyId||null),Te(!!_e.includeDefaultInRotation),Ye(_e.rotationMode==="random"?"random":"round-robin")}catch{W([]),Ce(null),Te(!1),Ye("round-robin")}finally{Xe(!1)}},Ve=async ve=>{Xe(!0);try{const _e=await fetch("/api/settings/proxies",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(ve)});if(!_e.ok){let Ae="";try{const nt=await _e.json();Ae=nt?.error||nt?.message||""}catch{Ae=""}o(`Failed to add proxy${Ae?`: ${Ae}`:""}.`,"error");return}const Ee=await _e.json();W(Array.isArray(Ee.proxies)?Ee.proxies:[]),Ce(Ee.defaultProxyId||null),Te(!!Ee.includeDefaultInRotation),Ye(Ee.rotationMode==="random"?"random":"round-robin"),o("Proxy added.","success")}catch{o("Failed to add proxy.","error")}finally{Xe(!1)}},He=async()=>{D(!0);try{const ve=await fetch("/api/settings/user-agent",{credentials:"include"});if(!ve.ok){ve.status===401&&o("Session expired. Please log in again.","error"),y("system"),re([]);return}const _e=await ve.json();y(_e.selection==="system"?"system":String(_e.selection||"system")),re(Array.isArray(_e.userAgents)?_e.userAgents:[])}catch{y("system"),re([])}finally{D(!1)}},st=async ve=>{D(!0);try{const _e=await fetch("/api/settings/user-agent",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({selection:ve})});if(!_e.ok){o("Failed to update user agent.","error");return}const Ee=await _e.json();y(Ee.selection==="system"?"system":String(Ee.selection||"system")),re(Array.isArray(Ee.userAgents)?Ee.userAgents:[]),o("User agent updated.","success")}catch{o("Failed to update user agent.","error")}finally{D(!1)}},Bt=async ve=>{if(!ve.length){o("No valid proxies found in file.","error");return}Xe(!0);try{const _e=await fetch("/api/settings/proxies/import",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({proxies:ve})});if(!_e.ok){let Ae="";try{const nt=await _e.json();Ae=nt?.error||nt?.message||""}catch{Ae=""}o(`Failed to import proxies${Ae?`: ${Ae}`:""}.`,"error");return}const Ee=await _e.json();W(Array.isArray(Ee.proxies)?Ee.proxies:[]),Ce(Ee.defaultProxyId||null),Te(!!Ee.includeDefaultInRotation),Ye(Ee.rotationMode==="random"?"random":"round-robin"),o("Proxies imported.","success")}catch{o("Failed to import proxies.","error")}finally{Xe(!1)}},ht=async(ve,_e)=>{Xe(!0);try{const Ee=await fetch(`/api/settings/proxies/${encodeURIComponent(ve)}`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(_e)});if(!Ee.ok){let nt="";try{const Lt=await Ee.json();nt=Lt?.error||Lt?.message||""}catch{nt=""}o(`Failed to update proxy${nt?`: ${nt}`:""}.`,"error");return}const Ae=await Ee.json();W(Array.isArray(Ae.proxies)?Ae.proxies:[]),Ce(Ae.defaultProxyId||null),Te(!!Ae.includeDefaultInRotation),Ye(Ae.rotationMode==="random"?"random":"round-robin"),o("Proxy updated.","success")}catch{o("Failed to update proxy.","error")}finally{Xe(!1)}},Wt=async ve=>{if(!(ve==="host"||!await u("Delete this proxy?"))){Xe(!0);try{const Ee=await fetch(`/api/settings/proxies/${encodeURIComponent(ve)}`,{method:"DELETE",credentials:"include"});if(!Ee.ok){o("Delete failed.","error");return}const Ae=await Ee.json();W(Array.isArray(Ae.proxies)?Ae.proxies:[]),Ce(Ae.defaultProxyId||null),Te(!!Ae.includeDefaultInRotation),Ye(Ae.rotationMode==="random"?"random":"round-robin"),o("Proxy deleted.","success")}catch{o("Delete failed.","error")}finally{Xe(!1)}}},We=async ve=>{if(!(ve.length===0||!await u(`Delete ${ve.length} proxies?`))){Xe(!0);try{const Ee=await fetch("/api/settings/proxies",{method:"DELETE",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ids:ve})});if(!Ee.ok){o("Bulk delete failed.","error");return}const Ae=await Ee.json();W(Array.isArray(Ae.proxies)?Ae.proxies:[]),Ce(Ae.defaultProxyId||null),Te(!!Ae.includeDefaultInRotation),Ye(Ae.rotationMode==="random"?"random":"round-robin"),o(`${ve.length} proxies deleted.`,"success")}catch{o("Bulk delete failed.","error")}finally{Xe(!1)}}},xt=async ve=>{const _e=ve==="host"?null:ve;Xe(!0);try{const Ee=await fetch("/api/settings/proxies/default",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:_e})});if(!Ee.ok){o("Failed to set default.","error");return}const Ae=await Ee.json();W(Array.isArray(Ae.proxies)?Ae.proxies:[]),Ce(Ae.defaultProxyId||null),Te(!!Ae.includeDefaultInRotation),Ye(Ae.rotationMode==="random"?"random":"round-robin"),o("Default proxy updated.","success")}catch{o("Failed to set default.","error")}finally{Xe(!1)}},Xt=async ve=>{Xe(!0);try{const _e=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({includeDefaultInRotation:ve})});if(!_e.ok){o("Failed to update rotation setting.","error");return}const Ee=await _e.json();W(Array.isArray(Ee.proxies)?Ee.proxies:[]),Ce(Ee.defaultProxyId||null),Te(!!Ee.includeDefaultInRotation),Ye(Ee.rotationMode==="random"?"random":"round-robin"),o("Rotation setting updated.","success")}catch{o("Failed to update rotation setting.","error")}finally{Xe(!1)}},it=async ve=>{Xe(!0);try{const _e=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({rotationMode:ve})});if(!_e.ok){o("Failed to update rotation mode.","error");return}const Ee=await _e.json();W(Array.isArray(Ee.proxies)?Ee.proxies:[]),Ce(Ee.defaultProxyId||null),Te(!!Ee.includeDefaultInRotation),Ye(Ee.rotationMode==="random"?"random":"round-robin"),o("Rotation mode updated.","success")}catch{o("Failed to update rotation mode.","error")}finally{Xe(!1)}},Ka=async()=>{U(!0);try{const ve=await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!ve.ok){let Ee="";try{const Ae=await ve.json();Ee=Ae?.error||Ae?.message||""}catch{Ee=""}ve.status===401?o("Session expired. Please log in again.","error"):o(`Failed to generate API key${Ee?`: ${Ee}`:""}.`,"error");return}const _e=await ve.json();w(_e.apiKey||null),o("API key generated.","success")}catch{o("Failed to generate API key.","error")}finally{U(!1)}},ka=async ve=>{fe(!0);try{const _e=await fetch("/api/settings/gemini-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({geminiApiKeys:ve})});if(!_e.ok){_e.status===401?o("Session expired. Please log in again.","error"):o("Failed to save Gemini API keys.","error");return}const Ee=await _e.json();Q(Array.isArray(Ee.geminiApiKeys)?Ee.geminiApiKeys:[]),o("Gemini API keys saved.","success")}catch{o("Failed to save Gemini API keys.","error")}finally{fe(!1)}},Za=async ve=>{K(!0);try{const _e=await fetch("/api/settings/openai-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({openAiApiKeys:ve})});if(!_e.ok){_e.status===401?o("Session expired. Please log in again.","error"):o("Failed to save OpenAI API keys.","error");return}const Ee=await _e.json();B(Array.isArray(Ee.openAiApiKeys)?Ee.openAiApiKeys:[]),o("OpenAI API keys saved.","success")}catch{o("Failed to save OpenAI API keys.","error")}finally{K(!1)}},oa=async ve=>{O(!0);try{const _e=await fetch("/api/settings/claude-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({claudeApiKeys:ve})});if(!_e.ok){_e.status===401?o("Session expired. Please log in again.","error"):o("Failed to save Claude API keys.","error");return}const Ee=await _e.json();we(Array.isArray(Ee.claudeApiKeys)?Ee.claudeApiKeys:[]),o("Claude API keys saved.","success")}catch{o("Failed to save Claude API keys.","error")}finally{O(!1)}};z.useEffect(()=>{c==="data"&&$(),c==="system"&&(Y(),ye(),je(),ge(),He()),c==="proxies"&&Re()},[c]),z.useEffect(()=>{c==="system"&&(Y(),ye(),je(),ge())},[]);const ga=[{id:"gemini_api_key",name:"Gemini API Key",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",disabled:!1},{id:"anthropic_api_key",name:"Anthropic API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",disabled:!1},{id:"openai_api_key",name:"OpenAI API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",disabled:!1},{id:"ollama_api_key",name:"Ollama API Key",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/ollama.svg",disabled:!0}],rt=[{id:"doppelganger_api_key",name:"Tasks API",description:"Manage task API access via `x-api-key` header",icon:"database",value:m,saving:C,loading:v,showCopyButton:!0,readOnly:!0,onSave:async()=>{},onRegenerate:async()=>{await Ka()}}];M.filter(ve=>ve&&ve.trim()).forEach((ve,_e)=>{rt.push({id:`gemini_api_key_${_e}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:ve,saving:F,loading:q,badge:_e===0?"Primary":"Backup",onSave:async Ee=>{const Ae=[...M];Ae[_e]=Ee,await ka(Ae)},onDelete:async()=>{const Ee=M.filter((Ae,nt)=>nt!==_e);await ka(Ee)}})}),ue.filter(ve=>ve&&ve.trim()).forEach((ve,_e)=>{rt.push({id:`openai_api_key_${_e}`,name:"OpenAI API Key",description:"Provide an API Key from OpenAI for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",value:ve,saving:ee,loading:H,badge:_e===0?"Primary":"Backup",onSave:async Ee=>{const Ae=[...ue];Ae[_e]=Ee,await Za(Ae)},onDelete:async()=>{const Ee=ue.filter((Ae,nt)=>nt!==_e);await Za(Ee)}})}),I.filter(ve=>ve&&ve.trim()).forEach((ve,_e)=>{rt.push({id:`anthropic_api_key_${_e}`,name:"Anthropic API Key",description:"Provide an API Key from Anthropic for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",value:ve,saving:A,loading:G,badge:_e===0?"Primary":"Backup",onSave:async Ee=>{const Ae=[...I];Ae[_e]=Ee,await oa(Ae)},onDelete:async()=>{const Ee=I.filter((Ae,nt)=>nt!==_e);await oa(Ee)}})});const hn=d.filter(ve=>ve==="gemini_api_key").length;for(let ve=0;ve<hn;ve++)rt.push({id:`gemini_api_key_unsaved_${ve}`,name:"Gemini API Key",description:"Provide an API Key from Google AI Studio for AI features",iconUrl:"https://www.google.com/s2/favicons?domain=gemini.google.com&sz=128",value:null,saving:F,loading:q,startEditing:!0,onSave:async _e=>{const Ee=[...M,_e];await ka(Ee),f(Ae=>{const nt=Ae.indexOf("gemini_api_key");if(nt!==-1){const Lt=[...Ae];return Lt.splice(nt,1),Lt}return Ae})},onDelete:async()=>{f(_e=>{const Ee=_e.indexOf("gemini_api_key");if(Ee!==-1){const Ae=[..._e];return Ae.splice(Ee,1),Ae}return _e})}});const Vn=d.filter(ve=>ve==="openai_api_key").length;for(let ve=0;ve<Vn;ve++)rt.push({id:`openai_api_key_unsaved_${ve}`,name:"OpenAI API Key",description:"Provide an API Key from OpenAI for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/openai.svg",value:null,saving:ee,loading:H,startEditing:!0,onSave:async _e=>{const Ee=[...ue,_e];await Za(Ee),f(Ae=>{const nt=Ae.indexOf("openai_api_key");if(nt!==-1){const Lt=[...Ae];return Lt.splice(nt,1),Lt}return Ae})},onDelete:async()=>{f(_e=>{const Ee=_e.indexOf("openai_api_key");if(Ee!==-1){const Ae=[..._e];return Ae.splice(Ee,1),Ae}return _e})}});const _t=d.filter(ve=>ve==="anthropic_api_key").length;for(let ve=0;ve<_t;ve++)rt.push({id:`anthropic_api_key_unsaved_${ve}`,name:"Anthropic API Key",description:"Provide an API Key from Anthropic for AI features",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/claude.svg",value:null,saving:A,loading:G,startEditing:!0,onSave:async _e=>{const Ee=[...I,_e];await oa(Ee),f(Ae=>{const nt=Ae.indexOf("anthropic_api_key");if(nt!==-1){const Lt=[...Ae];return Lt.splice(nt,1),Lt}return Ae})},onDelete:async()=>{f(_e=>{const Ee=_e.indexOf("anthropic_api_key");if(Ee!==-1){const Ae=[..._e];return Ae.splice(Ee,1),Ae}return _e})}});return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[s.jsx(Fb,{tab:c,onTabChange:h}),c==="system"&&s.jsxs(s.Fragment,{children:[s.jsx(Vb,{keys:rt,availableProviders:ga,onAddProvider:ve=>f(_e=>[..._e,ve]),onConfirm:u}),s.jsx(Wb,{selection:mt,options:de,loading:L,onChange:st}),s.jsx(ey,{version:$c}),s.jsx(Gb,{onClearStorage:l})]}),c==="data"&&s.jsxs(s.Fragment,{children:[s.jsx(Qb,{captures:p,loading:S,onRefresh:$,onDelete:me}),s.jsx(Jb,{cookies:b,originsCount:j.length,loading:S,onClear:()=>l("cookies"),onDelete:se})]}),c==="proxies"&&s.jsx(Pb,{proxies:P,defaultProxyId:ce,includeDefaultInRotation:Oe,rotationMode:ze,loading:Fe,onRefresh:Re,onAdd:Ve,onImport:Bt,onUpdate:ht,onDelete:Wt,onDeleteMultiple:We,onSetDefault:xt,onToggleIncludeDefault:Xt,onRotationModeChange:it}),s.jsx("div",{className:"pt-8 flex justify-center border-t border-white/5 mt-8",children:s.jsx(Gp,{})})]})})},Jc=({title:l="Loading",subtitle:u})=>s.jsxs("div",{className:"fixed inset-0 z-[80] bg-[#020202] flex items-center justify-center",children:[s.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),s.jsxs("div",{className:"glass-card p-10 rounded-[40px] text-center space-y-4",children:[s.jsx("div",{className:"w-12 h-12 mx-auto rounded-full border border-white/10 flex items-center justify-center",children:s.jsx("div",{className:"w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin"})}),s.jsxs("div",{className:"space-y-2",children:[s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:l}),u&&s.jsx("p",{className:"text-xs font-mono text-white/80",children:u})]})]})]}),dr=140,ly=6,iy=4,sy=({index:l,style:u,data:o})=>{const c=o.items[l];return c?s.jsxs("div",{style:u,onClick:()=>o.navigate(`/executions/${c.id}`),onKeyDown:h=>{(h.key==="Enter"||h.key===" ")&&(h.preventDefault(),o.navigate(`/executions/${c.id}`))},role:"button",tabIndex:0,className:"glass-card w-full rounded-2xl p-5 flex items-center gap-4 text-left hover:bg-white/[0.06] transition-all cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[s.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:c.source==="api"?s.jsx(Ne,{name:"cloud",className:"text-xl"}):s.jsx(Ne,{name:"monitor",className:"text-xl"})}),s.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[s.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:c.taskName||c.mode}),s.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(c.timestamp).toLocaleString()," | ",c.source," | ",c.mode," | ",c.status," | ",c.durationMs,"ms"]}),c.url&&s.jsx("div",{className:"text-[9px] text-white/50 truncate font-mono",children:c.url})]}),s.jsx("button",{onClick:h=>{h.stopPropagation(),o.deleteExecution(c.id)},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-red-500/5 border border-red-500/10 text-red-400 hover:bg-red-500/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Delete execution ${c.id}`,children:"Delete"})]}):null},ry=({onConfirm:l,onNotify:u})=>{const o=sl(),[c,h]=z.useState([]),[d,f]=z.useState("all"),[p,x]=z.useState(!1),b=z.useCallback(async()=>{x(!0);try{const N=await fetch("/api/executions");if(!N.ok)throw new Error("Failed to load");const m=await N.json();h(Array.isArray(m.executions)?m.executions:[])}catch{h([])}finally{x(!1)}},[]),k=z.useCallback(async()=>{if(!await l("Clear all executions?"))return;(await fetch("/api/executions/clear",{method:"POST"})).ok?(u("Executions cleared.","success"),b()):u("Clear failed.","error")},[b,l,u]),j=z.useCallback(async N=>{if(!await l("Delete this execution?"))return;(await fetch(`/api/executions/${N}`,{method:"DELETE"})).ok?(u("Execution deleted.","success"),h(v=>v.filter(E=>E.id!==N))):u("Delete failed.","error")},[l,u]);z.useEffect(()=>{b()},[b]);const T=z.useMemo(()=>c.filter(N=>d==="all"?!0:N.source===d),[c,d]),S=z.useMemo(()=>({items:T,deleteExecution:j,navigate:o}),[T,j,o]);return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsx("div",{className:"space-y-2",children:s.jsx("h2",{className:"text-4xl font-bold tracking-tighter text-white",children:"Run History"})}),s.jsxs("div",{className:"flex items-center gap-3",children:[s.jsx("div",{className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["all","editor","api"].map(N=>s.jsx("button",{onClick:()=>f(N),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${d===N?"bg-white text-black":"text-gray-500 hover:text-white"}`,"aria-pressed":d===N,children:N},N))}),s.jsx("button",{onClick:b,disabled:p,"aria-busy":p,className:"w-10 h-10 rounded-2xl border border-white/10 text-gray-400 hover:text-white hover:bg-white/5 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 disabled:opacity-50 disabled:cursor-not-allowed",title:"Refresh","aria-label":"Refresh executions",children:s.jsx(Ne,{name:"sync",className:`text-xl ${p?"animate-spin":""}`})}),s.jsx("button",{onClick:k,className:"w-10 h-10 rounded-2xl border border-red-500/20 text-red-400 hover:bg-red-500/10 transition-all flex items-center justify-center focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Clear all","aria-label":"Clear all executions",children:s.jsx(Ne,{name:"delete",className:"text-xl"})})]})]}),p&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading executions..."}),!p&&T.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No executions found."}),!p&&T.length>0&&s.jsx(yr,{height:Math.min(Math.max(dr,T.length*dr),dr*ly),itemCount:T.length,itemSize:dr,width:"100%",overscanCount:iy,itemData:S,className:"custom-scrollbar",children:sy})]})})};function Pp(){const[l,u]=z.useState(null);return z.useEffect(()=>{let o=!1;return(async()=>{try{const h=await fetch("/api/headful/status");if(h.ok){const d=await h.json();o||u(!!d.useNovnc)}else o||u(!1)}catch{o||u(!1)}})(),()=>{o=!0}},[]),l}const oy=l=>{if(!l.result)return null;const u=l.result||{};return{url:l.url||u.url||"",finalUrl:u.final_url||u.finalUrl,html:u.html,data:u.data??u.html??"",screenshotUrl:u.screenshot_url||u.screenshotUrl,logs:u.logs||[],timestamp:new Date(l.timestamp).toLocaleTimeString()}},cy=({onConfirm:l,onNotify:u})=>{const{id:o}=Dp(),c=sl(),[h,d]=z.useState(null),[f,p]=z.useState(!1),x=Pp();if(z.useEffect(()=>{(async()=>{if(o){p(!0);try{const j=await fetch(`/api/executions/${o}`);if(!j.ok)throw new Error("Failed to load execution");const T=await j.json();d(T.execution||null)}catch{d(null)}finally{p(!1)}}})()},[o]),f)return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsx("div",{className:"max-w-6xl mx-auto text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading execution..."})});if(!h)return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[s.jsx("button",{onClick:()=>c("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"}),s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"Execution not found."})]})});const b=oy(h);return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:h.taskName||h.mode}),s.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(h.timestamp).toLocaleString()," | ",h.source," | ",h.mode," | ",h.status," | ",h.durationMs,"ms"]})]}),s.jsx("button",{onClick:()=>c("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Back"})]}),s.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col min-h-[420px]",children:[s.jsx("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:s.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"})}),b?s.jsx($p,{results:b,isExecuting:!1,onConfirm:l,onNotify:u,fullWidth:!0,useNovnc:x}):s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"No output captured."})]})]})})},uy=360,Wp=12,fr=uy+Wp,dy=6,fy=4,hy=({index:l,style:u,data:o})=>{const c=o.captures[l];return c?s.jsx("div",{style:{...u,paddingBottom:Wp},children:s.jsx(Ip,{capture:c,onDelete:o.onDelete})}):null},py=({onConfirm:l,onNotify:u})=>{const o=sl(),[c,h]=z.useState([]),[d,f]=z.useState(!1),p=async()=>{f(!0);try{const k=await fetch("/api/data/captures"),j=k.ok?await k.json():{captures:[]};h(Array.isArray(j.captures)?j.captures:[])}catch{h([])}finally{f(!1)}},x=z.useCallback(async k=>{if(!await l(`Delete capture ${k}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(k)}`,{method:"DELETE"})).ok?(h(S=>S.filter(N=>N.name!==k)),u("Capture deleted.","success")):u("Delete failed.","error")},[l,u]);z.useEffect(()=>{p()},[]);const b=z.useMemo(()=>({captures:c,onDelete:x}),[c,x]);return s.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:s.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[s.jsxs("div",{className:"flex items-end justify-between",children:[s.jsxs("div",{className:"space-y-2",children:[s.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:"All Captures"}),s.jsx("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:"Recordings and screenshots from every run"})]}),s.jsxs("div",{className:"flex items-center gap-2",children:[s.jsxs("button",{onClick:p,disabled:d,"aria-busy":d,className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all disabled:opacity-50 inline-flex items-center gap-2",children:[s.jsx(Ne,{name:"sync",className:`text-base ${d?"animate-spin":""}`}),"Refresh"]}),s.jsx("button",{onClick:()=>o("/executions"),className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",children:"Executions"})]})]}),s.jsxs("div",{className:"glass-card rounded-[32px] p-8",children:[d&&s.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!d&&c.length===0&&s.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!d&&c.length>0&&s.jsx("div",{className:"space-y-4",children:s.jsx(yr,{height:Math.min(Math.max(fr,c.length*fr),fr*dy),width:"100%",itemCount:c.length,itemSize:fr,overscanCount:fy,itemData:b,className:"custom-scrollbar",children:hy})})]})]})})},em=({title:l="Not Found",subtitle:u="The page you requested does not exist.",onBack:o})=>s.jsx("div",{className:"h-full flex items-center justify-center px-10",children:s.jsxs("div",{className:"glass-card w-full max-w-2xl rounded-[40px] border border-white/10 p-10 text-center space-y-6",children:[s.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"404"}),s.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:l}),s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-gray-500",children:u}),o&&s.jsxs("button",{onClick:o,className:"mt-2 inline-flex items-center gap-2 px-6 py-3 rounded-2xl bg-white text-black text-[9px] font-bold uppercase tracking-[0.3em] hover:scale-105 transition-all",children:[s.jsx(Ne,{name:"arrow_back",className:"text-base"}),"Back"]})]})}),my=({message:l,tone:u,onClose:o})=>{const[c,h]=z.useState(!1);return z.useEffect(()=>{const d=setTimeout(()=>{h(!0)},2500);return()=>clearTimeout(d)},[]),z.useEffect(()=>{if(!c)return;const d=setTimeout(()=>o(),240);return()=>clearTimeout(d)},[c,o]),s.jsx("div",{className:`fixed bottom-6 right-6 z-[220] max-w-sm w-full ${c?"animate-out fade-out slide-out-to-bottom-3 duration-200":"animate-in fade-in slide-in-from-bottom-3 duration-300"}`,children:s.jsxs("div",{className:`glass-card rounded-2xl border border-white/10 p-4 shadow-2xl flex items-start gap-3 ${c?"animate-out fade-out zoom-out-95 duration-200":"animate-in fade-in zoom-in-95 duration-300"}`,children:[s.jsx("div",{className:`mt-1 h-2.5 w-2.5 rounded-full ${u==="error"?"bg-red-400":"bg-emerald-400"}`}),s.jsxs("div",{className:"flex-1",children:[s.jsx("p",{className:"text-[8px] font-bold uppercase tracking-[0.35em] text-gray-500",children:"Notification"}),s.jsx("p",{className:"mt-2 font-mono text-[11px] text-white leading-relaxed",children:l})]}),s.jsx("button",{onClick:()=>h(!0),className:"px-2 py-1 text-[8px] font-bold uppercase tracking-[0.2em] text-white/60 hover:text-white",children:"Close"})]})})},xy=({request:l,onResolve:u})=>s.jsx("div",{className:"fixed inset-0 z-[201] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:s.jsxs("div",{className:"glass-card w-full max-w-md rounded-[32px] border border-white/10 p-8 text-center shadow-2xl",children:[s.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:l.title??"Confirm"}),s.jsx("p",{className:"mt-4 font-mono text-sm text-white",children:l.message}),s.jsxs("div",{className:"mt-6 flex gap-4",children:[s.jsx("button",{onClick:()=>u(!1),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white/5 border border-white/10 text-gray-300 hover:bg-white/10",children:l.cancelLabel??"Cancel"}),s.jsx("button",{onClick:()=>u(!0),className:"w-full rounded-2xl px-6 py-3 text-[9px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10",children:l.confirmLabel??"Confirm"})]})]})}),gy=({tasks:l,loadTasks:u,touchTask:o,currentTask:c,setCurrentTask:h,onTaskLoaded:d,...f})=>{const{id:p}=Dp(),x=sl(),[b,k]=z.useState(!1),[j,T]=z.useState(!1);return z.useEffect(()=>{(async()=>{if(c?.id===p)return;k(!0),T(!1);let N=l;l.length===0&&(N=await u());const m=N.find(w=>String(w.id)===String(p));if(m){const w={...m};(!w.variables||Array.isArray(w.variables))&&(w.variables={}),w.stealth||(w.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),w.stealth.cursorGlide===void 0&&(w.stealth.cursorGlide=w.stealth.humanCursor??!1),delete w.stealth.humanCursor,w.stealth.randomizeClicks===void 0&&(w.stealth.randomizeClicks=!1),Array.isArray(w.actions)&&(w.actions=w.actions.map((v,E)=>v&&v.id?v:{...v,id:`act_${Date.now()}_${E}_${Math.floor(Math.random()*1e3)}`})),w.includeShadowDom===void 0&&(w.includeShadowDom=!0),h(w),d?.(w),p&&o(p)}else T(!0);k(!1)})()},[p,l]),j?s.jsx(em,{title:"Task Not Found",subtitle:"This task does not exist or was deleted.",onBack:()=>x("/dashboard")}):b||!c||String(c.id)!==String(p)?s.jsx(Jc,{title:"Loading Mission Data",subtitle:"Syncing task payload"}):s.jsx(Jp,{currentTask:c,setCurrentTask:h,tasks:l,...f})},bp="doppelganger.seenReleaseNotes_0_8";function by(){const[l,u]=z.useState(!1),[o,c]=z.useState(""),[h,d]=z.useState(!0);z.useEffect(()=>{$c.startsWith("0.8.")&&(localStorage.getItem(bp)||(u(!0),f()))},[]);const f=async()=>{try{const x=await fetch("https://api.github.com/repos/figranium/figranium/releases/tags/v0.8.0");if(x.ok){const b=await x.json();c(b.body||"No release notes available.")}else c("Failed to load release notes. Please check our GitHub repository.")}catch{c("Failed to load release notes. Please check our GitHub repository.")}finally{d(!1)}},p=()=>{u(!1),localStorage.setItem(bp,"true")};return l?s.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:s.jsxs("div",{className:"glass-card w-full max-w-2xl max-h-[80vh] flex flex-col rounded-[32px] border border-white/10 p-8 text-left shadow-2xl overflow-hidden",children:[s.jsxs("div",{className:"flex justify-between items-center mb-6 shrink-0",children:[s.jsx("h2",{className:"text-lg md:text-2xl font-bold text-white tracking-tight",children:"What's new in v0.8.0"}),s.jsxs("span",{className:"bg-white/10 text-white/70 px-3 py-1 rounded-full text-xs font-mono ml-4 shrink-0",children:["v",$c]})]}),s.jsx("div",{className:"flex-1 overflow-y-auto pr-2 custom-scrollbar text-sm text-gray-300",children:h?s.jsx("div",{className:"flex justify-center items-center h-32",children:s.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):s.jsx("div",{className:"whitespace-pre-wrap font-mono text-xs",children:o})}),s.jsx("div",{className:"mt-8 flex justify-end shrink-0",children:s.jsx("button",{onClick:p,className:"rounded-2xl px-8 py-3 text-[10px] font-bold uppercase tracking-[0.3em] transition-all bg-white text-black hover:scale-105 shadow-xl shadow-white/10",children:"Got it"})})]})}):null}const yy=(l,u)=>{if(typeof l!="string"||!l)return u;switch(l){case"ALREADY_SETUP":return"An account already exists";case"INVALID":return"Invalid credentials";case"SESSION_SAVE_FAILED":return"Unable to persist your session";default:{const o=l.toLowerCase().replace(/_/g," ");return o.charAt(0).toUpperCase()+o.slice(1)}}};function vy(){const l=sl(),[u,o]=z.useState(null),[c,h]=z.useState("checking"),[d,f]=z.useState(""),[p,x]=z.useState(!1),b=z.useCallback(async()=>{try{const S=await(await fetch("/api/auth/me",{credentials:"include"})).json();if(S.authenticated)return o(S.user),h("authenticated"),!0;const m=await(await fetch("/api/auth/check-setup",{credentials:"include"})).json();h(m.setupRequired?"setup":"login")}catch{h("login")}return!1},[]);z.useEffect(()=>{b()},[b]);const k=z.useCallback(async(T,S,N,m)=>{if(!T||!S){f("Email and password are required");return}if(c==="setup"&&(!N||S!==m)){f(N?"Passwords do not match":"Name required");return}if(p)return;const w=c==="setup"?"/api/auth/setup":"/api/auth/login",v=c==="setup"?{name:N,email:T,password:S}:{email:T,password:S};x(!0);try{const E=await fetch(w,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(v)}),C=await E.json().catch(()=>({}));if(E.ok)f(""),h("checking"),await b()?l("/"):(f("Authentication failed"),h("login"));else{const U=c==="setup"?"Setup failed":"Invalid credentials";f(yy(C?.error,U))}}catch{f("Network error")}finally{x(!1)}},[c,p,l,b]),j=z.useCallback(async T=>{await T("Are you sure you want to log out?")&&(await fetch("/api/auth/logout",{method:"POST",credentials:"include"}),o(null),h("login"),l("/"))},[l]);return{user:u,setUser:o,authStatus:c,setAuthStatus:h,authError:d,authBusy:p,checkAuth:b,handleAuthSubmit:k,logout:j}}const yp=l=>{if(!l)return"";const u=JSON.parse(JSON.stringify(l));return delete u.last_opened,JSON.stringify(u)},xr=l=>{if(typeof l=="boolean")return l;if(l==null)return!1;const u=String(l).toLowerCase();return u==="true"||u==="1"},wy=l=>l&&l[0].toUpperCase()+l.slice(1),tm=l=>{if(!l.actions||!Array.isArray(l.actions))return l;let u=!1;const o=l.actions.map((c,h)=>c.id?c:(u=!0,{...c,id:`act_${Date.now()}_${h}_${Math.floor(Math.random()*1e3)}`}));return u?{...l,actions:o}:l},Sy=()=>({name:"Imported Task",url:"",mode:"scrape",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},includeShadowDom:!0,disableRecording:!1,statelessExecution:!1}),_y=(l,u)=>{if(!l||typeof l!="object")return null;const o=Sy(),c={...o,...l};return(!c.name||typeof c.name!="string")&&(c.name=`Imported Task ${u+1}`),(!c.mode||!["scrape","agent","headful"].includes(c.mode))&&(c.mode="scrape"),typeof c.wait!="number"&&(c.wait=3),c.stealth||(c.stealth=o.stealth),(!c.variables||Array.isArray(c.variables))&&(c.variables={}),Array.isArray(c.actions)||(c.actions=[]),c.rotateProxies===void 0&&(c.rotateProxies=!1),c.disableRecording===void 0&&(c.disableRecording=!1),c.disableRecording=xr(c.disableRecording),c.statelessExecution===void 0&&(c.statelessExecution=!1),c.statelessExecution=xr(c.statelessExecution),delete c.versions,delete c.last_opened,c},jy=()=>({name:"Task "+Math.floor(Math.random()*100),url:"",mode:"agent",wait:3,selector:"",rotateUserAgents:!1,rotateProxies:!1,rotateViewport:!1,humanTyping:!1,stealth:{allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1},actions:[],variables:{},extractionFormat:"json",includeShadowDom:!0,disableRecording:!1,statelessExecution:!1});function Ny(l,u,o){const[c,h]=z.useState([]),[d,f]=z.useState(null),p=z.useRef(null);z.useEffect(()=>{p.current=d},[d]);const x=z.useCallback(async()=>{try{const E=[...await(await fetch("/api/tasks",{credentials:"include"})).json()].sort((C,U)=>(U.last_opened||0)-(C.last_opened||0));return h(E),E}catch(w){return console.error("Failed to load tasks",w),[]}},[]),b=z.useCallback(async w=>{try{await fetch(`/api/tasks/${w}/touch`,{method:"POST"}),x()}catch(v){console.error("Failed to touch task",v)}},[x]),k=z.useCallback((w,v)=>{const E=jy();v(!0),f(E),w(null),l("/tasks/new")},[l]),j=z.useCallback((w,v,E)=>{const C={...w};(!C.variables||Array.isArray(C.variables))&&(C.variables={}),C.stealth||(C.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),C.stealth.cursorGlide===void 0&&(C.stealth.cursorGlide=C.stealth.humanCursor??!1),delete C.stealth.humanCursor,C.stealth.randomizeClicks===void 0&&(C.stealth.randomizeClicks=!1),C.rotateProxies===void 0&&(C.rotateProxies=!1),C.rotateViewport===void 0&&(C.rotateViewport=!1),C.extractionFormat||(C.extractionFormat="json"),C.includeShadowDom===void 0&&(C.includeShadowDom=!0),C.disableRecording===void 0&&(C.disableRecording=!1),C.disableRecording=xr(C.disableRecording),C.statelessExecution===void 0&&(C.statelessExecution=!1),C.statelessExecution=xr(C.statelessExecution);const U=tm(C);f(U),v(U),E(null),l(`/tasks/${w.id}`),w.id&&b(w.id)},[l,b]),T=z.useCallback(async(w,v)=>{await o("Are you sure you want to delete this task?")&&(await fetch(`/api/tasks/${w}`,{method:"DELETE"}),x(),v.includes(w)&&l("/dashboard"))},[o,x,l]),S=z.useCallback(async(w,v,E,C=!1)=>{const U=E||p.current;if(!U)return;const M={...U,last_opened:Date.now()},ne=await(await fetch(`/api/tasks${C?"?version=true":""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)})).json();f(ne),w(ne),x(),v.includes("new")&&l(`/tasks/${ne.id}`,{replace:!0})},[l,x]),N=z.useCallback(w=>{let v=c;if(w&&w.length>0&&(v=c.filter(q=>q.id&&w.includes(q.id))),v.length===0){u("No tasks selected to export.","error");return}const E={exportedAt:new Date().toISOString(),tasks:v},C=new Blob([JSON.stringify(E,null,2)],{type:"application/json"}),U=URL.createObjectURL(C),M=document.createElement("a"),Q=new Date().toISOString().slice(0,10);M.href=U,M.download=`doppelganger-tasks-${Q}.json`,document.body.appendChild(M),M.click(),M.remove(),URL.revokeObjectURL(U),u(`Exported ${v.length} task(s).`,"success")},[c,u]),m=z.useCallback(async w=>{try{const v=await w.text(),E=JSON.parse(v),C=Array.isArray(E)?E:E?.tasks;if(!Array.isArray(C)){u("Invalid import file.","error");return}const U=Date.now(),M=C.map((Q,q)=>_y(Q,q)).filter(Q=>!!Q).map(Q=>Q.id?Q:{...Q,id:`task_${U}`});if(M.length===0){u("No tasks to import.","error");return}await Promise.all(M.map(Q=>fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(Q)}))),await x(),u(`Imported ${M.length} task(s).`,"success")}catch(v){u(`Import failed: ${v.message||"Unknown error"}`,"error")}},[u,x]);return z.useEffect(()=>{x()},[x]),{tasks:c,setTasks:h,currentTask:d,setCurrentTask:f,loadTasks:x,touchTask:b,createNewTask:k,editTask:j,deleteTask:T,saveTask:S,exportTasks:N,importTasks:m}}const vp=(l,u)=>{const o=String(l||"").trim();if(!o)return"Execution failed.";const c=o.toLowerCase();if(u==="headful"){if(c.includes("missing x server")||c.includes("$display"))return"Headful browser could not start because no display server is available.";if(c.includes("failed to connect to the bus"))return"Headful browser could not start due to missing system services."}let h=o;const d=h.indexOf("--disable-");return d>0&&(h=h.slice(0,d).trim()),h.length>240&&(h=`${h.slice(0,240)}...`),h||"Execution failed."},Ey=l=>{const u=String(l||"").toLowerCase();return u.includes("missing x server")||u.includes("$display")||u.includes("platform failed to initialize")||u.includes("no display server")};function Cy(l){const[u,o]=z.useState(!1),[c,h]=z.useState(!1),[d,f]=z.useState(null),[p,x]=z.useState(null),b=Pp(),k=z.useRef(null),j=async()=>{try{await fetch("/headful/stop",{method:"POST"})}catch(m){console.error("Failed to stop headful session",m)}finally{h(!1)}};return{isExecuting:u,isHeadfulOpen:c,results:d,setResults:f,activeRunId:p,useNovnc:b,runTaskWithSnapshot:async(m,w,v)=>{if(!m||!m.url)return;const E=tm(m);w&&E!==w&&v(E);const C=`run_${Date.now()}_${Math.floor(Math.random()*1e3)}`;if(x(C),u)return;o(!0),f({url:E.url,logs:[],timestamp:"Running..."});let U=null;try{const M={};Object.entries(E.variables).forEach(([H,_])=>{M[H]=_.value});const Q=H=>H.replace(/\\{\$(\w+)\\}/g,(_,ee)=>{if(ee==="now")return new Date().toISOString();const K=M[ee];return K==null||K===""?"":String(K)}),q=H=>typeof H!="string"?H:Q(H),ne=E.mode!=="agent";U={...{...E,url:ne?Q(E.url||""):E.url||"",selector:ne?q(E.selector):E.selector,actions:ne?E.actions.map(H=>({...H,selector:q(H.selector),value:q(H.value),key:q(H.key)})):E.actions},taskVariables:M,variables:M,runSource:"editor",taskId:E.id,taskName:E.name,taskSnapshot:E,runId:C};const fe=async H=>{const _=new AbortController;k.current=_;const ee=await fetch(`/${H}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:_.signal});if(!ee.ok){let K=null;try{K=await ee.json()}catch{K=null}const I=new Error(K?.details||K?.error||"Request failed");throw I.code=K?.error,I}return ee.json()},ue=E.mode==="headful"?"scrape":E.mode,B=await fe(ue);f({url:E.url,finalUrl:B.final_url,html:B.html,data:B.data??B.html??"No data captured.",screenshotUrl:B.screenshot_url,downloads:B.downloads,logs:B.logs||[],timestamp:new Date().toLocaleTimeString()})}catch(M){if(M?.name==="AbortError"){l("Execution stopped.","success"),o(!1);return}if(E?.mode==="headful"&&U&&(M?.code==="HEADFUL_DISPLAY_UNAVAILABLE"||Ey(M?.message||String(M))))try{const q=await(async()=>{const ne=new AbortController;k.current=ne;const F=await fetch("/scrape",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:ne.signal});if(!F.ok){const fe=await F.json();throw new Error(fe.details||fe.error||"Request failed")}return F.json()})();q.logs=["Headful display unavailable; ran headless instead.",...q.logs||[]],f({url:E.url,finalUrl:q.final_url,html:q.html,data:q.data??q.html??"No data captured.",screenshotUrl:q.screenshot_url,downloads:q.downloads,logs:q.logs||[],timestamp:new Date().toLocaleTimeString()}),o(!1);return}catch(q){const ne=vp(q?.message||String(q),E?.mode);l(`Execution crash: ${ne}`,"error"),o(!1);return}const Q=vp(M?.message||String(M),E?.mode);l(`Execution crash: ${Q}`,"error"),E?.mode==="headful"&&o(!1)}finally{k.current=null,o(!1)}},stopTask:async()=>{if(p)try{await fetch("/api/executions/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({runId:p})})}catch(m){console.error("Failed to request stop",m)}k.current&&k.current.abort(),o(!1)},openHeadful:async m=>{if(c){await j();return}h(!0);try{const w=await fetch("/headful",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:m})});if(!w.ok){const v=await w.json().catch(()=>({})),E=v?.details||v?.error||"Failed to start headful session";l(E,"error"),h(!1)}}catch{l("Failed to start headful session","error"),h(!1)}},stopHeadful:j}}function ky(){const[l,u]=z.useState(null),[o,c]=z.useState(null),h=z.useRef(null),d=z.useCallback((x,b="success")=>{u({message:x,tone:b}),b==="success"&&setTimeout(()=>{u(k=>k&&k.message===x?null:k)},2e3)},[]),f=z.useCallback(x=>new Promise(b=>{h.current=b,c(typeof x=="string"?{message:x}:x)}),[]),p=z.useCallback(x=>{const b=h.current;h.current=null,c(null),b&&b(x)},[]);return{centerAlert:l,setCenterAlert:u,centerConfirm:o,showAlert:d,requestConfirm:f,closeConfirm:p}}function Ay(){const l=sl(),u=Yn(),{centerAlert:o,setCenterAlert:c,centerConfirm:h,showAlert:d,requestConfirm:f,closeConfirm:p}=ky(),{authStatus:x,authError:b,authBusy:k,handleAuthSubmit:j,logout:T}=vy(),{tasks:S,currentTask:N,setCurrentTask:m,loadTasks:w,touchTask:v,createNewTask:E,editTask:C,deleteTask:U,saveTask:M,exportTasks:Q,importTasks:q}=Ny(l,d,f),{isExecuting:ne,isHeadfulOpen:F,results:fe,setResults:ue,activeRunId:B,useNovnc:H,runTaskWithSnapshot:_,stopTask:ee,openHeadful:K,stopHeadful:I}=Cy(d);z.useEffect(()=>{x==="authenticated"&&w()},[x]);const[we,G]=z.useState(!1),he=z.useRef(""),[A,O]=z.useState("visual"),[P,W]=z.useState({}),ce="doppelganger.pinnedResults",Oe=(se=>se?.id?String(se.id):"new")(N),Te=N&&P[Oe]||null;z.useEffect(()=>{try{const se=localStorage.getItem(ce);if(se){const Y=JSON.parse(se);Y&&typeof Y=="object"&&W(Y)}}catch{}},[]),z.useEffect(()=>{try{localStorage.setItem(ce,JSON.stringify(P))}catch{}},[P]),z.useEffect(()=>{!u.pathname.startsWith("/tasks")&&A==="history"&&O("visual")},[u.pathname,A]),z.useEffect(()=>{u.pathname==="/tasks/new"&&!N&&E(ue,G)},[u.pathname]),z.useEffect(()=>{if(!N){G(!1);return}const se=yp(N);G(se!==he.current)},[N]),z.useEffect(()=>{if(typeof window>"u")return;const se=Y=>{we&&(Y.preventDefault(),Y.returnValue="")};return window.addEventListener("beforeunload",se),()=>window.removeEventListener("beforeunload",se)},[we]);const ze=z.useCallback(se=>{he.current=yp(se),G(!1)},[]),Ye=se=>{N&&W(Y=>({...Y,[Oe]:se}))},Fe=()=>{N&&W(se=>{const Y={...se};return delete Y[Oe],Y})},Xe=async se=>{if(!await f(`Delete all ${se}?`))return;await fetch(se==="screenshots"?"/api/clear-screenshots":"/api/clear-cookies",{method:"POST"}),d(`${wy(se)} cleared.`,"success")},mt=()=>u.pathname.startsWith("/tasks")?"editor":u.pathname==="/settings"?"settings":u.pathname==="/executions"?"executions":u.pathname==="/captures"?"captures":"dashboard",y=z.useCallback(se=>{se==="dashboard"?l("/dashboard"):se==="settings"?l("/settings"):se==="executions"?l("/executions"):se==="captures"&&l("/captures")},[l]),de=z.useCallback(()=>{E(ue,G)},[E,ue,G]),re=z.useCallback(se=>{C(se,ze,ue)},[C,ze,ue]),L=z.useCallback(se=>{U(se,u.pathname)},[U,u.pathname]),D=z.useCallback((se,Y)=>M(ze,u.pathname,se,Y),[M,ze,u.pathname]),$=z.useCallback(()=>{T(f)},[T,f]);let me;return x==="login"||x==="setup"?me=s.jsx(Jg,{status:x,onSubmit:j,error:b,busy:k}):x==="checking"?me=s.jsx(Jc,{title:"Authenticating",subtitle:"Verifying session state"}):me=s.jsxs("div",{className:"h-full flex flex-row overflow-hidden bg-[#020202]",children:[s.jsx(by,{}),s.jsx($g,{onNavigate:y,onNewTask:de,onLogout:$,currentScreen:mt()}),s.jsxs(hg,{children:[s.jsx(Ya,{path:"/",element:s.jsx(lp,{tasks:S,onNewTask:de,onEditTask:re,onDeleteTask:L,onExportTasks:Q,onImportTasks:q})}),s.jsx(Ya,{path:"/dashboard",element:s.jsx(lp,{tasks:S,onNewTask:de,onEditTask:re,onDeleteTask:L,onExportTasks:Q,onImportTasks:q})}),s.jsx(Ya,{path:"/tasks/new",element:N?s.jsx(Jp,{currentTask:N,setCurrentTask:m,tasks:S,editorView:A,setEditorView:O,isExecuting:ne,onSave:D,onRun:()=>_(N,N,m),onRunSnapshot:se=>_(se||N,N,m),results:fe,pinnedResults:Te,onConfirm:f,onNotify:d,onPinResults:Ye,onUnpinResults:Fe,runId:B,onStop:()=>ee(),isHeadfulOpen:F,onOpenHeadful:se=>K(se),onStopHeadful:I,useNovnc:H}):s.jsx(Jc,{title:"Initializing",subtitle:"Preparing task workspace"})}),s.jsx(Ya,{path:"/tasks/:id",element:s.jsx(gy,{tasks:S,loadTasks:w,touchTask:v,currentTask:N,setCurrentTask:m,editorView:A,setEditorView:O,isExecuting:ne,onSave:D,onRun:()=>_(N,N,m),onRunSnapshot:se=>_(se||N,N,m),results:fe,pinnedResults:Te,onConfirm:f,onNotify:d,onPinResults:Ye,onUnpinResults:Fe,runId:B,onStop:()=>ee(),onTaskLoaded:ze,isHeadfulOpen:F,onOpenHeadful:se=>K(se),onStopHeadful:I,useNovnc:H})}),s.jsx(Ya,{path:"/settings",element:s.jsx(ny,{onClearStorage:Xe,onConfirm:f,onNotify:d})}),s.jsx(Ya,{path:"/executions",element:s.jsx(ry,{onConfirm:f,onNotify:d})}),s.jsx(Ya,{path:"/executions/:id",element:s.jsx(cy,{onConfirm:f,onNotify:d})}),s.jsx(Ya,{path:"/captures",element:s.jsx(py,{onConfirm:f,onNotify:d})}),s.jsx(Ya,{path:"*",element:s.jsx(em,{onBack:()=>l("/dashboard")})})]})]}),s.jsxs("div",{className:"h-full",children:[o&&s.jsx(my,{message:o.message,tone:o.tone,onClose:()=>c(null)}),h&&s.jsx(xy,{request:h,onResolve:p}),me]})}x0.createRoot(document.getElementById("root")).render(s.jsx(qn.StrictMode,{children:s.jsx(Bg,{children:s.jsx(Ay,{})})}));