@realtimex/realtimex-alchemy 1.0.74 → 1.0.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/CHANGELOG.md +19 -0
- package/dist/api/index.js +162 -0
- package/dist/assets/index-B20f5cpj.js +180 -0
- package/dist/assets/{index-CT_DMn9k.css → index-DQzcu1YR.css} +1 -1
- package/dist/index.html +2 -2
- package/package.json +2 -1
- package/scripts/migrate.sh +26 -2
- package/dist/assets/index-DG7qPboL.js +0 -177
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const a of o.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&r(a)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();function Ac(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ud={exports:{}},Lo={},Bd={exports:{}},Ge={};var $y;function ej(){if($y)return Ge;$y=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),a=Symbol.for("react.context"),c=Symbol.for("react.forward_ref"),d=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),p=Symbol.for("react.lazy"),g=Symbol.iterator;function y(M){return M===null||typeof M!="object"?null:(M=g&&M[g]||M["@@iterator"],typeof M=="function"?M:null)}var x={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},b=Object.assign,w={};function k(M,K,P){this.props=M,this.context=K,this.refs=w,this.updater=P||x}k.prototype.isReactComponent={},k.prototype.setState=function(M,K){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,K,"setState")},k.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function S(){}S.prototype=k.prototype;function E(M,K,P){this.props=M,this.context=K,this.refs=w,this.updater=P||x}var j=E.prototype=new S;j.constructor=E,b(j,k.prototype),j.isPureReactComponent=!0;var O=Array.isArray,N=Object.prototype.hasOwnProperty,T={current:null},I={key:!0,ref:!0,__self:!0,__source:!0};function V(M,K,P){var te,me={},ye=null,Fe=null;if(K!=null)for(te in K.ref!==void 0&&(Fe=K.ref),K.key!==void 0&&(ye=""+K.key),K)N.call(K,te)&&!I.hasOwnProperty(te)&&(me[te]=K[te]);var Ae=arguments.length-2;if(Ae===1)me.children=P;else if(1<Ae){for(var Ie=Array(Ae),Te=0;Te<Ae;Te++)Ie[Te]=arguments[Te+2];me.children=Ie}if(M&&M.defaultProps)for(te in Ae=M.defaultProps,Ae)me[te]===void 0&&(me[te]=Ae[te]);return{$$typeof:e,type:M,key:ye,ref:Fe,props:me,_owner:T.current}}function U(M,K){return{$$typeof:e,type:M.type,key:K,ref:M.ref,props:M.props,_owner:M._owner}}function D(M){return typeof M=="object"&&M!==null&&M.$$typeof===e}function Z(M){var K={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(P){return K[P]})}var Y=/\/+/g;function he(M,K){return typeof M=="object"&&M!==null&&M.key!=null?Z(""+M.key):K.toString(36)}function G(M,K,P,te,me){var ye=typeof M;(ye==="undefined"||ye==="boolean")&&(M=null);var Fe=!1;if(M===null)Fe=!0;else switch(ye){case"string":case"number":Fe=!0;break;case"object":switch(M.$$typeof){case e:case t:Fe=!0}}if(Fe)return Fe=M,me=me(Fe),M=te===""?"."+he(Fe,0):te,O(me)?(P="",M!=null&&(P=M.replace(Y,"$&/")+"/"),G(me,K,P,"",function(Te){return Te})):me!=null&&(D(me)&&(me=U(me,P+(!me.key||Fe&&Fe.key===me.key?"":(""+me.key).replace(Y,"$&/")+"/")+M)),K.push(me)),1;if(Fe=0,te=te===""?".":te+":",O(M))for(var Ae=0;Ae<M.length;Ae++){ye=M[Ae];var Ie=te+he(ye,Ae);Fe+=G(ye,K,P,Ie,me)}else if(Ie=y(M),typeof Ie=="function")for(M=Ie.call(M),Ae=0;!(ye=M.next()).done;)ye=ye.value,Ie=te+he(ye,Ae++),Fe+=G(ye,K,P,Ie,me);else if(ye==="object")throw K=String(M),Error("Objects are not valid as a React child (found: "+(K==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":K)+"). If you meant to render a collection of children, use an array instead.");return Fe}function W(M,K,P){if(M==null)return M;var te=[],me=0;return G(M,te,"","",function(ye){return K.call(P,ye,me++)}),te}function ne(M){if(M._status===-1){var K=M._result;K=K(),K.then(function(P){(M._status===0||M._status===-1)&&(M._status=1,M._result=P)},function(P){(M._status===0||M._status===-1)&&(M._status=2,M._result=P)}),M._status===-1&&(M._status=0,M._result=K)}if(M._status===1)return M._result.default;throw M._result}var re={current:null},J={transition:null},ce={ReactCurrentDispatcher:re,ReactCurrentBatchConfig:J,ReactCurrentOwner:T};function A(){throw Error("act(...) is not supported in production builds of React.")}return Ge.Children={map:W,forEach:function(M,K,P){W(M,function(){K.apply(this,arguments)},P)},count:function(M){var K=0;return W(M,function(){K++}),K},toArray:function(M){return W(M,function(K){return K})||[]},only:function(M){if(!D(M))throw Error("React.Children.only expected to receive a single React element child.");return M}},Ge.Component=k,Ge.Fragment=n,Ge.Profiler=s,Ge.PureComponent=E,Ge.StrictMode=r,Ge.Suspense=d,Ge.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ce,Ge.act=A,Ge.cloneElement=function(M,K,P){if(M==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+M+".");var te=b({},M.props),me=M.key,ye=M.ref,Fe=M._owner;if(K!=null){if(K.ref!==void 0&&(ye=K.ref,Fe=T.current),K.key!==void 0&&(me=""+K.key),M.type&&M.type.defaultProps)var Ae=M.type.defaultProps;for(Ie in K)N.call(K,Ie)&&!I.hasOwnProperty(Ie)&&(te[Ie]=K[Ie]===void 0&&Ae!==void 0?Ae[Ie]:K[Ie])}var Ie=arguments.length-2;if(Ie===1)te.children=P;else if(1<Ie){Ae=Array(Ie);for(var Te=0;Te<Ie;Te++)Ae[Te]=arguments[Te+2];te.children=Ae}return{$$typeof:e,type:M.type,key:me,ref:ye,props:te,_owner:Fe}},Ge.createContext=function(M){return M={$$typeof:a,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},M.Provider={$$typeof:o,_context:M},M.Consumer=M},Ge.createElement=V,Ge.createFactory=function(M){var K=V.bind(null,M);return K.type=M,K},Ge.createRef=function(){return{current:null}},Ge.forwardRef=function(M){return{$$typeof:c,render:M}},Ge.isValidElement=D,Ge.lazy=function(M){return{$$typeof:p,_payload:{_status:-1,_result:M},_init:ne}},Ge.memo=function(M,K){return{$$typeof:f,type:M,compare:K===void 0?null:K}},Ge.startTransition=function(M){var K=J.transition;J.transition={};try{M()}finally{J.transition=K}},Ge.unstable_act=A,Ge.useCallback=function(M,K){return re.current.useCallback(M,K)},Ge.useContext=function(M){return re.current.useContext(M)},Ge.useDebugValue=function(){},Ge.useDeferredValue=function(M){return re.current.useDeferredValue(M)},Ge.useEffect=function(M,K){return re.current.useEffect(M,K)},Ge.useId=function(){return re.current.useId()},Ge.useImperativeHandle=function(M,K,P){return re.current.useImperativeHandle(M,K,P)},Ge.useInsertionEffect=function(M,K){return re.current.useInsertionEffect(M,K)},Ge.useLayoutEffect=function(M,K){return re.current.useLayoutEffect(M,K)},Ge.useMemo=function(M,K){return re.current.useMemo(M,K)},Ge.useReducer=function(M,K,P){return re.current.useReducer(M,K,P)},Ge.useRef=function(M){return re.current.useRef(M)},Ge.useState=function(M){return re.current.useState(M)},Ge.useSyncExternalStore=function(M,K,P){return re.current.useSyncExternalStore(M,K,P)},Ge.useTransition=function(){return re.current.useTransition()},Ge.version="18.3.1",Ge}var Uy;function Rc(){return Uy||(Uy=1,Bd.exports=ej()),Bd.exports}var By;function tj(){if(By)return Lo;By=1;var e=Rc(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,s=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(c,d,f){var p,g={},y=null,x=null;f!==void 0&&(y=""+f),d.key!==void 0&&(y=""+d.key),d.ref!==void 0&&(x=d.ref);for(p in d)r.call(d,p)&&!o.hasOwnProperty(p)&&(g[p]=d[p]);if(c&&c.defaultProps)for(p in d=c.defaultProps,d)g[p]===void 0&&(g[p]=d[p]);return{$$typeof:t,type:c,key:y,ref:x,props:g,_owner:s.current}}return Lo.Fragment=n,Lo.jsx=a,Lo.jsxs=a,Lo}var Vy;function nj(){return Vy||(Vy=1,Ud.exports=tj()),Ud.exports}var u=nj(),R=Rc();const ia=Ac(R);var $l={},Vd={exports:{}},gn={},qd={exports:{}},Hd={};var qy;function rj(){return qy||(qy=1,(function(e){function t(J,ce){var A=J.length;J.push(ce);e:for(;0<A;){var M=A-1>>>1,K=J[M];if(0<s(K,ce))J[M]=ce,J[A]=K,A=M;else break e}}function n(J){return J.length===0?null:J[0]}function r(J){if(J.length===0)return null;var ce=J[0],A=J.pop();if(A!==ce){J[0]=A;e:for(var M=0,K=J.length,P=K>>>1;M<P;){var te=2*(M+1)-1,me=J[te],ye=te+1,Fe=J[ye];if(0>s(me,A))ye<K&&0>s(Fe,me)?(J[M]=Fe,J[ye]=A,M=ye):(J[M]=me,J[te]=A,M=te);else if(ye<K&&0>s(Fe,A))J[M]=Fe,J[ye]=A,M=ye;else break e}}return ce}function s(J,ce){var A=J.sortIndex-ce.sortIndex;return A!==0?A:J.id-ce.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var a=Date,c=a.now();e.unstable_now=function(){return a.now()-c}}var d=[],f=[],p=1,g=null,y=3,x=!1,b=!1,w=!1,k=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,E=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function j(J){for(var ce=n(f);ce!==null;){if(ce.callback===null)r(f);else if(ce.startTime<=J)r(f),ce.sortIndex=ce.expirationTime,t(d,ce);else break;ce=n(f)}}function O(J){if(w=!1,j(J),!b)if(n(d)!==null)b=!0,ne(N);else{var ce=n(f);ce!==null&&re(O,ce.startTime-J)}}function N(J,ce){b=!1,w&&(w=!1,S(V),V=-1),x=!0;var A=y;try{for(j(ce),g=n(d);g!==null&&(!(g.expirationTime>ce)||J&&!Z());){var M=g.callback;if(typeof M=="function"){g.callback=null,y=g.priorityLevel;var K=M(g.expirationTime<=ce);ce=e.unstable_now(),typeof K=="function"?g.callback=K:g===n(d)&&r(d),j(ce)}else r(d);g=n(d)}if(g!==null)var P=!0;else{var te=n(f);te!==null&&re(O,te.startTime-ce),P=!1}return P}finally{g=null,y=A,x=!1}}var T=!1,I=null,V=-1,U=5,D=-1;function Z(){return!(e.unstable_now()-D<U)}function Y(){if(I!==null){var J=e.unstable_now();D=J;var ce=!0;try{ce=I(!0,J)}finally{ce?he():(T=!1,I=null)}}else T=!1}var he;if(typeof E=="function")he=function(){E(Y)};else if(typeof MessageChannel<"u"){var G=new MessageChannel,W=G.port2;G.port1.onmessage=Y,he=function(){W.postMessage(null)}}else he=function(){k(Y,0)};function ne(J){I=J,T||(T=!0,he())}function re(J,ce){V=k(function(){J(e.unstable_now())},ce)}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(J){J.callback=null},e.unstable_continueExecution=function(){b||x||(b=!0,ne(N))},e.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):U=0<J?Math.floor(1e3/J):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_getFirstCallbackNode=function(){return n(d)},e.unstable_next=function(J){switch(y){case 1:case 2:case 3:var ce=3;break;default:ce=y}var A=y;y=ce;try{return J()}finally{y=A}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(J,ce){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var A=y;y=J;try{return ce()}finally{y=A}},e.unstable_scheduleCallback=function(J,ce,A){var M=e.unstable_now();switch(typeof A=="object"&&A!==null?(A=A.delay,A=typeof A=="number"&&0<A?M+A:M):A=M,J){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=A+K,J={id:p++,callback:ce,priorityLevel:J,startTime:A,expirationTime:K,sortIndex:-1},A>M?(J.sortIndex=A,t(f,J),n(d)===null&&J===n(f)&&(w?(S(V),V=-1):w=!0,re(O,A-M))):(J.sortIndex=K,t(d,J),b||x||(b=!0,ne(N))),J},e.unstable_shouldYield=Z,e.unstable_wrapCallback=function(J){var ce=y;return function(){var A=y;y=ce;try{return J.apply(this,arguments)}finally{y=A}}}})(Hd)),Hd}var Hy;function sj(){return Hy||(Hy=1,qd.exports=rj()),qd.exports}var Ky;function ij(){if(Ky)return gn;Ky=1;var e=Rc(),t=sj();function n(i){for(var l="https://reactjs.org/docs/error-decoder.html?invariant="+i,h=1;h<arguments.length;h++)l+="&args[]="+encodeURIComponent(arguments[h]);return"Minified React error #"+i+"; visit "+l+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var r=new Set,s={};function o(i,l){a(i,l),a(i+"Capture",l)}function a(i,l){for(s[i]=l,i=0;i<l.length;i++)r.add(l[i])}var c=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),d=Object.prototype.hasOwnProperty,f=/^[: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]*$/,p={},g={};function y(i){return d.call(g,i)?!0:d.call(p,i)?!1:f.test(i)?g[i]=!0:(p[i]=!0,!1)}function x(i,l,h,m){if(h!==null&&h.type===0)return!1;switch(typeof l){case"function":case"symbol":return!0;case"boolean":return m?!1:h!==null?!h.acceptsBooleans:(i=i.toLowerCase().slice(0,5),i!=="data-"&&i!=="aria-");default:return!1}}function b(i,l,h,m){if(l===null||typeof l>"u"||x(i,l,h,m))return!0;if(m)return!1;if(h!==null)switch(h.type){case 3:return!l;case 4:return l===!1;case 5:return isNaN(l);case 6:return isNaN(l)||1>l}return!1}function w(i,l,h,m,v,_,C){this.acceptsBooleans=l===2||l===3||l===4,this.attributeName=m,this.attributeNamespace=v,this.mustUseProperty=h,this.propertyName=i,this.type=l,this.sanitizeURL=_,this.removeEmptyString=C}var k={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(i){k[i]=new w(i,0,!1,i,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(i){var l=i[0];k[l]=new w(l,1,!1,i[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(i){k[i]=new w(i,2,!1,i.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(i){k[i]=new w(i,2,!1,i,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(i){k[i]=new w(i,3,!1,i.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(i){k[i]=new w(i,3,!0,i,null,!1,!1)}),["capture","download"].forEach(function(i){k[i]=new w(i,4,!1,i,null,!1,!1)}),["cols","rows","size","span"].forEach(function(i){k[i]=new w(i,6,!1,i,null,!1,!1)}),["rowSpan","start"].forEach(function(i){k[i]=new w(i,5,!1,i.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function E(i){return i[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(i){var l=i.replace(S,E);k[l]=new w(l,1,!1,i,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(i){var l=i.replace(S,E);k[l]=new w(l,1,!1,i,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(i){var l=i.replace(S,E);k[l]=new w(l,1,!1,i,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(i){k[i]=new w(i,1,!1,i.toLowerCase(),null,!1,!1)}),k.xlinkHref=new w("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(i){k[i]=new w(i,1,!1,i.toLowerCase(),null,!0,!0)});function j(i,l,h,m){var v=k.hasOwnProperty(l)?k[l]:null;(v!==null?v.type!==0:m||!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(b(l,h,v,m)&&(h=null),m||v===null?y(l)&&(h===null?i.removeAttribute(l):i.setAttribute(l,""+h)):v.mustUseProperty?i[v.propertyName]=h===null?v.type===3?!1:"":h:(l=v.attributeName,m=v.attributeNamespace,h===null?i.removeAttribute(l):(v=v.type,h=v===3||v===4&&h===!0?"":""+h,m?i.setAttributeNS(m,l,h):i.setAttribute(l,h))))}var O=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,N=Symbol.for("react.element"),T=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),V=Symbol.for("react.strict_mode"),U=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),Z=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),he=Symbol.for("react.suspense"),G=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),ne=Symbol.for("react.lazy"),re=Symbol.for("react.offscreen"),J=Symbol.iterator;function ce(i){return i===null||typeof i!="object"?null:(i=J&&i[J]||i["@@iterator"],typeof i=="function"?i:null)}var A=Object.assign,M;function K(i){if(M===void 0)try{throw Error()}catch(h){var l=h.stack.trim().match(/\n( *(at )?)/);M=l&&l[1]||""}return`
|
|
2
|
+
`+M+i}var P=!1;function te(i,l){if(!i||P)return"";P=!0;var h=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(l)if(l=function(){throw Error()},Object.defineProperty(l.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(l,[])}catch(q){var m=q}Reflect.construct(i,[],l)}else{try{l.call()}catch(q){m=q}i.call(l.prototype)}else{try{throw Error()}catch(q){m=q}i()}}catch(q){if(q&&m&&typeof q.stack=="string"){for(var v=q.stack.split(`
|
|
3
|
+
`),_=m.stack.split(`
|
|
4
|
+
`),C=v.length-1,L=_.length-1;1<=C&&0<=L&&v[C]!==_[L];)L--;for(;1<=C&&0<=L;C--,L--)if(v[C]!==_[L]){if(C!==1||L!==1)do if(C--,L--,0>L||v[C]!==_[L]){var z=`
|
|
5
|
+
`+v[C].replace(" at new "," at ");return i.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",i.displayName)),z}while(1<=C&&0<=L);break}}}finally{P=!1,Error.prepareStackTrace=h}return(i=i?i.displayName||i.name:"")?K(i):""}function me(i){switch(i.tag){case 5:return K(i.type);case 16:return K("Lazy");case 13:return K("Suspense");case 19:return K("SuspenseList");case 0:case 2:case 15:return i=te(i.type,!1),i;case 11:return i=te(i.type.render,!1),i;case 1:return i=te(i.type,!0),i;default:return""}}function ye(i){if(i==null)return null;if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case I:return"Fragment";case T:return"Portal";case U:return"Profiler";case V:return"StrictMode";case he:return"Suspense";case G:return"SuspenseList"}if(typeof i=="object")switch(i.$$typeof){case Z:return(i.displayName||"Context")+".Consumer";case D:return(i._context.displayName||"Context")+".Provider";case Y:var l=i.render;return i=i.displayName,i||(i=l.displayName||l.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case W:return l=i.displayName||null,l!==null?l:ye(i.type)||"Memo";case ne:l=i._payload,i=i._init;try{return ye(i(l))}catch{}}return null}function Fe(i){var l=i.type;switch(i.tag){case 24:return"Cache";case 9:return(l.displayName||"Context")+".Consumer";case 10:return(l._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return i=l.render,i=i.displayName||i.name||"",l.displayName||(i!==""?"ForwardRef("+i+")":"ForwardRef");case 7:return"Fragment";case 5:return l;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ye(l);case 8:return l===V?"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 l=="function")return l.displayName||l.name||null;if(typeof l=="string")return l}return null}function Ae(i){switch(typeof i){case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Ie(i){var l=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(l==="checkbox"||l==="radio")}function Te(i){var l=Ie(i)?"checked":"value",h=Object.getOwnPropertyDescriptor(i.constructor.prototype,l),m=""+i[l];if(!i.hasOwnProperty(l)&&typeof h<"u"&&typeof h.get=="function"&&typeof h.set=="function"){var v=h.get,_=h.set;return Object.defineProperty(i,l,{configurable:!0,get:function(){return v.call(this)},set:function(C){m=""+C,_.call(this,C)}}),Object.defineProperty(i,l,{enumerable:h.enumerable}),{getValue:function(){return m},setValue:function(C){m=""+C},stopTracking:function(){i._valueTracker=null,delete i[l]}}}}function Je(i){i._valueTracker||(i._valueTracker=Te(i))}function et(i){if(!i)return!1;var l=i._valueTracker;if(!l)return!0;var h=l.getValue(),m="";return i&&(m=Ie(i)?i.checked?"true":"false":i.value),i=m,i!==h?(l.setValue(i),!0):!1}function Ce(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}function gt(i,l){var h=l.checked;return A({},l,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:h??i._wrapperState.initialChecked})}function X(i,l){var h=l.defaultValue==null?"":l.defaultValue,m=l.checked!=null?l.checked:l.defaultChecked;h=Ae(l.value!=null?l.value:h),i._wrapperState={initialChecked:m,initialValue:h,controlled:l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null}}function ke(i,l){l=l.checked,l!=null&&j(i,"checked",l,!1)}function ee(i,l){ke(i,l);var h=Ae(l.value),m=l.type;if(h!=null)m==="number"?(h===0&&i.value===""||i.value!=h)&&(i.value=""+h):i.value!==""+h&&(i.value=""+h);else if(m==="submit"||m==="reset"){i.removeAttribute("value");return}l.hasOwnProperty("value")?Se(i,l.type,h):l.hasOwnProperty("defaultValue")&&Se(i,l.type,Ae(l.defaultValue)),l.checked==null&&l.defaultChecked!=null&&(i.defaultChecked=!!l.defaultChecked)}function pe(i,l,h){if(l.hasOwnProperty("value")||l.hasOwnProperty("defaultValue")){var m=l.type;if(!(m!=="submit"&&m!=="reset"||l.value!==void 0&&l.value!==null))return;l=""+i._wrapperState.initialValue,h||l===i.value||(i.value=l),i.defaultValue=l}h=i.name,h!==""&&(i.name=""),i.defaultChecked=!!i._wrapperState.initialChecked,h!==""&&(i.name=h)}function Se(i,l,h){(l!=="number"||Ce(i.ownerDocument)!==i)&&(h==null?i.defaultValue=""+i._wrapperState.initialValue:i.defaultValue!==""+h&&(i.defaultValue=""+h))}var ve=Array.isArray;function Be(i,l,h,m){if(i=i.options,l){l={};for(var v=0;v<h.length;v++)l["$"+h[v]]=!0;for(h=0;h<i.length;h++)v=l.hasOwnProperty("$"+i[h].value),i[h].selected!==v&&(i[h].selected=v),v&&m&&(i[h].defaultSelected=!0)}else{for(h=""+Ae(h),l=null,v=0;v<i.length;v++){if(i[v].value===h){i[v].selected=!0,m&&(i[v].defaultSelected=!0);return}l!==null||i[v].disabled||(l=i[v])}l!==null&&(l.selected=!0)}}function we(i,l){if(l.dangerouslySetInnerHTML!=null)throw Error(n(91));return A({},l,{value:void 0,defaultValue:void 0,children:""+i._wrapperState.initialValue})}function nt(i,l){var h=l.value;if(h==null){if(h=l.children,l=l.defaultValue,h!=null){if(l!=null)throw Error(n(92));if(ve(h)){if(1<h.length)throw Error(n(93));h=h[0]}l=h}l==null&&(l=""),h=l}i._wrapperState={initialValue:Ae(h)}}function st(i,l){var h=Ae(l.value),m=Ae(l.defaultValue);h!=null&&(h=""+h,h!==i.value&&(i.value=h),l.defaultValue==null&&i.defaultValue!==h&&(i.defaultValue=h)),m!=null&&(i.defaultValue=""+m)}function it(i){var l=i.textContent;l===i._wrapperState.initialValue&&l!==""&&l!==null&&(i.value=l)}function Q(i){switch(i){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 le(i,l){return i==null||i==="http://www.w3.org/1999/xhtml"?Q(l):i==="http://www.w3.org/2000/svg"&&l==="foreignObject"?"http://www.w3.org/1999/xhtml":i}var _e,Ve=(function(i){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(l,h,m,v){MSApp.execUnsafeLocalFunction(function(){return i(l,h,m,v)})}:i})(function(i,l){if(i.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in i)i.innerHTML=l;else{for(_e=_e||document.createElement("div"),_e.innerHTML="<svg>"+l.valueOf().toString()+"</svg>",l=_e.firstChild;i.firstChild;)i.removeChild(i.firstChild);for(;l.firstChild;)i.appendChild(l.firstChild)}});function He(i,l){if(l){var h=i.firstChild;if(h&&h===i.lastChild&&h.nodeType===3){h.nodeValue=l;return}}i.textContent=l}var lt={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},$t=["Webkit","ms","Moz","O"];Object.keys(lt).forEach(function(i){$t.forEach(function(l){l=l+i.charAt(0).toUpperCase()+i.substring(1),lt[l]=lt[i]})});function Nt(i,l,h){return l==null||typeof l=="boolean"||l===""?"":h||typeof l!="number"||l===0||lt.hasOwnProperty(i)&<[i]?(""+l).trim():l+"px"}function cn(i,l){i=i.style;for(var h in l)if(l.hasOwnProperty(h)){var m=h.indexOf("--")===0,v=Nt(h,l[h],m);h==="float"&&(h="cssFloat"),m?i.setProperty(h,v):i[h]=v}}var tn=A({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 We(i,l){if(l){if(tn[i]&&(l.children!=null||l.dangerouslySetInnerHTML!=null))throw Error(n(137,i));if(l.dangerouslySetInnerHTML!=null){if(l.children!=null)throw Error(n(60));if(typeof l.dangerouslySetInnerHTML!="object"||!("__html"in l.dangerouslySetInnerHTML))throw Error(n(61))}if(l.style!=null&&typeof l.style!="object")throw Error(n(62))}}function un(i,l){if(i.indexOf("-")===-1)return typeof l.is=="string";switch(i){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 nn=null;function nu(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var ru=null,Bs=null,Vs=null;function rm(i){if(i=vo(i)){if(typeof ru!="function")throw Error(n(280));var l=i.stateNode;l&&(l=tl(l),ru(i.stateNode,i.type,l))}}function sm(i){Bs?Vs?Vs.push(i):Vs=[i]:Bs=i}function im(){if(Bs){var i=Bs,l=Vs;if(Vs=Bs=null,rm(i),l)for(i=0;i<l.length;i++)rm(l[i])}}function om(i,l){return i(l)}function am(){}var su=!1;function lm(i,l,h){if(su)return i(l,h);su=!0;try{return om(i,l,h)}finally{su=!1,(Bs!==null||Vs!==null)&&(am(),im())}}function Yi(i,l){var h=i.stateNode;if(h===null)return null;var m=tl(h);if(m===null)return null;h=m[l];e:switch(l){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(i=i.type,m=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!m;break e;default:i=!1}if(i)return null;if(h&&typeof h!="function")throw Error(n(231,l,typeof h));return h}var iu=!1;if(c)try{var Qi={};Object.defineProperty(Qi,"passive",{get:function(){iu=!0}}),window.addEventListener("test",Qi,Qi),window.removeEventListener("test",Qi,Qi)}catch{iu=!1}function o1(i,l,h,m,v,_,C,L,z){var q=Array.prototype.slice.call(arguments,3);try{l.apply(h,q)}catch(ie){this.onError(ie)}}var Zi=!1,Oa=null,La=!1,ou=null,a1={onError:function(i){Zi=!0,Oa=i}};function l1(i,l,h,m,v,_,C,L,z){Zi=!1,Oa=null,o1.apply(a1,arguments)}function c1(i,l,h,m,v,_,C,L,z){if(l1.apply(this,arguments),Zi){if(Zi){var q=Oa;Zi=!1,Oa=null}else throw Error(n(198));La||(La=!0,ou=q)}}function is(i){var l=i,h=i;if(i.alternate)for(;l.return;)l=l.return;else{i=l;do l=i,(l.flags&4098)!==0&&(h=l.return),i=l.return;while(i)}return l.tag===3?h:null}function cm(i){if(i.tag===13){var l=i.memoizedState;if(l===null&&(i=i.alternate,i!==null&&(l=i.memoizedState)),l!==null)return l.dehydrated}return null}function um(i){if(is(i)!==i)throw Error(n(188))}function u1(i){var l=i.alternate;if(!l){if(l=is(i),l===null)throw Error(n(188));return l!==i?null:i}for(var h=i,m=l;;){var v=h.return;if(v===null)break;var _=v.alternate;if(_===null){if(m=v.return,m!==null){h=m;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===h)return um(v),i;if(_===m)return um(v),l;_=_.sibling}throw Error(n(188))}if(h.return!==m.return)h=v,m=_;else{for(var C=!1,L=v.child;L;){if(L===h){C=!0,h=v,m=_;break}if(L===m){C=!0,m=v,h=_;break}L=L.sibling}if(!C){for(L=_.child;L;){if(L===h){C=!0,h=_,m=v;break}if(L===m){C=!0,m=_,h=v;break}L=L.sibling}if(!C)throw Error(n(189))}}if(h.alternate!==m)throw Error(n(190))}if(h.tag!==3)throw Error(n(188));return h.stateNode.current===h?i:l}function dm(i){return i=u1(i),i!==null?hm(i):null}function hm(i){if(i.tag===5||i.tag===6)return i;for(i=i.child;i!==null;){var l=hm(i);if(l!==null)return l;i=i.sibling}return null}var fm=t.unstable_scheduleCallback,pm=t.unstable_cancelCallback,d1=t.unstable_shouldYield,h1=t.unstable_requestPaint,St=t.unstable_now,f1=t.unstable_getCurrentPriorityLevel,au=t.unstable_ImmediatePriority,mm=t.unstable_UserBlockingPriority,Ia=t.unstable_NormalPriority,p1=t.unstable_LowPriority,gm=t.unstable_IdlePriority,Da=null,er=null;function m1(i){if(er&&typeof er.onCommitFiberRoot=="function")try{er.onCommitFiberRoot(Da,i,void 0,(i.current.flags&128)===128)}catch{}}var Un=Math.clz32?Math.clz32:x1,g1=Math.log,y1=Math.LN2;function x1(i){return i>>>=0,i===0?32:31-(g1(i)/y1|0)|0}var Ma=64,za=4194304;function eo(i){switch(i&-i){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 i&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return i&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return i}}function Fa(i,l){var h=i.pendingLanes;if(h===0)return 0;var m=0,v=i.suspendedLanes,_=i.pingedLanes,C=h&268435455;if(C!==0){var L=C&~v;L!==0?m=eo(L):(_&=C,_!==0&&(m=eo(_)))}else C=h&~v,C!==0?m=eo(C):_!==0&&(m=eo(_));if(m===0)return 0;if(l!==0&&l!==m&&(l&v)===0&&(v=m&-m,_=l&-l,v>=_||v===16&&(_&4194240)!==0))return l;if((m&4)!==0&&(m|=h&16),l=i.entangledLanes,l!==0)for(i=i.entanglements,l&=m;0<l;)h=31-Un(l),v=1<<h,m|=i[h],l&=~v;return m}function v1(i,l){switch(i){case 1:case 2:case 4:return l+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 l+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 _1(i,l){for(var h=i.suspendedLanes,m=i.pingedLanes,v=i.expirationTimes,_=i.pendingLanes;0<_;){var C=31-Un(_),L=1<<C,z=v[C];z===-1?((L&h)===0||(L&m)!==0)&&(v[C]=v1(L,l)):z<=l&&(i.expiredLanes|=L),_&=~L}}function lu(i){return i=i.pendingLanes&-1073741825,i!==0?i:i&1073741824?1073741824:0}function ym(){var i=Ma;return Ma<<=1,(Ma&4194240)===0&&(Ma=64),i}function cu(i){for(var l=[],h=0;31>h;h++)l.push(i);return l}function to(i,l,h){i.pendingLanes|=l,l!==536870912&&(i.suspendedLanes=0,i.pingedLanes=0),i=i.eventTimes,l=31-Un(l),i[l]=h}function b1(i,l){var h=i.pendingLanes&~l;i.pendingLanes=l,i.suspendedLanes=0,i.pingedLanes=0,i.expiredLanes&=l,i.mutableReadLanes&=l,i.entangledLanes&=l,l=i.entanglements;var m=i.eventTimes;for(i=i.expirationTimes;0<h;){var v=31-Un(h),_=1<<v;l[v]=0,m[v]=-1,i[v]=-1,h&=~_}}function uu(i,l){var h=i.entangledLanes|=l;for(i=i.entanglements;h;){var m=31-Un(h),v=1<<m;v&l|i[m]&l&&(i[m]|=l),h&=~v}}var ot=0;function xm(i){return i&=-i,1<i?4<i?(i&268435455)!==0?16:536870912:4:1}var vm,du,_m,bm,wm,hu=!1,$a=[],Tr=null,Ar=null,Rr=null,no=new Map,ro=new Map,Pr=[],w1="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 km(i,l){switch(i){case"focusin":case"focusout":Tr=null;break;case"dragenter":case"dragleave":Ar=null;break;case"mouseover":case"mouseout":Rr=null;break;case"pointerover":case"pointerout":no.delete(l.pointerId);break;case"gotpointercapture":case"lostpointercapture":ro.delete(l.pointerId)}}function so(i,l,h,m,v,_){return i===null||i.nativeEvent!==_?(i={blockedOn:l,domEventName:h,eventSystemFlags:m,nativeEvent:_,targetContainers:[v]},l!==null&&(l=vo(l),l!==null&&du(l)),i):(i.eventSystemFlags|=m,l=i.targetContainers,v!==null&&l.indexOf(v)===-1&&l.push(v),i)}function k1(i,l,h,m,v){switch(l){case"focusin":return Tr=so(Tr,i,l,h,m,v),!0;case"dragenter":return Ar=so(Ar,i,l,h,m,v),!0;case"mouseover":return Rr=so(Rr,i,l,h,m,v),!0;case"pointerover":var _=v.pointerId;return no.set(_,so(no.get(_)||null,i,l,h,m,v)),!0;case"gotpointercapture":return _=v.pointerId,ro.set(_,so(ro.get(_)||null,i,l,h,m,v)),!0}return!1}function Sm(i){var l=os(i.target);if(l!==null){var h=is(l);if(h!==null){if(l=h.tag,l===13){if(l=cm(h),l!==null){i.blockedOn=l,wm(i.priority,function(){_m(h)});return}}else if(l===3&&h.stateNode.current.memoizedState.isDehydrated){i.blockedOn=h.tag===3?h.stateNode.containerInfo:null;return}}}i.blockedOn=null}function Ua(i){if(i.blockedOn!==null)return!1;for(var l=i.targetContainers;0<l.length;){var h=pu(i.domEventName,i.eventSystemFlags,l[0],i.nativeEvent);if(h===null){h=i.nativeEvent;var m=new h.constructor(h.type,h);nn=m,h.target.dispatchEvent(m),nn=null}else return l=vo(h),l!==null&&du(l),i.blockedOn=h,!1;l.shift()}return!0}function jm(i,l,h){Ua(i)&&h.delete(l)}function S1(){hu=!1,Tr!==null&&Ua(Tr)&&(Tr=null),Ar!==null&&Ua(Ar)&&(Ar=null),Rr!==null&&Ua(Rr)&&(Rr=null),no.forEach(jm),ro.forEach(jm)}function io(i,l){i.blockedOn===l&&(i.blockedOn=null,hu||(hu=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,S1)))}function oo(i){function l(v){return io(v,i)}if(0<$a.length){io($a[0],i);for(var h=1;h<$a.length;h++){var m=$a[h];m.blockedOn===i&&(m.blockedOn=null)}}for(Tr!==null&&io(Tr,i),Ar!==null&&io(Ar,i),Rr!==null&&io(Rr,i),no.forEach(l),ro.forEach(l),h=0;h<Pr.length;h++)m=Pr[h],m.blockedOn===i&&(m.blockedOn=null);for(;0<Pr.length&&(h=Pr[0],h.blockedOn===null);)Sm(h),h.blockedOn===null&&Pr.shift()}var qs=O.ReactCurrentBatchConfig,Ba=!0;function j1(i,l,h,m){var v=ot,_=qs.transition;qs.transition=null;try{ot=1,fu(i,l,h,m)}finally{ot=v,qs.transition=_}}function E1(i,l,h,m){var v=ot,_=qs.transition;qs.transition=null;try{ot=4,fu(i,l,h,m)}finally{ot=v,qs.transition=_}}function fu(i,l,h,m){if(Ba){var v=pu(i,l,h,m);if(v===null)Ru(i,l,m,Va,h),km(i,m);else if(k1(v,i,l,h,m))m.stopPropagation();else if(km(i,m),l&4&&-1<w1.indexOf(i)){for(;v!==null;){var _=vo(v);if(_!==null&&vm(_),_=pu(i,l,h,m),_===null&&Ru(i,l,m,Va,h),_===v)break;v=_}v!==null&&m.stopPropagation()}else Ru(i,l,m,null,h)}}var Va=null;function pu(i,l,h,m){if(Va=null,i=nu(m),i=os(i),i!==null)if(l=is(i),l===null)i=null;else if(h=l.tag,h===13){if(i=cm(l),i!==null)return i;i=null}else if(h===3){if(l.stateNode.current.memoizedState.isDehydrated)return l.tag===3?l.stateNode.containerInfo:null;i=null}else l!==i&&(i=null);return Va=i,null}function Em(i){switch(i){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(f1()){case au:return 1;case mm:return 4;case Ia:case p1:return 16;case gm:return 536870912;default:return 16}default:return 16}}var Or=null,mu=null,qa=null;function Cm(){if(qa)return qa;var i,l=mu,h=l.length,m,v="value"in Or?Or.value:Or.textContent,_=v.length;for(i=0;i<h&&l[i]===v[i];i++);var C=h-i;for(m=1;m<=C&&l[h-m]===v[_-m];m++);return qa=v.slice(i,1<m?1-m:void 0)}function Ha(i){var l=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&l===13&&(i=13)):i=l,i===10&&(i=13),32<=i||i===13?i:0}function Ka(){return!0}function Nm(){return!1}function bn(i){function l(h,m,v,_,C){this._reactName=h,this._targetInst=v,this.type=m,this.nativeEvent=_,this.target=C,this.currentTarget=null;for(var L in i)i.hasOwnProperty(L)&&(h=i[L],this[L]=h?h(_):_[L]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Ka:Nm,this.isPropagationStopped=Nm,this}return A(l.prototype,{preventDefault:function(){this.defaultPrevented=!0;var h=this.nativeEvent;h&&(h.preventDefault?h.preventDefault():typeof h.returnValue!="unknown"&&(h.returnValue=!1),this.isDefaultPrevented=Ka)},stopPropagation:function(){var h=this.nativeEvent;h&&(h.stopPropagation?h.stopPropagation():typeof h.cancelBubble!="unknown"&&(h.cancelBubble=!0),this.isPropagationStopped=Ka)},persist:function(){},isPersistent:Ka}),l}var Hs={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},gu=bn(Hs),ao=A({},Hs,{view:0,detail:0}),C1=bn(ao),yu,xu,lo,Wa=A({},ao,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:_u,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==lo&&(lo&&i.type==="mousemove"?(yu=i.screenX-lo.screenX,xu=i.screenY-lo.screenY):xu=yu=0,lo=i),yu)},movementY:function(i){return"movementY"in i?i.movementY:xu}}),Tm=bn(Wa),N1=A({},Wa,{dataTransfer:0}),T1=bn(N1),A1=A({},ao,{relatedTarget:0}),vu=bn(A1),R1=A({},Hs,{animationName:0,elapsedTime:0,pseudoElement:0}),P1=bn(R1),O1=A({},Hs,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),L1=bn(O1),I1=A({},Hs,{data:0}),Am=bn(I1),D1={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},M1={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"},z1={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function F1(i){var l=this.nativeEvent;return l.getModifierState?l.getModifierState(i):(i=z1[i])?!!l[i]:!1}function _u(){return F1}var $1=A({},ao,{key:function(i){if(i.key){var l=D1[i.key]||i.key;if(l!=="Unidentified")return l}return i.type==="keypress"?(i=Ha(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?M1[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:_u,charCode:function(i){return i.type==="keypress"?Ha(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?Ha(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),U1=bn($1),B1=A({},Wa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Rm=bn(B1),V1=A({},ao,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:_u}),q1=bn(V1),H1=A({},Hs,{propertyName:0,elapsedTime:0,pseudoElement:0}),K1=bn(H1),W1=A({},Wa,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),G1=bn(W1),J1=[9,13,27,32],bu=c&&"CompositionEvent"in window,co=null;c&&"documentMode"in document&&(co=document.documentMode);var X1=c&&"TextEvent"in window&&!co,Pm=c&&(!bu||co&&8<co&&11>=co),Om=" ",Lm=!1;function Im(i,l){switch(i){case"keyup":return J1.indexOf(l.keyCode)!==-1;case"keydown":return l.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dm(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Ks=!1;function Y1(i,l){switch(i){case"compositionend":return Dm(l);case"keypress":return l.which!==32?null:(Lm=!0,Om);case"textInput":return i=l.data,i===Om&&Lm?null:i;default:return null}}function Q1(i,l){if(Ks)return i==="compositionend"||!bu&&Im(i,l)?(i=Cm(),qa=mu=Or=null,Ks=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(l.ctrlKey||l.altKey||l.metaKey)||l.ctrlKey&&l.altKey){if(l.char&&1<l.char.length)return l.char;if(l.which)return String.fromCharCode(l.which)}return null;case"compositionend":return Pm&&l.locale!=="ko"?null:l.data;default:return null}}var Z1={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 Mm(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l==="input"?!!Z1[i.type]:l==="textarea"}function zm(i,l,h,m){sm(m),l=Qa(l,"onChange"),0<l.length&&(h=new gu("onChange","change",null,h,m),i.push({event:h,listeners:l}))}var uo=null,ho=null;function eS(i){ng(i,0)}function Ga(i){var l=Ys(i);if(et(l))return i}function tS(i,l){if(i==="change")return l}var Fm=!1;if(c){var wu;if(c){var ku="oninput"in document;if(!ku){var $m=document.createElement("div");$m.setAttribute("oninput","return;"),ku=typeof $m.oninput=="function"}wu=ku}else wu=!1;Fm=wu&&(!document.documentMode||9<document.documentMode)}function Um(){uo&&(uo.detachEvent("onpropertychange",Bm),ho=uo=null)}function Bm(i){if(i.propertyName==="value"&&Ga(ho)){var l=[];zm(l,ho,i,nu(i)),lm(eS,l)}}function nS(i,l,h){i==="focusin"?(Um(),uo=l,ho=h,uo.attachEvent("onpropertychange",Bm)):i==="focusout"&&Um()}function rS(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return Ga(ho)}function sS(i,l){if(i==="click")return Ga(l)}function iS(i,l){if(i==="input"||i==="change")return Ga(l)}function oS(i,l){return i===l&&(i!==0||1/i===1/l)||i!==i&&l!==l}var Bn=typeof Object.is=="function"?Object.is:oS;function fo(i,l){if(Bn(i,l))return!0;if(typeof i!="object"||i===null||typeof l!="object"||l===null)return!1;var h=Object.keys(i),m=Object.keys(l);if(h.length!==m.length)return!1;for(m=0;m<h.length;m++){var v=h[m];if(!d.call(l,v)||!Bn(i[v],l[v]))return!1}return!0}function Vm(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function qm(i,l){var h=Vm(i);i=0;for(var m;h;){if(h.nodeType===3){if(m=i+h.textContent.length,i<=l&&m>=l)return{node:h,offset:l-i};i=m}e:{for(;h;){if(h.nextSibling){h=h.nextSibling;break e}h=h.parentNode}h=void 0}h=Vm(h)}}function Hm(i,l){return i&&l?i===l?!0:i&&i.nodeType===3?!1:l&&l.nodeType===3?Hm(i,l.parentNode):"contains"in i?i.contains(l):i.compareDocumentPosition?!!(i.compareDocumentPosition(l)&16):!1:!1}function Km(){for(var i=window,l=Ce();l instanceof i.HTMLIFrameElement;){try{var h=typeof l.contentWindow.location.href=="string"}catch{h=!1}if(h)i=l.contentWindow;else break;l=Ce(i.document)}return l}function Su(i){var l=i&&i.nodeName&&i.nodeName.toLowerCase();return l&&(l==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||l==="textarea"||i.contentEditable==="true")}function aS(i){var l=Km(),h=i.focusedElem,m=i.selectionRange;if(l!==h&&h&&h.ownerDocument&&Hm(h.ownerDocument.documentElement,h)){if(m!==null&&Su(h)){if(l=m.start,i=m.end,i===void 0&&(i=l),"selectionStart"in h)h.selectionStart=l,h.selectionEnd=Math.min(i,h.value.length);else if(i=(l=h.ownerDocument||document)&&l.defaultView||window,i.getSelection){i=i.getSelection();var v=h.textContent.length,_=Math.min(m.start,v);m=m.end===void 0?_:Math.min(m.end,v),!i.extend&&_>m&&(v=m,m=_,_=v),v=qm(h,_);var C=qm(h,m);v&&C&&(i.rangeCount!==1||i.anchorNode!==v.node||i.anchorOffset!==v.offset||i.focusNode!==C.node||i.focusOffset!==C.offset)&&(l=l.createRange(),l.setStart(v.node,v.offset),i.removeAllRanges(),_>m?(i.addRange(l),i.extend(C.node,C.offset)):(l.setEnd(C.node,C.offset),i.addRange(l)))}}for(l=[],i=h;i=i.parentNode;)i.nodeType===1&&l.push({element:i,left:i.scrollLeft,top:i.scrollTop});for(typeof h.focus=="function"&&h.focus(),h=0;h<l.length;h++)i=l[h],i.element.scrollLeft=i.left,i.element.scrollTop=i.top}}var lS=c&&"documentMode"in document&&11>=document.documentMode,Ws=null,ju=null,po=null,Eu=!1;function Wm(i,l,h){var m=h.window===h?h.document:h.nodeType===9?h:h.ownerDocument;Eu||Ws==null||Ws!==Ce(m)||(m=Ws,"selectionStart"in m&&Su(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),po&&fo(po,m)||(po=m,m=Qa(ju,"onSelect"),0<m.length&&(l=new gu("onSelect","select",null,l,h),i.push({event:l,listeners:m}),l.target=Ws)))}function Ja(i,l){var h={};return h[i.toLowerCase()]=l.toLowerCase(),h["Webkit"+i]="webkit"+l,h["Moz"+i]="moz"+l,h}var Gs={animationend:Ja("Animation","AnimationEnd"),animationiteration:Ja("Animation","AnimationIteration"),animationstart:Ja("Animation","AnimationStart"),transitionend:Ja("Transition","TransitionEnd")},Cu={},Gm={};c&&(Gm=document.createElement("div").style,"AnimationEvent"in window||(delete Gs.animationend.animation,delete Gs.animationiteration.animation,delete Gs.animationstart.animation),"TransitionEvent"in window||delete Gs.transitionend.transition);function Xa(i){if(Cu[i])return Cu[i];if(!Gs[i])return i;var l=Gs[i],h;for(h in l)if(l.hasOwnProperty(h)&&h in Gm)return Cu[i]=l[h];return i}var Jm=Xa("animationend"),Xm=Xa("animationiteration"),Ym=Xa("animationstart"),Qm=Xa("transitionend"),Zm=new Map,eg="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 Lr(i,l){Zm.set(i,l),o(l,[i])}for(var Nu=0;Nu<eg.length;Nu++){var Tu=eg[Nu],cS=Tu.toLowerCase(),uS=Tu[0].toUpperCase()+Tu.slice(1);Lr(cS,"on"+uS)}Lr(Jm,"onAnimationEnd"),Lr(Xm,"onAnimationIteration"),Lr(Ym,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(Qm,"onTransitionEnd"),a("onMouseEnter",["mouseout","mouseover"]),a("onMouseLeave",["mouseout","mouseover"]),a("onPointerEnter",["pointerout","pointerover"]),a("onPointerLeave",["pointerout","pointerover"]),o("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),o("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),o("onBeforeInput",["compositionend","keypress","textInput","paste"]),o("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),o("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var mo="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(" "),dS=new Set("cancel close invalid load scroll toggle".split(" ").concat(mo));function tg(i,l,h){var m=i.type||"unknown-event";i.currentTarget=h,c1(m,l,void 0,i),i.currentTarget=null}function ng(i,l){l=(l&4)!==0;for(var h=0;h<i.length;h++){var m=i[h],v=m.event;m=m.listeners;e:{var _=void 0;if(l)for(var C=m.length-1;0<=C;C--){var L=m[C],z=L.instance,q=L.currentTarget;if(L=L.listener,z!==_&&v.isPropagationStopped())break e;tg(v,L,q),_=z}else for(C=0;C<m.length;C++){if(L=m[C],z=L.instance,q=L.currentTarget,L=L.listener,z!==_&&v.isPropagationStopped())break e;tg(v,L,q),_=z}}}if(La)throw i=ou,La=!1,ou=null,i}function ht(i,l){var h=l[Mu];h===void 0&&(h=l[Mu]=new Set);var m=i+"__bubble";h.has(m)||(rg(l,i,2,!1),h.add(m))}function Au(i,l,h){var m=0;l&&(m|=4),rg(h,i,m,l)}var Ya="_reactListening"+Math.random().toString(36).slice(2);function go(i){if(!i[Ya]){i[Ya]=!0,r.forEach(function(h){h!=="selectionchange"&&(dS.has(h)||Au(h,!1,i),Au(h,!0,i))});var l=i.nodeType===9?i:i.ownerDocument;l===null||l[Ya]||(l[Ya]=!0,Au("selectionchange",!1,l))}}function rg(i,l,h,m){switch(Em(l)){case 1:var v=j1;break;case 4:v=E1;break;default:v=fu}h=v.bind(null,l,h,i),v=void 0,!iu||l!=="touchstart"&&l!=="touchmove"&&l!=="wheel"||(v=!0),m?v!==void 0?i.addEventListener(l,h,{capture:!0,passive:v}):i.addEventListener(l,h,!0):v!==void 0?i.addEventListener(l,h,{passive:v}):i.addEventListener(l,h,!1)}function Ru(i,l,h,m,v){var _=m;if((l&1)===0&&(l&2)===0&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var L=m.stateNode.containerInfo;if(L===v||L.nodeType===8&&L.parentNode===v)break;if(C===4)for(C=m.return;C!==null;){var z=C.tag;if((z===3||z===4)&&(z=C.stateNode.containerInfo,z===v||z.nodeType===8&&z.parentNode===v))return;C=C.return}for(;L!==null;){if(C=os(L),C===null)return;if(z=C.tag,z===5||z===6){m=_=C;continue e}L=L.parentNode}}m=m.return}lm(function(){var q=_,ie=nu(h),ae=[];e:{var se=Zm.get(i);if(se!==void 0){var ge=gu,be=i;switch(i){case"keypress":if(Ha(h)===0)break e;case"keydown":case"keyup":ge=U1;break;case"focusin":be="focus",ge=vu;break;case"focusout":be="blur",ge=vu;break;case"beforeblur":case"afterblur":ge=vu;break;case"click":if(h.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ge=Tm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ge=T1;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ge=q1;break;case Jm:case Xm:case Ym:ge=P1;break;case Qm:ge=K1;break;case"scroll":ge=C1;break;case"wheel":ge=G1;break;case"copy":case"cut":case"paste":ge=L1;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ge=Rm}var je=(l&4)!==0,jt=!je&&i==="scroll",$=je?se!==null?se+"Capture":null:se;je=[];for(var F=q,B;F!==null;){B=F;var de=B.stateNode;if(B.tag===5&&de!==null&&(B=de,$!==null&&(de=Yi(F,$),de!=null&&je.push(yo(F,de,B)))),jt)break;F=F.return}0<je.length&&(se=new ge(se,be,null,h,ie),ae.push({event:se,listeners:je}))}}if((l&7)===0){e:{if(se=i==="mouseover"||i==="pointerover",ge=i==="mouseout"||i==="pointerout",se&&h!==nn&&(be=h.relatedTarget||h.fromElement)&&(os(be)||be[hr]))break e;if((ge||se)&&(se=ie.window===ie?ie:(se=ie.ownerDocument)?se.defaultView||se.parentWindow:window,ge?(be=h.relatedTarget||h.toElement,ge=q,be=be?os(be):null,be!==null&&(jt=is(be),be!==jt||be.tag!==5&&be.tag!==6)&&(be=null)):(ge=null,be=q),ge!==be)){if(je=Tm,de="onMouseLeave",$="onMouseEnter",F="mouse",(i==="pointerout"||i==="pointerover")&&(je=Rm,de="onPointerLeave",$="onPointerEnter",F="pointer"),jt=ge==null?se:Ys(ge),B=be==null?se:Ys(be),se=new je(de,F+"leave",ge,h,ie),se.target=jt,se.relatedTarget=B,de=null,os(ie)===q&&(je=new je($,F+"enter",be,h,ie),je.target=B,je.relatedTarget=jt,de=je),jt=de,ge&&be)t:{for(je=ge,$=be,F=0,B=je;B;B=Js(B))F++;for(B=0,de=$;de;de=Js(de))B++;for(;0<F-B;)je=Js(je),F--;for(;0<B-F;)$=Js($),B--;for(;F--;){if(je===$||$!==null&&je===$.alternate)break t;je=Js(je),$=Js($)}je=null}else je=null;ge!==null&&sg(ae,se,ge,je,!1),be!==null&&jt!==null&&sg(ae,jt,be,je,!0)}}e:{if(se=q?Ys(q):window,ge=se.nodeName&&se.nodeName.toLowerCase(),ge==="select"||ge==="input"&&se.type==="file")var Ee=tS;else if(Mm(se))if(Fm)Ee=iS;else{Ee=rS;var Re=nS}else(ge=se.nodeName)&&ge.toLowerCase()==="input"&&(se.type==="checkbox"||se.type==="radio")&&(Ee=sS);if(Ee&&(Ee=Ee(i,q))){zm(ae,Ee,h,ie);break e}Re&&Re(i,se,q),i==="focusout"&&(Re=se._wrapperState)&&Re.controlled&&se.type==="number"&&Se(se,"number",se.value)}switch(Re=q?Ys(q):window,i){case"focusin":(Mm(Re)||Re.contentEditable==="true")&&(Ws=Re,ju=q,po=null);break;case"focusout":po=ju=Ws=null;break;case"mousedown":Eu=!0;break;case"contextmenu":case"mouseup":case"dragend":Eu=!1,Wm(ae,h,ie);break;case"selectionchange":if(lS)break;case"keydown":case"keyup":Wm(ae,h,ie)}var Pe;if(bu)e:{switch(i){case"compositionstart":var $e="onCompositionStart";break e;case"compositionend":$e="onCompositionEnd";break e;case"compositionupdate":$e="onCompositionUpdate";break e}$e=void 0}else Ks?Im(i,h)&&($e="onCompositionEnd"):i==="keydown"&&h.keyCode===229&&($e="onCompositionStart");$e&&(Pm&&h.locale!=="ko"&&(Ks||$e!=="onCompositionStart"?$e==="onCompositionEnd"&&Ks&&(Pe=Cm()):(Or=ie,mu="value"in Or?Or.value:Or.textContent,Ks=!0)),Re=Qa(q,$e),0<Re.length&&($e=new Am($e,i,null,h,ie),ae.push({event:$e,listeners:Re}),Pe?$e.data=Pe:(Pe=Dm(h),Pe!==null&&($e.data=Pe)))),(Pe=X1?Y1(i,h):Q1(i,h))&&(q=Qa(q,"onBeforeInput"),0<q.length&&(ie=new Am("onBeforeInput","beforeinput",null,h,ie),ae.push({event:ie,listeners:q}),ie.data=Pe))}ng(ae,l)})}function yo(i,l,h){return{instance:i,listener:l,currentTarget:h}}function Qa(i,l){for(var h=l+"Capture",m=[];i!==null;){var v=i,_=v.stateNode;v.tag===5&&_!==null&&(v=_,_=Yi(i,h),_!=null&&m.unshift(yo(i,_,v)),_=Yi(i,l),_!=null&&m.push(yo(i,_,v))),i=i.return}return m}function Js(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5);return i||null}function sg(i,l,h,m,v){for(var _=l._reactName,C=[];h!==null&&h!==m;){var L=h,z=L.alternate,q=L.stateNode;if(z!==null&&z===m)break;L.tag===5&&q!==null&&(L=q,v?(z=Yi(h,_),z!=null&&C.unshift(yo(h,z,L))):v||(z=Yi(h,_),z!=null&&C.push(yo(h,z,L)))),h=h.return}C.length!==0&&i.push({event:l,listeners:C})}var hS=/\r\n?/g,fS=/\u0000|\uFFFD/g;function ig(i){return(typeof i=="string"?i:""+i).replace(hS,`
|
|
6
|
+
`).replace(fS,"")}function Za(i,l,h){if(l=ig(l),ig(i)!==l&&h)throw Error(n(425))}function el(){}var Pu=null,Ou=null;function Lu(i,l){return i==="textarea"||i==="noscript"||typeof l.children=="string"||typeof l.children=="number"||typeof l.dangerouslySetInnerHTML=="object"&&l.dangerouslySetInnerHTML!==null&&l.dangerouslySetInnerHTML.__html!=null}var Iu=typeof setTimeout=="function"?setTimeout:void 0,pS=typeof clearTimeout=="function"?clearTimeout:void 0,og=typeof Promise=="function"?Promise:void 0,mS=typeof queueMicrotask=="function"?queueMicrotask:typeof og<"u"?function(i){return og.resolve(null).then(i).catch(gS)}:Iu;function gS(i){setTimeout(function(){throw i})}function Du(i,l){var h=l,m=0;do{var v=h.nextSibling;if(i.removeChild(h),v&&v.nodeType===8)if(h=v.data,h==="/$"){if(m===0){i.removeChild(v),oo(l);return}m--}else h!=="$"&&h!=="$?"&&h!=="$!"||m++;h=v}while(h);oo(l)}function Ir(i){for(;i!=null;i=i.nextSibling){var l=i.nodeType;if(l===1||l===3)break;if(l===8){if(l=i.data,l==="$"||l==="$!"||l==="$?")break;if(l==="/$")return null}}return i}function ag(i){i=i.previousSibling;for(var l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="$"||h==="$!"||h==="$?"){if(l===0)return i;l--}else h==="/$"&&l++}i=i.previousSibling}return null}var Xs=Math.random().toString(36).slice(2),tr="__reactFiber$"+Xs,xo="__reactProps$"+Xs,hr="__reactContainer$"+Xs,Mu="__reactEvents$"+Xs,yS="__reactListeners$"+Xs,xS="__reactHandles$"+Xs;function os(i){var l=i[tr];if(l)return l;for(var h=i.parentNode;h;){if(l=h[hr]||h[tr]){if(h=l.alternate,l.child!==null||h!==null&&h.child!==null)for(i=ag(i);i!==null;){if(h=i[tr])return h;i=ag(i)}return l}i=h,h=i.parentNode}return null}function vo(i){return i=i[tr]||i[hr],!i||i.tag!==5&&i.tag!==6&&i.tag!==13&&i.tag!==3?null:i}function Ys(i){if(i.tag===5||i.tag===6)return i.stateNode;throw Error(n(33))}function tl(i){return i[xo]||null}var zu=[],Qs=-1;function Dr(i){return{current:i}}function ft(i){0>Qs||(i.current=zu[Qs],zu[Qs]=null,Qs--)}function ct(i,l){Qs++,zu[Qs]=i.current,i.current=l}var Mr={},Kt=Dr(Mr),dn=Dr(!1),as=Mr;function Zs(i,l){var h=i.type.contextTypes;if(!h)return Mr;var m=i.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===l)return m.__reactInternalMemoizedMaskedChildContext;var v={},_;for(_ in h)v[_]=l[_];return m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=l,i.__reactInternalMemoizedMaskedChildContext=v),v}function hn(i){return i=i.childContextTypes,i!=null}function nl(){ft(dn),ft(Kt)}function lg(i,l,h){if(Kt.current!==Mr)throw Error(n(168));ct(Kt,l),ct(dn,h)}function cg(i,l,h){var m=i.stateNode;if(l=l.childContextTypes,typeof m.getChildContext!="function")return h;m=m.getChildContext();for(var v in m)if(!(v in l))throw Error(n(108,Fe(i)||"Unknown",v));return A({},h,m)}function rl(i){return i=(i=i.stateNode)&&i.__reactInternalMemoizedMergedChildContext||Mr,as=Kt.current,ct(Kt,i),ct(dn,dn.current),!0}function ug(i,l,h){var m=i.stateNode;if(!m)throw Error(n(169));h?(i=cg(i,l,as),m.__reactInternalMemoizedMergedChildContext=i,ft(dn),ft(Kt),ct(Kt,i)):ft(dn),ct(dn,h)}var fr=null,sl=!1,Fu=!1;function dg(i){fr===null?fr=[i]:fr.push(i)}function vS(i){sl=!0,dg(i)}function zr(){if(!Fu&&fr!==null){Fu=!0;var i=0,l=ot;try{var h=fr;for(ot=1;i<h.length;i++){var m=h[i];do m=m(!0);while(m!==null)}fr=null,sl=!1}catch(v){throw fr!==null&&(fr=fr.slice(i+1)),fm(au,zr),v}finally{ot=l,Fu=!1}}return null}var ei=[],ti=0,il=null,ol=0,Pn=[],On=0,ls=null,pr=1,mr="";function cs(i,l){ei[ti++]=ol,ei[ti++]=il,il=i,ol=l}function hg(i,l,h){Pn[On++]=pr,Pn[On++]=mr,Pn[On++]=ls,ls=i;var m=pr;i=mr;var v=32-Un(m)-1;m&=~(1<<v),h+=1;var _=32-Un(l)+v;if(30<_){var C=v-v%5;_=(m&(1<<C)-1).toString(32),m>>=C,v-=C,pr=1<<32-Un(l)+v|h<<v|m,mr=_+i}else pr=1<<_|h<<v|m,mr=i}function $u(i){i.return!==null&&(cs(i,1),hg(i,1,0))}function Uu(i){for(;i===il;)il=ei[--ti],ei[ti]=null,ol=ei[--ti],ei[ti]=null;for(;i===ls;)ls=Pn[--On],Pn[On]=null,mr=Pn[--On],Pn[On]=null,pr=Pn[--On],Pn[On]=null}var wn=null,kn=null,mt=!1,Vn=null;function fg(i,l){var h=Mn(5,null,null,0);h.elementType="DELETED",h.stateNode=l,h.return=i,l=i.deletions,l===null?(i.deletions=[h],i.flags|=16):l.push(h)}function pg(i,l){switch(i.tag){case 5:var h=i.type;return l=l.nodeType!==1||h.toLowerCase()!==l.nodeName.toLowerCase()?null:l,l!==null?(i.stateNode=l,wn=i,kn=Ir(l.firstChild),!0):!1;case 6:return l=i.pendingProps===""||l.nodeType!==3?null:l,l!==null?(i.stateNode=l,wn=i,kn=null,!0):!1;case 13:return l=l.nodeType!==8?null:l,l!==null?(h=ls!==null?{id:pr,overflow:mr}:null,i.memoizedState={dehydrated:l,treeContext:h,retryLane:1073741824},h=Mn(18,null,null,0),h.stateNode=l,h.return=i,i.child=h,wn=i,kn=null,!0):!1;default:return!1}}function Bu(i){return(i.mode&1)!==0&&(i.flags&128)===0}function Vu(i){if(mt){var l=kn;if(l){var h=l;if(!pg(i,l)){if(Bu(i))throw Error(n(418));l=Ir(h.nextSibling);var m=wn;l&&pg(i,l)?fg(m,h):(i.flags=i.flags&-4097|2,mt=!1,wn=i)}}else{if(Bu(i))throw Error(n(418));i.flags=i.flags&-4097|2,mt=!1,wn=i}}}function mg(i){for(i=i.return;i!==null&&i.tag!==5&&i.tag!==3&&i.tag!==13;)i=i.return;wn=i}function al(i){if(i!==wn)return!1;if(!mt)return mg(i),mt=!0,!1;var l;if((l=i.tag!==3)&&!(l=i.tag!==5)&&(l=i.type,l=l!=="head"&&l!=="body"&&!Lu(i.type,i.memoizedProps)),l&&(l=kn)){if(Bu(i))throw gg(),Error(n(418));for(;l;)fg(i,l),l=Ir(l.nextSibling)}if(mg(i),i.tag===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(n(317));e:{for(i=i.nextSibling,l=0;i;){if(i.nodeType===8){var h=i.data;if(h==="/$"){if(l===0){kn=Ir(i.nextSibling);break e}l--}else h!=="$"&&h!=="$!"&&h!=="$?"||l++}i=i.nextSibling}kn=null}}else kn=wn?Ir(i.stateNode.nextSibling):null;return!0}function gg(){for(var i=kn;i;)i=Ir(i.nextSibling)}function ni(){kn=wn=null,mt=!1}function qu(i){Vn===null?Vn=[i]:Vn.push(i)}var _S=O.ReactCurrentBatchConfig;function _o(i,l,h){if(i=h.ref,i!==null&&typeof i!="function"&&typeof i!="object"){if(h._owner){if(h=h._owner,h){if(h.tag!==1)throw Error(n(309));var m=h.stateNode}if(!m)throw Error(n(147,i));var v=m,_=""+i;return l!==null&&l.ref!==null&&typeof l.ref=="function"&&l.ref._stringRef===_?l.ref:(l=function(C){var L=v.refs;C===null?delete L[_]:L[_]=C},l._stringRef=_,l)}if(typeof i!="string")throw Error(n(284));if(!h._owner)throw Error(n(290,i))}return i}function ll(i,l){throw i=Object.prototype.toString.call(l),Error(n(31,i==="[object Object]"?"object with keys {"+Object.keys(l).join(", ")+"}":i))}function yg(i){var l=i._init;return l(i._payload)}function xg(i){function l($,F){if(i){var B=$.deletions;B===null?($.deletions=[F],$.flags|=16):B.push(F)}}function h($,F){if(!i)return null;for(;F!==null;)l($,F),F=F.sibling;return null}function m($,F){for($=new Map;F!==null;)F.key!==null?$.set(F.key,F):$.set(F.index,F),F=F.sibling;return $}function v($,F){return $=Kr($,F),$.index=0,$.sibling=null,$}function _($,F,B){return $.index=B,i?(B=$.alternate,B!==null?(B=B.index,B<F?($.flags|=2,F):B):($.flags|=2,F)):($.flags|=1048576,F)}function C($){return i&&$.alternate===null&&($.flags|=2),$}function L($,F,B,de){return F===null||F.tag!==6?(F=Id(B,$.mode,de),F.return=$,F):(F=v(F,B),F.return=$,F)}function z($,F,B,de){var Ee=B.type;return Ee===I?ie($,F,B.props.children,de,B.key):F!==null&&(F.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ne&&yg(Ee)===F.type)?(de=v(F,B.props),de.ref=_o($,F,B),de.return=$,de):(de=Pl(B.type,B.key,B.props,null,$.mode,de),de.ref=_o($,F,B),de.return=$,de)}function q($,F,B,de){return F===null||F.tag!==4||F.stateNode.containerInfo!==B.containerInfo||F.stateNode.implementation!==B.implementation?(F=Dd(B,$.mode,de),F.return=$,F):(F=v(F,B.children||[]),F.return=$,F)}function ie($,F,B,de,Ee){return F===null||F.tag!==7?(F=ys(B,$.mode,de,Ee),F.return=$,F):(F=v(F,B),F.return=$,F)}function ae($,F,B){if(typeof F=="string"&&F!==""||typeof F=="number")return F=Id(""+F,$.mode,B),F.return=$,F;if(typeof F=="object"&&F!==null){switch(F.$$typeof){case N:return B=Pl(F.type,F.key,F.props,null,$.mode,B),B.ref=_o($,null,F),B.return=$,B;case T:return F=Dd(F,$.mode,B),F.return=$,F;case ne:var de=F._init;return ae($,de(F._payload),B)}if(ve(F)||ce(F))return F=ys(F,$.mode,B,null),F.return=$,F;ll($,F)}return null}function se($,F,B,de){var Ee=F!==null?F.key:null;if(typeof B=="string"&&B!==""||typeof B=="number")return Ee!==null?null:L($,F,""+B,de);if(typeof B=="object"&&B!==null){switch(B.$$typeof){case N:return B.key===Ee?z($,F,B,de):null;case T:return B.key===Ee?q($,F,B,de):null;case ne:return Ee=B._init,se($,F,Ee(B._payload),de)}if(ve(B)||ce(B))return Ee!==null?null:ie($,F,B,de,null);ll($,B)}return null}function ge($,F,B,de,Ee){if(typeof de=="string"&&de!==""||typeof de=="number")return $=$.get(B)||null,L(F,$,""+de,Ee);if(typeof de=="object"&&de!==null){switch(de.$$typeof){case N:return $=$.get(de.key===null?B:de.key)||null,z(F,$,de,Ee);case T:return $=$.get(de.key===null?B:de.key)||null,q(F,$,de,Ee);case ne:var Re=de._init;return ge($,F,B,Re(de._payload),Ee)}if(ve(de)||ce(de))return $=$.get(B)||null,ie(F,$,de,Ee,null);ll(F,de)}return null}function be($,F,B,de){for(var Ee=null,Re=null,Pe=F,$e=F=0,zt=null;Pe!==null&&$e<B.length;$e++){Pe.index>$e?(zt=Pe,Pe=null):zt=Pe.sibling;var rt=se($,Pe,B[$e],de);if(rt===null){Pe===null&&(Pe=zt);break}i&&Pe&&rt.alternate===null&&l($,Pe),F=_(rt,F,$e),Re===null?Ee=rt:Re.sibling=rt,Re=rt,Pe=zt}if($e===B.length)return h($,Pe),mt&&cs($,$e),Ee;if(Pe===null){for(;$e<B.length;$e++)Pe=ae($,B[$e],de),Pe!==null&&(F=_(Pe,F,$e),Re===null?Ee=Pe:Re.sibling=Pe,Re=Pe);return mt&&cs($,$e),Ee}for(Pe=m($,Pe);$e<B.length;$e++)zt=ge(Pe,$,$e,B[$e],de),zt!==null&&(i&&zt.alternate!==null&&Pe.delete(zt.key===null?$e:zt.key),F=_(zt,F,$e),Re===null?Ee=zt:Re.sibling=zt,Re=zt);return i&&Pe.forEach(function(Wr){return l($,Wr)}),mt&&cs($,$e),Ee}function je($,F,B,de){var Ee=ce(B);if(typeof Ee!="function")throw Error(n(150));if(B=Ee.call(B),B==null)throw Error(n(151));for(var Re=Ee=null,Pe=F,$e=F=0,zt=null,rt=B.next();Pe!==null&&!rt.done;$e++,rt=B.next()){Pe.index>$e?(zt=Pe,Pe=null):zt=Pe.sibling;var Wr=se($,Pe,rt.value,de);if(Wr===null){Pe===null&&(Pe=zt);break}i&&Pe&&Wr.alternate===null&&l($,Pe),F=_(Wr,F,$e),Re===null?Ee=Wr:Re.sibling=Wr,Re=Wr,Pe=zt}if(rt.done)return h($,Pe),mt&&cs($,$e),Ee;if(Pe===null){for(;!rt.done;$e++,rt=B.next())rt=ae($,rt.value,de),rt!==null&&(F=_(rt,F,$e),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return mt&&cs($,$e),Ee}for(Pe=m($,Pe);!rt.done;$e++,rt=B.next())rt=ge(Pe,$,$e,rt.value,de),rt!==null&&(i&&rt.alternate!==null&&Pe.delete(rt.key===null?$e:rt.key),F=_(rt,F,$e),Re===null?Ee=rt:Re.sibling=rt,Re=rt);return i&&Pe.forEach(function(ZS){return l($,ZS)}),mt&&cs($,$e),Ee}function jt($,F,B,de){if(typeof B=="object"&&B!==null&&B.type===I&&B.key===null&&(B=B.props.children),typeof B=="object"&&B!==null){switch(B.$$typeof){case N:e:{for(var Ee=B.key,Re=F;Re!==null;){if(Re.key===Ee){if(Ee=B.type,Ee===I){if(Re.tag===7){h($,Re.sibling),F=v(Re,B.props.children),F.return=$,$=F;break e}}else if(Re.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===ne&&yg(Ee)===Re.type){h($,Re.sibling),F=v(Re,B.props),F.ref=_o($,Re,B),F.return=$,$=F;break e}h($,Re);break}else l($,Re);Re=Re.sibling}B.type===I?(F=ys(B.props.children,$.mode,de,B.key),F.return=$,$=F):(de=Pl(B.type,B.key,B.props,null,$.mode,de),de.ref=_o($,F,B),de.return=$,$=de)}return C($);case T:e:{for(Re=B.key;F!==null;){if(F.key===Re)if(F.tag===4&&F.stateNode.containerInfo===B.containerInfo&&F.stateNode.implementation===B.implementation){h($,F.sibling),F=v(F,B.children||[]),F.return=$,$=F;break e}else{h($,F);break}else l($,F);F=F.sibling}F=Dd(B,$.mode,de),F.return=$,$=F}return C($);case ne:return Re=B._init,jt($,F,Re(B._payload),de)}if(ve(B))return be($,F,B,de);if(ce(B))return je($,F,B,de);ll($,B)}return typeof B=="string"&&B!==""||typeof B=="number"?(B=""+B,F!==null&&F.tag===6?(h($,F.sibling),F=v(F,B),F.return=$,$=F):(h($,F),F=Id(B,$.mode,de),F.return=$,$=F),C($)):h($,F)}return jt}var ri=xg(!0),vg=xg(!1),cl=Dr(null),ul=null,si=null,Hu=null;function Ku(){Hu=si=ul=null}function Wu(i){var l=cl.current;ft(cl),i._currentValue=l}function Gu(i,l,h){for(;i!==null;){var m=i.alternate;if((i.childLanes&l)!==l?(i.childLanes|=l,m!==null&&(m.childLanes|=l)):m!==null&&(m.childLanes&l)!==l&&(m.childLanes|=l),i===h)break;i=i.return}}function ii(i,l){ul=i,Hu=si=null,i=i.dependencies,i!==null&&i.firstContext!==null&&((i.lanes&l)!==0&&(fn=!0),i.firstContext=null)}function Ln(i){var l=i._currentValue;if(Hu!==i)if(i={context:i,memoizedValue:l,next:null},si===null){if(ul===null)throw Error(n(308));si=i,ul.dependencies={lanes:0,firstContext:i}}else si=si.next=i;return l}var us=null;function Ju(i){us===null?us=[i]:us.push(i)}function _g(i,l,h,m){var v=l.interleaved;return v===null?(h.next=h,Ju(l)):(h.next=v.next,v.next=h),l.interleaved=h,gr(i,m)}function gr(i,l){i.lanes|=l;var h=i.alternate;for(h!==null&&(h.lanes|=l),h=i,i=i.return;i!==null;)i.childLanes|=l,h=i.alternate,h!==null&&(h.childLanes|=l),h=i,i=i.return;return h.tag===3?h.stateNode:null}var Fr=!1;function Xu(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function bg(i,l){i=i.updateQueue,l.updateQueue===i&&(l.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,effects:i.effects})}function yr(i,l){return{eventTime:i,lane:l,tag:0,payload:null,callback:null,next:null}}function $r(i,l,h){var m=i.updateQueue;if(m===null)return null;if(m=m.shared,(tt&2)!==0){var v=m.pending;return v===null?l.next=l:(l.next=v.next,v.next=l),m.pending=l,gr(i,h)}return v=m.interleaved,v===null?(l.next=l,Ju(m)):(l.next=v.next,v.next=l),m.interleaved=l,gr(i,h)}function dl(i,l,h){if(l=l.updateQueue,l!==null&&(l=l.shared,(h&4194240)!==0)){var m=l.lanes;m&=i.pendingLanes,h|=m,l.lanes=h,uu(i,h)}}function wg(i,l){var h=i.updateQueue,m=i.alternate;if(m!==null&&(m=m.updateQueue,h===m)){var v=null,_=null;if(h=h.firstBaseUpdate,h!==null){do{var C={eventTime:h.eventTime,lane:h.lane,tag:h.tag,payload:h.payload,callback:h.callback,next:null};_===null?v=_=C:_=_.next=C,h=h.next}while(h!==null);_===null?v=_=l:_=_.next=l}else v=_=l;h={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:m.shared,effects:m.effects},i.updateQueue=h;return}i=h.lastBaseUpdate,i===null?h.firstBaseUpdate=l:i.next=l,h.lastBaseUpdate=l}function hl(i,l,h,m){var v=i.updateQueue;Fr=!1;var _=v.firstBaseUpdate,C=v.lastBaseUpdate,L=v.shared.pending;if(L!==null){v.shared.pending=null;var z=L,q=z.next;z.next=null,C===null?_=q:C.next=q,C=z;var ie=i.alternate;ie!==null&&(ie=ie.updateQueue,L=ie.lastBaseUpdate,L!==C&&(L===null?ie.firstBaseUpdate=q:L.next=q,ie.lastBaseUpdate=z))}if(_!==null){var ae=v.baseState;C=0,ie=q=z=null,L=_;do{var se=L.lane,ge=L.eventTime;if((m&se)===se){ie!==null&&(ie=ie.next={eventTime:ge,lane:0,tag:L.tag,payload:L.payload,callback:L.callback,next:null});e:{var be=i,je=L;switch(se=l,ge=h,je.tag){case 1:if(be=je.payload,typeof be=="function"){ae=be.call(ge,ae,se);break e}ae=be;break e;case 3:be.flags=be.flags&-65537|128;case 0:if(be=je.payload,se=typeof be=="function"?be.call(ge,ae,se):be,se==null)break e;ae=A({},ae,se);break e;case 2:Fr=!0}}L.callback!==null&&L.lane!==0&&(i.flags|=64,se=v.effects,se===null?v.effects=[L]:se.push(L))}else ge={eventTime:ge,lane:se,tag:L.tag,payload:L.payload,callback:L.callback,next:null},ie===null?(q=ie=ge,z=ae):ie=ie.next=ge,C|=se;if(L=L.next,L===null){if(L=v.shared.pending,L===null)break;se=L,L=se.next,se.next=null,v.lastBaseUpdate=se,v.shared.pending=null}}while(!0);if(ie===null&&(z=ae),v.baseState=z,v.firstBaseUpdate=q,v.lastBaseUpdate=ie,l=v.shared.interleaved,l!==null){v=l;do C|=v.lane,v=v.next;while(v!==l)}else _===null&&(v.shared.lanes=0);fs|=C,i.lanes=C,i.memoizedState=ae}}function kg(i,l,h){if(i=l.effects,l.effects=null,i!==null)for(l=0;l<i.length;l++){var m=i[l],v=m.callback;if(v!==null){if(m.callback=null,m=h,typeof v!="function")throw Error(n(191,v));v.call(m)}}}var bo={},nr=Dr(bo),wo=Dr(bo),ko=Dr(bo);function ds(i){if(i===bo)throw Error(n(174));return i}function Yu(i,l){switch(ct(ko,l),ct(wo,i),ct(nr,bo),i=l.nodeType,i){case 9:case 11:l=(l=l.documentElement)?l.namespaceURI:le(null,"");break;default:i=i===8?l.parentNode:l,l=i.namespaceURI||null,i=i.tagName,l=le(l,i)}ft(nr),ct(nr,l)}function oi(){ft(nr),ft(wo),ft(ko)}function Sg(i){ds(ko.current);var l=ds(nr.current),h=le(l,i.type);l!==h&&(ct(wo,i),ct(nr,h))}function Qu(i){wo.current===i&&(ft(nr),ft(wo))}var yt=Dr(0);function fl(i){for(var l=i;l!==null;){if(l.tag===13){var h=l.memoizedState;if(h!==null&&(h=h.dehydrated,h===null||h.data==="$?"||h.data==="$!"))return l}else if(l.tag===19&&l.memoizedProps.revealOrder!==void 0){if((l.flags&128)!==0)return l}else if(l.child!==null){l.child.return=l,l=l.child;continue}if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return null;l=l.return}l.sibling.return=l.return,l=l.sibling}return null}var Zu=[];function ed(){for(var i=0;i<Zu.length;i++)Zu[i]._workInProgressVersionPrimary=null;Zu.length=0}var pl=O.ReactCurrentDispatcher,td=O.ReactCurrentBatchConfig,hs=0,xt=null,Pt=null,Dt=null,ml=!1,So=!1,jo=0,bS=0;function Wt(){throw Error(n(321))}function nd(i,l){if(l===null)return!1;for(var h=0;h<l.length&&h<i.length;h++)if(!Bn(i[h],l[h]))return!1;return!0}function rd(i,l,h,m,v,_){if(hs=_,xt=l,l.memoizedState=null,l.updateQueue=null,l.lanes=0,pl.current=i===null||i.memoizedState===null?jS:ES,i=h(m,v),So){_=0;do{if(So=!1,jo=0,25<=_)throw Error(n(301));_+=1,Dt=Pt=null,l.updateQueue=null,pl.current=CS,i=h(m,v)}while(So)}if(pl.current=xl,l=Pt!==null&&Pt.next!==null,hs=0,Dt=Pt=xt=null,ml=!1,l)throw Error(n(300));return i}function sd(){var i=jo!==0;return jo=0,i}function rr(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Dt===null?xt.memoizedState=Dt=i:Dt=Dt.next=i,Dt}function In(){if(Pt===null){var i=xt.alternate;i=i!==null?i.memoizedState:null}else i=Pt.next;var l=Dt===null?xt.memoizedState:Dt.next;if(l!==null)Dt=l,Pt=i;else{if(i===null)throw Error(n(310));Pt=i,i={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},Dt===null?xt.memoizedState=Dt=i:Dt=Dt.next=i}return Dt}function Eo(i,l){return typeof l=="function"?l(i):l}function id(i){var l=In(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var m=Pt,v=m.baseQueue,_=h.pending;if(_!==null){if(v!==null){var C=v.next;v.next=_.next,_.next=C}m.baseQueue=v=_,h.pending=null}if(v!==null){_=v.next,m=m.baseState;var L=C=null,z=null,q=_;do{var ie=q.lane;if((hs&ie)===ie)z!==null&&(z=z.next={lane:0,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null}),m=q.hasEagerState?q.eagerState:i(m,q.action);else{var ae={lane:ie,action:q.action,hasEagerState:q.hasEagerState,eagerState:q.eagerState,next:null};z===null?(L=z=ae,C=m):z=z.next=ae,xt.lanes|=ie,fs|=ie}q=q.next}while(q!==null&&q!==_);z===null?C=m:z.next=L,Bn(m,l.memoizedState)||(fn=!0),l.memoizedState=m,l.baseState=C,l.baseQueue=z,h.lastRenderedState=m}if(i=h.interleaved,i!==null){v=i;do _=v.lane,xt.lanes|=_,fs|=_,v=v.next;while(v!==i)}else v===null&&(h.lanes=0);return[l.memoizedState,h.dispatch]}function od(i){var l=In(),h=l.queue;if(h===null)throw Error(n(311));h.lastRenderedReducer=i;var m=h.dispatch,v=h.pending,_=l.memoizedState;if(v!==null){h.pending=null;var C=v=v.next;do _=i(_,C.action),C=C.next;while(C!==v);Bn(_,l.memoizedState)||(fn=!0),l.memoizedState=_,l.baseQueue===null&&(l.baseState=_),h.lastRenderedState=_}return[_,m]}function jg(){}function Eg(i,l){var h=xt,m=In(),v=l(),_=!Bn(m.memoizedState,v);if(_&&(m.memoizedState=v,fn=!0),m=m.queue,ad(Tg.bind(null,h,m,i),[i]),m.getSnapshot!==l||_||Dt!==null&&Dt.memoizedState.tag&1){if(h.flags|=2048,Co(9,Ng.bind(null,h,m,v,l),void 0,null),Mt===null)throw Error(n(349));(hs&30)!==0||Cg(h,l,v)}return v}function Cg(i,l,h){i.flags|=16384,i={getSnapshot:l,value:h},l=xt.updateQueue,l===null?(l={lastEffect:null,stores:null},xt.updateQueue=l,l.stores=[i]):(h=l.stores,h===null?l.stores=[i]:h.push(i))}function Ng(i,l,h,m){l.value=h,l.getSnapshot=m,Ag(l)&&Rg(i)}function Tg(i,l,h){return h(function(){Ag(l)&&Rg(i)})}function Ag(i){var l=i.getSnapshot;i=i.value;try{var h=l();return!Bn(i,h)}catch{return!0}}function Rg(i){var l=gr(i,1);l!==null&&Wn(l,i,1,-1)}function Pg(i){var l=rr();return typeof i=="function"&&(i=i()),l.memoizedState=l.baseState=i,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Eo,lastRenderedState:i},l.queue=i,i=i.dispatch=SS.bind(null,xt,i),[l.memoizedState,i]}function Co(i,l,h,m){return i={tag:i,create:l,destroy:h,deps:m,next:null},l=xt.updateQueue,l===null?(l={lastEffect:null,stores:null},xt.updateQueue=l,l.lastEffect=i.next=i):(h=l.lastEffect,h===null?l.lastEffect=i.next=i:(m=h.next,h.next=i,i.next=m,l.lastEffect=i)),i}function Og(){return In().memoizedState}function gl(i,l,h,m){var v=rr();xt.flags|=i,v.memoizedState=Co(1|l,h,void 0,m===void 0?null:m)}function yl(i,l,h,m){var v=In();m=m===void 0?null:m;var _=void 0;if(Pt!==null){var C=Pt.memoizedState;if(_=C.destroy,m!==null&&nd(m,C.deps)){v.memoizedState=Co(l,h,_,m);return}}xt.flags|=i,v.memoizedState=Co(1|l,h,_,m)}function Lg(i,l){return gl(8390656,8,i,l)}function ad(i,l){return yl(2048,8,i,l)}function Ig(i,l){return yl(4,2,i,l)}function Dg(i,l){return yl(4,4,i,l)}function Mg(i,l){if(typeof l=="function")return i=i(),l(i),function(){l(null)};if(l!=null)return i=i(),l.current=i,function(){l.current=null}}function zg(i,l,h){return h=h!=null?h.concat([i]):null,yl(4,4,Mg.bind(null,l,i),h)}function ld(){}function Fg(i,l){var h=In();l=l===void 0?null:l;var m=h.memoizedState;return m!==null&&l!==null&&nd(l,m[1])?m[0]:(h.memoizedState=[i,l],i)}function $g(i,l){var h=In();l=l===void 0?null:l;var m=h.memoizedState;return m!==null&&l!==null&&nd(l,m[1])?m[0]:(i=i(),h.memoizedState=[i,l],i)}function Ug(i,l,h){return(hs&21)===0?(i.baseState&&(i.baseState=!1,fn=!0),i.memoizedState=h):(Bn(h,l)||(h=ym(),xt.lanes|=h,fs|=h,i.baseState=!0),l)}function wS(i,l){var h=ot;ot=h!==0&&4>h?h:4,i(!0);var m=td.transition;td.transition={};try{i(!1),l()}finally{ot=h,td.transition=m}}function Bg(){return In().memoizedState}function kS(i,l,h){var m=qr(i);if(h={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null},Vg(i))qg(l,h);else if(h=_g(i,l,h,m),h!==null){var v=sn();Wn(h,i,m,v),Hg(h,l,m)}}function SS(i,l,h){var m=qr(i),v={lane:m,action:h,hasEagerState:!1,eagerState:null,next:null};if(Vg(i))qg(l,v);else{var _=i.alternate;if(i.lanes===0&&(_===null||_.lanes===0)&&(_=l.lastRenderedReducer,_!==null))try{var C=l.lastRenderedState,L=_(C,h);if(v.hasEagerState=!0,v.eagerState=L,Bn(L,C)){var z=l.interleaved;z===null?(v.next=v,Ju(l)):(v.next=z.next,z.next=v),l.interleaved=v;return}}catch{}h=_g(i,l,v,m),h!==null&&(v=sn(),Wn(h,i,m,v),Hg(h,l,m))}}function Vg(i){var l=i.alternate;return i===xt||l!==null&&l===xt}function qg(i,l){So=ml=!0;var h=i.pending;h===null?l.next=l:(l.next=h.next,h.next=l),i.pending=l}function Hg(i,l,h){if((h&4194240)!==0){var m=l.lanes;m&=i.pendingLanes,h|=m,l.lanes=h,uu(i,h)}}var xl={readContext:Ln,useCallback:Wt,useContext:Wt,useEffect:Wt,useImperativeHandle:Wt,useInsertionEffect:Wt,useLayoutEffect:Wt,useMemo:Wt,useReducer:Wt,useRef:Wt,useState:Wt,useDebugValue:Wt,useDeferredValue:Wt,useTransition:Wt,useMutableSource:Wt,useSyncExternalStore:Wt,useId:Wt,unstable_isNewReconciler:!1},jS={readContext:Ln,useCallback:function(i,l){return rr().memoizedState=[i,l===void 0?null:l],i},useContext:Ln,useEffect:Lg,useImperativeHandle:function(i,l,h){return h=h!=null?h.concat([i]):null,gl(4194308,4,Mg.bind(null,l,i),h)},useLayoutEffect:function(i,l){return gl(4194308,4,i,l)},useInsertionEffect:function(i,l){return gl(4,2,i,l)},useMemo:function(i,l){var h=rr();return l=l===void 0?null:l,i=i(),h.memoizedState=[i,l],i},useReducer:function(i,l,h){var m=rr();return l=h!==void 0?h(l):l,m.memoizedState=m.baseState=l,i={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:l},m.queue=i,i=i.dispatch=kS.bind(null,xt,i),[m.memoizedState,i]},useRef:function(i){var l=rr();return i={current:i},l.memoizedState=i},useState:Pg,useDebugValue:ld,useDeferredValue:function(i){return rr().memoizedState=i},useTransition:function(){var i=Pg(!1),l=i[0];return i=wS.bind(null,i[1]),rr().memoizedState=i,[l,i]},useMutableSource:function(){},useSyncExternalStore:function(i,l,h){var m=xt,v=rr();if(mt){if(h===void 0)throw Error(n(407));h=h()}else{if(h=l(),Mt===null)throw Error(n(349));(hs&30)!==0||Cg(m,l,h)}v.memoizedState=h;var _={value:h,getSnapshot:l};return v.queue=_,Lg(Tg.bind(null,m,_,i),[i]),m.flags|=2048,Co(9,Ng.bind(null,m,_,h,l),void 0,null),h},useId:function(){var i=rr(),l=Mt.identifierPrefix;if(mt){var h=mr,m=pr;h=(m&~(1<<32-Un(m)-1)).toString(32)+h,l=":"+l+"R"+h,h=jo++,0<h&&(l+="H"+h.toString(32)),l+=":"}else h=bS++,l=":"+l+"r"+h.toString(32)+":";return i.memoizedState=l},unstable_isNewReconciler:!1},ES={readContext:Ln,useCallback:Fg,useContext:Ln,useEffect:ad,useImperativeHandle:zg,useInsertionEffect:Ig,useLayoutEffect:Dg,useMemo:$g,useReducer:id,useRef:Og,useState:function(){return id(Eo)},useDebugValue:ld,useDeferredValue:function(i){var l=In();return Ug(l,Pt.memoizedState,i)},useTransition:function(){var i=id(Eo)[0],l=In().memoizedState;return[i,l]},useMutableSource:jg,useSyncExternalStore:Eg,useId:Bg,unstable_isNewReconciler:!1},CS={readContext:Ln,useCallback:Fg,useContext:Ln,useEffect:ad,useImperativeHandle:zg,useInsertionEffect:Ig,useLayoutEffect:Dg,useMemo:$g,useReducer:od,useRef:Og,useState:function(){return od(Eo)},useDebugValue:ld,useDeferredValue:function(i){var l=In();return Pt===null?l.memoizedState=i:Ug(l,Pt.memoizedState,i)},useTransition:function(){var i=od(Eo)[0],l=In().memoizedState;return[i,l]},useMutableSource:jg,useSyncExternalStore:Eg,useId:Bg,unstable_isNewReconciler:!1};function qn(i,l){if(i&&i.defaultProps){l=A({},l),i=i.defaultProps;for(var h in i)l[h]===void 0&&(l[h]=i[h]);return l}return l}function cd(i,l,h,m){l=i.memoizedState,h=h(m,l),h=h==null?l:A({},l,h),i.memoizedState=h,i.lanes===0&&(i.updateQueue.baseState=h)}var vl={isMounted:function(i){return(i=i._reactInternals)?is(i)===i:!1},enqueueSetState:function(i,l,h){i=i._reactInternals;var m=sn(),v=qr(i),_=yr(m,v);_.payload=l,h!=null&&(_.callback=h),l=$r(i,_,v),l!==null&&(Wn(l,i,v,m),dl(l,i,v))},enqueueReplaceState:function(i,l,h){i=i._reactInternals;var m=sn(),v=qr(i),_=yr(m,v);_.tag=1,_.payload=l,h!=null&&(_.callback=h),l=$r(i,_,v),l!==null&&(Wn(l,i,v,m),dl(l,i,v))},enqueueForceUpdate:function(i,l){i=i._reactInternals;var h=sn(),m=qr(i),v=yr(h,m);v.tag=2,l!=null&&(v.callback=l),l=$r(i,v,m),l!==null&&(Wn(l,i,m,h),dl(l,i,m))}};function Kg(i,l,h,m,v,_,C){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(m,_,C):l.prototype&&l.prototype.isPureReactComponent?!fo(h,m)||!fo(v,_):!0}function Wg(i,l,h){var m=!1,v=Mr,_=l.contextType;return typeof _=="object"&&_!==null?_=Ln(_):(v=hn(l)?as:Kt.current,m=l.contextTypes,_=(m=m!=null)?Zs(i,v):Mr),l=new l(h,_),i.memoizedState=l.state!==null&&l.state!==void 0?l.state:null,l.updater=vl,i.stateNode=l,l._reactInternals=i,m&&(i=i.stateNode,i.__reactInternalMemoizedUnmaskedChildContext=v,i.__reactInternalMemoizedMaskedChildContext=_),l}function Gg(i,l,h,m){i=l.state,typeof l.componentWillReceiveProps=="function"&&l.componentWillReceiveProps(h,m),typeof l.UNSAFE_componentWillReceiveProps=="function"&&l.UNSAFE_componentWillReceiveProps(h,m),l.state!==i&&vl.enqueueReplaceState(l,l.state,null)}function ud(i,l,h,m){var v=i.stateNode;v.props=h,v.state=i.memoizedState,v.refs={},Xu(i);var _=l.contextType;typeof _=="object"&&_!==null?v.context=Ln(_):(_=hn(l)?as:Kt.current,v.context=Zs(i,_)),v.state=i.memoizedState,_=l.getDerivedStateFromProps,typeof _=="function"&&(cd(i,l,_,h),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(l=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),l!==v.state&&vl.enqueueReplaceState(v,v.state,null),hl(i,h,v,m),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308)}function ai(i,l){try{var h="",m=l;do h+=me(m),m=m.return;while(m);var v=h}catch(_){v=`
|
|
7
|
+
Error generating stack: `+_.message+`
|
|
8
|
+
`+_.stack}return{value:i,source:l,stack:v,digest:null}}function dd(i,l,h){return{value:i,source:null,stack:h??null,digest:l??null}}function hd(i,l){try{console.error(l.value)}catch(h){setTimeout(function(){throw h})}}var NS=typeof WeakMap=="function"?WeakMap:Map;function Jg(i,l,h){h=yr(-1,h),h.tag=3,h.payload={element:null};var m=l.value;return h.callback=function(){El||(El=!0,Cd=m),hd(i,l)},h}function Xg(i,l,h){h=yr(-1,h),h.tag=3;var m=i.type.getDerivedStateFromError;if(typeof m=="function"){var v=l.value;h.payload=function(){return m(v)},h.callback=function(){hd(i,l)}}var _=i.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(h.callback=function(){hd(i,l),typeof m!="function"&&(Br===null?Br=new Set([this]):Br.add(this));var C=l.stack;this.componentDidCatch(l.value,{componentStack:C!==null?C:""})}),h}function Yg(i,l,h){var m=i.pingCache;if(m===null){m=i.pingCache=new NS;var v=new Set;m.set(l,v)}else v=m.get(l),v===void 0&&(v=new Set,m.set(l,v));v.has(h)||(v.add(h),i=BS.bind(null,i,l,h),l.then(i,i))}function Qg(i){do{var l;if((l=i.tag===13)&&(l=i.memoizedState,l=l!==null?l.dehydrated!==null:!0),l)return i;i=i.return}while(i!==null);return null}function Zg(i,l,h,m,v){return(i.mode&1)===0?(i===l?i.flags|=65536:(i.flags|=128,h.flags|=131072,h.flags&=-52805,h.tag===1&&(h.alternate===null?h.tag=17:(l=yr(-1,1),l.tag=2,$r(h,l,1))),h.lanes|=1),i):(i.flags|=65536,i.lanes=v,i)}var TS=O.ReactCurrentOwner,fn=!1;function rn(i,l,h,m){l.child=i===null?vg(l,null,h,m):ri(l,i.child,h,m)}function ey(i,l,h,m,v){h=h.render;var _=l.ref;return ii(l,v),m=rd(i,l,h,m,_,v),h=sd(),i!==null&&!fn?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~v,xr(i,l,v)):(mt&&h&&$u(l),l.flags|=1,rn(i,l,m,v),l.child)}function ty(i,l,h,m,v){if(i===null){var _=h.type;return typeof _=="function"&&!Ld(_)&&_.defaultProps===void 0&&h.compare===null&&h.defaultProps===void 0?(l.tag=15,l.type=_,ny(i,l,_,m,v)):(i=Pl(h.type,null,m,l,l.mode,v),i.ref=l.ref,i.return=l,l.child=i)}if(_=i.child,(i.lanes&v)===0){var C=_.memoizedProps;if(h=h.compare,h=h!==null?h:fo,h(C,m)&&i.ref===l.ref)return xr(i,l,v)}return l.flags|=1,i=Kr(_,m),i.ref=l.ref,i.return=l,l.child=i}function ny(i,l,h,m,v){if(i!==null){var _=i.memoizedProps;if(fo(_,m)&&i.ref===l.ref)if(fn=!1,l.pendingProps=m=_,(i.lanes&v)!==0)(i.flags&131072)!==0&&(fn=!0);else return l.lanes=i.lanes,xr(i,l,v)}return fd(i,l,h,m,v)}function ry(i,l,h){var m=l.pendingProps,v=m.children,_=i!==null?i.memoizedState:null;if(m.mode==="hidden")if((l.mode&1)===0)l.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(ci,Sn),Sn|=h;else{if((h&1073741824)===0)return i=_!==null?_.baseLanes|h:h,l.lanes=l.childLanes=1073741824,l.memoizedState={baseLanes:i,cachePool:null,transitions:null},l.updateQueue=null,ct(ci,Sn),Sn|=i,null;l.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=_!==null?_.baseLanes:h,ct(ci,Sn),Sn|=m}else _!==null?(m=_.baseLanes|h,l.memoizedState=null):m=h,ct(ci,Sn),Sn|=m;return rn(i,l,v,h),l.child}function sy(i,l){var h=l.ref;(i===null&&h!==null||i!==null&&i.ref!==h)&&(l.flags|=512,l.flags|=2097152)}function fd(i,l,h,m,v){var _=hn(h)?as:Kt.current;return _=Zs(l,_),ii(l,v),h=rd(i,l,h,m,_,v),m=sd(),i!==null&&!fn?(l.updateQueue=i.updateQueue,l.flags&=-2053,i.lanes&=~v,xr(i,l,v)):(mt&&m&&$u(l),l.flags|=1,rn(i,l,h,v),l.child)}function iy(i,l,h,m,v){if(hn(h)){var _=!0;rl(l)}else _=!1;if(ii(l,v),l.stateNode===null)bl(i,l),Wg(l,h,m),ud(l,h,m,v),m=!0;else if(i===null){var C=l.stateNode,L=l.memoizedProps;C.props=L;var z=C.context,q=h.contextType;typeof q=="object"&&q!==null?q=Ln(q):(q=hn(h)?as:Kt.current,q=Zs(l,q));var ie=h.getDerivedStateFromProps,ae=typeof ie=="function"||typeof C.getSnapshotBeforeUpdate=="function";ae||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==m||z!==q)&&Gg(l,C,m,q),Fr=!1;var se=l.memoizedState;C.state=se,hl(l,m,C,v),z=l.memoizedState,L!==m||se!==z||dn.current||Fr?(typeof ie=="function"&&(cd(l,h,ie,m),z=l.memoizedState),(L=Fr||Kg(l,h,L,m,se,z,q))?(ae||typeof C.UNSAFE_componentWillMount!="function"&&typeof C.componentWillMount!="function"||(typeof C.componentWillMount=="function"&&C.componentWillMount(),typeof C.UNSAFE_componentWillMount=="function"&&C.UNSAFE_componentWillMount()),typeof C.componentDidMount=="function"&&(l.flags|=4194308)):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),l.memoizedProps=m,l.memoizedState=z),C.props=m,C.state=z,C.context=q,m=L):(typeof C.componentDidMount=="function"&&(l.flags|=4194308),m=!1)}else{C=l.stateNode,bg(i,l),L=l.memoizedProps,q=l.type===l.elementType?L:qn(l.type,L),C.props=q,ae=l.pendingProps,se=C.context,z=h.contextType,typeof z=="object"&&z!==null?z=Ln(z):(z=hn(h)?as:Kt.current,z=Zs(l,z));var ge=h.getDerivedStateFromProps;(ie=typeof ge=="function"||typeof C.getSnapshotBeforeUpdate=="function")||typeof C.UNSAFE_componentWillReceiveProps!="function"&&typeof C.componentWillReceiveProps!="function"||(L!==ae||se!==z)&&Gg(l,C,m,z),Fr=!1,se=l.memoizedState,C.state=se,hl(l,m,C,v);var be=l.memoizedState;L!==ae||se!==be||dn.current||Fr?(typeof ge=="function"&&(cd(l,h,ge,m),be=l.memoizedState),(q=Fr||Kg(l,h,q,m,se,be,z)||!1)?(ie||typeof C.UNSAFE_componentWillUpdate!="function"&&typeof C.componentWillUpdate!="function"||(typeof C.componentWillUpdate=="function"&&C.componentWillUpdate(m,be,z),typeof C.UNSAFE_componentWillUpdate=="function"&&C.UNSAFE_componentWillUpdate(m,be,z)),typeof C.componentDidUpdate=="function"&&(l.flags|=4),typeof C.getSnapshotBeforeUpdate=="function"&&(l.flags|=1024)):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&se===i.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&se===i.memoizedState||(l.flags|=1024),l.memoizedProps=m,l.memoizedState=be),C.props=m,C.state=be,C.context=z,m=q):(typeof C.componentDidUpdate!="function"||L===i.memoizedProps&&se===i.memoizedState||(l.flags|=4),typeof C.getSnapshotBeforeUpdate!="function"||L===i.memoizedProps&&se===i.memoizedState||(l.flags|=1024),m=!1)}return pd(i,l,h,m,_,v)}function pd(i,l,h,m,v,_){sy(i,l);var C=(l.flags&128)!==0;if(!m&&!C)return v&&ug(l,h,!1),xr(i,l,_);m=l.stateNode,TS.current=l;var L=C&&typeof h.getDerivedStateFromError!="function"?null:m.render();return l.flags|=1,i!==null&&C?(l.child=ri(l,i.child,null,_),l.child=ri(l,null,L,_)):rn(i,l,L,_),l.memoizedState=m.state,v&&ug(l,h,!0),l.child}function oy(i){var l=i.stateNode;l.pendingContext?lg(i,l.pendingContext,l.pendingContext!==l.context):l.context&&lg(i,l.context,!1),Yu(i,l.containerInfo)}function ay(i,l,h,m,v){return ni(),qu(v),l.flags|=256,rn(i,l,h,m),l.child}var md={dehydrated:null,treeContext:null,retryLane:0};function gd(i){return{baseLanes:i,cachePool:null,transitions:null}}function ly(i,l,h){var m=l.pendingProps,v=yt.current,_=!1,C=(l.flags&128)!==0,L;if((L=C)||(L=i!==null&&i.memoizedState===null?!1:(v&2)!==0),L?(_=!0,l.flags&=-129):(i===null||i.memoizedState!==null)&&(v|=1),ct(yt,v&1),i===null)return Vu(l),i=l.memoizedState,i!==null&&(i=i.dehydrated,i!==null)?((l.mode&1)===0?l.lanes=1:i.data==="$!"?l.lanes=8:l.lanes=1073741824,null):(C=m.children,i=m.fallback,_?(m=l.mode,_=l.child,C={mode:"hidden",children:C},(m&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=C):_=Ol(C,m,0,null),i=ys(i,m,h,null),_.return=l,i.return=l,_.sibling=i,l.child=_,l.child.memoizedState=gd(h),l.memoizedState=md,i):yd(l,C));if(v=i.memoizedState,v!==null&&(L=v.dehydrated,L!==null))return AS(i,l,C,m,L,v,h);if(_){_=m.fallback,C=l.mode,v=i.child,L=v.sibling;var z={mode:"hidden",children:m.children};return(C&1)===0&&l.child!==v?(m=l.child,m.childLanes=0,m.pendingProps=z,l.deletions=null):(m=Kr(v,z),m.subtreeFlags=v.subtreeFlags&14680064),L!==null?_=Kr(L,_):(_=ys(_,C,h,null),_.flags|=2),_.return=l,m.return=l,m.sibling=_,l.child=m,m=_,_=l.child,C=i.child.memoizedState,C=C===null?gd(h):{baseLanes:C.baseLanes|h,cachePool:null,transitions:C.transitions},_.memoizedState=C,_.childLanes=i.childLanes&~h,l.memoizedState=md,m}return _=i.child,i=_.sibling,m=Kr(_,{mode:"visible",children:m.children}),(l.mode&1)===0&&(m.lanes=h),m.return=l,m.sibling=null,i!==null&&(h=l.deletions,h===null?(l.deletions=[i],l.flags|=16):h.push(i)),l.child=m,l.memoizedState=null,m}function yd(i,l){return l=Ol({mode:"visible",children:l},i.mode,0,null),l.return=i,i.child=l}function _l(i,l,h,m){return m!==null&&qu(m),ri(l,i.child,null,h),i=yd(l,l.pendingProps.children),i.flags|=2,l.memoizedState=null,i}function AS(i,l,h,m,v,_,C){if(h)return l.flags&256?(l.flags&=-257,m=dd(Error(n(422))),_l(i,l,C,m)):l.memoizedState!==null?(l.child=i.child,l.flags|=128,null):(_=m.fallback,v=l.mode,m=Ol({mode:"visible",children:m.children},v,0,null),_=ys(_,v,C,null),_.flags|=2,m.return=l,_.return=l,m.sibling=_,l.child=m,(l.mode&1)!==0&&ri(l,i.child,null,C),l.child.memoizedState=gd(C),l.memoizedState=md,_);if((l.mode&1)===0)return _l(i,l,C,null);if(v.data==="$!"){if(m=v.nextSibling&&v.nextSibling.dataset,m)var L=m.dgst;return m=L,_=Error(n(419)),m=dd(_,m,void 0),_l(i,l,C,m)}if(L=(C&i.childLanes)!==0,fn||L){if(m=Mt,m!==null){switch(C&-C){case 4:v=2;break;case 16:v=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:v=32;break;case 536870912:v=268435456;break;default:v=0}v=(v&(m.suspendedLanes|C))!==0?0:v,v!==0&&v!==_.retryLane&&(_.retryLane=v,gr(i,v),Wn(m,i,v,-1))}return Od(),m=dd(Error(n(421))),_l(i,l,C,m)}return v.data==="$?"?(l.flags|=128,l.child=i.child,l=VS.bind(null,i),v._reactRetry=l,null):(i=_.treeContext,kn=Ir(v.nextSibling),wn=l,mt=!0,Vn=null,i!==null&&(Pn[On++]=pr,Pn[On++]=mr,Pn[On++]=ls,pr=i.id,mr=i.overflow,ls=l),l=yd(l,m.children),l.flags|=4096,l)}function cy(i,l,h){i.lanes|=l;var m=i.alternate;m!==null&&(m.lanes|=l),Gu(i.return,l,h)}function xd(i,l,h,m,v){var _=i.memoizedState;_===null?i.memoizedState={isBackwards:l,rendering:null,renderingStartTime:0,last:m,tail:h,tailMode:v}:(_.isBackwards=l,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=h,_.tailMode=v)}function uy(i,l,h){var m=l.pendingProps,v=m.revealOrder,_=m.tail;if(rn(i,l,m.children,h),m=yt.current,(m&2)!==0)m=m&1|2,l.flags|=128;else{if(i!==null&&(i.flags&128)!==0)e:for(i=l.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&cy(i,h,l);else if(i.tag===19)cy(i,h,l);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===l)break e;for(;i.sibling===null;){if(i.return===null||i.return===l)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}m&=1}if(ct(yt,m),(l.mode&1)===0)l.memoizedState=null;else switch(v){case"forwards":for(h=l.child,v=null;h!==null;)i=h.alternate,i!==null&&fl(i)===null&&(v=h),h=h.sibling;h=v,h===null?(v=l.child,l.child=null):(v=h.sibling,h.sibling=null),xd(l,!1,v,h,_);break;case"backwards":for(h=null,v=l.child,l.child=null;v!==null;){if(i=v.alternate,i!==null&&fl(i)===null){l.child=v;break}i=v.sibling,v.sibling=h,h=v,v=i}xd(l,!0,h,null,_);break;case"together":xd(l,!1,null,null,void 0);break;default:l.memoizedState=null}return l.child}function bl(i,l){(l.mode&1)===0&&i!==null&&(i.alternate=null,l.alternate=null,l.flags|=2)}function xr(i,l,h){if(i!==null&&(l.dependencies=i.dependencies),fs|=l.lanes,(h&l.childLanes)===0)return null;if(i!==null&&l.child!==i.child)throw Error(n(153));if(l.child!==null){for(i=l.child,h=Kr(i,i.pendingProps),l.child=h,h.return=l;i.sibling!==null;)i=i.sibling,h=h.sibling=Kr(i,i.pendingProps),h.return=l;h.sibling=null}return l.child}function RS(i,l,h){switch(l.tag){case 3:oy(l),ni();break;case 5:Sg(l);break;case 1:hn(l.type)&&rl(l);break;case 4:Yu(l,l.stateNode.containerInfo);break;case 10:var m=l.type._context,v=l.memoizedProps.value;ct(cl,m._currentValue),m._currentValue=v;break;case 13:if(m=l.memoizedState,m!==null)return m.dehydrated!==null?(ct(yt,yt.current&1),l.flags|=128,null):(h&l.child.childLanes)!==0?ly(i,l,h):(ct(yt,yt.current&1),i=xr(i,l,h),i!==null?i.sibling:null);ct(yt,yt.current&1);break;case 19:if(m=(h&l.childLanes)!==0,(i.flags&128)!==0){if(m)return uy(i,l,h);l.flags|=128}if(v=l.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),ct(yt,yt.current),m)break;return null;case 22:case 23:return l.lanes=0,ry(i,l,h)}return xr(i,l,h)}var dy,vd,hy,fy;dy=function(i,l){for(var h=l.child;h!==null;){if(h.tag===5||h.tag===6)i.appendChild(h.stateNode);else if(h.tag!==4&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===l)break;for(;h.sibling===null;){if(h.return===null||h.return===l)return;h=h.return}h.sibling.return=h.return,h=h.sibling}},vd=function(){},hy=function(i,l,h,m){var v=i.memoizedProps;if(v!==m){i=l.stateNode,ds(nr.current);var _=null;switch(h){case"input":v=gt(i,v),m=gt(i,m),_=[];break;case"select":v=A({},v,{value:void 0}),m=A({},m,{value:void 0}),_=[];break;case"textarea":v=we(i,v),m=we(i,m),_=[];break;default:typeof v.onClick!="function"&&typeof m.onClick=="function"&&(i.onclick=el)}We(h,m);var C;h=null;for(q in v)if(!m.hasOwnProperty(q)&&v.hasOwnProperty(q)&&v[q]!=null)if(q==="style"){var L=v[q];for(C in L)L.hasOwnProperty(C)&&(h||(h={}),h[C]="")}else q!=="dangerouslySetInnerHTML"&&q!=="children"&&q!=="suppressContentEditableWarning"&&q!=="suppressHydrationWarning"&&q!=="autoFocus"&&(s.hasOwnProperty(q)?_||(_=[]):(_=_||[]).push(q,null));for(q in m){var z=m[q];if(L=v?.[q],m.hasOwnProperty(q)&&z!==L&&(z!=null||L!=null))if(q==="style")if(L){for(C in L)!L.hasOwnProperty(C)||z&&z.hasOwnProperty(C)||(h||(h={}),h[C]="");for(C in z)z.hasOwnProperty(C)&&L[C]!==z[C]&&(h||(h={}),h[C]=z[C])}else h||(_||(_=[]),_.push(q,h)),h=z;else q==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,L=L?L.__html:void 0,z!=null&&L!==z&&(_=_||[]).push(q,z)):q==="children"?typeof z!="string"&&typeof z!="number"||(_=_||[]).push(q,""+z):q!=="suppressContentEditableWarning"&&q!=="suppressHydrationWarning"&&(s.hasOwnProperty(q)?(z!=null&&q==="onScroll"&&ht("scroll",i),_||L===z||(_=[])):(_=_||[]).push(q,z))}h&&(_=_||[]).push("style",h);var q=_;(l.updateQueue=q)&&(l.flags|=4)}},fy=function(i,l,h,m){h!==m&&(l.flags|=4)};function No(i,l){if(!mt)switch(i.tailMode){case"hidden":l=i.tail;for(var h=null;l!==null;)l.alternate!==null&&(h=l),l=l.sibling;h===null?i.tail=null:h.sibling=null;break;case"collapsed":h=i.tail;for(var m=null;h!==null;)h.alternate!==null&&(m=h),h=h.sibling;m===null?l||i.tail===null?i.tail=null:i.tail.sibling=null:m.sibling=null}}function Gt(i){var l=i.alternate!==null&&i.alternate.child===i.child,h=0,m=0;if(l)for(var v=i.child;v!==null;)h|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=i,v=v.sibling;else for(v=i.child;v!==null;)h|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=i,v=v.sibling;return i.subtreeFlags|=m,i.childLanes=h,l}function PS(i,l,h){var m=l.pendingProps;switch(Uu(l),l.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Gt(l),null;case 1:return hn(l.type)&&nl(),Gt(l),null;case 3:return m=l.stateNode,oi(),ft(dn),ft(Kt),ed(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(i===null||i.child===null)&&(al(l)?l.flags|=4:i===null||i.memoizedState.isDehydrated&&(l.flags&256)===0||(l.flags|=1024,Vn!==null&&(Ad(Vn),Vn=null))),vd(i,l),Gt(l),null;case 5:Qu(l);var v=ds(ko.current);if(h=l.type,i!==null&&l.stateNode!=null)hy(i,l,h,m,v),i.ref!==l.ref&&(l.flags|=512,l.flags|=2097152);else{if(!m){if(l.stateNode===null)throw Error(n(166));return Gt(l),null}if(i=ds(nr.current),al(l)){m=l.stateNode,h=l.type;var _=l.memoizedProps;switch(m[tr]=l,m[xo]=_,i=(l.mode&1)!==0,h){case"dialog":ht("cancel",m),ht("close",m);break;case"iframe":case"object":case"embed":ht("load",m);break;case"video":case"audio":for(v=0;v<mo.length;v++)ht(mo[v],m);break;case"source":ht("error",m);break;case"img":case"image":case"link":ht("error",m),ht("load",m);break;case"details":ht("toggle",m);break;case"input":X(m,_),ht("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!_.multiple},ht("invalid",m);break;case"textarea":nt(m,_),ht("invalid",m)}We(h,_),v=null;for(var C in _)if(_.hasOwnProperty(C)){var L=_[C];C==="children"?typeof L=="string"?m.textContent!==L&&(_.suppressHydrationWarning!==!0&&Za(m.textContent,L,i),v=["children",L]):typeof L=="number"&&m.textContent!==""+L&&(_.suppressHydrationWarning!==!0&&Za(m.textContent,L,i),v=["children",""+L]):s.hasOwnProperty(C)&&L!=null&&C==="onScroll"&&ht("scroll",m)}switch(h){case"input":Je(m),pe(m,_,!0);break;case"textarea":Je(m),it(m);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(m.onclick=el)}m=v,l.updateQueue=m,m!==null&&(l.flags|=4)}else{C=v.nodeType===9?v:v.ownerDocument,i==="http://www.w3.org/1999/xhtml"&&(i=Q(h)),i==="http://www.w3.org/1999/xhtml"?h==="script"?(i=C.createElement("div"),i.innerHTML="<script><\/script>",i=i.removeChild(i.firstChild)):typeof m.is=="string"?i=C.createElement(h,{is:m.is}):(i=C.createElement(h),h==="select"&&(C=i,m.multiple?C.multiple=!0:m.size&&(C.size=m.size))):i=C.createElementNS(i,h),i[tr]=l,i[xo]=m,dy(i,l,!1,!1),l.stateNode=i;e:{switch(C=un(h,m),h){case"dialog":ht("cancel",i),ht("close",i),v=m;break;case"iframe":case"object":case"embed":ht("load",i),v=m;break;case"video":case"audio":for(v=0;v<mo.length;v++)ht(mo[v],i);v=m;break;case"source":ht("error",i),v=m;break;case"img":case"image":case"link":ht("error",i),ht("load",i),v=m;break;case"details":ht("toggle",i),v=m;break;case"input":X(i,m),v=gt(i,m),ht("invalid",i);break;case"option":v=m;break;case"select":i._wrapperState={wasMultiple:!!m.multiple},v=A({},m,{value:void 0}),ht("invalid",i);break;case"textarea":nt(i,m),v=we(i,m),ht("invalid",i);break;default:v=m}We(h,v),L=v;for(_ in L)if(L.hasOwnProperty(_)){var z=L[_];_==="style"?cn(i,z):_==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&Ve(i,z)):_==="children"?typeof z=="string"?(h!=="textarea"||z!=="")&&He(i,z):typeof z=="number"&&He(i,""+z):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(s.hasOwnProperty(_)?z!=null&&_==="onScroll"&&ht("scroll",i):z!=null&&j(i,_,z,C))}switch(h){case"input":Je(i),pe(i,m,!1);break;case"textarea":Je(i),it(i);break;case"option":m.value!=null&&i.setAttribute("value",""+Ae(m.value));break;case"select":i.multiple=!!m.multiple,_=m.value,_!=null?Be(i,!!m.multiple,_,!1):m.defaultValue!=null&&Be(i,!!m.multiple,m.defaultValue,!0);break;default:typeof v.onClick=="function"&&(i.onclick=el)}switch(h){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(l.flags|=4)}l.ref!==null&&(l.flags|=512,l.flags|=2097152)}return Gt(l),null;case 6:if(i&&l.stateNode!=null)fy(i,l,i.memoizedProps,m);else{if(typeof m!="string"&&l.stateNode===null)throw Error(n(166));if(h=ds(ko.current),ds(nr.current),al(l)){if(m=l.stateNode,h=l.memoizedProps,m[tr]=l,(_=m.nodeValue!==h)&&(i=wn,i!==null))switch(i.tag){case 3:Za(m.nodeValue,h,(i.mode&1)!==0);break;case 5:i.memoizedProps.suppressHydrationWarning!==!0&&Za(m.nodeValue,h,(i.mode&1)!==0)}_&&(l.flags|=4)}else m=(h.nodeType===9?h:h.ownerDocument).createTextNode(m),m[tr]=l,l.stateNode=m}return Gt(l),null;case 13:if(ft(yt),m=l.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(mt&&kn!==null&&(l.mode&1)!==0&&(l.flags&128)===0)gg(),ni(),l.flags|=98560,_=!1;else if(_=al(l),m!==null&&m.dehydrated!==null){if(i===null){if(!_)throw Error(n(318));if(_=l.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(n(317));_[tr]=l}else ni(),(l.flags&128)===0&&(l.memoizedState=null),l.flags|=4;Gt(l),_=!1}else Vn!==null&&(Ad(Vn),Vn=null),_=!0;if(!_)return l.flags&65536?l:null}return(l.flags&128)!==0?(l.lanes=h,l):(m=m!==null,m!==(i!==null&&i.memoizedState!==null)&&m&&(l.child.flags|=8192,(l.mode&1)!==0&&(i===null||(yt.current&1)!==0?Ot===0&&(Ot=3):Od())),l.updateQueue!==null&&(l.flags|=4),Gt(l),null);case 4:return oi(),vd(i,l),i===null&&go(l.stateNode.containerInfo),Gt(l),null;case 10:return Wu(l.type._context),Gt(l),null;case 17:return hn(l.type)&&nl(),Gt(l),null;case 19:if(ft(yt),_=l.memoizedState,_===null)return Gt(l),null;if(m=(l.flags&128)!==0,C=_.rendering,C===null)if(m)No(_,!1);else{if(Ot!==0||i!==null&&(i.flags&128)!==0)for(i=l.child;i!==null;){if(C=fl(i),C!==null){for(l.flags|=128,No(_,!1),m=C.updateQueue,m!==null&&(l.updateQueue=m,l.flags|=4),l.subtreeFlags=0,m=h,h=l.child;h!==null;)_=h,i=m,_.flags&=14680066,C=_.alternate,C===null?(_.childLanes=0,_.lanes=i,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=C.childLanes,_.lanes=C.lanes,_.child=C.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=C.memoizedProps,_.memoizedState=C.memoizedState,_.updateQueue=C.updateQueue,_.type=C.type,i=C.dependencies,_.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),h=h.sibling;return ct(yt,yt.current&1|2),l.child}i=i.sibling}_.tail!==null&&St()>ui&&(l.flags|=128,m=!0,No(_,!1),l.lanes=4194304)}else{if(!m)if(i=fl(C),i!==null){if(l.flags|=128,m=!0,h=i.updateQueue,h!==null&&(l.updateQueue=h,l.flags|=4),No(_,!0),_.tail===null&&_.tailMode==="hidden"&&!C.alternate&&!mt)return Gt(l),null}else 2*St()-_.renderingStartTime>ui&&h!==1073741824&&(l.flags|=128,m=!0,No(_,!1),l.lanes=4194304);_.isBackwards?(C.sibling=l.child,l.child=C):(h=_.last,h!==null?h.sibling=C:l.child=C,_.last=C)}return _.tail!==null?(l=_.tail,_.rendering=l,_.tail=l.sibling,_.renderingStartTime=St(),l.sibling=null,h=yt.current,ct(yt,m?h&1|2:h&1),l):(Gt(l),null);case 22:case 23:return Pd(),m=l.memoizedState!==null,i!==null&&i.memoizedState!==null!==m&&(l.flags|=8192),m&&(l.mode&1)!==0?(Sn&1073741824)!==0&&(Gt(l),l.subtreeFlags&6&&(l.flags|=8192)):Gt(l),null;case 24:return null;case 25:return null}throw Error(n(156,l.tag))}function OS(i,l){switch(Uu(l),l.tag){case 1:return hn(l.type)&&nl(),i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 3:return oi(),ft(dn),ft(Kt),ed(),i=l.flags,(i&65536)!==0&&(i&128)===0?(l.flags=i&-65537|128,l):null;case 5:return Qu(l),null;case 13:if(ft(yt),i=l.memoizedState,i!==null&&i.dehydrated!==null){if(l.alternate===null)throw Error(n(340));ni()}return i=l.flags,i&65536?(l.flags=i&-65537|128,l):null;case 19:return ft(yt),null;case 4:return oi(),null;case 10:return Wu(l.type._context),null;case 22:case 23:return Pd(),null;case 24:return null;default:return null}}var wl=!1,Jt=!1,LS=typeof WeakSet=="function"?WeakSet:Set,xe=null;function li(i,l){var h=i.ref;if(h!==null)if(typeof h=="function")try{h(null)}catch(m){bt(i,l,m)}else h.current=null}function _d(i,l,h){try{h()}catch(m){bt(i,l,m)}}var py=!1;function IS(i,l){if(Pu=Ba,i=Km(),Su(i)){if("selectionStart"in i)var h={start:i.selectionStart,end:i.selectionEnd};else e:{h=(h=i.ownerDocument)&&h.defaultView||window;var m=h.getSelection&&h.getSelection();if(m&&m.rangeCount!==0){h=m.anchorNode;var v=m.anchorOffset,_=m.focusNode;m=m.focusOffset;try{h.nodeType,_.nodeType}catch{h=null;break e}var C=0,L=-1,z=-1,q=0,ie=0,ae=i,se=null;t:for(;;){for(var ge;ae!==h||v!==0&&ae.nodeType!==3||(L=C+v),ae!==_||m!==0&&ae.nodeType!==3||(z=C+m),ae.nodeType===3&&(C+=ae.nodeValue.length),(ge=ae.firstChild)!==null;)se=ae,ae=ge;for(;;){if(ae===i)break t;if(se===h&&++q===v&&(L=C),se===_&&++ie===m&&(z=C),(ge=ae.nextSibling)!==null)break;ae=se,se=ae.parentNode}ae=ge}h=L===-1||z===-1?null:{start:L,end:z}}else h=null}h=h||{start:0,end:0}}else h=null;for(Ou={focusedElem:i,selectionRange:h},Ba=!1,xe=l;xe!==null;)if(l=xe,i=l.child,(l.subtreeFlags&1028)!==0&&i!==null)i.return=l,xe=i;else for(;xe!==null;){l=xe;try{var be=l.alternate;if((l.flags&1024)!==0)switch(l.tag){case 0:case 11:case 15:break;case 1:if(be!==null){var je=be.memoizedProps,jt=be.memoizedState,$=l.stateNode,F=$.getSnapshotBeforeUpdate(l.elementType===l.type?je:qn(l.type,je),jt);$.__reactInternalSnapshotBeforeUpdate=F}break;case 3:var B=l.stateNode.containerInfo;B.nodeType===1?B.textContent="":B.nodeType===9&&B.documentElement&&B.removeChild(B.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(de){bt(l,l.return,de)}if(i=l.sibling,i!==null){i.return=l.return,xe=i;break}xe=l.return}return be=py,py=!1,be}function To(i,l,h){var m=l.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&i)===i){var _=v.destroy;v.destroy=void 0,_!==void 0&&_d(l,h,_)}v=v.next}while(v!==m)}}function kl(i,l){if(l=l.updateQueue,l=l!==null?l.lastEffect:null,l!==null){var h=l=l.next;do{if((h.tag&i)===i){var m=h.create;h.destroy=m()}h=h.next}while(h!==l)}}function bd(i){var l=i.ref;if(l!==null){var h=i.stateNode;i.tag,i=h,typeof l=="function"?l(i):l.current=i}}function my(i){var l=i.alternate;l!==null&&(i.alternate=null,my(l)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(l=i.stateNode,l!==null&&(delete l[tr],delete l[xo],delete l[Mu],delete l[yS],delete l[xS])),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}function gy(i){return i.tag===5||i.tag===3||i.tag===4}function yy(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||gy(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function wd(i,l,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,l?h.nodeType===8?h.parentNode.insertBefore(i,l):h.insertBefore(i,l):(h.nodeType===8?(l=h.parentNode,l.insertBefore(i,h)):(l=h,l.appendChild(i)),h=h._reactRootContainer,h!=null||l.onclick!==null||(l.onclick=el));else if(m!==4&&(i=i.child,i!==null))for(wd(i,l,h),i=i.sibling;i!==null;)wd(i,l,h),i=i.sibling}function kd(i,l,h){var m=i.tag;if(m===5||m===6)i=i.stateNode,l?h.insertBefore(i,l):h.appendChild(i);else if(m!==4&&(i=i.child,i!==null))for(kd(i,l,h),i=i.sibling;i!==null;)kd(i,l,h),i=i.sibling}var Ut=null,Hn=!1;function Ur(i,l,h){for(h=h.child;h!==null;)xy(i,l,h),h=h.sibling}function xy(i,l,h){if(er&&typeof er.onCommitFiberUnmount=="function")try{er.onCommitFiberUnmount(Da,h)}catch{}switch(h.tag){case 5:Jt||li(h,l);case 6:var m=Ut,v=Hn;Ut=null,Ur(i,l,h),Ut=m,Hn=v,Ut!==null&&(Hn?(i=Ut,h=h.stateNode,i.nodeType===8?i.parentNode.removeChild(h):i.removeChild(h)):Ut.removeChild(h.stateNode));break;case 18:Ut!==null&&(Hn?(i=Ut,h=h.stateNode,i.nodeType===8?Du(i.parentNode,h):i.nodeType===1&&Du(i,h),oo(i)):Du(Ut,h.stateNode));break;case 4:m=Ut,v=Hn,Ut=h.stateNode.containerInfo,Hn=!0,Ur(i,l,h),Ut=m,Hn=v;break;case 0:case 11:case 14:case 15:if(!Jt&&(m=h.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){v=m=m.next;do{var _=v,C=_.destroy;_=_.tag,C!==void 0&&((_&2)!==0||(_&4)!==0)&&_d(h,l,C),v=v.next}while(v!==m)}Ur(i,l,h);break;case 1:if(!Jt&&(li(h,l),m=h.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=h.memoizedProps,m.state=h.memoizedState,m.componentWillUnmount()}catch(L){bt(h,l,L)}Ur(i,l,h);break;case 21:Ur(i,l,h);break;case 22:h.mode&1?(Jt=(m=Jt)||h.memoizedState!==null,Ur(i,l,h),Jt=m):Ur(i,l,h);break;default:Ur(i,l,h)}}function vy(i){var l=i.updateQueue;if(l!==null){i.updateQueue=null;var h=i.stateNode;h===null&&(h=i.stateNode=new LS),l.forEach(function(m){var v=qS.bind(null,i,m);h.has(m)||(h.add(m),m.then(v,v))})}}function Kn(i,l){var h=l.deletions;if(h!==null)for(var m=0;m<h.length;m++){var v=h[m];try{var _=i,C=l,L=C;e:for(;L!==null;){switch(L.tag){case 5:Ut=L.stateNode,Hn=!1;break e;case 3:Ut=L.stateNode.containerInfo,Hn=!0;break e;case 4:Ut=L.stateNode.containerInfo,Hn=!0;break e}L=L.return}if(Ut===null)throw Error(n(160));xy(_,C,v),Ut=null,Hn=!1;var z=v.alternate;z!==null&&(z.return=null),v.return=null}catch(q){bt(v,l,q)}}if(l.subtreeFlags&12854)for(l=l.child;l!==null;)_y(l,i),l=l.sibling}function _y(i,l){var h=i.alternate,m=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:if(Kn(l,i),sr(i),m&4){try{To(3,i,i.return),kl(3,i)}catch(je){bt(i,i.return,je)}try{To(5,i,i.return)}catch(je){bt(i,i.return,je)}}break;case 1:Kn(l,i),sr(i),m&512&&h!==null&&li(h,h.return);break;case 5:if(Kn(l,i),sr(i),m&512&&h!==null&&li(h,h.return),i.flags&32){var v=i.stateNode;try{He(v,"")}catch(je){bt(i,i.return,je)}}if(m&4&&(v=i.stateNode,v!=null)){var _=i.memoizedProps,C=h!==null?h.memoizedProps:_,L=i.type,z=i.updateQueue;if(i.updateQueue=null,z!==null)try{L==="input"&&_.type==="radio"&&_.name!=null&&ke(v,_),un(L,C);var q=un(L,_);for(C=0;C<z.length;C+=2){var ie=z[C],ae=z[C+1];ie==="style"?cn(v,ae):ie==="dangerouslySetInnerHTML"?Ve(v,ae):ie==="children"?He(v,ae):j(v,ie,ae,q)}switch(L){case"input":ee(v,_);break;case"textarea":st(v,_);break;case"select":var se=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!_.multiple;var ge=_.value;ge!=null?Be(v,!!_.multiple,ge,!1):se!==!!_.multiple&&(_.defaultValue!=null?Be(v,!!_.multiple,_.defaultValue,!0):Be(v,!!_.multiple,_.multiple?[]:"",!1))}v[xo]=_}catch(je){bt(i,i.return,je)}}break;case 6:if(Kn(l,i),sr(i),m&4){if(i.stateNode===null)throw Error(n(162));v=i.stateNode,_=i.memoizedProps;try{v.nodeValue=_}catch(je){bt(i,i.return,je)}}break;case 3:if(Kn(l,i),sr(i),m&4&&h!==null&&h.memoizedState.isDehydrated)try{oo(l.containerInfo)}catch(je){bt(i,i.return,je)}break;case 4:Kn(l,i),sr(i);break;case 13:Kn(l,i),sr(i),v=i.child,v.flags&8192&&(_=v.memoizedState!==null,v.stateNode.isHidden=_,!_||v.alternate!==null&&v.alternate.memoizedState!==null||(Ed=St())),m&4&&vy(i);break;case 22:if(ie=h!==null&&h.memoizedState!==null,i.mode&1?(Jt=(q=Jt)||ie,Kn(l,i),Jt=q):Kn(l,i),sr(i),m&8192){if(q=i.memoizedState!==null,(i.stateNode.isHidden=q)&&!ie&&(i.mode&1)!==0)for(xe=i,ie=i.child;ie!==null;){for(ae=xe=ie;xe!==null;){switch(se=xe,ge=se.child,se.tag){case 0:case 11:case 14:case 15:To(4,se,se.return);break;case 1:li(se,se.return);var be=se.stateNode;if(typeof be.componentWillUnmount=="function"){m=se,h=se.return;try{l=m,be.props=l.memoizedProps,be.state=l.memoizedState,be.componentWillUnmount()}catch(je){bt(m,h,je)}}break;case 5:li(se,se.return);break;case 22:if(se.memoizedState!==null){ky(ae);continue}}ge!==null?(ge.return=se,xe=ge):ky(ae)}ie=ie.sibling}e:for(ie=null,ae=i;;){if(ae.tag===5){if(ie===null){ie=ae;try{v=ae.stateNode,q?(_=v.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(L=ae.stateNode,z=ae.memoizedProps.style,C=z!=null&&z.hasOwnProperty("display")?z.display:null,L.style.display=Nt("display",C))}catch(je){bt(i,i.return,je)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=q?"":ae.memoizedProps}catch(je){bt(i,i.return,je)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===i)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===i)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===i)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Kn(l,i),sr(i),m&4&&vy(i);break;case 21:break;default:Kn(l,i),sr(i)}}function sr(i){var l=i.flags;if(l&2){try{e:{for(var h=i.return;h!==null;){if(gy(h)){var m=h;break e}h=h.return}throw Error(n(160))}switch(m.tag){case 5:var v=m.stateNode;m.flags&32&&(He(v,""),m.flags&=-33);var _=yy(i);kd(i,_,v);break;case 3:case 4:var C=m.stateNode.containerInfo,L=yy(i);wd(i,L,C);break;default:throw Error(n(161))}}catch(z){bt(i,i.return,z)}i.flags&=-3}l&4096&&(i.flags&=-4097)}function DS(i,l,h){xe=i,by(i)}function by(i,l,h){for(var m=(i.mode&1)!==0;xe!==null;){var v=xe,_=v.child;if(v.tag===22&&m){var C=v.memoizedState!==null||wl;if(!C){var L=v.alternate,z=L!==null&&L.memoizedState!==null||Jt;L=wl;var q=Jt;if(wl=C,(Jt=z)&&!q)for(xe=v;xe!==null;)C=xe,z=C.child,C.tag===22&&C.memoizedState!==null?Sy(v):z!==null?(z.return=C,xe=z):Sy(v);for(;_!==null;)xe=_,by(_),_=_.sibling;xe=v,wl=L,Jt=q}wy(i)}else(v.subtreeFlags&8772)!==0&&_!==null?(_.return=v,xe=_):wy(i)}}function wy(i){for(;xe!==null;){var l=xe;if((l.flags&8772)!==0){var h=l.alternate;try{if((l.flags&8772)!==0)switch(l.tag){case 0:case 11:case 15:Jt||kl(5,l);break;case 1:var m=l.stateNode;if(l.flags&4&&!Jt)if(h===null)m.componentDidMount();else{var v=l.elementType===l.type?h.memoizedProps:qn(l.type,h.memoizedProps);m.componentDidUpdate(v,h.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var _=l.updateQueue;_!==null&&kg(l,_,m);break;case 3:var C=l.updateQueue;if(C!==null){if(h=null,l.child!==null)switch(l.child.tag){case 5:h=l.child.stateNode;break;case 1:h=l.child.stateNode}kg(l,C,h)}break;case 5:var L=l.stateNode;if(h===null&&l.flags&4){h=L;var z=l.memoizedProps;switch(l.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&h.focus();break;case"img":z.src&&(h.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(l.memoizedState===null){var q=l.alternate;if(q!==null){var ie=q.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&oo(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}Jt||l.flags&512&&bd(l)}catch(se){bt(l,l.return,se)}}if(l===i){xe=null;break}if(h=l.sibling,h!==null){h.return=l.return,xe=h;break}xe=l.return}}function ky(i){for(;xe!==null;){var l=xe;if(l===i){xe=null;break}var h=l.sibling;if(h!==null){h.return=l.return,xe=h;break}xe=l.return}}function Sy(i){for(;xe!==null;){var l=xe;try{switch(l.tag){case 0:case 11:case 15:var h=l.return;try{kl(4,l)}catch(z){bt(l,h,z)}break;case 1:var m=l.stateNode;if(typeof m.componentDidMount=="function"){var v=l.return;try{m.componentDidMount()}catch(z){bt(l,v,z)}}var _=l.return;try{bd(l)}catch(z){bt(l,_,z)}break;case 5:var C=l.return;try{bd(l)}catch(z){bt(l,C,z)}}}catch(z){bt(l,l.return,z)}if(l===i){xe=null;break}var L=l.sibling;if(L!==null){L.return=l.return,xe=L;break}xe=l.return}}var MS=Math.ceil,Sl=O.ReactCurrentDispatcher,Sd=O.ReactCurrentOwner,Dn=O.ReactCurrentBatchConfig,tt=0,Mt=null,Tt=null,Bt=0,Sn=0,ci=Dr(0),Ot=0,Ao=null,fs=0,jl=0,jd=0,Ro=null,pn=null,Ed=0,ui=1/0,vr=null,El=!1,Cd=null,Br=null,Cl=!1,Vr=null,Nl=0,Po=0,Nd=null,Tl=-1,Al=0;function sn(){return(tt&6)!==0?St():Tl!==-1?Tl:Tl=St()}function qr(i){return(i.mode&1)===0?1:(tt&2)!==0&&Bt!==0?Bt&-Bt:_S.transition!==null?(Al===0&&(Al=ym()),Al):(i=ot,i!==0||(i=window.event,i=i===void 0?16:Em(i.type)),i)}function Wn(i,l,h,m){if(50<Po)throw Po=0,Nd=null,Error(n(185));to(i,h,m),((tt&2)===0||i!==Mt)&&(i===Mt&&((tt&2)===0&&(jl|=h),Ot===4&&Hr(i,Bt)),mn(i,m),h===1&&tt===0&&(l.mode&1)===0&&(ui=St()+500,sl&&zr()))}function mn(i,l){var h=i.callbackNode;_1(i,l);var m=Fa(i,i===Mt?Bt:0);if(m===0)h!==null&&pm(h),i.callbackNode=null,i.callbackPriority=0;else if(l=m&-m,i.callbackPriority!==l){if(h!=null&&pm(h),l===1)i.tag===0?vS(Ey.bind(null,i)):dg(Ey.bind(null,i)),mS(function(){(tt&6)===0&&zr()}),h=null;else{switch(xm(m)){case 1:h=au;break;case 4:h=mm;break;case 16:h=Ia;break;case 536870912:h=gm;break;default:h=Ia}h=Ly(h,jy.bind(null,i))}i.callbackPriority=l,i.callbackNode=h}}function jy(i,l){if(Tl=-1,Al=0,(tt&6)!==0)throw Error(n(327));var h=i.callbackNode;if(di()&&i.callbackNode!==h)return null;var m=Fa(i,i===Mt?Bt:0);if(m===0)return null;if((m&30)!==0||(m&i.expiredLanes)!==0||l)l=Rl(i,m);else{l=m;var v=tt;tt|=2;var _=Ny();(Mt!==i||Bt!==l)&&(vr=null,ui=St()+500,ms(i,l));do try{$S();break}catch(L){Cy(i,L)}while(!0);Ku(),Sl.current=_,tt=v,Tt!==null?l=0:(Mt=null,Bt=0,l=Ot)}if(l!==0){if(l===2&&(v=lu(i),v!==0&&(m=v,l=Td(i,v))),l===1)throw h=Ao,ms(i,0),Hr(i,m),mn(i,St()),h;if(l===6)Hr(i,m);else{if(v=i.current.alternate,(m&30)===0&&!zS(v)&&(l=Rl(i,m),l===2&&(_=lu(i),_!==0&&(m=_,l=Td(i,_))),l===1))throw h=Ao,ms(i,0),Hr(i,m),mn(i,St()),h;switch(i.finishedWork=v,i.finishedLanes=m,l){case 0:case 1:throw Error(n(345));case 2:gs(i,pn,vr);break;case 3:if(Hr(i,m),(m&130023424)===m&&(l=Ed+500-St(),10<l)){if(Fa(i,0)!==0)break;if(v=i.suspendedLanes,(v&m)!==m){sn(),i.pingedLanes|=i.suspendedLanes&v;break}i.timeoutHandle=Iu(gs.bind(null,i,pn,vr),l);break}gs(i,pn,vr);break;case 4:if(Hr(i,m),(m&4194240)===m)break;for(l=i.eventTimes,v=-1;0<m;){var C=31-Un(m);_=1<<C,C=l[C],C>v&&(v=C),m&=~_}if(m=v,m=St()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*MS(m/1960))-m,10<m){i.timeoutHandle=Iu(gs.bind(null,i,pn,vr),m);break}gs(i,pn,vr);break;case 5:gs(i,pn,vr);break;default:throw Error(n(329))}}}return mn(i,St()),i.callbackNode===h?jy.bind(null,i):null}function Td(i,l){var h=Ro;return i.current.memoizedState.isDehydrated&&(ms(i,l).flags|=256),i=Rl(i,l),i!==2&&(l=pn,pn=h,l!==null&&Ad(l)),i}function Ad(i){pn===null?pn=i:pn.push.apply(pn,i)}function zS(i){for(var l=i;;){if(l.flags&16384){var h=l.updateQueue;if(h!==null&&(h=h.stores,h!==null))for(var m=0;m<h.length;m++){var v=h[m],_=v.getSnapshot;v=v.value;try{if(!Bn(_(),v))return!1}catch{return!1}}}if(h=l.child,l.subtreeFlags&16384&&h!==null)h.return=l,l=h;else{if(l===i)break;for(;l.sibling===null;){if(l.return===null||l.return===i)return!0;l=l.return}l.sibling.return=l.return,l=l.sibling}}return!0}function Hr(i,l){for(l&=~jd,l&=~jl,i.suspendedLanes|=l,i.pingedLanes&=~l,i=i.expirationTimes;0<l;){var h=31-Un(l),m=1<<h;i[h]=-1,l&=~m}}function Ey(i){if((tt&6)!==0)throw Error(n(327));di();var l=Fa(i,0);if((l&1)===0)return mn(i,St()),null;var h=Rl(i,l);if(i.tag!==0&&h===2){var m=lu(i);m!==0&&(l=m,h=Td(i,m))}if(h===1)throw h=Ao,ms(i,0),Hr(i,l),mn(i,St()),h;if(h===6)throw Error(n(345));return i.finishedWork=i.current.alternate,i.finishedLanes=l,gs(i,pn,vr),mn(i,St()),null}function Rd(i,l){var h=tt;tt|=1;try{return i(l)}finally{tt=h,tt===0&&(ui=St()+500,sl&&zr())}}function ps(i){Vr!==null&&Vr.tag===0&&(tt&6)===0&&di();var l=tt;tt|=1;var h=Dn.transition,m=ot;try{if(Dn.transition=null,ot=1,i)return i()}finally{ot=m,Dn.transition=h,tt=l,(tt&6)===0&&zr()}}function Pd(){Sn=ci.current,ft(ci)}function ms(i,l){i.finishedWork=null,i.finishedLanes=0;var h=i.timeoutHandle;if(h!==-1&&(i.timeoutHandle=-1,pS(h)),Tt!==null)for(h=Tt.return;h!==null;){var m=h;switch(Uu(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&nl();break;case 3:oi(),ft(dn),ft(Kt),ed();break;case 5:Qu(m);break;case 4:oi();break;case 13:ft(yt);break;case 19:ft(yt);break;case 10:Wu(m.type._context);break;case 22:case 23:Pd()}h=h.return}if(Mt=i,Tt=i=Kr(i.current,null),Bt=Sn=l,Ot=0,Ao=null,jd=jl=fs=0,pn=Ro=null,us!==null){for(l=0;l<us.length;l++)if(h=us[l],m=h.interleaved,m!==null){h.interleaved=null;var v=m.next,_=h.pending;if(_!==null){var C=_.next;_.next=v,m.next=C}h.pending=m}us=null}return i}function Cy(i,l){do{var h=Tt;try{if(Ku(),pl.current=xl,ml){for(var m=xt.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}ml=!1}if(hs=0,Dt=Pt=xt=null,So=!1,jo=0,Sd.current=null,h===null||h.return===null){Ot=1,Ao=l,Tt=null;break}e:{var _=i,C=h.return,L=h,z=l;if(l=Bt,L.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var q=z,ie=L,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var se=ie.alternate;se?(ie.updateQueue=se.updateQueue,ie.memoizedState=se.memoizedState,ie.lanes=se.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var ge=Qg(C);if(ge!==null){ge.flags&=-257,Zg(ge,C,L,_,l),ge.mode&1&&Yg(_,q,l),l=ge,z=q;var be=l.updateQueue;if(be===null){var je=new Set;je.add(z),l.updateQueue=je}else be.add(z);break e}else{if((l&1)===0){Yg(_,q,l),Od();break e}z=Error(n(426))}}else if(mt&&L.mode&1){var jt=Qg(C);if(jt!==null){(jt.flags&65536)===0&&(jt.flags|=256),Zg(jt,C,L,_,l),qu(ai(z,L));break e}}_=z=ai(z,L),Ot!==4&&(Ot=2),Ro===null?Ro=[_]:Ro.push(_),_=C;do{switch(_.tag){case 3:_.flags|=65536,l&=-l,_.lanes|=l;var $=Jg(_,z,l);wg(_,$);break e;case 1:L=z;var F=_.type,B=_.stateNode;if((_.flags&128)===0&&(typeof F.getDerivedStateFromError=="function"||B!==null&&typeof B.componentDidCatch=="function"&&(Br===null||!Br.has(B)))){_.flags|=65536,l&=-l,_.lanes|=l;var de=Xg(_,L,l);wg(_,de);break e}}_=_.return}while(_!==null)}Ay(h)}catch(Ee){l=Ee,Tt===h&&h!==null&&(Tt=h=h.return);continue}break}while(!0)}function Ny(){var i=Sl.current;return Sl.current=xl,i===null?xl:i}function Od(){(Ot===0||Ot===3||Ot===2)&&(Ot=4),Mt===null||(fs&268435455)===0&&(jl&268435455)===0||Hr(Mt,Bt)}function Rl(i,l){var h=tt;tt|=2;var m=Ny();(Mt!==i||Bt!==l)&&(vr=null,ms(i,l));do try{FS();break}catch(v){Cy(i,v)}while(!0);if(Ku(),tt=h,Sl.current=m,Tt!==null)throw Error(n(261));return Mt=null,Bt=0,Ot}function FS(){for(;Tt!==null;)Ty(Tt)}function $S(){for(;Tt!==null&&!d1();)Ty(Tt)}function Ty(i){var l=Oy(i.alternate,i,Sn);i.memoizedProps=i.pendingProps,l===null?Ay(i):Tt=l,Sd.current=null}function Ay(i){var l=i;do{var h=l.alternate;if(i=l.return,(l.flags&32768)===0){if(h=PS(h,l,Sn),h!==null){Tt=h;return}}else{if(h=OS(h,l),h!==null){h.flags&=32767,Tt=h;return}if(i!==null)i.flags|=32768,i.subtreeFlags=0,i.deletions=null;else{Ot=6,Tt=null;return}}if(l=l.sibling,l!==null){Tt=l;return}Tt=l=i}while(l!==null);Ot===0&&(Ot=5)}function gs(i,l,h){var m=ot,v=Dn.transition;try{Dn.transition=null,ot=1,US(i,l,h,m)}finally{Dn.transition=v,ot=m}return null}function US(i,l,h,m){do di();while(Vr!==null);if((tt&6)!==0)throw Error(n(327));h=i.finishedWork;var v=i.finishedLanes;if(h===null)return null;if(i.finishedWork=null,i.finishedLanes=0,h===i.current)throw Error(n(177));i.callbackNode=null,i.callbackPriority=0;var _=h.lanes|h.childLanes;if(b1(i,_),i===Mt&&(Tt=Mt=null,Bt=0),(h.subtreeFlags&2064)===0&&(h.flags&2064)===0||Cl||(Cl=!0,Ly(Ia,function(){return di(),null})),_=(h.flags&15990)!==0,(h.subtreeFlags&15990)!==0||_){_=Dn.transition,Dn.transition=null;var C=ot;ot=1;var L=tt;tt|=4,Sd.current=null,IS(i,h),_y(h,i),aS(Ou),Ba=!!Pu,Ou=Pu=null,i.current=h,DS(h),h1(),tt=L,ot=C,Dn.transition=_}else i.current=h;if(Cl&&(Cl=!1,Vr=i,Nl=v),_=i.pendingLanes,_===0&&(Br=null),m1(h.stateNode),mn(i,St()),l!==null)for(m=i.onRecoverableError,h=0;h<l.length;h++)v=l[h],m(v.value,{componentStack:v.stack,digest:v.digest});if(El)throw El=!1,i=Cd,Cd=null,i;return(Nl&1)!==0&&i.tag!==0&&di(),_=i.pendingLanes,(_&1)!==0?i===Nd?Po++:(Po=0,Nd=i):Po=0,zr(),null}function di(){if(Vr!==null){var i=xm(Nl),l=Dn.transition,h=ot;try{if(Dn.transition=null,ot=16>i?16:i,Vr===null)var m=!1;else{if(i=Vr,Vr=null,Nl=0,(tt&6)!==0)throw Error(n(331));var v=tt;for(tt|=4,xe=i.current;xe!==null;){var _=xe,C=_.child;if((xe.flags&16)!==0){var L=_.deletions;if(L!==null){for(var z=0;z<L.length;z++){var q=L[z];for(xe=q;xe!==null;){var ie=xe;switch(ie.tag){case 0:case 11:case 15:To(8,ie,_)}var ae=ie.child;if(ae!==null)ae.return=ie,xe=ae;else for(;xe!==null;){ie=xe;var se=ie.sibling,ge=ie.return;if(my(ie),ie===q){xe=null;break}if(se!==null){se.return=ge,xe=se;break}xe=ge}}}var be=_.alternate;if(be!==null){var je=be.child;if(je!==null){be.child=null;do{var jt=je.sibling;je.sibling=null,je=jt}while(je!==null)}}xe=_}}if((_.subtreeFlags&2064)!==0&&C!==null)C.return=_,xe=C;else e:for(;xe!==null;){if(_=xe,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:To(9,_,_.return)}var $=_.sibling;if($!==null){$.return=_.return,xe=$;break e}xe=_.return}}var F=i.current;for(xe=F;xe!==null;){C=xe;var B=C.child;if((C.subtreeFlags&2064)!==0&&B!==null)B.return=C,xe=B;else e:for(C=F;xe!==null;){if(L=xe,(L.flags&2048)!==0)try{switch(L.tag){case 0:case 11:case 15:kl(9,L)}}catch(Ee){bt(L,L.return,Ee)}if(L===C){xe=null;break e}var de=L.sibling;if(de!==null){de.return=L.return,xe=de;break e}xe=L.return}}if(tt=v,zr(),er&&typeof er.onPostCommitFiberRoot=="function")try{er.onPostCommitFiberRoot(Da,i)}catch{}m=!0}return m}finally{ot=h,Dn.transition=l}}return!1}function Ry(i,l,h){l=ai(h,l),l=Jg(i,l,1),i=$r(i,l,1),l=sn(),i!==null&&(to(i,1,l),mn(i,l))}function bt(i,l,h){if(i.tag===3)Ry(i,i,h);else for(;l!==null;){if(l.tag===3){Ry(l,i,h);break}else if(l.tag===1){var m=l.stateNode;if(typeof l.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(Br===null||!Br.has(m))){i=ai(h,i),i=Xg(l,i,1),l=$r(l,i,1),i=sn(),l!==null&&(to(l,1,i),mn(l,i));break}}l=l.return}}function BS(i,l,h){var m=i.pingCache;m!==null&&m.delete(l),l=sn(),i.pingedLanes|=i.suspendedLanes&h,Mt===i&&(Bt&h)===h&&(Ot===4||Ot===3&&(Bt&130023424)===Bt&&500>St()-Ed?ms(i,0):jd|=h),mn(i,l)}function Py(i,l){l===0&&((i.mode&1)===0?l=1:(l=za,za<<=1,(za&130023424)===0&&(za=4194304)));var h=sn();i=gr(i,l),i!==null&&(to(i,l,h),mn(i,h))}function VS(i){var l=i.memoizedState,h=0;l!==null&&(h=l.retryLane),Py(i,h)}function qS(i,l){var h=0;switch(i.tag){case 13:var m=i.stateNode,v=i.memoizedState;v!==null&&(h=v.retryLane);break;case 19:m=i.stateNode;break;default:throw Error(n(314))}m!==null&&m.delete(l),Py(i,h)}var Oy;Oy=function(i,l,h){if(i!==null)if(i.memoizedProps!==l.pendingProps||dn.current)fn=!0;else{if((i.lanes&h)===0&&(l.flags&128)===0)return fn=!1,RS(i,l,h);fn=(i.flags&131072)!==0}else fn=!1,mt&&(l.flags&1048576)!==0&&hg(l,ol,l.index);switch(l.lanes=0,l.tag){case 2:var m=l.type;bl(i,l),i=l.pendingProps;var v=Zs(l,Kt.current);ii(l,h),v=rd(null,l,m,i,v,h);var _=sd();return l.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(l.tag=1,l.memoizedState=null,l.updateQueue=null,hn(m)?(_=!0,rl(l)):_=!1,l.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,Xu(l),v.updater=vl,l.stateNode=v,v._reactInternals=l,ud(l,m,i,h),l=pd(null,l,m,!0,_,h)):(l.tag=0,mt&&_&&$u(l),rn(null,l,v,h),l=l.child),l;case 16:m=l.elementType;e:{switch(bl(i,l),i=l.pendingProps,v=m._init,m=v(m._payload),l.type=m,v=l.tag=KS(m),i=qn(m,i),v){case 0:l=fd(null,l,m,i,h);break e;case 1:l=iy(null,l,m,i,h);break e;case 11:l=ey(null,l,m,i,h);break e;case 14:l=ty(null,l,m,qn(m.type,i),h);break e}throw Error(n(306,m,""))}return l;case 0:return m=l.type,v=l.pendingProps,v=l.elementType===m?v:qn(m,v),fd(i,l,m,v,h);case 1:return m=l.type,v=l.pendingProps,v=l.elementType===m?v:qn(m,v),iy(i,l,m,v,h);case 3:e:{if(oy(l),i===null)throw Error(n(387));m=l.pendingProps,_=l.memoizedState,v=_.element,bg(i,l),hl(l,m,null,h);var C=l.memoizedState;if(m=C.element,_.isDehydrated)if(_={element:m,isDehydrated:!1,cache:C.cache,pendingSuspenseBoundaries:C.pendingSuspenseBoundaries,transitions:C.transitions},l.updateQueue.baseState=_,l.memoizedState=_,l.flags&256){v=ai(Error(n(423)),l),l=ay(i,l,m,h,v);break e}else if(m!==v){v=ai(Error(n(424)),l),l=ay(i,l,m,h,v);break e}else for(kn=Ir(l.stateNode.containerInfo.firstChild),wn=l,mt=!0,Vn=null,h=vg(l,null,m,h),l.child=h;h;)h.flags=h.flags&-3|4096,h=h.sibling;else{if(ni(),m===v){l=xr(i,l,h);break e}rn(i,l,m,h)}l=l.child}return l;case 5:return Sg(l),i===null&&Vu(l),m=l.type,v=l.pendingProps,_=i!==null?i.memoizedProps:null,C=v.children,Lu(m,v)?C=null:_!==null&&Lu(m,_)&&(l.flags|=32),sy(i,l),rn(i,l,C,h),l.child;case 6:return i===null&&Vu(l),null;case 13:return ly(i,l,h);case 4:return Yu(l,l.stateNode.containerInfo),m=l.pendingProps,i===null?l.child=ri(l,null,m,h):rn(i,l,m,h),l.child;case 11:return m=l.type,v=l.pendingProps,v=l.elementType===m?v:qn(m,v),ey(i,l,m,v,h);case 7:return rn(i,l,l.pendingProps,h),l.child;case 8:return rn(i,l,l.pendingProps.children,h),l.child;case 12:return rn(i,l,l.pendingProps.children,h),l.child;case 10:e:{if(m=l.type._context,v=l.pendingProps,_=l.memoizedProps,C=v.value,ct(cl,m._currentValue),m._currentValue=C,_!==null)if(Bn(_.value,C)){if(_.children===v.children&&!dn.current){l=xr(i,l,h);break e}}else for(_=l.child,_!==null&&(_.return=l);_!==null;){var L=_.dependencies;if(L!==null){C=_.child;for(var z=L.firstContext;z!==null;){if(z.context===m){if(_.tag===1){z=yr(-1,h&-h),z.tag=2;var q=_.updateQueue;if(q!==null){q=q.shared;var ie=q.pending;ie===null?z.next=z:(z.next=ie.next,ie.next=z),q.pending=z}}_.lanes|=h,z=_.alternate,z!==null&&(z.lanes|=h),Gu(_.return,h,l),L.lanes|=h;break}z=z.next}}else if(_.tag===10)C=_.type===l.type?null:_.child;else if(_.tag===18){if(C=_.return,C===null)throw Error(n(341));C.lanes|=h,L=C.alternate,L!==null&&(L.lanes|=h),Gu(C,h,l),C=_.sibling}else C=_.child;if(C!==null)C.return=_;else for(C=_;C!==null;){if(C===l){C=null;break}if(_=C.sibling,_!==null){_.return=C.return,C=_;break}C=C.return}_=C}rn(i,l,v.children,h),l=l.child}return l;case 9:return v=l.type,m=l.pendingProps.children,ii(l,h),v=Ln(v),m=m(v),l.flags|=1,rn(i,l,m,h),l.child;case 14:return m=l.type,v=qn(m,l.pendingProps),v=qn(m.type,v),ty(i,l,m,v,h);case 15:return ny(i,l,l.type,l.pendingProps,h);case 17:return m=l.type,v=l.pendingProps,v=l.elementType===m?v:qn(m,v),bl(i,l),l.tag=1,hn(m)?(i=!0,rl(l)):i=!1,ii(l,h),Wg(l,m,v),ud(l,m,v,h),pd(null,l,m,!0,i,h);case 19:return uy(i,l,h);case 22:return ry(i,l,h)}throw Error(n(156,l.tag))};function Ly(i,l){return fm(i,l)}function HS(i,l,h,m){this.tag=i,this.key=h,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=l,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Mn(i,l,h,m){return new HS(i,l,h,m)}function Ld(i){return i=i.prototype,!(!i||!i.isReactComponent)}function KS(i){if(typeof i=="function")return Ld(i)?1:0;if(i!=null){if(i=i.$$typeof,i===Y)return 11;if(i===W)return 14}return 2}function Kr(i,l){var h=i.alternate;return h===null?(h=Mn(i.tag,l,i.key,i.mode),h.elementType=i.elementType,h.type=i.type,h.stateNode=i.stateNode,h.alternate=i,i.alternate=h):(h.pendingProps=l,h.type=i.type,h.flags=0,h.subtreeFlags=0,h.deletions=null),h.flags=i.flags&14680064,h.childLanes=i.childLanes,h.lanes=i.lanes,h.child=i.child,h.memoizedProps=i.memoizedProps,h.memoizedState=i.memoizedState,h.updateQueue=i.updateQueue,l=i.dependencies,h.dependencies=l===null?null:{lanes:l.lanes,firstContext:l.firstContext},h.sibling=i.sibling,h.index=i.index,h.ref=i.ref,h}function Pl(i,l,h,m,v,_){var C=2;if(m=i,typeof i=="function")Ld(i)&&(C=1);else if(typeof i=="string")C=5;else e:switch(i){case I:return ys(h.children,v,_,l);case V:C=8,v|=8;break;case U:return i=Mn(12,h,l,v|2),i.elementType=U,i.lanes=_,i;case he:return i=Mn(13,h,l,v),i.elementType=he,i.lanes=_,i;case G:return i=Mn(19,h,l,v),i.elementType=G,i.lanes=_,i;case re:return Ol(h,v,_,l);default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case D:C=10;break e;case Z:C=9;break e;case Y:C=11;break e;case W:C=14;break e;case ne:C=16,m=null;break e}throw Error(n(130,i==null?i:typeof i,""))}return l=Mn(C,h,l,v),l.elementType=i,l.type=m,l.lanes=_,l}function ys(i,l,h,m){return i=Mn(7,i,m,l),i.lanes=h,i}function Ol(i,l,h,m){return i=Mn(22,i,m,l),i.elementType=re,i.lanes=h,i.stateNode={isHidden:!1},i}function Id(i,l,h){return i=Mn(6,i,null,l),i.lanes=h,i}function Dd(i,l,h){return l=Mn(4,i.children!==null?i.children:[],i.key,l),l.lanes=h,l.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},l}function WS(i,l,h,m,v){this.tag=l,this.containerInfo=i,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=cu(0),this.expirationTimes=cu(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=cu(0),this.identifierPrefix=m,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function Md(i,l,h,m,v,_,C,L,z){return i=new WS(i,l,h,L,z),l===1?(l=1,_===!0&&(l|=8)):l=0,_=Mn(3,null,null,l),i.current=_,_.stateNode=i,_.memoizedState={element:m,isDehydrated:h,cache:null,transitions:null,pendingSuspenseBoundaries:null},Xu(_),i}function GS(i,l,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:T,key:m==null?null:""+m,children:i,containerInfo:l,implementation:h}}function Iy(i){if(!i)return Mr;i=i._reactInternals;e:{if(is(i)!==i||i.tag!==1)throw Error(n(170));var l=i;do{switch(l.tag){case 3:l=l.stateNode.context;break e;case 1:if(hn(l.type)){l=l.stateNode.__reactInternalMemoizedMergedChildContext;break e}}l=l.return}while(l!==null);throw Error(n(171))}if(i.tag===1){var h=i.type;if(hn(h))return cg(i,h,l)}return l}function Dy(i,l,h,m,v,_,C,L,z){return i=Md(h,m,!0,i,v,_,C,L,z),i.context=Iy(null),h=i.current,m=sn(),v=qr(h),_=yr(m,v),_.callback=l??null,$r(h,_,v),i.current.lanes=v,to(i,v,m),mn(i,m),i}function Ll(i,l,h,m){var v=l.current,_=sn(),C=qr(v);return h=Iy(h),l.context===null?l.context=h:l.pendingContext=h,l=yr(_,C),l.payload={element:i},m=m===void 0?null:m,m!==null&&(l.callback=m),i=$r(v,l,C),i!==null&&(Wn(i,v,C,_),dl(i,v,C)),C}function Il(i){return i=i.current,i.child?(i.child.tag===5,i.child.stateNode):null}function My(i,l){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var h=i.retryLane;i.retryLane=h!==0&&h<l?h:l}}function zd(i,l){My(i,l),(i=i.alternate)&&My(i,l)}function JS(){return null}var zy=typeof reportError=="function"?reportError:function(i){console.error(i)};function Fd(i){this._internalRoot=i}Dl.prototype.render=Fd.prototype.render=function(i){var l=this._internalRoot;if(l===null)throw Error(n(409));Ll(i,l,null,null)},Dl.prototype.unmount=Fd.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var l=i.containerInfo;ps(function(){Ll(null,i,null,null)}),l[hr]=null}};function Dl(i){this._internalRoot=i}Dl.prototype.unstable_scheduleHydration=function(i){if(i){var l=bm();i={blockedOn:null,target:i,priority:l};for(var h=0;h<Pr.length&&l!==0&&l<Pr[h].priority;h++);Pr.splice(h,0,i),h===0&&Sm(i)}};function $d(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function Ml(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11&&(i.nodeType!==8||i.nodeValue!==" react-mount-point-unstable "))}function Fy(){}function XS(i,l,h,m,v){if(v){if(typeof m=="function"){var _=m;m=function(){var q=Il(C);_.call(q)}}var C=Dy(l,m,i,0,null,!1,!1,"",Fy);return i._reactRootContainer=C,i[hr]=C.current,go(i.nodeType===8?i.parentNode:i),ps(),C}for(;v=i.lastChild;)i.removeChild(v);if(typeof m=="function"){var L=m;m=function(){var q=Il(z);L.call(q)}}var z=Md(i,0,!1,null,null,!1,!1,"",Fy);return i._reactRootContainer=z,i[hr]=z.current,go(i.nodeType===8?i.parentNode:i),ps(function(){Ll(l,z,h,m)}),z}function zl(i,l,h,m,v){var _=h._reactRootContainer;if(_){var C=_;if(typeof v=="function"){var L=v;v=function(){var z=Il(C);L.call(z)}}Ll(l,C,i,v)}else C=XS(h,l,i,v,m);return Il(C)}vm=function(i){switch(i.tag){case 3:var l=i.stateNode;if(l.current.memoizedState.isDehydrated){var h=eo(l.pendingLanes);h!==0&&(uu(l,h|1),mn(l,St()),(tt&6)===0&&(ui=St()+500,zr()))}break;case 13:ps(function(){var m=gr(i,1);if(m!==null){var v=sn();Wn(m,i,1,v)}}),zd(i,1)}},du=function(i){if(i.tag===13){var l=gr(i,134217728);if(l!==null){var h=sn();Wn(l,i,134217728,h)}zd(i,134217728)}},_m=function(i){if(i.tag===13){var l=qr(i),h=gr(i,l);if(h!==null){var m=sn();Wn(h,i,l,m)}zd(i,l)}},bm=function(){return ot},wm=function(i,l){var h=ot;try{return ot=i,l()}finally{ot=h}},ru=function(i,l,h){switch(l){case"input":if(ee(i,h),l=h.name,h.type==="radio"&&l!=null){for(h=i;h.parentNode;)h=h.parentNode;for(h=h.querySelectorAll("input[name="+JSON.stringify(""+l)+'][type="radio"]'),l=0;l<h.length;l++){var m=h[l];if(m!==i&&m.form===i.form){var v=tl(m);if(!v)throw Error(n(90));et(m),ee(m,v)}}}break;case"textarea":st(i,h);break;case"select":l=h.value,l!=null&&Be(i,!!h.multiple,l,!1)}},om=Rd,am=ps;var YS={usingClientEntryPoint:!1,Events:[vo,Ys,tl,sm,im,Rd]},Oo={findFiberByHostInstance:os,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},QS={bundleType:Oo.bundleType,version:Oo.version,rendererPackageName:Oo.rendererPackageName,rendererConfig:Oo.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:O.ReactCurrentDispatcher,findHostInstanceByFiber:function(i){return i=dm(i),i===null?null:i.stateNode},findFiberByHostInstance:Oo.findFiberByHostInstance||JS,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 Fl=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Fl.isDisabled&&Fl.supportsFiber)try{Da=Fl.inject(QS),er=Fl}catch{}}return gn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=YS,gn.createPortal=function(i,l){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!$d(l))throw Error(n(200));return GS(i,l,null,h)},gn.createRoot=function(i,l){if(!$d(i))throw Error(n(299));var h=!1,m="",v=zy;return l!=null&&(l.unstable_strictMode===!0&&(h=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onRecoverableError!==void 0&&(v=l.onRecoverableError)),l=Md(i,1,!1,null,null,h,!1,m,v),i[hr]=l.current,go(i.nodeType===8?i.parentNode:i),new Fd(l)},gn.findDOMNode=function(i){if(i==null)return null;if(i.nodeType===1)return i;var l=i._reactInternals;if(l===void 0)throw typeof i.render=="function"?Error(n(188)):(i=Object.keys(i).join(","),Error(n(268,i)));return i=dm(l),i=i===null?null:i.stateNode,i},gn.flushSync=function(i){return ps(i)},gn.hydrate=function(i,l,h){if(!Ml(l))throw Error(n(200));return zl(null,i,l,!0,h)},gn.hydrateRoot=function(i,l,h){if(!$d(i))throw Error(n(405));var m=h!=null&&h.hydratedSources||null,v=!1,_="",C=zy;if(h!=null&&(h.unstable_strictMode===!0&&(v=!0),h.identifierPrefix!==void 0&&(_=h.identifierPrefix),h.onRecoverableError!==void 0&&(C=h.onRecoverableError)),l=Dy(l,null,i,1,h??null,v,!1,_,C),i[hr]=l.current,go(i),m)for(i=0;i<m.length;i++)h=m[i],v=h._getVersion,v=v(h._source),l.mutableSourceEagerHydrationData==null?l.mutableSourceEagerHydrationData=[h,v]:l.mutableSourceEagerHydrationData.push(h,v);return new Dl(l)},gn.render=function(i,l,h){if(!Ml(l))throw Error(n(200));return zl(null,i,l,!1,h)},gn.unmountComponentAtNode=function(i){if(!Ml(i))throw Error(n(40));return i._reactRootContainer?(ps(function(){zl(null,null,i,!1,function(){i._reactRootContainer=null,i[hr]=null})}),!0):!1},gn.unstable_batchedUpdates=Rd,gn.unstable_renderSubtreeIntoContainer=function(i,l,h,m){if(!Ml(h))throw Error(n(200));if(i==null||i._reactInternals===void 0)throw Error(n(38));return zl(i,l,h,!1,m)},gn.version="18.3.1-next-f1338f8080-20240426",gn}var Wy;function oj(){if(Wy)return Vd.exports;Wy=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Vd.exports=ij(),Vd.exports}var Gy;function aj(){if(Gy)return $l;Gy=1;var e=oj();return $l.createRoot=e.createRoot,$l.hydrateRoot=e.hydrateRoot,$l}var lj=aj();const cj=Ac(lj);var uj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};const dj=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),fe=(e,t)=>{const n=R.forwardRef(({color:r="currentColor",size:s=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:c="",children:d,...f},p)=>R.createElement("svg",{ref:p,...uj,width:s,height:s,stroke:r,strokeWidth:a?Number(o)*24/Number(s):o,className:["lucide",`lucide-${dj(e)}`,c].join(" "),...f},[...t.map(([g,y])=>R.createElement(g,y)),...Array.isArray(d)?d:[d]]));return n.displayName=`${e}`,n};const hj=fe("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);const ar=fe("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);const Bh=fe("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);const g_=fe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);const tc=fe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);const fj=fe("Bitcoin",[["path",{d:"M11.767 19.089c4.924.868 6.14-6.025 1.216-6.894m-1.216 6.894L5.86 18.047m5.908 1.042-.347 1.97m1.563-8.864c4.924.869 6.14-6.025 1.215-6.893m-1.215 6.893-3.94-.694m5.155-6.2L8.29 4.26m5.908 1.042.348-1.97M7.48 20.364l3.126-17.727",key:"yr8idg"}]]);const y_=fe("BookOpen",[["path",{d:"M2 3h6a4 4 0 0 1 4 4v14a3 3 0 0 0-3-3H2z",key:"vv98re"}],["path",{d:"M22 3h-6a4 4 0 0 0-4 4v14a3 3 0 0 1 3-3h7z",key:"1cyq3y"}]]);const pj=fe("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);const x_=fe("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]]);const mj=fe("Briefcase",[["rect",{width:"20",height:"14",x:"2",y:"7",rx:"2",ry:"2",key:"eto64e"}],["path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"zwj3tp"}]]);const gj=fe("Bug",[["path",{d:"m8 2 1.88 1.88",key:"fmnt4t"}],["path",{d:"M14.12 3.88 16 2",key:"qol33r"}],["path",{d:"M9 7.13v-1a3.003 3.003 0 1 1 6 0v1",key:"d7y7pr"}],["path",{d:"M12 20c-3.3 0-6-2.7-6-6v-3a4 4 0 0 1 4-4h4a4 4 0 0 1 4 4v3c0 3.3-2.7 6-6 6",key:"xs1cw7"}],["path",{d:"M12 20v-9",key:"1qisl0"}],["path",{d:"M6.53 9C4.6 8.8 3 7.1 3 5",key:"32zzws"}],["path",{d:"M6 13H2",key:"82j7cp"}],["path",{d:"M3 21c0-2.1 1.7-3.9 3.8-4",key:"4p0ekp"}],["path",{d:"M20.97 5c0 2.1-1.6 3.8-3.5 4",key:"18gb23"}],["path",{d:"M22 13h-4",key:"1jl80f"}],["path",{d:"M17.2 17c2.1.1 3.8 1.9 3.8 4",key:"k3fwyw"}]]);const yj=fe("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);const xj=fe("Camera",[["path",{d:"M14.5 4h-5L7 7H4a2 2 0 0 0-2 2v9a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-3l-2.5-3z",key:"1tc9qg"}],["circle",{cx:"12",cy:"13",r:"3",key:"1vg3eu"}]]);const Rs=fe("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);const Ps=fe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);const Is=fe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);const vj=fe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);const nc=fe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);const v_=fe("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);const _j=fe("ChevronsLeft",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);const bj=fe("ChevronsRight",[["path",{d:"m6 17 5-5-5-5",key:"xnjwq"}],["path",{d:"m13 17 5-5-5-5",key:"17xmmf"}]]);const Jy=fe("Chrome",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["line",{x1:"21.17",x2:"12",y1:"8",y2:"8",key:"a0cw5f"}],["line",{x1:"3.95",x2:"8.54",y1:"6.06",y2:"14",key:"1kftof"}],["line",{x1:"10.88",x2:"15.46",y1:"21.94",y2:"14",key:"1ymyh8"}]]);const Di=fe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);const __=fe("Code",[["polyline",{points:"16 18 22 12 16 6",key:"z7tu5w"}],["polyline",{points:"8 6 2 12 8 18",key:"1eg1df"}]]);const Uf=fe("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);const b_=fe("Cpu",[["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"9",y:"9",width:"6",height:"6",key:"o3kz5p"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]]);const jr=fe("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);const wj=fe("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);const Vh=fe("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);const es=fe("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);const Mi=fe("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]]);const kj=fe("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);const Sj=fe("FolderOpen",[["path",{d:"m6 14 1.5-2.9A2 2 0 0 1 9.24 10H20a2 2 0 0 1 1.94 2.5l-1.54 6a2 2 0 0 1-1.95 1.5H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H18a2 2 0 0 1 2 2v2",key:"usdka0"}]]);const jj=fe("Gauge",[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]]);const Io=fe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);const Bf=fe("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]]);const Xy=fe("HeartOff",[["line",{x1:"2",y1:"2",x2:"22",y2:"22",key:"1w4vcy"}],["path",{d:"M16.5 16.5 12 21l-7-7c-1.5-1.45-3-3.2-3-5.5a5.5 5.5 0 0 1 2.14-4.35",key:"3mpagl"}],["path",{d:"M8.76 3.1c1.15.22 2.13.78 3.24 1.9 1.5-1.5 2.74-2 4.5-2A5.5 5.5 0 0 1 22 8.5c0 2.12-1.3 3.78-2.67 5.17",key:"1gh3v3"}]]);const w_=fe("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);const Ej=fe("KeyRound",[["path",{d:"M2 18v3c0 .6.4 1 1 1h4v-3h3v-3h2l1.4-1.4a6.5 6.5 0 1 0-4-4Z",key:"167ctg"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]]);const Cj=fe("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);const Nj=fe("Landmark",[["line",{x1:"3",x2:"21",y1:"22",y2:"22",key:"j8o0r"}],["line",{x1:"6",x2:"6",y1:"18",y2:"11",key:"10tf0k"}],["line",{x1:"10",x2:"10",y1:"18",y2:"11",key:"54lgf6"}],["line",{x1:"14",x2:"14",y1:"18",y2:"11",key:"380y"}],["line",{x1:"18",x2:"18",y1:"18",y2:"11",key:"1kevvc"}],["polygon",{points:"12 2 20 7 4 7",key:"jkujk7"}]]);const Tj=fe("Languages",[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]]);const Aj=fe("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);const Ct=fe("Loader2",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);const Rj=fe("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);const Yy=fe("LogIn",[["path",{d:"M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4",key:"u53s6r"}],["polyline",{points:"10 17 15 12 10 7",key:"1ail0h"}],["line",{x1:"15",x2:"3",y1:"12",y2:"12",key:"v6grx8"}]]);const Qy=fe("LogOut",[["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}],["polyline",{points:"16 17 21 12 16 7",key:"1gabdz"}],["line",{x1:"21",x2:"9",y1:"12",y2:"12",key:"1uyos4"}]]);const Pj=fe("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);const qh=fe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);const Hh=fe("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);const Oj=fe("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);const Lj=fe("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);const Ij=fe("Moon",[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]]);const Dj=fe("PauseCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"10",x2:"10",y1:"15",y2:"9",key:"c1nkhi"}],["line",{x1:"14",x2:"14",y1:"15",y2:"9",key:"h65svq"}]]);const Zy=fe("PlayCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polygon",{points:"10 8 16 12 10 16 10 8",key:"1cimsy"}]]);const ex=fe("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);const Vf=fe("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);const Ds=fe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);const Kh=fe("Rocket",[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]]);const Mj=fe("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);const wr=fe("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);const oa=fe("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);const zj=fe("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);const uc=fe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);const Pc=fe("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]]);const Fj=fe("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);const $j=fe("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);const Uj=fe("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);const Bj=fe("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);const Wh=fe("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);const zi=fe("Terminal",[["polyline",{points:"4 17 10 11 4 5",key:"akl6gq"}],["line",{x1:"12",x2:"20",y1:"19",y2:"19",key:"q2wloq"}]]);const qf=fe("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);const Vj=fe("UserPlus",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"19",x2:"19",y1:"8",y2:"14",key:"1bvyxn"}],["line",{x1:"22",x2:"16",y1:"11",y2:"11",key:"1shjgl"}]]);const Oc=fe("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);const tx=fe("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);const nx=fe("VolumeX",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]);const xs=fe("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);const an=fe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);const Ft=fe("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]),Hf=R.createContext({});function Kf(e){const t=R.useRef(null);return t.current===null&&(t.current=e()),t.current}const Lc=R.createContext(null),Wf=R.createContext({transformPagePoint:e=>e,isStatic:!1,reducedMotion:"never"});class qj extends R.Component{getSnapshotBeforeUpdate(t){const n=this.props.childRef.current;if(n&&t.isPresent&&!this.props.isPresent){const r=this.props.sizeRef.current;r.height=n.offsetHeight||0,r.width=n.offsetWidth||0,r.top=n.offsetTop,r.left=n.offsetLeft}return null}componentDidUpdate(){}render(){return this.props.children}}function Hj({children:e,isPresent:t}){const n=R.useId(),r=R.useRef(null),s=R.useRef({width:0,height:0,top:0,left:0}),{nonce:o}=R.useContext(Wf);return R.useInsertionEffect(()=>{const{width:a,height:c,top:d,left:f}=s.current;if(t||!r.current||!a||!c)return;r.current.dataset.motionPopId=n;const p=document.createElement("style");return o&&(p.nonce=o),document.head.appendChild(p),p.sheet&&p.sheet.insertRule(`
|
|
9
|
+
[data-motion-pop-id="${n}"] {
|
|
10
|
+
position: absolute !important;
|
|
11
|
+
width: ${a}px !important;
|
|
12
|
+
height: ${c}px !important;
|
|
13
|
+
top: ${d}px !important;
|
|
14
|
+
left: ${f}px !important;
|
|
15
|
+
}
|
|
16
|
+
`),()=>{document.head.removeChild(p)}},[t]),u.jsx(qj,{isPresent:t,childRef:r,sizeRef:s,children:R.cloneElement(e,{ref:r})})}const Kj=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:o,mode:a})=>{const c=Kf(Wj),d=R.useId(),f=R.useCallback(g=>{c.set(g,!0);for(const y of c.values())if(!y)return;r&&r()},[c,r]),p=R.useMemo(()=>({id:d,initial:t,isPresent:n,custom:s,onExitComplete:f,register:g=>(c.set(g,!1),()=>c.delete(g))}),o?[Math.random(),f]:[n,f]);return R.useMemo(()=>{c.forEach((g,y)=>c.set(y,!1))},[n]),R.useEffect(()=>{!n&&!c.size&&r&&r()},[n]),a==="popLayout"&&(e=u.jsx(Hj,{isPresent:n,children:e})),u.jsx(Lc.Provider,{value:p,children:e})};function Wj(){return new Map}function k_(e=!0){const t=R.useContext(Lc);if(t===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=t,o=R.useId();R.useEffect(()=>{e&&s(o)},[e]);const a=R.useCallback(()=>e&&r&&r(o),[o,r,e]);return!n&&r?[!1,a]:[!0]}const Ul=e=>e.key||"";function rx(e){const t=[];return R.Children.forEach(e,n=>{R.isValidElement(n)&&t.push(n)}),t}const Gf=typeof window<"u",S_=Gf?R.useLayoutEffect:R.useEffect,It=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:o="sync",propagate:a=!1})=>{const[c,d]=k_(a),f=R.useMemo(()=>rx(e),[e]),p=a&&!c?[]:f.map(Ul),g=R.useRef(!0),y=R.useRef(f),x=Kf(()=>new Map),[b,w]=R.useState(f),[k,S]=R.useState(f);S_(()=>{g.current=!1,y.current=f;for(let O=0;O<k.length;O++){const N=Ul(k[O]);p.includes(N)?x.delete(N):x.get(N)!==!0&&x.set(N,!1)}},[k,p.length,p.join("-")]);const E=[];if(f!==b){let O=[...f];for(let N=0;N<k.length;N++){const T=k[N],I=Ul(T);p.includes(I)||(O.splice(N,0,T),E.push(T))}o==="wait"&&E.length&&(O=E),S(rx(O)),w(f);return}const{forceRender:j}=R.useContext(Hf);return u.jsx(u.Fragment,{children:k.map(O=>{const N=Ul(O),T=a&&!c?!1:f===k||p.includes(N),I=()=>{if(x.has(N))x.set(N,!0);else return;let V=!0;x.forEach(U=>{U||(V=!1)}),V&&(j?.(),S(y.current),a&&d?.(),r&&r())};return u.jsx(Kj,{isPresent:T,initial:!g.current||n?void 0:!1,custom:T?void 0:t,presenceAffectsLayout:s,mode:o,onExitComplete:T?void 0:I,children:O},N)})})},Tn=e=>e;let j_=Tn;function Jf(e){let t;return()=>(t===void 0&&(t=e()),t)}const Fi=(e,t,n)=>{const r=t-e;return r===0?1:(n-e)/r},kr=e=>e*1e3,Sr=e=>e/1e3,Gj={useManualTiming:!1};function Jj(e){let t=new Set,n=new Set,r=!1,s=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function c(f){o.has(f)&&(d.schedule(f),e()),f(a)}const d={schedule:(f,p=!1,g=!1)=>{const x=g&&r?t:n;return p&&o.add(f),x.has(f)||x.add(f),f},cancel:f=>{n.delete(f),o.delete(f)},process:f=>{if(a=f,r){s=!0;return}r=!0,[t,n]=[n,t],t.forEach(c),t.clear(),r=!1,s&&(s=!1,d.process(f))}};return d}const Bl=["read","resolveKeyframes","update","preRender","render","postRender"],Xj=40;function E_(e,t){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},o=()=>n=!0,a=Bl.reduce((S,E)=>(S[E]=Jj(o),S),{}),{read:c,resolveKeyframes:d,update:f,preRender:p,render:g,postRender:y}=a,x=()=>{const S=performance.now();n=!1,s.delta=r?1e3/60:Math.max(Math.min(S-s.timestamp,Xj),1),s.timestamp=S,s.isProcessing=!0,c.process(s),d.process(s),f.process(s),p.process(s),g.process(s),y.process(s),s.isProcessing=!1,n&&t&&(r=!1,e(x))},b=()=>{n=!0,r=!0,s.isProcessing||e(x)};return{schedule:Bl.reduce((S,E)=>{const j=a[E];return S[E]=(O,N=!1,T=!1)=>(n||b(),j.schedule(O,N,T)),S},{}),cancel:S=>{for(let E=0;E<Bl.length;E++)a[Bl[E]].cancel(S)},state:s,steps:a}}const{schedule:pt,cancel:ts,state:Ht,steps:Kd}=E_(typeof requestAnimationFrame<"u"?requestAnimationFrame:Tn,!0),C_=R.createContext({strict:!1}),sx={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]},$i={};for(const e in sx)$i[e]={isEnabled:t=>sx[e].some(n=>!!t[n])};function Yj(e){for(const t in e)$i[t]={...$i[t],...e[t]}}const Qj=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","ignoreStrict","viewport"]);function dc(e){return e.startsWith("while")||e.startsWith("drag")&&e!=="draggable"||e.startsWith("layout")||e.startsWith("onTap")||e.startsWith("onPan")||e.startsWith("onLayout")||Qj.has(e)}let N_=e=>!dc(e);function Zj(e){e&&(N_=t=>t.startsWith("on")?!dc(t):e(t))}try{Zj(require("@emotion/is-prop-valid").default)}catch{}function eE(e,t,n){const r={};for(const s in e)s==="values"&&typeof e.values=="object"||(N_(s)||n===!0&&dc(s)||!t&&!dc(s)||e.draggable&&s.startsWith("onDrag"))&&(r[s]=e[s]);return r}function tE(e){if(typeof Proxy>"u")return e;const t=new Map,n=(...r)=>e(...r);return new Proxy(n,{get:(r,s)=>s==="create"?e:(t.has(s)||t.set(s,e(s)),t.get(s))})}const Ic=R.createContext({});function aa(e){return typeof e=="string"||Array.isArray(e)}function Dc(e){return e!==null&&typeof e=="object"&&typeof e.start=="function"}const Xf=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],Yf=["initial",...Xf];function Mc(e){return Dc(e.animate)||Yf.some(t=>aa(e[t]))}function T_(e){return!!(Mc(e)||e.variants)}function nE(e,t){if(Mc(e)){const{initial:n,animate:r}=e;return{initial:n===!1||aa(n)?n:void 0,animate:aa(r)?r:void 0}}return e.inherit!==!1?t:{}}function rE(e){const{initial:t,animate:n}=nE(e,R.useContext(Ic));return R.useMemo(()=>({initial:t,animate:n}),[ix(t),ix(n)])}function ix(e){return Array.isArray(e)?e.join(" "):e}const sE=Symbol.for("motionComponentSymbol");function Ni(e){return e&&typeof e=="object"&&Object.prototype.hasOwnProperty.call(e,"current")}function iE(e,t,n){return R.useCallback(r=>{r&&e.onMount&&e.onMount(r),t&&(r?t.mount(r):t.unmount()),n&&(typeof n=="function"?n(r):Ni(n)&&(n.current=r))},[t])}const Qf=e=>e.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),oE="framerAppearId",A_="data-"+Qf(oE),{schedule:Zf}=E_(queueMicrotask,!1),R_=R.createContext({});function aE(e,t,n,r,s){var o,a;const{visualElement:c}=R.useContext(Ic),d=R.useContext(C_),f=R.useContext(Lc),p=R.useContext(Wf).reducedMotion,g=R.useRef(null);r=r||d.renderer,!g.current&&r&&(g.current=r(e,{visualState:t,parent:c,props:n,presenceContext:f,blockInitialAnimation:f?f.initial===!1:!1,reducedMotionConfig:p}));const y=g.current,x=R.useContext(R_);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&lE(g.current,n,s,x);const b=R.useRef(!1);R.useInsertionEffect(()=>{y&&b.current&&y.update(n,f)});const w=n[A_],k=R.useRef(!!w&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,w))&&((a=window.MotionHasOptimisedAnimation)===null||a===void 0?void 0:a.call(window,w)));return S_(()=>{y&&(b.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),Zf.render(y.render),k.current&&y.animationState&&y.animationState.animateChanges())}),R.useEffect(()=>{y&&(!k.current&&y.animationState&&y.animationState.animateChanges(),k.current&&(queueMicrotask(()=>{var S;(S=window.MotionHandoffMarkAsComplete)===null||S===void 0||S.call(window,w)}),k.current=!1))}),y}function lE(e,t,n,r){const{layoutId:s,layout:o,drag:a,dragConstraints:c,layoutScroll:d,layoutRoot:f}=t;e.projection=new n(e.latestValues,t["data-framer-portal-id"]?void 0:P_(e.parent)),e.projection.setOptions({layoutId:s,layout:o,alwaysMeasureLayout:!!a||c&&Ni(c),visualElement:e,animationType:typeof o=="string"?o:"both",initialPromotionConfig:r,layoutScroll:d,layoutRoot:f})}function P_(e){if(e)return e.options.allowProjection!==!1?e.projection:P_(e.parent)}function cE({preloadedFeatures:e,createVisualElement:t,useRender:n,useVisualState:r,Component:s}){var o,a;e&&Yj(e);function c(f,p){let g;const y={...R.useContext(Wf),...f,layoutId:uE(f)},{isStatic:x}=y,b=rE(f),w=r(f,x);if(!x&&Gf){dE();const k=hE(y);g=k.MeasureLayout,b.visualElement=aE(s,w,y,t,k.ProjectionNode)}return u.jsxs(Ic.Provider,{value:b,children:[g&&b.visualElement?u.jsx(g,{visualElement:b.visualElement,...y}):null,n(s,f,iE(w,b.visualElement,p),w,x,b.visualElement)]})}c.displayName=`motion.${typeof s=="string"?s:`create(${(a=(o=s.displayName)!==null&&o!==void 0?o:s.name)!==null&&a!==void 0?a:""})`}`;const d=R.forwardRef(c);return d[sE]=s,d}function uE({layoutId:e}){const t=R.useContext(Hf).id;return t&&e!==void 0?t+"-"+e:e}function dE(e,t){R.useContext(C_).strict}function hE(e){const{drag:t,layout:n}=$i;if(!t&&!n)return{};const r={...t,...n};return{MeasureLayout:t?.isEnabled(e)||n?.isEnabled(e)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}const fE=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];function ep(e){return typeof e!="string"||e.includes("-")?!1:!!(fE.indexOf(e)>-1||/[A-Z]/u.test(e))}function ox(e){const t=[{},{}];return e?.values.forEach((n,r)=>{t[0][r]=n.get(),t[1][r]=n.getVelocity()}),t}function tp(e,t,n,r){if(typeof t=="function"){const[s,o]=ox(r);t=t(n!==void 0?n:e.custom,s,o)}if(typeof t=="string"&&(t=e.variants&&e.variants[t]),typeof t=="function"){const[s,o]=ox(r);t=t(n!==void 0?n:e.custom,s,o)}return t}const Gh=e=>Array.isArray(e),pE=e=>!!(e&&typeof e=="object"&&e.mix&&e.toValue),mE=e=>Gh(e)?e[e.length-1]||0:e,Qt=e=>!!(e&&e.getVelocity);function rc(e){const t=Qt(e)?e.get():e;return pE(t)?t.toValue():t}function gE({scrapeMotionValuesFromProps:e,createRenderState:t,onUpdate:n},r,s,o){const a={latestValues:yE(r,s,o,e),renderState:t()};return n&&(a.onMount=c=>n({props:r,current:c,...a}),a.onUpdate=c=>n(c)),a}const O_=e=>(t,n)=>{const r=R.useContext(Ic),s=R.useContext(Lc),o=()=>gE(e,t,r,s);return n?o():Kf(o)};function yE(e,t,n,r){const s={},o=r(e,{});for(const y in o)s[y]=rc(o[y]);let{initial:a,animate:c}=e;const d=Mc(e),f=T_(e);t&&f&&!d&&e.inherit!==!1&&(a===void 0&&(a=t.initial),c===void 0&&(c=t.animate));let p=n?n.initial===!1:!1;p=p||a===!1;const g=p?c:a;if(g&&typeof g!="boolean"&&!Dc(g)){const y=Array.isArray(g)?g:[g];for(let x=0;x<y.length;x++){const b=tp(e,y[x]);if(b){const{transitionEnd:w,transition:k,...S}=b;for(const E in S){let j=S[E];if(Array.isArray(j)){const O=p?j.length-1:0;j=j[O]}j!==null&&(s[E]=j)}for(const E in w)s[E]=w[E]}}}return s}const Hi=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],$s=new Set(Hi),L_=e=>t=>typeof t=="string"&&t.startsWith(e),I_=L_("--"),xE=L_("var(--"),np=e=>xE(e)?vE.test(e.split("/*")[0].trim()):!1,vE=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,D_=(e,t)=>t&&typeof e=="number"?t.transform(e):e,Er=(e,t,n)=>n>t?t:n<e?e:n,Ki={test:e=>typeof e=="number",parse:parseFloat,transform:e=>e},la={...Ki,transform:e=>Er(0,1,e)},Vl={...Ki,default:1},ba=e=>({test:t=>typeof t=="string"&&t.endsWith(e)&&t.split(" ").length===1,parse:parseFloat,transform:t=>`${t}${e}`}),Xr=ba("deg"),cr=ba("%"),Me=ba("px"),_E=ba("vh"),bE=ba("vw"),ax={...cr,parse:e=>cr.parse(e)/100,transform:e=>cr.transform(e*100)},wE={borderWidth:Me,borderTopWidth:Me,borderRightWidth:Me,borderBottomWidth:Me,borderLeftWidth:Me,borderRadius:Me,radius:Me,borderTopLeftRadius:Me,borderTopRightRadius:Me,borderBottomRightRadius:Me,borderBottomLeftRadius:Me,width:Me,maxWidth:Me,height:Me,maxHeight:Me,top:Me,right:Me,bottom:Me,left:Me,padding:Me,paddingTop:Me,paddingRight:Me,paddingBottom:Me,paddingLeft:Me,margin:Me,marginTop:Me,marginRight:Me,marginBottom:Me,marginLeft:Me,backgroundPositionX:Me,backgroundPositionY:Me},kE={rotate:Xr,rotateX:Xr,rotateY:Xr,rotateZ:Xr,scale:Vl,scaleX:Vl,scaleY:Vl,scaleZ:Vl,skew:Xr,skewX:Xr,skewY:Xr,distance:Me,translateX:Me,translateY:Me,translateZ:Me,x:Me,y:Me,z:Me,perspective:Me,transformPerspective:Me,opacity:la,originX:ax,originY:ax,originZ:Me},lx={...Ki,transform:Math.round},rp={...wE,...kE,zIndex:lx,size:Me,fillOpacity:la,strokeOpacity:la,numOctaves:lx},SE={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jE=Hi.length;function EE(e,t,n){let r="",s=!0;for(let o=0;o<jE;o++){const a=Hi[o],c=e[a];if(c===void 0)continue;let d=!0;if(typeof c=="number"?d=c===(a.startsWith("scale")?1:0):d=parseFloat(c)===0,!d||n){const f=D_(c,rp[a]);if(!d){s=!1;const p=SE[a]||a;r+=`${p}(${f}) `}n&&(t[a]=f)}}return r=r.trim(),n?r=n(t,s?"":r):s&&(r="none"),r}function sp(e,t,n){const{style:r,vars:s,transformOrigin:o}=e;let a=!1,c=!1;for(const d in t){const f=t[d];if($s.has(d)){a=!0;continue}else if(I_(d)){s[d]=f;continue}else{const p=D_(f,rp[d]);d.startsWith("origin")?(c=!0,o[d]=p):r[d]=p}}if(t.transform||(a||n?r.transform=EE(t,e.transform,n):r.transform&&(r.transform="none")),c){const{originX:d="50%",originY:f="50%",originZ:p=0}=o;r.transformOrigin=`${d} ${f} ${p}`}}const CE={offset:"stroke-dashoffset",array:"stroke-dasharray"},NE={offset:"strokeDashoffset",array:"strokeDasharray"};function TE(e,t,n=1,r=0,s=!0){e.pathLength=1;const o=s?CE:NE;e[o.offset]=Me.transform(-r);const a=Me.transform(t),c=Me.transform(n);e[o.array]=`${a} ${c}`}function cx(e,t,n){return typeof e=="string"?e:Me.transform(t+n*e)}function AE(e,t,n){const r=cx(t,e.x,e.width),s=cx(n,e.y,e.height);return`${r} ${s}`}function ip(e,{attrX:t,attrY:n,attrScale:r,originX:s,originY:o,pathLength:a,pathSpacing:c=1,pathOffset:d=0,...f},p,g){if(sp(e,f,g),p){e.style.viewBox&&(e.attrs.viewBox=e.style.viewBox);return}e.attrs=e.style,e.style={};const{attrs:y,style:x,dimensions:b}=e;y.transform&&(b&&(x.transform=y.transform),delete y.transform),b&&(s!==void 0||o!==void 0||x.transform)&&(x.transformOrigin=AE(b,s!==void 0?s:.5,o!==void 0?o:.5)),t!==void 0&&(y.x=t),n!==void 0&&(y.y=n),r!==void 0&&(y.scale=r),a!==void 0&&TE(y,a,c,d,!1)}const op=()=>({style:{},transform:{},transformOrigin:{},vars:{}}),M_=()=>({...op(),attrs:{}}),ap=e=>typeof e=="string"&&e.toLowerCase()==="svg";function z_(e,{style:t,vars:n},r,s){Object.assign(e.style,t,s&&s.getProjectionStyles(r));for(const o in n)e.style.setProperty(o,n[o])}const F_=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]);function $_(e,t,n,r){z_(e,t,void 0,r);for(const s in t.attrs)e.setAttribute(F_.has(s)?s:Qf(s),t.attrs[s])}const hc={};function RE(e){Object.assign(hc,e)}function U_(e,{layout:t,layoutId:n}){return $s.has(e)||e.startsWith("origin")||(t||n!==void 0)&&(!!hc[e]||e==="opacity")}function lp(e,t,n){var r;const{style:s}=e,o={};for(const a in s)(Qt(s[a])||t.style&&Qt(t.style[a])||U_(a,e)||((r=n?.getValue(a))===null||r===void 0?void 0:r.liveStyle)!==void 0)&&(o[a]=s[a]);return o}function B_(e,t,n){const r=lp(e,t,n);for(const s in e)if(Qt(e[s])||Qt(t[s])){const o=Hi.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[o]=e[s]}return r}function PE(e,t){try{t.dimensions=typeof e.getBBox=="function"?e.getBBox():e.getBoundingClientRect()}catch{t.dimensions={x:0,y:0,width:0,height:0}}}const ux=["x","y","width","height","cx","cy","r"],OE={useVisualState:O_({scrapeMotionValuesFromProps:B_,createRenderState:M_,onUpdate:({props:e,prevProps:t,current:n,renderState:r,latestValues:s})=>{if(!n)return;let o=!!e.drag;if(!o){for(const c in s)if($s.has(c)){o=!0;break}}if(!o)return;let a=!t;if(t)for(let c=0;c<ux.length;c++){const d=ux[c];e[d]!==t[d]&&(a=!0)}a&&pt.read(()=>{PE(n,r),pt.render(()=>{ip(r,s,ap(n.tagName),e.transformTemplate),$_(n,r)})})}})},LE={useVisualState:O_({scrapeMotionValuesFromProps:lp,createRenderState:op})};function V_(e,t,n){for(const r in t)!Qt(t[r])&&!U_(r,n)&&(e[r]=t[r])}function IE({transformTemplate:e},t){return R.useMemo(()=>{const n=op();return sp(n,t,e),Object.assign({},n.vars,n.style)},[t])}function DE(e,t){const n=e.style||{},r={};return V_(r,n,e),Object.assign(r,IE(e,t)),r}function ME(e,t){const n={},r=DE(e,t);return e.drag&&e.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=e.drag===!0?"none":`pan-${e.drag==="x"?"y":"x"}`),e.tabIndex===void 0&&(e.onTap||e.onTapStart||e.whileTap)&&(n.tabIndex=0),n.style=r,n}function zE(e,t,n,r){const s=R.useMemo(()=>{const o=M_();return ip(o,t,ap(r),e.transformTemplate),{...o.attrs,style:{...o.style}}},[t]);if(e.style){const o={};V_(o,e.style,e),s.style={...o,...s.style}}return s}function FE(e=!1){return(n,r,s,{latestValues:o},a)=>{const d=(ep(n)?zE:ME)(r,o,a,n),f=eE(r,typeof n=="string",e),p=n!==R.Fragment?{...f,...d,ref:s}:{},{children:g}=r,y=R.useMemo(()=>Qt(g)?g.get():g,[g]);return R.createElement(n,{...p,children:y})}}function $E(e,t){return function(r,{forwardMotionProps:s}={forwardMotionProps:!1}){const a={...ep(r)?OE:LE,preloadedFeatures:e,useRender:FE(s),createVisualElement:t,Component:r};return cE(a)}}function q_(e,t){if(!Array.isArray(t))return!1;const n=t.length;if(n!==e.length)return!1;for(let r=0;r<n;r++)if(t[r]!==e[r])return!1;return!0}function zc(e,t,n){const r=e.getProps();return tp(r,t,n!==void 0?n:r.custom,e)}const UE=Jf(()=>window.ScrollTimeline!==void 0);class BE{constructor(t){this.stop=()=>this.runAll("stop"),this.animations=t.filter(Boolean)}get finished(){return Promise.all(this.animations.map(t=>"finished"in t?t.finished:t))}getAll(t){return this.animations[0][t]}setAll(t,n){for(let r=0;r<this.animations.length;r++)this.animations[r][t]=n}attachTimeline(t,n){const r=this.animations.map(s=>{if(UE()&&s.attachTimeline)return s.attachTimeline(t);if(typeof n=="function")return n(s)});return()=>{r.forEach((s,o)=>{s&&s(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(t){this.setAll("time",t)}get speed(){return this.getAll("speed")}set speed(t){this.setAll("speed",t)}get startTime(){return this.getAll("startTime")}get duration(){let t=0;for(let n=0;n<this.animations.length;n++)t=Math.max(t,this.animations[n].duration);return t}runAll(t){this.animations.forEach(n=>n[t]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class VE extends BE{then(t,n){return Promise.all(this.animations).then(t).catch(n)}}function cp(e,t){return e?e[t]||e.default||e:void 0}const Jh=2e4;function H_(e){let t=0;const n=50;let r=e.next(t);for(;!r.done&&t<Jh;)t+=n,r=e.next(t);return t>=Jh?1/0:t}function up(e){return typeof e=="function"}function dx(e,t){e.timeline=t,e.onfinish=null}const dp=e=>Array.isArray(e)&&typeof e[0]=="number",qE={linearEasing:void 0};function HE(e,t){const n=Jf(e);return()=>{var r;return(r=qE[t])!==null&&r!==void 0?r:n()}}const fc=HE(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),K_=(e,t,n=10)=>{let r="";const s=Math.max(Math.round(t/n),2);for(let o=0;o<s;o++)r+=e(Fi(0,s-1,o))+", ";return`linear(${r.substring(0,r.length-2)})`};function W_(e){return!!(typeof e=="function"&&fc()||!e||typeof e=="string"&&(e in Xh||fc())||dp(e)||Array.isArray(e)&&e.every(W_))}const qo=([e,t,n,r])=>`cubic-bezier(${e}, ${t}, ${n}, ${r})`,Xh={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:qo([0,.65,.55,1]),circOut:qo([.55,0,1,.45]),backIn:qo([.31,.01,.66,-.59]),backOut:qo([.33,1.53,.69,.99])};function G_(e,t){if(e)return typeof e=="function"&&fc()?K_(e,t):dp(e)?qo(e):Array.isArray(e)?e.map(n=>G_(n,t)||Xh.easeOut):Xh[e]}const Jn={x:!1,y:!1};function J_(){return Jn.x||Jn.y}function KE(e,t,n){var r;if(e instanceof Element)return[e];if(typeof e=="string"){let s=document;const o=(r=void 0)!==null&&r!==void 0?r:s.querySelectorAll(e);return o?Array.from(o):[]}return Array.from(e)}function X_(e,t){const n=KE(e),r=new AbortController,s={passive:!0,...t,signal:r.signal};return[n,s,()=>r.abort()]}function hx(e){return t=>{t.pointerType==="touch"||J_()||e(t)}}function WE(e,t,n={}){const[r,s,o]=X_(e,n),a=hx(c=>{const{target:d}=c,f=t(c);if(typeof f!="function"||!d)return;const p=hx(g=>{f(g),d.removeEventListener("pointerleave",p)});d.addEventListener("pointerleave",p,s)});return r.forEach(c=>{c.addEventListener("pointerenter",a,s)}),o}const Y_=(e,t)=>t?e===t?!0:Y_(e,t.parentElement):!1,hp=e=>e.pointerType==="mouse"?typeof e.button!="number"||e.button<=0:e.isPrimary!==!1,GE=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function JE(e){return GE.has(e.tagName)||e.tabIndex!==-1}const Ho=new WeakSet;function fx(e){return t=>{t.key==="Enter"&&e(t)}}function Wd(e,t){e.dispatchEvent(new PointerEvent("pointer"+t,{isPrimary:!0,bubbles:!0}))}const XE=(e,t)=>{const n=e.currentTarget;if(!n)return;const r=fx(()=>{if(Ho.has(n))return;Wd(n,"down");const s=fx(()=>{Wd(n,"up")}),o=()=>Wd(n,"cancel");n.addEventListener("keyup",s,t),n.addEventListener("blur",o,t)});n.addEventListener("keydown",r,t),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),t)};function px(e){return hp(e)&&!J_()}function YE(e,t,n={}){const[r,s,o]=X_(e,n),a=c=>{const d=c.currentTarget;if(!px(c)||Ho.has(d))return;Ho.add(d);const f=t(c),p=(x,b)=>{window.removeEventListener("pointerup",g),window.removeEventListener("pointercancel",y),!(!px(x)||!Ho.has(d))&&(Ho.delete(d),typeof f=="function"&&f(x,{success:b}))},g=x=>{p(x,n.useGlobalTarget||Y_(d,x.target))},y=x=>{p(x,!1)};window.addEventListener("pointerup",g,s),window.addEventListener("pointercancel",y,s)};return r.forEach(c=>{!JE(c)&&c.getAttribute("tabindex")===null&&(c.tabIndex=0),(n.useGlobalTarget?window:c).addEventListener("pointerdown",a,s),c.addEventListener("focus",f=>XE(f,s),s)}),o}function QE(e){return e==="x"||e==="y"?Jn[e]?null:(Jn[e]=!0,()=>{Jn[e]=!1}):Jn.x||Jn.y?null:(Jn.x=Jn.y=!0,()=>{Jn.x=Jn.y=!1})}const Q_=new Set(["width","height","top","left","right","bottom",...Hi]);let sc;function ZE(){sc=void 0}const ur={now:()=>(sc===void 0&&ur.set(Ht.isProcessing||Gj.useManualTiming?Ht.timestamp:performance.now()),sc),set:e=>{sc=e,queueMicrotask(ZE)}};function fp(e,t){e.indexOf(t)===-1&&e.push(t)}function pp(e,t){const n=e.indexOf(t);n>-1&&e.splice(n,1)}class mp{constructor(){this.subscriptions=[]}add(t){return fp(this.subscriptions,t),()=>pp(this.subscriptions,t)}notify(t,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](t,n,r);else for(let o=0;o<s;o++){const a=this.subscriptions[o];a&&a(t,n,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function Z_(e,t){return t?e*(1e3/t):0}const mx=30,eC=e=>!isNaN(parseFloat(e));class tC{constructor(t,n={}){this.version="11.18.2",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(r,s=!0)=>{const o=ur.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),s&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(t),this.owner=n.owner}setCurrent(t){this.current=t,this.updatedAt=ur.now(),this.canTrackVelocity===null&&t!==void 0&&(this.canTrackVelocity=eC(this.current))}setPrevFrameValue(t=this.current){this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt}onChange(t){return this.on("change",t)}on(t,n){this.events[t]||(this.events[t]=new mp);const r=this.events[t].add(n);return t==="change"?()=>{r(),pt.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const t in this.events)this.events[t].clear()}attach(t,n){this.passiveEffect=t,this.stopPassiveEffect=n}set(t,n=!0){!n||!this.passiveEffect?this.updateAndNotify(t,n):this.passiveEffect(t,this.updateAndNotify)}setWithVelocity(t,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=t,this.prevUpdatedAt=this.updatedAt-r}jump(t,n=!0){this.updateAndNotify(t),this.prev=t,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const t=ur.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||t-this.updatedAt>mx)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,mx);return Z_(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(t){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=t(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function ca(e,t){return new tC(e,t)}function nC(e,t,n){e.hasValue(t)?e.getValue(t).set(n):e.addValue(t,ca(n))}function rC(e,t){const n=zc(e,t);let{transitionEnd:r={},transition:s={},...o}=n||{};o={...o,...r};for(const a in o){const c=mE(o[a]);nC(e,a,c)}}function sC(e){return!!(Qt(e)&&e.add)}function Yh(e,t){const n=e.getValue("willChange");if(sC(n))return n.add(t)}function eb(e){return e.props[A_]}const tb=(e,t,n)=>(((1-3*n+3*t)*e+(3*n-6*t))*e+3*t)*e,iC=1e-7,oC=12;function aC(e,t,n,r,s){let o,a,c=0;do a=t+(n-t)/2,o=tb(a,r,s)-e,o>0?n=a:t=a;while(Math.abs(o)>iC&&++c<oC);return a}function wa(e,t,n,r){if(e===t&&n===r)return Tn;const s=o=>aC(o,0,1,e,n);return o=>o===0||o===1?o:tb(s(o),t,r)}const nb=e=>t=>t<=.5?e(2*t)/2:(2-e(2*(1-t)))/2,rb=e=>t=>1-e(1-t),sb=wa(.33,1.53,.69,.99),gp=rb(sb),ib=nb(gp),ob=e=>(e*=2)<1?.5*gp(e):.5*(2-Math.pow(2,-10*(e-1))),yp=e=>1-Math.sin(Math.acos(e)),ab=rb(yp),lb=nb(yp),cb=e=>/^0[^.\s]+$/u.test(e);function lC(e){return typeof e=="number"?e===0:e!==null?e==="none"||e==="0"||cb(e):!0}const Go=e=>Math.round(e*1e5)/1e5,xp=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function cC(e){return e==null}const uC=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,vp=(e,t)=>n=>!!(typeof n=="string"&&uC.test(n)&&n.startsWith(e)||t&&!cC(n)&&Object.prototype.hasOwnProperty.call(n,t)),ub=(e,t,n)=>r=>{if(typeof r!="string")return r;const[s,o,a,c]=r.match(xp);return{[e]:parseFloat(s),[t]:parseFloat(o),[n]:parseFloat(a),alpha:c!==void 0?parseFloat(c):1}},dC=e=>Er(0,255,e),Gd={...Ki,transform:e=>Math.round(dC(e))},Ns={test:vp("rgb","red"),parse:ub("red","green","blue"),transform:({red:e,green:t,blue:n,alpha:r=1})=>"rgba("+Gd.transform(e)+", "+Gd.transform(t)+", "+Gd.transform(n)+", "+Go(la.transform(r))+")"};function hC(e){let t="",n="",r="",s="";return e.length>5?(t=e.substring(1,3),n=e.substring(3,5),r=e.substring(5,7),s=e.substring(7,9)):(t=e.substring(1,2),n=e.substring(2,3),r=e.substring(3,4),s=e.substring(4,5),t+=t,n+=n,r+=r,s+=s),{red:parseInt(t,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Qh={test:vp("#"),parse:hC,transform:Ns.transform},Ti={test:vp("hsl","hue"),parse:ub("hue","saturation","lightness"),transform:({hue:e,saturation:t,lightness:n,alpha:r=1})=>"hsla("+Math.round(e)+", "+cr.transform(Go(t))+", "+cr.transform(Go(n))+", "+Go(la.transform(r))+")"},Xt={test:e=>Ns.test(e)||Qh.test(e)||Ti.test(e),parse:e=>Ns.test(e)?Ns.parse(e):Ti.test(e)?Ti.parse(e):Qh.parse(e),transform:e=>typeof e=="string"?e:e.hasOwnProperty("red")?Ns.transform(e):Ti.transform(e)},fC=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function pC(e){var t,n;return isNaN(e)&&typeof e=="string"&&(((t=e.match(xp))===null||t===void 0?void 0:t.length)||0)+(((n=e.match(fC))===null||n===void 0?void 0:n.length)||0)>0}const db="number",hb="color",mC="var",gC="var(",gx="${}",yC=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function ua(e){const t=e.toString(),n=[],r={color:[],number:[],var:[]},s=[];let o=0;const c=t.replace(yC,d=>(Xt.test(d)?(r.color.push(o),s.push(hb),n.push(Xt.parse(d))):d.startsWith(gC)?(r.var.push(o),s.push(mC),n.push(d)):(r.number.push(o),s.push(db),n.push(parseFloat(d))),++o,gx)).split(gx);return{values:n,split:c,indexes:r,types:s}}function fb(e){return ua(e).values}function pb(e){const{split:t,types:n}=ua(e),r=t.length;return s=>{let o="";for(let a=0;a<r;a++)if(o+=t[a],s[a]!==void 0){const c=n[a];c===db?o+=Go(s[a]):c===hb?o+=Xt.transform(s[a]):o+=s[a]}return o}}const xC=e=>typeof e=="number"?0:e;function vC(e){const t=fb(e);return pb(e)(t.map(xC))}const ns={test:pC,parse:fb,createTransformer:pb,getAnimatableNone:vC},_C=new Set(["brightness","contrast","saturate","opacity"]);function bC(e){const[t,n]=e.slice(0,-1).split("(");if(t==="drop-shadow")return e;const[r]=n.match(xp)||[];if(!r)return e;const s=n.replace(r,"");let o=_C.has(t)?1:0;return r!==n&&(o*=100),t+"("+o+s+")"}const wC=/\b([a-z-]*)\(.*?\)/gu,Zh={...ns,getAnimatableNone:e=>{const t=e.match(wC);return t?t.map(bC).join(" "):e}},kC={...rp,color:Xt,backgroundColor:Xt,outlineColor:Xt,fill:Xt,stroke:Xt,borderColor:Xt,borderTopColor:Xt,borderRightColor:Xt,borderBottomColor:Xt,borderLeftColor:Xt,filter:Zh,WebkitFilter:Zh},_p=e=>kC[e];function mb(e,t){let n=_p(e);return n!==Zh&&(n=ns),n.getAnimatableNone?n.getAnimatableNone(t):void 0}const SC=new Set(["auto","none","0"]);function jC(e,t,n){let r=0,s;for(;r<e.length&&!s;){const o=e[r];typeof o=="string"&&!SC.has(o)&&ua(o).values.length&&(s=e[r]),r++}if(s&&n)for(const o of t)e[o]=mb(n,s)}const yx=e=>e===Ki||e===Me,xx=(e,t)=>parseFloat(e.split(", ")[t]),vx=(e,t)=>(n,{transform:r})=>{if(r==="none"||!r)return 0;const s=r.match(/^matrix3d\((.+)\)$/u);if(s)return xx(s[1],t);{const o=r.match(/^matrix\((.+)\)$/u);return o?xx(o[1],e):0}},EC=new Set(["x","y","z"]),CC=Hi.filter(e=>!EC.has(e));function NC(e){const t=[];return CC.forEach(n=>{const r=e.getValue(n);r!==void 0&&(t.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),t}const Ui={width:({x:e},{paddingLeft:t="0",paddingRight:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),height:({y:e},{paddingTop:t="0",paddingBottom:n="0"})=>e.max-e.min-parseFloat(t)-parseFloat(n),top:(e,{top:t})=>parseFloat(t),left:(e,{left:t})=>parseFloat(t),bottom:({y:e},{top:t})=>parseFloat(t)+(e.max-e.min),right:({x:e},{left:t})=>parseFloat(t)+(e.max-e.min),x:vx(4,13),y:vx(5,14)};Ui.translateX=Ui.x;Ui.translateY=Ui.y;const Os=new Set;let ef=!1,tf=!1;function gb(){if(tf){const e=Array.from(Os).filter(r=>r.needsMeasurement),t=new Set(e.map(r=>r.element)),n=new Map;t.forEach(r=>{const s=NC(r);s.length&&(n.set(r,s),r.render())}),e.forEach(r=>r.measureInitialState()),t.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([o,a])=>{var c;(c=r.getValue(o))===null||c===void 0||c.set(a)})}),e.forEach(r=>r.measureEndState()),e.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}tf=!1,ef=!1,Os.forEach(e=>e.complete()),Os.clear()}function yb(){Os.forEach(e=>{e.readKeyframes(),e.needsMeasurement&&(tf=!0)})}function TC(){yb(),gb()}class bp{constructor(t,n,r,s,o,a=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...t],this.onComplete=n,this.name=r,this.motionValue=s,this.element=o,this.isAsync=a}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Os.add(this),ef||(ef=!0,pt.read(yb),pt.resolveKeyframes(gb))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:t,name:n,element:r,motionValue:s}=this;for(let o=0;o<t.length;o++)if(t[o]===null)if(o===0){const a=s?.get(),c=t[t.length-1];if(a!==void 0)t[0]=a;else if(r&&n){const d=r.readValue(n,c);d!=null&&(t[0]=d)}t[0]===void 0&&(t[0]=c),s&&a===void 0&&s.set(t[0])}else t[o]=t[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Os.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Os.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const xb=e=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(e),AC=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function RC(e){const t=AC.exec(e);if(!t)return[,];const[,n,r,s]=t;return[`--${n??r}`,s]}function vb(e,t,n=1){const[r,s]=RC(e);if(!r)return;const o=window.getComputedStyle(t).getPropertyValue(r);if(o){const a=o.trim();return xb(a)?parseFloat(a):a}return np(s)?vb(s,t,n+1):s}const _b=e=>t=>t.test(e),PC={test:e=>e==="auto",parse:e=>e},bb=[Ki,Me,cr,Xr,bE,_E,PC],_x=e=>bb.find(_b(e));class wb extends bp{constructor(t,n,r,s,o){super(t,n,r,s,o,!0)}readKeyframes(){const{unresolvedKeyframes:t,element:n,name:r}=this;if(!n||!n.current)return;super.readKeyframes();for(let d=0;d<t.length;d++){let f=t[d];if(typeof f=="string"&&(f=f.trim(),np(f))){const p=vb(f,n.current);p!==void 0&&(t[d]=p),d===t.length-1&&(this.finalKeyframe=f)}}if(this.resolveNoneKeyframes(),!Q_.has(r)||t.length!==2)return;const[s,o]=t,a=_x(s),c=_x(o);if(a!==c)if(yx(a)&&yx(c))for(let d=0;d<t.length;d++){const f=t[d];typeof f=="string"&&(t[d]=parseFloat(f))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:t,name:n}=this,r=[];for(let s=0;s<t.length;s++)lC(t[s])&&r.push(s);r.length&&jC(t,r,n)}measureInitialState(){const{element:t,unresolvedKeyframes:n,name:r}=this;if(!t||!t.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=Ui[r](t.measureViewportBox(),window.getComputedStyle(t.current)),n[0]=this.measuredOrigin;const s=n[n.length-1];s!==void 0&&t.getValue(r,s).jump(s,!1)}measureEndState(){var t;const{element:n,name:r,unresolvedKeyframes:s}=this;if(!n||!n.current)return;const o=n.getValue(r);o&&o.jump(this.measuredOrigin,!1);const a=s.length-1,c=s[a];s[a]=Ui[r](n.measureViewportBox(),window.getComputedStyle(n.current)),c!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=c),!((t=this.removedTransforms)===null||t===void 0)&&t.length&&this.removedTransforms.forEach(([d,f])=>{n.getValue(d).set(f)}),this.resolveNoneKeyframes()}}const bx=(e,t)=>t==="zIndex"?!1:!!(typeof e=="number"||Array.isArray(e)||typeof e=="string"&&(ns.test(e)||e==="0")&&!e.startsWith("url("));function OC(e){const t=e[0];if(e.length===1)return!0;for(let n=0;n<e.length;n++)if(e[n]!==t)return!0}function LC(e,t,n,r){const s=e[0];if(s===null)return!1;if(t==="display"||t==="visibility")return!0;const o=e[e.length-1],a=bx(s,t),c=bx(o,t);return!a||!c?!1:OC(e)||(n==="spring"||up(n))&&r}const IC=e=>e!==null;function Fc(e,{repeat:t,repeatType:n="loop"},r){const s=e.filter(IC),o=t&&n!=="loop"&&t%2===1?0:s.length-1;return!o||r===void 0?s[o]:r}const DC=40;class kb{constructor({autoplay:t=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:o=0,repeatType:a="loop",...c}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=ur.now(),this.options={autoplay:t,delay:n,type:r,repeat:s,repeatDelay:o,repeatType:a,...c},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>DC?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&TC(),this._resolved}onKeyframesResolved(t,n){this.resolvedAt=ur.now(),this.hasAttemptedResolve=!0;const{name:r,type:s,velocity:o,delay:a,onComplete:c,onUpdate:d,isGenerator:f}=this.options;if(!f&&!LC(t,r,s,o))if(a)this.options.duration=0;else{d&&d(Fc(t,this.options,n)),c&&c(),this.resolveFinishedPromise();return}const p=this.initPlayback(t,n);p!==!1&&(this._resolved={keyframes:t,finalKeyframe:n,...p},this.onPostResolved())}onPostResolved(){}then(t,n){return this.currentFinishedPromise.then(t,n)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(t=>{this.resolveFinishedPromise=t})}}const _t=(e,t,n)=>e+(t-e)*n;function Jd(e,t,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?e+(t-e)*6*n:n<1/2?t:n<2/3?e+(t-e)*(2/3-n)*6:e}function MC({hue:e,saturation:t,lightness:n,alpha:r}){e/=360,t/=100,n/=100;let s=0,o=0,a=0;if(!t)s=o=a=n;else{const c=n<.5?n*(1+t):n+t-n*t,d=2*n-c;s=Jd(d,c,e+1/3),o=Jd(d,c,e),a=Jd(d,c,e-1/3)}return{red:Math.round(s*255),green:Math.round(o*255),blue:Math.round(a*255),alpha:r}}function pc(e,t){return n=>n>0?t:e}const Xd=(e,t,n)=>{const r=e*e,s=n*(t*t-r)+r;return s<0?0:Math.sqrt(s)},zC=[Qh,Ns,Ti],FC=e=>zC.find(t=>t.test(e));function wx(e){const t=FC(e);if(!t)return!1;let n=t.parse(e);return t===Ti&&(n=MC(n)),n}const kx=(e,t)=>{const n=wx(e),r=wx(t);if(!n||!r)return pc(e,t);const s={...n};return o=>(s.red=Xd(n.red,r.red,o),s.green=Xd(n.green,r.green,o),s.blue=Xd(n.blue,r.blue,o),s.alpha=_t(n.alpha,r.alpha,o),Ns.transform(s))},$C=(e,t)=>n=>t(e(n)),ka=(...e)=>e.reduce($C),nf=new Set(["none","hidden"]);function UC(e,t){return nf.has(e)?n=>n<=0?e:t:n=>n>=1?t:e}function BC(e,t){return n=>_t(e,t,n)}function wp(e){return typeof e=="number"?BC:typeof e=="string"?np(e)?pc:Xt.test(e)?kx:HC:Array.isArray(e)?Sb:typeof e=="object"?Xt.test(e)?kx:VC:pc}function Sb(e,t){const n=[...e],r=n.length,s=e.map((o,a)=>wp(o)(o,t[a]));return o=>{for(let a=0;a<r;a++)n[a]=s[a](o);return n}}function VC(e,t){const n={...e,...t},r={};for(const s in n)e[s]!==void 0&&t[s]!==void 0&&(r[s]=wp(e[s])(e[s],t[s]));return s=>{for(const o in r)n[o]=r[o](s);return n}}function qC(e,t){var n;const r=[],s={color:0,var:0,number:0};for(let o=0;o<t.values.length;o++){const a=t.types[o],c=e.indexes[a][s[a]],d=(n=e.values[c])!==null&&n!==void 0?n:0;r[o]=d,s[a]++}return r}const HC=(e,t)=>{const n=ns.createTransformer(t),r=ua(e),s=ua(t);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?nf.has(e)&&!s.values.length||nf.has(t)&&!r.values.length?UC(e,t):ka(Sb(qC(r,s),s.values),n):pc(e,t)};function jb(e,t,n){return typeof e=="number"&&typeof t=="number"&&typeof n=="number"?_t(e,t,n):wp(e)(e,t)}const KC=5;function Eb(e,t,n){const r=Math.max(t-KC,0);return Z_(n-e(r),t-r)}const kt={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1},Yd=.001;function WC({duration:e=kt.duration,bounce:t=kt.bounce,velocity:n=kt.velocity,mass:r=kt.mass}){let s,o,a=1-t;a=Er(kt.minDamping,kt.maxDamping,a),e=Er(kt.minDuration,kt.maxDuration,Sr(e)),a<1?(s=f=>{const p=f*a,g=p*e,y=p-n,x=rf(f,a),b=Math.exp(-g);return Yd-y/x*b},o=f=>{const g=f*a*e,y=g*n+n,x=Math.pow(a,2)*Math.pow(f,2)*e,b=Math.exp(-g),w=rf(Math.pow(f,2),a);return(-s(f)+Yd>0?-1:1)*((y-x)*b)/w}):(s=f=>{const p=Math.exp(-f*e),g=(f-n)*e+1;return-Yd+p*g},o=f=>{const p=Math.exp(-f*e),g=(n-f)*(e*e);return p*g});const c=5/e,d=JC(s,o,c);if(e=kr(e),isNaN(d))return{stiffness:kt.stiffness,damping:kt.damping,duration:e};{const f=Math.pow(d,2)*r;return{stiffness:f,damping:a*2*Math.sqrt(r*f),duration:e}}}const GC=12;function JC(e,t,n){let r=n;for(let s=1;s<GC;s++)r=r-e(r)/t(r);return r}function rf(e,t){return e*Math.sqrt(1-t*t)}const XC=["duration","bounce"],YC=["stiffness","damping","mass"];function Sx(e,t){return t.some(n=>e[n]!==void 0)}function QC(e){let t={velocity:kt.velocity,stiffness:kt.stiffness,damping:kt.damping,mass:kt.mass,isResolvedFromDuration:!1,...e};if(!Sx(e,YC)&&Sx(e,XC))if(e.visualDuration){const n=e.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,o=2*Er(.05,1,1-(e.bounce||0))*Math.sqrt(s);t={...t,mass:kt.mass,stiffness:s,damping:o}}else{const n=WC(e);t={...t,...n,mass:kt.mass},t.isResolvedFromDuration=!0}return t}function Cb(e=kt.visualDuration,t=kt.bounce){const n=typeof e!="object"?{visualDuration:e,keyframes:[0,1],bounce:t}:e;let{restSpeed:r,restDelta:s}=n;const o=n.keyframes[0],a=n.keyframes[n.keyframes.length-1],c={done:!1,value:o},{stiffness:d,damping:f,mass:p,duration:g,velocity:y,isResolvedFromDuration:x}=QC({...n,velocity:-Sr(n.velocity||0)}),b=y||0,w=f/(2*Math.sqrt(d*p)),k=a-o,S=Sr(Math.sqrt(d/p)),E=Math.abs(k)<5;r||(r=E?kt.restSpeed.granular:kt.restSpeed.default),s||(s=E?kt.restDelta.granular:kt.restDelta.default);let j;if(w<1){const N=rf(S,w);j=T=>{const I=Math.exp(-w*S*T);return a-I*((b+w*S*k)/N*Math.sin(N*T)+k*Math.cos(N*T))}}else if(w===1)j=N=>a-Math.exp(-S*N)*(k+(b+S*k)*N);else{const N=S*Math.sqrt(w*w-1);j=T=>{const I=Math.exp(-w*S*T),V=Math.min(N*T,300);return a-I*((b+w*S*k)*Math.sinh(V)+N*k*Math.cosh(V))/N}}const O={calculatedDuration:x&&g||null,next:N=>{const T=j(N);if(x)c.done=N>=g;else{let I=0;w<1&&(I=N===0?kr(b):Eb(j,N,T));const V=Math.abs(I)<=r,U=Math.abs(a-T)<=s;c.done=V&&U}return c.value=c.done?a:T,c},toString:()=>{const N=Math.min(H_(O),Jh),T=K_(I=>O.next(N*I).value,N,30);return N+"ms "+T}};return O}function jx({keyframes:e,velocity:t=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:o=500,modifyTarget:a,min:c,max:d,restDelta:f=.5,restSpeed:p}){const g=e[0],y={done:!1,value:g},x=V=>c!==void 0&&V<c||d!==void 0&&V>d,b=V=>c===void 0?d:d===void 0||Math.abs(c-V)<Math.abs(d-V)?c:d;let w=n*t;const k=g+w,S=a===void 0?k:a(k);S!==k&&(w=S-g);const E=V=>-w*Math.exp(-V/r),j=V=>S+E(V),O=V=>{const U=E(V),D=j(V);y.done=Math.abs(U)<=f,y.value=y.done?S:D};let N,T;const I=V=>{x(y.value)&&(N=V,T=Cb({keyframes:[y.value,b(y.value)],velocity:Eb(j,V,y.value),damping:s,stiffness:o,restDelta:f,restSpeed:p}))};return I(0),{calculatedDuration:null,next:V=>{let U=!1;return!T&&N===void 0&&(U=!0,O(V),I(V)),N!==void 0&&V>=N?T.next(V-N):(!U&&O(V),y)}}}const ZC=wa(.42,0,1,1),e2=wa(0,0,.58,1),Nb=wa(.42,0,.58,1),t2=e=>Array.isArray(e)&&typeof e[0]!="number",n2={linear:Tn,easeIn:ZC,easeInOut:Nb,easeOut:e2,circIn:yp,circInOut:lb,circOut:ab,backIn:gp,backInOut:ib,backOut:sb,anticipate:ob},Ex=e=>{if(dp(e)){j_(e.length===4);const[t,n,r,s]=e;return wa(t,n,r,s)}else if(typeof e=="string")return n2[e];return e};function r2(e,t,n){const r=[],s=n||jb,o=e.length-1;for(let a=0;a<o;a++){let c=s(e[a],e[a+1]);if(t){const d=Array.isArray(t)?t[a]||Tn:t;c=ka(d,c)}r.push(c)}return r}function s2(e,t,{clamp:n=!0,ease:r,mixer:s}={}){const o=e.length;if(j_(o===t.length),o===1)return()=>t[0];if(o===2&&t[0]===t[1])return()=>t[1];const a=e[0]===e[1];e[0]>e[o-1]&&(e=[...e].reverse(),t=[...t].reverse());const c=r2(t,r,s),d=c.length,f=p=>{if(a&&p<e[0])return t[0];let g=0;if(d>1)for(;g<e.length-2&&!(p<e[g+1]);g++);const y=Fi(e[g],e[g+1],p);return c[g](y)};return n?p=>f(Er(e[0],e[o-1],p)):f}function i2(e,t){const n=e[e.length-1];for(let r=1;r<=t;r++){const s=Fi(0,t,r);e.push(_t(n,1,s))}}function o2(e){const t=[0];return i2(t,e.length-1),t}function a2(e,t){return e.map(n=>n*t)}function l2(e,t){return e.map(()=>t||Nb).splice(0,e.length-1)}function mc({duration:e=300,keyframes:t,times:n,ease:r="easeInOut"}){const s=t2(r)?r.map(Ex):Ex(r),o={done:!1,value:t[0]},a=a2(n&&n.length===t.length?n:o2(t),e),c=s2(a,t,{ease:Array.isArray(s)?s:l2(t,s)});return{calculatedDuration:e,next:d=>(o.value=c(d),o.done=d>=e,o)}}const c2=e=>{const t=({timestamp:n})=>e(n);return{start:()=>pt.update(t,!0),stop:()=>ts(t),now:()=>Ht.isProcessing?Ht.timestamp:ur.now()}},u2={decay:jx,inertia:jx,tween:mc,keyframes:mc,spring:Cb},d2=e=>e/100;class kp extends kb{constructor(t){super(t),this.holdTime=null,this.cancelTime=null,this.currentTime=0,this.playbackSpeed=1,this.pendingPlayState="running",this.startTime=null,this.state="idle",this.stop=()=>{if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.teardown();const{onStop:d}=this.options;d&&d()};const{name:n,motionValue:r,element:s,keyframes:o}=this.options,a=s?.KeyframeResolver||bp,c=(d,f)=>this.onKeyframesResolved(d,f);this.resolver=new a(o,c,n,r,s),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(t){const{type:n="keyframes",repeat:r=0,repeatDelay:s=0,repeatType:o,velocity:a=0}=this.options,c=up(n)?n:u2[n]||mc;let d,f;c!==mc&&typeof t[0]!="number"&&(d=ka(d2,jb(t[0],t[1])),t=[0,100]);const p=c({...this.options,keyframes:t});o==="mirror"&&(f=c({...this.options,keyframes:[...t].reverse(),velocity:-a})),p.calculatedDuration===null&&(p.calculatedDuration=H_(p));const{calculatedDuration:g}=p,y=g+s,x=y*(r+1)-s;return{generator:p,mirroredGenerator:f,mapPercentToKeyframes:d,calculatedDuration:g,resolvedDuration:y,totalDuration:x}}onPostResolved(){const{autoplay:t=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!t?this.pause():this.state=this.pendingPlayState}tick(t,n=!1){const{resolved:r}=this;if(!r){const{keyframes:V}=this.options;return{done:!0,value:V[V.length-1]}}const{finalKeyframe:s,generator:o,mirroredGenerator:a,mapPercentToKeyframes:c,keyframes:d,calculatedDuration:f,totalDuration:p,resolvedDuration:g}=r;if(this.startTime===null)return o.next(0);const{delay:y,repeat:x,repeatType:b,repeatDelay:w,onUpdate:k}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,t):this.speed<0&&(this.startTime=Math.min(t-p/this.speed,this.startTime)),n?this.currentTime=t:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(t-this.startTime)*this.speed;const S=this.currentTime-y*(this.speed>=0?1:-1),E=this.speed>=0?S<0:S>p;this.currentTime=Math.max(S,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=p);let j=this.currentTime,O=o;if(x){const V=Math.min(this.currentTime,p)/g;let U=Math.floor(V),D=V%1;!D&&V>=1&&(D=1),D===1&&U--,U=Math.min(U,x+1),U%2&&(b==="reverse"?(D=1-D,w&&(D-=w/g)):b==="mirror"&&(O=a)),j=Er(0,1,D)*g}const N=E?{done:!1,value:d[0]}:O.next(j);c&&(N.value=c(N.value));let{done:T}=N;!E&&f!==null&&(T=this.speed>=0?this.currentTime>=p:this.currentTime<=0);const I=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&T);return I&&s!==void 0&&(N.value=Fc(d,this.options,s)),k&&k(N.value),I&&this.finish(),N}get duration(){const{resolved:t}=this;return t?Sr(t.calculatedDuration):0}get time(){return Sr(this.currentTime)}set time(t){t=kr(t),this.currentTime=t,this.holdTime!==null||this.speed===0?this.holdTime=t:this.driver&&(this.startTime=this.driver.now()-t/this.speed)}get speed(){return this.playbackSpeed}set speed(t){const n=this.playbackSpeed!==t;this.playbackSpeed=t,n&&(this.time=Sr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:t=c2,onPlay:n,startTime:r}=this.options;this.driver||(this.driver=t(o=>this.tick(o))),n&&n();const s=this.driver.now();this.holdTime!==null?this.startTime=s-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=s):this.startTime=r??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var t;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(t=this.currentTime)!==null&&t!==void 0?t:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:t}=this.options;t&&t()}cancel(){this.cancelTime!==null&&this.tick(this.cancelTime),this.teardown(),this.updateFinishedPromise()}teardown(){this.state="idle",this.stopDriver(),this.resolveFinishedPromise(),this.updateFinishedPromise(),this.startTime=this.cancelTime=null,this.resolver.cancel()}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(t){return this.startTime=0,this.tick(t,!0)}}const h2=new Set(["opacity","clipPath","filter","transform"]);function f2(e,t,n,{delay:r=0,duration:s=300,repeat:o=0,repeatType:a="loop",ease:c="easeInOut",times:d}={}){const f={[t]:n};d&&(f.offset=d);const p=G_(c,s);return Array.isArray(p)&&(f.easing=p),e.animate(f,{delay:r,duration:s,easing:Array.isArray(p)?"linear":p,fill:"both",iterations:o+1,direction:a==="reverse"?"alternate":"normal"})}const p2=Jf(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),gc=10,m2=2e4;function g2(e){return up(e.type)||e.type==="spring"||!W_(e.ease)}function y2(e,t){const n=new kp({...t,keyframes:e,repeat:0,delay:0,isGenerator:!0});let r={done:!1,value:e[0]};const s=[];let o=0;for(;!r.done&&o<m2;)r=n.sample(o),s.push(r.value),o+=gc;return{times:void 0,keyframes:s,duration:o-gc,ease:"linear"}}const Tb={anticipate:ob,backInOut:ib,circInOut:lb};function x2(e){return e in Tb}class Cx extends kb{constructor(t){super(t);const{name:n,motionValue:r,element:s,keyframes:o}=this.options;this.resolver=new wb(o,(a,c)=>this.onKeyframesResolved(a,c),n,r,s),this.resolver.scheduleResolve()}initPlayback(t,n){let{duration:r=300,times:s,ease:o,type:a,motionValue:c,name:d,startTime:f}=this.options;if(!c.owner||!c.owner.current)return!1;if(typeof o=="string"&&fc()&&x2(o)&&(o=Tb[o]),g2(this.options)){const{onComplete:g,onUpdate:y,motionValue:x,element:b,...w}=this.options,k=y2(t,w);t=k.keyframes,t.length===1&&(t[1]=t[0]),r=k.duration,s=k.times,o=k.ease,a="keyframes"}const p=f2(c.owner.current,d,t,{...this.options,duration:r,times:s,ease:o});return p.startTime=f??this.calcStartTime(),this.pendingTimeline?(dx(p,this.pendingTimeline),this.pendingTimeline=void 0):p.onfinish=()=>{const{onComplete:g}=this.options;c.set(Fc(t,this.options,n)),g&&g(),this.cancel(),this.resolveFinishedPromise()},{animation:p,duration:r,times:s,type:a,ease:o,keyframes:t}}get duration(){const{resolved:t}=this;if(!t)return 0;const{duration:n}=t;return Sr(n)}get time(){const{resolved:t}=this;if(!t)return 0;const{animation:n}=t;return Sr(n.currentTime||0)}set time(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.currentTime=kr(t)}get speed(){const{resolved:t}=this;if(!t)return 1;const{animation:n}=t;return n.playbackRate}set speed(t){const{resolved:n}=this;if(!n)return;const{animation:r}=n;r.playbackRate=t}get state(){const{resolved:t}=this;if(!t)return"idle";const{animation:n}=t;return n.playState}get startTime(){const{resolved:t}=this;if(!t)return null;const{animation:n}=t;return n.startTime}attachTimeline(t){if(!this._resolved)this.pendingTimeline=t;else{const{resolved:n}=this;if(!n)return Tn;const{animation:r}=n;dx(r,t)}return Tn}play(){if(this.isStopped)return;const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.playState==="finished"&&this.updateFinishedPromise(),n.play()}pause(){const{resolved:t}=this;if(!t)return;const{animation:n}=t;n.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:t}=this;if(!t)return;const{animation:n,keyframes:r,duration:s,type:o,ease:a,times:c}=t;if(n.playState==="idle"||n.playState==="finished")return;if(this.time){const{motionValue:f,onUpdate:p,onComplete:g,element:y,...x}=this.options,b=new kp({...x,keyframes:r,duration:s,type:o,ease:a,times:c,isGenerator:!0}),w=kr(this.time);f.setWithVelocity(b.sample(w-gc).value,b.sample(w).value,gc)}const{onStop:d}=this.options;d&&d(),this.cancel()}complete(){const{resolved:t}=this;t&&t.animation.finish()}cancel(){const{resolved:t}=this;t&&t.animation.cancel()}static supports(t){const{motionValue:n,name:r,repeatDelay:s,repeatType:o,damping:a,type:c}=t;if(!n||!n.owner||!(n.owner.current instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:f}=n.owner.getProps();return p2()&&r&&h2.has(r)&&!d&&!f&&!s&&o!=="mirror"&&a!==0&&c!=="inertia"}}const v2={type:"spring",stiffness:500,damping:25,restSpeed:10},_2=e=>({type:"spring",stiffness:550,damping:e===0?2*Math.sqrt(550):30,restSpeed:10}),b2={type:"keyframes",duration:.8},w2={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},k2=(e,{keyframes:t})=>t.length>2?b2:$s.has(e)?e.startsWith("scale")?_2(t[1]):v2:w2;function S2({when:e,delay:t,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:o,repeatType:a,repeatDelay:c,from:d,elapsed:f,...p}){return!!Object.keys(p).length}const Sp=(e,t,n,r={},s,o)=>a=>{const c=cp(r,e)||{},d=c.delay||r.delay||0;let{elapsed:f=0}=r;f=f-kr(d);let p={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:t.getVelocity(),...c,delay:-f,onUpdate:y=>{t.set(y),c.onUpdate&&c.onUpdate(y)},onComplete:()=>{a(),c.onComplete&&c.onComplete()},name:e,motionValue:t,element:o?void 0:s};S2(c)||(p={...p,...k2(e,p)}),p.duration&&(p.duration=kr(p.duration)),p.repeatDelay&&(p.repeatDelay=kr(p.repeatDelay)),p.from!==void 0&&(p.keyframes[0]=p.from);let g=!1;if((p.type===!1||p.duration===0&&!p.repeatDelay)&&(p.duration=0,p.delay===0&&(g=!0)),g&&!o&&t.get()!==void 0){const y=Fc(p.keyframes,c);if(y!==void 0)return pt.update(()=>{p.onUpdate(y),p.onComplete()}),new VE([])}return!o&&Cx.supports(p)?new Cx(p):new kp(p)};function j2({protectedKeys:e,needsAnimating:t},n){const r=e.hasOwnProperty(n)&&t[n]!==!0;return t[n]=!1,r}function Ab(e,t,{delay:n=0,transitionOverride:r,type:s}={}){var o;let{transition:a=e.getDefaultTransition(),transitionEnd:c,...d}=t;r&&(a=r);const f=[],p=s&&e.animationState&&e.animationState.getState()[s];for(const g in d){const y=e.getValue(g,(o=e.latestValues[g])!==null&&o!==void 0?o:null),x=d[g];if(x===void 0||p&&j2(p,g))continue;const b={delay:n,...cp(a||{},g)};let w=!1;if(window.MotionHandoffAnimation){const S=eb(e);if(S){const E=window.MotionHandoffAnimation(S,g,pt);E!==null&&(b.startTime=E,w=!0)}}Yh(e,g),y.start(Sp(g,y,x,e.shouldReduceMotion&&Q_.has(g)?{type:!1}:b,e,w));const k=y.animation;k&&f.push(k)}return c&&Promise.all(f).then(()=>{pt.update(()=>{c&&rC(e,c)})}),f}function sf(e,t,n={}){var r;const s=zc(e,t,n.type==="exit"?(r=e.presenceContext)===null||r===void 0?void 0:r.custom:void 0);let{transition:o=e.getDefaultTransition()||{}}=s||{};n.transitionOverride&&(o=n.transitionOverride);const a=s?()=>Promise.all(Ab(e,s,n)):()=>Promise.resolve(),c=e.variantChildren&&e.variantChildren.size?(f=0)=>{const{delayChildren:p=0,staggerChildren:g,staggerDirection:y}=o;return E2(e,t,p+f,g,y,n)}:()=>Promise.resolve(),{when:d}=o;if(d){const[f,p]=d==="beforeChildren"?[a,c]:[c,a];return f().then(()=>p())}else return Promise.all([a(),c(n.delay)])}function E2(e,t,n=0,r=0,s=1,o){const a=[],c=(e.variantChildren.size-1)*r,d=s===1?(f=0)=>f*r:(f=0)=>c-f*r;return Array.from(e.variantChildren).sort(C2).forEach((f,p)=>{f.notify("AnimationStart",t),a.push(sf(f,t,{...o,delay:n+d(p)}).then(()=>f.notify("AnimationComplete",t)))}),Promise.all(a)}function C2(e,t){return e.sortNodePosition(t)}function N2(e,t,n={}){e.notify("AnimationStart",t);let r;if(Array.isArray(t)){const s=t.map(o=>sf(e,o,n));r=Promise.all(s)}else if(typeof t=="string")r=sf(e,t,n);else{const s=typeof t=="function"?zc(e,t,n.custom):t;r=Promise.all(Ab(e,s,n))}return r.then(()=>{e.notify("AnimationComplete",t)})}const T2=Yf.length;function Rb(e){if(!e)return;if(!e.isControllingVariants){const n=e.parent?Rb(e.parent)||{}:{};return e.props.initial!==void 0&&(n.initial=e.props.initial),n}const t={};for(let n=0;n<T2;n++){const r=Yf[n],s=e.props[r];(aa(s)||s===!1)&&(t[r]=s)}return t}const A2=[...Xf].reverse(),R2=Xf.length;function P2(e){return t=>Promise.all(t.map(({animation:n,options:r})=>N2(e,n,r)))}function O2(e){let t=P2(e),n=Nx(),r=!0;const s=d=>(f,p)=>{var g;const y=zc(e,p,d==="exit"?(g=e.presenceContext)===null||g===void 0?void 0:g.custom:void 0);if(y){const{transition:x,transitionEnd:b,...w}=y;f={...f,...w,...b}}return f};function o(d){t=d(e)}function a(d){const{props:f}=e,p=Rb(e.parent)||{},g=[],y=new Set;let x={},b=1/0;for(let k=0;k<R2;k++){const S=A2[k],E=n[S],j=f[S]!==void 0?f[S]:p[S],O=aa(j),N=S===d?E.isActive:null;N===!1&&(b=k);let T=j===p[S]&&j!==f[S]&&O;if(T&&r&&e.manuallyAnimateOnMount&&(T=!1),E.protectedKeys={...x},!E.isActive&&N===null||!j&&!E.prevProp||Dc(j)||typeof j=="boolean")continue;const I=L2(E.prevProp,j);let V=I||S===d&&E.isActive&&!T&&O||k>b&&O,U=!1;const D=Array.isArray(j)?j:[j];let Z=D.reduce(s(S),{});N===!1&&(Z={});const{prevResolvedValues:Y={}}=E,he={...Y,...Z},G=re=>{V=!0,y.has(re)&&(U=!0,y.delete(re)),E.needsAnimating[re]=!0;const J=e.getValue(re);J&&(J.liveStyle=!1)};for(const re in he){const J=Z[re],ce=Y[re];if(x.hasOwnProperty(re))continue;let A=!1;Gh(J)&&Gh(ce)?A=!q_(J,ce):A=J!==ce,A?J!=null?G(re):y.add(re):J!==void 0&&y.has(re)?G(re):E.protectedKeys[re]=!0}E.prevProp=j,E.prevResolvedValues=Z,E.isActive&&(x={...x,...Z}),r&&e.blockInitialAnimation&&(V=!1),V&&(!(T&&I)||U)&&g.push(...D.map(re=>({animation:re,options:{type:S}})))}if(y.size){const k={};y.forEach(S=>{const E=e.getBaseTarget(S),j=e.getValue(S);j&&(j.liveStyle=!0),k[S]=E??null}),g.push({animation:k})}let w=!!g.length;return r&&(f.initial===!1||f.initial===f.animate)&&!e.manuallyAnimateOnMount&&(w=!1),r=!1,w?t(g):Promise.resolve()}function c(d,f){var p;if(n[d].isActive===f)return Promise.resolve();(p=e.variantChildren)===null||p===void 0||p.forEach(y=>{var x;return(x=y.animationState)===null||x===void 0?void 0:x.setActive(d,f)}),n[d].isActive=f;const g=a(d);for(const y in n)n[y].protectedKeys={};return g}return{animateChanges:a,setActive:c,setAnimateFunction:o,getState:()=>n,reset:()=>{n=Nx(),r=!0}}}function L2(e,t){return typeof t=="string"?t!==e:Array.isArray(t)?!q_(t,e):!1}function vs(e=!1){return{isActive:e,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Nx(){return{animate:vs(!0),whileInView:vs(),whileHover:vs(),whileTap:vs(),whileDrag:vs(),whileFocus:vs(),exit:vs()}}class rs{constructor(t){this.isMounted=!1,this.node=t}update(){}}class I2 extends rs{constructor(t){super(t),t.animationState||(t.animationState=O2(t))}updateAnimationControlsSubscription(){const{animate:t}=this.node.getProps();Dc(t)&&(this.unmountControls=t.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:t}=this.node.getProps(),{animate:n}=this.node.prevProps||{};t!==n&&this.updateAnimationControlsSubscription()}unmount(){var t;this.node.animationState.reset(),(t=this.unmountControls)===null||t===void 0||t.call(this)}}let D2=0;class M2 extends rs{constructor(){super(...arguments),this.id=D2++}update(){if(!this.node.presenceContext)return;const{isPresent:t,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||t===r)return;const s=this.node.animationState.setActive("exit",!t);n&&!t&&s.then(()=>n(this.id))}mount(){const{register:t}=this.node.presenceContext||{};t&&(this.unmount=t(this.id))}unmount(){}}const z2={animation:{Feature:I2},exit:{Feature:M2}};function da(e,t,n,r={passive:!0}){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n)}function Sa(e){return{point:{x:e.pageX,y:e.pageY}}}const F2=e=>t=>hp(t)&&e(t,Sa(t));function Jo(e,t,n,r){return da(e,t,F2(n),r)}const Tx=(e,t)=>Math.abs(e-t);function $2(e,t){const n=Tx(e.x,t.x),r=Tx(e.y,t.y);return Math.sqrt(n**2+r**2)}class Pb{constructor(t,n,{transformPagePoint:r,contextWindow:s,dragSnapToOrigin:o=!1}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const g=Zd(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,x=$2(g.offset,{x:0,y:0})>=3;if(!y&&!x)return;const{point:b}=g,{timestamp:w}=Ht;this.history.push({...b,timestamp:w});const{onStart:k,onMove:S}=this.handlers;y||(k&&k(this.lastMoveEvent,g),this.startEvent=this.lastMoveEvent),S&&S(this.lastMoveEvent,g)},this.handlePointerMove=(g,y)=>{this.lastMoveEvent=g,this.lastMoveEventInfo=Qd(y,this.transformPagePoint),pt.update(this.updatePoint,!0)},this.handlePointerUp=(g,y)=>{this.end();const{onEnd:x,onSessionEnd:b,resumeAnimation:w}=this.handlers;if(this.dragSnapToOrigin&&w&&w(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const k=Zd(g.type==="pointercancel"?this.lastMoveEventInfo:Qd(y,this.transformPagePoint),this.history);this.startEvent&&x&&x(g,k),b&&b(g,k)},!hp(t))return;this.dragSnapToOrigin=o,this.handlers=n,this.transformPagePoint=r,this.contextWindow=s||window;const a=Sa(t),c=Qd(a,this.transformPagePoint),{point:d}=c,{timestamp:f}=Ht;this.history=[{...d,timestamp:f}];const{onSessionStart:p}=n;p&&p(t,Zd(c,this.history)),this.removeListeners=ka(Jo(this.contextWindow,"pointermove",this.handlePointerMove),Jo(this.contextWindow,"pointerup",this.handlePointerUp),Jo(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(t){this.handlers=t}end(){this.removeListeners&&this.removeListeners(),ts(this.updatePoint)}}function Qd(e,t){return t?{point:t(e.point)}:e}function Ax(e,t){return{x:e.x-t.x,y:e.y-t.y}}function Zd({point:e},t){return{point:e,delta:Ax(e,Ob(t)),offset:Ax(e,U2(t)),velocity:B2(t,.1)}}function U2(e){return e[0]}function Ob(e){return e[e.length-1]}function B2(e,t){if(e.length<2)return{x:0,y:0};let n=e.length-1,r=null;const s=Ob(e);for(;n>=0&&(r=e[n],!(s.timestamp-r.timestamp>kr(t)));)n--;if(!r)return{x:0,y:0};const o=Sr(s.timestamp-r.timestamp);if(o===0)return{x:0,y:0};const a={x:(s.x-r.x)/o,y:(s.y-r.y)/o};return a.x===1/0&&(a.x=0),a.y===1/0&&(a.y=0),a}const Lb=1e-4,V2=1-Lb,q2=1+Lb,Ib=.01,H2=0-Ib,K2=0+Ib;function Rn(e){return e.max-e.min}function W2(e,t,n){return Math.abs(e-t)<=n}function Rx(e,t,n,r=.5){e.origin=r,e.originPoint=_t(t.min,t.max,e.origin),e.scale=Rn(n)/Rn(t),e.translate=_t(n.min,n.max,e.origin)-e.originPoint,(e.scale>=V2&&e.scale<=q2||isNaN(e.scale))&&(e.scale=1),(e.translate>=H2&&e.translate<=K2||isNaN(e.translate))&&(e.translate=0)}function Xo(e,t,n,r){Rx(e.x,t.x,n.x,r?r.originX:void 0),Rx(e.y,t.y,n.y,r?r.originY:void 0)}function Px(e,t,n){e.min=n.min+t.min,e.max=e.min+Rn(t)}function G2(e,t,n){Px(e.x,t.x,n.x),Px(e.y,t.y,n.y)}function Ox(e,t,n){e.min=t.min-n.min,e.max=e.min+Rn(t)}function Yo(e,t,n){Ox(e.x,t.x,n.x),Ox(e.y,t.y,n.y)}function J2(e,{min:t,max:n},r){return t!==void 0&&e<t?e=r?_t(t,e,r.min):Math.max(e,t):n!==void 0&&e>n&&(e=r?_t(n,e,r.max):Math.min(e,n)),e}function Lx(e,t,n){return{min:t!==void 0?e.min+t:void 0,max:n!==void 0?e.max+n-(e.max-e.min):void 0}}function X2(e,{top:t,left:n,bottom:r,right:s}){return{x:Lx(e.x,n,s),y:Lx(e.y,t,r)}}function Ix(e,t){let n=t.min-e.min,r=t.max-e.max;return t.max-t.min<e.max-e.min&&([n,r]=[r,n]),{min:n,max:r}}function Y2(e,t){return{x:Ix(e.x,t.x),y:Ix(e.y,t.y)}}function Q2(e,t){let n=.5;const r=Rn(e),s=Rn(t);return s>r?n=Fi(t.min,t.max-r,e.min):r>s&&(n=Fi(e.min,e.max-s,t.min)),Er(0,1,n)}function Z2(e,t){const n={};return t.min!==void 0&&(n.min=t.min-e.min),t.max!==void 0&&(n.max=t.max-e.min),n}const of=.35;function eN(e=of){return e===!1?e=0:e===!0&&(e=of),{x:Dx(e,"left","right"),y:Dx(e,"top","bottom")}}function Dx(e,t,n){return{min:Mx(e,t),max:Mx(e,n)}}function Mx(e,t){return typeof e=="number"?e:e[t]||0}const zx=()=>({translate:0,scale:1,origin:0,originPoint:0}),Ai=()=>({x:zx(),y:zx()}),Fx=()=>({min:0,max:0}),Et=()=>({x:Fx(),y:Fx()});function Fn(e){return[e("x"),e("y")]}function Db({top:e,left:t,right:n,bottom:r}){return{x:{min:t,max:n},y:{min:e,max:r}}}function tN({x:e,y:t}){return{top:t.min,right:e.max,bottom:t.max,left:e.min}}function nN(e,t){if(!t)return e;const n=t({x:e.left,y:e.top}),r=t({x:e.right,y:e.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function eh(e){return e===void 0||e===1}function af({scale:e,scaleX:t,scaleY:n}){return!eh(e)||!eh(t)||!eh(n)}function ks(e){return af(e)||Mb(e)||e.z||e.rotate||e.rotateX||e.rotateY||e.skewX||e.skewY}function Mb(e){return $x(e.x)||$x(e.y)}function $x(e){return e&&e!=="0%"}function yc(e,t,n){const r=e-n,s=t*r;return n+s}function Ux(e,t,n,r,s){return s!==void 0&&(e=yc(e,s,r)),yc(e,n,r)+t}function lf(e,t=0,n=1,r,s){e.min=Ux(e.min,t,n,r,s),e.max=Ux(e.max,t,n,r,s)}function zb(e,{x:t,y:n}){lf(e.x,t.translate,t.scale,t.originPoint),lf(e.y,n.translate,n.scale,n.originPoint)}const Bx=.999999999999,Vx=1.0000000000001;function rN(e,t,n,r=!1){const s=n.length;if(!s)return;t.x=t.y=1;let o,a;for(let c=0;c<s;c++){o=n[c],a=o.projectionDelta;const{visualElement:d}=o.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Pi(e,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),a&&(t.x*=a.x.scale,t.y*=a.y.scale,zb(e,a)),r&&ks(o.latestValues)&&Pi(e,o.latestValues))}t.x<Vx&&t.x>Bx&&(t.x=1),t.y<Vx&&t.y>Bx&&(t.y=1)}function Ri(e,t){e.min=e.min+t,e.max=e.max+t}function qx(e,t,n,r,s=.5){const o=_t(e.min,e.max,s);lf(e,t,n,o,r)}function Pi(e,t){qx(e.x,t.x,t.scaleX,t.scale,t.originX),qx(e.y,t.y,t.scaleY,t.scale,t.originY)}function Fb(e,t){return Db(nN(e.getBoundingClientRect(),t))}function sN(e,t,n){const r=Fb(e,n),{scroll:s}=t;return s&&(Ri(r.x,s.offset.x),Ri(r.y,s.offset.y)),r}const $b=({current:e})=>e?e.ownerDocument.defaultView:null,iN=new WeakMap;class oN{constructor(t){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Et(),this.visualElement=t}start(t,{snapToCursor:n=!1}={}){const{presenceContext:r}=this.visualElement;if(r&&r.isPresent===!1)return;const s=p=>{const{dragSnapToOrigin:g}=this.getProps();g?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Sa(p).point)},o=(p,g)=>{const{drag:y,dragPropagation:x,onDragStart:b}=this.getProps();if(y&&!x&&(this.openDragLock&&this.openDragLock(),this.openDragLock=QE(y),!this.openDragLock))return;this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fn(k=>{let S=this.getAxisMotionValue(k).get()||0;if(cr.test(S)){const{projection:E}=this.visualElement;if(E&&E.layout){const j=E.layout.layoutBox[k];j&&(S=Rn(j)*(parseFloat(S)/100))}}this.originPoint[k]=S}),b&&pt.postRender(()=>b(p,g)),Yh(this.visualElement,"transform");const{animationState:w}=this.visualElement;w&&w.setActive("whileDrag",!0)},a=(p,g)=>{const{dragPropagation:y,dragDirectionLock:x,onDirectionLock:b,onDrag:w}=this.getProps();if(!y&&!this.openDragLock)return;const{offset:k}=g;if(x&&this.currentDirection===null){this.currentDirection=aN(k),this.currentDirection!==null&&b&&b(this.currentDirection);return}this.updateAxis("x",g.point,k),this.updateAxis("y",g.point,k),this.visualElement.render(),w&&w(p,g)},c=(p,g)=>this.stop(p,g),d=()=>Fn(p=>{var g;return this.getAnimationState(p)==="paused"&&((g=this.getAxisMotionValue(p).animation)===null||g===void 0?void 0:g.play())}),{dragSnapToOrigin:f}=this.getProps();this.panSession=new Pb(t,{onSessionStart:s,onStart:o,onMove:a,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:f,contextWindow:$b(this.visualElement)})}stop(t,n){const r=this.isDragging;if(this.cancel(),!r)return;const{velocity:s}=n;this.startAnimation(s);const{onDragEnd:o}=this.getProps();o&&pt.postRender(()=>o(t,n))}cancel(){this.isDragging=!1;const{projection:t,animationState:n}=this.visualElement;t&&(t.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(t,n,r){const{drag:s}=this.getProps();if(!r||!ql(t,s,this.currentDirection))return;const o=this.getAxisMotionValue(t);let a=this.originPoint[t]+r[t];this.constraints&&this.constraints[t]&&(a=J2(a,this.constraints[t],this.elastic[t])),o.set(a)}resolveConstraints(){var t;const{dragConstraints:n,dragElastic:r}=this.getProps(),s=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(t=this.visualElement.projection)===null||t===void 0?void 0:t.layout,o=this.constraints;n&&Ni(n)?this.constraints||(this.constraints=this.resolveRefConstraints()):n&&s?this.constraints=X2(s.layoutBox,n):this.constraints=!1,this.elastic=eN(r),o!==this.constraints&&s&&this.constraints&&!this.hasMutatedConstraints&&Fn(a=>{this.constraints!==!1&&this.getAxisMotionValue(a)&&(this.constraints[a]=Z2(s.layoutBox[a],this.constraints[a]))})}resolveRefConstraints(){const{dragConstraints:t,onMeasureDragConstraints:n}=this.getProps();if(!t||!Ni(t))return!1;const r=t.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const o=sN(r,s.root,this.visualElement.getTransformPagePoint());let a=Y2(s.layout.layoutBox,o);if(n){const c=n(tN(a));this.hasMutatedConstraints=!!c,c&&(a=Db(c))}return a}startAnimation(t){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:o,dragSnapToOrigin:a,onDragTransitionEnd:c}=this.getProps(),d=this.constraints||{},f=Fn(p=>{if(!ql(p,n,this.currentDirection))return;let g=d&&d[p]||{};a&&(g={min:0,max:0});const y=s?200:1e6,x=s?40:1e7,b={type:"inertia",velocity:r?t[p]:0,bounceStiffness:y,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...o,...g};return this.startAxisValueAnimation(p,b)});return Promise.all(f).then(c)}startAxisValueAnimation(t,n){const r=this.getAxisMotionValue(t);return Yh(this.visualElement,t),r.start(Sp(t,r,0,n,this.visualElement,!1))}stopAnimation(){Fn(t=>this.getAxisMotionValue(t).stop())}pauseAnimation(){Fn(t=>{var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.pause()})}getAnimationState(t){var n;return(n=this.getAxisMotionValue(t).animation)===null||n===void 0?void 0:n.state}getAxisMotionValue(t){const n=`_drag${t.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(t,(r.initial?r.initial[t]:void 0)||0)}snapToCursor(t){Fn(n=>{const{drag:r}=this.getProps();if(!ql(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,o=this.getAxisMotionValue(n);if(s&&s.layout){const{min:a,max:c}=s.layout.layoutBox[n];o.set(t[n]-_t(a,c,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:t,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!Ni(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fn(a=>{const c=this.getAxisMotionValue(a);if(c&&this.constraints!==!1){const d=c.get();s[a]=Q2({min:d,max:d},this.constraints[a])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fn(a=>{if(!ql(a,t,null))return;const c=this.getAxisMotionValue(a),{min:d,max:f}=this.constraints[a];c.set(_t(d,f,s[a]))})}addListeners(){if(!this.visualElement.current)return;iN.set(this.visualElement,this);const t=this.visualElement.current,n=Jo(t,"pointerdown",d=>{const{drag:f,dragListener:p=!0}=this.getProps();f&&p&&this.start(d)}),r=()=>{const{dragConstraints:d}=this.getProps();Ni(d)&&d.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,o=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),pt.read(r);const a=da(window,"resize",()=>this.scalePositionWithinConstraints()),c=s.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:f})=>{this.isDragging&&f&&(Fn(p=>{const g=this.getAxisMotionValue(p);g&&(this.originPoint[p]+=d[p].translate,g.set(g.get()+d[p].translate))}),this.visualElement.render())}));return()=>{a(),n(),o(),c&&c()}}getProps(){const t=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:o=!1,dragElastic:a=of,dragMomentum:c=!0}=t;return{...t,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:o,dragElastic:a,dragMomentum:c}}}function ql(e,t,n){return(t===!0||t===e)&&(n===null||n===e)}function aN(e,t=10){let n=null;return Math.abs(e.y)>t?n="y":Math.abs(e.x)>t&&(n="x"),n}class lN extends rs{constructor(t){super(t),this.removeGroupControls=Tn,this.removeListeners=Tn,this.controls=new oN(t)}mount(){const{dragControls:t}=this.node.getProps();t&&(this.removeGroupControls=t.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Tn}unmount(){this.removeGroupControls(),this.removeListeners()}}const Hx=e=>(t,n)=>{e&&pt.postRender(()=>e(t,n))};class cN extends rs{constructor(){super(...arguments),this.removePointerDownListener=Tn}onPointerDown(t){this.session=new Pb(t,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:$b(this.node)})}createPanHandlers(){const{onPanSessionStart:t,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Hx(t),onStart:Hx(n),onMove:r,onEnd:(o,a)=>{delete this.session,s&&pt.postRender(()=>s(o,a))}}}mount(){this.removePointerDownListener=Jo(this.node.current,"pointerdown",t=>this.onPointerDown(t))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const ic={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function Kx(e,t){return t.max===t.min?0:e/(t.max-t.min)*100}const Do={correct:(e,t)=>{if(!t.target)return e;if(typeof e=="string")if(Me.test(e))e=parseFloat(e);else return e;const n=Kx(e,t.target.x),r=Kx(e,t.target.y);return`${n}% ${r}%`}},uN={correct:(e,{treeScale:t,projectionDelta:n})=>{const r=e,s=ns.parse(e);if(s.length>5)return r;const o=ns.createTransformer(e),a=typeof s[0]!="number"?1:0,c=n.x.scale*t.x,d=n.y.scale*t.y;s[0+a]/=c,s[1+a]/=d;const f=_t(c,d,.5);return typeof s[2+a]=="number"&&(s[2+a]/=f),typeof s[3+a]=="number"&&(s[3+a]/=f),o(s)}};class dN extends R.Component{componentDidMount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:o}=t;RE(hN),o&&(n.group&&n.group.add(o),r&&r.register&&s&&r.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),ic.hasEverUpdated=!0}getSnapshotBeforeUpdate(t){const{layoutDependency:n,visualElement:r,drag:s,isPresent:o}=this.props,a=r.projection;return a&&(a.isPresent=o,s||t.layoutDependency!==n||n===void 0?a.willUpdate():this.safeToRemove(),t.isPresent!==o&&(o?a.promote():a.relegate()||pt.postRender(()=>{const c=a.getStack();(!c||!c.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:t}=this.props.visualElement;t&&(t.root.didUpdate(),Zf.postRender(()=>{!t.currentAnimation&&t.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:t,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=t;s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:t}=this.props;t&&t()}render(){return null}}function Ub(e){const[t,n]=k_(),r=R.useContext(Hf);return u.jsx(dN,{...e,layoutGroup:r,switchLayoutGroup:R.useContext(R_),isPresent:t,safeToRemove:n})}const hN={borderRadius:{...Do,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Do,borderTopRightRadius:Do,borderBottomLeftRadius:Do,borderBottomRightRadius:Do,boxShadow:uN};function fN(e,t,n){const r=Qt(e)?e:ca(e);return r.start(Sp("",r,t,n)),r.animation}function pN(e){return e instanceof SVGElement&&e.tagName!=="svg"}const mN=(e,t)=>e.depth-t.depth;class gN{constructor(){this.children=[],this.isDirty=!1}add(t){fp(this.children,t),this.isDirty=!0}remove(t){pp(this.children,t),this.isDirty=!0}forEach(t){this.isDirty&&this.children.sort(mN),this.isDirty=!1,this.children.forEach(t)}}function yN(e,t){const n=ur.now(),r=({timestamp:s})=>{const o=s-n;o>=t&&(ts(r),e(o-t))};return pt.read(r,!0),()=>ts(r)}const Bb=["TopLeft","TopRight","BottomLeft","BottomRight"],xN=Bb.length,Wx=e=>typeof e=="string"?parseFloat(e):e,Gx=e=>typeof e=="number"||Me.test(e);function vN(e,t,n,r,s,o){s?(e.opacity=_t(0,n.opacity!==void 0?n.opacity:1,_N(r)),e.opacityExit=_t(t.opacity!==void 0?t.opacity:1,0,bN(r))):o&&(e.opacity=_t(t.opacity!==void 0?t.opacity:1,n.opacity!==void 0?n.opacity:1,r));for(let a=0;a<xN;a++){const c=`border${Bb[a]}Radius`;let d=Jx(t,c),f=Jx(n,c);if(d===void 0&&f===void 0)continue;d||(d=0),f||(f=0),d===0||f===0||Gx(d)===Gx(f)?(e[c]=Math.max(_t(Wx(d),Wx(f),r),0),(cr.test(f)||cr.test(d))&&(e[c]+="%")):e[c]=f}(t.rotate||n.rotate)&&(e.rotate=_t(t.rotate||0,n.rotate||0,r))}function Jx(e,t){return e[t]!==void 0?e[t]:e.borderRadius}const _N=Vb(0,.5,ab),bN=Vb(.5,.95,Tn);function Vb(e,t,n){return r=>r<e?0:r>t?1:n(Fi(e,t,r))}function Xx(e,t){e.min=t.min,e.max=t.max}function zn(e,t){Xx(e.x,t.x),Xx(e.y,t.y)}function Yx(e,t){e.translate=t.translate,e.scale=t.scale,e.originPoint=t.originPoint,e.origin=t.origin}function Qx(e,t,n,r,s){return e-=t,e=yc(e,1/n,r),s!==void 0&&(e=yc(e,1/s,r)),e}function wN(e,t=0,n=1,r=.5,s,o=e,a=e){if(cr.test(t)&&(t=parseFloat(t),t=_t(a.min,a.max,t/100)-a.min),typeof t!="number")return;let c=_t(o.min,o.max,r);e===o&&(c-=t),e.min=Qx(e.min,t,n,c,s),e.max=Qx(e.max,t,n,c,s)}function Zx(e,t,[n,r,s],o,a){wN(e,t[n],t[r],t[s],t.scale,o,a)}const kN=["x","scaleX","originX"],SN=["y","scaleY","originY"];function ev(e,t,n,r){Zx(e.x,t,kN,n?n.x:void 0,r?r.x:void 0),Zx(e.y,t,SN,n?n.y:void 0,r?r.y:void 0)}function tv(e){return e.translate===0&&e.scale===1}function qb(e){return tv(e.x)&&tv(e.y)}function nv(e,t){return e.min===t.min&&e.max===t.max}function jN(e,t){return nv(e.x,t.x)&&nv(e.y,t.y)}function rv(e,t){return Math.round(e.min)===Math.round(t.min)&&Math.round(e.max)===Math.round(t.max)}function Hb(e,t){return rv(e.x,t.x)&&rv(e.y,t.y)}function sv(e){return Rn(e.x)/Rn(e.y)}function iv(e,t){return e.translate===t.translate&&e.scale===t.scale&&e.originPoint===t.originPoint}class EN{constructor(){this.members=[]}add(t){fp(this.members,t),t.scheduleRender()}remove(t){if(pp(this.members,t),t===this.prevLead&&(this.prevLead=void 0),t===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(t){const n=this.members.findIndex(s=>t===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const o=this.members[s];if(o.isPresent!==!1){r=o;break}}return r?(this.promote(r),!0):!1}promote(t,n){const r=this.lead;if(t!==r&&(this.prevLead=r,this.lead=t,t.show(),r)){r.instance&&r.scheduleRender(),t.scheduleRender(),t.resumeFrom=r,n&&(t.resumeFrom.preserveOpacity=!0),r.snapshot&&(t.snapshot=r.snapshot,t.snapshot.latestValues=r.animationValues||r.latestValues),t.root&&t.root.isUpdating&&(t.isLayoutDirty=!0);const{crossfade:s}=t.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(t=>{const{options:n,resumingFrom:r}=t;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(t=>{t.instance&&t.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function CN(e,t,n){let r="";const s=e.x.translate/t.x,o=e.y.translate/t.y,a=n?.z||0;if((s||o||a)&&(r=`translate3d(${s}px, ${o}px, ${a}px) `),(t.x!==1||t.y!==1)&&(r+=`scale(${1/t.x}, ${1/t.y}) `),n){const{transformPerspective:f,rotate:p,rotateX:g,rotateY:y,skewX:x,skewY:b}=n;f&&(r=`perspective(${f}px) ${r}`),p&&(r+=`rotate(${p}deg) `),g&&(r+=`rotateX(${g}deg) `),y&&(r+=`rotateY(${y}deg) `),x&&(r+=`skewX(${x}deg) `),b&&(r+=`skewY(${b}deg) `)}const c=e.x.scale*t.x,d=e.y.scale*t.y;return(c!==1||d!==1)&&(r+=`scale(${c}, ${d})`),r||"none"}const Ss={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ko=typeof window<"u"&&window.MotionDebug!==void 0,th=["","X","Y","Z"],NN={visibility:"hidden"},ov=1e3;let TN=0;function nh(e,t,n,r){const{latestValues:s}=t;s[e]&&(n[e]=s[e],t.setStaticValue(e,0),r&&(r[e]=0))}function Kb(e){if(e.hasCheckedOptimisedAppear=!0,e.root===e)return;const{visualElement:t}=e.options;if(!t)return;const n=eb(t);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:o}=e.options;window.MotionCancelOptimisedAnimation(n,"transform",pt,!(s||o))}const{parent:r}=e;r&&!r.hasCheckedOptimisedAppear&&Kb(r)}function Wb({attachResizeListener:e,defaultParent:t,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(a={},c=t?.()){this.id=TN++,this.animationId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,Ko&&(Ss.totalNodes=Ss.resolvedTargetDeltas=Ss.recalculatedProjection=0),this.nodes.forEach(PN),this.nodes.forEach(MN),this.nodes.forEach(zN),this.nodes.forEach(ON),Ko&&window.MotionDebug.record(Ss)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=a,this.root=c?c.root||c:this,this.path=c?[...c.path,c]:[],this.parent=c,this.depth=c?c.depth+1:0;for(let d=0;d<this.path.length;d++)this.path[d].shouldResetTransform=!0;this.root===this&&(this.nodes=new gN)}addEventListener(a,c){return this.eventHandlers.has(a)||this.eventHandlers.set(a,new mp),this.eventHandlers.get(a).add(c)}notifyListeners(a,...c){const d=this.eventHandlers.get(a);d&&d.notify(...c)}hasListeners(a){return this.eventHandlers.has(a)}mount(a,c=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=pN(a),this.instance=a;const{layoutId:d,layout:f,visualElement:p}=this.options;if(p&&!p.current&&p.mount(a),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),c&&(f||d)&&(this.isLayoutDirty=!0),e){let g;const y=()=>this.root.updateBlockedByResize=!1;e(a,()=>{this.root.updateBlockedByResize=!0,g&&g(),g=yN(y,250),ic.hasAnimatedSinceResize&&(ic.hasAnimatedSinceResize=!1,this.nodes.forEach(lv))})}d&&this.root.registerSharedNode(d,this),this.options.animate!==!1&&p&&(d||f)&&this.addEventListener("didUpdate",({delta:g,hasLayoutChanged:y,hasRelativeTargetChanged:x,layout:b})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const w=this.options.transition||p.getDefaultTransition()||VN,{onLayoutAnimationStart:k,onLayoutAnimationComplete:S}=p.getProps(),E=!this.targetLayout||!Hb(this.targetLayout,b)||x,j=!y&&x;if(this.options.layoutRoot||this.resumeFrom&&this.resumeFrom.instance||j||y&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(g,j);const O={...cp(w,"layout"),onPlay:k,onComplete:S};(p.shouldReduceMotion||this.options.layoutRoot)&&(O.delay=0,O.type=!1),this.startAnimation(O)}else y||lv(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=b})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const a=this.getStack();a&&a.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ts(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(FN),this.animationId++)}getTransformTemplate(){const{visualElement:a}=this.options;return a&&a.getProps().transformTemplate}willUpdate(a=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&Kb(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let p=0;p<this.path.length;p++){const g=this.path[p];g.shouldResetTransform=!0,g.updateScroll("snapshot"),g.options.layoutRoot&&g.willUpdate(!1)}const{layoutId:c,layout:d}=this.options;if(c===void 0&&!d)return;const f=this.getTransformTemplate();this.prevTransformTemplateValue=f?f(this.latestValues,""):void 0,this.updateSnapshot(),a&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(av);return}this.isUpdating||this.nodes.forEach(IN),this.isUpdating=!1,this.nodes.forEach(DN),this.nodes.forEach(AN),this.nodes.forEach(RN),this.clearAllSnapshots();const c=ur.now();Ht.delta=Er(0,1e3/60,c-Ht.timestamp),Ht.timestamp=c,Ht.isProcessing=!0,Kd.update.process(Ht),Kd.preRender.process(Ht),Kd.render.process(Ht),Ht.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,Zf.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(LN),this.sharedNodes.forEach($N)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pt.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pt.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure())}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let d=0;d<this.path.length;d++)this.path[d].updateScroll();const a=this.layout;this.layout=this.measure(!1),this.layoutCorrected=Et(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:c}=this.options;c&&c.notify("LayoutMeasure",this.layout.layoutBox,a?a.layoutBox:void 0)}updateScroll(a="measure"){let c=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===a&&(c=!1),c){const d=r(this.instance);this.scroll={animationId:this.root.animationId,phase:a,isRoot:d,offset:n(this.instance),wasRoot:this.scroll?this.scroll.isRoot:d}}}resetTransform(){if(!s)return;const a=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,c=this.projectionDelta&&!qb(this.projectionDelta),d=this.getTransformTemplate(),f=d?d(this.latestValues,""):void 0,p=f!==this.prevTransformTemplateValue;a&&(c||ks(this.latestValues)||p)&&(s(this.instance,f),this.shouldResetTransform=!1,this.scheduleRender())}measure(a=!0){const c=this.measurePageBox();let d=this.removeElementScroll(c);return a&&(d=this.removeTransform(d)),qN(d),{animationId:this.root.animationId,measuredBox:c,layoutBox:d,latestValues:{},source:this.id}}measurePageBox(){var a;const{visualElement:c}=this.options;if(!c)return Et();const d=c.measureViewportBox();if(!(((a=this.scroll)===null||a===void 0?void 0:a.wasRoot)||this.path.some(HN))){const{scroll:p}=this.root;p&&(Ri(d.x,p.offset.x),Ri(d.y,p.offset.y))}return d}removeElementScroll(a){var c;const d=Et();if(zn(d,a),!((c=this.scroll)===null||c===void 0)&&c.wasRoot)return d;for(let f=0;f<this.path.length;f++){const p=this.path[f],{scroll:g,options:y}=p;p!==this.root&&g&&y.layoutScroll&&(g.wasRoot&&zn(d,a),Ri(d.x,g.offset.x),Ri(d.y,g.offset.y))}return d}applyTransform(a,c=!1){const d=Et();zn(d,a);for(let f=0;f<this.path.length;f++){const p=this.path[f];!c&&p.options.layoutScroll&&p.scroll&&p!==p.root&&Pi(d,{x:-p.scroll.offset.x,y:-p.scroll.offset.y}),ks(p.latestValues)&&Pi(d,p.latestValues)}return ks(this.latestValues)&&Pi(d,this.latestValues),d}removeTransform(a){const c=Et();zn(c,a);for(let d=0;d<this.path.length;d++){const f=this.path[d];if(!f.instance||!ks(f.latestValues))continue;af(f.latestValues)&&f.updateSnapshot();const p=Et(),g=f.measurePageBox();zn(p,g),ev(c,f.latestValues,f.snapshot?f.snapshot.layoutBox:void 0,p)}return ks(this.latestValues)&&ev(c,this.latestValues),c}setTargetDelta(a){this.targetDelta=a,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(a){this.options={...this.options,...a,crossfade:a.crossfade!==void 0?a.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==Ht.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(a=!1){var c;const d=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=d.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=d.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=d.isSharedProjectionDirty);const f=!!this.resumingFrom||this!==d;if(!(a||f&&this.isSharedProjectionDirty||this.isProjectionDirty||!((c=this.parent)===null||c===void 0)&&c.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:g,layoutId:y}=this.options;if(!(!this.layout||!(g||y))){if(this.resolvedRelativeTargetAt=Ht.timestamp,!this.targetDelta&&!this.relativeTarget){const x=this.getClosestProjectingParent();x&&x.layout&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),Yo(this.relativeTargetOrigin,this.layout.layoutBox,x.layout.layoutBox),zn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=Et(),this.targetWithTransforms=Et()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),G2(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):zn(this.target,this.layout.layoutBox),zb(this.target,this.targetDelta)):zn(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const x=this.getClosestProjectingParent();x&&!!x.resumingFrom==!!this.resumingFrom&&!x.options.layoutScroll&&x.target&&this.animationProgress!==1?(this.relativeParent=x,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Et(),this.relativeTargetOrigin=Et(),Yo(this.relativeTargetOrigin,this.target,x.target),zn(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ko&&Ss.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||af(this.parent.latestValues)||Mb(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}calcProjection(){var a;const c=this.getLead(),d=!!this.resumingFrom||this!==c;let f=!0;if((this.isProjectionDirty||!((a=this.parent)===null||a===void 0)&&a.isProjectionDirty)&&(f=!1),d&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(f=!1),this.resolvedRelativeTargetAt===Ht.timestamp&&(f=!1),f)return;const{layout:p,layoutId:g}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(p||g))return;zn(this.layoutCorrected,this.layout.layoutBox);const y=this.treeScale.x,x=this.treeScale.y;rN(this.layoutCorrected,this.treeScale,this.path,d),c.layout&&!c.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(c.target=c.layout.layoutBox,c.targetWithTransforms=Et());const{target:b}=c;if(!b){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(Yx(this.prevProjectionDelta.x,this.projectionDelta.x),Yx(this.prevProjectionDelta.y,this.projectionDelta.y)),Xo(this.projectionDelta,this.layoutCorrected,b,this.latestValues),(this.treeScale.x!==y||this.treeScale.y!==x||!iv(this.projectionDelta.x,this.prevProjectionDelta.x)||!iv(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",b)),Ko&&Ss.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(a=!0){var c;if((c=this.options.visualElement)===null||c===void 0||c.scheduleRender(),a){const d=this.getStack();d&&d.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Ai(),this.projectionDelta=Ai(),this.projectionDeltaWithTransform=Ai()}setAnimationOrigin(a,c=!1){const d=this.snapshot,f=d?d.latestValues:{},p={...this.latestValues},g=Ai();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!c;const y=Et(),x=d?d.source:void 0,b=this.layout?this.layout.source:void 0,w=x!==b,k=this.getStack(),S=!k||k.members.length<=1,E=!!(w&&!S&&this.options.crossfade===!0&&!this.path.some(BN));this.animationProgress=0;let j;this.mixTargetDelta=O=>{const N=O/1e3;cv(g.x,a.x,N),cv(g.y,a.y,N),this.setTargetDelta(g),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Yo(y,this.layout.layoutBox,this.relativeParent.layout.layoutBox),UN(this.relativeTarget,this.relativeTargetOrigin,y,N),j&&jN(this.relativeTarget,j)&&(this.isProjectionDirty=!1),j||(j=Et()),zn(j,this.relativeTarget)),w&&(this.animationValues=p,vN(p,f,this.latestValues,N,E,S)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=N},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(a){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ts(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pt.update(()=>{ic.hasAnimatedSinceResize=!0,this.currentAnimation=fN(0,ov,{...a,onUpdate:c=>{this.mixTargetDelta(c),a.onUpdate&&a.onUpdate(c)},onComplete:()=>{a.onComplete&&a.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const a=this.getStack();a&&a.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(ov),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const a=this.getLead();let{targetWithTransforms:c,target:d,layout:f,latestValues:p}=a;if(!(!c||!d||!f)){if(this!==a&&this.layout&&f&&Gb(this.options.animationType,this.layout.layoutBox,f.layoutBox)){d=this.target||Et();const g=Rn(this.layout.layoutBox.x);d.x.min=a.target.x.min,d.x.max=d.x.min+g;const y=Rn(this.layout.layoutBox.y);d.y.min=a.target.y.min,d.y.max=d.y.min+y}zn(c,d),Pi(c,p),Xo(this.projectionDeltaWithTransform,this.layoutCorrected,c,p)}}registerSharedNode(a,c){this.sharedNodes.has(a)||this.sharedNodes.set(a,new EN),this.sharedNodes.get(a).add(c);const f=c.options.initialPromotionConfig;c.promote({transition:f?f.transition:void 0,preserveFollowOpacity:f&&f.shouldPreserveFollowOpacity?f.shouldPreserveFollowOpacity(c):void 0})}isLead(){const a=this.getStack();return a?a.lead===this:!0}getLead(){var a;const{layoutId:c}=this.options;return c?((a=this.getStack())===null||a===void 0?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:c}=this.options;return c?(a=this.getStack())===null||a===void 0?void 0:a.prevLead:void 0}getStack(){const{layoutId:a}=this.options;if(a)return this.root.sharedNodes.get(a)}promote({needsReset:a,transition:c,preserveFollowOpacity:d}={}){const f=this.getStack();f&&f.promote(this,d),a&&(this.projectionDelta=void 0,this.needsReset=!0),c&&this.setOptions({transition:c})}relegate(){const a=this.getStack();return a?a.relegate(this):!1}resetSkewAndRotation(){const{visualElement:a}=this.options;if(!a)return;let c=!1;const{latestValues:d}=a;if((d.z||d.rotate||d.rotateX||d.rotateY||d.rotateZ||d.skewX||d.skewY)&&(c=!0),!c)return;const f={};d.z&&nh("z",a,f,this.animationValues);for(let p=0;p<th.length;p++)nh(`rotate${th[p]}`,a,f,this.animationValues),nh(`skew${th[p]}`,a,f,this.animationValues);a.render();for(const p in f)a.setStaticValue(p,f[p]),this.animationValues&&(this.animationValues[p]=f[p]);a.scheduleRender()}getProjectionStyles(a){var c,d;if(!this.instance||this.isSVG)return;if(!this.isVisible)return NN;const f={visibility:""},p=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,f.opacity="",f.pointerEvents=rc(a?.pointerEvents)||"",f.transform=p?p(this.latestValues,""):"none",f;const g=this.getLead();if(!this.projectionDelta||!this.layout||!g.target){const w={};return this.options.layoutId&&(w.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,w.pointerEvents=rc(a?.pointerEvents)||""),this.hasProjected&&!ks(this.latestValues)&&(w.transform=p?p({},""):"none",this.hasProjected=!1),w}const y=g.animationValues||g.latestValues;this.applyTransformsToTarget(),f.transform=CN(this.projectionDeltaWithTransform,this.treeScale,y),p&&(f.transform=p(y,f.transform));const{x,y:b}=this.projectionDelta;f.transformOrigin=`${x.origin*100}% ${b.origin*100}% 0`,g.animationValues?f.opacity=g===this?(d=(c=y.opacity)!==null&&c!==void 0?c:this.latestValues.opacity)!==null&&d!==void 0?d:1:this.preserveOpacity?this.latestValues.opacity:y.opacityExit:f.opacity=g===this?y.opacity!==void 0?y.opacity:"":y.opacityExit!==void 0?y.opacityExit:0;for(const w in hc){if(y[w]===void 0)continue;const{correct:k,applyTo:S}=hc[w],E=f.transform==="none"?y[w]:k(y[w],g);if(S){const j=S.length;for(let O=0;O<j;O++)f[S[O]]=E}else f[w]=E}return this.options.layoutId&&(f.pointerEvents=g===this?rc(a?.pointerEvents)||"":"none"),f}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(a=>{var c;return(c=a.currentAnimation)===null||c===void 0?void 0:c.stop()}),this.root.nodes.forEach(av),this.root.sharedNodes.clear()}}}function AN(e){e.updateLayout()}function RN(e){var t;const n=((t=e.resumeFrom)===null||t===void 0?void 0:t.snapshot)||e.snapshot;if(e.isLead()&&e.layout&&n&&e.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=e.layout,{animationType:o}=e.options,a=n.source!==e.layout.source;o==="size"?Fn(g=>{const y=a?n.measuredBox[g]:n.layoutBox[g],x=Rn(y);y.min=r[g].min,y.max=y.min+x}):Gb(o,n.layoutBox,r)&&Fn(g=>{const y=a?n.measuredBox[g]:n.layoutBox[g],x=Rn(r[g]);y.max=y.min+x,e.relativeTarget&&!e.currentAnimation&&(e.isProjectionDirty=!0,e.relativeTarget[g].max=e.relativeTarget[g].min+x)});const c=Ai();Xo(c,r,n.layoutBox);const d=Ai();a?Xo(d,e.applyTransform(s,!0),n.measuredBox):Xo(d,r,n.layoutBox);const f=!qb(c);let p=!1;if(!e.resumeFrom){const g=e.getClosestProjectingParent();if(g&&!g.resumeFrom){const{snapshot:y,layout:x}=g;if(y&&x){const b=Et();Yo(b,n.layoutBox,y.layoutBox);const w=Et();Yo(w,r,x.layoutBox),Hb(b,w)||(p=!0),g.options.layoutRoot&&(e.relativeTarget=w,e.relativeTargetOrigin=b,e.relativeParent=g)}}}e.notifyListeners("didUpdate",{layout:r,snapshot:n,delta:d,layoutDelta:c,hasLayoutChanged:f,hasRelativeTargetChanged:p})}else if(e.isLead()){const{onExitComplete:r}=e.options;r&&r()}e.options.transition=void 0}function PN(e){Ko&&Ss.totalNodes++,e.parent&&(e.isProjecting()||(e.isProjectionDirty=e.parent.isProjectionDirty),e.isSharedProjectionDirty||(e.isSharedProjectionDirty=!!(e.isProjectionDirty||e.parent.isProjectionDirty||e.parent.isSharedProjectionDirty)),e.isTransformDirty||(e.isTransformDirty=e.parent.isTransformDirty))}function ON(e){e.isProjectionDirty=e.isSharedProjectionDirty=e.isTransformDirty=!1}function LN(e){e.clearSnapshot()}function av(e){e.clearMeasurements()}function IN(e){e.isLayoutDirty=!1}function DN(e){const{visualElement:t}=e.options;t&&t.getProps().onBeforeLayoutMeasure&&t.notify("BeforeLayoutMeasure"),e.resetTransform()}function lv(e){e.finishAnimation(),e.targetDelta=e.relativeTarget=e.target=void 0,e.isProjectionDirty=!0}function MN(e){e.resolveTargetDelta()}function zN(e){e.calcProjection()}function FN(e){e.resetSkewAndRotation()}function $N(e){e.removeLeadSnapshot()}function cv(e,t,n){e.translate=_t(t.translate,0,n),e.scale=_t(t.scale,1,n),e.origin=t.origin,e.originPoint=t.originPoint}function uv(e,t,n,r){e.min=_t(t.min,n.min,r),e.max=_t(t.max,n.max,r)}function UN(e,t,n,r){uv(e.x,t.x,n.x,r),uv(e.y,t.y,n.y,r)}function BN(e){return e.animationValues&&e.animationValues.opacityExit!==void 0}const VN={duration:.45,ease:[.4,0,.1,1]},dv=e=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(e),hv=dv("applewebkit/")&&!dv("chrome/")?Math.round:Tn;function fv(e){e.min=hv(e.min),e.max=hv(e.max)}function qN(e){fv(e.x),fv(e.y)}function Gb(e,t,n){return e==="position"||e==="preserve-aspect"&&!W2(sv(t),sv(n),.2)}function HN(e){var t;return e!==e.root&&((t=e.scroll)===null||t===void 0?void 0:t.wasRoot)}const KN=Wb({attachResizeListener:(e,t)=>da(e,"resize",t),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),rh={current:void 0},Jb=Wb({measureScroll:e=>({x:e.scrollLeft,y:e.scrollTop}),defaultParent:()=>{if(!rh.current){const e=new KN({});e.mount(window),e.setOptions({layoutScroll:!0}),rh.current=e}return rh.current},resetTransform:(e,t)=>{e.style.transform=t!==void 0?t:"none"},checkIsScrollRoot:e=>window.getComputedStyle(e).position==="fixed"}),WN={pan:{Feature:cN},drag:{Feature:lN,ProjectionNode:Jb,MeasureLayout:Ub}};function pv(e,t,n){const{props:r}=e;e.animationState&&r.whileHover&&e.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,o=r[s];o&&pt.postRender(()=>o(t,Sa(t)))}class GN extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=WE(t,n=>(pv(this.node,n,"Start"),r=>pv(this.node,r,"End"))))}unmount(){}}class JN extends rs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let t=!1;try{t=this.node.current.matches(":focus-visible")}catch{t=!0}!t||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=ka(da(this.node.current,"focus",()=>this.onFocus()),da(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function mv(e,t,n){const{props:r}=e;e.animationState&&r.whileTap&&e.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),o=r[s];o&&pt.postRender(()=>o(t,Sa(t)))}class XN extends rs{mount(){const{current:t}=this.node;t&&(this.unmount=YE(t,n=>(mv(this.node,n,"Start"),(r,{success:s})=>mv(this.node,r,s?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const cf=new WeakMap,sh=new WeakMap,YN=e=>{const t=cf.get(e.target);t&&t(e)},QN=e=>{e.forEach(YN)};function ZN({root:e,...t}){const n=e||document;sh.has(n)||sh.set(n,{});const r=sh.get(n),s=JSON.stringify(t);return r[s]||(r[s]=new IntersectionObserver(QN,{root:e,...t})),r[s]}function eT(e,t,n){const r=ZN(t);return cf.set(e,n),r.observe(e),()=>{cf.delete(e),r.unobserve(e)}}const tT={some:0,all:1};class nT extends rs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:t={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:o}=t,a={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:tT[s]},c=d=>{const{isIntersecting:f}=d;if(this.isInView===f||(this.isInView=f,o&&!f&&this.hasEnteredView))return;f&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",f);const{onViewportEnter:p,onViewportLeave:g}=this.node.getProps(),y=f?p:g;y&&y(d)};return eT(this.node.current,a,c)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:t,prevProps:n}=this.node;["amount","margin","root"].some(rT(t,n))&&this.startObserver()}unmount(){}}function rT({viewport:e={}},{viewport:t={}}={}){return n=>e[n]!==t[n]}const sT={inView:{Feature:nT},tap:{Feature:XN},focus:{Feature:JN},hover:{Feature:GN}},iT={layout:{ProjectionNode:Jb,MeasureLayout:Ub}},uf={current:null},Xb={current:!1};function oT(){if(Xb.current=!0,!!Gf)if(window.matchMedia){const e=window.matchMedia("(prefers-reduced-motion)"),t=()=>uf.current=e.matches;e.addListener(t),t()}else uf.current=!1}const aT=[...bb,Xt,ns],lT=e=>aT.find(_b(e)),gv=new WeakMap;function cT(e,t,n){for(const r in t){const s=t[r],o=n[r];if(Qt(s))e.addValue(r,s);else if(Qt(o))e.addValue(r,ca(s,{owner:e}));else if(o!==s)if(e.hasValue(r)){const a=e.getValue(r);a.liveStyle===!0?a.jump(s):a.hasAnimated||a.set(s)}else{const a=e.getStaticValue(r);e.addValue(r,ca(a!==void 0?a:s,{owner:e}))}}for(const r in n)t[r]===void 0&&e.removeValue(r);return t}const yv=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class uT{scrapeMotionValuesFromProps(t,n,r){return{}}constructor({parent:t,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:o,visualState:a},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=bp,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=ur.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,pt.render(this.render,!1,!0))};const{latestValues:d,renderState:f,onUpdate:p}=a;this.onUpdate=p,this.latestValues=d,this.baseTarget={...d},this.initialValues=n.initial?{...d}:{},this.renderState=f,this.parent=t,this.props=n,this.presenceContext=r,this.depth=t?t.depth+1:0,this.reducedMotionConfig=s,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=Mc(n),this.isVariantNode=T_(n),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(t&&t.current);const{willChange:g,...y}=this.scrapeMotionValuesFromProps(n,{},this);for(const x in y){const b=y[x];d[x]!==void 0&&Qt(b)&&b.set(d[x],!1)}}mount(t){this.current=t,gv.set(t,this),this.projection&&!this.projection.instance&&this.projection.mount(t),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((n,r)=>this.bindToMotionValue(r,n)),Xb.current||oT(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:uf.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){gv.delete(this.current),this.projection&&this.projection.unmount(),ts(this.notifyUpdate),ts(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const n=this.features[t];n&&(n.unmount(),n.isMounted=!1)}this.current=null}bindToMotionValue(t,n){this.valueSubscriptions.has(t)&&this.valueSubscriptions.get(t)();const r=$s.has(t),s=n.on("change",c=>{this.latestValues[t]=c,this.props.onUpdate&&pt.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0)}),o=n.on("renderRequest",this.scheduleRender);let a;window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,t,n)),this.valueSubscriptions.set(t,()=>{s(),o(),a&&a(),n.owner&&n.stop()})}sortNodePosition(t){return!this.current||!this.sortInstanceNodePosition||this.type!==t.type?0:this.sortInstanceNodePosition(this.current,t.current)}updateFeatures(){let t="animation";for(t in $i){const n=$i[t];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[t]&&s&&r(this.props)&&(this.features[t]=new s(this)),this.features[t]){const o=this.features[t];o.isMounted?o.update():(o.mount(),o.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Et()}getStaticValue(t){return this.latestValues[t]}setStaticValue(t,n){this.latestValues[t]=n}update(t,n){(t.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=t,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;r<yv.length;r++){const s=yv[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const o="on"+s,a=t[o];a&&(this.propEventSubscriptions[s]=this.on(s,a))}this.prevMotionValues=cT(this,this.scrapeMotionValuesFromProps(t,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(t){return this.props.variants?this.props.variants[t]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(t){const n=this.getClosestVariantNode();if(n)return n.variantChildren&&n.variantChildren.add(t),()=>n.variantChildren.delete(t)}addValue(t,n){const r=this.values.get(t);n!==r&&(r&&this.removeValue(t),this.bindToMotionValue(t,n),this.values.set(t,n),this.latestValues[t]=n.get())}removeValue(t){this.values.delete(t);const n=this.valueSubscriptions.get(t);n&&(n(),this.valueSubscriptions.delete(t)),delete this.latestValues[t],this.removeValueFromRenderState(t,this.renderState)}hasValue(t){return this.values.has(t)}getValue(t,n){if(this.props.values&&this.props.values[t])return this.props.values[t];let r=this.values.get(t);return r===void 0&&n!==void 0&&(r=ca(n===null?void 0:n,{owner:this}),this.addValue(t,r)),r}readValue(t,n){var r;let s=this.latestValues[t]!==void 0||!this.current?this.latestValues[t]:(r=this.getBaseTargetFromProps(this.props,t))!==null&&r!==void 0?r:this.readValueFromInstance(this.current,t,this.options);return s!=null&&(typeof s=="string"&&(xb(s)||cb(s))?s=parseFloat(s):!lT(s)&&ns.test(n)&&(s=mb(t,n)),this.setBaseTarget(t,Qt(s)?s.get():s)),Qt(s)?s.get():s}setBaseTarget(t,n){this.baseTarget[t]=n}getBaseTarget(t){var n;const{initial:r}=this.props;let s;if(typeof r=="string"||typeof r=="object"){const a=tp(this.props,r,(n=this.presenceContext)===null||n===void 0?void 0:n.custom);a&&(s=a[t])}if(r&&s!==void 0)return s;const o=this.getBaseTargetFromProps(this.props,t);return o!==void 0&&!Qt(o)?o:this.initialValues[t]!==void 0&&s===void 0?void 0:this.baseTarget[t]}on(t,n){return this.events[t]||(this.events[t]=new mp),this.events[t].add(n)}notify(t,...n){this.events[t]&&this.events[t].notify(...n)}}class Yb extends uT{constructor(){super(...arguments),this.KeyframeResolver=wb}sortInstanceNodePosition(t,n){return t.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(t,n){return t.style?t.style[n]:void 0}removeValueFromRenderState(t,{vars:n,style:r}){delete n[t],delete r[t]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:t}=this.props;Qt(t)&&(this.childSubscription=t.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function dT(e){return window.getComputedStyle(e)}class hT extends Yb{constructor(){super(...arguments),this.type="html",this.renderInstance=z_}readValueFromInstance(t,n){if($s.has(n)){const r=_p(n);return r&&r.default||0}else{const r=dT(t),s=(I_(n)?r.getPropertyValue(n):r[n])||0;return typeof s=="string"?s.trim():s}}measureInstanceViewportBox(t,{transformPagePoint:n}){return Fb(t,n)}build(t,n,r){sp(t,n,r.transformTemplate)}scrapeMotionValuesFromProps(t,n,r){return lp(t,n,r)}}class fT extends Yb{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Et}getBaseTargetFromProps(t,n){return t[n]}readValueFromInstance(t,n){if($s.has(n)){const r=_p(n);return r&&r.default||0}return n=F_.has(n)?n:Qf(n),t.getAttribute(n)}scrapeMotionValuesFromProps(t,n,r){return B_(t,n,r)}build(t,n,r){ip(t,n,this.isSVGTag,r.transformTemplate)}renderInstance(t,n,r,s){$_(t,n,r,s)}mount(t){this.isSVGTag=ap(t.tagName),super.mount(t)}}const pT=(e,t)=>ep(e)?new fT(t):new hT(t,{allowProjection:e!==R.Fragment}),mT=$E({...z2,...sT,...WN,...iT},pT),Le=tE(mT);function Qb(e,t){return function(){return e.apply(t,arguments)}}const{toString:gT}=Object.prototype,{getPrototypeOf:jp}=Object,{iterator:$c,toStringTag:Zb}=Symbol,Uc=(e=>t=>{const n=gT.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),Zn=e=>(e=e.toLowerCase(),t=>Uc(t)===e),Bc=e=>t=>typeof t===e,{isArray:Wi}=Array,Bi=Bc("undefined");function ja(e){return e!==null&&!Bi(e)&&e.constructor!==null&&!Bi(e.constructor)&&xn(e.constructor.isBuffer)&&e.constructor.isBuffer(e)}const ew=Zn("ArrayBuffer");function yT(e){let t;return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?t=ArrayBuffer.isView(e):t=e&&e.buffer&&ew(e.buffer),t}const xT=Bc("string"),xn=Bc("function"),tw=Bc("number"),Ea=e=>e!==null&&typeof e=="object",vT=e=>e===!0||e===!1,oc=e=>{if(Uc(e)!=="object")return!1;const t=jp(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Zb in e)&&!($c in e)},_T=e=>{if(!Ea(e)||ja(e))return!1;try{return Object.keys(e).length===0&&Object.getPrototypeOf(e)===Object.prototype}catch{return!1}},bT=Zn("Date"),wT=Zn("File"),kT=Zn("Blob"),ST=Zn("FileList"),jT=e=>Ea(e)&&xn(e.pipe),ET=e=>{let t;return e&&(typeof FormData=="function"&&e instanceof FormData||xn(e.append)&&((t=Uc(e))==="formdata"||t==="object"&&xn(e.toString)&&e.toString()==="[object FormData]"))},CT=Zn("URLSearchParams"),[NT,TT,AT,RT]=["ReadableStream","Request","Response","Headers"].map(Zn),PT=e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,"");function Ca(e,t,{allOwnKeys:n=!1}={}){if(e===null||typeof e>"u")return;let r,s;if(typeof e!="object"&&(e=[e]),Wi(e))for(r=0,s=e.length;r<s;r++)t.call(null,e[r],r,e);else{if(ja(e))return;const o=n?Object.getOwnPropertyNames(e):Object.keys(e),a=o.length;let c;for(r=0;r<a;r++)c=o[r],t.call(null,e[c],c,e)}}function nw(e,t){if(ja(e))return null;t=t.toLowerCase();const n=Object.keys(e);let r=n.length,s;for(;r-- >0;)if(s=n[r],t===s.toLowerCase())return s;return null}const Ts=typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:global,rw=e=>!Bi(e)&&e!==Ts;function df(){const{caseless:e,skipUndefined:t}=rw(this)&&this||{},n={},r=(s,o)=>{const a=e&&nw(n,o)||o;oc(n[a])&&oc(s)?n[a]=df(n[a],s):oc(s)?n[a]=df({},s):Wi(s)?n[a]=s.slice():(!t||!Bi(s))&&(n[a]=s)};for(let s=0,o=arguments.length;s<o;s++)arguments[s]&&Ca(arguments[s],r);return n}const OT=(e,t,n,{allOwnKeys:r}={})=>(Ca(t,(s,o)=>{n&&xn(s)?e[o]=Qb(s,n):e[o]=s},{allOwnKeys:r}),e),LT=e=>(e.charCodeAt(0)===65279&&(e=e.slice(1)),e),IT=(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},DT=(e,t,n,r)=>{let s,o,a;const c={};if(t=t||{},e==null)return t;do{for(s=Object.getOwnPropertyNames(e),o=s.length;o-- >0;)a=s[o],(!r||r(a,e,t))&&!c[a]&&(t[a]=e[a],c[a]=!0);e=n!==!1&&jp(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},MT=(e,t,n)=>{e=String(e),(n===void 0||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return r!==-1&&r===n},zT=e=>{if(!e)return null;if(Wi(e))return e;let t=e.length;if(!tw(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},FT=(e=>t=>e&&t instanceof e)(typeof Uint8Array<"u"&&jp(Uint8Array)),$T=(e,t)=>{const r=(e&&e[$c]).call(e);let s;for(;(s=r.next())&&!s.done;){const o=s.value;t.call(e,o[0],o[1])}},UT=(e,t)=>{let n;const r=[];for(;(n=e.exec(t))!==null;)r.push(n);return r},BT=Zn("HTMLFormElement"),VT=e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,function(n,r,s){return r.toUpperCase()+s}),xv=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),qT=Zn("RegExp"),sw=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};Ca(n,(s,o)=>{let a;(a=t(s,o,e))!==!1&&(r[o]=a||s)}),Object.defineProperties(e,r)},HT=e=>{sw(e,(t,n)=>{if(xn(e)&&["arguments","caller","callee"].indexOf(n)!==-1)return!1;const r=e[n];if(xn(r)){if(t.enumerable=!1,"writable"in t){t.writable=!1;return}t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")})}})},KT=(e,t)=>{const n={},r=s=>{s.forEach(o=>{n[o]=!0})};return Wi(e)?r(e):r(String(e).split(t)),n},WT=()=>{},GT=(e,t)=>e!=null&&Number.isFinite(e=+e)?e:t;function JT(e){return!!(e&&xn(e.append)&&e[Zb]==="FormData"&&e[$c])}const XT=e=>{const t=new Array(10),n=(r,s)=>{if(Ea(r)){if(t.indexOf(r)>=0)return;if(ja(r))return r;if(!("toJSON"in r)){t[s]=r;const o=Wi(r)?[]:{};return Ca(r,(a,c)=>{const d=n(a,s+1);!Bi(d)&&(o[c]=d)}),t[s]=void 0,o}}return r};return n(e,0)},YT=Zn("AsyncFunction"),QT=e=>e&&(Ea(e)||xn(e))&&xn(e.then)&&xn(e.catch),iw=((e,t)=>e?setImmediate:t?((n,r)=>(Ts.addEventListener("message",({source:s,data:o})=>{s===Ts&&o===n&&r.length&&r.shift()()},!1),s=>{r.push(s),Ts.postMessage(n,"*")}))(`axios@${Math.random()}`,[]):n=>setTimeout(n))(typeof setImmediate=="function",xn(Ts.postMessage)),ZT=typeof queueMicrotask<"u"?queueMicrotask.bind(Ts):typeof process<"u"&&process.nextTick||iw,eA=e=>e!=null&&xn(e[$c]),H={isArray:Wi,isArrayBuffer:ew,isBuffer:ja,isFormData:ET,isArrayBufferView:yT,isString:xT,isNumber:tw,isBoolean:vT,isObject:Ea,isPlainObject:oc,isEmptyObject:_T,isReadableStream:NT,isRequest:TT,isResponse:AT,isHeaders:RT,isUndefined:Bi,isDate:bT,isFile:wT,isBlob:kT,isRegExp:qT,isFunction:xn,isStream:jT,isURLSearchParams:CT,isTypedArray:FT,isFileList:ST,forEach:Ca,merge:df,extend:OT,trim:PT,stripBOM:LT,inherits:IT,toFlatObject:DT,kindOf:Uc,kindOfTest:Zn,endsWith:MT,toArray:zT,forEachEntry:$T,matchAll:UT,isHTMLForm:BT,hasOwnProperty:xv,hasOwnProp:xv,reduceDescriptors:sw,freezeMethods:HT,toObjectSet:KT,toCamelCase:VT,noop:WT,toFiniteNumber:GT,findKey:nw,global:Ts,isContextDefined:rw,isSpecCompliantForm:JT,toJSONObject:XT,isAsyncFn:YT,isThenable:QT,setImmediate:iw,asap:ZT,isIterable:eA};function qe(e,t,n,r,s){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),s&&(this.response=s,this.status=s.status?s.status:null)}H.inherits(qe,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:H.toJSONObject(this.config),code:this.code,status:this.status}}});const ow=qe.prototype,aw={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach(e=>{aw[e]={value:e}});Object.defineProperties(qe,aw);Object.defineProperty(ow,"isAxiosError",{value:!0});qe.from=(e,t,n,r,s,o)=>{const a=Object.create(ow);H.toFlatObject(e,a,function(p){return p!==Error.prototype},f=>f!=="isAxiosError");const c=e&&e.message?e.message:"Error",d=t==null&&e?e.code:t;return qe.call(a,c,d,n,r,s),e&&a.cause==null&&Object.defineProperty(a,"cause",{value:e,configurable:!0}),a.name=e&&e.name||"Error",o&&Object.assign(a,o),a};const tA=null;function hf(e){return H.isPlainObject(e)||H.isArray(e)}function lw(e){return H.endsWith(e,"[]")?e.slice(0,-2):e}function vv(e,t,n){return e?e.concat(t).map(function(s,o){return s=lw(s),!n&&o?"["+s+"]":s}).join(n?".":""):t}function nA(e){return H.isArray(e)&&!e.some(hf)}const rA=H.toFlatObject(H,{},null,function(t){return/^is[A-Z]/.test(t)});function Vc(e,t,n){if(!H.isObject(e))throw new TypeError("target must be an object");t=t||new FormData,n=H.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,function(w,k){return!H.isUndefined(k[w])});const r=n.metaTokens,s=n.visitor||p,o=n.dots,a=n.indexes,d=(n.Blob||typeof Blob<"u"&&Blob)&&H.isSpecCompliantForm(t);if(!H.isFunction(s))throw new TypeError("visitor must be a function");function f(b){if(b===null)return"";if(H.isDate(b))return b.toISOString();if(H.isBoolean(b))return b.toString();if(!d&&H.isBlob(b))throw new qe("Blob is not supported. Use a Buffer instead.");return H.isArrayBuffer(b)||H.isTypedArray(b)?d&&typeof Blob=="function"?new Blob([b]):Buffer.from(b):b}function p(b,w,k){let S=b;if(b&&!k&&typeof b=="object"){if(H.endsWith(w,"{}"))w=r?w:w.slice(0,-2),b=JSON.stringify(b);else if(H.isArray(b)&&nA(b)||(H.isFileList(b)||H.endsWith(w,"[]"))&&(S=H.toArray(b)))return w=lw(w),S.forEach(function(j,O){!(H.isUndefined(j)||j===null)&&t.append(a===!0?vv([w],O,o):a===null?w:w+"[]",f(j))}),!1}return hf(b)?!0:(t.append(vv(k,w,o),f(b)),!1)}const g=[],y=Object.assign(rA,{defaultVisitor:p,convertValue:f,isVisitable:hf});function x(b,w){if(!H.isUndefined(b)){if(g.indexOf(b)!==-1)throw Error("Circular reference detected in "+w.join("."));g.push(b),H.forEach(b,function(S,E){(!(H.isUndefined(S)||S===null)&&s.call(t,S,H.isString(E)?E.trim():E,w,y))===!0&&x(S,w?w.concat(E):[E])}),g.pop()}}if(!H.isObject(e))throw new TypeError("data must be an object");return x(e),t}function _v(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,function(r){return t[r]})}function Ep(e,t){this._pairs=[],e&&Vc(e,this,t)}const cw=Ep.prototype;cw.append=function(t,n){this._pairs.push([t,n])};cw.toString=function(t){const n=t?function(r){return t.call(this,r,_v)}:_v;return this._pairs.map(function(s){return n(s[0])+"="+n(s[1])},"").join("&")};function sA(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+")}function uw(e,t,n){if(!t)return e;const r=n&&n.encode||sA;H.isFunction(n)&&(n={serialize:n});const s=n&&n.serialize;let o;if(s?o=s(t,n):o=H.isURLSearchParams(t)?t.toString():new Ep(t,n).toString(r),o){const a=e.indexOf("#");a!==-1&&(e=e.slice(0,a)),e+=(e.indexOf("?")===-1?"?":"&")+o}return e}class bv{constructor(){this.handlers=[]}use(t,n,r){return this.handlers.push({fulfilled:t,rejected:n,synchronous:r?r.synchronous:!1,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(t){this.handlers[t]&&(this.handlers[t]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(t){H.forEach(this.handlers,function(r){r!==null&&t(r)})}}const dw={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},iA=typeof URLSearchParams<"u"?URLSearchParams:Ep,oA=typeof FormData<"u"?FormData:null,aA=typeof Blob<"u"?Blob:null,lA={isBrowser:!0,classes:{URLSearchParams:iA,FormData:oA,Blob:aA},protocols:["http","https","file","blob","url","data"]},Cp=typeof window<"u"&&typeof document<"u",ff=typeof navigator=="object"&&navigator||void 0,cA=Cp&&(!ff||["ReactNative","NativeScript","NS"].indexOf(ff.product)<0),uA=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope&&typeof self.importScripts=="function",dA=Cp&&window.location.href||"http://localhost",hA=Object.freeze(Object.defineProperty({__proto__:null,hasBrowserEnv:Cp,hasStandardBrowserEnv:cA,hasStandardBrowserWebWorkerEnv:uA,navigator:ff,origin:dA},Symbol.toStringTag,{value:"Module"})),Yt={...hA,...lA};function fA(e,t){return Vc(e,new Yt.classes.URLSearchParams,{visitor:function(n,r,s,o){return Yt.isNode&&H.isBuffer(n)?(this.append(r,n.toString("base64")),!1):o.defaultVisitor.apply(this,arguments)},...t})}function pA(e){return H.matchAll(/\w+|\[(\w*)]/g,e).map(t=>t[0]==="[]"?"":t[1]||t[0])}function mA(e){const t={},n=Object.keys(e);let r;const s=n.length;let o;for(r=0;r<s;r++)o=n[r],t[o]=e[o];return t}function hw(e){function t(n,r,s,o){let a=n[o++];if(a==="__proto__")return!0;const c=Number.isFinite(+a),d=o>=n.length;return a=!a&&H.isArray(s)?s.length:a,d?(H.hasOwnProp(s,a)?s[a]=[s[a],r]:s[a]=r,!c):((!s[a]||!H.isObject(s[a]))&&(s[a]=[]),t(n,r,s[a],o)&&H.isArray(s[a])&&(s[a]=mA(s[a])),!c)}if(H.isFormData(e)&&H.isFunction(e.entries)){const n={};return H.forEachEntry(e,(r,s)=>{t(pA(r),s,n,0)}),n}return null}function gA(e,t,n){if(H.isString(e))try{return(t||JSON.parse)(e),H.trim(e)}catch(r){if(r.name!=="SyntaxError")throw r}return(n||JSON.stringify)(e)}const Na={transitional:dw,adapter:["xhr","http","fetch"],transformRequest:[function(t,n){const r=n.getContentType()||"",s=r.indexOf("application/json")>-1,o=H.isObject(t);if(o&&H.isHTMLForm(t)&&(t=new FormData(t)),H.isFormData(t))return s?JSON.stringify(hw(t)):t;if(H.isArrayBuffer(t)||H.isBuffer(t)||H.isStream(t)||H.isFile(t)||H.isBlob(t)||H.isReadableStream(t))return t;if(H.isArrayBufferView(t))return t.buffer;if(H.isURLSearchParams(t))return n.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),t.toString();let c;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return fA(t,this.formSerializer).toString();if((c=H.isFileList(t))||r.indexOf("multipart/form-data")>-1){const d=this.env&&this.env.FormData;return Vc(c?{"files[]":t}:t,d&&new d,this.formSerializer)}}return o||s?(n.setContentType("application/json",!1),gA(t)):t}],transformResponse:[function(t){const n=this.transitional||Na.transitional,r=n&&n.forcedJSONParsing,s=this.responseType==="json";if(H.isResponse(t)||H.isReadableStream(t))return t;if(t&&H.isString(t)&&(r&&!this.responseType||s)){const a=!(n&&n.silentJSONParsing)&&s;try{return JSON.parse(t,this.parseReviver)}catch(c){if(a)throw c.name==="SyntaxError"?qe.from(c,qe.ERR_BAD_RESPONSE,this,null,this.response):c}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:Yt.classes.FormData,Blob:Yt.classes.Blob},validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};H.forEach(["delete","get","head","post","put","patch"],e=>{Na.headers[e]={}});const yA=H.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]),xA=e=>{const t={};let n,r,s;return e&&e.split(`
|
|
17
|
+
`).forEach(function(a){s=a.indexOf(":"),n=a.substring(0,s).trim().toLowerCase(),r=a.substring(s+1).trim(),!(!n||t[n]&&yA[n])&&(n==="set-cookie"?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)}),t},wv=Symbol("internals");function Mo(e){return e&&String(e).trim().toLowerCase()}function ac(e){return e===!1||e==null?e:H.isArray(e)?e.map(ac):String(e)}function vA(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}const _A=e=>/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim());function ih(e,t,n,r,s){if(H.isFunction(r))return r.call(this,t,n);if(s&&(t=n),!!H.isString(t)){if(H.isString(r))return t.indexOf(r)!==-1;if(H.isRegExp(r))return r.test(t)}}function bA(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,(t,n,r)=>n.toUpperCase()+r)}function wA(e,t){const n=H.toCamelCase(" "+t);["get","set","has"].forEach(r=>{Object.defineProperty(e,r+n,{value:function(s,o,a){return this[r].call(this,t,s,o,a)},configurable:!0})})}let vn=class{constructor(t){t&&this.set(t)}set(t,n,r){const s=this;function o(c,d,f){const p=Mo(d);if(!p)throw new Error("header name must be a non-empty string");const g=H.findKey(s,p);(!g||s[g]===void 0||f===!0||f===void 0&&s[g]!==!1)&&(s[g||d]=ac(c))}const a=(c,d)=>H.forEach(c,(f,p)=>o(f,p,d));if(H.isPlainObject(t)||t instanceof this.constructor)a(t,n);else if(H.isString(t)&&(t=t.trim())&&!_A(t))a(xA(t),n);else if(H.isObject(t)&&H.isIterable(t)){let c={},d,f;for(const p of t){if(!H.isArray(p))throw TypeError("Object iterator must return a key-value pair");c[f=p[0]]=(d=c[f])?H.isArray(d)?[...d,p[1]]:[d,p[1]]:p[1]}a(c,n)}else t!=null&&o(n,t,r);return this}get(t,n){if(t=Mo(t),t){const r=H.findKey(this,t);if(r){const s=this[r];if(!n)return s;if(n===!0)return vA(s);if(H.isFunction(n))return n.call(this,s,r);if(H.isRegExp(n))return n.exec(s);throw new TypeError("parser must be boolean|regexp|function")}}}has(t,n){if(t=Mo(t),t){const r=H.findKey(this,t);return!!(r&&this[r]!==void 0&&(!n||ih(this,this[r],r,n)))}return!1}delete(t,n){const r=this;let s=!1;function o(a){if(a=Mo(a),a){const c=H.findKey(r,a);c&&(!n||ih(r,r[c],c,n))&&(delete r[c],s=!0)}}return H.isArray(t)?t.forEach(o):o(t),s}clear(t){const n=Object.keys(this);let r=n.length,s=!1;for(;r--;){const o=n[r];(!t||ih(this,this[o],o,t,!0))&&(delete this[o],s=!0)}return s}normalize(t){const n=this,r={};return H.forEach(this,(s,o)=>{const a=H.findKey(r,o);if(a){n[a]=ac(s),delete n[o];return}const c=t?bA(o):String(o).trim();c!==o&&delete n[o],n[c]=ac(s),r[c]=!0}),this}concat(...t){return this.constructor.concat(this,...t)}toJSON(t){const n=Object.create(null);return H.forEach(this,(r,s)=>{r!=null&&r!==!1&&(n[s]=t&&H.isArray(r)?r.join(", "):r)}),n}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map(([t,n])=>t+": "+n).join(`
|
|
18
|
+
`)}getSetCookie(){return this.get("set-cookie")||[]}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(t){return t instanceof this?t:new this(t)}static concat(t,...n){const r=new this(t);return n.forEach(s=>r.set(s)),r}static accessor(t){const r=(this[wv]=this[wv]={accessors:{}}).accessors,s=this.prototype;function o(a){const c=Mo(a);r[c]||(wA(s,a),r[c]=!0)}return H.isArray(t)?t.forEach(o):o(t),this}};vn.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]);H.reduceDescriptors(vn.prototype,({value:e},t)=>{let n=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(r){this[n]=r}}});H.freezeMethods(vn);function oh(e,t){const n=this||Na,r=t||n,s=vn.from(r.headers);let o=r.data;return H.forEach(e,function(c){o=c.call(n,o,s.normalize(),t?t.status:void 0)}),s.normalize(),o}function fw(e){return!!(e&&e.__CANCEL__)}function Gi(e,t,n){qe.call(this,e??"canceled",qe.ERR_CANCELED,t,n),this.name="CanceledError"}H.inherits(Gi,qe,{__CANCEL__:!0});function pw(e,t,n){const r=n.config.validateStatus;!n.status||!r||r(n.status)?e(n):t(new qe("Request failed with status code "+n.status,[qe.ERR_BAD_REQUEST,qe.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n))}function kA(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}function SA(e,t){e=e||10;const n=new Array(e),r=new Array(e);let s=0,o=0,a;return t=t!==void 0?t:1e3,function(d){const f=Date.now(),p=r[o];a||(a=f),n[s]=d,r[s]=f;let g=o,y=0;for(;g!==s;)y+=n[g++],g=g%e;if(s=(s+1)%e,s===o&&(o=(o+1)%e),f-a<t)return;const x=p&&f-p;return x?Math.round(y*1e3/x):void 0}}function jA(e,t){let n=0,r=1e3/t,s,o;const a=(f,p=Date.now())=>{n=p,s=null,o&&(clearTimeout(o),o=null),e(...f)};return[(...f)=>{const p=Date.now(),g=p-n;g>=r?a(f,p):(s=f,o||(o=setTimeout(()=>{o=null,a(s)},r-g)))},()=>s&&a(s)]}const xc=(e,t,n=3)=>{let r=0;const s=SA(50,250);return jA(o=>{const a=o.loaded,c=o.lengthComputable?o.total:void 0,d=a-r,f=s(d),p=a<=c;r=a;const g={loaded:a,total:c,progress:c?a/c:void 0,bytes:d,rate:f||void 0,estimated:f&&c&&p?(c-a)/f:void 0,event:o,lengthComputable:c!=null,[t?"download":"upload"]:!0};e(g)},n)},kv=(e,t)=>{const n=e!=null;return[r=>t[0]({lengthComputable:n,total:e,loaded:r}),t[1]]},Sv=e=>(...t)=>H.asap(()=>e(...t)),EA=Yt.hasStandardBrowserEnv?((e,t)=>n=>(n=new URL(n,Yt.origin),e.protocol===n.protocol&&e.host===n.host&&(t||e.port===n.port)))(new URL(Yt.origin),Yt.navigator&&/(msie|trident)/i.test(Yt.navigator.userAgent)):()=>!0,CA=Yt.hasStandardBrowserEnv?{write(e,t,n,r,s,o,a){if(typeof document>"u")return;const c=[`${e}=${encodeURIComponent(t)}`];H.isNumber(n)&&c.push(`expires=${new Date(n).toUTCString()}`),H.isString(r)&&c.push(`path=${r}`),H.isString(s)&&c.push(`domain=${s}`),o===!0&&c.push("secure"),H.isString(a)&&c.push(`SameSite=${a}`),document.cookie=c.join("; ")},read(e){if(typeof document>"u")return null;const t=document.cookie.match(new RegExp("(?:^|; )"+e+"=([^;]*)"));return t?decodeURIComponent(t[1]):null},remove(e){this.write(e,"",Date.now()-864e5,"/")}}:{write(){},read(){return null},remove(){}};function NA(e){return/^([a-z][a-z\d+\-.]*:)?\/\//i.test(e)}function TA(e,t){return t?e.replace(/\/?\/$/,"")+"/"+t.replace(/^\/+/,""):e}function mw(e,t,n){let r=!NA(t);return e&&(r||n==!1)?TA(e,t):t}const jv=e=>e instanceof vn?{...e}:e;function Ms(e,t){t=t||{};const n={};function r(f,p,g,y){return H.isPlainObject(f)&&H.isPlainObject(p)?H.merge.call({caseless:y},f,p):H.isPlainObject(p)?H.merge({},p):H.isArray(p)?p.slice():p}function s(f,p,g,y){if(H.isUndefined(p)){if(!H.isUndefined(f))return r(void 0,f,g,y)}else return r(f,p,g,y)}function o(f,p){if(!H.isUndefined(p))return r(void 0,p)}function a(f,p){if(H.isUndefined(p)){if(!H.isUndefined(f))return r(void 0,f)}else return r(void 0,p)}function c(f,p,g){if(g in t)return r(f,p);if(g in e)return r(void 0,f)}const d={url:o,method:o,data:o,baseURL:a,transformRequest:a,transformResponse:a,paramsSerializer:a,timeout:a,timeoutMessage:a,withCredentials:a,withXSRFToken:a,adapter:a,responseType:a,xsrfCookieName:a,xsrfHeaderName:a,onUploadProgress:a,onDownloadProgress:a,decompress:a,maxContentLength:a,maxBodyLength:a,beforeRedirect:a,transport:a,httpAgent:a,httpsAgent:a,cancelToken:a,socketPath:a,responseEncoding:a,validateStatus:c,headers:(f,p,g)=>s(jv(f),jv(p),g,!0)};return H.forEach(Object.keys({...e,...t}),function(p){const g=d[p]||s,y=g(e[p],t[p],p);H.isUndefined(y)&&g!==c||(n[p]=y)}),n}const gw=e=>{const t=Ms({},e);let{data:n,withXSRFToken:r,xsrfHeaderName:s,xsrfCookieName:o,headers:a,auth:c}=t;if(t.headers=a=vn.from(a),t.url=uw(mw(t.baseURL,t.url,t.allowAbsoluteUrls),e.params,e.paramsSerializer),c&&a.set("Authorization","Basic "+btoa((c.username||"")+":"+(c.password?unescape(encodeURIComponent(c.password)):""))),H.isFormData(n)){if(Yt.hasStandardBrowserEnv||Yt.hasStandardBrowserWebWorkerEnv)a.setContentType(void 0);else if(H.isFunction(n.getHeaders)){const d=n.getHeaders(),f=["content-type","content-length"];Object.entries(d).forEach(([p,g])=>{f.includes(p.toLowerCase())&&a.set(p,g)})}}if(Yt.hasStandardBrowserEnv&&(r&&H.isFunction(r)&&(r=r(t)),r||r!==!1&&EA(t.url))){const d=s&&o&&CA.read(o);d&&a.set(s,d)}return t},AA=typeof XMLHttpRequest<"u",RA=AA&&function(e){return new Promise(function(n,r){const s=gw(e);let o=s.data;const a=vn.from(s.headers).normalize();let{responseType:c,onUploadProgress:d,onDownloadProgress:f}=s,p,g,y,x,b;function w(){x&&x(),b&&b(),s.cancelToken&&s.cancelToken.unsubscribe(p),s.signal&&s.signal.removeEventListener("abort",p)}let k=new XMLHttpRequest;k.open(s.method.toUpperCase(),s.url,!0),k.timeout=s.timeout;function S(){if(!k)return;const j=vn.from("getAllResponseHeaders"in k&&k.getAllResponseHeaders()),N={data:!c||c==="text"||c==="json"?k.responseText:k.response,status:k.status,statusText:k.statusText,headers:j,config:e,request:k};pw(function(I){n(I),w()},function(I){r(I),w()},N),k=null}"onloadend"in k?k.onloadend=S:k.onreadystatechange=function(){!k||k.readyState!==4||k.status===0&&!(k.responseURL&&k.responseURL.indexOf("file:")===0)||setTimeout(S)},k.onabort=function(){k&&(r(new qe("Request aborted",qe.ECONNABORTED,e,k)),k=null)},k.onerror=function(O){const N=O&&O.message?O.message:"Network Error",T=new qe(N,qe.ERR_NETWORK,e,k);T.event=O||null,r(T),k=null},k.ontimeout=function(){let O=s.timeout?"timeout of "+s.timeout+"ms exceeded":"timeout exceeded";const N=s.transitional||dw;s.timeoutErrorMessage&&(O=s.timeoutErrorMessage),r(new qe(O,N.clarifyTimeoutError?qe.ETIMEDOUT:qe.ECONNABORTED,e,k)),k=null},o===void 0&&a.setContentType(null),"setRequestHeader"in k&&H.forEach(a.toJSON(),function(O,N){k.setRequestHeader(N,O)}),H.isUndefined(s.withCredentials)||(k.withCredentials=!!s.withCredentials),c&&c!=="json"&&(k.responseType=s.responseType),f&&([y,b]=xc(f,!0),k.addEventListener("progress",y)),d&&k.upload&&([g,x]=xc(d),k.upload.addEventListener("progress",g),k.upload.addEventListener("loadend",x)),(s.cancelToken||s.signal)&&(p=j=>{k&&(r(!j||j.type?new Gi(null,e,k):j),k.abort(),k=null)},s.cancelToken&&s.cancelToken.subscribe(p),s.signal&&(s.signal.aborted?p():s.signal.addEventListener("abort",p)));const E=kA(s.url);if(E&&Yt.protocols.indexOf(E)===-1){r(new qe("Unsupported protocol "+E+":",qe.ERR_BAD_REQUEST,e));return}k.send(o||null)})},PA=(e,t)=>{const{length:n}=e=e?e.filter(Boolean):[];if(t||n){let r=new AbortController,s;const o=function(f){if(!s){s=!0,c();const p=f instanceof Error?f:this.reason;r.abort(p instanceof qe?p:new Gi(p instanceof Error?p.message:p))}};let a=t&&setTimeout(()=>{a=null,o(new qe(`timeout ${t} of ms exceeded`,qe.ETIMEDOUT))},t);const c=()=>{e&&(a&&clearTimeout(a),a=null,e.forEach(f=>{f.unsubscribe?f.unsubscribe(o):f.removeEventListener("abort",o)}),e=null)};e.forEach(f=>f.addEventListener("abort",o));const{signal:d}=r;return d.unsubscribe=()=>H.asap(c),d}},OA=function*(e,t){let n=e.byteLength;if(n<t){yield e;return}let r=0,s;for(;r<n;)s=r+t,yield e.slice(r,s),r=s},LA=async function*(e,t){for await(const n of IA(e))yield*OA(n,t)},IA=async function*(e){if(e[Symbol.asyncIterator]){yield*e;return}const t=e.getReader();try{for(;;){const{done:n,value:r}=await t.read();if(n)break;yield r}}finally{await t.cancel()}},Ev=(e,t,n,r)=>{const s=LA(e,t);let o=0,a,c=d=>{a||(a=!0,r&&r(d))};return new ReadableStream({async pull(d){try{const{done:f,value:p}=await s.next();if(f){c(),d.close();return}let g=p.byteLength;if(n){let y=o+=g;n(y)}d.enqueue(new Uint8Array(p))}catch(f){throw c(f),f}},cancel(d){return c(d),s.return()}},{highWaterMark:2})},Cv=64*1024,{isFunction:Hl}=H,DA=(({Request:e,Response:t})=>({Request:e,Response:t}))(H.global),{ReadableStream:Nv,TextEncoder:Tv}=H.global,Av=(e,...t)=>{try{return!!e(...t)}catch{return!1}},MA=e=>{e=H.merge.call({skipUndefined:!0},DA,e);const{fetch:t,Request:n,Response:r}=e,s=t?Hl(t):typeof fetch=="function",o=Hl(n),a=Hl(r);if(!s)return!1;const c=s&&Hl(Nv),d=s&&(typeof Tv=="function"?(b=>w=>b.encode(w))(new Tv):async b=>new Uint8Array(await new n(b).arrayBuffer())),f=o&&c&&Av(()=>{let b=!1;const w=new n(Yt.origin,{body:new Nv,method:"POST",get duplex(){return b=!0,"half"}}).headers.has("Content-Type");return b&&!w}),p=a&&c&&Av(()=>H.isReadableStream(new r("").body)),g={stream:p&&(b=>b.body)};s&&["text","arrayBuffer","blob","formData","stream"].forEach(b=>{!g[b]&&(g[b]=(w,k)=>{let S=w&&w[b];if(S)return S.call(w);throw new qe(`Response type '${b}' is not supported`,qe.ERR_NOT_SUPPORT,k)})});const y=async b=>{if(b==null)return 0;if(H.isBlob(b))return b.size;if(H.isSpecCompliantForm(b))return(await new n(Yt.origin,{method:"POST",body:b}).arrayBuffer()).byteLength;if(H.isArrayBufferView(b)||H.isArrayBuffer(b))return b.byteLength;if(H.isURLSearchParams(b)&&(b=b+""),H.isString(b))return(await d(b)).byteLength},x=async(b,w)=>{const k=H.toFiniteNumber(b.getContentLength());return k??y(w)};return async b=>{let{url:w,method:k,data:S,signal:E,cancelToken:j,timeout:O,onDownloadProgress:N,onUploadProgress:T,responseType:I,headers:V,withCredentials:U="same-origin",fetchOptions:D}=gw(b),Z=t||fetch;I=I?(I+"").toLowerCase():"text";let Y=PA([E,j&&j.toAbortSignal()],O),he=null;const G=Y&&Y.unsubscribe&&(()=>{Y.unsubscribe()});let W;try{if(T&&f&&k!=="get"&&k!=="head"&&(W=await x(V,S))!==0){let M=new n(w,{method:"POST",body:S,duplex:"half"}),K;if(H.isFormData(S)&&(K=M.headers.get("content-type"))&&V.setContentType(K),M.body){const[P,te]=kv(W,xc(Sv(T)));S=Ev(M.body,Cv,P,te)}}H.isString(U)||(U=U?"include":"omit");const ne=o&&"credentials"in n.prototype,re={...D,signal:Y,method:k.toUpperCase(),headers:V.normalize().toJSON(),body:S,duplex:"half",credentials:ne?U:void 0};he=o&&new n(w,re);let J=await(o?Z(he,D):Z(w,re));const ce=p&&(I==="stream"||I==="response");if(p&&(N||ce&&G)){const M={};["status","statusText","headers"].forEach(me=>{M[me]=J[me]});const K=H.toFiniteNumber(J.headers.get("content-length")),[P,te]=N&&kv(K,xc(Sv(N),!0))||[];J=new r(Ev(J.body,Cv,P,()=>{te&&te(),G&&G()}),M)}I=I||"text";let A=await g[H.findKey(g,I)||"text"](J,b);return!ce&&G&&G(),await new Promise((M,K)=>{pw(M,K,{data:A,headers:vn.from(J.headers),status:J.status,statusText:J.statusText,config:b,request:he})})}catch(ne){throw G&&G(),ne&&ne.name==="TypeError"&&/Load failed|fetch/i.test(ne.message)?Object.assign(new qe("Network Error",qe.ERR_NETWORK,b,he),{cause:ne.cause||ne}):qe.from(ne,ne&&ne.code,b,he)}}},zA=new Map,yw=e=>{let t=e&&e.env||{};const{fetch:n,Request:r,Response:s}=t,o=[r,s,n];let a=o.length,c=a,d,f,p=zA;for(;c--;)d=o[c],f=p.get(d),f===void 0&&p.set(d,f=c?new Map:MA(t)),p=f;return f};yw();const Np={http:tA,xhr:RA,fetch:{get:yw}};H.forEach(Np,(e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch{}Object.defineProperty(e,"adapterName",{value:t})}});const Rv=e=>`- ${e}`,FA=e=>H.isFunction(e)||e===null||e===!1;function $A(e,t){e=H.isArray(e)?e:[e];const{length:n}=e;let r,s;const o={};for(let a=0;a<n;a++){r=e[a];let c;if(s=r,!FA(r)&&(s=Np[(c=String(r)).toLowerCase()],s===void 0))throw new qe(`Unknown adapter '${c}'`);if(s&&(H.isFunction(s)||(s=s.get(t))))break;o[c||"#"+a]=s}if(!s){const a=Object.entries(o).map(([d,f])=>`adapter ${d} `+(f===!1?"is not supported by the environment":"is not available in the build"));let c=n?a.length>1?`since :
|
|
19
|
+
`+a.map(Rv).join(`
|
|
20
|
+
`):" "+Rv(a[0]):"as no adapter specified";throw new qe("There is no suitable adapter to dispatch the request "+c,"ERR_NOT_SUPPORT")}return s}const xw={getAdapter:$A,adapters:Np};function ah(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Gi(null,e)}function Pv(e){return ah(e),e.headers=vn.from(e.headers),e.data=oh.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),xw.getAdapter(e.adapter||Na.adapter,e)(e).then(function(r){return ah(e),r.data=oh.call(e,e.transformResponse,r),r.headers=vn.from(r.headers),r},function(r){return fw(r)||(ah(e),r&&r.response&&(r.response.data=oh.call(e,e.transformResponse,r.response),r.response.headers=vn.from(r.response.headers))),Promise.reject(r)})}const vw="1.13.2",qc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{qc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});const Ov={};qc.transitional=function(t,n,r){function s(o,a){return"[Axios v"+vw+"] Transitional option '"+o+"'"+a+(r?". "+r:"")}return(o,a,c)=>{if(t===!1)throw new qe(s(a," has been removed"+(n?" in "+n:"")),qe.ERR_DEPRECATED);return n&&!Ov[a]&&(Ov[a]=!0,console.warn(s(a," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(o,a,c):!0}};qc.spelling=function(t){return(n,r)=>(console.warn(`${r} is likely a misspelling of ${t}`),!0)};function UA(e,t,n){if(typeof e!="object")throw new qe("options must be an object",qe.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let s=r.length;for(;s-- >0;){const o=r[s],a=t[o];if(a){const c=e[o],d=c===void 0||a(c,o,e);if(d!==!0)throw new qe("option "+o+" must be "+d,qe.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new qe("Unknown option "+o,qe.ERR_BAD_OPTION)}}const lc={assertOptions:UA,validators:qc},ir=lc.validators;let Ls=class{constructor(t){this.defaults=t||{},this.interceptors={request:new bv,response:new bv}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let s={};Error.captureStackTrace?Error.captureStackTrace(s):s=new Error;const o=s.stack?s.stack.replace(/^.+\n/,""):"";try{r.stack?o&&!String(r.stack).endsWith(o.replace(/^.+\n.+\n/,""))&&(r.stack+=`
|
|
21
|
+
`+o):r.stack=o}catch{}}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=Ms(this.defaults,n);const{transitional:r,paramsSerializer:s,headers:o}=n;r!==void 0&&lc.assertOptions(r,{silentJSONParsing:ir.transitional(ir.boolean),forcedJSONParsing:ir.transitional(ir.boolean),clarifyTimeoutError:ir.transitional(ir.boolean)},!1),s!=null&&(H.isFunction(s)?n.paramsSerializer={serialize:s}:lc.assertOptions(s,{encode:ir.function,serialize:ir.function},!0)),n.allowAbsoluteUrls!==void 0||(this.defaults.allowAbsoluteUrls!==void 0?n.allowAbsoluteUrls=this.defaults.allowAbsoluteUrls:n.allowAbsoluteUrls=!0),lc.assertOptions(n,{baseUrl:ir.spelling("baseURL"),withXsrfToken:ir.spelling("withXSRFToken")},!0),n.method=(n.method||this.defaults.method||"get").toLowerCase();let a=o&&H.merge(o.common,o[n.method]);o&&H.forEach(["delete","get","head","post","put","patch","common"],b=>{delete o[b]}),n.headers=vn.concat(a,o);const c=[];let d=!0;this.interceptors.request.forEach(function(w){typeof w.runWhen=="function"&&w.runWhen(n)===!1||(d=d&&w.synchronous,c.unshift(w.fulfilled,w.rejected))});const f=[];this.interceptors.response.forEach(function(w){f.push(w.fulfilled,w.rejected)});let p,g=0,y;if(!d){const b=[Pv.bind(this),void 0];for(b.unshift(...c),b.push(...f),y=b.length,p=Promise.resolve(n);g<y;)p=p.then(b[g++],b[g++]);return p}y=c.length;let x=n;for(;g<y;){const b=c[g++],w=c[g++];try{x=b(x)}catch(k){w.call(this,k);break}}try{p=Pv.call(this,x)}catch(b){return Promise.reject(b)}for(g=0,y=f.length;g<y;)p=p.then(f[g++],f[g++]);return p}getUri(t){t=Ms(this.defaults,t);const n=mw(t.baseURL,t.url,t.allowAbsoluteUrls);return uw(n,t.params,t.paramsSerializer)}};H.forEach(["delete","get","head","options"],function(t){Ls.prototype[t]=function(n,r){return this.request(Ms(r||{},{method:t,url:n,data:(r||{}).data}))}});H.forEach(["post","put","patch"],function(t){function n(r){return function(o,a,c){return this.request(Ms(c||{},{method:t,headers:r?{"Content-Type":"multipart/form-data"}:{},url:o,data:a}))}}Ls.prototype[t]=n(),Ls.prototype[t+"Form"]=n(!0)});let BA=class _w{constructor(t){if(typeof t!="function")throw new TypeError("executor must be a function.");let n;this.promise=new Promise(function(o){n=o});const r=this;this.promise.then(s=>{if(!r._listeners)return;let o=r._listeners.length;for(;o-- >0;)r._listeners[o](s);r._listeners=null}),this.promise.then=s=>{let o;const a=new Promise(c=>{r.subscribe(c),o=c}).then(s);return a.cancel=function(){r.unsubscribe(o)},a},t(function(o,a,c){r.reason||(r.reason=new Gi(o,a,c),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;const n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}toAbortSignal(){const t=new AbortController,n=r=>{t.abort(r)};return this.subscribe(n),t.signal.unsubscribe=()=>this.unsubscribe(n),t.signal}static source(){let t;return{token:new _w(function(s){t=s}),cancel:t}}};function VA(e){return function(n){return e.apply(null,n)}}function qA(e){return H.isObject(e)&&e.isAxiosError===!0}const pf={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511,WebServerIsDown:521,ConnectionTimedOut:522,OriginIsUnreachable:523,TimeoutOccurred:524,SslHandshakeFailed:525,InvalidSslCertificate:526};Object.entries(pf).forEach(([e,t])=>{pf[t]=e});function bw(e){const t=new Ls(e),n=Qb(Ls.prototype.request,t);return H.extend(n,Ls.prototype,t,{allOwnKeys:!0}),H.extend(n,t,null,{allOwnKeys:!0}),n.create=function(s){return bw(Ms(e,s))},n}const Ye=bw(Na);Ye.Axios=Ls;Ye.CanceledError=Gi;Ye.CancelToken=BA;Ye.isCancel=fw;Ye.VERSION=vw;Ye.toFormData=Vc;Ye.AxiosError=qe;Ye.Cancel=Ye.CanceledError;Ye.all=function(t){return Promise.all(t)};Ye.spread=VA;Ye.isAxiosError=qA;Ye.mergeConfig=Ms;Ye.AxiosHeaders=vn;Ye.formToJSON=e=>hw(H.isHTMLForm(e)?new FormData(e):e);Ye.getAdapter=xw.getAdapter;Ye.HttpStatusCode=pf;Ye.default=Ye;const{Axios:_$,AxiosError:b$,CanceledError:w$,isCancel:k$,CancelToken:S$,VERSION:j$,all:E$,Cancel:C$,isAxiosError:N$,spread:T$,toFormData:A$,AxiosHeaders:R$,HttpStatusCode:P$,formToJSON:O$,getAdapter:L$,mergeConfig:I$}=Ye,Ue=e=>typeof e=="string",zo=()=>{let e,t;const n=new Promise((r,s)=>{e=r,t=s});return n.resolve=e,n.reject=t,n},Lv=e=>e==null?"":""+e,HA=(e,t,n)=>{e.forEach(r=>{t[r]&&(n[r]=t[r])})},KA=/###/g,Iv=e=>e&&e.indexOf("###")>-1?e.replace(KA,"."):e,Dv=e=>!e||Ue(e),Qo=(e,t,n)=>{const r=Ue(t)?t.split("."):t;let s=0;for(;s<r.length-1;){if(Dv(e))return{};const o=Iv(r[s]);!e[o]&&n&&(e[o]=new n),Object.prototype.hasOwnProperty.call(e,o)?e=e[o]:e={},++s}return Dv(e)?{}:{obj:e,k:Iv(r[s])}},Mv=(e,t,n)=>{const{obj:r,k:s}=Qo(e,t,Object);if(r!==void 0||t.length===1){r[s]=n;return}let o=t[t.length-1],a=t.slice(0,t.length-1),c=Qo(e,a,Object);for(;c.obj===void 0&&a.length;)o=`${a[a.length-1]}.${o}`,a=a.slice(0,a.length-1),c=Qo(e,a,Object),c?.obj&&typeof c.obj[`${c.k}.${o}`]<"u"&&(c.obj=void 0);c.obj[`${c.k}.${o}`]=n},WA=(e,t,n,r)=>{const{obj:s,k:o}=Qo(e,t,Object);s[o]=s[o]||[],s[o].push(n)},vc=(e,t)=>{const{obj:n,k:r}=Qo(e,t);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},GA=(e,t,n)=>{const r=vc(e,n);return r!==void 0?r:vc(t,n)},ww=(e,t,n)=>{for(const r in t)r!=="__proto__"&&r!=="constructor"&&(r in e?Ue(e[r])||e[r]instanceof String||Ue(t[r])||t[r]instanceof String?n&&(e[r]=t[r]):ww(e[r],t[r],n):e[r]=t[r]);return e},hi=e=>e.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var JA={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const XA=e=>Ue(e)?e.replace(/[&<>"'\/]/g,t=>JA[t]):e;class YA{constructor(t){this.capacity=t,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(t){const n=this.regExpMap.get(t);if(n!==void 0)return n;const r=new RegExp(t);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(t,r),this.regExpQueue.push(t),r}}const QA=[" ",",","?","!",";"],ZA=new YA(20),eR=(e,t,n)=>{t=t||"",n=n||"";const r=QA.filter(a=>t.indexOf(a)<0&&n.indexOf(a)<0);if(r.length===0)return!0;const s=ZA.getRegExp(`(${r.map(a=>a==="?"?"\\?":a).join("|")})`);let o=!s.test(e);if(!o){const a=e.indexOf(n);a>0&&!s.test(e.substring(0,a))&&(o=!0)}return o},mf=(e,t,n=".")=>{if(!e)return;if(e[t])return Object.prototype.hasOwnProperty.call(e,t)?e[t]:void 0;const r=t.split(n);let s=e;for(let o=0;o<r.length;){if(!s||typeof s!="object")return;let a,c="";for(let d=o;d<r.length;++d)if(d!==o&&(c+=n),c+=r[d],a=s[c],a!==void 0){if(["string","number","boolean"].indexOf(typeof a)>-1&&d<r.length-1)continue;o+=d-o+1;break}s=a}return s},ha=e=>e?.replace("_","-"),tR={type:"logger",log(e){this.output("log",e)},warn(e){this.output("warn",e)},error(e){this.output("error",e)},output(e,t){console?.[e]?.apply?.(console,t)}};class _c{constructor(t,n={}){this.init(t,n)}init(t,n={}){this.prefix=n.prefix||"i18next:",this.logger=t||tR,this.options=n,this.debug=n.debug}log(...t){return this.forward(t,"log","",!0)}warn(...t){return this.forward(t,"warn","",!0)}error(...t){return this.forward(t,"error","")}deprecate(...t){return this.forward(t,"warn","WARNING DEPRECATED: ",!0)}forward(t,n,r,s){return s&&!this.debug?null:(Ue(t[0])&&(t[0]=`${r}${this.prefix} ${t[0]}`),this.logger[n](t))}create(t){return new _c(this.logger,{prefix:`${this.prefix}:${t}:`,...this.options})}clone(t){return t=t||this.options,t.prefix=t.prefix||this.prefix,new _c(this.logger,t)}}var lr=new _c;class Hc{constructor(){this.observers={}}on(t,n){return t.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(t,n){if(this.observers[t]){if(!n){delete this.observers[t];return}this.observers[t].delete(n)}}emit(t,...n){this.observers[t]&&Array.from(this.observers[t].entries()).forEach(([s,o])=>{for(let a=0;a<o;a++)s(...n)}),this.observers["*"]&&Array.from(this.observers["*"].entries()).forEach(([s,o])=>{for(let a=0;a<o;a++)s.apply(s,[t,...n])})}}class zv extends Hc{constructor(t,n={ns:["translation"],defaultNS:"translation"}){super(),this.data=t||{},this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.options.ignoreJSONStructure===void 0&&(this.options.ignoreJSONStructure=!0)}addNamespaces(t){this.options.ns.indexOf(t)<0&&this.options.ns.push(t)}removeNamespaces(t){const n=this.options.ns.indexOf(t);n>-1&&this.options.ns.splice(n,1)}getResource(t,n,r,s={}){const o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,a=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let c;t.indexOf(".")>-1?c=t.split("."):(c=[t,n],r&&(Array.isArray(r)?c.push(...r):Ue(r)&&o?c.push(...r.split(o)):c.push(r)));const d=vc(this.data,c);return!d&&!n&&!r&&t.indexOf(".")>-1&&(t=c[0],n=c[1],r=c.slice(2).join(".")),d||!a||!Ue(r)?d:mf(this.data?.[t]?.[n],r,o)}addResource(t,n,r,s,o={silent:!1}){const a=o.keySeparator!==void 0?o.keySeparator:this.options.keySeparator;let c=[t,n];r&&(c=c.concat(a?r.split(a):r)),t.indexOf(".")>-1&&(c=t.split("."),s=n,n=c[1]),this.addNamespaces(n),Mv(this.data,c,s),o.silent||this.emit("added",t,n,r,s)}addResources(t,n,r,s={silent:!1}){for(const o in r)(Ue(r[o])||Array.isArray(r[o]))&&this.addResource(t,n,o,r[o],{silent:!0});s.silent||this.emit("added",t,n,r)}addResourceBundle(t,n,r,s,o,a={silent:!1,skipCopy:!1}){let c=[t,n];t.indexOf(".")>-1&&(c=t.split("."),s=r,r=n,n=c[1]),this.addNamespaces(n);let d=vc(this.data,c)||{};a.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?ww(d,r,o):d={...d,...r},Mv(this.data,c,d),a.silent||this.emit("added",t,n,r)}removeResourceBundle(t,n){this.hasResourceBundle(t,n)&&delete this.data[t][n],this.removeNamespaces(n),this.emit("removed",t,n)}hasResourceBundle(t,n){return this.getResource(t,n)!==void 0}getResourceBundle(t,n){return n||(n=this.options.defaultNS),this.getResource(t,n)}getDataByLanguage(t){return this.data[t]}hasLanguageSomeTranslations(t){const n=this.getDataByLanguage(t);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var kw={processors:{},addPostProcessor(e){this.processors[e.name]=e},handle(e,t,n,r,s){return e.forEach(o=>{t=this.processors[o]?.process(t,n,r,s)??t}),t}};const Sw=Symbol("i18next/PATH_KEY");function nR(){const e=[],t=Object.create(null);let n;return t.get=(r,s)=>(n?.revoke?.(),s===Sw?e:(e.push(s),n=Proxy.revocable(r,t),n.proxy)),Proxy.revocable(Object.create(null),t).proxy}function gf(e,t){const{[Sw]:n}=e(nR());return n.join(t?.keySeparator??".")}const Fv={},lh=e=>!Ue(e)&&typeof e!="boolean"&&typeof e!="number";class bc extends Hc{constructor(t,n={}){super(),HA(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],t,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=lr.create("translator")}changeLanguage(t){t&&(this.language=t)}exists(t,n={interpolation:{}}){const r={...n};if(t==null)return!1;const s=this.resolve(t,r);if(s?.res===void 0)return!1;const o=lh(s.res);return!(r.returnObjects===!1&&o)}extractFromKey(t,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let o=n.ns||this.options.defaultNS||[];const a=r&&t.indexOf(r)>-1,c=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!eR(t,r,s);if(a&&!c){const d=t.match(this.interpolator.nestingRegexp);if(d&&d.length>0)return{key:t,namespaces:Ue(o)?[o]:o};const f=t.split(r);(r!==s||r===s&&this.options.ns.indexOf(f[0])>-1)&&(o=f.shift()),t=f.join(s)}return{key:t,namespaces:Ue(o)?[o]:o}}translate(t,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),t==null)return"";typeof t=="function"&&(t=gf(t,{...this.options,...s})),Array.isArray(t)||(t=[String(t)]);const o=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,a=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:c,namespaces:d}=this.extractFromKey(t[t.length-1],s),f=d[d.length-1];let p=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;p===void 0&&(p=":");const g=s.lng||this.language,y=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if(g?.toLowerCase()==="cimode")return y?o?{res:`${f}${p}${c}`,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:`${f}${p}${c}`:o?{res:c,usedKey:c,exactUsedKey:c,usedLng:g,usedNS:f,usedParams:this.getUsedParamsDetails(s)}:c;const x=this.resolve(t,s);let b=x?.res;const w=x?.usedKey||c,k=x?.exactUsedKey||c,S=["[object Number]","[object Function]","[object RegExp]"],E=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,j=!this.i18nFormat||this.i18nFormat.handleAsObject,O=s.count!==void 0&&!Ue(s.count),N=bc.hasDefaultValue(s),T=O?this.pluralResolver.getSuffix(g,s.count,s):"",I=s.ordinal&&O?this.pluralResolver.getSuffix(g,s.count,{ordinal:!1}):"",V=O&&!s.ordinal&&s.count===0,U=V&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${T}`]||s[`defaultValue${I}`]||s.defaultValue;let D=b;j&&!b&&N&&(D=U);const Z=lh(D),Y=Object.prototype.toString.apply(D);if(j&&D&&Z&&S.indexOf(Y)<0&&!(Ue(E)&&Array.isArray(D))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const he=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,D,{...s,ns:d}):`key '${c} (${this.language})' returned an object instead of string.`;return o?(x.res=he,x.usedParams=this.getUsedParamsDetails(s),x):he}if(a){const he=Array.isArray(D),G=he?[]:{},W=he?k:w;for(const ne in D)if(Object.prototype.hasOwnProperty.call(D,ne)){const re=`${W}${a}${ne}`;N&&!b?G[ne]=this.translate(re,{...s,defaultValue:lh(U)?U[ne]:void 0,joinArrays:!1,ns:d}):G[ne]=this.translate(re,{...s,joinArrays:!1,ns:d}),G[ne]===re&&(G[ne]=D[ne])}b=G}}else if(j&&Ue(E)&&Array.isArray(b))b=b.join(E),b&&(b=this.extendTranslation(b,t,s,r));else{let he=!1,G=!1;!this.isValidLookup(b)&&N&&(he=!0,b=U),this.isValidLookup(b)||(G=!0,b=c);const ne=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&G?void 0:b,re=N&&U!==b&&this.options.updateMissing;if(G||he||re){if(this.logger.log(re?"updateKey":"missingKey",g,f,c,re?U:b),a){const M=this.resolve(c,{...s,keySeparator:!1});M&&M.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let J=[];const ce=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&ce&&ce[0])for(let M=0;M<ce.length;M++)J.push(ce[M]);else this.options.saveMissingTo==="all"?J=this.languageUtils.toResolveHierarchy(s.lng||this.language):J.push(s.lng||this.language);const A=(M,K,P)=>{const te=N&&P!==b?P:ne;this.options.missingKeyHandler?this.options.missingKeyHandler(M,f,K,te,re,s):this.backendConnector?.saveMissing&&this.backendConnector.saveMissing(M,f,K,te,re,s),this.emit("missingKey",M,f,K,b)};this.options.saveMissing&&(this.options.saveMissingPlurals&&O?J.forEach(M=>{const K=this.pluralResolver.getSuffixes(M,s);V&&s[`defaultValue${this.options.pluralSeparator}zero`]&&K.indexOf(`${this.options.pluralSeparator}zero`)<0&&K.push(`${this.options.pluralSeparator}zero`),K.forEach(P=>{A([M],c+P,s[`defaultValue${P}`]||U)})}):A(J,c,U))}b=this.extendTranslation(b,t,s,x,r),G&&b===c&&this.options.appendNamespaceToMissingKey&&(b=`${f}${p}${c}`),(G||he)&&this.options.parseMissingKeyHandler&&(b=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${f}${p}${c}`:c,he?b:void 0,s))}return o?(x.res=b,x.usedParams=this.getUsedParamsDetails(s),x):b}extendTranslation(t,n,r,s,o){if(this.i18nFormat?.parse)t=this.i18nFormat.parse(t,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=Ue(t)&&(r?.interpolation?.skipOnVariables!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let f;if(d){const g=t.match(this.interpolator.nestingRegexp);f=g&&g.length}let p=r.replace&&!Ue(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(p={...this.options.interpolation.defaultVariables,...p}),t=this.interpolator.interpolate(t,p,r.lng||this.language||s.usedLng,r),d){const g=t.match(this.interpolator.nestingRegexp),y=g&&g.length;f<y&&(r.nest=!1)}!r.lng&&s&&s.res&&(r.lng=this.language||s.usedLng),r.nest!==!1&&(t=this.interpolator.nest(t,(...g)=>o?.[0]===g[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${g[0]} in key: ${n[0]}`),null):this.translate(...g,n),r)),r.interpolation&&this.interpolator.reset()}const a=r.postProcess||this.options.postProcess,c=Ue(a)?[a]:a;return t!=null&&c?.length&&r.applyPostProcessor!==!1&&(t=kw.handle(c,t,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),t}resolve(t,n={}){let r,s,o,a,c;return Ue(t)&&(t=[t]),t.forEach(d=>{if(this.isValidLookup(r))return;const f=this.extractFromKey(d,n),p=f.key;s=p;let g=f.namespaces;this.options.fallbackNS&&(g=g.concat(this.options.fallbackNS));const y=n.count!==void 0&&!Ue(n.count),x=y&&!n.ordinal&&n.count===0,b=n.context!==void 0&&(Ue(n.context)||typeof n.context=="number")&&n.context!=="",w=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);g.forEach(k=>{this.isValidLookup(r)||(c=k,!Fv[`${w[0]}-${k}`]&&this.utils?.hasLoadedNamespace&&!this.utils?.hasLoadedNamespace(c)&&(Fv[`${w[0]}-${k}`]=!0,this.logger.warn(`key "${s}" for languages "${w.join(", ")}" won't get resolved as namespace "${c}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(S=>{if(this.isValidLookup(r))return;a=S;const E=[p];if(this.i18nFormat?.addLookupKeys)this.i18nFormat.addLookupKeys(E,p,S,k,n);else{let O;y&&(O=this.pluralResolver.getSuffix(S,n.count,n));const N=`${this.options.pluralSeparator}zero`,T=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(y&&(n.ordinal&&O.indexOf(T)===0&&E.push(p+O.replace(T,this.options.pluralSeparator)),E.push(p+O),x&&E.push(p+N)),b){const I=`${p}${this.options.contextSeparator||"_"}${n.context}`;E.push(I),y&&(n.ordinal&&O.indexOf(T)===0&&E.push(I+O.replace(T,this.options.pluralSeparator)),E.push(I+O),x&&E.push(I+N))}}let j;for(;j=E.pop();)this.isValidLookup(r)||(o=j,r=this.getResource(S,k,j,n))}))})}),{res:r,usedKey:s,exactUsedKey:o,usedLng:a,usedNS:c}}isValidLookup(t){return t!==void 0&&!(!this.options.returnNull&&t===null)&&!(!this.options.returnEmptyString&&t==="")}getResource(t,n,r,s={}){return this.i18nFormat?.getResource?this.i18nFormat.getResource(t,n,r,s):this.resourceStore.getResource(t,n,r,s)}getUsedParamsDetails(t={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=t.replace&&!Ue(t.replace);let s=r?t.replace:t;if(r&&typeof t.count<"u"&&(s.count=t.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const o of n)delete s[o]}return s}static hasDefaultValue(t){const n="defaultValue";for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&n===r.substring(0,n.length)&&t[r]!==void 0)return!0;return!1}}class $v{constructor(t){this.options=t,this.supportedLngs=this.options.supportedLngs||!1,this.logger=lr.create("languageUtils")}getScriptPartFromCode(t){if(t=ha(t),!t||t.indexOf("-")<0)return null;const n=t.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(t){if(t=ha(t),!t||t.indexOf("-")<0)return t;const n=t.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(t){if(Ue(t)&&t.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(t)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?t.toLowerCase():t)}return this.options.cleanCode||this.options.lowerCaseLng?t.toLowerCase():t}isSupportedCode(t){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(t=this.getLanguagePartFromCode(t)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(t)>-1}getBestMatchFromCodes(t){if(!t)return null;let n;return t.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&t.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const o=this.getLanguagePartFromCode(r);if(this.isSupportedCode(o))return n=o;n=this.options.supportedLngs.find(a=>{if(a===o)return a;if(!(a.indexOf("-")<0&&o.indexOf("-")<0)&&(a.indexOf("-")>0&&o.indexOf("-")<0&&a.substring(0,a.indexOf("-"))===o||a.indexOf(o)===0&&o.length>1))return a})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(t,n){if(!t)return[];if(typeof t=="function"&&(t=t(n)),Ue(t)&&(t=[t]),Array.isArray(t))return t;if(!n)return t.default||[];let r=t[n];return r||(r=t[this.getScriptPartFromCode(n)]),r||(r=t[this.formatLanguageCode(n)]),r||(r=t[this.getLanguagePartFromCode(n)]),r||(r=t.default),r||[]}toResolveHierarchy(t,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],t),s=[],o=a=>{a&&(this.isSupportedCode(a)?s.push(a):this.logger.warn(`rejecting language code not found in supportedLngs: ${a}`))};return Ue(t)&&(t.indexOf("-")>-1||t.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&o(this.formatLanguageCode(t)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&o(this.getScriptPartFromCode(t)),this.options.load!=="currentOnly"&&o(this.getLanguagePartFromCode(t))):Ue(t)&&o(this.formatLanguageCode(t)),r.forEach(a=>{s.indexOf(a)<0&&o(this.formatLanguageCode(a))}),s}}const Uv={zero:0,one:1,two:2,few:3,many:4,other:5},Bv={select:e=>e===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class rR{constructor(t,n={}){this.languageUtils=t,this.options=n,this.logger=lr.create("pluralResolver"),this.pluralRulesCache={}}clearCache(){this.pluralRulesCache={}}getRule(t,n={}){const r=ha(t==="dev"?"en":t),s=n.ordinal?"ordinal":"cardinal",o=JSON.stringify({cleanedCode:r,type:s});if(o in this.pluralRulesCache)return this.pluralRulesCache[o];let a;try{a=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Bv;if(!t.match(/-|_/))return Bv;const d=this.languageUtils.getLanguagePartFromCode(t);a=this.getRule(d,n)}return this.pluralRulesCache[o]=a,a}needsPlural(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?.resolvedOptions().pluralCategories.length>1}getPluralFormsOfKey(t,n,r={}){return this.getSuffixes(t,r).map(s=>`${n}${s}`)}getSuffixes(t,n={}){let r=this.getRule(t,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,o)=>Uv[s]-Uv[o]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(t,n,r={}){const s=this.getRule(t,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${t}`),this.getSuffix("dev",n,r))}}const Vv=(e,t,n,r=".",s=!0)=>{let o=GA(e,t,n);return!o&&s&&Ue(n)&&(o=mf(e,n,r),o===void 0&&(o=mf(t,n,r))),o},ch=e=>e.replace(/\$/g,"$$$$");class qv{constructor(t={}){this.logger=lr.create("interpolator"),this.options=t,this.format=t?.interpolation?.format||(n=>n),this.init(t)}init(t={}){t.interpolation||(t.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:o,prefixEscaped:a,suffix:c,suffixEscaped:d,formatSeparator:f,unescapeSuffix:p,unescapePrefix:g,nestingPrefix:y,nestingPrefixEscaped:x,nestingSuffix:b,nestingSuffixEscaped:w,nestingOptionsSeparator:k,maxReplaces:S,alwaysFormat:E}=t.interpolation;this.escape=n!==void 0?n:XA,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=o?hi(o):a||"{{",this.suffix=c?hi(c):d||"}}",this.formatSeparator=f||",",this.unescapePrefix=p?"":g||"-",this.unescapeSuffix=this.unescapePrefix?"":p||"",this.nestingPrefix=y?hi(y):x||hi("$t("),this.nestingSuffix=b?hi(b):w||hi(")"),this.nestingOptionsSeparator=k||",",this.maxReplaces=S||1e3,this.alwaysFormat=E!==void 0?E:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const t=(n,r)=>n?.source===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=t(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=t(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=t(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(t,n,r,s){let o,a,c;const d=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},f=x=>{if(x.indexOf(this.formatSeparator)<0){const S=Vv(n,d,x,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(S,void 0,r,{...s,...n,interpolationkey:x}):S}const b=x.split(this.formatSeparator),w=b.shift().trim(),k=b.join(this.formatSeparator).trim();return this.format(Vv(n,d,w,this.options.keySeparator,this.options.ignoreJSONStructure),k,r,{...s,...n,interpolationkey:w})};this.resetRegExp();const p=s?.missingInterpolationHandler||this.options.missingInterpolationHandler,g=s?.interpolation?.skipOnVariables!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:x=>ch(x)},{regex:this.regexp,safeValue:x=>this.escapeValue?ch(this.escape(x)):ch(x)}].forEach(x=>{for(c=0;o=x.regex.exec(t);){const b=o[1].trim();if(a=f(b),a===void 0)if(typeof p=="function"){const k=p(t,o,s);a=Ue(k)?k:""}else if(s&&Object.prototype.hasOwnProperty.call(s,b))a="";else if(g){a=o[0];continue}else this.logger.warn(`missed to pass in variable ${b} for interpolating ${t}`),a="";else!Ue(a)&&!this.useRawValueToEscape&&(a=Lv(a));const w=x.safeValue(a);if(t=t.replace(o[0],w),g?(x.regex.lastIndex+=a.length,x.regex.lastIndex-=o[0].length):x.regex.lastIndex=0,c++,c>=this.maxReplaces)break}}),t}nest(t,n,r={}){let s,o,a;const c=(d,f)=>{const p=this.nestingOptionsSeparator;if(d.indexOf(p)<0)return d;const g=d.split(new RegExp(`${p}[ ]*{`));let y=`{${g[1]}`;d=g[0],y=this.interpolate(y,a);const x=y.match(/'/g),b=y.match(/"/g);((x?.length??0)%2===0&&!b||b.length%2!==0)&&(y=y.replace(/'/g,'"'));try{a=JSON.parse(y),f&&(a={...f,...a})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${d}`,w),`${d}${p}${y}`}return a.defaultValue&&a.defaultValue.indexOf(this.prefix)>-1&&delete a.defaultValue,d};for(;s=this.nestingRegexp.exec(t);){let d=[];a={...r},a=a.replace&&!Ue(a.replace)?a.replace:a,a.applyPostProcessor=!1,delete a.defaultValue;const f=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(f!==-1&&(d=s[1].slice(f).split(this.formatSeparator).map(p=>p.trim()).filter(Boolean),s[1]=s[1].slice(0,f)),o=n(c.call(this,s[1].trim(),a),a),o&&s[0]===t&&!Ue(o))return o;Ue(o)||(o=Lv(o)),o||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${t}`),o=""),d.length&&(o=d.reduce((p,g)=>this.format(p,g,r.lng,{...r,interpolationkey:s[1].trim()}),o.trim())),t=t.replace(s[0],o),this.regexp.lastIndex=0}return t}}const sR=e=>{let t=e.toLowerCase().trim();const n={};if(e.indexOf("(")>-1){const r=e.split("(");t=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);t==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):t==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(a=>{if(a){const[c,...d]=a.split(":"),f=d.join(":").trim().replace(/^'+|'+$/g,""),p=c.trim();n[p]||(n[p]=f),f==="false"&&(n[p]=!1),f==="true"&&(n[p]=!0),isNaN(f)||(n[p]=parseInt(f,10))}})}return{formatName:t,formatOptions:n}},Hv=e=>{const t={};return(n,r,s)=>{let o=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(o={...o,[s.interpolationkey]:void 0});const a=r+JSON.stringify(o);let c=t[a];return c||(c=e(ha(r),s),t[a]=c),c(n)}},iR=e=>(t,n,r)=>e(ha(n),r)(t);class oR{constructor(t={}){this.logger=lr.create("formatter"),this.options=t,this.init(t)}init(t,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?Hv:iR;this.formats={number:r((s,o)=>{const a=new Intl.NumberFormat(s,{...o});return c=>a.format(c)}),currency:r((s,o)=>{const a=new Intl.NumberFormat(s,{...o,style:"currency"});return c=>a.format(c)}),datetime:r((s,o)=>{const a=new Intl.DateTimeFormat(s,{...o});return c=>a.format(c)}),relativetime:r((s,o)=>{const a=new Intl.RelativeTimeFormat(s,{...o});return c=>a.format(c,o.range||"day")}),list:r((s,o)=>{const a=new Intl.ListFormat(s,{...o});return c=>a.format(c)})}}add(t,n){this.formats[t.toLowerCase().trim()]=n}addCached(t,n){this.formats[t.toLowerCase().trim()]=Hv(n)}format(t,n,r,s={}){const o=n.split(this.formatSeparator);if(o.length>1&&o[0].indexOf("(")>1&&o[0].indexOf(")")<0&&o.find(c=>c.indexOf(")")>-1)){const c=o.findIndex(d=>d.indexOf(")")>-1);o[0]=[o[0],...o.splice(1,c)].join(this.formatSeparator)}return o.reduce((c,d)=>{const{formatName:f,formatOptions:p}=sR(d);if(this.formats[f]){let g=c;try{const y=s?.formatParams?.[s.interpolationkey]||{},x=y.locale||y.lng||s.locale||s.lng||r;g=this.formats[f](c,x,{...p,...s,...y})}catch(y){this.logger.warn(y)}return g}else this.logger.warn(`there was no format function for ${f}`);return c},t)}}const aR=(e,t)=>{e.pending[t]!==void 0&&(delete e.pending[t],e.pendingCount--)};class lR extends Hc{constructor(t,n,r,s={}){super(),this.backend=t,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=lr.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],this.backend?.init?.(r,s.backend,s)}queueLoad(t,n,r,s){const o={},a={},c={},d={};return t.forEach(f=>{let p=!0;n.forEach(g=>{const y=`${f}|${g}`;!r.reload&&this.store.hasResourceBundle(f,g)?this.state[y]=2:this.state[y]<0||(this.state[y]===1?a[y]===void 0&&(a[y]=!0):(this.state[y]=1,p=!1,a[y]===void 0&&(a[y]=!0),o[y]===void 0&&(o[y]=!0),d[g]===void 0&&(d[g]=!0)))}),p||(c[f]=!0)}),(Object.keys(o).length||Object.keys(a).length)&&this.queue.push({pending:a,pendingCount:Object.keys(a).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(o),pending:Object.keys(a),toLoadLanguages:Object.keys(c),toLoadNamespaces:Object.keys(d)}}loaded(t,n,r){const s=t.split("|"),o=s[0],a=s[1];n&&this.emit("failedLoading",o,a,n),!n&&r&&this.store.addResourceBundle(o,a,r,void 0,void 0,{skipCopy:!0}),this.state[t]=n?-1:2,n&&r&&(this.state[t]=0);const c={};this.queue.forEach(d=>{WA(d.loaded,[o],a),aR(d,t),n&&d.errors.push(n),d.pendingCount===0&&!d.done&&(Object.keys(d.loaded).forEach(f=>{c[f]||(c[f]={});const p=d.loaded[f];p.length&&p.forEach(g=>{c[f][g]===void 0&&(c[f][g]=!0)})}),d.done=!0,d.errors.length?d.callback(d.errors):d.callback())}),this.emit("loaded",c),this.queue=this.queue.filter(d=>!d.done)}read(t,n,r,s=0,o=this.retryTimeout,a){if(!t.length)return a(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:t,ns:n,fcName:r,tried:s,wait:o,callback:a});return}this.readingCalls++;const c=(f,p)=>{if(this.readingCalls--,this.waitingReads.length>0){const g=this.waitingReads.shift();this.read(g.lng,g.ns,g.fcName,g.tried,g.wait,g.callback)}if(f&&p&&s<this.maxRetries){setTimeout(()=>{this.read.call(this,t,n,r,s+1,o*2,a)},o);return}a(f,p)},d=this.backend[r].bind(this.backend);if(d.length===2){try{const f=d(t,n);f&&typeof f.then=="function"?f.then(p=>c(null,p)).catch(c):c(null,f)}catch(f){c(f)}return}return d(t,n,c)}prepareLoading(t,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();Ue(t)&&(t=this.languageUtils.toResolveHierarchy(t)),Ue(n)&&(n=[n]);const o=this.queueLoad(t,n,r,s);if(!o.toLoad.length)return o.pending.length||s(),null;o.toLoad.forEach(a=>{this.loadOne(a)})}load(t,n,r){this.prepareLoading(t,n,{},r)}reload(t,n,r){this.prepareLoading(t,n,{reload:!0},r)}loadOne(t,n=""){const r=t.split("|"),s=r[0],o=r[1];this.read(s,o,"read",void 0,void 0,(a,c)=>{a&&this.logger.warn(`${n}loading namespace ${o} for language ${s} failed`,a),!a&&c&&this.logger.log(`${n}loaded namespace ${o} for language ${s}`,c),this.loaded(t,a,c)})}saveMissing(t,n,r,s,o,a={},c=()=>{}){if(this.services?.utils?.hasLoadedNamespace&&!this.services?.utils?.hasLoadedNamespace(n)){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if(this.backend?.create){const d={...a,isUpdate:o},f=this.backend.create.bind(this.backend);if(f.length<6)try{let p;f.length===5?p=f(t,n,r,s,d):p=f(t,n,r,s),p&&typeof p.then=="function"?p.then(g=>c(null,g)).catch(c):c(null,p)}catch(p){c(p)}else f(t,n,r,s,c,d)}!t||!t[0]||this.store.addResource(t[0],n,r,s)}}}const uh=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:e=>{let t={};if(typeof e[1]=="object"&&(t=e[1]),Ue(e[1])&&(t.defaultValue=e[1]),Ue(e[2])&&(t.tDescription=e[2]),typeof e[2]=="object"||typeof e[3]=="object"){const n=e[3]||e[2];Object.keys(n).forEach(r=>{t[r]=n[r]})}return t},interpolation:{escapeValue:!0,format:e=>e,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),Kv=e=>(Ue(e.ns)&&(e.ns=[e.ns]),Ue(e.fallbackLng)&&(e.fallbackLng=[e.fallbackLng]),Ue(e.fallbackNS)&&(e.fallbackNS=[e.fallbackNS]),e.supportedLngs?.indexOf?.("cimode")<0&&(e.supportedLngs=e.supportedLngs.concat(["cimode"])),typeof e.initImmediate=="boolean"&&(e.initAsync=e.initImmediate),e),Kl=()=>{},cR=e=>{Object.getOwnPropertyNames(Object.getPrototypeOf(e)).forEach(n=>{typeof e[n]=="function"&&(e[n]=e[n].bind(e))})};class Zo extends Hc{constructor(t={},n){if(super(),this.options=Kv(t),this.services={},this.logger=lr,this.modules={external:[]},cR(this),n&&!this.isInitialized&&!t.isClone){if(!this.options.initAsync)return this.init(t,n),this;setTimeout(()=>{this.init(t,n)},0)}}init(t={},n){this.isInitializing=!0,typeof t=="function"&&(n=t,t={}),t.defaultNS==null&&t.ns&&(Ue(t.ns)?t.defaultNS=t.ns:t.ns.indexOf("translation")<0&&(t.defaultNS=t.ns[0]));const r=uh();this.options={...r,...this.options,...Kv(t)},this.options.interpolation={...r.interpolation,...this.options.interpolation},t.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=t.keySeparator),t.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=t.nsSeparator),typeof this.options.overloadTranslationOptionHandler!="function"&&(this.options.overloadTranslationOptionHandler=r.overloadTranslationOptionHandler),this.options.debug===!0&&typeof console<"u"&&console.warn("i18next is maintained with support from locize.com — consider powering your project with managed localization (AI, CDN, integrations): https://locize.com");const s=f=>f?typeof f=="function"?new f:f:null;if(!this.options.isClone){this.modules.logger?lr.init(s(this.modules.logger),this.options):lr.init(null,this.options);let f;this.modules.formatter?f=this.modules.formatter:f=oR;const p=new $v(this.options);this.store=new zv(this.options.resources,this.options);const g=this.services;g.logger=lr,g.resourceStore=this.store,g.languageUtils=p,g.pluralResolver=new rR(p,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),f&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(g.formatter=s(f),g.formatter.init&&g.formatter.init(g,this.options),this.options.interpolation.format=g.formatter.format.bind(g.formatter)),g.interpolator=new qv(this.options),g.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},g.backendConnector=new lR(s(this.modules.backend),g.resourceStore,g,this.options),g.backendConnector.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.languageDetector&&(g.languageDetector=s(this.modules.languageDetector),g.languageDetector.init&&g.languageDetector.init(g,this.options.detection,this.options)),this.modules.i18nFormat&&(g.i18nFormat=s(this.modules.i18nFormat),g.i18nFormat.init&&g.i18nFormat.init(this)),this.translator=new bc(this.services,this.options),this.translator.on("*",(x,...b)=>{this.emit(x,...b)}),this.modules.external.forEach(x=>{x.init&&x.init(this)})}if(this.format=this.options.interpolation.format,n||(n=Kl),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const f=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);f.length>0&&f[0]!=="dev"&&(this.options.lng=f[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(f=>{this[f]=(...p)=>this.store[f](...p)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(f=>{this[f]=(...p)=>(this.store[f](...p),this)});const c=zo(),d=()=>{const f=(p,g)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),c.resolve(g),n(p,g)};if(this.languages&&!this.isInitialized)return f(null,this.t.bind(this));this.changeLanguage(this.options.lng,f)};return this.options.resources||!this.options.initAsync?d():setTimeout(d,0),c}loadResources(t,n=Kl){let r=n;const s=Ue(t)?t:this.language;if(typeof t=="function"&&(r=t),!this.options.resources||this.options.partialBundledLanguages){if(s?.toLowerCase()==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const o=[],a=c=>{if(!c||c==="cimode")return;this.services.languageUtils.toResolveHierarchy(c).forEach(f=>{f!=="cimode"&&o.indexOf(f)<0&&o.push(f)})};s?a(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>a(d)),this.options.preload?.forEach?.(c=>a(c)),this.services.backendConnector.load(o,this.options.ns,c=>{!c&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(c)})}else r(null)}reloadResources(t,n,r){const s=zo();return typeof t=="function"&&(r=t,t=void 0),typeof n=="function"&&(r=n,n=void 0),t||(t=this.languages),n||(n=this.options.ns),r||(r=Kl),this.services.backendConnector.reload(t,n,o=>{s.resolve(),r(o)}),s}use(t){if(!t)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!t.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return t.type==="backend"&&(this.modules.backend=t),(t.type==="logger"||t.log&&t.warn&&t.error)&&(this.modules.logger=t),t.type==="languageDetector"&&(this.modules.languageDetector=t),t.type==="i18nFormat"&&(this.modules.i18nFormat=t),t.type==="postProcessor"&&kw.addPostProcessor(t),t.type==="formatter"&&(this.modules.formatter=t),t.type==="3rdParty"&&this.modules.external.push(t),this}setResolvedLanguage(t){if(!(!t||!this.languages)&&!(["cimode","dev"].indexOf(t)>-1)){for(let n=0;n<this.languages.length;n++){const r=this.languages[n];if(!(["cimode","dev"].indexOf(r)>-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(t)<0&&this.store.hasLanguageSomeTranslations(t)&&(this.resolvedLanguage=t,this.languages.unshift(t))}}changeLanguage(t,n){this.isLanguageChangingTo=t;const r=zo();this.emit("languageChanging",t);const s=c=>{this.language=c,this.languages=this.services.languageUtils.toResolveHierarchy(c),this.resolvedLanguage=void 0,this.setResolvedLanguage(c)},o=(c,d)=>{d?this.isLanguageChangingTo===t&&(s(d),this.translator.changeLanguage(d),this.isLanguageChangingTo=void 0,this.emit("languageChanged",d),this.logger.log("languageChanged",d)):this.isLanguageChangingTo=void 0,r.resolve((...f)=>this.t(...f)),n&&n(c,(...f)=>this.t(...f))},a=c=>{!t&&!c&&this.services.languageDetector&&(c=[]);const d=Ue(c)?c:c&&c[0],f=this.store.hasLanguageSomeTranslations(d)?d:this.services.languageUtils.getBestMatchFromCodes(Ue(c)?[c]:c);f&&(this.language||s(f),this.translator.language||this.translator.changeLanguage(f),this.services.languageDetector?.cacheUserLanguage?.(f)),this.loadResources(f,p=>{o(p,f)})};return!t&&this.services.languageDetector&&!this.services.languageDetector.async?a(this.services.languageDetector.detect()):!t&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(a):this.services.languageDetector.detect(a):a(t),r}getFixedT(t,n,r){const s=(o,a,...c)=>{let d;typeof a!="object"?d=this.options.overloadTranslationOptionHandler([o,a].concat(c)):d={...a},d.lng=d.lng||s.lng,d.lngs=d.lngs||s.lngs,d.ns=d.ns||s.ns,d.keyPrefix!==""&&(d.keyPrefix=d.keyPrefix||r||s.keyPrefix);const f=this.options.keySeparator||".";let p;return d.keyPrefix&&Array.isArray(o)?p=o.map(g=>(typeof g=="function"&&(g=gf(g,{...this.options,...a})),`${d.keyPrefix}${f}${g}`)):(typeof o=="function"&&(o=gf(o,{...this.options,...a})),p=d.keyPrefix?`${d.keyPrefix}${f}${o}`:o),this.t(p,d)};return Ue(t)?s.lng=t:s.lngs=t,s.ns=n,s.keyPrefix=r,s}t(...t){return this.translator?.translate(...t)}exists(...t){return this.translator?.exists(...t)}setDefaultNamespace(t){this.options.defaultNS=t}hasLoadedNamespace(t,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,o=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const a=(c,d)=>{const f=this.services.backendConnector.state[`${c}|${d}`];return f===-1||f===0||f===2};if(n.precheck){const c=n.precheck(this,a);if(c!==void 0)return c}return!!(this.hasResourceBundle(r,t)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||a(r,t)&&(!s||a(o,t)))}loadNamespaces(t,n){const r=zo();return this.options.ns?(Ue(t)&&(t=[t]),t.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(t,n){const r=zo();Ue(t)&&(t=[t]);const s=this.options.preload||[],o=t.filter(a=>s.indexOf(a)<0&&this.services.languageUtils.isSupportedCode(a));return o.length?(this.options.preload=s.concat(o),this.loadResources(a=>{r.resolve(),n&&n(a)}),r):(n&&n(),Promise.resolve())}dir(t){if(t||(t=this.resolvedLanguage||(this.languages?.length>0?this.languages[0]:this.language)),!t)return"rtl";try{const s=new Intl.Locale(t);if(s&&s.getTextInfo){const o=s.getTextInfo();if(o&&o.direction)return o.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=this.services?.languageUtils||new $v(uh());return t.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(t))>-1||t.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(t={},n){const r=new Zo(t,n);return r.createInstance=Zo.createInstance,r}cloneInstance(t={},n=Kl){const r=t.forkResourceStore;r&&delete t.forkResourceStore;const s={...this.options,...t,isClone:!0},o=new Zo(s);if((t.debug!==void 0||t.prefix!==void 0)&&(o.logger=o.logger.clone(t)),["store","services","language"].forEach(c=>{o[c]=this[c]}),o.services={...this.services},o.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},r){const c=Object.keys(this.store.data).reduce((d,f)=>(d[f]={...this.store.data[f]},d[f]=Object.keys(d[f]).reduce((p,g)=>(p[g]={...d[f][g]},p),d[f]),d),{});o.store=new zv(c,s),o.services.resourceStore=o.store}if(t.interpolation){const d={...uh().interpolation,...this.options.interpolation,...t.interpolation},f={...s,interpolation:d};o.services.interpolator=new qv(f)}return o.translator=new bc(o.services,s),o.translator.on("*",(c,...d)=>{o.emit(c,...d)}),o.init(s,n),o.translator.options=s,o.translator.backendConnector.services.utils={hasLoadedNamespace:o.hasLoadedNamespace.bind(o)},o}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const ln=Zo.createInstance();ln.createInstance;ln.dir;ln.init;ln.loadResources;ln.reloadResources;ln.use;ln.changeLanguage;ln.getFixedT;ln.t;ln.exists;ln.setDefaultNamespace;ln.hasLoadedNamespace;ln.loadNamespaces;ln.loadLanguages;const uR=(e,t,n,r)=>{const s=[n,{code:t,...r||{}}];if(e?.services?.logger?.forward)return e.services.logger.forward(s,"warn","react-i18next::",!0);zs(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),e?.services?.logger?.warn?e.services.logger.warn(...s):console?.warn&&console.warn(...s)},Wv={},jw=(e,t,n,r)=>{zs(n)&&Wv[n]||(zs(n)&&(Wv[n]=new Date),uR(e,t,n,r))},Ew=(e,t)=>()=>{if(e.isInitialized)t();else{const n=()=>{setTimeout(()=>{e.off("initialized",n)},0),t()};e.on("initialized",n)}},yf=(e,t,n)=>{e.loadNamespaces(t,Ew(e,n))},Gv=(e,t,n,r)=>{if(zs(n)&&(n=[n]),e.options.preload&&e.options.preload.indexOf(t)>-1)return yf(e,n,r);n.forEach(s=>{e.options.ns.indexOf(s)<0&&e.options.ns.push(s)}),e.loadLanguages(t,Ew(e,r))},dR=(e,t,n={})=>!t.languages||!t.languages.length?(jw(t,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:t.languages}),!0):t.hasLoadedNamespace(e,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,e))return!1}}),zs=e=>typeof e=="string",hR=e=>typeof e=="object"&&e!==null,fR=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,pR={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},mR=e=>pR[e],gR=e=>e.replace(fR,mR);let xf={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:gR,transDefaultProps:void 0};const yR=(e={})=>{xf={...xf,...e}},xR=()=>xf;let Cw;const vR=e=>{Cw=e},_R=()=>Cw,bR={type:"3rdParty",init(e){yR(e.options.react),vR(e)}},wR=R.createContext();class kR{constructor(){this.usedNamespaces={}}addUsedNamespaces(t){t.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}var dh={exports:{}},hh={};var Jv;function SR(){if(Jv)return hh;Jv=1;var e=Rc();function t(g,y){return g===y&&(g!==0||1/g===1/y)||g!==g&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,s=e.useEffect,o=e.useLayoutEffect,a=e.useDebugValue;function c(g,y){var x=y(),b=r({inst:{value:x,getSnapshot:y}}),w=b[0].inst,k=b[1];return o(function(){w.value=x,w.getSnapshot=y,d(w)&&k({inst:w})},[g,x,y]),s(function(){return d(w)&&k({inst:w}),g(function(){d(w)&&k({inst:w})})},[g]),a(x),x}function d(g){var y=g.getSnapshot;g=g.value;try{var x=y();return!n(g,x)}catch{return!0}}function f(g,y){return y()}var p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?f:c;return hh.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:p,hh}var Xv;function jR(){return Xv||(Xv=1,dh.exports=SR()),dh.exports}var ER=jR();const CR=(e,t)=>zs(t)?t:hR(t)&&zs(t.defaultValue)?t.defaultValue:Array.isArray(e)?e[e.length-1]:e,NR={t:CR,ready:!1},TR=()=>()=>{},Ze=(e,t={})=>{const{i18n:n}=t,{i18n:r,defaultNS:s}=R.useContext(wR)||{},o=n||r||_R();o&&!o.reportNamespaces&&(o.reportNamespaces=new kR),o||jw(o,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const a=R.useMemo(()=>({...xR(),...o?.options?.react,...t}),[o,t]),{useSuspense:c,keyPrefix:d}=a,f=s||o?.options?.defaultNS,p=zs(f)?[f]:f||["translation"],g=R.useMemo(()=>p,p);o?.reportNamespaces?.addUsedNamespaces?.(g);const y=R.useRef(0),x=R.useCallback(U=>{if(!o)return TR;const{bindI18n:D,bindI18nStore:Z}=a,Y=()=>{y.current+=1,U()};return D&&o.on(D,Y),Z&&o.store.on(Z,Y),()=>{D&&D.split(" ").forEach(he=>o.off(he,Y)),Z&&Z.split(" ").forEach(he=>o.store.off(he,Y))}},[o,a]),b=R.useRef(),w=R.useCallback(()=>{if(!o)return NR;const U=!!(o.isInitialized||o.initializedStoreOnce)&&g.every(W=>dR(W,o,a)),D=t.lng||o.language,Z=y.current,Y=b.current;if(Y&&Y.ready===U&&Y.lng===D&&Y.keyPrefix===d&&Y.revision===Z)return Y;const G={t:o.getFixedT(D,a.nsMode==="fallback"?g:g[0],d),ready:U,lng:D,keyPrefix:d,revision:Z};return b.current=G,G},[o,g,d,a,t.lng]),[k,S]=R.useState(0),{t:E,ready:j}=ER.useSyncExternalStore(x,w,w);R.useEffect(()=>{if(o&&!j&&!c){const U=()=>S(D=>D+1);t.lng?Gv(o,t.lng,g,U):yf(o,g,U)}},[o,t.lng,g,j,c,k]);const O=o||{},N=R.useRef(null),T=R.useRef(),I=U=>{const D=Object.getOwnPropertyDescriptors(U);D.__original&&delete D.__original;const Z=Object.create(Object.getPrototypeOf(U),D);if(!Object.prototype.hasOwnProperty.call(Z,"__original"))try{Object.defineProperty(Z,"__original",{value:U,writable:!1,enumerable:!1,configurable:!1})}catch{}return Z},V=R.useMemo(()=>{const U=O,D=U?.language;let Z=U;U&&(N.current&&N.current.__original===U?T.current!==D?(Z=I(U),N.current=Z,T.current=D):Z=N.current:(Z=I(U),N.current=Z,T.current=D));const Y=[E,Z,j];return Y.t=E,Y.i18n=Z,Y.ready=j,Y},[E,O,j,O.resolvedLanguage,O.language,O.languages]);if(o&&c&&!j)throw new Promise(U=>{const D=()=>U();t.lng?Gv(o,t.lng,g,D):yf(o,g,D)});return V};function Kc(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(e);s<r.length;s++)t.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(e,r[s])&&(n[r[s]]=e[r[s]]);return n}function AR(e,t,n,r){function s(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function c(p){try{f(r.next(p))}catch(g){a(g)}}function d(p){try{f(r.throw(p))}catch(g){a(g)}}function f(p){p.done?o(p.value):s(p.value).then(c,d)}f((r=r.apply(e,t||[])).next())})}const RR=e=>e?(...t)=>e(...t):(...t)=>fetch(...t);class Tp extends Error{constructor(t,n="FunctionsError",r){super(t),this.name=n,this.context=r}}class PR extends Tp{constructor(t){super("Failed to send a request to the Edge Function","FunctionsFetchError",t)}}class Yv extends Tp{constructor(t){super("Relay Error invoking the Edge Function","FunctionsRelayError",t)}}class Qv extends Tp{constructor(t){super("Edge Function returned a non-2xx status code","FunctionsHttpError",t)}}var vf;(function(e){e.Any="any",e.ApNortheast1="ap-northeast-1",e.ApNortheast2="ap-northeast-2",e.ApSouth1="ap-south-1",e.ApSoutheast1="ap-southeast-1",e.ApSoutheast2="ap-southeast-2",e.CaCentral1="ca-central-1",e.EuCentral1="eu-central-1",e.EuWest1="eu-west-1",e.EuWest2="eu-west-2",e.EuWest3="eu-west-3",e.SaEast1="sa-east-1",e.UsEast1="us-east-1",e.UsWest1="us-west-1",e.UsWest2="us-west-2"})(vf||(vf={}));class OR{constructor(t,{headers:n={},customFetch:r,region:s=vf.Any}={}){this.url=t,this.headers=n,this.region=s,this.fetch=RR(r)}setAuth(t){this.headers.Authorization=`Bearer ${t}`}invoke(t){return AR(this,arguments,void 0,function*(n,r={}){var s;let o,a;try{const{headers:c,method:d,body:f,signal:p,timeout:g}=r;let y={},{region:x}=r;x||(x=this.region);const b=new URL(`${this.url}/${n}`);x&&x!=="any"&&(y["x-region"]=x,b.searchParams.set("forceFunctionRegion",x));let w;f&&(c&&!Object.prototype.hasOwnProperty.call(c,"Content-Type")||!c)?typeof Blob<"u"&&f instanceof Blob||f instanceof ArrayBuffer?(y["Content-Type"]="application/octet-stream",w=f):typeof f=="string"?(y["Content-Type"]="text/plain",w=f):typeof FormData<"u"&&f instanceof FormData?w=f:(y["Content-Type"]="application/json",w=JSON.stringify(f)):f&&typeof f!="string"&&!(typeof Blob<"u"&&f instanceof Blob)&&!(f instanceof ArrayBuffer)&&!(typeof FormData<"u"&&f instanceof FormData)?w=JSON.stringify(f):w=f;let k=p;g&&(a=new AbortController,o=setTimeout(()=>a.abort(),g),p?(k=a.signal,p.addEventListener("abort",()=>a.abort())):k=a.signal);const S=yield this.fetch(b.toString(),{method:d||"POST",headers:Object.assign(Object.assign(Object.assign({},y),this.headers),c),body:w,signal:k}).catch(N=>{throw new PR(N)}),E=S.headers.get("x-relay-error");if(E&&E==="true")throw new Yv(S);if(!S.ok)throw new Qv(S);let j=((s=S.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),O;return j==="application/json"?O=yield S.json():j==="application/octet-stream"||j==="application/pdf"?O=yield S.blob():j==="text/event-stream"?O=S:j==="multipart/form-data"?O=yield S.formData():O=yield S.text(),{data:O,error:null,response:S}}catch(c){return{data:null,error:c,response:c instanceof Qv||c instanceof Yv?c.context:void 0}}finally{o&&clearTimeout(o)}})}}var LR=class extends Error{constructor(e){super(e.message),this.name="PostgrestError",this.details=e.details,this.hint=e.hint,this.code=e.code}},IR=class{constructor(e){var t,n;this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=new Headers(e.headers),this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=(t=e.shouldThrowOnError)!==null&&t!==void 0?t:!1,this.signal=e.signal,this.isMaybeSingle=(n=e.isMaybeSingle)!==null&&n!==void 0?n:!1,e.fetch?this.fetch=e.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(e,t){return this.headers=new Headers(this.headers),this.headers.set(e,t),this}then(e,t){var n=this;this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json");const r=this.fetch;let s=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async o=>{let a=null,c=null,d=null,f=o.status,p=o.statusText;if(o.ok){var g,y;if(n.method!=="HEAD"){var x;const S=await o.text();S===""||(n.headers.get("Accept")==="text/csv"||n.headers.get("Accept")&&(!((x=n.headers.get("Accept"))===null||x===void 0)&&x.includes("application/vnd.pgrst.plan+text"))?c=S:c=JSON.parse(S))}const w=(g=n.headers.get("Prefer"))===null||g===void 0?void 0:g.match(/count=(exact|planned|estimated)/),k=(y=o.headers.get("content-range"))===null||y===void 0?void 0:y.split("/");w&&k&&k.length>1&&(d=parseInt(k[1])),n.isMaybeSingle&&n.method==="GET"&&Array.isArray(c)&&(c.length>1?(a={code:"PGRST116",details:`Results contain ${c.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},c=null,d=null,f=406,p="Not Acceptable"):c.length===1?c=c[0]:c=null)}else{var b;const w=await o.text();try{a=JSON.parse(w),Array.isArray(a)&&o.status===404&&(c=[],a=null,f=200,p="OK")}catch{o.status===404&&w===""?(f=204,p="No Content"):a={message:w}}if(a&&n.isMaybeSingle&&(!(a==null||(b=a.details)===null||b===void 0)&&b.includes("0 rows"))&&(a=null,f=200,p="OK"),a&&n.shouldThrowOnError)throw new LR(a)}return{error:a,data:c,count:d,status:f,statusText:p}});return this.shouldThrowOnError||(s=s.catch(o=>{var a;let c="";const d=o?.cause;if(d){var f,p,g,y;const b=(f=d?.message)!==null&&f!==void 0?f:"",w=(p=d?.code)!==null&&p!==void 0?p:"";c=`${(g=o?.name)!==null&&g!==void 0?g:"FetchError"}: ${o?.message}`,c+=`
|
|
22
|
+
|
|
23
|
+
Caused by: ${(y=d?.name)!==null&&y!==void 0?y:"Error"}: ${b}`,w&&(c+=` (${w})`),d?.stack&&(c+=`
|
|
24
|
+
${d.stack}`)}else{var x;c=(x=o?.stack)!==null&&x!==void 0?x:""}return{error:{message:`${(a=o?.name)!==null&&a!==void 0?a:"FetchError"}: ${o?.message}`,details:c,hint:"",code:""},data:null,count:null,status:0,statusText:""}})),s.then(e,t)}returns(){return this}overrideTypes(){return this}},DR=class extends IR{select(e){let t=!1;const n=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",n),this.headers.append("Prefer","return=representation"),this}order(e,{ascending:t=!0,nullsFirst:n,foreignTable:r,referencedTable:s=r}={}){const o=s?`${s}.order`:"order",a=this.url.searchParams.get(o);return this.url.searchParams.set(o,`${a?`${a},`:""}${e}.${t?"asc":"desc"}${n===void 0?"":n?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t,referencedTable:n=t}={}){const r=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:n,referencedTable:r=n}={}){const s=typeof r>"u"?"offset":`${r}.offset`,o=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(s,`${e}`),this.url.searchParams.set(o,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.method==="GET"?this.headers.set("Accept","application/json"):this.headers.set("Accept","application/vnd.pgrst.object+json"),this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:e=!1,verbose:t=!1,settings:n=!1,buffers:r=!1,wal:s=!1,format:o="text"}={}){var a;const c=[e?"analyze":null,t?"verbose":null,n?"settings":null,r?"buffers":null,s?"wal":null].filter(Boolean).join("|"),d=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${o}; for="${d}"; options=${c};`),o==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(e){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${e}`),this}};const Zv=new RegExp("[,()]");var Si=class extends DR{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}regexMatch(e,t){return this.url.searchParams.append(e,`match.${t}`),this}regexIMatch(e,t){return this.url.searchParams.append(e,`imatch.${t}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}isDistinct(e,t){return this.url.searchParams.append(e,`isdistinct.${t}`),this}in(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&Zv.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${n})`),this}notIn(e,t){const n=Array.from(new Set(t)).map(r=>typeof r=="string"&&Zv.test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`not.in.(${n})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:n,type:r}={}){let s="";r==="plain"?s="pl":r==="phrase"?s="ph":r==="websearch"&&(s="w");const o=n===void 0?"":`(${n})`;return this.url.searchParams.append(e,`${s}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,n])=>{this.url.searchParams.append(t,`eq.${n}`)}),this}not(e,t,n){return this.url.searchParams.append(e,`not.${t}.${n}`),this}or(e,{foreignTable:t,referencedTable:n=t}={}){const r=n?`${n}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,n){return this.url.searchParams.append(e,`${t}.${n}`),this}},MR=class{constructor(e,{headers:t={},schema:n,fetch:r}){this.url=e,this.headers=new Headers(t),this.schema=n,this.fetch=r}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(e,t){const{head:n=!1,count:r}=t??{},s=n?"HEAD":"GET";let o=!1;const a=(e??"*").split("").map(f=>/\s/.test(f)&&!o?"":(f==='"'&&(o=!o),f)).join(""),{url:c,headers:d}=this.cloneRequestState();return c.searchParams.set("select",a),r&&d.append("Prefer",`count=${r}`),new Si({method:s,url:c,headers:d,schema:this.schema,fetch:this.fetch})}insert(e,{count:t,defaultToNull:n=!0}={}){var r;const s="POST",{url:o,headers:a}=this.cloneRequestState();if(t&&a.append("Prefer",`count=${t}`),n||a.append("Prefer","missing=default"),Array.isArray(e)){const c=e.reduce((d,f)=>d.concat(Object.keys(f)),[]);if(c.length>0){const d=[...new Set(c)].map(f=>`"${f}"`);o.searchParams.set("columns",d.join(","))}}return new Si({method:s,url:o,headers:a,schema:this.schema,body:e,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch})}upsert(e,{onConflict:t,ignoreDuplicates:n=!1,count:r,defaultToNull:s=!0}={}){var o;const a="POST",{url:c,headers:d}=this.cloneRequestState();if(d.append("Prefer",`resolution=${n?"ignore":"merge"}-duplicates`),t!==void 0&&c.searchParams.set("on_conflict",t),r&&d.append("Prefer",`count=${r}`),s||d.append("Prefer","missing=default"),Array.isArray(e)){const f=e.reduce((p,g)=>p.concat(Object.keys(g)),[]);if(f.length>0){const p=[...new Set(f)].map(g=>`"${g}"`);c.searchParams.set("columns",p.join(","))}}return new Si({method:a,url:c,headers:d,schema:this.schema,body:e,fetch:(o=this.fetch)!==null&&o!==void 0?o:fetch})}update(e,{count:t}={}){var n;const r="PATCH",{url:s,headers:o}=this.cloneRequestState();return t&&o.append("Prefer",`count=${t}`),new Si({method:r,url:s,headers:o,schema:this.schema,body:e,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch})}delete({count:e}={}){var t;const n="DELETE",{url:r,headers:s}=this.cloneRequestState();return e&&s.append("Prefer",`count=${e}`),new Si({method:n,url:r,headers:s,schema:this.schema,fetch:(t=this.fetch)!==null&&t!==void 0?t:fetch})}},zR=class Nw{constructor(t,{headers:n={},schema:r,fetch:s}={}){this.url=t,this.headers=new Headers(n),this.schemaName=r,this.fetch=s}from(t){if(!t||typeof t!="string"||t.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new MR(new URL(`${this.url}/${t}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch})}schema(t){return new Nw(this.url,{headers:this.headers,schema:t,fetch:this.fetch})}rpc(t,n={},{head:r=!1,get:s=!1,count:o}={}){var a;let c;const d=new URL(`${this.url}/rpc/${t}`);let f;const p=x=>x!==null&&typeof x=="object"&&(!Array.isArray(x)||x.some(p)),g=r&&Object.values(n).some(p);g?(c="POST",f=n):r||s?(c=r?"HEAD":"GET",Object.entries(n).filter(([x,b])=>b!==void 0).map(([x,b])=>[x,Array.isArray(b)?`{${b.join(",")}}`:`${b}`]).forEach(([x,b])=>{d.searchParams.append(x,b)})):(c="POST",f=n);const y=new Headers(this.headers);return g?y.set("Prefer",o?`count=${o},return=minimal`:"return=minimal"):o&&y.set("Prefer",`count=${o}`),new Si({method:c,url:d,headers:y,schema:this.schemaName,body:f,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch})}};class FR{constructor(){}static detectEnvironment(){var t;if(typeof WebSocket<"u")return{type:"native",constructor:WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocket<"u")return{type:"native",constructor:globalThis.WebSocket};if(typeof global<"u"&&typeof global.WebSocket<"u")return{type:"native",constructor:global.WebSocket};if(typeof globalThis<"u"&&typeof globalThis.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&globalThis.EdgeRuntime||typeof navigator<"u"&&(!((t=navigator.userAgent)===null||t===void 0)&&t.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const n=globalThis.process;if(n){const r=n.versions;if(r&&r.node){const s=r.node,o=parseInt(s.replace(/^v/,"").split(".")[0]);return o>=22?typeof globalThis.WebSocket<"u"?{type:"native",constructor:globalThis.WebSocket}:{type:"unsupported",error:`Node.js ${o} detected but native WebSocket not found.`,workaround:"Provide a WebSocket implementation via the transport option."}:{type:"unsupported",error:`Node.js ${o} detected without native WebSocket support.`,workaround:`For Node.js < 22, install "ws" package and provide it via the transport option:
|
|
25
|
+
import ws from "ws"
|
|
26
|
+
new RealtimeClient(url, { transport: ws })`}}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const t=this.detectEnvironment();if(t.constructor)return t.constructor;let n=t.error||"WebSocket not supported in this environment.";throw t.workaround&&(n+=`
|
|
27
|
+
|
|
28
|
+
Suggested solution: ${t.workaround}`),new Error(n)}static createWebSocket(t,n){const r=this.getWebSocketConstructor();return new r(t,n)}static isWebSocketSupported(){try{const t=this.detectEnvironment();return t.type==="native"||t.type==="ws"}catch{return!1}}}const $R="2.91.0",UR=`realtime-js/${$R}`,BR="1.0.0",Tw="2.0.0",e0=Tw,_f=1e4,VR=1e3,qR=100;var Yr;(function(e){e[e.connecting=0]="connecting",e[e.open=1]="open",e[e.closing=2]="closing",e[e.closed=3]="closed"})(Yr||(Yr={}));var Lt;(function(e){e.closed="closed",e.errored="errored",e.joined="joined",e.joining="joining",e.leaving="leaving"})(Lt||(Lt={}));var Yn;(function(e){e.close="phx_close",e.error="phx_error",e.join="phx_join",e.reply="phx_reply",e.leave="phx_leave",e.access_token="access_token"})(Yn||(Yn={}));var bf;(function(e){e.websocket="websocket"})(bf||(bf={}));var Es;(function(e){e.Connecting="connecting",e.Open="open",e.Closing="closing",e.Closed="closed"})(Es||(Es={}));class HR{constructor(t){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=t??[]}encode(t,n){if(t.event===this.BROADCAST_EVENT&&!(t.payload instanceof ArrayBuffer)&&typeof t.payload.event=="string")return n(this._binaryEncodeUserBroadcastPush(t));let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return n(JSON.stringify(r))}_binaryEncodeUserBroadcastPush(t){var n;return this._isArrayBuffer((n=t.payload)===null||n===void 0?void 0:n.payload)?this._encodeBinaryUserBroadcastPush(t):this._encodeJsonUserBroadcastPush(t)}_encodeBinaryUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:new ArrayBuffer(0);return this._encodeUserBroadcastPush(t,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(t){var n,r;const s=(r=(n=t.payload)===null||n===void 0?void 0:n.payload)!==null&&r!==void 0?r:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(t,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(t,n,r){var s,o;const a=t.topic,c=(s=t.ref)!==null&&s!==void 0?s:"",d=(o=t.join_ref)!==null&&o!==void 0?o:"",f=t.payload.event,p=this.allowedMetadataKeys?this._pick(t.payload,this.allowedMetadataKeys):{},g=Object.keys(p).length===0?"":JSON.stringify(p);if(d.length>255)throw new Error(`joinRef length ${d.length} exceeds maximum of 255`);if(c.length>255)throw new Error(`ref length ${c.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(f.length>255)throw new Error(`userEvent length ${f.length} exceeds maximum of 255`);if(g.length>255)throw new Error(`metadata length ${g.length} exceeds maximum of 255`);const y=this.USER_BROADCAST_PUSH_META_LENGTH+d.length+c.length+a.length+f.length+g.length,x=new ArrayBuffer(this.HEADER_LENGTH+y);let b=new DataView(x),w=0;b.setUint8(w++,this.KINDS.userBroadcastPush),b.setUint8(w++,d.length),b.setUint8(w++,c.length),b.setUint8(w++,a.length),b.setUint8(w++,f.length),b.setUint8(w++,g.length),b.setUint8(w++,n),Array.from(d,S=>b.setUint8(w++,S.charCodeAt(0))),Array.from(c,S=>b.setUint8(w++,S.charCodeAt(0))),Array.from(a,S=>b.setUint8(w++,S.charCodeAt(0))),Array.from(f,S=>b.setUint8(w++,S.charCodeAt(0))),Array.from(g,S=>b.setUint8(w++,S.charCodeAt(0)));var k=new Uint8Array(x.byteLength+r.byteLength);return k.set(new Uint8Array(x),0),k.set(new Uint8Array(r),x.byteLength),k.buffer}decode(t,n){if(this._isArrayBuffer(t)){let r=this._binaryDecode(t);return n(r)}if(typeof t=="string"){const r=JSON.parse(t),[s,o,a,c,d]=r;return n({join_ref:s,ref:o,topic:a,event:c,payload:d})}return n({})}_binaryDecode(t){const n=new DataView(t),r=n.getUint8(0),s=new TextDecoder;if(r===this.KINDS.userBroadcast)return this._decodeUserBroadcast(t,n,s)}_decodeUserBroadcast(t,n,r){const s=n.getUint8(1),o=n.getUint8(2),a=n.getUint8(3),c=n.getUint8(4);let d=this.HEADER_LENGTH+4;const f=r.decode(t.slice(d,d+s));d=d+s;const p=r.decode(t.slice(d,d+o));d=d+o;const g=r.decode(t.slice(d,d+a));d=d+a;const y=t.slice(d,t.byteLength),x=c===this.JSON_ENCODING?JSON.parse(r.decode(y)):y,b={type:this.BROADCAST_EVENT,event:p,payload:x};return a>0&&(b.meta=JSON.parse(g)),{join_ref:null,ref:null,topic:f,event:this.BROADCAST_EVENT,payload:b}}_isArrayBuffer(t){var n;return t instanceof ArrayBuffer||((n=t?.constructor)===null||n===void 0?void 0:n.name)==="ArrayBuffer"}_pick(t,n){return!t||typeof t!="object"?{}:Object.fromEntries(Object.entries(t).filter(([r])=>n.includes(r)))}}class Aw{constructor(t,n){this.callback=t,this.timerCalc=n,this.timer=void 0,this.tries=0,this.callback=t,this.timerCalc=n}reset(){this.tries=0,clearTimeout(this.timer),this.timer=void 0}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}var ut;(function(e){e.abstime="abstime",e.bool="bool",e.date="date",e.daterange="daterange",e.float4="float4",e.float8="float8",e.int2="int2",e.int4="int4",e.int4range="int4range",e.int8="int8",e.int8range="int8range",e.json="json",e.jsonb="jsonb",e.money="money",e.numeric="numeric",e.oid="oid",e.reltime="reltime",e.text="text",e.time="time",e.timestamp="timestamp",e.timestamptz="timestamptz",e.timetz="timetz",e.tsrange="tsrange",e.tstzrange="tstzrange"})(ut||(ut={}));const t0=(e,t,n={})=>{var r;const s=(r=n.skipTypes)!==null&&r!==void 0?r:[];return t?Object.keys(t).reduce((o,a)=>(o[a]=KR(a,e,t,s),o),{}):{}},KR=(e,t,n,r)=>{const s=t.find(c=>c.name===e),o=s?.type,a=n[e];return o&&!r.includes(o)?Rw(o,a):wf(a)},Rw=(e,t)=>{if(e.charAt(0)==="_"){const n=e.slice(1,e.length);return XR(t,n)}switch(e){case ut.bool:return WR(t);case ut.float4:case ut.float8:case ut.int2:case ut.int4:case ut.int8:case ut.numeric:case ut.oid:return GR(t);case ut.json:case ut.jsonb:return JR(t);case ut.timestamp:return YR(t);case ut.abstime:case ut.date:case ut.daterange:case ut.int4range:case ut.int8range:case ut.money:case ut.reltime:case ut.text:case ut.time:case ut.timestamptz:case ut.timetz:case ut.tsrange:case ut.tstzrange:return wf(t);default:return wf(t)}},wf=e=>e,WR=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},GR=e=>{if(typeof e=="string"){const t=parseFloat(e);if(!Number.isNaN(t))return t}return e},JR=e=>{if(typeof e=="string")try{return JSON.parse(e)}catch{return e}return e},XR=(e,t)=>{if(typeof e!="string")return e;const n=e.length-1,r=e[n];if(e[0]==="{"&&r==="}"){let o;const a=e.slice(1,n);try{o=JSON.parse("["+a+"]")}catch{o=a?a.split(","):[]}return o.map(c=>Rw(t,c))}return e},YR=e=>typeof e=="string"?e.replace(" ","T"):e,Pw=e=>{const t=new URL(e);return t.protocol=t.protocol.replace(/^ws/i,"http"),t.pathname=t.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),t.pathname===""||t.pathname==="/"?t.pathname="/api/broadcast":t.pathname=t.pathname+"/api/broadcast",t.href};class fh{constructor(t,n,r={},s=_f){this.channel=t,this.event=n,this.payload=r,this.timeout=s,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null}resend(t){this.timeout=t,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){this._hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()}))}updatePayload(t){this.payload=Object.assign(Object.assign({},this.payload),t)}receive(t,n){var r;return this._hasReceived(t)&&n((r=this.receivedResp)===null||r===void 0?void 0:r.response),this.recHooks.push({status:t,callback:n}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const t=n=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=n,this._matchReceive(n)};this.channel._on(this.refEvent,{},t),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(t,n){this.refEvent&&this.channel._trigger(this.refEvent,{status:t,response:n})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:t,response:n}){this.recHooks.filter(r=>r.status===t).forEach(r=>r.callback(n))}_hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}}var n0;(function(e){e.SYNC="sync",e.JOIN="join",e.LEAVE="leave"})(n0||(n0={}));class ea{constructor(t,n){this.channel=t,this.state={},this.pendingDiffs=[],this.joinRef=null,this.enabled=!1,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const r=n?.events||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},s=>{const{onJoin:o,onLeave:a,onSync:c}=this.caller;this.joinRef=this.channel._joinRef(),this.state=ea.syncState(this.state,s,o,a),this.pendingDiffs.forEach(d=>{this.state=ea.syncDiff(this.state,d,o,a)}),this.pendingDiffs=[],c()}),this.channel._on(r.diff,{},s=>{const{onJoin:o,onLeave:a,onSync:c}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=ea.syncDiff(this.state,s,o,a),c())}),this.onJoin((s,o,a)=>{this.channel._trigger("presence",{event:"join",key:s,currentPresences:o,newPresences:a})}),this.onLeave((s,o,a)=>{this.channel._trigger("presence",{event:"leave",key:s,currentPresences:o,leftPresences:a})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(t,n,r,s){const o=this.cloneDeep(t),a=this.transformState(n),c={},d={};return this.map(o,(f,p)=>{a[f]||(d[f]=p)}),this.map(a,(f,p)=>{const g=o[f];if(g){const y=p.map(k=>k.presence_ref),x=g.map(k=>k.presence_ref),b=p.filter(k=>x.indexOf(k.presence_ref)<0),w=g.filter(k=>y.indexOf(k.presence_ref)<0);b.length>0&&(c[f]=b),w.length>0&&(d[f]=w)}else c[f]=p}),this.syncDiff(o,{joins:c,leaves:d},r,s)}static syncDiff(t,n,r,s){const{joins:o,leaves:a}={joins:this.transformState(n.joins),leaves:this.transformState(n.leaves)};return r||(r=()=>{}),s||(s=()=>{}),this.map(o,(c,d)=>{var f;const p=(f=t[c])!==null&&f!==void 0?f:[];if(t[c]=this.cloneDeep(d),p.length>0){const g=t[c].map(x=>x.presence_ref),y=p.filter(x=>g.indexOf(x.presence_ref)<0);t[c].unshift(...y)}r(c,p,d)}),this.map(a,(c,d)=>{let f=t[c];if(!f)return;const p=d.map(g=>g.presence_ref);f=f.filter(g=>p.indexOf(g.presence_ref)<0),t[c]=f,s(c,f,d),f.length===0&&delete t[c]}),t}static map(t,n){return Object.getOwnPropertyNames(t).map(r=>n(r,t[r]))}static transformState(t){return t=this.cloneDeep(t),Object.getOwnPropertyNames(t).reduce((n,r)=>{const s=t[r];return"metas"in s?n[r]=s.metas.map(o=>(o.presence_ref=o.phx_ref,delete o.phx_ref,delete o.phx_ref_prev,o)):n[r]=s,n},{})}static cloneDeep(t){return JSON.parse(JSON.stringify(t))}onJoin(t){this.caller.onJoin=t}onLeave(t){this.caller.onLeave=t}onSync(t){this.caller.onSync=t}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var r0;(function(e){e.ALL="*",e.INSERT="INSERT",e.UPDATE="UPDATE",e.DELETE="DELETE"})(r0||(r0={}));var ta;(function(e){e.BROADCAST="broadcast",e.PRESENCE="presence",e.POSTGRES_CHANGES="postgres_changes",e.SYSTEM="system"})(ta||(ta={}));var br;(function(e){e.SUBSCRIBED="SUBSCRIBED",e.TIMED_OUT="TIMED_OUT",e.CLOSED="CLOSED",e.CHANNEL_ERROR="CHANNEL_ERROR"})(br||(br={}));class Oi{constructor(t,n={config:{}},r){var s,o;if(this.topic=t,this.params=n,this.socket=r,this.bindings={},this.state=Lt.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=t.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},n.config),this.timeout=this.socket.timeout,this.joinPush=new fh(this,Yn.join,this.params,this.timeout),this.rejoinTimer=new Aw(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=Lt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(a=>a.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=Lt.closed,this.socket._remove(this)}),this._onError(a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=Lt.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("error",a=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,a),this.state=Lt.errored,this.rejoinTimer.scheduleTimeout())}),this._on(Yn.reply,{},(a,c)=>{this._trigger(this._replyEventName(c),a)}),this.presence=new ea(this),this.broadcastEndpointURL=Pw(this.socket.endPoint),this.private=this.params.config.private||!1,!this.private&&(!((o=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||o===void 0)&&o.replay))throw`tried to use replay on public channel '${this.topic}'. It must be a private channel.`}subscribe(t,n=this.timeout){var r,s,o;if(this.socket.isConnected()||this.socket.connect(),this.state==Lt.closed){const{config:{broadcast:a,presence:c,private:d}}=this.params,f=(s=(r=this.bindings.postgres_changes)===null||r===void 0?void 0:r.map(x=>x.filter))!==null&&s!==void 0?s:[],p=!!this.bindings[ta.PRESENCE]&&this.bindings[ta.PRESENCE].length>0||((o=this.params.config.presence)===null||o===void 0?void 0:o.enabled)===!0,g={},y={broadcast:a,presence:Object.assign(Object.assign({},c),{enabled:p}),postgres_changes:f,private:d};this.socket.accessTokenValue&&(g.access_token=this.socket.accessTokenValue),this._onError(x=>t?.(br.CHANNEL_ERROR,x)),this._onClose(()=>t?.(br.CLOSED)),this.updateJoinPayload(Object.assign({config:y},g)),this.joinedOnce=!0,this._rejoin(n),this.joinPush.receive("ok",async({postgres_changes:x})=>{var b;if(this.socket._isManualToken()||this.socket.setAuth(),x===void 0){t?.(br.SUBSCRIBED);return}else{const w=this.bindings.postgres_changes,k=(b=w?.length)!==null&&b!==void 0?b:0,S=[];for(let E=0;E<k;E++){const j=w[E],{filter:{event:O,schema:N,table:T,filter:I}}=j,V=x&&x[E];if(V&&V.event===O&&Oi.isFilterValueEqual(V.schema,N)&&Oi.isFilterValueEqual(V.table,T)&&Oi.isFilterValueEqual(V.filter,I))S.push(Object.assign(Object.assign({},j),{id:V.id}));else{this.unsubscribe(),this.state=Lt.errored,t?.(br.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=S,t&&t(br.SUBSCRIBED);return}}).receive("error",x=>{this.state=Lt.errored,t?.(br.CHANNEL_ERROR,new Error(JSON.stringify(Object.values(x).join(", ")||"error")))}).receive("timeout",()=>{t?.(br.TIMED_OUT)})}return this}presenceState(){return this.presence.state}async track(t,n={}){return await this.send({type:"presence",event:"track",payload:t},n.timeout||this.timeout)}async untrack(t={}){return await this.send({type:"presence",event:"untrack"},t)}on(t,n,r){return this.state===Lt.joined&&t===ta.PRESENCE&&(this.socket.log("channel",`resubscribe to ${this.topic} due to change in presence callbacks on joined channel`),this.unsubscribe().then(async()=>await this.subscribe())),this._on(t,n,r)}async httpSend(t,n,r={}){var s;if(n==null)return Promise.reject("Payload is required for httpSend()");const o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const a={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:t,payload:n,private:this.private}]})},c=await this._fetchWithTimeout(this.broadcastEndpointURL,a,(s=r.timeout)!==null&&s!==void 0?s:this.timeout);if(c.status===202)return{success:!0};let d=c.statusText;try{const f=await c.json();d=f.error||f.message||d}catch{}return Promise.reject(new Error(d))}async send(t,n={}){var r,s;if(!this._canPush()&&t.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated in the future. Please use httpSend() explicitly for REST delivery.");const{event:o,payload:a}=t,c={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(c.Authorization=`Bearer ${this.socket.accessTokenValue}`);const d={method:"POST",headers:c,body:JSON.stringify({messages:[{topic:this.subTopic,event:o,payload:a,private:this.private}]})};try{const f=await this._fetchWithTimeout(this.broadcastEndpointURL,d,(r=n.timeout)!==null&&r!==void 0?r:this.timeout);return await((s=f.body)===null||s===void 0?void 0:s.cancel()),f.ok?"ok":"error"}catch(f){return f.name==="AbortError"?"timed out":"error"}}else return new Promise(o=>{var a,c,d;const f=this._push(t.type,t,n.timeout||this.timeout);t.type==="broadcast"&&!(!((d=(c=(a=this.params)===null||a===void 0?void 0:a.config)===null||c===void 0?void 0:c.broadcast)===null||d===void 0)&&d.ack)&&o("ok"),f.receive("ok",()=>o("ok")),f.receive("error",()=>o("error")),f.receive("timeout",()=>o("timed out"))})}updateJoinPayload(t){this.joinPush.updatePayload(t)}unsubscribe(t=this.timeout){this.state=Lt.leaving;const n=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(Yn.close,"leave",this._joinRef())};this.joinPush.destroy();let r=null;return new Promise(s=>{r=new fh(this,Yn.leave,{},t),r.receive("ok",()=>{n(),s("ok")}).receive("timeout",()=>{n(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})}).finally(()=>{r?.destroy()})}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Lt.closed,this.bindings={}}async _fetchWithTimeout(t,n,r){const s=new AbortController,o=setTimeout(()=>s.abort(),r),a=await this.socket.fetch(t,Object.assign(Object.assign({},n),{signal:s.signal}));return clearTimeout(o),a}_push(t,n,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${t}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let s=new fh(this,t,n,r);return this._canPush()?s.send():this._addToPushBuffer(s),s}_addToPushBuffer(t){if(t.startTimeout(),this.pushBuffer.push(t),this.pushBuffer.length>qR){const n=this.pushBuffer.shift();n&&(n.destroy(),this.socket.log("channel",`discarded push due to buffer overflow: ${n.event}`,n.payload))}}_onMessage(t,n,r){return n}_isMember(t){return this.topic===t}_joinRef(){return this.joinPush.ref}_trigger(t,n,r){var s,o;const a=t.toLocaleLowerCase(),{close:c,error:d,leave:f,join:p}=Yn;if(r&&[c,d,f,p].indexOf(a)>=0&&r!==this._joinRef())return;let y=this._onMessage(a,n,r);if(n&&!y)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(a)?(s=this.bindings.postgres_changes)===null||s===void 0||s.filter(x=>{var b,w,k;return((b=x.filter)===null||b===void 0?void 0:b.event)==="*"||((k=(w=x.filter)===null||w===void 0?void 0:w.event)===null||k===void 0?void 0:k.toLocaleLowerCase())===a}).map(x=>x.callback(y,r)):(o=this.bindings[a])===null||o===void 0||o.filter(x=>{var b,w,k,S,E,j,O,N;if(["broadcast","presence","postgres_changes"].includes(a))if("id"in x){const T=x.id,I=(b=x.filter)===null||b===void 0?void 0:b.event;return T&&((w=n.ids)===null||w===void 0?void 0:w.includes(T))&&(I==="*"||I?.toLocaleLowerCase()===((k=n.data)===null||k===void 0?void 0:k.type.toLocaleLowerCase()))&&(!(!((S=x.filter)===null||S===void 0)&&S.table)||x.filter.table===((E=n.data)===null||E===void 0?void 0:E.table))}else{const T=(O=(j=x?.filter)===null||j===void 0?void 0:j.event)===null||O===void 0?void 0:O.toLocaleLowerCase();return T==="*"||T===((N=n?.event)===null||N===void 0?void 0:N.toLocaleLowerCase())}else return x.type.toLocaleLowerCase()===a}).map(x=>{if(typeof y=="object"&&"ids"in y){const b=y.data,{schema:w,table:k,commit_timestamp:S,type:E,errors:j}=b;y=Object.assign(Object.assign({},{schema:w,table:k,commit_timestamp:S,eventType:E,new:{},old:{},errors:j}),this._getPayloadRecords(b))}x.callback(y,r)})}_isClosed(){return this.state===Lt.closed}_isJoined(){return this.state===Lt.joined}_isJoining(){return this.state===Lt.joining}_isLeaving(){return this.state===Lt.leaving}_replyEventName(t){return`chan_reply_${t}`}_on(t,n,r){const s=t.toLocaleLowerCase(),o={type:s,filter:n,callback:r};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this}_off(t,n){const r=t.toLocaleLowerCase();return this.bindings[r]&&(this.bindings[r]=this.bindings[r].filter(s=>{var o;return!(((o=s.type)===null||o===void 0?void 0:o.toLocaleLowerCase())===r&&Oi.isEqual(s.filter,n))})),this}static isEqual(t,n){if(Object.keys(t).length!==Object.keys(n).length)return!1;for(const r in t)if(t[r]!==n[r])return!1;return!0}static isFilterValueEqual(t,n){return(t??void 0)===(n??void 0)}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(t){this._on(Yn.close,{},t)}_onError(t){this._on(Yn.error,{},n=>t(n))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(t=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=Lt.joining,this.joinPush.resend(t))}_getPayloadRecords(t){const n={new:{},old:{}};return(t.type==="INSERT"||t.type==="UPDATE")&&(n.new=t0(t.columns,t.record)),(t.type==="UPDATE"||t.type==="DELETE")&&(n.old=t0(t.columns,t.old_record)),n}}const ph=()=>{},Wl={HEARTBEAT_INTERVAL:25e3,RECONNECT_DELAY:10,HEARTBEAT_TIMEOUT_FALLBACK:100},QR=[1e3,2e3,5e3,1e4],ZR=1e4,eP=`
|
|
29
|
+
addEventListener("message", (e) => {
|
|
30
|
+
if (e.data.event === "start") {
|
|
31
|
+
setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
|
|
32
|
+
}
|
|
33
|
+
});`;class tP{constructor(t,n){var r;if(this.accessTokenValue=null,this.apiKey=null,this._manuallySetToken=!1,this.channels=new Array,this.endPoint="",this.httpEndpoint="",this.headers={},this.params={},this.timeout=_f,this.transport=null,this.heartbeatIntervalMs=Wl.HEARTBEAT_INTERVAL,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.heartbeatCallback=ph,this.ref=0,this.reconnectTimer=null,this.vsn=e0,this.logger=ph,this.conn=null,this.sendBuffer=[],this.serializer=new HR,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.accessToken=null,this._connectionState="disconnected",this._wasManualDisconnect=!1,this._authPromise=null,this._heartbeatSentAt=null,this._resolveFetch=s=>s?(...o)=>s(...o):(...o)=>fetch(...o),!(!((r=n?.params)===null||r===void 0)&&r.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=n.params.apikey,this.endPoint=`${t}/${bf.websocket}`,this.httpEndpoint=Pw(t),this._initializeOptions(n),this._setupReconnectionTimer(),this.fetch=this._resolveFetch(n?.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.conn!==null&&this.isConnected())){if(this._setConnectionState("connecting"),this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this.transport)this.conn=new this.transport(this.endpointURL());else try{this.conn=FR.createWebSocket(this.endpointURL())}catch(t){this._setConnectionState("disconnected");const n=t.message;throw n.includes("Node.js")?new Error(`${n}
|
|
34
|
+
|
|
35
|
+
To use Realtime in Node.js, you need to provide a WebSocket implementation:
|
|
36
|
+
|
|
37
|
+
Option 1: Use Node.js 22+ which has native WebSocket support
|
|
38
|
+
Option 2: Install and provide the "ws" package:
|
|
39
|
+
|
|
40
|
+
npm install ws
|
|
41
|
+
|
|
42
|
+
import ws from "ws"
|
|
43
|
+
const client = new RealtimeClient(url, {
|
|
44
|
+
...options,
|
|
45
|
+
transport: ws
|
|
46
|
+
})`):new Error(`WebSocket not available: ${n}`)}this._setupConnectionHandlers()}}endpointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:this.vsn}))}disconnect(t,n){if(!this.isDisconnecting())if(this._setConnectionState("disconnecting",!0),this.conn){const r=setTimeout(()=>{this._setConnectionState("disconnected")},100);this.conn.onclose=()=>{clearTimeout(r),this._setConnectionState("disconnected")},typeof this.conn.close=="function"&&(t?this.conn.close(t,n??""):this.conn.close()),this._teardownConnection()}else this._setConnectionState("disconnected")}getChannels(){return this.channels}async removeChannel(t){const n=await t.unsubscribe();return this.channels.length===0&&this.disconnect(),n}async removeAllChannels(){const t=await Promise.all(this.channels.map(n=>n.unsubscribe()));return this.channels=[],this.disconnect(),t}log(t,n,r){this.logger(t,n,r)}connectionState(){switch(this.conn&&this.conn.readyState){case Yr.connecting:return Es.Connecting;case Yr.open:return Es.Open;case Yr.closing:return Es.Closing;default:return Es.Closed}}isConnected(){return this.connectionState()===Es.Open}isConnecting(){return this._connectionState==="connecting"}isDisconnecting(){return this._connectionState==="disconnecting"}channel(t,n={config:{}}){const r=`realtime:${t}`,s=this.getChannels().find(o=>o.topic===r);if(s)return s;{const o=new Oi(`realtime:${t}`,n,this);return this.channels.push(o),o}}push(t){const{topic:n,event:r,payload:s,ref:o}=t,a=()=>{this.encode(t,c=>{var d;(d=this.conn)===null||d===void 0||d.send(c)})};this.log("push",`${n} ${r} (${o})`,s),this.isConnected()?a():this.sendBuffer.push(a)}async setAuth(t=null){this._authPromise=this._performAuth(t);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){var t;if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(n){this.log("error","error in heartbeat callback",n)}return}if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this._heartbeatSentAt=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(n){this.log("error","error in heartbeat callback",n)}this._wasManualDisconnect=!1,(t=this.conn)===null||t===void 0||t.close(VR,"heartbeat timeout"),setTimeout(()=>{var n;this.isConnected()||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout()},Wl.HEARTBEAT_TIMEOUT_FALLBACK);return}this._heartbeatSentAt=Date.now(),this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(n){this.log("error","error in heartbeat callback",n)}this._setAuthSafely("heartbeat")}onHeartbeat(t){this.heartbeatCallback=t}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}_makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}_leaveOpenTopic(t){let n=this.channels.find(r=>r.topic===t&&(r._isJoined()||r._isJoining()));n&&(this.log("transport",`leaving duplicate topic "${t}"`),n.unsubscribe())}_remove(t){this.channels=this.channels.filter(n=>n.topic!==t.topic)}_onConnMessage(t){this.decode(t.data,n=>{if(n.topic==="phoenix"&&n.event==="phx_reply"&&n.ref&&n.ref===this.pendingHeartbeatRef){const f=this._heartbeatSentAt?Date.now()-this._heartbeatSentAt:void 0;try{this.heartbeatCallback(n.payload.status==="ok"?"ok":"error",f)}catch(p){this.log("error","error in heartbeat callback",p)}this._heartbeatSentAt=null,this.pendingHeartbeatRef=null}const{topic:r,event:s,payload:o,ref:a}=n,c=a?`(${a})`:"",d=o.status||"";this.log("receive",`${d} ${r} ${s} ${c}`.trim(),o),this.channels.filter(f=>f._isMember(r)).forEach(f=>f._trigger(s,o,a)),this._triggerStateCallbacks("message",n)})}_clearTimer(t){var n;t==="heartbeat"&&this.heartbeatTimer?(clearInterval(this.heartbeatTimer),this.heartbeatTimer=void 0):t==="reconnect"&&((n=this.reconnectTimer)===null||n===void 0||n.reset())}_clearAllTimers(){this._clearTimer("heartbeat"),this._clearTimer("reconnect")}_setupConnectionHandlers(){this.conn&&("binaryType"in this.conn&&(this.conn.binaryType="arraybuffer"),this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=t=>this._onConnError(t),this.conn.onmessage=t=>this._onConnMessage(t),this.conn.onclose=t=>this._onConnClose(t),this.conn.readyState===Yr.open&&this._onConnOpen())}_teardownConnection(){if(this.conn){if(this.conn.readyState===Yr.open||this.conn.readyState===Yr.connecting)try{this.conn.close()}catch(t){this.log("error","Error closing connection",t)}this.conn.onopen=null,this.conn.onerror=null,this.conn.onmessage=null,this.conn.onclose=null,this.conn=null}this._clearAllTimers(),this._terminateWorker(),this.channels.forEach(t=>t.teardown())}_onConnOpen(){this._setConnectionState("connected"),this.log("transport",`connected to ${this.endpointURL()}`),(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).then(()=>{this.flushSendBuffer()}).catch(n=>{this.log("error","error waiting for auth on connect",n),this.flushSendBuffer()}),this._clearTimer("reconnect"),this.worker?this.workerRef||this._startWorkerHeartbeat():this._startHeartbeat(),this._triggerStateCallbacks("open")}_startHeartbeat(){this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this.sendHeartbeat(),this.heartbeatIntervalMs)}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const t=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(t),this.workerRef.onerror=n=>{this.log("worker","worker error",n.message),this._terminateWorker()},this.workerRef.onmessage=n=>{n.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_onConnClose(t){var n;this._setConnectionState("disconnected"),this.log("transport","close",t),this._triggerChanError(),this._clearTimer("heartbeat"),this._wasManualDisconnect||(n=this.reconnectTimer)===null||n===void 0||n.scheduleTimeout(),this._triggerStateCallbacks("close",t)}_onConnError(t){this._setConnectionState("disconnected"),this.log("transport",`${t}`),this._triggerChanError(),this._triggerStateCallbacks("error",t)}_triggerChanError(){this.channels.forEach(t=>t._trigger(Yn.error))}_appendParams(t,n){if(Object.keys(n).length===0)return t;const r=t.match(/\?/)?"&":"?",s=new URLSearchParams(n);return`${t}${r}${s}`}_workerObjectUrl(t){let n;if(t)n=t;else{const r=new Blob([eP],{type:"application/javascript"});n=URL.createObjectURL(r)}return n}_setConnectionState(t,n=!1){this._connectionState=t,t==="connecting"?this._wasManualDisconnect=!1:t==="disconnecting"&&(this._wasManualDisconnect=n)}async _performAuth(t=null){let n,r=!1;if(t)n=t,r=!0;else if(this.accessToken)try{n=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),n=this.accessTokenValue}else n=this.accessTokenValue;r?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=n&&(this.accessTokenValue=n,this.channels.forEach(s=>{const o={access_token:n,version:UR};n&&s.updateJoinPayload(o),s.joinedOnce&&s._isJoined()&&s._push(Yn.access_token,{access_token:n})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(t="general"){this._isManualToken()||this.setAuth().catch(n=>{this.log("error",`Error setting auth in ${t}`,n)})}_triggerStateCallbacks(t,n){try{this.stateChangeCallbacks[t].forEach(r=>{try{r(n)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}_setupReconnectionTimer(){this.reconnectTimer=new Aw(async()=>{setTimeout(async()=>{await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()},Wl.RECONNECT_DELAY)},this.reconnectAfterMs)}_initializeOptions(t){var n,r,s,o,a,c,d,f,p,g,y,x;switch(this.transport=(n=t?.transport)!==null&&n!==void 0?n:null,this.timeout=(r=t?.timeout)!==null&&r!==void 0?r:_f,this.heartbeatIntervalMs=(s=t?.heartbeatIntervalMs)!==null&&s!==void 0?s:Wl.HEARTBEAT_INTERVAL,this.worker=(o=t?.worker)!==null&&o!==void 0?o:!1,this.accessToken=(a=t?.accessToken)!==null&&a!==void 0?a:null,this.heartbeatCallback=(c=t?.heartbeatCallback)!==null&&c!==void 0?c:ph,this.vsn=(d=t?.vsn)!==null&&d!==void 0?d:e0,t?.params&&(this.params=t.params),t?.logger&&(this.logger=t.logger),(t?.logLevel||t?.log_level)&&(this.logLevel=t.logLevel||t.log_level,this.params=Object.assign(Object.assign({},this.params),{log_level:this.logLevel})),this.reconnectAfterMs=(f=t?.reconnectAfterMs)!==null&&f!==void 0?f:(b=>QR[b-1]||ZR),this.vsn){case BR:this.encode=(p=t?.encode)!==null&&p!==void 0?p:((b,w)=>w(JSON.stringify(b))),this.decode=(g=t?.decode)!==null&&g!==void 0?g:((b,w)=>w(JSON.parse(b)));break;case Tw:this.encode=(y=t?.encode)!==null&&y!==void 0?y:this.serializer.encode.bind(this.serializer),this.decode=(x=t?.decode)!==null&&x!==void 0?x:this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${this.vsn}`)}if(this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=t?.workerUrl}}}var fa=class extends Error{constructor(e,t){super(e),this.name="IcebergError",this.status=t.status,this.icebergType=t.icebergType,this.icebergCode=t.icebergCode,this.details=t.details,this.isCommitStateUnknown=t.icebergType==="CommitStateUnknownException"||[500,502,504].includes(t.status)&&t.icebergType?.includes("CommitState")===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function nP(e,t,n){const r=new URL(t,e);if(n)for(const[s,o]of Object.entries(n))o!==void 0&&r.searchParams.set(s,o);return r.toString()}async function rP(e){return!e||e.type==="none"?{}:e.type==="bearer"?{Authorization:`Bearer ${e.token}`}:e.type==="header"?{[e.name]:e.value}:e.type==="custom"?await e.getHeaders():{}}function sP(e){const t=e.fetchImpl??globalThis.fetch;return{async request({method:n,path:r,query:s,body:o,headers:a}){const c=nP(e.baseUrl,r,s),d=await rP(e.auth),f=await t(c,{method:n,headers:{...o?{"Content-Type":"application/json"}:{},...d,...a},body:o?JSON.stringify(o):void 0}),p=await f.text(),g=(f.headers.get("content-type")||"").includes("application/json"),y=g&&p?JSON.parse(p):p;if(!f.ok){const x=g?y:void 0,b=x?.error;throw new fa(b?.message??`Request failed with status ${f.status}`,{status:f.status,icebergType:b?.type,icebergCode:b?.code,details:x})}return{status:f.status,headers:f.headers,data:y}}}}function Gl(e){return e.join("")}var iP=class{constructor(e,t=""){this.client=e,this.prefix=t}async listNamespaces(e){const t=e?{parent:Gl(e.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:t})).data.namespaces.map(r=>({namespace:r}))}async createNamespace(e,t){const n={namespace:e.namespace,properties:t?.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:n})).data}async dropNamespace(e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Gl(e.namespace)}`})}async loadNamespaceMetadata(e){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Gl(e.namespace)}`})).data.properties}}async namespaceExists(e){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Gl(e.namespace)}`}),!0}catch(t){if(t instanceof fa&&t.status===404)return!1;throw t}}async createNamespaceIfNotExists(e,t){try{return await this.createNamespace(e,t)}catch(n){if(n instanceof fa&&n.status===409)return;throw n}}};function fi(e){return e.join("")}var oP=class{constructor(e,t="",n){this.client=e,this.prefix=t,this.accessDelegation=n}async listTables(e){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables`})).data.identifiers}async createTable(e,t){const n={};return this.accessDelegation&&(n["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables`,body:t,headers:n})).data.metadata}async updateTable(e,t){const n=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables/${e.name}`,body:t});return{"metadata-location":n.data["metadata-location"],metadata:n.data.metadata}}async dropTable(e,t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables/${e.name}`,query:{purgeRequested:String(t?.purge??!1)}})}async loadTable(e){const t={};return this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables/${e.name}`,headers:t})).data.metadata}async tableExists(e){const t={};this.accessDelegation&&(t["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${fi(e.namespace)}/tables/${e.name}`,headers:t}),!0}catch(n){if(n instanceof fa&&n.status===404)return!1;throw n}}async createTableIfNotExists(e,t){try{return await this.createTable(e,t)}catch(n){if(n instanceof fa&&n.status===409)return await this.loadTable({namespace:e.namespace,name:t.name});throw n}}},aP=class{constructor(e){let t="v1";e.catalogName&&(t+=`/${e.catalogName}`);const n=e.baseUrl.endsWith("/")?e.baseUrl:`${e.baseUrl}/`;this.client=sP({baseUrl:n,auth:e.auth,fetchImpl:e.fetch}),this.accessDelegation=e.accessDelegation?.join(","),this.namespaceOps=new iP(this.client,t),this.tableOps=new oP(this.client,t,this.accessDelegation)}async listNamespaces(e){return this.namespaceOps.listNamespaces(e)}async createNamespace(e,t){return this.namespaceOps.createNamespace(e,t)}async dropNamespace(e){await this.namespaceOps.dropNamespace(e)}async loadNamespaceMetadata(e){return this.namespaceOps.loadNamespaceMetadata(e)}async listTables(e){return this.tableOps.listTables(e)}async createTable(e,t){return this.tableOps.createTable(e,t)}async updateTable(e,t){return this.tableOps.updateTable(e,t)}async dropTable(e,t){await this.tableOps.dropTable(e,t)}async loadTable(e){return this.tableOps.loadTable(e)}async namespaceExists(e){return this.namespaceOps.namespaceExists(e)}async tableExists(e){return this.tableOps.tableExists(e)}async createNamespaceIfNotExists(e,t){return this.namespaceOps.createNamespaceIfNotExists(e,t)}async createTableIfNotExists(e,t){return this.tableOps.createTableIfNotExists(e,t)}},Wc=class extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}};function vt(e){return typeof e=="object"&&e!==null&&"__isStorageError"in e}var lP=class extends Wc{constructor(e,t,n){super(e),this.name="StorageApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},kf=class extends Wc{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}};const Ap=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),cP=()=>Response,Sf=e=>{if(Array.isArray(e))return e.map(n=>Sf(n));if(typeof e=="function"||e!==Object(e))return e;const t={};return Object.entries(e).forEach(([n,r])=>{const s=n.replace(/([-_][a-z])/gi,o=>o.toUpperCase().replace(/[-_]/g,""));t[s]=Sf(r)}),t},uP=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},dP=e=>!e||typeof e!="string"||e.length===0||e.length>100||e.trim()!==e||e.includes("/")||e.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(e);function pa(e){"@babel/helpers - typeof";return pa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},pa(e)}function hP(e,t){if(pa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(pa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function fP(e){var t=hP(e,"string");return pa(t)=="symbol"?t:t+""}function pP(e,t,n){return(t=fP(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function ze(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?s0(Object(n),!0).forEach(function(r){pP(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const mh=e=>{var t;return e.msg||e.message||e.error_description||(typeof e.error=="string"?e.error:(t=e.error)===null||t===void 0?void 0:t.message)||JSON.stringify(e)},mP=async(e,t,n)=>{e instanceof await cP()&&!n?.noResolveJson?e.json().then(r=>{const s=e.status||500,o=r?.statusCode||s+"";t(new lP(mh(r),s,o))}).catch(r=>{t(new kf(mh(r),r))}):t(new kf(mh(e),e))},gP=(e,t,n,r)=>{const s={method:e,headers:t?.headers||{}};return e==="GET"||!r?s:(uP(r)?(s.headers=ze({"Content-Type":"application/json"},t?.headers),s.body=JSON.stringify(r)):s.body=r,t?.duplex&&(s.duplex=t.duplex),ze(ze({},s),n))};async function Ta(e,t,n,r,s,o){return new Promise((a,c)=>{e(n,gP(t,r,s,o)).then(d=>{if(!d.ok)throw d;return r?.noResolveJson?d:d.json()}).then(d=>a(d)).catch(d=>mP(d,c,r))})}async function ma(e,t,n,r){return Ta(e,"GET",t,n,r)}async function Xn(e,t,n,r,s){return Ta(e,"POST",t,r,s,n)}async function jf(e,t,n,r,s){return Ta(e,"PUT",t,r,s,n)}async function yP(e,t,n,r){return Ta(e,"HEAD",t,ze(ze({},n),{},{noResolveJson:!0}),r)}async function Rp(e,t,n,r,s){return Ta(e,"DELETE",t,r,s,n)}var xP=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t}then(e,t){return this.execute().then(e,t)}async execute(){var e=this;try{return{data:(await e.downloadFn()).body,error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(vt(t))return{data:null,error:t};throw t}}};let Ow;Ow=Symbol.toStringTag;var vP=class{constructor(e,t){this.downloadFn=e,this.shouldThrowOnError=t,this[Ow]="BlobDownloadBuilder",this.promise=null}asStream(){return new xP(this.downloadFn,this.shouldThrowOnError)}then(e,t){return this.getPromise().then(e,t)}catch(e){return this.getPromise().catch(e)}finally(e){return this.getPromise().finally(e)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var e=this;try{return{data:await(await e.downloadFn()).blob(),error:null}}catch(t){if(e.shouldThrowOnError)throw t;if(vt(t))return{data:null,error:t};throw t}}};const _P={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},i0={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var bP=class{constructor(e,t={},n,r){this.shouldThrowOnError=!1,this.url=e,this.headers=t,this.bucketId=n,this.fetch=Ap(r)}throwOnError(){return this.shouldThrowOnError=!0,this}async uploadOrUpdate(e,t,n,r){var s=this;try{let o;const a=ze(ze({},i0),r);let c=ze(ze({},s.headers),e==="POST"&&{"x-upsert":String(a.upsert)});const d=a.metadata;typeof Blob<"u"&&n instanceof Blob?(o=new FormData,o.append("cacheControl",a.cacheControl),d&&o.append("metadata",s.encodeMetadata(d)),o.append("",n)):typeof FormData<"u"&&n instanceof FormData?(o=n,o.has("cacheControl")||o.append("cacheControl",a.cacheControl),d&&!o.has("metadata")&&o.append("metadata",s.encodeMetadata(d))):(o=n,c["cache-control"]=`max-age=${a.cacheControl}`,c["content-type"]=a.contentType,d&&(c["x-metadata"]=s.toBase64(s.encodeMetadata(d))),(typeof ReadableStream<"u"&&o instanceof ReadableStream||o&&typeof o=="object"&&"pipe"in o&&typeof o.pipe=="function")&&!a.duplex&&(a.duplex="half")),r?.headers&&(c=ze(ze({},c),r.headers));const f=s._removeEmptyFolders(t),p=s._getFinalPath(f),g=await(e=="PUT"?jf:Xn)(s.fetch,`${s.url}/object/${p}`,o,ze({headers:c},a?.duplex?{duplex:a.duplex}:{}));return{data:{path:f,id:g.Id,fullPath:g.Key},error:null}}catch(o){if(s.shouldThrowOnError)throw o;if(vt(o))return{data:null,error:o};throw o}}async upload(e,t,n){return this.uploadOrUpdate("POST",e,t,n)}async uploadToSignedUrl(e,t,n,r){var s=this;const o=s._removeEmptyFolders(e),a=s._getFinalPath(o),c=new URL(s.url+`/object/upload/sign/${a}`);c.searchParams.set("token",t);try{let d;const f=ze({upsert:i0.upsert},r),p=ze(ze({},s.headers),{"x-upsert":String(f.upsert)});return typeof Blob<"u"&&n instanceof Blob?(d=new FormData,d.append("cacheControl",f.cacheControl),d.append("",n)):typeof FormData<"u"&&n instanceof FormData?(d=n,d.append("cacheControl",f.cacheControl)):(d=n,p["cache-control"]=`max-age=${f.cacheControl}`,p["content-type"]=f.contentType),{data:{path:o,fullPath:(await jf(s.fetch,c.toString(),d,{headers:p})).Key},error:null}}catch(d){if(s.shouldThrowOnError)throw d;if(vt(d))return{data:null,error:d};throw d}}async createSignedUploadUrl(e,t){var n=this;try{let r=n._getFinalPath(e);const s=ze({},n.headers);t?.upsert&&(s["x-upsert"]="true");const o=await Xn(n.fetch,`${n.url}/object/upload/sign/${r}`,{},{headers:s}),a=new URL(n.url+o.url),c=a.searchParams.get("token");if(!c)throw new Wc("No token returned by API");return{data:{signedUrl:a.toString(),path:e,token:c},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(vt(r))return{data:null,error:r};throw r}}async update(e,t,n){return this.uploadOrUpdate("PUT",e,t,n)}async move(e,t,n){var r=this;try{return{data:await Xn(r.fetch,`${r.url}/object/move`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers}),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(vt(s))return{data:null,error:s};throw s}}async copy(e,t,n){var r=this;try{return{data:{path:(await Xn(r.fetch,`${r.url}/object/copy`,{bucketId:r.bucketId,sourceKey:e,destinationKey:t,destinationBucket:n?.destinationBucket},{headers:r.headers})).Key},error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(vt(s))return{data:null,error:s};throw s}}async createSignedUrl(e,t,n){var r=this;try{let s=r._getFinalPath(e),o=await Xn(r.fetch,`${r.url}/object/sign/${s}`,ze({expiresIn:t},n?.transform?{transform:n.transform}:{}),{headers:r.headers});const a=n?.download?`&download=${n.download===!0?"":n.download}`:"";return o={signedUrl:encodeURI(`${r.url}${o.signedURL}${a}`)},{data:o,error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(vt(s))return{data:null,error:s};throw s}}async createSignedUrls(e,t,n){var r=this;try{const s=await Xn(r.fetch,`${r.url}/object/sign/${r.bucketId}`,{expiresIn:t,paths:e},{headers:r.headers}),o=n?.download?`&download=${n.download===!0?"":n.download}`:"";return{data:s.map(a=>ze(ze({},a),{},{signedUrl:a.signedURL?encodeURI(`${r.url}${a.signedURL}${o}`):null})),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(vt(s))return{data:null,error:s};throw s}}download(e,t){const n=typeof t?.transform<"u"?"render/image/authenticated":"object",r=this.transformOptsToQueryString(t?.transform||{}),s=r?`?${r}`:"",o=this._getFinalPath(e),a=()=>ma(this.fetch,`${this.url}/${n}/${o}${s}`,{headers:this.headers,noResolveJson:!0});return new vP(a,this.shouldThrowOnError)}async info(e){var t=this;const n=t._getFinalPath(e);try{return{data:Sf(await ma(t.fetch,`${t.url}/object/info/${n}`,{headers:t.headers})),error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(vt(r))return{data:null,error:r};throw r}}async exists(e){var t=this;const n=t._getFinalPath(e);try{return await yP(t.fetch,`${t.url}/object/${n}`,{headers:t.headers}),{data:!0,error:null}}catch(r){if(t.shouldThrowOnError)throw r;if(vt(r)&&r instanceof kf){const s=r.originalError;if([400,404].includes(s?.status))return{data:!1,error:r}}throw r}}getPublicUrl(e,t){const n=this._getFinalPath(e),r=[],s=t?.download?`download=${t.download===!0?"":t.download}`:"";s!==""&&r.push(s);const o=typeof t?.transform<"u"?"render/image":"object",a=this.transformOptsToQueryString(t?.transform||{});a!==""&&r.push(a);let c=r.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${o}/public/${n}${c}`)}}}async remove(e){var t=this;try{return{data:await Rp(t.fetch,`${t.url}/object/${t.bucketId}`,{prefixes:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async list(e,t,n){var r=this;try{const s=ze(ze(ze({},_P),t),{},{prefix:e||""});return{data:await Xn(r.fetch,`${r.url}/object/list/${r.bucketId}`,s,{headers:r.headers},n),error:null}}catch(s){if(r.shouldThrowOnError)throw s;if(vt(s))return{data:null,error:s};throw s}}async listV2(e,t){var n=this;try{const r=ze({},e);return{data:await Xn(n.fetch,`${n.url}/object/list-v2/${n.bucketId}`,r,{headers:n.headers},t),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(vt(r))return{data:null,error:r};throw r}}encodeMetadata(e){return JSON.stringify(e)}toBase64(e){return typeof Buffer<"u"?Buffer.from(e).toString("base64"):btoa(e)}_getFinalPath(e){return`${this.bucketId}/${e.replace(/^\/+/,"")}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}};const Lw="2.91.0",Iw={"X-Client-Info":`storage-js/${Lw}`};var wP=class{constructor(e,t={},n,r){this.shouldThrowOnError=!1;const s=new URL(e);r?.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase.")),this.url=s.href.replace(/\/$/,""),this.headers=ze(ze({},Iw),t),this.fetch=Ap(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async listBuckets(e){var t=this;try{const n=t.listBucketOptionsToQueryString(e);return{data:await ma(t.fetch,`${t.url}/bucket${n}`,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async getBucket(e){var t=this;try{return{data:await ma(t.fetch,`${t.url}/bucket/${e}`,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async createBucket(e,t={public:!1}){var n=this;try{return{data:await Xn(n.fetch,`${n.url}/bucket`,{id:e,name:e,type:t.type,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(vt(r))return{data:null,error:r};throw r}}async updateBucket(e,t){var n=this;try{return{data:await jf(n.fetch,`${n.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(vt(r))return{data:null,error:r};throw r}}async emptyBucket(e){var t=this;try{return{data:await Xn(t.fetch,`${t.url}/bucket/${e}/empty`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await Rp(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}listBucketOptionsToQueryString(e){const t={};return e&&("limit"in e&&(t.limit=String(e.limit)),"offset"in e&&(t.offset=String(e.offset)),e.search&&(t.search=e.search),e.sortColumn&&(t.sortColumn=e.sortColumn),e.sortOrder&&(t.sortOrder=e.sortOrder)),Object.keys(t).length>0?"?"+new URLSearchParams(t).toString():""}},kP=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=ze(ze({},Iw),t),this.fetch=Ap(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Xn(t.fetch,`${t.url}/bucket`,{name:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async listBuckets(e){var t=this;try{const n=new URLSearchParams;e?.limit!==void 0&&n.set("limit",e.limit.toString()),e?.offset!==void 0&&n.set("offset",e.offset.toString()),e?.sortColumn&&n.set("sortColumn",e.sortColumn),e?.sortOrder&&n.set("sortOrder",e.sortOrder),e?.search&&n.set("search",e.search);const r=n.toString(),s=r?`${t.url}/bucket?${r}`:`${t.url}/bucket`;return{data:await ma(t.fetch,s,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await Rp(t.fetch,`${t.url}/bucket/${e}`,{},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(vt(n))return{data:null,error:n};throw n}}from(e){var t=this;if(!dP(e))throw new Wc("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const n=new aP({baseUrl:this.url,catalogName:e,auth:{type:"custom",getHeaders:async()=>t.headers},fetch:this.fetch}),r=this.shouldThrowOnError;return new Proxy(n,{get(s,o){const a=s[o];return typeof a!="function"?a:async(...c)=>{try{return{data:await a.apply(s,c),error:null}}catch(d){if(r)throw d;return{data:null,error:d}}}}})}};const Pp={"X-Client-Info":`storage-js/${Lw}`,"Content-Type":"application/json"};var Dw=class extends Error{constructor(e){super(e),this.__isStorageVectorsError=!0,this.name="StorageVectorsError"}};function Cn(e){return typeof e=="object"&&e!==null&&"__isStorageVectorsError"in e}var gh=class extends Dw{constructor(e,t,n){super(e),this.name="StorageVectorsApiError",this.status=t,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}},SP=class extends Dw{constructor(e,t){super(e),this.name="StorageVectorsUnknownError",this.originalError=t}};const Op=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),jP=e=>{if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)},o0=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),EP=async(e,t,n)=>{if(e&&typeof e=="object"&&"status"in e&&"ok"in e&&typeof e.status=="number"&&!n?.noResolveJson){const r=e.status||500,s=e;if(typeof s.json=="function")s.json().then(o=>{const a=o?.statusCode||o?.code||r+"";t(new gh(o0(o),r,a))}).catch(()=>{const o=r+"";t(new gh(s.statusText||`HTTP ${r} error`,r,o))});else{const o=r+"";t(new gh(s.statusText||`HTTP ${r} error`,r,o))}}else t(new SP(o0(e),e))},CP=(e,t,n,r)=>{const s={method:e,headers:t?.headers||{}};return r?(jP(r)?(s.headers=ze({"Content-Type":"application/json"},t?.headers),s.body=JSON.stringify(r)):s.body=r,ze(ze({},s),n)):s};async function NP(e,t,n,r,s,o){return new Promise((a,c)=>{e(n,CP(t,r,s,o)).then(d=>{if(!d.ok)throw d;if(r?.noResolveJson)return d;const f=d.headers.get("content-type");return!f||!f.includes("application/json")?{}:d.json()}).then(d=>a(d)).catch(d=>EP(d,c,r))})}async function Nn(e,t,n,r,s){return NP(e,"POST",t,r,s,n)}var TP=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=ze(ze({},Pp),t),this.fetch=Op(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createIndex(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/CreateIndex`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async getIndex(e,t){var n=this;try{return{data:await Nn(n.fetch,`${n.url}/GetIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers}),error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Cn(r))return{data:null,error:r};throw r}}async listIndexes(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/ListIndexes`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async deleteIndex(e,t){var n=this;try{return{data:await Nn(n.fetch,`${n.url}/DeleteIndex`,{vectorBucketName:e,indexName:t},{headers:n.headers})||{},error:null}}catch(r){if(n.shouldThrowOnError)throw r;if(Cn(r))return{data:null,error:r};throw r}}},AP=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=ze(ze({},Pp),t),this.fetch=Op(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async putVectors(e){var t=this;try{if(e.vectors.length<1||e.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return{data:await Nn(t.fetch,`${t.url}/PutVectors`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async getVectors(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/GetVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async listVectors(e){var t=this;try{if(e.segmentCount!==void 0){if(e.segmentCount<1||e.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(e.segmentIndex!==void 0&&(e.segmentIndex<0||e.segmentIndex>=e.segmentCount))throw new Error(`segmentIndex must be between 0 and ${e.segmentCount-1}`)}return{data:await Nn(t.fetch,`${t.url}/ListVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async queryVectors(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/QueryVectors`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async deleteVectors(e){var t=this;try{if(e.keys.length<1||e.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return{data:await Nn(t.fetch,`${t.url}/DeleteVectors`,e,{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}},RP=class{constructor(e,t={},n){this.shouldThrowOnError=!1,this.url=e.replace(/\/$/,""),this.headers=ze(ze({},Pp),t),this.fetch=Op(n)}throwOnError(){return this.shouldThrowOnError=!0,this}async createBucket(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/CreateVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async getBucket(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/GetVectorBucket`,{vectorBucketName:e},{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async listBuckets(e={}){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/ListVectorBuckets`,e,{headers:t.headers}),error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}async deleteBucket(e){var t=this;try{return{data:await Nn(t.fetch,`${t.url}/DeleteVectorBucket`,{vectorBucketName:e},{headers:t.headers})||{},error:null}}catch(n){if(t.shouldThrowOnError)throw n;if(Cn(n))return{data:null,error:n};throw n}}},PP=class extends RP{constructor(e,t={}){super(e,t.headers||{},t.fetch)}from(e){return new OP(this.url,this.headers,e,this.fetch)}async createBucket(e){var t=()=>super.createBucket,n=this;return t().call(n,e)}async getBucket(e){var t=()=>super.getBucket,n=this;return t().call(n,e)}async listBuckets(e={}){var t=()=>super.listBuckets,n=this;return t().call(n,e)}async deleteBucket(e){var t=()=>super.deleteBucket,n=this;return t().call(n,e)}},OP=class extends TP{constructor(e,t,n,r){super(e,t,r),this.vectorBucketName=n}async createIndex(e){var t=()=>super.createIndex,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName}))}async listIndexes(e={}){var t=()=>super.listIndexes,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName}))}async getIndex(e){var t=()=>super.getIndex,n=this;return t().call(n,n.vectorBucketName,e)}async deleteIndex(e){var t=()=>super.deleteIndex,n=this;return t().call(n,n.vectorBucketName,e)}index(e){return new LP(this.url,this.headers,this.vectorBucketName,e,this.fetch)}},LP=class extends AP{constructor(e,t,n,r,s){super(e,t,s),this.vectorBucketName=n,this.indexName=r}async putVectors(e){var t=()=>super.putVectors,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async getVectors(e){var t=()=>super.getVectors,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async listVectors(e={}){var t=()=>super.listVectors,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async queryVectors(e){var t=()=>super.queryVectors,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}async deleteVectors(e){var t=()=>super.deleteVectors,n=this;return t().call(n,ze(ze({},e),{},{vectorBucketName:n.vectorBucketName,indexName:n.indexName}))}},IP=class extends wP{constructor(e,t={},n,r){super(e,t,n,r)}from(e){return new bP(this.url,this.headers,e,this.fetch)}get vectors(){return new PP(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new kP(this.url+"/iceberg",this.headers,this.fetch)}};const Mw="2.91.0",ji=30*1e3,Ef=3,yh=Ef*ji,DP="http://localhost:9999",MP="supabase.auth.token",zP={"X-Client-Info":`gotrue-js/${Mw}`},Cf="X-Supabase-Api-Version",zw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},FP=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,$P=600*1e3;class ga extends Error{constructor(t,n,r){super(t),this.__isAuthError=!0,this.name="AuthError",this.status=n,this.code=r}}function Ne(e){return typeof e=="object"&&e!==null&&"__isAuthError"in e}class UP extends ga{constructor(t,n,r){super(t,n,r),this.name="AuthApiError",this.status=n,this.code=r}}function BP(e){return Ne(e)&&e.name==="AuthApiError"}class Cs extends ga{constructor(t,n){super(t),this.name="AuthUnknownError",this.originalError=n}}class Cr extends ga{constructor(t,n,r,s){super(t,r,s),this.name=n,this.status=r}}class jn extends Cr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function VP(e){return Ne(e)&&e.name==="AuthSessionMissingError"}class pi extends Cr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Jl extends Cr{constructor(t){super(t,"AuthInvalidCredentialsError",400,void 0)}}class Xl extends Cr{constructor(t,n=null){super(t,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}function qP(e){return Ne(e)&&e.name==="AuthImplicitGrantRedirectError"}class a0 extends Cr{constructor(t,n=null){super(t,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=n}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class HP extends Cr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class Nf extends Cr{constructor(t,n){super(t,"AuthRetryableFetchError",n,void 0)}}function xh(e){return Ne(e)&&e.name==="AuthRetryableFetchError"}class l0 extends Cr{constructor(t,n,r){super(t,"AuthWeakPasswordError",n,"weak_password"),this.reasons=r}}class Tf extends Cr{constructor(t){super(t,"AuthInvalidJwtError",400,"invalid_jwt")}}const wc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),c0=`
|
|
47
|
+
\r=`.split(""),KP=(()=>{const e=new Array(128);for(let t=0;t<e.length;t+=1)e[t]=-1;for(let t=0;t<c0.length;t+=1)e[c0[t].charCodeAt(0)]=-2;for(let t=0;t<wc.length;t+=1)e[wc[t].charCodeAt(0)]=t;return e})();function u0(e,t,n){if(e!==null)for(t.queue=t.queue<<8|e,t.queuedBits+=8;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(wc[r]),t.queuedBits-=6}else if(t.queuedBits>0)for(t.queue=t.queue<<6-t.queuedBits,t.queuedBits=6;t.queuedBits>=6;){const r=t.queue>>t.queuedBits-6&63;n(wc[r]),t.queuedBits-=6}}function Fw(e,t,n){const r=KP[e];if(r>-1)for(t.queue=t.queue<<6|r,t.queuedBits+=6;t.queuedBits>=8;)n(t.queue>>t.queuedBits-8&255),t.queuedBits-=8;else{if(r===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(e)}"`)}}function d0(e){const t=[],n=a=>{t.push(String.fromCodePoint(a))},r={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},o=a=>{JP(a,r,n)};for(let a=0;a<e.length;a+=1)Fw(e.charCodeAt(a),s,o);return t.join("")}function WP(e,t){if(e<=127){t(e);return}else if(e<=2047){t(192|e>>6),t(128|e&63);return}else if(e<=65535){t(224|e>>12),t(128|e>>6&63),t(128|e&63);return}else if(e<=1114111){t(240|e>>18),t(128|e>>12&63),t(128|e>>6&63),t(128|e&63);return}throw new Error(`Unrecognized Unicode codepoint: ${e.toString(16)}`)}function GP(e,t){for(let n=0;n<e.length;n+=1){let r=e.charCodeAt(n);if(r>55295&&r<=56319){const s=(r-55296)*1024&65535;r=(e.charCodeAt(n+1)-56320&65535|s)+65536,n+=1}WP(r,t)}}function JP(e,t,n){if(t.utf8seq===0){if(e<=127){n(e);return}for(let r=1;r<6;r+=1)if((e>>7-r&1)===0){t.utf8seq=r;break}if(t.utf8seq===2)t.codepoint=e&31;else if(t.utf8seq===3)t.codepoint=e&15;else if(t.utf8seq===4)t.codepoint=e&7;else throw new Error("Invalid UTF-8 sequence");t.utf8seq-=1}else if(t.utf8seq>0){if(e<=127)throw new Error("Invalid UTF-8 sequence");t.codepoint=t.codepoint<<6|e&63,t.utf8seq-=1,t.utf8seq===0&&n(t.codepoint)}}function Li(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};for(let s=0;s<e.length;s+=1)Fw(e.charCodeAt(s),n,r);return new Uint8Array(t)}function XP(e){const t=[];return GP(e,n=>t.push(n)),new Uint8Array(t)}function As(e){const t=[],n={queue:0,queuedBits:0},r=s=>{t.push(s)};return e.forEach(s=>u0(s,n,r)),u0(null,n,r),t.join("")}function YP(e){return Math.round(Date.now()/1e3)+e}function QP(){return Symbol("auth-callback")}const qt=()=>typeof window<"u"&&typeof document<"u",_s={tested:!1,writable:!1},$w=()=>{if(!qt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(_s.tested)return _s.writable;const e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),_s.tested=!0,_s.writable=!0}catch{_s.tested=!0,_s.writable=!1}return _s.writable};function ZP(e){const t={},n=new URL(e);if(n.hash&&n.hash[0]==="#")try{new URLSearchParams(n.hash.substring(1)).forEach((s,o)=>{t[o]=s})}catch{}return n.searchParams.forEach((r,s)=>{t[s]=r}),t}const Uw=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),eO=e=>typeof e=="object"&&e!==null&&"status"in e&&"ok"in e&&"json"in e&&typeof e.json=="function",Ei=async(e,t,n)=>{await e.setItem(t,JSON.stringify(n))},bs=async(e,t)=>{const n=await e.getItem(t);if(!n)return null;try{return JSON.parse(n)}catch{return n}},Vt=async(e,t)=>{await e.removeItem(t)};class Gc{constructor(){this.promise=new Gc.promiseConstructor((t,n)=>{this.resolve=t,this.reject=n})}}Gc.promiseConstructor=Promise;function vh(e){const t=e.split(".");if(t.length!==3)throw new Tf("Invalid JWT structure");for(let r=0;r<t.length;r++)if(!FP.test(t[r]))throw new Tf("JWT not in base64url format");return{header:JSON.parse(d0(t[0])),payload:JSON.parse(d0(t[1])),signature:Li(t[2]),raw:{header:t[0],payload:t[1]}}}async function tO(e){return await new Promise(t=>{setTimeout(()=>t(null),e)})}function nO(e,t){return new Promise((r,s)=>{(async()=>{for(let o=0;o<1/0;o++)try{const a=await e(o);if(!t(o,null,a)){r(a);return}}catch(a){if(!t(o,a)){s(a);return}}})()})}function rO(e){return("0"+e.toString(16)).substr(-2)}function sO(){const t=new Uint32Array(56);if(typeof crypto>"u"){const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",r=n.length;let s="";for(let o=0;o<56;o++)s+=n.charAt(Math.floor(Math.random()*r));return s}return crypto.getRandomValues(t),Array.from(t,rO).join("")}async function iO(e){const n=new TextEncoder().encode(e),r=await crypto.subtle.digest("SHA-256",n),s=new Uint8Array(r);return Array.from(s).map(o=>String.fromCharCode(o)).join("")}async function oO(e){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;const n=await iO(e);return btoa(n).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function mi(e,t,n=!1){const r=sO();let s=r;n&&(s+="/PASSWORD_RECOVERY"),await Ei(e,`${t}-code-verifier`,s);const o=await oO(r);return[o,r===o?"plain":"s256"]}const aO=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function lO(e){const t=e.headers.get(Cf);if(!t||!t.match(aO))return null;try{return new Date(`${t}T00:00:00.0Z`)}catch{return null}}function cO(e){if(!e)throw new Error("Missing exp claim");const t=Math.floor(Date.now()/1e3);if(e<=t)throw new Error("JWT has expired")}function uO(e){switch(e){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const dO=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function gi(e){if(!dO.test(e))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function _h(){const e={};return new Proxy(e,{get:(t,n)=>{if(n==="__isUserNotAvailableProxy")return!0;if(typeof n=="symbol"){const r=n.toString();if(r==="Symbol(Symbol.toPrimitive)"||r==="Symbol(Symbol.toStringTag)"||r==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${n}" property of the session object is not supported. Please use getUser() instead.`)},set:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(t,n)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${n}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function hO(e,t){return new Proxy(e,{get:(n,r,s)=>{if(r==="__isInsecureUserWarningProxy")return!0;if(typeof r=="symbol"){const o=r.toString();if(o==="Symbol(Symbol.toPrimitive)"||o==="Symbol(Symbol.toStringTag)"||o==="Symbol(util.inspect.custom)"||o==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(n,r,s)}return!t.value&&typeof r=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),t.value=!0),Reflect.get(n,r,s)}})}function h0(e){return JSON.parse(JSON.stringify(e))}const js=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),fO=[502,503,504];async function f0(e){var t;if(!eO(e))throw new Nf(js(e),0);if(fO.includes(e.status))throw new Nf(js(e),e.status);let n;try{n=await e.json()}catch(o){throw new Cs(js(o),o)}let r;const s=lO(e);if(s&&s.getTime()>=zw["2024-01-01"].timestamp&&typeof n=="object"&&n&&typeof n.code=="string"?r=n.code:typeof n=="object"&&n&&typeof n.error_code=="string"&&(r=n.error_code),r){if(r==="weak_password")throw new l0(js(n),e.status,((t=n.weak_password)===null||t===void 0?void 0:t.reasons)||[]);if(r==="session_not_found")throw new jn}else if(typeof n=="object"&&n&&typeof n.weak_password=="object"&&n.weak_password&&Array.isArray(n.weak_password.reasons)&&n.weak_password.reasons.length&&n.weak_password.reasons.reduce((o,a)=>o&&typeof a=="string",!0))throw new l0(js(n),e.status,n.weak_password.reasons);throw new UP(js(n),e.status||500,r)}const pO=(e,t,n,r)=>{const s={method:e,headers:t?.headers||{}};return e==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},t?.headers),s.body=JSON.stringify(r),Object.assign(Object.assign({},s),n))};async function De(e,t,n,r){var s;const o=Object.assign({},r?.headers);o[Cf]||(o[Cf]=zw["2024-01-01"].name),r?.jwt&&(o.Authorization=`Bearer ${r.jwt}`);const a=(s=r?.query)!==null&&s!==void 0?s:{};r?.redirectTo&&(a.redirect_to=r.redirectTo);const c=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",d=await mO(e,t,n+c,{headers:o,noResolveJson:r?.noResolveJson},{},r?.body);return r?.xform?r?.xform(d):{data:Object.assign({},d),error:null}}async function mO(e,t,n,r,s,o){const a=pO(t,r,s,o);let c;try{c=await e(n,Object.assign({},a))}catch(d){throw console.error(d),new Nf(js(d),0)}if(c.ok||await f0(c),r?.noResolveJson)return c;try{return await c.json()}catch(d){await f0(d)}}function Gn(e){var t;let n=null;xO(e)&&(n=Object.assign({},e),e.expires_at||(n.expires_at=YP(e.expires_in)));const r=(t=e.user)!==null&&t!==void 0?t:e;return{data:{session:n,user:r},error:null}}function p0(e){const t=Gn(e);return!t.error&&e.weak_password&&typeof e.weak_password=="object"&&Array.isArray(e.weak_password.reasons)&&e.weak_password.reasons.length&&e.weak_password.message&&typeof e.weak_password.message=="string"&&e.weak_password.reasons.reduce((n,r)=>n&&typeof r=="string",!0)&&(t.data.weak_password=e.weak_password),t}function Qr(e){var t;return{data:{user:(t=e.user)!==null&&t!==void 0?t:e},error:null}}function gO(e){return{data:e,error:null}}function yO(e){const{action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o}=e,a=Kc(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),c={action_link:t,email_otp:n,hashed_token:r,redirect_to:s,verification_type:o},d=Object.assign({},a);return{data:{properties:c,user:d},error:null}}function m0(e){return e}function xO(e){return e.access_token&&e.refresh_token&&e.expires_in}const bh=["global","local","others"];class vO{constructor({url:t="",headers:n={},fetch:r}){this.url=t,this.headers=n,this.fetch=Uw(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)}}async signOut(t,n=bh[0]){if(bh.indexOf(n)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${bh.join(", ")}`);try{return await De(this.fetch,"POST",`${this.url}/logout?scope=${n}`,{headers:this.headers,jwt:t,noResolveJson:!0}),{data:null,error:null}}catch(r){if(Ne(r))return{data:null,error:r};throw r}}async inviteUserByEmail(t,n={}){try{return await De(this.fetch,"POST",`${this.url}/invite`,{body:{email:t,data:n.data},headers:this.headers,redirectTo:n.redirectTo,xform:Qr})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async generateLink(t){try{const{options:n}=t,r=Kc(t,["options"]),s=Object.assign(Object.assign({},r),n);return"newEmail"in r&&(s.new_email=r?.newEmail,delete s.newEmail),await De(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:yO,redirectTo:n?.redirectTo})}catch(n){if(Ne(n))return{data:{properties:null,user:null},error:n};throw n}}async createUser(t){try{return await De(this.fetch,"POST",`${this.url}/admin/users`,{body:t,headers:this.headers,xform:Qr})}catch(n){if(Ne(n))return{data:{user:null},error:n};throw n}}async listUsers(t){var n,r,s,o,a,c,d;try{const f={nextPage:null,lastPage:0,total:0},p=await De(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t?.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:m0});if(p.error)throw p.error;const g=await p.json(),y=(a=p.headers.get("x-total-count"))!==null&&a!==void 0?a:0,x=(d=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&d!==void 0?d:[];return x.length>0&&(x.forEach(b=>{const w=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(b.split(";")[1].split("=")[1]);f[`${k}Page`]=w}),f.total=parseInt(y)),{data:Object.assign(Object.assign({},g),f),error:null}}catch(f){if(Ne(f))return{data:{users:[]},error:f};throw f}}async getUserById(t){gi(t);try{return await De(this.fetch,"GET",`${this.url}/admin/users/${t}`,{headers:this.headers,xform:Qr})}catch(n){if(Ne(n))return{data:{user:null},error:n};throw n}}async updateUserById(t,n){gi(t);try{return await De(this.fetch,"PUT",`${this.url}/admin/users/${t}`,{body:n,headers:this.headers,xform:Qr})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async deleteUser(t,n=!1){gi(t);try{return await De(this.fetch,"DELETE",`${this.url}/admin/users/${t}`,{headers:this.headers,body:{should_soft_delete:n},xform:Qr})}catch(r){if(Ne(r))return{data:{user:null},error:r};throw r}}async _listFactors(t){gi(t.userId);try{const{data:n,error:r}=await De(this.fetch,"GET",`${this.url}/admin/users/${t.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:n,error:r}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _deleteFactor(t){gi(t.userId),gi(t.id);try{return{data:await De(this.fetch,"DELETE",`${this.url}/admin/users/${t.userId}/factors/${t.id}`,{headers:this.headers}),error:null}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _listOAuthClients(t){var n,r,s,o,a,c,d;try{const f={nextPage:null,lastPage:0,total:0},p=await De(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(r=(n=t?.page)===null||n===void 0?void 0:n.toString())!==null&&r!==void 0?r:"",per_page:(o=(s=t?.perPage)===null||s===void 0?void 0:s.toString())!==null&&o!==void 0?o:""},xform:m0});if(p.error)throw p.error;const g=await p.json(),y=(a=p.headers.get("x-total-count"))!==null&&a!==void 0?a:0,x=(d=(c=p.headers.get("link"))===null||c===void 0?void 0:c.split(","))!==null&&d!==void 0?d:[];return x.length>0&&(x.forEach(b=>{const w=parseInt(b.split(";")[0].split("=")[1].substring(0,1)),k=JSON.parse(b.split(";")[1].split("=")[1]);f[`${k}Page`]=w}),f.total=parseInt(y)),{data:Object.assign(Object.assign({},g),f),error:null}}catch(f){if(Ne(f))return{data:{clients:[]},error:f};throw f}}async _createOAuthClient(t){try{return await De(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:t,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _getOAuthClient(t){try{return await De(this.fetch,"GET",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _updateOAuthClient(t,n){try{return await De(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${t}`,{body:n,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(Ne(r))return{data:null,error:r};throw r}}async _deleteOAuthClient(t){try{return await De(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${t}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(n){if(Ne(n))return{data:null,error:n};throw n}}async _regenerateOAuthClientSecret(t){try{return await De(this.fetch,"POST",`${this.url}/admin/oauth/clients/${t}/regenerate_secret`,{headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(Ne(n))return{data:null,error:n};throw n}}}function g0(e={}){return{getItem:t=>e[t]||null,setItem:(t,n)=>{e[t]=n},removeItem:t=>{delete e[t]}}}const yi={debug:!!(globalThis&&$w()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug")==="true")};class Bw extends Error{constructor(t){super(t),this.isAcquireTimeout=!0}}class _O extends Bw{}async function bO(e,t,n){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquire lock",e,t);const r=new globalThis.AbortController;return t>0&&setTimeout(()=>{r.abort(),yi.debug&&console.log("@supabase/gotrue-js: navigatorLock acquire timed out",e)},t),await Promise.resolve().then(()=>globalThis.navigator.locks.request(e,t===0?{mode:"exclusive",ifAvailable:!0}:{mode:"exclusive",signal:r.signal},async s=>{if(s){yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: acquired",e,s.name);try{return await n()}finally{yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: released",e,s.name)}}else{if(t===0)throw yi.debug&&console.log("@supabase/gotrue-js: navigatorLock: not immediately available",e),new _O(`Acquiring an exclusive Navigator LockManager lock "${e}" immediately failed`);if(yi.debug)try{const o=await globalThis.navigator.locks.query();console.log("@supabase/gotrue-js: Navigator LockManager state",JSON.stringify(o,null," "))}catch(o){console.warn("@supabase/gotrue-js: Error when querying Navigator LockManager state",o)}return console.warn("@supabase/gotrue-js: Navigator LockManager returned a null lock when using #request without ifAvailable set to true, it appears this browser is not following the LockManager spec https://developer.mozilla.org/en-US/docs/Web/API/LockManager/request"),await n()}}))}function wO(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Vw(e){if(!/^0x[a-fA-F0-9]{40}$/.test(e))throw new Error(`@supabase/auth-js: Address "${e}" is invalid.`);return e.toLowerCase()}function kO(e){return parseInt(e,16)}function SO(e){const t=new TextEncoder().encode(e);return"0x"+Array.from(t,r=>r.toString(16).padStart(2,"0")).join("")}function jO(e){var t;const{chainId:n,domain:r,expirationTime:s,issuedAt:o=new Date,nonce:a,notBefore:c,requestId:d,resources:f,scheme:p,uri:g,version:y}=e;{if(!Number.isInteger(n))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${n}`);if(!r)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!g)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(y!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${y}`);if(!((t=e.statement)===null||t===void 0)&&t.includes(`
|
|
48
|
+
`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${e.statement}`)}const x=Vw(e.address),b=p?`${p}://${r}`:r,w=e.statement?`${e.statement}
|
|
49
|
+
`:"",k=`${b} wants you to sign in with your Ethereum account:
|
|
50
|
+
${x}
|
|
51
|
+
|
|
52
|
+
${w}`;let S=`URI: ${g}
|
|
53
|
+
Version: ${y}
|
|
54
|
+
Chain ID: ${n}${a?`
|
|
55
|
+
Nonce: ${a}`:""}
|
|
56
|
+
Issued At: ${o.toISOString()}`;if(s&&(S+=`
|
|
57
|
+
Expiration Time: ${s.toISOString()}`),c&&(S+=`
|
|
58
|
+
Not Before: ${c.toISOString()}`),d&&(S+=`
|
|
59
|
+
Request ID: ${d}`),f){let E=`
|
|
60
|
+
Resources:`;for(const j of f){if(!j||typeof j!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${j}`);E+=`
|
|
61
|
+
- ${j}`}S+=E}return`${k}
|
|
62
|
+
${S}`}class Rt extends Error{constructor({message:t,code:n,cause:r,name:s}){var o;super(t,{cause:r}),this.__isWebAuthnError=!0,this.name=(o=s??(r instanceof Error?r.name:void 0))!==null&&o!==void 0?o:"Unknown Error",this.code=n}}class kc extends Rt{constructor(t,n){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:n,message:t}),this.name="WebAuthnUnknownError",this.originalError=n}}function EO({error:e,options:t}){var n,r,s;const{publicKey:o}=t;if(!o)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Rt({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else if(e.name==="ConstraintError"){if(((n=o.authenticatorSelection)===null||n===void 0?void 0:n.requireResidentKey)===!0)return new Rt({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:e});if(t.mediation==="conditional"&&((r=o.authenticatorSelection)===null||r===void 0?void 0:r.userVerification)==="required")return new Rt({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:e});if(((s=o.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Rt({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:e})}else{if(e.name==="InvalidStateError")return new Rt({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:e});if(e.name==="NotAllowedError")return new Rt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="NotSupportedError")return o.pubKeyCredParams.filter(c=>c.type==="public-key").length===0?new Rt({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:e}):new Rt({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:e});if(e.name==="SecurityError"){const a=window.location.hostname;if(qw(a)){if(o.rp.id!==a)return new Rt({message:`The RP ID "${o.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Rt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="TypeError"){if(o.user.id.byteLength<1||o.user.id.byteLength>64)return new Rt({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:e})}else if(e.name==="UnknownError")return new Rt({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Rt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}function CO({error:e,options:t}){const{publicKey:n}=t;if(!n)throw Error("options was missing required publicKey property");if(e.name==="AbortError"){if(t.signal instanceof AbortSignal)return new Rt({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:e})}else{if(e.name==="NotAllowedError")return new Rt({message:e.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e});if(e.name==="SecurityError"){const r=window.location.hostname;if(qw(r)){if(n.rpId!==r)return new Rt({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:e})}else return new Rt({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:e})}else if(e.name==="UnknownError")return new Rt({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:e})}return new Rt({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:e})}class NO{createNewAbortSignal(){if(this.controller){const n=new Error("Cancelling existing WebAuthn API call for new one");n.name="AbortError",this.controller.abort(n)}const t=new AbortController;return this.controller=t,t.signal}cancelCeremony(){if(this.controller){const t=new Error("Manually cancelling existing WebAuthn API call");t.name="AbortError",this.controller.abort(t),this.controller=void 0}}}const TO=new NO;function AO(e){if(!e)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(e);const{challenge:t,user:n,excludeCredentials:r}=e,s=Kc(e,["challenge","user","excludeCredentials"]),o=Li(t).buffer,a=Object.assign(Object.assign({},n),{id:Li(n.id).buffer}),c=Object.assign(Object.assign({},s),{challenge:o,user:a});if(r&&r.length>0){c.excludeCredentials=new Array(r.length);for(let d=0;d<r.length;d++){const f=r[d];c.excludeCredentials[d]=Object.assign(Object.assign({},f),{id:Li(f.id).buffer,type:f.type||"public-key",transports:f.transports})}}return c}function RO(e){if(!e)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(e);const{challenge:t,allowCredentials:n}=e,r=Kc(e,["challenge","allowCredentials"]),s=Li(t).buffer,o=Object.assign(Object.assign({},r),{challenge:s});if(n&&n.length>0){o.allowCredentials=new Array(n.length);for(let a=0;a<n.length;a++){const c=n[a];o.allowCredentials[a]=Object.assign(Object.assign({},c),{id:Li(c.id).buffer,type:c.type||"public-key",transports:c.transports})}}return o}function PO(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e;return{id:e.id,rawId:e.id,response:{attestationObject:As(new Uint8Array(e.response.attestationObject)),clientDataJSON:As(new Uint8Array(e.response.clientDataJSON))},type:"public-key",clientExtensionResults:e.getClientExtensionResults(),authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function OO(e){var t;if("toJSON"in e&&typeof e.toJSON=="function")return e.toJSON();const n=e,r=e.getClientExtensionResults(),s=e.response;return{id:e.id,rawId:e.id,response:{authenticatorData:As(new Uint8Array(s.authenticatorData)),clientDataJSON:As(new Uint8Array(s.clientDataJSON)),signature:As(new Uint8Array(s.signature)),userHandle:s.userHandle?As(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:r,authenticatorAttachment:(t=n.authenticatorAttachment)!==null&&t!==void 0?t:void 0}}function qw(e){return e==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(e)}function y0(){var e,t;return!!(qt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((e=navigator?.credentials)===null||e===void 0?void 0:e.create)=="function"&&typeof((t=navigator?.credentials)===null||t===void 0?void 0:t.get)=="function")}async function LO(e){try{const t=await navigator.credentials.create(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kc("Browser returned unexpected credential type",t)}:{data:null,error:new kc("Empty credential response",t)}}catch(t){return{data:null,error:EO({error:t,options:e})}}}async function IO(e){try{const t=await navigator.credentials.get(e);return t?t instanceof PublicKeyCredential?{data:t,error:null}:{data:null,error:new kc("Browser returned unexpected credential type",t)}:{data:null,error:new kc("Empty credential response",t)}}catch(t){return{data:null,error:CO({error:t,options:e})}}}const DO={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},MO={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function Sc(...e){const t=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),n=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),r={};for(const s of e)if(s)for(const o in s){const a=s[o];if(a!==void 0)if(Array.isArray(a))r[o]=a;else if(n(a))r[o]=a;else if(t(a)){const c=r[o];t(c)?r[o]=Sc(c,a):r[o]=Sc(a)}else r[o]=a}return r}function zO(e,t){return Sc(DO,e,t||{})}function FO(e,t){return Sc(MO,e,t||{})}class $O{constructor(t){this.client=t,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(t){return this.client.mfa.enroll(Object.assign(Object.assign({},t),{factorType:"webauthn"}))}async _challenge({factorId:t,webauthn:n,friendlyName:r,signal:s},o){try{const{data:a,error:c}=await this.client.mfa.challenge({factorId:t,webauthn:n});if(!a)return{data:null,error:c};const d=s??TO.createNewAbortSignal();if(a.webauthn.type==="create"){const{user:f}=a.webauthn.credential_options.publicKey;f.name||(f.name=`${f.id}:${r}`),f.displayName||(f.displayName=f.name)}switch(a.webauthn.type){case"create":{const f=zO(a.webauthn.credential_options.publicKey,o?.create),{data:p,error:g}=await LO({publicKey:f,signal:d});return p?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:p}},error:null}:{data:null,error:g}}case"request":{const f=FO(a.webauthn.credential_options.publicKey,o?.request),{data:p,error:g}=await IO(Object.assign(Object.assign({},a.webauthn.credential_options),{publicKey:f,signal:d}));return p?{data:{factorId:t,challengeId:a.id,webauthn:{type:a.webauthn.type,credential_response:p}},error:null}:{data:null,error:g}}}}catch(a){return Ne(a)?{data:null,error:a}:{data:null,error:new Cs("Unexpected error in challenge",a)}}}async _verify({challengeId:t,factorId:n,webauthn:r}){return this.client.mfa.verify({factorId:n,challengeId:t,webauthn:r})}async _authenticate({factorId:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new ga("rpId is required for WebAuthn authentication")};try{if(!y0())return{data:null,error:new Cs("Browser does not support WebAuthn",null)};const{data:a,error:c}=await this.challenge({factorId:t,webauthn:{rpId:n,rpOrigins:r},signal:s},{request:o});if(!a)return{data:null,error:c};const{webauthn:d}=a;return this._verify({factorId:t,challengeId:a.challengeId,webauthn:{type:d.type,rpId:n,rpOrigins:r,credential_response:d.credential_response}})}catch(a){return Ne(a)?{data:null,error:a}:{data:null,error:new Cs("Unexpected error in authenticate",a)}}}async _register({friendlyName:t,webauthn:{rpId:n=typeof window<"u"?window.location.hostname:void 0,rpOrigins:r=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},o){if(!n)return{data:null,error:new ga("rpId is required for WebAuthn registration")};try{if(!y0())return{data:null,error:new Cs("Browser does not support WebAuthn",null)};const{data:a,error:c}=await this._enroll({friendlyName:t});if(!a)return await this.client.mfa.listFactors().then(p=>{var g;return(g=p.data)===null||g===void 0?void 0:g.all.find(y=>y.factor_type==="webauthn"&&y.friendly_name===t&&y.status!=="unverified")}).then(p=>p?this.client.mfa.unenroll({factorId:p?.id}):void 0),{data:null,error:c};const{data:d,error:f}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:n,rpOrigins:r},signal:s},{create:o});return d?this._verify({factorId:a.id,challengeId:d.challengeId,webauthn:{rpId:n,rpOrigins:r,type:d.webauthn.type,credential_response:d.webauthn.credential_response}}):{data:null,error:f}}catch(a){return Ne(a)?{data:null,error:a}:{data:null,error:new Cs("Unexpected error in register",a)}}}}wO();const UO={url:DP,storageKey:MP,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:zP,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:1e4};async function x0(e,t,n){return await n()}const xi={};class ya{get jwks(){var t,n;return(n=(t=xi[this.storageKey])===null||t===void 0?void 0:t.jwks)!==null&&n!==void 0?n:{keys:[]}}set jwks(t){xi[this.storageKey]=Object.assign(Object.assign({},xi[this.storageKey]),{jwks:t})}get jwks_cached_at(){var t,n;return(n=(t=xi[this.storageKey])===null||t===void 0?void 0:t.cachedAt)!==null&&n!==void 0?n:Number.MIN_SAFE_INTEGER}set jwks_cached_at(t){xi[this.storageKey]=Object.assign(Object.assign({},xi[this.storageKey]),{cachedAt:t})}constructor(t){var n,r,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const o=Object.assign(Object.assign({},UO),t);if(this.storageKey=o.storageKey,this.instanceID=(n=ya.nextInstanceID[this.storageKey])!==null&&n!==void 0?n:0,ya.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!o.debug,typeof o.debug=="function"&&(this.logger=o.debug),this.instanceID>0&&qt()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=o.persistSession,this.autoRefreshToken=o.autoRefreshToken,this.admin=new vO({url:o.url,headers:o.headers,fetch:o.fetch}),this.url=o.url,this.headers=o.headers,this.fetch=Uw(o.fetch),this.lock=o.lock||x0,this.detectSessionInUrl=o.detectSessionInUrl,this.flowType=o.flowType,this.hasCustomAuthorizationHeader=o.hasCustomAuthorizationHeader,this.throwOnError=o.throwOnError,this.lockAcquireTimeout=o.lockAcquireTimeout,o.lock?this.lock=o.lock:this.persistSession&&qt()&&(!((r=globalThis?.navigator)===null||r===void 0)&&r.locks)?this.lock=bO:this.lock=x0,this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new $O(this)},this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.persistSession?(o.storage?this.storage=o.storage:$w()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=g0(this.memoryStorage)),o.userStorage&&(this.userStorage=o.userStorage)):(this.memoryStorage={},this.storage=g0(this.memoryStorage)),qt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),await this._notifyAllSubscribers(a.data.event,a.data.session,!1)})}this.initialize()}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(t){if(this.throwOnError&&t&&t.error)throw t.error;return t}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Mw}) ${new Date().toISOString()}`}_debug(...t){return this.logDebugMessages&&this.logger(this._logPrefix(),...t),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){var t;try{let n={},r="none";if(qt()&&(n=ZP(window.location.href),this._isImplicitGrantCallback(n)?r="implicit":await this._isPKCECallback(n)&&(r="pkce")),qt()&&this.detectSessionInUrl&&r!=="none"){const{data:s,error:o}=await this._getSessionFromURL(n,r);if(o){if(this._debug("#_initialize()","error detecting session from URL",o),qP(o)){const d=(t=o.details)===null||t===void 0?void 0:t.code;if(d==="identity_already_exists"||d==="identity_not_found"||d==="single_identity_not_deletable")return{error:o}}return{error:o}}const{session:a,redirectType:c}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",c),await this._saveSession(a),setTimeout(async()=>{c==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(n){return Ne(n)?this._returnResult({error:n}):this._returnResult({error:new Cs("Unexpected error during initialization",n)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(t){var n,r,s;try{const o=await De(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(r=(n=t?.options)===null||n===void 0?void 0:n.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:(s=t?.options)===null||s===void 0?void 0:s.captchaToken}},xform:Gn}),{data:a,error:c}=o;if(c||!a)return this._returnResult({data:{user:null,session:null},error:c});const d=a.session,f=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",d)),this._returnResult({data:{user:f,session:d},error:null})}catch(o){if(Ne(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signUp(t){var n,r,s;try{let o;if("email"in t){const{email:p,password:g,options:y}=t;let x=null,b=null;this.flowType==="pkce"&&([x,b]=await mi(this.storage,this.storageKey)),o=await De(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:y?.emailRedirectTo,body:{email:p,password:g,data:(n=y?.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:y?.captchaToken},code_challenge:x,code_challenge_method:b},xform:Gn})}else if("phone"in t){const{phone:p,password:g,options:y}=t;o=await De(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:p,password:g,data:(r=y?.data)!==null&&r!==void 0?r:{},channel:(s=y?.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:y?.captchaToken}},xform:Gn})}else throw new Jl("You must provide either an email or phone number and a password");const{data:a,error:c}=o;if(c||!a)return await Vt(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:c});const d=a.session,f=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",d)),this._returnResult({data:{user:f,session:d},error:null})}catch(o){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async signInWithPassword(t){try{let n;if("email"in t){const{email:o,password:a,options:c}=t;n=await De(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:o,password:a,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:p0})}else if("phone"in t){const{phone:o,password:a,options:c}=t;n=await De(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:o,password:a,gotrue_meta_security:{captcha_token:c?.captchaToken}},xform:p0})}else throw new Jl("You must provide either an email or phone number and a password");const{data:r,error:s}=n;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!r||!r.session||!r.user){const o=new pi;return this._returnResult({data:{user:null,session:null},error:o})}return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:Object.assign({user:r.user,session:r.session},r.weak_password?{weakPassword:r.weak_password}:null),error:s})}catch(n){if(Ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOAuth(t){var n,r,s,o;return await this._handleProviderSignIn(t.provider,{redirectTo:(n=t.options)===null||n===void 0?void 0:n.redirectTo,scopes:(r=t.options)===null||r===void 0?void 0:r.scopes,queryParams:(s=t.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(o=t.options)===null||o===void 0?void 0:o.skipBrowserRedirect})}async exchangeCodeForSession(t){return await this.initializePromise,this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(t))}async signInWithWeb3(t){const{chain:n}=t;switch(n){case"ethereum":return await this.signInWithEthereum(t);case"solana":return await this.signInWithSolana(t);default:throw new Error(`@supabase/auth-js: Unsupported chain "${n}"`)}}async signInWithEthereum(t){var n,r,s,o,a,c,d,f,p,g,y;let x,b;if("message"in t)x=t.message,b=t.signature;else{const{chain:w,wallet:k,statement:S,options:E}=t;let j;if(qt())if(typeof k=="object")j=k;else{const U=window;if("ethereum"in U&&typeof U.ethereum=="object"&&"request"in U.ethereum&&typeof U.ethereum.request=="function")j=U.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof k!="object"||!E?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");j=k}const O=new URL((n=E?.url)!==null&&n!==void 0?n:window.location.href),N=await j.request({method:"eth_requestAccounts"}).then(U=>U).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!N||N.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const T=Vw(N[0]);let I=(r=E?.signInWithEthereum)===null||r===void 0?void 0:r.chainId;if(!I){const U=await j.request({method:"eth_chainId"});I=kO(U)}const V={domain:O.host,address:T,statement:S,uri:O.href,version:"1",chainId:I,nonce:(s=E?.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(o=E?.signInWithEthereum)===null||o===void 0?void 0:o.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(c=E?.signInWithEthereum)===null||c===void 0?void 0:c.expirationTime,notBefore:(d=E?.signInWithEthereum)===null||d===void 0?void 0:d.notBefore,requestId:(f=E?.signInWithEthereum)===null||f===void 0?void 0:f.requestId,resources:(p=E?.signInWithEthereum)===null||p===void 0?void 0:p.resources};x=jO(V),b=await j.request({method:"personal_sign",params:[SO(x),T]})}try{const{data:w,error:k}=await De(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:x,signature:b},!((g=t.options)===null||g===void 0)&&g.captchaToken?{gotrue_meta_security:{captcha_token:(y=t.options)===null||y===void 0?void 0:y.captchaToken}}:null),xform:Gn});if(k)throw k;if(!w||!w.session||!w.user){const S=new pi;return this._returnResult({data:{user:null,session:null},error:S})}return w.session&&(await this._saveSession(w.session),await this._notifyAllSubscribers("SIGNED_IN",w.session)),this._returnResult({data:Object.assign({},w),error:k})}catch(w){if(Ne(w))return this._returnResult({data:{user:null,session:null},error:w});throw w}}async signInWithSolana(t){var n,r,s,o,a,c,d,f,p,g,y,x;let b,w;if("message"in t)b=t.message,w=t.signature;else{const{chain:k,wallet:S,statement:E,options:j}=t;let O;if(qt())if(typeof S=="object")O=S;else{const T=window;if("solana"in T&&typeof T.solana=="object"&&("signIn"in T.solana&&typeof T.solana.signIn=="function"||"signMessage"in T.solana&&typeof T.solana.signMessage=="function"))O=T.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof S!="object"||!j?.url)throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");O=S}const N=new URL((n=j?.url)!==null&&n!==void 0?n:window.location.href);if("signIn"in O&&O.signIn){const T=await O.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},j?.signInWithSolana),{version:"1",domain:N.host,uri:N.href}),E?{statement:E}:null));let I;if(Array.isArray(T)&&T[0]&&typeof T[0]=="object")I=T[0];else if(T&&typeof T=="object"&&"signedMessage"in T&&"signature"in T)I=T;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in I&&"signature"in I&&(typeof I.signedMessage=="string"||I.signedMessage instanceof Uint8Array)&&I.signature instanceof Uint8Array)b=typeof I.signedMessage=="string"?I.signedMessage:new TextDecoder().decode(I.signedMessage),w=I.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in O)||typeof O.signMessage!="function"||!("publicKey"in O)||typeof O!="object"||!O.publicKey||!("toBase58"in O.publicKey)||typeof O.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");b=[`${N.host} wants you to sign in with your Solana account:`,O.publicKey.toBase58(),...E?["",E,""]:[""],"Version: 1",`URI: ${N.href}`,`Issued At: ${(s=(r=j?.signInWithSolana)===null||r===void 0?void 0:r.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((o=j?.signInWithSolana)===null||o===void 0)&&o.notBefore?[`Not Before: ${j.signInWithSolana.notBefore}`]:[],...!((a=j?.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${j.signInWithSolana.expirationTime}`]:[],...!((c=j?.signInWithSolana)===null||c===void 0)&&c.chainId?[`Chain ID: ${j.signInWithSolana.chainId}`]:[],...!((d=j?.signInWithSolana)===null||d===void 0)&&d.nonce?[`Nonce: ${j.signInWithSolana.nonce}`]:[],...!((f=j?.signInWithSolana)===null||f===void 0)&&f.requestId?[`Request ID: ${j.signInWithSolana.requestId}`]:[],...!((g=(p=j?.signInWithSolana)===null||p===void 0?void 0:p.resources)===null||g===void 0)&&g.length?["Resources",...j.signInWithSolana.resources.map(I=>`- ${I}`)]:[]].join(`
|
|
63
|
+
`);const T=await O.signMessage(new TextEncoder().encode(b),"utf8");if(!T||!(T instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");w=T}}try{const{data:k,error:S}=await De(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:b,signature:As(w)},!((y=t.options)===null||y===void 0)&&y.captchaToken?{gotrue_meta_security:{captcha_token:(x=t.options)===null||x===void 0?void 0:x.captchaToken}}:null),xform:Gn});if(S)throw S;if(!k||!k.session||!k.user){const E=new pi;return this._returnResult({data:{user:null,session:null},error:E})}return k.session&&(await this._saveSession(k.session),await this._notifyAllSubscribers("SIGNED_IN",k.session)),this._returnResult({data:Object.assign({},k),error:S})}catch(k){if(Ne(k))return this._returnResult({data:{user:null,session:null},error:k});throw k}}async _exchangeCodeForSession(t){const n=await bs(this.storage,`${this.storageKey}-code-verifier`),[r,s]=(n??"").split("/");try{if(!r&&this.flowType==="pkce")throw new HP;const{data:o,error:a}=await De(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:t,code_verifier:r},xform:Gn});if(await Vt(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!o||!o.session||!o.user){const c=new pi;return this._returnResult({data:{user:null,session:null,redirectType:null},error:c})}return o.session&&(await this._saveSession(o.session),setTimeout(async()=>{await this._notifyAllSubscribers("SIGNED_IN",o.session)},0)),this._returnResult({data:Object.assign(Object.assign({},o),{redirectType:s??null}),error:a})}catch(o){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(o))return this._returnResult({data:{user:null,session:null,redirectType:null},error:o});throw o}}async signInWithIdToken(t){try{const{options:n,provider:r,token:s,access_token:o,nonce:a}=t,c=await De(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:s,access_token:o,nonce:a,gotrue_meta_security:{captcha_token:n?.captchaToken}},xform:Gn}),{data:d,error:f}=c;if(f)return this._returnResult({data:{user:null,session:null},error:f});if(!d||!d.session||!d.user){const p=new pi;return this._returnResult({data:{user:null,session:null},error:p})}return d.session&&(await this._saveSession(d.session),await this._notifyAllSubscribers("SIGNED_IN",d.session)),this._returnResult({data:d,error:f})}catch(n){if(Ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async signInWithOtp(t){var n,r,s,o,a;try{if("email"in t){const{email:c,options:d}=t;let f=null,p=null;this.flowType==="pkce"&&([f,p]=await mi(this.storage,this.storageKey));const{error:g}=await De(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:c,data:(n=d?.data)!==null&&n!==void 0?n:{},create_user:(r=d?.shouldCreateUser)!==null&&r!==void 0?r:!0,gotrue_meta_security:{captcha_token:d?.captchaToken},code_challenge:f,code_challenge_method:p},redirectTo:d?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:g})}if("phone"in t){const{phone:c,options:d}=t,{data:f,error:p}=await De(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:c,data:(s=d?.data)!==null&&s!==void 0?s:{},create_user:(o=d?.shouldCreateUser)!==null&&o!==void 0?o:!0,gotrue_meta_security:{captcha_token:d?.captchaToken},channel:(a=d?.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:f?.message_id},error:p})}throw new Jl("You must provide either an email or phone number.")}catch(c){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(c))return this._returnResult({data:{user:null,session:null},error:c});throw c}}async verifyOtp(t){var n,r;try{let s,o;"options"in t&&(s=(n=t.options)===null||n===void 0?void 0:n.redirectTo,o=(r=t.options)===null||r===void 0?void 0:r.captchaToken);const{data:a,error:c}=await De(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},t),{gotrue_meta_security:{captcha_token:o}}),redirectTo:s,xform:Gn});if(c)throw c;if(!a)throw new Error("An error occurred on token verification.");const d=a.session,f=a.user;return d?.access_token&&(await this._saveSession(d),await this._notifyAllSubscribers(t.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",d)),this._returnResult({data:{user:f,session:d},error:null})}catch(s){if(Ne(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(t){var n,r,s,o,a;try{let c=null,d=null;this.flowType==="pkce"&&([c,d]=await mi(this.storage,this.storageKey));const f=await De(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in t?{provider_id:t.providerId}:null),"domain"in t?{domain:t.domain}:null),{redirect_to:(r=(n=t.options)===null||n===void 0?void 0:n.redirectTo)!==null&&r!==void 0?r:void 0}),!((s=t?.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:t.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:c,code_challenge_method:d}),headers:this.headers,xform:gO});return!((o=f.data)===null||o===void 0)&&o.url&&qt()&&!(!((a=t.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(f.data.url),this._returnResult(f)}catch(c){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(c))return this._returnResult({data:null,error:c});throw c}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;if(r)throw r;if(!n)throw new jn;const{error:s}=await De(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:n.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(t){if(Ne(t))return this._returnResult({data:{user:null,session:null},error:t});throw t}}async resend(t){try{const n=`${this.url}/resend`;if("email"in t){const{email:r,type:s,options:o}=t,{error:a}=await De(this.fetch,"POST",n,{headers:this.headers,body:{email:r,type:s,gotrue_meta_security:{captcha_token:o?.captchaToken}},redirectTo:o?.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:a})}else if("phone"in t){const{phone:r,type:s,options:o}=t,{data:a,error:c}=await De(this.fetch,"POST",n,{headers:this.headers,body:{phone:r,type:s,gotrue_meta_security:{captcha_token:o?.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a?.message_id},error:c})}throw new Jl("You must provide either an email or phone number and a type")}catch(n){if(Ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async getSession(){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async n=>n))}async _acquireLock(t,n){this._debug("#_acquireLock","begin",t);try{if(this.lockAcquired){const r=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await r,await n()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,t,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const r=n();for(this.pendingInLock.push((async()=>{try{await r}catch{}})()),await r;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await r}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(t){this._debug("#_useSession","begin");try{const n=await this.__loadSession();return await t(n)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let t=null;const n=await bs(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",n),n!==null&&(this._isValidSession(n)?t=n:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!t)return{data:{session:null},error:null};const r=t.expires_at?t.expires_at*1e3-Date.now()<yh:!1;if(this._debug("#__loadSession()",`session has${r?"":" not"} expired`,"expires_at",t.expires_at),!r){if(this.userStorage){const a=await bs(this.userStorage,this.storageKey+"-user");a?.user?t.user=a.user:t.user=_h()}if(this.storage.isServer&&t.user&&!t.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};t.user=hO(t.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:t},error:null}}const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{session:null},error:o}):this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(t){if(t)return await this._getUser(t);await this.initializePromise;const n=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser());return n.data.user&&(this.suppressGetSessionWarning=!0),n}async _getUser(t){try{return t?await De(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:t,xform:Qr}):await this._useSession(async n=>{var r,s,o;const{data:a,error:c}=n;if(c)throw c;return!(!((r=a.session)===null||r===void 0)&&r.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new jn}:await De(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(o=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&o!==void 0?o:void 0,xform:Qr})})}catch(n){if(Ne(n))return VP(n)&&(await this._removeSession(),await Vt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:n});throw n}}async updateUser(t,n={}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(t,n))}async _updateUser(t,n={}){try{return await this._useSession(async r=>{const{data:s,error:o}=r;if(o)throw o;if(!s.session)throw new jn;const a=s.session;let c=null,d=null;this.flowType==="pkce"&&t.email!=null&&([c,d]=await mi(this.storage,this.storageKey));const{data:f,error:p}=await De(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:n?.emailRedirectTo,body:Object.assign(Object.assign({},t),{code_challenge:c,code_challenge_method:d}),jwt:a.access_token,xform:Qr});if(p)throw p;return a.user=f.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(r){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(r))return this._returnResult({data:{user:null},error:r});throw r}}async setSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(t))}async _setSession(t){try{if(!t.access_token||!t.refresh_token)throw new jn;const n=Date.now()/1e3;let r=n,s=!0,o=null;const{payload:a}=vh(t.access_token);if(a.exp&&(r=a.exp,s=r<=n),s){const{data:c,error:d}=await this._callRefreshToken(t.refresh_token);if(d)return this._returnResult({data:{user:null,session:null},error:d});if(!c)return{data:{user:null,session:null},error:null};o=c}else{const{data:c,error:d}=await this._getUser(t.access_token);if(d)throw d;o={access_token:t.access_token,refresh_token:t.refresh_token,user:c.user,token_type:"bearer",expires_in:r-n,expires_at:r},await this._saveSession(o),await this._notifyAllSubscribers("SIGNED_IN",o)}return this._returnResult({data:{user:o.user,session:o},error:null})}catch(n){if(Ne(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}}async refreshSession(t){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(t))}async _refreshSession(t){try{return await this._useSession(async n=>{var r;if(!t){const{data:a,error:c}=n;if(c)throw c;t=(r=a.session)!==null&&r!==void 0?r:void 0}if(!t?.refresh_token)throw new jn;const{data:s,error:o}=await this._callRefreshToken(t.refresh_token);return o?this._returnResult({data:{user:null,session:null},error:o}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(n){if(Ne(n))return this._returnResult({data:{user:null,session:null},error:n});throw n}}async _getSessionFromURL(t,n){try{if(!qt())throw new Xl("No browser detected.");if(t.error||t.error_description||t.error_code)throw new Xl(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});switch(n){case"implicit":if(this.flowType==="pkce")throw new a0("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Xl("Not a valid implicit grant flow url.");break;default:}if(n==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!t.code)throw new a0("No code detected.");const{data:E,error:j}=await this._exchangeCodeForSession(t.code);if(j)throw j;const O=new URL(window.location.href);return O.searchParams.delete("code"),window.history.replaceState(window.history.state,"",O.toString()),{data:{session:E.session,redirectType:null},error:null}}const{provider_token:r,provider_refresh_token:s,access_token:o,refresh_token:a,expires_in:c,expires_at:d,token_type:f}=t;if(!o||!c||!a||!f)throw new Xl("No session defined in URL");const p=Math.round(Date.now()/1e3),g=parseInt(c);let y=p+g;d&&(y=parseInt(d));const x=y-p;x*1e3<=ji&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${x}s, should have been closer to ${g}s`);const b=y-g;p-b>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",b,y,p):p-b<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",b,y,p);const{data:w,error:k}=await this._getUser(o);if(k)throw k;const S={provider_token:r,provider_refresh_token:s,access_token:o,expires_in:g,expires_at:y,refresh_token:a,token_type:f,user:w.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:S,redirectType:t.type},error:null})}catch(r){if(Ne(r))return this._returnResult({data:{session:null,redirectType:null},error:r});throw r}}_isImplicitGrantCallback(t){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),t):!!(t.access_token||t.error_description)}async _isPKCECallback(t){const n=await bs(this.storage,`${this.storageKey}-code-verifier`);return!!(t.code&&n)}async signOut(t={scope:"global"}){return await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(t))}async _signOut({scope:t}={scope:"global"}){return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({error:o});const a=(r=s.session)===null||r===void 0?void 0:r.access_token;if(a){const{error:c}=await this.admin.signOut(a,t);if(c&&!(BP(c)&&(c.status===404||c.status===401||c.status===403)))return this._returnResult({error:c})}return t!=="others"&&(await this._removeSession(),await Vt(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(t){const n=QP(),r={id:n,callback:t,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",n),this.stateChangeEmitters.delete(n)}};return this._debug("#onAuthStateChange()","registered callback with id",n),this.stateChangeEmitters.set(n,r),(async()=>(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(n)})))(),{data:{subscription:r}}}async _emitInitialSession(t){return await this._useSession(async n=>{var r,s;try{const{data:{session:o},error:a}=n;if(a)throw a;await((r=this.stateChangeEmitters.get(t))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",o)),this._debug("INITIAL_SESSION","callback id",t,"session",o)}catch(o){await((s=this.stateChangeEmitters.get(t))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",t,"error",o),console.error(o)}})}async resetPasswordForEmail(t,n={}){let r=null,s=null;this.flowType==="pkce"&&([r,s]=await mi(this.storage,this.storageKey,!0));try{return await De(this.fetch,"POST",`${this.url}/recover`,{body:{email:t,code_challenge:r,code_challenge_method:s,gotrue_meta_security:{captcha_token:n.captchaToken}},headers:this.headers,redirectTo:n.redirectTo})}catch(o){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(o))return this._returnResult({data:null,error:o});throw o}}async getUserIdentities(){var t;try{const{data:n,error:r}=await this.getUser();if(r)throw r;return this._returnResult({data:{identities:(t=n.user.identities)!==null&&t!==void 0?t:[]},error:null})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async linkIdentity(t){return"token"in t?this.linkIdentityIdToken(t):this.linkIdentityOAuth(t)}async linkIdentityOAuth(t){var n;try{const{data:r,error:s}=await this._useSession(async o=>{var a,c,d,f,p;const{data:g,error:y}=o;if(y)throw y;const x=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,t.provider,{redirectTo:(a=t.options)===null||a===void 0?void 0:a.redirectTo,scopes:(c=t.options)===null||c===void 0?void 0:c.scopes,queryParams:(d=t.options)===null||d===void 0?void 0:d.queryParams,skipBrowserRedirect:!0});return await De(this.fetch,"GET",x,{headers:this.headers,jwt:(p=(f=g.session)===null||f===void 0?void 0:f.access_token)!==null&&p!==void 0?p:void 0})});if(s)throw s;return qt()&&!(!((n=t.options)===null||n===void 0)&&n.skipBrowserRedirect)&&window.location.assign(r?.url),this._returnResult({data:{provider:t.provider,url:r?.url},error:null})}catch(r){if(Ne(r))return this._returnResult({data:{provider:t.provider,url:null},error:r});throw r}}async linkIdentityIdToken(t){return await this._useSession(async n=>{var r;try{const{error:s,data:{session:o}}=n;if(s)throw s;const{options:a,provider:c,token:d,access_token:f,nonce:p}=t,g=await De(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(r=o?.access_token)!==null&&r!==void 0?r:void 0,body:{provider:c,id_token:d,access_token:f,nonce:p,link_identity:!0,gotrue_meta_security:{captcha_token:a?.captchaToken}},xform:Gn}),{data:y,error:x}=g;return x?this._returnResult({data:{user:null,session:null},error:x}):!y||!y.session||!y.user?this._returnResult({data:{user:null,session:null},error:new pi}):(y.session&&(await this._saveSession(y.session),await this._notifyAllSubscribers("USER_UPDATED",y.session)),this._returnResult({data:y,error:x}))}catch(s){if(await Vt(this.storage,`${this.storageKey}-code-verifier`),Ne(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;if(a)throw a;return await De(this.fetch,"DELETE",`${this.url}/user/identities/${t.identity_id}`,{headers:this.headers,jwt:(s=(r=o.session)===null||r===void 0?void 0:r.access_token)!==null&&s!==void 0?s:void 0})})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async _refreshAccessToken(t){const n=`#_refreshAccessToken(${t.substring(0,5)}...)`;this._debug(n,"begin");try{const r=Date.now();return await nO(async s=>(s>0&&await tO(200*Math.pow(2,s-1)),this._debug(n,"refreshing attempt",s),await De(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:t},headers:this.headers,xform:Gn})),(s,o)=>{const a=200*Math.pow(2,s);return o&&xh(o)&&Date.now()+a-r<ji})}catch(r){if(this._debug(n,"error",r),Ne(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}finally{this._debug(n,"end")}}_isValidSession(t){return typeof t=="object"&&t!==null&&"access_token"in t&&"refresh_token"in t&&"expires_at"in t}async _handleProviderSignIn(t,n){const r=await this._getUrlForProvider(`${this.url}/authorize`,t,{redirectTo:n.redirectTo,scopes:n.scopes,queryParams:n.queryParams});return this._debug("#_handleProviderSignIn()","provider",t,"options",n,"url",r),qt()&&!n.skipBrowserRedirect&&window.location.assign(r),{data:{provider:t,url:r},error:null}}async _recoverAndRefresh(){var t,n;const r="#_recoverAndRefresh()";this._debug(r,"begin");try{const s=await bs(this.storage,this.storageKey);if(s&&this.userStorage){let a=await bs(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await Ei(this.userStorage,this.storageKey+"-user",a)),s.user=(t=a?.user)!==null&&t!==void 0?t:_h()}else if(s&&!s.user&&!s.user){const a=await bs(this.storage,this.storageKey+"-user");a&&a?.user?(s.user=a.user,await Vt(this.storage,this.storageKey+"-user"),await Ei(this.storage,this.storageKey,s)):s.user=_h()}if(this._debug(r,"session from storage",s),!this._isValidSession(s)){this._debug(r,"session is not valid"),s!==null&&await this._removeSession();return}const o=((n=s.expires_at)!==null&&n!==void 0?n:1/0)*1e3-Date.now()<yh;if(this._debug(r,`session has${o?"":" not"} expired with margin of ${yh}s`),o){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(console.error(a),xh(a)||(this._debug(r,"refresh failed with a non-retryable error, removing the session",a),await this._removeSession()))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:c}=await this._getUser(s.access_token);!c&&a?.user?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(r,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(r,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(r,"error",s),console.error(s);return}finally{this._debug(r,"end")}}async _callRefreshToken(t){var n,r;if(!t)throw new jn;if(this.refreshingDeferred)return this.refreshingDeferred.promise;const s=`#_callRefreshToken(${t.substring(0,5)}...)`;this._debug(s,"begin");try{this.refreshingDeferred=new Gc;const{data:o,error:a}=await this._refreshAccessToken(t);if(a)throw a;if(!o.session)throw new jn;await this._saveSession(o.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",o.session);const c={data:o.session,error:null};return this.refreshingDeferred.resolve(c),c}catch(o){if(this._debug(s,"error",o),Ne(o)){const a={data:null,error:o};return xh(o)||await this._removeSession(),(n=this.refreshingDeferred)===null||n===void 0||n.resolve(a),a}throw(r=this.refreshingDeferred)===null||r===void 0||r.reject(o),o}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(t,n,r=!0){const s=`#_notifyAllSubscribers(${t})`;this._debug(s,"begin",n,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:t,session:n});const o=[],a=Array.from(this.stateChangeEmitters.values()).map(async c=>{try{await c.callback(t,n)}catch(d){o.push(d)}});if(await Promise.all(a),o.length>0){for(let c=0;c<o.length;c+=1)console.error(o[c]);throw o[0]}}finally{this._debug(s,"end")}}async _saveSession(t){this._debug("#_saveSession()",t),this.suppressGetSessionWarning=!0,await Vt(this.storage,`${this.storageKey}-code-verifier`);const n=Object.assign({},t),r=n.user&&n.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!r&&n.user&&await Ei(this.userStorage,this.storageKey+"-user",{user:n.user});const s=Object.assign({},n);delete s.user;const o=h0(s);await Ei(this.storage,this.storageKey,o)}else{const s=h0(n);await Ei(this.storage,this.storageKey,s)}}async _removeSession(){this._debug("#_removeSession()"),this.suppressGetSessionWarning=!1,await Vt(this.storage,this.storageKey),await Vt(this.storage,this.storageKey+"-code-verifier"),await Vt(this.storage,this.storageKey+"-user"),this.userStorage&&await Vt(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const t=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{t&&qt()&&window?.removeEventListener&&window.removeEventListener("visibilitychange",t)}catch(n){console.error("removing visibilitychange callback failed",n)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const t=setInterval(()=>this._autoRefreshTokenTick(),ji);this.autoRefreshTicker=t,t&&typeof t=="object"&&typeof t.unref=="function"?t.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(t);const n=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=n,n&&typeof n=="object"&&typeof n.unref=="function"?n.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(n)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const t=this.autoRefreshTicker;this.autoRefreshTicker=null,t&&clearInterval(t);const n=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,n&&clearTimeout(n)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const t=Date.now();try{return await this._useSession(async n=>{const{data:{session:r}}=n;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((r.expires_at*1e3-t)/ji);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${ji}ms, refresh threshold is ${Ef} ticks`),s<=Ef&&await this._callRefreshToken(r.refresh_token)})}catch(n){console.error("Auto refresh tick failed with error. This is likely a transient error.",n)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(t){if(t.isAcquireTimeout||t instanceof Bw)this._debug("auto refresh token tick lock not available");else throw t}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!qt()||!window?.addEventListener)return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window?.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(t){console.error("_handleVisibilityChange",t)}}async _onVisibilityChanged(t){const n=`#_onVisibilityChanged(${t})`;this._debug(n,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),t||(await this.initializePromise,await this._acquireLock(this.lockAcquireTimeout,async()=>{if(document.visibilityState!=="visible"){this._debug(n,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(t,n,r){const s=[`provider=${encodeURIComponent(n)}`];if(r?.redirectTo&&s.push(`redirect_to=${encodeURIComponent(r.redirectTo)}`),r?.scopes&&s.push(`scopes=${encodeURIComponent(r.scopes)}`),this.flowType==="pkce"){const[o,a]=await mi(this.storage,this.storageKey),c=new URLSearchParams({code_challenge:`${encodeURIComponent(o)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(c.toString())}if(r?.queryParams){const o=new URLSearchParams(r.queryParams);s.push(o.toString())}return r?.skipBrowserRedirect&&s.push(`skip_http_redirect=${r.skipBrowserRedirect}`),`${t}?${s.join("&")}`}async _unenroll(t){try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;return o?this._returnResult({data:null,error:o}):await De(this.fetch,"DELETE",`${this.url}/factors/${t.factorId}`,{headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token})})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async _enroll(t){try{return await this._useSession(async n=>{var r,s;const{data:o,error:a}=n;if(a)return this._returnResult({data:null,error:a});const c=Object.assign({friendly_name:t.friendlyName,factor_type:t.factorType},t.factorType==="phone"?{phone:t.phone}:t.factorType==="totp"?{issuer:t.issuer}:{}),{data:d,error:f}=await De(this.fetch,"POST",`${this.url}/factors`,{body:c,headers:this.headers,jwt:(r=o?.session)===null||r===void 0?void 0:r.access_token});return f?this._returnResult({data:null,error:f}):(t.factorType==="totp"&&d.type==="totp"&&(!((s=d?.totp)===null||s===void 0)&&s.qr_code)&&(d.totp.qr_code=`data:image/svg+xml;utf-8,${d.totp.qr_code}`),this._returnResult({data:d,error:null}))})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async _verify(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({data:null,error:o});const a=Object.assign({challenge_id:t.challengeId},"webauthn"in t?{webauthn:Object.assign(Object.assign({},t.webauthn),{credential_response:t.webauthn.type==="create"?PO(t.webauthn.credential_response):OO(t.webauthn.credential_response)})}:{code:t.code}),{data:c,error:d}=await De(this.fetch,"POST",`${this.url}/factors/${t.factorId}/verify`,{body:a,headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token});return d?this._returnResult({data:null,error:d}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+c.expires_in},c)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",c),this._returnResult({data:c,error:d}))})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}})}async _challenge(t){return this._acquireLock(this.lockAcquireTimeout,async()=>{try{return await this._useSession(async n=>{var r;const{data:s,error:o}=n;if(o)return this._returnResult({data:null,error:o});const a=await De(this.fetch,"POST",`${this.url}/factors/${t.factorId}/challenge`,{body:t,headers:this.headers,jwt:(r=s?.session)===null||r===void 0?void 0:r.access_token});if(a.error)return a;const{data:c}=a;if(c.type!=="webauthn")return{data:c,error:null};switch(c.webauthn.type){case"create":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:AO(c.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},c),{webauthn:Object.assign(Object.assign({},c.webauthn),{credential_options:Object.assign(Object.assign({},c.webauthn.credential_options),{publicKey:RO(c.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}})}async _challengeAndVerify(t){const{data:n,error:r}=await this._challenge({factorId:t.factorId});return r?this._returnResult({data:null,error:r}):await this._verify({factorId:t.factorId,challengeId:n.id,code:t.code})}async _listFactors(){var t;const{data:{user:n},error:r}=await this.getUser();if(r)return{data:null,error:r};const s={all:[],phone:[],totp:[],webauthn:[]};for(const o of(t=n?.factors)!==null&&t!==void 0?t:[])s.all.push(o),o.status==="verified"&&s[o.factor_type].push(o);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(){var t,n;const{data:{session:r},error:s}=await this.getSession();if(s)return this._returnResult({data:null,error:s});if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:o}=vh(r.access_token);let a=null;o.aal&&(a=o.aal);let c=a;((n=(t=r.user.factors)===null||t===void 0?void 0:t.filter(p=>p.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(c="aal2");const f=o.amr||[];return{data:{currentLevel:a,nextLevel:c,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?await De(this.fetch,"GET",`${this.url}/oauth/authorizations/${t}`,{headers:this.headers,jwt:r.access_token,xform:o=>({data:o,error:null})}):this._returnResult({data:null,error:new jn})})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async _approveAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new jn});const a=await De(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:c=>({data:c,error:null})});return a.data&&a.data.redirect_url&&qt()&&!n?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Ne(r))return this._returnResult({data:null,error:r});throw r}}async _denyAuthorization(t,n){try{return await this._useSession(async r=>{const{data:{session:s},error:o}=r;if(o)return this._returnResult({data:null,error:o});if(!s)return this._returnResult({data:null,error:new jn});const a=await De(this.fetch,"POST",`${this.url}/oauth/authorizations/${t}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:c=>({data:c,error:null})});return a.data&&a.data.redirect_url&&qt()&&!n?.skipBrowserRedirect&&window.location.assign(a.data.redirect_url),a})}catch(r){if(Ne(r))return this._returnResult({data:null,error:r});throw r}}async _listOAuthGrants(){try{return await this._useSession(async t=>{const{data:{session:n},error:r}=t;return r?this._returnResult({data:null,error:r}):n?await De(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new jn})})}catch(t){if(Ne(t))return this._returnResult({data:null,error:t});throw t}}async _revokeOAuthGrant(t){try{return await this._useSession(async n=>{const{data:{session:r},error:s}=n;return s?this._returnResult({data:null,error:s}):r?(await De(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,query:{client_id:t.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new jn})})}catch(n){if(Ne(n))return this._returnResult({data:null,error:n});throw n}}async fetchJwk(t,n={keys:[]}){let r=n.keys.find(c=>c.kid===t);if(r)return r;const s=Date.now();if(r=this.jwks.keys.find(c=>c.kid===t),r&&this.jwks_cached_at+$P>s)return r;const{data:o,error:a}=await De(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!o.keys||o.keys.length===0||(this.jwks=o,this.jwks_cached_at=s,r=o.keys.find(c=>c.kid===t),!r)?null:r}async getClaims(t,n={}){try{let r=t;if(!r){const{data:x,error:b}=await this.getSession();if(b||!x.session)return this._returnResult({data:null,error:b});r=x.session.access_token}const{header:s,payload:o,signature:a,raw:{header:c,payload:d}}=vh(r);n?.allowExpired||cO(o.exp);const f=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,n?.keys?{keys:n.keys}:n?.jwks);if(!f){const{error:x}=await this.getUser(r);if(x)throw x;return{data:{claims:o,header:s,signature:a},error:null}}const p=uO(s.alg),g=await crypto.subtle.importKey("jwk",f,p,!0,["verify"]);if(!await crypto.subtle.verify(p,g,a,XP(`${c}.${d}`)))throw new Tf("Invalid JWT signature");return{data:{claims:o,header:s,signature:a},error:null}}catch(r){if(Ne(r))return this._returnResult({data:null,error:r});throw r}}}ya.nextInstanceID={};const BO=ya,VO="2.91.0";let Wo="";typeof Deno<"u"?Wo="deno":typeof document<"u"?Wo="web":typeof navigator<"u"&&navigator.product==="ReactNative"?Wo="react-native":Wo="node";const qO={"X-Client-Info":`supabase-js-${Wo}/${VO}`},HO={headers:qO},KO={schema:"public"},WO={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},GO={};function xa(e){"@babel/helpers - typeof";return xa=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},xa(e)}function JO(e,t){if(xa(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(xa(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(t==="string"?String:Number)(e)}function XO(e){var t=JO(e,"string");return xa(t)=="symbol"?t:t+""}function YO(e,t,n){return(t=XO(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function v0(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(e,s).enumerable})),n.push.apply(n,r)}return n}function wt(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?v0(Object(n),!0).forEach(function(r){YO(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):v0(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}const QO=e=>e?(...t)=>e(...t):(...t)=>fetch(...t),ZO=()=>Headers,eL=(e,t,n)=>{const r=QO(n),s=ZO();return async(o,a)=>{var c;const d=(c=await t())!==null&&c!==void 0?c:e;let f=new s(a?.headers);return f.has("apikey")||f.set("apikey",e),f.has("Authorization")||f.set("Authorization",`Bearer ${d}`),r(o,wt(wt({},a),{},{headers:f}))}};function tL(e){return e.endsWith("/")?e:e+"/"}function nL(e,t){var n,r;const{db:s,auth:o,realtime:a,global:c}=e,{db:d,auth:f,realtime:p,global:g}=t,y={db:wt(wt({},d),s),auth:wt(wt({},f),o),realtime:wt(wt({},p),a),storage:{},global:wt(wt(wt({},g),c),{},{headers:wt(wt({},(n=g?.headers)!==null&&n!==void 0?n:{}),(r=c?.headers)!==null&&r!==void 0?r:{})}),accessToken:async()=>""};return e.accessToken?y.accessToken=e.accessToken:delete y.accessToken,y}function rL(e){const t=e?.trim();if(!t)throw new Error("supabaseUrl is required.");if(!t.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(tL(t))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var sL=class extends BO{constructor(e){super(e)}},iL=class{constructor(e,t,n){var r,s;this.supabaseUrl=e,this.supabaseKey=t;const o=rL(e);if(!t)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",o),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",o),this.storageUrl=new URL("storage/v1",o),this.functionsUrl=new URL("functions/v1",o);const a=`sb-${o.hostname.split(".")[0]}-auth-token`,c={db:KO,realtime:GO,auth:wt(wt({},WO),{},{storageKey:a}),global:HO},d=nL(n??{},c);if(this.storageKey=(r=d.auth.storageKey)!==null&&r!==void 0?r:"",this.headers=(s=d.global.headers)!==null&&s!==void 0?s:{},d.accessToken)this.accessToken=d.accessToken,this.auth=new Proxy({},{get:(p,g)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(g)} is not possible`)}});else{var f;this.auth=this._initSupabaseAuthClient((f=d.auth)!==null&&f!==void 0?f:{},this.headers,d.global.fetch)}this.fetch=eL(t,this._getAccessToken.bind(this),d.global.fetch),this.realtime=this._initRealtimeClient(wt({headers:this.headers,accessToken:this._getAccessToken.bind(this)},d.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(p=>this.realtime.setAuth(p)).catch(p=>console.warn("Failed to set initial Realtime auth token:",p)),this.rest=new zR(new URL("rest/v1",o).href,{headers:this.headers,schema:d.db.schema,fetch:this.fetch}),this.storage=new IP(this.storageUrl.href,this.headers,this.fetch,n?.storage),d.accessToken||this._listenForAuthEvents()}get functions(){return new OR(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},n={head:!1,get:!1,count:void 0}){return this.rest.rpc(e,t,n)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var e=this,t,n;if(e.accessToken)return await e.accessToken();const{data:r}=await e.auth.getSession();return(t=(n=r.session)===null||n===void 0?void 0:n.access_token)!==null&&t!==void 0?t:e.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,storageKey:o,flowType:a,lock:c,debug:d,throwOnError:f},p,g){const y={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new sL({url:this.authUrl.href,headers:wt(wt({},y),p),storageKey:o,autoRefreshToken:e,persistSession:t,detectSessionInUrl:n,storage:r,userStorage:s,flowType:a,lock:c,debug:d,throwOnError:f,fetch:g,hasCustomAuthorizationHeader:Object.keys(this.headers).some(x=>x.toLowerCase()==="authorization")})}_initRealtimeClient(e){return new tP(this.realtimeUrl.href,wt(wt({},e),{},{params:wt(wt({},{apikey:this.supabaseKey}),e?.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",t?.access_token)})}_handleTokenChanged(e,t,n){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==n?(this.changedAccessToken=n,this.realtime.setAuth(n)):e==="SIGNED_OUT"&&(this.realtime.setAuth(),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const Hw=(e,t,n)=>new iL(e,t,n);function oL(){if(typeof window<"u")return!1;const e=globalThis.process;if(!e)return!1;const t=e.version;if(t==null)return!1;const n=t.match(/^v(\d+)\./);return n?parseInt(n[1],10)<=18:!1}oL()&&console.warn("⚠️ Node.js 18 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to Node.js 20 or later. For more information, visit: https://github.com/orgs/supabase/discussions/37217");const Jc="alchemy_supabase_config";function Zr(){try{const e=localStorage.getItem(Jc);if(e)return JSON.parse(e)}catch(e){console.error("Error reading Supabase config:",e)}return null}function _0(e){try{localStorage.setItem(Jc,JSON.stringify(e))}catch(t){console.error("Error saving Supabase config:",t)}}function aL(){try{localStorage.removeItem(Jc)}catch(e){console.error("Error clearing Supabase config:",e)}}async function lL(e,t){try{if(!e.startsWith("http://")&&!e.startsWith("https://"))return{valid:!1,error:"Invalid URL format"};const n=t.startsWith("eyJ"),r=t.startsWith("sb_publishable_");if(!n&&!r)return{valid:!1,error:"Invalid API key format"};if(r)return{valid:!0};const s=await fetch(`${e}/rest/v1/`,{method:"GET",headers:{apikey:t,Authorization:`Bearer ${t}`}});return s.ok?{valid:!0}:s.status===401||s.status===403?{valid:!1,error:"Invalid API key"}:{valid:!1,error:`Connection failed: ${s.statusText}`}}catch(n){return{valid:!1,error:n instanceof Error?n.message:"Connection failed"}}}function cL(){return localStorage.getItem(Jc)?"ui":"none"}const Lp=Zr(),uL=Lp?.url||void 0||"https://placeholder.supabase.co",dL=Lp?.anonKey||void 0||"placeholder",oe=Hw(uL,dL,{auth:{persistSession:!0,autoRefreshToken:!0,detectSessionInUrl:!0}}),b0=!!Lp?.url;function hL({length:e=6,value:t,onChange:n,onComplete:r,disabled:s=!1,error:o=!1}){const a=R.useRef([]),[c,d]=R.useState(null),f=(y,x)=>{const b=x.replace(/[^0-9]/g,"");if(b.length===0){const S=t.split("");y<S.length&&S.splice(y,1);const E=S.join("");n(E),y>0&&a.current[y-1]?.focus();return}const w=[...t];w[y]=b[0];const k=w.join("");n(k),y<e-1&&b!==""&&a.current[y+1]?.focus(),k.length===e&&r&&r(k)},p=(y,x)=>{x.key==="Backspace"&&!t[y]&&y>0||x.key==="ArrowLeft"&&y>0?a.current[y-1]?.focus():x.key==="ArrowRight"&&y<e-1&&a.current[y+1]?.focus()},g=y=>{y.preventDefault();const b=y.clipboardData.getData("text/plain").replace(/[^0-9]/g,"").slice(0,e);n(b);const w=Math.min(b.length,e-1);a.current[w]?.focus(),b.length===e&&r&&r(b)};return u.jsx("div",{className:"flex gap-2 justify-center",children:Array.from({length:e}).map((y,x)=>u.jsx("input",{ref:b=>{a.current[x]=b},type:"text",inputMode:"numeric",maxLength:1,value:t[x]||"",onChange:b=>f(x,b.target.value),onKeyDown:b=>p(x,b),onPaste:g,onFocus:()=>d(x),onBlur:()=>d(null),disabled:s,className:`
|
|
64
|
+
w-10 h-10 sm:w-12 sm:h-12 text-center text-lg font-black
|
|
65
|
+
bg-black/20 border border-border/50 rounded-xl outline-none transition-all
|
|
66
|
+
${o?"border-error/50 shadow-[0_0_15px_rgba(239,68,68,0.1)]":"focus:border-primary/50"}
|
|
67
|
+
${c===x?"border-primary/50 bg-black/40 scale-105":""}
|
|
68
|
+
disabled:opacity-50 disabled:cursor-not-allowed
|
|
69
|
+
`,"aria-label":`Digit ${x+1}`},x))})}const wh=[{code:"en",label:"English",flag:"🇺🇸"},{code:"fr",label:"Français",flag:"🇫🇷"},{code:"es",label:"Español",flag:"🇪🇸"},{code:"ko",label:"한국어",flag:"🇰🇷"},{code:"ja",label:"日本語",flag:"🇯🇵"},{code:"vi",label:"Tiếng Việt",flag:"🇻🇳"}];function Ip({collapsed:e=!1,position:t="bottom"}){const{i18n:n}=Ze(),[r,s]=R.useState(!1),o=R.useRef(null),a=wh.find(d=>d.code===n.language)||wh[0];R.useEffect(()=>{const d=f=>{o.current&&!o.current.contains(f.target)&&s(!1)};return document.addEventListener("mousedown",d),()=>document.removeEventListener("mousedown",d)},[]);const c=d=>{n.changeLanguage(d),s(!1)};return u.jsxs("div",{className:"relative",ref:o,children:[u.jsxs("button",{onClick:()=>s(!r),className:`flex items-center gap-2 px-3 py-1.5 rounded-lg bg-surface/50 border border-border hover:bg-surface hover:border-primary/30 transition-all text-xs font-medium text-fg/70 ${e?"justify-center px-1.5":""}`,title:e?a.label:void 0,children:[!e&&u.jsx(Tj,{size:14,className:"text-primary"}),u.jsx("span",{children:a.flag}),!e&&u.jsxs(u.Fragment,{children:[u.jsx("span",{className:"hidden sm:inline",children:a.label}),u.jsx(Is,{size:12,className:`transition-transform duration-300 ${r?"rotate-180":""}`})]})]}),u.jsx(It,{children:r&&u.jsx(Le.div,{initial:{opacity:0,y:t==="top"?-10:10,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:t==="top"?-10:10,scale:.95},className:`absolute ${e?"left-0":"right-0"} ${t==="top"?"bottom-full mb-2":"top-full mt-2"} w-48 bg-surface border border-border rounded-xl shadow-2xl z-[9999] overflow-y-auto max-h-[280px] custom-scrollbar`,children:u.jsx("div",{className:"py-1",children:wh.map(d=>u.jsxs("button",{onClick:()=>c(d.code),className:"flex items-center justify-between w-full px-4 py-2.5 text-xs text-left hover:bg-bg transition-colors",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("span",{children:d.flag}),u.jsx("span",{className:d.code===n.language?"text-primary font-bold":"text-fg/70",children:d.label})]}),d.code===n.language&&u.jsx(Ps,{size:14,className:"text-primary"})]},d.code))})})})]})}function fL({onAuthSuccess:e,isInitialized:t=!0}){const{t:n}=Ze(),[r,s]=R.useState(""),[o,a]=R.useState(""),[c,d]=R.useState(""),[f,p]=R.useState(""),[g,y]=R.useState(!1),[x,b]=R.useState(!t),[w,k]=R.useState(null),[S,E]=R.useState("password"),[j,O]=R.useState("email"),[N,T]=R.useState(""),I=async U=>{U.preventDefault(),y(!0),k(null);try{if(x){const{error:D}=await oe.auth.signUp({email:r,password:o,options:{data:{first_name:c,last_name:f,full_name:`${c} ${f}`.trim()}}});if(D)throw D;e()}else if(S==="password"){const{error:D}=await oe.auth.signInWithPassword({email:r,password:o});if(D)throw D;e()}else if(S==="otp")if(j==="email"){const{error:D}=await oe.auth.signInWithOtp({email:r,options:{shouldCreateUser:!1}});if(D)throw D;O("verify")}else await V()}catch(D){k(D.message)}finally{y(!1)}},V=async()=>{y(!0),k(null);try{const{data:U,error:D}=await oe.auth.verifyOtp({email:r,token:N,type:"magiclink"});if(D)throw D;if(!U.session)throw new Error("Failed to create session");e()}catch(U){k(U.message||n("auth.invalid_code"))}finally{y(!1)}};return u.jsx("div",{className:"flex flex-col items-center justify-center p-8 h-full bg-gradient-to-t from-bg to-bg/50",children:u.jsxs(Le.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"w-full max-w-xl glass p-12 space-y-10 relative",children:[u.jsx("div",{className:"absolute top-4 right-4 z-50",children:u.jsx(Ip,{position:"bottom"})}),u.jsxs("div",{className:"text-center space-y-2 pt-2",children:[u.jsx("h2",{className:"text-3xl font-black italic tracking-tighter uppercase",children:n(!t&&x?"auth.title_init":x?"auth.title_join":S==="otp"?"auth.title_mystic":"auth.title_login")}),u.jsx("p",{className:"text-xs text-fg/40 font-mono tracking-widest uppercase",children:n(!t&&x?"auth.desc_init":S==="otp"?j==="email"?"auth.desc_mystic_email":"auth.desc_mystic_code":"auth.desc_login")})]}),u.jsx("form",{onSubmit:I,className:"space-y-4",children:u.jsxs(It,{mode:"wait",children:[x&&u.jsxs(Le.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"grid grid-cols-2 gap-4 overflow-hidden",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:n("auth.first_name")}),u.jsx("input",{type:"text",value:c,onChange:U=>d(U.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:n("auth.first_name_placeholder"),required:!0})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:n("auth.last_name")}),u.jsx("input",{type:"text",value:f,onChange:U=>p(U.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:n("auth.last_name_placeholder"),required:!0})]})]},"signup-fields"),S==="otp"&&j==="verify"?u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6 py-4",children:[u.jsx("div",{className:"flex justify-center",children:u.jsx(hL,{value:N,onChange:T,length:6,onComplete:U=>{T(U)},error:!!w})}),u.jsx("button",{type:"button",onClick:()=>O("email"),className:"w-full text-[10px] font-bold uppercase text-primary/40 hover:text-primary transition-colors tracking-widest",children:n("auth.change_email")}),u.jsxs("button",{type:"button",disabled:g||N.length!==6,onClick:V,className:"w-full py-4 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center justify-center gap-2",children:[g?u.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}):u.jsx(Yy,{size:18}),n("auth.verify_code")]})]},"otp-verify"):u.jsxs(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:n("auth.email_address")}),u.jsxs("div",{className:"relative",children:[u.jsx(Pj,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg/20",size:16}),u.jsx("input",{type:"email",value:r,onChange:U=>s(U.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 pl-10 pr-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:n("auth.email_placeholder"),required:!0})]})]}),(x||S==="password")&&u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:n("auth.complexity_key")}),u.jsxs("div",{className:"relative",children:[u.jsx(Rj,{className:"absolute left-3 top-1/2 -translate-y-1/2 text-fg/20",size:16}),u.jsx("input",{type:"password",value:o,onChange:U=>a(U.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 pl-10 pr-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:n("auth.password_placeholder"),required:!0})]})]}),u.jsxs("button",{type:"submit",disabled:g,className:"w-full py-4 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center justify-center gap-2",children:[g&&u.jsx("div",{className:"w-4 h-4 border-2 border-white/30 border-t-white rounded-full animate-spin"}),x?u.jsx(Vj,{size:18}):u.jsx(Yy,{size:18}),n(x?"auth.init_account":S==="otp"?"auth.send_code":"auth.unseal_engine")]})]},"base-login")]})}),w&&S==="password"&&u.jsx(Le.p,{initial:{opacity:0},animate:{opacity:1},className:"text-xs text-error font-medium bg-error/10 p-3 rounded-lg border border-error/10",children:w}),u.jsxs("div",{className:"space-y-4",children:[!x&&u.jsx("div",{className:"flex flex-col gap-2",children:S==="password"?u.jsxs("button",{type:"button",onClick:()=>{E("otp"),O("email"),k(null)},className:"w-full flex items-center justify-center gap-2 py-3 glass hover:bg-surface text-xs font-bold uppercase tracking-widest transition-all text-fg/40 hover:text-primary",children:[u.jsx(Ej,{size:16})," ",n("auth.sign_in_code")]}):u.jsxs("button",{type:"button",onClick:()=>{E("password"),k(null)},className:"w-full flex items-center justify-center gap-2 py-3 glass hover:bg-surface text-xs font-bold uppercase tracking-widest transition-all text-fg/40 hover:text-primary",children:[u.jsx(g_,{size:16})," ",n("auth.sign_in_password")]})}),u.jsxs("p",{className:"text-center text-xs text-fg/40",children:[n(x?"auth.already_alchemist":"auth.new_to_alchemy")," "," ",u.jsx("button",{onClick:()=>{b(!x),E("password"),k(null)},className:"text-primary font-bold hover:underline",children:n(x?"auth.login_instead":"auth.create_account")})]})]})]})})}function pL(e){const t=e.trim();return t?t.startsWith("http://")||t.startsWith("https://")?t:`https://${t}.supabase.co`:""}function mL(e){const t=e.match(/https?:\/\/([^.]+)\.supabase\.co/);return t?t[1]:""}function Kw({onComplete:e,open:t=!0,canClose:n=!1}){const{t:r}=Ze(),[s,o]=R.useState("welcome"),[a,c]=R.useState(""),[d,f]=R.useState(""),[p,g]=R.useState(""),[y,x]=R.useState(""),[b,w]=R.useState([]),[k,S]=R.useState(""),[E,j]=R.useState(!1),[O,N]=R.useState([]),[T,I]=R.useState(null),[V,U]=R.useState(!1),[D,Z]=R.useState("Alchemy Engine"),[Y,he]=R.useState("us-east-1"),[G,W]=R.useState([]),[ne,re]=R.useState("idle"),J=R.useRef(null);if(R.useEffect(()=>{J.current?.scrollIntoView({behavior:"smooth"})},[G]),!t)return null;const ce=async()=>{I(null),U(!0),o("validating");const te=pL(a),me=d.trim(),ye=await lL(te,me);if(ye.valid){_0({url:te,anonKey:me});try{const Ae=Hw(te,me),{data:Ie,error:Te}=await Ae.from("init_state").select("is_initialized").single();if(!Te&&Ie&&Ie.is_initialized>0){o("success"),setTimeout(()=>{window.location.reload()},1500);return}}catch{console.log("[SetupWizard] init_state check failed, showing migration step")}const Fe=mL(te);g(Fe),o("migration"),U(!1)}else I(ye.error||r("common.error")),o("credentials"),U(!1)},A=async()=>{if(y){j(!0),I(null);try{const te=await fetch("/api/setup/organizations",{headers:{Authorization:`Bearer ${y}`}}),me=await te.json();te.ok?(w(me),me.length>0&&S(me[0].id)):I(me.error||"Failed to fetch organizations")}catch(te){I(te.message||"Connection error")}finally{j(!1)}}},M=async()=>{if(!(!k||!y)){I(null),N([]),o("provisioning");try{const me=(await fetch("/api/setup/auto-provision",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${y}`},body:JSON.stringify({orgId:k,projectName:D,region:Y})})).body?.getReader(),ye=new TextDecoder;if(!me)throw new Error("Stream error");for(;;){const{done:Fe,value:Ae}=await me.read();if(Fe)break;const Te=ye.decode(Ae).split(`
|
|
70
|
+
|
|
71
|
+
`);for(const Je of Te){if(!Je.trim())continue;const et=Je.split(`
|
|
72
|
+
`).find(Ce=>Ce.startsWith("data: "));if(et)try{const Ce=JSON.parse(et.slice(6));if(Ce.type==="success"){const{url:gt,anonKey:X,projectId:ke}=Ce.data;c(gt),f(X),g(ke),_0({url:gt,anonKey:X}),setTimeout(()=>{K(ke,y)},500);return}else if(Ce.type==="error"){I(Ce.data),o("quick-setup");return}else N(gt=>[...gt,Ce.data])}catch{}}}}catch(te){I(te.message||"Auto-provisioning failed"),o("quick-setup")}}},K=async(te,me)=>{const ye=te||p,Fe=me||y;if(!ye){I(r("setup.project_id_required"));return}if(!Fe){I(r("setup.access_token_required"));return}I(null),W([]),re("running"),o("migrating");try{const Ie=(await fetch("/api/migrate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:ye,accessToken:Fe})})).body?.getReader(),Te=new TextDecoder;if(!Ie)throw new Error(r("setup.stream_error"));for(;;){const{done:Je,value:et}=await Ie.read();if(Je)break;const gt=Te.decode(et).split(`
|
|
73
|
+
`).filter(X=>X.startsWith("data: "));for(const X of gt)try{const ke=JSON.parse(X.slice(6));ke.type==="done"?ke.data==="success"?(re("success"),o("success"),setTimeout(()=>{window.location.reload()},2e3)):(re("failed"),I(r("setup.migration_failed_logs"))):W(ee=>[...ee,ke.data])}catch{}}}catch(Ae){re("failed"),I(Ae.message||"Migration failed"),W(Ie=>[...Ie,`Error: ${Ae.message}`])}},P=()=>{o("success"),setTimeout(()=>{window.location.reload()},1500)};return u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-bg/80 backdrop-blur-sm",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:"w-full max-w-xl glass p-12 space-y-10 relative",children:[u.jsx("div",{className:"absolute top-4 right-4 z-50",children:u.jsx(Ip,{position:"bottom"})}),u.jsx("div",{className:"absolute top-0 right-0 w-64 h-64 bg-primary/10 rounded-full blur-3xl -translate-y-1/2 translate-x-1/2 pointer-events-none"}),u.jsxs(It,{mode:"wait",children:[s==="welcome"&&u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 bg-primary/10 rounded-xl",children:u.jsx(jr,{className:"w-6 h-6 text-primary"})}),u.jsx("div",{className:"flex-1",children:u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter uppercase",children:r("setup.welcome_title")})})]}),u.jsx("p",{className:"text-sm text-fg/50 font-medium",children:r("setup.welcome_desc")})]}),u.jsxs("div",{className:"glass bg-white/5 border-white/10 p-4 rounded-xl space-y-3",children:[u.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-primary/70",children:r("setup.requirements")}),u.jsxs("ul",{className:"space-y-2",children:[u.jsxs("li",{className:"flex items-center gap-2 text-sm text-fg/60",children:[u.jsx(Ps,{className:"w-4 h-4 text-emerald-500"})," ",r("setup.project_url")]}),u.jsxs("li",{className:"flex items-center gap-2 text-sm text-fg/60",children:[u.jsx(Ps,{className:"w-4 h-4 text-emerald-500"})," ",r("setup.anon_key")]}),u.jsxs("li",{className:"flex items-center gap-2 text-sm text-fg/60",children:[u.jsx(Ps,{className:"w-4 h-4 text-emerald-500"})," ",r("account.credentials")]})]})]}),u.jsxs("div",{className:"flex flex-col gap-3",children:[u.jsxs("a",{href:"https://supabase.com",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 py-3 border border-border/20 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-white/5 transition-all text-fg/60",children:[r("setup.forge_project")," ",u.jsx(es,{size:14})]}),u.jsxs("button",{onClick:()=>o("type-selection"),className:"w-full py-4 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.01] active:scale-95 transition-all flex items-center justify-center gap-2",children:[r("setup.begin_init")," ",u.jsx(tc,{size:18})]})]})]},"welcome"),s==="type-selection"&&u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2 text-center mb-8",children:[u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter uppercase",children:r("setup.choose_setup_path")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium lowercase",children:r("setup.forge_how")})]}),u.jsxs("div",{className:"grid grid-cols-1 gap-4",children:[u.jsxs("button",{onClick:()=>o("quick-setup"),className:"group relative p-6 glass bg-primary/5 border-primary/20 hover:border-primary/50 text-left transition-all rounded-2xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx("div",{className:"p-3 bg-primary/10 rounded-xl group-hover:scale-110 transition-transform",children:u.jsx(Ft,{className:"w-6 h-6 text-primary"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold uppercase tracking-tight",children:r("setup.quick_launch")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium",children:r("setup.quick_launch_desc")})]})]}),u.jsx("div",{className:"absolute right-6 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 group-hover:translate-x-1 transition-all",children:u.jsx(tc,{className:"w-5 h-5 text-primary"})})]}),u.jsxs("button",{onClick:()=>o("credentials"),className:"group relative p-6 glass bg-white/5 border-white/10 hover:border-white/30 text-left transition-all rounded-2xl",children:[u.jsxs("div",{className:"flex items-start gap-4",children:[u.jsx("div",{className:"p-3 bg-white/5 rounded-xl group-hover:scale-110 transition-transform",children:u.jsx(jr,{className:"w-6 h-6 text-fg/50"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"text-lg font-bold uppercase tracking-tight",children:r("setup.manual_connection")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium lowercase",children:r("setup.manual_connection_desc")})]})]}),u.jsx("div",{className:"absolute right-6 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 group-hover:translate-x-1 transition-all",children:u.jsx(tc,{className:"w-5 h-5 text-fg/30"})})]})]}),u.jsx("button",{onClick:()=>o("welcome"),className:"w-full py-4 text-xs font-bold uppercase tracking-widest text-fg/30 hover:text-fg/60 transition-colors",children:r("common.back")})]},"type-selection"),s==="quick-setup"&&u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter uppercase",children:r("setup.quick_launch")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium lowercase",children:r("setup.quick_provision_desc")})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsxs("div",{className:"flex justify-between items-center px-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30",children:r("setup.access_token")}),u.jsxs("a",{href:"https://supabase.com/dashboard/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary hover:underline font-bold",children:[r("setup.get_token")," ",u.jsx(es,{size:10,className:"inline ml-1"})]})]}),u.jsx("input",{type:"password",value:y,onChange:te=>x(te.target.value),onBlur:A,className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all font-mono",placeholder:"sbp_..."})]}),b.length>0&&u.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-top-2 duration-300",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.project_name")}),u.jsx("input",{type:"text",value:D,onChange:te=>Z(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:r("setup.project_name_placeholder")})]}),u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.organization")}),u.jsx("select",{value:k,onChange:te=>S(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all appearance-none",children:b.map(te=>u.jsx("option",{value:te.id,children:te.name},te.id))})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.region")}),u.jsxs("select",{value:Y,onChange:te=>he(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all appearance-none",children:[u.jsx("option",{value:"us-east-1",children:r("setup.regions.us-east-1")}),u.jsx("option",{value:"us-west-1",children:r("setup.regions.us-west-1")}),u.jsx("option",{value:"eu-central-1",children:r("setup.regions.eu-central-1")}),u.jsx("option",{value:"eu-west-2",children:r("setup.regions.eu-west-2")}),u.jsx("option",{value:"ap-southeast-1",children:r("setup.regions.ap-southeast-1")}),u.jsx("option",{value:"ap-southeast-2",children:r("setup.regions.ap-southeast-2")}),u.jsx("option",{value:"sa-east-1",children:r("setup.regions.sa-east-1")})]})]})]})]})]}),T&&u.jsxs("div",{className:"bg-error/10 border border-error/20 p-3 rounded-xl flex items-center gap-3",children:[u.jsx(ar,{className:"w-5 h-5 text-error"}),u.jsx("p",{className:"text-xs text-error font-bold tracking-tight",children:T})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>o("type-selection"),className:"flex-1 py-4 border border-border/20 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-white/5 transition-all text-fg/40",children:r("common.back")}),u.jsxs("button",{onClick:M,disabled:!y||!k||E,className:"flex-[2] py-4 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.01] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale flex items-center justify-center gap-2",children:[E?u.jsx(Ct,{className:"animate-spin w-5 h-5"}):u.jsx(ex,{size:18}),r("setup.launch_engine")]})]})]},"quick-setup"),s==="provisioning"&&u.jsxs(Le.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Ct,{className:"w-6 h-6 animate-spin text-primary"}),u.jsx("h2",{className:"text-xl font-black italic tracking-tighter uppercase",children:r("setup.provisioning_forge")})]}),u.jsx("p",{className:"text-sm text-fg/40 lowercase",children:r("setup.building_instance")})]}),u.jsxs("div",{className:"bg-black/40 border border-primary/10 rounded-xl p-4 h-64 overflow-y-auto font-mono text-xs",children:[O.map((te,me)=>u.jsx("div",{className:"py-0.5 text-fg/60 animate-in fade-in slide-in-from-left-2 duration-300",children:te},me)),u.jsx("div",{ref:J})]})]},"provisioning"),s==="credentials"&&u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter uppercase",children:r("setup.credentials_title")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium lowercase",children:r("setup.credentials_desc")})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.project_url")}),u.jsx("input",{type:"text",value:a,onChange:te=>c(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:r("setup.project_url_placeholder")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.anon_key")}),u.jsx("input",{type:"password",value:d,onChange:te=>f(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all",placeholder:r("setup.anon_key_placeholder")})]})]}),T&&u.jsxs("div",{className:"bg-error/10 border border-error/20 p-3 rounded-xl flex items-center gap-3",children:[u.jsx(ar,{className:"w-5 h-5 text-error"}),u.jsx("p",{className:"text-xs text-error font-bold tracking-tight",children:T})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:()=>o("welcome"),className:"flex-1 py-4 border border-border/20 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-white/5 transition-all text-fg/40",children:r("common.back")}),u.jsxs("button",{onClick:ce,disabled:!a||!d,className:"flex-[2] py-4 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.01] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale flex items-center justify-center gap-2",children:[r("setup.connect_essence")," ",u.jsx(Ft,{size:18})]})]})]},"credentials"),s==="validating"&&u.jsxs(Le.div,{initial:{opacity:0},animate:{opacity:1},className:"flex flex-col items-center justify-center py-12 space-y-6",children:[u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 bg-primary/20 blur-xl rounded-full"}),u.jsx(Ct,{className:"w-16 h-16 animate-spin text-primary relative z-10"})]}),u.jsxs("div",{className:"text-center space-y-2",children:[u.jsx("h3",{className:"text-xl font-bold italic uppercase tracking-tighter",children:r("setup.validating")}),u.jsx("p",{className:"text-sm text-fg/40 font-mono tracking-widest uppercase animate-pulse",children:r("setup.resonance")})]})]},"validating"),s==="migration"&&u.jsxs(Le.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},exit:{opacity:0,x:-20},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 bg-accent/10 rounded-xl",children:u.jsx(zi,{className:"w-6 h-6 text-accent"})}),u.jsx("div",{className:"flex-1",children:u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter uppercase",children:r("setup.init_schema")})})]}),u.jsx("p",{className:"text-sm text-fg/50 font-medium",children:r("setup.schema_desc")})]}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.project_id")}),u.jsx("input",{type:"text",value:p,onChange:te=>g(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all font-mono",placeholder:r("setup.project_id_placeholder")}),u.jsx("p",{className:"text-[10px] text-fg/30 ml-1",children:r("setup.project_id_help")})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:r("setup.access_token")}),u.jsx("input",{type:"password",value:y,onChange:te=>x(te.target.value),className:"w-full bg-black/20 border border-border/20 rounded-xl py-3 px-4 text-sm focus:border-primary/50 outline-none transition-all font-mono",placeholder:r("setup.access_token_placeholder")}),u.jsxs("p",{className:"text-[10px] text-fg/30 ml-1",children:["Generate at"," ",u.jsx("a",{href:"https://supabase.com/dashboard/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-accent hover:underline",children:r("setup.access_token_link")})]})]})]}),T&&u.jsxs("div",{className:"bg-error/10 border border-error/20 p-3 rounded-xl flex items-center gap-3",children:[u.jsx(ar,{className:"w-5 h-5 text-error"}),u.jsx("p",{className:"text-xs text-error font-bold tracking-tight",children:T})]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsx("button",{onClick:P,className:"flex-1 py-4 border border-border/20 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-white/5 transition-all text-fg/40",children:r("common.skip")}),u.jsxs("button",{onClick:K,disabled:!p||!y,className:"flex-[2] py-4 bg-gradient-to-r from-accent to-primary text-white font-bold rounded-xl shadow-lg glow-accent hover:scale-[1.01] active:scale-95 transition-all disabled:opacity-50 disabled:grayscale flex items-center justify-center gap-2",children:[u.jsx(ex,{size:18})," ",r("setup.run_migrations")]})]})]},"migration"),s==="migrating"&&u.jsxs(Le.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(Ct,{className:"w-6 h-6 animate-spin text-accent"}),u.jsx("h2",{className:"text-xl font-black italic tracking-tighter uppercase",children:r("setup.running_migrations")})]}),u.jsx("p",{className:"text-sm text-fg/40",children:r("setup.take_minute")})]}),u.jsxs("div",{className:"bg-black/40 border border-border/20 rounded-xl p-4 h-64 overflow-y-auto font-mono text-xs",children:[G.map((te,me)=>u.jsx("div",{className:`py-0.5 ${te.includes("✅")||te.includes("SUCCESS")?"text-emerald-400":te.includes("❌")||te.includes("Error")?"text-red-400":te.includes("⚠️")?"text-amber-400":"text-fg/60"}`,children:te},me)),u.jsx("div",{ref:J})]}),ne==="failed"&&u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("button",{onClick:()=>o("migration"),className:"flex-1 py-3 border border-border/20 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-white/5 transition-all text-fg/40",children:[u.jsx(g_,{size:14,className:"inline mr-2"})," ",r("setup.back")]}),u.jsx("button",{onClick:K,className:"flex-1 py-3 bg-accent/20 border border-accent/30 rounded-xl text-xs font-bold uppercase tracking-widest hover:bg-accent/30 transition-all text-accent",children:r("setup.retry")})]})]},"migrating"),s==="success"&&u.jsxs(Le.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"flex flex-col items-center justify-center py-12 space-y-6",children:[u.jsx("div",{className:"p-4 bg-emerald-500/20 rounded-full",children:u.jsx(Rs,{className:"w-16 h-16 text-emerald-500"})}),u.jsxs("div",{className:"text-center space-y-2",children:[u.jsx("h3",{className:"text-2xl font-black italic uppercase tracking-tighter",children:r("setup.engine_aligned")}),u.jsx("p",{className:"text-sm text-fg/40 font-mono tracking-widest uppercase",children:r("setup.restarting")})]})]},"success")]})]})})}const Gr={chrome:{icon:u.jsx(Jy,{size:18}),name:"Google Chrome",color:"text-yellow-500"},firefox:{icon:u.jsx(Io,{size:18}),name:"Mozilla Firefox",color:"text-orange-500"},safari:{icon:u.jsx(Io,{size:18}),name:"Safari",color:"text-blue-500"},edge:{icon:u.jsx(Io,{size:18}),name:"Microsoft Edge",color:"text-cyan-500"},brave:{icon:u.jsx(Ft,{size:18}),name:"Brave",color:"text-orange-400"},arc:{icon:u.jsx(Ft,{size:18}),name:"Arc",color:"text-purple-500"},vivaldi:{icon:u.jsx(Io,{size:18}),name:"Vivaldi",color:"text-red-500"},opera:{icon:u.jsx(Io,{size:18}),name:"Opera",color:"text-red-400"},"opera-gx":{icon:u.jsx(Ft,{size:18}),name:"Opera GX",color:"text-pink-500"},chromium:{icon:u.jsx(Jy,{size:18}),name:"Chromium",color:"text-blue-400"}};function gL({sources:e,onChange:t}){const{t:n}=Ze(),[r,s]=R.useState(!1),[o,a]=R.useState({}),[c,d]=R.useState(""),[f,p]=R.useState("chrome"),[g,y]=R.useState(!1),x=async()=>{s(!0);try{const{data:E}=await Ye.get("/api/browser-paths/detect");a(E)}catch(E){console.error("Detection failed:",E)}finally{s(!1)}},b=E=>{const j=o[E];if(!j||!j.found||!j.valid||e.find(T=>T.browser===E&&T.path===j.path))return;const N={browser:E,path:j.path,enabled:!0,label:`${Gr[E].name} (${n("engine.auto_detected")})`};t([...e,N])},w=async()=>{if(c.trim()){y(!0);try{const{data:E}=await Ye.post("/api/browser-paths/validate",{path:c});if(!E.valid){alert(n("engine.invalid_path",{error:E.error||n("engine.not_a_browser_db")})),y(!1);return}const j={browser:f,path:c,enabled:!0,label:`${Gr[f].name} (${n("engine.custom")})`};t([...e,j]),d("")}catch(E){console.error("Validation failed:",E),alert(n("engine.validation_failed"))}finally{y(!1)}}},k=E=>{const j=[...e];j[E].enabled=!j[E].enabled,t(j)},S=E=>{t(e.filter((j,O)=>O!==E))};return u.jsxs("div",{className:"space-y-6",children:[u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(oa,{size:14})," ",n("engine.auto_detect_title")]}),u.jsxs("button",{onClick:x,disabled:r,className:"px-3 py-1.5 text-xs font-bold uppercase tracking-widest bg-primary/10 hover:bg-primary/20 text-primary rounded-lg transition-all flex items-center gap-2",children:[r?u.jsx(Ct,{size:12,className:"animate-spin"}):u.jsx(oa,{size:12}),n(r?"engine.scanning":"engine.scan_system")]})]}),Object.keys(o).length>0&&u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:Object.keys(Gr).map(E=>{const j=o[E],O=Gr[E],N=e.some(T=>T.browser===E&&T.path===j?.path);return u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:`glass p-4 rounded-xl border ${j?.found&&j?.valid?"border-success/20 bg-success/5":j?.found?"border-error/20 bg-error/5":"border-border/10"}`,children:[u.jsxs("div",{className:"flex items-start justify-between mb-2",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("div",{className:O.color,children:O.icon}),u.jsx("span",{className:"text-sm font-bold",children:O.name})]}),j?.found&&j?.valid?u.jsx(Ps,{size:16,className:"text-success"}):j?.found?u.jsx(ar,{size:16,className:"text-error"}):u.jsx(an,{size:16,className:"text-fg/20"})]}),j?.found?u.jsxs(u.Fragment,{children:[u.jsx("p",{className:"text-[10px] font-mono text-fg/40 truncate mb-2",children:j.path}),j.valid?u.jsx("button",{onClick:()=>b(E),disabled:N,className:`w-full py-1.5 text-xs font-bold uppercase tracking-widest rounded-lg transition-all ${N?"bg-fg/5 text-fg/30 cursor-not-allowed":"bg-success/10 hover:bg-success/20 text-success"}`,children:n(N?"engine.already_added":"engine.add_source")}):u.jsx("p",{className:"text-[10px] text-error font-medium",children:j.error})]}):u.jsx("p",{className:"text-[10px] text-fg/30 italic",children:n("engine.not_found")})]},E)})})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(Sj,{size:14})," ",n("engine.add_custom_path")]}),u.jsxs("div",{className:"glass p-4 rounded-xl space-y-3",children:[u.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[u.jsx("select",{value:f,onChange:E=>p(E.target.value),className:"bg-black/20 border border-border/5 rounded-xl py-2 px-3 text-sm focus:border-primary/30 outline-none transition-all",children:Object.keys(Gr).map(E=>u.jsx("option",{value:E,children:Gr[E].name},E))}),u.jsx("input",{type:"text",value:c,onChange:E=>d(E.target.value),placeholder:n("engine.custom_path_placeholder"),className:"col-span-2 bg-black/20 border border-border/5 rounded-xl py-2 px-3 text-sm focus:border-primary/30 outline-none transition-all"})]}),u.jsxs("button",{onClick:w,disabled:!c.trim()||g,className:"w-full py-2.5 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg hover:scale-[1.01] active:scale-95 transition-all flex items-center justify-center gap-2 disabled:opacity-50 disabled:grayscale",children:[g?u.jsx(Ct,{size:16,className:"animate-spin"}):u.jsx(Vf,{size:16}),n(g?"engine.validating":"engine.add_custom_source")]})]})]}),e.length>0&&u.jsxs("div",{className:"space-y-3",children:[u.jsx("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40",children:n("engine.configured_sources",{count:e.length})}),u.jsx("div",{className:"space-y-2",children:u.jsx(It,{children:e.map((E,j)=>u.jsxs(Le.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},className:`glass p-4 rounded-xl border border-border/10 flex items-center justify-between ${!E.enabled&&"opacity-50"}`,children:[u.jsxs("div",{className:"flex items-center gap-3 flex-1 min-w-0",children:[u.jsx("div",{className:Gr[E.browser].color,children:Gr[E.browser].icon}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("p",{className:"text-sm font-bold",children:E.label}),u.jsx("p",{className:"text-[10px] font-mono text-fg/40 truncate",children:E.path})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>k(j),className:`px-3 py-1.5 text-xs font-bold uppercase tracking-widest rounded-lg transition-all ${E.enabled?"bg-success/10 text-success":"bg-fg/5 text-fg/40"}`,children:E.enabled?n("engine.enabled"):n("engine.disabled")}),u.jsx("button",{onClick:()=>S(j),className:"p-2 hover:bg-error/10 text-error rounded-lg transition-all",children:u.jsx(an,{size:16})})]})]},`${E.browser}-${E.path}`))})})]})]})}const Ww=R.createContext(void 0);function yL({children:e}){const[t,n]=R.useState([]),r=R.useCallback((s,o="info")=>{const a=Math.random().toString(36).substr(2,9),c={id:a,type:o,message:s};n(d=>[...d,c]),setTimeout(()=>{n(d=>d.filter(f=>f.id!==a))},3e3)},[]);return u.jsxs(Ww.Provider,{value:{showToast:r},children:[e,u.jsx(xL,{toasts:t})]})}function Xc(){const e=R.useContext(Ww);if(!e)throw new Error("useToast must be used within ToastProvider");return e}function xL({toasts:e}){return u.jsx("div",{className:"fixed bottom-6 right-6 z-[100] flex flex-col gap-2 pointer-events-none",children:u.jsx(It,{children:e.map(t=>u.jsx(vL,{toast:t},t.id))})})}function vL({toast:e}){const t={success:u.jsx(Ps,{size:18,className:"text-success"}),error:u.jsx(an,{size:18,className:"text-error"}),warning:u.jsx(ar,{size:18,className:"text-accent"}),info:u.jsx(w_,{size:18,className:"text-primary"})},n={success:"border-success/20 bg-success/10",error:"border-error/20 bg-error/10",warning:"border-accent/20 bg-accent/10",info:"border-primary/20 bg-primary/10"};return u.jsxs(Le.div,{initial:{opacity:0,y:20,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,x:100,scale:.95},className:`glass px-4 py-3 rounded-xl border ${n[e.type]} flex items-center gap-3 min-w-[300px] max-w-md pointer-events-auto shadow-lg`,children:[t[e.type],u.jsx("span",{className:"text-sm font-medium flex-1",children:e.message})]})}const Gw=new Set(["login","log in","log-in","signin","sign in","sign-in","signup","sign up","sign-up","authentication","auth","password","register","registration","oauth","sso","navigation","menu","footer","header","sidebar","nav","breadcrumb","cookie","cookies","consent","privacy","terms","sitemap","ui","ux","user interface","interface","button","form","modal","popup","banner","facebook","meta","instagram","twitter","x","linkedin","tiktok","youtube","google","google drive","gmail","apple","icloud","microsoft","office","outlook","teams","pinterest","reddit","whatsapp","messenger","slack","discord","zoom","dropbox","notion","figma","github","gitlab","social media","social network","social","share","like","follow","post","error","not found","404","403","500","access denied","no content","empty","page not found","unavailable","blocked","forbidden","unauthorized","website","web page","webpage","page","site","web","app","application","download","install","home","homepage","main","index","default","about","contact","help","support","faq","blog","news","article"]);function _L(){const{t:e}=Ze(),{showToast:t}=Xc(),[n,r]=R.useState("realtimexai"),[s,o]=R.useState("gpt-4.1-mini"),[a,c]=R.useState("realtimexai"),[d,f]=R.useState("text-embedding-3-small"),[p,g]=R.useState([]),[y,x]=R.useState([]),[b,w]=R.useState([]),[k,S]=R.useState(!1),[E,j]=R.useState(!1),[O,N]=R.useState(!1),[T,I]=R.useState(!1),[V,U]=R.useState(!1),[D,Z]=R.useState(!1),[Y,he]=R.useState(null),[G,W]=R.useState([]),[ne,re]=R.useState([]);R.useEffect(()=>{J().then(X=>{ce(X)}),et()},[]);const J=async()=>{const X={llmProvider:"realtimexai",llmModel:"gpt-4.1-mini",embeddingProvider:"realtimexai",embeddingModel:"text-embedding-3-small"},{data:{user:ke}}=await oe.auth.getUser();if(!ke)return X;const{data:ee}=await oe.from("alchemy_settings").select("*").eq("user_id",ke.id).maybeSingle();if(ee){const pe=ee.llm_provider||X.llmProvider,Se=ee.llm_model||X.llmModel,ve=ee.embedding_provider||X.embeddingProvider,Be=ee.embedding_model||X.embeddingModel;r(pe),o(Se),c(ve),f(Be),g(ee.custom_browser_paths||[]),x(ee.blacklist_domains||[]);const we=ee.blocked_tags||[];return we.length>0?w(we):w(Array.from(Gw)),{llmProvider:pe,llmModel:Se,embeddingProvider:ve,embeddingModel:Be}}else{const pe=new Date(Date.now()-2592e6).toISOString();let Se=[];try{const{data:Be}=await Ye.get("/api/browser-paths/auto-discover");Be.success&&(Se=Be.sources)}catch(Be){console.warn("[AlchemistEngine] Auto-discovery failed:",Be)}const{data:ve}=await oe.from("alchemy_settings").insert({user_id:ke.id,llm_provider:X.llmProvider,llm_model:X.llmModel,embedding_provider:X.embeddingProvider,embedding_model:X.embeddingModel,max_urls_per_sync:50,sync_mode:"incremental",sync_start_date:pe,custom_browser_paths:Se}).select().single();return ve&&g(ve.custom_browser_paths||[]),X}},ce=async X=>{const ke=X?.llmProvider||"realtimexai",ee=X?.llmModel||"gpt-4.1-mini",pe=X?.embeddingProvider||"realtimexai",Se=X?.embeddingModel||"text-embedding-3-small";try{const[ve,Be]=await Promise.all([Ye.get("/api/sdk/providers/chat",{timeout:65e3}),Ye.get("/api/sdk/providers/embed",{timeout:65e3})]);if(ve.data.success&&Be.data.success){const we=ve.data.providers||[],nt=Be.data.providers||[];if(he({chat:we,embed:nt}),Z(!0),console.log("[AlchemistEngine] SDK providers loaded"),console.log(" Chat providers:",we.map(st=>st.provider)),console.log(" Embed providers:",nt.map(st=>st.provider)),we.length>0){const st=we.some(it=>it.provider===ke);if(st){const it=we.find(le=>le.provider===ke);!it?.models?.some(le=>le.id===ee)&&it?.models?.length>0&&o(it.models[0].id)}else{const it=we[0];r(it.provider),it.models?.length>0&&o(it.models[0].id)}M(st?ke:we[0].provider,we)}if(nt.length>0){const st=nt.some(it=>it.provider===pe);if(st){const it=nt.find(le=>le.provider===pe);!it?.models?.some(le=>le.id===Se)&&it?.models?.length>0&&f(it.models[0].id)}else{const it=nt[0];c(it.provider),it.models?.length>0&&f(it.models[0].id)}A(st?pe:nt[0].provider,nt)}}}catch{console.log("[AlchemistEngine] SDK not available"),Z(!1)}},A=(X,ke)=>{if(ke&&Array.isArray(ke)){const pe=ke.find(Se=>Se.provider===X);if(pe&&pe.models){const Se=pe.models.map(ve=>ve.id);console.log(`[AlchemistEngine] Using SDK embedding models for ${X}:`,Se),W(Se);return}}console.log(`[AlchemistEngine] Using hardcoded embedding models for ${X}`);const ee=[];X==="realtimexai"||X==="openai"?ee.push("text-embedding-3-small","text-embedding-3-large","text-embedding-ada-002"):X==="gemini"&&ee.push("embedding-001"),W(ee)},M=(X,ke)=>{if(ke&&Array.isArray(ke)){const pe=ke.find(Se=>Se.provider===X);if(pe&&pe.models){const Se=pe.models.map(ve=>ve.id);console.log(`[AlchemistEngine] Using SDK chat models for ${X}:`,Se),re(Se);return}}console.log(`[AlchemistEngine] Using hardcoded chat models for ${X}`);const ee=[];X==="realtimexai"||X==="openai"?ee.push("gpt-4o","gpt-4o-mini","gpt-4-turbo","gpt-3.5-turbo"):X==="anthropic"?ee.push("claude-3-5-sonnet-20241022","claude-3-5-haiku-20241022","claude-3-opus-20240229"):X==="google"?ee.push("gemini-2.0-flash-exp","gemini-1.5-pro","gemini-1.5-flash"):X==="ollama"&&ee.push("llama3","mistral","codellama","phi"),re(ee)},K=async()=>{S(!0);try{const{data:{user:X}}=await oe.auth.getUser();if(!X){t(e("engine.save_error_login"),"error"),S(!1);return}const{error:ke}=await oe.from("alchemy_settings").upsert({user_id:X.id,llm_provider:n,llm_model:s,embedding_provider:a,embedding_model:d,customized_at:new Date().toISOString()},{onConflict:"user_id"});ke?(console.error("[AlchemistEngine] Save error:",ke),t(`${e("common.error")}: ${ke.message}`,"error")):t(e("engine.save_success_llm"),"success")}catch(X){console.error("[AlchemistEngine] Unexpected error:",X),t(`Unexpected error: ${X.message}`,"error")}finally{S(!1)}},P=async()=>{j(!0);try{const{data:{user:X}}=await oe.auth.getUser();if(!X){t(e("engine.save_error_login"),"error"),j(!1);return}const{error:ke}=await oe.from("alchemy_settings").upsert({user_id:X.id,custom_browser_paths:p},{onConflict:"user_id"});ke?(console.error("[AlchemistEngine] Save browser sources error:",ke),t(`${e("common.error")}: ${ke.message}`,"error")):t(e("engine.save_success_browser"),"success")}catch(X){console.error("[AlchemistEngine] Unexpected error:",X),t(`Unexpected error: ${X.message}`,"error")}finally{j(!1)}},te=async()=>{N(!0);try{const{data:{user:X}}=await oe.auth.getUser();if(!X){t(e("engine.save_error_login"),"error"),N(!1);return}const ke=y.filter(pe=>pe.trim().length>0),{error:ee}=await oe.from("alchemy_settings").upsert({user_id:X.id,blacklist_domains:ke},{onConflict:"user_id"});ee?(console.error("[AlchemistEngine] Save blacklist error:",ee),t(`${e("common.error")}: ${ee.message}`,"error")):(t(e("engine.save_success_blacklist"),"success"),await J())}catch(X){console.error("[AlchemistEngine] Unexpected error:",X),t(`Unexpected error: ${X.message}`,"error")}finally{N(!1)}},me=async()=>{I(!0);try{const{data:{user:X}}=await oe.auth.getUser();if(!X){t(e("engine.save_error_login"),"error"),I(!1);return}const ke=b.filter(pe=>pe.trim().length>0),{error:ee}=await oe.from("alchemy_settings").upsert({user_id:X.id,blocked_tags:ke},{onConflict:"user_id"});ee?(console.error("[AlchemistEngine] Save blocked tags error:",ee),t(`${e("common.error")}: ${ee.message}`,"error")):(t(e("engine.save_success_tags"),"success"),await J())}catch(X){console.error("[AlchemistEngine] Unexpected error:",X),t(`Unexpected error: ${X.message}`,"error")}finally{I(!1)}},[ye,Fe]=R.useState(""),[Ae,Ie]=R.useState(""),[Te,Je]=R.useState(!1),et=async()=>{const{data:{user:X}}=await oe.auth.getUser();if(!X)return;const{data:ke}=await oe.from("user_persona").select("*").eq("user_id",X.id).maybeSingle();ke&&(Fe(ke.interest_summary||""),Ie(ke.anti_patterns||""))},Ce=async()=>{Je(!0);try{const{data:{user:X}}=await oe.auth.getUser();if(!X){t("Please log in to save persona","error"),Je(!1);return}const{error:ke}=await oe.from("user_persona").upsert({user_id:X.id,interest_summary:ye,anti_patterns:Ae,last_updated_at:new Date().toISOString()},{onConflict:"user_id"});ke?(console.error("[AlchemistEngine] Save persona error:",ke),t(`${e("common.error")}: ${ke.message}`,"error")):t(e("engine.save_success_persona"),"success")}catch(X){console.error("[AlchemistEngine] Unexpected error:",X),t(`Unexpected error: ${X.message}`,"error")}finally{Je(!1)}},gt=async()=>{U(!0);try{const{data:X}=await Ye.post("/api/llm/test",{baseUrl,modelName,apiKey});X.success?t(e("engine.test_success",{model:X.model||""}),"success"):t(`${e("engine.test_fail",{message:X.message})}`,"error")}catch(X){console.error("[AlchemistEngine] Test error:",X),t(`Test failed: ${X.message}`,"error")}finally{U(!1)}};return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("header",{className:"px-8 py-6 border-b border-border",children:[u.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:e("engine.title")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium",children:e("engine.subtitle")})]}),u.jsx("main",{className:"flex-1 overflow-y-auto custom-scrollbar p-8",children:u.jsxs("div",{className:"max-w-7xl mx-auto animate-in fade-in slide-in-from-bottom-2 duration-500",children:[u.jsxs("section",{className:"space-y-6 mb-8",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(b_,{size:14})," ",e("engine.configuration")]}),u.jsxs("div",{className:"flex gap-3",children:[u.jsxs("button",{onClick:gt,disabled:V||k,className:"px-6 py-3 bg-surface hover:bg-surface/80 border border-border text-fg font-bold rounded-xl shadow-sm hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[V?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(Ft,{size:18,className:"text-accent"}),e("engine.test_connection")]}),u.jsxs("button",{onClick:K,disabled:k,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[k?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),e("engine.save_config")]})]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[u.jsxs("div",{className:"glass p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h3",{className:"text-sm font-semibold text-fg/80",children:e("engine.llm_provider")}),D?u.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[u.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full"}),e("engine.sdk_connected")]}):u.jsxs("span",{className:"text-xs text-orange-500 flex items-center gap-1",children:[u.jsx("span",{className:"w-2 h-2 bg-orange-500 rounded-full"}),e("engine.sdk_not_available")]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-fg/60",children:e("engine.provider")}),u.jsx("select",{value:n,onChange:X=>{r(X.target.value),M(X.target.value,Y?.chat)},className:"w-full px-4 py-3 bg-surface border border-border rounded-xl text-fg focus:outline-none focus:ring-2 focus:ring-primary/50",children:Y?.chat&&Y.chat.length>0?Y.chat.map(X=>u.jsx("option",{value:X.provider,children:X.provider==="realtimexai"?"RealTimeX.AI":X.provider.charAt(0).toUpperCase()+X.provider.slice(1)},X.provider)):u.jsx("option",{value:"",disabled:!0,children:e("engine.loading_providers")})})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-fg/60",children:e("engine.intelligence_model")}),u.jsx("select",{value:s,onChange:X=>o(X.target.value),className:"w-full px-4 py-3 bg-surface border border-border rounded-xl text-fg focus:outline-none focus:ring-2 focus:ring-primary/50",children:ne.length>0?ne.map(X=>u.jsx("option",{value:X,children:X},X)):u.jsxs(u.Fragment,{children:[u.jsx("option",{value:"gpt-4o",children:"gpt-4o"}),u.jsx("option",{value:"gpt-4o-mini",children:"gpt-4o-mini"}),u.jsx("option",{value:"gpt-4-turbo",children:"gpt-4-turbo"})]})})]}),u.jsx("div",{className:"p-3 bg-primary/5 rounded-xl",children:u.jsx("p",{className:"text-[10px] text-primary/60 font-medium leading-relaxed",children:e(D?"engine.sdk_info_success":"engine.sdk_info_fail")})})]}),u.jsxs("div",{className:"glass p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h3",{className:"text-sm font-semibold text-fg/80",children:e("engine.embedding_provider")}),D?u.jsxs("span",{className:"text-xs text-green-500 flex items-center gap-1",children:[u.jsx("span",{className:"w-2 h-2 bg-green-500 rounded-full"}),e("engine.sdk_connected")]}):u.jsxs("span",{className:"text-xs text-orange-500 flex items-center gap-1",children:[u.jsx("span",{className:"w-2 h-2 bg-orange-500 rounded-full"}),e("engine.sdk_not_available")]})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-fg/60",children:e("engine.provider")}),u.jsx("select",{value:a,onChange:X=>{c(X.target.value),A(X.target.value,Y?.embed)},className:"w-full px-4 py-3 bg-surface border border-border rounded-xl text-fg focus:outline-none focus:ring-2 focus:ring-primary/50",children:Y?.embed&&Y.embed.length>0?Y.embed.map(X=>u.jsx("option",{value:X.provider,children:X.provider==="realtimexai"?"RealTimeX.AI":X.provider.charAt(0).toUpperCase()+X.provider.slice(1)},X.provider)):u.jsx("option",{value:"",disabled:!0,children:e("engine.loading_providers")})})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-xs font-medium text-fg/60",children:e("engine.embedding_model")}),u.jsx("select",{value:d,onChange:X=>f(X.target.value),className:"w-full px-4 py-3 bg-surface border border-border rounded-xl text-fg focus:outline-none focus:ring-2 focus:ring-primary/50",children:G.length>0?G.map(X=>u.jsx("option",{value:X,children:X},X)):u.jsxs(u.Fragment,{children:[u.jsx("option",{value:"text-embedding-3-small",children:"text-embedding-3-small"}),u.jsx("option",{value:"text-embedding-3-large",children:"text-embedding-3-large"}),u.jsx("option",{value:"text-embedding-ada-002",children:"text-embedding-ada-002"})]})})]}),u.jsx("div",{className:"p-3 bg-primary/5 rounded-xl",children:u.jsx("p",{className:"text-[10px] text-primary/60 font-medium leading-relaxed",children:e(D?"engine.embedding_info_success":"engine.embedding_info_fail")})})]})]})]}),u.jsxs("section",{className:"space-y-6 mb-8",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx("span",{className:"text-xl",children:"🧠"})," ",e("engine.persona_title")]}),u.jsxs("button",{onClick:Ce,disabled:Te,className:"px-6 py-3 bg-surface hover:bg-surface/80 border border-border text-fg font-bold rounded-xl shadow-sm hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[Te?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),e("engine.save_memory")]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[u.jsxs("div",{className:"glass p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h3",{className:"text-sm font-semibold text-fg/80",children:e("engine.interests_title")}),u.jsx("span",{className:"text-xs text-green-500 bg-green-500/10 px-2 py-1 rounded-full border border-green-500/20",children:e("engine.interests_priority")})]}),u.jsx("p",{className:"text-xs text-fg/50 leading-relaxed",children:e("engine.interests_desc")}),u.jsx("textarea",{value:ye,onChange:X=>Fe(X.target.value),placeholder:e("engine.interests_placeholder"),className:"w-full h-32 px-4 py-3 bg-surface border border-border rounded-xl text-sm text-fg placeholder:text-fg/40 focus:outline-none focus:ring-2 focus:ring-green-500/30 resize-none"})]}),u.jsxs("div",{className:"glass p-6 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("h3",{className:"text-sm font-semibold text-fg/80",children:e("engine.antipatterns_title")}),u.jsx("span",{className:"text-xs text-red-400 bg-red-500/10 px-2 py-1 rounded-full border border-red-500/20",children:e("engine.antipatterns_priority")})]}),u.jsx("p",{className:"text-xs text-fg/50 leading-relaxed",children:e("engine.antipatterns_desc")}),u.jsx("textarea",{value:Ae,onChange:X=>Ie(X.target.value),placeholder:e("engine.antipatterns_placeholder"),className:"w-full h-32 px-4 py-3 bg-surface border border-border rounded-xl text-sm text-fg placeholder:text-fg/40 focus:outline-none focus:ring-2 focus:ring-red-500/30 resize-none"})]})]})]}),u.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-8",children:[u.jsx("section",{className:"space-y-6",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(jr,{size:14})," ",e("engine.browser_sources")]}),u.jsxs("div",{className:"glass p-8 space-y-6",children:[u.jsx(gL,{sources:p,onChange:g}),u.jsx("div",{className:"flex justify-end pt-2",children:u.jsxs("button",{onClick:P,disabled:E,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[E?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),e("engine.save_browser")]})})]})]})}),u.jsx("section",{className:"space-y-6",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(Ft,{size:14})," ",e("engine.blacklist_title")]}),u.jsxs("div",{className:"glass p-8 space-y-6",children:[u.jsx("div",{className:"space-y-2",children:u.jsx("p",{className:"text-sm text-fg/60",children:e("engine.blacklist_desc")})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:e("engine.blacklist_label")}),u.jsx("textarea",{value:y.join(`
|
|
74
|
+
`),onChange:X=>x(X.target.value.split(`
|
|
75
|
+
`).map(ke=>ke.trim())),placeholder:e("engine.blacklist_placeholder"),className:"w-full h-40 px-4 py-3 rounded-xl border border-border bg-surface text-fg text-sm placeholder:text-fg/40 focus:outline-none focus:border-[var(--border-hover)] transition-all resize-none"}),u.jsx("p",{className:"text-xs text-fg/50 ml-1",children:e("engine.blacklist_examples")})]}),u.jsx("div",{className:"flex justify-end pt-2",children:u.jsxs("button",{onClick:te,disabled:O,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[O?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),e("engine.save_blacklist")]})})]})]})})]}),u.jsx("section",{className:"space-y-6 mt-8",children:u.jsxs("div",{className:"space-y-4",children:[u.jsxs("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40 flex items-center gap-2",children:[u.jsx(Bf,{size:14})," ",e("engine.blocked_tags_title")]}),u.jsxs("div",{className:"glass p-8 space-y-6",children:[u.jsx("div",{className:"space-y-2",children:u.jsx("p",{className:"text-sm text-fg/60",children:e("engine.blocked_tags_desc")})}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:e("engine.blocked_tags_label")}),u.jsx("textarea",{value:b.join("; "),onChange:X=>w(X.target.value.split(";").map(ke=>ke.trim())),placeholder:e("engine.blocked_tags_placeholder"),className:"w-full h-40 px-4 py-3 rounded-xl border border-border bg-surface text-fg text-sm placeholder:text-fg/40 focus:outline-none focus:border-[var(--border-hover)] transition-all resize-none"}),u.jsx("p",{className:"text-xs text-fg/50 ml-1",children:e("engine.blocked_tags_info")})]}),u.jsx("div",{className:"flex justify-end pt-2",children:u.jsxs("button",{onClick:me,disabled:T,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[T?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),e("engine.save_blocked_tags")]})})]})]})})]})})]})}const Jw=R.createContext(null);function bL({children:e}){const[t,n]=R.useState(!1),r=()=>n(!0),s=()=>n(!1);return u.jsx(Jw.Provider,{value:{isExpanded:t,setIsExpanded:n,openTerminal:r,closeTerminal:s},children:e})}function wL(){const e=R.useContext(Jw);if(!e)throw new Error("useTerminal must be used within a TerminalProvider");return e}function kL({isExpanded:e,onToggle:t,onNavigate:n,liftUp:r,isSyncing:s,onStop:o}={}){const{t:a}=Ze(),[c,d]=R.useState([]),{isExpanded:f,setIsExpanded:p}=wL(),[g,y]=R.useState({}),x=e!==void 0?e:f,b=t||(()=>p(!f)),w=r?"bottom-32":"bottom-6";R.useEffect(()=>{k();const N=oe.channel("processing_events_feed").on("postgres_changes",{event:"INSERT",schema:"public",table:"processing_events"},T=>{const I=T.new;I.event_type==="error"&&y(V=>({...V,[I.id]:!0})),d(V=>{const U=[I,...V];return U.length>50?U.slice(0,50):U})}).subscribe();return()=>{oe.removeChannel(N)}},[]);const k=async()=>{const{data:N}=await oe.from("processing_events").select("*").order("created_at",{ascending:!1}).limit(30);N&&d(N)},S=N=>{y(T=>({...T,[N]:!T[N]}))},E=N=>{switch(N.toLowerCase()){case"reading":return a("terminal.state_reading");case"thinking":return a("terminal.state_thinking");case"signal":return a("terminal.state_signal");case"skipped":return a("terminal.state_skipped");case"error":return a("terminal.state_error");case"completed":return a("terminal.state_completed");default:return N}},j=N=>{const T=N.message||"";if(T.startsWith("Reading content from:")){const I=T.split("Reading content from: ")[1]||"";return a("terminal.msg_reading",{url:I})}if(T.startsWith("Analyzing relevance of:")){const I=T.split("Analyzing relevance of: ")[1]||"";return a("terminal.msg_thinking",{title:I})}if(T.startsWith("Found signal:")){const I=N.metadata?.summary||N.details?.summary||"",V=N.metadata?.score||N.details?.score||0;return a("terminal.msg_found_signal",{summary:I,score:V})}if(T.startsWith("Low signal stored for review")){const I=T.match(/\((\d+)%\)/),V=I?I[1]:"0",U=T.split("): ")[1]||"";return a("terminal.msg_low_signal",{score:V,title:U})}if(T.startsWith("Analysis failed for")){const I=T.split("Analysis failed for ")[1]||"",V=I.split(": ")[0]||"",U=I.split(": ")[1]||"";return a("terminal.msg_failed",{title:V,error:U})}return T.startsWith("Sync completed:")?a("terminal.msg_sync_completed",{signals:N.metadata?.signals_found||N.details?.signals_found||0,skipped:N.metadata?.skipped||N.details?.skipped||0,errors:N.metadata?.errors||N.details?.errors||0}):T},O=(N,T,I,V)=>{if(T==="debug")return u.jsx(gj,{size:14,className:"text-fg/40"});if(I?.is_completion||V?.is_completion)return u.jsx(Rs,{size:14,className:"text-success"});switch(N){case"analysis":return u.jsx(x_,{size:14,className:"text-primary"});case"action":return u.jsx(Ft,{size:14,className:"text-accent"});case"error":return u.jsx(Bh,{size:14,className:"text-error"});case"system":return u.jsx(Ds,{size:14,className:"text-success"});default:return u.jsx(w_,{size:14,className:"text-fg/40"})}};return x?u.jsxs(Le.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},className:"fixed bottom-6 right-6 z-50 w-[450px] max-h-[600px] glass shadow-2xl flex flex-col overflow-hidden border-primary/10",children:[u.jsxs("div",{className:"p-4 border-b border-border/10 flex items-center justify-between bg-surface/50",children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(zi,{size:18,className:"text-primary"}),u.jsx("span",{className:"text-xs font-bold uppercase tracking-widest",children:a("terminal.title")}),u.jsxs("div",{className:"flex items-center gap-1.5 text-[9px] font-bold bg-success/10 text-success px-2 py-0.5 rounded-full border border-success/10 animate-pulse ml-2",children:[u.jsx(hj,{size:10})," ",a("terminal.live")]})]}),u.jsx("div",{className:"flex justify-center flex-1 mx-4",children:s&&o&&u.jsxs(Le.button,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},onClick:o,className:"flex items-center gap-1.5 bg-error/5 hover:bg-error text-error hover:text-white px-3 py-0.5 rounded-full text-[9px] font-bold uppercase tracking-widest transition-all border border-error/20 hover:border-error hover:shadow-lg hover:shadow-error/20 active:scale-95",children:[u.jsx(an,{size:10})," ",a("terminal.stop_sync")]})}),u.jsx("div",{className:"flex items-center gap-2",children:u.jsx("button",{onClick:b,className:"text-fg/40 hover:text-fg p-1 transition-colors",children:u.jsx(Lj,{size:18})})})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-4 space-y-4 custom-scrollbar bg-black/20",children:[c.length===0&&u.jsx("div",{className:"text-center py-12 text-fg/20 italic text-xs",children:a("terminal.idle")}),c.map(N=>u.jsxs("div",{className:"relative flex items-start gap-3 group",children:[u.jsx("div",{className:`mt-1 flex-shrink-0 w-6 h-6 rounded-full bg-surface border flex items-center justify-center ${N.metadata?.is_completion||N.details?.is_completion?"border-success/50 bg-success/5":"border-white/5"}`,children:O(N.event_type,N.level,N.metadata,N.details)}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsx("span",{className:"text-xs font-mono text-fg/60 shrink-0",children:new Date(N.created_at||Date.now()).toLocaleTimeString()}),u.jsx("span",{className:`text-xs font-bold uppercase tracking-wider ${N.level==="error"?"text-error":N.level==="warn"?"text-orange-400":N.event_type==="analysis"?"text-primary":"text-fg/90"}`,children:E(N.agent_state)}),N.metadata?.actionable&&n&&u.jsxs("button",{onClick:()=>n("logs",N.metadata?.actionable),className:"ml-auto flex items-center gap-1 bg-primary/10 text-primary border border-primary/20 px-1.5 py-0.5 rounded text-[10px] uppercase font-bold tracking-wider hover:bg-primary/20 transition-all font-mono",children:[N.metadata.actionable.label,u.jsx(Is,{size:10,className:"-rotate-90"})]}),N.duration_ms&&!N.metadata?.actionable&&u.jsxs("span",{className:"ml-auto text-[10px] font-mono bg-bg/50 px-1.5 py-0.5 rounded flex items-center gap-1 text-fg/40",children:[u.jsx(Di,{size:10}),N.duration_ms,"ms"]})]}),N.metadata?.is_completion||N.details?.is_completion?u.jsxs("div",{className:"bg-success/5 border border-success/20 rounded-lg p-3 space-y-2 mt-2",children:[u.jsxs("div",{className:"flex items-center gap-2 text-success font-bold uppercase text-[9px] tracking-[0.2em]",children:[u.jsx(Rs,{className:"w-3.5 h-3.5"}),a("terminal.run_completed")]}),u.jsxs("div",{className:"grid grid-cols-3 gap-4 pt-1",children:[u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("p",{className:"text-[10px] text-fg/40 uppercase",children:a("terminal.signals")}),u.jsx("p",{className:"text-sm font-bold text-primary",children:N.metadata?.signals_found||N.details?.signals_found||0})]}),u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("p",{className:"text-[10px] text-fg/40 uppercase",children:a("terminal.urls")}),u.jsx("p",{className:"text-sm font-bold",children:N.metadata?.total_urls||N.details?.total_urls||0})]}),u.jsxs("div",{className:"space-y-0.5",children:[u.jsx("p",{className:"text-[10px] text-fg/40 uppercase",children:a("terminal.skipped")}),u.jsx("p",{className:"text-sm font-bold text-fg/60",children:N.metadata?.skipped||N.details?.skipped||0})]})]}),(N.metadata?.errors||N.details?.errors)>0&&u.jsxs("div",{className:"pt-1 border-t border-success/10 flex items-center justify-between mt-1",children:[u.jsxs("p",{className:"text-[10px] text-error font-bold flex items-center gap-1.5",children:[u.jsx(Bh,{size:12}),a("terminal.failed_to_process",{count:N.metadata?.errors||N.details?.errors})]}),n&&u.jsxs("button",{onClick:()=>n("logs",{filter:"errors"}),className:"flex items-center gap-1 text-[9px] uppercase font-bold text-error bg-error/10 border border-error/20 px-2 py-1 rounded hover:bg-error/20 transition-all group/btn",children:[a("terminal.view_logs"),u.jsx(nc,{size:10,className:"group-hover/btn:translate-x-0.5 transition-transform"})]})]})]}):u.jsx("p",{className:`text-sm break-words leading-relaxed ${N.level==="debug"?"text-fg/50 font-mono text-xs":""}`,children:j(N)}),(N.details||N.metadata)&&u.jsxs("div",{className:"mt-2 text-xs",children:[u.jsxs("button",{onClick:()=>S(N.id),className:"flex items-center gap-1 text-fg/40 hover:text-primary transition-colors",children:[g[N.id]?u.jsx(v_,{size:12}):u.jsx(Is,{size:12}),g[N.id]?a("terminal.hide_details"):a("terminal.view_details")]}),u.jsx(It,{children:g[N.id]&&u.jsx(Le.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},className:"overflow-hidden",children:u.jsx("pre",{className:"mt-2 p-3 bg-bg/50 rounded border border-white/5 font-mono text-[10px] overflow-x-auto text-fg/70",children:JSON.stringify({...N.details,...N.metadata},null,2)})})})]})]})]},N.id))]})]}):u.jsxs("button",{onClick:b,className:`fixed ${w} right-6 z-50 glass p-4 flex items-center gap-3 hover:bg-surface transition-all shadow-xl group border-primary/10`,children:[u.jsxs("div",{className:"relative",children:[u.jsx(zi,{size:20,className:"text-primary"}),c.length>0&&u.jsxs("span",{className:"absolute -top-1 -right-1 flex h-2 w-2",children:[u.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-primary opacity-75"}),u.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-primary"})]})]}),u.jsx("span",{className:"text-xs font-bold uppercase tracking-widest hidden group-hover:block animate-in fade-in slide-in-from-right-2",children:a("terminal.engine_log")})]})}const kh="20260129000001";async function Xw(e){try{const{data:t,error:n}=await e.rpc("get_latest_migration_timestamp");if(n)return console.warn("[MigrationCheck] Failed to get DB timestamp:",n.message),{needsMigration:!0,appTimestamp:kh,dbTimestamp:null,message:"Database version verification function missing. Migration recommended."};const r=kh,s=t?r>t:!0;return{needsMigration:s,appTimestamp:r,dbTimestamp:t,message:s?`Update available: Database at ${t||"initial"}, App at ${r}`:"Database is up to date."}}catch(t){return console.error("[MigrationCheck] Error:",t),{needsMigration:!1,appTimestamp:kh,dbTimestamp:null,message:"Check failed."}}}function SL(){const{t:e}=Ze(),[t,n]=R.useState("profile"),[r,s]=R.useState(!1);return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsxs("header",{className:"px-8 py-6 border-b border-border",children:[u.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:e("account.title")}),u.jsx("p",{className:"text-sm text-fg/50 font-medium",children:e("account.desc")})]}),u.jsxs("div",{className:"flex-1 flex overflow-hidden",children:[u.jsxs("aside",{className:"w-64 border-r border-border p-4 space-y-1",children:[u.jsx(Sh,{active:t==="profile",onClick:()=>n("profile"),icon:u.jsx(Oc,{size:18}),label:e("account.profile")}),u.jsx(Sh,{active:t==="security",onClick:()=>n("security"),icon:u.jsx(Pc,{size:18}),label:e("account.security")}),u.jsx(Sh,{active:t==="supabase",onClick:()=>n("supabase"),icon:u.jsx(jr,{size:18}),label:e("account.supabase")})]}),u.jsxs("main",{className:"flex-1 overflow-y-auto custom-scrollbar p-8",children:[t==="profile"&&u.jsx(jL,{}),t==="security"&&u.jsx(EL,{}),t==="supabase"&&u.jsx(CL,{})]})]})]})}function jL(){const[e,t]=R.useState(""),[n,r]=R.useState(""),[s,o]=R.useState(""),[a,c]=R.useState(!1),[d,f]=R.useState(!1),[p,g]=R.useState(null),[y,x]=R.useState(!0),{t:b}=Ze();R.useEffect(()=>{w()},[]);const w=async()=>{const{data:{user:E}}=await oe.auth.getUser();if(!E)return;o(E.email||"");const{data:j}=await oe.from("profiles").select("*").eq("id",E.id).maybeSingle();j?(t(j.first_name||E.user_metadata?.first_name||""),r(j.last_name||E.user_metadata?.last_name||""),g(j.avatar_url)):(t(E.user_metadata?.first_name||""),r(E.user_metadata?.last_name||""));const{data:O}=await oe.from("alchemy_settings").select("sound_enabled").eq("user_id",E.id).maybeSingle();O&&x(O.sound_enabled??!0)},k=async()=>{c(!0);const{data:{user:E}}=await oe.auth.getUser();E&&(await oe.from("profiles").upsert({id:E.id,first_name:e,last_name:n,full_name:e&&n?`${e} ${n}`:e||n||null}),await oe.from("alchemy_settings").update({sound_enabled:y}).eq("user_id",E.id),c(!1))},S=async E=>{const j=E.target.files?.[0];if(j){f(!0);try{const{data:{user:O}}=await oe.auth.getUser();if(!O)return;const N=j.name.split(".").pop(),T=`${O.id}/avatar-${Date.now()}.${N}`,{error:I}=await oe.storage.from("avatars").upload(T,j,{upsert:!0});if(I)throw I;const{data:{publicUrl:V}}=oe.storage.from("avatars").getPublicUrl(T);await oe.from("profiles").update({avatar_url:V}).eq("id",O.id),g(V)}catch(O){console.error("Avatar upload failed:",O)}finally{f(!1)}}};return u.jsxs("div",{className:"max-w-2xl space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-500",children:[u.jsxs("section",{className:"flex items-start gap-8",children:[u.jsxs("div",{className:"relative group",children:[u.jsx("div",{className:"w-32 h-32 rounded-3xl bg-surface border border-border flex items-center justify-center overflow-hidden shadow-xl",children:p?u.jsx("img",{src:p,alt:"Avatar",className:"w-full h-full object-cover"}):u.jsx(Oc,{size:48,className:"text-fg/20"})}),u.jsxs("label",{className:"absolute inset-0 flex items-center justify-center bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity cursor-pointer rounded-3xl",children:[u.jsx(xj,{size:24,className:"text-white"}),u.jsx("input",{type:"file",className:"hidden",accept:"image/*",onChange:S,disabled:d})]}),d&&u.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-black/40 rounded-3xl",children:u.jsx(Ct,{size:24,className:"text-primary animate-spin"})})]}),u.jsxs("div",{className:"flex-1 space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsx(jc,{label:b("account.first_name"),value:e,onChange:t,placeholder:"Zosimos"}),u.jsx(jc,{label:b("account.last_name"),value:n,onChange:r,placeholder:"of Panopolis"})]}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:b("account.email_locked")}),u.jsx("input",{type:"email",value:s,readOnly:!0,className:"w-full bg-black/5 border border-border rounded-xl py-3 px-4 text-sm text-fg/40 cursor-not-allowed"})]})]})]}),u.jsxs("section",{className:"glass p-6 space-y-4",children:[u.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2",children:[y?u.jsx(tx,{size:20,className:"text-primary"}):u.jsx(nx,{size:20,className:"text-fg/40"}),b("account.sound_effects")]}),u.jsx("p",{className:"text-xs text-fg/40",children:b("account.sound_desc")}),u.jsx("button",{onClick:()=>x(!y),className:`w-full p-4 rounded-xl border-2 transition-all ${y?"bg-primary/10 border-primary/30 text-primary":"bg-surface border-border text-fg/40"}`,children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"font-semibold text-sm",children:b(y?"common.enabled":"common.disabled")}),y?u.jsx(tx,{size:18}):u.jsx(nx,{size:18})]})})]}),u.jsxs("section",{className:"glass p-6 space-y-4",children:[u.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2",children:[u.jsx(Qy,{size:20,className:"text-error"}),b("account.sign_out")]}),u.jsx("p",{className:"text-xs text-fg/40",children:b("account.logout_desc")}),u.jsx("button",{onClick:()=>oe.auth.signOut(),className:"w-full p-4 rounded-xl border-2 bg-error/10 border-error/30 text-error hover:bg-error hover:text-white transition-all",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("span",{className:"font-semibold text-sm",children:b("account.sign_out")}),u.jsx(Qy,{size:18})]})})]}),u.jsx("div",{className:"flex justify-end pt-4 border-t border-border",children:u.jsxs("button",{onClick:k,disabled:a,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2",children:[a?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(wr,{size:18}),b("account.preserve_profile")]})})]})}function EL(){const[e,t]=R.useState(""),[n,r]=R.useState(""),[s,o]=R.useState(!1),[a,c]=R.useState(null),[d,f]=R.useState(!1),{t:p}=Ze(),g=async()=>{if(!e||e!==n){c(p("account.password_mismatch"));return}if(e.length<8){c(p("account.password_too_short"));return}o(!0),c(null),f(!1);const{error:y}=await oe.auth.updateUser({password:e});y?c(y.message):(f(!0),t(""),r("")),o(!1)};return u.jsx("div",{className:"max-w-2xl space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-500",children:u.jsxs("div",{className:"glass p-6 space-y-6",children:[u.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2",children:[u.jsx(Cj,{size:20,className:"text-error"})," ",p("account.security_title")]}),u.jsxs("div",{className:"space-y-4",children:[u.jsx(jc,{label:p("account.new_password"),type:"password",value:e,onChange:t,placeholder:"••••••••"}),u.jsx(jc,{label:p("account.confirm_password"),type:"password",value:n,onChange:r,placeholder:"••••••••"})]}),a&&u.jsx("p",{className:"text-xs text-error font-mono bg-error/5 p-3 rounded-lg border border-error/10",children:a}),d&&u.jsx("p",{className:"text-xs text-success font-mono bg-success/5 p-3 rounded-lg border border-success/10",children:p("account.password_rotate_success")}),u.jsx("div",{className:"flex justify-end pt-2",children:u.jsxs("button",{onClick:g,disabled:s,className:"px-6 py-3 bg-error/10 text-error hover:bg-error hover:text-white font-bold rounded-xl border border-error/20 transition-all flex items-center gap-2",children:[s?u.jsx(Ct,{size:18,className:"animate-spin"}):u.jsx(Pc,{size:18}),p("account.rotate_key")]})})]})})}function CL(){const[e,t]=R.useState(!1),[n,r]=R.useState(null),s=Zr(),o=cL(),{t:a}=Ze();R.useEffect(()=>{s&&Xw(oe).then(r)},[]);const c=()=>{confirm(a("account.sever_confirm"))&&(aL(),window.location.reload())};return u.jsxs("div",{className:"max-w-2xl space-y-8 animate-in fade-in slide-in-from-bottom-2 duration-500",children:[u.jsxs("section",{className:"space-y-6",children:[u.jsx("div",{className:"flex items-center justify-between",children:u.jsxs("div",{children:[u.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2",children:[u.jsx(jr,{size:20,className:"text-primary"})," ",a("account.essence_resonance")]}),u.jsx("p",{className:"text-xs text-fg/40 font-medium",children:a("account.byok_desc")})]})}),u.jsx("div",{className:"glass p-8 space-y-8",children:s?u.jsxs(u.Fragment,{children:[u.jsxs("div",{className:"flex items-start gap-4 p-4 glass bg-emerald-500/5 border border-emerald-500/20 rounded-2xl",children:[u.jsx(Rs,{className:"w-6 h-6 text-emerald-500 mt-1"}),u.jsxs("div",{className:"flex-1 space-y-1",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsx("p",{className:"font-bold text-fg italic uppercase tracking-tighter",children:a("account.established_link")}),n?.latestMigrationTimestamp&&u.jsxs("span",{className:"text-[10px] font-mono bg-emerald-500/10 text-emerald-500 px-2 py-0.5 rounded-full border border-emerald-500/20",children:["v",n.latestMigrationTimestamp]})]}),u.jsx("p",{className:"text-xs font-mono text-fg/40 break-all",children:s.url})]})]}),o==="env"&&u.jsxs("div",{className:"flex items-center gap-3 p-3 bg-amber-500/5 border border-amber-500/10 rounded-xl",children:[u.jsx(ar,{size:16,className:"text-amber-500"}),u.jsx("p",{className:"text-[10px] text-amber-500 font-bold uppercase tracking-widest leading-none",children:a("account.env_notice")})]}),u.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[u.jsxs("button",{onClick:()=>t(!0),className:"px-4 py-3 glass hover:bg-surface text-xs font-bold uppercase tracking-widest transition-all flex items-center justify-center gap-2",children:[u.jsx(Ds,{size:14})," ",a("account.realign_link")]}),o==="ui"&&u.jsxs("button",{onClick:c,className:"px-4 py-3 glass border-error/10 hover:bg-error/10 text-error/60 hover:text-error text-xs font-bold uppercase tracking-widest transition-all flex items-center justify-center gap-2",children:[u.jsx(qf,{size:14})," ",a("account.sever_link")]})]}),u.jsxs("div",{className:"space-y-1 pt-4 border-t border-border/10",children:[u.jsx("label",{className:"text-[9px] font-bold uppercase tracking-widest text-fg/20 ml-1",children:a("account.anon_secret_fragment")}),u.jsxs("div",{className:"p-3 bg-surface/50 rounded-xl font-mono text-[11px] text-fg/30 break-all border border-border",children:[s.anonKey.substring(0,32),"..."]})]})]}):u.jsxs("div",{className:"flex flex-col items-center justify-center py-12 text-center space-y-6",children:[u.jsx(jr,{size:48,className:"text-fg/10"}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("p",{className:"font-bold italic uppercase tracking-tighter",children:a("account.no_resonance")}),u.jsx("p",{className:"text-xs text-fg/40 max-w-[240px]",children:a("account.no_resonance_desc")})]}),u.jsx("button",{onClick:()=>t(!0),className:"px-8 py-3 bg-primary text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] transition-all uppercase tracking-widest text-xs",children:a("account.initiate_link")})]})})]}),u.jsx(Kw,{open:e,onComplete:()=>t(!1),canClose:!0})]})}function Sh({active:e,icon:t,label:n,onClick:r}){return u.jsxs("button",{onClick:r,className:`w-full flex items-center gap-3 px-4 py-3 rounded-xl transition-all ${e?"glass bg-primary/10 text-primary border-primary/20 shadow-sm":"text-fg/40 hover:bg-surface hover:text-fg"}`,children:[e?ia.cloneElement(t,{className:"text-primary"}):t,u.jsx("span",{className:"font-semibold text-sm",children:n})]})}function jc({label:e,value:t,onChange:n,placeholder:r,type:s="text"}){return u.jsxs("div",{className:"space-y-1",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase text-fg/30 ml-1",children:e}),u.jsx("input",{type:s,value:t,onChange:o=>n(o.target.value),className:"w-full bg-surface border border-border rounded-xl py-3 px-4 text-sm text-fg placeholder:text-fg/40 focus:border-[var(--border-hover)] outline-none transition-all",placeholder:r})]})}function NL({signal:e,onClose:t}){const{t:n}=Ze(),[r,s]=ia.useState(!1);if(!e)return null;const o=()=>{const d=`# ${e.title}
|
|
76
|
+
|
|
77
|
+
**${n("discovery.category")}**: ${n(`common.categories.${e.category?.toLowerCase()||"other"}`,e.category||"Research")}
|
|
78
|
+
**${n("discovery.intelligence_score")}**: ${e.score}/100
|
|
79
|
+
**${n("discovery.discovered")}**: ${new Date(e.date).toLocaleDateString(n("common.locale_code",void 0))}
|
|
80
|
+
**${n("discovery.sources")}**: ${e.url||"N/A"}
|
|
81
|
+
|
|
82
|
+
## ${n("discovery.smart_summary")}
|
|
83
|
+
${e.summary}
|
|
84
|
+
|
|
85
|
+
${e.entities&&e.entities.length>0?`## ${n("discovery.entities")}
|
|
86
|
+
${e.entities.map(f=>`- ${f}`).join(`
|
|
87
|
+
`)}
|
|
88
|
+
`:""}
|
|
89
|
+
${e.content?`
|
|
90
|
+
## ${n("discovery.full_content")}
|
|
91
|
+
${e.content}`:""}`;navigator.clipboard.writeText(d),s(!0),setTimeout(()=>s(!1),2e3)},a=()=>{const d=`# ${e.title}
|
|
92
|
+
|
|
93
|
+
**${n("discovery.category")}**: ${n(`common.categories.${e.category?.toLowerCase()||"other"}`,e.category||"Research")}
|
|
94
|
+
**${n("discovery.intelligence_score")}**: ${e.score}/100
|
|
95
|
+
**${n("discovery.discovered")}**: ${new Date(e.date).toLocaleDateString(n("common.locale_code",void 0))}
|
|
96
|
+
**${n("discovery.sources")}**: ${e.url||"N/A"}
|
|
97
|
+
|
|
98
|
+
## ${n("discovery.smart_summary")}
|
|
99
|
+
${e.summary}
|
|
100
|
+
|
|
101
|
+
${e.entities&&e.entities.length>0?`## ${n("discovery.entities")}
|
|
102
|
+
${e.entities.map(y=>`- ${y}`).join(`
|
|
103
|
+
`)}
|
|
104
|
+
`:""}
|
|
105
|
+
${e.content?`
|
|
106
|
+
## ${n("discovery.full_content")}
|
|
107
|
+
${e.content}`:""}`,f=new Blob([d],{type:"text/markdown"}),p=URL.createObjectURL(f),g=document.createElement("a");g.href=p,g.download=`${e.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.md`,g.click(),URL.revokeObjectURL(p)},c=()=>{const d=JSON.stringify(e,null,2),f=new Blob([d],{type:"application/json"}),p=URL.createObjectURL(f),g=document.createElement("a");g.href=p,g.download=`signal_${e.id}.json`,g.click(),URL.revokeObjectURL(p)};return u.jsx(It,{children:u.jsx(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-bg/80 backdrop-blur-sm",onClick:t,children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},onClick:d=>d.stopPropagation(),className:"w-full max-w-4xl max-h-[90vh] glass flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"p-6 border-b border-border/10 flex items-start justify-between",children:[u.jsxs("div",{className:"flex-1 min-w-0 pr-4",children:[u.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[u.jsx("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-[10px] font-bold rounded border border-primary/20 uppercase tracking-wider",children:n(`common.categories.${e.category?.toLowerCase()||"other"}`,e.category||"Research")}),u.jsx("span",{className:`text-3xl font-black ${e.score>=80?"text-accent":"text-fg/40"}`,children:e.score})]}),u.jsx("h2",{className:"text-2xl font-bold leading-tight mb-2",children:e.title}),u.jsxs("p",{className:"text-xs text-fg/40 font-mono",children:[n("discovery.discovered")," ",new Date(e.date).toLocaleDateString(n("common.locale_code",void 0),{month:"long",day:"numeric",year:"numeric"})]})]}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-surface rounded-lg text-fg/40 hover:text-fg transition-all","aria-label":n("common.close"),children:u.jsx(an,{size:24})})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto custom-scrollbar p-6 space-y-6",children:[e.url&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40",children:n("discovery.original_source")}),u.jsxs("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-2 p-3 glass hover:bg-surface transition-all rounded-xl text-sm font-mono text-primary hover:text-accent group",children:[u.jsx(es,{size:16,className:"flex-shrink-0"}),u.jsx("span",{className:"truncate",children:e.url}),u.jsxs("span",{className:"ml-auto text-xs opacity-0 group-hover:opacity-100 transition-opacity",children:[n("discovery.open_link")," →"]})]})]}),e.entities&&e.entities.length>0&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40",children:n("discovery.entities")}),u.jsx("div",{className:"flex flex-wrap gap-2",children:e.entities.map(d=>u.jsx("span",{className:"px-3 py-1.5 bg-surface/50 border border-border/20 rounded-lg text-sm font-medium",children:d},d))})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40",children:n("discovery.ai_summary")}),u.jsx("div",{className:"p-4 glass rounded-xl",children:u.jsx("p",{className:"text-sm leading-relaxed text-fg/80",children:e.summary})})]}),e.content&&u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-xs font-bold uppercase tracking-widest text-fg/40",children:n("discovery.full_content")}),u.jsx("div",{className:"p-4 glass rounded-xl max-h-96 overflow-y-auto custom-scrollbar",children:u.jsx("p",{className:"text-sm leading-relaxed text-fg/60 whitespace-pre-wrap",children:e.content})})]})]}),u.jsxs("div",{className:"p-6 border-t border-border/10 flex items-center gap-3",children:[u.jsxs("button",{onClick:o,className:"flex-1 py-3 glass hover:bg-surface transition-all rounded-xl text-sm font-bold uppercase tracking-widest flex items-center justify-center gap-2",children:[r?u.jsx(Ps,{size:16,className:"text-success"}):u.jsx(Uf,{size:16}),n(r?"discovery.copied":"common.copy")]}),u.jsxs("button",{onClick:a,className:"flex-1 py-3 glass hover:bg-surface transition-all rounded-xl text-sm font-bold uppercase tracking-widest flex items-center justify-center gap-2",children:[u.jsx(Vh,{size:16}),"Markdown"]}),u.jsxs("button",{onClick:c,className:"flex-1 py-3 glass hover:bg-surface transition-all rounded-xl text-sm font-bold uppercase tracking-widest flex items-center justify-center gap-2",children:[u.jsx(Vh,{size:16}),"JSON"]})]})]})})})}function TL({isOpen:e,onClose:t}){const{t:n}=Ze(),{showToast:r}=Xc(),[s,o]=R.useState(""),[a,c]=R.useState(50),[d,f]=R.useState(!1),[p,g]=R.useState(!1);R.useEffect(()=>{e&&y()},[e]);const y=async()=>{const{data:{user:w}}=await oe.auth.getUser();if(!w)return;const{data:k}=await oe.from("alchemy_settings").select("*").eq("user_id",w.id).maybeSingle();if(k){c(k.max_urls_per_sync||50);const S=k.sync_start_date||k.last_sync_checkpoint;if(S){const E=new Date(S),j=N=>N<10?"0"+N:N,O=E.getFullYear()+"-"+j(E.getMonth()+1)+"-"+j(E.getDate())+"T"+j(E.getHours())+":"+j(E.getMinutes());o(O)}else o("")}},x=async()=>{f(!0);try{const{data:{user:w}}=await oe.auth.getUser();if(!w){r(n("discovery.login_to_save"),"error"),f(!1);return}const{error:k}=await oe.from("alchemy_settings").update({max_urls_per_sync:a,sync_start_date:s?new Date(s).toISOString():null}).eq("user_id",w.id);k?r(`${n("common.error")}: ${k.message}`,"error"):(r(n("discovery.sync_saved"),"success"),t())}catch(w){r(`${n("common.error")}: ${w.message}`,"error")}finally{f(!1)}},b=async()=>{g(!0);try{const{data:{user:w}}=await oe.auth.getUser();if(!w){r(n("discovery.login_to_reset"),"error"),g(!1);return}const{error:k}=await oe.from("alchemy_settings").update({last_sync_checkpoint:null}).eq("user_id",w.id);k?r(`${n("common.error")}: ${k.message}`,"error"):r(n("discovery.checkpoint_reset"),"success")}catch(w){r(`${n("common.error")}: ${w.message}`,"error")}finally{g(!1)}};return e?u.jsx("div",{className:"fixed inset-0 bg-black/50 backdrop-blur-sm flex items-center justify-center z-50 p-4",children:u.jsxs("div",{className:"bg-surface border border-border/20 rounded-2xl shadow-2xl max-w-lg w-full max-h-[90vh] overflow-y-auto",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border/10",children:[u.jsx("h2",{className:"text-xl font-bold",children:n("discovery.sync_settings")}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-black/10 rounded-lg transition-colors","aria-label":n("common.close"),children:u.jsx(an,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-6 space-y-6",children:[u.jsxs("div",{className:"space-y-3",children:[u.jsxs("label",{className:"text-sm font-semibold flex items-center gap-2",children:[u.jsx(yj,{className:"w-4 h-4 text-primary"}),n("discovery.sync_from")]}),u.jsx("input",{type:"datetime-local",value:s,onChange:w=>o(w.target.value),className:"w-full bg-black/20 border border-border/10 rounded-xl py-3 px-4 text-sm focus:border-primary/30 outline-none transition-all"}),u.jsx("p",{className:"text-xs text-fg/50",children:n("discovery.sync_from_hint")})]}),u.jsxs("div",{className:"space-y-3",children:[u.jsxs("div",{className:"flex justify-between items-center",children:[u.jsxs("label",{className:"text-sm font-semibold flex items-center gap-2",children:[u.jsx(jj,{className:"w-4 h-4 text-primary"}),n("discovery.urls_per_sync")]}),u.jsx("span",{className:"text-sm font-mono text-primary",children:a})]}),u.jsx("input",{type:"range",min:"5",max:"200",step:"5",value:a,onChange:w=>c(Number(w.target.value)),className:"w-full h-2 bg-black/20 rounded-lg appearance-none cursor-pointer accent-primary"}),u.jsxs("div",{className:"flex justify-between text-xs text-fg/30 font-medium",children:[u.jsx("span",{children:n("common.quick","Quick (5)")}),u.jsx("span",{children:n("common.balanced","Balanced (50)")}),u.jsx("span",{children:n("common.thorough","Thorough (200)")})]})]}),u.jsxs("div",{className:"pt-4 border-t border-border/10",children:[u.jsxs("button",{onClick:async()=>{f(!0);try{const{data:w}=await Ye.get("/api/browser-paths/auto-discover");if(w.success&&w.sources.length>0){const{data:{user:k}}=await oe.auth.getUser();k&&(await oe.from("alchemy_settings").update({custom_browser_paths:w.sources}).eq("user_id",k.id),r(n("engine.discovered_sources",{count:w.sources.length}),"success"))}else r(n("engine.no_sources_found"),"info")}catch{r(n("engine.discovery_failed"),"error")}finally{f(!1)}},disabled:d,className:"w-full px-4 py-2.5 bg-primary/10 hover:bg-primary/20 border border-primary/20 text-primary font-medium rounded-xl transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[u.jsx(oa,{size:16,className:d?"animate-spin":""}),d?n("common.searching","Searching..."):n("engine.auto_discover_sources","Auto-discover Sources")]}),u.jsx("p",{className:"text-xs text-fg/40 mt-2 text-center",children:n("engine.auto_discover_hint","Automatically find history paths for all browser profiles.")})]}),u.jsxs("div",{className:"pt-4 border-t border-border/10",children:[u.jsxs("button",{onClick:b,disabled:p,className:"w-full px-4 py-2.5 bg-warning/10 hover:bg-warning/20 border border-warning/20 text-warning font-medium rounded-xl transition-all flex items-center justify-center gap-2 text-sm disabled:opacity-50",children:[u.jsx(Mj,{size:16,className:p?"animate-spin":""}),p?n("common.resetting","Resetting..."):n("discovery.reset_checkpoint")]}),u.jsx("p",{className:"text-xs text-fg/40 mt-2 text-center",children:n("discovery.reset_checkpoint_hint")})]}),u.jsx("div",{className:"p-4 bg-primary/5 rounded-xl",children:u.jsx("p",{className:"text-xs text-primary/60 leading-relaxed",children:n("discovery.sync_info")})})]}),u.jsxs("div",{className:"flex gap-3 p-6 border-t border-border/10",children:[u.jsx("button",{onClick:t,className:"flex-1 px-4 py-2.5 bg-surface hover:bg-black/10 border border-border/10 rounded-xl font-medium transition-all",children:n("common.cancel")}),u.jsxs("button",{onClick:x,disabled:d,className:"flex-1 px-4 py-2.5 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg hover:scale-[1.02] active:scale-95 transition-all flex items-center justify-center gap-2 disabled:opacity-50",children:[u.jsx(wr,{size:18,className:d?"animate-spin":""}),n(d?"common.saving":"discovery.save_settings")]})]})]})}):null}const Vi=[{id:"ai",name:"AI & ML",icon:x_,color:"blue",priority:1},{id:"business",name:"Business",icon:mj,color:"purple",priority:1},{id:"politics",name:"Politics",icon:Nj,color:"red",priority:1},{id:"technology",name:"Technology",icon:b_,color:"cyan",priority:1},{id:"finance",name:"Finance",icon:wj,color:"green",priority:1},{id:"crypto",name:"Crypto",icon:fj,color:"orange",priority:1},{id:"science",name:"Science",icon:Oj,color:"teal",priority:1}],Dp={id:"other",name:"Other",icon:Wh,color:"gray",priority:3},AL=[...Vi,Dp];function RL(e){const t={blue:"bg-blue-500/20 text-blue-400 border-blue-500/30",purple:"bg-purple-500/20 text-purple-400 border-purple-500/30",red:"bg-red-500/20 text-red-400 border-red-500/30",cyan:"bg-cyan-500/20 text-cyan-400 border-cyan-500/30",green:"bg-green-500/20 text-green-400 border-green-500/30",orange:"bg-orange-500/20 text-orange-400 border-orange-500/30",teal:"bg-teal-500/20 text-teal-400 border-teal-500/30",gray:"bg-gray-500/20 text-gray-400 border-gray-500/30"};return t[e]||t.gray}function Yw(e,t){if(t){const n=t.toLowerCase().trim(),r=Vi.find(s=>s.id===n||s.name.toLowerCase()===n);if(r)return r.id;if(n==="other")return"other"}for(const n of e){const r=n.toLowerCase(),s=Vi.find(o=>r.includes(o.id)||r.includes(o.name.toLowerCase()));if(s)return s.id}return null}function PL({count:e}){const{t}=Ze();return e<=1?null:u.jsxs("div",{className:"absolute top-3 right-3 px-3 py-1.5 bg-gradient-to-r from-orange-500 to-red-500 rounded-full shadow-lg flex items-center gap-1.5 z-10",title:t("discovery.source_found_in",{count:e}),children:[u.jsx("span",{className:"text-lg",children:"🔥"}),u.jsx("span",{className:"text-white font-bold text-sm",children:e===1?t("discovery.source_count_one",{count:e}):t("discovery.source_count_other",{count:e})})]})}function OL({urls:e,timestamps:t=[]}){const{t:n}=Ze(),[r,s]=R.useState(!1);return e.length<=1?null:u.jsxs("div",{className:"mt-4 border-t border-border pt-4",children:[u.jsxs("button",{onClick:()=>s(!r),className:"flex items-center justify-between w-full text-sm text-fg/60 hover:text-fg transition-colors",children:[u.jsxs("span",{className:"font-medium",children:[n("discovery.view_all_sources")," (",e.length,")"]}),u.jsx(Is,{size:16,className:`transition-transform duration-200 ${r?"rotate-180":""}`})]}),r&&u.jsx("div",{className:"mt-3 space-y-2 animate-in fade-in slide-in-from-top-2 duration-200",children:e.map((o,a)=>u.jsxs("div",{className:"flex items-start gap-2 text-xs p-2 rounded-lg hover:bg-surface/50 transition-colors",children:[u.jsx(es,{size:12,className:"text-primary mt-0.5 flex-shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("a",{href:o,target:"_blank",rel:"noopener noreferrer",className:"text-fg/70 hover:text-primary underline truncate block",children:o}),t[a]&&u.jsx("span",{className:"text-fg/40 text-[10px]",children:new Date(t[a]).toLocaleDateString(n("common.locale_code",void 0),{month:"short",day:"numeric",year:"numeric"})})]})]},a))})]})}function Mp({signal:e,onOpen:t,onFavourite:n,onNote:r,onBoost:s,onDismiss:o}){const{t:a}=Ze(),[c,d]=R.useState(!1),f=x=>x>=80?"text-yellow-400 border-yellow-400/30":x>=50?"text-blue-400 border-blue-400/30":"text-gray-400 border-gray-400/30",p=x=>x>=80?a("discovery.score_high"):x>=50?a("discovery.score_medium"):a("discovery.score_low"),g=(x,b)=>{const w=Yw(b||[],x);if(w){const k=Vi.find(S=>S.id===w);if(k)return k}return Dp},y=x=>{const b=new Date(x),k=new Date().getTime()-b.getTime(),S=Math.floor(k/6e4),E=Math.floor(k/36e5),j=Math.floor(k/864e5);return S<60?a("discovery.time_min_ago",{count:S}):E<24?a("discovery.time_hour_ago",{count:E}):j<7?a("discovery.time_day_ago",{count:j}):b.toLocaleDateString(void 0,{month:"short",day:"numeric"})};return u.jsxs(Le.div,{whileHover:{scale:1.01,translateY:-2},onHoverStart:()=>d(!0),onHoverEnd:()=>d(!1),className:`relative bg-surface/50 backdrop-blur-sm border rounded-xl p-5 flex flex-col gap-4 transition-all duration-300 ${e.is_favorite?"border-yellow-500/30 shadow-[0_0_20px_rgba(234,179,8,0.1)]":e.is_dismissed?"opacity-50 grayscale":"border-border"}`,children:[u.jsx(PL,{count:e.mention_count||1}),u.jsxs("div",{className:"flex items-start justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("div",{className:`flex flex-col items-center justify-center w-14 h-14 rounded-2xl border ${f(e.score)} bg-surface`,children:[u.jsx("span",{className:"text-xl font-bold",children:e.score}),u.jsx("span",{className:"text-[9px] font-bold tracking-wider opacity-70",children:p(e.score)})]}),u.jsxs("div",{children:[(()=>{const x=g(e.category,e.tags),b=x.icon;return u.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[u.jsxs("span",{className:"px-2 py-0.5 bg-primary/10 text-primary text-[10px] font-bold uppercase tracking-wider rounded border border-primary/20 flex items-center gap-1.5 w-fit",children:[u.jsx(b,{size:10}),x.name]}),e.is_boosted&&u.jsxs("span",{className:"px-2 py-0.5 bg-accent/10 text-accent text-[10px] font-bold uppercase tracking-wider rounded border border-accent/20 flex items-center gap-1 w-fit",children:[u.jsx(Kh,{size:10}),a("discovery.boosted")]}),e.is_dismissed&&u.jsxs("span",{className:"px-2 py-0.5 bg-red-500/10 text-red-400 text-[10px] font-bold uppercase tracking-wider rounded border border-red-500/20 flex items-center gap-1 w-fit",children:[u.jsx(Xy,{size:10}),a("discovery.dismissed")]})]})})(),u.jsxs("div",{className:"flex items-center gap-1.5 text-xs text-fg/40 font-mono",children:[u.jsx(Di,{size:10}),y(e.created_at),(e.mention_count||1)>1&&u.jsxs(u.Fragment,{children:[u.jsx("span",{children:"•"}),u.jsx("span",{children:a("discovery.sources_count",{count:e.mention_count})})]})]})]})]}),n&&u.jsx("button",{onClick:()=>n(e.id,!!e.is_favorite),className:`p-2 rounded-lg transition-all ${e.is_favorite?"bg-yellow-500/10 text-yellow-500 hover:bg-yellow-500/20":"bg-white/5 text-fg/40 hover:bg-white/10 hover:text-yellow-500"}`,title:e.is_favorite?a("discovery.remove_favourite"):a("discovery.add_favourite"),children:u.jsx(Uj,{size:18,fill:e.is_favorite?"currentColor":"none"})})]}),u.jsxs("div",{className:"flex-1",children:[u.jsx("a",{href:e.url,target:"_blank",rel:"noopener noreferrer",className:"text-base font-bold text-fg/90 hover:text-primary transition-colors line-clamp-2 mb-2 leading-tight block",onClick:x=>{x.preventDefault(),t?.(e.url)},children:e.title}),u.jsx("p",{className:"text-xs text-fg/60 line-clamp-3 leading-relaxed",children:e.summary}),e.user_notes&&u.jsxs("div",{className:"mt-3 p-3 bg-yellow-500/5 border border-yellow-500/20 rounded-lg flex gap-2",children:[u.jsx(Mi,{size:14,className:"text-yellow-500 shrink-0 mt-0.5"}),u.jsxs("p",{className:"text-xs text-fg/80 italic font-medium line-clamp-2",children:['"',e.user_notes,'"']})]})]}),e.entities&&e.entities.length>0&&u.jsxs("div",{className:"flex flex-wrap gap-1.5",children:[e.entities.slice(0,4).map((x,b)=>u.jsx("span",{className:"px-2 py-0.5 bg-white/5 text-fg/50 text-[10px] rounded border border-white/5",children:x},b)),e.entities.length>4&&u.jsxs("span",{className:"px-2 py-0.5 text-fg/30 text-[10px]",children:["+",e.entities.length-4]})]}),u.jsx(OL,{urls:e.metadata?.source_urls||[],timestamps:e.metadata?.timestamps||[]}),u.jsxs("div",{className:"grid grid-cols-5 gap-2 pt-2 border-t border-border",children:[u.jsxs("button",{onClick:()=>t?.(e.url),className:"flex items-center justify-center gap-1.5 px-3 py-2 bg-white/5 hover:bg-white/10 rounded-lg transition-colors text-xs font-semibold text-fg/70",title:a("discovery.open_source"),children:[u.jsx(es,{size:14}),a("discovery.open_source")]}),r&&u.jsxs("button",{onClick:()=>r(e.id,e.user_notes||null,e.title),className:`flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg transition-colors text-xs font-semibold ${e.user_notes?"bg-blue-500/10 text-blue-400 hover:bg-blue-500/20":"bg-white/5 text-fg/70 hover:bg-white/10 hover:text-blue-400"}`,title:a("discovery.add_note"),children:[u.jsx(Mi,{size:14}),a("discovery.add_note")]}),s&&u.jsxs("button",{onClick:()=>s(e.id,!!e.is_boosted),className:`col-span-2 flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg transition-colors text-xs font-semibold ${e.is_boosted?"bg-accent/20 text-accent hover:bg-accent/30 shadow-sm border border-accent/20":"bg-white/5 text-fg/70 hover:bg-accent/10 hover:text-accent group"}`,title:a("discovery.boost_topic"),children:[u.jsx(Kh,{size:14,className:e.is_boosted?"fill-current":"group-hover:text-accent"}),e.is_boosted?a("discovery.boosted"):a("discovery.boost_topic")]}),o&&u.jsx("button",{onClick:()=>o(e.id,!!e.is_dismissed),className:`flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg transition-colors text-xs font-semibold ${e.is_dismissed?"bg-red-500/10 text-red-400 hover:bg-red-500/20":"bg-white/5 text-fg/70 hover:bg-white/10 hover:text-red-400"}`,title:a("discovery.dismiss_hint"),children:u.jsx(Xy,{size:14})})]})]})}function Qw({isOpen:e,onClose:t,initialNote:n,title:r,onSave:s}){const{t:o}=Ze(),[a,c]=R.useState(n||""),[d,f]=R.useState(!1);R.useEffect(()=>{c(n||"")},[n,e]);const p=async()=>{f(!0);try{await s(a),t()}catch(g){console.error("Failed to save note:",g)}finally{f(!1)}};return u.jsx(It,{children:e&&u.jsxs(u.Fragment,{children:[u.jsx(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-[60]"}),u.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center p-4 pointer-events-none",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:"bg-bg border border-border rounded-xl shadow-2xl w-full max-w-lg overflow-hidden pointer-events-auto",children:[u.jsxs("div",{className:"p-4 border-b border-border flex items-center justify-between bg-surface/30",children:[u.jsxs("h3",{className:"font-bold flex items-center gap-2",children:[u.jsx(Mi,{size:18,className:"text-primary"}),o("discovery.add_note_title")]}),u.jsx("button",{onClick:t,className:"p-1 hover:bg-surface rounded text-fg/40 hover:text-fg transition-colors",children:u.jsx(an,{size:18})})]}),u.jsxs("div",{className:"p-4 space-y-3",children:[u.jsxs("p",{className:"text-xs text-fg/50 line-clamp-1 font-mono",children:[o("discovery.target"),": ",r]}),u.jsx("textarea",{value:a,onChange:g=>c(g.target.value),placeholder:o("discovery.note_placeholder"),className:"w-full h-40 bg-surface/50 border border-border/20 rounded-lg p-3 text-sm focus:border-primary/50 focus:ring-1 focus:ring-primary/20 outline-none resize-none placeholder:text-fg/20",autoFocus:!0})]}),u.jsxs("div",{className:"p-4 border-t border-border bg-surface/10 flex justify-end gap-2",children:[u.jsx("button",{onClick:t,className:"px-4 py-2 hover:bg-surface rounded-lg text-xs font-bold text-fg/60 transition-colors",disabled:d,children:o("common.cancel")}),u.jsx("button",{onClick:p,disabled:d,className:"px-4 py-2 bg-primary hover:bg-primary/90 text-white rounded-lg text-xs font-bold flex items-center gap-2 transition-colors disabled:opacity-50",children:d?u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"w-3 h-3 border-2 border-white/30 border-t-white rounded-full animate-spin"}),o("common.saving")]}):u.jsxs(u.Fragment,{children:[u.jsx(wr,{size:14}),o("discovery.save_note")]})})]})]})})]})})}function LL({initialState:e}){const{t}=Ze(),[n,r]=R.useState([]),[s,o]=R.useState(!0),[a,c]=R.useState(null),[d,f]=R.useState(null),[p,g]=R.useState([]),[y,x]=R.useState([]),[b,w]=R.useState([]),[k,S]=R.useState(!1),[E,j]=R.useState(!1),[O,N]=R.useState(!1),[T,I]=R.useState(!1),[V,U]=R.useState(null),[D,Z]=R.useState(0),[Y,he]=R.useState(""),[G,W]=R.useState(null),[ne,re]=R.useState("all"),[J,ce]=R.useState(!1),[A,M]=R.useState([]),[K,P]=R.useState([]),[te,me]=R.useState([]),[ye,Fe]=R.useState({errors:0,signals:0});R.useEffect(()=>{Te()},[]),R.useEffect(()=>{T&&Ie(D)},[T,D,G,ne]),R.useEffect(()=>{const ee=setTimeout(()=>{T&&Ie(0)},500);return()=>clearTimeout(ee)},[Y]),R.useEffect(()=>{e&&(e.type==="blacklist_suggestion"&&(M(e.data?.suggestions||[]),j(!0)),e.filter==="errors"&&(N(!0),Ae()))},[e]),R.useEffect(()=>{if(n.length>0){const ee=n.reduce((Se,ve)=>Se+ve.errors,0),pe=n.reduce((Se,ve)=>Se+ve.signals_found,0);Fe({errors:ee,signals:pe})}},[n]);const Ae=async()=>{const{data:{user:ee}}=await oe.auth.getUser();if(!ee)return;const{data:pe,error:Se}=await oe.from("processing_events").select("*").eq("user_id",ee.id).eq("event_type","error").order("created_at",{ascending:!1}).limit(50);!Se&&pe&&P(pe)},Ie=async(ee=0)=>{ce(!0);const{data:{user:pe}}=await oe.auth.getUser();if(!pe)return;const Se=20,ve=ee*Se,Be=ve+Se-1;let we=oe.from("signals").select("*").eq("user_id",pe.id).order("created_at",{ascending:!1}).range(ve,Be);G&&(we=we.eq("category",G)),ne==="high"?we=we.gte("score",80):ne==="medium"?we=we.gte("score",50).lt("score",80):ne==="low"&&(we=we.lt("score",50)),Y&&(we=we.or(`title.ilike.%${Y}%,url.ilike.%${Y}%`));const{data:nt,error:st}=await we;!st&&nt&&me(nt),ce(!1)},Te=async()=>{o(!0);try{const{data:{user:ee}}=await oe.auth.getUser();if(!ee)return;const{data:pe,error:Se}=await oe.from("processing_events").select("*").eq("user_id",ee.id).eq("agent_state","Completed").order("created_at",{ascending:!1}).limit(50);if(Se){console.error("Error fetching sync runs:",Se);return}const ve=(pe||[]).map(Be=>{const we=Be.metadata||{},nt=we.errors||0,st=we.signals_found||0,it=we.skipped||0;return{id:Be.id,started_at:Be.created_at,completed_at:Be.created_at,duration_ms:Be.duration_ms||0,signals_found:st,urls_processed:we.total_urls||0,skipped:it,errors:nt,status:nt>0?"partial":st>0?"success":"failed"}});r(ve)}catch(ee){console.error("Failed to fetch sync runs:",ee)}finally{o(!1)}},Je=async ee=>{S(!0);try{const{data:{user:pe}}=await oe.auth.getUser();if(!pe)return;const Se=n.find(_e=>_e.id===ee);if(!Se)return;const ve=new Date(new Date(Se.started_at).getTime()-Se.duration_ms),Be=new Date(Se.completed_at),{data:we,error:nt}=await oe.from("processing_events").select("*").eq("user_id",pe.id).gte("created_at",ve.toISOString()).lte("created_at",Be.toISOString()).order("created_at",{ascending:!0});if(nt){console.error("Error fetching run events:",nt);return}g(we||[]);const st=[],it=(we||[]).filter(_e=>_e.agent_state==="Mining"&&_e.message.includes("Mining source:"));for(const _e of it){const Ve=_e.message.match(/Mining source: (.+) \((.+)\)/);if(Ve){const He=Ve[1],lt=Ve[2],$t=(we||[]).find(tn=>tn.agent_state==="Mining"&&tn.message.includes("Found")&&tn.message.includes(He)&&tn.created_at>_e.created_at),Nt=$t?.message.match(/Found (\d+) URLs/),cn=Nt?parseInt(Nt[1]):0;st.push({label:He,browser:lt,urls_found:cn,duration_ms:$t?.duration_ms||0,status:_e.event_type==="error"?"error":"success"})}}x(st);const Q=[],le=(we||[]).filter(_e=>_e.agent_state==="Reading");for(const _e of le){const Ve=_e.message.match(/Reading content from: (.+)/);if(!Ve)continue;const He=Ve[1];let lt=st.length>0?st[0].label:"Unknown";const $t=st.filter(We=>We.urls_found>0);($t.length===1||$t.length>1)&&(lt=$t[0].label),console.log(`[SystemLogs] URL ${He} assigned to source: ${lt}`);const Nt=(we||[]).find(We=>We.agent_state==="Signal"&&We.created_at>_e.created_at&&We.message.includes("Found signal")),cn=(we||[]).find(We=>We.agent_state==="Skipped"&&We.created_at>_e.created_at&&We.message.includes("Irrelevant content")),tn=(we||[]).find(We=>We.event_type==="error"&&We.created_at>_e.created_at);if(Nt){const We=Nt.message.match(/\((\d+)%\)/),un=We?parseInt(We[1]):0;Q.push({url:He,result:"signal",score:un,category:Nt.details?.category||"Unknown",duration_ms:Nt.duration_ms,source_label:lt})}else if(cn){const We=cn.message.match(/\((\d+)%\): (.+)/),un=We?parseInt(We[1]):0,nn=We?We[2]:"Irrelevant";Q.push({url:He,result:"skipped",score:un,reason:nn,duration_ms:cn.duration_ms,source_label:lt})}else tn&&Q.push({url:He,result:"error",reason:tn.message,source_label:lt})}w(Q)}catch(pe){console.error("Failed to fetch run details:",pe)}finally{S(!1)}},et=ee=>{a===ee?(c(null),f(null),x([]),w([])):(c(ee),f(null),Je(ee))},Ce=ee=>{f(d===ee?null:ee)},gt=ee=>{if(ee<1e3)return`${ee}ms`;const pe=Math.floor(ee/1e3);if(pe<60)return`${pe}s`;const Se=Math.floor(pe/60),ve=pe%60;return`${Se}m ${ve}s`},X=ee=>{switch(ee){case"success":return u.jsx(Rs,{className:"w-5 h-5 text-success"});case"failed":return u.jsx(xs,{className:"w-5 h-5 text-error"});case"partial":return u.jsx(ar,{className:"w-5 h-5 text-warning"});default:return u.jsx(Di,{className:"w-5 h-5 text-fg/40"})}},ke=ee=>{switch(ee){case"signal":return u.jsx(Ft,{className:"w-4 h-4 text-primary"});case"skipped":return u.jsx(Fj,{className:"w-4 h-4 text-fg/40"});case"error":return u.jsx(xs,{className:"w-4 h-4 text-error"});default:return null}};return s?u.jsx("div",{className:"flex items-center justify-center h-full",children:u.jsx("div",{className:"w-12 h-12 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})}):u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden p-8",children:[u.jsxs("div",{className:"mb-6",children:[u.jsx("h2",{className:"text-2xl font-bold",children:t("logs.title")}),u.jsx("p",{className:"text-sm text-fg/50",children:t("logs.desc")}),u.jsxs("div",{className:"grid grid-cols-3 gap-4 mt-6",children:[u.jsxs("div",{className:"glass p-4 rounded-xl border border-border/10 hover:bg-surface/50 transition-colors cursor-pointer group relative overflow-hidden",onClick:()=>j(!0),children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-fg/40",children:t("logs.blacklist_suggestion")}),u.jsx(ar,{size:16,className:"text-orange-400"})]}),u.jsx("div",{className:"text-2xl font-black text-fg/90",children:A.length>0?A.length:"--"}),u.jsx("div",{className:"text-[10px] text-fg/40 mt-1",children:t("logs.blacklist_desc")}),A.length>0&&u.jsxs("div",{className:"absolute top-2 right-2 flex h-2 w-2",children:[u.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-orange-400 opacity-75"}),u.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-orange-400"})]})]}),u.jsxs("div",{className:"glass p-4 rounded-xl border border-border/10 hover:bg-surface/50 transition-colors cursor-pointer group",onClick:()=>{N(!0),Ae()},children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-fg/40",children:t("logs.recent_errors")}),u.jsx(xs,{size:16,className:"text-error"})]}),u.jsx("div",{className:"text-2xl font-black text-fg/90",children:ye.errors}),u.jsx("div",{className:"text-[10px] text-fg/40 mt-1",children:t("logs.errors_desc")})]}),u.jsxs("div",{className:"glass p-4 rounded-xl border border-border/10 hover:bg-surface/50 transition-colors cursor-pointer group",onClick:()=>{I(!0),Ie()},children:[u.jsxs("div",{className:"flex items-center justify-between mb-2",children:[u.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-fg/40",children:t("logs.total_signals")}),u.jsx(Ft,{size:16,className:"text-primary"})]}),u.jsx("div",{className:"text-2xl font-black text-fg/90",children:ye.signals}),u.jsx("div",{className:"text-[10px] text-fg/40 mt-1",children:t("logs.signals_desc")})]})]})]}),u.jsxs(It,{children:[E&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg border border-border rounded-xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"p-6 border-b border-border flex items-center justify-between bg-surface/30",children:[u.jsxs("div",{children:[u.jsxs("h3",{className:"text-xl font-bold flex items-center gap-2",children:[u.jsx(ar,{className:"text-orange-400"}),t("logs.blacklist_modal_title")]}),u.jsx("p",{className:"text-sm text-fg/60",children:t("logs.blacklist_modal_desc")})]}),u.jsx("button",{onClick:()=>j(!1),className:"p-2 hover:bg-surface rounded-lg transition-colors",children:u.jsx(xs,{size:20,className:"text-fg/40"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-surface/10 space-y-4",children:A.length===0?u.jsxs("div",{className:"text-center py-12 text-fg/40",children:[u.jsx("div",{className:"bg-surface/50 w-16 h-16 rounded-full flex items-center justify-center mx-auto mb-4",children:u.jsx(Rs,{size:32,className:"text-success"})}),u.jsx("p",{className:"font-medium",children:t("logs.no_suggestions")}),u.jsx("p",{className:"text-xs opacity-70 mt-1",children:t("logs.quality_good")})]}):A.map((ee,pe)=>u.jsxs("div",{className:"glass p-4 rounded-xl border border-border/10 flex items-center justify-between group hover:border-primary/20 transition-all",children:[u.jsxs("div",{children:[u.jsx("div",{className:"font-mono text-sm font-bold text-fg/90",children:ee.domain}),u.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[u.jsx("span",{className:"text-[10px] bg-surface px-1.5 py-0.5 rounded text-fg/50",children:t("logs.signals_count",{count:ee.signalCount})}),u.jsx("span",{className:"text-[10px] bg-surface px-1.5 py-0.5 rounded text-fg/50",children:t("logs.avg_score",{score:ee.avgScore})}),u.jsx("span",{className:"text-[10px] text-orange-400 font-medium",children:ee.reason==="low_score"?t("logs.low_quality"):t("logs.repetitive")})]})]}),u.jsx("button",{onClick:async()=>{const{data:{user:Se}}=await oe.auth.getUser();if(Se){const{data:ve}=await oe.from("alchemy_settings").select("blacklist_domains").eq("user_id",Se.id).single(),Be=ve?.blacklist_domains||[];Be.includes(ee.domain)||await oe.from("alchemy_settings").update({blacklist_domains:[...Be,ee.domain]}).eq("user_id",Se.id),M(we=>we.filter(nt=>nt.domain!==ee.domain))}},className:"px-4 py-2 bg-orange-500/10 text-orange-500 hover:bg-orange-500 hover:text-white rounded-lg text-xs font-bold transition-all border border-orange-500/20",children:t("logs.blacklist_domain")})]},pe))})]})}),O&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg border border-border rounded-xl shadow-2xl w-full max-w-2xl max-h-[80vh] flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"p-6 border-b border-border flex items-center justify-between bg-surface/30",children:[u.jsxs("div",{children:[u.jsxs("h3",{className:"text-xl font-bold flex items-center gap-2",children:[u.jsx(xs,{className:"text-error"}),t("logs.errors_modal_title")]}),u.jsx("p",{className:"text-sm text-fg/60",children:t("logs.errors_modal_desc")})]}),u.jsx("button",{onClick:()=>N(!1),className:"p-2 hover:bg-surface rounded-lg transition-colors",children:u.jsx(xs,{size:20,className:"text-fg/40"})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-surface/10 space-y-3",children:K.length===0?u.jsxs("div",{className:"text-center py-12 text-fg/40",children:[u.jsx(Rs,{size:32,className:"mx-auto mb-4 text-success opacity-50"}),u.jsx("p",{children:t("logs.no_recent_errors")})]}):K.map((ee,pe)=>u.jsxs("div",{className:"glass p-4 rounded-xl border border-error/20 bg-error/5 flex items-start gap-3",children:[u.jsx(ar,{size:16,className:"text-error mt-0.5 shrink-0"}),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsxs("div",{className:"flex items-center justify-between mb-1",children:[u.jsx("span",{className:"text-xs font-mono text-fg/40",children:new Date(ee.created_at).toLocaleString()}),u.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider text-error",children:ee.agent_state})]}),u.jsx("p",{className:"text-sm font-mono text-fg/90 break-words",children:ee.message}),ee.details&&Object.keys(ee.details).length>0&&u.jsx("pre",{className:"mt-2 p-2 bg-black/20 rounded text-[10px] text-fg/60 overflow-x-auto",children:JSON.stringify(ee.details,null,2)})]})]},pe))})]})})]}),u.jsx(It,{children:T&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-sm",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg border border-border rounded-xl shadow-2xl w-full max-w-5xl h-[85vh] flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"p-6 border-b border-border bg-surface/30 space-y-4",children:[u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{children:[u.jsxs("h3",{className:"text-xl font-bold flex items-center gap-2",children:[u.jsx(Ft,{className:"text-primary"}),t("logs.signals_modal_title")]}),u.jsx("p",{className:"text-sm text-fg/60",children:t("logs.signals_modal_desc")})]}),u.jsx("button",{onClick:()=>I(!1),className:"p-2 hover:bg-surface rounded-lg transition-colors",children:u.jsx(xs,{size:20,className:"text-fg/40"})})]}),u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsxs("div",{className:"relative flex-1",children:[u.jsx("input",{type:"text",placeholder:t("logs.search_placeholder"),className:"w-full bg-black/5 border border-border/20 rounded-lg pl-9 pr-4 py-2 text-sm text-fg focus:ring-2 focus:ring-primary/20 focus:border-primary/50 outline-none",value:Y,onChange:ee=>{he(ee.target.value),Z(0)},onKeyDown:ee=>ee.key==="Enter"&&Ie(0)}),u.jsx(oa,{className:"absolute left-3 top-2.5 w-4 h-4 text-fg/40"})]}),u.jsxs("select",{className:"bg-black/5 border border-border/20 rounded-lg px-3 py-2 text-sm text-fg outline-none focus:border-primary/50",value:ne||"all",onChange:ee=>{re(ee.target.value),Z(0)},children:[u.jsx("option",{value:"all",children:t("logs.any_score")}),u.jsx("option",{value:"high",children:t("logs.high_score")}),u.jsx("option",{value:"medium",children:t("logs.medium_score")}),u.jsx("option",{value:"low",children:t("logs.low_score")})]}),u.jsxs("select",{className:"bg-black/5 border border-border/20 rounded-lg px-3 py-2 text-sm text-fg outline-none focus:border-primary/50",value:G||"",onChange:ee=>{W(ee.target.value||null),Z(0)},children:[u.jsx("option",{value:"",children:t("logs.all_categories")}),u.jsx("option",{value:"AI & ML",children:"AI & ML"}),u.jsx("option",{value:"Technology",children:"Technology"}),u.jsx("option",{value:"Business",children:"Business"}),u.jsx("option",{value:"Finance",children:"Finance"}),u.jsx("option",{value:"Politics",children:"Politics"}),u.jsx("option",{value:"Science",children:"Science"}),u.jsx("option",{value:"Crypto",children:"Crypto"}),u.jsx("option",{value:"Other",children:"Other"})]}),u.jsxs("div",{className:"flex items-center gap-2 border-l border-border/10 pl-4",children:[u.jsx("button",{disabled:D===0,onClick:()=>Z(ee=>Math.max(0,ee-1)),className:"p-2 hover:bg-surface rounded-lg disabled:opacity-30 transition-colors",children:u.jsx(vj,{size:20})}),u.jsx("span",{className:"text-xs font-mono text-fg/50 w-16 text-center",children:t("logs.page_x",{page:D+1})}),u.jsx("button",{disabled:te.length<20,onClick:()=>Z(ee=>ee+1),className:"p-2 hover:bg-surface rounded-lg disabled:opacity-30 transition-colors",children:u.jsx(nc,{size:20})})]})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-surface/10",children:J?u.jsx("div",{className:"h-full flex items-center justify-center",children:u.jsx("div",{className:"w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})}):te.length===0?u.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-fg/40 gap-4",children:[u.jsx("div",{className:"w-16 h-16 rounded-full bg-surface/50 flex items-center justify-center",children:u.jsx(Ft,{size:32,className:"opacity-50"})}),u.jsx("p",{children:"No signals found matching your criteria."})]}):u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:te.map(ee=>u.jsx(Mp,{signal:ee,onOpen:pe=>window.open(pe,"_blank"),onFavourite:async(pe,Se)=>{const ve=!Se;me(Be=>Be.map(we=>we.id===pe?{...we,is_favorite:ve}:we)),await oe.from("signals").update({is_favorite:ve}).eq("id",pe)},onBoost:async(pe,Se)=>{const ve=!Se;me(Be=>Be.map(we=>we.id===pe?{...we,is_boosted:ve}:we));try{const{data:{session:Be}}=await oe.auth.getSession(),we=Be?.access_token,nt=Zr(),st={"Content-Type":"application/json","x-user-id":Be?.user?.id||""};if(we&&(st.Authorization=`Bearer ${we}`),nt&&(st["x-supabase-url"]=nt.url,st["x-supabase-key"]=nt.anonKey),!(await fetch(`/api/signals/${pe}/boost`,{method:"POST",headers:st,body:JSON.stringify({value:ve,settings:{}})})).ok)throw new Error("Boost failed")}catch(Be){console.error("Boost API error:",Be),me(we=>we.map(nt=>nt.id===pe?{...nt,is_boosted:Se}:nt))}},onDismiss:async(pe,Se)=>{const ve=!Se;me(Be=>Be.map(we=>we.id===pe?{...we,is_dismissed:ve}:we)),await oe.from("signals").update({is_dismissed:ve}).eq("id",pe)},onNote:(pe,Se,ve)=>U({id:pe,note:Se,title:ve})},ee.id))})})]})})}),V&&u.jsx(Qw,{isOpen:!!V,onClose:()=>U(null),title:V.title,initialNote:V.note,onSave:async ee=>{V&&(me(pe=>pe.map(Se=>Se.id===V.id?{...Se,user_notes:ee}:Se)),await oe.from("signals").update({user_notes:ee}).eq("id",V.id),U(null))}}),u.jsx("div",{className:"flex-1 overflow-y-auto custom-scrollbar",children:n.length===0?u.jsxs("div",{className:"text-center py-12 text-fg/40",children:[u.jsx(Di,{className:"w-12 h-12 mx-auto mb-4 opacity-50"}),u.jsx("p",{children:"No sync runs yet"})]}):u.jsx("div",{className:"space-y-2",children:n.map(ee=>u.jsxs("div",{className:"glass rounded-xl overflow-hidden",children:[u.jsxs("button",{onClick:()=>et(ee.id),className:"w-full p-4 flex items-center gap-4 hover:bg-surface/50 transition-colors text-left",children:[a===ee.id?u.jsx(Is,{className:"w-5 h-5 text-primary shrink-0"}):u.jsx(nc,{className:"w-5 h-5 text-fg/40 shrink-0"}),X(ee.status),u.jsxs("div",{className:"flex-1 grid grid-cols-6 gap-4 items-center",children:[u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"Timestamp"}),u.jsx("div",{className:"text-sm font-mono",children:new Date(ee.started_at).toLocaleString([],{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})})]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"Duration"}),u.jsx("div",{className:"text-sm font-mono",children:gt(ee.duration_ms)})]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"Signals"}),u.jsx("div",{className:"text-sm font-semibold text-primary",children:ee.signals_found})]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"Skipped"}),u.jsx("div",{className:"text-sm font-semibold text-fg/60",children:ee.skipped})]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"URLs"}),u.jsx("div",{className:"text-sm font-semibold",children:ee.urls_processed})]}),u.jsxs("div",{children:[u.jsx("div",{className:"text-xs text-fg/40 uppercase tracking-wider",children:"Errors"}),u.jsx("div",{className:`text-sm font-semibold ${ee.errors>0?"text-error":"text-fg/40"}`,children:ee.errors})]})]})]}),u.jsx(It,{children:a===ee.id&&u.jsx(Le.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"border-t border-border overflow-hidden",children:u.jsx("div",{className:"p-4 bg-surface/30 space-y-2",children:k?u.jsx("div",{className:"flex items-center justify-center py-8",children:u.jsx("div",{className:"w-8 h-8 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})}):y.length===0?u.jsx("div",{className:"text-center py-4 text-fg/40 text-sm",children:"No source details available"}):y.map((pe,Se)=>u.jsxs("div",{className:"glass rounded-lg overflow-hidden",children:[u.jsxs("button",{onClick:()=>Ce(pe.label),className:"w-full p-3 flex items-center gap-3 hover:bg-surface/50 transition-colors text-left",children:[d===pe.label?u.jsx(Is,{className:"w-4 h-4 text-primary shrink-0"}):u.jsx(nc,{className:"w-4 h-4 text-fg/40 shrink-0"}),u.jsxs("div",{className:"flex-1 flex items-center gap-4",children:[u.jsxs("div",{className:"flex-1",children:[u.jsx("div",{className:"text-sm font-semibold",children:pe.label}),u.jsx("div",{className:"text-xs text-fg/40",children:pe.browser})]}),u.jsxs("div",{className:"text-right",children:[u.jsx("div",{className:"text-xs text-fg/40",children:"URLs Found"}),u.jsx("div",{className:"text-sm font-semibold",children:pe.urls_found})]}),u.jsxs("div",{className:"text-right",children:[u.jsx("div",{className:"text-xs text-fg/40",children:"Duration"}),u.jsx("div",{className:"text-sm font-mono",children:gt(pe.duration_ms)})]})]})]}),u.jsx(It,{children:d===pe.label&&u.jsx(Le.div,{initial:{height:0,opacity:0},animate:{height:"auto",opacity:1},exit:{height:0,opacity:0},transition:{duration:.2},className:"border-t border-border overflow-hidden",children:u.jsx("div",{className:"p-3 bg-surface/50 max-h-96 overflow-y-auto custom-scrollbar space-y-1",children:b.filter(ve=>ve.source_label===pe.label).length===0?u.jsx("div",{className:"text-center py-4 text-fg/40 text-xs",children:"No URL details available for this source"}):b.filter(ve=>ve.source_label===pe.label).map((ve,Be)=>u.jsxs("div",{className:"flex items-center gap-2 p-2 rounded bg-surface/30 hover:bg-surface/50 transition-colors",children:[ke(ve.result),u.jsxs("div",{className:"flex-1 min-w-0",children:[u.jsx("div",{className:"text-xs font-mono truncate text-fg/80",children:ve.url}),ve.result==="signal"&&u.jsxs("div",{className:"text-[10px] text-primary",children:["Signal (",ve.score,"%) - ",ve.category]}),ve.result==="skipped"&&u.jsxs("div",{className:"text-[10px] text-fg/40",children:["Skipped (",ve.score,"%) - ",ve.reason]}),ve.result==="error"&&u.jsxs("div",{className:"text-[10px] text-error",children:["Error: ",ve.reason]})]}),u.jsx("a",{href:ve.url,target:"_blank",rel:"noopener noreferrer",className:"p-1 hover:bg-surface rounded",onClick:we=>we.stopPropagation(),children:u.jsx(es,{className:"w-3 h-3 text-fg/40"})})]},Be))})})})]},Se))})})})]},ee.id))})})]})}function IL({signals:e,limit:t=10,onSignalClick:n}){const{t:r}=Ze(),s=e.slice(0,t),[o,a]=R.useState(()=>{const f=localStorage.getItem("newSignalsFeedExpanded");return f!==null?f==="true":!0});R.useEffect(()=>{localStorage.setItem("newSignalsFeedExpanded",String(o))},[o]);const c=f=>f>=80?"bg-yellow-400/20 text-yellow-400 border-yellow-400/30":f>=50?"bg-blue-400/20 text-blue-400 border-blue-400/30":"bg-gray-400/20 text-gray-400 border-gray-400/30",d=f=>{const p=new Date(f),y=new Date().getTime()-p.getTime(),x=Math.floor(y/6e4),b=Math.floor(y/36e5);return x<1?r("common.just_now"):x<60?r("discovery.time_min_ago",{count:x}):b<24?r("discovery.time_hour_ago",{count:b}):p.toLocaleDateString(r("common.locale_code",void 0),{month:"short",day:"numeric"})};return s.length===0?null:u.jsxs("div",{className:"mb-3",children:[u.jsxs("button",{onClick:()=>a(!o),className:"w-full flex items-center justify-between mb-2 px-1 py-1 hover:bg-surface/30 rounded-lg transition-colors",children:[u.jsx("div",{className:"flex items-center gap-2",children:u.jsxs("h3",{className:"text-sm font-semibold text-fg/70 uppercase tracking-wide",children:[r("discovery.new_signals")," (",s.length,")"]})}),o?u.jsx(v_,{size:16,className:"text-fg/40"}):u.jsx(Is,{size:16,className:"text-fg/40"})]}),u.jsx(It,{children:o&&u.jsx(Le.div,{initial:{height:0,opacity:0,overflow:"hidden"},animate:{height:"auto",opacity:1,transitionEnd:{overflow:"visible"}},exit:{height:0,opacity:0,overflow:"hidden"},transition:{duration:.2},className:"py-3",children:u.jsx("div",{className:"overflow-x-auto pb-2 -mx-4 px-4 scrollbar-on-hover",children:u.jsx("div",{className:"flex gap-3 min-w-max",children:s.map(f=>u.jsxs(Le.button,{onClick:()=>n(f.id),whileHover:{scale:1.05},whileTap:{scale:.98},className:"flex-shrink-0 w-[120px] bg-surface/50 backdrop-blur-sm border border-border rounded-lg p-3 hover:border-[var(--border-hover)] transition-all duration-300 text-left group relative z-0 hover:z-10",children:[u.jsx("div",{className:`w-12 h-12 rounded-full border-2 flex items-center justify-center mx-auto mb-2 ${c(f.score)}`,children:u.jsx("span",{className:"text-xl font-bold",children:f.score})}),u.jsx("p",{className:"text-xs text-fg line-clamp-2 mb-2 group-hover:text-blue-400 transition-colors",children:f.title}),u.jsxs("div",{className:"flex items-center gap-1 text-[10px] text-fg/40",children:[u.jsx(Di,{size:10}),u.jsx("span",{children:d(f.created_at)})]})]},f.id))})})})})]})}function DL({category:e,signalCount:t,latestTimestamp:n,onClick:r}){const{t:s}=Ze(),o=c=>{const d=new Date(c),p=new Date().getTime()-d.getTime(),g=Math.floor(p/6e4),y=Math.floor(p/36e5),x=Math.floor(p/864e5);return g<60?s("discovery.time_min_ago",{count:g}):y<24?s("discovery.time_hour_ago",{count:y}):x<7?s("discovery.time_day_ago",{count:x}):d.toLocaleDateString(s("common.locale_code",void 0),{month:"short",day:"numeric"})},a=e.icon;return u.jsxs(Le.button,{whileHover:{scale:1.05},whileTap:{scale:.98},onClick:r,className:"bg-surface/50 backdrop-blur-sm border border-border rounded-lg p-6 cursor-pointer hover:border-[var(--border-hover)] transition-all duration-300 text-left w-full relative z-0 hover:z-10",children:[u.jsx("div",{className:"mb-4",children:u.jsx(a,{size:40,className:"text-current opacity-80"})}),u.jsx("h3",{className:"text-lg font-semibold mb-3 text-fg",children:s(`common.categories.${e.id}`,e.name)}),u.jsxs("div",{className:"flex items-center justify-between text-sm",children:[u.jsx("span",{className:`px-2 py-1 rounded text-xs font-medium ${RL(e.color)}`,children:s("discovery.sources_count",{count:t})}),u.jsxs("span",{className:"text-fg/40 flex items-center gap-1 text-xs",children:[u.jsx(Di,{size:12}),o(n)]})]})]})}const ML=3,zL={ai:"artificial intelligence",ml:"machine learning",llm:"large language models",llms:"large language models",gpt:"large language models",genai:"generative ai","gen ai":"generative ai",js:"javascript",ts:"typescript",py:"python",api:"apis",apis:"apis",saas:"software as a service",iot:"internet of things",ar:"augmented reality",vr:"virtual reality",xr:"extended reality",vc:"venture capital",pe:"private equity",ipo:"initial public offering","m&a":"mergers and acquisitions",b2b:"business to business",b2c:"business to consumer",btc:"bitcoin",eth:"ethereum",nft:"nfts",nfts:"nfts",defi:"decentralized finance",web3:"web3",infosec:"cybersecurity",security:"cybersecurity",devops:"devops",dev:"development"};function FL(e){const t=e.toLowerCase().trim();return zL[t]||t}function $L({signals:e,externalCounts:t,onCategoryClick:n,onSync:r,isSyncing:s}){const{t:o}=Ze(),[a,c]=R.useState(new Set);R.useEffect(()=>{(async()=>{const{data:{user:g}}=await oe.auth.getUser();if(!g)return;const{data:y}=await oe.from("alchemy_settings").select("blocked_tags").eq("user_id",g.id).maybeSingle();y?.blocked_tags&&c(new Set(y.blocked_tags))})()},[]);const{categories:d,finalCounts:f}=R.useMemo(()=>{const p=a.size>0?a:Gw,g=S=>{const E=S.toLowerCase().trim();if(p.has(E))return!0;for(const j of p)if(E===j||j.length>3&&E.startsWith(j+" "))return!0;return!1},y=new Map;t&&(Vi.forEach(S=>{const E=t[S.id],j=t[S.name.toLowerCase()],O=E||j;O&&O.count>0&&y.set(S.id,O)}),t.other&&t.other.count>0&&y.set("other",t.other));const x=new Map;e.forEach(S=>{const E=S.tags||[],j=Yw(E,S.category);if(!t&&j){const O=y.get(j)||{count:0,latest:S.created_at};y.set(j,{count:O.count+1,latest:S.created_at>O.latest?S.created_at:O.latest})}j||E.forEach(O=>{if(!O||g(O))return;const N=FL(O);if(!N||g(N))return;x.set(N,(x.get(N)||0)+1);const T=y.get(N)||{count:0,latest:S.created_at};y.set(N,{count:T.count+1,latest:S.created_at>T.latest?S.created_at:T.latest})})});const b=Array.from(x.entries()).filter(([S,E])=>E>=ML).map(([S,E])=>({id:S,name:S.split(" ").map(j=>j.charAt(0).toUpperCase()+j.slice(1)).join(" "),icon:Bf,color:"gray",priority:2}));return{categories:[...Vi,...b,Dp].filter(S=>{const E=y.get(S.id);return E&&E.count>0}).sort((S,E)=>S.priority-E.priority),finalCounts:y}},[e,t,a]);return d.length===0?u.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8 text-center bg-surface/10 rounded-2xl border border-dashed border-border/20 m-2",children:[u.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-full flex items-center justify-center mb-6 text-primary",children:u.jsx(Kh,{className:"w-8 h-8 animate-pulse"})}),u.jsx("h3",{className:"text-xl font-bold mb-2",children:o("discovery.welcome_title","Welcome to Alchemist!")}),u.jsx("p",{className:"max-w-md text-fg/50 mb-8 leading-relaxed",children:o("discovery.welcome_desc","Connect your browser history to start discovering signals. We'll automatically analyze your visited pages to find mentions of AI, tech, and more.")}),u.jsxs("button",{onClick:r,disabled:s||!r,className:"px-8 py-3.5 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-[1.02] active:scale-95 transition-all flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed",children:[u.jsx(Ds,{size:20,className:s?"animate-spin":""}),s?o("discovery.syncing"):o("discovery.auto_detect_sync","Auto-detect & Sync")]}),u.jsxs("div",{className:"mt-8 flex items-center gap-6 text-[11px] font-medium text-fg/30 uppercase tracking-widest",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Pc,{size:12})," ",o("discovery.privacy_first","Privacy First")]}),u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx(Ft,{size:12})," ",o("discovery.offline_first","Offline First")]})]})]}):u.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-4 p-2",children:d.map(p=>{const g=f.get(p.id);return u.jsx(DL,{category:p,signalCount:g.count,latestTimestamp:g.latest,onClick:()=>n(p.id)},p.id)})})}function UL({isOpen:e,onClose:t,categoryId:n,signals:r,onOpenUrl:s,onFavourite:o,onNote:a,onBoost:c,onDismiss:d}){const{t:f}=Ze(),p=AL.find(N=>N.id===n),[g,y]=R.useState(null),[x,b]=R.useState([]),[w,k]=R.useState(!1);R.useEffect(()=>{if(!e||!n){b([]);return}(async()=>{k(!0);const T=p?.name||n,{data:I,error:V}=await oe.from("signals").select("*").ilike("category",T).order("created_at",{ascending:!1}).limit(50);V?(console.error("Error fetching category signals:",V),b(r.filter(U=>{const D=U.tags||[],Z=U.category?.toLowerCase()===n,Y=D.some(he=>he.toLowerCase().includes(n));return Z||Y}))):b(I||[]),k(!1)})()},[e,n,p?.name]);const S=x,E=N=>{s?s(N):window.open(N,"_blank","noopener,noreferrer")},j=(N,T,I)=>{y({id:N,note:T,title:I})},O=async N=>{g&&a&&(await a(g.id,N),y(null))};return u.jsx(It,{children:e&&u.jsxs(u.Fragment,{children:[u.jsx(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 bg-black/50 backdrop-blur-sm z-40"}),u.jsxs(Le.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:30,stiffness:300},className:"fixed right-0 top-0 h-full w-full md:w-2/3 lg:w-1/2 bg-bg border-l border-border z-50 overflow-y-auto custom-scrollbar",children:[u.jsx("div",{className:"sticky top-0 z-10 bg-bg/95 backdrop-blur-md border-b border-border p-6 shadow-sm",children:u.jsxs("div",{className:"flex items-center justify-between",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[p?.icon&&u.jsx("div",{className:"w-10 h-10 flex items-center justify-center bg-surface/50 rounded-xl border border-white/5",children:u.jsx(p.icon,{size:28,className:"text-primary"})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-2xl font-bold",children:f(`common.categories.${n}`,p?.name)}),u.jsx("p",{className:"text-sm text-fg/50 font-mono",children:S.length===1?f("discovery.signal_count_one",{count:S.length}):f("discovery.signal_count_other",{count:S.length})})]})]}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-surface rounded-lg transition-colors text-fg/60 hover:text-fg","aria-label":f("common.close"),children:u.jsx(an,{size:24})})]})}),u.jsx("div",{className:"p-6 space-y-4",children:w?u.jsxs("div",{className:"h-64 flex flex-col items-center justify-center text-fg/30 gap-2",children:[u.jsx(Ct,{size:32,className:"animate-spin"}),u.jsx("p",{children:f("discovery.loading_signals")})]}):S.length===0?u.jsxs("div",{className:"h-64 flex flex-col items-center justify-center text-fg/30 gap-2",children:[p?.icon&&u.jsx(p.icon,{size:48,className:"opacity-20"}),u.jsx("p",{className:"italic",children:f("discovery.no_signals_in_category",{category:f(`common.categories.${n}`,p?.name)})})]}):S.map(N=>u.jsx(Mp,{signal:N,onOpen:E,onFavourite:o,onNote:j,onBoost:c,onDismiss:d},N.id))})]}),g&&u.jsx(Qw,{isOpen:!!g,onClose:()=>y(null),title:g.title,initialNote:g.note,onSave:O})]})})}function BL({onOpenUrl:e,onCopyText:t,onSync:n,isSyncing:r}){const{t:s}=Ze(),[o,a]=R.useState([]),[c,d]=R.useState({}),[f,p]=R.useState(!0),[g,y]=R.useState(null),[x,b]=R.useState(""),[w,k]=R.useState(null);R.useEffect(()=>{(async()=>{const{data:j,error:O}=await oe.from("signals").select("category, created_at").order("created_at",{ascending:!1});if(O){console.error("Error fetching category counts:",O);return}const N={};j?.forEach(T=>{const I=T.category?.toLowerCase()||"other";N[I]||(N[I]={count:0,latest:T.created_at}),N[I].count++,T.created_at>N[I].latest&&(N[I].latest=T.created_at)}),d(N)})()},[]),R.useEffect(()=>{(async()=>{p(!0);let O=oe.from("signals").select("*").order("created_at",{ascending:!1}).limit(50);w&&(O=O.ilike("category",w)),x&&(O=O.or(`title.ilike.%${x}%,summary.ilike.%${x}%,url.ilike.%${x}%`));const{data:N,error:T}=await O;T?console.error("Error fetching signals:",T):a(N||[]),p(!1)})();const j=oe.channel("signals").on("postgres_changes",{event:"INSERT",schema:"public",table:"signals"},O=>{a(N=>[O.new,...N])}).subscribe();return()=>{j.unsubscribe()}},[x,w]);const S=E=>{e?e(E):window.open(E,"_blank","noopener,noreferrer")};return u.jsxs("div",{className:"flex-1 flex flex-col overflow-hidden",children:[u.jsx("div",{className:"px-4 pt-2",children:u.jsx(IL,{signals:o,limit:10,onSignalClick:E=>{const j=o.find(O=>O.id===E);j&&j.category&&y(j.category.toLowerCase())}})}),u.jsxs("div",{className:"px-4 pt-1 pb-2 space-y-3",children:[u.jsxs("div",{className:"relative",children:[u.jsx(oa,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-fg/40"}),u.jsx("input",{type:"text",placeholder:s("chat.ask_anything","Search signals..."),value:x,onChange:E=>b(E.target.value),className:"w-full bg-surface border border-border/20 rounded-xl py-3 pl-10 pr-10 text-sm text-fg placeholder:text-fg/40 focus:border-primary/50 focus:ring-2 focus:ring-primary/20 outline-none transition-all"}),x&&u.jsx("button",{onClick:()=>b(""),className:"absolute right-3 top-1/2 -translate-y-1/2 text-fg/40 hover:text-fg transition-colors",title:s("common.clear"),children:u.jsx(an,{size:16})})]}),u.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[u.jsx(kj,{className:"w-3.5 h-3.5 text-fg/40"}),u.jsx("button",{onClick:()=>k(null),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${w===null?"bg-primary text-white shadow-sm":"bg-surface hover:bg-surface/80 text-fg/60 hover:text-fg border border-border/20"}`,children:s("common.all")}),[{id:"AI & ML",key:"common.categories.ai_ml"},{id:"Business",key:"common.categories.business"},{id:"Politics",key:"common.categories.politics"},{id:"Technology",key:"common.categories.technology"},{id:"Finance",key:"common.categories.finance"},{id:"Crypto",key:"common.categories.crypto"},{id:"Science",key:"common.categories.science"},{id:"Other",key:"common.categories.other"}].map(E=>u.jsx("button",{onClick:()=>k(E.id),className:`px-3 py-1.5 rounded-lg text-xs font-medium transition-all ${w===E.id?"bg-primary text-white shadow-sm":"bg-surface hover:bg-surface/80 text-fg/60 hover:text-fg border border-border/20"}`,children:s(E.key)},E.id))]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto px-4 pb-12 scrollbar-on-hover",children:f?u.jsx("div",{className:"h-64 flex items-center justify-center text-fg/30",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-blue-400"})}):w?u.jsx("div",{className:"space-y-4 py-2",children:o.length===0?u.jsx("div",{className:"h-64 flex flex-col items-center justify-center text-fg/30 gap-2",children:u.jsx("p",{className:"italic",children:s("discovery.no_signals_in_category",{category:s(`common.categories.${w.toLowerCase()}`,w)})})}):o.map(E=>u.jsx(Mp,{signal:E,onOpen:S,onFavourite:async(j,O)=>{const N=!O;a(T=>T.map(I=>I.id===j?{...I,is_favorite:N}:I)),await oe.from("signals").update({is_favorite:N}).eq("id",j)},onBoost:async(j,O)=>{const N=!O;a(T=>T.map(I=>I.id===j?{...I,is_boosted:N}:I)),await oe.from("signals").update({is_boosted:N}).eq("id",j)},onDismiss:async(j,O)=>{const N=!O;a(T=>T.map(I=>I.id===j?{...I,is_dismissed:N}:I)),await oe.from("signals").update({is_dismissed:N}).eq("id",j)}},E.id))}):u.jsx($L,{signals:o,externalCounts:c,onCategoryClick:E=>y(E),onSync:n,isSyncing:r})}),u.jsx(UL,{isOpen:!!g,onClose:()=>y(null),categoryId:g||"",signals:o,onOpenUrl:S,onFavourite:async(E,j)=>{const O=!j;a(T=>T.map(I=>I.id===E?{...I,is_favorite:O}:I));const{error:N}=await oe.from("signals").update({is_favorite:O}).eq("id",E);N&&(console.error("Failed to update favorite:",N),a(T=>T.map(I=>I.id===E?{...I,is_favorite:j}:I)))},onNote:async(E,j)=>{a(N=>N.map(T=>T.id===E?{...T,user_notes:j}:T));const{error:O}=await oe.from("signals").update({user_notes:j}).eq("id",E);O&&console.error("Failed to update note:",O)},onBoost:async(E,j)=>{const O=!j;a(T=>T.map(I=>I.id===E?{...I,is_boosted:O}:I));const{error:N}=await oe.from("signals").update({is_boosted:O}).eq("id",E);N&&(console.error("Failed to update boost:",N),a(T=>T.map(I=>I.id===E?{...I,is_boosted:j}:I)))},onDismiss:async(E,j)=>{const O=!j;a(T=>T.map(I=>I.id===E?{...I,is_dismissed:O}:I));const{error:N}=await oe.from("signals").update({is_dismissed:O}).eq("id",E);N&&(console.error("Failed to update dismiss:",N),a(T=>T.map(I=>I.id===E?{...I,is_dismissed:j}:I)))}})]})}function VL({activeSessionId:e,onSelectSession:t}){const{t:n}=Ze(),[r,s]=R.useState([]),[o,a]=R.useState(!0);R.useEffect(()=>{c()},[]);const c=async()=>{try{const{data:{session:f}}=await oe.auth.getSession();if(!f)return;const p=await Ye.get("/api/chat/sessions",{headers:{"x-user-id":f.user.id}});p.data.success&&s(p.data.sessions)}catch(f){console.error("Failed to fetch sessions",f)}finally{a(!1)}},d=async(f,p)=>{f.stopPropagation();try{const{error:g}=await oe.from("chat_sessions").delete().eq("id",p);g||(s(y=>y.filter(x=>x.id!==p)),e===p&&t(null))}catch(g){console.error(g)}};return u.jsxs("div",{className:"w-64 bg-surface/25 backdrop-blur-xl flex flex-col rounded-xl border border-border overflow-hidden",children:[u.jsx("div",{className:"p-3 border-b border-border bg-surface/15",children:u.jsxs("button",{onClick:()=>t(null),className:"w-full flex items-center justify-center gap-2 px-4 py-3 bg-primary/10 hover:bg-primary/20 text-primary rounded-xl transition-all font-semibold text-sm border border-primary/20",children:[u.jsx(Vf,{size:16}),n("chat.new_chat")]})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-2 space-y-1",children:o?u.jsx("div",{className:"p-4 text-center text-xs text-fg/40",children:n("common.loading")}):r.length===0?u.jsxs("div",{className:"p-8 text-center",children:[u.jsx(qh,{size:24,className:"mx-auto text-fg/20 mb-2"}),u.jsx("p",{className:"text-xs text-fg/40",children:n("chat.no_history")})]}):r.map(f=>u.jsxs("div",{onClick:()=>t(f.id),className:`group flex items-center justify-between px-3 py-3 rounded-lg cursor-pointer transition-all text-sm ${e===f.id?"bg-surface/60 text-fg ring-1 ring-primary/20":"text-fg/60 hover:bg-surface/35 hover:text-fg"}`,children:[u.jsxs("div",{className:"flex items-center gap-2.5 overflow-hidden",children:[u.jsx(qh,{size:14,className:e===f.id?"text-primary":"opacity-50"}),u.jsx("span",{className:"truncate",children:f.title})]}),u.jsx("button",{onClick:p=>d(p,f.id),className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 p-1.5 hover:bg-red-500/10 hover:text-red-400 rounded transition-all focus-visible:ring-2 focus-visible:ring-red-500/40",children:u.jsx(qf,{size:12})})]},f.id))})]})}function qL(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const HL=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,KL=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,WL={};function w0(e,t){return(WL.jsx?KL:HL).test(e)}const GL=/[ \t\n\f\r]/g;function JL(e){return typeof e=="object"?e.type==="text"?k0(e.value):!1:k0(e)}function k0(e){return e.replace(GL,"")===""}class Aa{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Aa.prototype.normal={};Aa.prototype.property={};Aa.prototype.space=void 0;function Zw(e,t){const n={},r={};for(const s of e)Object.assign(n,s.property),Object.assign(r,s.normal);return new Aa(n,r,t)}function Af(e){return e.toLowerCase()}class _n{constructor(t,n){this.attribute=n,this.property=t}}_n.prototype.attribute="";_n.prototype.booleanish=!1;_n.prototype.boolean=!1;_n.prototype.commaOrSpaceSeparated=!1;_n.prototype.commaSeparated=!1;_n.prototype.defined=!1;_n.prototype.mustUseProperty=!1;_n.prototype.number=!1;_n.prototype.overloadedBoolean=!1;_n.prototype.property="";_n.prototype.spaceSeparated=!1;_n.prototype.space=void 0;let XL=0;const Ke=Us(),At=Us(),Rf=Us(),ue=Us(),dt=Us(),Ii=Us(),En=Us();function Us(){return 2**++XL}const Pf=Object.freeze(Object.defineProperty({__proto__:null,boolean:Ke,booleanish:At,commaOrSpaceSeparated:En,commaSeparated:Ii,number:ue,overloadedBoolean:Rf,spaceSeparated:dt},Symbol.toStringTag,{value:"Module"})),jh=Object.keys(Pf);class zp extends _n{constructor(t,n,r,s){let o=-1;if(super(t,n),S0(this,"space",s),typeof r=="number")for(;++o<jh.length;){const a=jh[o];S0(this,jh[o],(r&Pf[a])===Pf[a])}}}zp.prototype.defined=!0;function S0(e,t,n){n&&(e[t]=n)}function Ji(e){const t={},n={};for(const[r,s]of Object.entries(e.properties)){const o=new zp(r,e.transform(e.attributes||{},r),s,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Af(r)]=r,n[Af(o.attribute)]=r}return new Aa(t,n,e.space)}const ek=Ji({properties:{ariaActiveDescendant:null,ariaAtomic:At,ariaAutoComplete:null,ariaBusy:At,ariaChecked:At,ariaColCount:ue,ariaColIndex:ue,ariaColSpan:ue,ariaControls:dt,ariaCurrent:null,ariaDescribedBy:dt,ariaDetails:null,ariaDisabled:At,ariaDropEffect:dt,ariaErrorMessage:null,ariaExpanded:At,ariaFlowTo:dt,ariaGrabbed:At,ariaHasPopup:null,ariaHidden:At,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:dt,ariaLevel:ue,ariaLive:null,ariaModal:At,ariaMultiLine:At,ariaMultiSelectable:At,ariaOrientation:null,ariaOwns:dt,ariaPlaceholder:null,ariaPosInSet:ue,ariaPressed:At,ariaReadOnly:At,ariaRelevant:null,ariaRequired:At,ariaRoleDescription:dt,ariaRowCount:ue,ariaRowIndex:ue,ariaRowSpan:ue,ariaSelected:At,ariaSetSize:ue,ariaSort:null,ariaValueMax:ue,ariaValueMin:ue,ariaValueNow:ue,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function tk(e,t){return t in e?e[t]:t}function nk(e,t){return tk(e,t.toLowerCase())}const YL=Ji({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ii,acceptCharset:dt,accessKey:dt,action:null,allow:null,allowFullScreen:Ke,allowPaymentRequest:Ke,allowUserMedia:Ke,alt:null,as:null,async:Ke,autoCapitalize:null,autoComplete:dt,autoFocus:Ke,autoPlay:Ke,blocking:dt,capture:null,charSet:null,checked:Ke,cite:null,className:dt,cols:ue,colSpan:null,content:null,contentEditable:At,controls:Ke,controlsList:dt,coords:ue|Ii,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Ke,defer:Ke,dir:null,dirName:null,disabled:Ke,download:Rf,draggable:At,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Ke,formTarget:null,headers:dt,height:ue,hidden:Rf,high:ue,href:null,hrefLang:null,htmlFor:dt,httpEquiv:dt,id:null,imageSizes:null,imageSrcSet:null,inert:Ke,inputMode:null,integrity:null,is:null,isMap:Ke,itemId:null,itemProp:dt,itemRef:dt,itemScope:Ke,itemType:dt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Ke,low:ue,manifest:null,max:null,maxLength:ue,media:null,method:null,min:null,minLength:ue,multiple:Ke,muted:Ke,name:null,nonce:null,noModule:Ke,noValidate:Ke,onAbort:null,onAfterPrint:null,onAuxClick:null,onBeforeMatch:null,onBeforePrint:null,onBeforeToggle:null,onBeforeUnload:null,onBlur:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onContextLost:null,onContextMenu:null,onContextRestored:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnded:null,onError:null,onFocus:null,onFormData:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLanguageChange:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadEnd:null,onLoadStart:null,onMessage:null,onMessageError:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRejectionHandled:null,onReset:null,onResize:null,onScroll:null,onScrollEnd:null,onSecurityPolicyViolation:null,onSeeked:null,onSeeking:null,onSelect:null,onSlotChange:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnhandledRejection:null,onUnload:null,onVolumeChange:null,onWaiting:null,onWheel:null,open:Ke,optimum:ue,pattern:null,ping:dt,placeholder:null,playsInline:Ke,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Ke,referrerPolicy:null,rel:dt,required:Ke,reversed:Ke,rows:ue,rowSpan:ue,sandbox:dt,scope:null,scoped:Ke,seamless:Ke,selected:Ke,shadowRootClonable:Ke,shadowRootDelegatesFocus:Ke,shadowRootMode:null,shape:null,size:ue,sizes:null,slot:null,span:ue,spellCheck:At,src:null,srcDoc:null,srcLang:null,srcSet:null,start:ue,step:null,style:null,tabIndex:ue,target:null,title:null,translate:null,type:null,typeMustMatch:Ke,useMap:null,value:At,width:ue,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:dt,axis:null,background:null,bgColor:null,border:ue,borderColor:null,bottomMargin:ue,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Ke,declare:Ke,event:null,face:null,frame:null,frameBorder:null,hSpace:ue,leftMargin:ue,link:null,longDesc:null,lowSrc:null,marginHeight:ue,marginWidth:ue,noResize:Ke,noHref:Ke,noShade:Ke,noWrap:Ke,object:null,profile:null,prompt:null,rev:null,rightMargin:ue,rules:null,scheme:null,scrolling:At,standby:null,summary:null,text:null,topMargin:ue,valueType:null,version:null,vAlign:null,vLink:null,vSpace:ue,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:Ke,disableRemotePlayback:Ke,prefix:null,property:null,results:ue,security:null,unselectable:null},space:"html",transform:nk}),QL=Ji({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:En,accentHeight:ue,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:ue,amplitude:ue,arabicForm:null,ascent:ue,attributeName:null,attributeType:null,azimuth:ue,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:ue,by:null,calcMode:null,capHeight:ue,className:dt,clip:null,clipPath:null,clipPathUnits:null,clipRule:null,color:null,colorInterpolation:null,colorInterpolationFilters:null,colorProfile:null,colorRendering:null,content:null,contentScriptType:null,contentStyleType:null,crossOrigin:null,cursor:null,cx:null,cy:null,d:null,dataType:null,defaultAction:null,descent:ue,diffuseConstant:ue,direction:null,display:null,dur:null,divisor:ue,dominantBaseline:null,download:Ke,dx:null,dy:null,edgeMode:null,editable:null,elevation:ue,enableBackground:null,end:null,event:null,exponent:ue,externalResourcesRequired:null,fill:null,fillOpacity:ue,fillRule:null,filter:null,filterRes:null,filterUnits:null,floodColor:null,floodOpacity:null,focusable:null,focusHighlight:null,fontFamily:null,fontSize:null,fontSizeAdjust:null,fontStretch:null,fontStyle:null,fontVariant:null,fontWeight:null,format:null,fr:null,from:null,fx:null,fy:null,g1:Ii,g2:Ii,glyphName:Ii,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:ue,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:ue,horizOriginX:ue,horizOriginY:ue,id:null,ideographic:ue,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:ue,k:ue,k1:ue,k2:ue,k3:ue,k4:ue,kernelMatrix:En,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:ue,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:ue,mediaTime:null,method:null,min:null,mode:null,name:null,navDown:null,navDownLeft:null,navDownRight:null,navLeft:null,navNext:null,navPrev:null,navRight:null,navUp:null,navUpLeft:null,navUpRight:null,numOctaves:null,observer:null,offset:null,onAbort:null,onActivate:null,onAfterPrint:null,onBeforePrint:null,onBegin:null,onCancel:null,onCanPlay:null,onCanPlayThrough:null,onChange:null,onClick:null,onClose:null,onCopy:null,onCueChange:null,onCut:null,onDblClick:null,onDrag:null,onDragEnd:null,onDragEnter:null,onDragExit:null,onDragLeave:null,onDragOver:null,onDragStart:null,onDrop:null,onDurationChange:null,onEmptied:null,onEnd:null,onEnded:null,onError:null,onFocus:null,onFocusIn:null,onFocusOut:null,onHashChange:null,onInput:null,onInvalid:null,onKeyDown:null,onKeyPress:null,onKeyUp:null,onLoad:null,onLoadedData:null,onLoadedMetadata:null,onLoadStart:null,onMessage:null,onMouseDown:null,onMouseEnter:null,onMouseLeave:null,onMouseMove:null,onMouseOut:null,onMouseOver:null,onMouseUp:null,onMouseWheel:null,onOffline:null,onOnline:null,onPageHide:null,onPageShow:null,onPaste:null,onPause:null,onPlay:null,onPlaying:null,onPopState:null,onProgress:null,onRateChange:null,onRepeat:null,onReset:null,onResize:null,onScroll:null,onSeeked:null,onSeeking:null,onSelect:null,onShow:null,onStalled:null,onStorage:null,onSubmit:null,onSuspend:null,onTimeUpdate:null,onToggle:null,onUnload:null,onVolumeChange:null,onWaiting:null,onZoom:null,opacity:null,operator:null,order:null,orient:null,orientation:null,origin:null,overflow:null,overlay:null,overlinePosition:ue,overlineThickness:ue,paintOrder:null,panose1:null,path:null,pathLength:ue,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:dt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:ue,pointsAtY:ue,pointsAtZ:ue,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:En,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:En,rev:En,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:En,requiredFeatures:En,requiredFonts:En,requiredFormats:En,resource:null,restart:null,result:null,rotate:null,rx:null,ry:null,scale:null,seed:null,shapeRendering:null,side:null,slope:null,snapshotTime:null,specularConstant:ue,specularExponent:ue,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:ue,strikethroughThickness:ue,string:null,stroke:null,strokeDashArray:En,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:ue,strokeOpacity:ue,strokeWidth:null,style:null,surfaceScale:ue,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:En,tabIndex:ue,tableValues:null,target:null,targetX:ue,targetY:ue,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:En,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:ue,underlineThickness:ue,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:ue,values:null,vAlphabetic:ue,vMathematical:ue,vectorEffect:null,vHanging:ue,vIdeographic:ue,version:null,vertAdvY:ue,vertOriginX:ue,vertOriginY:ue,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:ue,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:tk}),rk=Ji({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),sk=Ji({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:nk}),ik=Ji({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),ZL={classId:"classID",dataType:"datatype",itemId:"itemID",strokeDashArray:"strokeDasharray",strokeDashOffset:"strokeDashoffset",strokeLineCap:"strokeLinecap",strokeLineJoin:"strokeLinejoin",strokeMiterLimit:"strokeMiterlimit",typeOf:"typeof",xLinkActuate:"xlinkActuate",xLinkArcRole:"xlinkArcrole",xLinkHref:"xlinkHref",xLinkRole:"xlinkRole",xLinkShow:"xlinkShow",xLinkTitle:"xlinkTitle",xLinkType:"xlinkType",xmlnsXLink:"xmlnsXlink"},eI=/[A-Z]/g,j0=/-[a-z]/g,tI=/^data[-\w.:]+$/i;function nI(e,t){const n=Af(t);let r=t,s=_n;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&tI.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(j0,sI);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!j0.test(o)){let a=o.replace(eI,rI);a.charAt(0)!=="-"&&(a="-"+a),t="data"+a}}s=zp}return new s(r,t)}function rI(e){return"-"+e.toLowerCase()}function sI(e){return e.charAt(1).toUpperCase()}const iI=Zw([ek,YL,rk,sk,ik],"html"),Fp=Zw([ek,QL,rk,sk,ik],"svg");function oI(e){return e.join(" ").trim()}var vi={},Eh,E0;function aI(){if(E0)return Eh;E0=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,s=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,a=/^[;\s]*/,c=/^\s+|\s+$/g,d=`
|
|
108
|
+
`,f="/",p="*",g="",y="comment",x="declaration";function b(k,S){if(typeof k!="string")throw new TypeError("First argument must be a string");if(!k)return[];S=S||{};var E=1,j=1;function O(G){var W=G.match(t);W&&(E+=W.length);var ne=G.lastIndexOf(d);j=~ne?G.length-ne:j+G.length}function N(){var G={line:E,column:j};return function(W){return W.position=new T(G),U(),W}}function T(G){this.start=G,this.end={line:E,column:j},this.source=S.source}T.prototype.content=k;function I(G){var W=new Error(S.source+":"+E+":"+j+": "+G);if(W.reason=G,W.filename=S.source,W.line=E,W.column=j,W.source=k,!S.silent)throw W}function V(G){var W=G.exec(k);if(W){var ne=W[0];return O(ne),k=k.slice(ne.length),W}}function U(){V(n)}function D(G){var W;for(G=G||[];W=Z();)W!==!1&&G.push(W);return G}function Z(){var G=N();if(!(f!=k.charAt(0)||p!=k.charAt(1))){for(var W=2;g!=k.charAt(W)&&(p!=k.charAt(W)||f!=k.charAt(W+1));)++W;if(W+=2,g===k.charAt(W-1))return I("End of comment missing");var ne=k.slice(2,W-2);return j+=2,O(ne),k=k.slice(W),j+=2,G({type:y,comment:ne})}}function Y(){var G=N(),W=V(r);if(W){if(Z(),!V(s))return I("property missing ':'");var ne=V(o),re=G({type:x,property:w(W[0].replace(e,g)),value:ne?w(ne[0].replace(e,g)):g});return V(a),re}}function he(){var G=[];D(G);for(var W;W=Y();)W!==!1&&(G.push(W),D(G));return G}return U(),he()}function w(k){return k?k.replace(c,g):g}return Eh=b,Eh}var C0;function lI(){if(C0)return vi;C0=1;var e=vi&&vi.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(vi,"__esModule",{value:!0}),vi.default=n;const t=e(aI());function n(r,s){let o=null;if(!r||typeof r!="string")return o;const a=(0,t.default)(r),c=typeof s=="function";return a.forEach(d=>{if(d.type!=="declaration")return;const{property:f,value:p}=d;c?s(f,p,d):p&&(o=o||{},o[f]=p)}),o}return vi}var Fo={},N0;function cI(){if(N0)return Fo;N0=1,Object.defineProperty(Fo,"__esModule",{value:!0}),Fo.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,s=/^-(ms)-/,o=function(f){return!f||n.test(f)||e.test(f)},a=function(f,p){return p.toUpperCase()},c=function(f,p){return"".concat(p,"-")},d=function(f,p){return p===void 0&&(p={}),o(f)?f:(f=f.toLowerCase(),p.reactCompat?f=f.replace(s,c):f=f.replace(r,c),f.replace(t,a))};return Fo.camelCase=d,Fo}var $o,T0;function uI(){if(T0)return $o;T0=1;var e=$o&&$o.__importDefault||function(s){return s&&s.__esModule?s:{default:s}},t=e(lI()),n=cI();function r(s,o){var a={};return!s||typeof s!="string"||(0,t.default)(s,function(c,d){c&&d&&(a[(0,n.camelCase)(c,o)]=d)}),a}return r.default=r,$o=r,$o}var dI=uI();const hI=Ac(dI),ok=ak("end"),$p=ak("start");function ak(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function fI(e){const t=$p(e),n=ok(e);if(t&&n)return{start:t,end:n}}function na(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?A0(e.position):"start"in e||"end"in e?A0(e):"line"in e||"column"in e?Of(e):""}function Of(e){return R0(e&&e.line)+":"+R0(e&&e.column)}function A0(e){return Of(e&&e.start)+"-"+Of(e&&e.end)}function R0(e){return e&&typeof e=="number"?e:1}class en extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let s="",o={},a=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?s=t:!o.cause&&t&&(a=!0,s=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const d=r.indexOf(":");d===-1?o.ruleId=r:(o.source=r.slice(0,d),o.ruleId=r.slice(d+1))}if(!o.place&&o.ancestors&&o.ancestors){const d=o.ancestors[o.ancestors.length-1];d&&(o.place=d.position)}const c=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=c?c.column:void 0,this.fatal=void 0,this.file="",this.message=s,this.line=c?c.line:void 0,this.name=na(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=a&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}en.prototype.file="";en.prototype.name="";en.prototype.reason="";en.prototype.message="";en.prototype.stack="";en.prototype.column=void 0;en.prototype.line=void 0;en.prototype.ancestors=void 0;en.prototype.cause=void 0;en.prototype.fatal=void 0;en.prototype.place=void 0;en.prototype.ruleId=void 0;en.prototype.source=void 0;const Up={}.hasOwnProperty,pI=new Map,mI=/[A-Z]/g,gI=new Set(["table","tbody","thead","tfoot","tr"]),yI=new Set(["td","th"]),lk="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function xI(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=EI(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=jI(n,t.jsx,t.jsxs)}const s={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?Fp:iI,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=ck(s,e,void 0);return o&&typeof o!="string"?o:s.create(e,s.Fragment,{children:o||void 0},void 0)}function ck(e,t,n){if(t.type==="element")return vI(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return _I(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return wI(e,t,n);if(t.type==="mdxjsEsm")return bI(e,t);if(t.type==="root")return kI(e,t,n);if(t.type==="text")return SI(e,t)}function vI(e,t,n){const r=e.schema;let s=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(s=Fp,e.schema=s),e.ancestors.push(t);const o=dk(e,t.tagName,!1),a=CI(e,t);let c=Vp(e,t);return gI.has(t.tagName)&&(c=c.filter(function(d){return typeof d=="string"?!JL(d):!0})),uk(e,a,o,t),Bp(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function _I(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}va(e,t.position)}function bI(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);va(e,t.position)}function wI(e,t,n){const r=e.schema;let s=r;t.name==="svg"&&r.space==="html"&&(s=Fp,e.schema=s),e.ancestors.push(t);const o=t.name===null?e.Fragment:dk(e,t.name,!0),a=NI(e,t),c=Vp(e,t);return uk(e,a,o,t),Bp(a,c),e.ancestors.pop(),e.schema=r,e.create(t,o,a,n)}function kI(e,t,n){const r={};return Bp(r,Vp(e,t)),e.create(t,e.Fragment,r,n)}function SI(e,t){return t.value}function uk(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function Bp(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function jI(e,t,n){return r;function r(s,o,a,c){const f=Array.isArray(a.children)?n:t;return c?f(o,a,c):f(o,a)}}function EI(e,t){return n;function n(r,s,o,a){const c=Array.isArray(o.children),d=$p(r);return t(s,o,a,c,{columnNumber:d?d.column-1:void 0,fileName:e,lineNumber:d?d.line:void 0},void 0)}}function CI(e,t){const n={};let r,s;for(s in t.properties)if(s!=="children"&&Up.call(t.properties,s)){const o=TI(e,s,t.properties[s]);if(o){const[a,c]=o;e.tableCellAlignToStyle&&a==="align"&&typeof c=="string"&&yI.has(t.tagName)?r=c:n[a]=c}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function NI(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const a=o.expression;a.type;const c=a.properties[0];c.type,Object.assign(n,e.evaluater.evaluateExpression(c.argument))}else va(e,t.position);else{const s=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const c=r.value.data.estree.body[0];c.type,o=e.evaluater.evaluateExpression(c.expression)}else va(e,t.position);else o=r.value===null?!0:r.value;n[s]=o}return n}function Vp(e,t){const n=[];let r=-1;const s=e.passKeys?new Map:pI;for(;++r<t.children.length;){const o=t.children[r];let a;if(e.passKeys){const d=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(d){const f=s.get(d)||0;a=d+"-"+f,s.set(d,f+1)}}const c=ck(e,o,a);c!==void 0&&n.push(c)}return n}function TI(e,t,n){const r=nI(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?qL(n):oI(n)),r.property==="style"){let s=typeof n=="object"?n:AI(e,String(n));return e.stylePropertyNameCase==="css"&&(s=RI(s)),["style",s]}return[e.elementAttributeNameCase==="react"&&r.space?ZL[r.property]||r.property:r.attribute,n]}}function AI(e,t){try{return hI(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,s=new en("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw s.file=e.filePath||void 0,s.url=lk+"#cannot-parse-style-attribute",s}}function dk(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const s=t.split(".");let o=-1,a;for(;++o<s.length;){const c=w0(s[o])?{type:"Identifier",name:s[o]}:{type:"Literal",value:s[o]};a=a?{type:"MemberExpression",object:a,property:c,computed:!!(o&&c.type==="Literal"),optional:!1}:c}r=a}else r=w0(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const s=r.value;return Up.call(e.components,s)?e.components[s]:s}if(e.evaluater)return e.evaluater.evaluateExpression(r);va(e)}function va(e,t){const n=new en("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=lk+"#cannot-handle-mdx-estrees-without-createevaluater",n}function RI(e){const t={};let n;for(n in e)Up.call(e,n)&&(t[PI(n)]=e[n]);return t}function PI(e){let t=e.replace(mI,OI);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function OI(e){return"-"+e.toLowerCase()}const Ch={action:["form"],cite:["blockquote","del","ins","q"],data:["object"],formAction:["button","input"],href:["a","area","base","link"],icon:["menuitem"],itemId:null,manifest:["html"],ping:["a","area"],poster:["video"],src:["audio","embed","iframe","img","input","script","source","track","video"]},LI={};function qp(e,t){const n=LI,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,s=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return hk(e,r,s)}function hk(e,t,n){if(II(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return P0(e.children,t,n)}return Array.isArray(e)?P0(e,t,n):""}function P0(e,t,n){const r=[];let s=-1;for(;++s<e.length;)r[s]=hk(e[s],t,n);return r.join("")}function II(e){return!!(e&&typeof e=="object")}const O0=document.createElement("i");function Hp(e){const t="&"+e+";";O0.innerHTML=t;const n=O0.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function An(e,t,n,r){const s=e.length;let o=0,a;if(t<0?t=-t>s?0:s+t:t=t>s?s:t,n=n>0?n:0,r.length<1e4)a=Array.from(r),a.unshift(t,n),e.splice(...a);else for(n&&e.splice(t,n);o<r.length;)a=r.slice(o,o+1e4),a.unshift(t,0),e.splice(...a),o+=1e4,t+=1e4}function $n(e,t){return e.length>0?(An(e,e.length,0,t),e):t}const L0={}.hasOwnProperty;function fk(e){const t={};let n=-1;for(;++n<e.length;)DI(t,e[n]);return t}function DI(e,t){let n;for(n in t){const s=(L0.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let a;if(o)for(a in o){L0.call(s,a)||(s[a]=[]);const c=o[a];MI(s[a],Array.isArray(c)?c:c?[c]:[])}}}function MI(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);An(e,0,0,r)}function pk(e,t){const n=Number.parseInt(e,t);return n<9||n===11||n>13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"�":String.fromCodePoint(n)}function Qn(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const on=ss(/[A-Za-z]/),Zt=ss(/[\dA-Za-z]/),zI=ss(/[#-'*+\--9=?A-Z^-~]/);function Ec(e){return e!==null&&(e<32||e===127)}const Lf=ss(/\d/),FI=ss(/[\dA-Fa-f]/),$I=ss(/[!-/:-@[-`{-~]/);function Oe(e){return e!==null&&e<-2}function at(e){return e!==null&&(e<0||e===32)}function Xe(e){return e===-2||e===-1||e===32}const Yc=ss(new RegExp("\\p{P}|\\p{S}","u")),Fs=ss(/\s/);function ss(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function Xi(e){const t=[];let n=-1,r=0,s=0;for(;++n<e.length;){const o=e.charCodeAt(n);let a="";if(o===37&&Zt(e.charCodeAt(n+1))&&Zt(e.charCodeAt(n+2)))s=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(a=String.fromCharCode(o));else if(o>55295&&o<57344){const c=e.charCodeAt(n+1);o<56320&&c>56319&&c<57344?(a=String.fromCharCode(o,c),s=1):a="�"}else a=String.fromCharCode(o);a&&(t.push(e.slice(r,n),encodeURIComponent(a)),r=n+s+1,a=""),s&&(n+=s,s=0)}return t.join("")+e.slice(r)}function Qe(e,t,n,r){const s=r?r-1:Number.POSITIVE_INFINITY;let o=0;return a;function a(d){return Xe(d)?(e.enter(n),c(d)):t(d)}function c(d){return Xe(d)&&o++<s?(e.consume(d),c):(e.exit(n),t(d))}}const UI={tokenize:BI};function BI(e){const t=e.attempt(this.parser.constructs.contentInitial,r,s);let n;return t;function r(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),Qe(e,t,"linePrefix")}function s(c){return e.enter("paragraph"),o(c)}function o(c){const d=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=d),n=d,a(c)}function a(c){if(c===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(c);return}return Oe(c)?(e.consume(c),e.exit("chunkText"),o):(e.consume(c),a)}}const VI={tokenize:qI},I0={tokenize:HI};function qI(e){const t=this,n=[];let r=0,s,o,a;return c;function c(j){if(r<n.length){const O=n[r];return t.containerState=O[1],e.attempt(O[0].continuation,d,f)(j)}return f(j)}function d(j){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,s&&E();const O=t.events.length;let N=O,T;for(;N--;)if(t.events[N][0]==="exit"&&t.events[N][1].type==="chunkFlow"){T=t.events[N][1].end;break}S(r);let I=O;for(;I<t.events.length;)t.events[I][1].end={...T},I++;return An(t.events,N+1,0,t.events.slice(O)),t.events.length=I,f(j)}return c(j)}function f(j){if(r===n.length){if(!s)return y(j);if(s.currentConstruct&&s.currentConstruct.concrete)return b(j);t.interrupt=!!(s.currentConstruct&&!s._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(I0,p,g)(j)}function p(j){return s&&E(),S(r),y(j)}function g(j){return t.parser.lazy[t.now().line]=r!==n.length,a=t.now().offset,b(j)}function y(j){return t.containerState={},e.attempt(I0,x,b)(j)}function x(j){return r++,n.push([t.currentConstruct,t.containerState]),y(j)}function b(j){if(j===null){s&&E(),S(0),e.consume(j);return}return s=s||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:s,contentType:"flow",previous:o}),w(j)}function w(j){if(j===null){k(e.exit("chunkFlow"),!0),S(0),e.consume(j);return}return Oe(j)?(e.consume(j),k(e.exit("chunkFlow")),r=0,t.interrupt=void 0,c):(e.consume(j),w)}function k(j,O){const N=t.sliceStream(j);if(O&&N.push(null),j.previous=o,o&&(o.next=j),o=j,s.defineSkip(j.start),s.write(N),t.parser.lazy[j.start.line]){let T=s.events.length;for(;T--;)if(s.events[T][1].start.offset<a&&(!s.events[T][1].end||s.events[T][1].end.offset>a))return;const I=t.events.length;let V=I,U,D;for(;V--;)if(t.events[V][0]==="exit"&&t.events[V][1].type==="chunkFlow"){if(U){D=t.events[V][1].end;break}U=!0}for(S(r),T=I;T<t.events.length;)t.events[T][1].end={...D},T++;An(t.events,V+1,0,t.events.slice(I)),t.events.length=T}}function S(j){let O=n.length;for(;O-- >j;){const N=n[O];t.containerState=N[1],N[0].exit.call(t,e)}n.length=j}function E(){s.write([null]),o=void 0,s=void 0,t.containerState._closeFlow=void 0}}function HI(e,t,n){return Qe(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function qi(e){if(e===null||at(e)||Fs(e))return 1;if(Yc(e))return 2}function Qc(e,t,n){const r=[];let s=-1;for(;++s<e.length;){const o=e[s].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const If={name:"attention",resolveAll:KI,tokenize:WI};function KI(e,t){let n=-1,r,s,o,a,c,d,f,p;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;d=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const g={...e[r][1].end},y={...e[n][1].start};D0(g,-d),D0(y,d),a={type:d>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},c={type:d>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:d>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},s={type:d>1?"strong":"emphasis",start:{...a.start},end:{...c.end}},e[r][1].end={...a.start},e[n][1].start={...c.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=$n(f,[["enter",e[r][1],t],["exit",e[r][1],t]])),f=$n(f,[["enter",s,t],["enter",a,t],["exit",a,t],["enter",o,t]]),f=$n(f,Qc(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),f=$n(f,[["exit",o,t],["enter",c,t],["exit",c,t],["exit",s,t]]),e[n][1].end.offset-e[n][1].start.offset?(p=2,f=$n(f,[["enter",e[n][1],t],["exit",e[n][1],t]])):p=0,An(e,r-1,n-r+3,f),n=r+f.length-p-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function WI(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,s=qi(r);let o;return a;function a(d){return o=d,e.enter("attentionSequence"),c(d)}function c(d){if(d===o)return e.consume(d),c;const f=e.exit("attentionSequence"),p=qi(d),g=!p||p===2&&s||n.includes(d),y=!s||s===2&&p||n.includes(r);return f._open=!!(o===42?g:g&&(s||!y)),f._close=!!(o===42?y:y&&(p||!g)),t(d)}}function D0(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const GI={name:"autolink",tokenize:JI};function JI(e,t,n){let r=0;return s;function s(x){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(x){return on(x)?(e.consume(x),a):x===64?n(x):f(x)}function a(x){return x===43||x===45||x===46||Zt(x)?(r=1,c(x)):f(x)}function c(x){return x===58?(e.consume(x),r=0,d):(x===43||x===45||x===46||Zt(x))&&r++<32?(e.consume(x),c):(r=0,f(x))}function d(x){return x===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):x===null||x===32||x===60||Ec(x)?n(x):(e.consume(x),d)}function f(x){return x===64?(e.consume(x),p):zI(x)?(e.consume(x),f):n(x)}function p(x){return Zt(x)?g(x):n(x)}function g(x){return x===46?(e.consume(x),r=0,p):x===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(x),e.exit("autolinkMarker"),e.exit("autolink"),t):y(x)}function y(x){if((x===45||Zt(x))&&r++<63){const b=x===45?y:g;return e.consume(x),b}return n(x)}}const Ra={partial:!0,tokenize:XI};function XI(e,t,n){return r;function r(o){return Xe(o)?Qe(e,s,"linePrefix")(o):s(o)}function s(o){return o===null||Oe(o)?t(o):n(o)}}const mk={continuation:{tokenize:QI},exit:ZI,name:"blockQuote",tokenize:YI};function YI(e,t,n){const r=this;return s;function s(a){if(a===62){const c=r.containerState;return c.open||(e.enter("blockQuote",{_container:!0}),c.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(a),e.exit("blockQuoteMarker"),o}return n(a)}function o(a){return Xe(a)?(e.enter("blockQuotePrefixWhitespace"),e.consume(a),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(a))}}function QI(e,t,n){const r=this;return s;function s(a){return Xe(a)?Qe(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(a):o(a)}function o(a){return e.attempt(mk,t,n)(a)}}function ZI(e){e.exit("blockQuote")}const gk={name:"characterEscape",tokenize:e4};function e4(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),s}function s(o){return $I(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const yk={name:"characterReference",tokenize:t4};function t4(e,t,n){const r=this;let s=0,o,a;return c;function c(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),d}function d(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),o=31,a=Zt,p(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,a=FI,p):(e.enter("characterReferenceValue"),o=7,a=Lf,p(g))}function p(g){if(g===59&&s){const y=e.exit("characterReferenceValue");return a===Zt&&!Hp(r.sliceSerialize(y))?n(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return a(g)&&s++<o?(e.consume(g),p):n(g)}}const M0={partial:!0,tokenize:r4},z0={concrete:!0,name:"codeFenced",tokenize:n4};function n4(e,t,n){const r=this,s={partial:!0,tokenize:N};let o=0,a=0,c;return d;function d(T){return f(T)}function f(T){const I=r.events[r.events.length-1];return o=I&&I[1].type==="linePrefix"?I[2].sliceSerialize(I[1],!0).length:0,c=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),p(T)}function p(T){return T===c?(a++,e.consume(T),p):a<3?n(T):(e.exit("codeFencedFenceSequence"),Xe(T)?Qe(e,g,"whitespace")(T):g(T))}function g(T){return T===null||Oe(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(M0,w,O)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Oe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(T)):Xe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Qe(e,x,"whitespace")(T)):T===96&&T===c?n(T):(e.consume(T),y)}function x(T){return T===null||Oe(T)?g(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),b(T))}function b(T){return T===null||Oe(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(T)):T===96&&T===c?n(T):(e.consume(T),b)}function w(T){return e.attempt(s,O,k)(T)}function k(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),S}function S(T){return o>0&&Xe(T)?Qe(e,E,"linePrefix",o+1)(T):E(T)}function E(T){return T===null||Oe(T)?e.check(M0,w,O)(T):(e.enter("codeFlowValue"),j(T))}function j(T){return T===null||Oe(T)?(e.exit("codeFlowValue"),E(T)):(e.consume(T),j)}function O(T){return e.exit("codeFenced"),t(T)}function N(T,I,V){let U=0;return D;function D(W){return T.enter("lineEnding"),T.consume(W),T.exit("lineEnding"),Z}function Z(W){return T.enter("codeFencedFence"),Xe(W)?Qe(T,Y,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):Y(W)}function Y(W){return W===c?(T.enter("codeFencedFenceSequence"),he(W)):V(W)}function he(W){return W===c?(U++,T.consume(W),he):U>=a?(T.exit("codeFencedFenceSequence"),Xe(W)?Qe(T,G,"whitespace")(W):G(W)):V(W)}function G(W){return W===null||Oe(W)?(T.exit("codeFencedFence"),I(W)):V(W)}}}function r4(e,t,n){const r=this;return s;function s(a){return a===null?n(a):(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}const Nh={name:"codeIndented",tokenize:i4},s4={partial:!0,tokenize:o4};function i4(e,t,n){const r=this;return s;function s(f){return e.enter("codeIndented"),Qe(e,o,"linePrefix",5)(f)}function o(f){const p=r.events[r.events.length-1];return p&&p[1].type==="linePrefix"&&p[2].sliceSerialize(p[1],!0).length>=4?a(f):n(f)}function a(f){return f===null?d(f):Oe(f)?e.attempt(s4,a,d)(f):(e.enter("codeFlowValue"),c(f))}function c(f){return f===null||Oe(f)?(e.exit("codeFlowValue"),a(f)):(e.consume(f),c)}function d(f){return e.exit("codeIndented"),t(f)}}function o4(e,t,n){const r=this;return s;function s(a){return r.parser.lazy[r.now().line]?n(a):Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),s):Qe(e,o,"linePrefix",5)(a)}function o(a){const c=r.events[r.events.length-1];return c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):Oe(a)?s(a):n(a)}}const a4={name:"codeText",previous:c4,resolve:l4,tokenize:u4};function l4(e){let t=e.length-4,n=3,r,s;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)s===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(s=r):(r===t||e[r][1].type==="lineEnding")&&(e[s][1].type="codeTextData",r!==s+2&&(e[s][1].end=e[r-1][1].end,e.splice(s+2,r-s-2),t-=r-s-2,r=s+2),s=void 0);return e}function c4(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function u4(e,t,n){let r=0,s,o;return a;function a(g){return e.enter("codeText"),e.enter("codeTextSequence"),c(g)}function c(g){return g===96?(e.consume(g),r++,c):(e.exit("codeTextSequence"),d(g))}function d(g){return g===null?n(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),d):g===96?(o=e.enter("codeTextSequence"),s=0,p(g)):Oe(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),d):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||Oe(g)?(e.exit("codeTextData"),d(g)):(e.consume(g),f)}function p(g){return g===96?(e.consume(g),s++,p):s===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(g)):(o.type="codeTextData",f(g))}}class d4{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const s=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-s,Number.POSITIVE_INFINITY);return r&&Uo(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Uo(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Uo(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);Uo(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);Uo(this.left,n.reverse())}}}function Uo(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function xk(e){const t={};let n=-1,r,s,o,a,c,d,f;const p=new d4(e);for(;++n<p.length;){for(;n in t;)n=t[n];if(r=p.get(n),n&&r[1].type==="chunkFlow"&&p.get(n-1)[1].type==="listItemPrefix"&&(d=r[1]._tokenizer.events,o=0,o<d.length&&d[o][1].type==="lineEndingBlank"&&(o+=2),o<d.length&&d[o][1].type==="content"))for(;++o<d.length&&d[o][1].type!=="content";)d[o][1].type==="chunkText"&&(d[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,h4(p,n)),n=t[n],f=!0);else if(r[1]._container){for(o=n,s=void 0;o--;)if(a=p.get(o),a[1].type==="lineEnding"||a[1].type==="lineEndingBlank")a[0]==="enter"&&(s&&(p.get(s)[1].type="lineEndingBlank"),a[1].type="lineEnding",s=o);else if(!(a[1].type==="linePrefix"||a[1].type==="listItemIndent"))break;s&&(r[1].end={...p.get(s)[1].start},c=p.slice(s,n),c.unshift(r),p.splice(s,n-s+1,c))}}return An(e,0,Number.POSITIVE_INFINITY,p.slice(0)),!f}function h4(e,t){const n=e.get(t)[1],r=e.get(t)[2];let s=t-1;const o=[];let a=n._tokenizer;a||(a=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(a._contentTypeTextTrailing=!0));const c=a.events,d=[],f={};let p,g,y=-1,x=n,b=0,w=0;const k=[w];for(;x;){for(;e.get(++s)[1]!==x;);o.push(s),x._tokenizer||(p=r.sliceStream(x),x.next||p.push(null),g&&a.defineSkip(x.start),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=!0),a.write(p),x._isInFirstContentOfListItem&&(a._gfmTasklistFirstContentOfListItem=void 0)),g=x,x=x.next}for(x=n;++y<c.length;)c[y][0]==="exit"&&c[y-1][0]==="enter"&&c[y][1].type===c[y-1][1].type&&c[y][1].start.line!==c[y][1].end.line&&(w=y+1,k.push(w),x._tokenizer=void 0,x.previous=void 0,x=x.next);for(a.events=[],x?(x._tokenizer=void 0,x.previous=void 0):k.pop(),y=k.length;y--;){const S=c.slice(k[y],k[y+1]),E=o.pop();d.push([E,E+S.length-1]),e.splice(E,2,S)}for(d.reverse(),y=-1;++y<d.length;)f[b+d[y][0]]=b+d[y][1],b+=d[y][1]-d[y][0]-1;return f}const f4={resolve:m4,tokenize:g4},p4={partial:!0,tokenize:y4};function m4(e){return xk(e),e}function g4(e,t){let n;return r;function r(c){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),s(c)}function s(c){return c===null?o(c):Oe(c)?e.check(p4,a,o)(c):(e.consume(c),s)}function o(c){return e.exit("chunkContent"),e.exit("content"),t(c)}function a(c){return e.consume(c),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,s}}function y4(e,t,n){const r=this;return s;function s(a){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),Qe(e,o,"linePrefix")}function o(a){if(a===null||Oe(a))return n(a);const c=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&c&&c[1].type==="linePrefix"&&c[2].sliceSerialize(c[1],!0).length>=4?t(a):e.interrupt(r.parser.constructs.flow,n,t)(a)}}function vk(e,t,n,r,s,o,a,c,d){const f=d||Number.POSITIVE_INFINITY;let p=0;return g;function g(S){return S===60?(e.enter(r),e.enter(s),e.enter(o),e.consume(S),e.exit(o),y):S===null||S===32||S===41||Ec(S)?n(S):(e.enter(r),e.enter(a),e.enter(c),e.enter("chunkString",{contentType:"string"}),w(S))}function y(S){return S===62?(e.enter(o),e.consume(S),e.exit(o),e.exit(s),e.exit(r),t):(e.enter(c),e.enter("chunkString",{contentType:"string"}),x(S))}function x(S){return S===62?(e.exit("chunkString"),e.exit(c),y(S)):S===null||S===60||Oe(S)?n(S):(e.consume(S),S===92?b:x)}function b(S){return S===60||S===62||S===92?(e.consume(S),x):x(S)}function w(S){return!p&&(S===null||S===41||at(S))?(e.exit("chunkString"),e.exit(c),e.exit(a),e.exit(r),t(S)):p<f&&S===40?(e.consume(S),p++,w):S===41?(e.consume(S),p--,w):S===null||S===32||S===40||Ec(S)?n(S):(e.consume(S),S===92?k:w)}function k(S){return S===40||S===41||S===92?(e.consume(S),w):w(S)}}function _k(e,t,n,r,s,o){const a=this;let c=0,d;return f;function f(x){return e.enter(r),e.enter(s),e.consume(x),e.exit(s),e.enter(o),p}function p(x){return c>999||x===null||x===91||x===93&&!d||x===94&&!c&&"_hiddenFootnoteSupport"in a.parser.constructs?n(x):x===93?(e.exit(o),e.enter(s),e.consume(x),e.exit(s),e.exit(r),t):Oe(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),p):(e.enter("chunkString",{contentType:"string"}),g(x))}function g(x){return x===null||x===91||x===93||Oe(x)||c++>999?(e.exit("chunkString"),p(x)):(e.consume(x),d||(d=!Xe(x)),x===92?y:g)}function y(x){return x===91||x===92||x===93?(e.consume(x),c++,g):g(x)}}function bk(e,t,n,r,s,o){let a;return c;function c(y){return y===34||y===39||y===40?(e.enter(r),e.enter(s),e.consume(y),e.exit(s),a=y===40?41:y,d):n(y)}function d(y){return y===a?(e.enter(s),e.consume(y),e.exit(s),e.exit(r),t):(e.enter(o),f(y))}function f(y){return y===a?(e.exit(o),d(a)):y===null?n(y):Oe(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Qe(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),p(y))}function p(y){return y===a||y===null||Oe(y)?(e.exit("chunkString"),f(y)):(e.consume(y),y===92?g:p)}function g(y){return y===a||y===92?(e.consume(y),p):p(y)}}function ra(e,t){let n;return r;function r(s){return Oe(s)?(e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n=!0,r):Xe(s)?Qe(e,r,n?"linePrefix":"lineSuffix")(s):t(s)}}const x4={name:"definition",tokenize:_4},v4={partial:!0,tokenize:b4};function _4(e,t,n){const r=this;let s;return o;function o(x){return e.enter("definition"),a(x)}function a(x){return _k.call(r,e,c,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(x)}function c(x){return s=Qn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),x===58?(e.enter("definitionMarker"),e.consume(x),e.exit("definitionMarker"),d):n(x)}function d(x){return at(x)?ra(e,f)(x):f(x)}function f(x){return vk(e,p,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(x)}function p(x){return e.attempt(v4,g,g)(x)}function g(x){return Xe(x)?Qe(e,y,"whitespace")(x):y(x)}function y(x){return x===null||Oe(x)?(e.exit("definition"),r.parser.defined.push(s),t(x)):n(x)}}function b4(e,t,n){return r;function r(c){return at(c)?ra(e,s)(c):n(c)}function s(c){return bk(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(c)}function o(c){return Xe(c)?Qe(e,a,"whitespace")(c):a(c)}function a(c){return c===null||Oe(c)?t(c):n(c)}}const w4={name:"hardBreakEscape",tokenize:k4};function k4(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),s}function s(o){return Oe(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const S4={name:"headingAtx",resolve:j4,tokenize:E4};function j4(e,t){let n=e.length-2,r=3,s,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(s={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},An(e,r,n-r+1,[["enter",s,t],["enter",o,t],["exit",o,t],["exit",s,t]])),e}function E4(e,t,n){let r=0;return s;function s(p){return e.enter("atxHeading"),o(p)}function o(p){return e.enter("atxHeadingSequence"),a(p)}function a(p){return p===35&&r++<6?(e.consume(p),a):p===null||at(p)?(e.exit("atxHeadingSequence"),c(p)):n(p)}function c(p){return p===35?(e.enter("atxHeadingSequence"),d(p)):p===null||Oe(p)?(e.exit("atxHeading"),t(p)):Xe(p)?Qe(e,c,"whitespace")(p):(e.enter("atxHeadingText"),f(p))}function d(p){return p===35?(e.consume(p),d):(e.exit("atxHeadingSequence"),c(p))}function f(p){return p===null||p===35||at(p)?(e.exit("atxHeadingText"),c(p)):(e.consume(p),f)}}const C4=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],F0=["pre","script","style","textarea"],N4={concrete:!0,name:"htmlFlow",resolveTo:R4,tokenize:P4},T4={partial:!0,tokenize:L4},A4={partial:!0,tokenize:O4};function R4(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function P4(e,t,n){const r=this;let s,o,a,c,d;return f;function f(P){return p(P)}function p(P){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(P),g}function g(P){return P===33?(e.consume(P),y):P===47?(e.consume(P),o=!0,w):P===63?(e.consume(P),s=3,r.interrupt?t:A):on(P)?(e.consume(P),a=String.fromCharCode(P),k):n(P)}function y(P){return P===45?(e.consume(P),s=2,x):P===91?(e.consume(P),s=5,c=0,b):on(P)?(e.consume(P),s=4,r.interrupt?t:A):n(P)}function x(P){return P===45?(e.consume(P),r.interrupt?t:A):n(P)}function b(P){const te="CDATA[";return P===te.charCodeAt(c++)?(e.consume(P),c===te.length?r.interrupt?t:Y:b):n(P)}function w(P){return on(P)?(e.consume(P),a=String.fromCharCode(P),k):n(P)}function k(P){if(P===null||P===47||P===62||at(P)){const te=P===47,me=a.toLowerCase();return!te&&!o&&F0.includes(me)?(s=1,r.interrupt?t(P):Y(P)):C4.includes(a.toLowerCase())?(s=6,te?(e.consume(P),S):r.interrupt?t(P):Y(P)):(s=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(P):o?E(P):j(P))}return P===45||Zt(P)?(e.consume(P),a+=String.fromCharCode(P),k):n(P)}function S(P){return P===62?(e.consume(P),r.interrupt?t:Y):n(P)}function E(P){return Xe(P)?(e.consume(P),E):D(P)}function j(P){return P===47?(e.consume(P),D):P===58||P===95||on(P)?(e.consume(P),O):Xe(P)?(e.consume(P),j):D(P)}function O(P){return P===45||P===46||P===58||P===95||Zt(P)?(e.consume(P),O):N(P)}function N(P){return P===61?(e.consume(P),T):Xe(P)?(e.consume(P),N):j(P)}function T(P){return P===null||P===60||P===61||P===62||P===96?n(P):P===34||P===39?(e.consume(P),d=P,I):Xe(P)?(e.consume(P),T):V(P)}function I(P){return P===d?(e.consume(P),d=null,U):P===null||Oe(P)?n(P):(e.consume(P),I)}function V(P){return P===null||P===34||P===39||P===47||P===60||P===61||P===62||P===96||at(P)?N(P):(e.consume(P),V)}function U(P){return P===47||P===62||Xe(P)?j(P):n(P)}function D(P){return P===62?(e.consume(P),Z):n(P)}function Z(P){return P===null||Oe(P)?Y(P):Xe(P)?(e.consume(P),Z):n(P)}function Y(P){return P===45&&s===2?(e.consume(P),ne):P===60&&s===1?(e.consume(P),re):P===62&&s===4?(e.consume(P),M):P===63&&s===3?(e.consume(P),A):P===93&&s===5?(e.consume(P),ce):Oe(P)&&(s===6||s===7)?(e.exit("htmlFlowData"),e.check(T4,K,he)(P)):P===null||Oe(P)?(e.exit("htmlFlowData"),he(P)):(e.consume(P),Y)}function he(P){return e.check(A4,G,K)(P)}function G(P){return e.enter("lineEnding"),e.consume(P),e.exit("lineEnding"),W}function W(P){return P===null||Oe(P)?he(P):(e.enter("htmlFlowData"),Y(P))}function ne(P){return P===45?(e.consume(P),A):Y(P)}function re(P){return P===47?(e.consume(P),a="",J):Y(P)}function J(P){if(P===62){const te=a.toLowerCase();return F0.includes(te)?(e.consume(P),M):Y(P)}return on(P)&&a.length<8?(e.consume(P),a+=String.fromCharCode(P),J):Y(P)}function ce(P){return P===93?(e.consume(P),A):Y(P)}function A(P){return P===62?(e.consume(P),M):P===45&&s===2?(e.consume(P),A):Y(P)}function M(P){return P===null||Oe(P)?(e.exit("htmlFlowData"),K(P)):(e.consume(P),M)}function K(P){return e.exit("htmlFlow"),t(P)}}function O4(e,t,n){const r=this;return s;function s(a){return Oe(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),o):n(a)}function o(a){return r.parser.lazy[r.now().line]?n(a):t(a)}}function L4(e,t,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),e.attempt(Ra,t,n)}}const I4={name:"htmlText",tokenize:D4};function D4(e,t,n){const r=this;let s,o,a;return c;function c(A){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(A),d}function d(A){return A===33?(e.consume(A),f):A===47?(e.consume(A),N):A===63?(e.consume(A),j):on(A)?(e.consume(A),V):n(A)}function f(A){return A===45?(e.consume(A),p):A===91?(e.consume(A),o=0,b):on(A)?(e.consume(A),E):n(A)}function p(A){return A===45?(e.consume(A),x):n(A)}function g(A){return A===null?n(A):A===45?(e.consume(A),y):Oe(A)?(a=g,re(A)):(e.consume(A),g)}function y(A){return A===45?(e.consume(A),x):g(A)}function x(A){return A===62?ne(A):A===45?y(A):g(A)}function b(A){const M="CDATA[";return A===M.charCodeAt(o++)?(e.consume(A),o===M.length?w:b):n(A)}function w(A){return A===null?n(A):A===93?(e.consume(A),k):Oe(A)?(a=w,re(A)):(e.consume(A),w)}function k(A){return A===93?(e.consume(A),S):w(A)}function S(A){return A===62?ne(A):A===93?(e.consume(A),S):w(A)}function E(A){return A===null||A===62?ne(A):Oe(A)?(a=E,re(A)):(e.consume(A),E)}function j(A){return A===null?n(A):A===63?(e.consume(A),O):Oe(A)?(a=j,re(A)):(e.consume(A),j)}function O(A){return A===62?ne(A):j(A)}function N(A){return on(A)?(e.consume(A),T):n(A)}function T(A){return A===45||Zt(A)?(e.consume(A),T):I(A)}function I(A){return Oe(A)?(a=I,re(A)):Xe(A)?(e.consume(A),I):ne(A)}function V(A){return A===45||Zt(A)?(e.consume(A),V):A===47||A===62||at(A)?U(A):n(A)}function U(A){return A===47?(e.consume(A),ne):A===58||A===95||on(A)?(e.consume(A),D):Oe(A)?(a=U,re(A)):Xe(A)?(e.consume(A),U):ne(A)}function D(A){return A===45||A===46||A===58||A===95||Zt(A)?(e.consume(A),D):Z(A)}function Z(A){return A===61?(e.consume(A),Y):Oe(A)?(a=Z,re(A)):Xe(A)?(e.consume(A),Z):U(A)}function Y(A){return A===null||A===60||A===61||A===62||A===96?n(A):A===34||A===39?(e.consume(A),s=A,he):Oe(A)?(a=Y,re(A)):Xe(A)?(e.consume(A),Y):(e.consume(A),G)}function he(A){return A===s?(e.consume(A),s=void 0,W):A===null?n(A):Oe(A)?(a=he,re(A)):(e.consume(A),he)}function G(A){return A===null||A===34||A===39||A===60||A===61||A===96?n(A):A===47||A===62||at(A)?U(A):(e.consume(A),G)}function W(A){return A===47||A===62||at(A)?U(A):n(A)}function ne(A){return A===62?(e.consume(A),e.exit("htmlTextData"),e.exit("htmlText"),t):n(A)}function re(A){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(A),e.exit("lineEnding"),J}function J(A){return Xe(A)?Qe(e,ce,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(A):ce(A)}function ce(A){return e.enter("htmlTextData"),a(A)}}const Kp={name:"labelEnd",resolveAll:$4,resolveTo:U4,tokenize:B4},M4={tokenize:V4},z4={tokenize:q4},F4={tokenize:H4};function $4(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const s=r.type==="labelImage"?4:2;r.type="data",t+=s}}return e.length!==n.length&&An(e,0,e.length,n),e}function U4(e,t){let n=e.length,r=0,s,o,a,c;for(;n--;)if(s=e[n][1],o){if(s.type==="link"||s.type==="labelLink"&&s._inactive)break;e[n][0]==="enter"&&s.type==="labelLink"&&(s._inactive=!0)}else if(a){if(e[n][0]==="enter"&&(s.type==="labelImage"||s.type==="labelLink")&&!s._balanced&&(o=n,s.type!=="labelLink")){r=2;break}}else s.type==="labelEnd"&&(a=n);const d={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[o][1].start},end:{...e[a][1].end}},p={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[a-2][1].start}};return c=[["enter",d,t],["enter",f,t]],c=$n(c,e.slice(o+1,o+r+3)),c=$n(c,[["enter",p,t]]),c=$n(c,Qc(t.parser.constructs.insideSpan.null,e.slice(o+r+4,a-3),t)),c=$n(c,[["exit",p,t],e[a-2],e[a-1],["exit",f,t]]),c=$n(c,e.slice(a+1)),c=$n(c,[["exit",d,t]]),An(e,o,e.length,c),e}function B4(e,t,n){const r=this;let s=r.events.length,o,a;for(;s--;)if((r.events[s][1].type==="labelImage"||r.events[s][1].type==="labelLink")&&!r.events[s][1]._balanced){o=r.events[s][1];break}return c;function c(y){return o?o._inactive?g(y):(a=r.parser.defined.includes(Qn(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),d):n(y)}function d(y){return y===40?e.attempt(M4,p,a?p:g)(y):y===91?e.attempt(z4,p,a?f:g)(y):a?p(y):g(y)}function f(y){return e.attempt(F4,p,g)(y)}function p(y){return t(y)}function g(y){return o._balanced=!0,n(y)}}function V4(e,t,n){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),s}function s(g){return at(g)?ra(e,o)(g):o(g)}function o(g){return g===41?p(g):vk(e,a,c,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function a(g){return at(g)?ra(e,d)(g):p(g)}function c(g){return n(g)}function d(g){return g===34||g===39||g===40?bk(e,f,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):p(g)}function f(g){return at(g)?ra(e,p)(g):p(g)}function p(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),t):n(g)}}function q4(e,t,n){const r=this;return s;function s(c){return _k.call(r,e,o,a,"reference","referenceMarker","referenceString")(c)}function o(c){return r.parser.defined.includes(Qn(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(c):n(c)}function a(c){return n(c)}}function H4(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),s}function s(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const K4={name:"labelStartImage",resolveAll:Kp.resolveAll,tokenize:W4};function W4(e,t,n){const r=this;return s;function s(c){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(c),e.exit("labelImageMarker"),o}function o(c){return c===91?(e.enter("labelMarker"),e.consume(c),e.exit("labelMarker"),e.exit("labelImage"),a):n(c)}function a(c){return c===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(c):t(c)}}const G4={name:"labelStartLink",resolveAll:Kp.resolveAll,tokenize:J4};function J4(e,t,n){const r=this;return s;function s(a){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(a),e.exit("labelMarker"),e.exit("labelLink"),o}function o(a){return a===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(a):t(a)}}const Th={name:"lineEnding",tokenize:X4};function X4(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Qe(e,t,"linePrefix")}}const cc={name:"thematicBreak",tokenize:Y4};function Y4(e,t,n){let r=0,s;return o;function o(f){return e.enter("thematicBreak"),a(f)}function a(f){return s=f,c(f)}function c(f){return f===s?(e.enter("thematicBreakSequence"),d(f)):r>=3&&(f===null||Oe(f))?(e.exit("thematicBreak"),t(f)):n(f)}function d(f){return f===s?(e.consume(f),r++,d):(e.exit("thematicBreakSequence"),Xe(f)?Qe(e,c,"whitespace")(f):c(f))}}const yn={continuation:{tokenize:tD},exit:rD,name:"list",tokenize:eD},Q4={partial:!0,tokenize:sD},Z4={partial:!0,tokenize:nD};function eD(e,t,n){const r=this,s=r.events[r.events.length-1];let o=s&&s[1].type==="linePrefix"?s[2].sliceSerialize(s[1],!0).length:0,a=0;return c;function c(x){const b=r.containerState.type||(x===42||x===43||x===45?"listUnordered":"listOrdered");if(b==="listUnordered"?!r.containerState.marker||x===r.containerState.marker:Lf(x)){if(r.containerState.type||(r.containerState.type=b,e.enter(b,{_container:!0})),b==="listUnordered")return e.enter("listItemPrefix"),x===42||x===45?e.check(cc,n,f)(x):f(x);if(!r.interrupt||x===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),d(x)}return n(x)}function d(x){return Lf(x)&&++a<10?(e.consume(x),d):(!r.interrupt||a<2)&&(r.containerState.marker?x===r.containerState.marker:x===41||x===46)?(e.exit("listItemValue"),f(x)):n(x)}function f(x){return e.enter("listItemMarker"),e.consume(x),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||x,e.check(Ra,r.interrupt?n:p,e.attempt(Q4,y,g))}function p(x){return r.containerState.initialBlankLine=!0,o++,y(x)}function g(x){return Xe(x)?(e.enter("listItemPrefixWhitespace"),e.consume(x),e.exit("listItemPrefixWhitespace"),y):n(x)}function y(x){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(x)}}function tD(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ra,s,o);function s(c){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Qe(e,t,"listItemIndent",r.containerState.size+1)(c)}function o(c){return r.containerState.furtherBlankLines||!Xe(c)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,a(c)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(Z4,t,a)(c))}function a(c){return r.containerState._closeFlow=!0,r.interrupt=void 0,Qe(e,e.attempt(yn,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(c)}}function nD(e,t,n){const r=this;return Qe(e,s,"listItemIndent",r.containerState.size+1);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="listItemIndent"&&a[2].sliceSerialize(a[1],!0).length===r.containerState.size?t(o):n(o)}}function rD(e){e.exit(this.containerState.type)}function sD(e,t,n){const r=this;return Qe(e,s,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function s(o){const a=r.events[r.events.length-1];return!Xe(o)&&a&&a[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const $0={name:"setextUnderline",resolveTo:iD,tokenize:oD};function iD(e,t){let n=e.length,r,s,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(s=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const a={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[s][1].type="setextHeadingText",o?(e.splice(s,0,["enter",a,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=a,e.push(["exit",a,t]),e}function oD(e,t,n){const r=this;let s;return o;function o(f){let p=r.events.length,g;for(;p--;)if(r.events[p][1].type!=="lineEnding"&&r.events[p][1].type!=="linePrefix"&&r.events[p][1].type!=="content"){g=r.events[p][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),s=f,a(f)):n(f)}function a(f){return e.enter("setextHeadingLineSequence"),c(f)}function c(f){return f===s?(e.consume(f),c):(e.exit("setextHeadingLineSequence"),Xe(f)?Qe(e,d,"lineSuffix")(f):d(f))}function d(f){return f===null||Oe(f)?(e.exit("setextHeadingLine"),t(f)):n(f)}}const aD={tokenize:lD};function lD(e){const t=this,n=e.attempt(Ra,r,e.attempt(this.parser.constructs.flowInitial,s,Qe(e,e.attempt(this.parser.constructs.flow,s,e.attempt(f4,s)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function s(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const cD={resolveAll:kk()},uD=wk("string"),dD=wk("text");function wk(e){return{resolveAll:kk(e==="text"?hD:void 0),tokenize:t};function t(n){const r=this,s=this.parser.constructs[e],o=n.attempt(s,a,c);return a;function a(p){return f(p)?o(p):c(p)}function c(p){if(p===null){n.consume(p);return}return n.enter("data"),n.consume(p),d}function d(p){return f(p)?(n.exit("data"),o(p)):(n.consume(p),d)}function f(p){if(p===null)return!0;const g=s[p];let y=-1;if(g)for(;++y<g.length;){const x=g[y];if(!x.previous||x.previous.call(r,r.previous))return!0}return!1}}}function kk(e){return t;function t(n,r){let s=-1,o;for(;++s<=n.length;)o===void 0?n[s]&&n[s][1].type==="data"&&(o=s,s++):(!n[s]||n[s][1].type!=="data")&&(s!==o+2&&(n[o][1].end=n[s-1][1].end,n.splice(o+2,s-o-2),s=o+2),o=void 0);return e?e(n,r):n}}function hD(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],s=t.sliceStream(r);let o=s.length,a=-1,c=0,d;for(;o--;){const f=s[o];if(typeof f=="string"){for(a=f.length;f.charCodeAt(a-1)===32;)c++,a--;if(a)break;a=-1}else if(f===-2)d=!0,c++;else if(f!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(c=0),c){const f={type:n===e.length||d||c<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?a:r.start._bufferIndex+a,_index:r.start._index+o,line:r.end.line,column:r.end.column-c,offset:r.end.offset-c},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(n,0,["enter",f,t],["exit",f,t]),n+=2)}n++}return e}const fD={42:yn,43:yn,45:yn,48:yn,49:yn,50:yn,51:yn,52:yn,53:yn,54:yn,55:yn,56:yn,57:yn,62:mk},pD={91:x4},mD={[-2]:Nh,[-1]:Nh,32:Nh},gD={35:S4,42:cc,45:[$0,cc],60:N4,61:$0,95:cc,96:z0,126:z0},yD={38:yk,92:gk},xD={[-5]:Th,[-4]:Th,[-3]:Th,33:K4,38:yk,42:If,60:[GI,I4],91:G4,92:[w4,gk],93:Kp,95:If,96:a4},vD={null:[If,cD]},_D={null:[42,95]},bD={null:[]},wD=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:_D,contentInitial:pD,disable:bD,document:fD,flow:gD,flowInitial:mD,insideSpan:vD,string:yD,text:xD},Symbol.toStringTag,{value:"Module"}));function kD(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const s={},o=[];let a=[],c=[];const d={attempt:I(N),check:I(T),consume:E,enter:j,exit:O,interrupt:I(T,{interrupt:!0})},f={code:null,containerState:{},defineSkip:w,events:[],now:b,parser:e,previous:null,sliceSerialize:y,sliceStream:x,write:g};let p=t.tokenize.call(f,d);return t.resolveAll&&o.push(t),f;function g(Z){return a=$n(a,Z),k(),a[a.length-1]!==null?[]:(V(t,0),f.events=Qc(o,f.events,f),f.events)}function y(Z,Y){return jD(x(Z),Y)}function x(Z){return SD(a,Z)}function b(){const{_bufferIndex:Z,_index:Y,line:he,column:G,offset:W}=r;return{_bufferIndex:Z,_index:Y,line:he,column:G,offset:W}}function w(Z){s[Z.line]=Z.column,D()}function k(){let Z;for(;r._index<a.length;){const Y=a[r._index];if(typeof Y=="string")for(Z=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===Z&&r._bufferIndex<Y.length;)S(Y.charCodeAt(r._bufferIndex));else S(Y)}}function S(Z){p=p(Z)}function E(Z){Oe(Z)?(r.line++,r.column=1,r.offset+=Z===-3?2:1,D()):Z!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===a[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=Z}function j(Z,Y){const he=Y||{};return he.type=Z,he.start=b(),f.events.push(["enter",he,f]),c.push(he),he}function O(Z){const Y=c.pop();return Y.end=b(),f.events.push(["exit",Y,f]),Y}function N(Z,Y){V(Z,Y.from)}function T(Z,Y){Y.restore()}function I(Z,Y){return he;function he(G,W,ne){let re,J,ce,A;return Array.isArray(G)?K(G):"tokenize"in G?K([G]):M(G);function M(ye){return Fe;function Fe(Ae){const Ie=Ae!==null&&ye[Ae],Te=Ae!==null&&ye.null,Je=[...Array.isArray(Ie)?Ie:Ie?[Ie]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return K(Je)(Ae)}}function K(ye){return re=ye,J=0,ye.length===0?ne:P(ye[J])}function P(ye){return Fe;function Fe(Ae){return A=U(),ce=ye,ye.partial||(f.currentConstruct=ye),ye.name&&f.parser.constructs.disable.null.includes(ye.name)?me():ye.tokenize.call(Y?Object.assign(Object.create(f),Y):f,d,te,me)(Ae)}}function te(ye){return Z(ce,A),W}function me(ye){return A.restore(),++J<re.length?P(re[J]):ne}}}function V(Z,Y){Z.resolveAll&&!o.includes(Z)&&o.push(Z),Z.resolve&&An(f.events,Y,f.events.length-Y,Z.resolve(f.events.slice(Y),f)),Z.resolveTo&&(f.events=Z.resolveTo(f.events,f))}function U(){const Z=b(),Y=f.previous,he=f.currentConstruct,G=f.events.length,W=Array.from(c);return{from:G,restore:ne};function ne(){r=Z,f.previous=Y,f.currentConstruct=he,f.events.length=G,c=W,D()}}function D(){r.line in s&&r.column<2&&(r.column=s[r.line],r.offset+=s[r.line]-1)}}function SD(e,t){const n=t.start._index,r=t.start._bufferIndex,s=t.end._index,o=t.end._bufferIndex;let a;if(n===s)a=[e[n].slice(r,o)];else{if(a=e.slice(n,s),r>-1){const c=a[0];typeof c=="string"?a[0]=c.slice(r):a.shift()}o>0&&a.push(e[s].slice(0,o))}return a}function jD(e,t){let n=-1;const r=[];let s;for(;++n<e.length;){const o=e[n];let a;if(typeof o=="string")a=o;else switch(o){case-5:{a="\r";break}case-4:{a=`
|
|
109
|
+
`;break}case-3:{a=`\r
|
|
110
|
+
`;break}case-2:{a=t?" ":" ";break}case-1:{if(!t&&s)continue;a=" ";break}default:a=String.fromCharCode(o)}s=o===-2,r.push(a)}return r.join("")}function ED(e){const r={constructs:fk([wD,...(e||{}).extensions||[]]),content:s(UI),defined:[],document:s(VI),flow:s(aD),lazy:{},string:s(uD),text:s(dD)};return r;function s(o){return a;function a(c){return kD(r,o,c)}}}function CD(e){for(;!xk(e););return e}const U0=/[\0\t\n\r]/g;function ND(){let e=1,t="",n=!0,r;return s;function s(o,a,c){const d=[];let f,p,g,y,x;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(a||void 0).decode(o)),g=0,t="",n&&(o.charCodeAt(0)===65279&&g++,n=void 0);g<o.length;){if(U0.lastIndex=g,f=U0.exec(o),y=f&&f.index!==void 0?f.index:o.length,x=o.charCodeAt(y),!f){t=o.slice(g);break}if(x===10&&g===y&&r)d.push(-3),r=void 0;else switch(r&&(d.push(-5),r=void 0),g<y&&(d.push(o.slice(g,y)),e+=y-g),x){case 0:{d.push(65533),e++;break}case 9:{for(p=Math.ceil(e/4)*4,d.push(-2);e++<p;)d.push(-1);break}case 10:{d.push(-4),e=1;break}default:r=!0,e=1}g=y+1}return c&&(r&&d.push(-5),t&&d.push(t),d.push(null)),d}}const TD=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function AD(e){return e.replace(TD,RD)}function RD(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const s=n.charCodeAt(1),o=s===120||s===88;return pk(n.slice(o?2:1),o?16:10)}return Hp(n)||e}const Sk={}.hasOwnProperty;function PD(e,t,n){return typeof t!="string"&&(n=t,t=void 0),OD(n)(CD(ED(n).document().write(ND()(e,t,!0))))}function OD(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(Se),autolinkProtocol:U,autolinkEmail:U,atxHeading:o(X),blockQuote:o(Te),characterEscape:U,characterReference:U,codeFenced:o(Je),codeFencedFenceInfo:a,codeFencedFenceMeta:a,codeIndented:o(Je,a),codeText:o(et,a),codeTextData:U,data:U,codeFlowValue:U,definition:o(Ce),definitionDestinationString:a,definitionLabelString:a,definitionTitleString:a,emphasis:o(gt),hardBreakEscape:o(ke),hardBreakTrailing:o(ke),htmlFlow:o(ee,a),htmlFlowData:U,htmlText:o(ee,a),htmlTextData:U,image:o(pe),label:a,link:o(Se),listItem:o(Be),listItemValue:y,listOrdered:o(ve,g),listUnordered:o(ve),paragraph:o(we),reference:P,referenceString:a,resourceDestinationString:a,resourceTitleString:a,setextHeading:o(X),strong:o(nt),thematicBreak:o(it)},exit:{atxHeading:d(),atxHeadingSequence:N,autolink:d(),autolinkEmail:Ie,autolinkProtocol:Ae,blockQuote:d(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:me,characterReferenceMarkerNumeric:me,characterReferenceValue:ye,characterReference:Fe,codeFenced:d(k),codeFencedFence:w,codeFencedFenceInfo:x,codeFencedFenceMeta:b,codeFlowValue:D,codeIndented:d(S),codeText:d(W),codeTextData:D,data:D,definition:d(),definitionDestinationString:O,definitionLabelString:E,definitionTitleString:j,emphasis:d(),hardBreakEscape:d(Y),hardBreakTrailing:d(Y),htmlFlow:d(he),htmlFlowData:D,htmlText:d(G),htmlTextData:D,image:d(re),label:ce,labelText:J,lineEnding:Z,link:d(ne),listItem:d(),listOrdered:d(),listUnordered:d(),paragraph:d(),referenceString:te,resourceDestinationString:A,resourceTitleString:M,resource:K,setextHeading:d(V),setextHeadingLineSequence:I,setextHeadingText:T,strong:d(),thematicBreak:d()}};jk(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(Q){let le={type:"root",children:[]};const _e={stack:[le],tokenStack:[],config:t,enter:c,exit:f,buffer:a,resume:p,data:n},Ve=[];let He=-1;for(;++He<Q.length;)if(Q[He][1].type==="listOrdered"||Q[He][1].type==="listUnordered")if(Q[He][0]==="enter")Ve.push(He);else{const lt=Ve.pop();He=s(Q,lt,He)}for(He=-1;++He<Q.length;){const lt=t[Q[He][0]];Sk.call(lt,Q[He][1].type)&<[Q[He][1].type].call(Object.assign({sliceSerialize:Q[He][2].sliceSerialize},_e),Q[He][1])}if(_e.tokenStack.length>0){const lt=_e.tokenStack[_e.tokenStack.length-1];(lt[1]||B0).call(_e,void 0,lt[0])}for(le.position={start:Jr(Q.length>0?Q[0][1].start:{line:1,column:1,offset:0}),end:Jr(Q.length>0?Q[Q.length-2][1].end:{line:1,column:1,offset:0})},He=-1;++He<t.transforms.length;)le=t.transforms[He](le)||le;return le}function s(Q,le,_e){let Ve=le-1,He=-1,lt=!1,$t,Nt,cn,tn;for(;++Ve<=_e;){const We=Q[Ve];switch(We[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{We[0]==="enter"?He++:He--,tn=void 0;break}case"lineEndingBlank":{We[0]==="enter"&&($t&&!tn&&!He&&!cn&&(cn=Ve),tn=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:tn=void 0}if(!He&&We[0]==="enter"&&We[1].type==="listItemPrefix"||He===-1&&We[0]==="exit"&&(We[1].type==="listUnordered"||We[1].type==="listOrdered")){if($t){let un=Ve;for(Nt=void 0;un--;){const nn=Q[un];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;Nt&&(Q[Nt][1].type="lineEndingBlank",lt=!0),nn[1].type="lineEnding",Nt=un}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}cn&&(!Nt||cn<Nt)&&($t._spread=!0),$t.end=Object.assign({},Nt?Q[Nt][1].start:We[1].end),Q.splice(Nt||Ve,0,["exit",$t,We[2]]),Ve++,_e++}if(We[1].type==="listItemPrefix"){const un={type:"listItem",_spread:!1,start:Object.assign({},We[1].start),end:void 0};$t=un,Q.splice(Ve,0,["enter",un,We[2]]),Ve++,_e++,cn=void 0,tn=!0}}}return Q[le][1]._spread=lt,_e}function o(Q,le){return _e;function _e(Ve){c.call(this,Q(Ve),Ve),le&&le.call(this,Ve)}}function a(){this.stack.push({type:"fragment",children:[]})}function c(Q,le,_e){this.stack[this.stack.length-1].children.push(Q),this.stack.push(Q),this.tokenStack.push([le,_e||void 0]),Q.position={start:Jr(le.start),end:void 0}}function d(Q){return le;function le(_e){Q&&Q.call(this,_e),f.call(this,_e)}}function f(Q,le){const _e=this.stack.pop(),Ve=this.tokenStack.pop();if(Ve)Ve[0].type!==Q.type&&(le?le.call(this,Q,Ve[0]):(Ve[1]||B0).call(this,Q,Ve[0]));else throw new Error("Cannot close `"+Q.type+"` ("+na({start:Q.start,end:Q.end})+"): it’s not open");_e.position.end=Jr(Q.end)}function p(){return qp(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function y(Q){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(Q),10),this.data.expectingFirstListItemValue=void 0}}function x(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.lang=Q}function b(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.meta=Q}function w(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function k(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q.replace(/(\r?\n|\r)$/g,"")}function E(Q){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.label=le,_e.identifier=Qn(this.sliceSerialize(Q)).toLowerCase()}function j(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function O(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function N(Q){const le=this.stack[this.stack.length-1];if(!le.depth){const _e=this.sliceSerialize(Q).length;le.depth=_e}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function I(Q){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(Q).codePointAt(0)===61?1:2}function V(){this.data.setextHeadingSlurpLineEnding=void 0}function U(Q){const _e=this.stack[this.stack.length-1].children;let Ve=_e[_e.length-1];(!Ve||Ve.type!=="text")&&(Ve=st(),Ve.position={start:Jr(Q.start),end:void 0},_e.push(Ve)),this.stack.push(Ve)}function D(Q){const le=this.stack.pop();le.value+=this.sliceSerialize(Q),le.position.end=Jr(Q.end)}function Z(Q){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const _e=le.children[le.children.length-1];_e.position.end=Jr(Q.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(le.type)&&(U.call(this,Q),D.call(this,Q))}function Y(){this.data.atHardBreak=!0}function he(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function G(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function W(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.value=Q}function ne(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function re(){const Q=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";Q.type+="Reference",Q.referenceType=le,delete Q.url,delete Q.title}else delete Q.identifier,delete Q.label;this.data.referenceType=void 0}function J(Q){const le=this.sliceSerialize(Q),_e=this.stack[this.stack.length-2];_e.label=AD(le),_e.identifier=Qn(le).toLowerCase()}function ce(){const Q=this.stack[this.stack.length-1],le=this.resume(),_e=this.stack[this.stack.length-1];if(this.data.inReference=!0,_e.type==="link"){const Ve=Q.children;_e.children=Ve}else _e.alt=le}function A(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.url=Q}function M(){const Q=this.resume(),le=this.stack[this.stack.length-1];le.title=Q}function K(){this.data.inReference=void 0}function P(){this.data.referenceType="collapsed"}function te(Q){const le=this.resume(),_e=this.stack[this.stack.length-1];_e.label=le,_e.identifier=Qn(this.sliceSerialize(Q)).toLowerCase(),this.data.referenceType="full"}function me(Q){this.data.characterReferenceType=Q.type}function ye(Q){const le=this.sliceSerialize(Q),_e=this.data.characterReferenceType;let Ve;_e?(Ve=pk(le,_e==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ve=Hp(le);const He=this.stack[this.stack.length-1];He.value+=Ve}function Fe(Q){const le=this.stack.pop();le.position.end=Jr(Q.end)}function Ae(Q){D.call(this,Q);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(Q)}function Ie(Q){D.call(this,Q);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(Q)}function Te(){return{type:"blockquote",children:[]}}function Je(){return{type:"code",lang:null,meta:null,value:""}}function et(){return{type:"inlineCode",value:""}}function Ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function gt(){return{type:"emphasis",children:[]}}function X(){return{type:"heading",depth:0,children:[]}}function ke(){return{type:"break"}}function ee(){return{type:"html",value:""}}function pe(){return{type:"image",title:null,url:"",alt:null}}function Se(){return{type:"link",title:null,url:"",children:[]}}function ve(Q){return{type:"list",ordered:Q.type==="listOrdered",start:null,spread:Q._spread,children:[]}}function Be(Q){return{type:"listItem",spread:Q._spread,checked:null,children:[]}}function we(){return{type:"paragraph",children:[]}}function nt(){return{type:"strong",children:[]}}function st(){return{type:"text",value:""}}function it(){return{type:"thematicBreak"}}}function Jr(e){return{line:e.line,column:e.column,offset:e.offset}}function jk(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?jk(e,r):LD(e,r)}}function LD(e,t){let n;for(n in t)if(Sk.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function B0(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+na({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+na({start:t.start,end:t.end})+") is still open")}function ID(e){const t=this;t.parser=n;function n(r){return PD(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function DD(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function MD(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
111
|
+
`}]}function zD(e,t){const n=t.value?t.value+`
|
|
112
|
+
`:"",r={},s=t.lang?t.lang.split(/\s+/):[];s.length>0&&(r.className=["language-"+s[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function FD(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function $D(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function UD(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),s=Xi(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let a,c=e.footnoteCounts.get(r);c===void 0?(c=0,e.footnoteOrder.push(r),a=e.footnoteOrder.length):a=o+1,c+=1,e.footnoteCounts.set(r,c);const d={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+s,id:n+"fnref-"+s+(c>1?"-"+c:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(a)}]};e.patch(t,d);const f={type:"element",tagName:"sup",properties:{},children:[d]};return e.patch(t,f),e.applyData(t,f)}function BD(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function VD(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function Ek(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const s=e.all(t),o=s[0];o&&o.type==="text"?o.value="["+o.value:s.unshift({type:"text",value:"["});const a=s[s.length-1];return a&&a.type==="text"?a.value+=r:s.push({type:"text",value:r}),s}function qD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ek(e,t);const s={src:Xi(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"img",properties:s,children:[]};return e.patch(t,o),e.applyData(t,o)}function HD(e,t){const n={src:Xi(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function KD(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function WD(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return Ek(e,t);const s={href:Xi(r.url||"")};r.title!==null&&r.title!==void 0&&(s.title=r.title);const o={type:"element",tagName:"a",properties:s,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function GD(e,t){const n={href:Xi(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function JD(e,t,n){const r=e.all(t),s=n?XD(n):Ck(t),o={},a=[];if(typeof t.checked=="boolean"){const p=r[0];let g;p&&p.type==="element"&&p.tagName==="p"?g=p:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let c=-1;for(;++c<r.length;){const p=r[c];(s||c!==0||p.type!=="element"||p.tagName!=="p")&&a.push({type:"text",value:`
|
|
113
|
+
`}),p.type==="element"&&p.tagName==="p"&&!s?a.push(...p.children):a.push(p)}const d=r[r.length-1];d&&(s||d.type!=="element"||d.tagName!=="p")&&a.push({type:"text",value:`
|
|
114
|
+
`});const f={type:"element",tagName:"li",properties:o,children:a};return e.patch(t,f),e.applyData(t,f)}function XD(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=Ck(n[r])}return t}function Ck(e){const t=e.spread;return t??e.children.length>1}function YD(e,t){const n={},r=e.all(t);let s=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++s<r.length;){const a=r[s];if(a.type==="element"&&a.tagName==="li"&&a.properties&&Array.isArray(a.properties.className)&&a.properties.className.includes("task-list-item")){n.className=["contains-task-list"];break}}const o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function QD(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZD(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function e5(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function t5(e,t){const n=e.all(t),r=n.shift(),s=[];if(r){const a={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],a),s.push(a)}if(n.length>0){const a={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},c=$p(t.children[1]),d=ok(t.children[t.children.length-1]);c&&d&&(a.position={start:c,end:d}),s.push(a)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(s,!0)};return e.patch(t,o),e.applyData(t,o)}function n5(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",a=n&&n.type==="table"?n.align:void 0,c=a?a.length:t.children.length;let d=-1;const f=[];for(;++d<c;){const g=t.children[d],y={},x=a?a[d]:void 0;x&&(y.align=x);let b={type:"element",tagName:o,properties:y,children:[]};g&&(b.children=e.all(g),e.patch(g,b),b=e.applyData(g,b)),f.push(b)}const p={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(t,p),e.applyData(t,p)}function r5(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const V0=9,q0=32;function s5(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),s=0;const o=[];for(;r;)o.push(H0(t.slice(s,r.index),s>0,!0),r[0]),s=r.index+r[0].length,r=n.exec(t);return o.push(H0(t.slice(s),s>0,!1)),o.join("")}function H0(e,t,n){let r=0,s=e.length;if(t){let o=e.codePointAt(r);for(;o===V0||o===q0;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(s-1);for(;o===V0||o===q0;)s--,o=e.codePointAt(s-1)}return s>r?e.slice(r,s):""}function i5(e,t){const n={type:"text",value:s5(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function o5(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const a5={blockquote:DD,break:MD,code:zD,delete:FD,emphasis:$D,footnoteReference:UD,heading:BD,html:VD,imageReference:qD,image:HD,inlineCode:KD,linkReference:WD,link:GD,listItem:JD,list:YD,paragraph:QD,root:ZD,strong:e5,table:t5,tableCell:r5,tableRow:n5,text:i5,thematicBreak:o5,toml:Yl,yaml:Yl,definition:Yl,footnoteDefinition:Yl};function Yl(){}const Nk=-1,Zc=0,sa=1,Cc=2,Wp=3,Gp=4,Jp=5,Xp=6,Tk=7,Ak=8,K0=typeof self=="object"?self:globalThis,l5=(e,t)=>{const n=(s,o)=>(e.set(o,s),s),r=s=>{if(e.has(s))return e.get(s);const[o,a]=t[s];switch(o){case Zc:case Nk:return n(a,s);case sa:{const c=n([],s);for(const d of a)c.push(r(d));return c}case Cc:{const c=n({},s);for(const[d,f]of a)c[r(d)]=r(f);return c}case Wp:return n(new Date(a),s);case Gp:{const{source:c,flags:d}=a;return n(new RegExp(c,d),s)}case Jp:{const c=n(new Map,s);for(const[d,f]of a)c.set(r(d),r(f));return c}case Xp:{const c=n(new Set,s);for(const d of a)c.add(r(d));return c}case Tk:{const{name:c,message:d}=a;return n(new K0[c](d),s)}case Ak:return n(BigInt(a),s);case"BigInt":return n(Object(BigInt(a)),s);case"ArrayBuffer":return n(new Uint8Array(a).buffer,a);case"DataView":{const{buffer:c}=new Uint8Array(a);return n(new DataView(c),a)}}return n(new K0[o](a),s)};return r},W0=e=>l5(new Map,e)(0),_i="",{toString:c5}={},{keys:u5}=Object,Bo=e=>{const t=typeof e;if(t!=="object"||!e)return[Zc,t];const n=c5.call(e).slice(8,-1);switch(n){case"Array":return[sa,_i];case"Object":return[Cc,_i];case"Date":return[Wp,_i];case"RegExp":return[Gp,_i];case"Map":return[Jp,_i];case"Set":return[Xp,_i];case"DataView":return[sa,n]}return n.includes("Array")?[sa,n]:n.includes("Error")?[Tk,n]:[Cc,n]},Ql=([e,t])=>e===Zc&&(t==="function"||t==="symbol"),d5=(e,t,n,r)=>{const s=(a,c)=>{const d=r.push(a)-1;return n.set(c,d),d},o=a=>{if(n.has(a))return n.get(a);let[c,d]=Bo(a);switch(c){case Zc:{let p=a;switch(d){case"bigint":c=Ak,p=a.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+d);p=null;break;case"undefined":return s([Nk],a)}return s([c,p],a)}case sa:{if(d){let y=a;return d==="DataView"?y=new Uint8Array(a.buffer):d==="ArrayBuffer"&&(y=new Uint8Array(a)),s([d,[...y]],a)}const p=[],g=s([c,p],a);for(const y of a)p.push(o(y));return g}case Cc:{if(d)switch(d){case"BigInt":return s([d,a.toString()],a);case"Boolean":case"Number":case"String":return s([d,a.valueOf()],a)}if(t&&"toJSON"in a)return o(a.toJSON());const p=[],g=s([c,p],a);for(const y of u5(a))(e||!Ql(Bo(a[y])))&&p.push([o(y),o(a[y])]);return g}case Wp:return s([c,a.toISOString()],a);case Gp:{const{source:p,flags:g}=a;return s([c,{source:p,flags:g}],a)}case Jp:{const p=[],g=s([c,p],a);for(const[y,x]of a)(e||!(Ql(Bo(y))||Ql(Bo(x))))&&p.push([o(y),o(x)]);return g}case Xp:{const p=[],g=s([c,p],a);for(const y of a)(e||!Ql(Bo(y)))&&p.push(o(y));return g}}const{message:f}=a;return s([c,{name:d,message:f}],a)};return o},G0=(e,{json:t,lossy:n}={})=>{const r=[];return d5(!(t||n),!!t,new Map,r)(e),r},Nc=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?W0(G0(e,t)):structuredClone(e):(e,t)=>W0(G0(e,t));function h5(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function f5(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function p5(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||h5,r=e.options.footnoteBackLabel||f5,s=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",a=e.options.footnoteLabelProperties||{className:["sr-only"]},c=[];let d=-1;for(;++d<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[d]);if(!f)continue;const p=e.all(f),g=String(f.identifier).toUpperCase(),y=Xi(g.toLowerCase());let x=0;const b=[],w=e.footnoteCounts.get(g);for(;w!==void 0&&++x<=w;){b.length>0&&b.push({type:"text",value:" "});let E=typeof n=="string"?n:n(d,x);typeof E=="string"&&(E={type:"text",value:E}),b.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(x>1?"-"+x:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(d,x),className:["data-footnote-backref"]},children:Array.isArray(E)?E:[E]})}const k=p[p.length-1];if(k&&k.type==="element"&&k.tagName==="p"){const E=k.children[k.children.length-1];E&&E.type==="text"?E.value+=" ":k.children.push({type:"text",value:" "}),k.children.push(...b)}else p.push(...b);const S={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(p,!0)};e.patch(f,S),c.push(S)}if(c.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...Nc(a),id:"footnote-label"},children:[{type:"text",value:s}]},{type:"text",value:`
|
|
115
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(c,!0)},{type:"text",value:`
|
|
116
|
+
`}]}}const eu=(function(e){if(e==null)return x5;if(typeof e=="function")return tu(e);if(typeof e=="object")return Array.isArray(e)?m5(e):g5(e);if(typeof e=="string")return y5(e);throw new Error("Expected function, string, or object as test")});function m5(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=eu(e[n]);return tu(r);function r(...s){let o=-1;for(;++o<t.length;)if(t[o].apply(this,s))return!0;return!1}}function g5(e){const t=e;return tu(n);function n(r){const s=r;let o;for(o in e)if(s[o]!==t[o])return!1;return!0}}function y5(e){return tu(t);function t(n){return n&&n.type===e}}function tu(e){return t;function t(n,r,s){return!!(v5(n)&&e.call(this,n,typeof r=="number"?r:void 0,s||void 0))}}function x5(){return!0}function v5(e){return e!==null&&typeof e=="object"&&"type"in e}const Rk=[],_5=!0,Df=!1,b5="skip";function Pk(e,t,n,r){let s;typeof t=="function"&&typeof n!="function"?(r=n,n=t):s=t;const o=eu(s),a=r?-1:1;c(e,void 0,[])();function c(d,f,p){const g=d&&typeof d=="object"?d:{};if(typeof g.type=="string"){const x=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(d.type+(x?"<"+x+">":""))+")"})}return y;function y(){let x=Rk,b,w,k;if((!t||o(d,f,p[p.length-1]||void 0))&&(x=w5(n(d,p)),x[0]===Df))return x;if("children"in d&&d.children){const S=d;if(S.children&&x[0]!==b5)for(w=(r?S.children.length:-1)+a,k=p.concat(S);w>-1&&w<S.children.length;){const E=S.children[w];if(b=c(E,w,k)(),b[0]===Df)return b;w=typeof b[1]=="number"?b[1]:w+a}}return x}}}function w5(e){return Array.isArray(e)?e:typeof e=="number"?[_5,e]:e==null?Rk:[e]}function Yp(e,t,n,r){let s,o,a;typeof t=="function"&&typeof n!="function"?(o=void 0,a=t,s=n):(o=t,a=n,s=r),Pk(e,o,c,s);function c(d,f){const p=f[f.length-1],g=p?p.children.indexOf(d):void 0;return a(d,g,p)}}const Mf={}.hasOwnProperty,k5={};function S5(e,t){const n=t||k5,r=new Map,s=new Map,o=new Map,a={...a5,...n.handlers},c={all:f,applyData:E5,definitionById:r,footnoteById:s,footnoteCounts:o,footnoteOrder:[],handlers:a,one:d,options:n,patch:j5,wrap:N5};return Yp(e,function(p){if(p.type==="definition"||p.type==="footnoteDefinition"){const g=p.type==="definition"?r:s,y=String(p.identifier).toUpperCase();g.has(y)||g.set(y,p)}}),c;function d(p,g){const y=p.type,x=c.handlers[y];if(Mf.call(c.handlers,y)&&x)return x(c,p,g);if(c.options.passThrough&&c.options.passThrough.includes(y)){if("children"in p){const{children:w,...k}=p,S=Nc(k);return S.children=c.all(p),S}return Nc(p)}return(c.options.unknownHandler||C5)(c,p,g)}function f(p){const g=[];if("children"in p){const y=p.children;let x=-1;for(;++x<y.length;){const b=c.one(y[x],p);if(b){if(x&&y[x-1].type==="break"&&(!Array.isArray(b)&&b.type==="text"&&(b.value=J0(b.value)),!Array.isArray(b)&&b.type==="element")){const w=b.children[0];w&&w.type==="text"&&(w.value=J0(w.value))}Array.isArray(b)?g.push(...b):g.push(b)}}}return g}}function j5(e,t){e.position&&(t.position=fI(e))}function E5(e,t){let n=t;if(e&&e.data){const r=e.data.hName,s=e.data.hChildren,o=e.data.hProperties;if(typeof r=="string")if(n.type==="element")n.tagName=r;else{const a="children"in n?n.children:[n];n={type:"element",tagName:r,properties:{},children:a}}n.type==="element"&&o&&Object.assign(n.properties,Nc(o)),"children"in n&&n.children&&s!==null&&s!==void 0&&(n.children=s)}return n}function C5(e,t){const n=t.data||{},r="value"in t&&!(Mf.call(n,"hProperties")||Mf.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function N5(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
117
|
+
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
118
|
+
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
119
|
+
`}),n}function J0(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function X0(e,t){const n=S5(e,t),r=n.one(e,void 0),s=p5(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return s&&o.children.push({type:"text",value:`
|
|
120
|
+
`},s),o}function T5(e,t){return e&&"run"in e?async function(n,r){const s=X0(n,{file:r,...t});await e.run(s,r)}:function(n,r){return X0(n,{file:r,...e||t})}}function Y0(e){if(e)throw e}var Ah,Q0;function A5(){if(Q0)return Ah;Q0=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,s=function(f){return typeof Array.isArray=="function"?Array.isArray(f):t.call(f)==="[object Array]"},o=function(f){if(!f||t.call(f)!=="[object Object]")return!1;var p=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!p&&!g)return!1;var y;for(y in f);return typeof y>"u"||e.call(f,y)},a=function(f,p){n&&p.name==="__proto__"?n(f,p.name,{enumerable:!0,configurable:!0,value:p.newValue,writable:!0}):f[p.name]=p.newValue},c=function(f,p){if(p==="__proto__")if(e.call(f,p)){if(r)return r(f,p).value}else return;return f[p]};return Ah=function d(){var f,p,g,y,x,b,w=arguments[0],k=1,S=arguments.length,E=!1;for(typeof w=="boolean"&&(E=w,w=arguments[1]||{},k=2),(w==null||typeof w!="object"&&typeof w!="function")&&(w={});k<S;++k)if(f=arguments[k],f!=null)for(p in f)g=c(w,p),y=c(f,p),w!==y&&(E&&y&&(o(y)||(x=s(y)))?(x?(x=!1,b=g&&s(g)?g:[]):b=g&&o(g)?g:{},a(w,{name:p,newValue:d(E,b,y)})):typeof y<"u"&&a(w,{name:p,newValue:y}));return w},Ah}var R5=A5();const Rh=Ac(R5);function zf(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function P5(){const e=[],t={run:n,use:r};return t;function n(...s){let o=-1;const a=s.pop();if(typeof a!="function")throw new TypeError("Expected function as last argument, not "+a);c(null,...s);function c(d,...f){const p=e[++o];let g=-1;if(d){a(d);return}for(;++g<s.length;)(f[g]===null||f[g]===void 0)&&(f[g]=s[g]);s=f,p?O5(p,c)(...f):a(null,...f)}}function r(s){if(typeof s!="function")throw new TypeError("Expected `middelware` to be a function, not "+s);return e.push(s),t}}function O5(e,t){let n;return r;function r(...a){const c=e.length>a.length;let d;c&&a.push(s);try{d=e.apply(this,a)}catch(f){const p=f;if(c&&n)throw p;return s(p)}c||(d&&d.then&&typeof d.then=="function"?d.then(o,s):d instanceof Error?s(d):o(d))}function s(a,...c){n||(n=!0,t(a,...c))}function o(a){s(null,a)}}const or={basename:L5,dirname:I5,extname:D5,join:M5,sep:"/"};function L5(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');Pa(e);let n=0,r=-1,s=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else r<0&&(o=!0,r=s+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let a=-1,c=t.length-1;for(;s--;)if(e.codePointAt(s)===47){if(o){n=s+1;break}}else a<0&&(o=!0,a=s+1),c>-1&&(e.codePointAt(s)===t.codePointAt(c--)?c<0&&(r=s):(c=-1,r=a));return n===r?r=a:r<0&&(r=e.length),e.slice(n,r)}function I5(e){if(Pa(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function D5(e){Pa(e);let t=e.length,n=-1,r=0,s=-1,o=0,a;for(;t--;){const c=e.codePointAt(t);if(c===47){if(a){r=t+1;break}continue}n<0&&(a=!0,n=t+1),c===46?s<0?s=t:o!==1&&(o=1):s>-1&&(o=-1)}return s<0||n<0||o===0||o===1&&s===n-1&&s===r+1?"":e.slice(s,n)}function M5(...e){let t=-1,n;for(;++t<e.length;)Pa(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":z5(n)}function z5(e){Pa(e);const t=e.codePointAt(0)===47;let n=F5(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function F5(e,t){let n="",r=0,s=-1,o=0,a=-1,c,d;for(;++a<=e.length;){if(a<e.length)c=e.codePointAt(a);else{if(c===47)break;c=47}if(c===47){if(!(s===a-1||o===1))if(s!==a-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(d=n.lastIndexOf("/"),d!==n.length-1){d<0?(n="",r=0):(n=n.slice(0,d),r=n.length-1-n.lastIndexOf("/")),s=a,o=0;continue}}else if(n.length>0){n="",r=0,s=a,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(s+1,a):n=e.slice(s+1,a),r=a-s-1;s=a,o=0}else c===46&&o>-1?o++:o=-1}return n}function Pa(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const $5={cwd:U5};function U5(){return"/"}function Ff(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function B5(e){if(typeof e=="string")e=new URL(e);else if(!Ff(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return V5(e)}function V5(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const s=new TypeError("File URL path must not include encoded / characters");throw s.code="ERR_INVALID_FILE_URL_PATH",s}}return decodeURIComponent(t)}const Ph=["history","path","basename","stem","extname","dirname"];class Ok{constructor(t){let n;t?Ff(t)?n={path:t}:typeof t=="string"||q5(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":$5.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Ph.length;){const o=Ph[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let s;for(s in n)Ph.includes(s)||(this[s]=n[s])}get basename(){return typeof this.path=="string"?or.basename(this.path):void 0}set basename(t){Lh(t,"basename"),Oh(t,"basename"),this.path=or.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?or.dirname(this.path):void 0}set dirname(t){Z0(this.basename,"dirname"),this.path=or.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?or.extname(this.path):void 0}set extname(t){if(Oh(t,"extname"),Z0(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=or.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){Ff(t)&&(t=B5(t)),Lh(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?or.basename(this.path,this.extname):void 0}set stem(t){Lh(t,"stem"),Oh(t,"stem"),this.path=or.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const s=this.message(t,n,r);throw s.fatal=!0,s}info(t,n,r){const s=this.message(t,n,r);return s.fatal=void 0,s}message(t,n,r){const s=new en(t,n,r);return this.path&&(s.name=this.path+":"+s.name,s.file=this.path),s.fatal=!1,this.messages.push(s),s}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Oh(e,t){if(e&&e.includes(or.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+or.sep+"`")}function Lh(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function Z0(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function q5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const H5=(function(e){const r=this.constructor.prototype,s=r[e],o=function(){return s.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),K5={}.hasOwnProperty;class Qp extends H5{constructor(){super("copy"),this.Compiler=void 0,this.Parser=void 0,this.attachers=[],this.compiler=void 0,this.freezeIndex=-1,this.frozen=void 0,this.namespace={},this.parser=void 0,this.transformers=P5()}copy(){const t=new Qp;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Rh(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Mh("data",this.frozen),this.namespace[t]=n,this):K5.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Mh("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=this;for(;++this.freezeIndex<this.attachers.length;){const[n,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const s=n.call(t,...r);typeof s=="function"&&this.transformers.use(s)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Zl(t),r=this.parser||this.Parser;return Ih("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Ih("process",this.parser||this.Parser),Dh("process",this.compiler||this.Compiler),n?s(void 0,n):new Promise(s);function s(o,a){const c=Zl(t),d=r.parse(c);r.run(d,c,function(p,g,y){if(p||!g||!y)return f(p);const x=g,b=r.stringify(x,y);J5(b)?y.value=b:y.result=b,f(p,y)});function f(p,g){p||!g?a(p):o?o(g):n(void 0,g)}}}processSync(t){let n=!1,r;return this.freeze(),Ih("processSync",this.parser||this.Parser),Dh("processSync",this.compiler||this.Compiler),this.process(t,s),t_("processSync","process",n),r;function s(o,a){n=!0,Y0(o),r=a}}run(t,n,r){e_(t),this.freeze();const s=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(a,c){const d=Zl(n);s.run(t,d,f);function f(p,g,y){const x=g||t;p?c(p):a?a(x):r(void 0,x,y)}}}runSync(t,n){let r=!1,s;return this.run(t,n,o),t_("runSync","run",r),s;function o(a,c){Y0(a),s=c,r=!0}}stringify(t,n){this.freeze();const r=Zl(n),s=this.compiler||this.Compiler;return Dh("stringify",s),e_(t),s(t,r)}use(t,...n){const r=this.attachers,s=this.namespace;if(Mh("use",this.frozen),t!=null)if(typeof t=="function")d(t,n);else if(typeof t=="object")Array.isArray(t)?c(t):a(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(f){if(typeof f=="function")d(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[p,...g]=f;d(p,g)}else a(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function a(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");c(f.plugins),f.settings&&(s.settings=Rh(!0,s.settings,f.settings))}function c(f){let p=-1;if(f!=null)if(Array.isArray(f))for(;++p<f.length;){const g=f[p];o(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function d(f,p){let g=-1,y=-1;for(;++g<r.length;)if(r[g][0]===f){y=g;break}if(y===-1)r.push([f,...p]);else if(p.length>0){let[x,...b]=p;const w=r[y][1];zf(w)&&zf(x)&&(x=Rh(!0,w,x)),r[y]=[f,x,...b]}}}}const W5=new Qp().freeze();function Ih(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Dh(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Mh(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function e_(e){if(!zf(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function t_(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Zl(e){return G5(e)?e:new Ok(e)}function G5(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function J5(e){return typeof e=="string"||X5(e)}function X5(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const Y5="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",n_=[],r_={allowDangerousHtml:!0},Q5=/^(https?|ircs?|mailto|xmpp)$/i,Z5=[{from:"astPlugins",id:"remove-buggy-html-in-markdown-parser"},{from:"allowDangerousHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"allowNode",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowElement"},{from:"allowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"allowedElements"},{from:"className",id:"remove-classname"},{from:"disallowedTypes",id:"replace-allownode-allowedtypes-and-disallowedtypes",to:"disallowedElements"},{from:"escapeHtml",id:"remove-buggy-html-in-markdown-parser"},{from:"includeElementIndex",id:"#remove-includeelementindex"},{from:"includeNodeIndex",id:"change-includenodeindex-to-includeelementindex"},{from:"linkTarget",id:"remove-linktarget"},{from:"plugins",id:"change-plugins-to-remarkplugins",to:"remarkPlugins"},{from:"rawSourcePos",id:"#remove-rawsourcepos"},{from:"renderers",id:"change-renderers-to-components",to:"components"},{from:"source",id:"change-source-to-children",to:"children"},{from:"sourcePos",id:"#remove-sourcepos"},{from:"transformImageUri",id:"#add-urltransform",to:"urlTransform"},{from:"transformLinkUri",id:"#add-urltransform",to:"urlTransform"}];function Zp(e){const t=eM(e),n=tM(e);return nM(t.runSync(t.parse(n),n),e)}function eM(e){const t=e.rehypePlugins||n_,n=e.remarkPlugins||n_,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...r_}:r_;return W5().use(ID).use(n).use(T5,r).use(t)}function tM(e){const t=e.children||"",n=new Ok;return typeof t=="string"&&(n.value=t),n}function nM(e,t){const n=t.allowedElements,r=t.allowElement,s=t.components,o=t.disallowedElements,a=t.skipHtml,c=t.unwrapDisallowed,d=t.urlTransform||rM;for(const p of Z5)Object.hasOwn(t,p.from)&&(""+p.from+(p.to?"use `"+p.to+"` instead":"remove it")+Y5+p.id,void 0);return Yp(e,f),xI(e,{Fragment:u.Fragment,components:s,ignoreInvalidStyle:!0,jsx:u.jsx,jsxs:u.jsxs,passKeys:!0,passNode:!0});function f(p,g,y){if(p.type==="raw"&&y&&typeof g=="number")return a?y.children.splice(g,1):y.children[g]={type:"text",value:p.value},g;if(p.type==="element"){let x;for(x in Ch)if(Object.hasOwn(Ch,x)&&Object.hasOwn(p.properties,x)){const b=p.properties[x],w=Ch[x];(w===null||w.includes(p.tagName))&&(p.properties[x]=d(String(b||""),x,p))}}if(p.type==="element"){let x=n?!n.includes(p.tagName):o?o.includes(p.tagName):!1;if(!x&&r&&typeof g=="number"&&(x=!r(p,g,y)),x&&y&&typeof g=="number")return c&&p.children?y.children.splice(g,1,...p.children):y.children.splice(g,1),g}}}function rM(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),s=e.indexOf("/");return t===-1||s!==-1&&t>s||n!==-1&&t>n||r!==-1&&t>r||Q5.test(e.slice(0,t))?e:""}function s_(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,s=n.indexOf(t);for(;s!==-1;)r++,s=n.indexOf(t,s+t.length);return r}function sM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function iM(e,t,n){const s=eu((n||{}).ignore||[]),o=oM(t);let a=-1;for(;++a<o.length;)Pk(e,"text",c);function c(f,p){let g=-1,y;for(;++g<p.length;){const x=p[g],b=y?y.children:void 0;if(s(x,b?b.indexOf(x):void 0,y))return;y=x}if(y)return d(f,p)}function d(f,p){const g=p[p.length-1],y=o[a][0],x=o[a][1];let b=0;const k=g.children.indexOf(f);let S=!1,E=[];y.lastIndex=0;let j=y.exec(f.value);for(;j;){const O=j.index,N={index:j.index,input:j.input,stack:[...p,f]};let T=x(...j,N);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?y.lastIndex=O+1:(b!==O&&E.push({type:"text",value:f.value.slice(b,O)}),Array.isArray(T)?E.push(...T):T&&E.push(T),b=O+j[0].length,S=!0),!y.global)break;j=y.exec(f.value)}return S?(b<f.value.length&&E.push({type:"text",value:f.value.slice(b)}),g.children.splice(k,1,...E)):E=[f],k+E.length}}function oM(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const s=n[r];t.push([aM(s[0]),lM(s[1])])}return t}function aM(e){return typeof e=="string"?new RegExp(sM(e),"g"):e}function lM(e){return typeof e=="function"?e:function(){return e}}const zh="phrasing",Fh=["autolink","link","image","label"];function cM(){return{transforms:[gM],enter:{literalAutolink:dM,literalAutolinkEmail:$h,literalAutolinkHttp:$h,literalAutolinkWww:$h},exit:{literalAutolink:mM,literalAutolinkEmail:pM,literalAutolinkHttp:hM,literalAutolinkWww:fM}}}function uM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:zh,notInConstruct:Fh},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:zh,notInConstruct:Fh},{character:":",before:"[ps]",after:"\\/",inConstruct:zh,notInConstruct:Fh}]}}function dM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function $h(e){this.config.enter.autolinkProtocol.call(this,e)}function hM(e){this.config.exit.autolinkProtocol.call(this,e)}function fM(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function pM(e){this.config.exit.autolinkEmail.call(this,e)}function mM(e){this.exit(e)}function gM(e){iM(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,yM],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),xM]],{ignore:["link","linkReference"]})}function yM(e,t,n,r,s){let o="";if(!Lk(s)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!vM(n)))return!1;const a=_M(n+r);if(!a[0])return!1;const c={type:"link",title:null,url:o+t+a[0],children:[{type:"text",value:t+a[0]}]};return a[1]?[c,{type:"text",value:a[1]}]:c}function xM(e,t,n,r){return!Lk(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function vM(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function _M(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const s=s_(e,"(");let o=s_(e,")");for(;r!==-1&&s>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function Lk(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||Fs(n)||Yc(n))&&(!t||n!==47)}Ik.peek=TM;function bM(){this.buffer()}function wM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function kM(){this.buffer()}function SM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function jM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function EM(e){this.exit(e)}function CM(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=Qn(this.sliceSerialize(e)).toLowerCase(),n.label=t}function NM(e){this.exit(e)}function TM(){return"["}function Ik(e,t,n,r){const s=n.createTracker(r);let o=s.move("[^");const a=n.enter("footnoteReference"),c=n.enter("reference");return o+=s.move(n.safe(n.associationId(e),{after:"]",before:o})),c(),a(),o+=s.move("]"),o}function AM(){return{enter:{gfmFootnoteCallString:bM,gfmFootnoteCall:wM,gfmFootnoteDefinitionLabelString:kM,gfmFootnoteDefinition:SM},exit:{gfmFootnoteCallString:jM,gfmFootnoteCall:EM,gfmFootnoteDefinitionLabelString:CM,gfmFootnoteDefinition:NM}}}function RM(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:Ik},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,s,o,a){const c=o.createTracker(a);let d=c.move("[^");const f=o.enter("footnoteDefinition"),p=o.enter("label");return d+=c.move(o.safe(o.associationId(r),{before:d,after:"]"})),p(),d+=c.move("]:"),r.children&&r.children.length>0&&(c.shift(4),d+=c.move((t?`
|
|
121
|
+
`:" ")+o.indentLines(o.containerFlow(r,c.current()),t?Dk:PM))),f(),d}}function PM(e,t,n){return t===0?e:Dk(e,t,n)}function Dk(e,t,n){return(n?"":" ")+e}const OM=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Mk.peek=zM;function LM(){return{canContainEols:["delete"],enter:{strikethrough:DM},exit:{strikethrough:MM}}}function IM(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:OM}],handlers:{delete:Mk}}}function DM(e){this.enter({type:"delete",children:[]},e)}function MM(e){this.exit(e)}function Mk(e,t,n,r){const s=n.createTracker(r),o=n.enter("strikethrough");let a=s.move("~~");return a+=n.containerPhrasing(e,{...s.current(),before:a,after:"~"}),a+=s.move("~~"),o(),a}function zM(){return"~"}function FM(e){return e.length}function $M(e,t){const n=t||{},r=(n.align||[]).concat(),s=n.stringLength||FM,o=[],a=[],c=[],d=[];let f=0,p=-1;for(;++p<e.length;){const w=[],k=[];let S=-1;for(e[p].length>f&&(f=e[p].length);++S<e[p].length;){const E=UM(e[p][S]);if(n.alignDelimiters!==!1){const j=s(E);k[S]=j,(d[S]===void 0||j>d[S])&&(d[S]=j)}w.push(E)}a[p]=w,c[p]=k}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)o[g]=i_(r[g]);else{const w=i_(r);for(;++g<f;)o[g]=w}g=-1;const y=[],x=[];for(;++g<f;){const w=o[g];let k="",S="";w===99?(k=":",S=":"):w===108?k=":":w===114&&(S=":");let E=n.alignDelimiters===!1?1:Math.max(1,d[g]-k.length-S.length);const j=k+"-".repeat(E)+S;n.alignDelimiters!==!1&&(E=k.length+E+S.length,E>d[g]&&(d[g]=E),x[g]=E),y[g]=j}a.splice(1,0,y),c.splice(1,0,x),p=-1;const b=[];for(;++p<a.length;){const w=a[p],k=c[p];g=-1;const S=[];for(;++g<f;){const E=w[g]||"";let j="",O="";if(n.alignDelimiters!==!1){const N=d[g]-(k[g]||0),T=o[g];T===114?j=" ".repeat(N):T===99?N%2?(j=" ".repeat(N/2+.5),O=" ".repeat(N/2-.5)):(j=" ".repeat(N/2),O=j):O=" ".repeat(N)}n.delimiterStart!==!1&&!g&&S.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&E==="")&&(n.delimiterStart!==!1||g)&&S.push(" "),n.alignDelimiters!==!1&&S.push(j),S.push(E),n.alignDelimiters!==!1&&S.push(O),n.padding!==!1&&S.push(" "),(n.delimiterEnd!==!1||g!==f-1)&&S.push("|")}b.push(n.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return b.join(`
|
|
122
|
+
`)}function UM(e){return e==null?"":String(e)}function i_(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function BM(e,t,n,r){const s=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const a=n.indentLines(n.containerFlow(e,o.current()),VM);return s(),a}function VM(e,t,n){return">"+(n?"":" ")+e}function qM(e,t){return o_(e,t.inConstruct,!0)&&!o_(e,t.notInConstruct,!1)}function o_(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function a_(e,t,n,r){let s=-1;for(;++s<n.unsafe.length;)if(n.unsafe[s].character===`
|
|
123
|
+
`&&qM(n.stack,n.unsafe[s]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
124
|
+
`}function HM(e,t){const n=String(e);let r=n.indexOf(t),s=r,o=0,a=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===s?++o>a&&(a=o):o=1,s=r+t.length,r=n.indexOf(t,s);return a}function KM(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function WM(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function GM(e,t,n,r){const s=WM(n),o=e.value||"",a=s==="`"?"GraveAccent":"Tilde";if(KM(e,n)){const g=n.enter("codeIndented"),y=n.indentLines(o,JM);return g(),y}const c=n.createTracker(r),d=s.repeat(Math.max(HM(o,s)+1,3)),f=n.enter("codeFenced");let p=c.move(d);if(e.lang){const g=n.enter(`codeFencedLang${a}`);p+=c.move(n.safe(e.lang,{before:p,after:" ",encode:["`"],...c.current()})),g()}if(e.lang&&e.meta){const g=n.enter(`codeFencedMeta${a}`);p+=c.move(" "),p+=c.move(n.safe(e.meta,{before:p,after:`
|
|
125
|
+
`,encode:["`"],...c.current()})),g()}return p+=c.move(`
|
|
126
|
+
`),o&&(p+=c.move(o+`
|
|
127
|
+
`)),p+=c.move(d),f(),p}function JM(e,t,n){return(n?"":" ")+e}function em(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function XM(e,t,n,r){const s=em(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("definition");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("[");return f+=d.move(n.safe(n.associationId(e),{before:f,after:"]",...d.current()})),f+=d.move("]: "),c(),!e.url||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":`
|
|
128
|
+
`,...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),a(),f}function YM(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function _a(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Tc(e,t,n){const r=qi(e),s=qi(t);return r===void 0?s===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:s===void 0?{inside:!1,outside:!1}:s===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}zk.peek=QM;function zk(e,t,n,r){const s=YM(n),o=n.enter("emphasis"),a=n.createTracker(r),c=a.move(s);let d=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const f=d.charCodeAt(0),p=Tc(r.before.charCodeAt(r.before.length-1),f,s);p.inside&&(d=_a(f)+d.slice(1));const g=d.charCodeAt(d.length-1),y=Tc(r.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+_a(g));const x=a.move(s);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+x}function QM(e,t,n){return n.options.emphasis||"*"}function ZM(e,t){let n=!1;return Yp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,Df}),!!((!e.depth||e.depth<3)&&qp(e)&&(t.options.setext||n))}function e3(e,t,n,r){const s=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(ZM(e,n)){const p=n.enter("headingSetext"),g=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
|
|
129
|
+
`,after:`
|
|
130
|
+
`});return g(),p(),y+`
|
|
131
|
+
`+(s===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
132
|
+
`))+1))}const a="#".repeat(s),c=n.enter("headingAtx"),d=n.enter("phrasing");o.move(a+" ");let f=n.containerPhrasing(e,{before:"# ",after:`
|
|
133
|
+
`,...o.current()});return/^[\t ]/.test(f)&&(f=_a(f.charCodeAt(0))+f.slice(1)),f=f?a+" "+f:a,n.options.closeAtx&&(f+=" "+a),d(),c(),f}Fk.peek=t3;function Fk(e){return e.value||""}function t3(){return"<"}$k.peek=n3;function $k(e,t,n,r){const s=em(n),o=s==='"'?"Quote":"Apostrophe",a=n.enter("image");let c=n.enter("label");const d=n.createTracker(r);let f=d.move("![");return f+=d.move(n.safe(e.alt,{before:f,after:"]",...d.current()})),f+=d.move("]("),c(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(c=n.enter("destinationLiteral"),f+=d.move("<"),f+=d.move(n.safe(e.url,{before:f,after:">",...d.current()})),f+=d.move(">")):(c=n.enter("destinationRaw"),f+=d.move(n.safe(e.url,{before:f,after:e.title?" ":")",...d.current()}))),c(),e.title&&(c=n.enter(`title${o}`),f+=d.move(" "+s),f+=d.move(n.safe(e.title,{before:f,after:s,...d.current()})),f+=d.move(s),c()),f+=d.move(")"),a(),f}function n3(){return"!"}Uk.peek=r3;function Uk(e,t,n,r){const s=e.referenceType,o=n.enter("imageReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("![");const f=n.safe(e.alt,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=p,o(),s==="full"||!f||f!==g?d+=c.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function r3(){return"!"}Bk.peek=s3;function Bk(e,t,n){let r=e.value||"",s="`",o=-1;for(;new RegExp("(^|[^`])"+s+"([^`]|$)").test(r);)s+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const a=n.unsafe[o],c=n.compilePattern(a);let d;if(a.atBreak)for(;d=c.exec(r);){let f=d.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(d.index+1)}}return s+r+s}function s3(){return"`"}function Vk(e,t){const n=qp(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}qk.peek=i3;function qk(e,t,n,r){const s=em(n),o=s==='"'?"Quote":"Apostrophe",a=n.createTracker(r);let c,d;if(Vk(e,n)){const p=n.stack;n.stack=[],c=n.enter("autolink");let g=a.move("<");return g+=a.move(n.containerPhrasing(e,{before:g,after:">",...a.current()})),g+=a.move(">"),c(),n.stack=p,g}c=n.enter("link"),d=n.enter("label");let f=a.move("[");return f+=a.move(n.containerPhrasing(e,{before:f,after:"](",...a.current()})),f+=a.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),f+=a.move("<"),f+=a.move(n.safe(e.url,{before:f,after:">",...a.current()})),f+=a.move(">")):(d=n.enter("destinationRaw"),f+=a.move(n.safe(e.url,{before:f,after:e.title?" ":")",...a.current()}))),d(),e.title&&(d=n.enter(`title${o}`),f+=a.move(" "+s),f+=a.move(n.safe(e.title,{before:f,after:s,...a.current()})),f+=a.move(s),d()),f+=a.move(")"),c(),f}function i3(e,t,n){return Vk(e,n)?"<":"["}Hk.peek=o3;function Hk(e,t,n,r){const s=e.referenceType,o=n.enter("linkReference");let a=n.enter("label");const c=n.createTracker(r);let d=c.move("[");const f=n.containerPhrasing(e,{before:d,after:"]",...c.current()});d+=c.move(f+"]["),a();const p=n.stack;n.stack=[],a=n.enter("reference");const g=n.safe(n.associationId(e),{before:d,after:"]",...c.current()});return a(),n.stack=p,o(),s==="full"||!f||f!==g?d+=c.move(g+"]"):s==="shortcut"?d=d.slice(0,-1):d+=c.move("]"),d}function o3(){return"["}function tm(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function a3(e){const t=tm(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function l3(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Kk(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function c3(e,t,n,r){const s=n.enter("list"),o=n.bulletCurrent;let a=e.ordered?l3(n):tm(n);const c=e.ordered?a==="."?")":".":a3(n);let d=t&&n.bulletLastUsed?a===n.bulletLastUsed:!1;if(!e.ordered){const p=e.children?e.children[0]:void 0;if((a==="*"||a==="-")&&p&&(!p.children||!p.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(d=!0),Kk(n)===a&&p){let g=-1;for(;++g<e.children.length;){const y=e.children[g];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){d=!0;break}}}}d&&(a=c),n.bulletCurrent=a;const f=n.containerFlow(e,r);return n.bulletLastUsed=a,n.bulletCurrent=o,s(),f}function u3(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function d3(e,t,n,r){const s=u3(n);let o=n.bulletCurrent||tm(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let a=o.length+1;(s==="tab"||s==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(a=Math.ceil(a/4)*4);const c=n.createTracker(r);c.move(o+" ".repeat(a-o.length)),c.shift(a);const d=n.enter("listItem"),f=n.indentLines(n.containerFlow(e,c.current()),p);return d(),f;function p(g,y,x){return y?(x?"":" ".repeat(a))+g:(x?o:o+" ".repeat(a-o.length))+g}}function h3(e,t,n,r){const s=n.enter("paragraph"),o=n.enter("phrasing"),a=n.containerPhrasing(e,r);return o(),s(),a}const f3=eu(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function p3(e,t,n,r){return(e.children.some(function(a){return f3(a)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function m3(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}Wk.peek=g3;function Wk(e,t,n,r){const s=m3(n),o=n.enter("strong"),a=n.createTracker(r),c=a.move(s+s);let d=a.move(n.containerPhrasing(e,{after:s,before:c,...a.current()}));const f=d.charCodeAt(0),p=Tc(r.before.charCodeAt(r.before.length-1),f,s);p.inside&&(d=_a(f)+d.slice(1));const g=d.charCodeAt(d.length-1),y=Tc(r.after.charCodeAt(0),g,s);y.inside&&(d=d.slice(0,-1)+_a(g));const x=a.move(s+s);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:p.outside},c+d+x}function g3(e,t,n){return n.options.strong||"*"}function y3(e,t,n,r){return n.safe(e.value,r)}function x3(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function v3(e,t,n){const r=(Kk(n)+(n.options.ruleSpaces?" ":"")).repeat(x3(n));return n.options.ruleSpaces?r.slice(0,-1):r}const Gk={blockquote:BM,break:a_,code:GM,definition:XM,emphasis:zk,hardBreak:a_,heading:e3,html:Fk,image:$k,imageReference:Uk,inlineCode:Bk,link:qk,linkReference:Hk,list:c3,listItem:d3,paragraph:h3,root:p3,strong:Wk,text:y3,thematicBreak:v3};function _3(){return{enter:{table:b3,tableData:l_,tableHeader:l_,tableRow:k3},exit:{codeText:S3,table:w3,tableData:Uh,tableHeader:Uh,tableRow:Uh}}}function b3(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function w3(e){this.exit(e),this.data.inTable=void 0}function k3(e){this.enter({type:"tableRow",children:[]},e)}function Uh(e){this.exit(e)}function l_(e){this.enter({type:"tableCell",children:[]},e)}function S3(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,j3));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function j3(e,t){return t==="|"?t:e}function E3(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,s=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
134
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:a,tableCell:d,tableRow:c}};function a(x,b,w,k){return f(p(x,w,k),x.align)}function c(x,b,w,k){const S=g(x,w,k),E=f([S]);return E.slice(0,E.indexOf(`
|
|
135
|
+
`))}function d(x,b,w,k){const S=w.enter("tableCell"),E=w.enter("phrasing"),j=w.containerPhrasing(x,{...k,before:o,after:o});return E(),S(),j}function f(x,b){return $M(x,{align:b,alignDelimiters:r,padding:n,stringLength:s})}function p(x,b,w){const k=x.children;let S=-1;const E=[],j=b.enter("table");for(;++S<k.length;)E[S]=g(k[S],b,w);return j(),E}function g(x,b,w){const k=x.children;let S=-1;const E=[],j=b.enter("tableRow");for(;++S<k.length;)E[S]=d(k[S],x,b,w);return j(),E}function y(x,b,w){let k=Gk.inlineCode(x,b,w);return w.stack.includes("tableCell")&&(k=k.replace(/\|/g,"\\$&")),k}}function C3(){return{exit:{taskListCheckValueChecked:c_,taskListCheckValueUnchecked:c_,paragraph:T3}}}function N3(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:A3}}}function c_(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function T3(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const s=t.children;let o=-1,a;for(;++o<s.length;){const c=s[o];if(c.type==="paragraph"){a=c;break}}a===n&&(r.value=r.value.slice(1),r.value.length===0?n.children.shift():n.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,n.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function A3(e,t,n,r){const s=e.children[0],o=typeof e.checked=="boolean"&&s&&s.type==="paragraph",a="["+(e.checked?"x":" ")+"] ",c=n.createTracker(r);o&&c.move(a);let d=Gk.listItem(e,t,n,{...r,...c.current()});return o&&(d=d.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),d;function f(p){return p+a}}function R3(){return[cM(),AM(),LM(),_3(),C3()]}function P3(e){return{extensions:[uM(),RM(e),IM(),E3(e),N3()]}}const O3={tokenize:F3,partial:!0},Jk={tokenize:$3,partial:!0},Xk={tokenize:U3,partial:!0},Yk={tokenize:B3,partial:!0},L3={tokenize:V3,partial:!0},Qk={name:"wwwAutolink",tokenize:M3,previous:e1},Zk={name:"protocolAutolink",tokenize:z3,previous:t1},Nr={name:"emailAutolink",tokenize:D3,previous:n1},dr={};function I3(){return{text:dr}}let ws=48;for(;ws<123;)dr[ws]=Nr,ws++,ws===58?ws=65:ws===91&&(ws=97);dr[43]=Nr;dr[45]=Nr;dr[46]=Nr;dr[95]=Nr;dr[72]=[Nr,Zk];dr[104]=[Nr,Zk];dr[87]=[Nr,Qk];dr[119]=[Nr,Qk];function D3(e,t,n){const r=this;let s,o;return a;function a(g){return!$f(g)||!n1.call(r,r.previous)||nm(r.events)?n(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),c(g))}function c(g){return $f(g)?(e.consume(g),c):g===64?(e.consume(g),d):n(g)}function d(g){return g===46?e.check(L3,p,f)(g):g===45||g===95||Zt(g)?(o=!0,e.consume(g),d):p(g)}function f(g){return e.consume(g),s=!0,d}function p(g){return o&&s&&on(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(g)):n(g)}}function M3(e,t,n){const r=this;return s;function s(a){return a!==87&&a!==119||!e1.call(r,r.previous)||nm(r.events)?n(a):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(O3,e.attempt(Jk,e.attempt(Xk,o),n),n)(a))}function o(a){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(a)}}function z3(e,t,n){const r=this;let s="",o=!1;return a;function a(g){return(g===72||g===104)&&t1.call(r,r.previous)&&!nm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),s+=String.fromCodePoint(g),e.consume(g),c):n(g)}function c(g){if(on(g)&&s.length<5)return s+=String.fromCodePoint(g),e.consume(g),c;if(g===58){const y=s.toLowerCase();if(y==="http"||y==="https")return e.consume(g),d}return n(g)}function d(g){return g===47?(e.consume(g),o?f:(o=!0,d)):n(g)}function f(g){return g===null||Ec(g)||at(g)||Fs(g)||Yc(g)?n(g):e.attempt(Jk,e.attempt(Xk,p),n)(g)}function p(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(g)}}function F3(e,t,n){let r=0;return s;function s(a){return(a===87||a===119)&&r<3?(r++,e.consume(a),s):a===46&&r===3?(e.consume(a),o):n(a)}function o(a){return a===null?n(a):t(a)}}function $3(e,t,n){let r,s,o;return a;function a(f){return f===46||f===95?e.check(Yk,d,c)(f):f===null||at(f)||Fs(f)||f!==45&&Yc(f)?d(f):(o=!0,e.consume(f),a)}function c(f){return f===95?r=!0:(s=r,r=void 0),e.consume(f),a}function d(f){return s||r||!o?n(f):t(f)}}function U3(e,t){let n=0,r=0;return s;function s(a){return a===40?(n++,e.consume(a),s):a===41&&r<n?o(a):a===33||a===34||a===38||a===39||a===41||a===42||a===44||a===46||a===58||a===59||a===60||a===63||a===93||a===95||a===126?e.check(Yk,t,o)(a):a===null||at(a)||Fs(a)?t(a):(e.consume(a),s)}function o(a){return a===41&&r++,e.consume(a),s}}function B3(e,t,n){return r;function r(c){return c===33||c===34||c===39||c===41||c===42||c===44||c===46||c===58||c===59||c===63||c===95||c===126?(e.consume(c),r):c===38?(e.consume(c),o):c===93?(e.consume(c),s):c===60||c===null||at(c)||Fs(c)?t(c):n(c)}function s(c){return c===null||c===40||c===91||at(c)||Fs(c)?t(c):r(c)}function o(c){return on(c)?a(c):n(c)}function a(c){return c===59?(e.consume(c),r):on(c)?(e.consume(c),a):n(c)}}function V3(e,t,n){return r;function r(o){return e.consume(o),s}function s(o){return Zt(o)?n(o):t(o)}}function e1(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||at(e)}function t1(e){return!on(e)}function n1(e){return!(e===47||$f(e))}function $f(e){return e===43||e===45||e===46||e===95||Zt(e)}function nm(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const q3={tokenize:Q3,partial:!0};function H3(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:J3,continuation:{tokenize:X3},exit:Y3}},text:{91:{name:"gfmFootnoteCall",tokenize:G3},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:K3,resolveTo:W3}}}}function K3(e,t,n){const r=this;let s=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let a;for(;s--;){const d=r.events[s][1];if(d.type==="labelImage"){a=d;break}if(d.type==="gfmFootnoteCall"||d.type==="labelLink"||d.type==="label"||d.type==="image"||d.type==="link")break}return c;function c(d){if(!a||!a._balanced)return n(d);const f=Qn(r.sliceSerialize({start:a.end,end:r.now()}));return f.codePointAt(0)!==94||!o.includes(f.slice(1))?n(d):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(d),e.exit("gfmFootnoteCallLabelMarker"),t(d))}}function W3(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},s={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};s.end.column++,s.end.offset++,s.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},s.end),end:Object.assign({},e[e.length-1][1].start)},a={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},c=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",s,t],["exit",s,t],["enter",o,t],["enter",a,t],["exit",a,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...c),e}function G3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,a;return c;function c(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),d}function d(g){return g!==94?n(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(g){if(o>999||g===93&&!a||g===null||g===91||at(g))return n(g);if(g===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return s.includes(Qn(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(g)}return at(g)||(a=!0),o++,e.consume(g),g===92?p:f}function p(g){return g===91||g===92||g===93?(e.consume(g),o++,f):f(g)}}function J3(e,t,n){const r=this,s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,a=0,c;return d;function d(b){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(b){return b===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",p):n(b)}function p(b){if(a>999||b===93&&!c||b===null||b===91||at(b))return n(b);if(b===93){e.exit("chunkString");const w=e.exit("gfmFootnoteDefinitionLabelString");return o=Qn(r.sliceSerialize(w)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(b),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return at(b)||(c=!0),a++,e.consume(b),b===92?g:p}function g(b){return b===91||b===92||b===93?(e.consume(b),a++,p):p(b)}function y(b){return b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),s.includes(o)||s.push(o),Qe(e,x,"gfmFootnoteDefinitionWhitespace")):n(b)}function x(b){return t(b)}}function X3(e,t,n){return e.check(Ra,t,e.attempt(q3,t,n))}function Y3(e){e.exit("gfmFootnoteDefinition")}function Q3(e,t,n){const r=this;return Qe(e,s,"gfmFootnoteDefinitionIndent",5);function s(o){const a=r.events[r.events.length-1];return a&&a[1].type==="gfmFootnoteDefinitionIndent"&&a[2].sliceSerialize(a[1],!0).length===4?t(o):n(o)}}function Z3(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:s};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function s(a,c){let d=-1;for(;++d<a.length;)if(a[d][0]==="enter"&&a[d][1].type==="strikethroughSequenceTemporary"&&a[d][1]._close){let f=d;for(;f--;)if(a[f][0]==="exit"&&a[f][1].type==="strikethroughSequenceTemporary"&&a[f][1]._open&&a[d][1].end.offset-a[d][1].start.offset===a[f][1].end.offset-a[f][1].start.offset){a[d][1].type="strikethroughSequence",a[f][1].type="strikethroughSequence";const p={type:"strikethrough",start:Object.assign({},a[f][1].start),end:Object.assign({},a[d][1].end)},g={type:"strikethroughText",start:Object.assign({},a[f][1].end),end:Object.assign({},a[d][1].start)},y=[["enter",p,c],["enter",a[f][1],c],["exit",a[f][1],c],["enter",g,c]],x=c.parser.constructs.insideSpan.null;x&&An(y,y.length,0,Qc(x,a.slice(f+1,d),c)),An(y,y.length,0,[["exit",g,c],["enter",a[d][1],c],["exit",a[d][1],c],["exit",p,c]]),An(a,f-1,d-f+3,y),d=f+y.length-2;break}}for(d=-1;++d<a.length;)a[d][1].type==="strikethroughSequenceTemporary"&&(a[d][1].type="data");return a}function o(a,c,d){const f=this.previous,p=this.events;let g=0;return y;function y(b){return f===126&&p[p.length-1][1].type!=="characterEscape"?d(b):(a.enter("strikethroughSequenceTemporary"),x(b))}function x(b){const w=qi(f);if(b===126)return g>1?d(b):(a.consume(b),g++,x);if(g<2&&!n)return d(b);const k=a.exit("strikethroughSequenceTemporary"),S=qi(b);return k._open=!S||S===2&&!!w,k._close=!w||w===2&&!!S,c(b)}}}class ez{constructor(){this.map=[]}add(t,n,r){tz(this,t,n,r)}consume(t){if(this.map.sort(function(o,a){return o[0]-a[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let s=r.pop();for(;s;){for(const o of s)t.push(o);s=r.pop()}this.map.length=0}}function tz(e,t,n,r){let s=0;if(!(n===0&&r.length===0)){for(;s<e.map.length;){if(e.map[s][0]===t){e.map[s][1]+=n,e.map[s][2].push(...r);return}s+=1}e.map.push([t,n,r])}}function nz(e,t){let n=!1;const r=[];for(;t<e.length;){const s=e[t];if(n){if(s[0]==="enter")s[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(s[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(s[1].type==="tableDelimiterRow")break}else s[0]==="enter"&&s[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function rz(){return{flow:{null:{name:"table",tokenize:sz,resolveAll:iz}}}}function sz(e,t,n){const r=this;let s=0,o=0,a;return c;function c(D){let Z=r.events.length-1;for(;Z>-1;){const G=r.events[Z][1].type;if(G==="lineEnding"||G==="linePrefix")Z--;else break}const Y=Z>-1?r.events[Z][1].type:null,he=Y==="tableHead"||Y==="tableRow"?T:d;return he===T&&r.parser.lazy[r.now().line]?n(D):he(D)}function d(D){return e.enter("tableHead"),e.enter("tableRow"),f(D)}function f(D){return D===124||(a=!0,o+=1),p(D)}function p(D){return D===null?n(D):Oe(D)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),x):n(D):Xe(D)?Qe(e,p,"whitespace")(D):(o+=1,a&&(a=!1,s+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),a=!0,p):(e.enter("data"),g(D)))}function g(D){return D===null||D===124||at(D)?(e.exit("data"),p(D)):(e.consume(D),D===92?y:g)}function y(D){return D===92||D===124?(e.consume(D),g):g(D)}function x(D){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(D):(e.enter("tableDelimiterRow"),a=!1,Xe(D)?Qe(e,b,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):b(D))}function b(D){return D===45||D===58?k(D):D===124?(a=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),w):N(D)}function w(D){return Xe(D)?Qe(e,k,"whitespace")(D):k(D)}function k(D){return D===58?(o+=1,a=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),S):D===45?(o+=1,S(D)):D===null||Oe(D)?O(D):N(D)}function S(D){return D===45?(e.enter("tableDelimiterFiller"),E(D)):N(D)}function E(D){return D===45?(e.consume(D),E):D===58?(a=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),j):(e.exit("tableDelimiterFiller"),j(D))}function j(D){return Xe(D)?Qe(e,O,"whitespace")(D):O(D)}function O(D){return D===124?b(D):D===null||Oe(D)?!a||s!==o?N(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(D)):N(D)}function N(D){return n(D)}function T(D){return e.enter("tableRow"),I(D)}function I(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),I):D===null||Oe(D)?(e.exit("tableRow"),t(D)):Xe(D)?Qe(e,I,"whitespace")(D):(e.enter("data"),V(D))}function V(D){return D===null||D===124||at(D)?(e.exit("data"),I(D)):(e.consume(D),D===92?U:V)}function U(D){return D===92||D===124?(e.consume(D),V):V(D)}}function iz(e,t){let n=-1,r=!0,s=0,o=[0,0,0,0],a=[0,0,0,0],c=!1,d=0,f,p,g;const y=new ez;for(;++n<e.length;){const x=e[n],b=x[1];x[0]==="enter"?b.type==="tableHead"?(c=!1,d!==0&&(u_(y,t,d,f,p),p=void 0,d=0),f={type:"table",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",f,t]])):b.type==="tableRow"||b.type==="tableDelimiterRow"?(r=!0,g=void 0,o=[0,0,0,0],a=[0,n+1,0,0],c&&(c=!1,p={type:"tableBody",start:Object.assign({},b.start),end:Object.assign({},b.end)},y.add(n,0,[["enter",p,t]])),s=b.type==="tableDelimiterRow"?2:p?3:1):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")?(r=!1,a[2]===0&&(o[1]!==0&&(a[0]=a[1],g=ec(y,t,o,s,void 0,g),o=[0,0,0,0]),a[2]=n)):b.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(a[0]=a[1],g=ec(y,t,o,s,void 0,g)),o=a,a=[o[1],n,0,0])):b.type==="tableHead"?(c=!0,d=n):b.type==="tableRow"||b.type==="tableDelimiterRow"?(d=n,o[1]!==0?(a[0]=a[1],g=ec(y,t,o,s,n,g)):a[1]!==0&&(g=ec(y,t,a,s,n,g)),s=0):s&&(b.type==="data"||b.type==="tableDelimiterMarker"||b.type==="tableDelimiterFiller")&&(a[3]=n)}for(d!==0&&u_(y,t,d,f,p),y.consume(t.events),n=-1;++n<t.events.length;){const x=t.events[n];x[0]==="enter"&&x[1].type==="table"&&(x[1]._align=nz(t.events,n))}return e}function ec(e,t,n,r,s,o){const a=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",c="tableContent";n[0]!==0&&(o.end=Object.assign({},Ci(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const d=Ci(t.events,n[1]);if(o={type:a,start:Object.assign({},d),end:Object.assign({},d)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const f=Ci(t.events,n[2]),p=Ci(t.events,n[3]),g={type:c,start:Object.assign({},f),end:Object.assign({},p)};if(e.add(n[2],0,[["enter",g,t]]),r!==2){const y=t.events[n[2]],x=t.events[n[3]];if(y[1].end=Object.assign({},x[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const b=n[2]+1,w=n[3]-n[2]-1;e.add(b,w,[])}}e.add(n[3]+1,0,[["exit",g,t]])}return s!==void 0&&(o.end=Object.assign({},Ci(t.events,s)),e.add(s,0,[["exit",o,t]]),o=void 0),o}function u_(e,t,n,r,s){const o=[],a=Ci(t.events,n);s&&(s.end=Object.assign({},a),o.push(["exit",s,t])),r.end=Object.assign({},a),o.push(["exit",r,t]),e.add(n+1,0,o)}function Ci(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const oz={name:"tasklistCheck",tokenize:lz};function az(){return{text:{91:oz}}}function lz(e,t,n){const r=this;return s;function s(d){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(d):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),o)}function o(d){return at(d)?(e.enter("taskListCheckValueUnchecked"),e.consume(d),e.exit("taskListCheckValueUnchecked"),a):d===88||d===120?(e.enter("taskListCheckValueChecked"),e.consume(d),e.exit("taskListCheckValueChecked"),a):n(d)}function a(d){return d===93?(e.enter("taskListCheckMarker"),e.consume(d),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),c):n(d)}function c(d){return Oe(d)?t(d):Xe(d)?e.check({tokenize:cz},t,n)(d):n(d)}}function cz(e,t,n){return Qe(e,r,"whitespace");function r(s){return s===null?n(s):t(s)}}function uz(e){return fk([I3(),H3(),Z3(e),rz(),az()])}const dz={};function hz(e){const t=this,n=e||dz,r=t.data(),s=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),a=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);s.push(uz(n)),o.push(R3()),a.push(P3(n))}function fz({message:e}){const{t}=Ze(),n=e.role==="user",r={p:({node:s,...o})=>u.jsx("p",{className:"mb-2 last:mb-0",...o}),a:({node:s,...o})=>u.jsx("a",{className:"text-primary hover:underline",...o}),ul:({node:s,...o})=>u.jsx("ul",{className:"list-disc ml-4 mb-2",...o}),ol:({node:s,...o})=>u.jsx("ol",{className:"list-decimal ml-4 mb-2",...o}),blockquote:({node:s,...o})=>u.jsx("blockquote",{className:"border-l-2 border-border/50 pl-3 text-fg/70 italic mb-2",...o}),table:({node:s,...o})=>u.jsx("table",{className:"w-full text-xs border-collapse my-2",...o}),th:({node:s,...o})=>u.jsx("th",{className:"border border-border/20 bg-surface/50 px-2 py-1 text-left font-semibold",...o}),td:({node:s,...o})=>u.jsx("td",{className:"border border-border/20 px-2 py-1 align-top",...o}),code:({node:s,inline:o,className:a,...c})=>u.jsx("code",{className:o?"bg-black/20 rounded px-1 py-0.5 font-mono text-xs":"block bg-black/30 rounded-lg p-3 font-mono text-xs leading-relaxed overflow-x-auto",...c}),pre:({node:s,...o})=>u.jsx("pre",{className:"my-2",...o})};return u.jsx("div",{className:`flex w-full ${n?"justify-end":"justify-start"}`,children:u.jsxs("div",{className:`flex gap-3 max-w-[85%] ${n?"flex-row-reverse":"flex-row"}`,children:[u.jsx("div",{className:`w-8 h-8 rounded-full flex items-center justify-center shrink-0 ${n?"bg-primary text-white":"bg-gradient-to-br from-indigo-500 to-purple-600 text-white shadow-lg glow-primary"}`,children:n?u.jsx(Oc,{size:16}):u.jsx(pj,{size:16})}),u.jsxs("div",{className:`flex flex-col ${n?"items-end":"items-start"}`,children:[u.jsx("div",{className:`px-5 py-3.5 rounded-2xl text-sm leading-relaxed shadow-sm ${n?"bg-primary/15 text-fg rounded-tr-none":"bg-surface/70 backdrop-blur-md text-fg rounded-tl-none"}`,children:u.jsx("div",{className:"markdown-body",children:u.jsx(Zp,{remarkPlugins:[hz],components:r,children:e.content})})}),u.jsx("span",{className:"text-[10px] text-fg/30 mt-1 px-1",children:new Date(e.created_at).toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})})]})]})})}function pz({sessionId:e,onContextUpdate:t,onNewSession:n,onSessionCreated:r}){const{t:s}=Ze(),[o,a]=R.useState([]),[c,d]=R.useState(""),[f,p]=R.useState(!1),[g,y]=R.useState(!1),x=R.useRef(null),b=R.useRef(null),w=R.useRef(!0),k=R.useRef(null);R.useEffect(()=>{e?E(e):(a([]),t([]))},[e,t]),R.useEffect(()=>{w.current&&x.current&&x.current.scrollIntoView({behavior:"smooth"})},[o,g]);const S=()=>{const N=b.current;if(!N)return;const T=N.scrollHeight-N.scrollTop-N.clientHeight;w.current=T<64},E=async N=>{try{const{data:{session:T}}=await oe.auth.getSession();if(!T)return;const I=await Ye.get(`/api/chat/sessions/${N}/messages`,{headers:{"x-user-id":T.user.id}});if(I.data.success){a(I.data.messages);const V=I.data.messages[I.data.messages.length-1];V&&V.role==="assistant"&&V.context_sources&&t(V.context_sources)}}catch(T){console.error("Failed to fetch messages",T)}},j=async N=>{if(N?.preventDefault(),!c.trim()||f)return;const T=c.trim();d(""),k.current&&(k.current.style.height="auto");const{data:{session:I}}=await oe.auth.getSession();if(!I)return;const V=I.user.id;p(!0),y(!0);try{let U=e;if(!U){const Y=await Ye.post("/api/chat/sessions",{},{headers:{"x-user-id":V}});if(Y.data.success)U=Y.data.session.id,r(U);else throw new Error("Failed to create session")}const D={id:"temp-"+Date.now(),role:"user",content:T,created_at:new Date().toISOString()};a(Y=>[...Y,D]);const Z=await Ye.post("/api/chat/message",{sessionId:U,content:T},{headers:{"x-user-id":V}});if(Z.data.success){const Y=Z.data.message;a(he=>[...he,Y]),Y.context_sources&&t(Y.context_sources)}}catch(U){console.error("Message failed",U),a(D=>[...D,{id:"err-"+Date.now(),role:"assistant",content:s("chat.error_message"),created_at:new Date().toISOString()}])}finally{p(!1),y(!1)}},O=N=>{N.key==="Enter"&&!N.shiftKey&&(N.preventDefault(),j())};return u.jsxs(u.Fragment,{children:[u.jsxs("div",{ref:b,onScroll:S,className:"flex-1 overflow-y-auto p-5 space-y-6 scrollbar-on-hover",children:[o.length===0?u.jsxs("div",{className:"h-full flex flex-col items-center justify-center p-8 text-center opacity-70",children:[u.jsx("div",{className:"w-16 h-16 bg-primary/10 rounded-2xl flex items-center justify-center mb-4 text-primary animate-pulse",children:u.jsx($j,{size:32})}),u.jsx("h3",{className:"text-xl font-bold mb-2",children:s("chat.title")}),u.jsx("p",{className:"text-sm max-w-md mx-auto mb-8",children:s("chat.desc")}),u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 max-w-lg w-full",children:[s("chat.suggestions.react"),s("chat.suggestions.ai"),s("chat.suggestions.finance"),s("chat.suggestions.performance")].map((N,T)=>u.jsx("button",{onClick:()=>d(N),className:"text-left p-3 text-xs bg-surface/30 hover:bg-surface/50 border border-border/30 rounded-xl transition-all hover:scale-[1.02]",children:N},T))})]}):u.jsxs(u.Fragment,{children:[o.map((N,T)=>u.jsx(fz,{message:N},N.id||T)),g&&u.jsx(Le.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},className:"flex justify-start w-full",children:u.jsxs("div",{className:"bg-surface/30 border border-border/20 rounded-xl px-4 py-3 flex items-center gap-3",children:[u.jsxs("div",{className:"flex gap-1",children:[u.jsx("span",{className:"w-1.5 h-1.5 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"0s"}}),u.jsx("span",{className:"w-1.5 h-1.5 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"0.1s"}}),u.jsx("span",{className:"w-1.5 h-1.5 bg-primary/60 rounded-full animate-bounce",style:{animationDelay:"0.2s"}})]}),u.jsx("span",{className:"text-xs text-fg/50 font-mono",children:s("chat.thinking")})]})})]}),u.jsx("div",{ref:x})]}),u.jsx("div",{className:"p-4 bg-surface/20 border-t border-border backdrop-blur-md",children:u.jsx("form",{onSubmit:j,className:"relative max-w-4xl mx-auto",children:u.jsxs("div",{className:"relative flex items-end gap-2 bg-surface/55 border border-border rounded-xl px-2 py-2 shadow-sm focus-within:ring-2 focus-within:ring-primary/30 focus-within:border-primary/30 transition-all",children:[u.jsx("textarea",{ref:k,value:c,onChange:N=>{d(N.target.value),N.target.style.height="auto",N.target.style.height=N.target.scrollHeight+"px"},onKeyDown:O,placeholder:s("chat.placeholder"),rows:1,className:"w-full bg-transparent border-none focus:ring-0 focus:outline-none py-2 pl-2 text-fg resize-none min-h-[24px] max-h-[200px] placeholder:text-fg/40",disabled:f}),u.jsx("button",{type:"submit",disabled:!c.trim()||f,className:"p-2 mb-0.5 bg-primary text-white rounded-xl shadow-lg hover:bg-primary/90 disabled:opacity-50 disabled:cursor-not-allowed transition-all shrink-0",children:f?u.jsx(Ds,{size:18,className:"animate-spin"}):u.jsx(zj,{size:18})})]})})})]})}function mz({sources:e,onClose:t}){const{t:n}=Ze();return!e||e.length===0?null:u.jsxs(Le.div,{initial:{opacity:0,x:20,width:0},animate:{opacity:1,x:0,width:300},exit:{opacity:0,x:20,width:0},className:"bg-surface/25 backdrop-blur-xl rounded-xl border border-border overflow-hidden flex flex-col",children:[u.jsxs("div",{className:"p-4 border-b border-border flex items-center justify-between bg-surface/15",children:[u.jsxs("div",{className:"flex items-center gap-2 text-sm font-semibold text-fg/80",children:[u.jsx(y_,{size:16,className:"text-secondary"}),u.jsx("span",{children:n("chat.relevant_context")})]}),u.jsx("button",{onClick:t,className:"p-1 hover:bg-surface rounded-md text-fg/40 hover:text-fg transition-colors",children:u.jsx(an,{size:14})})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-3 space-y-3",children:e.map((r,s)=>u.jsxs("div",{className:"p-3 bg-surface/20 hover:bg-surface/35 border border-border rounded-xl transition-all group",children:[u.jsxs("div",{className:"flex justify-between items-start mb-2",children:[u.jsxs("div",{className:"flex items-center gap-1.5",children:[u.jsx("span",{className:"flex items-center justify-center w-4 h-4 bg-primary/10 text-primary text-[10px] font-bold rounded",children:s+1}),u.jsx("span",{className:`text-[10px] font-bold px-1.5 py-0.5 rounded border ${r.score>=80?"bg-yellow-500/10 text-yellow-500 border-yellow-500/20":"bg-blue-500/10 text-blue-400 border-blue-500/20"}`,children:n("chat.match_score",{score:r.score})})]}),u.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"opacity-0 group-hover:opacity-100 focus-visible:opacity-100 text-fg/40 hover:text-primary transition-opacity focus-visible:ring-2 focus-visible:ring-primary/40 rounded",children:u.jsx(es,{size:12})})]}),u.jsx("a",{href:r.url,target:"_blank",rel:"noopener noreferrer",className:"text-xs font-bold text-fg/90 block mb-1 hover:text-primary transition-colors line-clamp-2",children:r.title}),u.jsx("p",{className:"text-[10px] text-fg/50 line-clamp-3 leading-relaxed",children:r.summary})]},s))}),u.jsx("div",{className:"p-3 border-t border-border bg-surface/20 text-[10px] text-center text-fg/30",children:n("chat.rag_attribution",{count:e.length})})]})}function gz(){const[e,t]=R.useState(null),[n,r]=R.useState([]),[s,o]=R.useState(!0);return u.jsxs("div",{className:"flex h-full gap-4 overflow-hidden",children:[u.jsx(VL,{activeSessionId:e,onSelectSession:t}),u.jsx("div",{className:"flex-1 flex flex-col min-w-0 bg-surface/60 rounded-xl overflow-hidden border border-border relative",children:u.jsx(pz,{sessionId:e,onContextUpdate:a=>{r(a),a.length>0&&o(!0)},onNewSession:()=>t(null),onSessionCreated:a=>t(a)})}),s&&u.jsx(mz,{sources:n,onClose:()=>o(!1)})]})}function yz({isOpen:e,onClose:t}){const{t:n}=Ze(),[r,s]=R.useState(""),[o,a]=R.useState(!0);R.useEffect(()=>{e&&c()},[e]);const c=async()=>{a(!0);try{const f=await(await fetch("/CHANGELOG.md")).text();s(f)}catch(d){console.error("Failed to load changelog:",d),s(`# ${n("common.error")}
|
|
136
|
+
|
|
137
|
+
${n("shell.changelog_error")}`)}finally{a(!1)}};return u.jsx(It,{children:e&&u.jsxs(u.Fragment,{children:[u.jsx(Le.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},onClick:t,className:"fixed inset-0 bg-black/60 backdrop-blur-sm z-50"}),u.jsx(Le.div,{initial:{opacity:0,scale:.95,y:20},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:20},transition:{type:"spring",damping:25,stiffness:300},className:"fixed inset-0 z-50 flex items-center justify-center p-4 pointer-events-none",children:u.jsxs("div",{className:"glass w-full max-w-3xl max-h-[80vh] overflow-hidden pointer-events-auto shadow-2xl",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx(y_,{size:24,className:"text-primary"}),u.jsx("h2",{className:"text-xl font-bold",children:n("shell.release_notes")})]}),u.jsx("button",{onClick:t,className:"p-2 hover:bg-surface rounded-lg transition-colors",children:u.jsx(an,{size:20,className:"text-fg/60"})})]}),u.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar max-h-[calc(80vh-88px)]",children:o?u.jsx("div",{className:"flex items-center justify-center py-12",children:u.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-2 border-primary border-t-transparent"})}):u.jsx(Zp,{components:{h1:({children:d})=>u.jsx("h1",{className:"text-2xl font-bold text-fg mb-6 mt-0",children:d}),h2:({children:d})=>u.jsx("h2",{className:"text-xl font-bold text-fg mt-8 mb-3 pb-2 border-b border-border first:mt-0",children:d}),h3:({children:d})=>u.jsx("h3",{className:"text-lg font-bold text-primary mt-6 mb-2",children:d}),p:({children:d})=>u.jsx("p",{className:"text-sm text-fg/70 mb-3 leading-relaxed",children:d}),ul:({children:d})=>u.jsx("ul",{className:"list-none space-y-1 mb-4 ml-0",children:d}),li:({children:d})=>u.jsx("li",{className:"text-sm text-fg/80 ml-4 mb-1 before:content-['•'] before:mr-2 before:text-primary",children:d}),a:({href:d,children:f})=>u.jsx("a",{href:d,target:"_blank",rel:"noopener noreferrer",className:"text-primary hover:text-primary/80 underline transition-colors",children:f}),code:({children:d})=>u.jsx("code",{className:"bg-surface/50 text-accent px-1.5 py-0.5 rounded text-xs font-mono border border-border",children:d}),strong:({children:d})=>u.jsx("strong",{className:"font-bold text-fg",children:d})},children:r})})]})})]})})}function xz({asset:e,onClose:t}){const{t:n}=Ze(),r=()=>{e.content&&navigator.clipboard.writeText(e.content)},s=()=>{if(!e.content)return;const o=new Blob([e.content],{type:"text/markdown"}),a=URL.createObjectURL(o),c=document.createElement("a");c.href=a,c.download=`${e.title.replace(/[^a-z0-9]/gi,"_").toLowerCase()}.md`,document.body.appendChild(c),c.click(),document.body.removeChild(c),URL.revokeObjectURL(a)};return u.jsx(It,{children:e&&u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/60 backdrop-blur-md",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg rounded-3xl shadow-2xl w-full max-w-4xl max-h-[85vh] flex flex-col overflow-hidden border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border bg-surface/50",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 rounded-2xl bg-primary/10 text-primary shadow-inner",children:e.type==="audio"?u.jsx(Hh,{className:"w-6 h-6"}):u.jsx(Mi,{className:"w-6 h-6"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-black italic tracking-tighter uppercase text-xl text-fg",children:e.title}),u.jsxs("p",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-widest mt-0.5",children:[new Date(e.created_at).toLocaleString([],{dateStyle:"medium",timeStyle:"short"})," • ",n("discovery.sources_count",{count:e.metadata?.source_signal_count||0})]})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:r,className:"p-2.5 text-fg/40 hover:text-primary hover:bg-primary/10 rounded-xl transition-all",title:"Copy Content",children:u.jsx(Uf,{className:"w-5 h-5"})}),u.jsx("button",{onClick:s,className:"p-2.5 text-fg/40 hover:text-primary hover:bg-primary/10 rounded-xl transition-all",title:"Download File",children:u.jsx(Vh,{className:"w-5 h-5"})}),u.jsx("div",{className:"w-px h-8 bg-border mx-2"}),u.jsx("button",{onClick:t,className:"p-2.5 text-fg/40 hover:text-error hover:bg-error/10 rounded-xl transition-all",children:u.jsx(an,{className:"w-6 h-6"})})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-8 bg-bg custom-scrollbar",children:e.status&&e.status!=="completed"?u.jsxs("div",{className:"flex flex-col items-center justify-center h-80 gap-6",children:[u.jsxs("div",{className:"relative",children:[u.jsx("div",{className:"absolute inset-0 bg-primary/20 rounded-full blur-xl animate-pulse"}),u.jsx(Ct,{className:"w-16 h-16 animate-spin text-primary relative z-10"})]}),u.jsxs("div",{className:"text-center space-y-2",children:[u.jsx("h4",{className:"text-xl font-black italic tracking-tighter uppercase text-fg",children:e.status==="processing"?n("transmute.generating_asset"):n("transmute.queued_desktop")}),u.jsx("p",{className:"text-xs text-fg/40 font-mono uppercase tracking-widest max-w-xs mx-auto",children:n("transmute.desktop_processing")})]})]}):e.type==="markdown"?u.jsx("div",{className:"prose prose-invert prose-headings:font-black prose-headings:italic prose-headings:tracking-tighter prose-headings:uppercase prose-p:text-fg/80 prose-li:text-fg/80 prose-strong:text-primary max-w-none",children:u.jsx(Zp,{children:e.content||""})}):e.type==="audio"?u.jsxs("div",{className:"flex flex-col items-center justify-center h-80 gap-8",children:[u.jsx("div",{className:"w-24 h-24 rounded-3xl bg-primary/10 flex items-center justify-center animate-pulse shadow-xl border border-primary/20",children:u.jsx(Hh,{className:"w-10 h-10 text-primary"})}),u.jsxs("div",{className:"text-center",children:[u.jsx("p",{className:"text-xs text-fg/40 font-mono uppercase tracking-widest mb-6",children:n("transmute.unsupported_type")}),u.jsxs("audio",{controls:!0,className:"w-80 h-12 rounded-xl bg-surface border border-border",children:[u.jsx("source",{src:e.content||"",type:"audio/mpeg"}),"Your browser does not support the audio element."]})]})]}):u.jsx("div",{className:"text-fg/20 text-center py-20 font-mono italic",children:"Unsupported asset type"})})]})})})}function d_({engine:e,onClose:t,onSave:n,onDelete:r}){const{t:s}=Ze(),{showToast:o}=Xc(),[a,c]=R.useState({title:"",type:"newsletter",status:"active",config:{schedule:"",min_score:70,categories:[],custom_prompt:"",max_signals:10,execution_mode:"local"}}),[d,f]=R.useState(!1);R.useEffect(()=>{e&&c({title:e.title,type:e.type,status:e.status,config:{schedule:e.config.schedule||"",min_score:e.config.filters?.min_score||70,categories:Array.isArray(e.config.category)?e.config.category:e.config.category?[e.config.category]:[],custom_prompt:e.config.custom_prompt||"",max_signals:e.config.max_signals||10,execution_mode:e.config.execution_mode||"local"}})},[e]);const p=async()=>{try{const x={title:a.title,type:a.type,status:a.status,config:{schedule:a.config.schedule,filters:{min_score:a.config.min_score,category:a.config.category},custom_prompt:a.config.custom_prompt,max_signals:a.config.max_signals,execution_mode:a.config.execution_mode}};if(e){const{data:b,error:w}=await oe.from("engines").update(x).eq("id",e.id).select().single();if(w)throw w;n(b),o("Engine updated successfully","success")}else{const{data:{user:b}}=await oe.auth.getUser();if(!b)throw new Error("Not authenticated");const{data:w,error:k}=await oe.from("engines").insert({...x,user_id:b.id}).select().single();if(k)throw k;n(w),o("Engine created successfully","success")}t()}catch(x){console.error("Save error:",x),o(x.message||"Failed to save engine","error")}},g=async()=>{if(!(!e||!r))try{const{error:x}=await oe.from("engines").delete().eq("id",e.id);if(x)throw x;r(e.id),o("Engine deleted","success"),t()}catch(x){o(x.message||"Failed to delete engine","error")}},y=()=>{f(!1),t()};return!e&&!t?null:u.jsx(It,{children:u.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4 bg-black/50 backdrop-blur-sm",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg rounded-3xl shadow-2xl w-full max-w-2xl max-h-[85vh] flex flex-col overflow-hidden border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border bg-surface/50",children:[u.jsxs("div",{children:[u.jsx("h3",{className:"text-xl font-black italic tracking-tighter uppercase text-fg",children:s(e?"transmute.edit_engine":"transmute.create_engine")}),u.jsx("p",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-[0.2em]",children:s("transmute.configure_pipeline")})]}),u.jsx("button",{onClick:y,className:"p-2 text-fg/40 hover:text-error hover:bg-error/10 rounded-xl transition-all",children:u.jsx(an,{className:"w-6 h-6"})})]}),u.jsxs("div",{className:"flex-1 overflow-y-auto p-8 space-y-8 custom-scrollbar",children:[u.jsxs("div",{className:"space-y-6",children:[u.jsx(_r,{label:s("transmute.engine_name"),children:u.jsx("input",{type:"text",value:a.title,onChange:x=>c({...a,title:x.target.value}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg placeholder:text-fg/20 focus:border-primary/50 outline-none transition-all text-sm",placeholder:"e.g., Daily Tech Brief"})}),u.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[u.jsx(_r,{label:s("transmute.type"),children:u.jsxs("select",{value:a.type,onChange:x=>c({...a,type:x.target.value}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm appearance-none cursor-pointer",children:[u.jsx("option",{value:"newsletter",children:s("transmute.newsletter")}),u.jsx("option",{value:"thread",children:s("transmute.thread")}),u.jsx("option",{value:"audio",children:"Audio Brief"}),u.jsx("option",{value:"report",children:"Report"})]})}),u.jsx(_r,{label:s("transmute.status"),children:u.jsxs("select",{value:a.status,onChange:x=>c({...a,status:x.target.value}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm appearance-none cursor-pointer",children:[u.jsx("option",{value:"active",children:s("common.status_active")}),u.jsx("option",{value:"paused",children:s("common.status_paused")}),u.jsx("option",{value:"draft",children:"Draft"})]})})]}),u.jsxs(_r,{label:s("transmute.execution_env"),children:[u.jsxs("select",{value:a.config.execution_mode,onChange:x=>c({...a,config:{...a.config,execution_mode:x.target.value}}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm appearance-none cursor-pointer",children:[u.jsx("option",{value:"local",children:s("transmute.local_llm")}),u.jsx("option",{value:"desktop",children:s("transmute.desktop_swarm")})]}),u.jsx("p",{className:"text-[10px] text-fg/40 font-mono uppercase mt-2 leading-relaxed",children:a.config.execution_mode==="desktop"?s("transmute.env_desc_desktop"):s("transmute.env_desc_local")})]})]}),u.jsxs("div",{className:"space-y-6 pt-6 border-t border-border/10",children:[u.jsx("h4",{className:"text-xs font-bold uppercase tracking-[0.2em] text-primary/60",children:"Signal Filters"}),u.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[u.jsx(_r,{label:s("transmute.min_score"),children:u.jsx("input",{type:"number",min:"0",max:"100",value:a.config.min_score,onChange:x=>c({...a,config:{...a.config,min_score:parseInt(x.target.value)||0}}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm"})}),u.jsx(_r,{label:s("transmute.max_signals"),children:u.jsx("input",{type:"number",min:"1",max:"50",value:a.config.max_signals,onChange:x=>c({...a,config:{...a.config,max_signals:parseInt(x.target.value)||10}}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm"})})]}),u.jsxs(_r,{label:s("transmute.category_filter"),children:[u.jsxs("select",{multiple:!0,value:a.config.categories,onChange:x=>{const b=Array.from(x.target.selectedOptions,w=>w.value);c({...a,config:{...a.config,categories:b}})},className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg focus:border-primary/50 outline-none transition-all text-sm min-h-[120px] custom-scrollbar",children:[u.jsx("option",{value:"AI & ML",children:"AI & ML"}),u.jsx("option",{value:"Technology",children:"Technology"}),u.jsx("option",{value:"Business",children:"Business"}),u.jsx("option",{value:"Finance",children:"Finance"}),u.jsx("option",{value:"Science",children:"Science"}),u.jsx("option",{value:"Politics",children:"Politics"})]}),u.jsx("p",{className:"text-[10px] text-fg/40 font-mono mt-2",children:s("transmute.multi_select_hint")})]})]}),u.jsx("div",{className:"pt-6 border-t border-border/10",children:u.jsxs(_r,{label:`${s("transmute.schedule")} (${s("common.optional")})`,children:[u.jsx("input",{type:"text",value:a.config.schedule,onChange:x=>c({...a,config:{...a.config,schedule:x.target.value}}),className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg placeholder:text-fg/20 focus:border-primary/50 outline-none transition-all text-sm",placeholder:"e.g., Daily @ 9am, Manual"}),u.jsx("p",{className:"text-[10px] text-fg/40 font-mono mt-2",children:s("transmute.schedule_hint")})]})}),u.jsx("div",{className:"pt-6 border-t border-border/10",children:u.jsx(_r,{label:s("transmute.prompt_override"),children:u.jsx("textarea",{value:a.config.custom_prompt,onChange:x=>c({...a,config:{...a.config,custom_prompt:x.target.value}}),rows:5,className:"w-full px-4 py-3 rounded-xl border border-border bg-surface text-fg placeholder:text-fg/20 focus:border-primary/50 outline-none transition-all text-sm resize-none custom-scrollbar",placeholder:s("transmute.prompt_placeholder")})})})]}),u.jsxs("div",{className:"flex items-center justify-between p-6 border-t border-border bg-surface/50",children:[e&&r?d?u.jsxs("div",{className:"flex items-center gap-4 bg-error/5 border border-error/20 px-4 py-2 rounded-2xl animate-in fade-in slide-in-from-left-2 transition-all",children:[u.jsx("span",{className:"text-xs text-error font-bold uppercase tracking-widest",children:s("transmute.delete_confirm")}),u.jsxs("div",{className:"flex gap-2",children:[u.jsx("button",{onClick:g,className:"px-4 py-2 bg-error text-white text-[10px] font-bold uppercase tracking-widest rounded-xl hover:bg-error/80 transition-all shadow-lg shadow-error/20",children:s("transmute.confirm")}),u.jsx("button",{onClick:()=>f(!1),className:"px-4 py-2 bg-surface border border-border text-fg/40 text-[10px] font-bold uppercase tracking-widest rounded-xl hover:bg-bg transition-all",children:s("common.cancel")})]})]}):u.jsxs("button",{onClick:()=>f(!0),className:"flex items-center gap-2 px-6 py-3 text-error/60 hover:text-error hover:bg-error/10 rounded-2xl transition-all font-bold text-xs uppercase tracking-widest",children:[u.jsx(qf,{className:"w-5 h-5"}),s("common.delete")]}):u.jsx("div",{}),u.jsxs("div",{className:"flex gap-4",children:[u.jsx("button",{onClick:y,className:"px-6 py-3 text-fg/40 font-bold text-xs uppercase tracking-widest hover:text-fg hover:bg-surface rounded-2xl transition-all",children:s("common.cancel")}),u.jsxs("button",{onClick:p,className:"flex items-center gap-2 px-8 py-3 bg-gradient-to-r from-primary to-accent text-white rounded-2xl font-bold text-xs uppercase tracking-widest hover:scale-105 active:scale-95 transition-all shadow-lg glow-primary",children:[u.jsx(wr,{className:"w-5 h-5"}),s("common.save")]})]})]})]})})})}function _r({label:e,children:t}){return u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-[10px] font-bold uppercase tracking-[0.2em] text-fg/30 ml-1",children:e}),t]})}const vz=({engine:e,onRun:t,onEdit:n,onToggle:r,onViewBrief:s,isLoading:o})=>{const{t:a}=Ze(),c=!!e.config.tag,d={newsletter:c?u.jsx(Bf,{className:"w-5 h-5 text-blue-500"}):u.jsx(Mi,{className:"w-5 h-5 text-emerald-500"}),thread:u.jsx(Ft,{className:"w-5 h-5 text-blue-500"}),audio:u.jsx(Hh,{className:"w-5 h-5 text-purple-500"}),report:u.jsx(uc,{className:"w-5 h-5 text-orange-500"})};return u.jsxs(Le.div,{layout:!0,initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},className:`p-5 rounded-2xl border transition-all hover:shadow-lg group ${e.status==="active"?"bg-surface border-border shadow-sm":"bg-surface/30 border-dashed border-border opacity-70"}`,children:[u.jsxs("div",{className:"flex justify-between items-start mb-4",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"p-2 rounded-xl bg-bg border border-border/10",children:d[e.type]||u.jsx(Mi,{className:"w-5 h-5"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-bold text-fg tracking-tight",children:e.title}),u.jsxs("p",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-widest",children:[c?a("transmute.topic"):a(`transmute.${e.type}`,e.type)," ",a("transmute.pipeline")]})]})]}),u.jsxs("div",{className:"flex gap-1",children:[u.jsx("button",{onClick:()=>r(e.id,e.status),className:"p-1.5 rounded-lg hover:bg-bg text-fg/40 hover:text-fg transition-colors",children:e.status==="active"?u.jsx(Dj,{className:"w-4 h-4"}):u.jsx(Zy,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>s(e.id),title:a("transmute.view_json"),className:"p-1.5 rounded-lg hover:bg-bg text-fg/40 hover:text-fg transition-colors",children:u.jsx(__,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>n(e.id),className:"p-1.5 rounded-lg hover:bg-bg text-fg/40 hover:text-fg transition-colors",children:u.jsx(uc,{className:"w-4 h-4"})})]})]}),u.jsxs("div",{className:"space-y-2 mb-4",children:[u.jsxs("div",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-widest flex justify-between",children:[u.jsx("span",{children:a("transmute.last_run")}),u.jsx("span",{className:"text-fg/60",children:e.last_run_at?new Date(e.last_run_at).toLocaleDateString(a("common.locale_code")):a("transmute.never")})]}),u.jsxs("div",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-widest flex justify-between",children:[u.jsx("span",{children:a("transmute.schedule")}),u.jsx("span",{className:"text-fg/60",children:e.config.schedule||a("transmute.manual")})]})]}),u.jsxs("button",{onClick:()=>t(e.id),disabled:o||e.status!=="active",className:"w-full flex items-center justify-center gap-2 py-2.5 rounded-xl bg-gradient-to-r from-primary to-primary/80 text-white font-bold shadow-lg glow-primary hover:scale-[1.02] active:scale-95 disabled:opacity-50 disabled:hover:scale-100 transition-all text-sm uppercase tracking-widest",children:[o?u.jsx(Ct,{className:"w-4 h-4 animate-spin"}):u.jsx(Zy,{className:"w-4 h-4"}),a(o?"transmute.running":"transmute.run_engine")]})]})};function _z(){const{t:e}=Ze(),[t,n]=R.useState([]),[r,s]=R.useState(!0),[o,a]=R.useState(new Set),[c,d]=R.useState(null),[f,p]=R.useState(null),[g,y]=R.useState(!1),[x,b]=R.useState(null),[w,k]=R.useState(!1),[S,E]=R.useState(!1),{showToast:j}=Xc();R.useEffect(()=>{(async()=>N())();const W=oe.channel("asset-updates").on("postgres_changes",{event:"UPDATE",schema:"public",table:"assets"},ne=>{const re=ne.new;d(J=>J?.id===re.id?re:J),re.status==="completed"&&ne.old.status!=="completed"&&j(e("transmute.asset_ready",{title:re.title}),"success")}).subscribe();return()=>{oe.removeChannel(W)}},[]);const O=async()=>{if(!S)try{E(!0),j(e("transmute.scanning"),"info");const{data:{session:G}}=await oe.auth.getSession(),W=Zr(),ne={"Content-Type":"application/json","x-user-id":G?.user?.id||""};if(G?.access_token&&(ne.Authorization=`Bearer ${G.access_token}`),W&&(ne["x-supabase-url"]=W.url,ne["x-supabase-key"]=W.anonKey),!(await fetch("/api/engines/ensure-defaults",{method:"POST",headers:ne})).ok)throw new Error("Failed to generate engines");j(e("transmute.discovery_complete"),"success"),await N()}catch(G){console.error("Failed to generate engines:",G),j(e("transmute.discovery_failed"),"error")}finally{E(!1)}},N=async()=>{try{s(!0);const{data:{user:G}}=await oe.auth.getUser();if(!G)return;const{data:W,error:ne}=await oe.from("engines").select("*").eq("user_id",G.id).order("created_at",{ascending:!1});if(ne)throw ne;n(W)}catch(G){console.error("Error fetching engines:",G),j(e("transmute.load_failed"),"error")}finally{s(!1)}},T=async G=>{if(!o.has(G))try{a(M=>new Set(M).add(G)),j(e("transmute.starting_run"),"info");const{data:{session:W}}=await oe.auth.getSession(),ne=W?.access_token,re=Zr(),J={"Content-Type":"application/json","x-user-id":W?.user?.id||""};ne&&(J.Authorization=`Bearer ${ne}`),re&&(J["x-supabase-url"]=re.url,J["x-supabase-key"]=re.anonKey);const ce=await fetch(`/api/engines/${G}/run`,{method:"POST",headers:J});if(!ce.ok){const M=await ce.json();throw new Error(M.error||"Run failed")}const A=await ce.json();A.status==="completed"?j(e("transmute.run_complete",{title:A.title}),"success"):j(e("transmute.run_started_desktop",{id:A.id}),"info"),d(A),n(M=>M.map(K=>K.id===G?{...K,last_run_at:new Date().toISOString()}:K))}catch(W){console.error("Engine run error:",W),j(W.message||e("transmute.run_failed"),"error")}finally{a(W=>{const ne=new Set(W);return ne.delete(G),ne})}},I=async G=>{try{y(!0);const{data:{session:W}}=await oe.auth.getSession(),ne=Zr(),re={"Content-Type":"application/json","x-user-id":W?.user?.id||""};W?.access_token&&(re.Authorization=`Bearer ${W.access_token}`),ne&&(re["x-supabase-url"]=ne.url,re["x-supabase-key"]=ne.anonKey);const J=await fetch(`/api/engines/${G}/brief`,{headers:re});if(!J.ok)throw new Error("Failed to fetch brief");const ce=await J.json();p(ce)}catch{j(e("transmute.brief_failed"),"error")}finally{y(!1)}},V=async(G,W)=>{const ne=W==="active"?"paused":"active";n(re=>re.map(J=>J.id===G?{...J,status:ne}:J));try{const{error:re}=await oe.from("engines").update({status:ne}).eq("id",G);if(re)throw re;j(e("transmute.status_updated",{status:ne}),"success")}catch{n(J=>J.map(ce=>ce.id===G?{...ce,status:W}:ce)),j(e("common.error"),"error")}},U=()=>{k(!0)},D=G=>{const W=t.find(ne=>ne.id===G);W&&b(W)},Z=G=>{n(W=>W.find(re=>re.id===G.id)?W.map(re=>re.id===G.id?G:re):[G,...W])},Y=G=>{n(W=>W.filter(ne=>ne.id!==G))},he=()=>{b(null),k(!1)};return u.jsxs("div",{className:"h-full flex flex-col bg-bg",children:[u.jsx("div",{className:"flex-none p-6 border-b border-border bg-bg/50 backdrop-blur-sm z-10 sticky top-0",children:u.jsxs("div",{className:"flex justify-between items-center max-w-7xl mx-auto w-full",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-2xl font-black italic tracking-tighter bg-clip-text text-transparent bg-gradient-to-r from-primary to-accent",children:e("transmute.title")}),u.jsx("p",{className:"text-xs text-fg/40 font-mono uppercase tracking-widest mt-1",children:e("transmute.desc")})]}),u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsxs("button",{onClick:O,disabled:S,className:"flex items-center gap-2 px-4 py-2.5 bg-primary/10 text-primary border border-primary/20 rounded-xl font-bold text-xs uppercase tracking-widest hover:bg-primary/20 transition-all disabled:opacity-50",children:[S?u.jsx(Ct,{className:"w-4 h-4 animate-spin"}):u.jsx(Ft,{className:"w-4 h-4"}),e("transmute.generate_engines")]}),u.jsxs("button",{onClick:U,className:"flex items-center gap-2 px-4 py-2.5 bg-gradient-to-r from-primary to-accent text-white rounded-xl font-bold text-xs uppercase tracking-widest hover:scale-105 transition-all shadow-lg glow-primary",children:[u.jsx(Vf,{className:"w-4 h-4"}),e("transmute.new_engine")]})]})]})}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6",children:u.jsx("div",{className:"max-w-7xl mx-auto w-full",children:r?u.jsx("div",{className:"flex items-center justify-center h-64",children:u.jsx(Ct,{className:"w-8 h-8 animate-spin text-purple-500"})}):t.length===0?u.jsxs("div",{className:"flex flex-col items-center justify-center h-96 text-center",children:[u.jsx("div",{className:"w-16 h-16 rounded-3xl bg-surface border border-border flex items-center justify-center mb-6 shadow-xl",children:u.jsx(Ft,{className:"w-8 h-8 text-fg/20"})}),u.jsx("h3",{className:"text-xl font-black italic tracking-tighter uppercase text-fg",children:e("transmute.no_engines")}),u.jsx("p",{className:"text-xs text-fg/40 font-mono tracking-widest uppercase max-w-sm mt-2 mb-8",children:e("transmute.no_engines_desc")}),u.jsx("button",{onClick:U,className:"px-8 py-3 rounded-xl border border-border bg-surface hover:bg-bg text-xs font-bold uppercase tracking-widest transition-all shadow-sm",children:e("transmute.create_engine")})]}):u.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:u.jsx(It,{children:t.map(G=>u.jsx(vz,{engine:G,onRun:T,onEdit:D,onToggle:V,onViewBrief:I,isLoading:o.has(G.id)},G.id))})})})}),u.jsx(It,{children:f&&u.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center p-4 bg-black/60 backdrop-blur-md",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"bg-bg rounded-3xl shadow-2xl w-full max-w-4xl max-h-[85vh] flex flex-col overflow-hidden border border-border",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-border bg-surface/50",children:[u.jsxs("div",{className:"flex items-center gap-4",children:[u.jsx("div",{className:"p-3 rounded-2xl bg-primary/10 text-primary",children:u.jsx(__,{className:"w-6 h-6"})}),u.jsxs("div",{children:[u.jsx("h3",{className:"font-black italic tracking-tighter uppercase text-lg text-fg",children:e("transmute.view_json")}),u.jsx("p",{className:"text-[10px] text-fg/40 font-mono uppercase tracking-widest",children:e("transmute.json_contract")})]})]}),u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx("button",{onClick:()=>{navigator.clipboard.writeText(JSON.stringify(f,null,2)),j(e("transmute.copied_json"),"info")},className:"p-2 text-fg/40 hover:text-primary hover:bg-primary/10 rounded-xl transition-all",children:u.jsx(Uf,{className:"w-4 h-4"})}),u.jsx("button",{onClick:()=>p(null),className:"p-2 text-fg/40 hover:text-error hover:bg-error/10 rounded-xl transition-all",children:u.jsx(an,{className:"w-5 h-5"})})]})]}),u.jsx("div",{className:"flex-1 overflow-y-auto p-6 bg-surface/30 font-mono text-sm custom-scrollbar",children:u.jsx("pre",{className:"text-primary leading-relaxed",children:JSON.stringify(f,null,2)})}),u.jsx("div",{className:"p-4 border-t border-border bg-surface/50 text-[9px] text-fg/30 font-mono uppercase tracking-[0.2em] text-center",children:e("transmute.json_footer")})]})})}),g&&u.jsx("div",{className:"fixed inset-0 z-[70] flex items-center justify-center bg-black/20 backdrop-blur-sm",children:u.jsx(Ct,{className:"w-10 h-10 animate-spin text-white"})}),u.jsx(xz,{asset:c,onClose:()=>d(null)}),x&&u.jsx(d_,{engine:x,onClose:he,onSave:Z,onDelete:Y}),w&&u.jsx(d_,{engine:null,onClose:he,onSave:Z})]})}function bz({onOpen:e}){const{t}=Ze();return u.jsxs(Le.div,{initial:{y:-50,opacity:0},animate:{y:0,opacity:1},className:"bg-primary px-4 py-2 flex items-center justify-center gap-4 text-white text-xs font-bold cursor-pointer hover:bg-primary/90 transition-all z-[100] sticky top-0",onClick:e,children:[u.jsxs("div",{className:"flex items-center gap-2",children:[u.jsx(jr,{size:14}),u.jsx("span",{children:t("migration.update_available","Database update available")})]}),u.jsxs("div",{className:"flex items-center gap-1 opacity-80 hover:opacity-100 uppercase tracking-tighter",children:[u.jsx("span",{children:t("migration.apply_now","Apply Now")}),u.jsx(tc,{size:10})]})]})}function wz({isOpen:e,onClose:t,status:n}){const{t:r}=Ze(),[s,o]=R.useState(!1),[a,c]=R.useState([]),[d,f]=R.useState(""),[p,g]=R.useState(""),y=R.useRef(null);R.useEffect(()=>{const w=Zr()?.url||void 0;if(w)try{const E=new URL(w).hostname.split(".")[0];f(E)}catch{console.error("Failed to parse Supabase URL for Project ID")}},[e]),R.useEffect(()=>{y.current&&y.current.scrollIntoView({behavior:"smooth"})},[a]);const x=async()=>{if(!(!d||!p)){o(!0),c([`🚀 Initializing migration for project: ${d}...`]);try{const b=await fetch("/api/migrate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({projectId:d,accessToken:p})});if(!b.ok){const S=await b.json();throw new Error(S.error||"Failed to start migration")}const w=b.body?.getReader();if(!w)throw new Error("Stream not available");const k=new TextDecoder;for(;;){const{done:S,value:E}=await w.read();if(S)break;const O=k.decode(E).split(`
|
|
138
|
+
|
|
139
|
+
`);for(const N of O)if(N.startsWith("data: "))try{const{type:T,data:I}=JSON.parse(N.substring(6));T==="stdout"||T==="stderr"||T==="info"?c(V=>[...V,I]):T==="done"&&(I==="success"?(c(V=>[...V,"✅ Migration completed successfully! Reloading in 3 seconds..."]),setTimeout(()=>window.location.reload(),3e3)):c(V=>[...V,"❌ Migration failed. Please check logs above."]))}catch{c(I=>[...I,N])}}}catch(b){c(w=>[...w,`❌ Error: ${b.message}`])}finally{o(!1)}}};return e?u.jsx("div",{className:"fixed inset-0 bg-black/60 backdrop-blur-md flex items-center justify-center z-[110] p-4 font-sans",children:u.jsxs(Le.div,{initial:{opacity:0,scale:.9,y:20},animate:{opacity:1,scale:1,y:0},className:"bg-[#0a0a0a] border border-white/10 rounded-2xl shadow-2xl max-w-2xl w-full flex flex-col overflow-hidden",children:[u.jsxs("div",{className:"flex items-center justify-between p-6 border-b border-white/5 bg-gradient-to-r from-primary/5 to-transparent",children:[u.jsxs("div",{className:"flex items-center gap-3",children:[u.jsx("div",{className:"w-10 h-10 rounded-xl bg-primary/20 flex items-center justify-center text-primary border border-primary/20",children:u.jsx(jr,{size:22})}),u.jsxs("div",{children:[u.jsx("h2",{className:"text-xl font-bold text-white tracking-tight",children:"Database Migration"}),u.jsx("p",{className:"text-xs text-white/50 uppercase tracking-widest font-bold mt-0.5",children:"Engine Update Required"})]})]}),u.jsx("button",{onClick:t,disabled:s,className:"p-2 hover:bg-white/5 rounded-lg transition-all text-white/40 hover:text-white disabled:opacity-20",children:u.jsx(an,{className:"w-5 h-5"})})]}),u.jsxs("div",{className:"p-6 space-y-6 overflow-y-auto max-h-[70vh]",children:[u.jsx("div",{className:"p-4 bg-white/5 rounded-xl border border-white/5 space-y-3",children:u.jsxs("div",{className:"flex items-start gap-3",children:[u.jsx("div",{className:"mt-1 text-primary",children:u.jsx(Ds,{size:18})}),u.jsxs("div",{className:"space-y-1",children:[u.jsx("p",{className:"text-sm text-white font-medium",children:"New schema version detected."}),u.jsxs("p",{className:"text-xs text-white/60 leading-relaxed",children:["Your application code (version ",u.jsx("span",{className:"text-primary font-mono",children:n?.appTimestamp}),") requires database updates that haven't been applied to your current database (version ",u.jsx("span",{className:"text-fg/50 font-mono",children:n?.dbTimestamp||"unknown"}),")."]})]})]})}),u.jsxs("div",{className:"space-y-4",children:[u.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[u.jsxs("div",{className:"space-y-2",children:[u.jsx("div",{className:"flex items-center h-5 px-1",children:u.jsx("label",{className:"text-xs font-bold text-white/40 uppercase tracking-widest",children:"Project ID"})}),u.jsxs("div",{className:"relative group",children:[u.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-white/30",children:u.jsx(jr,{size:14})}),u.jsx("input",{type:"text",placeholder:"Supabase Project ID",value:d,readOnly:!0,disabled:s,className:"w-full bg-white/5 border border-white/10 rounded-xl py-2.5 pl-10 pr-4 text-sm text-white/50 cursor-not-allowed outline-none transition-all placeholder:text-white/20"})]})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsxs("div",{className:"flex justify-between items-center h-5 px-1",children:[u.jsx("label",{className:"text-xs font-bold text-white/40 uppercase tracking-widest",children:"Access Token"}),u.jsxs("a",{href:"https://supabase.com/dashboard/account/tokens",target:"_blank",rel:"noopener noreferrer",className:"text-[10px] text-primary hover:underline flex items-center gap-1 font-bold",children:["GET TOKEN ",u.jsx(es,{size:10})]})]}),u.jsxs("div",{className:"relative group",children:[u.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none text-white/30 group-focus-within:text-primary transition-colors",children:u.jsx(Pc,{size:14})}),u.jsx("input",{type:"password",placeholder:"sbp_...",value:p,onChange:b=>g(b.target.value),disabled:s,className:"w-full bg-white/5 border border-white/10 rounded-xl py-2.5 pl-10 pr-4 text-sm text-white focus:border-primary/40 focus:ring-1 focus:ring-primary/20 outline-none transition-all placeholder:text-white/20"})]})]})]}),u.jsx("button",{onClick:x,disabled:s||!d||!p,className:"w-full py-4 bg-primary text-white font-bold rounded-xl shadow-lg shadow-primary/20 hover:scale-[1.01] active:scale-95 transition-all flex items-center justify-center gap-3 disabled:opacity-30 disabled:hover:scale-100 uppercase tracking-widest text-xs",children:s?u.jsxs(u.Fragment,{children:[u.jsx(Ds,{className:"w-4 h-4 animate-spin"}),"Migrating..."]}):u.jsxs(u.Fragment,{children:[u.jsx(zi,{className:"w-4 h-4"}),"Execute Migration"]})})]}),u.jsxs("div",{className:"space-y-2",children:[u.jsx("label",{className:"text-xs font-bold text-white/40 uppercase tracking-widest ml-1",children:"Execution Log"}),u.jsx("div",{className:"bg-black/80 rounded-xl border border-white/5 p-4 h-48 overflow-y-auto font-mono text-[10px] leading-relaxed relative",children:a.length===0?u.jsxs("div",{className:"text-white/20 italic flex flex-col items-center justify-center h-full gap-2",children:[u.jsx(zi,{size:24,className:"opacity-10"}),"Ready to process..."]}):u.jsxs("div",{className:"space-y-1",children:[a.map((b,w)=>u.jsxs("div",{className:"flex gap-2",children:[u.jsx("span",{className:"text-white/10 select-none",children:(w+1).toString().padStart(3,"0")}),u.jsx("span",{className:`
|
|
140
|
+
${b.includes("✅")||b.includes("SUCCESS")?"text-success":""}
|
|
141
|
+
${b.includes("❌")||b.includes("Error")?"text-error":""}
|
|
142
|
+
${b.includes("🚀")||b.includes("Starting")?"text-primary font-bold":""}
|
|
143
|
+
${!b.includes("✅")&&!b.includes("❌")&&!b.includes("🚀")?"text-white/70":""}
|
|
144
|
+
`,children:b})]},w)),u.jsx("div",{ref:y})]})})]})]}),u.jsxs("div",{className:"px-6 py-4 bg-white/[0.02] border-t border-white/5 flex items-center gap-3",children:[u.jsx("div",{className:"text-warning",children:u.jsx(Bh,{size:16})}),u.jsx("p",{className:"text-[10px] text-white/40 leading-tight",children:"Migration will apply cumulative schema updates to your Supabase instance. Do not close this window during execution."})]})]})}):null}class kz{audioContext=null;enabled=!0;constructor(){}getAudioContext(){return this.audioContext||(this.audioContext=new(window.AudioContext||window.webkitAudioContext)),this.audioContext}setEnabled(t){this.enabled=t}isEnabled(){return this.enabled}playTone(t,n,r=.3){if(this.enabled)try{const s=this.getAudioContext(),o=s.createOscillator(),a=s.createGain();o.connect(a),a.connect(s.destination),o.frequency.value=t,o.type="sine",a.gain.setValueAtTime(r,s.currentTime),a.gain.exponentialRampToValueAtTime(.01,s.currentTime+n),o.start(s.currentTime),o.stop(s.currentTime+n)}catch(s){console.warn("[Sound] Failed to play tone:",s)}}playSequence(t,n=.3){if(!this.enabled)return;let r=0;t.forEach(s=>{setTimeout(()=>{this.playTone(s.freq,s.duration,n)},r),r+=s.delay})}syncStart(){this.playSequence([{freq:261.63,duration:.15,delay:0},{freq:329.63,duration:.15,delay:100},{freq:392,duration:.2,delay:100}],.2)}signalFound(){this.playSequence([{freq:392,duration:.1,delay:0},{freq:523.25,duration:.15,delay:80}],.25)}syncComplete(){this.playSequence([{freq:261.63,duration:.12,delay:0},{freq:329.63,duration:.12,delay:80},{freq:392,duration:.12,delay:80},{freq:523.25,duration:.2,delay:80}],.2)}error(){this.playSequence([{freq:329.63,duration:.15,delay:0},{freq:261.63,duration:.2,delay:100}],.3)}click(){this.playTone(440,.05,.15)}}const Vo=new kz;function Sz(){const{t:e}=Ze(),[t,n]=R.useState([]),[r,s]=R.useState([]),[o,a]=R.useState("discovery"),[c,d]=R.useState(!1),[f,p]=R.useState(null),[g,y]=R.useState(!0),[x,b]=R.useState(!b0),[w,k]=R.useState(!0),[S,E]=R.useState(!1),[j,O]=R.useState(!1),[N,T]=R.useState(null),[I,V]=R.useState(!1),[U,D]=R.useState(!1),[Z,Y]=R.useState(!1),[he,G]=R.useState(!0),[W,ne]=R.useState(()=>localStorage.getItem("theme")||"dark"),[re,J]=R.useState(null),[ce,A]=R.useState(null),[M,K]=R.useState(!1),P=R.useRef(null);R.useMemo(()=>{const Te=r.length;let Je=0,et=0,Ce=null;for(const ke of r){Je+=ke.score,ke.score>et&&(et=ke.score);const ee=new Date(ke.date);(!Ce||ee>new Date(Ce.date))&&(Ce=ke)}const gt=Te?Math.round(Je/Te):0,X=Ce?new Date(Ce.date):null;return{total:Te,average:gt,top:et,latestTimestamp:X,latestTitle:Ce?.title??Ce?.category??null}},[r]),R.useEffect(()=>{(async()=>{if(!b0){b(!0),y(!1);return}try{const{data:et,error:Ce}=await oe.from("init_state").select("is_initialized").single();Ce?(console.warn("[App] Init check error (might be fresh DB):",Ce),Ce.code==="42P01"&&k(!1)):k(et.is_initialized>0);const{data:{session:gt}}=await oe.auth.getSession();if(p(gt?.user??null),gt?.user){const X=await Xw(oe);A(X.needsMigration?X:null)}}catch(et){console.error("[App] Status check failed:",et)}finally{y(!1)}})();const{data:{subscription:Je}}=oe.auth.onAuthStateChange((et,Ce)=>{p(Ce?.user??null)});return()=>Je.unsubscribe()},[]),R.useEffect(()=>{document.documentElement.setAttribute("data-theme",W),localStorage.setItem("theme",W)},[W]);const[te,me]=R.useState({});R.useEffect(()=>{(async()=>{if(!f)return;const{data:Je}=await oe.from("alchemy_settings").select("sync_start_date, last_sync_checkpoint").eq("user_id",f.id).maybeSingle();Je&&me(Je)})()},[f,I]),R.useEffect(()=>{if(!f)return;(async()=>{const{data:et}=await oe.from("alchemy_settings").select("sound_enabled").eq("user_id",f.id).maybeSingle();if(et){const Ce=et.sound_enabled??!0;G(Ce),Vo.setEnabled(Ce)}})();const Je=oe.channel("processing_events").on("postgres_changes",{event:"INSERT",schema:"public",table:"processing_events",filter:`user_id=eq.${f.id}`},et=>{const Ce=et.new;["Completed","Stopped","Failed"].includes(Ce.agent_state)||Ce.metadata?.is_completion?(D(!1),he&&(Ce.metadata?.errors>0||Ce.agent_state==="Failed"?Vo.error():Ce.agent_state==="Completed"&&Vo.syncComplete()),Ce.agent_state==="Completed"&&setTimeout(()=>{Y(!1)},5e3),ye()):(U||D(!0),Ce.metadata?.is_start&&!U&&(Y(!0),he&&Vo.syncStart()),Ce.agent_state==="Signal"&&he&&Vo.signalFound())}).subscribe();return()=>{oe.removeChannel(Je)}},[f,U,he]),R.useEffect(()=>{const Te=new EventSource("/events");return Te.onmessage=Je=>{const et=JSON.parse(Je.data);et.type==="history"?n(Ce=>[...et.data,...Ce].slice(0,100)):n(Ce=>[et,...Ce].slice(0,100))},ye(),()=>Te.close()},[f]),R.useEffect(()=>{P.current&&P.current.scrollIntoView({behavior:"smooth"})},[t]);const ye=async()=>{try{if(f){const{data:Je,error:et}=await oe.from("signals").select("*").order("created_at",{ascending:!1});if(!et&&Je){s(Je.map(Ce=>({id:Ce.id,title:Ce.title,score:Ce.score,summary:Ce.summary,date:Ce.created_at,category:Ce.category,entities:Ce.entities})));return}}const Te=await Ye.get("/api/signals");s(Te.data)}catch(Te){console.error("Failed to fetch signals",Te)}},Fe=async()=>{d(!0),Y(!0);try{await Ye.post("/api/mine"),ye()}catch(Te){console.error("Mining failed:",Te)}finally{d(!1)}},Ae=async()=>{try{await Ye.post("/api/mine/stop")}catch(Te){console.error("[App] Failed to stop sync:",Te)}},Ie=(Te,Je)=>{Te==="logs"?(J(Je),a("logs")):a(Te)};return g?u.jsx("div",{className:"flex items-center justify-center h-screen bg-bg",children:u.jsx("div",{className:"w-12 h-12 border-4 border-primary/20 border-t-primary rounded-full animate-spin"})}):x?u.jsx(Kw,{onComplete:()=>b(!1)}):f?u.jsx(yL,{children:u.jsx(bL,{children:u.jsxs("div",{className:"flex h-screen w-screen overflow-hidden bg-bg text-fg",children:[u.jsxs(Le.aside,{animate:{width:S?72:240},className:"glass m-4 mr-0 flex flex-col relative",children:[u.jsxs("div",{className:`px-4 py-3 pb-4 flex items-center gap-3 ${S?"justify-center":""}`,children:[u.jsx("div",{className:"w-10 h-10 min-w-[40px] bg-gradient-to-br from-primary to-accent rounded-xl flex items-center justify-center shadow-lg glow-primary",children:u.jsx(Ft,{className:"text-white fill-current",size:24})}),!S&&u.jsx(Le.h1,{initial:{opacity:0},animate:{opacity:1},className:"text-xl font-bold tracking-tight",children:"Alchemist"})]}),u.jsxs("nav",{className:"flex-1 flex flex-col gap-1 px-3",children:[u.jsx(bi,{active:o==="discovery",onClick:()=>a("discovery"),icon:u.jsx(Aj,{size:20}),label:e("tabs.discovery"),collapsed:S}),u.jsx(bi,{active:o==="chat",onClick:()=>a("chat"),icon:u.jsx(qh,{size:20}),label:e("tabs.chat"),collapsed:S}),u.jsx(bi,{active:o==="transmute",onClick:()=>a("transmute"),icon:u.jsx(Ft,{size:20}),label:e("tabs.transmute"),collapsed:S}),u.jsx(bi,{active:o==="engine",onClick:()=>a("engine"),icon:u.jsx(uc,{size:20}),label:e("common.settings"),collapsed:S}),u.jsx(bi,{active:o==="logs",onClick:()=>a("logs"),icon:u.jsx(zi,{size:20}),label:e("tabs.logs"),collapsed:S}),u.jsx(bi,{active:o==="account",onClick:()=>a("account"),icon:u.jsx(Oc,{size:20}),label:e("common.account"),collapsed:S})]}),u.jsx("div",{className:"px-3 pb-2 border-t border-white/5 pt-4 mt-2 relative z-[100]",children:u.jsx("div",{className:S?"flex justify-center":"px-1",children:u.jsx(Ip,{collapsed:S,position:"top"})})}),u.jsx("div",{className:"px-3 pb-2",children:u.jsxs("button",{onClick:()=>ne(W==="dark"?"light":"dark"),className:`w-full flex items-center ${S?"justify-center":"gap-3"} px-4 py-2.5 rounded-lg text-fg/40 hover:text-fg hover:bg-surface/50 transition-all text-xs font-medium`,title:S?e(W==="dark"?"shell.switch_light":"shell.switch_dark"):"",children:[u.jsx("div",{className:"min-w-[20px] flex justify-center",children:W==="dark"?u.jsx(Bj,{size:18}):u.jsx(Ij,{size:18})}),!S&&u.jsx(Le.span,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:"whitespace-nowrap",children:e(W==="dark"?"common.light_mode":"common.dark_mode")})]})}),u.jsxs("div",{className:"px-3 pb-3",children:[u.jsx("button",{onClick:()=>E(!S),className:`w-full flex items-center px-4 py-2.5 rounded-lg text-fg/40 hover:text-fg hover:bg-surface/50 transition-all text-xs font-medium ${S?"justify-center":"gap-3"}`,children:S?u.jsx(bj,{size:20}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"min-w-[20px] flex justify-center",children:u.jsx(_j,{size:20})}),u.jsx("span",{children:e("common.collapse")})]})}),u.jsxs("button",{onClick:()=>O(!0),className:"w-full flex items-center justify-center gap-2 px-3 py-2 mt-2 text-[10px] font-mono text-fg/30 hover:text-primary hover:bg-surface/30 rounded-lg transition-all group",title:e("shell.view_changelog"),children:[!S&&u.jsxs(u.Fragment,{children:[u.jsx(Wh,{size:12,className:"group-hover:text-primary transition-colors"}),u.jsxs("span",{children:["v","1.0.76"]})]}),S&&u.jsx(Wh,{size:14,className:"group-hover:text-primary transition-colors"})]})]})]}),u.jsxs("main",{className:"flex-1 flex flex-col p-4 gap-4 overflow-hidden relative",children:[ce&&u.jsx(bz,{onOpen:()=>K(!0)}),o==="discovery"&&u.jsxs(u.Fragment,{children:[u.jsxs("header",{className:"flex justify-between items-center px-4 py-2",children:[u.jsxs("div",{children:[u.jsx("h2",{className:"text-2xl font-bold",children:e("tabs.discovery")}),u.jsx("p",{className:"text-sm text-fg/50",children:e("setup.welcome_desc")})]}),u.jsxs("div",{className:"flex gap-2",children:[u.jsxs("button",{onClick:()=>V(!0),className:"px-6 py-3 glass hover:bg-surface transition-colors flex items-center gap-2 text-sm font-medium",children:[u.jsx(uc,{size:16}),u.jsxs("div",{className:"flex flex-col items-start",children:[u.jsx("span",{children:e("discovery.sync_settings")}),u.jsx("span",{className:"text-[10px] text-fg/40 font-mono",children:te.sync_start_date?`${e("discovery.from")}: ${new Date(te.sync_start_date).toLocaleString([],{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:te.last_sync_checkpoint?`${e("discovery.checkpoint")}: ${new Date(te.last_sync_checkpoint).toLocaleString([],{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}`:e("discovery.all_time")})]})]}),u.jsxs("button",{onClick:Fe,disabled:U,className:"px-6 py-3 bg-gradient-to-r from-primary to-accent text-white font-bold rounded-xl shadow-lg glow-primary hover:scale-105 active:scale-95 transition-all flex items-center gap-2 disabled:opacity-50 disabled:cursor-not-allowed disabled:hover:scale-100",children:[u.jsx(Ds,{size:18,className:U?"animate-spin":""}),e(U?"discovery.syncing":"discovery.sync_history")]})]})]}),u.jsx(BL,{onOpenUrl:Te=>window.open(Te,"_blank","noopener,noreferrer"),onSync:Fe,isSyncing:U,onCopyText:Te=>{navigator.clipboard.writeText(Te)}})]}),o==="chat"&&u.jsx(gz,{}),o==="transmute"&&u.jsx(_z,{}),o==="engine"&&u.jsx(_L,{}),o==="account"&&u.jsx(SL,{}),o==="logs"&&u.jsx(LL,{initialState:re}),u.jsx(kL,{isExpanded:Z,onToggle:()=>Y(!Z),onNavigate:Ie,liftUp:o==="chat",isSyncing:U,onStop:Ae})]}),u.jsx(NL,{signal:N,onClose:()=>T(null)}),u.jsx(TL,{isOpen:I,onClose:()=>V(!1)}),u.jsx(yz,{isOpen:j,onClose:()=>O(!1)}),u.jsx(wz,{isOpen:M,onClose:()=>K(!1),status:ce})]})})}):u.jsx(fL,{onAuthSuccess:()=>ye(),isInitialized:w})}function bi({active:e,icon:t,label:n,onClick:r,collapsed:s}){return u.jsx("button",{onClick:r,title:s?n:"",className:`w-full flex items-center ${s?"justify-center":"gap-3"} px-4 py-3 rounded-xl transition-all ${e?"bg-primary/10 text-primary shadow-sm":"text-fg/60 hover:bg-surface hover:text-fg"}`,children:s?ia.cloneElement(t,{className:e?"text-primary":""}):u.jsxs(u.Fragment,{children:[u.jsx("div",{className:"min-w-[20px] flex justify-center",children:ia.cloneElement(t,{className:e?"text-primary":""})}),u.jsx(Le.span,{initial:{opacity:0,x:-10},animate:{opacity:1,x:0},className:"font-semibold text-sm whitespace-nowrap",children:n})]})})}function jz(){Ye.interceptors.request.use(async e=>{try{const{data:{session:t}}=await oe.auth.getSession();t?.access_token&&(e.headers.Authorization=`Bearer ${t.access_token}`);const n=Zr();n&&(e.headers["x-supabase-url"]=n.url,e.headers["x-supabase-key"]=n.anonKey)}catch(t){console.error("[Axios] Error injecting headers:",t)}return e})}const{slice:Ez,forEach:Cz}=[];function Nz(e){return Cz.call(Ez.call(arguments,1),t=>{if(t)for(const n in t)e[n]===void 0&&(e[n]=t[n])}),e}function Tz(e){return typeof e!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(e))}const h_=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,Az=function(e,t){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(t);let o=`${e}=${s}`;if(r.maxAge>0){const a=r.maxAge-0;if(Number.isNaN(a))throw new Error("maxAge should be a Number");o+=`; Max-Age=${Math.floor(a)}`}if(r.domain){if(!h_.test(r.domain))throw new TypeError("option domain is invalid");o+=`; Domain=${r.domain}`}if(r.path){if(!h_.test(r.path))throw new TypeError("option path is invalid");o+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");o+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(o+="; HttpOnly"),r.secure&&(o+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:o+="; SameSite=Strict";break;case"lax":o+="; SameSite=Lax";break;case"strict":o+="; SameSite=Strict";break;case"none":o+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(o+="; Partitioned"),o},f_={create(e,t,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=Az(e,t,s)},read(e){const t=`${e}=`,n=document.cookie.split(";");for(let r=0;r<n.length;r++){let s=n[r];for(;s.charAt(0)===" ";)s=s.substring(1,s.length);if(s.indexOf(t)===0)return s.substring(t.length,s.length)}return null},remove(e,t){this.create(e,"",-1,t)}};var Rz={name:"cookie",lookup(e){let{lookupCookie:t}=e;if(t&&typeof document<"u")return f_.read(t)||void 0},cacheUserLanguage(e,t){let{lookupCookie:n,cookieMinutes:r,cookieDomain:s,cookieOptions:o}=t;n&&typeof document<"u"&&f_.create(n,e,r,s,o)}},Pz={name:"querystring",lookup(e){let{lookupQuerystring:t}=e,n;if(typeof window<"u"){let{search:r}=window.location;!window.location.search&&window.location.hash?.indexOf("?")>-1&&(r=window.location.hash.substring(window.location.hash.indexOf("?")));const o=r.substring(1).split("&");for(let a=0;a<o.length;a++){const c=o[a].indexOf("=");c>0&&o[a].substring(0,c)===t&&(n=o[a].substring(c+1))}}return n}},Oz={name:"hash",lookup(e){let{lookupHash:t,lookupFromHashIndex:n}=e,r;if(typeof window<"u"){const{hash:s}=window.location;if(s&&s.length>2){const o=s.substring(1);if(t){const a=o.split("&");for(let c=0;c<a.length;c++){const d=a[c].indexOf("=");d>0&&a[c].substring(0,d)===t&&(r=a[c].substring(d+1))}}if(r)return r;if(!r&&n>-1){const a=s.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?a[typeof n=="number"?n:0]?.replace("/",""):void 0}}}return r}};let wi=null;const p_=()=>{if(wi!==null)return wi;try{if(wi=typeof window<"u"&&window.localStorage!==null,!wi)return!1;const e="i18next.translate.boo";window.localStorage.setItem(e,"foo"),window.localStorage.removeItem(e)}catch{wi=!1}return wi};var Lz={name:"localStorage",lookup(e){let{lookupLocalStorage:t}=e;if(t&&p_())return window.localStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupLocalStorage:n}=t;n&&p_()&&window.localStorage.setItem(n,e)}};let ki=null;const m_=()=>{if(ki!==null)return ki;try{if(ki=typeof window<"u"&&window.sessionStorage!==null,!ki)return!1;const e="i18next.translate.boo";window.sessionStorage.setItem(e,"foo"),window.sessionStorage.removeItem(e)}catch{ki=!1}return ki};var Iz={name:"sessionStorage",lookup(e){let{lookupSessionStorage:t}=e;if(t&&m_())return window.sessionStorage.getItem(t)||void 0},cacheUserLanguage(e,t){let{lookupSessionStorage:n}=t;n&&m_()&&window.sessionStorage.setItem(n,e)}},Dz={name:"navigator",lookup(e){const t=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let o=0;o<n.length;o++)t.push(n[o]);r&&t.push(r),s&&t.push(s)}return t.length>0?t:void 0}},Mz={name:"htmlTag",lookup(e){let{htmlTag:t}=e,n;const r=t||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},zz={name:"path",lookup(e){let{lookupFromPathIndex:t}=e;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?n[typeof t=="number"?t:0]?.replace("/",""):void 0}},Fz={name:"subdomain",lookup(e){let{lookupFromSubdomainIndex:t}=e;const n=typeof t=="number"?t+1:1,r=typeof window<"u"&&window.location?.hostname?.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i);if(r)return r[n]}};let r1=!1;try{document.cookie,r1=!0}catch{}const s1=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];r1||s1.splice(1,1);const $z=()=>({order:s1,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:e=>e});class i1{constructor(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(t,n)}init(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=t,this.options=Nz(n,this.options||{},$z()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(Rz),this.addDetector(Pz),this.addDetector(Lz),this.addDetector(Iz),this.addDetector(Dz),this.addDetector(Mz),this.addDetector(zz),this.addDetector(Fz),this.addDetector(Oz)}addDetector(t){return this.detectors[t.name]=t,this}detect(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return t.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!Tz(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(t)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(t,this.options)}))}}i1.type="languageDetector";const Uz={save:"Save",cancel:"Cancel",loading:"Loading...",error:"Error",success:"Success",settings:"Settings",search:"Search",back:"Back",all:"All",delete:"Delete",update:"Update",edit:"Edit",close:"Close",complete:"Complete",skip:"Skip",begin:"Begin",connection:"Connection",setup:"Setup",project:"Project",account:"Account",logout:"Logout",welcome:"Welcome",dark_mode:"Dark Mode",light_mode:"Light Mode",collapse:"Collapse",just_now:"Just now",enabled:"Enabled",disabled:"Disabled",quick:"Quick (5)",balanced:"Balanced (50)",thorough:"Thorough (200)",resetting:"Resetting...",saving:"Saving...",locale_code:"en-US",categories:{ai_ml:"AI & ML",business:"Business",politics:"Politics",technology:"Technology",finance:"Finance",crypto:"Crypto",science:"Science",other:"Other"}},Bz={discovery:"Discovery",chat:"Chat",transmute:"Transmute",logs:"System Logs",history:"History"},Vz={welcome_title:"Assemble Your Engine",welcome_desc:"Alchemy requires a Supabase essence to store signal fragments and intelligence patterns.",requirements:"Requirements:",project_url:"Supabase Project URL",anon_key:"Anon Public API Key",db_password:"Database Password",project_url_placeholder:"https://xxx.supabase.co or project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"BEGIN INITIALIZATION",connect_essence:"CONNECT ESSENCE",credentials_title:"Essence Coordinates",credentials_desc:"Link the alchemist engine to your cloud database",validating:"Validating Link",resonance:"Synchronizing Resonance...",init_schema:"Initialize Schema",schema_desc:"Run database migrations to set up required tables and functions.",project_id:"Project ID",access_token:"Access Token",run_migrations:"RUN MIGRATIONS",running_migrations:"Running Migrations",take_minute:"This may take a minute...",engine_aligned:"Engine Aligned",restarting:"Restarting Alchemist Subsystems...",forge_project:"Forge Project at Supabase",project_id_help:"Found in Supabase Dashboard → Project Settings → General",access_token_help:"Generate at",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"Project ID is required",access_token_required:"Access token is required",migration_failed_logs:"Migration failed. Check logs for details.",stream_error:"Failed to read migration stream",back:"BACK",retry:"RETRY",choose_setup_path:"Choose Setup Path",forge_how:"how do you want to forge your engine?",quick_launch:"Quick Launch",quick_launch_desc:"Auto-create Supabase project for me (requires Access Token)",manual_connection:"Manual Connection",manual_connection_desc:"link with an existing project (requires url & anon key)",quick_provision_desc:"provide your access token to auto-provision everything",get_token:"GET TOKEN",project_name:"Project Name",project_name_placeholder:"e.g. My Alchemy Engine",organization:"Organization",region:"Region",launch_engine:"Launch Engine",provisioning_forge:"Provisioning Forge",building_instance:"building your private supabase instance...",regions:{"us-east-1":"US East (N. Virginia)","us-west-1":"US West (N. California)","eu-central-1":"Europe (Frankfurt)","eu-west-2":"Europe (London)","ap-southeast-1":"Asia Pacific (Singapore)","ap-southeast-2":"Asia Pacific (Sydney)","sa-east-1":"South America (São Paulo)"}},qz={title_init:"INITIALIZE MASTER",title_join:"JOIN THE CIRCLE",title_mystic:"MYSTIC ACCESS",title_login:"ALCHEMIST LOGIN",desc_init:"Forge the prime alchemist account",desc_mystic_email:"Enter your essence email",desc_mystic_code:"Transmute the sacred code",desc_login:"Transmute your data into intelligence",first_name:"First Name",last_name:"Last Name",first_name_placeholder:"Zosimos",last_name_placeholder:"Panopolis",email_address:"Email Address",email_placeholder:"alchemist@example.com",complexity_key:"Complexity Key",password_placeholder:"••••••••",init_account:"INITIALIZE ACCOUNT",send_code:"SEND CODE",unseal_engine:"UNSEAL ENGINE",verify_code:"VERIFY CODE",change_email:"Change email address",sign_in_code:"Sign in with Code",sign_in_password:"Sign in with Password",already_alchemist:"Already an Alchemist?",new_to_alchemy:"New to Alchemy?",login_instead:"Login instead",create_account:"Create an account",session_failed:"Failed to create session",invalid_code:"Invalid code"},Hz={filters:"Filters",category:"Category",intelligence_score:"Intelligence Score",no_signals_in_category:"No signals in {{category}} yet.",no_categories:"No categories yet.",discovery_hint:"Signals will be organized here once discovered.",loading_signals:"Loading signals...",dismiss_hint:"Dismiss (Not Interested)",signal_count_one:"{{count}} signal",signal_count_other:"{{count}} signals",time_min_ago:"{{count}}m ago",time_hour_ago:"{{count}}h ago",time_day_ago:"{{count}}d ago",add_note_title:"Add Note",target:"Target",note_placeholder:"Enter your thoughts, ideas, or action items regarding this signal...",save_note:"Save Note",view_all_sources:"View all sources",source_count_one:"{{count}} source",source_count_other:"{{count}} sources",source_found_in:"Found in {{count}} different sources",high_confidence:"High confidence - found in {{count}} sources",new_signals:"New Signals",smart_summary:"Smart Summary",entities:"Entities",sources:"Sources",last_sync:"Last Sync",syncnow:"Sync Now",all_time:"All time",checkpoint:"Checkpoint",from:"From",score_high:"HIGH",score_medium:"MEDIUM",score_low:"LOW",sources_count:"{{count}} sources",open_source:"Open",add_note:"Note",boost_topic:"Boost Topic",boosted:"Boosted",dismissed:"Dismissed",remove_favourite:"Remove from favourites",add_favourite:"Add to favourites",sync_history:"Sync History",syncing:"Syncing...",sync_settings:"Sync Settings",discovered:"Discovered",original_source:"Original Source",ai_summary:"AI Summary",full_content:"Full Content",copied:"Copied!",open_link:"Open",detail_title:"Signal Details",sync_from:"Sync From (Optional)",urls_per_sync:"URLs per Sync",sync_from_hint:"Leave empty to sync only new URLs since last sync (incremental). Set a date to process URLs from that point forward.",reset_checkpoint:"Reset Checkpoint",reset_checkpoint_hint:'Clear the sync checkpoint to force a full re-sync from your "Sync From" date',sync_info:'The Alchemist tracks your progress automatically. Use "Sync From" to backfill history or "Reset Checkpoint" to start fresh.',save_settings:"Save Settings",sync_saved:"Sync settings saved successfully",checkpoint_reset:"Checkpoint reset successfully",login_to_save:"Please log in to save settings",login_to_reset:"Please log in to reset checkpoint",status_updated:"Engine status updated to {{status}}",asset_ready:'Asset "{{title}}" is ready!',scanning:"Scanning for new categories and topics...",discovery_complete:"Engine discovery complete!",discovery_failed:"Discovery failed. Check settings.",welcome_title:"Welcome to Alchemist!",welcome_desc:"Connect your browser history to start discovering signals. We'll automatically analyze your visited pages to find mentions of AI, tech, and more.",auto_detect_sync:"Auto-detect & Sync",privacy_first:"Privacy First",offline_first:"Offline First",load_failed:"Failed to load engines",starting_run:"Starting engine run...",run_complete:"Engine run complete! Created: {{title}}",run_started_desktop:"Engine run started on Desktop. Tracking as: {{id}}",run_failed:"Failed to run engine",brief_failed:"Failed to generate production brief",topic:"Topic",pipeline:"Pipeline"},Kz={history:"History",ask_anything:"Ask anything about your browsing history...",sources:"Sources",processing:"Processing your query...",new_chat:"New Chat",no_messages:"No messages yet. Start a conversation!",no_history:"No chat history yet.",title:"Ask Alchemist",desc:"I can help you recall information, summarize topics, and find insights from your browsing history.",thinking:"Exploring memory...",placeholder:"Ask about your history...",error_message:"Sorry, I encountered an error processing your request.",relevant_context:"Relevant Context",match_score:"{{score}}% Match",rag_attribution:"Alchemist used these {{count}} signals to answer",suggestions:{react:"What have I read about React recently?",ai:"Summarize the latest AI news I visited.",finance:"Do I have any notes on Finance?",performance:"Find articles about 'Performance'"}},Wz={engines:"Alchemist Engines",assets:"Generated Assets",newsletter:"Newsletter",thread:"Thread",audio:"Audio",report:"Report",title:"Transmute Engine",desc:"Active Generation Pipelines & Assets",generate:"Generate",processing_desktop:"Processing on Desktop...",ensure_defaults:"Ensure Default Engines",create_engine:"Create Engine",no_assets:"No assets generated yet.",generate_engines:"Generate Engines",new_engine:"New Engine",no_engines:"No Engines Configured",no_engines_desc:"Create your first pipeline to automatically turn signals into newsletters, threads, or audio briefs.",run_engine:"Run Engine",running:"Running...",last_run:"Last Run",never:"Never",schedule:"Schedule",manual:"Manual",topic:"Topic",pipeline:"Pipeline",pause:"Pause",resume:"Resume",view_json:"View Production Brief JSON",json_contract:"Stateless & Self-Contained Contract",json_desc:"This JSON contains the full context (Signals + User Persona) required for the Desktop Studio.",generating_asset:"Generating Asset...",queued_desktop:"Queued for Desktop...",desktop_processing:"The RealTimeX Desktop app is processing this request. This modal will update automatically once finished.",unsupported_type:"Unsupported asset type",edit_engine:"Edit Engine",engine_name:"Engine Name",type:"Type",status:"Status",execution_env:"Execution Environment",local_llm:"Local (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (Agent Swarm)",env_desc_desktop:"Delegates heavy tasks like Audio/Video to the desktop app.",env_desc_local:"Runs simple Markdown tasks directly in Alchemy.",min_score:"Min Score",max_signals:"Max Signals",category_filter:"Category Filter (multi-select)",multi_select_hint:"Hold Cmd/Ctrl to select multiple categories",schedule_hint:"Note: Scheduling is not yet automated",prompt_override:"Custom Prompt Override (optional)",prompt_placeholder:"Override the default prompt for this engine type...",delete_confirm:"Really delete?",confirm:"Confirm",copied_json:"JSON copied to clipboard",json_footer:"This JSON contains the full context (Signals + User Persona) required for the Desktop Studio."},Gz={title:"Account Configuration",desc:"Manage your Alchemist profile and essence links.",profile:"Profile",security:"Security",supabase:"Supabase",first_name:"First Name",last_name:"Last Name",email_locked:"Email Address (Locked)",sound_effects:"Sound Effects",sound_desc:"Enable audio feedback for sync events and signal discoveries.",sign_out:"Sign Out",logout_desc:"End your current session and return to the login screen.",preserve_profile:"Preserve Profile",security_title:"Update Entropy Key",new_password:"New Password",confirm_password:"Confirm Password",password_mismatch:"Complexity keys do not match.",password_too_short:"Entropy too low. Minimum 8 characters.",password_rotate_success:"Key rotation successful.",rotate_key:"Rotate Key",essence_resonance:"Essence Resonance",byok_desc:"Bring Your Own Keys (BYOK) for intelligence persistence.",established_link:"Established Link",env_notice:"Active from environment variables. UI override enabled.",realign_link:"Realign Link",sever_link:"Sever Link",sever_confirm:"Sever connection to this essence? This will reset local resonance.",anon_secret_fragment:"Anon Secret Fragment",no_resonance:"No Essence Resonance",no_resonance_desc:"The Alchemist requires a cloud core to store intelligence fragments.",initiate_link:"Initiate Link",test_connection:"Test Connection"},Jz={title:"System Logs",desc:"Detailed history of sync runs, sources, and URL processing",blacklist_suggestion:"Potential Blacklist",blacklist_desc:"Candidates for blocking",recent_errors:"Recent Errors",errors_desc:"Failed URL processes",total_signals:"Total Signals",signals_desc:"Successfully mined",blacklist_modal_title:"Blacklist Suggestions",blacklist_modal_desc:"Review domains suggested for blacklisting based on low scores.",no_suggestions:"No suggestions right now",quality_good:"Your signal quality looks good!",signals_count:"{{count}} signals",avg_score:"Avg Score: {{score}}",low_quality:"Consistently Low Quality",repetitive:"Repetitive Pattern",blacklist_domain:"Blacklist Domain",errors_modal_title:"Recent Errors",errors_modal_desc:"Log of recent failures and issues.",no_recent_errors:"No recent errors found.",signals_modal_title:"Found Signals",signals_modal_desc:"Browse and manage your mined signals history.",search_placeholder:"Search signals...",any_score:"Any Score",high_score:"High (80%+)",medium_score:"Medium (50-79%)",low_score:"Low (<50%)",all_categories:"All Categories",page_x:"Page {{page}}"},Xz={title:"Alchemist Engine",live:"LIVE",clear:"Clear",idle:"Idle. Awaiting signal mining events...",run_completed:"Mining Run Completed",signals:"Signals",urls:"URLs",skipped:"Skipped",failed_to_process:"{{count}} URLs failed to process",view_logs:"View Logs",hide_details:"Hide Details",view_details:"View Details",engine_log:"Live Engine Log",stop_sync:"Stop Sync",state_reading:"Reading",state_thinking:"Thinking",state_signal:"Signal",state_skipped:"Skipped",state_error:"Error",state_completed:"Completed",msg_reading:"Reading content from: {{url}}",msg_thinking:"Analyzing relevance of: {{title}}",msg_found_signal:"Found signal: {{summary}} ({{score}}%)",msg_low_signal:"Low signal stored for review ({{score}}%): {{title}}",msg_failed:"Analysis failed for {{title}}: {{error}}",msg_sync_completed:"Sync completed: {{signals}} signals found, {{skipped}} skipped, {{errors}} errors"},Yz={switch_light:"Switch to Light Mode",switch_dark:"Switch to Dark Mode",view_changelog:"View Changelog",release_notes:"Release Notes",changelog_error:"Failed to load changelog."},Qz={title:"Signal Pulse",mining:"Mining",standing_by:"Standing by",idle:"Idle",tracked:"Signals tracked",avg_score:"Average score",top_signal:"Top signal",latest:"Latest",awaiting:"Awaiting mining",no_signals:"No signals yet"},Zz={title:"Intelligence Engine",subtitle:"Fine-tune the Alchemist's cognitive parameters and provider links.",configuration:"AI Configuration",test_connection:"Test Connection",save_config:"Save Configuration",llm_provider:"LLM Provider",embedding_provider:"Embedding Provider",sdk_connected:"SDK Connected",sdk_not_available:"SDK Not Available",provider:"Provider",intelligence_model:"Intelligence Model",embedding_model:"Embedding Model",loading_providers:"Loading providers...",sdk_info_success:"✓ Using RealTimeX configured provider",sdk_info_fail:"⚠️ RealTimeX SDK not detected. Configure in RealTimeX Desktop.",embedding_info_success:"✓ Embeddings are generated using your RealTimeX configured provider",embedding_info_fail:"⚠️ RealTimeX SDK not detected. Configure providers in RealTimeX Desktop.",persona_title:"Persona Memory",save_memory:"Save Memory",interests_title:"Active Interests",interests_priority:"High Priority",interests_desc:"The Alchemist prioritizes content matching these topics. Updated automatically based on Favorites & Boosts.",interests_placeholder:"e.g. User focuses on React performance, Rust backend systems, and AI Agent architecture...",antipatterns_title:"Anti-Patterns",antipatterns_priority:"Avoid",antipatterns_desc:"The Alchemist filters out or scores down content matching these patterns. Updated via Dismissals.",antipatterns_placeholder:"e.g. Dislikes marketing fluff, generic listicles, and crypto hype...",browser_sources:"Browser History Sources",save_browser:"Save Browser Sources",blacklist_title:"Blacklist Domains",blacklist_desc:"URLs containing these patterns will be skipped during mining. Enter one pattern per line.",blacklist_label:"Domain Patterns (one per line)",blacklist_placeholder:`google.com/search
|
|
145
|
+
localhost:
|
|
146
|
+
127.0.0.1
|
|
147
|
+
facebook.com
|
|
148
|
+
twitter.com
|
|
149
|
+
instagram.com
|
|
150
|
+
linkedin.com/feed`,blacklist_examples:"Examples: google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"Save Blacklist",blocked_tags_title:"Blocked Tags",blocked_tags_desc:"Signals with these tags will be excluded from dynamic category generation and newsletters. Enter one tag per line.",blocked_tags_label:"Tags (separated by semicolon)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"You have full control. These tags will completely replace the system defaults.",save_blocked_tags:"Save Blocked Tags",save_error_login:"Please log in to save settings",save_error_persona:"Please log in to save persona",save_success_llm:"LLM settings saved successfully",save_success_browser:"Browser sources saved successfully",save_success_blacklist:"Blacklist updated successfully",save_success_tags:"Blocked tags updated successfully",save_success_persona:"Persona updated successfully",test_success:"Connection successful! {{model}}",test_fail:"Connection failed: {{message}}",auto_detect_title:"Auto-Detect Browsers",scan_system:"Scan System",scanning:"Scanning...",auto_detected:"Auto-detected",custom:"Custom",add_source:"Add Source",already_added:"Already Added",not_found:"Not found on this system",add_custom_path:"Add Custom Path",custom_path_placeholder:"/path/to/browser/History",add_custom_source:"Add Custom Source",validating:"Validating...",configured_sources:"Configured Sources ({{count}})",enabled:"Enabled",disabled:"Disabled",invalid_path:"Invalid path: {{error}}",validation_failed:"Failed to validate path",discovered_sources:"Discovered {{count}} browser sources",no_sources_found:"No browser sources found",auto_discover_sources:"Auto-discover Sources",auto_discover_hint:"Automatically find history paths for all browser profiles."},eF={common:Uz,tabs:Bz,setup:Vz,auth:qz,discovery:Hz,chat:Kz,transmute:Wz,account:Gz,logs:Jz,terminal:Xz,shell:Yz,stats:Qz,engine:Zz},tF={save:"Enregistrer",cancel:"Annuler",loading:"Chargement...",error:"Erreur",success:"Succès",settings:"Paramètres",search:"Rechercher",back:"Retour",all:"Tout",delete:"Supprimer",update:"Mettre à jour",edit:"Modifier",close:"Fermer",complete:"Terminer",skip:"Passer",begin:"Commencer",connection:"Connexion",setup:"Configuration",project:"Projet",account:"Compte",logout:"Déconnexion",welcome:"Bienvenue",dark_mode:"Mode Sombre",light_mode:"Mode Clair",collapse:"Réduire",just_now:"À l'instant",enabled:"Activé",disabled:"Désactivé",quick:"Rapide (5)",balanced:"Équilibré (50)",thorough:"Complet (200)",resetting:"Réinitialisation...",saving:"Enregistrement...",locale_code:"fr-FR",categories:{ai_ml:"IA & ML",business:"Affaires",politics:"Politique",technology:"Technologie",finance:"Finance",crypto:"Crypto",science:"Science",other:"Autre"}},nF={discovery:"Découverte",chat:"Chat",transmute:"Transmuter",logs:"Journaux système",history:"Historique"},rF={welcome_title:"Assemblez votre moteur",welcome_desc:"Alchemy nécessite une essence Supabase pour stocker les fragments de signaux et les modèles d'intelligence.",requirements:"Prérequis :",project_url:"URL du projet Supabase",anon_key:"Clé API publique anonyme",db_password:"Mot de passe de la base de données",project_url_placeholder:"https://xxx.supabase.co ou project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"COMMENCER L'INITIALISATION",connect_essence:"CONNECTER L'ESSENCE",credentials_title:"Coordonnées de l'Essence",credentials_desc:"Reliez le moteur alchimique à votre base de données cloud",validating:"Validation du lien",resonance:"Synchronisation de la résonance...",init_schema:"Initialiser le schéma",schema_desc:"Exécutez les migrations de base de données pour configurer les tables et fonctions requises.",project_id:"ID du projet",access_token:"Jeton d'accès",run_migrations:"EXÉCUTER LES MIGRATIONS",running_migrations:"Exécution des migrations",take_minute:"Cela peut prendre une minute...",engine_aligned:"Moteur aligné",restarting:"Redémarrage des sous-systèmes Alchemist...",forge_project:"Forger un projet sur Supabase",project_id_help:"Trouvé dans le tableau de bord Supabase → Paramètres du projet → Général",access_token_help:"Générer sur",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"L'ID du projet est requis",access_token_required:"Le jeton d'accès est requis",migration_failed_logs:"Échec de la migration. Consultez les journaux pour plus de détails.",stream_error:"Échec de la lecture du flux de migration",back:"RETOUR",retry:"RÉESSAYER",choose_setup_path:"Choisir le Chemin de Configuration",forge_how:"comment voulez-vous forger votre moteur?",quick_launch:"Lancement Rapide",quick_launch_desc:"Créer automatiquement un projet Supabase pour moi (nécessite un jeton d'accès)",manual_connection:"Connexion Manuelle",manual_connection_desc:"lier avec un projet existant (nécessite url & clé anon)",quick_provision_desc:"fournissez votre jeton d'accès pour tout provisionner automatiquement",get_token:"OBTENIR LE JETON",project_name:"Nom du Projet",project_name_placeholder:"ex: Mon Moteur Alchemy",organization:"Organisation",region:"Région",launch_engine:"Lancer le Moteur",provisioning_forge:"Forge de Provisionnement",building_instance:"construction de votre instance supabase privée...",regions:{"us-east-1":"États-Unis Est (N. Virginie)","us-west-1":"États-Unis Ouest (N. Californie)","eu-central-1":"Europe (Francfort)","eu-west-2":"Europe (Londres)","ap-southeast-1":"Asie-Pacifique (Singapour)","ap-southeast-2":"Asie-Pacifique (Sydney)","sa-east-1":"Amérique du Sud (São Paulo)"}},sF={title_init:"INITIALISER LE MAÎTRE",title_join:"REJOINDRE LE CERCLE",title_mystic:"ACCÈS MYSTIQUE",title_login:"CONNEXION ALCHIMISTE",desc_init:"Forger le compte principal d'alchimiste",desc_mystic_email:"Entrez votre e-mail d'essence",desc_mystic_code:"Transmuter le code sacré",desc_login:"Transmuter vos données en intelligence",first_name:"Prénom",last_name:"Nom",first_name_placeholder:"Zosime",last_name_placeholder:"Panopolis",email_address:"Adresse e-mail",email_placeholder:"alchimiste@exemple.com",complexity_key:"Clé de complexité",password_placeholder:"••••••••",init_account:"INITIALISER LE COMPTE",send_code:"ENVOYER LE CODE",unseal_engine:"DÉSCELLER LE MOTEUR",verify_code:"VÉRIFIER LE CODE",change_email:"Modifier l'adresse e-mail",sign_in_code:"Se connecter avec un code",sign_in_password:"Se connecter avec un mot de passe",already_alchemist:"Déjà alchimiste ?",new_to_alchemy:"Nouveau sur Alchemy ?",login_instead:"Se connecter plutôt",create_account:"Créer un compte",session_failed:"Échec de la création de la session",invalid_code:"Code invalide"},iF={filters:"Filtres",category:"Catégorie",intelligence_score:"Score d'intelligence",no_signals_in_category:"Pas encore de signaux dans {{category}}.",no_categories:"Aucune catégorie pour le moment.",discovery_hint:"Les signaux seront organisés ici une fois découverts.",loading_signals:"Chargement des signaux...",dismiss_hint:"Ignorer (Pas intéressé)",signal_count_one:"{{count}} signal",signal_count_other:"{{count}} signaux",time_min_ago:"Il y a {{count}}m",time_hour_ago:"Il y a {{count}}h",time_day_ago:"Il y a {{count}}j",add_note_title:"Ajouter une note",target:"Cible",note_placeholder:"Entrez vos pensées, idées ou points d'action concernant ce signal...",save_note:"Enregistrer la note",view_all_sources:"Voir toutes les sources",source_count_one:"{{count}} source",source_count_other:"{{count}} sources",source_found_in:"Trouvé dans {{count}} sources différentes",high_confidence:"Haute confiance - trouvé dans {{count}} sources",new_signals:"Nouveaux signaux",smart_summary:"Résumé intelligent",entities:"Entités",sources:"Sources",last_sync:"Dernière synchro",syncnow:"Synchro maintenant",all_time:"Tout le temps",checkpoint:"Point de contrôle",from:"De",score_high:"ÉLEVÉ",score_medium:"MOYEN",score_low:"FAIBLE",sources_count:"{{count}} sources",open_source:"Ouvrir",add_note:"Note",boost_topic:"Booster",boosted:"Boosté",dismissed:"Ignoré",remove_favourite:"Retirer des favoris",add_favourite:"Ajouter aux favoris",sync_history:"Sync Historique",syncing:"Synchronisation...",sync_settings:"Paramètres de Sync",discovered:"Découvert",original_source:"Source originale",ai_summary:"Résumé IA",full_content:"Contenu complet",copied:"Copié !",open_link:"Ouvrir",detail_title:"Détails du Signal",sync_from:"Synchroniser depuis (Optionnel)",urls_per_sync:"URLs par synchronisation",sync_from_hint:"Laissez vide pour synchroniser uniquement les nouveaux URLs depuis la dernière synchronisation. Définissez une date pour traiter les URLs à partir de ce moment.",reset_checkpoint:"Réinitialiser le point de contrôle",reset_checkpoint_hint:"Effacer le point de contrôle de synchronisation pour forcer une resynchronisation complète à partir de votre date de début.",sync_info:`L'Alchimiste suit automatiquement votre progression. Utilisez "Synchroniser depuis" pour remplir l'historique ou "Réinitialiser le point de contrôle" pour recommencer à zéro.`,save_settings:"Enregistrer les paramètres",sync_saved:"Paramètres de synchronisation enregistrés",checkpoint_reset:"Point de contrôle réinitialisé",login_to_save:"Veuillez vous connecter pour enregistrer les paramètres",login_to_reset:"Veuillez vous connecter pour réinitialiser le point de contrôle",status_updated:"Statut de l'engin mis à jour en {{status}}",asset_ready:`L'atout "{{title}}" est prêt !`,scanning:"Recherche de nouvelles catégories et sujets...",discovery_complete:"Découverte de l'engin terminée !",discovery_failed:"Échec de la découverte. Vérifiez les paramètres.",welcome_title:"Bienvenue dans Alchemist !",welcome_desc:"Connectez votre historique de navigation pour commencer à découvrir des signaux. Nous analyserons automatiquement vos pages visitées pour trouver des mentions d'IA, de technologie et plus encore.",auto_detect_sync:"Détecter automatiquement et synchroniser",privacy_first:"Confidentialité d'abord",offline_first:"Hors ligne d'abord",load_failed:"Échec du chargement des engins",starting_run:"Lancement de l'exécution de l'engin...",run_complete:"Exécution de l'engin terminée ! Créé : {{title}}",run_started_desktop:"Exécution de l'engin démarrée sur le bureau. Suivi sous : {{id}}",run_failed:"Échec de l'exécution de l'engin",brief_failed:"Échec de la génération du brief de production",topic:"Sujet",pipeline:"Pipeline"},oF={history:"Historique",ask_anything:"Demandez n'importe quoi sur votre historique de navigation...",sources:"Sources",processing:"Traitement de votre demande...",new_chat:"Nouveau Chat",no_messages:"Aucun message pour l'instant. Commencez une conversation !",no_history:"Aucun historique de chat pour l'instant.",title:"Demander à l'Alchimiste",desc:"Je peux vous aider à vous souvenir d'informations, à résumer des sujets và trouver des idées dans votre historique de navigation.",thinking:"Exploration de la mémoire...",placeholder:"Posez une question sur votre historique...",error_message:"Désolé, j'ai rencontré une erreur lors du traitement de votre demande.",relevant_context:"Contexte pertinent",match_score:"{{score}}% de correspondance",rag_attribution:"L'Alchimiste a utilisé ces {{count}} signaux pour répondre",suggestions:{react:"Qu'ai-je lu sur React récemment ?",ai:"Résume les dernières nouvelles sur l'IA que j'ai consultées.",finance:"Ai-je des notes sur la finance ?",performance:"Trouve des articles sur la 'Performance'"}},aF={engines:"Moteurs Alchemist",assets:"Actifs générés",newsletter:"Bulletin",thread:"Fil de discussion",generate:"Générer",processing_desktop:"Traitement sur le bureau...",ensure_defaults:"Assurer les moteurs par défaut",create_engine:"Créer le moteur",no_assets:"Aucun actif n'a été généré.",title:"Moteur de Transmutation",desc:"Pipelines de génération active et actifs",generate_engines:"Générer les moteurs",new_engine:"Nouveau moteur",no_engines:"Aucun moteur configuré",no_engines_desc:"Créez votre premier pipeline pour transformer automatiquement les signaux en newsletters, fils de discussion ou briefings audio.",run_engine:"Lancer le moteur",running:"En cours...",last_run:"Dernière exécution",never:"Jamais",schedule:"Calendrier",manual:"Manuel",topic:"Sujet",pipeline:"Pipeline",pause:"Pause",resume:"Reprendre",view_json:"Voir le brief de production JSON",json_contract:"Contrat sans état et autonome",json_desc:"Ce JSON contient le contexte complet (Signaux + Persona utilisateur) requis pour le Desktop Studio.",generating_asset:"Génération de l'actif...",queued_desktop:"En file d'attente pour le bureau...",desktop_processing:"L'application RealTimeX Desktop traite cette demande. Cette fenêtre se mettra à jour automatiquement une fois terminée.",unsupported_type:"Type d'actif non pris en charge",edit_engine:"Modifier le moteur",engine_name:"Nom du moteur",type:"Type",status:"Statut",execution_env:"Environnement d'exécution",local_llm:"Local (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (Agent Swarm)",env_desc_desktop:"Délègue des tâches lourdes comme l'audio/vidéo à l'application de bureau.",env_desc_local:"Exécute des tâches Markdown simples directement dans Alchemy.",min_score:"Score min",max_signals:"Signaux max",category_filter:"Filtre de catégorie (sélection multiple)",multi_select_hint:"Maintenez Cmd/Ctrl pour sélectionner plusieurs catégories",schedule_hint:"Note : La planification n'est pas encore automatisée",prompt_override:"Remplacement du prompt personnalisé (optionnel)",prompt_placeholder:"Remplacez le prompt par défaut pour ce type de moteur...",delete_confirm:"Vraiment supprimer ?",confirm:"Confirmer",copied_json:"JSON copié dans le presse-papiers",json_footer:"Ce JSON contient le contexte complet (Signaux + Persona Utilisateur) requis pour Desktop Studio."},lF={title:"Configuration du compte",desc:"Gérez votre profil Alchemist et vos liens d'essence.",profile:"Profil",security:"Sécurité",supabase:"Supabase",first_name:"Prénom",last_name:"Nom",email_locked:"Adresse e-mail (verrouillée)",sound_effects:"Effets sonores",sound_desc:"Activer le retour sonore pour les événements de synchronisation et les découvertes de signaux.",sign_out:"Déconnexion",logout_desc:"Mettre fin à votre session actuelle et revenir à l'écran de connexion.",preserve_profile:"Préserver le profil",security_title:"Mettre à jour la clé d'entropie",new_password:"Nouveau mot de passe",confirm_password:"Confirmer le mot de passe",password_mismatch:"Les clés de complexité ne correspondent pas.",password_too_short:"Entropie trop faible. Minimum 8 caractères.",password_rotate_success:"Rotation de la clé réussie.",rotate_key:"Faire pivoter la clé",essence_resonance:"Résonance d'essence",byok_desc:"Apportez vos propres clés (BYOK) pour la persistance de l'intelligence.",established_link:"Lien établi",env_notice:"Actif à partir des variables d'environnement. Remplacement de l'UI activé.",realign_link:"Réaligner le lien",sever_link:"Rompre le lien",sever_confirm:"Rompre la connexion à cette essence ? Cela réinitialisera la résonance locale.",anon_secret_fragment:"Fragment secret Anon",no_resonance:"Pas de résonance d'essence",no_resonance_desc:"L'Alchimiste nécessite un cœur cloud pour stocker les fragments d'intelligence.",initiate_link:"Initier le lien",test_connection:"Tester la connexion"},cF={title:"Journaux système",desc:"Historique détaillé des exécutions de synchronisation, des sources et du traitement des URL",blacklist_suggestion:"Liste noire potentielle",blacklist_desc:"Candidats au blocage",recent_errors:"Erreurs récentes",errors_desc:"Échecs du traitement des URL",total_signals:"Total des signaux",signals_desc:"Extraits avec succès",blacklist_modal_title:"Suggestions de liste noire",blacklist_modal_desc:"Examinez les domaines suggérés pour la liste noire en fonction des scores faibles.",no_suggestions:"Pas de suggestions pour le moment",quality_good:"La qualité de vos signaux semble bonne !",signals_count:"{{count}} signaux",avg_score:"Score moyen : {{score}}",low_quality:"Qualité constamment faible",repetitive:"Motif répétitif",blacklist_domain:"Mettre le domaine sur liste noire",errors_modal_title:"Erreurs récentes",errors_modal_desc:"Journal des récents échecs et problèmes.",no_recent_errors:"Aucune erreur récente trouvée.",signals_modal_title:"Signaux trouvés",signals_modal_desc:"Parcourez et gérez l'historique de vos signaux extraits.",search_placeholder:"Rechercher des signaux...",any_score:"N'importe quel score",high_score:"Élevé (80%+)",medium_score:"Moyen (50-79%)",low_score:"Faible (<50%)",all_categories:"Toutes les catégories",page_x:"Page {{page}}"},uF={title:"Moteur Alchemist",live:"EN DIRECT",clear:"Effacer",idle:"Inactif. En attente d'événements de minage...",run_completed:"Cycle de minage terminé",signals:"Signaux",urls:"URLs",skipped:"Ignorés",failed_to_process:"{{count}} URLs n'ont pas pu être traitées",view_logs:"Voir les journaux",hide_details:"Masquer les détails",view_details:"Voir les détails",engine_log:"Journal du moteur en direct",stop_sync:"Arrêter la synchronisation",state_reading:"Lecture",state_thinking:"Réflexion",state_signal:"Signal",state_skipped:"Ignoré",state_error:"Erreur",state_completed:"Terminé",msg_reading:"Lecture du contenu de : {{url}}",msg_thinking:"Analyse de la pertinence de : {{title}}",msg_found_signal:"Signal trouvé : {{summary}} ({{score}}%)",msg_low_signal:"Signal faible stocké pour examen ({{score}}%) : {{title}}",msg_failed:"L'analyse a échoué pour {{title}} : {{error}}",msg_sync_completed:"Synchronisation terminée : {{signals}} signaux trouvés, {{skipped}} ignorés, {{errors}} erreurs"},dF={switch_light:"Passer au mode clair",switch_dark:"Passer au mode sombre",view_changelog:"Voir les changements",release_notes:"Notes de version",changelog_error:"Échec du chargement du journal des modifications."},hF={title:"Pouls des signaux",mining:"Minage",standing_by:"En attente",idle:"Inactif",tracked:"Signaux suivis",avg_score:"Score moyen",top_signal:"Meilleur signal",latest:"Dernier",awaiting:"En attente de minage",no_signals:"Aucun signal pour l'instant"},fF={title:"Moteur d'Intelligence",subtitle:"Affinez les paramètres cognitifs de l'Alchimiste et les liens des fournisseurs.",configuration:"Configuration IA",test_connection:"Tester la Connexion",save_config:"Enregistrer la Configuration",llm_provider:"Fournisseur LLM",embedding_provider:"Fournisseur d'Incrustation",sdk_connected:"SDK Connecté",sdk_not_available:"SDK non disponible",provider:"Fournisseur",intelligence_model:"Modèle d'Intelligence",embedding_model:"Modèle d'Incrustation",loading_providers:"Chargement des fournisseurs...",sdk_info_success:"✓ Utilisation du fournisseur configuré par RealTimeX",sdk_info_fail:"⚠️ SDK RealTimeX non détecté. Configurez dans RealTimeX Desktop.",embedding_info_success:"✓ Les incrustations sont générées en utilisant votre fournisseur configuré par RealTimeX",embedding_info_fail:"⚠️ SDK RealTimeX non détecté. Configurez les fournisseurs dans RealTimeX Desktop.",persona_title:"Mémoire de Persona",save_memory:"Enregistrer la Mémoire",interests_title:"Intérêts Actifs",interests_priority:"Haute Priorité",interests_desc:"L'Alchimiste donne la priorité au contenu correspondant à ces sujets. Mis à jour automatiquement en fonction des Favoris et des Boosts.",interests_placeholder:"ex: L'utilisateur se concentre sur les performances de React, les systèmes backend Rust et l'architecture des agents IA...",antipatterns_title:"Anti-Modèles",antipatterns_priority:"Éviter",antipatterns_desc:"L'Alchimiste filtre ou dévalorise le contenu correspondant à ces modèles. Mis à jour via les Rejets.",antipatterns_placeholder:"ex: N'aime pas le marketing superficiel, les listes génériques et le battage médiatique crypto...",browser_sources:"Sources de l'Historique du Navigateur",save_browser:"Enregistrer les Sources",blacklist_title:"Liste Noire de Domaines",blacklist_desc:"Les URLs contenant ces modèles seront ignorées lors du minage. Entrez un modèle par ligne.",blacklist_label:"Modèles de Domaine (un par ligne)",blacklist_placeholder:`google.com/search
|
|
151
|
+
localhost:
|
|
152
|
+
127.0.0.1
|
|
153
|
+
facebook.com
|
|
154
|
+
twitter.com
|
|
155
|
+
instagram.com
|
|
156
|
+
linkedin.com/feed`,blacklist_examples:"Exemples: google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"Enregistrer la Liste Noire",blocked_tags_title:"Tags Bloqués",blocked_tags_desc:"Les signaux avec ces tags seront exclus de la génération dynamique de catégories et des newsletters. Entrez un tag par ligne.",blocked_tags_label:"Tags (séparés par un point-virgule)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"Vous avez un contrôle total. Ces tags remplaceront complètement les valeurs par défaut du système.",save_blocked_tags:"Enregistrer les Tags Bloqués",save_error_login:"Veuillez vous connecter pour enregistrer les paramètres",save_error_persona:"Veuillez vous connecter pour enregistrer la persona",save_success_llm:"Paramètres LLM enregistrés avec succès",save_success_browser:"Sources du navigateur enregistrées avec succès",save_success_blacklist:"Liste noire mise à jour avec succès",save_success_tags:"Tags bloqués mis à jour avec succès",save_success_persona:"Persona mise à jour avec succès",test_success:"Connexion réussie ! {{model}}",test_fail:"Échec de la connexion : {{message}}",auto_detect_title:"Auto-détection des Navigateurs",scan_system:"Scanner le Système",scanning:"Numérisation...",auto_detected:"Auto-détecté",custom:"Personnalisé",add_source:"Ajouter la Source",already_added:"Déjà ajouté",not_found:"Non trouvé sur ce système",add_custom_path:"Ajouter un Chemin Personnalisé",custom_path_placeholder:"/chemin/vers/le/navigateur/History",add_custom_source:"Ajouter une Source Personnalisée",validating:"Validation en cours...",configured_sources:"Sources Configurées ({{count}})",enabled:"Activé",disabled:"Désactivé",invalid_path:"Chemin invalide : {{error}}",validation_failed:"Échec de la validation du chemin",discovered_sources:"{{count}} sources de navigateur découvertes",no_sources_found:"Aucune source de navigateur trouvée",auto_discover_sources:"Découvrir automatiquement les sources",auto_discover_hint:"Trouvez automatiquement les chemins d'historique pour tous les profils de navigateur."},pF={common:tF,tabs:nF,setup:rF,auth:sF,discovery:iF,chat:oF,transmute:aF,account:lF,logs:cF,terminal:uF,shell:dF,stats:hF,engine:fF},mF={save:"Guardar",cancel:"Cancelar",loading:"Cargando...",error:"Error",success:"Éxito",settings:"Ajustes",search:"Buscar",back:"Atrás",all:"Todo",delete:"Eliminar",update:"Actualizar",edit:"Editar",close:"Cerrar",complete:"Completar",skip:"Omitir",begin:"Empezar",connection:"Conexión",setup:"Configuración",project:"Proyecto",account:"Cuenta",logout:"Cerrar sesión",welcome:"Bienvenido",dark_mode:"Modo Oscuro",light_mode:"Modo Claro",collapse:"Contraer",just_now:"Ahora mismo",enabled:"Habilitado",disabled:"Deshabilitado",saving:"Guardando...",locale_code:"es-ES",categories:{ai_ml:"IA y ML",business:"Negocios",politics:"Política",technology:"Tecnología",finance:"Finanzas",crypto:"Cripto",science:"Ciencia",other:"Otro"}},gF={discovery:"Descubrimiento",chat:"Chat",transmute:"Transmutar",logs:"Registros del sistema",history:"Historial"},yF={welcome_title:"Ensambla tu motor",welcome_desc:"Alchemy requiere una esencia de Supabase para almacenar fragmentos de señales y patrones de inteligencia.",requirements:"Requisitos:",project_url:"URL del proyecto Supabase",anon_key:"Clave API anónima pública",db_password:"Contraseña de la base de datos",project_url_placeholder:"https://xxx.supabase.co o project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"INICIAR INICIALIZACIÓN",connect_essence:"CONECTAR ESENCIA",credentials_title:"Coordenadas de la Esencia",credentials_desc:"Vincule el motor de alquimia a su base de datos en la nube",validating:"Validando enlace",resonance:"Sincronizando resonancia...",init_schema:"Inicializar esquema",schema_desc:"Ejecuta las migraciones de la base de datos para configurar las tablas y funciones necesarias.",project_id:"ID del proyecto",access_token:"Token de acceso",run_migrations:"EJECUTAR MIGRACIONES",running_migrations:"Ejecutando migraciones",take_minute:"Esto puede tardar un minuto...",engine_aligned:"Motor alineado",restarting:"Reiniciando subsistemas Alchemist...",forge_project:"Forjar proyecto en Supabase",project_id_help:"Se encuentra en el Panel de Supabase → Configuración del proyecto → General",access_token_help:"Generar en",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"Se requiere el ID del proyecto",access_token_required:"Se requiere el token de acceso",migration_failed_logs:"La migración falló. Verifique los registros para más detalles.",stream_error:"Error al leer el flujo de migración",back:"ATRÁS",retry:"REINTENTAR",choose_setup_path:"Elegir Ruta de Configuración",forge_how:"¿cómo quieres forjar tu motor?",quick_launch:"Lanzamiento Rápido",quick_launch_desc:"Crear automáticamente proyecto Supabase para mí (requiere Token de Acceso)",manual_connection:"Conexión Manual",manual_connection_desc:"vincular con un proyecto existente (requiere url y clave anon)",quick_provision_desc:"proporciona tu token de acceso para aprovisionar todo automáticamente",get_token:"OBTENER TOKEN",project_name:"Nombre del Proyecto",project_name_placeholder:"ej: Mi Motor Alchemy",organization:"Organización",region:"Región",launch_engine:"Lanzar Motor",provisioning_forge:"Forja de Aprovisionamiento",building_instance:"construyendo tu instancia privada de supabase...",regions:{"us-east-1":"EE.UU. Este (N. Virginia)","us-west-1":"EE.UU. Oeste (N. California)","eu-central-1":"Europa (Fráncfort)","eu-west-2":"Europa (Londres)","ap-southeast-1":"Asia Pacífico (Singapur)","ap-southeast-2":"Asia Pacífico (Sídney)","sa-east-1":"Sudamérica (São Paulo)"}},xF={title_init:"INICIALIZAR MAESTRO",title_join:"UNIRSE AL CÍRCULO",title_mystic:"ACCESO MÍSTICO",title_login:"INICIO DE SESIÓN ALQUIMISTA",desc_init:"Forjar la cuenta principal de alquimista",desc_mystic_email:"Ingrese su correo electrónico de esencia",desc_mystic_code:"Transmutar el código sagrado",desc_login:"Transmutar sus datos en intelligence",first_name:"Nombre",last_name:"Apellido",first_name_placeholder:"Zosimos",last_name_placeholder:"Panopolis",email_address:"Dirección de correo electrónico",email_placeholder:"alquimista@ejemplo.com",complexity_key:"Clave de complejidad",password_placeholder:"••••••••",init_account:"INICIALIZAR CUENTA",send_code:"ENVIAR CÓDIGO",unseal_engine:"DESSELLAR MOTOR",verify_code:"VERIFICAR CÓDIGO",change_email:"Cambiar dirección de correo electrónico",sign_in_code:"Iniciar sesión con código",sign_in_password:"Iniciar sesión con contraseña",already_alchemist:"¿Ya eres alquimista?",new_to_alchemy:"¿Nuevo en Alchemy?",login_instead:"Iniciar sesión",create_account:"Crear una cuenta",session_failed:"Error al crear la sesión",invalid_code:"Código inválido"},vF={filters:"Filtros",category:"Categoría",intelligence_score:"Puntuación de inteligencia",no_signals_in_category:"Aún no hay señales en {{category}}.",no_categories:"No hay categorías todavía.",discovery_hint:"Las señales se organizarán aquí una vez descubiertas.",loading_signals:"Cargando señales...",dismiss_hint:"Descartar (No me interesa)",signal_count_one:"{{count}} señal",signal_count_other:"{{count}} señales",time_min_ago:"Hace {{count}}m",time_hour_ago:"Hace {{count}}h",time_day_ago:"Hace {{count}}d",add_note_title:"Añadir nota",target:"Objetivo",note_placeholder:"Ingrese sus pensamientos, ideas o puntos de acción con respecto a esta señal...",save_note:"Guardar nota",view_all_sources:"Ver todas las fuentes",source_count_one:"{{count}} fuente",source_count_other:"{{count}} fuentes",source_found_in:"Encontrado en {{count}} fuentes diferentes",high_confidence:"Alta confianza - encontrado en {{count}} fuentes",new_signals:"Nuevas señales",smart_summary:"Resumen inteligente",entities:"Entidades",sources:"Fuentes",last_sync:"Última sincronización",syncnow:"Sincronizar ahora",all_time:"Todo el tiempo",checkpoint:"Punto de control",from:"Desde",score_high:"ALTO",score_medium:"MEDIO",score_low:"BAJO",sources_count:"{{count}} fuentes",open_source:"Abrir",add_note:"Nota",boost_topic:"Impulsar",boosted:"Impulsado",dismissed:"Descartado",remove_favourite:"Quitar de favoritos",add_favourite:"Agregar a favoritos",sync_history:"Historial de Sync",syncing:"Sincronizando...",sync_settings:"Ajustes de Sync",discovered:"Descubierto",original_source:"Fuente original",ai_summary:"Resumen IA",full_content:"Contenido completo",copied:"¡Copiado!",open_link:"Abrir",detail_title:"Detalles de la Señal",sync_from:"Sincronizar desde (Opcional)",urls_per_sync:"URLs por sincronización",sync_from_hint:"Deje vacío para sincronizar solo los nuevos URLs desde la última sincronización. Establezca una fecha para procesar URLs a partir de ese momento.",reset_checkpoint:"Reiniciar punto de control",reset_checkpoint_hint:"Borrar el punto de control de sincronización para forzar una resincronización completa a partir de su fecha de inicio.",sync_info:'El Alquimista rastrea su progreso automáticamente. Use "Sincronizar desde" para completar el historial o "Reiniciar punto de control" para empezar de cero.',save_settings:"Guardar ajustes",sync_saved:"Ajustes de sincronización guardados",checkpoint_reset:"Punto de control reiniciado",login_to_save:"Inicie sesión para guardar los ajustes",login_to_reset:"Inicie sesión para reiniciar el punto de control",status_updated:"Estado del motor actualizado a {{status}}",asset_ready:'¡El activo "{{title}}" está listo!',scanning:"Escaneando nuevas categorías y temas...",discovery_complete:"¡Descubrimiento de motores completado!",discovery_failed:"Fallo en el descubrimiento. Verifique los ajustes.",welcome_title:"¡Bienvenido a Alchemist!",welcome_desc:"Conecta tu historial de navegación para comenzar a descubrir señales. Analizaremos automáticamente las páginas que visitaste para encontrar menciones de IA, tecnología y más.",auto_detect_sync:"Detectar automáticamente y sincronizar",privacy_first:"Privacidad primero",offline_first:"Sin conexión primero",load_failed:"Error al cargar los motores",starting_run:"Iniciando ejecución del motor...",run_complete:"¡Ejecución del motor completa! Creado: {{title}}",run_started_desktop:"Ejecución del motor iniciada en el escritorio. Seguimiento como: {{id}}",run_failed:"Error al ejecutar el motor",brief_failed:"Error al generar el informe de producción",topic:"Tema",pipeline:"Pipeline"},_F={history:"Historial",ask_anything:"Pregunta cualquier cosa sobre tu historial de navegación...",sources:"Fuentes",processing:"Procesando tu consulta...",new_chat:"Nuevo Chat",no_messages:"Aún no hay mensajes. ¡Empieza una conversación!",no_history:"Aún no hay historial de chat.",title:"Preguntar al Alquimista",desc:"Puedo ayudarte a recordar información, resumir temas y encontrar ideas en tu historial de navegación.",thinking:"Explorando la memoria...",placeholder:"Pregunta sobre tu historial...",error_message:"Lo siento, encontré un error al procesar tu solicitud.",relevant_context:"Contexto relevante",match_score:"{{score}}% de coincidencia",rag_attribution:"El Alquimista usó estas {{count}} señales para responder",suggestions:{react:"¿Qué he leído sobre React recientemente?",ai:"Resume las últimas noticias de IA que visité.",finance:"¿Tengo algunas notas sobre Finanzas?",performance:"Encuentra artículos sobre 'Rendimiento'"}},bF={engines:"Motores Alchemist",assets:"Activos generados",newsletter:"Boletín",thread:"Hilo",generate:"Generar",processing_desktop:"Procesando en escritorio...",ensure_defaults:"Asegurar motores predeterminados",create_engine:"Crear motor",no_assets:"Aún no se han generado activos.",title:"Motor de Transmutación",desc:"Pipelines de generación activa y activos",generate_engines:"Generar motores",new_engine:"Nuevo motor",no_engines:"No hay motores configurados",no_engines_desc:"Crea tu primer pipeline para convertir señales automáticamente en boletines, hilos o informes de audio.",run_engine:"Iniciar motor",running:"Ejecutando...",last_run:"Última ejecución",never:"Nunca",schedule:"Programación",manual:"Manual",topic:"Tema",pipeline:"Pipeline",pause:"Pausa",resume:"Reanudar",view_json:"Ver JSON de informe de producción",json_contract:"Contrato sin estado y autónomo",json_desc:"Este JSON contiene el contexto completo (Señales + Persona de usuario) requerido para el Desktop Studio.",generating_asset:"Generando activo...",queued_desktop:"En cola para el escritorio...",desktop_processing:"La aplicación RealTimeX Desktop está procesando esta solicitud. Esta ventana se actualizará automáticamente una vez terminada.",unsupported_type:"Tipo de activo no compatible",edit_engine:"Editar motor",engine_name:"Nombre del motor",type:"Tipo",status:"Estado",execution_env:"Entorno de ejecución",local_llm:"Local (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (Agent Swarm)",env_desc_desktop:"Delega tareas pesadas como audio/video a la aplicación de escritorio.",env_desc_local:"Ejecuta tareas de Markdown simples directamente en Alchemy.",min_score:"Puntuación mínima",max_signals:"Señales máximas",category_filter:"Filtro de categoría (selección múltiple)",multi_select_hint:"Mantén presionado Cmd/Ctrl para seleccionar varias categorías",schedule_hint:"Nota: La programación aún no está automatizada",prompt_override:"Sobrescribir prompt personalizado (opcional)",prompt_placeholder:"Sobrescribe el prompt predeterminado para este tipo de motor...",delete_confirm:"¿Realmente quieres eliminarlo?",confirm:"Confirmar",copied_json:"JSON copiado al portapapeles",json_footer:"Este JSON contiene el contexto completo (Señales + Persona de Usuario) requerido para Desktop Studio."},wF={title:"Configuración de la cuenta",desc:"Administra tu perfil de Alchemist y los enlaces de esencia.",profile:"Perfil",security:"Seguridad",supabase:"Supabase",first_name:"Nombre",last_name:"Apellido",email_locked:"Dirección de correo electrónico (Bloqueada)",sound_effects:"Efectos de sonido",sound_desc:"Activa la respuesta sonora para eventos de sincronización y descubrimientos de señales.",sign_out:"Cerrar sesión",logout_desc:"Finaliza tu sesión actual y vuelve a la pantalla de inicio de sesión.",preserve_profile:"Preservar perfil",security_title:"Actualizar clave de entropía",new_password:"Nueva contraseña",confirm_password:"Confirmar contraseña",password_mismatch:"Las claves de complejidad no coinciden.",password_too_short:"Entropía demasiado baja. Mínimo 8 caracteres.",password_rotate_success:"Rotación de clave exitosa.",rotate_key:"Rotar clave",essence_resonance:"Resonancia de esencia",byok_desc:"Trae tus propias claves (BYOK) para la persistencia de la inteligencia.",established_link:"Enlace establecido",env_notice:"Activo desde variables de entorno. Sobrescritura de UI habilitada.",realign_link:"Realinear enlace",sever_link:"Cortar enlace",sever_confirm:"¿Cortar la conexión con esta esencia? Esto restablecerá la resonancia local.",anon_secret_fragment:"Fragmento secreto anónimo",no_resonance:"Sin resonancia de esencia",no_resonance_desc:"El Alchemist requiere un núcleo en la nube para almacenar fragmentos de inteligencia.",initiate_link:"Iniciar enlace",test_connection:"Probar conexión"},kF={title:"Registros del sistema",desc:"Historial detallado de ejecuciones de sincronización, fuentes y procesamiento de URL",blacklist_suggestion:"Lista negra potencial",blacklist_desc:"Candidatos para bloqueo",recent_errors:"Errores recientes",errors_desc:"Procesos de URL fallidos",total_signals:"Total de señales",signals_desc:"Extraídas con éxito",blacklist_modal_title:"Sugerencias de lista negra",blacklist_modal_desc:"Revisa los dominios sugeridos para la lista negra basados en puntuaciones bajas.",no_suggestions:"No hay sugerencias por ahora",quality_good:"¡La calidad de tus señales se ve bien!",signals_count:"{{count}} señales",avg_score:"Puntuación media: {{score}}",low_quality:"Qualidad consistentemente baja",repetitive:"Patrón repetitivo",blacklist_domain:"Lista negra de dominio",errors_modal_title:"Errores recientes",errors_modal_desc:"Registro de fallos y problemas recientes.",no_recent_errors:"No se encontraron errores recientes.",signals_modal_title:"Señales encontradas",signals_modal_desc:"Navega y administra tu historial de señales extraídas.",search_placeholder:"Buscar señales...",any_score:"Cualquier puntuación",high_score:"Alta (80%+)",medium_score:"Media (50-79%)",low_score:"Baja (<50%)",all_categories:"Todas las categorías",page_x:"Página {{page}}"},SF={title:"Motor Alchemist",live:"EN VIVO",clear:"Limpiar",idle:"Inactivo. Esperando eventos de minería de señales...",run_completed:"Ciclo de minería completado",signals:"Señales",urls:"URLs",skipped:"Omitidos",failed_to_process:"{{count}} URLs no pudieron procesarse",view_logs:"Ver registros",hide_details:"Ocultar detalles",view_details:"Ver detalles",engine_log:"Registro del motor en vivo",stop_sync:"Detener sincronización",state_reading:"Lectura",state_thinking:"Pensando",state_signal:"Señal",state_skipped:"Omitido",state_error:"Error",state_completed:"Completado",msg_reading:"Leyendo contenido de: {{url}}",msg_thinking:"Analizando relevancia de: {{title}}",msg_found_signal:"Señal encontrada: {{summary}} ({{score}}%)",msg_low_signal:"Baja señal almacenada para revisión ({{score}}%): {{title}}",msg_failed:"Análisis fallido para {{title}}: {{error}}",msg_sync_completed:"Sincronización completada: {{signals}} señales encontradas, {{skipped}} omitidas, {{errors}} errores"},jF={switch_light:"Cambiar a modo claro",switch_dark:"Cambiar a modo oscuro",view_changelog:"Ver historial de cambios",release_notes:"Notas de la versión",changelog_error:"Error al cargar el historial de cambios."},EF={title:"Pulso de señales",mining:"Minería",standing_by:"En espera",idle:"Inactivo",tracked:"Señales rastreadas",avg_score:"Puntuación media",top_signal:"Mejor señal",latest:"Último",awaiting:"Esperando minería",no_signals:"Sin señales aún"},CF={title:"Motor de Inteligencia",subtitle:"Ajuste los parámetros cognitivos del Alquimista y los enlaces de proveedores.",configuration:"Configuración de IA",test_connection:"Probar Conexión",save_config:"Guardar Configuración",llm_provider:"Proveedor LLM",embedding_provider:"Proveedor de Incrustación",sdk_connected:"SDK Conectado",sdk_not_available:"SDK No Disponible",provider:"Proveedor",intelligence_model:"Modelo de Inteligencia",embedding_model:"Modelo de Incrustación",loading_providers:"Cargando proveedores...",sdk_info_success:"✓ Usando el proveedor configurado de RealTimeX",sdk_info_fail:"⚠️ SDK de RealTimeX no detectado. Configure en RealTimeX Desktop.",embedding_info_success:"✓ Las incrustaciones se generan usando su proveedor configurado de RealTimeX",embedding_info_fail:"⚠️ SDK de RealTimeX no detectado. Configure proveedores en RealTimeX Desktop.",persona_title:"Memoria de Persona",save_memory:"Guardar Memoria",interests_title:"Intereses Activos",interests_priority:"Prioridad Alta",interests_desc:"El Alquimista prioriza el contenido que coincide con estos temas. Se actualiza automáticamente según Favoritos y Boosts.",interests_placeholder:"ej. El usuario se centra en el rendimiento de React, sistemas backend de Rust y arquitectura de agentes de IA...",antipatterns_title:"Anti-Patrones",antipatterns_priority:"Evitar",antipatterns_desc:"El Alquimista filtra o reduce la puntuación del contenido que coincide con estos patrones. Actualizado a través de Descartes.",antipatterns_placeholder:"ej. No le gusta el marketing vacío, las listas genéricas y el hype de las criptomonedas...",browser_sources:"Fuentes del Historial del Navegador",save_browser:"Guardar Fuentes",blacklist_title:"Lista Negra de Dominios",blacklist_desc:"Las URLs que contienen estos patrones se omitirán durante la minería. Ingrese un patrón por línea.",blacklist_label:"Patrones de Dominio (uno por línea)",blacklist_placeholder:`google.com/search
|
|
157
|
+
localhost:
|
|
158
|
+
127.0.0.1
|
|
159
|
+
facebook.com
|
|
160
|
+
twitter.com
|
|
161
|
+
instagram.com
|
|
162
|
+
linkedin.com/feed`,blacklist_examples:"Ejemplos: google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"Guardar Lista Negra",blocked_tags_title:"Etiquetas Bloqueadas",blocked_tags_desc:"Las señales con estas etiquetas se excluirán de la generación dinámica de categorías y boletines. Ingrese una etiqueta por línea.",blocked_tags_label:"Etiquetas (separadas por punto y coma)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"Tienes control total. Estas etiquetas reemplazarán completamente los valores predeterminados del sistema.",save_blocked_tags:"Guardar Etiquetas Bloqueadas",save_error_login:"Por favor, inicie sesión para guardar los ajustes",save_error_persona:"Por favor, inicie sesión para guardar la persona",save_success_llm:"Ajustes de LLM guardados con éxito",save_success_browser:"Fuentes del navegador guardadas con éxito",save_success_blacklist:"Lista negra actualizada con éxito",save_success_tags:"Etiquetas bloqueadas actualizadas con éxito",save_success_persona:"Persona actualizada con éxito",test_success:"¡Conexión exitosa! {{model}}",test_fail:"Conexión fallida: {{message}}",auto_detect_title:"Auto-Detectar Navegadores",scan_system:"Escanear Sistema",scanning:"Escaneando...",auto_detected:"Auto-detectado",custom:"Personalizado",add_source:"Añadir Fuente",already_added:"Ya Añadido",not_found:"No encontrado en este sistema",add_custom_path:"Añadir Ruta Personalizada",custom_path_placeholder:"/ruta/al/navegador/Historial",add_custom_source:"Añadir Fuente Personalizada",validating:"Validando...",configured_sources:"Fuentes Configuradas ({{count}})",enabled:"Habilitado",disabled:"Deshabilitado",invalid_path:"Ruta inválida: {{error}}",validation_failed:"Error al validar la ruta",discovered_sources:"{{count}} fuentes de navegador descubiertas",no_sources_found:"No se encontraron fuentes de navegador",auto_discover_sources:"Descubrir fuentes automáticamente",auto_discover_hint:"Encuentra automáticamente rutas de historial para todos los perfiles de navegador."},NF={common:mF,tabs:gF,setup:yF,auth:xF,discovery:vF,chat:_F,transmute:bF,account:wF,logs:kF,terminal:SF,shell:jF,stats:EF,engine:CF},TF={save:"저장",cancel:"취소",loading:"로딩 중...",error:"오류",success:"성공",settings:"설정",search:"검색",back:"뒤로",all:"전체",delete:"삭제",update:"업데이트",edit:"편집",close:"닫기",complete:"완료",skip:"건너뛰기",begin:"시작",connection:"연결",setup:"설정",project:"프로젝트",account:"계정",logout:"로그아웃",welcome:"환영합니다",dark_mode:"다크 모드",light_mode:"라이트 모드",collapse:"접기",just_now:"방금 전",enabled:"활성화됨",disabled:"비활성화됨",quick:"빠름 (5)",balanced:"균형 (50)",thorough:"철저함 (200)",resetting:"초기화 중...",saving:"저장 중...",locale_code:"ko-KR",categories:{ai_ml:"AI 및 ML",business:"비즈니스",politics:"정치",technology:"기술",finance:"금융",crypto:"크립토",science:"과학",other:"기타"}},AF={discovery:"검색",chat:"채팅",transmute:"변환",logs:"시스템 로그",history:"기록"},RF={welcome_title:"엔진 조립",welcome_desc:"Alchemy는 신호 파편과 지능 패턴을 저장하기 위해 Supabase 에센스가 필요합니다.",requirements:"요구 사항:",project_url:"Supabase 프로젝트 URL",anon_key:"익명 공용 API 키",db_password:"데이터베이스 비밀번호",project_url_placeholder:"https://xxx.supabase.co 또는 project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"초기화 시작",connect_essence:"에센스 연결",credentials_title:"에센스 좌표",credentials_desc:"연금술사 엔진을 클라우드 데이터베이스와 연결",validating:"링크 확인 중",resonance:"공명 동기화 중...",init_schema:"스키마 초기화",schema_desc:"필요한 테이블과 기능을 설정하기 위해 데이터베이스 마이그레이션을 실행합니다.",project_id:"프로젝트 ID",access_token:"액세스 토큰",run_migrations:"마이그레이션 실행",running_migrations:"마이그레이션 실행 중",take_minute:"잠시만 기다려 주세요...",engine_aligned:"엔진 정렬 완료",restarting:"Alchemist 하위 시스템 재시작 중...",forge_project:"Supabase에서 프로젝트 만들기",project_id_help:"Supabase 대시보드 → 프로젝트 설정 → 일반에서 확인 가능",access_token_help:"여기에서 생성:",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"프로젝트 ID가 필요합니다",access_token_required:"액세스 토큰이 필요합니다",migration_failed_logs:"마이그레이션 실패. 자세한 내용은 로그를 확인하세요.",stream_error:"마이그레이션 스트림을 읽지 못했습니다",back:"뒤로",retry:"재시도",choose_setup_path:"설정 경로 선택",forge_how:"엔진을 어떻게 구축하시겠습니까?",quick_launch:"빠른 시작",quick_launch_desc:"Supabase 프로젝트 자동 생성 (액세스 토큰 필요)",manual_connection:"수동 연결",manual_connection_desc:"기존 프로젝트와 연결 (url & anon 키 필요)",quick_provision_desc:"액세스 토큰을 제공하여 모든 것을 자동 프로비저닝",get_token:"토큰 받기",project_name:"프로젝트 이름",project_name_placeholder:"예: 내 Alchemy 엔진",organization:"조직",region:"지역",launch_engine:"엔진 시작",provisioning_forge:"프로비저닝 포지",building_instance:"개인 supabase 인스턴스 구축 중...",regions:{"us-east-1":"미국 동부 (버지니아 북부)","us-west-1":"미국 서부 (캘리포니아 북부)","eu-central-1":"유럽 (프랑크푸르트)","eu-west-2":"유럽 (런던)","ap-southeast-1":"아시아 태평양 (싱가포르)","ap-southeast-2":"아시아 태평양 (시드니)","sa-east-1":"남미 (상파울루)"}},PF={title_init:"마스터 초기화",title_join:"서클 가입",title_mystic:"신비로운 접속",title_login:"연금술사 로그인",desc_init:"최초의 연금술사 계정 생성",desc_mystic_email:"에센스 이메일 입력",desc_mystic_code:"신성한 코드 변환",desc_login:"데이터를 지능으로 변환",first_name:"이름",last_name:"성",first_name_placeholder:"조시모스",last_name_placeholder:"파노폴리스",email_address:"이메일 주소",email_placeholder:"alchemist@example.com",complexity_key:"복잡성 키",password_placeholder:"••••••••",init_account:"계정 초기화",send_code:"코드 전송",unseal_engine:"엔진 봉인 해제",verify_code:"코드 확인",change_email:"이메일 주소 변경",sign_in_code:"코드로 로그인",sign_in_password:"비밀번호로 로그인",already_alchemist:"이미 멤버이신가요?",new_to_alchemy:"Alchemy가 처음이신가요?",login_instead:"로그인하기",create_account:"계정 만들기",session_failed:"세션 생성 실패",invalid_code:"유효하지 않은 코드"},OF={filters:"필터",category:"카테고리",intelligence_score:"지능 점수",no_signals_in_category:"{{category}}에 아직 신호가 없습니다.",no_categories:"아직 카테고리가 없습니다.",discovery_hint:"신호가 발견되면 여기에 정리됩니다.",loading_signals:"신호를 불러오는 중...",dismiss_hint:"무시하기 (관심 없음)",signal_count_one:"{{count}}개의 신호",signal_count_other:"{{count}}개의 신호",time_min_ago:"{{count}}분 전",time_hour_ago:"{{count}}시간 전",time_day_ago:"{{count}}일 전",add_note_title:"노트 추가",target:"대상",note_placeholder:"이 신호에 대한 생각, 아이디어 또는 실행 항목을 입력하세요...",save_note:"노트 저장",view_all_sources:"모든 소스 보기",source_count_one:"{{count}}개의 소스",source_count_other:"{{count}}개의 소스",source_found_in:"{{count}}개의 다른 소스에서 발견됨",high_confidence:"높은 신뢰도 - {{count}}개의 소스에서 발견됨",new_signals:"새로운 신호",smart_summary:"스마트 요약",entities:"엔티티",sources:"소스",last_sync:"최근 동기화",syncnow:"지금 동기화",all_time:"전체 기간",checkpoint:"체크포인트",from:"시작일",score_high:"높음",score_medium:"중간",score_low:"낮음",sources_count:"{{count}}개 출처",open_source:"열기",add_note:"노트",boost_topic:"토픽 부스트",boosted:"부스트됨",dismissed:"숨김",remove_favourite:"즐겨찾기 삭제",add_favourite:"즐겨찾기 추가",sync_history:"동기화 기록",syncing:"동기화 중...",sync_settings:"동기화 설정",discovered:"발견됨",original_source:"원본 소스",ai_summary:"AI 요약",full_content:"전체 내용",copied:"복사됨!",open_link:"열기",detail_title:"신호 상세 정보",sync_from:"동기화 시작 날짜 (선택 사항)",urls_per_sync:"동기화당 URL 수",sync_from_hint:"마지막 동기화 이후의 새 URL만 동기화하려면 비워 두세요. 특정 날짜부터 URL을 처리하려면 날짜를 설정하세요.",reset_checkpoint:"체크포인트 초기화",reset_checkpoint_hint:"동기화 체크포인트를 지워 설정한 날짜부터 전체 재동기화를 강제합니다.",sync_info:"알케미스트는 자동으로 진행 상황을 추적합니다. '동기화 시작 날짜'를 사용하여 이전 내역을 채우거나 '체크포인트 초기화'를 사용하여 새로 시작하세요.",save_settings:"설정 저장",sync_saved:"동기화 설정이 저장되었습니다",checkpoint_reset:"체크포인트가 초기화되었습니다",login_to_save:"설정을 저장하려면 로그인하세요",login_to_reset:"체크포인트를 초기화하려면 로그인하세요",status_updated:"엔진 상태가 {{status}}(으)로 업데이트되었습니다",asset_ready:'에셋 "{{title}}"이(가) 준비되었습니다!',scanning:"새로운 카테고리 및 주제 스캔 중...",discovery_complete:"엔진 검색 완료!",discovery_failed:"검색 실패. 설정을 확인하세요.",welcome_title:"Alchemist에 오신 것을 환영합니다!",welcome_desc:"브라우저 기록을 연결하여 신호 검색을 시작하세요. AI, 기술 등에 대한 언급을 자동으로 분석합니다.",auto_detect_sync:"자동 감지 및 동기화",privacy_first:"개인정보 우선",offline_first:"오프라인 우선",load_failed:"엔진을 불러오지 못했습니다",starting_run:"엔진 실행 시작 중...",run_complete:"엔진 실행 완료! 생성됨: {{title}}",run_started_desktop:"데스크톱에서 엔진 실행이 시작되었습니다. 추적 ID: {{id}}",run_failed:"엔진 실행 실패",brief_failed:"프로덕션 브리프 생성 실패",topic:"주제",pipeline:"파이프라인"},LF={history:"기록",ask_anything:"브라우징 기록에 대해 무엇이든 물어보세요...",sources:"소스",processing:"쿼리 처리 중...",new_chat:"새 채팅",no_messages:"아직 메시지가 없습니다. 대화를 시작해 보세요!",no_history:"아직 채팅 기록이 없습니다.",title:"알케미스트에게 물어보세요",desc:"방문 기록에서 정보를 기억하거나 주제를 요약하고 통찰력을 찾는 데 도움을 드릴 수 있습니다.",thinking:"메모리 탐색 중...",placeholder:"검색 기록에 대해 물어보세요...",error_message:"죄송합니다. 요청을 처리하는 동안 오류가 발생했습니다.",relevant_context:"관련 컨텍스트",match_score:"{{score}}% 일치",rag_attribution:"알케미스트는 이 답변을 위해 {{count}}개의 신호를 사용했습니다.",suggestions:{react:"최근에 React에 대해 무엇을 읽었나요?",ai:"최근 방문한 AI 뉴스 요약해줘.",finance:"금융에 관한 메모가 있나요?",performance:"'성능'에 관한 기사 찾아줘."}},IF={engines:"Alchemist 엔진",assets:"생성된 자산",newsletter:"뉴스레터",thread:"스레드",generate:"생성",processing_desktop:"데스크톱에서 처리 중...",ensure_defaults:"기본 엔진 확인",create_engine:"엔진 생성",no_assets:"아직 생성된 자산이 없습니다.",title:"변환 엔진",desc:"활성 생성 파이프라인 및 자산",generate_engines:"엔진 생성",new_engine:"새 엔진",no_engines:"구성된 엔진이 없습니다.",no_engines_desc:"신호를 자동으로 뉴스레터, 스레드 또는 오디오 브리핑으로 변환하는 첫 번째 파이프라인을 만드세요.",run_engine:"엔진 실행",running:"실행 중...",last_run:"최근 실행",never:"한 번도 없음",schedule:"일정",manual:"수동",topic:"주제",pipeline:"파이프라인",pause:"일시 중지",resume:"재개",view_json:"프로덕션 브리프 JSON 보기",json_contract:"상태 비저장 및 자체 포함 계약",json_desc:"이 JSON에는 Desktop Studio에 필요한 전체 컨텍스트(신호 + 사용자 페르소나)가 포함되어 있습니다.",generating_asset:"자산 생성 중...",queued_desktop:"데스크톱 대기열에 추가됨...",desktop_processing:"RealTimeX 데스크톱 앱에서 이 요청을 처리하고 있습니다. 완료되면 이 모달이 자동으로 업데이트됩니다.",unsupported_type:"지원되지 않는 자산 유형",edit_engine:"엔진 편집",engine_name:"엔진 이름",type:"유형",status:"상태",execution_env:"실행 환경",local_llm:"로컬 (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (에이전트 스웜)",env_desc_desktop:"오디오/비디오와 같은 무거운 작업을 데스크톱 앱에 위임합니다.",env_desc_local:"단순한 Markdown 작업을 Alchemy에서 직접 실행합니다.",min_score:"최소 점수",max_signals:"최대 신호 수",category_filter:"카테고리 필터 (다중 선택)",multi_select_hint:"여러 카테고리를 선택하려면 Cmd/Ctrl를 누르세요.",schedule_hint:"참고: 예약은 아직 자동화되지 않았습니다.",prompt_override:"사용자 정의 프롬프트 재정의 (선택 사항)",prompt_placeholder:"이 엔진 유형에 대한 기본 프롬프트를 재정의합니다...",delete_confirm:"정말 삭제하시겠습니까?",confirm:"확인",copied_json:"JSON이 클립보드에 복사되었습니다",json_footer:"이 JSON에는 데스크톱 스튜디오에 필요한 전체 컨텍스트(신호 + 사용자 페르소나)가 포함되어 있습니다."},DF={title:"계정 설정",desc:"Alchemist 프로필 및 에센스 링크를 관리합니다.",profile:"프로필",security:"보안",supabase:"Supabase",first_name:"이름",last_name:"성",email_locked:"이메일 주소 (잠금됨)",sound_effects:"사운드 효과",sound_desc:"동기화 이벤트 및 신호 검색에 대한 오디오 피드백을 활성화합니다.",sign_out:"로그아웃",logout_desc:"현재 세션을 종료하고 로그인 화면으로 돌아갑니다.",preserve_profile:"프로필 저장",security_title:"엔트로피 키 업데이트",new_password:"새 비밀번호",confirm_password:"비밀번호 확인",password_mismatch:"비밀번호가 일치하지 않습니다.",password_too_short:"엔트로피가 너무 낮습니다. 최소 8자 이상이어야 합니다.",password_rotate_success:"키 교체 성공.",rotate_key:"키 교체",essence_resonance:"에센스 공명",byok_desc:"지능 보존을 위해 자신의 키(BYOK)를 사용합니다.",established_link:"연결됨",env_notice:"환경 변수에서 활성화되었습니다. UI 재정의가 가능합니다.",realign_link:"링크 재정렬",sever_link:"링크 끊기",sever_confirm:"이 에센스와의 연결을 끊으시겠습니까? 로컬 공명이 초기화됩니다.",anon_secret_fragment:"익명 비밀 프래그먼트",no_resonance:"에센스 공명 없음",no_resonance_desc:"Alchemist는 지능 프래그먼트를 저장하기 위해 클라우드 코어가 필요합니다.",initiate_link:"링크 시작",test_connection:"연결 테스트"},MF={title:"시스템 로그",desc:"동기화 실행, 소스 및 URL 처리의 상세 내역",blacklist_suggestion:"블랙리스트 제안",blacklist_desc:"차단 후보",recent_errors:"최근 오류",errors_desc:"실패한 URL 처리",total_signals:"총 신호",signals_desc:"성공적으로 추출됨",blacklist_modal_title:"블랙리스트 제안",blacklist_modal_desc:"낮은 점수를 바탕으로 블랙리스트에 제안된 도메인을 검토합니다.",no_suggestions:"현재 제안 없음",quality_good:"신호 품질이 좋습니다!",signals_count:"{{count}}개 신호",avg_score:"평균 점수: {{score}}",low_quality:"지속적으로 낮은 품질",repetitive:"반복적인 패턴",blacklist_domain:"도메인 블랙리스트 추가",errors_modal_title:"최근 오류",errors_modal_desc:"최근 실패 및 문제 로그.",no_recent_errors:"최근 오류가 없습니다.",signals_modal_title:"찾은 신호",signals_modal_desc:"추출된 신호 내역을 검색하고 관리합니다.",search_placeholder:"신호 검색...",any_score:"모든 점수",high_score:"높음 (80%+)",medium_score:"중간 (50-79%)",low_score:"낮음 (<50%)",all_categories:"모든 카테고리",page_x:"페이지 {{page}}"},zF={title:"Alchemist 엔진",live:"라이브",clear:"지우기",idle:"대기 중. 신호 마이닝 이벤트를 기다리는 중...",run_completed:"마이닝 실행 완료",signals:"신호",urls:"URL",skipped:"건너뜀",failed_to_process:"{{count}}개의 URL 처리에 실패했습니다",view_logs:"로그 보기",hide_details:"상세 숨기기",view_details:"상세 보기",engine_log:"라이브 엔진 로그",stop_sync:"동기화 중지",state_reading:"읽기 중",state_thinking:"생각 중",state_signal:"신호 발견",state_skipped:"건너뜀",state_error:"오류",state_completed:"완료",msg_reading:"콘텐츠 읽는 중: {{url}}",msg_thinking:"{{title}}의 관련성 분석 중",msg_found_signal:"신호 발견: {{summary}} ({{score}}%)",msg_low_signal:"검토를 위해 저장된 낮은 신호 ({{score}}%): {{title}}",msg_failed:"{{title}} 분석 실패: {{error}}",msg_sync_completed:"동기화 완료: 신호 {{signals}}개 발견, {{skipped}}개 건너뜀, {{errors}}개 오류"},FF={switch_light:"라이트 모드로 전환",switch_dark:"다크 모드로 전환",view_changelog:"변경 이력 보기",release_notes:"릴리스 노트",changelog_error:"변경 이력을 불러오지 못했습니다."},$F={title:"신호 펄스",mining:"마이닝 중",standing_by:"대기 중",idle:"유휴 상태",tracked:"추적된 신호",avg_score:"평균 점수",top_signal:"최고 신호",latest:"최근",awaiting:"마이닝 대기 중",no_signals:"아직 신호 없음"},UF={title:"인텔리전스 엔진",subtitle:"알케미스트의 인지 파라미터와 제공자 링크를 미세 조정하세요.",configuration:"AI 구성",test_connection:"연결 테스트",save_config:"구성 저장",llm_provider:"LLM 제공자",embedding_provider:"임베딩 제공자",sdk_connected:"SDK 연결됨",sdk_not_available:"SDK 사용 불가",provider:"제공자",intelligence_model:"인텔리전스 모델",embedding_model:"임베딩 모델",loading_providers:"제공자 로딩 중...",sdk_info_success:"✓ RealTimeX 설정된 제공자 사용 중",sdk_info_fail:"⚠️ RealTimeX SDK가 감지되지 않았습니다. RealTimeX Desktop에서 구성하세요.",embedding_info_success:"✓ RealTimeX 설정된 제공자를 사용하여 임베딩이 생성됩니다",embedding_info_fail:"⚠️ RealTimeX SDK가 감지되지 않았습니다. RealTimeX Desktop에서 제공자를 구성하세요.",persona_title:"페르소나 메모리",save_memory:"메모리 저장",interests_title:"활발한 관심사",interests_priority:"높은 우선순위",interests_desc:"알케미스트는 이 주제와 일치하는 콘텐츠를 우선시합니다. 즐겨찾기 및 부스트를 기반으로 자동 업데이트됩니다.",interests_placeholder:"예: 사용자는 React 성능, Rust 백엔드 시스템 및 AI 에이전트 아키텍처에 집중함...",antipatterns_title:"안티 패턴",antipatterns_priority:"회피",antipatterns_desc:"알케미스트는 이 패턴과 일치하는 콘텐츠를 필터링하거나 점수를 낮춥니다. 거부를 통해 업데이트됩니다.",antipatterns_placeholder:"예: 마케팅 수식어, 일반적인 목록형 기사, 크립토 하이프를 싫어함...",browser_sources:"브라우저 히스토리 소스",save_browser:"브라우저 소스 저장",blacklist_title:"블랙리스트 도메인",blacklist_desc:"이 패턴을 포함하는 URL은 마이닝 중에 건너뜁니다. 한 줄에 하나의 패턴을 입력하세요.",blacklist_label:"도메인 패턴 (한 줄에 하나)",blacklist_placeholder:`google.com/search
|
|
163
|
+
localhost:
|
|
164
|
+
127.0.0.1
|
|
165
|
+
facebook.com
|
|
166
|
+
twitter.com
|
|
167
|
+
instagram.com
|
|
168
|
+
linkedin.com/feed`,blacklist_examples:"예: google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"블랙리스트 저장",blocked_tags_title:"차단된 태그",blocked_tags_desc:"이 태그가 있는 신호는 동적 카테고리 생성 및 뉴스레터에서 제외됩니다. 한 줄에 하나의 태그를 입력하세요.",blocked_tags_label:"태그 (세미콜론으로 구분)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"완전한 제어권이 있습니다. 이 태그들은 시스템 기본값을 완전히 대체합니다.",save_blocked_tags:"차단된 태그 저장",save_error_login:"설정을 저장하려면 로그인하세요",save_error_persona:"페르소나를 저장하려면 로그인하세요",save_success_llm:"LLM 설정이 성공적으로 저장되었습니다",save_success_browser:"브라우저 소스가 성공적으로 저장되었습니다",save_success_blacklist:"블랙리스트가 성공적으로 업데이트되었습니다",save_success_tags:"차단된 태그가 성공적으로 업데이트되었습니다",save_success_persona:"페르소나가 성공적으로 업데이트되었습니다",test_success:"연결 성공! {{model}}",test_fail:"연결 실패: {{message}}",auto_detect_title:"브라우저 자동 감지",scan_system:"시스템 스캔",scanning:"스캔 중...",auto_detected:"자동 감지됨",custom:"사용자 정의",add_source:"소스 추가",already_added:"이미 추가됨",not_found:"이 시스템에서 찾을 수 없음",add_custom_path:"사용자 정의 경로 추가",custom_path_placeholder:"/경로/대상/브라우저/History",add_custom_source:"사용자 정의 소스 추가",validating:"확인 중...",configured_sources:"구성된 소스 ({{count}})",enabled:"활성화됨",disabled:"비활성화됨",invalid_path:"잘못된 경로: {{error}}",validation_failed:"경로 확인 실패",discovered_sources:"{{count}}개의 브라우저 소스 발견",no_sources_found:"브라우저 소스를 찾을 수 없음",auto_discover_sources:"소스 자동 검색",auto_discover_hint:"모든 브라우저 프로필의 기록 경로를 자동으로 찾습니다."},BF={common:TF,tabs:AF,setup:RF,auth:PF,discovery:OF,chat:LF,transmute:IF,account:DF,logs:MF,terminal:zF,shell:FF,stats:$F,engine:UF},VF={save:"保存",cancel:"キャンセル",loading:"読み込み中...",error:"エラー",success:"成功",settings:"設定",search:"検索",back:"戻る",all:"すべて",delete:"削除",update:"更新",edit:"編集",close:"閉じる",complete:"完了",skip:"スキップ",begin:"開始",connection:"接続",setup:"セットアップ",project:"プロジェクト",account:"アカウント",logout:"ログアウト",welcome:"ようこそ",dark_mode:"ダークモード",light_mode:"ライトモード",collapse:"折り畳む",just_now:"たった今",enabled:"有効",disabled:"無効",quick:"高速 (5)",balanced:"標準 (50)",thorough:"詳細 (200)",resetting:"リセット中...",saving:"保存中...",locale_code:"ja-JP",categories:{ai_ml:"AI & ML",business:"ビジネス",politics:"政治",technology:"テクノロジー",finance:"金融",crypto:"クリプト",science:"科学",other:"その他"}},qF={discovery:"ディスカバリー",chat:"チャット",transmute:"トランスミュート",logs:"システムログ",history:"履歴"},HF={welcome_title:"エンジンの組み立て",welcome_desc:"Alchemyは、シグナルの断片とインテリジェンスパターンを保存するためにSupabaseのエッセンスを必要とします。",requirements:"要件:",project_url:"SupabaseプロジェクトURL",anon_key:"Anon公開APIキー",db_password:"データベースパスワード",project_url_placeholder:"https://xxx.supabase.co または project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"初期化を開始",connect_essence:"エッセンスを接続",credentials_title:"エッセンスの座標",credentials_desc:"錬金術エンジンのクラウドデータベースへのリンク",validating:"リンクを検証中",resonance:"レゾナンスを同期中...",init_schema:"スキーマを初期化",schema_desc:"データベースマイグレーションを実行して、必要なテーブルと関数をセットアップします。",project_id:"プロジェクトID",access_token:"アクセストークン",run_migrations:"マイグレーションを実行",running_migrations:"マイグレーションを実行中",take_minute:"1分ほどかかる場合があります...",engine_aligned:"エンジンの調整完了",restarting:"Alchemistサブシステムを再起動中...",forge_project:"Supabaseでプロジェクトを作成",project_id_help:"Supabaseダッシュボード → プロジェクト設定 → 一般で確認できます",access_token_help:"ここで生成:",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"プロジェクトIDが必要です",access_token_required:"アクセストークンが必要です",migration_failed_logs:"マイグレーションに失敗しました。詳細はログを確認してください。",stream_error:"マイグレーションストリームの読み取りに失敗しました",back:"戻る",retry:"再試行",choose_setup_path:"セットアップパスを選択",forge_how:"エンジンをどのように構築しますか?",quick_launch:"クイック起動",quick_launch_desc:"Supabaseプロジェクトを自動作成(アクセストークンが必要)",manual_connection:"手動接続",manual_connection_desc:"既存のプロジェクトにリンク(url & anonキーが必要)",quick_provision_desc:"アクセストークンを提供してすべてを自動プロビジョニング",get_token:"トークンを取得",project_name:"プロジェクト名",project_name_placeholder:"例: 私のAlchemyエンジン",organization:"組織",region:"リージョン",launch_engine:"エンジンを起動",provisioning_forge:"プロビジョニング フォージ",building_instance:"プライベートsupabaseインスタンスを構築中...",regions:{"us-east-1":"米国東部 (バージニア北部)","us-west-1":"米国西部 (カリフォルニア北部)","eu-central-1":"ヨーロッパ (フランクフルト)","eu-west-2":"ヨーロッパ (ロンドン)","ap-southeast-1":"アジアパシフィック (シンガポール)","ap-southeast-2":"アジアパシフィック (シドニー)","sa-east-1":"南米 (サンパウロ)"}},KF={title_init:"マスター初期化",title_join:"サークルに参加",title_mystic:"神秘的なアクセス",title_login:"錬金術師ログイン",desc_init:"最高の錬金術師アカウントを作成",desc_mystic_email:"エッセンスメールを入力",desc_mystic_code:"聖なるコードを変換",desc_login:"データをインテリジェンスに変換",first_name:"名前",last_name:"苗字",first_name_placeholder:"ゾシモス",last_name_placeholder:"パノポリス",email_address:"メールアドレス",email_placeholder:"alchemist@example.com",complexity_key:"複雑性キー",password_placeholder:"••••••••",init_account:"アカウントを初期化",send_code:"コードを送信",unseal_engine:"エンジンの封印を解除",verify_code:"コードを確認",change_email:"メールアドレスを変更",sign_in_code:"コードでログイン",sign_in_password:"パスワードでログイン",already_alchemist:"すでに錬金術師ですか?",new_to_alchemy:"Alchemyは初めてですか?",login_instead:"代わりにログイン",create_account:"アカウントを作成",session_failed:"セッションの作成に失敗しました",invalid_code:"無効なコード"},WF={filters:"フィルター",category:"カテゴリ",intelligence_score:"インテリジェンススコア",no_signals_in_category:"{{category}}にはまだシグナルがありません。",no_categories:"まだカテゴリはありません。",discovery_hint:"シグナルが発見されると、ここに整理されます。",loading_signals:"シグナルを読み込み中...",dismiss_hint:"非表示にする(興味がない)",signal_count_one:"{{count}} 個のシグナル",signal_count_other:"{{count}} 個のシグナル",time_min_ago:"{{count}}分前",time_hour_ago:"{{count}}時間前",time_day_ago:"{{count}}日前",high_confidence:"高い信頼性 - {{count}}個の情報源で見つかりました",new_signals:"新しいシグナル",smart_summary:"スマート要約",entities:"エンティティ",sources:"ソース",last_sync:"最終同期",syncnow:"今すぐ同期",all_time:"全期間",checkpoint:"チェックポイント",from:"開始",score_high:"高",score_medium:"中",score_low:"低",sources_count:"{{count}}個の情報源",open_source:"開く",add_note:"ノート",boost_topic:"トピックを強化",boosted:"強化済み",dismissed:"非表示",remove_favourite:"お気に入りから削除",add_favourite:"お気に入りに追加",sync_history:"同期履歴",syncing:"同期中...",sync_settings:"同期設定",discovered:"発見日",original_source:"元のソース",ai_summary:"AI要約",full_content:"全文表示",copied:"コピーしました!",open_link:"開く",detail_title:"シグナルの詳細",sync_from:"同期開始日(任意)",urls_per_sync:"同期ごとのURL数",sync_from_hint:"最後の同期以降の新しいURLのみを同期する場合は空にしてください。特定の時点からURLを処理する場合は日付を設定します。",reset_checkpoint:"チェックポイントをリセット",reset_checkpoint_hint:"同期チェックポイントをクリアして、開始日からフル再同期を強制します。",sync_info:"アルケミストは進捗を自動的に追跡します。「同期開始日」を使用して履歴を補完するか、「チェックポイントをリセット」して最初からやり直してください。",save_settings:"設定を保存",sync_saved:"同期設定を保存しました",checkpoint_reset:"チェックポイントをリセットしました",login_to_save:"設定を保存するにはログインしてください",login_to_reset:"チェックポイントをリセットするにはログインしてください",discovery_failed:"検出に失敗しました。設定を確認してください。",welcome_title:"Alchemistへようこそ!",welcome_desc:"ブラウザ履歴を接続してシグナルの検出を開始します。訪問したページを自動的に分析し、AI、技術などに関する言及を見つけます。",auto_detect_sync:"自動検出と同期",privacy_first:"プライバシー第一",offline_first:"オフライン第一"},GF={history:"履歴",ask_anything:"閲覧履歴について何でも聞いてください...",sources:"ソース",processing:"クエリを処理中...",new_chat:"新しいチャット",no_messages:"まだメッセージはありません。会話を始めましょう!",no_history:"チャット履歴はまだありません。",title:"アルケミストに聞く",desc:"閲覧履歴から情報を思い出したり、トピックを要約したり、洞察を見つけるお手伝いをします。",thinking:"メモリを探索中...",placeholder:"履歴について質問する...",error_message:"申し訳ありません。リクエストの処理中にエラーが発生しました。",relevant_context:"関連するコンテキスト",match_score:"{{score}}% 一致",rag_attribution:"アルケミストは回答のために {{count}} 個のシグナルを使用しました",suggestions:{react:"最近Reactについて何を読みましたか?",ai:"最近見たAIニュースを要約して。",finance:"金融に関するメモはありますか?",performance:"「パフォーマンス」に関する記事を見つけて。"}},JF={engines:"Alchemistエンジン",assets:"生成されたアセット",newsletter:"ニュースレター",thread:"スレッド",audio:"オーディオ",report:"レポート",title:"トランスミュートエンジン",desc:"アクティブな生成パイプラインとアセット",generate:"生成",processing_desktop:"デスクトップで処理中...",ensure_defaults:"デフォルトエンジンの確認",create_engine:"エンジン作成",no_assets:"生成されたアセットはまだありません。",generate_engines:"エンジン生成",new_engine:"新規エンジン",no_engines:"エンジンが設定されていません",no_engines_desc:"シグナルをニュースレター、スレッド、またはオーディオブリーフィングに自動的に変換하는最初のパイプラインを作成しましょう。",run_engine:"エンジン実行",running:"実行中...",last_run:"最終実行",never:"未実行",schedule:"スケジュール",manual:"手動",topic:"トピック",pipeline:"パイプライン",pause:"停止",resume:"再開",view_json:"制作要約JSONを表示",json_contract:"ステートレスで自己完結型の契約",json_desc:"このJSONには、Desktop Studioに必要な完全なコンテキスト(シグナル + ユーザーペルソナ)が含まれています。",generating_asset:"アセット生成中...",queued_desktop:"デスクトップで待機中...",desktop_processing:"RealTimeXデスクトップアプリがこのリクエストを処理しています。完了すると、このモーダルは自動的に更新されます。",unsupported_type:"サポートされていないアセットタイプ",edit_engine:"エンジン編集",engine_name:"エンジン名",type:"タイプ",status:"ステータス",execution_env:"実行環境",local_llm:"ローカル (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (エージェントスウォーム)",env_desc_desktop:"オーディオ/ビデオなどの重いタスクをデスクトップアプリに委任します。",env_desc_local:"単純なMarkdownタスクをAlchemyで直接実行します。",min_score:"最小スコア",max_signals:"最大シグナル数",category_filter:"カテゴリフィルター (複数選択)",multi_select_hint:"Cmd/Ctrlを押しながら複数のカテゴリを選択できます",schedule_hint:"注意:スケジューリングはまだ自動化されていません",prompt_override:"カスタムプロンプトの上書き (オプション)",prompt_placeholder:"このエンジンタイプのデフォルトプロンプトを上書きする...",delete_confirm:"本当に削除しますか?",confirm:"確認",copied_json:"JSONをクリップボードにコピーしました",json_footer:"このJSONには、Desktop Studioに必要な完全なコンテキスト(シグナル + ユーザーペルソナ)が含まれています。"},XF={title:"アカウント構成",desc:"Alchemistのプロフィールとエッセンスリンクを管理します。",profile:"プロフィール",security:"セキュリティ",supabase:"Supabase",first_name:"名",last_name:"姓",email_locked:"メールアドレス (ロック済み)",sound_effects:"サウンドエフェクト",sound_desc:"同期イベントやシグナル発見時のサウンドフィードバックを有効にします。",sign_out:"サインアウト",logout_desc:"現在のセッションを終了し、ログイン画面に戻ります。",preserve_profile:"プロフィールを保存",security_title:"エントロピーキーの更新",new_password:"新しいパスワード",confirm_password:"パスワードの確認",password_mismatch:"複雑性キーが一致しません。",password_too_short:"エントロピーが低すぎます。最低8文字必要です。",password_rotate_success:"キーのローテーションに成功しました。",rotate_key:"キーをローテーション",essence_resonance:"エッセンス共鳴",byok_desc:"インテリジェンスの永続性のために独自のキー(BYOK)を持ち込みます。",established_link:"リンク確立済み",env_notice:"環境変数からアクティブです。UI上書きが有効です。",realign_link:"リンクを再調整",sever_link:"リンクを切断",sever_confirm:"このエッセンスとの接続を切断しますか?ローカルの共鳴がリセットされます。",anon_secret_fragment:"匿名シークレットフラグメント",no_resonance:"エッセンス共鳴なし",no_resonance_desc:"Alchemistはインテリジェンスフラグメントを保存するためにクラウドコアを必要とします。",initiate_link:"リンクを開始",test_connection:"接続テスト"},YF={title:"システムログ",desc:"同期実行、ソース、URL処理の詳細な履歴",blacklist_suggestion:"潜在的なブラックリスト",blacklist_desc:"ブロック対象の候補",recent_errors:"最近のエラー",errors_desc:"失敗したURLプロセス",total_signals:"総シグナル数",signals_desc:"正常にマイニングされました",blacklist_modal_title:"ブラックリストの提案",blacklist_modal_desc:"低スコアに基づいてブラックリストに提案されたドメインを確認します。",no_suggestions:"現在、提案はありません",quality_good:"シグナルの品質は良好です!",signals_count:"{{count}} 個のシグナル",avg_score:"平均スコア: {{score}}",low_quality:"一貫して低い品質",repetitive:"反復的なパターン",blacklist_domain:"ドメインをブラックリストに登録",errors_modal_title:"最近のエラー",errors_modal_desc:"最近の失敗と問題のログです。",no_recent_errors:"最近のエラーは見つかりませんでした。",signals_modal_title:"見つかったシグナル",signals_modal_desc:"マイニングされたシグナルの履歴を閲覧・管理します。",search_placeholder:"シグナルを検索...",any_score:"すべてのスコア",high_score:"高 (80%+)",medium_score:"中 (50-79%)",low_score:"低 (<50%)",all_categories:"すべてのカテゴリ",page_x:"{{page}} ページ"},QF={title:"Alchemistエンジン",live:"ライブ",clear:"クリア",idle:"待機中。シグナルマイニングイベントを待っています...",run_completed:"マイニング実行完了",signals:"シグナル",urls:"URL",skipped:"スキップ済み",failed_to_process:"{{count}}個のURLの処理に失敗しました",view_logs:"ログを表示",hide_details:"詳細を隠す",view_details:"詳細を表示",engine_log:"ライブエンジンログ",stop_sync:"同期を停止",state_reading:"読み取り中",state_thinking:"思考中",state_signal:"シグナル",state_skipped:"スキップ",state_error:"エラー",state_completed:"完了",msg_reading:"コンテンツを読み取り中: {{url}}",msg_thinking:"{{title}} の関連性を分析中",msg_found_signal:"シグナルを発見: {{summary}} ({{score}}%)",msg_low_signal:"レビュー用に保存された低スコアのシグナル ({{score}}%): {{title}}",msg_failed:"{{title}} の分析に失敗しました: {{error}}",msg_sync_completed:"同期完了: {{signals}} 個のシグナルを発見、{{skipped}} 個スキップ、{{errors}} 個のエラー"},ZF={switch_light:"ライトモードに切り替え",switch_dark:"ダークモードに切り替え",view_changelog:"変更履歴を表示",release_notes:"リリースノート",changelog_error:"変更履歴の読み込みに失敗しました。"},e$={title:"シグナルパルス",mining:"マイニング中",standing_by:"待機中",idle:"アイドル",tracked:"追跡されたシグナル",avg_score:"平均スコア",top_signal:"トップシグナル",latest:"最新",awaiting:"マイニング待機中",no_signals:"まだシグナルはありません"},t$={title:"インテリジェンスエンジン",subtitle:"アルケミストの認知パラメータとプロバイダーのリンクを微調整します。",configuration:"AI構成",test_connection:"接続テスト",save_config:"構成を保存",llm_provider:"LLMプロバイダー",embedding_provider:"埋め込みプロバイダー",sdk_connected:"SDK接続済み",sdk_not_available:"SDK利用不可",provider:"プロバイダー",intelligence_model:"インテリジェンスモデル",embedding_model:"埋め込みモデル",loading_providers:"プロバイダーを読み込み中...",sdk_info_success:"✓ RealTimeXで設定されたプロバイダーを使用中",sdk_info_fail:"⚠️ RealTimeX SDKが検出されませんでした。RealTimeX Desktopで構成してください。",embedding_info_success:"✓ 埋め込みはRealTimeXで設定されたプロバイダーを使用して生成されます",embedding_info_fail:"⚠️ RealTimeX SDKが検出されませんでした。RealTimeX Desktopでプロバイダーを構成してください。",persona_title:"ペルソナメモリ",save_memory:"メモリを保存",interests_title:"アクティブな関心事",interests_priority:"高優先度",interests_desc:"アルケミストは、これらのトピックに一致するコンテンツを優先します。お気に入りやブーストに基づいて自動的に更新されます。",interests_placeholder:"例:ユーザーはReactのパフォーマンス、Rustのバックエンドシステム、AIエージェントアーキテクチャに焦点を当てています...",antipatterns_title:"アンチパターン",antipatterns_priority:"回避",antipatterns_desc:"アルケミストは、これらのパターンに一致するコンテンツをフィルタリングしたりスコアを下げたりします。非表示(Dismissals)を介して更新されます。",antipatterns_placeholder:"例:マーケティングの虚飾、一般的なリスト記事、クリプトの誇大広告を嫌います...",browser_sources:"ブラウザ履歴ソース",save_browser:"ブラウザソースを保存",blacklist_title:"ドメインブラックリスト",blacklist_desc:"これらのパターンを含むURLはマイニング中にスキップされます。1行に1つのパターンを入力してください。",blacklist_label:"ドメインパターン(1行1つ)",blacklist_placeholder:`google.com/search
|
|
169
|
+
localhost:
|
|
170
|
+
127.0.0.1
|
|
171
|
+
facebook.com
|
|
172
|
+
twitter.com
|
|
173
|
+
instagram.com
|
|
174
|
+
linkedin.com/feed`,blacklist_examples:"例:google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"ブラックリストを保存",blocked_tags_title:"ブロックされたタグ",blocked_tags_desc:"これらのタグを持つシグナルは、動的なカテゴリ生成やニュースレターから除外されます。1行に1つのタグを入力してください。",blocked_tags_label:"タグ(セミコロン区切り)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"完全な制御が可能です。これらのタグはシステムのデフォルトを完全に置き換えます。",save_blocked_tags:"ブロックされたタグを保存",save_error_login:"設定を保存するにはログインしてください",save_error_persona:"ペルソナを保存するにはログインしてください",save_success_llm:"LLM設定が正常に保存されました",save_success_browser:"ブラウザソースが正常に保存されました",save_success_blacklist:"ブラックリストが正常に更新されました",save_success_tags:"ブロックされたタグが正常に更新されました",save_success_persona:"ペルソナが正常に更新されました",test_success:"接続成功! {{model}}",test_fail:"接続失敗: {{message}}",auto_detect_title:"ブラウザの自動検出",scan_system:"システムをスキャン",scanning:"スキャン中...",auto_detected:"自動検出済み",custom:"カスタム",add_source:"ソースを追加",already_added:"追加済み",not_found:"このシステムでは見つかりません",add_custom_path:"カスタムパスを追加",custom_path_placeholder:"/path/to/browser/History",add_custom_source:"カスタムソースを追加",validating:"検証中...",configured_sources:"構成済みソース ({{count}})",enabled:"有効",disabled:"無効",invalid_path:"無効なパス: {{error}}",validation_failed:"パスの検証に失敗しました",discovered_sources:"{{count}}個のブラウザソースを検出しました",no_sources_found:"ブラウザソースが見つかりませんでした",auto_discover_sources:"ソースを自動検出",auto_discover_hint:"すべてのブラウザプロファイルの履歴パスを自動的に検出します。"},n$={common:VF,tabs:qF,setup:HF,auth:KF,discovery:WF,chat:GF,transmute:JF,account:XF,logs:YF,terminal:QF,shell:ZF,stats:e$,engine:t$},r$={save:"Lưu",cancel:"Hủy",loading:"Đang tải...",error:"Lỗi",success:"Thành công",settings:"Cài đặt",search:"Tìm kiếm",back:"Quay lại",all:"Tất cả",delete:"Xóa",update:"Cập nhật",edit:"Chỉnh sửa",close:"Đóng",complete:"Hoàn tất",skip:"Bỏ qua",begin:"Bắt đầu",connection:"Kết nối",setup:"Thiết lập",project:"Dự án",account:"Tài khoản",logout:"Đăng xuất",welcome:"Chào mừng",dark_mode:"Chế độ tối",light_mode:"Chế độ sáng",collapse:"Thu gọn",just_now:"Vừa xong",enabled:"Đã bật",disabled:"Đã tắt",quick:"Nhanh (5)",balanced:"Cân bằng (50)",thorough:"Kỹ lưỡng (200)",resetting:"Đang đặt lại...",saving:"Đang lưu...",locale_code:"vi-VN",categories:{ai_ml:"AI & ML",business:"Kinh doanh",politics:"Chính trị",technology:"Công nghệ",finance:"Tài chính",crypto:"Crypto",science:"Khoa học",other:"Khác"}},s$={discovery:"Khám phá",chat:"Chat",transmute:"Chuyển hóa",logs:"Nhật ký hệ thống",history:"Lịch sử"},i$={welcome_title:"Lắp ráp động cơ của bạn",welcome_desc:"Alchemy yêu cầu một tinh chất Supabase để lưu trữ các mảnh tín hiệu và mô hình thông minh.",requirements:"Yêu cầu:",project_url:"URL dự án Supabase",anon_key:"Khóa API công khai Anon",db_password:"Mật khẩu cơ sở dữ liệu",project_url_placeholder:"https://xxx.supabase.co hoặc project-id",anon_key_placeholder:"eyJ...",project_id_placeholder:"abcdefghijklm",access_token_placeholder:"sbp_...",begin_init:"BẮT ĐẦU KHỞI TẠO",connect_essence:"KẾT NỐI TINH CHẤT",credentials_title:"Tọa độ Tinh chất",credentials_desc:"Liên kết động cơ giả kim với cơ sở dữ liệu đám mây của bạn",validating:"Đang xác thực liên kết",resonance:"Đang đồng bộ hóa cộng hưởng...",init_schema:"Khởi tạo lược đồ",schema_desc:"Chạy di chuyển cơ sở dữ liệu để thiết lập các bảng và hàm bắt buộc.",project_id:"ID dự án",access_token:"Mã thông báo truy cập",run_migrations:"CHẠY DI CHUYỂN",running_migrations:"Đang chạy di chuyển",take_minute:"Việc này có thể mất một phút...",engine_aligned:"Động cơ đã căn chỉnh",restarting:"Đang khởi động lại các hệ thống con Alchemist...",forge_project:"Tạo Dự án tại Supabase",project_id_help:"Tìm thấy trong Bảng điều khiển Supabase → Cài đặt Dự án → Chung",access_token_help:"Tạo tại",access_token_link:"supabase.com/dashboard/account/tokens",project_id_required:"ID dự án là bắt buộc",access_token_required:"Mã thông báo truy cập là bắt buộc",migration_failed_logs:"Di chuyển thất bại. Kiểm tra nhật ký để biết chi tiết.",stream_error:"Không thể đọc luồng di chuyển",back:"QUAY LẠI",retry:"THỬ LẠI",choose_setup_path:"Chọn Đường Dẫn Thiết Lập",forge_how:"bạn muốn tạo động cơ của mình như thế nào?",quick_launch:"Khởi Động Nhanh",quick_launch_desc:"Tự động tạo dự án Supabase cho tôi (yêu cầu Mã Truy Cập)",manual_connection:"Kết Nối Thủ Công",manual_connection_desc:"liên kết với dự án hiện có (yêu cầu url & anon key)",quick_provision_desc:"cung cấp mã truy cập của bạn để tự động cung cấp mọi thứ",get_token:"LẤY MÃ",project_name:"Tên Dự Án",project_name_placeholder:"vd: Động Cơ Alchemy Của Tôi",organization:"Tổ Chức",region:"Khu Vực",launch_engine:"Khởi Động Động Cơ",provisioning_forge:"Lò Rèn Cung Cấp",building_instance:"đang xây dựng phiên bản supabase riêng tư của bạn...",regions:{"us-east-1":"Mỹ Đông (N. Virginia)","us-west-1":"Mỹ Tây (N. California)","eu-central-1":"Châu Âu (Frankfurt)","eu-west-2":"Châu Âu (London)","ap-southeast-1":"Châu Á Thái Bình Dương (Singapore)","ap-southeast-2":"Châu Á Thái Bình Dương (Sydney)","sa-east-1":"Nam Mỹ (São Paulo)"}},o$={title_init:"KHỞI TẠO BẬC THẦY",title_join:"GIA NHẬP VÒNG TRÒN",title_mystic:"TRUY CẬP HUYỀN BÍ",title_login:"ĐĂNG NHẬP NHÀ GIẢ KIM",desc_init:"Rèn luyện tài khoản nhà giả kim tối cao",desc_mystic_email:"Nhập email tinh chất của bạn",desc_mystic_code:"Chuyển hóa mã số thiêng liêng",desc_login:"Chuyển hóa dữ liệu của bạn thành trí thông minh",first_name:"Tên",last_name:"Họ",first_name_placeholder:"Zosimos",last_name_placeholder:"Panopolis",email_address:"Địa chỉ Email",email_placeholder:"alchemist@example.com",complexity_key:"Khóa phức tạp",password_placeholder:"••••••••",init_account:"KHỞI TẠO TÀI KHOẢN",send_code:"GỬI MÃ",unseal_engine:"MỞ KHÓA ĐỘNG CƠ",verify_code:"XÁC MINH MÃ",change_email:"Thay đổi địa chỉ email",sign_in_code:"Đăng nhập bằng mã",sign_in_password:"Đăng nhập bằng mật khẩu",already_alchemist:"Đã là một Nhà Giả Kim?",new_to_alchemy:"Mới làm quen với Alchemy?",login_instead:"Đăng nhập ngay",create_account:"Tạo tài khoản",session_failed:"Tạo phiên làm việc thất bại",invalid_code:"Mã không hợp lệ"},a$={filters:"Bộ lọc",category:"Danh mục",intelligence_score:"Điểm thông minh",no_signals_in_category:"Chưa có tín hiệu nào trong {{category}}.",no_categories:"Chưa có danh mục nào.",discovery_hint:"Các tín hiệu sẽ được sắp xếp ở đây sau khi được khám phá.",loading_signals:"Đang tải các tín hiệu...",dismiss_hint:"Bỏ qua (Không quan tâm)",signal_count_one:"{{count}} tín hiệu",signal_count_other:"{{count}} tín hiệu",time_min_ago:"{{count}}m trước",time_hour_ago:"{{count}}h trước",time_day_ago:"{{count}}d trước",add_note_title:"Thêm ghi chú",target:"Mục tiêu",note_placeholder:"Nhập suy nghĩ, ý tưởng hoặc các hạng mục hành động liên quan đến tín hiệu này...",save_note:"Lưu ghi chú",view_all_sources:"Xem tất cả nguồn",source_count_one:"{{count}} nguồn",source_count_other:"{{count}} nguồn",source_found_in:"Tìm thấy trong {{count}} nguồn khác nhau",high_confidence:"Độ tin cậy cao - được tìm thấy trong {{count}} nguồn",new_signals:"Tín hiệu mới",smart_summary:"Tóm tắt thông minh",entities:"Thực thể",sources:"Nguồn",last_sync:"Đồng bộ cuối",syncnow:"Đồng bộ ngay",all_time:"Tất cả thời gian",checkpoint:"Điểm kiểm tra",from:"Từ ngày",score_high:"CAO",score_medium:"TRUNG BÌNH",score_low:"THẤP",sources_count:"{{count}} nguồn",open_source:"Mở",add_note:"Ghi chú",boost_topic:"Đẩy chủ đề",boosted:"Đã đẩy",dismissed:"Đã bỏ qua",remove_favourite:"Xóa khỏi yêu thích",add_favourite:"Thêm vào yêu thích",sync_history:"Lịch sử đồng bộ",syncing:"Đang đồng bộ...",sync_settings:"Cài đặt đồng bộ",discovered:"Đã khám phá",original_source:"Nguồn gốc",ai_summary:"Tóm tắt AI",full_content:"Nội dung đầy đủ",copied:"Đã sao chép!",open_link:"Mở",detail_title:"Chi tiết tín hiệu",sync_from:"Đồng bộ từ (Tùy chọn)",urls_per_sync:"URL mỗi lần đồng bộ",sync_from_hint:"Để trống để chỉ đồng bộ các URL mới kể từ lần đồng bộ cuối cùng. Đặt ngày để xử lý các URL từ thời điểm đó trở đi.",reset_checkpoint:"Đặt lại điểm kiểm tra",reset_checkpoint_hint:"Xóa điểm kiểm tra đồng bộ để buộc đồng bộ lại toàn bộ từ ngày đã chọn.",sync_info:'Nhà Giả Kim tự động theo dõi tiến trình của bạn. Sử dụng "Đồng bộ từ" để điền lịch sử hoặc "Đặt lại điểm kiểm tra" để bắt đầu mới.',save_settings:"Lưu cài đặt",sync_saved:"Đã lưu cài đặt đồng bộ",checkpoint_reset:"Đã đặt lại điểm kiểm tra",login_to_save:"Vui lòng đăng nhập để lưu cài đặt",login_to_reset:"Vui lòng đăng nhập để đặt lại điểm kiểm tra",status_updated:"Đã cập nhật trạng thái động cơ thành {{status}}",asset_ready:'Tài sản "{{title}}" đã sẵn sàng!',scanning:"Đang quét các danh mục và chủ đề mới...",discovery_complete:"Đã hoàn tất khám phá động cơ!",discovery_failed:"Khám phá thất bại. Kiểm tra cài đặt.",welcome_title:"Chào mừng đến với Alchemist!",welcome_desc:"Kết nối lịch sử trình duyệt của bạn để bắt đầu khám phá tín hiệu. Chúng tôi sẽ tự động phân tích các trang bạn đã truy cập để tìm các đề cập về AI, công nghệ và hơn thế nữa.",auto_detect_sync:"Tự động phát hiện và đồng bộ",privacy_first:"Ưu tiên riêng tư",offline_first:"Ưu tiên ngoại tuyến",load_failed:"Không thể tải động cơ",starting_run:"Đang bắt đầu chạy động cơ...",run_complete:"Đã chạy động cơ hoàn tất! Đã tạo: {{title}}",run_started_desktop:"Đã bắt đầu chạy động cơ trên Máy tính. Theo dõi là: {{id}}",run_failed:"Chạy động cơ thất bại",brief_failed:"Không thể tạo tóm tắt sản xuất",topic:"Chủ đề",pipeline:"Quy trình"},l$={history:"Lịch sử",ask_anything:"Hỏi bất cứ điều gì về lịch sử duyệt web của bạn...",sources:"Nguồn",processing:"Đang xử lý truy vấn của bạn...",new_chat:"Chat mới",no_messages:"Chưa có tin nhắn nào. Hãy bắt đầu một cuộc trò chuyện!",no_history:"Chưa có lịch sử chat.",title:"Hỏi Alchemist",desc:"Tôi có thể giúp bạn nhớ lại thông tin, tóm tắt các chủ đề và tìm thông tin chuyên sâu từ lịch sử duyệt web của bạn.",thinking:"Đang khám phá bộ nhớ...",placeholder:"Hỏi về lịch sử của bạn...",error_message:"Xin lỗi, tôi đã gặp lỗi khi xử lý yêu cầu của bạn.",relevant_context:"Ngữ cảnh liên quan",match_score:"Khớp {{score}}%",rag_attribution:"Alchemist đã sử dụng {{count}} tín hiệu này để trả lời",suggestions:{react:"Gần đây tôi đã đọc gì về React?",ai:"Tóm tắt tin tức AI mới nhất tôi đã xem.",finance:"Tôi có ghi chú nào về Tài chính không?",performance:"Tìm các bài báo về 'Hiệu suất'"}},c$={engines:"Động cơ Alchemist",assets:"Tín hiệu đã tạo",newsletter:"Bản tin",thread:"Luồng",generate:"Tạo",processing_desktop:"Đang xử lý trên máy tính...",ensure_defaults:"Đảm bảo các động cơ mặc định",create_engine:"Tạo động cơ",no_assets:"Chưa có tín hiệu nào được tạo.",title:"Động cơ Chuyển hóa",desc:"Các đường ống tạo & Tài sản đang hoạt động",generate_engines:"Tạo các động cơ",new_engine:"Động cơ mới",no_engines:"Chưa định cấu hình động cơ",no_engines_desc:"Tạo quy trình đầu tiên của bạn để tự động biến các tín hiệu thành bản tin, chuỗi bài viết hoặc bản tin âm thanh.",run_engine:"Chạy động cơ",running:"Đang chạy...",last_run:"Lần chạy cuối",never:"Chưa bao giờ",schedule:"Lịch trình",manual:"Thủ công",topic:"Chủ đề",pipeline:"Quy trình",pause:"Tạm dừng",resume:"Tiếp tục",view_json:"Xem tóm tắt sản xuất JSON",json_contract:"Hợp đồng phi trạng thái & tự chứa",json_desc:"JSON này chứa đầy đủ ngữ cảnh (Tín hiệu + Hồ sơ người dùng) cần thiết cho Desktop Studio.",generating_asset:"Đang tạo tài sản...",queued_desktop:"Đã xếp hàng cho máy tính...",desktop_processing:"Ứng dụng RealTimeX Desktop đang xử lý yêu cầu này. Cửa sổ này sẽ tự động cập nhật sau khi hoàn thành.",unsupported_type:"Loại tài sản không được hỗ trợ",edit_engine:"Sửa động cơ",engine_name:"Tên động cơ",type:"Loại",status:"Trạng thái",execution_env:"Môi trường thực thi",local_llm:"Cục bộ (Alchemy LLM)",desktop_swarm:"RealTimeX Desktop (Agent Swarm)",env_desc_desktop:"Ủy thác các tác vụ nặng như Âm thanh/Video cho ứng dụng máy tính.",env_desc_local:"Chạy các tác vụ Markdown đơn giản trực tiếp trong Alchemy.",min_score:"Điểm tối thiểu",max_signals:"Số tín hiệu tối đa",category_filter:"Lọc danh mục (chọn nhiều)",multi_select_hint:"Giữ Cmd/Ctrl để chọn nhiều danh mục",schedule_hint:"Lưu ý: Việc lập lịch chưa được tự động hóa",prompt_override:"Ghi đè lệnh tùy chỉnh (tùy chọn)",prompt_placeholder:"Ghi đè lệnh mặc định cho loại động cơ này...",delete_confirm:"Thực sự xóa?",confirm:"Xác nhận",copied_json:"Đã sao chép JSON vào bộ nhớ tạm",json_footer:"JSON này chứa ngữ cảnh đầy đủ (Tín hiệu + Nhân vật người dùng) cần thiết cho Desktop Studio."},u$={title:"Cấu hình tài khoản",desc:"Quản lý hồ sơ Alchemist và các liên kết essence của bạn.",profile:"Hồ sơ",security:"Bảo mật",supabase:"Supabase",first_name:"Tên",last_name:"Họ",email_locked:"Địa chỉ email (Đã khóa)",sound_effects:"Hiệu ứng âm thanh",sound_desc:"Bật phản hồi âm thanh cho các sự kiện đồng bộ và khám phá tín hiệu.",sign_out:"Đăng xuất",logout_desc:"Kết thúc phiên hiện tại và quay lại màn hình đăng nhập.",preserve_profile:"Lưu hồ sơ",security_title:"Cập nhật khóa Entropy",new_password:"Mật khẩu mới",confirm_password:"Xác nhận mật khẩu",password_mismatch:"Các khóa phức tạp không khớp.",password_too_short:"Độ an toàn quá thấp. Tối thiểu 8 ký tự.",password_rotate_success:"Xoay vòng khóa thành công.",rotate_key:"Xoay vòng khóa",essence_resonance:"Sự cộng hưởng Essence",byok_desc:"Sử dụng khóa riêng của bạn (BYOK) để duy trì trí thông minh.",established_link:"Liên kết đã được thiết lập",env_notice:"Đang hoạt động từ các biến môi trường. Ghi đè UI đã được bật.",realign_link:"Căn chỉnh lại liên kết",sever_link:"Ngắt kết nối",sever_confirm:"Ngắt kết nối với essence này? Điều này sẽ đặt lại sự cộng hưởng cục bộ.",anon_secret_fragment:"Mảnh bí mật ẩn danh",no_resonance:"Không có sự cộng hưởng Essence",no_resonance_desc:"Alchemist yêu cầu một lõi đám mây để lưu trữ các mảnh trí thông minh.",initiate_link:"Bắt đầu liên kết",test_connection:"Kiểm tra kết nối"},d$={title:"Nhật ký hệ thống",desc:"Lịch sử chi tiết các lần đồng bộ, nguồn và xử lý URL",blacklist_suggestion:"Danh sách đen tiềm năng",blacklist_desc:"Các ứng viên để chặn",recent_errors:"Lỗi gần đây",errors_desc:"Quy trình xử lý URL bị lỗi",total_signals:"Tổng số tín hiệu",signals_desc:"Đã khai thác thành công",blacklist_modal_title:"Gợi ý danh sách đen",blacklist_modal_desc:"Xem xét các tên miền được gợi ý đưa vào danh sách đen dựa trên điểm số thấp.",no_suggestions:"Không có gợi ý nào vào lúc này",quality_good:"Chất lượng tín hiệu của bạn có vẻ tốt!",signals_count:"{{count}} tín hiệu",avg_score:"Điểm trung bình: {{score}}",low_quality:"Chất lượng thấp liên tục",repetitive:"Mẫu lặp đi lặp lại",blacklist_domain:"Tên miền danh sách đen",errors_modal_title:"Lỗi gần đây",errors_modal_desc:"Nhật ký các lỗi và sự cố gần đây.",no_recent_errors:"Không tìm thấy lỗi gần đây.",signals_modal_title:"Tín hiệu đã tìm thấy",signals_modal_desc:"Duyệt và quản lý lịch sử tín hiệu đã khai thác của bạn.",search_placeholder:"Tìm kiếm tín hiệu...",any_score:"Bất kỳ điểm số nào",high_score:"Cao (80%+)",medium_score:"Trung bình (50-79%)",low_score:"Thấp (<50%)",all_categories:"Tất cả danh mục",page_x:"Trang {{page}}"},h$={title:"Động cơ Alchemist",live:"TRỰC TIẾP",clear:"Xóa",idle:"Đang chờ. Đang đợi các sự kiện khai thác tín hiệu...",run_completed:"Đã hoàn thành lượt khai thác",signals:"Tín hiệu",urls:"URLs",skipped:"Đã bỏ qua",failed_to_process:"{{count}} URLs xử lý thất bại",view_logs:"Xem nhật ký",hide_details:"Ẩn chi tiết",view_details:"Xem chi tiết",engine_log:"Nhật ký động cơ trực tiếp",stop_sync:"Dừng đồng bộ",state_reading:"Đang đọc",state_thinking:"Đang suy nghĩ",state_signal:"Tín hiệu",state_skipped:"Bỏ qua",state_error:"Lỗi",state_completed:"Hoàn thành",msg_reading:"Đang đọc nội dung từ: {{url}}",msg_thinking:"Đang phân tích độ liên quan của: {{title}}",msg_found_signal:"Tìm thấy tín hiệu: {{summary}} ({{score}}%)",msg_low_signal:"Tín hiệu thấp được lưu để xem xét ({{score}}%): {{title}}",msg_failed:"Phân tích thất bại cho {{title}}: {{error}}",msg_sync_completed:"Đồng bộ hoàn tất: tìm thấy {{signals}} tín hiệu, đã bỏ qua {{skipped}}, {{errors}} lỗi"},f$={switch_light:"Chuyển sang Chế độ sáng",switch_dark:"Chuyển sang Chế độ tối",view_changelog:"Xem Nhật ký thay đổi",release_notes:"Ghi chú phát hành",changelog_error:"Không thể tải nhật ký thay đổi."},p$={title:"Nhịp đập tín hiệu",mining:"Đang khai thác",standing_by:"Đang chờ",idle:"Nhàn rỗi",tracked:"Tín hiệu đã theo dõi",avg_score:"Điểm trung bình",top_signal:"Tín hiệu cao nhất",latest:"Mới nhất",awaiting:"Đang đợi khai thác",no_signals:"Chưa có tín hiệu nào"},m$={title:"Động cơ Trí tuệ",subtitle:"Tinh chỉnh các thông số nhận thức của Alchemist và các liên kết nhà cung cấp.",configuration:"Cấu hình AI",test_connection:"Kiểm tra Kết nối",save_config:"Lưu Cấu hình",llm_provider:"Nhà cung cấp LLM",embedding_provider:"Nhà cung cấp Nhúng",sdk_connected:"Đã kết nối SDK",sdk_not_available:"SDK Không khả dụng",provider:"Nhà cung cấp",intelligence_model:"Mô hình Trí tuệ",embedding_model:"Mô hình Nhúng",loading_providers:"Đang tải nhà cung cấp...",sdk_info_success:"✓ Sử dụng nhà cung cấp đã cấu hình của RealTimeX",sdk_info_fail:"⚠️ Không phát hiện thấy RealTimeX SDK. Cấu hình trong RealTimeX Desktop.",embedding_info_success:"✓ Các bản nhúng được tạo bằng nhà cung cấp đã cấu hình của RealTimeX",embedding_info_fail:"⚠️ Không phát hiện thấy RealTimeX SDK. Cấu hình nhà cung cấp trong RealTimeX Desktop.",persona_title:"Bộ nhớ Cá nhân",save_memory:"Lưu Bộ nhớ",interests_title:"Mối quan tâm Hoạt động",interests_priority:"Ưu tiên Cao",interests_desc:"Alchemist ưu tiên nội dung khớp với các chủ đề này. Được cập nhật tự động dựa trên Yêu thích & Thúc đẩy.",interests_placeholder:"vd: Người dùng tập trung vào hiệu suất React, hệ thống backend Rust và kiến trúc AI Agent...",antipatterns_title:"Mẫu Chống lại",antipatterns_priority:"Tránh",antipatterns_desc:"Alchemist lọc bỏ hoặc giảm điểm nội dung khớp với các mẫu này. Được cập nhật qua việc Bỏ qua.",antipatterns_placeholder:"vd: Không thích tiếp thị sáo rỗng, danh sách chung chung và cường điệu tiền điện tử...",browser_sources:"Nguồn Lịch sử Trình duyệt",save_browser:"Lưu Nguồn Trình duyệt",blacklist_title:"Danh sách đen Tên miền",blacklist_desc:"Các URL chứa các mẫu này sẽ bị bỏ qua trong quá trình khai thác. Nhập một mẫu mỗi dòng.",blacklist_label:"Mẫu tên miền (một mẫu mỗi dòng)",blacklist_placeholder:`google.com/search
|
|
175
|
+
localhost:
|
|
176
|
+
127.0.0.1
|
|
177
|
+
facebook.com
|
|
178
|
+
twitter.com
|
|
179
|
+
instagram.com
|
|
180
|
+
linkedin.com/feed`,blacklist_examples:"Ví dụ: google.com/search, localhost:, facebook.com, twitter.com",save_blacklist:"Lưu Danh sách đen",blocked_tags_title:"Thẻ bị Chặn",blocked_tags_desc:"Các tín hiệu có các thẻ này sẽ bị loại khỏi quá trình tạo danh mục động và bản tin. Nhập một thẻ mỗi dòng.",blocked_tags_label:"Thẻ (cách nhau bằng dấu chấm phẩy)",blocked_tags_placeholder:"login; signup; footer; navigation",blocked_tags_info:"Bạn có toàn quyền kiểm soát. Các thẻ này sẽ thay thế hoàn toàn các giá trị mặc định của hệ thống.",save_blocked_tags:"Lưu Thẻ bị Chặn",save_error_login:"Vui lòng đăng nhập để lưu cài đặt",save_error_persona:"Vui lòng đăng nhập để lưu cá nhân",save_success_llm:"Đã lưu cài đặt LLM thành công",save_success_browser:"Đã lưu nguồn trình duyệt thành công",save_success_blacklist:"Đã cập nhật danh sách đen thành công",save_success_tags:"Đã cập nhật các thẻ bị chặn thành công",save_success_persona:"Đã cập nhật cá nhân thành công",test_success:"Kết nối thành công! {{model}}",test_fail:"Kết nối thất bại: {{message}}",auto_detect_title:"Tự động phát hiện trình duyệt",scan_system:"Quét hệ thống",scanning:"Đang quét...",auto_detected:"Đã tự động phát hiện",custom:"Tùy chỉnh",add_source:"Thêm nguồn",already_added:"Đã thêm rồi",not_found:"Không tìm thấy trên hệ thống này",add_custom_path:"Thêm đường dẫn tùy chỉnh",custom_path_placeholder:"/duong/dan/den/trinh/duyet/History",add_custom_source:"Thêm nguồn tùy chỉnh",validating:"Đang xác thực...",configured_sources:"Nguồn đã cấu hình ({{count}})",enabled:"Đã bật",disabled:"Đã tắt",invalid_path:"Đường dẫn không hợp lệ: {{error}}",validation_failed:"Xác thực đường dẫn thất bại",discovered_sources:"Đã phát hiện {{count}} nguồn trình duyệt",no_sources_found:"Không tìm thấy nguồn trình duyệt nào",auto_discover_sources:"Tự động phát hiện nguồn",auto_discover_hint:"Tự động tìm đường dẫn lịch sử cho tất cả hồ sơ trình duyệt."},g$={common:r$,tabs:s$,setup:i$,auth:o$,discovery:a$,chat:l$,transmute:c$,account:u$,logs:d$,terminal:h$,shell:f$,stats:p$,engine:m$};ln.use(i1).use(bR).init({resources:{en:{translation:eF},fr:{translation:pF},es:{translation:NF},ko:{translation:BF},ja:{translation:n$},vi:{translation:g$}},supportedLngs:["en","fr","es","ko","ja","vi"],fallbackLng:"en",load:"languageOnly",interpolation:{escapeValue:!1},detection:{order:["querystring","localStorage","navigator"],caches:["localStorage"],lookupLocalStorage:"i18nextLng"}});jz();cj.createRoot(document.getElementById("root")).render(u.jsx(ia.StrictMode,{children:u.jsx(Sz,{})}));
|