profile-manager-secure 1.0.1 → 1.0.2

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.
@@ -6,7 +6,7 @@
6
6
  *
7
7
  * This source code is licensed under the MIT license found in the
8
8
  * LICENSE file in the root directory of this source tree.
9
- */var _r=Symbol.for("react.element"),kd=Symbol.for("react.portal"),jd=Symbol.for("react.fragment"),wd=Symbol.for("react.strict_mode"),Sd=Symbol.for("react.profiler"),Cd=Symbol.for("react.provider"),bd=Symbol.for("react.context"),zd=Symbol.for("react.forward_ref"),Td=Symbol.for("react.suspense"),Pd=Symbol.for("react.memo"),Ed=Symbol.for("react.lazy"),Io=Symbol.iterator;function Nd(e){return e===null||typeof e!="object"?null:(e=Io&&e[Io]||e["@@iterator"],typeof e=="function"?e:null)}var Ha={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$a=Object.assign,Ka={};function Un(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ha}Un.prototype.isReactComponent={};Un.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qa(){}Qa.prototype=Un.prototype;function Is(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ha}var _s=Is.prototype=new Qa;_s.constructor=Is;$a(_s,Un.prototype);_s.isPureReactComponent=!0;var _o=Array.isArray,Ga=Object.prototype.hasOwnProperty,Ms={current:null},Xa={key:!0,ref:!0,__self:!0,__source:!0};function Ya(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ga.call(t,r)&&!Xa.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:_r,type:e,key:s,ref:o,props:i,_owner:Ms.current}}function Id(e,t){return{$$typeof:_r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ls(e){return typeof e=="object"&&e!==null&&e.$$typeof===_r}function _d(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Mo=/\/+/g;function ui(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_d(""+e.key):t.toString(36)}function ol(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case _r:case kd:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+ui(o,0):r,_o(i)?(n="",e!=null&&(n=e.replace(Mo,"$&/")+"/"),ol(i,t,n,"",function(d){return d})):i!=null&&(Ls(i)&&(i=Id(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Mo,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",_o(e))for(var a=0;a<e.length;a++){s=e[a];var c=r+ui(s,a);o+=ol(s,t,n,c,i)}else if(c=Nd(e),typeof c=="function")for(e=c.call(e),a=0;!(s=e.next()).done;)s=s.value,c=r+ui(s,a++),o+=ol(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Hr(e,t,n){if(e==null)return e;var r=[],i=0;return ol(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Md(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Me={current:null},al={transition:null},Ld={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:al,ReactCurrentOwner:Ms};function Ja(){throw Error("act(...) is not supported in production builds of React.")}q.Children={map:Hr,forEach:function(e,t,n){Hr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Hr(e,function(){t++}),t},toArray:function(e){return Hr(e,function(t){return t})||[]},only:function(e){if(!Ls(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};q.Component=Un;q.Fragment=jd;q.Profiler=Sd;q.PureComponent=Is;q.StrictMode=wd;q.Suspense=Td;q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Ld;q.act=Ja;q.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=$a({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ms.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Ga.call(t,c)&&!Xa.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var d=0;d<c;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:_r,type:e.type,key:i,ref:s,props:r,_owner:o}};q.createContext=function(e){return e={$$typeof:bd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Cd,_context:e},e.Consumer=e};q.createElement=Ya;q.createFactory=function(e){var t=Ya.bind(null,e);return t.type=e,t};q.createRef=function(){return{current:null}};q.forwardRef=function(e){return{$$typeof:zd,render:e}};q.isValidElement=Ls;q.lazy=function(e){return{$$typeof:Ed,_payload:{_status:-1,_result:e},_init:Md}};q.memo=function(e,t){return{$$typeof:Pd,type:e,compare:t===void 0?null:t}};q.startTransition=function(e){var t=al.transition;al.transition={};try{e()}finally{al.transition=t}};q.unstable_act=Ja;q.useCallback=function(e,t){return Me.current.useCallback(e,t)};q.useContext=function(e){return Me.current.useContext(e)};q.useDebugValue=function(){};q.useDeferredValue=function(e){return Me.current.useDeferredValue(e)};q.useEffect=function(e,t){return Me.current.useEffect(e,t)};q.useId=function(){return Me.current.useId()};q.useImperativeHandle=function(e,t,n){return Me.current.useImperativeHandle(e,t,n)};q.useInsertionEffect=function(e,t){return Me.current.useInsertionEffect(e,t)};q.useLayoutEffect=function(e,t){return Me.current.useLayoutEffect(e,t)};q.useMemo=function(e,t){return Me.current.useMemo(e,t)};q.useReducer=function(e,t,n){return Me.current.useReducer(e,t,n)};q.useRef=function(e){return Me.current.useRef(e)};q.useState=function(e){return Me.current.useState(e)};q.useSyncExternalStore=function(e,t,n){return Me.current.useSyncExternalStore(e,t,n)};q.useTransition=function(){return Me.current.useTransition()};q.version="18.3.1";Va.exports=q;var C=Va.exports;const Ut=vd(C);/**
9
+ */var _r=Symbol.for("react.element"),kd=Symbol.for("react.portal"),jd=Symbol.for("react.fragment"),wd=Symbol.for("react.strict_mode"),Sd=Symbol.for("react.profiler"),Cd=Symbol.for("react.provider"),bd=Symbol.for("react.context"),zd=Symbol.for("react.forward_ref"),Td=Symbol.for("react.suspense"),Pd=Symbol.for("react.memo"),Ed=Symbol.for("react.lazy"),Io=Symbol.iterator;function Nd(e){return e===null||typeof e!="object"?null:(e=Io&&e[Io]||e["@@iterator"],typeof e=="function"?e:null)}var Ha={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},$a=Object.assign,Ka={};function Un(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ha}Un.prototype.isReactComponent={};Un.prototype.setState=function(e,t){if(typeof e!="object"&&typeof e!="function"&&e!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,e,t,"setState")};Un.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};function Qa(){}Qa.prototype=Un.prototype;function Is(e,t,n){this.props=e,this.context=t,this.refs=Ka,this.updater=n||Ha}var _s=Is.prototype=new Qa;_s.constructor=Is;$a(_s,Un.prototype);_s.isPureReactComponent=!0;var _o=Array.isArray,Ga=Object.prototype.hasOwnProperty,Ls={current:null},Xa={key:!0,ref:!0,__self:!0,__source:!0};function Ya(e,t,n){var r,i={},s=null,o=null;if(t!=null)for(r in t.ref!==void 0&&(o=t.ref),t.key!==void 0&&(s=""+t.key),t)Ga.call(t,r)&&!Xa.hasOwnProperty(r)&&(i[r]=t[r]);var a=arguments.length-2;if(a===1)i.children=n;else if(1<a){for(var c=Array(a),d=0;d<a;d++)c[d]=arguments[d+2];i.children=c}if(e&&e.defaultProps)for(r in a=e.defaultProps,a)i[r]===void 0&&(i[r]=a[r]);return{$$typeof:_r,type:e,key:s,ref:o,props:i,_owner:Ls.current}}function Id(e,t){return{$$typeof:_r,type:e.type,key:t,ref:e.ref,props:e.props,_owner:e._owner}}function Ms(e){return typeof e=="object"&&e!==null&&e.$$typeof===_r}function _d(e){var t={"=":"=0",":":"=2"};return"$"+e.replace(/[=:]/g,function(n){return t[n]})}var Lo=/\/+/g;function ui(e,t){return typeof e=="object"&&e!==null&&e.key!=null?_d(""+e.key):t.toString(36)}function ol(e,t,n,r,i){var s=typeof e;(s==="undefined"||s==="boolean")&&(e=null);var o=!1;if(e===null)o=!0;else switch(s){case"string":case"number":o=!0;break;case"object":switch(e.$$typeof){case _r:case kd:o=!0}}if(o)return o=e,i=i(o),e=r===""?"."+ui(o,0):r,_o(i)?(n="",e!=null&&(n=e.replace(Lo,"$&/")+"/"),ol(i,t,n,"",function(d){return d})):i!=null&&(Ms(i)&&(i=Id(i,n+(!i.key||o&&o.key===i.key?"":(""+i.key).replace(Lo,"$&/")+"/")+e)),t.push(i)),1;if(o=0,r=r===""?".":r+":",_o(e))for(var a=0;a<e.length;a++){s=e[a];var c=r+ui(s,a);o+=ol(s,t,n,c,i)}else if(c=Nd(e),typeof c=="function")for(e=c.call(e),a=0;!(s=e.next()).done;)s=s.value,c=r+ui(s,a++),o+=ol(s,t,n,c,i);else if(s==="object")throw t=String(e),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead.");return o}function Hr(e,t,n){if(e==null)return e;var r=[],i=0;return ol(e,r,"","",function(s){return t.call(n,s,i++)}),r}function Ld(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(n){(e._status===0||e._status===-1)&&(e._status=1,e._result=n)},function(n){(e._status===0||e._status===-1)&&(e._status=2,e._result=n)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var Le={current:null},al={transition:null},Md={ReactCurrentDispatcher:Le,ReactCurrentBatchConfig:al,ReactCurrentOwner:Ls};function Ja(){throw Error("act(...) is not supported in production builds of React.")}q.Children={map:Hr,forEach:function(e,t,n){Hr(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return Hr(e,function(){t++}),t},toArray:function(e){return Hr(e,function(t){return t})||[]},only:function(e){if(!Ms(e))throw Error("React.Children.only expected to receive a single React element child.");return e}};q.Component=Un;q.Fragment=jd;q.Profiler=Sd;q.PureComponent=Is;q.StrictMode=wd;q.Suspense=Td;q.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Md;q.act=Ja;q.cloneElement=function(e,t,n){if(e==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+e+".");var r=$a({},e.props),i=e.key,s=e.ref,o=e._owner;if(t!=null){if(t.ref!==void 0&&(s=t.ref,o=Ls.current),t.key!==void 0&&(i=""+t.key),e.type&&e.type.defaultProps)var a=e.type.defaultProps;for(c in t)Ga.call(t,c)&&!Xa.hasOwnProperty(c)&&(r[c]=t[c]===void 0&&a!==void 0?a[c]:t[c])}var c=arguments.length-2;if(c===1)r.children=n;else if(1<c){a=Array(c);for(var d=0;d<c;d++)a[d]=arguments[d+2];r.children=a}return{$$typeof:_r,type:e.type,key:i,ref:s,props:r,_owner:o}};q.createContext=function(e){return e={$$typeof:bd,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},e.Provider={$$typeof:Cd,_context:e},e.Consumer=e};q.createElement=Ya;q.createFactory=function(e){var t=Ya.bind(null,e);return t.type=e,t};q.createRef=function(){return{current:null}};q.forwardRef=function(e){return{$$typeof:zd,render:e}};q.isValidElement=Ms;q.lazy=function(e){return{$$typeof:Ed,_payload:{_status:-1,_result:e},_init:Ld}};q.memo=function(e,t){return{$$typeof:Pd,type:e,compare:t===void 0?null:t}};q.startTransition=function(e){var t=al.transition;al.transition={};try{e()}finally{al.transition=t}};q.unstable_act=Ja;q.useCallback=function(e,t){return Le.current.useCallback(e,t)};q.useContext=function(e){return Le.current.useContext(e)};q.useDebugValue=function(){};q.useDeferredValue=function(e){return Le.current.useDeferredValue(e)};q.useEffect=function(e,t){return Le.current.useEffect(e,t)};q.useId=function(){return Le.current.useId()};q.useImperativeHandle=function(e,t,n){return Le.current.useImperativeHandle(e,t,n)};q.useInsertionEffect=function(e,t){return Le.current.useInsertionEffect(e,t)};q.useLayoutEffect=function(e,t){return Le.current.useLayoutEffect(e,t)};q.useMemo=function(e,t){return Le.current.useMemo(e,t)};q.useReducer=function(e,t,n){return Le.current.useReducer(e,t,n)};q.useRef=function(e){return Le.current.useRef(e)};q.useState=function(e){return Le.current.useState(e)};q.useSyncExternalStore=function(e,t,n){return Le.current.useSyncExternalStore(e,t,n)};q.useTransition=function(){return Le.current.useTransition()};q.version="18.3.1";Va.exports=q;var C=Va.exports;const Ut=vd(C);/**
10
10
  * @license React
11
11
  * react-jsx-runtime.production.min.js
12
12
  *
@@ -22,7 +22,7 @@
22
22
  *
23
23
  * This source code is licensed under the MIT license found in the
24
24
  * LICENSE file in the root directory of this source tree.
25
- */(function(e){function t(b,L){var F=b.length;b.push(L);e:for(;0<F;){var H=F-1>>>1,K=b[H];if(0<i(K,L))b[H]=L,b[F]=K,F=H;else break e}}function n(b){return b.length===0?null:b[0]}function r(b){if(b.length===0)return null;var L=b[0],F=b.pop();if(F!==L){b[0]=F;e:for(var H=0,K=b.length,h=K>>>1;H<h;){var E=2*(H+1)-1,V=b[E],$=E+1,Q=b[$];if(0>i(V,F))$<K&&0>i(Q,V)?(b[H]=Q,b[$]=F,H=$):(b[H]=V,b[E]=F,H=E);else if($<K&&0>i(Q,F))b[H]=Q,b[$]=F,H=$;else break e}}return L}function i(b,L){var F=b.sortIndex-L.sortIndex;return F!==0?F:b.id-L.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],d=[],x=1,g=null,y=3,k=!1,S=!1,m=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(b){for(var L=n(d);L!==null;){if(L.callback===null)r(d);else if(L.startTime<=b)r(d),L.sortIndex=L.expirationTime,t(c,L);else break;L=n(d)}}function j(b){if(m=!1,f(b),!S)if(n(c)!==null)S=!0,A(v);else{var L=n(d);L!==null&&W(j,L.startTime-b)}}function v(b,L){S=!1,m&&(m=!1,p(T),T=-1),k=!0;var F=y;try{for(f(L),g=n(c);g!==null&&(!(g.expirationTime>L)||b&&!Z());){var H=g.callback;if(typeof H=="function"){g.callback=null,y=g.priorityLevel;var K=H(g.expirationTime<=L);L=e.unstable_now(),typeof K=="function"?g.callback=K:g===n(c)&&r(c),f(L)}else r(c);g=n(c)}if(g!==null)var h=!0;else{var E=n(d);E!==null&&W(j,E.startTime-L),h=!1}return h}finally{g=null,y=F,k=!1}}var w=!1,z=null,T=-1,D=5,M=-1;function Z(){return!(e.unstable_now()-M<D)}function U(){if(z!==null){var b=e.unstable_now();M=b;var L=!0;try{L=z(!0,b)}finally{L?P():(w=!1,z=null)}}else w=!1}var P;if(typeof u=="function")P=function(){u(U)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,re=X.port2;X.port1.onmessage=U,P=function(){re.postMessage(null)}}else P=function(){N(U,0)};function A(b){z=b,w||(w=!0,P())}function W(b,L){T=N(function(){b(e.unstable_now())},L)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(b){b.callback=null},e.unstable_continueExecution=function(){S||k||(S=!0,A(v))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(b){switch(y){case 1:case 2:case 3:var L=3;break;default:L=y}var F=y;y=L;try{return b()}finally{y=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,L){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var F=y;y=b;try{return L()}finally{y=F}},e.unstable_scheduleCallback=function(b,L,F){var H=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?H+F:H):F=H,b){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=F+K,b={id:x++,callback:L,priorityLevel:b,startTime:F,expirationTime:K,sortIndex:-1},F>H?(b.sortIndex=F,t(d,b),n(c)===null&&b===n(d)&&(m?(p(T),T=-1):m=!0,W(j,F-H))):(b.sortIndex=K,t(c,b),S||k||(S=!0,A(v))),b},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(b){var L=y;return function(){var F=y;y=L;try{return b.apply(this,arguments)}finally{y=F}}}})(tc);ec.exports=tc;var Bd=ec.exports;/**
25
+ */(function(e){function t(b,M){var F=b.length;b.push(M);e:for(;0<F;){var H=F-1>>>1,K=b[H];if(0<i(K,M))b[H]=M,b[F]=K,F=H;else break e}}function n(b){return b.length===0?null:b[0]}function r(b){if(b.length===0)return null;var M=b[0],F=b.pop();if(F!==M){b[0]=F;e:for(var H=0,K=b.length,h=K>>>1;H<h;){var E=2*(H+1)-1,V=b[E],$=E+1,Q=b[$];if(0>i(V,F))$<K&&0>i(Q,V)?(b[H]=Q,b[$]=F,H=$):(b[H]=V,b[E]=F,H=E);else if($<K&&0>i(Q,F))b[H]=Q,b[$]=F,H=$;else break e}}return M}function i(b,M){var F=b.sortIndex-M.sortIndex;return F!==0?F:b.id-M.id}if(typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var o=Date,a=o.now();e.unstable_now=function(){return o.now()-a}}var c=[],d=[],x=1,y=null,g=3,k=!1,S=!1,m=!1,N=typeof setTimeout=="function"?setTimeout:null,p=typeof clearTimeout=="function"?clearTimeout:null,u=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function f(b){for(var M=n(d);M!==null;){if(M.callback===null)r(d);else if(M.startTime<=b)r(d),M.sortIndex=M.expirationTime,t(c,M);else break;M=n(d)}}function j(b){if(m=!1,f(b),!S)if(n(c)!==null)S=!0,A(v);else{var M=n(d);M!==null&&W(j,M.startTime-b)}}function v(b,M){S=!1,m&&(m=!1,p(T),T=-1),k=!0;var F=g;try{for(f(M),y=n(c);y!==null&&(!(y.expirationTime>M)||b&&!Z());){var H=y.callback;if(typeof H=="function"){y.callback=null,g=y.priorityLevel;var K=H(y.expirationTime<=M);M=e.unstable_now(),typeof K=="function"?y.callback=K:y===n(c)&&r(c),f(M)}else r(c);y=n(c)}if(y!==null)var h=!0;else{var E=n(d);E!==null&&W(j,E.startTime-M),h=!1}return h}finally{y=null,g=F,k=!1}}var w=!1,z=null,T=-1,D=5,L=-1;function Z(){return!(e.unstable_now()-L<D)}function U(){if(z!==null){var b=e.unstable_now();L=b;var M=!0;try{M=z(!0,b)}finally{M?P():(w=!1,z=null)}}else w=!1}var P;if(typeof u=="function")P=function(){u(U)};else if(typeof MessageChannel<"u"){var X=new MessageChannel,re=X.port2;X.port1.onmessage=U,P=function(){re.postMessage(null)}}else P=function(){N(U,0)};function A(b){z=b,w||(w=!0,P())}function W(b,M){T=N(function(){b(e.unstable_now())},M)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(b){b.callback=null},e.unstable_continueExecution=function(){S||k||(S=!0,A(v))},e.unstable_forceFrameRate=function(b){0>b||125<b?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):D=0<b?Math.floor(1e3/b):5},e.unstable_getCurrentPriorityLevel=function(){return g},e.unstable_getFirstCallbackNode=function(){return n(c)},e.unstable_next=function(b){switch(g){case 1:case 2:case 3:var M=3;break;default:M=g}var F=g;g=M;try{return b()}finally{g=F}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(b,M){switch(b){case 1:case 2:case 3:case 4:case 5:break;default:b=3}var F=g;g=b;try{return M()}finally{g=F}},e.unstable_scheduleCallback=function(b,M,F){var H=e.unstable_now();switch(typeof F=="object"&&F!==null?(F=F.delay,F=typeof F=="number"&&0<F?H+F:H):F=H,b){case 1:var K=-1;break;case 2:K=250;break;case 5:K=1073741823;break;case 4:K=1e4;break;default:K=5e3}return K=F+K,b={id:x++,callback:M,priorityLevel:b,startTime:F,expirationTime:K,sortIndex:-1},F>H?(b.sortIndex=F,t(d,b),n(c)===null&&b===n(d)&&(m?(p(T),T=-1):m=!0,W(j,F-H))):(b.sortIndex=K,t(c,b),S||k||(S=!0,A(v))),b},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(b){var M=g;return function(){var F=g;g=M;try{return b.apply(this,arguments)}finally{g=F}}}})(tc);ec.exports=tc;var Bd=ec.exports;/**
26
26
  * @license React
27
27
  * react-dom.production.min.js
28
28
  *
@@ -30,14 +30,14 @@
30
30
  *
31
31
  * This source code is licensed under the MIT license found in the
32
32
  * LICENSE file in the root directory of this source tree.
33
- */var Ud=C,$e=Bd;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var nc=new Set,xr={};function dn(e,t){Ln(e,t),Ln(e+"Capture",t)}function Ln(e,t){for(xr[e]=t,e=0;e<t.length;e++)nc.add(t[e])}var mt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ai=Object.prototype.hasOwnProperty,Vd=/^[: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]*$/,Lo={},Do={};function Hd(e){return Ai.call(Do,e)?!0:Ai.call(Lo,e)?!1:Vd.test(e)?Do[e]=!0:(Lo[e]=!0,!1)}function $d(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kd(e,t,n,r){if(t===null||typeof t>"u"||$d(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Le(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Le(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Le(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Le(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Le(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ze[e]=new Le(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Le(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Le(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Le(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Le(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ds=/[\-:]([a-z])/g;function Rs(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Le(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Le(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Le(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Le(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Le("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Le(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fs(e,t,n,r){var i=ze.hasOwnProperty(t)?ze[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kd(t,n,i,r)&&(n=null),r||i===null?Hd(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var wt=Ud.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$r=Symbol.for("react.element"),hn=Symbol.for("react.portal"),xn=Symbol.for("react.fragment"),As=Symbol.for("react.strict_mode"),Oi=Symbol.for("react.profiler"),rc=Symbol.for("react.provider"),lc=Symbol.for("react.context"),Os=Symbol.for("react.forward_ref"),Wi=Symbol.for("react.suspense"),Bi=Symbol.for("react.suspense_list"),Ws=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),ic=Symbol.for("react.offscreen"),Ro=Symbol.iterator;function Qn(e){return e===null||typeof e!="object"?null:(e=Ro&&e[Ro]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,di;function nr(e){if(di===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);di=t&&t[1]||""}return`
33
+ */var Ud=C,$e=Bd;function _(e){for(var t="https://reactjs.org/docs/error-decoder.html?invariant="+e,n=1;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n]);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."}var nc=new Set,xr={};function dn(e,t){Mn(e,t),Mn(e+"Capture",t)}function Mn(e,t){for(xr[e]=t,e=0;e<t.length;e++)nc.add(t[e])}var mt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ai=Object.prototype.hasOwnProperty,Vd=/^[: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]*$/,Mo={},Do={};function Hd(e){return Ai.call(Do,e)?!0:Ai.call(Mo,e)?!1:Vd.test(e)?Do[e]=!0:(Mo[e]=!0,!1)}function $d(e,t,n,r){if(n!==null&&n.type===0)return!1;switch(typeof t){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function Kd(e,t,n,r){if(t===null||typeof t>"u"||$d(e,t,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!t;case 4:return t===!1;case 5:return isNaN(t);case 6:return isNaN(t)||1>t}return!1}function Me(e,t,n,r,i,s,o){this.acceptsBooleans=t===2||t===3||t===4,this.attributeName=r,this.attributeNamespace=i,this.mustUseProperty=n,this.propertyName=e,this.type=t,this.sanitizeURL=s,this.removeEmptyString=o}var ze={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){ze[e]=new Me(e,0,!1,e,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var t=e[0];ze[t]=new Me(t,1,!1,e[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(e){ze[e]=new Me(e,2,!1,e.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){ze[e]=new Me(e,2,!1,e,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){ze[e]=new Me(e,3,!1,e.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(e){ze[e]=new Me(e,3,!0,e,null,!1,!1)});["capture","download"].forEach(function(e){ze[e]=new Me(e,4,!1,e,null,!1,!1)});["cols","rows","size","span"].forEach(function(e){ze[e]=new Me(e,6,!1,e,null,!1,!1)});["rowSpan","start"].forEach(function(e){ze[e]=new Me(e,5,!1,e.toLowerCase(),null,!1,!1)});var Ds=/[\-:]([a-z])/g;function Rs(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Me(t,1,!1,e,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Me(t,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(e){var t=e.replace(Ds,Rs);ze[t]=new Me(t,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(e){ze[e]=new Me(e,1,!1,e.toLowerCase(),null,!1,!1)});ze.xlinkHref=new Me("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(e){ze[e]=new Me(e,1,!1,e.toLowerCase(),null,!0,!0)});function Fs(e,t,n,r){var i=ze.hasOwnProperty(t)?ze[t]:null;(i!==null?i.type!==0:r||!(2<t.length)||t[0]!=="o"&&t[0]!=="O"||t[1]!=="n"&&t[1]!=="N")&&(Kd(t,n,i,r)&&(n=null),r||i===null?Hd(t)&&(n===null?e.removeAttribute(t):e.setAttribute(t,""+n)):i.mustUseProperty?e[i.propertyName]=n===null?i.type===3?!1:"":n:(t=i.attributeName,r=i.attributeNamespace,n===null?e.removeAttribute(t):(i=i.type,n=i===3||i===4&&n===!0?"":""+n,r?e.setAttributeNS(r,t,n):e.setAttribute(t,n))))}var wt=Ud.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$r=Symbol.for("react.element"),hn=Symbol.for("react.portal"),xn=Symbol.for("react.fragment"),As=Symbol.for("react.strict_mode"),Oi=Symbol.for("react.profiler"),rc=Symbol.for("react.provider"),lc=Symbol.for("react.context"),Os=Symbol.for("react.forward_ref"),Wi=Symbol.for("react.suspense"),Bi=Symbol.for("react.suspense_list"),Ws=Symbol.for("react.memo"),Pt=Symbol.for("react.lazy"),ic=Symbol.for("react.offscreen"),Ro=Symbol.iterator;function Qn(e){return e===null||typeof e!="object"?null:(e=Ro&&e[Ro]||e["@@iterator"],typeof e=="function"?e:null)}var fe=Object.assign,di;function nr(e){if(di===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);di=t&&t[1]||""}return`
34
34
  `+di+e}var pi=!1;function fi(e,t){if(!e||pi)return"";pi=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(t)if(t=function(){throw Error()},Object.defineProperty(t.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(t,[])}catch(d){var r=d}Reflect.construct(e,[],t)}else{try{t.call()}catch(d){r=d}e.call(t.prototype)}else{try{throw Error()}catch(d){r=d}e()}}catch(d){if(d&&r&&typeof d.stack=="string"){for(var i=d.stack.split(`
35
35
  `),s=r.stack.split(`
36
36
  `),o=i.length-1,a=s.length-1;1<=o&&0<=a&&i[o]!==s[a];)a--;for(;1<=o&&0<=a;o--,a--)if(i[o]!==s[a]){if(o!==1||a!==1)do if(o--,a--,0>a||i[o]!==s[a]){var c=`
37
- `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{pi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nr(e):""}function Qd(e){switch(e.tag){case 5:return nr(e.type);case 16:return nr("Lazy");case 13:return nr("Suspense");case 19:return nr("SuspenseList");case 0:case 2:case 15:return e=fi(e.type,!1),e;case 11:return e=fi(e.type.render,!1),e;case 1:return e=fi(e.type,!0),e;default:return""}}function Ui(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case xn:return"Fragment";case hn:return"Portal";case Oi:return"Profiler";case As:return"StrictMode";case Wi:return"Suspense";case Bi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lc:return(e.displayName||"Context")+".Consumer";case rc:return(e._context.displayName||"Context")+".Provider";case Os:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ws:return t=e.displayName||null,t!==null?t:Ui(e.type)||"Memo";case Pt:t=e._payload,e=e._init;try{return Ui(e(t))}catch{}}return null}function Gd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ui(t);case 8:return t===As?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xd(e){var t=sc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kr(e){e._valueTracker||(e._valueTracker=Xd(e))}function oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vl(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}}function Vi(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ac(e,t){t=t.checked,t!=null&&Fs(e,"checked",t,!1)}function Hi(e,t){ac(e,t);var n=Vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$i(e,t.type,n):t.hasOwnProperty("defaultValue")&&$i(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ao(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $i(e,t,n){(t!=="number"||vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ki(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Oo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(rr(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vt(n)}}function cc(e,t){var n=Vt(t.value),r=Vt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Wo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function uc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?uc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qr,dc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qr=Qr||document.createElement("div"),Qr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function yr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yd=["Webkit","ms","Moz","O"];Object.keys(sr).forEach(function(e){Yd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sr[t]=sr[e]})});function pc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||sr.hasOwnProperty(e)&&sr[e]?(""+t).trim():t+"px"}function fc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Jd=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gi(e,t){if(t){if(Jd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function Xi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Yi=null;function Bs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ji=null,Tn=null,Pn=null;function Bo(e){if(e=Dr(e)){if(typeof Ji!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Xl(t),Ji(e.stateNode,e.type,t))}}function hc(e){Tn?Pn?Pn.push(e):Pn=[e]:Tn=e}function xc(){if(Tn){var e=Tn,t=Pn;if(Pn=Tn=null,Bo(e),t)for(e=0;e<t.length;e++)Bo(t[e])}}function yc(e,t){return e(t)}function gc(){}var hi=!1;function mc(e,t,n){if(hi)return e(t,n);hi=!0;try{return yc(e,t,n)}finally{hi=!1,(Tn!==null||Pn!==null)&&(gc(),xc())}}function gr(e,t){var n=e.stateNode;if(n===null)return null;var r=Xl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(_(231,t,typeof n));return n}var Zi=!1;if(mt)try{var Gn={};Object.defineProperty(Gn,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch{Zi=!1}function Zd(e,t,n,r,i,s,o,a,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(x){this.onError(x)}}var or=!1,kl=null,jl=!1,qi=null,qd={onError:function(e){or=!0,kl=e}};function ep(e,t,n,r,i,s,o,a,c){or=!1,kl=null,Zd.apply(qd,arguments)}function tp(e,t,n,r,i,s,o,a,c){if(ep.apply(this,arguments),or){if(or){var d=kl;or=!1,kl=null}else throw Error(_(198));jl||(jl=!0,qi=d)}}function pn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function vc(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 Uo(e){if(pn(e)!==e)throw Error(_(188))}function np(e){var t=e.alternate;if(!t){if(t=pn(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Uo(i),e;if(s===r)return Uo(i),t;s=s.sibling}throw Error(_(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function kc(e){return e=np(e),e!==null?jc(e):null}function jc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jc(e);if(t!==null)return t;e=e.sibling}return null}var wc=$e.unstable_scheduleCallback,Vo=$e.unstable_cancelCallback,rp=$e.unstable_shouldYield,lp=$e.unstable_requestPaint,xe=$e.unstable_now,ip=$e.unstable_getCurrentPriorityLevel,Us=$e.unstable_ImmediatePriority,Sc=$e.unstable_UserBlockingPriority,wl=$e.unstable_NormalPriority,sp=$e.unstable_LowPriority,Cc=$e.unstable_IdlePriority,$l=null,ut=null;function op(e){if(ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot($l,e,void 0,(e.current.flags&128)===128)}catch{}}var lt=Math.clz32?Math.clz32:up,ap=Math.log,cp=Math.LN2;function up(e){return e>>>=0,e===0?32:31-(ap(e)/cp|0)|0}var Gr=64,Xr=4194304;function lr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=lr(a):(s&=o,s!==0&&(r=lr(s)))}else o=n&~i,o!==0?r=lr(o):s!==0&&(r=lr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-lt(t),i=1<<n,r|=e[n],t&=~i;return r}function dp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-lt(s),a=1<<o,c=i[o];c===-1?(!(a&n)||a&r)&&(i[o]=dp(a,t)):c<=t&&(e.expiredLanes|=a),s&=~a}}function es(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bc(){var e=Gr;return Gr<<=1,!(Gr&4194240)&&(Gr=64),e}function xi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Mr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lt(t),e[t]=n}function fp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-lt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Vs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-lt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ie=0;function zc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Tc,Hs,Pc,Ec,Nc,ts=!1,Yr=[],Lt=null,Dt=null,Rt=null,mr=new Map,vr=new Map,Nt=[],hp="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 submit".split(" ");function Ho(e,t){switch(e){case"focusin":case"focusout":Lt=null;break;case"dragenter":case"dragleave":Dt=null;break;case"mouseover":case"mouseout":Rt=null;break;case"pointerover":case"pointerout":mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vr.delete(t.pointerId)}}function Xn(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Dr(t),t!==null&&Hs(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function xp(e,t,n,r,i){switch(t){case"focusin":return Lt=Xn(Lt,e,t,n,r,i),!0;case"dragenter":return Dt=Xn(Dt,e,t,n,r,i),!0;case"mouseover":return Rt=Xn(Rt,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return mr.set(s,Xn(mr.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,vr.set(s,Xn(vr.get(s)||null,e,t,n,r,i)),!0}return!1}function Ic(e){var t=qt(e.target);if(t!==null){var n=pn(t);if(n!==null){if(t=n.tag,t===13){if(t=vc(n),t!==null){e.blockedOn=t,Nc(e.priority,function(){Pc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function cl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ns(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yi=r,n.target.dispatchEvent(r),Yi=null}else return t=Dr(n),t!==null&&Hs(t),e.blockedOn=n,!1;t.shift()}return!0}function $o(e,t,n){cl(e)&&n.delete(t)}function yp(){ts=!1,Lt!==null&&cl(Lt)&&(Lt=null),Dt!==null&&cl(Dt)&&(Dt=null),Rt!==null&&cl(Rt)&&(Rt=null),mr.forEach($o),vr.forEach($o)}function Yn(e,t){e.blockedOn===t&&(e.blockedOn=null,ts||(ts=!0,$e.unstable_scheduleCallback($e.unstable_NormalPriority,yp)))}function kr(e){function t(i){return Yn(i,e)}if(0<Yr.length){Yn(Yr[0],e);for(var n=1;n<Yr.length;n++){var r=Yr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Lt!==null&&Yn(Lt,e),Dt!==null&&Yn(Dt,e),Rt!==null&&Yn(Rt,e),mr.forEach(t),vr.forEach(t),n=0;n<Nt.length;n++)r=Nt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nt.length&&(n=Nt[0],n.blockedOn===null);)Ic(n),n.blockedOn===null&&Nt.shift()}var En=wt.ReactCurrentBatchConfig,Cl=!0;function gp(e,t,n,r){var i=ie,s=En.transition;En.transition=null;try{ie=1,$s(e,t,n,r)}finally{ie=i,En.transition=s}}function mp(e,t,n,r){var i=ie,s=En.transition;En.transition=null;try{ie=4,$s(e,t,n,r)}finally{ie=i,En.transition=s}}function $s(e,t,n,r){if(Cl){var i=ns(e,t,n,r);if(i===null)bi(e,t,r,bl,n),Ho(e,r);else if(xp(i,e,t,n,r))r.stopPropagation();else if(Ho(e,r),t&4&&-1<hp.indexOf(e)){for(;i!==null;){var s=Dr(i);if(s!==null&&Tc(s),s=ns(e,t,n,r),s===null&&bi(e,t,r,bl,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else bi(e,t,r,null,n)}}var bl=null;function ns(e,t,n,r){if(bl=null,e=Bs(r),e=qt(e),e!==null)if(t=pn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bl=e,null}function _c(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ip()){case Us:return 1;case Sc:return 4;case wl:case sp:return 16;case Cc:return 536870912;default:return 16}default:return 16}}var _t=null,Ks=null,ul=null;function Mc(){if(ul)return ul;var e,t=Ks,n=t.length,r,i="value"in _t?_t.value:_t.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return ul=i.slice(e,1<r?1-r:void 0)}function dl(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 Jr(){return!0}function Ko(){return!1}function Qe(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Jr:Ko,this.isPropagationStopped=Ko,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Jr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Jr)},persist:function(){},isPersistent:Jr}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qs=Qe(Vn),Lr=fe({},Vn,{view:0,detail:0}),vp=Qe(Lr),yi,gi,Jn,Kl=fe({},Lr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gs,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!==Jn&&(Jn&&e.type==="mousemove"?(yi=e.screenX-Jn.screenX,gi=e.screenY-Jn.screenY):gi=yi=0,Jn=e),yi)},movementY:function(e){return"movementY"in e?e.movementY:gi}}),Qo=Qe(Kl),kp=fe({},Kl,{dataTransfer:0}),jp=Qe(kp),wp=fe({},Lr,{relatedTarget:0}),mi=Qe(wp),Sp=fe({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Cp=Qe(Sp),bp=fe({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zp=Qe(bp),Tp=fe({},Vn,{data:0}),Go=Qe(Tp),Pp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ep={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"},Np={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ip(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Np[e])?!!t[e]:!1}function Gs(){return Ip}var _p=fe({},Lr,{key:function(e){if(e.key){var t=Pp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ep[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gs,charCode:function(e){return e.type==="keypress"?dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Mp=Qe(_p),Lp=fe({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xo=Qe(Lp),Dp=fe({},Lr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gs}),Rp=Qe(Dp),Fp=fe({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ap=Qe(Fp),Op=fe({},Kl,{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}),Wp=Qe(Op),Bp=[9,13,27,32],Xs=mt&&"CompositionEvent"in window,ar=null;mt&&"documentMode"in document&&(ar=document.documentMode);var Up=mt&&"TextEvent"in window&&!ar,Lc=mt&&(!Xs||ar&&8<ar&&11>=ar),Yo=" ",Jo=!1;function Dc(e,t){switch(e){case"keyup":return Bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yn=!1;function Vp(e,t){switch(e){case"compositionend":return Rc(t);case"keypress":return t.which!==32?null:(Jo=!0,Yo);case"textInput":return e=t.data,e===Yo&&Jo?null:e;default:return null}}function Hp(e,t){if(yn)return e==="compositionend"||!Xs&&Dc(e,t)?(e=Mc(),ul=Ks=_t=null,yn=!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 Lc&&t.locale!=="ko"?null:t.data;default:return null}}var $p={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 Zo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$p[e.type]:t==="textarea"}function Fc(e,t,n,r){hc(r),t=zl(t,"onChange"),0<t.length&&(n=new Qs("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var cr=null,jr=null;function Kp(e){Gc(e,0)}function Ql(e){var t=vn(e);if(oc(t))return e}function Qp(e,t){if(e==="change")return t}var Ac=!1;if(mt){var vi;if(mt){var ki="oninput"in document;if(!ki){var qo=document.createElement("div");qo.setAttribute("oninput","return;"),ki=typeof qo.oninput=="function"}vi=ki}else vi=!1;Ac=vi&&(!document.documentMode||9<document.documentMode)}function ea(){cr&&(cr.detachEvent("onpropertychange",Oc),jr=cr=null)}function Oc(e){if(e.propertyName==="value"&&Ql(jr)){var t=[];Fc(t,jr,e,Bs(e)),mc(Kp,t)}}function Gp(e,t,n){e==="focusin"?(ea(),cr=t,jr=n,cr.attachEvent("onpropertychange",Oc)):e==="focusout"&&ea()}function Xp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ql(jr)}function Yp(e,t){if(e==="click")return Ql(t)}function Jp(e,t){if(e==="input"||e==="change")return Ql(t)}function Zp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var st=typeof Object.is=="function"?Object.is:Zp;function wr(e,t){if(st(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ai.call(t,i)||!st(e[i],t[i]))return!1}return!0}function ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function na(e,t){var n=ta(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ta(n)}}function Wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bc(){for(var e=window,t=vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vl(e.document)}return t}function Ys(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")}function qp(e){var t=Bc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wc(n.ownerDocument.documentElement,n)){if(r!==null&&Ys(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=na(n,s);var o=na(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var e1=mt&&"documentMode"in document&&11>=document.documentMode,gn=null,rs=null,ur=null,ls=!1;function ra(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ls||gn==null||gn!==vl(r)||(r=gn,"selectionStart"in r&&Ys(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ur&&wr(ur,r)||(ur=r,r=zl(rs,"onSelect"),0<r.length&&(t=new Qs("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=gn)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mn={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionend:Zr("Transition","TransitionEnd")},ji={},Uc={};mt&&(Uc=document.createElement("div").style,"AnimationEvent"in window||(delete mn.animationend.animation,delete mn.animationiteration.animation,delete mn.animationstart.animation),"TransitionEvent"in window||delete mn.transitionend.transition);function Gl(e){if(ji[e])return ji[e];if(!mn[e])return e;var t=mn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Uc)return ji[e]=t[n];return e}var Vc=Gl("animationend"),Hc=Gl("animationiteration"),$c=Gl("animationstart"),Kc=Gl("transitionend"),Qc=new Map,la="abort auxClick 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(" ");function $t(e,t){Qc.set(e,t),dn(t,[e])}for(var wi=0;wi<la.length;wi++){var Si=la[wi],t1=Si.toLowerCase(),n1=Si[0].toUpperCase()+Si.slice(1);$t(t1,"on"+n1)}$t(Vc,"onAnimationEnd");$t(Hc,"onAnimationIteration");$t($c,"onAnimationStart");$t("dblclick","onDoubleClick");$t("focusin","onFocus");$t("focusout","onBlur");$t(Kc,"onTransitionEnd");Ln("onMouseEnter",["mouseout","mouseover"]);Ln("onMouseLeave",["mouseout","mouseover"]);Ln("onPointerEnter",["pointerout","pointerover"]);Ln("onPointerLeave",["pointerout","pointerover"]);dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));dn("onBeforeInput",["compositionend","keypress","textInput","paste"]);dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r1=new Set("cancel close invalid load scroll toggle".split(" ").concat(ir));function ia(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,tp(r,t,void 0,e),e.currentTarget=null}function Gc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,d=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;ia(i,a,d),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,d=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;ia(i,a,d),s=c}}}if(jl)throw e=qi,jl=!1,qi=null,e}function ae(e,t){var n=t[cs];n===void 0&&(n=t[cs]=new Set);var r=e+"__bubble";n.has(r)||(Xc(t,e,2,!1),n.add(r))}function Ci(e,t,n){var r=0;t&&(r|=4),Xc(n,e,r,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[qr]){e[qr]=!0,nc.forEach(function(n){n!=="selectionchange"&&(r1.has(n)||Ci(n,!1,e),Ci(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,Ci("selectionchange",!1,t))}}function Xc(e,t,n,r){switch(_c(t)){case 1:var i=gp;break;case 4:i=mp;break;default:i=$s}n=i.bind(null,t,n,e),i=void 0,!Zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function bi(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=qt(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}mc(function(){var d=s,x=Bs(n),g=[];e:{var y=Qc.get(e);if(y!==void 0){var k=Qs,S=e;switch(e){case"keypress":if(dl(n)===0)break e;case"keydown":case"keyup":k=Mp;break;case"focusin":S="focus",k=mi;break;case"focusout":S="blur",k=mi;break;case"beforeblur":case"afterblur":k=mi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":k=Qo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=Rp;break;case Vc:case Hc:case $c:k=Cp;break;case Kc:k=Ap;break;case"scroll":k=vp;break;case"wheel":k=Wp;break;case"copy":case"cut":case"paste":k=zp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=Xo}var m=(t&4)!==0,N=!m&&e==="scroll",p=m?y!==null?y+"Capture":null:y;m=[];for(var u=d,f;u!==null;){f=u;var j=f.stateNode;if(f.tag===5&&j!==null&&(f=j,p!==null&&(j=gr(u,p),j!=null&&m.push(Cr(u,j,f)))),N)break;u=u.return}0<m.length&&(y=new k(y,S,null,n,x),g.push({event:y,listeners:m}))}}if(!(t&7)){e:{if(y=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",y&&n!==Yi&&(S=n.relatedTarget||n.fromElement)&&(qt(S)||S[vt]))break e;if((k||y)&&(y=x.window===x?x:(y=x.ownerDocument)?y.defaultView||y.parentWindow:window,k?(S=n.relatedTarget||n.toElement,k=d,S=S?qt(S):null,S!==null&&(N=pn(S),S!==N||S.tag!==5&&S.tag!==6)&&(S=null)):(k=null,S=d),k!==S)){if(m=Qo,j="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(m=Xo,j="onPointerLeave",p="onPointerEnter",u="pointer"),N=k==null?y:vn(k),f=S==null?y:vn(S),y=new m(j,u+"leave",k,n,x),y.target=N,y.relatedTarget=f,j=null,qt(x)===d&&(m=new m(p,u+"enter",S,n,x),m.target=f,m.relatedTarget=N,j=m),N=j,k&&S)t:{for(m=k,p=S,u=0,f=m;f;f=fn(f))u++;for(f=0,j=p;j;j=fn(j))f++;for(;0<u-f;)m=fn(m),u--;for(;0<f-u;)p=fn(p),f--;for(;u--;){if(m===p||p!==null&&m===p.alternate)break t;m=fn(m),p=fn(p)}m=null}else m=null;k!==null&&sa(g,y,k,m,!1),S!==null&&N!==null&&sa(g,N,S,m,!0)}}e:{if(y=d?vn(d):window,k=y.nodeName&&y.nodeName.toLowerCase(),k==="select"||k==="input"&&y.type==="file")var v=Qp;else if(Zo(y))if(Ac)v=Jp;else{v=Xp;var w=Gp}else(k=y.nodeName)&&k.toLowerCase()==="input"&&(y.type==="checkbox"||y.type==="radio")&&(v=Yp);if(v&&(v=v(e,d))){Fc(g,v,n,x);break e}w&&w(e,y,d),e==="focusout"&&(w=y._wrapperState)&&w.controlled&&y.type==="number"&&$i(y,"number",y.value)}switch(w=d?vn(d):window,e){case"focusin":(Zo(w)||w.contentEditable==="true")&&(gn=w,rs=d,ur=null);break;case"focusout":ur=rs=gn=null;break;case"mousedown":ls=!0;break;case"contextmenu":case"mouseup":case"dragend":ls=!1,ra(g,n,x);break;case"selectionchange":if(e1)break;case"keydown":case"keyup":ra(g,n,x)}var z;if(Xs)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else yn?Dc(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Lc&&n.locale!=="ko"&&(yn||T!=="onCompositionStart"?T==="onCompositionEnd"&&yn&&(z=Mc()):(_t=x,Ks="value"in _t?_t.value:_t.textContent,yn=!0)),w=zl(d,T),0<w.length&&(T=new Go(T,e,null,n,x),g.push({event:T,listeners:w}),z?T.data=z:(z=Rc(n),z!==null&&(T.data=z)))),(z=Up?Vp(e,n):Hp(e,n))&&(d=zl(d,"onBeforeInput"),0<d.length&&(x=new Go("onBeforeInput","beforeinput",null,n,x),g.push({event:x,listeners:d}),x.data=z))}Gc(g,t)})}function Cr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=gr(e,n),s!=null&&r.unshift(Cr(e,s,i)),s=gr(e,t),s!=null&&r.push(Cr(e,s,i))),e=e.return}return r}function fn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sa(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,d=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&d!==null&&(a=d,i?(c=gr(n,s),c!=null&&o.unshift(Cr(n,c,a))):i||(c=gr(n,s),c!=null&&o.push(Cr(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var l1=/\r\n?/g,i1=/\u0000|\uFFFD/g;function oa(e){return(typeof e=="string"?e:""+e).replace(l1,`
38
- `).replace(i1,"")}function el(e,t,n){if(t=oa(t),oa(e)!==t&&n)throw Error(_(425))}function Tl(){}var is=null,ss=null;function os(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var as=typeof setTimeout=="function"?setTimeout:void 0,s1=typeof clearTimeout=="function"?clearTimeout:void 0,aa=typeof Promise=="function"?Promise:void 0,o1=typeof queueMicrotask=="function"?queueMicrotask:typeof aa<"u"?function(e){return aa.resolve(null).then(e).catch(a1)}:as;function a1(e){setTimeout(function(){throw e})}function zi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),kr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);kr(t)}function Ft(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==="$?")break;if(t==="/$")return null}}return e}function ca(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Hn=Math.random().toString(36).slice(2),ct="__reactFiber$"+Hn,br="__reactProps$"+Hn,vt="__reactContainer$"+Hn,cs="__reactEvents$"+Hn,c1="__reactListeners$"+Hn,u1="__reactHandles$"+Hn;function qt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ca(e);e!==null;){if(n=e[ct])return n;e=ca(e)}return t}e=n,n=e.parentNode}return null}function Dr(e){return e=e[ct]||e[vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Xl(e){return e[br]||null}var us=[],kn=-1;function Kt(e){return{current:e}}function ce(e){0>kn||(e.current=us[kn],us[kn]=null,kn--)}function oe(e,t){kn++,us[kn]=e.current,e.current=t}var Ht={},Ne=Kt(Ht),Fe=Kt(!1),ln=Ht;function Dn(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ae(e){return e=e.childContextTypes,e!=null}function Pl(){ce(Fe),ce(Ne)}function ua(e,t,n){if(Ne.current!==Ht)throw Error(_(168));oe(Ne,t),oe(Fe,n)}function Yc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(_(108,Gd(e)||"Unknown",i));return fe({},n,r)}function El(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,ln=Ne.current,oe(Ne,e),oe(Fe,Fe.current),!0}function da(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Yc(e,t,ln),r.__reactInternalMemoizedMergedChildContext=e,ce(Fe),ce(Ne),oe(Ne,e)):ce(Fe),oe(Fe,n)}var ht=null,Yl=!1,Ti=!1;function Jc(e){ht===null?ht=[e]:ht.push(e)}function d1(e){Yl=!0,Jc(e)}function Qt(){if(!Ti&&ht!==null){Ti=!0;var e=0,t=ie;try{var n=ht;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ht=null,Yl=!1}catch(i){throw ht!==null&&(ht=ht.slice(e+1)),wc(Us,Qt),i}finally{ie=t,Ti=!1}}return null}var jn=[],wn=0,Nl=null,Il=0,Ge=[],Xe=0,sn=null,xt=1,yt="";function Yt(e,t){jn[wn++]=Il,jn[wn++]=Nl,Nl=e,Il=t}function Zc(e,t,n){Ge[Xe++]=xt,Ge[Xe++]=yt,Ge[Xe++]=sn,sn=e;var r=xt;e=yt;var i=32-lt(r)-1;r&=~(1<<i),n+=1;var s=32-lt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xt=1<<32-lt(t)+i|n<<i|r,yt=s+e}else xt=1<<s|n<<i|r,yt=e}function Js(e){e.return!==null&&(Yt(e,1),Zc(e,1,0))}function Zs(e){for(;e===Nl;)Nl=jn[--wn],jn[wn]=null,Il=jn[--wn],jn[wn]=null;for(;e===sn;)sn=Ge[--Xe],Ge[Xe]=null,yt=Ge[--Xe],Ge[Xe]=null,xt=Ge[--Xe],Ge[Xe]=null}var He=null,Ve=null,ue=!1,rt=null;function qc(e,t){var n=Ye(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function pa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,He=e,Ve=Ft(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,He=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sn!==null?{id:xt,overflow:yt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ye(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,He=e,Ve=null,!0):!1;default:return!1}}function ds(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ps(e){if(ue){var t=Ve;if(t){var n=t;if(!pa(e,t)){if(ds(e))throw Error(_(418));t=Ft(n.nextSibling);var r=He;t&&pa(e,t)?qc(r,n):(e.flags=e.flags&-4097|2,ue=!1,He=e)}}else{if(ds(e))throw Error(_(418));e.flags=e.flags&-4097|2,ue=!1,He=e}}}function fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;He=e}function tl(e){if(e!==He)return!1;if(!ue)return fa(e),ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!os(e.type,e.memoizedProps)),t&&(t=Ve)){if(ds(e))throw eu(),Error(_(418));for(;t;)qc(e,t),t=Ft(t.nextSibling)}if(fa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ve=Ft(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=He?Ft(e.stateNode.nextSibling):null;return!0}function eu(){for(var e=Ve;e;)e=Ft(e.nextSibling)}function Rn(){Ve=He=null,ue=!1}function qs(e){rt===null?rt=[e]:rt.push(e)}var p1=wt.ReactCurrentBatchConfig;function Zn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function nl(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ha(e){var t=e._init;return t(e._payload)}function tu(e){function t(p,u){if(e){var f=p.deletions;f===null?(p.deletions=[u],p.flags|=16):f.push(u)}}function n(p,u){if(!e)return null;for(;u!==null;)t(p,u),u=u.sibling;return null}function r(p,u){for(p=new Map;u!==null;)u.key!==null?p.set(u.key,u):p.set(u.index,u),u=u.sibling;return p}function i(p,u){return p=Bt(p,u),p.index=0,p.sibling=null,p}function s(p,u,f){return p.index=f,e?(f=p.alternate,f!==null?(f=f.index,f<u?(p.flags|=2,u):f):(p.flags|=2,u)):(p.flags|=1048576,u)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,u,f,j){return u===null||u.tag!==6?(u=Li(f,p.mode,j),u.return=p,u):(u=i(u,f),u.return=p,u)}function c(p,u,f,j){var v=f.type;return v===xn?x(p,u,f.props.children,j,f.key):u!==null&&(u.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Pt&&ha(v)===u.type)?(j=i(u,f.props),j.ref=Zn(p,u,f),j.return=p,j):(j=ml(f.type,f.key,f.props,null,p.mode,j),j.ref=Zn(p,u,f),j.return=p,j)}function d(p,u,f,j){return u===null||u.tag!==4||u.stateNode.containerInfo!==f.containerInfo||u.stateNode.implementation!==f.implementation?(u=Di(f,p.mode,j),u.return=p,u):(u=i(u,f.children||[]),u.return=p,u)}function x(p,u,f,j,v){return u===null||u.tag!==7?(u=rn(f,p.mode,j,v),u.return=p,u):(u=i(u,f),u.return=p,u)}function g(p,u,f){if(typeof u=="string"&&u!==""||typeof u=="number")return u=Li(""+u,p.mode,f),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case $r:return f=ml(u.type,u.key,u.props,null,p.mode,f),f.ref=Zn(p,null,u),f.return=p,f;case hn:return u=Di(u,p.mode,f),u.return=p,u;case Pt:var j=u._init;return g(p,j(u._payload),f)}if(rr(u)||Qn(u))return u=rn(u,p.mode,f,null),u.return=p,u;nl(p,u)}return null}function y(p,u,f,j){var v=u!==null?u.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return v!==null?null:a(p,u,""+f,j);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case $r:return f.key===v?c(p,u,f,j):null;case hn:return f.key===v?d(p,u,f,j):null;case Pt:return v=f._init,y(p,u,v(f._payload),j)}if(rr(f)||Qn(f))return v!==null?null:x(p,u,f,j,null);nl(p,f)}return null}function k(p,u,f,j,v){if(typeof j=="string"&&j!==""||typeof j=="number")return p=p.get(f)||null,a(u,p,""+j,v);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case $r:return p=p.get(j.key===null?f:j.key)||null,c(u,p,j,v);case hn:return p=p.get(j.key===null?f:j.key)||null,d(u,p,j,v);case Pt:var w=j._init;return k(p,u,f,w(j._payload),v)}if(rr(j)||Qn(j))return p=p.get(f)||null,x(u,p,j,v,null);nl(u,j)}return null}function S(p,u,f,j){for(var v=null,w=null,z=u,T=u=0,D=null;z!==null&&T<f.length;T++){z.index>T?(D=z,z=null):D=z.sibling;var M=y(p,z,f[T],j);if(M===null){z===null&&(z=D);break}e&&z&&M.alternate===null&&t(p,z),u=s(M,u,T),w===null?v=M:w.sibling=M,w=M,z=D}if(T===f.length)return n(p,z),ue&&Yt(p,T),v;if(z===null){for(;T<f.length;T++)z=g(p,f[T],j),z!==null&&(u=s(z,u,T),w===null?v=z:w.sibling=z,w=z);return ue&&Yt(p,T),v}for(z=r(p,z);T<f.length;T++)D=k(z,p,T,f[T],j),D!==null&&(e&&D.alternate!==null&&z.delete(D.key===null?T:D.key),u=s(D,u,T),w===null?v=D:w.sibling=D,w=D);return e&&z.forEach(function(Z){return t(p,Z)}),ue&&Yt(p,T),v}function m(p,u,f,j){var v=Qn(f);if(typeof v!="function")throw Error(_(150));if(f=v.call(f),f==null)throw Error(_(151));for(var w=v=null,z=u,T=u=0,D=null,M=f.next();z!==null&&!M.done;T++,M=f.next()){z.index>T?(D=z,z=null):D=z.sibling;var Z=y(p,z,M.value,j);if(Z===null){z===null&&(z=D);break}e&&z&&Z.alternate===null&&t(p,z),u=s(Z,u,T),w===null?v=Z:w.sibling=Z,w=Z,z=D}if(M.done)return n(p,z),ue&&Yt(p,T),v;if(z===null){for(;!M.done;T++,M=f.next())M=g(p,M.value,j),M!==null&&(u=s(M,u,T),w===null?v=M:w.sibling=M,w=M);return ue&&Yt(p,T),v}for(z=r(p,z);!M.done;T++,M=f.next())M=k(z,p,T,M.value,j),M!==null&&(e&&M.alternate!==null&&z.delete(M.key===null?T:M.key),u=s(M,u,T),w===null?v=M:w.sibling=M,w=M);return e&&z.forEach(function(U){return t(p,U)}),ue&&Yt(p,T),v}function N(p,u,f,j){if(typeof f=="object"&&f!==null&&f.type===xn&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case $r:e:{for(var v=f.key,w=u;w!==null;){if(w.key===v){if(v=f.type,v===xn){if(w.tag===7){n(p,w.sibling),u=i(w,f.props.children),u.return=p,p=u;break e}}else if(w.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Pt&&ha(v)===w.type){n(p,w.sibling),u=i(w,f.props),u.ref=Zn(p,w,f),u.return=p,p=u;break e}n(p,w);break}else t(p,w);w=w.sibling}f.type===xn?(u=rn(f.props.children,p.mode,j,f.key),u.return=p,p=u):(j=ml(f.type,f.key,f.props,null,p.mode,j),j.ref=Zn(p,u,f),j.return=p,p=j)}return o(p);case hn:e:{for(w=f.key;u!==null;){if(u.key===w)if(u.tag===4&&u.stateNode.containerInfo===f.containerInfo&&u.stateNode.implementation===f.implementation){n(p,u.sibling),u=i(u,f.children||[]),u.return=p,p=u;break e}else{n(p,u);break}else t(p,u);u=u.sibling}u=Di(f,p.mode,j),u.return=p,p=u}return o(p);case Pt:return w=f._init,N(p,u,w(f._payload),j)}if(rr(f))return S(p,u,f,j);if(Qn(f))return m(p,u,f,j);nl(p,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,u!==null&&u.tag===6?(n(p,u.sibling),u=i(u,f),u.return=p,p=u):(n(p,u),u=Li(f,p.mode,j),u.return=p,p=u),o(p)):n(p,u)}return N}var Fn=tu(!0),nu=tu(!1),_l=Kt(null),Ml=null,Sn=null,eo=null;function to(){eo=Sn=Ml=null}function no(e){var t=_l.current;ce(_l),e._currentValue=t}function fs(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){Ml=e,eo=Sn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Re=!0),e.firstContext=null)}function Ze(e){var t=e._currentValue;if(eo!==e)if(e={context:e,memoizedValue:t,next:null},Sn===null){if(Ml===null)throw Error(_(308));Sn=e,Ml.dependencies={lanes:0,firstContext:e}}else Sn=Sn.next=e;return t}var en=null;function ro(e){en===null?en=[e]:en.push(e)}function ru(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ro(t)):(n.next=i.next,i.next=n),t.interleaved=n,kt(e,r)}function kt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Et=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function gt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function At(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,kt(e,n)}return i=r.interleaved,i===null?(t.next=t,ro(r)):(t.next=i.next,i.next=t),r.interleaved=t,kt(e,n)}function pl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vs(e,n)}}function xa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ll(e,t,n,r){var i=e.updateQueue;Et=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,d=c.next;c.next=null,o===null?s=d:o.next=d,o=c;var x=e.alternate;x!==null&&(x=x.updateQueue,a=x.lastBaseUpdate,a!==o&&(a===null?x.firstBaseUpdate=d:a.next=d,x.lastBaseUpdate=c))}if(s!==null){var g=i.baseState;o=0,x=d=c=null,a=s;do{var y=a.lane,k=a.eventTime;if((r&y)===y){x!==null&&(x=x.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var S=e,m=a;switch(y=t,k=n,m.tag){case 1:if(S=m.payload,typeof S=="function"){g=S.call(k,g,y);break e}g=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=m.payload,y=typeof S=="function"?S.call(k,g,y):S,y==null)break e;g=fe({},g,y);break e;case 2:Et=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,y=i.effects,y===null?i.effects=[a]:y.push(a))}else k={eventTime:k,lane:y,tag:a.tag,payload:a.payload,callback:a.callback,next:null},x===null?(d=x=k,c=g):x=x.next=k,o|=y;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;y=a,a=y.next,y.next=null,i.lastBaseUpdate=y,i.shared.pending=null}}while(!0);if(x===null&&(c=g),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=x,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);an|=o,e.lanes=o,e.memoizedState=g}}function ya(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(_(191,i));i.call(r)}}}var Rr={},dt=Kt(Rr),zr=Kt(Rr),Tr=Kt(Rr);function tn(e){if(e===Rr)throw Error(_(174));return e}function io(e,t){switch(oe(Tr,t),oe(zr,e),oe(dt,Rr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qi(t,e)}ce(dt),oe(dt,t)}function An(){ce(dt),ce(zr),ce(Tr)}function iu(e){tn(Tr.current);var t=tn(dt.current),n=Qi(t,e.type);t!==n&&(oe(zr,e),oe(dt,n))}function so(e){zr.current===e&&(ce(dt),ce(zr))}var de=Kt(0);function Dl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Pi=[];function oo(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var fl=wt.ReactCurrentDispatcher,Ei=wt.ReactCurrentBatchConfig,on=0,pe=null,ve=null,je=null,Rl=!1,dr=!1,Pr=0,f1=0;function Te(){throw Error(_(321))}function ao(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!st(e[n],t[n]))return!1;return!0}function co(e,t,n,r,i,s){if(on=s,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fl.current=e===null||e.memoizedState===null?g1:m1,e=n(r,i),dr){s=0;do{if(dr=!1,Pr=0,25<=s)throw Error(_(301));s+=1,je=ve=null,t.updateQueue=null,fl.current=v1,e=n(r,i)}while(dr)}if(fl.current=Fl,t=ve!==null&&ve.next!==null,on=0,je=ve=pe=null,Rl=!1,t)throw Error(_(300));return e}function uo(){var e=Pr!==0;return Pr=0,e}function at(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?pe.memoizedState=je=e:je=je.next=e,je}function qe(){if(ve===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=ve.next;var t=je===null?pe.memoizedState:je.next;if(t!==null)je=t,ve=e;else{if(e===null)throw Error(_(310));ve=e,e={memoizedState:ve.memoizedState,baseState:ve.baseState,baseQueue:ve.baseQueue,queue:ve.queue,next:null},je===null?pe.memoizedState=je=e:je=je.next=e}return je}function Er(e,t){return typeof t=="function"?t(e):t}function Ni(e){var t=qe(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=ve,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,d=s;do{var x=d.lane;if((on&x)===x)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var g={lane:x,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(a=c=g,o=r):c=c.next=g,pe.lanes|=x,an|=x}d=d.next}while(d!==null&&d!==s);c===null?o=r:c.next=a,st(r,t.memoizedState)||(Re=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,pe.lanes|=s,an|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ii(e){var t=qe(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);st(s,t.memoizedState)||(Re=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function su(){}function ou(e,t){var n=pe,r=qe(),i=t(),s=!st(r.memoizedState,i);if(s&&(r.memoizedState=i,Re=!0),r=r.queue,po(uu.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,Nr(9,cu.bind(null,n,r,i,t),void 0,null),we===null)throw Error(_(349));on&30||au(n,t,i)}return i}function au(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cu(e,t,n,r){t.value=n,t.getSnapshot=r,du(t)&&pu(e)}function uu(e,t,n){return n(function(){du(t)&&pu(e)})}function du(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!st(e,n)}catch{return!0}}function pu(e){var t=kt(e,1);t!==null&&it(t,e,1,-1)}function ga(e){var t=at();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:e},t.queue=e,e=e.dispatch=y1.bind(null,pe,e),[t.memoizedState,e]}function Nr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function fu(){return qe().memoizedState}function hl(e,t,n,r){var i=at();pe.flags|=e,i.memoizedState=Nr(1|t,n,void 0,r===void 0?null:r)}function Jl(e,t,n,r){var i=qe();r=r===void 0?null:r;var s=void 0;if(ve!==null){var o=ve.memoizedState;if(s=o.destroy,r!==null&&ao(r,o.deps)){i.memoizedState=Nr(t,n,s,r);return}}pe.flags|=e,i.memoizedState=Nr(1|t,n,s,r)}function ma(e,t){return hl(8390656,8,e,t)}function po(e,t){return Jl(2048,8,e,t)}function hu(e,t){return Jl(4,2,e,t)}function xu(e,t){return Jl(4,4,e,t)}function yu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function gu(e,t,n){return n=n!=null?n.concat([e]):null,Jl(4,4,yu.bind(null,t,e),n)}function fo(){}function mu(e,t){var n=qe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vu(e,t){var n=qe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ao(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ku(e,t,n){return on&21?(st(n,t)||(n=bc(),pe.lanes|=n,an|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Re=!0),e.memoizedState=n)}function h1(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=Ei.transition;Ei.transition={};try{e(!1),t()}finally{ie=n,Ei.transition=r}}function ju(){return qe().memoizedState}function x1(e,t,n){var r=Wt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wu(e))Su(t,n);else if(n=ru(e,t,n,r),n!==null){var i=_e();it(n,e,r,i),Cu(n,t,r)}}function y1(e,t,n){var r=Wt(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wu(e))Su(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,st(a,o)){var c=t.interleaved;c===null?(i.next=i,ro(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=ru(e,t,i,r),n!==null&&(i=_e(),it(n,e,r,i),Cu(n,t,r))}}function wu(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Su(e,t){dr=Rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cu(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vs(e,n)}}var Fl={readContext:Ze,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},g1={readContext:Ze,useCallback:function(e,t){return at().memoizedState=[e,t===void 0?null:t],e},useContext:Ze,useEffect:ma,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hl(4194308,4,yu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hl(4194308,4,e,t)},useInsertionEffect:function(e,t){return hl(4,2,e,t)},useMemo:function(e,t){var n=at();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=at();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=x1.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=at();return e={current:e},t.memoizedState=e},useState:ga,useDebugValue:fo,useDeferredValue:function(e){return at().memoizedState=e},useTransition:function(){var e=ga(!1),t=e[0];return e=h1.bind(null,e[1]),at().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,i=at();if(ue){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),we===null)throw Error(_(349));on&30||au(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ma(uu.bind(null,r,s,e),[e]),r.flags|=2048,Nr(9,cu.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=at(),t=we.identifierPrefix;if(ue){var n=yt,r=xt;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Pr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=f1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},m1={readContext:Ze,useCallback:mu,useContext:Ze,useEffect:po,useImperativeHandle:gu,useInsertionEffect:hu,useLayoutEffect:xu,useMemo:vu,useReducer:Ni,useRef:fu,useState:function(){return Ni(Er)},useDebugValue:fo,useDeferredValue:function(e){var t=qe();return ku(t,ve.memoizedState,e)},useTransition:function(){var e=Ni(Er)[0],t=qe().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:ou,useId:ju,unstable_isNewReconciler:!1},v1={readContext:Ze,useCallback:mu,useContext:Ze,useEffect:po,useImperativeHandle:gu,useInsertionEffect:hu,useLayoutEffect:xu,useMemo:vu,useReducer:Ii,useRef:fu,useState:function(){return Ii(Er)},useDebugValue:fo,useDeferredValue:function(e){var t=qe();return ve===null?t.memoizedState=e:ku(t,ve.memoizedState,e)},useTransition:function(){var e=Ii(Er)[0],t=qe().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:ou,useId:ju,unstable_isNewReconciler:!1};function tt(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zl={isMounted:function(e){return(e=e._reactInternals)?pn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_e(),i=Wt(e),s=gt(r,i);s.payload=t,n!=null&&(s.callback=n),t=At(e,s,i),t!==null&&(it(t,e,i,r),pl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_e(),i=Wt(e),s=gt(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=At(e,s,i),t!==null&&(it(t,e,i,r),pl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_e(),r=Wt(e),i=gt(n,r);i.tag=2,t!=null&&(i.callback=t),t=At(e,i,r),t!==null&&(it(t,e,r,n),pl(t,e,r))}};function va(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,s):!0}function bu(e,t,n){var r=!1,i=Ht,s=t.contextType;return typeof s=="object"&&s!==null?s=Ze(s):(i=Ae(t)?ln:Ne.current,r=t.contextTypes,s=(r=r!=null)?Dn(e,i):Ht),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ka(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zl.enqueueReplaceState(t,t.state,null)}function xs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},lo(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Ze(s):(s=Ae(t)?ln:Ne.current,i.context=Dn(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(hs(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Zl.enqueueReplaceState(i,i.state,null),Ll(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function On(e,t){try{var n="",r=t;do n+=Qd(r),r=r.return;while(r);var i=n}catch(s){i=`
37
+ `+i[o].replace(" at new "," at ");return e.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",e.displayName)),c}while(1<=o&&0<=a);break}}}finally{pi=!1,Error.prepareStackTrace=n}return(e=e?e.displayName||e.name:"")?nr(e):""}function Qd(e){switch(e.tag){case 5:return nr(e.type);case 16:return nr("Lazy");case 13:return nr("Suspense");case 19:return nr("SuspenseList");case 0:case 2:case 15:return e=fi(e.type,!1),e;case 11:return e=fi(e.type.render,!1),e;case 1:return e=fi(e.type,!0),e;default:return""}}function Ui(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case xn:return"Fragment";case hn:return"Portal";case Oi:return"Profiler";case As:return"StrictMode";case Wi:return"Suspense";case Bi:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case lc:return(e.displayName||"Context")+".Consumer";case rc:return(e._context.displayName||"Context")+".Provider";case Os:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ws:return t=e.displayName||null,t!==null?t:Ui(e.type)||"Memo";case Pt:t=e._payload,e=e._init;try{return Ui(e(t))}catch{}}return null}function Gd(e){var t=e.type;switch(e.tag){case 24:return"Cache";case 9:return(t.displayName||"Context")+".Consumer";case 10:return(t._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=t.render,e=e.displayName||e.name||"",t.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return t;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Ui(t);case 8:return t===As?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t}return null}function Vt(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function sc(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Xd(e){var t=sc(e)?"checked":"value",n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t),r=""+e[t];if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,s=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(o){r=""+o,s.call(this,o)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Kr(e){e._valueTracker||(e._valueTracker=Xd(e))}function oc(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r="";return e&&(r=sc(e)?e.checked?"true":"false":e.value),e=r,e!==n?(t.setValue(e),!0):!1}function vl(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}}function Vi(e,t){var n=t.checked;return fe({},t,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??e._wrapperState.initialChecked})}function Fo(e,t){var n=t.defaultValue==null?"":t.defaultValue,r=t.checked!=null?t.checked:t.defaultChecked;n=Vt(t.value!=null?t.value:n),e._wrapperState={initialChecked:r,initialValue:n,controlled:t.type==="checkbox"||t.type==="radio"?t.checked!=null:t.value!=null}}function ac(e,t){t=t.checked,t!=null&&Fs(e,"checked",t,!1)}function Hi(e,t){ac(e,t);var n=Vt(t.value),r=t.type;if(n!=null)r==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+n):e.value!==""+n&&(e.value=""+n);else if(r==="submit"||r==="reset"){e.removeAttribute("value");return}t.hasOwnProperty("value")?$i(e,t.type,n):t.hasOwnProperty("defaultValue")&&$i(e,t.type,Vt(t.defaultValue)),t.checked==null&&t.defaultChecked!=null&&(e.defaultChecked=!!t.defaultChecked)}function Ao(e,t,n){if(t.hasOwnProperty("value")||t.hasOwnProperty("defaultValue")){var r=t.type;if(!(r!=="submit"&&r!=="reset"||t.value!==void 0&&t.value!==null))return;t=""+e._wrapperState.initialValue,n||t===e.value||(e.value=t),e.defaultValue=t}n=e.name,n!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,n!==""&&(e.name=n)}function $i(e,t,n){(t!=="number"||vl(e.ownerDocument)!==e)&&(n==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+n&&(e.defaultValue=""+n))}var rr=Array.isArray;function zn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=""+Vt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ki(e,t){if(t.dangerouslySetInnerHTML!=null)throw Error(_(91));return fe({},t,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function Oo(e,t){var n=t.value;if(n==null){if(n=t.children,t=t.defaultValue,n!=null){if(t!=null)throw Error(_(92));if(rr(n)){if(1<n.length)throw Error(_(93));n=n[0]}t=n}t==null&&(t=""),n=t}e._wrapperState={initialValue:Vt(n)}}function cc(e,t){var n=Vt(t.value),r=Vt(t.defaultValue);n!=null&&(n=""+n,n!==e.value&&(e.value=n),t.defaultValue==null&&e.defaultValue!==n&&(e.defaultValue=n)),r!=null&&(e.defaultValue=""+r)}function Wo(e){var t=e.textContent;t===e._wrapperState.initialValue&&t!==""&&t!==null&&(e.value=t)}function uc(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Qi(e,t){return e==null||e==="http://www.w3.org/1999/xhtml"?uc(t):e==="http://www.w3.org/2000/svg"&&t==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var Qr,dc=function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(t,n,r,i){MSApp.execUnsafeLocalFunction(function(){return e(t,n,r,i)})}:e}(function(e,t){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=t;else{for(Qr=Qr||document.createElement("div"),Qr.innerHTML="<svg>"+t.valueOf().toString()+"</svg>",t=Qr.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;t.firstChild;)e.appendChild(t.firstChild)}});function gr(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var sr={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Yd=["Webkit","ms","Moz","O"];Object.keys(sr).forEach(function(e){Yd.forEach(function(t){t=t+e.charAt(0).toUpperCase()+e.substring(1),sr[t]=sr[e]})});function pc(e,t,n){return t==null||typeof t=="boolean"||t===""?"":n||typeof t!="number"||t===0||sr.hasOwnProperty(e)&&sr[e]?(""+t).trim():t+"px"}function fc(e,t){e=e.style;for(var n in t)if(t.hasOwnProperty(n)){var r=n.indexOf("--")===0,i=pc(n,t[n],r);n==="float"&&(n="cssFloat"),r?e.setProperty(n,i):e[n]=i}}var Jd=fe({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Gi(e,t){if(t){if(Jd[e]&&(t.children!=null||t.dangerouslySetInnerHTML!=null))throw Error(_(137,e));if(t.dangerouslySetInnerHTML!=null){if(t.children!=null)throw Error(_(60));if(typeof t.dangerouslySetInnerHTML!="object"||!("__html"in t.dangerouslySetInnerHTML))throw Error(_(61))}if(t.style!=null&&typeof t.style!="object")throw Error(_(62))}}function Xi(e,t){if(e.indexOf("-")===-1)return typeof t.is=="string";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 Yi=null;function Bs(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ji=null,Tn=null,Pn=null;function Bo(e){if(e=Dr(e)){if(typeof Ji!="function")throw Error(_(280));var t=e.stateNode;t&&(t=Xl(t),Ji(e.stateNode,e.type,t))}}function hc(e){Tn?Pn?Pn.push(e):Pn=[e]:Tn=e}function xc(){if(Tn){var e=Tn,t=Pn;if(Pn=Tn=null,Bo(e),t)for(e=0;e<t.length;e++)Bo(t[e])}}function gc(e,t){return e(t)}function yc(){}var hi=!1;function mc(e,t,n){if(hi)return e(t,n);hi=!0;try{return gc(e,t,n)}finally{hi=!1,(Tn!==null||Pn!==null)&&(yc(),xc())}}function yr(e,t){var n=e.stateNode;if(n===null)return null;var r=Xl(n);if(r===null)return null;n=r[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":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(_(231,t,typeof n));return n}var Zi=!1;if(mt)try{var Gn={};Object.defineProperty(Gn,"passive",{get:function(){Zi=!0}}),window.addEventListener("test",Gn,Gn),window.removeEventListener("test",Gn,Gn)}catch{Zi=!1}function Zd(e,t,n,r,i,s,o,a,c){var d=Array.prototype.slice.call(arguments,3);try{t.apply(n,d)}catch(x){this.onError(x)}}var or=!1,kl=null,jl=!1,qi=null,qd={onError:function(e){or=!0,kl=e}};function ep(e,t,n,r,i,s,o,a,c){or=!1,kl=null,Zd.apply(qd,arguments)}function tp(e,t,n,r,i,s,o,a,c){if(ep.apply(this,arguments),or){if(or){var d=kl;or=!1,kl=null}else throw Error(_(198));jl||(jl=!0,qi=d)}}function pn(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function vc(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 Uo(e){if(pn(e)!==e)throw Error(_(188))}function np(e){var t=e.alternate;if(!t){if(t=pn(e),t===null)throw Error(_(188));return t!==e?null:e}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var s=i.alternate;if(s===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===s.child){for(s=i.child;s;){if(s===n)return Uo(i),e;if(s===r)return Uo(i),t;s=s.sibling}throw Error(_(188))}if(n.return!==r.return)n=i,r=s;else{for(var o=!1,a=i.child;a;){if(a===n){o=!0,n=i,r=s;break}if(a===r){o=!0,r=i,n=s;break}a=a.sibling}if(!o){for(a=s.child;a;){if(a===n){o=!0,n=s,r=i;break}if(a===r){o=!0,r=s,n=i;break}a=a.sibling}if(!o)throw Error(_(189))}}if(n.alternate!==r)throw Error(_(190))}if(n.tag!==3)throw Error(_(188));return n.stateNode.current===n?e:t}function kc(e){return e=np(e),e!==null?jc(e):null}function jc(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var t=jc(e);if(t!==null)return t;e=e.sibling}return null}var wc=$e.unstable_scheduleCallback,Vo=$e.unstable_cancelCallback,rp=$e.unstable_shouldYield,lp=$e.unstable_requestPaint,xe=$e.unstable_now,ip=$e.unstable_getCurrentPriorityLevel,Us=$e.unstable_ImmediatePriority,Sc=$e.unstable_UserBlockingPriority,wl=$e.unstable_NormalPriority,sp=$e.unstable_LowPriority,Cc=$e.unstable_IdlePriority,$l=null,ut=null;function op(e){if(ut&&typeof ut.onCommitFiberRoot=="function")try{ut.onCommitFiberRoot($l,e,void 0,(e.current.flags&128)===128)}catch{}}var lt=Math.clz32?Math.clz32:up,ap=Math.log,cp=Math.LN2;function up(e){return e>>>=0,e===0?32:31-(ap(e)/cp|0)|0}var Gr=64,Xr=4194304;function lr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Sl(e,t){var n=e.pendingLanes;if(n===0)return 0;var r=0,i=e.suspendedLanes,s=e.pingedLanes,o=n&268435455;if(o!==0){var a=o&~i;a!==0?r=lr(a):(s&=o,s!==0&&(r=lr(s)))}else o=n&~i,o!==0?r=lr(o):s!==0&&(r=lr(s));if(r===0)return 0;if(t!==0&&t!==r&&!(t&i)&&(i=r&-r,s=t&-t,i>=s||i===16&&(s&4194240)!==0))return t;if(r&4&&(r|=n&16),t=e.entangledLanes,t!==0)for(e=e.entanglements,t&=r;0<t;)n=31-lt(t),i=1<<n,r|=e[n],t&=~i;return r}function dp(e,t){switch(e){case 1:case 2:case 4:return t+250;case 8:case 16:case 32:case 64: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:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pp(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,s=e.pendingLanes;0<s;){var o=31-lt(s),a=1<<o,c=i[o];c===-1?(!(a&n)||a&r)&&(i[o]=dp(a,t)):c<=t&&(e.expiredLanes|=a),s&=~a}}function es(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function bc(){var e=Gr;return Gr<<=1,!(Gr&4194240)&&(Gr=64),e}function xi(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Lr(e,t,n){e.pendingLanes|=t,t!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,t=31-lt(t),e[t]=n}function fp(e,t){var n=e.pendingLanes&~t;e.pendingLanes=t,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=t,e.mutableReadLanes&=t,e.entangledLanes&=t,t=e.entanglements;var r=e.eventTimes;for(e=e.expirationTimes;0<n;){var i=31-lt(n),s=1<<i;t[i]=0,r[i]=-1,e[i]=-1,n&=~s}}function Vs(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-lt(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}var ie=0;function zc(e){return e&=-e,1<e?4<e?e&268435455?16:536870912:4:1}var Tc,Hs,Pc,Ec,Nc,ts=!1,Yr=[],Mt=null,Dt=null,Rt=null,mr=new Map,vr=new Map,Nt=[],hp="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 submit".split(" ");function Ho(e,t){switch(e){case"focusin":case"focusout":Mt=null;break;case"dragenter":case"dragleave":Dt=null;break;case"mouseover":case"mouseout":Rt=null;break;case"pointerover":case"pointerout":mr.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":vr.delete(t.pointerId)}}function Xn(e,t,n,r,i,s){return e===null||e.nativeEvent!==s?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:s,targetContainers:[i]},t!==null&&(t=Dr(t),t!==null&&Hs(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function xp(e,t,n,r,i){switch(t){case"focusin":return Mt=Xn(Mt,e,t,n,r,i),!0;case"dragenter":return Dt=Xn(Dt,e,t,n,r,i),!0;case"mouseover":return Rt=Xn(Rt,e,t,n,r,i),!0;case"pointerover":var s=i.pointerId;return mr.set(s,Xn(mr.get(s)||null,e,t,n,r,i)),!0;case"gotpointercapture":return s=i.pointerId,vr.set(s,Xn(vr.get(s)||null,e,t,n,r,i)),!0}return!1}function Ic(e){var t=qt(e.target);if(t!==null){var n=pn(t);if(n!==null){if(t=n.tag,t===13){if(t=vc(n),t!==null){e.blockedOn=t,Nc(e.priority,function(){Pc(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function cl(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=ns(e.domEventName,e.eventSystemFlags,t[0],e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);Yi=r,n.target.dispatchEvent(r),Yi=null}else return t=Dr(n),t!==null&&Hs(t),e.blockedOn=n,!1;t.shift()}return!0}function $o(e,t,n){cl(e)&&n.delete(t)}function gp(){ts=!1,Mt!==null&&cl(Mt)&&(Mt=null),Dt!==null&&cl(Dt)&&(Dt=null),Rt!==null&&cl(Rt)&&(Rt=null),mr.forEach($o),vr.forEach($o)}function Yn(e,t){e.blockedOn===t&&(e.blockedOn=null,ts||(ts=!0,$e.unstable_scheduleCallback($e.unstable_NormalPriority,gp)))}function kr(e){function t(i){return Yn(i,e)}if(0<Yr.length){Yn(Yr[0],e);for(var n=1;n<Yr.length;n++){var r=Yr[n];r.blockedOn===e&&(r.blockedOn=null)}}for(Mt!==null&&Yn(Mt,e),Dt!==null&&Yn(Dt,e),Rt!==null&&Yn(Rt,e),mr.forEach(t),vr.forEach(t),n=0;n<Nt.length;n++)r=Nt[n],r.blockedOn===e&&(r.blockedOn=null);for(;0<Nt.length&&(n=Nt[0],n.blockedOn===null);)Ic(n),n.blockedOn===null&&Nt.shift()}var En=wt.ReactCurrentBatchConfig,Cl=!0;function yp(e,t,n,r){var i=ie,s=En.transition;En.transition=null;try{ie=1,$s(e,t,n,r)}finally{ie=i,En.transition=s}}function mp(e,t,n,r){var i=ie,s=En.transition;En.transition=null;try{ie=4,$s(e,t,n,r)}finally{ie=i,En.transition=s}}function $s(e,t,n,r){if(Cl){var i=ns(e,t,n,r);if(i===null)bi(e,t,r,bl,n),Ho(e,r);else if(xp(i,e,t,n,r))r.stopPropagation();else if(Ho(e,r),t&4&&-1<hp.indexOf(e)){for(;i!==null;){var s=Dr(i);if(s!==null&&Tc(s),s=ns(e,t,n,r),s===null&&bi(e,t,r,bl,n),s===i)break;i=s}i!==null&&r.stopPropagation()}else bi(e,t,r,null,n)}}var bl=null;function ns(e,t,n,r){if(bl=null,e=Bs(r),e=qt(e),e!==null)if(t=pn(e),t===null)e=null;else if(n=t.tag,n===13){if(e=vc(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null);return bl=e,null}function _c(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(ip()){case Us:return 1;case Sc:return 4;case wl:case sp:return 16;case Cc:return 536870912;default:return 16}default:return 16}}var _t=null,Ks=null,ul=null;function Lc(){if(ul)return ul;var e,t=Ks,n=t.length,r,i="value"in _t?_t.value:_t.textContent,s=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[s-r];r++);return ul=i.slice(e,1<r?1-r:void 0)}function dl(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 Jr(){return!0}function Ko(){return!1}function Qe(e){function t(n,r,i,s,o){this._reactName=n,this._targetInst=i,this.type=r,this.nativeEvent=s,this.target=o,this.currentTarget=null;for(var a in e)e.hasOwnProperty(a)&&(n=e[a],this[a]=n?n(s):s[a]);return this.isDefaultPrevented=(s.defaultPrevented!=null?s.defaultPrevented:s.returnValue===!1)?Jr:Ko,this.isPropagationStopped=Ko,this}return fe(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=Jr)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=Jr)},persist:function(){},isPersistent:Jr}),t}var Vn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Qs=Qe(Vn),Mr=fe({},Vn,{view:0,detail:0}),vp=Qe(Mr),gi,yi,Jn,Kl=fe({},Mr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Gs,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!==Jn&&(Jn&&e.type==="mousemove"?(gi=e.screenX-Jn.screenX,yi=e.screenY-Jn.screenY):yi=gi=0,Jn=e),gi)},movementY:function(e){return"movementY"in e?e.movementY:yi}}),Qo=Qe(Kl),kp=fe({},Kl,{dataTransfer:0}),jp=Qe(kp),wp=fe({},Mr,{relatedTarget:0}),mi=Qe(wp),Sp=fe({},Vn,{animationName:0,elapsedTime:0,pseudoElement:0}),Cp=Qe(Sp),bp=fe({},Vn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),zp=Qe(bp),Tp=fe({},Vn,{data:0}),Go=Qe(Tp),Pp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Ep={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"},Np={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Ip(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Np[e])?!!t[e]:!1}function Gs(){return Ip}var _p=fe({},Mr,{key:function(e){if(e.key){var t=Pp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Ep[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Gs,charCode:function(e){return e.type==="keypress"?dl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Lp=Qe(_p),Mp=fe({},Kl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xo=Qe(Mp),Dp=fe({},Mr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Gs}),Rp=Qe(Dp),Fp=fe({},Vn,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ap=Qe(Fp),Op=fe({},Kl,{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}),Wp=Qe(Op),Bp=[9,13,27,32],Xs=mt&&"CompositionEvent"in window,ar=null;mt&&"documentMode"in document&&(ar=document.documentMode);var Up=mt&&"TextEvent"in window&&!ar,Mc=mt&&(!Xs||ar&&8<ar&&11>=ar),Yo=" ",Jo=!1;function Dc(e,t){switch(e){case"keyup":return Bp.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var gn=!1;function Vp(e,t){switch(e){case"compositionend":return Rc(t);case"keypress":return t.which!==32?null:(Jo=!0,Yo);case"textInput":return e=t.data,e===Yo&&Jo?null:e;default:return null}}function Hp(e,t){if(gn)return e==="compositionend"||!Xs&&Dc(e,t)?(e=Lc(),ul=Ks=_t=null,gn=!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 Mc&&t.locale!=="ko"?null:t.data;default:return null}}var $p={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 Zo(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!$p[e.type]:t==="textarea"}function Fc(e,t,n,r){hc(r),t=zl(t,"onChange"),0<t.length&&(n=new Qs("onChange","change",null,n,r),e.push({event:n,listeners:t}))}var cr=null,jr=null;function Kp(e){Gc(e,0)}function Ql(e){var t=vn(e);if(oc(t))return e}function Qp(e,t){if(e==="change")return t}var Ac=!1;if(mt){var vi;if(mt){var ki="oninput"in document;if(!ki){var qo=document.createElement("div");qo.setAttribute("oninput","return;"),ki=typeof qo.oninput=="function"}vi=ki}else vi=!1;Ac=vi&&(!document.documentMode||9<document.documentMode)}function ea(){cr&&(cr.detachEvent("onpropertychange",Oc),jr=cr=null)}function Oc(e){if(e.propertyName==="value"&&Ql(jr)){var t=[];Fc(t,jr,e,Bs(e)),mc(Kp,t)}}function Gp(e,t,n){e==="focusin"?(ea(),cr=t,jr=n,cr.attachEvent("onpropertychange",Oc)):e==="focusout"&&ea()}function Xp(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ql(jr)}function Yp(e,t){if(e==="click")return Ql(t)}function Jp(e,t){if(e==="input"||e==="change")return Ql(t)}function Zp(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var st=typeof Object.is=="function"?Object.is:Zp;function wr(e,t){if(st(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Ai.call(t,i)||!st(e[i],t[i]))return!1}return!0}function ta(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function na(e,t){var n=ta(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=ta(n)}}function Wc(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Wc(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Bc(){for(var e=window,t=vl();t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=vl(e.document)}return t}function Ys(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")}function qp(e){var t=Bc(),n=e.focusedElem,r=e.selectionRange;if(t!==n&&n&&n.ownerDocument&&Wc(n.ownerDocument.documentElement,n)){if(r!==null&&Ys(n)){if(t=r.start,e=r.end,e===void 0&&(e=t),"selectionStart"in n)n.selectionStart=t,n.selectionEnd=Math.min(e,n.value.length);else if(e=(t=n.ownerDocument||document)&&t.defaultView||window,e.getSelection){e=e.getSelection();var i=n.textContent.length,s=Math.min(r.start,i);r=r.end===void 0?s:Math.min(r.end,i),!e.extend&&s>r&&(i=r,r=s,s=i),i=na(n,s);var o=na(n,r);i&&o&&(e.rangeCount!==1||e.anchorNode!==i.node||e.anchorOffset!==i.offset||e.focusNode!==o.node||e.focusOffset!==o.offset)&&(t=t.createRange(),t.setStart(i.node,i.offset),e.removeAllRanges(),s>r?(e.addRange(t),e.extend(o.node,o.offset)):(t.setEnd(o.node,o.offset),e.addRange(t)))}}for(t=[],e=n;e=e.parentNode;)e.nodeType===1&&t.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n<t.length;n++)e=t[n],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var e1=mt&&"documentMode"in document&&11>=document.documentMode,yn=null,rs=null,ur=null,ls=!1;function ra(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ls||yn==null||yn!==vl(r)||(r=yn,"selectionStart"in r&&Ys(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),ur&&wr(ur,r)||(ur=r,r=zl(rs,"onSelect"),0<r.length&&(t=new Qs("onSelect","select",null,t,n),e.push({event:t,listeners:r}),t.target=yn)))}function Zr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var mn={animationend:Zr("Animation","AnimationEnd"),animationiteration:Zr("Animation","AnimationIteration"),animationstart:Zr("Animation","AnimationStart"),transitionend:Zr("Transition","TransitionEnd")},ji={},Uc={};mt&&(Uc=document.createElement("div").style,"AnimationEvent"in window||(delete mn.animationend.animation,delete mn.animationiteration.animation,delete mn.animationstart.animation),"TransitionEvent"in window||delete mn.transitionend.transition);function Gl(e){if(ji[e])return ji[e];if(!mn[e])return e;var t=mn[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Uc)return ji[e]=t[n];return e}var Vc=Gl("animationend"),Hc=Gl("animationiteration"),$c=Gl("animationstart"),Kc=Gl("transitionend"),Qc=new Map,la="abort auxClick 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(" ");function $t(e,t){Qc.set(e,t),dn(t,[e])}for(var wi=0;wi<la.length;wi++){var Si=la[wi],t1=Si.toLowerCase(),n1=Si[0].toUpperCase()+Si.slice(1);$t(t1,"on"+n1)}$t(Vc,"onAnimationEnd");$t(Hc,"onAnimationIteration");$t($c,"onAnimationStart");$t("dblclick","onDoubleClick");$t("focusin","onFocus");$t("focusout","onBlur");$t(Kc,"onTransitionEnd");Mn("onMouseEnter",["mouseout","mouseover"]);Mn("onMouseLeave",["mouseout","mouseover"]);Mn("onPointerEnter",["pointerout","pointerover"]);Mn("onPointerLeave",["pointerout","pointerover"]);dn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));dn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));dn("onBeforeInput",["compositionend","keypress","textInput","paste"]);dn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));dn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));dn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ir="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),r1=new Set("cancel close invalid load scroll toggle".split(" ").concat(ir));function ia(e,t,n){var r=e.type||"unknown-event";e.currentTarget=n,tp(r,t,void 0,e),e.currentTarget=null}function Gc(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;e:{var s=void 0;if(t)for(var o=r.length-1;0<=o;o--){var a=r[o],c=a.instance,d=a.currentTarget;if(a=a.listener,c!==s&&i.isPropagationStopped())break e;ia(i,a,d),s=c}else for(o=0;o<r.length;o++){if(a=r[o],c=a.instance,d=a.currentTarget,a=a.listener,c!==s&&i.isPropagationStopped())break e;ia(i,a,d),s=c}}}if(jl)throw e=qi,jl=!1,qi=null,e}function ae(e,t){var n=t[cs];n===void 0&&(n=t[cs]=new Set);var r=e+"__bubble";n.has(r)||(Xc(t,e,2,!1),n.add(r))}function Ci(e,t,n){var r=0;t&&(r|=4),Xc(n,e,r,t)}var qr="_reactListening"+Math.random().toString(36).slice(2);function Sr(e){if(!e[qr]){e[qr]=!0,nc.forEach(function(n){n!=="selectionchange"&&(r1.has(n)||Ci(n,!1,e),Ci(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[qr]||(t[qr]=!0,Ci("selectionchange",!1,t))}}function Xc(e,t,n,r){switch(_c(t)){case 1:var i=yp;break;case 4:i=mp;break;default:i=$s}n=i.bind(null,t,n,e),i=void 0,!Zi||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),r?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function bi(e,t,n,r,i){var s=r;if(!(t&1)&&!(t&2)&&r!==null)e:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var a=r.stateNode.containerInfo;if(a===i||a.nodeType===8&&a.parentNode===i)break;if(o===4)for(o=r.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===i||c.nodeType===8&&c.parentNode===i))return;o=o.return}for(;a!==null;){if(o=qt(a),o===null)return;if(c=o.tag,c===5||c===6){r=s=o;continue e}a=a.parentNode}}r=r.return}mc(function(){var d=s,x=Bs(n),y=[];e:{var g=Qc.get(e);if(g!==void 0){var k=Qs,S=e;switch(e){case"keypress":if(dl(n)===0)break e;case"keydown":case"keyup":k=Lp;break;case"focusin":S="focus",k=mi;break;case"focusout":S="blur",k=mi;break;case"beforeblur":case"afterblur":k=mi;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":k=Qo;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":k=jp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":k=Rp;break;case Vc:case Hc:case $c:k=Cp;break;case Kc:k=Ap;break;case"scroll":k=vp;break;case"wheel":k=Wp;break;case"copy":case"cut":case"paste":k=zp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":k=Xo}var m=(t&4)!==0,N=!m&&e==="scroll",p=m?g!==null?g+"Capture":null:g;m=[];for(var u=d,f;u!==null;){f=u;var j=f.stateNode;if(f.tag===5&&j!==null&&(f=j,p!==null&&(j=yr(u,p),j!=null&&m.push(Cr(u,j,f)))),N)break;u=u.return}0<m.length&&(g=new k(g,S,null,n,x),y.push({event:g,listeners:m}))}}if(!(t&7)){e:{if(g=e==="mouseover"||e==="pointerover",k=e==="mouseout"||e==="pointerout",g&&n!==Yi&&(S=n.relatedTarget||n.fromElement)&&(qt(S)||S[vt]))break e;if((k||g)&&(g=x.window===x?x:(g=x.ownerDocument)?g.defaultView||g.parentWindow:window,k?(S=n.relatedTarget||n.toElement,k=d,S=S?qt(S):null,S!==null&&(N=pn(S),S!==N||S.tag!==5&&S.tag!==6)&&(S=null)):(k=null,S=d),k!==S)){if(m=Qo,j="onMouseLeave",p="onMouseEnter",u="mouse",(e==="pointerout"||e==="pointerover")&&(m=Xo,j="onPointerLeave",p="onPointerEnter",u="pointer"),N=k==null?g:vn(k),f=S==null?g:vn(S),g=new m(j,u+"leave",k,n,x),g.target=N,g.relatedTarget=f,j=null,qt(x)===d&&(m=new m(p,u+"enter",S,n,x),m.target=f,m.relatedTarget=N,j=m),N=j,k&&S)t:{for(m=k,p=S,u=0,f=m;f;f=fn(f))u++;for(f=0,j=p;j;j=fn(j))f++;for(;0<u-f;)m=fn(m),u--;for(;0<f-u;)p=fn(p),f--;for(;u--;){if(m===p||p!==null&&m===p.alternate)break t;m=fn(m),p=fn(p)}m=null}else m=null;k!==null&&sa(y,g,k,m,!1),S!==null&&N!==null&&sa(y,N,S,m,!0)}}e:{if(g=d?vn(d):window,k=g.nodeName&&g.nodeName.toLowerCase(),k==="select"||k==="input"&&g.type==="file")var v=Qp;else if(Zo(g))if(Ac)v=Jp;else{v=Xp;var w=Gp}else(k=g.nodeName)&&k.toLowerCase()==="input"&&(g.type==="checkbox"||g.type==="radio")&&(v=Yp);if(v&&(v=v(e,d))){Fc(y,v,n,x);break e}w&&w(e,g,d),e==="focusout"&&(w=g._wrapperState)&&w.controlled&&g.type==="number"&&$i(g,"number",g.value)}switch(w=d?vn(d):window,e){case"focusin":(Zo(w)||w.contentEditable==="true")&&(yn=w,rs=d,ur=null);break;case"focusout":ur=rs=yn=null;break;case"mousedown":ls=!0;break;case"contextmenu":case"mouseup":case"dragend":ls=!1,ra(y,n,x);break;case"selectionchange":if(e1)break;case"keydown":case"keyup":ra(y,n,x)}var z;if(Xs)e:{switch(e){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else gn?Dc(e,n)&&(T="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(T="onCompositionStart");T&&(Mc&&n.locale!=="ko"&&(gn||T!=="onCompositionStart"?T==="onCompositionEnd"&&gn&&(z=Lc()):(_t=x,Ks="value"in _t?_t.value:_t.textContent,gn=!0)),w=zl(d,T),0<w.length&&(T=new Go(T,e,null,n,x),y.push({event:T,listeners:w}),z?T.data=z:(z=Rc(n),z!==null&&(T.data=z)))),(z=Up?Vp(e,n):Hp(e,n))&&(d=zl(d,"onBeforeInput"),0<d.length&&(x=new Go("onBeforeInput","beforeinput",null,n,x),y.push({event:x,listeners:d}),x.data=z))}Gc(y,t)})}function Cr(e,t,n){return{instance:e,listener:t,currentTarget:n}}function zl(e,t){for(var n=t+"Capture",r=[];e!==null;){var i=e,s=i.stateNode;i.tag===5&&s!==null&&(i=s,s=yr(e,n),s!=null&&r.unshift(Cr(e,s,i)),s=yr(e,t),s!=null&&r.push(Cr(e,s,i))),e=e.return}return r}function fn(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function sa(e,t,n,r,i){for(var s=t._reactName,o=[];n!==null&&n!==r;){var a=n,c=a.alternate,d=a.stateNode;if(c!==null&&c===r)break;a.tag===5&&d!==null&&(a=d,i?(c=yr(n,s),c!=null&&o.unshift(Cr(n,c,a))):i||(c=yr(n,s),c!=null&&o.push(Cr(n,c,a)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var l1=/\r\n?/g,i1=/\u0000|\uFFFD/g;function oa(e){return(typeof e=="string"?e:""+e).replace(l1,`
38
+ `).replace(i1,"")}function el(e,t,n){if(t=oa(t),oa(e)!==t&&n)throw Error(_(425))}function Tl(){}var is=null,ss=null;function os(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var as=typeof setTimeout=="function"?setTimeout:void 0,s1=typeof clearTimeout=="function"?clearTimeout:void 0,aa=typeof Promise=="function"?Promise:void 0,o1=typeof queueMicrotask=="function"?queueMicrotask:typeof aa<"u"?function(e){return aa.resolve(null).then(e).catch(a1)}:as;function a1(e){setTimeout(function(){throw e})}function zi(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"){if(r===0){e.removeChild(i),kr(t);return}r--}else n!=="$"&&n!=="$?"&&n!=="$!"||r++;n=i}while(n);kr(t)}function Ft(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==="$?")break;if(t==="/$")return null}}return e}function ca(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"){if(t===0)return e;t--}else n==="/$"&&t++}e=e.previousSibling}return null}var Hn=Math.random().toString(36).slice(2),ct="__reactFiber$"+Hn,br="__reactProps$"+Hn,vt="__reactContainer$"+Hn,cs="__reactEvents$"+Hn,c1="__reactListeners$"+Hn,u1="__reactHandles$"+Hn;function qt(e){var t=e[ct];if(t)return t;for(var n=e.parentNode;n;){if(t=n[vt]||n[ct]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ca(e);e!==null;){if(n=e[ct])return n;e=ca(e)}return t}e=n,n=e.parentNode}return null}function Dr(e){return e=e[ct]||e[vt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function vn(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(_(33))}function Xl(e){return e[br]||null}var us=[],kn=-1;function Kt(e){return{current:e}}function ce(e){0>kn||(e.current=us[kn],us[kn]=null,kn--)}function oe(e,t){kn++,us[kn]=e.current,e.current=t}var Ht={},Ne=Kt(Ht),Fe=Kt(!1),ln=Ht;function Dn(e,t){var n=e.type.contextTypes;if(!n)return Ht;var r=e.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===t)return r.__reactInternalMemoizedMaskedChildContext;var i={},s;for(s in n)i[s]=t[s];return r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=t,e.__reactInternalMemoizedMaskedChildContext=i),i}function Ae(e){return e=e.childContextTypes,e!=null}function Pl(){ce(Fe),ce(Ne)}function ua(e,t,n){if(Ne.current!==Ht)throw Error(_(168));oe(Ne,t),oe(Fe,n)}function Yc(e,t,n){var r=e.stateNode;if(t=t.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var i in r)if(!(i in t))throw Error(_(108,Gd(e)||"Unknown",i));return fe({},n,r)}function El(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Ht,ln=Ne.current,oe(Ne,e),oe(Fe,Fe.current),!0}function da(e,t,n){var r=e.stateNode;if(!r)throw Error(_(169));n?(e=Yc(e,t,ln),r.__reactInternalMemoizedMergedChildContext=e,ce(Fe),ce(Ne),oe(Ne,e)):ce(Fe),oe(Fe,n)}var ht=null,Yl=!1,Ti=!1;function Jc(e){ht===null?ht=[e]:ht.push(e)}function d1(e){Yl=!0,Jc(e)}function Qt(){if(!Ti&&ht!==null){Ti=!0;var e=0,t=ie;try{var n=ht;for(ie=1;e<n.length;e++){var r=n[e];do r=r(!0);while(r!==null)}ht=null,Yl=!1}catch(i){throw ht!==null&&(ht=ht.slice(e+1)),wc(Us,Qt),i}finally{ie=t,Ti=!1}}return null}var jn=[],wn=0,Nl=null,Il=0,Ge=[],Xe=0,sn=null,xt=1,gt="";function Yt(e,t){jn[wn++]=Il,jn[wn++]=Nl,Nl=e,Il=t}function Zc(e,t,n){Ge[Xe++]=xt,Ge[Xe++]=gt,Ge[Xe++]=sn,sn=e;var r=xt;e=gt;var i=32-lt(r)-1;r&=~(1<<i),n+=1;var s=32-lt(t)+i;if(30<s){var o=i-i%5;s=(r&(1<<o)-1).toString(32),r>>=o,i-=o,xt=1<<32-lt(t)+i|n<<i|r,gt=s+e}else xt=1<<s|n<<i|r,gt=e}function Js(e){e.return!==null&&(Yt(e,1),Zc(e,1,0))}function Zs(e){for(;e===Nl;)Nl=jn[--wn],jn[wn]=null,Il=jn[--wn],jn[wn]=null;for(;e===sn;)sn=Ge[--Xe],Ge[Xe]=null,gt=Ge[--Xe],Ge[Xe]=null,xt=Ge[--Xe],Ge[Xe]=null}var He=null,Ve=null,ue=!1,rt=null;function qc(e,t){var n=Ye(5,null,null,0);n.elementType="DELETED",n.stateNode=t,n.return=e,t=e.deletions,t===null?(e.deletions=[n],e.flags|=16):t.push(n)}function pa(e,t){switch(e.tag){case 5:var n=e.type;return t=t.nodeType!==1||n.toLowerCase()!==t.nodeName.toLowerCase()?null:t,t!==null?(e.stateNode=t,He=e,Ve=Ft(t.firstChild),!0):!1;case 6:return t=e.pendingProps===""||t.nodeType!==3?null:t,t!==null?(e.stateNode=t,He=e,Ve=null,!0):!1;case 13:return t=t.nodeType!==8?null:t,t!==null?(n=sn!==null?{id:xt,overflow:gt}:null,e.memoizedState={dehydrated:t,treeContext:n,retryLane:1073741824},n=Ye(18,null,null,0),n.stateNode=t,n.return=e,e.child=n,He=e,Ve=null,!0):!1;default:return!1}}function ds(e){return(e.mode&1)!==0&&(e.flags&128)===0}function ps(e){if(ue){var t=Ve;if(t){var n=t;if(!pa(e,t)){if(ds(e))throw Error(_(418));t=Ft(n.nextSibling);var r=He;t&&pa(e,t)?qc(r,n):(e.flags=e.flags&-4097|2,ue=!1,He=e)}}else{if(ds(e))throw Error(_(418));e.flags=e.flags&-4097|2,ue=!1,He=e}}}function fa(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;He=e}function tl(e){if(e!==He)return!1;if(!ue)return fa(e),ue=!0,!1;var t;if((t=e.tag!==3)&&!(t=e.tag!==5)&&(t=e.type,t=t!=="head"&&t!=="body"&&!os(e.type,e.memoizedProps)),t&&(t=Ve)){if(ds(e))throw eu(),Error(_(418));for(;t;)qc(e,t),t=Ft(t.nextSibling)}if(fa(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(_(317));e:{for(e=e.nextSibling,t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"){if(t===0){Ve=Ft(e.nextSibling);break e}t--}else n!=="$"&&n!=="$!"&&n!=="$?"||t++}e=e.nextSibling}Ve=null}}else Ve=He?Ft(e.stateNode.nextSibling):null;return!0}function eu(){for(var e=Ve;e;)e=Ft(e.nextSibling)}function Rn(){Ve=He=null,ue=!1}function qs(e){rt===null?rt=[e]:rt.push(e)}var p1=wt.ReactCurrentBatchConfig;function Zn(e,t,n){if(e=n.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(n._owner){if(n=n._owner,n){if(n.tag!==1)throw Error(_(309));var r=n.stateNode}if(!r)throw Error(_(147,e));var i=r,s=""+e;return t!==null&&t.ref!==null&&typeof t.ref=="function"&&t.ref._stringRef===s?t.ref:(t=function(o){var a=i.refs;o===null?delete a[s]:a[s]=o},t._stringRef=s,t)}if(typeof e!="string")throw Error(_(284));if(!n._owner)throw Error(_(290,e))}return e}function nl(e,t){throw e=Object.prototype.toString.call(t),Error(_(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e))}function ha(e){var t=e._init;return t(e._payload)}function tu(e){function t(p,u){if(e){var f=p.deletions;f===null?(p.deletions=[u],p.flags|=16):f.push(u)}}function n(p,u){if(!e)return null;for(;u!==null;)t(p,u),u=u.sibling;return null}function r(p,u){for(p=new Map;u!==null;)u.key!==null?p.set(u.key,u):p.set(u.index,u),u=u.sibling;return p}function i(p,u){return p=Bt(p,u),p.index=0,p.sibling=null,p}function s(p,u,f){return p.index=f,e?(f=p.alternate,f!==null?(f=f.index,f<u?(p.flags|=2,u):f):(p.flags|=2,u)):(p.flags|=1048576,u)}function o(p){return e&&p.alternate===null&&(p.flags|=2),p}function a(p,u,f,j){return u===null||u.tag!==6?(u=Mi(f,p.mode,j),u.return=p,u):(u=i(u,f),u.return=p,u)}function c(p,u,f,j){var v=f.type;return v===xn?x(p,u,f.props.children,j,f.key):u!==null&&(u.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Pt&&ha(v)===u.type)?(j=i(u,f.props),j.ref=Zn(p,u,f),j.return=p,j):(j=ml(f.type,f.key,f.props,null,p.mode,j),j.ref=Zn(p,u,f),j.return=p,j)}function d(p,u,f,j){return u===null||u.tag!==4||u.stateNode.containerInfo!==f.containerInfo||u.stateNode.implementation!==f.implementation?(u=Di(f,p.mode,j),u.return=p,u):(u=i(u,f.children||[]),u.return=p,u)}function x(p,u,f,j,v){return u===null||u.tag!==7?(u=rn(f,p.mode,j,v),u.return=p,u):(u=i(u,f),u.return=p,u)}function y(p,u,f){if(typeof u=="string"&&u!==""||typeof u=="number")return u=Mi(""+u,p.mode,f),u.return=p,u;if(typeof u=="object"&&u!==null){switch(u.$$typeof){case $r:return f=ml(u.type,u.key,u.props,null,p.mode,f),f.ref=Zn(p,null,u),f.return=p,f;case hn:return u=Di(u,p.mode,f),u.return=p,u;case Pt:var j=u._init;return y(p,j(u._payload),f)}if(rr(u)||Qn(u))return u=rn(u,p.mode,f,null),u.return=p,u;nl(p,u)}return null}function g(p,u,f,j){var v=u!==null?u.key:null;if(typeof f=="string"&&f!==""||typeof f=="number")return v!==null?null:a(p,u,""+f,j);if(typeof f=="object"&&f!==null){switch(f.$$typeof){case $r:return f.key===v?c(p,u,f,j):null;case hn:return f.key===v?d(p,u,f,j):null;case Pt:return v=f._init,g(p,u,v(f._payload),j)}if(rr(f)||Qn(f))return v!==null?null:x(p,u,f,j,null);nl(p,f)}return null}function k(p,u,f,j,v){if(typeof j=="string"&&j!==""||typeof j=="number")return p=p.get(f)||null,a(u,p,""+j,v);if(typeof j=="object"&&j!==null){switch(j.$$typeof){case $r:return p=p.get(j.key===null?f:j.key)||null,c(u,p,j,v);case hn:return p=p.get(j.key===null?f:j.key)||null,d(u,p,j,v);case Pt:var w=j._init;return k(p,u,f,w(j._payload),v)}if(rr(j)||Qn(j))return p=p.get(f)||null,x(u,p,j,v,null);nl(u,j)}return null}function S(p,u,f,j){for(var v=null,w=null,z=u,T=u=0,D=null;z!==null&&T<f.length;T++){z.index>T?(D=z,z=null):D=z.sibling;var L=g(p,z,f[T],j);if(L===null){z===null&&(z=D);break}e&&z&&L.alternate===null&&t(p,z),u=s(L,u,T),w===null?v=L:w.sibling=L,w=L,z=D}if(T===f.length)return n(p,z),ue&&Yt(p,T),v;if(z===null){for(;T<f.length;T++)z=y(p,f[T],j),z!==null&&(u=s(z,u,T),w===null?v=z:w.sibling=z,w=z);return ue&&Yt(p,T),v}for(z=r(p,z);T<f.length;T++)D=k(z,p,T,f[T],j),D!==null&&(e&&D.alternate!==null&&z.delete(D.key===null?T:D.key),u=s(D,u,T),w===null?v=D:w.sibling=D,w=D);return e&&z.forEach(function(Z){return t(p,Z)}),ue&&Yt(p,T),v}function m(p,u,f,j){var v=Qn(f);if(typeof v!="function")throw Error(_(150));if(f=v.call(f),f==null)throw Error(_(151));for(var w=v=null,z=u,T=u=0,D=null,L=f.next();z!==null&&!L.done;T++,L=f.next()){z.index>T?(D=z,z=null):D=z.sibling;var Z=g(p,z,L.value,j);if(Z===null){z===null&&(z=D);break}e&&z&&Z.alternate===null&&t(p,z),u=s(Z,u,T),w===null?v=Z:w.sibling=Z,w=Z,z=D}if(L.done)return n(p,z),ue&&Yt(p,T),v;if(z===null){for(;!L.done;T++,L=f.next())L=y(p,L.value,j),L!==null&&(u=s(L,u,T),w===null?v=L:w.sibling=L,w=L);return ue&&Yt(p,T),v}for(z=r(p,z);!L.done;T++,L=f.next())L=k(z,p,T,L.value,j),L!==null&&(e&&L.alternate!==null&&z.delete(L.key===null?T:L.key),u=s(L,u,T),w===null?v=L:w.sibling=L,w=L);return e&&z.forEach(function(U){return t(p,U)}),ue&&Yt(p,T),v}function N(p,u,f,j){if(typeof f=="object"&&f!==null&&f.type===xn&&f.key===null&&(f=f.props.children),typeof f=="object"&&f!==null){switch(f.$$typeof){case $r:e:{for(var v=f.key,w=u;w!==null;){if(w.key===v){if(v=f.type,v===xn){if(w.tag===7){n(p,w.sibling),u=i(w,f.props.children),u.return=p,p=u;break e}}else if(w.elementType===v||typeof v=="object"&&v!==null&&v.$$typeof===Pt&&ha(v)===w.type){n(p,w.sibling),u=i(w,f.props),u.ref=Zn(p,w,f),u.return=p,p=u;break e}n(p,w);break}else t(p,w);w=w.sibling}f.type===xn?(u=rn(f.props.children,p.mode,j,f.key),u.return=p,p=u):(j=ml(f.type,f.key,f.props,null,p.mode,j),j.ref=Zn(p,u,f),j.return=p,p=j)}return o(p);case hn:e:{for(w=f.key;u!==null;){if(u.key===w)if(u.tag===4&&u.stateNode.containerInfo===f.containerInfo&&u.stateNode.implementation===f.implementation){n(p,u.sibling),u=i(u,f.children||[]),u.return=p,p=u;break e}else{n(p,u);break}else t(p,u);u=u.sibling}u=Di(f,p.mode,j),u.return=p,p=u}return o(p);case Pt:return w=f._init,N(p,u,w(f._payload),j)}if(rr(f))return S(p,u,f,j);if(Qn(f))return m(p,u,f,j);nl(p,f)}return typeof f=="string"&&f!==""||typeof f=="number"?(f=""+f,u!==null&&u.tag===6?(n(p,u.sibling),u=i(u,f),u.return=p,p=u):(n(p,u),u=Mi(f,p.mode,j),u.return=p,p=u),o(p)):n(p,u)}return N}var Fn=tu(!0),nu=tu(!1),_l=Kt(null),Ll=null,Sn=null,eo=null;function to(){eo=Sn=Ll=null}function no(e){var t=_l.current;ce(_l),e._currentValue=t}function fs(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===n)break;e=e.return}}function Nn(e,t){Ll=e,eo=Sn=null,e=e.dependencies,e!==null&&e.firstContext!==null&&(e.lanes&t&&(Re=!0),e.firstContext=null)}function Ze(e){var t=e._currentValue;if(eo!==e)if(e={context:e,memoizedValue:t,next:null},Sn===null){if(Ll===null)throw Error(_(308));Sn=e,Ll.dependencies={lanes:0,firstContext:e}}else Sn=Sn.next=e;return t}var en=null;function ro(e){en===null?en=[e]:en.push(e)}function ru(e,t,n,r){var i=t.interleaved;return i===null?(n.next=n,ro(t)):(n.next=i.next,i.next=n),t.interleaved=n,kt(e,r)}function kt(e,t){e.lanes|=t;var n=e.alternate;for(n!==null&&(n.lanes|=t),n=e,e=e.return;e!==null;)e.childLanes|=t,n=e.alternate,n!==null&&(n.childLanes|=t),n=e,e=e.return;return n.tag===3?n.stateNode:null}var Et=!1;function lo(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function lu(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function yt(e,t){return{eventTime:e,lane:t,tag:0,payload:null,callback:null,next:null}}function At(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,ne&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,kt(e,n)}return i=r.interleaved,i===null?(t.next=t,ro(r)):(t.next=i.next,i.next=t),r.interleaved=t,kt(e,n)}function pl(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194240)!==0)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vs(e,n)}}function xa(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,s=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};s===null?i=s=o:s=s.next=o,n=n.next}while(n!==null);s===null?i=s=t:s=s.next=t}else i=s=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:s,shared:r.shared,effects:r.effects},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}function Ml(e,t,n,r){var i=e.updateQueue;Et=!1;var s=i.firstBaseUpdate,o=i.lastBaseUpdate,a=i.shared.pending;if(a!==null){i.shared.pending=null;var c=a,d=c.next;c.next=null,o===null?s=d:o.next=d,o=c;var x=e.alternate;x!==null&&(x=x.updateQueue,a=x.lastBaseUpdate,a!==o&&(a===null?x.firstBaseUpdate=d:a.next=d,x.lastBaseUpdate=c))}if(s!==null){var y=i.baseState;o=0,x=d=c=null,a=s;do{var g=a.lane,k=a.eventTime;if((r&g)===g){x!==null&&(x=x.next={eventTime:k,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var S=e,m=a;switch(g=t,k=n,m.tag){case 1:if(S=m.payload,typeof S=="function"){y=S.call(k,y,g);break e}y=S;break e;case 3:S.flags=S.flags&-65537|128;case 0:if(S=m.payload,g=typeof S=="function"?S.call(k,y,g):S,g==null)break e;y=fe({},y,g);break e;case 2:Et=!0}}a.callback!==null&&a.lane!==0&&(e.flags|=64,g=i.effects,g===null?i.effects=[a]:g.push(a))}else k={eventTime:k,lane:g,tag:a.tag,payload:a.payload,callback:a.callback,next:null},x===null?(d=x=k,c=y):x=x.next=k,o|=g;if(a=a.next,a===null){if(a=i.shared.pending,a===null)break;g=a,a=g.next,g.next=null,i.lastBaseUpdate=g,i.shared.pending=null}}while(!0);if(x===null&&(c=y),i.baseState=c,i.firstBaseUpdate=d,i.lastBaseUpdate=x,t=i.shared.interleaved,t!==null){i=t;do o|=i.lane,i=i.next;while(i!==t)}else s===null&&(i.shared.lanes=0);an|=o,e.lanes=o,e.memoizedState=y}}function ga(e,t,n){if(e=t.effects,t.effects=null,e!==null)for(t=0;t<e.length;t++){var r=e[t],i=r.callback;if(i!==null){if(r.callback=null,r=n,typeof i!="function")throw Error(_(191,i));i.call(r)}}}var Rr={},dt=Kt(Rr),zr=Kt(Rr),Tr=Kt(Rr);function tn(e){if(e===Rr)throw Error(_(174));return e}function io(e,t){switch(oe(Tr,t),oe(zr,e),oe(dt,Rr),e=t.nodeType,e){case 9:case 11:t=(t=t.documentElement)?t.namespaceURI:Qi(null,"");break;default:e=e===8?t.parentNode:t,t=e.namespaceURI||null,e=e.tagName,t=Qi(t,e)}ce(dt),oe(dt,t)}function An(){ce(dt),ce(zr),ce(Tr)}function iu(e){tn(Tr.current);var t=tn(dt.current),n=Qi(t,e.type);t!==n&&(oe(zr,e),oe(dt,n))}function so(e){zr.current===e&&(ce(dt),ce(zr))}var de=Kt(0);function Dl(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||n.data==="$?"||n.data==="$!"))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==void 0){if(t.flags&128)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 Pi=[];function oo(){for(var e=0;e<Pi.length;e++)Pi[e]._workInProgressVersionPrimary=null;Pi.length=0}var fl=wt.ReactCurrentDispatcher,Ei=wt.ReactCurrentBatchConfig,on=0,pe=null,ve=null,je=null,Rl=!1,dr=!1,Pr=0,f1=0;function Te(){throw Error(_(321))}function ao(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!st(e[n],t[n]))return!1;return!0}function co(e,t,n,r,i,s){if(on=s,pe=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,fl.current=e===null||e.memoizedState===null?y1:m1,e=n(r,i),dr){s=0;do{if(dr=!1,Pr=0,25<=s)throw Error(_(301));s+=1,je=ve=null,t.updateQueue=null,fl.current=v1,e=n(r,i)}while(dr)}if(fl.current=Fl,t=ve!==null&&ve.next!==null,on=0,je=ve=pe=null,Rl=!1,t)throw Error(_(300));return e}function uo(){var e=Pr!==0;return Pr=0,e}function at(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?pe.memoizedState=je=e:je=je.next=e,je}function qe(){if(ve===null){var e=pe.alternate;e=e!==null?e.memoizedState:null}else e=ve.next;var t=je===null?pe.memoizedState:je.next;if(t!==null)je=t,ve=e;else{if(e===null)throw Error(_(310));ve=e,e={memoizedState:ve.memoizedState,baseState:ve.baseState,baseQueue:ve.baseQueue,queue:ve.queue,next:null},je===null?pe.memoizedState=je=e:je=je.next=e}return je}function Er(e,t){return typeof t=="function"?t(e):t}function Ni(e){var t=qe(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=ve,i=r.baseQueue,s=n.pending;if(s!==null){if(i!==null){var o=i.next;i.next=s.next,s.next=o}r.baseQueue=i=s,n.pending=null}if(i!==null){s=i.next,r=r.baseState;var a=o=null,c=null,d=s;do{var x=d.lane;if((on&x)===x)c!==null&&(c=c.next={lane:0,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null}),r=d.hasEagerState?d.eagerState:e(r,d.action);else{var y={lane:x,action:d.action,hasEagerState:d.hasEagerState,eagerState:d.eagerState,next:null};c===null?(a=c=y,o=r):c=c.next=y,pe.lanes|=x,an|=x}d=d.next}while(d!==null&&d!==s);c===null?o=r:c.next=a,st(r,t.memoizedState)||(Re=!0),t.memoizedState=r,t.baseState=o,t.baseQueue=c,n.lastRenderedState=r}if(e=n.interleaved,e!==null){i=e;do s=i.lane,pe.lanes|=s,an|=s,i=i.next;while(i!==e)}else i===null&&(n.lanes=0);return[t.memoizedState,n.dispatch]}function Ii(e){var t=qe(),n=t.queue;if(n===null)throw Error(_(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,s=t.memoizedState;if(i!==null){n.pending=null;var o=i=i.next;do s=e(s,o.action),o=o.next;while(o!==i);st(s,t.memoizedState)||(Re=!0),t.memoizedState=s,t.baseQueue===null&&(t.baseState=s),n.lastRenderedState=s}return[s,r]}function su(){}function ou(e,t){var n=pe,r=qe(),i=t(),s=!st(r.memoizedState,i);if(s&&(r.memoizedState=i,Re=!0),r=r.queue,po(uu.bind(null,n,r,e),[e]),r.getSnapshot!==t||s||je!==null&&je.memoizedState.tag&1){if(n.flags|=2048,Nr(9,cu.bind(null,n,r,i,t),void 0,null),we===null)throw Error(_(349));on&30||au(n,t,i)}return i}function au(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function cu(e,t,n,r){t.value=n,t.getSnapshot=r,du(t)&&pu(e)}function uu(e,t,n){return n(function(){du(t)&&pu(e)})}function du(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!st(e,n)}catch{return!0}}function pu(e){var t=kt(e,1);t!==null&&it(t,e,1,-1)}function ya(e){var t=at();return typeof e=="function"&&(e=e()),t.memoizedState=t.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Er,lastRenderedState:e},t.queue=e,e=e.dispatch=g1.bind(null,pe,e),[t.memoizedState,e]}function Nr(e,t,n,r){return e={tag:e,create:t,destroy:n,deps:r,next:null},t=pe.updateQueue,t===null?(t={lastEffect:null,stores:null},pe.updateQueue=t,t.lastEffect=e.next=e):(n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e)),e}function fu(){return qe().memoizedState}function hl(e,t,n,r){var i=at();pe.flags|=e,i.memoizedState=Nr(1|t,n,void 0,r===void 0?null:r)}function Jl(e,t,n,r){var i=qe();r=r===void 0?null:r;var s=void 0;if(ve!==null){var o=ve.memoizedState;if(s=o.destroy,r!==null&&ao(r,o.deps)){i.memoizedState=Nr(t,n,s,r);return}}pe.flags|=e,i.memoizedState=Nr(1|t,n,s,r)}function ma(e,t){return hl(8390656,8,e,t)}function po(e,t){return Jl(2048,8,e,t)}function hu(e,t){return Jl(4,2,e,t)}function xu(e,t){return Jl(4,4,e,t)}function gu(e,t){if(typeof t=="function")return e=e(),t(e),function(){t(null)};if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function yu(e,t,n){return n=n!=null?n.concat([e]):null,Jl(4,4,gu.bind(null,t,e),n)}function fo(){}function mu(e,t){var n=qe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ao(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function vu(e,t){var n=qe();t=t===void 0?null:t;var r=n.memoizedState;return r!==null&&t!==null&&ao(t,r[1])?r[0]:(e=e(),n.memoizedState=[e,t],e)}function ku(e,t,n){return on&21?(st(n,t)||(n=bc(),pe.lanes|=n,an|=n,e.baseState=!0),t):(e.baseState&&(e.baseState=!1,Re=!0),e.memoizedState=n)}function h1(e,t){var n=ie;ie=n!==0&&4>n?n:4,e(!0);var r=Ei.transition;Ei.transition={};try{e(!1),t()}finally{ie=n,Ei.transition=r}}function ju(){return qe().memoizedState}function x1(e,t,n){var r=Wt(e);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},wu(e))Su(t,n);else if(n=ru(e,t,n,r),n!==null){var i=_e();it(n,e,r,i),Cu(n,t,r)}}function g1(e,t,n){var r=Wt(e),i={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(wu(e))Su(t,i);else{var s=e.alternate;if(e.lanes===0&&(s===null||s.lanes===0)&&(s=t.lastRenderedReducer,s!==null))try{var o=t.lastRenderedState,a=s(o,n);if(i.hasEagerState=!0,i.eagerState=a,st(a,o)){var c=t.interleaved;c===null?(i.next=i,ro(t)):(i.next=c.next,c.next=i),t.interleaved=i;return}}catch{}finally{}n=ru(e,t,i,r),n!==null&&(i=_e(),it(n,e,r,i),Cu(n,t,r))}}function wu(e){var t=e.alternate;return e===pe||t!==null&&t===pe}function Su(e,t){dr=Rl=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Cu(e,t,n){if(n&4194240){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,Vs(e,n)}}var Fl={readContext:Ze,useCallback:Te,useContext:Te,useEffect:Te,useImperativeHandle:Te,useInsertionEffect:Te,useLayoutEffect:Te,useMemo:Te,useReducer:Te,useRef:Te,useState:Te,useDebugValue:Te,useDeferredValue:Te,useTransition:Te,useMutableSource:Te,useSyncExternalStore:Te,useId:Te,unstable_isNewReconciler:!1},y1={readContext:Ze,useCallback:function(e,t){return at().memoizedState=[e,t===void 0?null:t],e},useContext:Ze,useEffect:ma,useImperativeHandle:function(e,t,n){return n=n!=null?n.concat([e]):null,hl(4194308,4,gu.bind(null,t,e),n)},useLayoutEffect:function(e,t){return hl(4194308,4,e,t)},useInsertionEffect:function(e,t){return hl(4,2,e,t)},useMemo:function(e,t){var n=at();return t=t===void 0?null:t,e=e(),n.memoizedState=[e,t],e},useReducer:function(e,t,n){var r=at();return t=n!==void 0?n(t):t,r.memoizedState=r.baseState=t,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:t},r.queue=e,e=e.dispatch=x1.bind(null,pe,e),[r.memoizedState,e]},useRef:function(e){var t=at();return e={current:e},t.memoizedState=e},useState:ya,useDebugValue:fo,useDeferredValue:function(e){return at().memoizedState=e},useTransition:function(){var e=ya(!1),t=e[0];return e=h1.bind(null,e[1]),at().memoizedState=e,[t,e]},useMutableSource:function(){},useSyncExternalStore:function(e,t,n){var r=pe,i=at();if(ue){if(n===void 0)throw Error(_(407));n=n()}else{if(n=t(),we===null)throw Error(_(349));on&30||au(r,t,n)}i.memoizedState=n;var s={value:n,getSnapshot:t};return i.queue=s,ma(uu.bind(null,r,s,e),[e]),r.flags|=2048,Nr(9,cu.bind(null,r,s,n,t),void 0,null),n},useId:function(){var e=at(),t=we.identifierPrefix;if(ue){var n=gt,r=xt;n=(r&~(1<<32-lt(r)-1)).toString(32)+n,t=":"+t+"R"+n,n=Pr++,0<n&&(t+="H"+n.toString(32)),t+=":"}else n=f1++,t=":"+t+"r"+n.toString(32)+":";return e.memoizedState=t},unstable_isNewReconciler:!1},m1={readContext:Ze,useCallback:mu,useContext:Ze,useEffect:po,useImperativeHandle:yu,useInsertionEffect:hu,useLayoutEffect:xu,useMemo:vu,useReducer:Ni,useRef:fu,useState:function(){return Ni(Er)},useDebugValue:fo,useDeferredValue:function(e){var t=qe();return ku(t,ve.memoizedState,e)},useTransition:function(){var e=Ni(Er)[0],t=qe().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:ou,useId:ju,unstable_isNewReconciler:!1},v1={readContext:Ze,useCallback:mu,useContext:Ze,useEffect:po,useImperativeHandle:yu,useInsertionEffect:hu,useLayoutEffect:xu,useMemo:vu,useReducer:Ii,useRef:fu,useState:function(){return Ii(Er)},useDebugValue:fo,useDeferredValue:function(e){var t=qe();return ve===null?t.memoizedState=e:ku(t,ve.memoizedState,e)},useTransition:function(){var e=Ii(Er)[0],t=qe().memoizedState;return[e,t]},useMutableSource:su,useSyncExternalStore:ou,useId:ju,unstable_isNewReconciler:!1};function tt(e,t){if(e&&e.defaultProps){t=fe({},t),e=e.defaultProps;for(var n in e)t[n]===void 0&&(t[n]=e[n]);return t}return t}function hs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:fe({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Zl={isMounted:function(e){return(e=e._reactInternals)?pn(e)===e:!1},enqueueSetState:function(e,t,n){e=e._reactInternals;var r=_e(),i=Wt(e),s=yt(r,i);s.payload=t,n!=null&&(s.callback=n),t=At(e,s,i),t!==null&&(it(t,e,i,r),pl(t,e,i))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=_e(),i=Wt(e),s=yt(r,i);s.tag=1,s.payload=t,n!=null&&(s.callback=n),t=At(e,s,i),t!==null&&(it(t,e,i,r),pl(t,e,i))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=_e(),r=Wt(e),i=yt(n,r);i.tag=2,t!=null&&(i.callback=t),t=At(e,i,r),t!==null&&(it(t,e,r,n),pl(t,e,r))}};function va(e,t,n,r,i,s,o){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,s,o):t.prototype&&t.prototype.isPureReactComponent?!wr(n,r)||!wr(i,s):!0}function bu(e,t,n){var r=!1,i=Ht,s=t.contextType;return typeof s=="object"&&s!==null?s=Ze(s):(i=Ae(t)?ln:Ne.current,r=t.contextTypes,s=(r=r!=null)?Dn(e,i):Ht),t=new t(n,s),e.memoizedState=t.state!==null&&t.state!==void 0?t.state:null,t.updater=Zl,e.stateNode=t,t._reactInternals=e,r&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=i,e.__reactInternalMemoizedMaskedChildContext=s),t}function ka(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Zl.enqueueReplaceState(t,t.state,null)}function xs(e,t,n,r){var i=e.stateNode;i.props=n,i.state=e.memoizedState,i.refs={},lo(e);var s=t.contextType;typeof s=="object"&&s!==null?i.context=Ze(s):(s=Ae(t)?ln:Ne.current,i.context=Dn(e,s)),i.state=e.memoizedState,s=t.getDerivedStateFromProps,typeof s=="function"&&(hs(e,t,s,n),i.state=e.memoizedState),typeof t.getDerivedStateFromProps=="function"||typeof i.getSnapshotBeforeUpdate=="function"||typeof i.UNSAFE_componentWillMount!="function"&&typeof i.componentWillMount!="function"||(t=i.state,typeof i.componentWillMount=="function"&&i.componentWillMount(),typeof i.UNSAFE_componentWillMount=="function"&&i.UNSAFE_componentWillMount(),t!==i.state&&Zl.enqueueReplaceState(i,i.state,null),Ml(e,n,i,r),i.state=e.memoizedState),typeof i.componentDidMount=="function"&&(e.flags|=4194308)}function On(e,t){try{var n="",r=t;do n+=Qd(r),r=r.return;while(r);var i=n}catch(s){i=`
39
39
  Error generating stack: `+s.message+`
40
- `+s.stack}return{value:e,source:t,stack:i,digest:null}}function _i(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function ys(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var k1=typeof WeakMap=="function"?WeakMap:Map;function zu(e,t,n){n=gt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ol||(Ol=!0,zs=r),ys(e,t)},n}function Tu(e,t,n){n=gt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){ys(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){ys(e,t),typeof r!="function"&&(Ot===null?Ot=new Set([this]):Ot.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ja(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new k1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=L1.bind(null,e,t,n),t.then(e,e))}function wa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sa(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=gt(-1,1),t.tag=2,At(n,t,1))),n.lanes|=1),e)}var j1=wt.ReactCurrentOwner,Re=!1;function Ie(e,t,n,r){t.child=e===null?nu(t,null,n,r):Fn(t,e.child,n,r)}function Ca(e,t,n,r,i){n=n.render;var s=t.ref;return Nn(t,i),r=co(e,t,n,r,s,i),n=uo(),e!==null&&!Re?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jt(e,t,i)):(ue&&n&&Js(t),t.flags|=1,Ie(e,t,r,i),t.child)}function ba(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!jo(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Pu(e,t,s,r,i)):(e=ml(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:wr,n(o,r)&&e.ref===t.ref)return jt(e,t,i)}return t.flags|=1,e=Bt(s,r),e.ref=t.ref,e.return=t,t.child=e}function Pu(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(wr(s,r)&&e.ref===t.ref)if(Re=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Re=!0);else return t.lanes=e.lanes,jt(e,t,i)}return gs(e,t,n,r,i)}function Eu(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(bn,Ue),Ue|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,oe(bn,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,oe(bn,Ue),Ue|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,oe(bn,Ue),Ue|=r;return Ie(e,t,i,n),t.child}function Nu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function gs(e,t,n,r,i){var s=Ae(n)?ln:Ne.current;return s=Dn(t,s),Nn(t,i),n=co(e,t,n,r,s,i),r=uo(),e!==null&&!Re?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jt(e,t,i)):(ue&&r&&Js(t),t.flags|=1,Ie(e,t,n,i),t.child)}function za(e,t,n,r,i){if(Ae(n)){var s=!0;El(t)}else s=!1;if(Nn(t,i),t.stateNode===null)xl(e,t),bu(t,n,r),xs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Ze(d):(d=Ae(n)?ln:Ne.current,d=Dn(t,d));var x=n.getDerivedStateFromProps,g=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function";g||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==d)&&ka(t,o,r,d),Et=!1;var y=t.memoizedState;o.state=y,Ll(t,r,o,i),c=t.memoizedState,a!==r||y!==c||Fe.current||Et?(typeof x=="function"&&(hs(t,n,x,r),c=t.memoizedState),(a=Et||va(t,n,a,r,y,c,d))?(g||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=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,lu(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:tt(t.type,a),o.props=d,g=t.pendingProps,y=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Ze(c):(c=Ae(n)?ln:Ne.current,c=Dn(t,c));var k=n.getDerivedStateFromProps;(x=typeof k=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==g||y!==c)&&ka(t,o,r,c),Et=!1,y=t.memoizedState,o.state=y,Ll(t,r,o,i);var S=t.memoizedState;a!==g||y!==S||Fe.current||Et?(typeof k=="function"&&(hs(t,n,k,r),S=t.memoizedState),(d=Et||va(t,n,d,r,y,S,c)||!1)?(x||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,S,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,S,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=S),o.props=r,o.state=S,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&y===e.memoizedState||(t.flags|=1024),r=!1)}return ms(e,t,n,r,s,i)}function ms(e,t,n,r,i,s){Nu(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&da(t,n,!1),jt(e,t,s);r=t.stateNode,j1.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Fn(t,e.child,null,s),t.child=Fn(t,null,a,s)):Ie(e,t,a,s),t.memoizedState=r.state,i&&da(t,n,!0),t.child}function Iu(e){var t=e.stateNode;t.pendingContext?ua(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ua(e,t.context,!1),io(e,t.containerInfo)}function Ta(e,t,n,r,i){return Rn(),qs(i),t.flags|=256,Ie(e,t,n,r),t.child}var vs={dehydrated:null,treeContext:null,retryLane:0};function ks(e){return{baseLanes:e,cachePool:null,transitions:null}}function _u(e,t,n){var r=t.pendingProps,i=de.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),oe(de,i&1),e===null)return ps(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ti(o,r,0,null),e=rn(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ks(n),t.memoizedState=vs,e):ho(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return w1(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Bt(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Bt(a,s):(s=rn(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?ks(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=vs,r}return s=e.child,e=s.sibling,r=Bt(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ho(e,t){return t=ti({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rl(e,t,n,r){return r!==null&&qs(r),Fn(t,e.child,null,n),e=ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function w1(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=_i(Error(_(422))),rl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=ti({mode:"visible",children:r.children},i,0,null),s=rn(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Fn(t,e.child,null,o),t.child.memoizedState=ks(o),t.memoizedState=vs,s);if(!(t.mode&1))return rl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(_(419)),r=_i(s,r,void 0),rl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Re||a){if(r=we,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,kt(e,i),it(r,e,i,-1))}return ko(),r=_i(Error(_(421))),rl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=D1.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Ve=Ft(i.nextSibling),He=t,ue=!0,rt=null,e!==null&&(Ge[Xe++]=xt,Ge[Xe++]=yt,Ge[Xe++]=sn,xt=e.id,yt=e.overflow,sn=t),t=ho(t,r.children),t.flags|=4096,t)}function Pa(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fs(e.return,t,n)}function Mi(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Mu(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ie(e,t,r.children,n),r=de.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pa(e,n,t);else if(e.tag===19)Pa(e,n,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}r&=1}if(oe(de,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Dl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Mi(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Dl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Mi(t,!0,n,null,s);break;case"together":Mi(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),an|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=Bt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function S1(e,t,n){switch(t.tag){case 3:Iu(t),Rn();break;case 5:iu(t);break;case 1:Ae(t.type)&&El(t);break;case 4:io(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;oe(_l,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(oe(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?_u(e,t,n):(oe(de,de.current&1),e=jt(e,t,n),e!==null?e.sibling:null);oe(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Mu(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,Eu(e,t,n)}return jt(e,t,n)}var Lu,js,Du,Ru;Lu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};js=function(){};Du=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,tn(dt.current);var s=null;switch(n){case"input":i=Vi(e,i),r=Vi(e,r),s=[];break;case"select":i=fe({},i,{value:void 0}),r=fe({},r,{value:void 0}),s=[];break;case"textarea":i=Ki(e,i),r=Ki(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Tl)}Gi(n,r);var o;n=null;for(d in i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var a=i[d];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(xr.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(a=i!=null?i[d]:void 0,r.hasOwnProperty(d)&&c!==a&&(c!=null||a!=null))if(d==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(xr.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ae("scroll",e),s||a===c||(s=[])):(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}};Ru=function(e,t,n,r){n!==r&&(t.flags|=4)};function qn(e,t){if(!ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function C1(e,t,n){var r=t.pendingProps;switch(Zs(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Ae(t.type)&&Pl(),Pe(t),null;case 3:return r=t.stateNode,An(),ce(Fe),ce(Ne),oo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rt!==null&&(Es(rt),rt=null))),js(e,t),Pe(t),null;case 5:so(t);var i=tn(Tr.current);if(n=t.type,e!==null&&t.stateNode!=null)Du(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Pe(t),null}if(e=tn(dt.current),tl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ct]=t,r[br]=s,e=(t.mode&1)!==0,n){case"dialog":ae("cancel",r),ae("close",r);break;case"iframe":case"object":case"embed":ae("load",r);break;case"video":case"audio":for(i=0;i<ir.length;i++)ae(ir[i],r);break;case"source":ae("error",r);break;case"img":case"image":case"link":ae("error",r),ae("load",r);break;case"details":ae("toggle",r);break;case"input":Fo(r,s),ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ae("invalid",r);break;case"textarea":Oo(r,s),ae("invalid",r)}Gi(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&el(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&el(r.textContent,a,e),i=["children",""+a]):xr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ae("scroll",r)}switch(n){case"input":Kr(r),Ao(r,s,!0);break;case"textarea":Kr(r),Wo(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Tl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=uc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ct]=t,e[br]=r,Lu(e,t,!1,!1),t.stateNode=e;e:{switch(o=Xi(n,r),n){case"dialog":ae("cancel",e),ae("close",e),i=r;break;case"iframe":case"object":case"embed":ae("load",e),i=r;break;case"video":case"audio":for(i=0;i<ir.length;i++)ae(ir[i],e);i=r;break;case"source":ae("error",e),i=r;break;case"img":case"image":case"link":ae("error",e),ae("load",e),i=r;break;case"details":ae("toggle",e),i=r;break;case"input":Fo(e,r),i=Vi(e,r),ae("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=fe({},r,{value:void 0}),ae("invalid",e);break;case"textarea":Oo(e,r),i=Ki(e,r),ae("invalid",e);break;default:i=r}Gi(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?fc(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dc(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&yr(e,c):typeof c=="number"&&yr(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(xr.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ae("scroll",e):c!=null&&Fs(e,s,c,o))}switch(n){case"input":Kr(e),Ao(e,r,!1);break;case"textarea":Kr(e),Wo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vt(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?zn(e,!!r.multiple,s,!1):r.defaultValue!=null&&zn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Tl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pe(t),null;case 6:if(e&&t.stateNode!=null)Ru(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=tn(Tr.current),tn(dt.current),tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[ct]=t,(s=r.nodeValue!==n)&&(e=He,e!==null))switch(e.tag){case 3:el(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&el(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ct]=t,t.stateNode=r}return Pe(t),null;case 13:if(ce(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ue&&Ve!==null&&t.mode&1&&!(t.flags&128))eu(),Rn(),t.flags|=98560,s=!1;else if(s=tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(_(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(_(317));s[ct]=t}else Rn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pe(t),s=!1}else rt!==null&&(Es(rt),rt=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?ke===0&&(ke=3):ko())),t.updateQueue!==null&&(t.flags|=4),Pe(t),null);case 4:return An(),js(e,t),e===null&&Sr(t.stateNode.containerInfo),Pe(t),null;case 10:return no(t.type._context),Pe(t),null;case 17:return Ae(t.type)&&Pl(),Pe(t),null;case 19:if(ce(de),s=t.memoizedState,s===null)return Pe(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)qn(s,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Dl(e),o!==null){for(t.flags|=128,qn(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return oe(de,de.current&1|2),t.child}e=e.sibling}s.tail!==null&&xe()>Wn&&(t.flags|=128,r=!0,qn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Dl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ue)return Pe(t),null}else 2*xe()-s.renderingStartTime>Wn&&n!==1073741824&&(t.flags|=128,r=!0,qn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xe(),t.sibling=null,n=de.current,oe(de,r?n&1|2:n&1),t):(Pe(t),null);case 22:case 23:return vo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ue&1073741824&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function b1(e,t){switch(Zs(t),t.tag){case 1:return Ae(t.type)&&Pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(),ce(Fe),ce(Ne),oo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return so(t),null;case 13:if(ce(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));Rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(de),null;case 4:return An(),null;case 10:return no(t.type._context),null;case 22:case 23:return vo(),null;case 24:return null;default:return null}}var ll=!1,Ee=!1,z1=typeof WeakSet=="function"?WeakSet:Set,O=null;function Cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){he(e,t,r)}else n.current=null}function ws(e,t,n){try{n()}catch(r){he(e,t,r)}}var Ea=!1;function T1(e,t){if(is=Cl,e=Bc(),Ys(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,d=0,x=0,g=e,y=null;t:for(;;){for(var k;g!==n||i!==0&&g.nodeType!==3||(a=o+i),g!==s||r!==0&&g.nodeType!==3||(c=o+r),g.nodeType===3&&(o+=g.nodeValue.length),(k=g.firstChild)!==null;)y=g,g=k;for(;;){if(g===e)break t;if(y===n&&++d===i&&(a=o),y===s&&++x===r&&(c=o),(k=g.nextSibling)!==null)break;g=y,y=g.parentNode}g=k}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ss={focusedElem:e,selectionRange:n},Cl=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var m=S.memoizedProps,N=S.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?m:tt(t.type,m),N);p.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(j){he(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return S=Ea,Ea=!1,S}function pr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&ws(t,n,s)}i=i.next}while(i!==r)}}function ql(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ss(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Fu(e){var t=e.alternate;t!==null&&(e.alternate=null,Fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ct],delete t[br],delete t[cs],delete t[c1],delete t[u1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Au(e){return e.tag===5||e.tag===3||e.tag===4}function Na(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Au(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.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 Cs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tl));else if(r!==4&&(e=e.child,e!==null))for(Cs(e,t,n),e=e.sibling;e!==null;)Cs(e,t,n),e=e.sibling}function bs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bs(e,t,n),e=e.sibling;e!==null;)bs(e,t,n),e=e.sibling}var Ce=null,nt=!1;function Tt(e,t,n){for(n=n.child;n!==null;)Ou(e,t,n),n=n.sibling}function Ou(e,t,n){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount($l,n)}catch{}switch(n.tag){case 5:Ee||Cn(n,t);case 6:var r=Ce,i=nt;Ce=null,Tt(e,t,n),Ce=r,nt=i,Ce!==null&&(nt?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(nt?(e=Ce,n=n.stateNode,e.nodeType===8?zi(e.parentNode,n):e.nodeType===1&&zi(e,n),kr(e)):zi(Ce,n.stateNode));break;case 4:r=Ce,i=nt,Ce=n.stateNode.containerInfo,nt=!0,Tt(e,t,n),Ce=r,nt=i;break;case 0:case 11:case 14:case 15:if(!Ee&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ws(n,t,o),i=i.next}while(i!==r)}Tt(e,t,n);break;case 1:if(!Ee&&(Cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){he(n,t,a)}Tt(e,t,n);break;case 21:Tt(e,t,n);break;case 22:n.mode&1?(Ee=(r=Ee)||n.memoizedState!==null,Tt(e,t,n),Ee=r):Tt(e,t,n);break;default:Tt(e,t,n)}}function Ia(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new z1),t.forEach(function(r){var i=R1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function et(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ce=a.stateNode,nt=!1;break e;case 3:Ce=a.stateNode.containerInfo,nt=!0;break e;case 4:Ce=a.stateNode.containerInfo,nt=!0;break e}a=a.return}if(Ce===null)throw Error(_(160));Ou(s,o,i),Ce=null,nt=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(d){he(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling}function Wu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(et(t,e),ot(e),r&4){try{pr(3,e,e.return),ql(3,e)}catch(m){he(e,e.return,m)}try{pr(5,e,e.return)}catch(m){he(e,e.return,m)}}break;case 1:et(t,e),ot(e),r&512&&n!==null&&Cn(n,n.return);break;case 5:if(et(t,e),ot(e),r&512&&n!==null&&Cn(n,n.return),e.flags&32){var i=e.stateNode;try{yr(i,"")}catch(m){he(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&ac(i,s),Xi(a,o);var d=Xi(a,s);for(o=0;o<c.length;o+=2){var x=c[o],g=c[o+1];x==="style"?fc(i,g):x==="dangerouslySetInnerHTML"?dc(i,g):x==="children"?yr(i,g):Fs(i,x,g,d)}switch(a){case"input":Hi(i,s);break;case"textarea":cc(i,s);break;case"select":var y=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var k=s.value;k!=null?zn(i,!!s.multiple,k,!1):y!==!!s.multiple&&(s.defaultValue!=null?zn(i,!!s.multiple,s.defaultValue,!0):zn(i,!!s.multiple,s.multiple?[]:"",!1))}i[br]=s}catch(m){he(e,e.return,m)}}break;case 6:if(et(t,e),ot(e),r&4){if(e.stateNode===null)throw Error(_(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){he(e,e.return,m)}}break;case 3:if(et(t,e),ot(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kr(t.containerInfo)}catch(m){he(e,e.return,m)}break;case 4:et(t,e),ot(e);break;case 13:et(t,e),ot(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(go=xe())),r&4&&Ia(e);break;case 22:if(x=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||x,et(t,e),Ee=d):et(t,e),ot(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!x&&e.mode&1)for(O=e,x=e.child;x!==null;){for(g=O=x;O!==null;){switch(y=O,k=y.child,y.tag){case 0:case 11:case 14:case 15:pr(4,y,y.return);break;case 1:Cn(y,y.return);var S=y.stateNode;if(typeof S.componentWillUnmount=="function"){r=y,n=y.return;try{t=r,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(m){he(r,n,m)}}break;case 5:Cn(y,y.return);break;case 22:if(y.memoizedState!==null){Ma(g);continue}}k!==null?(k.return=y,O=k):Ma(g)}x=x.sibling}e:for(x=null,g=e;;){if(g.tag===5){if(x===null){x=g;try{i=g.stateNode,d?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=g.stateNode,c=g.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=pc("display",o))}catch(m){he(e,e.return,m)}}}else if(g.tag===6){if(x===null)try{g.stateNode.nodeValue=d?"":g.memoizedProps}catch(m){he(e,e.return,m)}}else if((g.tag!==22&&g.tag!==23||g.memoizedState===null||g===e)&&g.child!==null){g.child.return=g,g=g.child;continue}if(g===e)break e;for(;g.sibling===null;){if(g.return===null||g.return===e)break e;x===g&&(x=null),g=g.return}x===g&&(x=null),g.sibling.return=g.return,g=g.sibling}}break;case 19:et(t,e),ot(e),r&4&&Ia(e);break;case 21:break;default:et(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Au(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(yr(i,""),r.flags&=-33);var s=Na(e);bs(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Na(e);Cs(e,a,o);break;default:throw Error(_(161))}}catch(c){he(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function P1(e,t,n){O=e,Bu(e)}function Bu(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var i=O,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ll;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||Ee;a=ll;var d=Ee;if(ll=o,(Ee=c)&&!d)for(O=i;O!==null;)o=O,c=o.child,o.tag===22&&o.memoizedState!==null?La(i):c!==null?(c.return=o,O=c):La(i);for(;s!==null;)O=s,Bu(s),s=s.sibling;O=i,ll=a,Ee=d}_a(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,O=s):_a(e)}}function _a(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||ql(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ee)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:tt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ya(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ya(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var x=d.memoizedState;if(x!==null){var g=x.dehydrated;g!==null&&kr(g)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}Ee||t.flags&512&&Ss(t)}catch(y){he(t,t.return,y)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function Ma(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function La(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ql(4,t)}catch(c){he(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){he(t,i,c)}}var s=t.return;try{Ss(t)}catch(c){he(t,s,c)}break;case 5:var o=t.return;try{Ss(t)}catch(c){he(t,o,c)}}}catch(c){he(t,t.return,c)}if(t===e){O=null;break}var a=t.sibling;if(a!==null){a.return=t.return,O=a;break}O=t.return}}var E1=Math.ceil,Al=wt.ReactCurrentDispatcher,xo=wt.ReactCurrentOwner,Je=wt.ReactCurrentBatchConfig,ne=0,we=null,ge=null,be=0,Ue=0,bn=Kt(0),ke=0,Ir=null,an=0,ei=0,yo=0,fr=null,De=null,go=0,Wn=1/0,ft=null,Ol=!1,zs=null,Ot=null,il=!1,Mt=null,Wl=0,hr=0,Ts=null,yl=-1,gl=0;function _e(){return ne&6?xe():yl!==-1?yl:yl=xe()}function Wt(e){return e.mode&1?ne&2&&be!==0?be&-be:p1.transition!==null?(gl===0&&(gl=bc()),gl):(e=ie,e!==0||(e=window.event,e=e===void 0?16:_c(e.type)),e):1}function it(e,t,n,r){if(50<hr)throw hr=0,Ts=null,Error(_(185));Mr(e,n,r),(!(ne&2)||e!==we)&&(e===we&&(!(ne&2)&&(ei|=n),ke===4&&It(e,be)),Oe(e,r),n===1&&ne===0&&!(t.mode&1)&&(Wn=xe()+500,Yl&&Qt()))}function Oe(e,t){var n=e.callbackNode;pp(e,t);var r=Sl(e,e===we?be:0);if(r===0)n!==null&&Vo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Vo(n),t===1)e.tag===0?d1(Da.bind(null,e)):Jc(Da.bind(null,e)),o1(function(){!(ne&6)&&Qt()}),n=null;else{switch(zc(r)){case 1:n=Us;break;case 4:n=Sc;break;case 16:n=wl;break;case 536870912:n=Cc;break;default:n=wl}n=Xu(n,Uu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Uu(e,t){if(yl=-1,gl=0,ne&6)throw Error(_(327));var n=e.callbackNode;if(In()&&e.callbackNode!==n)return null;var r=Sl(e,e===we?be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Bl(e,r);else{t=r;var i=ne;ne|=2;var s=Hu();(we!==e||be!==t)&&(ft=null,Wn=xe()+500,nn(e,t));do try{_1();break}catch(a){Vu(e,a)}while(!0);to(),Al.current=s,ne=i,ge!==null?t=0:(we=null,be=0,t=ke)}if(t!==0){if(t===2&&(i=es(e),i!==0&&(r=i,t=Ps(e,i))),t===1)throw n=Ir,nn(e,0),It(e,r),Oe(e,xe()),n;if(t===6)It(e,r);else{if(i=e.current.alternate,!(r&30)&&!N1(i)&&(t=Bl(e,r),t===2&&(s=es(e),s!==0&&(r=s,t=Ps(e,s))),t===1))throw n=Ir,nn(e,0),It(e,r),Oe(e,xe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Jt(e,De,ft);break;case 3:if(It(e,r),(r&130023424)===r&&(t=go+500-xe(),10<t)){if(Sl(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=as(Jt.bind(null,e,De,ft),t);break}Jt(e,De,ft);break;case 4:if(It(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-lt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*E1(r/1960))-r,10<r){e.timeoutHandle=as(Jt.bind(null,e,De,ft),r);break}Jt(e,De,ft);break;case 5:Jt(e,De,ft);break;default:throw Error(_(329))}}}return Oe(e,xe()),e.callbackNode===n?Uu.bind(null,e):null}function Ps(e,t){var n=fr;return e.current.memoizedState.isDehydrated&&(nn(e,t).flags|=256),e=Bl(e,t),e!==2&&(t=De,De=n,t!==null&&Es(t)),e}function Es(e){De===null?De=e:De.push.apply(De,e)}function N1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!st(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 It(e,t){for(t&=~yo,t&=~ei,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-lt(t),r=1<<n;e[n]=-1,t&=~r}}function Da(e){if(ne&6)throw Error(_(327));In();var t=Sl(e,0);if(!(t&1))return Oe(e,xe()),null;var n=Bl(e,t);if(e.tag!==0&&n===2){var r=es(e);r!==0&&(t=r,n=Ps(e,r))}if(n===1)throw n=Ir,nn(e,0),It(e,t),Oe(e,xe()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jt(e,De,ft),Oe(e,xe()),null}function mo(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(Wn=xe()+500,Yl&&Qt())}}function cn(e){Mt!==null&&Mt.tag===0&&!(ne&6)&&In();var t=ne;ne|=1;var n=Je.transition,r=ie;try{if(Je.transition=null,ie=1,e)return e()}finally{ie=r,Je.transition=n,ne=t,!(ne&6)&&Qt()}}function vo(){Ue=bn.current,ce(bn)}function nn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,s1(n)),ge!==null)for(n=ge.return;n!==null;){var r=n;switch(Zs(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Pl();break;case 3:An(),ce(Fe),ce(Ne),oo();break;case 5:so(r);break;case 4:An();break;case 13:ce(de);break;case 19:ce(de);break;case 10:no(r.type._context);break;case 22:case 23:vo()}n=n.return}if(we=e,ge=e=Bt(e.current,null),be=Ue=t,ke=0,Ir=null,yo=ei=an=0,De=fr=null,en!==null){for(t=0;t<en.length;t++)if(n=en[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}en=null}return e}function Vu(e,t){do{var n=ge;try{if(to(),fl.current=Fl,Rl){for(var r=pe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rl=!1}if(on=0,je=ve=pe=null,dr=!1,Pr=0,xo.current=null,n===null||n.return===null){ke=1,Ir=t,ge=null;break}e:{var s=e,o=n.return,a=n,c=t;if(t=be,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,x=a,g=x.tag;if(!(x.mode&1)&&(g===0||g===11||g===15)){var y=x.alternate;y?(x.updateQueue=y.updateQueue,x.memoizedState=y.memoizedState,x.lanes=y.lanes):(x.updateQueue=null,x.memoizedState=null)}var k=wa(o);if(k!==null){k.flags&=-257,Sa(k,o,a,s,t),k.mode&1&&ja(s,d,t),t=k,c=d;var S=t.updateQueue;if(S===null){var m=new Set;m.add(c),t.updateQueue=m}else S.add(c);break e}else{if(!(t&1)){ja(s,d,t),ko();break e}c=Error(_(426))}}else if(ue&&a.mode&1){var N=wa(o);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Sa(N,o,a,s,t),qs(On(c,a));break e}}s=c=On(c,a),ke!==4&&(ke=2),fr===null?fr=[s]:fr.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=zu(s,c,t);xa(s,p);break e;case 1:a=c;var u=s.type,f=s.stateNode;if(!(s.flags&128)&&(typeof u.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ot===null||!Ot.has(f)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=Tu(s,a,t);xa(s,j);break e}}s=s.return}while(s!==null)}Ku(n)}catch(v){t=v,ge===n&&n!==null&&(ge=n=n.return);continue}break}while(!0)}function Hu(){var e=Al.current;return Al.current=Fl,e===null?Fl:e}function ko(){(ke===0||ke===3||ke===2)&&(ke=4),we===null||!(an&268435455)&&!(ei&268435455)||It(we,be)}function Bl(e,t){var n=ne;ne|=2;var r=Hu();(we!==e||be!==t)&&(ft=null,nn(e,t));do try{I1();break}catch(i){Vu(e,i)}while(!0);if(to(),ne=n,Al.current=r,ge!==null)throw Error(_(261));return we=null,be=0,ke}function I1(){for(;ge!==null;)$u(ge)}function _1(){for(;ge!==null&&!rp();)$u(ge)}function $u(e){var t=Gu(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?Ku(e):ge=t,xo.current=null}function Ku(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=b1(n,t),n!==null){n.flags&=32767,ge=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,ge=null;return}}else if(n=C1(n,t,Ue),n!==null){ge=n;return}if(t=t.sibling,t!==null){ge=t;return}ge=t=e}while(t!==null);ke===0&&(ke=5)}function Jt(e,t,n){var r=ie,i=Je.transition;try{Je.transition=null,ie=1,M1(e,t,n,r)}finally{Je.transition=i,ie=r}return null}function M1(e,t,n,r){do In();while(Mt!==null);if(ne&6)throw Error(_(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(fp(e,s),e===we&&(ge=we=null,be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||il||(il=!0,Xu(wl,function(){return In(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Je.transition,Je.transition=null;var o=ie;ie=1;var a=ne;ne|=4,xo.current=null,T1(e,n),Wu(n,e),qp(ss),Cl=!!is,ss=is=null,e.current=n,P1(n),lp(),ne=a,ie=o,Je.transition=s}else e.current=n;if(il&&(il=!1,Mt=e,Wl=i),s=e.pendingLanes,s===0&&(Ot=null),op(n.stateNode),Oe(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ol)throw Ol=!1,e=zs,zs=null,e;return Wl&1&&e.tag!==0&&In(),s=e.pendingLanes,s&1?e===Ts?hr++:(hr=0,Ts=e):hr=0,Qt(),null}function In(){if(Mt!==null){var e=zc(Wl),t=Je.transition,n=ie;try{if(Je.transition=null,ie=16>e?16:e,Mt===null)var r=!1;else{if(e=Mt,Mt=null,Wl=0,ne&6)throw Error(_(331));var i=ne;for(ne|=4,O=e.current;O!==null;){var s=O,o=s.child;if(O.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var d=a[c];for(O=d;O!==null;){var x=O;switch(x.tag){case 0:case 11:case 15:pr(8,x,s)}var g=x.child;if(g!==null)g.return=x,O=g;else for(;O!==null;){x=O;var y=x.sibling,k=x.return;if(Fu(x),x===d){O=null;break}if(y!==null){y.return=k,O=y;break}O=k}}}var S=s.alternate;if(S!==null){var m=S.child;if(m!==null){S.child=null;do{var N=m.sibling;m.sibling=null,m=N}while(m!==null)}}O=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,O=o;else e:for(;O!==null;){if(s=O,s.flags&2048)switch(s.tag){case 0:case 11:case 15:pr(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,O=p;break e}O=s.return}}var u=e.current;for(O=u;O!==null;){o=O;var f=o.child;if(o.subtreeFlags&2064&&f!==null)f.return=o,O=f;else e:for(o=u;O!==null;){if(a=O,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ql(9,a)}}catch(v){he(a,a.return,v)}if(a===o){O=null;break e}var j=a.sibling;if(j!==null){j.return=a.return,O=j;break e}O=a.return}}if(ne=i,Qt(),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot($l,e)}catch{}r=!0}return r}finally{ie=n,Je.transition=t}}return!1}function Ra(e,t,n){t=On(n,t),t=zu(e,t,1),e=At(e,t,1),t=_e(),e!==null&&(Mr(e,1,t),Oe(e,t))}function he(e,t,n){if(e.tag===3)Ra(e,e,n);else for(;t!==null;){if(t.tag===3){Ra(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ot===null||!Ot.has(r))){e=On(n,e),e=Tu(t,e,1),t=At(t,e,1),e=_e(),t!==null&&(Mr(t,1,e),Oe(t,e));break}}t=t.return}}function L1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,we===e&&(be&n)===n&&(ke===4||ke===3&&(be&130023424)===be&&500>xe()-go?nn(e,0):yo|=n),Oe(e,t)}function Qu(e,t){t===0&&(e.mode&1?(t=Xr,Xr<<=1,!(Xr&130023424)&&(Xr=4194304)):t=1);var n=_e();e=kt(e,t),e!==null&&(Mr(e,t,n),Oe(e,n))}function D1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function R1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Qu(e,n)}var Gu;Gu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)Re=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Re=!1,S1(e,t,n);Re=!!(e.flags&131072)}else Re=!1,ue&&t.flags&1048576&&Zc(t,Il,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xl(e,t),e=t.pendingProps;var i=Dn(t,Ne.current);Nn(t,n),i=co(null,t,r,e,i,n);var s=uo();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(r)?(s=!0,El(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,lo(t),i.updater=Zl,t.stateNode=i,i._reactInternals=t,xs(t,r,e,n),t=ms(null,t,r,!0,s,n)):(t.tag=0,ue&&s&&Js(t),Ie(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=A1(r),e=tt(r,e),i){case 0:t=gs(null,t,r,e,n);break e;case 1:t=za(null,t,r,e,n);break e;case 11:t=Ca(null,t,r,e,n);break e;case 14:t=ba(null,t,r,tt(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),gs(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),za(e,t,r,i,n);case 3:e:{if(Iu(t),e===null)throw Error(_(387));r=t.pendingProps,s=t.memoizedState,i=s.element,lu(e,t),Ll(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=On(Error(_(423)),t),t=Ta(e,t,r,n,i);break e}else if(r!==i){i=On(Error(_(424)),t),t=Ta(e,t,r,n,i);break e}else for(Ve=Ft(t.stateNode.containerInfo.firstChild),He=t,ue=!0,rt=null,n=nu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Rn(),r===i){t=jt(e,t,n);break e}Ie(e,t,r,n)}t=t.child}return t;case 5:return iu(t),e===null&&ps(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,os(r,i)?o=null:s!==null&&os(r,s)&&(t.flags|=32),Nu(e,t),Ie(e,t,o,n),t.child;case 6:return e===null&&ps(t),null;case 13:return _u(e,t,n);case 4:return io(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fn(t,null,r,n):Ie(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),Ca(e,t,r,i,n);case 7:return Ie(e,t,t.pendingProps,n),t.child;case 8:return Ie(e,t,t.pendingProps.children,n),t.child;case 12:return Ie(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,oe(_l,r._currentValue),r._currentValue=o,s!==null)if(st(s.value,o)){if(s.children===i.children&&!Fe.current){t=jt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=gt(-1,n&-n),c.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var x=d.pending;x===null?c.next=c:(c.next=x.next,x.next=c),d.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),fs(s.return,n,t),a.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),fs(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ie(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Nn(t,n),i=Ze(i),r=r(i),t.flags|=1,Ie(e,t,r,n),t.child;case 14:return r=t.type,i=tt(r,t.pendingProps),i=tt(r.type,i),ba(e,t,r,i,n);case 15:return Pu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),xl(e,t),t.tag=1,Ae(r)?(e=!0,El(t)):e=!1,Nn(t,n),bu(t,r,i),xs(t,r,i,n),ms(null,t,r,!0,e,n);case 19:return Mu(e,t,n);case 22:return Eu(e,t,n)}throw Error(_(156,t.tag))};function Xu(e,t){return wc(e,t)}function F1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,t,n,r){return new F1(e,t,n,r)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A1(e){if(typeof e=="function")return jo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Os)return 11;if(e===Ws)return 14}return 2}function Bt(e,t){var n=e.alternate;return n===null?(n=Ye(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ml(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")jo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case xn:return rn(n.children,i,s,t);case As:o=8,i|=8;break;case Oi:return e=Ye(12,n,t,i|2),e.elementType=Oi,e.lanes=s,e;case Wi:return e=Ye(13,n,t,i),e.elementType=Wi,e.lanes=s,e;case Bi:return e=Ye(19,n,t,i),e.elementType=Bi,e.lanes=s,e;case ic:return ti(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rc:o=10;break e;case lc:o=9;break e;case Os:o=11;break e;case Ws:o=14;break e;case Pt:o=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=Ye(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function rn(e,t,n,r){return e=Ye(7,e,r,t),e.lanes=n,e}function ti(e,t,n,r){return e=Ye(22,e,r,t),e.elementType=ic,e.lanes=n,e.stateNode={isHidden:!1},e}function Li(e,t,n){return e=Ye(6,e,null,t),e.lanes=n,e}function Di(e,t,n){return t=Ye(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xi(0),this.expirationTimes=xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function wo(e,t,n,r,i,s,o,a,c){return e=new O1(e,t,n,a,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ye(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lo(s),e}function W1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Yu(e){if(!e)return Ht;e=e._reactInternals;e:{if(pn(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ae(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(Ae(n))return Yc(e,n,t)}return t}function Ju(e,t,n,r,i,s,o,a,c){return e=wo(n,r,!0,e,i,s,o,a,c),e.context=Yu(null),n=e.current,r=_e(),i=Wt(n),s=gt(r,i),s.callback=t??null,At(n,s,i),e.current.lanes=i,Mr(e,i,r),Oe(e,r),e}function ni(e,t,n,r){var i=t.current,s=_e(),o=Wt(i);return n=Yu(n),t.context===null?t.context=n:t.pendingContext=n,t=gt(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=At(i,t,o),e!==null&&(it(e,i,o,s),pl(e,i,o)),o}function Ul(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Fa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function So(e,t){Fa(e,t),(e=e.alternate)&&Fa(e,t)}function B1(){return null}var Zu=typeof reportError=="function"?reportError:function(e){console.error(e)};function Co(e){this._internalRoot=e}ri.prototype.render=Co.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ni(e,t,null,null)};ri.prototype.unmount=Co.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cn(function(){ni(null,e,null,null)}),t[vt]=null}};function ri(e){this._internalRoot=e}ri.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ec();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nt.length&&t!==0&&t<Nt[n].priority;n++);Nt.splice(n,0,e),n===0&&Ic(e)}};function bo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function li(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Aa(){}function U1(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var d=Ul(o);s.call(d)}}var o=Ju(t,r,e,0,null,!1,!1,"",Aa);return e._reactRootContainer=o,e[vt]=o.current,Sr(e.nodeType===8?e.parentNode:e),cn(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var d=Ul(c);a.call(d)}}var c=wo(e,0,!1,null,null,!1,!1,"",Aa);return e._reactRootContainer=c,e[vt]=c.current,Sr(e.nodeType===8?e.parentNode:e),cn(function(){ni(t,c,n,r)}),c}function ii(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=Ul(o);a.call(c)}}ni(t,o,e,i)}else o=U1(n,t,e,i,r);return Ul(o)}Tc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lr(t.pendingLanes);n!==0&&(Vs(t,n|1),Oe(t,xe()),!(ne&6)&&(Wn=xe()+500,Qt()))}break;case 13:cn(function(){var r=kt(e,1);if(r!==null){var i=_e();it(r,e,1,i)}}),So(e,1)}};Hs=function(e){if(e.tag===13){var t=kt(e,134217728);if(t!==null){var n=_e();it(t,e,134217728,n)}So(e,134217728)}};Pc=function(e){if(e.tag===13){var t=Wt(e),n=kt(e,t);if(n!==null){var r=_e();it(n,e,t,r)}So(e,t)}};Ec=function(){return ie};Nc=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};Ji=function(e,t,n){switch(t){case"input":if(Hi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Xl(r);if(!i)throw Error(_(90));oc(r),Hi(r,i)}}}break;case"textarea":cc(e,n);break;case"select":t=n.value,t!=null&&zn(e,!!n.multiple,t,!1)}};yc=mo;gc=cn;var V1={usingClientEntryPoint:!1,Events:[Dr,vn,Xl,hc,xc,mo]},er={findFiberByHostInstance:qt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},H1={bundleType:er.bundleType,version:er.version,rendererPackageName:er.rendererPackageName,rendererConfig:er.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:wt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=kc(e),e===null?null:e.stateNode},findFiberByHostInstance:er.findFiberByHostInstance||B1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sl.isDisabled&&sl.supportsFiber)try{$l=sl.inject(H1),ut=sl}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V1;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bo(t))throw Error(_(200));return W1(e,t,null,n)};Ke.createRoot=function(e,t){if(!bo(e))throw Error(_(299));var n=!1,r="",i=Zu;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=wo(e,1,!1,null,null,n,!1,r,i),e[vt]=t.current,Sr(e.nodeType===8?e.parentNode:e),new Co(t)};Ke.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=kc(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return cn(e)};Ke.hydrate=function(e,t,n){if(!li(t))throw Error(_(200));return ii(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!bo(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Zu;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Ju(t,null,e,1,n??null,i,!1,s,o),e[vt]=t.current,Sr(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new ri(t)};Ke.render=function(e,t,n){if(!li(t))throw Error(_(200));return ii(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!li(e))throw Error(_(40));return e._reactRootContainer?(cn(function(){ii(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};Ke.unstable_batchedUpdates=mo;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!li(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ii(e,t,n,!1,r)};Ke.version="18.3.1-next-f1338f8080-20240426";function qu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qu)}catch(e){console.error(e)}}qu(),qa.exports=Ke;var $1=qa.exports,Oa=$1;Fi.createRoot=Oa.createRoot,Fi.hydrateRoot=Oa.hydrateRoot;const ed=C.createContext(void 0),K1=({children:e})=>{const[t,n]=C.useState(!1),[r,i]=C.useState(!1),[s,o]=C.useState(!0),[a,c]=C.useState(()=>sessionStorage.getItem("sessionToken")),[d,x]=C.useState(()=>{const f=localStorage.getItem("theme");return f==="light"||f==="dark"?f:"dark"}),g=async()=>{try{const j=await(await fetch("/api/auth/status")).json();n(j.initialized),i(j.unlocked),j.unlocked||(c(null),sessionStorage.removeItem("sessionToken"))}catch(f){console.error("Failed to check auth status:",f)}finally{o(!1)}};C.useEffect(()=>{g()},[]),C.useEffect(()=>{document.documentElement.setAttribute("data-theme",d),localStorage.setItem("theme",d)},[d]);const y=()=>{x(f=>f==="dark"?"light":"dark")},k=async(f,j)=>{o(!0);try{const v=await fetch("/api/auth/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:f,hint:j})}),w=await v.json();return v.ok&&w.success?(c(w.token),sessionStorage.setItem("sessionToken",w.token),n(!0),i(!0),!0):!1}catch(v){return console.error("Failed to initialize vault:",v),!1}finally{o(!1)}},S=async f=>{o(!0);try{const j=await fetch("/api/auth/unlock",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:f})}),v=await j.json();return j.ok&&v.success?(c(v.token),sessionStorage.setItem("sessionToken",v.token),i(!0),!0):!1}catch(j){return console.error("Failed to unlock vault:",j),!1}finally{o(!1)}},m=async()=>{try{await fetch("/api/auth/lock",{method:"POST"})}catch(f){console.error("Failed to lock vault:",f)}finally{c(null),sessionStorage.removeItem("sessionToken"),i(!1)}},N=async()=>{try{return(await(await fetch("/api/auth/hint")).json()).hint||null}catch(f){return console.error("Failed to get hint:",f),null}},p=async(f,j={})=>{const v={...j.headers,Authorization:`Bearer ${a}`,"Content-Type":"application/json"},w=await fetch(f,{...j,headers:v});return w.status===401&&(c(null),sessionStorage.removeItem("sessionToken"),i(!1)),w},u=f=>{c(f),sessionStorage.setItem("sessionToken",f)};return l.jsx(ed.Provider,{value:{isInitialized:t,isAuthenticated:r,isLoading:s,sessionToken:a,theme:d,toggleTheme:y,checkStatus:g,initializeVault:k,unlockVault:S,lockVault:m,getHint:N,fetchWithAuth:p,updateSessionToken:u},children:e})},St=()=>{const e=C.useContext(ed);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};/**
40
+ `+s.stack}return{value:e,source:t,stack:i,digest:null}}function _i(e,t,n){return{value:e,source:null,stack:n??null,digest:t??null}}function gs(e,t){try{console.error(t.value)}catch(n){setTimeout(function(){throw n})}}var k1=typeof WeakMap=="function"?WeakMap:Map;function zu(e,t,n){n=yt(-1,n),n.tag=3,n.payload={element:null};var r=t.value;return n.callback=function(){Ol||(Ol=!0,zs=r),gs(e,t)},n}function Tu(e,t,n){n=yt(-1,n),n.tag=3;var r=e.type.getDerivedStateFromError;if(typeof r=="function"){var i=t.value;n.payload=function(){return r(i)},n.callback=function(){gs(e,t)}}var s=e.stateNode;return s!==null&&typeof s.componentDidCatch=="function"&&(n.callback=function(){gs(e,t),typeof r!="function"&&(Ot===null?Ot=new Set([this]):Ot.add(this));var o=t.stack;this.componentDidCatch(t.value,{componentStack:o!==null?o:""})}),n}function ja(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new k1;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(i.add(n),e=M1.bind(null,e,t,n),t.then(e,e))}function wa(e){do{var t;if((t=e.tag===13)&&(t=e.memoizedState,t=t!==null?t.dehydrated!==null:!0),t)return e;e=e.return}while(e!==null);return null}function Sa(e,t,n,r,i){return e.mode&1?(e.flags|=65536,e.lanes=i,e):(e===t?e.flags|=65536:(e.flags|=128,n.flags|=131072,n.flags&=-52805,n.tag===1&&(n.alternate===null?n.tag=17:(t=yt(-1,1),t.tag=2,At(n,t,1))),n.lanes|=1),e)}var j1=wt.ReactCurrentOwner,Re=!1;function Ie(e,t,n,r){t.child=e===null?nu(t,null,n,r):Fn(t,e.child,n,r)}function Ca(e,t,n,r,i){n=n.render;var s=t.ref;return Nn(t,i),r=co(e,t,n,r,s,i),n=uo(),e!==null&&!Re?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jt(e,t,i)):(ue&&n&&Js(t),t.flags|=1,Ie(e,t,r,i),t.child)}function ba(e,t,n,r,i){if(e===null){var s=n.type;return typeof s=="function"&&!jo(s)&&s.defaultProps===void 0&&n.compare===null&&n.defaultProps===void 0?(t.tag=15,t.type=s,Pu(e,t,s,r,i)):(e=ml(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(s=e.child,!(e.lanes&i)){var o=s.memoizedProps;if(n=n.compare,n=n!==null?n:wr,n(o,r)&&e.ref===t.ref)return jt(e,t,i)}return t.flags|=1,e=Bt(s,r),e.ref=t.ref,e.return=t,t.child=e}function Pu(e,t,n,r,i){if(e!==null){var s=e.memoizedProps;if(wr(s,r)&&e.ref===t.ref)if(Re=!1,t.pendingProps=r=s,(e.lanes&i)!==0)e.flags&131072&&(Re=!0);else return t.lanes=e.lanes,jt(e,t,i)}return ys(e,t,n,r,i)}function Eu(e,t,n){var r=t.pendingProps,i=r.children,s=e!==null?e.memoizedState:null;if(r.mode==="hidden")if(!(t.mode&1))t.memoizedState={baseLanes:0,cachePool:null,transitions:null},oe(bn,Ue),Ue|=n;else{if(!(n&1073741824))return e=s!==null?s.baseLanes|n:n,t.lanes=t.childLanes=1073741824,t.memoizedState={baseLanes:e,cachePool:null,transitions:null},t.updateQueue=null,oe(bn,Ue),Ue|=e,null;t.memoizedState={baseLanes:0,cachePool:null,transitions:null},r=s!==null?s.baseLanes:n,oe(bn,Ue),Ue|=r}else s!==null?(r=s.baseLanes|n,t.memoizedState=null):r=n,oe(bn,Ue),Ue|=r;return Ie(e,t,i,n),t.child}function Nu(e,t){var n=t.ref;(e===null&&n!==null||e!==null&&e.ref!==n)&&(t.flags|=512,t.flags|=2097152)}function ys(e,t,n,r,i){var s=Ae(n)?ln:Ne.current;return s=Dn(t,s),Nn(t,i),n=co(e,t,n,r,s,i),r=uo(),e!==null&&!Re?(t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~i,jt(e,t,i)):(ue&&r&&Js(t),t.flags|=1,Ie(e,t,n,i),t.child)}function za(e,t,n,r,i){if(Ae(n)){var s=!0;El(t)}else s=!1;if(Nn(t,i),t.stateNode===null)xl(e,t),bu(t,n,r),xs(t,n,r,i),r=!0;else if(e===null){var o=t.stateNode,a=t.memoizedProps;o.props=a;var c=o.context,d=n.contextType;typeof d=="object"&&d!==null?d=Ze(d):(d=Ae(n)?ln:Ne.current,d=Dn(t,d));var x=n.getDerivedStateFromProps,y=typeof x=="function"||typeof o.getSnapshotBeforeUpdate=="function";y||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==r||c!==d)&&ka(t,o,r,d),Et=!1;var g=t.memoizedState;o.state=g,Ml(t,r,o,i),c=t.memoizedState,a!==r||g!==c||Fe.current||Et?(typeof x=="function"&&(hs(t,n,x,r),c=t.memoizedState),(a=Et||va(t,n,a,r,g,c,d))?(y||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=r,t.memoizedState=c),o.props=r,o.state=c,o.context=d,r=a):(typeof o.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{o=t.stateNode,lu(e,t),a=t.memoizedProps,d=t.type===t.elementType?a:tt(t.type,a),o.props=d,y=t.pendingProps,g=o.context,c=n.contextType,typeof c=="object"&&c!==null?c=Ze(c):(c=Ae(n)?ln:Ne.current,c=Dn(t,c));var k=n.getDerivedStateFromProps;(x=typeof k=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(a!==y||g!==c)&&ka(t,o,r,c),Et=!1,g=t.memoizedState,o.state=g,Ml(t,r,o,i);var S=t.memoizedState;a!==y||g!==S||Fe.current||Et?(typeof k=="function"&&(hs(t,n,k,r),S=t.memoizedState),(d=Et||va(t,n,d,r,g,S,c)||!1)?(x||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(r,S,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(r,S,c)),typeof o.componentDidUpdate=="function"&&(t.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=S),o.props=r,o.state=S,o.context=c,r=d):(typeof o.componentDidUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||a===e.memoizedProps&&g===e.memoizedState||(t.flags|=1024),r=!1)}return ms(e,t,n,r,s,i)}function ms(e,t,n,r,i,s){Nu(e,t);var o=(t.flags&128)!==0;if(!r&&!o)return i&&da(t,n,!1),jt(e,t,s);r=t.stateNode,j1.current=t;var a=o&&typeof n.getDerivedStateFromError!="function"?null:r.render();return t.flags|=1,e!==null&&o?(t.child=Fn(t,e.child,null,s),t.child=Fn(t,null,a,s)):Ie(e,t,a,s),t.memoizedState=r.state,i&&da(t,n,!0),t.child}function Iu(e){var t=e.stateNode;t.pendingContext?ua(e,t.pendingContext,t.pendingContext!==t.context):t.context&&ua(e,t.context,!1),io(e,t.containerInfo)}function Ta(e,t,n,r,i){return Rn(),qs(i),t.flags|=256,Ie(e,t,n,r),t.child}var vs={dehydrated:null,treeContext:null,retryLane:0};function ks(e){return{baseLanes:e,cachePool:null,transitions:null}}function _u(e,t,n){var r=t.pendingProps,i=de.current,s=!1,o=(t.flags&128)!==0,a;if((a=o)||(a=e!==null&&e.memoizedState===null?!1:(i&2)!==0),a?(s=!0,t.flags&=-129):(e===null||e.memoizedState!==null)&&(i|=1),oe(de,i&1),e===null)return ps(t),e=t.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?(t.mode&1?e.data==="$!"?t.lanes=8:t.lanes=1073741824:t.lanes=1,null):(o=r.children,e=r.fallback,s?(r=t.mode,s=t.child,o={mode:"hidden",children:o},!(r&1)&&s!==null?(s.childLanes=0,s.pendingProps=o):s=ti(o,r,0,null),e=rn(e,r,n,null),s.return=t,e.return=t,s.sibling=e,t.child=s,t.child.memoizedState=ks(n),t.memoizedState=vs,e):ho(t,o));if(i=e.memoizedState,i!==null&&(a=i.dehydrated,a!==null))return w1(e,t,o,r,a,i,n);if(s){s=r.fallback,o=t.mode,i=e.child,a=i.sibling;var c={mode:"hidden",children:r.children};return!(o&1)&&t.child!==i?(r=t.child,r.childLanes=0,r.pendingProps=c,t.deletions=null):(r=Bt(i,c),r.subtreeFlags=i.subtreeFlags&14680064),a!==null?s=Bt(a,s):(s=rn(s,o,n,null),s.flags|=2),s.return=t,r.return=t,r.sibling=s,t.child=r,r=s,s=t.child,o=e.child.memoizedState,o=o===null?ks(n):{baseLanes:o.baseLanes|n,cachePool:null,transitions:o.transitions},s.memoizedState=o,s.childLanes=e.childLanes&~n,t.memoizedState=vs,r}return s=e.child,e=s.sibling,r=Bt(s,{mode:"visible",children:r.children}),!(t.mode&1)&&(r.lanes=n),r.return=t,r.sibling=null,e!==null&&(n=t.deletions,n===null?(t.deletions=[e],t.flags|=16):n.push(e)),t.child=r,t.memoizedState=null,r}function ho(e,t){return t=ti({mode:"visible",children:t},e.mode,0,null),t.return=e,e.child=t}function rl(e,t,n,r){return r!==null&&qs(r),Fn(t,e.child,null,n),e=ho(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function w1(e,t,n,r,i,s,o){if(n)return t.flags&256?(t.flags&=-257,r=_i(Error(_(422))),rl(e,t,o,r)):t.memoizedState!==null?(t.child=e.child,t.flags|=128,null):(s=r.fallback,i=t.mode,r=ti({mode:"visible",children:r.children},i,0,null),s=rn(s,i,o,null),s.flags|=2,r.return=t,s.return=t,r.sibling=s,t.child=r,t.mode&1&&Fn(t,e.child,null,o),t.child.memoizedState=ks(o),t.memoizedState=vs,s);if(!(t.mode&1))return rl(e,t,o,null);if(i.data==="$!"){if(r=i.nextSibling&&i.nextSibling.dataset,r)var a=r.dgst;return r=a,s=Error(_(419)),r=_i(s,r,void 0),rl(e,t,o,r)}if(a=(o&e.childLanes)!==0,Re||a){if(r=we,r!==null){switch(o&-o){case 4:i=2;break;case 16:i=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:i=32;break;case 536870912:i=268435456;break;default:i=0}i=i&(r.suspendedLanes|o)?0:i,i!==0&&i!==s.retryLane&&(s.retryLane=i,kt(e,i),it(r,e,i,-1))}return ko(),r=_i(Error(_(421))),rl(e,t,o,r)}return i.data==="$?"?(t.flags|=128,t.child=e.child,t=D1.bind(null,e),i._reactRetry=t,null):(e=s.treeContext,Ve=Ft(i.nextSibling),He=t,ue=!0,rt=null,e!==null&&(Ge[Xe++]=xt,Ge[Xe++]=gt,Ge[Xe++]=sn,xt=e.id,gt=e.overflow,sn=t),t=ho(t,r.children),t.flags|=4096,t)}function Pa(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),fs(e.return,t,n)}function Li(e,t,n,r,i){var s=e.memoizedState;s===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i}:(s.isBackwards=t,s.rendering=null,s.renderingStartTime=0,s.last=r,s.tail=n,s.tailMode=i)}function Lu(e,t,n){var r=t.pendingProps,i=r.revealOrder,s=r.tail;if(Ie(e,t,r.children,n),r=de.current,r&2)r=r&1|2,t.flags|=128;else{if(e!==null&&e.flags&128)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Pa(e,n,t);else if(e.tag===19)Pa(e,n,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}r&=1}if(oe(de,r),!(t.mode&1))t.memoizedState=null;else switch(i){case"forwards":for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&Dl(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Li(t,!1,i,n,s);break;case"backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Dl(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Li(t,!0,n,null,s);break;case"together":Li(t,!1,null,null,void 0);break;default:t.memoizedState=null}return t.child}function xl(e,t){!(t.mode&1)&&e!==null&&(e.alternate=null,t.alternate=null,t.flags|=2)}function jt(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),an|=t.lanes,!(n&t.childLanes))return null;if(e!==null&&t.child!==e.child)throw Error(_(153));if(t.child!==null){for(e=t.child,n=Bt(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Bt(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function S1(e,t,n){switch(t.tag){case 3:Iu(t),Rn();break;case 5:iu(t);break;case 1:Ae(t.type)&&El(t);break;case 4:io(t,t.stateNode.containerInfo);break;case 10:var r=t.type._context,i=t.memoizedProps.value;oe(_l,r._currentValue),r._currentValue=i;break;case 13:if(r=t.memoizedState,r!==null)return r.dehydrated!==null?(oe(de,de.current&1),t.flags|=128,null):n&t.child.childLanes?_u(e,t,n):(oe(de,de.current&1),e=jt(e,t,n),e!==null?e.sibling:null);oe(de,de.current&1);break;case 19:if(r=(n&t.childLanes)!==0,e.flags&128){if(r)return Lu(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),oe(de,de.current),r)break;return null;case 22:case 23:return t.lanes=0,Eu(e,t,n)}return jt(e,t,n)}var Mu,js,Du,Ru;Mu=function(e,t){for(var n=t.child;n!==null;){if(n.tag===5||n.tag===6)e.appendChild(n.stateNode);else if(n.tag!==4&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return;n=n.return}n.sibling.return=n.return,n=n.sibling}};js=function(){};Du=function(e,t,n,r){var i=e.memoizedProps;if(i!==r){e=t.stateNode,tn(dt.current);var s=null;switch(n){case"input":i=Vi(e,i),r=Vi(e,r),s=[];break;case"select":i=fe({},i,{value:void 0}),r=fe({},r,{value:void 0}),s=[];break;case"textarea":i=Ki(e,i),r=Ki(e,r),s=[];break;default:typeof i.onClick!="function"&&typeof r.onClick=="function"&&(e.onclick=Tl)}Gi(n,r);var o;n=null;for(d in i)if(!r.hasOwnProperty(d)&&i.hasOwnProperty(d)&&i[d]!=null)if(d==="style"){var a=i[d];for(o in a)a.hasOwnProperty(o)&&(n||(n={}),n[o]="")}else d!=="dangerouslySetInnerHTML"&&d!=="children"&&d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&d!=="autoFocus"&&(xr.hasOwnProperty(d)?s||(s=[]):(s=s||[]).push(d,null));for(d in r){var c=r[d];if(a=i!=null?i[d]:void 0,r.hasOwnProperty(d)&&c!==a&&(c!=null||a!=null))if(d==="style")if(a){for(o in a)!a.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(n||(n={}),n[o]="");for(o in c)c.hasOwnProperty(o)&&a[o]!==c[o]&&(n||(n={}),n[o]=c[o])}else n||(s||(s=[]),s.push(d,n)),n=c;else d==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,a=a?a.__html:void 0,c!=null&&a!==c&&(s=s||[]).push(d,c)):d==="children"?typeof c!="string"&&typeof c!="number"||(s=s||[]).push(d,""+c):d!=="suppressContentEditableWarning"&&d!=="suppressHydrationWarning"&&(xr.hasOwnProperty(d)?(c!=null&&d==="onScroll"&&ae("scroll",e),s||a===c||(s=[])):(s=s||[]).push(d,c))}n&&(s=s||[]).push("style",n);var d=s;(t.updateQueue=d)&&(t.flags|=4)}};Ru=function(e,t,n,r){n!==r&&(t.flags|=4)};function qn(e,t){if(!ue)switch(e.tailMode){case"hidden":t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case"collapsed":n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Pe(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&14680064,r|=i.flags&14680064,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function C1(e,t,n){var r=t.pendingProps;switch(Zs(t),t.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Pe(t),null;case 1:return Ae(t.type)&&Pl(),Pe(t),null;case 3:return r=t.stateNode,An(),ce(Fe),ce(Ne),oo(),r.pendingContext&&(r.context=r.pendingContext,r.pendingContext=null),(e===null||e.child===null)&&(tl(t)?t.flags|=4:e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,rt!==null&&(Es(rt),rt=null))),js(e,t),Pe(t),null;case 5:so(t);var i=tn(Tr.current);if(n=t.type,e!==null&&t.stateNode!=null)Du(e,t,n,r,i),e.ref!==t.ref&&(t.flags|=512,t.flags|=2097152);else{if(!r){if(t.stateNode===null)throw Error(_(166));return Pe(t),null}if(e=tn(dt.current),tl(t)){r=t.stateNode,n=t.type;var s=t.memoizedProps;switch(r[ct]=t,r[br]=s,e=(t.mode&1)!==0,n){case"dialog":ae("cancel",r),ae("close",r);break;case"iframe":case"object":case"embed":ae("load",r);break;case"video":case"audio":for(i=0;i<ir.length;i++)ae(ir[i],r);break;case"source":ae("error",r);break;case"img":case"image":case"link":ae("error",r),ae("load",r);break;case"details":ae("toggle",r);break;case"input":Fo(r,s),ae("invalid",r);break;case"select":r._wrapperState={wasMultiple:!!s.multiple},ae("invalid",r);break;case"textarea":Oo(r,s),ae("invalid",r)}Gi(n,s),i=null;for(var o in s)if(s.hasOwnProperty(o)){var a=s[o];o==="children"?typeof a=="string"?r.textContent!==a&&(s.suppressHydrationWarning!==!0&&el(r.textContent,a,e),i=["children",a]):typeof a=="number"&&r.textContent!==""+a&&(s.suppressHydrationWarning!==!0&&el(r.textContent,a,e),i=["children",""+a]):xr.hasOwnProperty(o)&&a!=null&&o==="onScroll"&&ae("scroll",r)}switch(n){case"input":Kr(r),Ao(r,s,!0);break;case"textarea":Kr(r),Wo(r);break;case"select":case"option":break;default:typeof s.onClick=="function"&&(r.onclick=Tl)}r=i,t.updateQueue=r,r!==null&&(t.flags|=4)}else{o=i.nodeType===9?i:i.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=uc(n)),e==="http://www.w3.org/1999/xhtml"?n==="script"?(e=o.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof r.is=="string"?e=o.createElement(n,{is:r.is}):(e=o.createElement(n),n==="select"&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,n),e[ct]=t,e[br]=r,Mu(e,t,!1,!1),t.stateNode=e;e:{switch(o=Xi(n,r),n){case"dialog":ae("cancel",e),ae("close",e),i=r;break;case"iframe":case"object":case"embed":ae("load",e),i=r;break;case"video":case"audio":for(i=0;i<ir.length;i++)ae(ir[i],e);i=r;break;case"source":ae("error",e),i=r;break;case"img":case"image":case"link":ae("error",e),ae("load",e),i=r;break;case"details":ae("toggle",e),i=r;break;case"input":Fo(e,r),i=Vi(e,r),ae("invalid",e);break;case"option":i=r;break;case"select":e._wrapperState={wasMultiple:!!r.multiple},i=fe({},r,{value:void 0}),ae("invalid",e);break;case"textarea":Oo(e,r),i=Ki(e,r),ae("invalid",e);break;default:i=r}Gi(n,i),a=i;for(s in a)if(a.hasOwnProperty(s)){var c=a[s];s==="style"?fc(e,c):s==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&dc(e,c)):s==="children"?typeof c=="string"?(n!=="textarea"||c!=="")&&gr(e,c):typeof c=="number"&&gr(e,""+c):s!=="suppressContentEditableWarning"&&s!=="suppressHydrationWarning"&&s!=="autoFocus"&&(xr.hasOwnProperty(s)?c!=null&&s==="onScroll"&&ae("scroll",e):c!=null&&Fs(e,s,c,o))}switch(n){case"input":Kr(e),Ao(e,r,!1);break;case"textarea":Kr(e),Wo(e);break;case"option":r.value!=null&&e.setAttribute("value",""+Vt(r.value));break;case"select":e.multiple=!!r.multiple,s=r.value,s!=null?zn(e,!!r.multiple,s,!1):r.defaultValue!=null&&zn(e,!!r.multiple,r.defaultValue,!0);break;default:typeof i.onClick=="function"&&(e.onclick=Tl)}switch(n){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}}r&&(t.flags|=4)}t.ref!==null&&(t.flags|=512,t.flags|=2097152)}return Pe(t),null;case 6:if(e&&t.stateNode!=null)Ru(e,t,e.memoizedProps,r);else{if(typeof r!="string"&&t.stateNode===null)throw Error(_(166));if(n=tn(Tr.current),tn(dt.current),tl(t)){if(r=t.stateNode,n=t.memoizedProps,r[ct]=t,(s=r.nodeValue!==n)&&(e=He,e!==null))switch(e.tag){case 3:el(r.nodeValue,n,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&el(r.nodeValue,n,(e.mode&1)!==0)}s&&(t.flags|=4)}else r=(n.nodeType===9?n:n.ownerDocument).createTextNode(r),r[ct]=t,t.stateNode=r}return Pe(t),null;case 13:if(ce(de),r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(ue&&Ve!==null&&t.mode&1&&!(t.flags&128))eu(),Rn(),t.flags|=98560,s=!1;else if(s=tl(t),r!==null&&r.dehydrated!==null){if(e===null){if(!s)throw Error(_(318));if(s=t.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(_(317));s[ct]=t}else Rn(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Pe(t),s=!1}else rt!==null&&(Es(rt),rt=null),s=!0;if(!s)return t.flags&65536?t:null}return t.flags&128?(t.lanes=n,t):(r=r!==null,r!==(e!==null&&e.memoizedState!==null)&&r&&(t.child.flags|=8192,t.mode&1&&(e===null||de.current&1?ke===0&&(ke=3):ko())),t.updateQueue!==null&&(t.flags|=4),Pe(t),null);case 4:return An(),js(e,t),e===null&&Sr(t.stateNode.containerInfo),Pe(t),null;case 10:return no(t.type._context),Pe(t),null;case 17:return Ae(t.type)&&Pl(),Pe(t),null;case 19:if(ce(de),s=t.memoizedState,s===null)return Pe(t),null;if(r=(t.flags&128)!==0,o=s.rendering,o===null)if(r)qn(s,!1);else{if(ke!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Dl(e),o!==null){for(t.flags|=128,qn(s,!1),r=o.updateQueue,r!==null&&(t.updateQueue=r,t.flags|=4),t.subtreeFlags=0,r=n,n=t.child;n!==null;)s=n,e=r,s.flags&=14680066,o=s.alternate,o===null?(s.childLanes=0,s.lanes=e,s.child=null,s.subtreeFlags=0,s.memoizedProps=null,s.memoizedState=null,s.updateQueue=null,s.dependencies=null,s.stateNode=null):(s.childLanes=o.childLanes,s.lanes=o.lanes,s.child=o.child,s.subtreeFlags=0,s.deletions=null,s.memoizedProps=o.memoizedProps,s.memoizedState=o.memoizedState,s.updateQueue=o.updateQueue,s.type=o.type,e=o.dependencies,s.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),n=n.sibling;return oe(de,de.current&1|2),t.child}e=e.sibling}s.tail!==null&&xe()>Wn&&(t.flags|=128,r=!0,qn(s,!1),t.lanes=4194304)}else{if(!r)if(e=Dl(o),e!==null){if(t.flags|=128,r=!0,n=e.updateQueue,n!==null&&(t.updateQueue=n,t.flags|=4),qn(s,!0),s.tail===null&&s.tailMode==="hidden"&&!o.alternate&&!ue)return Pe(t),null}else 2*xe()-s.renderingStartTime>Wn&&n!==1073741824&&(t.flags|=128,r=!0,qn(s,!1),t.lanes=4194304);s.isBackwards?(o.sibling=t.child,t.child=o):(n=s.last,n!==null?n.sibling=o:t.child=o,s.last=o)}return s.tail!==null?(t=s.tail,s.rendering=t,s.tail=t.sibling,s.renderingStartTime=xe(),t.sibling=null,n=de.current,oe(de,r?n&1|2:n&1),t):(Pe(t),null);case 22:case 23:return vo(),r=t.memoizedState!==null,e!==null&&e.memoizedState!==null!==r&&(t.flags|=8192),r&&t.mode&1?Ue&1073741824&&(Pe(t),t.subtreeFlags&6&&(t.flags|=8192)):Pe(t),null;case 24:return null;case 25:return null}throw Error(_(156,t.tag))}function b1(e,t){switch(Zs(t),t.tag){case 1:return Ae(t.type)&&Pl(),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return An(),ce(Fe),ce(Ne),oo(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 5:return so(t),null;case 13:if(ce(de),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(_(340));Rn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ce(de),null;case 4:return An(),null;case 10:return no(t.type._context),null;case 22:case 23:return vo(),null;case 24:return null;default:return null}}var ll=!1,Ee=!1,z1=typeof WeakSet=="function"?WeakSet:Set,O=null;function Cn(e,t){var n=e.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){he(e,t,r)}else n.current=null}function ws(e,t,n){try{n()}catch(r){he(e,t,r)}}var Ea=!1;function T1(e,t){if(is=Cl,e=Bc(),Ys(e)){if("selectionStart"in e)var n={start:e.selectionStart,end:e.selectionEnd};else e:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var i=r.anchorOffset,s=r.focusNode;r=r.focusOffset;try{n.nodeType,s.nodeType}catch{n=null;break e}var o=0,a=-1,c=-1,d=0,x=0,y=e,g=null;t:for(;;){for(var k;y!==n||i!==0&&y.nodeType!==3||(a=o+i),y!==s||r!==0&&y.nodeType!==3||(c=o+r),y.nodeType===3&&(o+=y.nodeValue.length),(k=y.firstChild)!==null;)g=y,y=k;for(;;){if(y===e)break t;if(g===n&&++d===i&&(a=o),g===s&&++x===r&&(c=o),(k=y.nextSibling)!==null)break;y=g,g=y.parentNode}y=k}n=a===-1||c===-1?null:{start:a,end:c}}else n=null}n=n||{start:0,end:0}}else n=null;for(ss={focusedElem:e,selectionRange:n},Cl=!1,O=t;O!==null;)if(t=O,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,O=e;else for(;O!==null;){t=O;try{var S=t.alternate;if(t.flags&1024)switch(t.tag){case 0:case 11:case 15:break;case 1:if(S!==null){var m=S.memoizedProps,N=S.memoizedState,p=t.stateNode,u=p.getSnapshotBeforeUpdate(t.elementType===t.type?m:tt(t.type,m),N);p.__reactInternalSnapshotBeforeUpdate=u}break;case 3:var f=t.stateNode.containerInfo;f.nodeType===1?f.textContent="":f.nodeType===9&&f.documentElement&&f.removeChild(f.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(_(163))}}catch(j){he(t,t.return,j)}if(e=t.sibling,e!==null){e.return=t.return,O=e;break}O=t.return}return S=Ea,Ea=!1,S}function pr(e,t,n){var r=t.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var s=i.destroy;i.destroy=void 0,s!==void 0&&ws(t,n,s)}i=i.next}while(i!==r)}}function ql(e,t){if(t=t.updateQueue,t=t!==null?t.lastEffect:null,t!==null){var n=t=t.next;do{if((n.tag&e)===e){var r=n.create;n.destroy=r()}n=n.next}while(n!==t)}}function Ss(e){var t=e.ref;if(t!==null){var n=e.stateNode;switch(e.tag){case 5:e=n;break;default:e=n}typeof t=="function"?t(e):t.current=e}}function Fu(e){var t=e.alternate;t!==null&&(e.alternate=null,Fu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&(delete t[ct],delete t[br],delete t[cs],delete t[c1],delete t[u1])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Au(e){return e.tag===5||e.tag===3||e.tag===4}function Na(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Au(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.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 Cs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.nodeType===8?n.parentNode.insertBefore(e,t):n.insertBefore(e,t):(n.nodeType===8?(t=n.parentNode,t.insertBefore(e,n)):(t=n,t.appendChild(e)),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Tl));else if(r!==4&&(e=e.child,e!==null))for(Cs(e,t,n),e=e.sibling;e!==null;)Cs(e,t,n),e=e.sibling}function bs(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(e=e.child,e!==null))for(bs(e,t,n),e=e.sibling;e!==null;)bs(e,t,n),e=e.sibling}var Ce=null,nt=!1;function Tt(e,t,n){for(n=n.child;n!==null;)Ou(e,t,n),n=n.sibling}function Ou(e,t,n){if(ut&&typeof ut.onCommitFiberUnmount=="function")try{ut.onCommitFiberUnmount($l,n)}catch{}switch(n.tag){case 5:Ee||Cn(n,t);case 6:var r=Ce,i=nt;Ce=null,Tt(e,t,n),Ce=r,nt=i,Ce!==null&&(nt?(e=Ce,n=n.stateNode,e.nodeType===8?e.parentNode.removeChild(n):e.removeChild(n)):Ce.removeChild(n.stateNode));break;case 18:Ce!==null&&(nt?(e=Ce,n=n.stateNode,e.nodeType===8?zi(e.parentNode,n):e.nodeType===1&&zi(e,n),kr(e)):zi(Ce,n.stateNode));break;case 4:r=Ce,i=nt,Ce=n.stateNode.containerInfo,nt=!0,Tt(e,t,n),Ce=r,nt=i;break;case 0:case 11:case 14:case 15:if(!Ee&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){i=r=r.next;do{var s=i,o=s.destroy;s=s.tag,o!==void 0&&(s&2||s&4)&&ws(n,t,o),i=i.next}while(i!==r)}Tt(e,t,n);break;case 1:if(!Ee&&(Cn(n,t),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){he(n,t,a)}Tt(e,t,n);break;case 21:Tt(e,t,n);break;case 22:n.mode&1?(Ee=(r=Ee)||n.memoizedState!==null,Tt(e,t,n),Ee=r):Tt(e,t,n);break;default:Tt(e,t,n)}}function Ia(e){var t=e.updateQueue;if(t!==null){e.updateQueue=null;var n=e.stateNode;n===null&&(n=e.stateNode=new z1),t.forEach(function(r){var i=R1.bind(null,e,r);n.has(r)||(n.add(r),r.then(i,i))})}}function et(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];try{var s=e,o=t,a=o;e:for(;a!==null;){switch(a.tag){case 5:Ce=a.stateNode,nt=!1;break e;case 3:Ce=a.stateNode.containerInfo,nt=!0;break e;case 4:Ce=a.stateNode.containerInfo,nt=!0;break e}a=a.return}if(Ce===null)throw Error(_(160));Ou(s,o,i),Ce=null,nt=!1;var c=i.alternate;c!==null&&(c.return=null),i.return=null}catch(d){he(i,t,d)}}if(t.subtreeFlags&12854)for(t=t.child;t!==null;)Wu(t,e),t=t.sibling}function Wu(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(et(t,e),ot(e),r&4){try{pr(3,e,e.return),ql(3,e)}catch(m){he(e,e.return,m)}try{pr(5,e,e.return)}catch(m){he(e,e.return,m)}}break;case 1:et(t,e),ot(e),r&512&&n!==null&&Cn(n,n.return);break;case 5:if(et(t,e),ot(e),r&512&&n!==null&&Cn(n,n.return),e.flags&32){var i=e.stateNode;try{gr(i,"")}catch(m){he(e,e.return,m)}}if(r&4&&(i=e.stateNode,i!=null)){var s=e.memoizedProps,o=n!==null?n.memoizedProps:s,a=e.type,c=e.updateQueue;if(e.updateQueue=null,c!==null)try{a==="input"&&s.type==="radio"&&s.name!=null&&ac(i,s),Xi(a,o);var d=Xi(a,s);for(o=0;o<c.length;o+=2){var x=c[o],y=c[o+1];x==="style"?fc(i,y):x==="dangerouslySetInnerHTML"?dc(i,y):x==="children"?gr(i,y):Fs(i,x,y,d)}switch(a){case"input":Hi(i,s);break;case"textarea":cc(i,s);break;case"select":var g=i._wrapperState.wasMultiple;i._wrapperState.wasMultiple=!!s.multiple;var k=s.value;k!=null?zn(i,!!s.multiple,k,!1):g!==!!s.multiple&&(s.defaultValue!=null?zn(i,!!s.multiple,s.defaultValue,!0):zn(i,!!s.multiple,s.multiple?[]:"",!1))}i[br]=s}catch(m){he(e,e.return,m)}}break;case 6:if(et(t,e),ot(e),r&4){if(e.stateNode===null)throw Error(_(162));i=e.stateNode,s=e.memoizedProps;try{i.nodeValue=s}catch(m){he(e,e.return,m)}}break;case 3:if(et(t,e),ot(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{kr(t.containerInfo)}catch(m){he(e,e.return,m)}break;case 4:et(t,e),ot(e);break;case 13:et(t,e),ot(e),i=e.child,i.flags&8192&&(s=i.memoizedState!==null,i.stateNode.isHidden=s,!s||i.alternate!==null&&i.alternate.memoizedState!==null||(yo=xe())),r&4&&Ia(e);break;case 22:if(x=n!==null&&n.memoizedState!==null,e.mode&1?(Ee=(d=Ee)||x,et(t,e),Ee=d):et(t,e),ot(e),r&8192){if(d=e.memoizedState!==null,(e.stateNode.isHidden=d)&&!x&&e.mode&1)for(O=e,x=e.child;x!==null;){for(y=O=x;O!==null;){switch(g=O,k=g.child,g.tag){case 0:case 11:case 14:case 15:pr(4,g,g.return);break;case 1:Cn(g,g.return);var S=g.stateNode;if(typeof S.componentWillUnmount=="function"){r=g,n=g.return;try{t=r,S.props=t.memoizedProps,S.state=t.memoizedState,S.componentWillUnmount()}catch(m){he(r,n,m)}}break;case 5:Cn(g,g.return);break;case 22:if(g.memoizedState!==null){La(y);continue}}k!==null?(k.return=g,O=k):La(y)}x=x.sibling}e:for(x=null,y=e;;){if(y.tag===5){if(x===null){x=y;try{i=y.stateNode,d?(s=i.style,typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"):(a=y.stateNode,c=y.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,a.style.display=pc("display",o))}catch(m){he(e,e.return,m)}}}else if(y.tag===6){if(x===null)try{y.stateNode.nodeValue=d?"":y.memoizedProps}catch(m){he(e,e.return,m)}}else if((y.tag!==22&&y.tag!==23||y.memoizedState===null||y===e)&&y.child!==null){y.child.return=y,y=y.child;continue}if(y===e)break e;for(;y.sibling===null;){if(y.return===null||y.return===e)break e;x===y&&(x=null),y=y.return}x===y&&(x=null),y.sibling.return=y.return,y=y.sibling}}break;case 19:et(t,e),ot(e),r&4&&Ia(e);break;case 21:break;default:et(t,e),ot(e)}}function ot(e){var t=e.flags;if(t&2){try{e:{for(var n=e.return;n!==null;){if(Au(n)){var r=n;break e}n=n.return}throw Error(_(160))}switch(r.tag){case 5:var i=r.stateNode;r.flags&32&&(gr(i,""),r.flags&=-33);var s=Na(e);bs(e,s,i);break;case 3:case 4:var o=r.stateNode.containerInfo,a=Na(e);Cs(e,a,o);break;default:throw Error(_(161))}}catch(c){he(e,e.return,c)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function P1(e,t,n){O=e,Bu(e)}function Bu(e,t,n){for(var r=(e.mode&1)!==0;O!==null;){var i=O,s=i.child;if(i.tag===22&&r){var o=i.memoizedState!==null||ll;if(!o){var a=i.alternate,c=a!==null&&a.memoizedState!==null||Ee;a=ll;var d=Ee;if(ll=o,(Ee=c)&&!d)for(O=i;O!==null;)o=O,c=o.child,o.tag===22&&o.memoizedState!==null?Ma(i):c!==null?(c.return=o,O=c):Ma(i);for(;s!==null;)O=s,Bu(s),s=s.sibling;O=i,ll=a,Ee=d}_a(e)}else i.subtreeFlags&8772&&s!==null?(s.return=i,O=s):_a(e)}}function _a(e){for(;O!==null;){var t=O;if(t.flags&8772){var n=t.alternate;try{if(t.flags&8772)switch(t.tag){case 0:case 11:case 15:Ee||ql(5,t);break;case 1:var r=t.stateNode;if(t.flags&4&&!Ee)if(n===null)r.componentDidMount();else{var i=t.elementType===t.type?n.memoizedProps:tt(t.type,n.memoizedProps);r.componentDidUpdate(i,n.memoizedState,r.__reactInternalSnapshotBeforeUpdate)}var s=t.updateQueue;s!==null&&ga(t,s,r);break;case 3:var o=t.updateQueue;if(o!==null){if(n=null,t.child!==null)switch(t.child.tag){case 5:n=t.child.stateNode;break;case 1:n=t.child.stateNode}ga(t,o,n)}break;case 5:var a=t.stateNode;if(n===null&&t.flags&4){n=a;var c=t.memoizedProps;switch(t.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&n.focus();break;case"img":c.src&&(n.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(t.memoizedState===null){var d=t.alternate;if(d!==null){var x=d.memoizedState;if(x!==null){var y=x.dehydrated;y!==null&&kr(y)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(_(163))}Ee||t.flags&512&&Ss(t)}catch(g){he(t,t.return,g)}}if(t===e){O=null;break}if(n=t.sibling,n!==null){n.return=t.return,O=n;break}O=t.return}}function La(e){for(;O!==null;){var t=O;if(t===e){O=null;break}var n=t.sibling;if(n!==null){n.return=t.return,O=n;break}O=t.return}}function Ma(e){for(;O!==null;){var t=O;try{switch(t.tag){case 0:case 11:case 15:var n=t.return;try{ql(4,t)}catch(c){he(t,n,c)}break;case 1:var r=t.stateNode;if(typeof r.componentDidMount=="function"){var i=t.return;try{r.componentDidMount()}catch(c){he(t,i,c)}}var s=t.return;try{Ss(t)}catch(c){he(t,s,c)}break;case 5:var o=t.return;try{Ss(t)}catch(c){he(t,o,c)}}}catch(c){he(t,t.return,c)}if(t===e){O=null;break}var a=t.sibling;if(a!==null){a.return=t.return,O=a;break}O=t.return}}var E1=Math.ceil,Al=wt.ReactCurrentDispatcher,xo=wt.ReactCurrentOwner,Je=wt.ReactCurrentBatchConfig,ne=0,we=null,ye=null,be=0,Ue=0,bn=Kt(0),ke=0,Ir=null,an=0,ei=0,go=0,fr=null,De=null,yo=0,Wn=1/0,ft=null,Ol=!1,zs=null,Ot=null,il=!1,Lt=null,Wl=0,hr=0,Ts=null,gl=-1,yl=0;function _e(){return ne&6?xe():gl!==-1?gl:gl=xe()}function Wt(e){return e.mode&1?ne&2&&be!==0?be&-be:p1.transition!==null?(yl===0&&(yl=bc()),yl):(e=ie,e!==0||(e=window.event,e=e===void 0?16:_c(e.type)),e):1}function it(e,t,n,r){if(50<hr)throw hr=0,Ts=null,Error(_(185));Lr(e,n,r),(!(ne&2)||e!==we)&&(e===we&&(!(ne&2)&&(ei|=n),ke===4&&It(e,be)),Oe(e,r),n===1&&ne===0&&!(t.mode&1)&&(Wn=xe()+500,Yl&&Qt()))}function Oe(e,t){var n=e.callbackNode;pp(e,t);var r=Sl(e,e===we?be:0);if(r===0)n!==null&&Vo(n),e.callbackNode=null,e.callbackPriority=0;else if(t=r&-r,e.callbackPriority!==t){if(n!=null&&Vo(n),t===1)e.tag===0?d1(Da.bind(null,e)):Jc(Da.bind(null,e)),o1(function(){!(ne&6)&&Qt()}),n=null;else{switch(zc(r)){case 1:n=Us;break;case 4:n=Sc;break;case 16:n=wl;break;case 536870912:n=Cc;break;default:n=wl}n=Xu(n,Uu.bind(null,e))}e.callbackPriority=t,e.callbackNode=n}}function Uu(e,t){if(gl=-1,yl=0,ne&6)throw Error(_(327));var n=e.callbackNode;if(In()&&e.callbackNode!==n)return null;var r=Sl(e,e===we?be:0);if(r===0)return null;if(r&30||r&e.expiredLanes||t)t=Bl(e,r);else{t=r;var i=ne;ne|=2;var s=Hu();(we!==e||be!==t)&&(ft=null,Wn=xe()+500,nn(e,t));do try{_1();break}catch(a){Vu(e,a)}while(!0);to(),Al.current=s,ne=i,ye!==null?t=0:(we=null,be=0,t=ke)}if(t!==0){if(t===2&&(i=es(e),i!==0&&(r=i,t=Ps(e,i))),t===1)throw n=Ir,nn(e,0),It(e,r),Oe(e,xe()),n;if(t===6)It(e,r);else{if(i=e.current.alternate,!(r&30)&&!N1(i)&&(t=Bl(e,r),t===2&&(s=es(e),s!==0&&(r=s,t=Ps(e,s))),t===1))throw n=Ir,nn(e,0),It(e,r),Oe(e,xe()),n;switch(e.finishedWork=i,e.finishedLanes=r,t){case 0:case 1:throw Error(_(345));case 2:Jt(e,De,ft);break;case 3:if(It(e,r),(r&130023424)===r&&(t=yo+500-xe(),10<t)){if(Sl(e,0)!==0)break;if(i=e.suspendedLanes,(i&r)!==r){_e(),e.pingedLanes|=e.suspendedLanes&i;break}e.timeoutHandle=as(Jt.bind(null,e,De,ft),t);break}Jt(e,De,ft);break;case 4:if(It(e,r),(r&4194240)===r)break;for(t=e.eventTimes,i=-1;0<r;){var o=31-lt(r);s=1<<o,o=t[o],o>i&&(i=o),r&=~s}if(r=i,r=xe()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*E1(r/1960))-r,10<r){e.timeoutHandle=as(Jt.bind(null,e,De,ft),r);break}Jt(e,De,ft);break;case 5:Jt(e,De,ft);break;default:throw Error(_(329))}}}return Oe(e,xe()),e.callbackNode===n?Uu.bind(null,e):null}function Ps(e,t){var n=fr;return e.current.memoizedState.isDehydrated&&(nn(e,t).flags|=256),e=Bl(e,t),e!==2&&(t=De,De=n,t!==null&&Es(t)),e}function Es(e){De===null?De=e:De.push.apply(De,e)}function N1(e){for(var t=e;;){if(t.flags&16384){var n=t.updateQueue;if(n!==null&&(n=n.stores,n!==null))for(var r=0;r<n.length;r++){var i=n[r],s=i.getSnapshot;i=i.value;try{if(!st(s(),i))return!1}catch{return!1}}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 It(e,t){for(t&=~go,t&=~ei,e.suspendedLanes|=t,e.pingedLanes&=~t,e=e.expirationTimes;0<t;){var n=31-lt(t),r=1<<n;e[n]=-1,t&=~r}}function Da(e){if(ne&6)throw Error(_(327));In();var t=Sl(e,0);if(!(t&1))return Oe(e,xe()),null;var n=Bl(e,t);if(e.tag!==0&&n===2){var r=es(e);r!==0&&(t=r,n=Ps(e,r))}if(n===1)throw n=Ir,nn(e,0),It(e,t),Oe(e,xe()),n;if(n===6)throw Error(_(345));return e.finishedWork=e.current.alternate,e.finishedLanes=t,Jt(e,De,ft),Oe(e,xe()),null}function mo(e,t){var n=ne;ne|=1;try{return e(t)}finally{ne=n,ne===0&&(Wn=xe()+500,Yl&&Qt())}}function cn(e){Lt!==null&&Lt.tag===0&&!(ne&6)&&In();var t=ne;ne|=1;var n=Je.transition,r=ie;try{if(Je.transition=null,ie=1,e)return e()}finally{ie=r,Je.transition=n,ne=t,!(ne&6)&&Qt()}}function vo(){Ue=bn.current,ce(bn)}function nn(e,t){e.finishedWork=null,e.finishedLanes=0;var n=e.timeoutHandle;if(n!==-1&&(e.timeoutHandle=-1,s1(n)),ye!==null)for(n=ye.return;n!==null;){var r=n;switch(Zs(r),r.tag){case 1:r=r.type.childContextTypes,r!=null&&Pl();break;case 3:An(),ce(Fe),ce(Ne),oo();break;case 5:so(r);break;case 4:An();break;case 13:ce(de);break;case 19:ce(de);break;case 10:no(r.type._context);break;case 22:case 23:vo()}n=n.return}if(we=e,ye=e=Bt(e.current,null),be=Ue=t,ke=0,Ir=null,go=ei=an=0,De=fr=null,en!==null){for(t=0;t<en.length;t++)if(n=en[t],r=n.interleaved,r!==null){n.interleaved=null;var i=r.next,s=n.pending;if(s!==null){var o=s.next;s.next=i,r.next=o}n.pending=r}en=null}return e}function Vu(e,t){do{var n=ye;try{if(to(),fl.current=Fl,Rl){for(var r=pe.memoizedState;r!==null;){var i=r.queue;i!==null&&(i.pending=null),r=r.next}Rl=!1}if(on=0,je=ve=pe=null,dr=!1,Pr=0,xo.current=null,n===null||n.return===null){ke=1,Ir=t,ye=null;break}e:{var s=e,o=n.return,a=n,c=t;if(t=be,a.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var d=c,x=a,y=x.tag;if(!(x.mode&1)&&(y===0||y===11||y===15)){var g=x.alternate;g?(x.updateQueue=g.updateQueue,x.memoizedState=g.memoizedState,x.lanes=g.lanes):(x.updateQueue=null,x.memoizedState=null)}var k=wa(o);if(k!==null){k.flags&=-257,Sa(k,o,a,s,t),k.mode&1&&ja(s,d,t),t=k,c=d;var S=t.updateQueue;if(S===null){var m=new Set;m.add(c),t.updateQueue=m}else S.add(c);break e}else{if(!(t&1)){ja(s,d,t),ko();break e}c=Error(_(426))}}else if(ue&&a.mode&1){var N=wa(o);if(N!==null){!(N.flags&65536)&&(N.flags|=256),Sa(N,o,a,s,t),qs(On(c,a));break e}}s=c=On(c,a),ke!==4&&(ke=2),fr===null?fr=[s]:fr.push(s),s=o;do{switch(s.tag){case 3:s.flags|=65536,t&=-t,s.lanes|=t;var p=zu(s,c,t);xa(s,p);break e;case 1:a=c;var u=s.type,f=s.stateNode;if(!(s.flags&128)&&(typeof u.getDerivedStateFromError=="function"||f!==null&&typeof f.componentDidCatch=="function"&&(Ot===null||!Ot.has(f)))){s.flags|=65536,t&=-t,s.lanes|=t;var j=Tu(s,a,t);xa(s,j);break e}}s=s.return}while(s!==null)}Ku(n)}catch(v){t=v,ye===n&&n!==null&&(ye=n=n.return);continue}break}while(!0)}function Hu(){var e=Al.current;return Al.current=Fl,e===null?Fl:e}function ko(){(ke===0||ke===3||ke===2)&&(ke=4),we===null||!(an&268435455)&&!(ei&268435455)||It(we,be)}function Bl(e,t){var n=ne;ne|=2;var r=Hu();(we!==e||be!==t)&&(ft=null,nn(e,t));do try{I1();break}catch(i){Vu(e,i)}while(!0);if(to(),ne=n,Al.current=r,ye!==null)throw Error(_(261));return we=null,be=0,ke}function I1(){for(;ye!==null;)$u(ye)}function _1(){for(;ye!==null&&!rp();)$u(ye)}function $u(e){var t=Gu(e.alternate,e,Ue);e.memoizedProps=e.pendingProps,t===null?Ku(e):ye=t,xo.current=null}function Ku(e){var t=e;do{var n=t.alternate;if(e=t.return,t.flags&32768){if(n=b1(n,t),n!==null){n.flags&=32767,ye=n;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{ke=6,ye=null;return}}else if(n=C1(n,t,Ue),n!==null){ye=n;return}if(t=t.sibling,t!==null){ye=t;return}ye=t=e}while(t!==null);ke===0&&(ke=5)}function Jt(e,t,n){var r=ie,i=Je.transition;try{Je.transition=null,ie=1,L1(e,t,n,r)}finally{Je.transition=i,ie=r}return null}function L1(e,t,n,r){do In();while(Lt!==null);if(ne&6)throw Error(_(327));n=e.finishedWork;var i=e.finishedLanes;if(n===null)return null;if(e.finishedWork=null,e.finishedLanes=0,n===e.current)throw Error(_(177));e.callbackNode=null,e.callbackPriority=0;var s=n.lanes|n.childLanes;if(fp(e,s),e===we&&(ye=we=null,be=0),!(n.subtreeFlags&2064)&&!(n.flags&2064)||il||(il=!0,Xu(wl,function(){return In(),null})),s=(n.flags&15990)!==0,n.subtreeFlags&15990||s){s=Je.transition,Je.transition=null;var o=ie;ie=1;var a=ne;ne|=4,xo.current=null,T1(e,n),Wu(n,e),qp(ss),Cl=!!is,ss=is=null,e.current=n,P1(n),lp(),ne=a,ie=o,Je.transition=s}else e.current=n;if(il&&(il=!1,Lt=e,Wl=i),s=e.pendingLanes,s===0&&(Ot=null),op(n.stateNode),Oe(e,xe()),t!==null)for(r=e.onRecoverableError,n=0;n<t.length;n++)i=t[n],r(i.value,{componentStack:i.stack,digest:i.digest});if(Ol)throw Ol=!1,e=zs,zs=null,e;return Wl&1&&e.tag!==0&&In(),s=e.pendingLanes,s&1?e===Ts?hr++:(hr=0,Ts=e):hr=0,Qt(),null}function In(){if(Lt!==null){var e=zc(Wl),t=Je.transition,n=ie;try{if(Je.transition=null,ie=16>e?16:e,Lt===null)var r=!1;else{if(e=Lt,Lt=null,Wl=0,ne&6)throw Error(_(331));var i=ne;for(ne|=4,O=e.current;O!==null;){var s=O,o=s.child;if(O.flags&16){var a=s.deletions;if(a!==null){for(var c=0;c<a.length;c++){var d=a[c];for(O=d;O!==null;){var x=O;switch(x.tag){case 0:case 11:case 15:pr(8,x,s)}var y=x.child;if(y!==null)y.return=x,O=y;else for(;O!==null;){x=O;var g=x.sibling,k=x.return;if(Fu(x),x===d){O=null;break}if(g!==null){g.return=k,O=g;break}O=k}}}var S=s.alternate;if(S!==null){var m=S.child;if(m!==null){S.child=null;do{var N=m.sibling;m.sibling=null,m=N}while(m!==null)}}O=s}}if(s.subtreeFlags&2064&&o!==null)o.return=s,O=o;else e:for(;O!==null;){if(s=O,s.flags&2048)switch(s.tag){case 0:case 11:case 15:pr(9,s,s.return)}var p=s.sibling;if(p!==null){p.return=s.return,O=p;break e}O=s.return}}var u=e.current;for(O=u;O!==null;){o=O;var f=o.child;if(o.subtreeFlags&2064&&f!==null)f.return=o,O=f;else e:for(o=u;O!==null;){if(a=O,a.flags&2048)try{switch(a.tag){case 0:case 11:case 15:ql(9,a)}}catch(v){he(a,a.return,v)}if(a===o){O=null;break e}var j=a.sibling;if(j!==null){j.return=a.return,O=j;break e}O=a.return}}if(ne=i,Qt(),ut&&typeof ut.onPostCommitFiberRoot=="function")try{ut.onPostCommitFiberRoot($l,e)}catch{}r=!0}return r}finally{ie=n,Je.transition=t}}return!1}function Ra(e,t,n){t=On(n,t),t=zu(e,t,1),e=At(e,t,1),t=_e(),e!==null&&(Lr(e,1,t),Oe(e,t))}function he(e,t,n){if(e.tag===3)Ra(e,e,n);else for(;t!==null;){if(t.tag===3){Ra(t,e,n);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ot===null||!Ot.has(r))){e=On(n,e),e=Tu(t,e,1),t=At(t,e,1),e=_e(),t!==null&&(Lr(t,1,e),Oe(t,e));break}}t=t.return}}function M1(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),t=_e(),e.pingedLanes|=e.suspendedLanes&n,we===e&&(be&n)===n&&(ke===4||ke===3&&(be&130023424)===be&&500>xe()-yo?nn(e,0):go|=n),Oe(e,t)}function Qu(e,t){t===0&&(e.mode&1?(t=Xr,Xr<<=1,!(Xr&130023424)&&(Xr=4194304)):t=1);var n=_e();e=kt(e,t),e!==null&&(Lr(e,t,n),Oe(e,n))}function D1(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Qu(e,n)}function R1(e,t){var n=0;switch(e.tag){case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;default:throw Error(_(314))}r!==null&&r.delete(t),Qu(e,n)}var Gu;Gu=function(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps||Fe.current)Re=!0;else{if(!(e.lanes&n)&&!(t.flags&128))return Re=!1,S1(e,t,n);Re=!!(e.flags&131072)}else Re=!1,ue&&t.flags&1048576&&Zc(t,Il,t.index);switch(t.lanes=0,t.tag){case 2:var r=t.type;xl(e,t),e=t.pendingProps;var i=Dn(t,Ne.current);Nn(t,n),i=co(null,t,r,e,i,n);var s=uo();return t.flags|=1,typeof i=="object"&&i!==null&&typeof i.render=="function"&&i.$$typeof===void 0?(t.tag=1,t.memoizedState=null,t.updateQueue=null,Ae(r)?(s=!0,El(t)):s=!1,t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,lo(t),i.updater=Zl,t.stateNode=i,i._reactInternals=t,xs(t,r,e,n),t=ms(null,t,r,!0,s,n)):(t.tag=0,ue&&s&&Js(t),Ie(null,t,i,n),t=t.child),t;case 16:r=t.elementType;e:{switch(xl(e,t),e=t.pendingProps,i=r._init,r=i(r._payload),t.type=r,i=t.tag=A1(r),e=tt(r,e),i){case 0:t=ys(null,t,r,e,n);break e;case 1:t=za(null,t,r,e,n);break e;case 11:t=Ca(null,t,r,e,n);break e;case 14:t=ba(null,t,r,tt(r.type,e),n);break e}throw Error(_(306,r,""))}return t;case 0:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),ys(e,t,r,i,n);case 1:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),za(e,t,r,i,n);case 3:e:{if(Iu(t),e===null)throw Error(_(387));r=t.pendingProps,s=t.memoizedState,i=s.element,lu(e,t),Ml(t,r,null,n);var o=t.memoizedState;if(r=o.element,s.isDehydrated)if(s={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},t.updateQueue.baseState=s,t.memoizedState=s,t.flags&256){i=On(Error(_(423)),t),t=Ta(e,t,r,n,i);break e}else if(r!==i){i=On(Error(_(424)),t),t=Ta(e,t,r,n,i);break e}else for(Ve=Ft(t.stateNode.containerInfo.firstChild),He=t,ue=!0,rt=null,n=nu(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Rn(),r===i){t=jt(e,t,n);break e}Ie(e,t,r,n)}t=t.child}return t;case 5:return iu(t),e===null&&ps(t),r=t.type,i=t.pendingProps,s=e!==null?e.memoizedProps:null,o=i.children,os(r,i)?o=null:s!==null&&os(r,s)&&(t.flags|=32),Nu(e,t),Ie(e,t,o,n),t.child;case 6:return e===null&&ps(t),null;case 13:return _u(e,t,n);case 4:return io(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Fn(t,null,r,n):Ie(e,t,r,n),t.child;case 11:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),Ca(e,t,r,i,n);case 7:return Ie(e,t,t.pendingProps,n),t.child;case 8:return Ie(e,t,t.pendingProps.children,n),t.child;case 12:return Ie(e,t,t.pendingProps.children,n),t.child;case 10:e:{if(r=t.type._context,i=t.pendingProps,s=t.memoizedProps,o=i.value,oe(_l,r._currentValue),r._currentValue=o,s!==null)if(st(s.value,o)){if(s.children===i.children&&!Fe.current){t=jt(e,t,n);break e}}else for(s=t.child,s!==null&&(s.return=t);s!==null;){var a=s.dependencies;if(a!==null){o=s.child;for(var c=a.firstContext;c!==null;){if(c.context===r){if(s.tag===1){c=yt(-1,n&-n),c.tag=2;var d=s.updateQueue;if(d!==null){d=d.shared;var x=d.pending;x===null?c.next=c:(c.next=x.next,x.next=c),d.pending=c}}s.lanes|=n,c=s.alternate,c!==null&&(c.lanes|=n),fs(s.return,n,t),a.lanes|=n;break}c=c.next}}else if(s.tag===10)o=s.type===t.type?null:s.child;else if(s.tag===18){if(o=s.return,o===null)throw Error(_(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),fs(o,n,t),o=s.sibling}else o=s.child;if(o!==null)o.return=s;else for(o=s;o!==null;){if(o===t){o=null;break}if(s=o.sibling,s!==null){s.return=o.return,o=s;break}o=o.return}s=o}Ie(e,t,i.children,n),t=t.child}return t;case 9:return i=t.type,r=t.pendingProps.children,Nn(t,n),i=Ze(i),r=r(i),t.flags|=1,Ie(e,t,r,n),t.child;case 14:return r=t.type,i=tt(r,t.pendingProps),i=tt(r.type,i),ba(e,t,r,i,n);case 15:return Pu(e,t,t.type,t.pendingProps,n);case 17:return r=t.type,i=t.pendingProps,i=t.elementType===r?i:tt(r,i),xl(e,t),t.tag=1,Ae(r)?(e=!0,El(t)):e=!1,Nn(t,n),bu(t,r,i),xs(t,r,i,n),ms(null,t,r,!0,e,n);case 19:return Lu(e,t,n);case 22:return Eu(e,t,n)}throw Error(_(156,t.tag))};function Xu(e,t){return wc(e,t)}function F1(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ye(e,t,n,r){return new F1(e,t,n,r)}function jo(e){return e=e.prototype,!(!e||!e.isReactComponent)}function A1(e){if(typeof e=="function")return jo(e)?1:0;if(e!=null){if(e=e.$$typeof,e===Os)return 11;if(e===Ws)return 14}return 2}function Bt(e,t){var n=e.alternate;return n===null?(n=Ye(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&14680064,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n}function ml(e,t,n,r,i,s){var o=2;if(r=e,typeof e=="function")jo(e)&&(o=1);else if(typeof e=="string")o=5;else e:switch(e){case xn:return rn(n.children,i,s,t);case As:o=8,i|=8;break;case Oi:return e=Ye(12,n,t,i|2),e.elementType=Oi,e.lanes=s,e;case Wi:return e=Ye(13,n,t,i),e.elementType=Wi,e.lanes=s,e;case Bi:return e=Ye(19,n,t,i),e.elementType=Bi,e.lanes=s,e;case ic:return ti(n,i,s,t);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case rc:o=10;break e;case lc:o=9;break e;case Os:o=11;break e;case Ws:o=14;break e;case Pt:o=16,r=null;break e}throw Error(_(130,e==null?e:typeof e,""))}return t=Ye(o,n,t,i),t.elementType=e,t.type=r,t.lanes=s,t}function rn(e,t,n,r){return e=Ye(7,e,r,t),e.lanes=n,e}function ti(e,t,n,r){return e=Ye(22,e,r,t),e.elementType=ic,e.lanes=n,e.stateNode={isHidden:!1},e}function Mi(e,t,n){return e=Ye(6,e,null,t),e.lanes=n,e}function Di(e,t,n){return t=Ye(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}function O1(e,t,n,r,i){this.tag=t,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=xi(0),this.expirationTimes=xi(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=xi(0),this.identifierPrefix=r,this.onRecoverableError=i,this.mutableSourceEagerHydrationData=null}function wo(e,t,n,r,i,s,o,a,c){return e=new O1(e,t,n,a,c),t===1?(t=1,s===!0&&(t|=8)):t=0,s=Ye(3,null,null,t),e.current=s,s.stateNode=e,s.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},lo(s),e}function W1(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:hn,key:r==null?null:""+r,children:e,containerInfo:t,implementation:n}}function Yu(e){if(!e)return Ht;e=e._reactInternals;e:{if(pn(e)!==e||e.tag!==1)throw Error(_(170));var t=e;do{switch(t.tag){case 3:t=t.stateNode.context;break e;case 1:if(Ae(t.type)){t=t.stateNode.__reactInternalMemoizedMergedChildContext;break e}}t=t.return}while(t!==null);throw Error(_(171))}if(e.tag===1){var n=e.type;if(Ae(n))return Yc(e,n,t)}return t}function Ju(e,t,n,r,i,s,o,a,c){return e=wo(n,r,!0,e,i,s,o,a,c),e.context=Yu(null),n=e.current,r=_e(),i=Wt(n),s=yt(r,i),s.callback=t??null,At(n,s,i),e.current.lanes=i,Lr(e,i,r),Oe(e,r),e}function ni(e,t,n,r){var i=t.current,s=_e(),o=Wt(i);return n=Yu(n),t.context===null?t.context=n:t.pendingContext=n,t=yt(s,o),t.payload={element:e},r=r===void 0?null:r,r!==null&&(t.callback=r),e=At(i,t,o),e!==null&&(it(e,i,o,s),pl(e,i,o)),o}function Ul(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Fa(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function So(e,t){Fa(e,t),(e=e.alternate)&&Fa(e,t)}function B1(){return null}var Zu=typeof reportError=="function"?reportError:function(e){console.error(e)};function Co(e){this._internalRoot=e}ri.prototype.render=Co.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(_(409));ni(e,t,null,null)};ri.prototype.unmount=Co.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;cn(function(){ni(null,e,null,null)}),t[vt]=null}};function ri(e){this._internalRoot=e}ri.prototype.unstable_scheduleHydration=function(e){if(e){var t=Ec();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Nt.length&&t!==0&&t<Nt[n].priority;n++);Nt.splice(n,0,e),n===0&&Ic(e)}};function bo(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function li(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Aa(){}function U1(e,t,n,r,i){if(i){if(typeof r=="function"){var s=r;r=function(){var d=Ul(o);s.call(d)}}var o=Ju(t,r,e,0,null,!1,!1,"",Aa);return e._reactRootContainer=o,e[vt]=o.current,Sr(e.nodeType===8?e.parentNode:e),cn(),o}for(;i=e.lastChild;)e.removeChild(i);if(typeof r=="function"){var a=r;r=function(){var d=Ul(c);a.call(d)}}var c=wo(e,0,!1,null,null,!1,!1,"",Aa);return e._reactRootContainer=c,e[vt]=c.current,Sr(e.nodeType===8?e.parentNode:e),cn(function(){ni(t,c,n,r)}),c}function ii(e,t,n,r,i){var s=n._reactRootContainer;if(s){var o=s;if(typeof i=="function"){var a=i;i=function(){var c=Ul(o);a.call(c)}}ni(t,o,e,i)}else o=U1(n,t,e,i,r);return Ul(o)}Tc=function(e){switch(e.tag){case 3:var t=e.stateNode;if(t.current.memoizedState.isDehydrated){var n=lr(t.pendingLanes);n!==0&&(Vs(t,n|1),Oe(t,xe()),!(ne&6)&&(Wn=xe()+500,Qt()))}break;case 13:cn(function(){var r=kt(e,1);if(r!==null){var i=_e();it(r,e,1,i)}}),So(e,1)}};Hs=function(e){if(e.tag===13){var t=kt(e,134217728);if(t!==null){var n=_e();it(t,e,134217728,n)}So(e,134217728)}};Pc=function(e){if(e.tag===13){var t=Wt(e),n=kt(e,t);if(n!==null){var r=_e();it(n,e,t,r)}So(e,t)}};Ec=function(){return ie};Nc=function(e,t){var n=ie;try{return ie=e,t()}finally{ie=n}};Ji=function(e,t,n){switch(t){case"input":if(Hi(e,n),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll("input[name="+JSON.stringify(""+t)+'][type="radio"]'),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=Xl(r);if(!i)throw Error(_(90));oc(r),Hi(r,i)}}}break;case"textarea":cc(e,n);break;case"select":t=n.value,t!=null&&zn(e,!!n.multiple,t,!1)}};gc=mo;yc=cn;var V1={usingClientEntryPoint:!1,Events:[Dr,vn,Xl,hc,xc,mo]},er={findFiberByHostInstance:qt,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},H1={bundleType:er.bundleType,version:er.version,rendererPackageName:er.rendererPackageName,rendererConfig:er.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:wt.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=kc(e),e===null?null:e.stateNode},findFiberByHostInstance:er.findFiberByHostInstance||B1,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var sl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!sl.isDisabled&&sl.supportsFiber)try{$l=sl.inject(H1),ut=sl}catch{}}Ke.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=V1;Ke.createPortal=function(e,t){var n=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!bo(t))throw Error(_(200));return W1(e,t,null,n)};Ke.createRoot=function(e,t){if(!bo(e))throw Error(_(299));var n=!1,r="",i=Zu;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onRecoverableError!==void 0&&(i=t.onRecoverableError)),t=wo(e,1,!1,null,null,n,!1,r,i),e[vt]=t.current,Sr(e.nodeType===8?e.parentNode:e),new Co(t)};Ke.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(_(188)):(e=Object.keys(e).join(","),Error(_(268,e)));return e=kc(t),e=e===null?null:e.stateNode,e};Ke.flushSync=function(e){return cn(e)};Ke.hydrate=function(e,t,n){if(!li(t))throw Error(_(200));return ii(null,e,t,!0,n)};Ke.hydrateRoot=function(e,t,n){if(!bo(e))throw Error(_(405));var r=n!=null&&n.hydratedSources||null,i=!1,s="",o=Zu;if(n!=null&&(n.unstable_strictMode===!0&&(i=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onRecoverableError!==void 0&&(o=n.onRecoverableError)),t=Ju(t,null,e,1,n??null,i,!1,s,o),e[vt]=t.current,Sr(e),r)for(e=0;e<r.length;e++)n=r[e],i=n._getVersion,i=i(n._source),t.mutableSourceEagerHydrationData==null?t.mutableSourceEagerHydrationData=[n,i]:t.mutableSourceEagerHydrationData.push(n,i);return new ri(t)};Ke.render=function(e,t,n){if(!li(t))throw Error(_(200));return ii(null,e,t,!1,n)};Ke.unmountComponentAtNode=function(e){if(!li(e))throw Error(_(40));return e._reactRootContainer?(cn(function(){ii(null,null,e,!1,function(){e._reactRootContainer=null,e[vt]=null})}),!0):!1};Ke.unstable_batchedUpdates=mo;Ke.unstable_renderSubtreeIntoContainer=function(e,t,n,r){if(!li(n))throw Error(_(200));if(e==null||e._reactInternals===void 0)throw Error(_(38));return ii(e,t,n,!1,r)};Ke.version="18.3.1-next-f1338f8080-20240426";function qu(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qu)}catch(e){console.error(e)}}qu(),qa.exports=Ke;var $1=qa.exports,Oa=$1;Fi.createRoot=Oa.createRoot,Fi.hydrateRoot=Oa.hydrateRoot;const ed=C.createContext(void 0),K1=({children:e})=>{const[t,n]=C.useState(!1),[r,i]=C.useState(!1),[s,o]=C.useState(!0),[a,c]=C.useState(()=>sessionStorage.getItem("sessionToken")),[d,x]=C.useState(()=>{const f=localStorage.getItem("theme");return f==="light"||f==="dark"?f:"dark"}),y=async()=>{try{const j=await(await fetch("/api/auth/status")).json();n(j.initialized),i(j.unlocked),j.unlocked||(c(null),sessionStorage.removeItem("sessionToken"))}catch(f){console.error("Failed to check auth status:",f)}finally{o(!1)}};C.useEffect(()=>{y()},[]),C.useEffect(()=>{document.documentElement.setAttribute("data-theme",d),localStorage.setItem("theme",d)},[d]);const g=()=>{x(f=>f==="dark"?"light":"dark")},k=async(f,j)=>{o(!0);try{const v=await fetch("/api/auth/initialize",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:f,hint:j})}),w=await v.json();return v.ok&&w.success?(c(w.token),sessionStorage.setItem("sessionToken",w.token),n(!0),i(!0),!0):!1}catch(v){return console.error("Failed to initialize vault:",v),!1}finally{o(!1)}},S=async f=>{o(!0);try{const j=await fetch("/api/auth/unlock",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:f})}),v=await j.json();return j.ok&&v.success?(c(v.token),sessionStorage.setItem("sessionToken",v.token),i(!0),!0):!1}catch(j){return console.error("Failed to unlock vault:",j),!1}finally{o(!1)}},m=async()=>{try{await fetch("/api/auth/lock",{method:"POST"})}catch(f){console.error("Failed to lock vault:",f)}finally{c(null),sessionStorage.removeItem("sessionToken"),i(!1)}},N=async()=>{try{return(await(await fetch("/api/auth/hint")).json()).hint||null}catch(f){return console.error("Failed to get hint:",f),null}},p=async(f,j={})=>{const v={...j.headers,Authorization:`Bearer ${a}`,"Content-Type":"application/json"},w=await fetch(f,{...j,headers:v});return w.status===401&&(c(null),sessionStorage.removeItem("sessionToken"),i(!1)),w},u=f=>{c(f),sessionStorage.setItem("sessionToken",f)};return l.jsx(ed.Provider,{value:{isInitialized:t,isAuthenticated:r,isLoading:s,sessionToken:a,theme:d,toggleTheme:g,checkStatus:y,initializeVault:k,unlockVault:S,lockVault:m,getHint:N,fetchWithAuth:p,updateSessionToken:u},children:e})},St=()=>{const e=C.useContext(ed);if(!e)throw new Error("useAuth must be used within an AuthProvider");return e};/**
41
41
  * @license lucide-react v0.378.0 - ISC
42
42
  *
43
43
  * This source code is licensed under the ISC license.
@@ -142,7 +142,7 @@ Error generating stack: `+s.message+`
142
142
  *
143
143
  * This source code is licensed under the ISC license.
144
144
  * See the LICENSE file in the root directory of this source tree.
145
- */const Mn=J("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
145
+ */const Ln=J("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
146
146
  * @license lucide-react v0.378.0 - ISC
147
147
  *
148
148
  * This source code is licensed under the ISC license.
@@ -257,17 +257,17 @@ Error generating stack: `+s.message+`
257
257
  *
258
258
  * This source code is licensed under the ISC license.
259
259
  * See the LICENSE file in the root directory of this source tree.
260
- */const $n=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),uf=()=>{const{isInitialized:e,initializeVault:t,unlockVault:n,getHint:r,theme:i,toggleTheme:s}=St(),[o,a]=C.useState(""),[c,d]=C.useState(""),[x,g]=C.useState(!1),[y,k]=C.useState(null),[S,m]=C.useState(!1),[N,p]=C.useState(null),[u,f]=C.useState(!1);Ut.useEffect(()=>{e&&r().then(w=>{w==="Mật khẩu mặc định là 180823"&&f(!0)})},[e]);const j=async w=>{if(w.preventDefault(),!!o){k(null),m(!0);try{let z=!1;if(e)z=await n(o);else{if(o.length<8){k("Mật khẩu Master phải từ 8 ký tự trở lên"),m(!1);return}z=await t(o,c)}z||k(e?"Mật khẩu Master không chính xác!":"Không thể khởi tạo vault!")}catch{k("Đã xảy ra lỗi hệ thống, vui lòng thử lại.")}finally{m(!1)}}},v=async()=>{const w=await r();p(w||"Không có gợi ý nào được thiết lập.")};return l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",padding:"20px",position:"relative"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:s,style:{position:"absolute",top:"20px",right:"20px",borderRadius:"50%",width:"40px",height:"40px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10},title:i==="dark"?"Chuyển sang chế độ sáng":"Chuyển sang chế độ tối",children:i==="dark"?l.jsx(hd,{size:18}):l.jsx(od,{size:18})}),l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"450px",padding:"40px",display:"flex",flexDirection:"column",gap:"24px"},children:[l.jsxs("div",{style:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[l.jsx("div",{style:{background:"var(--primary-gradient)",padding:"14px",borderRadius:"50%",display:"inline-flex",boxShadow:"var(--glow-accent)"},children:l.jsx(dd,{size:32,color:"#030712"})}),l.jsx("h2",{className:"gradient-text",style:{fontSize:"28px",fontWeight:700},children:"Account Manager"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:e?"Nhập mật khẩu Master để giải mã dữ liệu của bạn":"Tạo mật khẩu Master để bắt đầu lưu trữ bảo mật"})]}),e&&u&&l.jsxs("div",{style:{background:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",color:"var(--text-accent)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px",lineHeight:"1.5",display:"flex",flexDirection:"column",gap:"4px",textAlign:"left"},children:[l.jsx("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"6px"},children:l.jsxs("span",{children:["💡 Mật khẩu mặc định: ",l.jsx("strong",{children:"180823"})]})}),l.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"12px"},children:["Vui lòng sử dụng mật khẩu trên để đăng nhập lần đầu, sau đó đổi mật khẩu trong phần ",l.jsx("strong",{children:"Cài đặt"})," để bảo vệ dữ liệu."]})]}),l.jsxs("form",{onSubmit:j,style:{display:"flex",flexDirection:"column",gap:"20px"},children:[y&&l.jsx("div",{style:{background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.3)",color:"#ff6b6b",padding:"12px 16px",borderRadius:"8px",fontSize:"13px",textAlign:"center"},children:y}),l.jsxs("div",{className:"form-group",style:{position:"relative"},children:[l.jsx("label",{className:"form-label",htmlFor:"password",children:"Mật khẩu Master"}),l.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[l.jsx("input",{id:"password",type:x?"text":"password",className:"form-input",placeholder:"Nhập mật khẩu chính...",value:o,onChange:w=>a(w.target.value),style:{paddingRight:"46px"},disabled:S,autoComplete:"current-password"}),l.jsx("button",{type:"button",onClick:()=>g(!x),style:{position:"absolute",right:"12px",background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},children:x?l.jsx(_n,{size:18}):l.jsx(Mn,{size:18})})]})]}),!e&&l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",htmlFor:"hint",children:"Gợi ý mật khẩu (Tùy chọn)"}),l.jsx("input",{id:"hint",type:"text",className:"form-input",placeholder:"Nhập gợi ý gợi nhớ mật khẩu...",value:c,onChange:w=>d(w.target.value),disabled:S})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",padding:"14px",fontSize:"15px"},disabled:S,children:S?l.jsx("div",{className:"spinner",style:{width:"18px",height:"18px"}}):l.jsxs(l.Fragment,{children:[l.jsx(lf,{size:18}),e?"Mở khóa Vault":"Thiết lập Vault"]})})]}),e&&l.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:"8px"},children:N?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"13px",color:"var(--text-accent)",background:"var(--bg-main)",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-color)"},children:[l.jsx(rf,{size:14}),l.jsxs("span",{children:["Gợi ý: ",l.jsx("strong",{children:N})]})]}):l.jsx("button",{type:"button",onClick:v,style:{background:"none",border:"none",color:"var(--text-muted)",fontSize:"13px",cursor:"pointer",textDecoration:"underline"},children:"Quên mật khẩu? Hiển thị gợi ý"})})]})]})},df=({search:e,setSearch:t,theme:n,toggleTheme:r,onSmartPasteOpen:i,onLockVault:s,onImportExportOpen:o})=>{const[a,c]=C.useState(!1),d=C.useRef(null);C.useEffect(()=>{const g=y=>{var k;(y.metaKey||y.ctrlKey)&&y.key.toLowerCase()==="k"&&(y.preventDefault(),(k=d.current)==null||k.focus())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[]);const x=typeof window<"u"&&/Mac|iPhone|iPod|iPad/i.test(navigator.userAgent||"");return l.jsxs("header",{className:"glass-panel",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 20px",width:"100%",position:"sticky",top:"0",zIndex:100},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flex:1,marginRight:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[l.jsx(ud,{size:28,style:{color:"var(--text-accent)"}}),l.jsx("h1",{className:"gradient-text",style:{fontSize:"22px",fontWeight:800},children:"Account Manager"})]}),l.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:"320px",flexShrink:1},children:[l.jsx(si,{size:18,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{ref:d,type:"text",className:"form-input",placeholder:"Tìm kiếm tài khoản, website...",value:e,onChange:g=>t(g.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),style:{paddingLeft:"38px",paddingRight:"60px",borderRadius:"24px",width:"100%",padding:"8px 16px 8px 38px"},"aria-label":"Tìm kiếm tài khoản và mật khẩu"}),!a&&!e&&l.jsxs("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:"3px",padding:"2px 6px",borderRadius:"4px",background:"var(--btn-secondary-bg)",border:"1px solid var(--border-color)",fontSize:"10px",color:"var(--text-secondary)",pointerEvents:"none",userSelect:"none",fontFamily:"monospace"},children:[l.jsx("span",{children:x?"⌘":"Ctrl"}),l.jsx("span",{children:"+"}),l.jsx("span",{children:"K"})]})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:r,style:{padding:"6px",borderRadius:"50%",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},title:n==="dark"?"Chuyển sang chế độ sáng":"Chuyển sang chế độ tối",children:n==="dark"?l.jsx(hd,{size:16}):l.jsx(od,{size:16})}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:o,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",fontSize:"13px"},children:[l.jsx(Bn,{size:16}),"Nhập / Xuất"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:i,style:{padding:"7px 14px",fontSize:"13px"},children:[l.jsx(ef,{size:16}),"Dán nhanh"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:s,style:{padding:"7px 14px",fontSize:"13px"},children:[l.jsx(of,{size:16}),"Khóa Vault"]})]})]})},oi=({name:e,size:t=16,className:n=""})=>{const r=e.toLowerCase();return r.includes("google")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}):r.includes("facebook")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12.073",r:"11.5",fill:"#FFFFFF"}),l.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",fill:"#1877F2"})]}):r.includes("github")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",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.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.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.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 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.579.688.481C19.137 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z"})}):r.includes("hotmail")||r.includes("outlook")||r.includes("microsoft")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 512 512",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"outlook-svgid-1",gradientUnits:"userSpaceOnUse",x1:"315.5344",y1:"-877.4263",x2:"315.5344",y2:"-651.1933",gradientTransform:"matrix(1 0 0 1 0 1145.3334)",children:[l.jsx("stop",{offset:"0",stopColor:"#35B8F1"}),l.jsx("stop",{offset:"1",stopColor:"#28A8EA"})]}),l.jsxs("linearGradient",{id:"outlook-svgid-2",gradientUnits:"userSpaceOnUse",x1:"45.5066",y1:"-1037.3639",x2:"216.4467",y2:"-741.3027",gradientTransform:"matrix(1 0 0 1 0 1145.3334)",children:[l.jsx("stop",{offset:"0",stopColor:"#1784D9"}),l.jsx("stop",{offset:"0.5",stopColor:"#107AD5"}),l.jsx("stop",{offset:"1",stopColor:"#0A63C9"})]})]}),l.jsx("path",{fill:"#0A2767",d:"M512,267.91c0.03-4-2.04-7.73-5.45-9.82h-0.06l-0.21-0.12L328.86,152.95c-0.77-0.52-1.56-0.99-2.38-1.42 c-6.85-3.53-14.99-3.53-21.84,0c-0.82,0.43-1.62,0.9-2.38,1.42L124.84,257.96l-0.21,0.12c-5.42,3.37-7.08,10.5-3.71,15.92 c0.99,1.6,2.36,2.93,3.99,3.88L302.32,382.9c0.77,0.51,1.56,0.99,2.38,1.42c6.85,3.53,14.99,3.53,21.84,0 c0.82-0.43,1.61-0.9,2.38-1.42l177.41-105.02C509.88,275.82,512.04,272.01,512,267.91z"}),l.jsx("path",{fill:"#0364B8",d:"M145.53,197.79h116.43v106.72H145.53V197.79z M488.19,89.3V40.48c0.28-12.21-9.38-22.33-21.59-22.62H164.47 c-12.21,0.29-21.87,10.42-21.59,22.62V89.3l178.6,47.63L488.19,89.3z"}),l.jsx("path",{fill:"#0078D4",d:"M142.88,89.3h119.07v107.16H142.88V89.3z"}),l.jsx("path",{fill:"#28A8EA",d:"M381.02,89.3H261.95v107.16l119.07,107.16h107.16V196.47L381.02,89.3z"}),l.jsx("path",{fill:"#0078D4",d:"M261.95,196.47h119.07v107.16H261.95V196.47z"}),l.jsx("path",{fill:"#0364B8",d:"M261.95,303.63h119.07v107.16H261.95V303.63z"}),l.jsx("path",{fill:"#14447D",d:"M145.53,304.51h116.43v97.02H145.53V304.51z"}),l.jsx("path",{fill:"#0078D4",d:"M381.02,303.63h107.16v107.16H381.02V303.63z"}),l.jsx("path",{fill:"url(#outlook-svgid-1)",d:"M506.55,277.23l-0.23,0.12l-177.41,99.78c-0.77,0.48-1.56,0.93-2.38,1.33c-3.01,1.43-6.29,2.25-9.62,2.38 l-9.69-5.67c-0.82-0.41-1.61-0.87-2.38-1.37l-179.8-102.61h-0.08l-5.88-3.29V469.9c0.09,13.48,11.09,24.33,24.56,24.24h344.18 c0.2,0,0.38-0.1,0.6-0.1c2.85-0.18,5.65-0.77,8.33-1.74c1.16-0.49,2.28-1.07,3.35-1.74c0.8-0.45,2.17-1.44,2.17-1.44 c6.1-4.51,9.71-11.64,9.74-19.23V267.91C512,271.77,509.91,275.33,506.55,277.23z"}),l.jsx("path",{fill:"#0A2767",opacity:.5,d:"M502.47,267.11v12.38L316.96,407.22L124.9,271.28c0-0.07-0.05-0.12-0.12-0.12l0,0l-17.62-10.6v-8.93l7.26-0.12 l15.36,8.81l0.36,0.12l1.31,0.83c0,0,180.51,103,180.99,103.23l6.91,4.05c0.6-0.24,1.19-0.48,1.91-0.71 c0.36-0.24,179.2-100.85,179.2-100.85L502.47,267.11z"}),l.jsx("path",{fill:"#1490DF",d:"M506.55,277.23l-0.23,0.13l-177.41,99.78c-0.77,0.48-1.56,0.93-2.38,1.33c-6.89,3.37-14.95,3.37-21.84,0 c-0.82-0.4-1.61-0.85-2.38-1.33l-177.41-99.78l-0.21-0.13c-3.43-1.86-5.57-5.43-5.61-9.32V469.9c0.09,13.47,11.08,24.33,24.55,24.24 c0,0,0,0,0,0h343.83c13.47,0.09,24.47-10.77,24.55-24.24c0,0,0,0,0,0V267.91C512,271.77,509.91,275.33,506.55,277.23z"}),l.jsx("path",{fill:"#000000",opacity:.1,d:"M331.49,375.67l-2.66,1.49c-0.77,0.49-1.56,0.94-2.38,1.35c-2.93,1.44-6.11,2.28-9.36,2.48l67.5,79.82 l117.75,28.37c3.23-2.44,5.79-5.64,7.47-9.32L331.49,375.67z"}),l.jsx("path",{fill:"#000000",opacity:.05,d:"M343.52,368.9l-14.68,8.25c-0.77,0.49-1.56,0.94-2.38,1.35c-2.93,1.44-6.11,2.28-9.36,2.48l31.62,87.19 l153.66,20.97c6.05-4.54,9.62-11.67,9.62-19.24v-2.61L343.52,368.9z"}),l.jsx("path",{fill:"#28A8EA",d:"M143.96,494.14h343.46c5.29,0.03,10.44-1.64,14.7-4.76L307.2,375.2c-0.82-0.41-1.61-0.87-2.38-1.37 l-179.8-102.61h-0.08l-5.87-3.31v201.3C119.06,482.96,130.2,494.13,143.96,494.14C143.96,494.14,143.96,494.14,143.96,494.14z"}),l.jsx("path",{fill:"#000000",opacity:.1,d:"M285.77,134.94v253.98c-0.02,8.9-5.44,16.91-13.69,20.24c-2.56,1.1-5.31,1.67-8.1,1.67H119.07v-285.8h23.81 v-11.91h121.09C276.01,113.16,285.74,122.91,285.77,134.94z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M273.86,146.85v253.98c0.03,2.88-0.58,5.72-1.79,8.33c-3.31,8.15-11.21,13.5-20,13.54h-133V125.02h133 c3.45-0.03,6.86,0.83,9.88,2.5C269.25,131.2,273.86,138.68,273.86,146.85z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M273.86,146.85v230.16c-0.06,12.02-9.77,21.77-21.79,21.87h-133V125.02h133c3.45-0.03,6.86,0.83,9.88,2.5 C269.25,131.2,273.86,138.68,273.86,146.85z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M261.95,146.85v230.16c-0.01,12.04-9.75,21.81-21.79,21.87H119.07V125.02h121.09 c12.04,0.01,21.8,9.77,21.79,21.81C261.95,146.84,261.95,146.84,261.95,146.85z"}),l.jsx("path",{fill:"url(#outlook-svgid-2)",d:"M21.83,125.02h218.3c12.05,0,21.83,9.77,21.83,21.83v218.3c0,12.05-9.77,21.83-21.83,21.83H21.83 C9.77,386.98,0,377.2,0,365.15v-218.3C0,134.8,9.77,125.02,21.83,125.02z"}),l.jsx("path",{fill:"#FFFFFF",d:"M68.22,216.56c5.38-11.46,14.06-21.05,24.93-27.54c12.04-6.89,25.75-10.33,39.61-9.93 c12.85-0.28,25.53,2.98,36.66,9.42c10.46,6.24,18.89,15.38,24.25,26.31c5.85,12.05,8.76,25.31,8.5,38.7 c0.28,13.99-2.71,27.86-8.75,40.48c-5.49,11.33-14.19,20.79-25,27.23c-11.56,6.64-24.71,9.98-38.03,9.67 c-13.13,0.32-26.09-2.98-37.47-9.53c-10.55-6.25-19.08-15.4-24.58-26.36c-5.88-11.87-8.83-24.99-8.6-38.23 C59.5,242.91,62.4,229.16,68.22,216.56z M94.79,281.22c2.87,7.25,7.73,13.53,14.03,18.12c6.41,4.48,14.09,6.79,21.91,6.6 c8.33,0.33,16.54-2.06,23.39-6.81c6.22-4.58,10.95-10.88,13.62-18.12c2.99-8.09,4.46-16.66,4.35-25.28c0.09-8.7-1.29-17.36-4.1-25.6 c-2.48-7.44-7.06-14-13.19-18.88c-6.68-4.97-14.86-7.5-23.18-7.14c-7.99-0.21-15.84,2.12-22.42,6.66 c-6.4,4.61-11.36,10.95-14.29,18.28c-6.5,16.79-6.54,35.4-0.1,52.21L94.79,281.22z"}),l.jsx("path",{fill:"#50D9FF",d:"M381.02,89.3h107.16v107.16H381.02V89.3z"})]}):r.includes("twitter")||r.includes(" x ")||r==="x"?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}):r.includes("threads")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.589 12c.027 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.964-.065-1.19.408-2.285 1.33-3.082.88-.76 2.119-1.207 3.583-1.291a13.853 13.853 0 0 1 3.02.142c-.126-.742-.375-1.332-.75-1.757-.513-.586-1.308-.883-2.359-.89h-.029c-.844 0-1.992.232-2.721 1.32L7.734 7.847c.98-1.454 2.568-2.256 4.478-2.256h.044c3.194.02 5.097 1.975 5.287 5.388.108.046.216.094.321.142 1.49.7 2.58 1.761 3.154 3.07.797 1.82.871 4.79-1.548 7.158-1.85 1.81-4.094 2.628-7.277 2.65Zm1.003-11.69c-.242 0-.487.007-.739.021-1.836.103-2.98.946-2.916 2.143.067 1.256 1.452 1.839 2.784 1.767 1.224-.065 2.818-.543 3.086-3.71a10.5 10.5 0 0 0-2.215-.221z"})}):r.includes("apple")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}):r.includes("aws")||r.includes("amazon")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#FF9900",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"})}):r.includes("tidbcloud")||r.includes("tidb")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#00D2C4",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M12 0 1.609 6.001v11.998L11.999 24l10.393-6.001V6.001ZM8.535 17.999v-7.998L5.07 12V8L12 4l3.462 2-3.464 2.001v12Zm6.93 0v-7.997l3.464-2v7.997z"})}):r.includes("gmailworkspace")||r.includes("gmail")||r.includes("workspace")?l.jsxs("svg",{width:t,height:t,viewBox:"52 42 88 66",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{fill:"#4285F4",d:"M58 108h14V74L52 59v43c0 3.32 2.69 6 6 6"}),l.jsx("path",{fill:"#34A853",d:"M120 108h14c3.32 0 6-2.69 6-6V59l-20 15"}),l.jsx("path",{fill:"#FBBC04",d:"M120 48v26l20-15v-8c0-7.42-8.47-11.65-14.4-7.2"}),l.jsx("path",{fill:"#EA4335",d:"M72 74V48l24 18 24-18v26L96 92"}),l.jsx("path",{fill:"#C5221F",d:"M52 51v8l20 15V48l-5.6-4.2c-5.94-4.45-14.4-.22-14.4 7.2"})]}):r.includes("vercel")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M24 22.525H0l12-21.05 12 21.05z"})}):r.includes("cloudinary")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#0078FF",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M24 14.8598c0 2.1729-1.3757 3.974-3.5903 4.6996l-.0995.0318V17.989c1.3777-.5805 2.1869-1.7275 2.1869-3.1291-.0072-2-1.6087-3.6288-3.6082-3.6699h-.5964l-.1432-.5686c-.7025-2.8996-3.2886-4.9489-6.2721-4.97a6.3915 6.3915 0 0 0-5.811 3.664l-.1828.3757-.4175.0437a4.4311 4.4311 0 0 0-3.3052 2.088c-1.2803 2.0856-.6274 4.8143 1.4583 6.0947v1.6897h-.01l-.149-.0675a5.9402 5.9402 0 0 1-3.3658-4.3494c-.5787-3.2291 1.57-6.3161 4.7991-6.8948a7.8766 7.8766 0 0 1 6.9839-4.149c3.4724.025 6.535 2.28 7.5901 5.5883 2.5789.3366 4.5138 2.5245 4.5327 5.1251zm-15.3176-1.322h.5647a.0656.0656 0 0 0 .0457-.1113L7.084 11.2158l-.0007-.0007a.0656.0656 0 0 0-.0927.0007L4.78 13.4265a.0656.0656 0 0 0 .0477.1113h.5566a.0656.0656 0 0 1 .0657.0656v5.0574c0 .6588.534 1.1928 1.1928 1.1928H9.247a.0656.0656 0 0 0 .0457-.1113l-.33-.33a1.1928 1.1928 0 0 1-.348-.839v-4.97a.0676.0676 0 0 1 .0676-.0655zm9.769 2.5466h.5667a.0655.0655 0 0 0 .0457-.1133l-2.2107-2.2087-.0015-.0015a.0636.0636 0 0 0-.0899.0015L14.551 15.971a.0657.0657 0 0 0 .0457.1133h.5567a.0656.0656 0 0 1 .0656.0656v2.5108c0 .6588.534 1.1928 1.1928 1.1928h2.6063a.0655.0655 0 0 0 .0457-.1113l-.33-.33a1.1928 1.1928 0 0 1-.348-.839V16.15a.0656.0656 0 0 1 .0657-.0656zm-4.8844-1.2743h.5646a.0656.0656 0 0 0 .0477-.1114l-2.2107-2.2027-.0006-.0006a.0656.0656 0 0 0-.0928.0006l-2.2087 2.2068a.0656.0656 0 0 0 .0457.1113h.5626a.0676.0676 0 0 1 .0657.0676v3.7791c0 .6588.534 1.1928 1.1928 1.1928h2.5983a.0656.0656 0 0 0 .0477-.1113l-.332-.33a1.193 1.193 0 0 1-.346-.839v-3.6956c0-.0366.0291-.0665.0657-.0676z"})}):r.includes("tiktok")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#000000"}),l.jsxs("g",{transform:"scale(0.7) translate(5.14, 5.14)",children:[l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#25F4EE",transform:"translate(-0.5, -0.5)"}),l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#FE094C",transform:"translate(0.5, 0.5)"}),l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#FFFFFF"})]})]}):r.includes("instagram")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"instagram-gradient-new",x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#fdf497"}),l.jsx("stop",{offset:"5%",stopColor:"#fdf497"}),l.jsx("stop",{offset:"28%",stopColor:"#fd5949"}),l.jsx("stop",{offset:"75%",stopColor:"#d6249f"}),l.jsx("stop",{offset:"100%",stopColor:"#285AEB"})]})}),l.jsx("path",{d:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z",fill:"url(#instagram-gradient-new)"})]}):r.includes("shopee")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#EE4D2D",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M15.9414 17.9633c.229-1.879-.981-3.077-4.1758-4.0969-1.548-.528-2.277-1.22-2.26-2.1719.065-1.056 1.048-1.825 2.352-1.85a5.2898 5.2898 0 0 1 2.8838.89c.116.072.197.06.263-.039.09-.145.315-.494.39-.62.051-.081.061-.187-.068-.281-.185-.1369-.704-.4149-.983-.5319a6.4697 6.4697 0 0 0-2.5118-.514c-1.909.008-3.4129 1.215-3.5389 2.826-.082 1.1629.494 2.1078 1.73 2.8278.262.152 1.6799.716 2.2438.892 1.774.552 2.695 1.5419 2.478 2.6969-.197 1.047-1.299 1.7239-2.818 1.7439-1.2039-.046-2.2878-.537-3.1278-1.19l-.141-.11c-.104-.08-.218-.075-.287.03-.05.077-.376.547-.458.67-.077.108-.035.168.045.234.35.293.817.613 1.134.775a6.7097 6.7097 0 0 0 2.8289.727 4.9048 4.9048 0 0 0 2.0759-.354c1.095-.465 1.8029-1.394 1.9449-2.554zM11.9986 1.4009c-2.068 0-3.7539 1.95-3.8329 4.3899h7.6657c-.08-2.44-1.765-4.3899-3.8328-4.3899zm7.8516 22.5981-.08.001-15.7843-.002c-1.074-.04-1.863-.91-1.971-1.991l-.01-.195L1.298 6.2858a.459.459 0 0 1 .45-.494h4.9748C6.8448 2.568 9.1607 0 11.9996 0c2.8388 0 5.1537 2.5689 5.2757 5.7898h4.9678a.459.459 0 0 1 .458.483l-.773 15.5883-.007.131c-.094 1.094-.979 1.9769-2.0709 2.0059z"})}):r.includes("telegram")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#2CA5E0"}),l.jsx("path",{d:"M5.4 11.6l12.7-4.9c.6-.2 1.1.1.9.8l-2.2 10.2c-.2.7-.6.9-1.2.5l-3.3-2.4-1.6 1.5c-.2.2-.3.3-.5.3l.2-3.4 6.2-5.6c.3-.2-.1-.4-.4-.2l-7.6 4.8-3.3-1c-.7-.2-.7-.7.1-.9z",fill:"#FFFFFF"})]}):r.includes("riot")||r.includes("valorant")||r.includes("league of legends")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#EB0029",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M13.458.86 0 7.093l3.353 12.761 2.552-.313-.701-8.024.838-.373 1.447 8.202 4.361-.535-.775-8.857.83-.37 1.591 9.025 4.412-.542-.849-9.708.84-.374 1.74 9.87L24 17.318V3.5Zm.316 19.356.222 1.256L24 23.14v-4.18l-10.22 1.256Z"})}):r.includes("vng")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 354.3 226.8",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{d:"M37.9,103.7c1.3,4.7,2.7,9.3,4.2,14c0.5,1.7,0.5,2.4-1.2,3.4C26.5,129.5,13,142.1,0.5,155.8c-1,1.1-0.9,1.7,0.3,2.5c20,13.7,39.9,27.5,60,41.2c1.7,1.1,2.5,0.7,3.5-1.1c11.6-21,24.1-41.5,36.5-62.1c1.3-2.1,2.4-2.8,4.9-1.9c15.1,5.3,29.9,11.3,45.4,15.6c4,1.1,5.9-0.1,7-4.1c4.9-18.7,9.8-37.4,14.6-56.1c0.4-1.6,0.3-2.3-1.4-3C155.4,79.5,140,70.8,125.1,61c-1.3-0.8-2.2-0.8-3.4,0.3c-13.6,12.7-27.1,25.4-40.8,38C39.8,100.1,38.9,100.7,37.9,103.7",fill:"#EB5A26"}),l.jsx("path",{d:"M112.5,103.5c4-7.5,8-15,11.9-22.5c1.4-2.7,1-3.6-1.9-4.8c-26.6-11.2-53-22.7-79.6-33.8c-1.2-0.5-2.2-0.3-2.9,0.8C27.9,60,15.7,76.5,3.9,93.2c-0.6,0.9-0.5,1.7,0.3,2.3c21.8,15.5,43.6,30.9,65.6,46.2c0.8,0.5,1.7,0.5,2.5-0.2C85.5,129.3,98.7,116.3,112.5,103.5",fill:"#0E71BA"}),l.jsx("path",{d:"M211.7,137.9c-8.9,0-15.6-2.2-20.2-6.6c-4.6-4.4-6.9-11-6.9-19.8V64.6h17.9v45.5c0,9.3,4.4,13.9,13.3,13.9c8.9,0,13.3-4.6,13.3-13.9V64.6h17.9v46.9c0,8.8-2.3,15.4-6.9,19.8C225.8,135.7,219.5,137.9,211.7,137.9",fill:"#2C373E"}),l.jsx("path",{d:"M260.9,64.6h18.3c15.2,0,22.8,6.8,22.8,20.3v32.7c0,13.5-7.6,20.3-22.8,20.3h-18.3V64.6z M278.8,121.7c4.6,0,6.9-2.5,6.9-7.5V84.9c0-5-2.3-7.5-6.9-7.5h-0.1v44.3H278.8z",fill:"#2C373E"}),l.jsx("path",{d:"M328.7,103.7h18.5V120c0,12-6.5,18-19.6,18c-15,0-22.5-7.3-22.5-22v-31c0-14.7,7.5-22,22.5-22c14.9,0,22,6.9,21.3,20.8h-18.1c0-4.9-1-7.4-3.1-7.4c-3,0-4.5,2.9-4.5,8.6v31c0,5.7,1.5,8.6,4.5,8.6C326.6,113.6,328.4,110.3,328.7,103.7",fill:"#2C373E"})]}):r.includes("reddit")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#FF4500",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"})}):r.includes("steam")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#171A21",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M11.979 0C5.678 0 .511 4.86.022 11.037l6.432 2.658c.545-.371 1.203-.59 1.912-.59.063 0 .125.004.188.006l2.861-4.142V8.91c0-2.495 2.028-4.524 4.524-4.524 2.494 0 4.524 2.031 4.524 4.527s-2.03 4.525-4.524 4.525h-.105l-4.076 2.911c0 .052.004.105.004.159 0 1.875-1.515 3.396-3.39 3.396-1.635 0-3.016-1.173-3.331-2.727L.436 15.27C1.862 20.307 6.486 24 11.979 24c6.627 0 11.999-5.373 11.999-12S18.605 0 11.979 0zM7.54 18.21l-1.473-.61c.262.543.714.999 1.314 1.25 1.297.539 2.793-.076 3.332-1.375.263-.63.264-1.319.005-1.949s-.75-1.121-1.377-1.383c-.624-.26-1.29-.249-1.878-.03l1.523.63c.956.4 1.409 1.5 1.009 2.455-.397.957-1.497 1.41-2.454 1.012H7.54zm11.415-9.303c0-1.662-1.353-3.015-3.015-3.015-1.665 0-3.015 1.353-3.015 3.015 0 1.665 1.35 3.015 3.015 3.015 1.663 0 3.015-1.35 3.015-3.015zm-5.273-.005c0-1.252 1.013-2.266 2.265-2.266 1.249 0 2.266 1.014 2.266 2.266 0 1.251-1.017 2.265-2.266 2.265-1.253 0-2.265-1.014-2.265-2.265z"})}):r.includes("discord")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#5865F2",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"})}):l.jsx(dd,{size:t,className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-accent)"}})},pf=({credentials:e,platforms:t,selectedPlatform:n,setSelectedPlatform:r,onlyFavorites:i,setOnlyFavorites:s,activeView:o,setActiveView:a})=>{const[c,d]=Ut.useState(!0);return l.jsx("aside",{className:"glass-panel scrollable",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"20px",height:"100%",overflowY:"auto"},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",flexGrow:1},children:[l.jsxs("button",{onClick:()=>{s(!1),r(null),a("vault")},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:!i&&!n&&o==="vault"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:!i&&!n&&o==="vault"?"var(--text-accent)":"var(--text-primary)",fontWeight:!i&&!n&&o==="vault"?600:400,cursor:"pointer",transition:"var(--transition-smooth)"},children:["Tất cả tài khoản (",e.length,")"]}),l.jsxs("button",{onClick:()=>{s(!i),r(null),a("vault")},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:i&&!n&&o==="vault"?"rgba(56, 239, 125, 0.1)":"transparent",border:"none",borderRadius:"8px",color:i&&!n&&o==="vault"?"var(--text-emerald)":"var(--text-primary)",fontWeight:i&&!n&&o==="vault"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(Po,{size:14,fill:i&&!n&&o==="vault"?"var(--text-emerald)":"none"}),"Yêu thích (",e.filter(x=>x.is_favorite).length,")"]}),l.jsxs("button",{onClick:()=>{a("proxy"),r(null),s(!1)},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="proxy"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="proxy"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="proxy"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(Y1,{size:14,style:{color:o==="proxy"?"var(--text-accent)":"var(--text-secondary)"}}),"Kiểm tra Proxy"]}),l.jsxs("button",{onClick:()=>{a("proxy-list"),r(null),s(!1)},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="proxy-list"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="proxy-list"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="proxy-list"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(sd,{size:14,style:{color:o==="proxy-list"?"var(--text-accent)":"var(--text-secondary)"}}),"Quản lý Proxy"]}),l.jsxs("button",{onClick:()=>d(!c),style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:"10px 14px",background:"transparent",border:"none",color:"var(--text-primary)",cursor:"pointer",textAlign:"left",fontWeight:500,transition:"var(--transition-smooth)",borderRadius:"8px",marginBottom:"4px"},onMouseEnter:x=>{x.currentTarget.style.background="rgba(255, 255, 255, 0.03)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx(Vl,{size:16,style:{color:"var(--text-secondary)"}}),l.jsx("span",{children:"Nền tảng"})]}),c?l.jsx(Fr,{size:14,style:{color:"var(--text-secondary)"}}):l.jsx(nd,{size:14,style:{color:"var(--text-secondary)"}})]}),c&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"8px"},children:[t.filter(x=>x.is_active).map(x=>{const g=e.filter(y=>y.platform_id===x.id).length;return l.jsxs("button",{onClick:()=>{r(x.id),s(!1),a("vault")},style:{width:"100%",padding:"8px 14px",textAlign:"left",background:n===x.id&&o==="vault"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:n===x.id&&o==="vault"?"var(--text-accent)":"var(--text-primary)",fontWeight:n===x.id&&o==="vault"?600:400,cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"var(--transition-smooth)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(oi,{name:x.icon,size:14}),l.jsx("span",{children:x.name})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:g})]},x.id)}),t.filter(x=>x.is_active).length===0&&l.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",paddingLeft:"14px",fontStyle:"italic"},children:"Không có nền tảng active"})]}),l.jsx("hr",{style:{border:"none",borderTop:"1px solid rgba(255,255,255,0.05)",marginTop:"auto",marginBottom:"8px"}}),l.jsxs("button",{onClick:()=>a("settings"),style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="settings"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="settings"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="settings"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"10px",transition:"var(--transition-smooth)"},children:[l.jsx(af,{size:16}),l.jsx("span",{children:"Cài đặt"})]})]})})},ff=({cred:e,platforms:t,totp:n,onToggleFavorite:r,onEdit:i,onDelete:s})=>{const[o,a]=C.useState(!1),[c,d]=C.useState(!1),[x,g]=C.useState(null),y=(w,z)=>{navigator.clipboard.writeText(w),g(z),setTimeout(()=>{g(null)},2e3)},k=e.platform_id?t.find(w=>w.id===e.platform_id):null,S=(n==null?void 0:n.remaining)??0,m=7,N=2*Math.PI*m,p=N*(1-S/30),u=S<=5,f=u?"#ef4444":"var(--text-emerald)",j=u?"#ef4444":"var(--text-secondary)",v=()=>{var z;(z=window.getSelection())!=null&&z.toString()||a(!o)};return l.jsxs("div",{className:"glass-panel animate-fade-in",onClick:v,style:{padding:"20px",display:"flex",flexDirection:"column",gap:o?"16px":"8px",cursor:"pointer"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[k&&l.jsx(oi,{name:k.icon,size:18}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:600,color:"var(--text-primary)"},children:k?k.name:e.title||"Tài khoản"}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"2px"},children:(e.email||!k&&e.title)&&l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:["Email: ",e.email||e.title]})})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{onClick:w=>{w.stopPropagation(),r()},style:{background:"none",border:"none",color:e.is_favorite?"var(--text-emerald)":"var(--text-muted)",cursor:"pointer"},title:e.is_favorite?"Bỏ yêu thích":"Yêu thích",children:l.jsx(Po,{size:16,fill:e.is_favorite?"var(--text-emerald)":"none"})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),i()},style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},title:"Sửa tài khoản",children:l.jsx(pd,{size:16})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),s()},style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer"},title:"Xóa tài khoản",children:l.jsx(un,{size:16})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),a(!o)},style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},title:o?"Thu gọn":"Mở rộng",children:o?l.jsx(Z1,{size:16}):l.jsx(Fr,{size:16})})]})]}),(o||e.totp_secret)&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o&&e.uid&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"UID:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500,fontFamily:"monospace"},children:e.uid}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),y(e.uid||"","uid")},title:"Sao chép UID",children:x==="uid"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.username&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Username:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:e.username}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),y(e.username,"username")},title:"Sao chép tài khoản",children:x==="username"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.password&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Mật khẩu:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:c?e.password:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),d(!c)},title:c?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:c?l.jsx(_n,{size:12}):l.jsx(Mn,{size:12})}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),y(e.password,"password")},title:"Sao chép mật khẩu",children:x==="password"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),e.totp_secret&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"4px"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-accent)",fontWeight:500},children:"Mã 2FA (OTP):"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{className:"otp-display",style:{fontSize:"15px",padding:"4px 8px"},children:(n==null?void 0:n.token)||"------"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",minWidth:"55px",justifyContent:"flex-start"},children:[l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)",flexShrink:0},children:[l.jsx("circle",{cx:"10",cy:"10",r:m,fill:"none",stroke:"var(--border-color)",strokeWidth:"2.5"}),S>0&&l.jsx("circle",{cx:"10",cy:"10",r:m,fill:"none",stroke:f,strokeWidth:"2.5",strokeDasharray:N,strokeDashoffset:p,style:{transition:"stroke-dashoffset 1s linear, stroke 0.3s"}})]}),l.jsxs("span",{style:{fontSize:"12px",fontWeight:600,color:j,minWidth:"22px"},children:[S,"s"]})]}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),y((n==null?void 0:n.token)||"","otp")},title:"Sao chép mã OTP",children:x==="otp"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.url&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Link:"}),l.jsxs("a",{href:e.url.startsWith("http")?e.url:`https://${e.url}`,target:"_blank",rel:"noreferrer",onClick:w=>{w.stopPropagation()},style:{fontSize:"13px",color:"var(--text-accent)",display:"flex",alignItems:"center",gap:"4px",textDecoration:"none"},children:["Truy cập website",l.jsx(zo,{size:12})]})]})]}),o&&e.custom_fields&&e.custom_fields.length>0&&l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"10px"},children:e.custom_fields.map((w,z)=>l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)"},children:[w.key,":"]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:500},children:w.value}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"2px 4px",borderRadius:"3px"},onClick:T=>{T.stopPropagation(),y(w.value,`custom_${z}`)},title:`Sao chép ${w.key}`,children:x===`custom_${z}`?l.jsx(tr,{size:10,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:10})})]})]},z))}),o&&e.notes&&l.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"10px",fontStyle:"italic"},children:e.notes})]})},hf=({cred:e,platforms:t,totp:n,visibleColumns:r,isSelected:i,onToggleSelect:s,onToggleFavorite:o,onEdit:a,onDelete:c})=>{const[d,x]=C.useState(!1),[g,y]=C.useState(!1),[k,S]=C.useState(!1),[m,N]=C.useState(null),[p,u]=C.useState(!1),f=(L,F)=>{navigator.clipboard.writeText(L),N(F),setTimeout(()=>N(null),2e3)},j=()=>{navigator.clipboard.writeText(e.id),u(!0),setTimeout(()=>u(!1),2e3)},v=L=>{if(!e.custom_fields)return"";const F=L.toLowerCase().trim(),H=e.custom_fields.find(K=>{const h=K.key.toLowerCase().trim();return F==="mail kp"?h==="mail kp"||h==="mailkp"||h==="email kp"||h==="emailkp"||h.includes("khôi phục")||h.includes("recovery"):F==="sđt"?h==="sđt"||h==="sdt"||h==="phone"||h==="sđt khôi phục"||h.includes("điện thoại")||h==="phone number":F==="backup code"?h==="backup code"||h==="backupcode"||h.includes("backup")||h.includes("mã dự phòng")||h.includes("mã cứu hộ")||h.includes("dự phòng"):F==="pass mail"?h==="pass mail"||h==="passmail"||h==="mật khẩu mail"||h==="mật khẩu email"||h==="pass email"||h==="passemail"||h.includes("mật khẩu email")||h.includes("pass mail"):h===F});return H?H.value:""},w=e.platform_id?t.find(L=>L.id===e.platform_id):null,z=(n==null?void 0:n.remaining)??0,T=7,D=2*Math.PI*T,M=D*(1-z/30),Z=z<=5,U=Z?"#ef4444":"var(--text-emerald)",P=Z?"#ef4444":"var(--text-secondary)",X=v("mail kp"),re=v("sđt"),A=v("backup code"),W=v("pass mail"),b=e.totp_secret;return l.jsxs("tr",{style:{background:i?"var(--bg-active-tab)":void 0,transition:"var(--transition-smooth)"},children:[l.jsx("td",{style:{width:"40px",textAlign:"center"},children:l.jsx("input",{type:"checkbox",checked:i,onChange:()=>s(e.id),style:{cursor:"pointer",accentColor:"var(--text-accent)"}})}),r.id&&l.jsx("td",{children:l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:j,title:"Click để sao chép ID đầy đủ",children:p?l.jsx("span",{style:{fontSize:"12px",color:"var(--text-emerald)",fontWeight:500,fontFamily:"monospace"},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"12px",fontFamily:"monospace",color:"var(--text-secondary)"},children:e.id.substring(0,8)})})}),l.jsx("td",{children:l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:w?l.jsxs(l.Fragment,{children:[l.jsx(oi,{name:w.icon,size:18}),l.jsx("span",{style:{fontSize:"13px"},children:w.name})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})})}),l.jsx("td",{children:l.jsx("span",{style:{fontWeight:600},children:e.email||e.title||"—"})}),r.username&&l.jsx("td",{children:e.username?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(e.username,"username"),title:"Click để sao chép Username",children:m==="username"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:e.username})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.uid&&l.jsx("td",{children:e.uid?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(e.uid||"","uid"),title:"Click để sao chép UID",children:m==="uid"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:e.uid})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.password&&l.jsx("td",{children:e.password?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(e.password,"password"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép mật khẩu",children:m==="password"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):d?e.password:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:()=>x(!d),title:d?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:d?l.jsx(_n,{size:11}):l.jsx(Mn,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.otp&&l.jsx("td",{children:e.totp_secret?l.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>f((n==null?void 0:n.token)||"","otp"),title:"Click để sao chép OTP",children:m==="otp"?l.jsx("span",{style:{fontSize:"14px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:"bold",color:"var(--text-accent)"},children:(n==null?void 0:n.token)||"------"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)",flexShrink:0},children:[l.jsx("circle",{cx:"10",cy:"10",r:T,fill:"none",stroke:"var(--border-color)",strokeWidth:"2.5"}),z>0&&l.jsx("circle",{cx:"10",cy:"10",r:T,fill:"none",stroke:U,strokeWidth:"2.5",strokeDasharray:D,strokeDashoffset:M,style:{transition:"stroke-dashoffset 1s linear, stroke 0.3s"}})]}),l.jsxs("span",{style:{fontSize:"11px",fontWeight:600,color:P},children:[z,"s"]})]})]})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.mailKp&&l.jsx("td",{children:X?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(X,"mailKp"),title:"Click để sao chép Mail KP",children:m==="mailKp"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:X})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.phone&&l.jsx("td",{children:re?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(re,"phone"),title:"Click để sao chép SĐT",children:m==="phone"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:re})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.backupCode&&l.jsx("td",{children:A?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(A,"backupCode"),title:"Click để sao chép Backup Code",children:m==="backupCode"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:A})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.passMail&&l.jsx("td",{children:W?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(W,"passMail"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép Mật khẩu Email",children:m==="passMail"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):k?W:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:L=>{L.stopPropagation(),S(!k)},title:k?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:k?l.jsx(_n,{size:11}):l.jsx(Mn,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.secretKey&&l.jsx("td",{children:b?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(b,"secretKey"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép Secret Key",children:m==="secretKey"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):g?b:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:()=>y(!g),title:g?"Ẩn Secret Key":"Hiển thị Secret Key",children:g?l.jsx(_n,{size:11}):l.jsx(Mn,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.url&&l.jsx("td",{children:e.url?l.jsxs("a",{href:e.url.startsWith("http")?e.url:`https://${e.url}`,target:"_blank",rel:"noreferrer",style:{fontSize:"13px",color:"var(--text-accent)",display:"inline-flex",alignItems:"center",gap:"4px",textDecoration:"none"},children:["Link ",l.jsx(zo,{size:12})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),l.jsx("td",{children:l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{onClick:()=>o(e),style:{background:"none",border:"none",color:e.is_favorite?"var(--text-emerald)":"var(--text-muted)",cursor:"pointer"},title:e.is_favorite?"Bỏ yêu thích":"Yêu thích",children:l.jsx(Po,{size:15,fill:e.is_favorite?"var(--text-emerald)":"none"})}),l.jsx("button",{onClick:()=>a(e),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},title:"Sửa tài khoản",children:l.jsx(pd,{size:15})}),l.jsx("button",{onClick:()=>c(e.id),style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer"},title:"Xóa tài khoản",children:l.jsx(un,{size:15})})]})})]})},xf=Ut.memo(hf),yf=({credentials:e,platforms:t,totps:n,visibleColumns:r,selectedIds:i,onToggleSelect:s,onToggleSelectAll:o,onToggleFavorite:a,onEdit:c,onDelete:d})=>{const x=Ut.useRef(null),g=e.length>0&&i.size===e.length,y=i.size>0&&i.size<e.length;return Ut.useEffect(()=>{x.current&&(x.current.indeterminate=y)},[y]),l.jsx("div",{className:"table-container animate-fade-in",children:l.jsxs("table",{className:"enterprise-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"40px",textAlign:"center"},children:l.jsx("input",{ref:x,type:"checkbox",checked:g,onChange:o,style:{cursor:"pointer",accentColor:"var(--text-accent)"}})}),r.id&&l.jsx("th",{style:{minWidth:"90px"},children:"ID"}),l.jsx("th",{style:{minWidth:"120px"},children:"Nền tảng"}),l.jsx("th",{style:{minWidth:"140px"},children:"Email"}),r.username&&l.jsx("th",{style:{minWidth:"160px"},children:"Username"}),r.uid&&l.jsx("th",{style:{minWidth:"120px"},children:"UID"}),r.password&&l.jsx("th",{style:{minWidth:"140px"},children:"Mật khẩu"}),r.otp&&l.jsx("th",{style:{minWidth:"140px"},children:"Mã 2FA (OTP)"}),r.mailKp&&l.jsx("th",{style:{minWidth:"160px"},children:"Mail KP"}),r.phone&&l.jsx("th",{style:{minWidth:"110px"},children:"SĐT"}),r.backupCode&&l.jsx("th",{style:{minWidth:"160px"},children:"Backup Code"}),r.passMail&&l.jsx("th",{style:{minWidth:"140px"},children:"Pass Mail"}),r.secretKey&&l.jsx("th",{style:{minWidth:"160px"},children:"Secret Key"}),r.url&&l.jsx("th",{style:{minWidth:"90px"},children:"Liên kết"}),l.jsx("th",{style:{width:"100px",minWidth:"100px"},children:"Thao tác"})]})}),l.jsx("tbody",{children:e.map(k=>l.jsx(xf,{cred:k,platforms:t,totp:n[k.id],visibleColumns:r,isSelected:i.has(k.id),onToggleSelect:s,onToggleFavorite:a,onEdit:c,onDelete:d},k.id))})]})})},xd=({value:e,onChange:t,options:n,placeholder:r="Chọn...",disabled:i=!1,searchable:s=!0})=>{const[o,a]=C.useState(!1),[c,d]=C.useState(""),x=C.useRef(null),g=C.useRef(null),y=n.find(S=>S.value===e);C.useEffect(()=>{const S=m=>{x.current&&!x.current.contains(m.target)&&a(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),C.useEffect(()=>{o&&s&&g.current&&(d(""),setTimeout(()=>{var S;(S=g.current)==null||S.focus()},50))},[o,s]);const k=n.filter(S=>S.label.toLowerCase().includes(c.toLowerCase()));return l.jsxs("div",{ref:x,style:{position:"relative",width:"100%"},children:[l.jsxs("button",{type:"button",onClick:()=>!i&&a(!o),className:"form-input",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:i?"not-allowed":"pointer",textAlign:"left",opacity:i?.6:1,paddingRight:"12px",width:"100%",background:"var(--bg-input)",borderColor:o?"var(--text-accent)":"var(--border-input)",boxShadow:o?"var(--glow-accent)":"none",transition:"var(--transition-smooth)",height:"42px",borderRadius:"8px"},disabled:i,children:[l.jsx("span",{style:{color:y?"var(--text-primary)":"var(--text-muted)"},children:y?y.label:r}),l.jsx(Fr,{size:16,style:{color:"var(--text-accent)",transform:o?"rotate(180deg)":"none",transition:"var(--transition-smooth)"}})]}),o&&l.jsxs("div",{className:"glass-panel",style:{position:"absolute",top:"calc(100% + 8px)",left:0,width:"100%",maxHeight:"300px",display:"flex",flexDirection:"column",zIndex:1e3,boxShadow:"0 15px 30px rgba(0, 0, 0, 0.4), var(--glow-accent)",background:"var(--bg-modal)",border:"1px solid var(--text-accent)",borderRadius:"12px",padding:"8px",overflow:"hidden"},children:[s&&n.length>5&&l.jsxs("div",{style:{position:"relative",marginBottom:"8px",flexShrink:0},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{ref:g,type:"text",className:"form-input",placeholder:"Tìm kiếm nhanh...",value:c,onChange:S=>d(S.target.value),style:{width:"100%",padding:"6px 30px 6px 30px",fontSize:"13px",borderRadius:"6px",background:"rgba(0, 0, 0, 0.2)",height:"32px",borderColor:"var(--border-color)"}}),c&&l.jsx("button",{type:"button",onClick:()=>d(""),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",padding:0},children:l.jsx($n,{size:14})})]}),l.jsx("div",{className:"scrollable",style:{overflowY:"auto",display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:k.length===0?l.jsx("div",{style:{padding:"12px",fontSize:"13px",color:"var(--text-muted)",textAlign:"center"},children:"Không tìm thấy kết quả"}):k.map(S=>{const m=S.value===e;return l.jsx("button",{type:"button",className:"dropdown-item",onClick:()=>{t(S.value),a(!1)},style:{display:"block",width:"100%",padding:"10px 12px",borderRadius:"8px",border:"none",background:m?"var(--bg-active-tab)":"transparent",color:m?"var(--text-accent)":"var(--text-primary)",fontWeight:m?600:400,cursor:"pointer",textAlign:"left",fontSize:"13px"},children:S.label},S.value)})})]})]})},gf={facebook:["Pass Mail","Mail KP","Pass Mail KP","SĐT","Cookie","Token","Backup Code"],tiktok:["Email","Pass Mail","SĐT","Cookie","Backup Code"],twitter:["Email","Pass Mail","Auth Token","Backup Code"],instagram:["Email","Pass Mail","Cookie","Backup Code"],google:["Mail KP","Pass Mail KP","SĐT","Pass Mail","Backup Code"],outlook:["Mail KP","SĐT","Client ID","Refresh Token","Pass Mail","Backup Code"],telegram:["API ID","API Hash","Session String"],discord:["Email","Token","Backup Code","Pass Mail"],reddit:["Email","Pass Mail","Cookie","Backup Code"]},mf=({isOpen:e,onClose:t,credential:n,onChange:r,onSave:i,platforms:s})=>{var S;if(!e)return null;const o=n.platform_id||"",a=gf[o]||[],c=(n.custom_fields||[]).filter(m=>!a.some(N=>N.toLowerCase().trim()===m.key.toLowerCase().trim())),d=(m,N)=>{const p=[...n.custom_fields||[]],u=p.findIndex(f=>f.key.toLowerCase().trim()===m.toLowerCase().trim());u>=0?p[u]={...p[u],value:N}:p.push({key:m,value:N}),r({...n,custom_fields:p})},x=m=>{var p;const N=(p=n.custom_fields)==null?void 0:p.find(u=>u.key.toLowerCase().trim()===m.toLowerCase().trim());return N?N.value:""},g=()=>{const m=[...n.custom_fields||[]];m.push({key:"",value:""}),r({...n,custom_fields:m})},y=(m,N,p)=>{const u=c[m],f=[...n.custom_fields||[]],j=f.findIndex(v=>v===u);j>=0&&(f[j]={...f[j],[N]:p},r({...n,custom_fields:f}))},k=m=>{const N=c[m],p=(n.custom_fields||[]).filter(u=>u!==N);r({...n,custom_fields:p})};return l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:l.jsxs("form",{onSubmit:i,className:"glass-panel animate-fade-in scrollable",style:{width:"100%",maxWidth:"620px",padding:"30px",display:"flex",flexDirection:"column",gap:"16px",maxHeight:"90vh",overflowY:"auto",background:"var(--bg-modal)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:n.id?"Sửa tài khoản":"Thêm tài khoản mới"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:l.jsx($n,{size:20})})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Tên đăng nhập"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập username...",value:n.username||"",onChange:m=>r({...n,username:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Email"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập địa chỉ email...",value:n.email||"",onChange:m=>r({...n,email:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"UID"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"UID tài khoản...",value:n.uid||"",onChange:m=>r({...n,uid:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Mật khẩu"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập mật khẩu...",value:n.password||"",onChange:m=>r({...n,password:m.target.value})})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Đường dẫn Website"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"https://example.com...",value:n.url||"",onChange:m=>r({...n,url:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Nền tảng (Platform)"}),l.jsx(xd,{value:n.platform_id||"",onChange:m=>r({...n,platform_id:m}),options:s.map(m=>({value:m.id,label:m.name})),placeholder:"Không chọn..."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Khóa bí mật 2FA (TOTP Secret Key)"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập mã bí mật Base32 (ví dụ: JBSWY3DPEHPK3PXP)...",value:n.totp_secret||"",onChange:m=>r({...n,totp_secret:m.target.value})})]}),a.length>0&&l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{fontWeight:600,color:"var(--text-accent)"},children:["Thông tin bổ sung (",(S=s.find(m=>m.id===o))==null?void 0:S.name,")"]}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",background:"rgba(255, 255, 255, 0.02)",padding:"14px",borderRadius:"8px",border:"1px solid var(--border-color)"},children:a.map(m=>l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:m}),l.jsx("input",{type:"text",className:"form-input",placeholder:`Nhập ${m.toLowerCase()}...`,value:x(m),onChange:N=>d(m,N.target.value)})]},m))})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{children:"Trường tùy chỉnh khác (Ví dụ: Mã PIN, Câu hỏi bảo mật...)"}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"2px 8px",fontSize:"11px"},onClick:g,children:"+ Thêm trường"})]}),c.map((m,N)=>l.jsxs("div",{className:"custom-field-row",children:[l.jsx("input",{type:"text",className:"form-input",placeholder:"Tên trường (ví dụ: PIN)",value:m.key,onChange:p=>y(N,"key",p.target.value)}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Giá trị",value:m.value,onChange:p=>y(N,"value",p.target.value)}),l.jsx("button",{type:"button",className:"btn btn-danger",style:{padding:"10px"},onClick:()=>k(N),children:"X"})]},N))]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Ghi chú thêm"}),l.jsx("textarea",{className:"form-input",placeholder:"Nhập ghi chú hoặc mã backup giải cứu...",rows:3,value:n.notes||"",onChange:m=>r({...n,notes:m.target.value}),style:{resize:"vertical"}})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"10px"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Hủy bỏ"}),l.jsx("button",{type:"submit",className:"btn btn-primary",children:"Lưu tài khoản"})]})]})})},vf=Ut.memo(({index:e,mapping:t,exampleValue:n,mappingOptions:r,onMappingChange:i,onRemove:s})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"150px",flexShrink:0},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"11px",color:"var(--text-secondary)",fontWeight:500},children:["Cột ",e+1]}),l.jsx("button",{type:"button",onClick:()=>s(e),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center"},children:l.jsx($n,{size:14})})]}),l.jsx("select",{value:t,onChange:o=>i(e,o.target.value),className:"form-input",style:{padding:"8px 12px",fontSize:"13px",borderRadius:"8px",border:"1px solid var(--border-color)",background:"var(--bg-panel)",width:"100%"},children:r.map(o=>l.jsx("option",{value:o.value,children:o.label},o.value))}),l.jsxs("span",{style:{fontSize:"11px",color:"var(--text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:n,children:["Ví dụ: ",n||"—"]})]})),Wa={facebook:"UID|Pass|2FA|Email|Pass_Email|MailKP|Pass_MailKP|Phone|Cookie|Token",tiktok:"Username|Pass|Email|Pass_Email|2FA|Phone|Cookie",twitter:"User|Pass|2FA|Backup Code|Mail|Pass Mail",instagram:"Username|Pass|Email|Pass_Email|2FA|Cookie",google:"Email|Pass|2FA|MailKP|Pass_MailKP|Phone",outlook:"Email|Pass|MailKP|Phone|Client_ID|Refresh_Token",telegram:"Phone|Pass_2FA|API_ID|API_Hash|Session_String",discord:"Username|Email|Pass|Token|2FA|Backup_Codes",reddit:"Username|Pass|Email|Pass_Email|Cookie"},kf=[{value:"skip",label:"❌ Bỏ qua cột này"},{value:"email",label:"📧 Email"},{value:"password",label:"🔑 Mật khẩu"},{value:"totp_secret",label:"🛡️ Mã 2FA (OTP)"},{value:"username",label:"👤 Tên đăng nhập"},{value:"uid",label:"🆔 UID tài khoản"},{value:"mail_kp",label:"📩 Mail khôi phục"},{value:"phone",label:"📞 Số điện thoại"},{value:"cookie",label:"🍪 Cookie"},{value:"token",label:"🔑 Access Token"},{value:"backup_code",label:"💾 Backup Code"},{value:"pass_mail",label:"🔑 Pass Mail"}],jf=({isOpen:e,onClose:t,text:n,onChange:r,onSubmit:i,platforms:s})=>{const[o,a]=C.useState(""),[c,d]=C.useState(["email"]),[x,g]=C.useState(!1);C.useEffect(()=>{const p=u=>{u.key==="Escape"&&t()};return e&&window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[e,t]);const y=C.useCallback((p,u)=>{const f=[...c];f[p]=u,d(f),g(!0)},[c]),k=C.useCallback(p=>{d(u=>u.filter((f,j)=>j!==p)),g(!0)},[]),S=C.useCallback(()=>{d(p=>[...p,"skip"]),g(!0)},[]);C.useEffect(()=>{e&&(n||(g(!1),d(["email"])))},[e,n]),C.useEffect(()=>{if(x||!n)return;const p=n.split(`
261
- `).map(w=>w.trim()).filter(w=>w);if(p.length===0)return;const f=p[0].split("|").map(w=>w.trim()),j=f.length;let v=Array(j).fill("skip");if(o&&Wa[o]){const z=Wa[o].split("|").map(T=>T.trim().toLowerCase());f.forEach((T,D)=>{const M=z[D];if(!M){v[D]="skip";return}M==="backup code"||M==="backup_codes"||M==="backup_code"||M.includes("backup")?v[D]="backup_code":M==="pass mail"||M==="pass_mail"||M==="pass email"||M==="pass_email"?v[D]="pass_mail":M.includes("email")||M==="mail"?v[D]="email":M.includes("pass")||M==="pwd"?M.includes("khôi phục")||M.includes("recovery")||M.includes("kp")?v[D]="mail_kp":v[D]="password":M==="2fa"||M==="otp"||M==="totp"?v[D]="totp_secret":M==="uid"?v[D]="uid":M.includes("username")||M==="user"?v[D]="username":M==="sđt"||M==="sdt"||M.includes("phone")?v[D]="phone":M.includes("khôi phục")||M.includes("recovery")||M.includes("mail kp")||M.includes("mailkp")?v[D]="mail_kp":M==="cookie"?v[D]="cookie":M==="token"?v[D]="token":v[D]="skip"})}else f.forEach((w,z)=>{const T=w.toLowerCase();if(T.includes("@")&&!T.includes("khôi phục")&&!T.includes("recovery")&&!T.includes("kp"))v[z]="email";else if(z===1&&f[0]&&f[0].includes("@"))v[z]="password";else if(w.length>=16&&/^[A-Z2-7=]+$/i.test(w))v[z]="totp_secret";else if(T.includes("gmail.com")||T.includes("outlook.com")||T.includes("yahoo.com")){const D=f.slice(0,z).some(M=>M.includes("@"));v[z]=D?"mail_kp":"email"}else/^\d{9,11}$/.test(w)?v[z]="phone":/^\d{15,}$/.test(w)&&(v[z]="uid")});d(v)},[n,o,x]);const m=C.useMemo(()=>{const p=n.split(`
262
- `).map(u=>u.trim()).filter(u=>u);return p.length?p[0].split("|").map(u=>u.trim()):[]},[n]);if(!e)return null;const N=()=>{if(c.length===0){alert("Vui lòng nhập/dán chuỗi dữ liệu thô vào khung bên dưới.");return}const p=c.map(u=>u==="email"?"email":u==="password"?"pass":u==="totp_secret"?"2fa":u==="username"?"username":u==="uid"?"uid":u==="mail_kp"?"mail kp":u==="phone"?"sđt":u==="cookie"?"cookie":u==="token"?"token":u==="backup_code"?"backup code":u==="pass_mail"?"pass mail":"skip").join("|");i(o||void 0,p)};return l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"900px",maxHeight:"90vh",overflowY:"auto",padding:"30px",display:"flex",flexDirection:"column",gap:"18px",background:"var(--bg-modal)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:"Dán nhanh chuỗi thô"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:l.jsx($n,{size:20})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsx("label",{style:{fontSize:"13px",fontWeight:500,color:"var(--text-secondary)"},children:"Nền tảng tài khoản"}),l.jsx(xd,{value:o,onChange:p=>a(p),options:[{value:"",label:"Tự động nhận diện / Cơ bản"},...s.map(p=>({value:p.id,label:p.name}))],placeholder:"Tự động nhận diện / Cơ bản"})]}),l.jsx("textarea",{className:"form-input",placeholder:"Dán chuỗi vào đây (định dạng các cột phân tách bằng dấu '|')...",value:n,onChange:p=>r(p.target.value),style:{resize:"vertical",fontFamily:"monospace",minHeight:"200px",width:"100%"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",background:"rgba(255, 255, 255, 0.02)",padding:"16px",borderRadius:"12px",border:"1px solid var(--border-color)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-accent)"},children:["Cấu hình các cột (",c.length," cột):"]}),l.jsxs("button",{type:"button",onClick:S,className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px",fontWeight:600,display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(To,{size:16})," Thêm cột"]})]}),c.length===0?l.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)",textAlign:"center"},children:'Chưa có cột nào được cấu hình. Sử dụng nút "+ Thêm cột" để thêm.'}):l.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",gap:"12px",overflowX:"auto",padding:"8px 4px 12px 4px",width:"100%",scrollbarWidth:"thin"},children:c.map((p,u)=>{const f=m[u]||"";return l.jsx(vf,{index:u,mapping:p,exampleValue:f,mappingOptions:kf,onMappingChange:y,onRemove:k},u)})})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"10px"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Hủy"}),l.jsx("button",{type:"button",className:"btn btn-primary",onClick:N,children:"Phân tích & Nhập"})]})]})})},wf=({isOpen:e,onClose:t,onImport:n,onExport:r})=>(C.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e,t]),e?l.jsxs("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:150},children:[l.jsx("div",{onClick:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1}}),l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"500px",padding:"24px",background:"var(--bg-modal)",display:"flex",flexDirection:"column",gap:"20px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.4)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:600,color:"var(--text-primary)"},children:"Nhập / Xuất dữ liệu"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},title:"Đóng",children:l.jsx($n,{size:18})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Nhập dữ liệu vào Vault"}),l.jsxs("label",{className:"btn btn-secondary",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",padding:"24px 16px",borderRadius:"8px",cursor:"pointer",border:"2px dashed var(--border-color)",background:"rgba(255, 255, 255, 0.01)",transition:"var(--transition-smooth)"},children:[l.jsx(cf,{size:24,style:{color:"var(--text-accent)"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)"},children:"Chọn tệp tin để nhập..."}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Hỗ trợ tệp tin .TXT, .CSV, .JSON"})]}),l.jsx("input",{type:"file",accept:".csv,.json,.txt",onChange:i=>{n(i),t()},style:{display:"none"}})]})]}),l.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-color)",margin:"4px 0"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Xuất dữ liệu mã hóa"}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{r("json"),t()},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"16px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"12px"},children:[l.jsx(Bn,{size:18,style:{color:"var(--text-emerald)"}}),l.jsx("span",{style:{fontWeight:600},children:"Xuất JSON"})]}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{r("csv"),t()},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"16px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"12px"},title:"Xuất định dạng email|pass|2FA|Mail KP|SĐT",children:[l.jsx(Bn,{size:18,style:{color:"var(--text-accent)"}}),l.jsx("span",{style:{fontWeight:600},children:"Xuất TXT (Gmail)"})]})]})]})]})]}):null),Sf=({currentPassword:e,setCurrentPassword:t,newPassword:n,setNewPassword:r,confirmNewPassword:i,setConfirmNewPassword:s,newHint:o,setNewHint:a,passwordError:c,passwordSuccess:d,isChangingPassword:x,onSubmit:g})=>l.jsxs("div",{className:"glass-panel",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"20px"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600,marginBottom:"6px"},children:"Đổi Mật khẩu Master"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Mật khẩu Master được sử dụng để mã hóa dữ liệu trong Vault. Việc thay đổi sẽ tự động giải mã và mã hóa lại tất cả tài khoản bằng khóa mới."})]}),l.jsxs("form",{onSubmit:g,style:{display:"flex",flexDirection:"column",gap:"16px"},children:[c&&l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px",fontWeight:500},children:c}),d&&l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(56, 239, 125, 0.1)",border:"1px solid rgba(56, 239, 125, 0.2)",color:"var(--text-emerald)",fontSize:"13px",fontWeight:500},children:d}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Mật khẩu Master hiện tại *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:e,onChange:y=>t(y.target.value),placeholder:"Nhập mật khẩu hiện tại..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Mật khẩu Master mới *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:n,onChange:y=>r(y.target.value),placeholder:"Ít nhất 8 ký tự..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Xác nhận mật khẩu Master mới *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:i,onChange:y=>s(y.target.value),placeholder:"Nhập lại mật khẩu mới..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Gợi ý mật khẩu (Hint) - Không bắt buộc"}),l.jsx("input",{type:"text",className:"form-input",value:o,onChange:y=>a(y.target.value),placeholder:"Gợi ý giúp bạn nhớ lại mật khẩu..."})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",disabled:x,style:{marginTop:"8px",alignSelf:"flex-start"},children:x?"Đang xử lý...":"Cập nhật mật khẩu Master"})]})]}),Cf=({vaultInfo:e,isLoadingVaultInfo:t,vaultInfoError:n})=>l.jsxs("div",{className:"glass-panel",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"24px"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600,marginBottom:"6px"},children:"Thông số hệ thống & Lưu trữ"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Thông tin chi tiết về cơ sở dữ liệu mã hóa và thuật toán mật mã của Vault."})]}),t?l.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"Đang tải thông tin hệ thống..."}):n?l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px"},children:n}):e?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Đường dẫn file dữ liệu:"}),l.jsx("code",{style:{fontSize:"13px",background:"var(--bg-input)",padding:"6px 10px",borderRadius:"4px",wordBreak:"break-all",color:"var(--text-accent)"},children:e.path})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Số lượng tài khoản:"}),l.jsxs("span",{style:{fontSize:"14px",fontWeight:500},children:[e.credentialsCount," mục"]})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Số lượng danh mục:"}),l.jsxs("span",{style:{fontSize:"14px",fontWeight:500},children:[e.categoriesCount," mục"]})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Thuật toán mã hóa:"}),l.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:"AES-256-GCM (Authenticated Encryption)"})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Hàm băm khóa (KDF):"}),l.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:"PBKDF2 với HMAC-SHA256 (100.000 vòng lặp)"})]})]}):null]}),bf=({tailscaleStatus:e,isLoadingTailscale:t,tailscaleError:n,setTailscaleError:r,isSubmittingTailscale:i,isProvisioningCert:s,onInstall:o,onConnect:a,onDisconnect:c,onLogout:d,onProvisionCert:x})=>{const[g,y]=C.useState(""),[k,S]=C.useState(!0),[m,N]=C.useState(""),[p,u]=C.useState(!1),f=v=>{v.preventDefault(),a(g||void 0,k,m||void 0),y("")},j=()=>{a(void 0,k,void 0)};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(ud,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"Tailscale VPN Client"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Kết nối máy tính của bạn vào mạng lưới Tailnet riêng tư và bảo mật."}),t?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("div",{style:{width:"18px",height:"18px",border:"2px solid var(--text-accent)",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang truy vấn trạng thái..."})]}):e?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[n&&l.jsxs("div",{style:{padding:"10px 14px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{children:n}),l.jsx("button",{type:"button",onClick:()=>r(null),style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer",fontWeight:"bold",fontSize:"14px"},children:"✕"})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"16px",background:"rgba(255,255,255,0.01)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:e.backendState==="Running"?"var(--text-emerald)":e.backendState==="Installing"?"var(--text-accent)":"var(--text-muted)",boxShadow:e.backendState==="Running"?"var(--glow-emerald)":e.backendState==="Installing"?"var(--glow-accent)":"none",animation:e.backendState==="Running"||e.backendState==="Installing"?"pulse-glow 2s infinite":"none"}}),l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"14px",fontWeight:600},children:e.backendState==="Running"?"Đã kết nối VPN":e.backendState==="NotInstalled"?"Chưa cài đặt Tailscale":e.backendState==="Installing"?"Đang cài đặt Tailscale...":"Đã ngắt kết nối"}),l.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:["Trạng thái: ",e.backendState]})]})]}),l.jsx("div",{style:{display:"flex",gap:"8px"},children:e.backendState==="Running"?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:c,style:{padding:"6px 12px",fontSize:"13px"},children:"Ngắt kết nối"}),l.jsx("button",{type:"button",className:"btn btn-danger",onClick:d,style:{padding:"6px 12px",fontSize:"13px"},children:"Đăng xuất"})]}):e.backendState==="Installing"?l.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",fontStyle:"italic"},children:"Đang tải và giải nén..."}):e.backendState==="NotInstalled"?l.jsx("button",{type:"button",className:"btn btn-primary",onClick:o,style:{padding:"6px 12px",fontSize:"13px"},children:"Tự động cài đặt (MSI)"}):l.jsx("button",{type:"button",className:"btn btn-emerald",style:{padding:"6px 12px",fontSize:"13px"},onClick:j,disabled:i,children:i?"Đang kết nối...":"Kết nối nhanh"})})]}),e.backendState==="Installing"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",background:"rgba(255,255,255,0.02)",padding:"16px",borderRadius:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[l.jsx("span",{style:{fontWeight:600,color:"var(--text-accent)"},children:e.installStatus||"Đang cài đặt..."}),l.jsxs("span",{children:[e.installProgress||0,"%"]})]}),l.jsx("div",{style:{width:"100%",height:"8px",background:"var(--bg-input)",borderRadius:"4px",overflow:"hidden"},children:l.jsx("div",{style:{width:`${e.installProgress||0}%`,height:"100%",background:"var(--text-accent)",transition:"width 0.3s ease"}})})]}),e.backendState==="NotInstalled"&&l.jsxs("div",{style:{padding:"16px",borderRadius:"8px",background:"rgba(217, 119, 6, 0.05)",border:"1px solid rgba(217, 119, 6, 0.15)",fontSize:"13px",lineHeight:"1.6"},children:[l.jsx("p",{style:{fontWeight:600,color:"var(--text-accent)",marginBottom:"8px"},children:"Chưa cài đặt Tailscale CLI trên thiết bị của bạn."}),l.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"16px"},children:[l.jsx("button",{type:"button",className:"btn btn-primary",onClick:o,style:{padding:"8px 16px",fontSize:"13px"},children:"Tự động cài đặt ngầm (Windows)"}),l.jsx("a",{href:"https://tailscale.com/download/windows",target:"_blank",rel:"noreferrer",className:"btn btn-secondary",style:{padding:"8px 16px",fontSize:"13px",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"Tải thủ công từ trang chủ"})]}),l.jsxs("details",{style:{cursor:"pointer"},children:[l.jsx("summary",{style:{fontWeight:600,color:"var(--text-secondary)",fontSize:"12px"},children:"Hướng dẫn cấu hình thủ công"}),l.jsxs("ol",{style:{paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px",fontSize:"12px"},children:[l.jsx("li",{children:"Cài đặt ứng dụng Tailscale và đăng nhập vào tài khoản của bạn."}),l.jsxs("li",{children:["Sau khi cài đặt xong, bấm nút ",l.jsx("strong",{children:"Kiểm tra lại"})," phía trên để nhận diện CLI."]})]})]})]}),e.backendState==="Running"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Tên thiết bị:"})," ",l.jsx("strong",{children:e.deviceName})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Mạng Tailnet:"})," ",l.jsx("strong",{children:e.tailnet})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Peers hoạt động:"})," ",l.jsxs("strong",{children:[e.peersCount," thiết bị"]})]})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"IPv4:"}),l.jsx("code",{style:{background:"var(--bg-input)",padding:"2px 6px",borderRadius:"4px",color:"var(--text-accent)"},children:e.ip4})]}),e.ip6&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"IPv6:"}),l.jsx("code",{style:{background:"var(--bg-input)",padding:"2px 6px",borderRadius:"4px",color:"var(--text-accent)",fontSize:"11px",wordBreak:"break-all"},children:e.ip6})]})]})]}),l.jsxs("div",{style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--text-secondary)"},children:"Chứng chỉ HTTPS (TLS)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:e.hasCert?`✓ Đã cấp TLS cho domain: ${e.certDomain}`:"Chưa cấp SSL/TLS cho tên miền Tailscale của thiết bị này."})]}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px"},onClick:x,disabled:s,children:s?"Đang xử lý...":e.hasCert?"Cập nhật Cert":"Cấp SSL Cert"})]})]}),e.backendState!=="Running"&&e.backendState!=="NotInstalled"&&l.jsxs("form",{onSubmit:f,style:{display:"flex",flexDirection:"column",gap:"12px",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px"},children:[l.jsx("h4",{style:{fontSize:"13px",fontWeight:600,borderBottom:"1px solid var(--border-color)",paddingBottom:"6px"},children:"Cấu hình kết nối VPN nâng cao"}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Auth Key (Đăng nhập tự động)"}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx("input",{type:p?"text":"password",className:"form-input",placeholder:"tskey-auth-...",value:g,onChange:v=>y(v.target.value),style:{paddingRight:"40px",fontSize:"13px"}}),l.jsx("button",{type:"button",onClick:()=>u(!p),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:p?l.jsx(_n,{size:14}):l.jsx(Mn,{size:14})})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Exit Node (IP hoặc tên thiết bị định tuyến)"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Ví dụ: 100.123.45.67",value:m,onChange:v=>N(v.target.value),style:{fontSize:"13px"}})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"},children:[l.jsx("input",{type:"checkbox",id:"acceptDns",checked:k,onChange:v=>S(v.target.checked),style:{cursor:"pointer",width:"14px",height:"14px"}}),l.jsx("label",{htmlFor:"acceptDns",style:{fontSize:"12px",cursor:"pointer",userSelect:"none"},children:"Chấp nhận DNS cấu hình từ mạng Tailnet"})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{alignSelf:"flex-start",padding:"6px 16px",fontSize:"13px"},disabled:i,children:i?"Đang kết nối...":"Kết nối với cấu hình"})]})]}):null]})},zf=({tailscaleStatus:e,funnelStatus:t,isLoadingFunnel:n,isTogglingServe:r,isTogglingFunnel:i,onToggleServe:s,onToggleFunnel:o})=>{const a=(e==null?void 0:e.backendState)==="Running",c=(d,x)=>{navigator.clipboard.writeText(d),alert(x)};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(zo,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"API Endpoints & Public Tunnels"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Expose ứng dụng của bạn ra mạng nội bộ Tailscale hoặc internet công cộng bằng HTTPS Tunnel bảo mật."}),n?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("div",{style:{width:"18px",height:"18px",border:"2px solid var(--text-accent)",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang tải trạng thái đường truyền..."})]}):t?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"var(--bg-active-tab)",color:"var(--text-accent)",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Local"}),l.jsx("code",{children:"http://localhost:18823"})]}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c("http://localhost:18823","Đã copy Local URL!"),children:"Copy"})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"rgba(56, 239, 125, 0.1)",color:"var(--text-emerald)",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Tailscale"}),a?t.serveActive&&t.serveUrl?l.jsx("a",{href:t.serveUrl,target:"_blank",rel:"noreferrer",style:{color:"var(--text-accent)",textDecoration:"none",fontWeight:500},children:t.serveUrl}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Chưa kích hoạt HTTPS nội bộ"}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Yêu cầu kết nối VPN"})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Cho phép truy cập HTTPS từ xa cho các máy trong mạng Tailscale."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a&&t.serveActive&&l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c(t.serveUrl||"","Đã copy Tailscale HTTPS URL!"),children:"Copy"}),l.jsx("button",{type:"button",disabled:!a||r,onClick:()=>s(!t.serveActive),style:{width:"42px",height:"22px",borderRadius:"11px",background:a&&t.serveActive?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:a?"pointer":"not-allowed",opacity:a?r?.6:1:.4,transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:a&&t.serveActive?"23px":"3px",transition:"var(--transition-smooth)"}})})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"rgba(255, 65, 108, 0.1)",color:"#ff416c",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Tunnel"}),a?t.funnelActive&&t.funnelUrl?l.jsx("a",{href:t.funnelUrl,target:"_blank",rel:"noreferrer",style:{color:"var(--text-accent)",textDecoration:"none",fontWeight:500},children:t.funnelUrl}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Chưa kích hoạt Tunnel công cộng"}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Yêu cầu kết nối VPN"})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Expose ứng dụng ra internet công cộng an toàn (mọi thiết bị đều vào được)."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a&&t.funnelActive&&l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c(t.funnelUrl||"","Đã copy Public Tunnel URL!"),children:"Copy"}),l.jsx("button",{type:"button",disabled:!a||i,onClick:()=>o(!t.funnelActive),style:{width:"42px",height:"22px",borderRadius:"11px",background:a&&t.funnelActive?"#ff416c":"var(--text-muted)",position:"relative",border:"none",cursor:a?"pointer":"not-allowed",opacity:a?i?.6:1:.4,transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:a&&t.funnelActive?"23px":"3px",transition:"var(--transition-smooth)"}})})]})]})]}):null]})},Tf=({apiKeys:e,isLoadingKeys:t,isCreatingKey:n,generatedKey:r,setGeneratedKey:i,onToggleKey:s,onDeleteKey:o,onCreateKey:a})=>{const[c,d]=C.useState(""),x=y=>{y.preventDefault(),c.trim()&&(a(c.trim()),d(""))},g=y=>{navigator.clipboard.writeText(y),alert("Đã copy API Key!")};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(id,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"Quản lý API Keys"})]})}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Tạo mã khóa API (`pmkey_...`) để xác thực các ứng dụng bên thứ ba (như Chrome Extension) gọi đến API của Profile Manager."}),l.jsxs("form",{onSubmit:x,style:{display:"flex",gap:"10px",alignItems:"flex-end",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0,flexGrow:1},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Tên khóa gợi nhớ (Ví dụ: Extension Laptop, Script Python...)"}),l.jsx("input",{type:"text",className:"form-input",required:!0,placeholder:"Nhập tên thiết bị/ứng dụng sẽ dùng key...",value:c,onChange:y=>d(y.target.value),style:{fontSize:"13px"}})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{padding:"10px 20px",fontSize:"13px"},disabled:n,children:n?"Đang tạo...":"+ Tạo Key"})]}),r&&l.jsxs("div",{style:{padding:"16px",borderRadius:"8px",background:"rgba(56, 239, 125, 0.08)",border:"1px solid rgba(56, 239, 125, 0.2)",fontSize:"13px",display:"flex",flexDirection:"column",gap:"8px"},children:[l.jsx("div",{style:{fontWeight:600,color:"var(--text-emerald)"},children:"✓ Đã tạo API Key thành công!"}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:"Mã khóa này chỉ hiển thị **DUY NHẤT MỘT LẦN**. Hãy lưu lại một cách an toàn:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"},children:[l.jsx("code",{style:{fontSize:"14px",background:"var(--bg-input)",padding:"6px 12px",borderRadius:"4px",color:"var(--text-emerald)",fontWeight:"bold",flexGrow:1,letterSpacing:"0.5px"},children:r}),l.jsx("button",{type:"button",className:"btn btn-emerald",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>g(r),children:"Copy Key"}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>i(null),children:"Tôi đã lưu"})]})]}),t?l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang tải danh sách keys..."}):e.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",border:"1px dashed var(--border-color)",borderRadius:"8px",color:"var(--text-muted)",fontSize:"13px"},children:"Chưa có API Key nào được tạo."}):l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:e.map(y=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"rgba(0,0,0,0.1)",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[l.jsx("div",{style:{fontWeight:600},children:y.name}),l.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:["Prefix: ",l.jsxs("code",{children:[y.keyPrefix,"••••••••"]})," • Ngày tạo: ",new Date(y.createdAt).toLocaleDateString("vi-VN")]})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:()=>s(y.id,y.enabled),style:{width:"38px",height:"20px",borderRadius:"10px",background:y.enabled?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:"pointer",transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:y.enabled?"21px":"3px",transition:"var(--transition-smooth)"}})}),l.jsx("button",{type:"button",className:"btn btn-danger",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>o(y.id),children:"Xóa"})]})]},y.id))})]})},Pf=({platforms:e,onTogglePlatform:t,onDeletePlatform:n})=>l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"20px",width:"100%"},children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(nf,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:"Quản lý Nền tảng (Platforms)"})]})}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Kích hoạt các nền tảng mong muốn xuất hiện trên thanh bên."}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"16px"},children:e.map(r=>l.jsxs("div",{className:"glass-panel",style:{padding:"16px",display:"flex",flexDirection:"column",justifyContent:"space-between",gap:"12px",background:"var(--bg-card)",border:"1px solid var(--border-color)",borderRadius:"12px",transition:"var(--transition-smooth)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(oi,{name:r.icon,size:20}),l.jsx("span",{style:{fontWeight:600,fontSize:"14px"},children:r.name})]}),r.is_custom&&l.jsx("button",{type:"button",style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer",padding:"2px"},onClick:()=>n(r.id),title:"Xóa nền tảng",children:l.jsx(un,{size:14})})]}),l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid var(--border-color)",paddingTop:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",color:"var(--text-secondary)"},children:r.is_custom?"Tùy chỉnh":"Mặc định"}),l.jsx("button",{type:"button",onClick:()=>t(r.id,r.is_active),style:{width:"38px",height:"20px",borderRadius:"10px",background:r.is_active?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:"pointer",transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:r.is_active?"21px":"3px",transition:"var(--transition-smooth)"}})})]})]},r.id))})]}),Ef=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState(null),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,c]=C.useState(!1),[d,x]=C.useState(!1),[g,y]=C.useState(null),[k,S]=C.useState(!1),[m,N]=C.useState(!1),[p,u]=C.useState(!1),f=async()=>{i(!0),o(null);try{const U=await e("/api/tailscale/status");if(U.ok){const P=await U.json();n(P)}else{const P=await U.json();o(P.error||"Không thể lấy trạng thái Tailscale")}}catch(U){console.error("Failed to fetch Tailscale status:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}},j=async()=>{o(null);try{const U=await e("/api/tailscale/install",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Yêu cầu cài đặt tự động thất bại")}}catch(U){console.error("Failed to trigger install:",U),o("Lỗi kết nối máy chủ")}},v=async()=>{x(!0),o(null);try{const U=await e("/api/tailscale/provision-cert",{method:"POST"}),P=await U.json();U.ok&&P.success?(alert(P.message),f()):o(P.error||P.message||"Lỗi cấp chứng chỉ")}catch(U){console.error("Failed to provision cert:",U),o("Lỗi kết nối máy chủ")}finally{x(!1)}},w=async(U,P=!0,X)=>{o(null),c(!0);try{const re=await e("/api/tailscale/connect",{method:"POST",body:JSON.stringify({authKey:U,acceptDns:P,exitNode:X})}),A=await re.json();re.ok?f():o(A.error||"Kết nối Tailscale thất bại")}catch(re){console.error("Failed to connect Tailscale:",re),o("Lỗi kết nối máy chủ")}finally{c(!1)}},z=async()=>{if(confirm("Bạn có chắc chắn muốn ngắt kết nối Tailscale không?")){o(null),i(!0);try{const U=await e("/api/tailscale/disconnect",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Ngắt kết nối thất bại")}}catch(U){console.error("Failed to disconnect Tailscale:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}}},T=async()=>{if(confirm("Bạn có chắc chắn muốn đăng xuất tài khoản Tailscale khỏi thiết bị này không?")){o(null),i(!0);try{const U=await e("/api/tailscale/logout",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Đăng xuất thất bại")}}catch(U){console.error("Failed to logout Tailscale:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}}},D=async()=>{S(!0);try{const U=await e("/api/tailscale/funnel-status");if(U.ok){const P=await U.json();y(P)}}catch(U){console.error("Failed to fetch funnel status:",U)}finally{S(!1)}},M=async U=>{N(!0),o(null);try{const P=await e("/api/tailscale/funnel/toggle",{method:"POST",body:JSON.stringify({active:U})});if(P.ok)D();else{const X=await P.json();o(X.error||"Failed to toggle funnel")}}catch(P){console.error("Failed to toggle funnel:",P),o("Lỗi kết nối máy chủ")}finally{N(!1)}},Z=async U=>{u(!0),o(null);try{const P=await e("/api/tailscale/serve/toggle",{method:"POST",body:JSON.stringify({active:U})});if(P.ok)D();else{const X=await P.json();o(X.error||"Failed to toggle serve")}}catch(P){console.error("Failed to toggle serve:",P),o("Lỗi kết nối máy chủ")}finally{u(!1)}};return C.useEffect(()=>{let U;return(t==null?void 0:t.backendState)==="Installing"&&(U=setInterval(()=>{f()},1500)),()=>clearInterval(U)},[t==null?void 0:t.backendState]),C.useEffect(()=>{f(),D()},[]),{tailscaleStatus:t,isLoadingTailscale:r,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:d,funnelStatus:g,isLoadingFunnel:k,isTogglingFunnel:m,isTogglingServe:p,fetchTailscaleStatus:f,handleInstallTailscale:j,handleProvisionCert:v,handleTailscaleConnect:w,handleTailscaleDisconnect:z,handleTailscaleLogout:T,fetchFunnelStatus:D,handleToggleFunnel:M,handleToggleServe:Z}},Nf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState(!1),[s,o]=C.useState(!1),[a,c]=C.useState(null),[d,x]=C.useState(null),g=async()=>{i(!0);try{const m=await e("/api/auth/api-keys");if(m.ok){const N=await m.json();n(N)}}catch(m){console.error("Failed to fetch API keys:",m)}finally{i(!1)}},y=async m=>{o(!0),x(null);try{const N=await e("/api/auth/api-keys",{method:"POST",body:JSON.stringify({name:m})}),p=await N.json();N.ok&&p.success?(c(p.key),g()):x(p.error||"Failed to create API key")}catch(N){console.error("Failed to create API key:",N),x("Lỗi kết nối máy chủ")}finally{o(!1)}},k=async(m,N)=>{try{(await e(`/api/auth/api-keys/${m}/toggle`,{method:"POST",body:JSON.stringify({enabled:!N})})).ok&&g()}catch(p){console.error("Failed to toggle API key:",p)}},S=async m=>{if(confirm("Bạn có chắc chắn muốn xóa API Key này không? Kết nối từ Chrome Extension của thiết bị tương ứng sẽ bị ngắt hoàn toàn."))try{(await e(`/api/auth/api-keys/${m}`,{method:"DELETE"})).ok&&g()}catch(N){console.error("Failed to delete API key:",N)}};return C.useEffect(()=>{g()},[]),{apiKeys:t,isLoadingKeys:r,isCreatingKey:s,generatedKey:a,setGeneratedKey:c,apiKeyError:d,setApiKeyError:x,fetchApiKeys:g,handleCreateApiKey:y,handleToggleApiKey:k,handleDeleteApiKey:S}},If=()=>{const{fetchWithAuth:e,updateSessionToken:t}=St(),[n,r]=C.useState(""),[i,s]=C.useState(""),[o,a]=C.useState(""),[c,d]=C.useState(""),[x,g]=C.useState(null),[y,k]=C.useState(null),[S,m]=C.useState(!1),[N,p]=C.useState(null),[u,f]=C.useState(!1),[j,v]=C.useState(null),w=async()=>{f(!0),v(null);try{const T=await e("/api/auth/vault-info"),D=T.headers.get("content-type");if(!D||!D.includes("application/json")){v("API không tồn tại hoặc Server chưa được khởi động lại");return}if(T.ok){const M=await T.json();p(M)}else{const M=await T.json();v(M.error||"Không thể tải thông tin Vault")}}catch(T){console.error("Failed to fetch vault info:",T),v("Lỗi kết nối máy chủ")}finally{f(!1)}},z=async T=>{if(T.preventDefault(),g(null),k(null),i.length<8){g("Mật khẩu mới phải từ 8 ký tự trở lên");return}if(i!==o){g("Mật khẩu xác nhận không khớp");return}m(!0);try{const D=await e("/api/auth/change-password",{method:"POST",body:JSON.stringify({currentPassword:n,newPassword:i,hint:c||void 0})}),M=D.headers.get("content-type");if(!M||!M.includes("application/json")){g("API không tồn tại hoặc Server chưa được khởi động lại");return}const Z=await D.json();D.ok&&Z.success?(k("Đổi mật khẩu Master thành công!"),t(Z.token),r(""),s(""),a(""),d("")):g(Z.error||"Có lỗi xảy ra khi đổi mật khẩu")}catch(D){console.error("Failed to change password:",D),g("Lỗi kết nối máy chủ")}finally{m(!1)}};return C.useEffect(()=>{w()},[]),{currentPassword:n,setCurrentPassword:r,newPassword:i,setNewPassword:s,confirmNewPassword:o,setConfirmNewPassword:a,newHint:c,setNewHint:d,passwordError:x,passwordSuccess:y,isChangingPassword:S,vaultInfo:N,isLoadingVaultInfo:u,vaultInfoError:j,fetchVaultInfo:w,handleChangePassword:z}},_f=({platforms:e,onTogglePlatform:t,onDeletePlatform:n})=>{const{tailscaleStatus:r,isLoadingTailscale:i,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:c,funnelStatus:d,isLoadingFunnel:x,isTogglingFunnel:g,isTogglingServe:y,handleInstallTailscale:k,handleProvisionCert:S,handleTailscaleConnect:m,handleTailscaleDisconnect:N,handleTailscaleLogout:p,handleToggleFunnel:u,handleToggleServe:f}=Ef(),{apiKeys:j,isLoadingKeys:v,isCreatingKey:w,generatedKey:z,setGeneratedKey:T,handleCreateApiKey:D,handleToggleApiKey:M,handleDeleteApiKey:Z}=Nf(),{currentPassword:U,setCurrentPassword:P,newPassword:X,setNewPassword:re,confirmNewPassword:A,setConfirmNewPassword:W,newHint:b,setNewHint:L,passwordError:F,passwordSuccess:H,isChangingPassword:K,vaultInfo:h,isLoadingVaultInfo:E,vaultInfoError:V,handleChangePassword:$}=If();return l.jsxs("main",{style:{display:"flex",flexDirection:"column",gap:"24px"},className:"animate-fade-in",children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:l.jsx("h2",{style:{fontSize:"18px",fontWeight:600},children:"Cài đặt hệ thống"})}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"24px",width:"100%"},children:[l.jsx(Sf,{currentPassword:U,setCurrentPassword:P,newPassword:X,setNewPassword:re,confirmNewPassword:A,setConfirmNewPassword:W,newHint:b,setNewHint:L,passwordError:F,passwordSuccess:H,isChangingPassword:K,onSubmit:$}),l.jsx(Cf,{vaultInfo:h,isLoadingVaultInfo:E,vaultInfoError:V}),l.jsx(bf,{tailscaleStatus:r,isLoadingTailscale:i,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:c,onInstall:k,onConnect:m,onDisconnect:N,onLogout:p,onProvisionCert:S}),l.jsx(zf,{tailscaleStatus:r,funnelStatus:d,isLoadingFunnel:x,isTogglingServe:y,isTogglingFunnel:g,onToggleServe:f,onToggleFunnel:u}),l.jsx(Tf,{apiKeys:j,isLoadingKeys:v,isCreatingKey:w,generatedKey:z,setGeneratedKey:T,onToggleKey:M,onDeleteKey:Z,onCreateKey:D})]}),l.jsx(Pf,{platforms:e,onTogglePlatform:t,onDeletePlatform:n})]})};function Mf(e){if(!e||e.length!==2)return"";const t=e.toUpperCase().split("").map(n=>127397+n.charCodeAt(0));return String.fromCodePoint(...t)}const Lf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState(""),[r,i]=C.useState(5e3),[s,o]=C.useState(10),[a,c]=C.useState([]),[d,x]=C.useState(!1),[g,y]=C.useState({current:0,total:0}),k=C.useRef(!1),[S,m]=C.useState(""),[N,p]=C.useState("all"),u=async()=>{if(!t.trim())return;const P=t.split(`
263
- `).map(A=>A.trim()).filter(A=>A.length>0);if(P.length===0)return;x(!0),k.current=!1,y({current:0,total:P.length}),c([]);const X=s,re=[];for(let A=0;A<P.length&&!k.current;A+=X){const W=P.slice(A,A+X);try{const b=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:W,timeout:r,concurrency:X})});if(b.ok){const L=await b.json();L.success&&Array.isArray(L.results)&&(re.push(...L.results),c([...re]))}else{const L=W.map(F=>({proxy:F,host:"",port:0,status:"dead",error:`API Request Failed (HTTP ${b.status})`}));re.push(...L),c([...re])}}catch(b){const L=W.map(F=>({proxy:F,host:"",port:0,status:"dead",error:b.message||"Lỗi mạng API"}));re.push(...L),c([...re])}y(b=>({...b,current:Math.min(b.current+W.length,b.total)}))}x(!1)},f=()=>{k.current=!0,x(!1)},j=()=>{n(""),c([]),y({current:0,total:0})},v=a.filter(P=>P.status==="active").length,w=a.filter(P=>P.status==="dead").length,z=v>0?Math.round(a.filter(P=>P.status==="active").reduce((P,X)=>P+(X.latency||0),0)/v):0,T=a.filter(P=>{const X=P.proxy.toLowerCase().includes(S.toLowerCase())||P.ip&&P.ip.toLowerCase().includes(S.toLowerCase())||P.country&&P.country.toLowerCase().includes(S.toLowerCase());return N==="live"?X&&P.status==="active":N==="dead"?X&&P.status==="dead":X}),D=()=>{const P=a.filter(X=>X.status==="active").map(X=>X.proxy).join(`
264
- `);P?(navigator.clipboard.writeText(P),alert("Đã copy danh sách proxy hoạt động vào clipboard!")):alert("Không có proxy hoạt động nào để copy.")},M=()=>{const P=a.filter(W=>W.status==="active").map(W=>W.proxy).join(`
265
- `);if(!P){alert("Không có proxy hoạt động nào để tải xuống.");return}const X=new Blob([P],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(X),A=document.createElement("a");A.href=re,A.download="live-proxies.txt",A.click(),URL.revokeObjectURL(re)},Z=(r-1e3)/14e3*100,U=(s-1)/49*100;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",width:"100%"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Kiểm tra Proxy"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginTop:"4px"},children:"Kiểm tra trạng thái hoạt động, độ trễ và vị trí địa lý của danh sách proxy HTTP/HTTPS."})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 0.8fr",gap:"20px"},children:[l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between"},children:[l.jsx("span",{children:"Nhập danh sách Proxy (Mỗi dòng một proxy)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Định dạng hỗ trợ: IP:Port hoặc IP:Port:User:Pass"})]}),l.jsx("textarea",{className:"form-input scrollable",placeholder:"Ví dụ:\r45.77.45.12:8080\r182.23.45.12:3128:admin:secret123",style:{height:"140px",fontFamily:"monospace",fontSize:"13px",resize:"vertical"},value:t,onChange:P=>n(P.target.value),disabled:d})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",children:["Thời gian chờ (Timeout: ",r,"ms)"]}),l.jsx("input",{type:"range",min:"1000",max:"15000",step:"500",value:r,onChange:P=>i(parseInt(P.target.value)),disabled:d,className:"slider-custom slider-timeout",style:{width:"100%",background:`linear-gradient(to right, var(--text-emerald) 0%, var(--text-emerald) ${Z}%, var(--bg-input) ${Z}%, var(--bg-input) 100%)`}})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",children:["Số luồng song song (Concurrency: ",s,")"]}),l.jsx("input",{type:"range",min:"1",max:"50",step:"1",value:s,onChange:P=>o(parseInt(P.target.value)),disabled:d,className:"slider-custom slider-concurrency",style:{width:"100%",background:`linear-gradient(to right, var(--text-accent) 0%, var(--text-accent) ${U}%, var(--bg-input) ${U}%, var(--bg-input) 100%)`}})]})]}),l.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"4px"},children:[d?l.jsxs("button",{className:"btn btn-danger",onClick:f,style:{flexGrow:1,padding:"12px",background:"var(--btn-danger-bg, #ef4444)",color:"#fff"},children:[l.jsx(fd,{size:16}),"Dừng kiểm tra"]}):l.jsxs("button",{className:"btn btn-primary",onClick:u,disabled:!t.trim(),style:{flexGrow:1,padding:"12px"},children:[l.jsx(ad,{size:16}),"Bắt đầu kiểm tra"]}),l.jsx("button",{className:"btn btn-secondary",onClick:j,disabled:d||!t&&a.length===0,style:{padding:"12px"},title:"Xóa sạch",children:l.jsx(un,{size:16})})]})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"18px",justifyContent:"center"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:600,color:"var(--text-secondary)"},children:"Thống kê"}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:"Tổng số"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-primary)"},children:g.total})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-emerald, #10b981)"},children:"LIVE (Hoạt động)"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-emerald, #10b981)"},children:v})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#ef4444"},children:"DEAD (Lỗi)"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"#ef4444"},children:w})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-accent)"},children:"Độ trễ TB"}),l.jsxs("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-accent)"},children:[z," ",l.jsx("span",{style:{fontSize:"12px"},children:"ms"})]})]})]}),l.jsxs("div",{style:{marginTop:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"6px"},children:[l.jsx("span",{children:"Tiến trình kiểm tra"}),l.jsxs("span",{children:[g.current," / ",g.total," (",g.total>0?Math.round(g.current/g.total*100):0,"%)"]})]}),l.jsx("div",{style:{width:"100%",height:"8px",background:"var(--bg-input)",borderRadius:"4px",overflow:"hidden",border:"1px solid var(--border-color)"},children:l.jsx("div",{style:{height:"100%",background:"var(--primary-gradient)",width:`${g.total>0?g.current/g.total*100:0}%`,transition:"width 0.3s ease"}})})]})]})]}),a.length>0&&l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsxs("button",{onClick:()=>p("all"),className:`btn ${N==="all"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px"},children:["Tất cả (",a.length,")"]}),l.jsxs("button",{onClick:()=>p("live"),className:`btn ${N==="live"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px",border:N==="live"?"none":"1px solid rgba(16, 185, 129, 0.2)"},children:["Hoạt động (",v,")"]}),l.jsxs("button",{onClick:()=>p("dead"),className:`btn ${N==="dead"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px",border:N==="dead"?"none":"1px solid rgba(239, 68, 68, 0.2)"},children:["Lỗi (",w,")"]})]}),l.jsxs("div",{style:{position:"relative",minWidth:"220px",flexGrow:1,maxWidth:"350px"},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{type:"text",placeholder:"Tìm kiếm IP, vị trí...",className:"form-input",style:{paddingLeft:"34px",fontSize:"13px"},value:S,onChange:P=>m(P.target.value)})]}),l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsxs("button",{className:"btn btn-secondary",onClick:D,disabled:v===0,style:{padding:"8px 12px",fontSize:"13px"},children:[l.jsx(Zt,{size:14}),"Copy Live"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:M,disabled:v===0,style:{padding:"8px 12px",fontSize:"13px"},children:[l.jsx(Bn,{size:14}),"Tải file TXT"]})]})]}),l.jsx("div",{className:"scrollable",style:{overflowX:"auto",maxHeight:"400px"},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",color:"var(--text-muted)"},children:[l.jsx("th",{style:{padding:"12px 8px",fontWeight:500},children:"Proxy"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"110px"},children:"Trạng thái"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"90px"},children:"Độ trễ"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"130px"},children:"IP nhận"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"150px"},children:"Quốc gia"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500},children:"Chi tiết / Lỗi"})]})}),l.jsx("tbody",{children:T.map((P,X)=>l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",background:X%2===0?"var(--btn-secondary-bg)":"transparent"},children:[l.jsx("td",{style:{padding:"10px 8px",fontFamily:"monospace",color:"var(--text-secondary)"},children:P.proxy}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",color:"var(--text-emerald, #10b981)",background:"rgba(16, 185, 129, 0.1)",padding:"3px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(rd,{size:10}),"LIVE"]}):l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",color:"#ef4444",background:"rgba(239, 68, 68, 0.1)",padding:"3px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(ld,{size:10}),"DEAD"]})}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"&&P.latency?l.jsxs("span",{style:{color:P.latency<500?"var(--text-emerald, #10b981)":P.latency<1500?"var(--text-accent)":"#ef4444",fontWeight:600},children:[P.latency," ms"]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"10px 8px",fontFamily:"monospace"},children:P.ip||"-"}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"&&P.countryCode?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"15px"},title:P.countryCode,children:Mf(P.countryCode)}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"110px"},children:P.country})]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"10px 8px",color:P.status==="active"?"var(--text-muted)":"#f87171",fontSize:"12px"},children:P.status==="active"?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(Vl,{size:11}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:P.isp})]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(cd,{size:12}),l.jsx("span",{children:P.error})]})})]},X))})]})})]})]})};function Df(e,t){if(t<=7)return Array.from({length:t},(s,o)=>o+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let s=r;s<=i;s++)n.push(s);return e<t-2&&n.push("ellipsis"),t>1&&n.push(t),n}const Ns=({currentPage:e,totalPages:t,pageSize:n,totalItems:r,startIndex:i,endIndex:s,pageSizeOptions:o,onPageChange:a,onPageSizeChange:c})=>{if(r<=o[0])return null;const d=Df(e,t);return l.jsxs("div",{className:"pagination-footer animate-fade-in",children:[l.jsxs("div",{className:"pagination-info",style:{display:"flex",alignItems:"center",gap:"16px"},children:[l.jsxs("span",{children:["Hiển thị ",l.jsx("strong",{children:i}),"–",l.jsx("strong",{children:s})," / ",l.jsx("strong",{children:r})," mục"]}),l.jsxs("div",{className:"pagination-size-selector",children:[l.jsx("span",{className:"pagination-size-label",children:"Số lượng"}),l.jsx("select",{className:"pagination-select",value:n,onChange:x=>c(Number(x.target.value)),children:o.map(x=>l.jsx("option",{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"pagination-nav",children:[l.jsx("button",{className:"pagination-btn pagination-arrow",onClick:()=>a(e-1),disabled:e<=1,title:"Trang trước",children:l.jsx(J1,{size:16})}),d.map((x,g)=>x==="ellipsis"?l.jsx("span",{className:"pagination-ellipsis",children:"…"},`ellipsis-${g}`):l.jsx("button",{className:`pagination-btn ${e===x?"active":""}`,onClick:()=>a(x),children:x},x)),l.jsx("button",{className:"pagination-btn pagination-arrow",onClick:()=>a(e+1),disabled:e>=t,title:"Trang tiếp",children:l.jsx(nd,{size:16})})]})]})},yd=[50,100,200,500,1e3],Rf="paginationPageSize",Ff=50;function Af(e){try{const t=localStorage.getItem(e);if(t){const n=Number(t);if(yd.includes(n))return n}}catch{}return Ff}function gd({items:e,storageKey:t=Rf}){const[n,r]=C.useState(()=>Af(t)),[i,s]=C.useState(1),o=e.length,a=Math.max(1,Math.ceil(o/n));C.useEffect(()=>{i>a&&s(a)},[a,i]),C.useEffect(()=>{s(1)},[o]);const c=S=>{r(S),s(1);try{localStorage.setItem(t,String(S))}catch{}},d=(i-1)*n,x=Math.min(d+n,o),g=C.useMemo(()=>e.slice(d,x),[e,d,x]),y=()=>{i<a&&s(i+1)},k=()=>{i>1&&s(i-1)};return{paginatedItems:g,currentPage:i,totalPages:a,pageSize:n,totalItems:o,startIndex:o===0?0:d+1,endIndex:x,pageSizeOptions:yd,setCurrentPage:s,setPageSize:c,goToNextPage:y,goToPrevPage:k}}const Ba=({label:e,value:t,options:n,onChange:r,width:i="150px",height:s="32px",hideAll:o=!1})=>{const[a,c]=C.useState(!1);return l.jsxs("div",{style:{position:"relative"},children:[l.jsxs("button",{onClick:()=>c(!a),className:"form-input",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px",width:i,padding:"4px 10px",fontSize:"12px",height:s,background:"var(--bg-input)",border:"1px solid var(--border-input)",borderRadius:"8px",color:"var(--text-primary)",cursor:"pointer",textAlign:"left"},children:[l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t==="all"?`${e} (Tất cả)`:t}),l.jsx(Fr,{size:10,style:{flexShrink:0,opacity:.7,transform:a?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:()=>c(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999}}),l.jsxs("div",{className:"glass-panel scrollable",style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:1e3,padding:"6px",minWidth:i,maxWidth:"220px",maxHeight:"200px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"4px",boxShadow:"var(--glow-accent)",background:"var(--bg-modal)",borderRadius:"8px"},children:[!o&&l.jsxs("button",{onClick:()=>{r("all"),c(!1)},style:{width:"100%",padding:"6px 10px",textAlign:"left",background:t==="all"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"6px",color:t==="all"?"var(--text-accent)":"var(--text-primary)",fontSize:"12px",cursor:"pointer",transition:"var(--transition-smooth)"},onMouseEnter:d=>{t!=="all"&&(d.currentTarget.style.background="rgba(255, 255, 255, 0.05)")},onMouseLeave:d=>{t!=="all"&&(d.currentTarget.style.background="transparent")},children:[e," (Tất cả)"]}),n.map(d=>l.jsx("button",{onClick:()=>{r(d),c(!1)},style:{width:"100%",padding:"6px 10px",textAlign:"left",background:t===d?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"6px",color:t===d?"var(--text-accent)":"var(--text-primary)",fontSize:"12px",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"var(--transition-smooth)"},onMouseEnter:x=>{t!==d&&(x.currentTarget.style.background="rgba(255, 255, 255, 0.05)")},onMouseLeave:x=>{t!==d&&(x.currentTarget.style.background="transparent")},children:d},d))]})]})]})};function Of(e){if(!e||e.length!==2)return"";const t=e.toUpperCase().split("").map(n=>127397+n.charCodeAt(0));return String.fromCodePoint(...t)}const Wf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState(!0),[s,o]=C.useState(null),[a,c]=C.useState(!1),[d,x]=C.useState(""),[g,y]=C.useState(!1),[k,S]=C.useState(""),[m,N]=C.useState("all"),[p,u]=C.useState("all"),[f,j]=C.useState("all"),[v,w]=C.useState(new Set),[z,T]=C.useState(new Set),[D,M]=C.useState(!1),[Z,U]=C.useState({current:0,total:0}),P=Ut.useRef(!1),X=async()=>{i(!0),o(null);try{const I=await e("/api/proxy");if(I.ok){const G=await I.json();n(G)}else o("Không thể lấy danh sách proxy từ máy chủ.")}catch(I){o(I.message||"Lỗi mạng khi tải danh sách proxy.")}finally{i(!1)}};C.useEffect(()=>{X()},[]);const re=C.useMemo(()=>{const I=new Set;return t.forEach(G=>{G.country&&I.add(G.country)}),Array.from(I).sort()},[t]),A=C.useMemo(()=>{const I=new Set;return t.forEach(G=>{G.isp&&I.add(G.isp)}),Array.from(I).sort()},[t]),W=C.useMemo(()=>t.filter(I=>{const G=I.proxy.toLowerCase().includes(k.toLowerCase())||I.host.toLowerCase().includes(k.toLowerCase())||I.ip&&I.ip.toLowerCase().includes(k.toLowerCase())||I.country&&I.country.toLowerCase().includes(k.toLowerCase())||I.isp&&I.isp.toLowerCase().includes(k.toLowerCase()),R=m==="all"||m==="live"&&I.status==="active"||m==="dead"&&I.status==="dead",Y=p==="all"||I.country===p,ee=f==="all"||I.isp===f;return G&&R&&Y&&ee}),[t,k,m,p,f]),{paginatedItems:b,currentPage:L,totalPages:F,pageSize:H,totalItems:K,startIndex:h,endIndex:E,pageSizeOptions:V,setCurrentPage:$,setPageSize:Q}=gd({items:W,storageKey:"proxyPageSize"}),le=I=>{if(I.target.checked){const G=W.map(R=>R.id);w(new Set(G))}else w(new Set)},B=I=>{const G=new Set(v);G.has(I)?G.delete(I):G.add(I),w(G)},Se=async()=>{if(d.trim()){y(!0);try{const I=d.split(`
266
- `).map(R=>R.trim()).filter(R=>R.length>0),G=await e("/api/proxy",{method:"POST",body:JSON.stringify({proxies:I})});if(G.ok)x(""),c(!1),await X();else{const R=await G.json();alert(R.error||"Lỗi khi lưu danh sách proxy.")}}catch(I){alert(I.message||"Lỗi kết nối khi gửi dữ liệu.")}finally{y(!1)}}},se=async I=>{if(confirm("Bạn có chắc chắn muốn xóa proxy này?"))try{if((await e(`/api/proxy/${I}`,{method:"DELETE"})).ok){n(Y=>Y.filter(ee=>ee.id!==I));const R=new Set(v);R.delete(I),w(R)}else alert("Không thể xóa proxy.")}catch(G){console.error(G)}},te=async()=>{if(v.size!==0&&confirm(`Bạn có chắc chắn muốn xóa ${v.size} proxy đã chọn?`))try{(await e("/api/proxy/delete-batch",{method:"POST",body:JSON.stringify({ids:Array.from(v)})})).ok?(n(G=>G.filter(R=>!v.has(R.id))),w(new Set)):alert("Không thể xóa các proxy đã chọn.")}catch(I){console.error(I)}},Ar=async(I,G)=>{T(R=>new Set(R).add(I));try{const R=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:[G],timeout:5e3})});if(R.ok){const Y=await R.json();if(Y.success&&Y.results&&Y.results.length>0){const ee=Y.results[0];n(ye=>ye.map(me=>me.id===I?{...me,status:ee.status,latency:ee.latency,ip:ee.ip,country:ee.country,countryCode:ee.countryCode,city:ee.city,isp:ee.isp,error:ee.error,last_checked:new Date().toISOString(),updated_at:new Date().toISOString()}:me))}}}catch(R){console.error(R)}finally{T(R=>{const Y=new Set(R);return Y.delete(I),Y})}},Or=async()=>{if(v.size===0)return;M(!0),P.current=!1;const I=Array.from(v);U({current:0,total:I.length});const G=I.map(Y=>{const ee=t.find(ye=>ye.id===Y);return{id:Y,proxyStr:(ee==null?void 0:ee.proxy)||""}}).filter(Y=>Y.proxyStr),R=5;for(let Y=0;Y<G.length&&!P.current;Y+=R){const ee=G.slice(Y,Y+R);T(ye=>{const me=new Set(ye);return ee.forEach(Gt=>me.add(Gt.id)),me});try{const ye=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:ee.map(me=>me.proxyStr),timeout:5e3,concurrency:R})});if(ye.ok){const me=await ye.json();me.success&&Array.isArray(me.results)&&n(Gt=>{let Xt=[...Gt];return me.results.forEach(We=>{const bt=Xt.findIndex(Eo=>Eo.proxy===We.proxy);bt!==-1&&(Xt[bt]={...Xt[bt],status:We.status,latency:We.latency,ip:We.ip,country:We.country,countryCode:We.countryCode,city:We.city,isp:We.isp,error:We.error,last_checked:new Date().toISOString(),updated_at:new Date().toISOString()})}),Xt})}}catch(ye){console.error("Lỗi check bulk:",ye)}finally{T(ye=>{const me=new Set(ye);return ee.forEach(Gt=>me.delete(Gt.id)),me}),U(ye=>({...ye,current:Math.min(ye.current+ee.length,ye.total)}))}}M(!1)},Wr=()=>{P.current=!0,M(!1)},Br=()=>{if(v.size===0)return;const I=t.filter(G=>v.has(G.id)).map(G=>G.proxy).join(`
260
+ */const $n=J("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),uf=()=>{const{isInitialized:e,initializeVault:t,unlockVault:n,getHint:r,theme:i,toggleTheme:s}=St(),[o,a]=C.useState(""),[c,d]=C.useState(""),[x,y]=C.useState(!1),[g,k]=C.useState(null),[S,m]=C.useState(!1),[N,p]=C.useState(null),[u,f]=C.useState(!1);Ut.useEffect(()=>{e&&r().then(w=>{w==="Mật khẩu mặc định là 180823"&&f(!0)})},[e]);const j=async w=>{if(w.preventDefault(),!!o){k(null),m(!0);try{let z=!1;if(e)z=await n(o);else{if(o.length<8){k("Mật khẩu Master phải từ 8 ký tự trở lên"),m(!1);return}z=await t(o,c)}z||k(e?"Mật khẩu Master không chính xác!":"Không thể khởi tạo vault!")}catch{k("Đã xảy ra lỗi hệ thống, vui lòng thử lại.")}finally{m(!1)}}},v=async()=>{const w=await r();p(w||"Không có gợi ý nào được thiết lập.")};return l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",padding:"20px",position:"relative"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:s,style:{position:"absolute",top:"20px",right:"20px",borderRadius:"50%",width:"40px",height:"40px",padding:0,display:"flex",alignItems:"center",justifyContent:"center",zIndex:10},title:i==="dark"?"Chuyển sang chế độ sáng":"Chuyển sang chế độ tối",children:i==="dark"?l.jsx(hd,{size:18}):l.jsx(od,{size:18})}),l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"450px",padding:"40px",display:"flex",flexDirection:"column",gap:"24px"},children:[l.jsxs("div",{style:{textAlign:"center",display:"flex",flexDirection:"column",alignItems:"center",gap:"12px"},children:[l.jsx("div",{style:{background:"var(--primary-gradient)",padding:"14px",borderRadius:"50%",display:"inline-flex",boxShadow:"var(--glow-accent)"},children:l.jsx(dd,{size:32,color:"#030712"})}),l.jsx("h2",{className:"gradient-text",style:{fontSize:"28px",fontWeight:700},children:"Account Manager"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px"},children:e?"Nhập mật khẩu Master để giải mã dữ liệu của bạn":"Tạo mật khẩu Master để bắt đầu lưu trữ bảo mật"})]}),e&&u&&l.jsxs("div",{style:{background:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",color:"var(--text-accent)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px",lineHeight:"1.5",display:"flex",flexDirection:"column",gap:"4px",textAlign:"left"},children:[l.jsx("div",{style:{fontWeight:600,display:"flex",alignItems:"center",gap:"6px"},children:l.jsxs("span",{children:["💡 Mật khẩu mặc định: ",l.jsx("strong",{children:"180823"})]})}),l.jsxs("span",{style:{color:"var(--text-secondary)",fontSize:"12px"},children:["Vui lòng sử dụng mật khẩu trên để đăng nhập lần đầu, sau đó đổi mật khẩu trong phần ",l.jsx("strong",{children:"Cài đặt"})," để bảo vệ dữ liệu."]})]}),l.jsxs("form",{onSubmit:j,style:{display:"flex",flexDirection:"column",gap:"20px"},children:[g&&l.jsx("div",{style:{background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.3)",color:"#ff6b6b",padding:"12px 16px",borderRadius:"8px",fontSize:"13px",textAlign:"center"},children:g}),l.jsxs("div",{className:"form-group",style:{position:"relative"},children:[l.jsx("label",{className:"form-label",htmlFor:"password",children:"Mật khẩu Master"}),l.jsxs("div",{style:{position:"relative",display:"flex",alignItems:"center"},children:[l.jsx("input",{id:"password",type:x?"text":"password",className:"form-input",placeholder:"Nhập mật khẩu chính...",value:o,onChange:w=>a(w.target.value),style:{paddingRight:"46px"},disabled:S,autoComplete:"current-password"}),l.jsx("button",{type:"button",onClick:()=>y(!x),style:{position:"absolute",right:"12px",background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},children:x?l.jsx(_n,{size:18}):l.jsx(Ln,{size:18})})]})]}),!e&&l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",htmlFor:"hint",children:"Gợi ý mật khẩu (Tùy chọn)"}),l.jsx("input",{id:"hint",type:"text",className:"form-input",placeholder:"Nhập gợi ý gợi nhớ mật khẩu...",value:c,onChange:w=>d(w.target.value),disabled:S})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{width:"100%",padding:"14px",fontSize:"15px"},disabled:S,children:S?l.jsx("div",{className:"spinner",style:{width:"18px",height:"18px"}}):l.jsxs(l.Fragment,{children:[l.jsx(lf,{size:18}),e?"Mở khóa Vault":"Thiết lập Vault"]})})]}),e&&l.jsx("div",{style:{display:"flex",justifyContent:"center",marginTop:"8px"},children:N?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",fontSize:"13px",color:"var(--text-accent)",background:"var(--bg-main)",padding:"8px 12px",borderRadius:"6px",border:"1px solid var(--border-color)"},children:[l.jsx(rf,{size:14}),l.jsxs("span",{children:["Gợi ý: ",l.jsx("strong",{children:N})]})]}):l.jsx("button",{type:"button",onClick:v,style:{background:"none",border:"none",color:"var(--text-muted)",fontSize:"13px",cursor:"pointer",textDecoration:"underline"},children:"Quên mật khẩu? Hiển thị gợi ý"})})]})]})},df=({search:e,setSearch:t,theme:n,toggleTheme:r,onSmartPasteOpen:i,onLockVault:s,onImportExportOpen:o})=>{const[a,c]=C.useState(!1),d=C.useRef(null);C.useEffect(()=>{const y=g=>{var k;(g.metaKey||g.ctrlKey)&&g.key.toLowerCase()==="k"&&(g.preventDefault(),(k=d.current)==null||k.focus())};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[]);const x=typeof window<"u"&&/Mac|iPhone|iPod|iPad/i.test(navigator.userAgent||"");return l.jsxs("header",{className:"glass-panel",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"14px 20px",width:"100%",position:"sticky",top:"0",zIndex:100},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"24px",flex:1,marginRight:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",flexShrink:0},children:[l.jsx(ud,{size:28,style:{color:"var(--text-accent)"}}),l.jsx("h1",{className:"gradient-text",style:{fontSize:"22px",fontWeight:800},children:"Account Manager"})]}),l.jsxs("div",{style:{position:"relative",width:"100%",maxWidth:"320px",flexShrink:1},children:[l.jsx(si,{size:18,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{ref:d,type:"text",className:"form-input",placeholder:"Tìm kiếm tài khoản, website...",value:e,onChange:y=>t(y.target.value),onFocus:()=>c(!0),onBlur:()=>c(!1),style:{paddingLeft:"38px",paddingRight:"60px",borderRadius:"24px",width:"100%",padding:"8px 16px 8px 38px"},"aria-label":"Tìm kiếm tài khoản và mật khẩu"}),!a&&!e&&l.jsxs("div",{style:{position:"absolute",right:"12px",top:"50%",transform:"translateY(-50%)",display:"flex",alignItems:"center",gap:"3px",padding:"2px 6px",borderRadius:"4px",background:"var(--btn-secondary-bg)",border:"1px solid var(--border-color)",fontSize:"10px",color:"var(--text-secondary)",pointerEvents:"none",userSelect:"none",fontFamily:"monospace"},children:[l.jsx("span",{children:x?"⌘":"Ctrl"}),l.jsx("span",{children:"+"}),l.jsx("span",{children:"K"})]})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:r,style:{padding:"6px",borderRadius:"50%",width:"32px",height:"32px",display:"flex",alignItems:"center",justifyContent:"center"},title:n==="dark"?"Chuyển sang chế độ sáng":"Chuyển sang chế độ tối",children:n==="dark"?l.jsx(hd,{size:16}):l.jsx(od,{size:16})}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:o,style:{display:"flex",alignItems:"center",gap:"6px",padding:"7px 14px",fontSize:"13px"},children:[l.jsx(Bn,{size:16}),"Nhập / Xuất"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:i,style:{padding:"7px 14px",fontSize:"13px"},children:[l.jsx(ef,{size:16}),"Dán nhanh"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:s,style:{padding:"7px 14px",fontSize:"13px"},children:[l.jsx(of,{size:16}),"Khóa Vault"]})]})]})},oi=({name:e,size:t=16,className:n=""})=>{const r=e.toLowerCase();return r.includes("google")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),l.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),l.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.06H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.94l2.85-2.22.81-.63z",fill:"#FBBC05"}),l.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.06l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}):r.includes("facebook")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12.073",r:"11.5",fill:"#FFFFFF"}),l.jsx("path",{d:"M24 12.073c0-6.627-5.373-12-12-12s-12 5.373-12 12c0 5.99 4.388 10.954 10.125 11.854v-8.385H7.078v-3.47h3.047V9.43c0-3.007 1.792-4.669 4.533-4.669 1.312 0 2.686.235 2.686.235v2.953H15.83c-1.491 0-1.956.925-1.956 1.874v2.25h3.328l-.532 3.47h-2.796v8.385C19.612 23.027 24 18.062 24 12.073z",fill:"#1877F2"})]}):r.includes("github")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",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.7-2.782.603-3.369-1.34-3.369-1.34-.454-1.156-1.11-1.464-1.11-1.464-.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.115 2.504.337 1.909-1.294 2.747-1.025 2.747-1.025.546 1.377.203 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.579.688.481C19.137 20.162 22 16.418 22 12c0-5.523-4.477-10-10-10z"})}):r.includes("hotmail")||r.includes("outlook")||r.includes("microsoft")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 512 512",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsxs("defs",{children:[l.jsxs("linearGradient",{id:"outlook-svgid-1",gradientUnits:"userSpaceOnUse",x1:"315.5344",y1:"-877.4263",x2:"315.5344",y2:"-651.1933",gradientTransform:"matrix(1 0 0 1 0 1145.3334)",children:[l.jsx("stop",{offset:"0",stopColor:"#35B8F1"}),l.jsx("stop",{offset:"1",stopColor:"#28A8EA"})]}),l.jsxs("linearGradient",{id:"outlook-svgid-2",gradientUnits:"userSpaceOnUse",x1:"45.5066",y1:"-1037.3639",x2:"216.4467",y2:"-741.3027",gradientTransform:"matrix(1 0 0 1 0 1145.3334)",children:[l.jsx("stop",{offset:"0",stopColor:"#1784D9"}),l.jsx("stop",{offset:"0.5",stopColor:"#107AD5"}),l.jsx("stop",{offset:"1",stopColor:"#0A63C9"})]})]}),l.jsx("path",{fill:"#0A2767",d:"M512,267.91c0.03-4-2.04-7.73-5.45-9.82h-0.06l-0.21-0.12L328.86,152.95c-0.77-0.52-1.56-0.99-2.38-1.42 c-6.85-3.53-14.99-3.53-21.84,0c-0.82,0.43-1.62,0.9-2.38,1.42L124.84,257.96l-0.21,0.12c-5.42,3.37-7.08,10.5-3.71,15.92 c0.99,1.6,2.36,2.93,3.99,3.88L302.32,382.9c0.77,0.51,1.56,0.99,2.38,1.42c6.85,3.53,14.99,3.53,21.84,0 c0.82-0.43,1.61-0.9,2.38-1.42l177.41-105.02C509.88,275.82,512.04,272.01,512,267.91z"}),l.jsx("path",{fill:"#0364B8",d:"M145.53,197.79h116.43v106.72H145.53V197.79z M488.19,89.3V40.48c0.28-12.21-9.38-22.33-21.59-22.62H164.47 c-12.21,0.29-21.87,10.42-21.59,22.62V89.3l178.6,47.63L488.19,89.3z"}),l.jsx("path",{fill:"#0078D4",d:"M142.88,89.3h119.07v107.16H142.88V89.3z"}),l.jsx("path",{fill:"#28A8EA",d:"M381.02,89.3H261.95v107.16l119.07,107.16h107.16V196.47L381.02,89.3z"}),l.jsx("path",{fill:"#0078D4",d:"M261.95,196.47h119.07v107.16H261.95V196.47z"}),l.jsx("path",{fill:"#0364B8",d:"M261.95,303.63h119.07v107.16H261.95V303.63z"}),l.jsx("path",{fill:"#14447D",d:"M145.53,304.51h116.43v97.02H145.53V304.51z"}),l.jsx("path",{fill:"#0078D4",d:"M381.02,303.63h107.16v107.16H381.02V303.63z"}),l.jsx("path",{fill:"url(#outlook-svgid-1)",d:"M506.55,277.23l-0.23,0.12l-177.41,99.78c-0.77,0.48-1.56,0.93-2.38,1.33c-3.01,1.43-6.29,2.25-9.62,2.38 l-9.69-5.67c-0.82-0.41-1.61-0.87-2.38-1.37l-179.8-102.61h-0.08l-5.88-3.29V469.9c0.09,13.48,11.09,24.33,24.56,24.24h344.18 c0.2,0,0.38-0.1,0.6-0.1c2.85-0.18,5.65-0.77,8.33-1.74c1.16-0.49,2.28-1.07,3.35-1.74c0.8-0.45,2.17-1.44,2.17-1.44 c6.1-4.51,9.71-11.64,9.74-19.23V267.91C512,271.77,509.91,275.33,506.55,277.23z"}),l.jsx("path",{fill:"#0A2767",opacity:.5,d:"M502.47,267.11v12.38L316.96,407.22L124.9,271.28c0-0.07-0.05-0.12-0.12-0.12l0,0l-17.62-10.6v-8.93l7.26-0.12 l15.36,8.81l0.36,0.12l1.31,0.83c0,0,180.51,103,180.99,103.23l6.91,4.05c0.6-0.24,1.19-0.48,1.91-0.71 c0.36-0.24,179.2-100.85,179.2-100.85L502.47,267.11z"}),l.jsx("path",{fill:"#1490DF",d:"M506.55,277.23l-0.23,0.13l-177.41,99.78c-0.77,0.48-1.56,0.93-2.38,1.33c-6.89,3.37-14.95,3.37-21.84,0 c-0.82-0.4-1.61-0.85-2.38-1.33l-177.41-99.78l-0.21-0.13c-3.43-1.86-5.57-5.43-5.61-9.32V469.9c0.09,13.47,11.08,24.33,24.55,24.24 c0,0,0,0,0,0h343.83c13.47,0.09,24.47-10.77,24.55-24.24c0,0,0,0,0,0V267.91C512,271.77,509.91,275.33,506.55,277.23z"}),l.jsx("path",{fill:"#000000",opacity:.1,d:"M331.49,375.67l-2.66,1.49c-0.77,0.49-1.56,0.94-2.38,1.35c-2.93,1.44-6.11,2.28-9.36,2.48l67.5,79.82 l117.75,28.37c3.23-2.44,5.79-5.64,7.47-9.32L331.49,375.67z"}),l.jsx("path",{fill:"#000000",opacity:.05,d:"M343.52,368.9l-14.68,8.25c-0.77,0.49-1.56,0.94-2.38,1.35c-2.93,1.44-6.11,2.28-9.36,2.48l31.62,87.19 l153.66,20.97c6.05-4.54,9.62-11.67,9.62-19.24v-2.61L343.52,368.9z"}),l.jsx("path",{fill:"#28A8EA",d:"M143.96,494.14h343.46c5.29,0.03,10.44-1.64,14.7-4.76L307.2,375.2c-0.82-0.41-1.61-0.87-2.38-1.37 l-179.8-102.61h-0.08l-5.87-3.31v201.3C119.06,482.96,130.2,494.13,143.96,494.14C143.96,494.14,143.96,494.14,143.96,494.14z"}),l.jsx("path",{fill:"#000000",opacity:.1,d:"M285.77,134.94v253.98c-0.02,8.9-5.44,16.91-13.69,20.24c-2.56,1.1-5.31,1.67-8.1,1.67H119.07v-285.8h23.81 v-11.91h121.09C276.01,113.16,285.74,122.91,285.77,134.94z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M273.86,146.85v253.98c0.03,2.88-0.58,5.72-1.79,8.33c-3.31,8.15-11.21,13.5-20,13.54h-133V125.02h133 c3.45-0.03,6.86,0.83,9.88,2.5C269.25,131.2,273.86,138.68,273.86,146.85z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M273.86,146.85v230.16c-0.06,12.02-9.77,21.77-21.79,21.87h-133V125.02h133c3.45-0.03,6.86,0.83,9.88,2.5 C269.25,131.2,273.86,138.68,273.86,146.85z"}),l.jsx("path",{fill:"#000000",opacity:.2,d:"M261.95,146.85v230.16c-0.01,12.04-9.75,21.81-21.79,21.87H119.07V125.02h121.09 c12.04,0.01,21.8,9.77,21.79,21.81C261.95,146.84,261.95,146.84,261.95,146.85z"}),l.jsx("path",{fill:"url(#outlook-svgid-2)",d:"M21.83,125.02h218.3c12.05,0,21.83,9.77,21.83,21.83v218.3c0,12.05-9.77,21.83-21.83,21.83H21.83 C9.77,386.98,0,377.2,0,365.15v-218.3C0,134.8,9.77,125.02,21.83,125.02z"}),l.jsx("path",{fill:"#FFFFFF",d:"M68.22,216.56c5.38-11.46,14.06-21.05,24.93-27.54c12.04-6.89,25.75-10.33,39.61-9.93 c12.85-0.28,25.53,2.98,36.66,9.42c10.46,6.24,18.89,15.38,24.25,26.31c5.85,12.05,8.76,25.31,8.5,38.7 c0.28,13.99-2.71,27.86-8.75,40.48c-5.49,11.33-14.19,20.79-25,27.23c-11.56,6.64-24.71,9.98-38.03,9.67 c-13.13,0.32-26.09-2.98-37.47-9.53c-10.55-6.25-19.08-15.4-24.58-26.36c-5.88-11.87-8.83-24.99-8.6-38.23 C59.5,242.91,62.4,229.16,68.22,216.56z M94.79,281.22c2.87,7.25,7.73,13.53,14.03,18.12c6.41,4.48,14.09,6.79,21.91,6.6 c8.33,0.33,16.54-2.06,23.39-6.81c6.22-4.58,10.95-10.88,13.62-18.12c2.99-8.09,4.46-16.66,4.35-25.28c0.09-8.7-1.29-17.36-4.1-25.6 c-2.48-7.44-7.06-14-13.19-18.88c-6.68-4.97-14.86-7.5-23.18-7.14c-7.99-0.21-15.84,2.12-22.42,6.66 c-6.4,4.61-11.36,10.95-14.29,18.28c-6.5,16.79-6.54,35.4-0.1,52.21L94.79,281.22z"}),l.jsx("path",{fill:"#50D9FF",d:"M381.02,89.3h107.16v107.16H381.02V89.3z"})]}):r.includes("twitter")||r.includes(" x ")||r==="x"?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M18.244 2.25h3.308l-7.227 8.26 8.502 11.24H16.17l-5.214-6.817L4.99 21.75H1.68l7.73-8.835L1.254 2.25H8.08l4.713 6.231zm-1.161 17.52h1.833L7.084 4.126H5.117z"})}):r.includes("threads")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M12.186 24h-.007c-3.581-.024-6.334-1.205-8.184-3.509C2.35 18.44 1.5 15.586 1.472 12.01v-.017c.03-3.579.879-6.43 2.525-8.482C5.845 1.205 8.6.024 12.18 0h.014c2.746.02 5.043.725 6.826 2.098 1.677 1.29 2.858 3.13 3.509 5.467l-2.04.569c-1.104-3.96-3.898-5.984-8.304-6.015-2.91.022-5.11.936-6.54 2.717C4.307 6.504 3.616 8.914 3.589 12c.027 3.086.718 5.496 2.057 7.164 1.43 1.783 3.631 2.698 6.54 2.717 2.623-.02 4.358-.631 5.8-2.045 1.647-1.613 1.618-3.593 1.09-4.798-.31-.71-.873-1.3-1.634-1.75-.192 1.352-.622 2.446-1.284 3.272-.886 1.102-2.14 1.704-3.73 1.79-1.202.065-2.361-.218-3.259-.801-1.063-.689-1.685-1.74-1.752-2.964-.065-1.19.408-2.285 1.33-3.082.88-.76 2.119-1.207 3.583-1.291a13.853 13.853 0 0 1 3.02.142c-.126-.742-.375-1.332-.75-1.757-.513-.586-1.308-.883-2.359-.89h-.029c-.844 0-1.992.232-2.721 1.32L7.734 7.847c.98-1.454 2.568-2.256 4.478-2.256h.044c3.194.02 5.097 1.975 5.287 5.388.108.046.216.094.321.142 1.49.7 2.58 1.761 3.154 3.07.797 1.82.871 4.79-1.548 7.158-1.85 1.81-4.094 2.628-7.277 2.65Zm1.003-11.69c-.242 0-.487.007-.739.021-1.836.103-2.98.946-2.916 2.143.067 1.256 1.452 1.839 2.784 1.767 1.224-.065 2.818-.543 3.086-3.71a10.5 10.5 0 0 0-2.215-.221z"})}):r.includes("apple")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M12.152 6.896c-.948 0-2.415-1.078-3.96-1.04-2.04.027-3.91 1.183-4.961 3.014-2.117 3.675-.546 9.103 1.519 12.09 1.013 1.454 2.208 3.09 3.792 3.039 1.52-.065 2.09-.987 3.935-.987 1.831 0 2.35.987 3.96.948 1.637-.026 2.676-1.48 3.676-2.948 1.156-1.688 1.636-3.325 1.662-3.415-.039-.013-3.182-1.221-3.22-4.857-.026-3.04 2.48-4.494 2.597-4.559-1.429-2.09-3.623-2.324-4.39-2.376-2-.156-3.675 1.09-4.61 1.09zM15.53 3.83c.843-1.012 1.4-2.427 1.245-3.83-1.207.052-2.662.805-3.532 1.818-.78.896-1.454 2.338-1.273 3.714 1.338.104 2.715-.688 3.559-1.701"})}):r.includes("aws")||r.includes("amazon")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#FF9900",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M6.763 10.036c0 .296.032.535.088.71.064.176.144.368.256.576.04.063.056.127.056.183 0 .08-.048.16-.152.24l-.503.335a.383.383 0 0 1-.208.072c-.08 0-.16-.04-.239-.112a2.47 2.47 0 0 1-.287-.375 6.18 6.18 0 0 1-.248-.471c-.622.734-1.405 1.101-2.347 1.101-.67 0-1.205-.191-1.596-.574-.391-.384-.59-.894-.59-1.533 0-.678.239-1.23.726-1.644.487-.415 1.133-.623 1.955-.623.272 0 .551.024.846.064.296.04.6.104.918.176v-.583c0-.607-.127-1.03-.375-1.277-.255-.248-.686-.367-1.3-.367-.28 0-.568.031-.863.103-.295.072-.583.16-.862.272a2.287 2.287 0 0 1-.28.104.488.488 0 0 1-.127.023c-.112 0-.168-.08-.168-.247v-.391c0-.128.016-.224.056-.28a.597.597 0 0 1 .224-.167c.279-.144.614-.264 1.005-.36a4.84 4.84 0 0 1 1.246-.151c.95 0 1.644.216 2.091.647.439.43.662 1.085.662 1.963v2.586zm-3.24 1.214c.263 0 .534-.048.822-.144.287-.096.543-.271.758-.51.128-.152.224-.32.272-.512.047-.191.08-.423.08-.694v-.335a6.66 6.66 0 0 0-.735-.136 6.02 6.02 0 0 0-.75-.048c-.535 0-.926.104-1.19.32-.263.215-.39.518-.39.917 0 .375.095.655.295.846.191.2.47.296.838.296zm6.41.862c-.144 0-.24-.024-.304-.08-.064-.048-.12-.16-.168-.311L7.586 5.55a1.398 1.398 0 0 1-.072-.32c0-.128.064-.2.191-.2h.783c.151 0 .255.025.31.08.065.048.113.16.16.312l1.342 5.284 1.245-5.284c.04-.16.088-.264.151-.312a.549.549 0 0 1 .32-.08h.638c.152 0 .256.025.32.08.063.048.12.16.151.312l1.261 5.348 1.381-5.348c.048-.16.104-.264.16-.312a.52.52 0 0 1 .311-.08h.743c.127 0 .2.065.2.2 0 .04-.009.08-.017.128a1.137 1.137 0 0 1-.056.2l-1.923 6.17c-.048.16-.104.263-.168.311a.51.51 0 0 1-.303.08h-.687c-.151 0-.255-.024-.32-.08-.063-.056-.119-.16-.15-.32l-1.238-5.148-1.23 5.14c-.04.16-.087.264-.15.32-.065.056-.177.08-.32.08zm10.256.215c-.415 0-.83-.048-1.229-.143-.399-.096-.71-.2-.918-.32-.128-.071-.215-.151-.247-.223a.563.563 0 0 1-.048-.224v-.407c0-.167.064-.247.183-.247.048 0 .096.008.144.024.048.016.12.048.2.08.271.12.566.215.878.279.319.064.63.096.95.096.502 0 .894-.088 1.165-.264a.86.86 0 0 0 .415-.758.777.777 0 0 0-.215-.559c-.144-.151-.416-.287-.807-.415l-1.157-.36c-.583-.183-1.014-.454-1.277-.813a1.902 1.902 0 0 1-.4-1.158c0-.335.073-.63.216-.886.144-.255.335-.479.575-.654.24-.184.51-.32.83-.415.32-.096.655-.136 1.006-.136.175 0 .359.008.535.032.183.024.35.056.518.088.16.04.312.08.455.127.144.048.256.096.336.144a.69.69 0 0 1 .24.2.43.43 0 0 1 .071.263v.375c0 .168-.064.256-.184.256a.83.83 0 0 1-.303-.096 3.652 3.652 0 0 0-1.532-.311c-.455 0-.815.071-1.062.223-.248.152-.375.383-.375.71 0 .224.08.416.24.567.159.152.454.304.877.44l1.134.358c.574.184.99.44 1.237.767.247.327.367.702.367 1.117 0 .343-.072.655-.207.926-.144.272-.336.511-.583.703-.248.2-.543.343-.886.447-.36.111-.734.167-1.142.167zM21.698 16.207c-2.626 1.94-6.442 2.969-9.722 2.969-4.598 0-8.74-1.7-11.87-4.526-.247-.223-.024-.527.272-.351 3.384 1.963 7.559 3.153 11.877 3.153 2.914 0 6.114-.607 9.06-1.852.439-.2.814.287.383.607zM22.792 14.961c-.336-.43-2.22-.207-3.074-.103-.255.032-.295-.192-.063-.36 1.5-1.053 3.967-.75 4.254-.399.287.36-.08 2.826-1.485 4.007-.215.184-.423.088-.327-.151.32-.79 1.03-2.57.695-2.994z"})}):r.includes("tidbcloud")||r.includes("tidb")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#00D2C4",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M12 0 1.609 6.001v11.998L11.999 24l10.393-6.001V6.001ZM8.535 17.999v-7.998L5.07 12V8L12 4l3.462 2-3.464 2.001v12Zm6.93 0v-7.997l3.464-2v7.997z"})}):r.includes("gmailworkspace")||r.includes("gmail")||r.includes("workspace")?l.jsxs("svg",{width:t,height:t,viewBox:"52 42 88 66",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{fill:"#4285F4",d:"M58 108h14V74L52 59v43c0 3.32 2.69 6 6 6"}),l.jsx("path",{fill:"#34A853",d:"M120 108h14c3.32 0 6-2.69 6-6V59l-20 15"}),l.jsx("path",{fill:"#FBBC04",d:"M120 48v26l20-15v-8c0-7.42-8.47-11.65-14.4-7.2"}),l.jsx("path",{fill:"#EA4335",d:"M72 74V48l24 18 24-18v26L96 92"}),l.jsx("path",{fill:"#C5221F",d:"M52 51v8l20 15V48l-5.6-4.2c-5.94-4.45-14.4-.22-14.4 7.2"})]}):r.includes("vercel")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"currentColor",className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-primary)"},children:l.jsx("path",{d:"M24 22.525H0l12-21.05 12 21.05z"})}):r.includes("cloudinary")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#0078FF",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M24 14.8598c0 2.1729-1.3757 3.974-3.5903 4.6996l-.0995.0318V17.989c1.3777-.5805 2.1869-1.7275 2.1869-3.1291-.0072-2-1.6087-3.6288-3.6082-3.6699h-.5964l-.1432-.5686c-.7025-2.8996-3.2886-4.9489-6.2721-4.97a6.3915 6.3915 0 0 0-5.811 3.664l-.1828.3757-.4175.0437a4.4311 4.4311 0 0 0-3.3052 2.088c-1.2803 2.0856-.6274 4.8143 1.4583 6.0947v1.6897h-.01l-.149-.0675a5.9402 5.9402 0 0 1-3.3658-4.3494c-.5787-3.2291 1.57-6.3161 4.7991-6.8948a7.8766 7.8766 0 0 1 6.9839-4.149c3.4724.025 6.535 2.28 7.5901 5.5883 2.5789.3366 4.5138 2.5245 4.5327 5.1251zm-15.3176-1.322h.5647a.0656.0656 0 0 0 .0457-.1113L7.084 11.2158l-.0007-.0007a.0656.0656 0 0 0-.0927.0007L4.78 13.4265a.0656.0656 0 0 0 .0477.1113h.5566a.0656.0656 0 0 1 .0657.0656v5.0574c0 .6588.534 1.1928 1.1928 1.1928H9.247a.0656.0656 0 0 0 .0457-.1113l-.33-.33a1.1928 1.1928 0 0 1-.348-.839v-4.97a.0676.0676 0 0 1 .0676-.0655zm9.769 2.5466h.5667a.0655.0655 0 0 0 .0457-.1133l-2.2107-2.2087-.0015-.0015a.0636.0636 0 0 0-.0899.0015L14.551 15.971a.0657.0657 0 0 0 .0457.1133h.5567a.0656.0656 0 0 1 .0656.0656v2.5108c0 .6588.534 1.1928 1.1928 1.1928h2.6063a.0655.0655 0 0 0 .0457-.1113l-.33-.33a1.1928 1.1928 0 0 1-.348-.839V16.15a.0656.0656 0 0 1 .0657-.0656zm-4.8844-1.2743h.5646a.0656.0656 0 0 0 .0477-.1114l-2.2107-2.2027-.0006-.0006a.0656.0656 0 0 0-.0928.0006l-2.2087 2.2068a.0656.0656 0 0 0 .0457.1113h.5626a.0676.0676 0 0 1 .0657.0676v3.7791c0 .6588.534 1.1928 1.1928 1.1928h2.5983a.0656.0656 0 0 0 .0477-.1113l-.332-.33a1.193 1.193 0 0 1-.346-.839v-3.6956c0-.0366.0291-.0665.0657-.0676z"})}):r.includes("tiktok")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#000000"}),l.jsxs("g",{transform:"scale(0.7) translate(5.14, 5.14)",children:[l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#25F4EE",transform:"translate(-0.5, -0.5)"}),l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#FE094C",transform:"translate(0.5, 0.5)"}),l.jsx("path",{d:"M12.525.02c1.31-.02 2.61-.01 3.91-.02.08 1.53.63 3.09 1.75 4.17 1.12 1.11 2.7 1.62 4.24 1.79v4.03c-1.44-.05-2.89-.35-4.2-.97-.57-.26-1.1-.59-1.62-.93-.01 2.92.01 5.84-.02 8.75-.08 1.4-.54 2.79-1.35 3.94-1.31 1.92-3.58 3.17-5.91 3.21-1.43.08-2.86-.31-4.08-1.03-2.02-1.19-3.44-3.37-3.65-5.71-.02-.5-.03-1-.01-1.49.18-1.9 1.12-3.72 2.58-4.96 1.66-1.44 3.98-2.13 6.15-1.72.02 1.48-.04 2.96-.04 4.44-.99-.32-2.15-.23-3.02.37-.63.41-1.11 1.04-1.36 1.75-.21.51-.15 1.07-.14 1.61.24 1.64 1.82 3.02 3.5 2.87 1.12-.01 2.19-.66 2.77-1.61.19-.33.4-.67.41-1.06.1-1.79.06-3.57.07-5.36.01-4.03-.01-8.05.02-12.07z",fill:"#FFFFFF"})]})]}):r.includes("instagram")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("defs",{children:l.jsxs("linearGradient",{id:"instagram-gradient-new",x1:"0%",y1:"100%",x2:"100%",y2:"0%",children:[l.jsx("stop",{offset:"0%",stopColor:"#fdf497"}),l.jsx("stop",{offset:"5%",stopColor:"#fdf497"}),l.jsx("stop",{offset:"28%",stopColor:"#fd5949"}),l.jsx("stop",{offset:"75%",stopColor:"#d6249f"}),l.jsx("stop",{offset:"100%",stopColor:"#285AEB"})]})}),l.jsx("path",{d:"M12 0C8.74 0 8.333.015 7.053.072 5.775.132 4.905.333 4.14.63c-.789.306-1.459.717-2.126 1.384S.935 3.35.63 4.14C.333 4.905.131 5.775.072 7.053.012 8.333 0 8.74 0 12s.015 3.667.072 4.947c.06 1.277.261 2.148.558 2.913.306.788.717 1.459 1.384 2.126.667.666 1.336 1.079 2.126 1.384.766.296 1.636.499 2.913.558C8.333 23.988 8.74 24 12 24s3.667-.015 4.947-.072c1.277-.06 2.148-.262 2.913-.558.788-.306 1.459-.718 2.126-1.384.666-.667 1.079-1.335 1.384-2.126.296-.765.499-1.636.558-2.913.06-1.28.072-1.687.072-4.947s-.015-3.667-.072-4.947c-.06-1.277-.262-2.149-.558-2.913-.306-.789-.718-1.459-1.384-2.126C21.319 1.347 20.651.935 19.86.63c-.765-.297-1.636-.499-2.913-.558C15.667.012 15.26 0 12 0zm0 2.16c3.203 0 3.585.016 4.85.071 1.17.055 1.805.249 2.227.415.562.217.96.477 1.382.896.419.42.679.819.896 1.381.164.422.36 1.057.413 2.227.057 1.266.07 1.646.07 4.85s-.015 3.585-.074 4.85c-.061 1.17-.256 1.805-.421 2.227-.224.562-.479.96-.899 1.382-.419.419-.824.679-1.38.896-.42.164-1.065.36-2.235.413-1.274.057-1.649.07-4.859.07-3.211 0-3.586-.015-4.859-.074-1.171-.061-1.816-.256-2.236-.421-.569-.224-.96-.479-1.379-.899-.421-.419-.69-.824-.9-1.38-.165-.42-.359-1.065-.42-2.235-.045-1.26-.061-1.649-.061-4.844 0-3.196.016-3.586.061-4.861.061-1.17.255-1.814.42-2.234.21-.57.479-.96.9-1.381.419-.419.81-.689 1.379-.898.42-.166 1.051-.361 2.221-.421 1.275-.045 1.65-.06 4.859-.06l.045.03zm0 3.678c-3.405 0-6.162 2.76-6.162 6.162 0 3.405 2.76 6.162 6.162 6.162 3.405 0 6.162-2.76 6.162-6.162 0-3.405-2.76-6.162-6.162-6.162zM12 16c-2.21 0-4-1.79-4-4s1.79-4 4-4 4 1.79 4 4-1.79 4-4 4zm7.846-10.405c0 .795-.646 1.44-1.44 1.44-.795 0-1.44-.646-1.44-1.44 0-.794.646-1.439 1.44-1.439.793-.001 1.44.645 1.44 1.439z",fill:"url(#instagram-gradient-new)"})]}):r.includes("shopee")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#EE4D2D",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M15.9414 17.9633c.229-1.879-.981-3.077-4.1758-4.0969-1.548-.528-2.277-1.22-2.26-2.1719.065-1.056 1.048-1.825 2.352-1.85a5.2898 5.2898 0 0 1 2.8838.89c.116.072.197.06.263-.039.09-.145.315-.494.39-.62.051-.081.061-.187-.068-.281-.185-.1369-.704-.4149-.983-.5319a6.4697 6.4697 0 0 0-2.5118-.514c-1.909.008-3.4129 1.215-3.5389 2.826-.082 1.1629.494 2.1078 1.73 2.8278.262.152 1.6799.716 2.2438.892 1.774.552 2.695 1.5419 2.478 2.6969-.197 1.047-1.299 1.7239-2.818 1.7439-1.2039-.046-2.2878-.537-3.1278-1.19l-.141-.11c-.104-.08-.218-.075-.287.03-.05.077-.376.547-.458.67-.077.108-.035.168.045.234.35.293.817.613 1.134.775a6.7097 6.7097 0 0 0 2.8289.727 4.9048 4.9048 0 0 0 2.0759-.354c1.095-.465 1.8029-1.394 1.9449-2.554zM11.9986 1.4009c-2.068 0-3.7539 1.95-3.8329 4.3899h7.6657c-.08-2.44-1.765-4.3899-3.8328-4.3899zm7.8516 22.5981-.08.001-15.7843-.002c-1.074-.04-1.863-.91-1.971-1.991l-.01-.195L1.298 6.2858a.459.459 0 0 1 .45-.494h4.9748C6.8448 2.568 9.1607 0 11.9996 0c2.8388 0 5.1537 2.5689 5.2757 5.7898h4.9678a.459.459 0 0 1 .458.483l-.773 15.5883-.007.131c-.094 1.094-.979 1.9769-2.0709 2.0059z"})}):r.includes("telegram")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("circle",{cx:"12",cy:"12",r:"12",fill:"#2CA5E0"}),l.jsx("path",{d:"M5.4 11.6l12.7-4.9c.6-.2 1.1.1.9.8l-2.2 10.2c-.2.7-.6.9-1.2.5l-3.3-2.4-1.6 1.5c-.2.2-.3.3-.5.3l.2-3.4 6.2-5.6c.3-.2-.1-.4-.4-.2l-7.6 4.8-3.3-1c-.7-.2-.7-.7.1-.9z",fill:"#FFFFFF"})]}):r.includes("riot")||r.includes("valorant")||r.includes("league of legends")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#EB0029",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M13.458.86 0 7.093l3.353 12.761 2.552-.313-.701-8.024.838-.373 1.447 8.202 4.361-.535-.775-8.857.83-.37 1.591 9.025 4.412-.542-.849-9.708.84-.374 1.74 9.87L24 17.318V3.5Zm.316 19.356.222 1.256L24 23.14v-4.18l-10.22 1.256Z"})}):r.includes("vng")?l.jsxs("svg",{width:t,height:t,viewBox:"0 0 354.3 226.8",fill:"none",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:[l.jsx("path",{d:"M37.9,103.7c1.3,4.7,2.7,9.3,4.2,14c0.5,1.7,0.5,2.4-1.2,3.4C26.5,129.5,13,142.1,0.5,155.8c-1,1.1-0.9,1.7,0.3,2.5c20,13.7,39.9,27.5,60,41.2c1.7,1.1,2.5,0.7,3.5-1.1c11.6-21,24.1-41.5,36.5-62.1c1.3-2.1,2.4-2.8,4.9-1.9c15.1,5.3,29.9,11.3,45.4,15.6c4,1.1,5.9-0.1,7-4.1c4.9-18.7,9.8-37.4,14.6-56.1c0.4-1.6,0.3-2.3-1.4-3C155.4,79.5,140,70.8,125.1,61c-1.3-0.8-2.2-0.8-3.4,0.3c-13.6,12.7-27.1,25.4-40.8,38C39.8,100.1,38.9,100.7,37.9,103.7",fill:"#EB5A26"}),l.jsx("path",{d:"M112.5,103.5c4-7.5,8-15,11.9-22.5c1.4-2.7,1-3.6-1.9-4.8c-26.6-11.2-53-22.7-79.6-33.8c-1.2-0.5-2.2-0.3-2.9,0.8C27.9,60,15.7,76.5,3.9,93.2c-0.6,0.9-0.5,1.7,0.3,2.3c21.8,15.5,43.6,30.9,65.6,46.2c0.8,0.5,1.7,0.5,2.5-0.2C85.5,129.3,98.7,116.3,112.5,103.5",fill:"#0E71BA"}),l.jsx("path",{d:"M211.7,137.9c-8.9,0-15.6-2.2-20.2-6.6c-4.6-4.4-6.9-11-6.9-19.8V64.6h17.9v45.5c0,9.3,4.4,13.9,13.3,13.9c8.9,0,13.3-4.6,13.3-13.9V64.6h17.9v46.9c0,8.8-2.3,15.4-6.9,19.8C225.8,135.7,219.5,137.9,211.7,137.9",fill:"#2C373E"}),l.jsx("path",{d:"M260.9,64.6h18.3c15.2,0,22.8,6.8,22.8,20.3v32.7c0,13.5-7.6,20.3-22.8,20.3h-18.3V64.6z M278.8,121.7c4.6,0,6.9-2.5,6.9-7.5V84.9c0-5-2.3-7.5-6.9-7.5h-0.1v44.3H278.8z",fill:"#2C373E"}),l.jsx("path",{d:"M328.7,103.7h18.5V120c0,12-6.5,18-19.6,18c-15,0-22.5-7.3-22.5-22v-31c0-14.7,7.5-22,22.5-22c14.9,0,22,6.9,21.3,20.8h-18.1c0-4.9-1-7.4-3.1-7.4c-3,0-4.5,2.9-4.5,8.6v31c0,5.7,1.5,8.6,4.5,8.6C326.6,113.6,328.4,110.3,328.7,103.7",fill:"#2C373E"})]}):r.includes("reddit")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#FF4500",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M12 0C5.373 0 0 5.373 0 12c0 3.314 1.343 6.314 3.515 8.485l-2.286 2.286C.775 23.225 1.097 24 1.738 24H12c6.627 0 12-5.373 12-12S18.627 0 12 0Zm4.388 3.199c1.104 0 1.999.895 1.999 1.999 0 1.105-.895 2-1.999 2-.946 0-1.739-.657-1.947-1.539v.002c-1.147.162-2.032 1.15-2.032 2.341v.007c1.776.067 3.4.567 4.686 1.363.473-.363 1.064-.58 1.707-.58 1.547 0 2.802 1.254 2.802 2.802 0 1.117-.655 2.081-1.601 2.531-.088 3.256-3.637 5.876-7.997 5.876-4.361 0-7.905-2.617-7.998-5.87-.954-.447-1.614-1.415-1.614-2.538 0-1.548 1.255-2.802 2.803-2.802.645 0 1.239.218 1.712.585 1.275-.79 2.881-1.291 4.64-1.365v-.01c0-1.663 1.263-3.034 2.88-3.207.188-.911.993-1.595 1.959-1.595Zm-8.085 8.376c-.784 0-1.459.78-1.506 1.797-.047 1.016.64 1.429 1.426 1.429.786 0 1.371-.369 1.418-1.385.047-1.017-.553-1.841-1.338-1.841Zm7.406 0c-.786 0-1.385.824-1.338 1.841.047 1.017.634 1.385 1.418 1.385.785 0 1.473-.413 1.426-1.429-.046-1.017-.721-1.797-1.506-1.797Zm-3.703 4.013c-.974 0-1.907.048-2.77.135-.147.015-.241.168-.183.305.483 1.154 1.622 1.964 2.953 1.964 1.33 0 2.47-.81 2.953-1.964.057-.137-.037-.29-.184-.305-.863-.087-1.795-.135-2.769-.135Z"})}):r.includes("steam")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#171A21",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M11.979 0C5.678 0 .511 4.86.022 11.037l6.432 2.658c.545-.371 1.203-.59 1.912-.59.063 0 .125.004.188.006l2.861-4.142V8.91c0-2.495 2.028-4.524 4.524-4.524 2.494 0 4.524 2.031 4.524 4.527s-2.03 4.525-4.524 4.525h-.105l-4.076 2.911c0 .052.004.105.004.159 0 1.875-1.515 3.396-3.39 3.396-1.635 0-3.016-1.173-3.331-2.727L.436 15.27C1.862 20.307 6.486 24 11.979 24c6.627 0 11.999-5.373 11.999-12S18.605 0 11.979 0zM7.54 18.21l-1.473-.61c.262.543.714.999 1.314 1.25 1.297.539 2.793-.076 3.332-1.375.263-.63.264-1.319.005-1.949s-.75-1.121-1.377-1.383c-.624-.26-1.29-.249-1.878-.03l1.523.63c.956.4 1.409 1.5 1.009 2.455-.397.957-1.497 1.41-2.454 1.012H7.54zm11.415-9.303c0-1.662-1.353-3.015-3.015-3.015-1.665 0-3.015 1.353-3.015 3.015 0 1.665 1.35 3.015 3.015 3.015 1.663 0 3.015-1.35 3.015-3.015zm-5.273-.005c0-1.252 1.013-2.266 2.265-2.266 1.249 0 2.266 1.014 2.266 2.266 0 1.251-1.017 2.265-2.266 2.265-1.253 0-2.265-1.014-2.265-2.265z"})}):r.includes("discord")?l.jsx("svg",{width:t,height:t,viewBox:"0 0 24 24",fill:"#5865F2",className:n,style:{display:"inline-block",verticalAlign:"middle"},children:l.jsx("path",{d:"M20.317 4.3698a19.7913 19.7913 0 00-4.8851-1.5152.0741.0741 0 00-.0785.0371c-.211.3753-.4447.8648-.6083 1.2495-1.8447-.2762-3.68-.2762-5.4868 0-.1636-.3933-.4058-.8742-.6177-1.2495a.077.077 0 00-.0785-.037 19.7363 19.7363 0 00-4.8852 1.515.0699.0699 0 00-.0321.0277C.5334 9.0458-.319 13.5799.0992 18.0578a.0824.0824 0 00.0312.0561c2.0528 1.5076 4.0413 2.4228 5.9929 3.0294a.0777.0777 0 00.0842-.0276c.4616-.6304.8731-1.2952 1.226-1.9942a.076.076 0 00-.0416-.1057c-.6528-.2476-1.2743-.5495-1.8722-.8923a.077.077 0 01-.0076-.1277c.1258-.0943.2517-.1923.3718-.2914a.0743.0743 0 01.0776-.0105c3.9278 1.7933 8.18 1.7933 12.0614 0a.0739.0739 0 01.0785.0095c.1202.099.246.1981.3728.2924a.077.077 0 01-.0066.1276 12.2986 12.2986 0 01-1.873.8914.0766.0766 0 00-.0407.1067c.3604.698.7719 1.3628 1.225 1.9932a.076.076 0 00.0842.0286c1.961-.6067 3.9495-1.5219 6.0023-3.0294a.077.077 0 00.0313-.0552c.5004-5.177-.8382-9.6739-3.5485-13.6604a.061.061 0 00-.0312-.0286zM8.02 15.3312c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9555-2.4189 2.157-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.9555 2.4189-2.1569 2.4189zm7.9748 0c-1.1825 0-2.1569-1.0857-2.1569-2.419 0-1.3332.9554-2.4189 2.1569-2.4189 1.2108 0 2.1757 1.0952 2.1568 2.419 0 1.3332-.946 2.4189-2.1568 2.4189Z"})}):l.jsx(dd,{size:t,className:n,style:{display:"inline-block",verticalAlign:"middle",color:"var(--text-accent)"}})},pf=({credentials:e,platforms:t,selectedPlatform:n,setSelectedPlatform:r,onlyFavorites:i,setOnlyFavorites:s,activeView:o,setActiveView:a})=>{const[c,d]=Ut.useState(!0);return l.jsx("aside",{className:"glass-panel scrollable",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"20px",height:"100%",overflowY:"auto"},children:l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px",flexGrow:1},children:[l.jsxs("button",{onClick:()=>{s(!1),r(null),a("vault")},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:!i&&!n&&o==="vault"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:!i&&!n&&o==="vault"?"var(--text-accent)":"var(--text-primary)",fontWeight:!i&&!n&&o==="vault"?600:400,cursor:"pointer",transition:"var(--transition-smooth)"},children:["Tất cả tài khoản (",e.length,")"]}),l.jsxs("button",{onClick:()=>{s(!i),r(null),a("vault")},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:i&&!n&&o==="vault"?"rgba(56, 239, 125, 0.1)":"transparent",border:"none",borderRadius:"8px",color:i&&!n&&o==="vault"?"var(--text-emerald)":"var(--text-primary)",fontWeight:i&&!n&&o==="vault"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(Po,{size:14,fill:i&&!n&&o==="vault"?"var(--text-emerald)":"none"}),"Yêu thích (",e.filter(x=>x.is_favorite).length,")"]}),l.jsxs("button",{onClick:()=>{a("proxy"),r(null),s(!1)},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="proxy"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="proxy"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="proxy"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(Y1,{size:14,style:{color:o==="proxy"?"var(--text-accent)":"var(--text-secondary)"}}),"Kiểm tra Proxy"]}),l.jsxs("button",{onClick:()=>{a("proxy-list"),r(null),s(!1)},style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="proxy-list"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="proxy-list"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="proxy-list"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"8px",transition:"var(--transition-smooth)"},children:[l.jsx(sd,{size:14,style:{color:o==="proxy-list"?"var(--text-accent)":"var(--text-secondary)"}}),"Quản lý Proxy"]}),l.jsxs("button",{onClick:()=>d(!c),style:{display:"flex",justifyContent:"space-between",alignItems:"center",width:"100%",padding:"10px 14px",background:"transparent",border:"none",color:"var(--text-primary)",cursor:"pointer",textAlign:"left",fontWeight:500,transition:"var(--transition-smooth)",borderRadius:"8px",marginBottom:"4px"},onMouseEnter:x=>{x.currentTarget.style.background="rgba(255, 255, 255, 0.03)"},onMouseLeave:x=>{x.currentTarget.style.background="transparent"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx(Vl,{size:16,style:{color:"var(--text-secondary)"}}),l.jsx("span",{children:"Nền tảng"})]}),c?l.jsx(Fr,{size:14,style:{color:"var(--text-secondary)"}}):l.jsx(nd,{size:14,style:{color:"var(--text-secondary)"}})]}),c&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",paddingLeft:"8px"},children:[t.filter(x=>x.is_active).map(x=>{const y=e.filter(g=>g.platform_id===x.id).length;return l.jsxs("button",{onClick:()=>{r(x.id),s(!1),a("vault")},style:{width:"100%",padding:"8px 14px",textAlign:"left",background:n===x.id&&o==="vault"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:n===x.id&&o==="vault"?"var(--text-accent)":"var(--text-primary)",fontWeight:n===x.id&&o==="vault"?600:400,cursor:"pointer",display:"flex",justifyContent:"space-between",alignItems:"center",transition:"var(--transition-smooth)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(oi,{name:x.icon,size:14}),l.jsx("span",{children:x.name})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:y})]},x.id)}),t.filter(x=>x.is_active).length===0&&l.jsx("span",{style:{fontSize:"12px",color:"var(--text-muted)",paddingLeft:"14px",fontStyle:"italic"},children:"Không có nền tảng active"})]}),l.jsx("hr",{style:{border:"none",borderTop:"1px solid rgba(255,255,255,0.05)",marginTop:"auto",marginBottom:"8px"}}),l.jsxs("button",{onClick:()=>a("settings"),style:{width:"100%",padding:"10px 14px",textAlign:"left",background:o==="settings"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"8px",color:o==="settings"?"var(--text-accent)":"var(--text-primary)",fontWeight:o==="settings"?600:400,cursor:"pointer",display:"flex",alignItems:"center",gap:"10px",transition:"var(--transition-smooth)"},children:[l.jsx(af,{size:16}),l.jsx("span",{children:"Cài đặt"})]})]})})},ff=({cred:e,platforms:t,totp:n,onToggleFavorite:r,onEdit:i,onDelete:s})=>{const[o,a]=C.useState(!1),[c,d]=C.useState(!1),[x,y]=C.useState(null),g=(w,z)=>{navigator.clipboard.writeText(w),y(z),setTimeout(()=>{y(null)},2e3)},k=e.platform_id?t.find(w=>w.id===e.platform_id):null,S=(n==null?void 0:n.remaining)??0,m=7,N=2*Math.PI*m,p=N*(1-S/30),u=S<=5,f=u?"#ef4444":"var(--text-emerald)",j=u?"#ef4444":"var(--text-secondary)",v=()=>{var z;(z=window.getSelection())!=null&&z.toString()||a(!o)};return l.jsxs("div",{className:"glass-panel animate-fade-in",onClick:v,style:{padding:"20px",display:"flex",flexDirection:"column",gap:o?"16px":"8px",cursor:"pointer"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[k&&l.jsx(oi,{name:k.icon,size:18}),l.jsxs("div",{style:{display:"flex",flexDirection:"column"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:600,color:"var(--text-primary)"},children:k?k.name:e.title||"Tài khoản"}),l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"2px",marginTop:"2px"},children:(e.email||!k&&e.title)&&l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:["Email: ",e.email||e.title]})})]})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{onClick:w=>{w.stopPropagation(),r()},style:{background:"none",border:"none",color:e.is_favorite?"var(--text-emerald)":"var(--text-muted)",cursor:"pointer"},title:e.is_favorite?"Bỏ yêu thích":"Yêu thích",children:l.jsx(Po,{size:16,fill:e.is_favorite?"var(--text-emerald)":"none"})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),i()},style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},title:"Sửa tài khoản",children:l.jsx(pd,{size:16})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),s()},style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer"},title:"Xóa tài khoản",children:l.jsx(un,{size:16})}),l.jsx("button",{onClick:w=>{w.stopPropagation(),a(!o)},style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},title:o?"Thu gọn":"Mở rộng",children:o?l.jsx(Z1,{size:16}):l.jsx(Fr,{size:16})})]})]}),(o||e.totp_secret)&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[o&&e.uid&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"UID:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500,fontFamily:"monospace"},children:e.uid}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),g(e.uid||"","uid")},title:"Sao chép UID",children:x==="uid"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.username&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Username:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:500},children:e.username}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),g(e.username,"username")},title:"Sao chép tài khoản",children:x==="username"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.password&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Mật khẩu:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:c?e.password:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),d(!c)},title:c?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:c?l.jsx(_n,{size:12}):l.jsx(Ln,{size:12})}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),g(e.password,"password")},title:"Sao chép mật khẩu",children:x==="password"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),e.totp_secret&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:"4px"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-accent)",fontWeight:500},children:"Mã 2FA (OTP):"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx("span",{className:"otp-display",style:{fontSize:"15px",padding:"4px 8px"},children:(n==null?void 0:n.token)||"------"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px",minWidth:"55px",justifyContent:"flex-start"},children:[l.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)",flexShrink:0},children:[l.jsx("circle",{cx:"10",cy:"10",r:m,fill:"none",stroke:"var(--border-color)",strokeWidth:"2.5"}),S>0&&l.jsx("circle",{cx:"10",cy:"10",r:m,fill:"none",stroke:f,strokeWidth:"2.5",strokeDasharray:N,strokeDashoffset:p,style:{transition:"stroke-dashoffset 1s linear, stroke 0.3s"}})]}),l.jsxs("span",{style:{fontSize:"12px",fontWeight:600,color:j,minWidth:"22px"},children:[S,"s"]})]}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"4px",borderRadius:"4px"},onClick:w=>{w.stopPropagation(),g((n==null?void 0:n.token)||"","otp")},title:"Sao chép mã OTP",children:x==="otp"?l.jsx(tr,{size:12,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:12})})]})]}),o&&e.url&&l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Link:"}),l.jsxs("a",{href:e.url.startsWith("http")?e.url:`https://${e.url}`,target:"_blank",rel:"noreferrer",onClick:w=>{w.stopPropagation()},style:{fontSize:"13px",color:"var(--text-accent)",display:"flex",alignItems:"center",gap:"4px",textDecoration:"none"},children:["Truy cập website",l.jsx(zo,{size:12})]})]})]}),o&&e.custom_fields&&e.custom_fields.length>0&&l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"6px",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"10px"},children:e.custom_fields.map((w,z)=>l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"12px",color:"var(--text-muted)"},children:[w.key,":"]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:500},children:w.value}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"2px 4px",borderRadius:"3px"},onClick:T=>{T.stopPropagation(),g(w.value,`custom_${z}`)},title:`Sao chép ${w.key}`,children:x===`custom_${z}`?l.jsx(tr,{size:10,style:{color:"var(--text-emerald)"}}):l.jsx(Zt,{size:10})})]})]},z))}),o&&e.notes&&l.jsx("p",{style:{fontSize:"12px",color:"var(--text-muted)",borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"10px",fontStyle:"italic"},children:e.notes})]})},hf=({cred:e,platforms:t,totp:n,visibleColumns:r,isSelected:i,onToggleSelect:s,onToggleFavorite:o,onEdit:a,onDelete:c})=>{const[d,x]=C.useState(!1),[y,g]=C.useState(!1),[k,S]=C.useState(!1),[m,N]=C.useState(null),[p,u]=C.useState(!1),f=(M,F)=>{navigator.clipboard.writeText(M),N(F),setTimeout(()=>N(null),2e3)},j=()=>{navigator.clipboard.writeText(e.id),u(!0),setTimeout(()=>u(!1),2e3)},v=M=>{if(!e.custom_fields)return"";const F=M.toLowerCase().trim(),H=e.custom_fields.find(K=>{const h=K.key.toLowerCase().trim();return F==="mail kp"?h==="mail kp"||h==="mailkp"||h==="email kp"||h==="emailkp"||h.includes("khôi phục")||h.includes("recovery"):F==="sđt"?h==="sđt"||h==="sdt"||h==="phone"||h==="sđt khôi phục"||h.includes("điện thoại")||h==="phone number":F==="backup code"?h==="backup code"||h==="backupcode"||h.includes("backup")||h.includes("mã dự phòng")||h.includes("mã cứu hộ")||h.includes("dự phòng"):F==="pass mail"?h==="pass mail"||h==="passmail"||h==="mật khẩu mail"||h==="mật khẩu email"||h==="pass email"||h==="passemail"||h.includes("mật khẩu email")||h.includes("pass mail"):h===F});return H?H.value:""},w=e.platform_id?t.find(M=>M.id===e.platform_id):null,z=(n==null?void 0:n.remaining)??0,T=7,D=2*Math.PI*T,L=D*(1-z/30),Z=z<=5,U=Z?"#ef4444":"var(--text-emerald)",P=Z?"#ef4444":"var(--text-secondary)",X=v("mail kp"),re=v("sđt"),A=v("backup code"),W=v("pass mail"),b=e.totp_secret;return l.jsxs("tr",{style:{background:i?"var(--bg-active-tab)":void 0,transition:"var(--transition-smooth)"},children:[l.jsx("td",{style:{width:"40px",textAlign:"center"},children:l.jsx("input",{type:"checkbox",checked:i,onChange:()=>s(e.id),style:{cursor:"pointer",accentColor:"var(--text-accent)"}})}),r.id&&l.jsx("td",{children:l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:j,title:"Click để sao chép ID đầy đủ",children:p?l.jsx("span",{style:{fontSize:"12px",color:"var(--text-emerald)",fontWeight:500,fontFamily:"monospace"},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"12px",fontFamily:"monospace",color:"var(--text-secondary)"},children:e.id.substring(0,8)})})}),l.jsx("td",{children:l.jsx("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:w?l.jsxs(l.Fragment,{children:[l.jsx(oi,{name:w.icon,size:18}),l.jsx("span",{style:{fontSize:"13px"},children:w.name})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})})}),l.jsx("td",{children:l.jsx("span",{style:{fontWeight:600},children:e.email||e.title||"—"})}),r.username&&l.jsx("td",{children:e.username?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(e.username,"username"),title:"Click để sao chép Username",children:m==="username"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:e.username})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.uid&&l.jsx("td",{children:e.uid?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(e.uid||"","uid"),title:"Click để sao chép UID",children:m==="uid"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:e.uid})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.password&&l.jsx("td",{children:e.password?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(e.password,"password"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép mật khẩu",children:m==="password"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):d?e.password:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:()=>x(!d),title:d?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:d?l.jsx(_n,{size:11}):l.jsx(Ln,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.otp&&l.jsx("td",{children:e.totp_secret?l.jsx("div",{style:{display:"inline-flex",alignItems:"center",gap:"8px",cursor:"pointer"},onClick:()=>f((n==null?void 0:n.token)||"","otp"),title:"Click để sao chép OTP",children:m==="otp"?l.jsx("span",{style:{fontSize:"14px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsxs(l.Fragment,{children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:"bold",color:"var(--text-accent)"},children:(n==null?void 0:n.token)||"------"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 20 20",style:{transform:"rotate(-90deg)",flexShrink:0},children:[l.jsx("circle",{cx:"10",cy:"10",r:T,fill:"none",stroke:"var(--border-color)",strokeWidth:"2.5"}),z>0&&l.jsx("circle",{cx:"10",cy:"10",r:T,fill:"none",stroke:U,strokeWidth:"2.5",strokeDasharray:D,strokeDashoffset:L,style:{transition:"stroke-dashoffset 1s linear, stroke 0.3s"}})]}),l.jsxs("span",{style:{fontSize:"11px",fontWeight:600,color:P},children:[z,"s"]})]})]})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.mailKp&&l.jsx("td",{children:X?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(X,"mailKp"),title:"Click để sao chép Mail KP",children:m==="mailKp"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:X})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.phone&&l.jsx("td",{children:re?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(re,"phone"),title:"Click để sao chép SĐT",children:m==="phone"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px"},children:re})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.backupCode&&l.jsx("td",{children:A?l.jsx("div",{style:{cursor:"pointer",display:"inline-flex",alignItems:"center",gap:"6px"},onClick:()=>f(A,"backupCode"),title:"Click để sao chép Backup Code",children:m==="backupCode"?l.jsx("span",{style:{fontSize:"13px",color:"var(--text-emerald)",fontWeight:500},children:"Đã sao chép!"}):l.jsx("span",{style:{fontSize:"13px",fontFamily:"monospace"},children:A})}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.passMail&&l.jsx("td",{children:W?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(W,"passMail"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép Mật khẩu Email",children:m==="passMail"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):k?W:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:M=>{M.stopPropagation(),S(!k)},title:k?"Ẩn mật khẩu":"Hiển thị mật khẩu",children:k?l.jsx(_n,{size:11}):l.jsx(Ln,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.secretKey&&l.jsx("td",{children:b?l.jsxs("div",{style:{display:"inline-flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{onClick:()=>f(b,"secretKey"),style:{fontSize:"13px",fontFamily:"monospace",cursor:"pointer"},title:"Click để sao chép Secret Key",children:m==="secretKey"?l.jsx("span",{style:{color:"var(--text-emerald)",fontWeight:500,fontFamily:"var(--font-sans)"},children:"Đã sao chép!"}):y?b:"••••••••"}),l.jsx("button",{className:"btn btn-secondary",style:{padding:"3px",borderRadius:"4px"},onClick:()=>g(!y),title:y?"Ẩn Secret Key":"Hiển thị Secret Key",children:y?l.jsx(_n,{size:11}):l.jsx(Ln,{size:11})})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),r.url&&l.jsx("td",{children:e.url?l.jsxs("a",{href:e.url.startsWith("http")?e.url:`https://${e.url}`,target:"_blank",rel:"noreferrer",style:{fontSize:"13px",color:"var(--text-accent)",display:"inline-flex",alignItems:"center",gap:"4px",textDecoration:"none"},children:["Link ",l.jsx(zo,{size:12})]}):l.jsx("span",{style:{color:"var(--text-muted)",fontSize:"13px"},children:"—"})}),l.jsx("td",{children:l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[l.jsx("button",{onClick:()=>o(e),style:{background:"none",border:"none",color:e.is_favorite?"var(--text-emerald)":"var(--text-muted)",cursor:"pointer"},title:e.is_favorite?"Bỏ yêu thích":"Yêu thích",children:l.jsx(Po,{size:15,fill:e.is_favorite?"var(--text-emerald)":"none"})}),l.jsx("button",{onClick:()=>a(e),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},title:"Sửa tài khoản",children:l.jsx(pd,{size:15})}),l.jsx("button",{onClick:()=>c(e.id),style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer"},title:"Xóa tài khoản",children:l.jsx(un,{size:15})})]})})]})},xf=Ut.memo(hf),gf=({credentials:e,platforms:t,totps:n,visibleColumns:r,selectedIds:i,onToggleSelect:s,onToggleSelectAll:o,onToggleFavorite:a,onEdit:c,onDelete:d})=>{const x=Ut.useRef(null),y=e.length>0&&i.size===e.length,g=i.size>0&&i.size<e.length;return Ut.useEffect(()=>{x.current&&(x.current.indeterminate=g)},[g]),l.jsx("div",{className:"table-container animate-fade-in",children:l.jsxs("table",{className:"enterprise-table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{style:{width:"40px",textAlign:"center"},children:l.jsx("input",{ref:x,type:"checkbox",checked:y,onChange:o,style:{cursor:"pointer",accentColor:"var(--text-accent)"}})}),r.id&&l.jsx("th",{style:{minWidth:"90px"},children:"ID"}),l.jsx("th",{style:{minWidth:"120px"},children:"Nền tảng"}),l.jsx("th",{style:{minWidth:"140px"},children:"Email"}),r.username&&l.jsx("th",{style:{minWidth:"160px"},children:"Username"}),r.uid&&l.jsx("th",{style:{minWidth:"120px"},children:"UID"}),r.password&&l.jsx("th",{style:{minWidth:"140px"},children:"Mật khẩu"}),r.otp&&l.jsx("th",{style:{minWidth:"140px"},children:"Mã 2FA (OTP)"}),r.mailKp&&l.jsx("th",{style:{minWidth:"160px"},children:"Mail KP"}),r.phone&&l.jsx("th",{style:{minWidth:"110px"},children:"SĐT"}),r.backupCode&&l.jsx("th",{style:{minWidth:"160px"},children:"Backup Code"}),r.passMail&&l.jsx("th",{style:{minWidth:"140px"},children:"Pass Mail"}),r.secretKey&&l.jsx("th",{style:{minWidth:"160px"},children:"Secret Key"}),r.url&&l.jsx("th",{style:{minWidth:"90px"},children:"Liên kết"}),l.jsx("th",{style:{width:"100px",minWidth:"100px"},children:"Thao tác"})]})}),l.jsx("tbody",{children:e.map(k=>l.jsx(xf,{cred:k,platforms:t,totp:n[k.id],visibleColumns:r,isSelected:i.has(k.id),onToggleSelect:s,onToggleFavorite:a,onEdit:c,onDelete:d},k.id))})]})})},xd=({value:e,onChange:t,options:n,placeholder:r="Chọn...",disabled:i=!1,searchable:s=!0})=>{const[o,a]=C.useState(!1),[c,d]=C.useState(""),x=C.useRef(null),y=C.useRef(null),g=n.find(S=>S.value===e);C.useEffect(()=>{const S=m=>{x.current&&!x.current.contains(m.target)&&a(!1)};return document.addEventListener("mousedown",S),()=>document.removeEventListener("mousedown",S)},[]),C.useEffect(()=>{o&&s&&y.current&&(d(""),setTimeout(()=>{var S;(S=y.current)==null||S.focus()},50))},[o,s]);const k=n.filter(S=>S.label.toLowerCase().includes(c.toLowerCase()));return l.jsxs("div",{ref:x,style:{position:"relative",width:"100%"},children:[l.jsxs("button",{type:"button",onClick:()=>!i&&a(!o),className:"form-input",style:{display:"flex",alignItems:"center",justifyContent:"space-between",cursor:i?"not-allowed":"pointer",textAlign:"left",opacity:i?.6:1,paddingRight:"12px",width:"100%",background:"var(--bg-input)",borderColor:o?"var(--text-accent)":"var(--border-input)",boxShadow:o?"var(--glow-accent)":"none",transition:"var(--transition-smooth)",height:"42px",borderRadius:"8px"},disabled:i,children:[l.jsx("span",{style:{color:g?"var(--text-primary)":"var(--text-muted)"},children:g?g.label:r}),l.jsx(Fr,{size:16,style:{color:"var(--text-accent)",transform:o?"rotate(180deg)":"none",transition:"var(--transition-smooth)"}})]}),o&&l.jsxs("div",{className:"glass-panel",style:{position:"absolute",top:"calc(100% + 8px)",left:0,width:"100%",maxHeight:"300px",display:"flex",flexDirection:"column",zIndex:1e3,boxShadow:"0 15px 30px rgba(0, 0, 0, 0.4), var(--glow-accent)",background:"var(--bg-modal)",border:"1px solid var(--text-accent)",borderRadius:"12px",padding:"8px",overflow:"hidden"},children:[s&&n.length>5&&l.jsxs("div",{style:{position:"relative",marginBottom:"8px",flexShrink:0},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{ref:y,type:"text",className:"form-input",placeholder:"Tìm kiếm nhanh...",value:c,onChange:S=>d(S.target.value),style:{width:"100%",padding:"6px 30px 6px 30px",fontSize:"13px",borderRadius:"6px",background:"rgba(0, 0, 0, 0.2)",height:"32px",borderColor:"var(--border-color)"}}),c&&l.jsx("button",{type:"button",onClick:()=>d(""),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-muted)",cursor:"pointer",display:"flex",alignItems:"center",padding:0},children:l.jsx($n,{size:14})})]}),l.jsx("div",{className:"scrollable",style:{overflowY:"auto",display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:k.length===0?l.jsx("div",{style:{padding:"12px",fontSize:"13px",color:"var(--text-muted)",textAlign:"center"},children:"Không tìm thấy kết quả"}):k.map(S=>{const m=S.value===e;return l.jsx("button",{type:"button",className:"dropdown-item",onClick:()=>{t(S.value),a(!1)},style:{display:"block",width:"100%",padding:"10px 12px",borderRadius:"8px",border:"none",background:m?"var(--bg-active-tab)":"transparent",color:m?"var(--text-accent)":"var(--text-primary)",fontWeight:m?600:400,cursor:"pointer",textAlign:"left",fontSize:"13px"},children:S.label},S.value)})})]})]})},yf={facebook:["Pass Mail","Mail KP","Pass Mail KP","SĐT","Cookie","Token","Backup Code"],tiktok:["Email","Pass Mail","SĐT","Cookie","Backup Code"],twitter:["Email","Pass Mail","Auth Token","Backup Code"],instagram:["Email","Pass Mail","Cookie","Backup Code"],google:["Mail KP","Pass Mail KP","SĐT","Pass Mail","Backup Code"],outlook:["Mail KP","SĐT","Client ID","Refresh Token","Pass Mail","Backup Code"],telegram:["API ID","API Hash","Session String"],discord:["Email","Token","Backup Code","Pass Mail"],reddit:["Email","Pass Mail","Cookie","Backup Code"]},mf=({isOpen:e,onClose:t,credential:n,onChange:r,onSave:i,platforms:s})=>{var S;if(!e)return null;const o=n.platform_id||"",a=yf[o]||[],c=(n.custom_fields||[]).filter(m=>!a.some(N=>N.toLowerCase().trim()===m.key.toLowerCase().trim())),d=(m,N)=>{const p=[...n.custom_fields||[]],u=p.findIndex(f=>f.key.toLowerCase().trim()===m.toLowerCase().trim());u>=0?p[u]={...p[u],value:N}:p.push({key:m,value:N}),r({...n,custom_fields:p})},x=m=>{var p;const N=(p=n.custom_fields)==null?void 0:p.find(u=>u.key.toLowerCase().trim()===m.toLowerCase().trim());return N?N.value:""},y=()=>{const m=[...n.custom_fields||[]];m.push({key:"",value:""}),r({...n,custom_fields:m})},g=(m,N,p)=>{const u=c[m],f=[...n.custom_fields||[]],j=f.findIndex(v=>v===u);j>=0&&(f[j]={...f[j],[N]:p},r({...n,custom_fields:f}))},k=m=>{const N=c[m],p=(n.custom_fields||[]).filter(u=>u!==N);r({...n,custom_fields:p})};return l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:l.jsxs("form",{onSubmit:i,className:"glass-panel animate-fade-in scrollable",style:{width:"100%",maxWidth:"620px",padding:"30px",display:"flex",flexDirection:"column",gap:"16px",maxHeight:"90vh",overflowY:"auto",background:"var(--bg-modal)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:n.id?"Sửa tài khoản":"Thêm tài khoản mới"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:l.jsx($n,{size:20})})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Tên đăng nhập"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập username...",value:n.username||"",onChange:m=>r({...n,username:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Email"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập địa chỉ email...",value:n.email||"",onChange:m=>r({...n,email:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"UID"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"UID tài khoản...",value:n.uid||"",onChange:m=>r({...n,uid:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Mật khẩu"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập mật khẩu...",value:n.password||"",onChange:m=>r({...n,password:m.target.value})})]})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Đường dẫn Website"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"https://example.com...",value:n.url||"",onChange:m=>r({...n,url:m.target.value})})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Nền tảng (Platform)"}),l.jsx(xd,{value:n.platform_id||"",onChange:m=>r({...n,platform_id:m}),options:s.map(m=>({value:m.id,label:m.name})),placeholder:"Không chọn..."})]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Khóa bí mật 2FA (TOTP Secret Key)"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Nhập mã bí mật Base32 (ví dụ: JBSWY3DPEHPK3PXP)...",value:n.totp_secret||"",onChange:m=>r({...n,totp_secret:m.target.value})})]}),a.length>0&&l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{fontWeight:600,color:"var(--text-accent)"},children:["Thông tin bổ sung (",(S=s.find(m=>m.id===o))==null?void 0:S.name,")"]}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px",background:"rgba(255, 255, 255, 0.02)",padding:"14px",borderRadius:"8px",border:"1px solid var(--border-color)"},children:a.map(m=>l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:m}),l.jsx("input",{type:"text",className:"form-input",placeholder:`Nhập ${m.toLowerCase()}...`,value:x(m),onChange:N=>d(m,N.target.value)})]},m))})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{children:"Trường tùy chỉnh khác (Ví dụ: Mã PIN, Câu hỏi bảo mật...)"}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"2px 8px",fontSize:"11px"},onClick:y,children:"+ Thêm trường"})]}),c.map((m,N)=>l.jsxs("div",{className:"custom-field-row",children:[l.jsx("input",{type:"text",className:"form-input",placeholder:"Tên trường (ví dụ: PIN)",value:m.key,onChange:p=>g(N,"key",p.target.value)}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Giá trị",value:m.value,onChange:p=>g(N,"value",p.target.value)}),l.jsx("button",{type:"button",className:"btn btn-danger",style:{padding:"10px"},onClick:()=>k(N),children:"X"})]},N))]}),l.jsxs("div",{className:"form-group",children:[l.jsx("label",{className:"form-label",children:"Ghi chú thêm"}),l.jsx("textarea",{className:"form-input",placeholder:"Nhập ghi chú hoặc mã backup giải cứu...",rows:3,value:n.notes||"",onChange:m=>r({...n,notes:m.target.value}),style:{resize:"vertical"}})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"10px"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Hủy bỏ"}),l.jsx("button",{type:"submit",className:"btn btn-primary",children:"Lưu tài khoản"})]})]})})},vf=Ut.memo(({index:e,mapping:t,exampleValue:n,mappingOptions:r,onMappingChange:i,onRemove:s})=>l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",width:"150px",flexShrink:0},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"11px",color:"var(--text-secondary)",fontWeight:500},children:["Cột ",e+1]}),l.jsx("button",{type:"button",onClick:()=>s(e),style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",padding:"2px",display:"flex",alignItems:"center"},children:l.jsx($n,{size:14})})]}),l.jsx("select",{value:t,onChange:o=>i(e,o.target.value),className:"form-input",style:{padding:"8px 12px",fontSize:"13px",borderRadius:"8px",border:"1px solid var(--border-color)",background:"var(--bg-panel)",width:"100%"},children:r.map(o=>l.jsx("option",{value:o.value,children:o.label},o.value))}),l.jsxs("span",{style:{fontSize:"11px",color:"var(--text-muted)",whiteSpace:"nowrap",overflow:"hidden",textOverflow:"ellipsis"},title:n,children:["Ví dụ: ",n||"—"]})]})),Wa={facebook:"UID|Pass|2FA|Email|Pass_Email|MailKP|Pass_MailKP|Phone|Cookie|Token",tiktok:"Username|Pass|Email|Pass_Email|2FA|Phone|Cookie",twitter:"User|Pass|2FA|Backup Code|Mail|Pass Mail",instagram:"Username|Pass|Email|Pass_Email|2FA|Cookie",google:"Email|Pass|2FA|MailKP|Pass_MailKP|Phone",outlook:"Email|Pass|MailKP|Phone|Client_ID|Refresh_Token",telegram:"Phone|Pass_2FA|API_ID|API_Hash|Session_String",discord:"Username|Email|Pass|Token|2FA|Backup_Codes",reddit:"Username|Pass|Email|Pass_Email|Cookie"},kf=[{value:"skip",label:"❌ Bỏ qua cột này"},{value:"email",label:"📧 Email"},{value:"password",label:"🔑 Mật khẩu"},{value:"totp_secret",label:"🛡️ Mã 2FA (OTP)"},{value:"username",label:"👤 Tên đăng nhập"},{value:"uid",label:"🆔 UID tài khoản"},{value:"mail_kp",label:"📩 Mail khôi phục"},{value:"phone",label:"📞 Số điện thoại"},{value:"cookie",label:"🍪 Cookie"},{value:"token",label:"🔑 Access Token"},{value:"backup_code",label:"💾 Backup Code"},{value:"pass_mail",label:"🔑 Pass Mail"}],jf=({isOpen:e,onClose:t,text:n,onChange:r,onSubmit:i,platforms:s})=>{const[o,a]=C.useState(""),[c,d]=C.useState(["email"]),[x,y]=C.useState(!1);C.useEffect(()=>{const p=u=>{u.key==="Escape"&&t()};return e&&window.addEventListener("keydown",p),()=>{window.removeEventListener("keydown",p)}},[e,t]);const g=C.useCallback((p,u)=>{const f=[...c];f[p]=u,d(f),y(!0)},[c]),k=C.useCallback(p=>{d(u=>u.filter((f,j)=>j!==p)),y(!0)},[]),S=C.useCallback(()=>{d(p=>[...p,"skip"]),y(!0)},[]);C.useEffect(()=>{e&&(n||(y(!1),d(["email"])))},[e,n]),C.useEffect(()=>{if(x||!n)return;const p=n.split(`
261
+ `).map(w=>w.trim()).filter(w=>w);if(p.length===0)return;const f=p[0].split("|").map(w=>w.trim()),j=f.length;let v=Array(j).fill("skip");if(o&&Wa[o]){const z=Wa[o].split("|").map(T=>T.trim().toLowerCase());f.forEach((T,D)=>{const L=z[D];if(!L){v[D]="skip";return}L==="backup code"||L==="backup_codes"||L==="backup_code"||L.includes("backup")?v[D]="backup_code":L==="pass mail"||L==="pass_mail"||L==="pass email"||L==="pass_email"?v[D]="pass_mail":L.includes("email")||L==="mail"?v[D]="email":L.includes("pass")||L==="pwd"?L.includes("khôi phục")||L.includes("recovery")||L.includes("kp")?v[D]="mail_kp":v[D]="password":L==="2fa"||L==="otp"||L==="totp"?v[D]="totp_secret":L==="uid"?v[D]="uid":L.includes("username")||L==="user"?v[D]="username":L==="sđt"||L==="sdt"||L.includes("phone")?v[D]="phone":L.includes("khôi phục")||L.includes("recovery")||L.includes("mail kp")||L.includes("mailkp")?v[D]="mail_kp":L==="cookie"?v[D]="cookie":L==="token"?v[D]="token":v[D]="skip"})}else f.forEach((w,z)=>{const T=w.toLowerCase();if(T.includes("@")&&!T.includes("khôi phục")&&!T.includes("recovery")&&!T.includes("kp"))v[z]="email";else if(z===1&&f[0]&&f[0].includes("@"))v[z]="password";else if(w.length>=16&&/^[A-Z2-7=]+$/i.test(w))v[z]="totp_secret";else if(T.includes("gmail.com")||T.includes("outlook.com")||T.includes("yahoo.com")){const D=f.slice(0,z).some(L=>L.includes("@"));v[z]=D?"mail_kp":"email"}else/^\d{9,11}$/.test(w)?v[z]="phone":/^\d{15,}$/.test(w)&&(v[z]="uid")});d(v)},[n,o,x]);const m=C.useMemo(()=>{const p=n.split(`
262
+ `).map(u=>u.trim()).filter(u=>u);return p.length?p[0].split("|").map(u=>u.trim()):[]},[n]);if(!e)return null;const N=()=>{if(c.length===0){alert("Vui lòng nhập/dán chuỗi dữ liệu thô vào khung bên dưới.");return}const p=c.map(u=>u==="email"?"email":u==="password"?"pass":u==="totp_secret"?"2fa":u==="username"?"username":u==="uid"?"uid":u==="mail_kp"?"mail kp":u==="phone"?"sđt":u==="cookie"?"cookie":u==="token"?"token":u==="backup_code"?"backup code":u==="pass_mail"?"pass mail":"skip").join("|");i(o||void 0,p)};return l.jsx("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:100},children:l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"900px",maxHeight:"90vh",overflowY:"auto",padding:"30px",display:"flex",flexDirection:"column",gap:"18px",background:"var(--bg-modal)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:"Dán nhanh chuỗi thô"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:l.jsx($n,{size:20})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsx("label",{style:{fontSize:"13px",fontWeight:500,color:"var(--text-secondary)"},children:"Nền tảng tài khoản"}),l.jsx(xd,{value:o,onChange:p=>a(p),options:[{value:"",label:"Tự động nhận diện / Cơ bản"},...s.map(p=>({value:p.id,label:p.name}))],placeholder:"Tự động nhận diện / Cơ bản"})]}),l.jsx("textarea",{className:"form-input",placeholder:"Dán chuỗi vào đây (định dạng các cột phân tách bằng dấu '|')...",value:n,onChange:p=>r(p.target.value),style:{resize:"vertical",fontFamily:"monospace",minHeight:"200px",width:"100%"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",background:"rgba(255, 255, 255, 0.02)",padding:"16px",borderRadius:"12px",border:"1px solid var(--border-color)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-accent)"},children:["Cấu hình các cột (",c.length," cột):"]}),l.jsxs("button",{type:"button",onClick:S,className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px",fontWeight:600,display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(To,{size:16})," Thêm cột"]})]}),c.length===0?l.jsx("p",{style:{fontSize:"13px",color:"var(--text-muted)",textAlign:"center"},children:'Chưa có cột nào được cấu hình. Sử dụng nút "+ Thêm cột" để thêm.'}):l.jsx("div",{style:{display:"flex",flexDirection:"row",flexWrap:"nowrap",gap:"12px",overflowX:"auto",padding:"8px 4px 12px 4px",width:"100%",scrollbarWidth:"thin"},children:c.map((p,u)=>{const f=m[u]||"";return l.jsx(vf,{index:u,mapping:p,exampleValue:f,mappingOptions:kf,onMappingChange:g,onRemove:k},u)})})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",justifyContent:"flex-end",marginTop:"10px"},children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:t,children:"Hủy"}),l.jsx("button",{type:"button",className:"btn btn-primary",onClick:N,children:"Phân tích & Nhập"})]})]})})},wf=({isOpen:e,onClose:t,onImport:n,onExport:r})=>(C.useEffect(()=>{const i=s=>{s.key==="Escape"&&t()};return e&&window.addEventListener("keydown",i),()=>{window.removeEventListener("keydown",i)}},[e,t]),e?l.jsxs("div",{style:{position:"fixed",top:0,left:0,right:0,bottom:0,background:"var(--modal-backdrop)",backdropFilter:"blur(8px)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:150},children:[l.jsx("div",{onClick:t,style:{position:"absolute",top:0,left:0,right:0,bottom:0,zIndex:-1}}),l.jsxs("div",{className:"glass-panel animate-fade-in",style:{width:"100%",maxWidth:"500px",padding:"24px",background:"var(--bg-modal)",display:"flex",flexDirection:"column",gap:"20px",boxShadow:"0 20px 25px -5px rgba(0, 0, 0, 0.4)"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("h3",{style:{fontSize:"16px",fontWeight:600,color:"var(--text-primary)"},children:"Nhập / Xuất dữ liệu"}),l.jsx("button",{type:"button",onClick:t,style:{background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer",display:"flex",alignItems:"center"},title:"Đóng",children:l.jsx($n,{size:18})})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Nhập dữ liệu vào Vault"}),l.jsxs("label",{className:"btn btn-secondary",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:"10px",padding:"24px 16px",borderRadius:"8px",cursor:"pointer",border:"2px dashed var(--border-color)",background:"rgba(255, 255, 255, 0.01)",transition:"var(--transition-smooth)"},children:[l.jsx(cf,{size:24,style:{color:"var(--text-accent)"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"4px"},children:[l.jsx("span",{style:{fontSize:"13px",fontWeight:600,color:"var(--text-primary)"},children:"Chọn tệp tin để nhập..."}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Hỗ trợ tệp tin .TXT, .CSV, .JSON"})]}),l.jsx("input",{type:"file",accept:".csv,.json,.txt",onChange:i=>{n(i),t()},style:{display:"none"}})]})]}),l.jsx("hr",{style:{border:"none",borderTop:"1px solid var(--border-color)",margin:"4px 0"}}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Xuất dữ liệu mã hóa"}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"10px"},children:[l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{r("json"),t()},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"16px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"12px"},children:[l.jsx(Bn,{size:18,style:{color:"var(--text-emerald)"}}),l.jsx("span",{style:{fontWeight:600},children:"Xuất JSON"})]}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>{r("csv"),t()},style:{display:"flex",flexDirection:"column",alignItems:"center",gap:"8px",padding:"16px 12px",borderRadius:"8px",cursor:"pointer",fontSize:"12px"},title:"Xuất định dạng email|pass|2FA|Mail KP|SĐT",children:[l.jsx(Bn,{size:18,style:{color:"var(--text-accent)"}}),l.jsx("span",{style:{fontWeight:600},children:"Xuất TXT (Gmail)"})]})]})]})]})]}):null),Sf=({currentPassword:e,setCurrentPassword:t,newPassword:n,setNewPassword:r,confirmNewPassword:i,setConfirmNewPassword:s,newHint:o,setNewHint:a,passwordError:c,passwordSuccess:d,isChangingPassword:x,onSubmit:y})=>l.jsxs("div",{className:"glass-panel",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"20px"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600,marginBottom:"6px"},children:"Đổi Mật khẩu Master"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Mật khẩu Master được sử dụng để mã hóa dữ liệu trong Vault. Việc thay đổi sẽ tự động giải mã và mã hóa lại tất cả tài khoản bằng khóa mới."})]}),l.jsxs("form",{onSubmit:y,style:{display:"flex",flexDirection:"column",gap:"16px"},children:[c&&l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px",fontWeight:500},children:c}),d&&l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(56, 239, 125, 0.1)",border:"1px solid rgba(56, 239, 125, 0.2)",color:"var(--text-emerald)",fontSize:"13px",fontWeight:500},children:d}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Mật khẩu Master hiện tại *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:e,onChange:g=>t(g.target.value),placeholder:"Nhập mật khẩu hiện tại..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Mật khẩu Master mới *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:n,onChange:g=>r(g.target.value),placeholder:"Ít nhất 8 ký tự..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Xác nhận mật khẩu Master mới *"}),l.jsx("input",{type:"password",className:"form-input",required:!0,value:i,onChange:g=>s(g.target.value),placeholder:"Nhập lại mật khẩu mới..."})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",children:"Gợi ý mật khẩu (Hint) - Không bắt buộc"}),l.jsx("input",{type:"text",className:"form-input",value:o,onChange:g=>a(g.target.value),placeholder:"Gợi ý giúp bạn nhớ lại mật khẩu..."})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",disabled:x,style:{marginTop:"8px",alignSelf:"flex-start"},children:x?"Đang xử lý...":"Cập nhật mật khẩu Master"})]})]}),Cf=({vaultInfo:e,isLoadingVaultInfo:t,vaultInfoError:n})=>l.jsxs("div",{className:"glass-panel",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"24px"},children:[l.jsxs("div",{children:[l.jsx("h3",{style:{fontSize:"18px",fontWeight:600,marginBottom:"6px"},children:"Thông số hệ thống & Lưu trữ"}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Thông tin chi tiết về cơ sở dữ liệu mã hóa và thuật toán mật mã của Vault."})]}),t?l.jsx("p",{style:{fontSize:"14px",color:"var(--text-secondary)"},children:"Đang tải thông tin hệ thống..."}):n?l.jsx("div",{style:{padding:"12px 16px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px"},children:n}):e?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Đường dẫn file dữ liệu:"}),l.jsx("code",{style:{fontSize:"13px",background:"var(--bg-input)",padding:"6px 10px",borderRadius:"4px",wordBreak:"break-all",color:"var(--text-accent)"},children:e.path})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Số lượng tài khoản:"}),l.jsxs("span",{style:{fontSize:"14px",fontWeight:500},children:[e.credentialsCount," mục"]})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Số lượng danh mục:"}),l.jsxs("span",{style:{fontSize:"14px",fontWeight:500},children:[e.categoriesCount," mục"]})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Thuật toán mã hóa:"}),l.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:"AES-256-GCM (Authenticated Encryption)"})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"220px 1fr",gap:"12px",alignItems:"center",paddingBottom:"12px"},children:[l.jsx("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-secondary)"},children:"Hàm băm khóa (KDF):"}),l.jsx("span",{style:{fontSize:"14px",fontWeight:500},children:"PBKDF2 với HMAC-SHA256 (100.000 vòng lặp)"})]})]}):null]}),bf=({tailscaleStatus:e,isLoadingTailscale:t,tailscaleError:n,setTailscaleError:r,isSubmittingTailscale:i,isProvisioningCert:s,onInstall:o,onConnect:a,onDisconnect:c,onLogout:d,onProvisionCert:x})=>{const[y,g]=C.useState(""),[k,S]=C.useState(!0),[m,N]=C.useState(""),[p,u]=C.useState(!1),f=v=>{v.preventDefault(),a(y||void 0,k,m||void 0),g("")},j=()=>{a(void 0,k,void 0)};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(ud,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"Tailscale VPN Client"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Kết nối máy tính của bạn vào mạng lưới Tailnet riêng tư và bảo mật."}),t?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("div",{style:{width:"18px",height:"18px",border:"2px solid var(--text-accent)",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang truy vấn trạng thái..."})]}):e?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[n&&l.jsxs("div",{style:{padding:"10px 14px",borderRadius:"8px",background:"rgba(255, 75, 43, 0.1)",border:"1px solid rgba(255, 75, 43, 0.2)",color:"#ff4b2b",fontSize:"13px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsx("span",{children:n}),l.jsx("button",{type:"button",onClick:()=>r(null),style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer",fontWeight:"bold",fontSize:"14px"},children:"✕"})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"16px",background:"rgba(255,255,255,0.01)",display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[l.jsx("div",{style:{width:"10px",height:"10px",borderRadius:"50%",background:e.backendState==="Running"?"var(--text-emerald)":e.backendState==="Installing"?"var(--text-accent)":"var(--text-muted)",boxShadow:e.backendState==="Running"?"var(--glow-emerald)":e.backendState==="Installing"?"var(--glow-accent)":"none",animation:e.backendState==="Running"||e.backendState==="Installing"?"pulse-glow 2s infinite":"none"}}),l.jsxs("div",{children:[l.jsx("div",{style:{fontSize:"14px",fontWeight:600},children:e.backendState==="Running"?"Đã kết nối VPN":e.backendState==="NotInstalled"?"Chưa cài đặt Tailscale":e.backendState==="Installing"?"Đang cài đặt Tailscale...":"Đã ngắt kết nối"}),l.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:["Trạng thái: ",e.backendState]})]})]}),l.jsx("div",{style:{display:"flex",gap:"8px"},children:e.backendState==="Running"?l.jsxs(l.Fragment,{children:[l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:c,style:{padding:"6px 12px",fontSize:"13px"},children:"Ngắt kết nối"}),l.jsx("button",{type:"button",className:"btn btn-danger",onClick:d,style:{padding:"6px 12px",fontSize:"13px"},children:"Đăng xuất"})]}):e.backendState==="Installing"?l.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)",fontStyle:"italic"},children:"Đang tải và giải nén..."}):e.backendState==="NotInstalled"?l.jsx("button",{type:"button",className:"btn btn-primary",onClick:o,style:{padding:"6px 12px",fontSize:"13px"},children:"Tự động cài đặt (MSI)"}):l.jsx("button",{type:"button",className:"btn btn-emerald",style:{padding:"6px 12px",fontSize:"13px"},onClick:j,disabled:i,children:i?"Đang kết nối...":"Kết nối nhanh"})})]}),e.backendState==="Installing"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"10px",background:"rgba(255,255,255,0.02)",padding:"16px",borderRadius:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"13px"},children:[l.jsx("span",{style:{fontWeight:600,color:"var(--text-accent)"},children:e.installStatus||"Đang cài đặt..."}),l.jsxs("span",{children:[e.installProgress||0,"%"]})]}),l.jsx("div",{style:{width:"100%",height:"8px",background:"var(--bg-input)",borderRadius:"4px",overflow:"hidden"},children:l.jsx("div",{style:{width:`${e.installProgress||0}%`,height:"100%",background:"var(--text-accent)",transition:"width 0.3s ease"}})})]}),e.backendState==="NotInstalled"&&l.jsxs("div",{style:{padding:"16px",borderRadius:"8px",background:"rgba(217, 119, 6, 0.05)",border:"1px solid rgba(217, 119, 6, 0.15)",fontSize:"13px",lineHeight:"1.6"},children:[l.jsx("p",{style:{fontWeight:600,color:"var(--text-accent)",marginBottom:"8px"},children:"Chưa cài đặt Tailscale CLI trên thiết bị của bạn."}),l.jsxs("div",{style:{display:"flex",gap:"12px",marginBottom:"16px"},children:[l.jsx("button",{type:"button",className:"btn btn-primary",onClick:o,style:{padding:"8px 16px",fontSize:"13px"},children:"Tự động cài đặt ngầm (Windows)"}),l.jsx("a",{href:"https://tailscale.com/download/windows",target:"_blank",rel:"noreferrer",className:"btn btn-secondary",style:{padding:"8px 16px",fontSize:"13px",textDecoration:"none",display:"inline-flex",alignItems:"center"},children:"Tải thủ công từ trang chủ"})]}),l.jsxs("details",{style:{cursor:"pointer"},children:[l.jsx("summary",{style:{fontWeight:600,color:"var(--text-secondary)",fontSize:"12px"},children:"Hướng dẫn cấu hình thủ công"}),l.jsxs("ol",{style:{paddingLeft:"20px",display:"flex",flexDirection:"column",gap:"6px",marginTop:"8px",fontSize:"12px"},children:[l.jsx("li",{children:"Cài đặt ứng dụng Tailscale và đăng nhập vào tài khoản của bạn."}),l.jsxs("li",{children:["Sau khi cài đặt xong, bấm nút ",l.jsx("strong",{children:"Kiểm tra lại"})," phía trên để nhận diện CLI."]})]})]})]}),e.backendState==="Running"&&l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"12px",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Tên thiết bị:"})," ",l.jsx("strong",{children:e.deviceName})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Mạng Tailnet:"})," ",l.jsx("strong",{children:e.tailnet})]}),l.jsxs("div",{children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"Peers hoạt động:"})," ",l.jsxs("strong",{children:[e.peersCount," thiết bị"]})]})]}),l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"6px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"IPv4:"}),l.jsx("code",{style:{background:"var(--bg-input)",padding:"2px 6px",borderRadius:"4px",color:"var(--text-accent)"},children:e.ip4})]}),e.ip6&&l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{color:"var(--text-secondary)"},children:"IPv6:"}),l.jsx("code",{style:{background:"var(--bg-input)",padding:"2px 6px",borderRadius:"4px",color:"var(--text-accent)",fontSize:"11px",wordBreak:"break-all"},children:e.ip6})]})]})]}),l.jsxs("div",{style:{borderTop:"1px solid rgba(255,255,255,0.05)",paddingTop:"12px",display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"2px"},children:[l.jsx("span",{style:{fontSize:"12px",fontWeight:600,color:"var(--text-secondary)"},children:"Chứng chỉ HTTPS (TLS)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:e.hasCert?`✓ Đã cấp TLS cho domain: ${e.certDomain}`:"Chưa cấp SSL/TLS cho tên miền Tailscale của thiết bị này."})]}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px"},onClick:x,disabled:s,children:s?"Đang xử lý...":e.hasCert?"Cập nhật Cert":"Cấp SSL Cert"})]})]}),e.backendState!=="Running"&&e.backendState!=="NotInstalled"&&l.jsxs("form",{onSubmit:f,style:{display:"flex",flexDirection:"column",gap:"12px",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px"},children:[l.jsx("h4",{style:{fontSize:"13px",fontWeight:600,borderBottom:"1px solid var(--border-color)",paddingBottom:"6px"},children:"Cấu hình kết nối VPN nâng cao"}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Auth Key (Đăng nhập tự động)"}),l.jsxs("div",{style:{position:"relative"},children:[l.jsx("input",{type:p?"text":"password",className:"form-input",placeholder:"tskey-auth-...",value:y,onChange:v=>g(v.target.value),style:{paddingRight:"40px",fontSize:"13px"}}),l.jsx("button",{type:"button",onClick:()=>u(!p),style:{position:"absolute",right:"10px",top:"50%",transform:"translateY(-50%)",background:"none",border:"none",color:"var(--text-secondary)",cursor:"pointer"},children:p?l.jsx(_n,{size:14}):l.jsx(Ln,{size:14})})]})]}),l.jsxs("div",{className:"form-group",style:{marginBottom:0},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Exit Node (IP hoặc tên thiết bị định tuyến)"}),l.jsx("input",{type:"text",className:"form-input",placeholder:"Ví dụ: 100.123.45.67",value:m,onChange:v=>N(v.target.value),style:{fontSize:"13px"}})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",marginTop:"4px"},children:[l.jsx("input",{type:"checkbox",id:"acceptDns",checked:k,onChange:v=>S(v.target.checked),style:{cursor:"pointer",width:"14px",height:"14px"}}),l.jsx("label",{htmlFor:"acceptDns",style:{fontSize:"12px",cursor:"pointer",userSelect:"none"},children:"Chấp nhận DNS cấu hình từ mạng Tailnet"})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{alignSelf:"flex-start",padding:"6px 16px",fontSize:"13px"},disabled:i,children:i?"Đang kết nối...":"Kết nối với cấu hình"})]})]}):null]})},zf=({tailscaleStatus:e,funnelStatus:t,isLoadingFunnel:n,isTogglingServe:r,isTogglingFunnel:i,onToggleServe:s,onToggleFunnel:o})=>{const a=(e==null?void 0:e.backendState)==="Running",c=(d,x)=>{navigator.clipboard.writeText(d),alert(x)};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(zo,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"API Endpoints & Public Tunnels"})]}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Expose ứng dụng của bạn ra mạng nội bộ Tailscale hoặc internet công cộng bằng HTTPS Tunnel bảo mật."}),n?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px"},children:[l.jsx("div",{style:{width:"18px",height:"18px",border:"2px solid var(--text-accent)",borderTopColor:"transparent",borderRadius:"50%",animation:"spin 1s linear infinite"}}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang tải trạng thái đường truyền..."})]}):t?l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"var(--bg-active-tab)",color:"var(--text-accent)",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Local"}),l.jsx("code",{children:"http://localhost:18823"})]}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c("http://localhost:18823","Đã copy Local URL!"),children:"Copy"})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"rgba(56, 239, 125, 0.1)",color:"var(--text-emerald)",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Tailscale"}),a?t.serveActive&&t.serveUrl?l.jsx("a",{href:t.serveUrl,target:"_blank",rel:"noreferrer",style:{color:"var(--text-accent)",textDecoration:"none",fontWeight:500},children:t.serveUrl}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Chưa kích hoạt HTTPS nội bộ"}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Yêu cầu kết nối VPN"})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Cho phép truy cập HTTPS từ xa cho các máy trong mạng Tailscale."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a&&t.serveActive&&l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c(t.serveUrl||"","Đã copy Tailscale HTTPS URL!"),children:"Copy"}),l.jsx("button",{type:"button",disabled:!a||r,onClick:()=>s(!t.serveActive),style:{width:"42px",height:"22px",borderRadius:"11px",background:a&&t.serveActive?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:a?"pointer":"not-allowed",opacity:a?r?.6:1:.4,transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:a&&t.serveActive?"23px":"3px",transition:"var(--transition-smooth)"}})})]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",background:"rgba(0,0,0,0.1)",padding:"12px 16px",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px",flexGrow:1},children:[l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("span",{style:{fontSize:"11px",background:"rgba(255, 65, 108, 0.1)",color:"#ff416c",padding:"2px 6px",borderRadius:"4px",fontWeight:600},children:"Tunnel"}),a?t.funnelActive&&t.funnelUrl?l.jsx("a",{href:t.funnelUrl,target:"_blank",rel:"noreferrer",style:{color:"var(--text-accent)",textDecoration:"none",fontWeight:500},children:t.funnelUrl}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Chưa kích hoạt Tunnel công cộng"}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"Yêu cầu kết nối VPN"})]}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Expose ứng dụng ra internet công cộng an toàn (mọi thiết bị đều vào được)."})]}),l.jsxs("div",{style:{display:"flex",gap:"8px",alignItems:"center"},children:[a&&t.funnelActive&&l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"4px 8px",fontSize:"12px"},onClick:()=>c(t.funnelUrl||"","Đã copy Public Tunnel URL!"),children:"Copy"}),l.jsx("button",{type:"button",disabled:!a||i,onClick:()=>o(!t.funnelActive),style:{width:"42px",height:"22px",borderRadius:"11px",background:a&&t.funnelActive?"#ff416c":"var(--text-muted)",position:"relative",border:"none",cursor:a?"pointer":"not-allowed",opacity:a?i?.6:1:.4,transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"16px",height:"16px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:a&&t.funnelActive?"23px":"3px",transition:"var(--transition-smooth)"}})})]})]}),l.jsx("div",{style:{marginTop:"8px",padding:"12px 16px",borderRadius:"8px",background:"rgba(242, 139, 42, 0.03)",border:"1px solid rgba(242, 139, 42, 0.15)",fontSize:"12px",lineHeight:"1.6"},children:l.jsxs("details",{style:{cursor:"pointer"},children:[l.jsx("summary",{style:{fontWeight:600,color:"#f28b2a",display:"flex",alignItems:"center",gap:"6px"},children:"💡 Hướng dẫn cấu hình Cloudflare Tunnel (Không cần VPN/Tailscale)"}),l.jsxs("div",{style:{marginTop:"8px",display:"flex",flexDirection:"column",gap:"8px",color:"var(--text-secondary)"},children:[l.jsxs("p",{style:{margin:0},children:["Nếu bạn muốn truy cập ứng dụng công khai bằng tên miền riêng qua ",l.jsx("strong",{children:"Cloudflare Tunnel"})," để thay thế Tailscale (không sợ xung đột cổng và không cần cài VPN trên thiết bị khách):"]}),l.jsxs("ol",{style:{paddingLeft:"16px",margin:0,display:"flex",flexDirection:"column",gap:"4px"},children:[l.jsxs("li",{children:["Tải ",l.jsx("code",{children:"cloudflared.exe"})," và chạy ",l.jsx("code",{children:"cloudflared.exe tunnel login"})," để liên kết tên miền."]}),l.jsxs("li",{children:["Tạo tunnel và viết cấu hình ",l.jsx("code",{children:"config.yml"})," chuyển tiếp cổng ",l.jsx("code",{children:"18823"})," (HTTP)."]}),l.jsxs("li",{children:["Chạy ",l.jsx("code",{children:"cloudflared.exe service install"})," để tự khởi động chạy ngầm cùng Windows."]})]}),l.jsxs("p",{style:{margin:0,fontSize:"11px",fontStyle:"italic",color:"var(--text-muted)"},children:["Xem hướng dẫn cấu hình chi tiết tại tệp tin: ",l.jsx("code",{style:{color:"var(--text-accent)"},children:"docs/huong-dan-cloudflare-tunnel.md"})," trong thư mục mã nguồn."]})]})]})})]}):null]})},Tf=({apiKeys:e,isLoadingKeys:t,isCreatingKey:n,generatedKey:r,setGeneratedKey:i,onToggleKey:s,onDeleteKey:o,onCreateKey:a})=>{const[c,d]=C.useState(""),x=g=>{g.preventDefault(),c.trim()&&(a(c.trim()),d(""))},y=g=>{navigator.clipboard.writeText(g),alert("Đã copy API Key!")};return l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"24px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(id,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"16px",fontWeight:600},children:"Quản lý API Keys"})]})}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Tạo mã khóa API (`pmkey_...`) để xác thực các ứng dụng bên thứ ba (như Chrome Extension) gọi đến API của Profile Manager."}),l.jsxs("form",{onSubmit:x,style:{display:"flex",gap:"10px",alignItems:"flex-end",background:"rgba(0,0,0,0.1)",padding:"16px",borderRadius:"8px"},children:[l.jsxs("div",{className:"form-group",style:{marginBottom:0,flexGrow:1},children:[l.jsx("label",{className:"form-label",style:{fontSize:"12px"},children:"Tên khóa gợi nhớ (Ví dụ: Extension Laptop, Script Python...)"}),l.jsx("input",{type:"text",className:"form-input",required:!0,placeholder:"Nhập tên thiết bị/ứng dụng sẽ dùng key...",value:c,onChange:g=>d(g.target.value),style:{fontSize:"13px"}})]}),l.jsx("button",{type:"submit",className:"btn btn-primary",style:{padding:"10px 20px",fontSize:"13px"},disabled:n,children:n?"Đang tạo...":"+ Tạo Key"})]}),r&&l.jsxs("div",{style:{padding:"16px",borderRadius:"8px",background:"rgba(56, 239, 125, 0.08)",border:"1px solid rgba(56, 239, 125, 0.2)",fontSize:"13px",display:"flex",flexDirection:"column",gap:"8px"},children:[l.jsx("div",{style:{fontWeight:600,color:"var(--text-emerald)"},children:"✓ Đã tạo API Key thành công!"}),l.jsx("p",{style:{fontSize:"12px",color:"var(--text-secondary)"},children:"Mã khóa này chỉ hiển thị **DUY NHẤT MỘT LẦN**. Hãy lưu lại một cách an toàn:"}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"10px",marginTop:"4px"},children:[l.jsx("code",{style:{fontSize:"14px",background:"var(--bg-input)",padding:"6px 12px",borderRadius:"4px",color:"var(--text-emerald)",fontWeight:"bold",flexGrow:1,letterSpacing:"0.5px"},children:r}),l.jsx("button",{type:"button",className:"btn btn-emerald",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>y(r),children:"Copy Key"}),l.jsx("button",{type:"button",className:"btn btn-secondary",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>i(null),children:"Tôi đã lưu"})]})]}),t?l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)"},children:"Đang tải danh sách keys..."}):e.length===0?l.jsx("div",{style:{padding:"20px",textAlign:"center",border:"1px dashed var(--border-color)",borderRadius:"8px",color:"var(--text-muted)",fontSize:"13px"},children:"Chưa có API Key nào được tạo."}):l.jsx("div",{style:{display:"flex",flexDirection:"column",gap:"10px"},children:e.map(g=>l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"12px 16px",background:"rgba(0,0,0,0.1)",borderRadius:"8px",fontSize:"13px"},children:[l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"4px"},children:[l.jsx("div",{style:{fontWeight:600},children:g.name}),l.jsxs("div",{style:{fontSize:"11px",color:"var(--text-muted)"},children:["Prefix: ",l.jsxs("code",{children:[g.keyPrefix,"••••••••"]})," • Ngày tạo: ",new Date(g.createdAt).toLocaleDateString("vi-VN")]})]}),l.jsxs("div",{style:{display:"flex",gap:"12px",alignItems:"center"},children:[l.jsx("button",{type:"button",onClick:()=>s(g.id,g.enabled),style:{width:"38px",height:"20px",borderRadius:"10px",background:g.enabled?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:"pointer",transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:g.enabled?"21px":"3px",transition:"var(--transition-smooth)"}})}),l.jsx("button",{type:"button",className:"btn btn-danger",style:{padding:"6px 12px",fontSize:"12px"},onClick:()=>o(g.id),children:"Xóa"})]})]},g.id))})]})},Pf=({platforms:e,onTogglePlatform:t,onDeletePlatform:n})=>l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"30px",display:"flex",flexDirection:"column",gap:"20px",width:"100%"},children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(nf,{size:20,style:{color:"var(--text-accent)"}}),l.jsx("h3",{style:{fontSize:"18px",fontWeight:600},children:"Quản lý Nền tảng (Platforms)"})]})}),l.jsx("p",{style:{fontSize:"13px",color:"var(--text-secondary)",marginTop:"-8px"},children:"Kích hoạt các nền tảng mong muốn xuất hiện trên thanh bên."}),l.jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(220px, 1fr))",gap:"16px"},children:e.map(r=>l.jsxs("div",{className:"glass-panel",style:{padding:"16px",display:"flex",flexDirection:"column",justifyContent:"space-between",gap:"12px",background:"var(--bg-card)",border:"1px solid var(--border-color)",borderRadius:"12px",transition:"var(--transition-smooth)"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",justifyContent:"space-between"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px"},children:[l.jsx(oi,{name:r.icon,size:20}),l.jsx("span",{style:{fontWeight:600,fontSize:"14px"},children:r.name})]}),r.is_custom&&l.jsx("button",{type:"button",style:{background:"none",border:"none",color:"#ff4b2b",cursor:"pointer",padding:"2px"},onClick:()=>n(r.id),title:"Xóa nền tảng",children:l.jsx(un,{size:14})})]}),l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderTop:"1px solid var(--border-color)",paddingTop:"10px"},children:[l.jsx("span",{style:{fontSize:"11px",color:"var(--text-secondary)"},children:r.is_custom?"Tùy chỉnh":"Mặc định"}),l.jsx("button",{type:"button",onClick:()=>t(r.id,r.is_active),style:{width:"38px",height:"20px",borderRadius:"10px",background:r.is_active?"var(--text-accent)":"var(--text-muted)",position:"relative",border:"none",cursor:"pointer",transition:"var(--transition-smooth)"},children:l.jsx("div",{style:{width:"14px",height:"14px",borderRadius:"50%",background:"#fff",position:"absolute",top:"3px",left:r.is_active?"21px":"3px",transition:"var(--transition-smooth)"}})})]})]},r.id))})]}),Ef=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState(null),[r,i]=C.useState(!1),[s,o]=C.useState(null),[a,c]=C.useState(!1),[d,x]=C.useState(!1),[y,g]=C.useState(null),[k,S]=C.useState(!1),[m,N]=C.useState(!1),[p,u]=C.useState(!1),f=async()=>{i(!0),o(null);try{const U=await e("/api/tailscale/status");if(U.ok){const P=await U.json();n(P)}else{const P=await U.json();o(P.error||"Không thể lấy trạng thái Tailscale")}}catch(U){console.error("Failed to fetch Tailscale status:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}},j=async()=>{o(null);try{const U=await e("/api/tailscale/install",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Yêu cầu cài đặt tự động thất bại")}}catch(U){console.error("Failed to trigger install:",U),o("Lỗi kết nối máy chủ")}},v=async()=>{x(!0),o(null);try{const U=await e("/api/tailscale/provision-cert",{method:"POST"}),P=await U.json();U.ok&&P.success?(alert(P.message),f()):o(P.error||P.message||"Lỗi cấp chứng chỉ")}catch(U){console.error("Failed to provision cert:",U),o("Lỗi kết nối máy chủ")}finally{x(!1)}},w=async(U,P=!0,X)=>{o(null),c(!0);try{const re=await e("/api/tailscale/connect",{method:"POST",body:JSON.stringify({authKey:U,acceptDns:P,exitNode:X})}),A=await re.json();re.ok?f():o(A.error||"Kết nối Tailscale thất bại")}catch(re){console.error("Failed to connect Tailscale:",re),o("Lỗi kết nối máy chủ")}finally{c(!1)}},z=async()=>{if(confirm("Bạn có chắc chắn muốn ngắt kết nối Tailscale không?")){o(null),i(!0);try{const U=await e("/api/tailscale/disconnect",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Ngắt kết nối thất bại")}}catch(U){console.error("Failed to disconnect Tailscale:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}}},T=async()=>{if(confirm("Bạn có chắc chắn muốn đăng xuất tài khoản Tailscale khỏi thiết bị này không?")){o(null),i(!0);try{const U=await e("/api/tailscale/logout",{method:"POST"});if(U.ok)f();else{const P=await U.json();o(P.error||"Đăng xuất thất bại")}}catch(U){console.error("Failed to logout Tailscale:",U),o("Lỗi kết nối máy chủ")}finally{i(!1)}}},D=async()=>{S(!0);try{const U=await e("/api/tailscale/funnel-status");if(U.ok){const P=await U.json();g(P)}}catch(U){console.error("Failed to fetch funnel status:",U)}finally{S(!1)}},L=async U=>{N(!0),o(null);try{const P=await e("/api/tailscale/funnel/toggle",{method:"POST",body:JSON.stringify({active:U})});if(P.ok)D();else{const X=await P.json();o(X.error||"Failed to toggle funnel")}}catch(P){console.error("Failed to toggle funnel:",P),o("Lỗi kết nối máy chủ")}finally{N(!1)}},Z=async U=>{u(!0),o(null);try{const P=await e("/api/tailscale/serve/toggle",{method:"POST",body:JSON.stringify({active:U})});if(P.ok)D();else{const X=await P.json();o(X.error||"Failed to toggle serve")}}catch(P){console.error("Failed to toggle serve:",P),o("Lỗi kết nối máy chủ")}finally{u(!1)}};return C.useEffect(()=>{let U;return(t==null?void 0:t.backendState)==="Installing"&&(U=setInterval(()=>{f()},1500)),()=>clearInterval(U)},[t==null?void 0:t.backendState]),C.useEffect(()=>{f(),D()},[]),{tailscaleStatus:t,isLoadingTailscale:r,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:d,funnelStatus:y,isLoadingFunnel:k,isTogglingFunnel:m,isTogglingServe:p,fetchTailscaleStatus:f,handleInstallTailscale:j,handleProvisionCert:v,handleTailscaleConnect:w,handleTailscaleDisconnect:z,handleTailscaleLogout:T,fetchFunnelStatus:D,handleToggleFunnel:L,handleToggleServe:Z}},Nf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState(!1),[s,o]=C.useState(!1),[a,c]=C.useState(null),[d,x]=C.useState(null),y=async()=>{i(!0);try{const m=await e("/api/auth/api-keys");if(m.ok){const N=await m.json();n(N)}}catch(m){console.error("Failed to fetch API keys:",m)}finally{i(!1)}},g=async m=>{o(!0),x(null);try{const N=await e("/api/auth/api-keys",{method:"POST",body:JSON.stringify({name:m})}),p=await N.json();N.ok&&p.success?(c(p.key),y()):x(p.error||"Failed to create API key")}catch(N){console.error("Failed to create API key:",N),x("Lỗi kết nối máy chủ")}finally{o(!1)}},k=async(m,N)=>{try{(await e(`/api/auth/api-keys/${m}/toggle`,{method:"POST",body:JSON.stringify({enabled:!N})})).ok&&y()}catch(p){console.error("Failed to toggle API key:",p)}},S=async m=>{if(confirm("Bạn có chắc chắn muốn xóa API Key này không? Kết nối từ Chrome Extension của thiết bị tương ứng sẽ bị ngắt hoàn toàn."))try{(await e(`/api/auth/api-keys/${m}`,{method:"DELETE"})).ok&&y()}catch(N){console.error("Failed to delete API key:",N)}};return C.useEffect(()=>{y()},[]),{apiKeys:t,isLoadingKeys:r,isCreatingKey:s,generatedKey:a,setGeneratedKey:c,apiKeyError:d,setApiKeyError:x,fetchApiKeys:y,handleCreateApiKey:g,handleToggleApiKey:k,handleDeleteApiKey:S}},If=()=>{const{fetchWithAuth:e,updateSessionToken:t}=St(),[n,r]=C.useState(""),[i,s]=C.useState(""),[o,a]=C.useState(""),[c,d]=C.useState(""),[x,y]=C.useState(null),[g,k]=C.useState(null),[S,m]=C.useState(!1),[N,p]=C.useState(null),[u,f]=C.useState(!1),[j,v]=C.useState(null),w=async()=>{f(!0),v(null);try{const T=await e("/api/auth/vault-info"),D=T.headers.get("content-type");if(!D||!D.includes("application/json")){v("API không tồn tại hoặc Server chưa được khởi động lại");return}if(T.ok){const L=await T.json();p(L)}else{const L=await T.json();v(L.error||"Không thể tải thông tin Vault")}}catch(T){console.error("Failed to fetch vault info:",T),v("Lỗi kết nối máy chủ")}finally{f(!1)}},z=async T=>{if(T.preventDefault(),y(null),k(null),i.length<8){y("Mật khẩu mới phải từ 8 ký tự trở lên");return}if(i!==o){y("Mật khẩu xác nhận không khớp");return}m(!0);try{const D=await e("/api/auth/change-password",{method:"POST",body:JSON.stringify({currentPassword:n,newPassword:i,hint:c||void 0})}),L=D.headers.get("content-type");if(!L||!L.includes("application/json")){y("API không tồn tại hoặc Server chưa được khởi động lại");return}const Z=await D.json();D.ok&&Z.success?(k("Đổi mật khẩu Master thành công!"),t(Z.token),r(""),s(""),a(""),d("")):y(Z.error||"Có lỗi xảy ra khi đổi mật khẩu")}catch(D){console.error("Failed to change password:",D),y("Lỗi kết nối máy chủ")}finally{m(!1)}};return C.useEffect(()=>{w()},[]),{currentPassword:n,setCurrentPassword:r,newPassword:i,setNewPassword:s,confirmNewPassword:o,setConfirmNewPassword:a,newHint:c,setNewHint:d,passwordError:x,passwordSuccess:g,isChangingPassword:S,vaultInfo:N,isLoadingVaultInfo:u,vaultInfoError:j,fetchVaultInfo:w,handleChangePassword:z}},_f=({platforms:e,onTogglePlatform:t,onDeletePlatform:n})=>{const{tailscaleStatus:r,isLoadingTailscale:i,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:c,funnelStatus:d,isLoadingFunnel:x,isTogglingFunnel:y,isTogglingServe:g,handleInstallTailscale:k,handleProvisionCert:S,handleTailscaleConnect:m,handleTailscaleDisconnect:N,handleTailscaleLogout:p,handleToggleFunnel:u,handleToggleServe:f}=Ef(),{apiKeys:j,isLoadingKeys:v,isCreatingKey:w,generatedKey:z,setGeneratedKey:T,handleCreateApiKey:D,handleToggleApiKey:L,handleDeleteApiKey:Z}=Nf(),{currentPassword:U,setCurrentPassword:P,newPassword:X,setNewPassword:re,confirmNewPassword:A,setConfirmNewPassword:W,newHint:b,setNewHint:M,passwordError:F,passwordSuccess:H,isChangingPassword:K,vaultInfo:h,isLoadingVaultInfo:E,vaultInfoError:V,handleChangePassword:$}=If();return l.jsxs("main",{style:{display:"flex",flexDirection:"column",gap:"24px"},className:"animate-fade-in",children:[l.jsx("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",borderBottom:"1px solid var(--border-color)",paddingBottom:"12px"},children:l.jsx("h2",{style:{fontSize:"18px",fontWeight:600},children:"Cài đặt hệ thống"})}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"repeat(2, 1fr)",gap:"24px",width:"100%"},children:[l.jsx(Sf,{currentPassword:U,setCurrentPassword:P,newPassword:X,setNewPassword:re,confirmNewPassword:A,setConfirmNewPassword:W,newHint:b,setNewHint:M,passwordError:F,passwordSuccess:H,isChangingPassword:K,onSubmit:$}),l.jsx(Cf,{vaultInfo:h,isLoadingVaultInfo:E,vaultInfoError:V}),l.jsx(bf,{tailscaleStatus:r,isLoadingTailscale:i,tailscaleError:s,setTailscaleError:o,isSubmittingTailscale:a,isProvisioningCert:c,onInstall:k,onConnect:m,onDisconnect:N,onLogout:p,onProvisionCert:S}),l.jsx(zf,{tailscaleStatus:r,funnelStatus:d,isLoadingFunnel:x,isTogglingServe:g,isTogglingFunnel:y,onToggleServe:f,onToggleFunnel:u}),l.jsx(Tf,{apiKeys:j,isLoadingKeys:v,isCreatingKey:w,generatedKey:z,setGeneratedKey:T,onToggleKey:L,onDeleteKey:Z,onCreateKey:D})]}),l.jsx(Pf,{platforms:e,onTogglePlatform:t,onDeletePlatform:n})]})};function Lf(e){if(!e||e.length!==2)return"";const t=e.toUpperCase().split("").map(n=>127397+n.charCodeAt(0));return String.fromCodePoint(...t)}const Mf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState(""),[r,i]=C.useState(5e3),[s,o]=C.useState(10),[a,c]=C.useState([]),[d,x]=C.useState(!1),[y,g]=C.useState({current:0,total:0}),k=C.useRef(!1),[S,m]=C.useState(""),[N,p]=C.useState("all"),u=async()=>{if(!t.trim())return;const P=t.split(`
263
+ `).map(A=>A.trim()).filter(A=>A.length>0);if(P.length===0)return;x(!0),k.current=!1,g({current:0,total:P.length}),c([]);const X=s,re=[];for(let A=0;A<P.length&&!k.current;A+=X){const W=P.slice(A,A+X);try{const b=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:W,timeout:r,concurrency:X})});if(b.ok){const M=await b.json();M.success&&Array.isArray(M.results)&&(re.push(...M.results),c([...re]))}else{const M=W.map(F=>({proxy:F,host:"",port:0,status:"dead",error:`API Request Failed (HTTP ${b.status})`}));re.push(...M),c([...re])}}catch(b){const M=W.map(F=>({proxy:F,host:"",port:0,status:"dead",error:b.message||"Lỗi mạng API"}));re.push(...M),c([...re])}g(b=>({...b,current:Math.min(b.current+W.length,b.total)}))}x(!1)},f=()=>{k.current=!0,x(!1)},j=()=>{n(""),c([]),g({current:0,total:0})},v=a.filter(P=>P.status==="active").length,w=a.filter(P=>P.status==="dead").length,z=v>0?Math.round(a.filter(P=>P.status==="active").reduce((P,X)=>P+(X.latency||0),0)/v):0,T=a.filter(P=>{const X=P.proxy.toLowerCase().includes(S.toLowerCase())||P.ip&&P.ip.toLowerCase().includes(S.toLowerCase())||P.country&&P.country.toLowerCase().includes(S.toLowerCase());return N==="live"?X&&P.status==="active":N==="dead"?X&&P.status==="dead":X}),D=()=>{const P=a.filter(X=>X.status==="active").map(X=>X.proxy).join(`
264
+ `);P?(navigator.clipboard.writeText(P),alert("Đã copy danh sách proxy hoạt động vào clipboard!")):alert("Không có proxy hoạt động nào để copy.")},L=()=>{const P=a.filter(W=>W.status==="active").map(W=>W.proxy).join(`
265
+ `);if(!P){alert("Không có proxy hoạt động nào để tải xuống.");return}const X=new Blob([P],{type:"text/plain;charset=utf-8"}),re=URL.createObjectURL(X),A=document.createElement("a");A.href=re,A.download="live-proxies.txt",A.click(),URL.revokeObjectURL(re)},Z=(r-1e3)/14e3*100,U=(s-1)/49*100;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",width:"100%"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Kiểm tra Proxy"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginTop:"4px"},children:"Kiểm tra trạng thái hoạt động, độ trễ và vị trí địa lý của danh sách proxy HTTP/HTTPS."})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1.2fr 0.8fr",gap:"20px"},children:[l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between"},children:[l.jsx("span",{children:"Nhập danh sách Proxy (Mỗi dòng một proxy)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Định dạng hỗ trợ: IP:Port hoặc IP:Port:User:Pass"})]}),l.jsx("textarea",{className:"form-input scrollable",placeholder:"Ví dụ:\r45.77.45.12:8080\r182.23.45.12:3128:admin:secret123",style:{height:"140px",fontFamily:"monospace",fontSize:"13px",resize:"vertical"},value:t,onChange:P=>n(P.target.value),disabled:d})]}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"16px"},children:[l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",children:["Thời gian chờ (Timeout: ",r,"ms)"]}),l.jsx("input",{type:"range",min:"1000",max:"15000",step:"500",value:r,onChange:P=>i(parseInt(P.target.value)),disabled:d,className:"slider-custom slider-timeout",style:{width:"100%",background:`linear-gradient(to right, var(--text-emerald) 0%, var(--text-emerald) ${Z}%, var(--bg-input) ${Z}%, var(--bg-input) 100%)`}})]}),l.jsxs("div",{className:"form-group",children:[l.jsxs("label",{className:"form-label",children:["Số luồng song song (Concurrency: ",s,")"]}),l.jsx("input",{type:"range",min:"1",max:"50",step:"1",value:s,onChange:P=>o(parseInt(P.target.value)),disabled:d,className:"slider-custom slider-concurrency",style:{width:"100%",background:`linear-gradient(to right, var(--text-accent) 0%, var(--text-accent) ${U}%, var(--bg-input) ${U}%, var(--bg-input) 100%)`}})]})]}),l.jsxs("div",{style:{display:"flex",gap:"10px",marginTop:"4px"},children:[d?l.jsxs("button",{className:"btn btn-danger",onClick:f,style:{flexGrow:1,padding:"12px",background:"var(--btn-danger-bg, #ef4444)",color:"#fff"},children:[l.jsx(fd,{size:16}),"Dừng kiểm tra"]}):l.jsxs("button",{className:"btn btn-primary",onClick:u,disabled:!t.trim(),style:{flexGrow:1,padding:"12px"},children:[l.jsx(ad,{size:16}),"Bắt đầu kiểm tra"]}),l.jsx("button",{className:"btn btn-secondary",onClick:j,disabled:d||!t&&a.length===0,style:{padding:"12px"},title:"Xóa sạch",children:l.jsx(un,{size:16})})]})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"18px",justifyContent:"center"},children:[l.jsx("h3",{style:{fontSize:"15px",fontWeight:600,color:"var(--text-secondary)"},children:"Thống kê"}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"1fr 1fr",gap:"12px"},children:[l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-muted)"},children:"Tổng số"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-primary)"},children:y.total})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-emerald, #10b981)"},children:"LIVE (Hoạt động)"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-emerald, #10b981)"},children:v})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"#ef4444"},children:"DEAD (Lỗi)"}),l.jsx("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"#ef4444"},children:w})]}),l.jsxs("div",{style:{background:"var(--btn-secondary-bg)",padding:"12px",borderRadius:"8px",border:"1px solid var(--border-color)",textAlign:"center"},children:[l.jsx("div",{style:{fontSize:"12px",color:"var(--text-accent)"},children:"Độ trễ TB"}),l.jsxs("div",{style:{fontSize:"24px",fontWeight:700,marginTop:"4px",color:"var(--text-accent)"},children:[z," ",l.jsx("span",{style:{fontSize:"12px"},children:"ms"})]})]})]}),l.jsxs("div",{style:{marginTop:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"var(--text-secondary)",marginBottom:"6px"},children:[l.jsx("span",{children:"Tiến trình kiểm tra"}),l.jsxs("span",{children:[y.current," / ",y.total," (",y.total>0?Math.round(y.current/y.total*100):0,"%)"]})]}),l.jsx("div",{style:{width:"100%",height:"8px",background:"var(--bg-input)",borderRadius:"4px",overflow:"hidden",border:"1px solid var(--border-color)"},children:l.jsx("div",{style:{height:"100%",background:"var(--primary-gradient)",width:`${y.total>0?y.current/y.total*100:0}%`,transition:"width 0.3s ease"}})})]})]})]}),a.length>0&&l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",gap:"16px",flexWrap:"wrap"},children:[l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsxs("button",{onClick:()=>p("all"),className:`btn ${N==="all"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px"},children:["Tất cả (",a.length,")"]}),l.jsxs("button",{onClick:()=>p("live"),className:`btn ${N==="live"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px",border:N==="live"?"none":"1px solid rgba(16, 185, 129, 0.2)"},children:["Hoạt động (",v,")"]}),l.jsxs("button",{onClick:()=>p("dead"),className:`btn ${N==="dead"?"btn-primary":"btn-secondary"}`,style:{padding:"6px 12px",fontSize:"13px",border:N==="dead"?"none":"1px solid rgba(239, 68, 68, 0.2)"},children:["Lỗi (",w,")"]})]}),l.jsxs("div",{style:{position:"relative",minWidth:"220px",flexGrow:1,maxWidth:"350px"},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"12px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{type:"text",placeholder:"Tìm kiếm IP, vị trí...",className:"form-input",style:{paddingLeft:"34px",fontSize:"13px"},value:S,onChange:P=>m(P.target.value)})]}),l.jsxs("div",{style:{display:"flex",gap:"8px"},children:[l.jsxs("button",{className:"btn btn-secondary",onClick:D,disabled:v===0,style:{padding:"8px 12px",fontSize:"13px"},children:[l.jsx(Zt,{size:14}),"Copy Live"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:L,disabled:v===0,style:{padding:"8px 12px",fontSize:"13px"},children:[l.jsx(Bn,{size:14}),"Tải file TXT"]})]})]}),l.jsx("div",{className:"scrollable",style:{overflowX:"auto",maxHeight:"400px"},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",color:"var(--text-muted)"},children:[l.jsx("th",{style:{padding:"12px 8px",fontWeight:500},children:"Proxy"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"110px"},children:"Trạng thái"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"90px"},children:"Độ trễ"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"130px"},children:"IP nhận"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500,width:"150px"},children:"Quốc gia"}),l.jsx("th",{style:{padding:"12px 8px",fontWeight:500},children:"Chi tiết / Lỗi"})]})}),l.jsx("tbody",{children:T.map((P,X)=>l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",background:X%2===0?"var(--btn-secondary-bg)":"transparent"},children:[l.jsx("td",{style:{padding:"10px 8px",fontFamily:"monospace",color:"var(--text-secondary)"},children:P.proxy}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",color:"var(--text-emerald, #10b981)",background:"rgba(16, 185, 129, 0.1)",padding:"3px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(rd,{size:10}),"LIVE"]}):l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"4px",color:"#ef4444",background:"rgba(239, 68, 68, 0.1)",padding:"3px 8px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(ld,{size:10}),"DEAD"]})}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"&&P.latency?l.jsxs("span",{style:{color:P.latency<500?"var(--text-emerald, #10b981)":P.latency<1500?"var(--text-accent)":"#ef4444",fontWeight:600},children:[P.latency," ms"]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"10px 8px",fontFamily:"monospace"},children:P.ip||"-"}),l.jsx("td",{style:{padding:"10px 8px"},children:P.status==="active"&&P.countryCode?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx("span",{style:{fontSize:"15px"},title:P.countryCode,children:Lf(P.countryCode)}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"110px"},children:P.country})]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"10px 8px",color:P.status==="active"?"var(--text-muted)":"#f87171",fontSize:"12px"},children:P.status==="active"?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(Vl,{size:11}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"200px"},children:P.isp})]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx(cd,{size:12}),l.jsx("span",{children:P.error})]})})]},X))})]})})]})]})};function Df(e,t){if(t<=7)return Array.from({length:t},(s,o)=>o+1);const n=[];n.push(1),e>3&&n.push("ellipsis");const r=Math.max(2,e-1),i=Math.min(t-1,e+1);for(let s=r;s<=i;s++)n.push(s);return e<t-2&&n.push("ellipsis"),t>1&&n.push(t),n}const Ns=({currentPage:e,totalPages:t,pageSize:n,totalItems:r,startIndex:i,endIndex:s,pageSizeOptions:o,onPageChange:a,onPageSizeChange:c})=>{if(r<=o[0])return null;const d=Df(e,t);return l.jsxs("div",{className:"pagination-footer animate-fade-in",children:[l.jsxs("div",{className:"pagination-info",style:{display:"flex",alignItems:"center",gap:"16px"},children:[l.jsxs("span",{children:["Hiển thị ",l.jsx("strong",{children:i}),"–",l.jsx("strong",{children:s})," / ",l.jsx("strong",{children:r})," mục"]}),l.jsxs("div",{className:"pagination-size-selector",children:[l.jsx("span",{className:"pagination-size-label",children:"Số lượng"}),l.jsx("select",{className:"pagination-select",value:n,onChange:x=>c(Number(x.target.value)),children:o.map(x=>l.jsx("option",{value:x,children:x},x))})]})]}),l.jsxs("div",{className:"pagination-nav",children:[l.jsx("button",{className:"pagination-btn pagination-arrow",onClick:()=>a(e-1),disabled:e<=1,title:"Trang trước",children:l.jsx(J1,{size:16})}),d.map((x,y)=>x==="ellipsis"?l.jsx("span",{className:"pagination-ellipsis",children:"…"},`ellipsis-${y}`):l.jsx("button",{className:`pagination-btn ${e===x?"active":""}`,onClick:()=>a(x),children:x},x)),l.jsx("button",{className:"pagination-btn pagination-arrow",onClick:()=>a(e+1),disabled:e>=t,title:"Trang tiếp",children:l.jsx(nd,{size:16})})]})]})},gd=[50,100,200,500,1e3],Rf="paginationPageSize",Ff=50;function Af(e){try{const t=localStorage.getItem(e);if(t){const n=Number(t);if(gd.includes(n))return n}}catch{}return Ff}function yd({items:e,storageKey:t=Rf}){const[n,r]=C.useState(()=>Af(t)),[i,s]=C.useState(1),o=e.length,a=Math.max(1,Math.ceil(o/n));C.useEffect(()=>{i>a&&s(a)},[a,i]),C.useEffect(()=>{s(1)},[o]);const c=S=>{r(S),s(1);try{localStorage.setItem(t,String(S))}catch{}},d=(i-1)*n,x=Math.min(d+n,o),y=C.useMemo(()=>e.slice(d,x),[e,d,x]),g=()=>{i<a&&s(i+1)},k=()=>{i>1&&s(i-1)};return{paginatedItems:y,currentPage:i,totalPages:a,pageSize:n,totalItems:o,startIndex:o===0?0:d+1,endIndex:x,pageSizeOptions:gd,setCurrentPage:s,setPageSize:c,goToNextPage:g,goToPrevPage:k}}const Ba=({label:e,value:t,options:n,onChange:r,width:i="150px",height:s="32px",hideAll:o=!1})=>{const[a,c]=C.useState(!1);return l.jsxs("div",{style:{position:"relative"},children:[l.jsxs("button",{onClick:()=>c(!a),className:"form-input",style:{display:"flex",alignItems:"center",justifyContent:"space-between",gap:"6px",width:i,padding:"4px 10px",fontSize:"12px",height:s,background:"var(--bg-input)",border:"1px solid var(--border-input)",borderRadius:"8px",color:"var(--text-primary)",cursor:"pointer",textAlign:"left"},children:[l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:t==="all"?`${e} (Tất cả)`:t}),l.jsx(Fr,{size:10,style:{flexShrink:0,opacity:.7,transform:a?"rotate(180deg)":"none",transition:"transform 0.2s ease"}})]}),a&&l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:()=>c(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999}}),l.jsxs("div",{className:"glass-panel scrollable",style:{position:"absolute",top:"calc(100% + 6px)",left:0,zIndex:1e3,padding:"6px",minWidth:i,maxWidth:"220px",maxHeight:"200px",overflowY:"auto",display:"flex",flexDirection:"column",gap:"4px",boxShadow:"var(--glow-accent)",background:"var(--bg-modal)",borderRadius:"8px"},children:[!o&&l.jsxs("button",{onClick:()=>{r("all"),c(!1)},style:{width:"100%",padding:"6px 10px",textAlign:"left",background:t==="all"?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"6px",color:t==="all"?"var(--text-accent)":"var(--text-primary)",fontSize:"12px",cursor:"pointer",transition:"var(--transition-smooth)"},onMouseEnter:d=>{t!=="all"&&(d.currentTarget.style.background="rgba(255, 255, 255, 0.05)")},onMouseLeave:d=>{t!=="all"&&(d.currentTarget.style.background="transparent")},children:[e," (Tất cả)"]}),n.map(d=>l.jsx("button",{onClick:()=>{r(d),c(!1)},style:{width:"100%",padding:"6px 10px",textAlign:"left",background:t===d?"var(--bg-active-tab)":"transparent",border:"none",borderRadius:"6px",color:t===d?"var(--text-accent)":"var(--text-primary)",fontSize:"12px",cursor:"pointer",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",transition:"var(--transition-smooth)"},onMouseEnter:x=>{t!==d&&(x.currentTarget.style.background="rgba(255, 255, 255, 0.05)")},onMouseLeave:x=>{t!==d&&(x.currentTarget.style.background="transparent")},children:d},d))]})]})]})};function Of(e){if(!e||e.length!==2)return"";const t=e.toUpperCase().split("").map(n=>127397+n.charCodeAt(0));return String.fromCodePoint(...t)}const Wf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState(!0),[s,o]=C.useState(null),[a,c]=C.useState(!1),[d,x]=C.useState(""),[y,g]=C.useState(!1),[k,S]=C.useState(""),[m,N]=C.useState("all"),[p,u]=C.useState("all"),[f,j]=C.useState("all"),[v,w]=C.useState(new Set),[z,T]=C.useState(new Set),[D,L]=C.useState(!1),[Z,U]=C.useState({current:0,total:0}),P=Ut.useRef(!1),X=async()=>{i(!0),o(null);try{const I=await e("/api/proxy");if(I.ok){const G=await I.json();n(G)}else o("Không thể lấy danh sách proxy từ máy chủ.")}catch(I){o(I.message||"Lỗi mạng khi tải danh sách proxy.")}finally{i(!1)}};C.useEffect(()=>{X()},[]);const re=C.useMemo(()=>{const I=new Set;return t.forEach(G=>{G.country&&I.add(G.country)}),Array.from(I).sort()},[t]),A=C.useMemo(()=>{const I=new Set;return t.forEach(G=>{G.isp&&I.add(G.isp)}),Array.from(I).sort()},[t]),W=C.useMemo(()=>t.filter(I=>{const G=I.proxy.toLowerCase().includes(k.toLowerCase())||I.host.toLowerCase().includes(k.toLowerCase())||I.ip&&I.ip.toLowerCase().includes(k.toLowerCase())||I.country&&I.country.toLowerCase().includes(k.toLowerCase())||I.isp&&I.isp.toLowerCase().includes(k.toLowerCase()),R=m==="all"||m==="live"&&I.status==="active"||m==="dead"&&I.status==="dead",Y=p==="all"||I.country===p,ee=f==="all"||I.isp===f;return G&&R&&Y&&ee}),[t,k,m,p,f]),{paginatedItems:b,currentPage:M,totalPages:F,pageSize:H,totalItems:K,startIndex:h,endIndex:E,pageSizeOptions:V,setCurrentPage:$,setPageSize:Q}=yd({items:W,storageKey:"proxyPageSize"}),le=I=>{if(I.target.checked){const G=W.map(R=>R.id);w(new Set(G))}else w(new Set)},B=I=>{const G=new Set(v);G.has(I)?G.delete(I):G.add(I),w(G)},Se=async()=>{if(d.trim()){g(!0);try{const I=d.split(`
266
+ `).map(R=>R.trim()).filter(R=>R.length>0),G=await e("/api/proxy",{method:"POST",body:JSON.stringify({proxies:I})});if(G.ok)x(""),c(!1),await X();else{const R=await G.json();alert(R.error||"Lỗi khi lưu danh sách proxy.")}}catch(I){alert(I.message||"Lỗi kết nối khi gửi dữ liệu.")}finally{g(!1)}}},se=async I=>{if(confirm("Bạn có chắc chắn muốn xóa proxy này?"))try{if((await e(`/api/proxy/${I}`,{method:"DELETE"})).ok){n(Y=>Y.filter(ee=>ee.id!==I));const R=new Set(v);R.delete(I),w(R)}else alert("Không thể xóa proxy.")}catch(G){console.error(G)}},te=async()=>{if(v.size!==0&&confirm(`Bạn có chắc chắn muốn xóa ${v.size} proxy đã chọn?`))try{(await e("/api/proxy/delete-batch",{method:"POST",body:JSON.stringify({ids:Array.from(v)})})).ok?(n(G=>G.filter(R=>!v.has(R.id))),w(new Set)):alert("Không thể xóa các proxy đã chọn.")}catch(I){console.error(I)}},Ar=async(I,G)=>{T(R=>new Set(R).add(I));try{const R=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:[G],timeout:5e3})});if(R.ok){const Y=await R.json();if(Y.success&&Y.results&&Y.results.length>0){const ee=Y.results[0];n(ge=>ge.map(me=>me.id===I?{...me,status:ee.status,latency:ee.latency,ip:ee.ip,country:ee.country,countryCode:ee.countryCode,city:ee.city,isp:ee.isp,error:ee.error,last_checked:new Date().toISOString(),updated_at:new Date().toISOString()}:me))}}}catch(R){console.error(R)}finally{T(R=>{const Y=new Set(R);return Y.delete(I),Y})}},Or=async()=>{if(v.size===0)return;L(!0),P.current=!1;const I=Array.from(v);U({current:0,total:I.length});const G=I.map(Y=>{const ee=t.find(ge=>ge.id===Y);return{id:Y,proxyStr:(ee==null?void 0:ee.proxy)||""}}).filter(Y=>Y.proxyStr),R=5;for(let Y=0;Y<G.length&&!P.current;Y+=R){const ee=G.slice(Y,Y+R);T(ge=>{const me=new Set(ge);return ee.forEach(Gt=>me.add(Gt.id)),me});try{const ge=await e("/api/proxy/check",{method:"POST",body:JSON.stringify({proxies:ee.map(me=>me.proxyStr),timeout:5e3,concurrency:R})});if(ge.ok){const me=await ge.json();me.success&&Array.isArray(me.results)&&n(Gt=>{let Xt=[...Gt];return me.results.forEach(We=>{const bt=Xt.findIndex(Eo=>Eo.proxy===We.proxy);bt!==-1&&(Xt[bt]={...Xt[bt],status:We.status,latency:We.latency,ip:We.ip,country:We.country,countryCode:We.countryCode,city:We.city,isp:We.isp,error:We.error,last_checked:new Date().toISOString(),updated_at:new Date().toISOString()})}),Xt})}}catch(ge){console.error("Lỗi check bulk:",ge)}finally{T(ge=>{const me=new Set(ge);return ee.forEach(Gt=>me.delete(Gt.id)),me}),U(ge=>({...ge,current:Math.min(ge.current+ee.length,ge.total)}))}}L(!1)},Wr=()=>{P.current=!0,L(!1)},Br=()=>{if(v.size===0)return;const I=t.filter(G=>v.has(G.id)).map(G=>G.proxy).join(`
267
267
  `);navigator.clipboard.writeText(I),alert(`Đã copy ${v.size} proxy vào clipboard!`)},Ur=()=>{const I=t.filter(G=>G.status==="active").map(G=>G.proxy).join(`
268
268
  `);I?(navigator.clipboard.writeText(I),alert("Đã copy danh sách proxy hoạt động vào clipboard!")):alert("Không có proxy hoạt động nào để copy.")},Vr=()=>{const I=t.filter(ee=>ee.status==="active").map(ee=>ee.proxy).join(`
269
- `);if(!I){alert("Không có proxy hoạt động nào để tải xuống.");return}const G=new Blob([I],{type:"text/plain;charset=utf-8"}),R=URL.createObjectURL(G),Y=document.createElement("a");Y.href=R,Y.download="live-proxies.txt",Y.click(),URL.revokeObjectURL(R)},Ct=t.length,pt=t.filter(I=>I.status==="active").length,ai=t.filter(I=>I.status==="dead").length;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",width:"100%",height:"100%",minHeight:0},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Quản lý Proxy"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginTop:"4px"},children:"Lịch sử và danh sách proxy đã lưu trong cơ sở dữ liệu mã hóa."})]}),l.jsxs("button",{className:"btn btn-primary",onClick:()=>c(!a),style:{padding:"8px 14px",gap:"6px"},children:[l.jsx(To,{size:16}),a?"Đóng panel":"Thêm Proxy"]})]}),a&&l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between",fontWeight:600},children:[l.jsx("span",{children:"Thêm nhanh Proxy (Mỗi dòng một proxy)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Định dạng: IP:Port hoặc IP:Port:User:Pass"})]}),l.jsx("textarea",{className:"form-input scrollable",placeholder:"Ví dụ:\r103.112.44.1:8080\r202.12.33.22:3128:user:pass",style:{height:"120px",fontFamily:"monospace",fontSize:"13px",resize:"vertical"},value:d,onChange:I=>x(I.target.value),disabled:g}),l.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[l.jsx("button",{className:"btn btn-secondary",onClick:()=>c(!1),disabled:g,style:{padding:"8px 16px"},children:"Hủy"}),l.jsx("button",{className:"btn btn-primary",onClick:Se,disabled:g||!d.trim(),style:{padding:"8px 16px",minWidth:"100px"},children:g?"Đang lưu...":"Lưu vào database"})]})]}),D&&l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"16px",display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontWeight:600},children:[l.jsx(Ri,{size:14,className:"animate-spin",style:{color:"var(--text-accent)"}}),l.jsx("span",{children:"Đang kiểm tra hàng loạt các proxy đã chọn..."})]}),l.jsxs("button",{className:"btn btn-danger",onClick:Wr,style:{padding:"4px 10px",fontSize:"12px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"#ef4444"},children:[l.jsx(fd,{size:12})," Dừng check"]})]}),l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"var(--text-secondary)"},children:[l.jsx("span",{children:"Tiến trình"}),l.jsxs("span",{children:[Z.current," / ",Z.total," (",Math.round(Z.current/Z.total*100),"%)"]})]}),l.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-input)",borderRadius:"3px",overflow:"hidden",border:"1px solid var(--border-color)"},children:l.jsx("div",{style:{height:"100%",background:"var(--primary-gradient)",width:`${Z.current/Z.total*100}%`,transition:"width 0.3s ease"}})})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px",flexGrow:1,minHeight:0,overflow:"hidden"},children:[l.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",background:"var(--btn-secondary-bg)",borderRadius:"6px",padding:"2px",border:"1px solid var(--border-color)"},children:[l.jsxs("button",{onClick:()=>N("all"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="all"?"var(--bg-active-tab)":"transparent",color:m==="all"?"var(--text-accent)":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="all"?600:400},children:["Tất cả (",Ct,")"]}),l.jsxs("button",{onClick:()=>N("live"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="live"?"rgba(16, 185, 129, 0.15)":"transparent",color:m==="live"?"var(--text-emerald, #10b981)":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="live"?600:400},children:["LIVE (",pt,")"]}),l.jsxs("button",{onClick:()=>N("dead"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="dead"?"rgba(239, 68, 68, 0.15)":"transparent",color:m==="dead"?"#ef4444":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="dead"?600:400},children:["DEAD (",ai,")"]})]}),l.jsx(Ba,{label:"Quốc gia",value:p,options:re,onChange:u}),l.jsx(Ba,{label:"Nhà mạng",value:f,options:A,onChange:j})]}),l.jsxs("div",{style:{position:"relative",minWidth:"200px",flexGrow:1,maxWidth:"280px"},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{type:"text",placeholder:"Tìm kiếm proxy, IP, ISP...",className:"form-input",style:{paddingLeft:"32px",fontSize:"12px",height:"32px"},value:k,onChange:I=>S(I.target.value)})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[v.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"btn btn-secondary",onClick:Or,disabled:D,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},title:"Check lại các mục đã chọn",children:[l.jsx(ad,{size:12})," Check"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:Br,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:[l.jsx(Zt,{size:12})," Copy (",v.size,")"]}),l.jsxs("button",{className:"btn btn-danger",onClick:te,disabled:D,style:{padding:"6px 10px",fontSize:"12px",gap:"4px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"#ef4444"},children:[l.jsx(un,{size:12})," Xóa"]})]}),l.jsx("button",{className:"btn btn-secondary",onClick:Ur,disabled:pt===0,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:"Copy Live"}),l.jsx("button",{className:"btn btn-secondary",onClick:Vr,disabled:pt===0,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:"Tải TXT"})]})]}),r?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"var(--text-secondary)"},children:[l.jsx(Ri,{size:24,className:"animate-spin"}),l.jsx("span",{style:{marginTop:"8px"},children:"Đang tải danh sách proxy..."})]}):s?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"#ef4444",gap:"8px"},children:[l.jsx(q1,{size:24}),l.jsx("span",{children:s}),l.jsx("button",{className:"btn btn-secondary",onClick:X,style:{fontSize:"12px",padding:"6px 12px"},children:"Tải lại"})]}):W.length===0?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"var(--text-muted)"},children:[l.jsx(Vl,{size:30,style:{opacity:.3}}),l.jsx("span",{style:{marginTop:"8px",fontSize:"14px"},children:"Không có proxy nào khớp với bộ lọc."})]}):l.jsx("div",{className:"scrollable",style:{overflow:"auto",flexGrow:1,minHeight:0},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.08)",color:"var(--text-muted)"},children:[l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",width:"32px"},children:l.jsx("input",{type:"checkbox",style:{accentColor:"var(--text-accent)",cursor:"pointer"},checked:W.length>0&&v.size===W.length,onChange:le})}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500},children:"Proxy"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"100px"},children:"Trạng thái"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"85px"},children:"Độ trễ"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"120px"},children:"IP nhận"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"140px"},children:"Quốc gia"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"160px"},children:"Nhà mạng / ISP"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"130px"},children:"Cập nhật"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"90px",textAlign:"center"},children:"Hành động"})]})}),l.jsx("tbody",{children:b.map((I,G)=>{const R=z.has(I.id);return l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",background:G%2===0?"var(--btn-secondary-bg)":"transparent",opacity:R?.7:1},children:[l.jsx("td",{style:{padding:"8px"},children:l.jsx("input",{type:"checkbox",style:{accentColor:"var(--text-accent)",cursor:"pointer"},checked:v.has(I.id),onChange:()=>B(I.id)})}),l.jsx("td",{style:{padding:"8px",fontFamily:"monospace",color:"var(--text-secondary)",wordBreak:"break-all"},children:I.proxy}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",color:"var(--text-emerald, #10b981)",background:"rgba(16, 185, 129, 0.1)",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(rd,{size:10}),"LIVE"]}):l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",color:"#ef4444",background:"rgba(239, 68, 68, 0.1)",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(ld,{size:10}),"DEAD"]})}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"&&I.latency?l.jsxs("span",{style:{color:I.latency<500?"var(--text-emerald, #10b981)":I.latency<1500?"var(--text-accent)":"#ef4444",fontWeight:600},children:[I.latency," ms"]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"8px",fontFamily:"monospace"},children:I.ip||"-"}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"&&I.countryCode?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx("span",{style:{fontSize:"14px"},title:I.countryCode,children:Of(I.countryCode)}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100px"},children:I.country})]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"var(--text-muted)",fontSize:"12px"},children:[l.jsx(Vl,{size:11,style:{flexShrink:0}}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"140px"},title:I.isp,children:I.isp})]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"#f87171",fontSize:"11px"},title:I.error,children:[l.jsx(cd,{size:11,style:{flexShrink:0}}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"140px"},children:I.error})]})}),l.jsx("td",{style:{padding:"8px",fontSize:"11px",color:"var(--text-muted)"},children:I.last_checked?new Date(I.last_checked).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit",second:"2-digit",day:"2-digit",month:"2-digit"}):"-"}),l.jsx("td",{style:{padding:"8px",textAlign:"center"},children:l.jsxs("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:[l.jsx("button",{className:"btn btn-secondary",onClick:()=>Ar(I.id,I.proxy),disabled:R||D,style:{padding:"4px",minWidth:"auto",borderRadius:"4px"},title:"Kiểm tra lại",children:l.jsx(Ri,{size:12,className:R?"animate-spin":""})}),l.jsx("button",{className:"btn btn-secondary",onClick:()=>se(I.id),disabled:R||D,style:{padding:"4px",minWidth:"auto",borderRadius:"4px",color:"#ef4444"},title:"Xóa",children:l.jsx(un,{size:12})})]})})]},I.id)})})]})}),l.jsx(Ns,{currentPage:L,totalPages:F,pageSize:H,totalItems:K,startIndex:h,endIndex:E,pageSizeOptions:V,onPageChange:$,onPageSizeChange:Q})]})]})};function Bf(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",n=e.toUpperCase().replace(/=+$/,"").replace(/\s/g,""),r=new Uint8Array(Math.floor(n.length*5/8));let i=0,s=0,o=0;for(let a=0;a<n.length;a++){const c=n[a],d=t.indexOf(c);if(d===-1)throw new Error(`Invalid base32 character: ${c}`);i=i<<5|d,s+=5,s>=8&&(r[o++]=i>>>s-8&255,s-=8)}return r}async function Uf(e){const r=Math.floor(Date.now()/1e3),i=Math.floor(r/30),s=30-r%30;try{const o=Bf(e),a=new Uint8Array(8);let c=i;for(let m=7;m>=0;m--)a[m]=c&255,c=c>>>8;const d=await window.crypto.subtle.importKey("raw",o,{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign"]),x=await window.crypto.subtle.sign("HMAC",d,a),g=new Uint8Array(x),y=g[g.length-1]&15;let S=(((g[y]&127)<<24|(g[y+1]&255)<<16|(g[y+2]&255)<<8|g[y+3]&255)%Math.pow(10,6)).toString();for(;S.length<6;)S="0"+S;return{token:S,remainingSeconds:s}}catch(o){return console.error("TOTP generation error:",o),{token:"------",remainingSeconds:0}}}const Vf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState([]),[s,o]=C.useState({}),[a,c]=C.useState(""),[d,x]=C.useState(null),[g,y]=C.useState(!1),[k,S]=C.useState(!1),[m,N]=C.useState(null),[p,u]=C.useState(!1),[f,j]=C.useState(""),v=async()=>{try{const A=await e("/api/credentials/platforms");if(A.ok){const W=await A.json();Array.isArray(W)&&i(W)}}catch(A){console.error("Failed to fetch platforms:",A)}},w=async(A,W)=>{try{(await e(`/api/credentials/platforms/${A}/toggle`,{method:"PUT",body:JSON.stringify({is_active:!W})})).ok&&v()}catch(b){console.error("Failed to toggle platform:",b)}},z=async A=>{if(confirm("Bạn có chắc chắn muốn xóa nền tảng tùy chỉnh này không? Các tài khoản thuộc nền tảng này sẽ bị gỡ bỏ liên kết."))try{(await e(`/api/credentials/platforms/${A}`,{method:"DELETE"})).ok&&(v(),T())}catch(W){console.error("Failed to delete platform:",W)}},T=async()=>{try{const A=await e("/api/credentials");if(A.ok){const W=await A.json();Array.isArray(W)&&n(W)}await v()}catch(A){console.error("Failed to fetch vault data:",A)}};C.useEffect(()=>{T()},[]),C.useEffect(()=>{const A=async()=>{const b={};for(const L of t)if(L.totp_secret)try{const{token:F,remainingSeconds:H}=await Uf(L.totp_secret);b[L.id]={token:F,remaining:H}}catch{b[L.id]={token:"Error",remaining:0}}o(b)};A();const W=setInterval(A,1e3);return()=>clearInterval(W)},[t]);const D=async A=>{if(A.preventDefault(),!!m)try{const W=r.find(V=>V.id===m.platform_id),b=W?W.name:"",L=m.title||b||m.email||m.username||"Tài khoản",F={...m,title:L},H=!!m.id,K=H?`/api/credentials/${m.id}`:"/api/credentials";(await e(K,{method:H?"PUT":"POST",body:JSON.stringify(F)})).ok&&(S(!1),N(null),T())}catch(W){console.error("Failed to save credential:",W)}},M=async A=>{if(confirm("Bạn có chắc chắn muốn xóa tài khoản này không?"))try{(await e(`/api/credentials/${A}`,{method:"DELETE"})).ok&&T()}catch(W){console.error("Failed to delete credential:",W)}},Z=async A=>{try{(await e(`/api/credentials/${A.id}`,{method:"PUT",body:JSON.stringify({is_favorite:!A.is_favorite})})).ok&&T()}catch(W){console.error("Failed to toggle favorite:",W)}},U=async(A,W)=>{if(!f)return;const b=f.split(`
270
- `).map(H=>H.trim()).filter(H=>H),L=(H,K,h)=>{const E=H.split("|").map(B=>B.trim()),V=K.split("|").map(B=>B.trim().toLowerCase()),$={title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[],notes:"Nhập nhanh từ chuỗi dán (định dạng tùy chỉnh)"},Q=r.find(B=>B.id===h);$.platform_id=h,$.title=Q?Q.name:"Tài khoản dán nhanh",h==="google"?$.url="google.com":h==="facebook"?$.url="facebook.com":h==="tiktok"?$.url="tiktok.com":h==="twitter"?$.url="x.com":h==="instagram"?$.url="instagram.com":h==="outlook"?$.url="outlook.live.com":h==="telegram"?$.url="telegram.org":h==="discord"?$.url="discord.com":h==="reddit"&&($.url="reddit.com");const le=(B,Se)=>{var se;Se&&((se=$.custom_fields)==null||se.push({key:B,value:Se}))};return V.forEach((B,Se)=>{const se=E[Se];if(!(!se||B==="skip"))if(B==="pass mail"||B==="pass_mail"||B==="pass email"||B==="pass_email"||B.includes("pass mail")||B.includes("pass email"))le("Pass Mail",se);else if(B==="backup code"||B==="backup_code"||B.includes("backup"))le("Backup Code",se);else if(B.includes("email")||B==="mail")$.email=se,$.username||($.username=se);else if(B.includes("pass")||B==="pwd")B.includes("khôi phục")||B.includes("recovery")||B.includes("kp")?le("Mail KP",se):$.password=se;else if(B==="2fa"||B==="otp"||B==="totp"||B.includes("secret")||B.includes("authenticator"))$.totp_secret=se;else if(B==="uid")$.uid=se;else if(B.includes("username")||B==="user")$.username=se;else if(B==="sđt"||B==="sdt"||B.includes("phone")||B.includes("điện thoại"))le("SĐT",se);else if(B.includes("khôi phục")||B.includes("recovery")||B.includes("mail kp")||B.includes("mailkp"))le("Mail KP",se);else if(B==="cookie")le("Cookie",se);else if(B==="token")le("Token",se);else if(B.includes("auth token"))le("Auth Token",se);else{const te=K.split("|")[Se]||`Trường ${Se+1}`;le(te,se)}}),$.title||($.title=$.email||$.username||"Tài khoản dán nhanh"),$},F=(H,K)=>{const h=H.split("|").map(Q=>Q.trim()),E={title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[],notes:"Nhập nhanh từ chuỗi dán"},V=(Q,le)=>{var B;le&&((B=E.custom_fields)==null||B.push({key:Q,value:le}))},$=r.find(Q=>Q.id===K);if(E.platform_id=K,E.title=$?$.name:"Tài khoản dán nhanh",K==="google")E.url="google.com",h[0]&&(E.email=h[0],E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.totp_secret=h[2]),h.length===5?(h[3]&&V("Mail KP",h[3]),h[4]&&V("SĐT",h[4])):(h[3]&&V("Mail KP",h[3]),h[4]&&V("Pass Mail KP",h[4]),h[5]&&V("SĐT",h[5]));else if(K==="facebook")E.url="facebook.com",h[0]&&(E.uid=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.totp_secret=h[2]),h[3]&&(E.email=h[3],E.username=h[3]),h[4]&&V("Pass Email",h[4]),h[5]&&V("Mail KP",h[5]),h[6]&&V("Pass Mail KP",h[6]),h[7]&&V("SĐT",h[7]),h[8]&&V("Cookie",h[8]),h[9]&&V("Token",h[9]);else if(K==="tiktok")E.url="tiktok.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("SĐT",h[5]),h[6]&&V("Cookie",h[6]);else if(K==="twitter")E.url="x.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Auth Token",h[5]);else if(K==="instagram")E.url="instagram.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Cookie",h[5]);else if(K==="outlook")E.url="outlook.live.com",h[0]&&(E.email=h[0],E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&V("Mail KP",h[2]),h[3]&&V("SĐT",h[3]),h[4]&&V("Client ID",h[4]),h[5]&&V("Refresh Token",h[5]);else if(K==="telegram")E.url="telegram.org",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&V("API ID",h[2]),h[3]&&V("API Hash",h[3]),h[4]&&V("Session String",h[4]);else if(K==="discord")E.url="discord.com",h[0]&&(E.username=h[0]),h[1]&&(E.email=h[1],V("Email",h[1])),h[2]&&(E.password=h[2]),h[3]&&V("Token",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Backup Codes",h[5]);else if(K==="reddit")E.url="reddit.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&V("Cookie",h[4]);else if(h.length===5){const Q=h[0],le=Q.toLowerCase().includes("gmail.com");E.title=le?"Gmail":"Tài khoản dán nhanh",E.url=le?"google.com":"",E.email=Q,E.username=Q,E.password=h[1],E.totp_secret=h[2],E.custom_fields=[{key:"Mail KP",value:h[3]},{key:"SĐT",value:h[4]}]}else h.length===4?(E.email=h[0],E.username=h[0],E.password=h[1],E.totp_secret=h[2],E.custom_fields=[{key:"Mail KP",value:h[3]}]):h.length===3?(E.email=h[0],E.username=h[0],E.password=h[1],E.totp_secret=h[2]):h.length===2?(E.username=h[0],E.password=h[1]):E.password=h[0];return E};if(b.length>1)try{let H=0;const K=b.map(async h=>{const E=W?L(h,W,A||""):F(h,A||"");(await e("/api/credentials",{method:"POST",body:JSON.stringify(E)})).ok&&H++});await Promise.all(K),alert(`Đã nhập thành công ${H} tài khoản!`),u(!1),j(""),T()}catch(H){console.error("Failed to bulk import:",H),alert("Lỗi nhập hàng loạt. Vui lòng kiểm tra lại định dạng.")}else{const H=W?L(b[0],W,A||""):F(b[0],A||"");N(H),u(!1),j(""),S(!0)}},P=async A=>{try{const b=await(await e("/api/credentials")).json();let L="",F="",H="";if(A==="json")L=JSON.stringify(b,null,2),F="application/json",H="credentials-export.json";else{const V=(Q,le)=>{if(!Q.custom_fields)return"";const B=le.toLowerCase().trim(),Se=Q.custom_fields.find(se=>{const te=se.key.toLowerCase().trim();return B==="mail kp"?te==="mail kp"||te==="mailkp"||te==="email kp"||te==="emailkp"||te.includes("khôi phục")||te.includes("recovery"):B==="sđt"?te==="sđt"||te==="sdt"||te==="phone"||te==="sđt khôi phục"||te.includes("điện thoại")||te==="phone number":B==="backup code"?te==="backup code"||te==="backupcode"||te.includes("backup")||te.includes("mã dự phòng")||te.includes("mã cứu hộ")||te.includes("dự phòng"):B==="pass mail"?te==="pass mail"||te==="passmail"||te==="mật khẩu mail"||te==="mật khẩu email"||te==="pass email"||te==="passemail"||te.includes("mật khẩu email")||te.includes("pass mail"):te===B});return Se?Se.value:""};L=b.map(Q=>{const le=V(Q,"mail kp"),B=V(Q,"sđt"),Se=V(Q,"backup code"),se=V(Q,"pass mail");return`${Q.username}|${Q.password}|${Q.totp_secret}|${le}|${B}|${Se}|${se}`}).join(`
271
- `),F="text/plain",H="credentials-export.txt"}const K=new Blob([L],{type:F}),h=URL.createObjectURL(K),E=document.createElement("a");E.href=h,E.download=H,E.click(),URL.revokeObjectURL(h)}catch(W){console.error("Failed to export:",W)}},X=async A=>{var L;const W=(L=A.target.files)==null?void 0:L[0];if(!W)return;const b=new FileReader;b.onload=async F=>{var H;try{const K=(H=F.target)==null?void 0:H.result;if(W.name.endsWith(".json")){const h=JSON.parse(K),E=Array.isArray(h)?h:[h];for(const V of E)await e("/api/credentials",{method:"POST",body:JSON.stringify(V)});alert(`Đã nhập thành công ${E.length} tài khoản!`),T()}else{const h=K.split(`
272
- `).map($=>$.trim()).filter($=>$);if(h.length===0)return;let E=0;if(h.some($=>$.includes("|"))){for(const $ of h){const Q=$.split("|").map(le=>le.trim());if(Q.length>=2){const le=Q[0],B=le.toLowerCase().includes("gmail.com");await e("/api/credentials",{method:"POST",body:JSON.stringify({title:B?"Gmail":"Tài khoản Nhập",username:le,password:Q[1]||"",totp_secret:Q[2]||"",custom_fields:[{key:"Mail KP",value:Q[3]||""},{key:"SĐT",value:Q[4]||""},{key:"Backup Code",value:Q[5]||""},{key:"Pass Mail",value:Q[6]||""}],url:B?"google.com":"",notes:"Nhập từ file định dạng email|pass|2FA|Mail KP|SĐT"})}),E++}}alert(`Đã nhập thành công ${E} tài khoản từ định dạng email|pass|2FA|Mail KP|SĐT!`)}else{if(h.length<=1)return;for(let $=1;$<h.length;$++){const Q=h[$].split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map(le=>le.replace(/^"|"$/g,"").trim());Q.length>=2&&(await e("/api/credentials",{method:"POST",body:JSON.stringify({title:Q[0]||"Tài khoản CSV",url:Q[3]||"",username:Q[1]||"",password:Q[2]||"",totp_secret:Q[4]||"",notes:Q[5]||""})}),E++)}alert(`Đã nhập thành công ${E} tài khoản từ file CSV!`)}T()}}catch{alert("Lỗi phân tích file. Vui lòng kiểm tra lại định dạng.")}},b.readAsText(W)},re=t.filter(A=>{const W=A.title.toLowerCase().includes(a.toLowerCase())||A.username.toLowerCase().includes(a.toLowerCase())||A.url.toLowerCase().includes(a.toLowerCase())||A.notes.toLowerCase().includes(a.toLowerCase()),b=g?A.is_favorite:!0,L=d?A.platform_id===d:!0;return W&&b&&L});return{credentials:t,platforms:r,totps:s,search:a,setSearch:c,selectedPlatform:d,setSelectedPlatform:x,onlyFavorites:g,setOnlyFavorites:y,filteredCredentials:re,isCredModalOpen:k,setIsCredModalOpen:S,currentCredential:m,setCurrentCredential:N,isSmartPasteOpen:p,setIsSmartPasteOpen:u,smartPasteText:f,setSmartPasteText:j,fetchData:T,fetchPlatforms:v,handleTogglePlatform:w,handleDeletePlatform:z,handleSaveCredential:D,handleDeleteCredential:M,handleToggleFavorite:Z,handleSmartPasteSubmit:U,handleExport:P,handleImport:X}},Hf=()=>{var G;const{lockVault:e,theme:t,toggleTheme:n,fetchWithAuth:r}=St(),[i,s]=C.useState("vault"),[o,a]=C.useState(()=>localStorage.getItem("viewMode")==="table"?"table":"card"),[c,d]=C.useState(!1),[x,g]=C.useState(window.innerWidth<768);C.useEffect(()=>{const R=()=>{g(window.innerWidth<768)};return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const y=R=>{a(R),localStorage.setItem("viewMode",R)},[k,S]=C.useState(()=>{const R=localStorage.getItem("visibleColumns"),Y={id:!0,username:!0,uid:!0,password:!0,otp:!0,mailKp:!0,phone:!0,backupCode:!1,passMail:!1,secretKey:!0,url:!0};if(R)try{const ee=JSON.parse(R);return{...Y,...ee}}catch{return Y}return Y}),[m,N]=C.useState(!1),p=R=>{const Y={...k,[R]:!k[R]};S(Y),localStorage.setItem("visibleColumns",JSON.stringify(Y))},{credentials:u,platforms:f,totps:j,search:v,setSearch:w,selectedPlatform:z,setSelectedPlatform:T,onlyFavorites:D,setOnlyFavorites:M,filteredCredentials:Z,isCredModalOpen:U,setIsCredModalOpen:P,currentCredential:X,setCurrentCredential:re,isSmartPasteOpen:A,setIsSmartPasteOpen:W,smartPasteText:b,setSmartPasteText:L,fetchData:F,handleTogglePlatform:H,handleDeletePlatform:K,handleSaveCredential:h,handleDeleteCredential:E,handleToggleFavorite:V,handleSmartPasteSubmit:$,handleExport:Q,handleImport:le}=Vf(),{paginatedItems:B,currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,setCurrentPage:Ur,setPageSize:Vr}=gd({items:Z}),[Ct,pt]=C.useState(new Set);C.useEffect(()=>{pt(new Set)},[z,D,v,Se]);const ai=async()=>{if(confirm(`Bạn có chắc chắn muốn xóa ${Ct.size} tài khoản đã chọn không?`))try{const R=Array.from(Ct).map(Y=>r(`/api/credentials/${Y}`,{method:"DELETE"}));await Promise.all(R),pt(new Set),F()}catch(R){console.error("Failed to delete selected credentials:",R)}},I=R=>{const Y=u.filter(bt=>Ct.has(bt.id));let ee="",ye="",me="";if(R==="json")ee=JSON.stringify(Y,null,2),ye="application/json",me="selected-credentials-export.json";else{const bt=(zt,ci)=>{if(!zt.custom_fields)return"";const Kn=ci.toLowerCase().trim(),No=zt.custom_fields.find(md=>{const Be=md.key.toLowerCase().trim();return Kn==="mail kp"?Be==="mail kp"||Be==="mailkp"||Be==="email kp"||Be==="emailkp"||Be.includes("khôi phục")||Be.includes("recovery"):Kn==="sđt"?Be==="sđt"||Be==="sdt"||Be==="phone"||Be==="sđt khôi phục"||Be.includes("điện thoại")||Be==="phone number":Be===Kn});return No?No.value:""};ee=Y.map(zt=>{const ci=bt(zt,"mail kp"),Kn=bt(zt,"sđt");return`${zt.username}|${zt.password}|${zt.totp_secret}|${ci}|${Kn}`}).join(`
273
- `),ye="text/plain",me="selected-credentials-export.txt"}const Gt=new Blob([ee],{type:ye}),Xt=URL.createObjectURL(Gt),We=document.createElement("a");We.href=Xt,We.download=me,We.click(),URL.revokeObjectURL(Xt)};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",padding:"12px",gap:"8px",overflow:"hidden"},children:[l.jsx(df,{search:v,setSearch:w,theme:t,toggleTheme:n,onImportExportOpen:()=>d(!0),onSmartPasteOpen:()=>W(!0),onLockVault:e}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"260px 1fr",gap:"12px",flexGrow:1,overflow:"hidden"},children:[l.jsx(pf,{credentials:u,platforms:f,selectedPlatform:z,setSelectedPlatform:T,onlyFavorites:D,setOnlyFavorites:M,activeView:i,setActiveView:s}),l.jsx("div",{style:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column",minHeight:0},children:i==="settings"?l.jsx("div",{style:{height:"100%",overflowY:"auto",paddingTop:"8px"},children:l.jsx(_f,{platforms:f,onTogglePlatform:H,onDeletePlatform:K})}):i==="proxy"?l.jsx("div",{style:{height:"100%",overflowY:"auto",paddingTop:"8px"},children:l.jsx(Lf,{})}):i==="proxy-list"?l.jsx("div",{style:{height:"100%",overflow:"hidden",paddingTop:"8px",display:"flex",flexDirection:"column",minHeight:0},children:l.jsx(Wf,{})}):l.jsxs("main",{style:{display:"flex",flexDirection:"column",gap:"10px",height:"100%",overflow:"hidden",minHeight:0,paddingTop:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("h2",{style:{fontSize:"18px",fontWeight:600},children:[z?`Nền tảng: ${(G=f.find(R=>R.id===z))==null?void 0:G.name}`:D?"Tài khoản yêu thích":"Tất cả tài khoản",l.jsxs("span",{style:{fontSize:"14px",color:"var(--text-muted)",marginLeft:"8px"},children:["(",Z.length," mục)"]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[!x&&l.jsxs("div",{style:{display:"flex",background:"var(--btn-secondary-bg)",border:"1px solid var(--btn-secondary-border)",borderRadius:"8px",padding:"2px"},children:[l.jsx("button",{onClick:()=>y("card"),style:{background:o==="card"?"var(--primary-gradient)":"none",border:"none",color:o==="card"?"var(--btn-primary-text)":"var(--text-secondary)",padding:"6px 12px",borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"var(--transition-smooth)"},title:"Dạng thẻ",children:l.jsx(sf,{size:16})}),l.jsx("button",{onClick:()=>y("table"),style:{background:o==="table"?"var(--primary-gradient)":"none",border:"none",color:o==="table"?"var(--btn-primary-text)":"var(--text-secondary)",padding:"6px 12px",borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"var(--transition-smooth)"},title:"Dạng bảng",children:l.jsx(sd,{size:16})})]}),!x&&o==="table"&&l.jsxs("div",{style:{position:"relative"},children:[l.jsxs("button",{className:"btn btn-secondary",onClick:()=>N(!m),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"8px"},title:"Hiển thị cột",children:[l.jsx(tf,{size:16}),"Cột",l.jsx(Fr,{size:14})]}),m&&l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:()=>N(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999}}),l.jsxs("div",{className:"glass-panel",style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:1e3,padding:"12px",minWidth:"180px",display:"flex",flexDirection:"column",gap:"10px",boxShadow:"var(--glow-accent)",background:"var(--bg-modal)"},children:[l.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Hiển thị cột"}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.id,onChange:()=>p("id"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"ID tài khoản"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.username,onChange:()=>p("username"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Username"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.uid,onChange:()=>p("uid"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"UID"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.password,onChange:()=>p("password"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mật khẩu"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.otp,onChange:()=>p("otp"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mã 2FA (OTP)"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.mailKp,onChange:()=>p("mailKp"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mail KP"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.phone,onChange:()=>p("phone"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"SĐT"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.backupCode,onChange:()=>p("backupCode"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Backup Code"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.passMail,onChange:()=>p("passMail"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Pass Mail"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.secretKey,onChange:()=>p("secretKey"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Secret Key"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.url,onChange:()=>p("url"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Liên kết"]})]})]})]}),l.jsxs("button",{className:"btn btn-primary",onClick:()=>{re({title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[{key:"Mail KP",value:""},{key:"SĐT",value:""},{key:"Backup Code",value:""},{key:"Pass Mail",value:""}],notes:"",category_id:"",platform_id:z||"",is_favorite:!1}),P(!0)},children:[l.jsx(To,{size:16}),"Thêm tài khoản"]})]})]}),Z.length===0?l.jsxs("div",{className:"glass-panel",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"60px",gap:"12px",color:"var(--text-secondary)"},children:[l.jsx(id,{size:36,style:{color:"var(--text-muted)"}}),l.jsx("p",{children:"Chưa có tài khoản nào trong bộ lọc này."})]}):x||o==="card"?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"scrollable",style:{flexGrow:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"16px",paddingRight:"4px",alignItems:"start"},children:B.map(R=>l.jsx(ff,{cred:R,platforms:f,totp:j[R.id],onToggleFavorite:()=>V(R),onEdit:()=>{re(R),P(!0)},onDelete:()=>E(R.id)},R.id))}),l.jsx(Ns,{currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,onPageChange:Ur,onPageSizeChange:Vr})]}):l.jsxs("div",{className:"table-pagination-wrapper",children:[l.jsx(yf,{credentials:B,platforms:f,totps:j,visibleColumns:k,onToggleFavorite:V,onEdit:R=>{re(R),P(!0)},onDelete:E,selectedIds:Ct,onToggleSelect:R=>{pt(Y=>{const ee=new Set(Y);return ee.has(R)?ee.delete(R):ee.add(R),ee})},onToggleSelectAll:()=>{pt(R=>R.size===B.length?new Set:new Set(B.map(Y=>Y.id)))}}),l.jsx(Ns,{currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,onPageChange:Ur,onPageSizeChange:Vr})]})]})})]}),Ct.size>0&&l.jsxs("div",{className:"glass-panel animate-slide-up",style:{position:"fixed",bottom:"24px",left:"50%",transform:"translateX(-50%)",zIndex:999,display:"flex",alignItems:"center",gap:"16px",padding:"10px 24px",boxShadow:"0 20px 40px rgba(0,0,0,0.5), var(--glow-accent)",background:"var(--bg-modal)",border:"1px solid var(--text-accent)",borderRadius:"30px"},children:[l.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-primary)"},children:["Đã chọn ",l.jsx("strong",{style:{color:"var(--text-accent)"},children:Ct.size})," tài khoản"]}),l.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border-color)"}}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>I("json"),style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(Bn,{size:14}),"Xuất JSON"]}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>I("csv"),style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},title:"Xuất định dạng email|pass|2FA|Mail KP|SĐT",children:[l.jsx(Bn,{size:14}),"Xuất TXT (Gmail)"]}),l.jsxs("button",{type:"button",className:"btn btn-danger",onClick:ai,style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(un,{size:14}),"Xóa đã chọn"]}),l.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border-color)"}}),l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>pt(new Set),style:{padding:"6px",borderRadius:"50%",width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Bỏ chọn tất cả",children:l.jsx($n,{size:14})})]}),l.jsx(mf,{isOpen:U,onClose:()=>{P(!1),re(null)},credential:X||{},onChange:re,onSave:h,platforms:f}),l.jsx(jf,{isOpen:A,onClose:()=>W(!1),text:b,onChange:L,onSubmit:$,platforms:f}),l.jsx(wf,{isOpen:c,onClose:()=>d(!1),onImport:le,onExport:Q})]})},$f=()=>{const{isAuthenticated:e,isLoading:t}=St();return t?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",gap:"16px",color:"var(--text-secondary)"},children:[l.jsx("div",{className:"spinner",style:{width:"40px",height:"40px"}}),l.jsx("p",{style:{fontSize:"15px",fontWeight:500,letterSpacing:"0.5px"},children:"Đang kết nối tới mã khóa bảo mật..."})]}):e?l.jsx(Hf,{}):l.jsx(uf,{})},Kf=()=>l.jsx(K1,{children:l.jsx($f,{})});Fi.createRoot(document.getElementById("root")).render(l.jsx(Ut.StrictMode,{children:l.jsx(Kf,{})}));
269
+ `);if(!I){alert("Không có proxy hoạt động nào để tải xuống.");return}const G=new Blob([I],{type:"text/plain;charset=utf-8"}),R=URL.createObjectURL(G),Y=document.createElement("a");Y.href=R,Y.download="live-proxies.txt",Y.click(),URL.revokeObjectURL(R)},Ct=t.length,pt=t.filter(I=>I.status==="active").length,ai=t.filter(I=>I.status==="dead").length;return l.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:"20px",width:"100%",height:"100%",minHeight:0},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"flex-start",gap:"16px"},children:[l.jsxs("div",{children:[l.jsx("h2",{style:{fontSize:"20px",fontWeight:600,color:"var(--text-primary)"},children:"Quản lý Proxy"}),l.jsx("p",{style:{color:"var(--text-secondary)",fontSize:"14px",marginTop:"4px"},children:"Lịch sử và danh sách proxy đã lưu trong cơ sở dữ liệu mã hóa."})]}),l.jsxs("button",{className:"btn btn-primary",onClick:()=>c(!a),style:{padding:"8px 14px",gap:"6px"},children:[l.jsx(To,{size:16}),a?"Đóng panel":"Thêm Proxy"]})]}),a&&l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"12px"},children:[l.jsxs("label",{className:"form-label",style:{display:"flex",justifyContent:"space-between",fontWeight:600},children:[l.jsx("span",{children:"Thêm nhanh Proxy (Mỗi dòng một proxy)"}),l.jsx("span",{style:{fontSize:"11px",color:"var(--text-muted)"},children:"Định dạng: IP:Port hoặc IP:Port:User:Pass"})]}),l.jsx("textarea",{className:"form-input scrollable",placeholder:"Ví dụ:\r103.112.44.1:8080\r202.12.33.22:3128:user:pass",style:{height:"120px",fontFamily:"monospace",fontSize:"13px",resize:"vertical"},value:d,onChange:I=>x(I.target.value),disabled:y}),l.jsxs("div",{style:{display:"flex",gap:"10px",justifyContent:"flex-end"},children:[l.jsx("button",{className:"btn btn-secondary",onClick:()=>c(!1),disabled:y,style:{padding:"8px 16px"},children:"Hủy"}),l.jsx("button",{className:"btn btn-primary",onClick:Se,disabled:y||!d.trim(),style:{padding:"8px 16px",minWidth:"100px"},children:y?"Đang lưu...":"Lưu vào database"})]})]}),D&&l.jsxs("div",{className:"glass-panel animate-fade-in",style:{padding:"16px",display:"flex",flexDirection:"column",gap:"10px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"8px",fontSize:"14px",fontWeight:600},children:[l.jsx(Ri,{size:14,className:"animate-spin",style:{color:"var(--text-accent)"}}),l.jsx("span",{children:"Đang kiểm tra hàng loạt các proxy đã chọn..."})]}),l.jsxs("button",{className:"btn btn-danger",onClick:Wr,style:{padding:"4px 10px",fontSize:"12px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"#ef4444"},children:[l.jsx(fd,{size:12})," Dừng check"]})]}),l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",fontSize:"12px",color:"var(--text-secondary)"},children:[l.jsx("span",{children:"Tiến trình"}),l.jsxs("span",{children:[Z.current," / ",Z.total," (",Math.round(Z.current/Z.total*100),"%)"]})]}),l.jsx("div",{style:{width:"100%",height:"6px",background:"var(--bg-input)",borderRadius:"3px",overflow:"hidden",border:"1px solid var(--border-color)"},children:l.jsx("div",{style:{height:"100%",background:"var(--primary-gradient)",width:`${Z.current/Z.total*100}%`,transition:"width 0.3s ease"}})})]}),l.jsxs("div",{className:"glass-panel",style:{padding:"20px",display:"flex",flexDirection:"column",gap:"16px",flexGrow:1,minHeight:0,overflow:"hidden"},children:[l.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"12px",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:"8px",alignItems:"center"},children:[l.jsxs("div",{style:{display:"flex",background:"var(--btn-secondary-bg)",borderRadius:"6px",padding:"2px",border:"1px solid var(--border-color)"},children:[l.jsxs("button",{onClick:()=>N("all"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="all"?"var(--bg-active-tab)":"transparent",color:m==="all"?"var(--text-accent)":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="all"?600:400},children:["Tất cả (",Ct,")"]}),l.jsxs("button",{onClick:()=>N("live"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="live"?"rgba(16, 185, 129, 0.15)":"transparent",color:m==="live"?"var(--text-emerald, #10b981)":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="live"?600:400},children:["LIVE (",pt,")"]}),l.jsxs("button",{onClick:()=>N("dead"),style:{padding:"5px 12px",fontSize:"12px",border:"none",background:m==="dead"?"rgba(239, 68, 68, 0.15)":"transparent",color:m==="dead"?"#ef4444":"var(--text-primary)",borderRadius:"4px",cursor:"pointer",fontWeight:m==="dead"?600:400},children:["DEAD (",ai,")"]})]}),l.jsx(Ba,{label:"Quốc gia",value:p,options:re,onChange:u}),l.jsx(Ba,{label:"Nhà mạng",value:f,options:A,onChange:j})]}),l.jsxs("div",{style:{position:"relative",minWidth:"200px",flexGrow:1,maxWidth:"280px"},children:[l.jsx(si,{size:14,style:{position:"absolute",left:"10px",top:"50%",transform:"translateY(-50%)",color:"var(--text-muted)"}}),l.jsx("input",{type:"text",placeholder:"Tìm kiếm proxy, IP, ISP...",className:"form-input",style:{paddingLeft:"32px",fontSize:"12px",height:"32px"},value:k,onChange:I=>S(I.target.value)})]}),l.jsxs("div",{style:{display:"flex",gap:"6px"},children:[v.size>0&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"btn btn-secondary",onClick:Or,disabled:D,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},title:"Check lại các mục đã chọn",children:[l.jsx(ad,{size:12})," Check"]}),l.jsxs("button",{className:"btn btn-secondary",onClick:Br,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:[l.jsx(Zt,{size:12})," Copy (",v.size,")"]}),l.jsxs("button",{className:"btn btn-danger",onClick:te,disabled:D,style:{padding:"6px 10px",fontSize:"12px",gap:"4px",background:"rgba(239, 68, 68, 0.1)",border:"1px solid rgba(239, 68, 68, 0.3)",color:"#ef4444"},children:[l.jsx(un,{size:12})," Xóa"]})]}),l.jsx("button",{className:"btn btn-secondary",onClick:Ur,disabled:pt===0,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:"Copy Live"}),l.jsx("button",{className:"btn btn-secondary",onClick:Vr,disabled:pt===0,style:{padding:"6px 10px",fontSize:"12px",gap:"4px"},children:"Tải TXT"})]})]}),r?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"var(--text-secondary)"},children:[l.jsx(Ri,{size:24,className:"animate-spin"}),l.jsx("span",{style:{marginTop:"8px"},children:"Đang tải danh sách proxy..."})]}):s?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"#ef4444",gap:"8px"},children:[l.jsx(q1,{size:24}),l.jsx("span",{children:s}),l.jsx("button",{className:"btn btn-secondary",onClick:X,style:{fontSize:"12px",padding:"6px 12px"},children:"Tải lại"})]}):W.length===0?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",flexGrow:1,height:"200px",color:"var(--text-muted)"},children:[l.jsx(Vl,{size:30,style:{opacity:.3}}),l.jsx("span",{style:{marginTop:"8px",fontSize:"14px"},children:"Không có proxy nào khớp với bộ lọc."})]}):l.jsx("div",{className:"scrollable",style:{overflow:"auto",flexGrow:1,minHeight:0},children:l.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",textAlign:"left",fontSize:"13px"},children:[l.jsx("thead",{children:l.jsxs("tr",{style:{borderBottom:"1px solid rgba(255,255,255,0.08)",color:"var(--text-muted)"},children:[l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",width:"32px"},children:l.jsx("input",{type:"checkbox",style:{accentColor:"var(--text-accent)",cursor:"pointer"},checked:W.length>0&&v.size===W.length,onChange:le})}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500},children:"Proxy"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"100px"},children:"Trạng thái"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"85px"},children:"Độ trễ"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"120px"},children:"IP nhận"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"140px"},children:"Quốc gia"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"160px"},children:"Nhà mạng / ISP"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"130px"},children:"Cập nhật"}),l.jsx("th",{style:{position:"sticky",top:0,zIndex:10,background:"var(--bg-modal)",padding:"10px 8px",fontWeight:500,width:"90px",textAlign:"center"},children:"Hành động"})]})}),l.jsx("tbody",{children:b.map((I,G)=>{const R=z.has(I.id);return l.jsxs("tr",{style:{borderBottom:"1px solid var(--border-color)",background:G%2===0?"var(--btn-secondary-bg)":"transparent",opacity:R?.7:1},children:[l.jsx("td",{style:{padding:"8px"},children:l.jsx("input",{type:"checkbox",style:{accentColor:"var(--text-accent)",cursor:"pointer"},checked:v.has(I.id),onChange:()=>B(I.id)})}),l.jsx("td",{style:{padding:"8px",fontFamily:"monospace",color:"var(--text-secondary)",wordBreak:"break-all"},children:I.proxy}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"?l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",color:"var(--text-emerald, #10b981)",background:"rgba(16, 185, 129, 0.1)",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(rd,{size:10}),"LIVE"]}):l.jsxs("span",{style:{display:"inline-flex",alignItems:"center",gap:"3px",color:"#ef4444",background:"rgba(239, 68, 68, 0.1)",padding:"2px 6px",borderRadius:"4px",fontSize:"11px",fontWeight:600},children:[l.jsx(ld,{size:10}),"DEAD"]})}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"&&I.latency?l.jsxs("span",{style:{color:I.latency<500?"var(--text-emerald, #10b981)":I.latency<1500?"var(--text-accent)":"#ef4444",fontWeight:600},children:[I.latency," ms"]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"8px",fontFamily:"monospace"},children:I.ip||"-"}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"&&I.countryCode?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px"},children:[l.jsx("span",{style:{fontSize:"14px"},title:I.countryCode,children:Of(I.countryCode)}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"100px"},children:I.country})]}):l.jsx("span",{style:{color:"var(--text-muted)"},children:"-"})}),l.jsx("td",{style:{padding:"8px"},children:I.status==="active"?l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"var(--text-muted)",fontSize:"12px"},children:[l.jsx(Vl,{size:11,style:{flexShrink:0}}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"140px"},title:I.isp,children:I.isp})]}):l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"4px",color:"#f87171",fontSize:"11px"},title:I.error,children:[l.jsx(cd,{size:11,style:{flexShrink:0}}),l.jsx("span",{style:{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap",maxWidth:"140px"},children:I.error})]})}),l.jsx("td",{style:{padding:"8px",fontSize:"11px",color:"var(--text-muted)"},children:I.last_checked?new Date(I.last_checked).toLocaleString("vi-VN",{hour:"2-digit",minute:"2-digit",second:"2-digit",day:"2-digit",month:"2-digit"}):"-"}),l.jsx("td",{style:{padding:"8px",textAlign:"center"},children:l.jsxs("div",{style:{display:"flex",gap:"4px",justifyContent:"center"},children:[l.jsx("button",{className:"btn btn-secondary",onClick:()=>Ar(I.id,I.proxy),disabled:R||D,style:{padding:"4px",minWidth:"auto",borderRadius:"4px"},title:"Kiểm tra lại",children:l.jsx(Ri,{size:12,className:R?"animate-spin":""})}),l.jsx("button",{className:"btn btn-secondary",onClick:()=>se(I.id),disabled:R||D,style:{padding:"4px",minWidth:"auto",borderRadius:"4px",color:"#ef4444"},title:"Xóa",children:l.jsx(un,{size:12})})]})})]},I.id)})})]})}),l.jsx(Ns,{currentPage:M,totalPages:F,pageSize:H,totalItems:K,startIndex:h,endIndex:E,pageSizeOptions:V,onPageChange:$,onPageSizeChange:Q})]})]})};function Bf(e){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZ234567",n=e.toUpperCase().replace(/=+$/,"").replace(/\s/g,""),r=new Uint8Array(Math.floor(n.length*5/8));let i=0,s=0,o=0;for(let a=0;a<n.length;a++){const c=n[a],d=t.indexOf(c);if(d===-1)throw new Error(`Invalid base32 character: ${c}`);i=i<<5|d,s+=5,s>=8&&(r[o++]=i>>>s-8&255,s-=8)}return r}async function Uf(e){const r=Math.floor(Date.now()/1e3),i=Math.floor(r/30),s=30-r%30;try{const o=Bf(e),a=new Uint8Array(8);let c=i;for(let m=7;m>=0;m--)a[m]=c&255,c=c>>>8;const d=await window.crypto.subtle.importKey("raw",o,{name:"HMAC",hash:{name:"SHA-1"}},!1,["sign"]),x=await window.crypto.subtle.sign("HMAC",d,a),y=new Uint8Array(x),g=y[y.length-1]&15;let S=(((y[g]&127)<<24|(y[g+1]&255)<<16|(y[g+2]&255)<<8|y[g+3]&255)%Math.pow(10,6)).toString();for(;S.length<6;)S="0"+S;return{token:S,remainingSeconds:s}}catch(o){return console.error("TOTP generation error:",o),{token:"------",remainingSeconds:0}}}const Vf=()=>{const{fetchWithAuth:e}=St(),[t,n]=C.useState([]),[r,i]=C.useState([]),[s,o]=C.useState({}),[a,c]=C.useState(""),[d,x]=C.useState(null),[y,g]=C.useState(!1),[k,S]=C.useState(!1),[m,N]=C.useState(null),[p,u]=C.useState(!1),[f,j]=C.useState(""),v=async()=>{try{const A=await e("/api/credentials/platforms");if(A.ok){const W=await A.json();Array.isArray(W)&&i(W)}}catch(A){console.error("Failed to fetch platforms:",A)}},w=async(A,W)=>{try{(await e(`/api/credentials/platforms/${A}/toggle`,{method:"PUT",body:JSON.stringify({is_active:!W})})).ok&&v()}catch(b){console.error("Failed to toggle platform:",b)}},z=async A=>{if(confirm("Bạn có chắc chắn muốn xóa nền tảng tùy chỉnh này không? Các tài khoản thuộc nền tảng này sẽ bị gỡ bỏ liên kết."))try{(await e(`/api/credentials/platforms/${A}`,{method:"DELETE"})).ok&&(v(),T())}catch(W){console.error("Failed to delete platform:",W)}},T=async()=>{try{const A=await e("/api/credentials");if(A.ok){const W=await A.json();Array.isArray(W)&&n(W)}await v()}catch(A){console.error("Failed to fetch vault data:",A)}};C.useEffect(()=>{T()},[]),C.useEffect(()=>{const A=async()=>{const b={};for(const M of t)if(M.totp_secret)try{const{token:F,remainingSeconds:H}=await Uf(M.totp_secret);b[M.id]={token:F,remaining:H}}catch{b[M.id]={token:"Error",remaining:0}}o(b)};A();const W=setInterval(A,1e3);return()=>clearInterval(W)},[t]);const D=async A=>{if(A.preventDefault(),!!m)try{const W=r.find(V=>V.id===m.platform_id),b=W?W.name:"",M=m.title||b||m.email||m.username||"Tài khoản",F={...m,title:M},H=!!m.id,K=H?`/api/credentials/${m.id}`:"/api/credentials";(await e(K,{method:H?"PUT":"POST",body:JSON.stringify(F)})).ok&&(S(!1),N(null),T())}catch(W){console.error("Failed to save credential:",W)}},L=async A=>{if(confirm("Bạn có chắc chắn muốn xóa tài khoản này không?"))try{(await e(`/api/credentials/${A}`,{method:"DELETE"})).ok&&T()}catch(W){console.error("Failed to delete credential:",W)}},Z=async A=>{try{(await e(`/api/credentials/${A.id}`,{method:"PUT",body:JSON.stringify({is_favorite:!A.is_favorite})})).ok&&T()}catch(W){console.error("Failed to toggle favorite:",W)}},U=async(A,W)=>{if(!f)return;const b=f.split(`
270
+ `).map(H=>H.trim()).filter(H=>H),M=(H,K,h)=>{const E=H.split("|").map(B=>B.trim()),V=K.split("|").map(B=>B.trim().toLowerCase()),$={title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[],notes:"Nhập nhanh từ chuỗi dán (định dạng tùy chỉnh)"},Q=r.find(B=>B.id===h);$.platform_id=h,$.title=Q?Q.name:"Tài khoản dán nhanh",h==="google"?$.url="google.com":h==="facebook"?$.url="facebook.com":h==="tiktok"?$.url="tiktok.com":h==="twitter"?$.url="x.com":h==="instagram"?$.url="instagram.com":h==="outlook"?$.url="outlook.live.com":h==="telegram"?$.url="telegram.org":h==="discord"?$.url="discord.com":h==="reddit"&&($.url="reddit.com");const le=(B,Se)=>{var se;Se&&((se=$.custom_fields)==null||se.push({key:B,value:Se}))};return V.forEach((B,Se)=>{const se=E[Se];if(!(!se||B==="skip"))if(B==="pass mail"||B==="pass_mail"||B==="pass email"||B==="pass_email"||B.includes("pass mail")||B.includes("pass email"))le("Pass Mail",se);else if(B==="backup code"||B==="backup_code"||B.includes("backup"))le("Backup Code",se);else if(B.includes("email")||B==="mail")$.email=se,$.username||($.username=se);else if(B.includes("pass")||B==="pwd")B.includes("khôi phục")||B.includes("recovery")||B.includes("kp")?le("Mail KP",se):$.password=se;else if(B==="2fa"||B==="otp"||B==="totp"||B.includes("secret")||B.includes("authenticator"))$.totp_secret=se;else if(B==="uid")$.uid=se;else if(B.includes("username")||B==="user")$.username=se;else if(B==="sđt"||B==="sdt"||B.includes("phone")||B.includes("điện thoại"))le("SĐT",se);else if(B.includes("khôi phục")||B.includes("recovery")||B.includes("mail kp")||B.includes("mailkp"))le("Mail KP",se);else if(B==="cookie")le("Cookie",se);else if(B==="token")le("Token",se);else if(B.includes("auth token"))le("Auth Token",se);else{const te=K.split("|")[Se]||`Trường ${Se+1}`;le(te,se)}}),$.title||($.title=$.email||$.username||"Tài khoản dán nhanh"),$},F=(H,K)=>{const h=H.split("|").map(Q=>Q.trim()),E={title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[],notes:"Nhập nhanh từ chuỗi dán"},V=(Q,le)=>{var B;le&&((B=E.custom_fields)==null||B.push({key:Q,value:le}))},$=r.find(Q=>Q.id===K);if(E.platform_id=K,E.title=$?$.name:"Tài khoản dán nhanh",K==="google")E.url="google.com",h[0]&&(E.email=h[0],E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.totp_secret=h[2]),h.length===5?(h[3]&&V("Mail KP",h[3]),h[4]&&V("SĐT",h[4])):(h[3]&&V("Mail KP",h[3]),h[4]&&V("Pass Mail KP",h[4]),h[5]&&V("SĐT",h[5]));else if(K==="facebook")E.url="facebook.com",h[0]&&(E.uid=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.totp_secret=h[2]),h[3]&&(E.email=h[3],E.username=h[3]),h[4]&&V("Pass Email",h[4]),h[5]&&V("Mail KP",h[5]),h[6]&&V("Pass Mail KP",h[6]),h[7]&&V("SĐT",h[7]),h[8]&&V("Cookie",h[8]),h[9]&&V("Token",h[9]);else if(K==="tiktok")E.url="tiktok.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("SĐT",h[5]),h[6]&&V("Cookie",h[6]);else if(K==="twitter")E.url="x.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Auth Token",h[5]);else if(K==="instagram")E.url="instagram.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Cookie",h[5]);else if(K==="outlook")E.url="outlook.live.com",h[0]&&(E.email=h[0],E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&V("Mail KP",h[2]),h[3]&&V("SĐT",h[3]),h[4]&&V("Client ID",h[4]),h[5]&&V("Refresh Token",h[5]);else if(K==="telegram")E.url="telegram.org",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&V("API ID",h[2]),h[3]&&V("API Hash",h[3]),h[4]&&V("Session String",h[4]);else if(K==="discord")E.url="discord.com",h[0]&&(E.username=h[0]),h[1]&&(E.email=h[1],V("Email",h[1])),h[2]&&(E.password=h[2]),h[3]&&V("Token",h[3]),h[4]&&(E.totp_secret=h[4]),h[5]&&V("Backup Codes",h[5]);else if(K==="reddit")E.url="reddit.com",h[0]&&(E.username=h[0]),h[1]&&(E.password=h[1]),h[2]&&(E.email=h[2],V("Email",h[2])),h[3]&&V("Pass Email",h[3]),h[4]&&V("Cookie",h[4]);else if(h.length===5){const Q=h[0],le=Q.toLowerCase().includes("gmail.com");E.title=le?"Gmail":"Tài khoản dán nhanh",E.url=le?"google.com":"",E.email=Q,E.username=Q,E.password=h[1],E.totp_secret=h[2],E.custom_fields=[{key:"Mail KP",value:h[3]},{key:"SĐT",value:h[4]}]}else h.length===4?(E.email=h[0],E.username=h[0],E.password=h[1],E.totp_secret=h[2],E.custom_fields=[{key:"Mail KP",value:h[3]}]):h.length===3?(E.email=h[0],E.username=h[0],E.password=h[1],E.totp_secret=h[2]):h.length===2?(E.username=h[0],E.password=h[1]):E.password=h[0];return E};if(b.length>1)try{let H=0;const K=b.map(async h=>{const E=W?M(h,W,A||""):F(h,A||"");(await e("/api/credentials",{method:"POST",body:JSON.stringify(E)})).ok&&H++});await Promise.all(K),alert(`Đã nhập thành công ${H} tài khoản!`),u(!1),j(""),T()}catch(H){console.error("Failed to bulk import:",H),alert("Lỗi nhập hàng loạt. Vui lòng kiểm tra lại định dạng.")}else{const H=W?M(b[0],W,A||""):F(b[0],A||"");N(H),u(!1),j(""),S(!0)}},P=async A=>{try{const b=await(await e("/api/credentials")).json();let M="",F="",H="";if(A==="json")M=JSON.stringify(b,null,2),F="application/json",H="credentials-export.json";else{const V=(Q,le)=>{if(!Q.custom_fields)return"";const B=le.toLowerCase().trim(),Se=Q.custom_fields.find(se=>{const te=se.key.toLowerCase().trim();return B==="mail kp"?te==="mail kp"||te==="mailkp"||te==="email kp"||te==="emailkp"||te.includes("khôi phục")||te.includes("recovery"):B==="sđt"?te==="sđt"||te==="sdt"||te==="phone"||te==="sđt khôi phục"||te.includes("điện thoại")||te==="phone number":B==="backup code"?te==="backup code"||te==="backupcode"||te.includes("backup")||te.includes("mã dự phòng")||te.includes("mã cứu hộ")||te.includes("dự phòng"):B==="pass mail"?te==="pass mail"||te==="passmail"||te==="mật khẩu mail"||te==="mật khẩu email"||te==="pass email"||te==="passemail"||te.includes("mật khẩu email")||te.includes("pass mail"):te===B});return Se?Se.value:""};M=b.map(Q=>{const le=V(Q,"mail kp"),B=V(Q,"sđt"),Se=V(Q,"backup code"),se=V(Q,"pass mail");return`${Q.username}|${Q.password}|${Q.totp_secret}|${le}|${B}|${Se}|${se}`}).join(`
271
+ `),F="text/plain",H="credentials-export.txt"}const K=new Blob([M],{type:F}),h=URL.createObjectURL(K),E=document.createElement("a");E.href=h,E.download=H,E.click(),URL.revokeObjectURL(h)}catch(W){console.error("Failed to export:",W)}},X=async A=>{var M;const W=(M=A.target.files)==null?void 0:M[0];if(!W)return;const b=new FileReader;b.onload=async F=>{var H;try{const K=(H=F.target)==null?void 0:H.result;if(W.name.endsWith(".json")){const h=JSON.parse(K),E=Array.isArray(h)?h:[h];for(const V of E)await e("/api/credentials",{method:"POST",body:JSON.stringify(V)});alert(`Đã nhập thành công ${E.length} tài khoản!`),T()}else{const h=K.split(`
272
+ `).map($=>$.trim()).filter($=>$);if(h.length===0)return;let E=0;if(h.some($=>$.includes("|"))){for(const $ of h){const Q=$.split("|").map(le=>le.trim());if(Q.length>=2){const le=Q[0],B=le.toLowerCase().includes("gmail.com");await e("/api/credentials",{method:"POST",body:JSON.stringify({title:B?"Gmail":"Tài khoản Nhập",username:le,password:Q[1]||"",totp_secret:Q[2]||"",custom_fields:[{key:"Mail KP",value:Q[3]||""},{key:"SĐT",value:Q[4]||""},{key:"Backup Code",value:Q[5]||""},{key:"Pass Mail",value:Q[6]||""}],url:B?"google.com":"",notes:"Nhập từ file định dạng email|pass|2FA|Mail KP|SĐT"})}),E++}}alert(`Đã nhập thành công ${E} tài khoản từ định dạng email|pass|2FA|Mail KP|SĐT!`)}else{if(h.length<=1)return;for(let $=1;$<h.length;$++){const Q=h[$].split(/,(?=(?:(?:[^"]*"){2})*[^"]*$)/).map(le=>le.replace(/^"|"$/g,"").trim());Q.length>=2&&(await e("/api/credentials",{method:"POST",body:JSON.stringify({title:Q[0]||"Tài khoản CSV",url:Q[3]||"",username:Q[1]||"",password:Q[2]||"",totp_secret:Q[4]||"",notes:Q[5]||""})}),E++)}alert(`Đã nhập thành công ${E} tài khoản từ file CSV!`)}T()}}catch{alert("Lỗi phân tích file. Vui lòng kiểm tra lại định dạng.")}},b.readAsText(W)},re=t.filter(A=>{const W=A.title.toLowerCase().includes(a.toLowerCase())||A.username.toLowerCase().includes(a.toLowerCase())||A.url.toLowerCase().includes(a.toLowerCase())||A.notes.toLowerCase().includes(a.toLowerCase()),b=y?A.is_favorite:!0,M=d?A.platform_id===d:!0;return W&&b&&M});return{credentials:t,platforms:r,totps:s,search:a,setSearch:c,selectedPlatform:d,setSelectedPlatform:x,onlyFavorites:y,setOnlyFavorites:g,filteredCredentials:re,isCredModalOpen:k,setIsCredModalOpen:S,currentCredential:m,setCurrentCredential:N,isSmartPasteOpen:p,setIsSmartPasteOpen:u,smartPasteText:f,setSmartPasteText:j,fetchData:T,fetchPlatforms:v,handleTogglePlatform:w,handleDeletePlatform:z,handleSaveCredential:D,handleDeleteCredential:L,handleToggleFavorite:Z,handleSmartPasteSubmit:U,handleExport:P,handleImport:X}},Hf=()=>{var G;const{lockVault:e,theme:t,toggleTheme:n,fetchWithAuth:r}=St(),[i,s]=C.useState("vault"),[o,a]=C.useState(()=>localStorage.getItem("viewMode")==="table"?"table":"card"),[c,d]=C.useState(!1),[x,y]=C.useState(window.innerWidth<768);C.useEffect(()=>{const R=()=>{y(window.innerWidth<768)};return window.addEventListener("resize",R),()=>window.removeEventListener("resize",R)},[]);const g=R=>{a(R),localStorage.setItem("viewMode",R)},[k,S]=C.useState(()=>{const R=localStorage.getItem("visibleColumns"),Y={id:!0,username:!0,uid:!0,password:!0,otp:!0,mailKp:!0,phone:!0,backupCode:!1,passMail:!1,secretKey:!0,url:!0};if(R)try{const ee=JSON.parse(R);return{...Y,...ee}}catch{return Y}return Y}),[m,N]=C.useState(!1),p=R=>{const Y={...k,[R]:!k[R]};S(Y),localStorage.setItem("visibleColumns",JSON.stringify(Y))},{credentials:u,platforms:f,totps:j,search:v,setSearch:w,selectedPlatform:z,setSelectedPlatform:T,onlyFavorites:D,setOnlyFavorites:L,filteredCredentials:Z,isCredModalOpen:U,setIsCredModalOpen:P,currentCredential:X,setCurrentCredential:re,isSmartPasteOpen:A,setIsSmartPasteOpen:W,smartPasteText:b,setSmartPasteText:M,fetchData:F,handleTogglePlatform:H,handleDeletePlatform:K,handleSaveCredential:h,handleDeleteCredential:E,handleToggleFavorite:V,handleSmartPasteSubmit:$,handleExport:Q,handleImport:le}=Vf(),{paginatedItems:B,currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,setCurrentPage:Ur,setPageSize:Vr}=yd({items:Z}),[Ct,pt]=C.useState(new Set);C.useEffect(()=>{pt(new Set)},[z,D,v,Se]);const ai=async()=>{if(confirm(`Bạn có chắc chắn muốn xóa ${Ct.size} tài khoản đã chọn không?`))try{const R=Array.from(Ct).map(Y=>r(`/api/credentials/${Y}`,{method:"DELETE"}));await Promise.all(R),pt(new Set),F()}catch(R){console.error("Failed to delete selected credentials:",R)}},I=R=>{const Y=u.filter(bt=>Ct.has(bt.id));let ee="",ge="",me="";if(R==="json")ee=JSON.stringify(Y,null,2),ge="application/json",me="selected-credentials-export.json";else{const bt=(zt,ci)=>{if(!zt.custom_fields)return"";const Kn=ci.toLowerCase().trim(),No=zt.custom_fields.find(md=>{const Be=md.key.toLowerCase().trim();return Kn==="mail kp"?Be==="mail kp"||Be==="mailkp"||Be==="email kp"||Be==="emailkp"||Be.includes("khôi phục")||Be.includes("recovery"):Kn==="sđt"?Be==="sđt"||Be==="sdt"||Be==="phone"||Be==="sđt khôi phục"||Be.includes("điện thoại")||Be==="phone number":Be===Kn});return No?No.value:""};ee=Y.map(zt=>{const ci=bt(zt,"mail kp"),Kn=bt(zt,"sđt");return`${zt.username}|${zt.password}|${zt.totp_secret}|${ci}|${Kn}`}).join(`
273
+ `),ge="text/plain",me="selected-credentials-export.txt"}const Gt=new Blob([ee],{type:ge}),Xt=URL.createObjectURL(Gt),We=document.createElement("a");We.href=Xt,We.download=me,We.click(),URL.revokeObjectURL(Xt)};return l.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100vh",padding:"12px",gap:"8px",overflow:"hidden"},children:[l.jsx(df,{search:v,setSearch:w,theme:t,toggleTheme:n,onImportExportOpen:()=>d(!0),onSmartPasteOpen:()=>W(!0),onLockVault:e}),l.jsxs("div",{style:{display:"grid",gridTemplateColumns:"260px 1fr",gap:"12px",flexGrow:1,overflow:"hidden"},children:[l.jsx(pf,{credentials:u,platforms:f,selectedPlatform:z,setSelectedPlatform:T,onlyFavorites:D,setOnlyFavorites:L,activeView:i,setActiveView:s}),l.jsx("div",{style:{height:"100%",overflow:"hidden",display:"flex",flexDirection:"column",minHeight:0},children:i==="settings"?l.jsx("div",{style:{height:"100%",overflowY:"auto",paddingTop:"8px"},children:l.jsx(_f,{platforms:f,onTogglePlatform:H,onDeletePlatform:K})}):i==="proxy"?l.jsx("div",{style:{height:"100%",overflowY:"auto",paddingTop:"8px"},children:l.jsx(Mf,{})}):i==="proxy-list"?l.jsx("div",{style:{height:"100%",overflow:"hidden",paddingTop:"8px",display:"flex",flexDirection:"column",minHeight:0},children:l.jsx(Wf,{})}):l.jsxs("main",{style:{display:"flex",flexDirection:"column",gap:"10px",height:"100%",overflow:"hidden",minHeight:0,paddingTop:"8px"},children:[l.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center"},children:[l.jsxs("h2",{style:{fontSize:"18px",fontWeight:600},children:[z?`Nền tảng: ${(G=f.find(R=>R.id===z))==null?void 0:G.name}`:D?"Tài khoản yêu thích":"Tất cả tài khoản",l.jsxs("span",{style:{fontSize:"14px",color:"var(--text-muted)",marginLeft:"8px"},children:["(",Z.length," mục)"]})]}),l.jsxs("div",{style:{display:"flex",alignItems:"center",gap:"12px"},children:[!x&&l.jsxs("div",{style:{display:"flex",background:"var(--btn-secondary-bg)",border:"1px solid var(--btn-secondary-border)",borderRadius:"8px",padding:"2px"},children:[l.jsx("button",{onClick:()=>g("card"),style:{background:o==="card"?"var(--primary-gradient)":"none",border:"none",color:o==="card"?"var(--btn-primary-text)":"var(--text-secondary)",padding:"6px 12px",borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"var(--transition-smooth)"},title:"Dạng thẻ",children:l.jsx(sf,{size:16})}),l.jsx("button",{onClick:()=>g("table"),style:{background:o==="table"?"var(--primary-gradient)":"none",border:"none",color:o==="table"?"var(--btn-primary-text)":"var(--text-secondary)",padding:"6px 12px",borderRadius:"6px",cursor:"pointer",display:"flex",alignItems:"center",gap:"6px",transition:"var(--transition-smooth)"},title:"Dạng bảng",children:l.jsx(sd,{size:16})})]}),!x&&o==="table"&&l.jsxs("div",{style:{position:"relative"},children:[l.jsxs("button",{className:"btn btn-secondary",onClick:()=>N(!m),style:{display:"flex",alignItems:"center",gap:"8px",padding:"8px 16px",borderRadius:"8px"},title:"Hiển thị cột",children:[l.jsx(tf,{size:16}),"Cột",l.jsx(Fr,{size:14})]}),m&&l.jsxs(l.Fragment,{children:[l.jsx("div",{onClick:()=>N(!1),style:{position:"fixed",top:0,left:0,right:0,bottom:0,zIndex:999}}),l.jsxs("div",{className:"glass-panel",style:{position:"absolute",top:"calc(100% + 8px)",right:0,zIndex:1e3,padding:"12px",minWidth:"180px",display:"flex",flexDirection:"column",gap:"10px",boxShadow:"var(--glow-accent)",background:"var(--bg-modal)"},children:[l.jsx("div",{style:{fontSize:"11px",fontWeight:600,color:"var(--text-secondary)",marginBottom:"4px",textTransform:"uppercase",letterSpacing:"0.05em"},children:"Hiển thị cột"}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.id,onChange:()=>p("id"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"ID tài khoản"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.username,onChange:()=>p("username"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Username"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.uid,onChange:()=>p("uid"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"UID"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.password,onChange:()=>p("password"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mật khẩu"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.otp,onChange:()=>p("otp"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mã 2FA (OTP)"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.mailKp,onChange:()=>p("mailKp"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Mail KP"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.phone,onChange:()=>p("phone"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"SĐT"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.backupCode,onChange:()=>p("backupCode"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Backup Code"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.passMail,onChange:()=>p("passMail"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Pass Mail"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.secretKey,onChange:()=>p("secretKey"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Secret Key"]}),l.jsxs("label",{style:{display:"flex",alignItems:"center",gap:"10px",fontSize:"13px",cursor:"pointer",color:"var(--text-primary)"},children:[l.jsx("input",{type:"checkbox",checked:k.url,onChange:()=>p("url"),style:{cursor:"pointer",accentColor:"var(--text-accent)"}}),"Liên kết"]})]})]})]}),l.jsxs("button",{className:"btn btn-primary",onClick:()=>{re({title:"",username:"",uid:"",password:"",totp_secret:"",url:"",custom_fields:[{key:"Mail KP",value:""},{key:"SĐT",value:""},{key:"Backup Code",value:""},{key:"Pass Mail",value:""}],notes:"",category_id:"",platform_id:z||"",is_favorite:!1}),P(!0)},children:[l.jsx(To,{size:16}),"Thêm tài khoản"]})]})]}),Z.length===0?l.jsxs("div",{className:"glass-panel",style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",padding:"60px",gap:"12px",color:"var(--text-secondary)"},children:[l.jsx(id,{size:36,style:{color:"var(--text-muted)"}}),l.jsx("p",{children:"Chưa có tài khoản nào trong bộ lọc này."})]}):x||o==="card"?l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"scrollable",style:{flexGrow:1,overflowY:"auto",display:"grid",gridTemplateColumns:"repeat(auto-fill, minmax(320px, 1fr))",gap:"16px",paddingRight:"4px",alignItems:"start"},children:B.map(R=>l.jsx(ff,{cred:R,platforms:f,totp:j[R.id],onToggleFavorite:()=>V(R),onEdit:()=>{re(R),P(!0)},onDelete:()=>E(R.id)},R.id))}),l.jsx(Ns,{currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,onPageChange:Ur,onPageSizeChange:Vr})]}):l.jsxs("div",{className:"table-pagination-wrapper",children:[l.jsx(gf,{credentials:B,platforms:f,totps:j,visibleColumns:k,onToggleFavorite:V,onEdit:R=>{re(R),P(!0)},onDelete:E,selectedIds:Ct,onToggleSelect:R=>{pt(Y=>{const ee=new Set(Y);return ee.has(R)?ee.delete(R):ee.add(R),ee})},onToggleSelectAll:()=>{pt(R=>R.size===B.length?new Set:new Set(B.map(Y=>Y.id)))}}),l.jsx(Ns,{currentPage:Se,totalPages:se,pageSize:te,totalItems:Ar,startIndex:Or,endIndex:Wr,pageSizeOptions:Br,onPageChange:Ur,onPageSizeChange:Vr})]})]})})]}),Ct.size>0&&l.jsxs("div",{className:"glass-panel animate-slide-up",style:{position:"fixed",bottom:"24px",left:"50%",transform:"translateX(-50%)",zIndex:999,display:"flex",alignItems:"center",gap:"16px",padding:"10px 24px",boxShadow:"0 20px 40px rgba(0,0,0,0.5), var(--glow-accent)",background:"var(--bg-modal)",border:"1px solid var(--text-accent)",borderRadius:"30px"},children:[l.jsxs("span",{style:{fontSize:"14px",fontWeight:600,color:"var(--text-primary)"},children:["Đã chọn ",l.jsx("strong",{style:{color:"var(--text-accent)"},children:Ct.size})," tài khoản"]}),l.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border-color)"}}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>I("json"),style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(Bn,{size:14}),"Xuất JSON"]}),l.jsxs("button",{type:"button",className:"btn btn-secondary",onClick:()=>I("csv"),style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},title:"Xuất định dạng email|pass|2FA|Mail KP|SĐT",children:[l.jsx(Bn,{size:14}),"Xuất TXT (Gmail)"]}),l.jsxs("button",{type:"button",className:"btn btn-danger",onClick:ai,style:{padding:"6px 12px",fontSize:"13px",borderRadius:"20px",display:"flex",alignItems:"center",gap:"6px"},children:[l.jsx(un,{size:14}),"Xóa đã chọn"]}),l.jsx("div",{style:{width:"1px",height:"20px",background:"var(--border-color)"}}),l.jsx("button",{type:"button",className:"btn btn-secondary",onClick:()=>pt(new Set),style:{padding:"6px",borderRadius:"50%",width:"28px",height:"28px",display:"flex",alignItems:"center",justifyContent:"center"},title:"Bỏ chọn tất cả",children:l.jsx($n,{size:14})})]}),l.jsx(mf,{isOpen:U,onClose:()=>{P(!1),re(null)},credential:X||{},onChange:re,onSave:h,platforms:f}),l.jsx(jf,{isOpen:A,onClose:()=>W(!1),text:b,onChange:M,onSubmit:$,platforms:f}),l.jsx(wf,{isOpen:c,onClose:()=>d(!1),onImport:le,onExport:Q})]})},$f=()=>{const{isAuthenticated:e,isLoading:t}=St();return t?l.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",minHeight:"100vh",gap:"16px",color:"var(--text-secondary)"},children:[l.jsx("div",{className:"spinner",style:{width:"40px",height:"40px"}}),l.jsx("p",{style:{fontSize:"15px",fontWeight:500,letterSpacing:"0.5px"},children:"Đang kết nối tới mã khóa bảo mật..."})]}):e?l.jsx(Hf,{}):l.jsx(uf,{})},Kf=()=>l.jsx(K1,{children:l.jsx($f,{})});Fi.createRoot(document.getElementById("root")).render(l.jsx(Ut.StrictMode,{children:l.jsx(Kf,{})}));