Linux websever 5.15.0-153-generic #163-Ubuntu SMP Thu Aug 7 16:37:18 UTC 2025 x86_64
Apache/2.4.52 (Ubuntu)
: 192.168.3.70 | : 192.168.1.99
Cant Read [ /etc/named.conf ]
8.1.2-1ubuntu2.23
urlab
www.github.com/MadExploits
Terminal
AUTO ROOT
Adminer
Backdoor Destroyer
Linux Exploit
Lock Shell
Lock File
Create User
CREATE RDP
PHP Mailer
BACKCONNECT
UNLOCK SHELL
HASH IDENTIFIER
CPANEL RESET
CREATE WP USER
README
+ Create Folder
+ Create File
/
var /
www /
html /
cryptolab /
assets /
[ HOME SHELL ]
Name
Size
Permission
Action
index-0w2L0Rvu.css
21.86
KB
-rw-r--r--
index-D3WZlKcR.js
1014.61
KB
-rw-r--r--
Delete
Unzip
Zip
${this.title}
Close
Code Editor : index-D3WZlKcR.js
function II(n,e){for(var t=0;t<e.length;t++){const i=e[t];if(typeof i!="string"&&!Array.isArray(i)){for(const r in i)if(r!=="default"&&!(r in n)){const o=Object.getOwnPropertyDescriptor(i,r);o&&Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:()=>i[r]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))i(r);new MutationObserver(r=>{for(const o of r)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&i(l)}).observe(document,{childList:!0,subtree:!0});function t(r){const o={};return r.integrity&&(o.integrity=r.integrity),r.referrerPolicy&&(o.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?o.credentials="include":r.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function i(r){if(r.ep)return;r.ep=!0;const o=t(r);fetch(r.href,o)}})();function kI(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var sm={exports:{}},xc={},om={exports:{}},De={};/** * @license React * react.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Kx;function PI(){if(Kx)return De;Kx=1;var n=Symbol.for("react.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),r=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),l=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function x($){return $===null||typeof $!="object"?null:($=y&&$[y]||$["@@iterator"],typeof $=="function"?$:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},T=Object.assign,C={};function I($,ee,ye){this.props=$,this.context=ee,this.refs=C,this.updater=ye||b}I.prototype.isReactComponent={},I.prototype.setState=function($,ee){if(typeof $!="object"&&typeof $!="function"&&$!=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,$,ee,"setState")},I.prototype.forceUpdate=function($){this.updater.enqueueForceUpdate(this,$,"forceUpdate")};function N(){}N.prototype=I.prototype;function D($,ee,ye){this.props=$,this.context=ee,this.refs=C,this.updater=ye||b}var O=D.prototype=new N;O.constructor=D,T(O,I.prototype),O.isPureReactComponent=!0;var L=Array.isArray,G=Object.prototype.hasOwnProperty,X={current:null},k={key:!0,ref:!0,__self:!0,__source:!0};function P($,ee,ye){var Ne,je={},Fe=null,He=null;if(ee!=null)for(Ne in ee.ref!==void 0&&(He=ee.ref),ee.key!==void 0&&(Fe=""+ee.key),ee)G.call(ee,Ne)&&!k.hasOwnProperty(Ne)&&(je[Ne]=ee[Ne]);var We=arguments.length-2;if(We===1)je.children=ye;else if(1<We){for(var Xe=Array(We),Ot=0;Ot<We;Ot++)Xe[Ot]=arguments[Ot+2];je.children=Xe}if($&&$.defaultProps)for(Ne in We=$.defaultProps,We)je[Ne]===void 0&&(je[Ne]=We[Ne]);return{$$typeof:n,type:$,key:Fe,ref:He,props:je,_owner:X.current}}function R($,ee){return{$$typeof:n,type:$.type,key:ee,ref:$.ref,props:$.props,_owner:$._owner}}function F($){return typeof $=="object"&&$!==null&&$.$$typeof===n}function z($){var ee={"=":"=0",":":"=2"};return"$"+$.replace(/[=:]/g,function(ye){return ee[ye]})}var q=/\/+/g;function M($,ee){return typeof $=="object"&&$!==null&&$.key!=null?z(""+$.key):ee.toString(36)}function qe($,ee,ye,Ne,je){var Fe=typeof $;(Fe==="undefined"||Fe==="boolean")&&($=null);var He=!1;if($===null)He=!0;else switch(Fe){case"string":case"number":He=!0;break;case"object":switch($.$$typeof){case n:case e:He=!0}}if(He)return He=$,je=je(He),$=Ne===""?"."+M(He,0):Ne,L(je)?(ye="",$!=null&&(ye=$.replace(q,"$&/")+"/"),qe(je,ee,ye,"",function(Ot){return Ot})):je!=null&&(F(je)&&(je=R(je,ye+(!je.key||He&&He.key===je.key?"":(""+je.key).replace(q,"$&/")+"/")+$)),ee.push(je)),1;if(He=0,Ne=Ne===""?".":Ne+":",L($))for(var We=0;We<$.length;We++){Fe=$[We];var Xe=Ne+M(Fe,We);He+=qe(Fe,ee,ye,Xe,je)}else if(Xe=x($),typeof Xe=="function")for($=Xe.call($),We=0;!(Fe=$.next()).done;)Fe=Fe.value,Xe=Ne+M(Fe,We++),He+=qe(Fe,ee,ye,Xe,je);else if(Fe==="object")throw ee=String($),Error("Objects are not valid as a React child (found: "+(ee==="[object Object]"?"object with keys {"+Object.keys($).join(", ")+"}":ee)+"). If you meant to render a collection of children, use an array instead.");return He}function mt($,ee,ye){if($==null)return $;var Ne=[],je=0;return qe($,Ne,"","",function(Fe){return ee.call(ye,Fe,je++)}),Ne}function $t($){if($._status===-1){var ee=$._result;ee=ee(),ee.then(function(ye){($._status===0||$._status===-1)&&($._status=1,$._result=ye)},function(ye){($._status===0||$._status===-1)&&($._status=2,$._result=ye)}),$._status===-1&&($._status=0,$._result=ee)}if($._status===1)return $._result.default;throw $._result}var ke={current:null},oe={transition:null},ge={ReactCurrentDispatcher:ke,ReactCurrentBatchConfig:oe,ReactCurrentOwner:X};function le(){throw Error("act(...) is not supported in production builds of React.")}return De.Children={map:mt,forEach:function($,ee,ye){mt($,function(){ee.apply(this,arguments)},ye)},count:function($){var ee=0;return mt($,function(){ee++}),ee},toArray:function($){return mt($,function(ee){return ee})||[]},only:function($){if(!F($))throw Error("React.Children.only expected to receive a single React element child.");return $}},De.Component=I,De.Fragment=t,De.Profiler=r,De.PureComponent=D,De.StrictMode=i,De.Suspense=h,De.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ge,De.act=le,De.cloneElement=function($,ee,ye){if($==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+$+".");var Ne=T({},$.props),je=$.key,Fe=$.ref,He=$._owner;if(ee!=null){if(ee.ref!==void 0&&(Fe=ee.ref,He=X.current),ee.key!==void 0&&(je=""+ee.key),$.type&&$.type.defaultProps)var We=$.type.defaultProps;for(Xe in ee)G.call(ee,Xe)&&!k.hasOwnProperty(Xe)&&(Ne[Xe]=ee[Xe]===void 0&&We!==void 0?We[Xe]:ee[Xe])}var Xe=arguments.length-2;if(Xe===1)Ne.children=ye;else if(1<Xe){We=Array(Xe);for(var Ot=0;Ot<Xe;Ot++)We[Ot]=arguments[Ot+2];Ne.children=We}return{$$typeof:n,type:$.type,key:je,ref:Fe,props:Ne,_owner:He}},De.createContext=function($){return $={$$typeof:l,_currentValue:$,_currentValue2:$,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},$.Provider={$$typeof:o,_context:$},$.Consumer=$},De.createElement=P,De.createFactory=function($){var ee=P.bind(null,$);return ee.type=$,ee},De.createRef=function(){return{current:null}},De.forwardRef=function($){return{$$typeof:u,render:$}},De.isValidElement=F,De.lazy=function($){return{$$typeof:g,_payload:{_status:-1,_result:$},_init:$t}},De.memo=function($,ee){return{$$typeof:p,type:$,compare:ee===void 0?null:ee}},De.startTransition=function($){var ee=oe.transition;oe.transition={};try{$()}finally{oe.transition=ee}},De.unstable_act=le,De.useCallback=function($,ee){return ke.current.useCallback($,ee)},De.useContext=function($){return ke.current.useContext($)},De.useDebugValue=function(){},De.useDeferredValue=function($){return ke.current.useDeferredValue($)},De.useEffect=function($,ee){return ke.current.useEffect($,ee)},De.useId=function(){return ke.current.useId()},De.useImperativeHandle=function($,ee,ye){return ke.current.useImperativeHandle($,ee,ye)},De.useInsertionEffect=function($,ee){return ke.current.useInsertionEffect($,ee)},De.useLayoutEffect=function($,ee){return ke.current.useLayoutEffect($,ee)},De.useMemo=function($,ee){return ke.current.useMemo($,ee)},De.useReducer=function($,ee,ye){return ke.current.useReducer($,ee,ye)},De.useRef=function($){return ke.current.useRef($)},De.useState=function($){return ke.current.useState($)},De.useSyncExternalStore=function($,ee,ye){return ke.current.useSyncExternalStore($,ee,ye)},De.useTransition=function(){return ke.current.useTransition()},De.version="18.3.1",De}var Qx;function Yg(){return Qx||(Qx=1,om.exports=PI()),om.exports}/** * @license React * react-jsx-runtime.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Yx;function AI(){if(Yx)return xc;Yx=1;var n=Yg(),e=Symbol.for("react.element"),t=Symbol.for("react.fragment"),i=Object.prototype.hasOwnProperty,r=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function l(u,h,p){var g,y={},x=null,b=null;p!==void 0&&(x=""+p),h.key!==void 0&&(x=""+h.key),h.ref!==void 0&&(b=h.ref);for(g in h)i.call(h,g)&&!o.hasOwnProperty(g)&&(y[g]=h[g]);if(u&&u.defaultProps)for(g in h=u.defaultProps,h)y[g]===void 0&&(y[g]=h[g]);return{$$typeof:e,type:u,key:x,ref:b,props:y,_owner:r.current}}return xc.Fragment=t,xc.jsx=l,xc.jsxs=l,xc}var Xx;function NI(){return Xx||(Xx=1,sm.exports=AI()),sm.exports}var d=NI(),V=Yg();const md=kI(V),RI=II({__proto__:null,default:md},[V]);var Bh={},am={exports:{}},In={},lm={exports:{}},cm={};/** * @license React * scheduler.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var Jx;function jI(){return Jx||(Jx=1,function(n){function e(oe,ge){var le=oe.length;oe.push(ge);e:for(;0<le;){var $=le-1>>>1,ee=oe[$];if(0<r(ee,ge))oe[$]=ge,oe[le]=ee,le=$;else break e}}function t(oe){return oe.length===0?null:oe[0]}function i(oe){if(oe.length===0)return null;var ge=oe[0],le=oe.pop();if(le!==ge){oe[0]=le;e:for(var $=0,ee=oe.length,ye=ee>>>1;$<ye;){var Ne=2*($+1)-1,je=oe[Ne],Fe=Ne+1,He=oe[Fe];if(0>r(je,le))Fe<ee&&0>r(He,je)?(oe[$]=He,oe[Fe]=le,$=Fe):(oe[$]=je,oe[Ne]=le,$=Ne);else if(Fe<ee&&0>r(He,le))oe[$]=He,oe[Fe]=le,$=Fe;else break e}}return ge}function r(oe,ge){var le=oe.sortIndex-ge.sortIndex;return le!==0?le:oe.id-ge.id}if(typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var l=Date,u=l.now();n.unstable_now=function(){return l.now()-u}}var h=[],p=[],g=1,y=null,x=3,b=!1,T=!1,C=!1,I=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,D=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function O(oe){for(var ge=t(p);ge!==null;){if(ge.callback===null)i(p);else if(ge.startTime<=oe)i(p),ge.sortIndex=ge.expirationTime,e(h,ge);else break;ge=t(p)}}function L(oe){if(C=!1,O(oe),!T)if(t(h)!==null)T=!0,$t(G);else{var ge=t(p);ge!==null&&ke(L,ge.startTime-oe)}}function G(oe,ge){T=!1,C&&(C=!1,N(P),P=-1),b=!0;var le=x;try{for(O(ge),y=t(h);y!==null&&(!(y.expirationTime>ge)||oe&&!z());){var $=y.callback;if(typeof $=="function"){y.callback=null,x=y.priorityLevel;var ee=$(y.expirationTime<=ge);ge=n.unstable_now(),typeof ee=="function"?y.callback=ee:y===t(h)&&i(h),O(ge)}else i(h);y=t(h)}if(y!==null)var ye=!0;else{var Ne=t(p);Ne!==null&&ke(L,Ne.startTime-ge),ye=!1}return ye}finally{y=null,x=le,b=!1}}var X=!1,k=null,P=-1,R=5,F=-1;function z(){return!(n.unstable_now()-F<R)}function q(){if(k!==null){var oe=n.unstable_now();F=oe;var ge=!0;try{ge=k(!0,oe)}finally{ge?M():(X=!1,k=null)}}else X=!1}var M;if(typeof D=="function")M=function(){D(q)};else if(typeof MessageChannel<"u"){var qe=new MessageChannel,mt=qe.port2;qe.port1.onmessage=q,M=function(){mt.postMessage(null)}}else M=function(){I(q,0)};function $t(oe){k=oe,X||(X=!0,M())}function ke(oe,ge){P=I(function(){oe(n.unstable_now())},ge)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(oe){oe.callback=null},n.unstable_continueExecution=function(){T||b||(T=!0,$t(G))},n.unstable_forceFrameRate=function(oe){0>oe||125<oe?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<oe?Math.floor(1e3/oe):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_getFirstCallbackNode=function(){return t(h)},n.unstable_next=function(oe){switch(x){case 1:case 2:case 3:var ge=3;break;default:ge=x}var le=x;x=ge;try{return oe()}finally{x=le}},n.unstable_pauseExecution=function(){},n.unstable_requestPaint=function(){},n.unstable_runWithPriority=function(oe,ge){switch(oe){case 1:case 2:case 3:case 4:case 5:break;default:oe=3}var le=x;x=oe;try{return ge()}finally{x=le}},n.unstable_scheduleCallback=function(oe,ge,le){var $=n.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?$+le:$):le=$,oe){case 1:var ee=-1;break;case 2:ee=250;break;case 5:ee=1073741823;break;case 4:ee=1e4;break;default:ee=5e3}return ee=le+ee,oe={id:g++,callback:ge,priorityLevel:oe,startTime:le,expirationTime:ee,sortIndex:-1},le>$?(oe.sortIndex=le,e(p,oe),t(h)===null&&oe===t(p)&&(C?(N(P),P=-1):C=!0,ke(L,le-$))):(oe.sortIndex=ee,e(h,oe),T||b||(T=!0,$t(G))),oe},n.unstable_shouldYield=z,n.unstable_wrapCallback=function(oe){var ge=x;return function(){var le=x;x=ge;try{return oe.apply(this,arguments)}finally{x=le}}}}(cm)),cm}var Zx;function DI(){return Zx||(Zx=1,lm.exports=jI()),lm.exports}/** * @license React * react-dom.production.min.js * * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. */var ew;function MI(){if(ew)return In;ew=1;var n=Yg(),e=DI();function t(s){for(var a="https://reactjs.org/docs/error-decoder.html?invariant="+s,c=1;c<arguments.length;c++)a+="&args[]="+encodeURIComponent(arguments[c]);return"Minified React error #"+s+"; visit "+a+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var i=new Set,r={};function o(s,a){l(s,a),l(s+"Capture",a)}function l(s,a){for(r[s]=a,s=0;s<a.length;s++)i.add(a[s])}var u=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,p=/^[: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]*$/,g={},y={};function x(s){return h.call(y,s)?!0:h.call(g,s)?!1:p.test(s)?y[s]=!0:(g[s]=!0,!1)}function b(s,a,c,m){if(c!==null&&c.type===0)return!1;switch(typeof a){case"function":case"symbol":return!0;case"boolean":return m?!1:c!==null?!c.acceptsBooleans:(s=s.toLowerCase().slice(0,5),s!=="data-"&&s!=="aria-");default:return!1}}function T(s,a,c,m){if(a===null||typeof a>"u"||b(s,a,c,m))return!0;if(m)return!1;if(c!==null)switch(c.type){case 3:return!a;case 4:return a===!1;case 5:return isNaN(a);case 6:return isNaN(a)||1>a}return!1}function C(s,a,c,m,v,_,S){this.acceptsBooleans=a===2||a===3||a===4,this.attributeName=m,this.attributeNamespace=v,this.mustUseProperty=c,this.propertyName=s,this.type=a,this.sanitizeURL=_,this.removeEmptyString=S}var I={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(s){I[s]=new C(s,0,!1,s,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(s){var a=s[0];I[a]=new C(a,1,!1,s[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(s){I[s]=new C(s,2,!1,s.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(s){I[s]=new C(s,2,!1,s,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(s){I[s]=new C(s,3,!1,s.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(s){I[s]=new C(s,3,!0,s,null,!1,!1)}),["capture","download"].forEach(function(s){I[s]=new C(s,4,!1,s,null,!1,!1)}),["cols","rows","size","span"].forEach(function(s){I[s]=new C(s,6,!1,s,null,!1,!1)}),["rowSpan","start"].forEach(function(s){I[s]=new C(s,5,!1,s.toLowerCase(),null,!1,!1)});var N=/[\-:]([a-z])/g;function D(s){return s[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(s){var a=s.replace(N,D);I[a]=new C(a,1,!1,s,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(s){var a=s.replace(N,D);I[a]=new C(a,1,!1,s,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(s){var a=s.replace(N,D);I[a]=new C(a,1,!1,s,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(s){I[s]=new C(s,1,!1,s.toLowerCase(),null,!1,!1)}),I.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(s){I[s]=new C(s,1,!1,s.toLowerCase(),null,!0,!0)});function O(s,a,c,m){var v=I.hasOwnProperty(a)?I[a]:null;(v!==null?v.type!==0:m||!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(T(a,c,v,m)&&(c=null),m||v===null?x(a)&&(c===null?s.removeAttribute(a):s.setAttribute(a,""+c)):v.mustUseProperty?s[v.propertyName]=c===null?v.type===3?!1:"":c:(a=v.attributeName,m=v.attributeNamespace,c===null?s.removeAttribute(a):(v=v.type,c=v===3||v===4&&c===!0?"":""+c,m?s.setAttributeNS(m,a,c):s.setAttribute(a,c))))}var L=n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,G=Symbol.for("react.element"),X=Symbol.for("react.portal"),k=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),F=Symbol.for("react.provider"),z=Symbol.for("react.context"),q=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),qe=Symbol.for("react.suspense_list"),mt=Symbol.for("react.memo"),$t=Symbol.for("react.lazy"),ke=Symbol.for("react.offscreen"),oe=Symbol.iterator;function ge(s){return s===null||typeof s!="object"?null:(s=oe&&s[oe]||s["@@iterator"],typeof s=="function"?s:null)}var le=Object.assign,$;function ee(s){if($===void 0)try{throw Error()}catch(c){var a=c.stack.trim().match(/\n( *(at )?)/);$=a&&a[1]||""}return` `+$+s}var ye=!1;function Ne(s,a){if(!s||ye)return"";ye=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(a)if(a=function(){throw Error()},Object.defineProperty(a.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(a,[])}catch(Q){var m=Q}Reflect.construct(s,[],a)}else{try{a.call()}catch(Q){m=Q}s.call(a.prototype)}else{try{throw Error()}catch(Q){m=Q}s()}}catch(Q){if(Q&&m&&typeof Q.stack=="string"){for(var v=Q.stack.split(` `),_=m.stack.split(` `),S=v.length-1,j=_.length-1;1<=S&&0<=j&&v[S]!==_[j];)j--;for(;1<=S&&0<=j;S--,j--)if(v[S]!==_[j]){if(S!==1||j!==1)do if(S--,j--,0>j||v[S]!==_[j]){var U=` `+v[S].replace(" at new "," at ");return s.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",s.displayName)),U}while(1<=S&&0<=j);break}}}finally{ye=!1,Error.prepareStackTrace=c}return(s=s?s.displayName||s.name:"")?ee(s):""}function je(s){switch(s.tag){case 5:return ee(s.type);case 16:return ee("Lazy");case 13:return ee("Suspense");case 19:return ee("SuspenseList");case 0:case 2:case 15:return s=Ne(s.type,!1),s;case 11:return s=Ne(s.type.render,!1),s;case 1:return s=Ne(s.type,!0),s;default:return""}}function Fe(s){if(s==null)return null;if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s;switch(s){case k:return"Fragment";case X:return"Portal";case R:return"Profiler";case P:return"StrictMode";case M:return"Suspense";case qe:return"SuspenseList"}if(typeof s=="object")switch(s.$$typeof){case z:return(s.displayName||"Context")+".Consumer";case F:return(s._context.displayName||"Context")+".Provider";case q:var a=s.render;return s=s.displayName,s||(s=a.displayName||a.name||"",s=s!==""?"ForwardRef("+s+")":"ForwardRef"),s;case mt:return a=s.displayName||null,a!==null?a:Fe(s.type)||"Memo";case $t:a=s._payload,s=s._init;try{return Fe(s(a))}catch{}}return null}function He(s){var a=s.type;switch(s.tag){case 24:return"Cache";case 9:return(a.displayName||"Context")+".Consumer";case 10:return(a._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return s=a.render,s=s.displayName||s.name||"",a.displayName||(s!==""?"ForwardRef("+s+")":"ForwardRef");case 7:return"Fragment";case 5:return a;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fe(a);case 8:return a===P?"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 a=="function")return a.displayName||a.name||null;if(typeof a=="string")return a}return null}function We(s){switch(typeof s){case"boolean":case"number":case"string":case"undefined":return s;case"object":return s;default:return""}}function Xe(s){var a=s.type;return(s=s.nodeName)&&s.toLowerCase()==="input"&&(a==="checkbox"||a==="radio")}function Ot(s){var a=Xe(s)?"checked":"value",c=Object.getOwnPropertyDescriptor(s.constructor.prototype,a),m=""+s[a];if(!s.hasOwnProperty(a)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var v=c.get,_=c.set;return Object.defineProperty(s,a,{configurable:!0,get:function(){return v.call(this)},set:function(S){m=""+S,_.call(this,S)}}),Object.defineProperty(s,a,{enumerable:c.enumerable}),{getValue:function(){return m},setValue:function(S){m=""+S},stopTracking:function(){s._valueTracker=null,delete s[a]}}}}function nr(s){s._valueTracker||(s._valueTracker=Ot(s))}function Go(s){if(!s)return!1;var a=s._valueTracker;if(!a)return!0;var c=a.getValue(),m="";return s&&(m=Xe(s)?s.checked?"true":"false":s.value),s=m,s!==c?(a.setValue(s),!0):!1}function Fr(s){if(s=s||(typeof document<"u"?document:void 0),typeof s>"u")return null;try{return s.activeElement||s.body}catch{return s.body}}function Ws(s,a){var c=a.checked;return le({},a,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:c??s._wrapperState.initialChecked})}function Ko(s,a){var c=a.defaultValue==null?"":a.defaultValue,m=a.checked!=null?a.checked:a.defaultChecked;c=We(a.value!=null?a.value:c),s._wrapperState={initialChecked:m,initialValue:c,controlled:a.type==="checkbox"||a.type==="radio"?a.checked!=null:a.value!=null}}function Sl(s,a){a=a.checked,a!=null&&O(s,"checked",a,!1)}function Cl(s,a){Sl(s,a);var c=We(a.value),m=a.type;if(c!=null)m==="number"?(c===0&&s.value===""||s.value!=c)&&(s.value=""+c):s.value!==""+c&&(s.value=""+c);else if(m==="submit"||m==="reset"){s.removeAttribute("value");return}a.hasOwnProperty("value")?Qo(s,a.type,c):a.hasOwnProperty("defaultValue")&&Qo(s,a.type,We(a.defaultValue)),a.checked==null&&a.defaultChecked!=null&&(s.defaultChecked=!!a.defaultChecked)}function Iu(s,a,c){if(a.hasOwnProperty("value")||a.hasOwnProperty("defaultValue")){var m=a.type;if(!(m!=="submit"&&m!=="reset"||a.value!==void 0&&a.value!==null))return;a=""+s._wrapperState.initialValue,c||a===s.value||(s.value=a),s.defaultValue=a}c=s.name,c!==""&&(s.name=""),s.defaultChecked=!!s._wrapperState.initialChecked,c!==""&&(s.name=c)}function Qo(s,a,c){(a!=="number"||Fr(s.ownerDocument)!==s)&&(c==null?s.defaultValue=""+s._wrapperState.initialValue:s.defaultValue!==""+c&&(s.defaultValue=""+c))}var ir=Array.isArray;function rr(s,a,c,m){if(s=s.options,a){a={};for(var v=0;v<c.length;v++)a["$"+c[v]]=!0;for(c=0;c<s.length;c++)v=a.hasOwnProperty("$"+s[c].value),s[c].selected!==v&&(s[c].selected=v),v&&m&&(s[c].defaultSelected=!0)}else{for(c=""+We(c),a=null,v=0;v<s.length;v++){if(s[v].value===c){s[v].selected=!0,m&&(s[v].defaultSelected=!0);return}a!==null||s[v].disabled||(a=s[v])}a!==null&&(a.selected=!0)}}function Il(s,a){if(a.dangerouslySetInnerHTML!=null)throw Error(t(91));return le({},a,{value:void 0,defaultValue:void 0,children:""+s._wrapperState.initialValue})}function Yo(s,a){var c=a.value;if(c==null){if(c=a.children,a=a.defaultValue,c!=null){if(a!=null)throw Error(t(92));if(ir(c)){if(1<c.length)throw Error(t(93));c=c[0]}a=c}a==null&&(a=""),c=a}s._wrapperState={initialValue:We(c)}}function Xo(s,a){var c=We(a.value),m=We(a.defaultValue);c!=null&&(c=""+c,c!==s.value&&(s.value=c),a.defaultValue==null&&s.defaultValue!==c&&(s.defaultValue=c)),m!=null&&(s.defaultValue=""+m)}function kl(s){var a=s.textContent;a===s._wrapperState.initialValue&&a!==""&&a!==null&&(s.value=a)}function It(s){switch(s){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 kt(s,a){return s==null||s==="http://www.w3.org/1999/xhtml"?It(a):s==="http://www.w3.org/2000/svg"&&a==="foreignObject"?"http://www.w3.org/1999/xhtml":s}var sr,Pl=function(s){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(a,c,m,v){MSApp.execUnsafeLocalFunction(function(){return s(a,c,m,v)})}:s}(function(s,a){if(s.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in s)s.innerHTML=a;else{for(sr=sr||document.createElement("div"),sr.innerHTML="<svg>"+a.valueOf().toString()+"</svg>",a=sr.firstChild;s.firstChild;)s.removeChild(s.firstChild);for(;a.firstChild;)s.appendChild(a.firstChild)}});function Ur(s,a){if(a){var c=s.firstChild;if(c&&c===s.lastChild&&c.nodeType===3){c.nodeValue=a;return}}s.textContent=a}var Gs={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},Ks=["Webkit","ms","Moz","O"];Object.keys(Gs).forEach(function(s){Ks.forEach(function(a){a=a+s.charAt(0).toUpperCase()+s.substring(1),Gs[a]=Gs[s]})});function Al(s,a,c){return a==null||typeof a=="boolean"||a===""?"":c||typeof a!="number"||a===0||Gs.hasOwnProperty(s)&&Gs[s]?(""+a).trim():a+"px"}function Nl(s,a){s=s.style;for(var c in a)if(a.hasOwnProperty(c)){var m=c.indexOf("--")===0,v=Al(c,a[c],m);c==="float"&&(c="cssFloat"),m?s.setProperty(c,v):s[c]=v}}var Rl=le({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 jl(s,a){if(a){if(Rl[s]&&(a.children!=null||a.dangerouslySetInnerHTML!=null))throw Error(t(137,s));if(a.dangerouslySetInnerHTML!=null){if(a.children!=null)throw Error(t(60));if(typeof a.dangerouslySetInnerHTML!="object"||!("__html"in a.dangerouslySetInnerHTML))throw Error(t(61))}if(a.style!=null&&typeof a.style!="object")throw Error(t(62))}}function Dl(s,a){if(s.indexOf("-")===-1)return typeof a.is=="string";switch(s){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 Qs=null;function Jo(s){return s=s.target||s.srcElement||window,s.correspondingUseElement&&(s=s.correspondingUseElement),s.nodeType===3?s.parentNode:s}var Zo=null,Gn=null,Di=null;function ea(s){if(s=rc(s)){if(typeof Zo!="function")throw Error(t(280));var a=s.stateNode;a&&(a=ih(a),Zo(s.stateNode,s.type,a))}}function Mi(s){Gn?Di?Di.push(s):Di=[s]:Gn=s}function Ml(){if(Gn){var s=Gn,a=Di;if(Di=Gn=null,ea(s),a)for(s=0;s<a.length;s++)ea(a[s])}}function Ys(s,a){return s(a)}function Ol(){}var or=!1;function Ll(s,a,c){if(or)return s(a,c);or=!0;try{return Ys(s,a,c)}finally{or=!1,(Gn!==null||Di!==null)&&(Ol(),Ml())}}function gt(s,a){var c=s.stateNode;if(c===null)return null;var m=ih(c);if(m===null)return null;c=m[a];e:switch(a){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)||(s=s.type,m=!(s==="button"||s==="input"||s==="select"||s==="textarea")),s=!m;break e;default:s=!1}if(s)return null;if(c&&typeof c!="function")throw Error(t(231,a,typeof c));return c}var ta=!1;if(u)try{var hi={};Object.defineProperty(hi,"passive",{get:function(){ta=!0}}),window.addEventListener("test",hi,hi),window.removeEventListener("test",hi,hi)}catch{ta=!1}function Xs(s,a,c,m,v,_,S,j,U){var Q=Array.prototype.slice.call(arguments,3);try{a.apply(c,Q)}catch(ie){this.onError(ie)}}var Js=!1,na=null,di=!1,Vl=null,jf={onError:function(s){Js=!0,na=s}};function ia(s,a,c,m,v,_,S,j,U){Js=!1,na=null,Xs.apply(jf,arguments)}function ku(s,a,c,m,v,_,S,j,U){if(ia.apply(this,arguments),Js){if(Js){var Q=na;Js=!1,na=null}else throw Error(t(198));di||(di=!0,Vl=Q)}}function fi(s){var a=s,c=s;if(s.alternate)for(;a.return;)a=a.return;else{s=a;do a=s,(a.flags&4098)!==0&&(c=a.return),s=a.return;while(s)}return a.tag===3?c:null}function Zs(s){if(s.tag===13){var a=s.memoizedState;if(a===null&&(s=s.alternate,s!==null&&(a=s.memoizedState)),a!==null)return a.dehydrated}return null}function pi(s){if(fi(s)!==s)throw Error(t(188))}function Pu(s){var a=s.alternate;if(!a){if(a=fi(s),a===null)throw Error(t(188));return a!==s?null:s}for(var c=s,m=a;;){var v=c.return;if(v===null)break;var _=v.alternate;if(_===null){if(m=v.return,m!==null){c=m;continue}break}if(v.child===_.child){for(_=v.child;_;){if(_===c)return pi(v),s;if(_===m)return pi(v),a;_=_.sibling}throw Error(t(188))}if(c.return!==m.return)c=v,m=_;else{for(var S=!1,j=v.child;j;){if(j===c){S=!0,c=v,m=_;break}if(j===m){S=!0,m=v,c=_;break}j=j.sibling}if(!S){for(j=_.child;j;){if(j===c){S=!0,c=_,m=v;break}if(j===m){S=!0,m=_,c=v;break}j=j.sibling}if(!S)throw Error(t(189))}}if(c.alternate!==m)throw Error(t(190))}if(c.tag!==3)throw Error(t(188));return c.stateNode.current===c?s:a}function Fl(s){return s=Pu(s),s!==null?ra(s):null}function ra(s){if(s.tag===5||s.tag===6)return s;for(s=s.child;s!==null;){var a=ra(s);if(a!==null)return a;s=s.sibling}return null}var sa=e.unstable_scheduleCallback,Ul=e.unstable_cancelCallback,Au=e.unstable_shouldYield,Df=e.unstable_requestPaint,Je=e.unstable_now,Nu=e.unstable_getCurrentPriorityLevel,eo=e.unstable_ImmediatePriority,zr=e.unstable_UserBlockingPriority,Kn=e.unstable_NormalPriority,zl=e.unstable_LowPriority,Ru=e.unstable_IdlePriority,to=null,jn=null;function ju(s){if(jn&&typeof jn.onCommitFiberRoot=="function")try{jn.onCommitFiberRoot(to,s,void 0,(s.current.flags&128)===128)}catch{}}var pn=Math.clz32?Math.clz32:Mu,Bl=Math.log,Du=Math.LN2;function Mu(s){return s>>>=0,s===0?32:31-(Bl(s)/Du|0)|0}var oa=64,aa=4194304;function Br(s){switch(s&-s){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 s&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return s&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return s}}function no(s,a){var c=s.pendingLanes;if(c===0)return 0;var m=0,v=s.suspendedLanes,_=s.pingedLanes,S=c&268435455;if(S!==0){var j=S&~v;j!==0?m=Br(j):(_&=S,_!==0&&(m=Br(_)))}else S=c&~v,S!==0?m=Br(S):_!==0&&(m=Br(_));if(m===0)return 0;if(a!==0&&a!==m&&(a&v)===0&&(v=m&-m,_=a&-a,v>=_||v===16&&(_&4194240)!==0))return a;if((m&4)!==0&&(m|=c&16),a=s.entangledLanes,a!==0)for(s=s.entanglements,a&=m;0<a;)c=31-pn(a),v=1<<c,m|=s[c],a&=~v;return m}function Mf(s,a){switch(s){case 1:case 2:case 4:return a+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 a+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 ar(s,a){for(var c=s.suspendedLanes,m=s.pingedLanes,v=s.expirationTimes,_=s.pendingLanes;0<_;){var S=31-pn(_),j=1<<S,U=v[S];U===-1?((j&c)===0||(j&m)!==0)&&(v[S]=Mf(j,a)):U<=a&&(s.expiredLanes|=j),_&=~j}}function Dn(s){return s=s.pendingLanes&-1073741825,s!==0?s:s&1073741824?1073741824:0}function io(){var s=oa;return oa<<=1,(oa&4194240)===0&&(oa=64),s}function qr(s){for(var a=[],c=0;31>c;c++)a.push(s);return a}function $r(s,a,c){s.pendingLanes|=a,a!==536870912&&(s.suspendedLanes=0,s.pingedLanes=0),s=s.eventTimes,a=31-pn(a),s[a]=c}function Ye(s,a){var c=s.pendingLanes&~a;s.pendingLanes=a,s.suspendedLanes=0,s.pingedLanes=0,s.expiredLanes&=a,s.mutableReadLanes&=a,s.entangledLanes&=a,a=s.entanglements;var m=s.eventTimes;for(s=s.expirationTimes;0<c;){var v=31-pn(c),_=1<<v;a[v]=0,m[v]=-1,s[v]=-1,c&=~_}}function Hr(s,a){var c=s.entangledLanes|=a;for(s=s.entanglements;c;){var m=31-pn(c),v=1<<m;v&a|s[m]&a&&(s[m]|=a),c&=~v}}var Ve=0;function Wr(s){return s&=-s,1<s?4<s?(s&268435455)!==0?16:536870912:4:1}var Ou,la,Lu,Vu,Fu,ql=!1,Oi=[],Ht=null,mi=null,gi=null,Gr=new Map,Qn=new Map,Li=[],Of="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 Uu(s,a){switch(s){case"focusin":case"focusout":Ht=null;break;case"dragenter":case"dragleave":mi=null;break;case"mouseover":case"mouseout":gi=null;break;case"pointerover":case"pointerout":Gr.delete(a.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qn.delete(a.pointerId)}}function wn(s,a,c,m,v,_){return s===null||s.nativeEvent!==_?(s={blockedOn:a,domEventName:c,eventSystemFlags:m,nativeEvent:_,targetContainers:[v]},a!==null&&(a=rc(a),a!==null&&la(a)),s):(s.eventSystemFlags|=m,a=s.targetContainers,v!==null&&a.indexOf(v)===-1&&a.push(v),s)}function Lf(s,a,c,m,v){switch(a){case"focusin":return Ht=wn(Ht,s,a,c,m,v),!0;case"dragenter":return mi=wn(mi,s,a,c,m,v),!0;case"mouseover":return gi=wn(gi,s,a,c,m,v),!0;case"pointerover":var _=v.pointerId;return Gr.set(_,wn(Gr.get(_)||null,s,a,c,m,v)),!0;case"gotpointercapture":return _=v.pointerId,Qn.set(_,wn(Qn.get(_)||null,s,a,c,m,v)),!0}return!1}function zu(s){var a=lo(s.target);if(a!==null){var c=fi(a);if(c!==null){if(a=c.tag,a===13){if(a=Zs(c),a!==null){s.blockedOn=a,Fu(s.priority,function(){Lu(c)});return}}else if(a===3&&c.stateNode.current.memoizedState.isDehydrated){s.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}s.blockedOn=null}function lr(s){if(s.blockedOn!==null)return!1;for(var a=s.targetContainers;0<a.length;){var c=ca(s.domEventName,s.eventSystemFlags,a[0],s.nativeEvent);if(c===null){c=s.nativeEvent;var m=new c.constructor(c.type,c);Qs=m,c.target.dispatchEvent(m),Qs=null}else return a=rc(c),a!==null&&la(a),s.blockedOn=c,!1;a.shift()}return!0}function ro(s,a,c){lr(s)&&c.delete(a)}function Bu(){ql=!1,Ht!==null&&lr(Ht)&&(Ht=null),mi!==null&&lr(mi)&&(mi=null),gi!==null&&lr(gi)&&(gi=null),Gr.forEach(ro),Qn.forEach(ro)}function yi(s,a){s.blockedOn===a&&(s.blockedOn=null,ql||(ql=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Bu)))}function vi(s){function a(v){return yi(v,s)}if(0<Oi.length){yi(Oi[0],s);for(var c=1;c<Oi.length;c++){var m=Oi[c];m.blockedOn===s&&(m.blockedOn=null)}}for(Ht!==null&&yi(Ht,s),mi!==null&&yi(mi,s),gi!==null&&yi(gi,s),Gr.forEach(a),Qn.forEach(a),c=0;c<Li.length;c++)m=Li[c],m.blockedOn===s&&(m.blockedOn=null);for(;0<Li.length&&(c=Li[0],c.blockedOn===null);)zu(c),c.blockedOn===null&&Li.shift()}var cr=L.ReactCurrentBatchConfig,Kr=!0;function st(s,a,c,m){var v=Ve,_=cr.transition;cr.transition=null;try{Ve=1,$l(s,a,c,m)}finally{Ve=v,cr.transition=_}}function Vf(s,a,c,m){var v=Ve,_=cr.transition;cr.transition=null;try{Ve=4,$l(s,a,c,m)}finally{Ve=v,cr.transition=_}}function $l(s,a,c,m){if(Kr){var v=ca(s,a,c,m);if(v===null)Qf(s,a,m,so,c),Uu(s,m);else if(Lf(v,s,a,c,m))m.stopPropagation();else if(Uu(s,m),a&4&&-1<Of.indexOf(s)){for(;v!==null;){var _=rc(v);if(_!==null&&Ou(_),_=ca(s,a,c,m),_===null&&Qf(s,a,m,so,c),_===v)break;v=_}v!==null&&m.stopPropagation()}else Qf(s,a,m,null,c)}}var so=null;function ca(s,a,c,m){if(so=null,s=Jo(m),s=lo(s),s!==null)if(a=fi(s),a===null)s=null;else if(c=a.tag,c===13){if(s=Zs(a),s!==null)return s;s=null}else if(c===3){if(a.stateNode.current.memoizedState.isDehydrated)return a.tag===3?a.stateNode.containerInfo:null;s=null}else a!==s&&(s=null);return so=s,null}function Hl(s){switch(s){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(Nu()){case eo:return 1;case zr:return 4;case Kn:case zl:return 16;case Ru:return 536870912;default:return 16}default:return 16}}var Mn=null,ua=null,_n=null;function Wl(){if(_n)return _n;var s,a=ua,c=a.length,m,v="value"in Mn?Mn.value:Mn.textContent,_=v.length;for(s=0;s<c&&a[s]===v[s];s++);var S=c-s;for(m=1;m<=S&&a[c-m]===v[_-m];m++);return _n=v.slice(s,1<m?1-m:void 0)}function ha(s){var a=s.keyCode;return"charCode"in s?(s=s.charCode,s===0&&a===13&&(s=13)):s=a,s===10&&(s=13),32<=s||s===13?s:0}function Vi(){return!0}function Gl(){return!1}function Wt(s){function a(c,m,v,_,S){this._reactName=c,this._targetInst=v,this.type=m,this.nativeEvent=_,this.target=S,this.currentTarget=null;for(var j in s)s.hasOwnProperty(j)&&(c=s[j],this[j]=c?c(_):_[j]);return this.isDefaultPrevented=(_.defaultPrevented!=null?_.defaultPrevented:_.returnValue===!1)?Vi:Gl,this.isPropagationStopped=Gl,this}return le(a.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=Vi)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=Vi)},persist:function(){},isPersistent:Vi}),a}var xi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(s){return s.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},da=Wt(xi),Fi=le({},xi,{view:0,detail:0}),Ff=Wt(Fi),fa,ur,Qr,oo=le({},Fi,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ui,button:0,buttons:0,relatedTarget:function(s){return s.relatedTarget===void 0?s.fromElement===s.srcElement?s.toElement:s.fromElement:s.relatedTarget},movementX:function(s){return"movementX"in s?s.movementX:(s!==Qr&&(Qr&&s.type==="mousemove"?(fa=s.screenX-Qr.screenX,ur=s.screenY-Qr.screenY):ur=fa=0,Qr=s),fa)},movementY:function(s){return"movementY"in s?s.movementY:ur}}),pa=Wt(oo),Kl=le({},oo,{dataTransfer:0}),qu=Wt(Kl),ma=le({},Fi,{relatedTarget:0}),ga=Wt(ma),$u=le({},xi,{animationName:0,elapsedTime:0,pseudoElement:0}),hr=Wt($u),Hu=le({},xi,{clipboardData:function(s){return"clipboardData"in s?s.clipboardData:window.clipboardData}}),Wu=Wt(Hu),Gu=le({},xi,{data:0}),Ql=Wt(Gu),ya={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},mn={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"},Ku={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qu(s){var a=this.nativeEvent;return a.getModifierState?a.getModifierState(s):(s=Ku[s])?!!a[s]:!1}function Ui(){return Qu}var f=le({},Fi,{key:function(s){if(s.key){var a=ya[s.key]||s.key;if(a!=="Unidentified")return a}return s.type==="keypress"?(s=ha(s),s===13?"Enter":String.fromCharCode(s)):s.type==="keydown"||s.type==="keyup"?mn[s.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ui,charCode:function(s){return s.type==="keypress"?ha(s):0},keyCode:function(s){return s.type==="keydown"||s.type==="keyup"?s.keyCode:0},which:function(s){return s.type==="keypress"?ha(s):s.type==="keydown"||s.type==="keyup"?s.keyCode:0}}),w=Wt(f),E=le({},oo,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),A=Wt(E),H=le({},Fi,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ui}),Y=Wt(H),ae=le({},xi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Qe=Wt(ae),Pt=le({},oo,{deltaX:function(s){return"deltaX"in s?s.deltaX:"wheelDeltaX"in s?-s.wheelDeltaX:0},deltaY:function(s){return"deltaY"in s?s.deltaY:"wheelDeltaY"in s?-s.wheelDeltaY:"wheelDelta"in s?-s.wheelDelta:0},deltaZ:0,deltaMode:0}),Ue=Wt(Pt),Lt=[9,13,27,32],bt=u&&"CompositionEvent"in window,Yn=null;u&&"documentMode"in document&&(Yn=document.documentMode);var On=u&&"TextEvent"in window&&!Yn,ao=u&&(!bt||Yn&&8<Yn&&11>=Yn),va=" ",Bv=!1;function qv(s,a){switch(s){case"keyup":return Lt.indexOf(a.keyCode)!==-1;case"keydown":return a.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function $v(s){return s=s.detail,typeof s=="object"&&"data"in s?s.data:null}var xa=!1;function TC(s,a){switch(s){case"compositionend":return $v(a);case"keypress":return a.which!==32?null:(Bv=!0,va);case"textInput":return s=a.data,s===va&&Bv?null:s;default:return null}}function SC(s,a){if(xa)return s==="compositionend"||!bt&&qv(s,a)?(s=Wl(),_n=ua=Mn=null,xa=!1,s):null;switch(s){case"paste":return null;case"keypress":if(!(a.ctrlKey||a.altKey||a.metaKey)||a.ctrlKey&&a.altKey){if(a.char&&1<a.char.length)return a.char;if(a.which)return String.fromCharCode(a.which)}return null;case"compositionend":return ao&&a.locale!=="ko"?null:a.data;default:return null}}var CC={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 Hv(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a==="input"?!!CC[s.type]:a==="textarea"}function Wv(s,a,c,m){Mi(m),a=eh(a,"onChange"),0<a.length&&(c=new da("onChange","change",null,c,m),s.push({event:c,listeners:a}))}var Yl=null,Xl=null;function IC(s){u0(s,0)}function Yu(s){var a=Ta(s);if(Go(a))return s}function kC(s,a){if(s==="change")return a}var Gv=!1;if(u){var Uf;if(u){var zf="oninput"in document;if(!zf){var Kv=document.createElement("div");Kv.setAttribute("oninput","return;"),zf=typeof Kv.oninput=="function"}Uf=zf}else Uf=!1;Gv=Uf&&(!document.documentMode||9<document.documentMode)}function Qv(){Yl&&(Yl.detachEvent("onpropertychange",Yv),Xl=Yl=null)}function Yv(s){if(s.propertyName==="value"&&Yu(Xl)){var a=[];Wv(a,Xl,s,Jo(s)),Ll(IC,a)}}function PC(s,a,c){s==="focusin"?(Qv(),Yl=a,Xl=c,Yl.attachEvent("onpropertychange",Yv)):s==="focusout"&&Qv()}function AC(s){if(s==="selectionchange"||s==="keyup"||s==="keydown")return Yu(Xl)}function NC(s,a){if(s==="click")return Yu(a)}function RC(s,a){if(s==="input"||s==="change")return Yu(a)}function jC(s,a){return s===a&&(s!==0||1/s===1/a)||s!==s&&a!==a}var wi=typeof Object.is=="function"?Object.is:jC;function Jl(s,a){if(wi(s,a))return!0;if(typeof s!="object"||s===null||typeof a!="object"||a===null)return!1;var c=Object.keys(s),m=Object.keys(a);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var v=c[m];if(!h.call(a,v)||!wi(s[v],a[v]))return!1}return!0}function Xv(s){for(;s&&s.firstChild;)s=s.firstChild;return s}function Jv(s,a){var c=Xv(s);s=0;for(var m;c;){if(c.nodeType===3){if(m=s+c.textContent.length,s<=a&&m>=a)return{node:c,offset:a-s};s=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=Xv(c)}}function Zv(s,a){return s&&a?s===a?!0:s&&s.nodeType===3?!1:a&&a.nodeType===3?Zv(s,a.parentNode):"contains"in s?s.contains(a):s.compareDocumentPosition?!!(s.compareDocumentPosition(a)&16):!1:!1}function e0(){for(var s=window,a=Fr();a instanceof s.HTMLIFrameElement;){try{var c=typeof a.contentWindow.location.href=="string"}catch{c=!1}if(c)s=a.contentWindow;else break;a=Fr(s.document)}return a}function Bf(s){var a=s&&s.nodeName&&s.nodeName.toLowerCase();return a&&(a==="input"&&(s.type==="text"||s.type==="search"||s.type==="tel"||s.type==="url"||s.type==="password")||a==="textarea"||s.contentEditable==="true")}function DC(s){var a=e0(),c=s.focusedElem,m=s.selectionRange;if(a!==c&&c&&c.ownerDocument&&Zv(c.ownerDocument.documentElement,c)){if(m!==null&&Bf(c)){if(a=m.start,s=m.end,s===void 0&&(s=a),"selectionStart"in c)c.selectionStart=a,c.selectionEnd=Math.min(s,c.value.length);else if(s=(a=c.ownerDocument||document)&&a.defaultView||window,s.getSelection){s=s.getSelection();var v=c.textContent.length,_=Math.min(m.start,v);m=m.end===void 0?_:Math.min(m.end,v),!s.extend&&_>m&&(v=m,m=_,_=v),v=Jv(c,_);var S=Jv(c,m);v&&S&&(s.rangeCount!==1||s.anchorNode!==v.node||s.anchorOffset!==v.offset||s.focusNode!==S.node||s.focusOffset!==S.offset)&&(a=a.createRange(),a.setStart(v.node,v.offset),s.removeAllRanges(),_>m?(s.addRange(a),s.extend(S.node,S.offset)):(a.setEnd(S.node,S.offset),s.addRange(a)))}}for(a=[],s=c;s=s.parentNode;)s.nodeType===1&&a.push({element:s,left:s.scrollLeft,top:s.scrollTop});for(typeof c.focus=="function"&&c.focus(),c=0;c<a.length;c++)s=a[c],s.element.scrollLeft=s.left,s.element.scrollTop=s.top}}var MC=u&&"documentMode"in document&&11>=document.documentMode,wa=null,qf=null,Zl=null,$f=!1;function t0(s,a,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;$f||wa==null||wa!==Fr(m)||(m=wa,"selectionStart"in m&&Bf(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}),Zl&&Jl(Zl,m)||(Zl=m,m=eh(qf,"onSelect"),0<m.length&&(a=new da("onSelect","select",null,a,c),s.push({event:a,listeners:m}),a.target=wa)))}function Xu(s,a){var c={};return c[s.toLowerCase()]=a.toLowerCase(),c["Webkit"+s]="webkit"+a,c["Moz"+s]="moz"+a,c}var _a={animationend:Xu("Animation","AnimationEnd"),animationiteration:Xu("Animation","AnimationIteration"),animationstart:Xu("Animation","AnimationStart"),transitionend:Xu("Transition","TransitionEnd")},Hf={},n0={};u&&(n0=document.createElement("div").style,"AnimationEvent"in window||(delete _a.animationend.animation,delete _a.animationiteration.animation,delete _a.animationstart.animation),"TransitionEvent"in window||delete _a.transitionend.transition);function Ju(s){if(Hf[s])return Hf[s];if(!_a[s])return s;var a=_a[s],c;for(c in a)if(a.hasOwnProperty(c)&&c in n0)return Hf[s]=a[c];return s}var i0=Ju("animationend"),r0=Ju("animationiteration"),s0=Ju("animationstart"),o0=Ju("transitionend"),a0=new Map,l0="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 Yr(s,a){a0.set(s,a),o(a,[s])}for(var Wf=0;Wf<l0.length;Wf++){var Gf=l0[Wf],OC=Gf.toLowerCase(),LC=Gf[0].toUpperCase()+Gf.slice(1);Yr(OC,"on"+LC)}Yr(i0,"onAnimationEnd"),Yr(r0,"onAnimationIteration"),Yr(s0,"onAnimationStart"),Yr("dblclick","onDoubleClick"),Yr("focusin","onFocus"),Yr("focusout","onBlur"),Yr(o0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("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 ec="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(" "),VC=new Set("cancel close invalid load scroll toggle".split(" ").concat(ec));function c0(s,a,c){var m=s.type||"unknown-event";s.currentTarget=c,ku(m,a,void 0,s),s.currentTarget=null}function u0(s,a){a=(a&4)!==0;for(var c=0;c<s.length;c++){var m=s[c],v=m.event;m=m.listeners;e:{var _=void 0;if(a)for(var S=m.length-1;0<=S;S--){var j=m[S],U=j.instance,Q=j.currentTarget;if(j=j.listener,U!==_&&v.isPropagationStopped())break e;c0(v,j,Q),_=U}else for(S=0;S<m.length;S++){if(j=m[S],U=j.instance,Q=j.currentTarget,j=j.listener,U!==_&&v.isPropagationStopped())break e;c0(v,j,Q),_=U}}}if(di)throw s=Vl,di=!1,Vl=null,s}function tt(s,a){var c=a[tp];c===void 0&&(c=a[tp]=new Set);var m=s+"__bubble";c.has(m)||(h0(a,s,2,!1),c.add(m))}function Kf(s,a,c){var m=0;a&&(m|=4),h0(c,s,m,a)}var Zu="_reactListening"+Math.random().toString(36).slice(2);function tc(s){if(!s[Zu]){s[Zu]=!0,i.forEach(function(c){c!=="selectionchange"&&(VC.has(c)||Kf(c,!1,s),Kf(c,!0,s))});var a=s.nodeType===9?s:s.ownerDocument;a===null||a[Zu]||(a[Zu]=!0,Kf("selectionchange",!1,a))}}function h0(s,a,c,m){switch(Hl(a)){case 1:var v=st;break;case 4:v=Vf;break;default:v=$l}c=v.bind(null,a,c,s),v=void 0,!ta||a!=="touchstart"&&a!=="touchmove"&&a!=="wheel"||(v=!0),m?v!==void 0?s.addEventListener(a,c,{capture:!0,passive:v}):s.addEventListener(a,c,!0):v!==void 0?s.addEventListener(a,c,{passive:v}):s.addEventListener(a,c,!1)}function Qf(s,a,c,m,v){var _=m;if((a&1)===0&&(a&2)===0&&m!==null)e:for(;;){if(m===null)return;var S=m.tag;if(S===3||S===4){var j=m.stateNode.containerInfo;if(j===v||j.nodeType===8&&j.parentNode===v)break;if(S===4)for(S=m.return;S!==null;){var U=S.tag;if((U===3||U===4)&&(U=S.stateNode.containerInfo,U===v||U.nodeType===8&&U.parentNode===v))return;S=S.return}for(;j!==null;){if(S=lo(j),S===null)return;if(U=S.tag,U===5||U===6){m=_=S;continue e}j=j.parentNode}}m=m.return}Ll(function(){var Q=_,ie=Jo(c),re=[];e:{var ne=a0.get(s);if(ne!==void 0){var ce=da,fe=s;switch(s){case"keypress":if(ha(c)===0)break e;case"keydown":case"keyup":ce=w;break;case"focusin":fe="focus",ce=ga;break;case"focusout":fe="blur",ce=ga;break;case"beforeblur":case"afterblur":ce=ga;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ce=pa;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ce=qu;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ce=Y;break;case i0:case r0:case s0:ce=hr;break;case o0:ce=Qe;break;case"scroll":ce=Ff;break;case"wheel":ce=Ue;break;case"copy":case"cut":case"paste":ce=Wu;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ce=A}var pe=(a&4)!==0,yt=!pe&&s==="scroll",W=pe?ne!==null?ne+"Capture":null:ne;pe=[];for(var B=Q,K;B!==null;){K=B;var se=K.stateNode;if(K.tag===5&&se!==null&&(K=se,W!==null&&(se=gt(B,W),se!=null&&pe.push(nc(B,se,K)))),yt)break;B=B.return}0<pe.length&&(ne=new ce(ne,fe,null,c,ie),re.push({event:ne,listeners:pe}))}}if((a&7)===0){e:{if(ne=s==="mouseover"||s==="pointerover",ce=s==="mouseout"||s==="pointerout",ne&&c!==Qs&&(fe=c.relatedTarget||c.fromElement)&&(lo(fe)||fe[dr]))break e;if((ce||ne)&&(ne=ie.window===ie?ie:(ne=ie.ownerDocument)?ne.defaultView||ne.parentWindow:window,ce?(fe=c.relatedTarget||c.toElement,ce=Q,fe=fe?lo(fe):null,fe!==null&&(yt=fi(fe),fe!==yt||fe.tag!==5&&fe.tag!==6)&&(fe=null)):(ce=null,fe=Q),ce!==fe)){if(pe=pa,se="onMouseLeave",W="onMouseEnter",B="mouse",(s==="pointerout"||s==="pointerover")&&(pe=A,se="onPointerLeave",W="onPointerEnter",B="pointer"),yt=ce==null?ne:Ta(ce),K=fe==null?ne:Ta(fe),ne=new pe(se,B+"leave",ce,c,ie),ne.target=yt,ne.relatedTarget=K,se=null,lo(ie)===Q&&(pe=new pe(W,B+"enter",fe,c,ie),pe.target=K,pe.relatedTarget=yt,se=pe),yt=se,ce&&fe)t:{for(pe=ce,W=fe,B=0,K=pe;K;K=ba(K))B++;for(K=0,se=W;se;se=ba(se))K++;for(;0<B-K;)pe=ba(pe),B--;for(;0<K-B;)W=ba(W),K--;for(;B--;){if(pe===W||W!==null&&pe===W.alternate)break t;pe=ba(pe),W=ba(W)}pe=null}else pe=null;ce!==null&&d0(re,ne,ce,pe,!1),fe!==null&&yt!==null&&d0(re,yt,fe,pe,!0)}}e:{if(ne=Q?Ta(Q):window,ce=ne.nodeName&&ne.nodeName.toLowerCase(),ce==="select"||ce==="input"&&ne.type==="file")var me=kC;else if(Hv(ne))if(Gv)me=RC;else{me=AC;var xe=PC}else(ce=ne.nodeName)&&ce.toLowerCase()==="input"&&(ne.type==="checkbox"||ne.type==="radio")&&(me=NC);if(me&&(me=me(s,Q))){Wv(re,me,c,ie);break e}xe&&xe(s,ne,Q),s==="focusout"&&(xe=ne._wrapperState)&&xe.controlled&&ne.type==="number"&&Qo(ne,"number",ne.value)}switch(xe=Q?Ta(Q):window,s){case"focusin":(Hv(xe)||xe.contentEditable==="true")&&(wa=xe,qf=Q,Zl=null);break;case"focusout":Zl=qf=wa=null;break;case"mousedown":$f=!0;break;case"contextmenu":case"mouseup":case"dragend":$f=!1,t0(re,c,ie);break;case"selectionchange":if(MC)break;case"keydown":case"keyup":t0(re,c,ie)}var we;if(bt)e:{switch(s){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else xa?qv(s,c)&&(Ce="onCompositionEnd"):s==="keydown"&&c.keyCode===229&&(Ce="onCompositionStart");Ce&&(ao&&c.locale!=="ko"&&(xa||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&xa&&(we=Wl()):(Mn=ie,ua="value"in Mn?Mn.value:Mn.textContent,xa=!0)),xe=eh(Q,Ce),0<xe.length&&(Ce=new Ql(Ce,s,null,c,ie),re.push({event:Ce,listeners:xe}),we?Ce.data=we:(we=$v(c),we!==null&&(Ce.data=we)))),(we=On?TC(s,c):SC(s,c))&&(Q=eh(Q,"onBeforeInput"),0<Q.length&&(ie=new Ql("onBeforeInput","beforeinput",null,c,ie),re.push({event:ie,listeners:Q}),ie.data=we))}u0(re,a)})}function nc(s,a,c){return{instance:s,listener:a,currentTarget:c}}function eh(s,a){for(var c=a+"Capture",m=[];s!==null;){var v=s,_=v.stateNode;v.tag===5&&_!==null&&(v=_,_=gt(s,c),_!=null&&m.unshift(nc(s,_,v)),_=gt(s,a),_!=null&&m.push(nc(s,_,v))),s=s.return}return m}function ba(s){if(s===null)return null;do s=s.return;while(s&&s.tag!==5);return s||null}function d0(s,a,c,m,v){for(var _=a._reactName,S=[];c!==null&&c!==m;){var j=c,U=j.alternate,Q=j.stateNode;if(U!==null&&U===m)break;j.tag===5&&Q!==null&&(j=Q,v?(U=gt(c,_),U!=null&&S.unshift(nc(c,U,j))):v||(U=gt(c,_),U!=null&&S.push(nc(c,U,j)))),c=c.return}S.length!==0&&s.push({event:a,listeners:S})}var FC=/\r\n?/g,UC=/\u0000|\uFFFD/g;function f0(s){return(typeof s=="string"?s:""+s).replace(FC,` `).replace(UC,"")}function th(s,a,c){if(a=f0(a),f0(s)!==a&&c)throw Error(t(425))}function nh(){}var Yf=null,Xf=null;function Jf(s,a){return s==="textarea"||s==="noscript"||typeof a.children=="string"||typeof a.children=="number"||typeof a.dangerouslySetInnerHTML=="object"&&a.dangerouslySetInnerHTML!==null&&a.dangerouslySetInnerHTML.__html!=null}var Zf=typeof setTimeout=="function"?setTimeout:void 0,zC=typeof clearTimeout=="function"?clearTimeout:void 0,p0=typeof Promise=="function"?Promise:void 0,BC=typeof queueMicrotask=="function"?queueMicrotask:typeof p0<"u"?function(s){return p0.resolve(null).then(s).catch(qC)}:Zf;function qC(s){setTimeout(function(){throw s})}function ep(s,a){var c=a,m=0;do{var v=c.nextSibling;if(s.removeChild(c),v&&v.nodeType===8)if(c=v.data,c==="/$"){if(m===0){s.removeChild(v),vi(a);return}m--}else c!=="$"&&c!=="$?"&&c!=="$!"||m++;c=v}while(c);vi(a)}function Xr(s){for(;s!=null;s=s.nextSibling){var a=s.nodeType;if(a===1||a===3)break;if(a===8){if(a=s.data,a==="$"||a==="$!"||a==="$?")break;if(a==="/$")return null}}return s}function m0(s){s=s.previousSibling;for(var a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="$"||c==="$!"||c==="$?"){if(a===0)return s;a--}else c==="/$"&&a++}s=s.previousSibling}return null}var Ea=Math.random().toString(36).slice(2),zi="__reactFiber$"+Ea,ic="__reactProps$"+Ea,dr="__reactContainer$"+Ea,tp="__reactEvents$"+Ea,$C="__reactListeners$"+Ea,HC="__reactHandles$"+Ea;function lo(s){var a=s[zi];if(a)return a;for(var c=s.parentNode;c;){if(a=c[dr]||c[zi]){if(c=a.alternate,a.child!==null||c!==null&&c.child!==null)for(s=m0(s);s!==null;){if(c=s[zi])return c;s=m0(s)}return a}s=c,c=s.parentNode}return null}function rc(s){return s=s[zi]||s[dr],!s||s.tag!==5&&s.tag!==6&&s.tag!==13&&s.tag!==3?null:s}function Ta(s){if(s.tag===5||s.tag===6)return s.stateNode;throw Error(t(33))}function ih(s){return s[ic]||null}var np=[],Sa=-1;function Jr(s){return{current:s}}function nt(s){0>Sa||(s.current=np[Sa],np[Sa]=null,Sa--)}function Ze(s,a){Sa++,np[Sa]=s.current,s.current=a}var Zr={},en=Jr(Zr),bn=Jr(!1),co=Zr;function Ca(s,a){var c=s.type.contextTypes;if(!c)return Zr;var m=s.stateNode;if(m&&m.__reactInternalMemoizedUnmaskedChildContext===a)return m.__reactInternalMemoizedMaskedChildContext;var v={},_;for(_ in c)v[_]=a[_];return m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=a,s.__reactInternalMemoizedMaskedChildContext=v),v}function En(s){return s=s.childContextTypes,s!=null}function rh(){nt(bn),nt(en)}function g0(s,a,c){if(en.current!==Zr)throw Error(t(168));Ze(en,a),Ze(bn,c)}function y0(s,a,c){var m=s.stateNode;if(a=a.childContextTypes,typeof m.getChildContext!="function")return c;m=m.getChildContext();for(var v in m)if(!(v in a))throw Error(t(108,He(s)||"Unknown",v));return le({},c,m)}function sh(s){return s=(s=s.stateNode)&&s.__reactInternalMemoizedMergedChildContext||Zr,co=en.current,Ze(en,s),Ze(bn,bn.current),!0}function v0(s,a,c){var m=s.stateNode;if(!m)throw Error(t(169));c?(s=y0(s,a,co),m.__reactInternalMemoizedMergedChildContext=s,nt(bn),nt(en),Ze(en,s)):nt(bn),Ze(bn,c)}var fr=null,oh=!1,ip=!1;function x0(s){fr===null?fr=[s]:fr.push(s)}function WC(s){oh=!0,x0(s)}function es(){if(!ip&&fr!==null){ip=!0;var s=0,a=Ve;try{var c=fr;for(Ve=1;s<c.length;s++){var m=c[s];do m=m(!0);while(m!==null)}fr=null,oh=!1}catch(v){throw fr!==null&&(fr=fr.slice(s+1)),sa(eo,es),v}finally{Ve=a,ip=!1}}return null}var Ia=[],ka=0,ah=null,lh=0,Xn=[],Jn=0,uo=null,pr=1,mr="";function ho(s,a){Ia[ka++]=lh,Ia[ka++]=ah,ah=s,lh=a}function w0(s,a,c){Xn[Jn++]=pr,Xn[Jn++]=mr,Xn[Jn++]=uo,uo=s;var m=pr;s=mr;var v=32-pn(m)-1;m&=~(1<<v),c+=1;var _=32-pn(a)+v;if(30<_){var S=v-v%5;_=(m&(1<<S)-1).toString(32),m>>=S,v-=S,pr=1<<32-pn(a)+v|c<<v|m,mr=_+s}else pr=1<<_|c<<v|m,mr=s}function rp(s){s.return!==null&&(ho(s,1),w0(s,1,0))}function sp(s){for(;s===ah;)ah=Ia[--ka],Ia[ka]=null,lh=Ia[--ka],Ia[ka]=null;for(;s===uo;)uo=Xn[--Jn],Xn[Jn]=null,mr=Xn[--Jn],Xn[Jn]=null,pr=Xn[--Jn],Xn[Jn]=null}var Ln=null,Vn=null,ot=!1,_i=null;function _0(s,a){var c=ni(5,null,null,0);c.elementType="DELETED",c.stateNode=a,c.return=s,a=s.deletions,a===null?(s.deletions=[c],s.flags|=16):a.push(c)}function b0(s,a){switch(s.tag){case 5:var c=s.type;return a=a.nodeType!==1||c.toLowerCase()!==a.nodeName.toLowerCase()?null:a,a!==null?(s.stateNode=a,Ln=s,Vn=Xr(a.firstChild),!0):!1;case 6:return a=s.pendingProps===""||a.nodeType!==3?null:a,a!==null?(s.stateNode=a,Ln=s,Vn=null,!0):!1;case 13:return a=a.nodeType!==8?null:a,a!==null?(c=uo!==null?{id:pr,overflow:mr}:null,s.memoizedState={dehydrated:a,treeContext:c,retryLane:1073741824},c=ni(18,null,null,0),c.stateNode=a,c.return=s,s.child=c,Ln=s,Vn=null,!0):!1;default:return!1}}function op(s){return(s.mode&1)!==0&&(s.flags&128)===0}function ap(s){if(ot){var a=Vn;if(a){var c=a;if(!b0(s,a)){if(op(s))throw Error(t(418));a=Xr(c.nextSibling);var m=Ln;a&&b0(s,a)?_0(m,c):(s.flags=s.flags&-4097|2,ot=!1,Ln=s)}}else{if(op(s))throw Error(t(418));s.flags=s.flags&-4097|2,ot=!1,Ln=s}}}function E0(s){for(s=s.return;s!==null&&s.tag!==5&&s.tag!==3&&s.tag!==13;)s=s.return;Ln=s}function ch(s){if(s!==Ln)return!1;if(!ot)return E0(s),ot=!0,!1;var a;if((a=s.tag!==3)&&!(a=s.tag!==5)&&(a=s.type,a=a!=="head"&&a!=="body"&&!Jf(s.type,s.memoizedProps)),a&&(a=Vn)){if(op(s))throw T0(),Error(t(418));for(;a;)_0(s,a),a=Xr(a.nextSibling)}if(E0(s),s.tag===13){if(s=s.memoizedState,s=s!==null?s.dehydrated:null,!s)throw Error(t(317));e:{for(s=s.nextSibling,a=0;s;){if(s.nodeType===8){var c=s.data;if(c==="/$"){if(a===0){Vn=Xr(s.nextSibling);break e}a--}else c!=="$"&&c!=="$!"&&c!=="$?"||a++}s=s.nextSibling}Vn=null}}else Vn=Ln?Xr(s.stateNode.nextSibling):null;return!0}function T0(){for(var s=Vn;s;)s=Xr(s.nextSibling)}function Pa(){Vn=Ln=null,ot=!1}function lp(s){_i===null?_i=[s]:_i.push(s)}var GC=L.ReactCurrentBatchConfig;function sc(s,a,c){if(s=c.ref,s!==null&&typeof s!="function"&&typeof s!="object"){if(c._owner){if(c=c._owner,c){if(c.tag!==1)throw Error(t(309));var m=c.stateNode}if(!m)throw Error(t(147,s));var v=m,_=""+s;return a!==null&&a.ref!==null&&typeof a.ref=="function"&&a.ref._stringRef===_?a.ref:(a=function(S){var j=v.refs;S===null?delete j[_]:j[_]=S},a._stringRef=_,a)}if(typeof s!="string")throw Error(t(284));if(!c._owner)throw Error(t(290,s))}return s}function uh(s,a){throw s=Object.prototype.toString.call(a),Error(t(31,s==="[object Object]"?"object with keys {"+Object.keys(a).join(", ")+"}":s))}function S0(s){var a=s._init;return a(s._payload)}function C0(s){function a(W,B){if(s){var K=W.deletions;K===null?(W.deletions=[B],W.flags|=16):K.push(B)}}function c(W,B){if(!s)return null;for(;B!==null;)a(W,B),B=B.sibling;return null}function m(W,B){for(W=new Map;B!==null;)B.key!==null?W.set(B.key,B):W.set(B.index,B),B=B.sibling;return W}function v(W,B){return W=ls(W,B),W.index=0,W.sibling=null,W}function _(W,B,K){return W.index=K,s?(K=W.alternate,K!==null?(K=K.index,K<B?(W.flags|=2,B):K):(W.flags|=2,B)):(W.flags|=1048576,B)}function S(W){return s&&W.alternate===null&&(W.flags|=2),W}function j(W,B,K,se){return B===null||B.tag!==6?(B=Zp(K,W.mode,se),B.return=W,B):(B=v(B,K),B.return=W,B)}function U(W,B,K,se){var me=K.type;return me===k?ie(W,B,K.props.children,se,K.key):B!==null&&(B.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===$t&&S0(me)===B.type)?(se=v(B,K.props),se.ref=sc(W,B,K),se.return=W,se):(se=Dh(K.type,K.key,K.props,null,W.mode,se),se.ref=sc(W,B,K),se.return=W,se)}function Q(W,B,K,se){return B===null||B.tag!==4||B.stateNode.containerInfo!==K.containerInfo||B.stateNode.implementation!==K.implementation?(B=em(K,W.mode,se),B.return=W,B):(B=v(B,K.children||[]),B.return=W,B)}function ie(W,B,K,se,me){return B===null||B.tag!==7?(B=wo(K,W.mode,se,me),B.return=W,B):(B=v(B,K),B.return=W,B)}function re(W,B,K){if(typeof B=="string"&&B!==""||typeof B=="number")return B=Zp(""+B,W.mode,K),B.return=W,B;if(typeof B=="object"&&B!==null){switch(B.$$typeof){case G:return K=Dh(B.type,B.key,B.props,null,W.mode,K),K.ref=sc(W,null,B),K.return=W,K;case X:return B=em(B,W.mode,K),B.return=W,B;case $t:var se=B._init;return re(W,se(B._payload),K)}if(ir(B)||ge(B))return B=wo(B,W.mode,K,null),B.return=W,B;uh(W,B)}return null}function ne(W,B,K,se){var me=B!==null?B.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return me!==null?null:j(W,B,""+K,se);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case G:return K.key===me?U(W,B,K,se):null;case X:return K.key===me?Q(W,B,K,se):null;case $t:return me=K._init,ne(W,B,me(K._payload),se)}if(ir(K)||ge(K))return me!==null?null:ie(W,B,K,se,null);uh(W,K)}return null}function ce(W,B,K,se,me){if(typeof se=="string"&&se!==""||typeof se=="number")return W=W.get(K)||null,j(B,W,""+se,me);if(typeof se=="object"&&se!==null){switch(se.$$typeof){case G:return W=W.get(se.key===null?K:se.key)||null,U(B,W,se,me);case X:return W=W.get(se.key===null?K:se.key)||null,Q(B,W,se,me);case $t:var xe=se._init;return ce(W,B,K,xe(se._payload),me)}if(ir(se)||ge(se))return W=W.get(K)||null,ie(B,W,se,me,null);uh(B,se)}return null}function fe(W,B,K,se){for(var me=null,xe=null,we=B,Ce=B=0,Ut=null;we!==null&&Ce<K.length;Ce++){we.index>Ce?(Ut=we,we=null):Ut=we.sibling;var $e=ne(W,we,K[Ce],se);if($e===null){we===null&&(we=Ut);break}s&&we&&$e.alternate===null&&a(W,we),B=_($e,B,Ce),xe===null?me=$e:xe.sibling=$e,xe=$e,we=Ut}if(Ce===K.length)return c(W,we),ot&&ho(W,Ce),me;if(we===null){for(;Ce<K.length;Ce++)we=re(W,K[Ce],se),we!==null&&(B=_(we,B,Ce),xe===null?me=we:xe.sibling=we,xe=we);return ot&&ho(W,Ce),me}for(we=m(W,we);Ce<K.length;Ce++)Ut=ce(we,W,Ce,K[Ce],se),Ut!==null&&(s&&Ut.alternate!==null&&we.delete(Ut.key===null?Ce:Ut.key),B=_(Ut,B,Ce),xe===null?me=Ut:xe.sibling=Ut,xe=Ut);return s&&we.forEach(function(cs){return a(W,cs)}),ot&&ho(W,Ce),me}function pe(W,B,K,se){var me=ge(K);if(typeof me!="function")throw Error(t(150));if(K=me.call(K),K==null)throw Error(t(151));for(var xe=me=null,we=B,Ce=B=0,Ut=null,$e=K.next();we!==null&&!$e.done;Ce++,$e=K.next()){we.index>Ce?(Ut=we,we=null):Ut=we.sibling;var cs=ne(W,we,$e.value,se);if(cs===null){we===null&&(we=Ut);break}s&&we&&cs.alternate===null&&a(W,we),B=_(cs,B,Ce),xe===null?me=cs:xe.sibling=cs,xe=cs,we=Ut}if($e.done)return c(W,we),ot&&ho(W,Ce),me;if(we===null){for(;!$e.done;Ce++,$e=K.next())$e=re(W,$e.value,se),$e!==null&&(B=_($e,B,Ce),xe===null?me=$e:xe.sibling=$e,xe=$e);return ot&&ho(W,Ce),me}for(we=m(W,we);!$e.done;Ce++,$e=K.next())$e=ce(we,W,Ce,$e.value,se),$e!==null&&(s&&$e.alternate!==null&&we.delete($e.key===null?Ce:$e.key),B=_($e,B,Ce),xe===null?me=$e:xe.sibling=$e,xe=$e);return s&&we.forEach(function(CI){return a(W,CI)}),ot&&ho(W,Ce),me}function yt(W,B,K,se){if(typeof K=="object"&&K!==null&&K.type===k&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case G:e:{for(var me=K.key,xe=B;xe!==null;){if(xe.key===me){if(me=K.type,me===k){if(xe.tag===7){c(W,xe.sibling),B=v(xe,K.props.children),B.return=W,W=B;break e}}else if(xe.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===$t&&S0(me)===xe.type){c(W,xe.sibling),B=v(xe,K.props),B.ref=sc(W,xe,K),B.return=W,W=B;break e}c(W,xe);break}else a(W,xe);xe=xe.sibling}K.type===k?(B=wo(K.props.children,W.mode,se,K.key),B.return=W,W=B):(se=Dh(K.type,K.key,K.props,null,W.mode,se),se.ref=sc(W,B,K),se.return=W,W=se)}return S(W);case X:e:{for(xe=K.key;B!==null;){if(B.key===xe)if(B.tag===4&&B.stateNode.containerInfo===K.containerInfo&&B.stateNode.implementation===K.implementation){c(W,B.sibling),B=v(B,K.children||[]),B.return=W,W=B;break e}else{c(W,B);break}else a(W,B);B=B.sibling}B=em(K,W.mode,se),B.return=W,W=B}return S(W);case $t:return xe=K._init,yt(W,B,xe(K._payload),se)}if(ir(K))return fe(W,B,K,se);if(ge(K))return pe(W,B,K,se);uh(W,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,B!==null&&B.tag===6?(c(W,B.sibling),B=v(B,K),B.return=W,W=B):(c(W,B),B=Zp(K,W.mode,se),B.return=W,W=B),S(W)):c(W,B)}return yt}var Aa=C0(!0),I0=C0(!1),hh=Jr(null),dh=null,Na=null,cp=null;function up(){cp=Na=dh=null}function hp(s){var a=hh.current;nt(hh),s._currentValue=a}function dp(s,a,c){for(;s!==null;){var m=s.alternate;if((s.childLanes&a)!==a?(s.childLanes|=a,m!==null&&(m.childLanes|=a)):m!==null&&(m.childLanes&a)!==a&&(m.childLanes|=a),s===c)break;s=s.return}}function Ra(s,a){dh=s,cp=Na=null,s=s.dependencies,s!==null&&s.firstContext!==null&&((s.lanes&a)!==0&&(Tn=!0),s.firstContext=null)}function Zn(s){var a=s._currentValue;if(cp!==s)if(s={context:s,memoizedValue:a,next:null},Na===null){if(dh===null)throw Error(t(308));Na=s,dh.dependencies={lanes:0,firstContext:s}}else Na=Na.next=s;return a}var fo=null;function fp(s){fo===null?fo=[s]:fo.push(s)}function k0(s,a,c,m){var v=a.interleaved;return v===null?(c.next=c,fp(a)):(c.next=v.next,v.next=c),a.interleaved=c,gr(s,m)}function gr(s,a){s.lanes|=a;var c=s.alternate;for(c!==null&&(c.lanes|=a),c=s,s=s.return;s!==null;)s.childLanes|=a,c=s.alternate,c!==null&&(c.childLanes|=a),c=s,s=s.return;return c.tag===3?c.stateNode:null}var ts=!1;function pp(s){s.updateQueue={baseState:s.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function P0(s,a){s=s.updateQueue,a.updateQueue===s&&(a.updateQueue={baseState:s.baseState,firstBaseUpdate:s.firstBaseUpdate,lastBaseUpdate:s.lastBaseUpdate,shared:s.shared,effects:s.effects})}function yr(s,a){return{eventTime:s,lane:a,tag:0,payload:null,callback:null,next:null}}function ns(s,a,c){var m=s.updateQueue;if(m===null)return null;if(m=m.shared,(Be&2)!==0){var v=m.pending;return v===null?a.next=a:(a.next=v.next,v.next=a),m.pending=a,gr(s,c)}return v=m.interleaved,v===null?(a.next=a,fp(m)):(a.next=v.next,v.next=a),m.interleaved=a,gr(s,c)}function fh(s,a,c){if(a=a.updateQueue,a!==null&&(a=a.shared,(c&4194240)!==0)){var m=a.lanes;m&=s.pendingLanes,c|=m,a.lanes=c,Hr(s,c)}}function A0(s,a){var c=s.updateQueue,m=s.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var v=null,_=null;if(c=c.firstBaseUpdate,c!==null){do{var S={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};_===null?v=_=S:_=_.next=S,c=c.next}while(c!==null);_===null?v=_=a:_=_.next=a}else v=_=a;c={baseState:m.baseState,firstBaseUpdate:v,lastBaseUpdate:_,shared:m.shared,effects:m.effects},s.updateQueue=c;return}s=c.lastBaseUpdate,s===null?c.firstBaseUpdate=a:s.next=a,c.lastBaseUpdate=a}function ph(s,a,c,m){var v=s.updateQueue;ts=!1;var _=v.firstBaseUpdate,S=v.lastBaseUpdate,j=v.shared.pending;if(j!==null){v.shared.pending=null;var U=j,Q=U.next;U.next=null,S===null?_=Q:S.next=Q,S=U;var ie=s.alternate;ie!==null&&(ie=ie.updateQueue,j=ie.lastBaseUpdate,j!==S&&(j===null?ie.firstBaseUpdate=Q:j.next=Q,ie.lastBaseUpdate=U))}if(_!==null){var re=v.baseState;S=0,ie=Q=U=null,j=_;do{var ne=j.lane,ce=j.eventTime;if((m&ne)===ne){ie!==null&&(ie=ie.next={eventTime:ce,lane:0,tag:j.tag,payload:j.payload,callback:j.callback,next:null});e:{var fe=s,pe=j;switch(ne=a,ce=c,pe.tag){case 1:if(fe=pe.payload,typeof fe=="function"){re=fe.call(ce,re,ne);break e}re=fe;break e;case 3:fe.flags=fe.flags&-65537|128;case 0:if(fe=pe.payload,ne=typeof fe=="function"?fe.call(ce,re,ne):fe,ne==null)break e;re=le({},re,ne);break e;case 2:ts=!0}}j.callback!==null&&j.lane!==0&&(s.flags|=64,ne=v.effects,ne===null?v.effects=[j]:ne.push(j))}else ce={eventTime:ce,lane:ne,tag:j.tag,payload:j.payload,callback:j.callback,next:null},ie===null?(Q=ie=ce,U=re):ie=ie.next=ce,S|=ne;if(j=j.next,j===null){if(j=v.shared.pending,j===null)break;ne=j,j=ne.next,ne.next=null,v.lastBaseUpdate=ne,v.shared.pending=null}}while(!0);if(ie===null&&(U=re),v.baseState=U,v.firstBaseUpdate=Q,v.lastBaseUpdate=ie,a=v.shared.interleaved,a!==null){v=a;do S|=v.lane,v=v.next;while(v!==a)}else _===null&&(v.shared.lanes=0);go|=S,s.lanes=S,s.memoizedState=re}}function N0(s,a,c){if(s=a.effects,a.effects=null,s!==null)for(a=0;a<s.length;a++){var m=s[a],v=m.callback;if(v!==null){if(m.callback=null,m=c,typeof v!="function")throw Error(t(191,v));v.call(m)}}}var oc={},Bi=Jr(oc),ac=Jr(oc),lc=Jr(oc);function po(s){if(s===oc)throw Error(t(174));return s}function mp(s,a){switch(Ze(lc,a),Ze(ac,s),Ze(Bi,oc),s=a.nodeType,s){case 9:case 11:a=(a=a.documentElement)?a.namespaceURI:kt(null,"");break;default:s=s===8?a.parentNode:a,a=s.namespaceURI||null,s=s.tagName,a=kt(a,s)}nt(Bi),Ze(Bi,a)}function ja(){nt(Bi),nt(ac),nt(lc)}function R0(s){po(lc.current);var a=po(Bi.current),c=kt(a,s.type);a!==c&&(Ze(ac,s),Ze(Bi,c))}function gp(s){ac.current===s&&(nt(Bi),nt(ac))}var at=Jr(0);function mh(s){for(var a=s;a!==null;){if(a.tag===13){var c=a.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||c.data==="$?"||c.data==="$!"))return a}else if(a.tag===19&&a.memoizedProps.revealOrder!==void 0){if((a.flags&128)!==0)return a}else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return null;a=a.return}a.sibling.return=a.return,a=a.sibling}return null}var yp=[];function vp(){for(var s=0;s<yp.length;s++)yp[s]._workInProgressVersionPrimary=null;yp.length=0}var gh=L.ReactCurrentDispatcher,xp=L.ReactCurrentBatchConfig,mo=0,lt=null,At=null,Vt=null,yh=!1,cc=!1,uc=0,KC=0;function tn(){throw Error(t(321))}function wp(s,a){if(a===null)return!1;for(var c=0;c<a.length&&c<s.length;c++)if(!wi(s[c],a[c]))return!1;return!0}function _p(s,a,c,m,v,_){if(mo=_,lt=a,a.memoizedState=null,a.updateQueue=null,a.lanes=0,gh.current=s===null||s.memoizedState===null?JC:ZC,s=c(m,v),cc){_=0;do{if(cc=!1,uc=0,25<=_)throw Error(t(301));_+=1,Vt=At=null,a.updateQueue=null,gh.current=eI,s=c(m,v)}while(cc)}if(gh.current=wh,a=At!==null&&At.next!==null,mo=0,Vt=At=lt=null,yh=!1,a)throw Error(t(300));return s}function bp(){var s=uc!==0;return uc=0,s}function qi(){var s={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Vt===null?lt.memoizedState=Vt=s:Vt=Vt.next=s,Vt}function ei(){if(At===null){var s=lt.alternate;s=s!==null?s.memoizedState:null}else s=At.next;var a=Vt===null?lt.memoizedState:Vt.next;if(a!==null)Vt=a,At=s;else{if(s===null)throw Error(t(310));At=s,s={memoizedState:At.memoizedState,baseState:At.baseState,baseQueue:At.baseQueue,queue:At.queue,next:null},Vt===null?lt.memoizedState=Vt=s:Vt=Vt.next=s}return Vt}function hc(s,a){return typeof a=="function"?a(s):a}function Ep(s){var a=ei(),c=a.queue;if(c===null)throw Error(t(311));c.lastRenderedReducer=s;var m=At,v=m.baseQueue,_=c.pending;if(_!==null){if(v!==null){var S=v.next;v.next=_.next,_.next=S}m.baseQueue=v=_,c.pending=null}if(v!==null){_=v.next,m=m.baseState;var j=S=null,U=null,Q=_;do{var ie=Q.lane;if((mo&ie)===ie)U!==null&&(U=U.next={lane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),m=Q.hasEagerState?Q.eagerState:s(m,Q.action);else{var re={lane:ie,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null};U===null?(j=U=re,S=m):U=U.next=re,lt.lanes|=ie,go|=ie}Q=Q.next}while(Q!==null&&Q!==_);U===null?S=m:U.next=j,wi(m,a.memoizedState)||(Tn=!0),a.memoizedState=m,a.baseState=S,a.baseQueue=U,c.lastRenderedState=m}if(s=c.interleaved,s!==null){v=s;do _=v.lane,lt.lanes|=_,go|=_,v=v.next;while(v!==s)}else v===null&&(c.lanes=0);return[a.memoizedState,c.dispatch]}function Tp(s){var a=ei(),c=a.queue;if(c===null)throw Error(t(311));c.lastRenderedReducer=s;var m=c.dispatch,v=c.pending,_=a.memoizedState;if(v!==null){c.pending=null;var S=v=v.next;do _=s(_,S.action),S=S.next;while(S!==v);wi(_,a.memoizedState)||(Tn=!0),a.memoizedState=_,a.baseQueue===null&&(a.baseState=_),c.lastRenderedState=_}return[_,m]}function j0(){}function D0(s,a){var c=lt,m=ei(),v=a(),_=!wi(m.memoizedState,v);if(_&&(m.memoizedState=v,Tn=!0),m=m.queue,Sp(L0.bind(null,c,m,s),[s]),m.getSnapshot!==a||_||Vt!==null&&Vt.memoizedState.tag&1){if(c.flags|=2048,dc(9,O0.bind(null,c,m,v,a),void 0,null),Ft===null)throw Error(t(349));(mo&30)!==0||M0(c,a,v)}return v}function M0(s,a,c){s.flags|=16384,s={getSnapshot:a,value:c},a=lt.updateQueue,a===null?(a={lastEffect:null,stores:null},lt.updateQueue=a,a.stores=[s]):(c=a.stores,c===null?a.stores=[s]:c.push(s))}function O0(s,a,c,m){a.value=c,a.getSnapshot=m,V0(a)&&F0(s)}function L0(s,a,c){return c(function(){V0(a)&&F0(s)})}function V0(s){var a=s.getSnapshot;s=s.value;try{var c=a();return!wi(s,c)}catch{return!0}}function F0(s){var a=gr(s,1);a!==null&&Si(a,s,1,-1)}function U0(s){var a=qi();return typeof s=="function"&&(s=s()),a.memoizedState=a.baseState=s,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:hc,lastRenderedState:s},a.queue=s,s=s.dispatch=XC.bind(null,lt,s),[a.memoizedState,s]}function dc(s,a,c,m){return s={tag:s,create:a,destroy:c,deps:m,next:null},a=lt.updateQueue,a===null?(a={lastEffect:null,stores:null},lt.updateQueue=a,a.lastEffect=s.next=s):(c=a.lastEffect,c===null?a.lastEffect=s.next=s:(m=c.next,c.next=s,s.next=m,a.lastEffect=s)),s}function z0(){return ei().memoizedState}function vh(s,a,c,m){var v=qi();lt.flags|=s,v.memoizedState=dc(1|a,c,void 0,m===void 0?null:m)}function xh(s,a,c,m){var v=ei();m=m===void 0?null:m;var _=void 0;if(At!==null){var S=At.memoizedState;if(_=S.destroy,m!==null&&wp(m,S.deps)){v.memoizedState=dc(a,c,_,m);return}}lt.flags|=s,v.memoizedState=dc(1|a,c,_,m)}function B0(s,a){return vh(8390656,8,s,a)}function Sp(s,a){return xh(2048,8,s,a)}function q0(s,a){return xh(4,2,s,a)}function $0(s,a){return xh(4,4,s,a)}function H0(s,a){if(typeof a=="function")return s=s(),a(s),function(){a(null)};if(a!=null)return s=s(),a.current=s,function(){a.current=null}}function W0(s,a,c){return c=c!=null?c.concat([s]):null,xh(4,4,H0.bind(null,a,s),c)}function Cp(){}function G0(s,a){var c=ei();a=a===void 0?null:a;var m=c.memoizedState;return m!==null&&a!==null&&wp(a,m[1])?m[0]:(c.memoizedState=[s,a],s)}function K0(s,a){var c=ei();a=a===void 0?null:a;var m=c.memoizedState;return m!==null&&a!==null&&wp(a,m[1])?m[0]:(s=s(),c.memoizedState=[s,a],s)}function Q0(s,a,c){return(mo&21)===0?(s.baseState&&(s.baseState=!1,Tn=!0),s.memoizedState=c):(wi(c,a)||(c=io(),lt.lanes|=c,go|=c,s.baseState=!0),a)}function QC(s,a){var c=Ve;Ve=c!==0&&4>c?c:4,s(!0);var m=xp.transition;xp.transition={};try{s(!1),a()}finally{Ve=c,xp.transition=m}}function Y0(){return ei().memoizedState}function YC(s,a,c){var m=os(s);if(c={lane:m,action:c,hasEagerState:!1,eagerState:null,next:null},X0(s))J0(a,c);else if(c=k0(s,a,c,m),c!==null){var v=yn();Si(c,s,m,v),Z0(c,a,m)}}function XC(s,a,c){var m=os(s),v={lane:m,action:c,hasEagerState:!1,eagerState:null,next:null};if(X0(s))J0(a,v);else{var _=s.alternate;if(s.lanes===0&&(_===null||_.lanes===0)&&(_=a.lastRenderedReducer,_!==null))try{var S=a.lastRenderedState,j=_(S,c);if(v.hasEagerState=!0,v.eagerState=j,wi(j,S)){var U=a.interleaved;U===null?(v.next=v,fp(a)):(v.next=U.next,U.next=v),a.interleaved=v;return}}catch{}finally{}c=k0(s,a,v,m),c!==null&&(v=yn(),Si(c,s,m,v),Z0(c,a,m))}}function X0(s){var a=s.alternate;return s===lt||a!==null&&a===lt}function J0(s,a){cc=yh=!0;var c=s.pending;c===null?a.next=a:(a.next=c.next,c.next=a),s.pending=a}function Z0(s,a,c){if((c&4194240)!==0){var m=a.lanes;m&=s.pendingLanes,c|=m,a.lanes=c,Hr(s,c)}}var wh={readContext:Zn,useCallback:tn,useContext:tn,useEffect:tn,useImperativeHandle:tn,useInsertionEffect:tn,useLayoutEffect:tn,useMemo:tn,useReducer:tn,useRef:tn,useState:tn,useDebugValue:tn,useDeferredValue:tn,useTransition:tn,useMutableSource:tn,useSyncExternalStore:tn,useId:tn,unstable_isNewReconciler:!1},JC={readContext:Zn,useCallback:function(s,a){return qi().memoizedState=[s,a===void 0?null:a],s},useContext:Zn,useEffect:B0,useImperativeHandle:function(s,a,c){return c=c!=null?c.concat([s]):null,vh(4194308,4,H0.bind(null,a,s),c)},useLayoutEffect:function(s,a){return vh(4194308,4,s,a)},useInsertionEffect:function(s,a){return vh(4,2,s,a)},useMemo:function(s,a){var c=qi();return a=a===void 0?null:a,s=s(),c.memoizedState=[s,a],s},useReducer:function(s,a,c){var m=qi();return a=c!==void 0?c(a):a,m.memoizedState=m.baseState=a,s={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:s,lastRenderedState:a},m.queue=s,s=s.dispatch=YC.bind(null,lt,s),[m.memoizedState,s]},useRef:function(s){var a=qi();return s={current:s},a.memoizedState=s},useState:U0,useDebugValue:Cp,useDeferredValue:function(s){return qi().memoizedState=s},useTransition:function(){var s=U0(!1),a=s[0];return s=QC.bind(null,s[1]),qi().memoizedState=s,[a,s]},useMutableSource:function(){},useSyncExternalStore:function(s,a,c){var m=lt,v=qi();if(ot){if(c===void 0)throw Error(t(407));c=c()}else{if(c=a(),Ft===null)throw Error(t(349));(mo&30)!==0||M0(m,a,c)}v.memoizedState=c;var _={value:c,getSnapshot:a};return v.queue=_,B0(L0.bind(null,m,_,s),[s]),m.flags|=2048,dc(9,O0.bind(null,m,_,c,a),void 0,null),c},useId:function(){var s=qi(),a=Ft.identifierPrefix;if(ot){var c=mr,m=pr;c=(m&~(1<<32-pn(m)-1)).toString(32)+c,a=":"+a+"R"+c,c=uc++,0<c&&(a+="H"+c.toString(32)),a+=":"}else c=KC++,a=":"+a+"r"+c.toString(32)+":";return s.memoizedState=a},unstable_isNewReconciler:!1},ZC={readContext:Zn,useCallback:G0,useContext:Zn,useEffect:Sp,useImperativeHandle:W0,useInsertionEffect:q0,useLayoutEffect:$0,useMemo:K0,useReducer:Ep,useRef:z0,useState:function(){return Ep(hc)},useDebugValue:Cp,useDeferredValue:function(s){var a=ei();return Q0(a,At.memoizedState,s)},useTransition:function(){var s=Ep(hc)[0],a=ei().memoizedState;return[s,a]},useMutableSource:j0,useSyncExternalStore:D0,useId:Y0,unstable_isNewReconciler:!1},eI={readContext:Zn,useCallback:G0,useContext:Zn,useEffect:Sp,useImperativeHandle:W0,useInsertionEffect:q0,useLayoutEffect:$0,useMemo:K0,useReducer:Tp,useRef:z0,useState:function(){return Tp(hc)},useDebugValue:Cp,useDeferredValue:function(s){var a=ei();return At===null?a.memoizedState=s:Q0(a,At.memoizedState,s)},useTransition:function(){var s=Tp(hc)[0],a=ei().memoizedState;return[s,a]},useMutableSource:j0,useSyncExternalStore:D0,useId:Y0,unstable_isNewReconciler:!1};function bi(s,a){if(s&&s.defaultProps){a=le({},a),s=s.defaultProps;for(var c in s)a[c]===void 0&&(a[c]=s[c]);return a}return a}function Ip(s,a,c,m){a=s.memoizedState,c=c(m,a),c=c==null?a:le({},a,c),s.memoizedState=c,s.lanes===0&&(s.updateQueue.baseState=c)}var _h={isMounted:function(s){return(s=s._reactInternals)?fi(s)===s:!1},enqueueSetState:function(s,a,c){s=s._reactInternals;var m=yn(),v=os(s),_=yr(m,v);_.payload=a,c!=null&&(_.callback=c),a=ns(s,_,v),a!==null&&(Si(a,s,v,m),fh(a,s,v))},enqueueReplaceState:function(s,a,c){s=s._reactInternals;var m=yn(),v=os(s),_=yr(m,v);_.tag=1,_.payload=a,c!=null&&(_.callback=c),a=ns(s,_,v),a!==null&&(Si(a,s,v,m),fh(a,s,v))},enqueueForceUpdate:function(s,a){s=s._reactInternals;var c=yn(),m=os(s),v=yr(c,m);v.tag=2,a!=null&&(v.callback=a),a=ns(s,v,m),a!==null&&(Si(a,s,m,c),fh(a,s,m))}};function ex(s,a,c,m,v,_,S){return s=s.stateNode,typeof s.shouldComponentUpdate=="function"?s.shouldComponentUpdate(m,_,S):a.prototype&&a.prototype.isPureReactComponent?!Jl(c,m)||!Jl(v,_):!0}function tx(s,a,c){var m=!1,v=Zr,_=a.contextType;return typeof _=="object"&&_!==null?_=Zn(_):(v=En(a)?co:en.current,m=a.contextTypes,_=(m=m!=null)?Ca(s,v):Zr),a=new a(c,_),s.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=_h,s.stateNode=a,a._reactInternals=s,m&&(s=s.stateNode,s.__reactInternalMemoizedUnmaskedChildContext=v,s.__reactInternalMemoizedMaskedChildContext=_),a}function nx(s,a,c,m){s=a.state,typeof a.componentWillReceiveProps=="function"&&a.componentWillReceiveProps(c,m),typeof a.UNSAFE_componentWillReceiveProps=="function"&&a.UNSAFE_componentWillReceiveProps(c,m),a.state!==s&&_h.enqueueReplaceState(a,a.state,null)}function kp(s,a,c,m){var v=s.stateNode;v.props=c,v.state=s.memoizedState,v.refs={},pp(s);var _=a.contextType;typeof _=="object"&&_!==null?v.context=Zn(_):(_=En(a)?co:en.current,v.context=Ca(s,_)),v.state=s.memoizedState,_=a.getDerivedStateFromProps,typeof _=="function"&&(Ip(s,a,_,c),v.state=s.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(a=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),a!==v.state&&_h.enqueueReplaceState(v,v.state,null),ph(s,c,v,m),v.state=s.memoizedState),typeof v.componentDidMount=="function"&&(s.flags|=4194308)}function Da(s,a){try{var c="",m=a;do c+=je(m),m=m.return;while(m);var v=c}catch(_){v=` Error generating stack: `+_.message+` `+_.stack}return{value:s,source:a,stack:v,digest:null}}function Pp(s,a,c){return{value:s,source:null,stack:c??null,digest:a??null}}function Ap(s,a){try{console.error(a.value)}catch(c){setTimeout(function(){throw c})}}var tI=typeof WeakMap=="function"?WeakMap:Map;function ix(s,a,c){c=yr(-1,c),c.tag=3,c.payload={element:null};var m=a.value;return c.callback=function(){kh||(kh=!0,Hp=m),Ap(s,a)},c}function rx(s,a,c){c=yr(-1,c),c.tag=3;var m=s.type.getDerivedStateFromError;if(typeof m=="function"){var v=a.value;c.payload=function(){return m(v)},c.callback=function(){Ap(s,a)}}var _=s.stateNode;return _!==null&&typeof _.componentDidCatch=="function"&&(c.callback=function(){Ap(s,a),typeof m!="function"&&(rs===null?rs=new Set([this]):rs.add(this));var S=a.stack;this.componentDidCatch(a.value,{componentStack:S!==null?S:""})}),c}function sx(s,a,c){var m=s.pingCache;if(m===null){m=s.pingCache=new tI;var v=new Set;m.set(a,v)}else v=m.get(a),v===void 0&&(v=new Set,m.set(a,v));v.has(c)||(v.add(c),s=mI.bind(null,s,a,c),a.then(s,s))}function ox(s){do{var a;if((a=s.tag===13)&&(a=s.memoizedState,a=a!==null?a.dehydrated!==null:!0),a)return s;s=s.return}while(s!==null);return null}function ax(s,a,c,m,v){return(s.mode&1)===0?(s===a?s.flags|=65536:(s.flags|=128,c.flags|=131072,c.flags&=-52805,c.tag===1&&(c.alternate===null?c.tag=17:(a=yr(-1,1),a.tag=2,ns(c,a,1))),c.lanes|=1),s):(s.flags|=65536,s.lanes=v,s)}var nI=L.ReactCurrentOwner,Tn=!1;function gn(s,a,c,m){a.child=s===null?I0(a,null,c,m):Aa(a,s.child,c,m)}function lx(s,a,c,m,v){c=c.render;var _=a.ref;return Ra(a,v),m=_p(s,a,c,m,_,v),c=bp(),s!==null&&!Tn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~v,vr(s,a,v)):(ot&&c&&rp(a),a.flags|=1,gn(s,a,m,v),a.child)}function cx(s,a,c,m,v){if(s===null){var _=c.type;return typeof _=="function"&&!Jp(_)&&_.defaultProps===void 0&&c.compare===null&&c.defaultProps===void 0?(a.tag=15,a.type=_,ux(s,a,_,m,v)):(s=Dh(c.type,null,m,a,a.mode,v),s.ref=a.ref,s.return=a,a.child=s)}if(_=s.child,(s.lanes&v)===0){var S=_.memoizedProps;if(c=c.compare,c=c!==null?c:Jl,c(S,m)&&s.ref===a.ref)return vr(s,a,v)}return a.flags|=1,s=ls(_,m),s.ref=a.ref,s.return=a,a.child=s}function ux(s,a,c,m,v){if(s!==null){var _=s.memoizedProps;if(Jl(_,m)&&s.ref===a.ref)if(Tn=!1,a.pendingProps=m=_,(s.lanes&v)!==0)(s.flags&131072)!==0&&(Tn=!0);else return a.lanes=s.lanes,vr(s,a,v)}return Np(s,a,c,m,v)}function hx(s,a,c){var m=a.pendingProps,v=m.children,_=s!==null?s.memoizedState:null;if(m.mode==="hidden")if((a.mode&1)===0)a.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ze(Oa,Fn),Fn|=c;else{if((c&1073741824)===0)return s=_!==null?_.baseLanes|c:c,a.lanes=a.childLanes=1073741824,a.memoizedState={baseLanes:s,cachePool:null,transitions:null},a.updateQueue=null,Ze(Oa,Fn),Fn|=s,null;a.memoizedState={baseLanes:0,cachePool:null,transitions:null},m=_!==null?_.baseLanes:c,Ze(Oa,Fn),Fn|=m}else _!==null?(m=_.baseLanes|c,a.memoizedState=null):m=c,Ze(Oa,Fn),Fn|=m;return gn(s,a,v,c),a.child}function dx(s,a){var c=a.ref;(s===null&&c!==null||s!==null&&s.ref!==c)&&(a.flags|=512,a.flags|=2097152)}function Np(s,a,c,m,v){var _=En(c)?co:en.current;return _=Ca(a,_),Ra(a,v),c=_p(s,a,c,m,_,v),m=bp(),s!==null&&!Tn?(a.updateQueue=s.updateQueue,a.flags&=-2053,s.lanes&=~v,vr(s,a,v)):(ot&&m&&rp(a),a.flags|=1,gn(s,a,c,v),a.child)}function fx(s,a,c,m,v){if(En(c)){var _=!0;sh(a)}else _=!1;if(Ra(a,v),a.stateNode===null)Eh(s,a),tx(a,c,m),kp(a,c,m,v),m=!0;else if(s===null){var S=a.stateNode,j=a.memoizedProps;S.props=j;var U=S.context,Q=c.contextType;typeof Q=="object"&&Q!==null?Q=Zn(Q):(Q=En(c)?co:en.current,Q=Ca(a,Q));var ie=c.getDerivedStateFromProps,re=typeof ie=="function"||typeof S.getSnapshotBeforeUpdate=="function";re||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(j!==m||U!==Q)&&nx(a,S,m,Q),ts=!1;var ne=a.memoizedState;S.state=ne,ph(a,m,S,v),U=a.memoizedState,j!==m||ne!==U||bn.current||ts?(typeof ie=="function"&&(Ip(a,c,ie,m),U=a.memoizedState),(j=ts||ex(a,c,j,m,ne,U,Q))?(re||typeof S.UNSAFE_componentWillMount!="function"&&typeof S.componentWillMount!="function"||(typeof S.componentWillMount=="function"&&S.componentWillMount(),typeof S.UNSAFE_componentWillMount=="function"&&S.UNSAFE_componentWillMount()),typeof S.componentDidMount=="function"&&(a.flags|=4194308)):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),a.memoizedProps=m,a.memoizedState=U),S.props=m,S.state=U,S.context=Q,m=j):(typeof S.componentDidMount=="function"&&(a.flags|=4194308),m=!1)}else{S=a.stateNode,P0(s,a),j=a.memoizedProps,Q=a.type===a.elementType?j:bi(a.type,j),S.props=Q,re=a.pendingProps,ne=S.context,U=c.contextType,typeof U=="object"&&U!==null?U=Zn(U):(U=En(c)?co:en.current,U=Ca(a,U));var ce=c.getDerivedStateFromProps;(ie=typeof ce=="function"||typeof S.getSnapshotBeforeUpdate=="function")||typeof S.UNSAFE_componentWillReceiveProps!="function"&&typeof S.componentWillReceiveProps!="function"||(j!==re||ne!==U)&&nx(a,S,m,U),ts=!1,ne=a.memoizedState,S.state=ne,ph(a,m,S,v);var fe=a.memoizedState;j!==re||ne!==fe||bn.current||ts?(typeof ce=="function"&&(Ip(a,c,ce,m),fe=a.memoizedState),(Q=ts||ex(a,c,Q,m,ne,fe,U)||!1)?(ie||typeof S.UNSAFE_componentWillUpdate!="function"&&typeof S.componentWillUpdate!="function"||(typeof S.componentWillUpdate=="function"&&S.componentWillUpdate(m,fe,U),typeof S.UNSAFE_componentWillUpdate=="function"&&S.UNSAFE_componentWillUpdate(m,fe,U)),typeof S.componentDidUpdate=="function"&&(a.flags|=4),typeof S.getSnapshotBeforeUpdate=="function"&&(a.flags|=1024)):(typeof S.componentDidUpdate!="function"||j===s.memoizedProps&&ne===s.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&ne===s.memoizedState||(a.flags|=1024),a.memoizedProps=m,a.memoizedState=fe),S.props=m,S.state=fe,S.context=U,m=Q):(typeof S.componentDidUpdate!="function"||j===s.memoizedProps&&ne===s.memoizedState||(a.flags|=4),typeof S.getSnapshotBeforeUpdate!="function"||j===s.memoizedProps&&ne===s.memoizedState||(a.flags|=1024),m=!1)}return Rp(s,a,c,m,_,v)}function Rp(s,a,c,m,v,_){dx(s,a);var S=(a.flags&128)!==0;if(!m&&!S)return v&&v0(a,c,!1),vr(s,a,_);m=a.stateNode,nI.current=a;var j=S&&typeof c.getDerivedStateFromError!="function"?null:m.render();return a.flags|=1,s!==null&&S?(a.child=Aa(a,s.child,null,_),a.child=Aa(a,null,j,_)):gn(s,a,j,_),a.memoizedState=m.state,v&&v0(a,c,!0),a.child}function px(s){var a=s.stateNode;a.pendingContext?g0(s,a.pendingContext,a.pendingContext!==a.context):a.context&&g0(s,a.context,!1),mp(s,a.containerInfo)}function mx(s,a,c,m,v){return Pa(),lp(v),a.flags|=256,gn(s,a,c,m),a.child}var jp={dehydrated:null,treeContext:null,retryLane:0};function Dp(s){return{baseLanes:s,cachePool:null,transitions:null}}function gx(s,a,c){var m=a.pendingProps,v=at.current,_=!1,S=(a.flags&128)!==0,j;if((j=S)||(j=s!==null&&s.memoizedState===null?!1:(v&2)!==0),j?(_=!0,a.flags&=-129):(s===null||s.memoizedState!==null)&&(v|=1),Ze(at,v&1),s===null)return ap(a),s=a.memoizedState,s!==null&&(s=s.dehydrated,s!==null)?((a.mode&1)===0?a.lanes=1:s.data==="$!"?a.lanes=8:a.lanes=1073741824,null):(S=m.children,s=m.fallback,_?(m=a.mode,_=a.child,S={mode:"hidden",children:S},(m&1)===0&&_!==null?(_.childLanes=0,_.pendingProps=S):_=Mh(S,m,0,null),s=wo(s,m,c,null),_.return=a,s.return=a,_.sibling=s,a.child=_,a.child.memoizedState=Dp(c),a.memoizedState=jp,s):Mp(a,S));if(v=s.memoizedState,v!==null&&(j=v.dehydrated,j!==null))return iI(s,a,S,m,j,v,c);if(_){_=m.fallback,S=a.mode,v=s.child,j=v.sibling;var U={mode:"hidden",children:m.children};return(S&1)===0&&a.child!==v?(m=a.child,m.childLanes=0,m.pendingProps=U,a.deletions=null):(m=ls(v,U),m.subtreeFlags=v.subtreeFlags&14680064),j!==null?_=ls(j,_):(_=wo(_,S,c,null),_.flags|=2),_.return=a,m.return=a,m.sibling=_,a.child=m,m=_,_=a.child,S=s.child.memoizedState,S=S===null?Dp(c):{baseLanes:S.baseLanes|c,cachePool:null,transitions:S.transitions},_.memoizedState=S,_.childLanes=s.childLanes&~c,a.memoizedState=jp,m}return _=s.child,s=_.sibling,m=ls(_,{mode:"visible",children:m.children}),(a.mode&1)===0&&(m.lanes=c),m.return=a,m.sibling=null,s!==null&&(c=a.deletions,c===null?(a.deletions=[s],a.flags|=16):c.push(s)),a.child=m,a.memoizedState=null,m}function Mp(s,a){return a=Mh({mode:"visible",children:a},s.mode,0,null),a.return=s,s.child=a}function bh(s,a,c,m){return m!==null&&lp(m),Aa(a,s.child,null,c),s=Mp(a,a.pendingProps.children),s.flags|=2,a.memoizedState=null,s}function iI(s,a,c,m,v,_,S){if(c)return a.flags&256?(a.flags&=-257,m=Pp(Error(t(422))),bh(s,a,S,m)):a.memoizedState!==null?(a.child=s.child,a.flags|=128,null):(_=m.fallback,v=a.mode,m=Mh({mode:"visible",children:m.children},v,0,null),_=wo(_,v,S,null),_.flags|=2,m.return=a,_.return=a,m.sibling=_,a.child=m,(a.mode&1)!==0&&Aa(a,s.child,null,S),a.child.memoizedState=Dp(S),a.memoizedState=jp,_);if((a.mode&1)===0)return bh(s,a,S,null);if(v.data==="$!"){if(m=v.nextSibling&&v.nextSibling.dataset,m)var j=m.dgst;return m=j,_=Error(t(419)),m=Pp(_,m,void 0),bh(s,a,S,m)}if(j=(S&s.childLanes)!==0,Tn||j){if(m=Ft,m!==null){switch(S&-S){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|S))!==0?0:v,v!==0&&v!==_.retryLane&&(_.retryLane=v,gr(s,v),Si(m,s,v,-1))}return Xp(),m=Pp(Error(t(421))),bh(s,a,S,m)}return v.data==="$?"?(a.flags|=128,a.child=s.child,a=gI.bind(null,s),v._reactRetry=a,null):(s=_.treeContext,Vn=Xr(v.nextSibling),Ln=a,ot=!0,_i=null,s!==null&&(Xn[Jn++]=pr,Xn[Jn++]=mr,Xn[Jn++]=uo,pr=s.id,mr=s.overflow,uo=a),a=Mp(a,m.children),a.flags|=4096,a)}function yx(s,a,c){s.lanes|=a;var m=s.alternate;m!==null&&(m.lanes|=a),dp(s.return,a,c)}function Op(s,a,c,m,v){var _=s.memoizedState;_===null?s.memoizedState={isBackwards:a,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:v}:(_.isBackwards=a,_.rendering=null,_.renderingStartTime=0,_.last=m,_.tail=c,_.tailMode=v)}function vx(s,a,c){var m=a.pendingProps,v=m.revealOrder,_=m.tail;if(gn(s,a,m.children,c),m=at.current,(m&2)!==0)m=m&1|2,a.flags|=128;else{if(s!==null&&(s.flags&128)!==0)e:for(s=a.child;s!==null;){if(s.tag===13)s.memoizedState!==null&&yx(s,c,a);else if(s.tag===19)yx(s,c,a);else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===a)break e;for(;s.sibling===null;){if(s.return===null||s.return===a)break e;s=s.return}s.sibling.return=s.return,s=s.sibling}m&=1}if(Ze(at,m),(a.mode&1)===0)a.memoizedState=null;else switch(v){case"forwards":for(c=a.child,v=null;c!==null;)s=c.alternate,s!==null&&mh(s)===null&&(v=c),c=c.sibling;c=v,c===null?(v=a.child,a.child=null):(v=c.sibling,c.sibling=null),Op(a,!1,v,c,_);break;case"backwards":for(c=null,v=a.child,a.child=null;v!==null;){if(s=v.alternate,s!==null&&mh(s)===null){a.child=v;break}s=v.sibling,v.sibling=c,c=v,v=s}Op(a,!0,c,null,_);break;case"together":Op(a,!1,null,null,void 0);break;default:a.memoizedState=null}return a.child}function Eh(s,a){(a.mode&1)===0&&s!==null&&(s.alternate=null,a.alternate=null,a.flags|=2)}function vr(s,a,c){if(s!==null&&(a.dependencies=s.dependencies),go|=a.lanes,(c&a.childLanes)===0)return null;if(s!==null&&a.child!==s.child)throw Error(t(153));if(a.child!==null){for(s=a.child,c=ls(s,s.pendingProps),a.child=c,c.return=a;s.sibling!==null;)s=s.sibling,c=c.sibling=ls(s,s.pendingProps),c.return=a;c.sibling=null}return a.child}function rI(s,a,c){switch(a.tag){case 3:px(a),Pa();break;case 5:R0(a);break;case 1:En(a.type)&&sh(a);break;case 4:mp(a,a.stateNode.containerInfo);break;case 10:var m=a.type._context,v=a.memoizedProps.value;Ze(hh,m._currentValue),m._currentValue=v;break;case 13:if(m=a.memoizedState,m!==null)return m.dehydrated!==null?(Ze(at,at.current&1),a.flags|=128,null):(c&a.child.childLanes)!==0?gx(s,a,c):(Ze(at,at.current&1),s=vr(s,a,c),s!==null?s.sibling:null);Ze(at,at.current&1);break;case 19:if(m=(c&a.childLanes)!==0,(s.flags&128)!==0){if(m)return vx(s,a,c);a.flags|=128}if(v=a.memoizedState,v!==null&&(v.rendering=null,v.tail=null,v.lastEffect=null),Ze(at,at.current),m)break;return null;case 22:case 23:return a.lanes=0,hx(s,a,c)}return vr(s,a,c)}var xx,Lp,wx,_x;xx=function(s,a){for(var c=a.child;c!==null;){if(c.tag===5||c.tag===6)s.appendChild(c.stateNode);else if(c.tag!==4&&c.child!==null){c.child.return=c,c=c.child;continue}if(c===a)break;for(;c.sibling===null;){if(c.return===null||c.return===a)return;c=c.return}c.sibling.return=c.return,c=c.sibling}},Lp=function(){},wx=function(s,a,c,m){var v=s.memoizedProps;if(v!==m){s=a.stateNode,po(Bi.current);var _=null;switch(c){case"input":v=Ws(s,v),m=Ws(s,m),_=[];break;case"select":v=le({},v,{value:void 0}),m=le({},m,{value:void 0}),_=[];break;case"textarea":v=Il(s,v),m=Il(s,m),_=[];break;default:typeof v.onClick!="function"&&typeof m.onClick=="function"&&(s.onclick=nh)}jl(c,m);var S;c=null;for(Q in v)if(!m.hasOwnProperty(Q)&&v.hasOwnProperty(Q)&&v[Q]!=null)if(Q==="style"){var j=v[Q];for(S in j)j.hasOwnProperty(S)&&(c||(c={}),c[S]="")}else Q!=="dangerouslySetInnerHTML"&&Q!=="children"&&Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&Q!=="autoFocus"&&(r.hasOwnProperty(Q)?_||(_=[]):(_=_||[]).push(Q,null));for(Q in m){var U=m[Q];if(j=v!=null?v[Q]:void 0,m.hasOwnProperty(Q)&&U!==j&&(U!=null||j!=null))if(Q==="style")if(j){for(S in j)!j.hasOwnProperty(S)||U&&U.hasOwnProperty(S)||(c||(c={}),c[S]="");for(S in U)U.hasOwnProperty(S)&&j[S]!==U[S]&&(c||(c={}),c[S]=U[S])}else c||(_||(_=[]),_.push(Q,c)),c=U;else Q==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,j=j?j.__html:void 0,U!=null&&j!==U&&(_=_||[]).push(Q,U)):Q==="children"?typeof U!="string"&&typeof U!="number"||(_=_||[]).push(Q,""+U):Q!=="suppressContentEditableWarning"&&Q!=="suppressHydrationWarning"&&(r.hasOwnProperty(Q)?(U!=null&&Q==="onScroll"&&tt("scroll",s),_||j===U||(_=[])):(_=_||[]).push(Q,U))}c&&(_=_||[]).push("style",c);var Q=_;(a.updateQueue=Q)&&(a.flags|=4)}},_x=function(s,a,c,m){c!==m&&(a.flags|=4)};function fc(s,a){if(!ot)switch(s.tailMode){case"hidden":a=s.tail;for(var c=null;a!==null;)a.alternate!==null&&(c=a),a=a.sibling;c===null?s.tail=null:c.sibling=null;break;case"collapsed":c=s.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?a||s.tail===null?s.tail=null:s.tail.sibling=null:m.sibling=null}}function nn(s){var a=s.alternate!==null&&s.alternate.child===s.child,c=0,m=0;if(a)for(var v=s.child;v!==null;)c|=v.lanes|v.childLanes,m|=v.subtreeFlags&14680064,m|=v.flags&14680064,v.return=s,v=v.sibling;else for(v=s.child;v!==null;)c|=v.lanes|v.childLanes,m|=v.subtreeFlags,m|=v.flags,v.return=s,v=v.sibling;return s.subtreeFlags|=m,s.childLanes=c,a}function sI(s,a,c){var m=a.pendingProps;switch(sp(a),a.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nn(a),null;case 1:return En(a.type)&&rh(),nn(a),null;case 3:return m=a.stateNode,ja(),nt(bn),nt(en),vp(),m.pendingContext&&(m.context=m.pendingContext,m.pendingContext=null),(s===null||s.child===null)&&(ch(a)?a.flags|=4:s===null||s.memoizedState.isDehydrated&&(a.flags&256)===0||(a.flags|=1024,_i!==null&&(Kp(_i),_i=null))),Lp(s,a),nn(a),null;case 5:gp(a);var v=po(lc.current);if(c=a.type,s!==null&&a.stateNode!=null)wx(s,a,c,m,v),s.ref!==a.ref&&(a.flags|=512,a.flags|=2097152);else{if(!m){if(a.stateNode===null)throw Error(t(166));return nn(a),null}if(s=po(Bi.current),ch(a)){m=a.stateNode,c=a.type;var _=a.memoizedProps;switch(m[zi]=a,m[ic]=_,s=(a.mode&1)!==0,c){case"dialog":tt("cancel",m),tt("close",m);break;case"iframe":case"object":case"embed":tt("load",m);break;case"video":case"audio":for(v=0;v<ec.length;v++)tt(ec[v],m);break;case"source":tt("error",m);break;case"img":case"image":case"link":tt("error",m),tt("load",m);break;case"details":tt("toggle",m);break;case"input":Ko(m,_),tt("invalid",m);break;case"select":m._wrapperState={wasMultiple:!!_.multiple},tt("invalid",m);break;case"textarea":Yo(m,_),tt("invalid",m)}jl(c,_),v=null;for(var S in _)if(_.hasOwnProperty(S)){var j=_[S];S==="children"?typeof j=="string"?m.textContent!==j&&(_.suppressHydrationWarning!==!0&&th(m.textContent,j,s),v=["children",j]):typeof j=="number"&&m.textContent!==""+j&&(_.suppressHydrationWarning!==!0&&th(m.textContent,j,s),v=["children",""+j]):r.hasOwnProperty(S)&&j!=null&&S==="onScroll"&&tt("scroll",m)}switch(c){case"input":nr(m),Iu(m,_,!0);break;case"textarea":nr(m),kl(m);break;case"select":case"option":break;default:typeof _.onClick=="function"&&(m.onclick=nh)}m=v,a.updateQueue=m,m!==null&&(a.flags|=4)}else{S=v.nodeType===9?v:v.ownerDocument,s==="http://www.w3.org/1999/xhtml"&&(s=It(c)),s==="http://www.w3.org/1999/xhtml"?c==="script"?(s=S.createElement("div"),s.innerHTML="<script><\/script>",s=s.removeChild(s.firstChild)):typeof m.is=="string"?s=S.createElement(c,{is:m.is}):(s=S.createElement(c),c==="select"&&(S=s,m.multiple?S.multiple=!0:m.size&&(S.size=m.size))):s=S.createElementNS(s,c),s[zi]=a,s[ic]=m,xx(s,a,!1,!1),a.stateNode=s;e:{switch(S=Dl(c,m),c){case"dialog":tt("cancel",s),tt("close",s),v=m;break;case"iframe":case"object":case"embed":tt("load",s),v=m;break;case"video":case"audio":for(v=0;v<ec.length;v++)tt(ec[v],s);v=m;break;case"source":tt("error",s),v=m;break;case"img":case"image":case"link":tt("error",s),tt("load",s),v=m;break;case"details":tt("toggle",s),v=m;break;case"input":Ko(s,m),v=Ws(s,m),tt("invalid",s);break;case"option":v=m;break;case"select":s._wrapperState={wasMultiple:!!m.multiple},v=le({},m,{value:void 0}),tt("invalid",s);break;case"textarea":Yo(s,m),v=Il(s,m),tt("invalid",s);break;default:v=m}jl(c,v),j=v;for(_ in j)if(j.hasOwnProperty(_)){var U=j[_];_==="style"?Nl(s,U):_==="dangerouslySetInnerHTML"?(U=U?U.__html:void 0,U!=null&&Pl(s,U)):_==="children"?typeof U=="string"?(c!=="textarea"||U!=="")&&Ur(s,U):typeof U=="number"&&Ur(s,""+U):_!=="suppressContentEditableWarning"&&_!=="suppressHydrationWarning"&&_!=="autoFocus"&&(r.hasOwnProperty(_)?U!=null&&_==="onScroll"&&tt("scroll",s):U!=null&&O(s,_,U,S))}switch(c){case"input":nr(s),Iu(s,m,!1);break;case"textarea":nr(s),kl(s);break;case"option":m.value!=null&&s.setAttribute("value",""+We(m.value));break;case"select":s.multiple=!!m.multiple,_=m.value,_!=null?rr(s,!!m.multiple,_,!1):m.defaultValue!=null&&rr(s,!!m.multiple,m.defaultValue,!0);break;default:typeof v.onClick=="function"&&(s.onclick=nh)}switch(c){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}}m&&(a.flags|=4)}a.ref!==null&&(a.flags|=512,a.flags|=2097152)}return nn(a),null;case 6:if(s&&a.stateNode!=null)_x(s,a,s.memoizedProps,m);else{if(typeof m!="string"&&a.stateNode===null)throw Error(t(166));if(c=po(lc.current),po(Bi.current),ch(a)){if(m=a.stateNode,c=a.memoizedProps,m[zi]=a,(_=m.nodeValue!==c)&&(s=Ln,s!==null))switch(s.tag){case 3:th(m.nodeValue,c,(s.mode&1)!==0);break;case 5:s.memoizedProps.suppressHydrationWarning!==!0&&th(m.nodeValue,c,(s.mode&1)!==0)}_&&(a.flags|=4)}else m=(c.nodeType===9?c:c.ownerDocument).createTextNode(m),m[zi]=a,a.stateNode=m}return nn(a),null;case 13:if(nt(at),m=a.memoizedState,s===null||s.memoizedState!==null&&s.memoizedState.dehydrated!==null){if(ot&&Vn!==null&&(a.mode&1)!==0&&(a.flags&128)===0)T0(),Pa(),a.flags|=98560,_=!1;else if(_=ch(a),m!==null&&m.dehydrated!==null){if(s===null){if(!_)throw Error(t(318));if(_=a.memoizedState,_=_!==null?_.dehydrated:null,!_)throw Error(t(317));_[zi]=a}else Pa(),(a.flags&128)===0&&(a.memoizedState=null),a.flags|=4;nn(a),_=!1}else _i!==null&&(Kp(_i),_i=null),_=!0;if(!_)return a.flags&65536?a:null}return(a.flags&128)!==0?(a.lanes=c,a):(m=m!==null,m!==(s!==null&&s.memoizedState!==null)&&m&&(a.child.flags|=8192,(a.mode&1)!==0&&(s===null||(at.current&1)!==0?Nt===0&&(Nt=3):Xp())),a.updateQueue!==null&&(a.flags|=4),nn(a),null);case 4:return ja(),Lp(s,a),s===null&&tc(a.stateNode.containerInfo),nn(a),null;case 10:return hp(a.type._context),nn(a),null;case 17:return En(a.type)&&rh(),nn(a),null;case 19:if(nt(at),_=a.memoizedState,_===null)return nn(a),null;if(m=(a.flags&128)!==0,S=_.rendering,S===null)if(m)fc(_,!1);else{if(Nt!==0||s!==null&&(s.flags&128)!==0)for(s=a.child;s!==null;){if(S=mh(s),S!==null){for(a.flags|=128,fc(_,!1),m=S.updateQueue,m!==null&&(a.updateQueue=m,a.flags|=4),a.subtreeFlags=0,m=c,c=a.child;c!==null;)_=c,s=m,_.flags&=14680066,S=_.alternate,S===null?(_.childLanes=0,_.lanes=s,_.child=null,_.subtreeFlags=0,_.memoizedProps=null,_.memoizedState=null,_.updateQueue=null,_.dependencies=null,_.stateNode=null):(_.childLanes=S.childLanes,_.lanes=S.lanes,_.child=S.child,_.subtreeFlags=0,_.deletions=null,_.memoizedProps=S.memoizedProps,_.memoizedState=S.memoizedState,_.updateQueue=S.updateQueue,_.type=S.type,s=S.dependencies,_.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),c=c.sibling;return Ze(at,at.current&1|2),a.child}s=s.sibling}_.tail!==null&&Je()>La&&(a.flags|=128,m=!0,fc(_,!1),a.lanes=4194304)}else{if(!m)if(s=mh(S),s!==null){if(a.flags|=128,m=!0,c=s.updateQueue,c!==null&&(a.updateQueue=c,a.flags|=4),fc(_,!0),_.tail===null&&_.tailMode==="hidden"&&!S.alternate&&!ot)return nn(a),null}else 2*Je()-_.renderingStartTime>La&&c!==1073741824&&(a.flags|=128,m=!0,fc(_,!1),a.lanes=4194304);_.isBackwards?(S.sibling=a.child,a.child=S):(c=_.last,c!==null?c.sibling=S:a.child=S,_.last=S)}return _.tail!==null?(a=_.tail,_.rendering=a,_.tail=a.sibling,_.renderingStartTime=Je(),a.sibling=null,c=at.current,Ze(at,m?c&1|2:c&1),a):(nn(a),null);case 22:case 23:return Yp(),m=a.memoizedState!==null,s!==null&&s.memoizedState!==null!==m&&(a.flags|=8192),m&&(a.mode&1)!==0?(Fn&1073741824)!==0&&(nn(a),a.subtreeFlags&6&&(a.flags|=8192)):nn(a),null;case 24:return null;case 25:return null}throw Error(t(156,a.tag))}function oI(s,a){switch(sp(a),a.tag){case 1:return En(a.type)&&rh(),s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 3:return ja(),nt(bn),nt(en),vp(),s=a.flags,(s&65536)!==0&&(s&128)===0?(a.flags=s&-65537|128,a):null;case 5:return gp(a),null;case 13:if(nt(at),s=a.memoizedState,s!==null&&s.dehydrated!==null){if(a.alternate===null)throw Error(t(340));Pa()}return s=a.flags,s&65536?(a.flags=s&-65537|128,a):null;case 19:return nt(at),null;case 4:return ja(),null;case 10:return hp(a.type._context),null;case 22:case 23:return Yp(),null;case 24:return null;default:return null}}var Th=!1,rn=!1,aI=typeof WeakSet=="function"?WeakSet:Set,de=null;function Ma(s,a){var c=s.ref;if(c!==null)if(typeof c=="function")try{c(null)}catch(m){ft(s,a,m)}else c.current=null}function Vp(s,a,c){try{c()}catch(m){ft(s,a,m)}}var bx=!1;function lI(s,a){if(Yf=Kr,s=e0(),Bf(s)){if("selectionStart"in s)var c={start:s.selectionStart,end:s.selectionEnd};else e:{c=(c=s.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var v=m.anchorOffset,_=m.focusNode;m=m.focusOffset;try{c.nodeType,_.nodeType}catch{c=null;break e}var S=0,j=-1,U=-1,Q=0,ie=0,re=s,ne=null;t:for(;;){for(var ce;re!==c||v!==0&&re.nodeType!==3||(j=S+v),re!==_||m!==0&&re.nodeType!==3||(U=S+m),re.nodeType===3&&(S+=re.nodeValue.length),(ce=re.firstChild)!==null;)ne=re,re=ce;for(;;){if(re===s)break t;if(ne===c&&++Q===v&&(j=S),ne===_&&++ie===m&&(U=S),(ce=re.nextSibling)!==null)break;re=ne,ne=re.parentNode}re=ce}c=j===-1||U===-1?null:{start:j,end:U}}else c=null}c=c||{start:0,end:0}}else c=null;for(Xf={focusedElem:s,selectionRange:c},Kr=!1,de=a;de!==null;)if(a=de,s=a.child,(a.subtreeFlags&1028)!==0&&s!==null)s.return=a,de=s;else for(;de!==null;){a=de;try{var fe=a.alternate;if((a.flags&1024)!==0)switch(a.tag){case 0:case 11:case 15:break;case 1:if(fe!==null){var pe=fe.memoizedProps,yt=fe.memoizedState,W=a.stateNode,B=W.getSnapshotBeforeUpdate(a.elementType===a.type?pe:bi(a.type,pe),yt);W.__reactInternalSnapshotBeforeUpdate=B}break;case 3:var K=a.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(t(163))}}catch(se){ft(a,a.return,se)}if(s=a.sibling,s!==null){s.return=a.return,de=s;break}de=a.return}return fe=bx,bx=!1,fe}function pc(s,a,c){var m=a.updateQueue;if(m=m!==null?m.lastEffect:null,m!==null){var v=m=m.next;do{if((v.tag&s)===s){var _=v.destroy;v.destroy=void 0,_!==void 0&&Vp(a,c,_)}v=v.next}while(v!==m)}}function Sh(s,a){if(a=a.updateQueue,a=a!==null?a.lastEffect:null,a!==null){var c=a=a.next;do{if((c.tag&s)===s){var m=c.create;c.destroy=m()}c=c.next}while(c!==a)}}function Fp(s){var a=s.ref;if(a!==null){var c=s.stateNode;switch(s.tag){case 5:s=c;break;default:s=c}typeof a=="function"?a(s):a.current=s}}function Ex(s){var a=s.alternate;a!==null&&(s.alternate=null,Ex(a)),s.child=null,s.deletions=null,s.sibling=null,s.tag===5&&(a=s.stateNode,a!==null&&(delete a[zi],delete a[ic],delete a[tp],delete a[$C],delete a[HC])),s.stateNode=null,s.return=null,s.dependencies=null,s.memoizedProps=null,s.memoizedState=null,s.pendingProps=null,s.stateNode=null,s.updateQueue=null}function Tx(s){return s.tag===5||s.tag===3||s.tag===4}function Sx(s){e:for(;;){for(;s.sibling===null;){if(s.return===null||Tx(s.return))return null;s=s.return}for(s.sibling.return=s.return,s=s.sibling;s.tag!==5&&s.tag!==6&&s.tag!==18;){if(s.flags&2||s.child===null||s.tag===4)continue e;s.child.return=s,s=s.child}if(!(s.flags&2))return s.stateNode}}function Up(s,a,c){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?c.nodeType===8?c.parentNode.insertBefore(s,a):c.insertBefore(s,a):(c.nodeType===8?(a=c.parentNode,a.insertBefore(s,c)):(a=c,a.appendChild(s)),c=c._reactRootContainer,c!=null||a.onclick!==null||(a.onclick=nh));else if(m!==4&&(s=s.child,s!==null))for(Up(s,a,c),s=s.sibling;s!==null;)Up(s,a,c),s=s.sibling}function zp(s,a,c){var m=s.tag;if(m===5||m===6)s=s.stateNode,a?c.insertBefore(s,a):c.appendChild(s);else if(m!==4&&(s=s.child,s!==null))for(zp(s,a,c),s=s.sibling;s!==null;)zp(s,a,c),s=s.sibling}var Gt=null,Ei=!1;function is(s,a,c){for(c=c.child;c!==null;)Cx(s,a,c),c=c.sibling}function Cx(s,a,c){if(jn&&typeof jn.onCommitFiberUnmount=="function")try{jn.onCommitFiberUnmount(to,c)}catch{}switch(c.tag){case 5:rn||Ma(c,a);case 6:var m=Gt,v=Ei;Gt=null,is(s,a,c),Gt=m,Ei=v,Gt!==null&&(Ei?(s=Gt,c=c.stateNode,s.nodeType===8?s.parentNode.removeChild(c):s.removeChild(c)):Gt.removeChild(c.stateNode));break;case 18:Gt!==null&&(Ei?(s=Gt,c=c.stateNode,s.nodeType===8?ep(s.parentNode,c):s.nodeType===1&&ep(s,c),vi(s)):ep(Gt,c.stateNode));break;case 4:m=Gt,v=Ei,Gt=c.stateNode.containerInfo,Ei=!0,is(s,a,c),Gt=m,Ei=v;break;case 0:case 11:case 14:case 15:if(!rn&&(m=c.updateQueue,m!==null&&(m=m.lastEffect,m!==null))){v=m=m.next;do{var _=v,S=_.destroy;_=_.tag,S!==void 0&&((_&2)!==0||(_&4)!==0)&&Vp(c,a,S),v=v.next}while(v!==m)}is(s,a,c);break;case 1:if(!rn&&(Ma(c,a),m=c.stateNode,typeof m.componentWillUnmount=="function"))try{m.props=c.memoizedProps,m.state=c.memoizedState,m.componentWillUnmount()}catch(j){ft(c,a,j)}is(s,a,c);break;case 21:is(s,a,c);break;case 22:c.mode&1?(rn=(m=rn)||c.memoizedState!==null,is(s,a,c),rn=m):is(s,a,c);break;default:is(s,a,c)}}function Ix(s){var a=s.updateQueue;if(a!==null){s.updateQueue=null;var c=s.stateNode;c===null&&(c=s.stateNode=new aI),a.forEach(function(m){var v=yI.bind(null,s,m);c.has(m)||(c.add(m),m.then(v,v))})}}function Ti(s,a){var c=a.deletions;if(c!==null)for(var m=0;m<c.length;m++){var v=c[m];try{var _=s,S=a,j=S;e:for(;j!==null;){switch(j.tag){case 5:Gt=j.stateNode,Ei=!1;break e;case 3:Gt=j.stateNode.containerInfo,Ei=!0;break e;case 4:Gt=j.stateNode.containerInfo,Ei=!0;break e}j=j.return}if(Gt===null)throw Error(t(160));Cx(_,S,v),Gt=null,Ei=!1;var U=v.alternate;U!==null&&(U.return=null),v.return=null}catch(Q){ft(v,a,Q)}}if(a.subtreeFlags&12854)for(a=a.child;a!==null;)kx(a,s),a=a.sibling}function kx(s,a){var c=s.alternate,m=s.flags;switch(s.tag){case 0:case 11:case 14:case 15:if(Ti(a,s),$i(s),m&4){try{pc(3,s,s.return),Sh(3,s)}catch(pe){ft(s,s.return,pe)}try{pc(5,s,s.return)}catch(pe){ft(s,s.return,pe)}}break;case 1:Ti(a,s),$i(s),m&512&&c!==null&&Ma(c,c.return);break;case 5:if(Ti(a,s),$i(s),m&512&&c!==null&&Ma(c,c.return),s.flags&32){var v=s.stateNode;try{Ur(v,"")}catch(pe){ft(s,s.return,pe)}}if(m&4&&(v=s.stateNode,v!=null)){var _=s.memoizedProps,S=c!==null?c.memoizedProps:_,j=s.type,U=s.updateQueue;if(s.updateQueue=null,U!==null)try{j==="input"&&_.type==="radio"&&_.name!=null&&Sl(v,_),Dl(j,S);var Q=Dl(j,_);for(S=0;S<U.length;S+=2){var ie=U[S],re=U[S+1];ie==="style"?Nl(v,re):ie==="dangerouslySetInnerHTML"?Pl(v,re):ie==="children"?Ur(v,re):O(v,ie,re,Q)}switch(j){case"input":Cl(v,_);break;case"textarea":Xo(v,_);break;case"select":var ne=v._wrapperState.wasMultiple;v._wrapperState.wasMultiple=!!_.multiple;var ce=_.value;ce!=null?rr(v,!!_.multiple,ce,!1):ne!==!!_.multiple&&(_.defaultValue!=null?rr(v,!!_.multiple,_.defaultValue,!0):rr(v,!!_.multiple,_.multiple?[]:"",!1))}v[ic]=_}catch(pe){ft(s,s.return,pe)}}break;case 6:if(Ti(a,s),$i(s),m&4){if(s.stateNode===null)throw Error(t(162));v=s.stateNode,_=s.memoizedProps;try{v.nodeValue=_}catch(pe){ft(s,s.return,pe)}}break;case 3:if(Ti(a,s),$i(s),m&4&&c!==null&&c.memoizedState.isDehydrated)try{vi(a.containerInfo)}catch(pe){ft(s,s.return,pe)}break;case 4:Ti(a,s),$i(s);break;case 13:Ti(a,s),$i(s),v=s.child,v.flags&8192&&(_=v.memoizedState!==null,v.stateNode.isHidden=_,!_||v.alternate!==null&&v.alternate.memoizedState!==null||($p=Je())),m&4&&Ix(s);break;case 22:if(ie=c!==null&&c.memoizedState!==null,s.mode&1?(rn=(Q=rn)||ie,Ti(a,s),rn=Q):Ti(a,s),$i(s),m&8192){if(Q=s.memoizedState!==null,(s.stateNode.isHidden=Q)&&!ie&&(s.mode&1)!==0)for(de=s,ie=s.child;ie!==null;){for(re=de=ie;de!==null;){switch(ne=de,ce=ne.child,ne.tag){case 0:case 11:case 14:case 15:pc(4,ne,ne.return);break;case 1:Ma(ne,ne.return);var fe=ne.stateNode;if(typeof fe.componentWillUnmount=="function"){m=ne,c=ne.return;try{a=m,fe.props=a.memoizedProps,fe.state=a.memoizedState,fe.componentWillUnmount()}catch(pe){ft(m,c,pe)}}break;case 5:Ma(ne,ne.return);break;case 22:if(ne.memoizedState!==null){Nx(re);continue}}ce!==null?(ce.return=ne,de=ce):Nx(re)}ie=ie.sibling}e:for(ie=null,re=s;;){if(re.tag===5){if(ie===null){ie=re;try{v=re.stateNode,Q?(_=v.style,typeof _.setProperty=="function"?_.setProperty("display","none","important"):_.display="none"):(j=re.stateNode,U=re.memoizedProps.style,S=U!=null&&U.hasOwnProperty("display")?U.display:null,j.style.display=Al("display",S))}catch(pe){ft(s,s.return,pe)}}}else if(re.tag===6){if(ie===null)try{re.stateNode.nodeValue=Q?"":re.memoizedProps}catch(pe){ft(s,s.return,pe)}}else if((re.tag!==22&&re.tag!==23||re.memoizedState===null||re===s)&&re.child!==null){re.child.return=re,re=re.child;continue}if(re===s)break e;for(;re.sibling===null;){if(re.return===null||re.return===s)break e;ie===re&&(ie=null),re=re.return}ie===re&&(ie=null),re.sibling.return=re.return,re=re.sibling}}break;case 19:Ti(a,s),$i(s),m&4&&Ix(s);break;case 21:break;default:Ti(a,s),$i(s)}}function $i(s){var a=s.flags;if(a&2){try{e:{for(var c=s.return;c!==null;){if(Tx(c)){var m=c;break e}c=c.return}throw Error(t(160))}switch(m.tag){case 5:var v=m.stateNode;m.flags&32&&(Ur(v,""),m.flags&=-33);var _=Sx(s);zp(s,_,v);break;case 3:case 4:var S=m.stateNode.containerInfo,j=Sx(s);Up(s,j,S);break;default:throw Error(t(161))}}catch(U){ft(s,s.return,U)}s.flags&=-3}a&4096&&(s.flags&=-4097)}function cI(s,a,c){de=s,Px(s)}function Px(s,a,c){for(var m=(s.mode&1)!==0;de!==null;){var v=de,_=v.child;if(v.tag===22&&m){var S=v.memoizedState!==null||Th;if(!S){var j=v.alternate,U=j!==null&&j.memoizedState!==null||rn;j=Th;var Q=rn;if(Th=S,(rn=U)&&!Q)for(de=v;de!==null;)S=de,U=S.child,S.tag===22&&S.memoizedState!==null?Rx(v):U!==null?(U.return=S,de=U):Rx(v);for(;_!==null;)de=_,Px(_),_=_.sibling;de=v,Th=j,rn=Q}Ax(s)}else(v.subtreeFlags&8772)!==0&&_!==null?(_.return=v,de=_):Ax(s)}}function Ax(s){for(;de!==null;){var a=de;if((a.flags&8772)!==0){var c=a.alternate;try{if((a.flags&8772)!==0)switch(a.tag){case 0:case 11:case 15:rn||Sh(5,a);break;case 1:var m=a.stateNode;if(a.flags&4&&!rn)if(c===null)m.componentDidMount();else{var v=a.elementType===a.type?c.memoizedProps:bi(a.type,c.memoizedProps);m.componentDidUpdate(v,c.memoizedState,m.__reactInternalSnapshotBeforeUpdate)}var _=a.updateQueue;_!==null&&N0(a,_,m);break;case 3:var S=a.updateQueue;if(S!==null){if(c=null,a.child!==null)switch(a.child.tag){case 5:c=a.child.stateNode;break;case 1:c=a.child.stateNode}N0(a,S,c)}break;case 5:var j=a.stateNode;if(c===null&&a.flags&4){c=j;var U=a.memoizedProps;switch(a.type){case"button":case"input":case"select":case"textarea":U.autoFocus&&c.focus();break;case"img":U.src&&(c.src=U.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(a.memoizedState===null){var Q=a.alternate;if(Q!==null){var ie=Q.memoizedState;if(ie!==null){var re=ie.dehydrated;re!==null&&vi(re)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(t(163))}rn||a.flags&512&&Fp(a)}catch(ne){ft(a,a.return,ne)}}if(a===s){de=null;break}if(c=a.sibling,c!==null){c.return=a.return,de=c;break}de=a.return}}function Nx(s){for(;de!==null;){var a=de;if(a===s){de=null;break}var c=a.sibling;if(c!==null){c.return=a.return,de=c;break}de=a.return}}function Rx(s){for(;de!==null;){var a=de;try{switch(a.tag){case 0:case 11:case 15:var c=a.return;try{Sh(4,a)}catch(U){ft(a,c,U)}break;case 1:var m=a.stateNode;if(typeof m.componentDidMount=="function"){var v=a.return;try{m.componentDidMount()}catch(U){ft(a,v,U)}}var _=a.return;try{Fp(a)}catch(U){ft(a,_,U)}break;case 5:var S=a.return;try{Fp(a)}catch(U){ft(a,S,U)}}}catch(U){ft(a,a.return,U)}if(a===s){de=null;break}var j=a.sibling;if(j!==null){j.return=a.return,de=j;break}de=a.return}}var uI=Math.ceil,Ch=L.ReactCurrentDispatcher,Bp=L.ReactCurrentOwner,ti=L.ReactCurrentBatchConfig,Be=0,Ft=null,Et=null,Kt=0,Fn=0,Oa=Jr(0),Nt=0,mc=null,go=0,Ih=0,qp=0,gc=null,Sn=null,$p=0,La=1/0,xr=null,kh=!1,Hp=null,rs=null,Ph=!1,ss=null,Ah=0,yc=0,Wp=null,Nh=-1,Rh=0;function yn(){return(Be&6)!==0?Je():Nh!==-1?Nh:Nh=Je()}function os(s){return(s.mode&1)===0?1:(Be&2)!==0&&Kt!==0?Kt&-Kt:GC.transition!==null?(Rh===0&&(Rh=io()),Rh):(s=Ve,s!==0||(s=window.event,s=s===void 0?16:Hl(s.type)),s)}function Si(s,a,c,m){if(50<yc)throw yc=0,Wp=null,Error(t(185));$r(s,c,m),((Be&2)===0||s!==Ft)&&(s===Ft&&((Be&2)===0&&(Ih|=c),Nt===4&&as(s,Kt)),Cn(s,m),c===1&&Be===0&&(a.mode&1)===0&&(La=Je()+500,oh&&es()))}function Cn(s,a){var c=s.callbackNode;ar(s,a);var m=no(s,s===Ft?Kt:0);if(m===0)c!==null&&Ul(c),s.callbackNode=null,s.callbackPriority=0;else if(a=m&-m,s.callbackPriority!==a){if(c!=null&&Ul(c),a===1)s.tag===0?WC(Dx.bind(null,s)):x0(Dx.bind(null,s)),BC(function(){(Be&6)===0&&es()}),c=null;else{switch(Wr(m)){case 1:c=eo;break;case 4:c=zr;break;case 16:c=Kn;break;case 536870912:c=Ru;break;default:c=Kn}c=Bx(c,jx.bind(null,s))}s.callbackPriority=a,s.callbackNode=c}}function jx(s,a){if(Nh=-1,Rh=0,(Be&6)!==0)throw Error(t(327));var c=s.callbackNode;if(Va()&&s.callbackNode!==c)return null;var m=no(s,s===Ft?Kt:0);if(m===0)return null;if((m&30)!==0||(m&s.expiredLanes)!==0||a)a=jh(s,m);else{a=m;var v=Be;Be|=2;var _=Ox();(Ft!==s||Kt!==a)&&(xr=null,La=Je()+500,vo(s,a));do try{fI();break}catch(j){Mx(s,j)}while(!0);up(),Ch.current=_,Be=v,Et!==null?a=0:(Ft=null,Kt=0,a=Nt)}if(a!==0){if(a===2&&(v=Dn(s),v!==0&&(m=v,a=Gp(s,v))),a===1)throw c=mc,vo(s,0),as(s,m),Cn(s,Je()),c;if(a===6)as(s,m);else{if(v=s.current.alternate,(m&30)===0&&!hI(v)&&(a=jh(s,m),a===2&&(_=Dn(s),_!==0&&(m=_,a=Gp(s,_))),a===1))throw c=mc,vo(s,0),as(s,m),Cn(s,Je()),c;switch(s.finishedWork=v,s.finishedLanes=m,a){case 0:case 1:throw Error(t(345));case 2:xo(s,Sn,xr);break;case 3:if(as(s,m),(m&130023424)===m&&(a=$p+500-Je(),10<a)){if(no(s,0)!==0)break;if(v=s.suspendedLanes,(v&m)!==m){yn(),s.pingedLanes|=s.suspendedLanes&v;break}s.timeoutHandle=Zf(xo.bind(null,s,Sn,xr),a);break}xo(s,Sn,xr);break;case 4:if(as(s,m),(m&4194240)===m)break;for(a=s.eventTimes,v=-1;0<m;){var S=31-pn(m);_=1<<S,S=a[S],S>v&&(v=S),m&=~_}if(m=v,m=Je()-m,m=(120>m?120:480>m?480:1080>m?1080:1920>m?1920:3e3>m?3e3:4320>m?4320:1960*uI(m/1960))-m,10<m){s.timeoutHandle=Zf(xo.bind(null,s,Sn,xr),m);break}xo(s,Sn,xr);break;case 5:xo(s,Sn,xr);break;default:throw Error(t(329))}}}return Cn(s,Je()),s.callbackNode===c?jx.bind(null,s):null}function Gp(s,a){var c=gc;return s.current.memoizedState.isDehydrated&&(vo(s,a).flags|=256),s=jh(s,a),s!==2&&(a=Sn,Sn=c,a!==null&&Kp(a)),s}function Kp(s){Sn===null?Sn=s:Sn.push.apply(Sn,s)}function hI(s){for(var a=s;;){if(a.flags&16384){var c=a.updateQueue;if(c!==null&&(c=c.stores,c!==null))for(var m=0;m<c.length;m++){var v=c[m],_=v.getSnapshot;v=v.value;try{if(!wi(_(),v))return!1}catch{return!1}}}if(c=a.child,a.subtreeFlags&16384&&c!==null)c.return=a,a=c;else{if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return!0;a=a.return}a.sibling.return=a.return,a=a.sibling}}return!0}function as(s,a){for(a&=~qp,a&=~Ih,s.suspendedLanes|=a,s.pingedLanes&=~a,s=s.expirationTimes;0<a;){var c=31-pn(a),m=1<<c;s[c]=-1,a&=~m}}function Dx(s){if((Be&6)!==0)throw Error(t(327));Va();var a=no(s,0);if((a&1)===0)return Cn(s,Je()),null;var c=jh(s,a);if(s.tag!==0&&c===2){var m=Dn(s);m!==0&&(a=m,c=Gp(s,m))}if(c===1)throw c=mc,vo(s,0),as(s,a),Cn(s,Je()),c;if(c===6)throw Error(t(345));return s.finishedWork=s.current.alternate,s.finishedLanes=a,xo(s,Sn,xr),Cn(s,Je()),null}function Qp(s,a){var c=Be;Be|=1;try{return s(a)}finally{Be=c,Be===0&&(La=Je()+500,oh&&es())}}function yo(s){ss!==null&&ss.tag===0&&(Be&6)===0&&Va();var a=Be;Be|=1;var c=ti.transition,m=Ve;try{if(ti.transition=null,Ve=1,s)return s()}finally{Ve=m,ti.transition=c,Be=a,(Be&6)===0&&es()}}function Yp(){Fn=Oa.current,nt(Oa)}function vo(s,a){s.finishedWork=null,s.finishedLanes=0;var c=s.timeoutHandle;if(c!==-1&&(s.timeoutHandle=-1,zC(c)),Et!==null)for(c=Et.return;c!==null;){var m=c;switch(sp(m),m.tag){case 1:m=m.type.childContextTypes,m!=null&&rh();break;case 3:ja(),nt(bn),nt(en),vp();break;case 5:gp(m);break;case 4:ja();break;case 13:nt(at);break;case 19:nt(at);break;case 10:hp(m.type._context);break;case 22:case 23:Yp()}c=c.return}if(Ft=s,Et=s=ls(s.current,null),Kt=Fn=a,Nt=0,mc=null,qp=Ih=go=0,Sn=gc=null,fo!==null){for(a=0;a<fo.length;a++)if(c=fo[a],m=c.interleaved,m!==null){c.interleaved=null;var v=m.next,_=c.pending;if(_!==null){var S=_.next;_.next=v,m.next=S}c.pending=m}fo=null}return s}function Mx(s,a){do{var c=Et;try{if(up(),gh.current=wh,yh){for(var m=lt.memoizedState;m!==null;){var v=m.queue;v!==null&&(v.pending=null),m=m.next}yh=!1}if(mo=0,Vt=At=lt=null,cc=!1,uc=0,Bp.current=null,c===null||c.return===null){Nt=1,mc=a,Et=null;break}e:{var _=s,S=c.return,j=c,U=a;if(a=Kt,j.flags|=32768,U!==null&&typeof U=="object"&&typeof U.then=="function"){var Q=U,ie=j,re=ie.tag;if((ie.mode&1)===0&&(re===0||re===11||re===15)){var ne=ie.alternate;ne?(ie.updateQueue=ne.updateQueue,ie.memoizedState=ne.memoizedState,ie.lanes=ne.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var ce=ox(S);if(ce!==null){ce.flags&=-257,ax(ce,S,j,_,a),ce.mode&1&&sx(_,Q,a),a=ce,U=Q;var fe=a.updateQueue;if(fe===null){var pe=new Set;pe.add(U),a.updateQueue=pe}else fe.add(U);break e}else{if((a&1)===0){sx(_,Q,a),Xp();break e}U=Error(t(426))}}else if(ot&&j.mode&1){var yt=ox(S);if(yt!==null){(yt.flags&65536)===0&&(yt.flags|=256),ax(yt,S,j,_,a),lp(Da(U,j));break e}}_=U=Da(U,j),Nt!==4&&(Nt=2),gc===null?gc=[_]:gc.push(_),_=S;do{switch(_.tag){case 3:_.flags|=65536,a&=-a,_.lanes|=a;var W=ix(_,U,a);A0(_,W);break e;case 1:j=U;var B=_.type,K=_.stateNode;if((_.flags&128)===0&&(typeof B.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(rs===null||!rs.has(K)))){_.flags|=65536,a&=-a,_.lanes|=a;var se=rx(_,j,a);A0(_,se);break e}}_=_.return}while(_!==null)}Vx(c)}catch(me){a=me,Et===c&&c!==null&&(Et=c=c.return);continue}break}while(!0)}function Ox(){var s=Ch.current;return Ch.current=wh,s===null?wh:s}function Xp(){(Nt===0||Nt===3||Nt===2)&&(Nt=4),Ft===null||(go&268435455)===0&&(Ih&268435455)===0||as(Ft,Kt)}function jh(s,a){var c=Be;Be|=2;var m=Ox();(Ft!==s||Kt!==a)&&(xr=null,vo(s,a));do try{dI();break}catch(v){Mx(s,v)}while(!0);if(up(),Be=c,Ch.current=m,Et!==null)throw Error(t(261));return Ft=null,Kt=0,Nt}function dI(){for(;Et!==null;)Lx(Et)}function fI(){for(;Et!==null&&!Au();)Lx(Et)}function Lx(s){var a=zx(s.alternate,s,Fn);s.memoizedProps=s.pendingProps,a===null?Vx(s):Et=a,Bp.current=null}function Vx(s){var a=s;do{var c=a.alternate;if(s=a.return,(a.flags&32768)===0){if(c=sI(c,a,Fn),c!==null){Et=c;return}}else{if(c=oI(c,a),c!==null){c.flags&=32767,Et=c;return}if(s!==null)s.flags|=32768,s.subtreeFlags=0,s.deletions=null;else{Nt=6,Et=null;return}}if(a=a.sibling,a!==null){Et=a;return}Et=a=s}while(a!==null);Nt===0&&(Nt=5)}function xo(s,a,c){var m=Ve,v=ti.transition;try{ti.transition=null,Ve=1,pI(s,a,c,m)}finally{ti.transition=v,Ve=m}return null}function pI(s,a,c,m){do Va();while(ss!==null);if((Be&6)!==0)throw Error(t(327));c=s.finishedWork;var v=s.finishedLanes;if(c===null)return null;if(s.finishedWork=null,s.finishedLanes=0,c===s.current)throw Error(t(177));s.callbackNode=null,s.callbackPriority=0;var _=c.lanes|c.childLanes;if(Ye(s,_),s===Ft&&(Et=Ft=null,Kt=0),(c.subtreeFlags&2064)===0&&(c.flags&2064)===0||Ph||(Ph=!0,Bx(Kn,function(){return Va(),null})),_=(c.flags&15990)!==0,(c.subtreeFlags&15990)!==0||_){_=ti.transition,ti.transition=null;var S=Ve;Ve=1;var j=Be;Be|=4,Bp.current=null,lI(s,c),kx(c,s),DC(Xf),Kr=!!Yf,Xf=Yf=null,s.current=c,cI(c),Df(),Be=j,Ve=S,ti.transition=_}else s.current=c;if(Ph&&(Ph=!1,ss=s,Ah=v),_=s.pendingLanes,_===0&&(rs=null),ju(c.stateNode),Cn(s,Je()),a!==null)for(m=s.onRecoverableError,c=0;c<a.length;c++)v=a[c],m(v.value,{componentStack:v.stack,digest:v.digest});if(kh)throw kh=!1,s=Hp,Hp=null,s;return(Ah&1)!==0&&s.tag!==0&&Va(),_=s.pendingLanes,(_&1)!==0?s===Wp?yc++:(yc=0,Wp=s):yc=0,es(),null}function Va(){if(ss!==null){var s=Wr(Ah),a=ti.transition,c=Ve;try{if(ti.transition=null,Ve=16>s?16:s,ss===null)var m=!1;else{if(s=ss,ss=null,Ah=0,(Be&6)!==0)throw Error(t(331));var v=Be;for(Be|=4,de=s.current;de!==null;){var _=de,S=_.child;if((de.flags&16)!==0){var j=_.deletions;if(j!==null){for(var U=0;U<j.length;U++){var Q=j[U];for(de=Q;de!==null;){var ie=de;switch(ie.tag){case 0:case 11:case 15:pc(8,ie,_)}var re=ie.child;if(re!==null)re.return=ie,de=re;else for(;de!==null;){ie=de;var ne=ie.sibling,ce=ie.return;if(Ex(ie),ie===Q){de=null;break}if(ne!==null){ne.return=ce,de=ne;break}de=ce}}}var fe=_.alternate;if(fe!==null){var pe=fe.child;if(pe!==null){fe.child=null;do{var yt=pe.sibling;pe.sibling=null,pe=yt}while(pe!==null)}}de=_}}if((_.subtreeFlags&2064)!==0&&S!==null)S.return=_,de=S;else e:for(;de!==null;){if(_=de,(_.flags&2048)!==0)switch(_.tag){case 0:case 11:case 15:pc(9,_,_.return)}var W=_.sibling;if(W!==null){W.return=_.return,de=W;break e}de=_.return}}var B=s.current;for(de=B;de!==null;){S=de;var K=S.child;if((S.subtreeFlags&2064)!==0&&K!==null)K.return=S,de=K;else e:for(S=B;de!==null;){if(j=de,(j.flags&2048)!==0)try{switch(j.tag){case 0:case 11:case 15:Sh(9,j)}}catch(me){ft(j,j.return,me)}if(j===S){de=null;break e}var se=j.sibling;if(se!==null){se.return=j.return,de=se;break e}de=j.return}}if(Be=v,es(),jn&&typeof jn.onPostCommitFiberRoot=="function")try{jn.onPostCommitFiberRoot(to,s)}catch{}m=!0}return m}finally{Ve=c,ti.transition=a}}return!1}function Fx(s,a,c){a=Da(c,a),a=ix(s,a,1),s=ns(s,a,1),a=yn(),s!==null&&($r(s,1,a),Cn(s,a))}function ft(s,a,c){if(s.tag===3)Fx(s,s,c);else for(;a!==null;){if(a.tag===3){Fx(a,s,c);break}else if(a.tag===1){var m=a.stateNode;if(typeof a.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(rs===null||!rs.has(m))){s=Da(c,s),s=rx(a,s,1),a=ns(a,s,1),s=yn(),a!==null&&($r(a,1,s),Cn(a,s));break}}a=a.return}}function mI(s,a,c){var m=s.pingCache;m!==null&&m.delete(a),a=yn(),s.pingedLanes|=s.suspendedLanes&c,Ft===s&&(Kt&c)===c&&(Nt===4||Nt===3&&(Kt&130023424)===Kt&&500>Je()-$p?vo(s,0):qp|=c),Cn(s,a)}function Ux(s,a){a===0&&((s.mode&1)===0?a=1:(a=aa,aa<<=1,(aa&130023424)===0&&(aa=4194304)));var c=yn();s=gr(s,a),s!==null&&($r(s,a,c),Cn(s,c))}function gI(s){var a=s.memoizedState,c=0;a!==null&&(c=a.retryLane),Ux(s,c)}function yI(s,a){var c=0;switch(s.tag){case 13:var m=s.stateNode,v=s.memoizedState;v!==null&&(c=v.retryLane);break;case 19:m=s.stateNode;break;default:throw Error(t(314))}m!==null&&m.delete(a),Ux(s,c)}var zx;zx=function(s,a,c){if(s!==null)if(s.memoizedProps!==a.pendingProps||bn.current)Tn=!0;else{if((s.lanes&c)===0&&(a.flags&128)===0)return Tn=!1,rI(s,a,c);Tn=(s.flags&131072)!==0}else Tn=!1,ot&&(a.flags&1048576)!==0&&w0(a,lh,a.index);switch(a.lanes=0,a.tag){case 2:var m=a.type;Eh(s,a),s=a.pendingProps;var v=Ca(a,en.current);Ra(a,c),v=_p(null,a,m,s,v,c);var _=bp();return a.flags|=1,typeof v=="object"&&v!==null&&typeof v.render=="function"&&v.$$typeof===void 0?(a.tag=1,a.memoizedState=null,a.updateQueue=null,En(m)?(_=!0,sh(a)):_=!1,a.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,pp(a),v.updater=_h,a.stateNode=v,v._reactInternals=a,kp(a,m,s,c),a=Rp(null,a,m,!0,_,c)):(a.tag=0,ot&&_&&rp(a),gn(null,a,v,c),a=a.child),a;case 16:m=a.elementType;e:{switch(Eh(s,a),s=a.pendingProps,v=m._init,m=v(m._payload),a.type=m,v=a.tag=xI(m),s=bi(m,s),v){case 0:a=Np(null,a,m,s,c);break e;case 1:a=fx(null,a,m,s,c);break e;case 11:a=lx(null,a,m,s,c);break e;case 14:a=cx(null,a,m,bi(m.type,s),c);break e}throw Error(t(306,m,""))}return a;case 0:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:bi(m,v),Np(s,a,m,v,c);case 1:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:bi(m,v),fx(s,a,m,v,c);case 3:e:{if(px(a),s===null)throw Error(t(387));m=a.pendingProps,_=a.memoizedState,v=_.element,P0(s,a),ph(a,m,null,c);var S=a.memoizedState;if(m=S.element,_.isDehydrated)if(_={element:m,isDehydrated:!1,cache:S.cache,pendingSuspenseBoundaries:S.pendingSuspenseBoundaries,transitions:S.transitions},a.updateQueue.baseState=_,a.memoizedState=_,a.flags&256){v=Da(Error(t(423)),a),a=mx(s,a,m,c,v);break e}else if(m!==v){v=Da(Error(t(424)),a),a=mx(s,a,m,c,v);break e}else for(Vn=Xr(a.stateNode.containerInfo.firstChild),Ln=a,ot=!0,_i=null,c=I0(a,null,m,c),a.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{if(Pa(),m===v){a=vr(s,a,c);break e}gn(s,a,m,c)}a=a.child}return a;case 5:return R0(a),s===null&&ap(a),m=a.type,v=a.pendingProps,_=s!==null?s.memoizedProps:null,S=v.children,Jf(m,v)?S=null:_!==null&&Jf(m,_)&&(a.flags|=32),dx(s,a),gn(s,a,S,c),a.child;case 6:return s===null&&ap(a),null;case 13:return gx(s,a,c);case 4:return mp(a,a.stateNode.containerInfo),m=a.pendingProps,s===null?a.child=Aa(a,null,m,c):gn(s,a,m,c),a.child;case 11:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:bi(m,v),lx(s,a,m,v,c);case 7:return gn(s,a,a.pendingProps,c),a.child;case 8:return gn(s,a,a.pendingProps.children,c),a.child;case 12:return gn(s,a,a.pendingProps.children,c),a.child;case 10:e:{if(m=a.type._context,v=a.pendingProps,_=a.memoizedProps,S=v.value,Ze(hh,m._currentValue),m._currentValue=S,_!==null)if(wi(_.value,S)){if(_.children===v.children&&!bn.current){a=vr(s,a,c);break e}}else for(_=a.child,_!==null&&(_.return=a);_!==null;){var j=_.dependencies;if(j!==null){S=_.child;for(var U=j.firstContext;U!==null;){if(U.context===m){if(_.tag===1){U=yr(-1,c&-c),U.tag=2;var Q=_.updateQueue;if(Q!==null){Q=Q.shared;var ie=Q.pending;ie===null?U.next=U:(U.next=ie.next,ie.next=U),Q.pending=U}}_.lanes|=c,U=_.alternate,U!==null&&(U.lanes|=c),dp(_.return,c,a),j.lanes|=c;break}U=U.next}}else if(_.tag===10)S=_.type===a.type?null:_.child;else if(_.tag===18){if(S=_.return,S===null)throw Error(t(341));S.lanes|=c,j=S.alternate,j!==null&&(j.lanes|=c),dp(S,c,a),S=_.sibling}else S=_.child;if(S!==null)S.return=_;else for(S=_;S!==null;){if(S===a){S=null;break}if(_=S.sibling,_!==null){_.return=S.return,S=_;break}S=S.return}_=S}gn(s,a,v.children,c),a=a.child}return a;case 9:return v=a.type,m=a.pendingProps.children,Ra(a,c),v=Zn(v),m=m(v),a.flags|=1,gn(s,a,m,c),a.child;case 14:return m=a.type,v=bi(m,a.pendingProps),v=bi(m.type,v),cx(s,a,m,v,c);case 15:return ux(s,a,a.type,a.pendingProps,c);case 17:return m=a.type,v=a.pendingProps,v=a.elementType===m?v:bi(m,v),Eh(s,a),a.tag=1,En(m)?(s=!0,sh(a)):s=!1,Ra(a,c),tx(a,m,v),kp(a,m,v,c),Rp(null,a,m,!0,s,c);case 19:return vx(s,a,c);case 22:return hx(s,a,c)}throw Error(t(156,a.tag))};function Bx(s,a){return sa(s,a)}function vI(s,a,c,m){this.tag=s,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=a,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 ni(s,a,c,m){return new vI(s,a,c,m)}function Jp(s){return s=s.prototype,!(!s||!s.isReactComponent)}function xI(s){if(typeof s=="function")return Jp(s)?1:0;if(s!=null){if(s=s.$$typeof,s===q)return 11;if(s===mt)return 14}return 2}function ls(s,a){var c=s.alternate;return c===null?(c=ni(s.tag,a,s.key,s.mode),c.elementType=s.elementType,c.type=s.type,c.stateNode=s.stateNode,c.alternate=s,s.alternate=c):(c.pendingProps=a,c.type=s.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=s.flags&14680064,c.childLanes=s.childLanes,c.lanes=s.lanes,c.child=s.child,c.memoizedProps=s.memoizedProps,c.memoizedState=s.memoizedState,c.updateQueue=s.updateQueue,a=s.dependencies,c.dependencies=a===null?null:{lanes:a.lanes,firstContext:a.firstContext},c.sibling=s.sibling,c.index=s.index,c.ref=s.ref,c}function Dh(s,a,c,m,v,_){var S=2;if(m=s,typeof s=="function")Jp(s)&&(S=1);else if(typeof s=="string")S=5;else e:switch(s){case k:return wo(c.children,v,_,a);case P:S=8,v|=8;break;case R:return s=ni(12,c,a,v|2),s.elementType=R,s.lanes=_,s;case M:return s=ni(13,c,a,v),s.elementType=M,s.lanes=_,s;case qe:return s=ni(19,c,a,v),s.elementType=qe,s.lanes=_,s;case ke:return Mh(c,v,_,a);default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case F:S=10;break e;case z:S=9;break e;case q:S=11;break e;case mt:S=14;break e;case $t:S=16,m=null;break e}throw Error(t(130,s==null?s:typeof s,""))}return a=ni(S,c,a,v),a.elementType=s,a.type=m,a.lanes=_,a}function wo(s,a,c,m){return s=ni(7,s,m,a),s.lanes=c,s}function Mh(s,a,c,m){return s=ni(22,s,m,a),s.elementType=ke,s.lanes=c,s.stateNode={isHidden:!1},s}function Zp(s,a,c){return s=ni(6,s,null,a),s.lanes=c,s}function em(s,a,c){return a=ni(4,s.children!==null?s.children:[],s.key,a),a.lanes=c,a.stateNode={containerInfo:s.containerInfo,pendingChildren:null,implementation:s.implementation},a}function wI(s,a,c,m,v){this.tag=a,this.containerInfo=s,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=qr(0),this.expirationTimes=qr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=qr(0),this.identifierPrefix=m,this.onRecoverableError=v,this.mutableSourceEagerHydrationData=null}function tm(s,a,c,m,v,_,S,j,U){return s=new wI(s,a,c,j,U),a===1?(a=1,_===!0&&(a|=8)):a=0,_=ni(3,null,null,a),s.current=_,_.stateNode=s,_.memoizedState={element:m,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null},pp(_),s}function _I(s,a,c){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:X,key:m==null?null:""+m,children:s,containerInfo:a,implementation:c}}function qx(s){if(!s)return Zr;s=s._reactInternals;e:{if(fi(s)!==s||s.tag!==1)throw Error(t(170));var a=s;do{switch(a.tag){case 3:a=a.stateNode.context;break e;case 1:if(En(a.type)){a=a.stateNode.__reactInternalMemoizedMergedChildContext;break e}}a=a.return}while(a!==null);throw Error(t(171))}if(s.tag===1){var c=s.type;if(En(c))return y0(s,c,a)}return a}function $x(s,a,c,m,v,_,S,j,U){return s=tm(c,m,!0,s,v,_,S,j,U),s.context=qx(null),c=s.current,m=yn(),v=os(c),_=yr(m,v),_.callback=a??null,ns(c,_,v),s.current.lanes=v,$r(s,v,m),Cn(s,m),s}function Oh(s,a,c,m){var v=a.current,_=yn(),S=os(v);return c=qx(c),a.context===null?a.context=c:a.pendingContext=c,a=yr(_,S),a.payload={element:s},m=m===void 0?null:m,m!==null&&(a.callback=m),s=ns(v,a,S),s!==null&&(Si(s,v,S,_),fh(s,v,S)),S}function Lh(s){if(s=s.current,!s.child)return null;switch(s.child.tag){case 5:return s.child.stateNode;default:return s.child.stateNode}}function Hx(s,a){if(s=s.memoizedState,s!==null&&s.dehydrated!==null){var c=s.retryLane;s.retryLane=c!==0&&c<a?c:a}}function nm(s,a){Hx(s,a),(s=s.alternate)&&Hx(s,a)}function bI(){return null}var Wx=typeof reportError=="function"?reportError:function(s){console.error(s)};function im(s){this._internalRoot=s}Vh.prototype.render=im.prototype.render=function(s){var a=this._internalRoot;if(a===null)throw Error(t(409));Oh(s,a,null,null)},Vh.prototype.unmount=im.prototype.unmount=function(){var s=this._internalRoot;if(s!==null){this._internalRoot=null;var a=s.containerInfo;yo(function(){Oh(null,s,null,null)}),a[dr]=null}};function Vh(s){this._internalRoot=s}Vh.prototype.unstable_scheduleHydration=function(s){if(s){var a=Vu();s={blockedOn:null,target:s,priority:a};for(var c=0;c<Li.length&&a!==0&&a<Li[c].priority;c++);Li.splice(c,0,s),c===0&&zu(s)}};function rm(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11)}function Fh(s){return!(!s||s.nodeType!==1&&s.nodeType!==9&&s.nodeType!==11&&(s.nodeType!==8||s.nodeValue!==" react-mount-point-unstable "))}function Gx(){}function EI(s,a,c,m,v){if(v){if(typeof m=="function"){var _=m;m=function(){var Q=Lh(S);_.call(Q)}}var S=$x(a,m,s,0,null,!1,!1,"",Gx);return s._reactRootContainer=S,s[dr]=S.current,tc(s.nodeType===8?s.parentNode:s),yo(),S}for(;v=s.lastChild;)s.removeChild(v);if(typeof m=="function"){var j=m;m=function(){var Q=Lh(U);j.call(Q)}}var U=tm(s,0,!1,null,null,!1,!1,"",Gx);return s._reactRootContainer=U,s[dr]=U.current,tc(s.nodeType===8?s.parentNode:s),yo(function(){Oh(a,U,c,m)}),U}function Uh(s,a,c,m,v){var _=c._reactRootContainer;if(_){var S=_;if(typeof v=="function"){var j=v;v=function(){var U=Lh(S);j.call(U)}}Oh(a,S,s,v)}else S=EI(c,a,s,v,m);return Lh(S)}Ou=function(s){switch(s.tag){case 3:var a=s.stateNode;if(a.current.memoizedState.isDehydrated){var c=Br(a.pendingLanes);c!==0&&(Hr(a,c|1),Cn(a,Je()),(Be&6)===0&&(La=Je()+500,es()))}break;case 13:yo(function(){var m=gr(s,1);if(m!==null){var v=yn();Si(m,s,1,v)}}),nm(s,1)}},la=function(s){if(s.tag===13){var a=gr(s,134217728);if(a!==null){var c=yn();Si(a,s,134217728,c)}nm(s,134217728)}},Lu=function(s){if(s.tag===13){var a=os(s),c=gr(s,a);if(c!==null){var m=yn();Si(c,s,a,m)}nm(s,a)}},Vu=function(){return Ve},Fu=function(s,a){var c=Ve;try{return Ve=s,a()}finally{Ve=c}},Zo=function(s,a,c){switch(a){case"input":if(Cl(s,c),a=c.name,c.type==="radio"&&a!=null){for(c=s;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll("input[name="+JSON.stringify(""+a)+'][type="radio"]'),a=0;a<c.length;a++){var m=c[a];if(m!==s&&m.form===s.form){var v=ih(m);if(!v)throw Error(t(90));Go(m),Cl(m,v)}}}break;case"textarea":Xo(s,c);break;case"select":a=c.value,a!=null&&rr(s,!!c.multiple,a,!1)}},Ys=Qp,Ol=yo;var TI={usingClientEntryPoint:!1,Events:[rc,Ta,ih,Mi,Ml,Qp]},vc={findFiberByHostInstance:lo,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},SI={bundleType:vc.bundleType,version:vc.version,rendererPackageName:vc.rendererPackageName,rendererConfig:vc.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:L.ReactCurrentDispatcher,findHostInstanceByFiber:function(s){return s=Fl(s),s===null?null:s.stateNode},findFiberByHostInstance:vc.findFiberByHostInstance||bI,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 zh=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zh.isDisabled&&zh.supportsFiber)try{to=zh.inject(SI),jn=zh}catch{}}return In.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=TI,In.createPortal=function(s,a){var c=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!rm(a))throw Error(t(200));return _I(s,a,null,c)},In.createRoot=function(s,a){if(!rm(s))throw Error(t(299));var c=!1,m="",v=Wx;return a!=null&&(a.unstable_strictMode===!0&&(c=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(v=a.onRecoverableError)),a=tm(s,1,!1,null,null,c,!1,m,v),s[dr]=a.current,tc(s.nodeType===8?s.parentNode:s),new im(a)},In.findDOMNode=function(s){if(s==null)return null;if(s.nodeType===1)return s;var a=s._reactInternals;if(a===void 0)throw typeof s.render=="function"?Error(t(188)):(s=Object.keys(s).join(","),Error(t(268,s)));return s=Fl(a),s=s===null?null:s.stateNode,s},In.flushSync=function(s){return yo(s)},In.hydrate=function(s,a,c){if(!Fh(a))throw Error(t(200));return Uh(null,s,a,!0,c)},In.hydrateRoot=function(s,a,c){if(!rm(s))throw Error(t(405));var m=c!=null&&c.hydratedSources||null,v=!1,_="",S=Wx;if(c!=null&&(c.unstable_strictMode===!0&&(v=!0),c.identifierPrefix!==void 0&&(_=c.identifierPrefix),c.onRecoverableError!==void 0&&(S=c.onRecoverableError)),a=$x(a,null,s,1,c??null,v,!1,_,S),s[dr]=a.current,tc(s),m)for(s=0;s<m.length;s++)c=m[s],v=c._getVersion,v=v(c._source),a.mutableSourceEagerHydrationData==null?a.mutableSourceEagerHydrationData=[c,v]:a.mutableSourceEagerHydrationData.push(c,v);return new Vh(a)},In.render=function(s,a,c){if(!Fh(a))throw Error(t(200));return Uh(null,s,a,!1,c)},In.unmountComponentAtNode=function(s){if(!Fh(s))throw Error(t(40));return s._reactRootContainer?(yo(function(){Uh(null,null,s,!1,function(){s._reactRootContainer=null,s[dr]=null})}),!0):!1},In.unstable_batchedUpdates=Qp,In.unstable_renderSubtreeIntoContainer=function(s,a,c,m){if(!Fh(c))throw Error(t(200));if(s==null||s._reactInternals===void 0)throw Error(t(38));return Uh(s,a,c,!1,m)},In.version="18.3.1-next-f1338f8080-20240426",In}var tw;function A1(){if(tw)return am.exports;tw=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),am.exports=MI(),am.exports}var nw;function OI(){if(nw)return Bh;nw=1;var n=A1();return Bh.createRoot=n.createRoot,Bh.hydrateRoot=n.hydrateRoot,Bh}var LI=OI();A1();/** * @remix-run/router v1.21.1 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function qc(){return qc=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},qc.apply(this,arguments)}var ms;(function(n){n.Pop="POP",n.Push="PUSH",n.Replace="REPLACE"})(ms||(ms={}));const iw="popstate";function VI(n){n===void 0&&(n={});function e(r,o){let{pathname:l="/",search:u="",hash:h=""}=Fo(r.location.hash.substr(1));return!l.startsWith("/")&&!l.startsWith(".")&&(l="/"+l),Jm("",{pathname:l,search:u,hash:h},o.state&&o.state.usr||null,o.state&&o.state.key||"default")}function t(r,o){let l=r.document.querySelector("base"),u="";if(l&&l.getAttribute("href")){let h=r.location.href,p=h.indexOf("#");u=p===-1?h:h.slice(0,p)}return u+"#"+(typeof o=="string"?o:gd(o))}function i(r,o){Xg(r.pathname.charAt(0)==="/","relative pathnames are not supported in hash history.push("+JSON.stringify(o)+")")}return UI(e,t,i,n)}function _t(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function Xg(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function FI(){return Math.random().toString(36).substr(2,8)}function rw(n,e){return{usr:n.state,key:n.key,idx:e}}function Jm(n,e,t,i){return t===void 0&&(t=null),qc({pathname:typeof n=="string"?n:n.pathname,search:"",hash:""},typeof e=="string"?Fo(e):e,{state:t,key:e&&e.key||i||FI()})}function gd(n){let{pathname:e="/",search:t="",hash:i=""}=n;return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),i&&i!=="#"&&(e+=i.charAt(0)==="#"?i:"#"+i),e}function Fo(n){let e={};if(n){let t=n.indexOf("#");t>=0&&(e.hash=n.substr(t),n=n.substr(0,t));let i=n.indexOf("?");i>=0&&(e.search=n.substr(i),n=n.substr(0,i)),n&&(e.pathname=n)}return e}function UI(n,e,t,i){i===void 0&&(i={});let{window:r=document.defaultView,v5Compat:o=!1}=i,l=r.history,u=ms.Pop,h=null,p=g();p==null&&(p=0,l.replaceState(qc({},l.state,{idx:p}),""));function g(){return(l.state||{idx:null}).idx}function y(){u=ms.Pop;let I=g(),N=I==null?null:I-p;p=I,h&&h({action:u,location:C.location,delta:N})}function x(I,N){u=ms.Push;let D=Jm(C.location,I,N);t&&t(D,I),p=g()+1;let O=rw(D,p),L=C.createHref(D);try{l.pushState(O,"",L)}catch(G){if(G instanceof DOMException&&G.name==="DataCloneError")throw G;r.location.assign(L)}o&&h&&h({action:u,location:C.location,delta:1})}function b(I,N){u=ms.Replace;let D=Jm(C.location,I,N);t&&t(D,I),p=g();let O=rw(D,p),L=C.createHref(D);l.replaceState(O,"",L),o&&h&&h({action:u,location:C.location,delta:0})}function T(I){let N=r.location.origin!=="null"?r.location.origin:r.location.href,D=typeof I=="string"?I:gd(I);return D=D.replace(/ $/,"%20"),_t(N,"No window.location.(origin|href) available to create URL for href: "+D),new URL(D,N)}let C={get action(){return u},get location(){return n(r,l)},listen(I){if(h)throw new Error("A history only accepts one active listener");return r.addEventListener(iw,y),h=I,()=>{r.removeEventListener(iw,y),h=null}},createHref(I){return e(r,I)},createURL:T,encodeLocation(I){let N=T(I);return{pathname:N.pathname,search:N.search,hash:N.hash}},push:x,replace:b,go(I){return l.go(I)}};return C}var sw;(function(n){n.data="data",n.deferred="deferred",n.redirect="redirect",n.error="error"})(sw||(sw={}));function zI(n,e,t){return t===void 0&&(t="/"),BI(n,e,t)}function BI(n,e,t,i){let r=typeof e=="string"?Fo(e):e,o=Jg(r.pathname||"/",t);if(o==null)return null;let l=N1(n);qI(l);let u=null;for(let h=0;u==null&&h<l.length;++h){let p=tk(o);u=JI(l[h],p)}return u}function N1(n,e,t,i){e===void 0&&(e=[]),t===void 0&&(t=[]),i===void 0&&(i="");let r=(o,l,u)=>{let h={relativePath:u===void 0?o.path||"":u,caseSensitive:o.caseSensitive===!0,childrenIndex:l,route:o};h.relativePath.startsWith("/")&&(_t(h.relativePath.startsWith(i),'Absolute route path "'+h.relativePath+'" nested under path '+('"'+i+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),h.relativePath=h.relativePath.slice(i.length));let p=vs([i,h.relativePath]),g=t.concat(h);o.children&&o.children.length>0&&(_t(o.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+p+'".')),N1(o.children,e,g,p)),!(o.path==null&&!o.index)&&e.push({path:p,score:YI(p,o.index),routesMeta:g})};return n.forEach((o,l)=>{var u;if(o.path===""||!((u=o.path)!=null&&u.includes("?")))r(o,l);else for(let h of R1(o.path))r(o,l,h)}),e}function R1(n){let e=n.split("/");if(e.length===0)return[];let[t,...i]=e,r=t.endsWith("?"),o=t.replace(/\?$/,"");if(i.length===0)return r?[o,""]:[o];let l=R1(i.join("/")),u=[];return u.push(...l.map(h=>h===""?o:[o,h].join("/"))),r&&u.push(...l),u.map(h=>n.startsWith("/")&&h===""?"/":h)}function qI(n){n.sort((e,t)=>e.score!==t.score?t.score-e.score:XI(e.routesMeta.map(i=>i.childrenIndex),t.routesMeta.map(i=>i.childrenIndex)))}const $I=/^:[\w-]+$/,HI=3,WI=2,GI=1,KI=10,QI=-2,ow=n=>n==="*";function YI(n,e){let t=n.split("/"),i=t.length;return t.some(ow)&&(i+=QI),e&&(i+=WI),t.filter(r=>!ow(r)).reduce((r,o)=>r+($I.test(o)?HI:o===""?GI:KI),i)}function XI(n,e){return n.length===e.length&&n.slice(0,-1).every((i,r)=>i===e[r])?n[n.length-1]-e[e.length-1]:0}function JI(n,e,t){let{routesMeta:i}=n,r={},o="/",l=[];for(let u=0;u<i.length;++u){let h=i[u],p=u===i.length-1,g=o==="/"?e:e.slice(o.length)||"/",y=ZI({path:h.relativePath,caseSensitive:h.caseSensitive,end:p},g),x=h.route;if(!y)return null;Object.assign(r,y.params),l.push({params:r,pathname:vs([o,y.pathname]),pathnameBase:sk(vs([o,y.pathnameBase])),route:x}),y.pathnameBase!=="/"&&(o=vs([o,y.pathnameBase]))}return l}function ZI(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[t,i]=ek(n.path,n.caseSensitive,n.end),r=e.match(t);if(!r)return null;let o=r[0],l=o.replace(/(.)\/+$/,"$1"),u=r.slice(1);return{params:i.reduce((p,g,y)=>{let{paramName:x,isOptional:b}=g;if(x==="*"){let C=u[y]||"";l=o.slice(0,o.length-C.length).replace(/(.)\/+$/,"$1")}const T=u[y];return b&&!T?p[x]=void 0:p[x]=(T||"").replace(/%2F/g,"/"),p},{}),pathname:o,pathnameBase:l,pattern:n}}function ek(n,e,t){e===void 0&&(e=!1),t===void 0&&(t=!0),Xg(n==="*"||!n.endsWith("*")||n.endsWith("/*"),'Route path "'+n+'" will be treated as if it were '+('"'+n.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+n.replace(/\*$/,"/*")+'".'));let i=[],r="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,u,h)=>(i.push({paramName:u,isOptional:h!=null}),h?"/?([^\\/]+)?":"/([^\\/]+)"));return n.endsWith("*")?(i.push({paramName:"*"}),r+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):t?r+="\\/*$":n!==""&&n!=="/"&&(r+="(?:(?=\\/|$))"),[new RegExp(r,e?void 0:"i"),i]}function tk(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return Xg(!1,'The URL path "'+n+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),n}}function Jg(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let t=e.endsWith("/")?e.length-1:e.length,i=n.charAt(t);return i&&i!=="/"?null:n.slice(t)||"/"}function nk(n,e){e===void 0&&(e="/");let{pathname:t,search:i="",hash:r=""}=typeof n=="string"?Fo(n):n;return{pathname:t?t.startsWith("/")?t:ik(t,e):e,search:ok(i),hash:ak(r)}}function ik(n,e){let t=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(r=>{r===".."?t.length>1&&t.pop():r!=="."&&t.push(r)}),t.length>1?t.join("/"):"/"}function um(n,e,t,i){return"Cannot include a '"+n+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(i)+"]. Please separate it out to the ")+("`to."+t+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function rk(n){return n.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Zg(n,e){let t=rk(n);return e?t.map((i,r)=>r===t.length-1?i.pathname:i.pathnameBase):t.map(i=>i.pathnameBase)}function ey(n,e,t,i){i===void 0&&(i=!1);let r;typeof n=="string"?r=Fo(n):(r=qc({},n),_t(!r.pathname||!r.pathname.includes("?"),um("?","pathname","search",r)),_t(!r.pathname||!r.pathname.includes("#"),um("#","pathname","hash",r)),_t(!r.search||!r.search.includes("#"),um("#","search","hash",r)));let o=n===""||r.pathname==="",l=o?"/":r.pathname,u;if(l==null)u=t;else{let y=e.length-1;if(!i&&l.startsWith("..")){let x=l.split("/");for(;x[0]==="..";)x.shift(),y-=1;r.pathname=x.join("/")}u=y>=0?e[y]:"/"}let h=nk(r,u),p=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&t.endsWith("/");return!h.pathname.endsWith("/")&&(p||g)&&(h.pathname+="/"),h}const vs=n=>n.join("/").replace(/\/\/+/g,"/"),sk=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),ok=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,ak=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function lk(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}const j1=["post","put","patch","delete"];new Set(j1);const ck=["get",...j1];new Set(ck);/** * React Router v6.28.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function $c(){return $c=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},$c.apply(this,arguments)}const ty=V.createContext(null),uk=V.createContext(null),Os=V.createContext(null),Qd=V.createContext(null),Ls=V.createContext({outlet:null,matches:[],isDataRoute:!1}),D1=V.createContext(null);function hk(n,e){let{relative:t}=e===void 0?{}:e;ml()||_t(!1);let{basename:i,navigator:r}=V.useContext(Os),{hash:o,pathname:l,search:u}=O1(n,{relative:t}),h=l;return i!=="/"&&(h=l==="/"?i:vs([i,l])),r.createHref({pathname:h,search:u,hash:o})}function ml(){return V.useContext(Qd)!=null}function Uo(){return ml()||_t(!1),V.useContext(Qd).location}function M1(n){V.useContext(Os).static||V.useLayoutEffect(n)}function Wn(){let{isDataRoute:n}=V.useContext(Ls);return n?Tk():dk()}function dk(){ml()||_t(!1);let n=V.useContext(ty),{basename:e,future:t,navigator:i}=V.useContext(Os),{matches:r}=V.useContext(Ls),{pathname:o}=Uo(),l=JSON.stringify(Zg(r,t.v7_relativeSplatPath)),u=V.useRef(!1);return M1(()=>{u.current=!0}),V.useCallback(function(p,g){if(g===void 0&&(g={}),!u.current)return;if(typeof p=="number"){i.go(p);return}let y=ey(p,JSON.parse(l),o,g.relative==="path");n==null&&e!=="/"&&(y.pathname=y.pathname==="/"?e:vs([e,y.pathname])),(g.replace?i.replace:i.push)(y,g.state,g)},[e,i,l,o,n])}function O1(n,e){let{relative:t}=e===void 0?{}:e,{future:i}=V.useContext(Os),{matches:r}=V.useContext(Ls),{pathname:o}=Uo(),l=JSON.stringify(Zg(r,i.v7_relativeSplatPath));return V.useMemo(()=>ey(n,JSON.parse(l),o,t==="path"),[n,l,o,t])}function fk(n,e){return pk(n,e)}function pk(n,e,t,i){ml()||_t(!1);let{navigator:r}=V.useContext(Os),{matches:o}=V.useContext(Ls),l=o[o.length-1],u=l?l.params:{};l&&l.pathname;let h=l?l.pathnameBase:"/";l&&l.route;let p=Uo(),g;if(e){var y;let I=typeof e=="string"?Fo(e):e;h==="/"||(y=I.pathname)!=null&&y.startsWith(h)||_t(!1),g=I}else g=p;let x=g.pathname||"/",b=x;if(h!=="/"){let I=h.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(I.length).join("/")}let T=zI(n,{pathname:b}),C=xk(T&&T.map(I=>Object.assign({},I,{params:Object.assign({},u,I.params),pathname:vs([h,r.encodeLocation?r.encodeLocation(I.pathname).pathname:I.pathname]),pathnameBase:I.pathnameBase==="/"?h:vs([h,r.encodeLocation?r.encodeLocation(I.pathnameBase).pathname:I.pathnameBase])})),o,t,i);return e&&C?V.createElement(Qd.Provider,{value:{location:$c({pathname:"/",search:"",hash:"",state:null,key:"default"},g),navigationType:ms.Pop}},C):C}function mk(){let n=Ek(),e=lk(n)?n.status+" "+n.statusText:n instanceof Error?n.message:JSON.stringify(n),t=n instanceof Error?n.stack:null,r={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return V.createElement(V.Fragment,null,V.createElement("h2",null,"Unexpected Application Error!"),V.createElement("h3",{style:{fontStyle:"italic"}},e),t?V.createElement("pre",{style:r},t):null,null)}const gk=V.createElement(mk,null);class yk extends V.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){console.error("React Router caught the following error during render",e,t)}render(){return this.state.error!==void 0?V.createElement(Ls.Provider,{value:this.props.routeContext},V.createElement(D1.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function vk(n){let{routeContext:e,match:t,children:i}=n,r=V.useContext(ty);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),V.createElement(Ls.Provider,{value:e},i)}function xk(n,e,t,i){var r;if(e===void 0&&(e=[]),t===void 0&&(t=null),i===void 0&&(i=null),n==null){var o;if(!t)return null;if(t.errors)n=t.matches;else if((o=i)!=null&&o.v7_partialHydration&&e.length===0&&!t.initialized&&t.matches.length>0)n=t.matches;else return null}let l=n,u=(r=t)==null?void 0:r.errors;if(u!=null){let g=l.findIndex(y=>y.route.id&&(u==null?void 0:u[y.route.id])!==void 0);g>=0||_t(!1),l=l.slice(0,Math.min(l.length,g+1))}let h=!1,p=-1;if(t&&i&&i.v7_partialHydration)for(let g=0;g<l.length;g++){let y=l[g];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(p=g),y.route.id){let{loaderData:x,errors:b}=t,T=y.route.loader&&x[y.route.id]===void 0&&(!b||b[y.route.id]===void 0);if(y.route.lazy||T){h=!0,p>=0?l=l.slice(0,p+1):l=[l[0]];break}}}return l.reduceRight((g,y,x)=>{let b,T=!1,C=null,I=null;t&&(b=u&&y.route.id?u[y.route.id]:void 0,C=y.route.errorElement||gk,h&&(p<0&&x===0?(Sk("route-fallback"),T=!0,I=null):p===x&&(T=!0,I=y.route.hydrateFallbackElement||null)));let N=e.concat(l.slice(0,x+1)),D=()=>{let O;return b?O=C:T?O=I:y.route.Component?O=V.createElement(y.route.Component,null):y.route.element?O=y.route.element:O=g,V.createElement(vk,{match:y,routeContext:{outlet:g,matches:N,isDataRoute:t!=null},children:O})};return t&&(y.route.ErrorBoundary||y.route.errorElement||x===0)?V.createElement(yk,{location:t.location,revalidation:t.revalidation,component:C,error:b,children:D(),routeContext:{outlet:null,matches:N,isDataRoute:!0}}):D()},null)}var L1=function(n){return n.UseBlocker="useBlocker",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n}(L1||{}),V1=function(n){return n.UseBlocker="useBlocker",n.UseLoaderData="useLoaderData",n.UseActionData="useActionData",n.UseRouteError="useRouteError",n.UseNavigation="useNavigation",n.UseRouteLoaderData="useRouteLoaderData",n.UseMatches="useMatches",n.UseRevalidator="useRevalidator",n.UseNavigateStable="useNavigate",n.UseRouteId="useRouteId",n}(V1||{});function wk(n){let e=V.useContext(ty);return e||_t(!1),e}function _k(n){let e=V.useContext(uk);return e||_t(!1),e}function bk(n){let e=V.useContext(Ls);return e||_t(!1),e}function F1(n){let e=bk(),t=e.matches[e.matches.length-1];return t.route.id||_t(!1),t.route.id}function Ek(){var n;let e=V.useContext(D1),t=_k(),i=F1();return e!==void 0?e:(n=t.errors)==null?void 0:n[i]}function Tk(){let{router:n}=wk(L1.UseNavigateStable),e=F1(V1.UseNavigateStable),t=V.useRef(!1);return M1(()=>{t.current=!0}),V.useCallback(function(r,o){o===void 0&&(o={}),t.current&&(typeof r=="number"?n.navigate(r):n.navigate(r,$c({fromRouteId:e},o)))},[n,e])}const aw={};function Sk(n,e,t){aw[n]||(aw[n]=!0)}const lw={};function Ck(n,e){lw[e]||(lw[e]=!0,console.warn(e))}const cw=(n,e,t)=>Ck(n,"⚠️ React Router Future Flag Warning: "+e+". "+("You can use the `"+n+"` future flag to opt-in early. ")+("For more information, see "+t+"."));function Ik(n,e){(n==null?void 0:n.v7_startTransition)===void 0&&cw("v7_startTransition","React Router will begin wrapping state updates in `React.startTransition` in v7","https://reactrouter.com/v6/upgrading/future#v7_starttransition"),(n==null?void 0:n.v7_relativeSplatPath)===void 0&&cw("v7_relativeSplatPath","Relative route resolution within Splat routes is changing in v7","https://reactrouter.com/v6/upgrading/future#v7_relativesplatpath")}function Hi(n){let{to:e,replace:t,state:i,relative:r}=n;ml()||_t(!1);let{future:o,static:l}=V.useContext(Os),{matches:u}=V.useContext(Ls),{pathname:h}=Uo(),p=Wn(),g=ey(e,Zg(u,o.v7_relativeSplatPath),h,r==="path"),y=JSON.stringify(g);return V.useEffect(()=>p(JSON.parse(y),{replace:t,state:i,relative:r}),[p,y,r,t,i]),null}function Rt(n){_t(!1)}function kk(n){let{basename:e="/",children:t=null,location:i,navigationType:r=ms.Pop,navigator:o,static:l=!1,future:u}=n;ml()&&_t(!1);let h=e.replace(/^\/*/,"/"),p=V.useMemo(()=>({basename:h,navigator:o,static:l,future:$c({v7_relativeSplatPath:!1},u)}),[h,u,o,l]);typeof i=="string"&&(i=Fo(i));let{pathname:g="/",search:y="",hash:x="",state:b=null,key:T="default"}=i,C=V.useMemo(()=>{let I=Jg(g,h);return I==null?null:{location:{pathname:I,search:y,hash:x,state:b,key:T},navigationType:r}},[h,g,y,x,b,T,r]);return C==null?null:V.createElement(Os.Provider,{value:p},V.createElement(Qd.Provider,{children:t,value:C}))}function Pk(n){let{children:e,location:t}=n;return fk(Zm(e),t)}new Promise(()=>{});function Zm(n,e){e===void 0&&(e=[]);let t=[];return V.Children.forEach(n,(i,r)=>{if(!V.isValidElement(i))return;let o=[...e,r];if(i.type===V.Fragment){t.push.apply(t,Zm(i.props.children,o));return}i.type!==Rt&&_t(!1),!i.props.index||!i.props.children||_t(!1);let l={id:i.props.id||o.join("-"),caseSensitive:i.props.caseSensitive,element:i.props.element,Component:i.props.Component,index:i.props.index,path:i.props.path,loader:i.props.loader,action:i.props.action,errorElement:i.props.errorElement,ErrorBoundary:i.props.ErrorBoundary,hasErrorBoundary:i.props.ErrorBoundary!=null||i.props.errorElement!=null,shouldRevalidate:i.props.shouldRevalidate,handle:i.props.handle,lazy:i.props.lazy};i.props.children&&(l.children=Zm(i.props.children,o)),t.push(l)}),t}/** * React Router DOM v6.28.2 * * Copyright (c) Remix Software Inc. * * This source code is licensed under the MIT license found in the * LICENSE.md file in the root directory of this source tree. * * @license MIT */function eg(){return eg=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i])}return n},eg.apply(this,arguments)}function Ak(n,e){if(n==null)return{};var t={},i=Object.keys(n),r,o;for(o=0;o<i.length;o++)r=i[o],!(e.indexOf(r)>=0)&&(t[r]=n[r]);return t}function Nk(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function Rk(n,e){return n.button===0&&(!e||e==="_self")&&!Nk(n)}const jk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],Dk="6";try{window.__reactRouterVersion=Dk}catch{}const Mk="startTransition",uw=RI[Mk];function Ok(n){let{basename:e,children:t,future:i,window:r}=n,o=V.useRef();o.current==null&&(o.current=VI({window:r,v5Compat:!0}));let l=o.current,[u,h]=V.useState({action:l.action,location:l.location}),{v7_startTransition:p}=i||{},g=V.useCallback(y=>{p&&uw?uw(()=>h(y)):h(y)},[h,p]);return V.useLayoutEffect(()=>l.listen(g),[l,g]),V.useEffect(()=>Ik(i),[i]),V.createElement(kk,{basename:e,children:t,location:u.location,navigationType:u.action,navigator:l,future:i})}const Lk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Vk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,kn=V.forwardRef(function(e,t){let{onClick:i,relative:r,reloadDocument:o,replace:l,state:u,target:h,to:p,preventScrollReset:g,viewTransition:y}=e,x=Ak(e,jk),{basename:b}=V.useContext(Os),T,C=!1;if(typeof p=="string"&&Vk.test(p)&&(T=p,Lk))try{let O=new URL(window.location.href),L=p.startsWith("//")?new URL(O.protocol+p):new URL(p),G=Jg(L.pathname,b);L.origin===O.origin&&G!=null?p=G+L.search+L.hash:C=!0}catch{}let I=hk(p,{relative:r}),N=Fk(p,{replace:l,state:u,target:h,preventScrollReset:g,relative:r,viewTransition:y});function D(O){i&&i(O),O.defaultPrevented||N(O)}return V.createElement("a",eg({},x,{href:T||I,onClick:C||o?i:D,ref:t,target:h}))});var hw;(function(n){n.UseScrollRestoration="useScrollRestoration",n.UseSubmit="useSubmit",n.UseSubmitFetcher="useSubmitFetcher",n.UseFetcher="useFetcher",n.useViewTransitionState="useViewTransitionState"})(hw||(hw={}));var dw;(function(n){n.UseFetcher="useFetcher",n.UseFetchers="useFetchers",n.UseScrollRestoration="useScrollRestoration"})(dw||(dw={}));function Fk(n,e){let{target:t,replace:i,state:r,preventScrollReset:o,relative:l,viewTransition:u}=e===void 0?{}:e,h=Wn(),p=Uo(),g=O1(n,{relative:l});return V.useCallback(y=>{if(Rk(y,t)){y.preventDefault();let x=i!==void 0?i:gd(p)===gd(g);h(n,{replace:x,state:r,preventScrollReset:o,relative:l,viewTransition:u})}},[p,h,g,i,r,t,n,o,l,u])}/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var Uk={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"};/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zk=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),Me=(n,e)=>{const t=V.forwardRef(({color:i="currentColor",size:r=24,strokeWidth:o=2,absoluteStrokeWidth:l,className:u="",children:h,...p},g)=>V.createElement("svg",{ref:g,...Uk,width:r,height:r,stroke:i,strokeWidth:l?Number(o)*24/Number(r):o,className:["lucide",`lucide-${zk(n)}`,u].join(" "),...p},[...e.map(([y,x])=>V.createElement(y,x)),...Array.isArray(h)?h:[h]]));return t.displayName=`${n}`,t};/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ar=Me("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Bk=Me("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const U1=Me("Award",[["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}],["path",{d:"M15.477 12.89 17 22l-5-3-5 3 1.523-9.11",key:"em7aur"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Ao=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qk=Me("Book",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const z1=Me("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Tr=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fw=Me("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Is=Me("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gi=Me("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const B1=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pw=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ny=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $k=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const q1=Me("FlaskRound",[["path",{d:"M10 2v7.31",key:"5d1hyh"}],["path",{d:"M14 9.3V1.99",key:"14k4l0"}],["path",{d:"M8.5 2h7",key:"csnxdl"}],["path",{d:"M14 9.3a6.5 6.5 0 1 1-4 0",key:"1r8fvy"}],["path",{d:"M5.52 16h12.96",key:"46hh1i"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const $1=Me("Github",[["path",{d:"M15 22v-4a4.8 4.8 0 0 0-1-3.5c3 0 6-2 6-5.5.08-1.25-.27-2.48-1-3.5.28-1.15.28-2.35 0-3.5 0 0-1 0-3 1.5-2.64-.5-5.36-.5-8 0C6 2 5 2 5 2c-.3 1.15-.3 2.35 0 3.5A5.403 5.403 0 0 0 4 9c0 3.5 3 5.5 6 5.5-.39.49-.68 1.05-.85 1.65-.17.6-.22 1.23-.15 1.85v4",key:"tonef"}],["path",{d:"M9 18c-4.51 2-5-2-7-2",key:"9comsn"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Hk=Me("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Wk=Me("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mw=Me("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const H1=Me("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Gk=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kk=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const W1=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gw=Me("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Qk=Me("Menu",[["line",{x1:"4",x2:"20",y1:"12",y2:"12",key:"1e0a9i"}],["line",{x1:"4",x2:"20",y1:"6",y2:"6",key:"1owob3"}],["line",{x1:"4",x2:"20",y1:"18",y2:"18",key:"yk5zj1"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Yk=Me("Newspaper",[["path",{d:"M4 22h16a2 2 0 0 0 2-2V4a2 2 0 0 0-2-2H8a2 2 0 0 0-2 2v16a2 2 0 0 1-2 2Zm0 0a2 2 0 0 1-2-2v-9c0-1.1.9-2 2-2h2",key:"7pis2x"}],["path",{d:"M18 14h-8",key:"sponae"}],["path",{d:"M15 18h-5",key:"95g1m2"}],["path",{d:"M10 6h8v4h-8V6Z",key:"smlsk5"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zh=Me("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Xk=Me("Play",[["polygon",{points:"5 3 19 12 5 21 5 3",key:"191637"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oi=Me("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Jk=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yw=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xs=Me("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vw=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const zn=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Nc=Me("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"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zi=Me("Users",[["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"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Zk=Me("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]);/** * @license lucide-react v0.344.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const ko=Me("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),eP="/site-icon.png",hm=[{name:"Home",href:"/",icon:Hk},{name:"Courses",href:"/courses",icon:Ao},{name:"Resources",href:"/resources",icon:B1},{name:"Events",href:"/events",icon:Tr},{name:"Members",href:"/members",icon:Zi},{name:"Blog",href:"/blog",icon:Yk},{name:"Labs",href:"/labs",icon:q1},{name:"IACR",href:"https://iacr.org",icon:ny,external:!0},{name:"About",href:"/about",icon:Wk}];function tP({children:n}){const e=Uo(),t=Wn(),[i,r]=V.useState(!1),o=V.useRef(null),[l,u]=V.useState({}),h=V.useRef({}),[p,g]=V.useState(!1);V.useEffect(()=>{const b=()=>{g(window.scrollY>300)};return window.addEventListener("scroll",b),()=>window.removeEventListener("scroll",b)},[]);const y=()=>{window.scrollTo({top:0,behavior:"smooth"})},x=()=>{t("/admin-login")};return V.useEffect(()=>{const b=h.current[e.pathname];if(b){const T=b.getBoundingClientRect(),C=b.parentElement.getBoundingClientRect();u({width:`${T.width}px`,transform:`translateX(${T.left-C.left}px)`})}},[e]),V.useEffect(()=>{r(!1)},[e]),d.jsxs("div",{className:"min-h-screen bg-[#13151a]",children:[d.jsx("nav",{className:"bg-[#23262d] border-b border-[rgb(136,58,234)]",children:d.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8",children:d.jsxs("div",{className:"flex h-16 items-center justify-between",children:[d.jsx("div",{className:"flex items-center",children:d.jsxs(kn,{to:"/",className:"flex items-center",children:[d.jsx("img",{src:eP,alt:"VeilCode Labs Logo",className:"h-8 w-8 mr-2"}),d.jsx("span",{className:"ml-2 text-xl font-bold text-white",children:"VeilCode Labs"})]})}),d.jsxs("div",{className:"hidden md:flex items-center",children:[d.jsxs("div",{className:"flex items-baseline space-x-4 relative",children:[d.jsx("div",{className:"absolute bottom-0 h-1 bg-[rgb(136,58,234)] transition-all duration-300 ease-in-out rounded-full",style:l}),hm.map(b=>{const T=e.pathname===b.href;return b.external?d.jsxs("a",{href:b.href,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] rounded-md px-3 py-2 text-sm font-medium transition-all duration-300 flex items-center",children:[b.name,d.jsx(ny,{className:"h-4 w-4 ml-1"})]},b.name):d.jsx(kn,{ref:C=>h.current[b.href]=C,to:b.href,className:`${T?"text-[rgb(224,204,250)]":"text-white hover:text-[rgb(224,204,250)]"} rounded-md px-3 py-2 text-sm font-medium transition-all duration-300`,children:b.name},b.name)})]}),d.jsx("button",{onClick:x,className:"ml-4 bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center","aria-label":"Admin login",children:d.jsx(yw,{className:"h-5 w-5"})})]}),d.jsx("div",{className:"md:hidden flex items-center gap-2",children:d.jsxs("div",{className:"relative",ref:o,children:[d.jsx("button",{onClick:()=>r(!i),className:"text-white hover:text-[rgb(224,204,250)] focus:outline-none p-2 rounded-md hover:bg-[rgb(49,10,101)] transition-all duration-300",children:i?d.jsx(ko,{className:"h-6 w-6"}):d.jsx(Qk,{className:"h-6 w-6"})}),i&&d.jsx("div",{className:"absolute right-0 mt-2 w-64 rounded-lg shadow-lg bg-[#23262d] ring-1 ring-black ring-opacity-5 border border-[rgb(136,58,234)] z-50",children:d.jsxs("div",{className:"p-2",children:[d.jsx("div",{className:"grid grid-cols-2 gap-1",children:hm.map(b=>{const T=e.pathname===b.href;return b.external?d.jsxs("a",{href:b.href,target:"_blank",rel:"noopener noreferrer",className:"flex flex-col items-center justify-center p-3 rounded-md text-sm font-medium text-white hover:bg-[rgb(49,10,101)] hover:text-[rgb(224,204,250)] transition-all duration-300",children:[d.jsx(b.icon,{className:"h-5 w-5 mb-1"}),d.jsx("span",{className:"text-xs",children:b.name})]},b.name):d.jsxs(kn,{to:b.href,className:`${T?"bg-[rgb(49,10,101)] text-[rgb(224,204,250)]":"text-white hover:bg-[rgb(49,10,101)] hover:text-[rgb(224,204,250)]"} flex flex-col items-center justify-center p-3 rounded-md text-sm font-medium transition-all duration-300`,children:[d.jsx(b.icon,{className:"h-5 w-5 mb-1"}),d.jsx("span",{className:"text-xs",children:b.name})]},b.name)})}),d.jsxs("button",{onClick:x,className:"w-full flex items-center justify-center p-3 rounded-md text-sm font-medium text-white hover:bg-[rgb(49,10,101)] hover:text-[rgb(224,204,250)] mt-2",children:[d.jsx(yw,{className:"h-5 w-5 mr-2"}),d.jsx("span",{className:"text-xs",children:"Admin"})]})]})})]})})]})})}),d.jsx("main",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-8",children:n}),p&&d.jsx("button",{onClick:y,className:"fixed bottom-8 right-8 p-3 bg-[rgb(136,58,234)] text-white rounded-full shadow-lg hover:bg-[rgb(49,10,101)] transition-all duration-300",children:d.jsx(Bk,{className:"h-6 w-6"})}),d.jsx("footer",{className:"bg-[#23262d] text-white mt-auto",children:d.jsx("div",{className:"mx-auto max-w-7xl px-4 sm:px-6 lg:px-8 py-2",children:d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-4 text-white",children:"VeilCode Labs"}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:"A comprehensive resource for cryptography students at IIIT Delhi"})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-4 text-[rgb(224,204,250)]",children:"Quick Links"}),d.jsx("ul",{className:"grid grid-cols-2 gap-2",children:hm.map(b=>d.jsx("li",{children:b.external?d.jsx("a",{href:b.href,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] hover:bg-[rgb(49,10,101)] px-2 py-1 rounded transition-all duration-300 inline-block",children:b.name}):d.jsx(kn,{to:b.href,className:"text-white hover:text-[rgb(224,204,250)] hover:bg-[rgb(49,10,101)] px-2 py-1 rounded transition-all duration-300 inline-block",children:b.name})},b.name))})]}),d.jsxs("div",{children:[d.jsx("h3",{className:"text-lg font-semibold mb-4 text-[rgb(224,204,250)]",children:"Contact"}),d.jsxs("p",{className:"text-white",children:["IIIT Delhi",d.jsx("br",{}),"Okhla Industrial Estate, Phase III",d.jsx("br",{}),"New Delhi, India"]}),d.jsxs("p",{className:"text-[rgb(224,204,250)] mt-4 text-sm",children:["Developed by"," ",d.jsx("a",{href:"https://lordaizen1.github.io/porfolio/",className:"underline hover:text-white",target:"_blank",rel:"noopener noreferrer",children:"Md Kaif"})," ","&"," ",d.jsx("a",{href:"https://areeb22297-portfolio.netlify.app/",className:"underline hover:text-white",target:"_blank",rel:"noopener noreferrer",children:"Mohammad Areeb Ansari"})]})]})]})})})]})}const iy=V.createContext({});function ry(n){const e=V.useRef(null);return e.current===null&&(e.current=n()),e.current}const Yd=V.createContext(null),sy=V.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});class nP extends V.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(t&&e.isPresent&&!this.props.isPresent){const i=t.offsetParent,r=i instanceof HTMLElement&&i.offsetWidth||0,o=this.props.sizeRef.current;o.height=t.offsetHeight||0,o.width=t.offsetWidth||0,o.top=t.offsetTop,o.left=t.offsetLeft,o.right=r-o.width-o.left}return null}componentDidUpdate(){}render(){return this.props.children}}function iP({children:n,isPresent:e,anchorX:t}){const i=V.useId(),r=V.useRef(null),o=V.useRef({width:0,height:0,top:0,left:0,right:0}),{nonce:l}=V.useContext(sy);return V.useInsertionEffect(()=>{const{width:u,height:h,top:p,left:g,right:y}=o.current;if(e||!r.current||!u||!h)return;const x=t==="left"?`left: ${g}`:`right: ${y}`;r.current.dataset.motionPopId=i;const b=document.createElement("style");return l&&(b.nonce=l),document.head.appendChild(b),b.sheet&&b.sheet.insertRule(` [data-motion-pop-id="${i}"] { position: absolute !important; width: ${u}px !important; height: ${h}px !important; ${x}px !important; top: ${p}px !important; } `),()=>{document.head.removeChild(b)}},[e]),d.jsx(nP,{isPresent:e,childRef:r,sizeRef:o,children:V.cloneElement(n,{ref:r})})}const rP=({children:n,initial:e,isPresent:t,onExitComplete:i,custom:r,presenceAffectsLayout:o,mode:l,anchorX:u})=>{const h=ry(sP),p=V.useId(),g=V.useCallback(x=>{h.set(x,!0);for(const b of h.values())if(!b)return;i&&i()},[h,i]),y=V.useMemo(()=>({id:p,initial:e,isPresent:t,custom:r,onExitComplete:g,register:x=>(h.set(x,!1),()=>h.delete(x))}),o?[Math.random(),g]:[t,g]);return V.useMemo(()=>{h.forEach((x,b)=>h.set(b,!1))},[t]),V.useEffect(()=>{!t&&!h.size&&i&&i()},[t]),l==="popLayout"&&(n=d.jsx(iP,{isPresent:t,anchorX:u,children:n})),d.jsx(Yd.Provider,{value:y,children:n})};function sP(){return new Map}function G1(n=!0){const e=V.useContext(Yd);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:i,register:r}=e,o=V.useId();V.useEffect(()=>{n&&r(o)},[n]);const l=V.useCallback(()=>n&&i&&i(o),[o,i,n]);return!t&&i?[!1,l]:[!0]}const qh=n=>n.key||"";function xw(n){const e=[];return V.Children.forEach(n,t=>{V.isValidElement(t)&&e.push(t)}),e}const oy=typeof window<"u",K1=oy?V.useLayoutEffect:V.useEffect,Q1=({children:n,custom:e,initial:t=!0,onExitComplete:i,presenceAffectsLayout:r=!0,mode:o="sync",propagate:l=!1,anchorX:u="left"})=>{const[h,p]=G1(l),g=V.useMemo(()=>xw(n),[n]),y=l&&!h?[]:g.map(qh),x=V.useRef(!0),b=V.useRef(g),T=ry(()=>new Map),[C,I]=V.useState(g),[N,D]=V.useState(g);K1(()=>{x.current=!1,b.current=g;for(let G=0;G<N.length;G++){const X=qh(N[G]);y.includes(X)?T.delete(X):T.get(X)!==!0&&T.set(X,!1)}},[N,y.length,y.join("-")]);const O=[];if(g!==C){let G=[...g];for(let X=0;X<N.length;X++){const k=N[X],P=qh(k);y.includes(P)||(G.splice(X,0,k),O.push(k))}return o==="wait"&&O.length&&(G=O),D(xw(G)),I(g),null}const{forceRender:L}=V.useContext(iy);return d.jsx(d.Fragment,{children:N.map(G=>{const X=qh(G),k=l&&!h?!1:g===N||y.includes(X),P=()=>{if(T.has(X))T.set(X,!0);else return;let R=!0;T.forEach(F=>{F||(R=!1)}),R&&(L==null||L(),D(b.current),l&&(p==null||p()),i&&i())};return d.jsx(rP,{isPresent:k,initial:!x.current||t?void 0:!1,custom:k?void 0:e,presenceAffectsLayout:r,mode:o,onExitComplete:k?void 0:P,anchorX:u,children:G},X)})})},qn=n=>n;let Y1=qn;function ay(n){let e;return()=>(e===void 0&&(e=n()),e)}const tl=(n,e,t)=>{const i=e-n;return i===0?1:(t-n)/i},Sr=n=>n*1e3,Cr=n=>n/1e3,oP={useManualTiming:!1};function aP(n){let e=new Set,t=new Set,i=!1,r=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function u(p){o.has(p)&&(h.schedule(p),n()),p(l)}const h={schedule:(p,g=!1,y=!1)=>{const b=y&&i?e:t;return g&&o.add(p),b.has(p)||b.add(p),p},cancel:p=>{t.delete(p),o.delete(p)},process:p=>{if(l=p,i){r=!0;return}i=!0,[e,t]=[t,e],e.forEach(u),e.clear(),i=!1,r&&(r=!1,h.process(p))}};return h}const $h=["read","resolveKeyframes","update","preRender","render","postRender"],lP=40;function X1(n,e){let t=!1,i=!0;const r={delta:0,timestamp:0,isProcessing:!1},o=()=>t=!0,l=$h.reduce((N,D)=>(N[D]=aP(o),N),{}),{read:u,resolveKeyframes:h,update:p,preRender:g,render:y,postRender:x}=l,b=()=>{const N=performance.now();t=!1,r.delta=i?1e3/60:Math.max(Math.min(N-r.timestamp,lP),1),r.timestamp=N,r.isProcessing=!0,u.process(r),h.process(r),p.process(r),g.process(r),y.process(r),x.process(r),r.isProcessing=!1,t&&e&&(i=!1,n(b))},T=()=>{t=!0,i=!0,r.isProcessing||n(b)};return{schedule:$h.reduce((N,D)=>{const O=l[D];return N[D]=(L,G=!1,X=!1)=>(t||T(),O.schedule(L,G,X)),N},{}),cancel:N=>{for(let D=0;D<$h.length;D++)l[$h[D]].cancel(N)},state:r,steps:l}}const{schedule:et,cancel:ks,state:Qt,steps:dm}=X1(typeof requestAnimationFrame<"u"?requestAnimationFrame:qn,!0),J1=V.createContext({strict:!1}),ww={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"]},nl={};for(const n in ww)nl[n]={isEnabled:e=>ww[n].some(t=>!!e[t])};function cP(n){for(const e in n)nl[e]={...nl[e],...n[e]}}const uP=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 yd(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||uP.has(n)}let Z1=n=>!yd(n);function hP(n){n&&(Z1=e=>e.startsWith("on")?!yd(e):n(e))}try{hP(require("@emotion/is-prop-valid").default)}catch{}function dP(n,e,t){const i={};for(const r in n)r==="values"&&typeof n.values=="object"||(Z1(r)||t===!0&&yd(r)||!e&&!yd(r)||n.draggable&&r.startsWith("onDrag"))&&(i[r]=n[r]);return i}function fP(n){if(typeof Proxy>"u")return n;const e=new Map,t=(...i)=>n(...i);return new Proxy(t,{get:(i,r)=>r==="create"?n:(e.has(r)||e.set(r,n(r)),e.get(r))})}const Xd=V.createContext({});function Jd(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function Hc(n){return typeof n=="string"||Array.isArray(n)}const ly=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],cy=["initial",...ly];function Zd(n){return Jd(n.animate)||cy.some(e=>Hc(n[e]))}function e2(n){return!!(Zd(n)||n.variants)}function pP(n,e){if(Zd(n)){const{initial:t,animate:i}=n;return{initial:t===!1||Hc(t)?t:void 0,animate:Hc(i)?i:void 0}}return n.inherit!==!1?e:{}}function mP(n){const{initial:e,animate:t}=pP(n,V.useContext(Xd));return V.useMemo(()=>({initial:e,animate:t}),[_w(e),_w(t)])}function _w(n){return Array.isArray(n)?n.join(" "):n}const gP=Symbol.for("motionComponentSymbol");function $a(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function yP(n,e,t){return V.useCallback(i=>{i&&n.onMount&&n.onMount(i),e&&(i?e.mount(i):e.unmount()),t&&(typeof t=="function"?t(i):$a(t)&&(t.current=i))},[e])}const uy=n=>n.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),vP="framerAppearId",t2="data-"+uy(vP),{schedule:hy}=X1(queueMicrotask,!1),n2=V.createContext({});function xP(n,e,t,i,r){var o,l;const{visualElement:u}=V.useContext(Xd),h=V.useContext(J1),p=V.useContext(Yd),g=V.useContext(sy).reducedMotion,y=V.useRef(null);i=i||h.renderer,!y.current&&i&&(y.current=i(n,{visualState:e,parent:u,props:t,presenceContext:p,blockInitialAnimation:p?p.initial===!1:!1,reducedMotionConfig:g}));const x=y.current,b=V.useContext(n2);x&&!x.projection&&r&&(x.type==="html"||x.type==="svg")&&wP(y.current,t,r,b);const T=V.useRef(!1);V.useInsertionEffect(()=>{x&&T.current&&x.update(t,p)});const C=t[t2],I=V.useRef(!!C&&!(!((o=window.MotionHandoffIsComplete)===null||o===void 0)&&o.call(window,C))&&((l=window.MotionHasOptimisedAnimation)===null||l===void 0?void 0:l.call(window,C)));return K1(()=>{x&&(T.current=!0,window.MotionIsMounted=!0,x.updateFeatures(),hy.render(x.render),I.current&&x.animationState&&x.animationState.animateChanges())}),V.useEffect(()=>{x&&(!I.current&&x.animationState&&x.animationState.animateChanges(),I.current&&(queueMicrotask(()=>{var N;(N=window.MotionHandoffMarkAsComplete)===null||N===void 0||N.call(window,C)}),I.current=!1))}),x}function wP(n,e,t,i){const{layoutId:r,layout:o,drag:l,dragConstraints:u,layoutScroll:h,layoutRoot:p}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:i2(n.parent)),n.projection.setOptions({layoutId:r,layout:o,alwaysMeasureLayout:!!l||u&&$a(u),visualElement:n,animationType:typeof o=="string"?o:"both",initialPromotionConfig:i,layoutScroll:h,layoutRoot:p})}function i2(n){if(n)return n.options.allowProjection!==!1?n.projection:i2(n.parent)}function _P({preloadedFeatures:n,createVisualElement:e,useRender:t,useVisualState:i,Component:r}){var o,l;n&&cP(n);function u(p,g){let y;const x={...V.useContext(sy),...p,layoutId:bP(p)},{isStatic:b}=x,T=mP(p),C=i(p,b);if(!b&&oy){EP();const I=TP(x);y=I.MeasureLayout,T.visualElement=xP(r,C,x,e,I.ProjectionNode)}return d.jsxs(Xd.Provider,{value:T,children:[y&&T.visualElement?d.jsx(y,{visualElement:T.visualElement,...x}):null,t(r,p,yP(C,T.visualElement,g),C,b,T.visualElement)]})}u.displayName=`motion.${typeof r=="string"?r:`create(${(l=(o=r.displayName)!==null&&o!==void 0?o:r.name)!==null&&l!==void 0?l:""})`}`;const h=V.forwardRef(u);return h[gP]=r,h}function bP({layoutId:n}){const e=V.useContext(iy).id;return e&&n!==void 0?e+"-"+n:n}function EP(n,e){V.useContext(J1).strict}function TP(n){const{drag:e,layout:t}=nl;if(!e&&!t)return{};const i={...e,...t};return{MeasureLayout:e!=null&&e.isEnabled(n)||t!=null&&t.isEnabled(n)?i.MeasureLayout:void 0,ProjectionNode:i.ProjectionNode}}const r2=n=>e=>typeof e=="string"&&e.startsWith(n),dy=r2("--"),SP=r2("var(--"),fy=n=>SP(n)?CP.test(n.split("/*")[0].trim()):!1,CP=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,Wc={};function IP(n){for(const e in n)Wc[e]=n[e],dy(e)&&(Wc[e].isCSSVariable=!0)}const gl=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],zo=new Set(gl);function s2(n,{layout:e,layoutId:t}){return zo.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!Wc[n]||n==="opacity")}const cn=n=>!!(n&&n.getVelocity),o2=(n,e)=>e&&typeof n=="number"?e.transform(n):n,Nr=(n,e,t)=>t>e?e:t<n?n:t,yl={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},Gc={...yl,transform:n=>Nr(0,1,n)},Hh={...yl,default:1},hu=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),hs=hu("deg"),Ki=hu("%"),Ee=hu("px"),kP=hu("vh"),PP=hu("vw"),bw={...Ki,parse:n=>Ki.parse(n)/100,transform:n=>Ki.transform(n*100)},AP={borderWidth:Ee,borderTopWidth:Ee,borderRightWidth:Ee,borderBottomWidth:Ee,borderLeftWidth:Ee,borderRadius:Ee,radius:Ee,borderTopLeftRadius:Ee,borderTopRightRadius:Ee,borderBottomRightRadius:Ee,borderBottomLeftRadius:Ee,width:Ee,maxWidth:Ee,height:Ee,maxHeight:Ee,top:Ee,right:Ee,bottom:Ee,left:Ee,padding:Ee,paddingTop:Ee,paddingRight:Ee,paddingBottom:Ee,paddingLeft:Ee,margin:Ee,marginTop:Ee,marginRight:Ee,marginBottom:Ee,marginLeft:Ee,backgroundPositionX:Ee,backgroundPositionY:Ee},NP={rotate:hs,rotateX:hs,rotateY:hs,rotateZ:hs,scale:Hh,scaleX:Hh,scaleY:Hh,scaleZ:Hh,skew:hs,skewX:hs,skewY:hs,distance:Ee,translateX:Ee,translateY:Ee,translateZ:Ee,x:Ee,y:Ee,z:Ee,perspective:Ee,transformPerspective:Ee,opacity:Gc,originX:bw,originY:bw,originZ:Ee},Ew={...yl,transform:Math.round},py={...AP,...NP,zIndex:Ew,size:Ee,fillOpacity:Gc,strokeOpacity:Gc,numOctaves:Ew},RP={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},jP=gl.length;function DP(n,e,t){let i="",r=!0;for(let o=0;o<jP;o++){const l=gl[o],u=n[l];if(u===void 0)continue;let h=!0;if(typeof u=="number"?h=u===(l.startsWith("scale")?1:0):h=parseFloat(u)===0,!h||t){const p=o2(u,py[l]);if(!h){r=!1;const g=RP[l]||l;i+=`${g}(${p}) `}t&&(e[l]=p)}}return i=i.trim(),t?i=t(e,r?"":i):r&&(i="none"),i}function my(n,e,t){const{style:i,vars:r,transformOrigin:o}=n;let l=!1,u=!1;for(const h in e){const p=e[h];if(zo.has(h)){l=!0;continue}else if(dy(h)){r[h]=p;continue}else{const g=o2(p,py[h]);h.startsWith("origin")?(u=!0,o[h]=g):i[h]=g}}if(e.transform||(l||t?i.transform=DP(e,n.transform,t):i.transform&&(i.transform="none")),u){const{originX:h="50%",originY:p="50%",originZ:g=0}=o;i.transformOrigin=`${h} ${p} ${g}`}}const gy=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function a2(n,e,t){for(const i in e)!cn(e[i])&&!s2(i,t)&&(n[i]=e[i])}function MP({transformTemplate:n},e){return V.useMemo(()=>{const t=gy();return my(t,e,n),Object.assign({},t.vars,t.style)},[e])}function OP(n,e){const t=n.style||{},i={};return a2(i,t,n),Object.assign(i,MP(n,e)),i}function LP(n,e){const t={},i=OP(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,i.userSelect=i.WebkitUserSelect=i.WebkitTouchCallout="none",i.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=i,t}const VP=["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 yy(n){return typeof n!="string"||n.includes("-")?!1:!!(VP.indexOf(n)>-1||/[A-Z]/u.test(n))}const FP={offset:"stroke-dashoffset",array:"stroke-dasharray"},UP={offset:"strokeDashoffset",array:"strokeDasharray"};function zP(n,e,t=1,i=0,r=!0){n.pathLength=1;const o=r?FP:UP;n[o.offset]=Ee.transform(-i);const l=Ee.transform(e),u=Ee.transform(t);n[o.array]=`${l} ${u}`}function Tw(n,e,t){return typeof n=="string"?n:Ee.transform(e+t*n)}function BP(n,e,t){const i=Tw(e,n.x,n.width),r=Tw(t,n.y,n.height);return`${i} ${r}`}function vy(n,{attrX:e,attrY:t,attrScale:i,originX:r,originY:o,pathLength:l,pathSpacing:u=1,pathOffset:h=0,...p},g,y){if(my(n,p,y),g){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:x,style:b,dimensions:T}=n;x.transform&&(T&&(b.transform=x.transform),delete x.transform),T&&(r!==void 0||o!==void 0||b.transform)&&(b.transformOrigin=BP(T,r!==void 0?r:.5,o!==void 0?o:.5)),e!==void 0&&(x.x=e),t!==void 0&&(x.y=t),i!==void 0&&(x.scale=i),l!==void 0&&zP(x,l,u,h,!1)}const l2=()=>({...gy(),attrs:{}}),xy=n=>typeof n=="string"&&n.toLowerCase()==="svg";function qP(n,e,t,i){const r=V.useMemo(()=>{const o=l2();return vy(o,e,xy(i),n.transformTemplate),{...o.attrs,style:{...o.style}}},[e]);if(n.style){const o={};a2(o,n.style,n),r.style={...o,...r.style}}return r}function $P(n=!1){return(t,i,r,{latestValues:o},l)=>{const h=(yy(t)?qP:LP)(i,o,l,t),p=dP(i,typeof t=="string",n),g=t!==V.Fragment?{...p,...h,ref:r}:{},{children:y}=i,x=V.useMemo(()=>cn(y)?y.get():y,[y]);return V.createElement(t,{...g,children:x})}}function Sw(n){const e=[{},{}];return n==null||n.values.forEach((t,i)=>{e[0][i]=t.get(),e[1][i]=t.getVelocity()}),e}function wy(n,e,t,i){if(typeof e=="function"){const[r,o]=Sw(i);e=e(t!==void 0?t:n.custom,r,o)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[r,o]=Sw(i);e=e(t!==void 0?t:n.custom,r,o)}return e}const tg=n=>Array.isArray(n),HP=n=>!!(n&&typeof n=="object"&&n.mix&&n.toValue),WP=n=>tg(n)?n[n.length-1]||0:n;function ed(n){const e=cn(n)?n.get():n;return HP(e)?e.toValue():e}function GP({scrapeMotionValuesFromProps:n,createRenderState:e,onUpdate:t},i,r,o){const l={latestValues:KP(i,r,o,n),renderState:e()};return t&&(l.onMount=u=>t({props:i,current:u,...l}),l.onUpdate=u=>t(u)),l}const c2=n=>(e,t)=>{const i=V.useContext(Xd),r=V.useContext(Yd),o=()=>GP(n,e,i,r);return t?o():ry(o)};function KP(n,e,t,i){const r={},o=i(n,{});for(const x in o)r[x]=ed(o[x]);let{initial:l,animate:u}=n;const h=Zd(n),p=e2(n);e&&p&&!h&&n.inherit!==!1&&(l===void 0&&(l=e.initial),u===void 0&&(u=e.animate));let g=t?t.initial===!1:!1;g=g||l===!1;const y=g?u:l;if(y&&typeof y!="boolean"&&!Jd(y)){const x=Array.isArray(y)?y:[y];for(let b=0;b<x.length;b++){const T=wy(n,x[b]);if(T){const{transitionEnd:C,transition:I,...N}=T;for(const D in N){let O=N[D];if(Array.isArray(O)){const L=g?O.length-1:0;O=O[L]}O!==null&&(r[D]=O)}for(const D in C)r[D]=C[D]}}}return r}function _y(n,e,t){var i;const{style:r}=n,o={};for(const l in r)(cn(r[l])||e.style&&cn(e.style[l])||s2(l,n)||((i=t==null?void 0:t.getValue(l))===null||i===void 0?void 0:i.liveStyle)!==void 0)&&(o[l]=r[l]);return o}const QP={useVisualState:c2({scrapeMotionValuesFromProps:_y,createRenderState:gy})};function u2(n,e){try{e.dimensions=typeof n.getBBox=="function"?n.getBBox():n.getBoundingClientRect()}catch{e.dimensions={x:0,y:0,width:0,height:0}}}function h2(n,{style:e,vars:t},i,r){Object.assign(n.style,e,r&&r.getProjectionStyles(i));for(const o in t)n.style.setProperty(o,t[o])}const d2=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 f2(n,e,t,i){h2(n,e,void 0,i);for(const r in e.attrs)n.setAttribute(d2.has(r)?r:uy(r),e.attrs[r])}function p2(n,e,t){const i=_y(n,e,t);for(const r in n)if(cn(n[r])||cn(e[r])){const o=gl.indexOf(r)!==-1?"attr"+r.charAt(0).toUpperCase()+r.substring(1):r;i[o]=n[r]}return i}const Cw=["x","y","width","height","cx","cy","r"],YP={useVisualState:c2({scrapeMotionValuesFromProps:p2,createRenderState:l2,onUpdate:({props:n,prevProps:e,current:t,renderState:i,latestValues:r})=>{if(!t)return;let o=!!n.drag;if(!o){for(const u in r)if(zo.has(u)){o=!0;break}}if(!o)return;let l=!e;if(e)for(let u=0;u<Cw.length;u++){const h=Cw[u];n[h]!==e[h]&&(l=!0)}l&&et.read(()=>{u2(t,i),et.render(()=>{vy(i,r,xy(t.tagName),n.transformTemplate),f2(t,i)})})}})};function XP(n,e){return function(i,{forwardMotionProps:r}={forwardMotionProps:!1}){const l={...yy(i)?YP:QP,preloadedFeatures:n,useRender:$P(r),createVisualElement:e,Component:i};return _P(l)}}function ef(n,e,t){const i=n.getProps();return wy(i,e,t!==void 0?t:i.custom,n)}const JP=ay(()=>window.ScrollTimeline!==void 0);class ZP{constructor(e){this.stop=()=>this.runAll("stop"),this.animations=e.filter(Boolean)}get finished(){return Promise.all(this.animations.map(e=>"finished"in e?e.finished:e))}getAll(e){return this.animations[0][e]}setAll(e,t){for(let i=0;i<this.animations.length;i++)this.animations[i][e]=t}attachTimeline(e,t){const i=this.animations.map(r=>{if(JP()&&r.attachTimeline)return r.attachTimeline(e);if(typeof t=="function")return t(r)});return()=>{i.forEach((r,o)=>{r&&r(),this.animations[o].stop()})}}get time(){return this.getAll("time")}set time(e){this.setAll("time",e)}get speed(){return this.getAll("speed")}set speed(e){this.setAll("speed",e)}get startTime(){return this.getAll("startTime")}get duration(){let e=0;for(let t=0;t<this.animations.length;t++)e=Math.max(e,this.animations[t].duration);return e}runAll(e){this.animations.forEach(t=>t[e]())}flatten(){this.runAll("flatten")}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}}class eA extends ZP{then(e,t){return Promise.all(this.animations).then(e).catch(t)}}function by(n,e){return n?n[e]||n.default||n:void 0}const ng=2e4;function m2(n){let e=0;const t=50;let i=n.next(e);for(;!i.done&&e<ng;)e+=t,i=n.next(e);return e>=ng?1/0:e}function Ey(n){return typeof n=="function"}function Iw(n,e){n.timeline=e,n.onfinish=null}const Ty=n=>Array.isArray(n)&&typeof n[0]=="number",tA={linearEasing:void 0};function nA(n,e){const t=ay(n);return()=>{var i;return(i=tA[e])!==null&&i!==void 0?i:t()}}const vd=nA(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),g2=(n,e,t=10)=>{let i="";const r=Math.max(Math.round(e/t),2);for(let o=0;o<r;o++)i+=n(tl(0,r-1,o))+", ";return`linear(${i.substring(0,i.length-2)})`};function y2(n){return!!(typeof n=="function"&&vd()||!n||typeof n=="string"&&(n in ig||vd())||Ty(n)||Array.isArray(n)&&n.every(y2))}const _c=([n,e,t,i])=>`cubic-bezier(${n}, ${e}, ${t}, ${i})`,ig={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:_c([0,.65,.55,1]),circOut:_c([.55,0,1,.45]),backIn:_c([.31,.01,.66,-.59]),backOut:_c([.33,1.53,.69,.99])};function v2(n,e){if(n)return typeof n=="function"&&vd()?g2(n,e):Ty(n)?_c(n):Array.isArray(n)?n.map(t=>v2(t,e)||ig.easeOut):ig[n]}const Ci={x:!1,y:!1};function x2(){return Ci.x||Ci.y}function iA(n,e,t){var i;if(n instanceof Element)return[n];if(typeof n=="string"){let r=document;const o=(i=void 0)!==null&&i!==void 0?i:r.querySelectorAll(n);return o?Array.from(o):[]}return Array.from(n)}function w2(n,e){const t=iA(n),i=new AbortController,r={passive:!0,...e,signal:i.signal};return[t,r,()=>i.abort()]}function kw(n){return!(n.pointerType==="touch"||x2())}function rA(n,e,t={}){const[i,r,o]=w2(n,t),l=u=>{if(!kw(u))return;const{target:h}=u,p=e(h,u);if(typeof p!="function"||!h)return;const g=y=>{kw(y)&&(p(y),h.removeEventListener("pointerleave",g))};h.addEventListener("pointerleave",g,r)};return i.forEach(u=>{u.addEventListener("pointerenter",l,r)}),o}const _2=(n,e)=>e?n===e?!0:_2(n,e.parentElement):!1,Sy=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,sA=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function oA(n){return sA.has(n.tagName)||n.tabIndex!==-1}const bc=new WeakSet;function Pw(n){return e=>{e.key==="Enter"&&n(e)}}function fm(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const aA=(n,e)=>{const t=n.currentTarget;if(!t)return;const i=Pw(()=>{if(bc.has(t))return;fm(t,"down");const r=Pw(()=>{fm(t,"up")}),o=()=>fm(t,"cancel");t.addEventListener("keyup",r,e),t.addEventListener("blur",o,e)});t.addEventListener("keydown",i,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",i),e)};function Aw(n){return Sy(n)&&!x2()}function lA(n,e,t={}){const[i,r,o]=w2(n,t),l=u=>{const h=u.currentTarget;if(!Aw(u)||bc.has(h))return;bc.add(h);const p=e(h,u),g=(b,T)=>{window.removeEventListener("pointerup",y),window.removeEventListener("pointercancel",x),!(!Aw(b)||!bc.has(h))&&(bc.delete(h),typeof p=="function"&&p(b,{success:T}))},y=b=>{g(b,t.useGlobalTarget||_2(h,b.target))},x=b=>{g(b,!1)};window.addEventListener("pointerup",y,r),window.addEventListener("pointercancel",x,r)};return i.forEach(u=>{!oA(u)&&u.getAttribute("tabindex")===null&&(u.tabIndex=0),(t.useGlobalTarget?window:u).addEventListener("pointerdown",l,r),u.addEventListener("focus",p=>aA(p,r),r)}),o}function cA(n){return n==="x"||n==="y"?Ci[n]?null:(Ci[n]=!0,()=>{Ci[n]=!1}):Ci.x||Ci.y?null:(Ci.x=Ci.y=!0,()=>{Ci.x=Ci.y=!1})}const b2=new Set(["width","height","top","left","right","bottom",...gl]);let td;function uA(){td=void 0}const Qi={now:()=>(td===void 0&&Qi.set(Qt.isProcessing||oP.useManualTiming?Qt.timestamp:performance.now()),td),set:n=>{td=n,queueMicrotask(uA)}};function Cy(n,e){n.indexOf(e)===-1&&n.push(e)}function Iy(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}class ky{constructor(){this.subscriptions=[]}add(e){return Cy(this.subscriptions,e),()=>Iy(this.subscriptions,e)}notify(e,t,i){const r=this.subscriptions.length;if(r)if(r===1)this.subscriptions[0](e,t,i);else for(let o=0;o<r;o++){const l=this.subscriptions[o];l&&l(e,t,i)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}function E2(n,e){return e?n*(1e3/e):0}const Nw=30,hA=n=>!isNaN(parseFloat(n));class dA{constructor(e,t={}){this.version="12.1.0",this.canTrackVelocity=null,this.events={},this.updateAndNotify=(i,r=!0)=>{const o=Qi.now();this.updatedAt!==o&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(i),this.current!==this.prev&&this.events.change&&this.events.change.notify(this.current),r&&this.events.renderRequest&&this.events.renderRequest.notify(this.current)},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=Qi.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=hA(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new ky);const i=this.events[e].add(t);return e==="change"?()=>{i(),et.read(()=>{this.events.change.getSize()||this.stop()})}:i}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e,t=!0){!t||!this.passiveEffect?this.updateAndNotify(e,t):this.passiveEffect(e,this.updateAndNotify)}setWithVelocity(e,t,i){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-i}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=Qi.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>Nw)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,Nw);return E2(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),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 Kc(n,e){return new dA(n,e)}function fA(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,Kc(t))}function pA(n,e){const t=ef(n,e);let{transitionEnd:i={},transition:r={},...o}=t||{};o={...o,...i};for(const l in o){const u=WP(o[l]);fA(n,l,u)}}function mA(n){return!!(cn(n)&&n.add)}function rg(n,e){const t=n.getValue("willChange");if(mA(t))return t.add(e)}function T2(n){return n.props[t2]}const S2=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,gA=1e-7,yA=12;function vA(n,e,t,i,r){let o,l,u=0;do l=e+(t-e)/2,o=S2(l,i,r)-n,o>0?t=l:e=l;while(Math.abs(o)>gA&&++u<yA);return l}function du(n,e,t,i){if(n===e&&t===i)return qn;const r=o=>vA(o,0,1,n,t);return o=>o===0||o===1?o:S2(r(o),e,i)}const C2=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,I2=n=>e=>1-n(1-e),k2=du(.33,1.53,.69,.99),Py=I2(k2),P2=C2(Py),A2=n=>(n*=2)<1?.5*Py(n):.5*(2-Math.pow(2,-10*(n-1))),Ay=n=>1-Math.sin(Math.acos(n)),N2=I2(Ay),R2=C2(Ay),j2=n=>/^0[^.\s]+$/u.test(n);function xA(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||j2(n):!0}const Rc=n=>Math.round(n*1e5)/1e5,Ny=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function wA(n){return n==null}const _A=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Ry=(n,e)=>t=>!!(typeof t=="string"&&_A.test(t)&&t.startsWith(n)||e&&!wA(t)&&Object.prototype.hasOwnProperty.call(t,e)),D2=(n,e,t)=>i=>{if(typeof i!="string")return i;const[r,o,l,u]=i.match(Ny);return{[n]:parseFloat(r),[e]:parseFloat(o),[t]:parseFloat(l),alpha:u!==void 0?parseFloat(u):1}},bA=n=>Nr(0,255,n),pm={...yl,transform:n=>Math.round(bA(n))},So={test:Ry("rgb","red"),parse:D2("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:i=1})=>"rgba("+pm.transform(n)+", "+pm.transform(e)+", "+pm.transform(t)+", "+Rc(Gc.transform(i))+")"};function EA(n){let e="",t="",i="",r="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),i=n.substring(5,7),r=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),i=n.substring(3,4),r=n.substring(4,5),e+=e,t+=t,i+=i,r+=r),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(i,16),alpha:r?parseInt(r,16)/255:1}}const sg={test:Ry("#"),parse:EA,transform:So.transform},Ha={test:Ry("hsl","hue"),parse:D2("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:i=1})=>"hsla("+Math.round(n)+", "+Ki.transform(Rc(e))+", "+Ki.transform(Rc(t))+", "+Rc(Gc.transform(i))+")"},on={test:n=>So.test(n)||sg.test(n)||Ha.test(n),parse:n=>So.test(n)?So.parse(n):Ha.test(n)?Ha.parse(n):sg.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?So.transform(n):Ha.transform(n)},TA=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function SA(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(Ny))===null||e===void 0?void 0:e.length)||0)+(((t=n.match(TA))===null||t===void 0?void 0:t.length)||0)>0}const M2="number",O2="color",CA="var",IA="var(",Rw="${}",kA=/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 Qc(n){const e=n.toString(),t=[],i={color:[],number:[],var:[]},r=[];let o=0;const u=e.replace(kA,h=>(on.test(h)?(i.color.push(o),r.push(O2),t.push(on.parse(h))):h.startsWith(IA)?(i.var.push(o),r.push(CA),t.push(h)):(i.number.push(o),r.push(M2),t.push(parseFloat(h))),++o,Rw)).split(Rw);return{values:t,split:u,indexes:i,types:r}}function L2(n){return Qc(n).values}function V2(n){const{split:e,types:t}=Qc(n),i=e.length;return r=>{let o="";for(let l=0;l<i;l++)if(o+=e[l],r[l]!==void 0){const u=t[l];u===M2?o+=Rc(r[l]):u===O2?o+=on.transform(r[l]):o+=r[l]}return o}}const PA=n=>typeof n=="number"?0:n;function AA(n){const e=L2(n);return V2(n)(e.map(PA))}const Ps={test:SA,parse:L2,createTransformer:V2,getAnimatableNone:AA},NA=new Set(["brightness","contrast","saturate","opacity"]);function RA(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[i]=t.match(Ny)||[];if(!i)return n;const r=t.replace(i,"");let o=NA.has(e)?1:0;return i!==t&&(o*=100),e+"("+o+r+")"}const jA=/\b([a-z-]*)\(.*?\)/gu,og={...Ps,getAnimatableNone:n=>{const e=n.match(jA);return e?e.map(RA).join(" "):n}},DA={...py,color:on,backgroundColor:on,outlineColor:on,fill:on,stroke:on,borderColor:on,borderTopColor:on,borderRightColor:on,borderBottomColor:on,borderLeftColor:on,filter:og,WebkitFilter:og},jy=n=>DA[n];function F2(n,e){let t=jy(n);return t!==og&&(t=Ps),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const MA=new Set(["auto","none","0"]);function OA(n,e,t){let i=0,r;for(;i<n.length&&!r;){const o=n[i];typeof o=="string"&&!MA.has(o)&&Qc(o).values.length&&(r=n[i]),i++}if(r&&t)for(const o of e)n[o]=F2(t,r)}const jw=n=>n===yl||n===Ee,Dw=(n,e)=>parseFloat(n.split(", ")[e]),Mw=(n,e)=>(t,{transform:i})=>{if(i==="none"||!i)return 0;const r=i.match(/^matrix3d\((.+)\)$/u);if(r)return Dw(r[1],e);{const o=i.match(/^matrix\((.+)\)$/u);return o?Dw(o[1],n):0}},LA=new Set(["x","y","z"]),VA=gl.filter(n=>!LA.has(n));function FA(n){const e=[];return VA.forEach(t=>{const i=n.getValue(t);i!==void 0&&(e.push([t,i.get()]),i.set(t.startsWith("scale")?1:0))}),e}const il={width:({x:n},{paddingLeft:e="0",paddingRight:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),height:({y:n},{paddingTop:e="0",paddingBottom:t="0"})=>n.max-n.min-parseFloat(e)-parseFloat(t),top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:Mw(4,13),y:Mw(5,14)};il.translateX=il.x;il.translateY=il.y;const Po=new Set;let ag=!1,lg=!1;function U2(){if(lg){const n=Array.from(Po).filter(i=>i.needsMeasurement),e=new Set(n.map(i=>i.element)),t=new Map;e.forEach(i=>{const r=FA(i);r.length&&(t.set(i,r),i.render())}),n.forEach(i=>i.measureInitialState()),e.forEach(i=>{i.render();const r=t.get(i);r&&r.forEach(([o,l])=>{var u;(u=i.getValue(o))===null||u===void 0||u.set(l)})}),n.forEach(i=>i.measureEndState()),n.forEach(i=>{i.suspendedScrollY!==void 0&&window.scrollTo(0,i.suspendedScrollY)})}lg=!1,ag=!1,Po.forEach(n=>n.complete()),Po.clear()}function z2(){Po.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(lg=!0)})}function UA(){z2(),U2()}class Dy{constructor(e,t,i,r,o,l=!1){this.isComplete=!1,this.isAsync=!1,this.needsMeasurement=!1,this.isScheduled=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=i,this.motionValue=r,this.element=o,this.isAsync=l}scheduleResolve(){this.isScheduled=!0,this.isAsync?(Po.add(this),ag||(ag=!0,et.read(z2),et.resolveKeyframes(U2))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:i,motionValue:r}=this;for(let o=0;o<e.length;o++)if(e[o]===null)if(o===0){const l=r==null?void 0:r.get(),u=e[e.length-1];if(l!==void 0)e[0]=l;else if(i&&t){const h=i.readValue(t,u);h!=null&&(e[0]=h)}e[0]===void 0&&(e[0]=u),r&&l===void 0&&r.set(e[0])}else e[o]=e[o-1]}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(){this.isComplete=!0,this.onComplete(this.unresolvedKeyframes,this.finalKeyframe),Po.delete(this)}cancel(){this.isComplete||(this.isScheduled=!1,Po.delete(this))}resume(){this.isComplete||this.scheduleResolve()}}const B2=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),zA=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function BA(n){const e=zA.exec(n);if(!e)return[,];const[,t,i,r]=e;return[`--${t??i}`,r]}function q2(n,e,t=1){const[i,r]=BA(n);if(!i)return;const o=window.getComputedStyle(e).getPropertyValue(i);if(o){const l=o.trim();return B2(l)?parseFloat(l):l}return fy(r)?q2(r,e,t+1):r}const $2=n=>e=>e.test(n),qA={test:n=>n==="auto",parse:n=>n},H2=[yl,Ee,Ki,hs,PP,kP,qA],Ow=n=>H2.find($2(n));class W2 extends Dy{constructor(e,t,i,r,o){super(e,t,i,r,o,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:i}=this;if(!t||!t.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let p=e[h];if(typeof p=="string"&&(p=p.trim(),fy(p))){const g=q2(p,t.current);g!==void 0&&(e[h]=g),h===e.length-1&&(this.finalKeyframe=p)}}if(this.resolveNoneKeyframes(),!b2.has(i)||e.length!==2)return;const[r,o]=e,l=Ow(r),u=Ow(o);if(l!==u)if(jw(l)&&jw(u))for(let h=0;h<e.length;h++){const p=e[h];typeof p=="string"&&(e[h]=parseFloat(p))}else this.needsMeasurement=!0}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,i=[];for(let r=0;r<e.length;r++)xA(e[r])&&i.push(r);i.length&&OA(e,i,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:i}=this;if(!e||!e.current)return;i==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=il[i](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const r=t[t.length-1];r!==void 0&&e.getValue(i,r).jump(r,!1)}measureEndState(){var e;const{element:t,name:i,unresolvedKeyframes:r}=this;if(!t||!t.current)return;const o=t.getValue(i);o&&o.jump(this.measuredOrigin,!1);const l=r.length-1,u=r[l];r[l]=il[i](t.measureViewportBox(),window.getComputedStyle(t.current)),u!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=u),!((e=this.removedTransforms)===null||e===void 0)&&e.length&&this.removedTransforms.forEach(([h,p])=>{t.getValue(h).set(p)}),this.resolveNoneKeyframes()}}const Lw=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Ps.test(n)||n==="0")&&!n.startsWith("url("));function $A(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function HA(n,e,t,i){const r=n[0];if(r===null)return!1;if(e==="display"||e==="visibility")return!0;const o=n[n.length-1],l=Lw(r,e),u=Lw(o,e);return!l||!u?!1:$A(n)||(t==="spring"||Ey(t))&&i}const WA=n=>n!==null;function tf(n,{repeat:e,repeatType:t="loop"},i){const r=n.filter(WA),o=e&&t!=="loop"&&e%2===1?0:r.length-1;return!o||i===void 0?r[o]:i}const GA=40;class G2{constructor({autoplay:e=!0,delay:t=0,type:i="keyframes",repeat:r=0,repeatDelay:o=0,repeatType:l="loop",...u}){this.isStopped=!1,this.hasAttemptedResolve=!1,this.createdAt=Qi.now(),this.options={autoplay:e,delay:t,type:i,repeat:r,repeatDelay:o,repeatType:l,...u},this.updateFinishedPromise()}calcStartTime(){return this.resolvedAt?this.resolvedAt-this.createdAt>GA?this.resolvedAt:this.createdAt:this.createdAt}get resolved(){return!this._resolved&&!this.hasAttemptedResolve&&UA(),this._resolved}onKeyframesResolved(e,t){this.resolvedAt=Qi.now(),this.hasAttemptedResolve=!0;const{name:i,type:r,velocity:o,delay:l,onComplete:u,onUpdate:h,isGenerator:p}=this.options;if(!p&&!HA(e,i,r,o))if(l)this.options.duration=0;else{h&&h(tf(e,this.options,t)),u&&u(),this.resolveFinishedPromise();return}const g=this.initPlayback(e,t);g!==!1&&(this._resolved={keyframes:e,finalKeyframe:t,...g},this.onPostResolved())}onPostResolved(){}then(e,t){return this.currentFinishedPromise.then(e,t)}flatten(){this.options.type="keyframes",this.options.ease="linear"}updateFinishedPromise(){this.currentFinishedPromise=new Promise(e=>{this.resolveFinishedPromise=e})}}const ut=(n,e,t)=>n+(e-n)*t;function mm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function KA({hue:n,saturation:e,lightness:t,alpha:i}){n/=360,e/=100,t/=100;let r=0,o=0,l=0;if(!e)r=o=l=t;else{const u=t<.5?t*(1+e):t+e-t*e,h=2*t-u;r=mm(h,u,n+1/3),o=mm(h,u,n),l=mm(h,u,n-1/3)}return{red:Math.round(r*255),green:Math.round(o*255),blue:Math.round(l*255),alpha:i}}function xd(n,e){return t=>t>0?e:n}const gm=(n,e,t)=>{const i=n*n,r=t*(e*e-i)+i;return r<0?0:Math.sqrt(r)},QA=[sg,So,Ha],YA=n=>QA.find(e=>e.test(n));function Vw(n){const e=YA(n);if(!e)return!1;let t=e.parse(n);return e===Ha&&(t=KA(t)),t}const Fw=(n,e)=>{const t=Vw(n),i=Vw(e);if(!t||!i)return xd(n,e);const r={...t};return o=>(r.red=gm(t.red,i.red,o),r.green=gm(t.green,i.green,o),r.blue=gm(t.blue,i.blue,o),r.alpha=ut(t.alpha,i.alpha,o),So.transform(r))},XA=(n,e)=>t=>e(n(t)),fu=(...n)=>n.reduce(XA),cg=new Set(["none","hidden"]);function JA(n,e){return cg.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function ZA(n,e){return t=>ut(n,e,t)}function My(n){return typeof n=="number"?ZA:typeof n=="string"?fy(n)?xd:on.test(n)?Fw:nN:Array.isArray(n)?K2:typeof n=="object"?on.test(n)?Fw:eN:xd}function K2(n,e){const t=[...n],i=t.length,r=n.map((o,l)=>My(o)(o,e[l]));return o=>{for(let l=0;l<i;l++)t[l]=r[l](o);return t}}function eN(n,e){const t={...n,...e},i={};for(const r in t)n[r]!==void 0&&e[r]!==void 0&&(i[r]=My(n[r])(n[r],e[r]));return r=>{for(const o in i)t[o]=i[o](r);return t}}function tN(n,e){var t;const i=[],r={color:0,var:0,number:0};for(let o=0;o<e.values.length;o++){const l=e.types[o],u=n.indexes[l][r[l]],h=(t=n.values[u])!==null&&t!==void 0?t:0;i[o]=h,r[l]++}return i}const nN=(n,e)=>{const t=Ps.createTransformer(e),i=Qc(n),r=Qc(e);return i.indexes.var.length===r.indexes.var.length&&i.indexes.color.length===r.indexes.color.length&&i.indexes.number.length>=r.indexes.number.length?cg.has(n)&&!r.values.length||cg.has(e)&&!i.values.length?JA(n,e):fu(K2(tN(i,r),r.values),t):xd(n,e)};function Q2(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?ut(n,e,t):My(n)(n,e)}const iN=5;function Y2(n,e,t){const i=Math.max(e-iN,0);return E2(t-n(i),e-i)}const pt={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},Uw=.001;function rN({duration:n=pt.duration,bounce:e=pt.bounce,velocity:t=pt.velocity,mass:i=pt.mass}){let r,o,l=1-e;l=Nr(pt.minDamping,pt.maxDamping,l),n=Nr(pt.minDuration,pt.maxDuration,Cr(n)),l<1?(r=p=>{const g=p*l,y=g*n,x=g-t,b=ug(p,l),T=Math.exp(-y);return Uw-x/b*T},o=p=>{const y=p*l*n,x=y*t+t,b=Math.pow(l,2)*Math.pow(p,2)*n,T=Math.exp(-y),C=ug(Math.pow(p,2),l);return(-r(p)+Uw>0?-1:1)*((x-b)*T)/C}):(r=p=>{const g=Math.exp(-p*n),y=(p-t)*n+1;return-.001+g*y},o=p=>{const g=Math.exp(-p*n),y=(t-p)*(n*n);return g*y});const u=5/n,h=oN(r,o,u);if(n=Sr(n),isNaN(h))return{stiffness:pt.stiffness,damping:pt.damping,duration:n};{const p=Math.pow(h,2)*i;return{stiffness:p,damping:l*2*Math.sqrt(i*p),duration:n}}}const sN=12;function oN(n,e,t){let i=t;for(let r=1;r<sN;r++)i=i-n(i)/e(i);return i}function ug(n,e){return n*Math.sqrt(1-e*e)}const aN=["duration","bounce"],lN=["stiffness","damping","mass"];function zw(n,e){return e.some(t=>n[t]!==void 0)}function cN(n){let e={velocity:pt.velocity,stiffness:pt.stiffness,damping:pt.damping,mass:pt.mass,isResolvedFromDuration:!1,...n};if(!zw(n,lN)&&zw(n,aN))if(n.visualDuration){const t=n.visualDuration,i=2*Math.PI/(t*1.2),r=i*i,o=2*Nr(.05,1,1-(n.bounce||0))*Math.sqrt(r);e={...e,mass:pt.mass,stiffness:r,damping:o}}else{const t=rN(n);e={...e,...t,mass:pt.mass},e.isResolvedFromDuration=!0}return e}function X2(n=pt.visualDuration,e=pt.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:i,restDelta:r}=t;const o=t.keyframes[0],l=t.keyframes[t.keyframes.length-1],u={done:!1,value:o},{stiffness:h,damping:p,mass:g,duration:y,velocity:x,isResolvedFromDuration:b}=cN({...t,velocity:-Cr(t.velocity||0)}),T=x||0,C=p/(2*Math.sqrt(h*g)),I=l-o,N=Cr(Math.sqrt(h/g)),D=Math.abs(I)<5;i||(i=D?pt.restSpeed.granular:pt.restSpeed.default),r||(r=D?pt.restDelta.granular:pt.restDelta.default);let O;if(C<1){const G=ug(N,C);O=X=>{const k=Math.exp(-C*N*X);return l-k*((T+C*N*I)/G*Math.sin(G*X)+I*Math.cos(G*X))}}else if(C===1)O=G=>l-Math.exp(-N*G)*(I+(T+N*I)*G);else{const G=N*Math.sqrt(C*C-1);O=X=>{const k=Math.exp(-C*N*X),P=Math.min(G*X,300);return l-k*((T+C*N*I)*Math.sinh(P)+G*I*Math.cosh(P))/G}}const L={calculatedDuration:b&&y||null,next:G=>{const X=O(G);if(b)u.done=G>=y;else{let k=0;C<1&&(k=G===0?Sr(T):Y2(O,G,X));const P=Math.abs(k)<=i,R=Math.abs(l-X)<=r;u.done=P&&R}return u.value=u.done?l:X,u},toString:()=>{const G=Math.min(m2(L),ng),X=g2(k=>L.next(G*k).value,G,30);return G+"ms "+X}};return L}function Bw({keyframes:n,velocity:e=0,power:t=.8,timeConstant:i=325,bounceDamping:r=10,bounceStiffness:o=500,modifyTarget:l,min:u,max:h,restDelta:p=.5,restSpeed:g}){const y=n[0],x={done:!1,value:y},b=P=>u!==void 0&&P<u||h!==void 0&&P>h,T=P=>u===void 0?h:h===void 0||Math.abs(u-P)<Math.abs(h-P)?u:h;let C=t*e;const I=y+C,N=l===void 0?I:l(I);N!==I&&(C=N-y);const D=P=>-C*Math.exp(-P/i),O=P=>N+D(P),L=P=>{const R=D(P),F=O(P);x.done=Math.abs(R)<=p,x.value=x.done?N:F};let G,X;const k=P=>{b(x.value)&&(G=P,X=X2({keyframes:[x.value,T(x.value)],velocity:Y2(O,P,x.value),damping:r,stiffness:o,restDelta:p,restSpeed:g}))};return k(0),{calculatedDuration:null,next:P=>{let R=!1;return!X&&G===void 0&&(R=!0,L(P),k(P)),G!==void 0&&P>=G?X.next(P-G):(!R&&L(P),x)}}}const uN=du(.42,0,1,1),hN=du(0,0,.58,1),J2=du(.42,0,.58,1),dN=n=>Array.isArray(n)&&typeof n[0]!="number",fN={linear:qn,easeIn:uN,easeInOut:J2,easeOut:hN,circIn:Ay,circInOut:R2,circOut:N2,backIn:Py,backInOut:P2,backOut:k2,anticipate:A2},qw=n=>{if(Ty(n)){Y1(n.length===4);const[e,t,i,r]=n;return du(e,t,i,r)}else if(typeof n=="string")return fN[n];return n};function pN(n,e,t){const i=[],r=t||Q2,o=n.length-1;for(let l=0;l<o;l++){let u=r(n[l],n[l+1]);if(e){const h=Array.isArray(e)?e[l]||qn:e;u=fu(h,u)}i.push(u)}return i}function mN(n,e,{clamp:t=!0,ease:i,mixer:r}={}){const o=n.length;if(Y1(o===e.length),o===1)return()=>e[0];if(o===2&&e[0]===e[1])return()=>e[1];const l=n[0]===n[1];n[0]>n[o-1]&&(n=[...n].reverse(),e=[...e].reverse());const u=pN(e,i,r),h=u.length,p=g=>{if(l&&g<n[0])return e[0];let y=0;if(h>1)for(;y<n.length-2&&!(g<n[y+1]);y++);const x=tl(n[y],n[y+1],g);return u[y](x)};return t?g=>p(Nr(n[0],n[o-1],g)):p}function gN(n,e){const t=n[n.length-1];for(let i=1;i<=e;i++){const r=tl(0,e,i);n.push(ut(t,1,r))}}function yN(n){const e=[0];return gN(e,n.length-1),e}function vN(n,e){return n.map(t=>t*e)}function xN(n,e){return n.map(()=>e||J2).splice(0,n.length-1)}function wd({duration:n=300,keyframes:e,times:t,ease:i="easeInOut"}){const r=dN(i)?i.map(qw):qw(i),o={done:!1,value:e[0]},l=vN(t&&t.length===e.length?t:yN(e),n),u=mN(l,e,{ease:Array.isArray(r)?r:xN(e,r)});return{calculatedDuration:n,next:h=>(o.value=u(h),o.done=h>=n,o)}}const wN=n=>{const e=({timestamp:t})=>n(t);return{start:()=>et.update(e,!0),stop:()=>ks(e),now:()=>Qt.isProcessing?Qt.timestamp:Qi.now()}},_N={decay:Bw,inertia:Bw,tween:wd,keyframes:wd,spring:X2},bN=n=>n/100;class Oy extends G2{constructor(e){super(e),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:h}=this.options;h&&h()};const{name:t,motionValue:i,element:r,keyframes:o}=this.options,l=(r==null?void 0:r.KeyframeResolver)||Dy,u=(h,p)=>this.onKeyframesResolved(h,p);this.resolver=new l(o,u,t,i,r),this.resolver.scheduleResolve()}flatten(){super.flatten(),this._resolved&&Object.assign(this._resolved,this.initPlayback(this._resolved.keyframes))}initPlayback(e){const{type:t="keyframes",repeat:i=0,repeatDelay:r=0,repeatType:o,velocity:l=0}=this.options,u=Ey(t)?t:_N[t]||wd;let h,p;u!==wd&&typeof e[0]!="number"&&(h=fu(bN,Q2(e[0],e[1])),e=[0,100]);const g=u({...this.options,keyframes:e});o==="mirror"&&(p=u({...this.options,keyframes:[...e].reverse(),velocity:-l})),g.calculatedDuration===null&&(g.calculatedDuration=m2(g));const{calculatedDuration:y}=g,x=y+r,b=x*(i+1)-r;return{generator:g,mirroredGenerator:p,mapPercentToKeyframes:h,calculatedDuration:y,resolvedDuration:x,totalDuration:b}}onPostResolved(){const{autoplay:e=!0}=this.options;this.play(),this.pendingPlayState==="paused"||!e?this.pause():this.state=this.pendingPlayState}tick(e,t=!1){const{resolved:i}=this;if(!i){const{keyframes:P}=this.options;return{done:!0,value:P[P.length-1]}}const{finalKeyframe:r,generator:o,mirroredGenerator:l,mapPercentToKeyframes:u,keyframes:h,calculatedDuration:p,totalDuration:g,resolvedDuration:y}=i;if(this.startTime===null)return o.next(0);const{delay:x,repeat:b,repeatType:T,repeatDelay:C,onUpdate:I}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-g/this.speed,this.startTime)),t?this.currentTime=e:this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=Math.round(e-this.startTime)*this.speed;const N=this.currentTime-x*(this.speed>=0?1:-1),D=this.speed>=0?N<0:N>g;this.currentTime=Math.max(N,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=g);let O=this.currentTime,L=o;if(b){const P=Math.min(this.currentTime,g)/y;let R=Math.floor(P),F=P%1;!F&&P>=1&&(F=1),F===1&&R--,R=Math.min(R,b+1),!!(R%2)&&(T==="reverse"?(F=1-F,C&&(F-=C/y)):T==="mirror"&&(L=l)),O=Nr(0,1,F)*y}const G=D?{done:!1,value:h[0]}:L.next(O);u&&(G.value=u(G.value));let{done:X}=G;!D&&p!==null&&(X=this.speed>=0?this.currentTime>=g:this.currentTime<=0);const k=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&X);return k&&r!==void 0&&(G.value=tf(h,this.options,r)),I&&I(G.value),k&&this.finish(),G}get duration(){const{resolved:e}=this;return e?Cr(e.calculatedDuration):0}get time(){return Cr(this.currentTime)}set time(e){e=Sr(e),this.currentTime=e,this.holdTime!==null||this.speed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.speed)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;this.playbackSpeed=e,t&&(this.time=Cr(this.currentTime))}play(){if(this.resolver.isScheduled||this.resolver.resume(),!this._resolved){this.pendingPlayState="running";return}if(this.isStopped)return;const{driver:e=wN,onPlay:t,startTime:i}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),t&&t();const r=this.driver.now();this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime?this.state==="finished"&&(this.startTime=r):this.startTime=i??this.calcStartTime(),this.state==="finished"&&this.updateFinishedPromise(),this.cancelTime=this.startTime,this.holdTime=null,this.state="running",this.driver.start()}pause(){var e;if(!this._resolved){this.pendingPlayState="paused";return}this.state="paused",this.holdTime=(e=this.currentTime)!==null&&e!==void 0?e:0}complete(){this.state!=="running"&&this.play(),this.pendingPlayState=this.state="finished",this.holdTime=null}finish(){this.teardown(),this.state="finished";const{onComplete:e}=this.options;e&&e()}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(e){return this.startTime=0,this.tick(e,!0)}}const EN=new Set(["opacity","clipPath","filter","transform"]);function TN(n,e,t,{delay:i=0,duration:r=300,repeat:o=0,repeatType:l="loop",ease:u="easeInOut",times:h}={}){const p={[e]:t};h&&(p.offset=h);const g=v2(u,r);return Array.isArray(g)&&(p.easing=g),n.animate(p,{delay:i,duration:r,easing:Array.isArray(g)?"linear":g,fill:"both",iterations:o+1,direction:l==="reverse"?"alternate":"normal"})}const SN=ay(()=>Object.hasOwnProperty.call(Element.prototype,"animate")),_d=10,CN=2e4;function IN(n){return Ey(n.type)||n.type==="spring"||!y2(n.ease)}function kN(n,e){const t=new Oy({...e,keyframes:n,repeat:0,delay:0,isGenerator:!0});let i={done:!1,value:n[0]};const r=[];let o=0;for(;!i.done&&o<CN;)i=t.sample(o),r.push(i.value),o+=_d;return{times:void 0,keyframes:r,duration:o-_d,ease:"linear"}}const Z2={anticipate:A2,backInOut:P2,circInOut:R2};function PN(n){return n in Z2}class $w extends G2{constructor(e){super(e);const{name:t,motionValue:i,element:r,keyframes:o}=this.options;this.resolver=new W2(o,(l,u)=>this.onKeyframesResolved(l,u),t,i,r),this.resolver.scheduleResolve()}initPlayback(e,t){let{duration:i=300,times:r,ease:o,type:l,motionValue:u,name:h,startTime:p}=this.options;if(!u.owner||!u.owner.current)return!1;if(typeof o=="string"&&vd()&&PN(o)&&(o=Z2[o]),IN(this.options)){const{onComplete:y,onUpdate:x,motionValue:b,element:T,...C}=this.options,I=kN(e,C);e=I.keyframes,e.length===1&&(e[1]=e[0]),i=I.duration,r=I.times,o=I.ease,l="keyframes"}const g=TN(u.owner.current,h,e,{...this.options,duration:i,times:r,ease:o});return g.startTime=p??this.calcStartTime(),this.pendingTimeline?(Iw(g,this.pendingTimeline),this.pendingTimeline=void 0):g.onfinish=()=>{const{onComplete:y}=this.options;u.set(tf(e,this.options,t)),y&&y(),this.cancel(),this.resolveFinishedPromise()},{animation:g,duration:i,times:r,type:l,ease:o,keyframes:e}}get duration(){const{resolved:e}=this;if(!e)return 0;const{duration:t}=e;return Cr(t)}get time(){const{resolved:e}=this;if(!e)return 0;const{animation:t}=e;return Cr(t.currentTime||0)}set time(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.currentTime=Sr(e)}get speed(){const{resolved:e}=this;if(!e)return 1;const{animation:t}=e;return t.playbackRate}set speed(e){const{resolved:t}=this;if(!t)return;const{animation:i}=t;i.playbackRate=e}get state(){const{resolved:e}=this;if(!e)return"idle";const{animation:t}=e;return t.playState}get startTime(){const{resolved:e}=this;if(!e)return null;const{animation:t}=e;return t.startTime}attachTimeline(e){if(!this._resolved)this.pendingTimeline=e;else{const{resolved:t}=this;if(!t)return qn;const{animation:i}=t;Iw(i,e)}return qn}play(){if(this.isStopped)return;const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.playState==="finished"&&this.updateFinishedPromise(),t.play()}pause(){const{resolved:e}=this;if(!e)return;const{animation:t}=e;t.pause()}stop(){if(this.resolver.cancel(),this.isStopped=!0,this.state==="idle")return;this.resolveFinishedPromise(),this.updateFinishedPromise();const{resolved:e}=this;if(!e)return;const{animation:t,keyframes:i,duration:r,type:o,ease:l,times:u}=e;if(t.playState==="idle"||t.playState==="finished")return;if(this.time){const{motionValue:p,onUpdate:g,onComplete:y,element:x,...b}=this.options,T=new Oy({...b,keyframes:i,duration:r,type:o,ease:l,times:u,isGenerator:!0}),C=Sr(this.time);p.setWithVelocity(T.sample(C-_d).value,T.sample(C).value,_d)}const{onStop:h}=this.options;h&&h(),this.cancel()}complete(){const{resolved:e}=this;e&&e.animation.finish()}cancel(){const{resolved:e}=this;e&&e.animation.cancel()}static supports(e){const{motionValue:t,name:i,repeatDelay:r,repeatType:o,damping:l,type:u}=e;if(!t||!t.owner||!(t.owner.current instanceof HTMLElement))return!1;const{onUpdate:h,transformTemplate:p}=t.owner.getProps();return SN()&&i&&EN.has(i)&&!h&&!p&&!r&&o!=="mirror"&&l!==0&&u!=="inertia"}}const AN={type:"spring",stiffness:500,damping:25,restSpeed:10},NN=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),RN={type:"keyframes",duration:.8},jN={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},DN=(n,{keyframes:e})=>e.length>2?RN:zo.has(n)?n.startsWith("scale")?NN(e[1]):AN:jN;function MN({when:n,delay:e,delayChildren:t,staggerChildren:i,staggerDirection:r,repeat:o,repeatType:l,repeatDelay:u,from:h,elapsed:p,...g}){return!!Object.keys(g).length}const Ly=(n,e,t,i={},r,o)=>l=>{const u=by(i,n)||{},h=u.delay||i.delay||0;let{elapsed:p=0}=i;p=p-Sr(h);let g={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...u,delay:-p,onUpdate:x=>{e.set(x),u.onUpdate&&u.onUpdate(x)},onComplete:()=>{l(),u.onComplete&&u.onComplete()},name:n,motionValue:e,element:o?void 0:r};MN(u)||(g={...g,...DN(n,g)}),g.duration&&(g.duration=Sr(g.duration)),g.repeatDelay&&(g.repeatDelay=Sr(g.repeatDelay)),g.from!==void 0&&(g.keyframes[0]=g.from);let y=!1;if((g.type===!1||g.duration===0&&!g.repeatDelay)&&(g.duration=0,g.delay===0&&(y=!0)),y&&!o&&e.get()!==void 0){const x=tf(g.keyframes,u);if(x!==void 0)return et.update(()=>{g.onUpdate(x),g.onComplete()}),new eA([])}return!o&&$w.supports(g)?new $w(g):new Oy(g)};function ON({protectedKeys:n,needsAnimating:e},t){const i=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,i}function eE(n,e,{delay:t=0,transitionOverride:i,type:r}={}){var o;let{transition:l=n.getDefaultTransition(),transitionEnd:u,...h}=e;i&&(l=i);const p=[],g=r&&n.animationState&&n.animationState.getState()[r];for(const y in h){const x=n.getValue(y,(o=n.latestValues[y])!==null&&o!==void 0?o:null),b=h[y];if(b===void 0||g&&ON(g,y))continue;const T={delay:t,...by(l||{},y)};let C=!1;if(window.MotionHandoffAnimation){const N=T2(n);if(N){const D=window.MotionHandoffAnimation(N,y,et);D!==null&&(T.startTime=D,C=!0)}}rg(n,y),x.start(Ly(y,x,b,n.shouldReduceMotion&&b2.has(y)?{type:!1}:T,n,C));const I=x.animation;I&&p.push(I)}return u&&Promise.all(p).then(()=>{et.update(()=>{u&&pA(n,u)})}),p}function hg(n,e,t={}){var i;const r=ef(n,e,t.type==="exit"?(i=n.presenceContext)===null||i===void 0?void 0:i.custom:void 0);let{transition:o=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(o=t.transitionOverride);const l=r?()=>Promise.all(eE(n,r,t)):()=>Promise.resolve(),u=n.variantChildren&&n.variantChildren.size?(p=0)=>{const{delayChildren:g=0,staggerChildren:y,staggerDirection:x}=o;return LN(n,e,g+p,y,x,t)}:()=>Promise.resolve(),{when:h}=o;if(h){const[p,g]=h==="beforeChildren"?[l,u]:[u,l];return p().then(()=>g())}else return Promise.all([l(),u(t.delay)])}function LN(n,e,t=0,i=0,r=1,o){const l=[],u=(n.variantChildren.size-1)*i,h=r===1?(p=0)=>p*i:(p=0)=>u-p*i;return Array.from(n.variantChildren).sort(VN).forEach((p,g)=>{p.notify("AnimationStart",e),l.push(hg(p,e,{...o,delay:t+h(g)}).then(()=>p.notify("AnimationComplete",e)))}),Promise.all(l)}function VN(n,e){return n.sortNodePosition(e)}function FN(n,e,t={}){n.notify("AnimationStart",e);let i;if(Array.isArray(e)){const r=e.map(o=>hg(n,o,t));i=Promise.all(r)}else if(typeof e=="string")i=hg(n,e,t);else{const r=typeof e=="function"?ef(n,e,t.custom):e;i=Promise.all(eE(n,r,t))}return i.then(()=>{n.notify("AnimationComplete",e)})}function tE(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let i=0;i<t;i++)if(e[i]!==n[i])return!1;return!0}const UN=cy.length;function nE(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?nE(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;t<UN;t++){const i=cy[t],r=n.props[i];(Hc(r)||r===!1)&&(e[i]=r)}return e}const zN=[...ly].reverse(),BN=ly.length;function qN(n){return e=>Promise.all(e.map(({animation:t,options:i})=>FN(n,t,i)))}function $N(n){let e=qN(n),t=Hw(),i=!0;const r=h=>(p,g)=>{var y;const x=ef(n,g,h==="exit"?(y=n.presenceContext)===null||y===void 0?void 0:y.custom:void 0);if(x){const{transition:b,transitionEnd:T,...C}=x;p={...p,...C,...T}}return p};function o(h){e=h(n)}function l(h){const{props:p}=n,g=nE(n.parent)||{},y=[],x=new Set;let b={},T=1/0;for(let I=0;I<BN;I++){const N=zN[I],D=t[N],O=p[N]!==void 0?p[N]:g[N],L=Hc(O),G=N===h?D.isActive:null;G===!1&&(T=I);let X=O===g[N]&&O!==p[N]&&L;if(X&&i&&n.manuallyAnimateOnMount&&(X=!1),D.protectedKeys={...b},!D.isActive&&G===null||!O&&!D.prevProp||Jd(O)||typeof O=="boolean")continue;const k=HN(D.prevProp,O);let P=k||N===h&&D.isActive&&!X&&L||I>T&&L,R=!1;const F=Array.isArray(O)?O:[O];let z=F.reduce(r(N),{});G===!1&&(z={});const{prevResolvedValues:q={}}=D,M={...q,...z},qe=ke=>{P=!0,x.has(ke)&&(R=!0,x.delete(ke)),D.needsAnimating[ke]=!0;const oe=n.getValue(ke);oe&&(oe.liveStyle=!1)};for(const ke in M){const oe=z[ke],ge=q[ke];if(b.hasOwnProperty(ke))continue;let le=!1;tg(oe)&&tg(ge)?le=!tE(oe,ge):le=oe!==ge,le?oe!=null?qe(ke):x.add(ke):oe!==void 0&&x.has(ke)?qe(ke):D.protectedKeys[ke]=!0}D.prevProp=O,D.prevResolvedValues=z,D.isActive&&(b={...b,...z}),i&&n.blockInitialAnimation&&(P=!1),P&&(!(X&&k)||R)&&y.push(...F.map(ke=>({animation:ke,options:{type:N}})))}if(x.size){const I={};x.forEach(N=>{const D=n.getBaseTarget(N),O=n.getValue(N);O&&(O.liveStyle=!0),I[N]=D??null}),y.push({animation:I})}let C=!!y.length;return i&&(p.initial===!1||p.initial===p.animate)&&!n.manuallyAnimateOnMount&&(C=!1),i=!1,C?e(y):Promise.resolve()}function u(h,p){var g;if(t[h].isActive===p)return Promise.resolve();(g=n.variantChildren)===null||g===void 0||g.forEach(x=>{var b;return(b=x.animationState)===null||b===void 0?void 0:b.setActive(h,p)}),t[h].isActive=p;const y=l(h);for(const x in t)t[x].protectedKeys={};return y}return{animateChanges:l,setActive:u,setAnimateFunction:o,getState:()=>t,reset:()=>{t=Hw(),i=!0}}}function HN(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!tE(e,n):!1}function _o(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function Hw(){return{animate:_o(!0),whileInView:_o(),whileHover:_o(),whileTap:_o(),whileDrag:_o(),whileFocus:_o(),exit:_o()}}class Vs{constructor(e){this.isMounted=!1,this.node=e}update(){}}class WN extends Vs{constructor(e){super(e),e.animationState||(e.animationState=$N(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();Jd(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)===null||e===void 0||e.call(this)}}let GN=0;class KN extends Vs{constructor(){super(...arguments),this.id=GN++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:i}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===i)return;const r=this.node.animationState.setActive("exit",!e);t&&!e&&r.then(()=>{t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const QN={animation:{Feature:WN},exit:{Feature:KN}};function Yc(n,e,t,i={passive:!0}){return n.addEventListener(e,t,i),()=>n.removeEventListener(e,t)}function pu(n){return{point:{x:n.pageX,y:n.pageY}}}const YN=n=>e=>Sy(e)&&n(e,pu(e));function jc(n,e,t,i){return Yc(n,e,YN(t),i)}const Ww=(n,e)=>Math.abs(n-e);function XN(n,e){const t=Ww(n.x,e.x),i=Ww(n.y,e.y);return Math.sqrt(t**2+i**2)}class iE{constructor(e,t,{transformPagePoint:i,contextWindow:r,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 y=vm(this.lastMoveEventInfo,this.history),x=this.startEvent!==null,b=XN(y.offset,{x:0,y:0})>=3;if(!x&&!b)return;const{point:T}=y,{timestamp:C}=Qt;this.history.push({...T,timestamp:C});const{onStart:I,onMove:N}=this.handlers;x||(I&&I(this.lastMoveEvent,y),this.startEvent=this.lastMoveEvent),N&&N(this.lastMoveEvent,y)},this.handlePointerMove=(y,x)=>{this.lastMoveEvent=y,this.lastMoveEventInfo=ym(x,this.transformPagePoint),et.update(this.updatePoint,!0)},this.handlePointerUp=(y,x)=>{this.end();const{onEnd:b,onSessionEnd:T,resumeAnimation:C}=this.handlers;if(this.dragSnapToOrigin&&C&&C(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const I=vm(y.type==="pointercancel"?this.lastMoveEventInfo:ym(x,this.transformPagePoint),this.history);this.startEvent&&b&&b(y,I),T&&T(y,I)},!Sy(e))return;this.dragSnapToOrigin=o,this.handlers=t,this.transformPagePoint=i,this.contextWindow=r||window;const l=pu(e),u=ym(l,this.transformPagePoint),{point:h}=u,{timestamp:p}=Qt;this.history=[{...h,timestamp:p}];const{onSessionStart:g}=t;g&&g(e,vm(u,this.history)),this.removeListeners=fu(jc(this.contextWindow,"pointermove",this.handlePointerMove),jc(this.contextWindow,"pointerup",this.handlePointerUp),jc(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),ks(this.updatePoint)}}function ym(n,e){return e?{point:e(n.point)}:n}function Gw(n,e){return{x:n.x-e.x,y:n.y-e.y}}function vm({point:n},e){return{point:n,delta:Gw(n,rE(e)),offset:Gw(n,JN(e)),velocity:ZN(e,.1)}}function JN(n){return n[0]}function rE(n){return n[n.length-1]}function ZN(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,i=null;const r=rE(n);for(;t>=0&&(i=n[t],!(r.timestamp-i.timestamp>Sr(e)));)t--;if(!i)return{x:0,y:0};const o=Cr(r.timestamp-i.timestamp);if(o===0)return{x:0,y:0};const l={x:(r.x-i.x)/o,y:(r.y-i.y)/o};return l.x===1/0&&(l.x=0),l.y===1/0&&(l.y=0),l}const sE=1e-4,eR=1-sE,tR=1+sE,oE=.01,nR=0-oE,iR=0+oE;function vn(n){return n.max-n.min}function rR(n,e,t){return Math.abs(n-e)<=t}function Kw(n,e,t,i=.5){n.origin=i,n.originPoint=ut(e.min,e.max,n.origin),n.scale=vn(t)/vn(e),n.translate=ut(t.min,t.max,n.origin)-n.originPoint,(n.scale>=eR&&n.scale<=tR||isNaN(n.scale))&&(n.scale=1),(n.translate>=nR&&n.translate<=iR||isNaN(n.translate))&&(n.translate=0)}function Dc(n,e,t,i){Kw(n.x,e.x,t.x,i?i.originX:void 0),Kw(n.y,e.y,t.y,i?i.originY:void 0)}function Qw(n,e,t){n.min=t.min+e.min,n.max=n.min+vn(e)}function sR(n,e,t){Qw(n.x,e.x,t.x),Qw(n.y,e.y,t.y)}function Yw(n,e,t){n.min=e.min-t.min,n.max=n.min+vn(e)}function Mc(n,e,t){Yw(n.x,e.x,t.x),Yw(n.y,e.y,t.y)}function oR(n,{min:e,max:t},i){return e!==void 0&&n<e?n=i?ut(e,n,i.min):Math.max(n,e):t!==void 0&&n>t&&(n=i?ut(t,n,i.max):Math.min(n,t)),n}function Xw(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function aR(n,{top:e,left:t,bottom:i,right:r}){return{x:Xw(n.x,t,r),y:Xw(n.y,e,i)}}function Jw(n,e){let t=e.min-n.min,i=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,i]=[i,t]),{min:t,max:i}}function lR(n,e){return{x:Jw(n.x,e.x),y:Jw(n.y,e.y)}}function cR(n,e){let t=.5;const i=vn(n),r=vn(e);return r>i?t=tl(e.min,e.max-i,n.min):i>r&&(t=tl(n.min,n.max-r,e.min)),Nr(0,1,t)}function uR(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const dg=.35;function hR(n=dg){return n===!1?n=0:n===!0&&(n=dg),{x:Zw(n,"left","right"),y:Zw(n,"top","bottom")}}function Zw(n,e,t){return{min:e_(n,e),max:e_(n,t)}}function e_(n,e){return typeof n=="number"?n:n[e]||0}const t_=()=>({translate:0,scale:1,origin:0,originPoint:0}),Wa=()=>({x:t_(),y:t_()}),n_=()=>({min:0,max:0}),vt=()=>({x:n_(),y:n_()});function si(n){return[n("x"),n("y")]}function aE({top:n,left:e,right:t,bottom:i}){return{x:{min:e,max:t},y:{min:n,max:i}}}function dR({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function fR(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),i=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:i.y,right:i.x}}function xm(n){return n===void 0||n===1}function fg({scale:n,scaleX:e,scaleY:t}){return!xm(n)||!xm(e)||!xm(t)}function bo(n){return fg(n)||lE(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function lE(n){return i_(n.x)||i_(n.y)}function i_(n){return n&&n!=="0%"}function bd(n,e,t){const i=n-t,r=e*i;return t+r}function r_(n,e,t,i,r){return r!==void 0&&(n=bd(n,r,i)),bd(n,t,i)+e}function pg(n,e=0,t=1,i,r){n.min=r_(n.min,e,t,i,r),n.max=r_(n.max,e,t,i,r)}function cE(n,{x:e,y:t}){pg(n.x,e.translate,e.scale,e.originPoint),pg(n.y,t.translate,t.scale,t.originPoint)}const s_=.999999999999,o_=1.0000000000001;function pR(n,e,t,i=!1){const r=t.length;if(!r)return;e.x=e.y=1;let o,l;for(let u=0;u<r;u++){o=t[u],l=o.projectionDelta;const{visualElement:h}=o.options;h&&h.props.style&&h.props.style.display==="contents"||(i&&o.options.layoutScroll&&o.scroll&&o!==o.root&&Ka(n,{x:-o.scroll.offset.x,y:-o.scroll.offset.y}),l&&(e.x*=l.x.scale,e.y*=l.y.scale,cE(n,l)),i&&bo(o.latestValues)&&Ka(n,o.latestValues))}e.x<o_&&e.x>s_&&(e.x=1),e.y<o_&&e.y>s_&&(e.y=1)}function Ga(n,e){n.min=n.min+e,n.max=n.max+e}function a_(n,e,t,i,r=.5){const o=ut(n.min,n.max,r);pg(n,e,t,o,i)}function Ka(n,e){a_(n.x,e.x,e.scaleX,e.scale,e.originX),a_(n.y,e.y,e.scaleY,e.scale,e.originY)}function uE(n,e){return aE(fR(n.getBoundingClientRect(),e))}function mR(n,e,t){const i=uE(n,t),{scroll:r}=e;return r&&(Ga(i.x,r.offset.x),Ga(i.y,r.offset.y)),i}const hE=({current:n})=>n?n.ownerDocument.defaultView:null,gR=new WeakMap;class yR{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=vt(),this.visualElement=e}start(e,{snapToCursor:t=!1}={}){const{presenceContext:i}=this.visualElement;if(i&&i.isPresent===!1)return;const r=g=>{const{dragSnapToOrigin:y}=this.getProps();y?this.pauseAnimation():this.stopAnimation(),t&&this.snapToCursor(pu(g).point)},o=(g,y)=>{const{drag:x,dragPropagation:b,onDragStart:T}=this.getProps();if(x&&!b&&(this.openDragLock&&this.openDragLock(),this.openDragLock=cA(x),!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),si(I=>{let N=this.getAxisMotionValue(I).get()||0;if(Ki.test(N)){const{projection:D}=this.visualElement;if(D&&D.layout){const O=D.layout.layoutBox[I];O&&(N=vn(O)*(parseFloat(N)/100))}}this.originPoint[I]=N}),T&&et.postRender(()=>T(g,y)),rg(this.visualElement,"transform");const{animationState:C}=this.visualElement;C&&C.setActive("whileDrag",!0)},l=(g,y)=>{const{dragPropagation:x,dragDirectionLock:b,onDirectionLock:T,onDrag:C}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:I}=y;if(b&&this.currentDirection===null){this.currentDirection=vR(I),this.currentDirection!==null&&T&&T(this.currentDirection);return}this.updateAxis("x",y.point,I),this.updateAxis("y",y.point,I),this.visualElement.render(),C&&C(g,y)},u=(g,y)=>this.stop(g,y),h=()=>si(g=>{var y;return this.getAnimationState(g)==="paused"&&((y=this.getAxisMotionValue(g).animation)===null||y===void 0?void 0:y.play())}),{dragSnapToOrigin:p}=this.getProps();this.panSession=new iE(e,{onSessionStart:r,onStart:o,onMove:l,onSessionEnd:u,resumeAnimation:h},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:p,contextWindow:hE(this.visualElement)})}stop(e,t){const i=this.isDragging;if(this.cancel(),!i)return;const{velocity:r}=t;this.startAnimation(r);const{onDragEnd:o}=this.getProps();o&&et.postRender(()=>o(e,t))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:i}=this.getProps();!i&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}updateAxis(e,t,i){const{drag:r}=this.getProps();if(!i||!Wh(e,r,this.currentDirection))return;const o=this.getAxisMotionValue(e);let l=this.originPoint[e]+i[e];this.constraints&&this.constraints[e]&&(l=oR(l,this.constraints[e],this.elastic[e])),o.set(l)}resolveConstraints(){var e;const{dragConstraints:t,dragElastic:i}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(e=this.visualElement.projection)===null||e===void 0?void 0:e.layout,o=this.constraints;t&&$a(t)?this.constraints||(this.constraints=this.resolveRefConstraints()):t&&r?this.constraints=aR(r.layoutBox,t):this.constraints=!1,this.elastic=hR(i),o!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&si(l=>{this.constraints!==!1&&this.getAxisMotionValue(l)&&(this.constraints[l]=uR(r.layoutBox[l],this.constraints[l]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!$a(e))return!1;const i=e.current,{projection:r}=this.visualElement;if(!r||!r.layout)return!1;const o=mR(i,r.root,this.visualElement.getTransformPagePoint());let l=lR(r.layout.layoutBox,o);if(t){const u=t(dR(l));this.hasMutatedConstraints=!!u,u&&(l=aE(u))}return l}startAnimation(e){const{drag:t,dragMomentum:i,dragElastic:r,dragTransition:o,dragSnapToOrigin:l,onDragTransitionEnd:u}=this.getProps(),h=this.constraints||{},p=si(g=>{if(!Wh(g,t,this.currentDirection))return;let y=h&&h[g]||{};l&&(y={min:0,max:0});const x=r?200:1e6,b=r?40:1e7,T={type:"inertia",velocity:i?e[g]:0,bounceStiffness:x,bounceDamping:b,timeConstant:750,restDelta:1,restSpeed:10,...o,...y};return this.startAxisValueAnimation(g,T)});return Promise.all(p).then(u)}startAxisValueAnimation(e,t){const i=this.getAxisMotionValue(e);return rg(this.visualElement,e),i.start(Ly(e,i,0,t,this.visualElement,!1))}stopAnimation(){si(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){si(e=>{var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.pause()})}getAnimationState(e){var t;return(t=this.getAxisMotionValue(e).animation)===null||t===void 0?void 0:t.state}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,i=this.visualElement.getProps(),r=i[t];return r||this.visualElement.getValue(e,(i.initial?i.initial[e]:void 0)||0)}snapToCursor(e){si(t=>{const{drag:i}=this.getProps();if(!Wh(t,i,this.currentDirection))return;const{projection:r}=this.visualElement,o=this.getAxisMotionValue(t);if(r&&r.layout){const{min:l,max:u}=r.layout.layoutBox[t];o.set(e[t]-ut(l,u,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:i}=this.visualElement;if(!$a(t)||!i||!this.constraints)return;this.stopAnimation();const r={x:0,y:0};si(l=>{const u=this.getAxisMotionValue(l);if(u&&this.constraints!==!1){const h=u.get();r[l]=cR({min:h,max:h},this.constraints[l])}});const{transformTemplate:o}=this.visualElement.getProps();this.visualElement.current.style.transform=o?o({},""):"none",i.root&&i.root.updateScroll(),i.updateLayout(),this.resolveConstraints(),si(l=>{if(!Wh(l,e,null))return;const u=this.getAxisMotionValue(l),{min:h,max:p}=this.constraints[l];u.set(ut(h,p,r[l]))})}addListeners(){if(!this.visualElement.current)return;gR.set(this.visualElement,this);const e=this.visualElement.current,t=jc(e,"pointerdown",h=>{const{drag:p,dragListener:g=!0}=this.getProps();p&&g&&this.start(h)}),i=()=>{const{dragConstraints:h}=this.getProps();$a(h)&&h.current&&(this.constraints=this.resolveRefConstraints())},{projection:r}=this.visualElement,o=r.addEventListener("measure",i);r&&!r.layout&&(r.root&&r.root.updateScroll(),r.updateLayout()),et.read(i);const l=Yc(window,"resize",()=>this.scalePositionWithinConstraints()),u=r.addEventListener("didUpdate",({delta:h,hasLayoutChanged:p})=>{this.isDragging&&p&&(si(g=>{const y=this.getAxisMotionValue(g);y&&(this.originPoint[g]+=h[g].translate,y.set(y.get()+h[g].translate))}),this.visualElement.render())});return()=>{l(),t(),o(),u&&u()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:i=!1,dragPropagation:r=!1,dragConstraints:o=!1,dragElastic:l=dg,dragMomentum:u=!0}=e;return{...e,drag:t,dragDirectionLock:i,dragPropagation:r,dragConstraints:o,dragElastic:l,dragMomentum:u}}}function Wh(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function vR(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class xR extends Vs{constructor(e){super(e),this.removeGroupControls=qn,this.removeListeners=qn,this.controls=new yR(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||qn}unmount(){this.removeGroupControls(),this.removeListeners()}}const l_=n=>(e,t)=>{n&&et.postRender(()=>n(e,t))};class wR extends Vs{constructor(){super(...arguments),this.removePointerDownListener=qn}onPointerDown(e){this.session=new iE(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:hE(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:i,onPanEnd:r}=this.node.getProps();return{onSessionStart:l_(e),onStart:l_(t),onMove:i,onEnd:(o,l)=>{delete this.session,r&&et.postRender(()=>r(o,l))}}}mount(){this.removePointerDownListener=jc(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}const nd={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function c_(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const wc={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(Ee.test(n))n=parseFloat(n);else return n;const t=c_(n,e.target.x),i=c_(n,e.target.y);return`${t}% ${i}%`}},_R={correct:(n,{treeScale:e,projectionDelta:t})=>{const i=n,r=Ps.parse(n);if(r.length>5)return i;const o=Ps.createTransformer(n),l=typeof r[0]!="number"?1:0,u=t.x.scale*e.x,h=t.y.scale*e.y;r[0+l]/=u,r[1+l]/=h;const p=ut(u,h,.5);return typeof r[2+l]=="number"&&(r[2+l]/=p),typeof r[3+l]=="number"&&(r[3+l]/=p),o(r)}};class bR extends V.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i,layoutId:r}=this.props,{projection:o}=e;IP(ER),o&&(t.group&&t.group.add(o),i&&i.register&&r&&i.register(o),o.root.didUpdate(),o.addEventListener("animationComplete",()=>{this.safeToRemove()}),o.setOptions({...o.options,onExitComplete:()=>this.safeToRemove()})),nd.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:i,drag:r,isPresent:o}=this.props,l=i.projection;return l&&(l.isPresent=o,r||e.layoutDependency!==t||t===void 0?l.willUpdate():this.safeToRemove(),e.isPresent!==o&&(o?l.promote():l.relegate()||et.postRender(()=>{const u=l.getStack();(!u||!u.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),hy.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:i}=this.props,{projection:r}=e;r&&(r.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(r),i&&i.deregister&&i.deregister(r))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function dE(n){const[e,t]=G1(),i=V.useContext(iy);return d.jsx(bR,{...n,layoutGroup:i,switchLayoutGroup:V.useContext(n2),isPresent:e,safeToRemove:t})}const ER={borderRadius:{...wc,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:wc,borderTopRightRadius:wc,borderBottomLeftRadius:wc,borderBottomRightRadius:wc,boxShadow:_R};function TR(n,e,t){const i=cn(n)?n:Kc(n);return i.start(Ly("",i,e,t)),i.animation}function SR(n){return n instanceof SVGElement&&n.tagName!=="svg"}const CR=(n,e)=>n.depth-e.depth;class IR{constructor(){this.children=[],this.isDirty=!1}add(e){Cy(this.children,e),this.isDirty=!0}remove(e){Iy(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(CR),this.isDirty=!1,this.children.forEach(e)}}function kR(n,e){const t=Qi.now(),i=({timestamp:r})=>{const o=r-t;o>=e&&(ks(i),n(o-e))};return et.read(i,!0),()=>ks(i)}const fE=["TopLeft","TopRight","BottomLeft","BottomRight"],PR=fE.length,u_=n=>typeof n=="string"?parseFloat(n):n,h_=n=>typeof n=="number"||Ee.test(n);function AR(n,e,t,i,r,o){r?(n.opacity=ut(0,t.opacity!==void 0?t.opacity:1,NR(i)),n.opacityExit=ut(e.opacity!==void 0?e.opacity:1,0,RR(i))):o&&(n.opacity=ut(e.opacity!==void 0?e.opacity:1,t.opacity!==void 0?t.opacity:1,i));for(let l=0;l<PR;l++){const u=`border${fE[l]}Radius`;let h=d_(e,u),p=d_(t,u);if(h===void 0&&p===void 0)continue;h||(h=0),p||(p=0),h===0||p===0||h_(h)===h_(p)?(n[u]=Math.max(ut(u_(h),u_(p),i),0),(Ki.test(p)||Ki.test(h))&&(n[u]+="%")):n[u]=p}(e.rotate||t.rotate)&&(n.rotate=ut(e.rotate||0,t.rotate||0,i))}function d_(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const NR=pE(0,.5,N2),RR=pE(.5,.95,qn);function pE(n,e,t){return i=>i<n?0:i>e?1:t(tl(n,e,i))}function f_(n,e){n.min=e.min,n.max=e.max}function ii(n,e){f_(n.x,e.x),f_(n.y,e.y)}function p_(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}function m_(n,e,t,i,r){return n-=e,n=bd(n,1/t,i),r!==void 0&&(n=bd(n,1/r,i)),n}function jR(n,e=0,t=1,i=.5,r,o=n,l=n){if(Ki.test(e)&&(e=parseFloat(e),e=ut(l.min,l.max,e/100)-l.min),typeof e!="number")return;let u=ut(o.min,o.max,i);n===o&&(u-=e),n.min=m_(n.min,e,t,u,r),n.max=m_(n.max,e,t,u,r)}function g_(n,e,[t,i,r],o,l){jR(n,e[t],e[i],e[r],e.scale,o,l)}const DR=["x","scaleX","originX"],MR=["y","scaleY","originY"];function y_(n,e,t,i){g_(n.x,e,DR,t?t.x:void 0,i?i.x:void 0),g_(n.y,e,MR,t?t.y:void 0,i?i.y:void 0)}function v_(n){return n.translate===0&&n.scale===1}function mE(n){return v_(n.x)&&v_(n.y)}function x_(n,e){return n.min===e.min&&n.max===e.max}function OR(n,e){return x_(n.x,e.x)&&x_(n.y,e.y)}function w_(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function gE(n,e){return w_(n.x,e.x)&&w_(n.y,e.y)}function __(n){return vn(n.x)/vn(n.y)}function b_(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}class LR{constructor(){this.members=[]}add(e){Cy(this.members,e),e.scheduleRender()}remove(e){if(Iy(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){const t=this.members.findIndex(r=>e===r);if(t===0)return!1;let i;for(let r=t;r>=0;r--){const o=this.members[r];if(o.isPresent!==!1){i=o;break}}return i?(this.promote(i),!0):!1}promote(e,t){const i=this.lead;if(e!==i&&(this.prevLead=i,this.lead=e,e.show(),i)){i.instance&&i.scheduleRender(),e.scheduleRender(),e.resumeFrom=i,t&&(e.resumeFrom.preserveOpacity=!0),i.snapshot&&(e.snapshot=i.snapshot,e.snapshot.latestValues=i.animationValues||i.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:r}=e.options;r===!1&&i.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:t,resumingFrom:i}=e;t.onExitComplete&&t.onExitComplete(),i&&i.options.onExitComplete&&i.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function VR(n,e,t){let i="";const r=n.x.translate/e.x,o=n.y.translate/e.y,l=(t==null?void 0:t.z)||0;if((r||o||l)&&(i=`translate3d(${r}px, ${o}px, ${l}px) `),(e.x!==1||e.y!==1)&&(i+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:p,rotate:g,rotateX:y,rotateY:x,skewX:b,skewY:T}=t;p&&(i=`perspective(${p}px) ${i}`),g&&(i+=`rotate(${g}deg) `),y&&(i+=`rotateX(${y}deg) `),x&&(i+=`rotateY(${x}deg) `),b&&(i+=`skewX(${b}deg) `),T&&(i+=`skewY(${T}deg) `)}const u=n.x.scale*e.x,h=n.y.scale*e.y;return(u!==1||h!==1)&&(i+=`scale(${u}, ${h})`),i||"none"}const Eo={type:"projectionFrame",totalNodes:0,resolvedTargetDeltas:0,recalculatedProjection:0},Ec=typeof window<"u"&&window.MotionDebug!==void 0,wm=["","X","Y","Z"],FR={visibility:"hidden"},E_=1e3;let UR=0;function _m(n,e,t,i){const{latestValues:r}=e;r[n]&&(t[n]=r[n],e.setStaticValue(n,0),i&&(i[n]=0))}function yE(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=T2(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:r,layoutId:o}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",et,!(r||o))}const{parent:i}=n;i&&!i.hasCheckedOptimisedAppear&&yE(i)}function vE({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:i,resetTransform:r}){return class{constructor(l={},u=e==null?void 0:e()){this.id=UR++,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,Ec&&(Eo.totalNodes=Eo.resolvedTargetDeltas=Eo.recalculatedProjection=0),this.nodes.forEach(qR),this.nodes.forEach(KR),this.nodes.forEach(QR),this.nodes.forEach($R),Ec&&window.MotionDebug.record(Eo)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=l,this.root=u?u.root||u:this,this.path=u?[...u.path,u]:[],this.parent=u,this.depth=u?u.depth+1:0;for(let h=0;h<this.path.length;h++)this.path[h].shouldResetTransform=!0;this.root===this&&(this.nodes=new IR)}addEventListener(l,u){return this.eventHandlers.has(l)||this.eventHandlers.set(l,new ky),this.eventHandlers.get(l).add(u)}notifyListeners(l,...u){const h=this.eventHandlers.get(l);h&&h.notify(...u)}hasListeners(l){return this.eventHandlers.has(l)}mount(l,u=this.root.hasTreeAnimated){if(this.instance)return;this.isSVG=SR(l),this.instance=l;const{layoutId:h,layout:p,visualElement:g}=this.options;if(g&&!g.current&&g.mount(l),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),u&&(p||h)&&(this.isLayoutDirty=!0),n){let y;const x=()=>this.root.updateBlockedByResize=!1;n(l,()=>{this.root.updateBlockedByResize=!0,y&&y(),y=kR(x,250),nd.hasAnimatedSinceResize&&(nd.hasAnimatedSinceResize=!1,this.nodes.forEach(S_))})}h&&this.root.registerSharedNode(h,this),this.options.animate!==!1&&g&&(h||p)&&this.addEventListener("didUpdate",({delta:y,hasLayoutChanged:x,hasRelativeLayoutChanged:b,layout:T})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const C=this.options.transition||g.getDefaultTransition()||e4,{onLayoutAnimationStart:I,onLayoutAnimationComplete:N}=g.getProps(),D=!this.targetLayout||!gE(this.targetLayout,T),O=!x&&b;if(this.options.layoutRoot||this.resumeFrom||O||x&&(D||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0),this.setAnimationOrigin(y,O);const L={...by(C,"layout"),onPlay:I,onComplete:N};(g.shouldReduceMotion||this.options.layoutRoot)&&(L.delay=0,L.type=!1),this.startAnimation(L)}else x||S_(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=T})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const l=this.getStack();l&&l.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,ks(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(YR),this.animationId++)}getTransformTemplate(){const{visualElement:l}=this.options;return l&&l.getProps().transformTemplate}willUpdate(l=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&yE(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let g=0;g<this.path.length;g++){const y=this.path[g];y.shouldResetTransform=!0,y.updateScroll("snapshot"),y.options.layoutRoot&&y.willUpdate(!1)}const{layoutId:u,layout:h}=this.options;if(u===void 0&&!h)return;const p=this.getTransformTemplate();this.prevTransformTemplateValue=p?p(this.latestValues,""):void 0,this.updateSnapshot(),l&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){this.unblockUpdate(),this.clearAllSnapshots(),this.nodes.forEach(T_);return}this.isUpdating||this.nodes.forEach(WR),this.isUpdating=!1,this.nodes.forEach(GR),this.nodes.forEach(zR),this.nodes.forEach(BR),this.clearAllSnapshots();const u=Qi.now();Qt.delta=Nr(0,1e3/60,u-Qt.timestamp),Qt.timestamp=u,Qt.isProcessing=!0,dm.update.process(Qt),dm.preRender.process(Qt),dm.render.process(Qt),Qt.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,hy.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(HR),this.sharedNodes.forEach(XR)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,et.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){et.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!vn(this.snapshot.measuredBox.x)&&!vn(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let h=0;h<this.path.length;h++)this.path[h].updateScroll();const l=this.layout;this.layout=this.measure(!1),this.layoutCorrected=vt(),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:u}=this.options;u&&u.notify("LayoutMeasure",this.layout.layoutBox,l?l.layoutBox:void 0)}updateScroll(l="measure"){let u=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===l&&(u=!1),u){const h=i(this.instance);this.scroll={animationId:this.root.animationId,phase:l,isRoot:h,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:h}}}resetTransform(){if(!r)return;const l=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,u=this.projectionDelta&&!mE(this.projectionDelta),h=this.getTransformTemplate(),p=h?h(this.latestValues,""):void 0,g=p!==this.prevTransformTemplateValue;l&&(u||bo(this.latestValues)||g)&&(r(this.instance,p),this.shouldResetTransform=!1,this.scheduleRender())}measure(l=!0){const u=this.measurePageBox();let h=this.removeElementScroll(u);return l&&(h=this.removeTransform(h)),t4(h),{animationId:this.root.animationId,measuredBox:u,layoutBox:h,latestValues:{},source:this.id}}measurePageBox(){var l;const{visualElement:u}=this.options;if(!u)return vt();const h=u.measureViewportBox();if(!(((l=this.scroll)===null||l===void 0?void 0:l.wasRoot)||this.path.some(n4))){const{scroll:g}=this.root;g&&(Ga(h.x,g.offset.x),Ga(h.y,g.offset.y))}return h}removeElementScroll(l){var u;const h=vt();if(ii(h,l),!((u=this.scroll)===null||u===void 0)&&u.wasRoot)return h;for(let p=0;p<this.path.length;p++){const g=this.path[p],{scroll:y,options:x}=g;g!==this.root&&y&&x.layoutScroll&&(y.wasRoot&&ii(h,l),Ga(h.x,y.offset.x),Ga(h.y,y.offset.y))}return h}applyTransform(l,u=!1){const h=vt();ii(h,l);for(let p=0;p<this.path.length;p++){const g=this.path[p];!u&&g.options.layoutScroll&&g.scroll&&g!==g.root&&Ka(h,{x:-g.scroll.offset.x,y:-g.scroll.offset.y}),bo(g.latestValues)&&Ka(h,g.latestValues)}return bo(this.latestValues)&&Ka(h,this.latestValues),h}removeTransform(l){const u=vt();ii(u,l);for(let h=0;h<this.path.length;h++){const p=this.path[h];if(!p.instance||!bo(p.latestValues))continue;fg(p.latestValues)&&p.updateSnapshot();const g=vt(),y=p.measurePageBox();ii(g,y),y_(u,p.latestValues,p.snapshot?p.snapshot.layoutBox:void 0,g)}return bo(this.latestValues)&&y_(u,this.latestValues),u}setTargetDelta(l){this.targetDelta=l,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(l){this.options={...this.options,...l,crossfade:l.crossfade!==void 0?l.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!==Qt.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(l=!1){var u;const h=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=h.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=h.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=h.isSharedProjectionDirty);const p=!!this.resumingFrom||this!==h;if(!(l||p&&this.isSharedProjectionDirty||this.isProjectionDirty||!((u=this.parent)===null||u===void 0)&&u.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:y,layoutId:x}=this.options;if(!(!this.layout||!(y||x))){if(this.resolvedRelativeTargetAt=Qt.timestamp,!this.targetDelta&&!this.relativeTarget){const b=this.getClosestProjectingParent();b&&b.layout&&this.animationProgress!==1?(this.relativeParent=b,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),Mc(this.relativeTargetOrigin,this.layout.layoutBox,b.layout.layoutBox),ii(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}if(!(!this.relativeTarget&&!this.targetDelta)){if(this.target||(this.target=vt(),this.targetWithTransforms=vt()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),sR(this.target,this.relativeTarget,this.relativeParent.target)):this.targetDelta?(this.resumingFrom?this.target=this.applyTransform(this.layout.layoutBox):ii(this.target,this.layout.layoutBox),cE(this.target,this.targetDelta)):ii(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget){this.attemptToResolveRelativeTarget=!1;const b=this.getClosestProjectingParent();b&&!!b.resumingFrom==!!this.resumingFrom&&!b.options.layoutScroll&&b.target&&this.animationProgress!==1?(this.relativeParent=b,this.forceRelativeParentToResolveTarget(),this.relativeTarget=vt(),this.relativeTargetOrigin=vt(),Mc(this.relativeTargetOrigin,this.target,b.target),ii(this.relativeTarget,this.relativeTargetOrigin)):this.relativeParent=this.relativeTarget=void 0}Ec&&Eo.resolvedTargetDeltas++}}}getClosestProjectingParent(){if(!(!this.parent||fg(this.parent.latestValues)||lE(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 l;const u=this.getLead(),h=!!this.resumingFrom||this!==u;let p=!0;if((this.isProjectionDirty||!((l=this.parent)===null||l===void 0)&&l.isProjectionDirty)&&(p=!1),h&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(p=!1),this.resolvedRelativeTargetAt===Qt.timestamp&&(p=!1),p)return;const{layout:g,layoutId:y}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(g||y))return;ii(this.layoutCorrected,this.layout.layoutBox);const x=this.treeScale.x,b=this.treeScale.y;pR(this.layoutCorrected,this.treeScale,this.path,h),u.layout&&!u.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(u.target=u.layout.layoutBox,u.targetWithTransforms=vt());const{target:T}=u;if(!T){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(p_(this.prevProjectionDelta.x,this.projectionDelta.x),p_(this.prevProjectionDelta.y,this.projectionDelta.y)),Dc(this.projectionDelta,this.layoutCorrected,T,this.latestValues),(this.treeScale.x!==x||this.treeScale.y!==b||!b_(this.projectionDelta.x,this.prevProjectionDelta.x)||!b_(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",T)),Ec&&Eo.recalculatedProjection++}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(l=!0){var u;if((u=this.options.visualElement)===null||u===void 0||u.scheduleRender(),l){const h=this.getStack();h&&h.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=Wa(),this.projectionDelta=Wa(),this.projectionDeltaWithTransform=Wa()}setAnimationOrigin(l,u=!1){const h=this.snapshot,p=h?h.latestValues:{},g={...this.latestValues},y=Wa();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!u;const x=vt(),b=h?h.source:void 0,T=this.layout?this.layout.source:void 0,C=b!==T,I=this.getStack(),N=!I||I.members.length<=1,D=!!(C&&!N&&this.options.crossfade===!0&&!this.path.some(ZR));this.animationProgress=0;let O;this.mixTargetDelta=L=>{const G=L/1e3;C_(y.x,l.x,G),C_(y.y,l.y,G),this.setTargetDelta(y),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(Mc(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox),JR(this.relativeTarget,this.relativeTargetOrigin,x,G),O&&OR(this.relativeTarget,O)&&(this.isProjectionDirty=!1),O||(O=vt()),ii(O,this.relativeTarget)),C&&(this.animationValues=g,AR(g,p,this.latestValues,G,D,N)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=G},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(l){this.notifyListeners("animationStart"),this.currentAnimation&&this.currentAnimation.stop(),this.resumingFrom&&this.resumingFrom.currentAnimation&&this.resumingFrom.currentAnimation.stop(),this.pendingAnimation&&(ks(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=et.update(()=>{nd.hasAnimatedSinceResize=!0,this.currentAnimation=TR(0,E_,{...l,onUpdate:u=>{this.mixTargetDelta(u),l.onUpdate&&l.onUpdate(u)},onComplete:()=>{l.onComplete&&l.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 l=this.getStack();l&&l.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(E_),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const l=this.getLead();let{targetWithTransforms:u,target:h,layout:p,latestValues:g}=l;if(!(!u||!h||!p)){if(this!==l&&this.layout&&p&&xE(this.options.animationType,this.layout.layoutBox,p.layoutBox)){h=this.target||vt();const y=vn(this.layout.layoutBox.x);h.x.min=l.target.x.min,h.x.max=h.x.min+y;const x=vn(this.layout.layoutBox.y);h.y.min=l.target.y.min,h.y.max=h.y.min+x}ii(u,h),Ka(u,g),Dc(this.projectionDeltaWithTransform,this.layoutCorrected,u,g)}}registerSharedNode(l,u){this.sharedNodes.has(l)||this.sharedNodes.set(l,new LR),this.sharedNodes.get(l).add(u);const p=u.options.initialPromotionConfig;u.promote({transition:p?p.transition:void 0,preserveFollowOpacity:p&&p.shouldPreserveFollowOpacity?p.shouldPreserveFollowOpacity(u):void 0})}isLead(){const l=this.getStack();return l?l.lead===this:!0}getLead(){var l;const{layoutId:u}=this.options;return u?((l=this.getStack())===null||l===void 0?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:u}=this.options;return u?(l=this.getStack())===null||l===void 0?void 0:l.prevLead:void 0}getStack(){const{layoutId:l}=this.options;if(l)return this.root.sharedNodes.get(l)}promote({needsReset:l,transition:u,preserveFollowOpacity:h}={}){const p=this.getStack();p&&p.promote(this,h),l&&(this.projectionDelta=void 0,this.needsReset=!0),u&&this.setOptions({transition:u})}relegate(){const l=this.getStack();return l?l.relegate(this):!1}resetSkewAndRotation(){const{visualElement:l}=this.options;if(!l)return;let u=!1;const{latestValues:h}=l;if((h.z||h.rotate||h.rotateX||h.rotateY||h.rotateZ||h.skewX||h.skewY)&&(u=!0),!u)return;const p={};h.z&&_m("z",l,p,this.animationValues);for(let g=0;g<wm.length;g++)_m(`rotate${wm[g]}`,l,p,this.animationValues),_m(`skew${wm[g]}`,l,p,this.animationValues);l.render();for(const g in p)l.setStaticValue(g,p[g]),this.animationValues&&(this.animationValues[g]=p[g]);l.scheduleRender()}getProjectionStyles(l){var u,h;if(!this.instance||this.isSVG)return;if(!this.isVisible)return FR;const p={visibility:""},g=this.getTransformTemplate();if(this.needsReset)return this.needsReset=!1,p.opacity="",p.pointerEvents=ed(l==null?void 0:l.pointerEvents)||"",p.transform=g?g(this.latestValues,""):"none",p;const y=this.getLead();if(!this.projectionDelta||!this.layout||!y.target){const C={};return this.options.layoutId&&(C.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,C.pointerEvents=ed(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!bo(this.latestValues)&&(C.transform=g?g({},""):"none",this.hasProjected=!1),C}const x=y.animationValues||y.latestValues;this.applyTransformsToTarget(),p.transform=VR(this.projectionDeltaWithTransform,this.treeScale,x),g&&(p.transform=g(x,p.transform));const{x:b,y:T}=this.projectionDelta;p.transformOrigin=`${b.origin*100}% ${T.origin*100}% 0`,y.animationValues?p.opacity=y===this?(h=(u=x.opacity)!==null&&u!==void 0?u:this.latestValues.opacity)!==null&&h!==void 0?h:1:this.preserveOpacity?this.latestValues.opacity:x.opacityExit:p.opacity=y===this?x.opacity!==void 0?x.opacity:"":x.opacityExit!==void 0?x.opacityExit:0;for(const C in Wc){if(x[C]===void 0)continue;const{correct:I,applyTo:N,isCSSVariable:D}=Wc[C],O=p.transform==="none"?x[C]:I(x[C],y);if(N){const L=N.length;for(let G=0;G<L;G++)p[N[G]]=O}else D?this.options.visualElement.renderState.vars[C]=O:p[C]=O}return this.options.layoutId&&(p.pointerEvents=y===this?ed(l==null?void 0:l.pointerEvents)||"":"none"),p}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(l=>{var u;return(u=l.currentAnimation)===null||u===void 0?void 0:u.stop()}),this.root.nodes.forEach(T_),this.root.sharedNodes.clear()}}}function zR(n){n.updateLayout()}function BR(n){var e;const t=((e=n.resumeFrom)===null||e===void 0?void 0:e.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&t&&n.hasListeners("didUpdate")){const{layoutBox:i,measuredBox:r}=n.layout,{animationType:o}=n.options,l=t.source!==n.layout.source;o==="size"?si(y=>{const x=l?t.measuredBox[y]:t.layoutBox[y],b=vn(x);x.min=i[y].min,x.max=x.min+b}):xE(o,t.layoutBox,i)&&si(y=>{const x=l?t.measuredBox[y]:t.layoutBox[y],b=vn(i[y]);x.max=x.min+b,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[y].max=n.relativeTarget[y].min+b)});const u=Wa();Dc(u,i,t.layoutBox);const h=Wa();l?Dc(h,n.applyTransform(r,!0),t.measuredBox):Dc(h,i,t.layoutBox);const p=!mE(u);let g=!1;if(!n.resumeFrom){const y=n.getClosestProjectingParent();if(y&&!y.resumeFrom){const{snapshot:x,layout:b}=y;if(x&&b){const T=vt();Mc(T,t.layoutBox,x.layoutBox);const C=vt();Mc(C,i,b.layoutBox),gE(T,C)||(g=!0),y.options.layoutRoot&&(n.relativeTarget=C,n.relativeTargetOrigin=T,n.relativeParent=y)}}}n.notifyListeners("didUpdate",{layout:i,snapshot:t,delta:h,layoutDelta:u,hasLayoutChanged:p,hasRelativeLayoutChanged:g})}else if(n.isLead()){const{onExitComplete:i}=n.options;i&&i()}n.options.transition=void 0}function qR(n){Ec&&Eo.totalNodes++,n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}function $R(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function HR(n){n.clearSnapshot()}function T_(n){n.clearMeasurements()}function WR(n){n.isLayoutDirty=!1}function GR(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function S_(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function KR(n){n.resolveTargetDelta()}function QR(n){n.calcProjection()}function YR(n){n.resetSkewAndRotation()}function XR(n){n.removeLeadSnapshot()}function C_(n,e,t){n.translate=ut(e.translate,0,t),n.scale=ut(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function I_(n,e,t,i){n.min=ut(e.min,t.min,i),n.max=ut(e.max,t.max,i)}function JR(n,e,t,i){I_(n.x,e.x,t.x,i),I_(n.y,e.y,t.y,i)}function ZR(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const e4={duration:.45,ease:[.4,0,.1,1]},k_=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),P_=k_("applewebkit/")&&!k_("chrome/")?Math.round:qn;function A_(n){n.min=P_(n.min),n.max=P_(n.max)}function t4(n){A_(n.x),A_(n.y)}function xE(n,e,t){return n==="position"||n==="preserve-aspect"&&!rR(__(e),__(t),.2)}function n4(n){var e;return n!==n.root&&((e=n.scroll)===null||e===void 0?void 0:e.wasRoot)}const i4=vE({attachResizeListener:(n,e)=>Yc(n,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),bm={current:void 0},wE=vE({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!bm.current){const n=new i4({});n.mount(window),n.setOptions({layoutScroll:!0}),bm.current=n}return bm.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),r4={pan:{Feature:wR},drag:{Feature:xR,ProjectionNode:wE,MeasureLayout:dE}};function N_(n,e,t){const{props:i}=n;n.animationState&&i.whileHover&&n.animationState.setActive("whileHover",t==="Start");const r="onHover"+t,o=i[r];o&&et.postRender(()=>o(e,pu(e)))}class s4 extends Vs{mount(){const{current:e}=this.node;e&&(this.unmount=rA(e,(t,i)=>(N_(this.node,i,"Start"),r=>N_(this.node,r,"End"))))}unmount(){}}class o4 extends Vs{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!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=fu(Yc(this.node.current,"focus",()=>this.onFocus()),Yc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function R_(n,e,t){const{props:i}=n;n.animationState&&i.whileTap&&n.animationState.setActive("whileTap",t==="Start");const r="onTap"+(t==="End"?"":t),o=i[r];o&&et.postRender(()=>o(e,pu(e)))}class a4 extends Vs{mount(){const{current:e}=this.node;e&&(this.unmount=lA(e,(t,i)=>(R_(this.node,i,"Start"),(r,{success:o})=>R_(this.node,r,o?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const mg=new WeakMap,Em=new WeakMap,l4=n=>{const e=mg.get(n.target);e&&e(n)},c4=n=>{n.forEach(l4)};function u4({root:n,...e}){const t=n||document;Em.has(t)||Em.set(t,{});const i=Em.get(t),r=JSON.stringify(e);return i[r]||(i[r]=new IntersectionObserver(c4,{root:n,...e})),i[r]}function h4(n,e,t){const i=u4(e);return mg.set(n,t),i.observe(n),()=>{mg.delete(n),i.unobserve(n)}}const d4={some:0,all:1};class f4 extends Vs{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:t,margin:i,amount:r="some",once:o}=e,l={root:t?t.current:void 0,rootMargin:i,threshold:typeof r=="number"?r:d4[r]},u=h=>{const{isIntersecting:p}=h;if(this.isInView===p||(this.isInView=p,o&&!p&&this.hasEnteredView))return;p&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",p);const{onViewportEnter:g,onViewportLeave:y}=this.node.getProps(),x=p?g:y;x&&x(h)};return h4(this.node.current,l,u)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(p4(e,t))&&this.startObserver()}unmount(){}}function p4({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const m4={inView:{Feature:f4},tap:{Feature:a4},focus:{Feature:o4},hover:{Feature:s4}},g4={layout:{ProjectionNode:wE,MeasureLayout:dE}},gg={current:null},_E={current:!1};function y4(){if(_E.current=!0,!!oy)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>gg.current=n.matches;n.addListener(e),e()}else gg.current=!1}const v4=[...H2,on,Ps],x4=n=>v4.find($2(n)),w4=new WeakMap;function _4(n,e,t){for(const i in e){const r=e[i],o=t[i];if(cn(r))n.addValue(i,r);else if(cn(o))n.addValue(i,Kc(r,{owner:n}));else if(o!==r)if(n.hasValue(i)){const l=n.getValue(i);l.liveStyle===!0?l.jump(r):l.hasAnimated||l.set(r)}else{const l=n.getStaticValue(i);n.addValue(i,Kc(l!==void 0?l:r,{owner:n}))}}for(const i in t)e[i]===void 0&&n.removeValue(i);return e}const j_=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class b4{scrapeMotionValuesFromProps(e,t,i){return{}}constructor({parent:e,props:t,presenceContext:i,reducedMotionConfig:r,blockInitialAnimation:o,visualState:l},u={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Dy,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 b=Qi.now();this.renderScheduledAt<b&&(this.renderScheduledAt=b,et.render(this.render,!1,!0))};const{latestValues:h,renderState:p,onUpdate:g}=l;this.onUpdate=g,this.latestValues=h,this.baseTarget={...h},this.initialValues=t.initial?{...h}:{},this.renderState=p,this.parent=e,this.props=t,this.presenceContext=i,this.depth=e?e.depth+1:0,this.reducedMotionConfig=r,this.options=u,this.blockInitialAnimation=!!o,this.isControllingVariants=Zd(t),this.isVariantNode=e2(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:y,...x}=this.scrapeMotionValuesFromProps(t,{},this);for(const b in x){const T=x[b];h[b]!==void 0&&cn(T)&&T.set(h[b],!1)}}mount(e){this.current=e,w4.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((t,i)=>this.bindToMotionValue(i,t)),_E.current||y4(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:gg.current,this.parent&&this.parent.children.add(this),this.update(this.props,this.presenceContext)}unmount(){this.projection&&this.projection.unmount(),ks(this.notifyUpdate),ks(this.render),this.valueSubscriptions.forEach(e=>e()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),this.parent&&this.parent.children.delete(this);for(const e in this.events)this.events[e].clear();for(const e in this.features){const t=this.features[e];t&&(t.unmount(),t.isMounted=!1)}this.current=null}bindToMotionValue(e,t){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const i=zo.has(e);i&&this.onBindTransform&&this.onBindTransform();const r=t.on("change",u=>{this.latestValues[e]=u,this.props.onUpdate&&et.preRender(this.notifyUpdate),i&&this.projection&&(this.projection.isTransformDirty=!0)}),o=t.on("renderRequest",this.scheduleRender);let l;window.MotionCheckAppearSync&&(l=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{r(),o(),l&&l(),t.owner&&t.stop()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in nl){const t=nl[e];if(!t)continue;const{isEnabled:i,Feature:r}=t;if(!this.features[e]&&r&&i(this.props)&&(this.features[e]=new r(this)),this.features[e]){const o=this.features[e];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):vt()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let i=0;i<j_.length;i++){const r=j_[i];this.propEventSubscriptions[r]&&(this.propEventSubscriptions[r](),delete this.propEventSubscriptions[r]);const o="on"+r,l=e[o];l&&(this.propEventSubscriptions[r]=this.on(r,l))}this.prevMotionValues=_4(this,this.scrapeMotionValuesFromProps(e,this.prevProps,this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue(),this.onUpdate&&this.onUpdate(this)}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]: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(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const i=this.values.get(e);t!==i&&(i&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let i=this.values.get(e);return i===void 0&&t!==void 0&&(i=Kc(t===null?void 0:t,{owner:this}),this.addValue(e,i)),i}readValue(e,t){var i;let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:(i=this.getBaseTargetFromProps(this.props,e))!==null&&i!==void 0?i:this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(B2(r)||j2(r))?r=parseFloat(r):!x4(r)&&Ps.test(t)&&(r=F2(e,t)),this.setBaseTarget(e,cn(r)?r.get():r)),cn(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var t;const{initial:i}=this.props;let r;if(typeof i=="string"||typeof i=="object"){const l=wy(this.props,i,(t=this.presenceContext)===null||t===void 0?void 0:t.custom);l&&(r=l[e])}if(i&&r!==void 0)return r;const o=this.getBaseTargetFromProps(this.props,e);return o!==void 0&&!cn(o)?o:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new ky),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}}class bE extends b4{constructor(){super(...arguments),this.KeyframeResolver=W2}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){return e.style?e.style[t]:void 0}removeValueFromRenderState(e,{vars:t,style:i}){delete t[e],delete i[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;cn(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}function E4(n){return window.getComputedStyle(n)}class T4 extends bE{constructor(){super(...arguments),this.type="html",this.renderInstance=h2}readValueFromInstance(e,t){if(zo.has(t)){const i=jy(t);return i&&i.default||0}else{const i=E4(e),r=(dy(t)?i.getPropertyValue(t):i[t])||0;return typeof r=="string"?r.trim():r}}measureInstanceViewportBox(e,{transformPagePoint:t}){return uE(e,t)}build(e,t,i){my(e,t,i.transformTemplate)}scrapeMotionValuesFromProps(e,t,i){return _y(e,t,i)}}class S4 extends bE{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=vt,this.updateDimensions=()=>{this.current&&!this.renderState.dimensions&&u2(this.current,this.renderState)}}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(zo.has(t)){const i=jy(t);return i&&i.default||0}return t=d2.has(t)?t:uy(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,i){return p2(e,t,i)}onBindTransform(){this.current&&!this.renderState.dimensions&&et.postRender(this.updateDimensions)}build(e,t,i){vy(e,t,this.isSVGTag,i.transformTemplate)}renderInstance(e,t,i,r){f2(e,t,i,r)}mount(e){this.isSVGTag=xy(e.tagName),super.mount(e)}}const C4=(n,e)=>yy(n)?new S4(e):new T4(e,{allowProjection:n!==V.Fragment}),I4=XP({...QN,...m4,...r4,...g4},C4),te=fP(I4),Oc="generated",k4="pointerdown",P4="pointerup",yg="pointerleave",A4="pointerout",No="pointermove",N4="touchstart",D_="touchend",R4="touchmove",j4="touchcancel",D4="resize",M4="visibilitychange",ci="tsParticles - Error";class Un{constructor(e,t,i){if(this._updateFromAngle=(r,o)=>{this.x=Math.cos(r)*o,this.y=Math.sin(r)*o},!ki(e)&&e){this.x=e.x,this.y=e.y;const r=e;this.z=r.z?r.z:0}else if(e!==void 0&&t!==void 0)this.x=e,this.y=t,this.z=i??0;else throw new Error(`${ci} Vector3d not initialized correctly`)}static get origin(){return Un.create(0,0,0)}get angle(){return Math.atan2(this.y,this.x)}set angle(e){this._updateFromAngle(e,this.length)}get length(){return Math.sqrt(this.getLengthSq())}set length(e){this._updateFromAngle(this.angle,e)}static clone(e){return Un.create(e.x,e.y,e.z)}static create(e,t,i){return new Un(e,t,i)}add(e){return Un.create(this.x+e.x,this.y+e.y,this.z+e.z)}addTo(e){this.x+=e.x,this.y+=e.y,this.z+=e.z}copy(){return Un.clone(this)}distanceTo(e){return this.sub(e).length}distanceToSq(e){return this.sub(e).getLengthSq()}div(e){return Un.create(this.x/e,this.y/e,this.z/e)}divTo(e){this.x/=e,this.y/=e,this.z/=e}getLengthSq(){return this.x**2+this.y**2}mult(e){return Un.create(this.x*e,this.y*e,this.z*e)}multTo(e){this.x*=e,this.y*=e,this.z*=e}normalize(){const e=this.length;e!=0&&this.multTo(1/e)}rotate(e){return Un.create(this.x*Math.cos(e)-this.y*Math.sin(e),this.x*Math.sin(e)+this.y*Math.cos(e),0)}setTo(e){this.x=e.x,this.y=e.y;const t=e;this.z=t.z?t.z:0}sub(e){return Un.create(this.x-e.x,this.y-e.y,this.z-e.z)}subFrom(e){this.x-=e.x,this.y-=e.y,this.z-=e.z}}class Bt extends Un{constructor(e,t){super(e,t,0)}static get origin(){return Bt.create(0,0)}static clone(e){return Bt.create(e.x,e.y)}static create(e,t){return new Bt(e,t)}}let O4=Math.random;const vg=new Map;function Tm(n,e){vg.get(n)||vg.set(n,e)}function EE(n){return vg.get(n)||(e=>e)}function rt(){return Ni(O4(),0,1-1e-16)}function Ni(n,e,t){return Math.min(Math.max(n,e),t)}function Sm(n,e,t,i){return Math.floor((n*t+e*i)/(t+i))}function Nn(n){const e=gs(n);let t=Vy(n);return e===t&&(t=0),rt()*(e-t)+t}function be(n){return ki(n)?n:Nn(n)}function Vy(n){return ki(n)?n:n.min}function gs(n){return ki(n)?n:n.max}function Ae(n,e){if(n===e||e===void 0&&ki(n))return n;const t=Vy(n),i=gs(n);return e!==void 0?{min:Math.min(t,e),max:Math.max(i,e)}:Ae(t,i)}function Ro(n){const e=n.random,{enable:t,minimumValue:i}=ws(e)?{enable:e,minimumValue:0}:e;return be(t?Ae(n.value,i):n.value)}function xn(n,e){const t=n.x-e.x,i=n.y-e.y;return{dx:t,dy:i,distance:Math.sqrt(t**2+i**2)}}function $n(n,e){return xn(n,e).distance}function L4(n,e,t){if(ki(n))return n*Math.PI/180;switch(n){case"top":return-Math.PI/2;case"top-right":return-Math.PI/4;case"right":return 0;case"bottom-right":return Math.PI/4;case"bottom":return Math.PI/2;case"bottom-left":return 3*Math.PI/4;case"left":return Math.PI;case"top-left":return-3*Math.PI/4;case"inside":return Math.atan2(t.y-e.y,t.x-e.x);case"outside":return Math.atan2(e.y-t.y,e.x-t.x);default:return rt()*Math.PI*2}}function V4(n){const e=Bt.origin;return e.length=1,e.angle=n,e}function M_(n,e,t,i){return Bt.create(n.x*(t-i)/(t+i)+e.x*2*i/(t+i),n.y)}function F4(n){var e,t;return{x:((e=n.position)==null?void 0:e.x)??rt()*n.size.width,y:((t=n.position)==null?void 0:t.y)??rt()*n.size.height}}function TE(n){return n?n.endsWith("%")?parseFloat(n)/100:parseFloat(n):1}const U4={debug:console.debug,error:console.error,info:console.info,log:console.log,verbose:console.log,warning:console.warn};function jo(){return U4}function O_(n){const e={bounced:!1},{pSide:t,pOtherSide:i,rectSide:r,rectOtherSide:o,velocity:l,factor:u}=n;return i.min<o.min||i.min>o.max||i.max<o.min||i.max>o.max||(t.max>=r.min&&t.max<=(r.max+r.min)/2&&l>0||t.min<=r.max&&t.min>(r.max+r.min)/2&&l<0)&&(e.velocity=l*-u,e.bounced=!0),e}function z4(n,e){const t=qt(e,i=>n.matches(i));return Hn(t)?t.some(i=>i):t}function rl(){return typeof window>"u"||!window||typeof window.document>"u"||!window.document}function B4(){return!rl()&&typeof matchMedia<"u"}function SE(n){if(B4())return matchMedia(n)}function q4(n){if(!(rl()||typeof MutationObserver>"u"))return new MutationObserver(n)}function wt(n,e){return n===e||Hn(e)&&e.indexOf(n)>-1}async function $4(n,e){try{await document.fonts.load(`${e??"400"} 36px '${n??"Verdana"}'`)}catch{}}function H4(n){return Math.floor(rt()*n.length)}function nf(n,e,t=!0){return n[e!==void 0&&t?e%n.length:H4(n)]}function Fy(n,e,t,i,r){return W4(mu(n,i??0),e,t,r)}function W4(n,e,t,i){let r=!0;return(!i||i==="bottom")&&(r=n.top<e.height+t.x),r&&(!i||i==="left")&&(r=n.right>t.x),r&&(!i||i==="right")&&(r=n.left<e.width+t.y),r&&(!i||i==="top")&&(r=n.bottom>t.y),r}function mu(n,e){return{bottom:n.y+e,left:n.x-e,right:n.x+e,top:n.y-e}}function un(n,...e){for(const t of e){if(t==null)continue;if(!Qa(t)){n=t;continue}const i=Array.isArray(t);i&&(Qa(n)||!n||!Array.isArray(n))?n=[]:!i&&(Qa(n)||!n||Array.isArray(n))&&(n={});for(const r in t){if(r==="__proto__")continue;const o=t,l=o[r],u=n;u[r]=Qa(l)&&Array.isArray(l)?l.map(h=>un(u[r],h)):un(u[r],l)}}return n}function Uy(n,e){return!!kE(e,t=>t.enable&&wt(n,t.mode))}function zy(n,e,t){qt(e,i=>{const r=i.mode;i.enable&&wt(n,r)&&G4(i,t)})}function G4(n,e){const t=n.selectors;qt(t,i=>{e(i,n)})}function CE(n,e){if(!(!e||!n))return kE(n,t=>z4(e,t.selectors))}function xg(n){return{position:n.getPosition(),radius:n.getRadius(),mass:n.getMass(),velocity:n.velocity,factor:Bt.create(Ro(n.options.bounce.horizontal),Ro(n.options.bounce.vertical))}}function IE(n,e){const{x:t,y:i}=n.velocity.sub(e.velocity),[r,o]=[n.position,e.position],{dx:l,dy:u}=xn(o,r);if(t*l+i*u<0)return;const h=-Math.atan2(u,l),p=n.mass,g=e.mass,y=n.velocity.rotate(h),x=e.velocity.rotate(h),b=M_(y,x,p,g),T=M_(x,y,p,g),C=b.rotate(-h),I=T.rotate(-h);n.velocity.x=C.x*n.factor.x,n.velocity.y=C.y*n.factor.y,e.velocity.x=I.x*e.factor.x,e.velocity.y=I.y*e.factor.y}function K4(n,e){const t=n.getPosition(),i=n.getRadius(),r=mu(t,i),o=O_({pSide:{min:r.left,max:r.right},pOtherSide:{min:r.top,max:r.bottom},rectSide:{min:e.left,max:e.right},rectOtherSide:{min:e.top,max:e.bottom},velocity:n.velocity.x,factor:Ro(n.options.bounce.horizontal)});o.bounced&&(o.velocity!==void 0&&(n.velocity.x=o.velocity),o.position!==void 0&&(n.position.x=o.position));const l=O_({pSide:{min:r.top,max:r.bottom},pOtherSide:{min:r.left,max:r.right},rectSide:{min:e.top,max:e.bottom},rectOtherSide:{min:e.left,max:e.right},velocity:n.velocity.y,factor:Ro(n.options.bounce.vertical)});l.bounced&&(l.velocity!==void 0&&(n.velocity.y=l.velocity),l.position!==void 0&&(n.position.y=l.position))}function qt(n,e){return Hn(n)?n.map((t,i)=>e(t,i)):e(n,0)}function Ir(n,e,t){return Hn(n)?nf(n,e,t):n}function kE(n,e){return Hn(n)?n.find((t,i)=>e(t,i)):e(n,0)?n:void 0}function PE(n,e){const t=n.value,i=n.animation,r={delayTime:be(i.delay)*1e3,enable:i.enable,value:be(n.value)*e,max:gs(t)*e,min:Vy(t)*e,loops:0,maxLoops:be(i.count),time:0};if(i.enable){switch(r.decay=1-be(i.decay),i.mode){case"increase":r.status="increasing";break;case"decrease":r.status="decreasing";break;case"random":r.status=rt()>=.5?"increasing":"decreasing";break}const o=i.mode==="auto";switch(i.startValue){case"min":r.value=r.min,o&&(r.status="increasing");break;case"max":r.value=r.max,o&&(r.status="decreasing");break;case"random":default:r.value=Nn(r),o&&(r.status=rt()>=.5?"increasing":"decreasing");break}}return r.initialValue=r.value,r}function Q4(n,e){if(!(n.mode==="percent")){const{mode:r,...o}=n;return o}return"x"in n?{x:n.x/100*e.width,y:n.y/100*e.height}:{width:n.width/100*e.width,height:n.height/100*e.height}}function AE(n,e){return Q4(n,e)}function ws(n){return typeof n=="boolean"}function Ii(n){return typeof n=="string"}function ki(n){return typeof n=="number"}function NE(n){return typeof n=="function"}function Qa(n){return typeof n=="object"&&n!==null}function Hn(n){return Array.isArray(n)}const Ed="random",id="mid",rf=new Map;function L_(n){rf.set(n.key,n)}function Cm(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Y4(n){for(const[,o]of rf)if(n.startsWith(o.stringPrefix))return o.parseString(n);const e=/^#?([a-f\d])([a-f\d])([a-f\d])([a-f\d])?$/i,t=n.replace(e,(o,l,u,h,p)=>l+l+u+u+h+h+(p!==void 0?p+p:"")),i=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})?$/i,r=i.exec(t);return r?{a:r[4]!==void 0?parseInt(r[4],16)/255:1,b:parseInt(r[3],16),g:parseInt(r[2],16),r:parseInt(r[1],16)}:void 0}function Pi(n,e,t=!0){if(!n)return;const i=Ii(n)?{value:n}:n;if(Ii(i.value))return RE(i.value,e,t);if(Hn(i.value))return Pi({value:nf(i.value,e,t)});for(const[,r]of rf){const o=r.handleRangeColor(i);if(o)return o}}function RE(n,e,t=!0){if(!n)return;const i=Ii(n)?{value:n}:n;if(Ii(i.value))return i.value===Ed?DE():X4(i.value);if(Hn(i.value))return RE({value:nf(i.value,e,t)});for(const[,r]of rf){const o=r.handleColor(i);if(o)return o}}function Xc(n,e,t=!0){const i=Pi(n,e,t);return i?jE(i):void 0}function jE(n){const e=n.r/255,t=n.g/255,i=n.b/255,r=Math.max(e,t,i),o=Math.min(e,t,i),l={h:0,l:(r+o)/2,s:0};return r!==o&&(l.s=l.l<.5?(r-o)/(r+o):(r-o)/(2-r-o),l.h=e===r?(t-i)/(r-o):l.h=t===r?2+(i-e)/(r-o):4+(e-t)/(r-o)),l.l*=100,l.s*=100,l.h*=60,l.h<0&&(l.h+=360),l.h>=360&&(l.h-=360),l}function X4(n){return Y4(n)}function sl(n){const e={b:0,g:0,r:0},t={h:n.h/360,l:n.l/100,s:n.s/100};if(!t.s)e.r=e.g=e.b=t.l;else{const i=t.l<.5?t.l*(1+t.s):t.l+t.s-t.l*t.s,r=2*t.l-i;e.r=Cm(r,i,t.h+1/3),e.g=Cm(r,i,t.h),e.b=Cm(r,i,t.h-1/3)}return e.r=Math.floor(e.r*255),e.g=Math.floor(e.g*255),e.b=Math.floor(e.b*255),e}function J4(n){const e=sl(n);return{a:n.a,b:e.b,g:e.g,r:e.r}}function DE(n){return{b:Math.floor(Nn(Ae(0,256))),g:Math.floor(Nn(Ae(0,256))),r:Math.floor(Nn(Ae(0,256)))}}function kr(n,e){return`rgba(${n.r}, ${n.g}, ${n.b}, ${e??1})`}function Jc(n,e){return`hsla(${n.h}, ${n.s}%, ${n.l}%, ${e??1})`}function By(n,e,t,i){let r=n,o=e;return r.r===void 0&&(r=sl(n)),o.r===void 0&&(o=sl(e)),{b:Sm(r.b,o.b,t,i),g:Sm(r.g,o.g,t,i),r:Sm(r.r,o.r,t,i)}}function wg(n,e,t){if(t===Ed)return DE();if(t===id){const i=n.getFillColor()??n.getStrokeColor(),r=(e==null?void 0:e.getFillColor())??(e==null?void 0:e.getStrokeColor());if(i&&r&&e)return By(i,r,n.getRadius(),e.getRadius());{const o=i??r;if(o)return sl(o)}}else return t}function ME(n,e,t){const i=Ii(n)?n:n.value;return i===Ed?t?Pi({value:i}):e?Ed:id:i===id?id:Pi({value:i})}function V_(n){return n!==void 0?{h:n.h.value,s:n.s.value,l:n.l.value}:void 0}function OE(n,e,t){const i={h:{enable:!1,value:n.h},s:{enable:!1,value:n.s},l:{enable:!1,value:n.l}};return e&&(Im(i.h,e.h,t),Im(i.s,e.s,t),Im(i.l,e.l,t)),i}function Im(n,e,t){n.enable=e.enable,n.enable?(n.velocity=be(e.speed)/100*t,n.decay=1-be(e.decay),n.status="increasing",n.loops=0,n.maxLoops=be(e.count),n.time=0,n.delayTime=be(e.delay)*1e3,e.sync||(n.velocity*=rt(),n.value*=rt()),n.initialValue=n.value):n.velocity=0}function Lc(n,e,t){n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.closePath()}function Z4(n,e,t,i){n.beginPath(),n.moveTo(e.x,e.y),n.lineTo(t.x,t.y),n.lineTo(i.x,i.y),n.closePath()}function ej(n,e,t){n.fillStyle=t??"rgba(0,0,0,0)",n.fillRect(0,0,e.width,e.height)}function tj(n,e,t,i){t&&(n.globalAlpha=i,n.drawImage(t,0,0,e.width,e.height),n.globalAlpha=1)}function km(n,e){n.clearRect(0,0,e.width,e.height)}function nj(n){const{container:e,context:t,particle:i,delta:r,colorStyles:o,backgroundMask:l,composite:u,radius:h,opacity:p,shadow:g,transform:y}=n,x=i.getPosition(),b=i.rotation+(i.pathRotation?i.velocity.angle:0),T={sin:Math.sin(b),cos:Math.cos(b)},C={a:T.cos*(y.a??1),b:T.sin*(y.b??1),c:-T.sin*(y.c??1),d:T.cos*(y.d??1)};t.setTransform(C.a,C.b,C.c,C.d,x.x,x.y),t.beginPath(),l&&(t.globalCompositeOperation=u);const I=i.shadowColor;g.enable&&I&&(t.shadowBlur=g.blur,t.shadowColor=kr(I),t.shadowOffsetX=g.offset.x,t.shadowOffsetY=g.offset.y),o.fill&&(t.fillStyle=o.fill);const N=i.strokeWidth??0;t.lineWidth=N,o.stroke&&(t.strokeStyle=o.stroke),ij(e,t,i,h,p,r),N>0&&t.stroke(),i.close&&t.closePath(),i.fill&&t.fill(),rj(e,t,i,h,p,r),t.globalCompositeOperation="source-over",t.setTransform(1,0,0,1,0,0)}function ij(n,e,t,i,r,o){if(!t.shape)return;const l=n.drawers.get(t.shape);l&&l.draw(e,t,i,r,o,n.retina.pixelRatio)}function rj(n,e,t,i,r,o){if(!t.shape)return;const l=n.drawers.get(t.shape);!l||!l.afterEffect||l.afterEffect(e,t,i,r,o,n.retina.pixelRatio)}function sj(n,e,t){e.draw&&e.draw(n,t)}function oj(n,e,t,i){e.drawParticle&&e.drawParticle(n,t,i)}function aj(n,e,t){return{h:n.h,s:n.s,l:n.l+(e==="darken"?-1:1)*t}}function lj(n,e,t){const i=e[t];i!==void 0&&(n[t]=(n[t]??1)*i)}class cj{constructor(e){this.container=e,this._applyPostDrawUpdaters=t=>{for(const i of this._postDrawUpdaters)i.afterDraw&&i.afterDraw(t)},this._applyPreDrawUpdaters=(t,i,r,o,l,u)=>{for(const h of this._preDrawUpdaters){if(h.getColorStyles){const{fill:p,stroke:g}=h.getColorStyles(i,t,r,o);p&&(l.fill=p),g&&(l.stroke=g)}if(h.getTransformValues){const p=h.getTransformValues(i);for(const g in p)lj(u,p,g)}h.beforeDraw&&h.beforeDraw(i)}},this._applyResizePlugins=()=>{for(const t of this._resizePlugins)t.resize&&t.resize()},this._getPluginParticleColors=t=>{let i,r;for(const o of this._colorPlugins)if(!i&&o.particleFillColor&&(i=Xc(o.particleFillColor(t))),!r&&o.particleStrokeColor&&(r=Xc(o.particleStrokeColor(t))),i&&r)break;return[i,r]},this._initCover=()=>{const t=this.container.actualOptions,i=t.backgroundMask.cover,r=i.color,o=Pi(r);if(o){const l={...o,a:i.opacity};this._coverColorStyle=kr(l,l.a)}},this._initStyle=()=>{const t=this.element,i=this.container.actualOptions;if(t){this._fullScreen?(this._originalStyle=un({},t.style),this._setFullScreenStyle()):this._resetOriginalStyle();for(const r in i.style){if(!r||!i.style)continue;const o=i.style[r];o&&t.style.setProperty(r,o,"important")}}},this._initTrail=async()=>{const t=this.container.actualOptions,i=t.particles.move.trail,r=i.fill;if(i.enable)if(r.color){const o=Pi(r.color);if(!o)return;const l=t.particles.move.trail;this._trailFill={color:{...o},opacity:1/l.length}}else await new Promise((o,l)=>{if(!r.image)return;const u=document.createElement("img");u.addEventListener("load",()=>{this._trailFill={image:u,opacity:1/i.length},o()}),u.addEventListener("error",h=>{l(h.error)}),u.src=r.image})},this._paintBase=t=>{this.draw(i=>ej(i,this.size,t))},this._paintImage=(t,i)=>{this.draw(r=>tj(r,this.size,t,i))},this._repairStyle=()=>{const t=this.element;t&&(this._safeMutationObserver(i=>i.disconnect()),this._initStyle(),this.initBackground(),this._safeMutationObserver(i=>i.observe(t,{attributes:!0})))},this._resetOriginalStyle=()=>{const t=this.element,i=this._originalStyle;if(!(t&&i))return;const r=t.style;r.position=i.position,r.zIndex=i.zIndex,r.top=i.top,r.left=i.left,r.width=i.width,r.height=i.height},this._safeMutationObserver=t=>{this._mutationObserver&&t(this._mutationObserver)},this._setFullScreenStyle=()=>{const t=this.element;if(!t)return;const i="important",r=t.style;r.setProperty("position","fixed",i),r.setProperty("z-index",this.container.actualOptions.fullScreen.zIndex.toString(10),i),r.setProperty("top","0",i),r.setProperty("left","0",i),r.setProperty("width","100%",i),r.setProperty("height","100%",i)},this.size={height:0,width:0},this._context=null,this._generated=!1,this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}get _fullScreen(){return this.container.actualOptions.fullScreen.enable}clear(){const e=this.container.actualOptions,t=e.particles.move.trail,i=this._trailFill;e.backgroundMask.enable?this.paint():t.enable&&t.length>0&&i?i.color?this._paintBase(kr(i.color,i.opacity)):i.image&&this._paintImage(i.image,i.opacity):this.draw(r=>{km(r,this.size)})}destroy(){if(this.stop(),this._generated){const e=this.element;e&&e.remove()}else this._resetOriginalStyle();this._preDrawUpdaters=[],this._postDrawUpdaters=[],this._resizePlugins=[],this._colorPlugins=[]}draw(e){const t=this._context;if(t)return e(t)}drawParticle(e,t){if(e.spawning||e.destroyed)return;const i=e.getRadius();if(i<=0)return;const r=e.getFillColor(),o=e.getStrokeColor()??r;let[l,u]=this._getPluginParticleColors(e);l||(l=r),u||(u=o),!(!l&&!u)&&this.draw(h=>{var O;const p=this.container,g=p.actualOptions,y=e.options.zIndex,x=(1-e.zIndexFactor)**y.opacityRate,b=e.bubble.opacity??((O=e.opacity)==null?void 0:O.value)??1,T=e.strokeOpacity??b,C=b*x,I=T*x,N={},D={fill:l?Jc(l,C):void 0};D.stroke=u?Jc(u,I):D.fill,this._applyPreDrawUpdaters(h,e,i,C,D,N),nj({container:p,context:h,particle:e,delta:t,colorStyles:D,backgroundMask:g.backgroundMask.enable,composite:g.backgroundMask.composite,radius:i*(1-e.zIndexFactor)**y.sizeRate,opacity:C,shadow:e.options.shadow,transform:N}),this._applyPostDrawUpdaters(e)})}drawParticlePlugin(e,t,i){this.draw(r=>oj(r,e,t,i))}drawPlugin(e,t){this.draw(i=>sj(i,e,t))}async init(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=q4(e=>{for(const t of e)t.type==="attributes"&&t.attributeName==="style"&&this._repairStyle()}),this.resize(),this._initStyle(),this._initCover();try{await this._initTrail()}catch(e){jo().error(e)}this.initBackground(),this._safeMutationObserver(e=>{this.element&&e.observe(this.element,{attributes:!0})}),this.initUpdaters(),this.initPlugins(),this.paint()}initBackground(){const e=this.container.actualOptions,t=e.background,i=this.element;if(!i)return;const r=i.style;if(r){if(t.color){const o=Pi(t.color);r.backgroundColor=o?kr(o,t.opacity):""}else r.backgroundColor="";r.backgroundImage=t.image||"",r.backgroundPosition=t.position||"",r.backgroundRepeat=t.repeat||"",r.backgroundSize=t.size||""}}initPlugins(){this._resizePlugins=[];for(const[,e]of this.container.plugins)e.resize&&this._resizePlugins.push(e),(e.particleFillColor||e.particleStrokeColor)&&this._colorPlugins.push(e)}initUpdaters(){this._preDrawUpdaters=[],this._postDrawUpdaters=[];for(const e of this.container.particles.updaters)e.afterDraw&&this._postDrawUpdaters.push(e),(e.getColorStyles||e.getTransformValues||e.beforeDraw)&&this._preDrawUpdaters.push(e)}loadCanvas(e){this._generated&&this.element&&this.element.remove(),this._generated=e.dataset&&Oc in e.dataset?e.dataset[Oc]==="true":this._generated,this.element=e,this.element.ariaHidden="true",this._originalStyle=un({},this.element.style),this.size.height=e.offsetHeight,this.size.width=e.offsetWidth,this._context=this.element.getContext("2d"),this._safeMutationObserver(t=>{this.element&&t.observe(this.element,{attributes:!0})}),this.container.retina.init(),this.initBackground()}paint(){const e=this.container.actualOptions;this.draw(t=>{e.backgroundMask.enable&&e.backgroundMask.cover?(km(t,this.size),this._paintBase(this._coverColorStyle)):this._paintBase()})}resize(){if(!this.element)return!1;const e=this.container,t=e.retina.pixelRatio,i=e.canvas.size,r={width:this.element.offsetWidth*t,height:this.element.offsetHeight*t};if(r.height===i.height&&r.width===i.width&&r.height===this.element.height&&r.width===this.element.width)return!1;const o={...i};return this.element.width=i.width=this.element.offsetWidth*t,this.element.height=i.height=this.element.offsetHeight*t,this.container.started&&(this.resizeFactor={width:i.width/o.width,height:i.height/o.height}),!0}stop(){this._safeMutationObserver(e=>e.disconnect()),this._mutationObserver=void 0,this.draw(e=>km(e,this.size))}async windowResize(){if(!this.element||!this.resize())return;const e=this.container,t=e.updateActualOptions();e.particles.setDensity(),this._applyResizePlugins(),t&&await e.refresh()}}function ri(n,e,t,i,r){if(i){let o={passive:!0};ws(r)?o.capture=r:r!==void 0&&(o=r),n.addEventListener(e,t,o)}else{const o=r;n.removeEventListener(e,t,o)}}class uj{constructor(e){this.container=e,this._doMouseTouchClick=t=>{const i=this.container,r=i.actualOptions;if(this._canPush){const o=i.interactivity.mouse,l=o.position;if(!l)return;o.clickPosition={...l},o.clickTime=new Date().getTime();const u=r.interactivity.events.onClick;qt(u.mode,h=>this.container.handleClickMode(h))}t.type==="touchend"&&setTimeout(()=>this._mouseTouchFinish(),500)},this._handleThemeChange=t=>{const i=t,r=this.container,o=r.options,l=o.defaultThemes,u=i.matches?l.dark:l.light,h=o.themes.find(p=>p.name===u);h&&h.default.auto&&r.loadTheme(u)},this._handleVisibilityChange=()=>{const t=this.container,i=t.actualOptions;this._mouseTouchFinish(),i.pauseOnBlur&&(document&&document.hidden?(t.pageHidden=!0,t.pause()):(t.pageHidden=!1,t.getAnimationStatus()?t.play(!0):t.draw(!0)))},this._handleWindowResize=async()=>{this._resizeTimeout&&(clearTimeout(this._resizeTimeout),delete this._resizeTimeout),this._resizeTimeout=setTimeout(async()=>{const t=this.container.canvas;t&&await t.windowResize()},this.container.actualOptions.interactivity.events.resize.delay*1e3)},this._manageInteractivityListeners=(t,i)=>{const r=this._handlers,o=this.container,l=o.actualOptions,u=o.interactivity.element;if(!u)return;const h=u,p=o.canvas.element;p&&(p.style.pointerEvents=h===p?"initial":"none"),(l.interactivity.events.onHover.enable||l.interactivity.events.onClick.enable)&&(ri(u,No,r.mouseMove,i),ri(u,N4,r.touchStart,i),ri(u,R4,r.touchMove,i),l.interactivity.events.onClick.enable?(ri(u,D_,r.touchEndClick,i),ri(u,P4,r.mouseUp,i),ri(u,k4,r.mouseDown,i)):ri(u,D_,r.touchEnd,i),ri(u,t,r.mouseLeave,i),ri(u,j4,r.touchCancel,i))},this._manageListeners=t=>{const i=this._handlers,r=this.container,o=r.actualOptions,l=o.interactivity.detectsOn,u=r.canvas.element;let h=yg;l==="window"?(r.interactivity.element=window,h=A4):l==="parent"&&u?r.interactivity.element=u.parentElement??u.parentNode:r.interactivity.element=u,this._manageMediaMatch(t),this._manageResize(t),this._manageInteractivityListeners(h,t),document&&ri(document,M4,i.visibilityChange,t,!1)},this._manageMediaMatch=t=>{const i=this._handlers,r=SE("(prefers-color-scheme: dark)");if(r){if(r.addEventListener!==void 0){ri(r,"change",i.themeChange,t);return}r.addListener!==void 0&&(t?r.addListener(i.oldThemeChange):r.removeListener(i.oldThemeChange))}},this._manageResize=t=>{const i=this._handlers,r=this.container;if(!r.actualOptions.interactivity.events.resize)return;if(typeof ResizeObserver>"u"){ri(window,D4,i.resize,t);return}const l=r.canvas.element;this._resizeObserver&&!t?(l&&this._resizeObserver.unobserve(l),this._resizeObserver.disconnect(),delete this._resizeObserver):!this._resizeObserver&&t&&l&&(this._resizeObserver=new ResizeObserver(async u=>{u.find(p=>p.target===l)&&await this._handleWindowResize()}),this._resizeObserver.observe(l))},this._mouseDown=()=>{const{interactivity:t}=this.container;if(!t)return;const{mouse:i}=t;i.clicking=!0,i.downPosition=i.position},this._mouseTouchClick=t=>{const i=this.container,r=i.actualOptions,{mouse:o}=i.interactivity;o.inside=!0;let l=!1;const u=o.position;if(!(!u||!r.interactivity.events.onClick.enable)){for(const[,h]of i.plugins)if(h.clickPositionValid&&(l=h.clickPositionValid(u),l))break;l||this._doMouseTouchClick(t),o.clicking=!1}},this._mouseTouchFinish=()=>{const t=this.container.interactivity;if(!t)return;const i=t.mouse;delete i.position,delete i.clickPosition,delete i.downPosition,t.status=yg,i.inside=!1,i.clicking=!1},this._mouseTouchMove=t=>{const i=this.container,r=i.actualOptions,o=i.interactivity,l=i.canvas.element;if(!o||!o.element)return;o.mouse.inside=!0;let u;if(t.type.startsWith("pointer")){this._canPush=!0;const p=t;if(o.element===window){if(l){const g=l.getBoundingClientRect();u={x:p.clientX-g.left,y:p.clientY-g.top}}}else if(r.interactivity.detectsOn==="parent"){const g=p.target,y=p.currentTarget;if(g&&y&&l){const x=g.getBoundingClientRect(),b=y.getBoundingClientRect(),T=l.getBoundingClientRect();u={x:p.offsetX+2*x.left-(b.left+T.left),y:p.offsetY+2*x.top-(b.top+T.top)}}else u={x:p.offsetX??p.clientX,y:p.offsetY??p.clientY}}else p.target===l&&(u={x:p.offsetX??p.clientX,y:p.offsetY??p.clientY})}else if(this._canPush=t.type!=="touchmove",l){const p=t,g=p.touches[p.touches.length-1],y=l.getBoundingClientRect();u={x:g.clientX-(y.left??0),y:g.clientY-(y.top??0)}}const h=i.retina.pixelRatio;u&&(u.x*=h,u.y*=h),o.mouse.position=u,o.status=No},this._touchEnd=t=>{const i=t,r=Array.from(i.changedTouches);for(const o of r)this._touches.delete(o.identifier);this._mouseTouchFinish()},this._touchEndClick=t=>{const i=t,r=Array.from(i.changedTouches);for(const o of r)this._touches.delete(o.identifier);this._mouseTouchClick(t)},this._touchStart=t=>{const i=t,r=Array.from(i.changedTouches);for(const o of r)this._touches.set(o.identifier,performance.now());this._mouseTouchMove(t)},this._canPush=!0,this._touches=new Map,this._handlers={mouseDown:()=>this._mouseDown(),mouseLeave:()=>this._mouseTouchFinish(),mouseMove:t=>this._mouseTouchMove(t),mouseUp:t=>this._mouseTouchClick(t),touchStart:t=>this._touchStart(t),touchMove:t=>this._mouseTouchMove(t),touchEnd:t=>this._touchEnd(t),touchCancel:t=>this._touchEnd(t),touchEndClick:t=>this._touchEndClick(t),visibilityChange:()=>this._handleVisibilityChange(),themeChange:t=>this._handleThemeChange(t),oldThemeChange:t=>this._handleThemeChange(t),resize:()=>{this._handleWindowResize()}}}addListeners(){this._manageListeners(!0)}removeListeners(){this._manageListeners(!1)}}class Jt{constructor(){this.value=""}static create(e,t){const i=new Jt;return i.load(e),t!==void 0&&(Ii(t)||Hn(t)?i.load({value:t}):i.load(t)),i}load(e){(e==null?void 0:e.value)!==void 0&&(this.value=e.value)}}class hj{constructor(){this.color=new Jt,this.color.value="",this.image="",this.position="",this.repeat="",this.size="",this.opacity=1}load(e){e&&(e.color!==void 0&&(this.color=Jt.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image),e.position!==void 0&&(this.position=e.position),e.repeat!==void 0&&(this.repeat=e.repeat),e.size!==void 0&&(this.size=e.size),e.opacity!==void 0&&(this.opacity=e.opacity))}}class dj{constructor(){this.color=new Jt,this.color.value="#fff",this.opacity=1}load(e){e&&(e.color!==void 0&&(this.color=Jt.create(this.color,e.color)),e.opacity!==void 0&&(this.opacity=e.opacity))}}class fj{constructor(){this.composite="destination-out",this.cover=new dj,this.enable=!1}load(e){if(e){if(e.composite!==void 0&&(this.composite=e.composite),e.cover!==void 0){const t=e.cover,i=Ii(e.cover)?{color:e.cover}:e.cover;this.cover.load(t.color!==void 0?t:{color:i})}e.enable!==void 0&&(this.enable=e.enable)}}}class pj{constructor(){this.enable=!0,this.zIndex=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.zIndex!==void 0&&(this.zIndex=e.zIndex))}}class mj{constructor(){this.enable=!1,this.mode=[]}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode))}}class F_{constructor(){this.selectors=[],this.enable=!1,this.mode=[],this.type="circle"}get el(){return this.elementId}set el(e){this.elementId=e}get elementId(){return this.ids}set elementId(e){this.ids=e}get ids(){return qt(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=qt(e,t=>`#${t}`)}load(e){if(!e)return;const t=e.ids??e.elementId??e.el;t!==void 0&&(this.ids=t),e.selectors!==void 0&&(this.selectors=e.selectors),e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),e.type!==void 0&&(this.type=e.type)}}class gj{constructor(){this.enable=!1,this.force=2,this.smooth=10}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.force!==void 0&&(this.force=e.force),e.smooth!==void 0&&(this.smooth=e.smooth))}}class yj{constructor(){this.enable=!1,this.mode=[],this.parallax=new gj}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.mode!==void 0&&(this.mode=e.mode),this.parallax.load(e.parallax))}}class vj{constructor(){this.delay=.5,this.enable=!0}load(e){e!==void 0&&(e.delay!==void 0&&(this.delay=e.delay),e.enable!==void 0&&(this.enable=e.enable))}}let xj=class{constructor(){this.onClick=new mj,this.onDiv=new F_,this.onHover=new yj,this.resize=new vj}get onclick(){return this.onClick}set onclick(e){this.onClick=e}get ondiv(){return this.onDiv}set ondiv(e){this.onDiv=e}get onhover(){return this.onHover}set onhover(e){this.onHover=e}load(e){if(!e)return;this.onClick.load(e.onClick??e.onclick);const t=e.onDiv??e.ondiv;t!==void 0&&(this.onDiv=qt(t,i=>{const r=new F_;return r.load(i),r})),this.onHover.load(e.onHover??e.onhover),ws(e.resize)?this.resize.enable=e.resize:this.resize.load(e.resize)}};class wj{constructor(e,t){this._engine=e,this._container=t}load(e){if(!e||!this._container)return;const t=this._engine.plugins.interactors.get(this._container);if(t)for(const i of t)i.loadModeOptions&&i.loadModeOptions(this,e)}}class LE{constructor(e,t){this.detectsOn="window",this.events=new xj,this.modes=new wj(e,t)}get detect_on(){return this.detectsOn}set detect_on(e){this.detectsOn=e}load(e){if(!e)return;const t=e.detectsOn??e.detect_on;t!==void 0&&(this.detectsOn=t),this.events.load(e.events),this.modes.load(e.modes)}}class _j{load(e){e&&(e.position&&(this.position={x:e.position.x??50,y:e.position.y??50,mode:e.position.mode??"percent"}),e.options&&(this.options=un({},e.options)))}}class bj{constructor(){this.maxWidth=1/0,this.options={},this.mode="canvas"}load(e){e&&(e.maxWidth!==void 0&&(this.maxWidth=e.maxWidth),e.mode!==void 0&&(e.mode==="screen"?this.mode="screen":this.mode="canvas"),e.options!==void 0&&(this.options=un({},e.options)))}}class Ej{constructor(){this.auto=!1,this.mode="any",this.value=!1}load(e){e&&(e.auto!==void 0&&(this.auto=e.auto),e.mode!==void 0&&(this.mode=e.mode),e.value!==void 0&&(this.value=e.value))}}class Tj{constructor(){this.name="",this.default=new Ej}load(e){e&&(e.name!==void 0&&(this.name=e.name),this.default.load(e.default),e.options!==void 0&&(this.options=un({},e.options)))}}class Pm{constructor(){this.count=0,this.enable=!1,this.offset=0,this.speed=1,this.delay=0,this.decay=0,this.sync=!0}load(e){e&&(e.count!==void 0&&(this.count=Ae(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.offset!==void 0&&(this.offset=Ae(e.offset)),e.speed!==void 0&&(this.speed=Ae(e.speed)),e.decay!==void 0&&(this.decay=Ae(e.decay)),e.delay!==void 0&&(this.delay=Ae(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class Sj{constructor(){this.h=new Pm,this.s=new Pm,this.l=new Pm}load(e){e&&(this.h.load(e.h),this.s.load(e.s),this.l.load(e.l))}}class Zc extends Jt{constructor(){super(),this.animation=new Sj}static create(e,t){const i=new Zc;return i.load(e),t!==void 0&&(Ii(t)||Hn(t)?i.load({value:t}):i.load(t)),i}load(e){if(super.load(e),!e)return;const t=e.animation;t!==void 0&&(t.enable!==void 0?this.animation.h.load(t):this.animation.load(e.animation))}}class Cj{constructor(){this.speed=2}load(e){e&&e.speed!==void 0&&(this.speed=e.speed)}}class Ij{constructor(){this.enable=!0,this.retries=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.retries!==void 0&&(this.retries=e.retries))}}class kj{constructor(){this.count=0,this.enable=!1,this.speed=1,this.decay=0,this.delay=0,this.sync=!1}load(e){e&&(e.count!==void 0&&(this.count=Ae(e.count)),e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=Ae(e.speed)),e.decay!==void 0&&(this.decay=Ae(e.decay)),e.delay!==void 0&&(this.delay=Ae(e.delay)),e.sync!==void 0&&(this.sync=e.sync))}}class VE extends kj{constructor(){super(),this.mode="auto",this.startValue="random"}load(e){super.load(e),e&&(e.minimumValue!==void 0&&(this.minimumValue=e.minimumValue),e.mode!==void 0&&(this.mode=e.mode),e.startValue!==void 0&&(this.startValue=e.startValue))}}class Pj{constructor(){this.enable=!1,this.minimumValue=0}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.minimumValue!==void 0&&(this.minimumValue=e.minimumValue))}}class Fs{constructor(){this.random=new Pj,this.value=0}load(e){e&&(ws(e.random)?this.random.enable=e.random:this.random.load(e.random),e.value!==void 0&&(this.value=Ae(e.value,this.random.enable?this.random.minimumValue:void 0)))}}class U_ extends Fs{constructor(){super(),this.random.minimumValue=.1,this.value=1}}class FE{constructor(){this.horizontal=new U_,this.vertical=new U_}load(e){e&&(this.horizontal.load(e.horizontal),this.vertical.load(e.vertical))}}class Aj{constructor(){this.absorb=new Cj,this.bounce=new FE,this.enable=!1,this.maxSpeed=50,this.mode="bounce",this.overlap=new Ij}load(e){e&&(this.absorb.load(e.absorb),this.bounce.load(e.bounce),e.enable!==void 0&&(this.enable=e.enable),e.maxSpeed!==void 0&&(this.maxSpeed=Ae(e.maxSpeed)),e.mode!==void 0&&(this.mode=e.mode),this.overlap.load(e.overlap))}}class Nj{constructor(){this.offset=0,this.value=90}load(e){e&&(e.offset!==void 0&&(this.offset=Ae(e.offset)),e.value!==void 0&&(this.value=Ae(e.value)))}}class Rj{constructor(){this.distance=200,this.enable=!1,this.rotate={x:3e3,y:3e3}}get rotateX(){return this.rotate.x}set rotateX(e){this.rotate.x=e}get rotateY(){return this.rotate.y}set rotateY(e){this.rotate.y=e}load(e){var r,o;if(!e)return;e.distance!==void 0&&(this.distance=Ae(e.distance)),e.enable!==void 0&&(this.enable=e.enable);const t=((r=e.rotate)==null?void 0:r.x)??e.rotateX;t!==void 0&&(this.rotate.x=t);const i=((o=e.rotate)==null?void 0:o.y)??e.rotateY;i!==void 0&&(this.rotate.y=i)}}class jj{constructor(){this.x=50,this.y=50,this.mode="percent",this.radius=0}load(e){e&&(e.x!==void 0&&(this.x=e.x),e.y!==void 0&&(this.y=e.y),e.mode!==void 0&&(this.mode=e.mode),e.radius!==void 0&&(this.radius=e.radius))}}class Dj{constructor(){this.acceleration=9.81,this.enable=!1,this.inverse=!1,this.maxSpeed=50}load(e){e&&(e.acceleration!==void 0&&(this.acceleration=Ae(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.inverse!==void 0&&(this.inverse=e.inverse),e.maxSpeed!==void 0&&(this.maxSpeed=Ae(e.maxSpeed)))}}class Mj{constructor(){this.clamp=!0,this.delay=new Fs,this.enable=!1,this.options={}}load(e){e&&(e.clamp!==void 0&&(this.clamp=e.clamp),this.delay.load(e.delay),e.enable!==void 0&&(this.enable=e.enable),this.generator=e.generator,e.options&&(this.options=un(this.options,e.options)))}}class Oj{load(e){e&&(e.color!==void 0&&(this.color=Jt.create(this.color,e.color)),e.image!==void 0&&(this.image=e.image))}}class Lj{constructor(){this.enable=!1,this.length=10,this.fill=new Oj}get fillColor(){return this.fill.color}set fillColor(e){this.fill.load({color:e})}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),(e.fill!==void 0||e.fillColor!==void 0)&&this.fill.load(e.fill||{color:e.fillColor}),e.length!==void 0&&(this.length=e.length))}}class Vj{constructor(){this.default="out"}load(e){e&&(e.default!==void 0&&(this.default=e.default),this.bottom=e.bottom??e.default,this.left=e.left??e.default,this.right=e.right??e.default,this.top=e.top??e.default)}}class Fj{constructor(){this.acceleration=0,this.enable=!1}load(e){e&&(e.acceleration!==void 0&&(this.acceleration=Ae(e.acceleration)),e.enable!==void 0&&(this.enable=e.enable),e.position&&(this.position=un({},e.position)))}}class Uj{constructor(){this.angle=new Nj,this.attract=new Rj,this.center=new jj,this.decay=0,this.distance={},this.direction="none",this.drift=0,this.enable=!1,this.gravity=new Dj,this.path=new Mj,this.outModes=new Vj,this.random=!1,this.size=!1,this.speed=2,this.spin=new Fj,this.straight=!1,this.trail=new Lj,this.vibrate=!1,this.warp=!1}get bounce(){return this.collisions}set bounce(e){this.collisions=e}get collisions(){return!1}set collisions(e){}get noise(){return this.path}set noise(e){this.path=e}get outMode(){return this.outModes.default}set outMode(e){this.outModes.default=e}get out_mode(){return this.outMode}set out_mode(e){this.outMode=e}load(e){if(!e)return;this.angle.load(ki(e.angle)?{value:e.angle}:e.angle),this.attract.load(e.attract),this.center.load(e.center),e.decay!==void 0&&(this.decay=Ae(e.decay)),e.direction!==void 0&&(this.direction=e.direction),e.distance!==void 0&&(this.distance=ki(e.distance)?{horizontal:e.distance,vertical:e.distance}:{...e.distance}),e.drift!==void 0&&(this.drift=Ae(e.drift)),e.enable!==void 0&&(this.enable=e.enable),this.gravity.load(e.gravity);const t=e.outModes??e.outMode??e.out_mode;t!==void 0&&(Qa(t)?this.outModes.load(t):this.outModes.load({default:t})),this.path.load(e.path??e.noise),e.random!==void 0&&(this.random=e.random),e.size!==void 0&&(this.size=e.size),e.speed!==void 0&&(this.speed=Ae(e.speed)),this.spin.load(e.spin),e.straight!==void 0&&(this.straight=e.straight),this.trail.load(e.trail),e.vibrate!==void 0&&(this.vibrate=e.vibrate),e.warp!==void 0&&(this.warp=e.warp)}}class zj extends VE{constructor(){super(),this.destroy="none",this.speed=2}get opacity_min(){return this.minimumValue}set opacity_min(e){this.minimumValue=e}load(e){(e==null?void 0:e.opacity_min)!==void 0&&e.minimumValue===void 0&&(e.minimumValue=e.opacity_min),super.load(e),e&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class Bj extends Fs{constructor(){super(),this.animation=new zj,this.random.minimumValue=.1,this.value=1}get anim(){return this.animation}set anim(e){this.animation=e}load(e){if(!e)return;super.load(e);const t=e.animation??e.anim;t!==void 0&&(this.animation.load(t),this.value=Ae(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class qj{constructor(){this.enable=!1,this.width=1920,this.height=1080}get area(){return this.width}set area(e){this.width=e}get factor(){return this.height}set factor(e){this.height=e}get value_area(){return this.area}set value_area(e){this.area=e}load(e){if(!e)return;e.enable!==void 0&&(this.enable=e.enable);const t=e.width??e.area??e.value_area;t!==void 0&&(this.width=t);const i=e.height??e.factor;i!==void 0&&(this.height=i)}}class $j{constructor(){this.density=new qj,this.limit=0,this.value=0}get max(){return this.limit}set max(e){this.limit=e}load(e){if(!e)return;this.density.load(e.density);const t=e.limit??e.max;t!==void 0&&(this.limit=t),e.value!==void 0&&(this.value=e.value)}}class Hj{constructor(){this.blur=0,this.color=new Jt,this.enable=!1,this.offset={x:0,y:0},this.color.value="#000"}load(e){e&&(e.blur!==void 0&&(this.blur=e.blur),this.color=Jt.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable),e.offset!==void 0&&(e.offset.x!==void 0&&(this.offset.x=e.offset.x),e.offset.y!==void 0&&(this.offset.y=e.offset.y)))}}const Am="character",Nm="char",Rm="image",jm="images",Dm="polygon",Mm="star";class Wj{constructor(){this.loadShape=(e,t,i,r)=>{if(!e)return;const o=Hn(e),l=o?[]:{},u=o!==Hn(this.options[t]),h=o!==Hn(this.options[i]);u&&(this.options[t]=l),h&&r&&(this.options[i]=l),this.options[t]=un(this.options[t]??l,e),(!this.options[i]||r)&&(this.options[i]=un(this.options[i]??l,e))},this.close=!0,this.fill=!0,this.options={},this.type="circle"}get character(){return this.options[Am]??this.options[Nm]}set character(e){this.options[Nm]=this.options[Am]=e}get custom(){return this.options}set custom(e){this.options=e}get image(){return this.options[Rm]??this.options[jm]}set image(e){this.options[jm]=this.options[Rm]=e}get images(){return this.image}set images(e){this.image=e}get polygon(){return this.options[Dm]??this.options[Mm]}set polygon(e){this.options[Mm]=this.options[Dm]=e}get stroke(){return[]}set stroke(e){}load(e){if(!e)return;const t=e.options??e.custom;if(t!==void 0)for(const i in t){const r=t[i];r&&(this.options[i]=un(this.options[i]??{},r))}this.loadShape(e.character,Am,Nm,!0),this.loadShape(e.polygon,Dm,Mm,!1),this.loadShape(e.image??e.images,Rm,jm,!0),e.close!==void 0&&(this.close=e.close),e.fill!==void 0&&(this.fill=e.fill),e.type!==void 0&&(this.type=e.type)}}class Gj extends VE{constructor(){super(),this.destroy="none",this.speed=5}get size_min(){return this.minimumValue}set size_min(e){this.minimumValue=e}load(e){(e==null?void 0:e.size_min)!==void 0&&e.minimumValue===void 0&&(e.minimumValue=e.size_min),super.load(e),e&&e.destroy!==void 0&&(this.destroy=e.destroy)}}class Kj extends Fs{constructor(){super(),this.animation=new Gj,this.random.minimumValue=1,this.value=3}get anim(){return this.animation}set anim(e){this.animation=e}load(e){if(super.load(e),!e)return;const t=e.animation??e.anim;t!==void 0&&(this.animation.load(t),this.value=Ae(this.value,this.animation.enable?this.animation.minimumValue:void 0))}}class z_{constructor(){this.width=0}load(e){e&&(e.color!==void 0&&(this.color=Zc.create(this.color,e.color)),e.width!==void 0&&(this.width=Ae(e.width)),e.opacity!==void 0&&(this.opacity=Ae(e.opacity)))}}class Qj extends Fs{constructor(){super(),this.opacityRate=1,this.sizeRate=1,this.velocityRate=1}load(e){super.load(e),e&&(e.opacityRate!==void 0&&(this.opacityRate=e.opacityRate),e.sizeRate!==void 0&&(this.sizeRate=e.sizeRate),e.velocityRate!==void 0&&(this.velocityRate=e.velocityRate))}}class Yj{constructor(e,t){this._engine=e,this._container=t,this.bounce=new FE,this.collisions=new Aj,this.color=new Zc,this.color.value="#fff",this.groups={},this.move=new Uj,this.number=new $j,this.opacity=new Bj,this.reduceDuplicates=!1,this.shadow=new Hj,this.shape=new Wj,this.size=new Kj,this.stroke=new z_,this.zIndex=new Qj}load(e){var r,o,l;if(!e)return;if(this.bounce.load(e.bounce),this.color.load(Zc.create(this.color,e.color)),e.groups!==void 0)for(const u in e.groups){const h=e.groups[u];h!==void 0&&(this.groups[u]=un(this.groups[u]??{},h))}this.move.load(e.move),this.number.load(e.number),this.opacity.load(e.opacity),e.reduceDuplicates!==void 0&&(this.reduceDuplicates=e.reduceDuplicates),this.shape.load(e.shape),this.size.load(e.size),this.shadow.load(e.shadow),this.zIndex.load(e.zIndex);const t=((r=e.move)==null?void 0:r.collisions)??((o=e.move)==null?void 0:o.bounce);t!==void 0&&(this.collisions.enable=t),this.collisions.load(e.collisions),e.interactivity!==void 0&&(this.interactivity=un({},e.interactivity));const i=e.stroke??((l=e.shape)==null?void 0:l.stroke);if(i&&(this.stroke=qt(i,u=>{const h=new z_;return h.load(u),h})),this._container){const u=this._engine.plugins.updaters.get(this._container);if(u)for(const p of u)p.loadOptions&&p.loadOptions(this,e);const h=this._engine.plugins.interactors.get(this._container);if(h)for(const p of h)p.loadParticlesOptions&&p.loadParticlesOptions(this,e)}}}function UE(n,...e){for(const t of e)n.load(t)}function zE(n,e,...t){const i=new Yj(n,e);return UE(i,...t),i}class Xj{constructor(e,t){this._findDefaultTheme=i=>this.themes.find(r=>r.default.value&&r.default.mode===i)??this.themes.find(r=>r.default.value&&r.default.mode==="any"),this._importPreset=i=>{this.load(this._engine.plugins.getPreset(i))},this._engine=e,this._container=t,this.autoPlay=!0,this.background=new hj,this.backgroundMask=new fj,this.defaultThemes={},this.delay=0,this.fullScreen=new pj,this.detectRetina=!0,this.duration=0,this.fpsLimit=120,this.interactivity=new LE(e,t),this.manualParticles=[],this.particles=zE(this._engine,this._container),this.pauseOnBlur=!0,this.pauseOnOutsideViewport=!0,this.responsive=[],this.smooth=!1,this.style={},this.themes=[],this.zLayers=100}get backgroundMode(){return this.fullScreen}set backgroundMode(e){this.fullScreen.load(e)}get fps_limit(){return this.fpsLimit}set fps_limit(e){this.fpsLimit=e}get retina_detect(){return this.detectRetina}set retina_detect(e){this.detectRetina=e}load(e){var l,u;if(!e)return;e.preset!==void 0&&qt(e.preset,h=>this._importPreset(h)),e.autoPlay!==void 0&&(this.autoPlay=e.autoPlay),e.delay!==void 0&&(this.delay=Ae(e.delay));const t=e.detectRetina??e.retina_detect;t!==void 0&&(this.detectRetina=t),e.duration!==void 0&&(this.duration=Ae(e.duration));const i=e.fpsLimit??e.fps_limit;i!==void 0&&(this.fpsLimit=i),e.pauseOnBlur!==void 0&&(this.pauseOnBlur=e.pauseOnBlur),e.pauseOnOutsideViewport!==void 0&&(this.pauseOnOutsideViewport=e.pauseOnOutsideViewport),e.zLayers!==void 0&&(this.zLayers=e.zLayers),this.background.load(e.background);const r=e.fullScreen??e.backgroundMode;ws(r)?this.fullScreen.enable=r:this.fullScreen.load(r),this.backgroundMask.load(e.backgroundMask),this.interactivity.load(e.interactivity),e.manualParticles&&(this.manualParticles=e.manualParticles.map(h=>{const p=new _j;return p.load(h),p})),this.particles.load(e.particles),this.style=un(this.style,e.style),this._engine.plugins.loadOptions(this,e),e.smooth!==void 0&&(this.smooth=e.smooth);const o=this._engine.plugins.interactors.get(this._container);if(o)for(const h of o)h.loadOptions&&h.loadOptions(this,e);if(e.responsive!==void 0)for(const h of e.responsive){const p=new bj;p.load(h),this.responsive.push(p)}if(this.responsive.sort((h,p)=>h.maxWidth-p.maxWidth),e.themes!==void 0)for(const h of e.themes){const p=this.themes.find(g=>g.name===h.name);if(p)p.load(h);else{const g=new Tj;g.load(h),this.themes.push(g)}}this.defaultThemes.dark=(l=this._findDefaultTheme("dark"))==null?void 0:l.name,this.defaultThemes.light=(u=this._findDefaultTheme("light"))==null?void 0:u.name}setResponsive(e,t,i){this.load(i);const r=this.responsive.find(o=>o.mode==="screen"&&screen?o.maxWidth>screen.availWidth:o.maxWidth*t>e);return this.load(r==null?void 0:r.options),r==null?void 0:r.maxWidth}setTheme(e){if(e){const t=this.themes.find(i=>i.name===e);t&&this.load(t.options)}else{const t=SE("(prefers-color-scheme: dark)"),i=t&&t.matches,r=this._findDefaultTheme(i?"dark":"light");r&&this.load(r.options)}}}class Jj{constructor(e,t){this.container=t,this._engine=e,this._interactors=e.plugins.getInteractors(this.container,!0),this._externalInteractors=[],this._particleInteractors=[]}async externalInteract(e){for(const t of this._externalInteractors)t.isEnabled()&&await t.interact(e)}handleClickMode(e){for(const t of this._externalInteractors)t.handleClickMode&&t.handleClickMode(e)}init(){this._externalInteractors=[],this._particleInteractors=[];for(const e of this._interactors){switch(e.type){case"external":this._externalInteractors.push(e);break;case"particles":this._particleInteractors.push(e);break}e.init()}}async particlesInteract(e,t){for(const i of this._externalInteractors)i.clear(e,t);for(const i of this._particleInteractors)i.isEnabled(e)&&await i.interact(e,t)}async reset(e){for(const t of this._externalInteractors)t.isEnabled()&&t.reset(e);for(const t of this._particleInteractors)t.isEnabled(e)&&t.reset(e)}}const B_=n=>{if(!wt(n.outMode,n.checkModes))return;const e=n.radius*2;n.coord>n.maxCoord-e?n.setCb(-n.radius):n.coord<e&&n.setCb(n.radius)};class Zj{constructor(e,t,i,r,o,l){this.container=i,this._calcPosition=(u,h,p,g=0)=>{for(const[,D]of u.plugins){const O=D.particlePosition!==void 0?D.particlePosition(h,this):void 0;if(O)return Un.create(O.x,O.y,p)}const y=u.canvas.size,x=F4({size:y,position:h}),b=Un.create(x.x,x.y,p),T=this.getRadius(),C=this.options.move.outModes,I=D=>{B_({outMode:D,checkModes:["bounce","bounce-horizontal"],coord:b.x,maxCoord:u.canvas.size.width,setCb:O=>b.x+=O,radius:T})},N=D=>{B_({outMode:D,checkModes:["bounce","bounce-vertical"],coord:b.y,maxCoord:u.canvas.size.height,setCb:O=>b.y+=O,radius:T})};return I(C.left??C.default),I(C.right??C.default),N(C.top??C.default),N(C.bottom??C.default),this._checkOverlap(b,g)?this._calcPosition(u,void 0,p,g+1):b},this._calculateVelocity=()=>{const u=V4(this.direction),h=u.copy(),p=this.options.move;if(p.direction==="inside"||p.direction==="outside")return h;const g=Math.PI/180*be(p.angle.value),y=Math.PI/180*be(p.angle.offset),x={left:y-g/2,right:y+g/2};return p.straight||(h.angle+=Nn(Ae(x.left,x.right))),p.random&&typeof p.speed=="number"&&(h.length*=rt()),h},this._checkOverlap=(u,h=0)=>{const p=this.options.collisions,g=this.getRadius();if(!p.enable)return!1;const y=p.overlap;if(y.enable)return!1;const x=y.retries;if(x>=0&&h>x)throw new Error(`${ci} particle is overlapping and can't be placed`);return!!this.container.particles.find(b=>$n(u,b.position)<g+b.getRadius())},this._getRollColor=u=>{if(!u||!this.roll||!this.backColor&&!this.roll.alter)return u;const h=this.roll.horizontal&&this.roll.vertical?2:1,p=this.roll.horizontal?Math.PI/2:0;return Math.floor(((this.roll.angle??0)+p)/(Math.PI/h))%2?this.backColor?this.backColor:this.roll.alter?aj(u,this.roll.alter.type,this.roll.alter.value):u:u},this._initPosition=u=>{const h=this.container,p=be(this.options.zIndex.value);this.position=this._calcPosition(h,u,Ni(p,0,h.zLayers)),this.initialPosition=this.position.copy();const g=h.canvas.size;switch(this.moveCenter={...AE(this.options.move.center,g),radius:this.options.move.center.radius??0,mode:this.options.move.center.mode??"percent"},this.direction=L4(this.options.move.direction,this.position,this.moveCenter),this.options.move.direction){case"inside":this.outType="inside";break;case"outside":this.outType="outside";break}this.offset=Bt.origin},this._loadShapeData=(u,h)=>{const p=u.options[this.shape];if(p)return un({close:u.close,fill:u.fill},Ir(p,this.id,h))},this._engine=e,this.init(t,r,o,l)}destroy(e){if(this.unbreakable||this.destroyed)return;this.destroyed=!0,this.bubble.inRange=!1,this.slow.inRange=!1;const t=this.container,i=this.pathGenerator;for(const[,r]of t.plugins)r.particleDestroyed&&r.particleDestroyed(this,e);for(const r of t.particles.updaters)r.particleDestroyed&&r.particleDestroyed(this,e);i&&i.reset(this)}draw(e){const t=this.container;for(const[,i]of t.plugins)t.canvas.drawParticlePlugin(i,this,e);t.canvas.drawParticle(this,e)}getFillColor(){return this._getRollColor(this.bubble.color??V_(this.color))}getMass(){return this.getRadius()**2*Math.PI/2}getPosition(){return{x:this.position.x+this.offset.x,y:this.position.y+this.offset.y,z:this.position.z}}getRadius(){return this.bubble.radius??this.size.value}getStrokeColor(){return this._getRollColor(this.bubble.color??V_(this.strokeColor))}init(e,t,i,r){const o=this.container,l=this._engine;this.id=e,this.group=r,this.fill=!0,this.pathRotation=!1,this.close=!0,this.lastPathTime=0,this.destroyed=!1,this.unbreakable=!1,this.rotation=0,this.misplaced=!1,this.retina={maxDistance:{}},this.outType="normal",this.ignoresResizeRatio=!0;const u=o.retina.pixelRatio,h=o.actualOptions,p=zE(this._engine,o,h.particles),g=p.shape.type,{reduceDuplicates:y}=p;this.shape=Ir(g,this.id,y);const x=p.shape;if(i&&i.shape&&i.shape.type){const O=i.shape.type,L=Ir(O,this.id,y);L&&(this.shape=L,x.load(i.shape))}this.shapeData=this._loadShapeData(x,y),p.load(i);const b=this.shapeData;b&&p.load(b.particles);const T=new LE(l,o);T.load(o.actualOptions.interactivity),T.load(p.interactivity),this.interactivity=T,this.fill=(b==null?void 0:b.fill)??p.shape.fill,this.close=(b==null?void 0:b.close)??p.shape.close,this.options=p;const C=this.options.move.path;this.pathDelay=Ro(C.delay)*1e3,C.generator&&(this.pathGenerator=this._engine.plugins.getPathGenerator(C.generator),this.pathGenerator&&o.addPath(C.generator,this.pathGenerator)&&this.pathGenerator.init(o)),o.retina.initParticle(this),this.size=PE(this.options.size,u),this.bubble={inRange:!1},this.slow={inRange:!1,factor:1},this._initPosition(t),this.initialVelocity=this._calculateVelocity(),this.velocity=this.initialVelocity.copy(),this.moveDecay=1-be(this.options.move.decay);const I=o.particles;I.needsSort=I.needsSort||I.lastZIndex<this.position.z,I.lastZIndex=this.position.z,this.zIndexFactor=this.position.z/o.zLayers,this.sides=24;let N=o.drawers.get(this.shape);N||(N=this._engine.plugins.getShapeDrawer(this.shape),N&&o.drawers.set(this.shape,N)),N&&N.loadShape&&N.loadShape(this);const D=N==null?void 0:N.getSidesCount;D&&(this.sides=D(this)),this.spawning=!1,this.shadowColor=Pi(this.options.shadow.color);for(const O of o.particles.updaters)O.init(this);for(const O of o.particles.movers)O.init&&O.init(this);N&&N.particleInit&&N.particleInit(o,this);for(const[,O]of o.plugins)O.particleCreated&&O.particleCreated(this)}isInsideCanvas(){const e=this.getRadius(),t=this.container.canvas.size,i=this.position;return i.x>=-e&&i.y>=-e&&i.y<=t.height+e&&i.x<=t.width+e}isVisible(){return!this.destroyed&&!this.spawning&&this.isInsideCanvas()}reset(){for(const e of this.container.particles.updaters)e.reset&&e.reset(this)}}class eD{constructor(e,t){this.position=e,this.particle=t}}class BE{constructor(e,t){this.position={x:e,y:t}}}class Ri extends BE{constructor(e,t,i,r){super(e,t),this.size={height:r,width:i}}contains(e){const t=this.size.width,i=this.size.height,r=this.position;return e.x>=r.x&&e.x<=r.x+t&&e.y>=r.y&&e.y<=r.y+i}intersects(e){e instanceof hn&&e.intersects(this);const t=this.size.width,i=this.size.height,r=this.position,o=e.position,l=e instanceof Ri?e.size:{width:0,height:0},u=l.width,h=l.height;return o.x<r.x+t&&o.x+u>r.x&&o.y<r.y+i&&o.y+h>r.y}}class hn extends BE{constructor(e,t,i){super(e,t),this.radius=i}contains(e){return $n(e,this.position)<=this.radius}intersects(e){const t=this.position,i=e.position,r={x:Math.abs(i.x-t.x),y:Math.abs(i.y-t.y)},o=this.radius;if(e instanceof hn){const l=o+e.radius,u=Math.sqrt(r.x**2+r.y**2);return l>u}else if(e instanceof Ri){const{width:l,height:u}=e.size;return Math.pow(r.x-l,2)+Math.pow(r.y-u,2)<=o**2||r.x<=o+l&&r.y<=o+u||r.x<=l||r.y<=u}return!1}}class Td{constructor(e,t){this.rectangle=e,this.capacity=t,this._subdivide=()=>{const{x:i,y:r}=this.rectangle.position,{width:o,height:l}=this.rectangle.size,{capacity:u}=this;for(let h=0;h<4;h++)this._subs.push(new Td(new Ri(i+o/2*(h%2),r+l/2*(Math.round(h/2)-h%2),o/2,l/2),u));this._divided=!0},this._points=[],this._divided=!1,this._subs=[]}insert(e){return this.rectangle.contains(e.position)?this._points.length<this.capacity?(this._points.push(e),!0):(this._divided||this._subdivide(),this._subs.some(t=>t.insert(e))):!1}query(e,t,i){const r=i||[];if(!e.intersects(this.rectangle))return[];for(const o of this._points)!e.contains(o.position)&&$n(e.position,o.position)>o.particle.getRadius()&&(!t||t(o.particle))||r.push(o.particle);if(this._divided)for(const o of this._subs)o.query(e,t,r);return r}queryCircle(e,t,i){return this.query(new hn(e.x,e.y,t),i)}queryRectangle(e,t,i){return this.query(new Ri(e.x,e.y,t.width,t.height),i)}}const q_=4,$_=n=>new Ri(-n.width/4,-n.height/4,n.width*3/2,n.height*3/2);let tD=class{constructor(e,t){this._applyDensity=(r,o,l)=>{var b;if(!((b=r.number.density)!=null&&b.enable))return;const u=r.number,h=this._initDensityFactor(u.density),p=u.value,g=u.limit>0?u.limit:p,y=Math.min(p,g)*h+o,x=Math.min(this.count,this.filter(T=>T.group===l).length);this.limit=u.limit*h,x<y?this.push(Math.abs(y-x),void 0,r,l):x>y&&this.removeQuantity(x-y,l)},this._initDensityFactor=r=>{const o=this._container;if(!o.canvas.element||!r.enable)return 1;const l=o.canvas.element,u=o.retina.pixelRatio;return l.width*l.height/(r.factor*u**2*r.area)},this._pushParticle=(r,o,l,u)=>{try{let h=this.pool.pop();h?h.init(this._nextId,r,o,l):h=new Zj(this._engine,this._nextId,this._container,r,o,l);let p=!0;return u&&(p=u(h)),p?(this._array.push(h),this._zArray.push(h),this._nextId++,this._engine.dispatchEvent("particleAdded",{container:this._container,data:{particle:h}}),h):void 0}catch(h){jo().warning(`${ci} adding particle: ${h}`);return}},this._removeParticle=(r,o,l)=>{const u=this._array[r];if(!u||u.group!==o)return!1;u.destroy(l);const h=this._zArray.indexOf(u);return this._array.splice(r,1),this._zArray.splice(h,1),this.pool.push(u),this._engine.dispatchEvent("particleRemoved",{container:this._container,data:{particle:u}}),!0},this._engine=e,this._container=t,this._nextId=0,this._array=[],this._zArray=[],this.pool=[],this.limit=0,this.needsSort=!1,this.lastZIndex=0,this._interactionManager=new Jj(e,t);const i=t.canvas.size;this.quadTree=new Td($_(i),q_),this.movers=this._engine.plugins.getMovers(t,!0),this.updaters=this._engine.plugins.getUpdaters(t,!0)}get count(){return this._array.length}addManualParticles(){const e=this._container,t=e.actualOptions;for(const i of t.manualParticles)this.addParticle(i.position?AE(i.position,e.canvas.size):void 0,i.options)}addParticle(e,t,i,r){const o=this._container,l=o.actualOptions,u=l.particles.number.limit;if(u>0){const h=this.count+1-u;h>0&&this.removeQuantity(h)}return this._pushParticle(e,t,i,r)}clear(){this._array=[],this._zArray=[]}destroy(){this._array=[],this._zArray=[],this.movers=[],this.updaters=[]}async draw(e){const t=this._container;t.canvas.clear(),await this.update(e);for(const[,i]of t.plugins)t.canvas.drawPlugin(i,e);for(const i of this._zArray)i.draw(e)}filter(e){return this._array.filter(e)}find(e){return this._array.find(e)}handleClickMode(e){this._interactionManager.handleClickMode(e)}init(){var r;const e=this._container,t=e.actualOptions;this.lastZIndex=0,this.needsSort=!1;let i=!1;this.updaters=this._engine.plugins.getUpdaters(e,!0),this._interactionManager.init();for(const[,o]of e.plugins)if(o.particlesInitialization!==void 0&&(i=o.particlesInitialization()),i)break;this._interactionManager.init();for(const[,o]of e.pathGenerators)o.init(e);if(this.addManualParticles(),!i){for(const o in t.particles.groups){const l=t.particles.groups[o];for(let u=this.count,h=0;h<((r=l.number)==null?void 0:r.value)&&u<t.particles.number.value;u++,h++)this.addParticle(void 0,l,o)}for(let o=this.count;o<t.particles.number.value;o++)this.addParticle()}}push(e,t,i,r){this.pushing=!0;for(let o=0;o<e;o++)this.addParticle(t==null?void 0:t.position,i,r);this.pushing=!1}async redraw(){this.clear(),this.init(),await this.draw({value:0,factor:0})}remove(e,t,i){this.removeAt(this._array.indexOf(e),void 0,t,i)}removeAt(e,t=1,i,r){if(e<0||e>this.count)return;let o=0;for(let l=e;o<t&&l<this.count;l++)this._removeParticle(l--,i,r)&&o++}removeQuantity(e,t){this.removeAt(0,e,t)}setDensity(){const e=this._container.actualOptions,t=e.particles.groups;for(const i in t)this._applyDensity(t[i],0,i);this._applyDensity(e.particles,e.manualParticles.length)}async update(e){const t=this._container,i=new Set;this.quadTree=new Td($_(t.canvas.size),q_);for(const[,r]of t.pathGenerators)r.update();for(const[,r]of t.plugins)r.update&&r.update(e);for(const r of this._array){const o=t.canvas.resizeFactor;o&&!r.ignoresResizeRatio&&(r.position.x*=o.width,r.position.y*=o.height,r.initialPosition.x*=o.width,r.initialPosition.y*=o.height),r.ignoresResizeRatio=!1,await this._interactionManager.reset(r);for(const[,l]of this._container.plugins){if(r.destroyed)break;l.particleUpdate&&l.particleUpdate(r,e)}for(const l of this.movers)l.isEnabled(r)&&l.move(r,e);if(r.destroyed){i.add(r);continue}this.quadTree.insert(new eD(r.getPosition(),r))}if(i.size){const r=o=>!i.has(o);this._array=this.filter(r),this._zArray=this._zArray.filter(r),this.pool.push(...i)}await this._interactionManager.externalInteract(e);for(const r of this._array){for(const o of this.updaters)o.update(r,e);!r.destroyed&&!r.spawning&&await this._interactionManager.particlesInteract(r,e)}if(delete t.canvas.resizeFactor,this.needsSort){const r=this._zArray;r.sort((o,l)=>l.position.z-o.position.z||o.id-l.id),this.lastZIndex=r[r.length-1].position.z,this.needsSort=!1}}};class nD{constructor(e){this.container=e,this.pixelRatio=1,this.reduceFactor=1}init(){const e=this.container,t=e.actualOptions;this.pixelRatio=!t.detectRetina||rl()?1:window.devicePixelRatio,this.reduceFactor=1;const i=this.pixelRatio;if(e.canvas.element){const l=e.canvas.element;e.canvas.size.width=l.offsetWidth*i,e.canvas.size.height=l.offsetHeight*i}const r=t.particles,o=r.move;this.attractDistance=be(o.attract.distance)*i,this.maxSpeed=be(o.gravity.maxSpeed)*i,this.sizeAnimationSpeed=be(r.size.animation.speed)*i}initParticle(e){const t=e.options,i=this.pixelRatio,r=t.move,o=r.distance,l=e.retina;l.attractDistance=be(r.attract.distance)*i,l.moveDrift=be(r.drift)*i,l.moveSpeed=be(r.speed)*i,l.sizeAnimationSpeed=be(t.size.animation.speed)*i;const u=l.maxDistance;u.horizontal=o.horizontal!==void 0?o.horizontal*i:void 0,u.vertical=o.vertical!==void 0?o.vertical*i:void 0,l.maxSpeed=be(r.gravity.maxSpeed)*i}}function ct(n){return n&&!n.destroyed}function iD(n,e=60,t=!1){return{value:n,factor:t?60/e:60*n/1e3}}function Fa(n,e,...t){const i=new Xj(n,e);return UE(i,...t),i}const rD="default",H_={generate:n=>n.velocity,init:()=>{},update:()=>{},reset:()=>{}};class sD{constructor(e,t,i){this.id=t,this._intersectionManager=r=>{if(!(!ct(this)||!this.actualOptions.pauseOnOutsideViewport))for(const o of r)o.target===this.interactivity.element&&(o.isIntersecting?this.play:this.pause)()},this._nextFrame=async r=>{try{if(!this.smooth&&this.lastFrameTime!==void 0&&r<this.lastFrameTime+1e3/this.fpsLimit){this.draw(!1);return}this.lastFrameTime??(this.lastFrameTime=r);const o=iD(r-this.lastFrameTime,this.fpsLimit,this.smooth);if(this.addLifeTime(o.value),this.lastFrameTime=r,o.value>1e3){this.draw(!1);return}if(await this.particles.draw(o),!this.alive()){this.destroy();return}this.getAnimationStatus()&&this.draw(!1)}catch(o){jo().error(`${ci} in animation loop`,o)}},this._engine=e,this.fpsLimit=120,this.smooth=!1,this._delay=0,this._duration=0,this._lifeTime=0,this._firstStart=!0,this.started=!1,this.destroyed=!1,this._paused=!0,this.lastFrameTime=0,this.zLayers=100,this.pageHidden=!1,this._sourceOptions=i,this._initialSourceOptions=i,this.retina=new nD(this),this.canvas=new cj(this),this.particles=new tD(this._engine,this),this.pathGenerators=new Map,this.interactivity={mouse:{clicking:!1,inside:!1}},this.plugins=new Map,this.drawers=new Map,this._options=Fa(this._engine,this),this.actualOptions=Fa(this._engine,this),this._eventListeners=new uj(this),typeof IntersectionObserver<"u"&&IntersectionObserver&&(this._intersectionObserver=new IntersectionObserver(r=>this._intersectionManager(r))),this._engine.dispatchEvent("containerBuilt",{container:this})}get options(){return this._options}get sourceOptions(){return this._sourceOptions}addClickHandler(e){if(!ct(this))return;const t=this.interactivity.element;if(!t)return;const i=(y,x,b)=>{if(!ct(this))return;const T=this.retina.pixelRatio,C={x:x.x*T,y:x.y*T},I=this.particles.quadTree.queryCircle(C,b*T);e(y,I)},r=y=>{if(!ct(this))return;const x=y,b={x:x.offsetX||x.clientX,y:x.offsetY||x.clientY};i(y,b,1)},o=()=>{ct(this)&&(p=!0,g=!1)},l=()=>{ct(this)&&(g=!0)},u=y=>{if(ct(this)){if(p&&!g){const x=y;let b=x.touches[x.touches.length-1];if(!b&&(b=x.changedTouches[x.changedTouches.length-1],!b))return;const T=this.canvas.element,C=T?T.getBoundingClientRect():void 0,I={x:b.clientX-(C?C.left:0),y:b.clientY-(C?C.top:0)};i(y,I,Math.max(b.radiusX,b.radiusY))}p=!1,g=!1}},h=()=>{ct(this)&&(p=!1,g=!1)};let p=!1,g=!1;t.addEventListener("click",r),t.addEventListener("touchstart",o),t.addEventListener("touchmove",l),t.addEventListener("touchend",u),t.addEventListener("touchcancel",h)}addLifeTime(e){this._lifeTime+=e}addPath(e,t,i=!1){return!ct(this)||!i&&this.pathGenerators.has(e)?!1:(this.pathGenerators.set(e,t??H_),!0)}alive(){return!this._duration||this._lifeTime<=this._duration}destroy(){if(!ct(this))return;this.stop(),this.particles.destroy(),this.canvas.destroy();for(const[,i]of this.drawers)i.destroy&&i.destroy(this);for(const i of this.drawers.keys())this.drawers.delete(i);this._engine.plugins.destroy(this),this.destroyed=!0;const e=this._engine.dom(),t=e.findIndex(i=>i===this);t>=0&&e.splice(t,1),this._engine.dispatchEvent("containerDestroyed",{container:this})}draw(e){if(!ct(this))return;let t=e;this._drawAnimationFrame=requestAnimationFrame(async i=>{t&&(this.lastFrameTime=void 0,t=!1),await this._nextFrame(i)})}async export(e,t={}){for(const[,i]of this.plugins){if(!i.export)continue;const r=await i.export(e,t);if(r.supported)return r.blob}jo().error(`${ci} - Export plugin with type ${e} not found`)}getAnimationStatus(){return!this._paused&&!this.pageHidden&&ct(this)}handleClickMode(e){if(ct(this)){this.particles.handleClickMode(e);for(const[,t]of this.plugins)t.handleClickMode&&t.handleClickMode(e)}}async init(){if(!ct(this))return;const e=this._engine.plugins.getSupportedShapes();for(const i of e){const r=this._engine.plugins.getShapeDrawer(i);r&&this.drawers.set(i,r)}this._options=Fa(this._engine,this,this._initialSourceOptions,this.sourceOptions),this.actualOptions=Fa(this._engine,this,this._options);const t=this._engine.plugins.getAvailablePlugins(this);for(const[i,r]of t)this.plugins.set(i,r);this.retina.init(),await this.canvas.init(),this.updateActualOptions(),this.canvas.initBackground(),this.canvas.resize(),this.zLayers=this.actualOptions.zLayers,this._duration=be(this.actualOptions.duration)*1e3,this._delay=be(this.actualOptions.delay)*1e3,this._lifeTime=0,this.fpsLimit=this.actualOptions.fpsLimit>0?this.actualOptions.fpsLimit:120,this.smooth=this.actualOptions.smooth;for(const[,i]of this.drawers)i.init&&await i.init(this);for(const[,i]of this.plugins)i.init&&await i.init();this._engine.dispatchEvent("containerInit",{container:this}),this.particles.init(),this.particles.setDensity();for(const[,i]of this.plugins)i.particlesSetup&&i.particlesSetup();this._engine.dispatchEvent("particlesSetup",{container:this})}async loadTheme(e){ct(this)&&(this._currentTheme=e,await this.refresh())}pause(){if(ct(this)&&(this._drawAnimationFrame!==void 0&&(cancelAnimationFrame(this._drawAnimationFrame),delete this._drawAnimationFrame),!this._paused)){for(const[,e]of this.plugins)e.pause&&e.pause();this.pageHidden||(this._paused=!0),this._engine.dispatchEvent("containerPaused",{container:this})}}play(e){if(!ct(this))return;const t=this._paused||e;if(this._firstStart&&!this.actualOptions.autoPlay){this._firstStart=!1;return}if(this._paused&&(this._paused=!1),t)for(const[,i]of this.plugins)i.play&&i.play();this._engine.dispatchEvent("containerPlay",{container:this}),this.draw(t||!1)}async refresh(){if(ct(this))return this.stop(),this.start()}async reset(){if(ct(this))return this._initialSourceOptions=void 0,this._options=Fa(this._engine,this),this.actualOptions=Fa(this._engine,this,this._options),this.refresh()}setNoise(e,t,i){ct(this)&&this.setPath(e,t,i)}setPath(e,t,i){if(!e||!ct(this))return;const r={...H_};if(NE(e))r.generate=e,t&&(r.init=t),i&&(r.update=i);else{const o=r;r.generate=e.generate||o.generate,r.init=e.init||o.init,r.update=e.update||o.update}this.addPath(rD,r,!0)}async start(){!ct(this)||this.started||(await this.init(),this.started=!0,await new Promise(e=>{this._delayTimeout=setTimeout(async()=>{this._eventListeners.addListeners(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.observe(this.interactivity.element);for(const[,t]of this.plugins)t.start&&await t.start();this._engine.dispatchEvent("containerStarted",{container:this}),this.play(),e()},this._delay)}))}stop(){if(!(!ct(this)||!this.started)){this._delayTimeout&&(clearTimeout(this._delayTimeout),delete this._delayTimeout),this._firstStart=!0,this.started=!1,this._eventListeners.removeListeners(),this.pause(),this.particles.clear(),this.canvas.stop(),this.interactivity.element instanceof HTMLElement&&this._intersectionObserver&&this._intersectionObserver.unobserve(this.interactivity.element);for(const[,e]of this.plugins)e.stop&&e.stop();for(const e of this.plugins.keys())this.plugins.delete(e);this._sourceOptions=this._options,this._engine.dispatchEvent("containerStopped",{container:this})}}updateActualOptions(){this.actualOptions.responsive=[];const e=this.actualOptions.setResponsive(this.canvas.size.width,this.retina.pixelRatio,this._options);return this.actualOptions.setTheme(this._currentTheme),this.responsiveMaxWidth===e?!1:(this.responsiveMaxWidth=e,!0)}}class oD{constructor(){this._listeners=new Map}addEventListener(e,t){this.removeEventListener(e,t);let i=this._listeners.get(e);i||(i=[],this._listeners.set(e,i)),i.push(t)}dispatchEvent(e,t){const i=this._listeners.get(e);i&&i.forEach(r=>r(t))}hasEventListener(e){return!!this._listeners.get(e)}removeAllEventListeners(e){e?this._listeners.delete(e):this._listeners=new Map}removeEventListener(e,t){const i=this._listeners.get(e);if(!i)return;const r=i.length,o=i.indexOf(t);o<0||(r===1?this._listeners.delete(e):i.splice(o,1))}}function Om(n,e,t,i=!1){let r=e.get(n);return(!r||i)&&(r=[...t.values()].map(o=>o(n)),e.set(n,r)),r}class aD{constructor(e){this._engine=e,this.plugins=[],this._initializers={interactors:new Map,movers:new Map,updaters:new Map},this.interactors=new Map,this.movers=new Map,this.updaters=new Map,this.presets=new Map,this.drawers=new Map,this.pathGenerators=new Map}addInteractor(e,t){this._initializers.interactors.set(e,t)}addParticleMover(e,t){this._initializers.movers.set(e,t)}addParticleUpdater(e,t){this._initializers.updaters.set(e,t)}addPathGenerator(e,t){!this.getPathGenerator(e)&&this.pathGenerators.set(e,t)}addPlugin(e){!this.getPlugin(e.id)&&this.plugins.push(e)}addPreset(e,t,i=!1){(i||!this.getPreset(e))&&this.presets.set(e,t)}addShapeDrawer(e,t){qt(e,i=>{!this.getShapeDrawer(i)&&this.drawers.set(i,t)})}destroy(e){this.updaters.delete(e),this.movers.delete(e),this.interactors.delete(e)}getAvailablePlugins(e){const t=new Map;for(const i of this.plugins)i.needsPlugin(e.actualOptions)&&t.set(i.id,i.getPlugin(e));return t}getInteractors(e,t=!1){return Om(e,this.interactors,this._initializers.interactors,t)}getMovers(e,t=!1){return Om(e,this.movers,this._initializers.movers,t)}getPathGenerator(e){return this.pathGenerators.get(e)}getPlugin(e){return this.plugins.find(t=>t.id===e)}getPreset(e){return this.presets.get(e)}getShapeDrawer(e){return this.drawers.get(e)}getSupportedShapes(){return this.drawers.keys()}getUpdaters(e,t=!1){return Om(e,this.updaters,this._initializers.updaters,t)}loadOptions(e,t){for(const i of this.plugins)i.loadOptions(e,t)}loadParticlesOptions(e,t,...i){const r=this.updaters.get(e);if(r)for(const o of r)o.loadOptions&&o.loadOptions(t,...i)}}async function lD(n){const e=Ir(n.url,n.index);if(!e)return n.fallback;const t=await fetch(e);return t.ok?t.json():(jo().error(`${ci} ${t.status} while retrieving config file`),n.fallback)}function cD(n){return!n.id&&!n.element&&!n.url&&!n.options}function uD(n){return!cD(n)}class hD{constructor(){this._configs=new Map,this._domArray=[],this._eventDispatcher=new oD,this._initialized=!1,this.plugins=new aD(this)}get configs(){const e={};for(const[t,i]of this._configs)e[t]=i;return e}get version(){return"2.12.0"}addConfig(e,t){Ii(e)?t&&(t.name=e,this._configs.set(e,t)):this._configs.set(e.name??"default",e)}addEventListener(e,t){this._eventDispatcher.addEventListener(e,t)}async addInteractor(e,t,i=!0){this.plugins.addInteractor(e,t),await this.refresh(i)}async addMover(e,t,i=!0){this.plugins.addParticleMover(e,t),await this.refresh(i)}async addParticleUpdater(e,t,i=!0){this.plugins.addParticleUpdater(e,t),await this.refresh(i)}async addPathGenerator(e,t,i=!0){this.plugins.addPathGenerator(e,t),await this.refresh(i)}async addPlugin(e,t=!0){this.plugins.addPlugin(e),await this.refresh(t)}async addPreset(e,t,i=!1,r=!0){this.plugins.addPreset(e,t,i),await this.refresh(r)}async addShape(e,t,i,r,o,l=!0){let u,h=l,p,g,y;ws(i)?(h=i,p=void 0):p=i,ws(r)?(h=r,g=void 0):g=r,ws(o)?(h=o,y=void 0):y=o,NE(t)?u={afterEffect:g,destroy:y,draw:t,init:p}:u=t,this.plugins.addShapeDrawer(e,u),await this.refresh(h)}dispatchEvent(e,t){this._eventDispatcher.dispatchEvent(e,t)}dom(){return this._domArray}domItem(e){const t=this.dom(),i=t[e];if(!i||i.destroyed){t.splice(e,1);return}return i}init(){this._initialized||(this._initialized=!0)}async load(e,t){return this.loadFromArray(e,t)}async loadFromArray(e,t,i){let r;return uD(e)?r=e:(r={},Ii(e)?r.id=e:r.options=e,ki(t)?r.index=t:r.options=t??r.options,r.index=i??r.index),this._loadParams(r)}async loadJSON(e,t,i){let r,o;return ki(t)||t===void 0?r=e:(o=e,r=t),this._loadParams({id:o,url:r,index:i})}async refresh(e=!0){e&&this.dom().forEach(t=>t.refresh())}removeEventListener(e,t){this._eventDispatcher.removeEventListener(e,t)}async set(e,t,i,r){const o={index:r};return Ii(e)?o.id=e:o.element=e,t instanceof HTMLElement?o.element=t:o.options=t,ki(i)?o.index=i:o.options=i??o.options,this._loadParams(o)}async setJSON(e,t,i,r){const o={};return e instanceof HTMLElement?(o.element=e,o.url=t,o.index=i):(o.id=e,o.element=t,o.url=i,o.index=r),this._loadParams(o)}setOnClickHandler(e){const t=this.dom();if(!t.length)throw new Error(`${ci} can only set click handlers after calling tsParticles.load()`);for(const i of t)i.addClickHandler(e)}async _loadParams(e){const t=e.id??`tsparticles${Math.floor(rt()*1e4)}`,{index:i,url:r}=e,o=r?await lD({fallback:e.options,url:r,index:i}):e.options;let l=e.element??document.getElementById(t);l||(l=document.createElement("div"),l.id=t,document.body.append(l));const u=Ir(o,i),h=this.dom(),p=h.findIndex(x=>x.id===t);if(p>=0){const x=this.domItem(p);x&&!x.destroyed&&(x.destroy(),h.splice(p,1))}let g;if(l.tagName.toLowerCase()==="canvas")g=l,g.dataset[Oc]="false";else{const x=l.getElementsByTagName("canvas");x.length?(g=x[0],g.dataset[Oc]="false"):(g=document.createElement("canvas"),g.dataset[Oc]="true",l.appendChild(g))}g.style.width||(g.style.width="100%"),g.style.height||(g.style.height="100%");const y=new sD(this,t,u);return p>=0?h.splice(p,0,y):h.push(y),y.canvas.loadCanvas(g),await y.start(),y}}class dD{constructor(){this.key="hsl",this.stringPrefix="hsl"}handleColor(e){const t=e.value,i=t.hsl??e.value;if(i.h!==void 0&&i.s!==void 0&&i.l!==void 0)return sl(i)}handleRangeColor(e){const t=e.value,i=t.hsl??e.value;if(i.h!==void 0&&i.l!==void 0)return sl({h:be(i.h),l:be(i.l),s:be(i.s)})}parseString(e){if(!e.startsWith("hsl"))return;const t=/hsla?\(\s*(\d+)\s*,\s*(\d+)%\s*,\s*(\d+)%\s*(,\s*([\d.%]+)\s*)?\)/i,i=t.exec(e);return i?J4({a:i.length>4?TE(i[5]):1,h:parseInt(i[1],10),l:parseInt(i[3],10),s:parseInt(i[2],10)}):void 0}}class fD{constructor(){this.key="rgb",this.stringPrefix="rgb"}handleColor(e){const t=e.value,i=t.rgb??e.value;if(i.r!==void 0)return i}handleRangeColor(e){const t=e.value,i=t.rgb??e.value;if(i.r!==void 0)return{r:be(i.r),g:be(i.g),b:be(i.b)}}parseString(e){if(!e.startsWith(this.stringPrefix))return;const t=/rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*([\d.%]+)\s*)?\)/i,i=t.exec(e);return i?{a:i.length>4?TE(i[5]):1,b:parseInt(i[3],10),g:parseInt(i[2],10),r:parseInt(i[1],10)}:void 0}}function pD(){const n=new fD,e=new dD;L_(n),L_(e);const t=new hD;return t.init(),t}class tr{constructor(e){this.container=e,this.type="external"}}class qy{constructor(e){this.container=e,this.type="particles"}}const Sd=pD();rl()||(window.tsParticles=Sd);const Ya=n=>typeof n=="object"&&n!==null;function Cd(n,e,t=()=>!1){if(!Ya(n)||!Ya(e))return n===e;const i=Object.keys(n).filter(o=>!t(o)),r=Object.keys(e).filter(o=>!t(o));if(i.length!==r.length)return!1;for(const o of i){console.log("key");const l=n[o],u=e[o];if(Ya(l)&&Ya(u)){if(l===e&&u===n)continue;if(!Cd(l,u,t))return!1}else if(Array.isArray(l)&&Array.isArray(u)){if(!qE(l,u,t))return!1}else if(l!==u)return!1}return!0}function qE(n,e,t){if(n.length!==e.length)return!1;for(let i=0;i<n.length;i++){const r=n[i],o=e[i];if(Array.isArray(r)&&Array.isArray(o)){if(!qE(r,o,t))return!1}else if(Ya(r)&&Ya(o)){if(!Cd(r,o,t))return!1}else if(r!==o)return!1}return!0}const $E="tsparticles";let HE=class WE extends V.Component{constructor(e){super(e),this.state={init:!1,library:void 0}}destroy(){this.state.library&&(this.state.library.destroy(),this.setState({library:void 0}))}shouldComponentUpdate(e){return console.log("should update"),e.url!==this.props.url&&e.id!==this.props.id&&e.canvasClassName!==this.props.canvasClassName&&e.className!==this.props.className&&e.height!==this.props.height&&e.width!==this.props.width&&!Cd(e.style,this.props.style)&&e.init!==this.props.init&&e.loaded!==this.props.loaded&&!Cd(e.options??e.params,this.props.options&&this.props.params)}componentDidUpdate(){this.refresh()}forceUpdate(){this.refresh().then(()=>{super.forceUpdate()})}componentDidMount(){(async()=>(this.props.init&&await this.props.init(Sd),this.setState({init:!0},async()=>{await this.loadParticles()})))()}componentWillUnmount(){this.destroy()}render(){const{width:e,height:t,className:i,canvasClassName:r,id:o}=this.props;return md.createElement("div",{className:i,id:o},md.createElement("canvas",{className:r,style:{...this.props.style,width:e,height:t}}))}async refresh(){this.destroy(),await this.loadParticles()}async loadParticles(){if(!this.state.init)return;const e=this.props.id??WE.defaultProps.id??$E,t=await Sd.load({url:this.props.url,id:e,options:this.props.options??this.props.params});this.props.container&&(this.props.container.current=t),this.setState({library:t}),this.props.loaded&&await this.props.loaded(t)}};HE.defaultProps={width:"100%",height:"100%",options:{},style:{},url:void 0,id:$E};class Id{static init(e){var o;const t=new Id,i=e.selector;if(!i)throw new Error("No selector provided");const r=document.querySelector(i);if(!r)throw new Error("No element found for selector");return Sd.set(i.replace(".","").replace("!",""),r,{fullScreen:{enable:!1},particles:{color:{value:e.color??"!000000"},links:{color:"random",distance:e.minDistance??120,enable:e.connectParticles??!1},move:{enable:!0,speed:e.speed??.5},number:{value:e.maxParticles??100},size:{value:{min:1,max:e.sizeVariations??3}}},responsive:(o=e.responsive)==null?void 0:o.map(l=>{var u,h,p,g,y;return{maxWidth:l.breakpoint,options:{particles:{color:{value:(u=l.options)==null?void 0:u.color},links:{distance:(h=l.options)==null?void 0:h.minDistance,enable:(p=l.options)==null?void 0:p.connectParticles},number:{value:e.maxParticles},move:{enable:!0,speed:(g=l.options)==null?void 0:g.speed},size:{value:(y=l.options)==null?void 0:y.sizeVariations}}}}})}).then(l=>{t._container=l}),t}destroy(){const e=this._container;e&&e.destroy()}pauseAnimation(){const e=this._container;e&&e.pause()}resumeAnimation(){const e=this._container;e&&e.play()}}const mD=n=>{const e=(i,r)=>n.load(i,r);e.load=(i,r,o)=>{n.loadJSON(i,r).then(l=>{l&&o(l)}).catch(()=>{o(void 0)})},e.setOnClickHandler=i=>{n.setOnClickHandler(i)};const t=n.dom();return{particlesJS:e,pJSDom:t}},gD=n=>{const{particlesJS:e,pJSDom:t}=mD(n);return window.particlesJS=e,window.pJSDom=t,window.Particles=Id,{particlesJS:e,pJSDom:t,Particles:Id}};function yD(n){const e=n.initialPosition,{dx:t,dy:i}=xn(e,n.position),r=Math.abs(t),o=Math.abs(i),{maxDistance:l}=n.retina,u=l.horizontal,h=l.vertical;if(!(!u&&!h)){if((u&&r>=u||h&&o>=h)&&!n.misplaced)n.misplaced=!!u&&r>u||!!h&&o>h,u&&(n.velocity.x=n.velocity.y/2-n.velocity.x),h&&(n.velocity.y=n.velocity.x/2-n.velocity.y);else if((!u||r<u)&&(!h||o<h)&&n.misplaced)n.misplaced=!1;else if(n.misplaced){const p=n.position,g=n.velocity;u&&(p.x<e.x&&g.x<0||p.x>e.x&&g.x>0)&&(g.x*=-rt()),h&&(p.y<e.y&&g.y<0||p.y>e.y&&g.y>0)&&(g.y*=-rt())}}}function vD(n,e,t,i,r,o){wD(n,o);const l=n.gravity,u=l!=null&&l.enable&&l.inverse?-1:1;r&&t&&(n.velocity.x+=r*o.factor/(60*t)),l!=null&&l.enable&&t&&(n.velocity.y+=u*(l.acceleration*o.factor)/(60*t));const h=n.moveDecay;n.velocity.multTo(h);const p=n.velocity.mult(t);l!=null&&l.enable&&i>0&&(!l.inverse&&p.y>=0&&p.y>=i||l.inverse&&p.y<=0&&p.y<=-i)&&(p.y=u*i,t&&(n.velocity.y=p.y/t));const g=n.options.zIndex,y=(1-n.zIndexFactor)**g.velocityRate;p.multTo(y);const{position:x}=n;x.addTo(p),e.vibrate&&(x.x+=Math.sin(x.x*Math.cos(x.y)),x.y+=Math.cos(x.y*Math.sin(x.x)))}function xD(n,e){const t=n.container;if(!n.spin)return;const i={x:n.spin.direction==="clockwise"?Math.cos:Math.sin,y:n.spin.direction==="clockwise"?Math.sin:Math.cos};n.position.x=n.spin.center.x+n.spin.radius*i.x(n.spin.angle),n.position.y=n.spin.center.y+n.spin.radius*i.y(n.spin.angle),n.spin.radius+=n.spin.acceleration;const r=Math.max(t.canvas.size.width,t.canvas.size.height);n.spin.radius>r/2?(n.spin.radius=r/2,n.spin.acceleration*=-1):n.spin.radius<0&&(n.spin.radius=0,n.spin.acceleration*=-1),n.spin.angle+=e/100*(1-n.spin.radius/r)}function wD(n,e){var l;const t=n.options,i=t.move.path;if(!i.enable)return;if(n.lastPathTime<=n.pathDelay){n.lastPathTime+=e.value;return}const o=(l=n.pathGenerator)==null?void 0:l.generate(n,e);o&&n.velocity.addTo(o),i.clamp&&(n.velocity.x=Ni(n.velocity.x,-1,1),n.velocity.y=Ni(n.velocity.y,-1,1)),n.lastPathTime-=n.pathDelay}function _D(n){return n.slow.inRange?n.slow.factor:1}const bD=2;class ED{constructor(){this._initSpin=e=>{const t=e.container,i=e.options,r=i.move.spin;if(!r.enable)return;const o=r.position??{x:50,y:50},l={x:o.x/100*t.canvas.size.width,y:o.y/100*t.canvas.size.height},u=e.getPosition(),h=$n(u,l),p=be(r.acceleration);e.retina.spinAcceleration=p*t.retina.pixelRatio,e.spin={center:l,direction:e.velocity.x>=0?"clockwise":"counter-clockwise",angle:e.velocity.angle,radius:h,acceleration:e.retina.spinAcceleration}}}init(e){const t=e.options,i=t.move.gravity;e.gravity={enable:i.enable,acceleration:be(i.acceleration),inverse:i.inverse},this._initSpin(e)}isEnabled(e){return!e.destroyed&&e.options.move.enable}move(e,t){var T,C;const i=e.options,r=i.move;if(!r.enable)return;const o=e.container,l=o.retina.pixelRatio,u=_D(e),h=((T=e.retina).moveSpeed??(T.moveSpeed=be(r.speed)*l))*o.retina.reduceFactor,p=(C=e.retina).moveDrift??(C.moveDrift=be(e.options.move.drift)*l),g=gs(i.size.value)*l,y=r.size?e.getRadius()/g:1,x=h*y*u*(t.factor||1)/bD,b=e.retina.maxSpeed??o.retina.maxSpeed;r.spin.enable?xD(e,x):vD(e,r,x,b,p,t),yD(e)}}async function TD(n,e=!0){await n.addMover("base",()=>new ED,e)}class SD{draw(e,t,i){t.circleRange||(t.circleRange={min:0,max:Math.PI*2});const r=t.circleRange;e.arc(0,0,i,r.min,r.max,!1)}getSidesCount(){return 12}particleInit(e,t){const i=t.shapeData,r=(i==null?void 0:i.angle)??{max:360,min:0};t.circleRange=Qa(r)?{min:r.min*Math.PI/180,max:r.max*Math.PI/180}:{min:0,max:r*Math.PI/180}}}async function CD(n,e=!0){await n.addShape("circle",new SD,e)}function Lm(n,e,t,i,r){if(!e||!t.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0)||(e.time||(e.time=0),(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0)))return;const o=Nn(t.offset),l=(e.velocity??0)*n.factor+o*3.6,u=e.decay??1;!r||e.status==="increasing"?(e.value+=l,e.value>i&&(e.loops||(e.loops=0),e.loops++,r&&(e.status="decreasing",e.value-=e.value%i))):(e.value-=l,e.value<0&&(e.loops||(e.loops=0),e.loops++,e.status="increasing",e.value+=e.value)),e.velocity&&u!==1&&(e.velocity*=u),e.value>i&&(e.value%=i)}function ID(n,e){const{h:t,s:i,l:r}=n.options.color.animation,{color:o}=n;if(!o)return;const{h:l,s:u,l:h}=o;l&&Lm(e,l,t,360,!1),u&&Lm(e,u,i,100,!0),h&&Lm(e,h,r,100,!0)}class kD{constructor(e){this.container=e}init(e){const t=Xc(e.options.color,e.id,e.options.reduceDuplicates);t&&(e.color=OE(t,e.options.color.animation,this.container.retina.reduceFactor))}isEnabled(e){const{h:t,s:i,l:r}=e.options.color.animation,{color:o}=e;return!e.destroyed&&!e.spawning&&((o==null?void 0:o.h.value)!==void 0&&t.enable||(o==null?void 0:o.s.value)!==void 0&&i.enable||(o==null?void 0:o.l.value)!==void 0&&r.enable)}update(e,t){ID(e,t)}}async function PD(n,e=!0){await n.addParticleUpdater("color",t=>new kD(t),e)}function AD(n,e,t,i){switch(n.options.opacity.animation.destroy){case"max":e>=i&&n.destroy();break;case"min":e<=t&&n.destroy();break}}function ND(n,e){const t=n.opacity;if(n.destroyed||!(t!=null&&t.enable)||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;const i=t.min,r=t.max,o=t.decay??1;if(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=e.value),!((t.delayTime??0)>0&&t.time<(t.delayTime??0))){switch(t.status){case"increasing":t.value>=r?(t.status="decreasing",t.loops||(t.loops=0),t.loops++):t.value+=(t.velocity??0)*e.factor;break;case"decreasing":t.value<=i?(t.status="increasing",t.loops||(t.loops=0),t.loops++):t.value-=(t.velocity??0)*e.factor;break}t.velocity&&t.decay!==1&&(t.velocity*=o),AD(n,t.value,i,r),n.destroyed||(t.value=Ni(t.value,i,r))}}class RD{constructor(e){this.container=e}init(e){const t=e.options.opacity;e.opacity=PE(t,1);const i=t.animation;i.enable&&(e.opacity.velocity=be(i.speed)/100*this.container.retina.reduceFactor,i.sync||(e.opacity.velocity*=rt()))}isEnabled(e){return!e.destroyed&&!e.spawning&&!!e.opacity&&e.opacity.enable&&((e.opacity.maxLoops??0)<=0||(e.opacity.maxLoops??0)>0&&(e.opacity.loops??0)<(e.opacity.maxLoops??0))}reset(e){e.opacity&&(e.opacity.time=0,e.opacity.loops=0)}update(e,t){this.isEnabled(e)&&ND(e,t)}}async function jD(n,e=!0){await n.addParticleUpdater("opacity",t=>new RD(t),e)}function DD(n){if(n.outMode!=="bounce"&&n.outMode!=="bounce-horizontal"&&n.outMode!=="bounceHorizontal"&&n.outMode!=="split"||n.direction!=="left"&&n.direction!=="right")return;n.bounds.right<0&&n.direction==="left"?n.particle.position.x=n.size+n.offset.x:n.bounds.left>n.canvasSize.width&&n.direction==="right"&&(n.particle.position.x=n.canvasSize.width-n.size-n.offset.x);const e=n.particle.velocity.x;let t=!1;if(n.direction==="right"&&n.bounds.right>=n.canvasSize.width&&e>0||n.direction==="left"&&n.bounds.left<=0&&e<0){const r=Ro(n.particle.options.bounce.horizontal);n.particle.velocity.x*=-r,t=!0}if(!t)return;const i=n.offset.x+n.size;n.bounds.right>=n.canvasSize.width&&n.direction==="right"?n.particle.position.x=n.canvasSize.width-i:n.bounds.left<=0&&n.direction==="left"&&(n.particle.position.x=i),n.outMode==="split"&&n.particle.destroy()}function MD(n){if(n.outMode!=="bounce"&&n.outMode!=="bounce-vertical"&&n.outMode!=="bounceVertical"&&n.outMode!=="split"||n.direction!=="bottom"&&n.direction!=="top")return;n.bounds.bottom<0&&n.direction==="top"?n.particle.position.y=n.size+n.offset.y:n.bounds.top>n.canvasSize.height&&n.direction==="bottom"&&(n.particle.position.y=n.canvasSize.height-n.size-n.offset.y);const e=n.particle.velocity.y;let t=!1;if(n.direction==="bottom"&&n.bounds.bottom>=n.canvasSize.height&&e>0||n.direction==="top"&&n.bounds.top<=0&&e<0){const r=Ro(n.particle.options.bounce.vertical);n.particle.velocity.y*=-r,t=!0}if(!t)return;const i=n.offset.y+n.size;n.bounds.bottom>=n.canvasSize.height&&n.direction==="bottom"?n.particle.position.y=n.canvasSize.height-i:n.bounds.top<=0&&n.direction==="top"&&(n.particle.position.y=i),n.outMode==="split"&&n.particle.destroy()}class OD{constructor(e){this.container=e,this.modes=["bounce","bounce-vertical","bounce-horizontal","bounceVertical","bounceHorizontal","split"]}update(e,t,i,r){if(!this.modes.includes(r))return;const o=this.container;let l=!1;for(const[,x]of o.plugins)if(x.particleBounce!==void 0&&(l=x.particleBounce(e,i,t)),l)break;if(l)return;const u=e.getPosition(),h=e.offset,p=e.getRadius(),g=mu(u,p),y=o.canvas.size;DD({particle:e,outMode:r,direction:t,bounds:g,canvasSize:y,offset:h,size:p}),MD({particle:e,outMode:r,direction:t,bounds:g,canvasSize:y,offset:h,size:p})}}class LD{constructor(e){this.container=e,this.modes=["destroy"]}update(e,t,i,r){if(!this.modes.includes(r))return;const o=this.container;switch(e.outType){case"normal":case"outside":if(Fy(e.position,o.canvas.size,Bt.origin,e.getRadius(),t))return;break;case"inside":{const{dx:l,dy:u}=xn(e.position,e.moveCenter),{x:h,y:p}=e.velocity;if(h<0&&l>e.moveCenter.radius||p<0&&u>e.moveCenter.radius||h>=0&&l<-e.moveCenter.radius||p>=0&&u<-e.moveCenter.radius)return;break}}o.particles.remove(e,void 0,!0)}}class VD{constructor(e){this.container=e,this.modes=["none"]}update(e,t,i,r){if(!this.modes.includes(r)||e.options.move.distance.horizontal&&(t==="left"||t==="right")||e.options.move.distance.vertical&&(t==="top"||t==="bottom"))return;const o=e.options.move.gravity,l=this.container,u=l.canvas.size,h=e.getRadius();if(o.enable){const p=e.position;(!o.inverse&&p.y>u.height+h&&t==="bottom"||o.inverse&&p.y<-h&&t==="top")&&l.particles.remove(e)}else{if(e.velocity.y>0&&e.position.y<=u.height+h||e.velocity.y<0&&e.position.y>=-h||e.velocity.x>0&&e.position.x<=u.width+h||e.velocity.x<0&&e.position.x>=-h)return;Fy(e.position,l.canvas.size,Bt.origin,h,t)||l.particles.remove(e)}}}class FD{constructor(e){this.container=e,this.modes=["out"]}update(e,t,i,r){if(!this.modes.includes(r))return;const o=this.container;switch(e.outType){case"inside":{const{x:l,y:u}=e.velocity,h=Bt.origin;h.length=e.moveCenter.radius,h.angle=e.velocity.angle+Math.PI,h.addTo(Bt.create(e.moveCenter));const{dx:p,dy:g}=xn(e.position,h);if(l<=0&&p>=0||u<=0&&g>=0||l>=0&&p<=0||u>=0&&g<=0)return;e.position.x=Math.floor(Nn({min:0,max:o.canvas.size.width})),e.position.y=Math.floor(Nn({min:0,max:o.canvas.size.height}));const{dx:y,dy:x}=xn(e.position,e.moveCenter);e.direction=Math.atan2(-x,-y),e.velocity.angle=e.direction;break}default:{if(Fy(e.position,o.canvas.size,Bt.origin,e.getRadius(),t))return;switch(e.outType){case"outside":{e.position.x=Math.floor(Nn({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.x,e.position.y=Math.floor(Nn({min:-e.moveCenter.radius,max:e.moveCenter.radius}))+e.moveCenter.y;const{dx:l,dy:u}=xn(e.position,e.moveCenter);e.moveCenter.radius&&(e.direction=Math.atan2(u,l),e.velocity.angle=e.direction);break}case"normal":{const l=e.options.move.warp,u=o.canvas.size,h={bottom:u.height+e.getRadius()+e.offset.y,left:-e.getRadius()-e.offset.x,right:u.width+e.getRadius()+e.offset.x,top:-e.getRadius()-e.offset.y},p=e.getRadius(),g=mu(e.position,p);t==="right"&&g.left>u.width+e.offset.x?(e.position.x=h.left,e.initialPosition.x=e.position.x,l||(e.position.y=rt()*u.height,e.initialPosition.y=e.position.y)):t==="left"&&g.right<-e.offset.x&&(e.position.x=h.right,e.initialPosition.x=e.position.x,l||(e.position.y=rt()*u.height,e.initialPosition.y=e.position.y)),t==="bottom"&&g.top>u.height+e.offset.y?(l||(e.position.x=rt()*u.width,e.initialPosition.x=e.position.x),e.position.y=h.top,e.initialPosition.y=e.position.y):t==="top"&&g.bottom<-e.offset.y&&(l||(e.position.x=rt()*u.width,e.initialPosition.x=e.position.x),e.position.y=h.bottom,e.initialPosition.y=e.position.y);break}}break}}}}class UD{constructor(e){this.container=e,this._updateOutMode=(t,i,r,o)=>{for(const l of this.updaters)l.update(t,o,i,r)},this.updaters=[new OD(e),new LD(e),new FD(e),new VD(e)]}init(){}isEnabled(e){return!e.destroyed&&!e.spawning}update(e,t){const i=e.options.move.outModes;this._updateOutMode(e,t,i.bottom??i.default,"bottom"),this._updateOutMode(e,t,i.left??i.default,"left"),this._updateOutMode(e,t,i.right??i.default,"right"),this._updateOutMode(e,t,i.top??i.default,"top")}}async function zD(n,e=!0){await n.addParticleUpdater("outModes",t=>new UD(t),e)}function BD(n,e,t,i){switch(n.options.size.animation.destroy){case"max":e>=i&&n.destroy();break;case"min":e<=t&&n.destroy();break}}function qD(n,e){const t=n.size;if(n.destroyed||!t||!t.enable||(t.maxLoops??0)>0&&(t.loops??0)>(t.maxLoops??0))return;const i=(t.velocity??0)*e.factor,r=t.min,o=t.max,l=t.decay??1;if(t.time||(t.time=0),(t.delayTime??0)>0&&t.time<(t.delayTime??0)&&(t.time+=e.value),!((t.delayTime??0)>0&&t.time<(t.delayTime??0))){switch(t.status){case"increasing":t.value>=o?(t.status="decreasing",t.loops||(t.loops=0),t.loops++):t.value+=i;break;case"decreasing":t.value<=r?(t.status="increasing",t.loops||(t.loops=0),t.loops++):t.value-=i}t.velocity&&l!==1&&(t.velocity*=l),BD(n,t.value,r,o),n.destroyed||(t.value=Ni(t.value,r,o))}}class $D{init(e){const t=e.container,i=e.options.size,r=i.animation;r.enable&&(e.size.velocity=(e.retina.sizeAnimationSpeed??t.retina.sizeAnimationSpeed)/100*t.retina.reduceFactor,r.sync||(e.size.velocity*=rt()))}isEnabled(e){return!e.destroyed&&!e.spawning&&e.size.enable&&((e.size.maxLoops??0)<=0||(e.size.maxLoops??0)>0&&(e.size.loops??0)<(e.size.maxLoops??0))}reset(e){e.size.loops=0}update(e,t){this.isEnabled(e)&&qD(e,t)}}async function HD(n,e=!0){await n.addParticleUpdater("size",()=>new $D,e)}async function WD(n,e=!0){await TD(n,!1),await CD(n,!1),await PD(n,!1),await jD(n,!1),await zD(n,!1),await HD(n,!1),await n.refresh(e)}async function GD(){Tm("ease-in-quad",n=>n**2),Tm("ease-out-quad",n=>1-(1-n)**2),Tm("ease-in-out-quad",n=>n<.5?2*n**2:1-(-2*n+2)**2/2)}class KD{constructor(){this.distance=200,this.duration=.4,this.easing="ease-out-quad",this.factor=1,this.maxSpeed=50,this.speed=1}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.easing!==void 0&&(this.easing=e.easing),e.factor!==void 0&&(this.factor=e.factor),e.maxSpeed!==void 0&&(this.maxSpeed=e.maxSpeed),e.speed!==void 0&&(this.speed=e.speed))}}let QD=class extends tr{constructor(e,t){super(t),this._clickAttract=()=>{const i=this.container;i.attract||(i.attract={particles:[]});const{attract:r}=i;if(r.finish||(r.count||(r.count=0),r.count++,r.count===i.particles.count&&(r.finish=!0)),r.clicking){const o=i.interactivity.mouse.clickPosition,l=i.retina.attractModeDistance;if(!l||l<0||!o)return;this._processAttract(o,l,new hn(o.x,o.y,l))}else r.clicking===!1&&(r.particles=[])},this._hoverAttract=()=>{const i=this.container,r=i.interactivity.mouse.position,o=i.retina.attractModeDistance;!o||o<0||!r||this._processAttract(r,o,new hn(r.x,r.y,o))},this._processAttract=(i,r,o)=>{const l=this.container,u=l.actualOptions.interactivity.modes.attract;if(!u)return;const h=l.particles.quadTree.query(o,p=>this.isEnabled(p));for(const p of h){const{dx:g,dy:y,distance:x}=xn(p.position,i),b=u.speed*u.factor,T=Ni(EE(u.easing)(1-x/r)*b,0,u.maxSpeed),C=Bt.create(x===0?b:g/x*T,x===0?b:y/x*T);p.position.subFrom(C)}},this._engine=e,t.attract||(t.attract={particles:[]}),this.handleClickMode=i=>{const r=this.container.actualOptions,o=r.interactivity.modes.attract;if(!(!o||i!=="attract")){t.attract||(t.attract={particles:[]}),t.attract.clicking=!0,t.attract.count=0;for(const l of t.attract.particles)this.isEnabled(l)&&l.velocity.setTo(l.initialVelocity);t.attract.particles=[],t.attract.finish=!1,setTimeout(()=>{t.destroyed||(t.attract||(t.attract={particles:[]}),t.attract.clicking=!1)},o.duration*1e3)}}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.attract;t&&(e.retina.attractModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=e.interactivity.status===No,r=t.interactivity.events,o=r.onHover.enable,l=r.onHover.mode,u=r.onClick.enable,h=r.onClick.mode;i&&o&&wt("attract",l)?this._hoverAttract():u&&wt("attract",h)&&this._clickAttract()}isEnabled(e){const t=this.container,i=t.actualOptions,r=t.interactivity.mouse,o=((e==null?void 0:e.interactivity)??i.interactivity).events;if((!r.position||!o.onHover.enable)&&(!r.clickPosition||!o.onClick.enable))return!1;const l=o.onHover.mode,u=o.onClick.mode;return wt("attract",l)||wt("attract",u)}loadModeOptions(e,...t){e.attract||(e.attract=new KD);for(const i of t)e.attract.load(i==null?void 0:i.attract)}reset(){}};async function YD(n,e=!0){await n.addInteractor("externalAttract",t=>new QD(n,t),e)}class XD{constructor(){this.distance=200}load(e){e&&e.distance!==void 0&&(this.distance=e.distance)}}class JD extends tr{constructor(e){super(e),this._processBounce=(t,i,r)=>{const o=this.container.particles.quadTree.query(r,l=>this.isEnabled(l));for(const l of o)r instanceof hn?IE(xg(l),{position:t,mass:i**2*Math.PI/2,velocity:Bt.origin,factor:Bt.origin}):r instanceof Ri&&K4(l,mu(t,i))},this._processMouseBounce=()=>{const t=this.container,i=t.retina.pixelRatio,r=10*i,o=t.interactivity.mouse.position,l=t.retina.bounceModeDistance;!l||l<0||!o||this._processBounce(o,l,new hn(o.x,o.y,l+r))},this._singleSelectorBounce=(t,i)=>{const r=this.container,o=document.querySelectorAll(t);o.length&&o.forEach(l=>{const u=l,h=r.retina.pixelRatio,p={x:(u.offsetLeft+u.offsetWidth/2)*h,y:(u.offsetTop+u.offsetHeight/2)*h},g=u.offsetWidth/2*h,y=10*h,x=i.type==="circle"?new hn(p.x,p.y,g+y):new Ri(u.offsetLeft*h-y,u.offsetTop*h-y,u.offsetWidth*h+y*2,u.offsetHeight*h+y*2);this._processBounce(p,g,x)})}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bounce;t&&(e.retina.bounceModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=t.interactivity.events,r=e.interactivity.status===No,o=i.onHover.enable,l=i.onHover.mode,u=i.onDiv;r&&o&&wt("bounce",l)?this._processMouseBounce():zy("bounce",u,(h,p)=>this._singleSelectorBounce(h,p))}isEnabled(e){const t=this.container,i=t.actualOptions,r=t.interactivity.mouse,o=((e==null?void 0:e.interactivity)??i.interactivity).events,l=o.onDiv;return r.position&&o.onHover.enable&&wt("bounce",o.onHover.mode)||Uy("bounce",l)}loadModeOptions(e,...t){e.bounce||(e.bounce=new XD);for(const i of t)e.bounce.load(i==null?void 0:i.bounce)}reset(){}}async function ZD(n,e=!0){await n.addInteractor("externalBounce",t=>new JD(t),e)}class GE{constructor(){this.distance=200,this.duration=.4,this.mix=!1}load(e){if(e){if(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.mix!==void 0&&(this.mix=e.mix),e.opacity!==void 0&&(this.opacity=e.opacity),e.color!==void 0){const t=Hn(this.color)?void 0:this.color;this.color=qt(e.color,i=>Jt.create(t,i))}e.size!==void 0&&(this.size=e.size)}}}class eM extends GE{constructor(){super(),this.selectors=[]}get ids(){return qt(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=qt(e,t=>`#${t}`)}load(e){super.load(e),e&&(e.ids!==void 0&&(this.ids=e.ids),e.selectors!==void 0&&(this.selectors=e.selectors))}}class tM extends GE{load(e){super.load(e),e&&(this.divs=qt(e.divs,t=>{const i=new eM;return i.load(t),i}))}}function W_(n,e,t,i){if(e>=t){const r=n+(e-t)*i;return Ni(r,n,e)}else if(e<t){const r=n-(t-e)*i;return Ni(r,e,n)}}class nM extends tr{constructor(e){super(e),this._clickBubble=()=>{var p;const t=this.container,i=t.actualOptions,r=t.interactivity.mouse.clickPosition,o=i.interactivity.modes.bubble;if(!o||!r)return;t.bubble||(t.bubble={});const l=t.retina.bubbleModeDistance;if(!l||l<0)return;const u=t.particles.quadTree.queryCircle(r,l,g=>this.isEnabled(g)),{bubble:h}=t;for(const g of u){if(!h.clicking)continue;g.bubble.inRange=!h.durationEnd;const y=g.getPosition(),x=$n(y,r),b=(new Date().getTime()-(t.interactivity.mouse.clickTime||0))/1e3;b>o.duration&&(h.durationEnd=!0),b>o.duration*2&&(h.clicking=!1,h.durationEnd=!1);const T={bubbleObj:{optValue:t.retina.bubbleModeSize,value:g.bubble.radius},particlesObj:{optValue:gs(g.options.size.value)*t.retina.pixelRatio,value:g.size.value},type:"size"};this._process(g,x,b,T);const C={bubbleObj:{optValue:o.opacity,value:g.bubble.opacity},particlesObj:{optValue:gs(g.options.opacity.value),value:((p=g.opacity)==null?void 0:p.value)??1},type:"opacity"};this._process(g,x,b,C),!h.durationEnd&&x<=l?this._hoverBubbleColor(g,x):delete g.bubble.color}},this._hoverBubble=()=>{const t=this.container,i=t.interactivity.mouse.position,r=t.retina.bubbleModeDistance;if(!r||r<0||i===void 0)return;const o=t.particles.quadTree.queryCircle(i,r,l=>this.isEnabled(l));for(const l of o){l.bubble.inRange=!0;const u=l.getPosition(),h=$n(u,i),p=1-h/r;h<=r?p>=0&&t.interactivity.status===No&&(this._hoverBubbleSize(l,p),this._hoverBubbleOpacity(l,p),this._hoverBubbleColor(l,p)):this.reset(l),t.interactivity.status===yg&&this.reset(l)}},this._hoverBubbleColor=(t,i,r)=>{const o=this.container.actualOptions,l=r??o.interactivity.modes.bubble;if(l){if(!t.bubble.finalColor){const u=l.color;if(!u)return;const h=Ir(u);t.bubble.finalColor=Xc(h)}if(t.bubble.finalColor)if(l.mix){t.bubble.color=void 0;const u=t.getFillColor();t.bubble.color=u?jE(By(u,t.bubble.finalColor,1-i,i)):t.bubble.finalColor}else t.bubble.color=t.bubble.finalColor}},this._hoverBubbleOpacity=(t,i,r)=>{var y,x;const o=this.container,l=o.actualOptions,u=(r==null?void 0:r.opacity)??((y=l.interactivity.modes.bubble)==null?void 0:y.opacity);if(!u)return;const h=t.options.opacity.value,p=((x=t.opacity)==null?void 0:x.value)??1,g=W_(p,u,gs(h),i);g!==void 0&&(t.bubble.opacity=g)},this._hoverBubbleSize=(t,i,r)=>{const o=this.container,l=r!=null&&r.size?r.size*o.retina.pixelRatio:o.retina.bubbleModeSize;if(l===void 0)return;const u=gs(t.options.size.value)*o.retina.pixelRatio,h=t.size.value,p=W_(h,l,u,i);p!==void 0&&(t.bubble.radius=p)},this._process=(t,i,r,o)=>{const l=this.container,u=o.bubbleObj.optValue,h=l.actualOptions,p=h.interactivity.modes.bubble;if(!p||u===void 0)return;const g=p.duration,y=l.retina.bubbleModeDistance,x=o.particlesObj.optValue,b=o.bubbleObj.value,T=o.particlesObj.value||0,C=o.type;if(!(!y||y<0||u===x))if(l.bubble||(l.bubble={}),l.bubble.durationEnd)b&&(C==="size"&&delete t.bubble.radius,C==="opacity"&&delete t.bubble.opacity);else if(i<=y){if((b??T)!==u){const N=T-r*(T-u)/g;C==="size"&&(t.bubble.radius=N),C==="opacity"&&(t.bubble.opacity=N)}}else C==="size"&&delete t.bubble.radius,C==="opacity"&&delete t.bubble.opacity},this._singleSelectorHover=(t,i,r)=>{const o=this.container,l=document.querySelectorAll(i),u=o.actualOptions.interactivity.modes.bubble;!u||!l.length||l.forEach(h=>{const p=h,g=o.retina.pixelRatio,y={x:(p.offsetLeft+p.offsetWidth/2)*g,y:(p.offsetTop+p.offsetHeight/2)*g},x=p.offsetWidth/2*g,b=r.type==="circle"?new hn(y.x,y.y,x):new Ri(p.offsetLeft*g,p.offsetTop*g,p.offsetWidth*g,p.offsetHeight*g),T=o.particles.quadTree.query(b,C=>this.isEnabled(C));for(const C of T){if(!b.contains(C.getPosition()))continue;C.bubble.inRange=!0;const I=u.divs,N=CE(I,p);(!C.bubble.div||C.bubble.div!==p)&&(this.clear(C,t,!0),C.bubble.div=p),this._hoverBubbleSize(C,1,N),this._hoverBubbleOpacity(C,1,N),this._hoverBubbleColor(C,1,N)}})},e.bubble||(e.bubble={}),this.handleClickMode=t=>{t==="bubble"&&(e.bubble||(e.bubble={}),e.bubble.clicking=!0)}}clear(e,t,i){e.bubble.inRange&&!i||(delete e.bubble.div,delete e.bubble.opacity,delete e.bubble.radius,delete e.bubble.color)}init(){const e=this.container,t=e.actualOptions.interactivity.modes.bubble;t&&(e.retina.bubbleModeDistance=t.distance*e.retina.pixelRatio,t.size!==void 0&&(e.retina.bubbleModeSize=t.size*e.retina.pixelRatio))}async interact(e){const t=this.container.actualOptions,i=t.interactivity.events,r=i.onHover,o=i.onClick,l=r.enable,u=r.mode,h=o.enable,p=o.mode,g=i.onDiv;l&&wt("bubble",u)?this._hoverBubble():h&&wt("bubble",p)?this._clickBubble():zy("bubble",g,(y,x)=>this._singleSelectorHover(e,y,x))}isEnabled(e){const t=this.container,i=t.actualOptions,r=t.interactivity.mouse,o=((e==null?void 0:e.interactivity)??i.interactivity).events,{onClick:l,onDiv:u,onHover:h}=o,p=Uy("bubble",u);return p||h.enable&&r.position||l.enable&&r.clickPosition?wt("bubble",h.mode)||wt("bubble",l.mode)||p:!1}loadModeOptions(e,...t){e.bubble||(e.bubble=new tM);for(const i of t)e.bubble.load(i==null?void 0:i.bubble)}reset(e){e.bubble.inRange=!1}}async function iM(n,e=!0){await n.addInteractor("externalBubble",t=>new nM(t),e)}class rM{constructor(){this.opacity=.5}load(e){e&&e.opacity!==void 0&&(this.opacity=e.opacity)}}class sM{constructor(){this.distance=80,this.links=new rM,this.radius=60}get lineLinked(){return this.links}set lineLinked(e){this.links=e}get line_linked(){return this.links}set line_linked(e){this.links=e}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links??e.lineLinked??e.line_linked),e.radius!==void 0&&(this.radius=e.radius))}}function oM(n,e,t,i){const r=Math.floor(t.getRadius()/e.getRadius()),o=e.getFillColor(),l=t.getFillColor();if(!o||!l)return;const u=e.getPosition(),h=t.getPosition(),p=By(o,l,e.getRadius(),t.getRadius()),g=n.createLinearGradient(u.x,u.y,h.x,h.y);return g.addColorStop(0,Jc(o,i)),g.addColorStop(r>1?1:r,kr(p,i)),g.addColorStop(1,Jc(l,i)),g}function aM(n,e,t,i,r){Lc(n,i,r),n.lineWidth=e,n.strokeStyle=t,n.stroke()}function lM(n,e,t,i){const r=n.actualOptions,o=r.interactivity.modes.connect;if(o)return oM(e,t,i,o.links.opacity)}function cM(n,e,t){n.canvas.draw(i=>{const r=lM(n,i,e,t);if(!r)return;const o=e.getPosition(),l=t.getPosition();aM(i,e.retina.linksWidth??0,r,o,l)})}class uM extends tr{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.connect;t&&(e.retina.connectModeDistance=t.distance*e.retina.pixelRatio,e.retina.connectModeRadius=t.radius*e.retina.pixelRatio)}async interact(){const e=this.container;if(e.actualOptions.interactivity.events.onHover.enable&&e.interactivity.status==="pointermove"){const i=e.interactivity.mouse.position;if(!e.retina.connectModeDistance||e.retina.connectModeDistance<0||!e.retina.connectModeRadius||e.retina.connectModeRadius<0||!i)return;const r=Math.abs(e.retina.connectModeRadius),o=e.particles.quadTree.queryCircle(i,r,u=>this.isEnabled(u));let l=0;for(const u of o){const h=u.getPosition();for(const p of o.slice(l+1)){const g=p.getPosition(),y=Math.abs(e.retina.connectModeDistance),x=Math.abs(h.x-g.x),b=Math.abs(h.y-g.y);x<y&&b<y&&cM(e,u,p)}++l}}}isEnabled(e){const t=this.container,i=t.interactivity.mouse,r=((e==null?void 0:e.interactivity)??t.actualOptions.interactivity).events;return r.onHover.enable&&i.position?wt("connect",r.onHover.mode):!1}loadModeOptions(e,...t){e.connect||(e.connect=new sM);for(const i of t)e.connect.load(i==null?void 0:i.connect)}reset(){}}async function hM(n,e=!0){await n.addInteractor("externalConnect",t=>new uM(t),e)}class dM{constructor(){this.blink=!1,this.consent=!1,this.opacity=1}load(e){e&&(e.blink!==void 0&&(this.blink=e.blink),e.color!==void 0&&(this.color=Jt.create(this.color,e.color)),e.consent!==void 0&&(this.consent=e.consent),e.opacity!==void 0&&(this.opacity=e.opacity))}}class fM{constructor(){this.distance=100,this.links=new dM}get lineLinked(){return this.links}set lineLinked(e){this.links=e}get line_linked(){return this.links}set line_linked(e){this.links=e}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),this.links.load(e.links??e.lineLinked??e.line_linked))}}function pM(n,e,t,i,r,o){Lc(n,t,i),n.strokeStyle=kr(r,o),n.lineWidth=e,n.stroke()}function mM(n,e,t,i,r){n.canvas.draw(o=>{const l=e.getPosition();pM(o,e.retina.linksWidth??0,l,r,t,i)})}class gM extends tr{constructor(e){super(e)}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.grab;t&&(e.retina.grabModeDistance=t.distance*e.retina.pixelRatio)}async interact(){var u;const e=this.container,t=e.actualOptions,i=t.interactivity;if(!i.modes.grab||!i.events.onHover.enable||e.interactivity.status!==No)return;const r=e.interactivity.mouse.position;if(!r)return;const o=e.retina.grabModeDistance;if(!o||o<0)return;const l=e.particles.quadTree.queryCircle(r,o,h=>this.isEnabled(h));for(const h of l){const p=h.getPosition(),g=$n(p,r);if(g>o)continue;const y=i.modes.grab.links,x=y.opacity,b=x-g*x/o;if(b<=0)continue;const T=y.color??((u=h.options.links)==null?void 0:u.color);if(!e.particles.grabLineColor&&T){const I=i.modes.grab.links;e.particles.grabLineColor=ME(T,I.blink,I.consent)}const C=wg(h,void 0,e.particles.grabLineColor);C&&mM(e,h,C,b,r)}}isEnabled(e){const t=this.container,i=t.interactivity.mouse,r=((e==null?void 0:e.interactivity)??t.actualOptions.interactivity).events;return r.onHover.enable&&!!i.position&&wt("grab",r.onHover.mode)}loadModeOptions(e,...t){e.grab||(e.grab=new fM);for(const i of t)e.grab.load(i==null?void 0:i.grab)}reset(){}}async function yM(n,e=!0){await n.addInteractor("externalGrab",t=>new gM(t),e)}class vM extends tr{constructor(e){super(e),this.handleClickMode=t=>{if(t!=="pause")return;const i=this.container;i.getAnimationStatus()?i.pause():i.play()}}clear(){}init(){}async interact(){}isEnabled(){return!0}reset(){}}async function xM(n,e=!0){await n.addInteractor("externalPause",t=>new vM(t),e)}class wM{constructor(){this.default=!0,this.groups=[],this.quantity=4}get particles_nb(){return this.quantity}set particles_nb(e){this.quantity=Ae(e)}load(e){if(!e)return;e.default!==void 0&&(this.default=e.default),e.groups!==void 0&&(this.groups=e.groups.map(i=>i)),this.groups.length||(this.default=!0);const t=e.quantity??e.particles_nb;t!==void 0&&(this.quantity=Ae(t))}}class _M extends tr{constructor(e){super(e),this.handleClickMode=t=>{if(t!=="push")return;const i=this.container,r=i.actualOptions,o=r.interactivity.modes.push;if(!o)return;const l=be(o.quantity);if(l<=0)return;const u=nf([void 0,...o.groups]),h=u!==void 0?i.actualOptions.particles.groups[u]:void 0;i.particles.push(l,i.interactivity.mouse,h,u)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(e,...t){e.push||(e.push=new wM);for(const i of t)e.push.load(i==null?void 0:i.push)}reset(){}}async function bM(n,e=!0){await n.addInteractor("externalPush",t=>new _M(t),e)}class EM{constructor(){this.quantity=2}get particles_nb(){return this.quantity}set particles_nb(e){this.quantity=Ae(e)}load(e){if(!e)return;const t=e.quantity??e.particles_nb;t!==void 0&&(this.quantity=Ae(t))}}class TM extends tr{constructor(e){super(e),this.handleClickMode=t=>{const i=this.container,r=i.actualOptions;if(!r.interactivity.modes.remove||t!=="remove")return;const o=be(r.interactivity.modes.remove.quantity);i.particles.removeQuantity(o)}}clear(){}init(){}async interact(){}isEnabled(){return!0}loadModeOptions(e,...t){e.remove||(e.remove=new EM);for(const i of t)e.remove.load(i==null?void 0:i.remove)}reset(){}}async function SM(n,e=!0){await n.addInteractor("externalRemove",t=>new TM(t),e)}class KE{constructor(){this.distance=200,this.duration=.4,this.factor=100,this.speed=1,this.maxSpeed=50,this.easing="ease-out-quad"}load(e){e&&(e.distance!==void 0&&(this.distance=e.distance),e.duration!==void 0&&(this.duration=e.duration),e.easing!==void 0&&(this.easing=e.easing),e.factor!==void 0&&(this.factor=e.factor),e.speed!==void 0&&(this.speed=e.speed),e.maxSpeed!==void 0&&(this.maxSpeed=e.maxSpeed))}}class CM extends KE{constructor(){super(),this.selectors=[]}get ids(){return qt(this.selectors,e=>e.replace("#",""))}set ids(e){this.selectors=qt(e,t=>`#${t}`)}load(e){super.load(e),e&&(e.ids!==void 0&&(this.ids=e.ids),e.selectors!==void 0&&(this.selectors=e.selectors))}}class IM extends KE{load(e){super.load(e),e&&(this.divs=qt(e.divs,t=>{const i=new CM;return i.load(t),i}))}}class kM extends tr{constructor(e,t){super(t),this._clickRepulse=()=>{const i=this.container,r=i.actualOptions.interactivity.modes.repulse;if(!r)return;const o=i.repulse||{particles:[]};if(o.finish||(o.count||(o.count=0),o.count++,o.count===i.particles.count&&(o.finish=!0)),o.clicking){const l=i.retina.repulseModeDistance;if(!l||l<0)return;const u=Math.pow(l/6,3),h=i.interactivity.mouse.clickPosition;if(h===void 0)return;const p=new hn(h.x,h.y,u),g=i.particles.quadTree.query(p,y=>this.isEnabled(y));for(const y of g){const{dx:x,dy:b,distance:T}=xn(h,y.position),C=T**2,I=r.speed,N=-u*I/C;if(C<=u){o.particles.push(y);const D=Bt.create(x,b);D.length=N,y.velocity.setTo(D)}}}else if(o.clicking===!1){for(const l of o.particles)l.velocity.setTo(l.initialVelocity);o.particles=[]}},this._hoverRepulse=()=>{const i=this.container,r=i.interactivity.mouse.position,o=i.retina.repulseModeDistance;!o||o<0||!r||this._processRepulse(r,o,new hn(r.x,r.y,o))},this._processRepulse=(i,r,o,l)=>{const u=this.container,h=u.particles.quadTree.query(o,g=>this.isEnabled(g)),p=u.actualOptions.interactivity.modes.repulse;if(p)for(const g of h){const{dx:y,dy:x,distance:b}=xn(g.position,i),T=((l==null?void 0:l.speed)??p.speed)*p.factor,C=Ni(EE(p.easing)(1-b/r)*T,0,p.maxSpeed),I=Bt.create(b===0?T:y/b*C,b===0?T:x/b*C);g.position.addTo(I)}},this._singleSelectorRepulse=(i,r)=>{const o=this.container,l=o.actualOptions.interactivity.modes.repulse;if(!l)return;const u=document.querySelectorAll(i);u.length&&u.forEach(h=>{const p=h,g=o.retina.pixelRatio,y={x:(p.offsetLeft+p.offsetWidth/2)*g,y:(p.offsetTop+p.offsetHeight/2)*g},x=p.offsetWidth/2*g,b=r.type==="circle"?new hn(y.x,y.y,x):new Ri(p.offsetLeft*g,p.offsetTop*g,p.offsetWidth*g,p.offsetHeight*g),T=l.divs,C=CE(T,p);this._processRepulse(y,x,b,C)})},this._engine=e,t.repulse||(t.repulse={particles:[]}),this.handleClickMode=i=>{const r=this.container.actualOptions,o=r.interactivity.modes.repulse;if(!o||i!=="repulse")return;t.repulse||(t.repulse={particles:[]});const l=t.repulse;l.clicking=!0,l.count=0;for(const u of t.repulse.particles)this.isEnabled(u)&&u.velocity.setTo(u.initialVelocity);l.particles=[],l.finish=!1,setTimeout(()=>{t.destroyed||(l.clicking=!1)},o.duration*1e3)}}clear(){}init(){const e=this.container,t=e.actualOptions.interactivity.modes.repulse;t&&(e.retina.repulseModeDistance=t.distance*e.retina.pixelRatio)}async interact(){const e=this.container,t=e.actualOptions,i=e.interactivity.status===No,r=t.interactivity.events,o=r.onHover,l=o.enable,u=o.mode,h=r.onClick,p=h.enable,g=h.mode,y=r.onDiv;i&&l&&wt("repulse",u)?this._hoverRepulse():p&&wt("repulse",g)?this._clickRepulse():zy("repulse",y,(x,b)=>this._singleSelectorRepulse(x,b))}isEnabled(e){const t=this.container,i=t.actualOptions,r=t.interactivity.mouse,o=((e==null?void 0:e.interactivity)??i.interactivity).events,l=o.onDiv,u=o.onHover,h=o.onClick,p=Uy("repulse",l);if(!(p||u.enable&&r.position||h.enable&&r.clickPosition))return!1;const g=u.mode,y=h.mode;return wt("repulse",g)||wt("repulse",y)||p}loadModeOptions(e,...t){e.repulse||(e.repulse=new IM);for(const i of t)e.repulse.load(i==null?void 0:i.repulse)}reset(){}}async function PM(n,e=!0){await n.addInteractor("externalRepulse",t=>new kM(n,t),e)}class AM{constructor(){this.factor=3,this.radius=200}load(e){e&&(e.factor!==void 0&&(this.factor=e.factor),e.radius!==void 0&&(this.radius=e.radius))}}class NM extends tr{constructor(e){super(e)}clear(e,t,i){e.slow.inRange&&!i||(e.slow.factor=1)}init(){const e=this.container,t=e.actualOptions.interactivity.modes.slow;t&&(e.retina.slowModeRadius=t.radius*e.retina.pixelRatio)}async interact(){}isEnabled(e){const t=this.container,i=t.interactivity.mouse,r=((e==null?void 0:e.interactivity)??t.actualOptions.interactivity).events;return r.onHover.enable&&!!i.position&&wt("slow",r.onHover.mode)}loadModeOptions(e,...t){e.slow||(e.slow=new AM);for(const i of t)e.slow.load(i==null?void 0:i.slow)}reset(e){e.slow.inRange=!1;const t=this.container,i=t.actualOptions,r=t.interactivity.mouse.position,o=t.retina.slowModeRadius,l=i.interactivity.modes.slow;if(!l||!o||o<0||!r)return;const u=e.getPosition(),h=$n(r,u),p=h/o,g=l.factor,{slow:y}=e;h>o||(y.inRange=!0,y.factor=p/g)}}async function RM(n,e=!0){await n.addInteractor("externalSlow",t=>new NM(t),e)}const Vm=[0,4,2,1],G_=[8,8,4,2];class jM{constructor(e){this.pos=0,this.data=new Uint8ClampedArray(e)}getString(e){const t=this.data.slice(this.pos,this.pos+e);return this.pos+=t.length,t.reduce((i,r)=>i+String.fromCharCode(r),"")}nextByte(){return this.data[this.pos++]}nextTwoBytes(){return this.pos+=2,this.data[this.pos-2]+(this.data[this.pos-1]<<8)}readSubBlocks(){let e="",t=0;do{t=this.data[this.pos++];for(let i=t;--i>=0;e+=String.fromCharCode(this.data[this.pos++]));}while(t!==0);return e}readSubBlocksBin(){let e=0,t=0;for(let r=0;(e=this.data[this.pos+r])!==0;r+=e+1)t+=e;const i=new Uint8Array(t);for(let r=0;(e=this.data[this.pos++])!==0;)for(let o=e;--o>=0;i[r++]=this.data[this.pos++]);return i}skipSubBlocks(){for(;this.data[this.pos]!==0;this.pos+=this.data[this.pos]+1);this.pos++}}function QE(n,e){const t=[];for(let i=0;i<e;i++)t.push({r:n.data[n.pos],g:n.data[n.pos+1],b:n.data[n.pos+2]}),n.pos+=3;return t}async function DM(n,e,t,i){switch(n.nextByte()){case 249:{const r=e.frames[t(!1)];n.pos++;const o=n.nextByte();r.GCreserved=(o&224)>>>5,r.disposalMethod=(o&28)>>>2,r.userInputDelayFlag=(o&2)===2;const l=(o&1)===1;r.delayTime=n.nextTwoBytes()*10;const u=n.nextByte();l&&i(u),n.pos++;break}case 255:{n.pos++;const r={identifier:n.getString(8),authenticationCode:n.getString(3),data:n.readSubBlocksBin()};e.applicationExtensions.push(r);break}case 254:{e.comments.push([t(!1),n.readSubBlocks()]);break}case 1:{if(e.globalColorTable.length===0)throw new EvalError("plain text extension without global color table");n.pos++,e.frames[t(!1)].plainTextData={left:n.nextTwoBytes(),top:n.nextTwoBytes(),width:n.nextTwoBytes(),height:n.nextTwoBytes(),charSize:{width:n.nextTwoBytes(),height:n.nextTwoBytes()},foregroundColor:n.nextByte(),backgroundColor:n.nextByte(),text:n.readSubBlocks()};break}default:n.skipSubBlocks();break}}async function MM(n,e,t,i,r,o){const l=e.frames[i(!0)];l.left=n.nextTwoBytes(),l.top=n.nextTwoBytes(),l.width=n.nextTwoBytes(),l.height=n.nextTwoBytes();const u=n.nextByte(),h=(u&128)===128,p=(u&64)===64;l.sortFlag=(u&32)===32,l.reserved=(u&24)>>>3;const g=1<<(u&7)+1;h&&(l.localColorTable=QE(n,g));const y=N=>{const{r:D,g:O,b:L}=(h?l.localColorTable:e.globalColorTable)[N];return{r:D,g:O,b:L,a:N===r(null)?t?~~((D+O+L)/3):0:255}},x=(()=>{try{return new ImageData(l.width,l.height,{colorSpace:"srgb"})}catch(N){if(N instanceof DOMException&&N.name==="IndexSizeError")return null;throw N}})();if(x==null)throw new EvalError("GIF frame size is to large");const b=n.nextByte(),T=n.readSubBlocksBin(),C=1<<b,I=(N,D)=>{const O=N>>>3,L=N&7;return(T[O]+(T[O+1]<<8)+(T[O+2]<<16)&(1<<D)-1<<L)>>>L};if(p){for(let N=0,D=b+1,O=0,L=[[0]],G=0;G<4;G++)if(Vm[G]<l.height)for(let X=0,k=0;;){const P=N;if(N=I(O,D),O+=D+1,N===C){D=b+1,L.length=C+2;for(let R=0;R<L.length;R++)L[R]=R<C?[R]:[]}else{N>=L.length?L.push(L[P].concat(L[P][0])):P!==C&&L.push(L[P].concat(L[N][0]));for(let R=0;R<L[N].length;R++){const{r:F,g:z,b:q,a:M}=y(L[N][R]);x.data.set([F,z,q,M],Vm[G]*l.width+G_[G]*k+X%(l.width*4)),X+=4}L.length===1<<D&&D<12&&D++}if(X===l.width*4*(k+1)&&(k++,Vm[G]+G_[G]*k>=l.height))break}l.image=x,l.bitmap=await createImageBitmap(x)}else{for(let N=0,D=b+1,O=0,L=[[0]],G=-4;;){const X=N;if(N=I(O,D),O+=D,N===C){D=b+1,L.length=C+2;for(let k=0;k<L.length;k++)L[k]=k<C?[k]:[]}else{if(N===C+1)break;N>=L.length?L.push(L[X].concat(L[X][0])):X!==C&&L.push(L[X].concat(L[N][0]));for(let k=0;k<L[N].length;k++){const{r:P,g:R,b:F,a:z}=y(L[N][k]);x.data.set([P,R,F,z],G+=4)}L.length>=1<<D&&D<12&&D++}}l.image=x,l.bitmap=await createImageBitmap(x)}}async function OM(n,e,t,i,r,o){switch(n.nextByte()){case 59:return!0;case 44:await MM(n,e,t,i,r);break;case 33:await DM(n,e,i,r);break;default:throw new EvalError("undefined block found")}return!1}function LM(n){for(const e of n.applicationExtensions)if(e.identifier+e.authenticationCode==="NETSCAPE2.0")return e.data[1]+(e.data[2]<<8);return NaN}async function VM(n,e,t){t||(t=!1);const i=await fetch(n);if(!i.ok&&i.status===404)throw new EvalError("file not found");const r=await i.arrayBuffer(),o={width:0,height:0,totalTime:0,colorRes:0,pixelAspectRatio:0,frames:[],sortFlag:!1,globalColorTable:[],backgroundImage:new ImageData(1,1,{colorSpace:"srgb"}),comments:[],applicationExtensions:[]},l=new jM(new Uint8ClampedArray(r));if(l.getString(6)!=="GIF89a")throw new Error("not a supported GIF file");o.width=l.nextTwoBytes(),o.height=l.nextTwoBytes();const u=l.nextByte(),h=(u&128)===128;o.colorRes=(u&112)>>>4,o.sortFlag=(u&8)===8;const p=1<<(u&7)+1,g=l.nextByte();o.pixelAspectRatio=l.nextByte(),o.pixelAspectRatio!==0&&(o.pixelAspectRatio=(o.pixelAspectRatio+15)/64),h&&(o.globalColorTable=QE(l,p));const y=(()=>{try{return new ImageData(o.width,o.height,{colorSpace:"srgb"})}catch(L){if(L instanceof DOMException&&L.name==="IndexSizeError")return null;throw L}})();if(y==null)throw new Error("GIF frame size is to large");const{r:x,g:b,b:T}=o.globalColorTable[g];y.data.set(h?[x,b,T,255]:[0,0,0,0]);for(let L=4;L<y.data.length;L*=2)y.data.copyWithin(L,0,L);o.backgroundImage=y;let C=-1,I=!0,N=-1;const D=L=>(L&&(I=!0),C),O=L=>(L!=null&&(N=L),N);try{do I&&(o.frames.push({left:0,top:0,width:0,height:0,disposalMethod:0,image:new ImageData(1,1,{colorSpace:"srgb"}),plainTextData:null,userInputDelayFlag:!1,delayTime:0,sortFlag:!1,localColorTable:[],reserved:0,GCreserved:0}),C++,N=-1,I=!1);while(!await OM(l,o,t,D,O,e));o.frames.length--;for(const L of o.frames){if(L.userInputDelayFlag&&L.delayTime===0){o.totalTime=1/0;break}o.totalTime+=L.delayTime}return o}catch(L){throw L instanceof EvalError?new Error(`error while parsing frame ${C} "${L.message}"`):L}}const FM=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d.]+%?\))|currentcolor/gi;function UM(n,e,t){const{svgData:i}=n;if(!i)return"";const r=Jc(e,t);if(i.includes("fill"))return i.replace(FM,()=>r);const o=i.indexOf(">");return`${i.substring(0,o)} fill="${r}"${i.substring(o)}`}async function sf(n){return new Promise(e=>{n.loading=!0;const t=new Image;n.element=t,t.addEventListener("load",()=>{n.loading=!1,e()}),t.addEventListener("error",()=>{n.element=void 0,n.error=!0,n.loading=!1,jo().error(`${ci} loading image: ${n.source}`),e()}),t.src=n.source})}async function zM(n){if(n.type!=="gif"){await sf(n);return}n.loading=!0;try{n.gifData=await VM(n.source),n.gifLoopCount=LM(n.gifData)??0,n.gifLoopCount===0&&(n.gifLoopCount=1/0)}catch{n.error=!0}n.loading=!1}async function BM(n){if(n.type!=="svg"){await sf(n);return}n.loading=!0;const e=await fetch(n.source);e.ok?n.svgData=await e.text():(jo().error(`${ci} Image not found`),n.error=!0),n.loading=!1}function qM(n,e,t,i){var l;const r=UM(n,t,((l=i.opacity)==null?void 0:l.value)??1),o={color:t,gif:e.gif,data:{...n,svgData:r},loaded:!1,ratio:e.width/e.height,replaceColor:e.replaceColor??e.replace_color,source:e.src};return new Promise(u=>{const h=new Blob([r],{type:"image/svg+xml"}),p=URL||window.URL||window.webkitURL||window,g=p.createObjectURL(h),y=new Image;y.addEventListener("load",()=>{o.loaded=!0,o.element=y,u(o),p.revokeObjectURL(g)}),y.addEventListener("error",async()=>{p.revokeObjectURL(g);const x={...n,error:!1,loading:!0};await sf(x),o.loaded=!0,o.element=x.element,u(o)}),y.src=g})}class $M{constructor(e){this.loadImageShape=async t=>{if(!this._engine.loadImage)throw new Error(`${ci} image shape not initialized`);await this._engine.loadImage({gif:t.gif,name:t.name,replaceColor:t.replaceColor??t.replace_color??!1,src:t.src})},this._engine=e}addImage(e){this._engine.images||(this._engine.images=[]),this._engine.images.push(e)}draw(e,t,i,r,o){const l=t.image,u=l==null?void 0:l.element;if(l){if(e.globalAlpha=r,l.gif&&l.gifData){const h=new OffscreenCanvas(l.gifData.width,l.gifData.height),p=h.getContext("2d");if(!p)throw new Error("could not create offscreen canvas context");p.imageSmoothingQuality="low",p.imageSmoothingEnabled=!1,p.clearRect(0,0,h.width,h.height),t.gifLoopCount===void 0&&(t.gifLoopCount=l.gifLoopCount??0);let g=t.gifFrame??0;const y={x:-l.gifData.width*.5,y:-l.gifData.height*.5},x=l.gifData.frames[g];if(t.gifTime===void 0&&(t.gifTime=0),!x.bitmap)return;switch(e.scale(i/l.gifData.width,i/l.gifData.height),x.disposalMethod){case 4:case 5:case 6:case 7:case 0:p.drawImage(x.bitmap,x.left,x.top),e.drawImage(h,y.x,y.y),p.clearRect(0,0,h.width,h.height);break;case 1:p.drawImage(x.bitmap,x.left,x.top),e.drawImage(h,y.x,y.y);break;case 2:p.drawImage(x.bitmap,x.left,x.top),e.drawImage(h,y.x,y.y),p.clearRect(0,0,h.width,h.height),l.gifData.globalColorTable.length===0?p.putImageData(l.gifData.frames[0].image,y.x+x.left,y.y+x.top):p.putImageData(l.gifData.backgroundImage,y.x,y.y);break;case 3:{const b=p.getImageData(0,0,h.width,h.height);p.drawImage(x.bitmap,x.left,x.top),e.drawImage(h,y.x,y.y),p.clearRect(0,0,h.width,h.height),p.putImageData(b,0,0)}break}if(t.gifTime+=o.value,t.gifTime>x.delayTime){if(t.gifTime-=x.delayTime,++g>=l.gifData.frames.length){if(--t.gifLoopCount<=0)return;g=0,p.clearRect(0,0,h.width,h.height)}t.gifFrame=g}e.scale(l.gifData.width/i,l.gifData.height/i)}else if(u){const h=l.ratio,p={x:-i,y:-i};e.drawImage(u,p.x,p.y,i*2,i*2/h)}e.globalAlpha=1}}getSidesCount(){return 12}async init(e){const t=e.actualOptions;if(!(!t.preload||!this._engine.loadImage))for(const i of t.preload)await this._engine.loadImage(i)}loadShape(e){if(e.shape!=="image"&&e.shape!=="images")return;this._engine.images||(this._engine.images=[]);const t=e.shapeData;this._engine.images.find(r=>r.name===t.name||r.source===t.src)||this.loadImageShape(t).then(()=>{this.loadShape(e)})}particleInit(e,t){if(t.shape!=="image"&&t.shape!=="images")return;this._engine.images||(this._engine.images=[]);const i=this._engine.images,r=t.shapeData,o=t.getFillColor(),l=i.find(h=>h.name===r.name||h.source===r.src);if(!l)return;const u=r.replaceColor??r.replace_color??l.replaceColor;if(l.loading){setTimeout(()=>{this.particleInit(e,t)});return}(async()=>{let h;l.svgData&&o?h=await qM(l,r,o,t):h={color:o,data:l,element:l.element,gif:l.gif,gifData:l.gifData,gifLoopCount:l.gifLoopCount,loaded:!0,ratio:r.width&&r.height?r.width/r.height:l.ratio??1,replaceColor:u,source:r.src},h.ratio||(h.ratio=1);const p=r.fill??t.fill,g=r.close??t.close,y={image:h,fill:p,close:g};t.image=y.image,t.fill=y.fill,t.close=y.close})()}}class HM{constructor(){this.src="",this.gif=!1}load(e){e&&(e.gif!==void 0&&(this.gif=e.gif),e.height!==void 0&&(this.height=e.height),e.name!==void 0&&(this.name=e.name),e.replaceColor!==void 0&&(this.replaceColor=e.replaceColor),e.src!==void 0&&(this.src=e.src),e.width!==void 0&&(this.width=e.width))}}class WM{constructor(e){this.id="imagePreloader",this._engine=e}getPlugin(){return{}}loadOptions(e,t){if(!t||!t.preload)return;e.preload||(e.preload=[]);const i=e.preload;for(const r of t.preload){const o=i.find(l=>l.name===r.name||l.src===r.src);if(o)o.load(r);else{const l=new HM;l.load(r),i.push(l)}}}needsPlugin(){return!0}}function GM(n){n.loadImage||(n.loadImage=async e=>{if(!e.name&&!e.src)throw new Error(`${ci} no image source provided`);if(n.images||(n.images=[]),!n.images.find(t=>t.name===e.name||t.source===e.src))try{const t={gif:e.gif??!1,name:e.name??e.src,source:e.src,type:e.src.substring(e.src.length-3),error:!1,loading:!0,replaceColor:e.replaceColor,ratio:e.width&&e.height?e.width/e.height:void 0};n.images.push(t),await(e.gif?zM:e.replaceColor?BM:sf)(t)}catch{throw new Error(`${ci} ${e.name??e.src} not found`)}})}async function KM(n,e=!0){GM(n);const t=new WM(n);await n.addPlugin(t,e),await n.addShape(["image","images"],new $M(n),e)}class QM extends Fs{constructor(){super(),this.sync=!1}load(e){e&&(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class YM extends Fs{constructor(){super(),this.random.minimumValue=1e-4,this.sync=!1}load(e){e&&(super.load(e),e.sync!==void 0&&(this.sync=e.sync))}}class XM{constructor(){this.count=0,this.delay=new QM,this.duration=new YM}load(e){e&&(e.count!==void 0&&(this.count=e.count),this.delay.load(e.delay),this.duration.load(e.duration))}}class JM{constructor(e){this.container=e}init(e){const t=this.container,i=e.options,r=i.life;r&&(e.life={delay:t.retina.reduceFactor?be(r.delay.value)*(r.delay.sync?1:rt())/t.retina.reduceFactor*1e3:0,delayTime:0,duration:t.retina.reduceFactor?be(r.duration.value)*(r.duration.sync?1:rt())/t.retina.reduceFactor*1e3:0,time:0,count:r.count},e.life.duration<=0&&(e.life.duration=-1),e.life.count<=0&&(e.life.count=-1),e.life&&(e.spawning=e.life.delay>0))}isEnabled(e){return!e.destroyed}loadOptions(e,...t){e.life||(e.life=new XM);for(const i of t)e.life.load(i==null?void 0:i.life)}update(e,t){if(!this.isEnabled(e)||!e.life)return;const i=e.life;let r=!1;if(e.spawning)if(i.delayTime+=t.value,i.delayTime>=e.life.delay)r=!0,e.spawning=!1,i.delayTime=0,i.time=0;else return;if(i.duration===-1||e.spawning||(r?i.time=0:i.time+=t.value,i.time<i.duration))return;if(i.time=0,e.life.count>0&&e.life.count--,e.life.count===0){e.destroy();return}const o=this.container.canvas.size,l=Ae(0,o.width),u=Ae(0,o.width);e.position.x=Nn(l),e.position.y=Nn(u),e.spawning=!0,i.delayTime=0,i.time=0,e.reset();const h=e.options.life;h&&(i.delay=be(h.delay.value)*1e3,i.duration=be(h.duration.value)*1e3)}}async function ZM(n,e=!0){await n.addParticleUpdater("life",t=>new JM(t),e)}class e3{draw(e,t,i){const r=t.shapeData;e.moveTo(-i/2,0),e.lineTo(i/2,0),e.lineCap=(r==null?void 0:r.cap)??"butt"}getSidesCount(){return 1}}async function t3(n,e=!0){await n.addShape("line",new e3,e)}class n3{init(){}isEnabled(e){return!rl()&&!e.destroyed&&e.container.actualOptions.interactivity.events.onHover.parallax.enable}move(e){const t=e.container,i=t.actualOptions,r=i.interactivity.events.onHover.parallax;if(rl()||!r.enable)return;const o=r.force,l=t.interactivity.mouse.position;if(!l)return;const u=t.canvas.size,h={x:u.width/2,y:u.height/2},p=r.smooth,g=e.getRadius()/o,y={x:(l.x-h.x)*g,y:(l.y-h.y)*g},{offset:x}=e;x.x+=(y.x-x.x)/p,x.y+=(y.y-x.y)/p}}async function i3(n,e=!0){await n.addMover("parallax",()=>new n3,e)}class r3 extends qy{constructor(e){super(e)}clear(){}init(){}async interact(e){const t=this.container,i=e.retina.attractDistance??t.retina.attractDistance,r=e.getPosition(),o=t.particles.quadTree.queryCircle(r,i);for(const l of o){if(e===l||!l.options.move.attract.enable||l.destroyed||l.spawning)continue;const u=l.getPosition(),{dx:h,dy:p}=xn(r,u),g=e.options.move.attract.rotate,y=h/(g.x*1e3),x=p/(g.y*1e3),b=l.size.value/e.size.value,T=1/b;e.velocity.x-=y*b,e.velocity.y-=x*b,l.velocity.x+=y*T,l.velocity.y+=x*T}}isEnabled(e){return e.options.move.attract.enable}reset(){}}async function s3(n,e=!0){await n.addInteractor("particlesAttract",t=>new r3(t),e)}function K_(n,e,t,i,r,o){const l=Ni(n.options.collisions.absorb.speed*r.factor/10,0,i);n.size.value+=l/2,t.size.value-=l,i<=o&&(t.size.value=0,t.destroy())}function o3(n,e,t,i){const r=n.getRadius(),o=e.getRadius();r===void 0&&o!==void 0?n.destroy():r!==void 0&&o===void 0?e.destroy():r!==void 0&&o!==void 0&&(r>=o?K_(n,r,e,o,t,i):K_(e,o,n,r,t,i))}const Q_=n=>{n.collisionMaxSpeed===void 0&&(n.collisionMaxSpeed=be(n.options.collisions.maxSpeed)),n.velocity.length>n.collisionMaxSpeed&&(n.velocity.length=n.collisionMaxSpeed)};function YE(n,e){IE(xg(n),xg(e)),Q_(n),Q_(e)}function a3(n,e){!n.unbreakable&&!e.unbreakable&&YE(n,e),n.getRadius()===void 0&&e.getRadius()!==void 0?n.destroy():n.getRadius()!==void 0&&e.getRadius()===void 0?e.destroy():n.getRadius()!==void 0&&e.getRadius()!==void 0&&(n.getRadius()>=e.getRadius()?e:n).destroy()}function l3(n,e,t,i){switch(n.options.collisions.mode){case"absorb":{o3(n,e,t,i);break}case"bounce":{YE(n,e);break}case"destroy":{a3(n,e);break}}}class c3 extends qy{constructor(e){super(e)}clear(){}init(){}async interact(e,t){if(e.destroyed||e.spawning)return;const i=this.container,r=e.getPosition(),o=e.getRadius(),l=i.particles.quadTree.queryCircle(r,o*2);for(const u of l){if(e===u||!u.options.collisions.enable||e.options.collisions.mode!==u.options.collisions.mode||u.destroyed||u.spawning)continue;const h=u.getPosition(),p=u.getRadius();if(Math.abs(Math.round(r.z)-Math.round(h.z))>o+p)continue;const g=$n(r,h),y=o+p;g>y||l3(e,u,t,i.retina.pixelRatio)}}isEnabled(e){return e.options.collisions.enable}reset(){}}async function u3(n,e=!0){await n.addInteractor("particlesCollisions",t=>new c3(t),e)}class h3 extends hn{constructor(e,t,i,r){super(e,t,i),this.canvasSize=r,this.canvasSize={...r}}contains(e){const{width:t,height:i}=this.canvasSize,{x:r,y:o}=e;return super.contains(e)||super.contains({x:r-t,y:o})||super.contains({x:r-t,y:o-i})||super.contains({x:r,y:o-i})}intersects(e){if(super.intersects(e))return!0;const t=e,i=e,r={x:e.position.x-this.canvasSize.width,y:e.position.y-this.canvasSize.height};if(i.radius!==void 0){const o=new hn(r.x,r.y,i.radius*2);return super.intersects(o)}else if(t.size!==void 0){const o=new Ri(r.x,r.y,t.size.width*2,t.size.height*2);return super.intersects(o)}return!1}}class d3{constructor(){this.blur=5,this.color=new Jt,this.color.value="#000",this.enable=!1}load(e){e&&(e.blur!==void 0&&(this.blur=e.blur),this.color=Jt.create(this.color,e.color),e.enable!==void 0&&(this.enable=e.enable))}}class f3{constructor(){this.enable=!1,this.frequency=1}load(e){e&&(e.color!==void 0&&(this.color=Jt.create(this.color,e.color)),e.enable!==void 0&&(this.enable=e.enable),e.frequency!==void 0&&(this.frequency=e.frequency),e.opacity!==void 0&&(this.opacity=e.opacity))}}class p3{constructor(){this.blink=!1,this.color=new Jt,this.color.value="#fff",this.consent=!1,this.distance=100,this.enable=!1,this.frequency=1,this.opacity=1,this.shadow=new d3,this.triangles=new f3,this.width=1,this.warp=!1}load(e){e&&(e.id!==void 0&&(this.id=e.id),e.blink!==void 0&&(this.blink=e.blink),this.color=Jt.create(this.color,e.color),e.consent!==void 0&&(this.consent=e.consent),e.distance!==void 0&&(this.distance=e.distance),e.enable!==void 0&&(this.enable=e.enable),e.frequency!==void 0&&(this.frequency=e.frequency),e.opacity!==void 0&&(this.opacity=e.opacity),this.shadow.load(e.shadow),this.triangles.load(e.triangles),e.width!==void 0&&(this.width=e.width),e.warp!==void 0&&(this.warp=e.warp))}}function m3(n,e,t,i,r){const{dx:o,dy:l,distance:u}=xn(n,e);if(!r||u<=t)return u;const h={x:Math.abs(o),y:Math.abs(l)},p={x:Math.min(h.x,i.width-h.x),y:Math.min(h.y,i.height-h.y)};return Math.sqrt(p.x**2+p.y**2)}class g3 extends qy{constructor(e){super(e),this._setColor=t=>{if(!t.options.links)return;const i=this.linkContainer,r=t.options.links;let o=r.id===void 0?i.particles.linksColor:i.particles.linksColors.get(r.id);if(o)return;const l=r.color;o=ME(l,r.blink,r.consent),r.id===void 0?i.particles.linksColor=o:i.particles.linksColors.set(r.id,o)},this.linkContainer=e}clear(){}init(){this.linkContainer.particles.linksColor=void 0,this.linkContainer.particles.linksColors=new Map}async interact(e){if(!e.options.links)return;e.links=[];const t=e.getPosition(),i=this.container,r=i.canvas.size;if(t.x<0||t.y<0||t.x>r.width||t.y>r.height)return;const o=e.options.links,l=o.opacity,u=e.retina.linksDistance??0,h=o.warp,p=h?new h3(t.x,t.y,u,r):new hn(t.x,t.y,u),g=i.particles.quadTree.query(p);for(const y of g){const x=y.options.links;if(e===y||!(x!=null&&x.enable)||o.id!==x.id||y.spawning||y.destroyed||!y.links||e.links.some(I=>I.destination===y)||y.links.some(I=>I.destination===e))continue;const b=y.getPosition();if(b.x<0||b.y<0||b.x>r.width||b.y>r.height)continue;const T=m3(t,b,u,r,h&&x.warp);if(T>u)continue;const C=(1-T/u)*l;this._setColor(e),e.links.push({destination:y,opacity:C})}}isEnabled(e){var t;return!!((t=e.options.links)!=null&&t.enable)}loadParticlesOptions(e,...t){e.links||(e.links=new p3);for(const i of t)e.links.load((i==null?void 0:i.links)??(i==null?void 0:i.lineLinked)??(i==null?void 0:i.line_linked))}reset(){}}async function y3(n,e=!0){await n.addInteractor("particlesLinks",t=>new g3(t),e)}function v3(n){let e=!1;const{begin:t,end:i,maxDistance:r,context:o,canvasSize:l,width:u,backgroundMask:h,colorLine:p,opacity:g,links:y}=n;if($n(t,i)<=r)Lc(o,t,i),e=!0;else if(y.warp){let b,T;const C={x:i.x-l.width,y:i.y},I=xn(t,C);if(I.distance<=r){const N=t.y-I.dy/I.dx*t.x;b={x:0,y:N},T={x:l.width,y:N}}else{const N={x:i.x,y:i.y-l.height},D=xn(t,N);if(D.distance<=r){const L=-(t.y-D.dy/D.dx*t.x)/(D.dy/D.dx);b={x:L,y:0},T={x:L,y:l.height}}else{const O={x:i.x-l.width,y:i.y-l.height},L=xn(t,O);if(L.distance<=r){const G=t.y-L.dy/L.dx*t.x;b={x:-G/(L.dy/L.dx),y:G},T={x:b.x+l.width,y:b.y+l.height}}}}b&&T&&(Lc(o,t,b),Lc(o,i,T),e=!0)}if(!e)return;o.lineWidth=u,h.enable&&(o.globalCompositeOperation=h.composite),o.strokeStyle=kr(p,g);const{shadow:x}=y;if(x.enable){const b=Pi(x.color);b&&(o.shadowBlur=x.blur,o.shadowColor=kr(b))}o.stroke()}function x3(n){const{context:e,pos1:t,pos2:i,pos3:r,backgroundMask:o,colorTriangle:l,opacityTriangle:u}=n;Z4(e,t,i,r),o.enable&&(e.globalCompositeOperation=o.composite),e.fillStyle=kr(l,u),e.fill()}function w3(n){return n.sort((e,t)=>e-t),n.join("_")}function Y_(n,e){const t=w3(n.map(r=>r.id));let i=e.get(t);return i===void 0&&(i=rt(),e.set(t,i)),i}class _3{constructor(e){this.container=e,this._drawLinkLine=(t,i)=>{const r=t.options.links;if(!(r!=null&&r.enable))return;const o=this.container,l=o.actualOptions,u=i.destination,h=t.getPosition(),p=u.getPosition();let g=i.opacity;o.canvas.draw(y=>{var N;let x;const b=(N=t.options.twinkle)==null?void 0:N.lines;if(b!=null&&b.enable){const D=b.frequency,O=Pi(b.color);rt()<D&&O&&(x=O,g=be(b.opacity))}if(!x){const D=r.id!==void 0?o.particles.linksColors.get(r.id):o.particles.linksColor;x=wg(t,u,D)}if(!x)return;const T=t.retina.linksWidth??0,C=t.retina.linksDistance??0,{backgroundMask:I}=l;v3({context:y,width:T,begin:h,end:p,maxDistance:C,canvasSize:o.canvas.size,links:r,backgroundMask:I,colorLine:x,opacity:g})})},this._drawLinkTriangle=(t,i,r)=>{const o=t.options.links;if(!(o!=null&&o.enable))return;const l=o.triangles;if(!l.enable)return;const u=this.container,h=u.actualOptions,p=i.destination,g=r.destination,y=l.opacity??(i.opacity+r.opacity)/2;y<=0||u.canvas.draw(x=>{const b=t.getPosition(),T=p.getPosition(),C=g.getPosition(),I=t.retina.linksDistance??0;if($n(b,T)>I||$n(C,T)>I||$n(C,b)>I)return;let N=Pi(l.color);if(!N){const D=o.id!==void 0?u.particles.linksColors.get(o.id):u.particles.linksColor;N=wg(t,p,D)}N&&x3({context:x,pos1:b,pos2:T,pos3:C,backgroundMask:h.backgroundMask,colorTriangle:N,opacityTriangle:y})})},this._drawTriangles=(t,i,r,o)=>{var h,p,g;const l=r.destination;if(!((h=t.links)!=null&&h.triangles.enable&&((p=l.options.links)!=null&&p.triangles.enable)))return;const u=(g=l.links)==null?void 0:g.filter(y=>{const x=this._getLinkFrequency(l,y.destination);return l.options.links&&x<=l.options.links.frequency&&o.findIndex(b=>b.destination===y.destination)>=0});if(u!=null&&u.length)for(const y of u){const x=y.destination;this._getTriangleFrequency(i,l,x)>t.links.triangles.frequency||this._drawLinkTriangle(i,r,y)}},this._getLinkFrequency=(t,i)=>Y_([t,i],this._freqs.links),this._getTriangleFrequency=(t,i,r)=>Y_([t,i,r],this._freqs.triangles),this._freqs={links:new Map,triangles:new Map}}drawParticle(e,t){const{links:i,options:r}=t;if(!i||i.length<=0)return;const o=i.filter(l=>r.links&&this._getLinkFrequency(t,l.destination)<=r.links.frequency);for(const l of o)this._drawTriangles(r,t,l,o),l.opacity>0&&(t.retina.linksWidth??0)>0&&this._drawLinkLine(t,l)}async init(){this._freqs.links=new Map,this._freqs.triangles=new Map}particleCreated(e){if(e.links=[],!e.options.links)return;const t=this.container.retina.pixelRatio,{retina:i}=e,{distance:r,width:o}=e.options.links;i.linksDistance=r*t,i.linksWidth=o*t}particleDestroyed(e){e.links=[]}}class b3{constructor(){this.id="links"}getPlugin(e){return new _3(e)}loadOptions(){}needsPlugin(){return!0}}async function E3(n,e=!0){const t=new b3;await n.addPlugin(t,e)}async function T3(n,e=!0){await y3(n,e),await E3(n,e)}class XE{draw(e,t,i){const r=this.getCenter(t,i),o=this.getSidesData(t,i),l=o.count.numerator*o.count.denominator,u=o.count.numerator/o.count.denominator,h=180*(u-2)/u,p=Math.PI-Math.PI*h/180;if(e){e.beginPath(),e.translate(r.x,r.y),e.moveTo(0,0);for(let g=0;g<l;g++)e.lineTo(o.length,0),e.translate(o.length,0),e.rotate(p)}}getSidesCount(e){const t=e.shapeData;return Math.round(be((t==null?void 0:t.sides)??(t==null?void 0:t.nb_sides)??5))}}class S3 extends XE{getCenter(e,t){return{x:-t/(e.sides/3.5),y:-t/(2.66/3.5)}}getSidesData(e,t){const i=e.sides;return{count:{denominator:1,numerator:i},length:t*2.66/(i/3)}}}class C3 extends XE{getCenter(e,t){return{x:-t,y:t/1.66}}getSidesCount(){return 3}getSidesData(e,t){return{count:{denominator:2,numerator:3},length:t*2}}}async function I3(n,e=!0){await n.addShape("polygon",new S3,e)}async function k3(n,e=!0){await n.addShape("triangle",new C3,e)}async function P3(n,e=!0){await I3(n,e),await k3(n,e)}class A3{constructor(){this.enable=!1,this.speed=0,this.decay=0,this.sync=!1}load(e){e&&(e.enable!==void 0&&(this.enable=e.enable),e.speed!==void 0&&(this.speed=Ae(e.speed)),e.decay!==void 0&&(this.decay=Ae(e.decay)),e.sync!==void 0&&(this.sync=e.sync))}}class N3 extends Fs{constructor(){super(),this.animation=new A3,this.direction="clockwise",this.path=!1,this.value=0}load(e){e&&(super.load(e),e.direction!==void 0&&(this.direction=e.direction),this.animation.load(e.animation),e.path!==void 0&&(this.path=e.path))}}function R3(n,e){const t=n.rotate,i=n.options.rotate;if(!t||!i)return;const r=i.animation,o=(t.velocity??0)*e.factor,l=2*Math.PI,u=t.decay??1;if(r.enable){switch(t.status){case"increasing":t.value+=o,t.value>l&&(t.value-=l);break;case"decreasing":default:t.value-=o,t.value<0&&(t.value+=l);break}t.velocity&&u!==1&&(t.velocity*=u)}}class j3{constructor(e){this.container=e}init(e){const t=e.options.rotate;if(!t)return;e.rotate={enable:t.animation.enable,value:be(t.value)*Math.PI/180},e.pathRotation=t.path;let i=t.direction;switch(i==="random"&&(i=Math.floor(rt()*2)>0?"counter-clockwise":"clockwise"),i){case"counter-clockwise":case"counterClockwise":e.rotate.status="decreasing";break;case"clockwise":e.rotate.status="increasing";break}const r=t.animation;r.enable&&(e.rotate.decay=1-be(r.decay),e.rotate.velocity=be(r.speed)/360*this.container.retina.reduceFactor,r.sync||(e.rotate.velocity*=rt())),e.rotation=e.rotate.value}isEnabled(e){const t=e.options.rotate;return t?!e.destroyed&&!e.spawning&&t.animation.enable&&!t.path:!1}loadOptions(e,...t){e.rotate||(e.rotate=new N3);for(const i of t)e.rotate.load(i==null?void 0:i.rotate)}update(e,t){var i;this.isEnabled(e)&&(R3(e,t),e.rotation=((i=e.rotate)==null?void 0:i.value)??0)}}async function D3(n,e=!0){await n.addParticleUpdater("rotate",t=>new j3(t),e)}const M3=Math.sqrt(2);class O3{draw(e,t,i){const r=i/M3,o=r*2;e.rect(-r,-r,o,o)}getSidesCount(){return 4}}async function L3(n,e=!0){await n.addShape(["edge","square"],new O3,e)}class V3{draw(e,t,i){const r=t.sides,o=t.starInset??2;e.moveTo(0,0-i);for(let l=0;l<r;l++)e.rotate(Math.PI/r),e.lineTo(0,0-i*o),e.rotate(Math.PI/r),e.lineTo(0,0-i)}getSidesCount(e){const t=e.shapeData;return Math.round(be((t==null?void 0:t.sides)??(t==null?void 0:t.nb_sides)??5))}particleInit(e,t){const i=t.shapeData,r=be((i==null?void 0:i.inset)??2);t.starInset=r}}async function F3(n,e=!0){await n.addShape("star",new V3,e)}function Fm(n,e,t,i,r){if(!e||!t.enable||(e.maxLoops??0)>0&&(e.loops??0)>(e.maxLoops??0)||(e.time||(e.time=0),(e.delayTime??0)>0&&e.time<(e.delayTime??0)&&(e.time+=n.value),(e.delayTime??0)>0&&e.time<(e.delayTime??0)))return;const o=Nn(t.offset),l=(e.velocity??0)*n.factor+o*3.6,u=e.decay??1;!r||e.status==="increasing"?(e.value+=l,e.value>i&&(e.loops||(e.loops=0),e.loops++,r&&(e.status="decreasing",e.value-=e.value%i))):(e.value-=l,e.value<0&&(e.loops||(e.loops=0),e.loops++,e.status="increasing",e.value+=e.value)),e.velocity&&u!==1&&(e.velocity*=u),e.value>i&&(e.value%=i)}function U3(n,e){if(!n.strokeColor||!n.strokeAnimation)return;const{h:t,s:i,l:r}=n.strokeColor,{h:o,s:l,l:u}=n.strokeAnimation;t&&Fm(e,t,o,360,!1),i&&Fm(e,i,l,100,!0),r&&Fm(e,r,u,100,!0)}class z3{constructor(e){this.container=e}init(e){var l;const t=this.container,i=e.options,r=Ir(i.stroke,e.id,i.reduceDuplicates);e.strokeWidth=be(r.width)*t.retina.pixelRatio,e.strokeOpacity=be(r.opacity??1),e.strokeAnimation=(l=r.color)==null?void 0:l.animation;const o=Xc(r.color)??e.getFillColor();o&&(e.strokeColor=OE(o,e.strokeAnimation,t.retina.reduceFactor))}isEnabled(e){const t=e.strokeAnimation,{strokeColor:i}=e;return!e.destroyed&&!e.spawning&&!!t&&((i==null?void 0:i.h.value)!==void 0&&i.h.enable||(i==null?void 0:i.s.value)!==void 0&&i.s.enable||(i==null?void 0:i.l.value)!==void 0&&i.l.enable)}update(e,t){this.isEnabled(e)&&U3(e,t)}}async function B3(n,e=!0){await n.addParticleUpdater("strokeColor",t=>new z3(t),e)}const rd=["text","character","char"];class q3{draw(e,t,i,r){const o=t.shapeData;if(o===void 0)return;const l=o.value;if(l===void 0)return;t.text===void 0&&(t.text=Ir(l,t.randomIndexData));const u=t.text,h=o.style??"",p=o.weight??"400",g=Math.round(i)*2,y=o.font??"Verdana",x=t.fill,b=u.length*i/2;e.font=`${h} ${p} ${g}px "${y}"`;const T={x:-b,y:i/2};e.globalAlpha=r,x?e.fillText(u,T.x,T.y):e.strokeText(u,T.x,T.y),e.globalAlpha=1}getSidesCount(){return 12}async init(e){const t=e.actualOptions;if(rd.find(i=>wt(i,t.particles.shape.type))){const i=rd.map(o=>t.particles.shape.options[o]).find(o=>!!o),r=[];qt(i,o=>{r.push($4(o.font,o.weight))}),await Promise.all(r)}}particleInit(e,t){if(!t.shape||!rd.includes(t.shape))return;const i=t.shapeData;if(i===void 0)return;const r=i.value;r!==void 0&&(t.text=Ir(r,t.randomIndexData))}}async function $3(n,e=!0){await n.addShape(rd,new q3,e)}async function H3(n,e=!0){gD(n),await i3(n,!1),await YD(n,!1),await ZD(n,!1),await iM(n,!1),await hM(n,!1),await yM(n,!1),await xM(n,!1),await bM(n,!1),await SM(n,!1),await PM(n,!1),await RM(n,!1),await s3(n,!1),await u3(n,!1),await T3(n,!1),await GD(),await KM(n,!1),await t3(n,!1),await P3(n,!1),await L3(n,!1),await F3(n,!1),await $3(n,!1),await ZM(n,!1),await D3(n,!1),await B3(n,!1),await WD(n,e)}const W3=()=>{const n=V.useCallback(async t=>{await H3(t)},[]),e=V.useCallback(async t=>{t?console.log("Particles container loaded successfully",t):console.log("Particles failed to load")},[]);return d.jsx(HE,{id:"tsparticles",init:n,loaded:e,style:{position:"absolute",top:0,left:0,width:"100%",height:"100%",zIndex:0},options:{background:{color:{value:"transparent"}},fullScreen:{enable:!1,zIndex:-1},particles:{color:{value:"#883AEA"},links:{color:"#E0CCFA",distance:150,enable:!0,opacity:.3,width:1},move:{enable:!0,speed:1.5},number:{density:{enable:!0,area:800},value:80},opacity:{value:.5},size:{value:{min:1,max:3}}},detectRetina:!0,interactivity:{events:{onHover:{enable:!0,mode:"grab"}},modes:{grab:{distance:140,links:{opacity:.5}}}}}})},G3=()=>{};var X_={};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const JE=function(n){const e=[];let t=0;for(let i=0;i<n.length;i++){let r=n.charCodeAt(i);r<128?e[t++]=r:r<2048?(e[t++]=r>>6|192,e[t++]=r&63|128):(r&64512)===55296&&i+1<n.length&&(n.charCodeAt(i+1)&64512)===56320?(r=65536+((r&1023)<<10)+(n.charCodeAt(++i)&1023),e[t++]=r>>18|240,e[t++]=r>>12&63|128,e[t++]=r>>6&63|128,e[t++]=r&63|128):(e[t++]=r>>12|224,e[t++]=r>>6&63|128,e[t++]=r&63|128)}return e},K3=function(n){const e=[];let t=0,i=0;for(;t<n.length;){const r=n[t++];if(r<128)e[i++]=String.fromCharCode(r);else if(r>191&&r<224){const o=n[t++];e[i++]=String.fromCharCode((r&31)<<6|o&63)}else if(r>239&&r<365){const o=n[t++],l=n[t++],u=n[t++],h=((r&7)<<18|(o&63)<<12|(l&63)<<6|u&63)-65536;e[i++]=String.fromCharCode(55296+(h>>10)),e[i++]=String.fromCharCode(56320+(h&1023))}else{const o=n[t++],l=n[t++];e[i++]=String.fromCharCode((r&15)<<12|(o&63)<<6|l&63)}}return e.join("")},ZE={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,i=[];for(let r=0;r<n.length;r+=3){const o=n[r],l=r+1<n.length,u=l?n[r+1]:0,h=r+2<n.length,p=h?n[r+2]:0,g=o>>2,y=(o&3)<<4|u>>4;let x=(u&15)<<2|p>>6,b=p&63;h||(b=64,l||(x=64)),i.push(t[g],t[y],t[x],t[b])}return i.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(JE(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):K3(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,i=[];for(let r=0;r<n.length;){const o=t[n.charAt(r++)],u=r<n.length?t[n.charAt(r)]:0;++r;const p=r<n.length?t[n.charAt(r)]:64;++r;const y=r<n.length?t[n.charAt(r)]:64;if(++r,o==null||u==null||p==null||y==null)throw new Q3;const x=o<<2|u>>4;if(i.push(x),p!==64){const b=u<<4&240|p>>2;if(i.push(b),y!==64){const T=p<<6&192|y;i.push(T)}}}return i},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class Q3 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Y3=function(n){const e=JE(n);return ZE.encodeByteArray(e,!0)},kd=function(n){return Y3(n).replace(/\./g,"")},eT=function(n){try{return ZE.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function X3(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const J3=()=>X3().__FIREBASE_DEFAULTS__,Z3=()=>{if(typeof process>"u"||typeof X_>"u")return;const n=X_.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},eO=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&eT(n[1]);return e&&JSON.parse(e)},of=()=>{try{return G3()||J3()||Z3()||eO()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},tT=n=>{var e,t;return(t=(e=of())===null||e===void 0?void 0:e.emulatorHosts)===null||t===void 0?void 0:t[n]},tO=n=>{const e=tT(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const i=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),i]:[e.substring(0,t),i]},nT=()=>{var n;return(n=of())===null||n===void 0?void 0:n.config},iT=n=>{var e;return(e=of())===null||e===void 0?void 0:e[`_${n}`]};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class nO{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,i)=>{t?this.reject(t):this.resolve(i),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,i))}}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function iO(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},i=e||"demo-project",r=n.iat||0,o=n.sub||n.user_id;if(!o)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const l=Object.assign({iss:`https://securetoken.google.com/${i}`,aud:i,iat:r,exp:r+3600,auth_time:r,sub:o,user_id:o,firebase:{sign_in_provider:"custom",identities:{}}},n);return[kd(JSON.stringify(t)),kd(JSON.stringify(l)),""].join(".")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function fn(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function rO(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(fn())}function sO(){var n;const e=(n=of())===null||n===void 0?void 0:n.forceEnvironment;if(e==="node")return!0;if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function oO(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function aO(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function lO(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function cO(){const n=fn();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function uO(){return!sO()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function hO(){try{return typeof indexedDB=="object"}catch{return!1}}function dO(){return new Promise((n,e)=>{try{let t=!0;const i="validate-browser-context-for-indexeddb-analytics-module",r=self.indexedDB.open(i);r.onsuccess=()=>{r.result.close(),t||self.indexedDB.deleteDatabase(i),n(!0)},r.onupgradeneeded=()=>{t=!1},r.onerror=()=>{var o;e(((o=r.error)===null||o===void 0?void 0:o.message)||"")}}catch(t){e(t)}})}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const fO="FirebaseError";class Lr extends Error{constructor(e,t,i){super(t),this.code=e,this.customData=i,this.name=fO,Object.setPrototypeOf(this,Lr.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,gu.prototype.create)}}class gu{constructor(e,t,i){this.service=e,this.serviceName=t,this.errors=i}create(e,...t){const i=t[0]||{},r=`${this.service}/${e}`,o=this.errors[e],l=o?pO(o,i):"Error",u=`${this.serviceName}: ${l} (${r}).`;return new Lr(r,u,i)}}function pO(n,e){return n.replace(mO,(t,i)=>{const r=e[i];return r!=null?String(r):`<${i}?>`})}const mO=/\{\$([^}]+)}/g;function gO(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Do(n,e){if(n===e)return!0;const t=Object.keys(n),i=Object.keys(e);for(const r of t){if(!i.includes(r))return!1;const o=n[r],l=e[r];if(J_(o)&&J_(l)){if(!Do(o,l))return!1}else if(o!==l)return!1}for(const r of i)if(!t.includes(r))return!1;return!0}function J_(n){return n!==null&&typeof n=="object"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function yu(n){const e=[];for(const[t,i]of Object.entries(n))Array.isArray(i)?i.forEach(r=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(r))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(i));return e.length?"&"+e.join("&"):""}function Tc(n){const e={};return n.replace(/^\?/,"").split("&").forEach(i=>{if(i){const[r,o]=i.split("=");e[decodeURIComponent(r)]=decodeURIComponent(o)}}),e}function Sc(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function yO(n,e){const t=new vO(n,e);return t.subscribe.bind(t)}class vO{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(i=>{this.error(i)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,i){let r;if(e===void 0&&t===void 0&&i===void 0)throw new Error("Missing Observer.");xO(e,["next","error","complete"])?r=e:r={next:e,error:t,complete:i},r.next===void 0&&(r.next=Um),r.error===void 0&&(r.error=Um),r.complete===void 0&&(r.complete=Um);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?r.error(this.finalError):r.complete()}catch{}}),this.observers.push(r),o}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(i){typeof console<"u"&&console.error&&console.error(i)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function xO(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function Um(){}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Mt(n){return n&&n._delegate?n._delegate:n}class Mo{constructor(e,t,i){this.name=e,this.instanceFactory=t,this.type=i,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const To="[DEFAULT]";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wO{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const i=new nO;if(this.instancesDeferred.set(t,i),this.isInitialized(t)||this.shouldAutoInitialize())try{const r=this.getOrInitializeService({instanceIdentifier:t});r&&i.resolve(r)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){var t;const i=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(t=e==null?void 0:e.optional)!==null&&t!==void 0?t:!1;if(this.isInitialized(i)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:i})}catch(o){if(r)return null;throw o}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(bO(e))try{this.getOrInitializeService({instanceIdentifier:To})}catch{}for(const[t,i]of this.instancesDeferred.entries()){const r=this.normalizeInstanceIdentifier(t);try{const o=this.getOrInitializeService({instanceIdentifier:r});i.resolve(o)}catch{}}}}clearInstance(e=To){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=To){return this.instances.has(e)}getOptions(e=To){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,i=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(i))throw Error(`${this.name}(${i}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const r=this.getOrInitializeService({instanceIdentifier:i,options:t});for(const[o,l]of this.instancesDeferred.entries()){const u=this.normalizeInstanceIdentifier(o);i===u&&l.resolve(r)}return r}onInit(e,t){var i;const r=this.normalizeInstanceIdentifier(t),o=(i=this.onInitCallbacks.get(r))!==null&&i!==void 0?i:new Set;o.add(e),this.onInitCallbacks.set(r,o);const l=this.instances.get(r);return l&&e(l,r),()=>{o.delete(e)}}invokeOnInitCallbacks(e,t){const i=this.onInitCallbacks.get(t);if(i)for(const r of i)try{r(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let i=this.instances.get(e);if(!i&&this.component&&(i=this.component.instanceFactory(this.container,{instanceIdentifier:_O(e),options:t}),this.instances.set(e,i),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(i,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,i)}catch{}return i||null}normalizeInstanceIdentifier(e=To){return this.component?this.component.multipleInstances?e:To:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function _O(n){return n===To?void 0:n}function bO(n){return n.instantiationMode==="EAGER"}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class EO{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new wO(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Oe;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(Oe||(Oe={}));const TO={debug:Oe.DEBUG,verbose:Oe.VERBOSE,info:Oe.INFO,warn:Oe.WARN,error:Oe.ERROR,silent:Oe.SILENT},SO=Oe.INFO,CO={[Oe.DEBUG]:"log",[Oe.VERBOSE]:"log",[Oe.INFO]:"info",[Oe.WARN]:"warn",[Oe.ERROR]:"error"},IO=(n,e,...t)=>{if(e<n.logLevel)return;const i=new Date().toISOString(),r=CO[e];if(r)console[r](`[${i}] ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class $y{constructor(e){this.name=e,this._logLevel=SO,this._logHandler=IO,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Oe))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?TO[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Oe.DEBUG,...e),this._logHandler(this,Oe.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Oe.VERBOSE,...e),this._logHandler(this,Oe.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Oe.INFO,...e),this._logHandler(this,Oe.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Oe.WARN,...e),this._logHandler(this,Oe.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Oe.ERROR,...e),this._logHandler(this,Oe.ERROR,...e)}}const kO=(n,e)=>e.some(t=>n instanceof t);let Z_,eb;function PO(){return Z_||(Z_=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function AO(){return eb||(eb=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const rT=new WeakMap,_g=new WeakMap,sT=new WeakMap,zm=new WeakMap,Hy=new WeakMap;function NO(n){const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("success",o),n.removeEventListener("error",l)},o=()=>{t(_s(n.result)),r()},l=()=>{i(n.error),r()};n.addEventListener("success",o),n.addEventListener("error",l)});return e.then(t=>{t instanceof IDBCursor&&rT.set(t,n)}).catch(()=>{}),Hy.set(e,n),e}function RO(n){if(_g.has(n))return;const e=new Promise((t,i)=>{const r=()=>{n.removeEventListener("complete",o),n.removeEventListener("error",l),n.removeEventListener("abort",l)},o=()=>{t(),r()},l=()=>{i(n.error||new DOMException("AbortError","AbortError")),r()};n.addEventListener("complete",o),n.addEventListener("error",l),n.addEventListener("abort",l)});_g.set(n,e)}let bg={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return _g.get(n);if(e==="objectStoreNames")return n.objectStoreNames||sT.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return _s(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function jO(n){bg=n(bg)}function DO(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const i=n.call(Bm(this),e,...t);return sT.set(i,e.sort?e.sort():[e]),_s(i)}:AO().includes(n)?function(...e){return n.apply(Bm(this),e),_s(rT.get(this))}:function(...e){return _s(n.apply(Bm(this),e))}}function MO(n){return typeof n=="function"?DO(n):(n instanceof IDBTransaction&&RO(n),kO(n,PO())?new Proxy(n,bg):n)}function _s(n){if(n instanceof IDBRequest)return NO(n);if(zm.has(n))return zm.get(n);const e=MO(n);return e!==n&&(zm.set(n,e),Hy.set(e,n)),e}const Bm=n=>Hy.get(n);function OO(n,e,{blocked:t,upgrade:i,blocking:r,terminated:o}={}){const l=indexedDB.open(n,e),u=_s(l);return i&&l.addEventListener("upgradeneeded",h=>{i(_s(l.result),h.oldVersion,h.newVersion,_s(l.transaction),h)}),t&&l.addEventListener("blocked",h=>t(h.oldVersion,h.newVersion,h)),u.then(h=>{o&&h.addEventListener("close",()=>o()),r&&h.addEventListener("versionchange",p=>r(p.oldVersion,p.newVersion,p))}).catch(()=>{}),u}const LO=["get","getKey","getAll","getAllKeys","count"],VO=["put","add","delete","clear"],qm=new Map;function tb(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(qm.get(e))return qm.get(e);const t=e.replace(/FromIndex$/,""),i=e!==t,r=VO.includes(t);if(!(t in(i?IDBIndex:IDBObjectStore).prototype)||!(r||LO.includes(t)))return;const o=async function(l,...u){const h=this.transaction(l,r?"readwrite":"readonly");let p=h.store;return i&&(p=p.index(u.shift())),(await Promise.all([p[t](...u),r&&h.done]))[0]};return qm.set(e,o),o}jO(n=>({...n,get:(e,t,i)=>tb(e,t)||n.get(e,t,i),has:(e,t)=>!!tb(e,t)||n.has(e,t)}));/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class FO{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(UO(t)){const i=t.getImmediate();return`${i.library}/${i.version}`}else return null}).filter(t=>t).join(" ")}}function UO(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Eg="@firebase/app",nb="0.11.3";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Rr=new $y("@firebase/app"),zO="@firebase/app-compat",BO="@firebase/analytics-compat",qO="@firebase/analytics",$O="@firebase/app-check-compat",HO="@firebase/app-check",WO="@firebase/auth",GO="@firebase/auth-compat",KO="@firebase/database",QO="@firebase/data-connect",YO="@firebase/database-compat",XO="@firebase/functions",JO="@firebase/functions-compat",ZO="@firebase/installations",eL="@firebase/installations-compat",tL="@firebase/messaging",nL="@firebase/messaging-compat",iL="@firebase/performance",rL="@firebase/performance-compat",sL="@firebase/remote-config",oL="@firebase/remote-config-compat",aL="@firebase/storage",lL="@firebase/storage-compat",cL="@firebase/firestore",uL="@firebase/vertexai",hL="@firebase/firestore-compat",dL="firebase",fL="11.5.0";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Tg="[DEFAULT]",pL={[Eg]:"fire-core",[zO]:"fire-core-compat",[qO]:"fire-analytics",[BO]:"fire-analytics-compat",[HO]:"fire-app-check",[$O]:"fire-app-check-compat",[WO]:"fire-auth",[GO]:"fire-auth-compat",[KO]:"fire-rtdb",[QO]:"fire-data-connect",[YO]:"fire-rtdb-compat",[XO]:"fire-fn",[JO]:"fire-fn-compat",[ZO]:"fire-iid",[eL]:"fire-iid-compat",[tL]:"fire-fcm",[nL]:"fire-fcm-compat",[iL]:"fire-perf",[rL]:"fire-perf-compat",[sL]:"fire-rc",[oL]:"fire-rc-compat",[aL]:"fire-gcs",[lL]:"fire-gcs-compat",[cL]:"fire-fst",[hL]:"fire-fst-compat",[uL]:"fire-vertex","fire-js":"fire-js",[dL]:"fire-js-all"};/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Pd=new Map,mL=new Map,Sg=new Map;function ib(n,e){try{n.container.addComponent(e)}catch(t){Rr.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function ol(n){const e=n.name;if(Sg.has(e))return Rr.debug(`There were multiple attempts to register component ${e}.`),!1;Sg.set(e,n);for(const t of Pd.values())ib(t,n);for(const t of mL.values())ib(t,n);return!0}function Wy(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function ai(n){return n==null?!1:n.settings!==void 0}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const gL={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},bs=new gu("app","Firebase",gL);/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class yL{constructor(e,t,i){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},t),this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=i,this.container.addComponent(new Mo("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw bs.create("app-deleted",{appName:this._name})}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const vl=fL;function oT(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const i=Object.assign({name:Tg,automaticDataCollectionEnabled:!1},e),r=i.name;if(typeof r!="string"||!r)throw bs.create("bad-app-name",{appName:String(r)});if(t||(t=nT()),!t)throw bs.create("no-options");const o=Pd.get(r);if(o){if(Do(t,o.options)&&Do(i,o.config))return o;throw bs.create("duplicate-app",{appName:r})}const l=new EO(r);for(const h of Sg.values())l.addComponent(h);const u=new yL(t,i,l);return Pd.set(r,u),u}function aT(n=Tg){const e=Pd.get(n);if(!e&&n===Tg&&nT())return oT();if(!e)throw bs.create("no-app",{appName:n});return e}function Es(n,e,t){var i;let r=(i=pL[n])!==null&&i!==void 0?i:n;t&&(r+=`-${t}`);const o=r.match(/\s|\//),l=e.match(/\s|\//);if(o||l){const u=[`Unable to register library "${r}" with version "${e}":`];o&&u.push(`library name "${r}" contains illegal characters (whitespace or "/")`),o&&l&&u.push("and"),l&&u.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Rr.warn(u.join(" "));return}ol(new Mo(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const vL="firebase-heartbeat-database",xL=1,eu="firebase-heartbeat-store";let $m=null;function lT(){return $m||($m=OO(vL,xL,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(eu)}catch(t){console.warn(t)}}}}).catch(n=>{throw bs.create("idb-open",{originalErrorMessage:n.message})})),$m}async function wL(n){try{const t=(await lT()).transaction(eu),i=await t.objectStore(eu).get(cT(n));return await t.done,i}catch(e){if(e instanceof Lr)Rr.warn(e.message);else{const t=bs.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Rr.warn(t.message)}}}async function rb(n,e){try{const i=(await lT()).transaction(eu,"readwrite");await i.objectStore(eu).put(e,cT(n)),await i.done}catch(t){if(t instanceof Lr)Rr.warn(t.message);else{const i=bs.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});Rr.warn(i.message)}}}function cT(n){return`${n.name}!${n.options.appId}`}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _L=1024,bL=30;class EL{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new SL(t),this._heartbeatsCachePromise=this._storage.read().then(i=>(this._heartbeatsCache=i,i))}async triggerHeartbeat(){var e,t;try{const r=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),o=sb();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===o||this._heartbeatsCache.heartbeats.some(l=>l.date===o))return;if(this._heartbeatsCache.heartbeats.push({date:o,agent:r}),this._heartbeatsCache.heartbeats.length>bL){const l=CL(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(l,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(i){Rr.warn(i)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=sb(),{heartbeatsToSend:i,unsentEntries:r}=TL(this._heartbeatsCache.heartbeats),o=kd(JSON.stringify({version:2,heartbeats:i}));return this._heartbeatsCache.lastSentHeartbeatDate=t,r.length>0?(this._heartbeatsCache.heartbeats=r,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(t){return Rr.warn(t),""}}}function sb(){return new Date().toISOString().substring(0,10)}function TL(n,e=_L){const t=[];let i=n.slice();for(const r of n){const o=t.find(l=>l.agent===r.agent);if(o){if(o.dates.push(r.date),ob(t)>e){o.dates.pop();break}}else if(t.push({agent:r.agent,dates:[r.date]}),ob(t)>e){t.pop();break}i=i.slice(1)}return{heartbeatsToSend:t,unsentEntries:i}}class SL{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return hO()?dO().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await wL(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var t;if(await this._canUseIndexedDBPromise){const r=await this.read();return rb(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var t;if(await this._canUseIndexedDBPromise){const r=await this.read();return rb(this.app,{lastSentHeartbeatDate:(t=e.lastSentHeartbeatDate)!==null&&t!==void 0?t:r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function ob(n){return kd(JSON.stringify({version:2,heartbeats:n})).length}function CL(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let i=1;i<n.length;i++)n[i].date<t&&(t=n[i].date,e=i);return e}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function IL(n){ol(new Mo("platform-logger",e=>new FO(e),"PRIVATE")),ol(new Mo("heartbeat",e=>new EL(e),"PRIVATE")),Es(Eg,nb,n),Es(Eg,nb,"esm2017"),Es("fire-js","")}IL("");var ab=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var Ts,uT;(function(){var n;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */function e(k,P){function R(){}R.prototype=P.prototype,k.D=P.prototype,k.prototype=new R,k.prototype.constructor=k,k.C=function(F,z,q){for(var M=Array(arguments.length-2),qe=2;qe<arguments.length;qe++)M[qe-2]=arguments[qe];return P.prototype[z].apply(F,M)}}function t(){this.blockSize=-1}function i(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(i,t),i.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function r(k,P,R){R||(R=0);var F=Array(16);if(typeof P=="string")for(var z=0;16>z;++z)F[z]=P.charCodeAt(R++)|P.charCodeAt(R++)<<8|P.charCodeAt(R++)<<16|P.charCodeAt(R++)<<24;else for(z=0;16>z;++z)F[z]=P[R++]|P[R++]<<8|P[R++]<<16|P[R++]<<24;P=k.g[0],R=k.g[1],z=k.g[2];var q=k.g[3],M=P+(q^R&(z^q))+F[0]+3614090360&4294967295;P=R+(M<<7&4294967295|M>>>25),M=q+(z^P&(R^z))+F[1]+3905402710&4294967295,q=P+(M<<12&4294967295|M>>>20),M=z+(R^q&(P^R))+F[2]+606105819&4294967295,z=q+(M<<17&4294967295|M>>>15),M=R+(P^z&(q^P))+F[3]+3250441966&4294967295,R=z+(M<<22&4294967295|M>>>10),M=P+(q^R&(z^q))+F[4]+4118548399&4294967295,P=R+(M<<7&4294967295|M>>>25),M=q+(z^P&(R^z))+F[5]+1200080426&4294967295,q=P+(M<<12&4294967295|M>>>20),M=z+(R^q&(P^R))+F[6]+2821735955&4294967295,z=q+(M<<17&4294967295|M>>>15),M=R+(P^z&(q^P))+F[7]+4249261313&4294967295,R=z+(M<<22&4294967295|M>>>10),M=P+(q^R&(z^q))+F[8]+1770035416&4294967295,P=R+(M<<7&4294967295|M>>>25),M=q+(z^P&(R^z))+F[9]+2336552879&4294967295,q=P+(M<<12&4294967295|M>>>20),M=z+(R^q&(P^R))+F[10]+4294925233&4294967295,z=q+(M<<17&4294967295|M>>>15),M=R+(P^z&(q^P))+F[11]+2304563134&4294967295,R=z+(M<<22&4294967295|M>>>10),M=P+(q^R&(z^q))+F[12]+1804603682&4294967295,P=R+(M<<7&4294967295|M>>>25),M=q+(z^P&(R^z))+F[13]+4254626195&4294967295,q=P+(M<<12&4294967295|M>>>20),M=z+(R^q&(P^R))+F[14]+2792965006&4294967295,z=q+(M<<17&4294967295|M>>>15),M=R+(P^z&(q^P))+F[15]+1236535329&4294967295,R=z+(M<<22&4294967295|M>>>10),M=P+(z^q&(R^z))+F[1]+4129170786&4294967295,P=R+(M<<5&4294967295|M>>>27),M=q+(R^z&(P^R))+F[6]+3225465664&4294967295,q=P+(M<<9&4294967295|M>>>23),M=z+(P^R&(q^P))+F[11]+643717713&4294967295,z=q+(M<<14&4294967295|M>>>18),M=R+(q^P&(z^q))+F[0]+3921069994&4294967295,R=z+(M<<20&4294967295|M>>>12),M=P+(z^q&(R^z))+F[5]+3593408605&4294967295,P=R+(M<<5&4294967295|M>>>27),M=q+(R^z&(P^R))+F[10]+38016083&4294967295,q=P+(M<<9&4294967295|M>>>23),M=z+(P^R&(q^P))+F[15]+3634488961&4294967295,z=q+(M<<14&4294967295|M>>>18),M=R+(q^P&(z^q))+F[4]+3889429448&4294967295,R=z+(M<<20&4294967295|M>>>12),M=P+(z^q&(R^z))+F[9]+568446438&4294967295,P=R+(M<<5&4294967295|M>>>27),M=q+(R^z&(P^R))+F[14]+3275163606&4294967295,q=P+(M<<9&4294967295|M>>>23),M=z+(P^R&(q^P))+F[3]+4107603335&4294967295,z=q+(M<<14&4294967295|M>>>18),M=R+(q^P&(z^q))+F[8]+1163531501&4294967295,R=z+(M<<20&4294967295|M>>>12),M=P+(z^q&(R^z))+F[13]+2850285829&4294967295,P=R+(M<<5&4294967295|M>>>27),M=q+(R^z&(P^R))+F[2]+4243563512&4294967295,q=P+(M<<9&4294967295|M>>>23),M=z+(P^R&(q^P))+F[7]+1735328473&4294967295,z=q+(M<<14&4294967295|M>>>18),M=R+(q^P&(z^q))+F[12]+2368359562&4294967295,R=z+(M<<20&4294967295|M>>>12),M=P+(R^z^q)+F[5]+4294588738&4294967295,P=R+(M<<4&4294967295|M>>>28),M=q+(P^R^z)+F[8]+2272392833&4294967295,q=P+(M<<11&4294967295|M>>>21),M=z+(q^P^R)+F[11]+1839030562&4294967295,z=q+(M<<16&4294967295|M>>>16),M=R+(z^q^P)+F[14]+4259657740&4294967295,R=z+(M<<23&4294967295|M>>>9),M=P+(R^z^q)+F[1]+2763975236&4294967295,P=R+(M<<4&4294967295|M>>>28),M=q+(P^R^z)+F[4]+1272893353&4294967295,q=P+(M<<11&4294967295|M>>>21),M=z+(q^P^R)+F[7]+4139469664&4294967295,z=q+(M<<16&4294967295|M>>>16),M=R+(z^q^P)+F[10]+3200236656&4294967295,R=z+(M<<23&4294967295|M>>>9),M=P+(R^z^q)+F[13]+681279174&4294967295,P=R+(M<<4&4294967295|M>>>28),M=q+(P^R^z)+F[0]+3936430074&4294967295,q=P+(M<<11&4294967295|M>>>21),M=z+(q^P^R)+F[3]+3572445317&4294967295,z=q+(M<<16&4294967295|M>>>16),M=R+(z^q^P)+F[6]+76029189&4294967295,R=z+(M<<23&4294967295|M>>>9),M=P+(R^z^q)+F[9]+3654602809&4294967295,P=R+(M<<4&4294967295|M>>>28),M=q+(P^R^z)+F[12]+3873151461&4294967295,q=P+(M<<11&4294967295|M>>>21),M=z+(q^P^R)+F[15]+530742520&4294967295,z=q+(M<<16&4294967295|M>>>16),M=R+(z^q^P)+F[2]+3299628645&4294967295,R=z+(M<<23&4294967295|M>>>9),M=P+(z^(R|~q))+F[0]+4096336452&4294967295,P=R+(M<<6&4294967295|M>>>26),M=q+(R^(P|~z))+F[7]+1126891415&4294967295,q=P+(M<<10&4294967295|M>>>22),M=z+(P^(q|~R))+F[14]+2878612391&4294967295,z=q+(M<<15&4294967295|M>>>17),M=R+(q^(z|~P))+F[5]+4237533241&4294967295,R=z+(M<<21&4294967295|M>>>11),M=P+(z^(R|~q))+F[12]+1700485571&4294967295,P=R+(M<<6&4294967295|M>>>26),M=q+(R^(P|~z))+F[3]+2399980690&4294967295,q=P+(M<<10&4294967295|M>>>22),M=z+(P^(q|~R))+F[10]+4293915773&4294967295,z=q+(M<<15&4294967295|M>>>17),M=R+(q^(z|~P))+F[1]+2240044497&4294967295,R=z+(M<<21&4294967295|M>>>11),M=P+(z^(R|~q))+F[8]+1873313359&4294967295,P=R+(M<<6&4294967295|M>>>26),M=q+(R^(P|~z))+F[15]+4264355552&4294967295,q=P+(M<<10&4294967295|M>>>22),M=z+(P^(q|~R))+F[6]+2734768916&4294967295,z=q+(M<<15&4294967295|M>>>17),M=R+(q^(z|~P))+F[13]+1309151649&4294967295,R=z+(M<<21&4294967295|M>>>11),M=P+(z^(R|~q))+F[4]+4149444226&4294967295,P=R+(M<<6&4294967295|M>>>26),M=q+(R^(P|~z))+F[11]+3174756917&4294967295,q=P+(M<<10&4294967295|M>>>22),M=z+(P^(q|~R))+F[2]+718787259&4294967295,z=q+(M<<15&4294967295|M>>>17),M=R+(q^(z|~P))+F[9]+3951481745&4294967295,k.g[0]=k.g[0]+P&4294967295,k.g[1]=k.g[1]+(z+(M<<21&4294967295|M>>>11))&4294967295,k.g[2]=k.g[2]+z&4294967295,k.g[3]=k.g[3]+q&4294967295}i.prototype.u=function(k,P){P===void 0&&(P=k.length);for(var R=P-this.blockSize,F=this.B,z=this.h,q=0;q<P;){if(z==0)for(;q<=R;)r(this,k,q),q+=this.blockSize;if(typeof k=="string"){for(;q<P;)if(F[z++]=k.charCodeAt(q++),z==this.blockSize){r(this,F),z=0;break}}else for(;q<P;)if(F[z++]=k[q++],z==this.blockSize){r(this,F),z=0;break}}this.h=z,this.o+=P},i.prototype.v=function(){var k=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);k[0]=128;for(var P=1;P<k.length-8;++P)k[P]=0;var R=8*this.o;for(P=k.length-8;P<k.length;++P)k[P]=R&255,R/=256;for(this.u(k),k=Array(16),P=R=0;4>P;++P)for(var F=0;32>F;F+=8)k[R++]=this.g[P]>>>F&255;return k};function o(k,P){var R=u;return Object.prototype.hasOwnProperty.call(R,k)?R[k]:R[k]=P(k)}function l(k,P){this.h=P;for(var R=[],F=!0,z=k.length-1;0<=z;z--){var q=k[z]|0;F&&q==P||(R[z]=q,F=!1)}this.g=R}var u={};function h(k){return-128<=k&&128>k?o(k,function(P){return new l([P|0],0>P?-1:0)}):new l([k|0],0>k?-1:0)}function p(k){if(isNaN(k)||!isFinite(k))return y;if(0>k)return I(p(-k));for(var P=[],R=1,F=0;k>=R;F++)P[F]=k/R|0,R*=4294967296;return new l(P,0)}function g(k,P){if(k.length==0)throw Error("number format error: empty string");if(P=P||10,2>P||36<P)throw Error("radix out of range: "+P);if(k.charAt(0)=="-")return I(g(k.substring(1),P));if(0<=k.indexOf("-"))throw Error('number format error: interior "-" character');for(var R=p(Math.pow(P,8)),F=y,z=0;z<k.length;z+=8){var q=Math.min(8,k.length-z),M=parseInt(k.substring(z,z+q),P);8>q?(q=p(Math.pow(P,q)),F=F.j(q).add(p(M))):(F=F.j(R),F=F.add(p(M)))}return F}var y=h(0),x=h(1),b=h(16777216);n=l.prototype,n.m=function(){if(C(this))return-I(this).m();for(var k=0,P=1,R=0;R<this.g.length;R++){var F=this.i(R);k+=(0<=F?F:4294967296+F)*P,P*=4294967296}return k},n.toString=function(k){if(k=k||10,2>k||36<k)throw Error("radix out of range: "+k);if(T(this))return"0";if(C(this))return"-"+I(this).toString(k);for(var P=p(Math.pow(k,6)),R=this,F="";;){var z=L(R,P).g;R=N(R,z.j(P));var q=((0<R.g.length?R.g[0]:R.h)>>>0).toString(k);if(R=z,T(R))return q+F;for(;6>q.length;)q="0"+q;F=q+F}},n.i=function(k){return 0>k?0:k<this.g.length?this.g[k]:this.h};function T(k){if(k.h!=0)return!1;for(var P=0;P<k.g.length;P++)if(k.g[P]!=0)return!1;return!0}function C(k){return k.h==-1}n.l=function(k){return k=N(this,k),C(k)?-1:T(k)?0:1};function I(k){for(var P=k.g.length,R=[],F=0;F<P;F++)R[F]=~k.g[F];return new l(R,~k.h).add(x)}n.abs=function(){return C(this)?I(this):this},n.add=function(k){for(var P=Math.max(this.g.length,k.g.length),R=[],F=0,z=0;z<=P;z++){var q=F+(this.i(z)&65535)+(k.i(z)&65535),M=(q>>>16)+(this.i(z)>>>16)+(k.i(z)>>>16);F=M>>>16,q&=65535,M&=65535,R[z]=M<<16|q}return new l(R,R[R.length-1]&-2147483648?-1:0)};function N(k,P){return k.add(I(P))}n.j=function(k){if(T(this)||T(k))return y;if(C(this))return C(k)?I(this).j(I(k)):I(I(this).j(k));if(C(k))return I(this.j(I(k)));if(0>this.l(b)&&0>k.l(b))return p(this.m()*k.m());for(var P=this.g.length+k.g.length,R=[],F=0;F<2*P;F++)R[F]=0;for(F=0;F<this.g.length;F++)for(var z=0;z<k.g.length;z++){var q=this.i(F)>>>16,M=this.i(F)&65535,qe=k.i(z)>>>16,mt=k.i(z)&65535;R[2*F+2*z]+=M*mt,D(R,2*F+2*z),R[2*F+2*z+1]+=q*mt,D(R,2*F+2*z+1),R[2*F+2*z+1]+=M*qe,D(R,2*F+2*z+1),R[2*F+2*z+2]+=q*qe,D(R,2*F+2*z+2)}for(F=0;F<P;F++)R[F]=R[2*F+1]<<16|R[2*F];for(F=P;F<2*P;F++)R[F]=0;return new l(R,0)};function D(k,P){for(;(k[P]&65535)!=k[P];)k[P+1]+=k[P]>>>16,k[P]&=65535,P++}function O(k,P){this.g=k,this.h=P}function L(k,P){if(T(P))throw Error("division by zero");if(T(k))return new O(y,y);if(C(k))return P=L(I(k),P),new O(I(P.g),I(P.h));if(C(P))return P=L(k,I(P)),new O(I(P.g),P.h);if(30<k.g.length){if(C(k)||C(P))throw Error("slowDivide_ only works with positive integers.");for(var R=x,F=P;0>=F.l(k);)R=G(R),F=G(F);var z=X(R,1),q=X(F,1);for(F=X(F,2),R=X(R,2);!T(F);){var M=q.add(F);0>=M.l(k)&&(z=z.add(R),q=M),F=X(F,1),R=X(R,1)}return P=N(k,z.j(P)),new O(z,P)}for(z=y;0<=k.l(P);){for(R=Math.max(1,Math.floor(k.m()/P.m())),F=Math.ceil(Math.log(R)/Math.LN2),F=48>=F?1:Math.pow(2,F-48),q=p(R),M=q.j(P);C(M)||0<M.l(k);)R-=F,q=p(R),M=q.j(P);T(q)&&(q=x),z=z.add(q),k=N(k,M)}return new O(z,k)}n.A=function(k){return L(this,k).h},n.and=function(k){for(var P=Math.max(this.g.length,k.g.length),R=[],F=0;F<P;F++)R[F]=this.i(F)&k.i(F);return new l(R,this.h&k.h)},n.or=function(k){for(var P=Math.max(this.g.length,k.g.length),R=[],F=0;F<P;F++)R[F]=this.i(F)|k.i(F);return new l(R,this.h|k.h)},n.xor=function(k){for(var P=Math.max(this.g.length,k.g.length),R=[],F=0;F<P;F++)R[F]=this.i(F)^k.i(F);return new l(R,this.h^k.h)};function G(k){for(var P=k.g.length+1,R=[],F=0;F<P;F++)R[F]=k.i(F)<<1|k.i(F-1)>>>31;return new l(R,k.h)}function X(k,P){var R=P>>5;P%=32;for(var F=k.g.length-R,z=[],q=0;q<F;q++)z[q]=0<P?k.i(q+R)>>>P|k.i(q+R+1)<<32-P:k.i(q+R);return new l(z,k.h)}i.prototype.digest=i.prototype.v,i.prototype.reset=i.prototype.s,i.prototype.update=i.prototype.u,uT=i,l.prototype.add=l.prototype.add,l.prototype.multiply=l.prototype.j,l.prototype.modulo=l.prototype.A,l.prototype.compare=l.prototype.l,l.prototype.toNumber=l.prototype.m,l.prototype.toString=l.prototype.toString,l.prototype.getBits=l.prototype.i,l.fromNumber=p,l.fromString=g,Ts=l}).apply(typeof ab<"u"?ab:typeof self<"u"?self:typeof window<"u"?window:{});var Gh=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var hT,Cc,dT,sd,Cg,fT,pT,mT;(function(){var n,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(f,w,E){return f==Array.prototype||f==Object.prototype||(f[w]=E.value),f};function t(f){f=[typeof globalThis=="object"&&globalThis,f,typeof window=="object"&&window,typeof self=="object"&&self,typeof Gh=="object"&&Gh];for(var w=0;w<f.length;++w){var E=f[w];if(E&&E.Math==Math)return E}throw Error("Cannot find global object")}var i=t(this);function r(f,w){if(w)e:{var E=i;f=f.split(".");for(var A=0;A<f.length-1;A++){var H=f[A];if(!(H in E))break e;E=E[H]}f=f[f.length-1],A=E[f],w=w(A),w!=A&&w!=null&&e(E,f,{configurable:!0,writable:!0,value:w})}}function o(f,w){f instanceof String&&(f+="");var E=0,A=!1,H={next:function(){if(!A&&E<f.length){var Y=E++;return{value:w(Y,f[Y]),done:!1}}return A=!0,{done:!0,value:void 0}}};return H[Symbol.iterator]=function(){return H},H}r("Array.prototype.values",function(f){return f||function(){return o(this,function(w,E){return E})}});/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */var l=l||{},u=this||self;function h(f){var w=typeof f;return w=w!="object"?w:f?Array.isArray(f)?"array":w:"null",w=="array"||w=="object"&&typeof f.length=="number"}function p(f){var w=typeof f;return w=="object"&&f!=null||w=="function"}function g(f,w,E){return f.call.apply(f.bind,arguments)}function y(f,w,E){if(!f)throw Error();if(2<arguments.length){var A=Array.prototype.slice.call(arguments,2);return function(){var H=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(H,A),f.apply(w,H)}}return function(){return f.apply(w,arguments)}}function x(f,w,E){return x=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?g:y,x.apply(null,arguments)}function b(f,w){var E=Array.prototype.slice.call(arguments,1);return function(){var A=E.slice();return A.push.apply(A,arguments),f.apply(this,A)}}function T(f,w){function E(){}E.prototype=w.prototype,f.aa=w.prototype,f.prototype=new E,f.prototype.constructor=f,f.Qb=function(A,H,Y){for(var ae=Array(arguments.length-2),Qe=2;Qe<arguments.length;Qe++)ae[Qe-2]=arguments[Qe];return w.prototype[H].apply(A,ae)}}function C(f){const w=f.length;if(0<w){const E=Array(w);for(let A=0;A<w;A++)E[A]=f[A];return E}return[]}function I(f,w){for(let E=1;E<arguments.length;E++){const A=arguments[E];if(h(A)){const H=f.length||0,Y=A.length||0;f.length=H+Y;for(let ae=0;ae<Y;ae++)f[H+ae]=A[ae]}else f.push(A)}}class N{constructor(w,E){this.i=w,this.j=E,this.h=0,this.g=null}get(){let w;return 0<this.h?(this.h--,w=this.g,this.g=w.next,w.next=null):w=this.i(),w}}function D(f){return/^[\s\xa0]*$/.test(f)}function O(){var f=u.navigator;return f&&(f=f.userAgent)?f:""}function L(f){return L[" "](f),f}L[" "]=function(){};var G=O().indexOf("Gecko")!=-1&&!(O().toLowerCase().indexOf("webkit")!=-1&&O().indexOf("Edge")==-1)&&!(O().indexOf("Trident")!=-1||O().indexOf("MSIE")!=-1)&&O().indexOf("Edge")==-1;function X(f,w,E){for(const A in f)w.call(E,f[A],A,f)}function k(f,w){for(const E in f)w.call(void 0,f[E],E,f)}function P(f){const w={};for(const E in f)w[E]=f[E];return w}const R="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function F(f,w){let E,A;for(let H=1;H<arguments.length;H++){A=arguments[H];for(E in A)f[E]=A[E];for(let Y=0;Y<R.length;Y++)E=R[Y],Object.prototype.hasOwnProperty.call(A,E)&&(f[E]=A[E])}}function z(f){var w=1;f=f.split(":");const E=[];for(;0<w&&f.length;)E.push(f.shift()),w--;return f.length&&E.push(f.join(":")),E}function q(f){u.setTimeout(()=>{throw f},0)}function M(){var f=ge;let w=null;return f.g&&(w=f.g,f.g=f.g.next,f.g||(f.h=null),w.next=null),w}class qe{constructor(){this.h=this.g=null}add(w,E){const A=mt.get();A.set(w,E),this.h?this.h.next=A:this.g=A,this.h=A}}var mt=new N(()=>new $t,f=>f.reset());class $t{constructor(){this.next=this.g=this.h=null}set(w,E){this.h=w,this.g=E,this.next=null}reset(){this.next=this.g=this.h=null}}let ke,oe=!1,ge=new qe,le=()=>{const f=u.Promise.resolve(void 0);ke=()=>{f.then($)}};var $=()=>{for(var f;f=M();){try{f.h.call(f.g)}catch(E){q(E)}var w=mt;w.j(f),100>w.h&&(w.h++,f.next=w.g,w.g=f)}oe=!1};function ee(){this.s=this.s,this.C=this.C}ee.prototype.s=!1,ee.prototype.ma=function(){this.s||(this.s=!0,this.N())},ee.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function ye(f,w){this.type=f,this.g=this.target=w,this.defaultPrevented=!1}ye.prototype.h=function(){this.defaultPrevented=!0};var Ne=function(){if(!u.addEventListener||!Object.defineProperty)return!1;var f=!1,w=Object.defineProperty({},"passive",{get:function(){f=!0}});try{const E=()=>{};u.addEventListener("test",E,w),u.removeEventListener("test",E,w)}catch{}return f}();function je(f,w){if(ye.call(this,f?f.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,f){var E=this.type=f.type,A=f.changedTouches&&f.changedTouches.length?f.changedTouches[0]:null;if(this.target=f.target||f.srcElement,this.g=w,w=f.relatedTarget){if(G){e:{try{L(w.nodeName);var H=!0;break e}catch{}H=!1}H||(w=null)}}else E=="mouseover"?w=f.fromElement:E=="mouseout"&&(w=f.toElement);this.relatedTarget=w,A?(this.clientX=A.clientX!==void 0?A.clientX:A.pageX,this.clientY=A.clientY!==void 0?A.clientY:A.pageY,this.screenX=A.screenX||0,this.screenY=A.screenY||0):(this.clientX=f.clientX!==void 0?f.clientX:f.pageX,this.clientY=f.clientY!==void 0?f.clientY:f.pageY,this.screenX=f.screenX||0,this.screenY=f.screenY||0),this.button=f.button,this.key=f.key||"",this.ctrlKey=f.ctrlKey,this.altKey=f.altKey,this.shiftKey=f.shiftKey,this.metaKey=f.metaKey,this.pointerId=f.pointerId||0,this.pointerType=typeof f.pointerType=="string"?f.pointerType:Fe[f.pointerType]||"",this.state=f.state,this.i=f,f.defaultPrevented&&je.aa.h.call(this)}}T(je,ye);var Fe={2:"touch",3:"pen",4:"mouse"};je.prototype.h=function(){je.aa.h.call(this);var f=this.i;f.preventDefault?f.preventDefault():f.returnValue=!1};var He="closure_listenable_"+(1e6*Math.random()|0),We=0;function Xe(f,w,E,A,H){this.listener=f,this.proxy=null,this.src=w,this.type=E,this.capture=!!A,this.ha=H,this.key=++We,this.da=this.fa=!1}function Ot(f){f.da=!0,f.listener=null,f.proxy=null,f.src=null,f.ha=null}function nr(f){this.src=f,this.g={},this.h=0}nr.prototype.add=function(f,w,E,A,H){var Y=f.toString();f=this.g[Y],f||(f=this.g[Y]=[],this.h++);var ae=Fr(f,w,A,H);return-1<ae?(w=f[ae],E||(w.fa=!1)):(w=new Xe(w,this.src,Y,!!A,H),w.fa=E,f.push(w)),w};function Go(f,w){var E=w.type;if(E in f.g){var A=f.g[E],H=Array.prototype.indexOf.call(A,w,void 0),Y;(Y=0<=H)&&Array.prototype.splice.call(A,H,1),Y&&(Ot(w),f.g[E].length==0&&(delete f.g[E],f.h--))}}function Fr(f,w,E,A){for(var H=0;H<f.length;++H){var Y=f[H];if(!Y.da&&Y.listener==w&&Y.capture==!!E&&Y.ha==A)return H}return-1}var Ws="closure_lm_"+(1e6*Math.random()|0),Ko={};function Sl(f,w,E,A,H){if(Array.isArray(w)){for(var Y=0;Y<w.length;Y++)Sl(f,w[Y],E,A,H);return null}return E=kl(E),f&&f[He]?f.K(w,E,p(A)?!!A.capture:!1,H):Cl(f,w,E,!1,A,H)}function Cl(f,w,E,A,H,Y){if(!w)throw Error("Invalid event type");var ae=p(H)?!!H.capture:!!H,Qe=Yo(f);if(Qe||(f[Ws]=Qe=new nr(f)),E=Qe.add(w,E,A,ae,Y),E.proxy)return E;if(A=Iu(),E.proxy=A,A.src=f,A.listener=E,f.addEventListener)Ne||(H=ae),H===void 0&&(H=!1),f.addEventListener(w.toString(),A,H);else if(f.attachEvent)f.attachEvent(rr(w.toString()),A);else if(f.addListener&&f.removeListener)f.addListener(A);else throw Error("addEventListener and attachEvent are unavailable.");return E}function Iu(){function f(E){return w.call(f.src,f.listener,E)}const w=Il;return f}function Qo(f,w,E,A,H){if(Array.isArray(w))for(var Y=0;Y<w.length;Y++)Qo(f,w[Y],E,A,H);else A=p(A)?!!A.capture:!!A,E=kl(E),f&&f[He]?(f=f.i,w=String(w).toString(),w in f.g&&(Y=f.g[w],E=Fr(Y,E,A,H),-1<E&&(Ot(Y[E]),Array.prototype.splice.call(Y,E,1),Y.length==0&&(delete f.g[w],f.h--)))):f&&(f=Yo(f))&&(w=f.g[w.toString()],f=-1,w&&(f=Fr(w,E,A,H)),(E=-1<f?w[f]:null)&&ir(E))}function ir(f){if(typeof f!="number"&&f&&!f.da){var w=f.src;if(w&&w[He])Go(w.i,f);else{var E=f.type,A=f.proxy;w.removeEventListener?w.removeEventListener(E,A,f.capture):w.detachEvent?w.detachEvent(rr(E),A):w.addListener&&w.removeListener&&w.removeListener(A),(E=Yo(w))?(Go(E,f),E.h==0&&(E.src=null,w[Ws]=null)):Ot(f)}}}function rr(f){return f in Ko?Ko[f]:Ko[f]="on"+f}function Il(f,w){if(f.da)f=!0;else{w=new je(w,this);var E=f.listener,A=f.ha||f.src;f.fa&&ir(f),f=E.call(A,w)}return f}function Yo(f){return f=f[Ws],f instanceof nr?f:null}var Xo="__closure_events_fn_"+(1e9*Math.random()>>>0);function kl(f){return typeof f=="function"?f:(f[Xo]||(f[Xo]=function(w){return f.handleEvent(w)}),f[Xo])}function It(){ee.call(this),this.i=new nr(this),this.M=this,this.F=null}T(It,ee),It.prototype[He]=!0,It.prototype.removeEventListener=function(f,w,E,A){Qo(this,f,w,E,A)};function kt(f,w){var E,A=f.F;if(A)for(E=[];A;A=A.F)E.push(A);if(f=f.M,A=w.type||w,typeof w=="string")w=new ye(w,f);else if(w instanceof ye)w.target=w.target||f;else{var H=w;w=new ye(A,f),F(w,H)}if(H=!0,E)for(var Y=E.length-1;0<=Y;Y--){var ae=w.g=E[Y];H=sr(ae,A,!0,w)&&H}if(ae=w.g=f,H=sr(ae,A,!0,w)&&H,H=sr(ae,A,!1,w)&&H,E)for(Y=0;Y<E.length;Y++)ae=w.g=E[Y],H=sr(ae,A,!1,w)&&H}It.prototype.N=function(){if(It.aa.N.call(this),this.i){var f=this.i,w;for(w in f.g){for(var E=f.g[w],A=0;A<E.length;A++)Ot(E[A]);delete f.g[w],f.h--}}this.F=null},It.prototype.K=function(f,w,E,A){return this.i.add(String(f),w,!1,E,A)},It.prototype.L=function(f,w,E,A){return this.i.add(String(f),w,!0,E,A)};function sr(f,w,E,A){if(w=f.i.g[String(w)],!w)return!0;w=w.concat();for(var H=!0,Y=0;Y<w.length;++Y){var ae=w[Y];if(ae&&!ae.da&&ae.capture==E){var Qe=ae.listener,Pt=ae.ha||ae.src;ae.fa&&Go(f.i,ae),H=Qe.call(Pt,A)!==!1&&H}}return H&&!A.defaultPrevented}function Pl(f,w,E){if(typeof f=="function")E&&(f=x(f,E));else if(f&&typeof f.handleEvent=="function")f=x(f.handleEvent,f);else throw Error("Invalid listener argument");return 2147483647<Number(w)?-1:u.setTimeout(f,w||0)}function Ur(f){f.g=Pl(()=>{f.g=null,f.i&&(f.i=!1,Ur(f))},f.l);const w=f.h;f.h=null,f.m.apply(null,w)}class Gs extends ee{constructor(w,E){super(),this.m=w,this.l=E,this.h=null,this.i=!1,this.g=null}j(w){this.h=arguments,this.g?this.i=!0:Ur(this)}N(){super.N(),this.g&&(u.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ks(f){ee.call(this),this.h=f,this.g={}}T(Ks,ee);var Al=[];function Nl(f){X(f.g,function(w,E){this.g.hasOwnProperty(E)&&ir(w)},f),f.g={}}Ks.prototype.N=function(){Ks.aa.N.call(this),Nl(this)},Ks.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Rl=u.JSON.stringify,jl=u.JSON.parse,Dl=class{stringify(f){return u.JSON.stringify(f,void 0)}parse(f){return u.JSON.parse(f,void 0)}};function Qs(){}Qs.prototype.h=null;function Jo(f){return f.h||(f.h=f.i())}function Zo(){}var Gn={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Di(){ye.call(this,"d")}T(Di,ye);function ea(){ye.call(this,"c")}T(ea,ye);var Mi={},Ml=null;function Ys(){return Ml=Ml||new It}Mi.La="serverreachability";function Ol(f){ye.call(this,Mi.La,f)}T(Ol,ye);function or(f){const w=Ys();kt(w,new Ol(w))}Mi.STAT_EVENT="statevent";function Ll(f,w){ye.call(this,Mi.STAT_EVENT,f),this.stat=w}T(Ll,ye);function gt(f){const w=Ys();kt(w,new Ll(w,f))}Mi.Ma="timingevent";function ta(f,w){ye.call(this,Mi.Ma,f),this.size=w}T(ta,ye);function hi(f,w){if(typeof f!="function")throw Error("Fn must not be null and must be a function");return u.setTimeout(function(){f()},w)}function Xs(){this.g=!0}Xs.prototype.xa=function(){this.g=!1};function Js(f,w,E,A,H,Y){f.info(function(){if(f.g)if(Y)for(var ae="",Qe=Y.split("&"),Pt=0;Pt<Qe.length;Pt++){var Ue=Qe[Pt].split("=");if(1<Ue.length){var Lt=Ue[0];Ue=Ue[1];var bt=Lt.split("_");ae=2<=bt.length&&bt[1]=="type"?ae+(Lt+"="+Ue+"&"):ae+(Lt+"=redacted&")}}else ae=null;else ae=Y;return"XMLHTTP REQ ("+A+") [attempt "+H+"]: "+w+` `+E+` `+ae})}function na(f,w,E,A,H,Y,ae){f.info(function(){return"XMLHTTP RESP ("+A+") [ attempt "+H+"]: "+w+` `+E+` `+Y+" "+ae})}function di(f,w,E,A){f.info(function(){return"XMLHTTP TEXT ("+w+"): "+jf(f,E)+(A?" "+A:"")})}function Vl(f,w){f.info(function(){return"TIMEOUT: "+w})}Xs.prototype.info=function(){};function jf(f,w){if(!f.g)return w;if(!w)return null;try{var E=JSON.parse(w);if(E){for(f=0;f<E.length;f++)if(Array.isArray(E[f])){var A=E[f];if(!(2>A.length)){var H=A[1];if(Array.isArray(H)&&!(1>H.length)){var Y=H[0];if(Y!="noop"&&Y!="stop"&&Y!="close")for(var ae=1;ae<H.length;ae++)H[ae]=""}}}}return Rl(E)}catch{return w}}var ia={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},ku={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},fi;function Zs(){}T(Zs,Qs),Zs.prototype.g=function(){return new XMLHttpRequest},Zs.prototype.i=function(){return{}},fi=new Zs;function pi(f,w,E,A){this.j=f,this.i=w,this.l=E,this.R=A||1,this.U=new Ks(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new Pu}function Pu(){this.i=null,this.g="",this.h=!1}var Fl={},ra={};function sa(f,w,E){f.L=1,f.v=Hr(Dn(w)),f.m=E,f.P=!0,Ul(f,null)}function Ul(f,w){f.F=Date.now(),Je(f),f.A=Dn(f.v);var E=f.A,A=f.R;Array.isArray(A)||(A=[String(A)]),Gr(E.i,"t",A),f.C=0,E=f.j.J,f.h=new Pu,f.g=Gu(f.j,E?w:null,!f.m),0<f.O&&(f.M=new Gs(x(f.Y,f,f.g),f.O)),w=f.U,E=f.g,A=f.ca;var H="readystatechange";Array.isArray(H)||(H&&(Al[0]=H.toString()),H=Al);for(var Y=0;Y<H.length;Y++){var ae=Sl(E,H[Y],A||w.handleEvent,!1,w.h||w);if(!ae)break;w.g[ae.key]=ae}w=f.H?P(f.H):{},f.m?(f.u||(f.u="POST"),w["Content-Type"]="application/x-www-form-urlencoded",f.g.ea(f.A,f.u,f.m,w)):(f.u="GET",f.g.ea(f.A,f.u,null,w)),or(),Js(f.i,f.u,f.A,f.l,f.R,f.m)}pi.prototype.ca=function(f){f=f.target;const w=this.M;w&&_n(f)==3?w.j():this.Y(f)},pi.prototype.Y=function(f){try{if(f==this.g)e:{const bt=_n(this.g);var w=this.g.Ba();const Yn=this.g.Z();if(!(3>bt)&&(bt!=3||this.g&&(this.h.h||this.g.oa()||Wl(this.g)))){this.J||bt!=4||w==7||(w==8||0>=Yn?or(3):or(2)),eo(this);var E=this.g.Z();this.X=E;t:if(Au(this)){var A=Wl(this.g);f="";var H=A.length,Y=_n(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Kn(this),zr(this);var ae="";break t}this.h.i=new u.TextDecoder}for(w=0;w<H;w++)this.h.h=!0,f+=this.h.i.decode(A[w],{stream:!(Y&&w==H-1)});A.length=0,this.h.g+=f,this.C=0,ae=this.h.g}else ae=this.g.oa();if(this.o=E==200,na(this.i,this.u,this.A,this.l,this.R,bt,E),this.o){if(this.T&&!this.K){t:{if(this.g){var Qe,Pt=this.g;if((Qe=Pt.g?Pt.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!D(Qe)){var Ue=Qe;break t}}Ue=null}if(E=Ue)di(this.i,this.l,E,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,zl(this,E);else{this.o=!1,this.s=3,gt(12),Kn(this),zr(this);break e}}if(this.P){E=!0;let On;for(;!this.J&&this.C<ae.length;)if(On=Df(this,ae),On==ra){bt==4&&(this.s=4,gt(14),E=!1),di(this.i,this.l,null,"[Incomplete Response]");break}else if(On==Fl){this.s=4,gt(15),di(this.i,this.l,ae,"[Invalid Chunk]"),E=!1;break}else di(this.i,this.l,On,null),zl(this,On);if(Au(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),bt!=4||ae.length!=0||this.h.h||(this.s=1,gt(16),E=!1),this.o=this.o&&E,!E)di(this.i,this.l,ae,"[Invalid Chunked Response]"),Kn(this),zr(this);else if(0<ae.length&&!this.W){this.W=!0;var Lt=this.j;Lt.g==this&&Lt.ba&&!Lt.M&&(Lt.j.info("Great, no buffering proxy detected. Bytes received: "+ae.length),Kl(Lt),Lt.M=!0,gt(11))}}else di(this.i,this.l,ae,null),zl(this,ae);bt==4&&Kn(this),this.o&&!this.J&&(bt==4?ga(this.j,this):(this.o=!1,Je(this)))}else ha(this.g),E==400&&0<ae.indexOf("Unknown SID")?(this.s=3,gt(12)):(this.s=0,gt(13)),Kn(this),zr(this)}}}catch{}finally{}};function Au(f){return f.g?f.u=="GET"&&f.L!=2&&f.j.Ca:!1}function Df(f,w){var E=f.C,A=w.indexOf(` `,E);return A==-1?ra:(E=Number(w.substring(E,A)),isNaN(E)?Fl:(A+=1,A+E>w.length?ra:(w=w.slice(A,A+E),f.C=A+E,w)))}pi.prototype.cancel=function(){this.J=!0,Kn(this)};function Je(f){f.S=Date.now()+f.I,Nu(f,f.I)}function Nu(f,w){if(f.B!=null)throw Error("WatchDog timer not null");f.B=hi(x(f.ba,f),w)}function eo(f){f.B&&(u.clearTimeout(f.B),f.B=null)}pi.prototype.ba=function(){this.B=null;const f=Date.now();0<=f-this.S?(Vl(this.i,this.A),this.L!=2&&(or(),gt(17)),Kn(this),this.s=2,zr(this)):Nu(this,this.S-f)};function zr(f){f.j.G==0||f.J||ga(f.j,f)}function Kn(f){eo(f);var w=f.M;w&&typeof w.ma=="function"&&w.ma(),f.M=null,Nl(f.U),f.g&&(w=f.g,f.g=null,w.abort(),w.ma())}function zl(f,w){try{var E=f.j;if(E.G!=0&&(E.g==f||pn(E.h,f))){if(!f.K&&pn(E.h,f)&&E.G==3){try{var A=E.Da.g.parse(w)}catch{A=null}if(Array.isArray(A)&&A.length==3){var H=A;if(H[0]==0){e:if(!E.u){if(E.g)if(E.g.F+3e3<f.F)ma(E),xi(E);else break e;pa(E),gt(18)}}else E.za=H[1],0<E.za-E.T&&37500>H[2]&&E.F&&E.v==0&&!E.C&&(E.C=hi(x(E.Za,E),6e3));if(1>=ju(E.h)&&E.ca){try{E.ca()}catch{}E.ca=void 0}}else hr(E,11)}else if((f.K||E.g==f)&&ma(E),!D(w))for(H=E.Da.g.parse(w),w=0;w<H.length;w++){let Ue=H[w];if(E.T=Ue[0],Ue=Ue[1],E.G==2)if(Ue[0]=="c"){E.K=Ue[1],E.ia=Ue[2];const Lt=Ue[3];Lt!=null&&(E.la=Lt,E.j.info("VER="+E.la));const bt=Ue[4];bt!=null&&(E.Aa=bt,E.j.info("SVER="+E.Aa));const Yn=Ue[5];Yn!=null&&typeof Yn=="number"&&0<Yn&&(A=1.5*Yn,E.L=A,E.j.info("backChannelRequestTimeoutMs_="+A)),A=E;const On=f.g;if(On){const ao=On.g?On.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(ao){var Y=A.h;Y.g||ao.indexOf("spdy")==-1&&ao.indexOf("quic")==-1&&ao.indexOf("h2")==-1||(Y.j=Y.l,Y.g=new Set,Y.h&&(Bl(Y,Y.h),Y.h=null))}if(A.D){const va=On.g?On.g.getResponseHeader("X-HTTP-Session-Id"):null;va&&(A.ya=va,Ye(A.I,A.D,va))}}E.G=3,E.l&&E.l.ua(),E.ba&&(E.R=Date.now()-f.F,E.j.info("Handshake RTT: "+E.R+"ms")),A=E;var ae=f;if(A.qa=Wu(A,A.J?A.ia:null,A.W),ae.K){Du(A.h,ae);var Qe=ae,Pt=A.L;Pt&&(Qe.I=Pt),Qe.B&&(eo(Qe),Je(Qe)),A.g=ae}else oo(A);0<E.i.length&&Fi(E)}else Ue[0]!="stop"&&Ue[0]!="close"||hr(E,7);else E.G==3&&(Ue[0]=="stop"||Ue[0]=="close"?Ue[0]=="stop"?hr(E,7):Wt(E):Ue[0]!="noop"&&E.l&&E.l.ta(Ue),E.v=0)}}or(4)}catch{}}var Ru=class{constructor(f,w){this.g=f,this.map=w}};function to(f){this.l=f||10,u.PerformanceNavigationTiming?(f=u.performance.getEntriesByType("navigation"),f=0<f.length&&(f[0].nextHopProtocol=="hq"||f[0].nextHopProtocol=="h2")):f=!!(u.chrome&&u.chrome.loadTimes&&u.chrome.loadTimes()&&u.chrome.loadTimes().wasFetchedViaSpdy),this.j=f?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function jn(f){return f.h?!0:f.g?f.g.size>=f.j:!1}function ju(f){return f.h?1:f.g?f.g.size:0}function pn(f,w){return f.h?f.h==w:f.g?f.g.has(w):!1}function Bl(f,w){f.g?f.g.add(w):f.h=w}function Du(f,w){f.h&&f.h==w?f.h=null:f.g&&f.g.has(w)&&f.g.delete(w)}to.prototype.cancel=function(){if(this.i=Mu(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const f of this.g.values())f.cancel();this.g.clear()}};function Mu(f){if(f.h!=null)return f.i.concat(f.h.D);if(f.g!=null&&f.g.size!==0){let w=f.i;for(const E of f.g.values())w=w.concat(E.D);return w}return C(f.i)}function oa(f){if(f.V&&typeof f.V=="function")return f.V();if(typeof Map<"u"&&f instanceof Map||typeof Set<"u"&&f instanceof Set)return Array.from(f.values());if(typeof f=="string")return f.split("");if(h(f)){for(var w=[],E=f.length,A=0;A<E;A++)w.push(f[A]);return w}w=[],E=0;for(A in f)w[E++]=f[A];return w}function aa(f){if(f.na&&typeof f.na=="function")return f.na();if(!f.V||typeof f.V!="function"){if(typeof Map<"u"&&f instanceof Map)return Array.from(f.keys());if(!(typeof Set<"u"&&f instanceof Set)){if(h(f)||typeof f=="string"){var w=[];f=f.length;for(var E=0;E<f;E++)w.push(E);return w}w=[],E=0;for(const A in f)w[E++]=A;return w}}}function Br(f,w){if(f.forEach&&typeof f.forEach=="function")f.forEach(w,void 0);else if(h(f)||typeof f=="string")Array.prototype.forEach.call(f,w,void 0);else for(var E=aa(f),A=oa(f),H=A.length,Y=0;Y<H;Y++)w.call(void 0,A[Y],E&&E[Y],f)}var no=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Mf(f,w){if(f){f=f.split("&");for(var E=0;E<f.length;E++){var A=f[E].indexOf("="),H=null;if(0<=A){var Y=f[E].substring(0,A);H=f[E].substring(A+1)}else Y=f[E];w(Y,H?decodeURIComponent(H.replace(/\+/g," ")):"")}}}function ar(f){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,f instanceof ar){this.h=f.h,io(this,f.j),this.o=f.o,this.g=f.g,qr(this,f.s),this.l=f.l;var w=f.i,E=new Oi;E.i=w.i,w.g&&(E.g=new Map(w.g),E.h=w.h),$r(this,E),this.m=f.m}else f&&(w=String(f).match(no))?(this.h=!1,io(this,w[1]||"",!0),this.o=Ve(w[2]||""),this.g=Ve(w[3]||"",!0),qr(this,w[4]),this.l=Ve(w[5]||"",!0),$r(this,w[6]||"",!0),this.m=Ve(w[7]||"")):(this.h=!1,this.i=new Oi(null,this.h))}ar.prototype.toString=function(){var f=[],w=this.j;w&&f.push(Wr(w,la,!0),":");var E=this.g;return(E||w=="file")&&(f.push("//"),(w=this.o)&&f.push(Wr(w,la,!0),"@"),f.push(encodeURIComponent(String(E)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),E=this.s,E!=null&&f.push(":",String(E))),(E=this.l)&&(this.g&&E.charAt(0)!="/"&&f.push("/"),f.push(Wr(E,E.charAt(0)=="/"?Vu:Lu,!0))),(E=this.i.toString())&&f.push("?",E),(E=this.m)&&f.push("#",Wr(E,ql)),f.join("")};function Dn(f){return new ar(f)}function io(f,w,E){f.j=E?Ve(w,!0):w,f.j&&(f.j=f.j.replace(/:$/,""))}function qr(f,w){if(w){if(w=Number(w),isNaN(w)||0>w)throw Error("Bad port number "+w);f.s=w}else f.s=null}function $r(f,w,E){w instanceof Oi?(f.i=w,Li(f.i,f.h)):(E||(w=Wr(w,Fu)),f.i=new Oi(w,f.h))}function Ye(f,w,E){f.i.set(w,E)}function Hr(f){return Ye(f,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),f}function Ve(f,w){return f?w?decodeURI(f.replace(/%25/g,"%2525")):decodeURIComponent(f):""}function Wr(f,w,E){return typeof f=="string"?(f=encodeURI(f).replace(w,Ou),E&&(f=f.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f):null}function Ou(f){return f=f.charCodeAt(0),"%"+(f>>4&15).toString(16)+(f&15).toString(16)}var la=/[#\/\?@]/g,Lu=/[#\?:]/g,Vu=/[#\?]/g,Fu=/[#\?@]/g,ql=/#/g;function Oi(f,w){this.h=this.g=null,this.i=f||null,this.j=!!w}function Ht(f){f.g||(f.g=new Map,f.h=0,f.i&&Mf(f.i,function(w,E){f.add(decodeURIComponent(w.replace(/\+/g," ")),E)}))}n=Oi.prototype,n.add=function(f,w){Ht(this),this.i=null,f=Qn(this,f);var E=this.g.get(f);return E||this.g.set(f,E=[]),E.push(w),this.h+=1,this};function mi(f,w){Ht(f),w=Qn(f,w),f.g.has(w)&&(f.i=null,f.h-=f.g.get(w).length,f.g.delete(w))}function gi(f,w){return Ht(f),w=Qn(f,w),f.g.has(w)}n.forEach=function(f,w){Ht(this),this.g.forEach(function(E,A){E.forEach(function(H){f.call(w,H,A,this)},this)},this)},n.na=function(){Ht(this);const f=Array.from(this.g.values()),w=Array.from(this.g.keys()),E=[];for(let A=0;A<w.length;A++){const H=f[A];for(let Y=0;Y<H.length;Y++)E.push(w[A])}return E},n.V=function(f){Ht(this);let w=[];if(typeof f=="string")gi(this,f)&&(w=w.concat(this.g.get(Qn(this,f))));else{f=Array.from(this.g.values());for(let E=0;E<f.length;E++)w=w.concat(f[E])}return w},n.set=function(f,w){return Ht(this),this.i=null,f=Qn(this,f),gi(this,f)&&(this.h-=this.g.get(f).length),this.g.set(f,[w]),this.h+=1,this},n.get=function(f,w){return f?(f=this.V(f),0<f.length?String(f[0]):w):w};function Gr(f,w,E){mi(f,w),0<E.length&&(f.i=null,f.g.set(Qn(f,w),C(E)),f.h+=E.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";const f=[],w=Array.from(this.g.keys());for(var E=0;E<w.length;E++){var A=w[E];const Y=encodeURIComponent(String(A)),ae=this.V(A);for(A=0;A<ae.length;A++){var H=Y;ae[A]!==""&&(H+="="+encodeURIComponent(String(ae[A]))),f.push(H)}}return this.i=f.join("&")};function Qn(f,w){return w=String(w),f.j&&(w=w.toLowerCase()),w}function Li(f,w){w&&!f.j&&(Ht(f),f.i=null,f.g.forEach(function(E,A){var H=A.toLowerCase();A!=H&&(mi(this,A),Gr(this,H,E))},f)),f.j=w}function Of(f,w){const E=new Xs;if(u.Image){const A=new Image;A.onload=b(wn,E,"TestLoadImage: loaded",!0,w,A),A.onerror=b(wn,E,"TestLoadImage: error",!1,w,A),A.onabort=b(wn,E,"TestLoadImage: abort",!1,w,A),A.ontimeout=b(wn,E,"TestLoadImage: timeout",!1,w,A),u.setTimeout(function(){A.ontimeout&&A.ontimeout()},1e4),A.src=f}else w(!1)}function Uu(f,w){const E=new Xs,A=new AbortController,H=setTimeout(()=>{A.abort(),wn(E,"TestPingServer: timeout",!1,w)},1e4);fetch(f,{signal:A.signal}).then(Y=>{clearTimeout(H),Y.ok?wn(E,"TestPingServer: ok",!0,w):wn(E,"TestPingServer: server error",!1,w)}).catch(()=>{clearTimeout(H),wn(E,"TestPingServer: error",!1,w)})}function wn(f,w,E,A,H){try{H&&(H.onload=null,H.onerror=null,H.onabort=null,H.ontimeout=null),A(E)}catch{}}function Lf(){this.g=new Dl}function zu(f,w,E){const A=E||"";try{Br(f,function(H,Y){let ae=H;p(H)&&(ae=Rl(H)),w.push(A+Y+"="+encodeURIComponent(ae))})}catch(H){throw w.push(A+"type="+encodeURIComponent("_badmap")),H}}function lr(f){this.l=f.Ub||null,this.j=f.eb||!1}T(lr,Qs),lr.prototype.g=function(){return new ro(this.l,this.j)},lr.prototype.i=function(f){return function(){return f}}({});function ro(f,w){It.call(this),this.D=f,this.o=w,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.u=new Headers,this.h=null,this.B="GET",this.A="",this.g=!1,this.v=this.j=this.l=null}T(ro,It),n=ro.prototype,n.open=function(f,w){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=f,this.A=w,this.readyState=1,vi(this)},n.send=function(f){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const w={headers:this.u,method:this.B,credentials:this.m,cache:void 0};f&&(w.body=f),(this.D||u).fetch(new Request(this.A,w)).then(this.Sa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.u=new Headers,this.status=0,this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),1<=this.readyState&&this.g&&this.readyState!=4&&(this.g=!1,yi(this)),this.readyState=0},n.Sa=function(f){if(this.g&&(this.l=f,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=f.headers,this.readyState=2,vi(this)),this.g&&(this.readyState=3,vi(this),this.g)))if(this.responseType==="arraybuffer")f.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof u.ReadableStream<"u"&&"body"in f){if(this.j=f.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;Bu(this)}else f.text().then(this.Ra.bind(this),this.ga.bind(this))};function Bu(f){f.j.read().then(f.Pa.bind(f)).catch(f.ga.bind(f))}n.Pa=function(f){if(this.g){if(this.o&&f.value)this.response.push(f.value);else if(!this.o){var w=f.value?f.value:new Uint8Array(0);(w=this.v.decode(w,{stream:!f.done}))&&(this.response=this.responseText+=w)}f.done?yi(this):vi(this),this.readyState==3&&Bu(this)}},n.Ra=function(f){this.g&&(this.response=this.responseText=f,yi(this))},n.Qa=function(f){this.g&&(this.response=f,yi(this))},n.ga=function(){this.g&&yi(this)};function yi(f){f.readyState=4,f.l=null,f.j=null,f.v=null,vi(f)}n.setRequestHeader=function(f,w){this.u.append(f,w)},n.getResponseHeader=function(f){return this.h&&this.h.get(f.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const f=[],w=this.h.entries();for(var E=w.next();!E.done;)E=E.value,f.push(E[0]+": "+E[1]),E=w.next();return f.join(`\r `)};function vi(f){f.onreadystatechange&&f.onreadystatechange.call(f)}Object.defineProperty(ro.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(f){this.m=f?"include":"same-origin"}});function cr(f){let w="";return X(f,function(E,A){w+=A,w+=":",w+=E,w+=`\r `}),w}function Kr(f,w,E){e:{for(A in E){var A=!1;break e}A=!0}A||(E=cr(E),typeof f=="string"?E!=null&&encodeURIComponent(String(E)):Ye(f,w,E))}function st(f){It.call(this),this.headers=new Map,this.o=f||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}T(st,It);var Vf=/^https?$/i,$l=["POST","PUT"];n=st.prototype,n.Ha=function(f){this.J=f},n.ea=function(f,w,E,A){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+f);w=w?w.toUpperCase():"GET",this.D=f,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():fi.g(),this.v=this.o?Jo(this.o):Jo(fi),this.g.onreadystatechange=x(this.Ea,this);try{this.B=!0,this.g.open(w,String(f),!0),this.B=!1}catch(Y){so(this,Y);return}if(f=E||"",E=new Map(this.headers),A)if(Object.getPrototypeOf(A)===Object.prototype)for(var H in A)E.set(H,A[H]);else if(typeof A.keys=="function"&&typeof A.get=="function")for(const Y of A.keys())E.set(Y,A.get(Y));else throw Error("Unknown input type for opt_headers: "+String(A));A=Array.from(E.keys()).find(Y=>Y.toLowerCase()=="content-type"),H=u.FormData&&f instanceof u.FormData,!(0<=Array.prototype.indexOf.call($l,w,void 0))||A||H||E.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Y,ae]of E)this.g.setRequestHeader(Y,ae);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{ua(this),this.u=!0,this.g.send(f),this.u=!1}catch(Y){so(this,Y)}};function so(f,w){f.h=!1,f.g&&(f.j=!0,f.g.abort(),f.j=!1),f.l=w,f.m=5,ca(f),Mn(f)}function ca(f){f.A||(f.A=!0,kt(f,"complete"),kt(f,"error"))}n.abort=function(f){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=f||7,kt(this,"complete"),kt(this,"abort"),Mn(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Mn(this,!0)),st.aa.N.call(this)},n.Ea=function(){this.s||(this.B||this.u||this.j?Hl(this):this.bb())},n.bb=function(){Hl(this)};function Hl(f){if(f.h&&typeof l<"u"&&(!f.v[1]||_n(f)!=4||f.Z()!=2)){if(f.u&&_n(f)==4)Pl(f.Ea,0,f);else if(kt(f,"readystatechange"),_n(f)==4){f.h=!1;try{const ae=f.Z();e:switch(ae){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var w=!0;break e;default:w=!1}var E;if(!(E=w)){var A;if(A=ae===0){var H=String(f.D).match(no)[1]||null;!H&&u.self&&u.self.location&&(H=u.self.location.protocol.slice(0,-1)),A=!Vf.test(H?H.toLowerCase():"")}E=A}if(E)kt(f,"complete"),kt(f,"success");else{f.m=6;try{var Y=2<_n(f)?f.g.statusText:""}catch{Y=""}f.l=Y+" ["+f.Z()+"]",ca(f)}}finally{Mn(f)}}}}function Mn(f,w){if(f.g){ua(f);const E=f.g,A=f.v[0]?()=>{}:null;f.g=null,f.v=null,w||kt(f,"ready");try{E.onreadystatechange=A}catch{}}}function ua(f){f.I&&(u.clearTimeout(f.I),f.I=null)}n.isActive=function(){return!!this.g};function _n(f){return f.g?f.g.readyState:0}n.Z=function(){try{return 2<_n(this)?this.g.status:-1}catch{return-1}},n.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.Oa=function(f){if(this.g){var w=this.g.responseText;return f&&w.indexOf(f)==0&&(w=w.substring(f.length)),jl(w)}};function Wl(f){try{if(!f.g)return null;if("response"in f.g)return f.g.response;switch(f.H){case"":case"text":return f.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in f.g)return f.g.mozResponseArrayBuffer}return null}catch{return null}}function ha(f){const w={};f=(f.g&&2<=_n(f)&&f.g.getAllResponseHeaders()||"").split(`\r `);for(let A=0;A<f.length;A++){if(D(f[A]))continue;var E=z(f[A]);const H=E[0];if(E=E[1],typeof E!="string")continue;E=E.trim();const Y=w[H]||[];w[H]=Y,Y.push(E)}k(w,function(A){return A.join(", ")})}n.Ba=function(){return this.m},n.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function Vi(f,w,E){return E&&E.internalChannelParams&&E.internalChannelParams[f]||w}function Gl(f){this.Aa=0,this.i=[],this.j=new Xs,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=Vi("failFast",!1,f),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=Vi("baseRetryDelayMs",5e3,f),this.cb=Vi("retryDelaySeedMs",1e4,f),this.Wa=Vi("forwardChannelMaxRetries",2,f),this.wa=Vi("forwardChannelRequestTimeoutMs",2e4,f),this.pa=f&&f.xmlHttpFactory||void 0,this.Xa=f&&f.Tb||void 0,this.Ca=f&&f.useFetchStreams||!1,this.L=void 0,this.J=f&&f.supportsCrossDomainXhr||!1,this.K="",this.h=new to(f&&f.concurrentRequestLimit),this.Da=new Lf,this.P=f&&f.fastHandshake||!1,this.O=f&&f.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=f&&f.Rb||!1,f&&f.xa&&this.j.xa(),f&&f.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&f&&f.detectBufferingProxy||!1,this.ja=void 0,f&&f.longPollingTimeout&&0<f.longPollingTimeout&&(this.ja=f.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}n=Gl.prototype,n.la=8,n.G=1,n.connect=function(f,w,E,A){gt(0),this.W=f,this.H=w||{},E&&A!==void 0&&(this.H.OSID=E,this.H.OAID=A),this.F=this.X,this.I=Wu(this,null,this.W),Fi(this)};function Wt(f){if(da(f),f.G==3){var w=f.U++,E=Dn(f.I);if(Ye(E,"SID",f.K),Ye(E,"RID",w),Ye(E,"TYPE","terminate"),ur(f,E),w=new pi(f,f.j,w),w.L=2,w.v=Hr(Dn(E)),E=!1,u.navigator&&u.navigator.sendBeacon)try{E=u.navigator.sendBeacon(w.v.toString(),"")}catch{}!E&&u.Image&&(new Image().src=w.v,E=!0),E||(w.g=Gu(w.j,null),w.g.ea(w.v)),w.F=Date.now(),Je(w)}Hu(f)}function xi(f){f.g&&(Kl(f),f.g.cancel(),f.g=null)}function da(f){xi(f),f.u&&(u.clearTimeout(f.u),f.u=null),ma(f),f.h.cancel(),f.s&&(typeof f.s=="number"&&u.clearTimeout(f.s),f.s=null)}function Fi(f){if(!jn(f.h)&&!f.s){f.s=!0;var w=f.Ga;ke||le(),oe||(ke(),oe=!0),ge.add(w,f),f.B=0}}function Ff(f,w){return ju(f.h)>=f.h.j-(f.s?1:0)?!1:f.s?(f.i=w.D.concat(f.i),!0):f.G==1||f.G==2||f.B>=(f.Va?0:f.Wa)?!1:(f.s=hi(x(f.Ga,f,w),$u(f,f.B)),f.B++,!0)}n.Ga=function(f){if(this.s)if(this.s=null,this.G==1){if(!f){this.U=Math.floor(1e5*Math.random()),f=this.U++;const H=new pi(this,this.j,f);let Y=this.o;if(this.S&&(Y?(Y=P(Y),F(Y,this.S)):Y=this.S),this.m!==null||this.O||(H.H=Y,Y=null),this.P)e:{for(var w=0,E=0;E<this.i.length;E++){t:{var A=this.i[E];if("__data__"in A.map&&(A=A.map.__data__,typeof A=="string")){A=A.length;break t}A=void 0}if(A===void 0)break;if(w+=A,4096<w){w=E;break e}if(w===4096||E===this.i.length-1){w=E+1;break e}}w=1e3}else w=1e3;w=Qr(this,H,w),E=Dn(this.I),Ye(E,"RID",f),Ye(E,"CVER",22),this.D&&Ye(E,"X-HTTP-Session-Id",this.D),ur(this,E),Y&&(this.O?w="headers="+encodeURIComponent(String(cr(Y)))+"&"+w:this.m&&Kr(E,this.m,Y)),Bl(this.h,H),this.Ua&&Ye(E,"TYPE","init"),this.P?(Ye(E,"$req",w),Ye(E,"SID","null"),H.T=!0,sa(H,E,null)):sa(H,E,w),this.G=2}}else this.G==3&&(f?fa(this,f):this.i.length==0||jn(this.h)||fa(this))};function fa(f,w){var E;w?E=w.l:E=f.U++;const A=Dn(f.I);Ye(A,"SID",f.K),Ye(A,"RID",E),Ye(A,"AID",f.T),ur(f,A),f.m&&f.o&&Kr(A,f.m,f.o),E=new pi(f,f.j,E,f.B+1),f.m===null&&(E.H=f.o),w&&(f.i=w.D.concat(f.i)),w=Qr(f,E,1e3),E.I=Math.round(.5*f.wa)+Math.round(.5*f.wa*Math.random()),Bl(f.h,E),sa(E,A,w)}function ur(f,w){f.H&&X(f.H,function(E,A){Ye(w,A,E)}),f.l&&Br({},function(E,A){Ye(w,A,E)})}function Qr(f,w,E){E=Math.min(f.i.length,E);var A=f.l?x(f.l.Na,f.l,f):null;e:{var H=f.i;let Y=-1;for(;;){const ae=["count="+E];Y==-1?0<E?(Y=H[0].g,ae.push("ofs="+Y)):Y=0:ae.push("ofs="+Y);let Qe=!0;for(let Pt=0;Pt<E;Pt++){let Ue=H[Pt].g;const Lt=H[Pt].map;if(Ue-=Y,0>Ue)Y=Math.max(0,H[Pt].g-100),Qe=!1;else try{zu(Lt,ae,"req"+Ue+"_")}catch{A&&A(Lt)}}if(Qe){A=ae.join("&");break e}}}return f=f.i.splice(0,E),w.D=f,A}function oo(f){if(!f.g&&!f.u){f.Y=1;var w=f.Fa;ke||le(),oe||(ke(),oe=!0),ge.add(w,f),f.v=0}}function pa(f){return f.g||f.u||3<=f.v?!1:(f.Y++,f.u=hi(x(f.Fa,f),$u(f,f.v)),f.v++,!0)}n.Fa=function(){if(this.u=null,qu(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var f=2*this.R;this.j.info("BP detection timer enabled: "+f),this.A=hi(x(this.ab,this),f)}},n.ab=function(){this.A&&(this.A=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.M=!0,gt(10),xi(this),qu(this))};function Kl(f){f.A!=null&&(u.clearTimeout(f.A),f.A=null)}function qu(f){f.g=new pi(f,f.j,"rpc",f.Y),f.m===null&&(f.g.H=f.o),f.g.O=0;var w=Dn(f.qa);Ye(w,"RID","rpc"),Ye(w,"SID",f.K),Ye(w,"AID",f.T),Ye(w,"CI",f.F?"0":"1"),!f.F&&f.ja&&Ye(w,"TO",f.ja),Ye(w,"TYPE","xmlhttp"),ur(f,w),f.m&&f.o&&Kr(w,f.m,f.o),f.L&&(f.g.I=f.L);var E=f.g;f=f.ia,E.L=1,E.v=Hr(Dn(w)),E.m=null,E.P=!0,Ul(E,f)}n.Za=function(){this.C!=null&&(this.C=null,xi(this),pa(this),gt(19))};function ma(f){f.C!=null&&(u.clearTimeout(f.C),f.C=null)}function ga(f,w){var E=null;if(f.g==w){ma(f),Kl(f),f.g=null;var A=2}else if(pn(f.h,w))E=w.D,Du(f.h,w),A=1;else return;if(f.G!=0){if(w.o)if(A==1){E=w.m?w.m.length:0,w=Date.now()-w.F;var H=f.B;A=Ys(),kt(A,new ta(A,E)),Fi(f)}else oo(f);else if(H=w.s,H==3||H==0&&0<w.X||!(A==1&&Ff(f,w)||A==2&&pa(f)))switch(E&&0<E.length&&(w=f.h,w.i=w.i.concat(E)),H){case 1:hr(f,5);break;case 4:hr(f,10);break;case 3:hr(f,6);break;default:hr(f,2)}}}function $u(f,w){let E=f.Ta+Math.floor(Math.random()*f.cb);return f.isActive()||(E*=2),E*w}function hr(f,w){if(f.j.info("Error code "+w),w==2){var E=x(f.fb,f),A=f.Xa;const H=!A;A=new ar(A||"//www.google.com/images/cleardot.gif"),u.location&&u.location.protocol=="http"||io(A,"https"),Hr(A),H?Of(A.toString(),E):Uu(A.toString(),E)}else gt(2);f.G=0,f.l&&f.l.sa(w),Hu(f),da(f)}n.fb=function(f){f?(this.j.info("Successfully pinged google.com"),gt(2)):(this.j.info("Failed to ping google.com"),gt(1))};function Hu(f){if(f.G=0,f.ka=[],f.l){const w=Mu(f.h);(w.length!=0||f.i.length!=0)&&(I(f.ka,w),I(f.ka,f.i),f.h.i.length=0,C(f.i),f.i.length=0),f.l.ra()}}function Wu(f,w,E){var A=E instanceof ar?Dn(E):new ar(E);if(A.g!="")w&&(A.g=w+"."+A.g),qr(A,A.s);else{var H=u.location;A=H.protocol,w=w?w+"."+H.hostname:H.hostname,H=+H.port;var Y=new ar(null);A&&io(Y,A),w&&(Y.g=w),H&&qr(Y,H),E&&(Y.l=E),A=Y}return E=f.D,w=f.ya,E&&w&&Ye(A,E,w),Ye(A,"VER",f.la),ur(f,A),A}function Gu(f,w,E){if(w&&!f.J)throw Error("Can't create secondary domain capable XhrIo object.");return w=f.Ca&&!f.pa?new st(new lr({eb:E})):new st(f.pa),w.Ha(f.J),w}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function Ql(){}n=Ql.prototype,n.ua=function(){},n.ta=function(){},n.sa=function(){},n.ra=function(){},n.isActive=function(){return!0},n.Na=function(){};function ya(){}ya.prototype.g=function(f,w){return new mn(f,w)};function mn(f,w){It.call(this),this.g=new Gl(w),this.l=f,this.h=w&&w.messageUrlParams||null,f=w&&w.messageHeaders||null,w&&w.clientProtocolHeaderRequired&&(f?f["X-Client-Protocol"]="webchannel":f={"X-Client-Protocol":"webchannel"}),this.g.o=f,f=w&&w.initMessageHeaders||null,w&&w.messageContentType&&(f?f["X-WebChannel-Content-Type"]=w.messageContentType:f={"X-WebChannel-Content-Type":w.messageContentType}),w&&w.va&&(f?f["X-WebChannel-Client-Profile"]=w.va:f={"X-WebChannel-Client-Profile":w.va}),this.g.S=f,(f=w&&w.Sb)&&!D(f)&&(this.g.m=f),this.v=w&&w.supportsCrossDomainXhr||!1,this.u=w&&w.sendRawJson||!1,(w=w&&w.httpSessionIdParam)&&!D(w)&&(this.g.D=w,f=this.h,f!==null&&w in f&&(f=this.h,w in f&&delete f[w])),this.j=new Ui(this)}T(mn,It),mn.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},mn.prototype.close=function(){Wt(this.g)},mn.prototype.o=function(f){var w=this.g;if(typeof f=="string"){var E={};E.__data__=f,f=E}else this.u&&(E={},E.__data__=Rl(f),f=E);w.i.push(new Ru(w.Ya++,f)),w.G==3&&Fi(w)},mn.prototype.N=function(){this.g.l=null,delete this.j,Wt(this.g),delete this.g,mn.aa.N.call(this)};function Ku(f){Di.call(this),f.__headers__&&(this.headers=f.__headers__,this.statusCode=f.__status__,delete f.__headers__,delete f.__status__);var w=f.__sm__;if(w){e:{for(const E in w){f=E;break e}f=void 0}(this.i=f)&&(f=this.i,w=w!==null&&f in w?w[f]:void 0),this.data=w}else this.data=f}T(Ku,Di);function Qu(){ea.call(this),this.status=1}T(Qu,ea);function Ui(f){this.g=f}T(Ui,Ql),Ui.prototype.ua=function(){kt(this.g,"a")},Ui.prototype.ta=function(f){kt(this.g,new Ku(f))},Ui.prototype.sa=function(f){kt(this.g,new Qu)},Ui.prototype.ra=function(){kt(this.g,"b")},ya.prototype.createWebChannel=ya.prototype.g,mn.prototype.send=mn.prototype.o,mn.prototype.open=mn.prototype.m,mn.prototype.close=mn.prototype.close,mT=function(){return new ya},pT=function(){return Ys()},fT=Mi,Cg={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},ia.NO_ERROR=0,ia.TIMEOUT=8,ia.HTTP_ERROR=6,sd=ia,ku.COMPLETE="complete",dT=ku,Zo.EventType=Gn,Gn.OPEN="a",Gn.CLOSE="b",Gn.ERROR="c",Gn.MESSAGE="d",It.prototype.listen=It.prototype.K,Cc=Zo,st.prototype.listenOnce=st.prototype.L,st.prototype.getLastError=st.prototype.Ka,st.prototype.getLastErrorCode=st.prototype.Ba,st.prototype.getStatus=st.prototype.Z,st.prototype.getResponseJson=st.prototype.Oa,st.prototype.getResponseText=st.prototype.oa,st.prototype.send=st.prototype.ea,st.prototype.setWithCredentials=st.prototype.Ha,hT=st}).apply(typeof Gh<"u"?Gh:typeof self<"u"?self:typeof window<"u"?window:{});const lb="@firebase/firestore",cb="4.7.10";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class an{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}an.UNAUTHENTICATED=new an(null),an.GOOGLE_CREDENTIALS=new an("google-credentials-uid"),an.FIRST_PARTY=new an("first-party-uid"),an.MOCK_USER=new an("mock-user");/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let xl="11.5.0";/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Oo=new $y("@firebase/firestore");function Ua(){return Oo.logLevel}function ue(n,...e){if(Oo.logLevel<=Oe.DEBUG){const t=e.map(Gy);Oo.debug(`Firestore (${xl}): ${n}`,...t)}}function jr(n,...e){if(Oo.logLevel<=Oe.ERROR){const t=e.map(Gy);Oo.error(`Firestore (${xl}): ${n}`,...t)}}function al(n,...e){if(Oo.logLevel<=Oe.WARN){const t=e.map(Gy);Oo.warn(`Firestore (${xl}): ${n}`,...t)}}function Gy(n){if(typeof n=="string")return n;try{/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */return function(t){return JSON.stringify(t)}(n)}catch{return n}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Se(n="Unexpected state"){const e=`FIRESTORE (${xl}) INTERNAL ASSERTION FAILED: `+n;throw jr(e),new Error(e)}function Ke(n,e){n||Se()}function Pe(n,e){return n}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const J={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class he extends Lr{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Pr{constructor(){this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gT{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class kL{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable(()=>t(an.UNAUTHENTICATED))}shutdown(){}}class PL{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable(()=>t(this.token.user))}shutdown(){this.changeListener=null}}class AL{constructor(e){this.t=e,this.currentUser=an.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,t){Ke(this.o===void 0);let i=this.i;const r=h=>this.i!==i?(i=this.i,t(h)):Promise.resolve();let o=new Pr;this.o=()=>{this.i++,this.currentUser=this.u(),o.resolve(),o=new Pr,e.enqueueRetryable(()=>r(this.currentUser))};const l=()=>{const h=o;e.enqueueRetryable(async()=>{await h.promise,await r(this.currentUser)})},u=h=>{ue("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=h,this.o&&(this.auth.addAuthTokenListener(this.o),l())};this.t.onInit(h=>u(h)),setTimeout(()=>{if(!this.auth){const h=this.t.getImmediate({optional:!0});h?u(h):(ue("FirebaseAuthCredentialsProvider","Auth not yet detected"),o.resolve(),o=new Pr)}},0),l()}getToken(){const e=this.i,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then(i=>this.i!==e?(ue("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):i?(Ke(typeof i.accessToken=="string"),new gT(i.accessToken,this.currentUser)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.o&&this.auth.removeAuthTokenListener(this.o),this.o=void 0}u(){const e=this.auth&&this.auth.getUid();return Ke(e===null||typeof e=="string"),new an(e)}}class NL{constructor(e,t,i){this.l=e,this.h=t,this.P=i,this.type="FirstParty",this.user=an.FIRST_PARTY,this.T=new Map}I(){return this.P?this.P():null}get headers(){this.T.set("X-Goog-AuthUser",this.l);const e=this.I();return e&&this.T.set("Authorization",e),this.h&&this.T.set("X-Goog-Iam-Authorization-Token",this.h),this.T}}class RL{constructor(e,t,i){this.l=e,this.h=t,this.P=i}getToken(){return Promise.resolve(new NL(this.l,this.h,this.P))}start(e,t){e.enqueueRetryable(()=>t(an.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class ub{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class jL{constructor(e,t){this.A=t,this.forceRefresh=!1,this.appCheck=null,this.R=null,this.V=null,ai(e)&&e.settings.appCheckToken&&(this.V=e.settings.appCheckToken)}start(e,t){Ke(this.o===void 0);const i=o=>{o.error!=null&&ue("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${o.error.message}`);const l=o.token!==this.R;return this.R=o.token,ue("FirebaseAppCheckTokenProvider",`Received ${l?"new":"existing"} token.`),l?t(o.token):Promise.resolve()};this.o=o=>{e.enqueueRetryable(()=>i(o))};const r=o=>{ue("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=o,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(o=>r(o)),setTimeout(()=>{if(!this.appCheck){const o=this.A.getImmediate({optional:!0});o?r(o):ue("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.V)return Promise.resolve(new ub(this.V));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(t=>t?(Ke(typeof t.token=="string"),this.R=t.token,new ub(t.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function DL(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let i=0;i<n;i++)t[i]=Math.floor(256*Math.random());return t}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function yT(){return new TextEncoder}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class vT{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let i="";for(;i.length<20;){const r=DL(40);for(let o=0;o<r.length;++o)i.length<20&&r[o]<t&&(i+=e.charAt(r[o]%62))}return i}}function Re(n,e){return n<e?-1:n>e?1:0}function Ig(n,e){let t=0;for(;t<n.length&&t<e.length;){const i=n.codePointAt(t),r=e.codePointAt(t);if(i!==r){if(i<128&&r<128)return Re(i,r);{const o=yT(),l=ML(o.encode(hb(n,t)),o.encode(hb(e,t)));return l!==0?l:Re(i,r)}}t+=i>65535?2:1}return Re(n.length,e.length)}function hb(n,e){return n.codePointAt(e)>65535?n.substring(e,e+2):n.substring(e,e+1)}function ML(n,e){for(let t=0;t<n.length&&t<e.length;++t)if(n[t]!==e[t])return Re(n[t],e[t]);return Re(n.length,e.length)}function ll(n,e,t){return n.length===e.length&&n.every((i,r)=>t(i,e[r]))}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const db=-62135596800,fb=1e6;class jt{static now(){return jt.fromMillis(Date.now())}static fromDate(e){return jt.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),i=Math.floor((e-1e3*t)*fb);return new jt(t,i)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new he(J.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new he(J.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<db)throw new he(J.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new he(J.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/fb}_compareTo(e){return this.seconds===e.seconds?Re(this.nanoseconds,e.nanoseconds):Re(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{seconds:this.seconds,nanoseconds:this.nanoseconds}}valueOf(){const e=this.seconds-db;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ie{static fromTimestamp(e){return new Ie(e)}static min(){return new Ie(new jt(0,0))}static max(){return new Ie(new jt(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const pb="__name__";class Wi{constructor(e,t,i){t===void 0?t=0:t>e.length&&Se(),i===void 0?i=e.length-t:i>e.length-t&&Se(),this.segments=e,this.offset=t,this.len=i}get length(){return this.len}isEqual(e){return Wi.comparator(this,e)===0}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof Wi?e.forEach(i=>{t.push(i)}):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,i=this.limit();t<i;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const i=Math.min(e.length,t.length);for(let r=0;r<i;r++){const o=Wi.compareSegments(e.get(r),t.get(r));if(o!==0)return o}return Re(e.length,t.length)}static compareSegments(e,t){const i=Wi.isNumericId(e),r=Wi.isNumericId(t);return i&&!r?-1:!i&&r?1:i&&r?Wi.extractNumericId(e).compare(Wi.extractNumericId(t)):Ig(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return Ts.fromString(e.substring(4,e.length-2))}}class it extends Wi{construct(e,t,i){return new it(e,t,i)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const i of e){if(i.indexOf("//")>=0)throw new he(J.INVALID_ARGUMENT,`Invalid segment (${i}). Paths must not contain // in them.`);t.push(...i.split("/").filter(r=>r.length>0))}return new it(t)}static emptyPath(){return new it([])}}const OL=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Xt extends Wi{construct(e,t,i){return new Xt(e,t,i)}static isValidIdentifier(e){return OL.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Xt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===pb}static keyField(){return new Xt([pb])}static fromServerFormat(e){const t=[];let i="",r=0;const o=()=>{if(i.length===0)throw new he(J.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(i),i=""};let l=!1;for(;r<e.length;){const u=e[r];if(u==="\\"){if(r+1===e.length)throw new he(J.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const h=e[r+1];if(h!=="\\"&&h!=="."&&h!=="`")throw new he(J.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);i+=h,r+=2}else u==="`"?(l=!l,r++):u!=="."||l?(i+=u,r++):(o(),r++)}if(o(),l)throw new he(J.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Xt(t)}static emptyPath(){return new Xt([])}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ve{constructor(e){this.path=e}static fromPath(e){return new ve(it.fromString(e))}static fromName(e){return new ve(it.fromString(e).popFirst(5))}static empty(){return new ve(it.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&it.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return it.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new ve(new it(e.slice()))}}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const tu=-1;function LL(n,e){const t=n.toTimestamp().seconds,i=n.toTimestamp().nanoseconds+1,r=Ie.fromTimestamp(i===1e9?new jt(t+1,0):new jt(t,i));return new As(r,ve.empty(),e)}function VL(n){return new As(n.readTime,n.key,tu)}class As{constructor(e,t,i){this.readTime=e,this.documentKey=t,this.largestBatchId=i}static min(){return new As(Ie.min(),ve.empty(),tu)}static max(){return new As(Ie.max(),ve.empty(),tu)}}function FL(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=ve.comparator(n.documentKey,e.documentKey),t!==0?t:Re(n.largestBatchId,e.largestBatchId))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const UL="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class zL{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function wl(n){if(n.code!==J.FAILED_PRECONDITION||n.message!==UL)throw n;ue("LocalStore","Unexpectedly lost primary lease")}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Z{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)},t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)})}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&Se(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new Z((i,r)=>{this.nextCallback=o=>{this.wrapSuccess(e,o).next(i,r)},this.catchCallback=o=>{this.wrapFailure(t,o).next(i,r)}})}toPromise(){return new Promise((e,t)=>{this.next(e,t)})}wrapUserFunction(e){try{const t=e();return t instanceof Z?t:Z.resolve(t)}catch(t){return Z.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction(()=>e(t)):Z.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction(()=>e(t)):Z.reject(t)}static resolve(e){return new Z((t,i)=>{t(e)})}static reject(e){return new Z((t,i)=>{i(e)})}static waitFor(e){return new Z((t,i)=>{let r=0,o=0,l=!1;e.forEach(u=>{++r,u.next(()=>{++o,l&&o===r&&t()},h=>i(h))}),l=!0,o===r&&t()})}static or(e){let t=Z.resolve(!1);for(const i of e)t=t.next(r=>r?Z.resolve(r):i());return t}static forEach(e,t){const i=[];return e.forEach((r,o)=>{i.push(t.call(this,r,o))}),this.waitFor(i)}static mapArray(e,t){return new Z((i,r)=>{const o=e.length,l=new Array(o);let u=0;for(let h=0;h<o;h++){const p=h;t(e[p]).next(g=>{l[p]=g,++u,u===o&&i(l)},g=>r(g))}})}static doWhile(e,t){return new Z((i,r)=>{const o=()=>{e()===!0?t().next(()=>{o()},r):i()};o()})}}function BL(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}function _l(n){return n.name==="IndexedDbTransactionError"}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class af{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=i=>this.oe(i),this._e=i=>t.writeSequenceNumber(i))}oe(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this._e&&this._e(e),e}}af.ae=-1;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ky=-1;function lf(n){return n==null}function Ad(n){return n===0&&1/n==-1/0}function qL(n){return typeof n=="number"&&Number.isInteger(n)&&!Ad(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const xT="";function $L(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=mb(e)),e=HL(n.get(t),e);return mb(e)}function HL(n,e){let t=e;const i=n.length;for(let r=0;r<i;r++){const o=n.charAt(r);switch(o){case"\0":t+="";break;case xT:t+="";break;default:t+=o}}return t}function mb(n){return n+xT+""}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function gb(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function Us(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function wT(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dt{constructor(e,t){this.comparator=e,this.root=t||Yt.EMPTY}insert(e,t){return new dt(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,Yt.BLACK,null,null))}remove(e){return new dt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Yt.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const i=this.comparator(e,t.key);if(i===0)return t.value;i<0?t=t.left:i>0&&(t=t.right)}return null}indexOf(e){let t=0,i=this.root;for(;!i.isEmpty();){const r=this.comparator(e,i.key);if(r===0)return t+i.left.size;r<0?i=i.left:(t+=i.left.size+1,i=i.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal((t,i)=>(e(t,i),!1))}toString(){const e=[];return this.inorderTraversal((t,i)=>(e.push(`${t}:${i}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Kh(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Kh(this.root,e,this.comparator,!1)}getReverseIterator(){return new Kh(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Kh(this.root,e,this.comparator,!0)}}class Kh{constructor(e,t,i,r){this.isReverse=r,this.nodeStack=[];let o=1;for(;!e.isEmpty();)if(o=t?i(e.key,t):1,t&&r&&(o*=-1),o<0)e=this.isReverse?e.left:e.right;else{if(o===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class Yt{constructor(e,t,i,r,o){this.key=e,this.value=t,this.color=i??Yt.RED,this.left=r??Yt.EMPTY,this.right=o??Yt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,i,r,o){return new Yt(e??this.key,t??this.value,i??this.color,r??this.left,o??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,i){let r=this;const o=i(e,r.key);return r=o<0?r.copy(null,null,null,r.left.insert(e,t,i),null):o===0?r.copy(null,t,null,null,null):r.copy(null,null,null,null,r.right.insert(e,t,i)),r.fixUp()}removeMin(){if(this.left.isEmpty())return Yt.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let i,r=this;if(t(e,r.key)<0)r.left.isEmpty()||r.left.isRed()||r.left.left.isRed()||(r=r.moveRedLeft()),r=r.copy(null,null,null,r.left.remove(e,t),null);else{if(r.left.isRed()&&(r=r.rotateRight()),r.right.isEmpty()||r.right.isRed()||r.right.left.isRed()||(r=r.moveRedRight()),t(e,r.key)===0){if(r.right.isEmpty())return Yt.EMPTY;i=r.right.min(),r=r.copy(i.key,i.value,null,null,r.right.removeMin())}r=r.copy(null,null,null,null,r.right.remove(e,t))}return r.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,Yt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Yt.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw Se();const e=this.left.check();if(e!==this.right.check())throw Se();return e+(this.isRed()?0:1)}}Yt.EMPTY=null,Yt.RED=!0,Yt.BLACK=!1;Yt.EMPTY=new class{constructor(){this.size=0}get key(){throw Se()}get value(){throw Se()}get color(){throw Se()}get left(){throw Se()}get right(){throw Se()}copy(e,t,i,r,o){return this}insert(e,t,i){return new Yt(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Dt{constructor(e){this.comparator=e,this.data=new dt(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal((t,i)=>(e(t),!1))}forEachInRange(e,t){const i=this.data.getIteratorFrom(e[0]);for(;i.hasNext();){const r=i.getNext();if(this.comparator(r.key,e[1])>=0)return;t(r.key)}}forEachWhile(e,t){let i;for(i=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();i.hasNext();)if(!e(i.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new yb(this.data.getIterator())}getIteratorFrom(e){return new yb(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach(i=>{t=t.add(i)}),t}isEqual(e){if(!(e instanceof Dt)||this.size!==e.size)return!1;const t=this.data.getIterator(),i=e.data.getIterator();for(;t.hasNext();){const r=t.getNext().key,o=i.getNext().key;if(this.comparator(r,o)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(t=>{e.push(t)}),e}toString(){const e=[];return this.forEach(t=>e.push(t)),"SortedSet("+e.toString()+")"}copy(e){const t=new Dt(this.comparator);return t.data=e,t}}class yb{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bn{constructor(e){this.fields=e,e.sort(Xt.comparator)}static empty(){return new Bn([])}unionWith(e){let t=new Dt(Xt.comparator);for(const i of this.fields)t=t.add(i);for(const i of e)t=t.add(i);return new Bn(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return ll(this.fields,e.fields,(t,i)=>t.isEqual(i))}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _T extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Zt{constructor(e){this.binaryString=e}static fromBase64String(e){const t=function(r){try{return atob(r)}catch(o){throw typeof DOMException<"u"&&o instanceof DOMException?new _T("Invalid base64 string: "+o):o}}(e);return new Zt(t)}static fromUint8Array(e){const t=function(r){let o="";for(let l=0;l<r.length;++l)o+=String.fromCharCode(r[l]);return o}(e);return new Zt(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(t){return btoa(t)}(this.binaryString)}toUint8Array(){return function(t){const i=new Uint8Array(t.length);for(let r=0;r<t.length;r++)i[r]=t.charCodeAt(r);return i}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Re(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Zt.EMPTY_BYTE_STRING=new Zt("");const WL=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Ns(n){if(Ke(!!n),typeof n=="string"){let e=0;const t=WL.exec(n);if(Ke(!!t),t[1]){let r=t[1];r=(r+"000000000").substr(0,9),e=Number(r)}const i=new Date(n);return{seconds:Math.floor(i.getTime()/1e3),nanos:e}}return{seconds:xt(n.seconds),nanos:xt(n.nanos)}}function xt(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function Rs(n){return typeof n=="string"?Zt.fromBase64String(n):Zt.fromUint8Array(n)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const bT="server_timestamp",ET="__type__",TT="__previous_value__",ST="__local_write_time__";function Qy(n){var e,t;return((t=(((e=n==null?void 0:n.mapValue)===null||e===void 0?void 0:e.fields)||{})[ET])===null||t===void 0?void 0:t.stringValue)===bT}function cf(n){const e=n.mapValue.fields[TT];return Qy(e)?cf(e):e}function nu(n){const e=Ns(n.mapValue.fields[ST].timestampValue);return new jt(e.seconds,e.nanos)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class GL{constructor(e,t,i,r,o,l,u,h,p){this.databaseId=e,this.appId=t,this.persistenceKey=i,this.host=r,this.ssl=o,this.forceLongPolling=l,this.autoDetectLongPolling=u,this.longPollingOptions=h,this.useFetchStreams=p}}const Nd="(default)";class iu{constructor(e,t){this.projectId=e,this.database=t||Nd}static empty(){return new iu("","")}get isDefaultDatabase(){return this.database===Nd}isEqual(e){return e instanceof iu&&e.projectId===this.projectId&&e.database===this.database}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const CT="__type__",KL="__max__",Qh={mapValue:{}},IT="__vector__",Rd="value";function js(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?Qy(n)?4:YL(n)?9007199254740991:QL(n)?10:11:Se()}function er(n,e){if(n===e)return!0;const t=js(n);if(t!==js(e))return!1;switch(t){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return nu(n).isEqual(nu(e));case 3:return function(r,o){if(typeof r.timestampValue=="string"&&typeof o.timestampValue=="string"&&r.timestampValue.length===o.timestampValue.length)return r.timestampValue===o.timestampValue;const l=Ns(r.timestampValue),u=Ns(o.timestampValue);return l.seconds===u.seconds&&l.nanos===u.nanos}(n,e);case 5:return n.stringValue===e.stringValue;case 6:return function(r,o){return Rs(r.bytesValue).isEqual(Rs(o.bytesValue))}(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return function(r,o){return xt(r.geoPointValue.latitude)===xt(o.geoPointValue.latitude)&&xt(r.geoPointValue.longitude)===xt(o.geoPointValue.longitude)}(n,e);case 2:return function(r,o){if("integerValue"in r&&"integerValue"in o)return xt(r.integerValue)===xt(o.integerValue);if("doubleValue"in r&&"doubleValue"in o){const l=xt(r.doubleValue),u=xt(o.doubleValue);return l===u?Ad(l)===Ad(u):isNaN(l)&&isNaN(u)}return!1}(n,e);case 9:return ll(n.arrayValue.values||[],e.arrayValue.values||[],er);case 10:case 11:return function(r,o){const l=r.mapValue.fields||{},u=o.mapValue.fields||{};if(gb(l)!==gb(u))return!1;for(const h in l)if(l.hasOwnProperty(h)&&(u[h]===void 0||!er(l[h],u[h])))return!1;return!0}(n,e);default:return Se()}}function ru(n,e){return(n.values||[]).find(t=>er(t,e))!==void 0}function cl(n,e){if(n===e)return 0;const t=js(n),i=js(e);if(t!==i)return Re(t,i);switch(t){case 0:case 9007199254740991:return 0;case 1:return Re(n.booleanValue,e.booleanValue);case 2:return function(o,l){const u=xt(o.integerValue||o.doubleValue),h=xt(l.integerValue||l.doubleValue);return u<h?-1:u>h?1:u===h?0:isNaN(u)?isNaN(h)?0:-1:1}(n,e);case 3:return vb(n.timestampValue,e.timestampValue);case 4:return vb(nu(n),nu(e));case 5:return Ig(n.stringValue,e.stringValue);case 6:return function(o,l){const u=Rs(o),h=Rs(l);return u.compareTo(h)}(n.bytesValue,e.bytesValue);case 7:return function(o,l){const u=o.split("/"),h=l.split("/");for(let p=0;p<u.length&&p<h.length;p++){const g=Re(u[p],h[p]);if(g!==0)return g}return Re(u.length,h.length)}(n.referenceValue,e.referenceValue);case 8:return function(o,l){const u=Re(xt(o.latitude),xt(l.latitude));return u!==0?u:Re(xt(o.longitude),xt(l.longitude))}(n.geoPointValue,e.geoPointValue);case 9:return xb(n.arrayValue,e.arrayValue);case 10:return function(o,l){var u,h,p,g;const y=o.fields||{},x=l.fields||{},b=(u=y[Rd])===null||u===void 0?void 0:u.arrayValue,T=(h=x[Rd])===null||h===void 0?void 0:h.arrayValue,C=Re(((p=b==null?void 0:b.values)===null||p===void 0?void 0:p.length)||0,((g=T==null?void 0:T.values)===null||g===void 0?void 0:g.length)||0);return C!==0?C:xb(b,T)}(n.mapValue,e.mapValue);case 11:return function(o,l){if(o===Qh.mapValue&&l===Qh.mapValue)return 0;if(o===Qh.mapValue)return 1;if(l===Qh.mapValue)return-1;const u=o.fields||{},h=Object.keys(u),p=l.fields||{},g=Object.keys(p);h.sort(),g.sort();for(let y=0;y<h.length&&y<g.length;++y){const x=Ig(h[y],g[y]);if(x!==0)return x;const b=cl(u[h[y]],p[g[y]]);if(b!==0)return b}return Re(h.length,g.length)}(n.mapValue,e.mapValue);default:throw Se()}}function vb(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return Re(n,e);const t=Ns(n),i=Ns(e),r=Re(t.seconds,i.seconds);return r!==0?r:Re(t.nanos,i.nanos)}function xb(n,e){const t=n.values||[],i=e.values||[];for(let r=0;r<t.length&&r<i.length;++r){const o=cl(t[r],i[r]);if(o)return o}return Re(t.length,i.length)}function ul(n){return kg(n)}function kg(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?function(t){const i=Ns(t);return`time(${i.seconds},${i.nanos})`}(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?function(t){return Rs(t).toBase64()}(n.bytesValue):"referenceValue"in n?function(t){return ve.fromName(t).toString()}(n.referenceValue):"geoPointValue"in n?function(t){return`geo(${t.latitude},${t.longitude})`}(n.geoPointValue):"arrayValue"in n?function(t){let i="[",r=!0;for(const o of t.values||[])r?r=!1:i+=",",i+=kg(o);return i+"]"}(n.arrayValue):"mapValue"in n?function(t){const i=Object.keys(t.fields||{}).sort();let r="{",o=!0;for(const l of i)o?o=!1:r+=",",r+=`${l}:${kg(t.fields[l])}`;return r+"}"}(n.mapValue):Se()}function od(n){switch(js(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=cf(n);return e?16+od(e):16;case 5:return 2*n.stringValue.length;case 6:return Rs(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return function(i){return(i.values||[]).reduce((r,o)=>r+od(o),0)}(n.arrayValue);case 10:case 11:return function(i){let r=0;return Us(i.fields,(o,l)=>{r+=o.length+od(l)}),r}(n.mapValue);default:throw Se()}}function wb(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function Pg(n){return!!n&&"integerValue"in n}function Yy(n){return!!n&&"arrayValue"in n}function _b(n){return!!n&&"nullValue"in n}function bb(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function ad(n){return!!n&&"mapValue"in n}function QL(n){var e,t;return((t=(((e=n==null?void 0:n.mapValue)===null||e===void 0?void 0:e.fields)||{})[CT])===null||t===void 0?void 0:t.stringValue)===IT}function Vc(n){if(n.geoPointValue)return{geoPointValue:Object.assign({},n.geoPointValue)};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:Object.assign({},n.timestampValue)};if(n.mapValue){const e={mapValue:{fields:{}}};return Us(n.mapValue.fields,(t,i)=>e.mapValue.fields[t]=Vc(i)),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=Vc(n.arrayValue.values[t]);return e}return Object.assign({},n)}function YL(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===KL}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class An{constructor(e){this.value=e}static empty(){return new An({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let i=0;i<e.length-1;++i)if(t=(t.mapValue.fields||{})[e.get(i)],!ad(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Vc(t)}setAll(e){let t=Xt.emptyPath(),i={},r=[];e.forEach((l,u)=>{if(!t.isImmediateParentOf(u)){const h=this.getFieldsMap(t);this.applyChanges(h,i,r),i={},r=[],t=u.popLast()}l?i[u.lastSegment()]=Vc(l):r.push(u.lastSegment())});const o=this.getFieldsMap(t);this.applyChanges(o,i,r)}delete(e){const t=this.field(e.popLast());ad(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return er(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let i=0;i<e.length;++i){let r=t.mapValue.fields[e.get(i)];ad(r)&&r.mapValue.fields||(r={mapValue:{fields:{}}},t.mapValue.fields[e.get(i)]=r),t=r}return t.mapValue.fields}applyChanges(e,t,i){Us(t,(r,o)=>e[r]=o);for(const r of i)delete e[r]}clone(){return new An(Vc(this.value))}}function kT(n){const e=[];return Us(n.fields,(t,i)=>{const r=new Xt([t]);if(ad(i)){const o=kT(i.mapValue).fields;if(o.length===0)e.push(r);else for(const l of o)e.push(r.child(l))}else e.push(r)}),new Bn(e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ln{constructor(e,t,i,r,o,l,u){this.key=e,this.documentType=t,this.version=i,this.readTime=r,this.createTime=o,this.data=l,this.documentState=u}static newInvalidDocument(e){return new ln(e,0,Ie.min(),Ie.min(),Ie.min(),An.empty(),0)}static newFoundDocument(e,t,i,r){return new ln(e,1,t,Ie.min(),i,r,0)}static newNoDocument(e,t){return new ln(e,2,t,Ie.min(),Ie.min(),An.empty(),0)}static newUnknownDocument(e,t){return new ln(e,3,t,Ie.min(),Ie.min(),An.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(Ie.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=An.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=An.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Ie.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof ln&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new ln(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class jd{constructor(e,t){this.position=e,this.inclusive=t}}function Eb(n,e,t){let i=0;for(let r=0;r<n.position.length;r++){const o=e[r],l=n.position[r];if(o.field.isKeyField()?i=ve.comparator(ve.fromName(l.referenceValue),t.key):i=cl(l,t.data.field(o.field)),o.dir==="desc"&&(i*=-1),i!==0)break}return i}function Tb(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!er(n.position[t],e.position[t]))return!1;return!0}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class su{constructor(e,t="asc"){this.field=e,this.dir=t}}function XL(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class PT{}class St extends PT{constructor(e,t,i){super(),this.field=e,this.op=t,this.value=i}static create(e,t,i){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,i):new ZL(e,t,i):t==="array-contains"?new nV(e,i):t==="in"?new iV(e,i):t==="not-in"?new rV(e,i):t==="array-contains-any"?new sV(e,i):new St(e,t,i)}static createKeyFieldInFilter(e,t,i){return t==="in"?new eV(e,i):new tV(e,i)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&this.matchesComparison(cl(t,this.value)):t!==null&&js(this.value)===js(t)&&this.matchesComparison(cl(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Se()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class ji extends PT{constructor(e,t){super(),this.filters=e,this.op=t,this.ce=null}static create(e,t){return new ji(e,t)}matches(e){return AT(this)?this.filters.find(t=>!t.matches(e))===void 0:this.filters.find(t=>t.matches(e))!==void 0}getFlattenedFilters(){return this.ce!==null||(this.ce=this.filters.reduce((e,t)=>e.concat(t.getFlattenedFilters()),[])),this.ce}getFilters(){return Object.assign([],this.filters)}}function AT(n){return n.op==="and"}function NT(n){return JL(n)&&AT(n)}function JL(n){for(const e of n.filters)if(e instanceof ji)return!1;return!0}function Ag(n){if(n instanceof St)return n.field.canonicalString()+n.op.toString()+ul(n.value);if(NT(n))return n.filters.map(e=>Ag(e)).join(",");{const e=n.filters.map(t=>Ag(t)).join(",");return`${n.op}(${e})`}}function RT(n,e){return n instanceof St?function(i,r){return r instanceof St&&i.op===r.op&&i.field.isEqual(r.field)&&er(i.value,r.value)}(n,e):n instanceof ji?function(i,r){return r instanceof ji&&i.op===r.op&&i.filters.length===r.filters.length?i.filters.reduce((o,l,u)=>o&&RT(l,r.filters[u]),!0):!1}(n,e):void Se()}function jT(n){return n instanceof St?function(t){return`${t.field.canonicalString()} ${t.op} ${ul(t.value)}`}(n):n instanceof ji?function(t){return t.op.toString()+" {"+t.getFilters().map(jT).join(" ,")+"}"}(n):"Filter"}class ZL extends St{constructor(e,t,i){super(e,t,i),this.key=ve.fromName(i.referenceValue)}matches(e){const t=ve.comparator(e.key,this.key);return this.matchesComparison(t)}}class eV extends St{constructor(e,t){super(e,"in",t),this.keys=DT("in",t)}matches(e){return this.keys.some(t=>t.isEqual(e.key))}}class tV extends St{constructor(e,t){super(e,"not-in",t),this.keys=DT("not-in",t)}matches(e){return!this.keys.some(t=>t.isEqual(e.key))}}function DT(n,e){var t;return(((t=e.arrayValue)===null||t===void 0?void 0:t.values)||[]).map(i=>ve.fromName(i.referenceValue))}class nV extends St{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Yy(t)&&ru(t.arrayValue,this.value)}}class iV extends St{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&ru(this.value.arrayValue,t)}}class rV extends St{constructor(e,t){super(e,"not-in",t)}matches(e){if(ru(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&!ru(this.value.arrayValue,t)}}class sV extends St{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Yy(t)||!t.arrayValue.values)&&t.arrayValue.values.some(i=>ru(this.value.arrayValue,i))}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class oV{constructor(e,t=null,i=[],r=[],o=null,l=null,u=null){this.path=e,this.collectionGroup=t,this.orderBy=i,this.filters=r,this.limit=o,this.startAt=l,this.endAt=u,this.le=null}}function Sb(n,e=null,t=[],i=[],r=null,o=null,l=null){return new oV(n,e,t,i,r,o,l)}function Xy(n){const e=Pe(n);if(e.le===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map(i=>Ag(i)).join(","),t+="|ob:",t+=e.orderBy.map(i=>function(o){return o.field.canonicalString()+o.dir}(i)).join(","),lf(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map(i=>ul(i)).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map(i=>ul(i)).join(",")),e.le=t}return e.le}function Jy(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!XL(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!RT(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!Tb(n.startAt,e.startAt)&&Tb(n.endAt,e.endAt)}function Ng(n){return ve.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bl{constructor(e,t=null,i=[],r=[],o=null,l="F",u=null,h=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=i,this.filters=r,this.limit=o,this.limitType=l,this.startAt=u,this.endAt=h,this.he=null,this.Pe=null,this.Te=null,this.startAt,this.endAt}}function aV(n,e,t,i,r,o,l,u){return new bl(n,e,t,i,r,o,l,u)}function uf(n){return new bl(n)}function Cb(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function MT(n){return n.collectionGroup!==null}function Fc(n){const e=Pe(n);if(e.he===null){e.he=[];const t=new Set;for(const o of e.explicitOrderBy)e.he.push(o),t.add(o.field.canonicalString());const i=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(l){let u=new Dt(Xt.comparator);return l.filters.forEach(h=>{h.getFlattenedFilters().forEach(p=>{p.isInequality()&&(u=u.add(p.field))})}),u})(e).forEach(o=>{t.has(o.canonicalString())||o.isKeyField()||e.he.push(new su(o,i))}),t.has(Xt.keyField().canonicalString())||e.he.push(new su(Xt.keyField(),i))}return e.he}function Yi(n){const e=Pe(n);return e.Pe||(e.Pe=lV(e,Fc(n))),e.Pe}function lV(n,e){if(n.limitType==="F")return Sb(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map(r=>{const o=r.dir==="desc"?"asc":"desc";return new su(r.field,o)});const t=n.endAt?new jd(n.endAt.position,n.endAt.inclusive):null,i=n.startAt?new jd(n.startAt.position,n.startAt.inclusive):null;return Sb(n.path,n.collectionGroup,e,n.filters,n.limit,t,i)}}function Rg(n,e){const t=n.filters.concat([e]);return new bl(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function jg(n,e,t){return new bl(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function hf(n,e){return Jy(Yi(n),Yi(e))&&n.limitType===e.limitType}function OT(n){return`${Xy(Yi(n))}|lt:${n.limitType}`}function za(n){return`Query(target=${function(t){let i=t.path.canonicalString();return t.collectionGroup!==null&&(i+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(i+=`, filters: [${t.filters.map(r=>jT(r)).join(", ")}]`),lf(t.limit)||(i+=", limit: "+t.limit),t.orderBy.length>0&&(i+=`, orderBy: [${t.orderBy.map(r=>function(l){return`${l.field.canonicalString()} (${l.dir})`}(r)).join(", ")}]`),t.startAt&&(i+=", startAt: ",i+=t.startAt.inclusive?"b:":"a:",i+=t.startAt.position.map(r=>ul(r)).join(",")),t.endAt&&(i+=", endAt: ",i+=t.endAt.inclusive?"a:":"b:",i+=t.endAt.position.map(r=>ul(r)).join(",")),`Target(${i})`}(Yi(n))}; limitType=${n.limitType})`}function df(n,e){return e.isFoundDocument()&&function(i,r){const o=r.key.path;return i.collectionGroup!==null?r.key.hasCollectionId(i.collectionGroup)&&i.path.isPrefixOf(o):ve.isDocumentKey(i.path)?i.path.isEqual(o):i.path.isImmediateParentOf(o)}(n,e)&&function(i,r){for(const o of Fc(i))if(!o.field.isKeyField()&&r.data.field(o.field)===null)return!1;return!0}(n,e)&&function(i,r){for(const o of i.filters)if(!o.matches(r))return!1;return!0}(n,e)&&function(i,r){return!(i.startAt&&!function(l,u,h){const p=Eb(l,u,h);return l.inclusive?p<=0:p<0}(i.startAt,Fc(i),r)||i.endAt&&!function(l,u,h){const p=Eb(l,u,h);return l.inclusive?p>=0:p>0}(i.endAt,Fc(i),r))}(n,e)}function cV(n){return n.collectionGroup||(n.path.length%2==1?n.path.lastSegment():n.path.get(n.path.length-2))}function LT(n){return(e,t)=>{let i=!1;for(const r of Fc(n)){const o=uV(r,e,t);if(o!==0)return o;i=i||r.field.isKeyField()}return 0}}function uV(n,e,t){const i=n.field.isKeyField()?ve.comparator(e.key,t.key):function(o,l,u){const h=l.data.field(o),p=u.data.field(o);return h!==null&&p!==null?cl(h,p):Se()}(n.field,e,t);switch(n.dir){case"asc":return i;case"desc":return-1*i;default:return Se()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bo{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),i=this.inner[t];if(i!==void 0){for(const[r,o]of i)if(this.equalsFn(r,e))return o}}has(e){return this.get(e)!==void 0}set(e,t){const i=this.mapKeyFn(e),r=this.inner[i];if(r===void 0)return this.inner[i]=[[e,t]],void this.innerSize++;for(let o=0;o<r.length;o++)if(this.equalsFn(r[o][0],e))return void(r[o]=[e,t]);r.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),i=this.inner[t];if(i===void 0)return!1;for(let r=0;r<i.length;r++)if(this.equalsFn(i[r][0],e))return i.length===1?delete this.inner[t]:i.splice(r,1),this.innerSize--,!0;return!1}forEach(e){Us(this.inner,(t,i)=>{for(const[r,o]of i)e(r,o)})}isEmpty(){return wT(this.inner)}size(){return this.innerSize}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const hV=new dt(ve.comparator);function Dr(){return hV}const VT=new dt(ve.comparator);function Ic(...n){let e=VT;for(const t of n)e=e.insert(t.key,t);return e}function FT(n){let e=VT;return n.forEach((t,i)=>e=e.insert(t,i.overlayedDocument)),e}function Co(){return Uc()}function UT(){return Uc()}function Uc(){return new Bo(n=>n.toString(),(n,e)=>n.isEqual(e))}const dV=new dt(ve.comparator),fV=new Dt(ve.comparator);function Le(...n){let e=fV;for(const t of n)e=e.add(t);return e}const pV=new Dt(Re);function mV(){return pV}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Zy(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Ad(e)?"-0":e}}function zT(n){return{integerValue:""+n}}function gV(n,e){return qL(e)?zT(e):Zy(n,e)}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ff{constructor(){this._=void 0}}function yV(n,e,t){return n instanceof ou?function(r,o){const l={fields:{[ET]:{stringValue:bT},[ST]:{timestampValue:{seconds:r.seconds,nanos:r.nanoseconds}}}};return o&&Qy(o)&&(o=cf(o)),o&&(l.fields[TT]=o),{mapValue:l}}(t,e):n instanceof au?qT(n,e):n instanceof lu?$T(n,e):function(r,o){const l=BT(r,o),u=Ib(l)+Ib(r.Ie);return Pg(l)&&Pg(r.Ie)?zT(u):Zy(r.serializer,u)}(n,e)}function vV(n,e,t){return n instanceof au?qT(n,e):n instanceof lu?$T(n,e):t}function BT(n,e){return n instanceof Dd?function(i){return Pg(i)||function(o){return!!o&&"doubleValue"in o}(i)}(e)?e:{integerValue:0}:null}class ou extends ff{}class au extends ff{constructor(e){super(),this.elements=e}}function qT(n,e){const t=HT(e);for(const i of n.elements)t.some(r=>er(r,i))||t.push(i);return{arrayValue:{values:t}}}class lu extends ff{constructor(e){super(),this.elements=e}}function $T(n,e){let t=HT(e);for(const i of n.elements)t=t.filter(r=>!er(r,i));return{arrayValue:{values:t}}}class Dd extends ff{constructor(e,t){super(),this.serializer=e,this.Ie=t}}function Ib(n){return xt(n.integerValue||n.doubleValue)}function HT(n){return Yy(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class xV{constructor(e,t){this.field=e,this.transform=t}}function wV(n,e){return n.field.isEqual(e.field)&&function(i,r){return i instanceof au&&r instanceof au||i instanceof lu&&r instanceof lu?ll(i.elements,r.elements,er):i instanceof Dd&&r instanceof Dd?er(i.Ie,r.Ie):i instanceof ou&&r instanceof ou}(n.transform,e.transform)}class _V{constructor(e,t){this.version=e,this.transformResults=t}}class li{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new li}static exists(e){return new li(void 0,e)}static updateTime(e){return new li(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function ld(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class pf{}function WT(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new ev(n.key,li.none()):new vu(n.key,n.data,li.none());{const t=n.data,i=An.empty();let r=new Dt(Xt.comparator);for(let o of e.fields)if(!r.has(o)){let l=t.field(o);l===null&&o.length>1&&(o=o.popLast(),l=t.field(o)),l===null?i.delete(o):i.set(o,l),r=r.add(o)}return new zs(n.key,i,new Bn(r.toArray()),li.none())}}function bV(n,e,t){n instanceof vu?function(r,o,l){const u=r.value.clone(),h=Pb(r.fieldTransforms,o,l.transformResults);u.setAll(h),o.convertToFoundDocument(l.version,u).setHasCommittedMutations()}(n,e,t):n instanceof zs?function(r,o,l){if(!ld(r.precondition,o))return void o.convertToUnknownDocument(l.version);const u=Pb(r.fieldTransforms,o,l.transformResults),h=o.data;h.setAll(GT(r)),h.setAll(u),o.convertToFoundDocument(l.version,h).setHasCommittedMutations()}(n,e,t):function(r,o,l){o.convertToNoDocument(l.version).setHasCommittedMutations()}(0,e,t)}function zc(n,e,t,i){return n instanceof vu?function(o,l,u,h){if(!ld(o.precondition,l))return u;const p=o.value.clone(),g=Ab(o.fieldTransforms,h,l);return p.setAll(g),l.convertToFoundDocument(l.version,p).setHasLocalMutations(),null}(n,e,t,i):n instanceof zs?function(o,l,u,h){if(!ld(o.precondition,l))return u;const p=Ab(o.fieldTransforms,h,l),g=l.data;return g.setAll(GT(o)),g.setAll(p),l.convertToFoundDocument(l.version,g).setHasLocalMutations(),u===null?null:u.unionWith(o.fieldMask.fields).unionWith(o.fieldTransforms.map(y=>y.field))}(n,e,t,i):function(o,l,u){return ld(o.precondition,l)?(l.convertToNoDocument(l.version).setHasLocalMutations(),null):u}(n,e,t)}function EV(n,e){let t=null;for(const i of n.fieldTransforms){const r=e.data.field(i.field),o=BT(i.transform,r||null);o!=null&&(t===null&&(t=An.empty()),t.set(i.field,o))}return t||null}function kb(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!function(i,r){return i===void 0&&r===void 0||!(!i||!r)&&ll(i,r,(o,l)=>wV(o,l))}(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class vu extends pf{constructor(e,t,i,r=[]){super(),this.key=e,this.value=t,this.precondition=i,this.fieldTransforms=r,this.type=0}getFieldMask(){return null}}class zs extends pf{constructor(e,t,i,r,o=[]){super(),this.key=e,this.data=t,this.fieldMask=i,this.precondition=r,this.fieldTransforms=o,this.type=1}getFieldMask(){return this.fieldMask}}function GT(n){const e=new Map;return n.fieldMask.fields.forEach(t=>{if(!t.isEmpty()){const i=n.data.field(t);e.set(t,i)}}),e}function Pb(n,e,t){const i=new Map;Ke(n.length===t.length);for(let r=0;r<t.length;r++){const o=n[r],l=o.transform,u=e.data.field(o.field);i.set(o.field,vV(l,u,t[r]))}return i}function Ab(n,e,t){const i=new Map;for(const r of n){const o=r.transform,l=t.data.field(r.field);i.set(r.field,yV(o,l,e))}return i}class ev extends pf{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class TV extends pf{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class SV{constructor(e,t,i,r){this.batchId=e,this.localWriteTime=t,this.baseMutations=i,this.mutations=r}applyToRemoteDocument(e,t){const i=t.mutationResults;for(let r=0;r<this.mutations.length;r++){const o=this.mutations[r];o.key.isEqual(e.key)&&bV(o,e,i[r])}}applyToLocalView(e,t){for(const i of this.baseMutations)i.key.isEqual(e.key)&&(t=zc(i,e,t,this.localWriteTime));for(const i of this.mutations)i.key.isEqual(e.key)&&(t=zc(i,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const i=UT();return this.mutations.forEach(r=>{const o=e.get(r.key),l=o.overlayedDocument;let u=this.applyToLocalView(l,o.mutatedFields);u=t.has(r.key)?null:u;const h=WT(l,u);h!==null&&i.set(r.key,h),l.isValidDocument()||l.convertToNoDocument(Ie.min())}),i}keys(){return this.mutations.reduce((e,t)=>e.add(t.key),Le())}isEqual(e){return this.batchId===e.batchId&&ll(this.mutations,e.mutations,(t,i)=>kb(t,i))&&ll(this.baseMutations,e.baseMutations,(t,i)=>kb(t,i))}}class tv{constructor(e,t,i,r){this.batch=e,this.commitVersion=t,this.mutationResults=i,this.docVersions=r}static from(e,t,i){Ke(e.mutations.length===i.length);let r=function(){return dV}();const o=e.mutations;for(let l=0;l<o.length;l++)r=r.insert(o[l].key,i[l].version);return new tv(e,t,i,r)}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class CV{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{ largestBatchId: ${this.largestBatchId}, mutation: ${this.mutation.toString()} }`}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class IV{constructor(e,t){this.count=e,this.unchangedNames=t}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Tt,ze;function kV(n){switch(n){case J.OK:return Se();case J.CANCELLED:case J.UNKNOWN:case J.DEADLINE_EXCEEDED:case J.RESOURCE_EXHAUSTED:case J.INTERNAL:case J.UNAVAILABLE:case J.UNAUTHENTICATED:return!1;case J.INVALID_ARGUMENT:case J.NOT_FOUND:case J.ALREADY_EXISTS:case J.PERMISSION_DENIED:case J.FAILED_PRECONDITION:case J.ABORTED:case J.OUT_OF_RANGE:case J.UNIMPLEMENTED:case J.DATA_LOSS:return!0;default:return Se()}}function KT(n){if(n===void 0)return jr("GRPC error has no .code"),J.UNKNOWN;switch(n){case Tt.OK:return J.OK;case Tt.CANCELLED:return J.CANCELLED;case Tt.UNKNOWN:return J.UNKNOWN;case Tt.DEADLINE_EXCEEDED:return J.DEADLINE_EXCEEDED;case Tt.RESOURCE_EXHAUSTED:return J.RESOURCE_EXHAUSTED;case Tt.INTERNAL:return J.INTERNAL;case Tt.UNAVAILABLE:return J.UNAVAILABLE;case Tt.UNAUTHENTICATED:return J.UNAUTHENTICATED;case Tt.INVALID_ARGUMENT:return J.INVALID_ARGUMENT;case Tt.NOT_FOUND:return J.NOT_FOUND;case Tt.ALREADY_EXISTS:return J.ALREADY_EXISTS;case Tt.PERMISSION_DENIED:return J.PERMISSION_DENIED;case Tt.FAILED_PRECONDITION:return J.FAILED_PRECONDITION;case Tt.ABORTED:return J.ABORTED;case Tt.OUT_OF_RANGE:return J.OUT_OF_RANGE;case Tt.UNIMPLEMENTED:return J.UNIMPLEMENTED;case Tt.DATA_LOSS:return J.DATA_LOSS;default:return Se()}}(ze=Tt||(Tt={}))[ze.OK=0]="OK",ze[ze.CANCELLED=1]="CANCELLED",ze[ze.UNKNOWN=2]="UNKNOWN",ze[ze.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",ze[ze.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",ze[ze.NOT_FOUND=5]="NOT_FOUND",ze[ze.ALREADY_EXISTS=6]="ALREADY_EXISTS",ze[ze.PERMISSION_DENIED=7]="PERMISSION_DENIED",ze[ze.UNAUTHENTICATED=16]="UNAUTHENTICATED",ze[ze.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",ze[ze.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",ze[ze.ABORTED=10]="ABORTED",ze[ze.OUT_OF_RANGE=11]="OUT_OF_RANGE",ze[ze.UNIMPLEMENTED=12]="UNIMPLEMENTED",ze[ze.INTERNAL=13]="INTERNAL",ze[ze.UNAVAILABLE=14]="UNAVAILABLE",ze[ze.DATA_LOSS=15]="DATA_LOSS";/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const PV=new Ts([4294967295,4294967295],0);function Nb(n){const e=yT().encode(n),t=new uT;return t.update(e),new Uint8Array(t.digest())}function Rb(n){const e=new DataView(n.buffer),t=e.getUint32(0,!0),i=e.getUint32(4,!0),r=e.getUint32(8,!0),o=e.getUint32(12,!0);return[new Ts([t,i],0),new Ts([r,o],0)]}class nv{constructor(e,t,i){if(this.bitmap=e,this.padding=t,this.hashCount=i,t<0||t>=8)throw new kc(`Invalid padding: ${t}`);if(i<0)throw new kc(`Invalid hash count: ${i}`);if(e.length>0&&this.hashCount===0)throw new kc(`Invalid hash count: ${i}`);if(e.length===0&&t!==0)throw new kc(`Invalid padding when bitmap length is 0: ${t}`);this.Ee=8*e.length-t,this.de=Ts.fromNumber(this.Ee)}Ae(e,t,i){let r=e.add(t.multiply(Ts.fromNumber(i)));return r.compare(PV)===1&&(r=new Ts([r.getBits(0),r.getBits(1)],0)),r.modulo(this.de).toNumber()}Re(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.Ee===0)return!1;const t=Nb(e),[i,r]=Rb(t);for(let o=0;o<this.hashCount;o++){const l=this.Ae(i,r,o);if(!this.Re(l))return!1}return!0}static create(e,t,i){const r=e%8==0?0:8-e%8,o=new Uint8Array(Math.ceil(e/8)),l=new nv(o,r,t);return i.forEach(u=>l.insert(u)),l}insert(e){if(this.Ee===0)return;const t=Nb(e),[i,r]=Rb(t);for(let o=0;o<this.hashCount;o++){const l=this.Ae(i,r,o);this.Ve(l)}}Ve(e){const t=Math.floor(e/8),i=e%8;this.bitmap[t]|=1<<i}}class kc extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class mf{constructor(e,t,i,r,o){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=i,this.documentUpdates=r,this.resolvedLimboDocuments=o}static createSynthesizedRemoteEventForCurrentChange(e,t,i){const r=new Map;return r.set(e,xu.createSynthesizedTargetChangeForCurrentChange(e,t,i)),new mf(Ie.min(),r,new dt(Re),Dr(),Le())}}class xu{constructor(e,t,i,r,o){this.resumeToken=e,this.current=t,this.addedDocuments=i,this.modifiedDocuments=r,this.removedDocuments=o}static createSynthesizedTargetChangeForCurrentChange(e,t,i){return new xu(i,t,Le(),Le(),Le())}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class cd{constructor(e,t,i,r){this.me=e,this.removedTargetIds=t,this.key=i,this.fe=r}}class QT{constructor(e,t){this.targetId=e,this.ge=t}}class YT{constructor(e,t,i=Zt.EMPTY_BYTE_STRING,r=null){this.state=e,this.targetIds=t,this.resumeToken=i,this.cause=r}}class jb{constructor(){this.pe=0,this.ye=Db(),this.we=Zt.EMPTY_BYTE_STRING,this.Se=!1,this.be=!0}get current(){return this.Se}get resumeToken(){return this.we}get De(){return this.pe!==0}get ve(){return this.be}Ce(e){e.approximateByteSize()>0&&(this.be=!0,this.we=e)}Fe(){let e=Le(),t=Le(),i=Le();return this.ye.forEach((r,o)=>{switch(o){case 0:e=e.add(r);break;case 2:t=t.add(r);break;case 1:i=i.add(r);break;default:Se()}}),new xu(this.we,this.Se,e,t,i)}Me(){this.be=!1,this.ye=Db()}xe(e,t){this.be=!0,this.ye=this.ye.insert(e,t)}Oe(e){this.be=!0,this.ye=this.ye.remove(e)}Ne(){this.pe+=1}Be(){this.pe-=1,Ke(this.pe>=0)}Le(){this.be=!0,this.Se=!0}}class AV{constructor(e){this.ke=e,this.qe=new Map,this.Qe=Dr(),this.$e=Yh(),this.Ue=Yh(),this.Ke=new dt(Re)}We(e){for(const t of e.me)e.fe&&e.fe.isFoundDocument()?this.Ge(t,e.fe):this.ze(t,e.key,e.fe);for(const t of e.removedTargetIds)this.ze(t,e.key,e.fe)}je(e){this.forEachTarget(e,t=>{const i=this.He(t);switch(e.state){case 0:this.Je(t)&&i.Ce(e.resumeToken);break;case 1:i.Be(),i.De||i.Me(),i.Ce(e.resumeToken);break;case 2:i.Be(),i.De||this.removeTarget(t);break;case 3:this.Je(t)&&(i.Le(),i.Ce(e.resumeToken));break;case 4:this.Je(t)&&(this.Ye(t),i.Ce(e.resumeToken));break;default:Se()}})}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.qe.forEach((i,r)=>{this.Je(r)&&t(r)})}Ze(e){const t=e.targetId,i=e.ge.count,r=this.Xe(t);if(r){const o=r.target;if(Ng(o))if(i===0){const l=new ve(o.path);this.ze(t,l,ln.newNoDocument(l,Ie.min()))}else Ke(i===1);else{const l=this.et(t);if(l!==i){const u=this.tt(e),h=u?this.nt(u,e,l):1;if(h!==0){this.Ye(t);const p=h===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ke=this.Ke.insert(t,p)}}}}}tt(e){const t=e.ge.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:i="",padding:r=0},hashCount:o=0}=t;let l,u;try{l=Rs(i).toUint8Array()}catch(h){if(h instanceof _T)return al("Decoding the base64 bloom filter in existence filter failed ("+h.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw h}try{u=new nv(l,r,o)}catch(h){return al(h instanceof kc?"BloomFilter error: ":"Applying bloom filter failed: ",h),null}return u.Ee===0?null:u}nt(e,t,i){return t.ge.count===i-this.st(e,t.targetId)?0:2}st(e,t){const i=this.ke.getRemoteKeysForTarget(t);let r=0;return i.forEach(o=>{const l=this.ke.it(),u=`projects/${l.projectId}/databases/${l.database}/documents/${o.path.canonicalString()}`;e.mightContain(u)||(this.ze(t,o,null),r++)}),r}ot(e){const t=new Map;this.qe.forEach((o,l)=>{const u=this.Xe(l);if(u){if(o.current&&Ng(u.target)){const h=new ve(u.target.path);this._t(h).has(l)||this.ut(l,h)||this.ze(l,h,ln.newNoDocument(h,e))}o.ve&&(t.set(l,o.Fe()),o.Me())}});let i=Le();this.Ue.forEach((o,l)=>{let u=!0;l.forEachWhile(h=>{const p=this.Xe(h);return!p||p.purpose==="TargetPurposeLimboResolution"||(u=!1,!1)}),u&&(i=i.add(o))}),this.Qe.forEach((o,l)=>l.setReadTime(e));const r=new mf(e,t,this.Ke,this.Qe,i);return this.Qe=Dr(),this.$e=Yh(),this.Ue=Yh(),this.Ke=new dt(Re),r}Ge(e,t){if(!this.Je(e))return;const i=this.ut(e,t.key)?2:0;this.He(e).xe(t.key,i),this.Qe=this.Qe.insert(t.key,t),this.$e=this.$e.insert(t.key,this._t(t.key).add(e)),this.Ue=this.Ue.insert(t.key,this.ct(t.key).add(e))}ze(e,t,i){if(!this.Je(e))return;const r=this.He(e);this.ut(e,t)?r.xe(t,1):r.Oe(t),this.Ue=this.Ue.insert(t,this.ct(t).delete(e)),this.Ue=this.Ue.insert(t,this.ct(t).add(e)),i&&(this.Qe=this.Qe.insert(t,i))}removeTarget(e){this.qe.delete(e)}et(e){const t=this.He(e).Fe();return this.ke.getRemoteKeysForTarget(e).size+t.addedDocuments.size-t.removedDocuments.size}Ne(e){this.He(e).Ne()}He(e){let t=this.qe.get(e);return t||(t=new jb,this.qe.set(e,t)),t}ct(e){let t=this.Ue.get(e);return t||(t=new Dt(Re),this.Ue=this.Ue.insert(e,t)),t}_t(e){let t=this.$e.get(e);return t||(t=new Dt(Re),this.$e=this.$e.insert(e,t)),t}Je(e){const t=this.Xe(e)!==null;return t||ue("WatchChangeAggregator","Detected inactive target",e),t}Xe(e){const t=this.qe.get(e);return t&&t.De?null:this.ke.lt(e)}Ye(e){this.qe.set(e,new jb),this.ke.getRemoteKeysForTarget(e).forEach(t=>{this.ze(e,t,null)})}ut(e,t){return this.ke.getRemoteKeysForTarget(e).has(t)}}function Yh(){return new dt(ve.comparator)}function Db(){return new dt(ve.comparator)}const NV={asc:"ASCENDING",desc:"DESCENDING"},RV={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},jV={and:"AND",or:"OR"};class DV{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function Dg(n,e){return n.useProto3Json||lf(e)?e:{value:e}}function Md(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function XT(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function MV(n,e){return Md(n,e.toTimestamp())}function Xi(n){return Ke(!!n),Ie.fromTimestamp(function(t){const i=Ns(t);return new jt(i.seconds,i.nanos)}(n))}function iv(n,e){return Mg(n,e).canonicalString()}function Mg(n,e){const t=function(r){return new it(["projects",r.projectId,"databases",r.database])}(n).child("documents");return e===void 0?t:t.child(e)}function JT(n){const e=it.fromString(n);return Ke(iS(e)),e}function Og(n,e){return iv(n.databaseId,e.path)}function Hm(n,e){const t=JT(e);if(t.get(1)!==n.databaseId.projectId)throw new he(J.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new he(J.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new ve(eS(t))}function ZT(n,e){return iv(n.databaseId,e)}function OV(n){const e=JT(n);return e.length===4?it.emptyPath():eS(e)}function Lg(n){return new it(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function eS(n){return Ke(n.length>4&&n.get(4)==="documents"),n.popFirst(5)}function Mb(n,e,t){return{name:Og(n,e),fields:t.value.mapValue.fields}}function LV(n,e){let t;if("targetChange"in e){e.targetChange;const i=function(p){return p==="NO_CHANGE"?0:p==="ADD"?1:p==="REMOVE"?2:p==="CURRENT"?3:p==="RESET"?4:Se()}(e.targetChange.targetChangeType||"NO_CHANGE"),r=e.targetChange.targetIds||[],o=function(p,g){return p.useProto3Json?(Ke(g===void 0||typeof g=="string"),Zt.fromBase64String(g||"")):(Ke(g===void 0||g instanceof Buffer||g instanceof Uint8Array),Zt.fromUint8Array(g||new Uint8Array))}(n,e.targetChange.resumeToken),l=e.targetChange.cause,u=l&&function(p){const g=p.code===void 0?J.UNKNOWN:KT(p.code);return new he(g,p.message||"")}(l);t=new YT(i,r,o,u||null)}else if("documentChange"in e){e.documentChange;const i=e.documentChange;i.document,i.document.name,i.document.updateTime;const r=Hm(n,i.document.name),o=Xi(i.document.updateTime),l=i.document.createTime?Xi(i.document.createTime):Ie.min(),u=new An({mapValue:{fields:i.document.fields}}),h=ln.newFoundDocument(r,o,l,u),p=i.targetIds||[],g=i.removedTargetIds||[];t=new cd(p,g,h.key,h)}else if("documentDelete"in e){e.documentDelete;const i=e.documentDelete;i.document;const r=Hm(n,i.document),o=i.readTime?Xi(i.readTime):Ie.min(),l=ln.newNoDocument(r,o),u=i.removedTargetIds||[];t=new cd([],u,l.key,l)}else if("documentRemove"in e){e.documentRemove;const i=e.documentRemove;i.document;const r=Hm(n,i.document),o=i.removedTargetIds||[];t=new cd([],o,r,null)}else{if(!("filter"in e))return Se();{e.filter;const i=e.filter;i.targetId;const{count:r=0,unchangedNames:o}=i,l=new IV(r,o),u=i.targetId;t=new QT(u,l)}}return t}function VV(n,e){let t;if(e instanceof vu)t={update:Mb(n,e.key,e.value)};else if(e instanceof ev)t={delete:Og(n,e.key)};else if(e instanceof zs)t={update:Mb(n,e.key,e.data),updateMask:GV(e.fieldMask)};else{if(!(e instanceof TV))return Se();t={verify:Og(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map(i=>function(o,l){const u=l.transform;if(u instanceof ou)return{fieldPath:l.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(u instanceof au)return{fieldPath:l.field.canonicalString(),appendMissingElements:{values:u.elements}};if(u instanceof lu)return{fieldPath:l.field.canonicalString(),removeAllFromArray:{values:u.elements}};if(u instanceof Dd)return{fieldPath:l.field.canonicalString(),increment:u.Ie};throw Se()}(0,i))),e.precondition.isNone||(t.currentDocument=function(r,o){return o.updateTime!==void 0?{updateTime:MV(r,o.updateTime)}:o.exists!==void 0?{exists:o.exists}:Se()}(n,e.precondition)),t}function FV(n,e){return n&&n.length>0?(Ke(e!==void 0),n.map(t=>function(r,o){let l=r.updateTime?Xi(r.updateTime):Xi(o);return l.isEqual(Ie.min())&&(l=Xi(o)),new _V(l,r.transformResults||[])}(t,e))):[]}function UV(n,e){return{documents:[ZT(n,e.path)]}}function zV(n,e){const t={structuredQuery:{}},i=e.path;let r;e.collectionGroup!==null?(r=i,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(r=i.popLast(),t.structuredQuery.from=[{collectionId:i.lastSegment()}]),t.parent=ZT(n,r);const o=function(p){if(p.length!==0)return nS(ji.create(p,"and"))}(e.filters);o&&(t.structuredQuery.where=o);const l=function(p){if(p.length!==0)return p.map(g=>function(x){return{field:Ba(x.field),direction:$V(x.dir)}}(g))}(e.orderBy);l&&(t.structuredQuery.orderBy=l);const u=Dg(n,e.limit);return u!==null&&(t.structuredQuery.limit=u),e.startAt&&(t.structuredQuery.startAt=function(p){return{before:p.inclusive,values:p.position}}(e.startAt)),e.endAt&&(t.structuredQuery.endAt=function(p){return{before:!p.inclusive,values:p.position}}(e.endAt)),{ht:t,parent:r}}function BV(n){let e=OV(n.parent);const t=n.structuredQuery,i=t.from?t.from.length:0;let r=null;if(i>0){Ke(i===1);const g=t.from[0];g.allDescendants?r=g.collectionId:e=e.child(g.collectionId)}let o=[];t.where&&(o=function(y){const x=tS(y);return x instanceof ji&&NT(x)?x.getFilters():[x]}(t.where));let l=[];t.orderBy&&(l=function(y){return y.map(x=>function(T){return new su(qa(T.field),function(I){switch(I){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(T.direction))}(x))}(t.orderBy));let u=null;t.limit&&(u=function(y){let x;return x=typeof y=="object"?y.value:y,lf(x)?null:x}(t.limit));let h=null;t.startAt&&(h=function(y){const x=!!y.before,b=y.values||[];return new jd(b,x)}(t.startAt));let p=null;return t.endAt&&(p=function(y){const x=!y.before,b=y.values||[];return new jd(b,x)}(t.endAt)),aV(e,r,l,o,u,"F",h,p)}function qV(n,e){const t=function(r){switch(r){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return Se()}}(e.purpose);return t==null?null:{"goog-listen-tags":t}}function tS(n){return n.unaryFilter!==void 0?function(t){switch(t.unaryFilter.op){case"IS_NAN":const i=qa(t.unaryFilter.field);return St.create(i,"==",{doubleValue:NaN});case"IS_NULL":const r=qa(t.unaryFilter.field);return St.create(r,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const o=qa(t.unaryFilter.field);return St.create(o,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const l=qa(t.unaryFilter.field);return St.create(l,"!=",{nullValue:"NULL_VALUE"});default:return Se()}}(n):n.fieldFilter!==void 0?function(t){return St.create(qa(t.fieldFilter.field),function(r){switch(r){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";default:return Se()}}(t.fieldFilter.op),t.fieldFilter.value)}(n):n.compositeFilter!==void 0?function(t){return ji.create(t.compositeFilter.filters.map(i=>tS(i)),function(r){switch(r){case"AND":return"and";case"OR":return"or";default:return Se()}}(t.compositeFilter.op))}(n):Se()}function $V(n){return NV[n]}function HV(n){return RV[n]}function WV(n){return jV[n]}function Ba(n){return{fieldPath:n.canonicalString()}}function qa(n){return Xt.fromServerFormat(n.fieldPath)}function nS(n){return n instanceof St?function(t){if(t.op==="=="){if(bb(t.value))return{unaryFilter:{field:Ba(t.field),op:"IS_NAN"}};if(_b(t.value))return{unaryFilter:{field:Ba(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(bb(t.value))return{unaryFilter:{field:Ba(t.field),op:"IS_NOT_NAN"}};if(_b(t.value))return{unaryFilter:{field:Ba(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Ba(t.field),op:HV(t.op),value:t.value}}}(n):n instanceof ji?function(t){const i=t.getFilters().map(r=>nS(r));return i.length===1?i[0]:{compositeFilter:{op:WV(t.op),filters:i}}}(n):Se()}function GV(n){const e=[];return n.fields.forEach(t=>e.push(t.canonicalString())),{fieldPaths:e}}function iS(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ys{constructor(e,t,i,r,o=Ie.min(),l=Ie.min(),u=Zt.EMPTY_BYTE_STRING,h=null){this.target=e,this.targetId=t,this.purpose=i,this.sequenceNumber=r,this.snapshotVersion=o,this.lastLimboFreeSnapshotVersion=l,this.resumeToken=u,this.expectedCount=h}withSequenceNumber(e){return new ys(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new ys(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new ys(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class KV{constructor(e){this.Tt=e}}function QV(n){const e=BV({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?jg(e,e.limit,"L"):e}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class YV{constructor(){this.Tn=new XV}addToCollectionParentIndex(e,t){return this.Tn.add(t),Z.resolve()}getCollectionParents(e,t){return Z.resolve(this.Tn.getEntries(t))}addFieldIndex(e,t){return Z.resolve()}deleteFieldIndex(e,t){return Z.resolve()}deleteAllFieldIndexes(e){return Z.resolve()}createTargetIndexes(e,t){return Z.resolve()}getDocumentsMatchingTarget(e,t){return Z.resolve(null)}getIndexType(e,t){return Z.resolve(0)}getFieldIndexes(e,t){return Z.resolve([])}getNextCollectionGroupToUpdate(e){return Z.resolve(null)}getMinOffset(e,t){return Z.resolve(As.min())}getMinOffsetFromCollectionGroup(e,t){return Z.resolve(As.min())}updateCollectionGroup(e,t,i){return Z.resolve()}updateIndexEntries(e,t){return Z.resolve()}}class XV{constructor(){this.index={}}add(e){const t=e.lastSegment(),i=e.popLast(),r=this.index[t]||new Dt(it.comparator),o=!r.has(i);return this.index[t]=r.add(i),o}has(e){const t=e.lastSegment(),i=e.popLast(),r=this.index[t];return r&&r.has(i)}getEntries(e){return(this.index[e]||new Dt(it.comparator)).toArray()}}/** * @license * Copyright 2018 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ob={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},rS=41943040;class Pn{static withCacheSize(e){return new Pn(e,Pn.DEFAULT_COLLECTION_PERCENTILE,Pn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,i){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=i}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Pn.DEFAULT_COLLECTION_PERCENTILE=10,Pn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Pn.DEFAULT=new Pn(rS,Pn.DEFAULT_COLLECTION_PERCENTILE,Pn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Pn.DISABLED=new Pn(-1,0,0);/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hl{constructor(e){this.$n=e}next(){return this.$n+=2,this.$n}static Un(){return new hl(0)}static Kn(){return new hl(-1)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Lb="LruGarbageCollector",JV=1048576;function Vb([n,e],[t,i]){const r=Re(n,t);return r===0?Re(e,i):r}class ZV{constructor(e){this.Hn=e,this.buffer=new Dt(Vb),this.Jn=0}Yn(){return++this.Jn}Zn(e){const t=[e,this.Yn()];if(this.buffer.size<this.Hn)this.buffer=this.buffer.add(t);else{const i=this.buffer.last();Vb(t,i)<0&&(this.buffer=this.buffer.delete(i).add(t))}}get maxValue(){return this.buffer.last()[0]}}class e5{constructor(e,t,i){this.garbageCollector=e,this.asyncQueue=t,this.localStore=i,this.Xn=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.er(6e4)}stop(){this.Xn&&(this.Xn.cancel(),this.Xn=null)}get started(){return this.Xn!==null}er(e){ue(Lb,`Garbage collection scheduled in ${e}ms`),this.Xn=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,async()=>{this.Xn=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){_l(t)?ue(Lb,"Ignoring IndexedDB error during garbage collection: ",t):await wl(t)}await this.er(3e5)})}}class t5{constructor(e,t){this.tr=e,this.params=t}calculateTargetCount(e,t){return this.tr.nr(e).next(i=>Math.floor(t/100*i))}nthSequenceNumber(e,t){if(t===0)return Z.resolve(af.ae);const i=new ZV(t);return this.tr.forEachTarget(e,r=>i.Zn(r.sequenceNumber)).next(()=>this.tr.rr(e,r=>i.Zn(r))).next(()=>i.maxValue)}removeTargets(e,t,i){return this.tr.removeTargets(e,t,i)}removeOrphanedDocuments(e,t){return this.tr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(ue("LruGarbageCollector","Garbage collection skipped; disabled"),Z.resolve(Ob)):this.getCacheSize(e).next(i=>i<this.params.cacheSizeCollectionThreshold?(ue("LruGarbageCollector",`Garbage collection skipped; Cache size ${i} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),Ob):this.ir(e,t))}getCacheSize(e){return this.tr.getCacheSize(e)}ir(e,t){let i,r,o,l,u,h,p;const g=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next(y=>(y>this.params.maximumSequenceNumbersToCollect?(ue("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${y}`),r=this.params.maximumSequenceNumbersToCollect):r=y,l=Date.now(),this.nthSequenceNumber(e,r))).next(y=>(i=y,u=Date.now(),this.removeTargets(e,i,t))).next(y=>(o=y,h=Date.now(),this.removeOrphanedDocuments(e,i))).next(y=>(p=Date.now(),Ua()<=Oe.DEBUG&&ue("LruGarbageCollector",`LRU Garbage Collection Counted targets in ${l-g}ms Determined least recently used ${r} in `+(u-l)+`ms Removed ${o} targets in `+(h-u)+`ms Removed ${y} documents in `+(p-h)+`ms Total Duration: ${p-g}ms`),Z.resolve({didRun:!0,sequenceNumbersCollected:r,targetsRemoved:o,documentsRemoved:y})))}}function n5(n,e){return new t5(n,e)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class i5{constructor(){this.changes=new Bo(e=>e.toString(),(e,t)=>e.isEqual(t)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,ln.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const i=this.changes.get(t);return i!==void 0?Z.resolve(i):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class r5{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class s5{constructor(e,t,i,r){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=i,this.indexManager=r}getDocument(e,t){let i=null;return this.documentOverlayCache.getOverlay(e,t).next(r=>(i=r,this.remoteDocumentCache.getEntry(e,t))).next(r=>(i!==null&&zc(i.mutation,r,Bn.empty(),jt.now()),r))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.getLocalViewOfDocuments(e,i,Le()).next(()=>i))}getLocalViewOfDocuments(e,t,i=Le()){const r=Co();return this.populateOverlays(e,r,t).next(()=>this.computeViews(e,t,r,i).next(o=>{let l=Ic();return o.forEach((u,h)=>{l=l.insert(u,h.overlayedDocument)}),l}))}getOverlayedDocuments(e,t){const i=Co();return this.populateOverlays(e,i,t).next(()=>this.computeViews(e,t,i,Le()))}populateOverlays(e,t,i){const r=[];return i.forEach(o=>{t.has(o)||r.push(o)}),this.documentOverlayCache.getOverlays(e,r).next(o=>{o.forEach((l,u)=>{t.set(l,u)})})}computeViews(e,t,i,r){let o=Dr();const l=Uc(),u=function(){return Uc()}();return t.forEach((h,p)=>{const g=i.get(p.key);r.has(p.key)&&(g===void 0||g.mutation instanceof zs)?o=o.insert(p.key,p):g!==void 0?(l.set(p.key,g.mutation.getFieldMask()),zc(g.mutation,p,g.mutation.getFieldMask(),jt.now())):l.set(p.key,Bn.empty())}),this.recalculateAndSaveOverlays(e,o).next(h=>(h.forEach((p,g)=>l.set(p,g)),t.forEach((p,g)=>{var y;return u.set(p,new r5(g,(y=l.get(p))!==null&&y!==void 0?y:null))}),u))}recalculateAndSaveOverlays(e,t){const i=Uc();let r=new dt((l,u)=>l-u),o=Le();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next(l=>{for(const u of l)u.keys().forEach(h=>{const p=t.get(h);if(p===null)return;let g=i.get(h)||Bn.empty();g=u.applyToLocalView(p,g),i.set(h,g);const y=(r.get(u.batchId)||Le()).add(h);r=r.insert(u.batchId,y)})}).next(()=>{const l=[],u=r.getReverseIterator();for(;u.hasNext();){const h=u.getNext(),p=h.key,g=h.value,y=UT();g.forEach(x=>{if(!o.has(x)){const b=WT(t.get(x),i.get(x));b!==null&&y.set(x,b),o=o.add(x)}}),l.push(this.documentOverlayCache.saveOverlays(e,p,y))}return Z.waitFor(l)}).next(()=>i)}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next(i=>this.recalculateAndSaveOverlays(e,i))}getDocumentsMatchingQuery(e,t,i,r){return function(l){return ve.isDocumentKey(l.path)&&l.collectionGroup===null&&l.filters.length===0}(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):MT(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,i,r):this.getDocumentsMatchingCollectionQuery(e,t,i,r)}getNextDocuments(e,t,i,r){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,i,r).next(o=>{const l=r-o.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,i.largestBatchId,r-o.size):Z.resolve(Co());let u=tu,h=o;return l.next(p=>Z.forEach(p,(g,y)=>(u<y.largestBatchId&&(u=y.largestBatchId),o.get(g)?Z.resolve():this.remoteDocumentCache.getEntry(e,g).next(x=>{h=h.insert(g,x)}))).next(()=>this.populateOverlays(e,p,o)).next(()=>this.computeViews(e,h,p,Le())).next(g=>({batchId:u,changes:FT(g)})))})}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new ve(t)).next(i=>{let r=Ic();return i.isFoundDocument()&&(r=r.insert(i.key,i)),r})}getDocumentsMatchingCollectionGroupQuery(e,t,i,r){const o=t.collectionGroup;let l=Ic();return this.indexManager.getCollectionParents(e,o).next(u=>Z.forEach(u,h=>{const p=function(y,x){return new bl(x,null,y.explicitOrderBy.slice(),y.filters.slice(),y.limit,y.limitType,y.startAt,y.endAt)}(t,h.child(o));return this.getDocumentsMatchingCollectionQuery(e,p,i,r).next(g=>{g.forEach((y,x)=>{l=l.insert(y,x)})})}).next(()=>l))}getDocumentsMatchingCollectionQuery(e,t,i,r){let o;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,i.largestBatchId).next(l=>(o=l,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,i,o,r))).next(l=>{o.forEach((h,p)=>{const g=p.getKey();l.get(g)===null&&(l=l.insert(g,ln.newInvalidDocument(g)))});let u=Ic();return l.forEach((h,p)=>{const g=o.get(h);g!==void 0&&zc(g.mutation,p,Bn.empty(),jt.now()),df(t,p)&&(u=u.insert(h,p))}),u})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class o5{constructor(e){this.serializer=e,this.dr=new Map,this.Ar=new Map}getBundleMetadata(e,t){return Z.resolve(this.dr.get(t))}saveBundleMetadata(e,t){return this.dr.set(t.id,function(r){return{id:r.id,version:r.version,createTime:Xi(r.createTime)}}(t)),Z.resolve()}getNamedQuery(e,t){return Z.resolve(this.Ar.get(t))}saveNamedQuery(e,t){return this.Ar.set(t.name,function(r){return{name:r.name,query:QV(r.bundledQuery),readTime:Xi(r.readTime)}}(t)),Z.resolve()}}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class a5{constructor(){this.overlays=new dt(ve.comparator),this.Rr=new Map}getOverlay(e,t){return Z.resolve(this.overlays.get(t))}getOverlays(e,t){const i=Co();return Z.forEach(t,r=>this.getOverlay(e,r).next(o=>{o!==null&&i.set(r,o)})).next(()=>i)}saveOverlays(e,t,i){return i.forEach((r,o)=>{this.Et(e,t,o)}),Z.resolve()}removeOverlaysForBatchId(e,t,i){const r=this.Rr.get(i);return r!==void 0&&(r.forEach(o=>this.overlays=this.overlays.remove(o)),this.Rr.delete(i)),Z.resolve()}getOverlaysForCollection(e,t,i){const r=Co(),o=t.length+1,l=new ve(t.child("")),u=this.overlays.getIteratorFrom(l);for(;u.hasNext();){const h=u.getNext().value,p=h.getKey();if(!t.isPrefixOf(p.path))break;p.path.length===o&&h.largestBatchId>i&&r.set(h.getKey(),h)}return Z.resolve(r)}getOverlaysForCollectionGroup(e,t,i,r){let o=new dt((p,g)=>p-g);const l=this.overlays.getIterator();for(;l.hasNext();){const p=l.getNext().value;if(p.getKey().getCollectionGroup()===t&&p.largestBatchId>i){let g=o.get(p.largestBatchId);g===null&&(g=Co(),o=o.insert(p.largestBatchId,g)),g.set(p.getKey(),p)}}const u=Co(),h=o.getIterator();for(;h.hasNext()&&(h.getNext().value.forEach((p,g)=>u.set(p,g)),!(u.size()>=r)););return Z.resolve(u)}Et(e,t,i){const r=this.overlays.get(i.key);if(r!==null){const l=this.Rr.get(r.largestBatchId).delete(i.key);this.Rr.set(r.largestBatchId,l)}this.overlays=this.overlays.insert(i.key,new CV(t,i));let o=this.Rr.get(t);o===void 0&&(o=Le(),this.Rr.set(t,o)),this.Rr.set(t,o.add(i.key))}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class l5{constructor(){this.sessionToken=Zt.EMPTY_BYTE_STRING}getSessionToken(e){return Z.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,Z.resolve()}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class rv{constructor(){this.Vr=new Dt(zt.mr),this.gr=new Dt(zt.pr)}isEmpty(){return this.Vr.isEmpty()}addReference(e,t){const i=new zt(e,t);this.Vr=this.Vr.add(i),this.gr=this.gr.add(i)}yr(e,t){e.forEach(i=>this.addReference(i,t))}removeReference(e,t){this.wr(new zt(e,t))}Sr(e,t){e.forEach(i=>this.removeReference(i,t))}br(e){const t=new ve(new it([])),i=new zt(t,e),r=new zt(t,e+1),o=[];return this.gr.forEachInRange([i,r],l=>{this.wr(l),o.push(l.key)}),o}Dr(){this.Vr.forEach(e=>this.wr(e))}wr(e){this.Vr=this.Vr.delete(e),this.gr=this.gr.delete(e)}vr(e){const t=new ve(new it([])),i=new zt(t,e),r=new zt(t,e+1);let o=Le();return this.gr.forEachInRange([i,r],l=>{o=o.add(l.key)}),o}containsKey(e){const t=new zt(e,0),i=this.Vr.firstAfterOrEqual(t);return i!==null&&e.isEqual(i.key)}}class zt{constructor(e,t){this.key=e,this.Cr=t}static mr(e,t){return ve.comparator(e.key,t.key)||Re(e.Cr,t.Cr)}static pr(e,t){return Re(e.Cr,t.Cr)||ve.comparator(e.key,t.key)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class c5{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Fr=1,this.Mr=new Dt(zt.mr)}checkEmpty(e){return Z.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,i,r){const o=this.Fr;this.Fr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const l=new SV(o,t,i,r);this.mutationQueue.push(l);for(const u of r)this.Mr=this.Mr.add(new zt(u.key,o)),this.indexManager.addToCollectionParentIndex(e,u.key.path.popLast());return Z.resolve(l)}lookupMutationBatch(e,t){return Z.resolve(this.Or(t))}getNextMutationBatchAfterBatchId(e,t){const i=t+1,r=this.Nr(i),o=r<0?0:r;return Z.resolve(this.mutationQueue.length>o?this.mutationQueue[o]:null)}getHighestUnacknowledgedBatchId(){return Z.resolve(this.mutationQueue.length===0?Ky:this.Fr-1)}getAllMutationBatches(e){return Z.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const i=new zt(t,0),r=new zt(t,Number.POSITIVE_INFINITY),o=[];return this.Mr.forEachInRange([i,r],l=>{const u=this.Or(l.Cr);o.push(u)}),Z.resolve(o)}getAllMutationBatchesAffectingDocumentKeys(e,t){let i=new Dt(Re);return t.forEach(r=>{const o=new zt(r,0),l=new zt(r,Number.POSITIVE_INFINITY);this.Mr.forEachInRange([o,l],u=>{i=i.add(u.Cr)})}),Z.resolve(this.Br(i))}getAllMutationBatchesAffectingQuery(e,t){const i=t.path,r=i.length+1;let o=i;ve.isDocumentKey(o)||(o=o.child(""));const l=new zt(new ve(o),0);let u=new Dt(Re);return this.Mr.forEachWhile(h=>{const p=h.key.path;return!!i.isPrefixOf(p)&&(p.length===r&&(u=u.add(h.Cr)),!0)},l),Z.resolve(this.Br(u))}Br(e){const t=[];return e.forEach(i=>{const r=this.Or(i);r!==null&&t.push(r)}),t}removeMutationBatch(e,t){Ke(this.Lr(t.batchId,"removed")===0),this.mutationQueue.shift();let i=this.Mr;return Z.forEach(t.mutations,r=>{const o=new zt(r.key,t.batchId);return i=i.delete(o),this.referenceDelegate.markPotentiallyOrphaned(e,r.key)}).next(()=>{this.Mr=i})}qn(e){}containsKey(e,t){const i=new zt(t,0),r=this.Mr.firstAfterOrEqual(i);return Z.resolve(t.isEqual(r&&r.key))}performConsistencyCheck(e){return this.mutationQueue.length,Z.resolve()}Lr(e,t){return this.Nr(e)}Nr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Or(e){const t=this.Nr(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class u5{constructor(e){this.kr=e,this.docs=function(){return new dt(ve.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const i=t.key,r=this.docs.get(i),o=r?r.size:0,l=this.kr(t);return this.docs=this.docs.insert(i,{document:t.mutableCopy(),size:l}),this.size+=l-o,this.indexManager.addToCollectionParentIndex(e,i.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const i=this.docs.get(t);return Z.resolve(i?i.document.mutableCopy():ln.newInvalidDocument(t))}getEntries(e,t){let i=Dr();return t.forEach(r=>{const o=this.docs.get(r);i=i.insert(r,o?o.document.mutableCopy():ln.newInvalidDocument(r))}),Z.resolve(i)}getDocumentsMatchingQuery(e,t,i,r){let o=Dr();const l=t.path,u=new ve(l.child("__id-9223372036854775808__")),h=this.docs.getIteratorFrom(u);for(;h.hasNext();){const{key:p,value:{document:g}}=h.getNext();if(!l.isPrefixOf(p.path))break;p.path.length>l.length+1||FL(VL(g),i)<=0||(r.has(g.key)||df(t,g))&&(o=o.insert(g.key,g.mutableCopy()))}return Z.resolve(o)}getAllFromCollectionGroup(e,t,i,r){Se()}qr(e,t){return Z.forEach(this.docs,i=>t(i))}newChangeBuffer(e){return new h5(this)}getSize(e){return Z.resolve(this.size)}}class h5 extends i5{constructor(e){super(),this.Ir=e}applyChanges(e){const t=[];return this.changes.forEach((i,r)=>{r.isValidDocument()?t.push(this.Ir.addEntry(e,r)):this.Ir.removeEntry(i)}),Z.waitFor(t)}getFromCache(e,t){return this.Ir.getEntry(e,t)}getAllFromCache(e,t){return this.Ir.getEntries(e,t)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class d5{constructor(e){this.persistence=e,this.Qr=new Bo(t=>Xy(t),Jy),this.lastRemoteSnapshotVersion=Ie.min(),this.highestTargetId=0,this.$r=0,this.Ur=new rv,this.targetCount=0,this.Kr=hl.Un()}forEachTarget(e,t){return this.Qr.forEach((i,r)=>t(r)),Z.resolve()}getLastRemoteSnapshotVersion(e){return Z.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return Z.resolve(this.$r)}allocateTargetId(e){return this.highestTargetId=this.Kr.next(),Z.resolve(this.highestTargetId)}setTargetsMetadata(e,t,i){return i&&(this.lastRemoteSnapshotVersion=i),t>this.$r&&(this.$r=t),Z.resolve()}zn(e){this.Qr.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.Kr=new hl(t),this.highestTargetId=t),e.sequenceNumber>this.$r&&(this.$r=e.sequenceNumber)}addTargetData(e,t){return this.zn(t),this.targetCount+=1,Z.resolve()}updateTargetData(e,t){return this.zn(t),Z.resolve()}removeTargetData(e,t){return this.Qr.delete(t.target),this.Ur.br(t.targetId),this.targetCount-=1,Z.resolve()}removeTargets(e,t,i){let r=0;const o=[];return this.Qr.forEach((l,u)=>{u.sequenceNumber<=t&&i.get(u.targetId)===null&&(this.Qr.delete(l),o.push(this.removeMatchingKeysForTargetId(e,u.targetId)),r++)}),Z.waitFor(o).next(()=>r)}getTargetCount(e){return Z.resolve(this.targetCount)}getTargetData(e,t){const i=this.Qr.get(t)||null;return Z.resolve(i)}addMatchingKeys(e,t,i){return this.Ur.yr(t,i),Z.resolve()}removeMatchingKeys(e,t,i){this.Ur.Sr(t,i);const r=this.persistence.referenceDelegate,o=[];return r&&t.forEach(l=>{o.push(r.markPotentiallyOrphaned(e,l))}),Z.waitFor(o)}removeMatchingKeysForTargetId(e,t){return this.Ur.br(t),Z.resolve()}getMatchingKeysForTargetId(e,t){const i=this.Ur.vr(t);return Z.resolve(i)}containsKey(e,t){return Z.resolve(this.Ur.containsKey(t))}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sS{constructor(e,t){this.Wr={},this.overlays={},this.Gr=new af(0),this.zr=!1,this.zr=!0,this.jr=new l5,this.referenceDelegate=e(this),this.Hr=new d5(this),this.indexManager=new YV,this.remoteDocumentCache=function(r){return new u5(r)}(i=>this.referenceDelegate.Jr(i)),this.serializer=new KV(t),this.Yr=new o5(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.zr=!1,Promise.resolve()}get started(){return this.zr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new a5,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let i=this.Wr[e.toKey()];return i||(i=new c5(t,this.referenceDelegate),this.Wr[e.toKey()]=i),i}getGlobalsCache(){return this.jr}getTargetCache(){return this.Hr}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Yr}runTransaction(e,t,i){ue("MemoryPersistence","Starting transaction:",e);const r=new f5(this.Gr.next());return this.referenceDelegate.Zr(),i(r).next(o=>this.referenceDelegate.Xr(r).next(()=>o)).toPromise().then(o=>(r.raiseOnCommittedEvent(),o))}ei(e,t){return Z.or(Object.values(this.Wr).map(i=>()=>i.containsKey(e,t)))}}class f5 extends zL{constructor(e){super(),this.currentSequenceNumber=e}}class sv{constructor(e){this.persistence=e,this.ti=new rv,this.ni=null}static ri(e){return new sv(e)}get ii(){if(this.ni)return this.ni;throw Se()}addReference(e,t,i){return this.ti.addReference(i,t),this.ii.delete(i.toString()),Z.resolve()}removeReference(e,t,i){return this.ti.removeReference(i,t),this.ii.add(i.toString()),Z.resolve()}markPotentiallyOrphaned(e,t){return this.ii.add(t.toString()),Z.resolve()}removeTarget(e,t){this.ti.br(t.targetId).forEach(r=>this.ii.add(r.toString()));const i=this.persistence.getTargetCache();return i.getMatchingKeysForTargetId(e,t.targetId).next(r=>{r.forEach(o=>this.ii.add(o.toString()))}).next(()=>i.removeTargetData(e,t))}Zr(){this.ni=new Set}Xr(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return Z.forEach(this.ii,i=>{const r=ve.fromPath(i);return this.si(e,r).next(o=>{o||t.removeEntry(r,Ie.min())})}).next(()=>(this.ni=null,t.apply(e)))}updateLimboDocument(e,t){return this.si(e,t).next(i=>{i?this.ii.delete(t.toString()):this.ii.add(t.toString())})}Jr(e){return 0}si(e,t){return Z.or([()=>Z.resolve(this.ti.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.ei(e,t)])}}class Od{constructor(e,t){this.persistence=e,this.oi=new Bo(i=>$L(i.path),(i,r)=>i.isEqual(r)),this.garbageCollector=n5(this,t)}static ri(e,t){return new Od(e,t)}Zr(){}Xr(e){return Z.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}nr(e){const t=this.sr(e);return this.persistence.getTargetCache().getTargetCount(e).next(i=>t.next(r=>i+r))}sr(e){let t=0;return this.rr(e,i=>{t++}).next(()=>t)}rr(e,t){return Z.forEach(this.oi,(i,r)=>this.ar(e,i,r).next(o=>o?Z.resolve():t(r)))}removeTargets(e,t,i){return this.persistence.getTargetCache().removeTargets(e,t,i)}removeOrphanedDocuments(e,t){let i=0;const r=this.persistence.getRemoteDocumentCache(),o=r.newChangeBuffer();return r.qr(e,l=>this.ar(e,l,t).next(u=>{u||(i++,o.removeEntry(l,Ie.min()))})).next(()=>o.apply(e)).next(()=>i)}markPotentiallyOrphaned(e,t){return this.oi.set(t,e.currentSequenceNumber),Z.resolve()}removeTarget(e,t){const i=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,i)}addReference(e,t,i){return this.oi.set(i,e.currentSequenceNumber),Z.resolve()}removeReference(e,t,i){return this.oi.set(i,e.currentSequenceNumber),Z.resolve()}updateLimboDocument(e,t){return this.oi.set(t,e.currentSequenceNumber),Z.resolve()}Jr(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=od(e.data.value)),t}ar(e,t,i){return Z.or([()=>this.persistence.ei(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const r=this.oi.get(t);return Z.resolve(r!==void 0&&r>i)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ov{constructor(e,t,i,r){this.targetId=e,this.fromCache=t,this.Hi=i,this.Ji=r}static Yi(e,t){let i=Le(),r=Le();for(const o of t.docChanges)switch(o.type){case 0:i=i.add(o.doc.key);break;case 1:r=r.add(o.doc.key)}return new ov(e,t.fromCache,i,r)}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class p5{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class m5{constructor(){this.Zi=!1,this.Xi=!1,this.es=100,this.ts=function(){return uO()?8:BL(fn())>0?6:4}()}initialize(e,t){this.ns=e,this.indexManager=t,this.Zi=!0}getDocumentsMatchingQuery(e,t,i,r){const o={result:null};return this.rs(e,t).next(l=>{o.result=l}).next(()=>{if(!o.result)return this.ss(e,t,r,i).next(l=>{o.result=l})}).next(()=>{if(o.result)return;const l=new p5;return this._s(e,t,l).next(u=>{if(o.result=u,this.Xi)return this.us(e,t,l,u.size)})}).next(()=>o.result)}us(e,t,i,r){return i.documentReadCount<this.es?(Ua()<=Oe.DEBUG&&ue("QueryEngine","SDK will not create cache indexes for query:",za(t),"since it only creates cache indexes for collection contains","more than or equal to",this.es,"documents"),Z.resolve()):(Ua()<=Oe.DEBUG&&ue("QueryEngine","Query:",za(t),"scans",i.documentReadCount,"local documents and returns",r,"documents as results."),i.documentReadCount>this.ts*r?(Ua()<=Oe.DEBUG&&ue("QueryEngine","The SDK decides to create cache indexes for query:",za(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Yi(t))):Z.resolve())}rs(e,t){if(Cb(t))return Z.resolve(null);let i=Yi(t);return this.indexManager.getIndexType(e,i).next(r=>r===0?null:(t.limit!==null&&r===1&&(t=jg(t,null,"F"),i=Yi(t)),this.indexManager.getDocumentsMatchingTarget(e,i).next(o=>{const l=Le(...o);return this.ns.getDocuments(e,l).next(u=>this.indexManager.getMinOffset(e,i).next(h=>{const p=this.cs(t,u);return this.ls(t,p,l,h.readTime)?this.rs(e,jg(t,null,"F")):this.hs(e,p,t,h)}))})))}ss(e,t,i,r){return Cb(t)||r.isEqual(Ie.min())?Z.resolve(null):this.ns.getDocuments(e,i).next(o=>{const l=this.cs(t,o);return this.ls(t,l,i,r)?Z.resolve(null):(Ua()<=Oe.DEBUG&&ue("QueryEngine","Re-using previous result from %s to execute query: %s",r.toString(),za(t)),this.hs(e,l,t,LL(r,tu)).next(u=>u))})}cs(e,t){let i=new Dt(LT(e));return t.forEach((r,o)=>{df(e,o)&&(i=i.add(o))}),i}ls(e,t,i,r){if(e.limit===null)return!1;if(i.size!==t.size)return!0;const o=e.limitType==="F"?t.last():t.first();return!!o&&(o.hasPendingWrites||o.version.compareTo(r)>0)}_s(e,t,i){return Ua()<=Oe.DEBUG&&ue("QueryEngine","Using full collection scan to execute query:",za(t)),this.ns.getDocumentsMatchingQuery(e,t,As.min(),i)}hs(e,t,i,r){return this.ns.getDocumentsMatchingQuery(e,i,r).next(o=>(t.forEach(l=>{o=o.insert(l.key,l)}),o))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const av="LocalStore",g5=3e8;class y5{constructor(e,t,i,r){this.persistence=e,this.Ps=t,this.serializer=r,this.Ts=new dt(Re),this.Is=new Bo(o=>Xy(o),Jy),this.Es=new Map,this.ds=e.getRemoteDocumentCache(),this.Hr=e.getTargetCache(),this.Yr=e.getBundleCache(),this.As(i)}As(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new s5(this.ds,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ds.setIndexManager(this.indexManager),this.Ps.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",t=>e.collect(t,this.Ts))}}function v5(n,e,t,i){return new y5(n,e,t,i)}async function oS(n,e){const t=Pe(n);return await t.persistence.runTransaction("Handle user change","readonly",i=>{let r;return t.mutationQueue.getAllMutationBatches(i).next(o=>(r=o,t.As(e),t.mutationQueue.getAllMutationBatches(i))).next(o=>{const l=[],u=[];let h=Le();for(const p of r){l.push(p.batchId);for(const g of p.mutations)h=h.add(g.key)}for(const p of o){u.push(p.batchId);for(const g of p.mutations)h=h.add(g.key)}return t.localDocuments.getDocuments(i,h).next(p=>({Rs:p,removedBatchIds:l,addedBatchIds:u}))})})}function x5(n,e){const t=Pe(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",i=>{const r=e.batch.keys(),o=t.ds.newChangeBuffer({trackRemovals:!0});return function(u,h,p,g){const y=p.batch,x=y.keys();let b=Z.resolve();return x.forEach(T=>{b=b.next(()=>g.getEntry(h,T)).next(C=>{const I=p.docVersions.get(T);Ke(I!==null),C.version.compareTo(I)<0&&(y.applyToRemoteDocument(C,p),C.isValidDocument()&&(C.setReadTime(p.commitVersion),g.addEntry(C)))})}),b.next(()=>u.mutationQueue.removeMutationBatch(h,y))}(t,i,e,o).next(()=>o.apply(i)).next(()=>t.mutationQueue.performConsistencyCheck(i)).next(()=>t.documentOverlayCache.removeOverlaysForBatchId(i,r,e.batch.batchId)).next(()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(i,function(u){let h=Le();for(let p=0;p<u.mutationResults.length;++p)u.mutationResults[p].transformResults.length>0&&(h=h.add(u.batch.mutations[p].key));return h}(e))).next(()=>t.localDocuments.getDocuments(i,r))})}function aS(n){const e=Pe(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",t=>e.Hr.getLastRemoteSnapshotVersion(t))}function w5(n,e){const t=Pe(n),i=e.snapshotVersion;let r=t.Ts;return t.persistence.runTransaction("Apply remote event","readwrite-primary",o=>{const l=t.ds.newChangeBuffer({trackRemovals:!0});r=t.Ts;const u=[];e.targetChanges.forEach((g,y)=>{const x=r.get(y);if(!x)return;u.push(t.Hr.removeMatchingKeys(o,g.removedDocuments,y).next(()=>t.Hr.addMatchingKeys(o,g.addedDocuments,y)));let b=x.withSequenceNumber(o.currentSequenceNumber);e.targetMismatches.get(y)!==null?b=b.withResumeToken(Zt.EMPTY_BYTE_STRING,Ie.min()).withLastLimboFreeSnapshotVersion(Ie.min()):g.resumeToken.approximateByteSize()>0&&(b=b.withResumeToken(g.resumeToken,i)),r=r.insert(y,b),function(C,I,N){return C.resumeToken.approximateByteSize()===0||I.snapshotVersion.toMicroseconds()-C.snapshotVersion.toMicroseconds()>=g5?!0:N.addedDocuments.size+N.modifiedDocuments.size+N.removedDocuments.size>0}(x,b,g)&&u.push(t.Hr.updateTargetData(o,b))});let h=Dr(),p=Le();if(e.documentUpdates.forEach(g=>{e.resolvedLimboDocuments.has(g)&&u.push(t.persistence.referenceDelegate.updateLimboDocument(o,g))}),u.push(_5(o,l,e.documentUpdates).next(g=>{h=g.Vs,p=g.fs})),!i.isEqual(Ie.min())){const g=t.Hr.getLastRemoteSnapshotVersion(o).next(y=>t.Hr.setTargetsMetadata(o,o.currentSequenceNumber,i));u.push(g)}return Z.waitFor(u).next(()=>l.apply(o)).next(()=>t.localDocuments.getLocalViewOfDocuments(o,h,p)).next(()=>h)}).then(o=>(t.Ts=r,o))}function _5(n,e,t){let i=Le(),r=Le();return t.forEach(o=>i=i.add(o)),e.getEntries(n,i).next(o=>{let l=Dr();return t.forEach((u,h)=>{const p=o.get(u);h.isFoundDocument()!==p.isFoundDocument()&&(r=r.add(u)),h.isNoDocument()&&h.version.isEqual(Ie.min())?(e.removeEntry(u,h.readTime),l=l.insert(u,h)):!p.isValidDocument()||h.version.compareTo(p.version)>0||h.version.compareTo(p.version)===0&&p.hasPendingWrites?(e.addEntry(h),l=l.insert(u,h)):ue(av,"Ignoring outdated watch update for ",u,". Current version:",p.version," Watch version:",h.version)}),{Vs:l,fs:r}})}function b5(n,e){const t=Pe(n);return t.persistence.runTransaction("Get next mutation batch","readonly",i=>(e===void 0&&(e=Ky),t.mutationQueue.getNextMutationBatchAfterBatchId(i,e)))}function E5(n,e){const t=Pe(n);return t.persistence.runTransaction("Allocate target","readwrite",i=>{let r;return t.Hr.getTargetData(i,e).next(o=>o?(r=o,Z.resolve(r)):t.Hr.allocateTargetId(i).next(l=>(r=new ys(e,l,"TargetPurposeListen",i.currentSequenceNumber),t.Hr.addTargetData(i,r).next(()=>r))))}).then(i=>{const r=t.Ts.get(i.targetId);return(r===null||i.snapshotVersion.compareTo(r.snapshotVersion)>0)&&(t.Ts=t.Ts.insert(i.targetId,i),t.Is.set(e,i.targetId)),i})}async function Vg(n,e,t){const i=Pe(n),r=i.Ts.get(e),o=t?"readwrite":"readwrite-primary";try{t||await i.persistence.runTransaction("Release target",o,l=>i.persistence.referenceDelegate.removeTarget(l,r))}catch(l){if(!_l(l))throw l;ue(av,`Failed to update sequence numbers for target ${e}: ${l}`)}i.Ts=i.Ts.remove(e),i.Is.delete(r.target)}function Fb(n,e,t){const i=Pe(n);let r=Ie.min(),o=Le();return i.persistence.runTransaction("Execute query","readwrite",l=>function(h,p,g){const y=Pe(h),x=y.Is.get(g);return x!==void 0?Z.resolve(y.Ts.get(x)):y.Hr.getTargetData(p,g)}(i,l,Yi(e)).next(u=>{if(u)return r=u.lastLimboFreeSnapshotVersion,i.Hr.getMatchingKeysForTargetId(l,u.targetId).next(h=>{o=h})}).next(()=>i.Ps.getDocumentsMatchingQuery(l,e,t?r:Ie.min(),t?o:Le())).next(u=>(T5(i,cV(e),u),{documents:u,gs:o})))}function T5(n,e,t){let i=n.Es.get(e)||Ie.min();t.forEach((r,o)=>{o.readTime.compareTo(i)>0&&(i=o.readTime)}),n.Es.set(e,i)}class Ub{constructor(){this.activeTargetIds=mV()}Ds(e){this.activeTargetIds=this.activeTargetIds.add(e)}vs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}bs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class S5{constructor(){this.ho=new Ub,this.Po={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,i){}addLocalQueryTarget(e,t=!0){return t&&this.ho.Ds(e),this.Po[e]||"not-current"}updateQueryState(e,t,i){this.Po[e]=t}removeLocalQueryTarget(e){this.ho.vs(e)}isLocalQueryTarget(e){return this.ho.activeTargetIds.has(e)}clearQueryState(e){delete this.Po[e]}getAllActiveQueryTargets(){return this.ho.activeTargetIds}isActiveQueryTarget(e){return this.ho.activeTargetIds.has(e)}start(){return this.ho=new Ub,Promise.resolve()}handleUserChange(e,t,i){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class C5{To(e){}shutdown(){}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const zb="ConnectivityMonitor";class Bb{constructor(){this.Io=()=>this.Eo(),this.Ao=()=>this.Ro(),this.Vo=[],this.mo()}To(e){this.Vo.push(e)}shutdown(){window.removeEventListener("online",this.Io),window.removeEventListener("offline",this.Ao)}mo(){window.addEventListener("online",this.Io),window.addEventListener("offline",this.Ao)}Eo(){ue(zb,"Network connectivity changed: AVAILABLE");for(const e of this.Vo)e(0)}Ro(){ue(zb,"Network connectivity changed: UNAVAILABLE");for(const e of this.Vo)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Xh=null;function Fg(){return Xh===null?Xh=function(){return 268435456+Math.round(2147483648*Math.random())}():Xh++,"0x"+Xh.toString(16)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Wm="RestConnection",I5={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class k5{get fo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",i=encodeURIComponent(this.databaseId.projectId),r=encodeURIComponent(this.databaseId.database);this.po=t+"://"+e.host,this.yo=`projects/${i}/databases/${r}`,this.wo=this.databaseId.database===Nd?`project_id=${i}`:`project_id=${i}&database_id=${r}`}So(e,t,i,r,o){const l=Fg(),u=this.bo(e,t.toUriEncodedString());ue(Wm,`Sending RPC '${e}' ${l}:`,u,i);const h={"google-cloud-resource-prefix":this.yo,"x-goog-request-params":this.wo};return this.Do(h,r,o),this.vo(e,u,h,i).then(p=>(ue(Wm,`Received RPC '${e}' ${l}: `,p),p),p=>{throw al(Wm,`RPC '${e}' ${l} failed with error: `,p,"url: ",u,"request:",i),p})}Co(e,t,i,r,o,l){return this.So(e,t,i,r,o)}Do(e,t,i){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+xl}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach((r,o)=>e[o]=r),i&&i.headers.forEach((r,o)=>e[o]=r)}bo(e,t){const i=I5[e];return`${this.po}/v1/${t}:${i}`}terminate(){}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class P5{constructor(e){this.Fo=e.Fo,this.Mo=e.Mo}xo(e){this.Oo=e}No(e){this.Bo=e}Lo(e){this.ko=e}onMessage(e){this.qo=e}close(){this.Mo()}send(e){this.Fo(e)}Qo(){this.Oo()}$o(){this.Bo()}Uo(e){this.ko(e)}Ko(e){this.qo(e)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const sn="WebChannelConnection";class A5 extends k5{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}vo(e,t,i,r){const o=Fg();return new Promise((l,u)=>{const h=new hT;h.setWithCredentials(!0),h.listenOnce(dT.COMPLETE,()=>{try{switch(h.getLastErrorCode()){case sd.NO_ERROR:const g=h.getResponseJson();ue(sn,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(g)),l(g);break;case sd.TIMEOUT:ue(sn,`RPC '${e}' ${o} timed out`),u(new he(J.DEADLINE_EXCEEDED,"Request time out"));break;case sd.HTTP_ERROR:const y=h.getStatus();if(ue(sn,`RPC '${e}' ${o} failed with status:`,y,"response text:",h.getResponseText()),y>0){let x=h.getResponseJson();Array.isArray(x)&&(x=x[0]);const b=x==null?void 0:x.error;if(b&&b.status&&b.message){const T=function(I){const N=I.toLowerCase().replace(/_/g,"-");return Object.values(J).indexOf(N)>=0?N:J.UNKNOWN}(b.status);u(new he(T,b.message))}else u(new he(J.UNKNOWN,"Server responded with status "+h.getStatus()))}else u(new he(J.UNAVAILABLE,"Connection failed."));break;default:Se()}}finally{ue(sn,`RPC '${e}' ${o} completed.`)}});const p=JSON.stringify(r);ue(sn,`RPC '${e}' ${o} sending request:`,r),h.send(t,"POST",p,i,15)})}Wo(e,t,i){const r=Fg(),o=[this.po,"/","google.firestore.v1.Firestore","/",e,"/channel"],l=mT(),u=pT(),h={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},p=this.longPollingOptions.timeoutSeconds;p!==void 0&&(h.longPollingTimeout=Math.round(1e3*p)),this.useFetchStreams&&(h.useFetchStreams=!0),this.Do(h.initMessageHeaders,t,i),h.encodeInitMessageHeaders=!0;const g=o.join("");ue(sn,`Creating RPC '${e}' stream ${r}: ${g}`,h);const y=l.createWebChannel(g,h);let x=!1,b=!1;const T=new P5({Fo:I=>{b?ue(sn,`Not sending because RPC '${e}' stream ${r} is closed:`,I):(x||(ue(sn,`Opening RPC '${e}' stream ${r} transport.`),y.open(),x=!0),ue(sn,`RPC '${e}' stream ${r} sending:`,I),y.send(I))},Mo:()=>y.close()}),C=(I,N,D)=>{I.listen(N,O=>{try{D(O)}catch(L){setTimeout(()=>{throw L},0)}})};return C(y,Cc.EventType.OPEN,()=>{b||(ue(sn,`RPC '${e}' stream ${r} transport opened.`),T.Qo())}),C(y,Cc.EventType.CLOSE,()=>{b||(b=!0,ue(sn,`RPC '${e}' stream ${r} transport closed`),T.Uo())}),C(y,Cc.EventType.ERROR,I=>{b||(b=!0,al(sn,`RPC '${e}' stream ${r} transport errored:`,I),T.Uo(new he(J.UNAVAILABLE,"The operation could not be completed")))}),C(y,Cc.EventType.MESSAGE,I=>{var N;if(!b){const D=I.data[0];Ke(!!D);const O=D,L=(O==null?void 0:O.error)||((N=O[0])===null||N===void 0?void 0:N.error);if(L){ue(sn,`RPC '${e}' stream ${r} received error:`,L);const G=L.status;let X=function(R){const F=Tt[R];if(F!==void 0)return KT(F)}(G),k=L.message;X===void 0&&(X=J.INTERNAL,k="Unknown error status: "+G+" with message "+L.message),b=!0,T.Uo(new he(X,k)),y.close()}else ue(sn,`RPC '${e}' stream ${r} received:`,D),T.Ko(D)}}),C(u,fT.STAT_EVENT,I=>{I.stat===Cg.PROXY?ue(sn,`RPC '${e}' stream ${r} detected buffering proxy`):I.stat===Cg.NOPROXY&&ue(sn,`RPC '${e}' stream ${r} detected no buffering proxy`)}),setTimeout(()=>{T.$o()},0),T}}function Gm(){return typeof document<"u"?document:null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function gf(n){return new DV(n,!0)}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class lS{constructor(e,t,i=1e3,r=1.5,o=6e4){this.Ti=e,this.timerId=t,this.Go=i,this.zo=r,this.jo=o,this.Ho=0,this.Jo=null,this.Yo=Date.now(),this.reset()}reset(){this.Ho=0}Zo(){this.Ho=this.jo}Xo(e){this.cancel();const t=Math.floor(this.Ho+this.e_()),i=Math.max(0,Date.now()-this.Yo),r=Math.max(0,t-i);r>0&&ue("ExponentialBackoff",`Backing off for ${r} ms (base delay: ${this.Ho} ms, delay with jitter: ${t} ms, last attempt: ${i} ms ago)`),this.Jo=this.Ti.enqueueAfterDelay(this.timerId,r,()=>(this.Yo=Date.now(),e())),this.Ho*=this.zo,this.Ho<this.Go&&(this.Ho=this.Go),this.Ho>this.jo&&(this.Ho=this.jo)}t_(){this.Jo!==null&&(this.Jo.skipDelay(),this.Jo=null)}cancel(){this.Jo!==null&&(this.Jo.cancel(),this.Jo=null)}e_(){return(Math.random()-.5)*this.Ho}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const qb="PersistentStream";class cS{constructor(e,t,i,r,o,l,u,h){this.Ti=e,this.n_=i,this.r_=r,this.connection=o,this.authCredentialsProvider=l,this.appCheckCredentialsProvider=u,this.listener=h,this.state=0,this.i_=0,this.s_=null,this.o_=null,this.stream=null,this.__=0,this.a_=new lS(e,t)}u_(){return this.state===1||this.state===5||this.c_()}c_(){return this.state===2||this.state===3}start(){this.__=0,this.state!==4?this.auth():this.l_()}async stop(){this.u_()&&await this.close(0)}h_(){this.state=0,this.a_.reset()}P_(){this.c_()&&this.s_===null&&(this.s_=this.Ti.enqueueAfterDelay(this.n_,6e4,()=>this.T_()))}I_(e){this.E_(),this.stream.send(e)}async T_(){if(this.c_())return this.close(0)}E_(){this.s_&&(this.s_.cancel(),this.s_=null)}d_(){this.o_&&(this.o_.cancel(),this.o_=null)}async close(e,t){this.E_(),this.d_(),this.a_.cancel(),this.i_++,e!==4?this.a_.reset():t&&t.code===J.RESOURCE_EXHAUSTED?(jr(t.toString()),jr("Using maximum backoff delay to prevent overloading the backend."),this.a_.Zo()):t&&t.code===J.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.A_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Lo(t)}A_(){}auth(){this.state=1;const e=this.R_(this.i_),t=this.i_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([i,r])=>{this.i_===t&&this.V_(i,r)},i=>{e(()=>{const r=new he(J.UNKNOWN,"Fetching auth token failed: "+i.message);return this.m_(r)})})}V_(e,t){const i=this.R_(this.i_);this.stream=this.f_(e,t),this.stream.xo(()=>{i(()=>this.listener.xo())}),this.stream.No(()=>{i(()=>(this.state=2,this.o_=this.Ti.enqueueAfterDelay(this.r_,1e4,()=>(this.c_()&&(this.state=3),Promise.resolve())),this.listener.No()))}),this.stream.Lo(r=>{i(()=>this.m_(r))}),this.stream.onMessage(r=>{i(()=>++this.__==1?this.g_(r):this.onNext(r))})}l_(){this.state=5,this.a_.Xo(async()=>{this.state=0,this.start()})}m_(e){return ue(qb,`close with error: ${e}`),this.stream=null,this.close(4,e)}R_(e){return t=>{this.Ti.enqueueAndForget(()=>this.i_===e?t():(ue(qb,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class N5 extends cS{constructor(e,t,i,r,o,l){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,i,r,l),this.serializer=o}f_(e,t){return this.connection.Wo("Listen",e,t)}g_(e){return this.onNext(e)}onNext(e){this.a_.reset();const t=LV(this.serializer,e),i=function(o){if(!("targetChange"in o))return Ie.min();const l=o.targetChange;return l.targetIds&&l.targetIds.length?Ie.min():l.readTime?Xi(l.readTime):Ie.min()}(e);return this.listener.p_(t,i)}y_(e){const t={};t.database=Lg(this.serializer),t.addTarget=function(o,l){let u;const h=l.target;if(u=Ng(h)?{documents:UV(o,h)}:{query:zV(o,h).ht},u.targetId=l.targetId,l.resumeToken.approximateByteSize()>0){u.resumeToken=XT(o,l.resumeToken);const p=Dg(o,l.expectedCount);p!==null&&(u.expectedCount=p)}else if(l.snapshotVersion.compareTo(Ie.min())>0){u.readTime=Md(o,l.snapshotVersion.toTimestamp());const p=Dg(o,l.expectedCount);p!==null&&(u.expectedCount=p)}return u}(this.serializer,e);const i=qV(this.serializer,e);i&&(t.labels=i),this.I_(t)}w_(e){const t={};t.database=Lg(this.serializer),t.removeTarget=e,this.I_(t)}}class R5 extends cS{constructor(e,t,i,r,o,l){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,i,r,l),this.serializer=o}get S_(){return this.__>0}start(){this.lastStreamToken=void 0,super.start()}A_(){this.S_&&this.b_([])}f_(e,t){return this.connection.Wo("Write",e,t)}g_(e){return Ke(!!e.streamToken),this.lastStreamToken=e.streamToken,Ke(!e.writeResults||e.writeResults.length===0),this.listener.D_()}onNext(e){Ke(!!e.streamToken),this.lastStreamToken=e.streamToken,this.a_.reset();const t=FV(e.writeResults,e.commitTime),i=Xi(e.commitTime);return this.listener.v_(i,t)}C_(){const e={};e.database=Lg(this.serializer),this.I_(e)}b_(e){const t={streamToken:this.lastStreamToken,writes:e.map(i=>VV(this.serializer,i))};this.I_(t)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class j5{}class D5 extends j5{constructor(e,t,i,r){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=i,this.serializer=r,this.F_=!1}M_(){if(this.F_)throw new he(J.FAILED_PRECONDITION,"The client has already been terminated.")}So(e,t,i,r){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,l])=>this.connection.So(e,Mg(t,i),r,o,l)).catch(o=>{throw o.name==="FirebaseError"?(o.code===J.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new he(J.UNKNOWN,o.toString())})}Co(e,t,i,r,o){return this.M_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([l,u])=>this.connection.Co(e,Mg(t,i),r,l,u,o)).catch(l=>{throw l.name==="FirebaseError"?(l.code===J.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),l):new he(J.UNKNOWN,l.toString())})}terminate(){this.F_=!0,this.connection.terminate()}}class M5{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.x_=0,this.O_=null,this.N_=!0}B_(){this.x_===0&&(this.L_("Unknown"),this.O_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.O_=null,this.k_("Backend didn't respond within 10 seconds."),this.L_("Offline"),Promise.resolve())))}q_(e){this.state==="Online"?this.L_("Unknown"):(this.x_++,this.x_>=1&&(this.Q_(),this.k_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.L_("Offline")))}set(e){this.Q_(),this.x_=0,e==="Online"&&(this.N_=!1),this.L_(e)}L_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}k_(e){const t=`Could not reach Cloud Firestore backend. ${e} This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.N_?(jr(t),this.N_=!1):ue("OnlineStateTracker",t)}Q_(){this.O_!==null&&(this.O_.cancel(),this.O_=null)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Lo="RemoteStore";class O5{constructor(e,t,i,r,o){this.localStore=e,this.datastore=t,this.asyncQueue=i,this.remoteSyncer={},this.U_=[],this.K_=new Map,this.W_=new Set,this.G_=[],this.z_=o,this.z_.To(l=>{i.enqueueAndForget(async()=>{qo(this)&&(ue(Lo,"Restarting streams for network reachability change."),await async function(h){const p=Pe(h);p.W_.add(4),await wu(p),p.j_.set("Unknown"),p.W_.delete(4),await yf(p)}(this))})}),this.j_=new M5(i,r)}}async function yf(n){if(qo(n))for(const e of n.G_)await e(!0)}async function wu(n){for(const e of n.G_)await e(!1)}function uS(n,e){const t=Pe(n);t.K_.has(e.targetId)||(t.K_.set(e.targetId,e),hv(t)?uv(t):El(t).c_()&&cv(t,e))}function lv(n,e){const t=Pe(n),i=El(t);t.K_.delete(e),i.c_()&&hS(t,e),t.K_.size===0&&(i.c_()?i.P_():qo(t)&&t.j_.set("Unknown"))}function cv(n,e){if(n.H_.Ne(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Ie.min())>0){const t=n.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(t)}El(n).y_(e)}function hS(n,e){n.H_.Ne(e),El(n).w_(e)}function uv(n){n.H_=new AV({getRemoteKeysForTarget:e=>n.remoteSyncer.getRemoteKeysForTarget(e),lt:e=>n.K_.get(e)||null,it:()=>n.datastore.serializer.databaseId}),El(n).start(),n.j_.B_()}function hv(n){return qo(n)&&!El(n).u_()&&n.K_.size>0}function qo(n){return Pe(n).W_.size===0}function dS(n){n.H_=void 0}async function L5(n){n.j_.set("Online")}async function V5(n){n.K_.forEach((e,t)=>{cv(n,e)})}async function F5(n,e){dS(n),hv(n)?(n.j_.q_(e),uv(n)):n.j_.set("Unknown")}async function U5(n,e,t){if(n.j_.set("Online"),e instanceof YT&&e.state===2&&e.cause)try{await async function(r,o){const l=o.cause;for(const u of o.targetIds)r.K_.has(u)&&(await r.remoteSyncer.rejectListen(u,l),r.K_.delete(u),r.H_.removeTarget(u))}(n,e)}catch(i){ue(Lo,"Failed to remove targets %s: %s ",e.targetIds.join(","),i),await Ld(n,i)}else if(e instanceof cd?n.H_.We(e):e instanceof QT?n.H_.Ze(e):n.H_.je(e),!t.isEqual(Ie.min()))try{const i=await aS(n.localStore);t.compareTo(i)>=0&&await function(o,l){const u=o.H_.ot(l);return u.targetChanges.forEach((h,p)=>{if(h.resumeToken.approximateByteSize()>0){const g=o.K_.get(p);g&&o.K_.set(p,g.withResumeToken(h.resumeToken,l))}}),u.targetMismatches.forEach((h,p)=>{const g=o.K_.get(h);if(!g)return;o.K_.set(h,g.withResumeToken(Zt.EMPTY_BYTE_STRING,g.snapshotVersion)),hS(o,h);const y=new ys(g.target,h,p,g.sequenceNumber);cv(o,y)}),o.remoteSyncer.applyRemoteEvent(u)}(n,t)}catch(i){ue(Lo,"Failed to raise snapshot:",i),await Ld(n,i)}}async function Ld(n,e,t){if(!_l(e))throw e;n.W_.add(1),await wu(n),n.j_.set("Offline"),t||(t=()=>aS(n.localStore)),n.asyncQueue.enqueueRetryable(async()=>{ue(Lo,"Retrying IndexedDB access"),await t(),n.W_.delete(1),await yf(n)})}function fS(n,e){return e().catch(t=>Ld(n,t,e))}async function vf(n){const e=Pe(n),t=Ds(e);let i=e.U_.length>0?e.U_[e.U_.length-1].batchId:Ky;for(;z5(e);)try{const r=await b5(e.localStore,i);if(r===null){e.U_.length===0&&t.P_();break}i=r.batchId,B5(e,r)}catch(r){await Ld(e,r)}pS(e)&&mS(e)}function z5(n){return qo(n)&&n.U_.length<10}function B5(n,e){n.U_.push(e);const t=Ds(n);t.c_()&&t.S_&&t.b_(e.mutations)}function pS(n){return qo(n)&&!Ds(n).u_()&&n.U_.length>0}function mS(n){Ds(n).start()}async function q5(n){Ds(n).C_()}async function $5(n){const e=Ds(n);for(const t of n.U_)e.b_(t.mutations)}async function H5(n,e,t){const i=n.U_.shift(),r=tv.from(i,e,t);await fS(n,()=>n.remoteSyncer.applySuccessfulWrite(r)),await vf(n)}async function W5(n,e){e&&Ds(n).S_&&await async function(i,r){if(function(l){return kV(l)&&l!==J.ABORTED}(r.code)){const o=i.U_.shift();Ds(i).h_(),await fS(i,()=>i.remoteSyncer.rejectFailedWrite(o.batchId,r)),await vf(i)}}(n,e),pS(n)&&mS(n)}async function $b(n,e){const t=Pe(n);t.asyncQueue.verifyOperationInProgress(),ue(Lo,"RemoteStore received new credentials");const i=qo(t);t.W_.add(3),await wu(t),i&&t.j_.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.W_.delete(3),await yf(t)}async function G5(n,e){const t=Pe(n);e?(t.W_.delete(2),await yf(t)):e||(t.W_.add(2),await wu(t),t.j_.set("Unknown"))}function El(n){return n.J_||(n.J_=function(t,i,r){const o=Pe(t);return o.M_(),new N5(i,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,r)}(n.datastore,n.asyncQueue,{xo:L5.bind(null,n),No:V5.bind(null,n),Lo:F5.bind(null,n),p_:U5.bind(null,n)}),n.G_.push(async e=>{e?(n.J_.h_(),hv(n)?uv(n):n.j_.set("Unknown")):(await n.J_.stop(),dS(n))})),n.J_}function Ds(n){return n.Y_||(n.Y_=function(t,i,r){const o=Pe(t);return o.M_(),new R5(i,o.connection,o.authCredentials,o.appCheckCredentials,o.serializer,r)}(n.datastore,n.asyncQueue,{xo:()=>Promise.resolve(),No:q5.bind(null,n),Lo:W5.bind(null,n),D_:$5.bind(null,n),v_:H5.bind(null,n)}),n.G_.push(async e=>{e?(n.Y_.h_(),await vf(n)):(await n.Y_.stop(),n.U_.length>0&&(ue(Lo,`Stopping write stream with ${n.U_.length} pending writes`),n.U_=[]))})),n.Y_}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class dv{constructor(e,t,i,r,o){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=i,this.op=r,this.removalCallback=o,this.deferred=new Pr,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(l=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,t,i,r,o){const l=Date.now()+i,u=new dv(e,t,l,r,o);return u.start(i),u}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new he(J.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget(()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then(e=>this.deferred.resolve(e))):Promise.resolve())}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function fv(n,e){if(jr("AsyncQueue",`${e}: ${n}`),_l(n))return new he(J.UNAVAILABLE,`${e}: ${n}`);throw n}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Xa{static emptySet(e){return new Xa(e.comparator)}constructor(e){this.comparator=e?(t,i)=>e(t,i)||ve.comparator(t.key,i.key):(t,i)=>ve.comparator(t.key,i.key),this.keyedMap=Ic(),this.sortedSet=new dt(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((t,i)=>(e(t),!1))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof Xa)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),i=e.sortedSet.getIterator();for(;t.hasNext();){const r=t.getNext().key,o=i.getNext().key;if(!r.isEqual(o))return!1}return!0}toString(){const e=[];return this.forEach(t=>{e.push(t.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` )`}copy(e,t){const i=new Xa;return i.comparator=this.comparator,i.keyedMap=e,i.sortedSet=t,i}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Hb{constructor(){this.Z_=new dt(ve.comparator)}track(e){const t=e.doc.key,i=this.Z_.get(t);i?e.type!==0&&i.type===3?this.Z_=this.Z_.insert(t,e):e.type===3&&i.type!==1?this.Z_=this.Z_.insert(t,{type:i.type,doc:e.doc}):e.type===2&&i.type===2?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):e.type===2&&i.type===0?this.Z_=this.Z_.insert(t,{type:0,doc:e.doc}):e.type===1&&i.type===0?this.Z_=this.Z_.remove(t):e.type===1&&i.type===2?this.Z_=this.Z_.insert(t,{type:1,doc:i.doc}):e.type===0&&i.type===1?this.Z_=this.Z_.insert(t,{type:2,doc:e.doc}):Se():this.Z_=this.Z_.insert(t,e)}X_(){const e=[];return this.Z_.inorderTraversal((t,i)=>{e.push(i)}),e}}class dl{constructor(e,t,i,r,o,l,u,h,p){this.query=e,this.docs=t,this.oldDocs=i,this.docChanges=r,this.mutatedKeys=o,this.fromCache=l,this.syncStateChanged=u,this.excludesMetadataChanges=h,this.hasCachedResults=p}static fromInitialDocuments(e,t,i,r,o){const l=[];return t.forEach(u=>{l.push({type:0,doc:u})}),new dl(e,t,Xa.emptySet(t),l,i,r,!0,!1,o)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&hf(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,i=e.docChanges;if(t.length!==i.length)return!1;for(let r=0;r<t.length;r++)if(t[r].type!==i[r].type||!t[r].doc.isEqual(i[r].doc))return!1;return!0}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class K5{constructor(){this.ea=void 0,this.ta=[]}na(){return this.ta.some(e=>e.ra())}}class Q5{constructor(){this.queries=Wb(),this.onlineState="Unknown",this.ia=new Set}terminate(){(function(t,i){const r=Pe(t),o=r.queries;r.queries=Wb(),o.forEach((l,u)=>{for(const h of u.ta)h.onError(i)})})(this,new he(J.ABORTED,"Firestore shutting down"))}}function Wb(){return new Bo(n=>OT(n),hf)}async function pv(n,e){const t=Pe(n);let i=3;const r=e.query;let o=t.queries.get(r);o?!o.na()&&e.ra()&&(i=2):(o=new K5,i=e.ra()?0:1);try{switch(i){case 0:o.ea=await t.onListen(r,!0);break;case 1:o.ea=await t.onListen(r,!1);break;case 2:await t.onFirstRemoteStoreListen(r)}}catch(l){const u=fv(l,`Initialization of query '${za(e.query)}' failed`);return void e.onError(u)}t.queries.set(r,o),o.ta.push(e),e.sa(t.onlineState),o.ea&&e.oa(o.ea)&&gv(t)}async function mv(n,e){const t=Pe(n),i=e.query;let r=3;const o=t.queries.get(i);if(o){const l=o.ta.indexOf(e);l>=0&&(o.ta.splice(l,1),o.ta.length===0?r=e.ra()?0:1:!o.na()&&e.ra()&&(r=2))}switch(r){case 0:return t.queries.delete(i),t.onUnlisten(i,!0);case 1:return t.queries.delete(i),t.onUnlisten(i,!1);case 2:return t.onLastRemoteStoreUnlisten(i);default:return}}function Y5(n,e){const t=Pe(n);let i=!1;for(const r of e){const o=r.query,l=t.queries.get(o);if(l){for(const u of l.ta)u.oa(r)&&(i=!0);l.ea=r}}i&&gv(t)}function X5(n,e,t){const i=Pe(n),r=i.queries.get(e);if(r)for(const o of r.ta)o.onError(t);i.queries.delete(e)}function gv(n){n.ia.forEach(e=>{e.next()})}var Ug,Gb;(Gb=Ug||(Ug={}))._a="default",Gb.Cache="cache";class yv{constructor(e,t,i){this.query=e,this.aa=t,this.ua=!1,this.ca=null,this.onlineState="Unknown",this.options=i||{}}oa(e){if(!this.options.includeMetadataChanges){const i=[];for(const r of e.docChanges)r.type!==3&&i.push(r);e=new dl(e.query,e.docs,e.oldDocs,i,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.ua?this.la(e)&&(this.aa.next(e),t=!0):this.ha(e,this.onlineState)&&(this.Pa(e),t=!0),this.ca=e,t}onError(e){this.aa.error(e)}sa(e){this.onlineState=e;let t=!1;return this.ca&&!this.ua&&this.ha(this.ca,e)&&(this.Pa(this.ca),t=!0),t}ha(e,t){if(!e.fromCache||!this.ra())return!0;const i=t!=="Offline";return(!this.options.Ta||!i)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}la(e){if(e.docChanges.length>0)return!0;const t=this.ca&&this.ca.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}Pa(e){e=dl.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.ua=!0,this.aa.next(e)}ra(){return this.options.source!==Ug.Cache}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class gS{constructor(e){this.key=e}}class yS{constructor(e){this.key=e}}class J5{constructor(e,t){this.query=e,this.fa=t,this.ga=null,this.hasCachedResults=!1,this.current=!1,this.pa=Le(),this.mutatedKeys=Le(),this.ya=LT(e),this.wa=new Xa(this.ya)}get Sa(){return this.fa}ba(e,t){const i=t?t.Da:new Hb,r=t?t.wa:this.wa;let o=t?t.mutatedKeys:this.mutatedKeys,l=r,u=!1;const h=this.query.limitType==="F"&&r.size===this.query.limit?r.last():null,p=this.query.limitType==="L"&&r.size===this.query.limit?r.first():null;if(e.inorderTraversal((g,y)=>{const x=r.get(g),b=df(this.query,y)?y:null,T=!!x&&this.mutatedKeys.has(x.key),C=!!b&&(b.hasLocalMutations||this.mutatedKeys.has(b.key)&&b.hasCommittedMutations);let I=!1;x&&b?x.data.isEqual(b.data)?T!==C&&(i.track({type:3,doc:b}),I=!0):this.va(x,b)||(i.track({type:2,doc:b}),I=!0,(h&&this.ya(b,h)>0||p&&this.ya(b,p)<0)&&(u=!0)):!x&&b?(i.track({type:0,doc:b}),I=!0):x&&!b&&(i.track({type:1,doc:x}),I=!0,(h||p)&&(u=!0)),I&&(b?(l=l.add(b),o=C?o.add(g):o.delete(g)):(l=l.delete(g),o=o.delete(g)))}),this.query.limit!==null)for(;l.size>this.query.limit;){const g=this.query.limitType==="F"?l.last():l.first();l=l.delete(g.key),o=o.delete(g.key),i.track({type:1,doc:g})}return{wa:l,Da:i,ls:u,mutatedKeys:o}}va(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,i,r){const o=this.wa;this.wa=e.wa,this.mutatedKeys=e.mutatedKeys;const l=e.Da.X_();l.sort((g,y)=>function(b,T){const C=I=>{switch(I){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Se()}};return C(b)-C(T)}(g.type,y.type)||this.ya(g.doc,y.doc)),this.Ca(i),r=r!=null&&r;const u=t&&!r?this.Fa():[],h=this.pa.size===0&&this.current&&!r?1:0,p=h!==this.ga;return this.ga=h,l.length!==0||p?{snapshot:new dl(this.query,e.wa,o,l,e.mutatedKeys,h===0,p,!1,!!i&&i.resumeToken.approximateByteSize()>0),Ma:u}:{Ma:u}}sa(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({wa:this.wa,Da:new Hb,mutatedKeys:this.mutatedKeys,ls:!1},!1)):{Ma:[]}}xa(e){return!this.fa.has(e)&&!!this.wa.has(e)&&!this.wa.get(e).hasLocalMutations}Ca(e){e&&(e.addedDocuments.forEach(t=>this.fa=this.fa.add(t)),e.modifiedDocuments.forEach(t=>{}),e.removedDocuments.forEach(t=>this.fa=this.fa.delete(t)),this.current=e.current)}Fa(){if(!this.current)return[];const e=this.pa;this.pa=Le(),this.wa.forEach(i=>{this.xa(i.key)&&(this.pa=this.pa.add(i.key))});const t=[];return e.forEach(i=>{this.pa.has(i)||t.push(new yS(i))}),this.pa.forEach(i=>{e.has(i)||t.push(new gS(i))}),t}Oa(e){this.fa=e.gs,this.pa=Le();const t=this.ba(e.documents);return this.applyChanges(t,!0)}Na(){return dl.fromInitialDocuments(this.query,this.wa,this.mutatedKeys,this.ga===0,this.hasCachedResults)}}const vv="SyncEngine";class Z5{constructor(e,t,i){this.query=e,this.targetId=t,this.view=i}}class e6{constructor(e){this.key=e,this.Ba=!1}}class t6{constructor(e,t,i,r,o,l){this.localStore=e,this.remoteStore=t,this.eventManager=i,this.sharedClientState=r,this.currentUser=o,this.maxConcurrentLimboResolutions=l,this.La={},this.ka=new Bo(u=>OT(u),hf),this.qa=new Map,this.Qa=new Set,this.$a=new dt(ve.comparator),this.Ua=new Map,this.Ka=new rv,this.Wa={},this.Ga=new Map,this.za=hl.Kn(),this.onlineState="Unknown",this.ja=void 0}get isPrimaryClient(){return this.ja===!0}}async function n6(n,e,t=!0){const i=ES(n);let r;const o=i.ka.get(e);return o?(i.sharedClientState.addLocalQueryTarget(o.targetId),r=o.view.Na()):r=await vS(i,e,t,!0),r}async function i6(n,e){const t=ES(n);await vS(t,e,!0,!1)}async function vS(n,e,t,i){const r=await E5(n.localStore,Yi(e)),o=r.targetId,l=n.sharedClientState.addLocalQueryTarget(o,t);let u;return i&&(u=await r6(n,e,o,l==="current",r.resumeToken)),n.isPrimaryClient&&t&&uS(n.remoteStore,r),u}async function r6(n,e,t,i,r){n.Ha=(y,x,b)=>async function(C,I,N,D){let O=I.view.ba(N);O.ls&&(O=await Fb(C.localStore,I.query,!1).then(({documents:k})=>I.view.ba(k,O)));const L=D&&D.targetChanges.get(I.targetId),G=D&&D.targetMismatches.get(I.targetId)!=null,X=I.view.applyChanges(O,C.isPrimaryClient,L,G);return Qb(C,I.targetId,X.Ma),X.snapshot}(n,y,x,b);const o=await Fb(n.localStore,e,!0),l=new J5(e,o.gs),u=l.ba(o.documents),h=xu.createSynthesizedTargetChangeForCurrentChange(t,i&&n.onlineState!=="Offline",r),p=l.applyChanges(u,n.isPrimaryClient,h);Qb(n,t,p.Ma);const g=new Z5(e,t,l);return n.ka.set(e,g),n.qa.has(t)?n.qa.get(t).push(e):n.qa.set(t,[e]),p.snapshot}async function s6(n,e,t){const i=Pe(n),r=i.ka.get(e),o=i.qa.get(r.targetId);if(o.length>1)return i.qa.set(r.targetId,o.filter(l=>!hf(l,e))),void i.ka.delete(e);i.isPrimaryClient?(i.sharedClientState.removeLocalQueryTarget(r.targetId),i.sharedClientState.isActiveQueryTarget(r.targetId)||await Vg(i.localStore,r.targetId,!1).then(()=>{i.sharedClientState.clearQueryState(r.targetId),t&&lv(i.remoteStore,r.targetId),zg(i,r.targetId)}).catch(wl)):(zg(i,r.targetId),await Vg(i.localStore,r.targetId,!0))}async function o6(n,e){const t=Pe(n),i=t.ka.get(e),r=t.qa.get(i.targetId);t.isPrimaryClient&&r.length===1&&(t.sharedClientState.removeLocalQueryTarget(i.targetId),lv(t.remoteStore,i.targetId))}async function a6(n,e,t){const i=p6(n);try{const r=await function(l,u){const h=Pe(l),p=jt.now(),g=u.reduce((b,T)=>b.add(T.key),Le());let y,x;return h.persistence.runTransaction("Locally write mutations","readwrite",b=>{let T=Dr(),C=Le();return h.ds.getEntries(b,g).next(I=>{T=I,T.forEach((N,D)=>{D.isValidDocument()||(C=C.add(N))})}).next(()=>h.localDocuments.getOverlayedDocuments(b,T)).next(I=>{y=I;const N=[];for(const D of u){const O=EV(D,y.get(D.key).overlayedDocument);O!=null&&N.push(new zs(D.key,O,kT(O.value.mapValue),li.exists(!0)))}return h.mutationQueue.addMutationBatch(b,p,N,u)}).next(I=>{x=I;const N=I.applyToLocalDocumentSet(y,C);return h.documentOverlayCache.saveOverlays(b,I.batchId,N)})}).then(()=>({batchId:x.batchId,changes:FT(y)}))}(i.localStore,e);i.sharedClientState.addPendingMutation(r.batchId),function(l,u,h){let p=l.Wa[l.currentUser.toKey()];p||(p=new dt(Re)),p=p.insert(u,h),l.Wa[l.currentUser.toKey()]=p}(i,r.batchId,t),await _u(i,r.changes),await vf(i.remoteStore)}catch(r){const o=fv(r,"Failed to persist write");t.reject(o)}}async function xS(n,e){const t=Pe(n);try{const i=await w5(t.localStore,e);e.targetChanges.forEach((r,o)=>{const l=t.Ua.get(o);l&&(Ke(r.addedDocuments.size+r.modifiedDocuments.size+r.removedDocuments.size<=1),r.addedDocuments.size>0?l.Ba=!0:r.modifiedDocuments.size>0?Ke(l.Ba):r.removedDocuments.size>0&&(Ke(l.Ba),l.Ba=!1))}),await _u(t,i,e)}catch(i){await wl(i)}}function Kb(n,e,t){const i=Pe(n);if(i.isPrimaryClient&&t===0||!i.isPrimaryClient&&t===1){const r=[];i.ka.forEach((o,l)=>{const u=l.view.sa(e);u.snapshot&&r.push(u.snapshot)}),function(l,u){const h=Pe(l);h.onlineState=u;let p=!1;h.queries.forEach((g,y)=>{for(const x of y.ta)x.sa(u)&&(p=!0)}),p&&gv(h)}(i.eventManager,e),r.length&&i.La.p_(r),i.onlineState=e,i.isPrimaryClient&&i.sharedClientState.setOnlineState(e)}}async function l6(n,e,t){const i=Pe(n);i.sharedClientState.updateQueryState(e,"rejected",t);const r=i.Ua.get(e),o=r&&r.key;if(o){let l=new dt(ve.comparator);l=l.insert(o,ln.newNoDocument(o,Ie.min()));const u=Le().add(o),h=new mf(Ie.min(),new Map,new dt(Re),l,u);await xS(i,h),i.$a=i.$a.remove(o),i.Ua.delete(e),xv(i)}else await Vg(i.localStore,e,!1).then(()=>zg(i,e,t)).catch(wl)}async function c6(n,e){const t=Pe(n),i=e.batch.batchId;try{const r=await x5(t.localStore,e);_S(t,i,null),wS(t,i),t.sharedClientState.updateMutationState(i,"acknowledged"),await _u(t,r)}catch(r){await wl(r)}}async function u6(n,e,t){const i=Pe(n);try{const r=await function(l,u){const h=Pe(l);return h.persistence.runTransaction("Reject batch","readwrite-primary",p=>{let g;return h.mutationQueue.lookupMutationBatch(p,u).next(y=>(Ke(y!==null),g=y.keys(),h.mutationQueue.removeMutationBatch(p,y))).next(()=>h.mutationQueue.performConsistencyCheck(p)).next(()=>h.documentOverlayCache.removeOverlaysForBatchId(p,g,u)).next(()=>h.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(p,g)).next(()=>h.localDocuments.getDocuments(p,g))})}(i.localStore,e);_S(i,e,t),wS(i,e),i.sharedClientState.updateMutationState(e,"rejected",t),await _u(i,r)}catch(r){await wl(r)}}function wS(n,e){(n.Ga.get(e)||[]).forEach(t=>{t.resolve()}),n.Ga.delete(e)}function _S(n,e,t){const i=Pe(n);let r=i.Wa[i.currentUser.toKey()];if(r){const o=r.get(e);o&&(t?o.reject(t):o.resolve(),r=r.remove(e)),i.Wa[i.currentUser.toKey()]=r}}function zg(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const i of n.qa.get(e))n.ka.delete(i),t&&n.La.Ja(i,t);n.qa.delete(e),n.isPrimaryClient&&n.Ka.br(e).forEach(i=>{n.Ka.containsKey(i)||bS(n,i)})}function bS(n,e){n.Qa.delete(e.path.canonicalString());const t=n.$a.get(e);t!==null&&(lv(n.remoteStore,t),n.$a=n.$a.remove(e),n.Ua.delete(t),xv(n))}function Qb(n,e,t){for(const i of t)i instanceof gS?(n.Ka.addReference(i.key,e),h6(n,i)):i instanceof yS?(ue(vv,"Document no longer in limbo: "+i.key),n.Ka.removeReference(i.key,e),n.Ka.containsKey(i.key)||bS(n,i.key)):Se()}function h6(n,e){const t=e.key,i=t.path.canonicalString();n.$a.get(t)||n.Qa.has(i)||(ue(vv,"New document in limbo: "+t),n.Qa.add(i),xv(n))}function xv(n){for(;n.Qa.size>0&&n.$a.size<n.maxConcurrentLimboResolutions;){const e=n.Qa.values().next().value;n.Qa.delete(e);const t=new ve(it.fromString(e)),i=n.za.next();n.Ua.set(i,new e6(t)),n.$a=n.$a.insert(t,i),uS(n.remoteStore,new ys(Yi(uf(t.path)),i,"TargetPurposeLimboResolution",af.ae))}}async function _u(n,e,t){const i=Pe(n),r=[],o=[],l=[];i.ka.isEmpty()||(i.ka.forEach((u,h)=>{l.push(i.Ha(h,e,t).then(p=>{var g;if((p||t)&&i.isPrimaryClient){const y=p?!p.fromCache:(g=t==null?void 0:t.targetChanges.get(h.targetId))===null||g===void 0?void 0:g.current;i.sharedClientState.updateQueryState(h.targetId,y?"current":"not-current")}if(p){r.push(p);const y=ov.Yi(h.targetId,p);o.push(y)}}))}),await Promise.all(l),i.La.p_(r),await async function(h,p){const g=Pe(h);try{await g.persistence.runTransaction("notifyLocalViewChanges","readwrite",y=>Z.forEach(p,x=>Z.forEach(x.Hi,b=>g.persistence.referenceDelegate.addReference(y,x.targetId,b)).next(()=>Z.forEach(x.Ji,b=>g.persistence.referenceDelegate.removeReference(y,x.targetId,b)))))}catch(y){if(!_l(y))throw y;ue(av,"Failed to update sequence numbers: "+y)}for(const y of p){const x=y.targetId;if(!y.fromCache){const b=g.Ts.get(x),T=b.snapshotVersion,C=b.withLastLimboFreeSnapshotVersion(T);g.Ts=g.Ts.insert(x,C)}}}(i.localStore,o))}async function d6(n,e){const t=Pe(n);if(!t.currentUser.isEqual(e)){ue(vv,"User change. New user:",e.toKey());const i=await oS(t.localStore,e);t.currentUser=e,function(o,l){o.Ga.forEach(u=>{u.forEach(h=>{h.reject(new he(J.CANCELLED,l))})}),o.Ga.clear()}(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,i.removedBatchIds,i.addedBatchIds),await _u(t,i.Rs)}}function f6(n,e){const t=Pe(n),i=t.Ua.get(e);if(i&&i.Ba)return Le().add(i.key);{let r=Le();const o=t.qa.get(e);if(!o)return r;for(const l of o){const u=t.ka.get(l);r=r.unionWith(u.view.Sa)}return r}}function ES(n){const e=Pe(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=xS.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=f6.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=l6.bind(null,e),e.La.p_=Y5.bind(null,e.eventManager),e.La.Ja=X5.bind(null,e.eventManager),e}function p6(n){const e=Pe(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=c6.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=u6.bind(null,e),e}class Vd{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=gf(e.databaseInfo.databaseId),this.sharedClientState=this.Za(e),this.persistence=this.Xa(e),await this.persistence.start(),this.localStore=this.eu(e),this.gcScheduler=this.tu(e,this.localStore),this.indexBackfillerScheduler=this.nu(e,this.localStore)}tu(e,t){return null}nu(e,t){return null}eu(e){return v5(this.persistence,new m5,e.initialUser,this.serializer)}Xa(e){return new sS(sv.ri,this.serializer)}Za(e){return new S5}async terminate(){var e,t;(e=this.gcScheduler)===null||e===void 0||e.stop(),(t=this.indexBackfillerScheduler)===null||t===void 0||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Vd.provider={build:()=>new Vd};class m6 extends Vd{constructor(e){super(),this.cacheSizeBytes=e}tu(e,t){Ke(this.persistence.referenceDelegate instanceof Od);const i=this.persistence.referenceDelegate.garbageCollector;return new e5(i,e.asyncQueue,t)}Xa(e){const t=this.cacheSizeBytes!==void 0?Pn.withCacheSize(this.cacheSizeBytes):Pn.DEFAULT;return new sS(i=>Od.ri(i,t),this.serializer)}}class Bg{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=i=>Kb(this.syncEngine,i,1),this.remoteStore.remoteSyncer.handleCredentialChange=d6.bind(null,this.syncEngine),await G5(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new Q5}()}createDatastore(e){const t=gf(e.databaseInfo.databaseId),i=function(o){return new A5(o)}(e.databaseInfo);return function(o,l,u,h){return new D5(o,l,u,h)}(e.authCredentials,e.appCheckCredentials,i,t)}createRemoteStore(e){return function(i,r,o,l,u){return new O5(i,r,o,l,u)}(this.localStore,this.datastore,e.asyncQueue,t=>Kb(this.syncEngine,t,0),function(){return Bb.D()?new Bb:new C5}())}createSyncEngine(e,t){return function(r,o,l,u,h,p,g){const y=new t6(r,o,l,u,h,p);return g&&(y.ja=!0),y}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await async function(r){const o=Pe(r);ue(Lo,"RemoteStore shutting down."),o.W_.add(5),await wu(o),o.z_.shutdown(),o.j_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(t=this.eventManager)===null||t===void 0||t.terminate()}}Bg.provider={build:()=>new Bg};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. *//** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wv{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.iu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.iu(this.observer.error,e):jr("Uncaught Error in snapshot listener:",e.toString()))}su(){this.muted=!0}iu(e,t){setTimeout(()=>{this.muted||e(t)},0)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Ms="FirestoreClient";class g6{constructor(e,t,i,r,o){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=i,this.databaseInfo=r,this.user=an.UNAUTHENTICATED,this.clientId=vT.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=o,this.authCredentials.start(i,async l=>{ue(Ms,"Received user=",l.uid),await this.authCredentialListener(l),this.user=l}),this.appCheckCredentials.start(i,l=>(ue(Ms,"Received new app check token=",l),this.appCheckCredentialListener(l,this.user)))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this.databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new Pr;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted(async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const i=fv(t,"Failed to shutdown persistence");e.reject(i)}}),e.promise}}async function Km(n,e){n.asyncQueue.verifyOperationInProgress(),ue(Ms,"Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let i=t.initialUser;n.setCredentialChangeListener(async r=>{i.isEqual(r)||(await oS(e.localStore,r),i=r)}),e.persistence.setDatabaseDeletedListener(()=>n.terminate()),n._offlineComponents=e}async function Yb(n,e){n.asyncQueue.verifyOperationInProgress();const t=await y6(n);ue(Ms,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener(i=>$b(e.remoteStore,i)),n.setAppCheckTokenChangeListener((i,r)=>$b(e.remoteStore,r)),n._onlineComponents=e}async function y6(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){ue(Ms,"Using user provided OfflineComponentProvider");try{await Km(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!function(r){return r.name==="FirebaseError"?r.code===J.FAILED_PRECONDITION||r.code===J.UNIMPLEMENTED:!(typeof DOMException<"u"&&r instanceof DOMException)||r.code===22||r.code===20||r.code===11}(t))throw t;al("Error using user provided cache. Falling back to memory cache: "+t),await Km(n,new Vd)}}else ue(Ms,"Using default OfflineComponentProvider"),await Km(n,new m6(void 0));return n._offlineComponents}async function TS(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(ue(Ms,"Using user provided OnlineComponentProvider"),await Yb(n,n._uninitializedComponentsProvider._online)):(ue(Ms,"Using default OnlineComponentProvider"),await Yb(n,new Bg))),n._onlineComponents}function v6(n){return TS(n).then(e=>e.syncEngine)}async function Fd(n){const e=await TS(n),t=e.eventManager;return t.onListen=n6.bind(null,e.syncEngine),t.onUnlisten=s6.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=i6.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=o6.bind(null,e.syncEngine),t}function x6(n,e,t={}){const i=new Pr;return n.asyncQueue.enqueueAndForget(async()=>function(o,l,u,h,p){const g=new wv({next:x=>{g.su(),l.enqueueAndForget(()=>mv(o,y));const b=x.docs.has(u);!b&&x.fromCache?p.reject(new he(J.UNAVAILABLE,"Failed to get document because the client is offline.")):b&&x.fromCache&&h&&h.source==="server"?p.reject(new he(J.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):p.resolve(x)},error:x=>p.reject(x)}),y=new yv(uf(u.path),g,{includeMetadataChanges:!0,Ta:!0});return pv(o,y)}(await Fd(n),n.asyncQueue,e,t,i)),i.promise}function w6(n,e,t={}){const i=new Pr;return n.asyncQueue.enqueueAndForget(async()=>function(o,l,u,h,p){const g=new wv({next:x=>{g.su(),l.enqueueAndForget(()=>mv(o,y)),x.fromCache&&h.source==="server"?p.reject(new he(J.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):p.resolve(x)},error:x=>p.reject(x)}),y=new yv(u,g,{includeMetadataChanges:!0,Ta:!0});return pv(o,y)}(await Fd(n),n.asyncQueue,e,t,i)),i.promise}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function SS(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Xb=new Map;/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function CS(n,e,t){if(!t)throw new he(J.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function _6(n,e,t,i){if(e===!0&&i===!0)throw new he(J.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function Jb(n){if(!ve.isDocumentKey(n))throw new he(J.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function Zb(n){if(ve.isDocumentKey(n))throw new he(J.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function xf(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{const e=function(i){return i.constructor?i.constructor.name:null}(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":Se()}function Rn(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new he(J.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=xf(n);throw new he(J.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const IS="firestore.googleapis.com",e1=!0;class t1{constructor(e){var t,i;if(e.host===void 0){if(e.ssl!==void 0)throw new he(J.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=IS,this.ssl=e1}else this.host=e.host,this.ssl=(t=e.ssl)!==null&&t!==void 0?t:e1;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=rS;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<JV)throw new he(J.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}_6("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=SS((i=e.experimentalLongPollingOptions)!==null&&i!==void 0?i:{}),function(o){if(o.timeoutSeconds!==void 0){if(isNaN(o.timeoutSeconds))throw new he(J.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (must not be NaN)`);if(o.timeoutSeconds<5)throw new he(J.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (minimum allowed value is 5)`);if(o.timeoutSeconds>30)throw new he(J.INVALID_ARGUMENT,`invalid long polling timeout: ${o.timeoutSeconds} (maximum allowed value is 30)`)}}(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&function(i,r){return i.timeoutSeconds===r.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class wf{constructor(e,t,i,r){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=i,this._app=r,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new t1({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new he(J.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new he(J.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new t1(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(i){if(!i)return new kL;switch(i.type){case"firstParty":return new RL(i.sessionIndex||"0",i.iamToken||null,i.authTokenFactory||null);case"provider":return i.client;default:throw new he(J.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return function(t){const i=Xb.get(t);i&&(ue("ComponentProvider","Removing Datastore"),Xb.delete(t),i.terminate())}(this),Promise.resolve()}}function b6(n,e,t,i={}){var r;const o=(n=Rn(n,wf))._getSettings(),l=Object.assign(Object.assign({},o),{emulatorOptions:n._getEmulatorOptions()}),u=`${e}:${t}`;o.host!==IS&&o.host!==u&&al("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const h=Object.assign(Object.assign({},o),{host:u,ssl:!1,emulatorOptions:i});if(!Do(h,l)&&(n._setSettings(h),i.mockUserToken)){let p,g;if(typeof i.mockUserToken=="string")p=i.mockUserToken,g=an.MOCK_USER;else{p=iO(i.mockUserToken,(r=n._app)===null||r===void 0?void 0:r.options.projectId);const y=i.mockUserToken.sub||i.mockUserToken.user_id;if(!y)throw new he(J.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");g=new an(y)}n._authCredentials=new PL(new gT(p,g))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Bs{constructor(e,t,i){this.converter=t,this._query=i,this.type="query",this.firestore=e}withConverter(e){return new Bs(this.firestore,e,this._query)}}class dn{constructor(e,t,i){this.converter=t,this._key=i,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Ss(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new dn(this.firestore,e,this._key)}}class Ss extends Bs{constructor(e,t,i){super(e,t,uf(i)),this._path=i,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new dn(this.firestore,null,new ve(e))}withConverter(e){return new Ss(this.firestore,e,this._path)}}function Ge(n,e,...t){if(n=Mt(n),CS("collection","path",e),n instanceof wf){const i=it.fromString(e,...t);return Zb(i),new Ss(n,null,i)}{if(!(n instanceof dn||n instanceof Ss))throw new he(J.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(it.fromString(e,...t));return Zb(i),new Ss(n.firestore,null,i)}}function ht(n,e,...t){if(n=Mt(n),arguments.length===1&&(e=vT.newId()),CS("doc","path",e),n instanceof wf){const i=it.fromString(e,...t);return Jb(i),new dn(n,null,new ve(i))}{if(!(n instanceof dn||n instanceof Ss))throw new he(J.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const i=n._path.child(it.fromString(e,...t));return Jb(i),new dn(n.firestore,n instanceof Ss?n.converter:null,new ve(i))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const n1="AsyncQueue";class i1{constructor(e=Promise.resolve()){this.Vu=[],this.mu=!1,this.fu=[],this.gu=null,this.pu=!1,this.yu=!1,this.wu=[],this.a_=new lS(this,"async_queue_retry"),this.Su=()=>{const i=Gm();i&&ue(n1,"Visibility state changed to "+i.visibilityState),this.a_.t_()},this.bu=e;const t=Gm();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Su)}get isShuttingDown(){return this.mu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Du(),this.vu(e)}enterRestrictedMode(e){if(!this.mu){this.mu=!0,this.yu=e||!1;const t=Gm();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Su)}}enqueue(e){if(this.Du(),this.mu)return new Promise(()=>{});const t=new Pr;return this.vu(()=>this.mu&&this.yu?Promise.resolve():(e().then(t.resolve,t.reject),t.promise)).then(()=>t.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Vu.push(e),this.Cu()))}async Cu(){if(this.Vu.length!==0){try{await this.Vu[0](),this.Vu.shift(),this.a_.reset()}catch(e){if(!_l(e))throw e;ue(n1,"Operation failed with retryable error: "+e)}this.Vu.length>0&&this.a_.Xo(()=>this.Cu())}}vu(e){const t=this.bu.then(()=>(this.pu=!0,e().catch(i=>{this.gu=i,this.pu=!1;const r=function(l){let u=l.message||"";return l.stack&&(u=l.stack.includes(l.message)?l.stack:l.message+` `+l.stack),u}(i);throw jr("INTERNAL UNHANDLED ERROR: ",r),i}).then(i=>(this.pu=!1,i))));return this.bu=t,t}enqueueAfterDelay(e,t,i){this.Du(),this.wu.indexOf(e)>-1&&(t=0);const r=dv.createAndSchedule(this,e,t,i,o=>this.Fu(o));return this.fu.push(r),r}Du(){this.gu&&Se()}verifyOperationInProgress(){}async Mu(){let e;do e=this.bu,await e;while(e!==this.bu)}xu(e){for(const t of this.fu)if(t.timerId===e)return!0;return!1}Ou(e){return this.Mu().then(()=>{this.fu.sort((t,i)=>t.targetTimeMs-i.targetTimeMs);for(const t of this.fu)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.Mu()})}Nu(e){this.wu.push(e)}Fu(e){const t=this.fu.indexOf(e);this.fu.splice(t,1)}}function r1(n){return function(t,i){if(typeof t!="object"||t===null)return!1;const r=t;for(const o of i)if(o in r&&typeof r[o]=="function")return!0;return!1}(n,["next","error","complete"])}class Mr extends wf{constructor(e,t,i,r){super(e,t,i,r),this.type="firestore",this._queue=new i1,this._persistenceKey=(r==null?void 0:r.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new i1(e),this._firestoreClient=void 0,await e}}}function E6(n,e){const t=typeof n=="object"?n:aT(),i=typeof n=="string"?n:Nd,r=Wy(t,"firestore").getImmediate({identifier:i});if(!r._initialized){const o=tO("firestore");o&&b6(r,...o)}return r}function _f(n){if(n._terminated)throw new he(J.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||T6(n),n._firestoreClient}function T6(n){var e,t,i;const r=n._freezeSettings(),o=function(u,h,p,g){return new GL(u,h,p,g.host,g.ssl,g.experimentalForceLongPolling,g.experimentalAutoDetectLongPolling,SS(g.experimentalLongPollingOptions),g.useFetchStreams)}(n._databaseId,((e=n._app)===null||e===void 0?void 0:e.options.appId)||"",n._persistenceKey,r);n._componentsProvider||!((t=r.localCache)===null||t===void 0)&&t._offlineComponentProvider&&(!((i=r.localCache)===null||i===void 0)&&i._onlineComponentProvider)&&(n._componentsProvider={_offline:r.localCache._offlineComponentProvider,_online:r.localCache._onlineComponentProvider}),n._firestoreClient=new g6(n._authCredentials,n._appCheckCredentials,n._queue,o,n._componentsProvider&&function(u){const h=u==null?void 0:u._online.build();return{_offline:u==null?void 0:u._offline.build(h),_online:h}}(n._componentsProvider))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fl{constructor(e){this._byteString=e}static fromBase64String(e){try{return new fl(Zt.fromBase64String(e))}catch(t){throw new he(J.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new fl(Zt.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bf{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new he(J.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Xt(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ef{constructor(e){this._methodName=e}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class _v{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new he(J.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new he(J.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}toJSON(){return{latitude:this._lat,longitude:this._long}}_compareTo(e){return Re(this._lat,e._lat)||Re(this._long,e._long)}}/** * @license * Copyright 2024 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class bv{constructor(e){this._values=(e||[]).map(t=>t)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(i,r){if(i.length!==r.length)return!1;for(let o=0;o<i.length;++o)if(i[o]!==r[o])return!1;return!0}(this._values,e._values)}}/** * @license * Copyright 2017 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const S6=/^__.*__$/;class C6{constructor(e,t,i){this.data=e,this.fieldMask=t,this.fieldTransforms=i}toMutation(e,t){return this.fieldMask!==null?new zs(e,this.data,this.fieldMask,t,this.fieldTransforms):new vu(e,this.data,t,this.fieldTransforms)}}class kS{constructor(e,t,i){this.data=e,this.fieldMask=t,this.fieldTransforms=i}toMutation(e,t){return new zs(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function PS(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Se()}}class Ev{constructor(e,t,i,r,o,l){this.settings=e,this.databaseId=t,this.serializer=i,this.ignoreUndefinedProperties=r,o===void 0&&this.Bu(),this.fieldTransforms=o||[],this.fieldMask=l||[]}get path(){return this.settings.path}get Lu(){return this.settings.Lu}ku(e){return new Ev(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}qu(e){var t;const i=(t=this.path)===null||t===void 0?void 0:t.child(e),r=this.ku({path:i,Qu:!1});return r.$u(e),r}Uu(e){var t;const i=(t=this.path)===null||t===void 0?void 0:t.child(e),r=this.ku({path:i,Qu:!1});return r.Bu(),r}Ku(e){return this.ku({path:void 0,Qu:!0})}Wu(e){return Ud(e,this.settings.methodName,this.settings.Gu||!1,this.path,this.settings.zu)}contains(e){return this.fieldMask.find(t=>e.isPrefixOf(t))!==void 0||this.fieldTransforms.find(t=>e.isPrefixOf(t.field))!==void 0}Bu(){if(this.path)for(let e=0;e<this.path.length;e++)this.$u(this.path.get(e))}$u(e){if(e.length===0)throw this.Wu("Document fields must not be empty");if(PS(this.Lu)&&S6.test(e))throw this.Wu('Document fields cannot begin and end with "__"')}}class I6{constructor(e,t,i){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer=i||gf(e)}ju(e,t,i,r=!1){return new Ev({Lu:e,methodName:t,zu:i,path:Xt.emptyPath(),Qu:!1,Gu:r},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Tf(n){const e=n._freezeSettings(),t=gf(n._databaseId);return new I6(n._databaseId,!!e.ignoreUndefinedProperties,t)}function AS(n,e,t,i,r,o={}){const l=n.ju(o.merge||o.mergeFields?2:0,e,t,r);Sv("Data must be an object, but it was:",l,i);const u=NS(i,l);let h,p;if(o.merge)h=new Bn(l.fieldMask),p=l.fieldTransforms;else if(o.mergeFields){const g=[];for(const y of o.mergeFields){const x=qg(e,y,t);if(!l.contains(x))throw new he(J.INVALID_ARGUMENT,`Field '${x}' is specified in your field mask but missing from your input data.`);jS(g,x)||g.push(x)}h=new Bn(g),p=l.fieldTransforms.filter(y=>h.covers(y.field))}else h=null,p=l.fieldTransforms;return new C6(new An(u),h,p)}class Sf extends Ef{_toFieldTransform(e){if(e.Lu!==2)throw e.Lu===1?e.Wu(`${this._methodName}() can only appear at the top level of your update data`):e.Wu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof Sf}}class Tv extends Ef{_toFieldTransform(e){return new xV(e.path,new ou)}isEqual(e){return e instanceof Tv}}function k6(n,e,t,i){const r=n.ju(1,e,t);Sv("Data must be an object, but it was:",r,i);const o=[],l=An.empty();Us(i,(h,p)=>{const g=Cv(e,h,t);p=Mt(p);const y=r.Uu(g);if(p instanceof Sf)o.push(g);else{const x=bu(p,y);x!=null&&(o.push(g),l.set(g,x))}});const u=new Bn(o);return new kS(l,u,r.fieldTransforms)}function P6(n,e,t,i,r,o){const l=n.ju(1,e,t),u=[qg(e,i,t)],h=[r];if(o.length%2!=0)throw new he(J.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let x=0;x<o.length;x+=2)u.push(qg(e,o[x])),h.push(o[x+1]);const p=[],g=An.empty();for(let x=u.length-1;x>=0;--x)if(!jS(p,u[x])){const b=u[x];let T=h[x];T=Mt(T);const C=l.Uu(b);if(T instanceof Sf)p.push(b);else{const I=bu(T,C);I!=null&&(p.push(b),g.set(b,I))}}const y=new Bn(p);return new kS(g,y,l.fieldTransforms)}function A6(n,e,t,i=!1){return bu(t,n.ju(i?4:3,e))}function bu(n,e){if(RS(n=Mt(n)))return Sv("Unsupported field value:",e,n),NS(n,e);if(n instanceof Ef)return function(i,r){if(!PS(r.Lu))throw r.Wu(`${i._methodName}() can only be used with update() and set()`);if(!r.path)throw r.Wu(`${i._methodName}() is not currently supported inside arrays`);const o=i._toFieldTransform(r);o&&r.fieldTransforms.push(o)}(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.Qu&&e.Lu!==4)throw e.Wu("Nested arrays are not supported");return function(i,r){const o=[];let l=0;for(const u of i){let h=bu(u,r.Ku(l));h==null&&(h={nullValue:"NULL_VALUE"}),o.push(h),l++}return{arrayValue:{values:o}}}(n,e)}return function(i,r){if((i=Mt(i))===null)return{nullValue:"NULL_VALUE"};if(typeof i=="number")return gV(r.serializer,i);if(typeof i=="boolean")return{booleanValue:i};if(typeof i=="string")return{stringValue:i};if(i instanceof Date){const o=jt.fromDate(i);return{timestampValue:Md(r.serializer,o)}}if(i instanceof jt){const o=new jt(i.seconds,1e3*Math.floor(i.nanoseconds/1e3));return{timestampValue:Md(r.serializer,o)}}if(i instanceof _v)return{geoPointValue:{latitude:i.latitude,longitude:i.longitude}};if(i instanceof fl)return{bytesValue:XT(r.serializer,i._byteString)};if(i instanceof dn){const o=r.databaseId,l=i.firestore._databaseId;if(!l.isEqual(o))throw r.Wu(`Document reference is for database ${l.projectId}/${l.database} but should be for database ${o.projectId}/${o.database}`);return{referenceValue:iv(i.firestore._databaseId||r.databaseId,i._key.path)}}if(i instanceof bv)return function(l,u){return{mapValue:{fields:{[CT]:{stringValue:IT},[Rd]:{arrayValue:{values:l.toArray().map(p=>{if(typeof p!="number")throw u.Wu("VectorValues must only contain numeric values.");return Zy(u.serializer,p)})}}}}}}(i,r);throw r.Wu(`Unsupported field value: ${xf(i)}`)}(n,e)}function NS(n,e){const t={};return wT(n)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):Us(n,(i,r)=>{const o=bu(r,e.qu(i));o!=null&&(t[i]=o)}),{mapValue:{fields:t}}}function RS(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof jt||n instanceof _v||n instanceof fl||n instanceof dn||n instanceof Ef||n instanceof bv)}function Sv(n,e,t){if(!RS(t)||!function(r){return typeof r=="object"&&r!==null&&(Object.getPrototypeOf(r)===Object.prototype||Object.getPrototypeOf(r)===null)}(t)){const i=xf(t);throw i==="an object"?e.Wu(n+" a custom object"):e.Wu(n+" "+i)}}function qg(n,e,t){if((e=Mt(e))instanceof bf)return e._internalPath;if(typeof e=="string")return Cv(n,e);throw Ud("Field path arguments must be of type string or ",n,!1,void 0,t)}const N6=new RegExp("[~\\*/\\[\\]]");function Cv(n,e,t){if(e.search(N6)>=0)throw Ud(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new bf(...e.split("."))._internalPath}catch{throw Ud(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function Ud(n,e,t,i,r){const o=i&&!i.isEmpty(),l=r!==void 0;let u=`Function ${e}() called with invalid data`;t&&(u+=" (via `toFirestore()`)"),u+=". ";let h="";return(o||l)&&(h+=" (found",o&&(h+=` in field ${i}`),l&&(h+=` in document ${r}`),h+=")"),new he(J.INVALID_ARGUMENT,u+n+h)}function jS(n,e){return n.some(t=>t.isEqual(e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class DS{constructor(e,t,i,r,o){this._firestore=e,this._userDataWriter=t,this._key=i,this._document=r,this._converter=o}get id(){return this._key.path.lastSegment()}get ref(){return new dn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new R6(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}get(e){if(this._document){const t=this._document.data.field(Cf("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}}class R6 extends DS{data(){return super.data()}}function Cf(n,e){return typeof e=="string"?Cv(n,e):e instanceof bf?e._internalPath:e._delegate._internalPath}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function MS(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new he(J.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class Iv{}class OS extends Iv{}function zd(n,e,...t){let i=[];e instanceof Iv&&i.push(e),i=i.concat(t),function(o){const l=o.filter(h=>h instanceof kv).length,u=o.filter(h=>h instanceof If).length;if(l>1||l>0&&u>0)throw new he(J.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")}(i);for(const r of i)n=r._apply(n);return n}class If extends OS{constructor(e,t,i){super(),this._field=e,this._op=t,this._value=i,this.type="where"}static _create(e,t,i){return new If(e,t,i)}_apply(e){const t=this._parse(e);return LS(e._query,t),new Bs(e.firestore,e.converter,Rg(e._query,t))}_parse(e){const t=Tf(e.firestore);return function(o,l,u,h,p,g,y){let x;if(p.isKeyField()){if(g==="array-contains"||g==="array-contains-any")throw new he(J.INVALID_ARGUMENT,`Invalid Query. You can't perform '${g}' queries on documentId().`);if(g==="in"||g==="not-in"){o1(y,g);const T=[];for(const C of y)T.push(s1(h,o,C));x={arrayValue:{values:T}}}else x=s1(h,o,y)}else g!=="in"&&g!=="not-in"&&g!=="array-contains-any"||o1(y,g),x=A6(u,l,y,g==="in"||g==="not-in");return St.create(p,g,x)}(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function Bd(n,e,t){const i=e,r=Cf("where",n);return If._create(r,i,t)}class kv extends Iv{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new kv(e,t)}_parse(e){const t=this._queryConstraints.map(i=>i._parse(e)).filter(i=>i.getFilters().length>0);return t.length===1?t[0]:ji.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:(function(r,o){let l=r;const u=o.getFlattenedFilters();for(const h of u)LS(l,h),l=Rg(l,h)}(e._query,t),new Bs(e.firestore,e.converter,Rg(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class Pv extends OS{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new Pv(e,t)}_apply(e){const t=function(r,o,l){if(r.startAt!==null)throw new he(J.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(r.endAt!==null)throw new he(J.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new su(o,l)}(e._query,this._field,this._direction);return new Bs(e.firestore,e.converter,function(r,o){const l=r.explicitOrderBy.concat([o]);return new bl(r.path,r.collectionGroup,l,r.filters.slice(),r.limit,r.limitType,r.startAt,r.endAt)}(e._query,t))}}function qd(n,e="asc"){const t=e,i=Cf("orderBy",n);return Pv._create(i,t)}function s1(n,e,t){if(typeof(t=Mt(t))=="string"){if(t==="")throw new he(J.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!MT(e)&&t.indexOf("/")!==-1)throw new he(J.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const i=e.path.child(it.fromString(t));if(!ve.isDocumentKey(i))throw new he(J.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${i}' is not because it has an odd number of segments (${i.length}).`);return wb(n,new ve(i))}if(t instanceof dn)return wb(n,t._key);throw new he(J.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${xf(t)}.`)}function o1(n,e){if(!Array.isArray(n)||n.length===0)throw new he(J.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function LS(n,e){const t=function(r,o){for(const l of r)for(const u of l.getFlattenedFilters())if(o.indexOf(u.op)>=0)return u.op;return null}(n.filters,function(r){switch(r){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}}(e.op));if(t!==null)throw t===e.op?new he(J.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new he(J.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}class j6{convertValue(e,t="none"){switch(js(e)){case 0:return null;case 1:return e.booleanValue;case 2:return xt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Rs(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw Se()}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const i={};return Us(e,(r,o)=>{i[r]=this.convertValue(o,t)}),i}convertVectorValue(e){var t,i,r;const o=(r=(i=(t=e.fields)===null||t===void 0?void 0:t[Rd].arrayValue)===null||i===void 0?void 0:i.values)===null||r===void 0?void 0:r.map(l=>xt(l.doubleValue));return new bv(o)}convertGeoPoint(e){return new _v(xt(e.latitude),xt(e.longitude))}convertArray(e,t){return(e.values||[]).map(i=>this.convertValue(i,t))}convertServerTimestamp(e,t){switch(t){case"previous":const i=cf(e);return i==null?null:this.convertValue(i,t);case"estimate":return this.convertTimestamp(nu(e));default:return null}}convertTimestamp(e){const t=Ns(e);return new jt(t.seconds,t.nanos)}convertDocumentKey(e,t){const i=it.fromString(e);Ke(iS(i));const r=new iu(i.get(1),i.get(3)),o=new ve(i.popFirst(5));return r.isEqual(t)||jr(`Document ${o} contains a document reference within a different database (${r.projectId}/${r.database}) which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),o}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function VS(n,e,t){let i;return i=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,i}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Pc{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class FS extends DS{constructor(e,t,i,r,o,l){super(e,t,i,r,l),this._firestore=e,this._firestoreImpl=e,this.metadata=o}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new ud(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const i=this._document.data.field(Cf("DocumentSnapshot.get",e));if(i!==null)return this._userDataWriter.convertValue(i,t.serverTimestamps)}}}class ud extends FS{data(e={}){return super.data(e)}}class US{constructor(e,t,i,r){this._firestore=e,this._userDataWriter=t,this._snapshot=r,this.metadata=new Pc(r.hasPendingWrites,r.fromCache),this.query=i}get docs(){const e=[];return this.forEach(t=>e.push(t)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach(i=>{e.call(t,new ud(this._firestore,this._userDataWriter,i.key,i,new Pc(this._snapshot.mutatedKeys.has(i.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new he(J.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=function(r,o){if(r._snapshot.oldDocs.isEmpty()){let l=0;return r._snapshot.docChanges.map(u=>{const h=new ud(r._firestore,r._userDataWriter,u.doc.key,u.doc,new Pc(r._snapshot.mutatedKeys.has(u.doc.key),r._snapshot.fromCache),r.query.converter);return u.doc,{type:"added",doc:h,oldIndex:-1,newIndex:l++}})}{let l=r._snapshot.oldDocs;return r._snapshot.docChanges.filter(u=>o||u.type!==3).map(u=>{const h=new ud(r._firestore,r._userDataWriter,u.doc.key,u.doc,new Pc(r._snapshot.mutatedKeys.has(u.doc.key),r._snapshot.fromCache),r.query.converter);let p=-1,g=-1;return u.type!==0&&(p=l.indexOf(u.doc.key),l=l.delete(u.doc.key)),u.type!==1&&(l=l.add(u.doc),g=l.indexOf(u.doc.key)),{type:D6(u.type),doc:h,oldIndex:p,newIndex:g}})}}(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}}function D6(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Se()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Eu(n){n=Rn(n,dn);const e=Rn(n.firestore,Mr);return x6(_f(e),n._key).then(t=>zS(e,n,t))}class Av extends j6{constructor(e){super(),this.firestore=e}convertBytes(e){return new fl(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new dn(this.firestore,null,t)}}function Ct(n){n=Rn(n,Bs);const e=Rn(n.firestore,Mr),t=_f(e),i=new Av(e);return MS(n._query),w6(t,n._query).then(r=>new US(e,i,n,r))}function a1(n,e,t){n=Rn(n,dn);const i=Rn(n.firestore,Mr),r=VS(n.converter,e,t);return kf(i,[AS(Tf(i),"setDoc",n._key,r,n.converter!==null,t).toMutation(n._key,li.none())])}function qs(n,e,t,...i){n=Rn(n,dn);const r=Rn(n.firestore,Mr),o=Tf(r);let l;return l=typeof(e=Mt(e))=="string"||e instanceof bf?P6(o,"updateDoc",n._key,e,t,i):k6(o,"updateDoc",n._key,e),kf(r,[l.toMutation(n._key,li.exists(!0))])}function $s(n){return kf(Rn(n.firestore,Mr),[new ev(n._key,li.none())])}function $o(n,e){const t=Rn(n.firestore,Mr),i=ht(n),r=VS(n.converter,e);return kf(t,[AS(Tf(n.firestore),"addDoc",i._key,r,n.converter!==null,{}).toMutation(i._key,li.exists(!1))]).then(()=>i)}function $g(n,...e){var t,i,r;n=Mt(n);let o={includeMetadataChanges:!1,source:"default"},l=0;typeof e[l]!="object"||r1(e[l])||(o=e[l],l++);const u={includeMetadataChanges:o.includeMetadataChanges,source:o.source};if(r1(e[l])){const y=e[l];e[l]=(t=y.next)===null||t===void 0?void 0:t.bind(y),e[l+1]=(i=y.error)===null||i===void 0?void 0:i.bind(y),e[l+2]=(r=y.complete)===null||r===void 0?void 0:r.bind(y)}let h,p,g;if(n instanceof dn)p=Rn(n.firestore,Mr),g=uf(n._key.path),h={next:y=>{e[l]&&e[l](zS(p,n,y))},error:e[l+1],complete:e[l+2]};else{const y=Rn(n,Bs);p=Rn(y.firestore,Mr),g=y._query;const x=new Av(p);h={next:b=>{e[l]&&e[l](new US(p,x,y,b))},error:e[l+1],complete:e[l+2]},MS(n._query)}return function(x,b,T,C){const I=new wv(C),N=new yv(b,I,T);return x.asyncQueue.enqueueAndForget(async()=>pv(await Fd(x),N)),()=>{I.su(),x.asyncQueue.enqueueAndForget(async()=>mv(await Fd(x),N))}}(_f(p),g,u,h)}function kf(n,e){return function(i,r){const o=new Pr;return i.asyncQueue.enqueueAndForget(async()=>a6(await v6(i),r,o)),o.promise}(_f(n),e)}function zS(n,e,t){const i=t.docs.get(e._key),r=new Av(n);return new FS(n,r,e._key,i,new Pc(t.hasPendingWrites,t.fromCache),e.converter)}function Qm(){return new Tv("serverTimestamp")}(function(e,t=!0){(function(r){xl=r})(vl),ol(new Mo("firestore",(i,{instanceIdentifier:r,options:o})=>{const l=i.getProvider("app").getImmediate(),u=new Mr(new AL(i.getProvider("auth-internal")),new jL(l,i.getProvider("app-check-internal")),function(p,g){if(!Object.prototype.hasOwnProperty.apply(p.options,["projectId"]))throw new he(J.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new iu(p.options.projectId,g)}(l,r),l);return o=Object.assign({useFetchStreams:t},o),u._setSettings(o),u},"PUBLIC").setMultipleInstances(!0)),Es(lb,cb,e),Es(lb,cb,"esm2017")})();var M6="firebase",O6="11.5.0";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */Es(M6,O6,"app");function Nv(n,e){var t={};for(var i in n)Object.prototype.hasOwnProperty.call(n,i)&&e.indexOf(i)<0&&(t[i]=n[i]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,i=Object.getOwnPropertySymbols(n);r<i.length;r++)e.indexOf(i[r])<0&&Object.prototype.propertyIsEnumerable.call(n,i[r])&&(t[i[r]]=n[i[r]]);return t}function BS(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const L6=BS,qS=new gu("auth","Firebase",BS());/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $d=new $y("@firebase/auth");function V6(n,...e){$d.logLevel<=Oe.WARN&&$d.warn(`Auth (${vl}): ${n}`,...e)}function hd(n,...e){$d.logLevel<=Oe.ERROR&&$d.error(`Auth (${vl}): ${n}`,...e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function ui(n,...e){throw jv(n,...e)}function Ai(n,...e){return jv(n,...e)}function Rv(n,e,t){const i=Object.assign(Object.assign({},L6()),{[e]:t});return new gu("auth","Firebase",i).create(e,{appName:n.name})}function Cs(n){return Rv(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function F6(n,e,t){const i=t;if(!(e instanceof i))throw i.name!==e.constructor.name&&ui(n,"argument-error"),Rv(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function jv(n,...e){if(typeof n!="string"){const t=e[0],i=[...e.slice(1)];return i[0]&&(i[0].appName=n.name),n._errorFactory.create(t,...i)}return qS.create(n,...e)}function Te(n,e,...t){if(!n)throw jv(e,...t)}function _r(n){const e="INTERNAL ASSERTION FAILED: "+n;throw hd(e),new Error(e)}function Or(n,e){n||_r(e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Hg(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.href)||""}function U6(){return l1()==="http:"||l1()==="https:"}function l1(){var n;return typeof self<"u"&&((n=self.location)===null||n===void 0?void 0:n.protocol)||null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function z6(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(U6()||aO()||"connection"in navigator)?navigator.onLine:!0}function B6(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Tu{constructor(e,t){this.shortDelay=e,this.longDelay=t,Or(t>e,"Short delay should be less than long delay!"),this.isMobile=rO()||lO()}get(){return z6()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Dv(n,e){Or(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class $S{static initialize(e,t,i){this.fetchImpl=e,t&&(this.headersImpl=t),i&&(this.responseImpl=i)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;_r("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;_r("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;_r("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const q6={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $6=new Tu(3e4,6e4);function Ho(n,e){return n.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:n.tenantId}):e}async function Hs(n,e,t,i,r={}){return HS(n,r,async()=>{let o={},l={};i&&(e==="GET"?l=i:o={body:JSON.stringify(i)});const u=yu(Object.assign({key:n.config.apiKey},l)).slice(1),h=await n._getAdditionalHeaders();h["Content-Type"]="application/json",n.languageCode&&(h["X-Firebase-Locale"]=n.languageCode);const p=Object.assign({method:e,headers:h},o);return oO()||(p.referrerPolicy="no-referrer"),$S.fetch()(WS(n,n.config.apiHost,t,u),p)})}async function HS(n,e,t){n._canInitEmulator=!1;const i=Object.assign(Object.assign({},q6),e);try{const r=new W6(n),o=await Promise.race([t(),r.promise]);r.clearNetworkTimeout();const l=await o.json();if("needConfirmation"in l)throw Jh(n,"account-exists-with-different-credential",l);if(o.ok&&!("errorMessage"in l))return l;{const u=o.ok?l.errorMessage:l.error.message,[h,p]=u.split(" : ");if(h==="FEDERATED_USER_ID_ALREADY_LINKED")throw Jh(n,"credential-already-in-use",l);if(h==="EMAIL_EXISTS")throw Jh(n,"email-already-in-use",l);if(h==="USER_DISABLED")throw Jh(n,"user-disabled",l);const g=i[h]||h.toLowerCase().replace(/[_\s]+/g,"-");if(p)throw Rv(n,g,p);ui(n,g)}}catch(r){if(r instanceof Lr)throw r;ui(n,"network-request-failed",{message:String(r)})}}async function Pf(n,e,t,i,r={}){const o=await Hs(n,e,t,i,r);return"mfaPendingCredential"in o&&ui(n,"multi-factor-auth-required",{_serverResponse:o}),o}function WS(n,e,t,i){const r=`${e}${t}?${i}`;return n.config.emulator?Dv(n.config,r):`${n.config.apiScheme}://${r}`}function H6(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class W6{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,i)=>{this.timer=setTimeout(()=>i(Ai(this.auth,"network-request-failed")),$6.get())})}}function Jh(n,e,t){const i={appName:n.name};t.email&&(i.email=t.email),t.phoneNumber&&(i.phoneNumber=t.phoneNumber);const r=Ai(n,e,i);return r.customData._tokenResponse=t,r}function c1(n){return n!==void 0&&n.enterprise!==void 0}class G6{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return H6(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function K6(n,e){return Hs(n,"GET","/v2/recaptchaConfig",Ho(n,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Q6(n,e){return Hs(n,"POST","/v1/accounts:delete",e)}async function GS(n,e){return Hs(n,"POST","/v1/accounts:lookup",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Bc(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Y6(n,e=!1){const t=Mt(n),i=await t.getIdToken(e),r=Mv(i);Te(r&&r.exp&&r.auth_time&&r.iat,t.auth,"internal-error");const o=typeof r.firebase=="object"?r.firebase:void 0,l=o==null?void 0:o.sign_in_provider;return{claims:r,token:i,authTime:Bc(Ym(r.auth_time)),issuedAtTime:Bc(Ym(r.iat)),expirationTime:Bc(Ym(r.exp)),signInProvider:l||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}}function Ym(n){return Number(n)*1e3}function Mv(n){const[e,t,i]=n.split(".");if(e===void 0||t===void 0||i===void 0)return hd("JWT malformed, contained fewer than 3 sections"),null;try{const r=eT(t);return r?JSON.parse(r):(hd("Failed to decode base64 JWT payload"),null)}catch(r){return hd("Caught error parsing JWT payload as JSON",r==null?void 0:r.toString()),null}}function u1(n){const e=Mv(n);return Te(e,"internal-error"),Te(typeof e.exp<"u","internal-error"),Te(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function cu(n,e,t=!1){if(t)return e;try{return await e}catch(i){throw i instanceof Lr&&X6(i)&&n.auth.currentUser===n&&await n.auth.signOut(),i}}function X6({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class J6{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){var t;if(e){const i=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),i}else{this.errorBackoff=3e4;const r=((t=this.user.stsTokenManager.expirationTime)!==null&&t!==void 0?t:0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Wg{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Bc(this.lastLoginAt),this.creationTime=Bc(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function Hd(n){var e;const t=n.auth,i=await n.getIdToken(),r=await cu(n,GS(t,{idToken:i}));Te(r==null?void 0:r.users.length,t,"internal-error");const o=r.users[0];n._notifyReloadListener(o);const l=!((e=o.providerUserInfo)===null||e===void 0)&&e.length?KS(o.providerUserInfo):[],u=eF(n.providerData,l),h=n.isAnonymous,p=!(n.email&&o.passwordHash)&&!(u!=null&&u.length),g=h?p:!1,y={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:u,metadata:new Wg(o.createdAt,o.lastLoginAt),isAnonymous:g};Object.assign(n,y)}async function Z6(n){const e=Mt(n);await Hd(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function eF(n,e){return[...n.filter(i=>!e.some(r=>r.providerId===i.providerId)),...e]}function KS(n){return n.map(e=>{var{providerId:t}=e,i=Nv(e,["providerId"]);return{providerId:t,uid:i.rawId||"",displayName:i.displayName||null,email:i.email||null,phoneNumber:i.phoneNumber||null,photoURL:i.photoUrl||null}})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function tF(n,e){const t=await HS(n,{},async()=>{const i=yu({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:r,apiKey:o}=n.config,l=WS(n,r,"/v1/token",`key=${o}`),u=await n._getAdditionalHeaders();return u["Content-Type"]="application/x-www-form-urlencoded",$S.fetch()(l,{method:"POST",headers:u,body:i})});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function nF(n,e){return Hs(n,"POST","/v2/accounts:revokeToken",Ho(n,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Ja{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Te(e.idToken,"internal-error"),Te(typeof e.idToken<"u","internal-error"),Te(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):u1(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Te(e.length!==0,"internal-error");const t=u1(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(Te(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:i,refreshToken:r,expiresIn:o}=await tF(e,t);this.updateTokensAndExpiration(i,r,Number(o))}updateTokensAndExpiration(e,t,i){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+i*1e3}static fromJSON(e,t){const{refreshToken:i,accessToken:r,expirationTime:o}=t,l=new Ja;return i&&(Te(typeof i=="string","internal-error",{appName:e}),l.refreshToken=i),r&&(Te(typeof r=="string","internal-error",{appName:e}),l.accessToken=r),o&&(Te(typeof o=="number","internal-error",{appName:e}),l.expirationTime=o),l}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new Ja,this.toJSON())}_performRefresh(){return _r("not implemented")}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function us(n,e){Te(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class br{constructor(e){var{uid:t,auth:i,stsTokenManager:r}=e,o=Nv(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new J6(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=t,this.auth=i,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new Wg(o.createdAt||void 0,o.lastLoginAt||void 0)}async getIdToken(e){const t=await cu(this,this.stsTokenManager.getToken(this.auth,e));return Te(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Y6(this,e)}reload(){return Z6(this)}_assign(e){this!==e&&(Te(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>Object.assign({},t)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new br(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return t.metadata._copy(this.metadata),t}_onReload(e){Te(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let i=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),i=!0),t&&await Hd(this),await this.auth._persistUserIfCurrent(this),i&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(ai(this.auth.app))return Promise.reject(Cs(this.auth));const e=await this.getIdToken();return await cu(this,Q6(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>Object.assign({},e)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){var i,r,o,l,u,h,p,g;const y=(i=t.displayName)!==null&&i!==void 0?i:void 0,x=(r=t.email)!==null&&r!==void 0?r:void 0,b=(o=t.phoneNumber)!==null&&o!==void 0?o:void 0,T=(l=t.photoURL)!==null&&l!==void 0?l:void 0,C=(u=t.tenantId)!==null&&u!==void 0?u:void 0,I=(h=t._redirectEventId)!==null&&h!==void 0?h:void 0,N=(p=t.createdAt)!==null&&p!==void 0?p:void 0,D=(g=t.lastLoginAt)!==null&&g!==void 0?g:void 0,{uid:O,emailVerified:L,isAnonymous:G,providerData:X,stsTokenManager:k}=t;Te(O&&k,e,"internal-error");const P=Ja.fromJSON(this.name,k);Te(typeof O=="string",e,"internal-error"),us(y,e.name),us(x,e.name),Te(typeof L=="boolean",e,"internal-error"),Te(typeof G=="boolean",e,"internal-error"),us(b,e.name),us(T,e.name),us(C,e.name),us(I,e.name),us(N,e.name),us(D,e.name);const R=new br({uid:O,auth:e,email:x,emailVerified:L,displayName:y,isAnonymous:G,photoURL:T,phoneNumber:b,tenantId:C,stsTokenManager:P,createdAt:N,lastLoginAt:D});return X&&Array.isArray(X)&&(R.providerData=X.map(F=>Object.assign({},F))),I&&(R._redirectEventId=I),R}static async _fromIdTokenResponse(e,t,i=!1){const r=new Ja;r.updateFromServerResponse(t);const o=new br({uid:t.localId,auth:e,stsTokenManager:r,isAnonymous:i});return await Hd(o),o}static async _fromGetAccountInfoResponse(e,t,i){const r=t.users[0];Te(r.localId!==void 0,"internal-error");const o=r.providerUserInfo!==void 0?KS(r.providerUserInfo):[],l=!(r.email&&r.passwordHash)&&!(o!=null&&o.length),u=new Ja;u.updateFromIdToken(i);const h=new br({uid:r.localId,auth:e,stsTokenManager:u,isAnonymous:l}),p={uid:r.localId,displayName:r.displayName||null,photoURL:r.photoUrl||null,email:r.email||null,emailVerified:r.emailVerified||!1,phoneNumber:r.phoneNumber||null,tenantId:r.tenantId||null,providerData:o,metadata:new Wg(r.createdAt,r.lastLoginAt),isAnonymous:!(r.email&&r.passwordHash)&&!(o!=null&&o.length)};return Object.assign(h,p),h}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const h1=new Map;function Er(n){Or(n instanceof Function,"Expected a class definition");let e=h1.get(n);return e?(Or(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,h1.set(n,e),e)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class QS{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}QS.type="NONE";const d1=QS;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function dd(n,e,t){return`firebase:${n}:${e}:${t}`}class Za{constructor(e,t,i){this.persistence=e,this.auth=t,this.userKey=i;const{config:r,name:o}=this.auth;this.fullUserKey=dd(this.userKey,r.apiKey,o),this.fullPersistenceKey=dd("persistence",r.apiKey,o),this.boundEventHandler=t._onStorageEvent.bind(t),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?br._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,t,i="authUser"){if(!t.length)return new Za(Er(d1),e,i);const r=(await Promise.all(t.map(async p=>{if(await p._isAvailable())return p}))).filter(p=>p);let o=r[0]||Er(d1);const l=dd(i,e.config.apiKey,e.name);let u=null;for(const p of t)try{const g=await p._get(l);if(g){const y=br._fromJSON(e,g);p!==o&&(u=y),o=p;break}}catch{}const h=r.filter(p=>p._shouldAllowMigration);return!o._shouldAllowMigration||!h.length?new Za(o,e,i):(o=h[0],u&&await o._set(l,u.toJSON()),await Promise.all(t.map(async p=>{if(p!==o)try{await p._remove(l)}catch{}})),new Za(o,e,i))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function f1(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(ZS(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(YS(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(tC(e))return"Blackberry";if(nC(e))return"Webos";if(XS(e))return"Safari";if((e.includes("chrome/")||JS(e))&&!e.includes("edge/"))return"Chrome";if(eC(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,i=n.match(t);if((i==null?void 0:i.length)===2)return i[1]}return"Other"}function YS(n=fn()){return/firefox\//i.test(n)}function XS(n=fn()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function JS(n=fn()){return/crios\//i.test(n)}function ZS(n=fn()){return/iemobile/i.test(n)}function eC(n=fn()){return/android/i.test(n)}function tC(n=fn()){return/blackberry/i.test(n)}function nC(n=fn()){return/webos/i.test(n)}function Ov(n=fn()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function iF(n=fn()){var e;return Ov(n)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function rF(){return cO()&&document.documentMode===10}function iC(n=fn()){return Ov(n)||eC(n)||nC(n)||tC(n)||/windows phone/i.test(n)||ZS(n)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function rC(n,e=[]){let t;switch(n){case"Browser":t=f1(fn());break;case"Worker":t=`${f1(fn())}-${n}`;break;default:t=n}const i=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${vl}/${i}`}/** * @license * Copyright 2022 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class sF{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const i=o=>new Promise((l,u)=>{try{const h=e(o);l(h)}catch(h){u(h)}});i.onAbort=t,this.queue.push(i);const r=this.queue.length-1;return()=>{this.queue[r]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const i of this.queue)await i(e),i.onAbort&&t.push(i.onAbort)}catch(i){t.reverse();for(const r of t)try{r()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:i==null?void 0:i.message})}}}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function oF(n,e={}){return Hs(n,"GET","/v2/passwordPolicy",Ho(n,e))}/** * @license * Copyright 2023 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const aF=6;class lF{constructor(e){var t,i,r,o;const l=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(t=l.minPasswordLength)!==null&&t!==void 0?t:aF,l.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=l.maxPasswordLength),l.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=l.containsLowercaseCharacter),l.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=l.containsUppercaseCharacter),l.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=l.containsNumericCharacter),l.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=l.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(r=(i=e.allowedNonAlphanumericCharacters)===null||i===void 0?void 0:i.join(""))!==null&&r!==void 0?r:"",this.forceUpgradeOnSignin=(o=e.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var t,i,r,o,l,u;const h={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,h),this.validatePasswordCharacterOptions(e,h),h.isValid&&(h.isValid=(t=h.meetsMinPasswordLength)!==null&&t!==void 0?t:!0),h.isValid&&(h.isValid=(i=h.meetsMaxPasswordLength)!==null&&i!==void 0?i:!0),h.isValid&&(h.isValid=(r=h.containsLowercaseLetter)!==null&&r!==void 0?r:!0),h.isValid&&(h.isValid=(o=h.containsUppercaseLetter)!==null&&o!==void 0?o:!0),h.isValid&&(h.isValid=(l=h.containsNumericCharacter)!==null&&l!==void 0?l:!0),h.isValid&&(h.isValid=(u=h.containsNonAlphanumericCharacter)!==null&&u!==void 0?u:!0),h}validatePasswordLengthOptions(e,t){const i=this.customStrengthOptions.minPasswordLength,r=this.customStrengthOptions.maxPasswordLength;i&&(t.meetsMinPasswordLength=e.length>=i),r&&(t.meetsMaxPasswordLength=e.length<=r)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let i;for(let r=0;r<e.length;r++)i=e.charAt(r),this.updatePasswordCharacterOptionsStatuses(t,i>="a"&&i<="z",i>="A"&&i<="Z",i>="0"&&i<="9",this.allowedNonAlphanumericCharacters.includes(i))}updatePasswordCharacterOptionsStatuses(e,t,i,r,o){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=i)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=r)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=o))}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class cF{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new p1(this),this.idTokenSubscription=new p1(this),this.beforeStateQueue=new sF(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=qS,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=Er(t)),this._initializationPromise=this.queue(async()=>{var i,r;if(!this._deleted&&(this.persistenceManager=await Za.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(t),this.lastNotifiedUid=((r=this.currentUser)===null||r===void 0?void 0:r.uid)||null,!this._deleted&&(this._isInitialized=!0)}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await GS(this,{idToken:e}),i=await br._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var t;if(ai(this.app)){const l=this.app.settings.authIdToken;return l?new Promise(u=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(l).then(u,u))}):this.directlySetCurrentUser(null)}const i=await this.assertedPersistence.getCurrentUser();let r=i,o=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const l=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,u=r==null?void 0:r._redirectEventId,h=await this.tryRedirectSignIn(e);(!l||l===u)&&(h!=null&&h.user)&&(r=h.user,o=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(o)try{await this.beforeStateQueue.runMiddleware(r)}catch(l){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(l))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Te(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await Hd(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=B6()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(ai(this.app))return Promise.reject(Cs(this));const t=e?Mt(e):null;return t&&Te(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Te(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return ai(this.app)?Promise.reject(Cs(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return ai(this.app)?Promise.reject(Cs(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(Er(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await oF(this),t=new lF(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new gu("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),await nF(this,i)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}async _setRedirectUser(e,t){const i=await this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&Er(e)||this._popupRedirectResolver;Te(t,this,"argument-error"),this.redirectPersistenceManager=await Za.create(this,[Er(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,i;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};const o=typeof t=="function"?t:t.next.bind(t);let l=!1;const u=this._isInitialized?Promise.resolve():this._initializationPromise;if(Te(u,this,"internal-error"),u.then(()=>{l||o(this.currentUser)}),typeof t=="function"){const h=e.addObserver(t,i,r);return()=>{l=!0,h()}}else{const h=e.addObserver(t);return()=>{l=!0,h()}}}async directlySetCurrentUser(e){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?await this.assertedPersistence.setCurrentUser(e):await this.assertedPersistence.removeCurrentUser()}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Te(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=rC(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());i&&(t["X-Firebase-Client"]=i);const r=await this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t}async _getAppCheckToken(){var e;if(ai(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const t=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return t!=null&&t.error&&V6(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token}}function Wo(n){return Mt(n)}class p1{constructor(e){this.auth=e,this.observer=null,this.addObserver=yO(t=>this.observer=t)}get next(){return Te(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */let Af={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function uF(n){Af=n}function sC(n){return Af.loadJS(n)}function hF(){return Af.recaptchaEnterpriseScript}function dF(){return Af.gapiScript}function fF(n){return`__${n}${Math.floor(Math.random()*1e6)}`}class pF{constructor(){this.enterprise=new mF}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class mF{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}const gF="recaptcha-enterprise",oC="NO_RECAPTCHA";class yF{constructor(e){this.type=gF,this.auth=Wo(e)}async verify(e="verify",t=!1){async function i(o){if(!t){if(o.tenantId==null&&o._agentRecaptchaConfig!=null)return o._agentRecaptchaConfig.siteKey;if(o.tenantId!=null&&o._tenantRecaptchaConfigs[o.tenantId]!==void 0)return o._tenantRecaptchaConfigs[o.tenantId].siteKey}return new Promise(async(l,u)=>{K6(o,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(h=>{if(h.recaptchaKey===void 0)u(new Error("recaptcha Enterprise site key undefined"));else{const p=new G6(h);return o.tenantId==null?o._agentRecaptchaConfig=p:o._tenantRecaptchaConfigs[o.tenantId]=p,l(p.siteKey)}}).catch(h=>{u(h)})})}function r(o,l,u){const h=window.grecaptcha;c1(h)?h.enterprise.ready(()=>{h.enterprise.execute(o,{action:e}).then(p=>{l(p)}).catch(()=>{l(oC)})}):u(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new pF().execute("siteKey",{action:"verify"}):new Promise((o,l)=>{i(this.auth).then(u=>{if(!t&&c1(window.grecaptcha))r(u,o,l);else{if(typeof window>"u"){l(new Error("RecaptchaVerifier is only supported in browser"));return}let h=hF();h.length!==0&&(h+=u),sC(h).then(()=>{r(u,o,l)}).catch(p=>{l(p)})}}).catch(u=>{l(u)})})}}async function m1(n,e,t,i=!1,r=!1){const o=new yF(n);let l;if(r)l=oC;else try{l=await o.verify(t)}catch{l=await o.verify(t,!0)}const u=Object.assign({},e);if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in u){const h=u.phoneEnrollmentInfo.phoneNumber,p=u.phoneEnrollmentInfo.recaptchaToken;Object.assign(u,{phoneEnrollmentInfo:{phoneNumber:h,recaptchaToken:p,captchaResponse:l,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in u){const h=u.phoneSignInInfo.recaptchaToken;Object.assign(u,{phoneSignInInfo:{recaptchaToken:h,captchaResponse:l,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return u}return i?Object.assign(u,{captchaResp:l}):Object.assign(u,{captchaResponse:l}),Object.assign(u,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(u,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),u}async function g1(n,e,t,i,r){var o;if(!((o=n._getRecaptchaConfig())===null||o===void 0)&&o.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const l=await m1(n,e,t,t==="getOobCode");return i(n,l)}else return i(n,e).catch(async l=>{if(l.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const u=await m1(n,e,t,t==="getOobCode");return i(n,u)}else return Promise.reject(l)})}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function vF(n,e){const t=Wy(n,"auth");if(t.isInitialized()){const r=t.getImmediate(),o=t.getOptions();if(Do(o,e??{}))return r;ui(r,"already-initialized")}return t.initialize({options:e})}function xF(n,e){const t=(e==null?void 0:e.persistence)||[],i=(Array.isArray(t)?t:[t]).map(Er);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(i,e==null?void 0:e.popupRedirectResolver)}function wF(n,e,t){const i=Wo(n);Te(/^https?:\/\//.test(e),i,"invalid-emulator-scheme");const r=!1,o=aC(e),{host:l,port:u}=_F(e),h=u===null?"":`:${u}`,p={url:`${o}//${l}${h}/`},g=Object.freeze({host:l,port:u,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:r})});if(!i._canInitEmulator){Te(i.config.emulator&&i.emulatorConfig,i,"emulator-config-failed"),Te(Do(p,i.config.emulator)&&Do(g,i.emulatorConfig),i,"emulator-config-failed");return}i.config.emulator=p,i.emulatorConfig=g,i.settings.appVerificationDisabledForTesting=!0,bF()}function aC(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function _F(n){const e=aC(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const i=t[2].split("@").pop()||"",r=/^(\[[^\]]+\])(:|$)/.exec(i);if(r){const o=r[1];return{host:o,port:y1(i.substr(o.length+1))}}else{const[o,l]=i.split(":");return{host:o,port:y1(l)}}}function y1(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function bF(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Lv{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return _r("not implemented")}_getIdTokenResponse(e){return _r("not implemented")}_linkToIdToken(e,t){return _r("not implemented")}_getReauthenticationResolver(e){return _r("not implemented")}}async function EF(n,e){return Hs(n,"POST","/v1/accounts:signUp",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function TF(n,e){return Pf(n,"POST","/v1/accounts:signInWithPassword",Ho(n,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function SF(n,e){return Pf(n,"POST","/v1/accounts:signInWithEmailLink",Ho(n,e))}async function CF(n,e){return Pf(n,"POST","/v1/accounts:signInWithEmailLink",Ho(n,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class uu extends Lv{constructor(e,t,i,r=null){super("password",i),this._email=e,this._password=t,this._tenantId=r}static _fromEmailAndPassword(e,t){return new uu(e,t,"password")}static _fromEmailAndCode(e,t,i=null){return new uu(e,t,"emailLink",i)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t!=null&&t.email&&(t!=null&&t.password)){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return g1(e,t,"signInWithPassword",TF);case"emailLink":return SF(e,{email:this._email,oobCode:this._password});default:ui(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const i={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return g1(e,i,"signUpPassword",EF);case"emailLink":return CF(e,{idToken:t,email:this._email,oobCode:this._password});default:ui(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function el(n,e){return Pf(n,"POST","/v1/accounts:signInWithIdp",Ho(n,e))}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const IF="http://localhost";class Vo extends Lv{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new Vo(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):ui("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:i,signInMethod:r}=t,o=Nv(t,["providerId","signInMethod"]);if(!i||!r)return null;const l=new Vo(i,r);return l.idToken=o.idToken||void 0,l.accessToken=o.accessToken||void 0,l.secret=o.secret,l.nonce=o.nonce,l.pendingToken=o.pendingToken||null,l}_getIdTokenResponse(e){const t=this.buildRequest();return el(e,t)}_linkToIdToken(e,t){const i=this.buildRequest();return i.idToken=t,el(e,i)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,el(e,t)}buildRequest(){const e={requestUri:IF,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=yu(t)}return e}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function kF(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function PF(n){const e=Tc(Sc(n)).link,t=e?Tc(Sc(e)).deep_link_id:null,i=Tc(Sc(n)).deep_link_id;return(i?Tc(Sc(i)).link:null)||i||t||e||n}class Vv{constructor(e){var t,i,r,o,l,u;const h=Tc(Sc(e)),p=(t=h.apiKey)!==null&&t!==void 0?t:null,g=(i=h.oobCode)!==null&&i!==void 0?i:null,y=kF((r=h.mode)!==null&&r!==void 0?r:null);Te(p&&g&&y,"argument-error"),this.apiKey=p,this.operation=y,this.code=g,this.continueUrl=(o=h.continueUrl)!==null&&o!==void 0?o:null,this.languageCode=(l=h.languageCode)!==null&&l!==void 0?l:null,this.tenantId=(u=h.tenantId)!==null&&u!==void 0?u:null}static parseLink(e){const t=PF(e);try{return new Vv(t)}catch{return null}}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Tl{constructor(){this.providerId=Tl.PROVIDER_ID}static credential(e,t){return uu._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const i=Vv.parseLink(t);return Te(i,"argument-error"),uu._fromEmailAndCode(e,i.code,i.tenantId)}}Tl.PROVIDER_ID="password";Tl.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Tl.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Fv{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Su extends Fv{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ds extends Su{constructor(){super("facebook.com")}static credential(e){return Vo._fromParams({providerId:ds.PROVIDER_ID,signInMethod:ds.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ds.credentialFromTaggedObject(e)}static credentialFromError(e){return ds.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ds.credential(e.oauthAccessToken)}catch{return null}}}ds.FACEBOOK_SIGN_IN_METHOD="facebook.com";ds.PROVIDER_ID="facebook.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wr extends Su{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return Vo._fromParams({providerId:wr.PROVIDER_ID,signInMethod:wr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return wr.credentialFromTaggedObject(e)}static credentialFromError(e){return wr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:i}=e;if(!t&&!i)return null;try{return wr.credential(t,i)}catch{return null}}}wr.GOOGLE_SIGN_IN_METHOD="google.com";wr.PROVIDER_ID="google.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fs extends Su{constructor(){super("github.com")}static credential(e){return Vo._fromParams({providerId:fs.PROVIDER_ID,signInMethod:fs.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return fs.credentialFromTaggedObject(e)}static credentialFromError(e){return fs.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return fs.credential(e.oauthAccessToken)}catch{return null}}}fs.GITHUB_SIGN_IN_METHOD="github.com";fs.PROVIDER_ID="github.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class ps extends Su{constructor(){super("twitter.com")}static credential(e,t){return Vo._fromParams({providerId:ps.PROVIDER_ID,signInMethod:ps.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return ps.credentialFromTaggedObject(e)}static credentialFromError(e){return ps.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:i}=e;if(!t||!i)return null;try{return ps.credential(t,i)}catch{return null}}}ps.TWITTER_SIGN_IN_METHOD="twitter.com";ps.PROVIDER_ID="twitter.com";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class pl{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,i,r=!1){const o=await br._fromIdTokenResponse(e,i,r),l=v1(i);return new pl({user:o,providerId:l,_tokenResponse:i,operationType:t})}static async _forOperation(e,t,i){await e._updateTokensIfNecessary(i,!0);const r=v1(i);return new pl({user:e,providerId:r,_tokenResponse:i,operationType:t})}}function v1(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Wd extends Lr{constructor(e,t,i,r){var o;super(t.code,t.message),this.operationType=i,this.user=r,Object.setPrototypeOf(this,Wd.prototype),this.customData={appName:e.name,tenantId:(o=e.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:t.customData._serverResponse,operationType:i}}static _fromErrorAndOperation(e,t,i,r){return new Wd(e,t,i,r)}}function lC(n,e,t,i){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?Wd._fromErrorAndOperation(n,o,e,i):o})}async function AF(n,e,t=!1){const i=await cu(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return pl._forOperation(n,"link",i)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function NF(n,e,t=!1){const{auth:i}=n;if(ai(i.app))return Promise.reject(Cs(i));const r="reauthenticate";try{const o=await cu(n,lC(i,r,e,n),t);Te(o.idToken,i,"internal-error");const l=Mv(o.idToken);Te(l,i,"internal-error");const{sub:u}=l;return Te(n.uid===u,i,"user-mismatch"),pl._forOperation(n,r,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&ui(i,"user-mismatch"),o}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function cC(n,e,t=!1){if(ai(n.app))return Promise.reject(Cs(n));const i="signIn",r=await lC(n,i,e),o=await pl._fromIdTokenResponse(n,i,r);return t||await n._updateCurrentUser(o.user),o}async function RF(n,e){return cC(Wo(n),e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function jF(n){const e=Wo(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}function DF(n,e,t){return ai(n.app)?Promise.reject(Cs(n)):RF(Mt(n),Tl.credential(e,t)).catch(async i=>{throw i.code==="auth/password-does-not-meet-requirements"&&jF(n),i})}function MF(n,e,t,i){return Mt(n).onIdTokenChanged(e,t,i)}function OF(n,e,t){return Mt(n).beforeAuthStateChanged(e,t)}function uC(n,e,t,i){return Mt(n).onAuthStateChanged(e,t,i)}function Gg(n){return Mt(n).signOut()}const Gd="__sak";/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class hC{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(Gd,"1"),this.storage.removeItem(Gd),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const LF=1e3,VF=10;class dC extends hC{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=iC(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const i=this.storage.getItem(t),r=this.localCache[t];i!==r&&e(t,r,i)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((l,u,h)=>{this.notifyListeners(l,h)});return}const i=e.key;t?this.detachListener():this.stopPolling();const r=()=>{const l=this.storage.getItem(i);!t&&this.localCache[i]===l||this.notifyListeners(i,l)},o=this.storage.getItem(i);rF()&&o!==e.newValue&&e.newValue!==e.oldValue?setTimeout(r,VF):r()}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,i)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:i}),!0)})},LF)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}dC.type="LOCAL";const FF=dC;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class fC extends hC{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}fC.type="SESSION";const pC=fC;/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function UF(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class Nf{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(r=>r.isListeningto(e));if(t)return t;const i=new Nf(e);return this.receivers.push(i),i}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:i,eventType:r,data:o}=t.data,l=this.handlersMap[r];if(!(l!=null&&l.size))return;t.ports[0].postMessage({status:"ack",eventId:i,eventType:r});const u=Array.from(l).map(async p=>p(t.origin,o)),h=await UF(u);t.ports[0].postMessage({status:"done",eventId:i,eventType:r,response:h})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Nf.receivers=[];/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Uv(n="",e=10){let t="";for(let i=0;i<e;i++)t+=Math.floor(Math.random()*10);return n+t}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zF{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,i=50){const r=typeof MessageChannel<"u"?new MessageChannel:null;if(!r)throw new Error("connection_unavailable");let o,l;return new Promise((u,h)=>{const p=Uv("",20);r.port1.start();const g=setTimeout(()=>{h(new Error("unsupported_event"))},i);l={messageChannel:r,onMessage(y){const x=y;if(x.data.eventId===p)switch(x.data.status){case"ack":clearTimeout(g),o=setTimeout(()=>{h(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),u(x.data.response);break;default:clearTimeout(g),clearTimeout(o),h(new Error("invalid_response"));break}}},this.handlers.add(l),r.port1.addEventListener("message",l.onMessage),this.target.postMessage({eventType:e,eventId:p,data:t},[r.port2])}).finally(()=>{l&&this.removeMessageHandler(l)})}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function Ji(){return window}function BF(n){Ji().location.href=n}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function mC(){return typeof Ji().WorkerGlobalScope<"u"&&typeof Ji().importScripts=="function"}async function qF(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function $F(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)===null||n===void 0?void 0:n.controller)||null}function HF(){return mC()?self:null}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const gC="firebaseLocalStorageDb",WF=1,Kd="firebaseLocalStorage",yC="fbase_key";class Cu{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function Rf(n,e){return n.transaction([Kd],e?"readwrite":"readonly").objectStore(Kd)}function GF(){const n=indexedDB.deleteDatabase(gC);return new Cu(n).toPromise()}function Kg(){const n=indexedDB.open(gC,WF);return new Promise((e,t)=>{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const i=n.result;try{i.createObjectStore(Kd,{keyPath:yC})}catch(r){t(r)}}),n.addEventListener("success",async()=>{const i=n.result;i.objectStoreNames.contains(Kd)?e(i):(i.close(),await GF(),e(await Kg()))})})}async function x1(n,e,t){const i=Rf(n,!0).put({[yC]:e,value:t});return new Cu(i).toPromise()}async function KF(n,e){const t=Rf(n,!1).get(e),i=await new Cu(t).toPromise();return i===void 0?null:i.value}function w1(n,e){const t=Rf(n,!0).delete(e);return new Cu(t).toPromise()}const QF=800,YF=3;class vC{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.db?this.db:(this.db=await Kg(),this.db)}async _withRetries(e){let t=0;for(;;)try{const i=await this._openDb();return await e(i)}catch(i){if(t++>YF)throw i;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return mC()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=Nf._getInstance(HF()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var e,t;if(this.activeServiceWorker=await qF(),!this.activeServiceWorker)return;this.sender=new zF(this.activeServiceWorker);const i=await this.sender._send("ping",{},800);i&&!((e=i[0])===null||e===void 0)&&e.fulfilled&&!((t=i[0])===null||t===void 0)&&t.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||$F()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{if(!indexedDB)return!1;const e=await Kg();return await x1(e,Gd,"1"),await w1(e,Gd),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(i=>x1(i,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(i=>KF(i,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>w1(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(r=>{const o=Rf(r,!1).getAll();return new Cu(o).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],i=new Set;if(e.length!==0)for(const{fbase_key:r,value:o}of e)i.add(r),JSON.stringify(this.localCache[r])!==JSON.stringify(o)&&(this.notifyListeners(r,o),t.push(r));for(const r of Object.keys(this.localCache))this.localCache[r]&&!i.has(r)&&(this.notifyListeners(r,null),t.push(r));return t}notifyListeners(e,t){this.localCache[e]=t;const i=this.listeners[e];if(i)for(const r of Array.from(i))r(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),QF)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}vC.type="LOCAL";const XF=vC;new Tu(3e4,6e4);/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function xC(n,e){return e?Er(e):(Te(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/** * @license * Copyright 2019 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zv extends Lv{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return el(e,this._buildIdpRequest())}_linkToIdToken(e,t){return el(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return el(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function JF(n){return cC(n.auth,new zv(n),n.bypassAuthState)}function ZF(n){const{auth:e,user:t}=n;return Te(t,e,"internal-error"),NF(t,new zv(n),n.bypassAuthState)}async function eU(n){const{auth:e,user:t}=n;return Te(t,e,"internal-error"),AF(t,new zv(n),n.bypassAuthState)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class wC{constructor(e,t,i,r,o=!1){this.auth=e,this.resolver=i,this.user=r,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(i){this.reject(i)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:i,postBody:r,tenantId:o,error:l,type:u}=e;if(l){this.reject(l);return}const h={auth:this.auth,requestUri:t,sessionId:i,tenantId:o||void 0,postBody:r||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(u)(h))}catch(p){this.reject(p)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return JF;case"linkViaPopup":case"linkViaRedirect":return eU;case"reauthViaPopup":case"reauthViaRedirect":return ZF;default:ui(this.auth,"internal-error")}}resolve(e){Or(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Or(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const tU=new Tu(2e3,1e4);async function nU(n,e,t){if(ai(n.app))return Promise.reject(Ai(n,"operation-not-supported-in-this-environment"));const i=Wo(n);F6(n,e,Fv);const r=xC(i,t);return new Io(i,"signInViaPopup",e,r).executeNotNull()}class Io extends wC{constructor(e,t,i,r,o){super(e,t,r,o),this.provider=i,this.authWindow=null,this.pollId=null,Io.currentPopupAction&&Io.currentPopupAction.cancel(),Io.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Te(e,this.auth,"internal-error"),e}async onExecution(){Or(this.filter.length===1,"Popup operations only handle one event");const e=Uv();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Ai(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)===null||e===void 0?void 0:e.associatedEvent)||null}cancel(){this.reject(Ai(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Io.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,i;if(!((i=(t=this.authWindow)===null||t===void 0?void 0:t.window)===null||i===void 0)&&i.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Ai(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,tU.get())};e()}}Io.currentPopupAction=null;/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const iU="pendingRedirect",fd=new Map;class rU extends wC{constructor(e,t,i=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,i),this.eventId=null}async execute(){let e=fd.get(this.auth._key());if(!e){try{const i=await sU(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(i)}catch(t){e=()=>Promise.reject(t)}fd.set(this.auth._key(),e)}return this.bypassAuthState||fd.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function sU(n,e){const t=lU(e),i=aU(n);if(!await i._isAvailable())return!1;const r=await i._get(t)==="true";return await i._remove(t),r}function oU(n,e){fd.set(n._key(),e)}function aU(n){return Er(n._redirectPersistence)}function lU(n){return dd(iU,n.config.apiKey,n.name)}async function cU(n,e,t=!1){if(ai(n.app))return Promise.reject(Cs(n));const i=Wo(n),r=xC(i,e),l=await new rU(i,r,t).execute();return l&&!t&&(delete l.user._redirectEventId,await i._persistUserIfCurrent(l.user),await i._setRedirectUser(null,e)),l}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const uU=10*60*1e3;class hU{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(i=>{this.isEventForConsumer(e,i)&&(t=!0,this.sendToConsumer(e,i),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!dU(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var i;if(e.error&&!_C(e)){const r=((i=e.error.code)===null||i===void 0?void 0:i.split("auth/")[1])||"internal-error";t.onError(Ai(this.auth,r))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const i=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&i}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=uU&&this.cachedEventUids.clear(),this.cachedEventUids.has(_1(e))}saveEventToCache(e){this.cachedEventUids.add(_1(e)),this.lastProcessedEventTime=Date.now()}}function _1(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function _C({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function dU(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return _C(n);default:return!1}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */async function fU(n,e={}){return Hs(n,"GET","/v1/projects",e)}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const pU=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,mU=/^https?/;async function gU(n){if(n.config.emulator)return;const{authorizedDomains:e}=await fU(n);for(const t of e)try{if(yU(t))return}catch{}ui(n,"unauthorized-domain")}function yU(n){const e=Hg(),{protocol:t,hostname:i}=new URL(e);if(n.startsWith("chrome-extension://")){const l=new URL(n);return l.hostname===""&&i===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&l.hostname===i}if(!mU.test(t))return!1;if(pU.test(n))return i===n;const r=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+r+"|"+r+")$","i").test(i)}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const vU=new Tu(3e4,6e4);function b1(){const n=Ji().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function xU(n){return new Promise((e,t)=>{var i,r,o;function l(){b1(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{b1(),t(Ai(n,"network-request-failed"))},timeout:vU.get()})}if(!((r=(i=Ji().gapi)===null||i===void 0?void 0:i.iframes)===null||r===void 0)&&r.Iframe)e(gapi.iframes.getContext());else if(!((o=Ji().gapi)===null||o===void 0)&&o.load)l();else{const u=fF("iframefcb");return Ji()[u]=()=>{gapi.load?l():t(Ai(n,"network-request-failed"))},sC(`${dF()}?onload=${u}`).catch(h=>t(h))}}).catch(e=>{throw pd=null,e})}let pd=null;function wU(n){return pd=pd||xU(n),pd}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const _U=new Tu(5e3,15e3),bU="__/auth/iframe",EU="emulator/auth/iframe",TU={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},SU=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function CU(n){const e=n.config;Te(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?Dv(e,EU):`https://${n.config.authDomain}/${bU}`,i={apiKey:e.apiKey,appName:n.name,v:vl},r=SU.get(n.config.apiHost);r&&(i.eid=r);const o=n._getFrameworks();return o.length&&(i.fw=o.join(",")),`${t}?${yu(i).slice(1)}`}async function IU(n){const e=await wU(n),t=Ji().gapi;return Te(t,n,"internal-error"),e.open({where:document.body,url:CU(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:TU,dontclear:!0},i=>new Promise(async(r,o)=>{await i.restyle({setHideOnLeave:!1});const l=Ai(n,"network-request-failed"),u=Ji().setTimeout(()=>{o(l)},_U.get());function h(){Ji().clearTimeout(u),r(i)}i.ping(h).then(h,()=>{o(l)})}))}/** * @license * Copyright 2020 Google LLC. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const kU={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},PU=500,AU=600,NU="_blank",RU="http://localhost";class E1{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function jU(n,e,t,i=PU,r=AU){const o=Math.max((window.screen.availHeight-r)/2,0).toString(),l=Math.max((window.screen.availWidth-i)/2,0).toString();let u="";const h=Object.assign(Object.assign({},kU),{width:i.toString(),height:r.toString(),top:o,left:l}),p=fn().toLowerCase();t&&(u=JS(p)?NU:t),YS(p)&&(e=e||RU,h.scrollbars="yes");const g=Object.entries(h).reduce((x,[b,T])=>`${x}${b}=${T},`,"");if(iF(p)&&u!=="_self")return DU(e||"",u),new E1(null);const y=window.open(e||"",u,g);Te(y,n,"popup-blocked");try{y.focus()}catch{}return new E1(y)}function DU(n,e){const t=document.createElement("a");t.href=n,t.target=e;const i=document.createEvent("MouseEvent");i.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(i)}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const MU="__/auth/handler",OU="emulator/auth/handler",LU=encodeURIComponent("fac");async function T1(n,e,t,i,r,o){Te(n.config.authDomain,n,"auth-domain-config-required"),Te(n.config.apiKey,n,"invalid-api-key");const l={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:i,v:vl,eventId:r};if(e instanceof Fv){e.setDefaultLanguage(n.languageCode),l.providerId=e.providerId||"",gO(e.getCustomParameters())||(l.customParameters=JSON.stringify(e.getCustomParameters()));for(const[g,y]of Object.entries({}))l[g]=y}if(e instanceof Su){const g=e.getScopes().filter(y=>y!=="");g.length>0&&(l.scopes=g.join(","))}n.tenantId&&(l.tid=n.tenantId);const u=l;for(const g of Object.keys(u))u[g]===void 0&&delete u[g];const h=await n._getAppCheckToken(),p=h?`#${LU}=${encodeURIComponent(h)}`:"";return`${VU(n)}?${yu(u).slice(1)}${p}`}function VU({config:n}){return n.emulator?Dv(n,OU):`https://${n.authDomain}/${MU}`}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const Xm="webStorageSupport";class FU{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=pC,this._completeRedirectFn=cU,this._overrideRedirectResult=oU}async _openPopup(e,t,i,r){var o;Or((o=this.eventManagers[e._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const l=await T1(e,t,i,Hg(),r);return jU(e,l,Uv())}async _openRedirect(e,t,i,r){await this._originValidation(e);const o=await T1(e,t,i,Hg(),r);return BF(o),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:r,promise:o}=this.eventManagers[t];return r?Promise.resolve(r):(Or(o,"If manager is not set, promise should be"),o)}const i=this.initAndGetManager(e);return this.eventManagers[t]={promise:i},i.catch(()=>{delete this.eventManagers[t]}),i}async initAndGetManager(e){const t=await IU(e),i=new hU(e);return t.register("authEvent",r=>(Te(r==null?void 0:r.authEvent,e,"invalid-auth-event"),{status:i.onEvent(r.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:i},this.iframes[e._key()]=t,i}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(Xm,{type:Xm},r=>{var o;const l=(o=r==null?void 0:r[0])===null||o===void 0?void 0:o[Xm];l!==void 0&&t(!!l),ui(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=gU(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return iC()||XS()||Ov()}}const UU=FU;var S1="@firebase/auth",C1="1.9.1";/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */class zU{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)===null||e===void 0?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(i=>{e((i==null?void 0:i.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Te(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/** * @license * Copyright 2020 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */function BU(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function qU(n){ol(new Mo("auth",(e,{options:t})=>{const i=e.getProvider("app").getImmediate(),r=e.getProvider("heartbeat"),o=e.getProvider("app-check-internal"),{apiKey:l,authDomain:u}=i.options;Te(l&&!l.includes(":"),"invalid-api-key",{appName:i.name});const h={apiKey:l,authDomain:u,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:rC(n)},p=new cF(i,r,o,h);return xF(p,t),p},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,i)=>{e.getProvider("auth-internal").initialize()})),ol(new Mo("auth-internal",e=>{const t=Wo(e.getProvider("auth").getImmediate());return(i=>new zU(i))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),Es(S1,C1,BU(n)),Es(S1,C1,"esm2017")}/** * @license * Copyright 2021 Google LLC * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */const $U=5*60,HU=iT("authIdTokenMaxAge")||$U;let I1=null;const WU=n=>async e=>{const t=e&&await e.getIdTokenResult(),i=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(i&&i>HU)return;const r=t==null?void 0:t.token;I1!==r&&(I1=r,await fetch(n,{method:r?"POST":"DELETE",headers:r?{Authorization:`Bearer ${r}`}:{}}))};function Ac(n=aT()){const e=Wy(n,"auth");if(e.isInitialized())return e.getImmediate();const t=vF(n,{popupRedirectResolver:UU,persistence:[XF,FF,pC]}),i=iT("authTokenSyncURL");if(i&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(i,location.origin);if(location.origin===o.origin){const l=WU(o.toString());OF(t,l,()=>l(t.currentUser)),MF(t,u=>l(u))}}const r=tT("auth");return r&&wF(t,`http://${r}`),t}function GU(){var n,e;return(e=(n=document.getElementsByTagName("head"))===null||n===void 0?void 0:n[0])!==null&&e!==void 0?e:document}uF({loadJS(n){return new Promise((e,t)=>{const i=document.createElement("script");i.setAttribute("src",n),i.onload=e,i.onerror=r=>{const o=Ai("internal-error");o.customData=r,t(o)},i.type="text/javascript",i.charset="UTF-8",GU().appendChild(i)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});qU("Browser");const KU={apiKey:"AIzaSyC5tUkSbGtExEOlTKoc6wa52q-_nHKEu_0",authDomain:"iiitd-crypto-lab.firebaseapp.com",projectId:"iiitd-crypto-lab",storageBucket:"iiitd-crypto-lab.firebasestorage.app",messagingSenderId:"946110268883",appId:"1:946110268883:web:c656eccf9b846d240f9b26"},bC=oT(KU),Qg=Ac(bC),_e=E6(bC),QU=[{name:"Course Information",description:"Access detailed course materials, syllabi, and learning objectives.",icon:Ao,href:"/courses"},{name:"Resource Database",description:"Explore our curated collection of textbooks, papers, and tutorials.",icon:B1,href:"/resources"},{name:"Events",description:"Stay updated with upcoming conferences, seminars, and workshops.",icon:Tr,href:"/events"},{name:"Members",description:"Connect with peers, discuss topics, and share knowledge.",icon:Zi,href:"/members"}];function YU(){var l,u;const[n,e]=V.useState(0),[t,i]=V.useState([]),[r,o]=V.useState(!0);return V.useEffect(()=>{(async()=>{try{const g=(await Ct(Ge(_e,"homeUpdates"))).docs.map(x=>x.data());i(g),o(!1);const y=$g(Ge(_e,"homeUpdates"),x=>{const b=x.docs.map(T=>T.data());i(b)});return()=>y()}catch(p){console.error("Error loading updates:",p),o(!1)}})()},[]),V.useEffect(()=>{if(t.length===0)return;const h=setInterval(()=>{e(p=>(p+1)%t.length)},5e3);return()=>clearInterval(h)},[t]),d.jsx(d.Fragment,{children:d.jsxs("div",{className:"relative min-h-screen bg-transparent",children:[d.jsx(W3,{}),d.jsxs("div",{className:"relative z-10 space-y-12",children:[d.jsxs(te.div,{className:"text-center",initial:{opacity:0,y:-30},animate:{opacity:1,y:0},transition:{duration:.2},children:[d.jsx("h1",{className:"text-4xl font-bold tracking-tight text-white sm:text-6xl",children:"Welcome to VeilCode Labs"}),d.jsx("p",{className:"mt-6 text-lg leading-8 text-[rgb(224,204,250)]",children:"Your comprehensive resource for Applied Cryptography and Topics in Cryptanalysis at IIIT Delhi."}),d.jsxs(te.div,{className:"mt-10 flex items-center justify-center gap-x-6",whileHover:{scale:1.05},children:[d.jsx(kn,{to:"/courses",className:"rounded-md bg-[rgb(136,58,234)] px-3.5 py-2.5 text-sm font-semibold text-white shadow-sm hover:bg-[rgb(49,10,101)] transition-all duration-300",children:"Explore Courses"}),d.jsx(kn,{to:"/about",className:"text-sm font-semibold leading-6 text-[rgb(224,204,250)] hover:text-white transition-colors duration-300",children:"Learn more →"})]})]}),d.jsxs(te.div,{className:"mx-auto max-w-7xl px-6 lg:px-8",initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},children:[d.jsxs("div",{className:"mx-auto max-w-2xl lg:text-center",children:[d.jsx("h2",{className:"text-base font-semibold text-[rgb(224,204,250)]",children:"Everything you need"}),d.jsx("p",{className:"mt-2 text-3xl font-bold tracking-tight text-white sm:text-4xl",children:"Comprehensive Learning Resources"})]}),d.jsx("div",{className:"mx-auto mt-16 max-w-2xl sm:mt-20 lg:mt-24 lg:max-w-none",children:d.jsx("dl",{className:"grid max-w-xl grid-cols-1 gap-x-8 gap-y-16 lg:max-w-none lg:grid-cols-2",children:QU.map((h,p)=>d.jsxs(te.div,{className:"group relative flex flex-col rounded-lg border border-[rgb(136,58,234)] p-6 hover:bg-[rgba(136,58,234,0.1)] transition",initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.2,delay:p*.1},whileHover:{scale:1.05},children:[d.jsxs("dt",{className:"flex items-center gap-x-3 text-base font-semibold leading-7 text-white",children:[d.jsx(h.icon,{className:"h-5 w-5 text-[rgb(136,58,234)] group-hover:text-[rgb(224,204,250)] transition-colors duration-300"}),h.name]}),d.jsx("dd",{className:"mt-4 flex flex-auto flex-col text-base leading-7 text-[rgb(224,204,250)] group-hover:text-white transition-colors duration-300",children:d.jsx("p",{className:"flex-auto",children:h.description})})]},h.name))})})]}),r?d.jsx("div",{className:"text-center text-[rgb(224,204,250)]",children:"Loading updates..."}):t.length>0?d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:"Latest Updates"}),d.jsx("div",{className:"relative h-20 overflow-hidden flex items-center",children:d.jsx(Q1,{mode:"wait",children:d.jsx(te.div,{className:"absolute w-full text-center",initial:{x:"100%",opacity:0},animate:{x:"0%",opacity:1},exit:{x:"-100%",opacity:0},transition:{duration:.7,ease:"easeInOut"},children:d.jsxs("div",{className:"border-l-4 border-[rgb(136,58,234)] pl-4 inline-block",children:[d.jsx("h3",{className:"font-semibold text-[rgb(224,204,250)]",children:((l=t[n])==null?void 0:l.title)||"No updates available"}),d.jsx("p",{className:"text-white",children:((u=t[n])==null?void 0:u.description)||""})]})},n)})})]}):d.jsx("div",{className:"text-center text-[rgb(224,204,250)]",children:"No updates available"})]})]})})}function XU(){var o,l,u,h;const[n,e]=V.useState([]),[t,i]=V.useState(null);Wn(),V.useEffect(()=>{(async()=>{const y=(await Ct(Ge(_e,"courses"))).docs.map(x=>({id:x.id,...x.data()}));e(y)})()},[]);const r=async p=>{const g=ht(_e,"courses",p),y=await Eu(g);y.exists()?i({id:y.id,...y.data()}):console.log("No such course!")};return t?d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8 pb-12",children:[d.jsx(te.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},className:"flex items-center mb-8",children:d.jsxs("button",{onClick:()=>i(null),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:[d.jsx(Is,{className:"h-5 w-5 mr-2 transform rotate-180"}),"Back to Courses"]})}),d.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[d.jsxs("div",{className:"md:col-span-2 space-y-6",children:[d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)]",children:[d.jsx("div",{className:"h-64",children:d.jsx("img",{src:t.image,alt:t.title,className:"w-full h-full object-cover"})}),d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:"mb-4",children:[d.jsx(te.h1,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:.2},className:"text-3xl font-bold text-white mb-2",children:t.title}),d.jsxs("div",{className:"text-[rgb(224,204,250)] space-y-1",children:[d.jsxs("p",{children:["Course Code: ",t.courseCode]}),d.jsxs("p",{children:["Credits: ",t.credits]}),d.jsxs("p",{children:["Offered to: ",t.offeredTo]})]})]}),d.jsx(te.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.3},className:"text-[rgb(224,204,250)] text-lg mb-6",children:t.description}),d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,delay:.4},className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Zi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[t.students," Students"]})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:t.duration})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Ao,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:t.instructor})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(vw,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[t.rating,"/5.0"]})]})]})]})]}),((o=t.courseOutcomes)==null?void 0:o.length)>0&&d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4,delay:.2},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Course Outcomes"}),d.jsx("div",{className:"grid gap-3",children:t.courseOutcomes.map((p,g)=>d.jsx(te.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:g*.1},className:"flex items-start text-[rgb(224,204,250)] p-3 rounded-lg hover:bg-[rgba(49,10,101,0.2)] transition-colors duration-300",children:d.jsxs("span",{children:["CO",g+1,": ",p]})},g))})]})]}),d.jsxs("div",{className:"space-y-6",children:[t.prerequisites&&d.jsxs(te.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.4},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Prerequisites"}),Object.entries(t.prerequisites).map(([p,g])=>g.length>0&&d.jsxs("div",{className:"mb-4 last:mb-0",children:[d.jsxs("h3",{className:"text-[rgb(224,204,250)] font-semibold mb-2 capitalize",children:[p.replace(/([A-Z])/g," $1").trim(),":"]}),d.jsx("ul",{className:"space-y-2",children:g.map((y,x)=>d.jsx(te.li,{className:"flex items-center text-white",children:y},x))})]},p))]}),((l=t.assessment)==null?void 0:l.length)>0&&d.jsxs(te.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.4,delay:.2},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Assessment Plan"}),d.jsx("div",{className:"space-y-3",children:t.assessment.map(({type:p,contribution:g})=>d.jsxs("div",{className:"flex justify-between",children:[d.jsx("span",{className:"text-[rgb(224,204,250)]",children:p}),d.jsxs("span",{className:"text-white",children:[g,"%"]})]},p))})]}),((h=(u=t.resources)==null?void 0:u.textbooks)==null?void 0:h.length)>0&&d.jsxs(te.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.4,delay:.3},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Resource Material"}),d.jsx("div",{className:"space-y-4",children:d.jsxs("div",{children:[d.jsx("h3",{className:"text-[rgb(224,204,250)] font-semibold mb-2",children:"Textbooks"}),d.jsx("ul",{className:"space-y-2",children:t.resources.textbooks.map((p,g)=>d.jsx(te.li,{className:"text-white",children:p},g))})]})})]})]})]})]}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"text-center",children:d.jsx(te.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},className:"text-4xl font-bold text-white mb-4",children:"Cryptography Courses"})}),d.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:n.length>0?n.map((p,g)=>d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:g*.2},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 shadow-lg",children:[d.jsx("div",{className:"h-48",children:d.jsx("img",{src:p.image,alt:p.title,className:"w-full h-full object-cover"})}),d.jsxs("div",{className:"p-6",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:p.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4 text-sm",children:p.description}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-6",children:[d.jsxs("div",{className:"flex items-center text-white text-sm",children:[d.jsx(Zi,{className:"h-4 w-4 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[p.students," Students"]})]}),d.jsxs("div",{className:"flex items-center text-white text-sm",children:[d.jsx(Gi,{className:"h-4 w-4 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:p.duration})]}),d.jsxs("div",{className:"flex items-center text-white text-sm",children:[d.jsx(Ao,{className:"h-4 w-4 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:p.instructor})]}),d.jsxs("div",{className:"flex items-center text-white text-sm",children:[d.jsx(vw,{className:"h-4 w-4 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[p.rating,"/5.0"]})]})]}),d.jsxs("button",{onClick:()=>r(p.id),className:"w-full bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center justify-center",children:["View Course Details",d.jsx(Is,{className:"ml-2 h-4 w-4"})]})]})]},p.id)):d.jsx("p",{className:"text-white text-center col-span-2",children:"No courses available"})})]})}function JU(){var x;const[n,e]=V.useState([]),[t,i]=V.useState(!0),[r,o]=V.useState(null),[l,u]=V.useState(null),h=V.useRef();V.useEffect(()=>{(async()=>{const C=(await Ct(Ge(_e,"events"))).docs.map(I=>({id:I.id,...I.data(),gallery:I.data().gallery||[]}));e(C),i(!1)})()},[]),V.useEffect(()=>{const b=T=>{l&&h.current&&!h.current.contains(T.target)&&y()};return document.addEventListener("mousedown",b),()=>{document.removeEventListener("mousedown",b)}},[l]);const p=async b=>{const T=ht(_e,"events",b),C=await Eu(T);C.exists()?o({id:C.id,...C.data(),gallery:C.data().gallery||[]}):console.log("No such event!")},g=b=>{u(b),document.body.style.overflow="hidden"},y=()=>{u(null),document.body.style.overflow="auto"};return t?d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"text-white",children:"Loading events..."})}):r?d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8 pb-12",children:[d.jsx(te.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},className:"flex items-center mb-8",children:d.jsxs("button",{onClick:()=>o(null),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:[d.jsx(Is,{className:"h-5 w-5 mr-2 transform rotate-180"}),"Back to Events"]})}),l&&d.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",children:d.jsxs("div",{className:"relative max-w-4xl max-h-[90vh] w-full",ref:h,children:[d.jsx("button",{onClick:y,className:"absolute -top-10 right-0 text-white hover:text-[rgb(136,58,234)] transition-colors duration-300 z-10",children:d.jsx(ko,{className:"h-8 w-8"})}),d.jsx("div",{className:"flex justify-center items-center h-full",children:d.jsx("img",{src:l,alt:"Enlarged gallery view",className:"max-w-full max-h-[80vh] object-contain rounded-lg"})})]})}),d.jsxs("div",{className:"grid md:grid-cols-3 gap-8",children:[d.jsx("div",{className:"md:col-span-2 space-y-6",children:d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)]",children:[d.jsx("div",{className:"h-64",children:d.jsx("img",{src:r.image,alt:r.title,className:"w-full h-full object-cover"})}),d.jsxs("div",{className:"p-6",children:[d.jsx(te.h1,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3,delay:.2},className:"text-3xl font-bold text-white mb-4",children:r.title}),d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.4,delay:.4},className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-6",children:[d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Tr,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:r.date})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:r.time})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(gw,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:r.location})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Zi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[r.registered||0,"/",r.capacity||0," Registered"]})]})]}),d.jsx(te.p,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.3},className:"text-[rgb(224,204,250)] text-lg mb-6",children:r.description})]})]})}),d.jsxs("div",{className:"space-y-6",children:[r.eventLink&&d.jsxs(te.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.4},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Event Link"}),d.jsxs(te.a,{href:r.eventLink,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.95},className:"w-full bg-[rgb(136,58,234)] text-white py-3 px-6 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center justify-center",children:["Visit Event Site",d.jsx(ny,{className:"ml-2 h-4 w-4"})]})]}),((x=r.gallery)==null?void 0:x.length)>0&&d.jsxs(te.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{duration:.4,delay:.2},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Event Gallery"}),d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:r.gallery.map((b,T)=>d.jsx(te.div,{whileHover:{scale:1.05},className:"h-48 cursor-pointer",onClick:()=>g(b),children:d.jsx("img",{src:b,alt:`Event gallery ${T+1}`,className:"w-full h-full object-cover rounded-md hover:ring-2 hover:ring-[rgb(136,58,234)] transition-all duration-300"})},T))})]})]})]})]}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsx(te.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},className:"text-4xl font-bold text-white mb-4",children:"Past Events"}),d.jsx(te.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.3},className:"text-[rgb(224,204,250)] text-lg",children:"Stay updated with the latest cryptography events, workshops, and conferences."})]}),d.jsx("div",{className:"grid gap-8",children:n.map((b,T)=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:T*.2},whileHover:{scale:1.05},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 shadow-lg",children:d.jsxs("div",{className:"md:flex",children:[d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:b.image,alt:b.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:"p-6 md:w-2/3",children:[d.jsx("h3",{className:"text-2xl font-bold text-white mb-2",children:b.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4",children:b.description}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Tr,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:b.date})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:b.time})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(gw,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:b.location})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Zi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[b.registered||0,"/",b.capacity||0," Registered"]})]})]}),d.jsxs(te.button,{onClick:()=>p(b.id),whileHover:{scale:1.05},whileTap:{scale:.95},className:"w-full bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center justify-center",children:["View More Details",d.jsx(Is,{className:"ml-2 h-4 w-4"})]})]})]})},b.id))})]})}const ZU=({isOpen:n,onClose:e,videoUrl:t})=>{const i=r=>{if(!r)return"";const o=r.match(/[?&]v=([^&]+)/);return o?o[1]:""};return d.jsx(Q1,{children:n&&d.jsx(te.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"fixed inset-0 z-50 flex items-center justify-center bg-black bg-opacity-75 p-4",children:d.jsxs(te.div,{initial:{scale:.9,opacity:0},animate:{scale:1,opacity:1},exit:{scale:.9,opacity:0},className:"relative w-full max-w-4xl bg-[#23262d] rounded-lg overflow-hidden",children:[d.jsx("button",{onClick:e,className:"absolute top-4 right-4 z-10 text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(ko,{className:"h-6 w-6"})}),d.jsx("div",{className:"relative pt-[56.25%]",children:d.jsx("iframe",{src:`https://www.youtube.com/embed/${i(t)}?autoplay=1`,title:"YouTube video player",className:"absolute top-0 left-0 w-full h-full",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0})})]})})})};function ez(){var b;const[n,e]=V.useState("lectures"),[t,i]=V.useState(null),[r,o]=V.useState(null),[l,u]=V.useState({lectures:{},books:{},videos:{},researchPapers:{}}),h=[{id:"lectures",label:"Lectures",icon:$k},{id:"books",label:"Books",icon:qk},{id:"videos",label:"Videos",icon:Zk},{id:"researchPapers",label:"Research Papers",icon:mw}],p=T=>{const C={};return T.forEach(I=>{const N=I.data().year||"Uncategorized";C[N]||(C[N]=[]),C[N].push({id:I.id,...I.data()})}),C};V.useEffect(()=>{(async()=>{const C=await Ct(Ge(_e,"lectures")),I=await Ct(Ge(_e,"books")),N=await Ct(Ge(_e,"videos")),D=await Ct(Ge(_e,"researchPapers"));u({lectures:p(C),books:p(I),videos:p(N),researchPapers:p(D)})})()},[]);const g=T=>{o(T)},y=T=>T?T.split(",").map(C=>C.trim()).filter(C=>C):[],x=T=>Object.keys(T).sort((I,N)=>N.localeCompare(I)).map(I=>d.jsxs("div",{className:"mb-12",children:[d.jsx("h3",{className:"text-2xl font-bold text-white mb-6 border-b border-[rgb(136,58,234)] pb-2",children:I==="Uncategorized"?"Other Resources":I}),n==="lectures"&&d.jsx("div",{className:"space-y-6",children:T[I].map((N,D)=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:D*.1},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-xl font-bold text-white",children:N.title}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:N.description}),d.jsxs("div",{className:"flex items-center space-x-4 text-sm text-white",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Gi,{className:"h-4 w-4 mr-2 text-[rgb(136,58,234)]"}),N.duration]}),d.jsx("div",{children:N.instructor})]})]}),d.jsxs(te.a,{href:N.pdfUrl,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.95},className:"flex items-center space-x-2 bg-[rgb(136,58,234)] text-white px-4 py-2 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:[d.jsx(pw,{className:"h-4 w-4"}),d.jsx("span",{children:"Download PDF"})]})]})},N.id))}),n==="books"&&d.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:T[I].map((N,D)=>d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:D*.1},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:N.title}),d.jsxs("p",{className:"text-[rgb(224,204,250)] mb-4",children:["by ",N.authors]}),d.jsxs("div",{className:"flex justify-between items-center text-sm text-white",children:[d.jsxs("div",{children:[N.edition," • ",N.year]}),d.jsxs(te.a,{href:N.url,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.95},className:"flex items-center space-x-2 text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:[d.jsx(mw,{className:"h-4 w-4"}),d.jsx("span",{children:"Access Book"})]})]})]},N.id))}),n==="videos"&&d.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:T[I].map((N,D)=>d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:D*.1},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:[d.jsxs("div",{className:"relative h-48",children:[d.jsx("img",{src:N.thumbnail,alt:N.title,className:"w-full h-full object-cover"}),d.jsx(te.button,{onClick:()=>i(N.videoUrl),className:"absolute inset-0 flex items-center justify-center bg-black bg-opacity-50 hover:bg-opacity-40 transition-all duration-300",whileHover:{scale:1.05},whileTap:{scale:.95},children:d.jsx(Xk,{className:"h-12 w-12 text-white"})})]}),d.jsxs("div",{className:"p-4",children:[d.jsx("h3",{className:"text-lg font-bold text-white mb-2",children:N.title}),d.jsxs("div",{className:"flex justify-between items-center text-sm text-[rgb(224,204,250)]",children:[d.jsx("div",{children:N.instructor}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Gi,{className:"h-4 w-4 mr-2"}),N.duration]})]})]})]},N.id))}),n==="researchPapers"&&r===null&&d.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:T[I].map((N,D)=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:D*.1},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:"mb-4",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsx("h3",{className:"text-xl font-bold text-white",children:N.title})}),N.tags&&d.jsx("div",{className:"flex flex-wrap gap-2 mt-3",children:N.tags.map((O,L)=>d.jsx("span",{className:"px-2 py-1 bg-[rgb(49,10,101)] text-[rgb(224,204,250)] rounded-full text-xs",children:O},L))})]}),d.jsxs(te.button,{onClick:()=>g(N),whileHover:{scale:1.05},whileTap:{scale:.95},className:"w-full flex items-center justify-center bg-[rgb(136,58,234)] text-white px-4 py-2 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:[d.jsx("span",{children:"View Paper Details"}),d.jsx(Is,{className:"ml-2 h-4 w-4"})]})]})},N.id))})]},I));return n==="researchPapers"&&r?d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx(te.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},className:"flex items-center mb-8",children:d.jsxs("button",{onClick:()=>o(null),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:[d.jsx(Is,{className:"h-5 w-5 mr-2 transform rotate-180"}),"Back to Research Papers"]})}),d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.4},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)]",children:[d.jsx(te.h2,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.3,delay:.1},className:"text-2xl font-bold text-white mb-4",children:r.title}),d.jsx(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.2},className:"mb-6",children:d.jsx("div",{className:"flex flex-wrap gap-2",children:(b=r.tags)==null?void 0:b.map((T,C)=>d.jsx("span",{className:"px-3 py-1 bg-[rgb(49,10,101)] text-[rgb(224,204,250)] rounded-full text-sm",children:T},C))})}),r.authors&&d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.3},className:"mb-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-[rgb(224,204,250)] mb-3",children:"Authors"}),d.jsx("ul",{className:"list-disc pl-5 space-y-1",children:y(r.authors).map((T,C)=>d.jsx("li",{className:"text-white",children:T},C))})]}),r.abstract&&d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.4},className:"mb-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-[rgb(224,204,250)] mb-2",children:"Abstract"}),d.jsx("p",{className:"text-white",children:r.abstract})]}),r.url&&d.jsx(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.3,delay:.5},className:"flex justify-center mt-8",children:d.jsxs(te.a,{href:r.url,target:"_blank",rel:"noopener noreferrer",whileHover:{scale:1.05},whileTap:{scale:.95},className:"inline-flex items-center bg-[rgb(136,58,234)] text-white px-6 py-3 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:[d.jsx(pw,{className:"h-5 w-5 mr-2"}),"View Full Paper"]})})]})]}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsx(te.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},className:"text-4xl font-bold text-white mb-4",children:"Course Resources"}),d.jsx(te.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.3},className:"text-[rgb(224,204,250)] text-lg",children:"Access all course materials, recommended readings, and additional resources."})]}),d.jsx("div",{className:"flex space-x-2 border-b border-[rgb(49,10,101)] overflow-x-auto pb-2",children:h.map(T=>d.jsxs(te.button,{onClick:()=>{e(T.id),o(null)},whileHover:{scale:1.05},whileTap:{scale:.95},className:`flex items-center space-x-2 px-4 py-2 rounded-t-lg transition-all duration-300 ${n===T.id?"text-white bg-[rgb(49,10,101)] border-t border-l border-r border-[rgb(136,58,234)]":"text-[rgb(224,204,250)] hover:text-white"}`,children:[d.jsx(T.icon,{className:"h-5 w-5"}),d.jsx("span",{className:"hidden md:inline",children:T.label})]},T.id))}),d.jsx("div",{className:"min-h-[400px]",children:x(l[n])}),d.jsx(ZU,{isOpen:!!t,onClose:()=>i(null),videoUrl:t})]})}const k1=({member:n,index:e,isHead:t})=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:e*.1},className:`bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 ${t?"md:max-w-2xl mx-auto":""}`,whileHover:{scale:1.02},children:d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:`flex ${t?"flex-col md:flex-row":"flex-row"} items-center space-x-4`,children:[d.jsx(te.img,{initial:{scale:.8,opacity:0},animate:{scale:1,opacity:1},transition:{duration:.3,delay:e*.1+.2},src:n.image,alt:n.name,className:`${t?"w-32 h-32 md:w-40 md:h-40":"w-24 h-24"} rounded-full object-cover border-2 border-[rgb(136,58,234)]`}),d.jsxs("div",{className:`${t?"text-center md:text-left mt-4 md:mt-0":""}`,children:[d.jsx("h3",{className:`${t?"text-2xl":"text-xl"} font-bold text-white`,children:n.name}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:n.role}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:n.specialization})]})]}),d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{delay:e*.1+.4},className:"mt-4 flex space-x-4 justify-center md:justify-start",children:[n.email&&d.jsx("a",{href:`mailto:${n.email}`,className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(W1,{className:"h-5 w-5"})}),n.github&&d.jsx("a",{href:`https://github.com/${n.github}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx($1,{className:"h-5 w-5"})}),n.linkedin&&d.jsx("a",{href:`https://linkedin.com/in/${n.linkedin}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(H1,{className:"h-5 w-5"})})]})]})});function tz(){const[n,e]=V.useState([]),[t,i]=V.useState(!0);if(V.useEffect(()=>{(async()=>{const g=(await Ct(Ge(_e,"members"))).docs.map(y=>({id:y.id,...y.data()}));e(g),i(!1)})()},[]),t)return d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"text-white",children:"Loading members..."})});const r=n.find(h=>h.isHead),l=n.filter(h=>!h.isHead).reduce((h,p)=>{const g=p.year||"Other";return h[g]||(h[g]=[]),h[g].push(p),h},{}),u=Object.keys(l).sort((h,p)=>p-h);return d.jsx(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.5},className:"space-y-8",children:d.jsxs("div",{className:"space-y-12",children:[d.jsxs(te.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2},className:"text-center",children:[d.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:"Our Members"}),d.jsx("p",{className:"text-[rgb(224,204,250)] text-lg",children:"Meet our distinguished faculty members and researchers in cryptography."})]}),r&&d.jsx("div",{className:"px-4",children:d.jsx(k1,{member:r,index:0,isHead:!0})}),u.map((h,p)=>d.jsxs("div",{className:"space-y-6",children:[d.jsx("h2",{className:"text-2xl font-bold text-white px-4",children:h}),d.jsx("div",{className:"grid gap-8 md:grid-cols-2 px-4",children:l[h].map((g,y)=>d.jsx(k1,{member:g,index:y+1,isHead:!1},g.id))})]},h))]})})}function nz(){const[n,e]=V.useState({stats:[],researchAreas:[],contact:{location:"",details:""},loading:!0});return V.useEffect(()=>{(async()=>{try{const i=ht(_e,"content","about"),r=await Eu(i);r.exists()&&e({...r.data(),loading:!1})}catch(i){console.error("Error fetching about data:",i),e(r=>({...r,loading:!1}))}})()},[]),n.loading?d.jsx("div",{className:"min-h-screen flex items-center justify-center text-white",children:"Loading..."}):d.jsxs(te.div,{className:"space-y-12",initial:{opacity:0},animate:{opacity:1},transition:{duration:1},children:[d.jsxs(te.div,{className:"text-center",initial:{y:-20,opacity:0},animate:{y:0,opacity:1},transition:{duration:.2},children:[d.jsx("h1",{className:"text-4xl font-bold text-white mb-4",children:"About VeilCode Labs"}),d.jsx("p",{className:"text-[rgb(224,204,250)] text-lg max-w-3xl mx-auto",children:"VeilCode Labs is IIIT Delhi's premier platform for cryptography education and research, fostering collaboration and excellence in the field of cryptography and security."})]}),d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-8",children:n.stats.map((t,i)=>d.jsxs(te.div,{className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 text-center",whileHover:{scale:1.05},initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.2,delay:i*.2},children:[t.icon==="Users"&&d.jsx(Zi,{className:"h-8 w-8 mx-auto text-[rgb(136,58,234)]"}),t.icon==="BookOpen"&&d.jsx(Ao,{className:"h-8 w-8 mx-auto text-[rgb(136,58,234)]"}),t.icon==="Award"&&d.jsx(U1,{className:"h-8 w-8 mx-auto text-[rgb(136,58,234)]"}),t.icon==="Building"&&d.jsx(z1,{className:"h-8 w-8 mx-auto text-[rgb(136,58,234)]"}),d.jsx("p",{className:"mt-4 text-2xl font-semibold text-white",children:t.value}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:t.name})]},t.name||i))}),d.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:["Our Mission","Our Vision"].map((t,i)=>d.jsxs(te.div,{className:"bg-[rgba(49,10,101,0.2)] rounded-lg p-6",initial:{x:i%2===0?-50:50,opacity:0},animate:{x:0,opacity:1},transition:{duration:.6,delay:i*.2},children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:t==="Our Mission"?"To enable education by maintaing an open-source platform where anyone can access, contribute to, and improve course materials, tools, and community driven learning.":"To empower learners worldwide with free, high-quality cryptography education—from basic ciphers to modern encryption."})]},t))}),d.jsxs(te.div,{className:"bg-[#23262d] rounded-lg p-8 border border-[rgb(136,58,234)]",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.8},children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"Research Areas"}),d.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:n.researchAreas.map((t,i)=>d.jsxs(te.div,{initial:{y:30,opacity:0},animate:{y:0,opacity:1},transition:{duration:.5,delay:i*.3},children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:t.title}),d.jsx("ul",{className:"list-disc list-inside text-white space-y-2",children:t.points.map((r,o)=>d.jsx("li",{children:r},o))})]},t.title||i))})]}),d.jsxs(te.div,{className:"bg-[rgba(49,10,101,0.2)] rounded-lg p-6",initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.7},children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Contact Us"}),d.jsxs("div",{className:"grid md:grid-cols-2 gap-8",children:[d.jsxs(te.div,{initial:{x:-50,opacity:0},animate:{x:0,opacity:1},transition:{duration:.2},children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:"Location"}),d.jsx("p",{className:"text-white whitespace-pre-line",children:n.contact.location})]}),d.jsxs(te.div,{initial:{x:50,opacity:0},animate:{x:0,opacity:1},transition:{duration:.2,delay:.2},children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:"Get in Touch"}),d.jsx("p",{className:"text-white whitespace-pre-line",children:n.contact.details})]})]})]})]})}class iz extends md.Component{constructor(e){super(e),this.state={hasError:!1}}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.error("Error caught by boundary:",e,t)}render(){return this.state.hasError?d.jsx("div",{className:"bg-red-900/20 border border-red-500 text-red-200 p-4 rounded-lg",children:"Something went wrong. Please try again later."}):this.props.children}}function rz(){var X;const[n,e]=V.useState([]),[t,i]=V.useState([]),[r,o]=V.useState(!0),[l,u]=V.useState(null),[h,p]=V.useState(!1),[g,y]=V.useState(null),[x,b]=V.useState(null),[T,C]=V.useState({title:"",content:"",tags:[],image:""}),I=k=>{if(!k)return"N/A";try{return typeof k.toDate=="function"?k.toDate().toLocaleDateString():typeof k=="string"?new Date(k).toLocaleDateString():"N/A"}catch{return"N/A"}};V.useEffect(()=>{const k=Ac();let P=()=>{},R=()=>{};const F=async()=>{try{const q=zd(Ge(_e,"blogs"),Bd("approved","==",!0),qd("date","desc"));P=$g(q,M=>{e(M.docs.map(qe=>({id:qe.id,...qe.data(),date:qe.data().date||Qm()}))),o(!1)},M=>{console.error("Error in blogs snapshot:",M),o(!1)})}catch(q){console.error("Error setting up blogs query:",q),o(!1)}},z=uC(k,q=>{if(q&&q.email.endsWith("@iiitd.ac.in")){u(q);const M=zd(Ge(_e,"blogs"),Bd("authorId","==",q.uid),qd("date","desc"));R=$g(M,qe=>{i(qe.docs.map(mt=>({id:mt.id,...mt.data(),date:mt.data().date||Qm()})))},qe=>{console.error("Error in user posts snapshot:",qe)})}else u(null),i([])});return F(),()=>{z(),P(),R()}},[]);const N=async()=>{const k=new wr;k.setCustomParameters({hd:"iiitd.ac.in"});try{(await nU(Ac(),k)).user.email.endsWith("@iiitd.ac.in")||(await Gg(Ac()),alert("Only @iiitd.ac.in emails are allowed."))}catch(P){console.error("Login failed:",P)}},D=async()=>{try{x?(await qs(ht(_e,"blogs",x.id),{...T,tags:T.tags.filter(k=>k.trim()!=="")}),b(null)):await $o(Ge(_e,"blogs"),{...T,author:l.displayName||l.email.split("@")[0],authorId:l.uid,date:Qm(),tags:T.tags.filter(k=>k.trim()!==""),approved:!1}),p(!1),C({title:"",content:"",tags:[],image:""})}catch(k){console.error("Error submitting blog:",k)}},O=async k=>{const P=ht(_e,"blogs",k),R=await Eu(P);R.exists()&&y({id:R.id,...R.data()})},L=k=>{b(k),C({title:k.title,content:k.content,tags:k.tags||[],image:k.image||""}),p(!0)},G=async k=>{if(window.confirm("Are you sure you want to delete this blog post?"))try{await $s(ht(_e,"blogs",k)),(g==null?void 0:g.id)===k&&y(null)}catch(P){console.error("Error deleting blog:",P)}};return r?d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"text-white",children:"Loading blogs..."})}):g?d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8 pb-12",children:[d.jsx(te.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},transition:{duration:.3},className:"flex items-center mb-8",children:d.jsxs("button",{onClick:()=>y(null),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:[d.jsx(Is,{className:"h-5 w-5 mr-2 transform rotate-180"}),"Back to Blogs"]})}),d.jsxs("div",{className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)]",children:[g.image&&d.jsx("div",{className:"h-64",children:d.jsx("img",{src:g.image,alt:g.title,className:"w-full h-full object-cover"})}),d.jsxs("div",{className:"p-8",children:[d.jsxs("div",{className:"flex justify-between items-start mb-6",children:[d.jsxs("div",{children:[d.jsx("h1",{className:"text-3xl font-bold text-white mb-2",children:g.title}),d.jsxs("div",{className:"flex items-center space-x-4 text-[rgb(224,204,250)]",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Nc,{className:"h-5 w-5 mr-2"}),g.author||"Anonymous"]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Tr,{className:"h-5 w-5 mr-2"}),I(g.date)]}),!g.approved&&d.jsxs("div",{className:"flex items-center text-yellow-400",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2"}),d.jsx("span",{children:"Pending Approval"})]})]})]}),(l==null?void 0:l.uid)===g.authorId&&d.jsxs("div",{className:"flex space-x-2",children:[d.jsxs("button",{onClick:()=>L(g),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors",children:[d.jsx(xs,{className:"h-5 w-5 mr-1"}),"Edit"]}),d.jsxs("button",{onClick:()=>G(g.id),className:"flex items-center text-red-500 hover:text-red-400 transition-colors",children:[d.jsx(ko,{className:"h-5 w-5 mr-1"}),"Delete"]})]})]}),d.jsx("div",{className:"prose prose-invert max-w-none",children:d.jsx("p",{className:"text-[rgb(224,204,250)] text-lg whitespace-pre-line",children:g.content})}),((X=g.tags)==null?void 0:X.length)>0&&d.jsxs("div",{className:"mt-8",children:[d.jsx("h3",{className:"text-xl font-semibold text-white mb-3",children:"Tags"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:g.tags.map((k,P)=>d.jsx(te.span,{whileHover:{scale:1.1},className:"bg-[rgb(49,10,101)] text-[rgb(224,204,250)] px-3 py-1 rounded-md text-sm",children:k},P))})]})]})]})]}):d.jsx(iz,{children:d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsx(te.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},className:"text-4xl font-bold text-white mb-4",children:"Cryptography Blog"}),d.jsx(te.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.3},className:"text-[rgb(224,204,250)] text-lg",children:"Latest insights, research, and developments in cryptography."})]}),l&&t.some(k=>!k.approved)&&d.jsx("div",{className:"bg-yellow-900/30 border border-yellow-600 text-yellow-200 p-4 rounded-lg",children:d.jsxs("div",{className:"flex items-center",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2"}),d.jsxs("span",{children:["You have ",t.filter(k=>!k.approved).length," post(s) waiting for admin approval"]})]})}),d.jsx("div",{className:"flex justify-end mb-8 gap-4",children:l?d.jsxs(d.Fragment,{children:[d.jsxs("button",{onClick:()=>{b(null),C({title:"",content:"",tags:[],image:""}),p(!0)},className:"bg-[rgb(136,58,234)] hover:bg-[rgb(49,10,101)] text-white px-6 py-3 rounded-lg transition-colors duration-300 flex items-center gap-2",children:[d.jsx(oi,{className:"h-5 w-5"}),d.jsx("span",{children:"Create Post"})]}),d.jsxs("button",{onClick:()=>Gg(Ac()),className:"bg-gray-600 hover:bg-gray-700 text-white px-4 py-3 rounded-lg transition-colors duration-300 flex items-center gap-2",children:[d.jsx(Kk,{className:"h-5 w-5"}),d.jsx("span",{children:"Logout"})]})]}):d.jsxs("button",{onClick:N,className:"bg-[rgb(136,58,234)] hover:bg-[rgb(49,10,101)] text-white px-6 py-3 rounded-lg transition-colors duration-300 flex items-center gap-2",children:[d.jsx(Gk,{className:"h-5 w-5"}),d.jsx("span",{children:"Sign In with IIITD Mail"})]})}),h&&d.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl border border-[rgb(136,58,234)]",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("h3",{className:"text-xl font-bold text-white",children:x?"Edit Blog Post":"New Blog Post"}),d.jsx("button",{onClick:()=>{p(!1),b(null)},className:"text-gray-400 hover:text-white",children:d.jsx(ko,{className:"h-6 w-6"})})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsx("input",{type:"text",placeholder:"Title",value:T.title,onChange:k=>C({...T,title:k.target.value}),className:"w-full p-3 bg-[#2b2e36] border border-[rgb(136,58,234)] rounded text-white",required:!0}),d.jsx("textarea",{placeholder:"Content",value:T.content,onChange:k=>C({...T,content:k.target.value}),className:"w-full p-3 bg-[#2b2e36] border border-[rgb(136,58,234)] rounded text-white min-h-[200px]",required:!0}),d.jsx("input",{type:"text",placeholder:"Tags (comma-separated)",value:T.tags.join(","),onChange:k=>C({...T,tags:k.target.value.split(",")}),className:"w-full p-3 bg-[#2b2e36] border border-[rgb(136,58,234)] rounded text-white"}),d.jsx("input",{type:"text",placeholder:"Thumbnail URL (optional)",value:T.image,onChange:k=>C({...T,image:k.target.value}),className:"w-full p-3 bg-[#2b2e36] border border-[rgb(136,58,234)] rounded text-white"}),!x&&d.jsx("div",{className:"bg-blue-900/20 border border-blue-500 text-blue-200 p-3 rounded text-sm",children:"Your post will be submitted for admin approval before being published."}),d.jsxs("div",{className:"flex justify-end gap-3",children:[d.jsx("button",{onClick:()=>{p(!1),b(null)},className:"px-4 py-2 bg-gray-600 text-white rounded hover:bg-gray-700 transition-colors",children:"Cancel"}),d.jsx("button",{onClick:D,className:"px-4 py-2 bg-[rgb(136,58,234)] hover:bg-[rgb(49,10,101)] text-white rounded transition-colors",children:x?"Update":"Submit for Approval"}),x&&d.jsx("button",{onClick:()=>G(x.id),className:"px-4 py-2 bg-red-600 hover:bg-red-700 text-white rounded transition-colors",children:"Delete"})]})]})]})}),d.jsx("div",{className:"grid gap-8",children:n.length>0?n.map((k,P)=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:P*.2},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 cursor-pointer",onClick:()=>O(k.id),children:d.jsxs("div",{className:"md:flex",children:[k.image&&d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:k.image,alt:k.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:`p-6 ${k.image?"md:w-2/3":"w-full"}`,children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:k.title}),(l==null?void 0:l.uid)===k.authorId&&d.jsx("button",{className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors",onClick:R=>{R.stopPropagation(),L(k)},children:d.jsx(xs,{className:"h-5 w-5"})})]}),d.jsxs("p",{className:"text-[rgb(224,204,250)] mb-4",children:[k.content.substring(0,200),k.content.length>200?"...":""]}),k.tags&&k.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2 mb-4",children:k.tags.map((R,F)=>d.jsx(te.span,{whileHover:{scale:1.1},className:"bg-[rgb(49,10,101)] text-[rgb(224,204,250)] px-2 py-1 rounded-md text-sm",children:R},F))}),d.jsx("div",{className:"flex items-center justify-between text-[rgb(224,204,250)]",children:d.jsxs("div",{className:"flex items-center space-x-4",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Nc,{className:"h-4 w-4 mr-2"}),k.author||"Anonymous"]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Tr,{className:"h-4 w-4 mr-2"}),I(k.date)]})]})})]})]})},k.id)):d.jsx("p",{className:"text-white text-center py-8",children:r?"Loading blogs...":"No approved blog posts found"})}),l&&t.some(k=>!k.approved)&&d.jsxs("div",{className:"mt-12",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-6 border-b border-yellow-600 pb-2",children:"Your Pending Posts"}),d.jsx("div",{className:"grid gap-8",children:t.filter(k=>!k.approved).map((k,P)=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:P*.1},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-yellow-600 hover:border-yellow-400 transition-all duration-300 cursor-pointer",onClick:()=>O(k.id),children:d.jsxs("div",{className:"md:flex",children:[k.image&&d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:k.image,alt:k.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:`p-6 ${k.image?"md:w-2/3":"w-full"}`,children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:k.title}),d.jsxs("div",{className:"flex space-x-2",children:[d.jsx("button",{className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors",onClick:R=>{R.stopPropagation(),L(k)},children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{className:"text-red-500 hover:text-red-400 transition-colors",onClick:R=>{R.stopPropagation(),G(k.id)},children:d.jsx(ko,{className:"h-5 w-5"})})]})]}),d.jsxs("div",{className:"flex items-center mb-4 text-yellow-400",children:[d.jsx(Gi,{className:"h-4 w-4 mr-2"}),d.jsx("span",{children:"Pending Admin Approval"})]}),d.jsxs("p",{className:"text-[rgb(224,204,250)] mb-4",children:[k.content.substring(0,200),k.content.length>200?"...":""]}),k.tags&&k.tags.length>0&&d.jsx("div",{className:"flex flex-wrap gap-2",children:k.tags.map((R,F)=>d.jsx(te.span,{whileHover:{scale:1.1},className:"bg-[rgb(49,10,101)] text-[rgb(224,204,250)] px-2 py-1 rounded-md text-sm",children:R},F))})]})]})},k.id))})]})]})})}function sz(){const[n,e]=V.useState([]),[t,i]=V.useState(!0);return V.useEffect(()=>{(async()=>{const l=(await Ct(Ge(_e,"labs"))).docs.map(u=>({id:u.id,...u.data()}));e(l),i(!1)})()},[]),t?d.jsx("div",{className:"min-h-screen flex items-center justify-center",children:d.jsx("div",{className:"text-white",children:"Loading labs..."})}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsxs("div",{className:"text-center",children:[d.jsx(te.h1,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.2,delay:.2},className:"text-4xl font-bold text-white mb-4",children:"Cryptography Labs"}),d.jsx(te.p,{initial:{opacity:0,y:-10},animate:{opacity:1,y:0},transition:{duration:.2,delay:.3},className:"text-[rgb(224,204,250)] text-lg",children:"Hands-on laboratory sessions for practical cryptography implementation."})]}),d.jsx("div",{className:"grid gap-8",children:n.map((r,o)=>{var l;return d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6,delay:o*.2},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"md:flex",children:[d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:r.image,alt:r.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:"p-6 md:w-2/3",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:r.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4",children:r.description}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Gi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:r.duration})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Zi,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsxs("span",{children:[r.enrolled||0,"/",r.capacity||0," Enrolled"]})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(Ao,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:r.instructor})]}),d.jsxs("div",{className:"flex items-center text-white",children:[d.jsx(q1,{className:"h-5 w-5 mr-2 text-[rgb(136,58,234)]"}),d.jsx("span",{children:((l=r.tools)==null?void 0:l.join(", "))||""})]})]}),r.prerequisites&&d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Prerequisites"}),d.jsx("ul",{className:"list-disc list-inside text-[rgb(224,204,250)]",children:r.prerequisites.map((u,h)=>d.jsx("li",{children:u},h))})]})]})]})},r.id)})})]})}const oz=()=>{const{pathname:n}=Uo();return V.useEffect(()=>{window.scrollTo(0,0)},[n]),null},az=()=>{const[n,e]=V.useState(""),[t,i]=V.useState(""),[r,o]=V.useState(""),l=Wn(),u=async h=>{h.preventDefault(),o("");try{await DF(Qg,n,t),l("/admin")}catch(p){console.error("Login error:",p.code,p.message),o(p.message)}};return d.jsx("div",{className:"min-h-screen flex items-center justify-center bg-[#13151a]",children:d.jsxs("div",{className:"bg-[#23262d] p-8 rounded-lg border border-[rgb(136,58,234)] w-96",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-6",children:"Admin Login"}),r&&d.jsx("p",{className:"text-red-500 mb-4",children:r}),d.jsxs("form",{onSubmit:u,className:"space-y-4",children:[d.jsx("input",{type:"email",placeholder:"Email",value:n,onChange:h=>e(h.target.value),className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{type:"password",placeholder:"Password",value:t,onChange:h=>i(h.target.value),className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("button",{type:"submit",className:"w-full bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:"Login"})]})]})})},EC=V.createContext(),lz=({children:n})=>{const[e,t]=V.useState(null);V.useEffect(()=>{const r=uC(Qg,o=>{t(o)});return()=>r()},[]);const i=async()=>{try{return await Gg(Qg),!0}catch(r){return console.error("Logout error:",r),!1}};return d.jsx(EC.Provider,{value:{user:e,logout:i},children:n})},Vr=()=>V.useContext(EC),cz=()=>{const{user:n,logout:e}=Vr(),[t,i]=V.useState(!1),[r,o]=V.useState(!1);if(!n)return d.jsx(Hi,{to:"/admin-login"});const l=async()=>{i(!0);try{await e()}catch(u){console.error("Logout failed:",u)}finally{i(!1),o(!1)}};return d.jsxs("div",{className:"p-8 relative",children:[r&&d.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:d.jsxs("div",{className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] max-w-md w-full",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-4",children:"Confirm Logout"}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-6",children:"Are you sure you want to log out of the admin panel?"}),d.jsxs("div",{className:"flex justify-end space-x-3",children:[d.jsx("button",{onClick:()=>o(!1),className:"px-4 py-2 rounded-md bg-gray-600 text-white hover:bg-gray-700 transition-colors duration-300",disabled:t,children:"Cancel"}),d.jsx("button",{onClick:l,className:`px-4 py-2 rounded-md ${t?"bg-red-700 cursor-not-allowed":"bg-red-500 hover:bg-red-600"} text-white transition-colors duration-300`,disabled:t,children:t?"Logging Out...":"Logout"})]})]})}),d.jsx("div",{className:"flex justify-between items-center",children:d.jsx("button",{onClick:()=>o(!0),className:`bg-red-500 text-white px-4 py-2 rounded-md ${t?"cursor-not-allowed opacity-75":"hover:bg-red-600"} transition-colors duration-300`,disabled:t,children:"Logout"})}),d.jsx("h1",{className:"text-3xl font-bold text-white mb-8 text-center",children:"Admin Panel"}),d.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mt-4",children:[d.jsx(kn,{to:"/admin/home",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Home"})}),d.jsx(kn,{to:"/admin/courses",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Courses"})}),d.jsx(kn,{to:"/admin/blogs",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Blogs"})}),d.jsx(kn,{to:"/admin/events",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Events"})}),d.jsx(kn,{to:"/admin/labs",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Labs"})}),d.jsx(kn,{to:"/admin/resources",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Resources"})}),d.jsx(kn,{to:"/admin/members",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage Members"})}),d.jsx(kn,{to:"/admin/about",className:"bg-[#23262d] p-6 rounded-lg border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 flex flex-col items-center hover:bg-[#2b2e36]",children:d.jsx("h2",{className:"text-xl font-bold text-white text-center",children:"Manage About"})})]})]})};function uz(){const[n,e]=V.useState([]),[t,i]=V.useState({title:"",description:""}),[r,o]=V.useState(null),[l,u]=V.useState(!0),[h,p]=V.useState(!1),{user:g}=Vr(),y=Wn();V.useEffect(()=>{(async()=>{try{const O=await Ct(Ge(_e,"homeUpdates")),L=[];O.forEach(G=>{L.push({id:G.id,...G.data()})}),e(L)}catch(O){console.error("Error fetching updates: ",O)}finally{u(!1)}})()},[]);const x=async()=>{if(!(!t.title||!t.description))try{const D=await $o(Ge(_e,"homeUpdates"),t);e([...n,{id:D.id,...t}]),i({title:"",description:""}),p(!1)}catch(D){console.error("Error adding update: ",D)}},b=async()=>{if(!(!r||!t.title||!t.description))try{await qs(ht(_e,"homeUpdates",r),t),e(n.map(D=>D.id===r?{...D,...t}:D)),i({title:"",description:""}),p(!1)}catch(D){console.error("Error updating document: ",D)}},T=async D=>{try{await $s(ht(_e,"homeUpdates",D)),e(n.filter(O=>O.id!==D))}catch(O){console.error("Error deleting document: ",O)}},C=()=>{o(null),i({title:"",description:""}),p(!0)},I=D=>{o(D.id),i({title:D.title,description:D.description}),p(!0)},N=()=>{p(!1),o(null),i({title:"",description:""})};return l?d.jsx("div",{className:"min-h-screen bg-[#13151a] flex items-center justify-center text-white",children:"Loading..."}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"bg-[#13151a] min-h-screen p-8 text-white",children:[d.jsx("div",{className:"flex justify-between items-center mb-8",children:d.jsxs("button",{onClick:()=>y("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-[rgb(224,204,250)]",children:"Manage Homepage Updates"}),g&&d.jsxs("button",{onClick:C,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center mb-8",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add New Update"]}),d.jsx("div",{className:"space-y-6",children:n.length===0?d.jsx("div",{className:"text-center text-[rgb(224,204,250)] py-8",children:"No updates added yet"}):n.map(D=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"bg-[#23262d] rounded-lg p-6 border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsxs("div",{children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:D.title}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:D.description})]}),g&&d.jsxs("div",{className:"flex gap-4",children:[d.jsx("button",{onClick:()=>I(D),className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(Zh,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>T(D.id),className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]})},D.id))}),h&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4 z-50",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("h2",{className:"text-2xl font-bold text-white",children:r?"Edit Update":"Add New Update"}),d.jsx("button",{onClick:N,className:"text-[rgb(224,204,250)] hover:text-white text-xl",children:"×"})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium mb-1 text-[rgb(224,204,250)]",children:"Title"}),d.jsx("input",{type:"text",value:t.title,onChange:D=>i({...t,title:D.target.value}),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]",placeholder:"Update title",required:!0})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-sm font-medium mb-1 text-[rgb(224,204,250)]",children:"Description"}),d.jsx("textarea",{value:t.description,onChange:D=>i({...t,description:D.target.value}),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]",placeholder:"Update description",rows:4,required:!0})]}),d.jsxs("div",{className:"flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:N,className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600 transition-colors duration-300",children:"Cancel"}),d.jsx("button",{type:"button",onClick:r?b:x,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:r?"Update":"Add"})]})]})]})})]})}function hz(){const[n,e]=V.useState([]),[t,i]=V.useState(null),[r,o]=V.useState({title:"",courseCode:"",credits:"",offeredTo:"",description:"",instructor:"",duration:"",students:"",rating:"",image:"",prerequisites:{mandatory:[],desirable:[],other:[]},courseOutcomes:[],weeklyPlan:[],assessment:[],resources:{textbooks:[]},nextStart:""}),{user:l}=Vr(),u=Wn();V.useEffect(()=>{(async()=>{const C=(await Ct(Ge(_e,"courses"))).docs.map(I=>({id:I.id,...I.data()}));e(C)})()},[]);const h=b=>{const{name:T,value:C}=b.target;if(T.includes("resources.")){const[I,N]=T.split(".");o(D=>({...D,resources:{...D.resources,[N]:C.split(",").map(O=>O.trim()).filter(O=>O!=="")}}))}else if(T.includes("prerequisites.")){const[I,N]=T.split(".");o(D=>({...D,prerequisites:{...D.prerequisites,[N]:C.split(",").map(O=>O.trim())}}))}else o({...r,[T]:C})},p=(b,T)=>{const{value:C}=b.target;o(I=>({...I,[T]:C.split(",").map(N=>N.trim())}))},g=async b=>{b.preventDefault();try{if(t!=null&&t.id)await qs(ht(_e,"courses",t.id),r),e(T=>T.map(C=>C.id===t.id?{...C,...r}:C));else{const T=await $o(Ge(_e,"courses"),r);e(C=>[...C,{id:T.id,...r}])}i(null),y()}catch(T){console.error("Error saving course:",T)}},y=()=>{o({title:"",courseCode:"",credits:"",offeredTo:"",description:"",instructor:"",duration:"",students:"",rating:"",image:"",prerequisites:{mandatory:[],desirable:[],other:[]},courseOutcomes:[],weeklyPlan:[],assessment:[],resources:{textbooks:[]},nextStart:""})},x=async b=>{await $s(ht(_e,"courses",b)),e(n.filter(T=>T.id!==b))};return d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>u("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Manage Courses"}),l&&d.jsxs("button",{onClick:()=>i({}),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add Course"]}),d.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:n.map(b=>d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg border border-[rgb(136,58,234)] transition-all duration-300 shadow-lg p-6",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:b.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4 text-sm",children:b.description}),d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Course Code:"})," ",b.courseCode]}),d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Instructor:"})," ",b.instructor]}),d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Duration:"})," ",b.duration]}),d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Students:"})," ",b.students]}),d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Rating:"})," ",b.rating]}),b.image&&d.jsx("img",{src:b.image,alt:b.title,className:"w-full h-32 object-cover rounded-lg mt-3"}),l&&d.jsxs("div",{className:"flex space-x-2 mt-4",children:[d.jsx("button",{onClick:()=>{i(b),o(b)},className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>x(b.id),className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]},b.id))}),t&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t.id?"Edit Course":"Add Course"}),d.jsxs("form",{onSubmit:g,className:"space-y-4",children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"courseCode",placeholder:"Course Code",value:r.courseCode,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"credits",placeholder:"Credits",type:"number",value:r.credits,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"offeredTo",placeholder:"Offered To",value:r.offeredTo,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("textarea",{name:"description",placeholder:"Description",value:r.description,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",rows:"3"}),d.jsx("input",{name:"instructor",placeholder:"Instructor",value:r.instructor,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"duration",placeholder:"Duration",value:r.duration,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"students",placeholder:"Number of Students",type:"number",value:r.students,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"rating",placeholder:"Rating (1-5)",type:"number",step:"0.1",min:"1",max:"5",value:r.rating,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"image",placeholder:"Image URL",value:r.image,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"nextStart",placeholder:"Next Start Date (YYYY-MM-DD)",value:r.nextStart,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-white font-semibold",children:"Prerequisites"}),d.jsx("input",{name:"prerequisites.mandatory",placeholder:"Mandatory (comma separated)",value:r.prerequisites.mandatory.join(", "),onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"prerequisites.desirable",placeholder:"Desirable (comma separated)",value:r.prerequisites.desirable.join(", "),onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"prerequisites.other",placeholder:"Other (comma separated)",value:r.prerequisites.other.join(", "),onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-white font-semibold",children:"Course Outcomes (comma separated)"}),d.jsx("textarea",{name:"courseOutcomes",placeholder:"CO1: Outcome 1, CO2: Outcome 2, ...",value:r.courseOutcomes.join(", "),onChange:b=>p(b,"courseOutcomes"),className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",rows:"3"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-white font-semibold",children:"Assessment Plan (format: Type:Contribution, ...)"}),d.jsx("textarea",{name:"assessment",placeholder:"Mid-sem:25, End-sem:35, ...",value:r.assessment.map(b=>`${b.type}:${b.contribution}`).join(", "),onChange:b=>{const C=b.target.value.split(",").map(I=>{const[N,D]=I.split(":").map(O=>O.trim());return{type:N,contribution:parseInt(D)||0}});o({...r,assessment:C})},className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",rows:"2"})]}),d.jsxs("div",{className:"space-y-2",children:[d.jsx("h3",{className:"text-white font-semibold",children:"Resources"}),d.jsx("textarea",{name:"resources.textbooks",placeholder:"Textbooks (comma separated)",value:r.resources.textbooks.join(", "),onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",rows:"2"})]}),d.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:()=>{i(null),y()},className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600",children:"Cancel"}),d.jsx("button",{type:"submit",className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)]",children:"Save"})]})]})]})})]})}function dz(){const[n,e]=V.useState({lectures:{},books:{},videos:{},researchPapers:{}}),[t,i]=V.useState(null),[r,o]=V.useState({type:"lectures",title:"",description:"",instructor:"",duration:"",pdfUrl:"",authors:"",abstract:"",edition:"",year:new Date().getFullYear().toString(),url:"",thumbnail:"",videoUrl:"",tags:[]}),l=I=>I?I.split(",").map(N=>N.trim()).filter(N=>N):[],{user:u}=Vr(),h=Wn(),p=I=>I?I.split(",").map(N=>N.trim()).filter(N=>N):[],g=I=>{const N={};return I.forEach(D=>{const O=D.data().year||"Uncategorized";N[O]||(N[O]=[]),N[O].push({id:D.id,...D.data()})}),N};V.useEffect(()=>{(async()=>{const N=await Ct(Ge(_e,"lectures")),D=await Ct(Ge(_e,"books")),O=await Ct(Ge(_e,"videos")),L=await Ct(Ge(_e,"researchPapers"));e({lectures:g(N),books:g(D),videos:g(O),researchPapers:g(L)})})()},[]);const y=I=>{o({...r,[I.target.name]:I.target.value})},x=async I=>{I.preventDefault();try{const N={...r,year:r.year||new Date().getFullYear().toString(),tags:r.tags||[]};if(t!=null&&t.id)await qs(ht(_e,r.type,t.id),N),e(D=>{var L,G;const O={...D};return t.year&&t.year!==N.year&&(O[r.type][t.year]=((L=O[r.type][t.year])==null?void 0:L.filter(X=>X.id!==t.id))||[]),O[r.type][N.year]||(O[r.type][N.year]=[]),O[r.type][N.year]=[...((G=O[r.type][N.year])==null?void 0:G.filter(X=>X.id!==t.id))??[],{id:t.id,...N}],O});else{const D=await $o(Ge(_e,r.type),N);e(O=>{const L={...O},G=N.year;return L[r.type][G]||(L[r.type][G]=[]),L[r.type][G]=[...L[r.type][G],{id:D.id,...N}],L})}i(null),o({type:"lectures",title:"",description:"",instructor:"",duration:"",pdfUrl:"",authors:"",abstract:"",edition:"",year:new Date().getFullYear().toString(),url:"",thumbnail:"",videoUrl:"",tags:[]})}catch(N){console.error("Error saving resource:",N)}},b=async(I,N,D)=>{await $s(ht(_e,N,I)),e(O=>{const L={...O};return L[N][D]=L[N][D].filter(G=>G.id!==I),L[N][D].length===0&&delete L[N][D],L})},T=()=>{var I;switch(r.type){case"lectures":return d.jsxs(d.Fragment,{children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"description",placeholder:"Description",value:r.description,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"instructor",placeholder:"Instructor",value:r.instructor,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"duration",placeholder:"Duration",value:r.duration,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"pdfUrl",placeholder:"PDF URL",value:r.pdfUrl,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"year",type:"number",placeholder:"Year",value:r.year,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]});case"books":return d.jsxs(d.Fragment,{children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"authors",placeholder:"Authors",value:r.authors,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"edition",placeholder:"Edition",value:r.edition,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"year",type:"number",placeholder:"Year",value:r.year,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"url",placeholder:"Link",value:r.url,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]});case"videos":return d.jsxs(d.Fragment,{children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"instructor",placeholder:"Instructor",value:r.instructor,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"duration",placeholder:"Duration",value:r.duration,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"thumbnail",placeholder:"Thumbnail URL",value:r.thumbnail,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"videoUrl",placeholder:"Video URL",value:r.videoUrl,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"year",type:"number",placeholder:"Year",value:r.year,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]});case"researchPapers":return d.jsxs(d.Fragment,{children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("textarea",{name:"authors",placeholder:"Authors (comma separated)",value:r.authors,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)] min-h-[100px]"}),d.jsx("div",{className:"text-sm text-[rgb(224,204,250)] mt-1 mb-4",children:'Enter authors separated by commas (e.g., "John Smith, Jane Doe, Bob Johnson")'}),d.jsx("textarea",{name:"abstract",placeholder:"Abstract",value:r.abstract,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)] min-h-[150px]"}),d.jsx("input",{name:"url",placeholder:"Paper URL",value:r.url,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"year",type:"number",placeholder:"Year",value:r.year,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"tags",placeholder:"Tags (comma separated, e.g., Cryptanalysis, Attacks, Cryptography)",value:((I=r.tags)==null?void 0:I.join(", "))||"",onChange:N=>{const D=l(N.target.value);o({...r,tags:D})},className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("div",{className:"text-sm text-[rgb(224,204,250)] mt-1 mb-4",children:'Enter tags separated by commas (e.g., "Cryptanalysis, Attacks, Cryptography")'})]});default:return null}},C=I=>Object.keys(n[I]).sort((D,O)=>O.localeCompare(D)).map(D=>d.jsxs("div",{className:"mb-8",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-4 border-b border-[rgb(136,58,234)] pb-2",children:D==="Uncategorized"?"Uncategorized":`Year: ${D}`}),d.jsx("div",{className:"grid md:grid-cols-2 gap-6",children:n[I][D].map(O=>d.jsxs(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},whileHover:{scale:1.02},className:"bg-[#23262d] rounded-lg border border-[rgb(136,58,234)] transition-all duration-300 shadow-lg p-6",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:O.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4 text-sm",children:O.description}),O.instructor&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Instructor:"})," ",O.instructor]}),O.duration&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Duration:"})," ",O.duration]}),O.authors&&I==="researchPapers"?d.jsxs("div",{className:"mt-2 mb-2",children:[d.jsx("p",{className:"text-white",children:d.jsx("strong",{children:"Authors:"})}),d.jsx("ul",{className:"list-disc pl-5 mt-1 mb-2",children:p(O.authors).map((L,G)=>d.jsx("li",{className:"text-white text-sm",children:L},G))})]}):O.authors&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Authors:"})," ",O.authors]}),O.tags&&I==="researchPapers"&&d.jsxs("div",{className:"mt-2 mb-2",children:[d.jsx("p",{className:"text-white",children:d.jsx("strong",{children:"Tags:"})}),d.jsx("div",{className:"flex flex-wrap gap-2 mt-2",children:O.tags.map((L,G)=>d.jsx("span",{className:"px-2 py-1 bg-[rgb(49,10,101)] text-[rgb(224,204,250)] rounded-full text-xs",children:L},G))})]}),O.edition&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Edition:"})," ",O.edition]}),O.year&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Year:"})," ",O.year]}),O.url&&d.jsxs("p",{className:"text-white",children:[d.jsx("strong",{children:"Link:"}),d.jsx("a",{href:O.url,target:"_blank",rel:"noopener noreferrer",className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] ml-2",children:O.url})]}),O.thumbnail&&d.jsx("img",{src:O.thumbnail,alt:O.title,className:"w-full h-32 object-cover rounded-lg mt-3"}),u&&d.jsxs("div",{className:"flex space-x-2 mt-4",children:[d.jsx("button",{onClick:()=>{i(O),o({...O,type:I})},className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>b(O.id,I,D),className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]},O.id))})]},D));return d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>h("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Manage Resources"}),u&&d.jsxs("button",{onClick:()=>i({}),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add Resource"]}),d.jsx("div",{className:"flex space-x-2 border-b border-[rgb(49,10,101)]",children:["lectures","books","videos","researchPapers"].map(I=>d.jsx(te.button,{onClick:()=>o(N=>({...N,type:I})),whileHover:{scale:1.05},whileTap:{scale:.95},className:`flex items-center space-x-2 px-4 py-2 rounded-t-lg transition-all duration-300 ${r.type===I?"text-white bg-[rgb(49,10,101)] border-t border-l border-r border-[rgb(136,58,234)]":"text-[rgb(224,204,250)] hover:text-white"}`,children:d.jsx("span",{children:I.charAt(0).toUpperCase()+I.slice(1)})},I))}),d.jsx("div",{className:"space-y-8",children:C(r.type)}),t&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t.id?"Edit Resource":"Add Resource"}),d.jsxs("form",{onSubmit:x,className:"space-y-4",children:[d.jsxs("select",{name:"type",value:r.type,onChange:y,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",children:[d.jsx("option",{value:"lectures",children:"Lectures"}),d.jsx("option",{value:"books",children:"Books"}),d.jsx("option",{value:"videos",children:"Videos"}),d.jsx("option",{value:"researchPapers",children:"Research Papers"})]}),T(),d.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:()=>i(null),className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600",children:"Cancel"}),d.jsx("button",{type:"submit",className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)]",children:"Save"})]})]})]})})]})}function fz(){const[n,e]=V.useState([]),[t,i]=V.useState(null),[r,o]=V.useState({title:"",description:"",duration:"",capacity:0,enrolled:0,prerequisites:[],image:"",instructor:"",tools:[]}),{user:l}=Vr(),u=Wn();V.useEffect(()=>{(async()=>{const C=(await Ct(Ge(_e,"labs"))).docs.map(I=>({id:I.id,...I.data()}));e(C)})()},[]);const h=b=>{const{name:T,value:C}=b.target;o({...r,[T]:C})},p=(b,T)=>{const{value:C}=b.target;o({...r,[T]:C.split(",").map(I=>I.trim())})},g=async b=>{b.preventDefault();try{if(t!=null&&t.id)await qs(ht(_e,"labs",t.id),r),e(n.map(T=>T.id===t.id?{...T,...r}:T));else{const T=await $o(Ge(_e,"labs"),r);e([...n,{id:T.id,...r}])}i(null),y()}catch(T){console.error("Error saving lab:",T)}},y=()=>{o({title:"",description:"",duration:"",capacity:0,enrolled:0,prerequisites:[],image:"",instructor:"",tools:[]})},x=async b=>{await $s(ht(_e,"labs",b)),e(n.filter(T=>T.id!==b))};return d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>u("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Manage Labs"}),l&&d.jsxs("button",{onClick:()=>i({}),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add Lab"]}),d.jsx("div",{className:"grid gap-8",children:n.map(b=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"md:flex",children:[d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:b.image,alt:b.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:"p-6 md:w-2/3",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:b.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4",children:b.description}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.duration})}),d.jsx("div",{className:"flex items-center text-white",children:d.jsxs("span",{children:[b.enrolled,"/",b.capacity," Enrolled"]})}),d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.instructor})}),d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.tools.join(", ")})})]}),d.jsxs("div",{className:"mb-4",children:[d.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Prerequisites"}),d.jsx("ul",{className:"list-disc list-inside text-[rgb(224,204,250)]",children:b.prerequisites.map((T,C)=>d.jsx("li",{children:T},C))})]}),l&&d.jsxs("div",{className:"flex space-x-2 mt-4",children:[d.jsx("button",{onClick:()=>{i(b),o(b)},className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>x(b.id),className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]})]})},b.id))}),t&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t.id?"Edit Lab":"Add Lab"}),d.jsxs("form",{onSubmit:g,className:"space-y-4",children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("textarea",{name:"description",placeholder:"Description",value:r.description,onChange:h,required:!0,rows:"4",className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsx("input",{name:"duration",placeholder:"Duration",value:r.duration,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"instructor",placeholder:"Instructor",value:r.instructor,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsx("input",{name:"enrolled",type:"number",placeholder:"Enrolled",value:r.enrolled,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"capacity",type:"number",placeholder:"Capacity",value:r.capacity,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsx("input",{name:"prerequisites",placeholder:"Prerequisites (comma separated)",value:r.prerequisites.join(", "),onChange:b=>p(b,"prerequisites"),className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"tools",placeholder:"Tools (comma separated)",value:r.tools.join(", "),onChange:b=>p(b,"tools"),className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"image",placeholder:"Image URL",value:r.image,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:()=>{i(null),y()},className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600",children:"Cancel"}),d.jsx("button",{type:"submit",className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)]",children:"Save"})]})]})]})})]})}function pz(){const[n,e]=V.useState([]),[t,i]=V.useState(null),[r,o]=V.useState({title:"",startDate:"",endDate:"",time:"",location:"",description:"",image:"",capacity:0,registered:0,eventLink:"",gallery:[]}),{user:l}=Vr(),u=Wn();V.useEffect(()=>{(async()=>{const C=(await Ct(Ge(_e,"events"))).docs.map(I=>({id:I.id,...I.data()}));e(C)})()},[]);const h=b=>{const{name:T,value:C}=b.target;o({...r,[T]:C})},p=b=>{const{value:T}=b.target;o({...r,gallery:T.split(",").map(C=>C.trim())})},g=async b=>{b.preventDefault();try{const T={...r,date:r.startDate===r.endDate||!r.endDate?r.startDate:`${r.startDate} to ${r.endDate}`};if(t!=null&&t.id)await qs(ht(_e,"events",t.id),T),e(n.map(C=>C.id===t.id?{...C,...T}:C));else{const C=await $o(Ge(_e,"events"),T);e([...n,{id:C.id,...T}])}i(null),y()}catch(T){console.error("Error saving event:",T)}},y=()=>{o({title:"",startDate:"",endDate:"",time:"",location:"",description:"",image:"",capacity:0,registered:0,eventLink:"",gallery:[]})},x=async b=>{await $s(ht(_e,"events",b)),e(n.filter(T=>T.id!==b))};return d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>u("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Manage Events"}),l&&d.jsxs("button",{onClick:()=>i({}),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add Event"]}),d.jsx("div",{className:"grid gap-8",children:n.map(b=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:"bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300",children:d.jsxs("div",{className:"md:flex",children:[d.jsx("div",{className:"md:w-1/3",children:d.jsx("img",{src:b.image,alt:b.title,className:"h-full w-full object-cover"})}),d.jsxs("div",{className:"p-6 md:w-2/3",children:[d.jsx("h3",{className:"text-xl font-bold text-white mb-2",children:b.title}),d.jsx("p",{className:"text-[rgb(224,204,250)] mb-4",children:b.description}),d.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.date})}),b.time&&d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.time})}),d.jsx("div",{className:"flex items-center text-white",children:d.jsx("span",{children:b.location})}),d.jsx("div",{className:"flex items-center text-white",children:d.jsxs("span",{children:[b.registered,"/",b.capacity," Registered"]})})]}),l&&d.jsxs("div",{className:"flex space-x-2 mt-4",children:[d.jsx("button",{onClick:()=>{var C;i(b);const T=(C=b.date)!=null&&C.includes(" to ")?b.date.split(" to "):[b.date,b.date];o({...b,startDate:T[0],endDate:T[1]})},className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>x(b.id),className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]})]})},b.id))}),t&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t.id?"Edit Event":"Add Event"}),d.jsxs("form",{onSubmit:g,className:"space-y-4",children:[d.jsx("input",{name:"title",placeholder:"Title",value:r.title,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("textarea",{name:"description",placeholder:"Description",value:r.description,onChange:h,required:!0,rows:"4",className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-white block mb-1",children:"Start Date"}),d.jsx("input",{name:"startDate",type:"date",value:r.startDate,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-white block mb-1",children:"End Date (optional)"}),d.jsx("input",{name:"endDate",type:"date",value:r.endDate,onChange:h,min:r.startDate,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]})]}),d.jsx("input",{name:"time",placeholder:"Time (optional, e.g., 10:00 AM - 4:00 PM)",value:r.time,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"location",placeholder:"Location",value:r.location,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"image",placeholder:"Image URL",value:r.image,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsx("input",{name:"eventLink",placeholder:"Event Website URL",value:r.eventLink,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"}),d.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"text-white block mb-1",children:"Capacity"}),d.jsx("input",{name:"capacity",type:"number",placeholder:"Capacity",value:r.capacity,onChange:h,required:!0,min:"0",className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-white block mb-1",children:"Registered"}),d.jsx("input",{name:"registered",type:"number",placeholder:"Registered",value:r.registered,onChange:h,min:"0",max:r.capacity,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]})]}),d.jsxs("div",{children:[d.jsx("label",{className:"text-white block mb-1",children:"Gallery Image URLs (comma separated)"}),d.jsx("textarea",{name:"gallery",placeholder:"https://example.com/image1.jpg, https://example.com/image2.jpg",value:(r.gallery||[]).join(", "),onChange:p,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",rows:"2"})]}),d.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:()=>{i(null),y()},className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600",children:"Cancel"}),d.jsx("button",{type:"submit",className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)]",children:"Save"})]})]})]})})]})}function mz(){const[n,e]=V.useState([]),[t,i]=V.useState(null),[r,o]=V.useState({name:"",role:"",specialization:"",image:"",email:"",github:"",linkedin:"",isHead:!1,year:""}),{user:l}=Vr(),u=Wn();V.useEffect(()=>{(async()=>{const T=(await Ct(Ge(_e,"members"))).docs.map(C=>({id:C.id,...C.data()}));e(T)})()},[]);const h=x=>{const{name:b,value:T,type:C,checked:I}=x.target;o({...r,[b]:C==="checkbox"?I:T})},p=async x=>{x.preventDefault();try{if(t!=null&&t.id)await qs(ht(_e,"members",t.id),r),e(n.map(b=>b.id===t.id?{...b,...r}:b));else{const b=await $o(Ge(_e,"members"),r);e([...n,{id:b.id,...r}])}i(null),g()}catch(b){console.error("Error saving member:",b)}},g=()=>{o({name:"",role:"",specialization:"",image:"",email:"",github:"",linkedin:"",isHead:!1,year:""})},y=async x=>{await $s(ht(_e,"members",x)),e(n.filter(b=>b.id!==x))};return d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>u("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Manage Members"}),l&&d.jsxs("button",{onClick:()=>i({}),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-2"}),"Add Member"]}),d.jsxs("div",{className:"space-y-8",children:[d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Head Faculty"}),n.filter(x=>x.isHead).map(x=>d.jsx(P1,{member:x,onEdit:()=>{i(x),o(x)},onDelete:()=>y(x.id),isAdmin:l,isHead:!0},x.id))]}),d.jsxs("div",{children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-4",children:"Team Members"}),d.jsx("div",{className:"grid gap-8 md:grid-cols-2",children:n.filter(x=>!x.isHead).map(x=>d.jsx(P1,{member:x,onEdit:()=>{i(x),o(x)},onDelete:()=>y(x.id),isAdmin:l,isHead:!1},x.id))})]})]}),t&&d.jsx("div",{className:"fixed inset-0 flex items-center justify-center bg-black bg-opacity-50 p-4",children:d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 w-full max-w-2xl max-h-screen overflow-y-auto",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:t.id?"Edit Member":"Add Member"}),d.jsxs("form",{onSubmit:p,className:"space-y-4",children:[d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Name"}),d.jsx("input",{name:"name",value:r.name,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Role"}),d.jsx("input",{name:"role",value:r.role,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Specialization"}),d.jsx("input",{name:"specialization",value:r.specialization,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Year"}),d.jsx("input",{name:"year",type:"number",value:r.year,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]",placeholder:"e.g. 2023"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Email"}),d.jsx("input",{name:"email",type:"email",value:r.email,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"GitHub Username"}),d.jsx("input",{name:"github",value:r.github,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]})]}),d.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"LinkedIn Username"}),d.jsx("input",{name:"linkedin",value:r.linkedin,onChange:h,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]}),d.jsxs("div",{children:[d.jsx("label",{className:"block text-[rgb(224,204,250)] mb-2",children:"Image URL"}),d.jsx("input",{name:"image",value:r.image,onChange:h,required:!0,className:"w-full bg-[#13151a] text-white rounded-md px-4 py-2 border border-[rgb(136,58,234)]"})]})]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx("input",{name:"isHead",type:"checkbox",checked:r.isHead,onChange:h,className:"h-4 w-4 text-[rgb(136,58,234)] rounded border-gray-300 focus:ring-[rgb(136,58,234)]"}),d.jsx("label",{className:"ml-2 text-[rgb(224,204,250)]",children:"Is Head Faculty Member"})]}),d.jsxs("div",{className:"mt-6 flex justify-end space-x-4",children:[d.jsx("button",{type:"button",onClick:()=>{i(null),g()},className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600",children:"Cancel"}),d.jsx("button",{type:"submit",className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)]",children:"Save"})]})]})]})})]})}const P1=({member:n,onEdit:e,onDelete:t,isAdmin:i,isHead:r})=>d.jsx(te.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},className:`bg-[#23262d] rounded-lg overflow-hidden border border-[rgb(136,58,234)] hover:border-[rgb(224,204,250)] transition-all duration-300 ${r?"md:max-w-2xl mx-auto":""}`,whileHover:{scale:1.02},children:d.jsxs("div",{className:"p-6",children:[d.jsxs("div",{className:`flex ${r?"flex-col md:flex-row":"flex-row"} items-center space-x-4`,children:[d.jsx("img",{src:n.image,alt:n.name,className:`${r?"w-32 h-32 md:w-40 md:h-40":"w-24 h-24"} rounded-full object-cover border-2 border-[rgb(136,58,234)]`}),d.jsxs("div",{className:`${r?"text-center md:text-left mt-4 md:mt-0":""}`,children:[d.jsx("h3",{className:`${r?"text-2xl":"text-xl"} font-bold text-white`,children:n.name}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:n.role}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:n.specialization}),n.year&&d.jsxs("p",{className:"text-[rgb(224,204,250)]",children:["Year: ",n.year]})]})]}),d.jsxs("div",{className:"mt-4 flex space-x-4 justify-center md:justify-start",children:[n.email&&d.jsx("a",{href:`mailto:${n.email}`,className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(W1,{className:"h-5 w-5"})}),n.github&&d.jsx("a",{href:`https://github.com/${n.github}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx($1,{className:"h-5 w-5"})}),n.linkedin&&d.jsx("a",{href:`https://linkedin.com/in/${n.linkedin}`,target:"_blank",rel:"noopener noreferrer",className:"text-white hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(H1,{className:"h-5 w-5"})})]}),i&&d.jsxs("div",{className:"flex space-x-2 mt-4 justify-center md:justify-start",children:[d.jsx("button",{onClick:e,className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(xs,{className:"h-5 w-5"})}),d.jsx("button",{onClick:t,className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]})]})});function gz(){var g;const[n,e]=V.useState({pending:[],approved:[]}),[t,i]=V.useState(!0),[r,o]=V.useState(null),l=Wn(),u=y=>{if(!y)return"N/A";try{return typeof y.toDate=="function"?y.toDate().toLocaleDateString():y.seconds?new Date(y.seconds*1e3).toLocaleDateString():typeof y=="string"?new Date(y).toLocaleDateString():"N/A"}catch{return"N/A"}};V.useEffect(()=>{(async()=>{try{const[x,b]=[zd(Ge(_e,"blogs"),Bd("approved","==",!1),qd("date","desc")),zd(Ge(_e,"blogs"),Bd("approved","==",!0),qd("date","desc"))],[T,C]=await Promise.all([Ct(x),Ct(b)]);e({pending:T.docs.map(I=>({id:I.id,...I.data()})),approved:C.docs.map(I=>({id:I.id,...I.data()}))})}catch(x){console.error("Error fetching blogs:",x)}finally{i(!1)}})()},[]);const h=async y=>{try{await qs(ht(_e,"blogs",y),{approved:!0}),e(x=>({pending:x.pending.filter(b=>b.id!==y),approved:[...x.approved,x.pending.find(b=>b.id===y)]}))}catch(x){console.error("Error approving blog:",x)}},p=async(y,x=!1)=>{if(window.confirm("Are you sure you want to delete this blog post?"))try{await $s(ht(_e,"blogs",y)),e(b=>({pending:x?b.pending.filter(T=>T.id!==y):b.pending,approved:x?b.approved:b.approved.filter(T=>T.id!==y)})),(r==null?void 0:r.id)===y&&o(null)}catch(b){console.error("Error deleting blog:",b)}};return t?d.jsx("div",{className:"flex justify-center items-center h-64",children:d.jsx("div",{className:"text-white",children:"Loading blogs..."})}):r?d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-6",children:[d.jsxs("div",{className:"flex justify-between items-center",children:[d.jsxs("button",{onClick:()=>o(null),className:"flex items-center text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] mb-4",children:[d.jsx(Is,{className:"h-5 w-5 mr-1 transform rotate-180"}),"Back to all blogs"]}),d.jsxs("button",{onClick:()=>l("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300 mb-4",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})]}),d.jsxs("div",{className:"bg-[#23262d] rounded-lg border border-[rgb(136,58,234)] p-6",children:[d.jsxs("div",{className:"flex justify-between items-start mb-4",children:[d.jsx("h2",{className:"text-2xl font-bold text-white",children:r.title}),d.jsxs("div",{className:"flex space-x-2",children:[!r.approved&&d.jsx("button",{onClick:()=>h(r.id),className:"text-green-500 hover:text-green-400 p-1",title:"Approve",children:d.jsx(fw,{className:"h-5 w-5"})}),d.jsx("button",{onClick:()=>p(r.id,!r.approved),className:"text-red-500 hover:text-red-400 p-1",title:"Delete",children:d.jsx(zn,{className:"h-5 w-5"})})]})]}),d.jsxs("div",{className:"flex items-center space-x-4 text-[rgb(224,204,250)] mb-4",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Nc,{className:"h-4 w-4 mr-2"}),r.author||"Anonymous"]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Tr,{className:"h-4 w-4 mr-2"}),u(r.date)]}),d.jsx("div",{className:"flex items-center",children:d.jsx("span",{className:`px-2 py-1 rounded-md text-xs ${r.approved?"bg-green-900 text-green-200":"bg-yellow-900 text-yellow-200"}`,children:r.approved?"Approved":"Pending"})})]}),d.jsx("div",{className:"prose prose-invert max-w-none",children:d.jsx("p",{className:"text-[rgb(224,204,250)] whitespace-pre-line",children:r.content})}),((g=r.tags)==null?void 0:g.length)>0&&d.jsxs("div",{className:"mt-6",children:[d.jsx("h3",{className:"text-lg font-semibold text-white mb-2",children:"Tags"}),d.jsx("div",{className:"flex flex-wrap gap-2",children:r.tags.map((y,x)=>d.jsx("span",{className:"bg-[rgb(49,10,101)] text-[rgb(224,204,250)] px-3 py-1 rounded-md text-sm",children:y},x))})]})]})]}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},className:"space-y-8",children:[d.jsx("div",{className:"flex justify-between items-center",children:d.jsxs("button",{onClick:()=>l("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]})}),d.jsx("h1",{className:"text-3xl font-bold text-white mb-6",children:"Manage Blog Posts"}),n.pending.length>0&&d.jsxs("div",{className:"space-y-4",children:[d.jsxs("h2",{className:"text-2xl font-semibold text-white border-b border-[rgb(136,58,234)] pb-2",children:["Pending Approval (",n.pending.length,")"]}),d.jsx("div",{className:"grid gap-6",children:n.pending.map(y=>d.jsxs(te.div,{whileHover:{scale:1.01},className:"bg-[#23262d] rounded-lg border border-yellow-600 p-4 cursor-pointer",onClick:()=>o(y),children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:y.title}),d.jsxs("div",{className:"flex space-x-2",children:[d.jsx("button",{onClick:x=>{x.stopPropagation(),h(y.id)},className:"text-green-500 hover:text-green-400 p-1",title:"Approve",children:d.jsx(fw,{className:"h-4 w-4"})}),d.jsx("button",{onClick:x=>{x.stopPropagation(),p(y.id,!0)},className:"text-red-500 hover:text-red-400 p-1",title:"Reject",children:d.jsx(ko,{className:"h-4 w-4"})})]})]}),d.jsxs("div",{className:"flex items-center space-x-4 text-[rgb(224,204,250)] text-sm",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Nc,{className:"h-3 w-3 mr-1"}),y.author||"Anonymous"]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Tr,{className:"h-3 w-3 mr-1"}),u(y.date)]})]}),d.jsx("p",{className:"text-[rgb(224,204,250)] mt-2 line-clamp-2",children:y.content})]},y.id))})]}),d.jsxs("div",{className:"space-y-4",children:[d.jsxs("h2",{className:"text-2xl font-semibold text-white border-b border-[rgb(136,58,234)] pb-2",children:["Approved Posts (",n.approved.length,")"]}),n.approved.length>0?d.jsx("div",{className:"grid gap-6",children:n.approved.map(y=>d.jsxs(te.div,{whileHover:{scale:1.01},className:"bg-[#23262d] rounded-lg border border-[rgb(136,58,234)] p-4 cursor-pointer",onClick:()=>o(y),children:[d.jsxs("div",{className:"flex justify-between items-start",children:[d.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:y.title}),d.jsx("div",{className:"flex space-x-2",children:d.jsx("button",{onClick:x=>{x.stopPropagation(),p(y.id)},className:"text-red-500 hover:text-red-400 p-1",title:"Delete",children:d.jsx(zn,{className:"h-4 w-4"})})})]}),d.jsxs("div",{className:"flex items-center space-x-4 text-[rgb(224,204,250)] text-sm",children:[d.jsxs("div",{className:"flex items-center",children:[d.jsx(Nc,{className:"h-3 w-3 mr-1"}),y.author||"Anonymous"]}),d.jsxs("div",{className:"flex items-center",children:[d.jsx(Tr,{className:"h-3 w-3 mr-1"}),u(y.date)]})]}),d.jsx("p",{className:"text-[rgb(224,204,250)] mt-2 line-clamp-2",children:y.content})]},y.id))}):d.jsx("p",{className:"text-white text-center py-8",children:"No approved blog posts found"})]})]})}const yz={Users:Zi,BookOpen:Ao,Award:U1,Building:z1};function vz(){const[n,e]=V.useState({stats:[],researchAreas:[],contact:{location:"",details:""}}),[t,i]=V.useState(null),[r,o]=V.useState(null),[l,u]=V.useState(!0),[h,p]=V.useState({success:null,message:""}),{user:g}=Vr(),y=Wn();V.useEffect(()=>{(async()=>{try{const G=ht(_e,"content","about"),X=await Eu(G);if(X.exists()){const k=X.data();e({stats:k.stats||[],researchAreas:k.researchAreas||[],contact:k.contact||{location:"",details:""}})}else{const k={stats:[{name:"Active Students",value:"500+",icon:"Users"},{name:"Research Papers",value:"150+",icon:"BookOpen"},{name:"Awards",value:"25+",icon:"Award"},{name:"Partner Institutions",value:"10+",icon:"Building"}],researchAreas:[{title:"Applied Cryptography",points:["Public Key Infrastructure","Secure Communication Protocols","Blockchain Technology","Zero-Knowledge Proofs"]},{title:"Cryptanalysis",points:["Side-Channel Attacks","Quantum Cryptanalysis","Mathematical Cryptanalysis","Hardware Security"]}],contact:{location:"Cryptography Research Lab, IIIT Delhi, Okhla Industrial Estate, Phase III, New Delhi, India",details:`Email: Under-Development Phone: Under-Development Office Hours: Under-Development`}};await a1(G,k),e(k)}}catch(G){console.error("Error fetching about data:",G),p({success:!1,message:"Failed to load data"})}finally{u(!1)}})()},[]);const x=async()=>{p({success:null,message:"Saving..."});try{const L=ht(_e,"content","about");await a1(L,n,{merge:!0}),p({success:!0,message:"Saved successfully!"}),setTimeout(()=>{p({success:null,message:""})},3e3)}catch(L){console.error("Error saving about data:",L),p({success:!1,message:`Error saving data: ${L.message}`})}},b=(L,G)=>{i(L),o(JSON.parse(JSON.stringify(G)))},T=(L,G,X)=>{if(Array.isArray(r)){const k=[...r];G?k[X]={...k[X],[G]:L.target.value}:k[X]=L.target.value,o(k)}else o(typeof r=="object"&&r!==null?{...r,[G]:L.target.value}:L.target.value)},C=()=>{let L={...n};switch(t){case"stats":case"researchAreas":L[t]=r;break;case"contactLocation":L.contact.location=r;break;case"contactDetails":L.contact.details=r;break}e(L),i(null)},I=()=>{const L=[...n.stats,{name:"",value:"",icon:"Users"}];e({...n,stats:L})},N=L=>{const G=n.stats.filter((X,k)=>k!==L);e({...n,stats:G})},D=()=>{const L=[...n.researchAreas,{title:"",points:[""]}];e({...n,researchAreas:L})},O=L=>{const G=n.researchAreas.filter((X,k)=>k!==L);e({...n,researchAreas:G})};return l?d.jsx("div",{className:"min-h-screen bg-[#13151a] flex items-center justify-center text-white",children:"Loading..."}):d.jsxs(te.div,{initial:{opacity:0},animate:{opacity:1},transition:{duration:.2},className:"bg-[#13151a] min-h-screen p-8 text-white",children:[h.message&&d.jsx("div",{className:`fixed bottom-4 right-4 p-4 rounded-md ${h.success===!0?"bg-green-600":h.success===!1?"bg-red-600":"bg-blue-600"} text-white z-50 transition-opacity duration-300`,children:h.message}),d.jsxs("div",{className:"flex justify-between items-center mb-8",children:[d.jsxs("button",{onClick:()=>y("/admin"),className:"flex items-center text-white hover:text-[rgb(136,58,234)] transition-colors duration-300",children:[d.jsx(Ar,{className:"h-5 w-5 mr-2"}),"Go Back to Dashboard"]}),g&&d.jsx("button",{onClick:x,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",disabled:h.message==="Saving...",children:h.message==="Saving..."?"Saving...":d.jsxs(d.Fragment,{children:[d.jsx(Jk,{className:"h-4 w-4 mr-2"}),"Save All Changes"]})})]}),d.jsx("h1",{className:"text-3xl font-bold mb-8 text-center text-[rgb(224,204,250)]",children:"Manage About Page Content"}),d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 mb-8 border border-[rgb(136,58,234)]",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-2",children:"About VeilCode Labs"}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:"VeilCode Labs is IIIT Delhi's premier platform for cryptography education and research, fostering collaboration and excellence in the field of cryptography and security."})]}),d.jsxs("div",{className:"grid md:grid-cols-2 gap-8 mb-8",children:[d.jsxs("div",{className:"bg-[rgba(49,10,101,0.2)] rounded-lg p-6",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Our Mission"}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:"To provide world-class education and research opportunities in cryptography, fostering innovation and excellence in information security."})]}),d.jsxs("div",{className:"bg-[rgba(49,10,101,0.2)] rounded-lg p-6",children:[d.jsx("h2",{className:"text-xl font-bold text-white mb-2",children:"Our Vision"}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:"To be a leading center of excellence in cryptography research and education, contributing to secure communication technologies."})]})]}),d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-6 mb-8 border border-[rgb(136,58,234)]",children:[d.jsxs("div",{className:"flex justify-between items-center mb-4",children:[d.jsx("h2",{className:"text-xl font-bold text-white",children:"Statistics"}),g&&d.jsxs("div",{className:"flex gap-2",children:[t!=="stats"&&d.jsxs("button",{onClick:()=>b("stats",[...n.stats]),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(Zh,{className:"h-4 w-4 mr-1"})," Edit"]}),d.jsxs("button",{onClick:I,className:"bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-1"})," Add"]})]})]}),t==="stats"?d.jsxs("div",{className:"space-y-6",children:[d.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:r.map((L,G)=>d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("input",{type:"text",value:L.name,onChange:X=>T(X,"name",G),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]",placeholder:"Stat name"}),d.jsx("button",{onClick:()=>{const X=r.filter((k,P)=>P!==G);o(X)},className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]}),d.jsx("input",{type:"text",value:L.value,onChange:X=>T(X,"value",G),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]",placeholder:"Stat value"}),d.jsxs("select",{value:L.icon,onChange:X=>T(X,"icon",G),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]",children:[d.jsx("option",{value:"Users",children:"Users Icon"}),d.jsx("option",{value:"BookOpen",children:"Book Icon"}),d.jsx("option",{value:"Award",children:"Award Icon"}),d.jsx("option",{value:"Building",children:"Building Icon"})]})]},G))}),d.jsxs("div",{className:"flex justify-between",children:[d.jsxs("button",{onClick:()=>o([...r,{name:"",value:"",icon:"Users"}]),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-1"})," Add Stat"]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("button",{onClick:()=>i(null),className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600 transition-colors duration-300",children:"Cancel"}),d.jsx("button",{onClick:C,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:"Save"})]})]})]}):d.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:n.stats.length>0?n.stats.map((L,G)=>{const X=yz[L.icon]||Zi;return d.jsxs("div",{className:"bg-[rgba(49,10,101,0.2)] p-4 rounded-lg text-center relative",children:[d.jsx(X,{className:"h-8 w-8 mx-auto text-[rgb(136,58,234)]"}),d.jsx("p",{className:"mt-4 text-2xl font-semibold text-white",children:L.value||"Value"}),d.jsx("p",{className:"text-[rgb(224,204,250)]",children:L.name||"Stat Name"}),g&&d.jsx("button",{onClick:()=>N(G),className:"absolute top-1 right-1 text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-4 w-4"})})]},G)}):d.jsx("div",{className:"col-span-4 text-center text-[rgb(224,204,250)] py-4",children:"No statistics added yet"})})]}),d.jsxs("div",{className:"bg-[#23262d] rounded-lg p-8 border border-[rgb(136,58,234)] mb-8",children:[d.jsxs("div",{className:"flex justify-between items-center mb-6",children:[d.jsx("h2",{className:"text-2xl font-bold text-white",children:"Research Areas"}),g&&d.jsxs("div",{className:"flex gap-2",children:[t!=="researchAreas"&&d.jsxs("button",{onClick:()=>b("researchAreas",[...n.researchAreas]),className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(Zh,{className:"h-4 w-4 mr-1"})," Edit"]}),d.jsxs("button",{onClick:D,className:"bg-green-600 text-white py-2 px-4 rounded-md hover:bg-green-700 transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-1"})," Add"]})]})]}),t==="researchAreas"?d.jsxs("div",{className:"space-y-8",children:[r.map((L,G)=>d.jsxs("div",{className:"space-y-4",children:[d.jsxs("div",{className:"flex items-center gap-4",children:[d.jsx("input",{type:"text",value:L.title,onChange:X=>{const k=[...r];k[G].title=X.target.value,o(k)},className:"flex-1 bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)] text-xl font-semibold",placeholder:"Research Area Title"}),d.jsx("button",{onClick:()=>{const X=r.filter((k,P)=>P!==G);o(X)},className:"text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]}),d.jsxs("div",{className:"space-y-2 ml-6",children:[L.points.map((X,k)=>d.jsxs("div",{className:"flex items-center gap-2",children:[d.jsx("span",{className:"text-[rgb(224,204,250)]",children:"•"}),d.jsx("input",{type:"text",value:X,onChange:P=>{const R=[...r];R[G].points[k]=P.target.value,o(R)},className:"flex-1 bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)]"}),d.jsx("button",{onClick:()=>{const P=[...r];P[G].points=P[G].points.filter((R,F)=>F!==k),o(P)},className:"text-red-500 hover:text-red-400 transition-colors duration-300",children:d.jsx(zn,{className:"h-4 w-4"})})]},k)),d.jsxs("button",{onClick:()=>{const X=[...r];X[G].points.push(""),o(X)},className:"text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300 flex items-center text-sm mt-2",children:[d.jsx(oi,{className:"h-3 w-3 mr-1"})," Add Point"]})]})]},G)),d.jsxs("div",{className:"flex justify-between pt-4",children:[d.jsxs("button",{onClick:()=>{o([...r,{title:"",points:[""]}])},className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300 flex items-center",children:[d.jsx(oi,{className:"h-4 w-4 mr-1"})," Add Research Area"]}),d.jsxs("div",{className:"flex gap-4",children:[d.jsx("button",{onClick:()=>i(null),className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600 transition-colors duration-300",children:"Cancel"}),d.jsx("button",{onClick:C,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:"Save"})]})]})]}):d.jsx("div",{className:"space-y-8",children:n.researchAreas.length>0?n.researchAreas.map((L,G)=>d.jsxs("div",{className:"relative",children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:L.title||"Research Area Title"}),d.jsx("ul",{className:"list-disc list-inside text-white space-y-2 ml-4",children:L.points.map((X,k)=>d.jsx("li",{children:X||"Research point..."},k))}),g&&d.jsx("button",{onClick:()=>O(G),className:"absolute top-0 right-0 text-red-500 hover:text-red-600 transition-colors duration-300",children:d.jsx(zn,{className:"h-5 w-5"})})]},G)):d.jsx("div",{className:"text-center text-[rgb(224,204,250)] py-4",children:"No research areas added yet"})})]}),d.jsxs("div",{className:"bg-[rgba(49,10,101,0.2)] rounded-lg p-6",children:[d.jsx("h2",{className:"text-2xl font-bold text-white mb-4",children:"Contact Information"}),d.jsx("div",{className:"grid md:grid-cols-2 gap-8",children:[{section:"contactLocation",title:"Location",content:n.contact.location},{section:"contactDetails",title:"Get in Touch",content:n.contact.details}].map(L=>d.jsx("div",{className:"relative",children:t===L.section?d.jsxs("div",{className:"space-y-4",children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:L.title}),d.jsx("textarea",{value:r,onChange:G=>o(G.target.value),className:"w-full bg-[#13151a] rounded-md p-2 text-white border border-[rgb(136,58,234)] h-32"}),d.jsxs("div",{className:"flex justify-end space-x-4",children:[d.jsx("button",{onClick:()=>i(null),className:"bg-gray-500 text-white py-2 px-4 rounded-md hover:bg-gray-600 transition-colors duration-300",children:"Cancel"}),d.jsx("button",{onClick:C,className:"bg-[rgb(136,58,234)] text-white py-2 px-4 rounded-md hover:bg-[rgb(49,10,101)] transition-colors duration-300",children:"Save"})]})]}):d.jsxs(d.Fragment,{children:[d.jsx("h3",{className:"text-xl font-semibold text-[rgb(224,204,250)] mb-2",children:L.title}),d.jsx("p",{className:"text-white whitespace-pre-line",children:L.content||`${L.title} information...`}),g&&d.jsx("button",{onClick:()=>b(L.section,L.content),className:"absolute top-0 right-0 text-[rgb(136,58,234)] hover:text-[rgb(224,204,250)] transition-colors duration-300",children:d.jsx(Zh,{className:"h-5 w-5"})})]})},L.section))})]})]})}function xz(){const{user:n}=Vr();return d.jsxs(Ok,{children:[d.jsx(oz,{}),d.jsx(tP,{children:d.jsxs(Pk,{children:[d.jsx(Rt,{path:"/",element:d.jsx(YU,{})}),d.jsx(Rt,{path:"/courses",element:d.jsx(XU,{})}),d.jsx(Rt,{path:"/resources",element:d.jsx(ez,{})}),d.jsx(Rt,{path:"/events",element:d.jsx(JU,{})}),d.jsx(Rt,{path:"/members",element:d.jsx(tz,{})}),d.jsx(Rt,{path:"/about",element:d.jsx(nz,{})}),d.jsx(Rt,{path:"/blog",element:d.jsx(rz,{})}),d.jsx(Rt,{path:"/labs",element:d.jsx(sz,{})}),d.jsx(Rt,{path:"/admin-login",element:d.jsx(az,{})}),d.jsx(Rt,{path:"/admin",element:n?d.jsx(cz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/home",element:n?d.jsx(uz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/courses",element:n?d.jsx(hz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/resources",element:n?d.jsx(dz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/labs",element:n?d.jsx(fz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/events",element:n?d.jsx(pz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/members",element:n?d.jsx(mz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/blogs",element:n?d.jsx(gz,{}):d.jsx(Hi,{to:"/admin-login"})}),d.jsx(Rt,{path:"/admin/about",element:n?d.jsx(vz,{}):d.jsx(Hi,{to:"/admin-login"})})]})})]})}LI.createRoot(document.getElementById("root")).render(d.jsx(lz,{children:d.jsx(V.StrictMode,{children:d.jsx(xz,{})})}));
Close