figranium 0.11.3 → 0.12.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,18 @@
1
+ (function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))u(f);new MutationObserver(f=>{for(const d of f)if(d.type==="childList")for(const h of d.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&u(h)}).observe(document,{childList:!0,subtree:!0});function r(f){const d={};return f.integrity&&(d.integrity=f.integrity),f.referrerPolicy&&(d.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?d.credentials="include":f.crossOrigin==="anonymous"?d.credentials="omit":d.credentials="same-origin",d}function u(f){if(f.ep)return;f.ep=!0;const d=r(f);fetch(f.href,d)}})();var Vs=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Vc(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Nc={exports:{}},ji={};var Kh;function d0(){if(Kh)return ji;Kh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function r(u,f,d){var h=null;if(d!==void 0&&(h=""+d),f.key!==void 0&&(h=""+f.key),"key"in f){d={};for(var p in f)p!=="key"&&(d[p]=f[p])}else d=f;return f=d.ref,{$$typeof:i,type:u,key:h,ref:f!==void 0?f:null,props:d}}return ji.Fragment=c,ji.jsx=r,ji.jsxs=r,ji}var Ih;function f0(){return Ih||(Ih=1,Nc.exports=d0()),Nc.exports}var l=f0(),_c={exports:{}},Ge={};var Gh;function h0(){if(Gh)return Ge;Gh=1;var i=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),d=Symbol.for("react.consumer"),h=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),g=Symbol.for("react.memo"),C=Symbol.for("react.lazy"),j=Symbol.for("react.activity"),E=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=E&&R[E]||R["@@iterator"],typeof R=="function"?R:null)}var _={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},m=Object.assign,b={};function S(R,B,W){this.props=R,this.context=B,this.refs=b,this.updater=W||_}S.prototype.isReactComponent={},S.prototype.setState=function(R,B){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,B,"setState")},S.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function y(){}y.prototype=S.prototype;function k(R,B,W){this.props=R,this.context=B,this.refs=b,this.updater=W||_}var U=k.prototype=new y;U.constructor=k,m(U,S.prototype),U.isPureReactComponent=!0;var O=Array.isArray;function M(){}var T={H:null,A:null,T:null,S:null},Z=Object.prototype.hasOwnProperty;function V(R,B,W){var ee=W.ref;return{$$typeof:i,type:R,key:B,ref:ee!==void 0?ee:null,props:W}}function ue(R,B){return V(R.type,B,R.props)}function oe(R){return typeof R=="object"&&R!==null&&R.$$typeof===i}function Y(R){var B={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(W){return B[W]})}var ae=/\/+/g;function z(R,B){return typeof R=="object"&&R!==null&&R.key!=null?Y(""+R.key):B.toString(36)}function I(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(M,M):(R.status="pending",R.then(function(B){R.status==="pending"&&(R.status="fulfilled",R.value=B)},function(B){R.status==="pending"&&(R.status="rejected",R.reason=B)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function X(R,B,W,ee,H){var ie=typeof R;(ie==="undefined"||ie==="boolean")&&(R=null);var Ee=!1;if(R===null)Ee=!0;else switch(ie){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(R.$$typeof){case i:case c:Ee=!0;break;case C:return Ee=R._init,X(Ee(R._payload),B,W,ee,H)}}if(Ee)return H=H(R),Ee=ee===""?"."+z(R,0):ee,O(H)?(W="",Ee!=null&&(W=Ee.replace(ae,"$&/")+"/"),X(H,B,W,"",function(qe){return qe})):H!=null&&(oe(H)&&(H=ue(H,W+(H.key==null||R&&R.key===H.key?"":(""+H.key).replace(ae,"$&/")+"/")+Ee)),B.push(H)),1;Ee=0;var ze=ee===""?".":ee+":";if(O(R))for(var Ae=0;Ae<R.length;Ae++)ee=R[Ae],ie=ze+z(ee,Ae),Ee+=X(ee,B,W,ie,H);else if(Ae=v(R),typeof Ae=="function")for(R=Ae.call(R),Ae=0;!(ee=R.next()).done;)ee=ee.value,ie=ze+z(ee,Ae++),Ee+=X(ee,B,W,ie,H);else if(ie==="object"){if(typeof R.then=="function")return X(I(R),B,W,ee,H);throw B=String(R),Error("Objects are not valid as a React child (found: "+(B==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":B)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function Q(R,B,W){if(R==null)return R;var ee=[],H=0;return X(R,ee,"","",function(ie){return B.call(W,ie,H++)}),ee}function Ne(R){if(R._status===-1){var B=R._result;B=B(),B.then(function(W){(R._status===0||R._status===-1)&&(R._status=1,R._result=W)},function(W){(R._status===0||R._status===-1)&&(R._status=2,R._result=W)}),R._status===-1&&(R._status=0,R._result=B)}if(R._status===1)return R._result.default;throw R._result}var $=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var B=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(B))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},re={map:Q,forEach:function(R,B,W){Q(R,function(){B.apply(this,arguments)},W)},count:function(R){var B=0;return Q(R,function(){B++}),B},toArray:function(R){return Q(R,function(B){return B})||[]},only:function(R){if(!oe(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Ge.Activity=j,Ge.Children=re,Ge.Component=S,Ge.Fragment=r,Ge.Profiler=f,Ge.PureComponent=k,Ge.StrictMode=u,Ge.Suspense=x,Ge.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=T,Ge.__COMPILER_RUNTIME={__proto__:null,c:function(R){return T.H.useMemoCache(R)}},Ge.cache=function(R){return function(){return R.apply(null,arguments)}},Ge.cacheSignal=function(){return null},Ge.cloneElement=function(R,B,W){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ee=m({},R.props),H=R.key;if(B!=null)for(ie in B.key!==void 0&&(H=""+B.key),B)!Z.call(B,ie)||ie==="key"||ie==="__self"||ie==="__source"||ie==="ref"&&B.ref===void 0||(ee[ie]=B[ie]);var ie=arguments.length-2;if(ie===1)ee.children=W;else if(1<ie){for(var Ee=Array(ie),ze=0;ze<ie;ze++)Ee[ze]=arguments[ze+2];ee.children=Ee}return V(R.type,H,ee)},Ge.createContext=function(R){return R={$$typeof:h,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:d,_context:R},R},Ge.createElement=function(R,B,W){var ee,H={},ie=null;if(B!=null)for(ee in B.key!==void 0&&(ie=""+B.key),B)Z.call(B,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(H[ee]=B[ee]);var Ee=arguments.length-2;if(Ee===1)H.children=W;else if(1<Ee){for(var ze=Array(Ee),Ae=0;Ae<Ee;Ae++)ze[Ae]=arguments[Ae+2];H.children=ze}if(R&&R.defaultProps)for(ee in Ee=R.defaultProps,Ee)H[ee]===void 0&&(H[ee]=Ee[ee]);return V(R,ie,H)},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(R){return{$$typeof:p,render:R}},Ge.isValidElement=oe,Ge.lazy=function(R){return{$$typeof:C,_payload:{_status:-1,_result:R},_init:Ne}},Ge.memo=function(R,B){return{$$typeof:g,type:R,compare:B===void 0?null:B}},Ge.startTransition=function(R){var B=T.T,W={};T.T=W;try{var ee=R(),H=T.S;H!==null&&H(W,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(M,$)}catch(ie){$(ie)}finally{B!==null&&W.types!==null&&(B.types=W.types),T.T=B}},Ge.unstable_useCacheRefresh=function(){return T.H.useCacheRefresh()},Ge.use=function(R){return T.H.use(R)},Ge.useActionState=function(R,B,W){return T.H.useActionState(R,B,W)},Ge.useCallback=function(R,B){return T.H.useCallback(R,B)},Ge.useContext=function(R){return T.H.useContext(R)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(R,B){return T.H.useDeferredValue(R,B)},Ge.useEffect=function(R,B){return T.H.useEffect(R,B)},Ge.useEffectEvent=function(R){return T.H.useEffectEvent(R)},Ge.useId=function(){return T.H.useId()},Ge.useImperativeHandle=function(R,B,W){return T.H.useImperativeHandle(R,B,W)},Ge.useInsertionEffect=function(R,B){return T.H.useInsertionEffect(R,B)},Ge.useLayoutEffect=function(R,B){return T.H.useLayoutEffect(R,B)},Ge.useMemo=function(R,B){return T.H.useMemo(R,B)},Ge.useOptimistic=function(R,B){return T.H.useOptimistic(R,B)},Ge.useReducer=function(R,B,W){return T.H.useReducer(R,B,W)},Ge.useRef=function(R){return T.H.useRef(R)},Ge.useState=function(R){return T.H.useState(R)},Ge.useSyncExternalStore=function(R,B,W){return T.H.useSyncExternalStore(R,B,W)},Ge.useTransition=function(){return T.H.useTransition()},Ge.version="19.2.3",Ge}var Vh;function Xc(){return Vh||(Vh=1,_c.exports=h0()),_c.exports}var A=Xc();const tt=Vc(A);var Cc={exports:{}},Si={},kc={exports:{}},Ec={};var Xh;function p0(){return Xh||(Xh=1,(function(i){function c(X,Q){var Ne=X.length;X.push(Q);e:for(;0<Ne;){var $=Ne-1>>>1,re=X[$];if(0<f(re,Q))X[$]=Q,X[Ne]=re,Ne=$;else break e}}function r(X){return X.length===0?null:X[0]}function u(X){if(X.length===0)return null;var Q=X[0],Ne=X.pop();if(Ne!==Q){X[0]=Ne;e:for(var $=0,re=X.length,R=re>>>1;$<R;){var B=2*($+1)-1,W=X[B],ee=B+1,H=X[ee];if(0>f(W,Ne))ee<re&&0>f(H,W)?(X[$]=H,X[ee]=Ne,$=ee):(X[$]=W,X[B]=Ne,$=B);else if(ee<re&&0>f(H,Ne))X[$]=H,X[ee]=Ne,$=ee;else break e}}return Q}function f(X,Q){var Ne=X.sortIndex-Q.sortIndex;return Ne!==0?Ne:X.id-Q.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var d=performance;i.unstable_now=function(){return d.now()}}else{var h=Date,p=h.now();i.unstable_now=function(){return h.now()-p}}var x=[],g=[],C=1,j=null,E=3,v=!1,_=!1,m=!1,b=!1,S=typeof setTimeout=="function"?setTimeout:null,y=typeof clearTimeout=="function"?clearTimeout:null,k=typeof setImmediate<"u"?setImmediate:null;function U(X){for(var Q=r(g);Q!==null;){if(Q.callback===null)u(g);else if(Q.startTime<=X)u(g),Q.sortIndex=Q.expirationTime,c(x,Q);else break;Q=r(g)}}function O(X){if(m=!1,U(X),!_)if(r(x)!==null)_=!0,M||(M=!0,Y());else{var Q=r(g);Q!==null&&I(O,Q.startTime-X)}}var M=!1,T=-1,Z=5,V=-1;function ue(){return b?!0:!(i.unstable_now()-V<Z)}function oe(){if(b=!1,M){var X=i.unstable_now();V=X;var Q=!0;try{e:{_=!1,m&&(m=!1,y(T),T=-1),v=!0;var Ne=E;try{t:{for(U(X),j=r(x);j!==null&&!(j.expirationTime>X&&ue());){var $=j.callback;if(typeof $=="function"){j.callback=null,E=j.priorityLevel;var re=$(j.expirationTime<=X);if(X=i.unstable_now(),typeof re=="function"){j.callback=re,U(X),Q=!0;break t}j===r(x)&&u(x),U(X)}else u(x);j=r(x)}if(j!==null)Q=!0;else{var R=r(g);R!==null&&I(O,R.startTime-X),Q=!1}}break e}finally{j=null,E=Ne,v=!1}Q=void 0}}finally{Q?Y():M=!1}}}var Y;if(typeof k=="function")Y=function(){k(oe)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,z=ae.port2;ae.port1.onmessage=oe,Y=function(){z.postMessage(null)}}else Y=function(){S(oe,0)};function I(X,Q){T=S(function(){X(i.unstable_now())},Q)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(X){X.callback=null},i.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<X?Math.floor(1e3/X):5},i.unstable_getCurrentPriorityLevel=function(){return E},i.unstable_next=function(X){switch(E){case 1:case 2:case 3:var Q=3;break;default:Q=E}var Ne=E;E=Q;try{return X()}finally{E=Ne}},i.unstable_requestPaint=function(){b=!0},i.unstable_runWithPriority=function(X,Q){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var Ne=E;E=X;try{return Q()}finally{E=Ne}},i.unstable_scheduleCallback=function(X,Q,Ne){var $=i.unstable_now();switch(typeof Ne=="object"&&Ne!==null?(Ne=Ne.delay,Ne=typeof Ne=="number"&&0<Ne?$+Ne:$):Ne=$,X){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=Ne+re,X={id:C++,callback:Q,priorityLevel:X,startTime:Ne,expirationTime:re,sortIndex:-1},Ne>$?(X.sortIndex=Ne,c(g,X),r(x)===null&&X===r(g)&&(m?(y(T),T=-1):m=!0,I(O,Ne-$))):(X.sortIndex=re,c(x,X),_||v||(_=!0,M||(M=!0,Y()))),X},i.unstable_shouldYield=ue,i.unstable_wrapCallback=function(X){var Q=E;return function(){var Ne=E;E=Q;try{return X.apply(this,arguments)}finally{E=Ne}}}})(Ec)),Ec}var Zh;function m0(){return Zh||(Zh=1,kc.exports=p0()),kc.exports}var Ac={exports:{}},Bt={};var $h;function x0(){if($h)return Bt;$h=1;var i=Xc();function c(x){var g="https://react.dev/errors/"+x;if(1<arguments.length){g+="?args[]="+encodeURIComponent(arguments[1]);for(var C=2;C<arguments.length;C++)g+="&args[]="+encodeURIComponent(arguments[C])}return"Minified React error #"+x+"; visit "+g+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function r(){}var u={d:{f:r,r:function(){throw Error(c(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},f=Symbol.for("react.portal");function d(x,g,C){var j=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:j==null?null:""+j,children:x,containerInfo:g,implementation:C}}var h=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(x,g){if(x==="font")return"";if(typeof g=="string")return g==="use-credentials"?g:""}return Bt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=u,Bt.createPortal=function(x,g){var C=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!g||g.nodeType!==1&&g.nodeType!==9&&g.nodeType!==11)throw Error(c(299));return d(x,g,null,C)},Bt.flushSync=function(x){var g=h.T,C=u.p;try{if(h.T=null,u.p=2,x)return x()}finally{h.T=g,u.p=C,u.d.f()}},Bt.preconnect=function(x,g){typeof x=="string"&&(g?(g=g.crossOrigin,g=typeof g=="string"?g==="use-credentials"?g:"":void 0):g=null,u.d.C(x,g))},Bt.prefetchDNS=function(x){typeof x=="string"&&u.d.D(x)},Bt.preinit=function(x,g){if(typeof x=="string"&&g&&typeof g.as=="string"){var C=g.as,j=p(C,g.crossOrigin),E=typeof g.integrity=="string"?g.integrity:void 0,v=typeof g.fetchPriority=="string"?g.fetchPriority:void 0;C==="style"?u.d.S(x,typeof g.precedence=="string"?g.precedence:void 0,{crossOrigin:j,integrity:E,fetchPriority:v}):C==="script"&&u.d.X(x,{crossOrigin:j,integrity:E,fetchPriority:v,nonce:typeof g.nonce=="string"?g.nonce:void 0})}},Bt.preinitModule=function(x,g){if(typeof x=="string")if(typeof g=="object"&&g!==null){if(g.as==null||g.as==="script"){var C=p(g.as,g.crossOrigin);u.d.M(x,{crossOrigin:C,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0})}}else g==null&&u.d.M(x)},Bt.preload=function(x,g){if(typeof x=="string"&&typeof g=="object"&&g!==null&&typeof g.as=="string"){var C=g.as,j=p(C,g.crossOrigin);u.d.L(x,C,{crossOrigin:j,integrity:typeof g.integrity=="string"?g.integrity:void 0,nonce:typeof g.nonce=="string"?g.nonce:void 0,type:typeof g.type=="string"?g.type:void 0,fetchPriority:typeof g.fetchPriority=="string"?g.fetchPriority:void 0,referrerPolicy:typeof g.referrerPolicy=="string"?g.referrerPolicy:void 0,imageSrcSet:typeof g.imageSrcSet=="string"?g.imageSrcSet:void 0,imageSizes:typeof g.imageSizes=="string"?g.imageSizes:void 0,media:typeof g.media=="string"?g.media:void 0})}},Bt.preloadModule=function(x,g){if(typeof x=="string")if(g){var C=p(g.as,g.crossOrigin);u.d.m(x,{as:typeof g.as=="string"&&g.as!=="script"?g.as:void 0,crossOrigin:C,integrity:typeof g.integrity=="string"?g.integrity:void 0})}else u.d.m(x)},Bt.requestFormReset=function(x){u.d.r(x)},Bt.unstable_batchedUpdates=function(x,g){return x(g)},Bt.useFormState=function(x,g,C){return h.H.useFormState(x,g,C)},Bt.useFormStatus=function(){return h.H.useHostTransitionStatus()},Bt.version="19.2.3",Bt}var Qh;function Np(){if(Qh)return Ac.exports;Qh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Ac.exports=x0(),Ac.exports}var Fh;function g0(){if(Fh)return Si;Fh=1;var i=m0(),c=Xc(),r=Np();function u(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 f(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 h(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(u(188))}function g(e){var t=e.alternate;if(!t){if(t=d(e),t===null)throw Error(u(188));return t!==e?null:e}for(var a=e,n=t;;){var s=a.return;if(s===null)break;var o=s.alternate;if(o===null){if(n=s.return,n!==null){a=n;continue}break}if(s.child===o.child){for(o=s.child;o;){if(o===a)return x(s),e;if(o===n)return x(s),t;o=o.sibling}throw Error(u(188))}if(a.return!==n.return)a=s,n=o;else{for(var w=!1,D=s.child;D;){if(D===a){w=!0,a=s,n=o;break}if(D===n){w=!0,n=s,a=o;break}D=D.sibling}if(!w){for(D=o.child;D;){if(D===a){w=!0,a=o,n=s;break}if(D===n){w=!0,n=o,a=s;break}D=D.sibling}if(!w)throw Error(u(189))}}if(a.alternate!==n)throw Error(u(190))}if(a.tag!==3)throw Error(u(188));return a.stateNode.current===a?e:t}function C(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=C(e),t!==null)return t;e=e.sibling}return null}var j=Object.assign,E=Symbol.for("react.element"),v=Symbol.for("react.transitional.element"),_=Symbol.for("react.portal"),m=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),y=Symbol.for("react.consumer"),k=Symbol.for("react.context"),U=Symbol.for("react.forward_ref"),O=Symbol.for("react.suspense"),M=Symbol.for("react.suspense_list"),T=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),V=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),oe=Symbol.iterator;function Y(e){return e===null||typeof e!="object"?null:(e=oe&&e[oe]||e["@@iterator"],typeof e=="function"?e:null)}var ae=Symbol.for("react.client.reference");function z(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case m:return"Fragment";case S:return"Profiler";case b:return"StrictMode";case O:return"Suspense";case M:return"SuspenseList";case V:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case _:return"Portal";case k:return e.displayName||"Context";case y: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 T:return t=e.displayName||null,t!==null?t:z(e.type)||"Memo";case Z:t=e._payload,e=e._init;try{return z(e(t))}catch{}}return null}var I=Array.isArray,X=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ne={pending:!1,data:null,method:null,action:null},$=[],re=-1;function R(e){return{current:e}}function B(e){0>re||(e.current=$[re],$[re]=null,re--)}function W(e,t){re++,$[re]=e.current,e.current=t}var ee=R(null),H=R(null),ie=R(null),Ee=R(null);function ze(e,t){switch(W(ie,t),W(H,e),W(ee,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}}B(ee),W(ee,e)}function Ae(){B(ee),B(H),B(ie)}function qe(e){e.memoizedState!==null&&W(Ee,e);var t=ee.current,a=fh(t,e.type);t!==a&&(W(H,e),W(ee,a))}function Ke(e){H.current===e&&(B(ee),B(H)),Ee.current===e&&(B(Ee),bi._currentValue=Ne)}var pt,ot;function N(e){if(pt===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);pt=t&&t[1]||"",ot=-1<a.stack.indexOf(`
2
+ at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
3
+ `+pt+e+ot}var xe=!1;function te(e,t){if(!e||xe)return"";xe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var Se=function(){throw Error()};if(Object.defineProperty(Se.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Se,[])}catch(fe){var se=fe}Reflect.construct(e,[],Se)}else{try{Se.call()}catch(fe){se=fe}e.call(Se.prototype)}}else{try{throw Error()}catch(fe){se=fe}(Se=e())&&typeof Se.catch=="function"&&Se.catch(function(){})}}catch(fe){if(fe&&se&&typeof fe.stack=="string")return[fe.stack,se.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var s=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");s&&s.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var o=n.DetermineComponentFrameRoot(),w=o[0],D=o[1];if(w&&D){var G=w.split(`
4
+ `),le=D.split(`
5
+ `);for(s=n=0;n<G.length&&!G[n].includes("DetermineComponentFrameRoot");)n++;for(;s<le.length&&!le[s].includes("DetermineComponentFrameRoot");)s++;if(n===G.length||s===le.length)for(n=G.length-1,s=le.length-1;1<=n&&0<=s&&G[n]!==le[s];)s--;for(;1<=n&&0<=s;n--,s--)if(G[n]!==le[s]){if(n!==1||s!==1)do if(n--,s--,0>s||G[n]!==le[s]){var ge=`
6
+ `+G[n].replace(" at new "," at ");return e.displayName&&ge.includes("<anonymous>")&&(ge=ge.replace("<anonymous>",e.displayName)),ge}while(1<=n&&0<=s);break}}}finally{xe=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?N(a):""}function q(e,t){switch(e.tag){case 26:case 27:case 5:return N(e.type);case 16:return N("Lazy");case 13:return e.child!==t&&t!==null?N("Suspense Fallback"):N("Suspense");case 19:return N("SuspenseList");case 0:case 15:return te(e.type,!1);case 11:return te(e.type.render,!1);case 1:return te(e.type,!0);case 31:return N("Activity");default:return""}}function L(e){try{var t="",a=null;do t+=q(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
7
+ Error generating stack: `+n.message+`
8
+ `+n.stack}}var J=Object.prototype.hasOwnProperty,me=i.unstable_scheduleCallback,ce=i.unstable_cancelCallback,K=i.unstable_shouldYield,we=i.unstable_requestPaint,Ce=i.unstable_now,je=i.unstable_getCurrentPriorityLevel,Oe=i.unstable_ImmediatePriority,Ve=i.unstable_UserBlockingPriority,He=i.unstable_NormalPriority,it=i.unstable_LowPriority,be=i.unstable_IdlePriority,ye=i.log,Re=i.unstable_setDisableYieldValue,Me=null,Be=null;function Ie(e){if(typeof ye=="function"&&Re(e),Be&&typeof Be.setStrictMode=="function")try{Be.setStrictMode(Me,e)}catch{}}var Te=Math.clz32?Math.clz32:ha,$e=Math.log,rt=Math.LN2;function ha(e){return e>>>=0,e===0?32:31-($e(e)/rt|0)|0}var ga=256,_a=262144,ta=4194304;function qt(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 Kn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var s=0,o=e.suspendedLanes,w=e.pingedLanes;e=e.warmLanes;var D=n&134217727;return D!==0?(n=D&~o,n!==0?s=qt(n):(w&=D,w!==0?s=qt(w):a||(a=D&~e,a!==0&&(s=qt(a))))):(D=n&~o,D!==0?s=qt(D):w!==0?s=qt(w):a||(a=n&~e,a!==0&&(s=qt(a)))),s===0?0:t!==0&&t!==s&&(t&o)===0&&(o=s&-s,a=t&-t,o>=a||o===32&&(a&4194048)!==0)?t:s}function bn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function fr(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 zi(){var e=ta;return ta<<=1,(ta&62914560)===0&&(ta=4194304),e}function zl(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function yn(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Rl(e,t,a,n,s,o){var w=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 D=e.entanglements,G=e.expirationTimes,le=e.hiddenUpdates;for(a=w&~a;0<a;){var ge=31-Te(a),Se=1<<ge;D[ge]=0,G[ge]=-1;var se=le[ge];if(se!==null)for(le[ge]=null,ge=0;ge<se.length;ge++){var fe=se[ge];fe!==null&&(fe.lane&=-536870913)}a&=~Se}n!==0&&In(e,n,0),o!==0&&s===0&&e.tag!==0&&(e.suspendedLanes|=o&~(w&~t))}function In(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Te(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Ol(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Te(a),s=1<<n;s&t|e[n]&t&&(e[n]|=t),a&=~s}}function Gn(e,t){var a=t&-t;return a=(a&42)!==0?1:vn(a),(a&(e.suspendedLanes|t))!==0?0:a}function vn(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 Dl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Ri(){var e=Q.p;return e!==0?e:(e=window.event,e===void 0?32:Mh(e.type))}function Oi(e,t){var a=Q.p;try{return Q.p=e,t()}finally{Q.p=a}}var At=Math.random().toString(36).slice(2),Rt="__reactFiber$"+At,Lt="__reactProps$"+At,wn="__reactContainer$"+At,Tl="__reactEvents$"+At,hr="__reactListeners$"+At,pr="__reactHandles$"+At,mr="__reactResources$"+At,jn="__reactMarker$"+At;function de(e){delete e[Rt],delete e[Lt],delete e[Tl],delete e[hr],delete e[pr]}function pe(e){var t=e[Rt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[wn]||a[Rt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=yh(e);e!==null;){if(a=e[Rt])return a;e=yh(e)}return t}e=a,a=e.parentNode}return null}function _e(e){if(e=e[Rt]||e[wn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function ke(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Qe(e){var t=e[mr];return t||(t=e[mr]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function at(e){e[jn]=!0}var Pc=new Set,Wc={};function Sn(e,t){Vn(e,t),Vn(e+"Capture",t)}function Vn(e,t){for(Wc[e]=t,e=0;e<t.length;e++)Pc.add(t[e])}var am=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]*$"),eu={},tu={};function nm(e){return J.call(tu,e)?!0:J.call(eu,e)?!1:am.test(e)?tu[e]=!0:(eu[e]=!0,!1)}function Di(e,t,a){if(nm(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 Ti(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 Ca(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 aa(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function au(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function lm(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 s=n.get,o=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return s.call(this)},set:function(w){a=""+w,o.call(this,w)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(w){a=""+w},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function xr(e){if(!e._valueTracker){var t=au(e)?"checked":"value";e._valueTracker=lm(e,t,""+e[t])}}function nu(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=au(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Mi(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 im=/[\n"\\]/g;function na(e){return e.replace(im,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function gr(e,t,a,n,s,o,w,D){e.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?e.type=w:e.removeAttribute("type"),t!=null?w==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+aa(t)):e.value!==""+aa(t)&&(e.value=""+aa(t)):w!=="submit"&&w!=="reset"||e.removeAttribute("value"),t!=null?br(e,w,aa(t)):a!=null?br(e,w,aa(a)):n!=null&&e.removeAttribute("value"),s==null&&o!=null&&(e.defaultChecked=!!o),s!=null&&(e.checked=s&&typeof s!="function"&&typeof s!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.name=""+aa(D):e.removeAttribute("name")}function lu(e,t,a,n,s,o,w,D){if(o!=null&&typeof o!="function"&&typeof o!="symbol"&&typeof o!="boolean"&&(e.type=o),t!=null||a!=null){if(!(o!=="submit"&&o!=="reset"||t!=null)){xr(e);return}a=a!=null?""+aa(a):"",t=t!=null?""+aa(t):a,D||t===e.value||(e.value=t),e.defaultValue=t}n=n??s,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=D?e.checked:!!n,e.defaultChecked=!!n,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(e.name=w),xr(e)}function br(e,t,a){t==="number"&&Mi(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Xn(e,t,a,n){if(e=e.options,t){t={};for(var s=0;s<a.length;s++)t["$"+a[s]]=!0;for(a=0;a<e.length;a++)s=t.hasOwnProperty("$"+e[a].value),e[a].selected!==s&&(e[a].selected=s),s&&n&&(e[a].defaultSelected=!0)}else{for(a=""+aa(a),t=null,s=0;s<e.length;s++){if(e[s].value===a){e[s].selected=!0,n&&(e[s].defaultSelected=!0);return}t!==null||e[s].disabled||(t=e[s])}t!==null&&(t.selected=!0)}}function iu(e,t,a){if(t!=null&&(t=""+aa(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+aa(a):""}function su(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(u(92));if(I(n)){if(1<n.length)throw Error(u(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=aa(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),xr(e)}function Zn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var sm=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||sm.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(u(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 s in t)n=t[s],t.hasOwnProperty(s)&&a[s]!==n&&ru(e,s,n)}else for(var o in t)t.hasOwnProperty(o)&&ru(e,o,t[o])}function yr(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 rm=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"]]),om=/^[\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 Ui(e){return om.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ka(){}var vr=null;function wr(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var $n=null,Qn=null;function cu(e){var t=_e(e);if(t&&(e=t.stateNode)){var a=e[Lt]||null;e:switch(e=t.stateNode,t.type){case"input":if(gr(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="'+na(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var s=n[Lt]||null;if(!s)throw Error(u(90));gr(n,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&nu(n)}break e;case"textarea":iu(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Xn(e,!!a.multiple,t,!1)}}}var jr=!1;function uu(e,t,a){if(jr)return e(t,a);jr=!0;try{var n=e(t);return n}finally{if(jr=!1,($n!==null||Qn!==null)&&(Ss(),$n&&(t=$n,e=Qn,Qn=$n=null,cu(t),e)))for(t=0;t<e.length;t++)cu(e[t])}}function Ml(e,t){var a=e.stateNode;if(a===null)return null;var n=a[Lt]||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(u(231,t,typeof a));return a}var Ea=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Sr=!1;if(Ea)try{var Ul={};Object.defineProperty(Ul,"passive",{get:function(){Sr=!0}}),window.addEventListener("test",Ul,Ul),window.removeEventListener("test",Ul,Ul)}catch{Sr=!1}var Xa=null,Nr=null,Bi=null;function du(){if(Bi)return Bi;var e,t=Nr,a=t.length,n,s="value"in Xa?Xa.value:Xa.textContent,o=s.length;for(e=0;e<a&&t[e]===s[e];e++);var w=a-e;for(n=1;n<=w&&t[a-n]===s[o-n];n++);return Bi=s.slice(e,1<n?1-n:void 0)}function Li(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 Hi(){return!0}function fu(){return!1}function Kt(e){function t(a,n,s,o,w){this._reactName=a,this._targetInst=s,this.type=n,this.nativeEvent=o,this.target=w,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(a=e[D],this[D]=a?a(o):o[D]);return this.isDefaultPrevented=(o.defaultPrevented!=null?o.defaultPrevented:o.returnValue===!1)?Hi: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=Hi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Hi)},persist:function(){},isPersistent:Hi}),t}var Nn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Yi=Kt(Nn),Bl=j({},Nn,{view:0,detail:0}),cm=Kt(Bl),_r,Cr,Ll,qi=j({},Bl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Er,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!==Ll&&(Ll&&e.type==="mousemove"?(_r=e.screenX-Ll.screenX,Cr=e.screenY-Ll.screenY):Cr=_r=0,Ll=e),_r)},movementY:function(e){return"movementY"in e?e.movementY:Cr}}),hu=Kt(qi),um=j({},qi,{dataTransfer:0}),dm=Kt(um),fm=j({},Bl,{relatedTarget:0}),kr=Kt(fm),hm=j({},Nn,{animationName:0,elapsedTime:0,pseudoElement:0}),pm=Kt(hm),mm=j({},Nn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),xm=Kt(mm),gm=j({},Nn,{data:0}),pu=Kt(gm),bm={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ym={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"},vm={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function wm(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=vm[e])?!!t[e]:!1}function Er(){return wm}var jm=j({},Bl,{key:function(e){if(e.key){var t=bm[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ym[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Er,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Sm=Kt(jm),Nm=j({},qi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mu=Kt(Nm),_m=j({},Bl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Er}),Cm=Kt(_m),km=j({},Nn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Em=Kt(km),Am=j({},qi,{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}),zm=Kt(Am),Rm=j({},Nn,{newState:0,oldState:0}),Om=Kt(Rm),Dm=[9,13,27,32],Ar=Ea&&"CompositionEvent"in window,Hl=null;Ea&&"documentMode"in document&&(Hl=document.documentMode);var Tm=Ea&&"TextEvent"in window&&!Hl,xu=Ea&&(!Ar||Hl&&8<Hl&&11>=Hl),gu=" ",bu=!1;function yu(e,t){switch(e){case"keyup":return Dm.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 Fn=!1;function Mm(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 Um(e,t){if(Fn)return e==="compositionend"||!Ar&&yu(e,t)?(e=du(),Bi=Nr=Xa=null,Fn=!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 Bm={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"?!!Bm[e.type]:t==="textarea"}function ju(e,t,a,n){$n?Qn?Qn.push(n):Qn=[n]:$n=n,t=zs(t,"onChange"),0<t.length&&(a=new Yi("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var Yl=null,ql=null;function Lm(e){ih(e,0)}function Ki(e){var t=ke(e);if(nu(t))return e}function Su(e,t){if(e==="change")return t}var Nu=!1;if(Ea){var zr;if(Ea){var Rr="oninput"in document;if(!Rr){var _u=document.createElement("div");_u.setAttribute("oninput","return;"),Rr=typeof _u.oninput=="function"}zr=Rr}else zr=!1;Nu=zr&&(!document.documentMode||9<document.documentMode)}function Cu(){Yl&&(Yl.detachEvent("onpropertychange",ku),ql=Yl=null)}function ku(e){if(e.propertyName==="value"&&Ki(ql)){var t=[];ju(t,ql,e,wr(e)),uu(Lm,t)}}function Hm(e,t,a){e==="focusin"?(Cu(),Yl=t,ql=a,Yl.attachEvent("onpropertychange",ku)):e==="focusout"&&Cu()}function Ym(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ki(ql)}function qm(e,t){if(e==="click")return Ki(t)}function Km(e,t){if(e==="input"||e==="change")return Ki(t)}function Im(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var $t=typeof Object.is=="function"?Object.is:Im;function Kl(e,t){if($t(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 s=a[n];if(!J.call(t,s)||!$t(e[s],t[s]))return!1}return!0}function Eu(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Au(e,t){var a=Eu(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=Eu(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 Ru(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Mi(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=Mi(e.document)}return t}function Or(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 Gm=Ea&&"documentMode"in document&&11>=document.documentMode,Jn=null,Dr=null,Il=null,Tr=!1;function Ou(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Tr||Jn==null||Jn!==Mi(n)||(n=Jn,"selectionStart"in n&&Or(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}),Il&&Kl(Il,n)||(Il=n,n=zs(Dr,"onSelect"),0<n.length&&(t=new Yi("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Jn)))}function _n(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var Pn={animationend:_n("Animation","AnimationEnd"),animationiteration:_n("Animation","AnimationIteration"),animationstart:_n("Animation","AnimationStart"),transitionrun:_n("Transition","TransitionRun"),transitionstart:_n("Transition","TransitionStart"),transitioncancel:_n("Transition","TransitionCancel"),transitionend:_n("Transition","TransitionEnd")},Mr={},Du={};Ea&&(Du=document.createElement("div").style,"AnimationEvent"in window||(delete Pn.animationend.animation,delete Pn.animationiteration.animation,delete Pn.animationstart.animation),"TransitionEvent"in window||delete Pn.transitionend.transition);function Cn(e){if(Mr[e])return Mr[e];if(!Pn[e])return e;var t=Pn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Du)return Mr[e]=t[a];return e}var Tu=Cn("animationend"),Mu=Cn("animationiteration"),Uu=Cn("animationstart"),Vm=Cn("transitionrun"),Xm=Cn("transitionstart"),Zm=Cn("transitioncancel"),Bu=Cn("transitionend"),Lu=new Map,Ur="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(" ");Ur.push("scrollEnd");function pa(e,t){Lu.set(e,t),Sn(t,[e])}var Ii=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)},la=[],Wn=0,Br=0;function Gi(){for(var e=Wn,t=Br=Wn=0;t<e;){var a=la[t];la[t++]=null;var n=la[t];la[t++]=null;var s=la[t];la[t++]=null;var o=la[t];if(la[t++]=null,n!==null&&s!==null){var w=n.pending;w===null?s.next=s:(s.next=w.next,w.next=s),n.pending=s}o!==0&&Hu(a,s,o)}}function Vi(e,t,a,n){la[Wn++]=e,la[Wn++]=t,la[Wn++]=a,la[Wn++]=n,Br|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function Lr(e,t,a,n){return Vi(e,t,a,n),Xi(e)}function kn(e,t){return Vi(e,null,null,t),Xi(e)}function Hu(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var s=!1,o=e.return;o!==null;)o.childLanes|=a,n=o.alternate,n!==null&&(n.childLanes|=a),o.tag===22&&(e=o.stateNode,e===null||e._visibility&1||(s=!0)),e=o,o=o.return;return e.tag===3?(o=e.stateNode,s&&t!==null&&(s=31-Te(a),e=o.hiddenUpdates,n=e[s],n===null?e[s]=[t]:n.push(t),t.lane=a|536870912),o):null}function Xi(e){if(50<di)throw di=0,$o=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var el={};function $m(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 Qt(e,t,a,n){return new $m(e,t,a,n)}function Hr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Aa(e,t){var a=e.alternate;return a===null?(a=Qt(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 Yu(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 Zi(e,t,a,n,s,o){var w=0;if(n=e,typeof e=="function")Hr(e)&&(w=1);else if(typeof e=="string")w=Wx(e,a,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case V:return e=Qt(31,a,t,s),e.elementType=V,e.lanes=o,e;case m:return En(a.children,s,o,t);case b:w=8,s|=24;break;case S:return e=Qt(12,a,t,s|2),e.elementType=S,e.lanes=o,e;case O:return e=Qt(13,a,t,s),e.elementType=O,e.lanes=o,e;case M:return e=Qt(19,a,t,s),e.elementType=M,e.lanes=o,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case k:w=10;break e;case y:w=9;break e;case U:w=11;break e;case T:w=14;break e;case Z:w=16,n=null;break e}w=29,a=Error(u(130,e===null?"null":typeof e,"")),n=null}return t=Qt(w,a,t,s),t.elementType=e,t.type=n,t.lanes=o,t}function En(e,t,a,n){return e=Qt(7,e,n,t),e.lanes=a,e}function Yr(e,t,a){return e=Qt(6,e,null,t),e.lanes=a,e}function qu(e){var t=Qt(18,null,null,0);return t.stateNode=e,t}function qr(e,t,a){return t=Qt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Ku=new WeakMap;function ia(e,t){if(typeof e=="object"&&e!==null){var a=Ku.get(e);return a!==void 0?a:(t={value:e,source:t,stack:L(t)},Ku.set(e,t),t)}return{value:e,source:t,stack:L(t)}}var tl=[],al=0,$i=null,Gl=0,sa=[],ra=0,Za=null,ba=1,ya="";function za(e,t){tl[al++]=Gl,tl[al++]=$i,$i=e,Gl=t}function Iu(e,t,a){sa[ra++]=ba,sa[ra++]=ya,sa[ra++]=Za,Za=e;var n=ba;e=ya;var s=32-Te(n)-1;n&=~(1<<s),a+=1;var o=32-Te(t)+s;if(30<o){var w=s-s%5;o=(n&(1<<w)-1).toString(32),n>>=w,s-=w,ba=1<<32-Te(t)+s|a<<s|n,ya=o+e}else ba=1<<o|a<<s|n,ya=e}function Kr(e){e.return!==null&&(za(e,1),Iu(e,1,0))}function Ir(e){for(;e===$i;)$i=tl[--al],tl[al]=null,Gl=tl[--al],tl[al]=null;for(;e===Za;)Za=sa[--ra],sa[ra]=null,ya=sa[--ra],sa[ra]=null,ba=sa[--ra],sa[ra]=null}function Gu(e,t){sa[ra++]=ba,sa[ra++]=ya,sa[ra++]=Za,ba=t.id,ya=t.overflow,Za=e}var Dt=null,xt=null,et=!1,$a=null,oa=!1,Gr=Error(u(519));function Qa(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Vl(ia(t,e)),Gr}function Vu(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[Rt]=e,t[Lt]=n,a){case"dialog":Je("cancel",t),Je("close",t);break;case"iframe":case"object":case"embed":Je("load",t);break;case"video":case"audio":for(a=0;a<hi.length;a++)Je(hi[a],t);break;case"source":Je("error",t);break;case"img":case"image":case"link":Je("error",t),Je("load",t);break;case"details":Je("toggle",t);break;case"input":Je("invalid",t),lu(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Je("invalid",t);break;case"textarea":Je("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&&(Je("beforetoggle",t),Je("toggle",t)),n.onScroll!=null&&Je("scroll",t),n.onScrollEnd!=null&&Je("scrollend",t),n.onClick!=null&&(t.onclick=ka),t=!0):t=!1,t||Qa(e,!0)}function Xu(e){for(Dt=e.return;Dt;)switch(Dt.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:Dt=Dt.return}}function nl(e){if(e!==Dt)return!1;if(!et)return Xu(e),et=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||cc(e.type,e.memoizedProps)),a=!a),a&&xt&&Qa(e),Xu(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));xt=bh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));xt=bh(e)}else t===27?(t=xt,un(e.type)?(e=pc,pc=null,xt=e):xt=t):xt=Dt?ua(e.stateNode.nextSibling):null;return!0}function An(){xt=Dt=null,et=!1}function Vr(){var e=$a;return e!==null&&(Xt===null?Xt=e:Xt.push.apply(Xt,e),$a=null),e}function Vl(e){$a===null?$a=[e]:$a.push(e)}var Xr=R(null),zn=null,Ra=null;function Fa(e,t,a){W(Xr,t._currentValue),t._currentValue=a}function Oa(e){e._currentValue=Xr.current,B(Xr)}function Zr(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 $r(e,t,a,n){var s=e.child;for(s!==null&&(s.return=e);s!==null;){var o=s.dependencies;if(o!==null){var w=s.child;o=o.firstContext;e:for(;o!==null;){var D=o;o=s;for(var G=0;G<t.length;G++)if(D.context===t[G]){o.lanes|=a,D=o.alternate,D!==null&&(D.lanes|=a),Zr(o.return,a,e),n||(w=null);break e}o=D.next}}else if(s.tag===18){if(w=s.return,w===null)throw Error(u(341));w.lanes|=a,o=w.alternate,o!==null&&(o.lanes|=a),Zr(w,a,e),w=null}else w=s.child;if(w!==null)w.return=s;else for(w=s;w!==null;){if(w===e){w=null;break}if(s=w.sibling,s!==null){s.return=w.return,w=s;break}w=w.return}s=w}}function ll(e,t,a,n){e=null;for(var s=t,o=!1;s!==null;){if(!o){if((s.flags&524288)!==0)o=!0;else if((s.flags&262144)!==0)break}if(s.tag===10){var w=s.alternate;if(w===null)throw Error(u(387));if(w=w.memoizedProps,w!==null){var D=s.type;$t(s.pendingProps.value,w.value)||(e!==null?e.push(D):e=[D])}}else if(s===Ee.current){if(w=s.alternate,w===null)throw Error(u(387));w.memoizedState.memoizedState!==s.memoizedState.memoizedState&&(e!==null?e.push(bi):e=[bi])}s=s.return}e!==null&&$r(t,e,a,n),t.flags|=262144}function Qi(e){for(e=e.firstContext;e!==null;){if(!$t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Rn(e){zn=e,Ra=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return Zu(zn,e)}function Fi(e,t){return zn===null&&Rn(e),Zu(e,t)}function Zu(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ra===null){if(e===null)throw Error(u(308));Ra=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ra=Ra.next=t;return a}var Qm=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()})}},Fm=i.unstable_scheduleCallback,Jm=i.unstable_NormalPriority,Nt={$$typeof:k,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qr(){return{controller:new Qm,data:new Map,refCount:0}}function Xl(e){e.refCount--,e.refCount===0&&Fm(Jm,function(){e.controller.abort()})}var Zl=null,Fr=0,il=0,sl=null;function Pm(e,t){if(Zl===null){var a=Zl=[];Fr=0,il=ec(),sl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Fr++,t.then($u,$u),t}function $u(){if(--Fr===0&&Zl!==null){sl!==null&&(sl.status="fulfilled");var e=Zl;Zl=null,il=0,sl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Wm(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(s){a.push(s)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var s=0;s<a.length;s++)(0,a[s])(t)},function(s){for(n.status="rejected",n.reason=s,s=0;s<a.length;s++)(0,a[s])(void 0)}),n}var Qu=X.S;X.S=function(e,t){Df=Ce(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&Pm(e,t),Qu!==null&&Qu(e,t)};var On=R(null);function Jr(){var e=On.current;return e!==null?e:mt.pooledCache}function Ji(e,t){t===null?W(On,On.current):W(On,t.pool)}function Fu(){var e=Jr();return e===null?null:{parent:Nt._currentValue,pool:e}}var rl=Error(u(460)),Pr=Error(u(474)),Pi=Error(u(542)),Wi={then:function(){}};function Ju(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(ka,ka),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(ka,ka);else{if(e=mt,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var s=t;s.status="fulfilled",s.value=n}},function(n){if(t.status==="pending"){var s=t;s.status="rejected",s.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,ed(e),e}throw Tn=t,rl}}function Dn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(Tn=a,rl):a}}var Tn=null;function Wu(){if(Tn===null)throw Error(u(459));var e=Tn;return Tn=null,e}function ed(e){if(e===rl||e===Pi)throw Error(u(483))}var ol=null,$l=0;function es(e){var t=$l;return $l+=1,ol===null&&(ol=[]),Pu(ol,e,t)}function Ql(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ts(e,t){throw t.$$typeof===E?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function td(e){function t(P,F){if(e){var ne=P.deletions;ne===null?(P.deletions=[F],P.flags|=16):ne.push(F)}}function a(P,F){if(!e)return null;for(;F!==null;)t(P,F),F=F.sibling;return null}function n(P){for(var F=new Map;P!==null;)P.key!==null?F.set(P.key,P):F.set(P.index,P),P=P.sibling;return F}function s(P,F){return P=Aa(P,F),P.index=0,P.sibling=null,P}function o(P,F,ne){return P.index=ne,e?(ne=P.alternate,ne!==null?(ne=ne.index,ne<F?(P.flags|=67108866,F):ne):(P.flags|=67108866,F)):(P.flags|=1048576,F)}function w(P){return e&&P.alternate===null&&(P.flags|=67108866),P}function D(P,F,ne,ve){return F===null||F.tag!==6?(F=Yr(ne,P.mode,ve),F.return=P,F):(F=s(F,ne),F.return=P,F)}function G(P,F,ne,ve){var Le=ne.type;return Le===m?ge(P,F,ne.props.children,ve,ne.key):F!==null&&(F.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&Dn(Le)===F.type)?(F=s(F,ne.props),Ql(F,ne),F.return=P,F):(F=Zi(ne.type,ne.key,ne.props,null,P.mode,ve),Ql(F,ne),F.return=P,F)}function le(P,F,ne,ve){return F===null||F.tag!==4||F.stateNode.containerInfo!==ne.containerInfo||F.stateNode.implementation!==ne.implementation?(F=qr(ne,P.mode,ve),F.return=P,F):(F=s(F,ne.children||[]),F.return=P,F)}function ge(P,F,ne,ve,Le){return F===null||F.tag!==7?(F=En(ne,P.mode,ve,Le),F.return=P,F):(F=s(F,ne),F.return=P,F)}function Se(P,F,ne){if(typeof F=="string"&&F!==""||typeof F=="number"||typeof F=="bigint")return F=Yr(""+F,P.mode,ne),F.return=P,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case v:return ne=Zi(F.type,F.key,F.props,null,P.mode,ne),Ql(ne,F),ne.return=P,ne;case _:return F=qr(F,P.mode,ne),F.return=P,F;case Z:return F=Dn(F),Se(P,F,ne)}if(I(F)||Y(F))return F=En(F,P.mode,ne,null),F.return=P,F;if(typeof F.then=="function")return Se(P,es(F),ne);if(F.$$typeof===k)return Se(P,Fi(P,F),ne);ts(P,F)}return null}function se(P,F,ne,ve){var Le=F!==null?F.key:null;if(typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint")return Le!==null?null:D(P,F,""+ne,ve);if(typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:return ne.key===Le?G(P,F,ne,ve):null;case _:return ne.key===Le?le(P,F,ne,ve):null;case Z:return ne=Dn(ne),se(P,F,ne,ve)}if(I(ne)||Y(ne))return Le!==null?null:ge(P,F,ne,ve,null);if(typeof ne.then=="function")return se(P,F,es(ne),ve);if(ne.$$typeof===k)return se(P,F,Fi(P,ne),ve);ts(P,ne)}return null}function fe(P,F,ne,ve,Le){if(typeof ve=="string"&&ve!==""||typeof ve=="number"||typeof ve=="bigint")return P=P.get(ne)||null,D(F,P,""+ve,Le);if(typeof ve=="object"&&ve!==null){switch(ve.$$typeof){case v:return P=P.get(ve.key===null?ne:ve.key)||null,G(F,P,ve,Le);case _:return P=P.get(ve.key===null?ne:ve.key)||null,le(F,P,ve,Le);case Z:return ve=Dn(ve),fe(P,F,ne,ve,Le)}if(I(ve)||Y(ve))return P=P.get(ne)||null,ge(F,P,ve,Le,null);if(typeof ve.then=="function")return fe(P,F,ne,es(ve),Le);if(ve.$$typeof===k)return fe(P,F,ne,Fi(F,ve),Le);ts(F,ve)}return null}function De(P,F,ne,ve){for(var Le=null,nt=null,Ue=F,Ze=F=0,We=null;Ue!==null&&Ze<ne.length;Ze++){Ue.index>Ze?(We=Ue,Ue=null):We=Ue.sibling;var lt=se(P,Ue,ne[Ze],ve);if(lt===null){Ue===null&&(Ue=We);break}e&&Ue&&lt.alternate===null&&t(P,Ue),F=o(lt,F,Ze),nt===null?Le=lt:nt.sibling=lt,nt=lt,Ue=We}if(Ze===ne.length)return a(P,Ue),et&&za(P,Ze),Le;if(Ue===null){for(;Ze<ne.length;Ze++)Ue=Se(P,ne[Ze],ve),Ue!==null&&(F=o(Ue,F,Ze),nt===null?Le=Ue:nt.sibling=Ue,nt=Ue);return et&&za(P,Ze),Le}for(Ue=n(Ue);Ze<ne.length;Ze++)We=fe(Ue,P,Ze,ne[Ze],ve),We!==null&&(e&&We.alternate!==null&&Ue.delete(We.key===null?Ze:We.key),F=o(We,F,Ze),nt===null?Le=We:nt.sibling=We,nt=We);return e&&Ue.forEach(function(mn){return t(P,mn)}),et&&za(P,Ze),Le}function Ye(P,F,ne,ve){if(ne==null)throw Error(u(151));for(var Le=null,nt=null,Ue=F,Ze=F=0,We=null,lt=ne.next();Ue!==null&&!lt.done;Ze++,lt=ne.next()){Ue.index>Ze?(We=Ue,Ue=null):We=Ue.sibling;var mn=se(P,Ue,lt.value,ve);if(mn===null){Ue===null&&(Ue=We);break}e&&Ue&&mn.alternate===null&&t(P,Ue),F=o(mn,F,Ze),nt===null?Le=mn:nt.sibling=mn,nt=mn,Ue=We}if(lt.done)return a(P,Ue),et&&za(P,Ze),Le;if(Ue===null){for(;!lt.done;Ze++,lt=ne.next())lt=Se(P,lt.value,ve),lt!==null&&(F=o(lt,F,Ze),nt===null?Le=lt:nt.sibling=lt,nt=lt);return et&&za(P,Ze),Le}for(Ue=n(Ue);!lt.done;Ze++,lt=ne.next())lt=fe(Ue,P,Ze,lt.value,ve),lt!==null&&(e&&lt.alternate!==null&&Ue.delete(lt.key===null?Ze:lt.key),F=o(lt,F,Ze),nt===null?Le=lt:nt.sibling=lt,nt=lt);return e&&Ue.forEach(function(u0){return t(P,u0)}),et&&za(P,Ze),Le}function ht(P,F,ne,ve){if(typeof ne=="object"&&ne!==null&&ne.type===m&&ne.key===null&&(ne=ne.props.children),typeof ne=="object"&&ne!==null){switch(ne.$$typeof){case v:e:{for(var Le=ne.key;F!==null;){if(F.key===Le){if(Le=ne.type,Le===m){if(F.tag===7){a(P,F.sibling),ve=s(F,ne.props.children),ve.return=P,P=ve;break e}}else if(F.elementType===Le||typeof Le=="object"&&Le!==null&&Le.$$typeof===Z&&Dn(Le)===F.type){a(P,F.sibling),ve=s(F,ne.props),Ql(ve,ne),ve.return=P,P=ve;break e}a(P,F);break}else t(P,F);F=F.sibling}ne.type===m?(ve=En(ne.props.children,P.mode,ve,ne.key),ve.return=P,P=ve):(ve=Zi(ne.type,ne.key,ne.props,null,P.mode,ve),Ql(ve,ne),ve.return=P,P=ve)}return w(P);case _:e:{for(Le=ne.key;F!==null;){if(F.key===Le)if(F.tag===4&&F.stateNode.containerInfo===ne.containerInfo&&F.stateNode.implementation===ne.implementation){a(P,F.sibling),ve=s(F,ne.children||[]),ve.return=P,P=ve;break e}else{a(P,F);break}else t(P,F);F=F.sibling}ve=qr(ne,P.mode,ve),ve.return=P,P=ve}return w(P);case Z:return ne=Dn(ne),ht(P,F,ne,ve)}if(I(ne))return De(P,F,ne,ve);if(Y(ne)){if(Le=Y(ne),typeof Le!="function")throw Error(u(150));return ne=Le.call(ne),Ye(P,F,ne,ve)}if(typeof ne.then=="function")return ht(P,F,es(ne),ve);if(ne.$$typeof===k)return ht(P,F,Fi(P,ne),ve);ts(P,ne)}return typeof ne=="string"&&ne!==""||typeof ne=="number"||typeof ne=="bigint"?(ne=""+ne,F!==null&&F.tag===6?(a(P,F.sibling),ve=s(F,ne),ve.return=P,P=ve):(a(P,F),ve=Yr(ne,P.mode,ve),ve.return=P,P=ve),w(P)):a(P,F)}return function(P,F,ne,ve){try{$l=0;var Le=ht(P,F,ne,ve);return ol=null,Le}catch(Ue){if(Ue===rl||Ue===Pi)throw Ue;var nt=Qt(29,Ue,null,P.mode);return nt.lanes=ve,nt.return=P,nt}}}var Mn=td(!0),ad=td(!1),Ja=!1;function Wr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function eo(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 Pa(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(st&2)!==0){var s=n.pending;return s===null?t.next=t:(t.next=s.next,s.next=t),n.pending=t,t=Xi(e),Hu(e,null,a),t}return Vi(e,n,t,a),Xi(e)}function Fl(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,Ol(e,a)}}function to(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var s=null,o=null;if(a=a.firstBaseUpdate,a!==null){do{var w={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};o===null?s=o=w:o=o.next=w,a=a.next}while(a!==null);o===null?s=o=t:o=o.next=t}else s=o=t;a={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:o,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 ao=!1;function Jl(){if(ao){var e=sl;if(e!==null)throw e}}function Pl(e,t,a,n){ao=!1;var s=e.updateQueue;Ja=!1;var o=s.firstBaseUpdate,w=s.lastBaseUpdate,D=s.shared.pending;if(D!==null){s.shared.pending=null;var G=D,le=G.next;G.next=null,w===null?o=le:w.next=le,w=G;var ge=e.alternate;ge!==null&&(ge=ge.updateQueue,D=ge.lastBaseUpdate,D!==w&&(D===null?ge.firstBaseUpdate=le:D.next=le,ge.lastBaseUpdate=G))}if(o!==null){var Se=s.baseState;w=0,ge=le=G=null,D=o;do{var se=D.lane&-536870913,fe=se!==D.lane;if(fe?(Pe&se)===se:(n&se)===se){se!==0&&se===il&&(ao=!0),ge!==null&&(ge=ge.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=e,Ye=D;se=t;var ht=a;switch(Ye.tag){case 1:if(De=Ye.payload,typeof De=="function"){Se=De.call(ht,Se,se);break e}Se=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=Ye.payload,se=typeof De=="function"?De.call(ht,Se,se):De,se==null)break e;Se=j({},Se,se);break e;case 2:Ja=!0}}se=D.callback,se!==null&&(e.flags|=64,fe&&(e.flags|=8192),fe=s.callbacks,fe===null?s.callbacks=[se]:fe.push(se))}else fe={lane:se,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ge===null?(le=ge=fe,G=Se):ge=ge.next=fe,w|=se;if(D=D.next,D===null){if(D=s.shared.pending,D===null)break;fe=D,D=fe.next,fe.next=null,s.lastBaseUpdate=fe,s.shared.pending=null}}while(!0);ge===null&&(G=Se),s.baseState=G,s.firstBaseUpdate=le,s.lastBaseUpdate=ge,o===null&&(s.shared.lanes=0),ln|=w,e.lanes=w,e.memoizedState=Se}}function nd(e,t){if(typeof e!="function")throw Error(u(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=R(null),as=R(0);function id(e,t){e=qa,W(as,e),W(cl,t),qa=e|t.baseLanes}function no(){W(as,qa),W(cl,cl.current)}function lo(){qa=as.current,B(cl),B(as)}var Ft=R(null),ca=null;function en(e){var t=e.alternate;W(jt,jt.current&1),W(Ft,e),ca===null&&(t===null||cl.current!==null||t.memoizedState!==null)&&(ca=e)}function io(e){W(jt,jt.current),W(Ft,e),ca===null&&(ca=e)}function sd(e){e.tag===22?(W(jt,jt.current),W(Ft,e),ca===null&&(ca=e)):tn()}function tn(){W(jt,jt.current),W(Ft,Ft.current)}function Jt(e){B(Ft),ca===e&&(ca=null),B(jt)}var jt=R(0);function ns(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||fc(a)||hc(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 Da=0,Xe=null,dt=null,_t=null,ls=!1,ul=!1,Un=!1,is=0,Wl=0,dl=null,ex=0;function vt(){throw Error(u(321))}function so(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!$t(e[a],t[a]))return!1;return!0}function ro(e,t,a,n,s,o){return Da=o,Xe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?Id:So,Un=!1,o=a(n,s),Un=!1,ul&&(o=od(t,a,n,s)),rd(e),o}function rd(e){X.H=ai;var t=dt!==null&&dt.next!==null;if(Da=0,_t=dt=Xe=null,ls=!1,Wl=0,dl=null,t)throw Error(u(300));e===null||Ct||(e=e.dependencies,e!==null&&Qi(e)&&(Ct=!0))}function od(e,t,a,n){Xe=e;var s=0;do{if(ul&&(dl=null),Wl=0,ul=!1,25<=s)throw Error(u(301));if(s+=1,_t=dt=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}X.H=Gd,o=t(a,n)}while(ul);return o}function tx(){var e=X.H,t=e.useState()[0];return t=typeof t.then=="function"?ei(t):t,e=e.useState()[0],(dt!==null?dt.memoizedState:null)!==e&&(Xe.flags|=1024),t}function oo(){var e=is!==0;return is=0,e}function co(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function uo(e){if(ls){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}ls=!1}Da=0,_t=dt=Xe=null,ul=!1,Wl=is=0,dl=null}function Ht(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?Xe.memoizedState=_t=e:_t=_t.next=e,_t}function St(){if(dt===null){var e=Xe.alternate;e=e!==null?e.memoizedState:null}else e=dt.next;var t=_t===null?Xe.memoizedState:_t.next;if(t!==null)_t=t,dt=e;else{if(e===null)throw Xe.alternate===null?Error(u(467)):Error(u(310));dt=e,e={memoizedState:dt.memoizedState,baseState:dt.baseState,baseQueue:dt.baseQueue,queue:dt.queue,next:null},_t===null?Xe.memoizedState=_t=e:_t=_t.next=e}return _t}function ss(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function ei(e){var t=Wl;return Wl+=1,dl===null&&(dl=[]),e=Pu(dl,e,t),t=Xe,(_t===null?t.memoizedState:_t.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?Id:So),e}function rs(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return ei(e);if(e.$$typeof===k)return Tt(e)}throw Error(u(438,String(e)))}function fo(e){var t=null,a=Xe.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=Xe.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(s){return s.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=ss(),Xe.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]=ue;return t.index++,a}function Ta(e,t){return typeof t=="function"?t(e):t}function os(e){var t=St();return ho(t,dt,e)}function ho(e,t,a){var n=e.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=a;var s=e.baseQueue,o=n.pending;if(o!==null){if(s!==null){var w=s.next;s.next=o.next,o.next=w}t.baseQueue=s=o,n.pending=null}if(o=e.baseState,s===null)e.memoizedState=o;else{t=s.next;var D=w=null,G=null,le=t,ge=!1;do{var Se=le.lane&-536870913;if(Se!==le.lane?(Pe&Se)===Se:(Da&Se)===Se){var se=le.revertLane;if(se===0)G!==null&&(G=G.next={lane:0,revertLane:0,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null}),Se===il&&(ge=!0);else if((Da&se)===se){le=le.next,se===il&&(ge=!0);continue}else Se={lane:0,revertLane:le.revertLane,gesture:null,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},G===null?(D=G=Se,w=o):G=G.next=Se,Xe.lanes|=se,ln|=se;Se=le.action,Un&&a(o,Se),o=le.hasEagerState?le.eagerState:a(o,Se)}else se={lane:Se,revertLane:le.revertLane,gesture:le.gesture,action:le.action,hasEagerState:le.hasEagerState,eagerState:le.eagerState,next:null},G===null?(D=G=se,w=o):G=G.next=se,Xe.lanes|=Se,ln|=Se;le=le.next}while(le!==null&&le!==t);if(G===null?w=o:G.next=D,!$t(o,e.memoizedState)&&(Ct=!0,ge&&(a=sl,a!==null)))throw a;e.memoizedState=o,e.baseState=w,e.baseQueue=G,n.lastRenderedState=o}return s===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function po(e){var t=St(),a=t.queue;if(a===null)throw Error(u(311));a.lastRenderedReducer=e;var n=a.dispatch,s=a.pending,o=t.memoizedState;if(s!==null){a.pending=null;var w=s=s.next;do o=e(o,w.action),w=w.next;while(w!==s);$t(o,t.memoizedState)||(Ct=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),a.lastRenderedState=o}return[o,n]}function cd(e,t,a){var n=Xe,s=St(),o=et;if(o){if(a===void 0)throw Error(u(407));a=a()}else a=t();var w=!$t((dt||s).memoizedState,a);if(w&&(s.memoizedState=a,Ct=!0),s=s.queue,go(fd.bind(null,n,s,e),[e]),s.getSnapshot!==t||w||_t!==null&&_t.memoizedState.tag&1){if(n.flags|=2048,fl(9,{destroy:void 0},dd.bind(null,n,s,a,t),null),mt===null)throw Error(u(349));o||(Da&127)!==0||ud(n,t,a)}return a}function ud(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=Xe.updateQueue,t===null?(t=ss(),Xe.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!$t(e,a)}catch{return!0}}function pd(e){var t=kn(e,2);t!==null&&Zt(t,e,2)}function mo(e){var t=Ht();if(typeof e=="function"){var a=e;if(e=a(),Un){Ie(!0);try{a()}finally{Ie(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:e},t}function md(e,t,a,n){return e.baseState=a,ho(e,dt,typeof n=="function"?n:Ta)}function ax(e,t,a,n,s){if(ds(e))throw Error(u(485));if(e=t.action,e!==null){var o={payload:s,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){o.listeners.push(w)}};X.T!==null?a(!0):o.isTransition=!1,n(o),a=t.pending,a===null?(o.next=t.pending=o,xd(t,o)):(o.next=a.next,t.pending=a.next=o)}}function xd(e,t){var a=t.action,n=t.payload,s=e.state;if(t.isTransition){var o=X.T,w={};X.T=w;try{var D=a(s,n),G=X.S;G!==null&&G(w,D),gd(e,t,D)}catch(le){xo(e,t,le)}finally{o!==null&&w.types!==null&&(o.types=w.types),X.T=o}}else try{o=a(s,n),gd(e,t,o)}catch(le){xo(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 xo(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 xo(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(et){var a=mt.formState;if(a!==null){e:{var n=Xe;if(et){if(xt){t:{for(var s=xt,o=oa;s.nodeType!==8;){if(!o){s=null;break t}if(s=ua(s.nextSibling),s===null){s=null;break t}}o=s.data,s=o==="F!"||o==="F"?s:null}if(s){xt=ua(s.nextSibling),n=s.data==="F!";break e}}Qa(n)}n=!1}n&&(t=a[0])}}return a=Ht(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vd,lastRenderedState:t},a.queue=n,a=Yd.bind(null,Xe,n),n.dispatch=a,n=mo(!1),o=jo.bind(null,Xe,!1,n.queue),n=Ht(),s={state:t,dispatch:null,action:e,pending:null},n.queue=s,a=ax.bind(null,Xe,s,o,a),s.dispatch=a,n.memoizedState=e,[t,a,!1]}function jd(e){var t=St();return Sd(t,dt,e)}function Sd(e,t,a){if(t=ho(e,t,vd)[0],e=os(Ta)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=ei(t)}catch(w){throw w===rl?Pi:w}else n=t;t=St();var s=t.queue,o=s.dispatch;return a!==t.memoizedState&&(Xe.flags|=2048,fl(9,{destroy:void 0},nx.bind(null,s,a),null)),[n,o,e]}function nx(e,t){e.action=t}function Nd(e){var t=St(),a=dt;if(a!==null)return Sd(t,a,e);St(),t=t.memoizedState,a=St();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function fl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=Xe.updateQueue,t===null&&(t=ss(),Xe.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 _d(){return St().memoizedState}function cs(e,t,a,n){var s=Ht();Xe.flags|=e,s.memoizedState=fl(1|t,{destroy:void 0},a,n===void 0?null:n)}function us(e,t,a,n){var s=St();n=n===void 0?null:n;var o=s.memoizedState.inst;dt!==null&&n!==null&&so(n,dt.memoizedState.deps)?s.memoizedState=fl(t,o,a,n):(Xe.flags|=e,s.memoizedState=fl(1|t,o,a,n))}function Cd(e,t){cs(8390656,8,e,t)}function go(e,t){us(2048,8,e,t)}function lx(e){Xe.flags|=4;var t=Xe.updateQueue;if(t===null)t=ss(),Xe.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function kd(e){var t=St().memoizedState;return lx({ref:t,nextImpl:e}),function(){if((st&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function Ed(e,t){return us(4,2,e,t)}function Ad(e,t){return us(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 Rd(e,t,a){a=a!=null?a.concat([e]):null,us(4,4,zd.bind(null,t,e),a)}function bo(){}function Od(e,t){var a=St();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&so(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function Dd(e,t){var a=St();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&so(t,n[1]))return n[0];if(n=e(),Un){Ie(!0);try{e()}finally{Ie(!1)}}return a.memoizedState=[n,t],n}function yo(e,t,a){return a===void 0||(Da&1073741824)!==0&&(Pe&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Mf(),Xe.lanes|=e,ln|=e,a)}function Td(e,t,a,n){return $t(a,t)?a:cl.current!==null?(e=yo(e,a,n),$t(e,t)||(Ct=!0),e):(Da&42)===0||(Da&1073741824)!==0&&(Pe&261930)===0?(Ct=!0,e.memoizedState=a):(e=Mf(),Xe.lanes|=e,ln|=e,t)}function Md(e,t,a,n,s){var o=Q.p;Q.p=o!==0&&8>o?o:8;var w=X.T,D={};X.T=D,jo(e,!1,t,a);try{var G=s(),le=X.S;if(le!==null&&le(D,G),G!==null&&typeof G=="object"&&typeof G.then=="function"){var ge=Wm(G,n);ti(e,t,ge,ea(e))}else ti(e,t,n,ea(e))}catch(Se){ti(e,t,{then:function(){},status:"rejected",reason:Se},ea())}finally{Q.p=o,w!==null&&D.types!==null&&(w.types=D.types),X.T=w}}function ix(){}function vo(e,t,a,n){if(e.tag!==5)throw Error(u(476));var s=Ud(e).queue;Md(e,s,t,Ne,a===null?ix:function(){return Bd(e),a(n)})}function Ud(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:Ne,baseState:Ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,lastRenderedState:Ne},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ta,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),ti(e,t.next.queue,{},ea())}function wo(){return Tt(bi)}function Ld(){return St().memoizedState}function Hd(){return St().memoizedState}function sx(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ea();e=Pa(a);var n=Wa(t,e,a);n!==null&&(Zt(n,t,a),Fl(n,t,a)),t={cache:Qr()},e.payload=t;return}t=t.return}}function rx(e,t,a){var n=ea();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},ds(e)?qd(t,a):(a=Lr(e,t,a,n),a!==null&&(Zt(a,e,n),Kd(a,t,n)))}function Yd(e,t,a){var n=ea();ti(e,t,a,n)}function ti(e,t,a,n){var s={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(ds(e))qd(t,s);else{var o=e.alternate;if(e.lanes===0&&(o===null||o.lanes===0)&&(o=t.lastRenderedReducer,o!==null))try{var w=t.lastRenderedState,D=o(w,a);if(s.hasEagerState=!0,s.eagerState=D,$t(D,w))return Vi(e,t,s,0),mt===null&&Gi(),!1}catch{}if(a=Lr(e,t,s,n),a!==null)return Zt(a,e,n),Kd(a,t,n),!0}return!1}function jo(e,t,a,n){if(n={lane:2,revertLane:ec(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},ds(e)){if(t)throw Error(u(479))}else t=Lr(e,a,n,2),t!==null&&Zt(t,e,2)}function ds(e){var t=e.alternate;return e===Xe||t!==null&&t===Xe}function qd(e,t){ul=ls=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Kd(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Ol(e,a)}}var ai={readContext:Tt,use:rs,useCallback:vt,useContext:vt,useEffect:vt,useImperativeHandle:vt,useLayoutEffect:vt,useInsertionEffect:vt,useMemo:vt,useReducer:vt,useRef:vt,useState:vt,useDebugValue:vt,useDeferredValue:vt,useTransition:vt,useSyncExternalStore:vt,useId:vt,useHostTransitionStatus:vt,useFormState:vt,useActionState:vt,useOptimistic:vt,useMemoCache:vt,useCacheRefresh:vt};ai.useEffectEvent=vt;var Id={readContext:Tt,use:rs,useCallback:function(e,t){return Ht().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:Cd,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,cs(4194308,4,zd.bind(null,t,e),a)},useLayoutEffect:function(e,t){return cs(4194308,4,e,t)},useInsertionEffect:function(e,t){cs(4,2,e,t)},useMemo:function(e,t){var a=Ht();t=t===void 0?null:t;var n=e();if(Un){Ie(!0);try{e()}finally{Ie(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Ht();if(a!==void 0){var s=a(t);if(Un){Ie(!0);try{a(t)}finally{Ie(!1)}}}else s=t;return n.memoizedState=n.baseState=s,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:s},n.queue=e,e=e.dispatch=rx.bind(null,Xe,e),[n.memoizedState,e]},useRef:function(e){var t=Ht();return e={current:e},t.memoizedState=e},useState:function(e){e=mo(e);var t=e.queue,a=Yd.bind(null,Xe,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:bo,useDeferredValue:function(e,t){var a=Ht();return yo(a,e,t)},useTransition:function(){var e=mo(!1);return e=Md.bind(null,Xe,e.queue,!0,!1),Ht().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=Xe,s=Ht();if(et){if(a===void 0)throw Error(u(407));a=a()}else{if(a=t(),mt===null)throw Error(u(349));(Pe&127)!==0||ud(n,t,a)}s.memoizedState=a;var o={value:a,getSnapshot:t};return s.queue=o,Cd(fd.bind(null,n,o,e),[e]),n.flags|=2048,fl(9,{destroy:void 0},dd.bind(null,n,o,a,t),null),a},useId:function(){var e=Ht(),t=mt.identifierPrefix;if(et){var a=ya,n=ba;a=(n&~(1<<32-Te(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=is++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=ex++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wo,useFormState:wd,useActionState:wd,useOptimistic:function(e){var t=Ht();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=jo.bind(null,Xe,!0,a),a.dispatch=t,[e,t]},useMemoCache:fo,useCacheRefresh:function(){return Ht().memoizedState=sx.bind(null,Xe)},useEffectEvent:function(e){var t=Ht(),a={impl:e};return t.memoizedState=a,function(){if((st&2)!==0)throw Error(u(440));return a.impl.apply(void 0,arguments)}}},So={readContext:Tt,use:rs,useCallback:Od,useContext:Tt,useEffect:go,useImperativeHandle:Rd,useInsertionEffect:Ed,useLayoutEffect:Ad,useMemo:Dd,useReducer:os,useRef:_d,useState:function(){return os(Ta)},useDebugValue:bo,useDeferredValue:function(e,t){var a=St();return Td(a,dt.memoizedState,e,t)},useTransition:function(){var e=os(Ta)[0],t=St().memoizedState;return[typeof e=="boolean"?e:ei(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:wo,useFormState:jd,useActionState:jd,useOptimistic:function(e,t){var a=St();return md(a,dt,e,t)},useMemoCache:fo,useCacheRefresh:Hd};So.useEffectEvent=kd;var Gd={readContext:Tt,use:rs,useCallback:Od,useContext:Tt,useEffect:go,useImperativeHandle:Rd,useInsertionEffect:Ed,useLayoutEffect:Ad,useMemo:Dd,useReducer:po,useRef:_d,useState:function(){return po(Ta)},useDebugValue:bo,useDeferredValue:function(e,t){var a=St();return dt===null?yo(a,e,t):Td(a,dt.memoizedState,e,t)},useTransition:function(){var e=po(Ta)[0],t=St().memoizedState;return[typeof e=="boolean"?e:ei(e),t]},useSyncExternalStore:cd,useId:Ld,useHostTransitionStatus:wo,useFormState:Nd,useActionState:Nd,useOptimistic:function(e,t){var a=St();return dt!==null?md(a,dt,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:fo,useCacheRefresh:Hd};Gd.useEffectEvent=kd;function No(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 _o={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=ea(),s=Pa(n);s.payload=t,a!=null&&(s.callback=a),t=Wa(e,s,n),t!==null&&(Zt(t,e,n),Fl(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=ea(),s=Pa(n);s.tag=1,s.payload=t,a!=null&&(s.callback=a),t=Wa(e,s,n),t!==null&&(Zt(t,e,n),Fl(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ea(),n=Pa(a);n.tag=2,t!=null&&(n.callback=t),t=Wa(e,n,a),t!==null&&(Zt(t,e,a),Fl(t,e,a))}};function Vd(e,t,a,n,s,o,w){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,o,w):t.prototype&&t.prototype.isPureReactComponent?!Kl(a,n)||!Kl(s,o):!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&&_o.enqueueReplaceState(t,t.state,null)}function Bn(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 s in e)a[s]===void 0&&(a[s]=e[s])}return a}function Zd(e){Ii(e)}function $d(e){console.error(e)}function Qd(e){Ii(e)}function fs(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Fd(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(s){setTimeout(function(){throw s})}}function Co(e,t,a){return a=Pa(a),a.tag=3,a.payload={element:null},a.callback=function(){fs(e,t)},a}function Jd(e){return e=Pa(e),e.tag=3,e}function Pd(e,t,a,n){var s=a.type.getDerivedStateFromError;if(typeof s=="function"){var o=n.value;e.payload=function(){return s(o)},e.callback=function(){Fd(t,a,n)}}var w=a.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(e.callback=function(){Fd(t,a,n),typeof s!="function"&&(sn===null?sn=new Set([this]):sn.add(this));var D=n.stack;this.componentDidCatch(n.value,{componentStack:D!==null?D:""})})}function ox(e,t,a,n,s){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&ll(t,a,s,!0),a=Ft.current,a!==null){switch(a.tag){case 31:case 13:return ca===null?Ns():a.alternate===null&&wt===0&&(wt=3),a.flags&=-257,a.flags|=65536,a.lanes=s,n===Wi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),Jo(e,n,s)),!1;case 22:return a.flags|=65536,n===Wi?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)),Jo(e,n,s)),!1}throw Error(u(435,a.tag))}return Jo(e,n,s),Ns(),!1}if(et)return t=Ft.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=s,n!==Gr&&(e=Error(u(422),{cause:n}),Vl(ia(e,a)))):(n!==Gr&&(t=Error(u(423),{cause:n}),Vl(ia(t,a))),e=e.current.alternate,e.flags|=65536,s&=-s,e.lanes|=s,n=ia(n,a),s=Co(e.stateNode,n,s),to(e,s),wt!==4&&(wt=2)),!1;var o=Error(u(520),{cause:n});if(o=ia(o,a),ui===null?ui=[o]:ui.push(o),wt!==4&&(wt=2),t===null)return!0;n=ia(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=s&-s,a.lanes|=e,e=Co(a.stateNode,n,e),to(a,e),!1;case 1:if(t=a.type,o=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||o!==null&&typeof o.componentDidCatch=="function"&&(sn===null||!sn.has(o))))return a.flags|=65536,s&=-s,a.lanes|=s,s=Jd(s),Pd(s,e,a,n),to(a,s),!1}a=a.return}while(a!==null);return!1}var ko=Error(u(461)),Ct=!1;function Mt(e,t,a,n){t.child=e===null?ad(t,null,a,n):Mn(t,e.child,a,n)}function Wd(e,t,a,n,s){a=a.render;var o=t.ref;if("ref"in n){var w={};for(var D in n)D!=="ref"&&(w[D]=n[D])}else w=n;return Rn(t),n=ro(e,t,a,w,o,s),D=oo(),e!==null&&!Ct?(co(e,t,s),Ma(e,t,s)):(et&&D&&Kr(t),t.flags|=1,Mt(e,t,n,s),t.child)}function ef(e,t,a,n,s){if(e===null){var o=a.type;return typeof o=="function"&&!Hr(o)&&o.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=o,tf(e,t,o,n,s)):(e=Zi(a.type,null,n,t,t.mode,s),e.ref=t.ref,e.return=t,t.child=e)}if(o=e.child,!Mo(e,s)){var w=o.memoizedProps;if(a=a.compare,a=a!==null?a:Kl,a(w,n)&&e.ref===t.ref)return Ma(e,t,s)}return t.flags|=1,e=Aa(o,n),e.ref=t.ref,e.return=t,t.child=e}function tf(e,t,a,n,s){if(e!==null){var o=e.memoizedProps;if(Kl(o,n)&&e.ref===t.ref)if(Ct=!1,t.pendingProps=n=o,Mo(e,s))(e.flags&131072)!==0&&(Ct=!0);else return t.lanes=e.lanes,Ma(e,t,s)}return Eo(e,t,a,n,s)}function af(e,t,a,n){var s=n.children,o=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(o=o!==null?o.baseLanes|a:a,e!==null){for(n=t.child=e.child,s=0;n!==null;)s=s|n.lanes|n.childLanes,n=n.sibling;n=s&~o}else n=0,t.child=null;return nf(e,t,o,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ji(t,o!==null?o.cachePool:null),o!==null?id(t,o):no(),sd(t);else return n=t.lanes=536870912,nf(e,t,o!==null?o.baseLanes|a:a,a,n)}else o!==null?(Ji(t,o.cachePool),id(t,o),tn(),t.memoizedState=null):(e!==null&&Ji(t,null),no(),tn());return Mt(e,t,s,a),t.child}function ni(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,s){var o=Jr();return o=o===null?null:{parent:Nt._currentValue,pool:o},t.memoizedState={baseLanes:a,cachePool:o},e!==null&&Ji(t,null),no(),sd(t),e!==null&&ll(e,t,n,!0),t.childLanes=s,null}function hs(e,t){return t=ms({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 Mn(t,e.child,null,a),e=hs(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function cx(e,t,a){var n=t.pendingProps,s=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(et){if(n.mode==="hidden")return e=hs(t,n),t.lanes=536870912,ni(null,e);if(io(t),(e=xt)?(e=gh(e,oa),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:ba,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},a=qu(e),a.return=t,t.child=a,Dt=t,xt=null)):e=null,e===null)throw Qa(t);return t.lanes=536870912,null}return hs(t,n)}var o=e.memoizedState;if(o!==null){var w=o.dehydrated;if(io(t),s)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(u(558));else if(Ct||ll(e,t,a,!1),s=(a&e.childLanes)!==0,Ct||s){if(n=mt,n!==null&&(w=Gn(n,a),w!==0&&w!==o.retryLane))throw o.retryLane=w,kn(e,w),Zt(n,e,w),ko;Ns(),t=lf(e,t,a)}else e=o.treeContext,xt=ua(w.nextSibling),Dt=t,et=!0,$a=null,oa=!1,e!==null&&Gu(t,e),t=hs(t,n),t.flags|=4096;return t}return e=Aa(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ps(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(u(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Eo(e,t,a,n,s){return Rn(t),a=ro(e,t,a,n,void 0,s),n=oo(),e!==null&&!Ct?(co(e,t,s),Ma(e,t,s)):(et&&n&&Kr(t),t.flags|=1,Mt(e,t,a,s),t.child)}function sf(e,t,a,n,s,o){return Rn(t),t.updateQueue=null,a=od(t,n,a,s),rd(e),n=oo(),e!==null&&!Ct?(co(e,t,o),Ma(e,t,o)):(et&&n&&Kr(t),t.flags|=1,Mt(e,t,a,o),t.child)}function rf(e,t,a,n,s){if(Rn(t),t.stateNode===null){var o=el,w=a.contextType;typeof w=="object"&&w!==null&&(o=Tt(w)),o=new a(n,o),t.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,o.updater=_o,t.stateNode=o,o._reactInternals=t,o=t.stateNode,o.props=n,o.state=t.memoizedState,o.refs={},Wr(t),w=a.contextType,o.context=typeof w=="object"&&w!==null?Tt(w):el,o.state=t.memoizedState,w=a.getDerivedStateFromProps,typeof w=="function"&&(No(t,a,w,n),o.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof o.getSnapshotBeforeUpdate=="function"||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(w=o.state,typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount(),w!==o.state&&_o.enqueueReplaceState(o,o.state,null),Pl(t,n,o,s),Jl(),o.state=t.memoizedState),typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){o=t.stateNode;var D=t.memoizedProps,G=Bn(a,D);o.props=G;var le=o.context,ge=a.contextType;w=el,typeof ge=="object"&&ge!==null&&(w=Tt(ge));var Se=a.getDerivedStateFromProps;ge=typeof Se=="function"||typeof o.getSnapshotBeforeUpdate=="function",D=t.pendingProps!==D,ge||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(D||le!==w)&&Xd(t,o,n,w),Ja=!1;var se=t.memoizedState;o.state=se,Pl(t,n,o,s),Jl(),le=t.memoizedState,D||se!==le||Ja?(typeof Se=="function"&&(No(t,a,Se,n),le=t.memoizedState),(G=Ja||Vd(t,a,G,n,se,le,w))?(ge||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(t.flags|=4194308)):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=le),o.props=n,o.state=le,o.context=w,n=G):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{o=t.stateNode,eo(e,t),w=t.memoizedProps,ge=Bn(a,w),o.props=ge,Se=t.pendingProps,se=o.context,le=a.contextType,G=el,typeof le=="object"&&le!==null&&(G=Tt(le)),D=a.getDerivedStateFromProps,(le=typeof D=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(w!==Se||se!==G)&&Xd(t,o,n,G),Ja=!1,se=t.memoizedState,o.state=se,Pl(t,n,o,s),Jl();var fe=t.memoizedState;w!==Se||se!==fe||Ja||e!==null&&e.dependencies!==null&&Qi(e.dependencies)?(typeof D=="function"&&(No(t,a,D,n),fe=t.memoizedState),(ge=Ja||Vd(t,a,ge,n,se,fe,G)||e!==null&&e.dependencies!==null&&Qi(e.dependencies))?(le||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,fe,G),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,fe,G)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||w===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=fe),o.props=n,o.state=fe,o.context=G,n=ge):(typeof o.componentDidUpdate!="function"||w===e.memoizedProps&&se===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||w===e.memoizedProps&&se===e.memoizedState||(t.flags|=1024),n=!1)}return o=n,ps(e,t),n=(t.flags&128)!==0,o||n?(o=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:o.render(),t.flags|=1,e!==null&&n?(t.child=Mn(t,e.child,null,s),t.child=Mn(t,null,a,s)):Mt(e,t,a,s),t.memoizedState=o.state,e=t.child):e=Ma(e,t,s),e}function of(e,t,a,n){return An(),t.flags|=256,Mt(e,t,a,n),t.child}var Ao={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function zo(e){return{baseLanes:e,cachePool:Fu()}}function Ro(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Wt),e}function cf(e,t,a){var n=t.pendingProps,s=!1,o=(t.flags&128)!==0,w;if((w=o)||(w=e!==null&&e.memoizedState===null?!1:(jt.current&2)!==0),w&&(s=!0,t.flags&=-129),w=(t.flags&32)!==0,t.flags&=-33,e===null){if(et){if(s?en(t):tn(),(e=xt)?(e=gh(e,oa),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Za!==null?{id:ba,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},a=qu(e),a.return=t,t.child=a,Dt=t,xt=null)):e=null,e===null)throw Qa(t);return hc(e)?t.lanes=32:t.lanes=536870912,null}var D=n.children;return n=n.fallback,s?(tn(),s=t.mode,D=ms({mode:"hidden",children:D},s),n=En(n,s,a,null),D.return=t,n.return=t,D.sibling=n,t.child=D,n=t.child,n.memoizedState=zo(a),n.childLanes=Ro(e,w,a),t.memoizedState=Ao,ni(null,n)):(en(t),Oo(t,D))}var G=e.memoizedState;if(G!==null&&(D=G.dehydrated,D!==null)){if(o)t.flags&256?(en(t),t.flags&=-257,t=Do(e,t,a)):t.memoizedState!==null?(tn(),t.child=e.child,t.flags|=128,t=null):(tn(),D=n.fallback,s=t.mode,n=ms({mode:"visible",children:n.children},s),D=En(D,s,a,null),D.flags|=2,n.return=t,D.return=t,n.sibling=D,t.child=n,Mn(t,e.child,null,a),n=t.child,n.memoizedState=zo(a),n.childLanes=Ro(e,w,a),t.memoizedState=Ao,t=ni(null,n));else if(en(t),hc(D)){if(w=D.nextSibling&&D.nextSibling.dataset,w)var le=w.dgst;w=le,n=Error(u(419)),n.stack="",n.digest=w,Vl({value:n,source:null,stack:null}),t=Do(e,t,a)}else if(Ct||ll(e,t,a,!1),w=(a&e.childLanes)!==0,Ct||w){if(w=mt,w!==null&&(n=Gn(w,a),n!==0&&n!==G.retryLane))throw G.retryLane=n,kn(e,n),Zt(w,e,n),ko;fc(D)||Ns(),t=Do(e,t,a)}else fc(D)?(t.flags|=192,t.child=e.child,t=null):(e=G.treeContext,xt=ua(D.nextSibling),Dt=t,et=!0,$a=null,oa=!1,e!==null&&Gu(t,e),t=Oo(t,n.children),t.flags|=4096);return t}return s?(tn(),D=n.fallback,s=t.mode,G=e.child,le=G.sibling,n=Aa(G,{mode:"hidden",children:n.children}),n.subtreeFlags=G.subtreeFlags&65011712,le!==null?D=Aa(le,D):(D=En(D,s,a,null),D.flags|=2),D.return=t,n.return=t,n.sibling=D,t.child=n,ni(null,n),n=t.child,D=e.child.memoizedState,D===null?D=zo(a):(s=D.cachePool,s!==null?(G=Nt._currentValue,s=s.parent!==G?{parent:G,pool:G}:s):s=Fu(),D={baseLanes:D.baseLanes|a,cachePool:s}),n.memoizedState=D,n.childLanes=Ro(e,w,a),t.memoizedState=Ao,ni(e.child,n)):(en(t),a=e.child,e=a.sibling,a=Aa(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(w=t.deletions,w===null?(t.deletions=[e],t.flags|=16):w.push(e)),t.child=a,t.memoizedState=null,a)}function Oo(e,t){return t=ms({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function ms(e,t){return e=Qt(22,e,null,t),e.lanes=0,e}function Do(e,t,a){return Mn(t,e.child,null,a),e=Oo(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),Zr(e.return,t,a)}function To(e,t,a,n,s,o){var w=e.memoizedState;w===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:s,treeForkCount:o}:(w.isBackwards=t,w.rendering=null,w.renderingStartTime=0,w.last=n,w.tail=a,w.tailMode=s,w.treeForkCount=o)}function df(e,t,a){var n=t.pendingProps,s=n.revealOrder,o=n.tail;n=n.children;var w=jt.current,D=(w&2)!==0;if(D?(w=w&1|2,t.flags|=128):w&=1,W(jt,w),Mt(e,t,n,a),n=et?Gl:0,!D&&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(s){case"forwards":for(a=t.child,s=null;a!==null;)e=a.alternate,e!==null&&ns(e)===null&&(s=a),a=a.sibling;a=s,a===null?(s=t.child,t.child=null):(s=a.sibling,a.sibling=null),To(t,!1,s,a,o,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,s=t.child,t.child=null;s!==null;){if(e=s.alternate,e!==null&&ns(e)===null){t.child=s;break}e=s.sibling,s.sibling=a,a=s,s=e}To(t,!0,a,null,o,n);break;case"together":To(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Ma(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),ln|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(ll(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,a=Aa(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Aa(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Mo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Qi(e)))}function ux(e,t,a){switch(t.tag){case 3:ze(t,t.stateNode.containerInfo),Fa(t,Nt,e.memoizedState.cache),An();break;case 27:case 5:qe(t);break;case 4:ze(t,t.stateNode.containerInfo);break;case 10:Fa(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,io(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(en(t),t.flags|=128,null):(a&t.child.childLanes)!==0?cf(e,t,a):(en(t),e=Ma(e,t,a),e!==null?e.sibling:null);en(t);break;case 19:var s=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(ll(e,t,a,!1),n=(a&t.childLanes)!==0),s){if(n)return df(e,t,a);t.flags|=128}if(s=t.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),W(jt,jt.current),n)break;return null;case 22:return t.lanes=0,af(e,t,a,t.pendingProps);case 24:Fa(t,Nt,e.memoizedState.cache)}return Ma(e,t,a)}function ff(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)Ct=!0;else{if(!Mo(e,a)&&(t.flags&128)===0)return Ct=!1,ux(e,t,a);Ct=(e.flags&131072)!==0}else Ct=!1,et&&(t.flags&1048576)!==0&&Iu(t,Gl,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=Dn(t.elementType),t.type=e,typeof e=="function")Hr(e)?(n=Bn(e,n),t.tag=1,t=rf(null,t,e,n,a)):(t.tag=0,t=Eo(null,t,e,n,a));else{if(e!=null){var s=e.$$typeof;if(s===U){t.tag=11,t=Wd(null,t,e,n,a);break e}else if(s===T){t.tag=14,t=ef(null,t,e,n,a);break e}}throw t=z(e)||e,Error(u(306,t,""))}}return t;case 0:return Eo(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,s=Bn(n,t.pendingProps),rf(e,t,n,s,a);case 3:e:{if(ze(t,t.stateNode.containerInfo),e===null)throw Error(u(387));n=t.pendingProps;var o=t.memoizedState;s=o.element,eo(e,t),Pl(t,n,null,a);var w=t.memoizedState;if(n=w.cache,Fa(t,Nt,n),n!==o.cache&&$r(t,[Nt],a,!0),Jl(),n=w.element,o.isDehydrated)if(o={element:n,isDehydrated:!1,cache:w.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=of(e,t,n,a);break e}else if(n!==s){s=ia(Error(u(424)),t),Vl(s),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,xt=ua(e.firstChild),Dt=t,et=!0,$a=null,oa=!0,a=ad(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(An(),n===s){t=Ma(e,t,a);break e}Mt(e,t,n,a)}t=t.child}return t;case 26:return ps(e,t),e===null?(a=Sh(t.type,null,t.pendingProps,null))?t.memoizedState=a:et||(a=t.type,e=t.pendingProps,n=Rs(ie.current).createElement(a),n[Rt]=t,n[Lt]=e,Ut(n,a,e),at(n),t.stateNode=n):t.memoizedState=Sh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return qe(t),e===null&&et&&(n=t.stateNode=vh(t.type,t.pendingProps,ie.current),Dt=t,oa=!0,s=xt,un(t.type)?(pc=s,xt=ua(n.firstChild)):xt=s),Mt(e,t,t.pendingProps.children,a),ps(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&et&&((s=n=xt)&&(n=Yx(n,t.type,t.pendingProps,oa),n!==null?(t.stateNode=n,Dt=t,xt=ua(n.firstChild),oa=!1,s=!0):s=!1),s||Qa(t)),qe(t),s=t.type,o=t.pendingProps,w=e!==null?e.memoizedProps:null,n=o.children,cc(s,o)?n=null:w!==null&&cc(s,w)&&(t.flags|=32),t.memoizedState!==null&&(s=ro(e,t,tx,null,null,a),bi._currentValue=s),ps(e,t),Mt(e,t,n,a),t.child;case 6:return e===null&&et&&((e=a=xt)&&(a=qx(a,t.pendingProps,oa),a!==null?(t.stateNode=a,Dt=t,xt=null,e=!0):e=!1),e||Qa(t)),null;case 13:return cf(e,t,a);case 4:return ze(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=Mn(t,null,n,a):Mt(e,t,n,a),t.child;case 11:return Wd(e,t,t.type,t.pendingProps,a);case 7:return Mt(e,t,t.pendingProps,a),t.child;case 8:return Mt(e,t,t.pendingProps.children,a),t.child;case 12:return Mt(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,Fa(t,t.type,n.value),Mt(e,t,n.children,a),t.child;case 9:return s=t.type._context,n=t.pendingProps.children,Rn(t),s=Tt(s),n=n(s),t.flags|=1,Mt(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 cx(e,t,a);case 22:return af(e,t,a,t.pendingProps);case 24:return Rn(t),n=Tt(Nt),e===null?(s=Jr(),s===null&&(s=mt,o=Qr(),s.pooledCache=o,o.refCount++,o!==null&&(s.pooledCacheLanes|=a),s=o),t.memoizedState={parent:n,cache:s},Wr(t),Fa(t,Nt,s)):((e.lanes&a)!==0&&(eo(e,t),Pl(t,null,null,a),Jl()),s=e.memoizedState,o=t.memoizedState,s.parent!==n?(s={parent:n,cache:n},t.memoizedState=s,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=s),Fa(t,Nt,n)):(n=o.cache,Fa(t,Nt,n),n!==s.cache&&$r(t,[Nt],a,!0))),Mt(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function Ua(e){e.flags|=4}function Uo(e,t,a,n,s){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(s&335544128)===s)if(e.stateNode.complete)e.flags|=8192;else if(Hf())e.flags|=8192;else throw Tn=Wi,Pr}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,!Eh(t))if(Hf())e.flags|=8192;else throw Tn=Wi,Pr}function xs(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?zi():536870912,e.lanes|=t,xl|=t)}function li(e,t){if(!et)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 gt(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags&65011712,n|=s.flags&65011712,s.return=e,s=s.sibling;else for(s=e.child;s!==null;)a|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=e,s=s.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function dx(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 gt(t),null;case 1:return gt(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Oa(Nt),Ae(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(nl(t)?Ua(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Vr())),gt(t),null;case 26:var s=t.type,o=t.memoizedState;return e===null?(Ua(t),o!==null?(gt(t),hf(t,o)):(gt(t),Uo(t,s,null,n,a))):o?o!==e.memoizedState?(Ua(t),gt(t),hf(t,o)):(gt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&Ua(t),gt(t),Uo(t,s,e,n,a)),null;case 27:if(Ke(t),a=ie.current,s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ua(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return gt(t),null}e=ee.current,nl(t)?Vu(t):(e=vh(s,n,a),t.stateNode=e,Ua(t))}return gt(t),null;case 5:if(Ke(t),s=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&Ua(t);else{if(!n){if(t.stateNode===null)throw Error(u(166));return gt(t),null}if(o=ee.current,nl(t))Vu(t);else{var w=Rs(ie.current);switch(o){case 1:o=w.createElementNS("http://www.w3.org/2000/svg",s);break;case 2:o=w.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;default:switch(s){case"svg":o=w.createElementNS("http://www.w3.org/2000/svg",s);break;case"math":o=w.createElementNS("http://www.w3.org/1998/Math/MathML",s);break;case"script":o=w.createElement("div"),o.innerHTML="<script><\/script>",o=o.removeChild(o.firstChild);break;case"select":o=typeof n.is=="string"?w.createElement("select",{is:n.is}):w.createElement("select"),n.multiple?o.multiple=!0:n.size&&(o.size=n.size);break;default:o=typeof n.is=="string"?w.createElement(s,{is:n.is}):w.createElement(s)}}o[Rt]=t,o[Lt]=n;e:for(w=t.child;w!==null;){if(w.tag===5||w.tag===6)o.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===t)break e;for(;w.sibling===null;){if(w.return===null||w.return===t)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}t.stateNode=o;e:switch(Ut(o,s,n),s){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&Ua(t)}}return gt(t),Uo(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&Ua(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(u(166));if(e=ie.current,nl(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,s=Dt,s!==null)switch(s.tag){case 27:case 5:n=s.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||ch(e.nodeValue,a)),e||Qa(t,!0)}else e=Rs(e).createTextNode(n),e[Rt]=t,t.stateNode=e}return gt(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=nl(t),a!==null){if(e===null){if(!n)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Rt]=t}else An(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),e=!1}else a=Vr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(u(558))}return gt(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(s=nl(t),n!==null&&n.dehydrated!==null){if(e===null){if(!s)throw Error(u(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(u(317));s[Rt]=t}else An(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;gt(t),s=!1}else s=Vr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),s=!0;if(!s)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,s=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(s=n.alternate.memoizedState.cachePool.pool),o=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(o=n.memoizedState.cachePool.pool),o!==s&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),xs(t,t.updateQueue),gt(t),null);case 4:return Ae(),e===null&&lc(t.stateNode.containerInfo),gt(t),null;case 10:return Oa(t.type),gt(t),null;case 19:if(B(jt),n=t.memoizedState,n===null)return gt(t),null;if(s=(t.flags&128)!==0,o=n.rendering,o===null)if(s)li(n,!1);else{if(wt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(o=ns(e),o!==null){for(t.flags|=128,li(n,!1),e=o.updateQueue,t.updateQueue=e,xs(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Yu(a,e),a=a.sibling;return W(jt,jt.current&1|2),et&&za(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&Ce()>ws&&(t.flags|=128,s=!0,li(n,!1),t.lanes=4194304)}else{if(!s)if(e=ns(o),e!==null){if(t.flags|=128,s=!0,e=e.updateQueue,t.updateQueue=e,xs(t,e),li(n,!0),n.tail===null&&n.tailMode==="hidden"&&!o.alternate&&!et)return gt(t),null}else 2*Ce()-n.renderingStartTime>ws&&a!==536870912&&(t.flags|=128,s=!0,li(n,!1),t.lanes=4194304);n.isBackwards?(o.sibling=t.child,t.child=o):(e=n.last,e!==null?e.sibling=o:t.child=o,n.last=o)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=Ce(),e.sibling=null,a=jt.current,W(jt,s?a&1|2:a&1),et&&za(t,n.treeForkCount),e):(gt(t),null);case 22:case 23:return Jt(t),lo(),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&&(gt(t),t.subtreeFlags&6&&(t.flags|=8192)):gt(t),a=t.updateQueue,a!==null&&xs(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&&B(On),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Oa(Nt),gt(t),null;case 25:return null;case 30:return null}throw Error(u(156,t.tag))}function fx(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 Oa(Nt),Ae(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ke(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(u(340));An()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));An()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return B(jt),null;case 4:return Ae(),null;case 10:return Oa(t.type),null;case 22:case 23:return Jt(t),lo(),e!==null&&B(On),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Oa(Nt),null;case 25:return null;default:return null}}function pf(e,t){switch(Ir(t),t.tag){case 3:Oa(Nt),Ae();break;case 26:case 27:case 5:Ke(t);break;case 4:Ae();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:B(jt);break;case 10:Oa(t.type);break;case 22:case 23:Jt(t),lo(),e!==null&&B(On);break;case 24:Oa(Nt)}}function ii(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var s=n.next;a=s;do{if((a.tag&e)===e){n=void 0;var o=a.create,w=a.inst;n=o(),w.destroy=n}a=a.next}while(a!==s)}}catch(D){ut(t,t.return,D)}}function an(e,t,a){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var o=s.next;n=o;do{if((n.tag&e)===e){var w=n.inst,D=w.destroy;if(D!==void 0){w.destroy=void 0,s=t;var G=a,le=D;try{le()}catch(ge){ut(s,G,ge)}}}n=n.next}while(n!==o)}}catch(ge){ut(t,t.return,ge)}}function mf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ld(t,a)}catch(n){ut(e,e.return,n)}}}function xf(e,t,a){a.props=Bn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){ut(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(s){ut(e,t,s)}}function va(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(s){ut(e,t,s)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(s){ut(e,t,s)}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(s){ut(e,e.return,s)}}function Bo(e,t,a){try{var n=e.stateNode;Tx(n,e.type,a,t),n[Lt]=t}catch(s){ut(e,e.return,s)}}function bf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&un(e.type)||e.tag===4}function Lo(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&&un(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 Ho(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=ka));else if(n!==4&&(n===27&&un(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(Ho(e,t,a),e=e.sibling;e!==null;)Ho(e,t,a),e=e.sibling}function gs(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&&un(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(gs(e,t,a),e=e.sibling;e!==null;)gs(e,t,a),e=e.sibling}function yf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,s=t.attributes;s.length;)t.removeAttributeNode(s[0]);Ut(t,n,a),t[Rt]=e,t[Lt]=a}catch(o){ut(e,e.return,o)}}var Ba=!1,kt=!1,Yo=!1,vf=typeof WeakSet=="function"?WeakSet:Set,Ot=null;function hx(e,t){if(e=e.containerInfo,rc=Ls,e=Ru(e),Or(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 s=n.anchorOffset,o=n.focusNode;n=n.focusOffset;try{a.nodeType,o.nodeType}catch{a=null;break e}var w=0,D=-1,G=-1,le=0,ge=0,Se=e,se=null;t:for(;;){for(var fe;Se!==a||s!==0&&Se.nodeType!==3||(D=w+s),Se!==o||n!==0&&Se.nodeType!==3||(G=w+n),Se.nodeType===3&&(w+=Se.nodeValue.length),(fe=Se.firstChild)!==null;)se=Se,Se=fe;for(;;){if(Se===e)break t;if(se===a&&++le===s&&(D=w),se===o&&++ge===n&&(G=w),(fe=Se.nextSibling)!==null)break;Se=se,se=Se.parentNode}Se=fe}a=D===-1||G===-1?null:{start:D,end:G}}else a=null}a=a||{start:0,end:0}}else a=null;for(oc={focusedElem:e,selectionRange:a},Ls=!1,Ot=t;Ot!==null;)if(t=Ot,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,Ot=e;else for(;Ot!==null;){switch(t=Ot,o=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++)s=e[a],s.ref.impl=s.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&o!==null){e=void 0,a=t,s=o.memoizedProps,o=o.memoizedState,n=a.stateNode;try{var De=Bn(a.type,s);e=n.getSnapshotBeforeUpdate(De,o),n.__reactInternalSnapshotBeforeUpdate=e}catch(Ye){ut(a,a.return,Ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)dc(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":dc(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(u(163))}if(e=t.sibling,e!==null){e.return=t.return,Ot=e;break}Ot=t.return}}function wf(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:Ha(e,a),n&4&&ii(5,a);break;case 1:if(Ha(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(w){ut(a,a.return,w)}else{var s=Bn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(s,t,e.__reactInternalSnapshotBeforeUpdate)}catch(w){ut(a,a.return,w)}}n&64&&mf(a),n&512&&si(a,a.return);break;case 3:if(Ha(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(w){ut(a,a.return,w)}}break;case 27:t===null&&n&4&&yf(a);case 26:case 5:Ha(e,a),t===null&&n&4&&gf(a),n&512&&si(a,a.return);break;case 12:Ha(e,a);break;case 31:Ha(e,a),n&4&&Nf(e,a);break;case 13:Ha(e,a),n&4&&_f(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=jx.bind(null,a),Kx(e,a))));break;case 22:if(n=a.memoizedState!==null||Ba,!n){t=t!==null&&t.memoizedState!==null||kt,s=Ba;var o=kt;Ba=n,(kt=t)&&!o?Ya(e,a,(a.subtreeFlags&8772)!==0):Ha(e,a),Ba=s,kt=o}break;case 30:break;default:Ha(e,a)}}function jf(e){var t=e.alternate;t!==null&&(e.alternate=null,jf(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&de(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 bt=null,It=!1;function La(e,t,a){for(a=a.child;a!==null;)Sf(e,t,a),a=a.sibling}function Sf(e,t,a){if(Be&&typeof Be.onCommitFiberUnmount=="function")try{Be.onCommitFiberUnmount(Me,a)}catch{}switch(a.tag){case 26:kt||va(a,t),La(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:kt||va(a,t);var n=bt,s=It;un(a.type)&&(bt=a.stateNode,It=!1),La(e,t,a),mi(a.stateNode),bt=n,It=s;break;case 5:kt||va(a,t);case 6:if(n=bt,s=It,bt=null,La(e,t,a),bt=n,It=s,bt!==null)if(It)try{(bt.nodeType===9?bt.body:bt.nodeName==="HTML"?bt.ownerDocument.body:bt).removeChild(a.stateNode)}catch(o){ut(a,t,o)}else try{bt.removeChild(a.stateNode)}catch(o){ut(a,t,o)}break;case 18:bt!==null&&(It?(e=bt,mh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),Nl(e)):mh(bt,a.stateNode));break;case 4:n=bt,s=It,bt=a.stateNode.containerInfo,It=!0,La(e,t,a),bt=n,It=s;break;case 0:case 11:case 14:case 15:an(2,a,t),kt||an(4,a,t),La(e,t,a);break;case 1:kt||(va(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&xf(a,t,n)),La(e,t,a);break;case 21:La(e,t,a);break;case 22:kt=(n=kt)||a.memoizedState!==null,La(e,t,a),kt=n;break;default:La(e,t,a)}}function Nf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Nl(e)}catch(a){ut(t,t.return,a)}}}function _f(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Nl(e)}catch(a){ut(t,t.return,a)}}function px(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(u(435,e.tag))}}function bs(e,t){var a=px(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var s=Sx.bind(null,e,n);n.then(s,s)}})}function Gt(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var s=a[n],o=e,w=t,D=w;e:for(;D!==null;){switch(D.tag){case 27:if(un(D.type)){bt=D.stateNode,It=!1;break e}break;case 5:bt=D.stateNode,It=!1;break e;case 3:case 4:bt=D.stateNode.containerInfo,It=!0;break e}D=D.return}if(bt===null)throw Error(u(160));Sf(o,w,s),bt=null,It=!1,o=s.alternate,o!==null&&(o.return=null),s.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Cf(t,e),t=t.sibling}var ma=null;function Cf(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Gt(t,e),Vt(e),n&4&&(an(3,e,e.return),ii(3,e),an(5,e,e.return));break;case 1:Gt(t,e),Vt(e),n&512&&(kt||a===null||va(a,a.return)),n&64&&Ba&&(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 s=ma;if(Gt(t,e),Vt(e),n&512&&(kt||a===null||va(a,a.return)),n&4){var o=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,s=s.ownerDocument||s;t:switch(n){case"title":o=s.getElementsByTagName("title")[0],(!o||o[jn]||o[Rt]||o.namespaceURI==="http://www.w3.org/2000/svg"||o.hasAttribute("itemprop"))&&(o=s.createElement(n),s.head.insertBefore(o,s.querySelector("head > title"))),Ut(o,n,a),o[Rt]=e,at(o),n=o;break e;case"link":var w=Ch("link","href",s).get(n+(a.href||""));if(w){for(var D=0;D<w.length;D++)if(o=w[D],o.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&o.getAttribute("rel")===(a.rel==null?null:a.rel)&&o.getAttribute("title")===(a.title==null?null:a.title)&&o.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){w.splice(D,1);break t}}o=s.createElement(n),Ut(o,n,a),s.head.appendChild(o);break;case"meta":if(w=Ch("meta","content",s).get(n+(a.content||""))){for(D=0;D<w.length;D++)if(o=w[D],o.getAttribute("content")===(a.content==null?null:""+a.content)&&o.getAttribute("name")===(a.name==null?null:a.name)&&o.getAttribute("property")===(a.property==null?null:a.property)&&o.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&o.getAttribute("charset")===(a.charSet==null?null:a.charSet)){w.splice(D,1);break t}}o=s.createElement(n),Ut(o,n,a),s.head.appendChild(o);break;default:throw Error(u(468,n))}o[Rt]=e,at(o),n=o}e.stateNode=n}else kh(s,e.type,e.stateNode);else e.stateNode=_h(s,n,e.memoizedProps);else o!==n?(o===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):o.count--,n===null?kh(s,e.type,e.stateNode):_h(s,n,e.memoizedProps)):n===null&&e.stateNode!==null&&Bo(e,e.memoizedProps,a.memoizedProps)}break;case 27:Gt(t,e),Vt(e),n&512&&(kt||a===null||va(a,a.return)),a!==null&&n&4&&Bo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Gt(t,e),Vt(e),n&512&&(kt||a===null||va(a,a.return)),e.flags&32){s=e.stateNode;try{Zn(s,"")}catch(De){ut(e,e.return,De)}}n&4&&e.stateNode!=null&&(s=e.memoizedProps,Bo(e,s,a!==null?a.memoizedProps:s)),n&1024&&(Yo=!0);break;case 6:if(Gt(t,e),Vt(e),n&4){if(e.stateNode===null)throw Error(u(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(De){ut(e,e.return,De)}}break;case 3:if(Ts=null,s=ma,ma=Os(t.containerInfo),Gt(t,e),ma=s,Vt(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{Nl(t.containerInfo)}catch(De){ut(e,e.return,De)}Yo&&(Yo=!1,kf(e));break;case 4:n=ma,ma=Os(e.stateNode.containerInfo),Gt(t,e),Vt(e),ma=n;break;case 12:Gt(t,e),Vt(e);break;case 31:Gt(t,e),Vt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 13:Gt(t,e),Vt(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(vs=Ce()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 22:s=e.memoizedState!==null;var G=a!==null&&a.memoizedState!==null,le=Ba,ge=kt;if(Ba=le||s,kt=ge||G,Gt(t,e),kt=ge,Ba=le,Vt(e),n&8192)e:for(t=e.stateNode,t._visibility=s?t._visibility&-2:t._visibility|1,s&&(a===null||G||Ba||kt||Ln(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){G=a=t;try{if(o=G.stateNode,s)w=o.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{D=G.stateNode;var Se=G.memoizedProps.style,se=Se!=null&&Se.hasOwnProperty("display")?Se.display:null;D.style.display=se==null||typeof se=="boolean"?"":(""+se).trim()}}catch(De){ut(G,G.return,De)}}}else if(t.tag===6){if(a===null){G=t;try{G.stateNode.nodeValue=s?"":G.memoizedProps}catch(De){ut(G,G.return,De)}}}else if(t.tag===18){if(a===null){G=t;try{var fe=G.stateNode;s?xh(fe,!0):xh(G.stateNode,!1)}catch(De){ut(G,G.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,bs(e,a))));break;case 19:Gt(t,e),Vt(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,bs(e,n)));break;case 30:break;case 21:break;default:Gt(t,e),Vt(e)}}function Vt(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(u(160));switch(a.tag){case 27:var s=a.stateNode,o=Lo(e);gs(e,o,s);break;case 5:var w=a.stateNode;a.flags&32&&(Zn(w,""),a.flags&=-33);var D=Lo(e);gs(e,D,w);break;case 3:case 4:var G=a.stateNode.containerInfo,le=Lo(e);Ho(e,le,G);break;default:throw Error(u(161))}}catch(ge){ut(e,e.return,ge)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function kf(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;kf(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ha(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)wf(e,t.alternate,t),t=t.sibling}function Ln(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:an(4,t,t.return),Ln(t);break;case 1:va(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&xf(t,t.return,a),Ln(t);break;case 27:mi(t.stateNode);case 26:case 5:va(t,t.return),Ln(t);break;case 22:t.memoizedState===null&&Ln(t);break;case 30:Ln(t);break;default:Ln(t)}e=e.sibling}}function Ya(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,s=e,o=t,w=o.flags;switch(o.tag){case 0:case 11:case 15:Ya(s,o,a),ii(4,o);break;case 1:if(Ya(s,o,a),n=o,s=n.stateNode,typeof s.componentDidMount=="function")try{s.componentDidMount()}catch(le){ut(n,n.return,le)}if(n=o,s=n.updateQueue,s!==null){var D=n.stateNode;try{var G=s.shared.hiddenCallbacks;if(G!==null)for(s.shared.hiddenCallbacks=null,s=0;s<G.length;s++)nd(G[s],D)}catch(le){ut(n,n.return,le)}}a&&w&64&&mf(o),si(o,o.return);break;case 27:yf(o);case 26:case 5:Ya(s,o,a),a&&n===null&&w&4&&gf(o),si(o,o.return);break;case 12:Ya(s,o,a);break;case 31:Ya(s,o,a),a&&w&4&&Nf(s,o);break;case 13:Ya(s,o,a),a&&w&4&&_f(s,o);break;case 22:o.memoizedState===null&&Ya(s,o,a),si(o,o.return);break;case 30:break;default:Ya(s,o,a)}t=t.sibling}}function qo(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&&Xl(a))}function Ko(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xl(e))}function xa(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Ef(e,t,a,n),t=t.sibling}function Ef(e,t,a,n){var s=t.flags;switch(t.tag){case 0:case 11:case 15:xa(e,t,a,n),s&2048&&ii(9,t);break;case 1:xa(e,t,a,n);break;case 3:xa(e,t,a,n),s&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Xl(e)));break;case 12:if(s&2048){xa(e,t,a,n),e=t.stateNode;try{var o=t.memoizedProps,w=o.id,D=o.onPostCommit;typeof D=="function"&&D(w,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(G){ut(t,t.return,G)}}else xa(e,t,a,n);break;case 31:xa(e,t,a,n);break;case 13:xa(e,t,a,n);break;case 23:break;case 22:o=t.stateNode,w=t.alternate,t.memoizedState!==null?o._visibility&2?xa(e,t,a,n):ri(e,t):o._visibility&2?xa(e,t,a,n):(o._visibility|=2,hl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),s&2048&&qo(w,t);break;case 24:xa(e,t,a,n),s&2048&&Ko(t.alternate,t);break;default:xa(e,t,a,n)}}function hl(e,t,a,n,s){for(s=s&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var o=e,w=t,D=a,G=n,le=w.flags;switch(w.tag){case 0:case 11:case 15:hl(o,w,D,G,s),ii(8,w);break;case 23:break;case 22:var ge=w.stateNode;w.memoizedState!==null?ge._visibility&2?hl(o,w,D,G,s):ri(o,w):(ge._visibility|=2,hl(o,w,D,G,s)),s&&le&2048&&qo(w.alternate,w);break;case 24:hl(o,w,D,G,s),s&&le&2048&&Ko(w.alternate,w);break;default:hl(o,w,D,G,s)}t=t.sibling}}function ri(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,s=n.flags;switch(n.tag){case 22:ri(a,n),s&2048&&qo(n.alternate,n);break;case 24:ri(a,n),s&2048&&Ko(n.alternate,n);break;default:ri(a,n)}t=t.sibling}}var oi=8192;function pl(e,t,a){if(e.subtreeFlags&oi)for(e=e.child;e!==null;)Af(e,t,a),e=e.sibling}function Af(e,t,a){switch(e.tag){case 26:pl(e,t,a),e.flags&oi&&e.memoizedState!==null&&e0(a,ma,e.memoizedState,e.memoizedProps);break;case 5:pl(e,t,a);break;case 3:case 4:var n=ma;ma=Os(e.stateNode.containerInfo),pl(e,t,a),ma=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=oi,oi=16777216,pl(e,t,a),oi=n):pl(e,t,a));break;default:pl(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 ci(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];Ot=n,Of(n,e)}zf(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Rf(e),e=e.sibling}function Rf(e){switch(e.tag){case 0:case 11:case 15:ci(e),e.flags&2048&&an(9,e,e.return);break;case 3:ci(e);break;case 12:ci(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ys(e)):ci(e);break;default:ci(e)}}function ys(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];Ot=n,Of(n,e)}zf(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:an(8,t,t.return),ys(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,ys(t));break;default:ys(t)}e=e.sibling}}function Of(e,t){for(;Ot!==null;){var a=Ot;switch(a.tag){case 0:case 11:case 15:an(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:Xl(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,Ot=n;else e:for(a=e;Ot!==null;){n=Ot;var s=n.sibling,o=n.return;if(jf(n),n===a){Ot=null;break e}if(s!==null){s.return=o,Ot=s;break e}Ot=o}}}var mx={getCacheForType:function(e){var t=Tt(Nt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(Nt).controller.signal}},xx=typeof WeakMap=="function"?WeakMap:Map,st=0,mt=null,Fe=null,Pe=0,ct=0,Pt=null,nn=!1,ml=!1,Io=!1,qa=0,wt=0,ln=0,Hn=0,Go=0,Wt=0,xl=0,ui=null,Xt=null,Vo=!1,vs=0,Df=0,ws=1/0,js=null,sn=null,zt=0,rn=null,gl=null,Ka=0,Xo=0,Zo=null,Tf=null,di=0,$o=null;function ea(){return(st&2)!==0&&Pe!==0?Pe&-Pe:X.T!==null?ec():Ri()}function Mf(){if(Wt===0)if((Pe&536870912)===0||et){var e=_a;_a<<=1,(_a&3932160)===0&&(_a=262144),Wt=e}else Wt=536870912;return e=Ft.current,e!==null&&(e.flags|=32),Wt}function Zt(e,t,a){(e===mt&&(ct===2||ct===9)||e.cancelPendingCommit!==null)&&(bl(e,0),on(e,Pe,Wt,!1)),yn(e,a),((st&2)===0||e!==mt)&&(e===mt&&((st&2)===0&&(Hn|=a),wt===4&&on(e,Pe,Wt,!1)),wa(e))}function Uf(e,t,a){if((st&6)!==0)throw Error(u(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||bn(e,t),s=n?yx(e,t):Fo(e,t,!0),o=n;do{if(s===0){ml&&!n&&on(e,t,0,!1);break}else{if(a=e.current.alternate,o&&!gx(a)){s=Fo(e,t,!1),o=!1;continue}if(s===2){if(o=t,e.errorRecoveryDisabledLanes&o)var w=0;else w=e.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){t=w;e:{var D=e;s=ui;var G=D.current.memoizedState.isDehydrated;if(G&&(bl(D,w).flags|=256),w=Fo(D,w,!1),w!==2){if(Io&&!G){D.errorRecoveryDisabledLanes|=o,Hn|=o,s=4;break e}o=Xt,Xt=s,o!==null&&(Xt===null?Xt=o:Xt.push.apply(Xt,o))}s=w}if(o=!1,s!==2)continue}}if(s===1){bl(e,0),on(e,t,0,!0);break}e:{switch(n=e,o=s,o){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t)break;case 6:on(n,t,Wt,!nn);break e;case 2:Xt=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(s=vs+300-Ce(),10<s)){if(on(n,t,Wt,!nn),Kn(n,0,!0)!==0)break e;Ka=t,n.timeoutHandle=hh(Bf.bind(null,n,a,Xt,js,Vo,t,Wt,Hn,xl,nn,o,"Throttled",-0,0),s);break e}Bf(n,a,Xt,js,Vo,t,Wt,Hn,xl,nn,o,null,-0,0)}}break}while(!0);wa(e)}function Bf(e,t,a,n,s,o,w,D,G,le,ge,Se,se,fe){if(e.timeoutHandle=-1,Se=t.subtreeFlags,Se&8192||(Se&16785408)===16785408){Se={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ka},Af(t,o,Se);var De=(o&62914560)===o?vs-Ce():(o&4194048)===o?Df-Ce():0;if(De=t0(Se,De),De!==null){Ka=o,e.cancelPendingCommit=De(Vf.bind(null,e,t,o,a,n,s,w,D,G,ge,Se,null,se,fe)),on(e,o,w,!le);return}}Vf(e,t,o,a,n,s,w,D,G)}function gx(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 s=a[n],o=s.getSnapshot;s=s.value;try{if(!$t(o(),s))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 on(e,t,a,n){t&=~Go,t&=~Hn,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var s=t;0<s;){var o=31-Te(s),w=1<<o;n[o]=-1,s&=~w}a!==0&&In(e,a,t)}function Ss(){return(st&6)===0?(fi(0),!1):!0}function Qo(){if(Fe!==null){if(ct===0)var e=Fe.return;else e=Fe,Ra=zn=null,uo(e),ol=null,$l=0,e=Fe;for(;e!==null;)pf(e.alternate,e),e=e.return;Fe=null}}function bl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,Bx(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Ka=0,Qo(),mt=e,Fe=a=Aa(e.current,null),Pe=t,ct=0,Pt=null,nn=!1,ml=bn(e,t),Io=!1,xl=Wt=Go=Hn=ln=wt=0,Xt=ui=null,Vo=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-Te(n),o=1<<s;t|=e[s],n&=~o}return qa=t,Gi(),a}function Lf(e,t){Xe=null,X.H=ai,t===rl||t===Pi?(t=Wu(),ct=3):t===Pr?(t=Wu(),ct=4):ct=t===ko?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,Pt=t,Fe===null&&(wt=1,fs(e,ia(t,e.current)))}function Hf(){var e=Ft.current;return e===null?!0:(Pe&4194048)===Pe?ca===null:(Pe&62914560)===Pe||(Pe&536870912)!==0?e===ca:!1}function Yf(){var e=X.H;return X.H=ai,e===null?ai:e}function qf(){var e=X.A;return X.A=mx,e}function Ns(){wt=4,nn||(Pe&4194048)!==Pe&&Ft.current!==null||(ml=!0),(ln&134217727)===0&&(Hn&134217727)===0||mt===null||on(mt,Pe,Wt,!1)}function Fo(e,t,a){var n=st;st|=2;var s=Yf(),o=qf();(mt!==e||Pe!==t)&&(js=null,bl(e,t)),t=!1;var w=wt;e:do try{if(ct!==0&&Fe!==null){var D=Fe,G=Pt;switch(ct){case 8:Qo(),w=6;break e;case 3:case 2:case 9:case 6:Ft.current===null&&(t=!0);var le=ct;if(ct=0,Pt=null,yl(e,D,G,le),a&&ml){w=0;break e}break;default:le=ct,ct=0,Pt=null,yl(e,D,G,le)}}bx(),w=wt;break}catch(ge){Lf(e,ge)}while(!0);return t&&e.shellSuspendCounter++,Ra=zn=null,st=n,X.H=s,X.A=o,Fe===null&&(mt=null,Pe=0,Gi()),w}function bx(){for(;Fe!==null;)Kf(Fe)}function yx(e,t){var a=st;st|=2;var n=Yf(),s=qf();mt!==e||Pe!==t?(js=null,ws=Ce()+500,bl(e,t)):ml=bn(e,t);e:do try{if(ct!==0&&Fe!==null){t=Fe;var o=Pt;t:switch(ct){case 1:ct=0,Pt=null,yl(e,t,o,1);break;case 2:case 9:if(Ju(o)){ct=0,Pt=null,If(t);break}t=function(){ct!==2&&ct!==9||mt!==e||(ct=7),wa(e)},o.then(t,t);break e;case 3:ct=7;break e;case 4:ct=5;break e;case 7:Ju(o)?(ct=0,Pt=null,If(t)):(ct=0,Pt=null,yl(e,t,o,7));break;case 5:var w=null;switch(Fe.tag){case 26:w=Fe.memoizedState;case 5:case 27:var D=Fe;if(w?Eh(w):D.stateNode.complete){ct=0,Pt=null;var G=D.sibling;if(G!==null)Fe=G;else{var le=D.return;le!==null?(Fe=le,_s(le)):Fe=null}break t}}ct=0,Pt=null,yl(e,t,o,5);break;case 6:ct=0,Pt=null,yl(e,t,o,6);break;case 8:Qo(),wt=6;break e;default:throw Error(u(462))}}vx();break}catch(ge){Lf(e,ge)}while(!0);return Ra=zn=null,X.H=n,X.A=s,st=a,Fe!==null?0:(mt=null,Pe=0,Gi(),wt)}function vx(){for(;Fe!==null&&!K();)Kf(Fe)}function Kf(e){var t=ff(e.alternate,e,qa);e.memoizedProps=e.pendingProps,t===null?_s(e):Fe=t}function If(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=sf(a,t,t.pendingProps,t.type,void 0,Pe);break;case 11:t=sf(a,t,t.pendingProps,t.type.render,t.ref,Pe);break;case 5:uo(t);default:pf(a,t),t=Fe=Yu(t,qa),t=ff(a,t,qa)}e.memoizedProps=e.pendingProps,t===null?_s(e):Fe=t}function yl(e,t,a,n){Ra=zn=null,uo(t),ol=null,$l=0;var s=t.return;try{if(ox(e,s,t,a,Pe)){wt=1,fs(e,ia(a,e.current)),Fe=null;return}}catch(o){if(s!==null)throw Fe=s,o;wt=1,fs(e,ia(a,e.current)),Fe=null;return}t.flags&32768?(et||n===1?e=!0:ml||(Pe&536870912)!==0?e=!1:(nn=e=!0,(n===2||n===9||n===3||n===6)&&(n=Ft.current,n!==null&&n.tag===13&&(n.flags|=16384))),Gf(t,e)):_s(t)}function _s(e){var t=e;do{if((t.flags&32768)!==0){Gf(t,nn);return}e=t.return;var a=dx(t.alternate,t,qa);if(a!==null){Fe=a;return}if(t=t.sibling,t!==null){Fe=t;return}Fe=t=e}while(t!==null);wt===0&&(wt=5)}function Gf(e,t){do{var a=fx(e.alternate,e);if(a!==null){a.flags&=32767,Fe=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Fe=e;return}Fe=e=a}while(e!==null);wt=6,Fe=null}function Vf(e,t,a,n,s,o,w,D,G){e.cancelPendingCommit=null;do Cs();while(zt!==0);if((st&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));if(o=t.lanes|t.childLanes,o|=Br,Rl(e,a,o,w,D,G),e===mt&&(Fe=mt=null,Pe=0),gl=t,rn=e,Ka=a,Xo=o,Zo=s,Tf=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Nx(He,function(){return Ff(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=X.T,X.T=null,s=Q.p,Q.p=2,w=st,st|=4;try{hx(e,t,a)}finally{st=w,Q.p=s,X.T=n}}zt=1,Xf(),Zf(),$f()}}function Xf(){if(zt===1){zt=0;var e=rn,t=gl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=X.T,X.T=null;var n=Q.p;Q.p=2;var s=st;st|=4;try{Cf(t,e);var o=oc,w=Ru(e.containerInfo),D=o.focusedElem,G=o.selectionRange;if(w!==D&&D&&D.ownerDocument&&zu(D.ownerDocument.documentElement,D)){if(G!==null&&Or(D)){var le=G.start,ge=G.end;if(ge===void 0&&(ge=le),"selectionStart"in D)D.selectionStart=le,D.selectionEnd=Math.min(ge,D.value.length);else{var Se=D.ownerDocument||document,se=Se&&Se.defaultView||window;if(se.getSelection){var fe=se.getSelection(),De=D.textContent.length,Ye=Math.min(G.start,De),ht=G.end===void 0?Ye:Math.min(G.end,De);!fe.extend&&Ye>ht&&(w=ht,ht=Ye,Ye=w);var P=Au(D,Ye),F=Au(D,ht);if(P&&F&&(fe.rangeCount!==1||fe.anchorNode!==P.node||fe.anchorOffset!==P.offset||fe.focusNode!==F.node||fe.focusOffset!==F.offset)){var ne=Se.createRange();ne.setStart(P.node,P.offset),fe.removeAllRanges(),Ye>ht?(fe.addRange(ne),fe.extend(F.node,F.offset)):(ne.setEnd(F.node,F.offset),fe.addRange(ne))}}}}for(Se=[],fe=D;fe=fe.parentNode;)fe.nodeType===1&&Se.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<Se.length;D++){var ve=Se[D];ve.element.scrollLeft=ve.left,ve.element.scrollTop=ve.top}}Ls=!!rc,oc=rc=null}finally{st=s,Q.p=n,X.T=a}}e.current=t,zt=2}}function Zf(){if(zt===2){zt=0;var e=rn,t=gl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=X.T,X.T=null;var n=Q.p;Q.p=2;var s=st;st|=4;try{wf(e,t.alternate,t)}finally{st=s,Q.p=n,X.T=a}}zt=3}}function $f(){if(zt===4||zt===3){zt=0,we();var e=rn,t=gl,a=Ka,n=Tf;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?zt=5:(zt=0,gl=rn=null,Qf(e,e.pendingLanes));var s=e.pendingLanes;if(s===0&&(sn=null),Dl(a),t=t.stateNode,Be&&typeof Be.onCommitFiberRoot=="function")try{Be.onCommitFiberRoot(Me,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=X.T,s=Q.p,Q.p=2,X.T=null;try{for(var o=e.onRecoverableError,w=0;w<n.length;w++){var D=n[w];o(D.value,{componentStack:D.stack})}}finally{X.T=t,Q.p=s}}(Ka&3)!==0&&Cs(),wa(e),s=e.pendingLanes,(a&261930)!==0&&(s&42)!==0?e===$o?di++:(di=0,$o=e):di=0,fi(0)}}function Qf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Xl(t)))}function Cs(){return Xf(),Zf(),$f(),Ff()}function Ff(){if(zt!==5)return!1;var e=rn,t=Xo;Xo=0;var a=Dl(Ka),n=X.T,s=Q.p;try{Q.p=32>a?32:a,X.T=null,a=Zo,Zo=null;var o=rn,w=Ka;if(zt=0,gl=rn=null,Ka=0,(st&6)!==0)throw Error(u(331));var D=st;if(st|=4,Rf(o.current),Ef(o,o.current,w,a),st=D,fi(0,!1),Be&&typeof Be.onPostCommitFiberRoot=="function")try{Be.onPostCommitFiberRoot(Me,o)}catch{}return!0}finally{Q.p=s,X.T=n,Qf(e,t)}}function Jf(e,t,a){t=ia(a,t),t=Co(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(yn(e,2),wa(e))}function ut(e,t,a){if(e.tag===3)Jf(e,e,a);else for(;t!==null;){if(t.tag===3){Jf(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(sn===null||!sn.has(n))){e=ia(a,e),a=Jd(2),n=Wa(t,a,2),n!==null&&(Pd(a,n,t,e),yn(n,2),wa(n));break}}t=t.return}}function Jo(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new xx;var s=new Set;n.set(t,s)}else s=n.get(t),s===void 0&&(s=new Set,n.set(t,s));s.has(a)||(Io=!0,s.add(a),e=wx.bind(null,e,t,a),t.then(e,e))}function wx(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,mt===e&&(Pe&a)===a&&(wt===4||wt===3&&(Pe&62914560)===Pe&&300>Ce()-vs?(st&2)===0&&bl(e,0):Go|=a,xl===Pe&&(xl=0)),wa(e)}function Pf(e,t){t===0&&(t=zi()),e=kn(e,t),e!==null&&(yn(e,t),wa(e))}function jx(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Pf(e,a)}function Sx(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,s=e.memoizedState;s!==null&&(a=s.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(u(314))}n!==null&&n.delete(t),Pf(e,a)}function Nx(e,t){return me(e,t)}var ks=null,vl=null,Po=!1,Es=!1,Wo=!1,cn=0;function wa(e){e!==vl&&e.next===null&&(vl===null?ks=vl=e:vl=vl.next=e),Es=!0,Po||(Po=!0,Cx())}function fi(e,t){if(!Wo&&Es){Wo=!0;do for(var a=!1,n=ks;n!==null;){if(e!==0){var s=n.pendingLanes;if(s===0)var o=0;else{var w=n.suspendedLanes,D=n.pingedLanes;o=(1<<31-Te(42|e)+1)-1,o&=s&~(w&~D),o=o&201326741?o&201326741|1:o?o|2:0}o!==0&&(a=!0,ah(n,o))}else o=Pe,o=Kn(n,n===mt?o:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(o&3)===0||bn(n,o)||(a=!0,ah(n,o));n=n.next}while(a);Wo=!1}}function _x(){Wf()}function Wf(){Es=Po=!1;var e=0;cn!==0&&Ux()&&(e=cn);for(var t=Ce(),a=null,n=ks;n!==null;){var s=n.next,o=eh(n,t);o===0?(n.next=null,a===null?ks=s:a.next=s,s===null&&(vl=a)):(a=n,(e!==0||(o&3)!==0)&&(Es=!0)),n=s}zt!==0&&zt!==5||fi(e),cn!==0&&(cn=0)}function eh(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,s=e.expirationTimes,o=e.pendingLanes&-62914561;0<o;){var w=31-Te(o),D=1<<w,G=s[w];G===-1?((D&a)===0||(D&n)!==0)&&(s[w]=fr(D,t)):G<=t&&(e.expiredLanes|=D),o&=~D}if(t=mt,a=Pe,a=Kn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(ct===2||ct===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&ce(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||bn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&ce(n),Dl(a)){case 2:case 8:a=Ve;break;case 32:a=He;break;case 268435456:a=be;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&&ce(n),e.callbackPriority=2,e.callbackNode=null,2}function th(e,t){if(zt!==0&&zt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Cs()&&e.callbackNode!==a)return null;var n=Pe;return n=Kn(e,e===mt?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(Uf(e,n,t),eh(e,Ce()),e.callbackNode!=null&&e.callbackNode===a?th.bind(null,e):null)}function ah(e,t){if(Cs())return null;Uf(e,t,!0)}function Cx(){Lx(function(){(st&6)!==0?me(Oe,_x):Wf()})}function ec(){if(cn===0){var e=il;e===0&&(e=ga,ga<<=1,(ga&261888)===0&&(ga=256)),cn=e}return cn}function nh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ui(""+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 kx(e,t,a,n,s){if(t==="submit"&&a&&a.stateNode===s){var o=nh((s[Lt]||null).action),w=n.submitter;w&&(t=(t=w[Lt]||null)?nh(t.formAction):w.getAttribute("formAction"),t!==null&&(o=t,w=null));var D=new Yi("action","action",null,n,s);e.push({event:D,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(cn!==0){var G=w?lh(s,w):new FormData(s);vo(a,{pending:!0,data:G,method:s.method,action:o},null,G)}}else typeof o=="function"&&(D.preventDefault(),G=w?lh(s,w):new FormData(s),vo(a,{pending:!0,data:G,method:s.method,action:o},o,G))},currentTarget:s}]})}}for(var tc=0;tc<Ur.length;tc++){var ac=Ur[tc],Ex=ac.toLowerCase(),Ax=ac[0].toUpperCase()+ac.slice(1);pa(Ex,"on"+Ax)}pa(Tu,"onAnimationEnd"),pa(Mu,"onAnimationIteration"),pa(Uu,"onAnimationStart"),pa("dblclick","onDoubleClick"),pa("focusin","onFocus"),pa("focusout","onBlur"),pa(Vm,"onTransitionRun"),pa(Xm,"onTransitionStart"),pa(Zm,"onTransitionCancel"),pa(Bu,"onTransitionEnd"),Vn("onMouseEnter",["mouseout","mouseover"]),Vn("onMouseLeave",["mouseout","mouseover"]),Vn("onPointerEnter",["pointerout","pointerover"]),Vn("onPointerLeave",["pointerout","pointerover"]),Sn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Sn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Sn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Sn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Sn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var hi="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(" "),zx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(hi));function ih(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],s=n.event;n=n.listeners;e:{var o=void 0;if(t)for(var w=n.length-1;0<=w;w--){var D=n[w],G=D.instance,le=D.currentTarget;if(D=D.listener,G!==o&&s.isPropagationStopped())break e;o=D,s.currentTarget=le;try{o(s)}catch(ge){Ii(ge)}s.currentTarget=null,o=G}else for(w=0;w<n.length;w++){if(D=n[w],G=D.instance,le=D.currentTarget,D=D.listener,G!==o&&s.isPropagationStopped())break e;o=D,s.currentTarget=le;try{o(s)}catch(ge){Ii(ge)}s.currentTarget=null,o=G}}}}function Je(e,t){var a=t[Tl];a===void 0&&(a=t[Tl]=new Set);var n=e+"__bubble";a.has(n)||(sh(t,e,2,!1),a.add(n))}function nc(e,t,a){var n=0;t&&(n|=4),sh(a,e,n,t)}var As="_reactListening"+Math.random().toString(36).slice(2);function lc(e){if(!e[As]){e[As]=!0,Pc.forEach(function(a){a!=="selectionchange"&&(zx.has(a)||nc(a,!1,e),nc(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[As]||(t[As]=!0,nc("selectionchange",!1,t))}}function sh(e,t,a,n){switch(Mh(t)){case 2:var s=l0;break;case 8:s=i0;break;default:s=yc}a=s.bind(null,t,a,e),s=void 0,!Sr||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(s=!0),n?s!==void 0?e.addEventListener(t,a,{capture:!0,passive:s}):e.addEventListener(t,a,!0):s!==void 0?e.addEventListener(t,a,{passive:s}):e.addEventListener(t,a,!1)}function ic(e,t,a,n,s){var o=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var w=n.tag;if(w===3||w===4){var D=n.stateNode.containerInfo;if(D===s)break;if(w===4)for(w=n.return;w!==null;){var G=w.tag;if((G===3||G===4)&&w.stateNode.containerInfo===s)return;w=w.return}for(;D!==null;){if(w=pe(D),w===null)return;if(G=w.tag,G===5||G===6||G===26||G===27){n=o=w;continue e}D=D.parentNode}}n=n.return}uu(function(){var le=o,ge=wr(a),Se=[];e:{var se=Lu.get(e);if(se!==void 0){var fe=Yi,De=e;switch(e){case"keypress":if(Li(a)===0)break e;case"keydown":case"keyup":fe=Sm;break;case"focusin":De="focus",fe=kr;break;case"focusout":De="blur",fe=kr;break;case"beforeblur":case"afterblur":fe=kr;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":fe=hu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=dm;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=Cm;break;case Tu:case Mu:case Uu:fe=pm;break;case Bu:fe=Em;break;case"scroll":case"scrollend":fe=cm;break;case"wheel":fe=zm;break;case"copy":case"cut":case"paste":fe=xm;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=mu;break;case"toggle":case"beforetoggle":fe=Om}var Ye=(t&4)!==0,ht=!Ye&&(e==="scroll"||e==="scrollend"),P=Ye?se!==null?se+"Capture":null:se;Ye=[];for(var F=le,ne;F!==null;){var ve=F;if(ne=ve.stateNode,ve=ve.tag,ve!==5&&ve!==26&&ve!==27||ne===null||P===null||(ve=Ml(F,P),ve!=null&&Ye.push(pi(F,ve,ne))),ht)break;F=F.return}0<Ye.length&&(se=new fe(se,De,null,a,ge),Se.push({event:se,listeners:Ye}))}}if((t&7)===0){e:{if(se=e==="mouseover"||e==="pointerover",fe=e==="mouseout"||e==="pointerout",se&&a!==vr&&(De=a.relatedTarget||a.fromElement)&&(pe(De)||De[wn]))break e;if((fe||se)&&(se=ge.window===ge?ge:(se=ge.ownerDocument)?se.defaultView||se.parentWindow:window,fe?(De=a.relatedTarget||a.toElement,fe=le,De=De?pe(De):null,De!==null&&(ht=d(De),Ye=De.tag,De!==ht||Ye!==5&&Ye!==27&&Ye!==6)&&(De=null)):(fe=null,De=le),fe!==De)){if(Ye=hu,ve="onMouseLeave",P="onMouseEnter",F="mouse",(e==="pointerout"||e==="pointerover")&&(Ye=mu,ve="onPointerLeave",P="onPointerEnter",F="pointer"),ht=fe==null?se:ke(fe),ne=De==null?se:ke(De),se=new Ye(ve,F+"leave",fe,a,ge),se.target=ht,se.relatedTarget=ne,ve=null,pe(ge)===le&&(Ye=new Ye(P,F+"enter",De,a,ge),Ye.target=ne,Ye.relatedTarget=ht,ve=Ye),ht=ve,fe&&De)t:{for(Ye=Rx,P=fe,F=De,ne=0,ve=P;ve;ve=Ye(ve))ne++;ve=0;for(var Le=F;Le;Le=Ye(Le))ve++;for(;0<ne-ve;)P=Ye(P),ne--;for(;0<ve-ne;)F=Ye(F),ve--;for(;ne--;){if(P===F||F!==null&&P===F.alternate){Ye=P;break t}P=Ye(P),F=Ye(F)}Ye=null}else Ye=null;fe!==null&&rh(Se,se,fe,Ye,!1),De!==null&&ht!==null&&rh(Se,ht,De,Ye,!0)}}e:{if(se=le?ke(le):window,fe=se.nodeName&&se.nodeName.toLowerCase(),fe==="select"||fe==="input"&&se.type==="file")var nt=Su;else if(wu(se))if(Nu)nt=Km;else{nt=Ym;var Ue=Hm}else fe=se.nodeName,!fe||fe.toLowerCase()!=="input"||se.type!=="checkbox"&&se.type!=="radio"?le&&yr(le.elementType)&&(nt=Su):nt=qm;if(nt&&(nt=nt(e,le))){ju(Se,nt,a,ge);break e}Ue&&Ue(e,se,le),e==="focusout"&&le&&se.type==="number"&&le.memoizedProps.value!=null&&br(se,"number",se.value)}switch(Ue=le?ke(le):window,e){case"focusin":(wu(Ue)||Ue.contentEditable==="true")&&(Jn=Ue,Dr=le,Il=null);break;case"focusout":Il=Dr=Jn=null;break;case"mousedown":Tr=!0;break;case"contextmenu":case"mouseup":case"dragend":Tr=!1,Ou(Se,a,ge);break;case"selectionchange":if(Gm)break;case"keydown":case"keyup":Ou(Se,a,ge)}var Ze;if(Ar)e:{switch(e){case"compositionstart":var We="onCompositionStart";break e;case"compositionend":We="onCompositionEnd";break e;case"compositionupdate":We="onCompositionUpdate";break e}We=void 0}else Fn?yu(e,a)&&(We="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(We="onCompositionStart");We&&(xu&&a.locale!=="ko"&&(Fn||We!=="onCompositionStart"?We==="onCompositionEnd"&&Fn&&(Ze=du()):(Xa=ge,Nr="value"in Xa?Xa.value:Xa.textContent,Fn=!0)),Ue=zs(le,We),0<Ue.length&&(We=new pu(We,e,null,a,ge),Se.push({event:We,listeners:Ue}),Ze?We.data=Ze:(Ze=vu(a),Ze!==null&&(We.data=Ze)))),(Ze=Tm?Mm(e,a):Um(e,a))&&(We=zs(le,"onBeforeInput"),0<We.length&&(Ue=new pu("onBeforeInput","beforeinput",null,a,ge),Se.push({event:Ue,listeners:We}),Ue.data=Ze)),kx(Se,e,le,a,ge)}ih(Se,t)})}function pi(e,t,a){return{instance:e,listener:t,currentTarget:a}}function zs(e,t){for(var a=t+"Capture",n=[];e!==null;){var s=e,o=s.stateNode;if(s=s.tag,s!==5&&s!==26&&s!==27||o===null||(s=Ml(e,a),s!=null&&n.unshift(pi(e,s,o)),s=Ml(e,t),s!=null&&n.push(pi(e,s,o))),e.tag===3)return n;e=e.return}return[]}function Rx(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,s){for(var o=t._reactName,w=[];a!==null&&a!==n;){var D=a,G=D.alternate,le=D.stateNode;if(D=D.tag,G!==null&&G===n)break;D!==5&&D!==26&&D!==27||le===null||(G=le,s?(le=Ml(a,o),le!=null&&w.unshift(pi(a,le,G))):s||(le=Ml(a,o),le!=null&&w.push(pi(a,le,G)))),a=a.return}w.length!==0&&e.push({event:t,listeners:w})}var Ox=/\r\n?/g,Dx=/\u0000|\uFFFD/g;function oh(e){return(typeof e=="string"?e:""+e).replace(Ox,`
9
+ `).replace(Dx,"")}function ch(e,t){return t=oh(t),oh(e)===t}function ft(e,t,a,n,s,o){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Zn(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Zn(e,""+n);break;case"className":Ti(e,"class",n);break;case"tabIndex":Ti(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":Ti(e,a,n);break;case"style":ou(e,n,o);break;case"data":if(t!=="object"){Ti(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=Ui(""+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 o=="function"&&(a==="formAction"?(t!=="input"&&ft(e,t,"name",s.name,s,null),ft(e,t,"formEncType",s.formEncType,s,null),ft(e,t,"formMethod",s.formMethod,s,null),ft(e,t,"formTarget",s.formTarget,s,null)):(ft(e,t,"encType",s.encType,s,null),ft(e,t,"method",s.method,s,null),ft(e,t,"target",s.target,s,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=Ui(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=ka);break;case"onScroll":n!=null&&Je("scroll",e);break;case"onScrollEnd":n!=null&&Je("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(u(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=Ui(""+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":Je("beforetoggle",e),Je("toggle",e),Di(e,"popover",n);break;case"xlinkActuate":Ca(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":Ca(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":Ca(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":Ca(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":Ca(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":Ca(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":Ca(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Di(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=rm.get(a)||a,Di(e,a,n))}}function sc(e,t,a,n,s,o){switch(a){case"style":ou(e,n,o);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(u(61));if(a=n.__html,a!=null){if(s.children!=null)throw Error(u(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Zn(e,n):(typeof n=="number"||typeof n=="bigint")&&Zn(e,""+n);break;case"onScroll":n!=null&&Je("scroll",e);break;case"onScrollEnd":n!=null&&Je("scrollend",e);break;case"onClick":n!=null&&(e.onclick=ka);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Wc.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(s=a.endsWith("Capture"),t=a.slice(2,s?a.length-7:void 0),o=e[Lt]||null,o=o!=null?o[a]:null,typeof o=="function"&&e.removeEventListener(t,o,s),typeof n=="function")){typeof o!="function"&&o!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,s);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Di(e,a,n)}}}function Ut(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Je("error",e),Je("load",e);var n=!1,s=!1,o;for(o in a)if(a.hasOwnProperty(o)){var w=a[o];if(w!=null)switch(o){case"src":n=!0;break;case"srcSet":s=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:ft(e,t,o,w,a,null)}}s&&ft(e,t,"srcSet",a.srcSet,a,null),n&&ft(e,t,"src",a.src,a,null);return;case"input":Je("invalid",e);var D=o=w=s=null,G=null,le=null;for(n in a)if(a.hasOwnProperty(n)){var ge=a[n];if(ge!=null)switch(n){case"name":s=ge;break;case"type":w=ge;break;case"checked":G=ge;break;case"defaultChecked":le=ge;break;case"value":o=ge;break;case"defaultValue":D=ge;break;case"children":case"dangerouslySetInnerHTML":if(ge!=null)throw Error(u(137,t));break;default:ft(e,t,n,ge,a,null)}}lu(e,o,D,G,le,w,s,!1);return;case"select":Je("invalid",e),n=w=o=null;for(s in a)if(a.hasOwnProperty(s)&&(D=a[s],D!=null))switch(s){case"value":o=D;break;case"defaultValue":w=D;break;case"multiple":n=D;default:ft(e,t,s,D,a,null)}t=o,a=w,e.multiple=!!n,t!=null?Xn(e,!!n,t,!1):a!=null&&Xn(e,!!n,a,!0);return;case"textarea":Je("invalid",e),o=s=n=null;for(w in a)if(a.hasOwnProperty(w)&&(D=a[w],D!=null))switch(w){case"value":n=D;break;case"defaultValue":s=D;break;case"children":o=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(u(91));break;default:ft(e,t,w,D,a,null)}su(e,n,s,o);return;case"option":for(G in a)a.hasOwnProperty(G)&&(n=a[G],n!=null)&&(G==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":ft(e,t,G,n,a,null));return;case"dialog":Je("beforetoggle",e),Je("toggle",e),Je("cancel",e),Je("close",e);break;case"iframe":case"object":Je("load",e);break;case"video":case"audio":for(n=0;n<hi.length;n++)Je(hi[n],e);break;case"image":Je("error",e),Je("load",e);break;case"details":Je("toggle",e);break;case"embed":case"source":case"link":Je("error",e),Je("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(u(137,t));default:ft(e,t,le,n,a,null)}return;default:if(yr(t)){for(ge in a)a.hasOwnProperty(ge)&&(n=a[ge],n!==void 0&&sc(e,t,ge,n,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(n=a[D],n!=null&&ft(e,t,D,n,a,null))}function Tx(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 s=null,o=null,w=null,D=null,G=null,le=null,ge=null;for(fe in a){var Se=a[fe];if(a.hasOwnProperty(fe)&&Se!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":G=Se;default:n.hasOwnProperty(fe)||ft(e,t,fe,null,n,Se)}}for(var se in n){var fe=n[se];if(Se=a[se],n.hasOwnProperty(se)&&(fe!=null||Se!=null))switch(se){case"type":o=fe;break;case"name":s=fe;break;case"checked":le=fe;break;case"defaultChecked":ge=fe;break;case"value":w=fe;break;case"defaultValue":D=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(u(137,t));break;default:fe!==Se&&ft(e,t,se,fe,n,Se)}}gr(e,w,D,G,le,ge,o,s);return;case"select":fe=w=D=se=null;for(o in a)if(G=a[o],a.hasOwnProperty(o)&&G!=null)switch(o){case"value":break;case"multiple":fe=G;default:n.hasOwnProperty(o)||ft(e,t,o,null,n,G)}for(s in n)if(o=n[s],G=a[s],n.hasOwnProperty(s)&&(o!=null||G!=null))switch(s){case"value":se=o;break;case"defaultValue":D=o;break;case"multiple":w=o;default:o!==G&&ft(e,t,s,o,n,G)}t=D,a=w,n=fe,se!=null?Xn(e,!!a,se,!1):!!n!=!!a&&(t!=null?Xn(e,!!a,t,!0):Xn(e,!!a,a?[]:"",!1));return;case"textarea":fe=se=null;for(D in a)if(s=a[D],a.hasOwnProperty(D)&&s!=null&&!n.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:ft(e,t,D,null,n,s)}for(w in n)if(s=n[w],o=a[w],n.hasOwnProperty(w)&&(s!=null||o!=null))switch(w){case"value":se=s;break;case"defaultValue":fe=s;break;case"children":break;case"dangerouslySetInnerHTML":if(s!=null)throw Error(u(91));break;default:s!==o&&ft(e,t,w,s,n,o)}iu(e,se,fe);return;case"option":for(var De in a)se=a[De],a.hasOwnProperty(De)&&se!=null&&!n.hasOwnProperty(De)&&(De==="selected"?e.selected=!1:ft(e,t,De,null,n,se));for(G in n)se=n[G],fe=a[G],n.hasOwnProperty(G)&&se!==fe&&(se!=null||fe!=null)&&(G==="selected"?e.selected=se&&typeof se!="function"&&typeof se!="symbol":ft(e,t,G,se,n,fe));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Ye in a)se=a[Ye],a.hasOwnProperty(Ye)&&se!=null&&!n.hasOwnProperty(Ye)&&ft(e,t,Ye,null,n,se);for(le in n)if(se=n[le],fe=a[le],n.hasOwnProperty(le)&&se!==fe&&(se!=null||fe!=null))switch(le){case"children":case"dangerouslySetInnerHTML":if(se!=null)throw Error(u(137,t));break;default:ft(e,t,le,se,n,fe)}return;default:if(yr(t)){for(var ht in a)se=a[ht],a.hasOwnProperty(ht)&&se!==void 0&&!n.hasOwnProperty(ht)&&sc(e,t,ht,void 0,n,se);for(ge in n)se=n[ge],fe=a[ge],!n.hasOwnProperty(ge)||se===fe||se===void 0&&fe===void 0||sc(e,t,ge,se,n,fe);return}}for(var P in a)se=a[P],a.hasOwnProperty(P)&&se!=null&&!n.hasOwnProperty(P)&&ft(e,t,P,null,n,se);for(Se in n)se=n[Se],fe=a[Se],!n.hasOwnProperty(Se)||se===fe||se==null&&fe==null||ft(e,t,Se,se,n,fe)}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 Mx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var s=a[n],o=s.transferSize,w=s.initiatorType,D=s.duration;if(o&&D&&uh(w)){for(w=0,D=s.responseEnd,n+=1;n<a.length;n++){var G=a[n],le=G.startTime;if(le>D)break;var ge=G.transferSize,Se=G.initiatorType;ge&&uh(Se)&&(G=G.responseEnd,w+=ge*(G<D?1:(D-le)/(G-le)))}if(--n,t+=8*(o+w)/(s.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 rc=null,oc=null;function Rs(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 cc(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 uc=null;function Ux(){var e=window.event;return e&&e.type==="popstate"?e===uc?!1:(uc=e,!0):(uc=null,!1)}var hh=typeof setTimeout=="function"?setTimeout:void 0,Bx=typeof clearTimeout=="function"?clearTimeout:void 0,ph=typeof Promise=="function"?Promise:void 0,Lx=typeof queueMicrotask=="function"?queueMicrotask:typeof ph<"u"?function(e){return ph.resolve(null).then(e).catch(Hx)}:hh;function Hx(e){setTimeout(function(){throw e})}function un(e){return e==="head"}function mh(e,t){var a=t,n=0;do{var s=a.nextSibling;if(e.removeChild(a),s&&s.nodeType===8)if(a=s.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(s),Nl(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")mi(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,mi(a);for(var o=a.firstChild;o;){var w=o.nextSibling,D=o.nodeName;o[jn]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&o.rel.toLowerCase()==="stylesheet"||a.removeChild(o),o=w}}else a==="body"&&mi(e.ownerDocument.body);a=s}while(a);Nl(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 dc(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":dc(a),de(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Yx(e,t,a,n){for(;e.nodeType===1;){var s=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[jn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(o=e.getAttribute("rel"),o==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(o!==s.rel||e.getAttribute("href")!==(s.href==null||s.href===""?null:s.href)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin)||e.getAttribute("title")!==(s.title==null?null:s.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(o=e.getAttribute("src"),(o!==(s.src==null?null:s.src)||e.getAttribute("type")!==(s.type==null?null:s.type)||e.getAttribute("crossorigin")!==(s.crossOrigin==null?null:s.crossOrigin))&&o&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var o=s.name==null?null:""+s.name;if(s.type==="hidden"&&e.getAttribute("name")===o)return e}else return e;if(e=ua(e.nextSibling),e===null)break}return null}function qx(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=ua(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=ua(e.nextSibling),e===null))return null;return e}function fc(e){return e.data==="$?"||e.data==="$~"}function hc(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Kx(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 ua(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 pc=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 ua(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=Rs(a),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function mi(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);de(e)}var da=new Map,wh=new Set;function Os(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Ia=Q.d;Q.d={f:Ix,r:Gx,D:Vx,C:Xx,L:Zx,m:$x,X:Fx,S:Qx,M:Jx};function Ix(){var e=Ia.f(),t=Ss();return e||t}function Gx(e){var t=_e(e);t!==null&&t.tag===5&&t.type==="form"?Bd(t):Ia.r(e)}var wl=typeof document>"u"?null:document;function jh(e,t,a){var n=wl;if(n&&typeof t=="string"&&t){var s=na(t);s='link[rel="'+e+'"][href="'+s+'"]',typeof a=="string"&&(s+='[crossorigin="'+a+'"]'),wh.has(s)||(wh.add(s),e={rel:e,crossOrigin:a,href:t},n.querySelector(s)===null&&(t=n.createElement("link"),Ut(t,"link",e),at(t),n.head.appendChild(t)))}}function Vx(e){Ia.D(e),jh("dns-prefetch",e,null)}function Xx(e,t){Ia.C(e,t),jh("preconnect",e,t)}function Zx(e,t,a){Ia.L(e,t,a);var n=wl;if(n&&e&&t){var s='link[rel="preload"][as="'+na(t)+'"]';t==="image"&&a&&a.imageSrcSet?(s+='[imagesrcset="'+na(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(s+='[imagesizes="'+na(a.imageSizes)+'"]')):s+='[href="'+na(e)+'"]';var o=s;switch(t){case"style":o=jl(e);break;case"script":o=Sl(e)}da.has(o)||(e=j({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),da.set(o,e),n.querySelector(s)!==null||t==="style"&&n.querySelector(xi(o))||t==="script"&&n.querySelector(gi(o))||(t=n.createElement("link"),Ut(t,"link",e),at(t),n.head.appendChild(t)))}}function $x(e,t){Ia.m(e,t);var a=wl;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",s='link[rel="modulepreload"][as="'+na(n)+'"][href="'+na(e)+'"]',o=s;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":o=Sl(e)}if(!da.has(o)&&(e=j({rel:"modulepreload",href:e},t),da.set(o,e),a.querySelector(s)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(gi(o)))return}n=a.createElement("link"),Ut(n,"link",e),at(n),a.head.appendChild(n)}}}function Qx(e,t,a){Ia.S(e,t,a);var n=wl;if(n&&e){var s=Qe(n).hoistableStyles,o=jl(e);t=t||"default";var w=s.get(o);if(!w){var D={loading:0,preload:null};if(w=n.querySelector(xi(o)))D.loading=5;else{e=j({rel:"stylesheet",href:e,"data-precedence":t},a),(a=da.get(o))&&mc(e,a);var G=w=n.createElement("link");at(G),Ut(G,"link",e),G._p=new Promise(function(le,ge){G.onload=le,G.onerror=ge}),G.addEventListener("load",function(){D.loading|=1}),G.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Ds(w,t,n)}w={type:"stylesheet",instance:w,count:1,state:D},s.set(o,w)}}}function Fx(e,t){Ia.X(e,t);var a=wl;if(a&&e){var n=Qe(a).hoistableScripts,s=Sl(e),o=n.get(s);o||(o=a.querySelector(gi(s)),o||(e=j({src:e,async:!0},t),(t=da.get(s))&&xc(e,t),o=a.createElement("script"),at(o),Ut(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(s,o))}}function Jx(e,t){Ia.M(e,t);var a=wl;if(a&&e){var n=Qe(a).hoistableScripts,s=Sl(e),o=n.get(s);o||(o=a.querySelector(gi(s)),o||(e=j({src:e,async:!0,type:"module"},t),(t=da.get(s))&&xc(e,t),o=a.createElement("script"),at(o),Ut(o,"link",e),a.head.appendChild(o)),o={type:"script",instance:o,count:1,state:null},n.set(s,o))}}function Sh(e,t,a,n){var s=(s=ie.current)?Os(s):null;if(!s)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=jl(a.href),a=Qe(s).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=jl(a.href);var o=Qe(s).hoistableStyles,w=o.get(e);if(w||(s=s.ownerDocument||s,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},o.set(e,w),(o=s.querySelector(xi(e)))&&!o._p&&(w.instance=o,w.state.loading=5),da.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},da.set(e,a),o||Px(s,e,a,w.state))),t&&n===null)throw Error(u(528,""));return w}if(t&&n!==null)throw Error(u(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Sl(a),a=Qe(s).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(u(444,e))}}function jl(e){return'href="'+na(e)+'"'}function xi(e){return'link[rel="stylesheet"]['+e+"]"}function Nh(e){return j({},e,{"data-precedence":e.precedence,precedence:null})}function Px(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}),Ut(t,"link",a),at(t),e.head.appendChild(t))}function Sl(e){return'[src="'+na(e)+'"]'}function gi(e){return"script[async]"+e}function _h(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+na(a.href)+'"]');if(n)return t.instance=n,at(n),n;var s=j({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),at(n),Ut(n,"style",s),Ds(n,a.precedence,e),t.instance=n;case"stylesheet":s=jl(a.href);var o=e.querySelector(xi(s));if(o)return t.state.loading|=4,t.instance=o,at(o),o;n=Nh(a),(s=da.get(s))&&mc(n,s),o=(e.ownerDocument||e).createElement("link"),at(o);var w=o;return w._p=new Promise(function(D,G){w.onload=D,w.onerror=G}),Ut(o,"link",n),t.state.loading|=4,Ds(o,a.precedence,e),t.instance=o;case"script":return o=Sl(a.src),(s=e.querySelector(gi(o)))?(t.instance=s,at(s),s):(n=a,(s=da.get(o))&&(n=j({},a),xc(n,s)),e=e.ownerDocument||e,s=e.createElement("script"),at(s),Ut(s,"link",n),e.head.appendChild(s),t.instance=s);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,Ds(n,a.precedence,e));return t.instance}function Ds(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),s=n.length?n[n.length-1]:null,o=s,w=0;w<n.length;w++){var D=n[w];if(D.dataset.precedence===t)o=D;else if(o!==s)break}o?o.parentNode.insertBefore(e,o.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function mc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function xc(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Ts=null;function Ch(e,t,a){if(Ts===null){var n=new Map,s=Ts=new Map;s.set(a,n)}else s=Ts,n=s.get(a),n||(n=new Map,s.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),s=0;s<a.length;s++){var o=a[s];if(!(o[jn]||o[Rt]||e==="link"&&o.getAttribute("rel")==="stylesheet")&&o.namespaceURI!=="http://www.w3.org/2000/svg"){var w=o.getAttribute(t)||"";w=e+w;var D=n.get(w);D?D.push(o):n.set(w,[o])}}return n}function kh(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Wx(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 Eh(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function e0(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 s=jl(n.href),o=t.querySelector(xi(s));if(o){t=o._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Ms.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=o,at(o);return}o=t.ownerDocument||t,n=Nh(n),(s=da.get(s))&&mc(n,s),o=o.createElement("link"),at(o);var w=o;w._p=new Promise(function(D,G){w.onload=D,w.onerror=G}),Ut(o,"link",n),a.instance=o}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Ms.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var gc=0;function t0(e,t){return e.stylesheets&&e.count===0&&Bs(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend){var o=e.unsuspend;e.unsuspend=null,o()}},6e4+t);0<e.imgBytes&&gc===0&&(gc=62500*Mx());var s=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Bs(e,e.stylesheets),e.unsuspend)){var o=e.unsuspend;e.unsuspend=null,o()}},(e.imgBytes>gc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(s)}}:null}function Ms(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Bs(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Us=null;function Bs(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Us=new Map,t.forEach(a0,e),Us=null,Ms.call(e))}function a0(e,t){if(!(t.state.loading&4)){var a=Us.get(e);if(a)var n=a.get(null);else{a=new Map,Us.set(e,a);for(var s=e.querySelectorAll("link[data-precedence],style[data-precedence]"),o=0;o<s.length;o++){var w=s[o];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(a.set(w.dataset.precedence,w),n=w)}n&&a.set(null,n)}s=t.instance,w=s.getAttribute("data-precedence"),o=a.get(w)||n,o===n&&a.set(null,s),a.set(w,s),this.count++,n=Ms.bind(this),s.addEventListener("load",n),s.addEventListener("error",n),o?o.parentNode.insertBefore(s,o.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(s,e.firstChild)),t.state.loading|=4}}var bi={$$typeof:k,Provider:null,Consumer:null,_currentValue:Ne,_currentValue2:Ne,_threadCount:0};function n0(e,t,a,n,s,o,w,D,G){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=zl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=zl(0),this.hiddenUpdates=zl(null),this.identifierPrefix=n,this.onUncaughtError=s,this.onCaughtError=o,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=G,this.incompleteTransitions=new Map}function Ah(e,t,a,n,s,o,w,D,G,le,ge,Se){return e=new n0(e,t,a,w,G,le,ge,Se,D),t=1,o===!0&&(t|=24),o=Qt(3,null,null,t),e.current=o,o.stateNode=e,t=Qr(),t.refCount++,e.pooledCache=t,t.refCount++,o.memoizedState={element:n,isDehydrated:a,cache:t},Wr(o),e}function zh(e){return e?(e=el,e):el}function Rh(e,t,a,n,s,o){s=zh(s),n.context===null?n.context=s:n.pendingContext=s,n=Pa(t),n.payload={element:a},o=o===void 0?null:o,o!==null&&(n.callback=o),a=Wa(e,n,t),a!==null&&(Zt(a,e,t),Fl(a,e,t))}function Oh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function bc(e,t){Oh(e,t),(e=e.alternate)&&Oh(e,t)}function Dh(e){if(e.tag===13||e.tag===31){var t=kn(e,67108864);t!==null&&Zt(t,e,67108864),bc(e,67108864)}}function Th(e){if(e.tag===13||e.tag===31){var t=ea();t=vn(t);var a=kn(e,t);a!==null&&Zt(a,e,t),bc(e,t)}}var Ls=!0;function l0(e,t,a,n){var s=X.T;X.T=null;var o=Q.p;try{Q.p=2,yc(e,t,a,n)}finally{Q.p=o,X.T=s}}function i0(e,t,a,n){var s=X.T;X.T=null;var o=Q.p;try{Q.p=8,yc(e,t,a,n)}finally{Q.p=o,X.T=s}}function yc(e,t,a,n){if(Ls){var s=vc(n);if(s===null)ic(e,t,n,Hs,a),Uh(e,n);else if(r0(s,e,t,a,n))n.stopPropagation();else if(Uh(e,n),t&4&&-1<s0.indexOf(e)){for(;s!==null;){var o=_e(s);if(o!==null)switch(o.tag){case 3:if(o=o.stateNode,o.current.memoizedState.isDehydrated){var w=qt(o.pendingLanes);if(w!==0){var D=o;for(D.pendingLanes|=2,D.entangledLanes|=2;w;){var G=1<<31-Te(w);D.entanglements[1]|=G,w&=~G}wa(o),(st&6)===0&&(ws=Ce()+500,fi(0))}}break;case 31:case 13:D=kn(o,2),D!==null&&Zt(D,o,2),Ss(),bc(o,2)}if(o=vc(n),o===null&&ic(e,t,n,Hs,a),o===s)break;s=o}s!==null&&n.stopPropagation()}else ic(e,t,n,null,a)}}function vc(e){return e=wr(e),wc(e)}var Hs=null;function wc(e){if(Hs=null,e=pe(e),e!==null){var t=d(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=h(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 Hs=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(je()){case Oe:return 2;case Ve:return 8;case He:case it:return 32;case be:return 268435456;default:return 32}default:return 32}}var jc=!1,dn=null,fn=null,hn=null,yi=new Map,vi=new Map,pn=[],s0="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":fn=null;break;case"mouseover":case"mouseout":hn=null;break;case"pointerover":case"pointerout":yi.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vi.delete(t.pointerId)}}function wi(e,t,a,n,s,o){return e===null||e.nativeEvent!==o?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:o,targetContainers:[s]},t!==null&&(t=_e(t),t!==null&&Dh(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,s!==null&&t.indexOf(s)===-1&&t.push(s),e)}function r0(e,t,a,n,s){switch(t){case"focusin":return dn=wi(dn,e,t,a,n,s),!0;case"dragenter":return fn=wi(fn,e,t,a,n,s),!0;case"mouseover":return hn=wi(hn,e,t,a,n,s),!0;case"pointerover":var o=s.pointerId;return yi.set(o,wi(yi.get(o)||null,e,t,a,n,s)),!0;case"gotpointercapture":return o=s.pointerId,vi.set(o,wi(vi.get(o)||null,e,t,a,n,s)),!0}return!1}function Bh(e){var t=pe(e.target);if(t!==null){var a=d(t);if(a!==null){if(t=a.tag,t===13){if(t=h(a),t!==null){e.blockedOn=t,Oi(e.priority,function(){Th(a)});return}}else if(t===31){if(t=p(a),t!==null){e.blockedOn=t,Oi(e.priority,function(){Th(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 Ys(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=vc(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);vr=n,a.target.dispatchEvent(n),vr=null}else return t=_e(a),t!==null&&Dh(t),e.blockedOn=a,!1;t.shift()}return!0}function Lh(e,t,a){Ys(e)&&a.delete(t)}function o0(){jc=!1,dn!==null&&Ys(dn)&&(dn=null),fn!==null&&Ys(fn)&&(fn=null),hn!==null&&Ys(hn)&&(hn=null),yi.forEach(Lh),vi.forEach(Lh)}function qs(e,t){e.blockedOn===t&&(e.blockedOn=null,jc||(jc=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,o0)))}var Ks=null;function Hh(e){Ks!==e&&(Ks=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){Ks===e&&(Ks=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],s=e[t+2];if(typeof n!="function"){if(wc(n||a)===null)continue;break}var o=_e(a);o!==null&&(e.splice(t,3),t-=3,vo(o,{pending:!0,data:s,method:a.method,action:n},n,s))}}))}function Nl(e){function t(G){return qs(G,e)}dn!==null&&qs(dn,e),fn!==null&&qs(fn,e),hn!==null&&qs(hn,e),yi.forEach(t),vi.forEach(t);for(var a=0;a<pn.length;a++){var n=pn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<pn.length&&(a=pn[0],a.blockedOn===null);)Bh(a),a.blockedOn===null&&pn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var s=a[n],o=a[n+1],w=s[Lt]||null;if(typeof o=="function")w||Hh(a);else if(w){var D=null;if(o&&o.hasAttribute("formAction")){if(s=o,w=o[Lt]||null)D=w.formAction;else if(wc(s)!==null)continue}else D=w.action;typeof D=="function"?a[n+1]=D:(a.splice(n,3),n-=3),Hh(a)}}}function Yh(){function e(o){o.canIntercept&&o.info==="react-transition"&&o.intercept({handler:function(){return new Promise(function(w){return s=w})},focusReset:"manual",scroll:"manual"})}function t(){s!==null&&(s(),s=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var o=navigation.currentEntry;o&&o.url!=null&&navigation.navigate(o.url,{state:o.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,s=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),s!==null&&(s(),s=null)}}}function Sc(e){this._internalRoot=e}Is.prototype.render=Sc.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var a=t.current,n=ea();Rh(a,n,e,t,null,null)},Is.prototype.unmount=Sc.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Rh(e.current,2,null,e,null,null),Ss(),t[wn]=null}};function Is(e){this._internalRoot=e}Is.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ri();e={blockedOn:null,target:e,priority:t};for(var a=0;a<pn.length&&t!==0&&t<pn[a].priority;a++);pn.splice(a,0,e),a===0&&Bh(e)}};var qh=c.version;if(qh!=="19.2.3")throw Error(u(527,qh,"19.2.3"));Q.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=g(t),e=e!==null?C(e):null,e=e===null?null:e.stateNode,e};var c0={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Gs=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Gs.isDisabled&&Gs.supportsFiber)try{Me=Gs.inject(c0),Be=Gs}catch{}}return Si.createRoot=function(e,t){if(!f(e))throw Error(u(299));var a=!1,n="",s=Zd,o=$d,w=Qd;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(s=t.onUncaughtError),t.onCaughtError!==void 0&&(o=t.onCaughtError),t.onRecoverableError!==void 0&&(w=t.onRecoverableError)),t=Ah(e,1,!1,null,null,a,n,null,s,o,w,Yh),e[wn]=t.current,lc(e),new Sc(t)},Si.hydrateRoot=function(e,t,a){if(!f(e))throw Error(u(299));var n=!1,s="",o=Zd,w=$d,D=Qd,G=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(s=a.identifierPrefix),a.onUncaughtError!==void 0&&(o=a.onUncaughtError),a.onCaughtError!==void 0&&(w=a.onCaughtError),a.onRecoverableError!==void 0&&(D=a.onRecoverableError),a.formState!==void 0&&(G=a.formState)),t=Ah(e,1,!0,t,a??null,n,s,G,o,w,D,Yh),t.context=zh(null),a=t.current,n=ea(),n=vn(n),s=Pa(n),s.callback=null,Wa(a,s,n),a=n,t.current.lanes=a,yn(t,a),wa(t),e[wn]=t.current,lc(e),new Is(t)},Si.version="19.2.3",Si}var Jh;function b0(){if(Jh)return Cc.exports;Jh=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(c){console.error(c)}}return i(),Cc.exports=g0(),Cc.exports}var y0=b0();const v0=Vc(y0);var Ph="popstate";function w0(i={}){function c(u,f){let{pathname:d,search:h,hash:p}=u.location;return Hc("",{pathname:d,search:h,hash:p},f.state&&f.state.usr||null,f.state&&f.state.key||"default")}function r(u,f){return typeof f=="string"?f:Ci(f)}return S0(c,r,null,i)}function yt(i,c){if(i===!1||i===null||typeof i>"u")throw new Error(c)}function Sa(i,c){if(!i){typeof console<"u"&&console.warn(c);try{throw new Error(c)}catch{}}}function j0(){return Math.random().toString(36).substring(2,10)}function Wh(i,c){return{usr:i.state,key:i.key,idx:c}}function Hc(i,c,r=null,u){return{pathname:typeof i=="string"?i:i.pathname,search:"",hash:"",...typeof c=="string"?El(c):c,state:r,key:c&&c.key||u||j0()}}function Ci({pathname:i="/",search:c="",hash:r=""}){return c&&c!=="?"&&(i+=c.charAt(0)==="?"?c:"?"+c),r&&r!=="#"&&(i+=r.charAt(0)==="#"?r:"#"+r),i}function El(i){let c={};if(i){let r=i.indexOf("#");r>=0&&(c.hash=i.substring(r),i=i.substring(0,r));let u=i.indexOf("?");u>=0&&(c.search=i.substring(u),i=i.substring(0,u)),i&&(c.pathname=i)}return c}function S0(i,c,r,u={}){let{window:f=document.defaultView,v5Compat:d=!1}=u,h=f.history,p="POP",x=null,g=C();g==null&&(g=0,h.replaceState({...h.state,idx:g},""));function C(){return(h.state||{idx:null}).idx}function j(){p="POP";let b=C(),S=b==null?null:b-g;g=b,x&&x({action:p,location:m.location,delta:S})}function E(b,S){p="PUSH";let y=Hc(m.location,b,S);g=C()+1;let k=Wh(y,g),U=m.createHref(y);try{h.pushState(k,"",U)}catch(O){if(O instanceof DOMException&&O.name==="DataCloneError")throw O;f.location.assign(U)}d&&x&&x({action:p,location:m.location,delta:1})}function v(b,S){p="REPLACE";let y=Hc(m.location,b,S);g=C();let k=Wh(y,g),U=m.createHref(y);h.replaceState(k,"",U),d&&x&&x({action:p,location:m.location,delta:0})}function _(b){return N0(b)}let m={get action(){return p},get location(){return i(f,h)},listen(b){if(x)throw new Error("A history only accepts one active listener");return f.addEventListener(Ph,j),x=b,()=>{f.removeEventListener(Ph,j),x=null}},createHref(b){return c(f,b)},createURL:_,encodeLocation(b){let S=_(b);return{pathname:S.pathname,search:S.search,hash:S.hash}},push:E,replace:v,go(b){return h.go(b)}};return m}function N0(i,c=!1){let r="http://localhost";typeof window<"u"&&(r=window.location.origin!=="null"?window.location.origin:window.location.href),yt(r,"No window.location.(origin|href) available to create URL");let u=typeof i=="string"?i:Ci(i);return u=u.replace(/ $/,"%20"),!c&&u.startsWith("//")&&(u=r+u),new URL(u,r)}function _p(i,c,r="/"){return _0(i,c,r,!1)}function _0(i,c,r,u){let f=typeof c=="string"?El(c):c,d=Va(f.pathname||"/",r);if(d==null)return null;let h=Cp(i);C0(h);let p=null;for(let x=0;p==null&&x<h.length;++x){let g=B0(d);p=M0(h[x],g,u)}return p}function Cp(i,c=[],r=[],u="",f=!1){let d=(h,p,x=f,g)=>{let C={relativePath:g===void 0?h.path||"":g,caseSensitive:h.caseSensitive===!0,childrenIndex:p,route:h};if(C.relativePath.startsWith("/")){if(!C.relativePath.startsWith(u)&&x)return;yt(C.relativePath.startsWith(u),`Absolute route path "${C.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),C.relativePath=C.relativePath.slice(u.length)}let j=Ga([u,C.relativePath]),E=r.concat(C);h.children&&h.children.length>0&&(yt(h.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${j}".`),Cp(h.children,c,E,j,x)),!(h.path==null&&!h.index)&&c.push({path:j,score:D0(j,h.index),routesMeta:E})};return i.forEach((h,p)=>{if(h.path===""||!h.path?.includes("?"))d(h,p);else for(let x of kp(h.path))d(h,p,!0,x)}),c}function kp(i){let c=i.split("/");if(c.length===0)return[];let[r,...u]=c,f=r.endsWith("?"),d=r.replace(/\?$/,"");if(u.length===0)return f?[d,""]:[d];let h=kp(u.join("/")),p=[];return p.push(...h.map(x=>x===""?d:[d,x].join("/"))),f&&p.push(...h),p.map(x=>i.startsWith("/")&&x===""?"/":x)}function C0(i){i.sort((c,r)=>c.score!==r.score?r.score-c.score:T0(c.routesMeta.map(u=>u.childrenIndex),r.routesMeta.map(u=>u.childrenIndex)))}var k0=/^:[\w-]+$/,E0=3,A0=2,z0=1,R0=10,O0=-2,ep=i=>i==="*";function D0(i,c){let r=i.split("/"),u=r.length;return r.some(ep)&&(u+=O0),c&&(u+=A0),r.filter(f=>!ep(f)).reduce((f,d)=>f+(k0.test(d)?E0:d===""?z0:R0),u)}function T0(i,c){return i.length===c.length&&i.slice(0,-1).every((u,f)=>u===c[f])?i[i.length-1]-c[c.length-1]:0}function M0(i,c,r=!1){let{routesMeta:u}=i,f={},d="/",h=[];for(let p=0;p<u.length;++p){let x=u[p],g=p===u.length-1,C=d==="/"?c:c.slice(d.length)||"/",j=lr({path:x.relativePath,caseSensitive:x.caseSensitive,end:g},C),E=x.route;if(!j&&g&&r&&!u[u.length-1].route.index&&(j=lr({path:x.relativePath,caseSensitive:x.caseSensitive,end:!1},C)),!j)return null;Object.assign(f,j.params),h.push({params:f,pathname:Ga([d,j.pathname]),pathnameBase:q0(Ga([d,j.pathnameBase])),route:E}),j.pathnameBase!=="/"&&(d=Ga([d,j.pathnameBase]))}return h}function lr(i,c){typeof i=="string"&&(i={path:i,caseSensitive:!1,end:!0});let[r,u]=U0(i.path,i.caseSensitive,i.end),f=c.match(r);if(!f)return null;let d=f[0],h=d.replace(/(.)\/+$/,"$1"),p=f.slice(1);return{params:u.reduce((g,{paramName:C,isOptional:j},E)=>{if(C==="*"){let _=p[E]||"";h=d.slice(0,d.length-_.length).replace(/(.)\/+$/,"$1")}const v=p[E];return j&&!v?g[C]=void 0:g[C]=(v||"").replace(/%2F/g,"/"),g},{}),pathname:d,pathnameBase:h,pattern:i}}function U0(i,c=!1,r=!0){Sa(i==="*"||!i.endsWith("*")||i.endsWith("/*"),`Route path "${i}" will be treated as if it were "${i.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${i.replace(/\*$/,"/*")}".`);let u=[],f="^"+i.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,p,x)=>(u.push({paramName:p,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return i.endsWith("*")?(u.push({paramName:"*"}),f+=i==="*"||i==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?f+="\\/*$":i!==""&&i!=="/"&&(f+="(?:(?=\\/|$))"),[new RegExp(f,c?void 0:"i"),u]}function B0(i){try{return i.split("/").map(c=>decodeURIComponent(c).replace(/\//g,"%2F")).join("/")}catch(c){return Sa(!1,`The URL path "${i}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${c}).`),i}}function Va(i,c){if(c==="/")return i;if(!i.toLowerCase().startsWith(c.toLowerCase()))return null;let r=c.endsWith("/")?c.length-1:c.length,u=i.charAt(r);return u&&u!=="/"?null:i.slice(r)||"/"}var L0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function H0(i,c="/"){let{pathname:r,search:u="",hash:f=""}=typeof i=="string"?El(i):i,d;return r?(r=r.replace(/\/\/+/g,"/"),r.startsWith("/")?d=tp(r.substring(1),"/"):d=tp(r,c)):d=c,{pathname:d,search:K0(u),hash:I0(f)}}function tp(i,c){let r=c.replace(/\/+$/,"").split("/");return i.split("/").forEach(f=>{f===".."?r.length>1&&r.pop():f!=="."&&r.push(f)}),r.length>1?r.join("/"):"/"}function zc(i,c,r,u){return`Cannot include a '${i}' character in a manually specified \`to.${c}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${r}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Y0(i){return i.filter((c,r)=>r===0||c.route.path&&c.route.path.length>0)}function Ep(i){let c=Y0(i);return c.map((r,u)=>u===c.length-1?r.pathname:r.pathnameBase)}function Ap(i,c,r,u=!1){let f;typeof i=="string"?f=El(i):(f={...i},yt(!f.pathname||!f.pathname.includes("?"),zc("?","pathname","search",f)),yt(!f.pathname||!f.pathname.includes("#"),zc("#","pathname","hash",f)),yt(!f.search||!f.search.includes("#"),zc("#","search","hash",f)));let d=i===""||f.pathname==="",h=d?"/":f.pathname,p;if(h==null)p=r;else{let j=c.length-1;if(!u&&h.startsWith("..")){let E=h.split("/");for(;E[0]==="..";)E.shift(),j-=1;f.pathname=E.join("/")}p=j>=0?c[j]:"/"}let x=H0(f,p),g=h&&h!=="/"&&h.endsWith("/"),C=(d||h===".")&&r.endsWith("/");return!x.pathname.endsWith("/")&&(g||C)&&(x.pathname+="/"),x}var Ga=i=>i.join("/").replace(/\/\/+/g,"/"),q0=i=>i.replace(/\/+$/,"").replace(/^\/*/,"/"),K0=i=>!i||i==="?"?"":i.startsWith("?")?i:"?"+i,I0=i=>!i||i==="#"?"":i.startsWith("#")?i:"#"+i,G0=class{constructor(i,c,r,u=!1){this.status=i,this.statusText=c||"",this.internal=u,r instanceof Error?(this.data=r.toString(),this.error=r):this.data=r}};function V0(i){return i!=null&&typeof i.status=="number"&&typeof i.statusText=="string"&&typeof i.internal=="boolean"&&"data"in i}function X0(i){return i.map(c=>c.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var zp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Rp(i,c){let r=i;if(typeof r!="string"||!L0.test(r))return{absoluteURL:void 0,isExternal:!1,to:r};let u=r,f=!1;if(zp)try{let d=new URL(window.location.href),h=r.startsWith("//")?new URL(d.protocol+r):new URL(r),p=Va(h.pathname,c);h.origin===d.origin&&p!=null?r=p+h.search+h.hash:f=!0}catch{Sa(!1,`<Link to="${r}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:f,to:r}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Op=["POST","PUT","PATCH","DELETE"];new Set(Op);var Z0=["GET",...Op];new Set(Z0);var Al=A.createContext(null);Al.displayName="DataRouter";var or=A.createContext(null);or.displayName="DataRouterState";var $0=A.createContext(!1),Dp=A.createContext({isTransitioning:!1});Dp.displayName="ViewTransition";var Q0=A.createContext(new Map);Q0.displayName="Fetchers";var F0=A.createContext(null);F0.displayName="Await";var fa=A.createContext(null);fa.displayName="Navigation";var ki=A.createContext(null);ki.displayName="Location";var Na=A.createContext({outlet:null,matches:[],isDataRoute:!1});Na.displayName="Route";var Zc=A.createContext(null);Zc.displayName="RouteError";var Tp="REACT_ROUTER_ERROR",J0="REDIRECT",P0="ROUTE_ERROR_RESPONSE";function W0(i){if(i.startsWith(`${Tp}:${J0}:{`))try{let c=JSON.parse(i.slice(28));if(typeof c=="object"&&c&&typeof c.status=="number"&&typeof c.statusText=="string"&&typeof c.location=="string"&&typeof c.reloadDocument=="boolean"&&typeof c.replace=="boolean")return c}catch{}}function eg(i){if(i.startsWith(`${Tp}:${P0}:{`))try{let c=JSON.parse(i.slice(40));if(typeof c=="object"&&c&&typeof c.status=="number"&&typeof c.statusText=="string")return new G0(c.status,c.statusText,c.data)}catch{}}function tg(i,{relative:c}={}){yt(Ei(),"useHref() may be used only in the context of a <Router> component.");let{basename:r,navigator:u}=A.useContext(fa),{hash:f,pathname:d,search:h}=Ai(i,{relative:c}),p=d;return r!=="/"&&(p=d==="/"?r:Ga([r,d])),u.createHref({pathname:p,search:h,hash:f})}function Ei(){return A.useContext(ki)!=null}function gn(){return yt(Ei(),"useLocation() may be used only in the context of a <Router> component."),A.useContext(ki).location}var Mp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Up(i){A.useContext(fa).static||A.useLayoutEffect(i)}function qn(){let{isDataRoute:i}=A.useContext(Na);return i?pg():ag()}function ag(){yt(Ei(),"useNavigate() may be used only in the context of a <Router> component.");let i=A.useContext(Al),{basename:c,navigator:r}=A.useContext(fa),{matches:u}=A.useContext(Na),{pathname:f}=gn(),d=JSON.stringify(Ep(u)),h=A.useRef(!1);return Up(()=>{h.current=!0}),A.useCallback((x,g={})=>{if(Sa(h.current,Mp),!h.current)return;if(typeof x=="number"){r.go(x);return}let C=Ap(x,JSON.parse(d),f,g.relative==="path");i==null&&c!=="/"&&(C.pathname=C.pathname==="/"?c:Ga([c,C.pathname])),(g.replace?r.replace:r.push)(C,g.state,g)},[c,r,d,f,i])}A.createContext(null);function Bp(){let{matches:i}=A.useContext(Na),c=i[i.length-1];return c?c.params:{}}function Ai(i,{relative:c}={}){let{matches:r}=A.useContext(Na),{pathname:u}=gn(),f=JSON.stringify(Ep(r));return A.useMemo(()=>Ap(i,JSON.parse(f),u,c==="path"),[i,f,u,c])}function ng(i,c){return Lp(i,c)}function Lp(i,c,r,u,f){yt(Ei(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:d}=A.useContext(fa),{matches:h}=A.useContext(Na),p=h[h.length-1],x=p?p.params:{},g=p?p.pathname:"/",C=p?p.pathnameBase:"/",j=p&&p.route;{let y=j&&j.path||"";Yp(g,!j||y.endsWith("*")||y.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${y}">) 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="${y}"> to <Route path="${y==="/"?"*":`${y}/*`}">.`)}let E=gn(),v;if(c){let y=typeof c=="string"?El(c):c;yt(C==="/"||y.pathname?.startsWith(C),`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 "${C}" but pathname "${y.pathname}" was given in the \`location\` prop.`),v=y}else v=E;let _=v.pathname||"/",m=_;if(C!=="/"){let y=C.replace(/^\//,"").split("/");m="/"+_.replace(/^\//,"").split("/").slice(y.length).join("/")}let b=_p(i,{pathname:m});Sa(j||b!=null,`No routes matched location "${v.pathname}${v.search}${v.hash}" `),Sa(b==null||b[b.length-1].route.element!==void 0||b[b.length-1].route.Component!==void 0||b[b.length-1].route.lazy!==void 0,`Matched leaf route at location "${v.pathname}${v.search}${v.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=og(b&&b.map(y=>Object.assign({},y,{params:Object.assign({},x,y.params),pathname:Ga([C,d.encodeLocation?d.encodeLocation(y.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathname]),pathnameBase:y.pathnameBase==="/"?C:Ga([C,d.encodeLocation?d.encodeLocation(y.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:y.pathnameBase])})),h,r,u,f);return c&&S?A.createElement(ki.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...v},navigationType:"POP"}},S):S}function lg(){let i=hg(),c=V0(i)?`${i.status} ${i.statusText}`:i instanceof Error?i.message:JSON.stringify(i),r=i instanceof Error?i.stack:null,u="rgba(200,200,200, 0.5)",f={padding:"0.5rem",backgroundColor:u},d={padding:"2px 4px",backgroundColor:u},h=null;return console.error("Error handled by React Router default ErrorBoundary:",i),h=A.createElement(A.Fragment,null,A.createElement("p",null,"💿 Hey developer 👋"),A.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",A.createElement("code",{style:d},"ErrorBoundary")," or"," ",A.createElement("code",{style:d},"errorElement")," prop on your route.")),A.createElement(A.Fragment,null,A.createElement("h2",null,"Unexpected Application Error!"),A.createElement("h3",{style:{fontStyle:"italic"}},c),r?A.createElement("pre",{style:f},r):null,h)}var ig=A.createElement(lg,null),Hp=class extends A.Component{constructor(i){super(i),this.state={location:i.location,revalidation:i.revalidation,error:i.error}}static getDerivedStateFromError(i){return{error:i}}static getDerivedStateFromProps(i,c){return c.location!==i.location||c.revalidation!=="idle"&&i.revalidation==="idle"?{error:i.error,location:i.location,revalidation:i.revalidation}:{error:i.error!==void 0?i.error:c.error,location:c.location,revalidation:i.revalidation||c.revalidation}}componentDidCatch(i,c){this.props.onError?this.props.onError(i,c):console.error("React Router caught the following error during render",i)}render(){let i=this.state.error;if(this.context&&typeof i=="object"&&i&&"digest"in i&&typeof i.digest=="string"){const r=eg(i.digest);r&&(i=r)}let c=i!==void 0?A.createElement(Na.Provider,{value:this.props.routeContext},A.createElement(Zc.Provider,{value:i,children:this.props.component})):this.props.children;return this.context?A.createElement(sg,{error:i},c):c}};Hp.contextType=$0;var Rc=new WeakMap;function sg({children:i,error:c}){let{basename:r}=A.useContext(fa);if(typeof c=="object"&&c&&"digest"in c&&typeof c.digest=="string"){let u=W0(c.digest);if(u){let f=Rc.get(c);if(f)throw f;let d=Rp(u.location,r);if(zp&&!Rc.get(c))if(d.isExternal||u.reloadDocument)window.location.href=d.absoluteURL||d.to;else{const h=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(d.to,{replace:u.replace}));throw Rc.set(c,h),h}return A.createElement("meta",{httpEquiv:"refresh",content:`0;url=${d.absoluteURL||d.to}`})}}return i}function rg({routeContext:i,match:c,children:r}){let u=A.useContext(Al);return u&&u.static&&u.staticContext&&(c.route.errorElement||c.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=c.route.id),A.createElement(Na.Provider,{value:i},r)}function og(i,c=[],r=null,u=null,f=null){if(i==null){if(!r)return null;if(r.errors)i=r.matches;else if(c.length===0&&!r.initialized&&r.matches.length>0)i=r.matches;else return null}let d=i,h=r?.errors;if(h!=null){let C=d.findIndex(j=>j.route.id&&h?.[j.route.id]!==void 0);yt(C>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),d=d.slice(0,Math.min(d.length,C+1))}let p=!1,x=-1;if(r)for(let C=0;C<d.length;C++){let j=d[C];if((j.route.HydrateFallback||j.route.hydrateFallbackElement)&&(x=C),j.route.id){let{loaderData:E,errors:v}=r,_=j.route.loader&&!E.hasOwnProperty(j.route.id)&&(!v||v[j.route.id]===void 0);if(j.route.lazy||_){p=!0,x>=0?d=d.slice(0,x+1):d=[d[0]];break}}}let g=r&&u?(C,j)=>{u(C,{location:r.location,params:r.matches?.[0]?.params??{},unstable_pattern:X0(r.matches),errorInfo:j})}:void 0;return d.reduceRight((C,j,E)=>{let v,_=!1,m=null,b=null;r&&(v=h&&j.route.id?h[j.route.id]:void 0,m=j.route.errorElement||ig,p&&(x<0&&E===0?(Yp("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,b=null):x===E&&(_=!0,b=j.route.hydrateFallbackElement||null)));let S=c.concat(d.slice(0,E+1)),y=()=>{let k;return v?k=m:_?k=b:j.route.Component?k=A.createElement(j.route.Component,null):j.route.element?k=j.route.element:k=C,A.createElement(rg,{match:j,routeContext:{outlet:C,matches:S,isDataRoute:r!=null},children:k})};return r&&(j.route.ErrorBoundary||j.route.errorElement||E===0)?A.createElement(Hp,{location:r.location,revalidation:r.revalidation,component:m,error:v,children:y(),routeContext:{outlet:null,matches:S,isDataRoute:!0},onError:g}):y()},null)}function $c(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function cg(i){let c=A.useContext(Al);return yt(c,$c(i)),c}function ug(i){let c=A.useContext(or);return yt(c,$c(i)),c}function dg(i){let c=A.useContext(Na);return yt(c,$c(i)),c}function Qc(i){let c=dg(i),r=c.matches[c.matches.length-1];return yt(r.route.id,`${i} can only be used on routes that contain a unique "id"`),r.route.id}function fg(){return Qc("useRouteId")}function hg(){let i=A.useContext(Zc),c=ug("useRouteError"),r=Qc("useRouteError");return i!==void 0?i:c.errors?.[r]}function pg(){let{router:i}=cg("useNavigate"),c=Qc("useNavigate"),r=A.useRef(!1);return Up(()=>{r.current=!0}),A.useCallback(async(f,d={})=>{Sa(r.current,Mp),r.current&&(typeof f=="number"?await i.navigate(f):await i.navigate(f,{fromRouteId:c,...d}))},[i,c])}var ap={};function Yp(i,c,r){!c&&!ap[i]&&(ap[i]=!0,Sa(!1,r))}A.memo(mg);function mg({routes:i,future:c,state:r,onError:u}){return Lp(i,void 0,r,u,c)}function ja(i){yt(!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 xg({basename:i="/",children:c=null,location:r,navigationType:u="POP",navigator:f,static:d=!1,unstable_useTransitions:h}){yt(!Ei(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let p=i.replace(/^\/*/,"/"),x=A.useMemo(()=>({basename:p,navigator:f,static:d,unstable_useTransitions:h,future:{}}),[p,f,d,h]);typeof r=="string"&&(r=El(r));let{pathname:g="/",search:C="",hash:j="",state:E=null,key:v="default"}=r,_=A.useMemo(()=>{let m=Va(g,p);return m==null?null:{location:{pathname:m,search:C,hash:j,state:E,key:v},navigationType:u}},[p,g,C,j,E,v,u]);return Sa(_!=null,`<Router basename="${p}"> is not able to match the URL "${g}${C}${j}" because it does not start with the basename, so the <Router> won't render anything.`),_==null?null:A.createElement(fa.Provider,{value:x},A.createElement(ki.Provider,{children:c,value:_}))}function gg({children:i,location:c}){return ng(Yc(i),c)}function Yc(i,c=[]){let r=[];return A.Children.forEach(i,(u,f)=>{if(!A.isValidElement(u))return;let d=[...c,f];if(u.type===A.Fragment){r.push.apply(r,Yc(u.props.children,d));return}yt(u.type===ja,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),yt(!u.props.index||!u.props.children,"An index route cannot have child routes.");let h={id:u.props.id||d.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(h.children=Yc(u.props.children,d)),r.push(h)}),r}var ar="get",nr="application/x-www-form-urlencoded";function cr(i){return typeof HTMLElement<"u"&&i instanceof HTMLElement}function bg(i){return cr(i)&&i.tagName.toLowerCase()==="button"}function yg(i){return cr(i)&&i.tagName.toLowerCase()==="form"}function vg(i){return cr(i)&&i.tagName.toLowerCase()==="input"}function wg(i){return!!(i.metaKey||i.altKey||i.ctrlKey||i.shiftKey)}function jg(i,c){return i.button===0&&(!c||c==="_self")&&!wg(i)}var Xs=null;function Sg(){if(Xs===null)try{new FormData(document.createElement("form"),0),Xs=!1}catch{Xs=!0}return Xs}var Ng=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Oc(i){return i!=null&&!Ng.has(i)?(Sa(!1,`"${i}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${nr}"`),null):i}function _g(i,c){let r,u,f,d,h;if(yg(i)){let p=i.getAttribute("action");u=p?Va(p,c):null,r=i.getAttribute("method")||ar,f=Oc(i.getAttribute("enctype"))||nr,d=new FormData(i)}else if(bg(i)||vg(i)&&(i.type==="submit"||i.type==="image")){let p=i.form;if(p==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let x=i.getAttribute("formaction")||p.getAttribute("action");if(u=x?Va(x,c):null,r=i.getAttribute("formmethod")||p.getAttribute("method")||ar,f=Oc(i.getAttribute("formenctype"))||Oc(p.getAttribute("enctype"))||nr,d=new FormData(p,i),!Sg()){let{name:g,type:C,value:j}=i;if(C==="image"){let E=g?`${g}.`:"";d.append(`${E}x`,"0"),d.append(`${E}y`,"0")}else g&&d.append(g,j)}}else{if(cr(i))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');r=ar,u=null,f=nr,h=i}return d&&f==="text/plain"&&(h=d,d=void 0),{action:u,method:r.toLowerCase(),encType:f,formData:d,body:h}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Fc(i,c){if(i===!1||i===null||typeof i>"u")throw new Error(c)}function Cg(i,c,r,u){let f=typeof i=="string"?new URL(i,typeof window>"u"?"server://singlefetch/":window.location.origin):i;return r?f.pathname.endsWith("/")?f.pathname=`${f.pathname}_.${u}`:f.pathname=`${f.pathname}.${u}`:f.pathname==="/"?f.pathname=`_root.${u}`:c&&Va(f.pathname,c)==="/"?f.pathname=`${c.replace(/\/$/,"")}/_root.${u}`:f.pathname=`${f.pathname.replace(/\/$/,"")}.${u}`,f}async function kg(i,c){if(i.id in c)return c[i.id];try{let r=await import(i.module);return c[i.id]=r,r}catch(r){return console.error(`Error loading route module \`${i.module}\`, reloading page...`),console.error(r),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function Eg(i){return i==null?!1:i.href==null?i.rel==="preload"&&typeof i.imageSrcSet=="string"&&typeof i.imageSizes=="string":typeof i.rel=="string"&&typeof i.href=="string"}async function Ag(i,c,r){let u=await Promise.all(i.map(async f=>{let d=c.routes[f.route.id];if(d){let h=await kg(d,r);return h.links?h.links():[]}return[]}));return Dg(u.flat(1).filter(Eg).filter(f=>f.rel==="stylesheet"||f.rel==="preload").map(f=>f.rel==="stylesheet"?{...f,rel:"prefetch",as:"style"}:{...f,rel:"prefetch"}))}function np(i,c,r,u,f,d){let h=(x,g)=>r[g]?x.route.id!==r[g].route.id:!0,p=(x,g)=>r[g].pathname!==x.pathname||r[g].route.path?.endsWith("*")&&r[g].params["*"]!==x.params["*"];return d==="assets"?c.filter((x,g)=>h(x,g)||p(x,g)):d==="data"?c.filter((x,g)=>{let C=u.routes[x.route.id];if(!C||!C.hasLoader)return!1;if(h(x,g)||p(x,g))return!0;if(x.route.shouldRevalidate){let j=x.route.shouldRevalidate({currentUrl:new URL(f.pathname+f.search+f.hash,window.origin),currentParams:r[0]?.params||{},nextUrl:new URL(i,window.origin),nextParams:x.params,defaultShouldRevalidate:!0});if(typeof j=="boolean")return j}return!0}):[]}function zg(i,c,{includeHydrateFallback:r}={}){return Rg(i.map(u=>{let f=c.routes[u.route.id];if(!f)return[];let d=[f.module];return f.clientActionModule&&(d=d.concat(f.clientActionModule)),f.clientLoaderModule&&(d=d.concat(f.clientLoaderModule)),r&&f.hydrateFallbackModule&&(d=d.concat(f.hydrateFallbackModule)),f.imports&&(d=d.concat(f.imports)),d}).flat(1))}function Rg(i){return[...new Set(i)]}function Og(i){let c={},r=Object.keys(i).sort();for(let u of r)c[u]=i[u];return c}function Dg(i,c){let r=new Set;return new Set(c),i.reduce((u,f)=>{let d=JSON.stringify(Og(f));return r.has(d)||(r.add(d),u.push({key:d,link:f})),u},[])}function qp(){let i=A.useContext(Al);return Fc(i,"You must render this element inside a <DataRouterContext.Provider> element"),i}function Tg(){let i=A.useContext(or);return Fc(i,"You must render this element inside a <DataRouterStateContext.Provider> element"),i}var Jc=A.createContext(void 0);Jc.displayName="FrameworkContext";function Kp(){let i=A.useContext(Jc);return Fc(i,"You must render this element inside a <HydratedRouter> element"),i}function Mg(i,c){let r=A.useContext(Jc),[u,f]=A.useState(!1),[d,h]=A.useState(!1),{onFocus:p,onBlur:x,onMouseEnter:g,onMouseLeave:C,onTouchStart:j}=c,E=A.useRef(null);A.useEffect(()=>{if(i==="render"&&h(!0),i==="viewport"){let m=S=>{S.forEach(y=>{h(y.isIntersecting)})},b=new IntersectionObserver(m,{threshold:.5});return E.current&&b.observe(E.current),()=>{b.disconnect()}}},[i]),A.useEffect(()=>{if(u){let m=setTimeout(()=>{h(!0)},100);return()=>{clearTimeout(m)}}},[u]);let v=()=>{f(!0)},_=()=>{f(!1),h(!1)};return r?i!=="intent"?[d,E,{}]:[d,E,{onFocus:Ni(p,v),onBlur:Ni(x,_),onMouseEnter:Ni(g,v),onMouseLeave:Ni(C,_),onTouchStart:Ni(j,v)}]:[!1,E,{}]}function Ni(i,c){return r=>{i&&i(r),r.defaultPrevented||c(r)}}function Ug({page:i,...c}){let{router:r}=qp(),u=A.useMemo(()=>_p(r.routes,i,r.basename),[r.routes,i,r.basename]);return u?A.createElement(Lg,{page:i,matches:u,...c}):null}function Bg(i){let{manifest:c,routeModules:r}=Kp(),[u,f]=A.useState([]);return A.useEffect(()=>{let d=!1;return Ag(i,c,r).then(h=>{d||f(h)}),()=>{d=!0}},[i,c,r]),u}function Lg({page:i,matches:c,...r}){let u=gn(),{future:f,manifest:d,routeModules:h}=Kp(),{basename:p}=qp(),{loaderData:x,matches:g}=Tg(),C=A.useMemo(()=>np(i,c,g,d,u,"data"),[i,c,g,d,u]),j=A.useMemo(()=>np(i,c,g,d,u,"assets"),[i,c,g,d,u]),E=A.useMemo(()=>{if(i===u.pathname+u.search+u.hash)return[];let m=new Set,b=!1;if(c.forEach(y=>{let k=d.routes[y.route.id];!k||!k.hasLoader||(!C.some(U=>U.route.id===y.route.id)&&y.route.id in x&&h[y.route.id]?.shouldRevalidate||k.hasClientLoader?b=!0:m.add(y.route.id))}),m.size===0)return[];let S=Cg(i,p,f.unstable_trailingSlashAwareDataRequests,"data");return b&&m.size>0&&S.searchParams.set("_routes",c.filter(y=>m.has(y.route.id)).map(y=>y.route.id).join(",")),[S.pathname+S.search]},[p,f.unstable_trailingSlashAwareDataRequests,x,u,d,C,c,i,h]),v=A.useMemo(()=>zg(j,d),[j,d]),_=Bg(j);return A.createElement(A.Fragment,null,E.map(m=>A.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...r})),v.map(m=>A.createElement("link",{key:m,rel:"modulepreload",href:m,...r})),_.map(({key:m,link:b})=>A.createElement("link",{key:m,nonce:r.nonce,...b,crossOrigin:b.crossOrigin??r.crossOrigin})))}function Hg(...i){return c=>{i.forEach(r=>{typeof r=="function"?r(c):r!=null&&(r.current=c)})}}var Yg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Yg&&(window.__reactRouterVersion="7.13.0")}catch{}function qg({basename:i,children:c,unstable_useTransitions:r,window:u}){let f=A.useRef();f.current==null&&(f.current=w0({window:u,v5Compat:!0}));let d=f.current,[h,p]=A.useState({action:d.action,location:d.location}),x=A.useCallback(g=>{r===!1?p(g):A.startTransition(()=>p(g))},[r]);return A.useLayoutEffect(()=>d.listen(x),[d,x]),A.createElement(xg,{basename:i,children:c,location:h.location,navigationType:h.action,navigator:d,unstable_useTransitions:r})}var Ip=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Gp=A.forwardRef(function({onClick:c,discover:r="render",prefetch:u="none",relative:f,reloadDocument:d,replace:h,state:p,target:x,to:g,preventScrollReset:C,viewTransition:j,unstable_defaultShouldRevalidate:E,...v},_){let{basename:m,unstable_useTransitions:b}=A.useContext(fa),S=typeof g=="string"&&Ip.test(g),y=Rp(g,m);g=y.to;let k=tg(g,{relative:f}),[U,O,M]=Mg(u,v),T=Vg(g,{replace:h,state:p,target:x,preventScrollReset:C,relative:f,viewTransition:j,unstable_defaultShouldRevalidate:E,unstable_useTransitions:b});function Z(ue){c&&c(ue),ue.defaultPrevented||T(ue)}let V=A.createElement("a",{...v,...M,href:y.absoluteURL||k,onClick:y.isExternal||d?c:Z,ref:Hg(_,O),target:x,"data-discover":!S&&r==="render"?"true":void 0});return U&&!S?A.createElement(A.Fragment,null,V,A.createElement(Ug,{page:k})):V});Gp.displayName="Link";var Kg=A.forwardRef(function({"aria-current":c="page",caseSensitive:r=!1,className:u="",end:f=!1,style:d,to:h,viewTransition:p,children:x,...g},C){let j=Ai(h,{relative:g.relative}),E=gn(),v=A.useContext(or),{navigator:_,basename:m}=A.useContext(fa),b=v!=null&&Fg(j)&&p===!0,S=_.encodeLocation?_.encodeLocation(j).pathname:j.pathname,y=E.pathname,k=v&&v.navigation&&v.navigation.location?v.navigation.location.pathname:null;r||(y=y.toLowerCase(),k=k?k.toLowerCase():null,S=S.toLowerCase()),k&&m&&(k=Va(k,m)||k);const U=S!=="/"&&S.endsWith("/")?S.length-1:S.length;let O=y===S||!f&&y.startsWith(S)&&y.charAt(U)==="/",M=k!=null&&(k===S||!f&&k.startsWith(S)&&k.charAt(S.length)==="/"),T={isActive:O,isPending:M,isTransitioning:b},Z=O?c:void 0,V;typeof u=="function"?V=u(T):V=[u,O?"active":null,M?"pending":null,b?"transitioning":null].filter(Boolean).join(" ");let ue=typeof d=="function"?d(T):d;return A.createElement(Gp,{...g,"aria-current":Z,className:V,ref:C,style:ue,to:h,viewTransition:p},typeof x=="function"?x(T):x)});Kg.displayName="NavLink";var Ig=A.forwardRef(({discover:i="render",fetcherKey:c,navigate:r,reloadDocument:u,replace:f,state:d,method:h=ar,action:p,onSubmit:x,relative:g,preventScrollReset:C,viewTransition:j,unstable_defaultShouldRevalidate:E,...v},_)=>{let{unstable_useTransitions:m}=A.useContext(fa),b=$g(),S=Qg(p,{relative:g}),y=h.toLowerCase()==="get"?"get":"post",k=typeof p=="string"&&Ip.test(p),U=O=>{if(x&&x(O),O.defaultPrevented)return;O.preventDefault();let M=O.nativeEvent.submitter,T=M?.getAttribute("formmethod")||h,Z=()=>b(M||O.currentTarget,{fetcherKey:c,method:T,navigate:r,replace:f,state:d,relative:g,preventScrollReset:C,viewTransition:j,unstable_defaultShouldRevalidate:E});m&&r!==!1?A.startTransition(()=>Z()):Z()};return A.createElement("form",{ref:_,method:y,action:S,onSubmit:u?x:U,...v,"data-discover":!k&&i==="render"?"true":void 0})});Ig.displayName="Form";function Gg(i){return`${i} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Vp(i){let c=A.useContext(Al);return yt(c,Gg(i)),c}function Vg(i,{target:c,replace:r,state:u,preventScrollReset:f,relative:d,viewTransition:h,unstable_defaultShouldRevalidate:p,unstable_useTransitions:x}={}){let g=qn(),C=gn(),j=Ai(i,{relative:d});return A.useCallback(E=>{if(jg(E,c)){E.preventDefault();let v=r!==void 0?r:Ci(C)===Ci(j),_=()=>g(i,{replace:v,state:u,preventScrollReset:f,relative:d,viewTransition:h,unstable_defaultShouldRevalidate:p});x?A.startTransition(()=>_()):_()}},[C,g,j,r,u,c,i,f,d,h,p,x])}var Xg=0,Zg=()=>`__${String(++Xg)}__`;function $g(){let{router:i}=Vp("useSubmit"),{basename:c}=A.useContext(fa),r=fg(),u=i.fetch,f=i.navigate;return A.useCallback(async(d,h={})=>{let{action:p,method:x,encType:g,formData:C,body:j}=_g(d,c);if(h.navigate===!1){let E=h.fetcherKey||Zg();await u(E,r,h.action||p,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:C,body:j,formMethod:h.method||x,formEncType:h.encType||g,flushSync:h.flushSync})}else await f(h.action||p,{unstable_defaultShouldRevalidate:h.unstable_defaultShouldRevalidate,preventScrollReset:h.preventScrollReset,formData:C,body:j,formMethod:h.method||x,formEncType:h.encType||g,replace:h.replace,state:h.state,fromRouteId:r,flushSync:h.flushSync,viewTransition:h.viewTransition})},[u,f,c,r])}function Qg(i,{relative:c}={}){let{basename:r}=A.useContext(fa),u=A.useContext(Na);yt(u,"useFormAction must be used inside a RouteContext");let[f]=u.matches.slice(-1),d={...Ai(i||".",{relative:c})},h=gn();if(i==null){d.search=h.search;let p=new URLSearchParams(d.search),x=p.getAll("index");if(x.some(C=>C==="")){p.delete("index"),x.filter(j=>j).forEach(j=>p.append("index",j));let C=p.toString();d.search=C?`?${C}`:""}}return(!i||i===".")&&f.route.index&&(d.search=d.search?d.search.replace(/^\?/,"?index&"):"?index"),r!=="/"&&(d.pathname=d.pathname==="/"?r:Ga([r,d.pathname])),Ci(d)}function Fg(i,{relative:c}={}){let r=A.useContext(Dp);yt(r!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=Vp("useViewTransitionState"),f=Ai(i,{relative:c});if(!r.isTransitioning)return!1;let d=Va(r.currentLocation.pathname,u)||r.currentLocation.pathname,h=Va(r.nextLocation.pathname,u)||r.nextLocation.pathname;return lr(f.pathname,h)!=null||lr(f.pathname,d)!=null}var ur=Np();const he=tt.memo(({name:i,className:c="",fill:r=!1})=>l.jsx("span",{className:`material-symbols-outlined ${c}`,style:{fontVariationSettings:r?"'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24":"'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24"},"aria-hidden":"true",children:i})),Jg=({onNavigate:i,onNewTask:c,onLogout:r,currentScreen:u})=>l.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:[l.jsx("button",{onClick:()=>i("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",title:"Go to Dashboard",children:l.jsx("img",{src:"/figranium_icon.svg",alt:"Figranium Logo",className:"w-10 h-10",onError:f=>{f.currentTarget.src="/figranium_icon.svg"}})}),l.jsxs("div",{className:"flex-1 flex flex-col gap-6",children:[l.jsx("button",{onClick:c,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:l.jsx(he,{name:"add",className:"text-2xl"})}),l.jsx("button",{onClick:()=>i("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 ${u==="dashboard"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Dashboard","aria-label":"Dashboard",children:l.jsx(he,{name:"home",className:"text-2xl"})}),l.jsx("button",{onClick:()=>i("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 ${u==="settings"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Settings","aria-label":"Settings",children:l.jsx(he,{name:"settings",className:"text-2xl"})}),l.jsx("button",{onClick:()=>i("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 ${u==="executions"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Executions","aria-label":"Executions",children:l.jsx(he,{name:"history",className:"text-2xl"})}),l.jsx("button",{onClick:()=>i("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 ${u==="captures"?"bg-white/10 text-white":"text-gray-500 hover:bg-white/5 hover:text-white"}`,title:"Captures","aria-label":"Captures",children:l.jsx(he,{name:"photo_camera",className:"text-2xl"})})]}),l.jsx("button",{onClick:r,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:l.jsx(he,{name:"logout",className:"text-2xl"})})]}),Pg=tt.memo(Jg),Wg=({status:i,onSubmit:c,error:r,busy:u=!1})=>{const[f,d]=A.useState(""),[h,p]=A.useState(""),[x,g]=A.useState(""),[C,j]=A.useState(""),[E,v]=A.useState(!1),[_,m]=A.useState(!1),b=y=>{y.preventDefault(),c(h,x,f,C)},S=i==="setup"?u?"Creating account...":"Create Account":u?"Authenticating...":"Authenticate";return l.jsxs("div",{className:"fixed inset-0 z-[100] bg-[#020202] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),l.jsxs("div",{className:"w-[400px] glass-card p-10 rounded-[48px] space-y-8 relative",children:[l.jsx("div",{className:"text-center space-y-3",children:l.jsx("img",{src:"/figranium_logo.svg",alt:"Figranium",className:"h-24 mx-auto object-contain"})}),l.jsxs("form",{onSubmit:b,className:"space-y-8",children:[l.jsxs("div",{className:"space-y-4",children:[i==="setup"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"auth-name",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Name"}),l.jsx("input",{id:"auth-name",type:"text",value:f,onChange:y=>d(y.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 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",autoComplete:"name"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"auth-email",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Email"}),l.jsx("input",{id:"auth-email",type:"email",value:h,onChange:y=>p(y.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 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:"email"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"auth-pass",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Password"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{id:"auth-pass",type:E?"text":"password",value:x,onChange:y=>g(y.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 pr-12 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:i==="setup"?"new-password":"current-password"}),l.jsx("button",{type:"button",onClick:()=>v(!E),className:"absolute right-4 top-1/2 -translate-y-1/2 p-1.5 rounded-lg text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":E?"Hide password":"Show password",title:E?"Hide password":"Show password",children:l.jsx(he,{name:E?"visibility_off":"visibility",className:"text-lg"})})]})]}),i==="setup"&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"auth-pass-confirm",className:"text-[9px] font-bold text-gray-400 uppercase tracking-[0.2em]",children:"Confirm Password"}),l.jsxs("div",{className:"relative",children:[l.jsx("input",{id:"auth-pass-confirm",type:_?"text":"password",value:C,onChange:y=>j(y.target.value),placeholder:"••••••••",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl px-5 py-4 pr-12 text-sm focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/50 transition-all placeholder:text-gray-600",required:!0,autoComplete:"new-password"}),l.jsx("button",{type:"button",onClick:()=>m(!_),className:"absolute right-4 top-1/2 -translate-y-1/2 p-1.5 rounded-lg text-white/30 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":_?"Hide password confirmation":"Show password confirmation",title:_?"Hide password confirmation":"Show password confirmation",children:l.jsx(he,{name:_?"visibility_off":"visibility",className:"text-lg"})})]})]})]}),l.jsxs("button",{type:"submit",disabled:u,"aria-busy":u,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:[u&&l.jsx("div",{className:"w-4 h-4 border-2 border-black/10 border-t-black rounded-full animate-spin"}),S]}),r&&l.jsx("div",{role:"alert",className:"text-[9px] font-bold text-red-500 text-center uppercase tracking-widest",children:r})]})]})]})},eb=i=>{if(!i)return null;const c=i.match(/^(?:https?:\/\/)?(?:[^@\n]+@)?(?:www\.)?([^:/\n?]+)/im);return c?`https://www.google.com/s2/favicons?domain=${c[1]}&sz=64`:null},tb=({task:i,onEditTask:c,onDeleteTask:r})=>{const u=eb(i.url);return l.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:[l.jsxs("div",{className:"flex justify-between items-start",children:[l.jsx("div",{className:"w-12 h-12 rounded-xl bg-white/5 border border-white/10 flex items-center justify-center overflow-hidden",children:u?l.jsx("img",{src:u,alt:"",className:"w-6 h-6 object-contain grayscale opacity-100 group-hover:grayscale-0 transition-all duration-300",onError:f=>{f.target.style.display="none"}}):l.jsx(he,{name:"public",className:"text-gray-500 text-xl"})}),l.jsx("div",{className:"flex items-center gap-2",children:l.jsx("div",{className:"px-3 py-1 rounded-lg bg-white/5 text-[7px] font-bold uppercase tracking-widest text-white/60",children:i.mode})})]}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-bold text-white truncate",children:i.name||"Untitled"}),l.jsx("p",{className:"text-[10px] text-gray-600 font-mono truncate mt-1",children:i.url||"Target undefined"})]}),l.jsxs("div",{className:"flex gap-3 pt-4 border-t border-white/5",children:[l.jsx("button",{onClick:()=>c(i),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-blue-500",children:"Edit Task"}),l.jsx("button",{onClick:()=>r(i.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:l.jsx(he,{name:"close",className:"text-base"})})]})]})},ab=A.memo(tb),nb=({tasks:i,onNewTask:c,onEditTask:r,onDeleteTask:u,onExportTasks:f,onImportTasks:d})=>{const h=A.useRef(null),p=A.useRef(null),[x,g]=tt.useState(!1),[C,j]=tt.useState([]),[E,v]=tt.useState("");tt.useEffect(()=>{const y=k=>{k.key==="/"&&document.activeElement?.tagName!=="INPUT"&&document.activeElement?.tagName!=="TEXTAREA"&&(k.preventDefault(),p.current?.focus())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[]);const _=tt.useMemo(()=>{const y=E.toLowerCase().trim();return y?i.filter(k=>(k.name||"").toLowerCase().includes(y)||(k.url||"").toLowerCase().includes(y)):i},[i,E]),m=()=>{h.current?.click()},b=y=>{const k=Array.from(y.target.files||[]);k.length>0&&k.forEach(U=>d(U)),y.target.value=""},S=y=>{j(k=>k.includes(y)?k.filter(U=>U!==y):[...k,y])};return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex-1 overflow-hidden animate-in fade-in duration-500 bg-black",children:l.jsxs("div",{className:"h-full flex flex-col px-12 py-12 max-w-7xl mx-auto space-y-12 w-full",children:[l.jsxs("div",{className:"relative flex items-center justify-between",children:[l.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase shrink-0",children:"Dashboard"}),i.length>0&&l.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 group/search w-[260px]",children:[l.jsx(he,{name:"search",className:"absolute left-4 top-1/2 -translate-y-1/2 text-gray-500 text-lg group-focus-within/search:text-white transition-colors"}),l.jsx("input",{ref:p,type:"text",value:E,onChange:y=>v(y.target.value),placeholder:"Filter tasks... (/)",className:"w-full bg-white/[0.05] border border-white/10 rounded-2xl py-3 pl-12 pr-10 text-[10px] font-bold uppercase tracking-widest text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30 focus-visible:ring-2 focus-visible:ring-white/20 transition-all","aria-label":"Filter tasks",title:"Search tasks by name or URL"}),E&&l.jsx("button",{onClick:()=>v(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white transition-colors","aria-label":"Clear filter",title:"Clear filter",children:l.jsx(he,{name:"cancel",className:"text-base"})})]}),l.jsxs("div",{className:"flex items-center gap-5",children:[l.jsxs("button",{onClick:()=>{j([]),g(!0)},className:"px-5 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",title:"Export tasks","aria-label":"Export tasks",children:[l.jsx(he,{name:"download",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Export"]}),l.jsxs("button",{onClick:m,className:"px-5 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",title:"Import tasks","aria-label":"Import tasks",children:[l.jsx(he,{name:"upload",className:"w-4 h-4 inline-block mr-2 text-[16px] align-sub"}),"Import"]}),l.jsx("button",{onClick:c,className:"shine-effect bg-white text-black px-9 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-blue-500","aria-label":"Create new task",title:"Create new task",children:"+ New Task"}),l.jsx("input",{ref:h,type:"file",accept:"application/json",multiple:!0,className:"hidden",onChange:b})]})]}),l.jsxs("div",{className:"relative flex-1 min-h-0",children:[l.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"}),l.jsxs("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:[E&&_.length===0&&l.jsxs("div",{className:"col-span-full py-20 flex flex-col items-center justify-center text-center space-y-4",children:[l.jsx(he,{name:"search_off",className:"text-5xl text-white/10"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-white/40",children:"No matching tasks"}),l.jsx("p",{className:"text-[10px] text-gray-600",children:"Try a different search term or clear the filter."})]}),l.jsx("button",{onClick:()=>v(""),className:"text-[9px] font-bold uppercase tracking-widest text-blue-400 hover:text-blue-300 transition-colors",children:"Clear Filter"})]}),_.map(y=>l.jsx(ab,{task:y,onEditTask:r,onDeleteTask:u},y.id))]})]}),i.length===0&&l.jsx("div",{className:"flex-1 flex flex-col items-center justify-center",children:l.jsxs("button",{onClick:c,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",title:"Create first task","aria-label":"Create first task",children:[l.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:l.jsx(he,{name:"add",className:"text-3xl text-gray-500 group-hover:text-white transition-colors"})}),l.jsxs("div",{className:"text-center space-y-2",children:[l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-white/70 group-hover:text-white transition-colors",children:"Create First Task"}),l.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."})]})]})})]})}),x&&l.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 pb-20 sm:pb-6",children:[l.jsx("div",{className:"absolute inset-0 bg-black/80 backdrop-blur-sm",onClick:()=>g(!1)}),l.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:[l.jsxs("div",{className:"p-6 sm:p-8 shrink-0",children:[l.jsx("h3",{className:"text-xl font-bold text-white tracking-tight",children:"Export Tasks"}),l.jsx("p",{className:"text-[11px] text-white/50 mt-2 font-mono",children:"Select the tasks you want to export."})]}),l.jsxs("div",{className:"px-6 sm:px-8 pb-4 flex items-center gap-3 shrink-0 border-b border-white/5",children:[l.jsx("button",{onClick:()=>j(i.map(y=>y.id)),className:"text-[10px] font-bold uppercase tracking-widest text-blue-400 hover:text-blue-300 transition-colors",children:"Select All"}),l.jsx("span",{className:"text-white/20",children:"|"}),l.jsx("button",{onClick:()=>j([]),className:"text-[10px] font-bold uppercase tracking-widest text-white/40 hover:text-white/80 transition-colors",children:"Deselect All"}),l.jsx("div",{className:"flex-1"}),l.jsxs("span",{className:"text-[10px] font-mono text-white/30",children:[C.length," selected"]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 sm:p-8 space-y-2",children:i.map(y=>l.jsxs("button",{onClick:()=>S(y.id),className:`w-full text-left p-4 rounded-2xl border transition-all flex items-center gap-4 ${C.includes(y.id)?"bg-blue-500/10 border-blue-500/30":"bg-white/5 border-white/5 hover:border-white/10"}`,children:[l.jsx("div",{className:`w-5 h-5 rounded flex items-center justify-center border transition-colors ${C.includes(y.id)?"bg-blue-500 border-blue-400 text-white":"border-white/20"}`,children:C.includes(y.id)&&l.jsx(he,{name:"check",className:"text-[14px]"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("div",{className:"text-sm font-bold text-white truncate",children:y.name||"Untitled"}),l.jsx("div",{className:"text-[10px] text-white/40 font-mono truncate",children:y.url||"No URL"})]})]},y.id))}),l.jsxs("div",{className:"p-6 sm:p-8 bg-black/40 border-t border-white/5 flex gap-3 shrink-0",children:[l.jsx("button",{onClick:()=>g(!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"}),l.jsxs("button",{onClick:()=>{f(C),g(!1)},disabled:C.length===0,className:`flex-1 px-4 py-3 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 ${C.length>0?"bg-white text-black hover:scale-105":"bg-white/10 text-white/30 cursor-not-allowed"}`,children:["Export (",C.length,")"]})]})]})]})]})},lp=A.memo(nb),ir=[{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"},{type:"http_request",label:"HTTP Request",description:"Make an API call",icon:"language"}],lb=({open:i,query:c,onQueryChange:r,onClose:u,onSelect:f})=>{const d=A.useRef(null),h=A.useRef(null),[p,x]=A.useState(-1);A.useEffect(()=>{if(i){x(-1);const j=setTimeout(()=>d.current?.focus(),50);return()=>clearTimeout(j)}},[i]);const g=A.useMemo(()=>{const j=c.trim().toLowerCase();return j?ir.filter(E=>E.label.toLowerCase().includes(j)||E.description.toLowerCase().includes(j)):ir},[c]);A.useEffect(()=>{x(-1)},[c]),A.useEffect(()=>{if(i&&h.current){const j=h.current.querySelector(`[data-index="${p}"]`);j&&j.scrollIntoView({block:"nearest",behavior:"smooth"})}},[p,i]);const C=j=>{j.key==="Escape"?c?(j.stopPropagation(),r("")):u():j.key==="ArrowDown"?(j.preventDefault(),x(E=>E===-1?0:E+2<g.length?E+2:E)):j.key==="ArrowUp"?(j.preventDefault(),x(E=>E<=0?-1:E-2)):j.key==="ArrowRight"?(j.preventDefault(),x(E=>E===-1?0:E+1<g.length?E+1:E)):j.key==="ArrowLeft"?(j.preventDefault(),x(E=>E<=0?-1:E-1)):j.key==="Enter"&&(j.preventDefault(),g[p]&&f(g[p].type))};return i?l.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:u,children:l.jsxs("div",{className:"glass-card w-full max-w-xl rounded-[28px] border border-white/10 p-6 shadow-2xl animate-in fade-in zoom-in-95 duration-200",onClick:j=>j.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between mb-4",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"Add Block"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Search actions and control flow blocks."})]}),l.jsx("button",{onClick:u,className:"p-2 rounded-xl border border-white/10 text-white/70 hover:text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Close",title:"Close palette",children:l.jsx(he,{name:"close",className:"text-base"})})]}),l.jsxs("div",{className:"relative group/search",children:[l.jsx("input",{ref:d,value:c,onChange:j=>r(j.target.value),onKeyDown:C,placeholder:"Type to filter (e.g., if, click, while)","aria-label":"Search actions","aria-activedescendant":g[p]?`action-item-${g[p].type}`:void 0,className:"w-full rounded-xl bg-black/40 border border-white/10 px-4 py-3 pr-10 text-sm text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/20"}),c&&l.jsx("button",{onClick:()=>{r(""),d.current?.focus()},className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-white transition-colors","aria-label":"Clear search",title:"Clear search",children:l.jsx(he,{name:"cancel",className:"text-lg"})})]}),l.jsxs("div",{ref:h,className:"mt-4 max-h-[400px] overflow-y-auto custom-scrollbar pr-2",children:[l.jsx("div",{className:"grid grid-cols-2 gap-3 pb-2",role:"listbox",children:g.map((j,E)=>l.jsxs("button",{id:`action-item-${j.type}`,"data-index":E,role:"option","aria-selected":E===p,onClick:()=>f(j.type),className:`flex flex-col items-start gap-2 text-left p-4 rounded-2xl border transition-all hover:scale-[1.02] active:scale-95 group focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500/50 ${E===p?"bg-white/10 border-white/30 ring-1 ring-white/20":"border-white/5 bg-white/[0.02] hover:bg-white/[0.08] hover:border-white/20"}`,children:[l.jsx(he,{name:j.icon||"extension",className:"text-2xl text-white/80 group-hover:text-white transition-colors shrink-0 mb-1"}),l.jsxs("div",{children:[l.jsx("div",{className:"text-[11px] font-bold uppercase tracking-widest text-white/90 group-hover:text-white mb-1",children:j.label}),l.jsx("div",{className:"text-[10px] text-gray-500 line-clamp-2 leading-relaxed",children:j.description})]})]},j.type))}),g.length===0&&l.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-3",children:[l.jsx(he,{name:"search_off",className:"text-4xl text-white/10"}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-widest text-white/40",children:"No matches found"}),l.jsx("p",{className:"text-[10px] text-gray-600",children:"Try a different search term or browse the catalog."})]})]})]})]})}):null},ib={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},Et=i=>/[&<>"']/.test(i)?i.replace(/[&<>"']/g,c=>ib[c]):i,sb=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"]),sr=(i,c)=>{if(!i.includes("{$"))return Et(i);const r=/\{\$(\w+)\}/g;let u="",f=0,d;const h=x=>!!c&&(x in c||x==="now"),p=x=>{if(x==="now")return!0;const g=c?c[x]:void 0;return g&&g.value!==""&&g.value!==void 0&&g.value!==null};for(;(d=r.exec(i))!==null;){d.index>f&&(u+=Et(i.substring(f,d.index)));const x=d[1],g=h(x),C=p(x);u+=`<span class="${g?C?"var-highlight-default":"var-highlight":"var-highlight-undefined"}">${Et(d[0])}</span>`,f=r.lastIndex}return u+=Et(i.substring(f)),u},rb=i=>{const c=/("(?:\\.|[^"\\])*")|(-?\b\d+(?:\.\d+)?(?:[eE][+-]?\d+)?\b)|\b(true|false|null)\b/g;let r="",u=0,f;for(;(f=c.exec(i))!==null;){f.index>u&&(r+=Et(i.substring(u,f.index)));const d=f[0];if(f[1]){let h=!1,p=f.index+d.length;for(;p<i.length&&/\s/.test(i[p]);)p+=1;i[p]===":"&&(h=!0),r+=`<span class="${h?"code-token-key":"code-token-string"}">${Et(d)}</span>`}else f[2]?r+=`<span class="code-token-number">${Et(d)}</span>`:r+=`<span class="code-token-boolean">${Et(d)}</span>`;u=c.lastIndex}return r+=Et(i.substring(u)),r},ob=(i,c)=>{const r=/(\{\$\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 u="",f=0,d;for(;(d=r.exec(i))!==null;){d.index>f&&(u+=Et(i.substring(f,d.index)));const h=d[0];if(d[1])u+=sr(h,c);else if(d[2])u+=`<span class="code-token-comment">${Et(h)}</span>`;else if(d[3])u+=`<span class="code-token-string">${Et(h)}</span>`;else if(d[4])u+=`<span class="code-token-number">${Et(h)}</span>`;else if(d[5])u+=`<span class="code-token-boolean">${Et(h)}</span>`;else if(d[6]){const p=sb.has(h)?"code-token-keyword":"code-token-identifier";u+=`<span class="${p}">${Et(h)}</span>`}else u+=Et(h);f=r.lastIndex}return u+=Et(i.substring(f)),u},cb=(i,c)=>{const r=/<\/?[^>]+>/g;let u="",f=0,d;for(;(d=r.exec(i))!==null;){d.index>f&&(u+=sr(i.substring(f,d.index),c));const p=d[0],x=p.match(/^<(\/?[A-Za-z0-9-]+)([\s\S]*?)>$/);if(x){const g=x[1],C=x[2];let j=Et(g);j.startsWith("/")?j=`/<span class="code-token-tag">${j.substring(1)}</span>`:j=`<span class="code-token-tag">${j}</span>`;let E=Et(C);E=E.replace(/(\s)([A-Za-z0-9-:]+)(=)/g,'$1<span class="code-token-attr">$2</span>$3'),E=E.replace(/(&quot;.*?&quot;|&#39;.*?&#39;)/g,'<span class="code-token-string">$1</span>'),u+=`<span class="code-token-punct">&lt;${j}${E}&gt;</span>`}else u+=`<span class="code-token-punct">${Et(p)}</span>`;f=r.lastIndex}const h=i.substring(f);return h&&(u+=sr(h,c)),u},Xp=(i,c,r)=>c==="javascript"?ob(i,r):c==="json"?rb(i):c==="html"?cb(i,r):sr(i,r),xn=({value:i,onChange:c,onBlur:r,language:u,placeholder:f,className:d,readOnly:h,variables:p})=>{const x=A.useRef(null),g=A.useRef(null),C=i||f||"",j=!i&&!!f,E=A.useMemo(()=>Xp(C,u,p),[C,u,p]);return A.useEffect(()=>{const v=x.current,_=g.current;if(!v||!_)return;const m=()=>{_.scrollTop=v.scrollTop,_.scrollLeft=v.scrollLeft};return v.addEventListener("scroll",m),()=>{v.removeEventListener("scroll",m)}},[]),l.jsxs("div",{className:`code-editor ${d||""}`,onWheel:v=>{const _=x.current;_&&(_.scrollHeight<=_.clientHeight||(_.scrollTop+=v.deltaY,_.scrollLeft+=v.deltaX,_.focus(),v.preventDefault()))},children:[l.jsx("pre",{ref:g,className:`code-editor-pre ${j?"code-editor-placeholder":""}`,"aria-hidden":!0,dangerouslySetInnerHTML:{__html:E}}),l.jsx("textarea",{ref:x,value:i,onChange:v=>c?.(v.target.value),onBlur:v=>r?.(v.target.value),spellCheck:!1,wrap:"off",readOnly:h,className:`code-editor-textarea ${h?"code-editor-textarea-readonly":""}`,"aria-label":"Code editor",tabIndex:h?-1:0})]})},ub=async i=>{try{if(navigator.clipboard&&window.isSecureContext)return await navigator.clipboard.writeText(i),!0;{const c=document.createElement("textarea");c.value=i,c.style.position="fixed",c.style.left="-999999px",c.style.top="-999999px",document.body.appendChild(c),c.focus(),c.select();const r=document.execCommand("copy");return c.remove(),r}}catch(c){return console.error("Copy failed:",c),!1}},kl=({text:i,label:c,className:r,iconClassName:u,onCopy:f,title:d,disabled:h=!1})=>{const[p,x]=A.useState(!1),g=async _=>{if(_.stopPropagation(),h)return;await ub(i)&&(x(!0),f?.(),setTimeout(()=>x(!1),2e3))},C="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",j="focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",E=r?`${r} ${j}`:`${C} ${j}`,v=p?E.replace("border-white/10","border-green-400 text-green-400"):E;return l.jsxs("button",{onClick:g,disabled:h,className:v,title:d||(p?"Copied":"Copy"),type:"button","aria-label":c||d||"Copy to clipboard",children:[p?l.jsx(he,{name:"check",className:`${u||"text-sm"} text-green-400`}):l.jsx(he,{name:"content_copy",className:u||"text-sm"}),c&&l.jsx("span",{children:p?"Copied":c})]})},db=({currentTask:i,onUpdateTask:c})=>{if(!i.id)return l.jsxs("div",{className:"flex flex-col items-center justify-center h-64 text-center space-y-4 animate-in fade-in duration-300",children:[l.jsx("div",{className:"w-12 h-12 rounded-full bg-white/5 flex items-center justify-center",children:l.jsx(he,{name:"save",className:"text-gray-500"})}),l.jsxs("div",{children:[l.jsx("p",{className:"text-xs text-white font-medium",children:"Save Required"}),l.jsx("p",{className:"text-[10px] text-gray-500 mt-1 max-w-[200px]",children:"You must save this task before you can set an execution schedule."})]})]});const r=i.schedule||{enabled:!1},[u,f]=tt.useState(!!r.cron&&!r.frequency);tt.useEffect(()=>{r.cron&&!r.frequency&&f(!0),r.frequency&&!r.cron&&f(!1)},[r.cron,r.frequency]);const[d,h]=tt.useState(null),[p,x]=tt.useState(r.nextRun||null),[g,C]=tt.useState(!1),[j,E]=tt.useState(null),[v,_]=tt.useState(!1),m=O=>{const M={...r,...O};M.enabled&&!M.frequency&&!M.cron&&(M.frequency="daily",M.hour=9,M.minute=0),c({schedule:M}),fetch(`/api/schedules/${i.id}/describe`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(M)}).then(T=>T.json()).then(T=>{h(T.description||null),x(T.nextRun||null)}).catch(()=>{})};tt.useEffect(()=>{(r.enabled||r.frequency||r.cron)&&fetch(`/api/schedules/${i.id}/describe`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(r)}).then(O=>O.json()).then(O=>{h(O.description||null),x(O.nextRun||null)}).catch(()=>{})},[]);const b=O=>{C(!0),E(null),_(!1);const M=O||{...r};fetch(`/api/schedules/${i.id}`,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(M)}).then(async T=>{const Z=await T.json();if(!T.ok)throw new Error(Z.message||Z.error||"Failed to save");return Z}).then(T=>{T.schedule&&(c({schedule:T.schedule}),h(T.description||null),x(T.schedule?.nextRun||null),_(!0),setTimeout(()=>_(!1),2e3))}).catch(T=>{E(T.message)}).finally(()=>{C(!1)})},S=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],y=r.frequency||(u?void 0:"daily"),k=r.daysOfWeek||[],U=O=>{const M=O-Date.now();if(M<0)return"now";const T=Math.floor(M/6e4);if(T<1)return"less than a minute";if(T<60)return`${T}m`;const Z=Math.floor(T/60);return Z<24?`${Z}h ${T%60}m`:`${Math.floor(Z/24)}d ${Z%24}h`};return l.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Scheduled Execution"}),l.jsxs("button",{role:"switch","aria-checked":r.enabled,onClick:()=>{const O=!r.enabled,M={...r,enabled:O};O&&!M.frequency&&!M.cron&&(M.frequency="daily",M.hour=9,M.minute=0),m(M),b(M)},className:`flex items-center gap-2 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all border focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r.enabled?"bg-emerald-500/20 border-emerald-500/40 text-emerald-400":"bg-white/5 border-white/10 text-gray-500 hover:text-white hover:border-white/20"}`,children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${r.enabled?"bg-emerald-400 animate-pulse":"bg-gray-600"}`}),r.enabled?"Active":"Inactive"]})]}),l.jsxs("div",{role:"tablist",className:"flex items-center gap-2 bg-black/40 p-1 rounded-xl border border-white/5",children:[l.jsx("button",{role:"tab","aria-selected":!u,onClick:()=>{f(!1),m({cron:void 0,frequency:r.frequency||"daily"})},className:`flex-1 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all focus:outline-none focus-visible:ring-2 ${u?"text-gray-500 hover:text-white focus-visible:ring-white/50":"bg-white text-black focus-visible:ring-blue-500"}`,children:"Visual"}),l.jsx("button",{role:"tab","aria-selected":u,onClick:()=>{f(!0),m({frequency:void 0,cron:r.cron||"0 9 * * *"})},className:`flex-1 px-3 py-1.5 rounded-lg text-[10px] font-bold uppercase tracking-wider transition-all focus:outline-none focus-visible:ring-2 ${u?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:"Advanced"})]}),u?l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Cron Expression"}),l.jsx("input",{type:"text","aria-label":"Cron Expression",value:r.cron||"",onChange:O=>m({cron:O.target.value,frequency:void 0}),placeholder:"*/5 * * * *",className:"w-full bg-black/40 border border-white/10 rounded-xl px-4 py-3 text-sm text-white font-mono placeholder:text-gray-700 focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50"}),l.jsx("p",{className:"text-[9px] text-gray-600 font-mono",children:"minute hour day-of-month month day-of-week"})]}):l.jsxs("div",{className:"space-y-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Frequency"}),l.jsx("div",{role:"tablist",className:"grid grid-cols-3 gap-2",children:["interval","hourly","daily","weekly","monthly"].map(O=>l.jsx("button",{role:"tab","aria-selected":y===O,onClick:()=>m({frequency:O,cron:void 0}),className:`px-3 py-2.5 rounded-xl text-[10px] font-bold uppercase tracking-wider border transition-all focus:outline-none focus-visible:ring-2 ${y===O?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:O==="interval"?"Every X min":O},O))})]}),y==="interval"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Run every"}),l.jsx("div",{role:"tablist",className:"grid grid-cols-6 gap-2",children:[1,5,10,15,30,60].map(O=>l.jsxs("button",{role:"tab","aria-selected":(r.intervalMinutes||5)===O,onClick:()=>m({intervalMinutes:O}),className:`py-2 rounded-xl text-xs font-bold border transition-all focus:outline-none focus-visible:ring-2 ${(r.intervalMinutes||5)===O?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:[O,"m"]},O))})]}),y==="hourly"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"At minute"}),l.jsx("div",{role:"tablist",className:"grid grid-cols-4 gap-2",children:[0,15,30,45].map(O=>l.jsxs("button",{role:"tab","aria-selected":(r.minute??0)===O,onClick:()=>m({minute:O}),className:`py-2 rounded-xl text-xs font-bold border transition-all focus:outline-none focus-visible:ring-2 ${(r.minute??0)===O?"bg-white/15 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-500 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:[":",String(O).padStart(2,"0")]},O))})]}),(y==="daily"||y==="weekly"||y==="monthly")&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Time"}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("select",{"aria-label":"Hour",value:r.hour??9,onChange:O=>m({hour:parseInt(O.target.value)}),className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:24},(O,M)=>l.jsx("option",{value:M,children:M===0?"12 AM":M<12?`${M} AM`:M===12?"12 PM":`${M-12} PM`},M))}),l.jsx("select",{"aria-label":"Minute",value:r.minute??0,onChange:O=>m({minute:parseInt(O.target.value)}),className:"flex-1 bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:60},(O,M)=>l.jsxs("option",{value:M,children:[":",String(M).padStart(2,"0")]},M))})]})]}),y==="weekly"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Days"}),l.jsx("div",{className:"grid grid-cols-7 gap-1.5",children:S.map((O,M)=>l.jsx("button",{"aria-pressed":k.includes(M),onClick:()=>{const T=k.includes(M)?k.filter(Z=>Z!==M):[...k,M].sort();m({daysOfWeek:T})},className:`py-2 rounded-xl text-[10px] font-bold uppercase border transition-all focus:outline-none focus-visible:ring-2 ${k.includes(M)?"bg-white/20 border-white/40 text-white focus-visible:ring-blue-500":"bg-white/5 border-white/5 text-gray-600 hover:text-white hover:border-white/15 focus-visible:ring-white/50"}`,children:O},M))})]}),y==="monthly"&&l.jsxs("div",{className:"space-y-3",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Day of Month"}),l.jsx("select",{"aria-label":"Day of Month",value:r.dayOfMonth??1,onChange:O=>m({dayOfMonth:parseInt(O.target.value)}),className:"w-full bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white focus:outline-none focus:border-white/30 transition-all focus-visible:ring-2 focus-visible:ring-white/50",children:Array.from({length:31},(O,M)=>l.jsx("option",{value:M+1,children:M+1},M+1))})]})]}),d&&l.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4",children:[l.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[l.jsx(he,{name:"event_repeat",className:"text-sm text-white/40"}),l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Schedule"})]}),l.jsx("p",{className:"text-sm text-white font-medium",children:d})]}),p&&l.jsxs("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-2xl p-4",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Next Run"}),l.jsx("p",{className:"text-xs text-white mt-1",children:new Date(p).toLocaleString()})]}),l.jsxs("span",{className:"text-xs text-gray-400",children:["in ",U(p)]})]}),r.lastRun&&l.jsxs("div",{className:"flex items-center justify-between bg-white/5 border border-white/10 rounded-2xl p-4",children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("div",{className:`w-2 h-2 rounded-full ${r.lastRunStatus==="success"?"bg-emerald-400":"bg-red-400"}`}),l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Last Run"}),l.jsx("p",{className:"text-xs text-white mt-0.5",children:new Date(r.lastRun).toLocaleString()})]})]}),r.lastRunDurationMs!=null&&l.jsxs("span",{className:"text-[10px] text-gray-500",children:[(r.lastRunDurationMs/1e3).toFixed(1),"s"]})]}),j&&l.jsx("div",{className:"p-3 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-[10px] font-bold uppercase tracking-widest text-center",children:j}),l.jsxs("button",{onClick:()=>b(),disabled:g,className:`w-full py-3 rounded-2xl text-[10px] font-bold uppercase tracking-[0.2em] transition-all flex items-center justify-center gap-3 focus:outline-none focus-visible:ring-2 ${v?"bg-emerald-500 text-white shadow-lg shadow-emerald-500/20 focus-visible:ring-white":"bg-white text-black hover:bg-gray-200 shadow-xl shadow-white/5 focus-visible:ring-blue-500"} disabled:opacity-50`,children:[g?l.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):v?l.jsx(he,{name:"check",className:"text-sm"}):null,v?"Schedule Saved":g?"Saving...":"Save Schedule"]})]})},fb=({isOpen:i,onClose:c,currentTask:r,onUpdateTask:u,proxyListLoaded:f,proxyList:d,initialTab:h="mode",versions:p,versionsLoading:x,onRollback:g,onPreview:C})=>{const[j,E]=tt.useState(h),[v,_]=tt.useState([]),[m,b]=tt.useState({name:"",baseUrl:"https://api.baserow.io",token:""}),[S,y]=tt.useState(!1),[k,U]=tt.useState(!1),[O,M]=tt.useState([]),[T,Z]=tt.useState([]),[V,ue]=tt.useState(!1),[oe,Y]=tt.useState(!1),[ae,z]=tt.useState(!0);tt.useEffect(()=>{i&&E(h)},[i,h]),tt.useEffect(()=>{i&&j==="output"&&fetch("/api/credentials").then(H=>H.json()).then(_).catch(()=>{})},[i,j]);const I=tt.useCallback(async H=>{if(!H){M([]),Z([]),z(!0);return}ue(!0),z(!0);try{const ie=await fetch(`/api/credentials/${H}/proxy/baserow/databases`);if(ie.ok){const Ee=await ie.json();M(Ee),z(!0)}else M([]),z(!1)}catch{M([]),z(!1)}finally{ue(!1)}},[]),X=tt.useCallback(async(H,ie)=>{if(!H||!ie){Z([]);return}Y(!0);try{const Ee=await fetch(`/api/credentials/${H}/proxy/baserow/databases/${ie}/tables`);Ee.ok?Z(await Ee.json()):Z([])}catch{Z([])}finally{Y(!1)}},[]);tt.useEffect(()=>{r.output?.credentialId?I(r.output.credentialId):(M([]),Z([]))},[r.output?.credentialId,I]),tt.useEffect(()=>{r.output?.credentialId&&r.output?.databaseId?X(r.output.credentialId,r.output.databaseId):Z([])},[r.output?.databaseId,r.output?.credentialId,X]);const Q=async()=>{if(!(!m.name||!m.token)){U(!0);try{const H=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:m.name,provider:"baserow",config:{baseUrl:m.baseUrl,token:m.token}})});if(H.ok){const ie=await H.json();_(Ee=>[...Ee,ie]),b({name:"",baseUrl:"https://api.baserow.io",token:""}),y(!1),r.output?.credentialId||u({output:{...r.output,credentialId:ie.id,provider:"baserow",tableId:r.output?.tableId||"",onError:r.output?.onError||"ignore"}})}}finally{U(!1)}}},Ne=async H=>{await fetch(`/api/credentials/${H}`,{method:"DELETE"}),_(ie=>ie.filter(Ee=>Ee.id!==H)),r.output?.credentialId===H&&u({output:{...r.output,credentialId:""}})};if(!i)return null;const $=f&&d.length===1&&d[0]?.id==="host",re=(H,ie,Ee,ze)=>{const Ae={...r.variables};H!==ie&&delete Ae[H],Ae[ie]={type:Ee,value:ze},u({variables:Ae})},R=H=>{const ie={...r.variables};delete ie[H],u({variables:ie})},B=()=>{const H=`var_${Object.keys(r.variables||{}).length+1}`;re(H,H,"string","")},W=H=>{u({stealth:{...r.stealth,[H]:!r.stealth[H]}})},ee=(H,ie,Ee)=>l.jsxs("button",{role:"tab","aria-selected":j===H,onClick:()=>E(H),className:`flex items-center gap-2 px-4 py-2 rounded-xl text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${j===H?"bg-white text-black shadow-lg shadow-white/10 focus-visible:ring-blue-500":"text-gray-500 hover:text-white hover:bg-white/5 focus-visible:ring-white/50"}`,children:[l.jsx(he,{name:Ee,className:"text-sm"}),ie]});return l.jsxs("div",{className:"fixed inset-y-0 right-0 w-[450px] z-[100] flex",children:[l.jsx("div",{className:"fixed inset-0 bg-black/40 backdrop-blur-[2px]",onClick:c}),l.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:[l.jsxs("div",{className:"flex items-center justify-between mb-8",children:[l.jsxs("div",{children:[l.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Task Settings"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-[0.2em] mt-1",children:r.name||"Untitled Task"})]}),l.jsx("button",{onClick:c,className:"w-10 h-10 rounded-full flex items-center justify-center hover:bg-white/5 text-gray-400 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Close settings",title:"Close settings",children:l.jsx(he,{name:"close"})})]}),l.jsxs("div",{className:"mb-6",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em] block mb-2",children:"Description"}),l.jsx("textarea",{value:r.description||"",onChange:H=>u({description:H.target.value}),placeholder:"What does this task do? Give AI agents and operators context...",rows:3,className:"w-full bg-black/40 border border-white/10 rounded-xl px-3 py-2.5 text-xs text-white placeholder:text-gray-600 focus:outline-none focus:border-white/30 resize-none transition-all custom-scrollbar"})]}),l.jsxs("div",{role:"tablist",className:"flex flex-wrap gap-2 mb-8 bg-black/40 p-1 rounded-2xl border border-white/5",children:[ee("mode","Mode","settings_input_component"),ee("variables","Vars","data_object"),ee("behavior","Behavior","psychology"),ee("extraction","Extract","terminal"),ee("api","API","api"),ee("output","Output","table"),ee("schedule","Schedule","event_repeat"),ee("history","History","history")]}),l.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar pr-2 -mr-2",children:[j==="mode"&&l.jsx("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Execution Mode"}),l.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[l.jsxs("button",{onClick:()=>u({mode:"agent"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r.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:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:l.jsx(he,{name:"smart_toy",className:"text-white/60"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-bold text-white",children:"Agent Mode"}),l.jsx("div",{className:"text-[9px] text-gray-500",children:"Autonomous decision making"})]})]}),l.jsxs("button",{onClick:()=>u({mode:"scrape"}),className:`p-4 rounded-2xl border transition-all text-left space-y-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r.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:[l.jsx("div",{className:"w-8 h-8 rounded-full bg-white/10 flex items-center justify-center",children:l.jsx(he,{name:"api",className:"text-white/60"})}),l.jsxs("div",{children:[l.jsx("div",{className:"text-xs font-bold text-white",children:"Scrape Mode"}),l.jsx("div",{className:"text-[9px] text-gray-500",children:"Fixed data extraction flow"})]})]})]})]})}),j==="variables"&&l.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Task Variables"}),l.jsx("button",{onClick:B,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"+ Add Var"})]}),l.jsxs("div",{className:"space-y-3",children:[Object.entries(r.variables||{}).map(([H,ie])=>l.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[l.jsxs("div",{className:"flex gap-2",children:[l.jsx("input",{type:"text",defaultValue:H,onBlur:Ee=>{Ee.target.value!==H&&re(H,Ee.target.value,ie.type,ie.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"}),l.jsxs("select",{value:ie.type,onChange:Ee=>re(H,H,Ee.target.value,ie.value),className:"bg-black/40 border border-white/5 rounded-xl px-2 py-2 text-[10px] font-bold uppercase text-gray-500",children:[l.jsx("option",{value:"string",children:"String"}),l.jsx("option",{value:"number",children:"Number"}),l.jsx("option",{value:"boolean",children:"Bool"})]}),l.jsx("button",{onClick:()=>R(H),className:"text-red-500/50 hover:text-red-500 p-2 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg","aria-label":"Remove variable",title:"Remove variable",children:l.jsx(he,{name:"delete",className:"text-sm"})})]}),l.jsx("div",{className:"pl-1",children:ie.type==="boolean"?l.jsxs("select",{value:String(ie.value),onChange:Ee=>re(H,H,ie.type,Ee.target.value==="true"),className:"w-full bg-black/40 border border-white/5 rounded-xl px-3 py-2 text-xs text-white",children:[l.jsx("option",{value:"true",children:"True"}),l.jsx("option",{value:"false",children:"False"})]}):l.jsx("input",{type:ie.type==="number"?"number":"text",value:ie.value,onChange:Ee=>re(H,H,ie.type,ie.type==="number"?parseFloat(Ee.target.value):Ee.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"})})]},H)),Object.keys(r.variables||{}).length===0&&l.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:l.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No variables defined"})})]})]}),j==="behavior"&&l.jsxs("div",{className:"space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Runtime Flags"}),l.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:$},{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(H=>l.jsxs("button",{disabled:H.disabled,role:"switch","aria-checked":!!r[H.key],onClick:()=>u({[H.key]:!r[H.key]}),className:`flex items-center justify-between p-4 rounded-2xl border transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r[H.key]?"bg-white/10 border-white/30 text-white":"bg-white/5 border-white/5 text-gray-400 opacity-60 hover:opacity-100"} ${H.disabled?"opacity-20 cursor-not-allowed":""}`,children:[l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx(he,{name:H.icon,className:"text-sm opacity-70"}),l.jsx("span",{className:"text-xs font-medium",children:H.label})]}),l.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors ${r[H.key]?"bg-white":"bg-white/10"}`,children:l.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${r[H.key]?"right-1 bg-black":"left-1 bg-white/20"}`})})]},H.key))})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Stealth & Behavior"}),l.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(H=>l.jsxs("button",{role:"switch","aria-checked":!!r.stealth[H.key],onClick:()=>W(H.key),className:`flex flex-col gap-2 p-4 rounded-2xl border transition-all text-left focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${r.stealth[H.key]?"bg-white/15 border-white/40 text-white":"bg-white/5 border-white/5 text-gray-500 opacity-60 hover:opacity-100"}`,children:[l.jsx(he,{name:H.icon,className:"text-sm opacity-70"}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-tight",children:H.label})]},H.key))})]})]}),j==="extraction"&&l.jsx("div",{className:"space-y-6 h-full flex flex-col animate-in fade-in slide-in-from-bottom-2 duration-300",children:l.jsxs("div",{className:"space-y-4 flex-1 flex flex-col",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Post-Execution Script"}),l.jsxs("select",{value:r.extractionFormat||"json",onChange:H=>u({extractionFormat:H.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:[l.jsx("option",{value:"json",children:"JSON"}),l.jsx("option",{value:"csv",children:"CSV"})]})]}),l.jsx("div",{className:"flex-1 bg-black/40 border border-white/5 rounded-2xl overflow-hidden min-h-[300px]",children:l.jsx(xn,{language:"javascript",value:r.extractionScript||"",onChange:H=>u({extractionScript:H}),placeholder:"// Example: return { title: document.title };",className:"h-full text-[11px]"})})]})}),j==="api"&&l.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Trigger via API"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-[10px] text-gray-500",children:"Run this task from external tools using the endpoint below:"}),l.jsxs("div",{className:"relative group",children:[l.jsxs("div",{className:"bg-black/40 border border-white/10 rounded-xl p-4 pr-12 font-mono text-[10px] text-white/80 break-all border-dashed",children:["POST /api/tasks/",r.id,"/api"]}),l.jsx(kl,{text:`POST /api/tasks/${r.id}/api`,className:"absolute right-2 top-2 p-2 rounded-lg bg-white/5 border border-white/10 text-white opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all",iconClassName:"text-xs",title:"Copy Endpoint"})]})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Response Options"}),l.jsxs("button",{role:"switch","aria-checked":r.includeHtml,onClick:()=>u({includeHtml:!r.includeHtml}),className:"w-full flex items-center justify-between p-3 rounded-xl bg-black/20 border border-white/5 hover:bg-white/5 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("span",{className:"text-xs font-medium",children:"Include HTML in response"}),l.jsx("p",{className:"text-[9px] text-gray-500 mt-0.5",children:"When an extraction script is set, also return the raw HTML"})]}),l.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors flex-shrink-0 ${r.includeHtml?"bg-white":"bg-white/10"}`,children:l.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${r.includeHtml?"right-1 bg-black":"left-1 bg-white/20"}`})})]})]}),l.jsxs("div",{className:"space-y-4",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Passing Variables"}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-[10px] text-gray-500",children:"You can override task variables in the request body:"}),l.jsxs("div",{className:"relative group",children:[l.jsx("div",{className:"bg-black/40 border border-white/5 rounded-xl p-4 pr-12 font-mono text-[10px] text-white/60",children:l.jsx("pre",{children:JSON.stringify({variables:Object.fromEntries(Object.entries(r.variables||{}).slice(0,2).map(([H,ie])=>[H,ie.value]))},null,2)})}),l.jsx(kl,{text:JSON.stringify({variables:Object.fromEntries(Object.entries(r.variables||{}).slice(0,2).map(([H,ie])=>[H,ie.value]))},null,2),className:"absolute right-2 top-2 p-2 rounded-lg bg-white/5 border border-white/10 text-white opacity-0 group-hover:opacity-100 focus-visible:opacity-100 transition-all",iconClassName:"text-xs",title:"Copy Payload"})]})]})]})]}),j==="output"&&l.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("button",{role:"switch","aria-checked":!!r.output,onClick:()=>u({output:r.output?void 0:{provider:"baserow",credentialId:"",tableId:"",onError:"ignore"}}),className:"w-full flex items-center justify-between p-3 rounded-xl bg-black/20 border border-white/5 hover:bg-white/5 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[l.jsxs("div",{className:"text-left",children:[l.jsx("span",{className:"text-xs font-medium",children:"Push results to destination"}),l.jsx("p",{className:"text-[9px] text-gray-500 mt-0.5",children:"Send extracted data to an external table after each run"})]}),l.jsx("div",{className:`w-8 h-4 rounded-full relative transition-colors flex-shrink-0 ${r.output?"bg-white":"bg-white/10"}`,children:l.jsx("div",{className:`absolute top-1 w-2 h-2 rounded-full transition-all ${r.output?"right-1 bg-black":"left-1 bg-white/20"}`})})]}),r.output&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Provider"}),l.jsx("select",{value:r.output.provider,onChange:H=>u({output:{...r.output,provider:H.target.value,credentialId:"",tableId:""}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",children:l.jsx("option",{value:"baserow",children:"Baserow"})})]}),l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Credential"}),l.jsxs("button",{onClick:()=>y(H=>!H),className:"text-[9px] font-bold text-gray-400 hover:text-white transition-colors flex items-center gap-1 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded",children:[l.jsx(he,{name:"add",className:"text-xs"}),"New"]})]}),S&&l.jsxs("div",{className:"space-y-2 p-3 rounded-xl bg-black/40 border border-white/5",children:[l.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"Name (e.g. My Baserow)",value:m.name,onChange:H=>b(ie=>({...ie,name:H.target.value}))}),l.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"Base URL",value:m.baseUrl,onChange:H=>b(ie=>({...ie,baseUrl:H.target.value}))}),l.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"API Token",type:"password",value:m.token,onChange:H=>b(ie=>({...ie,token:H.target.value}))}),l.jsxs("div",{className:"flex gap-2",children:[l.jsx("button",{onClick:Q,disabled:k||!m.name||!m.token,className:"flex-1 py-1.5 rounded-lg bg-white text-black text-[10px] font-bold disabled:opacity-40 transition-opacity focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:k?"Saving…":"Save"}),l.jsx("button",{onClick:()=>y(!1),className:"px-3 py-1.5 rounded-lg bg-white/5 text-gray-400 text-[10px] font-bold hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Cancel"})]})]}),(()=>{const H=v.filter(ie=>ie.provider===r.output?.provider);return H.length===0&&!S?l.jsxs("p",{className:"text-[10px] text-gray-600",children:["No credentials yet. Click ",l.jsx("span",{className:"text-gray-400",children:"+ New"})," to add one."]}):l.jsxs("select",{value:r.output.credentialId,onChange:ie=>u({output:{...r.output,credentialId:ie.target.value}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",children:[l.jsx("option",{value:"",children:"Select credential…"}),H.map(ie=>l.jsx("option",{value:ie.id,children:ie.name},ie.id))]})})(),v.filter(H=>H.provider===r.output?.provider).length>0&&l.jsx("div",{className:"space-y-1",children:v.filter(H=>H.provider===r.output?.provider).map(H=>l.jsxs("div",{className:"flex items-center justify-between px-3 py-1.5 rounded-lg bg-black/20 border border-white/5",children:[l.jsxs("div",{children:[l.jsx("span",{className:"text-[10px] text-white",children:H.name}),l.jsx("span",{className:"text-[9px] text-gray-600 ml-2",children:H.config.baseUrl})]}),l.jsx("button",{onClick:()=>Ne(H.id),className:"text-gray-600 hover:text-red-400 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded",children:l.jsx(he,{name:"delete",className:"text-sm"})})]},H.id))})]}),r.output.credentialId&&ae&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Database"}),V&&l.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),l.jsxs("select",{value:r.output.databaseId||"",onChange:H=>u({output:{...r.output,databaseId:H.target.value,tableId:""}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",disabled:V,children:[l.jsx("option",{value:"",children:"Select database…"}),O.map(H=>l.jsx("option",{value:H.id,children:H.name},H.id))]})]}),r.output.databaseId&&l.jsxs("div",{className:"space-y-2",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Table"}),oe&&l.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),l.jsxs("select",{value:r.output.tableId,onChange:H=>u({output:{...r.output,tableId:H.target.value}}),className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white focus:outline-none focus:border-white/20",disabled:oe,children:[l.jsx("option",{value:"",children:"Select table…"}),T.map(H=>l.jsx("option",{value:H.id,children:H.name},H.id))]})]})]}),r.output.credentialId&&!ae&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Table ID"}),l.jsx("input",{className:"w-full bg-black/40 border border-white/5 rounded-lg px-3 py-2 text-xs text-white placeholder-gray-600 focus:outline-none focus:border-white/20",placeholder:"e.g. 1234",value:r.output.tableId,onChange:H=>u({output:{...r.output,tableId:H.target.value}})}),l.jsxs("p",{className:"text-[9px] text-gray-600",children:["Your token doesn't support browsing. Use a ",l.jsx("span",{className:"text-gray-400",children:"Personal API Token"})," for dropdowns, or enter the Table ID from the Baserow URL."]})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"On Push Error"}),l.jsx("div",{className:"flex gap-2",children:["ignore","fail"].map(H=>l.jsx("button",{onClick:()=>u({output:{...r.output,onError:H}}),className:`flex-1 py-2 rounded-lg text-[10px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${r.output?.onError===H?"bg-white text-black focus-visible:ring-blue-500":"bg-white/5 text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:H==="ignore"?"Ignore":"Log Error"},H))}),l.jsx("p",{className:"text-[9px] text-gray-600",children:r.output.onError==="fail"?"Push errors will be logged prominently in the server console.":"Push errors will be silently suppressed."})]})]})]}),j==="schedule"&&l.jsx(db,{currentTask:r,onUpdateTask:u}),j==="history"&&l.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-2 duration-300",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Version History"}),x&&l.jsx("div",{className:"w-3 h-3 border-2 border-white/20 border-t-white rounded-full animate-spin"})]}),l.jsxs("div",{className:"space-y-2",children:[p.map(H=>l.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:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("div",{className:"text-xs font-bold text-white mb-0.5",children:new Date(H.timestamp).toLocaleString()}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-[9px] px-1.5 py-0.5 rounded bg-white/10 text-gray-400 font-bold uppercase tracking-widest",children:H.mode}),l.jsx("span",{className:"text-[9px] text-gray-600 truncate max-w-[150px]",children:H.name||"Untitled"})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:()=>C(H.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Preview version","aria-label":"Preview version",children:l.jsx(he,{name:"visibility",className:"text-sm"})}),l.jsx("button",{onClick:()=>g(H.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Rollback to this version","aria-label":"Rollback to this version",children:l.jsx(he,{name:"restore",className:"text-sm"})})]})]},H.id)),p.length===0&&!x&&l.jsx("div",{className:"text-center py-12 border border-dashed border-white/10 rounded-3xl",children:l.jsx("p",{className:"text-[10px] text-gray-600 uppercase tracking-widest",children:"No previous versions found"})})]})]})]})]})]})},hb=()=>{const[i,c]=A.useState({x:0,y:0}),[r,u]=A.useState(1),f=A.useRef(!1),d=A.useRef({x:0,y:0,offsetX:0,offsetY:0}),h=A.useRef(!1),p=A.useRef(null),x=A.useRef(!1),g=A.useRef(r);A.useEffect(()=>{g.current=r},[r]),A.useEffect(()=>{if(x.current)return;x.current=!0;const v=p.current;if(!v)return;const _=v.clientWidth;c({x:(_-400)/2,y:20})},[]),A.useEffect(()=>{const v=p.current;if(!v)return;const _=m=>{if(m.preventDefault(),m.ctrlKey||m.metaKey){const b=v.getBoundingClientRect(),S=m.clientX-b.left,y=m.clientY-b.top,k=g.current,U=m.deltaY<0?1.1:.9,O=Math.min(2,Math.max(.25,k*U)),M=O/k;c(T=>({x:S-M*(S-T.x),y:y-M*(y-T.y)})),u(O)}else c(b=>({x:b.x-m.deltaX,y:b.y-m.deltaY}))};return v.addEventListener("wheel",_,{passive:!1}),()=>v.removeEventListener("wheel",_)},[]);const C=A.useCallback(v=>{f.current=!0,d.current={x:v.clientX,y:v.clientY,offsetX:i.x,offsetY:i.y},v.target.setPointerCapture?.(v.pointerId)},[i]),j=A.useCallback(v=>{if(!f.current)return;const _=v.clientX-d.current.x,m=v.clientY-d.current.y;c({x:d.current.offsetX+_,y:d.current.offsetY+m})},[]),E=A.useCallback(()=>{f.current=!1},[]);return{canvasOffset:i,setCanvasOffset:c,canvasScale:r,setCanvasScale:u,canvasViewportRef:p,spaceHeldRef:h,isPanning:f,startPanning:C,handlePanning:j,stopPanning:E}},_i=i=>{if(!i)return"";const{last_opened:c,versions:r,...u}=i;return JSON.stringify(u)},rr=i=>{if(typeof i=="boolean")return i;if(i==null)return!1;const c=String(i).toLowerCase();return c==="true"||c==="1"},pb=i=>i&&i[0].toUpperCase()+i.slice(1),Zp=i=>{if(!i.actions||!Array.isArray(i.actions))return i;let c=!1;const r=i.actions.map((u,f)=>u.id?u:(c=!0,{...u,id:`act_${Date.now()}_${f}_${Math.floor(Math.random()*1e3)}`}));return c?{...i,actions:r}:i},mb=()=>({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}),xb=(i,c)=>{if(!i||typeof i!="object")return null;const r=mb(),u={...r,...i};return(!u.name||typeof u.name!="string")&&(u.name=`Imported Task ${c+1}`),(!u.mode||!["scrape","agent","headful"].includes(u.mode))&&(u.mode="scrape"),typeof u.wait!="number"&&(u.wait=3),u.stealth||(u.stealth=r.stealth),(!u.variables||Array.isArray(u.variables))&&(u.variables={}),Array.isArray(u.actions)||(u.actions=[]),u.rotateProxies===void 0&&(u.rotateProxies=!1),u.disableRecording===void 0&&(u.disableRecording=!1),u.disableRecording=rr(u.disableRecording),u.statelessExecution===void 0&&(u.statelessExecution=!1),u.statelessExecution=rr(u.statelessExecution),delete u.versions,delete u.last_opened,u},gb=()=>({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",includeHtml:!1,includeShadowDom:!0,disableRecording:!1,statelessExecution:!1}),bb=(i,c,r)=>{const u=A.useRef([]),f=A.useRef(-1),d=A.useRef(!1),h=A.useRef("");A.useEffect(()=>{if(d.current){d.current=!1;return}const g=_i(i);if(g===h.current)return;const C=setTimeout(()=>{h.current=g,f.current<u.current.length-1&&(u.current=u.current.slice(0,f.current+1)),u.current.push(JSON.parse(g)),f.current=u.current.length-1,u.current.length>50&&(u.current.shift(),f.current-=1)},300);return()=>clearTimeout(C)},[i]);const p=A.useCallback(()=>{if(f.current>0){f.current-=1;const C={...u.current[f.current],versions:i.versions,last_opened:Date.now()};d.current=!0,h.current=_i(C),c(C),r(C,!1)}},[c,r,i.versions]),x=A.useCallback(()=>{if(f.current<u.current.length-1){f.current+=1;const C={...u.current[f.current],versions:i.versions,last_opened:Date.now()};d.current=!0,h.current=_i(C),c(C),r(C,!1)}},[c,r,i.versions]);return A.useEffect(()=>{const g=C=>{const j=document.activeElement;if(j){const v=j.tagName.toLowerCase(),_=j.getAttribute("contenteditable")==="true";if(v==="input"||v==="textarea"||_)return}const E=C.metaKey||C.ctrlKey;E&&C.key.toLowerCase()==="z"?(C.preventDefault(),C.shiftKey?x():p()):E&&!C.shiftKey&&C.key.toLowerCase()==="y"&&(C.preventDefault(),x())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[p,x]),{undo:p,redo:x}},yb=(i,c,r)=>{const[u,f]=A.useState(new Set),[d,h]=A.useState(null),[p,x]=A.useState(null),g=A.useRef(null),C=A.useCallback((b,S,y=!1)=>{c(y?k=>{if(!k)return null;const U={...k,actions:k.actions.map(O=>O.id===b?{...O,...S}:O)};return r(U,!1),U}:k=>k?{...k,actions:k.actions.map(U=>U.id===b?{...U,...S}:U)}:null)},[c,r]),j=A.useCallback((b,S)=>{b!==S&&c(y=>{if(!y)return null;const k=[...y.actions],U=k.findIndex(Z=>Z.id===b),O=k.findIndex(Z=>Z.id===S);if(U===-1||O===-1)return y;const[M]=k.splice(U,1);k.splice(O,0,M);const T={...y,actions:k};return r(T,!1),T})},[c,r]),E=A.useCallback(b=>{c(S=>{if(!S)return null;const y={...S,actions:S.actions.filter(k=>k.id!==b)};return r(y,!1),y})},[c,r]),v=A.useCallback((b,S,y,k)=>{if(y!==void 0&&k!==void 0&&Math.abs(b-k)<14)return y;const U=i.actions;let O=U.length-1;for(let M=0;M<U.length;M++){if(U[M].id===S)continue;const T=document.getElementById(`action-${U[M].id}`);if(!T)continue;const Z=T.getBoundingClientRect(),V=Z.top+Z.height*.4;if(b<V){O=M;break}}return O},[i.actions]),_=A.useCallback(()=>{if(d){if(p!==null&&p!==d.index){const b=i.actions[p]?.id;b&&j(d.id,b)}h(null),x(null),g.current=null}},[d,p,i.actions,j]),m=A.useCallback((b,S,y)=>{if(b.shiftKey||b.ctrlKey||b.metaKey){f(O=>{const M=new Set(O);return M.has(S)?M.delete(S):M.add(S),M});return}f(new Set([S]));const k=document.getElementById(`action-${S}`);if(!k)return;const U=k.getBoundingClientRect();g.current=b.pointerId,h({id:S,startY:b.clientY,currentY:b.clientY,height:U.height,index:y,originTop:U.top,pointerOffset:b.clientY-U.top}),x(y)},[]);return A.useEffect(()=>{if(!d)return;const b=y=>{if(g.current!==null&&y.pointerId!==g.current)return;const k=d.originTop+d.height/2,U=v(y.clientY,d.id,d.index,k);h(O=>O&&{...O,currentY:y.clientY}),x(U)},S=y=>{g.current!==null&&y.pointerId!==g.current||_()};return window.addEventListener("pointermove",b),window.addEventListener("pointerup",S),window.addEventListener("pointercancel",S),()=>{window.removeEventListener("pointermove",b),window.removeEventListener("pointerup",S),window.removeEventListener("pointercancel",S)}},[d,v,_]),{selectedActionIds:u,setSelectedActionIds:f,dragState:d,dragOverIndex:p,updateAction:C,moveAction:j,removeAction:E,handleActionPointerDown:m}},vb=(i,c,r,u)=>{const[f,d]=A.useState([]),[h,p]=A.useState(!1),[x,g]=A.useState(null),C=A.useCallback(async()=>{if(i.id){p(!0);try{const v=await fetch(`/api/tasks/${i.id}/versions`);if(!v.ok)throw new Error("Failed to load versions");const _=await v.json();d(Array.isArray(_.versions)?_.versions:[])}catch{d([])}finally{p(!1)}}},[i.id]),j=A.useCallback(async v=>{if(!(!i.id||!await r("Rollback to this version? Current changes will be saved as a new version.")))try{const m=await fetch(`/api/tasks/${i.id}/rollback`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({versionId:v})});if(!m.ok)throw new Error("Rollback failed");const b=await m.json();u(b),c("Rolled back to selected version.","success"),C()}catch{c("Rollback failed.","error")}},[i.id,r,c,u,C]),E=A.useCallback(async v=>{if(i.id)try{const _=await fetch(`/api/tasks/${i.id}/versions/${v}`);if(!_.ok)throw new Error("Failed to load version");const m=await _.json();if(!m?.snapshot)throw new Error("Missing snapshot");g({id:m.metadata?.id||v,timestamp:m.metadata?.timestamp||Date.now(),snapshot:m.snapshot})}catch{c("Failed to load version snapshot.","error")}},[i.id,c]);return{versions:f,versionsLoading:h,versionPreview:x,setVersionPreview:g,loadVersions:C,rollbackToVersion:j,openVersionPreview:E}},wb=(i,c,r,u,f)=>{const[d,h]=A.useState(!1),[p,x]=A.useState(!1),[g,C]=A.useState(null),[j,E]=A.useState({}),v=A.useRef(null);A.useEffect(()=>{v.current=g},[g]);const _=A.useRef(f);A.useEffect(()=>{_.current=f},[f]),A.useEffect(()=>{c?v.current&&h(!0):(h(!1),x(!1))},[c]),A.useEffect(()=>{let b=null;return c&&(b=new EventSource("/api/headful/selector_stream"),b.onmessage=S=>{try{const y=JSON.parse(S.data),k=v.current;if(y.selector&&k){try{const U=JSON.parse(y.selector);Array.isArray(U)&&U.length>0?(E(O=>({...O,[k]:U})),r(k,{selector:U[0]},!0)):r(k,{selector:y.selector},!0)}catch{r(k,{selector:y.selector},!0)}C(null),_.current?.()}}catch{}}),()=>{b&&b.close()}},[c,r]);const m=A.useCallback(async()=>{const b=!d;x(!0);try{if(!(await fetch("/api/headful/inspect",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({enabled:b})})).ok)throw new Error("Failed to toggle inspect mode");h(b),u(`Inspect mode ${b?"enabled":"disabled"}`,"success")}catch{u("Failed to toggle inspect mode","error")}finally{x(!1)}},[d,u]);return{isInspectMode:d,isInspectLoading:p,activeInspectActionId:g,setActiveInspectActionId:C,selectorOptionsById:j,handleToggleInspect:m}},jb=()=>{const[i,c]=A.useState([]),[r,u]=A.useState(!1);return A.useEffect(()=>{let f=!1;return(async()=>{try{const h=await fetch("/api/settings/proxies",{credentials:"include"});if(!h.ok)throw new Error("Failed to load proxies");const p=await h.json();if(f)return;c(Array.isArray(p.proxies)?p.proxies:[])}catch{f||c([])}finally{f||u(!0)}})(),()=>{f=!0}},[]),{proxyList:i,proxyListLoaded:r}},Sb=({currentTask:i,onUpdateTaskName:c,onAutoSave:r,onOpenHistory:u})=>l.jsx("div",{className:"fixed top-0 left-0 right-0 z-40 w-full pointer-events-none",children:l.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:[l.jsx("div",{className:"flex-1 overflow-hidden flex justify-center",children:l.jsx("input",{type:"text",value:i.name||"",onChange:f=>c(f.target.value),onBlur:()=>r(),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"})}),l.jsx("div",{className:"flex items-center gap-1",children:l.jsx("button",{onClick:u,className:"w-8 h-8 rounded-lg flex items-center justify-center text-white/30 hover:text-white hover:bg-white/5 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Version History","aria-label":"Version History",children:l.jsx(he,{name:"history",className:"text-base"})})})]})}),Nb=({isExecuting:i,isHeadfulOpen:c,onRun:r,onStop:u,onOpenHeadful:f,onStopHeadful:d})=>l.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:[l.jsxs("button",{onClick:r,disabled:i||c,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] focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",title:"Run Task (Ctrl + Enter)","aria-label":"Run Task (Ctrl + Enter)",children:[i?l.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}):l.jsx(he,{name:"play_arrow",className:"text-sm text-black"}),l.jsx("span",{children:i?"Running...":"Run Task"})]}),i&&l.jsx("button",{onClick:()=>u?.(),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:l.jsx(he,{name:"stop",className:"text-base"})}),l.jsxs("button",{onClick:()=>{c?d?.():f()},disabled:i,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 ${c?"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:c?"Stop headful browser":"Open browser to log in",children:[l.jsx(he,{name:c?"stop":"open_in_browser",className:"text-base"}),c?"Close Browser":"Open Browser"]})]});function qc(){return qc=Object.assign?Object.assign.bind():function(i){for(var c=1;c<arguments.length;c++){var r=arguments[c];for(var u in r)({}).hasOwnProperty.call(r,u)&&(i[u]=r[u])}return i},qc.apply(null,arguments)}function ip(i){if(i===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return i}function Kc(i,c){return Kc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(r,u){return r.__proto__=u,r},Kc(i,c)}function _b(i,c){i.prototype=Object.create(c.prototype),i.prototype.constructor=i,Kc(i,c)}var sp=Number.isNaN||function(c){return typeof c=="number"&&c!==c};function Cb(i,c){return!!(i===c||sp(i)&&sp(c))}function kb(i,c){if(i.length!==c.length)return!1;for(var r=0;r<i.length;r++)if(!Cb(i[r],c[r]))return!1;return!0}function Dc(i,c){c===void 0&&(c=kb);var r,u=[],f,d=!1;function h(){for(var p=[],x=0;x<arguments.length;x++)p[x]=arguments[x];return d&&r===this&&c(p,u)||(f=i.apply(this,p),d=!0,r=this,u=p),f}return h}var Eb=typeof performance=="object"&&typeof performance.now=="function",rp=Eb?function(){return performance.now()}:function(){return Date.now()};function op(i){cancelAnimationFrame(i.id)}function Ab(i,c){var r=rp();function u(){rp()-r>=c?i.call(null):f.id=requestAnimationFrame(u)}var f={id:requestAnimationFrame(u)};return f}var Tc=-1;function cp(i){if(i===void 0&&(i=!1),Tc===-1||i){var c=document.createElement("div"),r=c.style;r.width="50px",r.height="50px",r.overflow="scroll",document.body.appendChild(c),Tc=c.offsetWidth-c.clientWidth,document.body.removeChild(c)}return Tc}var _l=null;function up(i){if(i===void 0&&(i=!1),_l===null||i){var c=document.createElement("div"),r=c.style;r.width="50px",r.height="50px",r.overflow="scroll",r.direction="rtl";var u=document.createElement("div"),f=u.style;return f.width="100px",f.height="100px",c.appendChild(u),document.body.appendChild(c),c.scrollLeft>0?_l="positive-descending":(c.scrollLeft=1,c.scrollLeft===0?_l="negative":_l="positive-ascending"),document.body.removeChild(c),_l}return _l}var zb=150,Rb=function(c,r){return c};function Ob(i){var c,r=i.getItemOffset,u=i.getEstimatedTotalSize,f=i.getItemSize,d=i.getOffsetForIndexAndAlignment,h=i.getStartIndexForOffset,p=i.getStopIndexForStartIndex,x=i.initInstanceProps,g=i.shouldResetStyleCacheOnItemSizeChange,C=i.validateProps;return c=(function(j){_b(E,j);function E(_){var m;return m=j.call(this,_)||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=Dc(function(b,S,y,k){return m.props.onItemsRendered({overscanStartIndex:b,overscanStopIndex:S,visibleStartIndex:y,visibleStopIndex:k})}),m._callOnScroll=void 0,m._callOnScroll=Dc(function(b,S,y){return m.props.onScroll({scrollDirection:b,scrollOffset:S,scrollUpdateWasRequested:y})}),m._getItemStyle=void 0,m._getItemStyle=function(b){var S=m.props,y=S.direction,k=S.itemSize,U=S.layout,O=m._getItemStyleCache(g&&k,g&&U,g&&y),M;if(O.hasOwnProperty(b))M=O[b];else{var T=r(m.props,b,m._instanceProps),Z=f(m.props,b,m._instanceProps),V=y==="horizontal"||U==="horizontal",ue=y==="rtl",oe=V?T:0;O[b]=M={position:"absolute",left:ue?void 0:oe,right:ue?oe:void 0,top:V?0:T,height:V?"100%":Z,width:V?Z:"100%"}}return M},m._getItemStyleCache=void 0,m._getItemStyleCache=Dc(function(b,S,y){return{}}),m._onScrollHorizontal=function(b){var S=b.currentTarget,y=S.clientWidth,k=S.scrollLeft,U=S.scrollWidth;m.setState(function(O){if(O.scrollOffset===k)return null;var M=m.props.direction,T=k;if(M==="rtl")switch(up()){case"negative":T=-k;break;case"positive-descending":T=U-y-k;break}return T=Math.max(0,Math.min(T,U-y)),{isScrolling:!0,scrollDirection:O.scrollOffset<T?"forward":"backward",scrollOffset:T,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._onScrollVertical=function(b){var S=b.currentTarget,y=S.clientHeight,k=S.scrollHeight,U=S.scrollTop;m.setState(function(O){if(O.scrollOffset===U)return null;var M=Math.max(0,Math.min(U,k-y));return{isScrolling:!0,scrollDirection:O.scrollOffset<M?"forward":"backward",scrollOffset:M,scrollUpdateWasRequested:!1}},m._resetIsScrollingDebounced)},m._outerRefSetter=function(b){var S=m.props.outerRef;m._outerRef=b,typeof S=="function"?S(b):S!=null&&typeof S=="object"&&S.hasOwnProperty("current")&&(S.current=b)},m._resetIsScrollingDebounced=function(){m._resetIsScrollingTimeoutId!==null&&op(m._resetIsScrollingTimeoutId),m._resetIsScrollingTimeoutId=Ab(m._resetIsScrolling,zb)},m._resetIsScrolling=function(){m._resetIsScrollingTimeoutId=null,m.setState({isScrolling:!1},function(){m._getItemStyleCache(-1,null)})},m}E.getDerivedStateFromProps=function(m,b){return Db(m,b),C(m),null};var v=E.prototype;return v.scrollTo=function(m){m=Math.max(0,m),this.setState(function(b){return b.scrollOffset===m?null:{scrollDirection:b.scrollOffset<m?"forward":"backward",scrollOffset:m,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},v.scrollToItem=function(m,b){b===void 0&&(b="auto");var S=this.props,y=S.itemCount,k=S.layout,U=this.state.scrollOffset;m=Math.max(0,Math.min(m,y-1));var O=0;if(this._outerRef){var M=this._outerRef;k==="vertical"?O=M.scrollWidth>M.clientWidth?cp():0:O=M.scrollHeight>M.clientHeight?cp():0}this.scrollTo(d(this.props,m,b,U,this._instanceProps,O))},v.componentDidMount=function(){var m=this.props,b=m.direction,S=m.initialScrollOffset,y=m.layout;if(typeof S=="number"&&this._outerRef!=null){var k=this._outerRef;b==="horizontal"||y==="horizontal"?k.scrollLeft=S:k.scrollTop=S}this._callPropsCallbacks()},v.componentDidUpdate=function(){var m=this.props,b=m.direction,S=m.layout,y=this.state,k=y.scrollOffset,U=y.scrollUpdateWasRequested;if(U&&this._outerRef!=null){var O=this._outerRef;if(b==="horizontal"||S==="horizontal")if(b==="rtl")switch(up()){case"negative":O.scrollLeft=-k;break;case"positive-ascending":O.scrollLeft=k;break;default:var M=O.clientWidth,T=O.scrollWidth;O.scrollLeft=T-M-k;break}else O.scrollLeft=k;else O.scrollTop=k}this._callPropsCallbacks()},v.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&op(this._resetIsScrollingTimeoutId)},v.render=function(){var m=this.props,b=m.children,S=m.className,y=m.direction,k=m.height,U=m.innerRef,O=m.innerElementType,M=m.innerTagName,T=m.itemCount,Z=m.itemData,V=m.itemKey,ue=V===void 0?Rb:V,oe=m.layout,Y=m.outerElementType,ae=m.outerTagName,z=m.style,I=m.useIsScrolling,X=m.width,Q=this.state.isScrolling,Ne=y==="horizontal"||oe==="horizontal",$=Ne?this._onScrollHorizontal:this._onScrollVertical,re=this._getRangeToRender(),R=re[0],B=re[1],W=[];if(T>0)for(var ee=R;ee<=B;ee++)W.push(A.createElement(b,{data:Z,key:ue(ee,Z),index:ee,isScrolling:I?Q:void 0,style:this._getItemStyle(ee)}));var H=u(this.props,this._instanceProps);return A.createElement(Y||ae||"div",{className:S,onScroll:$,ref:this._outerRefSetter,style:qc({position:"relative",height:k,width:X,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:y},z)},A.createElement(O||M||"div",{children:W,ref:U,style:{height:Ne?"100%":H,pointerEvents:Q?"none":void 0,width:Ne?H:"100%"}}))},v._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var m=this.props.itemCount;if(m>0){var b=this._getRangeToRender(),S=b[0],y=b[1],k=b[2],U=b[3];this._callOnItemsRendered(S,y,k,U)}}if(typeof this.props.onScroll=="function"){var O=this.state,M=O.scrollDirection,T=O.scrollOffset,Z=O.scrollUpdateWasRequested;this._callOnScroll(M,T,Z)}},v._getRangeToRender=function(){var m=this.props,b=m.itemCount,S=m.overscanCount,y=this.state,k=y.isScrolling,U=y.scrollDirection,O=y.scrollOffset;if(b===0)return[0,0,0,0];var M=h(this.props,O,this._instanceProps),T=p(this.props,M,O,this._instanceProps),Z=!k||U==="backward"?Math.max(1,S):1,V=!k||U==="forward"?Math.max(1,S):1;return[Math.max(0,M-Z),Math.max(0,Math.min(b-1,T+V)),M,T]},E})(A.PureComponent),c.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},c}var Db=function(c,r){c.children,c.direction,c.height,c.layout,c.innerTagName,c.outerTagName,c.width,r.instance},dr=Ob({getItemOffset:function(c,r){var u=c.itemSize;return r*u},getItemSize:function(c,r){var u=c.itemSize;return u},getEstimatedTotalSize:function(c){var r=c.itemCount,u=c.itemSize;return u*r},getOffsetForIndexAndAlignment:function(c,r,u,f,d,h){var p=c.direction,x=c.height,g=c.itemCount,C=c.itemSize,j=c.layout,E=c.width,v=p==="horizontal"||j==="horizontal",_=v?E:x,m=Math.max(0,g*C-_),b=Math.min(m,r*C),S=Math.max(0,r*C-_+C+h);switch(u==="smart"&&(f>=S-_&&f<=b+_?u="auto":u="center"),u){case"start":return b;case"end":return S;case"center":{var y=Math.round(S+(b-S)/2);return y<Math.ceil(_/2)?0:y>m+Math.floor(_/2)?m:y}default:return f>=S&&f<=b?f:f<S?S:b}},getStartIndexForOffset:function(c,r){var u=c.itemCount,f=c.itemSize;return Math.max(0,Math.min(u-1,Math.floor(r/f)))},getStopIndexForStartIndex:function(c,r,u){var f=c.direction,d=c.height,h=c.itemCount,p=c.itemSize,x=c.layout,g=c.width,C=f==="horizontal"||x==="horizontal",j=r*p,E=C?g:d,v=Math.ceil((E+u-j)/p);return Math.max(0,Math.min(h-1,r+v-1))},initInstanceProps:function(c){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(c){c.itemSize}});const Tb=(i,c=2)=>{if(i===0)return"0 B";const r=1024,u=c<0?0:c,f=["B","KB","MB","GB","TB","PB","EB","ZB","YB"],d=Math.floor(Math.log(i)/Math.log(r));return parseFloat((i/Math.pow(r,d)).toFixed(u))+" "+f[d]},Mb=({capture:i,onDelete:c})=>{const r=new URL(i.url,window.location.origin).toString();return l.jsxs("div",{className:"rounded-2xl border border-white/10 bg-white/[0.02] overflow-hidden",children:[l.jsxs("div",{className:"p-3 border-b border-white/10 flex items-center justify-between",children:[l.jsxs("div",{className:"text-[9px] font-bold text-white uppercase tracking-widest flex items-center gap-1.5",children:[l.jsx(he,{name:i.type==="recording"?"play_circle":"photo_camera",className:"text-xs text-white/50"}),i.type==="recording"?"Recording":"Screenshot"]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx(kl,{text:r,title:"Copy URL",className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all",iconClassName:"text-sm"}),l.jsx("a",{href:i.url,download:i.name,className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Download","aria-label":"Download capture",children:l.jsx(he,{name:"download",className:"text-sm"})}),l.jsx("a",{href:i.url,target:"_blank",rel:"noreferrer",className:"p-1.5 rounded-lg text-white/50 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Open in new tab","aria-label":"Open capture in new tab",children:l.jsx(he,{name:"open_in_new",className:"text-sm"})}),c&&l.jsx("button",{onClick:()=>c(i.name),className:"p-1.5 rounded-lg text-red-300 hover:text-red-200 hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Delete","aria-label":"Delete capture",children:l.jsx(he,{name:"delete",className:"text-sm"})})]})]}),l.jsx("div",{className:"bg-black relative group",children:i.type==="recording"?l.jsx("video",{src:i.url,controls:!0,className:"w-full h-64 object-contain bg-black"}):l.jsx("img",{src:i.url,className:"w-full h-64 object-contain bg-black",alt:`Screenshot of ${i.name}`})}),l.jsxs("div",{className:"p-3 border-t border-white/5 bg-white/[0.01]",children:[l.jsx("div",{className:"text-[9px] text-white font-bold uppercase tracking-widest truncate",title:i.name,children:i.name}),l.jsxs("div",{className:"flex items-center justify-between mt-1 text-[8px] text-gray-500 uppercase tracking-widest",children:[l.jsx("span",{children:Tb(i.size)}),l.jsx("span",{children:new Date(i.modified).toLocaleDateString()})]})]})]})},$p=tt.memo(Mb);function Zs(i){throw new Error('Could not dynamically require "'+i+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Mc={exports:{}};var dp;function Ub(){return dp||(dp=1,(function(i,c){(function(r){i.exports=r()})(function(){return(function r(u,f,d){function h(g,C){if(!f[g]){if(!u[g]){var j=typeof Zs=="function"&&Zs;if(!C&&j)return j(g,!0);if(p)return p(g,!0);var E=new Error("Cannot find module '"+g+"'");throw E.code="MODULE_NOT_FOUND",E}var v=f[g]={exports:{}};u[g][0].call(v.exports,function(_){var m=u[g][1][_];return h(m||_)},v,v.exports,r,u,f,d)}return f[g].exports}for(var p=typeof Zs=="function"&&Zs,x=0;x<d.length;x++)h(d[x]);return h})({1:[function(r,u,f){var d=r("./utils"),h=r("./support"),p="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";f.encode=function(x){for(var g,C,j,E,v,_,m,b=[],S=0,y=x.length,k=y,U=d.getTypeOf(x)!=="string";S<x.length;)k=y-S,j=U?(g=x[S++],C=S<y?x[S++]:0,S<y?x[S++]:0):(g=x.charCodeAt(S++),C=S<y?x.charCodeAt(S++):0,S<y?x.charCodeAt(S++):0),E=g>>2,v=(3&g)<<4|C>>4,_=1<k?(15&C)<<2|j>>6:64,m=2<k?63&j:64,b.push(p.charAt(E)+p.charAt(v)+p.charAt(_)+p.charAt(m));return b.join("")},f.decode=function(x){var g,C,j,E,v,_,m=0,b=0,S="data:";if(x.substr(0,S.length)===S)throw new Error("Invalid base64 input, it looks like a data url.");var y,k=3*(x=x.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(x.charAt(x.length-1)===p.charAt(64)&&k--,x.charAt(x.length-2)===p.charAt(64)&&k--,k%1!=0)throw new Error("Invalid base64 input, bad content length.");for(y=h.uint8array?new Uint8Array(0|k):new Array(0|k);m<x.length;)g=p.indexOf(x.charAt(m++))<<2|(E=p.indexOf(x.charAt(m++)))>>4,C=(15&E)<<4|(v=p.indexOf(x.charAt(m++)))>>2,j=(3&v)<<6|(_=p.indexOf(x.charAt(m++))),y[b++]=g,v!==64&&(y[b++]=C),_!==64&&(y[b++]=j);return y}},{"./support":30,"./utils":32}],2:[function(r,u,f){var d=r("./external"),h=r("./stream/DataWorker"),p=r("./stream/Crc32Probe"),x=r("./stream/DataLengthProbe");function g(C,j,E,v,_){this.compressedSize=C,this.uncompressedSize=j,this.crc32=E,this.compression=v,this.compressedContent=_}g.prototype={getContentWorker:function(){var C=new h(d.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new x("data_length")),j=this;return C.on("end",function(){if(this.streamInfo.data_length!==j.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),C},getCompressedWorker:function(){return new h(d.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},g.createWorkerFrom=function(C,j,E){return C.pipe(new p).pipe(new x("uncompressedSize")).pipe(j.compressWorker(E)).pipe(new x("compressedSize")).withStreamInfo("compression",j)},u.exports=g},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(r,u,f){var d=r("./stream/GenericWorker");f.STORE={magic:"\0\0",compressWorker:function(){return new d("STORE compression")},uncompressWorker:function(){return new d("STORE decompression")}},f.DEFLATE=r("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(r,u,f){var d=r("./utils"),h=(function(){for(var p,x=[],g=0;g<256;g++){p=g;for(var C=0;C<8;C++)p=1&p?3988292384^p>>>1:p>>>1;x[g]=p}return x})();u.exports=function(p,x){return p!==void 0&&p.length?d.getTypeOf(p)!=="string"?(function(g,C,j,E){var v=h,_=E+j;g^=-1;for(var m=E;m<_;m++)g=g>>>8^v[255&(g^C[m])];return-1^g})(0|x,p,p.length,0):(function(g,C,j,E){var v=h,_=E+j;g^=-1;for(var m=E;m<_;m++)g=g>>>8^v[255&(g^C.charCodeAt(m))];return-1^g})(0|x,p,p.length,0):0}},{"./utils":32}],5:[function(r,u,f){f.base64=!1,f.binary=!1,f.dir=!1,f.createFolders=!0,f.date=null,f.compression=null,f.compressionOptions=null,f.comment=null,f.unixPermissions=null,f.dosPermissions=null},{}],6:[function(r,u,f){var d=null;d=typeof Promise<"u"?Promise:r("lie"),u.exports={Promise:d}},{lie:37}],7:[function(r,u,f){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",h=r("pako"),p=r("./utils"),x=r("./stream/GenericWorker"),g=d?"uint8array":"array";function C(j,E){x.call(this,"FlateWorker/"+j),this._pako=null,this._pakoAction=j,this._pakoOptions=E,this.meta={}}f.magic="\b\0",p.inherits(C,x),C.prototype.processChunk=function(j){this.meta=j.meta,this._pako===null&&this._createPako(),this._pako.push(p.transformTo(g,j.data),!1)},C.prototype.flush=function(){x.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},C.prototype.cleanUp=function(){x.prototype.cleanUp.call(this),this._pako=null},C.prototype._createPako=function(){this._pako=new h[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var j=this;this._pako.onData=function(E){j.push({data:E,meta:j.meta})}},f.compressWorker=function(j){return new C("Deflate",j)},f.uncompressWorker=function(){return new C("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(r,u,f){function d(v,_){var m,b="";for(m=0;m<_;m++)b+=String.fromCharCode(255&v),v>>>=8;return b}function h(v,_,m,b,S,y){var k,U,O=v.file,M=v.compression,T=y!==g.utf8encode,Z=p.transformTo("string",y(O.name)),V=p.transformTo("string",g.utf8encode(O.name)),ue=O.comment,oe=p.transformTo("string",y(ue)),Y=p.transformTo("string",g.utf8encode(ue)),ae=V.length!==O.name.length,z=Y.length!==ue.length,I="",X="",Q="",Ne=O.dir,$=O.date,re={crc32:0,compressedSize:0,uncompressedSize:0};_&&!m||(re.crc32=v.crc32,re.compressedSize=v.compressedSize,re.uncompressedSize=v.uncompressedSize);var R=0;_&&(R|=8),T||!ae&&!z||(R|=2048);var B=0,W=0;Ne&&(B|=16),S==="UNIX"?(W=798,B|=(function(H,ie){var Ee=H;return H||(Ee=ie?16893:33204),(65535&Ee)<<16})(O.unixPermissions,Ne)):(W=20,B|=(function(H){return 63&(H||0)})(O.dosPermissions)),k=$.getUTCHours(),k<<=6,k|=$.getUTCMinutes(),k<<=5,k|=$.getUTCSeconds()/2,U=$.getUTCFullYear()-1980,U<<=4,U|=$.getUTCMonth()+1,U<<=5,U|=$.getUTCDate(),ae&&(X=d(1,1)+d(C(Z),4)+V,I+="up"+d(X.length,2)+X),z&&(Q=d(1,1)+d(C(oe),4)+Y,I+="uc"+d(Q.length,2)+Q);var ee="";return ee+=`
12
+ \0`,ee+=d(R,2),ee+=M.magic,ee+=d(k,2),ee+=d(U,2),ee+=d(re.crc32,4),ee+=d(re.compressedSize,4),ee+=d(re.uncompressedSize,4),ee+=d(Z.length,2),ee+=d(I.length,2),{fileRecord:j.LOCAL_FILE_HEADER+ee+Z+I,dirRecord:j.CENTRAL_FILE_HEADER+d(W,2)+ee+d(oe.length,2)+"\0\0\0\0"+d(B,4)+d(b,4)+Z+I+oe}}var p=r("../utils"),x=r("../stream/GenericWorker"),g=r("../utf8"),C=r("../crc32"),j=r("../signature");function E(v,_,m,b){x.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=_,this.zipPlatform=m,this.encodeFileName=b,this.streamFiles=v,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}p.inherits(E,x),E.prototype.push=function(v){var _=v.meta.percent||0,m=this.entriesCount,b=this._sources.length;this.accumulate?this.contentBuffer.push(v):(this.bytesWritten+=v.data.length,x.prototype.push.call(this,{data:v.data,meta:{currentFile:this.currentFile,percent:m?(_+100*(m-b-1))/m:100}}))},E.prototype.openedSource=function(v){this.currentSourceOffset=this.bytesWritten,this.currentFile=v.file.name;var _=this.streamFiles&&!v.file.dir;if(_){var m=h(v,_,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:m.fileRecord,meta:{percent:0}})}else this.accumulate=!0},E.prototype.closedSource=function(v){this.accumulate=!1;var _=this.streamFiles&&!v.file.dir,m=h(v,_,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(m.dirRecord),_)this.push({data:(function(b){return j.DATA_DESCRIPTOR+d(b.crc32,4)+d(b.compressedSize,4)+d(b.uncompressedSize,4)})(v),meta:{percent:100}});else for(this.push({data:m.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},E.prototype.flush=function(){for(var v=this.bytesWritten,_=0;_<this.dirRecords.length;_++)this.push({data:this.dirRecords[_],meta:{percent:100}});var m=this.bytesWritten-v,b=(function(S,y,k,U,O){var M=p.transformTo("string",O(U));return j.CENTRAL_DIRECTORY_END+"\0\0\0\0"+d(S,2)+d(S,2)+d(y,4)+d(k,4)+d(M.length,2)+M})(this.dirRecords.length,m,v,this.zipComment,this.encodeFileName);this.push({data:b,meta:{percent:100}})},E.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},E.prototype.registerPrevious=function(v){this._sources.push(v);var _=this;return v.on("data",function(m){_.processChunk(m)}),v.on("end",function(){_.closedSource(_.previous.streamInfo),_._sources.length?_.prepareNextSource():_.end()}),v.on("error",function(m){_.error(m)}),this},E.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))},E.prototype.error=function(v){var _=this._sources;if(!x.prototype.error.call(this,v))return!1;for(var m=0;m<_.length;m++)try{_[m].error(v)}catch{}return!0},E.prototype.lock=function(){x.prototype.lock.call(this);for(var v=this._sources,_=0;_<v.length;_++)v[_].lock()},u.exports=E},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(r,u,f){var d=r("../compressions"),h=r("./ZipFileWorker");f.generateWorker=function(p,x,g){var C=new h(x.streamFiles,g,x.platform,x.encodeFileName),j=0;try{p.forEach(function(E,v){j++;var _=(function(y,k){var U=y||k,O=d[U];if(!O)throw new Error(U+" is not a valid compression method !");return O})(v.options.compression,x.compression),m=v.options.compressionOptions||x.compressionOptions||{},b=v.dir,S=v.date;v._compressWorker(_,m).withStreamInfo("file",{name:E,dir:b,date:S,comment:v.comment||"",unixPermissions:v.unixPermissions,dosPermissions:v.dosPermissions}).pipe(C)}),C.entriesCount=j}catch(E){C.error(E)}return C}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(r,u,f){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 h=new d;for(var p in this)typeof this[p]!="function"&&(h[p]=this[p]);return h}}(d.prototype=r("./object")).loadAsync=r("./load"),d.support=r("./support"),d.defaults=r("./defaults"),d.version="3.10.1",d.loadAsync=function(h,p){return new d().loadAsync(h,p)},d.external=r("./external"),u.exports=d},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(r,u,f){var d=r("./utils"),h=r("./external"),p=r("./utf8"),x=r("./zipEntries"),g=r("./stream/Crc32Probe"),C=r("./nodejsUtils");function j(E){return new h.Promise(function(v,_){var m=E.decompressed.getContentWorker().pipe(new g);m.on("error",function(b){_(b)}).on("end",function(){m.streamInfo.crc32!==E.decompressed.crc32?_(new Error("Corrupted zip : CRC32 mismatch")):v()}).resume()})}u.exports=function(E,v){var _=this;return v=d.extend(v||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:p.utf8decode}),C.isNode&&C.isStream(E)?h.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):d.prepareContent("the loaded zip file",E,!0,v.optimizedBinaryString,v.base64).then(function(m){var b=new x(v);return b.load(m),b}).then(function(m){var b=[h.Promise.resolve(m)],S=m.files;if(v.checkCRC32)for(var y=0;y<S.length;y++)b.push(j(S[y]));return h.Promise.all(b)}).then(function(m){for(var b=m.shift(),S=b.files,y=0;y<S.length;y++){var k=S[y],U=k.fileNameStr,O=d.resolve(k.fileNameStr);_.file(O,k.decompressed,{binary:!0,optimizedBinaryString:!0,date:k.date,dir:k.dir,comment:k.fileCommentStr.length?k.fileCommentStr:null,unixPermissions:k.unixPermissions,dosPermissions:k.dosPermissions,createFolders:v.createFolders}),k.dir||(_.file(O).unsafeOriginalName=U)}return b.zipComment.length&&(_.comment=b.zipComment),_})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(r,u,f){var d=r("../utils"),h=r("../stream/GenericWorker");function p(x,g){h.call(this,"Nodejs stream input adapter for "+x),this._upstreamEnded=!1,this._bindStream(g)}d.inherits(p,h),p.prototype._bindStream=function(x){var g=this;(this._stream=x).pause(),x.on("data",function(C){g.push({data:C,meta:{percent:0}})}).on("error",function(C){g.isPaused?this.generatedError=C:g.error(C)}).on("end",function(){g.isPaused?g._upstreamEnded=!0:g.end()})},p.prototype.pause=function(){return!!h.prototype.pause.call(this)&&(this._stream.pause(),!0)},p.prototype.resume=function(){return!!h.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},u.exports=p},{"../stream/GenericWorker":28,"../utils":32}],13:[function(r,u,f){var d=r("readable-stream").Readable;function h(p,x,g){d.call(this,x),this._helper=p;var C=this;p.on("data",function(j,E){C.push(j)||C._helper.pause(),g&&g(E)}).on("error",function(j){C.emit("error",j)}).on("end",function(){C.push(null)})}r("../utils").inherits(h,d),h.prototype._read=function(){this._helper.resume()},u.exports=h},{"../utils":32,"readable-stream":16}],14:[function(r,u,f){u.exports={isNode:typeof Buffer<"u",newBufferFrom:function(d,h){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(d,h);if(typeof d=="number")throw new Error('The "data" argument must not be a number');return new Buffer(d,h)},allocBuffer:function(d){if(Buffer.alloc)return Buffer.alloc(d);var h=new Buffer(d);return h.fill(0),h},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(r,u,f){function d(O,M,T){var Z,V=p.getTypeOf(M),ue=p.extend(T||{},C);ue.date=ue.date||new Date,ue.compression!==null&&(ue.compression=ue.compression.toUpperCase()),typeof ue.unixPermissions=="string"&&(ue.unixPermissions=parseInt(ue.unixPermissions,8)),ue.unixPermissions&&16384&ue.unixPermissions&&(ue.dir=!0),ue.dosPermissions&&16&ue.dosPermissions&&(ue.dir=!0),ue.dir&&(O=S(O)),ue.createFolders&&(Z=b(O))&&y.call(this,Z,!0);var oe=V==="string"&&ue.binary===!1&&ue.base64===!1;T&&T.binary!==void 0||(ue.binary=!oe),(M instanceof j&&M.uncompressedSize===0||ue.dir||!M||M.length===0)&&(ue.base64=!1,ue.binary=!0,M="",ue.compression="STORE",V="string");var Y=null;Y=M instanceof j||M instanceof x?M:_.isNode&&_.isStream(M)?new m(O,M):p.prepareContent(O,M,ue.binary,ue.optimizedBinaryString,ue.base64);var ae=new E(O,Y,ue);this.files[O]=ae}var h=r("./utf8"),p=r("./utils"),x=r("./stream/GenericWorker"),g=r("./stream/StreamHelper"),C=r("./defaults"),j=r("./compressedObject"),E=r("./zipObject"),v=r("./generate"),_=r("./nodejsUtils"),m=r("./nodejs/NodejsStreamInputAdapter"),b=function(O){O.slice(-1)==="/"&&(O=O.substring(0,O.length-1));var M=O.lastIndexOf("/");return 0<M?O.substring(0,M):""},S=function(O){return O.slice(-1)!=="/"&&(O+="/"),O},y=function(O,M){return M=M!==void 0?M:C.createFolders,O=S(O),this.files[O]||d.call(this,O,null,{dir:!0,createFolders:M}),this.files[O]};function k(O){return Object.prototype.toString.call(O)==="[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(O){var M,T,Z;for(M in this.files)Z=this.files[M],(T=M.slice(this.root.length,M.length))&&M.slice(0,this.root.length)===this.root&&O(T,Z)},filter:function(O){var M=[];return this.forEach(function(T,Z){O(T,Z)&&M.push(Z)}),M},file:function(O,M,T){if(arguments.length!==1)return O=this.root+O,d.call(this,O,M,T),this;if(k(O)){var Z=O;return this.filter(function(ue,oe){return!oe.dir&&Z.test(ue)})}var V=this.files[this.root+O];return V&&!V.dir?V:null},folder:function(O){if(!O)return this;if(k(O))return this.filter(function(V,ue){return ue.dir&&O.test(V)});var M=this.root+O,T=y.call(this,M),Z=this.clone();return Z.root=T.name,Z},remove:function(O){O=this.root+O;var M=this.files[O];if(M||(O.slice(-1)!=="/"&&(O+="/"),M=this.files[O]),M&&!M.dir)delete this.files[O];else for(var T=this.filter(function(V,ue){return ue.name.slice(0,O.length)===O}),Z=0;Z<T.length;Z++)delete this.files[T[Z].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(O){var M,T={};try{if((T=p.extend(O||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:h.utf8encode})).type=T.type.toLowerCase(),T.compression=T.compression.toUpperCase(),T.type==="binarystring"&&(T.type="string"),!T.type)throw new Error("No output type specified.");p.checkSupport(T.type),T.platform!=="darwin"&&T.platform!=="freebsd"&&T.platform!=="linux"&&T.platform!=="sunos"||(T.platform="UNIX"),T.platform==="win32"&&(T.platform="DOS");var Z=T.comment||this.comment||"";M=v.generateWorker(this,T,Z)}catch(V){(M=new x("error")).error(V)}return new g(M,T.type||"string",T.mimeType)},generateAsync:function(O,M){return this.generateInternalStream(O).accumulate(M)},generateNodeStream:function(O,M){return(O=O||{}).type||(O.type="nodebuffer"),this.generateInternalStream(O).toNodejsStream(M)}};u.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(r,u,f){u.exports=r("stream")},{stream:void 0}],17:[function(r,u,f){var d=r("./DataReader");function h(p){d.call(this,p);for(var x=0;x<this.data.length;x++)p[x]=255&p[x]}r("../utils").inherits(h,d),h.prototype.byteAt=function(p){return this.data[this.zero+p]},h.prototype.lastIndexOfSignature=function(p){for(var x=p.charCodeAt(0),g=p.charCodeAt(1),C=p.charCodeAt(2),j=p.charCodeAt(3),E=this.length-4;0<=E;--E)if(this.data[E]===x&&this.data[E+1]===g&&this.data[E+2]===C&&this.data[E+3]===j)return E-this.zero;return-1},h.prototype.readAndCheckSignature=function(p){var x=p.charCodeAt(0),g=p.charCodeAt(1),C=p.charCodeAt(2),j=p.charCodeAt(3),E=this.readData(4);return x===E[0]&&g===E[1]&&C===E[2]&&j===E[3]},h.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},u.exports=h},{"../utils":32,"./DataReader":18}],18:[function(r,u,f){var d=r("../utils");function h(p){this.data=p,this.length=p.length,this.index=0,this.zero=0}h.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,g=0;for(this.checkOffset(p),x=this.index+p-1;x>=this.index;x--)g=(g<<8)+this.byteAt(x);return this.index+=p,g},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))}},u.exports=h},{"../utils":32}],19:[function(r,u,f){var d=r("./Uint8ArrayReader");function h(p){d.call(this,p)}r("../utils").inherits(h,d),h.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},u.exports=h},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(r,u,f){var d=r("./DataReader");function h(p){d.call(this,p)}r("../utils").inherits(h,d),h.prototype.byteAt=function(p){return this.data.charCodeAt(this.zero+p)},h.prototype.lastIndexOfSignature=function(p){return this.data.lastIndexOf(p)-this.zero},h.prototype.readAndCheckSignature=function(p){return p===this.readData(4)},h.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},u.exports=h},{"../utils":32,"./DataReader":18}],21:[function(r,u,f){var d=r("./ArrayReader");function h(p){d.call(this,p)}r("../utils").inherits(h,d),h.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},u.exports=h},{"../utils":32,"./ArrayReader":17}],22:[function(r,u,f){var d=r("../utils"),h=r("../support"),p=r("./ArrayReader"),x=r("./StringReader"),g=r("./NodeBufferReader"),C=r("./Uint8ArrayReader");u.exports=function(j){var E=d.getTypeOf(j);return d.checkSupport(E),E!=="string"||h.uint8array?E==="nodebuffer"?new g(j):h.uint8array?new C(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(r,u,f){f.LOCAL_FILE_HEADER="PK",f.CENTRAL_FILE_HEADER="PK",f.CENTRAL_DIRECTORY_END="PK",f.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",f.ZIP64_CENTRAL_DIRECTORY_END="PK",f.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(r,u,f){var d=r("./GenericWorker"),h=r("../utils");function p(x){d.call(this,"ConvertWorker to "+x),this.destType=x}h.inherits(p,d),p.prototype.processChunk=function(x){this.push({data:h.transformTo(this.destType,x.data),meta:x.meta})},u.exports=p},{"../utils":32,"./GenericWorker":28}],25:[function(r,u,f){var d=r("./GenericWorker"),h=r("../crc32");function p(){d.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}r("../utils").inherits(p,d),p.prototype.processChunk=function(x){this.streamInfo.crc32=h(x.data,this.streamInfo.crc32||0),this.push(x)},u.exports=p},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(r,u,f){var d=r("../utils"),h=r("./GenericWorker");function p(x){h.call(this,"DataLengthProbe for "+x),this.propName=x,this.withStreamInfo(x,0)}d.inherits(p,h),p.prototype.processChunk=function(x){if(x){var g=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=g+x.data.length}h.prototype.processChunk.call(this,x)},u.exports=p},{"../utils":32,"./GenericWorker":28}],27:[function(r,u,f){var d=r("../utils"),h=r("./GenericWorker");function p(x){h.call(this,"DataWorker");var g=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,x.then(function(C){g.dataIsReady=!0,g.data=C,g.max=C&&C.length||0,g.type=d.getTypeOf(C),g.isPaused||g._tickAndRepeat()},function(C){g.error(C)})}d.inherits(p,h),p.prototype.cleanUp=function(){h.prototype.cleanUp.call(this),this.data=null},p.prototype.resume=function(){return!!h.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,g=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,g);break;case"uint8array":x=this.data.subarray(this.index,g);break;case"array":case"nodebuffer":x=this.data.slice(this.index,g)}return this.index=g,this.push({data:x,meta:{percent:this.max?this.index/this.max*100:0}})},u.exports=p},{"../utils":32,"./GenericWorker":28}],28:[function(r,u,f){function d(h){this.name=h||"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(h){this.emit("data",h)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(h){this.emit("error",h)}return!0},error:function(h){return!this.isFinished&&(this.isPaused?this.generatedError=h:(this.isFinished=!0,this.emit("error",h),this.previous&&this.previous.error(h),this.cleanUp()),!0)},on:function(h,p){return this._listeners[h].push(p),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(h,p){if(this._listeners[h])for(var x=0;x<this._listeners[h].length;x++)this._listeners[h][x].call(this,p)},pipe:function(h){return h.registerPrevious(this)},registerPrevious:function(h){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=h.streamInfo,this.mergeStreamInfo(),this.previous=h;var p=this;return h.on("data",function(x){p.processChunk(x)}),h.on("end",function(){p.end()}),h.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 h=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),h=!0),this.previous&&this.previous.resume(),!h},flush:function(){},processChunk:function(h){this.push(h)},withStreamInfo:function(h,p){return this.extraStreamInfo[h]=p,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var h in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,h)&&(this.streamInfo[h]=this.extraStreamInfo[h])},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 h="Worker "+this.name;return this.previous?this.previous+" -> "+h:h}},u.exports=d},{}],29:[function(r,u,f){var d=r("../utils"),h=r("./ConvertWorker"),p=r("./GenericWorker"),x=r("../base64"),g=r("../support"),C=r("../external"),j=null;if(g.nodestream)try{j=r("../nodejs/NodejsStreamOutputAdapter")}catch{}function E(_,m){return new C.Promise(function(b,S){var y=[],k=_._internalType,U=_._outputType,O=_._mimeType;_.on("data",function(M,T){y.push(M),m&&m(T)}).on("error",function(M){y=[],S(M)}).on("end",function(){try{var M=(function(T,Z,V){switch(T){case"blob":return d.newBlob(d.transformTo("arraybuffer",Z),V);case"base64":return x.encode(Z);default:return d.transformTo(T,Z)}})(U,(function(T,Z){var V,ue=0,oe=null,Y=0;for(V=0;V<Z.length;V++)Y+=Z[V].length;switch(T){case"string":return Z.join("");case"array":return Array.prototype.concat.apply([],Z);case"uint8array":for(oe=new Uint8Array(Y),V=0;V<Z.length;V++)oe.set(Z[V],ue),ue+=Z[V].length;return oe;case"nodebuffer":return Buffer.concat(Z);default:throw new Error("concat : unsupported type '"+T+"'")}})(k,y),O);b(M)}catch(T){S(T)}y=[]}).resume()})}function v(_,m,b){var S=m;switch(m){case"blob":case"arraybuffer":S="uint8array";break;case"base64":S="string"}try{this._internalType=S,this._outputType=m,this._mimeType=b,d.checkSupport(S),this._worker=_.pipe(new h(S)),_.lock()}catch(y){this._worker=new p("error"),this._worker.error(y)}}v.prototype={accumulate:function(_){return E(this,_)},on:function(_,m){var b=this;return _==="data"?this._worker.on(_,function(S){m.call(b,S.data,S.meta)}):this._worker.on(_,function(){d.delay(m,arguments,b)}),this},resume:function(){return d.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(_){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"},_)}},u.exports=v},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(r,u,f){if(f.base64=!0,f.array=!0,f.string=!0,f.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",f.nodebuffer=typeof Buffer<"u",f.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")f.blob=!1;else{var d=new ArrayBuffer(0);try{f.blob=new Blob([d],{type:"application/zip"}).size===0}catch{try{var h=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);h.append(d),f.blob=h.getBlob("application/zip").size===0}catch{f.blob=!1}}}try{f.nodestream=!!r("readable-stream").Readable}catch{f.nodestream=!1}},{"readable-stream":16}],31:[function(r,u,f){for(var d=r("./utils"),h=r("./support"),p=r("./nodejsUtils"),x=r("./stream/GenericWorker"),g=new Array(256),C=0;C<256;C++)g[C]=252<=C?6:248<=C?5:240<=C?4:224<=C?3:192<=C?2:1;g[254]=g[254]=1;function j(){x.call(this,"utf-8 decode"),this.leftOver=null}function E(){x.call(this,"utf-8 encode")}f.utf8encode=function(v){return h.nodebuffer?p.newBufferFrom(v,"utf-8"):(function(_){var m,b,S,y,k,U=_.length,O=0;for(y=0;y<U;y++)(64512&(b=_.charCodeAt(y)))==55296&&y+1<U&&(64512&(S=_.charCodeAt(y+1)))==56320&&(b=65536+(b-55296<<10)+(S-56320),y++),O+=b<128?1:b<2048?2:b<65536?3:4;for(m=h.uint8array?new Uint8Array(O):new Array(O),y=k=0;k<O;y++)(64512&(b=_.charCodeAt(y)))==55296&&y+1<U&&(64512&(S=_.charCodeAt(y+1)))==56320&&(b=65536+(b-55296<<10)+(S-56320),y++),b<128?m[k++]=b:(b<2048?m[k++]=192|b>>>6:(b<65536?m[k++]=224|b>>>12:(m[k++]=240|b>>>18,m[k++]=128|b>>>12&63),m[k++]=128|b>>>6&63),m[k++]=128|63&b);return m})(v)},f.utf8decode=function(v){return h.nodebuffer?d.transformTo("nodebuffer",v).toString("utf-8"):(function(_){var m,b,S,y,k=_.length,U=new Array(2*k);for(m=b=0;m<k;)if((S=_[m++])<128)U[b++]=S;else if(4<(y=g[S]))U[b++]=65533,m+=y-1;else{for(S&=y===2?31:y===3?15:7;1<y&&m<k;)S=S<<6|63&_[m++],y--;1<y?U[b++]=65533:S<65536?U[b++]=S:(S-=65536,U[b++]=55296|S>>10&1023,U[b++]=56320|1023&S)}return U.length!==b&&(U.subarray?U=U.subarray(0,b):U.length=b),d.applyFromCharCode(U)})(v=d.transformTo(h.uint8array?"uint8array":"array",v))},d.inherits(j,x),j.prototype.processChunk=function(v){var _=d.transformTo(h.uint8array?"uint8array":"array",v.data);if(this.leftOver&&this.leftOver.length){if(h.uint8array){var m=_;(_=new Uint8Array(m.length+this.leftOver.length)).set(this.leftOver,0),_.set(m,this.leftOver.length)}else _=this.leftOver.concat(_);this.leftOver=null}var b=(function(y,k){var U;for((k=k||y.length)>y.length&&(k=y.length),U=k-1;0<=U&&(192&y[U])==128;)U--;return U<0||U===0?k:U+g[y[U]]>k?U:k})(_),S=_;b!==_.length&&(h.uint8array?(S=_.subarray(0,b),this.leftOver=_.subarray(b,_.length)):(S=_.slice(0,b),this.leftOver=_.slice(b,_.length))),this.push({data:f.utf8decode(S),meta:v.meta})},j.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:f.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},f.Utf8DecodeWorker=j,d.inherits(E,x),E.prototype.processChunk=function(v){this.push({data:f.utf8encode(v.data),meta:v.meta})},f.Utf8EncodeWorker=E},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(r,u,f){var d=r("./support"),h=r("./base64"),p=r("./nodejsUtils"),x=r("./external");function g(m){return m}function C(m,b){for(var S=0;S<m.length;++S)b[S]=255&m.charCodeAt(S);return b}r("setimmediate"),f.newBlob=function(m,b){f.checkSupport("blob");try{return new Blob([m],{type:b})}catch{try{var S=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return S.append(m),S.getBlob(b)}catch{throw new Error("Bug : can't construct the Blob.")}}};var j={stringifyByChunk:function(m,b,S){var y=[],k=0,U=m.length;if(U<=S)return String.fromCharCode.apply(null,m);for(;k<U;)b==="array"||b==="nodebuffer"?y.push(String.fromCharCode.apply(null,m.slice(k,Math.min(k+S,U)))):y.push(String.fromCharCode.apply(null,m.subarray(k,Math.min(k+S,U)))),k+=S;return y.join("")},stringifyByChar:function(m){for(var b="",S=0;S<m.length;S++)b+=String.fromCharCode(m[S]);return b},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 E(m){var b=65536,S=f.getTypeOf(m),y=!0;if(S==="uint8array"?y=j.applyCanBeUsed.uint8array:S==="nodebuffer"&&(y=j.applyCanBeUsed.nodebuffer),y)for(;1<b;)try{return j.stringifyByChunk(m,S,b)}catch{b=Math.floor(b/2)}return j.stringifyByChar(m)}function v(m,b){for(var S=0;S<m.length;S++)b[S]=m[S];return b}f.applyFromCharCode=E;var _={};_.string={string:g,array:function(m){return C(m,new Array(m.length))},arraybuffer:function(m){return _.string.uint8array(m).buffer},uint8array:function(m){return C(m,new Uint8Array(m.length))},nodebuffer:function(m){return C(m,p.allocBuffer(m.length))}},_.array={string:E,array:g,arraybuffer:function(m){return new Uint8Array(m).buffer},uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return p.newBufferFrom(m)}},_.arraybuffer={string:function(m){return E(new Uint8Array(m))},array:function(m){return v(new Uint8Array(m),new Array(m.byteLength))},arraybuffer:g,uint8array:function(m){return new Uint8Array(m)},nodebuffer:function(m){return p.newBufferFrom(new Uint8Array(m))}},_.uint8array={string:E,array:function(m){return v(m,new Array(m.length))},arraybuffer:function(m){return m.buffer},uint8array:g,nodebuffer:function(m){return p.newBufferFrom(m)}},_.nodebuffer={string:E,array:function(m){return v(m,new Array(m.length))},arraybuffer:function(m){return _.nodebuffer.uint8array(m).buffer},uint8array:function(m){return v(m,new Uint8Array(m.length))},nodebuffer:g},f.transformTo=function(m,b){if(b=b||"",!m)return b;f.checkSupport(m);var S=f.getTypeOf(b);return _[S][m](b)},f.resolve=function(m){for(var b=m.split("/"),S=[],y=0;y<b.length;y++){var k=b[y];k==="."||k===""&&y!==0&&y!==b.length-1||(k===".."?S.pop():S.push(k))}return S.join("/")},f.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},f.checkSupport=function(m){if(!d[m.toLowerCase()])throw new Error(m+" is not supported by this platform")},f.MAX_VALUE_16BITS=65535,f.MAX_VALUE_32BITS=-1,f.pretty=function(m){var b,S,y="";for(S=0;S<(m||"").length;S++)y+="\\x"+((b=m.charCodeAt(S))<16?"0":"")+b.toString(16).toUpperCase();return y},f.delay=function(m,b,S){setImmediate(function(){m.apply(S||null,b||[])})},f.inherits=function(m,b){function S(){}S.prototype=b.prototype,m.prototype=new S},f.extend=function(){var m,b,S={};for(m=0;m<arguments.length;m++)for(b in arguments[m])Object.prototype.hasOwnProperty.call(arguments[m],b)&&S[b]===void 0&&(S[b]=arguments[m][b]);return S},f.prepareContent=function(m,b,S,y,k){return x.Promise.resolve(b).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(O,M){var T=new FileReader;T.onload=function(Z){O(Z.target.result)},T.onerror=function(Z){M(Z.target.error)},T.readAsArrayBuffer(U)}):U}).then(function(U){var O=f.getTypeOf(U);return O?(O==="arraybuffer"?U=f.transformTo("uint8array",U):O==="string"&&(k?U=h.decode(U):S&&y!==!0&&(U=(function(M){return C(M,d.uint8array?new Uint8Array(M.length):new Array(M.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(r,u,f){var d=r("./reader/readerFor"),h=r("./utils"),p=r("./signature"),x=r("./zipEntry"),g=r("./support");function C(j){this.files=[],this.loadOptions=j}C.prototype={checkSignature:function(j){if(!this.reader.readAndCheckSignature(j)){this.reader.index-=4;var E=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+h.pretty(E)+", expected "+h.pretty(j)+")")}},isSignature:function(j,E){var v=this.reader.index;this.reader.setIndex(j);var _=this.reader.readString(4)===E;return this.reader.setIndex(v),_},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),E=g.uint8array?"uint8array":"array",v=h.transformTo(E,j);this.zipComment=this.loadOptions.decodeFileName(v)},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,E,v,_=this.zip64EndOfCentralSize-44;0<_;)j=this.reader.readInt(2),E=this.reader.readInt(4),v=this.reader.readData(E),this.zip64ExtensibleData[j]={id:j,length:E,value:v}},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,E;for(j=0;j<this.files.length;j++)E=this.files[j],this.reader.setIndex(E.localHeaderOffset),this.checkSignature(p.LOCAL_FILE_HEADER),E.readLocalPart(this.reader),E.handleUTF8(),E.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 E=j;if(this.checkSignature(p.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===h.MAX_VALUE_16BITS||this.diskWithCentralDirStart===h.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===h.MAX_VALUE_16BITS||this.centralDirRecords===h.MAX_VALUE_16BITS||this.centralDirSize===h.MAX_VALUE_32BITS||this.centralDirOffset===h.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 v=this.centralDirOffset+this.centralDirSize;this.zip64&&(v+=20,v+=12+this.zip64EndOfCentralSize);var _=E-v;if(0<_)this.isSignature(E,p.CENTRAL_FILE_HEADER)||(this.reader.zero=_);else if(_<0)throw new Error("Corrupted zip: missing "+Math.abs(_)+" bytes.")},prepareReader:function(j){this.reader=d(j)},load:function(j){this.prepareReader(j),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},u.exports=C},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(r,u,f){var d=r("./reader/readerFor"),h=r("./utils"),p=r("./compressedObject"),x=r("./crc32"),g=r("./utf8"),C=r("./compressions"),j=r("./support");function E(v,_){this.options=v,this.loadOptions=_}E.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(v){var _,m;if(v.skip(22),this.fileNameLength=v.readInt(2),m=v.readInt(2),this.fileName=v.readData(this.fileNameLength),v.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((_=(function(b){for(var S in C)if(Object.prototype.hasOwnProperty.call(C,S)&&C[S].magic===b)return C[S];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+h.pretty(this.compressionMethod)+" unknown (inner file : "+h.transformTo("string",this.fileName)+")");this.decompressed=new p(this.compressedSize,this.uncompressedSize,this.crc32,_,v.readData(this.compressedSize))},readCentralPart:function(v){this.versionMadeBy=v.readInt(2),v.skip(2),this.bitFlag=v.readInt(2),this.compressionMethod=v.readString(2),this.date=v.readDate(),this.crc32=v.readInt(4),this.compressedSize=v.readInt(4),this.uncompressedSize=v.readInt(4);var _=v.readInt(2);if(this.extraFieldsLength=v.readInt(2),this.fileCommentLength=v.readInt(2),this.diskNumberStart=v.readInt(2),this.internalFileAttributes=v.readInt(2),this.externalFileAttributes=v.readInt(4),this.localHeaderOffset=v.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");v.skip(_),this.readExtraFields(v),this.parseZIP64ExtraField(v),this.fileComment=v.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var v=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),v==0&&(this.dosPermissions=63&this.externalFileAttributes),v==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var v=d(this.extraFields[1].value);this.uncompressedSize===h.MAX_VALUE_32BITS&&(this.uncompressedSize=v.readInt(8)),this.compressedSize===h.MAX_VALUE_32BITS&&(this.compressedSize=v.readInt(8)),this.localHeaderOffset===h.MAX_VALUE_32BITS&&(this.localHeaderOffset=v.readInt(8)),this.diskNumberStart===h.MAX_VALUE_32BITS&&(this.diskNumberStart=v.readInt(4))}},readExtraFields:function(v){var _,m,b,S=v.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});v.index+4<S;)_=v.readInt(2),m=v.readInt(2),b=v.readData(m),this.extraFields[_]={id:_,length:m,value:b};v.setIndex(S)},handleUTF8:function(){var v=j.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=g.utf8decode(this.fileName),this.fileCommentStr=g.utf8decode(this.fileComment);else{var _=this.findExtraFieldUnicodePath();if(_!==null)this.fileNameStr=_;else{var m=h.transformTo(v,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(m)}var b=this.findExtraFieldUnicodeComment();if(b!==null)this.fileCommentStr=b;else{var S=h.transformTo(v,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(S)}}},findExtraFieldUnicodePath:function(){var v=this.extraFields[28789];if(v){var _=d(v.value);return _.readInt(1)!==1||x(this.fileName)!==_.readInt(4)?null:g.utf8decode(_.readData(v.length-5))}return null},findExtraFieldUnicodeComment:function(){var v=this.extraFields[25461];if(v){var _=d(v.value);return _.readInt(1)!==1||x(this.fileComment)!==_.readInt(4)?null:g.utf8decode(_.readData(v.length-5))}return null}},u.exports=E},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(r,u,f){function d(_,m,b){this.name=_,this.dir=b.dir,this.date=b.date,this.comment=b.comment,this.unixPermissions=b.unixPermissions,this.dosPermissions=b.dosPermissions,this._data=m,this._dataBinary=b.binary,this.options={compression:b.compression,compressionOptions:b.compressionOptions}}var h=r("./stream/StreamHelper"),p=r("./stream/DataWorker"),x=r("./utf8"),g=r("./compressedObject"),C=r("./stream/GenericWorker");d.prototype={internalStream:function(_){var m=null,b="string";try{if(!_)throw new Error("No output type specified.");var S=(b=_.toLowerCase())==="string"||b==="text";b!=="binarystring"&&b!=="text"||(b="string"),m=this._decompressWorker();var y=!this._dataBinary;y&&!S&&(m=m.pipe(new x.Utf8EncodeWorker)),!y&&S&&(m=m.pipe(new x.Utf8DecodeWorker))}catch(k){(m=new C("error")).error(k)}return new h(m,b,"")},async:function(_,m){return this.internalStream(_).accumulate(m)},nodeStream:function(_,m){return this.internalStream(_||"nodebuffer").toNodejsStream(m)},_compressWorker:function(_,m){if(this._data instanceof g&&this._data.compression.magic===_.magic)return this._data.getCompressedWorker();var b=this._decompressWorker();return this._dataBinary||(b=b.pipe(new x.Utf8EncodeWorker)),g.createWorkerFrom(b,_,m)},_decompressWorker:function(){return this._data instanceof g?this._data.getContentWorker():this._data instanceof C?this._data:new p(this._data)}};for(var j=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],E=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},v=0;v<j.length;v++)d.prototype[j[v]]=E;u.exports=d},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(r,u,f){(function(d){var h,p,x=d.MutationObserver||d.WebKitMutationObserver;if(x){var g=0,C=new x(_),j=d.document.createTextNode("");C.observe(j,{characterData:!0}),h=function(){j.data=g=++g%2}}else if(d.setImmediate||d.MessageChannel===void 0)h="document"in d&&"onreadystatechange"in d.document.createElement("script")?function(){var m=d.document.createElement("script");m.onreadystatechange=function(){_(),m.onreadystatechange=null,m.parentNode.removeChild(m),m=null},d.document.documentElement.appendChild(m)}:function(){setTimeout(_,0)};else{var E=new d.MessageChannel;E.port1.onmessage=_,h=function(){E.port2.postMessage(0)}}var v=[];function _(){var m,b;p=!0;for(var S=v.length;S;){for(b=v,v=[],m=-1;++m<S;)b[m]();S=v.length}p=!1}u.exports=function(m){v.push(m)!==1||p||h()}}).call(this,typeof Vs<"u"?Vs:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(r,u,f){var d=r("immediate");function h(){}var p={},x=["REJECTED"],g=["FULFILLED"],C=["PENDING"];function j(S){if(typeof S!="function")throw new TypeError("resolver must be a function");this.state=C,this.queue=[],this.outcome=void 0,S!==h&&m(this,S)}function E(S,y,k){this.promise=S,typeof y=="function"&&(this.onFulfilled=y,this.callFulfilled=this.otherCallFulfilled),typeof k=="function"&&(this.onRejected=k,this.callRejected=this.otherCallRejected)}function v(S,y,k){d(function(){var U;try{U=y(k)}catch(O){return p.reject(S,O)}U===S?p.reject(S,new TypeError("Cannot resolve promise with itself")):p.resolve(S,U)})}function _(S){var y=S&&S.then;if(S&&(typeof S=="object"||typeof S=="function")&&typeof y=="function")return function(){y.apply(S,arguments)}}function m(S,y){var k=!1;function U(T){k||(k=!0,p.reject(S,T))}function O(T){k||(k=!0,p.resolve(S,T))}var M=b(function(){y(O,U)});M.status==="error"&&U(M.value)}function b(S,y){var k={};try{k.value=S(y),k.status="success"}catch(U){k.status="error",k.value=U}return k}(u.exports=j).prototype.finally=function(S){if(typeof S!="function")return this;var y=this.constructor;return this.then(function(k){return y.resolve(S()).then(function(){return k})},function(k){return y.resolve(S()).then(function(){throw k})})},j.prototype.catch=function(S){return this.then(null,S)},j.prototype.then=function(S,y){if(typeof S!="function"&&this.state===g||typeof y!="function"&&this.state===x)return this;var k=new this.constructor(h);return this.state!==C?v(k,this.state===g?S:y,this.outcome):this.queue.push(new E(k,S,y)),k},E.prototype.callFulfilled=function(S){p.resolve(this.promise,S)},E.prototype.otherCallFulfilled=function(S){v(this.promise,this.onFulfilled,S)},E.prototype.callRejected=function(S){p.reject(this.promise,S)},E.prototype.otherCallRejected=function(S){v(this.promise,this.onRejected,S)},p.resolve=function(S,y){var k=b(_,y);if(k.status==="error")return p.reject(S,k.value);var U=k.value;if(U)m(S,U);else{S.state=g,S.outcome=y;for(var O=-1,M=S.queue.length;++O<M;)S.queue[O].callFulfilled(y)}return S},p.reject=function(S,y){S.state=x,S.outcome=y;for(var k=-1,U=S.queue.length;++k<U;)S.queue[k].callRejected(y);return S},j.resolve=function(S){return S instanceof this?S:p.resolve(new this(h),S)},j.reject=function(S){var y=new this(h);return p.reject(y,S)},j.all=function(S){var y=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=S.length,U=!1;if(!k)return this.resolve([]);for(var O=new Array(k),M=0,T=-1,Z=new this(h);++T<k;)V(S[T],T);return Z;function V(ue,oe){y.resolve(ue).then(function(Y){O[oe]=Y,++M!==k||U||(U=!0,p.resolve(Z,O))},function(Y){U||(U=!0,p.reject(Z,Y))})}},j.race=function(S){var y=this;if(Object.prototype.toString.call(S)!=="[object Array]")return this.reject(new TypeError("must be an array"));var k=S.length,U=!1;if(!k)return this.resolve([]);for(var O=-1,M=new this(h);++O<k;)T=S[O],y.resolve(T).then(function(Z){U||(U=!0,p.resolve(M,Z))},function(Z){U||(U=!0,p.reject(M,Z))});var T;return M}},{immediate:36}],38:[function(r,u,f){var d={};(0,r("./lib/utils/common").assign)(d,r("./lib/deflate"),r("./lib/inflate"),r("./lib/zlib/constants")),u.exports=d},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(r,u,f){var d=r("./zlib/deflate"),h=r("./utils/common"),p=r("./utils/strings"),x=r("./zlib/messages"),g=r("./zlib/zstream"),C=Object.prototype.toString,j=0,E=-1,v=0,_=8;function m(S){if(!(this instanceof m))return new m(S);this.options=h.assign({level:E,method:_,chunkSize:16384,windowBits:15,memLevel:8,strategy:v,to:""},S||{});var y=this.options;y.raw&&0<y.windowBits?y.windowBits=-y.windowBits:y.gzip&&0<y.windowBits&&y.windowBits<16&&(y.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new g,this.strm.avail_out=0;var k=d.deflateInit2(this.strm,y.level,y.method,y.windowBits,y.memLevel,y.strategy);if(k!==j)throw new Error(x[k]);if(y.header&&d.deflateSetHeader(this.strm,y.header),y.dictionary){var U;if(U=typeof y.dictionary=="string"?p.string2buf(y.dictionary):C.call(y.dictionary)==="[object ArrayBuffer]"?new Uint8Array(y.dictionary):y.dictionary,(k=d.deflateSetDictionary(this.strm,U))!==j)throw new Error(x[k]);this._dict_set=!0}}function b(S,y){var k=new m(y);if(k.push(S,!0),k.err)throw k.msg||x[k.err];return k.result}m.prototype.push=function(S,y){var k,U,O=this.strm,M=this.options.chunkSize;if(this.ended)return!1;U=y===~~y?y:y===!0?4:0,typeof S=="string"?O.input=p.string2buf(S):C.call(S)==="[object ArrayBuffer]"?O.input=new Uint8Array(S):O.input=S,O.next_in=0,O.avail_in=O.input.length;do{if(O.avail_out===0&&(O.output=new h.Buf8(M),O.next_out=0,O.avail_out=M),(k=d.deflate(O,U))!==1&&k!==j)return this.onEnd(k),!(this.ended=!0);O.avail_out!==0&&(O.avail_in!==0||U!==4&&U!==2)||(this.options.to==="string"?this.onData(p.buf2binstring(h.shrinkBuf(O.output,O.next_out))):this.onData(h.shrinkBuf(O.output,O.next_out)))}while((0<O.avail_in||O.avail_out===0)&&k!==1);return U===4?(k=d.deflateEnd(this.strm),this.onEnd(k),this.ended=!0,k===j):U!==2||(this.onEnd(j),!(O.avail_out=0))},m.prototype.onData=function(S){this.chunks.push(S)},m.prototype.onEnd=function(S){S===j&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},f.Deflate=m,f.deflate=b,f.deflateRaw=function(S,y){return(y=y||{}).raw=!0,b(S,y)},f.gzip=function(S,y){return(y=y||{}).gzip=!0,b(S,y)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(r,u,f){var d=r("./zlib/inflate"),h=r("./utils/common"),p=r("./utils/strings"),x=r("./zlib/constants"),g=r("./zlib/messages"),C=r("./zlib/zstream"),j=r("./zlib/gzheader"),E=Object.prototype.toString;function v(m){if(!(this instanceof v))return new v(m);this.options=h.assign({chunkSize:16384,windowBits:0,to:""},m||{});var b=this.options;b.raw&&0<=b.windowBits&&b.windowBits<16&&(b.windowBits=-b.windowBits,b.windowBits===0&&(b.windowBits=-15)),!(0<=b.windowBits&&b.windowBits<16)||m&&m.windowBits||(b.windowBits+=32),15<b.windowBits&&b.windowBits<48&&(15&b.windowBits)==0&&(b.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new C,this.strm.avail_out=0;var S=d.inflateInit2(this.strm,b.windowBits);if(S!==x.Z_OK)throw new Error(g[S]);this.header=new j,d.inflateGetHeader(this.strm,this.header)}function _(m,b){var S=new v(b);if(S.push(m,!0),S.err)throw S.msg||g[S.err];return S.result}v.prototype.push=function(m,b){var S,y,k,U,O,M,T=this.strm,Z=this.options.chunkSize,V=this.options.dictionary,ue=!1;if(this.ended)return!1;y=b===~~b?b:b===!0?x.Z_FINISH:x.Z_NO_FLUSH,typeof m=="string"?T.input=p.binstring2buf(m):E.call(m)==="[object ArrayBuffer]"?T.input=new Uint8Array(m):T.input=m,T.next_in=0,T.avail_in=T.input.length;do{if(T.avail_out===0&&(T.output=new h.Buf8(Z),T.next_out=0,T.avail_out=Z),(S=d.inflate(T,x.Z_NO_FLUSH))===x.Z_NEED_DICT&&V&&(M=typeof V=="string"?p.string2buf(V):E.call(V)==="[object ArrayBuffer]"?new Uint8Array(V):V,S=d.inflateSetDictionary(this.strm,M)),S===x.Z_BUF_ERROR&&ue===!0&&(S=x.Z_OK,ue=!1),S!==x.Z_STREAM_END&&S!==x.Z_OK)return this.onEnd(S),!(this.ended=!0);T.next_out&&(T.avail_out!==0&&S!==x.Z_STREAM_END&&(T.avail_in!==0||y!==x.Z_FINISH&&y!==x.Z_SYNC_FLUSH)||(this.options.to==="string"?(k=p.utf8border(T.output,T.next_out),U=T.next_out-k,O=p.buf2string(T.output,k),T.next_out=U,T.avail_out=Z-U,U&&h.arraySet(T.output,T.output,k,U,0),this.onData(O)):this.onData(h.shrinkBuf(T.output,T.next_out)))),T.avail_in===0&&T.avail_out===0&&(ue=!0)}while((0<T.avail_in||T.avail_out===0)&&S!==x.Z_STREAM_END);return S===x.Z_STREAM_END&&(y=x.Z_FINISH),y===x.Z_FINISH?(S=d.inflateEnd(this.strm),this.onEnd(S),this.ended=!0,S===x.Z_OK):y!==x.Z_SYNC_FLUSH||(this.onEnd(x.Z_OK),!(T.avail_out=0))},v.prototype.onData=function(m){this.chunks.push(m)},v.prototype.onEnd=function(m){m===x.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=h.flattenChunks(this.chunks)),this.chunks=[],this.err=m,this.msg=this.strm.msg},f.Inflate=v,f.inflate=_,f.inflateRaw=function(m,b){return(b=b||{}).raw=!0,_(m,b)},f.ungzip=_},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(r,u,f){var d=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";f.assign=function(x){for(var g=Array.prototype.slice.call(arguments,1);g.length;){var C=g.shift();if(C){if(typeof C!="object")throw new TypeError(C+"must be non-object");for(var j in C)C.hasOwnProperty(j)&&(x[j]=C[j])}}return x},f.shrinkBuf=function(x,g){return x.length===g?x:x.subarray?x.subarray(0,g):(x.length=g,x)};var h={arraySet:function(x,g,C,j,E){if(g.subarray&&x.subarray)x.set(g.subarray(C,C+j),E);else for(var v=0;v<j;v++)x[E+v]=g[C+v]},flattenChunks:function(x){var g,C,j,E,v,_;for(g=j=0,C=x.length;g<C;g++)j+=x[g].length;for(_=new Uint8Array(j),g=E=0,C=x.length;g<C;g++)v=x[g],_.set(v,E),E+=v.length;return _}},p={arraySet:function(x,g,C,j,E){for(var v=0;v<j;v++)x[E+v]=g[C+v]},flattenChunks:function(x){return[].concat.apply([],x)}};f.setTyped=function(x){x?(f.Buf8=Uint8Array,f.Buf16=Uint16Array,f.Buf32=Int32Array,f.assign(f,h)):(f.Buf8=Array,f.Buf16=Array,f.Buf32=Array,f.assign(f,p))},f.setTyped(d)},{}],42:[function(r,u,f){var d=r("./common"),h=!0,p=!0;try{String.fromCharCode.apply(null,[0])}catch{h=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{p=!1}for(var x=new d.Buf8(256),g=0;g<256;g++)x[g]=252<=g?6:248<=g?5:240<=g?4:224<=g?3:192<=g?2:1;function C(j,E){if(E<65537&&(j.subarray&&p||!j.subarray&&h))return String.fromCharCode.apply(null,d.shrinkBuf(j,E));for(var v="",_=0;_<E;_++)v+=String.fromCharCode(j[_]);return v}x[254]=x[254]=1,f.string2buf=function(j){var E,v,_,m,b,S=j.length,y=0;for(m=0;m<S;m++)(64512&(v=j.charCodeAt(m)))==55296&&m+1<S&&(64512&(_=j.charCodeAt(m+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),m++),y+=v<128?1:v<2048?2:v<65536?3:4;for(E=new d.Buf8(y),m=b=0;b<y;m++)(64512&(v=j.charCodeAt(m)))==55296&&m+1<S&&(64512&(_=j.charCodeAt(m+1)))==56320&&(v=65536+(v-55296<<10)+(_-56320),m++),v<128?E[b++]=v:(v<2048?E[b++]=192|v>>>6:(v<65536?E[b++]=224|v>>>12:(E[b++]=240|v>>>18,E[b++]=128|v>>>12&63),E[b++]=128|v>>>6&63),E[b++]=128|63&v);return E},f.buf2binstring=function(j){return C(j,j.length)},f.binstring2buf=function(j){for(var E=new d.Buf8(j.length),v=0,_=E.length;v<_;v++)E[v]=j.charCodeAt(v);return E},f.buf2string=function(j,E){var v,_,m,b,S=E||j.length,y=new Array(2*S);for(v=_=0;v<S;)if((m=j[v++])<128)y[_++]=m;else if(4<(b=x[m]))y[_++]=65533,v+=b-1;else{for(m&=b===2?31:b===3?15:7;1<b&&v<S;)m=m<<6|63&j[v++],b--;1<b?y[_++]=65533:m<65536?y[_++]=m:(m-=65536,y[_++]=55296|m>>10&1023,y[_++]=56320|1023&m)}return C(y,_)},f.utf8border=function(j,E){var v;for((E=E||j.length)>j.length&&(E=j.length),v=E-1;0<=v&&(192&j[v])==128;)v--;return v<0||v===0?E:v+x[j[v]]>E?v:E}},{"./common":41}],43:[function(r,u,f){u.exports=function(d,h,p,x){for(var g=65535&d|0,C=d>>>16&65535|0,j=0;p!==0;){for(p-=j=2e3<p?2e3:p;C=C+(g=g+h[x++]|0)|0,--j;);g%=65521,C%=65521}return g|C<<16|0}},{}],44:[function(r,u,f){u.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(r,u,f){var d=(function(){for(var h,p=[],x=0;x<256;x++){h=x;for(var g=0;g<8;g++)h=1&h?3988292384^h>>>1:h>>>1;p[x]=h}return p})();u.exports=function(h,p,x,g){var C=d,j=g+x;h^=-1;for(var E=g;E<j;E++)h=h>>>8^C[255&(h^p[E])];return-1^h}},{}],46:[function(r,u,f){var d,h=r("../utils/common"),p=r("./trees"),x=r("./adler32"),g=r("./crc32"),C=r("./messages"),j=0,E=4,v=0,_=-2,m=-1,b=4,S=2,y=8,k=9,U=286,O=30,M=19,T=2*U+1,Z=15,V=3,ue=258,oe=ue+V+1,Y=42,ae=113,z=1,I=2,X=3,Q=4;function Ne(N,xe){return N.msg=C[xe],xe}function $(N){return(N<<1)-(4<N?9:0)}function re(N){for(var xe=N.length;0<=--xe;)N[xe]=0}function R(N){var xe=N.state,te=xe.pending;te>N.avail_out&&(te=N.avail_out),te!==0&&(h.arraySet(N.output,xe.pending_buf,xe.pending_out,te,N.next_out),N.next_out+=te,xe.pending_out+=te,N.total_out+=te,N.avail_out-=te,xe.pending-=te,xe.pending===0&&(xe.pending_out=0))}function B(N,xe){p._tr_flush_block(N,0<=N.block_start?N.block_start:-1,N.strstart-N.block_start,xe),N.block_start=N.strstart,R(N.strm)}function W(N,xe){N.pending_buf[N.pending++]=xe}function ee(N,xe){N.pending_buf[N.pending++]=xe>>>8&255,N.pending_buf[N.pending++]=255&xe}function H(N,xe){var te,q,L=N.max_chain_length,J=N.strstart,me=N.prev_length,ce=N.nice_match,K=N.strstart>N.w_size-oe?N.strstart-(N.w_size-oe):0,we=N.window,Ce=N.w_mask,je=N.prev,Oe=N.strstart+ue,Ve=we[J+me-1],He=we[J+me];N.prev_length>=N.good_match&&(L>>=2),ce>N.lookahead&&(ce=N.lookahead);do if(we[(te=xe)+me]===He&&we[te+me-1]===Ve&&we[te]===we[J]&&we[++te]===we[J+1]){J+=2,te++;do;while(we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&we[++J]===we[++te]&&J<Oe);if(q=ue-(Oe-J),J=Oe-ue,me<q){if(N.match_start=xe,ce<=(me=q))break;Ve=we[J+me-1],He=we[J+me]}}while((xe=je[xe&Ce])>K&&--L!=0);return me<=N.lookahead?me:N.lookahead}function ie(N){var xe,te,q,L,J,me,ce,K,we,Ce,je=N.w_size;do{if(L=N.window_size-N.lookahead-N.strstart,N.strstart>=je+(je-oe)){for(h.arraySet(N.window,N.window,je,je,0),N.match_start-=je,N.strstart-=je,N.block_start-=je,xe=te=N.hash_size;q=N.head[--xe],N.head[xe]=je<=q?q-je:0,--te;);for(xe=te=je;q=N.prev[--xe],N.prev[xe]=je<=q?q-je:0,--te;);L+=je}if(N.strm.avail_in===0)break;if(me=N.strm,ce=N.window,K=N.strstart+N.lookahead,we=L,Ce=void 0,Ce=me.avail_in,we<Ce&&(Ce=we),te=Ce===0?0:(me.avail_in-=Ce,h.arraySet(ce,me.input,me.next_in,Ce,K),me.state.wrap===1?me.adler=x(me.adler,ce,Ce,K):me.state.wrap===2&&(me.adler=g(me.adler,ce,Ce,K)),me.next_in+=Ce,me.total_in+=Ce,Ce),N.lookahead+=te,N.lookahead+N.insert>=V)for(J=N.strstart-N.insert,N.ins_h=N.window[J],N.ins_h=(N.ins_h<<N.hash_shift^N.window[J+1])&N.hash_mask;N.insert&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[J+V-1])&N.hash_mask,N.prev[J&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=J,J++,N.insert--,!(N.lookahead+N.insert<V)););}while(N.lookahead<oe&&N.strm.avail_in!==0)}function Ee(N,xe){for(var te,q;;){if(N.lookahead<oe){if(ie(N),N.lookahead<oe&&xe===j)return z;if(N.lookahead===0)break}if(te=0,N.lookahead>=V&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+V-1])&N.hash_mask,te=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),te!==0&&N.strstart-te<=N.w_size-oe&&(N.match_length=H(N,te)),N.match_length>=V)if(q=p._tr_tally(N,N.strstart-N.match_start,N.match_length-V),N.lookahead-=N.match_length,N.match_length<=N.max_lazy_match&&N.lookahead>=V){for(N.match_length--;N.strstart++,N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+V-1])&N.hash_mask,te=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart,--N.match_length!=0;);N.strstart++}else N.strstart+=N.match_length,N.match_length=0,N.ins_h=N.window[N.strstart],N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+1])&N.hash_mask;else q=p._tr_tally(N,0,N.window[N.strstart]),N.lookahead--,N.strstart++;if(q&&(B(N,!1),N.strm.avail_out===0))return z}return N.insert=N.strstart<V-1?N.strstart:V-1,xe===E?(B(N,!0),N.strm.avail_out===0?X:Q):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?z:I}function ze(N,xe){for(var te,q,L;;){if(N.lookahead<oe){if(ie(N),N.lookahead<oe&&xe===j)return z;if(N.lookahead===0)break}if(te=0,N.lookahead>=V&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+V-1])&N.hash_mask,te=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),N.prev_length=N.match_length,N.prev_match=N.match_start,N.match_length=V-1,te!==0&&N.prev_length<N.max_lazy_match&&N.strstart-te<=N.w_size-oe&&(N.match_length=H(N,te),N.match_length<=5&&(N.strategy===1||N.match_length===V&&4096<N.strstart-N.match_start)&&(N.match_length=V-1)),N.prev_length>=V&&N.match_length<=N.prev_length){for(L=N.strstart+N.lookahead-V,q=p._tr_tally(N,N.strstart-1-N.prev_match,N.prev_length-V),N.lookahead-=N.prev_length-1,N.prev_length-=2;++N.strstart<=L&&(N.ins_h=(N.ins_h<<N.hash_shift^N.window[N.strstart+V-1])&N.hash_mask,te=N.prev[N.strstart&N.w_mask]=N.head[N.ins_h],N.head[N.ins_h]=N.strstart),--N.prev_length!=0;);if(N.match_available=0,N.match_length=V-1,N.strstart++,q&&(B(N,!1),N.strm.avail_out===0))return z}else if(N.match_available){if((q=p._tr_tally(N,0,N.window[N.strstart-1]))&&B(N,!1),N.strstart++,N.lookahead--,N.strm.avail_out===0)return z}else N.match_available=1,N.strstart++,N.lookahead--}return N.match_available&&(q=p._tr_tally(N,0,N.window[N.strstart-1]),N.match_available=0),N.insert=N.strstart<V-1?N.strstart:V-1,xe===E?(B(N,!0),N.strm.avail_out===0?X:Q):N.last_lit&&(B(N,!1),N.strm.avail_out===0)?z:I}function Ae(N,xe,te,q,L){this.good_length=N,this.max_lazy=xe,this.nice_length=te,this.max_chain=q,this.func=L}function qe(){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=y,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 h.Buf16(2*T),this.dyn_dtree=new h.Buf16(2*(2*O+1)),this.bl_tree=new h.Buf16(2*(2*M+1)),re(this.dyn_ltree),re(this.dyn_dtree),re(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new h.Buf16(Z+1),this.heap=new h.Buf16(2*U+1),re(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new h.Buf16(2*U+1),re(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 Ke(N){var xe;return N&&N.state?(N.total_in=N.total_out=0,N.data_type=S,(xe=N.state).pending=0,xe.pending_out=0,xe.wrap<0&&(xe.wrap=-xe.wrap),xe.status=xe.wrap?Y:ae,N.adler=xe.wrap===2?0:1,xe.last_flush=j,p._tr_init(xe),v):Ne(N,_)}function pt(N){var xe=Ke(N);return xe===v&&(function(te){te.window_size=2*te.w_size,re(te.head),te.max_lazy_match=d[te.level].max_lazy,te.good_match=d[te.level].good_length,te.nice_match=d[te.level].nice_length,te.max_chain_length=d[te.level].max_chain,te.strstart=0,te.block_start=0,te.lookahead=0,te.insert=0,te.match_length=te.prev_length=V-1,te.match_available=0,te.ins_h=0})(N.state),xe}function ot(N,xe,te,q,L,J){if(!N)return _;var me=1;if(xe===m&&(xe=6),q<0?(me=0,q=-q):15<q&&(me=2,q-=16),L<1||k<L||te!==y||q<8||15<q||xe<0||9<xe||J<0||b<J)return Ne(N,_);q===8&&(q=9);var ce=new qe;return(N.state=ce).strm=N,ce.wrap=me,ce.gzhead=null,ce.w_bits=q,ce.w_size=1<<ce.w_bits,ce.w_mask=ce.w_size-1,ce.hash_bits=L+7,ce.hash_size=1<<ce.hash_bits,ce.hash_mask=ce.hash_size-1,ce.hash_shift=~~((ce.hash_bits+V-1)/V),ce.window=new h.Buf8(2*ce.w_size),ce.head=new h.Buf16(ce.hash_size),ce.prev=new h.Buf16(ce.w_size),ce.lit_bufsize=1<<L+6,ce.pending_buf_size=4*ce.lit_bufsize,ce.pending_buf=new h.Buf8(ce.pending_buf_size),ce.d_buf=1*ce.lit_bufsize,ce.l_buf=3*ce.lit_bufsize,ce.level=xe,ce.strategy=J,ce.method=te,pt(N)}d=[new Ae(0,0,0,0,function(N,xe){var te=65535;for(te>N.pending_buf_size-5&&(te=N.pending_buf_size-5);;){if(N.lookahead<=1){if(ie(N),N.lookahead===0&&xe===j)return z;if(N.lookahead===0)break}N.strstart+=N.lookahead,N.lookahead=0;var q=N.block_start+te;if((N.strstart===0||N.strstart>=q)&&(N.lookahead=N.strstart-q,N.strstart=q,B(N,!1),N.strm.avail_out===0)||N.strstart-N.block_start>=N.w_size-oe&&(B(N,!1),N.strm.avail_out===0))return z}return N.insert=0,xe===E?(B(N,!0),N.strm.avail_out===0?X:Q):(N.strstart>N.block_start&&(B(N,!1),N.strm.avail_out),z)}),new Ae(4,4,8,4,Ee),new Ae(4,5,16,8,Ee),new Ae(4,6,32,32,Ee),new Ae(4,4,16,16,ze),new Ae(8,16,32,32,ze),new Ae(8,16,128,128,ze),new Ae(8,32,128,256,ze),new Ae(32,128,258,1024,ze),new Ae(32,258,258,4096,ze)],f.deflateInit=function(N,xe){return ot(N,xe,y,15,8,0)},f.deflateInit2=ot,f.deflateReset=pt,f.deflateResetKeep=Ke,f.deflateSetHeader=function(N,xe){return N&&N.state?N.state.wrap!==2?_:(N.state.gzhead=xe,v):_},f.deflate=function(N,xe){var te,q,L,J;if(!N||!N.state||5<xe||xe<0)return N?Ne(N,_):_;if(q=N.state,!N.output||!N.input&&N.avail_in!==0||q.status===666&&xe!==E)return Ne(N,N.avail_out===0?-5:_);if(q.strm=N,te=q.last_flush,q.last_flush=xe,q.status===Y)if(q.wrap===2)N.adler=0,W(q,31),W(q,139),W(q,8),q.gzhead?(W(q,(q.gzhead.text?1:0)+(q.gzhead.hcrc?2:0)+(q.gzhead.extra?4:0)+(q.gzhead.name?8:0)+(q.gzhead.comment?16:0)),W(q,255&q.gzhead.time),W(q,q.gzhead.time>>8&255),W(q,q.gzhead.time>>16&255),W(q,q.gzhead.time>>24&255),W(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),W(q,255&q.gzhead.os),q.gzhead.extra&&q.gzhead.extra.length&&(W(q,255&q.gzhead.extra.length),W(q,q.gzhead.extra.length>>8&255)),q.gzhead.hcrc&&(N.adler=g(N.adler,q.pending_buf,q.pending,0)),q.gzindex=0,q.status=69):(W(q,0),W(q,0),W(q,0),W(q,0),W(q,0),W(q,q.level===9?2:2<=q.strategy||q.level<2?4:0),W(q,3),q.status=ae);else{var me=y+(q.w_bits-8<<4)<<8;me|=(2<=q.strategy||q.level<2?0:q.level<6?1:q.level===6?2:3)<<6,q.strstart!==0&&(me|=32),me+=31-me%31,q.status=ae,ee(q,me),q.strstart!==0&&(ee(q,N.adler>>>16),ee(q,65535&N.adler)),N.adler=1}if(q.status===69)if(q.gzhead.extra){for(L=q.pending;q.gzindex<(65535&q.gzhead.extra.length)&&(q.pending!==q.pending_buf_size||(q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),R(N),L=q.pending,q.pending!==q.pending_buf_size));)W(q,255&q.gzhead.extra[q.gzindex]),q.gzindex++;q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),q.gzindex===q.gzhead.extra.length&&(q.gzindex=0,q.status=73)}else q.status=73;if(q.status===73)if(q.gzhead.name){L=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),R(N),L=q.pending,q.pending===q.pending_buf_size)){J=1;break}J=q.gzindex<q.gzhead.name.length?255&q.gzhead.name.charCodeAt(q.gzindex++):0,W(q,J)}while(J!==0);q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),J===0&&(q.gzindex=0,q.status=91)}else q.status=91;if(q.status===91)if(q.gzhead.comment){L=q.pending;do{if(q.pending===q.pending_buf_size&&(q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),R(N),L=q.pending,q.pending===q.pending_buf_size)){J=1;break}J=q.gzindex<q.gzhead.comment.length?255&q.gzhead.comment.charCodeAt(q.gzindex++):0,W(q,J)}while(J!==0);q.gzhead.hcrc&&q.pending>L&&(N.adler=g(N.adler,q.pending_buf,q.pending-L,L)),J===0&&(q.status=103)}else q.status=103;if(q.status===103&&(q.gzhead.hcrc?(q.pending+2>q.pending_buf_size&&R(N),q.pending+2<=q.pending_buf_size&&(W(q,255&N.adler),W(q,N.adler>>8&255),N.adler=0,q.status=ae)):q.status=ae),q.pending!==0){if(R(N),N.avail_out===0)return q.last_flush=-1,v}else if(N.avail_in===0&&$(xe)<=$(te)&&xe!==E)return Ne(N,-5);if(q.status===666&&N.avail_in!==0)return Ne(N,-5);if(N.avail_in!==0||q.lookahead!==0||xe!==j&&q.status!==666){var ce=q.strategy===2?(function(K,we){for(var Ce;;){if(K.lookahead===0&&(ie(K),K.lookahead===0)){if(we===j)return z;break}if(K.match_length=0,Ce=p._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++,Ce&&(B(K,!1),K.strm.avail_out===0))return z}return K.insert=0,we===E?(B(K,!0),K.strm.avail_out===0?X:Q):K.last_lit&&(B(K,!1),K.strm.avail_out===0)?z:I})(q,xe):q.strategy===3?(function(K,we){for(var Ce,je,Oe,Ve,He=K.window;;){if(K.lookahead<=ue){if(ie(K),K.lookahead<=ue&&we===j)return z;if(K.lookahead===0)break}if(K.match_length=0,K.lookahead>=V&&0<K.strstart&&(je=He[Oe=K.strstart-1])===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]){Ve=K.strstart+ue;do;while(je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&je===He[++Oe]&&Oe<Ve);K.match_length=ue-(Ve-Oe),K.match_length>K.lookahead&&(K.match_length=K.lookahead)}if(K.match_length>=V?(Ce=p._tr_tally(K,1,K.match_length-V),K.lookahead-=K.match_length,K.strstart+=K.match_length,K.match_length=0):(Ce=p._tr_tally(K,0,K.window[K.strstart]),K.lookahead--,K.strstart++),Ce&&(B(K,!1),K.strm.avail_out===0))return z}return K.insert=0,we===E?(B(K,!0),K.strm.avail_out===0?X:Q):K.last_lit&&(B(K,!1),K.strm.avail_out===0)?z:I})(q,xe):d[q.level].func(q,xe);if(ce!==X&&ce!==Q||(q.status=666),ce===z||ce===X)return N.avail_out===0&&(q.last_flush=-1),v;if(ce===I&&(xe===1?p._tr_align(q):xe!==5&&(p._tr_stored_block(q,0,0,!1),xe===3&&(re(q.head),q.lookahead===0&&(q.strstart=0,q.block_start=0,q.insert=0))),R(N),N.avail_out===0))return q.last_flush=-1,v}return xe!==E?v:q.wrap<=0?1:(q.wrap===2?(W(q,255&N.adler),W(q,N.adler>>8&255),W(q,N.adler>>16&255),W(q,N.adler>>24&255),W(q,255&N.total_in),W(q,N.total_in>>8&255),W(q,N.total_in>>16&255),W(q,N.total_in>>24&255)):(ee(q,N.adler>>>16),ee(q,65535&N.adler)),R(N),0<q.wrap&&(q.wrap=-q.wrap),q.pending!==0?v:1)},f.deflateEnd=function(N){var xe;return N&&N.state?(xe=N.state.status)!==Y&&xe!==69&&xe!==73&&xe!==91&&xe!==103&&xe!==ae&&xe!==666?Ne(N,_):(N.state=null,xe===ae?Ne(N,-3):v):_},f.deflateSetDictionary=function(N,xe){var te,q,L,J,me,ce,K,we,Ce=xe.length;if(!N||!N.state||(J=(te=N.state).wrap)===2||J===1&&te.status!==Y||te.lookahead)return _;for(J===1&&(N.adler=x(N.adler,xe,Ce,0)),te.wrap=0,Ce>=te.w_size&&(J===0&&(re(te.head),te.strstart=0,te.block_start=0,te.insert=0),we=new h.Buf8(te.w_size),h.arraySet(we,xe,Ce-te.w_size,te.w_size,0),xe=we,Ce=te.w_size),me=N.avail_in,ce=N.next_in,K=N.input,N.avail_in=Ce,N.next_in=0,N.input=xe,ie(te);te.lookahead>=V;){for(q=te.strstart,L=te.lookahead-(V-1);te.ins_h=(te.ins_h<<te.hash_shift^te.window[q+V-1])&te.hash_mask,te.prev[q&te.w_mask]=te.head[te.ins_h],te.head[te.ins_h]=q,q++,--L;);te.strstart=q,te.lookahead=V-1,ie(te)}return te.strstart+=te.lookahead,te.block_start=te.strstart,te.insert=te.lookahead,te.lookahead=0,te.match_length=te.prev_length=V-1,te.match_available=0,N.next_in=ce,N.input=K,N.avail_in=me,te.wrap=J,v},f.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(r,u,f){u.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(r,u,f){u.exports=function(d,h){var p,x,g,C,j,E,v,_,m,b,S,y,k,U,O,M,T,Z,V,ue,oe,Y,ae,z,I;p=d.state,x=d.next_in,z=d.input,g=x+(d.avail_in-5),C=d.next_out,I=d.output,j=C-(h-d.avail_out),E=C+(d.avail_out-257),v=p.dmax,_=p.wsize,m=p.whave,b=p.wnext,S=p.window,y=p.hold,k=p.bits,U=p.lencode,O=p.distcode,M=(1<<p.lenbits)-1,T=(1<<p.distbits)-1;e:do{k<15&&(y+=z[x++]<<k,k+=8,y+=z[x++]<<k,k+=8),Z=U[y&M];t:for(;;){if(y>>>=V=Z>>>24,k-=V,(V=Z>>>16&255)===0)I[C++]=65535&Z;else{if(!(16&V)){if((64&V)==0){Z=U[(65535&Z)+(y&(1<<V)-1)];continue t}if(32&V){p.mode=12;break e}d.msg="invalid literal/length code",p.mode=30;break e}ue=65535&Z,(V&=15)&&(k<V&&(y+=z[x++]<<k,k+=8),ue+=y&(1<<V)-1,y>>>=V,k-=V),k<15&&(y+=z[x++]<<k,k+=8,y+=z[x++]<<k,k+=8),Z=O[y&T];a:for(;;){if(y>>>=V=Z>>>24,k-=V,!(16&(V=Z>>>16&255))){if((64&V)==0){Z=O[(65535&Z)+(y&(1<<V)-1)];continue a}d.msg="invalid distance code",p.mode=30;break e}if(oe=65535&Z,k<(V&=15)&&(y+=z[x++]<<k,(k+=8)<V&&(y+=z[x++]<<k,k+=8)),v<(oe+=y&(1<<V)-1)){d.msg="invalid distance too far back",p.mode=30;break e}if(y>>>=V,k-=V,(V=C-j)<oe){if(m<(V=oe-V)&&p.sane){d.msg="invalid distance too far back",p.mode=30;break e}if(ae=S,(Y=0)===b){if(Y+=_-V,V<ue){for(ue-=V;I[C++]=S[Y++],--V;);Y=C-oe,ae=I}}else if(b<V){if(Y+=_+b-V,(V-=b)<ue){for(ue-=V;I[C++]=S[Y++],--V;);if(Y=0,b<ue){for(ue-=V=b;I[C++]=S[Y++],--V;);Y=C-oe,ae=I}}}else if(Y+=b-V,V<ue){for(ue-=V;I[C++]=S[Y++],--V;);Y=C-oe,ae=I}for(;2<ue;)I[C++]=ae[Y++],I[C++]=ae[Y++],I[C++]=ae[Y++],ue-=3;ue&&(I[C++]=ae[Y++],1<ue&&(I[C++]=ae[Y++]))}else{for(Y=C-oe;I[C++]=I[Y++],I[C++]=I[Y++],I[C++]=I[Y++],2<(ue-=3););ue&&(I[C++]=I[Y++],1<ue&&(I[C++]=I[Y++]))}break}}break}}while(x<g&&C<E);x-=ue=k>>3,y&=(1<<(k-=ue<<3))-1,d.next_in=x,d.next_out=C,d.avail_in=x<g?g-x+5:5-(x-g),d.avail_out=C<E?E-C+257:257-(C-E),p.hold=y,p.bits=k}},{}],49:[function(r,u,f){var d=r("../utils/common"),h=r("./adler32"),p=r("./crc32"),x=r("./inffast"),g=r("./inftrees"),C=1,j=2,E=0,v=-2,_=1,m=852,b=592;function S(Y){return(Y>>>24&255)+(Y>>>8&65280)+((65280&Y)<<8)+((255&Y)<<24)}function y(){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 k(Y){var ae;return Y&&Y.state?(ae=Y.state,Y.total_in=Y.total_out=ae.total=0,Y.msg="",ae.wrap&&(Y.adler=1&ae.wrap),ae.mode=_,ae.last=0,ae.havedict=0,ae.dmax=32768,ae.head=null,ae.hold=0,ae.bits=0,ae.lencode=ae.lendyn=new d.Buf32(m),ae.distcode=ae.distdyn=new d.Buf32(b),ae.sane=1,ae.back=-1,E):v}function U(Y){var ae;return Y&&Y.state?((ae=Y.state).wsize=0,ae.whave=0,ae.wnext=0,k(Y)):v}function O(Y,ae){var z,I;return Y&&Y.state?(I=Y.state,ae<0?(z=0,ae=-ae):(z=1+(ae>>4),ae<48&&(ae&=15)),ae&&(ae<8||15<ae)?v:(I.window!==null&&I.wbits!==ae&&(I.window=null),I.wrap=z,I.wbits=ae,U(Y))):v}function M(Y,ae){var z,I;return Y?(I=new y,(Y.state=I).window=null,(z=O(Y,ae))!==E&&(Y.state=null),z):v}var T,Z,V=!0;function ue(Y){if(V){var ae;for(T=new d.Buf32(512),Z=new d.Buf32(32),ae=0;ae<144;)Y.lens[ae++]=8;for(;ae<256;)Y.lens[ae++]=9;for(;ae<280;)Y.lens[ae++]=7;for(;ae<288;)Y.lens[ae++]=8;for(g(C,Y.lens,0,288,T,0,Y.work,{bits:9}),ae=0;ae<32;)Y.lens[ae++]=5;g(j,Y.lens,0,32,Z,0,Y.work,{bits:5}),V=!1}Y.lencode=T,Y.lenbits=9,Y.distcode=Z,Y.distbits=5}function oe(Y,ae,z,I){var X,Q=Y.state;return Q.window===null&&(Q.wsize=1<<Q.wbits,Q.wnext=0,Q.whave=0,Q.window=new d.Buf8(Q.wsize)),I>=Q.wsize?(d.arraySet(Q.window,ae,z-Q.wsize,Q.wsize,0),Q.wnext=0,Q.whave=Q.wsize):(I<(X=Q.wsize-Q.wnext)&&(X=I),d.arraySet(Q.window,ae,z-I,X,Q.wnext),(I-=X)?(d.arraySet(Q.window,ae,z-I,I,0),Q.wnext=I,Q.whave=Q.wsize):(Q.wnext+=X,Q.wnext===Q.wsize&&(Q.wnext=0),Q.whave<Q.wsize&&(Q.whave+=X))),0}f.inflateReset=U,f.inflateReset2=O,f.inflateResetKeep=k,f.inflateInit=function(Y){return M(Y,15)},f.inflateInit2=M,f.inflate=function(Y,ae){var z,I,X,Q,Ne,$,re,R,B,W,ee,H,ie,Ee,ze,Ae,qe,Ke,pt,ot,N,xe,te,q,L=0,J=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(!Y||!Y.state||!Y.output||!Y.input&&Y.avail_in!==0)return v;(z=Y.state).mode===12&&(z.mode=13),Ne=Y.next_out,X=Y.output,re=Y.avail_out,Q=Y.next_in,I=Y.input,$=Y.avail_in,R=z.hold,B=z.bits,W=$,ee=re,xe=E;e:for(;;)switch(z.mode){case _:if(z.wrap===0){z.mode=13;break}for(;B<16;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(2&z.wrap&&R===35615){J[z.check=0]=255&R,J[1]=R>>>8&255,z.check=p(z.check,J,2,0),B=R=0,z.mode=2;break}if(z.flags=0,z.head&&(z.head.done=!1),!(1&z.wrap)||(((255&R)<<8)+(R>>8))%31){Y.msg="incorrect header check",z.mode=30;break}if((15&R)!=8){Y.msg="unknown compression method",z.mode=30;break}if(B-=4,N=8+(15&(R>>>=4)),z.wbits===0)z.wbits=N;else if(N>z.wbits){Y.msg="invalid window size",z.mode=30;break}z.dmax=1<<N,Y.adler=z.check=1,z.mode=512&R?10:12,B=R=0;break;case 2:for(;B<16;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(z.flags=R,(255&z.flags)!=8){Y.msg="unknown compression method",z.mode=30;break}if(57344&z.flags){Y.msg="unknown header flags set",z.mode=30;break}z.head&&(z.head.text=R>>8&1),512&z.flags&&(J[0]=255&R,J[1]=R>>>8&255,z.check=p(z.check,J,2,0)),B=R=0,z.mode=3;case 3:for(;B<32;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.head&&(z.head.time=R),512&z.flags&&(J[0]=255&R,J[1]=R>>>8&255,J[2]=R>>>16&255,J[3]=R>>>24&255,z.check=p(z.check,J,4,0)),B=R=0,z.mode=4;case 4:for(;B<16;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.head&&(z.head.xflags=255&R,z.head.os=R>>8),512&z.flags&&(J[0]=255&R,J[1]=R>>>8&255,z.check=p(z.check,J,2,0)),B=R=0,z.mode=5;case 5:if(1024&z.flags){for(;B<16;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.length=R,z.head&&(z.head.extra_len=R),512&z.flags&&(J[0]=255&R,J[1]=R>>>8&255,z.check=p(z.check,J,2,0)),B=R=0}else z.head&&(z.head.extra=null);z.mode=6;case 6:if(1024&z.flags&&($<(H=z.length)&&(H=$),H&&(z.head&&(N=z.head.extra_len-z.length,z.head.extra||(z.head.extra=new Array(z.head.extra_len)),d.arraySet(z.head.extra,I,Q,H,N)),512&z.flags&&(z.check=p(z.check,I,H,Q)),$-=H,Q+=H,z.length-=H),z.length))break e;z.length=0,z.mode=7;case 7:if(2048&z.flags){if($===0)break e;for(H=0;N=I[Q+H++],z.head&&N&&z.length<65536&&(z.head.name+=String.fromCharCode(N)),N&&H<$;);if(512&z.flags&&(z.check=p(z.check,I,H,Q)),$-=H,Q+=H,N)break e}else z.head&&(z.head.name=null);z.length=0,z.mode=8;case 8:if(4096&z.flags){if($===0)break e;for(H=0;N=I[Q+H++],z.head&&N&&z.length<65536&&(z.head.comment+=String.fromCharCode(N)),N&&H<$;);if(512&z.flags&&(z.check=p(z.check,I,H,Q)),$-=H,Q+=H,N)break e}else z.head&&(z.head.comment=null);z.mode=9;case 9:if(512&z.flags){for(;B<16;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(R!==(65535&z.check)){Y.msg="header crc mismatch",z.mode=30;break}B=R=0}z.head&&(z.head.hcrc=z.flags>>9&1,z.head.done=!0),Y.adler=z.check=0,z.mode=12;break;case 10:for(;B<32;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}Y.adler=z.check=S(R),B=R=0,z.mode=11;case 11:if(z.havedict===0)return Y.next_out=Ne,Y.avail_out=re,Y.next_in=Q,Y.avail_in=$,z.hold=R,z.bits=B,2;Y.adler=z.check=1,z.mode=12;case 12:if(ae===5||ae===6)break e;case 13:if(z.last){R>>>=7&B,B-=7&B,z.mode=27;break}for(;B<3;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}switch(z.last=1&R,B-=1,3&(R>>>=1)){case 0:z.mode=14;break;case 1:if(ue(z),z.mode=20,ae!==6)break;R>>>=2,B-=2;break e;case 2:z.mode=17;break;case 3:Y.msg="invalid block type",z.mode=30}R>>>=2,B-=2;break;case 14:for(R>>>=7&B,B-=7&B;B<32;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if((65535&R)!=(R>>>16^65535)){Y.msg="invalid stored block lengths",z.mode=30;break}if(z.length=65535&R,B=R=0,z.mode=15,ae===6)break e;case 15:z.mode=16;case 16:if(H=z.length){if($<H&&(H=$),re<H&&(H=re),H===0)break e;d.arraySet(X,I,Q,H,Ne),$-=H,Q+=H,re-=H,Ne+=H,z.length-=H;break}z.mode=12;break;case 17:for(;B<14;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(z.nlen=257+(31&R),R>>>=5,B-=5,z.ndist=1+(31&R),R>>>=5,B-=5,z.ncode=4+(15&R),R>>>=4,B-=4,286<z.nlen||30<z.ndist){Y.msg="too many length or distance symbols",z.mode=30;break}z.have=0,z.mode=18;case 18:for(;z.have<z.ncode;){for(;B<3;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.lens[me[z.have++]]=7&R,R>>>=3,B-=3}for(;z.have<19;)z.lens[me[z.have++]]=0;if(z.lencode=z.lendyn,z.lenbits=7,te={bits:z.lenbits},xe=g(0,z.lens,0,19,z.lencode,0,z.work,te),z.lenbits=te.bits,xe){Y.msg="invalid code lengths set",z.mode=30;break}z.have=0,z.mode=19;case 19:for(;z.have<z.nlen+z.ndist;){for(;Ae=(L=z.lencode[R&(1<<z.lenbits)-1])>>>16&255,qe=65535&L,!((ze=L>>>24)<=B);){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(qe<16)R>>>=ze,B-=ze,z.lens[z.have++]=qe;else{if(qe===16){for(q=ze+2;B<q;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(R>>>=ze,B-=ze,z.have===0){Y.msg="invalid bit length repeat",z.mode=30;break}N=z.lens[z.have-1],H=3+(3&R),R>>>=2,B-=2}else if(qe===17){for(q=ze+3;B<q;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}B-=ze,N=0,H=3+(7&(R>>>=ze)),R>>>=3,B-=3}else{for(q=ze+7;B<q;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}B-=ze,N=0,H=11+(127&(R>>>=ze)),R>>>=7,B-=7}if(z.have+H>z.nlen+z.ndist){Y.msg="invalid bit length repeat",z.mode=30;break}for(;H--;)z.lens[z.have++]=N}}if(z.mode===30)break;if(z.lens[256]===0){Y.msg="invalid code -- missing end-of-block",z.mode=30;break}if(z.lenbits=9,te={bits:z.lenbits},xe=g(C,z.lens,0,z.nlen,z.lencode,0,z.work,te),z.lenbits=te.bits,xe){Y.msg="invalid literal/lengths set",z.mode=30;break}if(z.distbits=6,z.distcode=z.distdyn,te={bits:z.distbits},xe=g(j,z.lens,z.nlen,z.ndist,z.distcode,0,z.work,te),z.distbits=te.bits,xe){Y.msg="invalid distances set",z.mode=30;break}if(z.mode=20,ae===6)break e;case 20:z.mode=21;case 21:if(6<=$&&258<=re){Y.next_out=Ne,Y.avail_out=re,Y.next_in=Q,Y.avail_in=$,z.hold=R,z.bits=B,x(Y,ee),Ne=Y.next_out,X=Y.output,re=Y.avail_out,Q=Y.next_in,I=Y.input,$=Y.avail_in,R=z.hold,B=z.bits,z.mode===12&&(z.back=-1);break}for(z.back=0;Ae=(L=z.lencode[R&(1<<z.lenbits)-1])>>>16&255,qe=65535&L,!((ze=L>>>24)<=B);){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(Ae&&(240&Ae)==0){for(Ke=ze,pt=Ae,ot=qe;Ae=(L=z.lencode[ot+((R&(1<<Ke+pt)-1)>>Ke)])>>>16&255,qe=65535&L,!(Ke+(ze=L>>>24)<=B);){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}R>>>=Ke,B-=Ke,z.back+=Ke}if(R>>>=ze,B-=ze,z.back+=ze,z.length=qe,Ae===0){z.mode=26;break}if(32&Ae){z.back=-1,z.mode=12;break}if(64&Ae){Y.msg="invalid literal/length code",z.mode=30;break}z.extra=15&Ae,z.mode=22;case 22:if(z.extra){for(q=z.extra;B<q;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.length+=R&(1<<z.extra)-1,R>>>=z.extra,B-=z.extra,z.back+=z.extra}z.was=z.length,z.mode=23;case 23:for(;Ae=(L=z.distcode[R&(1<<z.distbits)-1])>>>16&255,qe=65535&L,!((ze=L>>>24)<=B);){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if((240&Ae)==0){for(Ke=ze,pt=Ae,ot=qe;Ae=(L=z.distcode[ot+((R&(1<<Ke+pt)-1)>>Ke)])>>>16&255,qe=65535&L,!(Ke+(ze=L>>>24)<=B);){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}R>>>=Ke,B-=Ke,z.back+=Ke}if(R>>>=ze,B-=ze,z.back+=ze,64&Ae){Y.msg="invalid distance code",z.mode=30;break}z.offset=qe,z.extra=15&Ae,z.mode=24;case 24:if(z.extra){for(q=z.extra;B<q;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}z.offset+=R&(1<<z.extra)-1,R>>>=z.extra,B-=z.extra,z.back+=z.extra}if(z.offset>z.dmax){Y.msg="invalid distance too far back",z.mode=30;break}z.mode=25;case 25:if(re===0)break e;if(H=ee-re,z.offset>H){if((H=z.offset-H)>z.whave&&z.sane){Y.msg="invalid distance too far back",z.mode=30;break}ie=H>z.wnext?(H-=z.wnext,z.wsize-H):z.wnext-H,H>z.length&&(H=z.length),Ee=z.window}else Ee=X,ie=Ne-z.offset,H=z.length;for(re<H&&(H=re),re-=H,z.length-=H;X[Ne++]=Ee[ie++],--H;);z.length===0&&(z.mode=21);break;case 26:if(re===0)break e;X[Ne++]=z.length,re--,z.mode=21;break;case 27:if(z.wrap){for(;B<32;){if($===0)break e;$--,R|=I[Q++]<<B,B+=8}if(ee-=re,Y.total_out+=ee,z.total+=ee,ee&&(Y.adler=z.check=z.flags?p(z.check,X,ee,Ne-ee):h(z.check,X,ee,Ne-ee)),ee=re,(z.flags?R:S(R))!==z.check){Y.msg="incorrect data check",z.mode=30;break}B=R=0}z.mode=28;case 28:if(z.wrap&&z.flags){for(;B<32;){if($===0)break e;$--,R+=I[Q++]<<B,B+=8}if(R!==(4294967295&z.total)){Y.msg="incorrect length check",z.mode=30;break}B=R=0}z.mode=29;case 29:xe=1;break e;case 30:xe=-3;break e;case 31:return-4;default:return v}return Y.next_out=Ne,Y.avail_out=re,Y.next_in=Q,Y.avail_in=$,z.hold=R,z.bits=B,(z.wsize||ee!==Y.avail_out&&z.mode<30&&(z.mode<27||ae!==4))&&oe(Y,Y.output,Y.next_out,ee-Y.avail_out)?(z.mode=31,-4):(W-=Y.avail_in,ee-=Y.avail_out,Y.total_in+=W,Y.total_out+=ee,z.total+=ee,z.wrap&&ee&&(Y.adler=z.check=z.flags?p(z.check,X,ee,Y.next_out-ee):h(z.check,X,ee,Y.next_out-ee)),Y.data_type=z.bits+(z.last?64:0)+(z.mode===12?128:0)+(z.mode===20||z.mode===15?256:0),(W==0&&ee===0||ae===4)&&xe===E&&(xe=-5),xe)},f.inflateEnd=function(Y){if(!Y||!Y.state)return v;var ae=Y.state;return ae.window&&(ae.window=null),Y.state=null,E},f.inflateGetHeader=function(Y,ae){var z;return Y&&Y.state?(2&(z=Y.state).wrap)==0?v:((z.head=ae).done=!1,E):v},f.inflateSetDictionary=function(Y,ae){var z,I=ae.length;return Y&&Y.state?(z=Y.state).wrap!==0&&z.mode!==11?v:z.mode===11&&h(1,ae,I,0)!==z.check?-3:oe(Y,ae,I,I)?(z.mode=31,-4):(z.havedict=1,E):v},f.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(r,u,f){var d=r("../utils/common"),h=[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],g=[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];u.exports=function(C,j,E,v,_,m,b,S){var y,k,U,O,M,T,Z,V,ue,oe=S.bits,Y=0,ae=0,z=0,I=0,X=0,Q=0,Ne=0,$=0,re=0,R=0,B=null,W=0,ee=new d.Buf16(16),H=new d.Buf16(16),ie=null,Ee=0;for(Y=0;Y<=15;Y++)ee[Y]=0;for(ae=0;ae<v;ae++)ee[j[E+ae]]++;for(X=oe,I=15;1<=I&&ee[I]===0;I--);if(I<X&&(X=I),I===0)return _[m++]=20971520,_[m++]=20971520,S.bits=1,0;for(z=1;z<I&&ee[z]===0;z++);for(X<z&&(X=z),Y=$=1;Y<=15;Y++)if($<<=1,($-=ee[Y])<0)return-1;if(0<$&&(C===0||I!==1))return-1;for(H[1]=0,Y=1;Y<15;Y++)H[Y+1]=H[Y]+ee[Y];for(ae=0;ae<v;ae++)j[E+ae]!==0&&(b[H[j[E+ae]]++]=ae);if(T=C===0?(B=ie=b,19):C===1?(B=h,W-=257,ie=p,Ee-=257,256):(B=x,ie=g,-1),Y=z,M=m,Ne=ae=R=0,U=-1,O=(re=1<<(Q=X))-1,C===1&&852<re||C===2&&592<re)return 1;for(;;){for(Z=Y-Ne,ue=b[ae]<T?(V=0,b[ae]):b[ae]>T?(V=ie[Ee+b[ae]],B[W+b[ae]]):(V=96,0),y=1<<Y-Ne,z=k=1<<Q;_[M+(R>>Ne)+(k-=y)]=Z<<24|V<<16|ue|0,k!==0;);for(y=1<<Y-1;R&y;)y>>=1;if(y!==0?(R&=y-1,R+=y):R=0,ae++,--ee[Y]==0){if(Y===I)break;Y=j[E+b[ae]]}if(X<Y&&(R&O)!==U){for(Ne===0&&(Ne=X),M+=z,$=1<<(Q=Y-Ne);Q+Ne<I&&!(($-=ee[Q+Ne])<=0);)Q++,$<<=1;if(re+=1<<Q,C===1&&852<re||C===2&&592<re)return 1;_[U=R&O]=X<<24|Q<<16|M-m|0}}return R!==0&&(_[M+R]=Y-Ne<<24|64<<16|0),S.bits=X,0}},{"../utils/common":41}],51:[function(r,u,f){u.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(r,u,f){var d=r("../utils/common"),h=0,p=1;function x(L){for(var J=L.length;0<=--J;)L[J]=0}var g=0,C=29,j=256,E=j+1+C,v=30,_=19,m=2*E+1,b=15,S=16,y=7,k=256,U=16,O=17,M=18,T=[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],Z=[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],V=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],ue=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],oe=new Array(2*(E+2));x(oe);var Y=new Array(2*v);x(Y);var ae=new Array(512);x(ae);var z=new Array(256);x(z);var I=new Array(C);x(I);var X,Q,Ne,$=new Array(v);function re(L,J,me,ce,K){this.static_tree=L,this.extra_bits=J,this.extra_base=me,this.elems=ce,this.max_length=K,this.has_stree=L&&L.length}function R(L,J){this.dyn_tree=L,this.max_code=0,this.stat_desc=J}function B(L){return L<256?ae[L]:ae[256+(L>>>7)]}function W(L,J){L.pending_buf[L.pending++]=255&J,L.pending_buf[L.pending++]=J>>>8&255}function ee(L,J,me){L.bi_valid>S-me?(L.bi_buf|=J<<L.bi_valid&65535,W(L,L.bi_buf),L.bi_buf=J>>S-L.bi_valid,L.bi_valid+=me-S):(L.bi_buf|=J<<L.bi_valid&65535,L.bi_valid+=me)}function H(L,J,me){ee(L,me[2*J],me[2*J+1])}function ie(L,J){for(var me=0;me|=1&L,L>>>=1,me<<=1,0<--J;);return me>>>1}function Ee(L,J,me){var ce,K,we=new Array(b+1),Ce=0;for(ce=1;ce<=b;ce++)we[ce]=Ce=Ce+me[ce-1]<<1;for(K=0;K<=J;K++){var je=L[2*K+1];je!==0&&(L[2*K]=ie(we[je]++,je))}}function ze(L){var J;for(J=0;J<E;J++)L.dyn_ltree[2*J]=0;for(J=0;J<v;J++)L.dyn_dtree[2*J]=0;for(J=0;J<_;J++)L.bl_tree[2*J]=0;L.dyn_ltree[2*k]=1,L.opt_len=L.static_len=0,L.last_lit=L.matches=0}function Ae(L){8<L.bi_valid?W(L,L.bi_buf):0<L.bi_valid&&(L.pending_buf[L.pending++]=L.bi_buf),L.bi_buf=0,L.bi_valid=0}function qe(L,J,me,ce){var K=2*J,we=2*me;return L[K]<L[we]||L[K]===L[we]&&ce[J]<=ce[me]}function Ke(L,J,me){for(var ce=L.heap[me],K=me<<1;K<=L.heap_len&&(K<L.heap_len&&qe(J,L.heap[K+1],L.heap[K],L.depth)&&K++,!qe(J,ce,L.heap[K],L.depth));)L.heap[me]=L.heap[K],me=K,K<<=1;L.heap[me]=ce}function pt(L,J,me){var ce,K,we,Ce,je=0;if(L.last_lit!==0)for(;ce=L.pending_buf[L.d_buf+2*je]<<8|L.pending_buf[L.d_buf+2*je+1],K=L.pending_buf[L.l_buf+je],je++,ce===0?H(L,K,J):(H(L,(we=z[K])+j+1,J),(Ce=T[we])!==0&&ee(L,K-=I[we],Ce),H(L,we=B(--ce),me),(Ce=Z[we])!==0&&ee(L,ce-=$[we],Ce)),je<L.last_lit;);H(L,k,J)}function ot(L,J){var me,ce,K,we=J.dyn_tree,Ce=J.stat_desc.static_tree,je=J.stat_desc.has_stree,Oe=J.stat_desc.elems,Ve=-1;for(L.heap_len=0,L.heap_max=m,me=0;me<Oe;me++)we[2*me]!==0?(L.heap[++L.heap_len]=Ve=me,L.depth[me]=0):we[2*me+1]=0;for(;L.heap_len<2;)we[2*(K=L.heap[++L.heap_len]=Ve<2?++Ve:0)]=1,L.depth[K]=0,L.opt_len--,je&&(L.static_len-=Ce[2*K+1]);for(J.max_code=Ve,me=L.heap_len>>1;1<=me;me--)Ke(L,we,me);for(K=Oe;me=L.heap[1],L.heap[1]=L.heap[L.heap_len--],Ke(L,we,1),ce=L.heap[1],L.heap[--L.heap_max]=me,L.heap[--L.heap_max]=ce,we[2*K]=we[2*me]+we[2*ce],L.depth[K]=(L.depth[me]>=L.depth[ce]?L.depth[me]:L.depth[ce])+1,we[2*me+1]=we[2*ce+1]=K,L.heap[1]=K++,Ke(L,we,1),2<=L.heap_len;);L.heap[--L.heap_max]=L.heap[1],(function(He,it){var be,ye,Re,Me,Be,Ie,Te=it.dyn_tree,$e=it.max_code,rt=it.stat_desc.static_tree,ha=it.stat_desc.has_stree,ga=it.stat_desc.extra_bits,_a=it.stat_desc.extra_base,ta=it.stat_desc.max_length,qt=0;for(Me=0;Me<=b;Me++)He.bl_count[Me]=0;for(Te[2*He.heap[He.heap_max]+1]=0,be=He.heap_max+1;be<m;be++)ta<(Me=Te[2*Te[2*(ye=He.heap[be])+1]+1]+1)&&(Me=ta,qt++),Te[2*ye+1]=Me,$e<ye||(He.bl_count[Me]++,Be=0,_a<=ye&&(Be=ga[ye-_a]),Ie=Te[2*ye],He.opt_len+=Ie*(Me+Be),ha&&(He.static_len+=Ie*(rt[2*ye+1]+Be)));if(qt!==0){do{for(Me=ta-1;He.bl_count[Me]===0;)Me--;He.bl_count[Me]--,He.bl_count[Me+1]+=2,He.bl_count[ta]--,qt-=2}while(0<qt);for(Me=ta;Me!==0;Me--)for(ye=He.bl_count[Me];ye!==0;)$e<(Re=He.heap[--be])||(Te[2*Re+1]!==Me&&(He.opt_len+=(Me-Te[2*Re+1])*Te[2*Re],Te[2*Re+1]=Me),ye--)}})(L,J),Ee(we,Ve,L.bl_count)}function N(L,J,me){var ce,K,we=-1,Ce=J[1],je=0,Oe=7,Ve=4;for(Ce===0&&(Oe=138,Ve=3),J[2*(me+1)+1]=65535,ce=0;ce<=me;ce++)K=Ce,Ce=J[2*(ce+1)+1],++je<Oe&&K===Ce||(je<Ve?L.bl_tree[2*K]+=je:K!==0?(K!==we&&L.bl_tree[2*K]++,L.bl_tree[2*U]++):je<=10?L.bl_tree[2*O]++:L.bl_tree[2*M]++,we=K,Ve=(je=0)===Ce?(Oe=138,3):K===Ce?(Oe=6,3):(Oe=7,4))}function xe(L,J,me){var ce,K,we=-1,Ce=J[1],je=0,Oe=7,Ve=4;for(Ce===0&&(Oe=138,Ve=3),ce=0;ce<=me;ce++)if(K=Ce,Ce=J[2*(ce+1)+1],!(++je<Oe&&K===Ce)){if(je<Ve)for(;H(L,K,L.bl_tree),--je!=0;);else K!==0?(K!==we&&(H(L,K,L.bl_tree),je--),H(L,U,L.bl_tree),ee(L,je-3,2)):je<=10?(H(L,O,L.bl_tree),ee(L,je-3,3)):(H(L,M,L.bl_tree),ee(L,je-11,7));we=K,Ve=(je=0)===Ce?(Oe=138,3):K===Ce?(Oe=6,3):(Oe=7,4)}}x($);var te=!1;function q(L,J,me,ce){ee(L,(g<<1)+(ce?1:0),3),(function(K,we,Ce,je){Ae(K),W(K,Ce),W(K,~Ce),d.arraySet(K.pending_buf,K.window,we,Ce,K.pending),K.pending+=Ce})(L,J,me)}f._tr_init=function(L){te||((function(){var J,me,ce,K,we,Ce=new Array(b+1);for(K=ce=0;K<C-1;K++)for(I[K]=ce,J=0;J<1<<T[K];J++)z[ce++]=K;for(z[ce-1]=K,K=we=0;K<16;K++)for($[K]=we,J=0;J<1<<Z[K];J++)ae[we++]=K;for(we>>=7;K<v;K++)for($[K]=we<<7,J=0;J<1<<Z[K]-7;J++)ae[256+we++]=K;for(me=0;me<=b;me++)Ce[me]=0;for(J=0;J<=143;)oe[2*J+1]=8,J++,Ce[8]++;for(;J<=255;)oe[2*J+1]=9,J++,Ce[9]++;for(;J<=279;)oe[2*J+1]=7,J++,Ce[7]++;for(;J<=287;)oe[2*J+1]=8,J++,Ce[8]++;for(Ee(oe,E+1,Ce),J=0;J<v;J++)Y[2*J+1]=5,Y[2*J]=ie(J,5);X=new re(oe,T,j+1,E,b),Q=new re(Y,Z,0,v,b),Ne=new re(new Array(0),V,0,_,y)})(),te=!0),L.l_desc=new R(L.dyn_ltree,X),L.d_desc=new R(L.dyn_dtree,Q),L.bl_desc=new R(L.bl_tree,Ne),L.bi_buf=0,L.bi_valid=0,ze(L)},f._tr_stored_block=q,f._tr_flush_block=function(L,J,me,ce){var K,we,Ce=0;0<L.level?(L.strm.data_type===2&&(L.strm.data_type=(function(je){var Oe,Ve=4093624447;for(Oe=0;Oe<=31;Oe++,Ve>>>=1)if(1&Ve&&je.dyn_ltree[2*Oe]!==0)return h;if(je.dyn_ltree[18]!==0||je.dyn_ltree[20]!==0||je.dyn_ltree[26]!==0)return p;for(Oe=32;Oe<j;Oe++)if(je.dyn_ltree[2*Oe]!==0)return p;return h})(L)),ot(L,L.l_desc),ot(L,L.d_desc),Ce=(function(je){var Oe;for(N(je,je.dyn_ltree,je.l_desc.max_code),N(je,je.dyn_dtree,je.d_desc.max_code),ot(je,je.bl_desc),Oe=_-1;3<=Oe&&je.bl_tree[2*ue[Oe]+1]===0;Oe--);return je.opt_len+=3*(Oe+1)+5+5+4,Oe})(L),K=L.opt_len+3+7>>>3,(we=L.static_len+3+7>>>3)<=K&&(K=we)):K=we=me+5,me+4<=K&&J!==-1?q(L,J,me,ce):L.strategy===4||we===K?(ee(L,2+(ce?1:0),3),pt(L,oe,Y)):(ee(L,4+(ce?1:0),3),(function(je,Oe,Ve,He){var it;for(ee(je,Oe-257,5),ee(je,Ve-1,5),ee(je,He-4,4),it=0;it<He;it++)ee(je,je.bl_tree[2*ue[it]+1],3);xe(je,je.dyn_ltree,Oe-1),xe(je,je.dyn_dtree,Ve-1)})(L,L.l_desc.max_code+1,L.d_desc.max_code+1,Ce+1),pt(L,L.dyn_ltree,L.dyn_dtree)),ze(L),ce&&Ae(L)},f._tr_tally=function(L,J,me){return L.pending_buf[L.d_buf+2*L.last_lit]=J>>>8&255,L.pending_buf[L.d_buf+2*L.last_lit+1]=255&J,L.pending_buf[L.l_buf+L.last_lit]=255&me,L.last_lit++,J===0?L.dyn_ltree[2*me]++:(L.matches++,J--,L.dyn_ltree[2*(z[me]+j+1)]++,L.dyn_dtree[2*B(J)]++),L.last_lit===L.lit_bufsize-1},f._tr_align=function(L){ee(L,2,3),H(L,k,oe),(function(J){J.bi_valid===16?(W(J,J.bi_buf),J.bi_buf=0,J.bi_valid=0):8<=J.bi_valid&&(J.pending_buf[J.pending++]=255&J.bi_buf,J.bi_buf>>=8,J.bi_valid-=8)})(L)}},{"../utils/common":41}],53:[function(r,u,f){u.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(r,u,f){(function(d){(function(h,p){if(!h.setImmediate){var x,g,C,j,E=1,v={},_=!1,m=h.document,b=Object.getPrototypeOf&&Object.getPrototypeOf(h);b=b&&b.setTimeout?b:h,x={}.toString.call(h.process)==="[object process]"?function(U){process.nextTick(function(){y(U)})}:(function(){if(h.postMessage&&!h.importScripts){var U=!0,O=h.onmessage;return h.onmessage=function(){U=!1},h.postMessage("","*"),h.onmessage=O,U}})()?(j="setImmediate$"+Math.random()+"$",h.addEventListener?h.addEventListener("message",k,!1):h.attachEvent("onmessage",k),function(U){h.postMessage(j+U,"*")}):h.MessageChannel?((C=new MessageChannel).port1.onmessage=function(U){y(U.data)},function(U){C.port2.postMessage(U)}):m&&"onreadystatechange"in m.createElement("script")?(g=m.documentElement,function(U){var O=m.createElement("script");O.onreadystatechange=function(){y(U),O.onreadystatechange=null,g.removeChild(O),O=null},g.appendChild(O)}):function(U){setTimeout(y,0,U)},b.setImmediate=function(U){typeof U!="function"&&(U=new Function(""+U));for(var O=new Array(arguments.length-1),M=0;M<O.length;M++)O[M]=arguments[M+1];var T={callback:U,args:O};return v[E]=T,x(E),E++},b.clearImmediate=S}function S(U){delete v[U]}function y(U){if(_)setTimeout(y,0,U);else{var O=v[U];if(O){_=!0;try{(function(M){var T=M.callback,Z=M.args;switch(Z.length){case 0:T();break;case 1:T(Z[0]);break;case 2:T(Z[0],Z[1]);break;case 3:T(Z[0],Z[1],Z[2]);break;default:T.apply(p,Z)}})(O)}finally{S(U),_=!1}}}}function k(U){U.source===h&&typeof U.data=="string"&&U.data.indexOf(j)===0&&y(+U.data.slice(j.length))}})(typeof self>"u"?d===void 0?this:d:self)}).call(this,typeof Vs<"u"?Vs:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Mc)),Mc.exports}var Bb=Ub();const Lb=Vc(Bb),Hb=i=>{switch(i.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"}},$s=6e4,Cl=200,fp=200,Yn=1e6,Uc=2e3,Bc=2e3,Yb=360,Qp=12,Qs=Yb+Qp,qb=4,Kb=4,Ib=({index:i,style:c,data:r})=>{const u=r[i];return u?l.jsx("div",{style:{...c,paddingBottom:Qp},children:l.jsx($p,{capture:u})}):null},hp=i=>`${(i/(1024*1024)).toFixed(2)} MB`,Gb=i=>{if(typeof i=="boolean")return i;if(typeof i=="string"){const c=i.trim().toLowerCase();if(c==="true")return!0;if(c==="false")return!1}return null},Fs=(i,c)=>i.length<=c?{text:i,truncated:!1}:{text:i.slice(0,c),truncated:!0},Vb=i=>!i||i.data===void 0||i.data===null?{reason:"No data to copy."}:{raw:i.data},Js=(i,c,r)=>i.length<=c?i:(r.push(`first ${c.toLocaleString()} chars`),i.slice(0,c)),Xb=i=>{const c=[];if(typeof i=="string")return{text:Js(i,Yn,c),truncated:c.length>0,reason:c.join(", ")};if(Array.isArray(i)){let u=i;i.length>Uc&&(u=i.slice(0,Uc),c.push(`first ${Uc.toLocaleString()} items`));let f="";try{f=JSON.stringify(u,null,2)}catch{f=String(u)}return f=Js(f,Yn,c),{text:f,truncated:c.length>0,reason:c.join(", ")}}if(i&&typeof i=="object"){let u=i;const f=Object.keys(i);f.length>Bc&&(u=f.slice(0,Bc).reduce((h,p)=>(h[p]=i[p],h),{}),c.push(`first ${Bc.toLocaleString()} keys`));let d="";try{d=JSON.stringify(u,null,2)}catch{d=String(u)}return d=Js(d,Yn,c),{text:d,truncated:c.length>0,reason:c.join(", ")}}return{text:Js(String(i),Yn,c),truncated:c.length>0,reason:c.join(", ")}},Zb=i=>{if(typeof i=="string")return i;try{return JSON.stringify(i,null,2)}catch{return String(i)}},pp=i=>{if(!i||i.data===void 0||i.data===null||i.data==="")return{text:"",truncated:!1,language:"plain"};const c=i.data;if(typeof c=="string"){const u=c.slice(0,2e3).trim(),f=u.startsWith("<")&&u.includes(">")?"html":u.startsWith("{")||u.startsWith("[")?"json":"plain",d=Fs(c,$s);return{text:d.text,truncated:d.truncated,language:f}}if(Array.isArray(c)){const u=c.length>Cl?c.slice(0,Cl):c,f=JSON.stringify(u,null,2),d=Fs(f,$s);return{text:d.text,truncated:d.truncated||c.length>Cl,language:"json"}}if(c&&typeof c=="object"){const u=Object.keys(c);let f=c,d=!1;u.length>fp&&(d=!0,f=u.slice(0,fp).reduce((x,g)=>(x[g]=c[g],x),{}));const h=JSON.stringify(f,null,2),p=Fs(h,$s);return{text:p.text,truncated:p.truncated||d,language:"json"}}const r=Fs(String(c),$s);return{text:r.text,truncated:r.truncated,language:"plain"}},$b=(i,c)=>{const r=[];let u=[],f="",d=!1;for(let h=0;h<i.length;h+=1){const p=i[h];if(d)p==='"'?i[h+1]==='"'?(f+='"',h+=1):d=!1:f+=p;else if(p==='"')d=!0;else if(p===",")u.push(f),f="";else if(p===`
13
+ `){if(u.push(f),r.push(u),r.length>=c)return r;u=[],f=""}else p==="\r"||(f+=p)}return u.push(f),(u.length>1||u[0]!==""||r.length>0)&&r.push(u),r},Qb=i=>{if(!i)return null;if(typeof i=="string"){const c=i.slice(0,2e3).trim();if(c.startsWith("{")||c.startsWith("[")||!c.includes(",")||!c.includes(`
14
+ `))return null;const r=i.trim(),u=$b(r,Cl+1).filter(h=>h.some(p=>String(p||"").trim()!==""));if(u.length<2)return null;const f=u[0].map((h,p)=>String(h||"").trim()||`column_${p+1}`),d=u.slice(1,Cl+1);return f.length<2?null:{headers:f,rows:d}}if(Array.isArray(i)){if(i.length===0)return null;const c=i.slice(0,Cl);if(c.every(r=>r&&typeof r=="object"&&!Array.isArray(r))){const r=[],u=new Set;if(c.forEach(d=>{Object.keys(d).forEach(h=>{u.has(h)||(u.add(h),r.push(h))})}),r.length===0)return null;const f=c.map(d=>r.map(h=>d[h]??""));return{headers:r,rows:f}}if(c.every(r=>Array.isArray(r))){const r=Math.max(...c.map(f=>f.length));return{headers:Array.from({length:r},(f,d)=>`column_${d+1}`),rows:c}}return null}if(i&&typeof i=="object"){const c=Object.keys(i);return c.length===0?null:{headers:c,rows:[c.map(r=>i[r]??"")]}}return null},Fb=(i,c)=>i==null?null:typeof i=="string"?c?{content:i,mime:"text/csv",ext:"csv"}:{content:i,mime:"application/json",ext:"json"}:{content:JSON.stringify(i,null,2),mime:"application/json",ext:"json"},Jb=(i,c,r)=>{const u=new Blob([c],{type:r}),f=URL.createObjectURL(u),d=document.createElement("a");d.href=f,d.download=i,document.body.appendChild(d),d.click(),d.remove(),URL.revokeObjectURL(f)},Pb=({results:i,pinnedResults:c,isExecuting:r,isHeadful:u,runId:f,onConfirm:d,onNotify:h,onPin:p,onUnpin:x,fullWidth:g,useNovnc:C})=>{const[j,E]=A.useState(null),[v,_]=A.useState("raw"),[m,b]=A.useState("data"),[S,y]=A.useState(()=>c&&!i?"pinned":"latest"),k=A.useMemo(()=>C===null?"checking":C?"novnc":"native",[C]),[U,O]=A.useState(!1),[M,T]=A.useState(!1),[Z,V]=A.useState([]),ue=A.useRef(null),oe=S==="pinned"&&c?c:i,Y=A.useMemo(()=>Qb(oe?.data),[oe?.data]),ae=A.useMemo(()=>oe&&oe.data!==void 0&&oe.data!==null&&oe.data!==""?pp(oe):null,[oe?.data]),z=A.useMemo(()=>oe?.screenshotUrl?`${oe.screenshotUrl}${S==="latest"?`?t=${Date.now()}`:""}`:null,[oe?.screenshotUrl,S]),I=$=>{const re=Gb($);return re!==null?re?l.jsx(he,{name:"check",className:"text-xs text-blue-400"}):"":$??""},X=async()=>{T(!0);try{const $=f?`?runId=${encodeURIComponent(f)}`:"",re=await fetch(`/api/data/captures${$}`),R=re.ok?await re.json():{captures:[]};V(Array.isArray(R.captures)?R.captures:[])}catch{V([])}finally{T(!1)}};A.useEffect(()=>{_(Y?"table":"raw"),!oe?.downloads||oe.downloads.length===0?b("data"):oe?.data||b("downloads")},[oe]),A.useEffect(()=>{i&&y("latest")},[i]),A.useEffect(()=>{!c&&S==="pinned"&&y("latest")},[c,S]),A.useEffect(()=>{if(!U)return;const $=re=>{re.key==="Escape"&&O(!1)};return window.addEventListener("keydown",$),()=>window.removeEventListener("keydown",$)},[U]);const Q=async($,re,R)=>{if(!$){h("Nothing to copy.","error");return}let B=$;!R?.skipSizeConfirm&&$.length>Yn&&(await d({message:`Copying ${hp($.length)} may freeze your browser.`,confirmLabel:"Copy full",cancelLabel:"Copy segment"})||(B=$.slice(0,Yn)));try{if(navigator.clipboard&&window.isSecureContext)await navigator.clipboard.writeText(B);else{const W=document.createElement("textarea");W.value=B,W.style.position="fixed",W.style.left="-999999px",W.style.top="-999999px",document.body.appendChild(W),W.focus(),W.select(),document.execCommand("copy"),W.remove()}E(re),setTimeout(()=>E(null),2e3),R?.truncatedNotice?h("Copied truncated data.","success"):B.length!==$.length&&h("Copied a truncated preview.","success")}catch(W){console.error("Copy failed:",W),h("Copy failed.","error")}};if(u&&S==="latest"){const{origin:$,hostname:re}=window.location,R=`${$}/novnc.html?host=${re}&path=websockify`,B=()=>{const W=ue.current;if(W){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}W.requestFullscreen?.().catch(()=>{})}};return k==="native"?l.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:[l.jsx("div",{className:"text-[12px] font-bold uppercase tracking-widest text-white",children:"Headful Session Active"}),l.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."})]}):k==="checking"?l.jsx("div",{className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative flex items-center justify-center",children:l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-widest text-gray-500",children:"Checking headful viewer..."})}):l.jsxs("div",{ref:ue,className:"glass-card rounded-[32px] overflow-hidden h-[80vh] w-full relative",children:[l.jsx("button",{type:"button",onClick:B,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"}),l.jsx("iframe",{src:R,className:"absolute inset-0 w-full h-full",title:"Headful Browser"})]})}if(!oe&&!(r&&S==="latest"))return l.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center space-y-4 opacity-20",children:[l.jsx("div",{className:"w-16 h-16 border border-white/10 rounded-full flex items-center justify-center",children:l.jsx(he,{name:"terminal",className:"text-2xl text-white"})}),l.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.3em]",children:"Ready"})]});const Ne=g?"space-y-12 relative z-10 w-full":"space-y-12 relative z-10 max-w-5xl mx-auto";return l.jsxs("div",{className:Ne,children:[l.jsxs("div",{className:"flex items-end justify-between border-b border-white/5 pb-10",children:[l.jsxs("div",{className:"space-y-4",children:[l.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Preview"}),l.jsx("h2",{className:"text-xl font-mono text-white truncate max-w-xl tracking-tight italic",children:oe?.finalUrl||oe?.url||""})]}),l.jsx("div",{className:`px-4 py-2 rounded-xl text-[9px] font-bold uppercase tracking-[0.2em] ${S==="pinned"?"bg-amber-500/10 text-amber-300":r?"bg-blue-500/10 text-blue-400 animate-pulse":"bg-green-500/10 text-green-400"}`,children:S==="pinned"?"Pinned":r?"Running":"Finished"})]}),l.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-8",children:[l.jsxs("div",{className:"glass-card rounded-[32px] overflow-hidden flex flex-col min-h-[400px]",children:[l.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:[l.jsx("span",{children:"Screenshot"}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("span",{className:"text-white/20",children:oe?.timestamp||"--:--:--"}),l.jsx("button",{type:"button",onClick:()=>{O(!0),X()},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"})]})]}),l.jsx("div",{className:"relative bg-black flex-1 flex items-center justify-center overflow-hidden",children:z?l.jsx("img",{src:z,className:"absolute inset-0 w-full h-full object-contain transition-opacity duration-1000"}):l.jsx("div",{className:"text-[8px] font-bold text-white/5 uppercase tracking-widest",children:"Waiting for Frame..."})})]}),l.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col h-[400px]",children:[l.jsxs("div",{className:"flex items-center justify-between mb-6 border-b border-white/5 pb-4",children:[l.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Activity Log"}),l.jsxs("button",{onClick:()=>Q((oe?.logs||[]).join(`
15
+ `),"logs"),className:`px-3 py-1.5 border text-[7px] font-bold rounded-lg uppercase transition-all flex items-center gap-1.5 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${j==="logs"?"bg-green-500/10 border-green-500/20 text-green-400":"bg-white/5 border-white/10 text-white/50 hover:text-white hover:bg-white/10"}`,title:"Copy activity log","aria-label":"Copy activity log",children:[l.jsx(he,{name:j==="logs"?"check":"content_copy",className:"text-[12px]"}),j==="logs"?"Copied":"Copy"]})]}),l.jsxs("div",{className:"flex-1 font-mono text-[10px] text-gray-400 space-y-2 overflow-y-auto custom-scrollbar pr-2",children:[oe?.logs?.map(($,re)=>l.jsxs("div",{className:"flex gap-2",children:[l.jsx("span",{className:"text-white/10 shrink-0",children:"›"})," ",l.jsx("span",{children:$})]},re)),r&&S==="latest"&&(!oe?.logs||oe?.logs.length===0)&&l.jsx("div",{className:"animate-pulse",children:"Connecting to kernel..."})]})]})]}),U&&l.jsx("div",{className:"fixed inset-0 z-50 bg-black/70 flex items-center justify-center p-6",children:l.jsxs("div",{className:"glass-card rounded-[32px] w-full max-w-5xl max-h-[85vh] overflow-hidden flex flex-col",children:[l.jsxs("div",{className:"p-6 border-b border-white/10 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-widest",children:"Captures"}),l.jsx("div",{className:"text-sm font-bold text-white",children:"Recordings and Screenshots"})]}),l.jsx("button",{onClick:()=>O(!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"})]}),l.jsxs("div",{className:"p-6 overflow-y-auto custom-scrollbar",children:[M&&l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!M&&Z.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!M&&Z.length>0&&l.jsx(dr,{height:Math.min(Math.max(Qs,Z.length*Qs),Qs*qb),width:"100%",itemCount:Z.length,itemSize:Qs,overscanCount:Kb,itemData:Z,className:"custom-scrollbar",children:Ib})]})]})}),l.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col relative",children:[l.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[l.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:m==="downloads"?"Downloads":"Data"}),l.jsxs("div",{className:"flex items-center gap-2",children:[oe?.downloads&&oe.downloads.length>0&&l.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["data","downloads"].map($=>l.jsx("button",{role:"tab","aria-selected":m===$,onClick:()=>b($),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${m===$?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:$},$))}),c&&l.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["latest","pinned"].map($=>l.jsx("button",{role:"tab","aria-selected":S===$,onClick:()=>y($),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${S===$?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:$},$))}),Y&&m==="data"&&l.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-lg p-0.5 border border-white/10",children:["table","raw"].map($=>l.jsx("button",{role:"tab","aria-selected":v===$,onClick:()=>_($),className:`px-3 py-1 rounded text-[8px] font-bold uppercase tracking-widest transition-all focus:outline-none focus-visible:ring-2 ${v===$?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:$},$))}),S==="pinned"?l.jsx("button",{onClick:()=>{x?.(),y("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"}):l.jsx("button",{onClick:()=>{if(!oe){h("No data to pin.","error");return}p?.(oe),y("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:c?"Update Pin":"Pin"}),m==="data"&&l.jsx("button",{onClick:()=>{const $=Fb(oe?.data,Y);if(!$){h("No data to export.","error");return}const re=`doppelganger-data-${new Date().toISOString().replace(/[:.]/g,"-")}.${$.ext}`;Jb(re,$.content,$.mime),h(`Exported ${$.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"&&l.jsxs("button",{onClick:async()=>{if(!(!oe?.downloads||oe.downloads.length===0)){if(oe.downloads.length===1){const $=oe.downloads[0],re=document.createElement("a");re.href=$.path,re.download=$.name,document.body.appendChild(re),re.click(),re.remove(),h(`Downloading ${$.name}`,"success");return}h("Generating ZIP...","success");try{const $=new Lb;for(const W of oe.downloads){const H=await(await fetch(W.path)).blob();$.file(W.name,H)}const re=await $.generateAsync({type:"blob"}),R=URL.createObjectURL(re),B=document.createElement("a");B.href=R,B.download=`doppelganger-downloads-${new Date().toISOString().replace(/[:.]/g,"-")}.zip`,document.body.appendChild(B),B.click(),B.remove(),URL.revokeObjectURL(R)}catch($){console.error("Failed to zip files:",$),h("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:oe?.downloads?.length===1?"Download File":"Download ZIP",children:[l.jsx(he,{name:"folder_zip",className:"text-[14px]"}),oe?.downloads?.length===1?"Download":"Download ZIP"]}),m==="data"&&l.jsxs("button",{onClick:async()=>{const $=Vb(oe);if($.reason){h($.reason||"Data too large to copy safely.","error");return}const re=pp(oe);let B=Zb($.raw),W=!1;re.truncated&&(await d({message:"Preview is truncated for performance.",confirmLabel:"Copy full",cancelLabel:"Copy preview"})||(B=re.text||"",W=!0)),B.length>Yn&&(await d({message:`Copying ${hp(B.length)} may freeze your browser.`,confirmLabel:"Copy full",cancelLabel:W?"Copy preview":"Copy truncated"})||(B=Xb($.raw).text,W=!0)),Q(B,"data",{skipSizeConfirm:!0,truncatedNotice:W})},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"?l.jsx(he,{name:"check",className:"text-sm"}):l.jsx(he,{name:"content_copy",className:"text-sm"}),j==="data"?"Copied":"Copy"]})]})]}),ae?.truncated&&l.jsx("button",{type:"button",onClick:()=>h("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"}),l.jsx("div",{className:"max-h-[70vh] overflow-y-auto custom-scrollbar pr-2 relative",children:(()=>{const $=oe&&oe.data!==void 0&&oe.data!==null&&oe.data!=="",re=oe&&oe.downloads&&oe.downloads.length>0;return r&&S==="latest"&&(!oe||!$&&!re)?l.jsx("pre",{className:"font-mono text-[10px] text-blue-300/60 whitespace-pre-wrap leading-relaxed",children:"Buffering data stream..."}):!oe||!$&&!re?null:l.jsx("div",{className:"h-full",children:m==="downloads"?l.jsx("div",{className:"space-y-2",children:oe.downloads.map((R,B)=>l.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:[l.jsxs("div",{className:"flex items-center gap-4 overflow-hidden pr-4",children:[l.jsx("div",{className:"p-3 bg-white/5 rounded-lg border border-white/10 shrink-0",children:l.jsx(he,{name:Hb(R.name),className:"text-2xl text-white/70"})}),l.jsxs("div",{className:"min-w-0",children:[l.jsx("h4",{className:"text-sm font-bold text-white truncate",children:R.name}),l.jsx("p",{className:"text-[10px] text-gray-500 truncate mt-1",children:R.url})]})]}),l.jsx("a",{href:R.path,download:R.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:l.jsx(he,{name:"download",className:"text-[18px]"})})]},B))}):Y&&v==="table"?l.jsx("div",{className:"overflow-auto custom-scrollbar rounded-2xl border border-white/10",children:l.jsxs("table",{className:"min-w-full table-auto text-[10px] text-left text-white/80 font-mono",children:[l.jsx("thead",{className:"bg-white/5 text-[9px] uppercase tracking-widest text-white/50",children:l.jsx("tr",{children:Y.headers.map(R=>l.jsx("th",{className:"px-3 py-2 border-b border-white/10 whitespace-nowrap",children:R},R))})}),l.jsx("tbody",{children:Y.rows.map((R,B)=>l.jsx("tr",{className:"odd:bg-white/[0.02]",children:Y.headers.map((W,ee)=>l.jsx("td",{className:"px-3 py-2 border-b border-white/5 align-top whitespace-normal break-words",children:I(R[ee])},`${B}-${ee}`))},B))})]})}):l.jsx(xn,{readOnly:!0,value:ae?.text||"",language:ae?.language||"plain"})})})()})]})]})},Fp=A.memo(Pb),Wb=({isOpen:i,onToggle:c,results:r,pinnedResults:u,isExecuting:f,isHeadfulOpen:d,runId:h,onConfirm:p,onNotify:x,onPinResults:g,onUnpinResults:C,useNovnc:j})=>l.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 ${i?"translate-x-0":"translate-x-full"}`,children:[l.jsx("button",{onClick:c,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":i?"Close Results Drawer":"Open Results Drawer",title:i?"Close Results Drawer":"Open Results Drawer",children:l.jsx(he,{name:"drag_indicator",className:`text-white/30 text-xl transition-transform duration-500 ${i?"rotate-180":""}`})}),l.jsx("div",{className:"h-full w-full overflow-y-auto custom-scrollbar p-6",children:l.jsx(Fp,{results:r,pinnedResults:u,isExecuting:f,isHeadful:d,runId:h,onConfirm:p,onNotify:x,onPin:g,onUnpin:C,fullWidth:!0,useNovnc:j})})]}),ey=({versionPreview:i,onClose:c,onRunSnapshot:r})=>i?l.jsx("div",{className:"fixed inset-0 z-[210] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:l.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:[l.jsxs("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.3em]",children:"Task Snapshot"}),l.jsx("div",{className:"text-lg font-bold text-white",children:i.snapshot.name}),l.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(i.timestamp).toLocaleString()," | ",i.snapshot.mode]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:c,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Close"}),l.jsx("button",{onClick:()=>{r(i.snapshot),c()},className:"px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-xl bg-white text-black hover:bg-white/90 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Run Version"})]})]}),l.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:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Snapshot JSON"}),l.jsx(xn,{readOnly:!0,value:JSON.stringify(i.snapshot,null,2),language:"json",className:"min-h-[320px]"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("div",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"}),l.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."})]})]})]})}):null,ty=({isHeadfulOpen:i,isInspectMode:c,isInspectLoading:r,isExecuting:u,useNovnc:f,onToggleInspect:d,onStopHeadful:h})=>{const p=A.useRef(null);if(!i)return null;const{origin:x,hostname:g}=window.location,C=`${x}/novnc.html?host=${g}&path=websockify`,j=()=>{const E=p.current;if(E){if(document.fullscreenElement){document.exitFullscreen().catch(()=>{});return}E.requestFullscreen?.().catch(()=>{})}};return l.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:l.jsxs("div",{className:"w-full max-w-6xl bg-black/60 backdrop-blur-3xl border border-white/20 rounded-[32px] shadow-2xl overflow-hidden flex flex-col",children:[l.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:[l.jsx("div",{className:"flex flex-col gap-1",children:l.jsx("div",{className:"flex items-center gap-3",children:l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-widest text-white",children:"Active Browser Session"})})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{type:"button",onClick:d,disabled:r||u,className:`px-3 py-1.5 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all flex items-center gap-2 disabled:opacity-30 disabled:cursor-not-allowed focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c?"border-green-500/30 bg-green-500/20 text-green-400 hover:bg-green-500/30":"border-white/10 text-white/60 hover:text-white hover:bg-white/10"}`,title:c?"Stop inspecting elements":"Highlight elements on hover","aria-label":c?"Stop inspecting elements":"Highlight elements on hover",children:[r?l.jsx("div",{className:"w-4 h-4 border-2 border-white/20 border-t-white rounded-full animate-spin"}):l.jsx(he,{name:c?"visibility_off":"center_focus_strong",className:"text-[14px]"}),c?"Stop Inspect":"Inspect UI"]}),l.jsx("button",{type:"button",onClick:j,className:"p-2 text-white/60 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg",title:"Toggle fullscreen","aria-label":"Toggle fullscreen",children:l.jsx(he,{name:"fullscreen",className:"text-[16px]"})}),l.jsx("button",{type:"button",onClick:h,className:"p-2 text-white/60 hover:text-white transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg",title:"Close Browser","aria-label":"Close Browser",children:l.jsx(he,{name:"close",className:"text-[16px]"})})]})]}),l.jsx("div",{ref:p,className:"w-full aspect-video relative bg-black flex items-center justify-center",children:f===!1?l.jsxs("div",{className:"text-center p-8",children:[l.jsx(he,{name:"open_in_new",className:"text-6xl text-white/20 mb-4 block"}),l.jsx("h3",{className:"text-white text-lg font-bold mb-2",children:"Browser Opened Natively"}),l.jsx("p",{className:"text-white/60 text-sm max-w-md mx-auto leading-relaxed mb-6",children:"The headful browser has been launched in a separate window on your desktop. Use that window to pick selectors. It will automatically sync back here."})]}):l.jsx("iframe",{src:C,className:"absolute inset-0 w-full h-full border-0",title:"Headful Browser"})})]})})},Yt=({value:i,onChange:c,onBlur:r,placeholder:u,variables:f,className:d,syntax:h="plain"})=>{const p=A.useRef(null);return A.useEffect(()=>{if(p.current){const x=p.current.innerHTML,g=Xp(i,h,f);if(x!==g){const C=window.getSelection();let j=0;if(C&&C.rangeCount>0){const E=C.getRangeAt(0),v=E.cloneRange();v.selectNodeContents(p.current),v.setEnd(E.endContainer,E.endOffset),j=v.toString().length}if(p.current.innerHTML=g,j>0){const E=document.createTreeWalker(p.current,NodeFilter.SHOW_TEXT);let v=0,_=E.nextNode();for(;_;){const m=_.textContent?.length||0;if(v+m>=j){const b=document.createRange();b.setStart(_,j-v),b.collapse(!0),C?.removeAllRanges(),C?.addRange(b);break}v+=m,_=E.nextNode()}}}}},[i,f]),l.jsx("div",{ref:p,contentEditable:!0,role:"textbox","aria-multiline":"true","aria-label":u||"Text input",className:`rich-input-content w-full bg-transparent focus:outline-none text-white min-h-[1.5rem] ${d}`,"data-placeholder":u,onInput:x=>c(x.currentTarget.textContent||""),onBlur:x=>{const g=x.currentTarget.textContent||"";c(g),r?.(g)}})},ay=[{value:"Control",label:"Ctrl"},{value:"Shift",label:"Shift"},{value:"Alt",label:"Alt"},{value:"Meta",label:"Meta"}],ny=["Enter","Tab","Escape","Space","Backspace","Delete","ArrowUp","ArrowDown","ArrowLeft","ArrowRight","Home","End","PageUp","PageDown","F1","F2","F3","F4","F5"].concat([...Array(10)].map((i,c)=>`${c}`)).concat(Array.from({length:26},(i,c)=>String.fromCharCode(65+c))),ly=[{value:"replace",label:"Replace Text"},{value:"append",label:"Append Text"}],iy=i=>{if(!i)return{modifiers:[],baseKey:""};const c=i.split("+"),r=c.pop()||"";return{modifiers:c,baseKey:r}},mp=(i,c)=>[...i.filter(Boolean),c].filter(Boolean).join("+"),sy=i=>{const c=(i||"").trim(),r=c.match(/^\{\$([\w.]+)\}$/);return r?r[1]:c},Ps={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"}]},ry=["else","end","on_error"],oy=({action:i,variables:c,availableTasks:r,selectorOptions:u,onUpdate:f,onAutoSave:d,onClose:h,onStartInspect:p})=>{const x=ir.find(O=>O.type===i.type)?.label||i.type,[g,C]=A.useState(!1),[j,E]=A.useState(""),[v,_]=A.useState(!1),[m,b]=A.useState(null),S=async()=>{if(j.trim()){_(!0),b(null);try{const O=await fetch("/api/tasks/generate-script",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:j.trim()})}),M=await O.json();if(!O.ok)throw new Error(M.error||"Generation failed");f(i.id,{value:M.script}),C(!1),E("")}catch(O){b(O.message)}finally{_(!1)}}};A.useEffect(()=>{const O=M=>{M.key==="Escape"&&h()};return window.addEventListener("keydown",O),()=>window.removeEventListener("keydown",O)},[h]);const y=(O,M)=>l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1 block",children:O}),M]}),k=O=>l.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 text-[11px] focus-within:border-white/20 transition-all",children:O}),U=()=>{if(ry.includes(i.type))return l.jsx("p",{className:"text-[10px] text-gray-600 text-center py-4",children:"This block has no configurable options."});const{modifiers:O,baseKey:M}=iy(i.key),T=Object.keys(c||{}),Z=sy(i.conditionVar||""),V=Z&&c?.[Z]?.type,ue=i.conditionVarType||V||"string",oe=Ps[ue]||Ps.string,Y=i.conditionOp||oe[0].value,ae=i.method||"GET",z=["POST","PUT","PATCH","DELETE"];return l.jsxs("div",{className:"space-y-10",children:[(i.type==="click"||i.type==="type"||i.type==="hover"||i.type==="wait_selector"||i.type==="scroll")&&y(i.type==="scroll"?"Selector (Optional)":"Selector",l.jsxs("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 text-[11px] focus-within:border-white/20 transition-all flex items-center gap-2",children:[l.jsxs("div",{className:"flex-1 min-w-0 flex flex-col gap-1",children:[l.jsx(Yt,{value:i.selector||"",onChange:I=>f(i.id,{selector:I}),onBlur:()=>d(),variables:c,placeholder:i.type==="scroll"?".scroll-container or leave empty":".btn-primary"}),u&&u.length>1&&l.jsx("div",{className:"flex flex-wrap gap-1 mt-1",children:u.map((I,X)=>l.jsx("button",{onClick:()=>f(i.id,{selector:I},!0),className:`text-[9px] px-1.5 py-0.5 rounded border transition-colors ${i.selector===I?"bg-blue-500/20 border-blue-500/50 text-blue-300":"bg-white/[0.02] border-white/10 text-white/40 hover:text-white/80 hover:bg-white/[0.05]"}`,children:I},X))})]}),p&&l.jsx("button",{onClick:()=>{h(),p(i.id)},disabled:i.disabled,className:"text-white opacity-50 hover:opacity-100 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 shrink-0 disabled:opacity-20 disabled:cursor-not-allowed rounded",title:"Pick Selector in Browser","aria-label":"Pick Selector in Browser",children:l.jsx(he,{name:"my_location",className:"text-lg"})})]})),i.type==="scroll"&&y("Scroll Speed (ms)",k(l.jsx(Yt,{value:i.key||"",onChange:I=>f(i.id,{key:I}),onBlur:()=>d(),variables:c,placeholder:"500"}))),(i.type==="navigate"||i.type==="type"||i.type==="wait"||i.type==="wait_selector"||i.type==="javascript"||i.type==="csv")&&(i.type==="javascript"?l.jsxs("div",{className:"space-y-1.5",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Script"}),l.jsxs("button",{onClick:()=>{C(I=>!I),b(null)},className:"flex items-center gap-1 text-[8px] font-bold uppercase tracking-widest text-white/60 hover:text-white transition-colors",title:"Generate with AI",children:[l.jsx(he,{name:"auto_awesome",className:"text-sm"}),"Generate"]})]}),g&&l.jsxs("div",{className:"flex flex-col gap-2 p-3 rounded-xl bg-white/5 border border-white/10",children:[l.jsx("input",{autoFocus:!0,type:"text",value:j,onChange:I=>E(I.target.value),onKeyDown:I=>{I.key==="Enter"&&!v&&S()},placeholder:"e.g. extract all article titles and links",className:"bg-transparent text-[11px] text-white placeholder-gray-600 focus:outline-none"}),m&&l.jsx("p",{className:"text-[9px] text-red-400",children:m}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>{C(!1),b(null)},className:"text-[8px] font-bold uppercase tracking-widest text-gray-500 hover:text-white transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:S,disabled:v||!j.trim(),className:"px-3 py-1 rounded-lg bg-white text-black text-[8px] font-bold uppercase tracking-widest hover:bg-white/90 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1",children:[v&&l.jsx(he,{name:"autorenew",className:"text-xs animate-spin"}),v?"Generating…":"Generate"]})]})]}),k(l.jsx(xn,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),language:"javascript",variables:c,className:"min-h-[120px]",placeholder:"return document.title"}))]}):y(i.type==="navigate"?"URL":i.type==="type"?"Content":i.type==="wait"?"Seconds":i.type==="wait_selector"?"Timeout (Sec)":"CSV Input",k(i.type==="csv"?l.jsx(xn,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),language:"plain",variables:c,className:"min-h-[120px]",placeholder:`name,age
16
+ Ada,31`}):l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:i.type==="navigate"?"https://example.com":i.type==="type"?"Search keywords":i.type==="wait"?"3":i.type==="wait_selector"?"10":"400"})))),i.type==="type"&&y("Mode",k(l.jsx("select",{value:i.typeMode||"replace",onChange:I=>f(i.id,{typeMode:I.target.value},!0),className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:ly.map(I=>l.jsx("option",{value:I.value,children:I.label},I.value))}))),i.type==="screenshot"&&y("Label (Optional)",k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"checkout-step"}))),i.type==="press"&&l.jsxs("div",{className:"space-y-5",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Key"}),l.jsx("div",{className:"grid grid-cols-2 gap-3 text-[10px] text-white",children:ay.map(I=>l.jsxs("label",{className:"inline-flex items-center space-x-1",children:[l.jsx("input",{type:"checkbox",checked:O.includes(I.value),onChange:X=>{const Q=X.target.checked?[...O,I.value]:O.filter(Ne=>Ne!==I.value);f(i.id,{key:mp(Q,M)},!0)},className:"h-3 w-3 rounded border border-white/30 bg-black/80"}),l.jsx("span",{className:"uppercase text-[9px] text-white/70",children:I.label})]},I.value))}),k(l.jsxs("select",{value:M,onChange:I=>f(i.id,{key:mp(O,I.target.value)},!0),className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:[l.jsx("option",{value:"",children:"Select key"}),ny.map(I=>l.jsx("option",{value:I,children:I},I))]}))]}),(i.type==="if"||i.type==="while")&&l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Condition"}),l.jsxs("div",{className:"grid grid-cols-3 gap-2",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Variable"}),l.jsx("input",{type:"text",list:`cond-var-${i.id}`,value:i.conditionVar||"",onChange:I=>f(i.id,{conditionVar:I.target.value}),onBlur:()=>d(),placeholder:"variable name",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white focus:outline-none focus:border-white/30"}),T.length>0&&l.jsx("datalist",{id:`cond-var-${i.id}`,children:T.map(I=>l.jsx("option",{value:I},I))})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Type"}),l.jsxs("select",{value:ue,onChange:I=>{const X=I.target.value,Q=Ps[X]||Ps.string;f(i.id,{conditionVarType:X,conditionOp:Q[0].value,conditionValue:X==="boolean"?"":i.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 focus:outline-none",children:[l.jsx("option",{value:"string",children:"String"}),l.jsx("option",{value:"number",children:"Number"}),l.jsx("option",{value:"boolean",children:"Boolean"})]})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Relation"}),l.jsx("select",{value:Y,onChange:I=>f(i.id,{conditionOp:I.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 focus:outline-none",children:oe.map(I=>l.jsx("option",{value:I.value,children:I.label},I.value))})]})]}),ue!=="boolean"&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("span",{className:"text-[7px] font-bold text-gray-500 uppercase tracking-widest pl-1",children:"Value"}),l.jsx("input",{type:ue==="number"?"number":"text",value:i.conditionValue||"",onChange:I=>f(i.id,{conditionValue:I.target.value}),onBlur:()=>d(),placeholder:ue==="number"?"0":"value",className:"w-full bg-white/[0.05] border border-white/10 rounded-lg px-3 py-2 text-[10px] text-white focus:outline-none focus:border-white/30"})]})]}),i.type==="repeat"&&y("Times",k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"3"}))),i.type==="foreach"&&l.jsxs(l.Fragment,{children:[y("Selector (Optional)",k(l.jsx(Yt,{value:i.selector||"",onChange:I=>f(i.id,{selector:I}),onBlur:()=>d(),variables:c,placeholder:".list-item"}))),y("Variable (Array Name)",k(l.jsx(Yt,{value:i.varName||"",onChange:I=>f(i.id,{varName:I}),onBlur:()=>d(),variables:c,placeholder:"items"})))]}),i.type==="set"&&l.jsxs(l.Fragment,{children:[y("Variable Name",k(l.jsx(Yt,{value:i.varName||"",onChange:I=>f(i.id,{varName:I}),onBlur:()=>d(),variables:c,placeholder:"status"}))),y("Value",k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"ready"})))]}),i.type==="merge"&&l.jsxs(l.Fragment,{children:[y("Sources",k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"items, extraItems, {$block.output}"}))),y("Target Variable (Optional)",k(l.jsx(Yt,{value:i.varName||"",onChange:I=>f(i.id,{varName:I}),onBlur:()=>d(),variables:c,placeholder:"allItems"})))]}),i.type==="stop"&&y("Outcome",l.jsxs("select",{value:i.value||"success",onChange:I=>f(i.id,{value:I.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[l.jsx("option",{value:"success",children:"Success"}),l.jsx("option",{value:"error",children:"Error"})]})),i.type==="start"&&y("Task",l.jsxs("select",{value:i.value||"",onChange:I=>f(i.id,{value:I.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 text-[9px] font-bold uppercase tracking-[0.2em] text-white/70 focus:outline-none",children:[l.jsx("option",{value:"",disabled:!0,children:"Select task"}),r.length===0&&l.jsx("option",{value:"",disabled:!0,children:"No other tasks"}),r.map(I=>l.jsx("option",{value:I.id,children:I.name||I.id},I.id))]})),i.type==="wait_downloads"&&y("Max Wait (Sec, Optional)",k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"30"}))),i.type==="http_request"&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Method"}),l.jsx("select",{value:ae,onChange:I=>f(i.id,{method:I.target.value},!0),className:"custom-select w-full bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 text-[9px] font-bold uppercase tracking-[0.1em] text-white/70 focus:outline-none focus:border-white/20",children:["GET","POST","PUT","PATCH","DELETE"].map(I=>l.jsx("option",{value:I,children:I},I))})]}),l.jsxs("div",{className:"col-span-2 space-y-1.5",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"URL"}),k(l.jsx(Yt,{value:i.value||"",onChange:I=>f(i.id,{value:I}),onBlur:()=>d(),variables:c,placeholder:"https://api.example.com/data"}))]})]}),y("Headers (JSON, Optional)",k(l.jsx(xn,{value:i.headers||"",onChange:I=>f(i.id,{headers:I}),onBlur:()=>d(),language:"json",variables:c,className:"min-h-[56px]",placeholder:'{"Authorization": "Bearer {$token}"}'}))),z.includes(ae)&&y("Body",k(l.jsx(xn,{value:i.body||"",onChange:I=>f(i.id,{body:I}),onBlur:()=>d(),language:"json",variables:c,className:"min-h-[80px]",placeholder:'{"key": "value"}'}))),y("Store Response In Variable (Optional)",k(l.jsx(Yt,{value:i.varName||"",onChange:I=>f(i.id,{varName:I}),onBlur:()=>d(),variables:c,placeholder:"apiResponse"})))]})]})};return ur.createPortal(l.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:h,children:l.jsxs("div",{className:"glass-card w-full max-w-lg rounded-[28px] border border-white/10 p-7 shadow-2xl animate-in fade-in zoom-in-95 duration-200 flex flex-col gap-10 max-h-[85vh]",onClick:O=>O.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:x}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Configure this block."})]}),l.jsx("button",{onClick:h,className:"p-2 text-white/40 hover:text-white transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-xl","aria-label":"Close",title:"Close",children:l.jsx(he,{name:"close",className:"text-base"})})]}),l.jsx("div",{className:"overflow-y-auto custom-scrollbar pr-1",children:U()}),l.jsx("button",{onClick:h,className:"shrink-0 w-full py-3 rounded-2xl bg-white text-black text-[10px] font-bold uppercase tracking-[0.2em] hover:scale-[1.02] active:scale-[0.98] transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Done"})]})}),document.body)},cy=i=>{let c="";if(i.type==="click"||i.type==="hover"||i.type==="scroll"||i.type==="wait_selector")c=i.selector||"";else if(i.type==="type"||i.type==="navigate"||i.type==="wait"||i.type==="javascript"||i.type==="repeat"||i.type==="start"||i.type==="screenshot"||i.type==="wait_downloads"||i.type==="stop")c=i.value||"";else if(i.type==="set"||i.type==="foreach"||i.type==="merge")c=i.varName||"";else if(i.type==="press")c=i.key||"";else if(i.type==="if"||i.type==="while")c=i.conditionVar||"";else if(i.type==="http_request"){const r=i.method||"GET";c=i.value?`[${r}] ${i.value}`:r}return c.trim()},uy=i=>{const c="text-[12px]";return i==="if"||i==="else"?l.jsx(he,{name:"call_split",className:`${c} text-white`}):i==="end"?l.jsx(he,{name:"subdirectory_arrow_right",className:`${c} text-gray-500`}):i==="while"||i==="repeat"?l.jsx(he,{name:"repeat",className:`${c} text-white`}):i==="foreach"?l.jsx(he,{name:"list",className:`${c} text-white`}):i==="on_error"?l.jsx(he,{name:"warning",className:`${c} text-red-400`}):i==="set"?l.jsx(he,{name:"data_object",className:`${c} text-white`}):i==="stop"?l.jsx(he,{name:"stop",className:`${c} text-white`}):i==="click"?l.jsx(he,{name:"ads_click",className:`${c} text-white`}):i==="type"?l.jsx(he,{name:"text_format",className:`${c} text-white`}):i==="hover"?l.jsx(he,{name:"my_location",className:`${c} text-white`}):i==="press"?l.jsx(he,{name:"keyboard",className:`${c} text-white`}):i==="wait"?l.jsx(he,{name:"schedule",className:`${c} text-white`}):i==="wait_selector"?l.jsx(he,{name:"schedule",className:`${c} text-white`}):i==="scroll"?l.jsx(he,{name:"swap_vert",className:`${c} text-white`}):i==="javascript"?l.jsx(he,{name:"code",className:`${c} text-white`}):i==="csv"?l.jsx(he,{name:"table_chart",className:`${c} text-white`}):i==="merge"?l.jsx(he,{name:"layers",className:`${c} text-white`}):i==="screenshot"?l.jsx(he,{name:"photo_camera",className:`${c} text-white`}):i==="start"?l.jsx(he,{name:"play_circle",className:`${c} text-white`}):i==="navigate"?l.jsx(he,{name:"navigation",className:`${c} text-white`}):i==="http_request"?l.jsx(he,{name:"language",className:`${c} text-white`}):i==="wait_downloads"?l.jsx(he,{name:"download",className:`${c} text-white`}):l.jsx("span",{className:"text-[9px] text-white/20",children:"|"})},dy=["else","end","on_error"],xp=tt.memo(({action:i,index:c,status:r,isDragging:u,isDragOver:f,translateY:d,variables:h,availableTasks:p,onUpdate:x,onAutoSave:g,onOpenPalette:C,onOpenContextMenu:j,onPointerDown:E,dragTransformY:v,onStartInspect:_,isSelected:m,selectorOptions:b})=>{const[S,y]=A.useState(!1),k=A.useRef(null),U=r==="running"?"border-yellow-400/60":r==="success"?"border-green-400/60":r==="error"?"border-red-400/70":r==="skipped"?"border-gray-500/40":"",O=V=>!V||!(V instanceof HTMLElement)?!1:!!V.closest('input, textarea, select, button, a, [contenteditable="true"], [data-no-drag="true"], [role="button"]'),M=u?`translateY(${v||0}px)`:d?`translateY(${d}px)`:void 0,T=cy(i),Z=!dy.includes(i.type);return l.jsxs(l.Fragment,{children:[l.jsx("div",{id:`action-${i.id}`,"data-action-id":i.id,onPointerDown:V=>{O(V.target)||V.button===0&&(k.current={x:V.clientX,y:V.clientY},V.stopPropagation(),E(V,i.id,c))},onClick:V=>{if(Z&&!O(V.target)){if(k.current){const ue=V.clientX-k.current.x,oe=V.clientY-k.current.y;if(Math.sqrt(ue*ue+oe*oe)>5)return}y(!0)}},onContextMenu:V=>j(V,i.id),className:`bg-black min-w-[280px] w-full max-w-sm mx-auto border p-5 rounded-2xl 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 ${U||(m?"border-blue-500 ring-2 ring-blue-500/50":"border-white/20")} ${u?"ring-2 ring-white/40 scale-[1.02] shadow-[0_30px_80px_rgba(0,0,0,0.45)] opacity-85 z-20 mx-auto":""} ${f&&!u?"ring-2 ring-blue-400/60 bg-blue-500/5":""} ${i.disabled?"opacity-40 grayscale":""}`,style:{transform:M},children:l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:"text-[8px] font-bold text-white/20 font-mono tracking-tighter shrink-0",children:(c+1).toString().padStart(2,"0")}),l.jsx("div",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:uy(i.type)}),l.jsx("button",{onClick:V=>{V.stopPropagation(),C(i.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 shrink-0","aria-label":`Change action type: ${i.type}`,children:ir.find(V=>V.type===i.type)?.label||i.type}),T&&l.jsx("span",{className:"text-white/40 text-[9px] font-mono truncate min-w-0 pointer-events-none",children:T}),Z&&l.jsx("button",{"data-no-drag":"true",onClick:V=>{V.stopPropagation(),y(!0)},className:"ml-auto shrink-0 text-white/20 hover:text-white/70 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded","aria-label":"Configure block",title:"Configure block",children:l.jsx(he,{name:"tune",className:"text-sm"})})]})}),S&&l.jsx(oy,{action:i,variables:h,availableTasks:p,selectorOptions:b,onUpdate:x,onAutoSave:g,onClose:()=>y(!1),onStartInspect:_})]})}),gp={default:{bg:"rgba(255,255,255,0.07)",border:"rgba(255,255,255,0.18)",header:"rgba(255,255,255,0.10)"},yellow:{bg:"rgba(250,204,21,0.14)",border:"rgba(250,204,21,0.40)",header:"rgba(250,204,21,0.20)"},pink:{bg:"rgba(236,72,153,0.14)",border:"rgba(236,72,153,0.40)",header:"rgba(236,72,153,0.20)"},green:{bg:"rgba(34,197,94,0.14)",border:"rgba(34,197,94,0.40)",header:"rgba(34,197,94,0.20)"},purple:{bg:"rgba(168,85,247,0.14)",border:"rgba(168,85,247,0.40)",header:"rgba(168,85,247,0.20)"}},bp={default:"#ffffff",yellow:"#facc15",pink:"#ec4899",green:"#22c55e",purple:"#a855f7"},fy=["default","yellow","pink","green","purple"],hy=({note:i,canvasScale:c,isSelected:r,onUpdate:u,onDelete:f,onDuplicate:d})=>{const[h,p]=A.useState(i.content===""),[x,g]=A.useState(i.content),[C,j]=A.useState(null),E=A.useRef(null),v=A.useRef(null),_=A.useRef(null),m=gp[i.color]||gp.default;A.useEffect(()=>{h&&E.current&&(E.current.focus(),E.current.select())},[h]);const b=A.useCallback(T=>{T.stopPropagation(),T.preventDefault(),v.current={startX:T.clientX,startY:T.clientY,origX:i.x,origY:i.y},T.target.setPointerCapture(T.pointerId)},[i.x,i.y]),S=A.useCallback(T=>{if(T.stopPropagation(),!v.current)return;const Z=(T.clientX-v.current.startX)/c,V=(T.clientY-v.current.startY)/c;u(i.id,{x:Math.round(v.current.origX+Z),y:Math.round(v.current.origY+V)})},[c,i.id,u]),y=A.useCallback(T=>{T.stopPropagation(),v.current=null},[]),k=A.useCallback(T=>{T.stopPropagation(),T.preventDefault(),_.current={startX:T.clientX,startY:T.clientY,origW:i.width,origH:i.height},T.target.setPointerCapture(T.pointerId)},[i.width,i.height]),U=A.useCallback(T=>{if(T.stopPropagation(),!_.current)return;const Z=(T.clientX-_.current.startX)/c,V=(T.clientY-_.current.startY)/c;u(i.id,{width:Math.round(Math.max(160,_.current.origW+Z)),height:Math.round(Math.max(100,_.current.origH+V))})},[c,i.id,u]),O=A.useCallback(T=>{T.stopPropagation(),_.current=null},[]),M=A.useCallback(()=>{u(i.id,{content:x}),p(!1)},[i.id,x,u]);return l.jsxs(l.Fragment,{children:[l.jsx("div",{"data-sticky-note-id":i.id,className:"absolute select-none group",style:{left:i.x,top:i.y,width:i.width,height:i.height,zIndex:5},onPointerDown:T=>T.stopPropagation(),onContextMenu:T=>{T.preventDefault(),T.stopPropagation();const Z=8,V=200,ue=164,oe=Math.min(Math.max(T.clientX+12,Z),window.innerWidth-V-Z),Y=Math.min(Math.max(T.clientY+12,Z),window.innerHeight-ue-Z);j({x:oe,y:Y})},children:l.jsxs("div",{className:"w-full h-full rounded-xl flex flex-col overflow-hidden",style:{background:m.bg,border:`1px solid ${r?"rgba(96,165,250,0.8)":m.border}`,boxShadow:r?"0 0 0 2px rgba(59,130,246,0.4), 0 4px 24px rgba(0,0,0,0.4)":"0 4px 24px rgba(0,0,0,0.4)"},children:[l.jsxs("div",{className:"flex items-center justify-between px-2.5 py-1.5 cursor-grab active:cursor-grabbing shrink-0",style:{background:m.header},onPointerDown:b,onPointerMove:S,onPointerUp:y,onPointerCancel:y,children:[l.jsx("div",{className:"flex items-center gap-1",style:{opacity:h?1:0,pointerEvents:h?"auto":"none",transition:"opacity 0.15s"},children:fy.map(T=>l.jsx("button",{className:"w-3 h-3 rounded-full transition-all hover:scale-125 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",style:{background:bp[T],opacity:i.color===T?1:.35,outline:i.color===T?`1.5px solid ${bp[T]}`:"none",outlineOffset:"1px"},onMouseDown:Z=>{Z.preventDefault(),Z.stopPropagation()},onPointerDown:Z=>Z.stopPropagation(),onClick:Z=>{Z.stopPropagation(),u(i.id,{color:T})},title:`Set color to ${T}`,"aria-label":`Set color to ${T}`},T))}),l.jsxs("div",{className:"flex items-center gap-1 opacity-0 group-hover:opacity-100 group-focus-within:opacity-100 transition-opacity duration-200",children:[l.jsx("button",{className:"w-6 h-6 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",onPointerDown:T=>T.stopPropagation(),onClick:T=>{T.stopPropagation(),p(!0),g(i.content)},title:"Edit note","aria-label":"Edit note",children:l.jsx(he,{name:"edit",className:"text-[14px]"})}),l.jsx(kl,{text:i.content,title:"Copy note",className:"w-6 h-6 rounded flex items-center justify-center text-white/50 hover:text-white hover:bg-white/10 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",iconClassName:"text-[14px]"}),l.jsx("button",{className:"w-6 h-6 rounded flex items-center justify-center text-white/50 hover:text-red-400 hover:bg-white/10 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",onPointerDown:T=>T.stopPropagation(),onClick:T=>{T.stopPropagation(),f(i.id)},title:"Delete note","aria-label":"Delete note",children:l.jsx(he,{name:"close",className:"text-[14px]"})})]})]}),l.jsx("div",{className:"flex-1 overflow-auto min-h-0 custom-scrollbar",onDoubleClick:()=>{h||(p(!0),g(i.content))},children:h?l.jsx("textarea",{ref:E,value:x,onChange:T=>g(T.target.value),onBlur:M,onKeyDown:T=>{T.key==="Escape"&&M(),(T.ctrlKey||T.metaKey)&&T.key==="Enter"&&M(),T.stopPropagation()},className:"w-full h-full resize-none bg-transparent px-3 py-2 text-xs text-white/80 placeholder-white/20 focus:outline-none font-mono leading-relaxed",placeholder:"Write markdown here...",style:{minHeight:0},onClick:T=>T.stopPropagation()}):l.jsx("div",{className:"px-3 py-2 text-xs text-white/75 leading-relaxed overflow-auto h-full cursor-text custom-scrollbar font-mono whitespace-pre-wrap",children:i.content||l.jsx("span",{className:"text-white/20 italic",children:"Double-click to edit..."})})}),l.jsx("div",{className:"absolute bottom-0 right-0 w-5 h-5 cursor-se-resize flex items-end justify-end pb-1 pr-1",onPointerDown:k,onPointerMove:U,onPointerUp:O,onPointerCancel:O,children:l.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",fill:"none",children:l.jsx("path",{d:"M7 1L1 7M7 4L4 7",stroke:"rgba(255,255,255,0.25)",strokeWidth:"1.5",strokeLinecap:"round"})})})]})}),C&&ur.createPortal(l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>j(null),onContextMenu:T=>{T.preventDefault(),j(null)}}),l.jsxs("div",{className:"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:C.x,top:C.y},children:[l.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{d(i),j(null)},children:[l.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"copy_all"}),"Duplicate"]}),l.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{navigator.clipboard.writeText(i.content).catch(()=>{}),j(null)},children:[l.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"content_copy"}),"Copy"]}),l.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",onClick:()=>{navigator.clipboard.writeText(i.content).catch(()=>{}),f(i.id),j(null)},children:[l.jsx("span",{className:"material-symbols-outlined text-white/40",style:{fontSize:"14px"},children:"content_cut"}),"Cut"]}),l.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400 flex items-center gap-2.5",onClick:()=>{f(i.id),j(null)},children:[l.jsx("span",{className:"material-symbols-outlined text-red-400/70",style:{fontSize:"14px"},children:"delete"}),"Delete"]})]})]}),document.body)]})},yp=({task:i,onUpdate:c,onAutoSave:r})=>{const[u,f]=A.useState(!1),[d,h]=A.useState(!1),[p,x]=A.useState(""),[g,C]=A.useState(!1),[j,E]=A.useState(null),v=(i.extractionScript||"").split(`
17
+ `).find(b=>b.trim())||"",_=async()=>{if(p.trim()){C(!0),E(null);try{const b=await fetch("/api/tasks/generate-script",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({description:p.trim()})}),S=await b.json();if(!b.ok)throw new Error(S.error||"Generation failed");c({extractionScript:S.script}),h(!1),x("")}catch(b){E(b.message)}finally{C(!1)}}},m=u?ur.createPortal(l.jsx("div",{className:"fixed inset-0 z-[190] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",onClick:()=>{f(!1),h(!1),E(null)},children:l.jsxs("div",{className:"glass-card w-full max-w-lg rounded-[28px] border border-white/10 p-7 shadow-2xl animate-in fade-in zoom-in-95 duration-200 flex flex-col gap-8 max-h-[85vh]",onClick:b=>b.stopPropagation(),children:[l.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"Extraction Script"}),l.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Runs after page actions. Return data to capture it."})]}),l.jsx("button",{onClick:()=>{f(!1),h(!1),E(null)},className:"p-2 rounded-xl text-white/40 hover:text-white transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:l.jsx(he,{name:"close",className:"text-base"})})]}),l.jsxs("div",{className:"overflow-y-auto custom-scrollbar pr-1 flex flex-col gap-6",children:[l.jsxs("div",{className:"space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Script"}),l.jsxs("button",{onClick:()=>{h(b=>!b),E(null)},className:"flex items-center gap-1 text-[8px] font-bold uppercase tracking-widest text-white/60 hover:text-white transition-colors",title:"Generate with AI",children:[l.jsx(he,{name:"auto_awesome",className:"text-sm"}),"Generate"]})]}),d&&l.jsxs("div",{className:"flex flex-col gap-2 p-3 rounded-xl bg-white/5 border border-white/10",children:[l.jsx("input",{autoFocus:!0,type:"text",value:p,onChange:b=>x(b.target.value),onKeyDown:b=>{b.key==="Enter"&&!g&&_()},placeholder:"e.g. extract all article titles and links",className:"bg-transparent text-[11px] text-white placeholder-gray-600 focus:outline-none"}),j&&l.jsx("p",{className:"text-[9px] text-red-400",children:j}),l.jsxs("div",{className:"flex justify-end gap-2",children:[l.jsx("button",{onClick:()=>{h(!1),E(null)},className:"text-[8px] font-bold uppercase tracking-widest text-gray-500 hover:text-white transition-colors",children:"Cancel"}),l.jsxs("button",{onClick:_,disabled:g||!p.trim(),className:"px-3 py-1 rounded-lg bg-white text-black text-[8px] font-bold uppercase tracking-widest hover:bg-white/90 transition-all disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-1",children:[g&&l.jsx(he,{name:"autorenew",className:"text-xs animate-spin"}),g?"Generating…":"Generate"]})]})]}),l.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 focus-within:border-white/20 transition-all",children:l.jsx(xn,{value:i.extractionScript||"",onChange:b=>c({extractionScript:b}),onBlur:r,language:"javascript",className:"min-h-[180px]",placeholder:"// Example: return { title: document.title };"})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-[7px] font-bold text-gray-600 uppercase tracking-widest pl-1",children:"Output Format"}),l.jsx("div",{className:"bg-white/[0.03] border border-white/5 rounded-xl px-3 py-2.5 focus-within:border-white/20 transition-all",children:l.jsxs("select",{value:i.extractionFormat||"json",onChange:b=>{c({extractionFormat:b.target.value})},className:"custom-select w-full bg-transparent border-none px-0 py-0 text-[11px] text-white",children:[l.jsx("option",{value:"json",children:"JSON"}),l.jsx("option",{value:"csv",children:"CSV"})]})})]})]}),l.jsx("button",{onClick:()=>{f(!1),h(!1),E(null),r()},className:"shrink-0 w-full py-3 rounded-2xl bg-white text-black text-[10px] font-bold uppercase tracking-[0.2em] hover:scale-[1.02] active:scale-[0.98] transition-all focus:outline-none",children:"Done"})]})}),document.body):null;return l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:()=>f(!0),className:"bg-black min-w-[280px] w-full max-w-sm mx-auto border border-white/20 p-5 rounded-2xl group/item relative transition-all duration-150 select-none touch-none cursor-pointer hover:border-white/40 hover:bg-white/[0.02]",children:l.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[l.jsx("div",{className:"w-4 h-4 flex items-center justify-center shrink-0",children:l.jsx(he,{name:"data_object",className:"text-[12px] text-white"})}),l.jsx("span",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-white shrink-0",children:"Extraction Script"}),v&&l.jsx("span",{className:"text-white/40 text-[9px] font-mono truncate min-w-0 pointer-events-none",children:v.trim()})]})}),m]})},py=({currentTask:i,setCurrentTask:c,canvasOffset:r,canvasScale:u,canvasViewportRef:f,triggerExpanded:d,setTriggerExpanded:h,onOpenCabinet:p,handleAutoSave:x,dragState:g,dragOverIndex:C,selectedActionIds:j,actionStatusById:E,availableTasks:v,selectorOptionsById:_,updateAction:m,openActionPalette:b,openContextMenu:S,handleActionPointerDown:y,onOpenHeadful:k,isHeadfulOpen:U,onPointerDown:O,onPointerMove:M,onPointerUp:T,onPointerCancel:Z,selectionBox:V,onAddStickyNote:ue,onUpdateStickyNote:oe,onDeleteStickyNote:Y,onDuplicateStickyNote:ae,selectedNoteIds:z})=>{const I=A.useCallback(re=>{U||k?.(i.url||"https://www.google.com",re,i,i.variables)},[U,k,i.url,i.variables]),[X,Q]=A.useState(null),Ne=A.useCallback(re=>{const R=re.target;if(R.closest("[data-action-id]")||R.closest("[data-sticky-note-id]")||R.closest('[data-interactive-target="true"]'))return;re.preventDefault();const B=re.currentTarget.getBoundingClientRect(),W=Math.round((re.clientX-B.left-r.x)/u),ee=Math.round((re.clientY-B.top-r.y)/u),H=8,ie=180,Ee=48,ze=Math.min(Math.max(re.clientX+12,H),window.innerWidth-ie-H),Ae=Math.min(Math.max(re.clientY+12,H),window.innerHeight-Ee-H);Q({x:ze,y:Ae,worldX:W,worldY:ee})},[r,u]),$=(re,R,B=0)=>{const W=[];let ee=re;for(;ee<R;){const H=ee,ie=i.actions[H];if(!ie){ee++;continue}if(ie.type==="if"||ie.type==="while"){const Ee=ee;let ze=1,Ae=ee+1,qe=-1;for(;Ae<R&&ze>0;){const te=i.actions[Ae];if((te.type==="if"||te.type==="while")&&ze++,te.type==="end"&&(ze--,ze===0))break;te.type==="else"&&ze===1&&ie.type==="if"&&(qe=Ae),Ae++}const Ke=Ae,pt=Ee+1,ot=qe!==-1?qe:Ke,N=qe!==-1?qe+1:-1,xe=qe!==-1?Ke:-1;W.push(l.jsxs("div",{className:"flex flex-col items-center w-full",children:[l.jsx("div",{className:"w-[360px]",children:l.jsx(xp,{action:ie,index:H,isDragOver:C===H&&g?.id!==ie.id,isDragging:g?.id===ie.id,dragTransformY:g?.id===ie.id?g.currentY-g.startY:void 0,isSelected:j.has(ie.id),status:E[ie.id],translateY:0,variables:i.variables,availableTasks:v,selectorOptions:_[ie.id],onUpdate:m,onAutoSave:x,onOpenPalette:b,onOpenContextMenu:S,onPointerDown:y,onStartInspect:I})}),l.jsxs("div",{className:"flex gap-16 mt-4 relative",children:[l.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[l.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:ie.type==="while"?"Loop":"True"}),l.jsx("div",{className:"w-px h-6 bg-white/25"}),l.jsx("div",{className:"flex flex-col items-center gap-3",children:$(pt,ot,B+1)}),l.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"w-px h-4 bg-white/20"}),l.jsx("button",{onClick:()=>b(void 0,ot),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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action (Ctrl + K)",title:"Add action (Ctrl + K)",children:l.jsx(he,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]}),ie.type==="if"&&l.jsxs("div",{className:"flex flex-col items-center min-w-[200px]",children:[l.jsx("div",{className:"text-[8px] font-bold text-white/60 uppercase tracking-widest mb-2",children:"Otherwise"}),l.jsx("div",{className:"w-px h-6 bg-white/25"}),l.jsx("div",{className:"flex flex-col items-center gap-3",children:N!==-1?$(N,xe,B+1):null}),l.jsxs("div",{className:"mt-2 flex flex-col items-center",children:[l.jsx("div",{className:"w-px h-4 bg-white/20"}),l.jsx("button",{onClick:()=>{if(N!==-1)b(void 0,xe);else{const te={id:"act_"+Date.now()+"_else",type:"else",selector:"",value:""},q=[...i.actions];q.splice(Ke,0,te),c({...i,actions:q}),x({...i,actions:q}),setTimeout(()=>b(void 0,Ke+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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action (Ctrl + K)",title:"Add action (Ctrl + K)",children:l.jsx(he,{name:"add",className:"text-lg text-gray-500 group-hover:text-white transition-colors"})})]})]})]}),l.jsxs("div",{className:"flex flex-col items-center mt-3",children:[l.jsx("div",{className:"w-px h-2 bg-white/25"}),l.jsx("button",{onClick:()=>b(void 0,Ke+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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action (Ctrl + K)",title:"Add action (Ctrl + K)",children:l.jsx(he,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),l.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},ie.id)),ee=Ke+1}else ie.type==="end"||ie.type==="else"||W.push(l.jsxs("div",{className:"flex flex-col items-center",children:[l.jsx("div",{className:"w-[360px]",children:l.jsx(xp,{action:ie,index:H,isDragOver:C===H&&g?.id!==ie.id,isDragging:g?.id===ie.id,dragTransformY:g?.id===ie.id?g.currentY-g.startY:void 0,isSelected:j.has(ie.id),status:E[ie.id],translateY:0,variables:i.variables,availableTasks:v,selectorOptions:_[ie.id],onUpdate:m,onAutoSave:x,onOpenPalette:b,onOpenContextMenu:S,onPointerDown:y,onStartInspect:I})}),ee<R-1&&i.actions[ee+1]?.type!=="end"&&l.jsxs("div",{className:"flex flex-col items-center my-1",children:[l.jsx("div",{className:"w-px h-2 bg-white/25"}),l.jsx("button",{onClick:()=>b(void 0,H+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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action (Ctrl + K)",title:"Add action (Ctrl + K)",children:l.jsx(he,{name:"add",className:"text-sm text-gray-600 group-hover:text-white transition-colors"})}),l.jsx("div",{className:"w-px h-2 bg-white/25"})]})]},ie.id)),ee++}return W};return l.jsxs("div",{ref:f,className:"flex-1 overflow-hidden relative cursor-grab active:cursor-grabbing select-none",style:{touchAction:"none"},onPointerDown:O,onPointerMove:M,onPointerUp:T,onPointerCancel:Z,onContextMenu:Ne,children:[l.jsx("div",{className:"absolute inset-0 pointer-events-none z-0",style:{backgroundImage:"radial-gradient(circle, rgba(255,255,255,0.12) 0.8px, transparent 0)",backgroundSize:`${22*u}px ${22*u}px`,backgroundPosition:`${r.x}px ${r.y}px`}}),l.jsxs("div",{className:"absolute origin-top-left",style:{transform:`translate(${r.x}px, ${r.y}px) scale(${u})`},children:[(i.stickyNotes||[]).map(re=>l.jsx(hy,{note:re,canvasScale:u,isSelected:z.has(re.id),onUpdate:oe,onDelete:Y,onDuplicate:ae},re.id)),l.jsxs("div",{className:"relative z-10 flex flex-col items-center pointer-events-none",style:{paddingTop:"60px",minWidth:"500px"},children:[l.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 pointer-events-auto",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("button",{type:"button","aria-expanded":d,"aria-label":d?"Collapse trigger settings":"Expand trigger settings",title:d?"Collapse":"Expand",onClick:()=>h(!d),className:"flex items-center gap-3 cursor-pointer focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 rounded-lg pr-2 transition-all",children:[l.jsx(he,{name:"bolt",className:"text-white/40 text-base"}),l.jsx("h3",{className:"text-white/60 font-bold tracking-widest uppercase text-[10px]",children:"On Execution"}),l.jsx(he,{name:d?"expand_less":"expand_more",className:"text-xs text-gray-600"})]}),l.jsx("button",{onClick:()=>p("mode"),className:"p-2 rounded-lg hover:bg-white/10 text-white/30 hover:text-white transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Task Settings","aria-label":"Task Settings",children:l.jsx(he,{name:"settings",className:"text-lg"})})]}),i.description&&l.jsx("p",{className:"text-[10px] text-gray-500 mt-2 leading-relaxed",children:i.description}),d&&l.jsxs("div",{className:"space-y-4 mt-4 pt-3 border-t border-white/10",children:[l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"URL"}),l.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:l.jsx(Yt,{value:i.url,onChange:re=>c({...i,url:re}),onBlur:()=>x(),variables:i.variables,placeholder:"https://..."})})]}),l.jsxs("div",{className:"space-y-1.5",children:[l.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Wait (sec)"}),l.jsx("input",{type:"number",value:i.wait,onChange:re=>c({...i,wait:parseFloat(re.target.value)||0}),onBlur:()=>x(),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"})]})]})]}),(i.mode==="agent"||i.mode==="scrape")&&l.jsx("div",{className:"w-px h-10 bg-white/25"}),i.mode==="scrape"&&l.jsx("div",{className:"w-[360px] pointer-events-auto",children:l.jsx(yp,{task:i,onUpdate:re=>{const R={...i,...re};c(R),x(R)},onAutoSave:()=>x()})}),i.mode==="agent"&&l.jsx("div",{className:"flex flex-col items-center w-full select-text cursor-auto pointer-events-auto",children:l.jsxs("div",{className:"space-y-6 w-full flex flex-col items-center relative",children:[$(0,i.actions.length),l.jsxs("div",{className:"pt-2 flex flex-col items-center",children:[l.jsx("div",{className:"w-px h-6 bg-white/10"}),l.jsxs("button",{onClick:()=>b(),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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Add action (Ctrl + K)",title:"Add action (Ctrl + K)",children:[l.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:l.jsx(he,{name:"add",className:"text-2xl text-gray-500 group-hover:text-white transition-colors"})}),l.jsx("span",{className:"text-[9px] font-bold uppercase tracking-[0.2em] text-gray-500 group-hover:text-gray-300 transition-colors",children:"Add Action"})]})]}),l.jsx("div",{className:"w-px h-6 bg-white/25"}),l.jsx("div",{className:"w-[360px]",children:l.jsx(yp,{task:i,onUpdate:re=>{const R={...i,...re};c(R),x(R)},onAutoSave:()=>x()})})]})})]})]}),V&&l.jsx("div",{className:"fixed inset-0 pointer-events-none z-20 overflow-hidden",children:l.jsx("div",{className:"absolute bg-blue-500/10 border border-blue-400",style:{left:Math.min(V.startX,V.currentX),top:Math.min(V.startY,V.currentY),width:Math.abs(V.currentX-V.startX),height:Math.abs(V.currentY-V.startY)}})}),X&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>Q(null),onContextMenu:re=>{re.preventDefault(),Q(null)}}),l.jsx("div",{className:"fixed z-50 w-[180px] bg-[#0b0b0b] border border-white/10 rounded-xl shadow-2xl p-2 text-[10px] font-bold uppercase tracking-widest text-white/80",style:{left:X.x,top:X.y},children:l.jsxs("button",{className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2",onClick:()=>{ue(X.worldX,X.worldY),Q(null)},children:[l.jsx("span",{className:"material-symbols-outlined text-white/50",style:{fontSize:"14px"},children:"sticky_note_2"}),"Add sticky note"]})})]})]})},Jp=({currentTask:i,setCurrentTask:c,tasks:r=[],isExecuting:u,onSave:f,onRun:d,results:h,pinnedResults:p,onConfirm:x,onNotify:g,onPinResults:C,onUnpinResults:j,onRunSnapshot:E,runId:v,onStop:_,isHeadfulOpen:m,onOpenHeadful:b,onStopHeadful:S,useNovnc:y})=>{const k=hb();bb(i,be=>c(be),(be,ye)=>f(be,ye));const U=yb(i,c,(be,ye)=>f(be,ye)),O=vb(i,g,x,be=>c(be)),M=wb(i,m,U.updateAction,g,S),{proxyList:T,proxyListLoaded:Z}=jb(),V=A.useRef(i);A.useEffect(()=>{V.current=i},[i]);const[ue,oe]=A.useState(null),[Y,ae]=A.useState([]),[z,I]=A.useState([]),[X,Q]=A.useState(!1),[Ne,$]=A.useState(!1),[re,R]=A.useState("mode"),[B,W]=A.useState(null),[ee,H]=A.useState(""),[ie,Ee]=A.useState(null),[ze,Ae]=A.useState(null),[qe,Ke]=A.useState({}),[pt,ot]=A.useState(!1),[N,xe]=A.useState(!1),[te,q]=A.useState(new Set);A.useEffect(()=>{if(!v||i.mode!=="agent")return;Ke({});const be=new EventSource(`/api/executions/stream?runId=${encodeURIComponent(v)}`,{withCredentials:!0});return be.onmessage=ye=>{if(ye.data)try{const Re=JSON.parse(ye.data);Re&&Re.actionId&&Re.status&&Ke(Me=>({...Me,[Re.actionId]:Re.status}))}catch{}},()=>be.close()},[v,i.mode]);const L=A.useCallback(be=>{f(be||V.current,!1)},[f]),J=A.useCallback((be,ye)=>{const Re={id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:be-100,y:ye-60,width:220,height:160,content:"",color:"default"},Me={...i,stickyNotes:[...i.stickyNotes||[],Re]};c(Me),L(Me)},[i,L,c]),me=A.useCallback((be,ye)=>{if((ye.x!==void 0||ye.y!==void 0)&&ye.color===void 0&&ye.content===void 0&&ye.width===void 0&&ye.height===void 0&&te.has(be)&&te.size>1){const Be=(i.stickyNotes||[]).find(Ie=>Ie.id===be);if(Be){const Ie=(ye.x??Be.x)-Be.x,Te=(ye.y??Be.y)-Be.y,$e={...i,stickyNotes:(i.stickyNotes||[]).map(rt=>rt.id===be?{...rt,...ye}:te.has(rt.id)?{...rt,x:rt.x+Ie,y:rt.y+Te}:rt)};c($e),L($e);return}}const Me={...i,stickyNotes:(i.stickyNotes||[]).map(Be=>Be.id===be?{...Be,...ye}:Be)};c(Me),L(Me)},[i,L,c,te]),ce=A.useCallback(be=>{const ye={...be,id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:be.x+24,y:be.y+24},Re={...i,stickyNotes:[...i.stickyNotes||[],ye]};c(Re),L(Re)},[i,L,c]),K=A.useCallback(be=>{const ye={...i,stickyNotes:(i.stickyNotes||[]).filter(Re=>Re.id!==be)};c(ye),L(ye)},[i,L,c]),we=(be="mode")=>{R(be),be==="history"&&O.loadVersions(),$(!0)},Ce=A.useCallback((be,ye)=>{Q(!0),H(""),Ee(be||null),Ae(ye!==void 0?ye:null)},[]),je=be=>{const ye=be.tagName.toLowerCase();return ye==="input"||ye==="textarea"||be.isContentEditable||be.closest('[data-interactive-target="true"]')};A.useEffect(()=>{const be=ye=>{if((ye.ctrlKey||ye.metaKey)&&ye.key==="Enter"){ye.preventDefault(),ot(!0),d();return}if(!je(ye.target))if(ye.key==="Backspace"||ye.key==="Delete"){if(U.selectedActionIds.size>0||te.size>0){ye.preventDefault();let Re=[...i.actions];U.selectedActionIds.forEach(Be=>{const Ie=Re.findIndex(Te=>Te.id===Be);if(Ie!==-1){const Te=Re[Ie];if(Te.type==="if"||Te.type==="while"){let $e=1;for(let rt=Ie+1;rt<Re.length;rt++)if((Re[rt].type==="if"||Re[rt].type==="while")&&$e++,Re[rt].type==="end"&&$e--,$e===0){Re.splice(rt,1);break}}Re.splice(Ie,1)}});const Me={...i,actions:Re,stickyNotes:(i.stickyNotes||[]).filter(Be=>!te.has(Be.id))};c(Me),L(Me),U.setSelectedActionIds(new Set),q(new Set)}}else if((ye.ctrlKey||ye.metaKey)&&ye.key==="c")(U.selectedActionIds.size>0||te.size>0)&&(ye.preventDefault(),U.selectedActionIds.size>0&&ae(i.actions.filter(Re=>U.selectedActionIds.has(Re.id))),te.size>0&&I((i.stickyNotes||[]).filter(Re=>te.has(Re.id))));else if((ye.ctrlKey||ye.metaKey)&&ye.key==="v"){if(Y.length>0||z.length>0){ye.preventDefault();let Re={...i},Me=[],Be=[];if(Y.length>0){const Ie=Y.map(ha=>({...ha,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)})),Te=Math.max(-1,...Y.map(ha=>Re.actions.findIndex(ga=>ga.id===ha.id))),$e=Te>=0?Te+1:Re.actions.length,rt=[...Re.actions];rt.splice($e,0,...Ie),Re={...Re,actions:rt},Me=Ie.map(ha=>ha.id)}if(z.length>0){const Ie=z.map(Te=>({...Te,id:"note_"+Date.now()+"_"+Math.floor(Math.random()*1e3),x:Te.x+24,y:Te.y+24}));Re={...Re,stickyNotes:[...Re.stickyNotes||[],...Ie]},Be=Ie.map(Te=>Te.id)}c(Re),L(Re),Me.length>0&&U.setSelectedActionIds(new Set(Me)),Be.length>0&&q(new Set(Be))}}else(ye.ctrlKey||ye.metaKey)&&ye.key==="a"?(ye.preventDefault(),U.setSelectedActionIds(new Set(i.actions.map(Re=>Re.id)))):(ye.metaKey||ye.ctrlKey)&&ye.key==="k"?(ye.preventDefault(),X||Ce()):ye.key==="Escape"&&(O.versionPreview?O.setVersionPreview(null):X?Q(!1):Ne?$(!1):ue?oe(null):pt&&ot(!1))};return document.addEventListener("keydown",be),()=>document.removeEventListener("keydown",be)},[U,i,L,X,Ce,c,te,Y,z]);const Oe=A.useCallback((be,ye)=>{be.preventDefault();const Re=8,Me=200,Be=190,Ie=Math.min(Math.max(be.clientX+12,Re),window.innerWidth-Me-Re),Te=Math.min(Math.max(be.clientY+12,Re),window.innerHeight-Be-Re);oe({id:ye,x:Ie,y:Te})},[]),Ve=be=>({...be,id:"act_"+Date.now()+"_"+Math.floor(Math.random()*1e3)}),He=be=>{const ye={id:"act_"+Date.now(),type:be,selector:"",value:""};if((be==="set"||be==="merge")&&(ye.varName=""),be==="start"&&(ye.value=""),be==="type"&&(ye.typeMode="replace"),be==="if"||be==="while"){ye.conditionVar="",ye.conditionVarType="string",ye.conditionOp="equals",ye.conditionValue="";const Re={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""},Me={...i,actions:[...i.actions,ye,Re]};c(Me),L(Me)}else{be==="wait_downloads"&&(ye.value="30");const Re={...i,actions:[...i.actions,ye]};c(Re),L(Re)}},it=A.useMemo(()=>r.filter(be=>String(be.id||"")!==String(i.id||"")),[r,i.id]);return l.jsxs("div",{className:"flex-1 flex overflow-hidden animate-in fade-in slide-in-from-bottom-4 duration-500 bg-black relative",children:[l.jsx(Sb,{currentTask:i,onUpdateTaskName:be=>c({...i,name:be}),onAutoSave:L,onOpenHistory:()=>we("history")}),l.jsx(py,{currentTask:i,setCurrentTask:c,canvasOffset:k.canvasOffset,canvasScale:k.canvasScale,canvasViewportRef:k.canvasViewportRef,triggerExpanded:N,setTriggerExpanded:xe,onOpenCabinet:we,handleAutoSave:L,dragState:U.dragState,dragOverIndex:U.dragOverIndex,selectedActionIds:U.selectedActionIds,setSelectedActionIds:U.setSelectedActionIds,actionStatusById:qe,availableTasks:it,selectorOptionsById:M.selectorOptionsById,updateAction:U.updateAction,openActionPalette:Ce,openContextMenu:Oe,handleActionPointerDown:U.handleActionPointerDown,onOpenHeadful:A.useCallback((be,ye)=>{M.setActiveInspectActionId(ye||null),b?.(be,ye,V.current,V.current.variables)},[b,M.setActiveInspectActionId]),isHeadfulOpen:m,onPointerDown:be=>{if(be.button===1||be.button===0&&k.spaceHeldRef.current)k.startPanning(be);else if(be.button===0&&!je(be.target)){if(be.target.closest("[data-action-id]")||be.target.closest("[data-sticky-note-id]"))return;W({startX:be.clientX,startY:be.clientY,currentX:be.clientX,currentY:be.clientY}),!be.shiftKey&&!be.ctrlKey&&!be.metaKey&&(U.setSelectedActionIds(new Set),q(new Set)),be.target.setPointerCapture?.(be.pointerId)}},onPointerMove:be=>{if(k.isPanning.current)k.handlePanning(be.nativeEvent);else if(B){W(Te=>Te?{...Te,currentX:be.clientX,currentY:be.clientY}:null);const ye={left:Math.min(B.startX,be.clientX),right:Math.max(B.startX,be.clientX),top:Math.min(B.startY,be.clientY),bottom:Math.max(B.startY,be.clientY)},Re=document.querySelectorAll("[data-action-id]"),Me=new Set(be.shiftKey||be.ctrlKey||be.metaKey?Array.from(U.selectedActionIds):[]);Re.forEach(Te=>{const $e=Te.getBoundingClientRect();!($e.right<ye.left||$e.left>ye.right||$e.bottom<ye.top||$e.top>ye.bottom)&&Me.add(Te.getAttribute("data-action-id"))}),U.setSelectedActionIds(Me);const Be=document.querySelectorAll("[data-sticky-note-id]"),Ie=new Set(be.shiftKey||be.ctrlKey||be.metaKey?Array.from(te):[]);Be.forEach(Te=>{const $e=Te.getBoundingClientRect();!($e.right<ye.left||$e.left>ye.right||$e.bottom<ye.top||$e.top>ye.bottom)&&Ie.add(Te.getAttribute("data-sticky-note-id"))}),q(Ie)}},onPointerUp:()=>{k.stopPanning(),W(null)},onPointerCancel:()=>{k.stopPanning(),W(null)},selectionBox:B,onAddStickyNote:J,onUpdateStickyNote:me,onDeleteStickyNote:K,onDuplicateStickyNote:ce,selectedNoteIds:te}),l.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",role:"group","aria-label":"Zoom controls",children:[l.jsx("button",{onClick:()=>k.setCanvasScale(Math.min(2,k.canvasScale*1.2)),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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Zoom in",title:"Zoom in",children:"+"}),l.jsxs("div",{className:"text-[8px] text-center text-gray-500 font-bold select-none","aria-live":"polite",children:[Math.round(k.canvasScale*100),"%"]}),l.jsx("button",{onClick:()=>k.setCanvasScale(Math.max(.25,k.canvasScale*.8)),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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Zoom out",title:"Zoom out",children:"−"}),l.jsx("button",{onClick:()=>{k.setCanvasScale(1);const be=k.canvasViewportRef.current;k.setCanvasOffset({x:((be?be.clientWidth:1e3)-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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Reset zoom and center",title:"Reset zoom and center",children:l.jsx(he,{name:"fit_screen",className:"text-sm"})})]}),ue&&(()=>{const be=i.actions.findIndex(Be=>Be.id===ue.id),ye=i.actions[be];if(!ye)return null;const Re=U.selectedActionIds.has(ye.id)&&U.selectedActionIds.size>1,Me=Re?Array.from(U.selectedActionIds):[ye.id];return l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"fixed inset-0 z-40",onClick:()=>oe(null)}),l.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:ue.x,top:ue.y},children:[l.jsxs("button",{onClick:()=>{const Be=!ye.disabled,Ie=i.actions.map($e=>Me.includes($e.id)?{...$e,disabled:Be}:$e),Te={...i,actions:Ie};c(Te),L(Te),oe(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[l.jsx(he,{name:ye.disabled?"visibility":"visibility_off",className:"text-sm text-white/40"}),ye.disabled?"Enable":"Disable"," ",Re?"All":""]}),l.jsxs("button",{onClick:()=>{const Be=i.actions.filter(Te=>!Me.includes(Te.id)),Ie={...i,actions:Be};c(Ie),L(Ie),oe(null),U.setSelectedActionIds(new Set)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors text-red-400 flex items-center gap-2.5",children:[l.jsx(he,{name:"delete",className:"text-sm text-red-400/70"}),"Delete ",Re?"All":""]}),l.jsxs("button",{onClick:()=>{const Be=i.actions.filter($e=>Me.includes($e.id));ae(Be);const Ie=i.actions.filter($e=>!Me.includes($e.id)),Te={...i,actions:Ie};c(Te),L(Te),U.setSelectedActionIds(new Set),oe(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[l.jsx(he,{name:"content_cut",className:"text-sm text-white/40"}),"Cut ",Re?"All":""]}),l.jsxs("button",{onClick:()=>{ae(i.actions.filter(Be=>Me.includes(Be.id))),oe(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[l.jsx(he,{name:"content_copy",className:"text-sm text-white/40"}),"Copy ",Re?"All":""]}),l.jsxs("button",{onClick:()=>{const Ie=i.actions.filter(rt=>Me.includes(rt.id)).map(rt=>Ve(rt)),Te=[...i.actions];Te.splice(be+1,0,...Ie);const $e={...i,actions:Te};c($e),L($e),oe(null)},className:"w-full text-left px-3 py-2 rounded-lg hover:bg-white/5 transition-colors flex items-center gap-2.5",children:[l.jsx(he,{name:"copy_all",className:"text-sm text-white/40"}),"Duplicate ",Re?"All":""]})]})]})})(),l.jsx(lb,{open:X,query:ee,onQueryChange:H,onClose:()=>Q(!1),onSelect:be=>{if(ie)U.updateAction(ie,{type:be},!0);else if(ze!==null){const ye={id:"act_"+Date.now(),type:be,selector:"",value:""};(be==="set"||be==="merge")&&(ye.varName=""),be==="start"&&(ye.value=""),be==="type"&&(ye.typeMode="replace"),(be==="if"||be==="while")&&(ye.conditionVar="",ye.conditionVarType="string",ye.conditionOp="equals",ye.conditionValue=""),be==="wait_downloads"&&(ye.value="30");const Re=[...i.actions];if(be==="if"||be==="while"){const Be={id:"act_"+Date.now()+"_end",type:"end",selector:"",value:""};Re.splice(ze,0,ye,Be)}else Re.splice(ze,0,ye);const Me={...i,actions:Re};c(Me),L(Me)}else He(be);Q(!1),Ae(null)}}),l.jsx(Wb,{isOpen:pt,onToggle:()=>ot(!pt),results:h,pinnedResults:p,isExecuting:u,isHeadfulOpen:m||!1,runId:v,onConfirm:x,onNotify:g,onPinResults:C,onUnpinResults:j,useNovnc:y}),l.jsx(ey,{versionPreview:O.versionPreview,onClose:()=>O.setVersionPreview(null),onRunSnapshot:E}),l.jsx(ty,{isHeadfulOpen:m||!1,isInspectMode:M.isInspectMode,isInspectLoading:M.isInspectLoading,isExecuting:u,useNovnc:y,onToggleInspect:M.handleToggleInspect,onStopHeadful:()=>S?.()}),l.jsx(Nb,{isExecuting:u,isHeadfulOpen:m||!1,onRun:()=>{ot(!0),d()},onStop:_,onOpenHeadful:()=>b?.(i.url||"https://www.google.com",void 0,i,i.variables),onStopHeadful:S}),l.jsx(fb,{isOpen:Ne,onClose:()=>$(!1),currentTask:i,onUpdateTask:be=>{const ye={...i,...be};c(ye),L(ye)},proxyListLoaded:Z,proxyList:T,initialTab:re,versions:O.versions,versionsLoading:O.versionsLoading,onRollback:O.rollbackToVersion,onPreview:O.openVersionPreview})]})};function my(i){return i>=1e6?`${(i/1e6).toFixed(1).replace(/\.0$/,"")}m`:i>=1e3?`${(i/1e3).toFixed(1).replace(/\.0$/,"")}k`:String(i)}const xy=({className:i})=>l.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",className:i,"aria-hidden":"true",children:l.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 gy({className:i=""}){const[c,r]=A.useState("—"),u=d=>{const h=d.currentTarget.getBoundingClientRect(),p=Math.min(1,Math.max(0,(d.clientX-h.left)/h.width)),x=Math.min(1,Math.max(0,(d.clientY-h.top)/h.height));d.currentTarget.style.setProperty("--beam-x",`${(p*100).toFixed(2)}%`),d.currentTarget.style.setProperty("--beam-y",`${(x*100).toFixed(2)}%`)},f=d=>{d.currentTarget.style.setProperty("--beam-x","50%"),d.currentTarget.style.setProperty("--beam-y","50%")};return A.useEffect(()=>{let d=!0;return fetch("https://api.github.com/repos/figranium/figranium").then(h=>h.ok?h.json():null).then(h=>{!d||!h?.stargazers_count||r(my(Number(h.stargazers_count)))}).catch(()=>{d&&r("—")}),()=>{d=!1}},[]),l.jsxs("a",{href:"https://github.com/figranium/figranium",target:"_blank",rel:"noreferrer",onPointerMove:u,onPointerLeave:f,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 ${i}`,"aria-label":"Star Figranium on GitHub",children:[l.jsx(xy,{className:"h-4 w-4"}),"GitHub",l.jsx("span",{className:"mx-1 h-3 w-px bg-white/20","aria-hidden":"true"}),l.jsx(he,{name:"star",className:"text-base",fill:!0}),c]})}const vp=i=>{if(!i)return{url:"",model:""};try{const c=JSON.parse(i);return{url:c.url||"",model:c.model||""}}catch{return{url:i,model:""}}},by=({config:i,onConfirm:c})=>{const[r,u]=A.useState(i.startEditing||!1),[f,d]=A.useState(i.startEditing&&i.value||""),[h,p]=A.useState(!1),[x,g]=A.useState(""),[C,j]=A.useState(""),E=()=>{if(i.urlModel){const k=vp(i.value);g(k.url),j(k.model)}else d(i.value||""),p(!1);u(!0)},v=()=>{u(!1),d(""),g(""),j(""),p(!1)},_=async()=>{if(i.urlModel){const k=JSON.stringify({url:x.trim(),model:C.trim()});await i.onSave(k)}else await i.onSave(f.trim());u(!1)},m=async()=>{i.onRegenerate&&await i.onRegenerate()},b=i.loading?"Loading...":i.value?"••••••••••••••••••••••••••••••••••••••••":"No key set",S=l.jsx("div",{className:"w-10 h-10 rounded-2xl flex items-center justify-center text-blue-400 overflow-hidden shrink-0",children:i.iconUrl?l.jsx("img",{src:i.iconUrl,alt:i.name,className:"w-6 h-6 object-contain"}):i.iconComponent?l.jsx(i.iconComponent,{className:"w-5 h-5"}):l.jsx(he,{name:i.icon||"key",className:"text-xl"})}),y=i.onDelete&&l.jsx("button",{onClick:async()=>{(c?await c(`Are you sure you want to delete the ${i.name}?`):confirm(`Are you sure you want to delete the ${i.name}?`))&&await i.onDelete?.()},disabled:i.loading||i.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 shrink-0",title:"Delete","aria-label":"Delete",children:l.jsx(he,{name:"delete",className:"text-base"})});if(i.urlModel){const k=vp(i.value);return l.jsxs("div",{className:"flex flex-col gap-4 py-4 border-b border-white/5 last:border-0",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[S,l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h4",{className:"text-sm font-bold text-white uppercase tracking-widest",children:i.name}),i.badge&&l.jsx("span",{className:`text-[8px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full ${i.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:i.badge})]}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:i.description})]})]}),r?l.jsxs("div",{className:"flex flex-col gap-3",children:[l.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl bg-black/40 border border-white/30 focus-within:border-white px-4 py-3 transition-all",children:[l.jsxs("div",{className:"flex flex-col gap-1",children:[l.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Base URL"}),l.jsx("input",{type:"text",value:x,onChange:U=>g(U.target.value),disabled:i.saving,placeholder:"http://localhost:11434",className:"bg-transparent text-[11px] text-white font-mono focus:outline-none",autoFocus:!0})]}),l.jsxs("div",{className:"border-t border-white/10 pt-2 flex flex-col gap-1",children:[l.jsx("label",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Model"}),l.jsx("input",{type:"text",value:C,onChange:U=>j(U.target.value),disabled:i.saving,placeholder:"gemma4:e2b",className:"bg-transparent text-[11px] text-white font-mono focus:outline-none"})]})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("button",{onClick:v,disabled:i.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"}),l.jsxs("button",{onClick:_,disabled:i.saving||!x.trim(),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:[l.jsx(he,{name:"save",className:"text-base"}),i.saving?"Saving...":"Save"]})]})]}):l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{className:"flex-1 rounded-2xl bg-black/40 border border-white/10 px-4 py-3 text-[10px] text-blue-200/80 min-h-[44px] flex flex-col justify-center gap-1",children:i.loading?l.jsx("span",{className:"opacity-50",children:"Loading..."}):i.value?l.jsxs(l.Fragment,{children:[l.jsx("span",{className:"font-mono",children:k.url||l.jsx("span",{className:"opacity-40",children:"No URL"})}),l.jsx("span",{className:"text-white/40",children:k.model||l.jsx("span",{className:"italic",children:"No model set"})})]}):l.jsx("span",{className:"opacity-40",children:"Not configured"})}),!i.readOnly&&l.jsxs("button",{onClick:E,disabled:i.loading||i.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 shrink-0",children:[l.jsx(he,{name:"edit",className:"text-base"}),"Edit"]}),y]})]})}return l.jsxs("div",{className:"flex flex-col gap-4 py-4 border-b border-white/5 last:border-0",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[S,l.jsxs("div",{children:[l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("h4",{className:"text-sm font-bold text-white uppercase tracking-widest",children:i.name}),i.badge&&l.jsx("span",{className:`text-[8px] font-bold uppercase tracking-widest px-2 py-0.5 rounded-full ${i.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:i.badge})]}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:i.description})]})]}),r?l.jsxs("div",{className:"flex items-center gap-3",children:[l.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:[l.jsx("input",{type:h?"text":"password",value:f,onChange:k=>d(k.target.value),disabled:i.saving,placeholder:"Enter new API key...",className:"flex-1 bg-transparent text-[10px] text-white font-mono focus:outline-none",autoFocus:!0}),l.jsx("button",{onClick:()=>p(!h),type:"button",className:"p-2 rounded-xl text-white/50 hover:text-white hover:bg-white/10 transition-all",title:h?"Hide value":"Show value","aria-label":h?"Hide value":"Show value",children:l.jsx(he,{name:h?"visibility_off":"visibility",className:"text-base"})})]}),l.jsx("button",{onClick:v,disabled:i.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"}),l.jsxs("button",{onClick:_,disabled:i.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:[l.jsx(he,{name:"save",className:"text-base"}),i.saving?"Saving...":"Save"]})]}):l.jsxs("div",{className:"flex items-center gap-3",children:[l.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:l.jsx("span",{className:"opacity-80 select-none",children:b})}),!i.readOnly&&l.jsxs("button",{onClick:E,disabled:i.loading||i.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:[l.jsx(he,{name:"edit",className:"text-base"}),"Edit"]}),i.onRegenerate&&l.jsxs("button",{onClick:m,disabled:i.loading||i.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:[l.jsx(he,{name:"autorenew",className:"text-base"}),i.saving?"Generating...":"Regenerate"]}),i.showCopyButton&&i.value&&l.jsx(kl,{text:i.value,className:"p-3 rounded-2xl bg-white/5 border border-white/10 text-white hover:bg-white/10 transition-all",iconClassName:"text-base"}),y]})]})},yy=({keys:i,availableProviders:c,onAddProvider:r,dbProviders:u,onAddDbCredential:f,onConfirm:d})=>{const[h,p]=A.useState(!1),[x,g]=A.useState("list"),[C,j]=A.useState(null),[E,v]=A.useState({name:"",baseUrl:"https://api.baserow.io",token:""}),[_,m]=A.useState(!1),[b,S]=A.useState(null),y=c&&c.length>0&&r||u&&u.length>0&&f,k=()=>{p(!1),g("list"),j(null),v({name:"",baseUrl:"https://api.baserow.io",token:""}),S(null)},U=M=>{j(M),g("db-form"),S(null)},O=async()=>{if(!(!C||!E.name||!E.token||!f)){m(!0),S(null);try{await f({name:E.name,provider:C.providerKey,config:{baseUrl:E.baseUrl,token:E.token}})?k():S("Failed to save credential. Check the server console for details.")}catch(M){console.error("[ApiKeysPanel] handleDbSave error:",M),S("An unexpected error occurred.")}finally{m(!1)}}};return A.useEffect(()=>{if(h){document.body.style.overflow="hidden";const M=document.querySelector("main");M&&(M.style.overflow="hidden")}else{document.body.style.overflow="";const M=document.querySelector("main");M&&(M.style.overflow="")}return()=>{document.body.style.overflow="";const M=document.querySelector("main");M&&(M.style.overflow="")}},[h]),l.jsxs("div",{className:"glass-card p-8 rounded-[40px]",children:[l.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-lg font-bold text-white uppercase tracking-widest",children:"API Keys"}),l.jsx("p",{className:"text-[10px] text-gray-400 uppercase tracking-widest mt-1",children:"Manage external integrations and API access"})]}),y&&l.jsxs("div",{children:[l.jsxs("button",{onClick:()=>p(!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:[l.jsx(he,{name:"add",className:"text-base"}),"Add API Key"]}),h&&ur.createPortal(l.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},onClick:M=>{M.target===M.currentTarget&&k()},children:l.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:[l.jsx("button",{onClick:k,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:l.jsx(he,{name:"close",className:"text-2xl"})}),x==="list"&&l.jsxs(l.Fragment,{children:[l.jsx("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:"Add Key"}),l.jsx("p",{className:"text-sm text-white/50 mb-8",children:"Choose what you'd like to add."}),c&&c.length>0&&r&&l.jsxs("div",{className:"mb-8",children:[l.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] mb-4",children:"AI Providers"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:c.map(M=>l.jsxs("button",{onClick:()=>{M.disabled||(r(M.id),k())},disabled:M.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${M.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:[l.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${M.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:M.iconUrl?l.jsx("img",{src:M.iconUrl,alt:M.name,className:"w-8 h-8 object-contain drop-shadow-md"}):M.iconComponent?l.jsx(M.iconComponent,{className:"w-6 h-6 text-white"}):l.jsx(he,{name:"api",className:"text-xl text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"text-base font-bold text-white mb-1",children:M.name}),l.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:M.disabled?"Coming Soon":"Available"})]})]},M.id))})]}),u&&u.length>0&&f&&l.jsxs("div",{children:[l.jsx("p",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em] mb-4",children:"Database / Output"}),l.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:u.map(M=>l.jsxs("button",{onClick:()=>!M.disabled&&U(M),disabled:M.disabled,className:`flex items-start gap-4 p-5 rounded-3xl border transition-all text-left ${M.disabled?"border-white/5 bg-white/5 opacity-40 cursor-not-allowed grayscale":"border-white/10 hover:border-emerald-400/30 hover:bg-emerald-500/5 cursor-pointer group"}`,children:[l.jsx("div",{className:`w-12 h-12 rounded-2xl flex items-center justify-center shrink-0 overflow-hidden ${M.disabled?"bg-black/20":"bg-white/5 group-hover:scale-110 transition-transform"}`,children:M.iconUrl?l.jsx("img",{src:M.iconUrl,alt:M.name,className:"w-8 h-8 object-contain drop-shadow-md"}):l.jsx(he,{name:"database",className:"text-xl text-white"})}),l.jsxs("div",{className:"flex-1",children:[l.jsx("div",{className:"text-base font-bold text-white mb-1",children:M.name}),l.jsx("div",{className:"text-[10px] text-white/50 uppercase tracking-widest",children:M.disabled?"Coming Soon":"Available"})]})]},M.providerKey))})]})]}),x==="db-form"&&C&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{onClick:()=>g("list"),className:"flex items-center gap-2 text-[10px] font-bold text-gray-500 hover:text-white uppercase tracking-widest mb-6 transition-colors",children:[l.jsx(he,{name:"arrow_back",className:"text-sm"}),"Back"]}),l.jsxs("h3",{className:"text-2xl font-bold text-white tracking-wide mb-2",children:["Add ",C.name]}),l.jsxs("p",{className:"text-sm text-white/50 mb-8",children:["Enter your ",C.name," credentials."]}),l.jsxs("div",{className:"space-y-4",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Name"}),l.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors",placeholder:"e.g. My Baserow",value:E.name,onChange:M=>v(T=>({...T,name:M.target.value})),autoFocus:!0})]}),C.providerKey==="baserow"&&l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"Base URL"}),l.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors",placeholder:"https://api.baserow.io",value:E.baseUrl,onChange:M=>v(T=>({...T,baseUrl:M.target.value}))})]}),l.jsxs("div",{className:"space-y-1",children:[l.jsx("label",{className:"text-[9px] font-bold text-gray-500 uppercase tracking-[0.2em]",children:"API Token"}),l.jsx("input",{className:"w-full bg-black/40 border border-white/10 rounded-2xl px-4 py-3 text-sm text-white placeholder-gray-600 focus:outline-none focus:border-white/30 transition-colors font-mono",placeholder:"Token",type:"password",value:E.token,onChange:M=>v(T=>({...T,token:M.target.value}))})]})]}),b&&l.jsx("p",{className:"mt-4 text-[10px] text-red-400 bg-red-500/10 border border-red-500/20 rounded-xl px-3 py-2",children:b}),l.jsxs("div",{className:"flex gap-3 mt-4",children:[l.jsx("button",{onClick:k,className:"px-6 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-transparent border border-white/10 text-gray-400 hover:text-white hover:border-white/20 transition-all",children:"Cancel"}),l.jsx("button",{onClick:O,disabled:_||!E.name||!E.token,className:"flex-1 py-3 rounded-2xl text-[10px] font-bold uppercase tracking-widest bg-white text-black hover:bg-white/90 transition-all disabled:opacity-40 disabled:cursor-not-allowed",children:_?"Saving…":"Save Credential"})]})]})]})}),document.body)]})]}),l.jsx("div",{className:"flex flex-col",children:i.map(M=>l.jsx(by,{config:M,onConfirm:d},M.id))})]})},vy=({onClearStorage:i})=>l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[l.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:l.jsx(he,{name:"delete",className:"text-xl"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Storage"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Manage stored data"})]})]}),l.jsxs("div",{className:"flex gap-4",children:[l.jsx("button",{type:"button",onClick:()=>i("screenshots"),"aria-label":"Clear all captures",title:"Clear all captures",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 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50",children:"Clear Captures"}),l.jsx("button",{type:"button",onClick:()=>i("cookies"),"aria-label":"Reset all cookies",title:"Reset all 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 focus:outline-none focus-visible:ring-2 focus-visible:ring-yellow-500/50",children:"Reset Cookies"})]})]}),wy=72,Pp=6,Ws=wy+Pp,jy=5,Sy=2,Ny=({index:i,style:c,data:r})=>{const u=r.captures[i];return u?l.jsx("div",{style:{...c,paddingBottom:Pp},children:l.jsxs("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:[l.jsxs("div",{className:"space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:u.type==="recording"?"Recording":"Screenshot"}),l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:u.name})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("a",{href:u.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":`Open ${u.name}`,title:`Open ${u.name}`,children:"Open"}),l.jsx("button",{type:"button",onClick:()=>r.onDelete(u.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-red-500/50","aria-label":`Delete ${u.name}`,title:`Delete ${u.name}`,children:"Delete"})]})]})}):null},_y=({captures:i,loading:c,onRefresh:r,onDelete:u})=>{const f=Math.min(Math.max(Ws,i.length*Ws),Ws*jy),d=A.useMemo(()=>({captures:i,onDelete:u}),[i,u]);return l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Captures"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Recordings and screenshots"})]}),l.jsx("button",{type:"button",onClick:r,disabled:c,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50","aria-label":"Refresh captures list",title:"Refresh captures list",children:"Refresh"})]}),c&&l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading captures..."}),!c&&i.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!c&&i.length>0&&l.jsx(dr,{height:f,width:"100%",itemCount:i.length,itemSize:Ws,overscanCount:Sy,itemData:d,children:Ny})]})},Lc=i=>`${i.name}|${i.domain||""}|${i.path||""}|${i.expires||""}`,wp=i=>{if(!i)return!1;let c=0;for(let r=0;r<i.length;r+=1){const u=i.charCodeAt(r);(u===9||u===10||u===13||u>=32&&u<=126)&&(c+=1)}return c/i.length>=.85},Cy=i=>{if(!i)return null;if(/%[0-9A-Fa-f]{2}/.test(i))try{const c=decodeURIComponent(i);if(c!==i&&wp(c))return{value:c,kind:"URL"}}catch{}if(/^[A-Za-z0-9+/=]+$/.test(i)&&i.length>=12&&i.length%4===0)try{const c=atob(i);if(c&&wp(c))return{value:c,kind:"Base64"}}catch{}return null},ky=({cookies:i,originsCount:c,loading:r,onClear:u,onDelete:f})=>{const[d,h]=A.useState({}),[p,x]=A.useState({}),g=E=>{const v=Lc(E);h(_=>({..._,[v]:!_[v]}))},C=E=>{const v=Lc(E);x(_=>({..._,[v]:!_[v]}))},j=A.useMemo(()=>i.map(E=>{const v=Lc(E),_=E.value||"";return{cookie:E,key:v,value:_,decodedCandidate:Cy(_)}}),[i]);return l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[l.jsxs("div",{className:"flex items-center justify-between",children:[l.jsxs("div",{className:"flex items-center gap-4",children:[l.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:l.jsx(he,{name:"database",className:"text-xl"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Cookies"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Browser storage state"})]})]}),l.jsx("button",{type:"button",onClick:u,title:"Clear all cookies","aria-label":"Clear all cookies",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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Clear Cookies"})]}),r&&l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading data..."}),!r&&i.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No cookies found."}),l.jsx("div",{className:"space-y-3",children:j.map(({cookie:E,key:v,value:_,decodedCandidate:m})=>{const b=!!d[v],S=!!m&&!!p[v],y=S&&m?m.value:_,k=b||y.length<=120?y:`${y.slice(0,120)}...`;return l.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-4 space-y-3",children:[l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsxs("div",{className:"min-w-0",children:[l.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:E.name}),l.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[E.domain||"local"," | ",E.path||"/",E.expires?` | ${new Date(E.expires*1e3).toLocaleString()}`:""]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[m&&l.jsx("button",{type:"button",onClick:()=>C(E),title:S?"Show raw value":`Decode ${m.kind}`,"aria-label":S?"Show raw value":`Decode ${m.kind}`,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:S?"Show Raw":`Decode ${m.kind}`}),l.jsx(kl,{text:y,title:"Copy cookie value",label:"Copy",className:"px-3 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",iconClassName:"text-sm"}),l.jsx("button",{type:"button",onClick:()=>f(E),title:`Delete cookie ${E.name}`,"aria-label":`Delete cookie ${E.name}`,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Delete"})]})]}),l.jsx("button",{type:"button",onClick:()=>g(E),"aria-expanded":b,"aria-label":b?"Collapse cookie value":"Expand cookie value",className:"w-full text-left 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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:b?"Click to collapse":"Click to expand",children:k||"(empty)"})]},v)})}),!r&&c>0&&l.jsxs("div",{className:"pt-2 text-[8px] text-gray-600 uppercase tracking-widest",children:["Origins stored: ",c]})]})},Ey=({tab:i,onTabChange:c})=>l.jsxs("div",{className:"flex items-end justify-between mb-8",children:[l.jsx("div",{className:"space-y-2",children:l.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"Settings"})}),l.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["system","data","proxies"].map(r=>l.jsx("button",{role:"tab","aria-selected":i===r,onClick:()=>c(r),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 ${i===r?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:r},r))})]}),Ay=({proxies:i,defaultProxyId:c,includeDefaultInRotation:r,rotationMode:u,loading:f,onRefresh:d,onAdd:h,onImport:p,onUpdate:x,onDelete:g,onDeleteMultiple:C,onSetDefault:j,onToggleIncludeDefault:E,onRotationModeChange:v})=>{const[_,m]=A.useState(""),[b,S]=A.useState(""),[y,k]=A.useState(""),[U,O]=A.useState(""),[M,T]=A.useState(!1),[Z,V]=A.useState(""),[ue,oe]=A.useState(null),[Y,ae]=A.useState(""),[z,I]=A.useState(""),[X,Q]=A.useState(""),[Ne,$]=A.useState(""),[re,R]=A.useState(!1),[B,W]=A.useState(""),[ee,H]=A.useState(""),[ie,Ee]=A.useState(new Set),[ze,Ae]=A.useState(null),qe=A.useRef(null),Ke=()=>{_.trim()&&(h({server:_.trim(),username:b.trim()||void 0,password:y.trim()||void 0,label:U.trim()||void 0,isRotatingPool:M,estimatedPoolSize:Z?parseInt(Z,10):void 0}),m(""),S(""),k(""),O(""),T(!1),V(""))},pt=K=>{oe(K.id),ae(K.server),I(K.username||""),Q(""),$(K.label||""),R(!!K.isRotatingPool),W(K.estimatedPoolSize?String(K.estimatedPoolSize):"")},ot=()=>{oe(null),ae(""),I(""),Q(""),$(""),R(!1),W("")},N=()=>{!ue||!Y.trim()||(x(ue,{server:Y.trim(),username:z.trim()||void 0,password:X.trim()||void 0,label:Ne.trim()||void 0,isRotatingPool:re,estimatedPoolSize:B?parseInt(B,10):void 0}),ot())},xe=K=>{const we=K.trim();if(!we)return null;if(we.includes("://"))return{server:we};const Ce=we.split(":");if(Ce.length<2)return null;const je=Ce[0]?.trim(),Oe=Ce[1]?.trim();if(!je||!Oe)return null;const Ve=Ce[2]?Ce[2].trim():"",He=Ce.length>3?Ce.slice(3).join(":").trim():"";return{server:`${je}:${Oe}`,username:Ve||void 0,password:He||void 0}},te=async K=>{const we=Array.from(K.target.files||[]);if(we.length)try{const Oe=(await Promise.all(we.map(Ve=>Ve.text()))).join(`
18
+ `).split(/\r?\n/).flatMap(Ve=>Ve.split(/[,;]+/)).map(xe).filter(Boolean);if(Oe.length===0){H("No valid proxies found in file.");return}H(""),p(Oe)}catch{H("Failed to read file.")}finally{qe.current&&(qe.current.value="")}},q=(K,we)=>{Ee(Ce=>{const je=new Set(Ce);if(we?.shiftKey&&ze){const Oe=i.filter(it=>it.id!=="host"),Ve=Oe.findIndex(it=>it.id===ze),He=Oe.findIndex(it=>it.id===K);if(Ve!==-1&&He!==-1){const it=Math.min(Ve,He),be=Math.max(Ve,He);for(let ye=it;ye<=be;ye++)je.add(Oe[ye].id);return je}}return je.has(K)?je.delete(K):je.add(K),je}),Ae(K)},L=()=>{const K=i.filter(we=>we.id!=="host");ie.size>=K.length&&K.length>0?Ee(new Set):Ee(new Set(K.map(we=>we.id)))},J=()=>{ie.size>0&&(C(Array.from(ie)),Ee(new Set))},me=i.filter(K=>K.id!=="host"),ce=me.length>0&&ie.size>=me.length;return l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[l.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:l.jsx(he,{name:"security",className:"text-xl"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Proxies"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Set defaults and rotate per task"})]}),l.jsx("div",{className:"ml-auto",children:l.jsxs("button",{onClick:d,disabled:f,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Refresh proxy list","aria-label":"Refresh proxy list",children:[l.jsx(he,{name:"sync",className:`text-base ${f?"animate-spin":""}`}),"Refresh"]})})]}),l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[l.jsx("input",{type:"text",placeholder:"Proxy server (host:port or scheme://host:port)",value:_,onChange:K=>m(K.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"}),l.jsx("input",{type:"text",placeholder:"Label (optional)",value:U,onChange:K=>O(K.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"}),l.jsx("input",{type:"text",placeholder:"Username (optional)",value:b,onChange:K=>S(K.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"}),l.jsx("input",{type:"password",placeholder:"Password (optional)",value:y,onChange:K=>k(K.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"}),l.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:[l.jsx("input",{type:"checkbox",checked:M,onChange:K=>T(K.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),l.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),M&&l.jsx("input",{type:"number",placeholder:"Estimated size (optional)",value:Z,onChange:K=>V(K.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"})]}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsxs("button",{onClick:Ke,disabled:f||!_.trim(),className:"px-6 py-3 rounded-2xl text-[9px] font-bold uppercase tracking-widest bg-white text-black hover:scale-105 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500 disabled:opacity-50 disabled:cursor-not-allowed flex items-center gap-2",children:[f&&l.jsx("div",{className:"w-3 h-3 border-2 border-black/20 border-t-black rounded-full animate-spin"}),"Add Proxy"]}),l.jsx("button",{onClick:()=>qe.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:"Import"}),l.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 ${c?"text-white hover:bg-white/5":"bg-white/10 text-white"}`,children:"Use Host IP"})]}),(ie.size>0||me.length>0)&&l.jsxs("div",{className:"flex items-center justify-between p-3.5 rounded-2xl bg-white/[0.02] border border-white/5",children:[l.jsxs("label",{className:"flex items-center gap-3 cursor-pointer group",children:[l.jsx("input",{type:"checkbox",checked:ce,onChange:L,disabled:me.length===0,className:"w-4 h-4 rounded border-white/20 bg-transparent disabled:opacity-50"}),l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white transition-colors",children:ie.size>0?`${ie.size} Selected`:"Select All"})]}),ie.size>0&&l.jsxs("button",{onClick:J,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[l.jsx(he,{name:"delete",className:"text-base"}),"Delete Selected"]})]}),l.jsx("input",{ref:qe,type:"file",accept:".txt,text/plain",onChange:te,className:"hidden"}),ee&&l.jsx("div",{className:"text-[9px] text-red-400 uppercase tracking-widest",children:ee}),l.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:[l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Rotation mode"}),l.jsxs("select",{value:u,onChange:K=>v(K.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:[l.jsx("option",{value:"round-robin",children:"Round robin"}),l.jsx("option",{value:"random",children:"Random"})]})]}),l.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:[l.jsx("input",{type:"checkbox",checked:r,onChange:K=>E(K.target.checked),className:"w-4 h-4 rounded border-white/20 bg-transparent"}),l.jsx("span",{className:"text-[10px] font-bold text-gray-500 uppercase tracking-widest group-hover:text-white",children:"Include default IP in rotation pool"})]}),l.jsxs("div",{className:"space-y-3",children:[f&&l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading proxies..."}),!f&&i.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No proxies saved yet."}),!f&&i.map(K=>{const we=K.id===c,Ce=K.id===ue;return l.jsx("div",{className:"flex items-center justify-between gap-4 p-4 rounded-2xl border border-white/10 bg-white/[0.02]",children:Ce?l.jsxs("div",{className:"w-full space-y-3",children:[l.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[l.jsx("input",{type:"text",value:Y,onChange:je=>ae(je.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"}),l.jsx("input",{type:"text",value:Ne,onChange:je=>$(je.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"}),l.jsx("input",{type:"text",value:z,onChange:je=>I(je.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"}),l.jsx("input",{type:"password",value:X,onChange:je=>Q(je.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"}),l.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:[l.jsx("input",{type:"checkbox",checked:re,onChange:je=>R(je.target.checked),className:"w-3.5 h-3.5 rounded border-white/20 bg-transparent"}),l.jsx("span",{className:"text-[10px] text-gray-400 uppercase tracking-widest group-hover:text-white transition-colors",children:"Rotating pool"})]}),re&&l.jsx("input",{type:"number",placeholder:"Estimated size",value:B,onChange:je=>W(je.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"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsx("button",{onClick:N,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Save proxy changes","aria-label":"Save proxy changes",children:"Save"}),l.jsx("button",{onClick:ot,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Cancel editing","aria-label":"Cancel editing",children:"Cancel"})]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"flex items-center gap-4 border-r border-white/10 pr-4 w-12 justify-center",children:K.id!=="host"?l.jsx("input",{type:"checkbox",checked:ie.has(K.id),onChange:()=>{},onClick:je=>{je.stopPropagation(),q(K.id,je)},className:"w-4 h-4 rounded border-white/20 bg-transparent"}):l.jsx("div",{title:"Host IP (Cannot be deleted)",className:"flex items-center justify-center opacity-70",children:l.jsx(he,{name:"computer",className:"text-lg text-white"})})}),l.jsxs("div",{className:"flex-1 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest",children:K.label||K.server}),l.jsxs("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest flex items-center gap-2",children:[l.jsx("span",{children:K.server}),K.isRotatingPool&&l.jsxs("span",{className:"px-1.5 py-0.5 rounded bg-white/10 text-white font-bold inline-flex items-center gap-1",children:[l.jsx(he,{name:"autorenew",className:"text-[10px]"}),"Pool",K.estimatedPoolSize?`(~${K.estimatedPoolSize})`:""]})]})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.jsxs("button",{onClick:()=>j(K.id),className:`px-3 py-2 rounded-xl border text-[9px] font-bold uppercase tracking-widest transition-all inline-flex items-center gap-2 focus:outline-none focus-visible:ring-2 ${we?"bg-white text-black border-white focus-visible:ring-blue-500":"border-white/10 text-white hover:bg-white/5 focus-visible:ring-white/50"}`,title:we?"Current default proxy":"Set as default proxy","aria-label":we?"Current default proxy":"Set as default proxy",children:[we?l.jsx(he,{name:"star",className:"text-base"}):l.jsx(he,{name:"star_outline",className:"text-base"}),we?"Default":"Set Default"]}),K.id!=="host"&&l.jsxs(l.Fragment,{children:[l.jsx("button",{onClick:()=>pt(K),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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Edit proxy","aria-label":"Edit proxy",children:"Edit"}),l.jsxs("button",{onClick:()=>g(K.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",title:"Delete proxy","aria-label":"Delete proxy",children:[l.jsx(he,{name:"delete",className:"text-base"}),"Delete"]})]})]})]})},K.id)})]})]})},zy=({selection:i,options:c,loading:r,onChange:u})=>l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-4",children:[l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"User Agent"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Default browser identity"})]}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("label",{htmlFor:"user-agent-select",className:"sr-only",children:"Select Default User Agent"}),l.jsxs("select",{id:"user-agent-select",value:i,onChange:f=>u(f.target.value),disabled:r,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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:[l.jsx("option",{value:"system",children:"System user agent (default)"}),c.map(f=>l.jsx("option",{value:f,children:f},f))]}),l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Applies when rotate UA is disabled in tasks."})]})]}),Ry=({version:i})=>{const[c,r]=A.useState(!1),u=i?`v${i}`:"Unknown",f=async()=>{const d=i||u;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)}r(!0),setTimeout(()=>r(!1),1500)}catch{r(!1)}};return l.jsxs("div",{className:"glass-card p-8 rounded-[40px] space-y-6",children:[l.jsxs("div",{className:"flex items-center gap-4 mb-2",children:[l.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:l.jsx(he,{name:"content_copy",className:"text-xl"})}),l.jsxs("div",{children:[l.jsx("h3",{className:"text-sm font-bold text-white uppercase tracking-widest",children:"Version"}),l.jsx("p",{className:"text-[10px] text-gray-500 uppercase tracking-widest mt-1",children:"Package metadata"})]})]}),l.jsxs("div",{className:"flex items-center justify-between gap-4",children:[l.jsx("div",{className:"text-[9px] font-bold uppercase tracking-[0.3em] text-white",children:u}),l.jsx("button",{onClick:f,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:c?"Copied":"Copy version"})]})]})},Oy="0.12.0",Dy={version:Oy},Ic=Dy.version,Ty=({onClearStorage:i,onConfirm:c,onNotify:r})=>{const[u,f]=A.useState("system"),[d,h]=A.useState([]),[p,x]=A.useState(!1),[g,C]=A.useState([]),[j,E]=A.useState([]),[v,_]=A.useState([]),[m,b]=A.useState([]),[S,y]=A.useState(!1),[k,U]=A.useState(null),[O,M]=A.useState(!0),[T,Z]=A.useState(!1),[V,ue]=A.useState([]),[oe,Y]=A.useState(!0),[ae,z]=A.useState(!1),[I,X]=A.useState([]),[Q,Ne]=A.useState(!0),[$,re]=A.useState(!1),[R,B]=A.useState([]),[W,ee]=A.useState(!0),[H,ie]=A.useState(!1),[Ee,ze]=A.useState([]),[Ae,qe]=A.useState(!0),[Ke,pt]=A.useState(!1),[ot,N]=A.useState([]),[xe,te]=A.useState(null),[q,L]=A.useState(!1),[J,me]=A.useState("round-robin"),[ce,K]=A.useState(!1),[we,Ce]=A.useState("system"),[je,Oe]=A.useState([]),[Ve,He]=A.useState(!1),it=A.useCallback(async()=>{y(!0);try{const[de,pe]=await Promise.all([fetch("/api/data/captures"),fetch("/api/data/cookies")]),_e=de.ok?await de.json():{captures:[]},ke=pe.ok?await pe.json():{cookies:[],origins:[]};E(Array.isArray(_e.captures)?_e.captures:[]),_(Array.isArray(ke.cookies)?ke.cookies:[]),b(Array.isArray(ke.origins)?ke.origins:[])}catch{E([]),_([]),b([])}finally{y(!1)}},[]),be=A.useCallback(async()=>{x(!0);try{const de=await fetch("/api/credentials");de.ok&&h(await de.json())}catch{h([])}finally{x(!1)}},[]),ye=A.useCallback(async de=>{await fetch(`/api/credentials/${de}`,{method:"DELETE"}),h(pe=>pe.filter(_e=>_e.id!==de))},[]),Re=A.useCallback(async de=>{if(!await c(`Delete capture ${de}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(de)}`,{method:"DELETE"})).ok?(r("Capture deleted.","success"),it()):r("Delete failed.","error")},[c,r,it]),Me=A.useCallback(async de=>{if(!await c(`Delete cookie ${de.name}?`))return;(await fetch("/api/data/cookies/delete",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:de.name,domain:de.domain,path:de.path})})).ok?(r("Cookie deleted.","success"),it()):r("Delete failed.","error")},[c,r,it]),Be=async()=>{M(!0);try{const de=await fetch("/api/settings/api-key",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),U(null);return}const pe=await de.json();U(pe.apiKey||null)}catch{U(null)}finally{M(!1)}},Ie=async()=>{Y(!0);try{const de=await fetch("/api/settings/gemini-api-key",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),ue([]);return}const pe=await de.json();ue(Array.isArray(pe.geminiApiKeys)?pe.geminiApiKeys:[])}catch{ue([])}finally{Y(!1)}},Te=async()=>{Ne(!0);try{const de=await fetch("/api/settings/openai-api-key",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),X([]);return}const pe=await de.json();X(Array.isArray(pe.openAiApiKeys)?pe.openAiApiKeys:[])}catch{X([])}finally{Ne(!1)}},$e=async()=>{ee(!0);try{const de=await fetch("/api/settings/claude-api-key",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),B([]);return}const pe=await de.json();B(Array.isArray(pe.claudeApiKeys)?pe.claudeApiKeys:[])}catch{B([])}finally{ee(!1)}},rt=async()=>{K(!0);try{const de=await fetch("/api/settings/proxies",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),N([]),te(null),me("round-robin");return}const pe=await de.json();N(Array.isArray(pe.proxies)?pe.proxies:[]),te(pe.defaultProxyId||null),L(!!pe.includeDefaultInRotation),me(pe.rotationMode==="random"?"random":"round-robin")}catch{N([]),te(null),L(!1),me("round-robin")}finally{K(!1)}},ha=async de=>{K(!0);try{const pe=await fetch("/api/settings/proxies",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(de)});if(!pe.ok){let ke="";try{const Qe=await pe.json();ke=Qe?.error||Qe?.message||""}catch{ke=""}r(`Failed to add proxy${ke?`: ${ke}`:""}.`,"error");return}const _e=await pe.json();N(Array.isArray(_e.proxies)?_e.proxies:[]),te(_e.defaultProxyId||null),L(!!_e.includeDefaultInRotation),me(_e.rotationMode==="random"?"random":"round-robin"),r("Proxy added.","success")}catch{r("Failed to add proxy.","error")}finally{K(!1)}},ga=async()=>{He(!0);try{const de=await fetch("/api/settings/user-agent",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),Ce("system"),Oe([]);return}const pe=await de.json();Ce(pe.selection==="system"?"system":String(pe.selection||"system")),Oe(Array.isArray(pe.userAgents)?pe.userAgents:[])}catch{Ce("system"),Oe([])}finally{He(!1)}},_a=async de=>{He(!0);try{const pe=await fetch("/api/settings/user-agent",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({selection:de})});if(!pe.ok){r("Failed to update user agent.","error");return}const _e=await pe.json();Ce(_e.selection==="system"?"system":String(_e.selection||"system")),Oe(Array.isArray(_e.userAgents)?_e.userAgents:[]),r("User agent updated.","success")}catch{r("Failed to update user agent.","error")}finally{He(!1)}},ta=async de=>{if(!de.length){r("No valid proxies found in file.","error");return}K(!0);try{const pe=await fetch("/api/settings/proxies/import",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({proxies:de})});if(!pe.ok){let ke="";try{const Qe=await pe.json();ke=Qe?.error||Qe?.message||""}catch{ke=""}r(`Failed to import proxies${ke?`: ${ke}`:""}.`,"error");return}const _e=await pe.json();N(Array.isArray(_e.proxies)?_e.proxies:[]),te(_e.defaultProxyId||null),L(!!_e.includeDefaultInRotation),me(_e.rotationMode==="random"?"random":"round-robin"),r("Proxies imported.","success")}catch{r("Failed to import proxies.","error")}finally{K(!1)}},qt=async(de,pe)=>{K(!0);try{const _e=await fetch(`/api/settings/proxies/${encodeURIComponent(de)}`,{method:"PUT",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(pe)});if(!_e.ok){let Qe="";try{const at=await _e.json();Qe=at?.error||at?.message||""}catch{Qe=""}r(`Failed to update proxy${Qe?`: ${Qe}`:""}.`,"error");return}const ke=await _e.json();N(Array.isArray(ke.proxies)?ke.proxies:[]),te(ke.defaultProxyId||null),L(!!ke.includeDefaultInRotation),me(ke.rotationMode==="random"?"random":"round-robin"),r("Proxy updated.","success")}catch{r("Failed to update proxy.","error")}finally{K(!1)}},Kn=async de=>{if(!(de==="host"||!await c("Delete this proxy?"))){K(!0);try{const _e=await fetch(`/api/settings/proxies/${encodeURIComponent(de)}`,{method:"DELETE",credentials:"include"});if(!_e.ok){r("Delete failed.","error");return}const ke=await _e.json();N(Array.isArray(ke.proxies)?ke.proxies:[]),te(ke.defaultProxyId||null),L(!!ke.includeDefaultInRotation),me(ke.rotationMode==="random"?"random":"round-robin"),r("Proxy deleted.","success")}catch{r("Delete failed.","error")}finally{K(!1)}}},bn=async de=>{if(!(de.length===0||!await c(`Delete ${de.length} proxies?`))){K(!0);try{const _e=await fetch("/api/settings/proxies",{method:"DELETE",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ids:de})});if(!_e.ok){r("Bulk delete failed.","error");return}const ke=await _e.json();N(Array.isArray(ke.proxies)?ke.proxies:[]),te(ke.defaultProxyId||null),L(!!ke.includeDefaultInRotation),me(ke.rotationMode==="random"?"random":"round-robin"),r(`${de.length} proxies deleted.`,"success")}catch{r("Bulk delete failed.","error")}finally{K(!1)}}},fr=async de=>{const pe=de==="host"?null:de;K(!0);try{const _e=await fetch("/api/settings/proxies/default",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({id:pe})});if(!_e.ok){r("Failed to set default.","error");return}const ke=await _e.json();N(Array.isArray(ke.proxies)?ke.proxies:[]),te(ke.defaultProxyId||null),L(!!ke.includeDefaultInRotation),me(ke.rotationMode==="random"?"random":"round-robin"),r("Default proxy updated.","success")}catch{r("Failed to set default.","error")}finally{K(!1)}},zi=async de=>{K(!0);try{const pe=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({includeDefaultInRotation:de})});if(!pe.ok){r("Failed to update rotation setting.","error");return}const _e=await pe.json();N(Array.isArray(_e.proxies)?_e.proxies:[]),te(_e.defaultProxyId||null),L(!!_e.includeDefaultInRotation),me(_e.rotationMode==="random"?"random":"round-robin"),r("Rotation setting updated.","success")}catch{r("Failed to update rotation setting.","error")}finally{K(!1)}},zl=async de=>{K(!0);try{const pe=await fetch("/api/settings/proxies/rotation",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({rotationMode:de})});if(!pe.ok){r("Failed to update rotation mode.","error");return}const _e=await pe.json();N(Array.isArray(_e.proxies)?_e.proxies:[]),te(_e.defaultProxyId||null),L(!!_e.includeDefaultInRotation),me(_e.rotationMode==="random"?"random":"round-robin"),r("Rotation mode updated.","success")}catch{r("Failed to update rotation mode.","error")}finally{K(!1)}},yn=async()=>{Z(!0);try{const de=await fetch("/api/settings/api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include"});if(!de.ok){let _e="";try{const ke=await de.json();_e=ke?.error||ke?.message||""}catch{_e=""}de.status===401?r("Session expired. Please log in again.","error"):r(`Failed to generate API key${_e?`: ${_e}`:""}.`,"error");return}const pe=await de.json();U(pe.apiKey||null),r("API key generated.","success")}catch{r("Failed to generate API key.","error")}finally{Z(!1)}},Rl=async de=>{z(!0);try{const pe=await fetch("/api/settings/gemini-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({geminiApiKeys:de})});if(!pe.ok){pe.status===401?r("Session expired. Please log in again.","error"):r("Failed to save Gemini API keys.","error");return}const _e=await pe.json();ue(Array.isArray(_e.geminiApiKeys)?_e.geminiApiKeys:[]),r("Gemini API keys saved.","success")}catch{r("Failed to save Gemini API keys.","error")}finally{z(!1)}},In=async de=>{re(!0);try{const pe=await fetch("/api/settings/openai-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({openAiApiKeys:de})});if(!pe.ok){pe.status===401?r("Session expired. Please log in again.","error"):r("Failed to save OpenAI API keys.","error");return}const _e=await pe.json();X(Array.isArray(_e.openAiApiKeys)?_e.openAiApiKeys:[]),r("OpenAI API keys saved.","success")}catch{r("Failed to save OpenAI API keys.","error")}finally{re(!1)}},Ol=async()=>{qe(!0);try{const de=await fetch("/api/settings/ollama-api-key",{credentials:"include"});if(!de.ok){de.status===401&&r("Session expired. Please log in again.","error"),ze([]);return}const pe=await de.json();ze(Array.isArray(pe.ollamaApiKeys)?pe.ollamaApiKeys:[])}catch{ze([])}finally{qe(!1)}},Gn=async de=>{pt(!0);try{const pe=await fetch("/api/settings/ollama-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({ollamaApiKeys:de})});if(!pe.ok){pe.status===401?r("Session expired. Please log in again.","error"):r("Failed to save Ollama settings.","error");return}const _e=await pe.json();ze(Array.isArray(_e.ollamaApiKeys)?_e.ollamaApiKeys:[]),r("Ollama settings saved.","success")}catch{r("Failed to save Ollama settings.","error")}finally{pt(!1)}},vn=async de=>{ie(!0);try{const pe=await fetch("/api/settings/claude-api-key",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify({claudeApiKeys:de})});if(!pe.ok){pe.status===401?r("Session expired. Please log in again.","error"):r("Failed to save Claude API keys.","error");return}const _e=await pe.json();B(Array.isArray(_e.claudeApiKeys)?_e.claudeApiKeys:[]),r("Claude API keys saved.","success")}catch{r("Failed to save Claude API keys.","error")}finally{ie(!1)}};A.useEffect(()=>{u==="data"&&it(),u==="system"&&(Be(),Ie(),Te(),$e(),Ol(),ga(),be()),u==="proxies"&&rt()},[u]),A.useEffect(()=>{u==="system"&&(Be(),Ie(),Te(),$e(),Ol(),be())},[]);const Dl=[{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:!1}],Ri=[{providerKey:"baserow",name:"Baserow",iconUrl:"https://www.google.com/s2/favicons?domain=baserow.io&sz=128"}],Oi=async de=>{try{const pe=await fetch("/api/credentials",{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(de)});if(!pe.ok){const ke=await pe.json().catch(()=>({}));return console.error("[handleAddDbCredential] API error",pe.status,ke),!1}const _e=await pe.json();return h(ke=>[...ke,_e]),r("Credential saved.","success"),!0}catch(pe){return console.error("[handleAddDbCredential] fetch error:",pe),!1}},At=[{id:"doppelganger_api_key",name:"Tasks API",description:"Manage task API access via `x-api-key` header",icon:"database",value:k,saving:T,loading:O,showCopyButton:!0,readOnly:!0,onSave:async()=>{},onRegenerate:async()=>{await yn()}}];V.filter(de=>de&&de.trim()).forEach((de,pe)=>{At.push({id:`gemini_api_key_${pe}`,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:de,saving:ae,loading:oe,badge:pe===0?"Primary":"Backup",onSave:async _e=>{const ke=[...V];ke[pe]=_e,await Rl(ke)},onDelete:async()=>{const _e=V.filter((ke,Qe)=>Qe!==pe);await Rl(_e)}})}),I.filter(de=>de&&de.trim()).forEach((de,pe)=>{At.push({id:`openai_api_key_${pe}`,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:de,saving:$,loading:Q,badge:pe===0?"Primary":"Backup",onSave:async _e=>{const ke=[...I];ke[pe]=_e,await In(ke)},onDelete:async()=>{const _e=I.filter((ke,Qe)=>Qe!==pe);await In(_e)}})}),R.filter(de=>de&&de.trim()).forEach((de,pe)=>{At.push({id:`anthropic_api_key_${pe}`,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:de,saving:H,loading:W,badge:pe===0?"Primary":"Backup",onSave:async _e=>{const ke=[...R];ke[pe]=_e,await vn(ke)},onDelete:async()=>{const _e=R.filter((ke,Qe)=>Qe!==pe);await vn(_e)}})});const Tl=g.filter(de=>de==="gemini_api_key").length;for(let de=0;de<Tl;de++)At.push({id:`gemini_api_key_unsaved_${de}`,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:ae,loading:oe,startEditing:!0,onSave:async pe=>{const _e=[...V,pe];await Rl(_e),C(ke=>{const Qe=ke.indexOf("gemini_api_key");if(Qe!==-1){const at=[...ke];return at.splice(Qe,1),at}return ke})},onDelete:async()=>{C(pe=>{const _e=pe.indexOf("gemini_api_key");if(_e!==-1){const ke=[...pe];return ke.splice(_e,1),ke}return pe})}});const hr=g.filter(de=>de==="openai_api_key").length;for(let de=0;de<hr;de++)At.push({id:`openai_api_key_unsaved_${de}`,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:$,loading:Q,startEditing:!0,onSave:async pe=>{const _e=[...I,pe];await In(_e),C(ke=>{const Qe=ke.indexOf("openai_api_key");if(Qe!==-1){const at=[...ke];return at.splice(Qe,1),at}return ke})},onDelete:async()=>{C(pe=>{const _e=pe.indexOf("openai_api_key");if(_e!==-1){const ke=[...pe];return ke.splice(_e,1),ke}return pe})}});const pr=g.filter(de=>de==="anthropic_api_key").length;for(let de=0;de<pr;de++)At.push({id:`anthropic_api_key_unsaved_${de}`,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:H,loading:W,startEditing:!0,onSave:async pe=>{const _e=[...R,pe];await vn(_e),C(ke=>{const Qe=ke.indexOf("anthropic_api_key");if(Qe!==-1){const at=[...ke];return at.splice(Qe,1),at}return ke})},onDelete:async()=>{C(pe=>{const _e=pe.indexOf("anthropic_api_key");if(_e!==-1){const ke=[...pe];return ke.splice(_e,1),ke}return pe})}});Ee.filter(de=>de&&de.trim()).forEach((de,pe)=>{At.push({id:`ollama_api_key_${pe}`,name:"Ollama",description:"Local Ollama instance URL and model",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/ollama.svg",value:de,saving:Ke,loading:Ae,badge:pe===0?"Primary":"Backup",urlModel:!0,onSave:async _e=>{const ke=[...Ee];ke[pe]=_e,await Gn(ke)},onDelete:async()=>{const _e=Ee.filter((ke,Qe)=>Qe!==pe);await Gn(_e)}})});const jn=g.filter(de=>de==="ollama_api_key").length;for(let de=0;de<jn;de++)At.push({id:`ollama_api_key_unsaved_${de}`,name:"Ollama",description:"Local Ollama instance URL and model",iconUrl:"https://cdn.jsdelivr.net/gh/selfhst/icons@main/svg/ollama.svg",value:null,saving:Ke,loading:Ae,startEditing:!0,urlModel:!0,onSave:async pe=>{const _e=[...Ee,pe];await Gn(_e),C(ke=>{const Qe=ke.indexOf("ollama_api_key");if(Qe!==-1){const at=[...ke];return at.splice(Qe,1),at}return ke})},onDelete:async()=>{C(pe=>{const _e=pe.indexOf("ollama_api_key");if(_e!==-1){const ke=[...pe];return ke.splice(_e,1),ke}return pe})}});return d.forEach(de=>{At.push({id:`db_cred_${de.id}`,name:de.name,description:`${de.provider} · ${de.config.baseUrl}`,iconUrl:"https://www.google.com/s2/favicons?domain=baserow.io&sz=128",value:de.config.token||null,saving:!1,loading:p,onSave:async()=>{},readOnly:!0,onDelete:async()=>{(c?await c(`Delete credential "${de.name}"?`):confirm(`Delete credential "${de.name}"?`))&&await ye(de.id)}})}),l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsxs("div",{className:"max-w-3xl mx-auto space-y-8",children:[l.jsx(Ey,{tab:u,onTabChange:f}),u==="system"&&l.jsxs(l.Fragment,{children:[l.jsx(yy,{keys:At,availableProviders:Dl,onAddProvider:de=>C(pe=>[...pe,de]),dbProviders:Ri,onAddDbCredential:Oi,onConfirm:c}),l.jsx(zy,{selection:we,options:je,loading:Ve,onChange:_a}),l.jsx(Ry,{version:Ic}),l.jsx(vy,{onClearStorage:i})]}),u==="data"&&l.jsxs(l.Fragment,{children:[l.jsx(_y,{captures:j,loading:S,onRefresh:it,onDelete:Re}),l.jsx(ky,{cookies:v,originsCount:m.length,loading:S,onClear:()=>i("cookies"),onDelete:Me})]}),u==="proxies"&&l.jsx(Ay,{proxies:ot,defaultProxyId:xe,includeDefaultInRotation:q,rotationMode:J,loading:ce,onRefresh:rt,onAdd:ha,onImport:ta,onUpdate:qt,onDelete:Kn,onDeleteMultiple:bn,onSetDefault:fr,onToggleIncludeDefault:zi,onRotationModeChange:zl}),l.jsx("div",{className:"pt-8 flex justify-center border-t border-white/5 mt-8",children:l.jsx(gy,{})})]})})},Gc=({title:i="Loading",subtitle:c})=>l.jsxs("div",{className:"fixed inset-0 z-[80] bg-[#020202] flex items-center justify-center",children:[l.jsx("div",{className:"absolute inset-0 opacity-[0.03] pointer-events-none",style:{backgroundImage:"radial-gradient(#fff 1px, transparent 1px)",backgroundSize:"40px 40px"}}),l.jsxs("div",{className:"glass-card p-10 rounded-[40px] text-center space-y-4",children:[l.jsx("div",{className:"w-12 h-12 mx-auto rounded-full border border-white/10 flex items-center justify-center",children:l.jsx("div",{className:"w-5 h-5 border-2 border-white/20 border-t-white rounded-full animate-spin"})}),l.jsxs("div",{className:"space-y-2",children:[l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:i}),c&&l.jsx("p",{className:"text-xs font-mono text-white/80",children:c})]})]})]}),er=140,My=6,Uy=4,By=({index:i,style:c,data:r})=>{const u=r.items[i];return u?l.jsxs("div",{style:c,onClick:()=>r.navigate(`/executions/${u.id}`),onKeyDown:f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),r.navigate(`/executions/${u.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:[l.jsx("div",{className:"w-10 h-10 rounded-2xl bg-white/5 flex items-center justify-center text-gray-400",children:u.source==="api"?l.jsx(he,{name:"cloud",className:"text-xl"}):l.jsx(he,{name:"monitor",className:"text-xl"})}),l.jsxs("div",{className:"flex-1 min-w-0 space-y-1",children:[l.jsx("div",{className:"text-[10px] font-bold text-white uppercase tracking-widest truncate",children:u.taskName||u.mode}),l.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(u.timestamp).toLocaleString()," | ",u.source," | ",u.mode," | ",u.status," | ",u.durationMs,"ms"]}),u.url&&l.jsx("div",{className:"text-[9px] text-white/50 truncate font-mono",children:u.url})]}),l.jsx("button",{onClick:f=>{f.stopPropagation(),r.deleteExecution(u.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 ${u.id}`,children:"Delete"})]}):null},Ly=({onConfirm:i,onNotify:c})=>{const r=qn(),[u,f]=A.useState([]),[d,h]=A.useState("all"),[p,x]=A.useState(!1),g=A.useCallback(async()=>{x(!0);try{const _=await fetch("/api/executions");if(!_.ok)throw new Error("Failed to load");const m=await _.json();f(Array.isArray(m.executions)?m.executions:[])}catch{f([])}finally{x(!1)}},[]),C=A.useCallback(async()=>{if(!await i("Clear all executions?"))return;(await fetch("/api/executions/clear",{method:"POST"})).ok?(c("Executions cleared.","success"),g()):c("Clear failed.","error")},[g,i,c]),j=A.useCallback(async _=>{if(!await i("Delete this execution?"))return;(await fetch(`/api/executions/${_}`,{method:"DELETE"})).ok?(c("Execution deleted.","success"),f(S=>S.filter(y=>y.id!==_))):c("Delete failed.","error")},[i,c]);A.useEffect(()=>{g()},[g]);const E=A.useMemo(()=>u.filter(_=>d==="all"?!0:_.source===d),[u,d]),v=A.useMemo(()=>({items:E,deleteExecution:j,navigate:r}),[E,j,r]);return l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[l.jsxs("div",{className:"flex items-end justify-between",children:[l.jsx("div",{className:"space-y-2",children:l.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"Run History"})}),l.jsxs("div",{className:"flex items-center gap-3",children:[l.jsx("div",{role:"tablist",className:"flex bg-white/5 rounded-xl p-1 border border-white/5",children:["all","editor","api"].map(_=>l.jsx("button",{role:"tab","aria-selected":d===_,onClick:()=>h(_),className:`px-4 py-2 text-[9px] font-bold uppercase tracking-widest rounded-lg transition-all focus:outline-none focus-visible:ring-2 ${d===_?"bg-white text-black focus-visible:ring-blue-500":"text-gray-500 hover:text-white focus-visible:ring-white/50"}`,children:_},_))}),l.jsx("button",{onClick:g,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:l.jsx(he,{name:"sync",className:`text-xl ${p?"animate-spin":""}`})}),l.jsx("button",{onClick:C,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:l.jsx(he,{name:"delete",className:"text-xl"})})]})]}),p&&l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading executions..."}),!p&&E.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No executions found."}),!p&&E.length>0&&l.jsx(dr,{height:Math.min(Math.max(er,E.length*er),er*My),itemCount:E.length,itemSize:er,width:"100%",overscanCount:Uy,itemData:v,className:"custom-scrollbar",children:By})]})})};function Wp(){const[i,c]=A.useState(null);return A.useEffect(()=>{let r=!1;return(async()=>{try{const f=await fetch("/api/headful/status");if(f.ok){const d=await f.json();r||c(!!d.useNovnc)}else r||c(!1)}catch{r||c(!1)}})(),()=>{r=!0}},[]),i}const Hy=i=>{if(!i.result)return null;const c=i.result||{};return{url:i.url||c.url||"",finalUrl:c.final_url||c.finalUrl,html:c.html,data:c.data??c.html??"",screenshotUrl:c.screenshot_url||c.screenshotUrl,logs:c.logs||[],timestamp:new Date(i.timestamp).toLocaleTimeString()}},Yy=({onConfirm:i,onNotify:c})=>{const{id:r}=Bp(),u=qn(),[f,d]=A.useState(null),[h,p]=A.useState(!1),x=Wp();if(A.useEffect(()=>{(async()=>{if(r){p(!0);try{const j=await fetch(`/api/executions/${r}`);if(!j.ok)throw new Error("Failed to load execution");const E=await j.json();d(E.execution||null)}catch{d(null)}finally{p(!1)}}})()},[r]),h)return l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsx("div",{className:"max-w-6xl mx-auto text-[9px] text-gray-500 uppercase tracking-widest",children:"Loading execution..."})});if(!f)return l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsxs("div",{className:"max-w-6xl mx-auto space-y-6",children:[l.jsx("button",{onClick:()=>u("/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"}),l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"Execution not found."})]})});const g=Hy(f);return l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[l.jsxs("div",{className:"flex items-end justify-between",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:f.taskName||f.mode}),l.jsxs("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:[new Date(f.timestamp).toLocaleString()," | ",f.source," | ",f.mode," | ",f.status," | ",f.durationMs,"ms"]})]}),l.jsx("button",{onClick:()=>u("/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"})]}),l.jsxs("div",{className:"glass-card rounded-[32px] p-8 flex flex-col min-h-[420px]",children:[l.jsx("div",{className:"flex items-center justify-between border-b border-white/5 pb-4 mb-6",children:l.jsx("span",{className:"text-[8px] font-bold text-gray-500 uppercase tracking-widest",children:"Output"})}),g?l.jsx(Fp,{results:g,isExecuting:!1,onConfirm:i,onNotify:c,fullWidth:!0,useNovnc:x}):l.jsx("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest",children:"No output captured."})]})]})})},qy=360,em=12,tr=qy+em,Ky=6,Iy=4,Gy=({index:i,style:c,data:r})=>{const u=r.captures[i];return u?l.jsx("div",{style:{...c,paddingBottom:em},children:l.jsx($p,{capture:u,onDelete:r.onDelete})}):null},Vy=({onConfirm:i,onNotify:c})=>{const r=qn(),[u,f]=A.useState([]),[d,h]=A.useState(!1),p=async()=>{h(!0);try{const C=await fetch("/api/data/captures"),j=C.ok?await C.json():{captures:[]};f(Array.isArray(j.captures)?j.captures:[])}catch{f([])}finally{h(!1)}},x=A.useCallback(async C=>{if(!await i(`Delete capture ${C}?`))return;(await fetch(`/api/data/captures/${encodeURIComponent(C)}`,{method:"DELETE"})).ok?(f(v=>v.filter(_=>_.name!==C)),c("Capture deleted.","success")):c("Delete failed.","error")},[i,c]);A.useEffect(()=>{p()},[]);const g=A.useMemo(()=>({captures:u,onDelete:x}),[u,x]);return l.jsx("main",{className:"flex-1 p-12 overflow-y-auto custom-scrollbar animate-in fade-in duration-500",children:l.jsxs("div",{className:"max-w-6xl mx-auto space-y-8",children:[l.jsxs("div",{className:"flex items-end justify-between",children:[l.jsxs("div",{className:"space-y-2",children:[l.jsx("h2",{className:"text-2xl font-medium tracking-[0.25em] text-white uppercase",children:"All Captures"}),l.jsx("div",{className:"text-[8px] text-gray-500 uppercase tracking-[0.2em]",children:"Recordings and screenshots from every run"})]}),l.jsxs("div",{className:"flex items-center gap-2",children:[l.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:[l.jsx(he,{name:"sync",className:`text-base ${d?"animate-spin":""}`}),"Refresh"]}),l.jsx("button",{onClick:()=>r("/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"})]})]}),l.jsxs("div",{className:"glass-card rounded-[32px] p-8",children:[d&&l.jsxs("div",{className:"text-[9px] text-gray-500 uppercase tracking-widest flex items-center gap-3",children:[l.jsx(he,{name:"sync",className:"text-base animate-spin"}),"Loading captures..."]}),!d&&u.length===0&&l.jsx("div",{className:"text-[9px] text-gray-600 uppercase tracking-widest",children:"No captures found."}),!d&&u.length>0&&l.jsx("div",{className:"space-y-4",children:l.jsx(dr,{height:Math.min(Math.max(tr,u.length*tr),tr*Ky),width:"100%",itemCount:u.length,itemSize:tr,overscanCount:Iy,itemData:g,className:"custom-scrollbar",children:Gy})})]})]})})},tm=({title:i="Not Found",subtitle:c="The page you requested does not exist.",onBack:r})=>l.jsx("div",{className:"h-full flex items-center justify-center px-10",children:l.jsxs("div",{className:"glass-card w-full max-w-2xl rounded-[40px] border border-white/10 p-10 text-center space-y-6",children:[l.jsx("div",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:"404"}),l.jsx("h2",{className:"text-3xl font-bold tracking-tighter text-white",children:i}),l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.25em] text-gray-500",children:c}),r&&l.jsxs("button",{onClick:r,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:[l.jsx(he,{name:"arrow_back",className:"text-base"}),"Back"]})]})}),Xy=({message:i,tone:c,onClose:r})=>{const[u,f]=A.useState(!1);return A.useEffect(()=>{const d=setTimeout(()=>{f(!0)},2500);return()=>clearTimeout(d)},[]),A.useEffect(()=>{if(!u)return;const d=setTimeout(()=>r(),240);return()=>clearTimeout(d)},[u,r]),l.jsx("div",{className:`fixed bottom-6 right-6 z-[220] max-w-sm w-full ${u?"animate-out fade-out slide-out-to-bottom-3 duration-200":"animate-in fade-in slide-in-from-bottom-3 duration-300"}`,children:l.jsxs("div",{role:c==="error"?"alert":"status",className:`glass-card rounded-2xl border border-white/10 p-4 shadow-2xl flex items-start gap-3 ${u?"animate-out fade-out zoom-out-95 duration-200":"animate-in fade-in zoom-in-95 duration-300"}`,children:[l.jsx("div",{className:"mt-0.5",children:c==="error"?l.jsx(he,{name:"error",className:"text-red-400 text-lg"}):l.jsx(he,{name:"check_circle",className:"text-emerald-400 text-lg"})}),l.jsxs("div",{className:"flex-1 min-w-0",children:[l.jsx("p",{className:"text-[8px] font-bold uppercase tracking-[0.35em] text-gray-500",children:c==="error"?"Error":"Success"}),l.jsx("p",{className:"mt-1.5 font-mono text-[11px] text-white leading-relaxed break-words",children:i})]}),l.jsx("button",{onClick:()=>f(!0),className:"p-1.5 rounded-lg text-white/40 hover:text-white hover:bg-white/10 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50 shrink-0","aria-label":"Close notification",title:"Close",children:l.jsx(he,{name:"close",className:"text-base"})})]})})},Zy=({request:i,onResolve:c})=>l.jsx("div",{className:"fixed inset-0 z-[201] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:l.jsxs("div",{className:"glass-card w-full max-w-md rounded-[32px] border border-white/10 p-8 text-center shadow-2xl",children:[l.jsx("p",{className:"text-[10px] font-bold uppercase tracking-[0.4em] text-gray-500",children:i.title??"Confirm"}),l.jsx("p",{className:"mt-4 font-mono text-sm text-white",children:i.message}),l.jsxs("div",{className:"mt-6 flex gap-4",children:[l.jsx("button",{onClick:()=>c(!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 focus:outline-none focus-visible:ring-2 focus-visible:ring-white/50",children:i.cancelLabel??"Cancel"}),l.jsx("button",{onClick:()=>c(!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 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:i.confirmLabel??"Confirm"})]})]})}),$y=({tasks:i,loadTasks:c,touchTask:r,currentTask:u,setCurrentTask:f,onTaskLoaded:d,...h})=>{const{id:p}=Bp(),x=qn(),[g,C]=A.useState(!1),[j,E]=A.useState(!1);return A.useEffect(()=>{(async()=>{if(u?.id===p)return;C(!0),E(!1);let _=i;i.length===0&&(_=await c());const m=_.find(b=>String(b.id)===String(p));if(m){const b={...m};(!b.variables||Array.isArray(b.variables))&&(b.variables={}),b.stealth||(b.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),b.stealth.cursorGlide===void 0&&(b.stealth.cursorGlide=b.stealth.humanCursor??!1),delete b.stealth.humanCursor,b.stealth.randomizeClicks===void 0&&(b.stealth.randomizeClicks=!1),Array.isArray(b.actions)&&(b.actions=b.actions.map((S,y)=>S&&S.id?S:{...S,id:`act_${Date.now()}_${y}_${Math.floor(Math.random()*1e3)}`})),b.includeShadowDom===void 0&&(b.includeShadowDom=!0),f(b),d?.(b),p&&r(p)}else E(!0);C(!1)})()},[p,i]),j?l.jsx(tm,{title:"Task Not Found",subtitle:"This task does not exist or was deleted.",onBack:()=>x("/dashboard")}):g||!u||String(u.id)!==String(p)?l.jsx(Gc,{title:"Loading Mission Data",subtitle:"Syncing task payload"}):l.jsx(Jp,{currentTask:u,setCurrentTask:f,tasks:i,...h})},jp="doppelganger.seenReleaseNotes_0_8";function Qy(){const[i,c]=A.useState(!1),[r,u]=A.useState(""),[f,d]=A.useState(!0);A.useEffect(()=>{Ic.startsWith("0.8.")&&(localStorage.getItem(jp)||(c(!0),h()))},[]);const h=async()=>{try{const x=await fetch("https://api.github.com/repos/figranium/figranium/releases/tags/v0.8.0");if(x.ok){const g=await x.json();u(g.body||"No release notes available.")}else u("Failed to load release notes. Please check our GitHub repository.")}catch{u("Failed to load release notes. Please check our GitHub repository.")}finally{d(!1)}},p=()=>{c(!1),localStorage.setItem(jp,"true")};return i?l.jsx("div",{className:"fixed inset-0 z-[300] flex items-center justify-center bg-black/70 backdrop-blur-sm px-6",children:l.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:[l.jsxs("div",{className:"flex justify-between items-center mb-6 shrink-0",children:[l.jsx("h2",{className:"text-lg md:text-2xl font-bold text-white tracking-tight",children:"What's new in v0.8.0"}),l.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",Ic]})]}),l.jsx("div",{className:"flex-1 overflow-y-auto pr-2 custom-scrollbar text-sm text-gray-300",children:f?l.jsx("div",{className:"flex justify-center items-center h-32",children:l.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):l.jsx("div",{className:"whitespace-pre-wrap font-mono text-xs",children:r})}),l.jsx("div",{className:"mt-8 flex justify-end shrink-0",children:l.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 focus:outline-none focus-visible:ring-2 focus-visible:ring-blue-500",children:"Got it"})})]})}):null}const Fy=(i,c)=>{if(typeof i!="string"||!i)return c;switch(i){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 r=i.toLowerCase().replace(/_/g," ");return r.charAt(0).toUpperCase()+r.slice(1)}}};function Jy(){const i=qn(),[c,r]=A.useState(null),[u,f]=A.useState("checking"),[d,h]=A.useState(""),[p,x]=A.useState(!1),g=A.useCallback(async()=>{try{const v=await(await fetch("/api/auth/me",{credentials:"include"})).json();if(v.authenticated)return r(v.user),f("authenticated"),!0;const m=await(await fetch("/api/auth/check-setup",{credentials:"include"})).json();f(m.setupRequired?"setup":"login")}catch{f("login")}return!1},[]);A.useEffect(()=>{g()},[g]);const C=A.useCallback(async(E,v,_,m)=>{if(!E||!v){h("Email and password are required");return}if(u==="setup"&&(!_||v!==m)){h(_?"Passwords do not match":"Name required");return}if(p)return;const b=u==="setup"?"/api/auth/setup":"/api/auth/login",S=u==="setup"?{name:_,email:E,password:v}:{email:E,password:v};x(!0);try{const y=await fetch(b,{method:"POST",headers:{"Content-Type":"application/json"},credentials:"include",body:JSON.stringify(S)}),k=await y.json().catch(()=>({}));if(y.ok)h(""),f("checking"),await g()?i("/"):(h("Authentication failed"),f("login"));else{const U=u==="setup"?"Setup failed":"Invalid credentials";h(Fy(k?.error,U))}}catch{h("Network error")}finally{x(!1)}},[u,p,i,g]),j=A.useCallback(async E=>{await E("Are you sure you want to log out?")&&(await fetch("/api/auth/logout",{method:"POST",credentials:"include"}),r(null),f("login"),i("/"))},[i]);return{user:c,setUser:r,authStatus:u,setAuthStatus:f,authError:d,authBusy:p,checkAuth:g,handleAuthSubmit:C,logout:j}}function Py(i,c,r){const[u,f]=A.useState([]),[d,h]=A.useState(null),p=A.useRef(null);A.useEffect(()=>{p.current=d},[d]);const x=A.useCallback(async()=>{try{const y=[...await(await fetch("/api/tasks",{credentials:"include"})).json()].sort((k,U)=>(U.last_opened||0)-(k.last_opened||0));return f(y),y}catch(b){return console.error("Failed to load tasks",b),[]}},[]),g=A.useCallback(async b=>{try{await fetch(`/api/tasks/${b}/touch`,{method:"POST"}),x()}catch(S){console.error("Failed to touch task",S)}},[x]),C=A.useCallback((b,S)=>{const y=gb();S(!0),h(y),b(null),i("/tasks/new")},[i]),j=A.useCallback((b,S,y)=>{const k={...b};(!k.variables||Array.isArray(k.variables))&&(k.variables={}),k.stealth||(k.stealth={allowTypos:!1,idleMovements:!1,overscroll:!1,deadClicks:!1,fatigue:!1,naturalTyping:!1,cursorGlide:!1,randomizeClicks:!1}),k.stealth.cursorGlide===void 0&&(k.stealth.cursorGlide=k.stealth.humanCursor??!1),delete k.stealth.humanCursor,k.stealth.randomizeClicks===void 0&&(k.stealth.randomizeClicks=!1),k.rotateProxies===void 0&&(k.rotateProxies=!1),k.rotateViewport===void 0&&(k.rotateViewport=!1),k.extractionFormat||(k.extractionFormat="json"),k.includeHtml===void 0&&(k.includeHtml=!1),k.includeShadowDom===void 0&&(k.includeShadowDom=!0),k.disableRecording===void 0&&(k.disableRecording=!1),k.disableRecording=rr(k.disableRecording),k.statelessExecution===void 0&&(k.statelessExecution=!1),k.statelessExecution=rr(k.statelessExecution);const U=Zp(k);h(U),S(U),y(null),i(`/tasks/${b.id}`),b.id&&g(b.id)},[i,g]),E=A.useCallback(async(b,S)=>{await r("Are you sure you want to delete this task?")&&(await fetch(`/api/tasks/${b}`,{method:"DELETE"}),x(),S.includes(b)&&i("/dashboard"))},[r,x,i]),v=A.useCallback(async(b,S,y,k=!1)=>{const U=y||p.current;if(!U)return;const O={...U,last_opened:Date.now()},Z=await(await fetch(`/api/tasks${k?"?version=true":""}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(O)})).json();h(Z),b(Z),x(),S.includes("new")&&i(`/tasks/${Z.id}`,{replace:!0})},[i,x]),_=A.useCallback(b=>{let S=u;if(b&&b.length>0&&(S=u.filter(T=>T.id&&b.includes(T.id))),S.length===0){c("No tasks selected to export.","error");return}const y={exportedAt:new Date().toISOString(),tasks:S},k=new Blob([JSON.stringify(y,null,2)],{type:"application/json"}),U=URL.createObjectURL(k),O=document.createElement("a"),M=new Date().toISOString().slice(0,10);O.href=U,O.download=`doppelganger-tasks-${M}.json`,document.body.appendChild(O),O.click(),O.remove(),URL.revokeObjectURL(U),c(`Exported ${S.length} task(s).`,"success")},[u,c]),m=A.useCallback(async b=>{try{const S=await b.text(),y=JSON.parse(S);let k=[];if(Array.isArray(y)?k=y:y&&typeof y=="object"&&(Array.isArray(y.tasks)?k=y.tasks:(y.name||y.actions)&&(k=[y])),k.length===0){c("Invalid import file.","error");return}const U=Date.now(),O=k.map((M,T)=>xb(M,T)).filter(M=>!!M).map((M,T)=>M.id?M:{...M,id:`task_${U}_${T}`});if(O.length===0){c("No tasks to import.","error");return}await Promise.all(O.map(M=>fetch("/api/tasks",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(M)}))),await x(),c(`Imported ${O.length} task(s).`,"success")}catch(S){c(`Import failed: ${S.message||"Unknown error"}`,"error")}},[c,x]);return A.useEffect(()=>{x()},[x]),{tasks:u,setTasks:f,currentTask:d,setCurrentTask:h,loadTasks:x,touchTask:g,createNewTask:C,editTask:j,deleteTask:E,saveTask:v,exportTasks:_,importTasks:m}}const Sp=(i,c)=>{const r=String(i||"").trim();if(!r)return"Execution failed.";const u=r.toLowerCase();if(c==="headful"){if(u.includes("missing x server")||u.includes("$display"))return"Headful browser could not start because no display server is available.";if(u.includes("failed to connect to the bus"))return"Headful browser could not start due to missing system services."}let f=r;const d=f.indexOf("--disable-");return d>0&&(f=f.slice(0,d).trim()),f.length>240&&(f=`${f.slice(0,240)}...`),f||"Execution failed."},Wy=i=>{const c=String(i||"").toLowerCase();return c.includes("missing x server")||c.includes("$display")||c.includes("platform failed to initialize")||c.includes("no display server")};function ev(i){const[c,r]=A.useState(!1),[u,f]=A.useState(!1),[d,h]=A.useState(null),[p,x]=A.useState(null),g=Wp(),C=A.useRef(null),j=async()=>{try{await fetch("/headful/stop",{method:"POST"})}catch(m){console.error("Failed to stop headful session",m)}finally{f(!1)}};return{isExecuting:c,isHeadfulOpen:u,results:d,setResults:h,activeRunId:p,useNovnc:g,runTaskWithSnapshot:async(m,b,S)=>{if(!m||!m.url)return;const y=Zp(m);b&&y!==b&&S(y);const k=`run_${Date.now()}_${Math.floor(Math.random()*1e3)}`;if(x(k),c)return;r(!0),h({url:y.url,logs:[],timestamp:"Running..."});let U=null;try{const O={};Object.entries(y.variables).forEach(([ae,z])=>{O[ae]=z.value});const M=ae=>ae.replace(/\\{\$(\w+)\\}/g,(z,I)=>{if(I==="now")return new Date().toISOString();const X=O[I];return X==null||X===""?"":String(X)}),T=ae=>typeof ae!="string"?ae:M(ae),Z=y.mode!=="agent";U={...{...y,url:Z?M(y.url||""):y.url||"",selector:Z?T(y.selector):y.selector,actions:Z?y.actions.map(ae=>({...ae,selector:T(ae.selector),value:T(ae.value),key:T(ae.key)})):y.actions},taskVariables:O,variables:O,runSource:"editor",taskId:y.id,taskName:y.name,taskSnapshot:y,runId:k};const ue=async ae=>{const z=new AbortController;C.current=z;const I=await fetch(`/${ae}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:z.signal});if(!I.ok){let X=null;try{X=await I.json()}catch{X=null}const Q=new Error(X?.details||X?.error||"Request failed");throw Q.code=X?.error,Q}return I.json()},oe=y.mode==="headful"?"scrape":y.mode,Y=await ue(oe);h({url:y.url,finalUrl:Y.final_url,html:Y.html,data:Y.data??Y.html??null,screenshotUrl:Y.screenshot_url,downloads:Y.downloads,logs:Y.logs||[],timestamp:new Date().toLocaleTimeString()})}catch(O){if(O?.name==="AbortError"){i("Execution stopped.","success"),r(!1);return}if(y?.mode==="headful"&&U&&(O?.code==="HEADFUL_DISPLAY_UNAVAILABLE"||Wy(O?.message||String(O))))try{const T=await(async()=>{const Z=new AbortController;C.current=Z;const V=await fetch("/scrape",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(U),signal:Z.signal});if(!V.ok){const ue=await V.json();throw new Error(ue.details||ue.error||"Request failed")}return V.json()})();T.logs=["Headful display unavailable; ran headless instead.",...T.logs||[]],h({url:y.url,finalUrl:T.final_url,html:T.html,data:T.data??T.html??null,screenshotUrl:T.screenshot_url,downloads:T.downloads,logs:T.logs||[],timestamp:new Date().toLocaleTimeString()}),r(!1);return}catch(T){const Z=Sp(T?.message||String(T),y?.mode);i(`Execution crash: ${Z}`,"error"),r(!1);return}const M=Sp(O?.message||String(O),y?.mode);i(`Execution crash: ${M}`,"error"),y?.mode==="headful"&&r(!1)}finally{C.current=null,r(!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)}C.current&&C.current.abort(),r(!1)},openHeadful:async(m,b,S,y)=>{if(u){await j();return}f(!0);try{const k=await fetch("/headful",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:m,targetActionId:b,taskSnapshot:S,variables:y})});if(!k.ok){const U=await k.json().catch(()=>({})),O=U?.details||U?.error||"Failed to start headful session";i(O,"error"),f(!1)}}catch{i("Failed to start headful session","error"),f(!1)}},stopHeadful:j}}function tv(){const[i,c]=A.useState(null),[r,u]=A.useState(null),f=A.useRef(null),d=A.useCallback((x,g="success")=>{c({message:x,tone:g}),g==="success"&&setTimeout(()=>{c(C=>C&&C.message===x?null:C)},2e3)},[]),h=A.useCallback(x=>new Promise(g=>{f.current=g,u(typeof x=="string"?{message:x}:x)}),[]),p=A.useCallback(x=>{const g=f.current;f.current=null,u(null),g&&g(x)},[]);return{centerAlert:i,setCenterAlert:c,centerConfirm:r,showAlert:d,requestConfirm:h,closeConfirm:p}}function av(){const i=qn(),c=gn(),{centerAlert:r,setCenterAlert:u,centerConfirm:f,showAlert:d,requestConfirm:h,closeConfirm:p}=tv(),{authStatus:x,authError:g,authBusy:C,handleAuthSubmit:j,logout:E}=Jy(),{tasks:v,currentTask:_,setCurrentTask:m,loadTasks:b,touchTask:S,createNewTask:y,editTask:k,deleteTask:U,saveTask:O,exportTasks:M,importTasks:T}=Py(i,d,h),{isExecuting:Z,isHeadfulOpen:V,results:ue,setResults:oe,activeRunId:Y,useNovnc:ae,runTaskWithSnapshot:z,stopTask:I,openHeadful:X,stopHeadful:Q}=ev(d);A.useEffect(()=>{x==="authenticated"&&b()},[x]);const[Ne,$]=A.useState(!1),re=A.useRef(""),[R,B]=A.useState("visual"),[W,ee]=A.useState({}),H="doppelganger.pinnedResults",Ee=(ce=>ce?.id?String(ce.id):"new")(_),ze=_&&W[Ee]||null;A.useEffect(()=>{try{const ce=localStorage.getItem(H);if(ce){const K=JSON.parse(ce);K&&typeof K=="object"&&ee(K)}}catch{}},[]),A.useEffect(()=>{try{localStorage.setItem(H,JSON.stringify(W))}catch{}},[W]),A.useEffect(()=>{!c.pathname.startsWith("/tasks")&&R==="history"&&B("visual")},[c.pathname,R]),A.useEffect(()=>{c.pathname==="/tasks/new"&&!_&&y(oe,$)},[c.pathname]),A.useEffect(()=>{if(!_){$(!1);return}const ce=_i(_);$(ce!==re.current)},[_]),A.useEffect(()=>{if(typeof window>"u")return;const ce=K=>{Ne&&(K.preventDefault(),K.returnValue="")};return window.addEventListener("beforeunload",ce),()=>window.removeEventListener("beforeunload",ce)},[Ne]);const Ae=A.useCallback(ce=>{re.current=_i(ce),$(!1)},[]),qe=ce=>{_&&ee(K=>({...K,[Ee]:ce}))},Ke=()=>{_&&ee(ce=>{const K={...ce};return delete K[Ee],K})},pt=async ce=>{if(!await h(`Delete all ${ce}?`))return;await fetch(ce==="screenshots"?"/api/clear-screenshots":"/api/clear-cookies",{method:"POST"}),d(`${pb(ce)} cleared.`,"success")},ot=()=>c.pathname.startsWith("/tasks")?"editor":c.pathname==="/settings"?"settings":c.pathname==="/executions"?"executions":c.pathname==="/captures"?"captures":"dashboard",N=A.useCallback(ce=>{ce==="dashboard"?i("/dashboard"):ce==="settings"?i("/settings"):ce==="executions"?i("/executions"):ce==="captures"&&i("/captures")},[i]),xe=A.useCallback(()=>{y(oe,$)},[y,oe,$]),te=A.useCallback(ce=>{k(ce,Ae,oe)},[k,Ae,oe]),q=A.useCallback(ce=>{U(ce,c.pathname)},[U,c.pathname]),L=A.useCallback((ce,K)=>O(Ae,c.pathname,ce,K),[O,Ae,c.pathname]),J=A.useCallback(()=>{E(h)},[E,h]);let me;return x==="login"||x==="setup"?me=l.jsx(Wg,{status:x,onSubmit:j,error:g,busy:C}):x==="checking"?me=l.jsx(Gc,{title:"Authenticating",subtitle:"Verifying session state"}):me=l.jsxs("div",{className:"h-full flex flex-row overflow-hidden bg-[#020202]",children:[l.jsx(Qy,{}),l.jsx(Pg,{onNavigate:N,onNewTask:xe,onLogout:J,currentScreen:ot()}),l.jsxs(gg,{children:[l.jsx(ja,{path:"/",element:l.jsx(lp,{tasks:v,onNewTask:xe,onEditTask:te,onDeleteTask:q,onExportTasks:M,onImportTasks:T})}),l.jsx(ja,{path:"/dashboard",element:l.jsx(lp,{tasks:v,onNewTask:xe,onEditTask:te,onDeleteTask:q,onExportTasks:M,onImportTasks:T})}),l.jsx(ja,{path:"/tasks/new",element:_?l.jsx(Jp,{currentTask:_,setCurrentTask:m,tasks:v,editorView:R,setEditorView:B,isExecuting:Z,onSave:L,onRun:()=>z(_,_,m),onRunSnapshot:ce=>z(ce||_,_,m),results:ue,pinnedResults:ze,onConfirm:h,onNotify:d,onPinResults:qe,onUnpinResults:Ke,runId:Y,onStop:()=>I(),isHeadfulOpen:V,onOpenHeadful:(ce,K,we,Ce)=>X(ce,K,we,Ce),onStopHeadful:Q,useNovnc:ae}):l.jsx(Gc,{title:"Initializing",subtitle:"Preparing task workspace"})}),l.jsx(ja,{path:"/tasks/:id",element:l.jsx($y,{tasks:v,loadTasks:b,touchTask:S,currentTask:_,setCurrentTask:m,editorView:R,setEditorView:B,isExecuting:Z,onSave:L,onRun:()=>z(_,_,m),onRunSnapshot:ce=>z(ce||_,_,m),results:ue,pinnedResults:ze,onConfirm:h,onNotify:d,onPinResults:qe,onUnpinResults:Ke,runId:Y,onStop:()=>I(),onTaskLoaded:Ae,isHeadfulOpen:V,onOpenHeadful:(ce,K,we,Ce)=>X(ce,K,we,Ce),onStopHeadful:Q,useNovnc:ae})}),l.jsx(ja,{path:"/settings",element:l.jsx(Ty,{onClearStorage:pt,onConfirm:h,onNotify:d})}),l.jsx(ja,{path:"/executions",element:l.jsx(Ly,{onConfirm:h,onNotify:d})}),l.jsx(ja,{path:"/executions/:id",element:l.jsx(Yy,{onConfirm:h,onNotify:d})}),l.jsx(ja,{path:"/captures",element:l.jsx(Vy,{onConfirm:h,onNotify:d})}),l.jsx(ja,{path:"*",element:l.jsx(tm,{onBack:()=>i("/dashboard")})})]})]}),l.jsxs("div",{className:"h-full",children:[r&&l.jsx(Xy,{message:r.message,tone:r.tone,onClose:()=>u(null)}),f&&l.jsx(Zy,{request:f,onResolve:p}),me]})}v0.createRoot(document.getElementById("root")).render(l.jsx(tt.StrictMode,{children:l.jsx(qg,{children:l.jsx(av,{})})}));