const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/SignUp-Dc99vJqB.js","assets/SignUp-f5-5XPur.css","assets/PathwaySelection-gaCzt6_M.js","assets/circle-check-CEDUd2_b.js","assets/PathwayDetails-CEpcSELs.js","assets/video-6xscjXLX.js","assets/message-circle-bhQHNNrv.js","assets/Payment-ZpLrvoBf.js","assets/index-D77RIKQ4.js","assets/index-CayIi7uc.js","assets/wallet-r5Fa81ex.js","assets/Community-BYN7kkqt.js","assets/calendar-CurgrDSD.js","assets/ProgramDetails-BE517FHa.js","assets/usePurchases-rQEjgq8A.js","assets/PaymentModal-DkAV3y_l.js","assets/ModuleContent-C8GzAdJU.js","assets/download-CQEUU27p.js","assets/PathwayComplet-y2_QjSka.js","assets/VideoPlayer-CDvhlV9h.js","assets/circle-alert-BQPfjTfu.js","assets/PathwayAlacarte-DmPOzuy9.js","assets/star-DryIZ4vI.js","assets/PathwayPersonnalise-DyGr8C7H.js","assets/About-Dpx79Ouc.js","assets/CompletePathwayEnrollment-BfXrXKGh.js","assets/Dashboard-DK4n7rTR.js","assets/progress-D5W0e0Nv.js","assets/MyCourses-ClxXa9t8.js","assets/Levels-Cq9GhKWn.js","assets/circle-check-big-Du07jO1U.js","assets/lock-DtWK7maD.js","assets/Level1-PgFxX1uQ.js","assets/Level2-HBf77q5S.js","assets/Level3-OBlH6L7Y.js","assets/Evaluations-8kG04Q7b.js","assets/AccountSettings-Dr5bKvCu.js","assets/textarea-BuXhJ3xX.js","assets/Certificates-uXo9iWUY.js","assets/share-2-CH1dc59x.js","assets/AboutIntranet-DatD_yya.js","assets/heart-CA-cu6T-.js","assets/CommunityIntranet-BksoYZob.js"])))=>i.map(i=>d[i]); var ED=Object.defineProperty;var Gx=t=>{throw TypeError(t)};var TD=(t,e,n)=>e in t?ED(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var _r=(t,e,n)=>TD(t,typeof e!="symbol"?e+"":e,n),Fp=(t,e,n)=>e.has(t)||Gx("Cannot "+n);var F=(t,e,n)=>(Fp(t,e,"read from private field"),n?n.call(t):e.get(t)),_e=(t,e,n)=>e.has(t)?Gx("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,n),ue=(t,e,n,r)=>(Fp(t,e,"write to private field"),r?r.call(t,n):e.set(t,n),n),zt=(t,e,n)=>(Fp(t,e,"access private method"),n);var Xc=(t,e,n,r)=>({set _(s){ue(t,e,s,n)},get _(){return F(t,e,r)}});function bD(t,e){for(var n=0;nr[s]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const i of s)if(i.type==="childList")for(const o of i.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function n(s){const i={};return s.integrity&&(i.integrity=s.integrity),s.referrerPolicy&&(i.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?i.credentials="include":s.crossOrigin==="anonymous"?i.credentials="omit":i.credentials="same-origin",i}function r(s){if(s.ep)return;s.ep=!0;const i=n(s);fetch(s.href,i)}})();function yS(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var vS={exports:{}},_f={},wS={exports:{}},ve={};/** * @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 cc=Symbol.for("react.element"),SD=Symbol.for("react.portal"),CD=Symbol.for("react.fragment"),ID=Symbol.for("react.strict_mode"),PD=Symbol.for("react.profiler"),AD=Symbol.for("react.provider"),RD=Symbol.for("react.context"),kD=Symbol.for("react.forward_ref"),ND=Symbol.for("react.suspense"),DD=Symbol.for("react.memo"),OD=Symbol.for("react.lazy"),Qx=Symbol.iterator;function LD(t){return t===null||typeof t!="object"?null:(t=Qx&&t[Qx]||t["@@iterator"],typeof t=="function"?t:null)}var xS={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},_S=Object.assign,ES={};function Ka(t,e,n){this.props=t,this.context=e,this.refs=ES,this.updater=n||xS}Ka.prototype.isReactComponent={};Ka.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=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,t,e,"setState")};Ka.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function TS(){}TS.prototype=Ka.prototype;function cv(t,e,n){this.props=t,this.context=e,this.refs=ES,this.updater=n||xS}var dv=cv.prototype=new TS;dv.constructor=cv;_S(dv,Ka.prototype);dv.isPureReactComponent=!0;var Yx=Array.isArray,bS=Object.prototype.hasOwnProperty,hv={current:null},SS={key:!0,ref:!0,__self:!0,__source:!0};function CS(t,e,n){var r,s={},i=null,o=null;if(e!=null)for(r in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)bS.call(e,r)&&!SS.hasOwnProperty(r)&&(s[r]=e[r]);var a=arguments.length-2;if(a===1)s.children=n;else if(1>>1,Y=M[H];if(0>>1;Hs(Oe,Q))yes(Pe,Oe)?(M[H]=Pe,M[ye]=Q,H=ye):(M[H]=Oe,M[me]=Q,H=me);else if(yes(Pe,Q))M[H]=Pe,M[ye]=Q,H=ye;else break e}}return B}function s(M,B){var Q=M.sortIndex-B.sortIndex;return Q!==0?Q:M.id-B.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,a=o.now();t.unstable_now=function(){return o.now()-a}}var l=[],u=[],d=1,h=null,f=3,p=!1,g=!1,w=!1,_=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,x=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function T(M){for(var B=n(u);B!==null;){if(B.callback===null)r(u);else if(B.startTime<=M)r(u),B.sortIndex=B.expirationTime,e(l,B);else break;B=n(u)}}function A(M){if(w=!1,T(M),!g)if(n(l)!==null)g=!0,X(k);else{var B=n(u);B!==null&&G(A,B.startTime-M)}}function k(M,B){g=!1,w&&(w=!1,v(S),S=-1),p=!0;var Q=f;try{for(T(B),h=n(l);h!==null&&(!(h.expirationTime>B)||M&&!N());){var H=h.callback;if(typeof H=="function"){h.callback=null,f=h.priorityLevel;var Y=H(h.expirationTime<=B);B=t.unstable_now(),typeof Y=="function"?h.callback=Y:h===n(l)&&r(l),T(B)}else r(l);h=n(l)}if(h!==null)var te=!0;else{var me=n(u);me!==null&&G(A,me.startTime-B),te=!1}return te}finally{h=null,f=Q,p=!1}}var L=!1,C=null,S=-1,I=5,P=-1;function N(){return!(t.unstable_now()-PM||125H?(M.sortIndex=Q,e(u,M),n(l)===null&&M===n(u)&&(w?(v(S),S=-1):w=!0,G(A,Q-H))):(M.sortIndex=Y,e(l,M),g||p||(g=!0,X(k))),M},t.unstable_shouldYield=N,t.unstable_wrapCallback=function(M){var B=f;return function(){var Q=f;f=B;try{return M.apply(this,arguments)}finally{f=Q}}}})(kS);RS.exports=kS;var KD=RS.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 GD=b,kn=KD;function W(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,n=1;n"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Qm=Object.prototype.hasOwnProperty,QD=/^[: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]*$/,Jx={},Zx={};function YD(t){return Qm.call(Zx,t)?!0:Qm.call(Jx,t)?!1:QD.test(t)?Zx[t]=!0:(Jx[t]=!0,!1)}function XD(t,e,n,r){if(n!==null&&n.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return r?!1:n!==null?!n.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JD(t,e,n,r){if(e===null||typeof e>"u"||XD(t,e,n,r))return!0;if(r)return!1;if(n!==null)switch(n.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function un(t,e,n,r,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=r,this.attributeNamespace=s,this.mustUseProperty=n,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var jt={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){jt[t]=new un(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];jt[e]=new un(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){jt[t]=new un(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){jt[t]=new un(t,2,!1,t,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(t){jt[t]=new un(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){jt[t]=new un(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){jt[t]=new un(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){jt[t]=new un(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){jt[t]=new un(t,5,!1,t.toLowerCase(),null,!1,!1)});var pv=/[\-:]([a-z])/g;function mv(t){return t[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(t){var e=t.replace(pv,mv);jt[e]=new un(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(pv,mv);jt[e]=new un(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(pv,mv);jt[e]=new un(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){jt[t]=new un(t,1,!1,t.toLowerCase(),null,!1,!1)});jt.xlinkHref=new un("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){jt[t]=new un(t,1,!1,t.toLowerCase(),null,!0,!0)});function gv(t,e,n,r){var s=jt.hasOwnProperty(e)?jt[e]:null;(s!==null?s.type!==0:r||!(2a||s[o]!==i[a]){var l=` `+s[o].replace(" at new "," at ");return t.displayName&&l.includes("")&&(l=l.replace("",t.displayName)),l}while(1<=o&&0<=a);break}}}finally{Bp=!1,Error.prepareStackTrace=n}return(t=t?t.displayName||t.name:"")?Ll(t):""}function ZD(t){switch(t.tag){case 5:return Ll(t.type);case 16:return Ll("Lazy");case 13:return Ll("Suspense");case 19:return Ll("SuspenseList");case 0:case 2:case 15:return t=zp(t.type,!1),t;case 11:return t=zp(t.type.render,!1),t;case 1:return t=zp(t.type,!0),t;default:return""}}function Zm(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case zo:return"Fragment";case Bo:return"Portal";case Ym:return"Profiler";case yv:return"StrictMode";case Xm:return"Suspense";case Jm:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case OS:return(t.displayName||"Context")+".Consumer";case DS:return(t._context.displayName||"Context")+".Provider";case vv:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case wv:return e=t.displayName||null,e!==null?e:Zm(t.type)||"Memo";case Os:e=t._payload,t=t._init;try{return Zm(t(e))}catch{}}return null}function eO(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Zm(e);case 8:return e===yv?"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 e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function hi(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function MS(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function tO(t){var e=MS(t)?"checked":"value",n=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),r=""+t[e];if(!t.hasOwnProperty(e)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var s=n.get,i=n.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){r=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:n.enumerable}),{getValue:function(){return r},setValue:function(o){r=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function ed(t){t._valueTracker||(t._valueTracker=tO(t))}function VS(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var n=e.getValue(),r="";return t&&(r=MS(t)?t.checked?"true":"false":t.value),t=r,t!==n?(e.setValue(t),!0):!1}function uh(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function eg(t,e){var n=e.checked;return nt({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:n??t._wrapperState.initialChecked})}function t_(t,e){var n=e.defaultValue==null?"":e.defaultValue,r=e.checked!=null?e.checked:e.defaultChecked;n=hi(e.value!=null?e.value:n),t._wrapperState={initialChecked:r,initialValue:n,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function jS(t,e){e=e.checked,e!=null&&gv(t,"checked",e,!1)}function tg(t,e){jS(t,e);var n=hi(e.value),r=e.type;if(n!=null)r==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+n):t.value!==""+n&&(t.value=""+n);else if(r==="submit"||r==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?ng(t,e.type,n):e.hasOwnProperty("defaultValue")&&ng(t,e.type,hi(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function n_(t,e,n){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var r=e.type;if(!(r!=="submit"&&r!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,n||e===t.value||(t.value=e),t.defaultValue=e}n=t.name,n!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,n!==""&&(t.name=n)}function ng(t,e,n){(e!=="number"||uh(t.ownerDocument)!==t)&&(n==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+n&&(t.defaultValue=""+n))}var Ml=Array.isArray;function ia(t,e,n,r){if(t=t.options,e){e={};for(var s=0;s"+e.valueOf().toString()+"",e=td.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function vu(t,e){if(e){var n=t.firstChild;if(n&&n===t.lastChild&&n.nodeType===3){n.nodeValue=e;return}}t.textContent=e}var Kl={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},nO=["Webkit","ms","Moz","O"];Object.keys(Kl).forEach(function(t){nO.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Kl[e]=Kl[t]})});function BS(t,e,n){return e==null||typeof e=="boolean"||e===""?"":n||typeof e!="number"||e===0||Kl.hasOwnProperty(t)&&Kl[t]?(""+e).trim():e+"px"}function zS(t,e){t=t.style;for(var n in e)if(e.hasOwnProperty(n)){var r=n.indexOf("--")===0,s=BS(n,e[n],r);n==="float"&&(n="cssFloat"),r?t.setProperty(n,s):t[n]=s}}var rO=nt({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 ig(t,e){if(e){if(rO[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(W(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(W(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(W(61))}if(e.style!=null&&typeof e.style!="object")throw Error(W(62))}}function og(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){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 ag=null;function xv(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var lg=null,oa=null,aa=null;function i_(t){if(t=fc(t)){if(typeof lg!="function")throw Error(W(280));var e=t.stateNode;e&&(e=Cf(e),lg(t.stateNode,t.type,e))}}function HS(t){oa?aa?aa.push(t):aa=[t]:oa=t}function WS(){if(oa){var t=oa,e=aa;if(aa=oa=null,i_(t),e)for(t=0;t>>=0,t===0?32:31-(pO(t)/mO|0)|0}var nd=64,rd=4194304;function Vl(t){switch(t&-t){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 t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function fh(t,e){var n=t.pendingLanes;if(n===0)return 0;var r=0,s=t.suspendedLanes,i=t.pingedLanes,o=n&268435455;if(o!==0){var a=o&~s;a!==0?r=Vl(a):(i&=o,i!==0&&(r=Vl(i)))}else o=n&~s,o!==0?r=Vl(o):i!==0&&(r=Vl(i));if(r===0)return 0;if(e!==0&&e!==r&&!(e&s)&&(s=r&-r,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(r&4&&(r|=n&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=r;0n;n++)e.push(t);return e}function dc(t,e,n){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ur(e),t[e]=n}function wO(t,e){var n=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var r=t.eventTimes;for(t=t.expirationTimes;0=Ql),p_=" ",m_=!1;function dC(t,e){switch(t){case"keyup":return KO.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hC(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Ho=!1;function QO(t,e){switch(t){case"compositionend":return hC(e);case"keypress":return e.which!==32?null:(m_=!0,p_);case"textInput":return t=e.data,t===p_&&m_?null:t;default:return null}}function YO(t,e){if(Ho)return t==="compositionend"||!Pv&&dC(t,e)?(t=uC(),Ld=Sv=Ks=null,Ho=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:n,offset:e-t};t=r}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=w_(n)}}function gC(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?gC(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function yC(){for(var t=window,e=uh();e instanceof t.HTMLIFrameElement;){try{var n=typeof e.contentWindow.location.href=="string"}catch{n=!1}if(n)t=e.contentWindow;else break;e=uh(t.document)}return e}function Av(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function iL(t){var e=yC(),n=t.focusedElem,r=t.selectionRange;if(e!==n&&n&&n.ownerDocument&&gC(n.ownerDocument.documentElement,n)){if(r!==null&&Av(n)){if(e=r.start,t=r.end,t===void 0&&(t=e),"selectionStart"in n)n.selectionStart=e,n.selectionEnd=Math.min(t,n.value.length);else if(t=(e=n.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=n.textContent.length,i=Math.min(r.start,s);r=r.end===void 0?i:Math.min(r.end,s),!t.extend&&i>r&&(s=r,r=i,i=s),s=x_(n,i);var o=x_(n,r);s&&o&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==o.node||t.focusOffset!==o.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>r?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=n;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof n.focus=="function"&&n.focus(),n=0;n=document.documentMode,Wo=null,pg=null,Xl=null,mg=!1;function __(t,e,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;mg||Wo==null||Wo!==uh(r)||(r=Wo,"selectionStart"in r&&Av(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Xl&&bu(Xl,r)||(Xl=r,r=gh(pg,"onSelect"),0Go||(t.current=_g[Go],_g[Go]=null,Go--)}function Fe(t,e){Go++,_g[Go]=t.current,t.current=e}var fi={},Jt=Pi(fi),yn=Pi(!1),co=fi;function Ia(t,e){var n=t.type.contextTypes;if(!n)return fi;var r=t.stateNode;if(r&&r.__reactInternalMemoizedUnmaskedChildContext===e)return r.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in n)s[i]=e[i];return r&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function vn(t){return t=t.childContextTypes,t!=null}function vh(){We(yn),We(Jt)}function P_(t,e,n){if(Jt.current!==fi)throw Error(W(168));Fe(Jt,e),Fe(yn,n)}function CC(t,e,n){var r=t.stateNode;if(e=e.childContextTypes,typeof r.getChildContext!="function")return n;r=r.getChildContext();for(var s in r)if(!(s in e))throw Error(W(108,eO(t)||"Unknown",s));return nt({},n,r)}function wh(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||fi,co=Jt.current,Fe(Jt,t),Fe(yn,yn.current),!0}function A_(t,e,n){var r=t.stateNode;if(!r)throw Error(W(169));n?(t=CC(t,e,co),r.__reactInternalMemoizedMergedChildContext=t,We(yn),We(Jt),Fe(Jt,t)):We(yn),Fe(yn,n)}var Qr=null,If=!1,rm=!1;function IC(t){Qr===null?Qr=[t]:Qr.push(t)}function yL(t){If=!0,IC(t)}function Ai(){if(!rm&&Qr!==null){rm=!0;var t=0,e=De;try{var n=Qr;for(De=1;t>=o,s-=o,Jr=1<<32-ur(e)+s|n<S?(I=C,C=null):I=C.sibling;var P=f(v,C,T[S],A);if(P===null){C===null&&(C=I);break}t&&C&&P.alternate===null&&e(v,C),x=i(P,x,S),L===null?k=P:L.sibling=P,L=P,C=I}if(S===T.length)return n(v,C),Ge&&Ui(v,S),k;if(C===null){for(;SS?(I=C,C=null):I=C.sibling;var N=f(v,C,P.value,A);if(N===null){C===null&&(C=I);break}t&&C&&N.alternate===null&&e(v,C),x=i(N,x,S),L===null?k=N:L.sibling=N,L=N,C=I}if(P.done)return n(v,C),Ge&&Ui(v,S),k;if(C===null){for(;!P.done;S++,P=T.next())P=h(v,P.value,A),P!==null&&(x=i(P,x,S),L===null?k=P:L.sibling=P,L=P);return Ge&&Ui(v,S),k}for(C=r(v,C);!P.done;S++,P=T.next())P=p(C,v,S,P.value,A),P!==null&&(t&&P.alternate!==null&&C.delete(P.key===null?S:P.key),x=i(P,x,S),L===null?k=P:L.sibling=P,L=P);return t&&C.forEach(function(O){return e(v,O)}),Ge&&Ui(v,S),k}function _(v,x,T,A){if(typeof T=="object"&&T!==null&&T.type===zo&&T.key===null&&(T=T.props.children),typeof T=="object"&&T!==null){switch(T.$$typeof){case Zc:e:{for(var k=T.key,L=x;L!==null;){if(L.key===k){if(k=T.type,k===zo){if(L.tag===7){n(v,L.sibling),x=s(L,T.props.children),x.return=v,v=x;break e}}else if(L.elementType===k||typeof k=="object"&&k!==null&&k.$$typeof===Os&&N_(k)===L.type){n(v,L.sibling),x=s(L,T.props),x.ref=Pl(v,L,T),x.return=v,v=x;break e}n(v,L);break}else e(v,L);L=L.sibling}T.type===zo?(x=io(T.props.children,v.mode,A,T.key),x.return=v,v=x):(A=zd(T.type,T.key,T.props,null,v.mode,A),A.ref=Pl(v,x,T),A.return=v,v=A)}return o(v);case Bo:e:{for(L=T.key;x!==null;){if(x.key===L)if(x.tag===4&&x.stateNode.containerInfo===T.containerInfo&&x.stateNode.implementation===T.implementation){n(v,x.sibling),x=s(x,T.children||[]),x.return=v,v=x;break e}else{n(v,x);break}else e(v,x);x=x.sibling}x=dm(T,v.mode,A),x.return=v,v=x}return o(v);case Os:return L=T._init,_(v,x,L(T._payload),A)}if(Ml(T))return g(v,x,T,A);if(Tl(T))return w(v,x,T,A);cd(v,T)}return typeof T=="string"&&T!==""||typeof T=="number"?(T=""+T,x!==null&&x.tag===6?(n(v,x.sibling),x=s(x,T),x.return=v,v=x):(n(v,x),x=cm(T,v.mode,A),x.return=v,v=x),o(v)):n(v,x)}return _}var Aa=kC(!0),NC=kC(!1),Eh=Pi(null),Th=null,Xo=null,Dv=null;function Ov(){Dv=Xo=Th=null}function Lv(t){var e=Eh.current;We(Eh),t._currentValue=e}function bg(t,e,n){for(;t!==null;){var r=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,r!==null&&(r.childLanes|=e)):r!==null&&(r.childLanes&e)!==e&&(r.childLanes|=e),t===n)break;t=t.return}}function ua(t,e){Th=t,Dv=Xo=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(mn=!0),t.firstContext=null)}function Gn(t){var e=t._currentValue;if(Dv!==t)if(t={context:t,memoizedValue:e,next:null},Xo===null){if(Th===null)throw Error(W(308));Xo=t,Th.dependencies={lanes:0,firstContext:t}}else Xo=Xo.next=t;return e}var Wi=null;function Mv(t){Wi===null?Wi=[t]:Wi.push(t)}function DC(t,e,n,r){var s=e.interleaved;return s===null?(n.next=n,Mv(e)):(n.next=s.next,s.next=n),e.interleaved=n,os(t,r)}function os(t,e){t.lanes|=e;var n=t.alternate;for(n!==null&&(n.lanes|=e),n=t,t=t.return;t!==null;)t.childLanes|=e,n=t.alternate,n!==null&&(n.childLanes|=e),n=t,t=t.return;return n.tag===3?n.stateNode:null}var Ls=!1;function Vv(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function OC(t,e){t=t.updateQueue,e.updateQueue===t&&(e.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function ns(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function ti(t,e,n){var r=t.updateQueue;if(r===null)return null;if(r=r.shared,be&2){var s=r.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),r.pending=e,os(t,n)}return s=r.interleaved,s===null?(e.next=e,Mv(r)):(e.next=s.next,s.next=e),r.interleaved=e,os(t,n)}function Vd(t,e,n){if(e=e.updateQueue,e!==null&&(e=e.shared,(n&4194240)!==0)){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Ev(t,n)}}function D_(t,e){var n=t.updateQueue,r=t.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var s=null,i=null;if(n=n.firstBaseUpdate,n!==null){do{var o={eventTime:n.eventTime,lane:n.lane,tag:n.tag,payload:n.payload,callback:n.callback,next:null};i===null?s=i=o:i=i.next=o,n=n.next}while(n!==null);i===null?s=i=e:i=i.next=e}else s=i=e;n={baseState:r.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:r.shared,effects:r.effects},t.updateQueue=n;return}t=n.lastBaseUpdate,t===null?n.firstBaseUpdate=e:t.next=e,n.lastBaseUpdate=e}function bh(t,e,n,r){var s=t.updateQueue;Ls=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,a=s.shared.pending;if(a!==null){s.shared.pending=null;var l=a,u=l.next;l.next=null,o===null?i=u:o.next=u,o=l;var d=t.alternate;d!==null&&(d=d.updateQueue,a=d.lastBaseUpdate,a!==o&&(a===null?d.firstBaseUpdate=u:a.next=u,d.lastBaseUpdate=l))}if(i!==null){var h=s.baseState;o=0,d=u=l=null,a=i;do{var f=a.lane,p=a.eventTime;if((r&f)===f){d!==null&&(d=d.next={eventTime:p,lane:0,tag:a.tag,payload:a.payload,callback:a.callback,next:null});e:{var g=t,w=a;switch(f=e,p=n,w.tag){case 1:if(g=w.payload,typeof g=="function"){h=g.call(p,h,f);break e}h=g;break e;case 3:g.flags=g.flags&-65537|128;case 0:if(g=w.payload,f=typeof g=="function"?g.call(p,h,f):g,f==null)break e;h=nt({},h,f);break e;case 2:Ls=!0}}a.callback!==null&&a.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[a]:f.push(a))}else p={eventTime:p,lane:f,tag:a.tag,payload:a.payload,callback:a.callback,next:null},d===null?(u=d=p,l=h):d=d.next=p,o|=f;if(a=a.next,a===null){if(a=s.shared.pending,a===null)break;f=a,a=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(d===null&&(l=h),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=d,e=s.shared.interleaved,e!==null){s=e;do o|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);po|=o,t.lanes=o,t.memoizedState=h}}function O_(t,e,n){if(t=e.effects,e.effects=null,t!==null)for(e=0;en?n:4,t(!0);var r=im.transition;im.transition={};try{t(!1),e()}finally{De=n,im.transition=r}}function XC(){return Qn().memoizedState}function _L(t,e,n){var r=ri(t);if(n={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null},JC(t))ZC(e,n);else if(n=DC(t,e,n,r),n!==null){var s=an();cr(n,t,r,s),eI(n,e,r)}}function EL(t,e,n){var r=ri(t),s={lane:r,action:n,hasEagerState:!1,eagerState:null,next:null};if(JC(t))ZC(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var o=e.lastRenderedState,a=i(o,n);if(s.hasEagerState=!0,s.eagerState=a,pr(a,o)){var l=e.interleaved;l===null?(s.next=s,Mv(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}n=DC(t,e,s,r),n!==null&&(s=an(),cr(n,t,r,s),eI(n,e,r))}}function JC(t){var e=t.alternate;return t===et||e!==null&&e===et}function ZC(t,e){Jl=Ch=!0;var n=t.pending;n===null?e.next=e:(e.next=n.next,n.next=e),t.pending=e}function eI(t,e,n){if(n&4194240){var r=e.lanes;r&=t.pendingLanes,n|=r,e.lanes=n,Ev(t,n)}}var Ih={readContext:Gn,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useInsertionEffect:Ht,useLayoutEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useMutableSource:Ht,useSyncExternalStore:Ht,useId:Ht,unstable_isNewReconciler:!1},TL={readContext:Gn,useCallback:function(t,e){return Tr().memoizedState=[t,e===void 0?null:e],t},useContext:Gn,useEffect:M_,useImperativeHandle:function(t,e,n){return n=n!=null?n.concat([t]):null,Fd(4194308,4,qC.bind(null,e,t),n)},useLayoutEffect:function(t,e){return Fd(4194308,4,t,e)},useInsertionEffect:function(t,e){return Fd(4,2,t,e)},useMemo:function(t,e){var n=Tr();return e=e===void 0?null:e,t=t(),n.memoizedState=[t,e],t},useReducer:function(t,e,n){var r=Tr();return e=n!==void 0?n(e):e,r.memoizedState=r.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},r.queue=t,t=t.dispatch=_L.bind(null,et,t),[r.memoizedState,t]},useRef:function(t){var e=Tr();return t={current:t},e.memoizedState=t},useState:L_,useDebugValue:Wv,useDeferredValue:function(t){return Tr().memoizedState=t},useTransition:function(){var t=L_(!1),e=t[0];return t=xL.bind(null,t[1]),Tr().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,n){var r=et,s=Tr();if(Ge){if(n===void 0)throw Error(W(407));n=n()}else{if(n=e(),Rt===null)throw Error(W(349));fo&30||jC(r,e,n)}s.memoizedState=n;var i={value:n,getSnapshot:e};return s.queue=i,M_(UC.bind(null,r,i,t),[t]),r.flags|=2048,Nu(9,FC.bind(null,r,i,n,e),void 0,null),n},useId:function(){var t=Tr(),e=Rt.identifierPrefix;if(Ge){var n=Zr,r=Jr;n=(r&~(1<<32-ur(r)-1)).toString(32)+n,e=":"+e+"R"+n,n=Ru++,0<\/script>",t=t.removeChild(t.firstChild)):typeof r.is=="string"?t=o.createElement(n,{is:r.is}):(t=o.createElement(n),n==="select"&&(o=t,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):t=o.createElementNS(t,n),t[Pr]=e,t[Iu]=r,cI(t,e,!1,!1),e.stateNode=t;e:{switch(o=og(n,r),n){case"dialog":ze("cancel",t),ze("close",t),s=r;break;case"iframe":case"object":case"embed":ze("load",t),s=r;break;case"video":case"audio":for(s=0;sNa&&(e.flags|=128,r=!0,Al(i,!1),e.lanes=4194304)}else{if(!r)if(t=Sh(o),t!==null){if(e.flags|=128,r=!0,n=t.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),Al(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Ge)return Wt(e),null}else 2*ht()-i.renderingStartTime>Na&&n!==1073741824&&(e.flags|=128,r=!0,Al(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(n=i.last,n!==null?n.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=ht(),e.sibling=null,n=Xe.current,Fe(Xe,r?n&1|2:n&1),e):(Wt(e),null);case 22:case 23:return Xv(),r=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==r&&(e.flags|=8192),r&&e.mode&1?Tn&1073741824&&(Wt(e),e.subtreeFlags&6&&(e.flags|=8192)):Wt(e),null;case 24:return null;case 25:return null}throw Error(W(156,e.tag))}function kL(t,e){switch(kv(e),e.tag){case 1:return vn(e.type)&&vh(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ra(),We(yn),We(Jt),Uv(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return Fv(e),null;case 13:if(We(Xe),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(W(340));Pa()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return We(Xe),null;case 4:return Ra(),null;case 10:return Lv(e.type._context),null;case 22:case 23:return Xv(),null;case 24:return null;default:return null}}var hd=!1,Qt=!1,NL=typeof WeakSet=="function"?WeakSet:Set,ee=null;function Jo(t,e){var n=t.ref;if(n!==null)if(typeof n=="function")try{n(null)}catch(r){ut(t,e,r)}else n.current=null}function Dg(t,e,n){try{n()}catch(r){ut(t,e,r)}}var K_=!1;function DL(t,e){if(gg=ph,t=yC(),Av(t)){if("selectionStart"in t)var n={start:t.selectionStart,end:t.selectionEnd};else e:{n=(n=t.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var s=r.anchorOffset,i=r.focusNode;r=r.focusOffset;try{n.nodeType,i.nodeType}catch{n=null;break e}var o=0,a=-1,l=-1,u=0,d=0,h=t,f=null;t:for(;;){for(var p;h!==n||s!==0&&h.nodeType!==3||(a=o+s),h!==i||r!==0&&h.nodeType!==3||(l=o+r),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)f=h,h=p;for(;;){if(h===t)break t;if(f===n&&++u===s&&(a=o),f===i&&++d===r&&(l=o),(p=h.nextSibling)!==null)break;h=f,f=h.parentNode}h=p}n=a===-1||l===-1?null:{start:a,end:l}}else n=null}n=n||{start:0,end:0}}else n=null;for(yg={focusedElem:t,selectionRange:n},ph=!1,ee=e;ee!==null;)if(e=ee,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ee=t;else for(;ee!==null;){e=ee;try{var g=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(g!==null){var w=g.memoizedProps,_=g.memoizedState,v=e.stateNode,x=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:nr(e.type,w),_);v.__reactInternalSnapshotBeforeUpdate=x}break;case 3:var T=e.stateNode.containerInfo;T.nodeType===1?T.textContent="":T.nodeType===9&&T.documentElement&&T.removeChild(T.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(W(163))}}catch(A){ut(e,e.return,A)}if(t=e.sibling,t!==null){t.return=e.return,ee=t;break}ee=e.return}return g=K_,K_=!1,g}function Zl(t,e,n){var r=e.updateQueue;if(r=r!==null?r.lastEffect:null,r!==null){var s=r=r.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&Dg(e,n,i)}s=s.next}while(s!==r)}}function Rf(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var n=e=e.next;do{if((n.tag&t)===t){var r=n.create;n.destroy=r()}n=n.next}while(n!==e)}}function Og(t){var e=t.ref;if(e!==null){var n=t.stateNode;switch(t.tag){case 5:t=n;break;default:t=n}typeof e=="function"?e(t):e.current=t}}function fI(t){var e=t.alternate;e!==null&&(t.alternate=null,fI(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Pr],delete e[Iu],delete e[xg],delete e[mL],delete e[gL])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function pI(t){return t.tag===5||t.tag===3||t.tag===4}function G_(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||pI(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Lg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.nodeType===8?n.parentNode.insertBefore(t,e):n.insertBefore(t,e):(n.nodeType===8?(e=n.parentNode,e.insertBefore(t,n)):(e=n,e.appendChild(t)),n=n._reactRootContainer,n!=null||e.onclick!==null||(e.onclick=yh));else if(r!==4&&(t=t.child,t!==null))for(Lg(t,e,n),t=t.sibling;t!==null;)Lg(t,e,n),t=t.sibling}function Mg(t,e,n){var r=t.tag;if(r===5||r===6)t=t.stateNode,e?n.insertBefore(t,e):n.appendChild(t);else if(r!==4&&(t=t.child,t!==null))for(Mg(t,e,n),t=t.sibling;t!==null;)Mg(t,e,n),t=t.sibling}var Dt=null,or=!1;function Ps(t,e,n){for(n=n.child;n!==null;)mI(t,e,n),n=n.sibling}function mI(t,e,n){if(Rr&&typeof Rr.onCommitFiberUnmount=="function")try{Rr.onCommitFiberUnmount(Ef,n)}catch{}switch(n.tag){case 5:Qt||Jo(n,e);case 6:var r=Dt,s=or;Dt=null,Ps(t,e,n),Dt=r,or=s,Dt!==null&&(or?(t=Dt,n=n.stateNode,t.nodeType===8?t.parentNode.removeChild(n):t.removeChild(n)):Dt.removeChild(n.stateNode));break;case 18:Dt!==null&&(or?(t=Dt,n=n.stateNode,t.nodeType===8?nm(t.parentNode,n):t.nodeType===1&&nm(t,n),Eu(t)):nm(Dt,n.stateNode));break;case 4:r=Dt,s=or,Dt=n.stateNode.containerInfo,or=!0,Ps(t,e,n),Dt=r,or=s;break;case 0:case 11:case 14:case 15:if(!Qt&&(r=n.updateQueue,r!==null&&(r=r.lastEffect,r!==null))){s=r=r.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&Dg(n,e,o),s=s.next}while(s!==r)}Ps(t,e,n);break;case 1:if(!Qt&&(Jo(n,e),r=n.stateNode,typeof r.componentWillUnmount=="function"))try{r.props=n.memoizedProps,r.state=n.memoizedState,r.componentWillUnmount()}catch(a){ut(n,e,a)}Ps(t,e,n);break;case 21:Ps(t,e,n);break;case 22:n.mode&1?(Qt=(r=Qt)||n.memoizedState!==null,Ps(t,e,n),Qt=r):Ps(t,e,n);break;default:Ps(t,e,n)}}function Q_(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var n=t.stateNode;n===null&&(n=t.stateNode=new NL),e.forEach(function(r){var s=BL.bind(null,t,r);n.has(r)||(n.add(r),r.then(s,s))})}}function Zn(t,e){var n=e.deletions;if(n!==null)for(var r=0;rs&&(s=o),r&=~i}if(r=s,r=ht()-r,r=(120>r?120:480>r?480:1080>r?1080:1920>r?1920:3e3>r?3e3:4320>r?4320:1960*LL(r/1960))-r,10t?16:t,Gs===null)var r=!1;else{if(t=Gs,Gs=null,Rh=0,be&6)throw Error(W(331));var s=be;for(be|=4,ee=t.current;ee!==null;){var i=ee,o=i.child;if(ee.flags&16){var a=i.deletions;if(a!==null){for(var l=0;lht()-Qv?so(t,0):Gv|=n),wn(t,e)}function TI(t,e){e===0&&(t.mode&1?(e=rd,rd<<=1,!(rd&130023424)&&(rd=4194304)):e=1);var n=an();t=os(t,e),t!==null&&(dc(t,e,n),wn(t,n))}function $L(t){var e=t.memoizedState,n=0;e!==null&&(n=e.retryLane),TI(t,n)}function BL(t,e){var n=0;switch(t.tag){case 13:var r=t.stateNode,s=t.memoizedState;s!==null&&(n=s.retryLane);break;case 19:r=t.stateNode;break;default:throw Error(W(314))}r!==null&&r.delete(e),TI(t,n)}var bI;bI=function(t,e,n){if(t!==null)if(t.memoizedProps!==e.pendingProps||yn.current)mn=!0;else{if(!(t.lanes&n)&&!(e.flags&128))return mn=!1,AL(t,e,n);mn=!!(t.flags&131072)}else mn=!1,Ge&&e.flags&1048576&&PC(e,_h,e.index);switch(e.lanes=0,e.tag){case 2:var r=e.type;Ud(t,e),t=e.pendingProps;var s=Ia(e,Jt.current);ua(e,n),s=Bv(null,e,r,t,s,n);var i=zv();return e.flags|=1,typeof s=="object"&&s!==null&&typeof s.render=="function"&&s.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,vn(r)?(i=!0,wh(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,Vv(e),s.updater=Af,e.stateNode=s,s._reactInternals=e,Cg(e,r,t,n),e=Ag(null,e,r,!0,i,n)):(e.tag=0,Ge&&i&&Rv(e),rn(null,e,s,n),e=e.child),e;case 16:r=e.elementType;e:{switch(Ud(t,e),t=e.pendingProps,s=r._init,r=s(r._payload),e.type=r,s=e.tag=HL(r),t=nr(r,t),s){case 0:e=Pg(null,e,r,t,n);break e;case 1:e=H_(null,e,r,t,n);break e;case 11:e=B_(null,e,r,t,n);break e;case 14:e=z_(null,e,r,nr(r.type,t),n);break e}throw Error(W(306,r,""))}return e;case 0:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:nr(r,s),Pg(t,e,r,s,n);case 1:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:nr(r,s),H_(t,e,r,s,n);case 3:e:{if(aI(e),t===null)throw Error(W(387));r=e.pendingProps,i=e.memoizedState,s=i.element,OC(t,e),bh(e,r,null,n);var o=e.memoizedState;if(r=o.element,i.isDehydrated)if(i={element:r,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=ka(Error(W(423)),e),e=W_(t,e,r,n,s);break e}else if(r!==s){s=ka(Error(W(424)),e),e=W_(t,e,r,n,s);break e}else for(Cn=ei(e.stateNode.containerInfo.firstChild),Pn=e,Ge=!0,ar=null,n=NC(e,null,r,n),e.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling;else{if(Pa(),r===s){e=as(t,e,n);break e}rn(t,e,r,n)}e=e.child}return e;case 5:return LC(e),t===null&&Tg(e),r=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,vg(r,s)?o=null:i!==null&&vg(r,i)&&(e.flags|=32),oI(t,e),rn(t,e,o,n),e.child;case 6:return t===null&&Tg(e),null;case 13:return lI(t,e,n);case 4:return jv(e,e.stateNode.containerInfo),r=e.pendingProps,t===null?e.child=Aa(e,null,r,n):rn(t,e,r,n),e.child;case 11:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:nr(r,s),B_(t,e,r,s,n);case 7:return rn(t,e,e.pendingProps,n),e.child;case 8:return rn(t,e,e.pendingProps.children,n),e.child;case 12:return rn(t,e,e.pendingProps.children,n),e.child;case 10:e:{if(r=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,Fe(Eh,r._currentValue),r._currentValue=o,i!==null)if(pr(i.value,o)){if(i.children===s.children&&!yn.current){e=as(t,e,n);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var a=i.dependencies;if(a!==null){o=i.child;for(var l=a.firstContext;l!==null;){if(l.context===r){if(i.tag===1){l=ns(-1,n&-n),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?l.next=l:(l.next=d.next,d.next=l),u.pending=l}}i.lanes|=n,l=i.alternate,l!==null&&(l.lanes|=n),bg(i.return,n,e),a.lanes|=n;break}l=l.next}}else if(i.tag===10)o=i.type===e.type?null:i.child;else if(i.tag===18){if(o=i.return,o===null)throw Error(W(341));o.lanes|=n,a=o.alternate,a!==null&&(a.lanes|=n),bg(o,n,e),o=i.sibling}else o=i.child;if(o!==null)o.return=i;else for(o=i;o!==null;){if(o===e){o=null;break}if(i=o.sibling,i!==null){i.return=o.return,o=i;break}o=o.return}i=o}rn(t,e,s.children,n),e=e.child}return e;case 9:return s=e.type,r=e.pendingProps.children,ua(e,n),s=Gn(s),r=r(s),e.flags|=1,rn(t,e,r,n),e.child;case 14:return r=e.type,s=nr(r,e.pendingProps),s=nr(r.type,s),z_(t,e,r,s,n);case 15:return sI(t,e,e.type,e.pendingProps,n);case 17:return r=e.type,s=e.pendingProps,s=e.elementType===r?s:nr(r,s),Ud(t,e),e.tag=1,vn(r)?(t=!0,wh(e)):t=!1,ua(e,n),tI(e,r,s),Cg(e,r,s,n),Ag(null,e,r,!0,t,n);case 19:return uI(t,e,n);case 22:return iI(t,e,n)}throw Error(W(156,e.tag))};function SI(t,e){return JS(t,e)}function zL(t,e,n,r){this.tag=t,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Hn(t,e,n,r){return new zL(t,e,n,r)}function Zv(t){return t=t.prototype,!(!t||!t.isReactComponent)}function HL(t){if(typeof t=="function")return Zv(t)?1:0;if(t!=null){if(t=t.$$typeof,t===vv)return 11;if(t===wv)return 14}return 2}function si(t,e){var n=t.alternate;return n===null?(n=Hn(t.tag,e,t.key,t.mode),n.elementType=t.elementType,n.type=t.type,n.stateNode=t.stateNode,n.alternate=t,t.alternate=n):(n.pendingProps=e,n.type=t.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=t.flags&14680064,n.childLanes=t.childLanes,n.lanes=t.lanes,n.child=t.child,n.memoizedProps=t.memoizedProps,n.memoizedState=t.memoizedState,n.updateQueue=t.updateQueue,e=t.dependencies,n.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},n.sibling=t.sibling,n.index=t.index,n.ref=t.ref,n}function zd(t,e,n,r,s,i){var o=2;if(r=t,typeof t=="function")Zv(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case zo:return io(n.children,s,i,e);case yv:o=8,s|=8;break;case Ym:return t=Hn(12,n,e,s|2),t.elementType=Ym,t.lanes=i,t;case Xm:return t=Hn(13,n,e,s),t.elementType=Xm,t.lanes=i,t;case Jm:return t=Hn(19,n,e,s),t.elementType=Jm,t.lanes=i,t;case LS:return Nf(n,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case DS:o=10;break e;case OS:o=9;break e;case vv:o=11;break e;case wv:o=14;break e;case Os:o=16,r=null;break e}throw Error(W(130,t==null?t:typeof t,""))}return e=Hn(o,n,e,s),e.elementType=t,e.type=r,e.lanes=i,e}function io(t,e,n,r){return t=Hn(7,t,r,e),t.lanes=n,t}function Nf(t,e,n,r){return t=Hn(22,t,r,e),t.elementType=LS,t.lanes=n,t.stateNode={isHidden:!1},t}function cm(t,e,n){return t=Hn(6,t,null,e),t.lanes=n,t}function dm(t,e,n){return e=Hn(4,t.children!==null?t.children:[],t.key,e),e.lanes=n,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function WL(t,e,n,r,s){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Wp(0),this.expirationTimes=Wp(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Wp(0),this.identifierPrefix=r,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function e0(t,e,n,r,s,i,o,a,l){return t=new WL(t,e,n,a,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=Hn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:r,isDehydrated:n,cache:null,transitions:null,pendingSuspenseBoundaries:null},Vv(i),t}function qL(t,e,n){var r=3"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(AI)}catch(t){console.error(t)}}AI(),AS.exports=Nn;var mc=AS.exports;const RI=yS(mc);var kI,rE=mc;kI=rE.createRoot,rE.hydrateRoot;const XL="modulepreload",JL=function(t){return"/"+t},sE={},Le=function(e,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const o=document.querySelector("meta[property=csp-nonce]"),a=(o==null?void 0:o.nonce)||(o==null?void 0:o.getAttribute("nonce"));s=Promise.allSettled(n.map(l=>{if(l=JL(l),l in sE)return;sE[l]=!0;const u=l.endsWith(".css"),d=u?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${l}"]${d}`))return;const h=document.createElement("link");if(h.rel=u?"stylesheet":XL,u||(h.as="script"),h.crossOrigin="",h.href=l,a&&h.setAttribute("nonce",a),document.head.appendChild(h),u)return new Promise((f,p)=>{h.addEventListener("load",f),h.addEventListener("error",()=>p(new Error(`Unable to preload CSS for ${l}`)))})}))}function i(o){const a=new Event("vite:preloadError",{cancelable:!0});if(a.payload=o,window.dispatchEvent(a),!a.defaultPrevented)throw o}return s.then(o=>{for(const a of o||[])a.status==="rejected"&&i(a.reason);return e().catch(i)})};var NI=(t=>(t.BASE="base",t.BODY="body",t.HEAD="head",t.HTML="html",t.LINK="link",t.META="meta",t.NOSCRIPT="noscript",t.SCRIPT="script",t.STYLE="style",t.TITLE="title",t.FRAGMENT="Symbol(react.fragment)",t))(NI||{}),hm={link:{rel:["amphtml","canonical","alternate"]},script:{type:["application/ld+json"]},meta:{charset:"",name:["generator","robots","description"],property:["og:type","og:title","og:url","og:image","og:image:alt","og:description","twitter:url","twitter:title","twitter:description","twitter:image","twitter:image:alt","twitter:card","twitter:site"]}};Object.values(NI);var s0={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"};Object.entries(s0).reduce((t,[e,n])=>(t[n]=e,t),{});var Ou="data-rh",ZL=t=>Array.isArray(t)?t.join(""):t,eM=(t,e)=>{const n=Object.keys(t);for(let r=0;rArray.isArray(t)?t.reduce((n,r)=>(eM(r,e)?n.priority.push(r):n.default.push(r),n),{priority:[],default:[]}):{default:t,priority:[]},tM=["noscript","script","style"],$g=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'"),DI=t=>Object.keys(t).reduce((e,n)=>{const r=typeof t[n]<"u"?`${n}="${t[n]}"`:`${n}`;return e?`${e} ${r}`:r},""),nM=(t,e,n,r)=>{const s=DI(n),i=ZL(e);return s?`<${t} ${Ou}="true" ${s}>${$g(i,r)}`:`<${t} ${Ou}="true">${$g(i,r)}`},rM=(t,e,n=!0)=>e.reduce((r,s)=>{const i=s,o=Object.keys(i).filter(u=>!(u==="innerHTML"||u==="cssText")).reduce((u,d)=>{const h=typeof i[d]>"u"?d:`${d}="${$g(i[d],n)}"`;return u?`${u} ${h}`:h},""),a=i.innerHTML||i.cssText||"",l=tM.indexOf(t)===-1;return`${r}<${t} ${Ou}="true" ${o}${l?"/>":`>${a}`}`},""),OI=(t,e={})=>Object.keys(t).reduce((n,r)=>{const s=s0[r];return n[s||r]=t[r],n},e),sM=(t,e,n)=>{const r={key:e,[Ou]:!0},s=OI(n,r);return[q.createElement("title",s,e)]},Hd=(t,e)=>e.map((n,r)=>{const s={key:r,[Ou]:!0};return Object.keys(n).forEach(i=>{const a=s0[i]||i;if(a==="innerHTML"||a==="cssText"){const l=n.innerHTML||n.cssText;s.dangerouslySetInnerHTML={__html:l}}else s[a]=n[i]}),q.createElement(t,s)}),Un=(t,e,n=!0)=>{switch(t){case"title":return{toComponent:()=>sM(t,e.title,e.titleAttributes),toString:()=>nM(t,e.title,e.titleAttributes,n)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>OI(e),toString:()=>DI(e)};default:return{toComponent:()=>Hd(t,e),toString:()=>rM(t,e,n)}}},iM=({metaTags:t,linkTags:e,scriptTags:n,encode:r})=>{const s=fm(t,hm.meta),i=fm(e,hm.link),o=fm(n,hm.script);return{priorityMethods:{toComponent:()=>[...Hd("meta",s.priority),...Hd("link",i.priority),...Hd("script",o.priority)],toString:()=>`${Un("meta",s.priority,r)} ${Un("link",i.priority,r)} ${Un("script",o.priority,r)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},oM=t=>{const{baseTag:e,bodyAttributes:n,encode:r=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:a="",titleAttributes:l,prioritizeSeoTags:u}=t;let{linkTags:d,metaTags:h,scriptTags:f}=t,p={toComponent:()=>{},toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:h,scriptTags:f}=iM(t)),{priority:p,base:Un("base",e,r),bodyAttributes:Un("bodyAttributes",n,r),htmlAttributes:Un("htmlAttributes",s,r),link:Un("link",d,r),meta:Un("meta",h,r),noscript:Un("noscript",i,r),script:Un("script",f,r),style:Un("style",o,r),title:Un("title",{title:a,titleAttributes:l},r)}},aM=oM,md=[],LI=!!(typeof window<"u"&&window.document&&window.document.createElement),lM=class{constructor(t,e){_r(this,"instances",[]);_r(this,"canUseDOM",LI);_r(this,"context");_r(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?md:this.instances,add:t=>{(this.canUseDOM?md:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?md:this.instances).indexOf(t);(this.canUseDOM?md:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=aM({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},uM={},cM=q.createContext(uM),Xi,dM=(Xi=class extends b.Component{constructor(n){super(n);_r(this,"helmetData");this.helmetData=new lM(this.props.context||{},Xi.canUseDOM)}render(){return q.createElement(cM.Provider,{value:this.helmetData.value},this.props.children)}},_r(Xi,"canUseDOM",LI),Xi);const hM=1,fM=1e6;let pm=0;function pM(){return pm=(pm+1)%Number.MAX_SAFE_INTEGER,pm.toString()}const mm=new Map,iE=t=>{if(mm.has(t))return;const e=setTimeout(()=>{mm.delete(t),nu({type:"REMOVE_TOAST",toastId:t})},fM);mm.set(t,e)},mM=(t,e)=>{switch(e.type){case"ADD_TOAST":return{...t,toasts:[e.toast,...t.toasts].slice(0,hM)};case"UPDATE_TOAST":return{...t,toasts:t.toasts.map(n=>n.id===e.toast.id?{...n,...e.toast}:n)};case"DISMISS_TOAST":{const{toastId:n}=e;return n?iE(n):t.toasts.forEach(r=>{iE(r.id)}),{...t,toasts:t.toasts.map(r=>r.id===n||n===void 0?{...r,open:!1}:r)}}case"REMOVE_TOAST":return e.toastId===void 0?{...t,toasts:[]}:{...t,toasts:t.toasts.filter(n=>n.id!==e.toastId)}}},Wd=[];let qd={toasts:[]};function nu(t){qd=mM(qd,t),Wd.forEach(e=>{e(qd)})}function gM({...t}){const e=pM(),n=s=>nu({type:"UPDATE_TOAST",toast:{...s,id:e}}),r=()=>nu({type:"DISMISS_TOAST",toastId:e});return nu({type:"ADD_TOAST",toast:{...t,id:e,open:!0,onOpenChange:s=>{s||r()}}}),{id:e,dismiss:r,update:n}}function MI(){const[t,e]=b.useState(qd);return b.useEffect(()=>(Wd.push(e),()=>{const n=Wd.indexOf(e);n>-1&&Wd.splice(n,1)}),[t]),{...t,toast:gM,dismiss:n=>nu({type:"DISMISS_TOAST",toastId:n})}}function ft(t,e,{checkForDefaultPrevented:n=!0}={}){return function(s){if(t==null||t(s),n===!1||!s.defaultPrevented)return e==null?void 0:e(s)}}function yM(t,e){typeof t=="function"?t(e):t!=null&&(t.current=e)}function VI(...t){return e=>t.forEach(n=>yM(n,e))}function Yn(...t){return b.useCallback(VI(...t),t)}function vM(t,e=[]){let n=[];function r(i,o){const a=b.createContext(o),l=n.length;n=[...n,o];function u(h){const{scope:f,children:p,...g}=h,w=(f==null?void 0:f[t][l])||a,_=b.useMemo(()=>g,Object.values(g));return y.jsx(w.Provider,{value:_,children:p})}function d(h,f){const p=(f==null?void 0:f[t][l])||a,g=b.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>b.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,wM(s,...e)]}function wM(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var Lu=b.forwardRef((t,e)=>{const{children:n,...r}=t,s=b.Children.toArray(n),i=s.find(xM);if(i){const o=i.props.children,a=s.map(l=>l===i?b.Children.count(o)>1?b.Children.only(null):b.isValidElement(o)?o.props.children:null:l);return y.jsx(Bg,{...r,ref:e,children:b.isValidElement(o)?b.cloneElement(o,void 0,a):null})}return y.jsx(Bg,{...r,ref:e,children:n})});Lu.displayName="Slot";var Bg=b.forwardRef((t,e)=>{const{children:n,...r}=t;if(b.isValidElement(n)){const s=EM(n);return b.cloneElement(n,{..._M(r,n.props),ref:e?VI(e,s):s})}return b.Children.count(n)>1?b.Children.only(null):null});Bg.displayName="SlotClone";var jI=({children:t})=>y.jsx(y.Fragment,{children:t});function xM(t){return b.isValidElement(t)&&t.type===jI}function _M(t,e){const n={...e};for(const r in e){const s=t[r],i=e[r];/^on[A-Z]/.test(r)?s&&i?n[r]=(...a)=>{i(...a),s(...a)}:s&&(n[r]=s):r==="style"?n[r]={...s,...i}:r==="className"&&(n[r]=[s,i].filter(Boolean).join(" "))}return{...t,...n}}function EM(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function TM(t){const e=t+"CollectionProvider",[n,r]=vM(e),[s,i]=n(e,{collectionRef:{current:null},itemMap:new Map}),o=p=>{const{scope:g,children:w}=p,_=q.useRef(null),v=q.useRef(new Map).current;return y.jsx(s,{scope:g,itemMap:v,collectionRef:_,children:w})};o.displayName=e;const a=t+"CollectionSlot",l=q.forwardRef((p,g)=>{const{scope:w,children:_}=p,v=i(a,w),x=Yn(g,v.collectionRef);return y.jsx(Lu,{ref:x,children:_})});l.displayName=a;const u=t+"CollectionItemSlot",d="data-radix-collection-item",h=q.forwardRef((p,g)=>{const{scope:w,children:_,...v}=p,x=q.useRef(null),T=Yn(g,x),A=i(u,w);return q.useEffect(()=>(A.itemMap.set(x,{ref:x,...v}),()=>void A.itemMap.delete(x))),y.jsx(Lu,{[d]:"",ref:T,children:_})});h.displayName=u;function f(p){const g=i(t+"CollectionConsumer",p);return q.useCallback(()=>{const _=g.collectionRef.current;if(!_)return[];const v=Array.from(_.querySelectorAll(`[${d}]`));return Array.from(g.itemMap.values()).sort((A,k)=>v.indexOf(A.ref.current)-v.indexOf(k.ref.current))},[g.collectionRef,g.itemMap])}return[{Provider:o,Slot:l,ItemSlot:h},f,r]}function bY(t,e){const n=b.createContext(e),r=i=>{const{children:o,...a}=i,l=b.useMemo(()=>a,Object.values(a));return y.jsx(n.Provider,{value:l,children:o})};r.displayName=t+"Provider";function s(i){const o=b.useContext(n);if(o)return o;if(e!==void 0)return e;throw new Error(`\`${i}\` must be used within \`${t}\``)}return[r,s]}function i0(t,e=[]){let n=[];function r(i,o){const a=b.createContext(o),l=n.length;n=[...n,o];const u=h=>{var v;const{scope:f,children:p,...g}=h,w=((v=f==null?void 0:f[t])==null?void 0:v[l])||a,_=b.useMemo(()=>g,Object.values(g));return y.jsx(w.Provider,{value:_,children:p})};u.displayName=i+"Provider";function d(h,f){var w;const p=((w=f==null?void 0:f[t])==null?void 0:w[l])||a,g=b.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return[u,d]}const s=()=>{const i=n.map(o=>b.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,bM(s,...e)]}function bM(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}var SM=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],Ut=SM.reduce((t,e)=>{const n=b.forwardRef((r,s)=>{const{asChild:i,...o}=r,a=i?Lu:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),y.jsx(a,{...o,ref:s})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function FI(t,e){t&&mc.flushSync(()=>t.dispatchEvent(e))}function Vr(t){const e=b.useRef(t);return b.useEffect(()=>{e.current=t}),b.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function CM(t,e=globalThis==null?void 0:globalThis.document){const n=Vr(t);b.useEffect(()=>{const r=s=>{s.key==="Escape"&&n(s)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var IM="DismissableLayer",zg="dismissableLayer.update",PM="dismissableLayer.pointerDownOutside",AM="dismissableLayer.focusOutside",oE,UI=b.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),o0=b.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:s,onFocusOutside:i,onInteractOutside:o,onDismiss:a,...l}=t,u=b.useContext(UI),[d,h]=b.useState(null),f=(d==null?void 0:d.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,p]=b.useState({}),g=Yn(e,C=>h(C)),w=Array.from(u.layers),[_]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),v=w.indexOf(_),x=d?w.indexOf(d):-1,T=u.layersWithOutsidePointerEventsDisabled.size>0,A=x>=v,k=kM(C=>{const S=C.target,I=[...u.branches].some(P=>P.contains(S));!A||I||(s==null||s(C),o==null||o(C),C.defaultPrevented||a==null||a())},f),L=NM(C=>{const S=C.target;[...u.branches].some(P=>P.contains(S))||(i==null||i(C),o==null||o(C),C.defaultPrevented||a==null||a())},f);return CM(C=>{x===u.layers.size-1&&(r==null||r(C),!C.defaultPrevented&&a&&(C.preventDefault(),a()))},f),b.useEffect(()=>{if(d)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(oE=f.body.style.pointerEvents,f.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(d)),u.layers.add(d),aE(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(f.body.style.pointerEvents=oE)}},[d,f,n,u]),b.useEffect(()=>()=>{d&&(u.layers.delete(d),u.layersWithOutsidePointerEventsDisabled.delete(d),aE())},[d,u]),b.useEffect(()=>{const C=()=>p({});return document.addEventListener(zg,C),()=>document.removeEventListener(zg,C)},[]),y.jsx(Ut.div,{...l,ref:g,style:{pointerEvents:T?A?"auto":"none":void 0,...t.style},onFocusCapture:ft(t.onFocusCapture,L.onFocusCapture),onBlurCapture:ft(t.onBlurCapture,L.onBlurCapture),onPointerDownCapture:ft(t.onPointerDownCapture,k.onPointerDownCapture)})});o0.displayName=IM;var RM="DismissableLayerBranch",$I=b.forwardRef((t,e)=>{const n=b.useContext(UI),r=b.useRef(null),s=Yn(e,r);return b.useEffect(()=>{const i=r.current;if(i)return n.branches.add(i),()=>{n.branches.delete(i)}},[n.branches]),y.jsx(Ut.div,{...t,ref:s})});$I.displayName=RM;function kM(t,e=globalThis==null?void 0:globalThis.document){const n=Vr(t),r=b.useRef(!1),s=b.useRef(()=>{});return b.useEffect(()=>{const i=a=>{if(a.target&&!r.current){let l=function(){BI(PM,n,u,{discrete:!0})};const u={originalEvent:a};a.pointerType==="touch"?(e.removeEventListener("click",s.current),s.current=l,e.addEventListener("click",s.current,{once:!0})):l()}else e.removeEventListener("click",s.current);r.current=!1},o=window.setTimeout(()=>{e.addEventListener("pointerdown",i)},0);return()=>{window.clearTimeout(o),e.removeEventListener("pointerdown",i),e.removeEventListener("click",s.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function NM(t,e=globalThis==null?void 0:globalThis.document){const n=Vr(t),r=b.useRef(!1);return b.useEffect(()=>{const s=i=>{i.target&&!r.current&&BI(AM,n,{originalEvent:i},{discrete:!1})};return e.addEventListener("focusin",s),()=>e.removeEventListener("focusin",s)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function aE(){const t=new CustomEvent(zg);document.dispatchEvent(t)}function BI(t,e,n,{discrete:r}){const s=n.originalEvent.target,i=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?FI(s,i):s.dispatchEvent(i)}var DM=o0,OM=$I,go=globalThis!=null&&globalThis.document?b.useLayoutEffect:()=>{},LM="Portal",zI=b.forwardRef((t,e)=>{var a;const{container:n,...r}=t,[s,i]=b.useState(!1);go(()=>i(!0),[]);const o=n||s&&((a=globalThis==null?void 0:globalThis.document)==null?void 0:a.body);return o?RI.createPortal(y.jsx(Ut.div,{...r,ref:e}),o):null});zI.displayName=LM;function MM(t,e){return b.useReducer((n,r)=>e[n][r]??n,t)}var Vf=t=>{const{present:e,children:n}=t,r=VM(e),s=typeof n=="function"?n({present:r.isPresent}):b.Children.only(n),i=Yn(r.ref,jM(s));return typeof n=="function"||r.isPresent?b.cloneElement(s,{ref:i}):null};Vf.displayName="Presence";function VM(t){const[e,n]=b.useState(),r=b.useRef({}),s=b.useRef(t),i=b.useRef("none"),o=t?"mounted":"unmounted",[a,l]=MM(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return b.useEffect(()=>{const u=gd(r.current);i.current=a==="mounted"?u:"none"},[a]),go(()=>{const u=r.current,d=s.current;if(d!==t){const f=i.current,p=gd(u);t?l("MOUNT"):p==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(d&&f!==p?"ANIMATION_OUT":"UNMOUNT"),s.current=t}},[t,l]),go(()=>{if(e){let u;const d=e.ownerDocument.defaultView??window,h=p=>{const w=gd(r.current).includes(p.animationName);if(p.target===e&&w&&(l("ANIMATION_END"),!s.current)){const _=e.style.animationFillMode;e.style.animationFillMode="forwards",u=d.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=_)})}},f=p=>{p.target===e&&(i.current=gd(r.current))};return e.addEventListener("animationstart",f),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{d.clearTimeout(u),e.removeEventListener("animationstart",f),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(a),ref:b.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function gd(t){return(t==null?void 0:t.animationName)||"none"}function jM(t){var r,s;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(s=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:s.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}function HI({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,s]=FM({defaultProp:e,onChange:n}),i=t!==void 0,o=i?t:r,a=Vr(n),l=b.useCallback(u=>{if(i){const h=typeof u=="function"?u(t):u;h!==t&&a(h)}else s(u)},[i,t,s,a]);return[o,l]}function FM({defaultProp:t,onChange:e}){const n=b.useState(t),[r]=n,s=b.useRef(r),i=Vr(e);return b.useEffect(()=>{s.current!==r&&(i(r),s.current=r)},[r,s,i]),n}var UM="VisuallyHidden",jf=b.forwardRef((t,e)=>y.jsx(Ut.span,{...t,ref:e,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...t.style}}));jf.displayName=UM;var $M=jf,a0="ToastProvider",[l0,BM,zM]=TM("Toast"),[WI]=i0("Toast",[zM]),[HM,Ff]=WI(a0),qI=t=>{const{__scopeToast:e,label:n="Notification",duration:r=5e3,swipeDirection:s="right",swipeThreshold:i=50,children:o}=t,[a,l]=b.useState(null),[u,d]=b.useState(0),h=b.useRef(!1),f=b.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${a0}\`. Expected non-empty \`string\`.`),y.jsx(l0.Provider,{scope:e,children:y.jsx(HM,{scope:e,label:n,duration:r,swipeDirection:s,swipeThreshold:i,toastCount:u,viewport:a,onViewportChange:l,onToastAdd:b.useCallback(()=>d(p=>p+1),[]),onToastRemove:b.useCallback(()=>d(p=>p-1),[]),isFocusedToastEscapeKeyDownRef:h,isClosePausedRef:f,children:o})})};qI.displayName=a0;var KI="ToastViewport",WM=["F8"],Hg="toast.viewportPause",Wg="toast.viewportResume",GI=b.forwardRef((t,e)=>{const{__scopeToast:n,hotkey:r=WM,label:s="Notifications ({hotkey})",...i}=t,o=Ff(KI,n),a=BM(n),l=b.useRef(null),u=b.useRef(null),d=b.useRef(null),h=b.useRef(null),f=Yn(e,h,o.onViewportChange),p=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),g=o.toastCount>0;b.useEffect(()=>{const _=v=>{var T;r.length!==0&&r.every(A=>v[A]||v.code===A)&&((T=h.current)==null||T.focus())};return document.addEventListener("keydown",_),()=>document.removeEventListener("keydown",_)},[r]),b.useEffect(()=>{const _=l.current,v=h.current;if(g&&_&&v){const x=()=>{if(!o.isClosePausedRef.current){const L=new CustomEvent(Hg);v.dispatchEvent(L),o.isClosePausedRef.current=!0}},T=()=>{if(o.isClosePausedRef.current){const L=new CustomEvent(Wg);v.dispatchEvent(L),o.isClosePausedRef.current=!1}},A=L=>{!_.contains(L.relatedTarget)&&T()},k=()=>{_.contains(document.activeElement)||T()};return _.addEventListener("focusin",x),_.addEventListener("focusout",A),_.addEventListener("pointermove",x),_.addEventListener("pointerleave",k),window.addEventListener("blur",x),window.addEventListener("focus",T),()=>{_.removeEventListener("focusin",x),_.removeEventListener("focusout",A),_.removeEventListener("pointermove",x),_.removeEventListener("pointerleave",k),window.removeEventListener("blur",x),window.removeEventListener("focus",T)}}},[g,o.isClosePausedRef]);const w=b.useCallback(({tabbingDirection:_})=>{const x=a().map(T=>{const A=T.ref.current,k=[A,...sV(A)];return _==="forwards"?k:k.reverse()});return(_==="forwards"?x.reverse():x).flat()},[a]);return b.useEffect(()=>{const _=h.current;if(_){const v=x=>{var k,L,C;const T=x.altKey||x.ctrlKey||x.metaKey;if(x.key==="Tab"&&!T){const S=document.activeElement,I=x.shiftKey;if(x.target===_&&I){(k=u.current)==null||k.focus();return}const O=w({tabbingDirection:I?"backwards":"forwards"}),D=O.findIndex(z=>z===S);gm(O.slice(D+1))?x.preventDefault():I?(L=u.current)==null||L.focus():(C=d.current)==null||C.focus()}};return _.addEventListener("keydown",v),()=>_.removeEventListener("keydown",v)}},[a,w]),y.jsxs(OM,{ref:l,role:"region","aria-label":s.replace("{hotkey}",p),tabIndex:-1,style:{pointerEvents:g?void 0:"none"},children:[g&&y.jsx(qg,{ref:u,onFocusFromOutsideViewport:()=>{const _=w({tabbingDirection:"forwards"});gm(_)}}),y.jsx(l0.Slot,{scope:n,children:y.jsx(Ut.ol,{tabIndex:-1,...i,ref:f})}),g&&y.jsx(qg,{ref:d,onFocusFromOutsideViewport:()=>{const _=w({tabbingDirection:"backwards"});gm(_)}})]})});GI.displayName=KI;var QI="ToastFocusProxy",qg=b.forwardRef((t,e)=>{const{__scopeToast:n,onFocusFromOutsideViewport:r,...s}=t,i=Ff(QI,n);return y.jsx(jf,{"aria-hidden":!0,tabIndex:0,...s,ref:e,style:{position:"fixed"},onFocus:o=>{var u;const a=o.relatedTarget;!((u=i.viewport)!=null&&u.contains(a))&&r()}})});qg.displayName=QI;var Uf="Toast",qM="toast.swipeStart",KM="toast.swipeMove",GM="toast.swipeCancel",QM="toast.swipeEnd",YI=b.forwardRef((t,e)=>{const{forceMount:n,open:r,defaultOpen:s,onOpenChange:i,...o}=t,[a=!0,l]=HI({prop:r,defaultProp:s,onChange:i});return y.jsx(Vf,{present:n||a,children:y.jsx(JM,{open:a,...o,ref:e,onClose:()=>l(!1),onPause:Vr(t.onPause),onResume:Vr(t.onResume),onSwipeStart:ft(t.onSwipeStart,u=>{u.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:ft(t.onSwipeMove,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","move"),u.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${h}px`)}),onSwipeCancel:ft(t.onSwipeCancel,u=>{u.currentTarget.setAttribute("data-swipe","cancel"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:ft(t.onSwipeEnd,u=>{const{x:d,y:h}=u.detail.delta;u.currentTarget.setAttribute("data-swipe","end"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),u.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),u.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${d}px`),u.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${h}px`),l(!1)})})})});YI.displayName=Uf;var[YM,XM]=WI(Uf,{onClose(){}}),JM=b.forwardRef((t,e)=>{const{__scopeToast:n,type:r="foreground",duration:s,open:i,onClose:o,onEscapeKeyDown:a,onPause:l,onResume:u,onSwipeStart:d,onSwipeMove:h,onSwipeCancel:f,onSwipeEnd:p,...g}=t,w=Ff(Uf,n),[_,v]=b.useState(null),x=Yn(e,z=>v(z)),T=b.useRef(null),A=b.useRef(null),k=s||w.duration,L=b.useRef(0),C=b.useRef(k),S=b.useRef(0),{onToastAdd:I,onToastRemove:P}=w,N=Vr(()=>{var re;(_==null?void 0:_.contains(document.activeElement))&&((re=w.viewport)==null||re.focus()),o()}),O=b.useCallback(z=>{!z||z===1/0||(window.clearTimeout(S.current),L.current=new Date().getTime(),S.current=window.setTimeout(N,z))},[N]);b.useEffect(()=>{const z=w.viewport;if(z){const re=()=>{O(C.current),u==null||u()},X=()=>{const G=new Date().getTime()-L.current;C.current=C.current-G,window.clearTimeout(S.current),l==null||l()};return z.addEventListener(Hg,X),z.addEventListener(Wg,re),()=>{z.removeEventListener(Hg,X),z.removeEventListener(Wg,re)}}},[w.viewport,k,l,u,O]),b.useEffect(()=>{i&&!w.isClosePausedRef.current&&O(k)},[i,k,w.isClosePausedRef,O]),b.useEffect(()=>(I(),()=>P()),[I,P]);const D=b.useMemo(()=>_?rP(_):null,[_]);return w.viewport?y.jsxs(y.Fragment,{children:[D&&y.jsx(ZM,{__scopeToast:n,role:"status","aria-live":r==="foreground"?"assertive":"polite","aria-atomic":!0,children:D}),y.jsx(YM,{scope:n,onClose:N,children:mc.createPortal(y.jsx(l0.ItemSlot,{scope:n,children:y.jsx(DM,{asChild:!0,onEscapeKeyDown:ft(a,()=>{w.isFocusedToastEscapeKeyDownRef.current||N(),w.isFocusedToastEscapeKeyDownRef.current=!1}),children:y.jsx(Ut.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":i?"open":"closed","data-swipe-direction":w.swipeDirection,...g,ref:x,style:{userSelect:"none",touchAction:"none",...t.style},onKeyDown:ft(t.onKeyDown,z=>{z.key==="Escape"&&(a==null||a(z.nativeEvent),z.nativeEvent.defaultPrevented||(w.isFocusedToastEscapeKeyDownRef.current=!0,N()))}),onPointerDown:ft(t.onPointerDown,z=>{z.button===0&&(T.current={x:z.clientX,y:z.clientY})}),onPointerMove:ft(t.onPointerMove,z=>{if(!T.current)return;const re=z.clientX-T.current.x,X=z.clientY-T.current.y,G=!!A.current,M=["left","right"].includes(w.swipeDirection),B=["left","up"].includes(w.swipeDirection)?Math.min:Math.max,Q=M?B(0,re):0,H=M?0:B(0,X),Y=z.pointerType==="touch"?10:2,te={x:Q,y:H},me={originalEvent:z,delta:te};G?(A.current=te,yd(KM,h,me,{discrete:!1})):lE(te,w.swipeDirection,Y)?(A.current=te,yd(qM,d,me,{discrete:!1}),z.target.setPointerCapture(z.pointerId)):(Math.abs(re)>Y||Math.abs(X)>Y)&&(T.current=null)}),onPointerUp:ft(t.onPointerUp,z=>{const re=A.current,X=z.target;if(X.hasPointerCapture(z.pointerId)&&X.releasePointerCapture(z.pointerId),A.current=null,T.current=null,re){const G=z.currentTarget,M={originalEvent:z,delta:re};lE(re,w.swipeDirection,w.swipeThreshold)?yd(QM,p,M,{discrete:!0}):yd(GM,f,M,{discrete:!0}),G.addEventListener("click",B=>B.preventDefault(),{once:!0})}})})})}),w.viewport)})]}):null}),ZM=t=>{const{__scopeToast:e,children:n,...r}=t,s=Ff(Uf,e),[i,o]=b.useState(!1),[a,l]=b.useState(!1);return nV(()=>o(!0)),b.useEffect(()=>{const u=window.setTimeout(()=>l(!0),1e3);return()=>window.clearTimeout(u)},[]),a?null:y.jsx(zI,{asChild:!0,children:y.jsx(jf,{...r,children:i&&y.jsxs(y.Fragment,{children:[s.label," ",n]})})})},eV="ToastTitle",XI=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(Ut.div,{...r,ref:e})});XI.displayName=eV;var tV="ToastDescription",JI=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t;return y.jsx(Ut.div,{...r,ref:e})});JI.displayName=tV;var ZI="ToastAction",eP=b.forwardRef((t,e)=>{const{altText:n,...r}=t;return n.trim()?y.jsx(nP,{altText:n,asChild:!0,children:y.jsx(u0,{...r,ref:e})}):(console.error(`Invalid prop \`altText\` supplied to \`${ZI}\`. Expected non-empty \`string\`.`),null)});eP.displayName=ZI;var tP="ToastClose",u0=b.forwardRef((t,e)=>{const{__scopeToast:n,...r}=t,s=XM(tP,n);return y.jsx(nP,{asChild:!0,children:y.jsx(Ut.button,{type:"button",...r,ref:e,onClick:ft(t.onClick,s.onClose)})})});u0.displayName=tP;var nP=b.forwardRef((t,e)=>{const{__scopeToast:n,altText:r,...s}=t;return y.jsx(Ut.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":r||void 0,...s,ref:e})});function rP(t){const e=[];return Array.from(t.childNodes).forEach(r=>{if(r.nodeType===r.TEXT_NODE&&r.textContent&&e.push(r.textContent),rV(r)){const s=r.ariaHidden||r.hidden||r.style.display==="none",i=r.dataset.radixToastAnnounceExclude==="";if(!s)if(i){const o=r.dataset.radixToastAnnounceAlt;o&&e.push(o)}else e.push(...rP(r))}}),e}function yd(t,e,n,{discrete:r}){const s=n.originalEvent.currentTarget,i=new CustomEvent(t,{bubbles:!0,cancelable:!0,detail:n});e&&s.addEventListener(t,e,{once:!0}),r?FI(s,i):s.dispatchEvent(i)}var lE=(t,e,n=0)=>{const r=Math.abs(t.x),s=Math.abs(t.y),i=r>s;return e==="left"||e==="right"?i&&r>n:!i&&s>n};function nV(t=()=>{}){const e=Vr(t);go(()=>{let n=0,r=0;return n=window.requestAnimationFrame(()=>r=window.requestAnimationFrame(e)),()=>{window.cancelAnimationFrame(n),window.cancelAnimationFrame(r)}},[e])}function rV(t){return t.nodeType===t.ELEMENT_NODE}function sV(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const s=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||s?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function gm(t){const e=document.activeElement;return t.some(n=>n===e?!0:(n.focus(),document.activeElement!==e))}var iV=qI,sP=GI,iP=YI,oP=XI,aP=JI,lP=eP,uP=u0;function cP(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;etypeof t=="boolean"?`${t}`:t===0?"0":t,cE=dP,$f=(t,e)=>n=>{var r;if((e==null?void 0:e.variants)==null)return cE(t,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:s,defaultVariants:i}=e,o=Object.keys(s).map(u=>{const d=n==null?void 0:n[u],h=i==null?void 0:i[u];if(d===null)return null;const f=uE(d)||uE(h);return s[u][f]}),a=n&&Object.entries(n).reduce((u,d)=>{let[h,f]=d;return f===void 0||(u[h]=f),u},{}),l=e==null||(r=e.compoundVariants)===null||r===void 0?void 0:r.reduce((u,d)=>{let{class:h,className:f,...p}=d;return Object.entries(p).every(g=>{let[w,_]=g;return Array.isArray(_)?_.includes({...i,...a}[w]):{...i,...a}[w]===_})?[...u,h,f]:u},[]);return cE(t,o,l,n==null?void 0:n.class,n==null?void 0:n.className)};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const oV=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),hP=(...t)=>t.filter((e,n,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===n).join(" ").trim();/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */var aV={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.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const lV=b.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:s="",children:i,iconNode:o,...a},l)=>b.createElement("svg",{ref:l,...aV,width:e,height:e,stroke:t,strokeWidth:r?Number(n)*24/Number(e):n,className:hP("lucide",s),...a},[...o.map(([u,d])=>b.createElement(u,d)),...Array.isArray(i)?i:[i]]));/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const qe=(t,e)=>{const n=b.forwardRef(({className:r,...s},i)=>b.createElement(lV,{ref:i,iconNode:e,className:hP(`lucide-${oV(t)}`,r),...s}));return n.displayName=`${t}`,n};/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const uV=qe("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fP=qe("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const cV=qe("Award",[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const dV=qe("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const hV=qe("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const Kd=qe("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const fV=qe("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pV=qe("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const mV=qe("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const gV=qe("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const yV=qe("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const vV=qe("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.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const wV=qe("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const xV=qe("GraduationCap",[["path",{d:"M21.42 10.922a1 1 0 0 0-.019-1.838L12.83 5.18a2 2 0 0 0-1.66 0L2.6 9.08a1 1 0 0 0 0 1.832l8.57 3.908a2 2 0 0 0 1.66 0z",key:"j76jl0"}],["path",{d:"M22 10v6",key:"1lu8f3"}],["path",{d:"M6 12.5V16a6 3 0 0 0 12 0v-3.5",key:"1r8lef"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const pP=qe("House",[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-5.999a2 2 0 0 1 2.582 0l7 5.999A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"1d0kgt"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const _V=qe("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const EV=qe("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.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const c0=qe("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.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const TV=qe("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const bV=qe("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const SV=qe("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const CV=qe("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const IV=qe("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/** * @license lucide-react v0.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const PV=qe("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.462.0 - ISC * * This source code is licensed under the ISC license. * See the LICENSE file in the root directory of this source tree. */const d0=qe("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),h0="-",AV=t=>{const e=kV(t),{conflictingClassGroups:n,conflictingClassGroupModifiers:r}=t;return{getClassGroupId:o=>{const a=o.split(h0);return a[0]===""&&a.length!==1&&a.shift(),mP(a,e)||RV(o)},getConflictingClassGroupIds:(o,a)=>{const l=n[o]||[];return a&&r[o]?[...l,...r[o]]:l}}},mP=(t,e)=>{var o;if(t.length===0)return e.classGroupId;const n=t[0],r=e.nextPart.get(n),s=r?mP(t.slice(1),r):void 0;if(s)return s;if(e.validators.length===0)return;const i=t.join(h0);return(o=e.validators.find(({validator:a})=>a(i)))==null?void 0:o.classGroupId},dE=/^\[(.+)\]$/,RV=t=>{if(dE.test(t)){const e=dE.exec(t)[1],n=e==null?void 0:e.substring(0,e.indexOf(":"));if(n)return"arbitrary.."+n}},kV=t=>{const{theme:e,prefix:n}=t,r={nextPart:new Map,validators:[]};return DV(Object.entries(t.classGroups),n).forEach(([i,o])=>{Kg(o,r,i,e)}),r},Kg=(t,e,n,r)=>{t.forEach(s=>{if(typeof s=="string"){const i=s===""?e:hE(e,s);i.classGroupId=n;return}if(typeof s=="function"){if(NV(s)){Kg(s(r),e,n,r);return}e.validators.push({validator:s,classGroupId:n});return}Object.entries(s).forEach(([i,o])=>{Kg(o,hE(e,i),n,r)})})},hE=(t,e)=>{let n=t;return e.split(h0).forEach(r=>{n.nextPart.has(r)||n.nextPart.set(r,{nextPart:new Map,validators:[]}),n=n.nextPart.get(r)}),n},NV=t=>t.isThemeGetter,DV=(t,e)=>e?t.map(([n,r])=>{const s=r.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([o,a])=>[e+o,a])):i);return[n,s]}):t,OV=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,n=new Map,r=new Map;const s=(i,o)=>{n.set(i,o),e++,e>t&&(e=0,r=n,n=new Map)};return{get(i){let o=n.get(i);if(o!==void 0)return o;if((o=r.get(i))!==void 0)return s(i,o),o},set(i,o){n.has(i)?n.set(i,o):s(i,o)}}},gP="!",LV=t=>{const{separator:e,experimentalParseClassName:n}=t,r=e.length===1,s=e[0],i=e.length,o=a=>{const l=[];let u=0,d=0,h;for(let _=0;_d?h-d:void 0;return{modifiers:l,hasImportantModifier:p,baseClassName:g,maybePostfixModifierPosition:w}};return n?a=>n({className:a,parseClassName:o}):o},MV=t=>{if(t.length<=1)return t;const e=[];let n=[];return t.forEach(r=>{r[0]==="["?(e.push(...n.sort(),r),n=[]):n.push(r)}),e.push(...n.sort()),e},VV=t=>({cache:OV(t.cacheSize),parseClassName:LV(t),...AV(t)}),jV=/\s+/,FV=(t,e)=>{const{parseClassName:n,getClassGroupId:r,getConflictingClassGroupIds:s}=e,i=[],o=t.trim().split(jV);let a="";for(let l=o.length-1;l>=0;l-=1){const u=o[l],{modifiers:d,hasImportantModifier:h,baseClassName:f,maybePostfixModifierPosition:p}=n(u);let g=!!p,w=r(g?f.substring(0,p):f);if(!w){if(!g){a=u+(a.length>0?" "+a:a);continue}if(w=r(f),!w){a=u+(a.length>0?" "+a:a);continue}g=!1}const _=MV(d).join(":"),v=h?_+gP:_,x=v+w;if(i.includes(x))continue;i.push(x);const T=s(w,g);for(let A=0;A0?" "+a:a)}return a};function UV(){let t=0,e,n,r="";for(;t{if(typeof t=="string")return t;let e,n="";for(let r=0;rh(d),t());return n=VV(u),r=n.cache.get,s=n.cache.set,i=a,a(l)}function a(l){const u=r(l);if(u)return u;const d=FV(l,n);return s(l,d),d}return function(){return i(UV.apply(null,arguments))}}const Be=t=>{const e=n=>n[t]||[];return e.isThemeGetter=!0,e},vP=/^\[(?:([a-z-]+):)?(.+)\]$/i,BV=/^\d+\/\d+$/,zV=new Set(["px","full","screen"]),HV=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,WV=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,qV=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,KV=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,GV=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,qr=t=>da(t)||zV.has(t)||BV.test(t),As=t=>Ya(t,"length",nj),da=t=>!!t&&!Number.isNaN(Number(t)),ym=t=>Ya(t,"number",da),kl=t=>!!t&&Number.isInteger(Number(t)),QV=t=>t.endsWith("%")&&da(t.slice(0,-1)),fe=t=>vP.test(t),Rs=t=>HV.test(t),YV=new Set(["length","size","percentage"]),XV=t=>Ya(t,YV,wP),JV=t=>Ya(t,"position",wP),ZV=new Set(["image","url"]),ej=t=>Ya(t,ZV,sj),tj=t=>Ya(t,"",rj),Nl=()=>!0,Ya=(t,e,n)=>{const r=vP.exec(t);return r?r[1]?typeof e=="string"?r[1]===e:e.has(r[1]):n(r[2]):!1},nj=t=>WV.test(t)&&!qV.test(t),wP=()=>!1,rj=t=>KV.test(t),sj=t=>GV.test(t),ij=()=>{const t=Be("colors"),e=Be("spacing"),n=Be("blur"),r=Be("brightness"),s=Be("borderColor"),i=Be("borderRadius"),o=Be("borderSpacing"),a=Be("borderWidth"),l=Be("contrast"),u=Be("grayscale"),d=Be("hueRotate"),h=Be("invert"),f=Be("gap"),p=Be("gradientColorStops"),g=Be("gradientColorStopPositions"),w=Be("inset"),_=Be("margin"),v=Be("opacity"),x=Be("padding"),T=Be("saturate"),A=Be("scale"),k=Be("sepia"),L=Be("skew"),C=Be("space"),S=Be("translate"),I=()=>["auto","contain","none"],P=()=>["auto","hidden","clip","visible","scroll"],N=()=>["auto",fe,e],O=()=>[fe,e],D=()=>["",qr,As],z=()=>["auto",da,fe],re=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],X=()=>["solid","dashed","dotted","double","none"],G=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],M=()=>["start","end","center","between","around","evenly","stretch"],B=()=>["","0",fe],Q=()=>["auto","avoid","all","avoid-page","page","left","right","column"],H=()=>[da,fe];return{cacheSize:500,separator:":",theme:{colors:[Nl],spacing:[qr,As],blur:["none","",Rs,fe],brightness:H(),borderColor:[t],borderRadius:["none","","full",Rs,fe],borderSpacing:O(),borderWidth:D(),contrast:H(),grayscale:B(),hueRotate:H(),invert:B(),gap:O(),gradientColorStops:[t],gradientColorStopPositions:[QV,As],inset:N(),margin:N(),opacity:H(),padding:O(),saturate:H(),scale:H(),sepia:B(),skew:H(),space:O(),translate:O()},classGroups:{aspect:[{aspect:["auto","square","video",fe]}],container:["container"],columns:[{columns:[Rs]}],"break-after":[{"break-after":Q()}],"break-before":[{"break-before":Q()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...re(),fe]}],overflow:[{overflow:P()}],"overflow-x":[{"overflow-x":P()}],"overflow-y":[{"overflow-y":P()}],overscroll:[{overscroll:I()}],"overscroll-x":[{"overscroll-x":I()}],"overscroll-y":[{"overscroll-y":I()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[w]}],"inset-x":[{"inset-x":[w]}],"inset-y":[{"inset-y":[w]}],start:[{start:[w]}],end:[{end:[w]}],top:[{top:[w]}],right:[{right:[w]}],bottom:[{bottom:[w]}],left:[{left:[w]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",kl,fe]}],basis:[{basis:N()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",fe]}],grow:[{grow:B()}],shrink:[{shrink:B()}],order:[{order:["first","last","none",kl,fe]}],"grid-cols":[{"grid-cols":[Nl]}],"col-start-end":[{col:["auto",{span:["full",kl,fe]},fe]}],"col-start":[{"col-start":z()}],"col-end":[{"col-end":z()}],"grid-rows":[{"grid-rows":[Nl]}],"row-start-end":[{row:["auto",{span:[kl,fe]},fe]}],"row-start":[{"row-start":z()}],"row-end":[{"row-end":z()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",fe]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",fe]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...M()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...M(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...M(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[x]}],px:[{px:[x]}],py:[{py:[x]}],ps:[{ps:[x]}],pe:[{pe:[x]}],pt:[{pt:[x]}],pr:[{pr:[x]}],pb:[{pb:[x]}],pl:[{pl:[x]}],m:[{m:[_]}],mx:[{mx:[_]}],my:[{my:[_]}],ms:[{ms:[_]}],me:[{me:[_]}],mt:[{mt:[_]}],mr:[{mr:[_]}],mb:[{mb:[_]}],ml:[{ml:[_]}],"space-x":[{"space-x":[C]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[C]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",fe,e]}],"min-w":[{"min-w":[fe,e,"min","max","fit"]}],"max-w":[{"max-w":[fe,e,"none","full","min","max","fit","prose",{screen:[Rs]},Rs]}],h:[{h:[fe,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[fe,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[fe,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[fe,e,"auto","min","max","fit"]}],"font-size":[{text:["base",Rs,As]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",ym]}],"font-family":[{font:[Nl]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractons"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",fe]}],"line-clamp":[{"line-clamp":["none",da,ym]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",qr,fe]}],"list-image":[{"list-image":["none",fe]}],"list-style-type":[{list:["none","disc","decimal",fe]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[v]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[v]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...X(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",qr,As]}],"underline-offset":[{"underline-offset":["auto",qr,fe]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:O()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",fe]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",fe]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[v]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...re(),JV]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",XV]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},ej]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[g]}],"gradient-via-pos":[{via:[g]}],"gradient-to-pos":[{to:[g]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[a]}],"border-w-x":[{"border-x":[a]}],"border-w-y":[{"border-y":[a]}],"border-w-s":[{"border-s":[a]}],"border-w-e":[{"border-e":[a]}],"border-w-t":[{"border-t":[a]}],"border-w-r":[{"border-r":[a]}],"border-w-b":[{"border-b":[a]}],"border-w-l":[{"border-l":[a]}],"border-opacity":[{"border-opacity":[v]}],"border-style":[{border:[...X(),"hidden"]}],"divide-x":[{"divide-x":[a]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[a]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[v]}],"divide-style":[{divide:X()}],"border-color":[{border:[s]}],"border-color-x":[{"border-x":[s]}],"border-color-y":[{"border-y":[s]}],"border-color-s":[{"border-s":[s]}],"border-color-e":[{"border-e":[s]}],"border-color-t":[{"border-t":[s]}],"border-color-r":[{"border-r":[s]}],"border-color-b":[{"border-b":[s]}],"border-color-l":[{"border-l":[s]}],"divide-color":[{divide:[s]}],"outline-style":[{outline:["",...X()]}],"outline-offset":[{"outline-offset":[qr,fe]}],"outline-w":[{outline:[qr,As]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:D()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[v]}],"ring-offset-w":[{"ring-offset":[qr,As]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",Rs,tj]}],"shadow-color":[{shadow:[Nl]}],opacity:[{opacity:[v]}],"mix-blend":[{"mix-blend":[...G(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":G()}],filter:[{filter:["","none"]}],blur:[{blur:[n]}],brightness:[{brightness:[r]}],contrast:[{contrast:[l]}],"drop-shadow":[{"drop-shadow":["","none",Rs,fe]}],grayscale:[{grayscale:[u]}],"hue-rotate":[{"hue-rotate":[d]}],invert:[{invert:[h]}],saturate:[{saturate:[T]}],sepia:[{sepia:[k]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[n]}],"backdrop-brightness":[{"backdrop-brightness":[r]}],"backdrop-contrast":[{"backdrop-contrast":[l]}],"backdrop-grayscale":[{"backdrop-grayscale":[u]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[d]}],"backdrop-invert":[{"backdrop-invert":[h]}],"backdrop-opacity":[{"backdrop-opacity":[v]}],"backdrop-saturate":[{"backdrop-saturate":[T]}],"backdrop-sepia":[{"backdrop-sepia":[k]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[o]}],"border-spacing-x":[{"border-spacing-x":[o]}],"border-spacing-y":[{"border-spacing-y":[o]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",fe]}],duration:[{duration:H()}],ease:[{ease:["linear","in","out","in-out",fe]}],delay:[{delay:H()}],animate:[{animate:["none","spin","ping","pulse","bounce",fe]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[A]}],"scale-x":[{"scale-x":[A]}],"scale-y":[{"scale-y":[A]}],rotate:[{rotate:[kl,fe]}],"translate-x":[{"translate-x":[S]}],"translate-y":[{"translate-y":[S]}],"skew-x":[{"skew-x":[L]}],"skew-y":[{"skew-y":[L]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",fe]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",fe]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":O()}],"scroll-mx":[{"scroll-mx":O()}],"scroll-my":[{"scroll-my":O()}],"scroll-ms":[{"scroll-ms":O()}],"scroll-me":[{"scroll-me":O()}],"scroll-mt":[{"scroll-mt":O()}],"scroll-mr":[{"scroll-mr":O()}],"scroll-mb":[{"scroll-mb":O()}],"scroll-ml":[{"scroll-ml":O()}],"scroll-p":[{"scroll-p":O()}],"scroll-px":[{"scroll-px":O()}],"scroll-py":[{"scroll-py":O()}],"scroll-ps":[{"scroll-ps":O()}],"scroll-pe":[{"scroll-pe":O()}],"scroll-pt":[{"scroll-pt":O()}],"scroll-pr":[{"scroll-pr":O()}],"scroll-pb":[{"scroll-pb":O()}],"scroll-pl":[{"scroll-pl":O()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",fe]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[qr,As,ym]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},oj=$V(ij);function Ye(...t){return oj(dP(t))}const aj=iV,xP=b.forwardRef(({className:t,...e},n)=>y.jsx(sP,{ref:n,className:Ye("fixed top-0 z-[100] flex max-h-screen w-full flex-col-reverse p-4 sm:bottom-0 sm:right-0 sm:top-auto sm:flex-col md:max-w-[420px]",t),...e}));xP.displayName=sP.displayName;const lj=$f("group pointer-events-auto relative flex w-full items-center justify-between space-x-4 overflow-hidden rounded-md border p-6 pr-8 shadow-lg transition-all data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[swipe=move]:transition-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[swipe=end]:animate-out data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full",{variants:{variant:{default:"border bg-background text-foreground",destructive:"destructive group border-destructive bg-destructive text-destructive-foreground"}},defaultVariants:{variant:"default"}}),_P=b.forwardRef(({className:t,variant:e,...n},r)=>y.jsx(iP,{ref:r,className:Ye(lj({variant:e}),t),...n}));_P.displayName=iP.displayName;const uj=b.forwardRef(({className:t,...e},n)=>y.jsx(lP,{ref:n,className:Ye("inline-flex h-8 shrink-0 items-center justify-center rounded-md border bg-transparent px-3 text-sm font-medium ring-offset-background transition-colors hover:bg-secondary focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 group-[.destructive]:border-muted/40 group-[.destructive]:hover:border-destructive/30 group-[.destructive]:hover:bg-destructive group-[.destructive]:hover:text-destructive-foreground group-[.destructive]:focus:ring-destructive",t),...e}));uj.displayName=lP.displayName;const EP=b.forwardRef(({className:t,...e},n)=>y.jsx(uP,{ref:n,className:Ye("absolute right-2 top-2 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground focus:opacity-100 focus:outline-none focus:ring-2 group-hover:opacity-100 group-[.destructive]:text-red-300 group-[.destructive]:hover:text-red-50 group-[.destructive]:focus:ring-red-400 group-[.destructive]:focus:ring-offset-red-600",t),"toast-close":"",...e,children:y.jsx(d0,{className:"h-4 w-4"})}));EP.displayName=uP.displayName;const TP=b.forwardRef(({className:t,...e},n)=>y.jsx(oP,{ref:n,className:Ye("text-sm font-semibold",t),...e}));TP.displayName=oP.displayName;const bP=b.forwardRef(({className:t,...e},n)=>y.jsx(aP,{ref:n,className:Ye("text-sm opacity-90",t),...e}));bP.displayName=aP.displayName;function cj(){const{toasts:t}=MI();return y.jsxs(aj,{children:[t.map(function({id:e,title:n,description:r,action:s,...i}){return y.jsxs(_P,{...i,children:[y.jsxs("div",{className:"grid gap-1",children:[n&&y.jsx(TP,{children:n}),r&&y.jsx(bP,{children:r})]}),s,y.jsx(EP,{})]},e)}),y.jsx(xP,{})]})}var fE=["light","dark"],dj="(prefers-color-scheme: dark)",hj=b.createContext(void 0),fj={setTheme:t=>{},themes:[]},pj=()=>{var t;return(t=b.useContext(hj))!=null?t:fj};b.memo(({forcedTheme:t,storageKey:e,attribute:n,enableSystem:r,enableColorScheme:s,defaultTheme:i,value:o,attrs:a,nonce:l})=>{let u=i==="system",d=n==="class"?`var d=document.documentElement,c=d.classList;${`c.remove(${a.map(g=>`'${g}'`).join(",")})`};`:`var d=document.documentElement,n='${n}',s='setAttribute';`,h=s?fE.includes(i)&&i?`if(e==='light'||e==='dark'||!e)d.style.colorScheme=e||'${i}'`:"if(e==='light'||e==='dark')d.style.colorScheme=e":"",f=(g,w=!1,_=!0)=>{let v=o?o[g]:g,x=w?g+"|| ''":`'${v}'`,T="";return s&&_&&!w&&fE.includes(g)&&(T+=`d.style.colorScheme = '${g}';`),n==="class"?w||v?T+=`c.add(${x})`:T+="null":v&&(T+=`d[s](n,${x})`),T},p=t?`!function(){${d}${f(t)}}()`:r?`!function(){try{${d}var e=localStorage.getItem('${e}');if('system'===e||(!e&&${u})){var t='${dj}',m=window.matchMedia(t);if(m.media!==t||m.matches){${f("dark")}}else{${f("light")}}}else if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}${u?"":"else{"+f(i,!1,!1)+"}"}${h}}catch(e){}}()`:`!function(){try{${d}var e=localStorage.getItem('${e}');if(e){${o?`var x=${JSON.stringify(o)};`:""}${f(o?"x[e]":"e",!0)}}else{${f(i,!1,!1)};}${h}}catch(t){}}();`;return b.createElement("script",{nonce:l,dangerouslySetInnerHTML:{__html:p}})});var mj=t=>{switch(t){case"success":return vj;case"info":return xj;case"warning":return wj;case"error":return _j;default:return null}},gj=Array(12).fill(0),yj=({visible:t})=>q.createElement("div",{className:"sonner-loading-wrapper","data-visible":t},q.createElement("div",{className:"sonner-spinner"},gj.map((e,n)=>q.createElement("div",{className:"sonner-loading-bar",key:`spinner-bar-${n}`})))),vj=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",clipRule:"evenodd"})),wj=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",clipRule:"evenodd"})),xj=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",clipRule:"evenodd"})),_j=q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",height:"20",width:"20"},q.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",clipRule:"evenodd"})),Ej=()=>{let[t,e]=q.useState(document.hidden);return q.useEffect(()=>{let n=()=>{e(document.hidden)};return document.addEventListener("visibilitychange",n),()=>window.removeEventListener("visibilitychange",n)},[]),t},Gg=1,Tj=class{constructor(){this.subscribe=e=>(this.subscribers.push(e),()=>{let n=this.subscribers.indexOf(e);this.subscribers.splice(n,1)}),this.publish=e=>{this.subscribers.forEach(n=>n(e))},this.addToast=e=>{this.publish(e),this.toasts=[...this.toasts,e]},this.create=e=>{var n;let{message:r,...s}=e,i=typeof(e==null?void 0:e.id)=="number"||((n=e.id)==null?void 0:n.length)>0?e.id:Gg++,o=this.toasts.find(l=>l.id===i),a=e.dismissible===void 0?!0:e.dismissible;return o?this.toasts=this.toasts.map(l=>l.id===i?(this.publish({...l,...e,id:i,title:r}),{...l,...e,id:i,dismissible:a,title:r}):l):this.addToast({title:r,...s,dismissible:a,id:i}),i},this.dismiss=e=>(e||this.toasts.forEach(n=>{this.subscribers.forEach(r=>r({id:n.id,dismiss:!0}))}),this.subscribers.forEach(n=>n({id:e,dismiss:!0})),e),this.message=(e,n)=>this.create({...n,message:e}),this.error=(e,n)=>this.create({...n,message:e,type:"error"}),this.success=(e,n)=>this.create({...n,type:"success",message:e}),this.info=(e,n)=>this.create({...n,type:"info",message:e}),this.warning=(e,n)=>this.create({...n,type:"warning",message:e}),this.loading=(e,n)=>this.create({...n,type:"loading",message:e}),this.promise=(e,n)=>{if(!n)return;let r;n.loading!==void 0&&(r=this.create({...n,promise:e,type:"loading",message:n.loading,description:typeof n.description!="function"?n.description:void 0}));let s=e instanceof Promise?e:e(),i=r!==void 0;return s.then(async o=>{if(Sj(o)&&!o.ok){i=!1;let a=typeof n.error=="function"?await n.error(`HTTP error! status: ${o.status}`):n.error,l=typeof n.description=="function"?await n.description(`HTTP error! status: ${o.status}`):n.description;this.create({id:r,type:"error",message:a,description:l})}else if(n.success!==void 0){i=!1;let a=typeof n.success=="function"?await n.success(o):n.success,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"success",message:a,description:l})}}).catch(async o=>{if(n.error!==void 0){i=!1;let a=typeof n.error=="function"?await n.error(o):n.error,l=typeof n.description=="function"?await n.description(o):n.description;this.create({id:r,type:"error",message:a,description:l})}}).finally(()=>{var o;i&&(this.dismiss(r),r=void 0),(o=n.finally)==null||o.call(n)}),r},this.custom=(e,n)=>{let r=(n==null?void 0:n.id)||Gg++;return this.create({jsx:e(r),id:r,...n}),r},this.subscribers=[],this.toasts=[]}},En=new Tj,bj=(t,e)=>{let n=(e==null?void 0:e.id)||Gg++;return En.addToast({title:t,...e,id:n}),n},Sj=t=>t&&typeof t=="object"&&"ok"in t&&typeof t.ok=="boolean"&&"status"in t&&typeof t.status=="number",Cj=bj,Ij=()=>En.toasts;Object.assign(Cj,{success:En.success,info:En.info,warning:En.warning,error:En.error,custom:En.custom,message:En.message,promise:En.promise,dismiss:En.dismiss,loading:En.loading},{getHistory:Ij});function Pj(t,{insertAt:e}={}){if(typeof document>"u")return;let n=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",e==="top"&&n.firstChild?n.insertBefore(r,n.firstChild):n.appendChild(r),r.styleSheet?r.styleSheet.cssText=t:r.appendChild(document.createTextNode(t))}Pj(`:where(html[dir="ltr"]),:where([data-sonner-toaster][dir="ltr"]){--toast-icon-margin-start: -3px;--toast-icon-margin-end: 4px;--toast-svg-margin-start: -1px;--toast-svg-margin-end: 0px;--toast-button-margin-start: auto;--toast-button-margin-end: 0;--toast-close-button-start: 0;--toast-close-button-end: unset;--toast-close-button-transform: translate(-35%, -35%)}:where(html[dir="rtl"]),:where([data-sonner-toaster][dir="rtl"]){--toast-icon-margin-start: 4px;--toast-icon-margin-end: -3px;--toast-svg-margin-start: 0px;--toast-svg-margin-end: -1px;--toast-button-margin-start: 0;--toast-button-margin-end: auto;--toast-close-button-start: unset;--toast-close-button-end: 0;--toast-close-button-transform: translate(35%, -35%)}:where([data-sonner-toaster]){position:fixed;width:var(--width);font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;--gray1: hsl(0, 0%, 99%);--gray2: hsl(0, 0%, 97.3%);--gray3: hsl(0, 0%, 95.1%);--gray4: hsl(0, 0%, 93%);--gray5: hsl(0, 0%, 90.9%);--gray6: hsl(0, 0%, 88.7%);--gray7: hsl(0, 0%, 85.8%);--gray8: hsl(0, 0%, 78%);--gray9: hsl(0, 0%, 56.1%);--gray10: hsl(0, 0%, 52.3%);--gray11: hsl(0, 0%, 43.5%);--gray12: hsl(0, 0%, 9%);--border-radius: 8px;box-sizing:border-box;padding:0;margin:0;list-style:none;outline:none;z-index:999999999}:where([data-sonner-toaster][data-x-position="right"]){right:max(var(--offset),env(safe-area-inset-right))}:where([data-sonner-toaster][data-x-position="left"]){left:max(var(--offset),env(safe-area-inset-left))}:where([data-sonner-toaster][data-x-position="center"]){left:50%;transform:translate(-50%)}:where([data-sonner-toaster][data-y-position="top"]){top:max(var(--offset),env(safe-area-inset-top))}:where([data-sonner-toaster][data-y-position="bottom"]){bottom:max(var(--offset),env(safe-area-inset-bottom))}:where([data-sonner-toast]){--y: translateY(100%);--lift-amount: calc(var(--lift) * var(--gap));z-index:var(--z-index);position:absolute;opacity:0;transform:var(--y);filter:blur(0);touch-action:none;transition:transform .4s,opacity .4s,height .4s,box-shadow .2s;box-sizing:border-box;outline:none;overflow-wrap:anywhere}:where([data-sonner-toast][data-styled="true"]){padding:16px;background:var(--normal-bg);border:1px solid var(--normal-border);color:var(--normal-text);border-radius:var(--border-radius);box-shadow:0 4px 12px #0000001a;width:var(--width);font-size:13px;display:flex;align-items:center;gap:6px}:where([data-sonner-toast]:focus-visible){box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast][data-y-position="top"]){top:0;--y: translateY(-100%);--lift: 1;--lift-amount: calc(1 * var(--gap))}:where([data-sonner-toast][data-y-position="bottom"]){bottom:0;--y: translateY(100%);--lift: -1;--lift-amount: calc(var(--lift) * var(--gap))}:where([data-sonner-toast]) :where([data-description]){font-weight:400;line-height:1.4;color:inherit}:where([data-sonner-toast]) :where([data-title]){font-weight:500;line-height:1.5;color:inherit}:where([data-sonner-toast]) :where([data-icon]){display:flex;height:16px;width:16px;position:relative;justify-content:flex-start;align-items:center;flex-shrink:0;margin-left:var(--toast-icon-margin-start);margin-right:var(--toast-icon-margin-end)}:where([data-sonner-toast][data-promise="true"]) :where([data-icon])>svg{opacity:0;transform:scale(.8);transform-origin:center;animation:sonner-fade-in .3s ease forwards}:where([data-sonner-toast]) :where([data-icon])>*{flex-shrink:0}:where([data-sonner-toast]) :where([data-icon]) svg{margin-left:var(--toast-svg-margin-start);margin-right:var(--toast-svg-margin-end)}:where([data-sonner-toast]) :where([data-content]){display:flex;flex-direction:column;gap:2px}[data-sonner-toast][data-styled=true] [data-button]{border-radius:4px;padding-left:8px;padding-right:8px;height:24px;font-size:12px;color:var(--normal-bg);background:var(--normal-text);margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end);border:none;cursor:pointer;outline:none;display:flex;align-items:center;flex-shrink:0;transition:opacity .4s,box-shadow .2s}:where([data-sonner-toast]) :where([data-button]):focus-visible{box-shadow:0 0 0 2px #0006}:where([data-sonner-toast]) :where([data-button]):first-of-type{margin-left:var(--toast-button-margin-start);margin-right:var(--toast-button-margin-end)}:where([data-sonner-toast]) :where([data-cancel]){color:var(--normal-text);background:rgba(0,0,0,.08)}:where([data-sonner-toast][data-theme="dark"]) :where([data-cancel]){background:rgba(255,255,255,.3)}:where([data-sonner-toast]) :where([data-close-button]){position:absolute;left:var(--toast-close-button-start);right:var(--toast-close-button-end);top:0;height:20px;width:20px;display:flex;justify-content:center;align-items:center;padding:0;background:var(--gray1);color:var(--gray12);border:1px solid var(--gray4);transform:var(--toast-close-button-transform);border-radius:50%;cursor:pointer;z-index:1;transition:opacity .1s,background .2s,border-color .2s}:where([data-sonner-toast]) :where([data-close-button]):focus-visible{box-shadow:0 4px 12px #0000001a,0 0 0 2px #0003}:where([data-sonner-toast]) :where([data-disabled="true"]){cursor:not-allowed}:where([data-sonner-toast]):hover :where([data-close-button]):hover{background:var(--gray2);border-color:var(--gray5)}:where([data-sonner-toast][data-swiping="true"]):before{content:"";position:absolute;left:0;right:0;height:100%;z-index:-1}:where([data-sonner-toast][data-y-position="top"][data-swiping="true"]):before{bottom:50%;transform:scaleY(3) translateY(50%)}:where([data-sonner-toast][data-y-position="bottom"][data-swiping="true"]):before{top:50%;transform:scaleY(3) translateY(-50%)}:where([data-sonner-toast][data-swiping="false"][data-removed="true"]):before{content:"";position:absolute;inset:0;transform:scaleY(2)}:where([data-sonner-toast]):after{content:"";position:absolute;left:0;height:calc(var(--gap) + 1px);bottom:100%;width:100%}:where([data-sonner-toast][data-mounted="true"]){--y: translateY(0);opacity:1}:where([data-sonner-toast][data-expanded="false"][data-front="false"]){--scale: var(--toasts-before) * .05 + 1;--y: translateY(calc(var(--lift-amount) * var(--toasts-before))) scale(calc(-1 * var(--scale)));height:var(--front-toast-height)}:where([data-sonner-toast])>*{transition:opacity .4s}:where([data-sonner-toast][data-expanded="false"][data-front="false"][data-styled="true"])>*{opacity:0}:where([data-sonner-toast][data-visible="false"]){opacity:0;pointer-events:none}:where([data-sonner-toast][data-mounted="true"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset)));height:var(--initial-height)}:where([data-sonner-toast][data-removed="true"][data-front="true"][data-swipe-out="false"]){--y: translateY(calc(var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="true"]){--y: translateY(calc(var(--lift) * var(--offset) + var(--lift) * -100%));opacity:0}:where([data-sonner-toast][data-removed="true"][data-front="false"][data-swipe-out="false"][data-expanded="false"]){--y: translateY(40%);opacity:0;transition:transform .5s,opacity .2s}:where([data-sonner-toast][data-removed="true"][data-front="false"]):before{height:calc(var(--initial-height) + 20%)}[data-sonner-toast][data-swiping=true]{transform:var(--y) translateY(var(--swipe-amount, 0px));transition:none}[data-sonner-toast][data-swipe-out=true][data-y-position=bottom],[data-sonner-toast][data-swipe-out=true][data-y-position=top]{animation:swipe-out .2s ease-out forwards}@keyframes swipe-out{0%{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount)));opacity:1}to{transform:translateY(calc(var(--lift) * var(--offset) + var(--swipe-amount) + var(--lift) * -100%));opacity:0}}@media (max-width: 600px){[data-sonner-toaster]{position:fixed;--mobile-offset: 16px;right:var(--mobile-offset);left:var(--mobile-offset);width:100%}[data-sonner-toaster] [data-sonner-toast]{left:0;right:0;width:calc(100% - var(--mobile-offset) * 2)}[data-sonner-toaster][data-x-position=left]{left:var(--mobile-offset)}[data-sonner-toaster][data-y-position=bottom]{bottom:20px}[data-sonner-toaster][data-y-position=top]{top:20px}[data-sonner-toaster][data-x-position=center]{left:var(--mobile-offset);right:var(--mobile-offset);transform:none}}[data-sonner-toaster][data-theme=light]{--normal-bg: #fff;--normal-border: var(--gray4);--normal-text: var(--gray12);--success-bg: hsl(143, 85%, 96%);--success-border: hsl(145, 92%, 91%);--success-text: hsl(140, 100%, 27%);--info-bg: hsl(208, 100%, 97%);--info-border: hsl(221, 91%, 91%);--info-text: hsl(210, 92%, 45%);--warning-bg: hsl(49, 100%, 97%);--warning-border: hsl(49, 91%, 91%);--warning-text: hsl(31, 92%, 45%);--error-bg: hsl(359, 100%, 97%);--error-border: hsl(359, 100%, 94%);--error-text: hsl(360, 100%, 45%)}[data-sonner-toaster][data-theme=light] [data-sonner-toast][data-invert=true]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1)}[data-sonner-toaster][data-theme=dark] [data-sonner-toast][data-invert=true]{--normal-bg: #fff;--normal-border: var(--gray3);--normal-text: var(--gray12)}[data-sonner-toaster][data-theme=dark]{--normal-bg: #000;--normal-border: hsl(0, 0%, 20%);--normal-text: var(--gray1);--success-bg: hsl(150, 100%, 6%);--success-border: hsl(147, 100%, 12%);--success-text: hsl(150, 86%, 65%);--info-bg: hsl(215, 100%, 6%);--info-border: hsl(223, 100%, 12%);--info-text: hsl(216, 87%, 65%);--warning-bg: hsl(64, 100%, 6%);--warning-border: hsl(60, 100%, 12%);--warning-text: hsl(46, 87%, 65%);--error-bg: hsl(358, 76%, 10%);--error-border: hsl(357, 89%, 16%);--error-text: hsl(358, 100%, 81%)}[data-rich-colors=true][data-sonner-toast][data-type=success],[data-rich-colors=true][data-sonner-toast][data-type=success] [data-close-button]{background:var(--success-bg);border-color:var(--success-border);color:var(--success-text)}[data-rich-colors=true][data-sonner-toast][data-type=info],[data-rich-colors=true][data-sonner-toast][data-type=info] [data-close-button]{background:var(--info-bg);border-color:var(--info-border);color:var(--info-text)}[data-rich-colors=true][data-sonner-toast][data-type=warning],[data-rich-colors=true][data-sonner-toast][data-type=warning] [data-close-button]{background:var(--warning-bg);border-color:var(--warning-border);color:var(--warning-text)}[data-rich-colors=true][data-sonner-toast][data-type=error],[data-rich-colors=true][data-sonner-toast][data-type=error] [data-close-button]{background:var(--error-bg);border-color:var(--error-border);color:var(--error-text)}.sonner-loading-wrapper{--size: 16px;height:var(--size);width:var(--size);position:absolute;inset:0;z-index:10}.sonner-loading-wrapper[data-visible=false]{transform-origin:center;animation:sonner-fade-out .2s ease forwards}.sonner-spinner{position:relative;top:50%;left:50%;height:var(--size);width:var(--size)}.sonner-loading-bar{animation:sonner-spin 1.2s linear infinite;background:var(--gray11);border-radius:6px;height:8%;left:-10%;position:absolute;top:-3.9%;width:24%}.sonner-loading-bar:nth-child(1){animation-delay:-1.2s;transform:rotate(.0001deg) translate(146%)}.sonner-loading-bar:nth-child(2){animation-delay:-1.1s;transform:rotate(30deg) translate(146%)}.sonner-loading-bar:nth-child(3){animation-delay:-1s;transform:rotate(60deg) translate(146%)}.sonner-loading-bar:nth-child(4){animation-delay:-.9s;transform:rotate(90deg) translate(146%)}.sonner-loading-bar:nth-child(5){animation-delay:-.8s;transform:rotate(120deg) translate(146%)}.sonner-loading-bar:nth-child(6){animation-delay:-.7s;transform:rotate(150deg) translate(146%)}.sonner-loading-bar:nth-child(7){animation-delay:-.6s;transform:rotate(180deg) translate(146%)}.sonner-loading-bar:nth-child(8){animation-delay:-.5s;transform:rotate(210deg) translate(146%)}.sonner-loading-bar:nth-child(9){animation-delay:-.4s;transform:rotate(240deg) translate(146%)}.sonner-loading-bar:nth-child(10){animation-delay:-.3s;transform:rotate(270deg) translate(146%)}.sonner-loading-bar:nth-child(11){animation-delay:-.2s;transform:rotate(300deg) translate(146%)}.sonner-loading-bar:nth-child(12){animation-delay:-.1s;transform:rotate(330deg) translate(146%)}@keyframes sonner-fade-in{0%{opacity:0;transform:scale(.8)}to{opacity:1;transform:scale(1)}}@keyframes sonner-fade-out{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(.8)}}@keyframes sonner-spin{0%{opacity:1}to{opacity:.15}}@media (prefers-reduced-motion){[data-sonner-toast],[data-sonner-toast]>*,.sonner-loading-bar{transition:none!important;animation:none!important}}.sonner-loader{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);transform-origin:center;transition:opacity .2s,transform .2s}.sonner-loader[data-visible=false]{opacity:0;transform:scale(.8) translate(-50%,-50%)} `);function vd(t){return t.label!==void 0}var Aj=3,Rj="32px",kj=4e3,Nj=356,Dj=14,Oj=20,Lj=200;function Mj(...t){return t.filter(Boolean).join(" ")}var Vj=t=>{var e,n,r,s,i,o,a,l,u,d;let{invert:h,toast:f,unstyled:p,interacting:g,setHeights:w,visibleToasts:_,heights:v,index:x,toasts:T,expanded:A,removeToast:k,defaultRichColors:L,closeButton:C,style:S,cancelButtonStyle:I,actionButtonStyle:P,className:N="",descriptionClassName:O="",duration:D,position:z,gap:re,loadingIcon:X,expandByDefault:G,classNames:M,icons:B,closeButtonAriaLabel:Q="Close toast",pauseWhenPageIsHidden:H,cn:Y}=t,[te,me]=q.useState(!1),[Oe,ye]=q.useState(!1),[Pe,Ve]=q.useState(!1),[mt,je]=q.useState(!1),[Te,Z]=q.useState(0),[ge,Ae]=q.useState(0),Ke=q.useRef(null),st=q.useRef(null),tn=x===0,cn=x+1<=_,Ne=f.type,Ct=f.dismissible!==!1,vr=f.className||"",Oi=f.descriptionClassName||"",On=q.useMemo(()=>v.findIndex(ae=>ae.toastId===f.id)||0,[v,f.id]),Es=q.useMemo(()=>{var ae;return(ae=f.closeButton)!=null?ae:C},[f.closeButton,C]),Ts=q.useMemo(()=>f.duration||D||kj,[f.duration,D]),it=q.useRef(0),Ue=q.useRef(0),Br=q.useRef(0),xn=q.useRef(null),[dn,Li]=z.split("-"),Ln=q.useMemo(()=>v.reduce((ae,Re,Se)=>Se>=On?ae:ae+Re.height,0),[v,On]),wr=Ej(),bs=f.invert||h,zr=Ne==="loading";Ue.current=q.useMemo(()=>On*re+Ln,[On,Ln]),q.useEffect(()=>{me(!0)},[]),q.useLayoutEffect(()=>{if(!te)return;let ae=st.current,Re=ae.style.height;ae.style.height="auto";let Se=ae.getBoundingClientRect().height;ae.style.height=Re,Ae(Se),w(_t=>_t.find(kt=>kt.toastId===f.id)?_t.map(kt=>kt.toastId===f.id?{...kt,height:Se}:kt):[{toastId:f.id,height:Se,position:f.position},..._t])},[te,f.title,f.description,w,f.id]);let Mn=q.useCallback(()=>{ye(!0),Z(Ue.current),w(ae=>ae.filter(Re=>Re.toastId!==f.id)),setTimeout(()=>{k(f)},Lj)},[f,k,w,Ue]);q.useEffect(()=>{if(f.promise&&Ne==="loading"||f.duration===1/0||f.type==="loading")return;let ae,Re=Ts;return A||g||H&&wr?(()=>{if(Br.current{var Se;(Se=f.onAutoClose)==null||Se.call(f,f),Mn()},Re)),()=>clearTimeout(ae)},[A,g,G,f,Ts,Mn,f.promise,Ne,H,wr]),q.useEffect(()=>{let ae=st.current;if(ae){let Re=ae.getBoundingClientRect().height;return Ae(Re),w(Se=>[{toastId:f.id,height:Re,position:f.position},...Se]),()=>w(Se=>Se.filter(_t=>_t.toastId!==f.id))}},[w,f.id]),q.useEffect(()=>{f.delete&&Mn()},[Mn,f.delete]);function dl(){return B!=null&&B.loading?q.createElement("div",{className:"sonner-loader","data-visible":Ne==="loading"},B.loading):X?q.createElement("div",{className:"sonner-loader","data-visible":Ne==="loading"},X):q.createElement(yj,{visible:Ne==="loading"})}return q.createElement("li",{"aria-live":f.important?"assertive":"polite","aria-atomic":"true",role:"status",tabIndex:0,ref:st,className:Y(N,vr,M==null?void 0:M.toast,(e=f==null?void 0:f.classNames)==null?void 0:e.toast,M==null?void 0:M.default,M==null?void 0:M[Ne],(n=f==null?void 0:f.classNames)==null?void 0:n[Ne]),"data-sonner-toast":"","data-rich-colors":(r=f.richColors)!=null?r:L,"data-styled":!(f.jsx||f.unstyled||p),"data-mounted":te,"data-promise":!!f.promise,"data-removed":Oe,"data-visible":cn,"data-y-position":dn,"data-x-position":Li,"data-index":x,"data-front":tn,"data-swiping":Pe,"data-dismissible":Ct,"data-type":Ne,"data-invert":bs,"data-swipe-out":mt,"data-expanded":!!(A||G&&te),style:{"--index":x,"--toasts-before":x,"--z-index":T.length-x,"--offset":`${Oe?Te:Ue.current}px`,"--initial-height":G?"auto":`${ge}px`,...S,...f.style},onPointerDown:ae=>{zr||!Ct||(Ke.current=new Date,Z(Ue.current),ae.target.setPointerCapture(ae.pointerId),ae.target.tagName!=="BUTTON"&&(Ve(!0),xn.current={x:ae.clientX,y:ae.clientY}))},onPointerUp:()=>{var ae,Re,Se,_t;if(mt||!Ct)return;xn.current=null;let kt=Number(((ae=st.current)==null?void 0:ae.style.getPropertyValue("--swipe-amount").replace("px",""))||0),xr=new Date().getTime()-((Re=Ke.current)==null?void 0:Re.getTime()),Vn=Math.abs(kt)/xr;if(Math.abs(kt)>=Oj||Vn>.11){Z(Ue.current),(Se=f.onDismiss)==null||Se.call(f,f),Mn(),je(!0);return}(_t=st.current)==null||_t.style.setProperty("--swipe-amount","0px"),Ve(!1)},onPointerMove:ae=>{var Re;if(!xn.current||!Ct)return;let Se=ae.clientY-xn.current.y,_t=ae.clientX-xn.current.x,kt=(dn==="top"?Math.min:Math.max)(0,Se),xr=ae.pointerType==="touch"?10:2;Math.abs(kt)>xr?(Re=st.current)==null||Re.style.setProperty("--swipe-amount",`${Se}px`):Math.abs(_t)>xr&&(xn.current=null)}},Es&&!f.jsx?q.createElement("button",{"aria-label":Q,"data-disabled":zr,"data-close-button":!0,onClick:zr||!Ct?()=>{}:()=>{var ae;Mn(),(ae=f.onDismiss)==null||ae.call(f,f)},className:Y(M==null?void 0:M.closeButton,(s=f==null?void 0:f.classNames)==null?void 0:s.closeButton)},q.createElement("svg",{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"},q.createElement("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),q.createElement("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))):null,f.jsx||q.isValidElement(f.title)?f.jsx||f.title:q.createElement(q.Fragment,null,Ne||f.icon||f.promise?q.createElement("div",{"data-icon":"",className:Y(M==null?void 0:M.icon,(i=f==null?void 0:f.classNames)==null?void 0:i.icon)},f.promise||f.type==="loading"&&!f.icon?f.icon||dl():null,f.type!=="loading"?f.icon||(B==null?void 0:B[Ne])||mj(Ne):null):null,q.createElement("div",{"data-content":"",className:Y(M==null?void 0:M.content,(o=f==null?void 0:f.classNames)==null?void 0:o.content)},q.createElement("div",{"data-title":"",className:Y(M==null?void 0:M.title,(a=f==null?void 0:f.classNames)==null?void 0:a.title)},f.title),f.description?q.createElement("div",{"data-description":"",className:Y(O,Oi,M==null?void 0:M.description,(l=f==null?void 0:f.classNames)==null?void 0:l.description)},f.description):null),q.isValidElement(f.cancel)?f.cancel:f.cancel&&vd(f.cancel)?q.createElement("button",{"data-button":!0,"data-cancel":!0,style:f.cancelButtonStyle||I,onClick:ae=>{var Re,Se;vd(f.cancel)&&Ct&&((Se=(Re=f.cancel).onClick)==null||Se.call(Re,ae),Mn())},className:Y(M==null?void 0:M.cancelButton,(u=f==null?void 0:f.classNames)==null?void 0:u.cancelButton)},f.cancel.label):null,q.isValidElement(f.action)?f.action:f.action&&vd(f.action)?q.createElement("button",{"data-button":!0,"data-action":!0,style:f.actionButtonStyle||P,onClick:ae=>{var Re,Se;vd(f.action)&&(ae.defaultPrevented||((Se=(Re=f.action).onClick)==null||Se.call(Re,ae),Mn()))},className:Y(M==null?void 0:M.actionButton,(d=f==null?void 0:f.classNames)==null?void 0:d.actionButton)},f.action.label):null))};function pE(){if(typeof window>"u"||typeof document>"u")return"ltr";let t=document.documentElement.getAttribute("dir");return t==="auto"||!t?window.getComputedStyle(document.documentElement).direction:t}var jj=t=>{let{invert:e,position:n="bottom-right",hotkey:r=["altKey","KeyT"],expand:s,closeButton:i,className:o,offset:a,theme:l="light",richColors:u,duration:d,style:h,visibleToasts:f=Aj,toastOptions:p,dir:g=pE(),gap:w=Dj,loadingIcon:_,icons:v,containerAriaLabel:x="Notifications",pauseWhenPageIsHidden:T,cn:A=Mj}=t,[k,L]=q.useState([]),C=q.useMemo(()=>Array.from(new Set([n].concat(k.filter(H=>H.position).map(H=>H.position)))),[k,n]),[S,I]=q.useState([]),[P,N]=q.useState(!1),[O,D]=q.useState(!1),[z,re]=q.useState(l!=="system"?l:typeof window<"u"&&window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"),X=q.useRef(null),G=r.join("+").replace(/Key/g,"").replace(/Digit/g,""),M=q.useRef(null),B=q.useRef(!1),Q=q.useCallback(H=>{var Y;(Y=k.find(te=>te.id===H.id))!=null&&Y.delete||En.dismiss(H.id),L(te=>te.filter(({id:me})=>me!==H.id))},[k]);return q.useEffect(()=>En.subscribe(H=>{if(H.dismiss){L(Y=>Y.map(te=>te.id===H.id?{...te,delete:!0}:te));return}setTimeout(()=>{RI.flushSync(()=>{L(Y=>{let te=Y.findIndex(me=>me.id===H.id);return te!==-1?[...Y.slice(0,te),{...Y[te],...H},...Y.slice(te+1)]:[H,...Y]})})})}),[]),q.useEffect(()=>{if(l!=="system"){re(l);return}l==="system"&&(window.matchMedia&&window.matchMedia("(prefers-color-scheme: dark)").matches?re("dark"):re("light")),typeof window<"u"&&window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change",({matches:H})=>{re(H?"dark":"light")})},[l]),q.useEffect(()=>{k.length<=1&&N(!1)},[k]),q.useEffect(()=>{let H=Y=>{var te,me;r.every(Oe=>Y[Oe]||Y.code===Oe)&&(N(!0),(te=X.current)==null||te.focus()),Y.code==="Escape"&&(document.activeElement===X.current||(me=X.current)!=null&&me.contains(document.activeElement))&&N(!1)};return document.addEventListener("keydown",H),()=>document.removeEventListener("keydown",H)},[r]),q.useEffect(()=>{if(X.current)return()=>{M.current&&(M.current.focus({preventScroll:!0}),M.current=null,B.current=!1)}},[X.current]),k.length?q.createElement("section",{"aria-label":`${x} ${G}`,tabIndex:-1},C.map((H,Y)=>{var te;let[me,Oe]=H.split("-");return q.createElement("ol",{key:H,dir:g==="auto"?pE():g,tabIndex:-1,ref:X,className:o,"data-sonner-toaster":!0,"data-theme":z,"data-y-position":me,"data-x-position":Oe,style:{"--front-toast-height":`${((te=S[0])==null?void 0:te.height)||0}px`,"--offset":typeof a=="number"?`${a}px`:a||Rj,"--width":`${Nj}px`,"--gap":`${w}px`,...h},onBlur:ye=>{B.current&&!ye.currentTarget.contains(ye.relatedTarget)&&(B.current=!1,M.current&&(M.current.focus({preventScroll:!0}),M.current=null))},onFocus:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||B.current||(B.current=!0,M.current=ye.relatedTarget)},onMouseEnter:()=>N(!0),onMouseMove:()=>N(!0),onMouseLeave:()=>{O||N(!1)},onPointerDown:ye=>{ye.target instanceof HTMLElement&&ye.target.dataset.dismissible==="false"||D(!0)},onPointerUp:()=>D(!1)},k.filter(ye=>!ye.position&&Y===0||ye.position===H).map((ye,Pe)=>{var Ve,mt;return q.createElement(Vj,{key:ye.id,icons:v,index:Pe,toast:ye,defaultRichColors:u,duration:(Ve=p==null?void 0:p.duration)!=null?Ve:d,className:p==null?void 0:p.className,descriptionClassName:p==null?void 0:p.descriptionClassName,invert:e,visibleToasts:f,closeButton:(mt=p==null?void 0:p.closeButton)!=null?mt:i,interacting:O,position:H,style:p==null?void 0:p.style,unstyled:p==null?void 0:p.unstyled,classNames:p==null?void 0:p.classNames,cancelButtonStyle:p==null?void 0:p.cancelButtonStyle,actionButtonStyle:p==null?void 0:p.actionButtonStyle,removeToast:Q,toasts:k.filter(je=>je.position==ye.position),heights:S.filter(je=>je.position==ye.position),setHeights:I,expandByDefault:s,gap:w,loadingIcon:_,expanded:P,pauseWhenPageIsHidden:T,cn:A})}))})):null};const Fj=({...t})=>{const{theme:e="system"}=pj();return y.jsx(jj,{theme:e,className:"toaster group",toastOptions:{classNames:{toast:"group toast group-[.toaster]:bg-background group-[.toaster]:text-foreground group-[.toaster]:border-border group-[.toaster]:shadow-lg",description:"group-[.toast]:text-muted-foreground",actionButton:"group-[.toast]:bg-primary group-[.toast]:text-primary-foreground",cancelButton:"group-[.toast]:bg-muted group-[.toast]:text-muted-foreground"}},...t})},Uj=["top","right","bottom","left"],pi=Math.min,bn=Math.max,Dh=Math.round,wd=Math.floor,mi=t=>({x:t,y:t}),$j={left:"right",right:"left",bottom:"top",top:"bottom"},Bj={start:"end",end:"start"};function Qg(t,e,n){return bn(t,pi(e,n))}function ls(t,e){return typeof t=="function"?t(e):t}function us(t){return t.split("-")[0]}function Xa(t){return t.split("-")[1]}function f0(t){return t==="x"?"y":"x"}function p0(t){return t==="y"?"height":"width"}function gi(t){return["top","bottom"].includes(us(t))?"y":"x"}function m0(t){return f0(gi(t))}function zj(t,e,n){n===void 0&&(n=!1);const r=Xa(t),s=m0(t),i=p0(s);let o=s==="x"?r===(n?"end":"start")?"right":"left":r==="start"?"bottom":"top";return e.reference[i]>e.floating[i]&&(o=Oh(o)),[o,Oh(o)]}function Hj(t){const e=Oh(t);return[Yg(t),e,Yg(e)]}function Yg(t){return t.replace(/start|end/g,e=>Bj[e])}function Wj(t,e,n){const r=["left","right"],s=["right","left"],i=["top","bottom"],o=["bottom","top"];switch(t){case"top":case"bottom":return n?e?s:r:e?r:s;case"left":case"right":return e?i:o;default:return[]}}function qj(t,e,n,r){const s=Xa(t);let i=Wj(us(t),n==="start",r);return s&&(i=i.map(o=>o+"-"+s),e&&(i=i.concat(i.map(Yg)))),i}function Oh(t){return t.replace(/left|right|bottom|top/g,e=>$j[e])}function Kj(t){return{top:0,right:0,bottom:0,left:0,...t}}function SP(t){return typeof t!="number"?Kj(t):{top:t,right:t,bottom:t,left:t}}function Lh(t){const{x:e,y:n,width:r,height:s}=t;return{width:r,height:s,top:n,left:e,right:e+r,bottom:n+s,x:e,y:n}}function mE(t,e,n){let{reference:r,floating:s}=t;const i=gi(e),o=m0(e),a=p0(o),l=us(e),u=i==="y",d=r.x+r.width/2-s.width/2,h=r.y+r.height/2-s.height/2,f=r[a]/2-s[a]/2;let p;switch(l){case"top":p={x:d,y:r.y-s.height};break;case"bottom":p={x:d,y:r.y+r.height};break;case"right":p={x:r.x+r.width,y:h};break;case"left":p={x:r.x-s.width,y:h};break;default:p={x:r.x,y:r.y}}switch(Xa(e)){case"start":p[o]-=f*(n&&u?-1:1);break;case"end":p[o]+=f*(n&&u?-1:1);break}return p}const Gj=async(t,e,n)=>{const{placement:r="bottom",strategy:s="absolute",middleware:i=[],platform:o}=n,a=i.filter(Boolean),l=await(o.isRTL==null?void 0:o.isRTL(e));let u=await o.getElementRects({reference:t,floating:e,strategy:s}),{x:d,y:h}=mE(u,r,l),f=r,p={},g=0;for(let w=0;w({name:"arrow",options:t,async fn(e){const{x:n,y:r,placement:s,rects:i,platform:o,elements:a,middlewareData:l}=e,{element:u,padding:d=0}=ls(t,e)||{};if(u==null)return{};const h=SP(d),f={x:n,y:r},p=m0(s),g=p0(p),w=await o.getDimensions(u),_=p==="y",v=_?"top":"left",x=_?"bottom":"right",T=_?"clientHeight":"clientWidth",A=i.reference[g]+i.reference[p]-f[p]-i.floating[g],k=f[p]-i.reference[p],L=await(o.getOffsetParent==null?void 0:o.getOffsetParent(u));let C=L?L[T]:0;(!C||!await(o.isElement==null?void 0:o.isElement(L)))&&(C=a.floating[T]||i.floating[g]);const S=A/2-k/2,I=C/2-w[g]/2-1,P=pi(h[v],I),N=pi(h[x],I),O=P,D=C-w[g]-N,z=C/2-w[g]/2+S,re=Qg(O,z,D),X=!l.arrow&&Xa(s)!=null&&z!==re&&i.reference[g]/2-(zz<=0)){var N,O;const z=(((N=i.flip)==null?void 0:N.index)||0)+1,re=C[z];if(re)return{data:{index:z,overflows:P},reset:{placement:re}};let X=(O=P.filter(G=>G.overflows[0]<=0).sort((G,M)=>G.overflows[1]-M.overflows[1])[0])==null?void 0:O.placement;if(!X)switch(p){case"bestFit":{var D;const G=(D=P.filter(M=>{if(L){const B=gi(M.placement);return B===x||B==="y"}return!0}).map(M=>[M.placement,M.overflows.filter(B=>B>0).reduce((B,Q)=>B+Q,0)]).sort((M,B)=>M[1]-B[1])[0])==null?void 0:D[0];G&&(X=G);break}case"initialPlacement":X=a;break}if(s!==X)return{reset:{placement:X}}}return{}}}};function gE(t,e){return{top:t.top-e.height,right:t.right-e.width,bottom:t.bottom-e.height,left:t.left-e.width}}function yE(t){return Uj.some(e=>t[e]>=0)}const Xj=function(t){return t===void 0&&(t={}),{name:"hide",options:t,async fn(e){const{rects:n}=e,{strategy:r="referenceHidden",...s}=ls(t,e);switch(r){case"referenceHidden":{const i=await Mu(e,{...s,elementContext:"reference"}),o=gE(i,n.reference);return{data:{referenceHiddenOffsets:o,referenceHidden:yE(o)}}}case"escaped":{const i=await Mu(e,{...s,altBoundary:!0}),o=gE(i,n.floating);return{data:{escapedOffsets:o,escaped:yE(o)}}}default:return{}}}}};async function Jj(t,e){const{placement:n,platform:r,elements:s}=t,i=await(r.isRTL==null?void 0:r.isRTL(s.floating)),o=us(n),a=Xa(n),l=gi(n)==="y",u=["left","top"].includes(o)?-1:1,d=i&&l?-1:1,h=ls(e,t);let{mainAxis:f,crossAxis:p,alignmentAxis:g}=typeof h=="number"?{mainAxis:h,crossAxis:0,alignmentAxis:null}:{mainAxis:h.mainAxis||0,crossAxis:h.crossAxis||0,alignmentAxis:h.alignmentAxis};return a&&typeof g=="number"&&(p=a==="end"?g*-1:g),l?{x:p*d,y:f*u}:{x:f*u,y:p*d}}const Zj=function(t){return t===void 0&&(t=0),{name:"offset",options:t,async fn(e){var n,r;const{x:s,y:i,placement:o,middlewareData:a}=e,l=await Jj(e,t);return o===((n=a.offset)==null?void 0:n.placement)&&(r=a.arrow)!=null&&r.alignmentOffset?{}:{x:s+l.x,y:i+l.y,data:{...l,placement:o}}}}},e4=function(t){return t===void 0&&(t={}),{name:"shift",options:t,async fn(e){const{x:n,y:r,placement:s}=e,{mainAxis:i=!0,crossAxis:o=!1,limiter:a={fn:_=>{let{x:v,y:x}=_;return{x:v,y:x}}},...l}=ls(t,e),u={x:n,y:r},d=await Mu(e,l),h=gi(us(s)),f=f0(h);let p=u[f],g=u[h];if(i){const _=f==="y"?"top":"left",v=f==="y"?"bottom":"right",x=p+d[_],T=p-d[v];p=Qg(x,p,T)}if(o){const _=h==="y"?"top":"left",v=h==="y"?"bottom":"right",x=g+d[_],T=g-d[v];g=Qg(x,g,T)}const w=a.fn({...e,[f]:p,[h]:g});return{...w,data:{x:w.x-n,y:w.y-r,enabled:{[f]:i,[h]:o}}}}}},t4=function(t){return t===void 0&&(t={}),{options:t,fn(e){const{x:n,y:r,placement:s,rects:i,middlewareData:o}=e,{offset:a=0,mainAxis:l=!0,crossAxis:u=!0}=ls(t,e),d={x:n,y:r},h=gi(s),f=f0(h);let p=d[f],g=d[h];const w=ls(a,e),_=typeof w=="number"?{mainAxis:w,crossAxis:0}:{mainAxis:0,crossAxis:0,...w};if(l){const T=f==="y"?"height":"width",A=i.reference[f]-i.floating[T]+_.mainAxis,k=i.reference[f]+i.reference[T]-_.mainAxis;pk&&(p=k)}if(u){var v,x;const T=f==="y"?"width":"height",A=["top","left"].includes(us(s)),k=i.reference[h]-i.floating[T]+(A&&((v=o.offset)==null?void 0:v[h])||0)+(A?0:_.crossAxis),L=i.reference[h]+i.reference[T]+(A?0:((x=o.offset)==null?void 0:x[h])||0)-(A?_.crossAxis:0);gL&&(g=L)}return{[f]:p,[h]:g}}}},n4=function(t){return t===void 0&&(t={}),{name:"size",options:t,async fn(e){var n,r;const{placement:s,rects:i,platform:o,elements:a}=e,{apply:l=()=>{},...u}=ls(t,e),d=await Mu(e,u),h=us(s),f=Xa(s),p=gi(s)==="y",{width:g,height:w}=i.floating;let _,v;h==="top"||h==="bottom"?(_=h,v=f===(await(o.isRTL==null?void 0:o.isRTL(a.floating))?"start":"end")?"left":"right"):(v=h,_=f==="end"?"top":"bottom");const x=w-d.top-d.bottom,T=g-d.left-d.right,A=pi(w-d[_],x),k=pi(g-d[v],T),L=!e.middlewareData.shift;let C=A,S=k;if((n=e.middlewareData.shift)!=null&&n.enabled.x&&(S=T),(r=e.middlewareData.shift)!=null&&r.enabled.y&&(C=x),L&&!f){const P=bn(d.left,0),N=bn(d.right,0),O=bn(d.top,0),D=bn(d.bottom,0);p?S=g-2*(P!==0||N!==0?P+N:bn(d.left,d.right)):C=w-2*(O!==0||D!==0?O+D:bn(d.top,d.bottom))}await l({...e,availableWidth:S,availableHeight:C});const I=await o.getDimensions(a.floating);return g!==I.width||w!==I.height?{reset:{rects:!0}}:{}}}};function Bf(){return typeof window<"u"}function Ja(t){return CP(t)?(t.nodeName||"").toLowerCase():"#document"}function An(t){var e;return(t==null||(e=t.ownerDocument)==null?void 0:e.defaultView)||window}function Ur(t){var e;return(e=(CP(t)?t.ownerDocument:t.document)||window.document)==null?void 0:e.documentElement}function CP(t){return Bf()?t instanceof Node||t instanceof An(t).Node:!1}function mr(t){return Bf()?t instanceof Element||t instanceof An(t).Element:!1}function jr(t){return Bf()?t instanceof HTMLElement||t instanceof An(t).HTMLElement:!1}function vE(t){return!Bf()||typeof ShadowRoot>"u"?!1:t instanceof ShadowRoot||t instanceof An(t).ShadowRoot}function gc(t){const{overflow:e,overflowX:n,overflowY:r,display:s}=gr(t);return/auto|scroll|overlay|hidden|clip/.test(e+r+n)&&!["inline","contents"].includes(s)}function r4(t){return["table","td","th"].includes(Ja(t))}function zf(t){return[":popover-open",":modal"].some(e=>{try{return t.matches(e)}catch{return!1}})}function g0(t){const e=y0(),n=mr(t)?gr(t):t;return n.transform!=="none"||n.perspective!=="none"||(n.containerType?n.containerType!=="normal":!1)||!e&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!e&&(n.filter?n.filter!=="none":!1)||["transform","perspective","filter"].some(r=>(n.willChange||"").includes(r))||["paint","layout","strict","content"].some(r=>(n.contain||"").includes(r))}function s4(t){let e=yi(t);for(;jr(e)&&!Da(e);){if(g0(e))return e;if(zf(e))return null;e=yi(e)}return null}function y0(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function Da(t){return["html","body","#document"].includes(Ja(t))}function gr(t){return An(t).getComputedStyle(t)}function Hf(t){return mr(t)?{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}:{scrollLeft:t.scrollX,scrollTop:t.scrollY}}function yi(t){if(Ja(t)==="html")return t;const e=t.assignedSlot||t.parentNode||vE(t)&&t.host||Ur(t);return vE(e)?e.host:e}function IP(t){const e=yi(t);return Da(e)?t.ownerDocument?t.ownerDocument.body:t.body:jr(e)&&gc(e)?e:IP(e)}function Vu(t,e,n){var r;e===void 0&&(e=[]),n===void 0&&(n=!0);const s=IP(t),i=s===((r=t.ownerDocument)==null?void 0:r.body),o=An(s);if(i){const a=Xg(o);return e.concat(o,o.visualViewport||[],gc(s)?s:[],a&&n?Vu(a):[])}return e.concat(s,Vu(s,[],n))}function Xg(t){return t.parent&&Object.getPrototypeOf(t.parent)?t.frameElement:null}function PP(t){const e=gr(t);let n=parseFloat(e.width)||0,r=parseFloat(e.height)||0;const s=jr(t),i=s?t.offsetWidth:n,o=s?t.offsetHeight:r,a=Dh(n)!==i||Dh(r)!==o;return a&&(n=i,r=o),{width:n,height:r,$:a}}function v0(t){return mr(t)?t:t.contextElement}function ha(t){const e=v0(t);if(!jr(e))return mi(1);const n=e.getBoundingClientRect(),{width:r,height:s,$:i}=PP(e);let o=(i?Dh(n.width):n.width)/r,a=(i?Dh(n.height):n.height)/s;return(!o||!Number.isFinite(o))&&(o=1),(!a||!Number.isFinite(a))&&(a=1),{x:o,y:a}}const i4=mi(0);function AP(t){const e=An(t);return!y0()||!e.visualViewport?i4:{x:e.visualViewport.offsetLeft,y:e.visualViewport.offsetTop}}function o4(t,e,n){return e===void 0&&(e=!1),!n||e&&n!==An(t)?!1:e}function yo(t,e,n,r){e===void 0&&(e=!1),n===void 0&&(n=!1);const s=t.getBoundingClientRect(),i=v0(t);let o=mi(1);e&&(r?mr(r)&&(o=ha(r)):o=ha(t));const a=o4(i,n,r)?AP(i):mi(0);let l=(s.left+a.x)/o.x,u=(s.top+a.y)/o.y,d=s.width/o.x,h=s.height/o.y;if(i){const f=An(i),p=r&&mr(r)?An(r):r;let g=f,w=Xg(g);for(;w&&r&&p!==g;){const _=ha(w),v=w.getBoundingClientRect(),x=gr(w),T=v.left+(w.clientLeft+parseFloat(x.paddingLeft))*_.x,A=v.top+(w.clientTop+parseFloat(x.paddingTop))*_.y;l*=_.x,u*=_.y,d*=_.x,h*=_.y,l+=T,u+=A,g=An(w),w=Xg(g)}}return Lh({width:d,height:h,x:l,y:u})}function a4(t){let{elements:e,rect:n,offsetParent:r,strategy:s}=t;const i=s==="fixed",o=Ur(r),a=e?zf(e.floating):!1;if(r===o||a&&i)return n;let l={scrollLeft:0,scrollTop:0},u=mi(1);const d=mi(0),h=jr(r);if((h||!h&&!i)&&((Ja(r)!=="body"||gc(o))&&(l=Hf(r)),jr(r))){const f=yo(r);u=ha(r),d.x=f.x+r.clientLeft,d.y=f.y+r.clientTop}return{width:n.width*u.x,height:n.height*u.y,x:n.x*u.x-l.scrollLeft*u.x+d.x,y:n.y*u.y-l.scrollTop*u.y+d.y}}function l4(t){return Array.from(t.getClientRects())}function Jg(t,e){const n=Hf(t).scrollLeft;return e?e.left+n:yo(Ur(t)).left+n}function u4(t){const e=Ur(t),n=Hf(t),r=t.ownerDocument.body,s=bn(e.scrollWidth,e.clientWidth,r.scrollWidth,r.clientWidth),i=bn(e.scrollHeight,e.clientHeight,r.scrollHeight,r.clientHeight);let o=-n.scrollLeft+Jg(t);const a=-n.scrollTop;return gr(r).direction==="rtl"&&(o+=bn(e.clientWidth,r.clientWidth)-s),{width:s,height:i,x:o,y:a}}function c4(t,e){const n=An(t),r=Ur(t),s=n.visualViewport;let i=r.clientWidth,o=r.clientHeight,a=0,l=0;if(s){i=s.width,o=s.height;const u=y0();(!u||u&&e==="fixed")&&(a=s.offsetLeft,l=s.offsetTop)}return{width:i,height:o,x:a,y:l}}function d4(t,e){const n=yo(t,!0,e==="fixed"),r=n.top+t.clientTop,s=n.left+t.clientLeft,i=jr(t)?ha(t):mi(1),o=t.clientWidth*i.x,a=t.clientHeight*i.y,l=s*i.x,u=r*i.y;return{width:o,height:a,x:l,y:u}}function wE(t,e,n){let r;if(e==="viewport")r=c4(t,n);else if(e==="document")r=u4(Ur(t));else if(mr(e))r=d4(e,n);else{const s=AP(t);r={...e,x:e.x-s.x,y:e.y-s.y}}return Lh(r)}function RP(t,e){const n=yi(t);return n===e||!mr(n)||Da(n)?!1:gr(n).position==="fixed"||RP(n,e)}function h4(t,e){const n=e.get(t);if(n)return n;let r=Vu(t,[],!1).filter(a=>mr(a)&&Ja(a)!=="body"),s=null;const i=gr(t).position==="fixed";let o=i?yi(t):t;for(;mr(o)&&!Da(o);){const a=gr(o),l=g0(o);!l&&a.position==="fixed"&&(s=null),(i?!l&&!s:!l&&a.position==="static"&&!!s&&["absolute","fixed"].includes(s.position)||gc(o)&&!l&&RP(t,o))?r=r.filter(d=>d!==o):s=a,o=yi(o)}return e.set(t,r),r}function f4(t){let{element:e,boundary:n,rootBoundary:r,strategy:s}=t;const o=[...n==="clippingAncestors"?zf(e)?[]:h4(e,this._c):[].concat(n),r],a=o[0],l=o.reduce((u,d)=>{const h=wE(e,d,s);return u.top=bn(h.top,u.top),u.right=pi(h.right,u.right),u.bottom=pi(h.bottom,u.bottom),u.left=bn(h.left,u.left),u},wE(e,a,s));return{width:l.right-l.left,height:l.bottom-l.top,x:l.left,y:l.top}}function p4(t){const{width:e,height:n}=PP(t);return{width:e,height:n}}function m4(t,e,n){const r=jr(e),s=Ur(e),i=n==="fixed",o=yo(t,!0,i,e);let a={scrollLeft:0,scrollTop:0};const l=mi(0);if(r||!r&&!i)if((Ja(e)!=="body"||gc(s))&&(a=Hf(e)),r){const p=yo(e,!0,i,e);l.x=p.x+e.clientLeft,l.y=p.y+e.clientTop}else s&&(l.x=Jg(s));let u=0,d=0;if(s&&!r&&!i){const p=s.getBoundingClientRect();d=p.top+a.scrollTop,u=p.left+a.scrollLeft-Jg(s,p)}const h=o.left+a.scrollLeft-l.x-u,f=o.top+a.scrollTop-l.y-d;return{x:h,y:f,width:o.width,height:o.height}}function vm(t){return gr(t).position==="static"}function xE(t,e){if(!jr(t)||gr(t).position==="fixed")return null;if(e)return e(t);let n=t.offsetParent;return Ur(t)===n&&(n=n.ownerDocument.body),n}function kP(t,e){const n=An(t);if(zf(t))return n;if(!jr(t)){let s=yi(t);for(;s&&!Da(s);){if(mr(s)&&!vm(s))return s;s=yi(s)}return n}let r=xE(t,e);for(;r&&r4(r)&&vm(r);)r=xE(r,e);return r&&Da(r)&&vm(r)&&!g0(r)?n:r||s4(t)||n}const g4=async function(t){const e=this.getOffsetParent||kP,n=this.getDimensions,r=await n(t.floating);return{reference:m4(t.reference,await e(t.floating),t.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}};function y4(t){return gr(t).direction==="rtl"}const v4={convertOffsetParentRelativeRectToViewportRelativeRect:a4,getDocumentElement:Ur,getClippingRect:f4,getOffsetParent:kP,getElementRects:g4,getClientRects:l4,getDimensions:p4,getScale:ha,isElement:mr,isRTL:y4};function w4(t,e){let n=null,r;const s=Ur(t);function i(){var a;clearTimeout(r),(a=n)==null||a.disconnect(),n=null}function o(a,l){a===void 0&&(a=!1),l===void 0&&(l=1),i();const{left:u,top:d,width:h,height:f}=t.getBoundingClientRect();if(a||e(),!h||!f)return;const p=wd(d),g=wd(s.clientWidth-(u+h)),w=wd(s.clientHeight-(d+f)),_=wd(u),x={rootMargin:-p+"px "+-g+"px "+-w+"px "+-_+"px",threshold:bn(0,pi(1,l))||1};let T=!0;function A(k){const L=k[0].intersectionRatio;if(L!==l){if(!T)return o();L?o(!1,L):r=setTimeout(()=>{o(!1,1e-7)},1e3)}T=!1}try{n=new IntersectionObserver(A,{...x,root:s.ownerDocument})}catch{n=new IntersectionObserver(A,x)}n.observe(t)}return o(!0),i}function x4(t,e,n,r){r===void 0&&(r={});const{ancestorScroll:s=!0,ancestorResize:i=!0,elementResize:o=typeof ResizeObserver=="function",layoutShift:a=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,u=v0(t),d=s||i?[...u?Vu(u):[],...Vu(e)]:[];d.forEach(v=>{s&&v.addEventListener("scroll",n,{passive:!0}),i&&v.addEventListener("resize",n)});const h=u&&a?w4(u,n):null;let f=-1,p=null;o&&(p=new ResizeObserver(v=>{let[x]=v;x&&x.target===u&&p&&(p.unobserve(e),cancelAnimationFrame(f),f=requestAnimationFrame(()=>{var T;(T=p)==null||T.observe(e)})),n()}),u&&!l&&p.observe(u),p.observe(e));let g,w=l?yo(t):null;l&&_();function _(){const v=yo(t);w&&(v.x!==w.x||v.y!==w.y||v.width!==w.width||v.height!==w.height)&&n(),w=v,g=requestAnimationFrame(_)}return n(),()=>{var v;d.forEach(x=>{s&&x.removeEventListener("scroll",n),i&&x.removeEventListener("resize",n)}),h==null||h(),(v=p)==null||v.disconnect(),p=null,l&&cancelAnimationFrame(g)}}const _4=Zj,E4=e4,T4=Yj,b4=n4,S4=Xj,_E=Qj,C4=t4,I4=(t,e,n)=>{const r=new Map,s={platform:v4,...n},i={...s.platform,_c:r};return Gj(t,e,{...s,platform:i})};var Gd=typeof document<"u"?b.useLayoutEffect:b.useEffect;function Mh(t,e){if(t===e)return!0;if(typeof t!=typeof e)return!1;if(typeof t=="function"&&t.toString()===e.toString())return!0;let n,r,s;if(t&&e&&typeof t=="object"){if(Array.isArray(t)){if(n=t.length,n!==e.length)return!1;for(r=n;r--!==0;)if(!Mh(t[r],e[r]))return!1;return!0}if(s=Object.keys(t),n=s.length,n!==Object.keys(e).length)return!1;for(r=n;r--!==0;)if(!{}.hasOwnProperty.call(e,s[r]))return!1;for(r=n;r--!==0;){const i=s[r];if(!(i==="_owner"&&t.$$typeof)&&!Mh(t[i],e[i]))return!1}return!0}return t!==t&&e!==e}function NP(t){return typeof window>"u"?1:(t.ownerDocument.defaultView||window).devicePixelRatio||1}function EE(t,e){const n=NP(t);return Math.round(e*n)/n}function wm(t){const e=b.useRef(t);return Gd(()=>{e.current=t}),e}function P4(t){t===void 0&&(t={});const{placement:e="bottom",strategy:n="absolute",middleware:r=[],platform:s,elements:{reference:i,floating:o}={},transform:a=!0,whileElementsMounted:l,open:u}=t,[d,h]=b.useState({x:0,y:0,strategy:n,placement:e,middlewareData:{},isPositioned:!1}),[f,p]=b.useState(r);Mh(f,r)||p(r);const[g,w]=b.useState(null),[_,v]=b.useState(null),x=b.useCallback(M=>{M!==L.current&&(L.current=M,w(M))},[]),T=b.useCallback(M=>{M!==C.current&&(C.current=M,v(M))},[]),A=i||g,k=o||_,L=b.useRef(null),C=b.useRef(null),S=b.useRef(d),I=l!=null,P=wm(l),N=wm(s),O=wm(u),D=b.useCallback(()=>{if(!L.current||!C.current)return;const M={placement:e,strategy:n,middleware:f};N.current&&(M.platform=N.current),I4(L.current,C.current,M).then(B=>{const Q={...B,isPositioned:O.current!==!1};z.current&&!Mh(S.current,Q)&&(S.current=Q,mc.flushSync(()=>{h(Q)}))})},[f,e,n,N,O]);Gd(()=>{u===!1&&S.current.isPositioned&&(S.current.isPositioned=!1,h(M=>({...M,isPositioned:!1})))},[u]);const z=b.useRef(!1);Gd(()=>(z.current=!0,()=>{z.current=!1}),[]),Gd(()=>{if(A&&(L.current=A),k&&(C.current=k),A&&k){if(P.current)return P.current(A,k,D);D()}},[A,k,D,P,I]);const re=b.useMemo(()=>({reference:L,floating:C,setReference:x,setFloating:T}),[x,T]),X=b.useMemo(()=>({reference:A,floating:k}),[A,k]),G=b.useMemo(()=>{const M={position:n,left:0,top:0};if(!X.floating)return M;const B=EE(X.floating,d.x),Q=EE(X.floating,d.y);return a?{...M,transform:"translate("+B+"px, "+Q+"px)",...NP(X.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:B,top:Q}},[n,a,X.floating,d.x,d.y]);return b.useMemo(()=>({...d,update:D,refs:re,elements:X,floatingStyles:G}),[d,D,re,X,G])}const A4=t=>{function e(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:t,fn(n){const{element:r,padding:s}=typeof t=="function"?t(n):t;return r&&e(r)?r.current!=null?_E({element:r.current,padding:s}).fn(n):{}:r?_E({element:r,padding:s}).fn(n):{}}}},R4=(t,e)=>({..._4(t),options:[t,e]}),k4=(t,e)=>({...E4(t),options:[t,e]}),N4=(t,e)=>({...C4(t),options:[t,e]}),D4=(t,e)=>({...T4(t),options:[t,e]}),O4=(t,e)=>({...b4(t),options:[t,e]}),L4=(t,e)=>({...S4(t),options:[t,e]}),M4=(t,e)=>({...A4(t),options:[t,e]});var V4="Arrow",DP=b.forwardRef((t,e)=>{const{children:n,width:r=10,height:s=5,...i}=t;return y.jsx(Ut.svg,{...i,ref:e,width:r,height:s,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:t.asChild?n:y.jsx("polygon",{points:"0,0 30,0 15,10"})})});DP.displayName=V4;var j4=DP;function F4(t,e=[]){let n=[];function r(i,o){const a=b.createContext(o),l=n.length;n=[...n,o];function u(h){const{scope:f,children:p,...g}=h,w=(f==null?void 0:f[t][l])||a,_=b.useMemo(()=>g,Object.values(g));return y.jsx(w.Provider,{value:_,children:p})}function d(h,f){const p=(f==null?void 0:f[t][l])||a,g=b.useContext(p);if(g)return g;if(o!==void 0)return o;throw new Error(`\`${h}\` must be used within \`${i}\``)}return u.displayName=i+"Provider",[u,d]}const s=()=>{const i=n.map(o=>b.createContext(o));return function(a){const l=(a==null?void 0:a[t])||i;return b.useMemo(()=>({[`__scope${t}`]:{...a,[t]:l}}),[a,l])}};return s.scopeName=t,[r,U4(s,...e)]}function U4(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(s=>({useScope:s(),scopeName:s.scopeName}));return function(i){const o=r.reduce((a,{useScope:l,scopeName:u})=>{const h=l(i)[`__scope${u}`];return{...a,...h}},{});return b.useMemo(()=>({[`__scope${e.scopeName}`]:o}),[o])}};return n.scopeName=e.scopeName,n}function OP(t){const[e,n]=b.useState(void 0);return go(()=>{if(t){n({width:t.offsetWidth,height:t.offsetHeight});const r=new ResizeObserver(s=>{if(!Array.isArray(s)||!s.length)return;const i=s[0];let o,a;if("borderBoxSize"in i){const l=i.borderBoxSize,u=Array.isArray(l)?l[0]:l;o=u.inlineSize,a=u.blockSize}else o=t.offsetWidth,a=t.offsetHeight;n({width:o,height:a})});return r.observe(t,{box:"border-box"}),()=>r.unobserve(t)}else n(void 0)},[t]),e}var LP="Popper",[MP,VP]=F4(LP),[CY,jP]=MP(LP),FP="PopperAnchor",UP=b.forwardRef((t,e)=>{const{__scopePopper:n,virtualRef:r,...s}=t,i=jP(FP,n),o=b.useRef(null),a=Yn(e,o);return b.useEffect(()=>{i.onAnchorChange((r==null?void 0:r.current)||o.current)}),r?null:y.jsx(Ut.div,{...s,ref:a})});UP.displayName=FP;var w0="PopperContent",[$4,B4]=MP(w0),$P=b.forwardRef((t,e)=>{var Pe,Ve,mt,je,Te,Z;const{__scopePopper:n,side:r="bottom",sideOffset:s=0,align:i="center",alignOffset:o=0,arrowPadding:a=0,avoidCollisions:l=!0,collisionBoundary:u=[],collisionPadding:d=0,sticky:h="partial",hideWhenDetached:f=!1,updatePositionStrategy:p="optimized",onPlaced:g,...w}=t,_=jP(w0,n),[v,x]=b.useState(null),T=Yn(e,ge=>x(ge)),[A,k]=b.useState(null),L=OP(A),C=(L==null?void 0:L.width)??0,S=(L==null?void 0:L.height)??0,I=r+(i!=="center"?"-"+i:""),P=typeof d=="number"?d:{top:0,right:0,bottom:0,left:0,...d},N=Array.isArray(u)?u:[u],O=N.length>0,D={padding:P,boundary:N.filter(H4),altBoundary:O},{refs:z,floatingStyles:re,placement:X,isPositioned:G,middlewareData:M}=P4({strategy:"fixed",placement:I,whileElementsMounted:(...ge)=>x4(...ge,{animationFrame:p==="always"}),elements:{reference:_.anchor},middleware:[R4({mainAxis:s+S,alignmentAxis:o}),l&&k4({mainAxis:!0,crossAxis:!1,limiter:h==="partial"?N4():void 0,...D}),l&&D4({...D}),O4({...D,apply:({elements:ge,rects:Ae,availableWidth:Ke,availableHeight:st})=>{const{width:tn,height:cn}=Ae.reference,Ne=ge.floating.style;Ne.setProperty("--radix-popper-available-width",`${Ke}px`),Ne.setProperty("--radix-popper-available-height",`${st}px`),Ne.setProperty("--radix-popper-anchor-width",`${tn}px`),Ne.setProperty("--radix-popper-anchor-height",`${cn}px`)}}),A&&M4({element:A,padding:a}),W4({arrowWidth:C,arrowHeight:S}),f&&L4({strategy:"referenceHidden",...D})]}),[B,Q]=HP(X),H=Vr(g);go(()=>{G&&(H==null||H())},[G,H]);const Y=(Pe=M.arrow)==null?void 0:Pe.x,te=(Ve=M.arrow)==null?void 0:Ve.y,me=((mt=M.arrow)==null?void 0:mt.centerOffset)!==0,[Oe,ye]=b.useState();return go(()=>{v&&ye(window.getComputedStyle(v).zIndex)},[v]),y.jsx("div",{ref:z.setFloating,"data-radix-popper-content-wrapper":"",style:{...re,transform:G?re.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Oe,"--radix-popper-transform-origin":[(je=M.transformOrigin)==null?void 0:je.x,(Te=M.transformOrigin)==null?void 0:Te.y].join(" "),...((Z=M.hide)==null?void 0:Z.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:t.dir,children:y.jsx($4,{scope:n,placedSide:B,onArrowChange:k,arrowX:Y,arrowY:te,shouldHideArrow:me,children:y.jsx(Ut.div,{"data-side":B,"data-align":Q,...w,ref:T,style:{...w.style,animation:G?void 0:"none"}})})})});$P.displayName=w0;var BP="PopperArrow",z4={top:"bottom",right:"left",bottom:"top",left:"right"},zP=b.forwardRef(function(e,n){const{__scopePopper:r,...s}=e,i=B4(BP,r),o=z4[i.placedSide];return y.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[o]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:y.jsx(j4,{...s,ref:n,style:{...s.style,display:"block"}})})});zP.displayName=BP;function H4(t){return t!==null}var W4=t=>({name:"transformOrigin",options:t,fn(e){var _,v,x;const{placement:n,rects:r,middlewareData:s}=e,o=((_=s.arrow)==null?void 0:_.centerOffset)!==0,a=o?0:t.arrowWidth,l=o?0:t.arrowHeight,[u,d]=HP(n),h={start:"0%",center:"50%",end:"100%"}[d],f=(((v=s.arrow)==null?void 0:v.x)??0)+a/2,p=(((x=s.arrow)==null?void 0:x.y)??0)+l/2;let g="",w="";return u==="bottom"?(g=o?h:`${f}px`,w=`${-l}px`):u==="top"?(g=o?h:`${f}px`,w=`${r.floating.height+l}px`):u==="right"?(g=`${-l}px`,w=o?h:`${p}px`):u==="left"&&(g=`${r.floating.width+l}px`,w=o?h:`${p}px`),{data:{x:g,y:w}}}});function HP(t){const[e,n="center"]=t.split("-");return[e,n]}var q4=UP,K4=$P,G4=zP,[Wf]=i0("Tooltip",[VP]),x0=VP(),WP="TooltipProvider",Q4=700,TE="tooltip.open",[Y4,qP]=Wf(WP),KP=t=>{const{__scopeTooltip:e,delayDuration:n=Q4,skipDelayDuration:r=300,disableHoverableContent:s=!1,children:i}=t,[o,a]=b.useState(!0),l=b.useRef(!1),u=b.useRef(0);return b.useEffect(()=>{const d=u.current;return()=>window.clearTimeout(d)},[]),y.jsx(Y4,{scope:e,isOpenDelayed:o,delayDuration:n,onOpen:b.useCallback(()=>{window.clearTimeout(u.current),a(!1)},[]),onClose:b.useCallback(()=>{window.clearTimeout(u.current),u.current=window.setTimeout(()=>a(!0),r)},[r]),isPointerInTransitRef:l,onPointerInTransitChange:b.useCallback(d=>{l.current=d},[]),disableHoverableContent:s,children:i})};KP.displayName=WP;var GP="Tooltip",[IY,qf]=Wf(GP),Zg="TooltipTrigger",X4=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=qf(Zg,n),i=qP(Zg,n),o=x0(n),a=b.useRef(null),l=Yn(e,a,s.onTriggerChange),u=b.useRef(!1),d=b.useRef(!1),h=b.useCallback(()=>u.current=!1,[]);return b.useEffect(()=>()=>document.removeEventListener("pointerup",h),[h]),y.jsx(q4,{asChild:!0,...o,children:y.jsx(Ut.button,{"aria-describedby":s.open?s.contentId:void 0,"data-state":s.stateAttribute,...r,ref:l,onPointerMove:ft(t.onPointerMove,f=>{f.pointerType!=="touch"&&!d.current&&!i.isPointerInTransitRef.current&&(s.onTriggerEnter(),d.current=!0)}),onPointerLeave:ft(t.onPointerLeave,()=>{s.onTriggerLeave(),d.current=!1}),onPointerDown:ft(t.onPointerDown,()=>{u.current=!0,document.addEventListener("pointerup",h,{once:!0})}),onFocus:ft(t.onFocus,()=>{u.current||s.onOpen()}),onBlur:ft(t.onBlur,s.onClose),onClick:ft(t.onClick,s.onClose)})})});X4.displayName=Zg;var J4="TooltipPortal",[PY,Z4]=Wf(J4,{forceMount:void 0}),Oa="TooltipContent",QP=b.forwardRef((t,e)=>{const n=Z4(Oa,t.__scopeTooltip),{forceMount:r=n.forceMount,side:s="top",...i}=t,o=qf(Oa,t.__scopeTooltip);return y.jsx(Vf,{present:r||o.open,children:o.disableHoverableContent?y.jsx(YP,{side:s,...i,ref:e}):y.jsx(eF,{side:s,...i,ref:e})})}),eF=b.forwardRef((t,e)=>{const n=qf(Oa,t.__scopeTooltip),r=qP(Oa,t.__scopeTooltip),s=b.useRef(null),i=Yn(e,s),[o,a]=b.useState(null),{trigger:l,onClose:u}=n,d=s.current,{onPointerInTransitChange:h}=r,f=b.useCallback(()=>{a(null),h(!1)},[h]),p=b.useCallback((g,w)=>{const _=g.currentTarget,v={x:g.clientX,y:g.clientY},x=sF(v,_.getBoundingClientRect()),T=iF(v,x),A=oF(w.getBoundingClientRect()),k=lF([...T,...A]);a(k),h(!0)},[h]);return b.useEffect(()=>()=>f(),[f]),b.useEffect(()=>{if(l&&d){const g=_=>p(_,d),w=_=>p(_,l);return l.addEventListener("pointerleave",g),d.addEventListener("pointerleave",w),()=>{l.removeEventListener("pointerleave",g),d.removeEventListener("pointerleave",w)}}},[l,d,p,f]),b.useEffect(()=>{if(o){const g=w=>{const _=w.target,v={x:w.clientX,y:w.clientY},x=(l==null?void 0:l.contains(_))||(d==null?void 0:d.contains(_)),T=!aF(v,o);x?f():T&&(f(),u())};return document.addEventListener("pointermove",g),()=>document.removeEventListener("pointermove",g)}},[l,d,o,u,f]),y.jsx(YP,{...t,ref:i})}),[tF,nF]=Wf(GP,{isInside:!1}),YP=b.forwardRef((t,e)=>{const{__scopeTooltip:n,children:r,"aria-label":s,onEscapeKeyDown:i,onPointerDownOutside:o,...a}=t,l=qf(Oa,n),u=x0(n),{onClose:d}=l;return b.useEffect(()=>(document.addEventListener(TE,d),()=>document.removeEventListener(TE,d)),[d]),b.useEffect(()=>{if(l.trigger){const h=f=>{const p=f.target;p!=null&&p.contains(l.trigger)&&d()};return window.addEventListener("scroll",h,{capture:!0}),()=>window.removeEventListener("scroll",h,{capture:!0})}},[l.trigger,d]),y.jsx(o0,{asChild:!0,disableOutsidePointerEvents:!1,onEscapeKeyDown:i,onPointerDownOutside:o,onFocusOutside:h=>h.preventDefault(),onDismiss:d,children:y.jsxs(K4,{"data-state":l.stateAttribute,...u,...a,ref:e,style:{...a.style,"--radix-tooltip-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-tooltip-content-available-width":"var(--radix-popper-available-width)","--radix-tooltip-content-available-height":"var(--radix-popper-available-height)","--radix-tooltip-trigger-width":"var(--radix-popper-anchor-width)","--radix-tooltip-trigger-height":"var(--radix-popper-anchor-height)"},children:[y.jsx(jI,{children:r}),y.jsx(tF,{scope:n,isInside:!0,children:y.jsx($M,{id:l.contentId,role:"tooltip",children:s||r})})]})})});QP.displayName=Oa;var XP="TooltipArrow",rF=b.forwardRef((t,e)=>{const{__scopeTooltip:n,...r}=t,s=x0(n);return nF(XP,n).isInside?null:y.jsx(G4,{...s,...r,ref:e})});rF.displayName=XP;function sF(t,e){const n=Math.abs(e.top-t.y),r=Math.abs(e.bottom-t.y),s=Math.abs(e.right-t.x),i=Math.abs(e.left-t.x);switch(Math.min(n,r,s,i)){case i:return"left";case s:return"right";case n:return"top";case r:return"bottom";default:throw new Error("unreachable")}}function iF(t,e,n=5){const r=[];switch(e){case"top":r.push({x:t.x-n,y:t.y+n},{x:t.x+n,y:t.y+n});break;case"bottom":r.push({x:t.x-n,y:t.y-n},{x:t.x+n,y:t.y-n});break;case"left":r.push({x:t.x+n,y:t.y-n},{x:t.x+n,y:t.y+n});break;case"right":r.push({x:t.x-n,y:t.y-n},{x:t.x-n,y:t.y+n});break}return r}function oF(t){const{top:e,right:n,bottom:r,left:s}=t;return[{x:s,y:e},{x:n,y:e},{x:n,y:r},{x:s,y:r}]}function aF(t,e){const{x:n,y:r}=t;let s=!1;for(let i=0,o=e.length-1;ir!=d>r&&n<(u-a)*(r-l)/(d-l)+a&&(s=!s)}return s}function lF(t){const e=t.slice();return e.sort((n,r)=>n.xr.x?1:n.yr.y?1:0),uF(e)}function uF(t){if(t.length<=1)return t.slice();const e=[];for(let r=0;r=2;){const i=e[e.length-1],o=e[e.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))e.pop();else break}e.push(s)}e.pop();const n=[];for(let r=t.length-1;r>=0;r--){const s=t[r];for(;n.length>=2;){const i=n[n.length-1],o=n[n.length-2];if((i.x-o.x)*(s.y-o.y)>=(i.y-o.y)*(s.x-o.x))n.pop();else break}n.push(s)}return n.pop(),e.length===1&&n.length===1&&e[0].x===n[0].x&&e[0].y===n[0].y?e:e.concat(n)}var cF=KP,JP=QP;const dF=cF,hF=b.forwardRef(({className:t,sideOffset:e=4,...n},r)=>y.jsx(JP,{ref:r,sideOffset:e,className:Ye("z-50 overflow-hidden rounded-md border bg-popover px-3 py-1.5 text-sm text-popover-foreground shadow-md animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2",t),...n}));hF.displayName=JP.displayName;var Kf=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fF={setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),setInterval:(t,e)=>setInterval(t,e),clearInterval:t=>clearInterval(t)},$s,uv,lS,pF=(lS=class{constructor(){_e(this,$s,fF);_e(this,uv,!1)}setTimeoutProvider(t){ue(this,$s,t)}setTimeout(t,e){return F(this,$s).setTimeout(t,e)}clearTimeout(t){F(this,$s).clearTimeout(t)}setInterval(t,e){return F(this,$s).setInterval(t,e)}clearInterval(t){F(this,$s).clearInterval(t)}},$s=new WeakMap,uv=new WeakMap,lS),ey=new pF;function mF(t){setTimeout(t,0)}var Gf=typeof window>"u"||"Deno"in globalThis;function rr(){}function gF(t,e){return typeof t=="function"?t(e):t}function yF(t){return typeof t=="number"&&t>=0&&t!==1/0}function vF(t,e){return Math.max(t+(e||0)-Date.now(),0)}function ty(t,e){return typeof t=="function"?t(e):t}function wF(t,e){return typeof t=="function"?t(e):t}function bE(t,e){const{type:n="all",exact:r,fetchStatus:s,predicate:i,queryKey:o,stale:a}=t;if(o){if(r){if(e.queryHash!==_0(o,e.options))return!1}else if(!Fu(e.queryKey,o))return!1}if(n!=="all"){const l=e.isActive();if(n==="active"&&!l||n==="inactive"&&l)return!1}return!(typeof a=="boolean"&&e.isStale()!==a||s&&s!==e.state.fetchStatus||i&&!i(e))}function SE(t,e){const{exact:n,status:r,predicate:s,mutationKey:i}=t;if(i){if(!e.options.mutationKey)return!1;if(n){if(ju(e.options.mutationKey)!==ju(i))return!1}else if(!Fu(e.options.mutationKey,i))return!1}return!(r&&e.state.status!==r||s&&!s(e))}function _0(t,e){return((e==null?void 0:e.queryKeyHashFn)||ju)(t)}function ju(t){return JSON.stringify(t,(e,n)=>ny(n)?Object.keys(n).sort().reduce((r,s)=>(r[s]=n[s],r),{}):n)}function Fu(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?Object.keys(e).every(n=>Fu(t[n],e[n])):!1}var xF=Object.prototype.hasOwnProperty;function ZP(t,e,n=0){if(t===e)return t;if(n>500)return e;const r=CE(t)&&CE(e);if(!r&&!(ny(t)&&ny(e)))return e;const i=(r?t:Object.keys(t)).length,o=r?e:Object.keys(e),a=o.length,l=r?new Array(a):{};let u=0;for(let d=0;d{ey.setTimeout(e,t)})}function EF(t,e,n){return typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?ZP(t,e):e}function TF(t,e,n=0){const r=[...t,e];return n&&r.length>n?r.slice(1):r}function bF(t,e,n=0){const r=[e,...t];return n&&r.length>n?r.slice(0,-1):r}var E0=Symbol();function eA(t,e){return!t.queryFn&&(e!=null&&e.initialPromise)?()=>e.initialPromise:!t.queryFn||t.queryFn===E0?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function SF(t,e,n){let r=!1,s;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(s??(s=e()),r||(r=!0,s.aborted?n():s.addEventListener("abort",n,{once:!0})),s)}),t}var Ji,Bs,va,uS,CF=(uS=class extends Kf{constructor(){super();_e(this,Ji);_e(this,Bs);_e(this,va);ue(this,va,e=>{if(!Gf&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){F(this,Bs)||this.setEventListener(F(this,va))}onUnsubscribe(){var e;this.hasListeners()||((e=F(this,Bs))==null||e.call(this),ue(this,Bs,void 0))}setEventListener(e){var n;ue(this,va,e),(n=F(this,Bs))==null||n.call(this),ue(this,Bs,e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(e){F(this,Ji)!==e&&(ue(this,Ji,e),this.onFocus())}onFocus(){const e=this.isFocused();this.listeners.forEach(n=>{n(e)})}isFocused(){var e;return typeof F(this,Ji)=="boolean"?F(this,Ji):((e=globalThis.document)==null?void 0:e.visibilityState)!=="hidden"}},Ji=new WeakMap,Bs=new WeakMap,va=new WeakMap,uS),tA=new CF;function IF(){let t,e;const n=new Promise((s,i)=>{t=s,e=i});n.status="pending",n.catch(()=>{});function r(s){Object.assign(n,s),delete n.resolve,delete n.reject}return n.resolve=s=>{r({status:"fulfilled",value:s}),t(s)},n.reject=s=>{r({status:"rejected",reason:s}),e(s)},n}var PF=mF;function AF(){let t=[],e=0,n=a=>{a()},r=a=>{a()},s=PF;const i=a=>{e?t.push(a):s(()=>{n(a)})},o=()=>{const a=t;t=[],a.length&&s(()=>{r(()=>{a.forEach(l=>{n(l)})})})};return{batch:a=>{let l;e++;try{l=a()}finally{e--,e||o()}return l},batchCalls:a=>(...l)=>{i(()=>{a(...l)})},schedule:i,setNotifyFunction:a=>{n=a},setBatchNotifyFunction:a=>{r=a},setScheduler:a=>{s=a}}}var sn=AF(),wa,zs,xa,cS,RF=(cS=class extends Kf{constructor(){super();_e(this,wa,!0);_e(this,zs);_e(this,xa);ue(this,xa,e=>{if(!Gf&&window.addEventListener){const n=()=>e(!0),r=()=>e(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){F(this,zs)||this.setEventListener(F(this,xa))}onUnsubscribe(){var e;this.hasListeners()||((e=F(this,zs))==null||e.call(this),ue(this,zs,void 0))}setEventListener(e){var n;ue(this,xa,e),(n=F(this,zs))==null||n.call(this),ue(this,zs,e(this.setOnline.bind(this)))}setOnline(e){F(this,wa)!==e&&(ue(this,wa,e),this.listeners.forEach(r=>{r(e)}))}isOnline(){return F(this,wa)}},wa=new WeakMap,zs=new WeakMap,xa=new WeakMap,cS),Vh=new RF;function kF(t){return Math.min(1e3*2**t,3e4)}function nA(t){return(t??"online")==="online"?Vh.isOnline():!0}var ry=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function rA(t){let e=!1,n=0,r;const s=IF(),i=()=>s.status!=="pending",o=w=>{var _;if(!i()){const v=new ry(w);f(v),(_=t.onCancel)==null||_.call(t,v)}},a=()=>{e=!0},l=()=>{e=!1},u=()=>tA.isFocused()&&(t.networkMode==="always"||Vh.isOnline())&&t.canRun(),d=()=>nA(t.networkMode)&&t.canRun(),h=w=>{i()||(r==null||r(),s.resolve(w))},f=w=>{i()||(r==null||r(),s.reject(w))},p=()=>new Promise(w=>{var _;r=v=>{(i()||u())&&w(v)},(_=t.onPause)==null||_.call(t)}).then(()=>{var w;r=void 0,i()||(w=t.onContinue)==null||w.call(t)}),g=()=>{if(i())return;let w;const _=n===0?t.initialPromise:void 0;try{w=_??t.fn()}catch(v){w=Promise.reject(v)}Promise.resolve(w).then(h).catch(v=>{var L;if(i())return;const x=t.retry??(Gf?0:3),T=t.retryDelay??kF,A=typeof T=="function"?T(n,v):T,k=x===!0||typeof x=="number"&&nu()?void 0:p()).then(()=>{e?f(v):g()})})};return{promise:s,status:()=>s.status,cancel:o,continue:()=>(r==null||r(),s),cancelRetry:a,continueRetry:l,canStart:d,start:()=>(d()?g():p().then(g),s)}}var Zi,dS,sA=(dS=class{constructor(){_e(this,Zi)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),yF(this.gcTime)&&ue(this,Zi,ey.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(Gf?1/0:5*60*1e3))}clearGcTimeout(){F(this,Zi)&&(ey.clearTimeout(F(this,Zi)),ue(this,Zi,void 0))}},Zi=new WeakMap,dS),eo,_a,$n,to,It,ac,no,sr,Kr,hS,NF=(hS=class extends sA{constructor(n){super();_e(this,sr);_e(this,eo);_e(this,_a);_e(this,$n);_e(this,to);_e(this,It);_e(this,ac);_e(this,no);ue(this,no,!1),ue(this,ac,n.defaultOptions),this.setOptions(n.options),this.observers=[],ue(this,to,n.client),ue(this,$n,F(this,to).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,ue(this,eo,AE(this.options)),this.state=n.state??F(this,eo),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var n;return(n=F(this,It))==null?void 0:n.promise}setOptions(n){if(this.options={...F(this,ac),...n},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const r=AE(this.options);r.data!==void 0&&(this.setState(PE(r.data,r.dataUpdatedAt)),ue(this,eo,r))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&F(this,$n).remove(this)}setData(n,r){const s=EF(this.state.data,n,this.options);return zt(this,sr,Kr).call(this,{data:s,type:"success",dataUpdatedAt:r==null?void 0:r.updatedAt,manual:r==null?void 0:r.manual}),s}setState(n,r){zt(this,sr,Kr).call(this,{type:"setState",state:n,setStateOptions:r})}cancel(n){var s,i;const r=(s=F(this,It))==null?void 0:s.promise;return(i=F(this,It))==null||i.cancel(n),r?r.then(rr).catch(rr):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(F(this,eo))}isActive(){return this.observers.some(n=>wF(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===E0||this.state.dataUpdateCount+this.state.errorUpdateCount===0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>ty(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!vF(this.state.dataUpdatedAt,n)}onFocus(){var r;const n=this.observers.find(s=>s.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(r=F(this,It))==null||r.continue()}onOnline(){var r;const n=this.observers.find(s=>s.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(r=F(this,It))==null||r.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),F(this,$n).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(r=>r!==n),this.observers.length||(F(this,It)&&(F(this,no)?F(this,It).cancel({revert:!0}):F(this,It).cancelRetry()),this.scheduleGc()),F(this,$n).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||zt(this,sr,Kr).call(this,{type:"invalidate"})}async fetch(n,r){var u,d,h,f,p,g,w,_,v,x,T,A;if(this.state.fetchStatus!=="idle"&&((u=F(this,It))==null?void 0:u.status())!=="rejected"){if(this.state.data!==void 0&&(r!=null&&r.cancelRefetch))this.cancel({silent:!0});else if(F(this,It))return F(this,It).continueRetry(),F(this,It).promise}if(n&&this.setOptions(n),!this.options.queryFn){const k=this.observers.find(L=>L.options.queryFn);k&&this.setOptions(k.options)}const s=new AbortController,i=k=>{Object.defineProperty(k,"signal",{enumerable:!0,get:()=>(ue(this,no,!0),s.signal)})},o=()=>{const k=eA(this.options,r),C=(()=>{const S={client:F(this,to),queryKey:this.queryKey,meta:this.meta};return i(S),S})();return ue(this,no,!1),this.options.persister?this.options.persister(k,C,this):k(C)},l=(()=>{const k={fetchOptions:r,options:this.options,queryKey:this.queryKey,client:F(this,to),state:this.state,fetchFn:o};return i(k),k})();(d=this.options.behavior)==null||d.onFetch(l,this),ue(this,_a,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((h=l.fetchOptions)==null?void 0:h.meta))&&zt(this,sr,Kr).call(this,{type:"fetch",meta:(f=l.fetchOptions)==null?void 0:f.meta}),ue(this,It,rA({initialPromise:r==null?void 0:r.initialPromise,fn:l.fetchFn,onCancel:k=>{k instanceof ry&&k.revert&&this.setState({...F(this,_a),fetchStatus:"idle"}),s.abort()},onFail:(k,L)=>{zt(this,sr,Kr).call(this,{type:"failed",failureCount:k,error:L})},onPause:()=>{zt(this,sr,Kr).call(this,{type:"pause"})},onContinue:()=>{zt(this,sr,Kr).call(this,{type:"continue"})},retry:l.options.retry,retryDelay:l.options.retryDelay,networkMode:l.options.networkMode,canRun:()=>!0}));try{const k=await F(this,It).start();if(k===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(k),(g=(p=F(this,$n).config).onSuccess)==null||g.call(p,k,this),(_=(w=F(this,$n).config).onSettled)==null||_.call(w,k,this.state.error,this),k}catch(k){if(k instanceof ry){if(k.silent)return F(this,It).promise;if(k.revert){if(this.state.data===void 0)throw k;return this.state.data}}throw zt(this,sr,Kr).call(this,{type:"error",error:k}),(x=(v=F(this,$n).config).onError)==null||x.call(v,k,this),(A=(T=F(this,$n).config).onSettled)==null||A.call(T,this.state.data,k,this),k}finally{this.scheduleGc()}}},eo=new WeakMap,_a=new WeakMap,$n=new WeakMap,to=new WeakMap,It=new WeakMap,ac=new WeakMap,no=new WeakMap,sr=new WeakSet,Kr=function(n){const r=s=>{switch(n.type){case"failed":return{...s,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...s,fetchStatus:"paused"};case"continue":return{...s,fetchStatus:"fetching"};case"fetch":return{...s,...DF(s.data,this.options),fetchMeta:n.meta??null};case"success":const i={...s,...PE(n.data,n.dataUpdatedAt),dataUpdateCount:s.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return ue(this,_a,n.manual?i:void 0),i;case"error":const o=n.error;return{...s,error:o,errorUpdateCount:s.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:s.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...s,isInvalidated:!0};case"setState":return{...s,...n.state}}};this.state=r(this.state),sn.batch(()=>{this.observers.forEach(s=>{s.onQueryUpdate()}),F(this,$n).notify({query:this,type:"updated",action:n})})},hS);function DF(t,e){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:nA(e.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function PE(t,e){return{data:t,dataUpdatedAt:e??Date.now(),error:null,isInvalidated:!1,status:"success"}}function AE(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=e!==void 0,r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"pending",fetchStatus:"idle"}}function RE(t){return{onFetch:(e,n)=>{var d,h,f,p,g;const r=e.options,s=(f=(h=(d=e.fetchOptions)==null?void 0:d.meta)==null?void 0:h.fetchMore)==null?void 0:f.direction,i=((p=e.state.data)==null?void 0:p.pages)||[],o=((g=e.state.data)==null?void 0:g.pageParams)||[];let a={pages:[],pageParams:[]},l=0;const u=async()=>{let w=!1;const _=T=>{SF(T,()=>e.signal,()=>w=!0)},v=eA(e.options,e.fetchOptions),x=async(T,A,k)=>{if(w)return Promise.reject();if(A==null&&T.pages.length)return Promise.resolve(T);const C=(()=>{const N={client:e.client,queryKey:e.queryKey,pageParam:A,direction:k?"backward":"forward",meta:e.options.meta};return _(N),N})(),S=await v(C),{maxPages:I}=e.options,P=k?bF:TF;return{pages:P(T.pages,S,I),pageParams:P(T.pageParams,A,I)}};if(s&&i.length){const T=s==="backward",A=T?OF:kE,k={pages:i,pageParams:o},L=A(r,k);a=await x(k,L,T)}else{const T=t??i.length;do{const A=l===0?o[0]??r.initialPageParam:kE(r,a);if(l>0&&A==null)break;a=await x(a,A),l++}while(l{var w,_;return(_=(w=e.options).persister)==null?void 0:_.call(w,u,{client:e.client,queryKey:e.queryKey,meta:e.options.meta,signal:e.signal},n)}:e.fetchFn=u}}}function kE(t,{pages:e,pageParams:n}){const r=e.length-1;return e.length>0?t.getNextPageParam(e[r],e,n[r],n):void 0}function OF(t,{pages:e,pageParams:n}){var r;return e.length>0?(r=t.getPreviousPageParam)==null?void 0:r.call(t,e[0],e,n[0],n):void 0}var lc,Sr,Kt,ro,Cr,Ns,fS,LF=(fS=class extends sA{constructor(n){super();_e(this,Cr);_e(this,lc);_e(this,Sr);_e(this,Kt);_e(this,ro);ue(this,lc,n.client),this.mutationId=n.mutationId,ue(this,Kt,n.mutationCache),ue(this,Sr,[]),this.state=n.state||MF(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){F(this,Sr).includes(n)||(F(this,Sr).push(n),this.clearGcTimeout(),F(this,Kt).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){ue(this,Sr,F(this,Sr).filter(r=>r!==n)),this.scheduleGc(),F(this,Kt).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){F(this,Sr).length||(this.state.status==="pending"?this.scheduleGc():F(this,Kt).remove(this))}continue(){var n;return((n=F(this,ro))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var a,l,u,d,h,f,p,g,w,_,v,x,T,A,k,L,C,S;const r=()=>{zt(this,Cr,Ns).call(this,{type:"continue"})},s={client:F(this,lc),meta:this.options.meta,mutationKey:this.options.mutationKey};ue(this,ro,rA({fn:()=>this.options.mutationFn?this.options.mutationFn(n,s):Promise.reject(new Error("No mutationFn found")),onFail:(I,P)=>{zt(this,Cr,Ns).call(this,{type:"failed",failureCount:I,error:P})},onPause:()=>{zt(this,Cr,Ns).call(this,{type:"pause"})},onContinue:r,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>F(this,Kt).canRun(this)}));const i=this.state.status==="pending",o=!F(this,ro).canStart();try{if(i)r();else{zt(this,Cr,Ns).call(this,{type:"pending",variables:n,isPaused:o}),F(this,Kt).config.onMutate&&await F(this,Kt).config.onMutate(n,this,s);const P=await((l=(a=this.options).onMutate)==null?void 0:l.call(a,n,s));P!==this.state.context&&zt(this,Cr,Ns).call(this,{type:"pending",context:P,variables:n,isPaused:o})}const I=await F(this,ro).start();return await((d=(u=F(this,Kt).config).onSuccess)==null?void 0:d.call(u,I,n,this.state.context,this,s)),await((f=(h=this.options).onSuccess)==null?void 0:f.call(h,I,n,this.state.context,s)),await((g=(p=F(this,Kt).config).onSettled)==null?void 0:g.call(p,I,null,this.state.variables,this.state.context,this,s)),await((_=(w=this.options).onSettled)==null?void 0:_.call(w,I,null,n,this.state.context,s)),zt(this,Cr,Ns).call(this,{type:"success",data:I}),I}catch(I){try{await((x=(v=F(this,Kt).config).onError)==null?void 0:x.call(v,I,n,this.state.context,this,s))}catch(P){Promise.reject(P)}try{await((A=(T=this.options).onError)==null?void 0:A.call(T,I,n,this.state.context,s))}catch(P){Promise.reject(P)}try{await((L=(k=F(this,Kt).config).onSettled)==null?void 0:L.call(k,void 0,I,this.state.variables,this.state.context,this,s))}catch(P){Promise.reject(P)}try{await((S=(C=this.options).onSettled)==null?void 0:S.call(C,void 0,I,n,this.state.context,s))}catch(P){Promise.reject(P)}throw zt(this,Cr,Ns).call(this,{type:"error",error:I}),I}finally{F(this,Kt).runNext(this)}}},lc=new WeakMap,Sr=new WeakMap,Kt=new WeakMap,ro=new WeakMap,Cr=new WeakSet,Ns=function(n){const r=s=>{switch(n.type){case"failed":return{...s,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...s,isPaused:!0};case"continue":return{...s,isPaused:!1};case"pending":return{...s,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...s,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...s,data:void 0,error:n.error,failureCount:s.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=r(this.state),sn.batch(()=>{F(this,Sr).forEach(s=>{s.onMutationUpdate(n)}),F(this,Kt).notify({mutation:this,type:"updated",action:n})})},fS);function MF(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Yr,ir,uc,pS,VF=(pS=class extends Kf{constructor(e={}){super();_e(this,Yr);_e(this,ir);_e(this,uc);this.config=e,ue(this,Yr,new Set),ue(this,ir,new Map),ue(this,uc,0)}build(e,n,r){const s=new LF({client:e,mutationCache:this,mutationId:++Xc(this,uc)._,options:e.defaultMutationOptions(n),state:r});return this.add(s),s}add(e){F(this,Yr).add(e);const n=xd(e);if(typeof n=="string"){const r=F(this,ir).get(n);r?r.push(e):F(this,ir).set(n,[e])}this.notify({type:"added",mutation:e})}remove(e){if(F(this,Yr).delete(e)){const n=xd(e);if(typeof n=="string"){const r=F(this,ir).get(n);if(r)if(r.length>1){const s=r.indexOf(e);s!==-1&&r.splice(s,1)}else r[0]===e&&F(this,ir).delete(n)}}this.notify({type:"removed",mutation:e})}canRun(e){const n=xd(e);if(typeof n=="string"){const r=F(this,ir).get(n),s=r==null?void 0:r.find(i=>i.state.status==="pending");return!s||s===e}else return!0}runNext(e){var r;const n=xd(e);if(typeof n=="string"){const s=(r=F(this,ir).get(n))==null?void 0:r.find(i=>i!==e&&i.state.isPaused);return(s==null?void 0:s.continue())??Promise.resolve()}else return Promise.resolve()}clear(){sn.batch(()=>{F(this,Yr).forEach(e=>{this.notify({type:"removed",mutation:e})}),F(this,Yr).clear(),F(this,ir).clear()})}getAll(){return Array.from(F(this,Yr))}find(e){const n={exact:!0,...e};return this.getAll().find(r=>SE(n,r))}findAll(e={}){return this.getAll().filter(n=>SE(e,n))}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}resumePausedMutations(){const e=this.getAll().filter(n=>n.state.isPaused);return sn.batch(()=>Promise.all(e.map(n=>n.continue().catch(rr))))}},Yr=new WeakMap,ir=new WeakMap,uc=new WeakMap,pS);function xd(t){var e;return(e=t.options.scope)==null?void 0:e.id}var Ir,mS,jF=(mS=class extends Kf{constructor(e={}){super();_e(this,Ir);this.config=e,ue(this,Ir,new Map)}build(e,n,r){const s=n.queryKey,i=n.queryHash??_0(s,n);let o=this.get(i);return o||(o=new NF({client:e,queryKey:s,queryHash:i,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(o)),o}add(e){F(this,Ir).has(e.queryHash)||(F(this,Ir).set(e.queryHash,e),this.notify({type:"added",query:e}))}remove(e){const n=F(this,Ir).get(e.queryHash);n&&(e.destroy(),n===e&&F(this,Ir).delete(e.queryHash),this.notify({type:"removed",query:e}))}clear(){sn.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return F(this,Ir).get(e)}getAll(){return[...F(this,Ir).values()]}find(e){const n={exact:!0,...e};return this.getAll().find(r=>bE(n,r))}findAll(e={}){const n=this.getAll();return Object.keys(e).length>0?n.filter(r=>bE(e,r)):n}notify(e){sn.batch(()=>{this.listeners.forEach(n=>{n(e)})})}onFocus(){sn.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){sn.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Ir=new WeakMap,mS),at,Hs,Ws,Ea,Ta,qs,ba,Sa,gS,FF=(gS=class{constructor(t={}){_e(this,at);_e(this,Hs);_e(this,Ws);_e(this,Ea);_e(this,Ta);_e(this,qs);_e(this,ba);_e(this,Sa);ue(this,at,t.queryCache||new jF),ue(this,Hs,t.mutationCache||new VF),ue(this,Ws,t.defaultOptions||{}),ue(this,Ea,new Map),ue(this,Ta,new Map),ue(this,qs,0)}mount(){Xc(this,qs)._++,F(this,qs)===1&&(ue(this,ba,tA.subscribe(async t=>{t&&(await this.resumePausedMutations(),F(this,at).onFocus())})),ue(this,Sa,Vh.subscribe(async t=>{t&&(await this.resumePausedMutations(),F(this,at).onOnline())})))}unmount(){var t,e;Xc(this,qs)._--,F(this,qs)===0&&((t=F(this,ba))==null||t.call(this),ue(this,ba,void 0),(e=F(this,Sa))==null||e.call(this),ue(this,Sa,void 0))}isFetching(t){return F(this,at).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return F(this,Hs).findAll({...t,status:"pending"}).length}getQueryData(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=F(this,at).get(e.queryHash))==null?void 0:n.state.data}ensureQueryData(t){const e=this.defaultQueryOptions(t),n=F(this,at).build(this,e),r=n.state.data;return r===void 0?this.fetchQuery(t):(t.revalidateIfStale&&n.isStaleByTime(ty(e.staleTime,n))&&this.prefetchQuery(e),Promise.resolve(r))}getQueriesData(t){return F(this,at).findAll(t).map(({queryKey:e,state:n})=>{const r=n.data;return[e,r]})}setQueryData(t,e,n){const r=this.defaultQueryOptions({queryKey:t}),s=F(this,at).get(r.queryHash),i=s==null?void 0:s.state.data,o=gF(e,i);if(o!==void 0)return F(this,at).build(this,r).setData(o,{...n,manual:!0})}setQueriesData(t,e,n){return sn.batch(()=>F(this,at).findAll(t).map(({queryKey:r})=>[r,this.setQueryData(r,e,n)]))}getQueryState(t){var n;const e=this.defaultQueryOptions({queryKey:t});return(n=F(this,at).get(e.queryHash))==null?void 0:n.state}removeQueries(t){const e=F(this,at);sn.batch(()=>{e.findAll(t).forEach(n=>{e.remove(n)})})}resetQueries(t,e){const n=F(this,at);return sn.batch(()=>(n.findAll(t).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...t},e)))}cancelQueries(t,e={}){const n={revert:!0,...e},r=sn.batch(()=>F(this,at).findAll(t).map(s=>s.cancel(n)));return Promise.all(r).then(rr).catch(rr)}invalidateQueries(t,e={}){return sn.batch(()=>(F(this,at).findAll(t).forEach(n=>{n.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},e)))}refetchQueries(t,e={}){const n={...e,cancelRefetch:e.cancelRefetch??!0},r=sn.batch(()=>F(this,at).findAll(t).filter(s=>!s.isDisabled()&&!s.isStatic()).map(s=>{let i=s.fetch(void 0,n);return n.throwOnError||(i=i.catch(rr)),s.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(r).then(rr)}fetchQuery(t){const e=this.defaultQueryOptions(t);e.retry===void 0&&(e.retry=!1);const n=F(this,at).build(this,e);return n.isStaleByTime(ty(e.staleTime,n))?n.fetch(e):Promise.resolve(n.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(rr).catch(rr)}fetchInfiniteQuery(t){return t.behavior=RE(t.pages),this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(rr).catch(rr)}ensureInfiniteQueryData(t){return t.behavior=RE(t.pages),this.ensureQueryData(t)}resumePausedMutations(){return Vh.isOnline()?F(this,Hs).resumePausedMutations():Promise.resolve()}getQueryCache(){return F(this,at)}getMutationCache(){return F(this,Hs)}getDefaultOptions(){return F(this,Ws)}setDefaultOptions(t){ue(this,Ws,t)}setQueryDefaults(t,e){F(this,Ea).set(ju(t),{queryKey:t,defaultOptions:e})}getQueryDefaults(t){const e=[...F(this,Ea).values()],n={};return e.forEach(r=>{Fu(t,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(t,e){F(this,Ta).set(ju(t),{mutationKey:t,defaultOptions:e})}getMutationDefaults(t){const e=[...F(this,Ta).values()],n={};return e.forEach(r=>{Fu(t,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(t){if(t._defaulted)return t;const e={...F(this,Ws).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return e.queryHash||(e.queryHash=_0(e.queryKey,e)),e.refetchOnReconnect===void 0&&(e.refetchOnReconnect=e.networkMode!=="always"),e.throwOnError===void 0&&(e.throwOnError=!!e.suspense),!e.networkMode&&e.persister&&(e.networkMode="offlineFirst"),e.queryFn===E0&&(e.enabled=!1),e}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...F(this,Ws).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){F(this,at).clear(),F(this,Hs).clear()}},at=new WeakMap,Hs=new WeakMap,Ws=new WeakMap,Ea=new WeakMap,Ta=new WeakMap,qs=new WeakMap,ba=new WeakMap,Sa=new WeakMap,gS),UF=b.createContext(void 0),$F=({client:t,children:e})=>(b.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),y.jsx(UF.Provider,{value:t,children:e})),BF=function(){return null};/** * @remix-run/router v1.20.0 * * 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 Uu(){return Uu=Object.assign?Object.assign.bind():function(t){for(var e=1;e"u")throw new Error(e)}function iA(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function HF(){return Math.random().toString(36).substr(2,8)}function DE(t,e){return{usr:t.state,key:t.key,idx:e}}function sy(t,e,n,r){return n===void 0&&(n=null),Uu({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Za(e):e,{state:n,key:e&&e.key||r||HF()})}function jh(t){let{pathname:e="/",search:n="",hash:r=""}=t;return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),r&&r!=="#"&&(e+=r.charAt(0)==="#"?r:"#"+r),e}function Za(t){let e={};if(t){let n=t.indexOf("#");n>=0&&(e.hash=t.substr(n),t=t.substr(0,n));let r=t.indexOf("?");r>=0&&(e.search=t.substr(r),t=t.substr(0,r)),t&&(e.pathname=t)}return e}function WF(t,e,n,r){r===void 0&&(r={});let{window:s=document.defaultView,v5Compat:i=!1}=r,o=s.history,a=Qs.Pop,l=null,u=d();u==null&&(u=0,o.replaceState(Uu({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){a=Qs.Pop;let _=d(),v=_==null?null:_-u;u=_,l&&l({action:a,location:w.location,delta:v})}function f(_,v){a=Qs.Push;let x=sy(w.location,_,v);u=d()+1;let T=DE(x,u),A=w.createHref(x);try{o.pushState(T,"",A)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(A)}i&&l&&l({action:a,location:w.location,delta:1})}function p(_,v){a=Qs.Replace;let x=sy(w.location,_,v);u=d();let T=DE(x,u),A=w.createHref(x);o.replaceState(T,"",A),i&&l&&l({action:a,location:w.location,delta:0})}function g(_){let v=s.location.origin!=="null"?s.location.origin:s.location.href,x=typeof _=="string"?_:jh(_);return x=x.replace(/ $/,"%20"),tt(v,"No window.location.(origin|href) available to create URL for href: "+x),new URL(x,v)}let w={get action(){return a},get location(){return t(s,o)},listen(_){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(NE,h),l=_,()=>{s.removeEventListener(NE,h),l=null}},createHref(_){return e(s,_)},createURL:g,encodeLocation(_){let v=g(_);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:f,replace:p,go(_){return o.go(_)}};return w}var OE;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(OE||(OE={}));function qF(t,e,n){return n===void 0&&(n="/"),KF(t,e,n)}function KF(t,e,n,r){let s=typeof e=="string"?Za(e):e,i=La(s.pathname||"/",n);if(i==null)return null;let o=oA(t);GF(o);let a=null;for(let l=0;a==null&&l{let l={relativePath:a===void 0?i.path||"":a,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};l.relativePath.startsWith("/")&&(tt(l.relativePath.startsWith(r),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+r+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(r.length));let u=ii([r,l.relativePath]),d=n.concat(l);i.children&&i.children.length>0&&(tt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),oA(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:t3(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var a;if(i.path===""||!((a=i.path)!=null&&a.includes("?")))s(i,o);else for(let l of aA(i.path))s(i,o,l)}),e}function aA(t){let e=t.split("/");if(e.length===0)return[];let[n,...r]=e,s=n.endsWith("?"),i=n.replace(/\?$/,"");if(r.length===0)return s?[i,""]:[i];let o=aA(r.join("/")),a=[];return a.push(...o.map(l=>l===""?i:[i,l].join("/"))),s&&a.push(...o),a.map(l=>t.startsWith("/")&&l===""?"/":l)}function GF(t){t.sort((e,n)=>e.score!==n.score?n.score-e.score:n3(e.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}const QF=/^:[\w-]+$/,YF=3,XF=2,JF=1,ZF=10,e3=-2,LE=t=>t==="*";function t3(t,e){let n=t.split("/"),r=n.length;return n.some(LE)&&(r+=e3),e&&(r+=XF),n.filter(s=>!LE(s)).reduce((s,i)=>s+(QF.test(i)?YF:i===""?JF:ZF),r)}function n3(t,e){return t.length===e.length&&t.slice(0,-1).every((r,s)=>r===e[s])?t[t.length-1]-e[e.length-1]:0}function r3(t,e,n){let{routesMeta:r}=t,s={},i="/",o=[];for(let a=0;a{let{paramName:f,isOptional:p}=d;if(f==="*"){let w=a[h]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const g=a[h];return p&&!g?u[f]=void 0:u[f]=(g||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function s3(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!0),iA(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let r=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,a,l)=>(r.push({paramName:a,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(r.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),r]}function i3(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return iA(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+e+").")),t}}function La(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let n=e.endsWith("/")?e.length-1:e.length,r=t.charAt(n);return r&&r!=="/"?null:t.slice(n)||"/"}function o3(t,e){e===void 0&&(e="/");let{pathname:n,search:r="",hash:s=""}=typeof t=="string"?Za(t):t;return{pathname:n?n.startsWith("/")?n:a3(n,e):e,search:c3(r),hash:d3(s)}}function a3(t,e){let n=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?n.length>1&&n.pop():s!=="."&&n.push(s)}),n.length>1?n.join("/"):"/"}function xm(t,e,n,r){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(r)+"]. Please separate it out to the ")+("`to."+n+"` field. Alternatively you may provide the full path as ")+'a string in and the router will parse it for you.'}function l3(t){return t.filter((e,n)=>n===0||e.route.path&&e.route.path.length>0)}function T0(t,e){let n=l3(t);return e?n.map((r,s)=>s===n.length-1?r.pathname:r.pathnameBase):n.map(r=>r.pathnameBase)}function b0(t,e,n,r){r===void 0&&(r=!1);let s;typeof t=="string"?s=Za(t):(s=Uu({},t),tt(!s.pathname||!s.pathname.includes("?"),xm("?","pathname","search",s)),tt(!s.pathname||!s.pathname.includes("#"),xm("#","pathname","hash",s)),tt(!s.search||!s.search.includes("#"),xm("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,a;if(o==null)a=n;else{let h=e.length-1;if(!r&&o.startsWith("..")){let f=o.split("/");for(;f[0]==="..";)f.shift(),h-=1;s.pathname=f.join("/")}a=h>=0?e[h]:"/"}let l=o3(s,a),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&n.endsWith("/");return!l.pathname.endsWith("/")&&(u||d)&&(l.pathname+="/"),l}const ii=t=>t.join("/").replace(/\/\/+/g,"/"),u3=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),c3=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,d3=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function h3(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const lA=["post","put","patch","delete"];new Set(lA);const f3=["get",...lA];new Set(f3);/** * React Router v6.27.0 * * 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 $u(){return $u=Object.assign?Object.assign.bind():function(t){for(var e=1;e{a.current=!0}),b.useCallback(function(u,d){if(d===void 0&&(d={}),!a.current)return;if(typeof u=="number"){r.go(u);return}let h=b0(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:ii([e,h.pathname])),(d.replace?r.replace:r.push)(h,d.state,d)},[e,r,o,i,t])}function kY(){let{matches:t}=b.useContext(vs),e=t[t.length-1];return e?e.params:{}}function Jf(t,e){let{relative:n}=e===void 0?{}:e,{future:r}=b.useContext(ys),{matches:s}=b.useContext(vs),{pathname:i}=Ri(),o=JSON.stringify(T0(s,r.v7_relativeSplatPath));return b.useMemo(()=>b0(t,JSON.parse(o),i,n==="path"),[t,o,i,n])}function g3(t,e){return y3(t,e)}function y3(t,e,n,r){el()||tt(!1);let{navigator:s}=b.useContext(ys),{matches:i}=b.useContext(vs),o=i[i.length-1],a=o?o.params:{};o&&o.pathname;let l=o?o.pathnameBase:"/";o&&o.route;let u=Ri(),d;if(e){var h;let _=typeof e=="string"?Za(e):e;l==="/"||(h=_.pathname)!=null&&h.startsWith(l)||tt(!1),d=_}else d=u;let f=d.pathname||"/",p=f;if(l!=="/"){let _=l.replace(/^\//,"").split("/");p="/"+f.replace(/^\//,"").split("/").slice(_.length).join("/")}let g=qF(t,{pathname:p}),w=E3(g&&g.map(_=>Object.assign({},_,{params:Object.assign({},a,_.params),pathname:ii([l,s.encodeLocation?s.encodeLocation(_.pathname).pathname:_.pathname]),pathnameBase:_.pathnameBase==="/"?l:ii([l,s.encodeLocation?s.encodeLocation(_.pathnameBase).pathname:_.pathnameBase])})),i,n,r);return e&&w?b.createElement(Yf.Provider,{value:{location:$u({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:Qs.Pop}},w):w}function v3(){let t=C3(),e=h3(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),n=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return b.createElement(b.Fragment,null,b.createElement("h2",null,"Unexpected Application Error!"),b.createElement("h3",{style:{fontStyle:"italic"}},e),n?b.createElement("pre",{style:s},n):null,null)}const w3=b.createElement(v3,null);class x3 extends b.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,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){console.error("React Router caught the following error during render",e,n)}render(){return this.state.error!==void 0?b.createElement(vs.Provider,{value:this.props.routeContext},b.createElement(cA.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function _3(t){let{routeContext:e,match:n,children:r}=t,s=b.useContext(Qf);return s&&s.static&&s.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=n.route.id),b.createElement(vs.Provider,{value:e},r)}function E3(t,e,n,r){var s;if(e===void 0&&(e=[]),n===void 0&&(n=null),r===void 0&&(r=null),t==null){var i;if(!n)return null;if(n.errors)t=n.matches;else if((i=r)!=null&&i.v7_partialHydration&&e.length===0&&!n.initialized&&n.matches.length>0)t=n.matches;else return null}let o=t,a=(s=n)==null?void 0:s.errors;if(a!=null){let d=o.findIndex(h=>h.route.id&&(a==null?void 0:a[h.route.id])!==void 0);d>=0||tt(!1),o=o.slice(0,Math.min(o.length,d+1))}let l=!1,u=-1;if(n&&r&&r.v7_partialHydration)for(let d=0;d=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,f)=>{let p,g=!1,w=null,_=null;n&&(p=a&&h.route.id?a[h.route.id]:void 0,w=h.route.errorElement||w3,l&&(u<0&&f===0?(P3("route-fallback"),g=!0,_=null):u===f&&(g=!0,_=h.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,f+1)),x=()=>{let T;return p?T=w:g?T=_:h.route.Component?T=b.createElement(h.route.Component,null):h.route.element?T=h.route.element:T=d,b.createElement(_3,{match:h,routeContext:{outlet:d,matches:v,isDataRoute:n!=null},children:T})};return n&&(h.route.ErrorBoundary||h.route.errorElement||f===0)?b.createElement(x3,{location:n.location,revalidation:n.revalidation,component:w,error:p,children:x(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):x()},null)}var hA=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(hA||{}),fA=function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t}(fA||{});function T3(t){let e=b.useContext(Qf);return e||tt(!1),e}function b3(t){let e=b.useContext(uA);return e||tt(!1),e}function S3(t){let e=b.useContext(vs);return e||tt(!1),e}function pA(t){let e=S3(),n=e.matches[e.matches.length-1];return n.route.id||tt(!1),n.route.id}function C3(){var t;let e=b.useContext(cA),n=b3(),r=pA();return e!==void 0?e:(t=n.errors)==null?void 0:t[r]}function I3(){let{router:t}=T3(hA.UseNavigateStable),e=pA(fA.UseNavigateStable),n=b.useRef(!1);return dA(()=>{n.current=!0}),b.useCallback(function(s,i){i===void 0&&(i={}),n.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,$u({fromRouteId:e},i)))},[t,e])}const ME={};function P3(t,e,n){ME[t]||(ME[t]=!0)}function A3(t){let{to:e,replace:n,state:r,relative:s}=t;el()||tt(!1);let{future:i,static:o}=b.useContext(ys),{matches:a}=b.useContext(vs),{pathname:l}=Ri(),u=Xf(),d=b0(e,T0(a,i.v7_relativeSplatPath),l,s==="path"),h=JSON.stringify(d);return b.useEffect(()=>u(JSON.parse(h),{replace:n,state:r,relative:s}),[u,h,s,n,r]),null}function Ie(t){tt(!1)}function R3(t){let{basename:e="/",children:n=null,location:r,navigationType:s=Qs.Pop,navigator:i,static:o=!1,future:a}=t;el()&&tt(!1);let l=e.replace(/^\/*/,"/"),u=b.useMemo(()=>({basename:l,navigator:i,static:o,future:$u({v7_relativeSplatPath:!1},a)}),[l,a,i,o]);typeof r=="string"&&(r=Za(r));let{pathname:d="/",search:h="",hash:f="",state:p=null,key:g="default"}=r,w=b.useMemo(()=>{let _=La(d,l);return _==null?null:{location:{pathname:_,search:h,hash:f,state:p,key:g},navigationType:s}},[l,d,h,f,p,g,s]);return w==null?null:b.createElement(ys.Provider,{value:u},b.createElement(Yf.Provider,{children:n,value:w}))}function k3(t){let{children:e,location:n}=t;return g3(oy(e),n)}new Promise(()=>{});function oy(t,e){e===void 0&&(e=[]);let n=[];return b.Children.forEach(t,(r,s)=>{if(!b.isValidElement(r))return;let i=[...e,s];if(r.type===b.Fragment){n.push.apply(n,oy(r.props.children,i));return}r.type!==Ie&&tt(!1),!r.props.index||!r.props.children||tt(!1);let o={id:r.props.id||i.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,loader:r.props.loader,action:r.props.action,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(o.children=oy(r.props.children,i)),n.push(o)}),n}/** * React Router DOM v6.27.0 * * 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 Fh(){return Fh=Object.assign?Object.assign.bind():function(t){for(var e=1;e=0)&&(n[s]=t[s]);return n}function N3(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function D3(t,e){return t.button===0&&(!e||e==="_self")&&!N3(t)}const O3=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],L3=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],M3="6";try{window.__reactRouterVersion=M3}catch{}const V3=b.createContext({isTransitioning:!1}),j3="startTransition",VE=UD[j3];function F3(t){let{basename:e,children:n,future:r,window:s}=t,i=b.useRef();i.current==null&&(i.current=zF({window:s,v5Compat:!0}));let o=i.current,[a,l]=b.useState({action:o.action,location:o.location}),{v7_startTransition:u}=r||{},d=b.useCallback(h=>{u&&VE?VE(()=>l(h)):l(h)},[l,u]);return b.useLayoutEffect(()=>o.listen(d),[o,d]),b.createElement(R3,{basename:e,children:n,location:a.location,navigationType:a.action,navigator:o,future:r})}const U3=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",$3=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vi=b.forwardRef(function(e,n){let{onClick:r,relative:s,reloadDocument:i,replace:o,state:a,target:l,to:u,preventScrollReset:d,viewTransition:h}=e,f=mA(e,O3),{basename:p}=b.useContext(ys),g,w=!1;if(typeof u=="string"&&$3.test(u)&&(g=u,U3))try{let T=new URL(window.location.href),A=u.startsWith("//")?new URL(T.protocol+u):new URL(u),k=La(A.pathname,p);A.origin===T.origin&&k!=null?u=k+A.search+A.hash:w=!0}catch{}let _=p3(u,{relative:s}),v=z3(u,{replace:o,state:a,target:l,preventScrollReset:d,relative:s,viewTransition:h});function x(T){r&&r(T),T.defaultPrevented||v(T)}return b.createElement("a",Fh({},f,{href:g||_,onClick:w||i?r:x,ref:n,target:l}))}),jE=b.forwardRef(function(e,n){let{"aria-current":r="page",caseSensitive:s=!1,className:i="",end:o=!1,style:a,to:l,viewTransition:u,children:d}=e,h=mA(e,L3),f=Jf(l,{relative:h.relative}),p=Ri(),g=b.useContext(uA),{navigator:w,basename:_}=b.useContext(ys),v=g!=null&&H3(f)&&u===!0,x=w.encodeLocation?w.encodeLocation(f).pathname:f.pathname,T=p.pathname,A=g&&g.navigation&&g.navigation.location?g.navigation.location.pathname:null;s||(T=T.toLowerCase(),A=A?A.toLowerCase():null,x=x.toLowerCase()),A&&_&&(A=La(A,_)||A);const k=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let L=T===x||!o&&T.startsWith(x)&&T.charAt(k)==="/",C=A!=null&&(A===x||!o&&A.startsWith(x)&&A.charAt(x.length)==="/"),S={isActive:L,isPending:C,isTransitioning:v},I=L?r:void 0,P;typeof i=="function"?P=i(S):P=[i,L?"active":null,C?"pending":null,v?"transitioning":null].filter(Boolean).join(" ");let N=typeof a=="function"?a(S):a;return b.createElement(vi,Fh({},h,{"aria-current":I,className:P,ref:n,style:N,to:l,viewTransition:u}),typeof d=="function"?d(S):d)});var ay;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(ay||(ay={}));var FE;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(FE||(FE={}));function B3(t){let e=b.useContext(Qf);return e||tt(!1),e}function z3(t,e){let{target:n,replace:r,state:s,preventScrollReset:i,relative:o,viewTransition:a}=e===void 0?{}:e,l=Xf(),u=Ri(),d=Jf(t,{relative:o});return b.useCallback(h=>{if(D3(h,n)){h.preventDefault();let f=r!==void 0?r:jh(u)===jh(d);l(t,{replace:f,state:s,preventScrollReset:i,relative:o,viewTransition:a})}},[u,l,d,r,s,n,t,i,o,a])}function H3(t,e){e===void 0&&(e={});let n=b.useContext(V3);n==null&&tt(!1);let{basename:r}=B3(ay.useViewTransitionState),s=Jf(t,{relative:e.relative});if(!n.isTransitioning)return!1;let i=La(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=La(n.nextLocation.pathname,r)||n.nextLocation.pathname;return iy(s.pathname,o)!=null||iy(s.pathname,i)!=null}const W3=()=>{};var UE={};/** * @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 gA=function(t){const e=[];let n=0;for(let r=0;r>6|192,e[n++]=s&63|128):(s&64512)===55296&&r+1>18|240,e[n++]=s>>12&63|128,e[n++]=s>>6&63|128,e[n++]=s&63|128):(e[n++]=s>>12|224,e[n++]=s>>6&63|128,e[n++]=s&63|128)}return e},q3=function(t){const e=[];let n=0,r=0;for(;n191&&s<224){const i=t[n++];e[r++]=String.fromCharCode((s&31)<<6|i&63)}else if(s>239&&s<365){const i=t[n++],o=t[n++],a=t[n++],l=((s&7)<<18|(i&63)<<12|(o&63)<<6|a&63)-65536;e[r++]=String.fromCharCode(55296+(l>>10)),e[r++]=String.fromCharCode(56320+(l&1023))}else{const i=t[n++],o=t[n++];e[r++]=String.fromCharCode((s&15)<<12|(i&63)<<6|o&63)}}return e.join("")},yA={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(t,e){if(!Array.isArray(t))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s>2,h=(i&3)<<4|a>>4;let f=(a&15)<<2|u>>6,p=u&63;l||(p=64,o||(f=64)),r.push(n[d],n[h],n[f],n[p])}return r.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(gA(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):q3(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const n=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s>4;if(r.push(f),u!==64){const p=a<<4&240|u>>2;if(r.push(p),h!==64){const g=u<<6&192|h;r.push(g)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class K3 extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const G3=function(t){const e=gA(t);return yA.encodeByteArray(e,!0)},Uh=function(t){return G3(t).replace(/\./g,"")},vA=function(t){try{return yA.decodeString(t,!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 Q3(){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 Y3=()=>Q3().__FIREBASE_DEFAULTS__,X3=()=>{if(typeof process>"u"||typeof UE>"u")return;const t=UE.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},J3=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&vA(t[1]);return e&&JSON.parse(e)},Zf=()=>{try{return W3()||Y3()||X3()||J3()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},wA=t=>{var e,n;return(n=(e=Zf())===null||e===void 0?void 0:e.emulatorHosts)===null||n===void 0?void 0:n[t]},Z3=t=>{const e=wA(t);if(!e)return;const n=e.lastIndexOf(":");if(n<=0||n+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(n+1),10);return e[0]==="["?[e.substring(1,n-1),r]:[e.substring(0,n),r]},xA=()=>{var t;return(t=Zf())===null||t===void 0?void 0:t.config},_A=t=>{var e;return(e=Zf())===null||e===void 0?void 0: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 e5{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=n})}wrapCallback(e){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(n):e(n,r))}}}/** * @license * Copyright 2025 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 yc(t){return t.endsWith(".cloudworkstations.dev")}async function EA(t){return(await fetch(t,{credentials:"include"})).ok}/** * @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 t5(t,e){if(t.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const n={alg:"none",type:"JWT"},r=e||"demo-project",s=t.iat||0,i=t.sub||t.user_id;if(!i)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o=Object.assign({iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[Uh(JSON.stringify(n)),Uh(JSON.stringify(o)),""].join(".")}const ru={};function n5(){const t={prod:[],emulator:[]};for(const e of Object.keys(ru))ru[e]?t.emulator.push(e):t.prod.push(e);return t}function r5(t){let e=document.getElementById(t),n=!1;return e||(e=document.createElement("div"),e.setAttribute("id",t),n=!0),{created:n,element:e}}let $E=!1;function TA(t,e){if(typeof window>"u"||typeof document>"u"||!yc(window.location.host)||ru[t]===e||ru[t]||$E)return;ru[t]=e;function n(f){return`__firebase__banner__${f}`}const r="__firebase__banner",i=n5().prod.length>0;function o(){const f=document.getElementById(r);f&&f.remove()}function a(f){f.style.display="flex",f.style.background="#7faaf0",f.style.position="fixed",f.style.bottom="5px",f.style.left="5px",f.style.padding=".5em",f.style.borderRadius="5px",f.style.alignItems="center"}function l(f,p){f.setAttribute("width","24"),f.setAttribute("id",p),f.setAttribute("height","24"),f.setAttribute("viewBox","0 0 24 24"),f.setAttribute("fill","none"),f.style.marginLeft="-6px"}function u(){const f=document.createElement("span");return f.style.cursor="pointer",f.style.marginLeft="16px",f.style.fontSize="24px",f.innerHTML=" ×",f.onclick=()=>{$E=!0,o()},f}function d(f,p){f.setAttribute("id",p),f.innerText="Learn more",f.href="https://firebase.google.com/docs/studio/preview-apps#preview-backend",f.setAttribute("target","__blank"),f.style.paddingLeft="5px",f.style.textDecoration="underline"}function h(){const f=r5(r),p=n("text"),g=document.getElementById(p)||document.createElement("span"),w=n("learnmore"),_=document.getElementById(w)||document.createElement("a"),v=n("preprendIcon"),x=document.getElementById(v)||document.createElementNS("http://www.w3.org/2000/svg","svg");if(f.created){const T=f.element;a(T),d(_,w);const A=u();l(x,v),T.append(x,g,_,A),document.body.appendChild(T)}i?(g.innerText="Preview backend disconnected.",x.innerHTML=` `):(x.innerHTML=` `,g.innerText="Preview backend running in this workspace."),g.setAttribute("id",p)}document.readyState==="loading"?window.addEventListener("DOMContentLoaded",h):h()}/** * @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 Zt(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function s5(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Zt())}function i5(){var t;const e=(t=Zf())===null||t===void 0?void 0:t.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 o5(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function a5(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function l5(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function u5(){const t=Zt();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function c5(){return!i5()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function d5(){try{return typeof indexedDB=="object"}catch{return!1}}function h5(){return new Promise((t,e)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),n||self.indexedDB.deleteDatabase(r),t(!0)},s.onupgradeneeded=()=>{n=!1},s.onerror=()=>{var i;e(((i=s.error)===null||i===void 0?void 0:i.message)||"")}}catch(n){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. */const f5="FirebaseError";class ws extends Error{constructor(e,n,r){super(n),this.code=e,this.customData=r,this.name=f5,Object.setPrototypeOf(this,ws.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,vc.prototype.create)}}class vc{constructor(e,n,r){this.service=e,this.serviceName=n,this.errors=r}create(e,...n){const r=n[0]||{},s=`${this.service}/${e}`,i=this.errors[e],o=i?p5(i,r):"Error",a=`${this.serviceName}: ${o} (${s}).`;return new ws(s,a,r)}}function p5(t,e){return t.replace(m5,(n,r)=>{const s=e[r];return s!=null?String(s):`<${r}?>`})}const m5=/\{\$([^}]+)}/g;function g5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function vo(t,e){if(t===e)return!0;const n=Object.keys(t),r=Object.keys(e);for(const s of n){if(!r.includes(s))return!1;const i=t[s],o=e[s];if(BE(i)&&BE(o)){if(!vo(i,o))return!1}else if(i!==o)return!1}for(const s of r)if(!n.includes(s))return!1;return!0}function BE(t){return t!==null&&typeof t=="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 wc(t){const e=[];for(const[n,r]of Object.entries(t))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(n)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function Fl(t){const e={};return t.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[s,i]=r.split("=");e[decodeURIComponent(s)]=decodeURIComponent(i)}}),e}function Ul(t){const e=t.indexOf("?");if(!e)return"";const n=t.indexOf("#",e);return t.substring(e,n>0?n:void 0)}function y5(t,e){const n=new v5(t,e);return n.subscribe.bind(n)}class v5{constructor(e,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(n=>{n.next(e)})}error(e){this.forEachObserver(n=>{n.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,n,r){let s;if(e===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");w5(e,["next","error","complete"])?s=e:s={next:e,error:n,complete:r},s.next===void 0&&(s.next=_m),s.error===void 0&&(s.error=_m),s.complete===void 0&&(s.complete=_m);const i=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),i}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 n=0;n{if(this.observers!==void 0&&this.observers[e]!==void 0)try{n(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}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 w5(t,e){if(typeof t!="object"||t===null)return!1;for(const n of e)if(n in t&&typeof t[n]=="function")return!0;return!1}function _m(){}/** * @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 pt(t){return t&&t._delegate?t._delegate:t}class wo{constructor(e,n,r){this.name=e,this.instanceFactory=n,this.type=r,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 Bi="[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 x5{constructor(e,n){this.name=e,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const n=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(n)){const r=new e5;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:n});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(n).promise}getImmediate(e){var n;const r=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(n=e==null?void 0:e.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(i){if(s)return null;throw i}else{if(s)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(E5(e))try{this.getOrInitializeService({instanceIdentifier:Bi})}catch{}for(const[n,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(n);try{const i=this.getOrInitializeService({instanceIdentifier:s});r.resolve(i)}catch{}}}}clearInstance(e=Bi){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(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...e.filter(n=>"_delete"in n).map(n=>n._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Bi){return this.instances.has(e)}getOptions(e=Bi){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:n={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[i,o]of this.instancesDeferred.entries()){const a=this.normalizeInstanceIdentifier(i);r===a&&o.resolve(s)}return s}onInit(e,n){var r;const s=this.normalizeInstanceIdentifier(n),i=(r=this.onInitCallbacks.get(s))!==null&&r!==void 0?r:new Set;i.add(e),this.onInitCallbacks.set(s,i);const o=this.instances.get(s);return o&&e(o,s),()=>{i.delete(e)}}invokeOnInitCallbacks(e,n){const r=this.onInitCallbacks.get(n);if(r)for(const s of r)try{s(e,n)}catch{}}getOrInitializeService({instanceIdentifier:e,options:n={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:_5(e),options:n}),this.instances.set(e,r),this.instancesOptions.set(e,n),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Bi){return this.component?this.component.multipleInstances?e:Bi:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function _5(t){return t===Bi?void 0:t}function E5(t){return t.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 T5{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const n=this.getProvider(e.name);if(n.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);n.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 n=new x5(e,this);return this.providers.set(e,n),n}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 we;(function(t){t[t.DEBUG=0]="DEBUG",t[t.VERBOSE=1]="VERBOSE",t[t.INFO=2]="INFO",t[t.WARN=3]="WARN",t[t.ERROR=4]="ERROR",t[t.SILENT=5]="SILENT"})(we||(we={}));const b5={debug:we.DEBUG,verbose:we.VERBOSE,info:we.INFO,warn:we.WARN,error:we.ERROR,silent:we.SILENT},S5=we.INFO,C5={[we.DEBUG]:"log",[we.VERBOSE]:"log",[we.INFO]:"info",[we.WARN]:"warn",[we.ERROR]:"error"},I5=(t,e,...n)=>{if(ee.some(n=>t instanceof n);let zE,HE;function A5(){return zE||(zE=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function R5(){return HE||(HE=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const bA=new WeakMap,ly=new WeakMap,SA=new WeakMap,Em=new WeakMap,C0=new WeakMap;function k5(t){const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{n(oi(t.result)),s()},o=()=>{r(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(n=>{n instanceof IDBCursor&&bA.set(n,t)}).catch(()=>{}),C0.set(e,t),e}function N5(t){if(ly.has(t))return;const e=new Promise((n,r)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{n(),s()},o=()=>{r(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});ly.set(t,e)}let uy={get(t,e,n){if(t instanceof IDBTransaction){if(e==="done")return ly.get(t);if(e==="objectStoreNames")return t.objectStoreNames||SA.get(t);if(e==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return oi(t[e])},set(t,e,n){return t[e]=n,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function D5(t){uy=t(uy)}function O5(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...n){const r=t.call(Tm(this),e,...n);return SA.set(r,e.sort?e.sort():[e]),oi(r)}:R5().includes(t)?function(...e){return t.apply(Tm(this),e),oi(bA.get(this))}:function(...e){return oi(t.apply(Tm(this),e))}}function L5(t){return typeof t=="function"?O5(t):(t instanceof IDBTransaction&&N5(t),P5(t,A5())?new Proxy(t,uy):t)}function oi(t){if(t instanceof IDBRequest)return k5(t);if(Em.has(t))return Em.get(t);const e=L5(t);return e!==t&&(Em.set(t,e),C0.set(e,t)),e}const Tm=t=>C0.get(t);function M5(t,e,{blocked:n,upgrade:r,blocking:s,terminated:i}={}){const o=indexedDB.open(t,e),a=oi(o);return r&&o.addEventListener("upgradeneeded",l=>{r(oi(o.result),l.oldVersion,l.newVersion,oi(o.transaction),l)}),n&&o.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),a.then(l=>{i&&l.addEventListener("close",()=>i()),s&&l.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),a}const V5=["get","getKey","getAll","getAllKeys","count"],j5=["put","add","delete","clear"],bm=new Map;function WE(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(bm.get(e))return bm.get(e);const n=e.replace(/FromIndex$/,""),r=e!==n,s=j5.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(s||V5.includes(n)))return;const i=async function(o,...a){const l=this.transaction(o,s?"readwrite":"readonly");let u=l.store;return r&&(u=u.index(a.shift())),(await Promise.all([u[n](...a),s&&l.done]))[0]};return bm.set(e,i),i}D5(t=>({...t,get:(e,n,r)=>WE(e,n)||t.get(e,n,r),has:(e,n)=>!!WE(e,n)||t.has(e,n)}));/** * @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 F5{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(U5(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function U5(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const cy="@firebase/app",qE="0.13.1";/** * @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 cs=new S0("@firebase/app"),$5="@firebase/app-compat",B5="@firebase/analytics-compat",z5="@firebase/analytics",H5="@firebase/app-check-compat",W5="@firebase/app-check",q5="@firebase/auth",K5="@firebase/auth-compat",G5="@firebase/database",Q5="@firebase/data-connect",Y5="@firebase/database-compat",X5="@firebase/functions",J5="@firebase/functions-compat",Z5="@firebase/installations",e6="@firebase/installations-compat",t6="@firebase/messaging",n6="@firebase/messaging-compat",r6="@firebase/performance",s6="@firebase/performance-compat",i6="@firebase/remote-config",o6="@firebase/remote-config-compat",a6="@firebase/storage",l6="@firebase/storage-compat",u6="@firebase/firestore",c6="@firebase/ai",d6="@firebase/firestore-compat",h6="firebase",f6="11.9.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 dy="[DEFAULT]",p6={[cy]:"fire-core",[$5]:"fire-core-compat",[z5]:"fire-analytics",[B5]:"fire-analytics-compat",[W5]:"fire-app-check",[H5]:"fire-app-check-compat",[q5]:"fire-auth",[K5]:"fire-auth-compat",[G5]:"fire-rtdb",[Q5]:"fire-data-connect",[Y5]:"fire-rtdb-compat",[X5]:"fire-fn",[J5]:"fire-fn-compat",[Z5]:"fire-iid",[e6]:"fire-iid-compat",[t6]:"fire-fcm",[n6]:"fire-fcm-compat",[r6]:"fire-perf",[s6]:"fire-perf-compat",[i6]:"fire-rc",[o6]:"fire-rc-compat",[a6]:"fire-gcs",[l6]:"fire-gcs-compat",[u6]:"fire-fst",[d6]:"fire-fst-compat",[c6]:"fire-vertex","fire-js":"fire-js",[h6]:"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 $h=new Map,m6=new Map,hy=new Map;function KE(t,e){try{t.container.addComponent(e)}catch(n){cs.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,n)}}function Ma(t){const e=t.name;if(hy.has(e))return cs.debug(`There were multiple attempts to register component ${e}.`),!1;hy.set(e,t);for(const n of $h.values())KE(n,t);for(const n of m6.values())KE(n,t);return!0}function I0(t,e){const n=t.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),t.container.getProvider(e)}function Sn(t){return t==null?!1:t.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 g6={"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."},ai=new vc("app","Firebase",g6);/** * @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 y6{constructor(e,n,r){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new wo("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 ai.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 tl=f6;function CA(t,e={}){let n=t;typeof e!="object"&&(e={name:e});const r=Object.assign({name:dy,automaticDataCollectionEnabled:!0},e),s=r.name;if(typeof s!="string"||!s)throw ai.create("bad-app-name",{appName:String(s)});if(n||(n=xA()),!n)throw ai.create("no-options");const i=$h.get(s);if(i){if(vo(n,i.options)&&vo(r,i.config))return i;throw ai.create("duplicate-app",{appName:s})}const o=new T5(s);for(const l of hy.values())o.addComponent(l);const a=new y6(n,r,o);return $h.set(s,a),a}function IA(t=dy){const e=$h.get(t);if(!e&&t===dy&&xA())return CA();if(!e)throw ai.create("no-app",{appName:t});return e}function li(t,e,n){var r;let s=(r=p6[t])!==null&&r!==void 0?r:t;n&&(s+=`-${n}`);const i=s.match(/\s|\//),o=e.match(/\s|\//);if(i||o){const a=[`Unable to register library "${s}" with version "${e}":`];i&&a.push(`library name "${s}" contains illegal characters (whitespace or "/")`),i&&o&&a.push("and"),o&&a.push(`version name "${e}" contains illegal characters (whitespace or "/")`),cs.warn(a.join(" "));return}Ma(new wo(`${s}-version`,()=>({library:s,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 v6="firebase-heartbeat-database",w6=1,Bu="firebase-heartbeat-store";let Sm=null;function PA(){return Sm||(Sm=M5(v6,w6,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Bu)}catch(n){console.warn(n)}}}}).catch(t=>{throw ai.create("idb-open",{originalErrorMessage:t.message})})),Sm}async function x6(t){try{const n=(await PA()).transaction(Bu),r=await n.objectStore(Bu).get(AA(t));return await n.done,r}catch(e){if(e instanceof ws)cs.warn(e.message);else{const n=ai.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});cs.warn(n.message)}}}async function GE(t,e){try{const r=(await PA()).transaction(Bu,"readwrite");await r.objectStore(Bu).put(e,AA(t)),await r.done}catch(n){if(n instanceof ws)cs.warn(n.message);else{const r=ai.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});cs.warn(r.message)}}}function AA(t){return`${t.name}!${t.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 _6=1024,E6=30;class T6{constructor(e){this.container=e,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new S6(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,n;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=QE();if(((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(o=>o.date===i))return;if(this._heartbeatsCache.heartbeats.push({date:i,agent:s}),this._heartbeatsCache.heartbeats.length>E6){const o=C6(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){cs.warn(r)}}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 n=QE(),{heartbeatsToSend:r,unsentEntries:s}=b6(this._heartbeatsCache.heartbeats),i=Uh(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(n){return cs.warn(n),""}}}function QE(){return new Date().toISOString().substring(0,10)}function b6(t,e=_6){const n=[];let r=t.slice();for(const s of t){const i=n.find(o=>o.agent===s.agent);if(i){if(i.dates.push(s.date),YE(n)>e){i.dates.pop();break}}else if(n.push({agent:s.agent,dates:[s.date]}),YE(n)>e){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class S6{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return d5()?h5().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const n=await x6(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return GE(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var n;if(await this._canUseIndexedDBPromise){const s=await this.read();return GE(this.app,{lastSentHeartbeatDate:(n=e.lastSentHeartbeatDate)!==null&&n!==void 0?n:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function YE(t){return Uh(JSON.stringify({version:2,heartbeats:t})).length}function C6(t){if(t.length===0)return-1;let e=0,n=t[0].date;for(let r=1;rnew F5(e),"PRIVATE")),Ma(new wo("heartbeat",e=>new T6(e),"PRIVATE")),li(cy,qE,t),li(cy,qE,"esm2017"),li("fire-js","")}I6("");var XE=function(){return XE=Object.assign||function(e){for(var n,r=1,s=arguments.length;r"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.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 xc{constructor(e,n){this.shortDelay=e,this.longDelay=n,ds(n>e,"Short delay should be less than long delay!"),this.isMobile=s5()||l5()}get(){return N6()?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 k0(t,e){ds(t.emulator,"Emulator should always be set here");const{url:n}=t.emulator;return e?`${n}${e.startsWith("/")?e.slice(1):e}`: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 NA{static initialize(e,n,r){this.fetchImpl=e,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}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;es("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;es("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;es("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 O6={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 L6=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],M6=new xc(3e4,6e4);function xs(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function $r(t,e,n,r,s={}){return DA(t,s,async()=>{let i={},o={};r&&(e==="GET"?o=r:i={body:JSON.stringify(r)});const a=wc(Object.assign({key:t.config.apiKey},o)).slice(1),l=await t._getAdditionalHeaders();l["Content-Type"]="application/json",t.languageCode&&(l["X-Firebase-Locale"]=t.languageCode);const u=Object.assign({method:e,headers:l},i);return o5()||(u.referrerPolicy="no-referrer"),t.emulatorConfig&&yc(t.emulatorConfig.host)&&(u.credentials="include"),NA.fetch()(await OA(t,t.config.apiHost,n,a),u)})}async function DA(t,e,n){t._canInitEmulator=!1;const r=Object.assign(Object.assign({},O6),e);try{const s=new j6(t),i=await Promise.race([n(),s.promise]);s.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw _d(t,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const a=i.ok?o.errorMessage:o.error.message,[l,u]=a.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw _d(t,"credential-already-in-use",o);if(l==="EMAIL_EXISTS")throw _d(t,"email-already-in-use",o);if(l==="USER_DISABLED")throw _d(t,"user-disabled",o);const d=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw A0(t,d,u);Xn(t,d)}}catch(s){if(s instanceof ws)throw s;Xn(t,"network-request-failed",{message:String(s)})}}async function _c(t,e,n,r,s={}){const i=await $r(t,e,n,r,s);return"mfaPendingCredential"in i&&Xn(t,"multi-factor-auth-required",{_serverResponse:i}),i}async function OA(t,e,n,r){const s=`${e}${n}?${r}`,i=t,o=i.config.emulator?k0(t.config,s):`${t.config.apiScheme}://${s}`;return L6.includes(n)&&(await i._persistenceManagerAvailable,i._getPersistenceType()==="COOKIE")?i._getPersistence()._getFinalTarget(o).toString():o}function V6(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class j6{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(dr(this.auth,"network-request-failed")),M6.get())})}}function _d(t,e,n){const r={appName:t.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const s=dr(t,e,r);return s.customData._tokenResponse=n,s}function ZE(t){return t!==void 0&&t.enterprise!==void 0}class F6{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 n of this.recaptchaEnforcementState)if(n.provider&&n.provider===e)return V6(n.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 U6(t,e){return $r(t,"GET","/v2/recaptchaConfig",xs(t,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 $6(t,e){return $r(t,"POST","/v1/accounts:delete",e)}async function zh(t,e){return $r(t,"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 su(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function B6(t,e=!1){const n=pt(t),r=await n.getIdToken(e),s=N0(r);ie(s&&s.exp&&s.auth_time&&s.iat,n.auth,"internal-error");const i=typeof s.firebase=="object"?s.firebase:void 0,o=i==null?void 0:i.sign_in_provider;return{claims:s,token:r,authTime:su(Cm(s.auth_time)),issuedAtTime:su(Cm(s.iat)),expirationTime:su(Cm(s.exp)),signInProvider:o||null,signInSecondFactor:(i==null?void 0:i.sign_in_second_factor)||null}}function Cm(t){return Number(t)*1e3}function N0(t){const[e,n,r]=t.split(".");if(e===void 0||n===void 0||r===void 0)return Qd("JWT malformed, contained fewer than 3 sections"),null;try{const s=vA(n);return s?JSON.parse(s):(Qd("Failed to decode base64 JWT payload"),null)}catch(s){return Qd("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function eT(t){const e=N0(t);return ie(e,"internal-error"),ie(typeof e.exp<"u","internal-error"),ie(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 Va(t,e,n=!1){if(n)return e;try{return await e}catch(r){throw r instanceof ws&&z6(r)&&t.auth.currentUser===t&&await t.auth.signOut(),r}}function z6({code:t}){return t==="auth/user-disabled"||t==="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 H6{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 n;if(e){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const s=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,s)}}schedule(e=!1){if(!this.isRunning)return;const n=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},n)}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 py{constructor(e,n){this.createdAt=e,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=su(this.lastLoginAt),this.creationTime=su(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 Hh(t){var e;const n=t.auth,r=await t.getIdToken(),s=await Va(t,zh(n,{idToken:r}));ie(s==null?void 0:s.users.length,n,"internal-error");const i=s.users[0];t._notifyReloadListener(i);const o=!((e=i.providerUserInfo)===null||e===void 0)&&e.length?LA(i.providerUserInfo):[],a=q6(t.providerData,o),l=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(a!=null&&a.length),d=l?u:!1,h={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:a,metadata:new py(i.createdAt,i.lastLoginAt),isAnonymous:d};Object.assign(t,h)}async function W6(t){const e=pt(t);await Hh(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function q6(t,e){return[...t.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function LA(t){return t.map(e=>{var{providerId:n}=e,r=P0(e,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.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 K6(t,e){const n=await DA(t,{},async()=>{const r=wc({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:i}=t.config,o=await OA(t,s,"/v1/token",`key=${i}`),a=await t._getAdditionalHeaders();return a["Content-Type"]="application/x-www-form-urlencoded",NA.fetch()(o,{method:"POST",headers:a,body:r})});return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}}async function G6(t,e){return $r(t,"POST","/v2/accounts:revokeToken",xs(t,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 fa{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){ie(e.idToken,"internal-error"),ie(typeof e.idToken<"u","internal-error"),ie(typeof e.refreshToken<"u","internal-error");const n="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):eT(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,n)}updateFromIdToken(e){ie(e.length!==0,"internal-error");const n=eT(e);this.updateTokensAndExpiration(e,null,n)}async getToken(e,n=!1){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(ie(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,n){const{accessToken:r,refreshToken:s,expiresIn:i}=await K6(e,n);this.updateTokensAndExpiration(r,s,Number(i))}updateTokensAndExpiration(e,n,r){this.refreshToken=n||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,n){const{refreshToken:r,accessToken:s,expirationTime:i}=n,o=new fa;return r&&(ie(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),s&&(ie(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),i&&(ie(typeof i=="number","internal-error",{appName:e}),o.expirationTime=i),o}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 fa,this.toJSON())}_performRefresh(){return es("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 ks(t,e){ie(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class lr{constructor(e){var{uid:n,auth:r,stsTokenManager:s}=e,i=P0(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new H6(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=s,this.accessToken=s.accessToken,this.displayName=i.displayName||null,this.email=i.email||null,this.emailVerified=i.emailVerified||!1,this.phoneNumber=i.phoneNumber||null,this.photoURL=i.photoURL||null,this.isAnonymous=i.isAnonymous||!1,this.tenantId=i.tenantId||null,this.providerData=i.providerData?[...i.providerData]:[],this.metadata=new py(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const n=await Va(this,this.stsTokenManager.getToken(this.auth,e));return ie(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n}getIdTokenResult(e){return B6(this,e)}reload(){return W6(this)}_assign(e){this!==e&&(ie(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(n=>Object.assign({},n)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const n=new lr(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(e){ie(!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,n=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),n&&await Hh(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Sn(this.auth.app))return Promise.reject(rs(this.auth));const e=await this.getIdToken();return await Va(this,$6(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,n){var r,s,i,o,a,l,u,d;const h=(r=n.displayName)!==null&&r!==void 0?r:void 0,f=(s=n.email)!==null&&s!==void 0?s:void 0,p=(i=n.phoneNumber)!==null&&i!==void 0?i:void 0,g=(o=n.photoURL)!==null&&o!==void 0?o:void 0,w=(a=n.tenantId)!==null&&a!==void 0?a:void 0,_=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,v=(u=n.createdAt)!==null&&u!==void 0?u:void 0,x=(d=n.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:T,emailVerified:A,isAnonymous:k,providerData:L,stsTokenManager:C}=n;ie(T&&C,e,"internal-error");const S=fa.fromJSON(this.name,C);ie(typeof T=="string",e,"internal-error"),ks(h,e.name),ks(f,e.name),ie(typeof A=="boolean",e,"internal-error"),ie(typeof k=="boolean",e,"internal-error"),ks(p,e.name),ks(g,e.name),ks(w,e.name),ks(_,e.name),ks(v,e.name),ks(x,e.name);const I=new lr({uid:T,auth:e,email:f,emailVerified:A,displayName:h,isAnonymous:k,photoURL:g,phoneNumber:p,tenantId:w,stsTokenManager:S,createdAt:v,lastLoginAt:x});return L&&Array.isArray(L)&&(I.providerData=L.map(P=>Object.assign({},P))),_&&(I._redirectEventId=_),I}static async _fromIdTokenResponse(e,n,r=!1){const s=new fa;s.updateFromServerResponse(n);const i=new lr({uid:n.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await Hh(i),i}static async _fromGetAccountInfoResponse(e,n,r){const s=n.users[0];ie(s.localId!==void 0,"internal-error");const i=s.providerUserInfo!==void 0?LA(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!(i!=null&&i.length),a=new fa;a.updateFromIdToken(r);const l=new lr({uid:s.localId,auth:e,stsTokenManager:a,isAnonymous:o}),u={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:i,metadata:new py(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(i!=null&&i.length)};return Object.assign(l,u),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 tT=new Map;function ts(t){ds(t instanceof Function,"Expected a class definition");let e=tT.get(t);return e?(ds(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,tT.set(t,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 MA{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,n){this.storage[e]=n}async _get(e){const n=this.storage[e];return n===void 0?null:n}async _remove(e){delete this.storage[e]}_addListener(e,n){}_removeListener(e,n){}}MA.type="NONE";const nT=MA;/** * @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 Yd(t,e,n){return`firebase:${t}:${e}:${n}`}class pa{constructor(e,n,r){this.persistence=e,this.auth=n,this.userKey=r;const{config:s,name:i}=this.auth;this.fullUserKey=Yd(this.userKey,s.apiKey,i),this.fullPersistenceKey=Yd("persistence",s.apiKey,i),this.boundEventHandler=n._onStorageEvent.bind(n),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);if(!e)return null;if(typeof e=="string"){const n=await zh(this.auth,{idToken:e}).catch(()=>{});return n?lr._fromGetAccountInfoResponse(this.auth,n,e):null}return lr._fromJSON(this.auth,e)}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 n=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,n)return this.setCurrentUser(n)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,n,r="authUser"){if(!n.length)return new pa(ts(nT),e,r);const s=(await Promise.all(n.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let i=s[0]||ts(nT);const o=Yd(r,e.config.apiKey,e.name);let a=null;for(const u of n)try{const d=await u._get(o);if(d){let h;if(typeof d=="string"){const f=await zh(e,{idToken:d}).catch(()=>{});if(!f)break;h=await lr._fromGetAccountInfoResponse(e,f,d)}else h=lr._fromJSON(e,d);u!==i&&(a=h),i=u;break}}catch{}const l=s.filter(u=>u._shouldAllowMigration);return!i._shouldAllowMigration||!l.length?new pa(i,e,r):(i=l[0],a&&await i._set(o,a.toJSON()),await Promise.all(n.map(async u=>{if(u!==i)try{await u._remove(o)}catch{}})),new pa(i,e,r))}}/** * @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 rT(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(UA(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(VA(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(BA(e))return"Blackberry";if(zA(e))return"Webos";if(jA(e))return"Safari";if((e.includes("chrome/")||FA(e))&&!e.includes("edge/"))return"Chrome";if($A(e))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=t.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function VA(t=Zt()){return/firefox\//i.test(t)}function jA(t=Zt()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function FA(t=Zt()){return/crios\//i.test(t)}function UA(t=Zt()){return/iemobile/i.test(t)}function $A(t=Zt()){return/android/i.test(t)}function BA(t=Zt()){return/blackberry/i.test(t)}function zA(t=Zt()){return/webos/i.test(t)}function D0(t=Zt()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function Q6(t=Zt()){var e;return D0(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function Y6(){return u5()&&document.documentMode===10}function HA(t=Zt()){return D0(t)||$A(t)||zA(t)||BA(t)||/windows phone/i.test(t)||UA(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. */function WA(t,e=[]){let n;switch(t){case"Browser":n=rT(Zt());break;case"Worker":n=`${rT(Zt())}-${t}`;break;default:n=t}const r=e.length?e.join(","):"FirebaseCore-web";return`${n}/JsCore/${tl}/${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 X6{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,n){const r=i=>new Promise((o,a)=>{try{const l=e(i);o(l)}catch(l){a(l)}});r.onAbort=n,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const n=[];try{for(const r of this.queue)await r(e),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const s of n)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.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 J6(t,e={}){return $r(t,"GET","/v2/passwordPolicy",xs(t,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 Z6=6;class e9{constructor(e){var n,r,s,i;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=o.minPasswordLength)!==null&&n!==void 0?n:Z6,o.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=o.maxPasswordLength),o.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=o.containsLowercaseCharacter),o.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=o.containsUppercaseCharacter),o.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=o.containsNumericCharacter),o.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=o.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(s=(r=e.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&s!==void 0?s:"",this.forceUpgradeOnSignin=(i=e.forceUpgradeOnSignin)!==null&&i!==void 0?i:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var n,r,s,i,o,a;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,l),this.validatePasswordCharacterOptions(e,l),l.isValid&&(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(s=l.containsLowercaseLetter)!==null&&s!==void 0?s:!0),l.isValid&&(l.isValid=(i=l.containsUppercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(o=l.containsNumericCharacter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(a=l.containsNonAlphanumericCharacter)!==null&&a!==void 0?a:!0),l}validatePasswordLengthOptions(e,n){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=e.length>=r),s&&(n.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let s=0;s="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,n,r,s,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=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 t9{constructor(e,n,r,s){this.app=e,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new sT(this),this.idTokenSubscription=new sT(this),this.beforeStateQueue=new X6(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=kA,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(i=>this._resolvePersistenceManagerAvailable=i)}_initializeWithPersistence(e,n){return n&&(this._popupRedirectResolver=ts(n)),this._initializationPromise=this.queue(async()=>{var r,s,i;if(!this._deleted&&(this.persistenceManager=await pa.create(this,e),(r=this._resolvePersistenceManagerAvailable)===null||r===void 0||r.call(this),!this._deleted)){if(!((s=this._popupRedirectResolver)===null||s===void 0)&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.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 n=await zh(this,{idToken:e}),r=await lr._fromGetAccountInfoResponse(this,n,e);await this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var n;if(Sn(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(a=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(a,a))}):this.directlySetCurrentUser(null)}const r=await this.assertedPersistence.getCurrentUser();let s=r,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,a=s==null?void 0:s._redirectEventId,l=await this.tryRedirectSignIn(e);(!o||o===a)&&(l!=null&&l.user)&&(s=l.user,i=!0)}if(!s)return this.directlySetCurrentUser(null);if(!s._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(s)}catch(o){s=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return ie(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===s._redirectEventId?this.directlySetCurrentUser(s):this.reloadAndSetCurrentUserOrClear(s)}async tryRedirectSignIn(e){let n=null;try{n=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return n}async reloadAndSetCurrentUserOrClear(e){try{await Hh(e)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=D6()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Sn(this.app))return Promise.reject(rs(this));const n=e?pt(e):null;return n&&ie(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))}async _updateCurrentUser(e,n=!1){if(!this._deleted)return e&&ie(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),n||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Sn(this.app)?Promise.reject(rs(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Sn(this.app)?Promise.reject(rs(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ts(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await J6(this),n=new e9(e);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new vc("auth","Firebase",e())}onAuthStateChanged(e,n,r){return this.registerStateListener(this.authStateSubscription,e,n,r)}beforeAuthStateChanged(e,n){return this.beforeStateQueue.pushCallback(e,n)}onIdTokenChanged(e,n,r){return this.registerStateListener(this.idTokenSubscription,e,n,r)}authStateReady(){return new Promise((e,n)=>{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},n)}})}async revokeAccessToken(e){if(this.currentUser){const n=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),await G6(this,r)}}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,n){const r=await this.getOrInitRedirectPersistenceManager(n);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const n=e&&ts(e)||this._popupRedirectResolver;ie(n,this,"argument-error"),this.redirectPersistenceManager=await pa.create(this,[ts(n._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var n,r;return this._isInitialized&&await this.queue(async()=>{}),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===e?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._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,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,n,r,s){if(this._deleted)return()=>{};const i=typeof n=="function"?n:n.next.bind(n);let o=!1;const a=this._isInitialized?Promise.resolve():this._initializationPromise;if(ie(a,this,"internal-error"),a.then(()=>{o||i(this.currentUser)}),typeof n=="function"){const l=e.addObserver(n,r,s);return()=>{o=!0,l()}}else{const l=e.addObserver(n);return()=>{o=!0,l()}}}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 ie(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=WA(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());r&&(n["X-Firebase-Client"]=r);const s=await this._getAppCheckToken();return s&&(n["X-Firebase-AppCheck"]=s),n}async _getAppCheckToken(){var e;if(Sn(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const n=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return n!=null&&n.error&&A6(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token}}function _s(t){return pt(t)}class sT{constructor(e){this.auth=e,this.observer=null,this.addObserver=y5(n=>this.observer=n)}get next(){return ie(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 ep={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function n9(t){ep=t}function qA(t){return ep.loadJS(t)}function r9(){return ep.recaptchaEnterpriseScript}function s9(){return ep.gapiScript}function i9(t){return`__${t}${Math.floor(Math.random()*1e6)}`}class o9{constructor(){this.enterprise=new a9}ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}class a9{ready(e){e()}execute(e,n){return Promise.resolve("token")}render(e,n){return""}}const l9="recaptcha-enterprise",KA="NO_RECAPTCHA";class u9{constructor(e){this.type=l9,this.auth=_s(e)}async verify(e="verify",n=!1){async function r(i){if(!n){if(i.tenantId==null&&i._agentRecaptchaConfig!=null)return i._agentRecaptchaConfig.siteKey;if(i.tenantId!=null&&i._tenantRecaptchaConfigs[i.tenantId]!==void 0)return i._tenantRecaptchaConfigs[i.tenantId].siteKey}return new Promise(async(o,a)=>{U6(i,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)a(new Error("recaptcha Enterprise site key undefined"));else{const u=new F6(l);return i.tenantId==null?i._agentRecaptchaConfig=u:i._tenantRecaptchaConfigs[i.tenantId]=u,o(u.siteKey)}}).catch(l=>{a(l)})})}function s(i,o,a){const l=window.grecaptcha;ZE(l)?l.enterprise.ready(()=>{l.enterprise.execute(i,{action:e}).then(u=>{o(u)}).catch(()=>{o(KA)})}):a(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new o9().execute("siteKey",{action:"verify"}):new Promise((i,o)=>{r(this.auth).then(a=>{if(!n&&ZE(window.grecaptcha))s(a,i,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let l=r9();l.length!==0&&(l+=a),qA(l).then(()=>{s(a,i,o)}).catch(u=>{o(u)})}}).catch(a=>{o(a)})})}}async function iT(t,e,n,r=!1,s=!1){const i=new u9(t);let o;if(s)o=KA;else try{o=await i.verify(n)}catch{o=await i.verify(n,!0)}const a=Object.assign({},e);if(n==="mfaSmsEnrollment"||n==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in a){const l=a.phoneEnrollmentInfo.phoneNumber,u=a.phoneEnrollmentInfo.recaptchaToken;Object.assign(a,{phoneEnrollmentInfo:{phoneNumber:l,recaptchaToken:u,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in a){const l=a.phoneSignInInfo.recaptchaToken;Object.assign(a,{phoneSignInInfo:{recaptchaToken:l,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return a}return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a}async function Wh(t,e,n,r,s){var i;if(!((i=t._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await iT(t,e,n,n==="getOobCode");return r(t,o)}else return r(t,e).catch(async o=>{if(o.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const a=await iT(t,e,n,n==="getOobCode");return r(t,a)}else return Promise.reject(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 c9(t,e){const n=I0(t,"auth");if(n.isInitialized()){const s=n.getImmediate(),i=n.getOptions();if(vo(i,e??{}))return s;Xn(s,"already-initialized")}return n.initialize({options:e})}function d9(t,e){const n=(e==null?void 0:e.persistence)||[],r=(Array.isArray(n)?n:[n]).map(ts);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function h9(t,e,n){const r=_s(t);ie(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const s=!1,i=GA(e),{host:o,port:a}=f9(e),l=a===null?"":`:${a}`,u={url:`${i}//${o}${l}/`},d=Object.freeze({host:o,port:a,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){ie(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),ie(vo(u,r.config.emulator)&&vo(d,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=u,r.emulatorConfig=d,r.settings.appVerificationDisabledForTesting=!0,yc(o)?(EA(`${i}//${o}${l}`),TA("Auth",!0)):p9()}function GA(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function f9(t){const e=GA(t),n=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const i=s[1];return{host:i,port:oT(r.substr(i.length+1))}}else{const[i,o]=r.split(":");return{host:i,port:oT(o)}}}function oT(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function p9(){function t(){const e=document.createElement("p"),n=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.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",t):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 O0{constructor(e,n){this.providerId=e,this.signInMethod=n}toJSON(){return es("not implemented")}_getIdTokenResponse(e){return es("not implemented")}_linkToIdToken(e,n){return es("not implemented")}_getReauthenticationResolver(e){return es("not implemented")}}async function m9(t,e){return $r(t,"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 g9(t,e){return _c(t,"POST","/v1/accounts:signInWithPassword",xs(t,e))}async function y9(t,e){return $r(t,"POST","/v1/accounts:sendOobCode",xs(t,e))}async function v9(t,e){return y9(t,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 w9(t,e){return _c(t,"POST","/v1/accounts:signInWithEmailLink",xs(t,e))}async function x9(t,e){return _c(t,"POST","/v1/accounts:signInWithEmailLink",xs(t,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 zu extends O0{constructor(e,n,r,s=null){super("password",r),this._email=e,this._password=n,this._tenantId=s}static _fromEmailAndPassword(e,n){return new zu(e,n,"password")}static _fromEmailAndCode(e,n,r=null){return new zu(e,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const n=typeof e=="string"?JSON.parse(e):e;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Wh(e,n,"signInWithPassword",g9);case"emailLink":return w9(e,{email:this._email,oobCode:this._password});default:Xn(e,"internal-error")}}async _linkToIdToken(e,n){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Wh(e,r,"signUpPassword",m9);case"emailLink":return x9(e,{idToken:n,email:this._email,oobCode:this._password});default:Xn(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 ma(t,e){return _c(t,"POST","/v1/accounts:signInWithIdp",xs(t,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 _9="http://localhost";class xo extends O0{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const n=new xo(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(n.idToken=e.idToken),e.accessToken&&(n.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(n.nonce=e.nonce),e.pendingToken&&(n.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(n.accessToken=e.oauthToken,n.secret=e.oauthTokenSecret):Xn("argument-error"),n}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 n=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s}=n,i=P0(n,["providerId","signInMethod"]);if(!r||!s)return null;const o=new xo(r,s);return o.idToken=i.idToken||void 0,o.accessToken=i.accessToken||void 0,o.secret=i.secret,o.nonce=i.nonce,o.pendingToken=i.pendingToken||null,o}_getIdTokenResponse(e){const n=this.buildRequest();return ma(e,n)}_linkToIdToken(e,n){const r=this.buildRequest();return r.idToken=n,ma(e,r)}_getReauthenticationResolver(e){const n=this.buildRequest();return n.autoCreate=!1,ma(e,n)}buildRequest(){const e={requestUri:_9,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),e.postBody=wc(n)}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 E9(t){switch(t){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 T9(t){const e=Fl(Ul(t)).link,n=e?Fl(Ul(e)).deep_link_id:null,r=Fl(Ul(t)).deep_link_id;return(r?Fl(Ul(r)).link:null)||r||n||e||t}class L0{constructor(e){var n,r,s,i,o,a;const l=Fl(Ul(e)),u=(n=l.apiKey)!==null&&n!==void 0?n:null,d=(r=l.oobCode)!==null&&r!==void 0?r:null,h=E9((s=l.mode)!==null&&s!==void 0?s:null);ie(u&&d&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=d,this.continueUrl=(i=l.continueUrl)!==null&&i!==void 0?i:null,this.languageCode=(o=l.lang)!==null&&o!==void 0?o:null,this.tenantId=(a=l.tenantId)!==null&&a!==void 0?a:null}static parseLink(e){const n=T9(e);try{return new L0(n)}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 nl{constructor(){this.providerId=nl.PROVIDER_ID}static credential(e,n){return zu._fromEmailAndPassword(e,n)}static credentialWithLink(e,n){const r=L0.parseLink(n);return ie(r,"argument-error"),zu._fromEmailAndCode(e,r.code,r.tenantId)}}nl.PROVIDER_ID="password";nl.EMAIL_PASSWORD_SIGN_IN_METHOD="password";nl.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 M0{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 Ec extends M0{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 js extends Ec{constructor(){super("facebook.com")}static credential(e){return xo._fromParams({providerId:js.PROVIDER_ID,signInMethod:js.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return js.credentialFromTaggedObject(e)}static credentialFromError(e){return js.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return js.credential(e.oauthAccessToken)}catch{return null}}}js.FACEBOOK_SIGN_IN_METHOD="facebook.com";js.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 Xr extends Ec{constructor(){super("google.com"),this.addScope("profile")}static credential(e,n){return xo._fromParams({providerId:Xr.PROVIDER_ID,signInMethod:Xr.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:n})}static credentialFromResult(e){return Xr.credentialFromTaggedObject(e)}static credentialFromError(e){return Xr.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:n,oauthAccessToken:r}=e;if(!n&&!r)return null;try{return Xr.credential(n,r)}catch{return null}}}Xr.GOOGLE_SIGN_IN_METHOD="google.com";Xr.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 Ec{constructor(){super("github.com")}static credential(e){return xo._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 Us extends Ec{constructor(){super("twitter.com")}static credential(e,n){return xo._fromParams({providerId:Us.PROVIDER_ID,signInMethod:Us.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:n})}static credentialFromResult(e){return Us.credentialFromTaggedObject(e)}static credentialFromError(e){return Us.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=e;if(!n||!r)return null;try{return Us.credential(n,r)}catch{return null}}}Us.TWITTER_SIGN_IN_METHOD="twitter.com";Us.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. */async function b9(t,e){return _c(t,"POST","/v1/accounts:signUp",xs(t,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 _o{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,n,r,s=!1){const i=await lr._fromIdTokenResponse(e,r,s),o=aT(r);return new _o({user:i,providerId:o,_tokenResponse:r,operationType:n})}static async _forOperation(e,n,r){await e._updateTokensIfNecessary(r,!0);const s=aT(r);return new _o({user:e,providerId:s,_tokenResponse:r,operationType:n})}}function aT(t){return t.providerId?t.providerId:"phoneNumber"in t?"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 qh extends ws{constructor(e,n,r,s){var i;super(n.code,n.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,qh.prototype),this.customData={appName:e.name,tenantId:(i=e.tenantId)!==null&&i!==void 0?i:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,n,r,s){return new qh(e,n,r,s)}}function QA(t,e,n,r){return(e==="reauthenticate"?n._getReauthenticationResolver(t):n._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?qh._fromErrorAndOperation(t,i,e,r):i})}async function S9(t,e,n=!1){const r=await Va(t,e._linkToIdToken(t.auth,await t.getIdToken()),n);return _o._forOperation(t,"link",r)}/** * @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 C9(t,e,n=!1){const{auth:r}=t;if(Sn(r.app))return Promise.reject(rs(r));const s="reauthenticate";try{const i=await Va(t,QA(r,s,e,t),n);ie(i.idToken,r,"internal-error");const o=N0(i.idToken);ie(o,r,"internal-error");const{sub:a}=o;return ie(t.uid===a,r,"user-mismatch"),_o._forOperation(t,s,i)}catch(i){throw(i==null?void 0:i.code)==="auth/user-not-found"&&Xn(r,"user-mismatch"),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. */async function YA(t,e,n=!1){if(Sn(t.app))return Promise.reject(rs(t));const r="signIn",s=await QA(t,r,e),i=await _o._fromIdTokenResponse(t,r,s);return n||await t._updateCurrentUser(i.user),i}async function I9(t,e){return YA(_s(t),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 XA(t){const e=_s(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function OY(t,e,n){const r=_s(t);await Wh(r,{requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"},"getOobCode",v9)}async function P9(t,e,n){if(Sn(t.app))return Promise.reject(rs(t));const r=_s(t),o=await Wh(r,{returnSecureToken:!0,email:e,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",b9).catch(l=>{throw l.code==="auth/password-does-not-meet-requirements"&&XA(t),l}),a=await _o._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(a.user),a}function A9(t,e,n){return Sn(t.app)?Promise.reject(rs(t)):I9(pt(t),nl.credential(e,n)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&XA(t),r})}/** * @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 R9(t,e){return $r(t,"POST","/v1/accounts:update",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 k9(t,{displayName:e,photoURL:n}){if(e===void 0&&n===void 0)return;const r=pt(t),i={idToken:await r.getIdToken(),displayName:e,photoUrl:n,returnSecureToken:!0},o=await Va(r,R9(r.auth,i));r.displayName=o.displayName||null,r.photoURL=o.photoUrl||null;const a=r.providerData.find(({providerId:l})=>l==="password");a&&(a.displayName=r.displayName,a.photoURL=r.photoURL),await r._updateTokensIfNecessary(o)}function N9(t,e,n,r){return pt(t).onIdTokenChanged(e,n,r)}function D9(t,e,n){return pt(t).beforeAuthStateChanged(e,n)}function O9(t,e,n,r){return pt(t).onAuthStateChanged(e,n,r)}function L9(t){return pt(t).signOut()}const Kh="__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 JA{constructor(e,n){this.storageRetriever=e,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Kh,"1"),this.storage.removeItem(Kh),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,n){return this.storage.setItem(e,JSON.stringify(n)),Promise.resolve()}_get(e){const n=this.storage.getItem(e);return Promise.resolve(n?JSON.parse(n):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 M9=1e3,V9=10;class ZA extends JA{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,n)=>this.onStorageEvent(e,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=HA(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),s=this.localCache[n];r!==s&&e(n,s,r)}}onStorageEvent(e,n=!1){if(!e.key){this.forAllChangedKeys((o,a,l)=>{this.notifyListeners(o,l)});return}const r=e.key;n?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(r);!n&&this.localCache[r]===o||this.notifyListeners(r,o)},i=this.storage.getItem(r);Y6()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,V9):s()}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:n,newValue:r}),!0)})},M9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,n){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(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,n){await super._set(e,n),this.localCache[e]=JSON.stringify(n)}async _get(e){const n=await super._get(e);return this.localCache[e]=JSON.stringify(n),n}async _remove(e){await super._remove(e),delete this.localCache[e]}}ZA.type="LOCAL";const j9=ZA;/** * @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 eR extends JA{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,n){}_removeListener(e,n){}}eR.type="SESSION";const tR=eR;/** * @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 F9(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(n){return{fulfilled:!1,reason:n}}}))}/** * @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 tp{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const n=this.receivers.find(s=>s.isListeningto(e));if(n)return n;const r=new tp(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const n=e,{eventId:r,eventType:s,data:i}=n.data,o=this.handlersMap[s];if(!(o!=null&&o.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const a=Array.from(o).map(async u=>u(n.origin,i)),l=await F9(a);n.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:l})}_subscribe(e,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(n)}_unsubscribe(e,n){this.handlersMap[e]&&n&&this.handlersMap[e].delete(n),(!n||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}tp.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 V0(t="",e=10){let n="";for(let r=0;r{const u=V0("",20);s.port1.start();const d=setTimeout(()=>{l(new Error("unsupported_event"))},r);o={messageChannel:s,onMessage(h){const f=h;if(f.data.eventId===u)switch(f.data.status){case"ack":clearTimeout(d),i=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),a(f.data.response);break;default:clearTimeout(d),clearTimeout(i),l(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:n},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(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 Nr(){return window}function $9(t){Nr().location.href=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. */function nR(){return typeof Nr().WorkerGlobalScope<"u"&&typeof Nr().importScripts=="function"}async function B9(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function z9(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function H9(){return nR()?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 rR="firebaseLocalStorageDb",W9=1,Gh="firebaseLocalStorage",sR="fbase_key";class Tc{constructor(e){this.request=e}toPromise(){return new Promise((e,n)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function np(t,e){return t.transaction([Gh],e?"readwrite":"readonly").objectStore(Gh)}function q9(){const t=indexedDB.deleteDatabase(rR);return new Tc(t).toPromise()}function my(){const t=indexedDB.open(rR,W9);return new Promise((e,n)=>{t.addEventListener("error",()=>{n(t.error)}),t.addEventListener("upgradeneeded",()=>{const r=t.result;try{r.createObjectStore(Gh,{keyPath:sR})}catch(s){n(s)}}),t.addEventListener("success",async()=>{const r=t.result;r.objectStoreNames.contains(Gh)?e(r):(r.close(),await q9(),e(await my()))})})}async function lT(t,e,n){const r=np(t,!0).put({[sR]:e,value:n});return new Tc(r).toPromise()}async function K9(t,e){const n=np(t,!1).get(e),r=await new Tc(n).toPromise();return r===void 0?null:r.value}function uT(t,e){const n=np(t,!0).delete(e);return new Tc(n).toPromise()}const G9=800,Q9=3;class iR{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 my(),this.db)}async _withRetries(e){let n=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(n++>Q9)throw r;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return nR()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=tp._getInstance(H9()),this.receiver._subscribe("keyChanged",async(e,n)=>({keyProcessed:(await this._poll()).includes(n.key)})),this.receiver._subscribe("ping",async(e,n)=>["keyChanged"])}async initializeSender(){var e,n;if(this.activeServiceWorker=await B9(),!this.activeServiceWorker)return;this.sender=new U9(this.activeServiceWorker);const r=await this.sender._send("ping",{},800);r&&!((e=r[0])===null||e===void 0)&&e.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||z9()!==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 my();return await lT(e,Kh,"1"),await uT(e,Kh),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,n){return this._withPendingWrite(async()=>(await this._withRetries(r=>lT(r,e,n)),this.localCache[e]=n,this.notifyServiceWorker(e)))}async _get(e){const n=await this._withRetries(r=>K9(r,e));return this.localCache[e]=n,n}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(n=>uT(n,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const i=np(s,!1).getAll();return new Tc(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:i}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(i)&&(this.notifyListeners(s,i),n.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),n.push(s));return n}notifyListeners(e,n){this.localCache[e]=n;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),G9)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(n)}_removeListener(e,n){this.listeners[e]&&(this.listeners[e].delete(n),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}iR.type="LOCAL";const Y9=iR;new xc(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 oR(t,e){return e?ts(e):(ie(t._popupRedirectResolver,t,"argument-error"),t._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 j0 extends O0{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return ma(e,this._buildIdpRequest())}_linkToIdToken(e,n){return ma(e,this._buildIdpRequest(n))}_getReauthenticationResolver(e){return ma(e,this._buildIdpRequest())}_buildIdpRequest(e){const n={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&&(n.idToken=e),n}}function X9(t){return YA(t.auth,new j0(t),t.bypassAuthState)}function J9(t){const{auth:e,user:n}=t;return ie(n,e,"internal-error"),C9(n,new j0(t),t.bypassAuthState)}async function Z9(t){const{auth:e,user:n}=t;return ie(n,e,"internal-error"),S9(n,new j0(t),t.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 aR{constructor(e,n,r,s,i=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise(async(e,n)=>{this.pendingPromise={resolve:e,reject:n};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:n,sessionId:r,postBody:s,tenantId:i,error:o,type:a}=e;if(o){this.reject(o);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:i||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(a)(l))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return X9;case"linkViaPopup":case"linkViaRedirect":return Z9;case"reauthViaPopup":case"reauthViaRedirect":return J9;default:Xn(this.auth,"internal-error")}}resolve(e){ds(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){ds(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 eU=new xc(2e3,1e4);async function tU(t,e,n){if(Sn(t.app))return Promise.reject(dr(t,"operation-not-supported-in-this-environment"));const r=_s(t);R6(t,e,M0);const s=oR(r,n);return new Ki(r,"signInViaPopup",e,s).executeNotNull()}class Ki extends aR{constructor(e,n,r,s,i){super(e,n,s,i),this.provider=r,this.authWindow=null,this.pollId=null,Ki.currentPopupAction&&Ki.currentPopupAction.cancel(),Ki.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return ie(e,this.auth,"internal-error"),e}async onExecution(){ds(this.filter.length===1,"Popup operations only handle one event");const e=V0();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(dr(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(dr(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Ki.currentPopupAction=null}pollUserCancellation(){const e=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(dr(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,eU.get())};e()}}Ki.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 nU="pendingRedirect",Xd=new Map;class rU extends aR{constructor(e,n,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}async execute(){let e=Xd.get(this.auth._key());if(!e){try{const r=await sU(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(n){e=()=>Promise.reject(n)}Xd.set(this.auth._key(),e)}return this.bypassAuthState||Xd.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 n=await this.auth._redirectUserForId(e.eventId);if(n)return this.user=n,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function sU(t,e){const n=aU(e),r=oU(t);if(!await r._isAvailable())return!1;const s=await r._get(n)==="true";return await r._remove(n),s}function iU(t,e){Xd.set(t._key(),e)}function oU(t){return ts(t._redirectPersistence)}function aU(t){return Yd(nU,t.config.apiKey,t.name)}async function lU(t,e,n=!1){if(Sn(t.app))return Promise.reject(rs(t));const r=_s(t),s=oR(r,e),o=await new rU(r,s,n).execute();return o&&!n&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),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 uU=10*60*1e3;class cU{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 n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(n=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!dU(e)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=e,n=!0)),n}sendToConsumer(e,n){var r;if(e.error&&!lR(e)){const s=((r=e.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(dr(this.auth,s))}else n.onAuthEvent(e)}isEventForConsumer(e,n){const r=n.eventId===null||!!e.eventId&&e.eventId===n.eventId;return n.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=uU&&this.cachedEventUids.clear(),this.cachedEventUids.has(cT(e))}saveEventToCache(e){this.cachedEventUids.add(cT(e)),this.lastProcessedEventTime=Date.now()}}function cT(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function lR({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function dU(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return lR(t);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 hU(t,e={}){return $r(t,"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 fU=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,pU=/^https?/;async function mU(t){if(t.config.emulator)return;const{authorizedDomains:e}=await hU(t);for(const n of e)try{if(gU(n))return}catch{}Xn(t,"unauthorized-domain")}function gU(t){const e=fy(),{protocol:n,hostname:r}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&r===""?n==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):n==="chrome-extension:"&&o.hostname===r}if(!pU.test(n))return!1;if(fU.test(t))return r===t;const s=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/** * @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 yU=new xc(3e4,6e4);function dT(){const t=Nr().___jsl;if(t!=null&&t.H){for(const e of Object.keys(t.H))if(t.H[e].r=t.H[e].r||[],t.H[e].L=t.H[e].L||[],t.H[e].r=[...t.H[e].L],t.CP)for(let n=0;n{var r,s,i;function o(){dT(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{dT(),n(dr(t,"network-request-failed"))},timeout:yU.get()})}if(!((s=(r=Nr().gapi)===null||r===void 0?void 0:r.iframes)===null||s===void 0)&&s.Iframe)e(gapi.iframes.getContext());else if(!((i=Nr().gapi)===null||i===void 0)&&i.load)o();else{const a=i9("iframefcb");return Nr()[a]=()=>{gapi.load?o():n(dr(t,"network-request-failed"))},qA(`${s9()}?onload=${a}`).catch(l=>n(l))}}).catch(e=>{throw Jd=null,e})}let Jd=null;function wU(t){return Jd=Jd||vU(t),Jd}/** * @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 xU=new xc(5e3,15e3),_U="__/auth/iframe",EU="emulator/auth/iframe",TU={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},bU=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function SU(t){const e=t.config;ie(e.authDomain,t,"auth-domain-config-required");const n=e.emulator?k0(e,EU):`https://${t.config.authDomain}/${_U}`,r={apiKey:e.apiKey,appName:t.name,v:tl},s=bU.get(t.config.apiHost);s&&(r.eid=s);const i=t._getFrameworks();return i.length&&(r.fw=i.join(",")),`${n}?${wc(r).slice(1)}`}async function CU(t){const e=await wU(t),n=Nr().gapi;return ie(n,t,"internal-error"),e.open({where:document.body,url:SU(t),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:TU,dontclear:!0},r=>new Promise(async(s,i)=>{await r.restyle({setHideOnLeave:!1});const o=dr(t,"network-request-failed"),a=Nr().setTimeout(()=>{i(o)},xU.get());function l(){Nr().clearTimeout(a),s(r)}r.ping(l).then(l,()=>{i(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 IU={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},PU=500,AU=600,RU="_blank",kU="http://localhost";class hT{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function NU(t,e,n,r=PU,s=AU){const i=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let a="";const l=Object.assign(Object.assign({},IU),{width:r.toString(),height:s.toString(),top:i,left:o}),u=Zt().toLowerCase();n&&(a=FA(u)?RU:n),VA(u)&&(e=e||kU,l.scrollbars="yes");const d=Object.entries(l).reduce((f,[p,g])=>`${f}${p}=${g},`,"");if(Q6(u)&&a!=="_self")return DU(e||"",a),new hT(null);const h=window.open(e||"",a,d);ie(h,t,"popup-blocked");try{h.focus()}catch{}return new hT(h)}function DU(t,e){const n=document.createElement("a");n.href=t,n.target=e;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/** * @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 OU="__/auth/handler",LU="emulator/auth/handler",MU=encodeURIComponent("fac");async function fT(t,e,n,r,s,i){ie(t.config.authDomain,t,"auth-domain-config-required"),ie(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:n,redirectUrl:r,v:tl,eventId:s};if(e instanceof M0){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",g5(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,h]of Object.entries({}))o[d]=h}if(e instanceof Ec){const d=e.getScopes().filter(h=>h!=="");d.length>0&&(o.scopes=d.join(","))}t.tenantId&&(o.tid=t.tenantId);const a=o;for(const d of Object.keys(a))a[d]===void 0&&delete a[d];const l=await t._getAppCheckToken(),u=l?`#${MU}=${encodeURIComponent(l)}`:"";return`${VU(t)}?${wc(a).slice(1)}${u}`}function VU({config:t}){return t.emulator?k0(t,LU):`https://${t.authDomain}/${OU}`}/** * @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 Im="webStorageSupport";class jU{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=tR,this._completeRedirectFn=lU,this._overrideRedirectResult=iU}async _openPopup(e,n,r,s){var i;ds((i=this.eventManagers[e._key()])===null||i===void 0?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await fT(e,n,r,fy(),s);return NU(e,o,V0())}async _openRedirect(e,n,r,s){await this._originValidation(e);const i=await fT(e,n,r,fy(),s);return $9(i),new Promise(()=>{})}_initialize(e){const n=e._key();if(this.eventManagers[n]){const{manager:s,promise:i}=this.eventManagers[n];return s?Promise.resolve(s):(ds(i,"If manager is not set, promise should be"),i)}const r=this.initAndGetManager(e);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}async initAndGetManager(e){const n=await CU(e),r=new cU(e);return n.register("authEvent",s=>(ie(s==null?void 0:s.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=n,r}_isIframeWebStorageSupported(e,n){this.iframes[e._key()].send(Im,{type:Im},s=>{var i;const o=(i=s==null?void 0:s[0])===null||i===void 0?void 0:i[Im];o!==void 0&&n(!!o),Xn(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const n=e._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=mU(e)),this.originValidationPromises[n]}get _shouldInitProactively(){return HA()||jA()||D0()}}const FU=jU;var pT="@firebase/auth",mT="1.10.6";/** * @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{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 n=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,n),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const n=this.internalListeners.get(e);n&&(this.internalListeners.delete(e),n(),this.updateProactiveRefresh())}assertAuthConfigured(){ie(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 $U(t){switch(t){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function BU(t){Ma(new wo("auth",(e,{options:n})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:a}=r.options;ie(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:o,authDomain:a,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:WA(t)},u=new t9(r,s,i,l);return d9(u,n),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,n,r)=>{e.getProvider("auth-internal").initialize()})),Ma(new wo("auth-internal",e=>{const n=_s(e.getProvider("auth").getImmediate());return(r=>new UU(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),li(pT,mT,$U(t)),li(pT,mT,"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 zU=5*60,HU=_A("authIdTokenMaxAge")||zU;let gT=null;const WU=t=>async e=>{const n=e&&await e.getIdTokenResult(),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>HU)return;const s=n==null?void 0:n.token;gT!==s&&(gT=s,await fetch(t,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function qU(t=IA()){const e=I0(t,"auth");if(e.isInitialized())return e.getImmediate();const n=c9(t,{popupRedirectResolver:FU,persistence:[Y9,j9,tR]}),r=_A("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(r,location.origin);if(location.origin===i.origin){const o=WU(i.toString());D9(n,o,()=>o(n.currentUser)),N9(n,a=>o(a))}}const s=wA("auth");return s&&h9(n,`http://${s}`),n}function KU(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}n9({loadJS(t){return new Promise((e,n)=>{const r=document.createElement("script");r.setAttribute("src",t),r.onload=e,r.onerror=s=>{const i=dr("internal-error");i.customData=s,n(i)},r.type="text/javascript",r.charset="UTF-8",KU().appendChild(r)})},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="});BU("Browser");var GU="firebase",QU="11.9.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. */li(GU,QU,"app");var yT=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 ui,uR;(function(){var t;/** @license Copyright The Closure Library Authors. SPDX-License-Identifier: Apache-2.0 */function e(C,S){function I(){}I.prototype=S.prototype,C.D=S.prototype,C.prototype=new I,C.prototype.constructor=C,C.C=function(P,N,O){for(var D=Array(arguments.length-2),z=2;zN;++N)P[N]=S.charCodeAt(I++)|S.charCodeAt(I++)<<8|S.charCodeAt(I++)<<16|S.charCodeAt(I++)<<24;else for(N=0;16>N;++N)P[N]=S[I++]|S[I++]<<8|S[I++]<<16|S[I++]<<24;S=C.g[0],I=C.g[1],N=C.g[2];var O=C.g[3],D=S+(O^I&(N^O))+P[0]+3614090360&4294967295;S=I+(D<<7&4294967295|D>>>25),D=O+(N^S&(I^N))+P[1]+3905402710&4294967295,O=S+(D<<12&4294967295|D>>>20),D=N+(I^O&(S^I))+P[2]+606105819&4294967295,N=O+(D<<17&4294967295|D>>>15),D=I+(S^N&(O^S))+P[3]+3250441966&4294967295,I=N+(D<<22&4294967295|D>>>10),D=S+(O^I&(N^O))+P[4]+4118548399&4294967295,S=I+(D<<7&4294967295|D>>>25),D=O+(N^S&(I^N))+P[5]+1200080426&4294967295,O=S+(D<<12&4294967295|D>>>20),D=N+(I^O&(S^I))+P[6]+2821735955&4294967295,N=O+(D<<17&4294967295|D>>>15),D=I+(S^N&(O^S))+P[7]+4249261313&4294967295,I=N+(D<<22&4294967295|D>>>10),D=S+(O^I&(N^O))+P[8]+1770035416&4294967295,S=I+(D<<7&4294967295|D>>>25),D=O+(N^S&(I^N))+P[9]+2336552879&4294967295,O=S+(D<<12&4294967295|D>>>20),D=N+(I^O&(S^I))+P[10]+4294925233&4294967295,N=O+(D<<17&4294967295|D>>>15),D=I+(S^N&(O^S))+P[11]+2304563134&4294967295,I=N+(D<<22&4294967295|D>>>10),D=S+(O^I&(N^O))+P[12]+1804603682&4294967295,S=I+(D<<7&4294967295|D>>>25),D=O+(N^S&(I^N))+P[13]+4254626195&4294967295,O=S+(D<<12&4294967295|D>>>20),D=N+(I^O&(S^I))+P[14]+2792965006&4294967295,N=O+(D<<17&4294967295|D>>>15),D=I+(S^N&(O^S))+P[15]+1236535329&4294967295,I=N+(D<<22&4294967295|D>>>10),D=S+(N^O&(I^N))+P[1]+4129170786&4294967295,S=I+(D<<5&4294967295|D>>>27),D=O+(I^N&(S^I))+P[6]+3225465664&4294967295,O=S+(D<<9&4294967295|D>>>23),D=N+(S^I&(O^S))+P[11]+643717713&4294967295,N=O+(D<<14&4294967295|D>>>18),D=I+(O^S&(N^O))+P[0]+3921069994&4294967295,I=N+(D<<20&4294967295|D>>>12),D=S+(N^O&(I^N))+P[5]+3593408605&4294967295,S=I+(D<<5&4294967295|D>>>27),D=O+(I^N&(S^I))+P[10]+38016083&4294967295,O=S+(D<<9&4294967295|D>>>23),D=N+(S^I&(O^S))+P[15]+3634488961&4294967295,N=O+(D<<14&4294967295|D>>>18),D=I+(O^S&(N^O))+P[4]+3889429448&4294967295,I=N+(D<<20&4294967295|D>>>12),D=S+(N^O&(I^N))+P[9]+568446438&4294967295,S=I+(D<<5&4294967295|D>>>27),D=O+(I^N&(S^I))+P[14]+3275163606&4294967295,O=S+(D<<9&4294967295|D>>>23),D=N+(S^I&(O^S))+P[3]+4107603335&4294967295,N=O+(D<<14&4294967295|D>>>18),D=I+(O^S&(N^O))+P[8]+1163531501&4294967295,I=N+(D<<20&4294967295|D>>>12),D=S+(N^O&(I^N))+P[13]+2850285829&4294967295,S=I+(D<<5&4294967295|D>>>27),D=O+(I^N&(S^I))+P[2]+4243563512&4294967295,O=S+(D<<9&4294967295|D>>>23),D=N+(S^I&(O^S))+P[7]+1735328473&4294967295,N=O+(D<<14&4294967295|D>>>18),D=I+(O^S&(N^O))+P[12]+2368359562&4294967295,I=N+(D<<20&4294967295|D>>>12),D=S+(I^N^O)+P[5]+4294588738&4294967295,S=I+(D<<4&4294967295|D>>>28),D=O+(S^I^N)+P[8]+2272392833&4294967295,O=S+(D<<11&4294967295|D>>>21),D=N+(O^S^I)+P[11]+1839030562&4294967295,N=O+(D<<16&4294967295|D>>>16),D=I+(N^O^S)+P[14]+4259657740&4294967295,I=N+(D<<23&4294967295|D>>>9),D=S+(I^N^O)+P[1]+2763975236&4294967295,S=I+(D<<4&4294967295|D>>>28),D=O+(S^I^N)+P[4]+1272893353&4294967295,O=S+(D<<11&4294967295|D>>>21),D=N+(O^S^I)+P[7]+4139469664&4294967295,N=O+(D<<16&4294967295|D>>>16),D=I+(N^O^S)+P[10]+3200236656&4294967295,I=N+(D<<23&4294967295|D>>>9),D=S+(I^N^O)+P[13]+681279174&4294967295,S=I+(D<<4&4294967295|D>>>28),D=O+(S^I^N)+P[0]+3936430074&4294967295,O=S+(D<<11&4294967295|D>>>21),D=N+(O^S^I)+P[3]+3572445317&4294967295,N=O+(D<<16&4294967295|D>>>16),D=I+(N^O^S)+P[6]+76029189&4294967295,I=N+(D<<23&4294967295|D>>>9),D=S+(I^N^O)+P[9]+3654602809&4294967295,S=I+(D<<4&4294967295|D>>>28),D=O+(S^I^N)+P[12]+3873151461&4294967295,O=S+(D<<11&4294967295|D>>>21),D=N+(O^S^I)+P[15]+530742520&4294967295,N=O+(D<<16&4294967295|D>>>16),D=I+(N^O^S)+P[2]+3299628645&4294967295,I=N+(D<<23&4294967295|D>>>9),D=S+(N^(I|~O))+P[0]+4096336452&4294967295,S=I+(D<<6&4294967295|D>>>26),D=O+(I^(S|~N))+P[7]+1126891415&4294967295,O=S+(D<<10&4294967295|D>>>22),D=N+(S^(O|~I))+P[14]+2878612391&4294967295,N=O+(D<<15&4294967295|D>>>17),D=I+(O^(N|~S))+P[5]+4237533241&4294967295,I=N+(D<<21&4294967295|D>>>11),D=S+(N^(I|~O))+P[12]+1700485571&4294967295,S=I+(D<<6&4294967295|D>>>26),D=O+(I^(S|~N))+P[3]+2399980690&4294967295,O=S+(D<<10&4294967295|D>>>22),D=N+(S^(O|~I))+P[10]+4293915773&4294967295,N=O+(D<<15&4294967295|D>>>17),D=I+(O^(N|~S))+P[1]+2240044497&4294967295,I=N+(D<<21&4294967295|D>>>11),D=S+(N^(I|~O))+P[8]+1873313359&4294967295,S=I+(D<<6&4294967295|D>>>26),D=O+(I^(S|~N))+P[15]+4264355552&4294967295,O=S+(D<<10&4294967295|D>>>22),D=N+(S^(O|~I))+P[6]+2734768916&4294967295,N=O+(D<<15&4294967295|D>>>17),D=I+(O^(N|~S))+P[13]+1309151649&4294967295,I=N+(D<<21&4294967295|D>>>11),D=S+(N^(I|~O))+P[4]+4149444226&4294967295,S=I+(D<<6&4294967295|D>>>26),D=O+(I^(S|~N))+P[11]+3174756917&4294967295,O=S+(D<<10&4294967295|D>>>22),D=N+(S^(O|~I))+P[2]+718787259&4294967295,N=O+(D<<15&4294967295|D>>>17),D=I+(O^(N|~S))+P[9]+3951481745&4294967295,C.g[0]=C.g[0]+S&4294967295,C.g[1]=C.g[1]+(N+(D<<21&4294967295|D>>>11))&4294967295,C.g[2]=C.g[2]+N&4294967295,C.g[3]=C.g[3]+O&4294967295}r.prototype.u=function(C,S){S===void 0&&(S=C.length);for(var I=S-this.blockSize,P=this.B,N=this.h,O=0;Othis.h?this.blockSize:2*this.blockSize)-this.h);C[0]=128;for(var S=1;SS;++S)for(var P=0;32>P;P+=8)C[I++]=this.g[S]>>>P&255;return C};function i(C,S){var I=a;return Object.prototype.hasOwnProperty.call(I,C)?I[C]:I[C]=S(C)}function o(C,S){this.h=S;for(var I=[],P=!0,N=C.length-1;0<=N;N--){var O=C[N]|0;P&&O==S||(I[N]=O,P=!1)}this.g=I}var a={};function l(C){return-128<=C&&128>C?i(C,function(S){return new o([S|0],0>S?-1:0)}):new o([C|0],0>C?-1:0)}function u(C){if(isNaN(C)||!isFinite(C))return h;if(0>C)return _(u(-C));for(var S=[],I=1,P=0;C>=I;P++)S[P]=C/I|0,I*=4294967296;return new o(S,0)}function d(C,S){if(C.length==0)throw Error("number format error: empty string");if(S=S||10,2>S||36O?(O=u(Math.pow(S,O)),P=P.j(O).add(u(D))):(P=P.j(I),P=P.add(u(D)))}return P}var h=l(0),f=l(1),p=l(16777216);t=o.prototype,t.m=function(){if(w(this))return-_(this).m();for(var C=0,S=1,I=0;IC||36>>0).toString(C);if(I=N,g(I))return O+P;for(;6>O.length;)O="0"+O;P=O+P}},t.i=function(C){return 0>C?0:C>>16)+(this.i(N)>>>16)+(C.i(N)>>>16);P=D>>>16,O&=65535,D&=65535,I[N]=D<<16|O}return new o(I,I[I.length-1]&-2147483648?-1:0)};function v(C,S){return C.add(_(S))}t.j=function(C){if(g(this)||g(C))return h;if(w(this))return w(C)?_(this).j(_(C)):_(_(this).j(C));if(w(C))return _(this.j(_(C)));if(0>this.l(p)&&0>C.l(p))return u(this.m()*C.m());for(var S=this.g.length+C.g.length,I=[],P=0;P<2*S;P++)I[P]=0;for(P=0;P>>16,D=this.i(P)&65535,z=C.i(N)>>>16,re=C.i(N)&65535;I[2*P+2*N]+=D*re,x(I,2*P+2*N),I[2*P+2*N+1]+=O*re,x(I,2*P+2*N+1),I[2*P+2*N+1]+=D*z,x(I,2*P+2*N+1),I[2*P+2*N+2]+=O*z,x(I,2*P+2*N+2)}for(P=0;P>>16,C[S]&=65535,S++}function T(C,S){this.g=C,this.h=S}function A(C,S){if(g(S))throw Error("division by zero");if(g(C))return new T(h,h);if(w(C))return S=A(_(C),S),new T(_(S.g),_(S.h));if(w(S))return S=A(C,_(S)),new T(_(S.g),S.h);if(30=P.l(C);)I=k(I),P=k(P);var N=L(I,1),O=L(P,1);for(P=L(P,2),I=L(I,2);!g(P);){var D=O.add(P);0>=D.l(C)&&(N=N.add(I),O=D),P=L(P,1),I=L(I,1)}return S=v(C,N.j(S)),new T(N,S)}for(N=h;0<=C.l(S);){for(I=Math.max(1,Math.floor(C.m()/S.m())),P=Math.ceil(Math.log(I)/Math.LN2),P=48>=P?1:Math.pow(2,P-48),O=u(I),D=O.j(S);w(D)||0>>31;return new o(I,C.h)}function L(C,S){var I=S>>5;S%=32;for(var P=C.g.length-I,N=[],O=0;O>>S|C.i(O+I+1)<<32-S:C.i(O+I);return new o(N,C.h)}r.prototype.digest=r.prototype.v,r.prototype.reset=r.prototype.s,r.prototype.update=r.prototype.u,uR=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.A,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=u,o.fromString=d,ui=o}).apply(typeof yT<"u"?yT:typeof self<"u"?self:typeof window<"u"?window:{});var Ed=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 cR,$l,dR,Zd,gy,hR,fR,pR;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(c,m,E){return c==Array.prototype||c==Object.prototype||(c[m]=E.value),c};function n(c){c=[typeof globalThis=="object"&&globalThis,c,typeof window=="object"&&window,typeof self=="object"&&self,typeof Ed=="object"&&Ed];for(var m=0;m{throw c},0)}function D(){var c=B;let m=null;return c.g&&(m=c.g,c.g=c.g.next,c.g||(c.h=null),m.next=null),m}class z{constructor(){this.h=this.g=null}add(m,E){const R=re.get();R.set(m,E),this.h?this.h.next=R:this.g=R,this.h=R}}var re=new v(()=>new X,c=>c.reset());class X{constructor(){this.next=this.g=this.h=null}set(m,E){this.h=m,this.g=E,this.next=null}reset(){this.next=this.g=this.h=null}}let G,M=!1,B=new z,Q=()=>{const c=a.Promise.resolve(void 0);G=()=>{c.then(H)}};var H=()=>{for(var c;c=D();){try{c.h.call(c.g)}catch(E){O(E)}var m=re;m.j(c),100>m.h&&(m.h++,c.next=m.g,m.g=c)}M=!1};function Y(){this.s=this.s,this.C=this.C}Y.prototype.s=!1,Y.prototype.ma=function(){this.s||(this.s=!0,this.N())},Y.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function te(c,m){this.type=c,this.g=this.target=m,this.defaultPrevented=!1}te.prototype.h=function(){this.defaultPrevented=!0};var me=function(){if(!a.addEventListener||!Object.defineProperty)return!1;var c=!1,m=Object.defineProperty({},"passive",{get:function(){c=!0}});try{const E=()=>{};a.addEventListener("test",E,m),a.removeEventListener("test",E,m)}catch{}return c}();function Oe(c,m){if(te.call(this,c?c.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,c){var E=this.type=c.type,R=c.changedTouches&&c.changedTouches.length?c.changedTouches[0]:null;if(this.target=c.target||c.srcElement,this.g=m,m=c.relatedTarget){if(k){e:{try{A(m.nodeName);var V=!0;break e}catch{}V=!1}V||(m=null)}}else E=="mouseover"?m=c.fromElement:E=="mouseout"&&(m=c.toElement);this.relatedTarget=m,R?(this.clientX=R.clientX!==void 0?R.clientX:R.pageX,this.clientY=R.clientY!==void 0?R.clientY:R.pageY,this.screenX=R.screenX||0,this.screenY=R.screenY||0):(this.clientX=c.clientX!==void 0?c.clientX:c.pageX,this.clientY=c.clientY!==void 0?c.clientY:c.pageY,this.screenX=c.screenX||0,this.screenY=c.screenY||0),this.button=c.button,this.key=c.key||"",this.ctrlKey=c.ctrlKey,this.altKey=c.altKey,this.shiftKey=c.shiftKey,this.metaKey=c.metaKey,this.pointerId=c.pointerId||0,this.pointerType=typeof c.pointerType=="string"?c.pointerType:ye[c.pointerType]||"",this.state=c.state,this.i=c,c.defaultPrevented&&Oe.aa.h.call(this)}}g(Oe,te);var ye={2:"touch",3:"pen",4:"mouse"};Oe.prototype.h=function(){Oe.aa.h.call(this);var c=this.i;c.preventDefault?c.preventDefault():c.returnValue=!1};var Pe="closure_listenable_"+(1e6*Math.random()|0),Ve=0;function mt(c,m,E,R,V){this.listener=c,this.proxy=null,this.src=m,this.type=E,this.capture=!!R,this.ha=V,this.key=++Ve,this.da=this.fa=!1}function je(c){c.da=!0,c.listener=null,c.proxy=null,c.src=null,c.ha=null}function Te(c){this.src=c,this.g={},this.h=0}Te.prototype.add=function(c,m,E,R,V){var j=c.toString();c=this.g[j],c||(c=this.g[j]=[],this.h++);var K=ge(c,m,R,V);return-1>>0);function Ts(c){return typeof c=="function"?c:(c[Es]||(c[Es]=function(m){return c.handleEvent(m)}),c[Es])}function it(){Y.call(this),this.i=new Te(this),this.M=this,this.F=null}g(it,Y),it.prototype[Pe]=!0,it.prototype.removeEventListener=function(c,m,E,R){Ne(this,c,m,E,R)};function Ue(c,m){var E,R=c.F;if(R)for(E=[];R;R=R.F)E.push(R);if(c=c.M,R=m.type||m,typeof m=="string")m=new te(m,c);else if(m instanceof te)m.target=m.target||c;else{var V=m;m=new te(R,c),P(m,V)}if(V=!0,E)for(var j=E.length-1;0<=j;j--){var K=m.g=E[j];V=Br(K,R,!0,m)&&V}if(K=m.g=c,V=Br(K,R,!0,m)&&V,V=Br(K,R,!1,m)&&V,E)for(j=0;j{c.g=null,c.i&&(c.i=!1,dn(c))},c.l);const m=c.h;c.h=null,c.m.apply(null,m)}class Li extends Y{constructor(m,E){super(),this.m=m,this.l=E,this.h=null,this.i=!1,this.g=null}j(m){this.h=arguments,this.g?this.i=!0:dn(this)}N(){super.N(),this.g&&(a.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ln(c){Y.call(this),this.h=c,this.g={}}g(Ln,Y);var wr=[];function bs(c){L(c.g,function(m,E){this.g.hasOwnProperty(E)&&Ct(m)},c),c.g={}}Ln.prototype.N=function(){Ln.aa.N.call(this),bs(this)},Ln.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var zr=a.JSON.stringify,Mn=a.JSON.parse,dl=class{stringify(c){return a.JSON.stringify(c,void 0)}parse(c){return a.JSON.parse(c,void 0)}};function ae(){}ae.prototype.h=null;function Re(c){return c.h||(c.h=c.i())}function Se(){}var _t={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function kt(){te.call(this,"d")}g(kt,te);function xr(){te.call(this,"c")}g(xr,te);var Vn={},Lc=null;function Mc(){return Lc=Lc||new it}Vn.La="serverreachability";function ox(c){te.call(this,Vn.La,c)}g(ox,te);function hl(c){const m=Mc();Ue(m,new ox(m))}Vn.STAT_EVENT="statevent";function ax(c,m){te.call(this,Vn.STAT_EVENT,c),this.stat=m}g(ax,te);function nn(c){const m=Mc();Ue(m,new ax(m,c))}Vn.Ma="timingevent";function lx(c,m){te.call(this,Vn.Ma,c),this.size=m}g(lx,te);function fl(c,m){if(typeof c!="function")throw Error("Fn must not be null and must be a function");return a.setTimeout(function(){c()},m)}function pl(){this.g=!0}pl.prototype.xa=function(){this.g=!1};function Z2(c,m,E,R,V,j){c.info(function(){if(c.g)if(j)for(var K="",Me=j.split("&"),Nt=0;NtR.length)){var V=R[1];if(Array.isArray(V)&&!(1>V.length)){var j=V[0];if(j!="noop"&&j!="stop"&&j!="close")for(var K=1;KBt)&&(Bt!=3||this.g&&(this.h.h||this.g.oa()||Dx(this.g)))){this.J||Bt!=4||m==7||(m==8||0>=No?hl(3):hl(2)),Rp(this);var E=this.g.Z();this.X=E;t:if(fx(this)){var R=Dx(this.g);c="";var V=R.length,j=Wr(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){Mi(this),ml(this);var K="";break t}this.h.i=new a.TextDecoder}for(m=0;mm.length?Pp:(m=m.slice(R,R+E),c.C=R+E,m)))}Ss.prototype.cancel=function(){this.J=!0,Mi(this)};function Fc(c){c.S=Date.now()+c.I,px(c,c.I)}function px(c,m){if(c.B!=null)throw Error("WatchDog timer not null");c.B=fl(f(c.ba,c),m)}function Rp(c){c.B&&(a.clearTimeout(c.B),c.B=null)}Ss.prototype.ba=function(){this.B=null;const c=Date.now();0<=c-this.S?(tD(this.i,this.A),this.L!=2&&(hl(),nn(17)),Mi(this),this.s=2,ml(this)):px(this,this.S-c)};function ml(c){c.j.G==0||c.J||Ux(c.j,c)}function Mi(c){Rp(c);var m=c.M;m&&typeof m.ma=="function"&&m.ma(),c.M=null,bs(c.U),c.g&&(m=c.g,c.g=null,m.abort(),m.ma())}function kp(c,m){try{var E=c.j;if(E.G!=0&&(E.g==c||Np(E.h,c))){if(!c.K&&Np(E.h,c)&&E.G==3){try{var R=E.Da.g.parse(m)}catch{R=null}if(Array.isArray(R)&&R.length==3){var V=R;if(V[0]==0){e:if(!E.u){if(E.g)if(E.g.F+3e3V[2]&&E.F&&E.v==0&&!E.C&&(E.C=fl(f(E.Za,E),6e3));if(1>=yx(E.h)&&E.ca){try{E.ca()}catch{}E.ca=void 0}}else ji(E,11)}else if((c.K||E.g==c)&&Gc(E),!x(m))for(V=E.Da.g.parse(m),m=0;m=c.j:!1}function yx(c){return c.h?1:c.g?c.g.size:0}function Np(c,m){return c.h?c.h==m:c.g?c.g.has(m):!1}function Dp(c,m){c.g?c.g.add(m):c.h=m}function vx(c,m){c.h&&c.h==m?c.h=null:c.g&&c.g.has(m)&&c.g.delete(m)}mx.prototype.cancel=function(){if(this.i=wx(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const c of this.g.values())c.cancel();this.g.clear()}};function wx(c){if(c.h!=null)return c.i.concat(c.h.D);if(c.g!=null&&c.g.size!==0){let m=c.i;for(const E of c.g.values())m=m.concat(E.D);return m}return w(c.i)}function iD(c){if(c.V&&typeof c.V=="function")return c.V();if(typeof Map<"u"&&c instanceof Map||typeof Set<"u"&&c instanceof Set)return Array.from(c.values());if(typeof c=="string")return c.split("");if(l(c)){for(var m=[],E=c.length,R=0;Rm)throw Error("Bad port number "+m);c.s=m}else c.s=null}function Ex(c,m,E){m instanceof vl?(c.i=m,fD(c.i,c.h)):(E||(m=yl(m,dD)),c.i=new vl(m,c.h))}function $e(c,m,E){c.i.set(m,E)}function Bc(c){return $e(c,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),c}function gl(c,m){return c?m?decodeURI(c.replace(/%25/g,"%2525")):decodeURIComponent(c):""}function yl(c,m,E){return typeof c=="string"?(c=encodeURI(c).replace(m,lD),E&&(c=c.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),c):null}function lD(c){return c=c.charCodeAt(0),"%"+(c>>4&15).toString(16)+(c&15).toString(16)}var Tx=/[#\/\?@]/g,uD=/[#\?:]/g,cD=/[#\?]/g,dD=/[#\?@]/g,hD=/#/g;function vl(c,m){this.h=this.g=null,this.i=c||null,this.j=!!m}function Cs(c){c.g||(c.g=new Map,c.h=0,c.i&&aD(c.i,function(m,E){c.add(decodeURIComponent(m.replace(/\+/g," ")),E)}))}t=vl.prototype,t.add=function(c,m){Cs(this),this.i=null,c=Ro(this,c);var E=this.g.get(c);return E||this.g.set(c,E=[]),E.push(m),this.h+=1,this};function bx(c,m){Cs(c),m=Ro(c,m),c.g.has(m)&&(c.i=null,c.h-=c.g.get(m).length,c.g.delete(m))}function Sx(c,m){return Cs(c),m=Ro(c,m),c.g.has(m)}t.forEach=function(c,m){Cs(this),this.g.forEach(function(E,R){E.forEach(function(V){c.call(m,V,R,this)},this)},this)},t.na=function(){Cs(this);const c=Array.from(this.g.values()),m=Array.from(this.g.keys()),E=[];for(let R=0;R{R.abort(),Is(E,"TestPingServer: timeout",!1,m)},1e4);fetch(c,{signal:R.signal}).then(j=>{clearTimeout(V),j.ok?Is(E,"TestPingServer: ok",!0,m):Is(E,"TestPingServer: server error",!1,m)}).catch(()=>{clearTimeout(V),Is(E,"TestPingServer: error",!1,m)})}function Is(c,m,E,R,V){try{V&&(V.onload=null,V.onerror=null,V.onabort=null,V.ontimeout=null),R(E)}catch{}}function gD(){this.g=new dl}function yD(c,m,E){const R=E||"";try{xx(c,function(V,j){let K=V;u(V)&&(K=zr(V)),m.push(R+j+"="+encodeURIComponent(K))})}catch(V){throw m.push(R+"type="+encodeURIComponent("_badmap")),V}}function zc(c){this.l=c.Ub||null,this.j=c.eb||!1}g(zc,ae),zc.prototype.g=function(){return new Hc(this.l,this.j)},zc.prototype.i=function(c){return function(){return c}}({});function Hc(c,m){it.call(this),this.D=c,this.o=m,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}g(Hc,it),t=Hc.prototype,t.open=function(c,m){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=c,this.A=m,this.readyState=1,xl(this)},t.send=function(c){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const m={headers:this.u,method:this.B,credentials:this.m,cache:void 0};c&&(m.body=c),(this.D||a).fetch(new Request(this.A,m)).then(this.Sa.bind(this),this.ga.bind(this))},t.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,wl(this)),this.readyState=0},t.Sa=function(c){if(this.g&&(this.l=c,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=c.headers,this.readyState=2,xl(this)),this.g&&(this.readyState=3,xl(this),this.g)))if(this.responseType==="arraybuffer")c.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof a.ReadableStream<"u"&&"body"in c){if(this.j=c.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;Ix(this)}else c.text().then(this.Ra.bind(this),this.ga.bind(this))};function Ix(c){c.j.read().then(c.Pa.bind(c)).catch(c.ga.bind(c))}t.Pa=function(c){if(this.g){if(this.o&&c.value)this.response.push(c.value);else if(!this.o){var m=c.value?c.value:new Uint8Array(0);(m=this.v.decode(m,{stream:!c.done}))&&(this.response=this.responseText+=m)}c.done?wl(this):xl(this),this.readyState==3&&Ix(this)}},t.Ra=function(c){this.g&&(this.response=this.responseText=c,wl(this))},t.Qa=function(c){this.g&&(this.response=c,wl(this))},t.ga=function(){this.g&&wl(this)};function wl(c){c.readyState=4,c.l=null,c.j=null,c.v=null,xl(c)}t.setRequestHeader=function(c,m){this.u.append(c,m)},t.getResponseHeader=function(c){return this.h&&this.h.get(c.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const c=[],m=this.h.entries();for(var E=m.next();!E.done;)E=E.value,c.push(E[0]+": "+E[1]),E=m.next();return c.join(`\r `)};function xl(c){c.onreadystatechange&&c.onreadystatechange.call(c)}Object.defineProperty(Hc.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(c){this.m=c?"include":"same-origin"}});function Px(c){let m="";return L(c,function(E,R){m+=R,m+=":",m+=E,m+=`\r `}),m}function Op(c,m,E){e:{for(R in E){var R=!1;break e}R=!0}R||(E=Px(E),typeof c=="string"?E!=null&&encodeURIComponent(String(E)):$e(c,m,E))}function ot(c){it.call(this),this.headers=new Map,this.o=c||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}g(ot,it);var vD=/^https?$/i,wD=["POST","PUT"];t=ot.prototype,t.Ha=function(c){this.J=c},t.ea=function(c,m,E,R){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+c);m=m?m.toUpperCase():"GET",this.D=c,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Ip.g(),this.v=this.o?Re(this.o):Re(Ip),this.g.onreadystatechange=f(this.Ea,this);try{this.B=!0,this.g.open(m,String(c),!0),this.B=!1}catch(j){Ax(this,j);return}if(c=E||"",E=new Map(this.headers),R)if(Object.getPrototypeOf(R)===Object.prototype)for(var V in R)E.set(V,R[V]);else if(typeof R.keys=="function"&&typeof R.get=="function")for(const j of R.keys())E.set(j,R.get(j));else throw Error("Unknown input type for opt_headers: "+String(R));R=Array.from(E.keys()).find(j=>j.toLowerCase()=="content-type"),V=a.FormData&&c instanceof a.FormData,!(0<=Array.prototype.indexOf.call(wD,m,void 0))||R||V||E.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[j,K]of E)this.g.setRequestHeader(j,K);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{Nx(this),this.u=!0,this.g.send(c),this.u=!1}catch(j){Ax(this,j)}};function Ax(c,m){c.h=!1,c.g&&(c.j=!0,c.g.abort(),c.j=!1),c.l=m,c.m=5,Rx(c),Wc(c)}function Rx(c){c.A||(c.A=!0,Ue(c,"complete"),Ue(c,"error"))}t.abort=function(c){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=c||7,Ue(this,"complete"),Ue(this,"abort"),Wc(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),Wc(this,!0)),ot.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?kx(this):this.bb())},t.bb=function(){kx(this)};function kx(c){if(c.h&&typeof o<"u"&&(!c.v[1]||Wr(c)!=4||c.Z()!=2)){if(c.u&&Wr(c)==4)xn(c.Ea,0,c);else if(Ue(c,"readystatechange"),Wr(c)==4){c.h=!1;try{const K=c.Z();e:switch(K){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var m=!0;break e;default:m=!1}var E;if(!(E=m)){var R;if(R=K===0){var V=String(c.D).match(_x)[1]||null;!V&&a.self&&a.self.location&&(V=a.self.location.protocol.slice(0,-1)),R=!vD.test(V?V.toLowerCase():"")}E=R}if(E)Ue(c,"complete"),Ue(c,"success");else{c.m=6;try{var j=2{}:null;c.g=null,c.v=null,m||Ue(c,"ready");try{E.onreadystatechange=R}catch{}}}function Nx(c){c.I&&(a.clearTimeout(c.I),c.I=null)}t.isActive=function(){return!!this.g};function Wr(c){return c.g?c.g.readyState:0}t.Z=function(){try{return 2=c.h.j-(c.s?1:0)?!1:c.s?(c.i=m.D.concat(c.i),!0):c.G==1||c.G==2||c.B>=(c.Va?0:c.Wa)?!1:(c.s=fl(f(c.Ga,c,m),$x(c,c.B)),c.B++,!0)}t.Ga=function(c){if(this.s)if(this.s=null,this.G==1){if(!c){this.U=Math.floor(1e5*Math.random()),c=this.U++;const V=new Ss(this,this.j,c);let j=this.o;if(this.S&&(j?(j=S(j),P(j,this.S)):j=this.S),this.m!==null||this.O||(V.H=j,j=null),this.P)e:{for(var m=0,E=0;ECe)j=Math.max(0,V[Nt].g-100),Me=!1;else try{yD($t,K,"req"+Ce+"_")}catch{R&&R($t)}}if(Me){R=K.join("&");break e}}}return c=c.i.splice(0,E),m.D=c,R}function jx(c){if(!c.g&&!c.u){c.Y=1;var m=c.Fa;G||Q(),M||(G(),M=!0),B.add(m,c),c.v=0}}function Mp(c){return c.g||c.u||3<=c.v?!1:(c.Y++,c.u=fl(f(c.Fa,c),$x(c,c.v)),c.v++,!0)}t.Fa=function(){if(this.u=null,Fx(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var c=2*this.R;this.j.info("BP detection timer enabled: "+c),this.A=fl(f(this.ab,this),c)}},t.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,nn(10),qc(this),Fx(this))};function Vp(c){c.A!=null&&(a.clearTimeout(c.A),c.A=null)}function Fx(c){c.g=new Ss(c,c.j,"rpc",c.Y),c.m===null&&(c.g.H=c.o),c.g.O=0;var m=Hr(c.qa);$e(m,"RID","rpc"),$e(m,"SID",c.K),$e(m,"AID",c.T),$e(m,"CI",c.F?"0":"1"),!c.F&&c.ja&&$e(m,"TO",c.ja),$e(m,"TYPE","xmlhttp"),El(c,m),c.m&&c.o&&Op(m,c.m,c.o),c.L&&(c.g.I=c.L);var E=c.g;c=c.ia,E.L=1,E.v=Bc(Hr(m)),E.m=null,E.P=!0,hx(E,c)}t.Za=function(){this.C!=null&&(this.C=null,qc(this),Mp(this),nn(19))};function Gc(c){c.C!=null&&(a.clearTimeout(c.C),c.C=null)}function Ux(c,m){var E=null;if(c.g==m){Gc(c),Vp(c),c.g=null;var R=2}else if(Np(c.h,m))E=m.D,vx(c.h,m),R=1;else return;if(c.G!=0){if(m.o)if(R==1){E=m.m?m.m.length:0,m=Date.now()-m.F;var V=c.B;R=Mc(),Ue(R,new lx(R,E)),Kc(c)}else jx(c);else if(V=m.s,V==3||V==0&&0`${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 oo{constructor(){this.promise=new Promise((e,n)=>{this.resolve=e,this.reject=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 gR{constructor(e,n){this.user=n,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class YU{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,n){e.enqueueRetryable(()=>n(Gt.UNAUTHENTICATED))}shutdown(){}}class XU{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,n){this.changeListener=n,e.enqueueRetryable(()=>n(this.token.user))}shutdown(){this.changeListener=null}}class JU{constructor(e){this.t=e,this.currentUser=Gt.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,n){ke(this.o===void 0,42304);let r=this.i;const s=l=>this.i!==r?(r=this.i,n(l)):Promise.resolve();let i=new oo;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new oo,e.enqueueRetryable(()=>s(this.currentUser))};const o=()=>{const l=i;e.enqueueRetryable(async()=>{await l.promise,await s(this.currentUser)})},a=l=>{J("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=l,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(l=>a(l)),setTimeout(()=>{if(!this.auth){const l=this.t.getImmediate({optional:!0});l?a(l):(J("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new oo)}},0),o()}getToken(){const e=this.i,n=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(n).then(r=>this.i!==e?(J("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(ke(typeof r.accessToken=="string",31837,{l:r}),new gR(r.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",2055,{h:e}),new Gt(e)}}class ZU{constructor(e,n,r){this.P=e,this.T=n,this.I=r,this.type="FirstParty",this.user=Gt.FIRST_PARTY,this.A=new Map}R(){return this.I?this.I():null}get headers(){this.A.set("X-Goog-AuthUser",this.P);const e=this.R();return e&&this.A.set("Authorization",e),this.T&&this.A.set("X-Goog-Iam-Authorization-Token",this.T),this.A}}class e${constructor(e,n,r){this.P=e,this.T=n,this.I=r}getToken(){return Promise.resolve(new ZU(this.P,this.T,this.I))}start(e,n){e.enqueueRetryable(()=>n(Gt.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class xT{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 t${constructor(e,n){this.V=n,this.forceRefresh=!1,this.appCheck=null,this.m=null,this.p=null,Sn(e)&&e.settings.appCheckToken&&(this.p=e.settings.appCheckToken)}start(e,n){ke(this.o===void 0,3512);const r=i=>{i.error!=null&&J("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const o=i.token!==this.m;return this.m=i.token,J("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?n(i.token):Promise.resolve()};this.o=i=>{e.enqueueRetryable(()=>r(i))};const s=i=>{J("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.o&&this.appCheck.addTokenListener(this.o)};this.V.onInit(i=>s(i)),setTimeout(()=>{if(!this.appCheck){const i=this.V.getImmediate({optional:!0});i?s(i):J("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){if(this.p)return Promise.resolve(new xT(this.p));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(n=>n?(ke(typeof n.token=="string",44558,{tokenResult:n}),this.m=n.token,new xT(n.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 n$(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),n=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(n);else for(let r=0;re?1:0}function yy(t,e){let n=0;for(;n65535?2:1}return pe(t.length,e.length)}function _T(t,e){return t.codePointAt(e)>65535?t.substring(e,e+2):t.substring(e,e+1)}function r$(t,e){for(let n=0;nn(r,e[s]))}/** * @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 ET=-62135596800,TT=1e6;class bt{static now(){return bt.fromMillis(Date.now())}static fromDate(e){return bt.fromMillis(e.getTime())}static fromMillis(e){const n=Math.floor(e/1e3),r=Math.floor((e-1e3*n)*TT);return new bt(n,r)}constructor(e,n){if(this.seconds=e,this.nanoseconds=n,n<0)throw new ne($.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(n>=1e9)throw new ne($.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+n);if(e=253402300800)throw new ne($.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/TT}_compareTo(e){return this.seconds===e.seconds?pe(this.nanoseconds,e.nanoseconds):pe(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-ET;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 de{static fromTimestamp(e){return new de(e)}static min(){return new de(new bt(0,0))}static max(){return new de(new bt(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 bT="__name__";class br{constructor(e,n,r){n===void 0?n=0:n>e.length&&oe(637,{offset:n,range:e.length}),r===void 0?r=e.length-n:r>e.length-n&&oe(1746,{length:r,range:e.length-n}),this.segments=e,this.offset=n,this.len=r}get length(){return this.len}isEqual(e){return br.comparator(this,e)===0}child(e){const n=this.segments.slice(this.offset,this.limit());return e instanceof br?e.forEach(r=>{n.push(r)}):n.push(e),this.construct(n)}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=0)throw new ne($.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);n.push(...r.split("/").filter(s=>s.length>0))}return new He(n)}static emptyPath(){return new He([])}}const s$=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Mt extends br{construct(e,n,r){return new Mt(e,n,r)}static isValidIdentifier(e){return s$.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Mt.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===bT}static keyField(){return new Mt([bT])}static fromServerFormat(e){const n=[];let r="",s=0;const i=()=>{if(r.length===0)throw new ne($.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);n.push(r),r=""};let o=!1;for(;s=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&&He.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,n){return He.comparator(e.path,n.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new se(new He(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 Hu=-1;function i$(t,e){const n=t.toTimestamp().seconds,r=t.toTimestamp().nanoseconds+1,s=de.fromTimestamp(r===1e9?new bt(n+1,0):new bt(n,r));return new wi(s,se.empty(),e)}function o$(t){return new wi(t.readTime,t.key,Hu)}class wi{constructor(e,n,r){this.readTime=e,this.documentKey=n,this.largestBatchId=r}static min(){return new wi(de.min(),se.empty(),Hu)}static max(){return new wi(de.max(),se.empty(),Hu)}}function a$(t,e){let n=t.readTime.compareTo(e.readTime);return n!==0?n:(n=se.comparator(t.documentKey,e.documentKey),n!==0?n:pe(t.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 l$="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class u${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 sl(t){if(t.code!==$.FAILED_PRECONDITION||t.message!==l$)throw t;J("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 U{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(n=>{this.isDone=!0,this.result=n,this.nextCallback&&this.nextCallback(n)},n=>{this.isDone=!0,this.error=n,this.catchCallback&&this.catchCallback(n)})}catch(e){return this.next(void 0,e)}next(e,n){return this.callbackAttached&&oe(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(n,this.error):this.wrapSuccess(e,this.result):new U((r,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(r,s)},this.catchCallback=i=>{this.wrapFailure(n,i).next(r,s)}})}toPromise(){return new Promise((e,n)=>{this.next(e,n)})}wrapUserFunction(e){try{const n=e();return n instanceof U?n:U.resolve(n)}catch(n){return U.reject(n)}}wrapSuccess(e,n){return e?this.wrapUserFunction(()=>e(n)):U.resolve(n)}wrapFailure(e,n){return e?this.wrapUserFunction(()=>e(n)):U.reject(n)}static resolve(e){return new U((n,r)=>{n(e)})}static reject(e){return new U((n,r)=>{r(e)})}static waitFor(e){return new U((n,r)=>{let s=0,i=0,o=!1;e.forEach(a=>{++s,a.next(()=>{++i,o&&i===s&&n()},l=>r(l))}),o=!0,i===s&&n()})}static or(e){let n=U.resolve(!1);for(const r of e)n=n.next(s=>s?U.resolve(s):r());return n}static forEach(e,n){const r=[];return e.forEach((s,i)=>{r.push(n.call(this,s,i))}),this.waitFor(r)}static mapArray(e,n){return new U((r,s)=>{const i=e.length,o=new Array(i);let a=0;for(let l=0;l{o[u]=d,++a,a===i&&r(o)},d=>s(d))}})}static doWhile(e,n){return new U((r,s)=>{const i=()=>{e()===!0?n().next(()=>{i()},s):r()};i()})}}function c$(t){const e=t.match(/Android ([\d.]+)/i),n=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(n)}function il(t){return t.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 rp{constructor(e,n){this.previousValue=e,n&&(n.sequenceNumberHandler=r=>this.ue(r),this.ce=r=>n.writeSequenceNumber(r))}ue(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.ce&&this.ce(e),e}}rp.le=-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 U0=-1;function sp(t){return t==null}function Qh(t){return t===0&&1/t==-1/0}function d$(t){return typeof t=="number"&&Number.isInteger(t)&&!Qh(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=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 wR="";function h$(t){let e="";for(let n=0;n0&&(e=ST(e)),e=f$(t.get(n),e);return ST(e)}function f$(t,e){let n=e;const r=t.length;for(let s=0;s0&&(n=n.right)}return null}indexOf(e){let n=0,r=this.root;for(;!r.isEmpty();){const s=this.comparator(e,r.key);if(s===0)return n+r.left.size;s<0?r=r.left:(n+=r.left.size+1,r=r.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((n,r)=>(e(n,r),!1))}toString(){const e=[];return this.inorderTraversal((n,r)=>(e.push(`${n}:${r}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new Td(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new Td(this.root,e,this.comparator,!1)}getReverseIterator(){return new Td(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new Td(this.root,e,this.comparator,!0)}}class Td{constructor(e,n,r,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=n?r(e.key,n):1,n&&s&&(i*=-1),i<0)e=this.isReverse?e.left:e.right;else{if(i===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const n={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 n}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 Lt{constructor(e,n,r,s,i){this.key=e,this.value=n,this.color=r??Lt.RED,this.left=s??Lt.EMPTY,this.right=i??Lt.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,n,r,s,i){return new Lt(e??this.key,n??this.value,r??this.color,s??this.left,i??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,n,r){let s=this;const i=r(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,n,r),null):i===0?s.copy(null,n,null,null,null):s.copy(null,null,null,null,s.right.insert(e,n,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return Lt.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,n){let r,s=this;if(n(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,n),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),n(e,s.key)===0){if(s.right.isEmpty())return Lt.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,n))}return s.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,Lt.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Lt.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),n=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,n)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw oe(43730,{key:this.key,value:this.value});if(this.right.isRed())throw oe(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw oe(27949);return e+(this.isRed()?0:1)}}Lt.EMPTY=null,Lt.RED=!0,Lt.BLACK=!1;Lt.EMPTY=new class{constructor(){this.size=0}get key(){throw oe(57766)}get value(){throw oe(16141)}get color(){throw oe(16727)}get left(){throw oe(29726)}get right(){throw oe(36894)}copy(e,n,r,s,i){return this}insert(e,n,r){return new Lt(e,n)}remove(e,n){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 St{constructor(e){this.comparator=e,this.data=new rt(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((n,r)=>(e(n),!1))}forEachInRange(e,n){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;n(s.key)}}forEachWhile(e,n){let r;for(r=n!==void 0?this.data.getIteratorFrom(n):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const n=this.data.getIteratorFrom(e);return n.hasNext()?n.getNext().key:null}getIterator(){return new IT(this.data.getIterator())}getIteratorFrom(e){return new IT(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 n=this;return n.size{n=n.add(r)}),n}isEqual(e){if(!(e instanceof St)||this.size!==e.size)return!1;const n=this.data.getIterator(),r=e.data.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(this.comparator(s,i)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(n=>{e.push(n)}),e}toString(){const e=[];return this.forEach(n=>e.push(n)),"SortedSet("+e.toString()+")"}copy(e){const n=new St(this.comparator);return n.data=e,n}}class IT{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 In{constructor(e){this.fields=e,e.sort(Mt.comparator)}static empty(){return new In([])}unionWith(e){let n=new St(Mt.comparator);for(const r of this.fields)n=n.add(r);for(const r of e)n=n.add(r);return new In(n.toArray())}covers(e){for(const n of this.fields)if(n.isPrefixOf(e))return!0;return!1}isEqual(e){return Fa(this.fields,e.fields,(n,r)=>n.isEqual(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 _R 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 Ft{constructor(e){this.binaryString=e}static fromBase64String(e){const n=function(s){try{return atob(s)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new _R("Invalid base64 string: "+i):i}}(e);return new Ft(n)}static fromUint8Array(e){const n=function(s){let i="";for(let o=0;oeFr(n,e))!==void 0}function Ua(t,e){if(t===e)return 0;const n=Ei(t),r=Ei(e);if(n!==r)return pe(n,r);switch(n){case 0:case 9007199254740991:return 0;case 1:return pe(t.booleanValue,e.booleanValue);case 2:return function(i,o){const a=dt(i.integerValue||i.doubleValue),l=dt(o.integerValue||o.doubleValue);return al?1:a===l?0:isNaN(a)?isNaN(l)?0:-1:1}(t,e);case 3:return PT(t.timestampValue,e.timestampValue);case 4:return PT(Wu(t),Wu(e));case 5:return yy(t.stringValue,e.stringValue);case 6:return function(i,o){const a=_i(i),l=_i(o);return a.compareTo(l)}(t.bytesValue,e.bytesValue);case 7:return function(i,o){const a=i.split("/"),l=o.split("/");for(let u=0;us+eh(i),0)}(t.arrayValue);case 10:case 11:return function(r){let s=0;return ki(r.fields,(i,o)=>{s+=i.length+eh(o)}),s}(t.mapValue);default:throw oe(13486,{value:t})}}function RT(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function wy(t){return!!t&&"integerValue"in t}function B0(t){return!!t&&"arrayValue"in t}function kT(t){return!!t&&"nullValue"in t}function NT(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function th(t){return!!t&&"mapValue"in t}function y$(t){var e,n;return((n=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{})[CR])===null||n===void 0?void 0:n.stringValue)===IR}function iu(t){if(t.geoPointValue)return{geoPointValue:Object.assign({},t.geoPointValue)};if(t.timestampValue&&typeof t.timestampValue=="object")return{timestampValue:Object.assign({},t.timestampValue)};if(t.mapValue){const e={mapValue:{fields:{}}};return ki(t.mapValue.fields,(n,r)=>e.mapValue.fields[n]=iu(r)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let n=0;n<(t.arrayValue.values||[]).length;++n)e.arrayValue.values[n]=iu(t.arrayValue.values[n]);return e}return Object.assign({},t)}function v$(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue===g$}/** * @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 pn{constructor(e){this.value=e}static empty(){return new pn({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let n=this.value;for(let r=0;r{if(!n.isImmediateParentOf(a)){const l=this.getFieldsMap(n);this.applyChanges(l,r,s),r={},s=[],n=a.popLast()}o?r[a.lastSegment()]=iu(o):s.push(a.lastSegment())});const i=this.getFieldsMap(n);this.applyChanges(i,r,s)}delete(e){const n=this.field(e.popLast());th(n)&&n.mapValue.fields&&delete n.mapValue.fields[e.lastSegment()]}isEqual(e){return Fr(this.value,e.value)}getFieldsMap(e){let n=this.value;n.mapValue.fields||(n.mapValue={fields:{}});for(let r=0;re[s]=i);for(const s of r)delete e[s]}clone(){return new pn(iu(this.value))}}function PR(t){const e=[];return ki(t.fields,(n,r)=>{const s=new Mt([n]);if(th(r)){const i=PR(r.mapValue).fields;if(i.length===0)e.push(s);else for(const o of i)e.push(s.child(o))}else e.push(s)}),new In(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 Yt{constructor(e,n,r,s,i,o,a){this.key=e,this.documentType=n,this.version=r,this.readTime=s,this.createTime=i,this.data=o,this.documentState=a}static newInvalidDocument(e){return new Yt(e,0,de.min(),de.min(),de.min(),pn.empty(),0)}static newFoundDocument(e,n,r,s){return new Yt(e,1,n,de.min(),r,s,0)}static newNoDocument(e,n){return new Yt(e,2,n,de.min(),de.min(),pn.empty(),0)}static newUnknownDocument(e,n){return new Yt(e,3,n,de.min(),de.min(),pn.empty(),2)}convertToFoundDocument(e,n){return!this.createTime.isEqual(de.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=n,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=pn.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=pn.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=de.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 Yt&&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 Yt(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 Jh{constructor(e,n){this.position=e,this.inclusive=n}}function DT(t,e,n){let r=0;for(let s=0;s":return e>0;case">=":return e>=0;default:return oe(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class yr extends AR{constructor(e,n){super(),this.filters=e,this.op=n,this.Te=null}static create(e,n){return new yr(e,n)}matches(e){return RR(this)?this.filters.find(n=>!n.matches(e))===void 0:this.filters.find(n=>n.matches(e))!==void 0}getFlattenedFilters(){return this.Te!==null||(this.Te=this.filters.reduce((e,n)=>e.concat(n.getFlattenedFilters()),[])),this.Te}getFilters(){return Object.assign([],this.filters)}}function RR(t){return t.op==="and"}function kR(t){return x$(t)&&RR(t)}function x$(t){for(const e of t.filters)if(e instanceof yr)return!1;return!0}function xy(t){if(t instanceof wt)return t.field.canonicalString()+t.op.toString()+$a(t.value);if(kR(t))return t.filters.map(e=>xy(e)).join(",");{const e=t.filters.map(n=>xy(n)).join(",");return`${t.op}(${e})`}}function NR(t,e){return t instanceof wt?function(r,s){return s instanceof wt&&r.op===s.op&&r.field.isEqual(s.field)&&Fr(r.value,s.value)}(t,e):t instanceof yr?function(r,s){return s instanceof yr&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce((i,o,a)=>i&&NR(o,s.filters[a]),!0):!1}(t,e):void oe(19439)}function DR(t){return t instanceof wt?function(n){return`${n.field.canonicalString()} ${n.op} ${$a(n.value)}`}(t):t instanceof yr?function(n){return n.op.toString()+" {"+n.getFilters().map(DR).join(" ,")+"}"}(t):"Filter"}class _$ extends wt{constructor(e,n,r){super(e,n,r),this.key=se.fromName(r.referenceValue)}matches(e){const n=se.comparator(e.key,this.key);return this.matchesComparison(n)}}class E$ extends wt{constructor(e,n){super(e,"in",n),this.keys=OR("in",n)}matches(e){return this.keys.some(n=>n.isEqual(e.key))}}class T$ extends wt{constructor(e,n){super(e,"not-in",n),this.keys=OR("not-in",n)}matches(e){return!this.keys.some(n=>n.isEqual(e.key))}}function OR(t,e){var n;return(((n=e.arrayValue)===null||n===void 0?void 0:n.values)||[]).map(r=>se.fromName(r.referenceValue))}class b$ extends wt{constructor(e,n){super(e,"array-contains",n)}matches(e){const n=e.data.field(this.field);return B0(n)&&Ku(n.arrayValue,this.value)}}class S$ extends wt{constructor(e,n){super(e,"in",n)}matches(e){const n=e.data.field(this.field);return n!==null&&Ku(this.value.arrayValue,n)}}class C$ extends wt{constructor(e,n){super(e,"not-in",n)}matches(e){if(Ku(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const n=e.data.field(this.field);return n!==null&&n.nullValue===void 0&&!Ku(this.value.arrayValue,n)}}class I$ extends wt{constructor(e,n){super(e,"array-contains-any",n)}matches(e){const n=e.data.field(this.field);return!(!B0(n)||!n.arrayValue.values)&&n.arrayValue.values.some(r=>Ku(this.value.arrayValue,r))}}/** * @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 P${constructor(e,n=null,r=[],s=[],i=null,o=null,a=null){this.path=e,this.collectionGroup=n,this.orderBy=r,this.filters=s,this.limit=i,this.startAt=o,this.endAt=a,this.Ie=null}}function LT(t,e=null,n=[],r=[],s=null,i=null,o=null){return new P$(t,e,n,r,s,i,o)}function z0(t){const e=he(t);if(e.Ie===null){let n=e.path.canonicalString();e.collectionGroup!==null&&(n+="|cg:"+e.collectionGroup),n+="|f:",n+=e.filters.map(r=>xy(r)).join(","),n+="|ob:",n+=e.orderBy.map(r=>function(i){return i.field.canonicalString()+i.dir}(r)).join(","),sp(e.limit)||(n+="|l:",n+=e.limit),e.startAt&&(n+="|lb:",n+=e.startAt.inclusive?"b:":"a:",n+=e.startAt.position.map(r=>$a(r)).join(",")),e.endAt&&(n+="|ub:",n+=e.endAt.inclusive?"a:":"b:",n+=e.endAt.position.map(r=>$a(r)).join(",")),e.Ie=n}return e.Ie}function H0(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let n=0;n0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let a=new St(Mt.comparator);return o.filters.forEach(l=>{l.getFlattenedFilters().forEach(u=>{u.isInequality()&&(a=a.add(u.field))})}),a})(e).forEach(i=>{n.has(i.canonicalString())||i.isKeyField()||e.Ee.push(new Zh(i,r))}),n.has(Mt.keyField().canonicalString())||e.Ee.push(new Zh(Mt.keyField(),r))}return e.Ee}function Dr(t){const e=he(t);return e.de||(e.de=R$(e,ou(t))),e.de}function R$(t,e){if(t.limitType==="F")return LT(t.path,t.collectionGroup,e,t.filters,t.limit,t.startAt,t.endAt);{e=e.map(s=>{const i=s.dir==="desc"?"asc":"desc";return new Zh(s.field,i)});const n=t.endAt?new Jh(t.endAt.position,t.endAt.inclusive):null,r=t.startAt?new Jh(t.startAt.position,t.startAt.inclusive):null;return LT(t.path,t.collectionGroup,e,t.filters,t.limit,n,r)}}function Ey(t,e){const n=t.filters.concat([e]);return new bc(t.path,t.collectionGroup,t.explicitOrderBy.slice(),n,t.limit,t.limitType,t.startAt,t.endAt)}function Ty(t,e,n){return new bc(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,n,t.startAt,t.endAt)}function op(t,e){return H0(Dr(t),Dr(e))&&t.limitType===e.limitType}function MR(t){return`${z0(Dr(t))}|lt:${t.limitType}`}function Fo(t){return`Query(target=${function(n){let r=n.path.canonicalString();return n.collectionGroup!==null&&(r+=" collectionGroup="+n.collectionGroup),n.filters.length>0&&(r+=`, filters: [${n.filters.map(s=>DR(s)).join(", ")}]`),sp(n.limit)||(r+=", limit: "+n.limit),n.orderBy.length>0&&(r+=`, orderBy: [${n.orderBy.map(s=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(s)).join(", ")}]`),n.startAt&&(r+=", startAt: ",r+=n.startAt.inclusive?"b:":"a:",r+=n.startAt.position.map(s=>$a(s)).join(",")),n.endAt&&(r+=", endAt: ",r+=n.endAt.inclusive?"a:":"b:",r+=n.endAt.position.map(s=>$a(s)).join(",")),`Target(${r})`}(Dr(t))}; limitType=${t.limitType})`}function ap(t,e){return e.isFoundDocument()&&function(r,s){const i=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(i):se.isDocumentKey(r.path)?r.path.isEqual(i):r.path.isImmediateParentOf(i)}(t,e)&&function(r,s){for(const i of ou(r))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0}(t,e)&&function(r,s){for(const i of r.filters)if(!i.matches(s))return!1;return!0}(t,e)&&function(r,s){return!(r.startAt&&!function(o,a,l){const u=DT(o,a,l);return o.inclusive?u<=0:u<0}(r.startAt,ou(r),s)||r.endAt&&!function(o,a,l){const u=DT(o,a,l);return o.inclusive?u>=0:u>0}(r.endAt,ou(r),s))}(t,e)}function k$(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function VR(t){return(e,n)=>{let r=!1;for(const s of ou(t)){const i=N$(s,e,n);if(i!==0)return i;r=r||s.field.isKeyField()}return 0}}function N$(t,e,n){const r=t.field.isKeyField()?se.comparator(e.key,n.key):function(i,o,a){const l=o.data.field(i),u=a.data.field(i);return l!==null&&u!==null?Ua(l,u):oe(42886)}(t.field,e,n);switch(t.dir){case"asc":return r;case"desc":return-1*r;default:return oe(19790,{direction:t.dir})}}/** * @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 Io{constructor(e,n){this.mapKeyFn=e,this.equalsFn=n,this.inner={},this.innerSize=0}get(e){const n=this.mapKeyFn(e),r=this.inner[n];if(r!==void 0){for(const[s,i]of r)if(this.equalsFn(s,e))return i}}has(e){return this.get(e)!==void 0}set(e,n){const r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,n]],void this.innerSize++;for(let i=0;i{for(const[s,i]of r)e(s,i)})}isEmpty(){return xR(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 D$=new rt(se.comparator);function fs(){return D$}const jR=new rt(se.comparator);function Bl(...t){let e=jR;for(const n of t)e=e.insert(n.key,n);return e}function FR(t){let e=jR;return t.forEach((n,r)=>e=e.insert(n,r.overlayedDocument)),e}function Gi(){return au()}function UR(){return au()}function au(){return new Io(t=>t.toString(),(t,e)=>t.isEqual(e))}const O$=new rt(se.comparator),L$=new St(se.comparator);function xe(...t){let e=L$;for(const n of t)e=e.add(n);return e}const M$=new St(pe);function V$(){return M$}/** * @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 q0(t,e){if(t.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:Qh(e)?"-0":e}}function $R(t){return{integerValue:""+t}}function j$(t,e){return d$(e)?$R(e):q0(t,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 lp{constructor(){this._=void 0}}function F$(t,e,n){return t instanceof ef?function(s,i){const o={fields:{[TR]:{stringValue:ER},[SR]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&$0(i)&&(i=ip(i)),i&&(o.fields[bR]=i),{mapValue:o}}(n,e):t instanceof Gu?zR(t,e):t instanceof Qu?HR(t,e):function(s,i){const o=BR(s,i),a=VT(o)+VT(s.Re);return wy(o)&&wy(s.Re)?$R(a):q0(s.serializer,a)}(t,e)}function U$(t,e,n){return t instanceof Gu?zR(t,e):t instanceof Qu?HR(t,e):n}function BR(t,e){return t instanceof tf?function(r){return wy(r)||function(i){return!!i&&"doubleValue"in i}(r)}(e)?e:{integerValue:0}:null}class ef extends lp{}class Gu extends lp{constructor(e){super(),this.elements=e}}function zR(t,e){const n=WR(e);for(const r of t.elements)n.some(s=>Fr(s,r))||n.push(r);return{arrayValue:{values:n}}}class Qu extends lp{constructor(e){super(),this.elements=e}}function HR(t,e){let n=WR(e);for(const r of t.elements)n=n.filter(s=>!Fr(s,r));return{arrayValue:{values:n}}}class tf extends lp{constructor(e,n){super(),this.serializer=e,this.Re=n}}function VT(t){return dt(t.integerValue||t.doubleValue)}function WR(t){return B0(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}function $$(t,e){return t.field.isEqual(e.field)&&function(r,s){return r instanceof Gu&&s instanceof Gu||r instanceof Qu&&s instanceof Qu?Fa(r.elements,s.elements,Fr):r instanceof tf&&s instanceof tf?Fr(r.Re,s.Re):r instanceof ef&&s instanceof ef}(t.transform,e.transform)}class B${constructor(e,n){this.version=e,this.transformResults=n}}class hr{constructor(e,n){this.updateTime=e,this.exists=n}static none(){return new hr}static exists(e){return new hr(void 0,e)}static updateTime(e){return new hr(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 nh(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class up{}function qR(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new K0(t.key,hr.none()):new Sc(t.key,t.data,hr.none());{const n=t.data,r=pn.empty();let s=new St(Mt.comparator);for(let i of e.fields)if(!s.has(i)){let o=n.field(i);o===null&&i.length>1&&(i=i.popLast(),o=n.field(i)),o===null?r.delete(i):r.set(i,o),s=s.add(i)}return new Ni(t.key,r,new In(s.toArray()),hr.none())}}function z$(t,e,n){t instanceof Sc?function(s,i,o){const a=s.value.clone(),l=FT(s.fieldTransforms,i,o.transformResults);a.setAll(l),i.convertToFoundDocument(o.version,a).setHasCommittedMutations()}(t,e,n):t instanceof Ni?function(s,i,o){if(!nh(s.precondition,i))return void i.convertToUnknownDocument(o.version);const a=FT(s.fieldTransforms,i,o.transformResults),l=i.data;l.setAll(KR(s)),l.setAll(a),i.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,n):function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,n)}function lu(t,e,n,r){return t instanceof Sc?function(i,o,a,l){if(!nh(i.precondition,o))return a;const u=i.value.clone(),d=UT(i.fieldTransforms,l,o);return u.setAll(d),o.convertToFoundDocument(o.version,u).setHasLocalMutations(),null}(t,e,n,r):t instanceof Ni?function(i,o,a,l){if(!nh(i.precondition,o))return a;const u=UT(i.fieldTransforms,l,o),d=o.data;return d.setAll(KR(i)),d.setAll(u),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),a===null?null:a.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map(h=>h.field))}(t,e,n,r):function(i,o,a){return nh(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):a}(t,e,n)}function H$(t,e){let n=null;for(const r of t.fieldTransforms){const s=e.data.field(r.field),i=BR(r.transform,s||null);i!=null&&(n===null&&(n=pn.empty()),n.set(r.field,i))}return n||null}function jT(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&Fa(r,s,(i,o)=>$$(i,o))}(t.fieldTransforms,e.fieldTransforms)&&(t.type===0?t.value.isEqual(e.value):t.type!==1||t.data.isEqual(e.data)&&t.fieldMask.isEqual(e.fieldMask))}class Sc extends up{constructor(e,n,r,s=[]){super(),this.key=e,this.value=n,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class Ni extends up{constructor(e,n,r,s,i=[]){super(),this.key=e,this.data=n,this.fieldMask=r,this.precondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function KR(t){const e=new Map;return t.fieldMask.fields.forEach(n=>{if(!n.isEmpty()){const r=t.data.field(n);e.set(n,r)}}),e}function FT(t,e,n){const r=new Map;ke(t.length===n.length,32656,{Ve:n.length,me:t.length});for(let s=0;s{const i=e.get(s.key),o=i.overlayedDocument;let a=this.applyToLocalView(o,i.mutatedFields);a=n.has(s.key)?null:a;const l=qR(o,a);l!==null&&r.set(s.key,l),o.isValidDocument()||o.convertToNoDocument(de.min())}),r}keys(){return this.mutations.reduce((e,n)=>e.add(n.key),xe())}isEqual(e){return this.batchId===e.batchId&&Fa(this.mutations,e.mutations,(n,r)=>jT(n,r))&&Fa(this.baseMutations,e.baseMutations,(n,r)=>jT(n,r))}}class G0{constructor(e,n,r,s){this.batch=e,this.commitVersion=n,this.mutationResults=r,this.docVersions=s}static from(e,n,r){ke(e.mutations.length===r.length,58842,{fe:e.mutations.length,ge:r.length});let s=function(){return O$}();const i=e.mutations;for(let o=0;o=8)throw new zl(`Invalid padding: ${n}`);if(r<0)throw new zl(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new zl(`Invalid hash count: ${r}`);if(e.length===0&&n!==0)throw new zl(`Invalid padding when bitmap length is 0: ${n}`);this.pe=8*e.length-n,this.ye=ui.fromNumber(this.pe)}we(e,n,r){let s=e.add(n.multiply(ui.fromNumber(r)));return s.compare(Y$)===1&&(s=new ui([s.getBits(0),s.getBits(1)],0)),s.modulo(this.ye).toNumber()}be(e){return!!(this.bitmap[Math.floor(e/8)]&1<o.insert(a)),o}insert(e){if(this.pe===0)return;const n=$T(e),[r,s]=BT(n);for(let i=0;i0&&(this.Ne=!0,this.xe=e)}qe(){let e=xe(),n=xe(),r=xe();return this.Me.forEach((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:n=n.add(s);break;case 1:r=r.add(s);break;default:oe(38017,{changeType:i})}}),new Cc(this.xe,this.Oe,e,n,r)}Qe(){this.Ne=!1,this.Me=HT()}$e(e,n){this.Ne=!0,this.Me=this.Me.insert(e,n)}Ue(e){this.Ne=!0,this.Me=this.Me.remove(e)}Ke(){this.Fe+=1}We(){this.Fe-=1,ke(this.Fe>=0,3241,{Fe:this.Fe})}Ge(){this.Ne=!0,this.Oe=!0}}class X${constructor(e){this.ze=e,this.je=new Map,this.He=fs(),this.Je=Sd(),this.Ye=Sd(),this.Ze=new rt(pe)}Xe(e){for(const n of e.De)e.ve&&e.ve.isFoundDocument()?this.et(n,e.ve):this.tt(n,e.key,e.ve);for(const n of e.removedTargetIds)this.tt(n,e.key,e.ve)}nt(e){this.forEachTarget(e,n=>{const r=this.rt(n);switch(e.state){case 0:this.it(n)&&r.ke(e.resumeToken);break;case 1:r.We(),r.Be||r.Qe(),r.ke(e.resumeToken);break;case 2:r.We(),r.Be||this.removeTarget(n);break;case 3:this.it(n)&&(r.Ge(),r.ke(e.resumeToken));break;case 4:this.it(n)&&(this.st(n),r.ke(e.resumeToken));break;default:oe(56790,{state:e.state})}})}forEachTarget(e,n){e.targetIds.length>0?e.targetIds.forEach(n):this.je.forEach((r,s)=>{this.it(s)&&n(s)})}ot(e){const n=e.targetId,r=e.Ce.count,s=this._t(n);if(s){const i=s.target;if(_y(i))if(r===0){const o=new se(i.path);this.tt(n,o,Yt.newNoDocument(o,de.min()))}else ke(r===1,20013,{expectedCount:r});else{const o=this.ut(n);if(o!==r){const a=this.ct(e),l=a?this.lt(a,e,o):1;if(l!==0){this.st(n);const u=l===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Ze=this.Ze.insert(n,u)}}}}}ct(e){const n=e.Ce.unchangedNames;if(!n||!n.bits)return null;const{bits:{bitmap:r="",padding:s=0},hashCount:i=0}=n;let o,a;try{o=_i(r).toUint8Array()}catch(l){if(l instanceof _R)return ja("Decoding the base64 bloom filter in existence filter failed ("+l.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw l}try{a=new Q0(o,s,i)}catch(l){return ja(l instanceof zl?"BloomFilter error: ":"Applying bloom filter failed: ",l),null}return a.pe===0?null:a}lt(e,n,r){return n.Ce.count===r-this.Tt(e,n.targetId)?0:2}Tt(e,n){const r=this.ze.getRemoteKeysForTarget(n);let s=0;return r.forEach(i=>{const o=this.ze.Pt(),a=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(a)||(this.tt(n,i,null),s++)}),s}It(e){const n=new Map;this.je.forEach((i,o)=>{const a=this._t(o);if(a){if(i.current&&_y(a.target)){const l=new se(a.target.path);this.Et(l).has(o)||this.dt(o,l)||this.tt(o,l,Yt.newNoDocument(l,e))}i.Le&&(n.set(o,i.qe()),i.Qe())}});let r=xe();this.Ye.forEach((i,o)=>{let a=!0;o.forEachWhile(l=>{const u=this._t(l);return!u||u.purpose==="TargetPurposeLimboResolution"||(a=!1,!1)}),a&&(r=r.add(i))}),this.He.forEach((i,o)=>o.setReadTime(e));const s=new cp(e,n,this.Ze,this.He,r);return this.He=fs(),this.Je=Sd(),this.Ye=Sd(),this.Ze=new rt(pe),s}et(e,n){if(!this.it(e))return;const r=this.dt(e,n.key)?2:0;this.rt(e).$e(n.key,r),this.He=this.He.insert(n.key,n),this.Je=this.Je.insert(n.key,this.Et(n.key).add(e)),this.Ye=this.Ye.insert(n.key,this.At(n.key).add(e))}tt(e,n,r){if(!this.it(e))return;const s=this.rt(e);this.dt(e,n)?s.$e(n,1):s.Ue(n),this.Ye=this.Ye.insert(n,this.At(n).delete(e)),this.Ye=this.Ye.insert(n,this.At(n).add(e)),r&&(this.He=this.He.insert(n,r))}removeTarget(e){this.je.delete(e)}ut(e){const n=this.rt(e).qe();return this.ze.getRemoteKeysForTarget(e).size+n.addedDocuments.size-n.removedDocuments.size}Ke(e){this.rt(e).Ke()}rt(e){let n=this.je.get(e);return n||(n=new zT,this.je.set(e,n)),n}At(e){let n=this.Ye.get(e);return n||(n=new St(pe),this.Ye=this.Ye.insert(e,n)),n}Et(e){let n=this.Je.get(e);return n||(n=new St(pe),this.Je=this.Je.insert(e,n)),n}it(e){const n=this._t(e)!==null;return n||J("WatchChangeAggregator","Detected inactive target",e),n}_t(e){const n=this.je.get(e);return n&&n.Be?null:this.ze.Rt(e)}st(e){this.je.set(e,new zT),this.ze.getRemoteKeysForTarget(e).forEach(n=>{this.tt(e,n,null)})}dt(e,n){return this.ze.getRemoteKeysForTarget(e).has(n)}}function Sd(){return new rt(se.comparator)}function HT(){return new rt(se.comparator)}const J$={asc:"ASCENDING",desc:"DESCENDING"},Z$={"<":"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"},eB={and:"AND",or:"OR"};class tB{constructor(e,n){this.databaseId=e,this.useProto3Json=n}}function by(t,e){return t.useProto3Json||sp(e)?e:{value:e}}function nf(t,e){return t.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function XR(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function nB(t,e){return nf(t,e.toTimestamp())}function Or(t){return ke(!!t,49232),de.fromTimestamp(function(n){const r=xi(n);return new bt(r.seconds,r.nanos)}(t))}function Y0(t,e){return Sy(t,e).canonicalString()}function Sy(t,e){const n=function(s){return new He(["projects",s.projectId,"databases",s.database])}(t).child("documents");return e===void 0?n:n.child(e)}function JR(t){const e=He.fromString(t);return ke(rk(e),10190,{key:e.toString()}),e}function Cy(t,e){return Y0(t.databaseId,e.path)}function Pm(t,e){const n=JR(e);if(n.get(1)!==t.databaseId.projectId)throw new ne($.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+n.get(1)+" vs "+t.databaseId.projectId);if(n.get(3)!==t.databaseId.database)throw new ne($.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+n.get(3)+" vs "+t.databaseId.database);return new se(ek(n))}function ZR(t,e){return Y0(t.databaseId,e)}function rB(t){const e=JR(t);return e.length===4?He.emptyPath():ek(e)}function Iy(t){return new He(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function ek(t){return ke(t.length>4&&t.get(4)==="documents",29091,{key:t.toString()}),t.popFirst(5)}function WT(t,e,n){return{name:Cy(t,e),fields:n.value.mapValue.fields}}function sB(t,e){let n;if("targetChange"in e){e.targetChange;const r=function(u){return u==="NO_CHANGE"?0:u==="ADD"?1:u==="REMOVE"?2:u==="CURRENT"?3:u==="RESET"?4:oe(39313,{state:u})}(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=function(u,d){return u.useProto3Json?(ke(d===void 0||typeof d=="string",58123),Ft.fromBase64String(d||"")):(ke(d===void 0||d instanceof Buffer||d instanceof Uint8Array,16193),Ft.fromUint8Array(d||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,a=o&&function(u){const d=u.code===void 0?$.UNKNOWN:GR(u.code);return new ne(d,u.message||"")}(o);n=new YR(r,s,i,a||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const s=Pm(t,r.document.name),i=Or(r.document.updateTime),o=r.document.createTime?Or(r.document.createTime):de.min(),a=new pn({mapValue:{fields:r.document.fields}}),l=Yt.newFoundDocument(s,i,o,a),u=r.targetIds||[],d=r.removedTargetIds||[];n=new rh(u,d,l.key,l)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const s=Pm(t,r.document),i=r.readTime?Or(r.readTime):de.min(),o=Yt.newNoDocument(s,i),a=r.removedTargetIds||[];n=new rh([],a,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const s=Pm(t,r.document),i=r.removedTargetIds||[];n=new rh([],i,s,null)}else{if(!("filter"in e))return oe(11601,{Vt:e});{e.filter;const r=e.filter;r.targetId;const{count:s=0,unchangedNames:i}=r,o=new G$(s,i),a=r.targetId;n=new QR(a,o)}}return n}function iB(t,e){let n;if(e instanceof Sc)n={update:WT(t,e.key,e.value)};else if(e instanceof K0)n={delete:Cy(t,e.key)};else if(e instanceof Ni)n={update:WT(t,e.key,e.data),updateMask:pB(e.fieldMask)};else{if(!(e instanceof W$))return oe(16599,{ft:e.type});n={verify:Cy(t,e.key)}}return e.fieldTransforms.length>0&&(n.updateTransforms=e.fieldTransforms.map(r=>function(i,o){const a=o.transform;if(a instanceof ef)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(a instanceof Gu)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:a.elements}};if(a instanceof Qu)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:a.elements}};if(a instanceof tf)return{fieldPath:o.field.canonicalString(),increment:a.Re};throw oe(20930,{transform:o.transform})}(0,r))),e.precondition.isNone||(n.currentDocument=function(s,i){return i.updateTime!==void 0?{updateTime:nB(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:oe(27497)}(t,e.precondition)),n}function oB(t,e){return t&&t.length>0?(ke(e!==void 0,14353),t.map(n=>function(s,i){let o=s.updateTime?Or(s.updateTime):Or(i);return o.isEqual(de.min())&&(o=Or(i)),new B$(o,s.transformResults||[])}(n,e))):[]}function aB(t,e){return{documents:[ZR(t,e.path)]}}function lB(t,e){const n={structuredQuery:{}},r=e.path;let s;e.collectionGroup!==null?(s=r,n.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),n.structuredQuery.from=[{collectionId:r.lastSegment()}]),n.parent=ZR(t,s);const i=function(u){if(u.length!==0)return nk(yr.create(u,"and"))}(e.filters);i&&(n.structuredQuery.where=i);const o=function(u){if(u.length!==0)return u.map(d=>function(f){return{field:Uo(f.field),direction:dB(f.dir)}}(d))}(e.orderBy);o&&(n.structuredQuery.orderBy=o);const a=by(t,e.limit);return a!==null&&(n.structuredQuery.limit=a),e.startAt&&(n.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(e.startAt)),e.endAt&&(n.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(e.endAt)),{gt:n,parent:s}}function uB(t){let e=rB(t.parent);const n=t.structuredQuery,r=n.from?n.from.length:0;let s=null;if(r>0){ke(r===1,65062);const d=n.from[0];d.allDescendants?s=d.collectionId:e=e.child(d.collectionId)}let i=[];n.where&&(i=function(h){const f=tk(h);return f instanceof yr&&kR(f)?f.getFilters():[f]}(n.where));let o=[];n.orderBy&&(o=function(h){return h.map(f=>function(g){return new Zh($o(g.field),function(_){switch(_){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(g.direction))}(f))}(n.orderBy));let a=null;n.limit&&(a=function(h){let f;return f=typeof h=="object"?h.value:h,sp(f)?null:f}(n.limit));let l=null;n.startAt&&(l=function(h){const f=!!h.before,p=h.values||[];return new Jh(p,f)}(n.startAt));let u=null;return n.endAt&&(u=function(h){const f=!h.before,p=h.values||[];return new Jh(p,f)}(n.endAt)),A$(e,s,o,i,a,"F",l,u)}function cB(t,e){const n=function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return oe(28987,{purpose:s})}}(e.purpose);return n==null?null:{"goog-listen-tags":n}}function tk(t){return t.unaryFilter!==void 0?function(n){switch(n.unaryFilter.op){case"IS_NAN":const r=$o(n.unaryFilter.field);return wt.create(r,"==",{doubleValue:NaN});case"IS_NULL":const s=$o(n.unaryFilter.field);return wt.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const i=$o(n.unaryFilter.field);return wt.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=$o(n.unaryFilter.field);return wt.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return oe(61313);default:return oe(60726)}}(t):t.fieldFilter!==void 0?function(n){return wt.create($o(n.fieldFilter.field),function(s){switch(s){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";case"OPERATOR_UNSPECIFIED":return oe(58110);default:return oe(50506)}}(n.fieldFilter.op),n.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(n){return yr.create(n.compositeFilter.filters.map(r=>tk(r)),function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return oe(1026)}}(n.compositeFilter.op))}(t):oe(30097,{filter:t})}function dB(t){return J$[t]}function hB(t){return Z$[t]}function fB(t){return eB[t]}function Uo(t){return{fieldPath:t.canonicalString()}}function $o(t){return Mt.fromServerFormat(t.fieldPath)}function nk(t){return t instanceof wt?function(n){if(n.op==="=="){if(NT(n.value))return{unaryFilter:{field:Uo(n.field),op:"IS_NAN"}};if(kT(n.value))return{unaryFilter:{field:Uo(n.field),op:"IS_NULL"}}}else if(n.op==="!="){if(NT(n.value))return{unaryFilter:{field:Uo(n.field),op:"IS_NOT_NAN"}};if(kT(n.value))return{unaryFilter:{field:Uo(n.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Uo(n.field),op:hB(n.op),value:n.value}}}(t):t instanceof yr?function(n){const r=n.getFilters().map(s=>nk(s));return r.length===1?r[0]:{compositeFilter:{op:fB(n.op),filters:r}}}(t):oe(54877,{filter:t})}function pB(t){const e=[];return t.fields.forEach(n=>e.push(n.canonicalString())),{fieldPaths:e}}function rk(t){return t.length>=4&&t.get(0)==="projects"&&t.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,n,r,s,i=de.min(),o=de.min(),a=Ft.EMPTY_BYTE_STRING,l=null){this.target=e,this.targetId=n,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=a,this.expectedCount=l}withSequenceNumber(e){return new Ys(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,n){return new Ys(this.target,this.targetId,this.purpose,this.sequenceNumber,n,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 mB{constructor(e){this.wt=e}}function gB(t){const e=uB({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?Ty(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 yB{constructor(){this.Cn=new vB}addToCollectionParentIndex(e,n){return this.Cn.add(n),U.resolve()}getCollectionParents(e,n){return U.resolve(this.Cn.getEntries(n))}addFieldIndex(e,n){return U.resolve()}deleteFieldIndex(e,n){return U.resolve()}deleteAllFieldIndexes(e){return U.resolve()}createTargetIndexes(e,n){return U.resolve()}getDocumentsMatchingTarget(e,n){return U.resolve(null)}getIndexType(e,n){return U.resolve(0)}getFieldIndexes(e,n){return U.resolve([])}getNextCollectionGroupToUpdate(e){return U.resolve(null)}getMinOffset(e,n){return U.resolve(wi.min())}getMinOffsetFromCollectionGroup(e,n){return U.resolve(wi.min())}updateCollectionGroup(e,n,r){return U.resolve()}updateIndexEntries(e,n){return U.resolve()}}class vB{constructor(){this.index={}}add(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n]||new St(He.comparator),i=!s.has(r);return this.index[n]=s.add(r),i}has(e){const n=e.lastSegment(),r=e.popLast(),s=this.index[n];return s&&s.has(r)}getEntries(e){return(this.index[e]||new St(He.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 qT={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},sk=41943040;class hn{static withCacheSize(e){return new hn(e,hn.DEFAULT_COLLECTION_PERCENTILE,hn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,n,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=n,this.maximumSequenceNumbersToCollect=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. */hn.DEFAULT_COLLECTION_PERCENTILE=10,hn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,hn.DEFAULT=new hn(sk,hn.DEFAULT_COLLECTION_PERCENTILE,hn.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),hn.DISABLED=new hn(-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 Ba{constructor(e){this.ur=e}next(){return this.ur+=2,this.ur}static cr(){return new Ba(0)}static lr(){return new Ba(-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 KT="LruGarbageCollector",wB=1048576;function GT([t,e],[n,r]){const s=pe(t,n);return s===0?pe(e,r):s}class xB{constructor(e){this.Er=e,this.buffer=new St(GT),this.dr=0}Ar(){return++this.dr}Rr(e){const n=[e,this.Ar()];if(this.buffer.size{this.Vr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(n){il(n)?J(KT,"Ignoring IndexedDB error during garbage collection: ",n):await sl(n)}await this.mr(3e5)})}}class EB{constructor(e,n){this.gr=e,this.params=n}calculateTargetCount(e,n){return this.gr.pr(e).next(r=>Math.floor(n/100*r))}nthSequenceNumber(e,n){if(n===0)return U.resolve(rp.le);const r=new xB(n);return this.gr.forEachTarget(e,s=>r.Rr(s.sequenceNumber)).next(()=>this.gr.yr(e,s=>r.Rr(s))).next(()=>r.maxValue)}removeTargets(e,n,r){return this.gr.removeTargets(e,n,r)}removeOrphanedDocuments(e,n){return this.gr.removeOrphanedDocuments(e,n)}collect(e,n){return this.params.cacheSizeCollectionThreshold===-1?(J("LruGarbageCollector","Garbage collection skipped; disabled"),U.resolve(qT)):this.getCacheSize(e).next(r=>r(h>this.params.maximumSequenceNumbersToCollect?(J("LruGarbageCollector",`Capping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${h}`),s=this.params.maximumSequenceNumbersToCollect):s=h,o=Date.now(),this.nthSequenceNumber(e,s))).next(h=>(r=h,a=Date.now(),this.removeTargets(e,r,n))).next(h=>(i=h,l=Date.now(),this.removeOrphanedDocuments(e,r))).next(h=>(u=Date.now(),jo()<=we.DEBUG&&J("LruGarbageCollector",`LRU Garbage Collection Counted targets in ${o-d}ms Determined least recently used ${s} in `+(a-o)+`ms Removed ${i} targets in `+(l-a)+`ms Removed ${h} documents in `+(u-l)+`ms Total Duration: ${u-d}ms`),U.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:i,documentsRemoved:h})))}}function TB(t,e){return new EB(t,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 bB{constructor(){this.changes=new Io(e=>e.toString(),(e,n)=>e.isEqual(n)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,n){this.assertNotApplied(),this.changes.set(e,Yt.newInvalidDocument(e).setReadTime(n))}getEntry(e,n){this.assertNotApplied();const r=this.changes.get(n);return r!==void 0?U.resolve(r):this.getFromCache(e,n)}getEntries(e,n){return this.getAllFromCache(e,n)}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 SB{constructor(e,n){this.overlayedDocument=e,this.mutatedFields=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 CB{constructor(e,n,r,s){this.remoteDocumentCache=e,this.mutationQueue=n,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,n){let r=null;return this.documentOverlayCache.getOverlay(e,n).next(s=>(r=s,this.remoteDocumentCache.getEntry(e,n))).next(s=>(r!==null&&lu(r.mutation,s,In.empty(),bt.now()),s))}getDocuments(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.getLocalViewOfDocuments(e,r,xe()).next(()=>r))}getLocalViewOfDocuments(e,n,r=xe()){const s=Gi();return this.populateOverlays(e,s,n).next(()=>this.computeViews(e,n,s,r).next(i=>{let o=Bl();return i.forEach((a,l)=>{o=o.insert(a,l.overlayedDocument)}),o}))}getOverlayedDocuments(e,n){const r=Gi();return this.populateOverlays(e,r,n).next(()=>this.computeViews(e,n,r,xe()))}populateOverlays(e,n,r){const s=[];return r.forEach(i=>{n.has(i)||s.push(i)}),this.documentOverlayCache.getOverlays(e,s).next(i=>{i.forEach((o,a)=>{n.set(o,a)})})}computeViews(e,n,r,s){let i=fs();const o=au(),a=function(){return au()}();return n.forEach((l,u)=>{const d=r.get(u.key);s.has(u.key)&&(d===void 0||d.mutation instanceof Ni)?i=i.insert(u.key,u):d!==void 0?(o.set(u.key,d.mutation.getFieldMask()),lu(d.mutation,u,d.mutation.getFieldMask(),bt.now())):o.set(u.key,In.empty())}),this.recalculateAndSaveOverlays(e,i).next(l=>(l.forEach((u,d)=>o.set(u,d)),n.forEach((u,d)=>{var h;return a.set(u,new SB(d,(h=o.get(u))!==null&&h!==void 0?h:null))}),a))}recalculateAndSaveOverlays(e,n){const r=au();let s=new rt((o,a)=>o-a),i=xe();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,n).next(o=>{for(const a of o)a.keys().forEach(l=>{const u=n.get(l);if(u===null)return;let d=r.get(l)||In.empty();d=a.applyToLocalView(u,d),r.set(l,d);const h=(s.get(a.batchId)||xe()).add(l);s=s.insert(a.batchId,h)})}).next(()=>{const o=[],a=s.getReverseIterator();for(;a.hasNext();){const l=a.getNext(),u=l.key,d=l.value,h=UR();d.forEach(f=>{if(!i.has(f)){const p=qR(n.get(f),r.get(f));p!==null&&h.set(f,p),i=i.add(f)}}),o.push(this.documentOverlayCache.saveOverlays(e,u,h))}return U.waitFor(o)}).next(()=>r)}recalculateAndSaveOverlaysForDocumentKeys(e,n){return this.remoteDocumentCache.getEntries(e,n).next(r=>this.recalculateAndSaveOverlays(e,r))}getDocumentsMatchingQuery(e,n,r,s){return function(o){return se.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(n)?this.getDocumentsMatchingDocumentQuery(e,n.path):LR(n)?this.getDocumentsMatchingCollectionGroupQuery(e,n,r,s):this.getDocumentsMatchingCollectionQuery(e,n,r,s)}getNextDocuments(e,n,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,n,r,s).next(i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,n,r.largestBatchId,s-i.size):U.resolve(Gi());let a=Hu,l=i;return o.next(u=>U.forEach(u,(d,h)=>(a{l=l.insert(d,f)}))).next(()=>this.populateOverlays(e,u,i)).next(()=>this.computeViews(e,l,u,xe())).next(d=>({batchId:a,changes:FR(d)})))})}getDocumentsMatchingDocumentQuery(e,n){return this.getDocument(e,new se(n)).next(r=>{let s=Bl();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s})}getDocumentsMatchingCollectionGroupQuery(e,n,r,s){const i=n.collectionGroup;let o=Bl();return this.indexManager.getCollectionParents(e,i).next(a=>U.forEach(a,l=>{const u=function(h,f){return new bc(f,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)}(n,l.child(i));return this.getDocumentsMatchingCollectionQuery(e,u,r,s).next(d=>{d.forEach((h,f)=>{o=o.insert(h,f)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,n,r,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,n.path,r.largestBatchId).next(o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,n,r,i,s))).next(o=>{i.forEach((l,u)=>{const d=u.getKey();o.get(d)===null&&(o=o.insert(d,Yt.newInvalidDocument(d)))});let a=Bl();return o.forEach((l,u)=>{const d=i.get(l);d!==void 0&&lu(d.mutation,u,In.empty(),bt.now()),ap(n,u)&&(a=a.insert(l,u))}),a})}}/** * @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 IB{constructor(e){this.serializer=e,this.kr=new Map,this.qr=new Map}getBundleMetadata(e,n){return U.resolve(this.kr.get(n))}saveBundleMetadata(e,n){return this.kr.set(n.id,function(s){return{id:s.id,version:s.version,createTime:Or(s.createTime)}}(n)),U.resolve()}getNamedQuery(e,n){return U.resolve(this.qr.get(n))}saveNamedQuery(e,n){return this.qr.set(n.name,function(s){return{name:s.name,query:gB(s.bundledQuery),readTime:Or(s.readTime)}}(n)),U.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 PB{constructor(){this.overlays=new rt(se.comparator),this.Qr=new Map}getOverlay(e,n){return U.resolve(this.overlays.get(n))}getOverlays(e,n){const r=Gi();return U.forEach(n,s=>this.getOverlay(e,s).next(i=>{i!==null&&r.set(s,i)})).next(()=>r)}saveOverlays(e,n,r){return r.forEach((s,i)=>{this.St(e,n,i)}),U.resolve()}removeOverlaysForBatchId(e,n,r){const s=this.Qr.get(r);return s!==void 0&&(s.forEach(i=>this.overlays=this.overlays.remove(i)),this.Qr.delete(r)),U.resolve()}getOverlaysForCollection(e,n,r){const s=Gi(),i=n.length+1,o=new se(n.child("")),a=this.overlays.getIteratorFrom(o);for(;a.hasNext();){const l=a.getNext().value,u=l.getKey();if(!n.isPrefixOf(u.path))break;u.path.length===i&&l.largestBatchId>r&&s.set(l.getKey(),l)}return U.resolve(s)}getOverlaysForCollectionGroup(e,n,r,s){let i=new rt((u,d)=>u-d);const o=this.overlays.getIterator();for(;o.hasNext();){const u=o.getNext().value;if(u.getKey().getCollectionGroup()===n&&u.largestBatchId>r){let d=i.get(u.largestBatchId);d===null&&(d=Gi(),i=i.insert(u.largestBatchId,d)),d.set(u.getKey(),u)}}const a=Gi(),l=i.getIterator();for(;l.hasNext()&&(l.getNext().value.forEach((u,d)=>a.set(u,d)),!(a.size()>=s)););return U.resolve(a)}St(e,n,r){const s=this.overlays.get(r.key);if(s!==null){const o=this.Qr.get(s.largestBatchId).delete(r.key);this.Qr.set(s.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new K$(n,r));let i=this.Qr.get(n);i===void 0&&(i=xe(),this.Qr.set(n,i)),this.Qr.set(n,i.add(r.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 AB{constructor(){this.sessionToken=Ft.EMPTY_BYTE_STRING}getSessionToken(e){return U.resolve(this.sessionToken)}setSessionToken(e,n){return this.sessionToken=n,U.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 X0{constructor(){this.$r=new St(Pt.Ur),this.Kr=new St(Pt.Wr)}isEmpty(){return this.$r.isEmpty()}addReference(e,n){const r=new Pt(e,n);this.$r=this.$r.add(r),this.Kr=this.Kr.add(r)}Gr(e,n){e.forEach(r=>this.addReference(r,n))}removeReference(e,n){this.zr(new Pt(e,n))}jr(e,n){e.forEach(r=>this.removeReference(r,n))}Hr(e){const n=new se(new He([])),r=new Pt(n,e),s=new Pt(n,e+1),i=[];return this.Kr.forEachInRange([r,s],o=>{this.zr(o),i.push(o.key)}),i}Jr(){this.$r.forEach(e=>this.zr(e))}zr(e){this.$r=this.$r.delete(e),this.Kr=this.Kr.delete(e)}Yr(e){const n=new se(new He([])),r=new Pt(n,e),s=new Pt(n,e+1);let i=xe();return this.Kr.forEachInRange([r,s],o=>{i=i.add(o.key)}),i}containsKey(e){const n=new Pt(e,0),r=this.$r.firstAfterOrEqual(n);return r!==null&&e.isEqual(r.key)}}class Pt{constructor(e,n){this.key=e,this.Zr=n}static Ur(e,n){return se.comparator(e.key,n.key)||pe(e.Zr,n.Zr)}static Wr(e,n){return pe(e.Zr,n.Zr)||se.comparator(e.key,n.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 RB{constructor(e,n){this.indexManager=e,this.referenceDelegate=n,this.mutationQueue=[],this.nr=1,this.Xr=new St(Pt.Ur)}checkEmpty(e){return U.resolve(this.mutationQueue.length===0)}addMutationBatch(e,n,r,s){const i=this.nr;this.nr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new q$(i,n,r,s);this.mutationQueue.push(o);for(const a of s)this.Xr=this.Xr.add(new Pt(a.key,i)),this.indexManager.addToCollectionParentIndex(e,a.key.path.popLast());return U.resolve(o)}lookupMutationBatch(e,n){return U.resolve(this.ei(n))}getNextMutationBatchAfterBatchId(e,n){const r=n+1,s=this.ti(r),i=s<0?0:s;return U.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return U.resolve(this.mutationQueue.length===0?U0:this.nr-1)}getAllMutationBatches(e){return U.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,n){const r=new Pt(n,0),s=new Pt(n,Number.POSITIVE_INFINITY),i=[];return this.Xr.forEachInRange([r,s],o=>{const a=this.ei(o.Zr);i.push(a)}),U.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,n){let r=new St(pe);return n.forEach(s=>{const i=new Pt(s,0),o=new Pt(s,Number.POSITIVE_INFINITY);this.Xr.forEachInRange([i,o],a=>{r=r.add(a.Zr)})}),U.resolve(this.ni(r))}getAllMutationBatchesAffectingQuery(e,n){const r=n.path,s=r.length+1;let i=r;se.isDocumentKey(i)||(i=i.child(""));const o=new Pt(new se(i),0);let a=new St(pe);return this.Xr.forEachWhile(l=>{const u=l.key.path;return!!r.isPrefixOf(u)&&(u.length===s&&(a=a.add(l.Zr)),!0)},o),U.resolve(this.ni(a))}ni(e){const n=[];return e.forEach(r=>{const s=this.ei(r);s!==null&&n.push(s)}),n}removeMutationBatch(e,n){ke(this.ri(n.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.Xr;return U.forEach(n.mutations,s=>{const i=new Pt(s.key,n.batchId);return r=r.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.Xr=r})}sr(e){}containsKey(e,n){const r=new Pt(n,0),s=this.Xr.firstAfterOrEqual(r);return U.resolve(n.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,U.resolve()}ri(e,n){return this.ti(e)}ti(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}ei(e){const n=this.ti(e);return n<0||n>=this.mutationQueue.length?null:this.mutationQueue[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 kB{constructor(e){this.ii=e,this.docs=function(){return new rt(se.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,n){const r=n.key,s=this.docs.get(r),i=s?s.size:0,o=this.ii(n);return this.docs=this.docs.insert(r,{document:n.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const n=this.docs.get(e);n&&(this.docs=this.docs.remove(e),this.size-=n.size)}getEntry(e,n){const r=this.docs.get(n);return U.resolve(r?r.document.mutableCopy():Yt.newInvalidDocument(n))}getEntries(e,n){let r=fs();return n.forEach(s=>{const i=this.docs.get(s);r=r.insert(s,i?i.document.mutableCopy():Yt.newInvalidDocument(s))}),U.resolve(r)}getDocumentsMatchingQuery(e,n,r,s){let i=fs();const o=n.path,a=new se(o.child("__id-9223372036854775808__")),l=this.docs.getIteratorFrom(a);for(;l.hasNext();){const{key:u,value:{document:d}}=l.getNext();if(!o.isPrefixOf(u.path))break;u.path.length>o.length+1||a$(o$(d),r)<=0||(s.has(d.key)||ap(n,d))&&(i=i.insert(d.key,d.mutableCopy()))}return U.resolve(i)}getAllFromCollectionGroup(e,n,r,s){oe(9500)}si(e,n){return U.forEach(this.docs,r=>n(r))}newChangeBuffer(e){return new NB(this)}getSize(e){return U.resolve(this.size)}}class NB extends bB{constructor(e){super(),this.Br=e}applyChanges(e){const n=[];return this.changes.forEach((r,s)=>{s.isValidDocument()?n.push(this.Br.addEntry(e,s)):this.Br.removeEntry(r)}),U.waitFor(n)}getFromCache(e,n){return this.Br.getEntry(e,n)}getAllFromCache(e,n){return this.Br.getEntries(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 DB{constructor(e){this.persistence=e,this.oi=new Io(n=>z0(n),H0),this.lastRemoteSnapshotVersion=de.min(),this.highestTargetId=0,this._i=0,this.ai=new X0,this.targetCount=0,this.ui=Ba.cr()}forEachTarget(e,n){return this.oi.forEach((r,s)=>n(s)),U.resolve()}getLastRemoteSnapshotVersion(e){return U.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return U.resolve(this._i)}allocateTargetId(e){return this.highestTargetId=this.ui.next(),U.resolve(this.highestTargetId)}setTargetsMetadata(e,n,r){return r&&(this.lastRemoteSnapshotVersion=r),n>this._i&&(this._i=n),U.resolve()}Tr(e){this.oi.set(e.target,e);const n=e.targetId;n>this.highestTargetId&&(this.ui=new Ba(n),this.highestTargetId=n),e.sequenceNumber>this._i&&(this._i=e.sequenceNumber)}addTargetData(e,n){return this.Tr(n),this.targetCount+=1,U.resolve()}updateTargetData(e,n){return this.Tr(n),U.resolve()}removeTargetData(e,n){return this.oi.delete(n.target),this.ai.Hr(n.targetId),this.targetCount-=1,U.resolve()}removeTargets(e,n,r){let s=0;const i=[];return this.oi.forEach((o,a)=>{a.sequenceNumber<=n&&r.get(a.targetId)===null&&(this.oi.delete(o),i.push(this.removeMatchingKeysForTargetId(e,a.targetId)),s++)}),U.waitFor(i).next(()=>s)}getTargetCount(e){return U.resolve(this.targetCount)}getTargetData(e,n){const r=this.oi.get(n)||null;return U.resolve(r)}addMatchingKeys(e,n,r){return this.ai.Gr(n,r),U.resolve()}removeMatchingKeys(e,n,r){this.ai.jr(n,r);const s=this.persistence.referenceDelegate,i=[];return s&&n.forEach(o=>{i.push(s.markPotentiallyOrphaned(e,o))}),U.waitFor(i)}removeMatchingKeysForTargetId(e,n){return this.ai.Hr(n),U.resolve()}getMatchingKeysForTargetId(e,n){const r=this.ai.Yr(n);return U.resolve(r)}containsKey(e,n){return U.resolve(this.ai.containsKey(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 ik{constructor(e,n){this.ci={},this.overlays={},this.li=new rp(0),this.hi=!1,this.hi=!0,this.Pi=new AB,this.referenceDelegate=e(this),this.Ti=new DB(this),this.indexManager=new yB,this.remoteDocumentCache=function(s){return new kB(s)}(r=>this.referenceDelegate.Ii(r)),this.serializer=new mB(n),this.Ei=new IB(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.hi=!1,Promise.resolve()}get started(){return this.hi}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let n=this.overlays[e.toKey()];return n||(n=new PB,this.overlays[e.toKey()]=n),n}getMutationQueue(e,n){let r=this.ci[e.toKey()];return r||(r=new RB(n,this.referenceDelegate),this.ci[e.toKey()]=r),r}getGlobalsCache(){return this.Pi}getTargetCache(){return this.Ti}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Ei}runTransaction(e,n,r){J("MemoryPersistence","Starting transaction:",e);const s=new OB(this.li.next());return this.referenceDelegate.di(),r(s).next(i=>this.referenceDelegate.Ai(s).next(()=>i)).toPromise().then(i=>(s.raiseOnCommittedEvent(),i))}Ri(e,n){return U.or(Object.values(this.ci).map(r=>()=>r.containsKey(e,n)))}}class OB extends u${constructor(e){super(),this.currentSequenceNumber=e}}class J0{constructor(e){this.persistence=e,this.Vi=new X0,this.mi=null}static fi(e){return new J0(e)}get gi(){if(this.mi)return this.mi;throw oe(60996)}addReference(e,n,r){return this.Vi.addReference(r,n),this.gi.delete(r.toString()),U.resolve()}removeReference(e,n,r){return this.Vi.removeReference(r,n),this.gi.add(r.toString()),U.resolve()}markPotentiallyOrphaned(e,n){return this.gi.add(n.toString()),U.resolve()}removeTarget(e,n){this.Vi.Hr(n.targetId).forEach(s=>this.gi.add(s.toString()));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,n.targetId).next(s=>{s.forEach(i=>this.gi.add(i.toString()))}).next(()=>r.removeTargetData(e,n))}di(){this.mi=new Set}Ai(e){const n=this.persistence.getRemoteDocumentCache().newChangeBuffer();return U.forEach(this.gi,r=>{const s=se.fromPath(r);return this.pi(e,s).next(i=>{i||n.removeEntry(s,de.min())})}).next(()=>(this.mi=null,n.apply(e)))}updateLimboDocument(e,n){return this.pi(e,n).next(r=>{r?this.gi.delete(n.toString()):this.gi.add(n.toString())})}Ii(e){return 0}pi(e,n){return U.or([()=>U.resolve(this.Vi.containsKey(n)),()=>this.persistence.getTargetCache().containsKey(e,n),()=>this.persistence.Ri(e,n)])}}class rf{constructor(e,n){this.persistence=e,this.yi=new Io(r=>h$(r.path),(r,s)=>r.isEqual(s)),this.garbageCollector=TB(this,n)}static fi(e,n){return new rf(e,n)}di(){}Ai(e){return U.resolve()}forEachTarget(e,n){return this.persistence.getTargetCache().forEachTarget(e,n)}pr(e){const n=this.br(e);return this.persistence.getTargetCache().getTargetCount(e).next(r=>n.next(s=>r+s))}br(e){let n=0;return this.yr(e,r=>{n++}).next(()=>n)}yr(e,n){return U.forEach(this.yi,(r,s)=>this.Dr(e,r,s).next(i=>i?U.resolve():n(s)))}removeTargets(e,n,r){return this.persistence.getTargetCache().removeTargets(e,n,r)}removeOrphanedDocuments(e,n){let r=0;const s=this.persistence.getRemoteDocumentCache(),i=s.newChangeBuffer();return s.si(e,o=>this.Dr(e,o,n).next(a=>{a||(r++,i.removeEntry(o,de.min()))})).next(()=>i.apply(e)).next(()=>r)}markPotentiallyOrphaned(e,n){return this.yi.set(n,e.currentSequenceNumber),U.resolve()}removeTarget(e,n){const r=n.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,n,r){return this.yi.set(r,e.currentSequenceNumber),U.resolve()}removeReference(e,n,r){return this.yi.set(r,e.currentSequenceNumber),U.resolve()}updateLimboDocument(e,n){return this.yi.set(n,e.currentSequenceNumber),U.resolve()}Ii(e){let n=e.key.toString().length;return e.isFoundDocument()&&(n+=eh(e.data.value)),n}Dr(e,n,r){return U.or([()=>this.persistence.Ri(e,n),()=>this.persistence.getTargetCache().containsKey(e,n),()=>{const s=this.yi.get(n);return U.resolve(s!==void 0&&s>r)}])}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 Z0{constructor(e,n,r,s){this.targetId=e,this.fromCache=n,this.ds=r,this.As=s}static Rs(e,n){let r=xe(),s=xe();for(const i of n.docChanges)switch(i.type){case 0:r=r.add(i.doc.key);break;case 1:s=s.add(i.doc.key)}return new Z0(e,n.fromCache,r,s)}}/** * @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 LB{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 MB{constructor(){this.Vs=!1,this.fs=!1,this.gs=100,this.ps=function(){return c5()?8:c$(Zt())>0?6:4}()}initialize(e,n){this.ys=e,this.indexManager=n,this.Vs=!0}getDocumentsMatchingQuery(e,n,r,s){const i={result:null};return this.ws(e,n).next(o=>{i.result=o}).next(()=>{if(!i.result)return this.bs(e,n,s,r).next(o=>{i.result=o})}).next(()=>{if(i.result)return;const o=new LB;return this.Ss(e,n,o).next(a=>{if(i.result=a,this.fs)return this.Ds(e,n,o,a.size)})}).next(()=>i.result)}Ds(e,n,r,s){return r.documentReadCountthis.ps*s?(jo()<=we.DEBUG&&J("QueryEngine","The SDK decides to create cache indexes for query:",Fo(n),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Dr(n))):U.resolve())}ws(e,n){if(MT(n))return U.resolve(null);let r=Dr(n);return this.indexManager.getIndexType(e,r).next(s=>s===0?null:(n.limit!==null&&s===1&&(n=Ty(n,null,"F"),r=Dr(n)),this.indexManager.getDocumentsMatchingTarget(e,r).next(i=>{const o=xe(...i);return this.ys.getDocuments(e,o).next(a=>this.indexManager.getMinOffset(e,r).next(l=>{const u=this.vs(n,a);return this.Cs(n,u,o,l.readTime)?this.ws(e,Ty(n,null,"F")):this.Fs(e,u,n,l)}))})))}bs(e,n,r,s){return MT(n)||s.isEqual(de.min())?U.resolve(null):this.ys.getDocuments(e,r).next(i=>{const o=this.vs(n,i);return this.Cs(n,o,r,s)?U.resolve(null):(jo()<=we.DEBUG&&J("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Fo(n)),this.Fs(e,o,n,i$(s,Hu)).next(a=>a))})}vs(e,n){let r=new St(VR(e));return n.forEach((s,i)=>{ap(e,i)&&(r=r.add(i))}),r}Cs(e,n,r,s){if(e.limit===null)return!1;if(r.size!==n.size)return!0;const i=e.limitType==="F"?n.last():n.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}Ss(e,n,r){return jo()<=we.DEBUG&&J("QueryEngine","Using full collection scan to execute query:",Fo(n)),this.ys.getDocumentsMatchingQuery(e,n,wi.min(),r)}Fs(e,n,r,s){return this.ys.getDocumentsMatchingQuery(e,r,s).next(i=>(n.forEach(o=>{i=i.insert(o.key,o)}),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 ew="LocalStore",VB=3e8;class jB{constructor(e,n,r,s){this.persistence=e,this.Ms=n,this.serializer=s,this.xs=new rt(pe),this.Os=new Io(i=>z0(i),H0),this.Ns=new Map,this.Bs=e.getRemoteDocumentCache(),this.Ti=e.getTargetCache(),this.Ei=e.getBundleCache(),this.Ls(r)}Ls(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new CB(this.Bs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.Bs.setIndexManager(this.indexManager),this.Ms.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",n=>e.collect(n,this.xs))}}function FB(t,e,n,r){return new jB(t,e,n,r)}async function ok(t,e){const n=he(t);return await n.persistence.runTransaction("Handle user change","readonly",r=>{let s;return n.mutationQueue.getAllMutationBatches(r).next(i=>(s=i,n.Ls(e),n.mutationQueue.getAllMutationBatches(r))).next(i=>{const o=[],a=[];let l=xe();for(const u of s){o.push(u.batchId);for(const d of u.mutations)l=l.add(d.key)}for(const u of i){a.push(u.batchId);for(const d of u.mutations)l=l.add(d.key)}return n.localDocuments.getDocuments(r,l).next(u=>({ks:u,removedBatchIds:o,addedBatchIds:a}))})})}function UB(t,e){const n=he(t);return n.persistence.runTransaction("Acknowledge batch","readwrite-primary",r=>{const s=e.batch.keys(),i=n.Bs.newChangeBuffer({trackRemovals:!0});return function(a,l,u,d){const h=u.batch,f=h.keys();let p=U.resolve();return f.forEach(g=>{p=p.next(()=>d.getEntry(l,g)).next(w=>{const _=u.docVersions.get(g);ke(_!==null,48541),w.version.compareTo(_)<0&&(h.applyToRemoteDocument(w,u),w.isValidDocument()&&(w.setReadTime(u.commitVersion),d.addEntry(w)))})}),p.next(()=>a.mutationQueue.removeMutationBatch(l,h))}(n,r,e,i).next(()=>i.apply(r)).next(()=>n.mutationQueue.performConsistencyCheck(r)).next(()=>n.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId)).next(()=>n.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,function(a){let l=xe();for(let u=0;u0&&(l=l.add(a.batch.mutations[u].key));return l}(e))).next(()=>n.localDocuments.getDocuments(r,s))})}function ak(t){const e=he(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",n=>e.Ti.getLastRemoteSnapshotVersion(n))}function $B(t,e){const n=he(t),r=e.snapshotVersion;let s=n.xs;return n.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{const o=n.Bs.newChangeBuffer({trackRemovals:!0});s=n.xs;const a=[];e.targetChanges.forEach((d,h)=>{const f=s.get(h);if(!f)return;a.push(n.Ti.removeMatchingKeys(i,d.removedDocuments,h).next(()=>n.Ti.addMatchingKeys(i,d.addedDocuments,h)));let p=f.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?p=p.withResumeToken(Ft.EMPTY_BYTE_STRING,de.min()).withLastLimboFreeSnapshotVersion(de.min()):d.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(d.resumeToken,r)),s=s.insert(h,p),function(w,_,v){return w.resumeToken.approximateByteSize()===0||_.snapshotVersion.toMicroseconds()-w.snapshotVersion.toMicroseconds()>=VB?!0:v.addedDocuments.size+v.modifiedDocuments.size+v.removedDocuments.size>0}(f,p,d)&&a.push(n.Ti.updateTargetData(i,p))});let l=fs(),u=xe();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&a.push(n.persistence.referenceDelegate.updateLimboDocument(i,d))}),a.push(BB(i,o,e.documentUpdates).next(d=>{l=d.qs,u=d.Qs})),!r.isEqual(de.min())){const d=n.Ti.getLastRemoteSnapshotVersion(i).next(h=>n.Ti.setTargetsMetadata(i,i.currentSequenceNumber,r));a.push(d)}return U.waitFor(a).next(()=>o.apply(i)).next(()=>n.localDocuments.getLocalViewOfDocuments(i,l,u)).next(()=>l)}).then(i=>(n.xs=s,i))}function BB(t,e,n){let r=xe(),s=xe();return n.forEach(i=>r=r.add(i)),e.getEntries(t,r).next(i=>{let o=fs();return n.forEach((a,l)=>{const u=i.get(a);l.isFoundDocument()!==u.isFoundDocument()&&(s=s.add(a)),l.isNoDocument()&&l.version.isEqual(de.min())?(e.removeEntry(a,l.readTime),o=o.insert(a,l)):!u.isValidDocument()||l.version.compareTo(u.version)>0||l.version.compareTo(u.version)===0&&u.hasPendingWrites?(e.addEntry(l),o=o.insert(a,l)):J(ew,"Ignoring outdated watch update for ",a,". Current version:",u.version," Watch version:",l.version)}),{qs:o,Qs:s}})}function zB(t,e){const n=he(t);return n.persistence.runTransaction("Get next mutation batch","readonly",r=>(e===void 0&&(e=U0),n.mutationQueue.getNextMutationBatchAfterBatchId(r,e)))}function HB(t,e){const n=he(t);return n.persistence.runTransaction("Allocate target","readwrite",r=>{let s;return n.Ti.getTargetData(r,e).next(i=>i?(s=i,U.resolve(s)):n.Ti.allocateTargetId(r).next(o=>(s=new Ys(e,o,"TargetPurposeListen",r.currentSequenceNumber),n.Ti.addTargetData(r,s).next(()=>s))))}).then(r=>{const s=n.xs.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(n.xs=n.xs.insert(r.targetId,r),n.Os.set(e,r.targetId)),r})}async function Py(t,e,n){const r=he(t),s=r.xs.get(e),i=n?"readwrite":"readwrite-primary";try{n||await r.persistence.runTransaction("Release target",i,o=>r.persistence.referenceDelegate.removeTarget(o,s))}catch(o){if(!il(o))throw o;J(ew,`Failed to update sequence numbers for target ${e}: ${o}`)}r.xs=r.xs.remove(e),r.Os.delete(s.target)}function QT(t,e,n){const r=he(t);let s=de.min(),i=xe();return r.persistence.runTransaction("Execute query","readwrite",o=>function(l,u,d){const h=he(l),f=h.Os.get(d);return f!==void 0?U.resolve(h.xs.get(f)):h.Ti.getTargetData(u,d)}(r,o,Dr(e)).next(a=>{if(a)return s=a.lastLimboFreeSnapshotVersion,r.Ti.getMatchingKeysForTargetId(o,a.targetId).next(l=>{i=l})}).next(()=>r.Ms.getDocumentsMatchingQuery(o,e,n?s:de.min(),n?i:xe())).next(a=>(WB(r,k$(e),a),{documents:a,$s:i})))}function WB(t,e,n){let r=t.Ns.get(e)||de.min();n.forEach((s,i)=>{i.readTime.compareTo(r)>0&&(r=i.readTime)}),t.Ns.set(e,r)}class YT{constructor(){this.activeTargetIds=V$()}js(e){this.activeTargetIds=this.activeTargetIds.add(e)}Hs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}zs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class qB{constructor(){this.xo=new YT,this.Oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,n,r){}addLocalQueryTarget(e,n=!0){return n&&this.xo.js(e),this.Oo[e]||"not-current"}updateQueryState(e,n,r){this.Oo[e]=n}removeLocalQueryTarget(e){this.xo.Hs(e)}isLocalQueryTarget(e){return this.xo.activeTargetIds.has(e)}clearQueryState(e){delete this.Oo[e]}getAllActiveQueryTargets(){return this.xo.activeTargetIds}isActiveQueryTarget(e){return this.xo.activeTargetIds.has(e)}start(){return this.xo=new YT,Promise.resolve()}handleUserChange(e,n,r){}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 KB{No(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 XT="ConnectivityMonitor";class JT{constructor(){this.Bo=()=>this.Lo(),this.ko=()=>this.qo(),this.Qo=[],this.$o()}No(e){this.Qo.push(e)}shutdown(){window.removeEventListener("online",this.Bo),window.removeEventListener("offline",this.ko)}$o(){window.addEventListener("online",this.Bo),window.addEventListener("offline",this.ko)}Lo(){J(XT,"Network connectivity changed: AVAILABLE");for(const e of this.Qo)e(0)}qo(){J(XT,"Network connectivity changed: UNAVAILABLE");for(const e of this.Qo)e(1)}static C(){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 Cd=null;function Ay(){return Cd===null?Cd=function(){return 268435456+Math.round(2147483648*Math.random())}():Cd++,"0x"+Cd.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 Am="RestConnection",GB={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};class QB{get Uo(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const n=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Ko=n+"://"+e.host,this.Wo=`projects/${r}/databases/${s}`,this.Go=this.databaseId.database===Yh?`project_id=${r}`:`project_id=${r}&database_id=${s}`}zo(e,n,r,s,i){const o=Ay(),a=this.jo(e,n.toUriEncodedString());J(Am,`Sending RPC '${e}' ${o}:`,a,r);const l={"google-cloud-resource-prefix":this.Wo,"x-goog-request-params":this.Go};this.Ho(l,s,i);const{host:u}=new URL(a),d=yc(u);return this.Jo(e,a,l,r,d).then(h=>(J(Am,`Received RPC '${e}' ${o}: `,h),h),h=>{throw ja(Am,`RPC '${e}' ${o} failed with error: `,h,"url: ",a,"request:",r),h})}Yo(e,n,r,s,i,o){return this.zo(e,n,r,s,i)}Ho(e,n,r){e["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+rl}(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((s,i)=>e[i]=s),r&&r.headers.forEach((s,i)=>e[i]=s)}jo(e,n){const r=GB[e];return`${this.Ko}/v1/${n}:${r}`}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 YB{constructor(e){this.Zo=e.Zo,this.Xo=e.Xo}e_(e){this.t_=e}n_(e){this.r_=e}i_(e){this.s_=e}onMessage(e){this.o_=e}close(){this.Xo()}send(e){this.Zo(e)}__(){this.t_()}a_(){this.r_()}u_(e){this.s_(e)}c_(e){this.o_(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 qt="WebChannelConnection";class XB extends QB{constructor(e){super(e),this.l_=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}Jo(e,n,r,s,i){const o=Ay();return new Promise((a,l)=>{const u=new cR;u.setWithCredentials(!0),u.listenOnce(dR.COMPLETE,()=>{try{switch(u.getLastErrorCode()){case Zd.NO_ERROR:const h=u.getResponseJson();J(qt,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(h)),a(h);break;case Zd.TIMEOUT:J(qt,`RPC '${e}' ${o} timed out`),l(new ne($.DEADLINE_EXCEEDED,"Request time out"));break;case Zd.HTTP_ERROR:const f=u.getStatus();if(J(qt,`RPC '${e}' ${o} failed with status:`,f,"response text:",u.getResponseText()),f>0){let p=u.getResponseJson();Array.isArray(p)&&(p=p[0]);const g=p==null?void 0:p.error;if(g&&g.status&&g.message){const w=function(v){const x=v.toLowerCase().replace(/_/g,"-");return Object.values($).indexOf(x)>=0?x:$.UNKNOWN}(g.status);l(new ne(w,g.message))}else l(new ne($.UNKNOWN,"Server responded with status "+u.getStatus()))}else l(new ne($.UNAVAILABLE,"Connection failed."));break;default:oe(9055,{h_:e,streamId:o,P_:u.getLastErrorCode(),T_:u.getLastError()})}}finally{J(qt,`RPC '${e}' ${o} completed.`)}});const d=JSON.stringify(s);J(qt,`RPC '${e}' ${o} sending request:`,s),u.send(n,"POST",d,r,15)})}I_(e,n,r){const s=Ay(),i=[this.Ko,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=pR(),a=fR(),l={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},u=this.longPollingOptions.timeoutSeconds;u!==void 0&&(l.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(l.useFetchStreams=!0),this.Ho(l.initMessageHeaders,n,r),l.encodeInitMessageHeaders=!0;const d=i.join("");J(qt,`Creating RPC '${e}' stream ${s}: ${d}`,l);const h=o.createWebChannel(d,l);this.E_(h);let f=!1,p=!1;const g=new YB({Zo:_=>{p?J(qt,`Not sending because RPC '${e}' stream ${s} is closed:`,_):(f||(J(qt,`Opening RPC '${e}' stream ${s} transport.`),h.open(),f=!0),J(qt,`RPC '${e}' stream ${s} sending:`,_),h.send(_))},Xo:()=>h.close()}),w=(_,v,x)=>{_.listen(v,T=>{try{x(T)}catch(A){setTimeout(()=>{throw A},0)}})};return w(h,$l.EventType.OPEN,()=>{p||(J(qt,`RPC '${e}' stream ${s} transport opened.`),g.__())}),w(h,$l.EventType.CLOSE,()=>{p||(p=!0,J(qt,`RPC '${e}' stream ${s} transport closed`),g.u_(),this.d_(h))}),w(h,$l.EventType.ERROR,_=>{p||(p=!0,ja(qt,`RPC '${e}' stream ${s} transport errored. Name:`,_.name,"Message:",_.message),g.u_(new ne($.UNAVAILABLE,"The operation could not be completed")))}),w(h,$l.EventType.MESSAGE,_=>{var v;if(!p){const x=_.data[0];ke(!!x,16349);const T=x,A=(T==null?void 0:T.error)||((v=T[0])===null||v===void 0?void 0:v.error);if(A){J(qt,`RPC '${e}' stream ${s} received error:`,A);const k=A.status;let L=function(I){const P=gt[I];if(P!==void 0)return GR(P)}(k),C=A.message;L===void 0&&(L=$.INTERNAL,C="Unknown error status: "+k+" with message "+A.message),p=!0,g.u_(new ne(L,C)),h.close()}else J(qt,`RPC '${e}' stream ${s} received:`,x),g.c_(x)}}),w(a,hR.STAT_EVENT,_=>{_.stat===gy.PROXY?J(qt,`RPC '${e}' stream ${s} detected buffering proxy`):_.stat===gy.NOPROXY&&J(qt,`RPC '${e}' stream ${s} detected no buffering proxy`)}),setTimeout(()=>{g.a_()},0),g}terminate(){this.l_.forEach(e=>e.close()),this.l_=[]}E_(e){this.l_.push(e)}d_(e){this.l_=this.l_.filter(n=>n===e)}}function Rm(){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 dp(t){return new tB(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. */class lk{constructor(e,n,r=1e3,s=1.5,i=6e4){this.xi=e,this.timerId=n,this.A_=r,this.R_=s,this.V_=i,this.m_=0,this.f_=null,this.g_=Date.now(),this.reset()}reset(){this.m_=0}p_(){this.m_=this.V_}y_(e){this.cancel();const n=Math.floor(this.m_+this.w_()),r=Math.max(0,Date.now()-this.g_),s=Math.max(0,n-r);s>0&&J("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.m_} ms, delay with jitter: ${n} ms, last attempt: ${r} ms ago)`),this.f_=this.xi.enqueueAfterDelay(this.timerId,s,()=>(this.g_=Date.now(),e())),this.m_*=this.R_,this.m_this.V_&&(this.m_=this.V_)}b_(){this.f_!==null&&(this.f_.skipDelay(),this.f_=null)}cancel(){this.f_!==null&&(this.f_.cancel(),this.f_=null)}w_(){return(Math.random()-.5)*this.m_}}/** * @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 ZT="PersistentStream";class uk{constructor(e,n,r,s,i,o,a,l){this.xi=e,this.S_=r,this.D_=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=a,this.listener=l,this.state=0,this.v_=0,this.C_=null,this.F_=null,this.stream=null,this.M_=0,this.x_=new lk(e,n)}O_(){return this.state===1||this.state===5||this.N_()}N_(){return this.state===2||this.state===3}start(){this.M_=0,this.state!==4?this.auth():this.B_()}async stop(){this.O_()&&await this.close(0)}L_(){this.state=0,this.x_.reset()}k_(){this.N_()&&this.C_===null&&(this.C_=this.xi.enqueueAfterDelay(this.S_,6e4,()=>this.q_()))}Q_(e){this.U_(),this.stream.send(e)}async q_(){if(this.N_())return this.close(0)}U_(){this.C_&&(this.C_.cancel(),this.C_=null)}K_(){this.F_&&(this.F_.cancel(),this.F_=null)}async close(e,n){this.U_(),this.K_(),this.x_.cancel(),this.v_++,e!==4?this.x_.reset():n&&n.code===$.RESOURCE_EXHAUSTED?(hs(n.toString()),hs("Using maximum backoff delay to prevent overloading the backend."),this.x_.p_()):n&&n.code===$.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.W_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.i_(n)}W_(){}auth(){this.state=1;const e=this.G_(this.v_),n=this.v_;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([r,s])=>{this.v_===n&&this.z_(r,s)},r=>{e(()=>{const s=new ne($.UNKNOWN,"Fetching auth token failed: "+r.message);return this.j_(s)})})}z_(e,n){const r=this.G_(this.v_);this.stream=this.H_(e,n),this.stream.e_(()=>{r(()=>this.listener.e_())}),this.stream.n_(()=>{r(()=>(this.state=2,this.F_=this.xi.enqueueAfterDelay(this.D_,1e4,()=>(this.N_()&&(this.state=3),Promise.resolve())),this.listener.n_()))}),this.stream.i_(s=>{r(()=>this.j_(s))}),this.stream.onMessage(s=>{r(()=>++this.M_==1?this.J_(s):this.onNext(s))})}B_(){this.state=5,this.x_.y_(async()=>{this.state=0,this.start()})}j_(e){return J(ZT,`close with error: ${e}`),this.stream=null,this.close(4,e)}G_(e){return n=>{this.xi.enqueueAndForget(()=>this.v_===e?n():(J(ZT,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class JB extends uk{constructor(e,n,r,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}H_(e,n){return this.connection.I_("Listen",e,n)}J_(e){return this.onNext(e)}onNext(e){this.x_.reset();const n=sB(this.serializer,e),r=function(i){if(!("targetChange"in i))return de.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?de.min():o.readTime?Or(o.readTime):de.min()}(e);return this.listener.Y_(n,r)}Z_(e){const n={};n.database=Iy(this.serializer),n.addTarget=function(i,o){let a;const l=o.target;if(a=_y(l)?{documents:aB(i,l)}:{query:lB(i,l).gt},a.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){a.resumeToken=XR(i,o.resumeToken);const u=by(i,o.expectedCount);u!==null&&(a.expectedCount=u)}else if(o.snapshotVersion.compareTo(de.min())>0){a.readTime=nf(i,o.snapshotVersion.toTimestamp());const u=by(i,o.expectedCount);u!==null&&(a.expectedCount=u)}return a}(this.serializer,e);const r=cB(this.serializer,e);r&&(n.labels=r),this.Q_(n)}X_(e){const n={};n.database=Iy(this.serializer),n.removeTarget=e,this.Q_(n)}}class ZB extends uk{constructor(e,n,r,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",n,r,s,o),this.serializer=i}get ea(){return this.M_>0}start(){this.lastStreamToken=void 0,super.start()}W_(){this.ea&&this.ta([])}H_(e,n){return this.connection.I_("Write",e,n)}J_(e){return ke(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,ke(!e.writeResults||e.writeResults.length===0,55816),this.listener.na()}onNext(e){ke(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.x_.reset();const n=oB(e.writeResults,e.commitTime),r=Or(e.commitTime);return this.listener.ra(r,n)}ia(){const e={};e.database=Iy(this.serializer),this.Q_(e)}ta(e){const n={streamToken:this.lastStreamToken,writes:e.map(r=>iB(this.serializer,r))};this.Q_(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 ez{}class tz extends ez{constructor(e,n,r,s){super(),this.authCredentials=e,this.appCheckCredentials=n,this.connection=r,this.serializer=s,this.sa=!1}oa(){if(this.sa)throw new ne($.FAILED_PRECONDITION,"The client has already been terminated.")}zo(e,n,r,s){return this.oa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.zo(e,Sy(n,r),s,i,o)).catch(i=>{throw i.name==="FirebaseError"?(i.code===$.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new ne($.UNKNOWN,i.toString())})}Yo(e,n,r,s,i){return this.oa(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,a])=>this.connection.Yo(e,Sy(n,r),s,o,a,i)).catch(o=>{throw o.name==="FirebaseError"?(o.code===$.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new ne($.UNKNOWN,o.toString())})}terminate(){this.sa=!0,this.connection.terminate()}}class nz{constructor(e,n){this.asyncQueue=e,this.onlineStateHandler=n,this.state="Unknown",this._a=0,this.aa=null,this.ua=!0}ca(){this._a===0&&(this.la("Unknown"),this.aa=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.aa=null,this.ha("Backend didn't respond within 10 seconds."),this.la("Offline"),Promise.resolve())))}Pa(e){this.state==="Online"?this.la("Unknown"):(this._a++,this._a>=1&&(this.Ta(),this.ha(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.la("Offline")))}set(e){this.Ta(),this._a=0,e==="Online"&&(this.ua=!1),this.la(e)}la(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}ha(e){const n=`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.ua?(hs(n),this.ua=!1):J("OnlineStateTracker",n)}Ta(){this.aa!==null&&(this.aa.cancel(),this.aa=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 To="RemoteStore";class rz{constructor(e,n,r,s,i){this.localStore=e,this.datastore=n,this.asyncQueue=r,this.remoteSyncer={},this.Ia=[],this.Ea=new Map,this.da=new Set,this.Aa=[],this.Ra=i,this.Ra.No(o=>{r.enqueueAndForget(async()=>{Po(this)&&(J(To,"Restarting streams for network reachability change."),await async function(l){const u=he(l);u.da.add(4),await Ic(u),u.Va.set("Unknown"),u.da.delete(4),await hp(u)}(this))})}),this.Va=new nz(r,s)}}async function hp(t){if(Po(t))for(const e of t.Aa)await e(!0)}async function Ic(t){for(const e of t.Aa)await e(!1)}function ck(t,e){const n=he(t);n.Ea.has(e.targetId)||(n.Ea.set(e.targetId,e),sw(n)?rw(n):ol(n).N_()&&nw(n,e))}function tw(t,e){const n=he(t),r=ol(n);n.Ea.delete(e),r.N_()&&dk(n,e),n.Ea.size===0&&(r.N_()?r.k_():Po(n)&&n.Va.set("Unknown"))}function nw(t,e){if(t.ma.Ke(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(de.min())>0){const n=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(n)}ol(t).Z_(e)}function dk(t,e){t.ma.Ke(e),ol(t).X_(e)}function rw(t){t.ma=new X$({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),Rt:e=>t.Ea.get(e)||null,Pt:()=>t.datastore.serializer.databaseId}),ol(t).start(),t.Va.ca()}function sw(t){return Po(t)&&!ol(t).O_()&&t.Ea.size>0}function Po(t){return he(t).da.size===0}function hk(t){t.ma=void 0}async function sz(t){t.Va.set("Online")}async function iz(t){t.Ea.forEach((e,n)=>{nw(t,e)})}async function oz(t,e){hk(t),sw(t)?(t.Va.Pa(e),rw(t)):t.Va.set("Unknown")}async function az(t,e,n){if(t.Va.set("Online"),e instanceof YR&&e.state===2&&e.cause)try{await async function(s,i){const o=i.cause;for(const a of i.targetIds)s.Ea.has(a)&&(await s.remoteSyncer.rejectListen(a,o),s.Ea.delete(a),s.ma.removeTarget(a))}(t,e)}catch(r){J(To,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await sf(t,r)}else if(e instanceof rh?t.ma.Xe(e):e instanceof QR?t.ma.ot(e):t.ma.nt(e),!n.isEqual(de.min()))try{const r=await ak(t.localStore);n.compareTo(r)>=0&&await function(i,o){const a=i.ma.It(o);return a.targetChanges.forEach((l,u)=>{if(l.resumeToken.approximateByteSize()>0){const d=i.Ea.get(u);d&&i.Ea.set(u,d.withResumeToken(l.resumeToken,o))}}),a.targetMismatches.forEach((l,u)=>{const d=i.Ea.get(l);if(!d)return;i.Ea.set(l,d.withResumeToken(Ft.EMPTY_BYTE_STRING,d.snapshotVersion)),dk(i,l);const h=new Ys(d.target,l,u,d.sequenceNumber);nw(i,h)}),i.remoteSyncer.applyRemoteEvent(a)}(t,n)}catch(r){J(To,"Failed to raise snapshot:",r),await sf(t,r)}}async function sf(t,e,n){if(!il(e))throw e;t.da.add(1),await Ic(t),t.Va.set("Offline"),n||(n=()=>ak(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{J(To,"Retrying IndexedDB access"),await n(),t.da.delete(1),await hp(t)})}function fk(t,e){return e().catch(n=>sf(t,n,e))}async function fp(t){const e=he(t),n=Ti(e);let r=e.Ia.length>0?e.Ia[e.Ia.length-1].batchId:U0;for(;lz(e);)try{const s=await zB(e.localStore,r);if(s===null){e.Ia.length===0&&n.k_();break}r=s.batchId,uz(e,s)}catch(s){await sf(e,s)}pk(e)&&mk(e)}function lz(t){return Po(t)&&t.Ia.length<10}function uz(t,e){t.Ia.push(e);const n=Ti(t);n.N_()&&n.ea&&n.ta(e.mutations)}function pk(t){return Po(t)&&!Ti(t).O_()&&t.Ia.length>0}function mk(t){Ti(t).start()}async function cz(t){Ti(t).ia()}async function dz(t){const e=Ti(t);for(const n of t.Ia)e.ta(n.mutations)}async function hz(t,e,n){const r=t.Ia.shift(),s=G0.from(r,e,n);await fk(t,()=>t.remoteSyncer.applySuccessfulWrite(s)),await fp(t)}async function fz(t,e){e&&Ti(t).ea&&await async function(r,s){if(function(o){return Q$(o)&&o!==$.ABORTED}(s.code)){const i=r.Ia.shift();Ti(r).L_(),await fk(r,()=>r.remoteSyncer.rejectFailedWrite(i.batchId,s)),await fp(r)}}(t,e),pk(t)&&mk(t)}async function e1(t,e){const n=he(t);n.asyncQueue.verifyOperationInProgress(),J(To,"RemoteStore received new credentials");const r=Po(n);n.da.add(3),await Ic(n),r&&n.Va.set("Unknown"),await n.remoteSyncer.handleCredentialChange(e),n.da.delete(3),await hp(n)}async function pz(t,e){const n=he(t);e?(n.da.delete(2),await hp(n)):e||(n.da.add(2),await Ic(n),n.Va.set("Unknown"))}function ol(t){return t.fa||(t.fa=function(n,r,s){const i=he(n);return i.oa(),new JB(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)}(t.datastore,t.asyncQueue,{e_:sz.bind(null,t),n_:iz.bind(null,t),i_:oz.bind(null,t),Y_:az.bind(null,t)}),t.Aa.push(async e=>{e?(t.fa.L_(),sw(t)?rw(t):t.Va.set("Unknown")):(await t.fa.stop(),hk(t))})),t.fa}function Ti(t){return t.ga||(t.ga=function(n,r,s){const i=he(n);return i.oa(),new ZB(r,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)}(t.datastore,t.asyncQueue,{e_:()=>Promise.resolve(),n_:cz.bind(null,t),i_:fz.bind(null,t),na:dz.bind(null,t),ra:hz.bind(null,t)}),t.Aa.push(async e=>{e?(t.ga.L_(),await fp(t)):(await t.ga.stop(),t.Ia.length>0&&(J(To,`Stopping write stream with ${t.Ia.length} pending writes`),t.Ia=[]))})),t.ga}/** * @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 iw{constructor(e,n,r,s,i){this.asyncQueue=e,this.timerId=n,this.targetTimeMs=r,this.op=s,this.removalCallback=i,this.deferred=new oo,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,n,r,s,i){const o=Date.now()+r,a=new iw(e,n,o,s,i);return a.start(r),a}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new ne($.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 ow(t,e){if(hs("AsyncQueue",`${e}: ${t}`),il(t))return new ne($.UNAVAILABLE,`${e}: ${t}`);throw 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 ga{static emptySet(e){return new ga(e.comparator)}constructor(e){this.comparator=e?(n,r)=>e(n,r)||se.comparator(n.key,r.key):(n,r)=>se.comparator(n.key,r.key),this.keyedMap=Bl(),this.sortedSet=new rt(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 n=this.keyedMap.get(e);return n?this.sortedSet.indexOf(n):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((n,r)=>(e(n),!1))}add(e){const n=this.delete(e.key);return n.copy(n.keyedMap.insert(e.key,e),n.sortedSet.insert(e,null))}delete(e){const n=this.get(e);return n?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(n)):this}isEqual(e){if(!(e instanceof ga)||this.size!==e.size)return!1;const n=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;n.hasNext();){const s=n.getNext().key,i=r.getNext().key;if(!s.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach(n=>{e.push(n.toString())}),e.length===0?"DocumentSet ()":`DocumentSet ( `+e.join(` `)+` )`}copy(e,n){const r=new ga;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=n,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. */class t1{constructor(){this.pa=new rt(se.comparator)}track(e){const n=e.doc.key,r=this.pa.get(n);r?e.type!==0&&r.type===3?this.pa=this.pa.insert(n,e):e.type===3&&r.type!==1?this.pa=this.pa.insert(n,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.pa=this.pa.insert(n,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.pa=this.pa.insert(n,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.pa=this.pa.remove(n):e.type===1&&r.type===2?this.pa=this.pa.insert(n,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.pa=this.pa.insert(n,{type:2,doc:e.doc}):oe(63341,{Vt:e,ya:r}):this.pa=this.pa.insert(n,e)}wa(){const e=[];return this.pa.inorderTraversal((n,r)=>{e.push(r)}),e}}class za{constructor(e,n,r,s,i,o,a,l,u){this.query=e,this.docs=n,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=a,this.excludesMetadataChanges=l,this.hasCachedResults=u}static fromInitialDocuments(e,n,r,s,i){const o=[];return n.forEach(a=>{o.push({type:0,doc:a})}),new za(e,n,ga.emptySet(n),o,r,s,!0,!1,i)}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)&&op(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const n=this.docChanges,r=e.docChanges;if(n.length!==r.length)return!1;for(let s=0;se.va())}}class gz{constructor(){this.queries=n1(),this.onlineState="Unknown",this.Ca=new Set}terminate(){(function(n,r){const s=he(n),i=s.queries;s.queries=n1(),i.forEach((o,a)=>{for(const l of a.Sa)l.onError(r)})})(this,new ne($.ABORTED,"Firestore shutting down"))}}function n1(){return new Io(t=>MR(t),op)}async function yz(t,e){const n=he(t);let r=3;const s=e.query;let i=n.queries.get(s);i?!i.Da()&&e.va()&&(r=2):(i=new mz,r=e.va()?0:1);try{switch(r){case 0:i.ba=await n.onListen(s,!0);break;case 1:i.ba=await n.onListen(s,!1);break;case 2:await n.onFirstRemoteStoreListen(s)}}catch(o){const a=ow(o,`Initialization of query '${Fo(e.query)}' failed`);return void e.onError(a)}n.queries.set(s,i),i.Sa.push(e),e.Fa(n.onlineState),i.ba&&e.Ma(i.ba)&&aw(n)}async function vz(t,e){const n=he(t),r=e.query;let s=3;const i=n.queries.get(r);if(i){const o=i.Sa.indexOf(e);o>=0&&(i.Sa.splice(o,1),i.Sa.length===0?s=e.va()?0:1:!i.Da()&&e.va()&&(s=2))}switch(s){case 0:return n.queries.delete(r),n.onUnlisten(r,!0);case 1:return n.queries.delete(r),n.onUnlisten(r,!1);case 2:return n.onLastRemoteStoreUnlisten(r);default:return}}function wz(t,e){const n=he(t);let r=!1;for(const s of e){const i=s.query,o=n.queries.get(i);if(o){for(const a of o.Sa)a.Ma(s)&&(r=!0);o.ba=s}}r&&aw(n)}function xz(t,e,n){const r=he(t),s=r.queries.get(e);if(s)for(const i of s.Sa)i.onError(n);r.queries.delete(e)}function aw(t){t.Ca.forEach(e=>{e.next()})}var Ry,r1;(r1=Ry||(Ry={})).xa="default",r1.Cache="cache";class _z{constructor(e,n,r){this.query=e,this.Oa=n,this.Na=!1,this.Ba=null,this.onlineState="Unknown",this.options=r||{}}Ma(e){if(!this.options.includeMetadataChanges){const r=[];for(const s of e.docChanges)s.type!==3&&r.push(s);e=new za(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let n=!1;return this.Na?this.La(e)&&(this.Oa.next(e),n=!0):this.ka(e,this.onlineState)&&(this.qa(e),n=!0),this.Ba=e,n}onError(e){this.Oa.error(e)}Fa(e){this.onlineState=e;let n=!1;return this.Ba&&!this.Na&&this.ka(this.Ba,e)&&(this.qa(this.Ba),n=!0),n}ka(e,n){if(!e.fromCache||!this.va())return!0;const r=n!=="Offline";return(!this.options.Qa||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||n==="Offline")}La(e){if(e.docChanges.length>0)return!0;const n=this.Ba&&this.Ba.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!n)&&this.options.includeMetadataChanges===!0}qa(e){e=za.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Na=!0,this.Oa.next(e)}va(){return this.options.source!==Ry.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 gk{constructor(e){this.key=e}}class yk{constructor(e){this.key=e}}class Ez{constructor(e,n){this.query=e,this.Ha=n,this.Ja=null,this.hasCachedResults=!1,this.current=!1,this.Ya=xe(),this.mutatedKeys=xe(),this.Za=VR(e),this.Xa=new ga(this.Za)}get eu(){return this.Ha}tu(e,n){const r=n?n.nu:new t1,s=n?n.Xa:this.Xa;let i=n?n.mutatedKeys:this.mutatedKeys,o=s,a=!1;const l=this.query.limitType==="F"&&s.size===this.query.limit?s.last():null,u=this.query.limitType==="L"&&s.size===this.query.limit?s.first():null;if(e.inorderTraversal((d,h)=>{const f=s.get(d),p=ap(this.query,h)?h:null,g=!!f&&this.mutatedKeys.has(f.key),w=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let _=!1;f&&p?f.data.isEqual(p.data)?g!==w&&(r.track({type:3,doc:p}),_=!0):this.ru(f,p)||(r.track({type:2,doc:p}),_=!0,(l&&this.Za(p,l)>0||u&&this.Za(p,u)<0)&&(a=!0)):!f&&p?(r.track({type:0,doc:p}),_=!0):f&&!p&&(r.track({type:1,doc:f}),_=!0,(l||u)&&(a=!0)),_&&(p?(o=o.add(p),i=w?i.add(d):i.delete(d)):(o=o.delete(d),i=i.delete(d)))}),this.query.limit!==null)for(;o.size>this.query.limit;){const d=this.query.limitType==="F"?o.last():o.first();o=o.delete(d.key),i=i.delete(d.key),r.track({type:1,doc:d})}return{Xa:o,nu:r,Cs:a,mutatedKeys:i}}ru(e,n){return e.hasLocalMutations&&n.hasCommittedMutations&&!n.hasLocalMutations}applyChanges(e,n,r,s){const i=this.Xa;this.Xa=e.Xa,this.mutatedKeys=e.mutatedKeys;const o=e.nu.wa();o.sort((d,h)=>function(p,g){const w=_=>{switch(_){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return oe(20277,{Vt:_})}};return w(p)-w(g)}(d.type,h.type)||this.Za(d.doc,h.doc)),this.iu(r),s=s!=null&&s;const a=n&&!s?this.su():[],l=this.Ya.size===0&&this.current&&!s?1:0,u=l!==this.Ja;return this.Ja=l,o.length!==0||u?{snapshot:new za(this.query,e.Xa,i,o,e.mutatedKeys,l===0,u,!1,!!r&&r.resumeToken.approximateByteSize()>0),ou:a}:{ou:a}}Fa(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Xa:this.Xa,nu:new t1,mutatedKeys:this.mutatedKeys,Cs:!1},!1)):{ou:[]}}_u(e){return!this.Ha.has(e)&&!!this.Xa.has(e)&&!this.Xa.get(e).hasLocalMutations}iu(e){e&&(e.addedDocuments.forEach(n=>this.Ha=this.Ha.add(n)),e.modifiedDocuments.forEach(n=>{}),e.removedDocuments.forEach(n=>this.Ha=this.Ha.delete(n)),this.current=e.current)}su(){if(!this.current)return[];const e=this.Ya;this.Ya=xe(),this.Xa.forEach(r=>{this._u(r.key)&&(this.Ya=this.Ya.add(r.key))});const n=[];return e.forEach(r=>{this.Ya.has(r)||n.push(new yk(r))}),this.Ya.forEach(r=>{e.has(r)||n.push(new gk(r))}),n}au(e){this.Ha=e.$s,this.Ya=xe();const n=this.tu(e.documents);return this.applyChanges(n,!0)}uu(){return za.fromInitialDocuments(this.query,this.Xa,this.mutatedKeys,this.Ja===0,this.hasCachedResults)}}const lw="SyncEngine";class Tz{constructor(e,n,r){this.query=e,this.targetId=n,this.view=r}}class bz{constructor(e){this.key=e,this.cu=!1}}class Sz{constructor(e,n,r,s,i,o){this.localStore=e,this.remoteStore=n,this.eventManager=r,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.lu={},this.hu=new Io(a=>MR(a),op),this.Pu=new Map,this.Tu=new Set,this.Iu=new rt(se.comparator),this.Eu=new Map,this.du=new X0,this.Au={},this.Ru=new Map,this.Vu=Ba.lr(),this.onlineState="Unknown",this.mu=void 0}get isPrimaryClient(){return this.mu===!0}}async function Cz(t,e,n=!0){const r=Tk(t);let s;const i=r.hu.get(e);return i?(r.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.uu()):s=await vk(r,e,n,!0),s}async function Iz(t,e){const n=Tk(t);await vk(n,e,!0,!1)}async function vk(t,e,n,r){const s=await HB(t.localStore,Dr(e)),i=s.targetId,o=t.sharedClientState.addLocalQueryTarget(i,n);let a;return r&&(a=await Pz(t,e,i,o==="current",s.resumeToken)),t.isPrimaryClient&&n&&ck(t.remoteStore,s),a}async function Pz(t,e,n,r,s){t.fu=(h,f,p)=>async function(w,_,v,x){let T=_.view.tu(v);T.Cs&&(T=await QT(w.localStore,_.query,!1).then(({documents:C})=>_.view.tu(C,T)));const A=x&&x.targetChanges.get(_.targetId),k=x&&x.targetMismatches.get(_.targetId)!=null,L=_.view.applyChanges(T,w.isPrimaryClient,A,k);return i1(w,_.targetId,L.ou),L.snapshot}(t,h,f,p);const i=await QT(t.localStore,e,!0),o=new Ez(e,i.$s),a=o.tu(i.documents),l=Cc.createSynthesizedTargetChangeForCurrentChange(n,r&&t.onlineState!=="Offline",s),u=o.applyChanges(a,t.isPrimaryClient,l);i1(t,n,u.ou);const d=new Tz(e,n,o);return t.hu.set(e,d),t.Pu.has(n)?t.Pu.get(n).push(e):t.Pu.set(n,[e]),u.snapshot}async function Az(t,e,n){const r=he(t),s=r.hu.get(e),i=r.Pu.get(s.targetId);if(i.length>1)return r.Pu.set(s.targetId,i.filter(o=>!op(o,e))),void r.hu.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedClientState.isActiveQueryTarget(s.targetId)||await Py(r.localStore,s.targetId,!1).then(()=>{r.sharedClientState.clearQueryState(s.targetId),n&&tw(r.remoteStore,s.targetId),ky(r,s.targetId)}).catch(sl)):(ky(r,s.targetId),await Py(r.localStore,s.targetId,!0))}async function Rz(t,e){const n=he(t),r=n.hu.get(e),s=n.Pu.get(r.targetId);n.isPrimaryClient&&s.length===1&&(n.sharedClientState.removeLocalQueryTarget(r.targetId),tw(n.remoteStore,r.targetId))}async function kz(t,e,n){const r=jz(t);try{const s=await function(o,a){const l=he(o),u=bt.now(),d=a.reduce((p,g)=>p.add(g.key),xe());let h,f;return l.persistence.runTransaction("Locally write mutations","readwrite",p=>{let g=fs(),w=xe();return l.Bs.getEntries(p,d).next(_=>{g=_,g.forEach((v,x)=>{x.isValidDocument()||(w=w.add(v))})}).next(()=>l.localDocuments.getOverlayedDocuments(p,g)).next(_=>{h=_;const v=[];for(const x of a){const T=H$(x,h.get(x.key).overlayedDocument);T!=null&&v.push(new Ni(x.key,T,PR(T.value.mapValue),hr.exists(!0)))}return l.mutationQueue.addMutationBatch(p,u,v,a)}).next(_=>{f=_;const v=_.applyToLocalDocumentSet(h,w);return l.documentOverlayCache.saveOverlays(p,_.batchId,v)})}).then(()=>({batchId:f.batchId,changes:FR(h)}))}(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),function(o,a,l){let u=o.Au[o.currentUser.toKey()];u||(u=new rt(pe)),u=u.insert(a,l),o.Au[o.currentUser.toKey()]=u}(r,s.batchId,n),await Pc(r,s.changes),await fp(r.remoteStore)}catch(s){const i=ow(s,"Failed to persist write");n.reject(i)}}async function wk(t,e){const n=he(t);try{const r=await $B(n.localStore,e);e.targetChanges.forEach((s,i)=>{const o=n.Eu.get(i);o&&(ke(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.cu=!0:s.modifiedDocuments.size>0?ke(o.cu,14607):s.removedDocuments.size>0&&(ke(o.cu,42227),o.cu=!1))}),await Pc(n,r,e)}catch(r){await sl(r)}}function s1(t,e,n){const r=he(t);if(r.isPrimaryClient&&n===0||!r.isPrimaryClient&&n===1){const s=[];r.hu.forEach((i,o)=>{const a=o.view.Fa(e);a.snapshot&&s.push(a.snapshot)}),function(o,a){const l=he(o);l.onlineState=a;let u=!1;l.queries.forEach((d,h)=>{for(const f of h.Sa)f.Fa(a)&&(u=!0)}),u&&aw(l)}(r.eventManager,e),s.length&&r.lu.Y_(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function Nz(t,e,n){const r=he(t);r.sharedClientState.updateQueryState(e,"rejected",n);const s=r.Eu.get(e),i=s&&s.key;if(i){let o=new rt(se.comparator);o=o.insert(i,Yt.newNoDocument(i,de.min()));const a=xe().add(i),l=new cp(de.min(),new Map,new rt(pe),o,a);await wk(r,l),r.Iu=r.Iu.remove(i),r.Eu.delete(e),uw(r)}else await Py(r.localStore,e,!1).then(()=>ky(r,e,n)).catch(sl)}async function Dz(t,e){const n=he(t),r=e.batch.batchId;try{const s=await UB(n.localStore,e);_k(n,r,null),xk(n,r),n.sharedClientState.updateMutationState(r,"acknowledged"),await Pc(n,s)}catch(s){await sl(s)}}async function Oz(t,e,n){const r=he(t);try{const s=await function(o,a){const l=he(o);return l.persistence.runTransaction("Reject batch","readwrite-primary",u=>{let d;return l.mutationQueue.lookupMutationBatch(u,a).next(h=>(ke(h!==null,37113),d=h.keys(),l.mutationQueue.removeMutationBatch(u,h))).next(()=>l.mutationQueue.performConsistencyCheck(u)).next(()=>l.documentOverlayCache.removeOverlaysForBatchId(u,d,a)).next(()=>l.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(u,d)).next(()=>l.localDocuments.getDocuments(u,d))})}(r.localStore,e);_k(r,e,n),xk(r,e),r.sharedClientState.updateMutationState(e,"rejected",n),await Pc(r,s)}catch(s){await sl(s)}}function xk(t,e){(t.Ru.get(e)||[]).forEach(n=>{n.resolve()}),t.Ru.delete(e)}function _k(t,e,n){const r=he(t);let s=r.Au[r.currentUser.toKey()];if(s){const i=s.get(e);i&&(n?i.reject(n):i.resolve(),s=s.remove(e)),r.Au[r.currentUser.toKey()]=s}}function ky(t,e,n=null){t.sharedClientState.removeLocalQueryTarget(e);for(const r of t.Pu.get(e))t.hu.delete(r),n&&t.lu.gu(r,n);t.Pu.delete(e),t.isPrimaryClient&&t.du.Hr(e).forEach(r=>{t.du.containsKey(r)||Ek(t,r)})}function Ek(t,e){t.Tu.delete(e.path.canonicalString());const n=t.Iu.get(e);n!==null&&(tw(t.remoteStore,n),t.Iu=t.Iu.remove(e),t.Eu.delete(n),uw(t))}function i1(t,e,n){for(const r of n)r instanceof gk?(t.du.addReference(r.key,e),Lz(t,r)):r instanceof yk?(J(lw,"Document no longer in limbo: "+r.key),t.du.removeReference(r.key,e),t.du.containsKey(r.key)||Ek(t,r.key)):oe(19791,{pu:r})}function Lz(t,e){const n=e.key,r=n.path.canonicalString();t.Iu.get(n)||t.Tu.has(r)||(J(lw,"New document in limbo: "+n),t.Tu.add(r),uw(t))}function uw(t){for(;t.Tu.size>0&&t.Iu.size{o.push(r.fu(l,e,n).then(u=>{var d;if((u||n)&&r.isPrimaryClient){const h=u?!u.fromCache:(d=n==null?void 0:n.targetChanges.get(l.targetId))===null||d===void 0?void 0:d.current;r.sharedClientState.updateQueryState(l.targetId,h?"current":"not-current")}if(u){s.push(u);const h=Z0.Rs(l.targetId,u);i.push(h)}}))}),await Promise.all(o),r.lu.Y_(s),await async function(l,u){const d=he(l);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>U.forEach(u,f=>U.forEach(f.ds,p=>d.persistence.referenceDelegate.addReference(h,f.targetId,p)).next(()=>U.forEach(f.As,p=>d.persistence.referenceDelegate.removeReference(h,f.targetId,p)))))}catch(h){if(!il(h))throw h;J(ew,"Failed to update sequence numbers: "+h)}for(const h of u){const f=h.targetId;if(!h.fromCache){const p=d.xs.get(f),g=p.snapshotVersion,w=p.withLastLimboFreeSnapshotVersion(g);d.xs=d.xs.insert(f,w)}}}(r.localStore,i))}async function Mz(t,e){const n=he(t);if(!n.currentUser.isEqual(e)){J(lw,"User change. New user:",e.toKey());const r=await ok(n.localStore,e);n.currentUser=e,function(i,o){i.Ru.forEach(a=>{a.forEach(l=>{l.reject(new ne($.CANCELLED,o))})}),i.Ru.clear()}(n,"'waitForPendingWrites' promise is rejected due to a user change."),n.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await Pc(n,r.ks)}}function Vz(t,e){const n=he(t),r=n.Eu.get(e);if(r&&r.cu)return xe().add(r.key);{let s=xe();const i=n.Pu.get(e);if(!i)return s;for(const o of i){const a=n.hu.get(o);s=s.unionWith(a.view.eu)}return s}}function Tk(t){const e=he(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=wk.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=Vz.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=Nz.bind(null,e),e.lu.Y_=wz.bind(null,e.eventManager),e.lu.gu=xz.bind(null,e.eventManager),e}function jz(t){const e=he(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=Dz.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=Oz.bind(null,e),e}class of{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=dp(e.databaseInfo.databaseId),this.sharedClientState=this.bu(e),this.persistence=this.Su(e),await this.persistence.start(),this.localStore=this.Du(e),this.gcScheduler=this.vu(e,this.localStore),this.indexBackfillerScheduler=this.Cu(e,this.localStore)}vu(e,n){return null}Cu(e,n){return null}Du(e){return FB(this.persistence,new MB,e.initialUser,this.serializer)}Su(e){return new ik(J0.fi,this.serializer)}bu(e){return new qB}async terminate(){var e,n;(e=this.gcScheduler)===null||e===void 0||e.stop(),(n=this.indexBackfillerScheduler)===null||n===void 0||n.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}of.provider={build:()=>new of};class Fz extends of{constructor(e){super(),this.cacheSizeBytes=e}vu(e,n){ke(this.persistence.referenceDelegate instanceof rf,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new _B(r,e.asyncQueue,n)}Su(e){const n=this.cacheSizeBytes!==void 0?hn.withCacheSize(this.cacheSizeBytes):hn.DEFAULT;return new ik(r=>rf.fi(r,n),this.serializer)}}class Ny{async initialize(e,n){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(n),this.remoteStore=this.createRemoteStore(n),this.eventManager=this.createEventManager(n),this.syncEngine=this.createSyncEngine(n,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>s1(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=Mz.bind(null,this.syncEngine),await pz(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new gz}()}createDatastore(e){const n=dp(e.databaseInfo.databaseId),r=function(i){return new XB(i)}(e.databaseInfo);return function(i,o,a,l){return new tz(i,o,a,l)}(e.authCredentials,e.appCheckCredentials,r,n)}createRemoteStore(e){return function(r,s,i,o,a){return new rz(r,s,i,o,a)}(this.localStore,this.datastore,e.asyncQueue,n=>s1(this.syncEngine,n,0),function(){return JT.C()?new JT:new KB}())}createSyncEngine(e,n){return function(s,i,o,a,l,u,d){const h=new Sz(s,i,o,a,l,u);return d&&(h.mu=!0),h}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,n)}async terminate(){var e,n;await async function(s){const i=he(s);J(To,"RemoteStore shutting down."),i.da.add(5),await Ic(i),i.Ra.shutdown(),i.Va.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(n=this.eventManager)===null||n===void 0||n.terminate()}}Ny.provider={build:()=>new Ny};/** * @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 Uz{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Mu(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Mu(this.observer.error,e):hs("Uncaught Error in snapshot listener:",e.toString()))}xu(){this.muted=!0}Mu(e,n){setTimeout(()=>{this.muted||e(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. */const bi="FirestoreClient";class $z{constructor(e,n,r,s,i){this.authCredentials=e,this.appCheckCredentials=n,this.asyncQueue=r,this.databaseInfo=s,this.user=Gt.UNAUTHENTICATED,this.clientId=vR.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(r,async o=>{J(bi,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(r,o=>(J(bi,"Received new app check token=",o),this.appCheckCredentialListener(o,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 oo;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(n){const r=ow(n,"Failed to shutdown persistence");e.reject(r)}}),e.promise}}async function km(t,e){t.asyncQueue.verifyOperationInProgress(),J(bi,"Initializing OfflineComponentProvider");const n=t.configuration;await e.initialize(n);let r=n.initialUser;t.setCredentialChangeListener(async s=>{r.isEqual(s)||(await ok(e.localStore,s),r=s)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function o1(t,e){t.asyncQueue.verifyOperationInProgress();const n=await Bz(t);J(bi,"Initializing OnlineComponentProvider"),await e.initialize(n,t.configuration),t.setCredentialChangeListener(r=>e1(e.remoteStore,r)),t.setAppCheckTokenChangeListener((r,s)=>e1(e.remoteStore,s)),t._onlineComponents=e}async function Bz(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){J(bi,"Using user provided OfflineComponentProvider");try{await km(t,t._uninitializedComponentsProvider._offline)}catch(e){const n=e;if(!function(s){return s.name==="FirebaseError"?s.code===$.FAILED_PRECONDITION||s.code===$.UNIMPLEMENTED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11}(n))throw n;ja("Error using user provided cache. Falling back to memory cache: "+n),await km(t,new of)}}else J(bi,"Using default OfflineComponentProvider"),await km(t,new Fz(void 0));return t._offlineComponents}async function bk(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(J(bi,"Using user provided OnlineComponentProvider"),await o1(t,t._uninitializedComponentsProvider._online)):(J(bi,"Using default OnlineComponentProvider"),await o1(t,new Ny))),t._onlineComponents}function zz(t){return bk(t).then(e=>e.syncEngine)}async function a1(t){const e=await bk(t),n=e.eventManager;return n.onListen=Cz.bind(null,e.syncEngine),n.onUnlisten=Az.bind(null,e.syncEngine),n.onFirstRemoteStoreListen=Iz.bind(null,e.syncEngine),n.onLastRemoteStoreUnlisten=Rz.bind(null,e.syncEngine),n}/** * @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 Sk(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.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 l1=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 Ck(t,e,n){if(!n)throw new ne($.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function Hz(t,e,n,r){if(e===!0&&r===!0)throw new ne($.INVALID_ARGUMENT,`${t} and ${n} cannot be used together.`)}function u1(t){if(!se.isDocumentKey(t))throw new ne($.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function c1(t){if(se.isDocumentKey(t))throw new ne($.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function pp(t){if(t===void 0)return"undefined";if(t===null)return"null";if(typeof t=="string")return t.length>20&&(t=`${t.substring(0,20)}...`),JSON.stringify(t);if(typeof t=="number"||typeof t=="boolean")return""+t;if(typeof t=="object"){if(t instanceof Array)return"an array";{const e=function(r){return r.constructor?r.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":oe(12329,{type:typeof t})}function uu(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new ne($.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const n=pp(t);throw new ne($.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${n}`)}}return 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. */const Ik="firestore.googleapis.com",d1=!0;class h1{constructor(e){var n,r;if(e.host===void 0){if(e.ssl!==void 0)throw new ne($.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=Ik,this.ssl=d1}else this.host=e.host,this.ssl=(n=e.ssl)!==null&&n!==void 0?n:d1;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=sk;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes30)throw new ne($.INVALID_ARGUMENT,`invalid long polling timeout: ${i.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(r,s){return r.timeoutSeconds===s.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class mp{constructor(e,n,r,s){this._authCredentials=e,this._appCheckCredentials=n,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new h1({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new ne($.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 ne($.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 h1(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=function(r){if(!r)return new YU;switch(r.type){case"firstParty":return new e$(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new ne($.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(n){const r=l1.get(n);r&&(J("ComponentProvider","Removing Datastore"),l1.delete(n),r.terminate())}(this),Promise.resolve()}}function Wz(t,e,n,r={}){var s;t=uu(t,mp);const i=yc(e),o=t._getSettings(),a=Object.assign(Object.assign({},o),{emulatorOptions:t._getEmulatorOptions()}),l=`${e}:${n}`;i&&(EA(`https://${l}`),TA("Firestore",!0)),o.host!==Ik&&o.host!==l&&ja("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const u=Object.assign(Object.assign({},o),{host:l,ssl:i,emulatorOptions:r});if(!vo(u,a)&&(t._setSettings(u),r.mockUserToken)){let d,h;if(typeof r.mockUserToken=="string")d=r.mockUserToken,h=Gt.MOCK_USER;else{d=t5(r.mockUserToken,(s=t._app)===null||s===void 0?void 0:s.options.projectId);const f=r.mockUserToken.sub||r.mockUserToken.user_id;if(!f)throw new ne($.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");h=new Gt(f)}t._authCredentials=new XU(new gR(d,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. */class al{constructor(e,n,r){this.converter=n,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new al(this.firestore,e,this._query)}}class Rn{constructor(e,n,r){this.converter=n,this._key=r,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 ci(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Rn(this.firestore,e,this._key)}}class ci extends al{constructor(e,n,r){super(e,n,W0(r)),this._path=r,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 Rn(this.firestore,null,new se(e))}withConverter(e){return new ci(this.firestore,e,this._path)}}function Pk(t,e,...n){if(t=pt(t),Ck("collection","path",e),t instanceof mp){const r=He.fromString(e,...n);return c1(r),new ci(t,null,r)}{if(!(t instanceof Rn||t instanceof ci))throw new ne($.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(He.fromString(e,...n));return c1(r),new ci(t.firestore,null,r)}}function MY(t,e,...n){if(t=pt(t),arguments.length===1&&(e=vR.newId()),Ck("doc","path",e),t instanceof mp){const r=He.fromString(e,...n);return u1(r),new Rn(t,null,new se(r))}{if(!(t instanceof Rn||t instanceof ci))throw new ne($.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=t._path.child(He.fromString(e,...n));return u1(r),new Rn(t.firestore,t instanceof ci?t.converter:null,new se(r))}}/** * @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 f1="AsyncQueue";class p1{constructor(e=Promise.resolve()){this.Ju=[],this.Yu=!1,this.Zu=[],this.Xu=null,this.ec=!1,this.tc=!1,this.nc=[],this.x_=new lk(this,"async_queue_retry"),this.rc=()=>{const r=Rm();r&&J(f1,"Visibility state changed to "+r.visibilityState),this.x_.b_()},this.sc=e;const n=Rm();n&&typeof n.addEventListener=="function"&&n.addEventListener("visibilitychange",this.rc)}get isShuttingDown(){return this.Yu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.oc(),this._c(e)}enterRestrictedMode(e){if(!this.Yu){this.Yu=!0,this.tc=e||!1;const n=Rm();n&&typeof n.removeEventListener=="function"&&n.removeEventListener("visibilitychange",this.rc)}}enqueue(e){if(this.oc(),this.Yu)return new Promise(()=>{});const n=new oo;return this._c(()=>this.Yu&&this.tc?Promise.resolve():(e().then(n.resolve,n.reject),n.promise)).then(()=>n.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Ju.push(e),this.ac()))}async ac(){if(this.Ju.length!==0){try{await this.Ju[0](),this.Ju.shift(),this.x_.reset()}catch(e){if(!il(e))throw e;J(f1,"Operation failed with retryable error: "+e)}this.Ju.length>0&&this.x_.y_(()=>this.ac())}}_c(e){const n=this.sc.then(()=>(this.ec=!0,e().catch(r=>{throw this.Xu=r,this.ec=!1,hs("INTERNAL UNHANDLED ERROR: ",m1(r)),r}).then(r=>(this.ec=!1,r))));return this.sc=n,n}enqueueAfterDelay(e,n,r){this.oc(),this.nc.indexOf(e)>-1&&(n=0);const s=iw.createAndSchedule(this,e,n,r,i=>this.uc(i));return this.Zu.push(s),s}oc(){this.Xu&&oe(47125,{cc:m1(this.Xu)})}verifyOperationInProgress(){}async lc(){let e;do e=this.sc,await e;while(e!==this.sc)}hc(e){for(const n of this.Zu)if(n.timerId===e)return!0;return!1}Pc(e){return this.lc().then(()=>{this.Zu.sort((n,r)=>n.targetTimeMs-r.targetTimeMs);for(const n of this.Zu)if(n.skipDelay(),e!=="all"&&n.timerId===e)break;return this.lc()})}Tc(e){this.nc.push(e)}uc(e){const n=this.Zu.indexOf(e);this.Zu.splice(n,1)}}function m1(t){let e=t.message||"";return t.stack&&(e=t.stack.includes(t.message)?t.stack:t.message+` `+t.stack),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. */function g1(t){return function(n,r){if(typeof n!="object"||n===null)return!1;const s=n;for(const i of r)if(i in s&&typeof s[i]=="function")return!0;return!1}(t,["next","error","complete"])}class af extends mp{constructor(e,n,r,s){super(e,n,r,s),this.type="firestore",this._queue=new p1,this._persistenceKey=(s==null?void 0:s.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new p1(e),this._firestoreClient=void 0,await e}}}function qz(t,e){const n=typeof t=="object"?t:IA(),r=typeof t=="string"?t:Yh,s=I0(n,"firestore").getImmediate({identifier:r});if(!s._initialized){const i=Z3("firestore");i&&Wz(s,...i)}return s}function cw(t){if(t._terminated)throw new ne($.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||Kz(t),t._firestoreClient}function Kz(t){var e,n,r;const s=t._freezeSettings(),i=function(a,l,u,d){return new m$(a,l,u,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,Sk(d.experimentalLongPollingOptions),d.useFetchStreams,d.isUsingEmulator)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,s);t._componentsProvider||!((n=s.localCache)===null||n===void 0)&&n._offlineComponentProvider&&(!((r=s.localCache)===null||r===void 0)&&r._onlineComponentProvider)&&(t._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),t._firestoreClient=new $z(t._authCredentials,t._appCheckCredentials,t._queue,i,t._componentsProvider&&function(a){const l=a==null?void 0:a._online.build();return{_offline:a==null?void 0:a._offline.build(l),_online:l}}(t._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 Ha{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Ha(Ft.fromBase64String(e))}catch(n){throw new ne($.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+n)}}static fromUint8Array(e){return new Ha(Ft.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 gp{constructor(...e){for(let n=0;n90)throw new ne($.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(n)||n<-180||n>180)throw new ne($.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+n);this._lat=e,this._long=n}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 pe(this._lat,e._lat)||pe(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 fw{constructor(e){this._values=(e||[]).map(n=>n)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(r,s){if(r.length!==s.length)return!1;for(let i=0;ie.isPrefixOf(n))!==void 0||this.fieldTransforms.find(n=>e.isPrefixOf(n.field))!==void 0}Ec(){if(this.path)for(let e=0;el.covers(h.field))}else l=null,u=o.fieldTransforms;return new Qz(new pn(a),l,u)}class yp extends dw{_toFieldTransform(e){if(e.Ic!==2)throw e.Ic===1?e.gc(`${this._methodName}() can only appear at the top level of your update data`):e.gc(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof yp}}function Jz(t,e,n,r){const s=t.bc(1,e,n);mw("Data must be an object, but it was:",s,r);const i=[],o=pn.empty();ki(r,(l,u)=>{const d=gw(e,l,n);u=pt(u);const h=s.mc(d);if(u instanceof yp)i.push(d);else{const f=Ac(u,h);f!=null&&(i.push(d),o.set(d,f))}});const a=new In(i);return new Ak(o,a,s.fieldTransforms)}function Zz(t,e,n,r,s,i){const o=t.bc(1,e,n),a=[Dy(e,r,n)],l=[s];if(i.length%2!=0)throw new ne($.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let f=0;f=0;--f)if(!Ok(u,a[f])){const p=a[f];let g=l[f];g=pt(g);const w=o.mc(p);if(g instanceof yp)u.push(p);else{const _=Ac(g,w);_!=null&&(u.push(p),d.set(p,_))}}const h=new In(u);return new Ak(d,h,o.fieldTransforms)}function e8(t,e,n,r=!1){return Ac(n,t.bc(r?4:3,e))}function Ac(t,e){if(Dk(t=pt(t)))return mw("Unsupported field value:",e,t),Nk(t,e);if(t instanceof dw)return function(r,s){if(!Rk(s.Ic))throw s.gc(`${r._methodName}() can only be used with update() and set()`);if(!s.path)throw s.gc(`${r._methodName}() is not currently supported inside arrays`);const i=r._toFieldTransform(s);i&&s.fieldTransforms.push(i)}(t,e),null;if(t===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),t instanceof Array){if(e.settings.Rc&&e.Ic!==4)throw e.gc("Nested arrays are not supported");return function(r,s){const i=[];let o=0;for(const a of r){let l=Ac(a,s.fc(o));l==null&&(l={nullValue:"NULL_VALUE"}),i.push(l),o++}return{arrayValue:{values:i}}}(t,e)}return function(r,s){if((r=pt(r))===null)return{nullValue:"NULL_VALUE"};if(typeof r=="number")return j$(s.serializer,r);if(typeof r=="boolean")return{booleanValue:r};if(typeof r=="string")return{stringValue:r};if(r instanceof Date){const i=bt.fromDate(r);return{timestampValue:nf(s.serializer,i)}}if(r instanceof bt){const i=new bt(r.seconds,1e3*Math.floor(r.nanoseconds/1e3));return{timestampValue:nf(s.serializer,i)}}if(r instanceof hw)return{geoPointValue:{latitude:r.latitude,longitude:r.longitude}};if(r instanceof Ha)return{bytesValue:XR(s.serializer,r._byteString)};if(r instanceof Rn){const i=s.databaseId,o=r.firestore._databaseId;if(!o.isEqual(i))throw s.gc(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:Y0(r.firestore._databaseId||s.databaseId,r._key.path)}}if(r instanceof fw)return function(o,a){return{mapValue:{fields:{[CR]:{stringValue:IR},[Xh]:{arrayValue:{values:o.toArray().map(u=>{if(typeof u!="number")throw a.gc("VectorValues must only contain numeric values.");return q0(a.serializer,u)})}}}}}}(r,s);throw s.gc(`Unsupported field value: ${pp(r)}`)}(t,e)}function Nk(t,e){const n={};return xR(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):ki(t,(r,s)=>{const i=Ac(s,e.Ac(r));i!=null&&(n[r]=i)}),{mapValue:{fields:n}}}function Dk(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof bt||t instanceof hw||t instanceof Ha||t instanceof Rn||t instanceof dw||t instanceof fw)}function mw(t,e,n){if(!Dk(n)||!function(s){return typeof s=="object"&&s!==null&&(Object.getPrototypeOf(s)===Object.prototype||Object.getPrototypeOf(s)===null)}(n)){const r=pp(n);throw r==="an object"?e.gc(t+" a custom object"):e.gc(t+" "+r)}}function Dy(t,e,n){if((e=pt(e))instanceof gp)return e._internalPath;if(typeof e=="string")return gw(t,e);throw lf("Field path arguments must be of type string or ",t,!1,void 0,n)}const t8=new RegExp("[~\\*/\\[\\]]");function gw(t,e,n){if(e.search(t8)>=0)throw lf(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,n);try{return new gp(...e.split("."))._internalPath}catch{throw lf(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,n)}}function lf(t,e,n,r,s){const i=r&&!r.isEmpty(),o=s!==void 0;let a=`Function ${e}() called with invalid data`;n&&(a+=" (via `toFirestore()`)"),a+=". ";let l="";return(i||o)&&(l+=" (found",i&&(l+=` in field ${r}`),o&&(l+=` in document ${s}`),l+=")"),new ne($.INVALID_ARGUMENT,a+t+l)}function Ok(t,e){return t.some(n=>n.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 Lk{constructor(e,n,r,s,i){this._firestore=e,this._userDataWriter=n,this._key=r,this._document=s,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Rn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new n8(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 n=this._document.data.field(Mk("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n)}}}class n8 extends Lk{data(){return super.data()}}function Mk(t,e){return typeof e=="string"?gw(t,e):e instanceof gp?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 r8(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new ne($.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class yw{}class s8 extends yw{}function Vk(t,e,...n){let r=[];e instanceof yw&&r.push(e),r=r.concat(n),function(i){const o=i.filter(l=>l instanceof ww).length,a=i.filter(l=>l instanceof vw).length;if(o>1||o>0&&a>0)throw new ne($.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(...)))`.")}(r);for(const s of r)t=s._apply(t);return t}class vw extends s8{constructor(e,n,r){super(),this._field=e,this._op=n,this._value=r,this.type="where"}static _create(e,n,r){return new vw(e,n,r)}_apply(e){const n=this._parse(e);return jk(e._query,n),new al(e.firestore,e.converter,Ey(e._query,n))}_parse(e){const n=kk(e.firestore);return function(i,o,a,l,u,d,h){let f;if(u.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new ne($.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){v1(h,d);const g=[];for(const w of h)g.push(y1(l,i,w));f={arrayValue:{values:g}}}else f=y1(l,i,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||v1(h,d),f=e8(a,o,h,d==="in"||d==="not-in");return wt.create(u,d,f)}(e._query,"where",n,e.firestore._databaseId,this._field,this._op,this._value)}}class ww extends yw{constructor(e,n){super(),this.type=e,this._queryConstraints=n}static _create(e,n){return new ww(e,n)}_parse(e){const n=this._queryConstraints.map(r=>r._parse(e)).filter(r=>r.getFilters().length>0);return n.length===1?n[0]:yr.create(n,this._getOperator())}_apply(e){const n=this._parse(e);return n.getFilters().length===0?e:(function(s,i){let o=s;const a=i.getFlattenedFilters();for(const l of a)jk(o,l),o=Ey(o,l)}(e._query,n),new al(e.firestore,e.converter,Ey(e._query,n)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function y1(t,e,n){if(typeof(n=pt(n))=="string"){if(n==="")throw new ne($.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!LR(e)&&n.indexOf("/")!==-1)throw new ne($.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${n}' contains a '/' character.`);const r=e.path.child(He.fromString(n));if(!se.isDocumentKey(r))throw new ne($.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return RT(t,new se(r))}if(n instanceof Rn)return RT(t,n._key);throw new ne($.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${pp(n)}.`)}function v1(t,e){if(!Array.isArray(t)||t.length===0)throw new ne($.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function jk(t,e){const n=function(s,i){for(const o of s)for(const a of o.getFlattenedFilters())if(i.indexOf(a.op)>=0)return a.op;return null}(t.filters,function(s){switch(s){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(n!==null)throw n===e.op?new ne($.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new ne($.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${n.toString()}' filters.`)}class i8{convertValue(e,n="none"){switch(Ei(e)){case 0:return null;case 1:return e.booleanValue;case 2:return dt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,n);case 5:return e.stringValue;case 6:return this.convertBytes(_i(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,n);case 11:return this.convertObject(e.mapValue,n);case 10:return this.convertVectorValue(e.mapValue);default:throw oe(62114,{value:e})}}convertObject(e,n){return this.convertObjectMap(e.fields,n)}convertObjectMap(e,n="none"){const r={};return ki(e,(s,i)=>{r[s]=this.convertValue(i,n)}),r}convertVectorValue(e){var n,r,s;const i=(s=(r=(n=e.fields)===null||n===void 0?void 0:n[Xh].arrayValue)===null||r===void 0?void 0:r.values)===null||s===void 0?void 0:s.map(o=>dt(o.doubleValue));return new fw(i)}convertGeoPoint(e){return new hw(dt(e.latitude),dt(e.longitude))}convertArray(e,n){return(e.values||[]).map(r=>this.convertValue(r,n))}convertServerTimestamp(e,n){switch(n){case"previous":const r=ip(e);return r==null?null:this.convertValue(r,n);case"estimate":return this.convertTimestamp(Wu(e));default:return null}}convertTimestamp(e){const n=xi(e);return new bt(n.seconds,n.nanos)}convertDocumentKey(e,n){const r=He.fromString(e);ke(rk(r),9688,{name:e});const s=new qu(r.get(1),r.get(3)),i=new se(r.popFirst(5));return s.isEqual(n)||hs(`Document ${i} contains a document reference within a different database (${s.projectId}/${s.database}) which is not supported. It will be treated as a reference in the current database (${n.projectId}/${n.database}) instead.`),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 o8(t,e,n){let r;return r=t?n&&(n.merge||n.mergeFields)?t.toFirestore(e,n):t.toFirestore(e):e,r}/** * @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 Hl{constructor(e,n){this.hasPendingWrites=e,this.fromCache=n}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Fk extends Lk{constructor(e,n,r,s,i,o){super(e,n,r,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const n=new sh(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(n,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,n={}){if(this._document){const r=this._document.data.field(Mk("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,n.serverTimestamps)}}}class sh extends Fk{data(e={}){return super.data(e)}}class a8{constructor(e,n,r,s){this._firestore=e,this._userDataWriter=n,this._snapshot=s,this.metadata=new Hl(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){const e=[];return this.forEach(n=>e.push(n)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,n){this._snapshot.docs.forEach(r=>{e.call(n,new sh(this._firestore,this._userDataWriter,r.key,r,new Hl(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const n=!!e.includeMetadataChanges;if(n&&this._snapshot.excludesMetadataChanges)throw new ne($.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===n||(this._cachedChanges=function(s,i){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map(a=>{const l=new sh(s._firestore,s._userDataWriter,a.doc.key,a.doc,new Hl(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);return a.doc,{type:"added",doc:l,oldIndex:-1,newIndex:o++}})}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter(a=>i||a.type!==3).map(a=>{const l=new sh(s._firestore,s._userDataWriter,a.doc.key,a.doc,new Hl(s._snapshot.mutatedKeys.has(a.doc.key),s._snapshot.fromCache),s.query.converter);let u=-1,d=-1;return a.type!==0&&(u=o.indexOf(a.doc.key),o=o.delete(a.doc.key)),a.type!==1&&(o=o.add(a.doc),d=o.indexOf(a.doc.key)),{type:l8(a.type),doc:l,oldIndex:u,newIndex:d}})}}(this,n),this._cachedChangesIncludeMetadataChanges=n),this._cachedChanges}}function l8(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return oe(61501,{type:t})}}class Uk extends i8{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ha(e)}convertReference(e){const n=this.convertDocumentKey(e,this.firestore._databaseId);return new Rn(this.firestore,null,n)}}function $k(t,...e){var n,r,s;t=pt(t);let i={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||g1(e[o])||(i=e[o],o++);const a={includeMetadataChanges:i.includeMetadataChanges,source:i.source};if(g1(e[o])){const h=e[o];e[o]=(n=h.next)===null||n===void 0?void 0:n.bind(h),e[o+1]=(r=h.error)===null||r===void 0?void 0:r.bind(h),e[o+2]=(s=h.complete)===null||s===void 0?void 0:s.bind(h)}let l,u,d;if(t instanceof Rn)u=uu(t.firestore,af),d=W0(t._key.path),l={next:h=>{e[o]&&e[o](c8(u,t,h))},error:e[o+1],complete:e[o+2]};else{const h=uu(t,al);u=uu(h.firestore,af),d=h._query;const f=new Uk(u);l={next:p=>{e[o]&&e[o](new a8(u,f,h,p))},error:e[o+1],complete:e[o+2]},r8(t._query)}return function(f,p,g,w){const _=new Uz(w),v=new _z(p,_,g);return f.asyncQueue.enqueueAndForget(async()=>yz(await a1(f),v)),()=>{_.xu(),f.asyncQueue.enqueueAndForget(async()=>vz(await a1(f),v))}}(cw(u),d,a,l)}function u8(t,e){return function(r,s){const i=new oo;return r.asyncQueue.enqueueAndForget(async()=>kz(await zz(r),s,i)),i.promise}(cw(t),e)}function c8(t,e,n){const r=n.docs.get(e._key),s=new Uk(t);return new Fk(t,s,e._key,r,new Hl(n.hasPendingWrites,n.fromCache),e.converter)}/** * @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 d8{constructor(e,n){this._firestore=e,this._commitHandler=n,this._mutations=[],this._committed=!1,this._dataReader=kk(e)}set(e,n,r){this._verifyNotCommitted();const s=Nm(e,this._firestore),i=o8(s.converter,n,r),o=Xz(this._dataReader,"WriteBatch.set",s._key,i,s.converter!==null,r);return this._mutations.push(o.toMutation(s._key,hr.none())),this}update(e,n,r,...s){this._verifyNotCommitted();const i=Nm(e,this._firestore);let o;return o=typeof(n=pt(n))=="string"||n instanceof gp?Zz(this._dataReader,"WriteBatch.update",i._key,n,r,s):Jz(this._dataReader,"WriteBatch.update",i._key,n),this._mutations.push(o.toMutation(i._key,hr.exists(!0))),this}delete(e){this._verifyNotCommitted();const n=Nm(e,this._firestore);return this._mutations=this._mutations.concat(new K0(n._key,hr.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new ne($.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function Nm(t,e){if((t=pt(t)).firestore!==e)throw new ne($.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return 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. */function VY(t){return cw(t=uu(t,af)),new d8(t,e=>u8(t,e))}(function(e,n=!0){(function(s){rl=s})(tl),Ma(new wo("firestore",(r,{instanceIdentifier:s,options:i})=>{const o=r.getProvider("app").getImmediate(),a=new af(new JU(r.getProvider("auth-internal")),new t$(o,r.getProvider("app-check-internal")),function(u,d){if(!Object.prototype.hasOwnProperty.apply(u.options,["projectId"]))throw new ne($.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new qu(u.options.projectId,d)}(o,s),o);return i=Object.assign({useFetchStreams:n},i),a._setSettings(i),a},"PUBLIC").setMultipleInstances(!0)),li(vT,wT,e),li(vT,wT,"esm2017")})();const h8={apiKey:"AIzaSyA6lSmBAfmQVJHquzdoHuSN5gtX5w5g2cU",authDomain:"ldn-plateforme.firebaseapp.com",projectId:"ldn-plateforme",storageBucket:"ldn-plateforme.firebasestorage.app",messagingSenderId:"978301203657",appId:"1:978301203657:web:15b6dd73f0634e10ca8918",measurementId:"G-DBRZNEK780"},Bk=CA(h8),Oo=qU(Bk),f8=new Xr,zk=qz(Bk),Hk=b.createContext(void 0),p8=({children:t})=>{const[e,n]=b.useState(null),[r,s]=b.useState(!0);b.useEffect(()=>{const u=O9(Oo,d=>{n(d),s(!1)});return()=>u()},[]);const i=b.useCallback(async()=>{try{return(await tU(Oo,f8)).user}catch(u){const d=u;throw console.error("Erreur lors de la connexion:",u),new Error(d.message||"Erreur lors de la connexion avec Google")}},[]),o=b.useCallback(async(u,d)=>{try{return(await A9(Oo,u,d)).user}catch(h){const f=h;console.error("Erreur lors de la connexion:",h);let p="Erreur lors de la connexion";switch(f.code){case"auth/invalid-email":p="Email invalide";break;case"auth/user-disabled":p="Ce compte a été désactivé";break;case"auth/user-not-found":p="Aucun compte trouvé avec cet email";break;case"auth/wrong-password":p="Mot de passe incorrect";break;case"auth/invalid-credential":p="Email ou mot de passe incorrect";break;default:p=f.message||p}throw new Error(p)}},[]),a=b.useCallback(async(u,d,h,f)=>{try{const p=await P9(Oo,u,d);return await k9(p.user,{displayName:`${h} ${f}`}),await p.user.reload(),n(Oo.currentUser),p.user}catch(p){const g=p;console.error("Erreur lors de l'inscription:",p);let w="Erreur lors de l'inscription";switch(g.code){case"auth/email-already-in-use":w="Cet email est déjà utilisé";break;case"auth/invalid-email":w="Email invalide";break;case"auth/operation-not-allowed":w="L'inscription par email est désactivée";break;case"auth/weak-password":w="Le mot de passe est trop faible";break;default:w=g.message||w}throw new Error(w)}},[]),l=b.useCallback(async()=>{try{await L9(Oo)}catch(u){console.error("Erreur lors de la déconnexion:",u)}},[]);return y.jsx(Hk.Provider,{value:{user:e,loading:r,signInWithGoogle:i,signInWithEmail:o,signUpWithEmail:a,logout:l},children:t})},vp=()=>{const t=b.useContext(Hk);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t},m8=["fr","en"],g8="fr",w1={STALE_TIME:5*60*1e3,GC_TIME:30*60*1e3},y8=()=>new FF({defaultOptions:{queries:{staleTime:w1.STALE_TIME,gcTime:w1.GC_TIME,retry:3,refetchOnWindowFocus:!0,refetchOnMount:!1},mutations:{retry:1}}}),v8=$f("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),xt=b.forwardRef(({className:t,variant:e,size:n,asChild:r=!1,...s},i)=>{const o=r?Lu:"button";return y.jsx(o,{className:Ye(v8({variant:e,size:n,className:t})),ref:i,...s})});xt.displayName="Button";class w8 extends b.Component{constructor(){super(...arguments);_r(this,"state",{hasError:!1,error:null});_r(this,"handleRetry",()=>{this.setState({hasError:!1,error:null})});_r(this,"handleGoHome",()=>{window.location.href="/"})}static getDerivedStateFromError(n){return{hasError:!0,error:n}}componentDidCatch(n,r){var s,i;console.error("ErrorBoundary caught an error:",n,r),(i=(s=this.props).onError)==null||i.call(s,n,r)}render(){return this.state.hasError?this.props.fallback?this.props.fallback:y.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50 px-4",children:y.jsxs("div",{className:"max-w-md w-full text-center",children:[y.jsxs("div",{className:"bg-white rounded-2xl shadow-lg p-8 border border-slate-100",children:[y.jsx("div",{className:"w-16 h-16 bg-red-100 rounded-full flex items-center justify-center mx-auto mb-6",children:y.jsx(IV,{className:"w-8 h-8 text-red-600"})}),y.jsx("h1",{className:"text-2xl font-bold text-slate-900 mb-3",children:"Une erreur est survenue"}),y.jsx("p",{className:"text-slate-600 mb-6",children:"Nous sommes désolés, quelque chose s'est mal passé. Veuillez réessayer ou retourner à la page d'accueil."}),!1,y.jsxs("div",{className:"flex gap-3 justify-center",children:[y.jsxs(xt,{variant:"outline",onClick:this.handleRetry,className:"gap-2",children:[y.jsx(SV,{className:"w-4 h-4"}),"Réessayer"]}),y.jsxs(xt,{onClick:this.handleGoHome,className:"gap-2 bg-[#4338ca] hover:bg-[#3730a3]",children:[y.jsx(pP,{className:"w-4 h-4"}),"Accueil"]})]})]}),y.jsx("p",{className:"mt-6 text-sm text-slate-500",children:"Si le problème persiste, contactez notre support."})]})}):this.props.children}}const x8=({message:t="Chargement...",fullScreen:e=!1})=>{const n=y.jsxs("div",{className:"flex flex-col items-center justify-center gap-4",children:[y.jsx(_V,{className:"w-8 h-8 text-[#4338ca] animate-spin"}),y.jsx("p",{className:"text-slate-600 text-sm",children:t})]});return e?y.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50",children:n}):y.jsx("div",{className:"flex items-center justify-center py-12",children:n})},_8=()=>{const{pathname:t}=Ri();return b.useEffect(()=>{const e=setTimeout(()=>{window.scrollTo({top:0,left:0,behavior:"instant"})},0);return()=>clearTimeout(e)},[t]),null},x1=[{title:"Accueil",hasDropdown:!1,link:"/"},{title:"Programmes",hasDropdown:!1,link:"/programs",submenu:[]},{title:"Parcours",hasDropdown:!1,link:"/pathways",submenu:[{title:"Parcours Complet",link:"/pathways/complet"},{title:"Parcours À la carte",link:"/pathways/alacarte"},{title:"Parcours Personnalisé",link:"/pathways/personnalise"}]},{title:"Communauté",hasDropdown:!1,link:"/community"},{title:"À propos",hasDropdown:!1,link:"/about",submenu:[{title:"Histoire",link:"/about#history"},{title:"Valeurs LDN",link:"/about#values"},{title:"Missions LDN",link:"/about#missions"},{title:"Équipe",link:"/about#team"},{title:"Partenaires",link:"/about#partners"}]}],_1=()=>{const[t,e]=b.useState(!1),[n,r]=b.useState("FR"),s=i=>{r(i),e(!1)};return y.jsxs("div",{className:"relative",children:[y.jsxs("button",{onClick:()=>e(!t),className:"flex items-center space-x-2 text-foreground hover:text-primary transition-colors",children:[y.jsx(wV,{className:"h-5 w-5"}),y.jsx("span",{className:"text-base",children:n})," ",y.jsx(Kd,{className:"h-4 w-4"})]}),t&&y.jsxs("div",{className:"absolute top-full right-0 mt-2 w-28 bg-white border border-gray-200 rounded-lg shadow-lg z-50 py-2",children:[y.jsx("button",{onClick:()=>s("FR"),className:`block w-full px-4 py-3 text-base text-left hover:bg-gray-100 ${n==="FR"?"bg-gray-100":""}`,children:"Français"}),y.jsx("button",{onClick:()=>s("EN"),className:`block w-full px-4 py-3 text-base text-left hover:bg-gray-100 ${n==="EN"?"bg-gray-100":""}`,children:"English"})]})]})},E8=()=>{const[t,e]=b.useState(!1),[n,r]=b.useState(null),{user:s,signInWithGoogle:i,logout:o}=vp(),a=Xf();return y.jsx("header",{className:"bg-white shadow-sm border-b border-border sticky top-0 z-50",children:y.jsxs("div",{className:"container mx-auto px-4",children:[y.jsxs("div",{className:"flex items-center justify-between h-20",children:[y.jsx("div",{className:"flex items-center",children:y.jsx("a",{href:"/","aria-label":"Aller à l'accueil",children:y.jsx("img",{src:"/assets/images/logo-ldn.png",alt:"Des Nations",className:"h-24 w-auto"})})}),y.jsx("nav",{className:"hidden lg:flex items-center space-x-10",children:x1.map(l=>{var u;return y.jsxs("div",{className:"relative group",onMouseEnter:()=>l.hasDropdown&&r(l.title),onMouseLeave:()=>r(null),children:[l.link?y.jsxs("a",{href:l.link,className:"flex items-center space-x-2 text-foreground hover:text-primary transition-colors py-3",children:[y.jsx("span",{className:"text-lg",children:l.title}),l.hasDropdown&&y.jsx(Kd,{className:"h-5 w-5 transition-transform group-hover:rotate-180"})]}):y.jsxs("div",{className:"flex items-center space-x-2 text-foreground hover:text-primary transition-colors py-3 cursor-pointer",children:[y.jsx("span",{className:"text-lg",children:l.title}),l.hasDropdown&&y.jsx(Kd,{className:"h-5 w-5 transition-transform group-hover:rotate-180"})]}),l.hasDropdown&&n===l.title&&y.jsx("div",{className:"absolute top-full left-0 w-80 bg-white border border-border rounded-lg shadow-xl py-3 z-50",children:(u=l.submenu)==null?void 0:u.map((d,h)=>y.jsx("a",{href:d.link,className:"flex items-center px-6 py-4 text-base text-foreground hover:bg-accent hover:text-accent-foreground transition-colors group/submenu",children:y.jsx("span",{className:"flex-1",children:y.jsxs("div",{className:"text-lg group-hover/submenu:text-primary transition-colors",children:[" ",d.title]})})},h))})]},l.title)})}),y.jsxs("div",{className:"hidden lg:flex items-center space-x-6",children:[y.jsx(_1,{}),y.jsx(xt,{onClick:()=>a("/login"),variant:"ghost",className:"border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-white transition-all duration-300 rounded-full px-8 py-3 text-base",children:"Connexion au Portail →"})]}),y.jsx("button",{className:"lg:hidden",onClick:()=>e(!t),children:t?y.jsx(d0,{className:"h-8 w-8"}):y.jsx(c0,{className:"h-8 w-8"})})]}),t&&y.jsxs("div",{className:"lg:hidden py-6 border-t border-gray-200",children:[x1.map(l=>{var u;return y.jsxs("div",{className:"py-3",children:[y.jsxs("div",{className:"flex items-center justify-between w-full",children:[l.link?y.jsx("a",{href:l.link,className:"flex-1 text-left text-foreground hover:text-primary transition-colors text-lg",children:l.title}):y.jsx("div",{className:"flex-1 text-left text-foreground hover:text-primary transition-colors text-lg font-medium",children:l.title}),l.hasDropdown&&y.jsx("button",{className:"p-2",onClick:()=>r(n===l.title?null:l.title),"aria-label":"Ouvrir le sous-menu",children:y.jsx(Kd,{className:`h-5 w-5 transition-transform ${n===l.title?"rotate-180":""}`})})]}),l.hasDropdown&&n===l.title&&y.jsx("div",{className:"mt-3 pl-6 space-y-3 bg-gray-50 rounded-lg p-4",children:(u=l.submenu)==null?void 0:u.map((d,h)=>y.jsxs("a",{href:d.link,className:"block py-3 text-base text-gray-600 hover:text-gray-900 transition-colors",children:[y.jsx("div",{children:d.title})," "]},h))})]},l.title)}),y.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-200 space-y-4",children:[y.jsx("div",{className:"flex justify-center",children:y.jsx(_1,{})}),y.jsx(xt,{onClick:()=>a("/login"),variant:"outline",size:"lg",className:"w-full text-base py-3",children:"Connexion au Portail →"})]})]})]})})},E1=[{text:"Commencer le parcours",link:"/parcours"},{text:"Découvrir les formations",link:"/#pathways-overview"},{text:"Explorer les programmes",link:"/pathways"},{text:"Voir le parcours complet",link:"/pathways/complet"},{text:"Rejoindre maintenant",link:"/pathways/complet"}],T8=()=>{const[t,e]=b.useState([]);return b.useEffect(()=>{const n=Vk(Pk(zk,"media")),r=$k(n,s=>{const i=[];s.docs.forEach((o,a)=>{const l=o.data(),u=E1[a%E1.length];i.push({id:o.id,type:l.type||"image",src:l.url,title:l.title||"",subtitle:l.subtitle||"",description:l.description||"",buttonText:u.text,buttonLink:u.link,hasShapes:a===0,startTime:l.startTime,endTime:l.endTime})}),i.length>0?e(i):e([])},s=>{console.error("Error listening to hero slides:",s)});return()=>r()},[]),t},xw=b.createContext({});function _w(t){const e=b.useRef(null);return e.current===null&&(e.current=t()),e.current}const Ew=typeof window<"u",Wk=Ew?b.useLayoutEffect:b.useEffect,wp=b.createContext(null);function Tw(t,e){t.indexOf(e)===-1&&t.push(e)}function bw(t,e){const n=t.indexOf(e);n>-1&&t.splice(n,1)}const ps=(t,e,n)=>n>e?e:n{};const ms={},qk=t=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(t);function Kk(t){return typeof t=="object"&&t!==null}const Gk=t=>/^0[^.\s]+$/u.test(t);function Cw(t){let e;return()=>(e===void 0&&(e=t()),e)}const Kn=t=>t,b8=(t,e)=>n=>e(t(n)),Rc=(...t)=>t.reduce(b8),Yu=(t,e,n)=>{const r=e-t;return r===0?1:(n-t)/r};class Iw{constructor(){this.subscriptions=[]}add(e){return Tw(this.subscriptions,e),()=>bw(this.subscriptions,e)}notify(e,n,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,n,r);else for(let i=0;it*1e3,Wn=t=>t/1e3;function Qk(t,e){return e?t*(1e3/e):0}const Yk=(t,e,n)=>(((1-3*n+3*e)*t+(3*n-6*e))*t+3*e)*t,S8=1e-7,C8=12;function I8(t,e,n,r,s){let i,o,a=0;do o=e+(n-e)/2,i=Yk(o,r,s)-t,i>0?n=o:e=o;while(Math.abs(i)>S8&&++aI8(i,0,1,t,n);return i=>i===0||i===1?i:Yk(s(i),e,r)}const Xk=t=>e=>e<=.5?t(2*e)/2:(2-t(2*(1-e)))/2,Jk=t=>e=>1-t(1-e),Zk=kc(.33,1.53,.69,.99),Pw=Jk(Zk),eN=Xk(Pw),tN=t=>(t*=2)<1?.5*Pw(t):.5*(2-Math.pow(2,-10*(t-1))),Aw=t=>1-Math.sin(Math.acos(t)),nN=Jk(Aw),rN=Xk(Aw),P8=kc(.42,0,1,1),A8=kc(0,0,.58,1),sN=kc(.42,0,.58,1),R8=t=>Array.isArray(t)&&typeof t[0]!="number",iN=t=>Array.isArray(t)&&typeof t[0]=="number",k8={linear:Kn,easeIn:P8,easeInOut:sN,easeOut:A8,circIn:Aw,circInOut:rN,circOut:nN,backIn:Pw,backInOut:eN,backOut:Zk,anticipate:tN},N8=t=>typeof t=="string",T1=t=>{if(iN(t)){Sw(t.length===4);const[e,n,r,s]=t;return kc(e,n,r,s)}else if(N8(t))return k8[t];return t},Id=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function D8(t,e){let n=new Set,r=new Set,s=!1,i=!1;const o=new WeakSet;let a={delta:0,timestamp:0,isProcessing:!1};function l(d){o.has(d)&&(u.schedule(d),t()),d(a)}const u={schedule:(d,h=!1,f=!1)=>{const g=f&&s?n:r;return h&&o.add(d),g.has(d)||g.add(d),d},cancel:d=>{r.delete(d),o.delete(d)},process:d=>{if(a=d,s){i=!0;return}s=!0,[n,r]=[r,n],n.forEach(l),n.clear(),s=!1,i&&(i=!1,u.process(d))}};return u}const O8=40;function oN(t,e){let n=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},i=()=>n=!0,o=Id.reduce((T,A)=>(T[A]=D8(i),T),{}),{setup:a,read:l,resolveKeyframes:u,preUpdate:d,update:h,preRender:f,render:p,postRender:g}=o,w=()=>{const T=ms.useManualTiming?s.timestamp:performance.now();n=!1,ms.useManualTiming||(s.delta=r?1e3/60:Math.max(Math.min(T-s.timestamp,O8),1)),s.timestamp=T,s.isProcessing=!0,a.process(s),l.process(s),u.process(s),d.process(s),h.process(s),f.process(s),p.process(s),g.process(s),s.isProcessing=!1,n&&e&&(r=!1,t(w))},_=()=>{n=!0,r=!0,s.isProcessing||t(w)};return{schedule:Id.reduce((T,A)=>{const k=o[A];return T[A]=(L,C=!1,S=!1)=>(n||_(),k.schedule(L,C,S)),T},{}),cancel:T=>{for(let A=0;A(ih===void 0&&gn.set(Ot.isProcessing||ms.useManualTiming?Ot.timestamp:performance.now()),ih),set:t=>{ih=t,queueMicrotask(L8)}},aN=t=>e=>typeof e=="string"&&e.startsWith(t),Rw=aN("--"),M8=aN("var(--"),kw=t=>M8(t)?V8.test(t.split("/*")[0].trim()):!1,V8=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu,ll={test:t=>typeof t=="number",parse:parseFloat,transform:t=>t},Xu={...ll,transform:t=>ps(0,1,t)},Pd={...ll,default:1},cu=t=>Math.round(t*1e5)/1e5,Nw=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function j8(t){return t==null}const F8=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,Dw=(t,e)=>n=>!!(typeof n=="string"&&F8.test(n)&&n.startsWith(t)||e&&!j8(n)&&Object.prototype.hasOwnProperty.call(n,e)),lN=(t,e,n)=>r=>{if(typeof r!="string")return r;const[s,i,o,a]=r.match(Nw);return{[t]:parseFloat(s),[e]:parseFloat(i),[n]:parseFloat(o),alpha:a!==void 0?parseFloat(a):1}},U8=t=>ps(0,255,t),Om={...ll,transform:t=>Math.round(U8(t))},Qi={test:Dw("rgb","red"),parse:lN("red","green","blue"),transform:({red:t,green:e,blue:n,alpha:r=1})=>"rgba("+Om.transform(t)+", "+Om.transform(e)+", "+Om.transform(n)+", "+cu(Xu.transform(r))+")"};function $8(t){let e="",n="",r="",s="";return t.length>5?(e=t.substring(1,3),n=t.substring(3,5),r=t.substring(5,7),s=t.substring(7,9)):(e=t.substring(1,2),n=t.substring(2,3),r=t.substring(3,4),s=t.substring(4,5),e+=e,n+=n,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(n,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Oy={test:Dw("#"),parse:$8,transform:Qi.transform},Nc=t=>({test:e=>typeof e=="string"&&e.endsWith(t)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${t}`}),Ds=Nc("deg"),Mr=Nc("%"),le=Nc("px"),B8=Nc("vh"),z8=Nc("vw"),b1={...Mr,parse:t=>Mr.parse(t)/100,transform:t=>Mr.transform(t*100)},ea={test:Dw("hsl","hue"),parse:lN("hue","saturation","lightness"),transform:({hue:t,saturation:e,lightness:n,alpha:r=1})=>"hsla("+Math.round(t)+", "+Mr.transform(cu(e))+", "+Mr.transform(cu(n))+", "+cu(Xu.transform(r))+")"},yt={test:t=>Qi.test(t)||Oy.test(t)||ea.test(t),parse:t=>Qi.test(t)?Qi.parse(t):ea.test(t)?ea.parse(t):Oy.parse(t),transform:t=>typeof t=="string"?t:t.hasOwnProperty("red")?Qi.transform(t):ea.transform(t),getAnimatableNone:t=>{const e=yt.parse(t);return e.alpha=0,yt.transform(e)}},H8=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function W8(t){var e,n;return isNaN(t)&&typeof t=="string"&&(((e=t.match(Nw))==null?void 0:e.length)||0)+(((n=t.match(H8))==null?void 0:n.length)||0)>0}const uN="number",cN="color",q8="var",K8="var(",S1="${}",G8=/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 Ju(t){const e=t.toString(),n=[],r={color:[],number:[],var:[]},s=[];let i=0;const a=e.replace(G8,l=>(yt.test(l)?(r.color.push(i),s.push(cN),n.push(yt.parse(l))):l.startsWith(K8)?(r.var.push(i),s.push(q8),n.push(l)):(r.number.push(i),s.push(uN),n.push(parseFloat(l))),++i,S1)).split(S1);return{values:n,split:a,indexes:r,types:s}}function dN(t){return Ju(t).values}function hN(t){const{split:e,types:n}=Ju(t),r=e.length;return s=>{let i="";for(let o=0;otypeof t=="number"?0:yt.test(t)?yt.getAnimatableNone(t):t;function Y8(t){const e=dN(t);return hN(t)(e.map(Q8))}const Ci={test:W8,parse:dN,createTransformer:hN,getAnimatableNone:Y8};function Lm(t,e,n){return n<0&&(n+=1),n>1&&(n-=1),n<1/6?t+(e-t)*6*n:n<1/2?e:n<2/3?t+(e-t)*(2/3-n)*6:t}function X8({hue:t,saturation:e,lightness:n,alpha:r}){t/=360,e/=100,n/=100;let s=0,i=0,o=0;if(!e)s=i=o=n;else{const a=n<.5?n*(1+e):n+e-n*e,l=2*n-a;s=Lm(l,a,t+1/3),i=Lm(l,a,t),o=Lm(l,a,t-1/3)}return{red:Math.round(s*255),green:Math.round(i*255),blue:Math.round(o*255),alpha:r}}function uf(t,e){return n=>n>0?e:t}const Je=(t,e,n)=>t+(e-t)*n,Mm=(t,e,n)=>{const r=t*t,s=n*(e*e-r)+r;return s<0?0:Math.sqrt(s)},J8=[Oy,Qi,ea],Z8=t=>J8.find(e=>e.test(t));function C1(t){const e=Z8(t);if(!e)return!1;let n=e.parse(t);return e===ea&&(n=X8(n)),n}const I1=(t,e)=>{const n=C1(t),r=C1(e);if(!n||!r)return uf(t,e);const s={...n};return i=>(s.red=Mm(n.red,r.red,i),s.green=Mm(n.green,r.green,i),s.blue=Mm(n.blue,r.blue,i),s.alpha=Je(n.alpha,r.alpha,i),Qi.transform(s))},Ly=new Set(["none","hidden"]);function e7(t,e){return Ly.has(t)?n=>n<=0?t:e:n=>n>=1?e:t}function t7(t,e){return n=>Je(t,e,n)}function Ow(t){return typeof t=="number"?t7:typeof t=="string"?kw(t)?uf:yt.test(t)?I1:s7:Array.isArray(t)?fN:typeof t=="object"?yt.test(t)?I1:n7:uf}function fN(t,e){const n=[...t],r=n.length,s=t.map((i,o)=>Ow(i)(i,e[o]));return i=>{for(let o=0;o{for(const i in r)n[i]=r[i](s);return n}}function r7(t,e){const n=[],r={color:0,var:0,number:0};for(let s=0;s{const n=Ci.createTransformer(e),r=Ju(t),s=Ju(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Ly.has(t)&&!s.values.length||Ly.has(e)&&!r.values.length?e7(t,e):Rc(fN(r7(r,s),s.values),n):uf(t,e)};function pN(t,e,n){return typeof t=="number"&&typeof e=="number"&&typeof n=="number"?Je(t,e,n):Ow(t)(t,e)}const i7=t=>{const e=({timestamp:n})=>t(n);return{start:(n=!0)=>Qe.update(e,n),stop:()=>Si(e),now:()=>Ot.isProcessing?Ot.timestamp:gn.now()}},mN=(t,e,n=10)=>{let r="";const s=Math.max(Math.round(e/n),2);for(let i=0;i=cf?1/0:e}function o7(t,e=100,n){const r=n({...t,keyframes:[0,e]}),s=Math.min(Lw(r),cf);return{type:"keyframes",ease:i=>r.next(s*i).value/e,duration:Wn(s)}}const a7=5;function gN(t,e,n){const r=Math.max(e-a7,0);return Qk(n-t(r),e-r)}const lt={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},Vm=.001;function l7({duration:t=lt.duration,bounce:e=lt.bounce,velocity:n=lt.velocity,mass:r=lt.mass}){let s,i,o=1-e;o=ps(lt.minDamping,lt.maxDamping,o),t=ps(lt.minDuration,lt.maxDuration,Wn(t)),o<1?(s=u=>{const d=u*o,h=d*t,f=d-n,p=My(u,o),g=Math.exp(-h);return Vm-f/p*g},i=u=>{const h=u*o*t,f=h*n+n,p=Math.pow(o,2)*Math.pow(u,2)*t,g=Math.exp(-h),w=My(Math.pow(u,2),o);return(-s(u)+Vm>0?-1:1)*((f-p)*g)/w}):(s=u=>{const d=Math.exp(-u*t),h=(u-n)*t+1;return-Vm+d*h},i=u=>{const d=Math.exp(-u*t),h=(n-u)*(t*t);return d*h});const a=5/t,l=c7(s,i,a);if(t=Lr(t),isNaN(l))return{stiffness:lt.stiffness,damping:lt.damping,duration:t};{const u=Math.pow(l,2)*r;return{stiffness:u,damping:o*2*Math.sqrt(r*u),duration:t}}}const u7=12;function c7(t,e,n){let r=n;for(let s=1;st[n]!==void 0)}function f7(t){let e={velocity:lt.velocity,stiffness:lt.stiffness,damping:lt.damping,mass:lt.mass,isResolvedFromDuration:!1,...t};if(!P1(t,h7)&&P1(t,d7))if(t.visualDuration){const n=t.visualDuration,r=2*Math.PI/(n*1.2),s=r*r,i=2*ps(.05,1,1-(t.bounce||0))*Math.sqrt(s);e={...e,mass:lt.mass,stiffness:s,damping:i}}else{const n=l7(t);e={...e,...n,mass:lt.mass},e.isResolvedFromDuration=!0}return e}function df(t=lt.visualDuration,e=lt.bounce){const n=typeof t!="object"?{visualDuration:t,keyframes:[0,1],bounce:e}:t;let{restSpeed:r,restDelta:s}=n;const i=n.keyframes[0],o=n.keyframes[n.keyframes.length-1],a={done:!1,value:i},{stiffness:l,damping:u,mass:d,duration:h,velocity:f,isResolvedFromDuration:p}=f7({...n,velocity:-Wn(n.velocity||0)}),g=f||0,w=u/(2*Math.sqrt(l*d)),_=o-i,v=Wn(Math.sqrt(l/d)),x=Math.abs(_)<5;r||(r=x?lt.restSpeed.granular:lt.restSpeed.default),s||(s=x?lt.restDelta.granular:lt.restDelta.default);let T;if(w<1){const k=My(v,w);T=L=>{const C=Math.exp(-w*v*L);return o-C*((g+w*v*_)/k*Math.sin(k*L)+_*Math.cos(k*L))}}else if(w===1)T=k=>o-Math.exp(-v*k)*(_+(g+v*_)*k);else{const k=v*Math.sqrt(w*w-1);T=L=>{const C=Math.exp(-w*v*L),S=Math.min(k*L,300);return o-C*((g+w*v*_)*Math.sinh(S)+k*_*Math.cosh(S))/k}}const A={calculatedDuration:p&&h||null,next:k=>{const L=T(k);if(p)a.done=k>=h;else{let C=k===0?g:0;w<1&&(C=k===0?Lr(g):gN(T,k,L));const S=Math.abs(C)<=r,I=Math.abs(o-L)<=s;a.done=S&&I}return a.value=a.done?o:L,a},toString:()=>{const k=Math.min(Lw(A),cf),L=mN(C=>A.next(k*C).value,k,30);return k+"ms "+L},toTransition:()=>{}};return A}df.applyToOptions=t=>{const e=o7(t,100,df);return t.ease=e.ease,t.duration=Lr(e.duration),t.type="keyframes",t};function Vy({keyframes:t,velocity:e=0,power:n=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:i=500,modifyTarget:o,min:a,max:l,restDelta:u=.5,restSpeed:d}){const h=t[0],f={done:!1,value:h},p=S=>a!==void 0&&Sl,g=S=>a===void 0?l:l===void 0||Math.abs(a-S)-w*Math.exp(-S/r),T=S=>v+x(S),A=S=>{const I=x(S),P=T(S);f.done=Math.abs(I)<=u,f.value=f.done?v:P};let k,L;const C=S=>{p(f.value)&&(k=S,L=df({keyframes:[f.value,g(f.value)],velocity:gN(T,S,f.value),damping:s,stiffness:i,restDelta:u,restSpeed:d}))};return C(0),{calculatedDuration:null,next:S=>{let I=!1;return!L&&k===void 0&&(I=!0,A(S),C(S)),k!==void 0&&S>=k?L.next(S-k):(!I&&A(S),f)}}}function p7(t,e,n){const r=[],s=n||ms.mix||pN,i=t.length-1;for(let o=0;oe[0];if(i===2&&e[0]===e[1])return()=>e[1];const o=t[0]===t[1];t[0]>t[i-1]&&(t=[...t].reverse(),e=[...e].reverse());const a=p7(e,r,s),l=a.length,u=d=>{if(o&&d1)for(;hu(ps(t[0],t[i-1],d)):u}function g7(t,e){const n=t[t.length-1];for(let r=1;r<=e;r++){const s=Yu(0,e,r);t.push(Je(n,1,s))}}function y7(t){const e=[0];return g7(e,t.length-1),e}function v7(t,e){return t.map(n=>n*e)}function w7(t,e){return t.map(()=>e||sN).splice(0,t.length-1)}function du({duration:t=300,keyframes:e,times:n,ease:r="easeInOut"}){const s=R8(r)?r.map(T1):T1(r),i={done:!1,value:e[0]},o=v7(n&&n.length===e.length?n:y7(e),t),a=m7(o,e,{ease:Array.isArray(s)?s:w7(e,s)});return{calculatedDuration:t,next:l=>(i.value=a(l),i.done=l>=t,i)}}const x7=t=>t!==null;function Mw(t,{repeat:e,repeatType:n="loop"},r,s=1){const i=t.filter(x7),a=s<0||e&&n!=="loop"&&e%2===1?0:i.length-1;return!a||r===void 0?i[a]:r}const _7={decay:Vy,inertia:Vy,tween:du,keyframes:du,spring:df};function yN(t){typeof t.type=="string"&&(t.type=_7[t.type])}class Vw{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,n){return this.finished.then(e,n)}}const E7=t=>t/100;class jw extends Vw{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.stop=()=>{var r,s;const{motionValue:n}=this.options;n&&n.updatedAt!==gn.now()&&this.tick(gn.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;yN(e);const{type:n=du,repeat:r=0,repeatDelay:s=0,repeatType:i,velocity:o=0}=e;let{keyframes:a}=e;const l=n||du;l!==du&&typeof a[0]!="number"&&(this.mixKeyframes=Rc(E7,pN(a[0],a[1])),a=[0,100]);const u=l({...e,keyframes:a});i==="mirror"&&(this.mirroredGenerator=l({...e,keyframes:[...a].reverse(),velocity:-o})),u.calculatedDuration===null&&(u.calculatedDuration=Lw(u));const{calculatedDuration:d}=u;this.calculatedDuration=d,this.resolvedDuration=d+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=u}updateTime(e){const n=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=n}tick(e,n=!1){const{generator:r,totalDuration:s,mixKeyframes:i,mirroredGenerator:o,resolvedDuration:a,calculatedDuration:l}=this;if(this.startTime===null)return r.next(0);const{delay:u=0,keyframes:d,repeat:h,repeatType:f,repeatDelay:p,type:g,onUpdate:w,finalKeyframe:_}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),n?this.currentTime=e:this.updateTime(e);const v=this.currentTime-u*(this.playbackSpeed>=0?1:-1),x=this.playbackSpeed>=0?v<0:v>s;this.currentTime=Math.max(v,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,A=r;if(h){const S=Math.min(this.currentTime,s)/a;let I=Math.floor(S),P=S%1;!P&&S>=1&&(P=1),P===1&&I--,I=Math.min(I,h+1),!!(I%2)&&(f==="reverse"?(P=1-P,p&&(P-=p/a)):f==="mirror"&&(A=o)),T=ps(0,1,P)*a}const k=x?{done:!1,value:d[0]}:A.next(T);i&&(k.value=i(k.value));let{done:L}=k;!x&&l!==null&&(L=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const C=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&L);return C&&g!==Vy&&(k.value=Mw(d,this.options,_,this.speed)),w&&w(k.value),C&&this.finish(),k}then(e,n){return this.finished.then(e,n)}get duration(){return Wn(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Wn(e)}get time(){return Wn(this.currentTime)}set time(e){var n;e=Lr(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),(n=this.driver)==null||n.start(!1)}get speed(){return this.playbackSpeed}set speed(e){this.updateTime(gn.now());const n=this.playbackSpeed!==e;this.playbackSpeed=e,n&&(this.time=Wn(this.currentTime))}play(){var s,i;if(this.isStopped)return;const{driver:e=i7,startTime:n}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(i=(s=this.options).onPlay)==null||i.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=n??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(gn.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,n;this.notifyFinished(),this.teardown(),this.state="finished",(n=(e=this.options).onComplete)==null||n.call(e)}cancel(){var e,n;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(n=(e=this.options).onCancel)==null||n.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var n;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(n=this.driver)==null||n.stop(),e.observe(this)}}function T7(t){for(let e=1;et*180/Math.PI,jy=t=>{const e=Yi(Math.atan2(t[1],t[0]));return Fy(e)},b7={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:t=>(Math.abs(t[0])+Math.abs(t[3]))/2,rotate:jy,rotateZ:jy,skewX:t=>Yi(Math.atan(t[1])),skewY:t=>Yi(Math.atan(t[2])),skew:t=>(Math.abs(t[1])+Math.abs(t[2]))/2},Fy=t=>(t=t%360,t<0&&(t+=360),t),A1=jy,R1=t=>Math.sqrt(t[0]*t[0]+t[1]*t[1]),k1=t=>Math.sqrt(t[4]*t[4]+t[5]*t[5]),S7={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:R1,scaleY:k1,scale:t=>(R1(t)+k1(t))/2,rotateX:t=>Fy(Yi(Math.atan2(t[6],t[5]))),rotateY:t=>Fy(Yi(Math.atan2(-t[2],t[0]))),rotateZ:A1,rotate:A1,skewX:t=>Yi(Math.atan(t[4])),skewY:t=>Yi(Math.atan(t[1])),skew:t=>(Math.abs(t[1])+Math.abs(t[4]))/2};function Uy(t){return t.includes("scale")?1:0}function $y(t,e){if(!t||t==="none")return Uy(e);const n=t.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(n)r=S7,s=n;else{const a=t.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=b7,s=a}if(!s)return Uy(e);const i=r[e],o=s[1].split(",").map(I7);return typeof i=="function"?i(o):o[i]}const C7=(t,e)=>{const{transform:n="none"}=getComputedStyle(t);return $y(n,e)};function I7(t){return parseFloat(t.trim())}const ul=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],cl=new Set(ul),N1=t=>t===ll||t===le,P7=new Set(["x","y","z"]),A7=ul.filter(t=>!P7.has(t));function R7(t){const e=[];return A7.forEach(n=>{const r=t.getValue(n);r!==void 0&&(e.push([n,r.get()]),r.set(n.startsWith("scale")?1:0))}),e}const ao={width:({x:t},{paddingLeft:e="0",paddingRight:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),height:({y:t},{paddingTop:e="0",paddingBottom:n="0"})=>t.max-t.min-parseFloat(e)-parseFloat(n),top:(t,{top:e})=>parseFloat(e),left:(t,{left:e})=>parseFloat(e),bottom:({y:t},{top:e})=>parseFloat(e)+(t.max-t.min),right:({x:t},{left:e})=>parseFloat(e)+(t.max-t.min),x:(t,{transform:e})=>$y(e,"x"),y:(t,{transform:e})=>$y(e,"y")};ao.translateX=ao.x;ao.translateY=ao.y;const lo=new Set;let By=!1,zy=!1,Hy=!1;function vN(){if(zy){const t=Array.from(lo).filter(r=>r.needsMeasurement),e=new Set(t.map(r=>r.element)),n=new Map;e.forEach(r=>{const s=R7(r);s.length&&(n.set(r,s),r.render())}),t.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=n.get(r);s&&s.forEach(([i,o])=>{var a;(a=r.getValue(i))==null||a.set(o)})}),t.forEach(r=>r.measureEndState()),t.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}zy=!1,By=!1,lo.forEach(t=>t.complete(Hy)),lo.clear()}function wN(){lo.forEach(t=>{t.readKeyframes(),t.needsMeasurement&&(zy=!0)})}function k7(){Hy=!0,wN(),vN(),Hy=!1}class Fw{constructor(e,n,r,s,i,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=n,this.name=r,this.motionValue=s,this.element=i,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(lo.add(this),By||(By=!0,Qe.read(wN),Qe.resolveKeyframes(vN))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:n,element:r,motionValue:s}=this;if(e[0]===null){const i=s==null?void 0:s.get(),o=e[e.length-1];if(i!==void 0)e[0]=i;else if(r&&n){const a=r.readValue(n,o);a!=null&&(e[0]=a)}e[0]===void 0&&(e[0]=o),s&&i===void 0&&s.set(e[0])}T7(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),lo.delete(this)}cancel(){this.state==="scheduled"&&(lo.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const N7=t=>t.startsWith("--");function D7(t,e,n){N7(e)?t.style.setProperty(e,n):t.style[e]=n}const O7=Cw(()=>window.ScrollTimeline!==void 0),L7={};function M7(t,e){const n=Cw(t);return()=>L7[e]??n()}const xN=M7(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Wl=([t,e,n,r])=>`cubic-bezier(${t}, ${e}, ${n}, ${r})`,D1={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Wl([0,.65,.55,1]),circOut:Wl([.55,0,1,.45]),backIn:Wl([.31,.01,.66,-.59]),backOut:Wl([.33,1.53,.69,.99])};function _N(t,e){if(t)return typeof t=="function"?xN()?mN(t,e):"ease-out":iN(t)?Wl(t):Array.isArray(t)?t.map(n=>_N(n,e)||D1.easeOut):D1[t]}function V7(t,e,n,{delay:r=0,duration:s=300,repeat:i=0,repeatType:o="loop",ease:a="easeOut",times:l}={},u=void 0){const d={[e]:n};l&&(d.offset=l);const h=_N(a,s);Array.isArray(h)&&(d.easing=h);const f={delay:r,duration:s,easing:Array.isArray(h)?"linear":h,fill:"both",iterations:i+1,direction:o==="reverse"?"alternate":"normal"};return u&&(f.pseudoElement=u),t.animate(d,f)}function EN(t){return typeof t=="function"&&"applyToOptions"in t}function j7({type:t,...e}){return EN(t)&&xN()?t.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class F7 extends Vw{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,!e)return;const{element:n,name:r,keyframes:s,pseudoElement:i,allowFlatten:o=!1,finalKeyframe:a,onComplete:l}=e;this.isPseudoElement=!!i,this.allowFlatten=o,this.options=e,Sw(typeof e.type!="string");const u=j7(e);this.animation=V7(n,r,s,u,i),u.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!i){const d=Mw(s,this.options,a,this.speed);this.updateMotionValue?this.updateMotionValue(d):D7(n,r,d),this.animation.cancel()}l==null||l(),this.notifyFinished()}}play(){this.isStopped||(this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,n;(n=(e=this.animation).finish)==null||n.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var e,n;this.isPseudoElement||(n=(e=this.animation).commitStyles)==null||n.call(e)}get duration(){var n,r;const e=((r=(n=this.animation.effect)==null?void 0:n.getComputedTiming)==null?void 0:r.call(n).duration)||0;return Wn(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Wn(e)}get time(){return Wn(Number(this.animation.currentTime)||0)}set time(e){this.finishedTime=null,this.animation.currentTime=Lr(e)}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return Number(this.animation.startTime)}set startTime(e){this.animation.startTime=e}attachTimeline({timeline:e,observe:n}){var r;return this.allowFlatten&&((r=this.animation.effect)==null||r.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&O7()?(this.animation.timeline=e,Kn):n(this)}}const TN={anticipate:tN,backInOut:eN,circInOut:rN};function U7(t){return t in TN}function $7(t){typeof t.ease=="string"&&U7(t.ease)&&(t.ease=TN[t.ease])}const O1=10;class B7 extends F7{constructor(e){$7(e),yN(e),super(e),e.startTime&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:n,onUpdate:r,onComplete:s,element:i,...o}=this.options;if(!n)return;if(e!==void 0){n.set(e);return}const a=new jw({...o,autoplay:!1}),l=Lr(this.finishedTime??this.time);n.setWithVelocity(a.sample(l-O1).value,a.sample(l).value,O1),a.stop()}}const L1=(t,e)=>e==="zIndex"?!1:!!(typeof t=="number"||Array.isArray(t)||typeof t=="string"&&(Ci.test(t)||t==="0")&&!t.startsWith("url("));function z7(t){const e=t[0];if(t.length===1)return!0;for(let n=0;nObject.hasOwnProperty.call(Element.prototype,"animate"));function K7(t){var d;const{motionValue:e,name:n,repeatDelay:r,repeatType:s,damping:i,type:o}=t;if(!(((d=e==null?void 0:e.owner)==null?void 0:d.current)instanceof HTMLElement))return!1;const{onUpdate:l,transformTemplate:u}=e.owner.getProps();return q7()&&n&&W7.has(n)&&(n!=="transform"||!u)&&!l&&!r&&s!=="mirror"&&i!==0&&o!=="inertia"}const G7=40;class Q7 extends Vw{constructor({autoplay:e=!0,delay:n=0,type:r="keyframes",repeat:s=0,repeatDelay:i=0,repeatType:o="loop",keyframes:a,name:l,motionValue:u,element:d,...h}){var g;super(),this.stop=()=>{var w,_;this._animation&&(this._animation.stop(),(w=this.stopTimeline)==null||w.call(this)),(_=this.keyframeResolver)==null||_.cancel()},this.createdAt=gn.now();const f={autoplay:e,delay:n,type:r,repeat:s,repeatDelay:i,repeatType:o,name:l,motionValue:u,element:d,...h},p=(d==null?void 0:d.KeyframeResolver)||Fw;this.keyframeResolver=new p(a,(w,_,v)=>this.onKeyframesResolved(w,_,f,!v),l,u,d),(g=this.keyframeResolver)==null||g.scheduleResolve()}onKeyframesResolved(e,n,r,s){this.keyframeResolver=void 0;const{name:i,type:o,velocity:a,delay:l,isHandoff:u,onUpdate:d}=r;this.resolvedAt=gn.now(),H7(e,i,o,a)||((ms.instantAnimations||!l)&&(d==null||d(Mw(e,r,n))),e[0]=e[e.length-1],Wy(r),r.repeat=0);const f={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>G7?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:n,...r,keyframes:e},p=!u&&K7(f)?new B7({...f,element:f.motionValue.owner.current}):new jw(f);p.finished.then(()=>this.notifyFinished()).catch(Kn),this.pendingTimeline&&(this.stopTimeline=p.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=p}get finished(){return this._animation?this.animation.finished:this._finished}then(e,n){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),k7()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}const Y7=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function X7(t){const e=Y7.exec(t);if(!e)return[,];const[,n,r,s]=e;return[`--${n??r}`,s]}function bN(t,e,n=1){const[r,s]=X7(t);if(!r)return;const i=window.getComputedStyle(e).getPropertyValue(r);if(i){const o=i.trim();return qk(o)?parseFloat(o):o}return kw(s)?bN(s,e,n+1):s}function Uw(t,e){return(t==null?void 0:t[e])??(t==null?void 0:t.default)??t}const SN=new Set(["width","height","top","left","right","bottom",...ul]),J7={test:t=>t==="auto",parse:t=>t},CN=t=>e=>e.test(t),IN=[ll,le,Mr,Ds,z8,B8,J7],M1=t=>IN.find(CN(t));function Z7(t){return typeof t=="number"?t===0:t!==null?t==="none"||t==="0"||Gk(t):!0}const eH=new Set(["brightness","contrast","saturate","opacity"]);function tH(t){const[e,n]=t.slice(0,-1).split("(");if(e==="drop-shadow")return t;const[r]=n.match(Nw)||[];if(!r)return t;const s=n.replace(r,"");let i=eH.has(e)?1:0;return r!==n&&(i*=100),e+"("+i+s+")"}const nH=/\b([a-z-]*)\(.*?\)/gu,qy={...Ci,getAnimatableNone:t=>{const e=t.match(nH);return e?e.map(tH).join(" "):t}},V1={...ll,transform:Math.round},rH={rotate:Ds,rotateX:Ds,rotateY:Ds,rotateZ:Ds,scale:Pd,scaleX:Pd,scaleY:Pd,scaleZ:Pd,skew:Ds,skewX:Ds,skewY:Ds,distance:le,translateX:le,translateY:le,translateZ:le,x:le,y:le,z:le,perspective:le,transformPerspective:le,opacity:Xu,originX:b1,originY:b1,originZ:le},$w={borderWidth:le,borderTopWidth:le,borderRightWidth:le,borderBottomWidth:le,borderLeftWidth:le,borderRadius:le,radius:le,borderTopLeftRadius:le,borderTopRightRadius:le,borderBottomRightRadius:le,borderBottomLeftRadius:le,width:le,maxWidth:le,height:le,maxHeight:le,top:le,right:le,bottom:le,left:le,padding:le,paddingTop:le,paddingRight:le,paddingBottom:le,paddingLeft:le,margin:le,marginTop:le,marginRight:le,marginBottom:le,marginLeft:le,backgroundPositionX:le,backgroundPositionY:le,...rH,zIndex:V1,fillOpacity:Xu,strokeOpacity:Xu,numOctaves:V1},sH={...$w,color:yt,backgroundColor:yt,outlineColor:yt,fill:yt,stroke:yt,borderColor:yt,borderTopColor:yt,borderRightColor:yt,borderBottomColor:yt,borderLeftColor:yt,filter:qy,WebkitFilter:qy},PN=t=>sH[t];function AN(t,e){let n=PN(t);return n!==qy&&(n=Ci),n.getAnimatableNone?n.getAnimatableNone(e):void 0}const iH=new Set(["auto","none","0"]);function oH(t,e,n){let r=0,s;for(;r{e.getValue(l).set(u)}),this.resolveNoneKeyframes()}}function lH(t,e,n){if(t instanceof EventTarget)return[t];if(typeof t=="string"){let r=document;const s=(n==null?void 0:n[t])??r.querySelectorAll(t);return s?Array.from(s):[]}return Array.from(t)}const RN=(t,e)=>e&&typeof t=="number"?e.transform(t):t;function kN(t){return Kk(t)&&"offsetHeight"in t}const j1=30,uH=t=>!isNaN(parseFloat(t));class cH{constructor(e,n={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var i;const s=gn.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((i=this.events.change)==null||i.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=n.owner}setCurrent(e){this.current=e,this.updatedAt=gn.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=uH(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,n){this.events[e]||(this.events[e]=new Iw);const r=this.events[e].add(n);return e==="change"?()=>{r(),Qe.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,n){this.passiveEffect=e,this.stopPassiveEffect=n}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,n,r){this.set(n),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,n=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,n&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=gn.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>j1)return 0;const n=Math.min(this.updatedAt-this.prevUpdatedAt,j1);return Qk(parseFloat(this.current)-parseFloat(this.prevFrameValue),n)}start(e){return this.stop(),new Promise(n=>{this.hasAnimated=!0,this.animation=e(n),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,n;(e=this.dependents)==null||e.clear(),(n=this.events.destroy)==null||n.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function Wa(t,e){return new cH(t,e)}const{schedule:Bw}=oN(queueMicrotask,!1),tr={x:!1,y:!1};function NN(){return tr.x||tr.y}function dH(t){return t==="x"||t==="y"?tr[t]?null:(tr[t]=!0,()=>{tr[t]=!1}):tr.x||tr.y?null:(tr.x=tr.y=!0,()=>{tr.x=tr.y=!1})}function DN(t,e){const n=lH(t),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[n,s,()=>r.abort()]}function F1(t){return!(t.pointerType==="touch"||NN())}function hH(t,e,n={}){const[r,s,i]=DN(t,n),o=a=>{if(!F1(a))return;const{target:l}=a,u=e(l,a);if(typeof u!="function"||!l)return;const d=h=>{F1(h)&&(u(h),l.removeEventListener("pointerleave",d))};l.addEventListener("pointerleave",d,s)};return r.forEach(a=>{a.addEventListener("pointerenter",o,s)}),i}const ON=(t,e)=>e?t===e?!0:ON(t,e.parentElement):!1,zw=t=>t.pointerType==="mouse"?typeof t.button!="number"||t.button<=0:t.isPrimary!==!1,fH=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function pH(t){return fH.has(t.tagName)||t.tabIndex!==-1}const oh=new WeakSet;function U1(t){return e=>{e.key==="Enter"&&t(e)}}function jm(t,e){t.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const mH=(t,e)=>{const n=t.currentTarget;if(!n)return;const r=U1(()=>{if(oh.has(n))return;jm(n,"down");const s=U1(()=>{jm(n,"up")}),i=()=>jm(n,"cancel");n.addEventListener("keyup",s,e),n.addEventListener("blur",i,e)});n.addEventListener("keydown",r,e),n.addEventListener("blur",()=>n.removeEventListener("keydown",r),e)};function $1(t){return zw(t)&&!NN()}function gH(t,e,n={}){const[r,s,i]=DN(t,n),o=a=>{const l=a.currentTarget;if(!$1(a))return;oh.add(l);const u=e(l,a),d=(p,g)=>{window.removeEventListener("pointerup",h),window.removeEventListener("pointercancel",f),oh.has(l)&&oh.delete(l),$1(p)&&typeof u=="function"&&u(p,{success:g})},h=p=>{d(p,l===window||l===document||n.useGlobalTarget||ON(l,p.target))},f=p=>{d(p,!1)};window.addEventListener("pointerup",h,s),window.addEventListener("pointercancel",f,s)};return r.forEach(a=>{(n.useGlobalTarget?window:a).addEventListener("pointerdown",o,s),kN(a)&&(a.addEventListener("focus",u=>mH(u,s)),!pH(a)&&!a.hasAttribute("tabindex")&&(a.tabIndex=0))}),i}function LN(t){return Kk(t)&&"ownerSVGElement"in t}function yH(t){return LN(t)&&t.tagName==="svg"}const Xt=t=>!!(t&&t.getVelocity),vH=[...IN,yt,Ci],wH=t=>vH.find(CN(t)),Hw=b.createContext({transformPagePoint:t=>t,isStatic:!1,reducedMotion:"never"});function B1(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function xH(...t){return e=>{let n=!1;const r=t.map(s=>{const i=B1(s,e);return!n&&typeof i=="function"&&(n=!0),i});if(n)return()=>{for(let s=0;s{const{width:u,height:d,top:h,left:f,right:p}=o.current;if(e||!i.current||!u||!d)return;const g=n==="left"?`left: ${f}`:`right: ${p}`;i.current.dataset.motionPopId=s;const w=document.createElement("style");a&&(w.nonce=a);const _=r??document.head;return _.appendChild(w),w.sheet&&w.sheet.insertRule(` [data-motion-pop-id="${s}"] { position: absolute !important; width: ${u}px !important; height: ${d}px !important; ${g}px !important; top: ${h}px !important; } `),()=>{_.contains(w)&&_.removeChild(w)}},[e]),y.jsx(EH,{isPresent:e,childRef:i,sizeRef:o,children:b.cloneElement(t,{ref:l})})}const bH=({children:t,initial:e,isPresent:n,onExitComplete:r,custom:s,presenceAffectsLayout:i,mode:o,anchorX:a,root:l})=>{const u=_w(SH),d=b.useId();let h=!0,f=b.useMemo(()=>(h=!1,{id:d,initial:e,isPresent:n,custom:s,onExitComplete:p=>{u.set(p,!0);for(const g of u.values())if(!g)return;r&&r()},register:p=>(u.set(p,!1),()=>u.delete(p))}),[n,u,r]);return i&&h&&(f={...f}),b.useMemo(()=>{u.forEach((p,g)=>u.set(g,!1))},[n]),b.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),o==="popLayout"&&(t=y.jsx(TH,{isPresent:n,anchorX:a,root:l,children:t})),y.jsx(wp.Provider,{value:f,children:t})};function SH(){return new Map}function MN(t=!0){const e=b.useContext(wp);if(e===null)return[!0,null];const{isPresent:n,onExitComplete:r,register:s}=e,i=b.useId();b.useEffect(()=>{if(t)return s(i)},[t]);const o=b.useCallback(()=>t&&r&&r(i),[i,r,t]);return!n&&r?[!1,o]:[!0]}const Ad=t=>t.key||"";function z1(t){const e=[];return b.Children.forEach(t,n=>{b.isValidElement(n)&&e.push(n)}),e}const CH=({children:t,custom:e,initial:n=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:i="sync",propagate:o=!1,anchorX:a="left",root:l})=>{const[u,d]=MN(o),h=b.useMemo(()=>z1(t),[t]),f=o&&!u?[]:h.map(Ad),p=b.useRef(!0),g=b.useRef(h),w=_w(()=>new Map),[_,v]=b.useState(h),[x,T]=b.useState(h);Wk(()=>{p.current=!1,g.current=h;for(let L=0;L{const C=Ad(L),S=o&&!u?!1:h===x||f.includes(C),I=()=>{if(w.has(C))w.set(C,!0);else return;let P=!0;w.forEach(N=>{N||(P=!1)}),P&&(k==null||k(),T(g.current),o&&(d==null||d()),r&&r())};return y.jsx(bH,{isPresent:S,initial:!p.current||n?void 0:!1,custom:e,presenceAffectsLayout:s,mode:i,root:l,onExitComplete:S?void 0:I,anchorX:a,children:L},C)})})},VN=b.createContext({strict:!1}),H1={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"]},qa={};for(const t in H1)qa[t]={isEnabled:e=>H1[t].some(n=>!!e[n])};function IH(t){for(const e in t)qa[e]={...qa[e],...t[e]}}const PH=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 hf(t){return t.startsWith("while")||t.startsWith("drag")&&t!=="draggable"||t.startsWith("layout")||t.startsWith("onTap")||t.startsWith("onPan")||t.startsWith("onLayout")||PH.has(t)}let jN=t=>!hf(t);function AH(t){typeof t=="function"&&(jN=e=>e.startsWith("on")?!hf(e):t(e))}try{AH(require("@emotion/is-prop-valid").default)}catch{}function RH(t,e,n){const r={};for(const s in t)s==="values"&&typeof t.values=="object"||(jN(s)||n===!0&&hf(s)||!e&&!hf(s)||t.draggable&&s.startsWith("onDrag"))&&(r[s]=t[s]);return r}const xp=b.createContext({});function _p(t){return t!==null&&typeof t=="object"&&typeof t.start=="function"}function Zu(t){return typeof t=="string"||Array.isArray(t)}const Ww=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],qw=["initial",...Ww];function Ep(t){return _p(t.animate)||qw.some(e=>Zu(t[e]))}function FN(t){return!!(Ep(t)||t.variants)}function kH(t,e){if(Ep(t)){const{initial:n,animate:r}=t;return{initial:n===!1||Zu(n)?n:void 0,animate:Zu(r)?r:void 0}}return t.inherit!==!1?e:{}}function NH(t){const{initial:e,animate:n}=kH(t,b.useContext(xp));return b.useMemo(()=>({initial:e,animate:n}),[W1(e),W1(n)])}function W1(t){return Array.isArray(t)?t.join(" "):t}const ec={};function DH(t){for(const e in t)ec[e]=t[e],Rw(e)&&(ec[e].isCSSVariable=!0)}function UN(t,{layout:e,layoutId:n}){return cl.has(t)||t.startsWith("origin")||(e||n!==void 0)&&(!!ec[t]||t==="opacity")}const OH={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},LH=ul.length;function MH(t,e,n){let r="",s=!0;for(let i=0;i({style:{},transform:{},transformOrigin:{},vars:{}});function $N(t,e,n){for(const r in e)!Xt(e[r])&&!UN(r,n)&&(t[r]=e[r])}function VH({transformTemplate:t},e){return b.useMemo(()=>{const n=Gw();return Kw(n,e,t),Object.assign({},n.vars,n.style)},[e])}function jH(t,e){const n=t.style||{},r={};return $N(r,n,t),Object.assign(r,VH(t,e)),r}function FH(t,e){const n={},r=jH(t,e);return t.drag&&t.dragListener!==!1&&(n.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=t.drag===!0?"none":`pan-${t.drag==="x"?"y":"x"}`),t.tabIndex===void 0&&(t.onTap||t.onTapStart||t.whileTap)&&(n.tabIndex=0),n.style=r,n}const UH={offset:"stroke-dashoffset",array:"stroke-dasharray"},$H={offset:"strokeDashoffset",array:"strokeDasharray"};function BH(t,e,n=1,r=0,s=!0){t.pathLength=1;const i=s?UH:$H;t[i.offset]=le.transform(-r);const o=le.transform(e),a=le.transform(n);t[i.array]=`${o} ${a}`}function BN(t,{attrX:e,attrY:n,attrScale:r,pathLength:s,pathSpacing:i=1,pathOffset:o=0,...a},l,u,d){if(Kw(t,a,u),l){t.style.viewBox&&(t.attrs.viewBox=t.style.viewBox);return}t.attrs=t.style,t.style={};const{attrs:h,style:f}=t;h.transform&&(f.transform=h.transform,delete h.transform),(f.transform||h.transformOrigin)&&(f.transformOrigin=h.transformOrigin??"50% 50%",delete h.transformOrigin),f.transform&&(f.transformBox=(d==null?void 0:d.transformBox)??"fill-box",delete h.transformBox),e!==void 0&&(h.x=e),n!==void 0&&(h.y=n),r!==void 0&&(h.scale=r),s!==void 0&&BH(h,s,i,o,!1)}const zN=()=>({...Gw(),attrs:{}}),HN=t=>typeof t=="string"&&t.toLowerCase()==="svg";function zH(t,e,n,r){const s=b.useMemo(()=>{const i=zN();return BN(i,e,HN(r),t.transformTemplate,t.style),{...i.attrs,style:{...i.style}}},[e]);if(t.style){const i={};$N(i,t.style,t),s.style={...i,...s.style}}return s}const HH=["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 Qw(t){return typeof t!="string"||t.includes("-")?!1:!!(HH.indexOf(t)>-1||/[A-Z]/u.test(t))}function WH(t,e,n,{latestValues:r},s,i=!1){const a=(Qw(t)?zH:FH)(e,r,s,t),l=RH(e,typeof t=="string",i),u=t!==b.Fragment?{...l,...a,ref:n}:{},{children:d}=e,h=b.useMemo(()=>Xt(d)?d.get():d,[d]);return b.createElement(t,{...u,children:h})}function q1(t){const e=[{},{}];return t==null||t.values.forEach((n,r)=>{e[0][r]=n.get(),e[1][r]=n.getVelocity()}),e}function Yw(t,e,n,r){if(typeof e=="function"){const[s,i]=q1(r);e=e(n!==void 0?n:t.custom,s,i)}if(typeof e=="string"&&(e=t.variants&&t.variants[e]),typeof e=="function"){const[s,i]=q1(r);e=e(n!==void 0?n:t.custom,s,i)}return e}function ah(t){return Xt(t)?t.get():t}function qH({scrapeMotionValuesFromProps:t,createRenderState:e},n,r,s){return{latestValues:KH(n,r,s,t),renderState:e()}}function KH(t,e,n,r){const s={},i=r(t,{});for(const f in i)s[f]=ah(i[f]);let{initial:o,animate:a}=t;const l=Ep(t),u=FN(t);e&&u&&!l&&t.inherit!==!1&&(o===void 0&&(o=e.initial),a===void 0&&(a=e.animate));let d=n?n.initial===!1:!1;d=d||o===!1;const h=d?a:o;if(h&&typeof h!="boolean"&&!_p(h)){const f=Array.isArray(h)?h:[h];for(let p=0;p(e,n)=>{const r=b.useContext(xp),s=b.useContext(wp),i=()=>qH(t,e,r,s);return n?i():_w(i)};function Xw(t,e,n){var i;const{style:r}=t,s={};for(const o in r)(Xt(r[o])||e.style&&Xt(e.style[o])||UN(o,t)||((i=n==null?void 0:n.getValue(o))==null?void 0:i.liveStyle)!==void 0)&&(s[o]=r[o]);return s}const GH=WN({scrapeMotionValuesFromProps:Xw,createRenderState:Gw});function qN(t,e,n){const r=Xw(t,e,n);for(const s in t)if(Xt(t[s])||Xt(e[s])){const i=ul.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[i]=t[s]}return r}const QH=WN({scrapeMotionValuesFromProps:qN,createRenderState:zN}),YH=Symbol.for("motionComponentSymbol");function ta(t){return t&&typeof t=="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function XH(t,e,n){return b.useCallback(r=>{r&&t.onMount&&t.onMount(r),e&&(r?e.mount(r):e.unmount()),n&&(typeof n=="function"?n(r):ta(n)&&(n.current=r))},[e])}const Jw=t=>t.replace(/([a-z])([A-Z])/gu,"$1-$2").toLowerCase(),JH="framerAppearId",KN="data-"+Jw(JH),GN=b.createContext({});function ZH(t,e,n,r,s){var w,_;const{visualElement:i}=b.useContext(xp),o=b.useContext(VN),a=b.useContext(wp),l=b.useContext(Hw).reducedMotion,u=b.useRef(null);r=r||o.renderer,!u.current&&r&&(u.current=r(t,{visualState:e,parent:i,props:n,presenceContext:a,blockInitialAnimation:a?a.initial===!1:!1,reducedMotionConfig:l}));const d=u.current,h=b.useContext(GN);d&&!d.projection&&s&&(d.type==="html"||d.type==="svg")&&eW(u.current,n,s,h);const f=b.useRef(!1);b.useInsertionEffect(()=>{d&&f.current&&d.update(n,a)});const p=n[KN],g=b.useRef(!!p&&!((w=window.MotionHandoffIsComplete)!=null&&w.call(window,p))&&((_=window.MotionHasOptimisedAnimation)==null?void 0:_.call(window,p)));return Wk(()=>{d&&(f.current=!0,window.MotionIsMounted=!0,d.updateFeatures(),d.scheduleRenderMicrotask(),g.current&&d.animationState&&d.animationState.animateChanges())}),b.useEffect(()=>{d&&(!g.current&&d.animationState&&d.animationState.animateChanges(),g.current&&(queueMicrotask(()=>{var v;(v=window.MotionHandoffMarkAsComplete)==null||v.call(window,p)}),g.current=!1),d.enteringChildren=void 0)}),d}function eW(t,e,n,r){const{layoutId:s,layout:i,drag:o,dragConstraints:a,layoutScroll:l,layoutRoot:u,layoutCrossfade:d}=e;t.projection=new n(t.latestValues,e["data-framer-portal-id"]?void 0:QN(t.parent)),t.projection.setOptions({layoutId:s,layout:i,alwaysMeasureLayout:!!o||a&&ta(a),visualElement:t,animationType:typeof i=="string"?i:"both",initialPromotionConfig:r,crossfade:d,layoutScroll:l,layoutRoot:u})}function QN(t){if(t)return t.options.allowProjection!==!1?t.projection:QN(t.parent)}function Fm(t,{forwardMotionProps:e=!1}={},n,r){n&&IH(n);const s=Qw(t)?QH:GH;function i(a,l){let u;const d={...b.useContext(Hw),...a,layoutId:tW(a)},{isStatic:h}=d,f=NH(a),p=s(a,h);if(!h&&Ew){nW();const g=rW(d);u=g.MeasureLayout,f.visualElement=ZH(t,p,d,r,g.ProjectionNode)}return y.jsxs(xp.Provider,{value:f,children:[u&&f.visualElement?y.jsx(u,{visualElement:f.visualElement,...d}):null,WH(t,a,XH(p,f.visualElement,l),p,h,e)]})}i.displayName=`motion.${typeof t=="string"?t:`create(${t.displayName??t.name??""})`}`;const o=b.forwardRef(i);return o[YH]=t,o}function tW({layoutId:t}){const e=b.useContext(xw).id;return e&&t!==void 0?e+"-"+t:t}function nW(t,e){b.useContext(VN).strict}function rW(t){const{drag:e,layout:n}=qa;if(!e&&!n)return{};const r={...e,...n};return{MeasureLayout:e!=null&&e.isEnabled(t)||n!=null&&n.isEnabled(t)?r.MeasureLayout:void 0,ProjectionNode:r.ProjectionNode}}function sW(t,e){if(typeof Proxy>"u")return Fm;const n=new Map,r=(i,o)=>Fm(i,o,t,e),s=(i,o)=>r(i,o);return new Proxy(s,{get:(i,o)=>o==="create"?r:(n.has(o)||n.set(o,Fm(o,void 0,t,e)),n.get(o))})}function YN({top:t,left:e,right:n,bottom:r}){return{x:{min:e,max:n},y:{min:t,max:r}}}function iW({x:t,y:e}){return{top:e.min,right:t.max,bottom:e.max,left:t.min}}function oW(t,e){if(!e)return t;const n=e({x:t.left,y:t.top}),r=e({x:t.right,y:t.bottom});return{top:n.y,left:n.x,bottom:r.y,right:r.x}}function Um(t){return t===void 0||t===1}function Ky({scale:t,scaleX:e,scaleY:n}){return!Um(t)||!Um(e)||!Um(n)}function zi(t){return Ky(t)||XN(t)||t.z||t.rotate||t.rotateX||t.rotateY||t.skewX||t.skewY}function XN(t){return K1(t.x)||K1(t.y)}function K1(t){return t&&t!=="0%"}function ff(t,e,n){const r=t-n,s=e*r;return n+s}function G1(t,e,n,r,s){return s!==void 0&&(t=ff(t,s,r)),ff(t,n,r)+e}function Gy(t,e=0,n=1,r,s){t.min=G1(t.min,e,n,r,s),t.max=G1(t.max,e,n,r,s)}function JN(t,{x:e,y:n}){Gy(t.x,e.translate,e.scale,e.originPoint),Gy(t.y,n.translate,n.scale,n.originPoint)}const Q1=.999999999999,Y1=1.0000000000001;function aW(t,e,n,r=!1){const s=n.length;if(!s)return;e.x=e.y=1;let i,o;for(let a=0;aQ1&&(e.x=1),e.yQ1&&(e.y=1)}function na(t,e){t.min=t.min+e,t.max=t.max+e}function X1(t,e,n,r,s=.5){const i=Je(t.min,t.max,s);Gy(t,e,n,i,r)}function ra(t,e){X1(t.x,e.x,e.scaleX,e.scale,e.originX),X1(t.y,e.y,e.scaleY,e.scale,e.originY)}function ZN(t,e){return YN(oW(t.getBoundingClientRect(),e))}function lW(t,e,n){const r=ZN(t,n),{scroll:s}=e;return s&&(na(r.x,s.offset.x),na(r.y,s.offset.y)),r}const J1=()=>({translate:0,scale:1,origin:0,originPoint:0}),sa=()=>({x:J1(),y:J1()}),Z1=()=>({min:0,max:0}),ct=()=>({x:Z1(),y:Z1()}),Qy={current:null},e2={current:!1};function uW(){if(e2.current=!0,!!Ew)if(window.matchMedia){const t=window.matchMedia("(prefers-reduced-motion)"),e=()=>Qy.current=t.matches;t.addEventListener("change",e),e()}else Qy.current=!1}const cW=new WeakMap;function dW(t,e,n){for(const r in e){const s=e[r],i=n[r];if(Xt(s))t.addValue(r,s);else if(Xt(i))t.addValue(r,Wa(s,{owner:t}));else if(i!==s)if(t.hasValue(r)){const o=t.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=t.getStaticValue(r);t.addValue(r,Wa(o!==void 0?o:s,{owner:t}))}}for(const r in n)e[r]===void 0&&t.removeValue(r);return e}const eb=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];class hW{scrapeMotionValuesFromProps(e,n,r){return{}}constructor({parent:e,props:n,presenceContext:r,reducedMotionConfig:s,blockInitialAnimation:i,visualState:o},a={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.values=new Map,this.KeyframeResolver=Fw,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 f=gn.now();this.renderScheduledAtthis.bindToMotionValue(s,r)),e2.current||uW(),this.shouldReduceMotion=this.reducedMotionConfig==="never"?!1:this.reducedMotionConfig==="always"?!0:Qy.current,(n=this.parent)==null||n.addChild(this),this.update(this.props,this.presenceContext)}unmount(){var e;this.projection&&this.projection.unmount(),Si(this.notifyUpdate),Si(this.render),this.valueSubscriptions.forEach(n=>n()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const n in this.events)this.events[n].clear();for(const n in this.features){const r=this.features[n];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,n){this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)();const r=cl.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=n.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&Qe.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let i;window.MotionCheckAppearSync&&(i=window.MotionCheckAppearSync(this,e,n)),this.valueSubscriptions.set(e,()=>{s(),i&&i(),n.owner&&n.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 qa){const n=qa[e];if(!n)continue;const{isEnabled:r,Feature:s}=n;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const i=this.features[e];i.isMounted?i.update():(i.mount(),i.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):ct()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,n){this.latestValues[e]=n}update(e,n){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=n;for(let r=0;rn.variantChildren.delete(e)}addValue(e,n){const r=this.values.get(e);n!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,n),this.values.set(e,n),this.latestValues[e]=n.get())}removeValue(e){this.values.delete(e);const n=this.valueSubscriptions.get(e);n&&(n(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,n){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&n!==void 0&&(r=Wa(n===null?void 0:n,{owner:this}),this.addValue(e,r)),r}readValue(e,n){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(qk(r)||Gk(r))?r=parseFloat(r):!wH(r)&&Ci.test(n)&&(r=AN(e,n)),this.setBaseTarget(e,Xt(r)?r.get():r)),Xt(r)?r.get():r}setBaseTarget(e,n){this.baseTarget[e]=n}getBaseTarget(e){var i;const{initial:n}=this.props;let r;if(typeof n=="string"||typeof n=="object"){const o=Yw(this.props,n,(i=this.presenceContext)==null?void 0:i.custom);o&&(r=o[e])}if(n&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!Xt(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,n){return this.events[e]||(this.events[e]=new Iw),this.events[e].add(n)}notify(e,...n){this.events[e]&&this.events[e].notify(...n)}scheduleRenderMicrotask(){Bw.render(this.render)}}class t2 extends hW{constructor(){super(...arguments),this.KeyframeResolver=aH}sortInstanceNodePosition(e,n){return e.compareDocumentPosition(n)&2?1:-1}getBaseTargetFromProps(e,n){return e.style?e.style[n]:void 0}removeValueFromRenderState(e,{vars:n,style:r}){delete n[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;Xt(e)&&(this.childSubscription=e.on("change",n=>{this.current&&(this.current.textContent=`${n}`)}))}}function n2(t,{style:e,vars:n},r,s){const i=t.style;let o;for(o in e)i[o]=e[o];s==null||s.applyProjectionStyles(i,r);for(o in n)i.setProperty(o,n[o])}function fW(t){return window.getComputedStyle(t)}class pW extends t2{constructor(){super(...arguments),this.type="html",this.renderInstance=n2}readValueFromInstance(e,n){var r;if(cl.has(n))return(r=this.projection)!=null&&r.isProjecting?Uy(n):C7(e,n);{const s=fW(e),i=(Rw(n)?s.getPropertyValue(n):s[n])||0;return typeof i=="string"?i.trim():i}}measureInstanceViewportBox(e,{transformPagePoint:n}){return ZN(e,n)}build(e,n,r){Kw(e,n,r.transformTemplate)}scrapeMotionValuesFromProps(e,n,r){return Xw(e,n,r)}}const r2=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 mW(t,e,n,r){n2(t,e,void 0,r);for(const s in e.attrs)t.setAttribute(r2.has(s)?s:Jw(s),e.attrs[s])}class gW extends t2{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=ct}getBaseTargetFromProps(e,n){return e[n]}readValueFromInstance(e,n){if(cl.has(n)){const r=PN(n);return r&&r.default||0}return n=r2.has(n)?n:Jw(n),e.getAttribute(n)}scrapeMotionValuesFromProps(e,n,r){return qN(e,n,r)}build(e,n,r){BN(e,n,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,n,r,s){mW(e,n,r,s)}mount(e){this.isSVGTag=HN(e.tagName),super.mount(e)}}const yW=(t,e)=>Qw(t)?new gW(e):new pW(e,{allowProjection:t!==b.Fragment});function ya(t,e,n){const r=t.getProps();return Yw(r,e,n!==void 0?n:r.custom,t)}const Yy=t=>Array.isArray(t);function vW(t,e,n){t.hasValue(e)?t.getValue(e).set(n):t.addValue(e,Wa(n))}function wW(t){return Yy(t)?t[t.length-1]||0:t}function xW(t,e){const n=ya(t,e);let{transitionEnd:r={},transition:s={},...i}=n||{};i={...i,...r};for(const o in i){const a=wW(i[o]);vW(t,o,a)}}function _W(t){return!!(Xt(t)&&t.add)}function Xy(t,e){const n=t.getValue("willChange");if(_W(n))return n.add(e);if(!n&&ms.WillChange){const r=new ms.WillChange("auto");t.addValue("willChange",r),r.add(e)}}function s2(t){return t.props[KN]}const EW=t=>t!==null;function TW(t,{repeat:e,repeatType:n="loop"},r){const s=t.filter(EW),i=e&&n!=="loop"&&e%2===1?0:s.length-1;return s[i]}const bW={type:"spring",stiffness:500,damping:25,restSpeed:10},SW=t=>({type:"spring",stiffness:550,damping:t===0?2*Math.sqrt(550):30,restSpeed:10}),CW={type:"keyframes",duration:.8},IW={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},PW=(t,{keyframes:e})=>e.length>2?CW:cl.has(t)?t.startsWith("scale")?SW(e[1]):bW:IW;function AW({when:t,delay:e,delayChildren:n,staggerChildren:r,staggerDirection:s,repeat:i,repeatType:o,repeatDelay:a,from:l,elapsed:u,...d}){return!!Object.keys(d).length}const Zw=(t,e,n,r={},s,i)=>o=>{const a=Uw(r,t)||{},l=a.delay||r.delay||0;let{elapsed:u=0}=r;u=u-Lr(l);const d={keyframes:Array.isArray(n)?n:[null,n],ease:"easeOut",velocity:e.getVelocity(),...a,delay:-u,onUpdate:f=>{e.set(f),a.onUpdate&&a.onUpdate(f)},onComplete:()=>{o(),a.onComplete&&a.onComplete()},name:t,motionValue:e,element:i?void 0:s};AW(a)||Object.assign(d,PW(t,d)),d.duration&&(d.duration=Lr(d.duration)),d.repeatDelay&&(d.repeatDelay=Lr(d.repeatDelay)),d.from!==void 0&&(d.keyframes[0]=d.from);let h=!1;if((d.type===!1||d.duration===0&&!d.repeatDelay)&&(Wy(d),d.delay===0&&(h=!0)),(ms.instantAnimations||ms.skipAnimations)&&(h=!0,Wy(d),d.delay=0),d.allowFlatten=!a.type&&!a.ease,h&&!i&&e.get()!==void 0){const f=TW(d.keyframes,a);if(f!==void 0){Qe.update(()=>{d.onUpdate(f),d.onComplete()});return}}return a.isSync?new jw(d):new Q7(d)};function RW({protectedKeys:t,needsAnimating:e},n){const r=t.hasOwnProperty(n)&&e[n]!==!0;return e[n]=!1,r}function i2(t,e,{delay:n=0,transitionOverride:r,type:s}={}){let{transition:i=t.getDefaultTransition(),transitionEnd:o,...a}=e;r&&(i=r);const l=[],u=s&&t.animationState&&t.animationState.getState()[s];for(const d in a){const h=t.getValue(d,t.latestValues[d]??null),f=a[d];if(f===void 0||u&&RW(u,d))continue;const p={delay:n,...Uw(i||{},d)},g=h.get();if(g!==void 0&&!h.isAnimating&&!Array.isArray(f)&&f===g&&!p.velocity)continue;let w=!1;if(window.MotionHandoffAnimation){const v=s2(t);if(v){const x=window.MotionHandoffAnimation(v,d,Qe);x!==null&&(p.startTime=x,w=!0)}}Xy(t,d),h.start(Zw(d,h,f,t.shouldReduceMotion&&SN.has(d)?{type:!1}:p,t,w));const _=h.animation;_&&l.push(_)}return o&&Promise.all(l).then(()=>{Qe.update(()=>{o&&xW(t,o)})}),l}function o2(t,e,n,r=0,s=1){const i=Array.from(t).sort((u,d)=>u.sortNodePosition(d)).indexOf(e),o=t.size,a=(o-1)*r;return typeof n=="function"?n(i,o):s===1?i*r:a-i*r}function Jy(t,e,n={}){var l;const r=ya(t,e,n.type==="exit"?(l=t.presenceContext)==null?void 0:l.custom:void 0);let{transition:s=t.getDefaultTransition()||{}}=r||{};n.transitionOverride&&(s=n.transitionOverride);const i=r?()=>Promise.all(i2(t,r,n)):()=>Promise.resolve(),o=t.variantChildren&&t.variantChildren.size?(u=0)=>{const{delayChildren:d=0,staggerChildren:h,staggerDirection:f}=s;return kW(t,e,u,d,h,f,n)}:()=>Promise.resolve(),{when:a}=s;if(a){const[u,d]=a==="beforeChildren"?[i,o]:[o,i];return u().then(()=>d())}else return Promise.all([i(),o(n.delay)])}function kW(t,e,n=0,r=0,s=0,i=1,o){const a=[];for(const l of t.variantChildren)l.notify("AnimationStart",e),a.push(Jy(l,e,{...o,delay:n+(typeof r=="function"?0:r)+o2(t.variantChildren,l,r,s,i)}).then(()=>l.notify("AnimationComplete",e)));return Promise.all(a)}function NW(t,e,n={}){t.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(i=>Jy(t,i,n));r=Promise.all(s)}else if(typeof e=="string")r=Jy(t,e,n);else{const s=typeof e=="function"?ya(t,e,n.custom):e;r=Promise.all(i2(t,s,n))}return r.then(()=>{t.notify("AnimationComplete",e)})}function a2(t,e){if(!Array.isArray(e))return!1;const n=e.length;if(n!==t.length)return!1;for(let r=0;rPromise.all(e.map(({animation:n,options:r})=>NW(t,n,r)))}function VW(t){let e=MW(t),n=tb(),r=!0;const s=l=>(u,d)=>{var f;const h=ya(t,d,l==="exit"?(f=t.presenceContext)==null?void 0:f.custom:void 0);if(h){const{transition:p,transitionEnd:g,...w}=h;u={...u,...w,...g}}return u};function i(l){e=l(t)}function o(l){const{props:u}=t,d=l2(t.parent)||{},h=[],f=new Set;let p={},g=1/0;for(let _=0;_g&&A,I=!1;const P=Array.isArray(T)?T:[T];let N=P.reduce(s(v),{});k===!1&&(N={});const{prevResolvedValues:O={}}=x,D={...O,...N},z=G=>{S=!0,f.has(G)&&(I=!0,f.delete(G)),x.needsAnimating[G]=!0;const M=t.getValue(G);M&&(M.liveStyle=!1)};for(const G in D){const M=N[G],B=O[G];if(p.hasOwnProperty(G))continue;let Q=!1;Yy(M)&&Yy(B)?Q=!a2(M,B):Q=M!==B,Q?M!=null?z(G):f.add(G):M!==void 0&&f.has(G)?z(G):x.protectedKeys[G]=!0}x.prevProp=T,x.prevResolvedValues=N,x.isActive&&(p={...p,...N}),r&&t.blockInitialAnimation&&(S=!1);const re=L&&C;S&&(!re||I)&&h.push(...P.map(G=>{const M={type:v};if(typeof G=="string"&&r&&!re&&t.manuallyAnimateOnMount&&t.parent){const{parent:B}=t,Q=ya(B,G);if(B.enteringChildren&&Q){const{delayChildren:H}=Q.transition||{};M.delay=o2(B.enteringChildren,t,H)}}return{animation:G,options:M}}))}if(f.size){const _={};if(typeof u.initial!="boolean"){const v=ya(t,Array.isArray(u.initial)?u.initial[0]:u.initial);v&&v.transition&&(_.transition=v.transition)}f.forEach(v=>{const x=t.getBaseTarget(v),T=t.getValue(v);T&&(T.liveStyle=!0),_[v]=x??null}),h.push({animation:_})}let w=!!h.length;return r&&(u.initial===!1||u.initial===u.animate)&&!t.manuallyAnimateOnMount&&(w=!1),r=!1,w?e(h):Promise.resolve()}function a(l,u){var h;if(n[l].isActive===u)return Promise.resolve();(h=t.variantChildren)==null||h.forEach(f=>{var p;return(p=f.animationState)==null?void 0:p.setActive(l,u)}),n[l].isActive=u;const d=o(l);for(const f in n)n[f].protectedKeys={};return d}return{animateChanges:o,setActive:a,setAnimateFunction:i,getState:()=>n,reset:()=>{n=tb(),r=!0}}}function jW(t,e){return typeof e=="string"?e!==t:Array.isArray(e)?!a2(e,t):!1}function Fi(t=!1){return{isActive:t,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function tb(){return{animate:Fi(!0),whileInView:Fi(),whileHover:Fi(),whileTap:Fi(),whileDrag:Fi(),whileFocus:Fi(),exit:Fi()}}class Di{constructor(e){this.isMounted=!1,this.node=e}update(){}}class FW extends Di{constructor(e){super(e),e.animationState||(e.animationState=VW(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();_p(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:n}=this.node.prevProps||{};e!==n&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let UW=0;class $W extends Di{constructor(){super(...arguments),this.id=UW++}update(){if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:n}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;const s=this.node.animationState.setActive("exit",!e);n&&!e&&s.then(()=>{n(this.id)})}mount(){const{register:e,onExitComplete:n}=this.node.presenceContext||{};n&&n(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const BW={animation:{Feature:FW},exit:{Feature:$W}};function tc(t,e,n,r={passive:!0}){return t.addEventListener(e,n,r),()=>t.removeEventListener(e,n)}function Dc(t){return{point:{x:t.pageX,y:t.pageY}}}const zW=t=>e=>zw(e)&&t(e,Dc(e));function hu(t,e,n,r){return tc(t,e,zW(n),r)}const u2=1e-4,HW=1-u2,WW=1+u2,c2=.01,qW=0-c2,KW=0+c2;function on(t){return t.max-t.min}function GW(t,e,n){return Math.abs(t-e)<=n}function nb(t,e,n,r=.5){t.origin=r,t.originPoint=Je(e.min,e.max,t.origin),t.scale=on(n)/on(e),t.translate=Je(n.min,n.max,t.origin)-t.originPoint,(t.scale>=HW&&t.scale<=WW||isNaN(t.scale))&&(t.scale=1),(t.translate>=qW&&t.translate<=KW||isNaN(t.translate))&&(t.translate=0)}function fu(t,e,n,r){nb(t.x,e.x,n.x,r?r.originX:void 0),nb(t.y,e.y,n.y,r?r.originY:void 0)}function rb(t,e,n){t.min=n.min+e.min,t.max=t.min+on(e)}function QW(t,e,n){rb(t.x,e.x,n.x),rb(t.y,e.y,n.y)}function sb(t,e,n){t.min=e.min-n.min,t.max=t.min+on(e)}function pu(t,e,n){sb(t.x,e.x,n.x),sb(t.y,e.y,n.y)}function Fn(t){return[t("x"),t("y")]}const d2=({current:t})=>t?t.ownerDocument.defaultView:null,ib=(t,e)=>Math.abs(t-e);function YW(t,e){const n=ib(t.x,e.x),r=ib(t.y,e.y);return Math.sqrt(n**2+r**2)}class h2{constructor(e,n,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:i=!1,distanceThreshold:o=3}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const f=Bm(this.lastMoveEventInfo,this.history),p=this.startEvent!==null,g=YW(f.offset,{x:0,y:0})>=this.distanceThreshold;if(!p&&!g)return;const{point:w}=f,{timestamp:_}=Ot;this.history.push({...w,timestamp:_});const{onStart:v,onMove:x}=this.handlers;p||(v&&v(this.lastMoveEvent,f),this.startEvent=this.lastMoveEvent),x&&x(this.lastMoveEvent,f)},this.handlePointerMove=(f,p)=>{this.lastMoveEvent=f,this.lastMoveEventInfo=$m(p,this.transformPagePoint),Qe.update(this.updatePoint,!0)},this.handlePointerUp=(f,p)=>{this.end();const{onEnd:g,onSessionEnd:w,resumeAnimation:_}=this.handlers;if(this.dragSnapToOrigin&&_&&_(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const v=Bm(f.type==="pointercancel"?this.lastMoveEventInfo:$m(p,this.transformPagePoint),this.history);this.startEvent&&g&&g(f,v),w&&w(f,v)},!zw(e))return;this.dragSnapToOrigin=i,this.handlers=n,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const a=Dc(e),l=$m(a,this.transformPagePoint),{point:u}=l,{timestamp:d}=Ot;this.history=[{...u,timestamp:d}];const{onSessionStart:h}=n;h&&h(e,Bm(l,this.history)),this.removeListeners=Rc(hu(this.contextWindow,"pointermove",this.handlePointerMove),hu(this.contextWindow,"pointerup",this.handlePointerUp),hu(this.contextWindow,"pointercancel",this.handlePointerUp))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),Si(this.updatePoint)}}function $m(t,e){return e?{point:e(t.point)}:t}function ob(t,e){return{x:t.x-e.x,y:t.y-e.y}}function Bm({point:t},e){return{point:t,delta:ob(t,f2(e)),offset:ob(t,XW(e)),velocity:JW(e,.1)}}function XW(t){return t[0]}function f2(t){return t[t.length-1]}function JW(t,e){if(t.length<2)return{x:0,y:0};let n=t.length-1,r=null;const s=f2(t);for(;n>=0&&(r=t[n],!(s.timestamp-r.timestamp>Lr(e)));)n--;if(!r)return{x:0,y:0};const i=Wn(s.timestamp-r.timestamp);if(i===0)return{x:0,y:0};const o={x:(s.x-r.x)/i,y:(s.y-r.y)/i};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function ZW(t,{min:e,max:n},r){return e!==void 0&&tn&&(t=r?Je(n,t,r.max):Math.min(t,n)),t}function ab(t,e,n){return{min:e!==void 0?t.min+e:void 0,max:n!==void 0?t.max+n-(t.max-t.min):void 0}}function eq(t,{top:e,left:n,bottom:r,right:s}){return{x:ab(t.x,n,s),y:ab(t.y,e,r)}}function lb(t,e){let n=e.min-t.min,r=e.max-t.max;return e.max-e.minr?n=Yu(e.min,e.max-r,t.min):r>s&&(n=Yu(t.min,t.max-s,e.min)),ps(0,1,n)}function rq(t,e){const n={};return e.min!==void 0&&(n.min=e.min-t.min),e.max!==void 0&&(n.max=e.max-t.min),n}const Zy=.35;function sq(t=Zy){return t===!1?t=0:t===!0&&(t=Zy),{x:ub(t,"left","right"),y:ub(t,"top","bottom")}}function ub(t,e,n){return{min:cb(t,e),max:cb(t,n)}}function cb(t,e){return typeof t=="number"?t:t[e]||0}const iq=new WeakMap;class oq{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=ct(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:n=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const i=h=>{const{dragSnapToOrigin:f}=this.getProps();f?this.pauseAnimation():this.stopAnimation(),n&&this.snapToCursor(Dc(h).point)},o=(h,f)=>{const{drag:p,dragPropagation:g,onDragStart:w}=this.getProps();if(p&&!g&&(this.openDragLock&&this.openDragLock(),this.openDragLock=dH(p),!this.openDragLock))return;this.latestPointerEvent=h,this.latestPanInfo=f,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),Fn(v=>{let x=this.getAxisMotionValue(v).get()||0;if(Mr.test(x)){const{projection:T}=this.visualElement;if(T&&T.layout){const A=T.layout.layoutBox[v];A&&(x=on(A)*(parseFloat(x)/100))}}this.originPoint[v]=x}),w&&Qe.postRender(()=>w(h,f)),Xy(this.visualElement,"transform");const{animationState:_}=this.visualElement;_&&_.setActive("whileDrag",!0)},a=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f;const{dragPropagation:p,dragDirectionLock:g,onDirectionLock:w,onDrag:_}=this.getProps();if(!p&&!this.openDragLock)return;const{offset:v}=f;if(g&&this.currentDirection===null){this.currentDirection=aq(v),this.currentDirection!==null&&w&&w(this.currentDirection);return}this.updateAxis("x",f.point,v),this.updateAxis("y",f.point,v),this.visualElement.render(),_&&_(h,f)},l=(h,f)=>{this.latestPointerEvent=h,this.latestPanInfo=f,this.stop(h,f),this.latestPointerEvent=null,this.latestPanInfo=null},u=()=>Fn(h=>{var f;return this.getAnimationState(h)==="paused"&&((f=this.getAxisMotionValue(h).animation)==null?void 0:f.play())}),{dragSnapToOrigin:d}=this.getProps();this.panSession=new h2(e,{onSessionStart:i,onStart:o,onMove:a,onSessionEnd:l,resumeAnimation:u},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:d,distanceThreshold:r,contextWindow:d2(this.visualElement)})}stop(e,n){const r=e||this.latestPointerEvent,s=n||this.latestPanInfo,i=this.isDragging;if(this.cancel(),!i||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:a}=this.getProps();a&&Qe.postRender(()=>a(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:n}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.panSession&&this.panSession.end(),this.panSession=void 0;const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),n&&n.setActive("whileDrag",!1)}updateAxis(e,n,r){const{drag:s}=this.getProps();if(!r||!Rd(e,s,this.currentDirection))return;const i=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=ZW(o,this.constraints[e],this.elastic[e])),i.set(o)}resolveConstraints(){var i;const{dragConstraints:e,dragElastic:n}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(i=this.visualElement.projection)==null?void 0:i.layout,s=this.constraints;e&&ta(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=eq(r.layoutBox,e):this.constraints=!1,this.elastic=sq(n),s!==this.constraints&&r&&this.constraints&&!this.hasMutatedConstraints&&Fn(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=rq(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:n}=this.getProps();if(!e||!ta(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;const i=lW(r,s.root,this.visualElement.getTransformPagePoint());let o=tq(s.layout.layoutBox,i);if(n){const a=n(iW(o));this.hasMutatedConstraints=!!a,a&&(o=YN(a))}return o}startAnimation(e){const{drag:n,dragMomentum:r,dragElastic:s,dragTransition:i,dragSnapToOrigin:o,onDragTransitionEnd:a}=this.getProps(),l=this.constraints||{},u=Fn(d=>{if(!Rd(d,n,this.currentDirection))return;let h=l&&l[d]||{};o&&(h={min:0,max:0});const f=s?200:1e6,p=s?40:1e7,g={type:"inertia",velocity:r?e[d]:0,bounceStiffness:f,bounceDamping:p,timeConstant:750,restDelta:1,restSpeed:10,...i,...h};return this.startAxisValueAnimation(d,g)});return Promise.all(u).then(a)}startAxisValueAnimation(e,n){const r=this.getAxisMotionValue(e);return Xy(this.visualElement,e),r.start(Zw(e,r,0,n,this.visualElement,!1))}stopAnimation(){Fn(e=>this.getAxisMotionValue(e).stop())}pauseAnimation(){Fn(e=>{var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.pause()})}getAnimationState(e){var n;return(n=this.getAxisMotionValue(e).animation)==null?void 0:n.state}getAxisMotionValue(e){const n=`_drag${e.toUpperCase()}`,r=this.visualElement.getProps(),s=r[n];return s||this.visualElement.getValue(e,(r.initial?r.initial[e]:void 0)||0)}snapToCursor(e){Fn(n=>{const{drag:r}=this.getProps();if(!Rd(n,r,this.currentDirection))return;const{projection:s}=this.visualElement,i=this.getAxisMotionValue(n);if(s&&s.layout){const{min:o,max:a}=s.layout.layoutBox[n];i.set(e[n]-Je(o,a,.5))}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:n}=this.getProps(),{projection:r}=this.visualElement;if(!ta(n)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};Fn(o=>{const a=this.getAxisMotionValue(o);if(a&&this.constraints!==!1){const l=a.get();s[o]=nq({min:l,max:l},this.constraints[o])}});const{transformTemplate:i}=this.visualElement.getProps();this.visualElement.current.style.transform=i?i({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.resolveConstraints(),Fn(o=>{if(!Rd(o,e,null))return;const a=this.getAxisMotionValue(o),{min:l,max:u}=this.constraints[o];a.set(Je(l,u,s[o]))})}addListeners(){if(!this.visualElement.current)return;iq.set(this.visualElement,this);const e=this.visualElement.current,n=hu(e,"pointerdown",l=>{const{drag:u,dragListener:d=!0}=this.getProps();u&&d&&this.start(l)}),r=()=>{const{dragConstraints:l}=this.getProps();ta(l)&&l.current&&(this.constraints=this.resolveRefConstraints())},{projection:s}=this.visualElement,i=s.addEventListener("measure",r);s&&!s.layout&&(s.root&&s.root.updateScroll(),s.updateLayout()),Qe.read(r);const o=tc(window,"resize",()=>this.scalePositionWithinConstraints()),a=s.addEventListener("didUpdate",({delta:l,hasLayoutChanged:u})=>{this.isDragging&&u&&(Fn(d=>{const h=this.getAxisMotionValue(d);h&&(this.originPoint[d]+=l[d].translate,h.set(h.get()+l[d].translate))}),this.visualElement.render())});return()=>{o(),n(),i(),a&&a()}}getProps(){const e=this.visualElement.getProps(),{drag:n=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:i=!1,dragElastic:o=Zy,dragMomentum:a=!0}=e;return{...e,drag:n,dragDirectionLock:r,dragPropagation:s,dragConstraints:i,dragElastic:o,dragMomentum:a}}}function Rd(t,e,n){return(e===!0||e===t)&&(n===null||n===t)}function aq(t,e=10){let n=null;return Math.abs(t.y)>e?n="y":Math.abs(t.x)>e&&(n="x"),n}class lq extends Di{constructor(e){super(e),this.removeGroupControls=Kn,this.removeListeners=Kn,this.controls=new oq(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||Kn}unmount(){this.removeGroupControls(),this.removeListeners()}}const db=t=>(e,n)=>{t&&Qe.postRender(()=>t(e,n))};class uq extends Di{constructor(){super(...arguments),this.removePointerDownListener=Kn}onPointerDown(e){this.session=new h2(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:d2(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:n,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:db(e),onStart:db(n),onMove:r,onEnd:(i,o)=>{delete this.session,s&&Qe.postRender(()=>s(i,o))}}}mount(){this.removePointerDownListener=hu(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 lh={hasAnimatedSinceResize:!0,hasEverUpdated:!1};function hb(t,e){return e.max===e.min?0:t/(e.max-e.min)*100}const Dl={correct:(t,e)=>{if(!e.target)return t;if(typeof t=="string")if(le.test(t))t=parseFloat(t);else return t;const n=hb(t,e.target.x),r=hb(t,e.target.y);return`${n}% ${r}%`}},cq={correct:(t,{treeScale:e,projectionDelta:n})=>{const r=t,s=Ci.parse(t);if(s.length>5)return r;const i=Ci.createTransformer(t),o=typeof s[0]!="number"?1:0,a=n.x.scale*e.x,l=n.y.scale*e.y;s[0+o]/=a,s[1+o]/=l;const u=Je(a,l,.5);return typeof s[2+o]=="number"&&(s[2+o]/=u),typeof s[3+o]=="number"&&(s[3+o]/=u),i(s)}};let zm=!1;class dq extends b.Component{componentDidMount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r,layoutId:s}=this.props,{projection:i}=e;DH(hq),i&&(n.group&&n.group.add(i),r&&r.register&&s&&r.register(i),zm&&i.root.didUpdate(),i.addEventListener("animationComplete",()=>{this.safeToRemove()}),i.setOptions({...i.options,onExitComplete:()=>this.safeToRemove()})),lh.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:n,visualElement:r,drag:s,isPresent:i}=this.props,{projection:o}=r;return o&&(o.isPresent=i,zm=!0,s||e.layoutDependency!==n||n===void 0||e.isPresent!==i?o.willUpdate():this.safeToRemove(),e.isPresent!==i&&(i?o.promote():o.relegate()||Qe.postRender(()=>{const a=o.getStack();(!a||!a.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{projection:e}=this.props.visualElement;e&&(e.root.didUpdate(),Bw.postRender(()=>{!e.currentAnimation&&e.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:n,switchLayoutGroup:r}=this.props,{projection:s}=e;zm=!0,s&&(s.scheduleCheckAfterUnmount(),n&&n.group&&n.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function p2(t){const[e,n]=MN(),r=b.useContext(xw);return y.jsx(dq,{...t,layoutGroup:r,switchLayoutGroup:b.useContext(GN),isPresent:e,safeToRemove:n})}const hq={borderRadius:{...Dl,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:Dl,borderTopRightRadius:Dl,borderBottomLeftRadius:Dl,borderBottomRightRadius:Dl,boxShadow:cq};function fq(t,e,n){const r=Xt(t)?t:Wa(t);return r.start(Zw("",r,e,n)),r.animation}const pq=(t,e)=>t.depth-e.depth;class mq{constructor(){this.children=[],this.isDirty=!1}add(e){Tw(this.children,e),this.isDirty=!0}remove(e){bw(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(pq),this.isDirty=!1,this.children.forEach(e)}}function gq(t,e){const n=gn.now(),r=({timestamp:s})=>{const i=s-n;i>=e&&(Si(r),t(i-e))};return Qe.setup(r,!0),()=>Si(r)}const m2=["TopLeft","TopRight","BottomLeft","BottomRight"],yq=m2.length,fb=t=>typeof t=="string"?parseFloat(t):t,pb=t=>typeof t=="number"||le.test(t);function vq(t,e,n,r,s,i){s?(t.opacity=Je(0,n.opacity??1,wq(r)),t.opacityExit=Je(e.opacity??1,0,xq(r))):i&&(t.opacity=Je(e.opacity??1,n.opacity??1,r));for(let o=0;ore?1:n(Yu(t,e,r))}function gb(t,e){t.min=e.min,t.max=e.max}function jn(t,e){gb(t.x,e.x),gb(t.y,e.y)}function yb(t,e){t.translate=e.translate,t.scale=e.scale,t.originPoint=e.originPoint,t.origin=e.origin}function vb(t,e,n,r,s){return t-=e,t=ff(t,1/n,r),s!==void 0&&(t=ff(t,1/s,r)),t}function _q(t,e=0,n=1,r=.5,s,i=t,o=t){if(Mr.test(e)&&(e=parseFloat(e),e=Je(o.min,o.max,e/100)-o.min),typeof e!="number")return;let a=Je(i.min,i.max,r);t===i&&(a-=e),t.min=vb(t.min,e,n,a,s),t.max=vb(t.max,e,n,a,s)}function wb(t,e,[n,r,s],i,o){_q(t,e[n],e[r],e[s],e.scale,i,o)}const Eq=["x","scaleX","originX"],Tq=["y","scaleY","originY"];function xb(t,e,n,r){wb(t.x,e,Eq,n?n.x:void 0,r?r.x:void 0),wb(t.y,e,Tq,n?n.y:void 0,r?r.y:void 0)}function _b(t){return t.translate===0&&t.scale===1}function y2(t){return _b(t.x)&&_b(t.y)}function Eb(t,e){return t.min===e.min&&t.max===e.max}function bq(t,e){return Eb(t.x,e.x)&&Eb(t.y,e.y)}function Tb(t,e){return Math.round(t.min)===Math.round(e.min)&&Math.round(t.max)===Math.round(e.max)}function v2(t,e){return Tb(t.x,e.x)&&Tb(t.y,e.y)}function bb(t){return on(t.x)/on(t.y)}function Sb(t,e){return t.translate===e.translate&&t.scale===e.scale&&t.originPoint===e.originPoint}class Sq{constructor(){this.members=[]}add(e){Tw(this.members,e),e.scheduleRender()}remove(e){if(bw(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const n=this.members[this.members.length-1];n&&this.promote(n)}}relegate(e){const n=this.members.findIndex(s=>e===s);if(n===0)return!1;let r;for(let s=n;s>=0;s--){const i=this.members[s];if(i.isPresent!==!1){r=i;break}}return r?(this.promote(r),!0):!1}promote(e,n){const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.instance&&r.scheduleRender(),e.scheduleRender(),e.resumeFrom=r,n&&(e.resumeFrom.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),e.root&&e.root.isUpdating&&(e.isLayoutDirty=!0);const{crossfade:s}=e.options;s===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{const{options:n,resumingFrom:r}=e;n.onExitComplete&&n.onExitComplete(),r&&r.options.onExitComplete&&r.options.onExitComplete()})}scheduleRender(){this.members.forEach(e=>{e.instance&&e.scheduleRender(!1)})}removeLeadSnapshot(){this.lead&&this.lead.snapshot&&(this.lead.snapshot=void 0)}}function Cq(t,e,n){let r="";const s=t.x.translate/e.x,i=t.y.translate/e.y,o=(n==null?void 0:n.z)||0;if((s||i||o)&&(r=`translate3d(${s}px, ${i}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),n){const{transformPerspective:u,rotate:d,rotateX:h,rotateY:f,skewX:p,skewY:g}=n;u&&(r=`perspective(${u}px) ${r}`),d&&(r+=`rotate(${d}deg) `),h&&(r+=`rotateX(${h}deg) `),f&&(r+=`rotateY(${f}deg) `),p&&(r+=`skewX(${p}deg) `),g&&(r+=`skewY(${g}deg) `)}const a=t.x.scale*e.x,l=t.y.scale*e.y;return(a!==1||l!==1)&&(r+=`scale(${a}, ${l})`),r||"none"}const Hm=["","X","Y","Z"],Iq=1e3;let Pq=0;function Wm(t,e,n,r){const{latestValues:s}=e;s[t]&&(n[t]=s[t],e.setStaticValue(t,0),r&&(r[t]=0))}function w2(t){if(t.hasCheckedOptimisedAppear=!0,t.root===t)return;const{visualElement:e}=t.options;if(!e)return;const n=s2(e);if(window.MotionHasOptimisedAnimation(n,"transform")){const{layout:s,layoutId:i}=t.options;window.MotionCancelOptimisedAnimation(n,"transform",Qe,!(s||i))}const{parent:r}=t;r&&!r.hasCheckedOptimisedAppear&&w2(r)}function x2({attachResizeListener:t,defaultParent:e,measureScroll:n,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},a=e==null?void 0:e()){this.id=Pq++,this.animationId=0,this.animationCommitId=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,this.nodes.forEach(kq),this.nodes.forEach(Lq),this.nodes.forEach(Mq),this.nodes.forEach(Nq)},this.resolvedRelativeTargetAt=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=a?a.root||a:this,this.path=a?[...a.path,a]:[],this.parent=a,this.depth=a?a.depth+1:0;for(let l=0;lthis.root.updateBlockedByResize=!1;Qe.read(()=>{h=window.innerWidth}),t(o,()=>{const p=window.innerWidth;p!==h&&(h=p,this.root.updateBlockedByResize=!0,d&&d(),d=gq(f,250),lh.hasAnimatedSinceResize&&(lh.hasAnimatedSinceResize=!1,this.nodes.forEach(Pb)))})}a&&this.root.registerSharedNode(a,this),this.options.animate!==!1&&u&&(a||l)&&this.addEventListener("didUpdate",({delta:d,hasLayoutChanged:h,hasRelativeLayoutChanged:f,layout:p})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const g=this.options.transition||u.getDefaultTransition()||$q,{onLayoutAnimationStart:w,onLayoutAnimationComplete:_}=u.getProps(),v=!this.targetLayout||!v2(this.targetLayout,p),x=!h&&f;if(this.options.layoutRoot||this.resumeFrom||x||h&&(v||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...Uw(g,"layout"),onPlay:w,onComplete:_};(u.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(d,x)}else h||Pb(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=p})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Si(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(Vq),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&w2(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let d=0;d{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!on(this.snapshot.measuredBox.x)&&!on(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 l=0;l{const k=A/1e3;Ab(h.x,o.x,k),Ab(h.y,o.y,k),this.setTargetDelta(h),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(pu(f,this.layout.layoutBox,this.relativeParent.layout.layoutBox),Fq(this.relativeTarget,this.relativeTargetOrigin,f,k),T&&bq(this.relativeTarget,T)&&(this.isProjectionDirty=!1),T||(T=ct()),jn(T,this.relativeTarget)),w&&(this.animationValues=d,vq(d,u,this.latestValues,k,x,v)),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=k},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var a,l,u;this.notifyListeners("animationStart"),(a=this.currentAnimation)==null||a.stop(),(u=(l=this.resumingFrom)==null?void 0:l.currentAnimation)==null||u.stop(),this.pendingAnimation&&(Si(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=Qe.update(()=>{lh.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=Wa(0)),this.currentAnimation=fq(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:d=>{this.mixTargetDelta(d),o.onUpdate&&o.onUpdate(d)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.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 o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(Iq),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:a,target:l,layout:u,latestValues:d}=o;if(!(!a||!l||!u)){if(this!==o&&this.layout&&u&&_2(this.options.animationType,this.layout.layoutBox,u.layoutBox)){l=this.target||ct();const h=on(this.layout.layoutBox.x);l.x.min=o.target.x.min,l.x.max=l.x.min+h;const f=on(this.layout.layoutBox.y);l.y.min=o.target.y.min,l.y.max=l.y.min+f}jn(a,l),ra(a,d),fu(this.projectionDeltaWithTransform,this.layoutCorrected,a,d)}}registerSharedNode(o,a){this.sharedNodes.has(o)||this.sharedNodes.set(o,new Sq),this.sharedNodes.get(o).add(a);const u=a.options.initialPromotionConfig;a.promote({transition:u?u.transition:void 0,preserveFollowOpacity:u&&u.shouldPreserveFollowOpacity?u.shouldPreserveFollowOpacity(a):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var a;const{layoutId:o}=this.options;return o?((a=this.getStack())==null?void 0:a.lead)||this:this}getPrevLead(){var a;const{layoutId:o}=this.options;return o?(a=this.getStack())==null?void 0:a.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:a,preserveFollowOpacity:l}={}){const u=this.getStack();u&&u.promote(this,l),o&&(this.projectionDelta=void 0,this.needsReset=!0),a&&this.setOptions({transition:a})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let a=!1;const{latestValues:l}=o;if((l.z||l.rotate||l.rotateX||l.rotateY||l.rotateZ||l.skewX||l.skewY)&&(a=!0),!a)return;const u={};l.z&&Wm("z",o,u,this.animationValues);for(let d=0;d{var a;return(a=o.currentAnimation)==null?void 0:a.stop()}),this.root.nodes.forEach(Cb),this.root.sharedNodes.clear()}}}function Aq(t){t.updateLayout()}function Rq(t){var n;const e=((n=t.resumeFrom)==null?void 0:n.snapshot)||t.snapshot;if(t.isLead()&&t.layout&&e&&t.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=t.layout,{animationType:i}=t.options,o=e.source!==t.layout.source;i==="size"?Fn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=on(f);f.min=r[h].min,f.max=f.min+p}):_2(i,e.layoutBox,r)&&Fn(h=>{const f=o?e.measuredBox[h]:e.layoutBox[h],p=on(r[h]);f.max=f.min+p,t.relativeTarget&&!t.currentAnimation&&(t.isProjectionDirty=!0,t.relativeTarget[h].max=t.relativeTarget[h].min+p)});const a=sa();fu(a,r,e.layoutBox);const l=sa();o?fu(l,t.applyTransform(s,!0),e.measuredBox):fu(l,r,e.layoutBox);const u=!y2(a);let d=!1;if(!t.resumeFrom){const h=t.getClosestProjectingParent();if(h&&!h.resumeFrom){const{snapshot:f,layout:p}=h;if(f&&p){const g=ct();pu(g,e.layoutBox,f.layoutBox);const w=ct();pu(w,r,p.layoutBox),v2(g,w)||(d=!0),h.options.layoutRoot&&(t.relativeTarget=w,t.relativeTargetOrigin=g,t.relativeParent=h)}}}t.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:l,layoutDelta:a,hasLayoutChanged:u,hasRelativeLayoutChanged:d})}else if(t.isLead()){const{onExitComplete:r}=t.options;r&&r()}t.options.transition=void 0}function kq(t){t.parent&&(t.isProjecting()||(t.isProjectionDirty=t.parent.isProjectionDirty),t.isSharedProjectionDirty||(t.isSharedProjectionDirty=!!(t.isProjectionDirty||t.parent.isProjectionDirty||t.parent.isSharedProjectionDirty)),t.isTransformDirty||(t.isTransformDirty=t.parent.isTransformDirty))}function Nq(t){t.isProjectionDirty=t.isSharedProjectionDirty=t.isTransformDirty=!1}function Dq(t){t.clearSnapshot()}function Cb(t){t.clearMeasurements()}function Ib(t){t.isLayoutDirty=!1}function Oq(t){const{visualElement:e}=t.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),t.resetTransform()}function Pb(t){t.finishAnimation(),t.targetDelta=t.relativeTarget=t.target=void 0,t.isProjectionDirty=!0}function Lq(t){t.resolveTargetDelta()}function Mq(t){t.calcProjection()}function Vq(t){t.resetSkewAndRotation()}function jq(t){t.removeLeadSnapshot()}function Ab(t,e,n){t.translate=Je(e.translate,0,n),t.scale=Je(e.scale,1,n),t.origin=e.origin,t.originPoint=e.originPoint}function Rb(t,e,n,r){t.min=Je(e.min,n.min,r),t.max=Je(e.max,n.max,r)}function Fq(t,e,n,r){Rb(t.x,e.x,n.x,r),Rb(t.y,e.y,n.y,r)}function Uq(t){return t.animationValues&&t.animationValues.opacityExit!==void 0}const $q={duration:.45,ease:[.4,0,.1,1]},kb=t=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(t),Nb=kb("applewebkit/")&&!kb("chrome/")?Math.round:Kn;function Db(t){t.min=Nb(t.min),t.max=Nb(t.max)}function Bq(t){Db(t.x),Db(t.y)}function _2(t,e,n){return t==="position"||t==="preserve-aspect"&&!GW(bb(e),bb(n),.2)}function zq(t){var e;return t!==t.root&&((e=t.scroll)==null?void 0:e.wasRoot)}const Hq=x2({attachResizeListener:(t,e)=>tc(t,"resize",e),measureScroll:()=>({x:document.documentElement.scrollLeft||document.body.scrollLeft,y:document.documentElement.scrollTop||document.body.scrollTop}),checkIsScrollRoot:()=>!0}),qm={current:void 0},E2=x2({measureScroll:t=>({x:t.scrollLeft,y:t.scrollTop}),defaultParent:()=>{if(!qm.current){const t=new Hq({});t.mount(window),t.setOptions({layoutScroll:!0}),qm.current=t}return qm.current},resetTransform:(t,e)=>{t.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:t=>window.getComputedStyle(t).position==="fixed"}),Wq={pan:{Feature:uq},drag:{Feature:lq,ProjectionNode:E2,MeasureLayout:p2}};function Ob(t,e,n){const{props:r}=t;t.animationState&&r.whileHover&&t.animationState.setActive("whileHover",n==="Start");const s="onHover"+n,i=r[s];i&&Qe.postRender(()=>i(e,Dc(e)))}class qq extends Di{mount(){const{current:e}=this.node;e&&(this.unmount=hH(e,(n,r)=>(Ob(this.node,r,"Start"),s=>Ob(this.node,s,"End"))))}unmount(){}}class Kq extends Di{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=Rc(tc(this.node.current,"focus",()=>this.onFocus()),tc(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function Lb(t,e,n){const{props:r}=t;if(t.current instanceof HTMLButtonElement&&t.current.disabled)return;t.animationState&&r.whileTap&&t.animationState.setActive("whileTap",n==="Start");const s="onTap"+(n==="End"?"":n),i=r[s];i&&Qe.postRender(()=>i(e,Dc(e)))}class Gq extends Di{mount(){const{current:e}=this.node;e&&(this.unmount=gH(e,(n,r)=>(Lb(this.node,r,"Start"),(s,{success:i})=>Lb(this.node,s,i?"End":"Cancel")),{useGlobalTarget:this.node.props.globalTapTarget}))}unmount(){}}const ev=new WeakMap,Km=new WeakMap,Qq=t=>{const e=ev.get(t.target);e&&e(t)},Yq=t=>{t.forEach(Qq)};function Xq({root:t,...e}){const n=t||document;Km.has(n)||Km.set(n,{});const r=Km.get(n),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Yq,{root:t,...e})),r[s]}function Jq(t,e,n){const r=Xq(e);return ev.set(t,n),r.observe(t),()=>{ev.delete(t),r.unobserve(t)}}const Zq={some:0,all:1};class eK extends Di{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){this.unmount();const{viewport:e={}}=this.node.getProps(),{root:n,margin:r,amount:s="some",once:i}=e,o={root:n?n.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Zq[s]},a=l=>{const{isIntersecting:u}=l;if(this.isInView===u||(this.isInView=u,i&&!u&&this.hasEnteredView))return;u&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",u);const{onViewportEnter:d,onViewportLeave:h}=this.node.getProps(),f=u?d:h;f&&f(l)};return Jq(this.node.current,o,a)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:n}=this.node;["amount","margin","root"].some(tK(e,n))&&this.startObserver()}unmount(){}}function tK({viewport:t={}},{viewport:e={}}={}){return n=>t[n]!==e[n]}const nK={inView:{Feature:eK},tap:{Feature:Gq},focus:{Feature:Kq},hover:{Feature:qq}},rK={layout:{ProjectionNode:E2,MeasureLayout:p2}},sK={...BW,...nK,...Wq,...rK},iK=sW(sK,yW),oK=({slide:t})=>{const e=t.type==="video",n=t.buttonLink.includes("#"),r=()=>{const s=new URLSearchParams({autoplay:"1",mute:"1",controls:"0",rel:"0",modestbranding:"1",playsinline:"1"});return t.startTime!==void 0&&s.set("start",t.startTime.toString()),t.endTime!==void 0&&s.set("end",t.endTime.toString()),`${t.src}?${s.toString()}`};return y.jsxs("div",{className:"absolute inset-0 transition-transform duration-700 ease-in-out",children:[e?y.jsx("div",{className:"absolute inset-0 w-full h-full overflow-hidden bg-black",children:y.jsx("iframe",{src:r(),title:t.title,className:"absolute top-1/2 left-1/2 min-w-full min-h-full w-auto h-auto -translate-x-1/2 -translate-y-1/2 pointer-events-none",style:{width:"177.78vh",height:"100vh",minWidth:"100vw",minHeight:"56.25vw"},allow:"autoplay; encrypted-media",allowFullScreen:!0})}):y.jsx("div",{className:"absolute inset-0",children:y.jsx("img",{src:t.src,alt:t.title,className:"absolute inset-0 w-full h-full object-cover"})}),y.jsx("div",{className:"absolute inset-0 bg-black/50"}),y.jsx("div",{className:"relative z-10 container mx-auto px-8 h-full flex items-center",children:y.jsxs("div",{className:"max-w-3xl text-white",children:[y.jsx("h1",{className:"text-6xl lg:text-7xl font-bold mb-6",children:t.title}),y.jsx("h2",{className:"text-2xl mb-8 text-white/90",children:t.subtitle}),y.jsx("p",{className:"text-xl mb-12 text-white/80",children:t.description}),n?y.jsx("a",{href:t.buttonLink,children:y.jsx(xt,{size:"lg",className:"bg-primary hover:bg-primary-dark text-white px-10 py-4 text-xl font-semibold rounded-full transition-all hover:scale-105 shadow-lg",children:t.buttonText})}):y.jsx(vi,{to:t.buttonLink,children:y.jsx(xt,{size:"lg",className:"bg-primary hover:bg-primary-dark text-white px-10 py-4 text-xl font-semibold rounded-full transition-all hover:scale-105 shadow-lg",children:t.buttonText})})]})})]})},aK=()=>{const t=T8(),[e,n]=b.useState(0),[r,s]=b.useState("right"),i=t[e],o=b.useCallback(()=>{s("right"),n(l=>(l+1)%t.length)},[t.length]),a=b.useCallback(()=>{s("left"),n(l=>(l-1+t.length)%t.length)},[t.length]);return b.useEffect(()=>{if(!t.length)return;let l=8e3;if((i==null?void 0:i.type)==="video"){const d=i.startTime??0;l=((i.endTime??8)-d)*1e3}const u=setTimeout(()=>{o()},l);return()=>clearTimeout(u)},[e,t.length,i==null?void 0:i.type,i==null?void 0:i.startTime,i==null?void 0:i.endTime,o]),!t||t.length===0||!i?null:y.jsxs("div",{className:"relative h-screen overflow-hidden bg-black",children:[y.jsx(CH,{custom:r,children:y.jsx(iK.div,{custom:r,variants:{enter:l=>({x:l==="right"?"100%":"-100%",opacity:0}),center:{x:0,opacity:1},exit:l=>({x:l==="right"?"-30%":"30%",opacity:0})},initial:"enter",animate:"center",exit:"exit",transition:{x:{type:"spring",stiffness:60,damping:20},opacity:{duration:.5}},className:"absolute inset-0",children:y.jsx(oK,{slide:i})},i.id)}),y.jsx("button",{onClick:a,className:"absolute left-6 top-1/2 -translate-y-1/2 z-20 text-white",children:y.jsx(fV,{size:48})}),y.jsx("button",{onClick:o,className:"absolute right-6 top-1/2 -translate-y-1/2 z-20 text-white",children:y.jsx(pV,{size:48})}),y.jsx("div",{className:"absolute bottom-12 left-1/2 -translate-x-1/2 z-20 flex space-x-4",children:t.map((l,u)=>y.jsx("button",{onClick:()=>{s(u>e?"right":"left"),n(u)},className:`w-4 h-4 rounded-full ${u===e?"bg-white scale-125":"bg-white/40"}`},u))})]})},pf=b.forwardRef(({className:t,type:e,...n},r)=>y.jsx("input",{type:e,className:Ye("flex h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-base ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",t),ref:r,...n}));pf.displayName="Input";var T2={color:void 0,size:void 0,className:void 0,style:void 0,attr:void 0},Mb=q.createContext&&q.createContext(T2),lK=["attr","size","title"];function uK(t,e){if(t==null)return{};var n=cK(t,e),r,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function cK(t,e){if(t==null)return{};var n={};for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(e.indexOf(r)>=0)continue;n[r]=t[r]}return n}function mf(){return mf=Object.assign?Object.assign.bind():function(t){for(var e=1;eq.createElement(e.tag,gf({key:n},e.attr),b2(e.child)))}function Tp(t){return e=>q.createElement(pK,mf({attr:gf({},t.attr)},e),b2(t.child))}function pK(t){var e=n=>{var{attr:r,size:s,title:i}=t,o=uK(t,lK),a=s||n.size||"1em",l;return n.className&&(l=n.className),t.className&&(l=(l?l+" ":"")+t.className),q.createElement("svg",mf({stroke:"currentColor",fill:"currentColor",strokeWidth:"0"},n.attr,r,o,{className:l,style:gf(gf({color:t.color||n.color},n.style),t.style),height:a,width:a,xmlns:"http://www.w3.org/2000/svg"}),i&&q.createElement("title",null,i),t.children)};return Mb!==void 0?q.createElement(Mb.Consumer,null,n=>e(n)):e(T2)}function mK(t){return Tp({attr:{viewBox:"0 0 320 512"},child:[{tag:"path",attr:{d:"M80 299.3V512H196V299.3h86.5l18-97.8H196V166.9c0-51.7 20.3-71.5 72.7-71.5c16.3 0 29.4 .4 37 1.2V7.9C291.4 4 256.4 0 236.2 0C129.3 0 80 50.5 80 159.4v42.1H14v97.8H80z"},child:[]}]})(t)}function gK(t){return Tp({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M224.1 141c-63.6 0-114.9 51.3-114.9 114.9s51.3 114.9 114.9 114.9S339 319.5 339 255.9 287.7 141 224.1 141zm0 189.6c-41.1 0-74.7-33.5-74.7-74.7s33.5-74.7 74.7-74.7 74.7 33.5 74.7 74.7-33.6 74.7-74.7 74.7zm146.4-194.3c0 14.9-12 26.8-26.8 26.8-14.9 0-26.8-12-26.8-26.8s12-26.8 26.8-26.8 26.8 12 26.8 26.8zm76.1 27.2c-1.7-35.9-9.9-67.7-36.2-93.9-26.2-26.2-58-34.4-93.9-36.2-37-2.1-147.9-2.1-184.9 0-35.8 1.7-67.6 9.9-93.9 36.1s-34.4 58-36.2 93.9c-2.1 37-2.1 147.9 0 184.9 1.7 35.9 9.9 67.7 36.2 93.9s58 34.4 93.9 36.2c37 2.1 147.9 2.1 184.9 0 35.9-1.7 67.7-9.9 93.9-36.2 26.2-26.2 34.4-58 36.2-93.9 2.1-37 2.1-147.8 0-184.8zM398.8 388c-7.8 19.6-22.9 34.7-42.6 42.6-29.5 11.7-99.5 9-132.1 9s-102.7 2.6-132.1-9c-19.6-7.8-34.7-22.9-42.6-42.6-11.7-29.5-9-99.5-9-132.1s-2.6-102.7 9-132.1c7.8-19.6 22.9-34.7 42.6-42.6 29.5-11.7 99.5-9 132.1-9s102.7-2.6 132.1 9c19.6 7.8 34.7 22.9 42.6 42.6 11.7 29.5 9 99.5 9 132.1s2.7 102.7-9 132.1z"},child:[]}]})(t)}function yK(t){return Tp({attr:{viewBox:"0 0 448 512"},child:[{tag:"path",attr:{d:"M100.28 448H7.4V148.9h92.88zM53.79 108.1C24.09 108.1 0 83.5 0 53.8a53.79 53.79 0 0 1 107.58 0c0 29.7-24.1 54.3-53.79 54.3zM447.9 448h-92.68V302.4c0-34.7-.7-79.2-48.29-79.2-48.29 0-55.69 37.7-55.69 76.7V448h-92.78V148.9h89.08v40.8h1.3c12.4-23.5 42.69-48.3 87.88-48.3 94 0 111.28 61.9 111.28 142.3V448z"},child:[]}]})(t)}function vK(t){return Tp({attr:{viewBox:"0 0 512 512"},child:[{tag:"path",attr:{d:"M389.2 48h70.6L305.6 224.2 487 464H345L233.7 318.6 106.5 464H35.8L200.7 275.5 26.8 48H172.4L272.9 180.9 389.2 48zM364.4 421.8h39.1L151.1 88h-42L364.4 421.8z"},child:[]}]})(t)}const wK=()=>{const t={Formation:["Programmes","Pathways","Certification","Mentorat"],Ressources:["Blog","Documentation","Webinaires","Guides"],Communauté:["Forum","Événements","Discord","LinkedIn"],Support:["Centre d'aide","Contact","FAQ","Status"]},e=[{name:"Facebook",icon:y.jsx(mK,{}),url:"#"},{name:"Instagram",icon:y.jsx(gK,{}),url:"#"},{name:"X (Twitter)",icon:y.jsx(vK,{}),url:"#"},{name:"LinkedIn",icon:y.jsx(yK,{}),url:"#"}];return y.jsx("footer",{className:"bg-gray-900 text-white",children:y.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[y.jsx("div",{className:"py-16",children:y.jsxs("div",{className:"grid lg:grid-cols-6 gap-8",children:[y.jsxs("div",{className:"lg:col-span-2",children:[y.jsx("div",{className:"text-2xl font-bold text-gradient mb-4",children:"L'école de destinée"}),y.jsx("p",{className:"text-gray-300 mb-6 max-w-md",children:"Transformez votre carrière avec nos formations de qualité supérieure. Rejoignez une communauté d'apprenants passionnés et d'experts de l'industrie."}),y.jsxs("div",{className:"space-y-4",children:[y.jsx("h4",{className:"font-semibold",children:"Restez informé"}),y.jsxs("div",{className:"flex gap-2",children:[y.jsx(pf,{type:"email",placeholder:"Votre email",className:"bg-gray-800 border-gray-700 text-white"}),y.jsx(xt,{className:"gradient-sky text-white",children:"S'abonner"})]})]})]}),Object.entries(t).map(([n,r])=>y.jsxs("div",{children:[y.jsx("h4",{className:"font-semibold mb-4",children:n}),y.jsx("ul",{className:"space-y-2",children:r.map(s=>y.jsx("li",{children:y.jsx("a",{href:"#",className:"text-gray-300 hover:text-white transition-colors",children:s})},s))})]},n))]})}),y.jsx("div",{className:"border-t border-gray-800 py-8",children:y.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-center",children:[y.jsxs("div",{className:"flex items-center space-x-6 mb-4 md:mb-0",children:[y.jsx("span",{className:"text-gray-300",children:"Suivez-nous:"}),e.map(n=>y.jsx("a",{href:n.url,className:"text-2xl hover:scale-110 transition-transform duration-300",title:n.name,children:n.icon},n.name))]}),y.jsxs("div",{className:"flex flex-col md:flex-row items-center space-y-2 md:space-y-0 md:space-x-6 text-gray-300 text-sm",children:[y.jsx("span",{children:"© 2024 L'école de destinée. Tous droits réservés."}),y.jsxs("div",{className:"flex space-x-4",children:[y.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Politique de confidentialité"}),y.jsx("a",{href:"#",className:"hover:text-white transition-colors",children:"Conditions d'utilisation"})]})]})]})})]})})},xK=[{title:"Parcours Complet",desc:"Suivez le parcours complet en 3 niveaux pour entrer progressivement dans votre destinée.",href:"/pathways/complet",img:"https://www.trulydivine.com/wp-content/uploads/2024/12/Life-path-11-spiritual-meaning.jpg",accent:"from-[hsl(var(--primary))]/80 to-[hsl(var(--primary-dark))]/80",cta:"Explorer le parcours complet"},{title:"Parcours personnalisé",desc:"Composez votre chemin à la carte en sélectionnant les modules selon vos besoins.",href:"/pathways/alacarte",img:"https://images.unsplash.com/photo-1521737604893-d14cc237f11d?w=1200&q=70&auto=format&fit=crop",accent:"from-emerald-500/80 to-teal-600/80",cta:"Découvrir l'à‑la‑carte"},{title:"Parcours Personnalisé",desc:"Bénéficiez de la flexibilité du parcours à la carte enrichie par un accompagnement coaching sur mesure pour atteindre vos objectifs plus vite.",href:"/pathways/personnalise",img:"https://www.trulydivine.com/wp-content/uploads/2024/12/Life-path-11-spiritual-meaning.jpg",accent:"from-orange-500 to-red-600",cta:"Découvrir le parcours personnalisé"}],_K=()=>y.jsx("section",{id:"pathways-overview",className:"py-16 md:py-20 bg-gradient-to-b from-[hsl(var(--primary-dark))] via-[#0e2749] to-[#0b1b2e] text-white",children:y.jsxs("div",{className:"container mx-auto px-4",children:[y.jsx("h1",{className:"text-center text-4xl md:text-5xl font-bold mb-10",children:"Choisissez votre chemin vers la réussite"}),y.jsx("div",{className:"grid md:grid-cols-3 gap-6 lg:gap-8",children:xK.map(t=>y.jsxs("div",{className:"rounded-xl overflow-hidden bg-white/5 border border-white/10",children:[y.jsxs("div",{className:"relative",children:[y.jsx("img",{src:t.img,alt:t.title,className:"w-full h-40 md:h-48 object-cover"}),y.jsx("div",{className:`absolute inset-0 bg-gradient-to-tr ${t.accent} mix-blend-multiply`})]}),y.jsxs("div",{className:"p-5 md:p-6",children:[y.jsx("h3",{className:"text-lg md:text-xl font-semibold mb-2",children:t.title}),y.jsx("p",{className:"text-sm md:text-base text-white/80 mb-5",children:t.desc}),y.jsx("a",{href:t.href,children:y.jsx(xt,{size:"sm",className:"bg-primary hover:bg-primary-dark text-white px-10 py-4 text-xl font-semibold rounded-full transition-all hover:scale-105 shadow-lg",children:t.cta})})]})]},t.title))}),y.jsx("div",{className:"text-center mt-10 md:mt-14",children:y.jsx("a",{href:"/pathways/complet",children:y.jsx(xt,{variant:"ghost",size:"lg",className:"border-2 border-primary text-primary bg-transparent hover:bg-primary hover:text-white transition-all duration-300 rounded-full px-8 py-3 text-base",children:"Voir le Parcours complet →"})})})]})}),EK=()=>y.jsx("section",{className:"py-16",children:y.jsx("div",{className:"container mx-auto px-4",children:y.jsx("div",{className:"rounded-2xl overflow-hidden bg-gradient-to-r from-slate-900 via-slate-800 to-slate-900 text-white",children:y.jsxs("div",{className:"p-6 md:p-10 lg:p-12",children:[y.jsx("h2",{className:"text-3xl md:text-4xl font-bold mb-4",children:"Communauté"}),y.jsxs("div",{className:"grid gap-4 text-white/85 max-w-4xl",children:[y.jsx("p",{children:"Venez découvrir les expériences et discussions des leaders au travers de la communauté LDN. L’école de destinée “Leaders Des Nations” est aussi une famille où chaque leader partage ses expériences et témoignages."}),y.jsx("p",{children:"En entrant à LDN, vous découvrez également la destinée de vos frères et sœurs. C’est l’espace de partage des expériences personnelles et la synergie des destinées individuelles."}),y.jsx("p",{children:"LDN encourage les leaders à partager leur vision de vie et de fusionner avec ceux qui courent dans le même champ afin d’apprendre et de partager les spécificités."}),y.jsx("p",{children:"La communauté LDN c’est aussi l’expérience des leaders dans des temps de retraite, des moments de jeux, de prière et d’enseignement ensemble."})]}),y.jsx("div",{className:"mt-8 flex flex-col sm:flex-row items-start sm:items-center gap-3",children:y.jsx(vi,{to:"/community",className:"text-white/80 hover:text-white underline underline-offset-4",children:"Accéder à la page Communauté →"})})]})})})});function TK(t){return Object.prototype.toString.call(t)==="[object Object]"}function jb(t){return TK(t)||Array.isArray(t)}function bK(){return!!(typeof window<"u"&&window.document&&window.document.createElement)}function ex(t,e){const n=Object.keys(t),r=Object.keys(e);if(n.length!==r.length)return!1;const s=JSON.stringify(Object.keys(t.breakpoints||{})),i=JSON.stringify(Object.keys(e.breakpoints||{}));return s!==i?!1:n.every(o=>{const a=t[o],l=e[o];return typeof a=="function"?`${a}`==`${l}`:!jb(a)||!jb(l)?a===l:ex(a,l)})}function Fb(t){return t.concat().sort((e,n)=>e.name>n.name?1:-1).map(e=>e.options)}function SK(t,e){if(t.length!==e.length)return!1;const n=Fb(t),r=Fb(e);return n.every((s,i)=>{const o=r[i];return ex(s,o)})}function tx(t){return typeof t=="number"}function tv(t){return typeof t=="string"}function bp(t){return typeof t=="boolean"}function Ub(t){return Object.prototype.toString.call(t)==="[object Object]"}function Ze(t){return Math.abs(t)}function nx(t){return Math.sign(t)}function mu(t,e){return Ze(t-e)}function CK(t,e){if(t===0||e===0||Ze(t)<=Ze(e))return 0;const n=mu(Ze(t),Ze(e));return Ze(n/t)}function nc(t){return rc(t).map(Number)}function fr(t){return t[Oc(t)]}function Oc(t){return Math.max(0,t.length-1)}function rx(t,e){return e===Oc(t)}function $b(t,e=0){return Array.from(Array(t),(n,r)=>e+r)}function rc(t){return Object.keys(t)}function S2(t,e){return[t,e].reduce((n,r)=>(rc(r).forEach(s=>{const i=n[s],o=r[s],a=Ub(i)&&Ub(o);n[s]=a?S2(i,o):o}),n),{})}function nv(t,e){return typeof e.MouseEvent<"u"&&t instanceof e.MouseEvent}function IK(t,e){const n={start:r,center:s,end:i};function r(){return 0}function s(l){return i(l)/2}function i(l){return e-l}function o(l,u){return tv(t)?n[t](l):t(e,l,u)}return{measure:o}}function sc(){let t=[];function e(s,i,o,a={passive:!0}){let l;if("addEventListener"in s)s.addEventListener(i,o,a),l=()=>s.removeEventListener(i,o,a);else{const u=s;u.addListener(o),l=()=>u.removeListener(o)}return t.push(l),r}function n(){t=t.filter(s=>s())}const r={add:e,clear:n};return r}function PK(t,e,n,r){const s=sc(),i=1e3/60;let o=null,a=0,l=0;function u(){s.add(t,"visibilitychange",()=>{t.hidden&&g()})}function d(){p(),s.clear()}function h(_){if(!l)return;o||(o=_);const v=_-o;for(o=_,a+=v;a>=i;)n(i),a-=i;const x=a/i;r(x),l&&e.requestAnimationFrame(h)}function f(){l||(l=e.requestAnimationFrame(h))}function p(){e.cancelAnimationFrame(l),o=null,a=0,l=0}function g(){o=null,a=0}return{init:u,destroy:d,start:f,stop:p,update:()=>n(i),render:r}}function AK(t,e){const n=e==="rtl",r=t==="y",s=r?"y":"x",i=r?"x":"y",o=!r&&n?-1:1,a=d(),l=h();function u(g){const{height:w,width:_}=g;return r?w:_}function d(){return r?"top":n?"right":"left"}function h(){return r?"bottom":n?"left":"right"}function f(g){return g*o}return{scroll:s,cross:i,startEdge:a,endEdge:l,measureSize:u,direction:f}}function bo(t=0,e=0){const n=Ze(t-e);function r(u){return ue}function i(u){return r(u)||s(u)}function o(u){return i(u)?r(u)?t:e:u}function a(u){return n?u-n*Math.ceil((u-e)/n):u}return{length:n,max:e,min:t,constrain:o,reachedAny:i,reachedMax:s,reachedMin:r,removeOffset:a}}function C2(t,e,n){const{constrain:r}=bo(0,t),s=t+1;let i=o(e);function o(f){return n?Ze((s+f)%s):r(f)}function a(){return i}function l(f){return i=o(f),h}function u(f){return d().set(a()+f)}function d(){return C2(t,a(),n)}const h={get:a,set:l,add:u,clone:d};return h}function RK(t,e,n,r,s,i,o,a,l,u,d,h,f,p,g,w,_,v,x){const{cross:T,direction:A}=t,k=["INPUT","SELECT","TEXTAREA"],L={passive:!1},C=sc(),S=sc(),I=bo(50,225).constrain(p.measure(20)),P={mouse:300,touch:400},N={mouse:500,touch:600},O=g?43:25;let D=!1,z=0,re=0,X=!1,G=!1,M=!1,B=!1;function Q(Z){if(!x)return;function ge(Ke){(bp(x)||x(Z,Ke))&&ye(Ke)}const Ae=e;C.add(Ae,"dragstart",Ke=>Ke.preventDefault(),L).add(Ae,"touchmove",()=>{},L).add(Ae,"touchend",()=>{}).add(Ae,"touchstart",ge).add(Ae,"mousedown",ge).add(Ae,"touchcancel",Ve).add(Ae,"contextmenu",Ve).add(Ae,"click",mt,!0)}function H(){C.clear(),S.clear()}function Y(){const Z=B?n:e;S.add(Z,"touchmove",Pe,L).add(Z,"touchend",Ve).add(Z,"mousemove",Pe,L).add(Z,"mouseup",Ve)}function te(Z){const ge=Z.nodeName||"";return k.includes(ge)}function me(){return(g?N:P)[B?"mouse":"touch"]}function Oe(Z,ge){const Ae=h.add(nx(Z)*-1),Ke=d.byDistance(Z,!g).distance;return g||Ze(Z)=2,!(ge&&Z.button!==0)&&(te(Z.target)||(X=!0,i.pointerDown(Z),u.useFriction(0).useDuration(0),s.set(o),Y(),z=i.readPoint(Z),re=i.readPoint(Z,T),f.emit("pointerDown")))}function Pe(Z){if(!nv(Z,r)&&Z.touches.length>=2)return Ve(Z);const Ae=i.readPoint(Z),Ke=i.readPoint(Z,T),st=mu(Ae,z),tn=mu(Ke,re);if(!G&&!B&&(!Z.cancelable||(G=st>tn,!G)))return Ve(Z);const cn=i.pointerMove(Z);st>w&&(M=!0),u.useFriction(.3).useDuration(.75),a.start(),s.add(A(cn)),Z.preventDefault()}function Ve(Z){const Ae=d.byDistance(0,!1).index!==h.get(),Ke=i.pointerUp(Z)*me(),st=Oe(A(Ke),Ae),tn=CK(Ke,st),cn=O-10*tn,Ne=v+tn/50;G=!1,X=!1,S.clear(),u.useDuration(cn).useFriction(Ne),l.distance(st,!g),B=!1,f.emit("pointerUp")}function mt(Z){M&&(Z.stopPropagation(),Z.preventDefault(),M=!1)}function je(){return X}return{init:Q,destroy:H,pointerDown:je}}function kK(t,e){let r,s;function i(h){return h.timeStamp}function o(h,f){const g=`client${(f||t.scroll)==="x"?"X":"Y"}`;return(nv(h,e)?h:h.touches[0])[g]}function a(h){return r=h,s=h,o(h)}function l(h){const f=o(h)-o(s),p=i(h)-i(r)>170;return s=h,p&&(r=h),f}function u(h){if(!r||!s)return 0;const f=o(s)-o(r),p=i(h)-i(r),g=i(h)-i(s)>170,w=f/p;return p&&!g&&Ze(w)>.1?w:0}return{pointerDown:a,pointerMove:l,pointerUp:u,readPoint:o}}function NK(){function t(n){const{offsetTop:r,offsetLeft:s,offsetWidth:i,offsetHeight:o}=n;return{top:r,right:s+i,bottom:r+o,left:s,width:i,height:o}}return{measure:t}}function DK(t){function e(r){return t*(r/100)}return{measure:e}}function OK(t,e,n,r,s,i,o){const a=[t].concat(r);let l,u,d=[],h=!1;function f(_){return s.measureSize(o.measure(_))}function p(_){if(!i)return;u=f(t),d=r.map(f);function v(x){for(const T of x){if(h)return;const A=T.target===t,k=r.indexOf(T.target),L=A?u:d[k],C=f(A?t:r[k]);if(Ze(C-L)>=.5){_.reInit(),e.emit("resize");break}}}l=new ResizeObserver(x=>{(bp(i)||i(_,x))&&v(x)}),n.requestAnimationFrame(()=>{a.forEach(x=>l.observe(x))})}function g(){h=!0,l&&l.disconnect()}return{init:p,destroy:g}}function LK(t,e,n,r,s,i){let o=0,a=0,l=s,u=i,d=t.get(),h=0;function f(L){const C=L/1e3,S=l*C,I=r.get()-t.get(),P=!l;let N=0;return P?(o=0,n.set(r),t.set(r),N=I):(n.set(t),o+=I/S,o*=u,d+=o,t.add(o*C),N=d-h),a=nx(N),h=d,k}function p(){const L=r.get()-e.get();return Ze(L)<.001}function g(){return l}function w(){return a}function _(){return o}function v(){return T(s)}function x(){return A(i)}function T(L){return l=L,k}function A(L){return u=L,k}const k={direction:w,duration:g,velocity:_,seek:f,settled:p,useBaseFriction:x,useBaseDuration:v,useFriction:A,useDuration:T};return k}function MK(t,e,n,r,s){const i=s.measure(10),o=s.measure(50),a=bo(.1,.99);let l=!1;function u(){return!(l||!t.reachedAny(n.get())||!t.reachedAny(e.get()))}function d(p){if(!u())return;const g=t.reachedMin(e.get())?"min":"max",w=Ze(t[g]-e.get()),_=n.get()-e.get(),v=a.constrain(w/o);n.subtract(_*v),!p&&Ze(_){const{min:_,max:v}=i,x=i.constrain(g),T=!w,A=rx(n,w);return T?v:A||u(_,x)?_:u(v,x)?v:x}).map(g=>parseFloat(g.toFixed(3)))}function f(){if(e<=t+s)return[i.max];if(r==="keepSnaps")return o;const{min:g,max:w}=a;return o.slice(g,w)}return{snapsContained:l,scrollContainLimit:a}}function jK(t,e,n){const r=e[0],s=n?r-t:fr(e);return{limit:bo(s,r)}}function FK(t,e,n,r){const i=e.min+.1,o=e.max+.1,{reachedMin:a,reachedMax:l}=bo(i,o);function u(f){return f===1?l(n.get()):f===-1?a(n.get()):!1}function d(f){if(!u(f))return;const p=t*(f*-1);r.forEach(g=>g.add(p))}return{loop:d}}function UK(t){const{max:e,length:n}=t;function r(i){const o=i-e;return n?o/-n:0}return{get:r}}function $K(t,e,n,r,s){const{startEdge:i,endEdge:o}=t,{groupSlides:a}=s,l=h().map(e.measure),u=f(),d=p();function h(){return a(r).map(w=>fr(w)[o]-w[0][i]).map(Ze)}function f(){return r.map(w=>n[i]-w[i]).map(w=>-Ze(w))}function p(){return a(u).map(w=>w[0]).map((w,_)=>w+l[_])}return{snaps:u,snapsAligned:d}}function BK(t,e,n,r,s,i){const{groupSlides:o}=s,{min:a,max:l}=r,u=d();function d(){const f=o(i),p=!t||e==="keepSnaps";return n.length===1?[i]:p?f:f.slice(a,l).map((g,w,_)=>{const v=!w,x=rx(_,w);if(v){const T=fr(_[0])+1;return $b(T)}if(x){const T=Oc(i)-fr(_)[0]+1;return $b(T,fr(_)[0])}return g})}return{slideRegistry:u}}function zK(t,e,n,r,s){const{reachedAny:i,removeOffset:o,constrain:a}=r;function l(g){return g.concat().sort((w,_)=>Ze(w)-Ze(_))[0]}function u(g){const w=t?o(g):a(g),_=e.map((x,T)=>({diff:d(x-w,0),index:T})).sort((x,T)=>Ze(x.diff)-Ze(T.diff)),{index:v}=_[0];return{index:v,distance:w}}function d(g,w){const _=[g,g+n,g-n];if(!t)return g;if(!w)return l(_);const v=_.filter(x=>nx(x)===w);return v.length?l(v):fr(_)-n}function h(g,w){const _=e[g]-s.get(),v=d(_,w);return{index:g,distance:v}}function f(g,w){const _=s.get()+g,{index:v,distance:x}=u(_),T=!t&&i(_);if(!w||T)return{index:v,distance:g};const A=e[v]-x,k=g+d(A,0);return{index:v,distance:k}}return{byDistance:f,byIndex:h,shortcut:d}}function HK(t,e,n,r,s,i,o){function a(h){const f=h.distance,p=h.index!==e.get();i.add(f),f&&(r.duration()?t.start():(t.update(),t.render(1),t.update())),p&&(n.set(e.get()),e.set(h.index),o.emit("select"))}function l(h,f){const p=s.byDistance(h,f);a(p)}function u(h,f){const p=e.clone().set(h),g=s.byIndex(p.get(),f);a(g)}return{distance:l,index:u}}function WK(t,e,n,r,s,i,o,a){const l={passive:!0,capture:!0};let u=0;function d(p){if(!a)return;function g(w){if(new Date().getTime()-u>10)return;o.emit("slideFocusStart"),t.scrollLeft=0;const x=n.findIndex(T=>T.includes(w));tx(x)&&(s.useDuration(0),r.index(x,0),o.emit("slideFocus"))}i.add(document,"keydown",h,!1),e.forEach((w,_)=>{i.add(w,"focus",v=>{(bp(a)||a(p,v))&&g(_)},l)})}function h(p){p.code==="Tab"&&(u=new Date().getTime())}return{init:d}}function ql(t){let e=t;function n(){return e}function r(l){e=o(l)}function s(l){e+=o(l)}function i(l){e-=o(l)}function o(l){return tx(l)?l:l.get()}return{get:n,set:r,add:s,subtract:i}}function I2(t,e){const n=t.scroll==="x"?i:o,r=e.style;let s=!1;function i(h){return`translate3d(${h}px,0px,0px)`}function o(h){return`translate3d(0px,${h}px,0px)`}function a(h){s||(r.transform=n(t.direction(h)))}function l(h){s=!h}function u(){s||(r.transform="",e.getAttribute("style")||e.removeAttribute("style"))}return{clear:u,to:a,toggleActive:l}}function qK(t,e,n,r,s,i,o,a,l){const d=nc(s),h=nc(s).reverse(),f=v().concat(x());function p(C,S){return C.reduce((I,P)=>I-s[P],S)}function g(C,S){return C.reduce((I,P)=>p(I,S)>0?I.concat([P]):I,[])}function w(C){return i.map((S,I)=>({start:S-r[I]+.5+C,end:S+e-.5+C}))}function _(C,S,I){const P=w(S);return C.map(N=>{const O=I?0:-n,D=I?n:0,z=I?"end":"start",re=P[N][z];return{index:N,loopPoint:re,slideLocation:ql(-1),translate:I2(t,l[N]),target:()=>a.get()>re?O:D}})}function v(){const C=o[0],S=g(h,C);return _(S,n,!1)}function x(){const C=e-o[0]-1,S=g(d,C);return _(S,-n,!0)}function T(){return f.every(({index:C})=>{const S=d.filter(I=>I!==C);return p(S,e)<=.1})}function A(){f.forEach(C=>{const{target:S,translate:I,slideLocation:P}=C,N=S();N!==P.get()&&(I.to(N),P.set(N))})}function k(){f.forEach(C=>C.translate.clear())}return{canLoop:T,clear:k,loop:A,loopPoints:f}}function KK(t,e,n){let r,s=!1;function i(l){if(!n)return;function u(d){for(const h of d)if(h.type==="childList"){l.reInit(),e.emit("slidesChanged");break}}r=new MutationObserver(d=>{s||(bp(n)||n(l,d))&&u(d)}),r.observe(t,{childList:!0})}function o(){r&&r.disconnect(),s=!0}return{init:i,destroy:o}}function GK(t,e,n,r){const s={};let i=null,o=null,a,l=!1;function u(){a=new IntersectionObserver(g=>{l||(g.forEach(w=>{const _=e.indexOf(w.target);s[_]=w}),i=null,o=null,n.emit("slidesInView"))},{root:t.parentElement,threshold:r}),e.forEach(g=>a.observe(g))}function d(){a&&a.disconnect(),l=!0}function h(g){return rc(s).reduce((w,_)=>{const v=parseInt(_),{isIntersecting:x}=s[v];return(g&&x||!g&&!x)&&w.push(v),w},[])}function f(g=!0){if(g&&i)return i;if(!g&&o)return o;const w=h(g);return g&&(i=w),g||(o=w),w}return{init:u,destroy:d,get:f}}function QK(t,e,n,r,s,i){const{measureSize:o,startEdge:a,endEdge:l}=t,u=n[0]&&s,d=g(),h=w(),f=n.map(o),p=_();function g(){if(!u)return 0;const x=n[0];return Ze(e[a]-x[a])}function w(){if(!u)return 0;const x=i.getComputedStyle(fr(r));return parseFloat(x.getPropertyValue(`margin-${l}`))}function _(){return n.map((x,T,A)=>{const k=!T,L=rx(A,T);return k?f[T]+d:L?f[T]+h:A[T+1][a]-x[a]}).map(Ze)}return{slideSizes:f,slideSizesWithGaps:p,startGap:d,endGap:h}}function YK(t,e,n,r,s,i,o,a,l){const{startEdge:u,endEdge:d,direction:h}=t,f=tx(n);function p(v,x){return nc(v).filter(T=>T%x===0).map(T=>v.slice(T,T+x))}function g(v){return v.length?nc(v).reduce((x,T,A)=>{const k=fr(x)||0,L=k===0,C=T===Oc(v),S=s[u]-i[k][u],I=s[u]-i[T][d],P=!r&&L?h(o):0,N=!r&&C?h(a):0,O=Ze(I-N-(S+P));return A&&O>e+l&&x.push(T),C&&x.push(v.length),x},[]).map((x,T,A)=>{const k=Math.max(A[T-1]||0);return v.slice(k,x)}):[]}function w(v){return f?p(v,n):g(v)}return{groupSlides:w}}function XK(t,e,n,r,s,i,o){const{align:a,axis:l,direction:u,startIndex:d,loop:h,duration:f,dragFree:p,dragThreshold:g,inViewThreshold:w,slidesToScroll:_,skipSnaps:v,containScroll:x,watchResize:T,watchSlides:A,watchDrag:k,watchFocus:L}=i,C=2,S=NK(),I=S.measure(e),P=n.map(S.measure),N=AK(l,u),O=N.measureSize(I),D=DK(O),z=IK(a,O),re=!h&&!!x,X=h||!!x,{slideSizes:G,slideSizesWithGaps:M,startGap:B,endGap:Q}=QK(N,I,P,n,X,s),H=YK(N,O,_,h,I,P,B,Q,C),{snaps:Y,snapsAligned:te}=$K(N,z,I,P,H),me=-fr(Y)+fr(M),{snapsContained:Oe,scrollContainLimit:ye}=VK(O,me,te,x,C),Pe=re?Oe:te,{limit:Ve}=jK(me,Pe,h),mt=C2(Oc(Pe),d,h),je=mt.clone(),Te=nc(n),Z=({dragHandler:dn,scrollBody:Li,scrollBounds:Ln,options:{loop:wr}},bs)=>{wr||Ln.constrain(dn.pointerDown()),Li.seek(bs)},ge=({scrollBody:dn,translate:Li,location:Ln,offsetLocation:wr,scrollLooper:bs,slideLooper:zr,dragHandler:Mn,animation:dl,eventHandler:ae,scrollBounds:Re,options:{loop:Se}},_t)=>{const kt=dn.settled(),xr=!Re.shouldConstrain(),Vn=Se?kt:kt&&xr;Vn&&!Mn.pointerDown()&&(dl.stop(),ae.emit("settle")),Vn||ae.emit("scroll");const Lc=Ln.get()*_t+cn.get()*(1-_t);wr.set(Lc),Se&&(bs.loop(dn.direction()),zr.loop()),Li.to(wr.get())},Ae=PK(r,s,dn=>Z(xn,dn),dn=>ge(xn,dn)),Ke=.68,st=Pe[mt.get()],tn=ql(st),cn=ql(st),Ne=ql(st),Ct=ql(st),vr=LK(tn,Ne,cn,Ct,f,Ke),Oi=zK(h,Pe,me,Ve,Ct),On=HK(Ae,mt,je,vr,Oi,Ct,o),Es=UK(Ve),Ts=sc(),it=GK(e,n,o,w),{slideRegistry:Ue}=BK(re,x,Pe,ye,H,Te),Br=WK(t,n,Ue,On,vr,Ts,o,L),xn={ownerDocument:r,ownerWindow:s,eventHandler:o,containerRect:I,slideRects:P,animation:Ae,axis:N,dragHandler:RK(N,t,r,s,Ct,kK(N,s),tn,Ae,On,vr,Oi,mt,o,D,p,g,v,Ke,k),eventStore:Ts,percentOfView:D,index:mt,indexPrevious:je,limit:Ve,location:tn,offsetLocation:Ne,previousLocation:cn,options:i,resizeHandler:OK(e,o,s,n,N,T,S),scrollBody:vr,scrollBounds:MK(Ve,Ne,Ct,vr,D),scrollLooper:FK(me,Ve,Ne,[tn,Ne,cn,Ct]),scrollProgress:Es,scrollSnapList:Pe.map(Es.get),scrollSnaps:Pe,scrollTarget:Oi,scrollTo:On,slideLooper:qK(N,O,me,G,M,Y,Pe,Ne,n),slideFocus:Br,slidesHandler:KK(e,o,A),slidesInView:it,slideIndexes:Te,slideRegistry:Ue,slidesToScroll:H,target:Ct,translate:I2(N,e)};return xn}function JK(){let t={},e;function n(u){e=u}function r(u){return t[u]||[]}function s(u){return r(u).forEach(d=>d(e,u)),l}function i(u,d){return t[u]=r(u).concat([d]),l}function o(u,d){return t[u]=r(u).filter(h=>h!==d),l}function a(){t={}}const l={init:n,emit:s,off:o,on:i,clear:a};return l}const ZK={align:"center",axis:"x",container:null,slides:null,containScroll:"trimSnaps",direction:"ltr",slidesToScroll:1,inViewThreshold:0,breakpoints:{},dragFree:!1,dragThreshold:10,loop:!1,skipSnaps:!1,duration:25,startIndex:0,active:!0,watchDrag:!0,watchResize:!0,watchSlides:!0,watchFocus:!0};function eG(t){function e(i,o){return S2(i,o||{})}function n(i){const o=i.breakpoints||{},a=rc(o).filter(l=>t.matchMedia(l).matches).map(l=>o[l]).reduce((l,u)=>e(l,u),{});return e(i,a)}function r(i){return i.map(o=>rc(o.breakpoints||{})).reduce((o,a)=>o.concat(a),[]).map(t.matchMedia)}return{mergeOptions:e,optionsAtMedia:n,optionsMediaQueries:r}}function tG(t){let e=[];function n(i,o){return e=o.filter(({options:a})=>t.optionsAtMedia(a).active!==!1),e.forEach(a=>a.init(i,t)),o.reduce((a,l)=>Object.assign(a,{[l.name]:l}),{})}function r(){e=e.filter(i=>i.destroy())}return{init:n,destroy:r}}function yf(t,e,n){const r=t.ownerDocument,s=r.defaultView,i=eG(s),o=tG(i),a=sc(),l=JK(),{mergeOptions:u,optionsAtMedia:d,optionsMediaQueries:h}=i,{on:f,off:p,emit:g}=l,w=N;let _=!1,v,x=u(ZK,yf.globalOptions),T=u(x),A=[],k,L,C;function S(){const{container:Te,slides:Z}=T;L=(tv(Te)?t.querySelector(Te):Te)||t.children[0];const Ae=tv(Z)?L.querySelectorAll(Z):Z;C=[].slice.call(Ae||L.children)}function I(Te){const Z=XK(t,L,C,r,s,Te,l);if(Te.loop&&!Z.slideLooper.canLoop()){const ge=Object.assign({},Te,{loop:!1});return I(ge)}return Z}function P(Te,Z){_||(x=u(x,Te),T=d(x),A=Z||A,S(),v=I(T),h([x,...A.map(({options:ge})=>ge)]).forEach(ge=>a.add(ge,"change",N)),T.active&&(v.translate.to(v.location.get()),v.animation.init(),v.slidesInView.init(),v.slideFocus.init(je),v.eventHandler.init(je),v.resizeHandler.init(je),v.slidesHandler.init(je),v.options.loop&&v.slideLooper.loop(),L.offsetParent&&C.length&&v.dragHandler.init(je),k=o.init(je,A)))}function N(Te,Z){const ge=H();O(),P(u({startIndex:ge},Te),Z),l.emit("reInit")}function O(){v.dragHandler.destroy(),v.eventStore.clear(),v.translate.clear(),v.slideLooper.clear(),v.resizeHandler.destroy(),v.slidesHandler.destroy(),v.slidesInView.destroy(),v.animation.destroy(),o.destroy(),a.clear()}function D(){_||(_=!0,a.clear(),O(),l.emit("destroy"),l.clear())}function z(Te,Z,ge){!T.active||_||(v.scrollBody.useBaseFriction().useDuration(Z===!0?0:T.duration),v.scrollTo.index(Te,ge||0))}function re(Te){const Z=v.index.add(1).get();z(Z,Te,-1)}function X(Te){const Z=v.index.add(-1).get();z(Z,Te,1)}function G(){return v.index.add(1).get()!==H()}function M(){return v.index.add(-1).get()!==H()}function B(){return v.scrollSnapList}function Q(){return v.scrollProgress.get(v.location.get())}function H(){return v.index.get()}function Y(){return v.indexPrevious.get()}function te(){return v.slidesInView.get()}function me(){return v.slidesInView.get(!1)}function Oe(){return k}function ye(){return v}function Pe(){return t}function Ve(){return L}function mt(){return C}const je={canScrollNext:G,canScrollPrev:M,containerNode:Ve,internalEngine:ye,destroy:D,off:p,on:f,emit:g,plugins:Oe,previousScrollSnap:Y,reInit:w,rootNode:Pe,scrollNext:re,scrollPrev:X,scrollProgress:Q,scrollSnapList:B,scrollTo:z,selectedScrollSnap:H,slideNodes:mt,slidesInView:te,slidesNotInView:me};return P(e,n),setTimeout(()=>l.emit("init"),0),je}yf.globalOptions=void 0;function sx(t={},e=[]){const n=b.useRef(t),r=b.useRef(e),[s,i]=b.useState(),[o,a]=b.useState(),l=b.useCallback(()=>{s&&s.reInit(n.current,r.current)},[s]);return b.useEffect(()=>{ex(n.current,t)||(n.current=t,l())},[t,l]),b.useEffect(()=>{SK(r.current,e)||(r.current=e,l())},[e,l]),b.useEffect(()=>{if(bK()&&o){yf.globalOptions=sx.globalOptions;const u=yf(o,n.current,r.current);return i(u),()=>u.destroy()}else i(void 0)},[o,i]),[a,s]}sx.globalOptions=void 0;const P2=b.createContext(null);function Sp(){const t=b.useContext(P2);if(!t)throw new Error("useCarousel must be used within a ");return t}const A2=b.forwardRef(({orientation:t="horizontal",opts:e,setApi:n,plugins:r,className:s,children:i,...o},a)=>{const[l,u]=sx({...e,axis:t==="horizontal"?"x":"y"},r),[d,h]=b.useState(!1),[f,p]=b.useState(!1),g=b.useCallback(x=>{x&&(h(x.canScrollPrev()),p(x.canScrollNext()))},[]),w=b.useCallback(()=>{u==null||u.scrollPrev()},[u]),_=b.useCallback(()=>{u==null||u.scrollNext()},[u]),v=b.useCallback(x=>{x.key==="ArrowLeft"?(x.preventDefault(),w()):x.key==="ArrowRight"&&(x.preventDefault(),_())},[w,_]);return b.useEffect(()=>{!u||!n||n(u)},[u,n]),b.useEffect(()=>{if(u)return g(u),u.on("reInit",g),u.on("select",g),()=>{u==null||u.off("select",g)}},[u,g]),y.jsx(P2.Provider,{value:{carouselRef:l,api:u,opts:e,orientation:t||((e==null?void 0:e.axis)==="y"?"vertical":"horizontal"),scrollPrev:w,scrollNext:_,canScrollPrev:d,canScrollNext:f},children:y.jsx("div",{ref:a,onKeyDownCapture:v,className:Ye("relative",s),role:"region","aria-roledescription":"carousel",...o,children:i})})});A2.displayName="Carousel";const R2=b.forwardRef(({className:t,...e},n)=>{const{carouselRef:r,orientation:s}=Sp();return y.jsx("div",{ref:r,className:"overflow-hidden",children:y.jsx("div",{ref:n,className:Ye("flex",s==="horizontal"?"-ml-4":"-mt-4 flex-col",t),...e})})});R2.displayName="CarouselContent";const k2=b.forwardRef(({className:t,...e},n)=>{const{orientation:r}=Sp();return y.jsx("div",{ref:n,role:"group","aria-roledescription":"slide",className:Ye("min-w-0 shrink-0 grow-0 basis-full",r==="horizontal"?"pl-4":"pt-4",t),...e})});k2.displayName="CarouselItem";const N2=b.forwardRef(({className:t,variant:e="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollPrev:o,canScrollPrev:a}=Sp();return y.jsxs(xt,{ref:s,variant:e,size:n,className:Ye("absolute h-8 w-8 rounded-full",i==="horizontal"?"-left-12 top-1/2 -translate-y-1/2":"-top-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!a,onClick:o,...r,children:[y.jsx(uV,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Previous slide"})]})});N2.displayName="CarouselPrevious";const D2=b.forwardRef(({className:t,variant:e="outline",size:n="icon",...r},s)=>{const{orientation:i,scrollNext:o,canScrollNext:a}=Sp();return y.jsxs(xt,{ref:s,variant:e,size:n,className:Ye("absolute h-8 w-8 rounded-full",i==="horizontal"?"-right-12 top-1/2 -translate-y-1/2":"-bottom-12 left-1/2 -translate-x-1/2 rotate-90",t),disabled:!a,onClick:o,...r,children:[y.jsx(fP,{className:"h-4 w-4"}),y.jsx("span",{className:"sr-only",children:"Next slide"})]})});D2.displayName="CarouselNext";const nG=({videoUrl:t,title:e})=>{var o;const[n,r]=b.useState(!1),s=(o=t.split("/embed/")[1])==null?void 0:o.split("?")[0],i=s?`https://img.youtube.com/vi/${s}/maxresdefault.jpg`:"";if(n){const a=t.includes("?")?"&":"?",l=`${t}${a}autoplay=1&rel=0&modestbranding=1`;return y.jsx("div",{className:"aspect-video bg-black rounded-t-lg shrink-0",children:y.jsx("iframe",{src:l,title:e,className:"w-full h-full rounded-t-lg",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share",allowFullScreen:!0})})}return y.jsxs("div",{className:"aspect-video bg-black rounded-t-lg shrink-0 relative cursor-pointer group/video",onClick:()=>r(!0),children:[i&&y.jsx("img",{src:i,alt:e,className:"w-full h-full object-cover rounded-t-lg opacity-90 group-hover/video:opacity-100 transition-opacity"}),y.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:y.jsx("div",{className:"w-16 h-16 bg-white/20 backdrop-blur-sm rounded-full flex items-center justify-center group-hover/video:scale-110 transition-transform duration-300",children:y.jsx("div",{className:"w-12 h-12 bg-white rounded-full flex items-center justify-center shadow-lg",children:y.jsx(bV,{className:"w-5 h-5 text-primary ml-1 fill-primary"})})})})]})},rG=()=>{const[t,e]=b.useState(!1),n=b.useRef(null),r=[{author:"Laure WAFEU",video:"https://www.youtube.com/embed/QqMECkoD9ow?si=g2eB1gZFsTVPyC3q",testimony:"Je me sentais vide et désorientée, sans comprendre le sens de ma destinée. Grâce à la formation Leader des Nations, j’ai découvert ma personnalité, mes dons et mes talents, et aujourd’hui je cours avec assurance vers le couloir de ma destinée."},{author:"Cyrille TAYO",video:"https://www.youtube.com/embed/BBF5uGIL0dI?si=7nLdzbFj3Z9Y7owz",testimony:"J’étais frustré et perdu, sans savoir qui j’étais ni où aller. Aujourd’hui, grâce à l’école de destinée et de leadership LDN, un nouveau chapitre s’est ouvert et je vis désormais ce à quoi je suis réellement appelé."},{author:"Omer TAFOTIE",video:"https://www.youtube.com/embed/9y8IG2Ap0Dw?si=s9ZNyltp02nBVAjS",testimony:"Je voulais me marier et bâtir ma vie, mais je ne savais pas quelle voix écouter. Grâce à cette formation, j’ai appris à distinguer la voix de Dieu de toutes les autres, et aujourd’hui je marche avec clarté et assurance dans mes décisions."},{author:"Guy WAFEU",video:"https://www.youtube.com/embed/3I1-aEY4HbM?si=1KkgNOhLI25BlaN4",testimony:"Même en étant médecin, je me sentais perdu quant au sens réel de ma vie. Grâce à la formation Leadership des Nations, j’ai identifié clairement mon objectif sur terre et aujourd’hui je mène une vie qui compte vraiment."},{author:"Ulrich NGUENA",video:"https://www.youtube.com/embed/2sX9jkrQ_-8?si=3TCzzljIp7YbpoRQ",testimony:"Cette formation m’a profondément bouleversé. Elle m’a permis d’identifier avec précision ma destinée et aujourd’hui, mon énergie, mon travail et mes pensées sont entièrement alignés vers ce à quoi je suis appelé."},{author:"Gervais TALLA",video:"https://www.youtube.com/embed/Ih50UQXFHpY?si=j9TTEfSfnvLCS59M",testimony:"Je me suis longtemps demandé quel était le sens réel de ma vie. Grâce à la formation Leadership des Nations, je ne survis plus : je vis pleinement, avec une destinée claire et un vide intérieur désormais comblé."},{author:"Arlette TCHOUAMOU",video:"https://www.youtube.com/embed/KqFsKBdMaSk?si=06foJ1-GxNweE2Zb",testimony:"Je me posais de profondes questions sur mon identité et mon avenir. Grâce à Leadership des Nations, j’ai découvert qui je suis, trouvé ma place dans ma destinée et aujourd’hui je m’épanouis en me sentant réellement utile aux autres."},{author:"Rodrigue SAMEGNI",video:"https://www.youtube.com/embed/t5w6TZVIo_g?si=DSK-37dlDUFx9tWx",testimony:"Avant cette formation, je marchais un peu dans le noir, sans vraiment savoir où j’allais. Leadership des Nations m’a appris à prier, à comprendre ma destinée et à déployer mes dons avec clarté et assurance dans ma vie et celle de ma famille."}],s=[{number:15e3,label:"Leaders bénis",suffix:"+"},{number:30,label:"Modules",suffix:"+"},{number:95,label:"Satisfaction",suffix:"%"},{number:4.9,label:"Note moyenne",suffix:"/5"}];b.useEffect(()=>{const o=n.current,a=new IntersectionObserver(l=>{const u=l[0];u!=null&&u.isIntersecting&&e(!0)},{threshold:.1});return o&&a.observe(o),()=>{o&&a.unobserve(o)}},[]);const i=({targetNumber:o,suffix:a})=>{const[l,u]=b.useState(0);return b.useEffect(()=>{if(!t)return;const d=2e3,h=60,f=o/h,p=d/h,g=setInterval(()=>{u(w=>wclearInterval(g)},[o]),y.jsxs("span",{children:[o%1===0?Math.floor(l):l.toFixed(1),a]})};return y.jsx("section",{ref:n,className:"py-16 bg-white",children:y.jsxs("div",{className:"container mx-auto px-4",children:[y.jsx("h2",{className:"text-3xl md:text-4xl font-bold text-gray-900 mb-6",children:"Expériences et témoignages"}),y.jsx("p",{className:"text-gray-600 mb-10",children:"Statistiques et témoignages des leaders formés"}),y.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-4 gap-6 mb-12",children:s.map((o,a)=>y.jsxs("div",{className:"p-6 rounded-lg border bg-gray-50 text-center transition-all duration-500 hover:shadow-lg hover:scale-105",children:[y.jsx("div",{className:"text-3xl font-bold text-primary mb-2",children:y.jsx(i,{targetNumber:o.number,suffix:o.suffix})}),y.jsx("div",{className:"text-sm text-gray-600",children:o.label})]},a))}),y.jsxs("div",{className:"mb-8 relative",children:[y.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-6",children:"Témoignages"}),y.jsxs(A2,{opts:{align:"start",loop:!0},className:"w-full",children:[y.jsx(R2,{className:"",children:r.map((o,a)=>y.jsx(k2,{className:"md:basis-1/2 lg:basis-1/3 xl:basis-1/4 pl-4",children:y.jsxs("div",{className:"h-full bg-white rounded-lg border border-gray-200 shadow-sm hover:shadow-md transition-all duration-300 hover:scale-105 flex flex-col select-none",children:[y.jsx(nG,{videoUrl:o.video,title:`Témoignage de ${o.author}`}),y.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[y.jsx("div",{className:"font-semibold text-lg text-gray-900 mb-3",children:o.author}),y.jsxs("p",{className:"text-gray-600 text-sm leading-relaxed italic",children:['"',o.testimony,'"']})]})]})},a))}),y.jsx(N2,{className:"static translate-y-0 h-10 w-10 border-slate-200"}),y.jsx(D2,{className:"static translate-y-0 h-10 w-10 border-slate-200"})]})]})]})})},sG=()=>{const t=[{name:"L’Eclaireur",logo:"/assets/partners/Logo Eclaireur transparent.png",link:"https://eclaireurofficiel.com/",maxHeight:"h-[200px]"},{name:"EDREAMA",logo:"/assets/partners/Logo Edreama noir.png",link:"https://web.facebook.com/edreama.eden",maxHeight:"h-[80px]"},{name:"Music Rhema",logo:"/assets/partners/logo-music-rhema.png",link:"https://www.musicrhema.fr/",maxHeight:"h-[180px]"},{name:"OrEvent",logo:"/assets/partners/Or Events.png",link:"https://web.facebook.com/profile.php?id=61574925240473#",maxHeight:"h-[110px]"},{name:"Divine Peace",logo:"/assets/partners/logo transparent Divine Peace.png",link:"https://web.facebook.com/profile.php?id=100077329340229",maxHeight:"h-[110px]"},{name:"Trinita Foods",logo:"/assets/partners/logo-trinita-foods.jpg",link:"https://web.facebook.com/profile.php?id=61557966137633#",maxHeight:"h-[130px]"}];return y.jsx("section",{className:"py-8 mx-auto px-16 bg-background",children:y.jsxs("div",{className:"relative overflow-hidden mx-auto px-4 w-full max-w-full",children:[y.jsx("h2",{className:"text-3xl font-bold text-[#1e1b4b] mb-2",children:"Nos Partenaires"}),y.jsx("div",{className:"flex w-max animate-scroll gap-16",children:[...t,...t].map((e,n)=>y.jsxs("a",{href:e.link,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center min-h-[120px]",children:[y.jsx("img",{src:e.logo,alt:e.name,className:`w-auto object-contain ${e.maxHeight??"h-24"} hover:scale-105 transition-transform duration-300`,onError:r=>{var s;r.currentTarget.style.display="none",(s=r.currentTarget.nextElementSibling)==null||s.classList.remove("hidden")}}),y.jsx("span",{className:"hidden text-3xl font-bold text-slate-400 uppercase tracking-widest",children:e.name})]},n))}),y.jsxs("div",{className:"mt-4 text-center",children:[" ",y.jsx("p",{className:"text-slate-400 text-sm italic tracking-wide",children:" Ils nous font confiance pour bâtir l'avenir "})," "]})]})})},iG=()=>{const t=[{color:"bg-blue-500",title:"Equipement spirituel",description:"Reçois le bagage et les ressources nécessaires à la croissance et maturité spirituelle pour opérer dans ta destinée tel que Dieu veut et a prévu"},{color:"bg-red-500",title:"Développement personnel",description:"Apprend à mieux te connaître, découvre ta personnalité et acquiert ici tout ce qui contribue à faire de toi un leader responsable et équipé pour influencer convenablement sa génération"},{color:"bg-yellow-500",title:"Entrepreneuriat",description:"Découvre les clés qui t'aident à créer la richesse dont ta destinée a besoin pour se réaliser et s'accomplir convenablement. Personne ne financera mieux ta destinée que toi-même."},{color:"bg-green-500",title:"Leadership",description:"Prends ta destinée en main en tant que leader et découvre tout ce qui concerne le leadership."},{color:"bg-purple-500",title:"Management",description:"Apprend à gérer les ressources humaines, économiques et financières que Dieu a mis à ta disposition pour réussir ta destinée."},{color:"bg-pink-500",title:"Développement des relations",description:"Tu ne peux réussir ta destinée sans entretenir et développer des relations saines. C'est le lieu de comprendre le rôle du mariage, de la paternité spirituelle et des autres relations à développer pour réussir sa destinée."}];return y.jsx("section",{className:"py-12 md:py-20 bg-gradient-to-b from-[hsl(var(--primary-dark))] via-[#0e2749] to-[#0b1b2e] text-white",children:y.jsxs("div",{className:"container mx-auto px-4",children:[y.jsxs("div",{className:"mb-12 md:mb-16",children:[y.jsx("h2",{className:"text-3xl md:text-4xl lg:text-5xl font-bold text-white mb-6 md:mb-6 text-left",children:"Bienvenue à l'école de destinée LDN"}),y.jsxs("div",{className:"space-y-4 text-left",children:[y.jsx("p",{className:"text-lg md:text-xl text-white/80 leading-relaxed",children:"Découvrez et entrez dans votre destinée avec notre processus passionnant et éprouvé par plusieurs leaders dans le monde"}),y.jsx("p",{className:"text-base md:text-lg text-white/80 leading-relaxed",children:"Nous croyons à un appel unique sur la vie de chaque personne. Tout a été créé pour un but spécifique et avec des caractéristiques spécifiques. Les programmes LDN combinent équipement spirituel, développement personnel, entrepreneuriat, leadership, management des projets et des ressources et développement des relations."})]})]}),y.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 lg:gap-12 items-start mb-12",children:[y.jsxs("div",{className:"relative order-2 lg:order-1 space-y-6",children:[y.jsxs("div",{className:"relative rounded-2xl overflow-hidden shadow-2xl",children:[y.jsx("img",{src:"https://i.la-croix.com/836x/smart/2019/01/29/1200998860/Louvrage-sancre-debat-socialon-regretter-certain-relativisme-interlocuteurs_0.jpg",alt:"Symbolique de destinée, lumière, appel spirituel",className:"w-full h-64 md:h-96 lg:h-[500px] object-cover"}),y.jsxs("div",{className:"absolute bottom-4 left-4 bg-yellow-400 text-gray-900 p-4 md:p-6 rounded-xl shadow-lg",children:[y.jsx("div",{className:"text-2xl md:text-3xl font-bold",children:"+15 000"}),y.jsx("div",{className:"text-xs md:text-sm font-medium",children:"Personnes accompagnées"})]})]}),t[5]&&y.jsxs("div",{className:"flex items-start gap-3 p-4 bg-white/5 rounded-lg hover:bg-white/10 transition-colors",children:[y.jsx("div",{className:`w-8 h-8 ${t[5].color} rounded-full flex-shrink-0 mt-0.5`}),y.jsxs("div",{className:"flex-1",children:[y.jsx("h4",{className:"font-semibold text-white mb-1 text-base md:text-lg",children:t[5].title}),y.jsx("p",{className:"text-sm md:text-base text-white/80 leading-relaxed",children:t[5].description})]})]})]}),y.jsxs("div",{className:"space-y-4 md:space-y-6 order-1 lg:order-2",children:[y.jsx("h3",{className:"text-2xl md:text-3xl font-bold text-white mb-6",children:"Nos 6 Piliers de Formation"}),y.jsx("div",{className:"grid grid-cols-1 gap-4",children:t.slice(0,5).map((e,n)=>y.jsxs("div",{className:"flex items-start gap-3 p-4 bg-white/5 rounded-lg hover:bg-white/10 transition-colors",children:[y.jsx("div",{className:`w-8 h-8 ${e.color} rounded-full flex-shrink-0 mt-0.5`}),y.jsxs("div",{className:"flex-1",children:[y.jsx("h4",{className:"font-semibold text-white mb-1 text-base md:text-lg",children:e.title}),y.jsx("p",{className:"text-sm md:text-base text-white/80 leading-relaxed",children:e.description})]})]},n))})]})]}),y.jsxs("div",{className:"bg-white/5 rounded-2xl p-6 md:p-8 lg:p-10 text-center",children:[y.jsx("p",{className:"text-base md:text-lg text-white/80 mb-6 max-w-3xl mx-auto text-justify",children:"L'école de destinée est une école qui équipe les leaders à découvrir et entrer dans leur destinée. Découvrez l'histoire, l'équipe, les valeurs et les missions de LDN."}),y.jsx(vi,{to:"/about",children:y.jsx(xt,{size:"lg",className:"bg-primary hover:bg-primary-dark text-white px-6 md:px-8 py-3 md:py-4 text-base md:text-lg font-semibold rounded-full transition-all hover:scale-105 shadow-lg",children:"En savoir plus sur LDN"})})]})]})})},O2=b.forwardRef(({className:t,...e},n)=>y.jsx("div",{ref:n,className:Ye("rounded-lg border bg-card text-card-foreground shadow-sm",t),...e}));O2.displayName="Card";const oG=b.forwardRef(({className:t,...e},n)=>y.jsx("div",{ref:n,className:Ye("flex flex-col space-y-1.5 p-6",t),...e}));oG.displayName="CardHeader";const aG=b.forwardRef(({className:t,...e},n)=>y.jsx("h3",{ref:n,className:Ye("text-2xl font-semibold leading-none tracking-tight",t),...e}));aG.displayName="CardTitle";const lG=b.forwardRef(({className:t,...e},n)=>y.jsx("p",{ref:n,className:Ye("text-sm text-muted-foreground",t),...e}));lG.displayName="CardDescription";const L2=b.forwardRef(({className:t,...e},n)=>y.jsx("div",{ref:n,className:Ye("p-6 pt-0",t),...e}));L2.displayName="CardContent";const uG=b.forwardRef(({className:t,...e},n)=>y.jsx("div",{ref:n,className:Ye("flex items-center p-6 pt-0",t),...e}));uG.displayName="CardFooter";const cG=$f("inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function dG({className:t,variant:e,...n}){return y.jsx("div",{className:Ye(cG({variant:e}),t),...n})}const hG=()=>{const[t,e]=b.useState([]),[n,r]=b.useState([]),[s,i]=b.useState(!0);b.useEffect(()=>{const a=Vk(Pk(zk,"modules")),l=$k(a,u=>{const d=[],h=new Set;u.forEach(f=>{const p=f.data();d.push({id:f.id,...p}),p.category&&h.add(p.category)}),d.sort((f,p)=>{const g=parseInt(f.id),w=parseInt(p.id);return!isNaN(g)&&!isNaN(w)?g-w:f.id.localeCompare(p.id)}),e(d),r(Array.from(h).sort()),i(!1)},u=>{console.error("Error fetching programs:",u),i(!1)});return()=>l()},[]);const o=["Tout",...n];return{programs:t,categories:n,filters:o,loading:s}},fG=(t,e,n,r)=>{var i,o,a,l;const s=[n,{code:e,...r||{}}];if((o=(i=t==null?void 0:t.services)==null?void 0:i.logger)!=null&&o.forward)return t.services.logger.forward(s,"warn","react-i18next::",!0);uo(s[0])&&(s[0]=`react-i18next:: ${s[0]}`),(l=(a=t==null?void 0:t.services)==null?void 0:a.logger)!=null&&l.warn?t.services.logger.warn(...s):console!=null&&console.warn&&console.warn(...s)},Bb={},rv=(t,e,n,r)=>{uo(n)&&Bb[n]||(uo(n)&&(Bb[n]=new Date),fG(t,e,n,r))},M2=(t,e)=>()=>{if(t.isInitialized)e();else{const n=()=>{setTimeout(()=>{t.off("initialized",n)},0),e()};t.on("initialized",n)}},sv=(t,e,n)=>{t.loadNamespaces(e,M2(t,n))},zb=(t,e,n,r)=>{if(uo(n)&&(n=[n]),t.options.preload&&t.options.preload.indexOf(e)>-1)return sv(t,n,r);n.forEach(s=>{t.options.ns.indexOf(s)<0&&t.options.ns.push(s)}),t.loadLanguages(e,M2(t,r))},pG=(t,e,n={})=>!e.languages||!e.languages.length?(rv(e,"NO_LANGUAGES","i18n.languages were undefined or empty",{languages:e.languages}),!0):e.hasLoadedNamespace(t,{lng:n.lng,precheck:(r,s)=>{if(n.bindI18n&&n.bindI18n.indexOf("languageChanging")>-1&&r.services.backendConnector.backend&&r.isLanguageChangingTo&&!s(r.isLanguageChangingTo,t))return!1}}),uo=t=>typeof t=="string",mG=t=>typeof t=="object"&&t!==null,gG=/&(?:amp|#38|lt|#60|gt|#62|apos|#39|quot|#34|nbsp|#160|copy|#169|reg|#174|hellip|#8230|#x2F|#47);/g,yG={"&":"&","&":"&","<":"<","<":"<",">":">",">":">","'":"'","'":"'",""":'"',""":'"'," ":" "," ":" ","©":"©","©":"©","®":"®","®":"®","…":"…","…":"…","/":"/","/":"/"},vG=t=>yG[t],wG=t=>t.replace(gG,vG);let iv={bindI18n:"languageChanged",bindI18nStore:"",transEmptyNodeValue:"",transSupportBasicHtmlNodes:!0,transWrapTextNodes:"",transKeepBasicHtmlNodesFor:["br","strong","i","p"],useSuspense:!0,unescape:wG};const xG=(t={})=>{iv={...iv,...t}},_G=()=>iv;let V2;const EG=t=>{V2=t},TG=()=>V2,bG={type:"3rdParty",init(t){xG(t.options.react),EG(t)}},SG=b.createContext();class CG{constructor(){this.usedNamespaces={}}addUsedNamespaces(e){e.forEach(n=>{this.usedNamespaces[n]||(this.usedNamespaces[n]=!0)})}getUsedNamespaces(){return Object.keys(this.usedNamespaces)}}const IG=(t,e)=>{const n=b.useRef();return b.useEffect(()=>{n.current=t},[t,e]),n.current},j2=(t,e,n,r)=>t.getFixedT(e,n,r),PG=(t,e,n,r)=>b.useCallback(j2(t,e,n,r),[t,e,n,r]),AG=(t,e={})=>{var A,k,L,C;const{i18n:n}=e,{i18n:r,defaultNS:s}=b.useContext(SG)||{},i=n||r||TG();if(i&&!i.reportNamespaces&&(i.reportNamespaces=new CG),!i){rv(i,"NO_I18NEXT_INSTANCE","useTranslation: You will need to pass in an i18next instance by using initReactI18next");const S=(P,N)=>uo(N)?N:mG(N)&&uo(N.defaultValue)?N.defaultValue:Array.isArray(P)?P[P.length-1]:P,I=[S,{},!1];return I.t=S,I.i18n={},I.ready=!1,I}(A=i.options.react)!=null&&A.wait&&rv(i,"DEPRECATED_OPTION","useTranslation: It seems you are still using the old wait option, you may migrate to the new useSuspense behaviour.");const o={..._G(),...i.options.react,...e},{useSuspense:a,keyPrefix:l}=o;let u=s||((k=i.options)==null?void 0:k.defaultNS);u=uo(u)?[u]:u||["translation"],(C=(L=i.reportNamespaces).addUsedNamespaces)==null||C.call(L,u);const d=(i.isInitialized||i.initializedStoreOnce)&&u.every(S=>pG(S,i,o)),h=PG(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),f=()=>h,p=()=>j2(i,e.lng||null,o.nsMode==="fallback"?u:u[0],l),[g,w]=b.useState(f);let _=u.join();e.lng&&(_=`${e.lng}${_}`);const v=IG(_),x=b.useRef(!0);b.useEffect(()=>{const{bindI18n:S,bindI18nStore:I}=o;x.current=!0,!d&&!a&&(e.lng?zb(i,e.lng,u,()=>{x.current&&w(p)}):sv(i,u,()=>{x.current&&w(p)})),d&&v&&v!==_&&x.current&&w(p);const P=()=>{x.current&&w(p)};return S&&(i==null||i.on(S,P)),I&&(i==null||i.store.on(I,P)),()=>{x.current=!1,i&&S&&(S==null||S.split(" ").forEach(N=>i.off(N,P))),I&&i&&I.split(" ").forEach(N=>i.store.off(N,P))}},[i,_]),b.useEffect(()=>{x.current&&d&&w(f)},[i,l,d]);const T=[g,i,d];if(T.t=g,T.i18n=i,T.ready=d,d||!d&&!a)return T;throw new Promise(S=>{e.lng?zb(i,e.lng,u,()=>S()):sv(i,u,()=>S())})},RG=()=>{const[t,e]=b.useState("Tout"),{t:n}=AG(),{programs:r,filters:s}=hG(),i=t==="Tout"?r:r.filter(a=>a.category===t),o=i.slice(0,4);return y.jsx("section",{className:"py-16 bg-background",children:y.jsxs("div",{className:"container mx-auto px-4",children:[y.jsxs("div",{className:"text-center mb-12",children:[y.jsx("h2",{className:"text-4xl lg:text-5xl font-bold text-foreground mb-4",children:"Programmes populaires"}),y.jsx("p",{className:"text-muted-foreground text-lg max-w-2xl mx-auto mb-8",children:"Découvrez nos formations les plus demandées pour accélérer votre croissance"}),y.jsx("div",{className:"flex flex-wrap justify-center gap-3 mb-12",children:s.map(a=>y.jsx(xt,{variant:t===a?"default":"outline",onClick:()=>e(a),className:`rounded-full px-6 py-2 transition-all ${t===a?"bg-primary text-primary-foreground":"border-border hover:border-primary hover:text-primary"}`,children:a==="Tout"?"Tous les programmes":a},a))})]}),y.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:o.map(a=>y.jsxs(O2,{className:"group hover:shadow-xl transition-all duration-300 overflow-hidden border-border hover:border-primary/50 flex flex-col h-full bg-card",children:[y.jsxs("div",{className:"relative aspect-video overflow-hidden",children:[y.jsx("img",{src:(()=>{if(a.thumbnail)return a.thumbnail;if(a.video){const l=a.video.match(/(?:youtube\.com\/(?:[^/]+\/.+\/|(?:v|e(?:mbed)?)\/|.*[?&]v=)|youtu\.be\/)([^"&?/\s]{11})/);if(l&&l[1])return`https://img.youtube.com/vi/${l[1]}/maxresdefault.jpg`;if(a.video.includes("cloudinary.com"))return a.video.replace("/upload/","/upload/so_0,w_800,c_fill,f_jpg/")}return a.image||"https://images.unsplash.com/photo-1516321318423-f06f85e504b3?w=800&auto=format&fit=crop"})(),alt:a.title,className:"w-full h-full object-cover transition-transform duration-500 group-hover:scale-110"}),y.jsx(dG,{variant:"secondary",className:"absolute top-2 left-2 bg-white/90 text-primary hover:bg-white",children:a.category})]}),y.jsxs(L2,{className:"p-5 flex-1 flex flex-col",children:[y.jsx("h3",{className:"text-lg font-bold text-foreground mb-2 group-hover:text-primary transition-colors line-clamp-1",children:a.title}),y.jsxs("div",{className:"text-muted-foreground mb-4 text-xs leading-relaxed space-y-1 line-clamp-3",children:[(Array.isArray(a.description)?a.description[0]||"":a.description).split(` `)[0].replace("•","").trim(),"..."]}),y.jsx("div",{className:"flex items-center text-sm text-muted-foreground mb-4 gap-4",children:y.jsxs("span",{className:"flex items-center gap-1",children:[y.jsx(mV,{className:"w-4 h-4"}),a.duration," Heures"]})}),y.jsxs("div",{className:"mt-auto flex items-center justify-between pt-4 border-t border-border",children:[y.jsxs("div",{className:"flex flex-col",children:[y.jsx("span",{className:"text-xs text-muted-foreground",children:"Prix"}),y.jsxs("span",{className:"text-lg font-bold text-primary",children:[a.price," ",a.priceCurrency]})]}),y.jsx(vi,{to:`/programs/${a.id}`,children:y.jsxs(xt,{size:"sm",className:"gap-2",children:["Voir le programme",y.jsx(fP,{className:"w-4 h-4"})]})})]})]})]},a.id))}),i.length>4&&y.jsx("div",{className:"mt-12 text-center",children:y.jsx(vi,{to:"/programs",children:y.jsx(xt,{variant:"outline",size:"lg",className:"rounded-full px-8 border-primary text-primary hover:bg-primary hover:text-white transition-all duration-300",children:"Voir tous les programmes"})})})]})})},kG=()=>y.jsxs("div",{className:"min-h-screen bg-background",children:[y.jsx(E8,{}),y.jsx(aK,{}),y.jsx(iG,{}),y.jsx(RG,{}),y.jsx(_K,{}),y.jsx(EK,{}),y.jsx(rG,{}),y.jsx(sG,{}),y.jsx(wK,{})]}),NG=()=>{const t=Ri();return b.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",t.pathname)},[t.pathname]),y.jsx("div",{className:"min-h-screen flex items-center justify-center bg-gray-100",children:y.jsxs("div",{className:"text-center",children:[y.jsx("h1",{className:"text-4xl font-bold mb-4",children:"404"}),y.jsx("p",{className:"text-xl text-gray-600 mb-4",children:"Oops! Page not found"}),y.jsx("a",{href:"/",className:"text-blue-500 hover:text-blue-700 underline",children:"Return to Home"})]})})};var DG="Label",F2=b.forwardRef((t,e)=>y.jsx(Ut.label,{...t,ref:e,onMouseDown:n=>{var s;n.target.closest("button, input, select, textarea")||((s=t.onMouseDown)==null||s.call(t,n),!n.defaultPrevented&&n.detail>1&&n.preventDefault())}}));F2.displayName=DG;var U2=F2;const OG=$f("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70"),ov=b.forwardRef(({className:t,...e},n)=>y.jsx(U2,{ref:n,className:Ye(OG(),t),...e}));ov.displayName=U2.displayName;function LG(t){const e=b.useRef({value:t,previous:t});return b.useMemo(()=>(e.current.value!==t&&(e.current.previous=e.current.value,e.current.value=t),e.current.previous),[t])}var ix="Checkbox",[MG]=i0(ix),[VG,jG]=MG(ix),$2=b.forwardRef((t,e)=>{const{__scopeCheckbox:n,name:r,checked:s,defaultChecked:i,required:o,disabled:a,value:l="on",onCheckedChange:u,form:d,...h}=t,[f,p]=b.useState(null),g=Yn(e,A=>p(A)),w=b.useRef(!1),_=f?d||!!f.closest("form"):!0,[v=!1,x]=HI({prop:s,defaultProp:i,onChange:u}),T=b.useRef(v);return b.useEffect(()=>{const A=f==null?void 0:f.form;if(A){const k=()=>x(T.current);return A.addEventListener("reset",k),()=>A.removeEventListener("reset",k)}},[f,x]),y.jsxs(VG,{scope:n,state:v,disabled:a,children:[y.jsx(Ut.button,{type:"button",role:"checkbox","aria-checked":di(v)?"mixed":v,"aria-required":o,"data-state":H2(v),"data-disabled":a?"":void 0,disabled:a,value:l,...h,ref:g,onKeyDown:ft(t.onKeyDown,A=>{A.key==="Enter"&&A.preventDefault()}),onClick:ft(t.onClick,A=>{x(k=>di(k)?!0:!k),_&&(w.current=A.isPropagationStopped(),w.current||A.stopPropagation())})}),_&&y.jsx(FG,{control:f,bubbles:!w.current,name:r,value:l,checked:v,required:o,disabled:a,form:d,style:{transform:"translateX(-100%)"},defaultChecked:di(i)?!1:i})]})});$2.displayName=ix;var B2="CheckboxIndicator",z2=b.forwardRef((t,e)=>{const{__scopeCheckbox:n,forceMount:r,...s}=t,i=jG(B2,n);return y.jsx(Vf,{present:r||di(i.state)||i.state===!0,children:y.jsx(Ut.span,{"data-state":H2(i.state),"data-disabled":i.disabled?"":void 0,...s,ref:e,style:{pointerEvents:"none",...t.style}})})});z2.displayName=B2;var FG=t=>{const{control:e,checked:n,bubbles:r=!0,defaultChecked:s,...i}=t,o=b.useRef(null),a=LG(n),l=OP(e);b.useEffect(()=>{const d=o.current,h=window.HTMLInputElement.prototype,p=Object.getOwnPropertyDescriptor(h,"checked").set;if(a!==n&&p){const g=new Event("click",{bubbles:r});d.indeterminate=di(n),p.call(d,di(n)?!1:n),d.dispatchEvent(g)}},[a,n,r]);const u=b.useRef(di(n)?!1:n);return y.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??u.current,...i,tabIndex:-1,ref:o,style:{...t.style,...l,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function di(t){return t==="indeterminate"}function H2(t){return di(t)?"indeterminate":t?"checked":"unchecked"}var W2=$2,UG=z2;const q2=b.forwardRef(({className:t,...e},n)=>y.jsx(W2,{ref:n,className:Ye("peer h-4 w-4 shrink-0 rounded-sm border border-primary ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground",t),...e,children:y.jsx(UG,{className:Ye("flex items-center justify-center text-current"),children:y.jsx(hV,{className:"h-4 w-4"})})}));q2.displayName=W2.displayName;const $G=()=>{const[t,e]=b.useState(""),[n,r]=b.useState(""),[s,i]=b.useState(!1),[o,a]=b.useState(!1),[l,u]=b.useState(!1),d=Xf(),{signInWithGoogle:h,signInWithEmail:f}=vp(),{toast:p}=MI(),g=async _=>{_.preventDefault(),u(!0);try{await f(t,n),p({title:"Connexion réussie",description:"Bienvenue sur la plateforme LDN"}),d("/dashboard")}catch(v){p({variant:"destructive",title:"Erreur de connexion",description:v.message||"Email ou mot de passe incorrect"})}finally{u(!1)}},w=async()=>{u(!0);try{await h(),p({title:"Connexion réussie",description:"Bienvenue sur la plateforme LDN"}),d("/dashboard")}catch(_){p({variant:"destructive",title:"Erreur de connexion",description:_.message||"Impossible de se connecter avec Google"})}finally{u(!1)}};return y.jsxs("div",{className:"min-h-screen flex",children:[y.jsxs("div",{className:"hidden lg:flex lg:w-2/5 bg-gradient-to-br from-[#003366] via-[#004080] to-[#0066cc] relative overflow-hidden",children:[y.jsxs("div",{className:"absolute inset-0 opacity-10",children:[y.jsx("div",{className:"absolute top-20 left-10 w-40 h-40 border-4 border-[#00bfff] rotate-45"}),y.jsx("div",{className:"absolute top-40 left-32 w-32 h-32 border-4 border-[#00bfff] rotate-45"}),y.jsx("div",{className:"absolute top-60 left-20 w-36 h-36 border-4 border-[#00bfff] rotate-45"}),y.jsx("div",{className:"absolute bottom-20 left-24 w-44 h-44 border-4 border-[#00bfff] rotate-45"})]}),y.jsxs("div",{className:"relative z-10 flex flex-col justify-center px-16 text-white",children:[y.jsx("div",{className:"mb-12",children:y.jsx("img",{src:"/assets/images/logo-ldn-blanc.png",alt:"Des Nations Logo Blanc",className:"h-32 w-auto mb-8"})}),y.jsx("h1",{className:"text-4xl font-bold mb-6",children:"Portail d'Admission LDN"}),y.jsxs("div",{className:"space-y-6",children:[y.jsx("h2",{className:"text-2xl font-semibold",children:"Bon retour !"}),y.jsx("p",{className:"text-lg text-gray-200 leading-relaxed",children:"Voici le portail d'admission LDN, votre première étape vers la découverte de votre destinée et rejoindre notre communauté de leaders spirituels engagés."}),y.jsx("p",{className:"text-lg text-gray-200 leading-relaxed",children:"Si vous avez déjà un compte, connectez-vous en entrant votre email et votre mot de passe ou via Google."}),y.jsx("p",{className:"text-lg text-gray-200 leading-relaxed",children:`Si c'est votre première fois sur le portail d'admission, veuillez descendre et cliquer sur le bouton "S'inscrire" pour créer votre compte.`})]})]})]}),y.jsx("div",{className:"w-full lg:w-3/5 flex items-center justify-center p-8 bg-gray-50",children:y.jsxs("div",{className:"w-full max-w-md space-y-8",children:[y.jsx("div",{className:"lg:hidden flex justify-center mb-8",children:y.jsx("img",{src:"/assets/images/logo-ldn.png",alt:"Des Nations Logo",className:"h-20 w-auto"})}),y.jsx("div",{className:"text-center",children:y.jsx("h2",{className:"text-3xl font-bold text-gray-900",children:"Connectez-vous à votre compte"})}),y.jsxs("div",{className:"bg-white rounded-xl shadow-lg p-8 space-y-6",children:[y.jsxs(xt,{onClick:w,disabled:l,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 text-base flex items-center justify-center gap-3",children:[y.jsxs("svg",{className:"w-5 h-5",viewBox:"0 0 24 24",children:[y.jsx("path",{fill:"currentColor",d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z"}),y.jsx("path",{fill:"currentColor",d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z"}),y.jsx("path",{fill:"currentColor",d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z"}),y.jsx("path",{fill:"currentColor",d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z"})]}),"Google"]}),y.jsxs("div",{className:"relative",children:[y.jsx("div",{className:"absolute inset-0 flex items-center",children:y.jsx("div",{className:"w-full border-t border-gray-300"})}),y.jsx("div",{className:"relative flex justify-center text-sm",children:y.jsx("span",{className:"px-4 bg-white text-gray-500",children:"Ou continuez avec"})})]}),y.jsxs("form",{onSubmit:g,className:"space-y-5",children:[y.jsxs("div",{children:[y.jsx(ov,{htmlFor:"email",className:"text-sm font-medium text-gray-700",children:"Email"}),y.jsx(pf,{id:"email",type:"email",value:t,onChange:_=>e(_.target.value),required:!0,className:"mt-2 h-12 border-2 border-gray-300 focus:border-blue-500",placeholder:"votre.email@exemple.com"})]}),y.jsxs("div",{children:[y.jsx(ov,{htmlFor:"password",className:"text-sm font-medium text-gray-700",children:"Mot de passe"}),y.jsxs("div",{className:"relative mt-2",children:[y.jsx(pf,{id:"password",type:o?"text":"password",value:n,onChange:_=>r(_.target.value),required:!0,className:"h-12 border-2 border-gray-300 focus:border-blue-500 pr-12",placeholder:"••••••••"}),y.jsx("button",{type:"button",onClick:()=>a(!o),className:"absolute right-3 top-1/2 -translate-y-1/2 text-gray-500 hover:text-gray-700",children:o?y.jsx(gV,{className:"h-5 w-5"}):y.jsx(yV,{className:"h-5 w-5"})})]})]}),y.jsxs("div",{className:"flex items-center justify-between",children:[y.jsxs("div",{className:"flex items-center space-x-2",children:[y.jsx(q2,{id:"remember",checked:s,onCheckedChange:_=>i(_)}),y.jsx("label",{htmlFor:"remember",className:"text-sm text-gray-700 cursor-pointer",children:"Se souvenir de moi"})]}),y.jsx(vi,{to:"/forgot-password",className:"text-sm text-blue-600 hover:text-blue-700 font-medium",children:"Mot de passe oublié ?"})]}),y.jsx(xt,{type:"submit",disabled:l,className:"w-full bg-blue-600 hover:bg-blue-700 text-white py-6 text-base font-medium",children:l?"Connexion...":"Se connecter"})]}),y.jsxs("div",{className:"text-center space-y-3 pt-4",children:[y.jsx("button",{className:"text-sm text-gray-600 hover:text-gray-800",children:"Renvoyer les instructions de confirmation par email"}),y.jsx("button",{className:"block w-full text-sm text-gray-600 hover:text-gray-800",children:"Envoyer les instructions de déverrouillage"})]})]}),y.jsxs("div",{className:"text-center text-gray-600",children:["Pas encore de compte ?"," ",y.jsx(vi,{to:"/pathways/complet",className:"text-blue-600 hover:text-blue-700 font-medium",children:"S'inscrire"})]})]})})]})},BG=[{title:"PRINCIPAL",items:[{title:"Tableau de bord",url:"/dashboard",icon:pP},{title:"Mes Cours",url:"/my-courses",icon:dV},{title:"Levels",url:"/levels",icon:xV}]},{title:"APPRENTISSAGE",items:[{title:"Evaluations",url:"/evaluations",icon:vV},{title:"Certifications",url:"/certificates",icon:cV}]},{title:"COMMUNAUTÉ",items:[{title:"Communauté",url:"/communaute-intranet",icon:PV},{title:"Blog et Resources",url:"/a-propos-intranet",icon:TV}]}];function zG({isCollapsed:t,isMobileOpen:e,onToggle:n,onMobileToggle:r}){const{user:s,logout:i}=vp();return y.jsxs(y.Fragment,{children:[e&&y.jsx("div",{className:"lg:hidden fixed inset-0 bg-black bg-opacity-50 z-40",onClick:r}),y.jsxs("aside",{className:` fixed lg:relative h-screen bg-white border-r flex flex-col transition-all duration-300 z-50 ${t?"w-20":"w-64"} ${e?"translate-x-0":"-translate-x-full lg:translate-x-0"} `,children:[y.jsx("div",{className:"flex-shrink-0 p-2 border-b flex justify-between items-center",children:y.jsxs("div",{className:"flex items-center gap-2",children:[y.jsx("button",{onClick:n,className:"p-2 hover:bg-gray-100 rounded-md transition-colors hidden lg:block","aria-label":"Toggle sidebar",children:y.jsx(c0,{className:"w-8 h-8 text-gray-700"})}),y.jsx("button",{onClick:r,className:"p-2 hover:bg-gray-100 rounded-md transition-colors lg:hidden","aria-label":"Fermer le menu",children:y.jsx(d0,{className:"w-6 h-6 text-gray-700"})}),!t&&y.jsx("img",{src:"/assets/images/logo-ldn.png",alt:"LDN Logo",className:"h-16 w-auto object-contain"})]})}),y.jsx("div",{className:"flex-1 overflow-y-auto py-4",children:BG.map(o=>y.jsxs("div",{className:"mb-6",children:[!t&&y.jsx("div",{className:"px-4 mb-2",children:y.jsx("h3",{className:"text-xs font-semibold text-gray-500 uppercase tracking-wider",children:o.title})}),y.jsx("nav",{className:"space-y-1 px-2",children:o.items.map(a=>y.jsxs(jE,{to:a.url,title:t?a.title:void 0,onClick:r,className:({isActive:l})=>`flex items-center gap-3 px-3 py-2.5 rounded-lg transition-colors ${l?"text-blue-600 bg-blue-50":"text-gray-700 hover:bg-gray-100"} ${t?"justify-center":""}`,children:[y.jsx(a.icon,{className:"w-5 h-5 flex-shrink-0"}),!t&&y.jsx("span",{className:"text-sm font-medium",children:a.title})]},a.title))})]},o.title))}),y.jsxs("div",{className:"flex-shrink-0 p-4 border-t bg-white",children:[y.jsxs("div",{className:`flex items-center gap-3 mb-3 ${t?"justify-center":""}`,children:[y.jsx("img",{src:(s==null?void 0:s.photoURL)||"/placeholder.svg",alt:"Profile",className:"w-10 h-10 rounded-full object-cover flex-shrink-0"}),!t&&y.jsxs("div",{className:"flex-1 min-w-0",children:[y.jsx("p",{className:"text-sm font-medium text-gray-900 truncate",children:(s==null?void 0:s.displayName)||"Apprenant"}),y.jsx("p",{className:"text-xs text-gray-500 truncate",children:s==null?void 0:s.email})]})]}),!t&&y.jsxs("div",{className:"space-y-1",children:[y.jsx(jE,{to:"/account-settings",onClick:r,children:y.jsxs(xt,{variant:"ghost",size:"sm",className:"w-full justify-start gap-2",children:[y.jsx(CV,{className:"w-4 h-4 flex-shrink-0"}),y.jsx("span",{children:"Parametres"})]})}),y.jsxs(xt,{onClick:()=>{i(),r()},variant:"ghost",size:"sm",className:"w-full justify-start gap-2 text-red-600 hover:bg-red-50",children:[y.jsx(EV,{className:"w-4 h-4 flex-shrink-0"}),y.jsx("span",{children:"Se Deconnecter"})]})]})]})]})]})}function er({children:t}){const{user:e,loading:n}=vp(),[r,s]=b.useState(!1),[i,o]=b.useState(!1);return n?y.jsx("div",{className:"min-h-screen flex items-center justify-center",children:y.jsx("div",{className:"h-32 w-32 rounded-full border-4 border-primary/80 border-t-transparent animate-spin"})}):e?y.jsxs("div",{className:"flex h-screen overflow-hidden bg-gray-50",children:[y.jsx(zG,{isCollapsed:r,isMobileOpen:i,onToggle:()=>s(!r),onMobileToggle:()=>o(!i)}),y.jsxs("main",{className:"flex-1",children:[y.jsxs("div",{className:"lg:hidden p-2 border-b bg-white flex items-center justify-start",children:[y.jsx("button",{onClick:()=>o(!0),className:"p-2 hover:bg-gray-100 rounded-md transition-colors","aria-label":"Ouvrir le menu",children:y.jsx(c0,{className:"w-8 h-8 text-gray-700"})}),y.jsx("img",{src:"/assets/images/logo-ldn.png",alt:"LDN Logo",className:"h-14 w-auto object-contain"}),y.jsx("div",{className:"w-10"})]}),t]})]}):y.jsx(A3,{to:"/",replace:!0})}const HG=b.lazy(()=>Le(()=>import("./SignUp-Dc99vJqB.js"),__vite__mapDeps([0,1]))),WG=b.lazy(()=>Le(()=>import("./ForgotPassword-PfmZoKit.js"),[])),qG=b.lazy(()=>Le(()=>import("./PrivacyPolicy-CjXe44_n.js"),[])),KG=b.lazy(()=>Le(()=>import("./PathwaySelection-gaCzt6_M.js"),__vite__mapDeps([2,3]))),GG=b.lazy(()=>Le(()=>import("./PathwayDetails-CEpcSELs.js"),__vite__mapDeps([4,5,3,6]))),QG=b.lazy(()=>Le(()=>import("./Payment-ZpLrvoBf.js"),__vite__mapDeps([7,8,9,3,10]))),YG=b.lazy(()=>Le(()=>import("./Community-BYN7kkqt.js"),__vite__mapDeps([11,12,6]))),XG=b.lazy(()=>Le(()=>import("./Programs-CEBVV2Om.js"),[])),JG=b.lazy(()=>Le(()=>import("./ProgramDetails-BE517FHa.js"),__vite__mapDeps([13,14,15,8,10,3,5]))),ZG=b.lazy(()=>Le(()=>import("./ModuleContent-C8GzAdJU.js"),__vite__mapDeps([16,14,3,17,5]))),eQ=b.lazy(()=>Le(()=>import("./PathwayComplet-y2_QjSka.js"),__vite__mapDeps([18,19,8,9,15,10,3,12,20]))),tQ=b.lazy(()=>Le(()=>import("./PathwayAlacarte-DmPOzuy9.js"),__vite__mapDeps([21,19,8,9,22]))),nQ=b.lazy(()=>Le(()=>import("./PathwayPersonnalise-DyGr8C7H.js"),__vite__mapDeps([23,19,8,9]))),rQ=b.lazy(()=>Le(()=>import("./About-Dpx79Ouc.js"),__vite__mapDeps([24,3,5]))),sQ=b.lazy(()=>Le(()=>import("./CompletePathwayEnrollment-BfXrXKGh.js"),__vite__mapDeps([25,3,12]))),iQ=b.lazy(()=>Le(()=>import("./Pathways-iwyfzig8.js"),[])),oQ=b.lazy(()=>Le(()=>import("./Dashboard-DK4n7rTR.js"),__vite__mapDeps([26,27]))),aQ=b.lazy(()=>Le(()=>import("./MyCourses-ClxXa9t8.js"),__vite__mapDeps([28,27]))),lQ=b.lazy(()=>Le(()=>import("./Levels-Cq9GhKWn.js"),__vite__mapDeps([29,27,30,31]))),uQ=b.lazy(()=>Le(()=>import("./Level1-PgFxX1uQ.js"),__vite__mapDeps([32,27,30]))),cQ=b.lazy(()=>Le(()=>import("./Level2-HBf77q5S.js"),__vite__mapDeps([33,27,31]))),dQ=b.lazy(()=>Le(()=>import("./Level3-OBlH6L7Y.js"),__vite__mapDeps([34,27,31]))),hQ=b.lazy(()=>Le(()=>import("./Evaluations-8kG04Q7b.js"),__vite__mapDeps([35,27,20,30]))),fQ=b.lazy(()=>Le(()=>import("./AccountSettings-Dr5bKvCu.js"),__vite__mapDeps([36,37]))),pQ=b.lazy(()=>Le(()=>import("./Certificates-uXo9iWUY.js"),__vite__mapDeps([38,30,12,17,39]))),mQ=b.lazy(()=>Le(()=>import("./AboutIntranet-DatD_yya.js"),__vite__mapDeps([40,41,22,12]))),gQ=b.lazy(()=>Le(()=>import("./CommunityIntranet-BksoYZob.js"),__vite__mapDeps([42,37,6,12,41,39]))),yQ=b.lazy(()=>Le(()=>import("./DataSeeder-BpatJO4O.js"),[])),vQ=y8(),wQ=()=>y.jsx(x8,{fullScreen:!0,message:"Chargement de la page..."}),xQ=()=>y.jsx(w8,{children:y.jsx(dM,{children:y.jsxs($F,{client:vQ,children:[y.jsx(dF,{children:y.jsxs(p8,{children:[y.jsx(cj,{}),y.jsx(Fj,{}),y.jsxs(F3,{children:[y.jsx(_8,{}),y.jsx(b.Suspense,{fallback:y.jsx(wQ,{}),children:y.jsxs(k3,{children:[y.jsx(Ie,{path:"/admin/seed",element:y.jsx(yQ,{})}),y.jsx(Ie,{path:"/",element:y.jsx(kG,{})}),y.jsx(Ie,{path:"/login",element:y.jsx($G,{})}),y.jsx(Ie,{path:"/signup",element:y.jsx(HG,{})}),y.jsx(Ie,{path:"/forgot-password",element:y.jsx(WG,{})}),y.jsx(Ie,{path:"/privacy-policy",element:y.jsx(qG,{})}),y.jsx(Ie,{path:"/onboarding/pathway-selection",element:y.jsx(KG,{})}),y.jsx(Ie,{path:"/onboarding/pathway-details/:pathwayId",element:y.jsx(GG,{})}),y.jsx(Ie,{path:"/onboarding/payment/:pathwayId",element:y.jsx(QG,{})}),y.jsx(Ie,{path:"/dashboard",element:y.jsx(er,{children:y.jsx(oQ,{})})}),y.jsx(Ie,{path:"/my-courses",element:y.jsx(er,{children:y.jsx(aQ,{})})}),y.jsx(Ie,{path:"/levels",element:y.jsx(er,{children:y.jsx(lQ,{})})}),y.jsx(Ie,{path:"/level-1",element:y.jsx(er,{children:y.jsx(uQ,{})})}),y.jsx(Ie,{path:"/level-2",element:y.jsx(er,{children:y.jsx(cQ,{})})}),y.jsx(Ie,{path:"/level-3",element:y.jsx(er,{children:y.jsx(dQ,{})})}),y.jsx(Ie,{path:"/evaluations",element:y.jsx(er,{children:y.jsx(hQ,{})})}),y.jsx(Ie,{path:"/certificates",element:y.jsx(er,{children:y.jsx(pQ,{})})}),y.jsx(Ie,{path:"/account-settings",element:y.jsx(er,{children:y.jsx(fQ,{})})}),y.jsx(Ie,{path:"/about-intranet",element:y.jsx(er,{children:y.jsx(mQ,{})})}),y.jsx(Ie,{path:"/community-intranet",element:y.jsx(er,{children:y.jsx(gQ,{})})}),y.jsx(Ie,{path:"/about",element:y.jsx(rQ,{})}),y.jsx(Ie,{path:"/community",element:y.jsx(YG,{})}),y.jsx(Ie,{path:"/programs",element:y.jsx(XG,{})}),y.jsx(Ie,{path:"/programs/:programId",element:y.jsx(JG,{})}),y.jsx(Ie,{path:"/module/:moduleId/content",element:y.jsx(ZG,{})}),y.jsx(Ie,{path:"/pathways",element:y.jsx(iQ,{})}),y.jsx(Ie,{path:"/pathways/complet",element:y.jsx(eQ,{})}),y.jsx(Ie,{path:"/pathways/alacarte",element:y.jsx(tQ,{})}),y.jsx(Ie,{path:"/pathways/personnalise",element:y.jsx(nQ,{})}),y.jsx(Ie,{path:"/pathways/complete-enrollment",element:y.jsx(sQ,{})}),y.jsx(Ie,{path:"*",element:y.jsx(NG,{})})]})})]})]})}),y.jsx(BF,{initialIsOpen:!1})]})})}),ce=t=>typeof t=="string",Ol=()=>{let t,e;const n=new Promise((r,s)=>{t=r,e=s});return n.resolve=t,n.reject=e,n},Hb=t=>t==null?"":""+t,_Q=(t,e,n)=>{t.forEach(r=>{e[r]&&(n[r]=e[r])})},EQ=/###/g,Wb=t=>t&&t.indexOf("###")>-1?t.replace(EQ,"."):t,qb=t=>!t||ce(t),gu=(t,e,n)=>{const r=ce(e)?e.split("."):e;let s=0;for(;s{const{obj:r,k:s}=gu(t,e,Object);if(r!==void 0||e.length===1){r[s]=n;return}let i=e[e.length-1],o=e.slice(0,e.length-1),a=gu(t,o,Object);for(;a.obj===void 0&&o.length;)i=`${o[o.length-1]}.${i}`,o=o.slice(0,o.length-1),a=gu(t,o,Object),a!=null&&a.obj&&typeof a.obj[`${a.k}.${i}`]<"u"&&(a.obj=void 0);a.obj[`${a.k}.${i}`]=n},TQ=(t,e,n,r)=>{const{obj:s,k:i}=gu(t,e,Object);s[i]=s[i]||[],s[i].push(n)},vf=(t,e)=>{const{obj:n,k:r}=gu(t,e);if(n&&Object.prototype.hasOwnProperty.call(n,r))return n[r]},bQ=(t,e,n)=>{const r=vf(t,n);return r!==void 0?r:vf(e,n)},K2=(t,e,n)=>{for(const r in e)r!=="__proto__"&&r!=="constructor"&&(r in t?ce(t[r])||t[r]instanceof String||ce(e[r])||e[r]instanceof String?n&&(t[r]=e[r]):K2(t[r],e[r],n):t[r]=e[r]);return t},Lo=t=>t.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g,"\\$&");var SQ={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};const CQ=t=>ce(t)?t.replace(/[&<>"'\/]/g,e=>SQ[e]):t;class IQ{constructor(e){this.capacity=e,this.regExpMap=new Map,this.regExpQueue=[]}getRegExp(e){const n=this.regExpMap.get(e);if(n!==void 0)return n;const r=new RegExp(e);return this.regExpQueue.length===this.capacity&&this.regExpMap.delete(this.regExpQueue.shift()),this.regExpMap.set(e,r),this.regExpQueue.push(e),r}}const PQ=[" ",",","?","!",";"],AQ=new IQ(20),RQ=(t,e,n)=>{e=e||"",n=n||"";const r=PQ.filter(o=>e.indexOf(o)<0&&n.indexOf(o)<0);if(r.length===0)return!0;const s=AQ.getRegExp(`(${r.map(o=>o==="?"?"\\?":o).join("|")})`);let i=!s.test(t);if(!i){const o=t.indexOf(n);o>0&&!s.test(t.substring(0,o))&&(i=!0)}return i},av=(t,e,n=".")=>{if(!t)return;if(t[e])return Object.prototype.hasOwnProperty.call(t,e)?t[e]:void 0;const r=e.split(n);let s=t;for(let i=0;i-1&&lt==null?void 0:t.replace("_","-"),kQ={type:"logger",log(t){this.output("log",t)},warn(t){this.output("warn",t)},error(t){this.output("error",t)},output(t,e){var n,r;(r=(n=console==null?void 0:console[t])==null?void 0:n.apply)==null||r.call(n,console,e)}};class wf{constructor(e,n={}){this.init(e,n)}init(e,n={}){this.prefix=n.prefix||"i18next:",this.logger=e||kQ,this.options=n,this.debug=n.debug}log(...e){return this.forward(e,"log","",!0)}warn(...e){return this.forward(e,"warn","",!0)}error(...e){return this.forward(e,"error","")}deprecate(...e){return this.forward(e,"warn","WARNING DEPRECATED: ",!0)}forward(e,n,r,s){return s&&!this.debug?null:(ce(e[0])&&(e[0]=`${r}${this.prefix} ${e[0]}`),this.logger[n](e))}create(e){return new wf(this.logger,{prefix:`${this.prefix}:${e}:`,...this.options})}clone(e){return e=e||this.options,e.prefix=e.prefix||this.prefix,new wf(this.logger,e)}}var Ar=new wf;class Cp{constructor(){this.observers={}}on(e,n){return e.split(" ").forEach(r=>{this.observers[r]||(this.observers[r]=new Map);const s=this.observers[r].get(n)||0;this.observers[r].set(n,s+1)}),this}off(e,n){if(this.observers[e]){if(!n){delete this.observers[e];return}this.observers[e].delete(n)}}emit(e,...n){this.observers[e]&&Array.from(this.observers[e].entries()).forEach(([s,i])=>{for(let o=0;o{for(let o=0;o-1&&this.options.ns.splice(n,1)}getResource(e,n,r,s={}){var u,d;const i=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,o=s.ignoreJSONStructure!==void 0?s.ignoreJSONStructure:this.options.ignoreJSONStructure;let a;e.indexOf(".")>-1?a=e.split("."):(a=[e,n],r&&(Array.isArray(r)?a.push(...r):ce(r)&&i?a.push(...r.split(i)):a.push(r)));const l=vf(this.data,a);return!l&&!n&&!r&&e.indexOf(".")>-1&&(e=a[0],n=a[1],r=a.slice(2).join(".")),l||!o||!ce(r)?l:av((d=(u=this.data)==null?void 0:u[e])==null?void 0:d[n],r,i)}addResource(e,n,r,s,i={silent:!1}){const o=i.keySeparator!==void 0?i.keySeparator:this.options.keySeparator;let a=[e,n];r&&(a=a.concat(o?r.split(o):r)),e.indexOf(".")>-1&&(a=e.split("."),s=n,n=a[1]),this.addNamespaces(n),Kb(this.data,a,s),i.silent||this.emit("added",e,n,r,s)}addResources(e,n,r,s={silent:!1}){for(const i in r)(ce(r[i])||Array.isArray(r[i]))&&this.addResource(e,n,i,r[i],{silent:!0});s.silent||this.emit("added",e,n,r)}addResourceBundle(e,n,r,s,i,o={silent:!1,skipCopy:!1}){let a=[e,n];e.indexOf(".")>-1&&(a=e.split("."),s=r,r=n,n=a[1]),this.addNamespaces(n);let l=vf(this.data,a)||{};o.skipCopy||(r=JSON.parse(JSON.stringify(r))),s?K2(l,r,i):l={...l,...r},Kb(this.data,a,l),o.silent||this.emit("added",e,n,r)}removeResourceBundle(e,n){this.hasResourceBundle(e,n)&&delete this.data[e][n],this.removeNamespaces(n),this.emit("removed",e,n)}hasResourceBundle(e,n){return this.getResource(e,n)!==void 0}getResourceBundle(e,n){return n||(n=this.options.defaultNS),this.getResource(e,n)}getDataByLanguage(e){return this.data[e]}hasLanguageSomeTranslations(e){const n=this.getDataByLanguage(e);return!!(n&&Object.keys(n)||[]).find(s=>n[s]&&Object.keys(n[s]).length>0)}toJSON(){return this.data}}var G2={processors:{},addPostProcessor(t){this.processors[t.name]=t},handle(t,e,n,r,s){return t.forEach(i=>{var o;e=((o=this.processors[i])==null?void 0:o.process(e,n,r,s))??e}),e}};const Q2=Symbol("i18next/PATH_KEY");function NQ(){const t=[],e=Object.create(null);let n;return e.get=(r,s)=>{var i;return(i=n==null?void 0:n.revoke)==null||i.call(n),s===Q2?t:(t.push(s),n=Proxy.revocable(r,e),n.proxy)},Proxy.revocable(Object.create(null),e).proxy}function lv(t,e){const{[Q2]:n}=t(NQ());return n.join((e==null?void 0:e.keySeparator)??".")}const Qb={},Yb=t=>!ce(t)&&typeof t!="boolean"&&typeof t!="number";class xf extends Cp{constructor(e,n={}){super(),_Q(["resourceStore","languageUtils","pluralResolver","interpolator","backendConnector","i18nFormat","utils"],e,this),this.options=n,this.options.keySeparator===void 0&&(this.options.keySeparator="."),this.logger=Ar.create("translator")}changeLanguage(e){e&&(this.language=e)}exists(e,n={interpolation:{}}){const r={...n};if(e==null)return!1;const s=this.resolve(e,r);return(s==null?void 0:s.res)!==void 0}extractFromKey(e,n){let r=n.nsSeparator!==void 0?n.nsSeparator:this.options.nsSeparator;r===void 0&&(r=":");const s=n.keySeparator!==void 0?n.keySeparator:this.options.keySeparator;let i=n.ns||this.options.defaultNS||[];const o=r&&e.indexOf(r)>-1,a=!this.options.userDefinedKeySeparator&&!n.keySeparator&&!this.options.userDefinedNsSeparator&&!n.nsSeparator&&!RQ(e,r,s);if(o&&!a){const l=e.match(this.interpolator.nestingRegexp);if(l&&l.length>0)return{key:e,namespaces:ce(i)?[i]:i};const u=e.split(r);(r!==s||r===s&&this.options.ns.indexOf(u[0])>-1)&&(i=u.shift()),e=u.join(s)}return{key:e,namespaces:ce(i)?[i]:i}}translate(e,n,r){let s=typeof n=="object"?{...n}:n;if(typeof s!="object"&&this.options.overloadTranslationOptionHandler&&(s=this.options.overloadTranslationOptionHandler(arguments)),typeof s=="object"&&(s={...s}),s||(s={}),e==null)return"";typeof e=="function"&&(e=lv(e,{...this.options,...s})),Array.isArray(e)||(e=[String(e)]);const i=s.returnDetails!==void 0?s.returnDetails:this.options.returnDetails,o=s.keySeparator!==void 0?s.keySeparator:this.options.keySeparator,{key:a,namespaces:l}=this.extractFromKey(e[e.length-1],s),u=l[l.length-1];let d=s.nsSeparator!==void 0?s.nsSeparator:this.options.nsSeparator;d===void 0&&(d=":");const h=s.lng||this.language,f=s.appendNamespaceToCIMode||this.options.appendNamespaceToCIMode;if((h==null?void 0:h.toLowerCase())==="cimode")return f?i?{res:`${u}${d}${a}`,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:`${u}${d}${a}`:i?{res:a,usedKey:a,exactUsedKey:a,usedLng:h,usedNS:u,usedParams:this.getUsedParamsDetails(s)}:a;const p=this.resolve(e,s);let g=p==null?void 0:p.res;const w=(p==null?void 0:p.usedKey)||a,_=(p==null?void 0:p.exactUsedKey)||a,v=["[object Number]","[object Function]","[object RegExp]"],x=s.joinArrays!==void 0?s.joinArrays:this.options.joinArrays,T=!this.i18nFormat||this.i18nFormat.handleAsObject,A=s.count!==void 0&&!ce(s.count),k=xf.hasDefaultValue(s),L=A?this.pluralResolver.getSuffix(h,s.count,s):"",C=s.ordinal&&A?this.pluralResolver.getSuffix(h,s.count,{ordinal:!1}):"",S=A&&!s.ordinal&&s.count===0,I=S&&s[`defaultValue${this.options.pluralSeparator}zero`]||s[`defaultValue${L}`]||s[`defaultValue${C}`]||s.defaultValue;let P=g;T&&!g&&k&&(P=I);const N=Yb(P),O=Object.prototype.toString.apply(P);if(T&&P&&N&&v.indexOf(O)<0&&!(ce(x)&&Array.isArray(P))){if(!s.returnObjects&&!this.options.returnObjects){this.options.returnedObjectHandler||this.logger.warn("accessing an object - but returnObjects options is not enabled!");const D=this.options.returnedObjectHandler?this.options.returnedObjectHandler(w,P,{...s,ns:l}):`key '${a} (${this.language})' returned an object instead of string.`;return i?(p.res=D,p.usedParams=this.getUsedParamsDetails(s),p):D}if(o){const D=Array.isArray(P),z=D?[]:{},re=D?_:w;for(const X in P)if(Object.prototype.hasOwnProperty.call(P,X)){const G=`${re}${o}${X}`;k&&!g?z[X]=this.translate(G,{...s,defaultValue:Yb(I)?I[X]:void 0,joinArrays:!1,ns:l}):z[X]=this.translate(G,{...s,joinArrays:!1,ns:l}),z[X]===G&&(z[X]=P[X])}g=z}}else if(T&&ce(x)&&Array.isArray(g))g=g.join(x),g&&(g=this.extendTranslation(g,e,s,r));else{let D=!1,z=!1;!this.isValidLookup(g)&&k&&(D=!0,g=I),this.isValidLookup(g)||(z=!0,g=a);const X=(s.missingKeyNoValueFallbackToKey||this.options.missingKeyNoValueFallbackToKey)&&z?void 0:g,G=k&&I!==g&&this.options.updateMissing;if(z||D||G){if(this.logger.log(G?"updateKey":"missingKey",h,u,a,G?I:g),o){const H=this.resolve(a,{...s,keySeparator:!1});H&&H.res&&this.logger.warn("Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.")}let M=[];const B=this.languageUtils.getFallbackCodes(this.options.fallbackLng,s.lng||this.language);if(this.options.saveMissingTo==="fallback"&&B&&B[0])for(let H=0;H{var Oe;const me=k&&te!==g?te:X;this.options.missingKeyHandler?this.options.missingKeyHandler(H,u,Y,me,G,s):(Oe=this.backendConnector)!=null&&Oe.saveMissing&&this.backendConnector.saveMissing(H,u,Y,me,G,s),this.emit("missingKey",H,u,Y,g)};this.options.saveMissing&&(this.options.saveMissingPlurals&&A?M.forEach(H=>{const Y=this.pluralResolver.getSuffixes(H,s);S&&s[`defaultValue${this.options.pluralSeparator}zero`]&&Y.indexOf(`${this.options.pluralSeparator}zero`)<0&&Y.push(`${this.options.pluralSeparator}zero`),Y.forEach(te=>{Q([H],a+te,s[`defaultValue${te}`]||I)})}):Q(M,a,I))}g=this.extendTranslation(g,e,s,p,r),z&&g===a&&this.options.appendNamespaceToMissingKey&&(g=`${u}${d}${a}`),(z||D)&&this.options.parseMissingKeyHandler&&(g=this.options.parseMissingKeyHandler(this.options.appendNamespaceToMissingKey?`${u}${d}${a}`:a,D?g:void 0,s))}return i?(p.res=g,p.usedParams=this.getUsedParamsDetails(s),p):g}extendTranslation(e,n,r,s,i){var l,u;if((l=this.i18nFormat)!=null&&l.parse)e=this.i18nFormat.parse(e,{...this.options.interpolation.defaultVariables,...r},r.lng||this.language||s.usedLng,s.usedNS,s.usedKey,{resolved:s});else if(!r.skipInterpolation){r.interpolation&&this.interpolator.init({...r,interpolation:{...this.options.interpolation,...r.interpolation}});const d=ce(e)&&(((u=r==null?void 0:r.interpolation)==null?void 0:u.skipOnVariables)!==void 0?r.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables);let h;if(d){const p=e.match(this.interpolator.nestingRegexp);h=p&&p.length}let f=r.replace&&!ce(r.replace)?r.replace:r;if(this.options.interpolation.defaultVariables&&(f={...this.options.interpolation.defaultVariables,...f}),e=this.interpolator.interpolate(e,f,r.lng||this.language||s.usedLng,r),d){const p=e.match(this.interpolator.nestingRegexp),g=p&&p.length;h(i==null?void 0:i[0])===p[0]&&!r.context?(this.logger.warn(`It seems you are nesting recursively key: ${p[0]} in key: ${n[0]}`),null):this.translate(...p,n),r)),r.interpolation&&this.interpolator.reset()}const o=r.postProcess||this.options.postProcess,a=ce(o)?[o]:o;return e!=null&&(a!=null&&a.length)&&r.applyPostProcessor!==!1&&(e=G2.handle(a,e,n,this.options&&this.options.postProcessPassResolved?{i18nResolved:{...s,usedParams:this.getUsedParamsDetails(r)},...r}:r,this)),e}resolve(e,n={}){let r,s,i,o,a;return ce(e)&&(e=[e]),e.forEach(l=>{if(this.isValidLookup(r))return;const u=this.extractFromKey(l,n),d=u.key;s=d;let h=u.namespaces;this.options.fallbackNS&&(h=h.concat(this.options.fallbackNS));const f=n.count!==void 0&&!ce(n.count),p=f&&!n.ordinal&&n.count===0,g=n.context!==void 0&&(ce(n.context)||typeof n.context=="number")&&n.context!=="",w=n.lngs?n.lngs:this.languageUtils.toResolveHierarchy(n.lng||this.language,n.fallbackLng);h.forEach(_=>{var v,x;this.isValidLookup(r)||(a=_,!Qb[`${w[0]}-${_}`]&&((v=this.utils)!=null&&v.hasLoadedNamespace)&&!((x=this.utils)!=null&&x.hasLoadedNamespace(a))&&(Qb[`${w[0]}-${_}`]=!0,this.logger.warn(`key "${s}" for languages "${w.join(", ")}" won't get resolved as namespace "${a}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!")),w.forEach(T=>{var L;if(this.isValidLookup(r))return;o=T;const A=[d];if((L=this.i18nFormat)!=null&&L.addLookupKeys)this.i18nFormat.addLookupKeys(A,d,T,_,n);else{let C;f&&(C=this.pluralResolver.getSuffix(T,n.count,n));const S=`${this.options.pluralSeparator}zero`,I=`${this.options.pluralSeparator}ordinal${this.options.pluralSeparator}`;if(f&&(n.ordinal&&C.indexOf(I)===0&&A.push(d+C.replace(I,this.options.pluralSeparator)),A.push(d+C),p&&A.push(d+S)),g){const P=`${d}${this.options.contextSeparator||"_"}${n.context}`;A.push(P),f&&(n.ordinal&&C.indexOf(I)===0&&A.push(P+C.replace(I,this.options.pluralSeparator)),A.push(P+C),p&&A.push(P+S))}}let k;for(;k=A.pop();)this.isValidLookup(r)||(i=k,r=this.getResource(T,_,k,n))}))})}),{res:r,usedKey:s,exactUsedKey:i,usedLng:o,usedNS:a}}isValidLookup(e){return e!==void 0&&!(!this.options.returnNull&&e===null)&&!(!this.options.returnEmptyString&&e==="")}getResource(e,n,r,s={}){var i;return(i=this.i18nFormat)!=null&&i.getResource?this.i18nFormat.getResource(e,n,r,s):this.resourceStore.getResource(e,n,r,s)}getUsedParamsDetails(e={}){const n=["defaultValue","ordinal","context","replace","lng","lngs","fallbackLng","ns","keySeparator","nsSeparator","returnObjects","returnDetails","joinArrays","postProcess","interpolation"],r=e.replace&&!ce(e.replace);let s=r?e.replace:e;if(r&&typeof e.count<"u"&&(s.count=e.count),this.options.interpolation.defaultVariables&&(s={...this.options.interpolation.defaultVariables,...s}),!r){s={...s};for(const i of n)delete s[i]}return s}static hasDefaultValue(e){const n="defaultValue";for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)&&n===r.substring(0,n.length)&&e[r]!==void 0)return!0;return!1}}class Xb{constructor(e){this.options=e,this.supportedLngs=this.options.supportedLngs||!1,this.logger=Ar.create("languageUtils")}getScriptPartFromCode(e){if(e=ic(e),!e||e.indexOf("-")<0)return null;const n=e.split("-");return n.length===2||(n.pop(),n[n.length-1].toLowerCase()==="x")?null:this.formatLanguageCode(n.join("-"))}getLanguagePartFromCode(e){if(e=ic(e),!e||e.indexOf("-")<0)return e;const n=e.split("-");return this.formatLanguageCode(n[0])}formatLanguageCode(e){if(ce(e)&&e.indexOf("-")>-1){let n;try{n=Intl.getCanonicalLocales(e)[0]}catch{}return n&&this.options.lowerCaseLng&&(n=n.toLowerCase()),n||(this.options.lowerCaseLng?e.toLowerCase():e)}return this.options.cleanCode||this.options.lowerCaseLng?e.toLowerCase():e}isSupportedCode(e){return(this.options.load==="languageOnly"||this.options.nonExplicitSupportedLngs)&&(e=this.getLanguagePartFromCode(e)),!this.supportedLngs||!this.supportedLngs.length||this.supportedLngs.indexOf(e)>-1}getBestMatchFromCodes(e){if(!e)return null;let n;return e.forEach(r=>{if(n)return;const s=this.formatLanguageCode(r);(!this.options.supportedLngs||this.isSupportedCode(s))&&(n=s)}),!n&&this.options.supportedLngs&&e.forEach(r=>{if(n)return;const s=this.getScriptPartFromCode(r);if(this.isSupportedCode(s))return n=s;const i=this.getLanguagePartFromCode(r);if(this.isSupportedCode(i))return n=i;n=this.options.supportedLngs.find(o=>{if(o===i)return o;if(!(o.indexOf("-")<0&&i.indexOf("-")<0)&&(o.indexOf("-")>0&&i.indexOf("-")<0&&o.substring(0,o.indexOf("-"))===i||o.indexOf(i)===0&&i.length>1))return o})}),n||(n=this.getFallbackCodes(this.options.fallbackLng)[0]),n}getFallbackCodes(e,n){if(!e)return[];if(typeof e=="function"&&(e=e(n)),ce(e)&&(e=[e]),Array.isArray(e))return e;if(!n)return e.default||[];let r=e[n];return r||(r=e[this.getScriptPartFromCode(n)]),r||(r=e[this.formatLanguageCode(n)]),r||(r=e[this.getLanguagePartFromCode(n)]),r||(r=e.default),r||[]}toResolveHierarchy(e,n){const r=this.getFallbackCodes((n===!1?[]:n)||this.options.fallbackLng||[],e),s=[],i=o=>{o&&(this.isSupportedCode(o)?s.push(o):this.logger.warn(`rejecting language code not found in supportedLngs: ${o}`))};return ce(e)&&(e.indexOf("-")>-1||e.indexOf("_")>-1)?(this.options.load!=="languageOnly"&&i(this.formatLanguageCode(e)),this.options.load!=="languageOnly"&&this.options.load!=="currentOnly"&&i(this.getScriptPartFromCode(e)),this.options.load!=="currentOnly"&&i(this.getLanguagePartFromCode(e))):ce(e)&&i(this.formatLanguageCode(e)),r.forEach(o=>{s.indexOf(o)<0&&i(this.formatLanguageCode(o))}),s}}const Jb={zero:0,one:1,two:2,few:3,many:4,other:5},Zb={select:t=>t===1?"one":"other",resolvedOptions:()=>({pluralCategories:["one","other"]})};class DQ{constructor(e,n={}){this.languageUtils=e,this.options=n,this.logger=Ar.create("pluralResolver"),this.pluralRulesCache={}}addRule(e,n){this.rules[e]=n}clearCache(){this.pluralRulesCache={}}getRule(e,n={}){const r=ic(e==="dev"?"en":e),s=n.ordinal?"ordinal":"cardinal",i=JSON.stringify({cleanedCode:r,type:s});if(i in this.pluralRulesCache)return this.pluralRulesCache[i];let o;try{o=new Intl.PluralRules(r,{type:s})}catch{if(!Intl)return this.logger.error("No Intl support, please use an Intl polyfill!"),Zb;if(!e.match(/-|_/))return Zb;const l=this.languageUtils.getLanguagePartFromCode(e);o=this.getRule(l,n)}return this.pluralRulesCache[i]=o,o}needsPlural(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),(r==null?void 0:r.resolvedOptions().pluralCategories.length)>1}getPluralFormsOfKey(e,n,r={}){return this.getSuffixes(e,r).map(s=>`${n}${s}`)}getSuffixes(e,n={}){let r=this.getRule(e,n);return r||(r=this.getRule("dev",n)),r?r.resolvedOptions().pluralCategories.sort((s,i)=>Jb[s]-Jb[i]).map(s=>`${this.options.prepend}${n.ordinal?`ordinal${this.options.prepend}`:""}${s}`):[]}getSuffix(e,n,r={}){const s=this.getRule(e,r);return s?`${this.options.prepend}${r.ordinal?`ordinal${this.options.prepend}`:""}${s.select(n)}`:(this.logger.warn(`no plural rule found for: ${e}`),this.getSuffix("dev",n,r))}}const eS=(t,e,n,r=".",s=!0)=>{let i=bQ(t,e,n);return!i&&s&&ce(n)&&(i=av(t,n,r),i===void 0&&(i=av(e,n,r))),i},Gm=t=>t.replace(/\$/g,"$$$$");class OQ{constructor(e={}){var n;this.logger=Ar.create("interpolator"),this.options=e,this.format=((n=e==null?void 0:e.interpolation)==null?void 0:n.format)||(r=>r),this.init(e)}init(e={}){e.interpolation||(e.interpolation={escapeValue:!0});const{escape:n,escapeValue:r,useRawValueToEscape:s,prefix:i,prefixEscaped:o,suffix:a,suffixEscaped:l,formatSeparator:u,unescapeSuffix:d,unescapePrefix:h,nestingPrefix:f,nestingPrefixEscaped:p,nestingSuffix:g,nestingSuffixEscaped:w,nestingOptionsSeparator:_,maxReplaces:v,alwaysFormat:x}=e.interpolation;this.escape=n!==void 0?n:CQ,this.escapeValue=r!==void 0?r:!0,this.useRawValueToEscape=s!==void 0?s:!1,this.prefix=i?Lo(i):o||"{{",this.suffix=a?Lo(a):l||"}}",this.formatSeparator=u||",",this.unescapePrefix=d?"":h||"-",this.unescapeSuffix=this.unescapePrefix?"":d||"",this.nestingPrefix=f?Lo(f):p||Lo("$t("),this.nestingSuffix=g?Lo(g):w||Lo(")"),this.nestingOptionsSeparator=_||",",this.maxReplaces=v||1e3,this.alwaysFormat=x!==void 0?x:!1,this.resetRegExp()}reset(){this.options&&this.init(this.options)}resetRegExp(){const e=(n,r)=>(n==null?void 0:n.source)===r?(n.lastIndex=0,n):new RegExp(r,"g");this.regexp=e(this.regexp,`${this.prefix}(.+?)${this.suffix}`),this.regexpUnescape=e(this.regexpUnescape,`${this.prefix}${this.unescapePrefix}(.+?)${this.unescapeSuffix}${this.suffix}`),this.nestingRegexp=e(this.nestingRegexp,`${this.nestingPrefix}((?:[^()"']+|"[^"]*"|'[^']*'|\\((?:[^()]|"[^"]*"|'[^']*')*\\))*?)${this.nestingSuffix}`)}interpolate(e,n,r,s){var p;let i,o,a;const l=this.options&&this.options.interpolation&&this.options.interpolation.defaultVariables||{},u=g=>{if(g.indexOf(this.formatSeparator)<0){const x=eS(n,l,g,this.options.keySeparator,this.options.ignoreJSONStructure);return this.alwaysFormat?this.format(x,void 0,r,{...s,...n,interpolationkey:g}):x}const w=g.split(this.formatSeparator),_=w.shift().trim(),v=w.join(this.formatSeparator).trim();return this.format(eS(n,l,_,this.options.keySeparator,this.options.ignoreJSONStructure),v,r,{...s,...n,interpolationkey:_})};this.resetRegExp();const d=(s==null?void 0:s.missingInterpolationHandler)||this.options.missingInterpolationHandler,h=((p=s==null?void 0:s.interpolation)==null?void 0:p.skipOnVariables)!==void 0?s.interpolation.skipOnVariables:this.options.interpolation.skipOnVariables;return[{regex:this.regexpUnescape,safeValue:g=>Gm(g)},{regex:this.regexp,safeValue:g=>this.escapeValue?Gm(this.escape(g)):Gm(g)}].forEach(g=>{for(a=0;i=g.regex.exec(e);){const w=i[1].trim();if(o=u(w),o===void 0)if(typeof d=="function"){const v=d(e,i,s);o=ce(v)?v:""}else if(s&&Object.prototype.hasOwnProperty.call(s,w))o="";else if(h){o=i[0];continue}else this.logger.warn(`missed to pass in variable ${w} for interpolating ${e}`),o="";else!ce(o)&&!this.useRawValueToEscape&&(o=Hb(o));const _=g.safeValue(o);if(e=e.replace(i[0],_),h?(g.regex.lastIndex+=o.length,g.regex.lastIndex-=i[0].length):g.regex.lastIndex=0,a++,a>=this.maxReplaces)break}}),e}nest(e,n,r={}){let s,i,o;const a=(l,u)=>{const d=this.nestingOptionsSeparator;if(l.indexOf(d)<0)return l;const h=l.split(new RegExp(`${d}[ ]*{`));let f=`{${h[1]}`;l=h[0],f=this.interpolate(f,o);const p=f.match(/'/g),g=f.match(/"/g);(((p==null?void 0:p.length)??0)%2===0&&!g||g.length%2!==0)&&(f=f.replace(/'/g,'"'));try{o=JSON.parse(f),u&&(o={...u,...o})}catch(w){return this.logger.warn(`failed parsing options string in nesting for key ${l}`,w),`${l}${d}${f}`}return o.defaultValue&&o.defaultValue.indexOf(this.prefix)>-1&&delete o.defaultValue,l};for(;s=this.nestingRegexp.exec(e);){let l=[];o={...r},o=o.replace&&!ce(o.replace)?o.replace:o,o.applyPostProcessor=!1,delete o.defaultValue;const u=/{.*}/.test(s[1])?s[1].lastIndexOf("}")+1:s[1].indexOf(this.formatSeparator);if(u!==-1&&(l=s[1].slice(u).split(this.formatSeparator).map(d=>d.trim()).filter(Boolean),s[1]=s[1].slice(0,u)),i=n(a.call(this,s[1].trim(),o),o),i&&s[0]===e&&!ce(i))return i;ce(i)||(i=Hb(i)),i||(this.logger.warn(`missed to resolve ${s[1]} for nesting ${e}`),i=""),l.length&&(i=l.reduce((d,h)=>this.format(d,h,r.lng,{...r,interpolationkey:s[1].trim()}),i.trim())),e=e.replace(s[0],i),this.regexp.lastIndex=0}return e}}const LQ=t=>{let e=t.toLowerCase().trim();const n={};if(t.indexOf("(")>-1){const r=t.split("(");e=r[0].toLowerCase().trim();const s=r[1].substring(0,r[1].length-1);e==="currency"&&s.indexOf(":")<0?n.currency||(n.currency=s.trim()):e==="relativetime"&&s.indexOf(":")<0?n.range||(n.range=s.trim()):s.split(";").forEach(o=>{if(o){const[a,...l]=o.split(":"),u=l.join(":").trim().replace(/^'+|'+$/g,""),d=a.trim();n[d]||(n[d]=u),u==="false"&&(n[d]=!1),u==="true"&&(n[d]=!0),isNaN(u)||(n[d]=parseInt(u,10))}})}return{formatName:e,formatOptions:n}},tS=t=>{const e={};return(n,r,s)=>{let i=s;s&&s.interpolationkey&&s.formatParams&&s.formatParams[s.interpolationkey]&&s[s.interpolationkey]&&(i={...i,[s.interpolationkey]:void 0});const o=r+JSON.stringify(i);let a=e[o];return a||(a=t(ic(r),s),e[o]=a),a(n)}},MQ=t=>(e,n,r)=>t(ic(n),r)(e);class VQ{constructor(e={}){this.logger=Ar.create("formatter"),this.options=e,this.init(e)}init(e,n={interpolation:{}}){this.formatSeparator=n.interpolation.formatSeparator||",";const r=n.cacheInBuiltFormats?tS:MQ;this.formats={number:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i});return a=>o.format(a)}),currency:r((s,i)=>{const o=new Intl.NumberFormat(s,{...i,style:"currency"});return a=>o.format(a)}),datetime:r((s,i)=>{const o=new Intl.DateTimeFormat(s,{...i});return a=>o.format(a)}),relativetime:r((s,i)=>{const o=new Intl.RelativeTimeFormat(s,{...i});return a=>o.format(a,i.range||"day")}),list:r((s,i)=>{const o=new Intl.ListFormat(s,{...i});return a=>o.format(a)})}}add(e,n){this.formats[e.toLowerCase().trim()]=n}addCached(e,n){this.formats[e.toLowerCase().trim()]=tS(n)}format(e,n,r,s={}){const i=n.split(this.formatSeparator);if(i.length>1&&i[0].indexOf("(")>1&&i[0].indexOf(")")<0&&i.find(a=>a.indexOf(")")>-1)){const a=i.findIndex(l=>l.indexOf(")")>-1);i[0]=[i[0],...i.splice(1,a)].join(this.formatSeparator)}return i.reduce((a,l)=>{var h;const{formatName:u,formatOptions:d}=LQ(l);if(this.formats[u]){let f=a;try{const p=((h=s==null?void 0:s.formatParams)==null?void 0:h[s.interpolationkey])||{},g=p.locale||p.lng||s.locale||s.lng||r;f=this.formats[u](a,g,{...d,...s,...p})}catch(p){this.logger.warn(p)}return f}else this.logger.warn(`there was no format function for ${u}`);return a},e)}}const jQ=(t,e)=>{t.pending[e]!==void 0&&(delete t.pending[e],t.pendingCount--)};class FQ extends Cp{constructor(e,n,r,s={}){var i,o;super(),this.backend=e,this.store=n,this.services=r,this.languageUtils=r.languageUtils,this.options=s,this.logger=Ar.create("backendConnector"),this.waitingReads=[],this.maxParallelReads=s.maxParallelReads||10,this.readingCalls=0,this.maxRetries=s.maxRetries>=0?s.maxRetries:5,this.retryTimeout=s.retryTimeout>=1?s.retryTimeout:350,this.state={},this.queue=[],(o=(i=this.backend)==null?void 0:i.init)==null||o.call(i,r,s.backend,s)}queueLoad(e,n,r,s){const i={},o={},a={},l={};return e.forEach(u=>{let d=!0;n.forEach(h=>{const f=`${u}|${h}`;!r.reload&&this.store.hasResourceBundle(u,h)?this.state[f]=2:this.state[f]<0||(this.state[f]===1?o[f]===void 0&&(o[f]=!0):(this.state[f]=1,d=!1,o[f]===void 0&&(o[f]=!0),i[f]===void 0&&(i[f]=!0),l[h]===void 0&&(l[h]=!0)))}),d||(a[u]=!0)}),(Object.keys(i).length||Object.keys(o).length)&&this.queue.push({pending:o,pendingCount:Object.keys(o).length,loaded:{},errors:[],callback:s}),{toLoad:Object.keys(i),pending:Object.keys(o),toLoadLanguages:Object.keys(a),toLoadNamespaces:Object.keys(l)}}loaded(e,n,r){const s=e.split("|"),i=s[0],o=s[1];n&&this.emit("failedLoading",i,o,n),!n&&r&&this.store.addResourceBundle(i,o,r,void 0,void 0,{skipCopy:!0}),this.state[e]=n?-1:2,n&&r&&(this.state[e]=0);const a={};this.queue.forEach(l=>{TQ(l.loaded,[i],o),jQ(l,e),n&&l.errors.push(n),l.pendingCount===0&&!l.done&&(Object.keys(l.loaded).forEach(u=>{a[u]||(a[u]={});const d=l.loaded[u];d.length&&d.forEach(h=>{a[u][h]===void 0&&(a[u][h]=!0)})}),l.done=!0,l.errors.length?l.callback(l.errors):l.callback())}),this.emit("loaded",a),this.queue=this.queue.filter(l=>!l.done)}read(e,n,r,s=0,i=this.retryTimeout,o){if(!e.length)return o(null,{});if(this.readingCalls>=this.maxParallelReads){this.waitingReads.push({lng:e,ns:n,fcName:r,tried:s,wait:i,callback:o});return}this.readingCalls++;const a=(u,d)=>{if(this.readingCalls--,this.waitingReads.length>0){const h=this.waitingReads.shift();this.read(h.lng,h.ns,h.fcName,h.tried,h.wait,h.callback)}if(u&&d&&s{this.read.call(this,e,n,r,s+1,i*2,o)},i);return}o(u,d)},l=this.backend[r].bind(this.backend);if(l.length===2){try{const u=l(e,n);u&&typeof u.then=="function"?u.then(d=>a(null,d)).catch(a):a(null,u)}catch(u){a(u)}return}return l(e,n,a)}prepareLoading(e,n,r={},s){if(!this.backend)return this.logger.warn("No backend was added via i18next.use. Will not load resources."),s&&s();ce(e)&&(e=this.languageUtils.toResolveHierarchy(e)),ce(n)&&(n=[n]);const i=this.queueLoad(e,n,r,s);if(!i.toLoad.length)return i.pending.length||s(),null;i.toLoad.forEach(o=>{this.loadOne(o)})}load(e,n,r){this.prepareLoading(e,n,{},r)}reload(e,n,r){this.prepareLoading(e,n,{reload:!0},r)}loadOne(e,n=""){const r=e.split("|"),s=r[0],i=r[1];this.read(s,i,"read",void 0,void 0,(o,a)=>{o&&this.logger.warn(`${n}loading namespace ${i} for language ${s} failed`,o),!o&&a&&this.logger.log(`${n}loaded namespace ${i} for language ${s}`,a),this.loaded(e,o,a)})}saveMissing(e,n,r,s,i,o={},a=()=>{}){var l,u,d,h,f;if((u=(l=this.services)==null?void 0:l.utils)!=null&&u.hasLoadedNamespace&&!((h=(d=this.services)==null?void 0:d.utils)!=null&&h.hasLoadedNamespace(n))){this.logger.warn(`did not save key "${r}" as the namespace "${n}" was not yet loaded`,"This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!");return}if(!(r==null||r==="")){if((f=this.backend)!=null&&f.create){const p={...o,isUpdate:i},g=this.backend.create.bind(this.backend);if(g.length<6)try{let w;g.length===5?w=g(e,n,r,s,p):w=g(e,n,r,s),w&&typeof w.then=="function"?w.then(_=>a(null,_)).catch(a):a(null,w)}catch(w){a(w)}else g(e,n,r,s,a,p)}!e||!e[0]||this.store.addResource(e[0],n,r,s)}}}const nS=()=>({debug:!1,initAsync:!0,ns:["translation"],defaultNS:["translation"],fallbackLng:["dev"],fallbackNS:!1,supportedLngs:!1,nonExplicitSupportedLngs:!1,load:"all",preload:!1,simplifyPluralSuffix:!0,keySeparator:".",nsSeparator:":",pluralSeparator:"_",contextSeparator:"_",partialBundledLanguages:!1,saveMissing:!1,updateMissing:!1,saveMissingTo:"fallback",saveMissingPlurals:!0,missingKeyHandler:!1,missingInterpolationHandler:!1,postProcess:!1,postProcessPassResolved:!1,returnNull:!1,returnEmptyString:!0,returnObjects:!1,joinArrays:!1,returnedObjectHandler:!1,parseMissingKeyHandler:!1,appendNamespaceToMissingKey:!1,appendNamespaceToCIMode:!1,overloadTranslationOptionHandler:t=>{let e={};if(typeof t[1]=="object"&&(e=t[1]),ce(t[1])&&(e.defaultValue=t[1]),ce(t[2])&&(e.tDescription=t[2]),typeof t[2]=="object"||typeof t[3]=="object"){const n=t[3]||t[2];Object.keys(n).forEach(r=>{e[r]=n[r]})}return e},interpolation:{escapeValue:!0,format:t=>t,prefix:"{{",suffix:"}}",formatSeparator:",",unescapePrefix:"-",nestingPrefix:"$t(",nestingSuffix:")",nestingOptionsSeparator:",",maxReplaces:1e3,skipOnVariables:!0},cacheInBuiltFormats:!0}),rS=t=>{var e,n;return ce(t.ns)&&(t.ns=[t.ns]),ce(t.fallbackLng)&&(t.fallbackLng=[t.fallbackLng]),ce(t.fallbackNS)&&(t.fallbackNS=[t.fallbackNS]),((n=(e=t.supportedLngs)==null?void 0:e.indexOf)==null?void 0:n.call(e,"cimode"))<0&&(t.supportedLngs=t.supportedLngs.concat(["cimode"])),typeof t.initImmediate=="boolean"&&(t.initAsync=t.initImmediate),t},kd=()=>{},UQ=t=>{Object.getOwnPropertyNames(Object.getPrototypeOf(t)).forEach(n=>{typeof t[n]=="function"&&(t[n]=t[n].bind(t))})};class oc extends Cp{constructor(e={},n){if(super(),this.options=rS(e),this.services={},this.logger=Ar,this.modules={external:[]},UQ(this),n&&!this.isInitialized&&!e.isClone){if(!this.options.initAsync)return this.init(e,n),this;setTimeout(()=>{this.init(e,n)},0)}}init(e={},n){this.isInitializing=!0,typeof e=="function"&&(n=e,e={}),e.defaultNS==null&&e.ns&&(ce(e.ns)?e.defaultNS=e.ns:e.ns.indexOf("translation")<0&&(e.defaultNS=e.ns[0]));const r=nS();this.options={...r,...this.options,...rS(e)},this.options.interpolation={...r.interpolation,...this.options.interpolation},e.keySeparator!==void 0&&(this.options.userDefinedKeySeparator=e.keySeparator),e.nsSeparator!==void 0&&(this.options.userDefinedNsSeparator=e.nsSeparator);const s=u=>u?typeof u=="function"?new u:u:null;if(!this.options.isClone){this.modules.logger?Ar.init(s(this.modules.logger),this.options):Ar.init(null,this.options);let u;this.modules.formatter?u=this.modules.formatter:u=VQ;const d=new Xb(this.options);this.store=new Gb(this.options.resources,this.options);const h=this.services;h.logger=Ar,h.resourceStore=this.store,h.languageUtils=d,h.pluralResolver=new DQ(d,{prepend:this.options.pluralSeparator,simplifyPluralSuffix:this.options.simplifyPluralSuffix}),this.options.interpolation.format&&this.options.interpolation.format!==r.interpolation.format&&this.logger.deprecate("init: you are still using the legacy format function, please use the new approach: https://www.i18next.com/translation-function/formatting"),u&&(!this.options.interpolation.format||this.options.interpolation.format===r.interpolation.format)&&(h.formatter=s(u),h.formatter.init&&h.formatter.init(h,this.options),this.options.interpolation.format=h.formatter.format.bind(h.formatter)),h.interpolator=new OQ(this.options),h.utils={hasLoadedNamespace:this.hasLoadedNamespace.bind(this)},h.backendConnector=new FQ(s(this.modules.backend),h.resourceStore,h,this.options),h.backendConnector.on("*",(p,...g)=>{this.emit(p,...g)}),this.modules.languageDetector&&(h.languageDetector=s(this.modules.languageDetector),h.languageDetector.init&&h.languageDetector.init(h,this.options.detection,this.options)),this.modules.i18nFormat&&(h.i18nFormat=s(this.modules.i18nFormat),h.i18nFormat.init&&h.i18nFormat.init(this)),this.translator=new xf(this.services,this.options),this.translator.on("*",(p,...g)=>{this.emit(p,...g)}),this.modules.external.forEach(p=>{p.init&&p.init(this)})}if(this.format=this.options.interpolation.format,n||(n=kd),this.options.fallbackLng&&!this.services.languageDetector&&!this.options.lng){const u=this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);u.length>0&&u[0]!=="dev"&&(this.options.lng=u[0])}!this.services.languageDetector&&!this.options.lng&&this.logger.warn("init: no languageDetector is used and no lng is defined"),["getResource","hasResourceBundle","getResourceBundle","getDataByLanguage"].forEach(u=>{this[u]=(...d)=>this.store[u](...d)}),["addResource","addResources","addResourceBundle","removeResourceBundle"].forEach(u=>{this[u]=(...d)=>(this.store[u](...d),this)});const a=Ol(),l=()=>{const u=(d,h)=>{this.isInitializing=!1,this.isInitialized&&!this.initializedStoreOnce&&this.logger.warn("init: i18next is already initialized. You should call init just once!"),this.isInitialized=!0,this.options.isClone||this.logger.log("initialized",this.options),this.emit("initialized",this.options),a.resolve(h),n(d,h)};if(this.languages&&!this.isInitialized)return u(null,this.t.bind(this));this.changeLanguage(this.options.lng,u)};return this.options.resources||!this.options.initAsync?l():setTimeout(l,0),a}loadResources(e,n=kd){var i,o;let r=n;const s=ce(e)?e:this.language;if(typeof e=="function"&&(r=e),!this.options.resources||this.options.partialBundledLanguages){if((s==null?void 0:s.toLowerCase())==="cimode"&&(!this.options.preload||this.options.preload.length===0))return r();const a=[],l=u=>{if(!u||u==="cimode")return;this.services.languageUtils.toResolveHierarchy(u).forEach(h=>{h!=="cimode"&&a.indexOf(h)<0&&a.push(h)})};s?l(s):this.services.languageUtils.getFallbackCodes(this.options.fallbackLng).forEach(d=>l(d)),(o=(i=this.options.preload)==null?void 0:i.forEach)==null||o.call(i,u=>l(u)),this.services.backendConnector.load(a,this.options.ns,u=>{!u&&!this.resolvedLanguage&&this.language&&this.setResolvedLanguage(this.language),r(u)})}else r(null)}reloadResources(e,n,r){const s=Ol();return typeof e=="function"&&(r=e,e=void 0),typeof n=="function"&&(r=n,n=void 0),e||(e=this.languages),n||(n=this.options.ns),r||(r=kd),this.services.backendConnector.reload(e,n,i=>{s.resolve(),r(i)}),s}use(e){if(!e)throw new Error("You are passing an undefined module! Please check the object you are passing to i18next.use()");if(!e.type)throw new Error("You are passing a wrong module! Please check the object you are passing to i18next.use()");return e.type==="backend"&&(this.modules.backend=e),(e.type==="logger"||e.log&&e.warn&&e.error)&&(this.modules.logger=e),e.type==="languageDetector"&&(this.modules.languageDetector=e),e.type==="i18nFormat"&&(this.modules.i18nFormat=e),e.type==="postProcessor"&&G2.addPostProcessor(e),e.type==="formatter"&&(this.modules.formatter=e),e.type==="3rdParty"&&this.modules.external.push(e),this}setResolvedLanguage(e){if(!(!e||!this.languages)&&!(["cimode","dev"].indexOf(e)>-1)){for(let n=0;n-1)&&this.store.hasLanguageSomeTranslations(r)){this.resolvedLanguage=r;break}}!this.resolvedLanguage&&this.languages.indexOf(e)<0&&this.store.hasLanguageSomeTranslations(e)&&(this.resolvedLanguage=e,this.languages.unshift(e))}}changeLanguage(e,n){this.isLanguageChangingTo=e;const r=Ol();this.emit("languageChanging",e);const s=a=>{this.language=a,this.languages=this.services.languageUtils.toResolveHierarchy(a),this.resolvedLanguage=void 0,this.setResolvedLanguage(a)},i=(a,l)=>{l?this.isLanguageChangingTo===e&&(s(l),this.translator.changeLanguage(l),this.isLanguageChangingTo=void 0,this.emit("languageChanged",l),this.logger.log("languageChanged",l)):this.isLanguageChangingTo=void 0,r.resolve((...u)=>this.t(...u)),n&&n(a,(...u)=>this.t(...u))},o=a=>{var d,h;!e&&!a&&this.services.languageDetector&&(a=[]);const l=ce(a)?a:a&&a[0],u=this.store.hasLanguageSomeTranslations(l)?l:this.services.languageUtils.getBestMatchFromCodes(ce(a)?[a]:a);u&&(this.language||s(u),this.translator.language||this.translator.changeLanguage(u),(h=(d=this.services.languageDetector)==null?void 0:d.cacheUserLanguage)==null||h.call(d,u)),this.loadResources(u,f=>{i(f,u)})};return!e&&this.services.languageDetector&&!this.services.languageDetector.async?o(this.services.languageDetector.detect()):!e&&this.services.languageDetector&&this.services.languageDetector.async?this.services.languageDetector.detect.length===0?this.services.languageDetector.detect().then(o):this.services.languageDetector.detect(o):o(e),r}getFixedT(e,n,r){const s=(i,o,...a)=>{let l;typeof o!="object"?l=this.options.overloadTranslationOptionHandler([i,o].concat(a)):l={...o},l.lng=l.lng||s.lng,l.lngs=l.lngs||s.lngs,l.ns=l.ns||s.ns,l.keyPrefix!==""&&(l.keyPrefix=l.keyPrefix||r||s.keyPrefix);const u=this.options.keySeparator||".";let d;return l.keyPrefix&&Array.isArray(i)?d=i.map(h=>(typeof h=="function"&&(h=lv(h,{...this.options,...o})),`${l.keyPrefix}${u}${h}`)):(typeof i=="function"&&(i=lv(i,{...this.options,...o})),d=l.keyPrefix?`${l.keyPrefix}${u}${i}`:i),this.t(d,l)};return ce(e)?s.lng=e:s.lngs=e,s.ns=n,s.keyPrefix=r,s}t(...e){var n;return(n=this.translator)==null?void 0:n.translate(...e)}exists(...e){var n;return(n=this.translator)==null?void 0:n.exists(...e)}setDefaultNamespace(e){this.options.defaultNS=e}hasLoadedNamespace(e,n={}){if(!this.isInitialized)return this.logger.warn("hasLoadedNamespace: i18next was not initialized",this.languages),!1;if(!this.languages||!this.languages.length)return this.logger.warn("hasLoadedNamespace: i18n.languages were undefined or empty",this.languages),!1;const r=n.lng||this.resolvedLanguage||this.languages[0],s=this.options?this.options.fallbackLng:!1,i=this.languages[this.languages.length-1];if(r.toLowerCase()==="cimode")return!0;const o=(a,l)=>{const u=this.services.backendConnector.state[`${a}|${l}`];return u===-1||u===0||u===2};if(n.precheck){const a=n.precheck(this,o);if(a!==void 0)return a}return!!(this.hasResourceBundle(r,e)||!this.services.backendConnector.backend||this.options.resources&&!this.options.partialBundledLanguages||o(r,e)&&(!s||o(i,e)))}loadNamespaces(e,n){const r=Ol();return this.options.ns?(ce(e)&&(e=[e]),e.forEach(s=>{this.options.ns.indexOf(s)<0&&this.options.ns.push(s)}),this.loadResources(s=>{r.resolve(),n&&n(s)}),r):(n&&n(),Promise.resolve())}loadLanguages(e,n){const r=Ol();ce(e)&&(e=[e]);const s=this.options.preload||[],i=e.filter(o=>s.indexOf(o)<0&&this.services.languageUtils.isSupportedCode(o));return i.length?(this.options.preload=s.concat(i),this.loadResources(o=>{r.resolve(),n&&n(o)}),r):(n&&n(),Promise.resolve())}dir(e){var s,i;if(e||(e=this.resolvedLanguage||(((s=this.languages)==null?void 0:s.length)>0?this.languages[0]:this.language)),!e)return"rtl";try{const o=new Intl.Locale(e);if(o&&o.getTextInfo){const a=o.getTextInfo();if(a&&a.direction)return a.direction}}catch{}const n=["ar","shu","sqr","ssh","xaa","yhd","yud","aao","abh","abv","acm","acq","acw","acx","acy","adf","ads","aeb","aec","afb","ajp","apc","apd","arb","arq","ars","ary","arz","auz","avl","ayh","ayl","ayn","ayp","bbz","pga","he","iw","ps","pbt","pbu","pst","prp","prd","ug","ur","ydd","yds","yih","ji","yi","hbo","men","xmn","fa","jpr","peo","pes","prs","dv","sam","ckb"],r=((i=this.services)==null?void 0:i.languageUtils)||new Xb(nS());return e.toLowerCase().indexOf("-latn")>1?"ltr":n.indexOf(r.getLanguagePartFromCode(e))>-1||e.toLowerCase().indexOf("-arab")>1?"rtl":"ltr"}static createInstance(e={},n){return new oc(e,n)}cloneInstance(e={},n=kd){const r=e.forkResourceStore;r&&delete e.forkResourceStore;const s={...this.options,...e,isClone:!0},i=new oc(s);if((e.debug!==void 0||e.prefix!==void 0)&&(i.logger=i.logger.clone(e)),["store","services","language"].forEach(a=>{i[a]=this[a]}),i.services={...this.services},i.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},r){const a=Object.keys(this.store.data).reduce((l,u)=>(l[u]={...this.store.data[u]},l[u]=Object.keys(l[u]).reduce((d,h)=>(d[h]={...l[u][h]},d),l[u]),l),{});i.store=new Gb(a,s),i.services.resourceStore=i.store}return i.translator=new xf(i.services,s),i.translator.on("*",(a,...l)=>{i.emit(a,...l)}),i.init(s,n),i.translator.options=s,i.translator.backendConnector.services.utils={hasLoadedNamespace:i.hasLoadedNamespace.bind(i)},i}toJSON(){return{options:this.options,store:this.store,language:this.language,languages:this.languages,resolvedLanguage:this.resolvedLanguage}}}const en=oc.createInstance();en.createInstance=oc.createInstance;en.createInstance;en.dir;en.init;en.loadResources;en.reloadResources;en.use;en.changeLanguage;en.getFixedT;en.t;en.exists;en.setDefaultNamespace;en.hasLoadedNamespace;en.loadNamespaces;en.loadLanguages;const{slice:$Q,forEach:BQ}=[];function zQ(t){return BQ.call($Q.call(arguments,1),e=>{if(e)for(const n in e)t[n]===void 0&&(t[n]=e[n])}),t}function HQ(t){return typeof t!="string"?!1:[/<\s*script.*?>/i,/<\s*\/\s*script\s*>/i,/<\s*img.*?on\w+\s*=/i,/<\s*\w+\s*on\w+\s*=.*?>/i,/javascript\s*:/i,/vbscript\s*:/i,/expression\s*\(/i,/eval\s*\(/i,/alert\s*\(/i,/document\.cookie/i,/document\.write\s*\(/i,/window\.location/i,/innerHTML/i].some(n=>n.test(t))}const sS=/^[\u0009\u0020-\u007e\u0080-\u00ff]+$/,WQ=function(t,e){const r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{path:"/"},s=encodeURIComponent(e);let i=`${t}=${s}`;if(r.maxAge>0){const o=r.maxAge-0;if(Number.isNaN(o))throw new Error("maxAge should be a Number");i+=`; Max-Age=${Math.floor(o)}`}if(r.domain){if(!sS.test(r.domain))throw new TypeError("option domain is invalid");i+=`; Domain=${r.domain}`}if(r.path){if(!sS.test(r.path))throw new TypeError("option path is invalid");i+=`; Path=${r.path}`}if(r.expires){if(typeof r.expires.toUTCString!="function")throw new TypeError("option expires is invalid");i+=`; Expires=${r.expires.toUTCString()}`}if(r.httpOnly&&(i+="; HttpOnly"),r.secure&&(i+="; Secure"),r.sameSite)switch(typeof r.sameSite=="string"?r.sameSite.toLowerCase():r.sameSite){case!0:i+="; SameSite=Strict";break;case"lax":i+="; SameSite=Lax";break;case"strict":i+="; SameSite=Strict";break;case"none":i+="; SameSite=None";break;default:throw new TypeError("option sameSite is invalid")}return r.partitioned&&(i+="; Partitioned"),i},iS={create(t,e,n,r){let s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:{path:"/",sameSite:"strict"};n&&(s.expires=new Date,s.expires.setTime(s.expires.getTime()+n*60*1e3)),r&&(s.domain=r),document.cookie=WQ(t,e,s)},read(t){const e=`${t}=`,n=document.cookie.split(";");for(let r=0;r-1&&(s=window.location.hash.substring(window.location.hash.indexOf("?")));const o=s.substring(1).split("&");for(let a=0;a0&&o[a].substring(0,l)===e&&(n=o[a].substring(l+1))}}return n}},GQ={name:"hash",lookup(t){var s;let{lookupHash:e,lookupFromHashIndex:n}=t,r;if(typeof window<"u"){const{hash:i}=window.location;if(i&&i.length>2){const o=i.substring(1);if(e){const a=o.split("&");for(let l=0;l0&&a[l].substring(0,u)===e&&(r=a[l].substring(u+1))}}if(r)return r;if(!r&&n>-1){const a=i.match(/\/([a-zA-Z-]*)/g);return Array.isArray(a)?(s=a[typeof n=="number"?n:0])==null?void 0:s.replace("/",""):void 0}}}return r}};let Mo=null;const oS=()=>{if(Mo!==null)return Mo;try{if(Mo=typeof window<"u"&&window.localStorage!==null,!Mo)return!1;const t="i18next.translate.boo";window.localStorage.setItem(t,"foo"),window.localStorage.removeItem(t)}catch{Mo=!1}return Mo};var QQ={name:"localStorage",lookup(t){let{lookupLocalStorage:e}=t;if(e&&oS())return window.localStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupLocalStorage:n}=e;n&&oS()&&window.localStorage.setItem(n,t)}};let Vo=null;const aS=()=>{if(Vo!==null)return Vo;try{if(Vo=typeof window<"u"&&window.sessionStorage!==null,!Vo)return!1;const t="i18next.translate.boo";window.sessionStorage.setItem(t,"foo"),window.sessionStorage.removeItem(t)}catch{Vo=!1}return Vo};var YQ={name:"sessionStorage",lookup(t){let{lookupSessionStorage:e}=t;if(e&&aS())return window.sessionStorage.getItem(e)||void 0},cacheUserLanguage(t,e){let{lookupSessionStorage:n}=e;n&&aS()&&window.sessionStorage.setItem(n,t)}},XQ={name:"navigator",lookup(t){const e=[];if(typeof navigator<"u"){const{languages:n,userLanguage:r,language:s}=navigator;if(n)for(let i=0;i0?e:void 0}},JQ={name:"htmlTag",lookup(t){let{htmlTag:e}=t,n;const r=e||(typeof document<"u"?document.documentElement:null);return r&&typeof r.getAttribute=="function"&&(n=r.getAttribute("lang")),n}},ZQ={name:"path",lookup(t){var s;let{lookupFromPathIndex:e}=t;if(typeof window>"u")return;const n=window.location.pathname.match(/\/([a-zA-Z-]*)/g);return Array.isArray(n)?(s=n[typeof e=="number"?e:0])==null?void 0:s.replace("/",""):void 0}},eY={name:"subdomain",lookup(t){var s,i;let{lookupFromSubdomainIndex:e}=t;const n=typeof e=="number"?e+1:1,r=typeof window<"u"&&((i=(s=window.location)==null?void 0:s.hostname)==null?void 0:i.match(/^(\w{2,5})\.(([a-z0-9-]{1,63}\.[a-z]{2,6})|localhost)/i));if(r)return r[n]}};let Y2=!1;try{document.cookie,Y2=!0}catch{}const X2=["querystring","cookie","localStorage","sessionStorage","navigator","htmlTag"];Y2||X2.splice(1,1);const tY=()=>({order:X2,lookupQuerystring:"lng",lookupCookie:"i18next",lookupLocalStorage:"i18nextLng",lookupSessionStorage:"i18nextLng",caches:["localStorage"],excludeCacheFor:["cimode"],convertDetectedLanguage:t=>t});class J2{constructor(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};this.type="languageDetector",this.detectors={},this.init(e,n)}init(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{languageUtils:{}},n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};this.services=e,this.options=zQ(n,this.options||{},tY()),typeof this.options.convertDetectedLanguage=="string"&&this.options.convertDetectedLanguage.indexOf("15897")>-1&&(this.options.convertDetectedLanguage=s=>s.replace("-","_")),this.options.lookupFromUrlIndex&&(this.options.lookupFromPathIndex=this.options.lookupFromUrlIndex),this.i18nOptions=r,this.addDetector(qQ),this.addDetector(KQ),this.addDetector(QQ),this.addDetector(YQ),this.addDetector(XQ),this.addDetector(JQ),this.addDetector(ZQ),this.addDetector(eY),this.addDetector(GQ)}addDetector(e){return this.detectors[e.name]=e,this}detect(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.options.order,n=[];return e.forEach(r=>{if(this.detectors[r]){let s=this.detectors[r].lookup(this.options);s&&typeof s=="string"&&(s=[s]),s&&(n=n.concat(s))}}),n=n.filter(r=>r!=null&&!HQ(r)).map(r=>this.options.convertDetectedLanguage(r)),this.services&&this.services.languageUtils&&this.services.languageUtils.getBestMatchFromCodes?n:n.length>0?n[0]:null}cacheUserLanguage(e){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:this.options.caches;n&&(this.options.excludeCacheFor&&this.options.excludeCacheFor.indexOf(e)>-1||n.forEach(r=>{this.detectors[r]&&this.detectors[r].cacheUserLanguage(e,this.options)}))}}J2.type="languageDetector";const nY={programmes:"PROGRAMMES",pathway:"PATHWAY",community:"COMMUNAUTÉ",about:"À PROPOS",login:"Connexion au Portail →"},rY={viewAll:"Découvrez tous nos programmes",leadership:"Programmes de leadership spirituel",destinee:"Découverte de la destinée",formation:"Formation spirituelle pratique",impact:"Leadership d'impact",excellence:"Parcours d'excellence",accomplissement:"Accomplissement de la destinée",fondations:"Fondations spirituelles",croissance:"Croissance spirituelle",maturite:"Maturité spirituelle",story:"Notre histoire",team:"Notre équipe",mission:"Notre mission"},sY={slide1:{title:"Découvre et active ta destinée",subtitle:"L'École de Destinée LDN t'accompagne",description:"Identifie ton appel, clarifie ta vision et marche pleinement dans le plan de Dieu pour ta vie.",buttonText:"Commencer le parcours"},slide2:{title:"Construis les fondations de ta destinée",subtitle:"Un enseignement solide et inspiré",description:"Reçois une formation spirituelle pratique pour poser des bases stables et solides dans ta marche avec Dieu.",buttonText:"Découvrir les formations"},slide3:{title:"Impacte ta génération",subtitle:"Deviens un acteur de transformation",description:"Développe ton leadership spirituel et inspire les autres à marcher dans leur destinée.",buttonText:"Explorer les programmes"},slide4:{title:"Progresse vers l'excellence",subtitle:"Un parcours en plusieurs étapes",description:"Évolue pas à pas dans ta destinée à travers un accompagnement structuré et progressif.",buttonText:"Voir le parcours complet"},slide5:{title:"Accomplis ta destinée",subtitle:"Un aboutissement spirituel et pratique",description:"De la découverte à la réalisation, vis pleinement l'appel que Dieu a placé sur ta vie.",buttonText:"Rejoindre maintenant"}},iY={title:"Programmes Les Plus Populaires",subtitle:"Programmes Des Nations"},oY={all:"Tous",Leadership:"Leadership","Formation Spirituelle":"Formation Spirituelle",Destinée:"Destinée",Impact:"Impact"},aY={open:"Ouvert maintenant",soon:"Bientôt disponible"},lY={months:"Mois"},uY={destinee:{title:"Découverte de la Destinée",description:"Identifiez votre appel et clarifez votre vision pour votre vie"},leadership:{title:"Leadership Spirituel",description:"Développez vos compétences de leadership dans la foi"},formation:{title:"Formation aux Fondements",description:"Posez des bases solides dans votre marche spirituelle"},impact:{title:"Impact et Transformation",description:"Devenez un agent de transformation dans votre communauté"}},cY={title:"Découvre ta destinée et marche avec clarté",titleHighlight:"destinée",description:"À *Destinée Platform*, nous croyons que Dieu a un appel unique pour ta vie. Nos programmes fusionnent formation spirituelle, alignement personnel, projets concrets et mentorat pour t'aider à vivre ton appel dans le concret.",features:{revelation:{title:"Révélation de l'appel",description:"Découvre ce pour quoi Dieu t'a appelé"},mentoring:{title:"Mentorat spirituel",description:"Guidance par des leaders façonnés par la foi"},projects:{title:"Projets d'impact",description:"Actions concrètes pour impacter ta génération"},community:{title:"Communauté de destinée",description:"Un groupe uni pour encourager et grandir ensemble"},resources:{title:"Ressources bibliques",description:"Enseignements ancrés dans la Parole"}},button:"Commencer ta destinée",stats:{people:"Personnes accompagnées"}},dY={header:nY,menu:rY,hero:sY,programs:iY,filter:oY,status:aY,common:lY,program:uY,about:cY},hY={programmes:"PROGRAMS",pathway:"PATHWAY",community:"COMMUNITY",about:"ABOUT",login:"Login to Portal →"},fY={viewAll:"Discover all our programs",leadership:"Spiritual leadership programs",destinee:"Destiny discovery",formation:"Practical spiritual formation",impact:"Impact leadership",excellence:"Excellence pathway",accomplissement:"Destiny fulfillment",fondations:"Spiritual foundations",croissance:"Spiritual growth",maturite:"Spiritual maturity",story:"Our story",team:"Our team",mission:"Our mission"},pY={slide1:{title:"Discover and activate your destiny",subtitle:"LDN Destiny School accompanies you",description:"Identify your calling, clarify your vision and walk fully in God's plan for your life.",buttonText:"Start the journey"},slide2:{title:"Build the foundations of your destiny",subtitle:"Solid and inspired teaching",description:"Receive practical spiritual training to lay stable and solid foundations in your walk with God.",buttonText:"Discover training programs"},slide3:{title:"Impact your generation",subtitle:"Become an agent of transformation",description:"Develop your spiritual leadership and inspire others to walk in their destiny.",buttonText:"Explore programs"},slide4:{title:"Progress towards excellence",subtitle:"A multi-step journey",description:"Evolve step by step in your destiny through structured and progressive support.",buttonText:"See the full pathway"},slide5:{title:"Fulfill your destiny",subtitle:"A spiritual and practical fulfillment",description:"From discovery to fulfillment, live fully the calling that God has placed on your life.",buttonText:"Join now"}},mY={title:"Most Popular Programs",subtitle:"Des Nations Programs"},gY={all:"All",Leadership:"Leadership","Formation Spirituelle":"Spiritual Formation",Destinée:"Destiny",Impact:"Impact"},yY={open:"Now Open",soon:"Coming Soon"},vY={months:"Months"},wY={destinee:{title:"Destiny Discovery",description:"Identify your calling and clarify your life vision"},leadership:{title:"Spiritual Leadership",description:"Develop your faith-based leadership skills"},formation:{title:"Foundation Training",description:"Build solid foundations in your spiritual walk"},impact:{title:"Impact & Transformation",description:"Become an agent of transformation in your community"}},xY={title:"Discover your destiny and walk with clarity",titleHighlight:"destiny",description:"At *Destiny Platform*, we believe God has a unique calling for your life. Our programs merge spiritual formation, personal alignment, concrete projects and mentoring to help you live your calling in practice.",features:{revelation:{title:"Calling revelation",description:"Discover what God has called you for"},mentoring:{title:"Spiritual mentoring",description:"Guidance by faith-shaped leaders"},projects:{title:"Impact projects",description:"Concrete actions to impact your generation"},community:{title:"Destiny community",description:"A united group to encourage and grow together"},resources:{title:"Biblical resources",description:"Teachings rooted in the Word"}},button:"Start your destiny",stats:{people:"People accompanied"}},_Y={header:hY,menu:fY,hero:pY,programs:mY,filter:gY,status:yY,common:vY,program:wY,about:xY},EY={fr:{translation:dY},en:{translation:_Y}};en.use(J2).use(bG).init({resources:EY,fallbackLng:g8,supportedLngs:m8,debug:!1,interpolation:{escapeValue:!1},detection:{order:["localStorage","navigator","htmlTag"],lookupLocalStorage:"i18nextLng",caches:["localStorage"]}});kI(document.getElementById("root")).render(y.jsx(xQ,{}));export{k2 as $,cV as A,xt as B,q2 as C,LG as D,gV as E,OP as F,Ye as G,E8 as H,pf as I,dG as J,wK as K,ov as L,hG as M,fP as N,hV as O,Ut as P,vV as Q,xV as R,bV as S,MY as T,PV as U,$k as V,uV as W,Kd as X,zk as Y,A2 as Z,R2 as _,vp as a,N2 as a0,D2 as a1,XE as a2,P0 as a3,DY as a4,zI as a5,Lu as a6,o0 as a7,bY as a8,d0 as a9,_V as aa,go as ab,q as ac,UD as ad,pV as ae,$f as af,TV as ag,VY as ah,MI as b,yV as c,vi as d,qU as e,O2 as f,yS as g,oG as h,aG as i,y as j,lG as k,L2 as l,kY as m,dV as n,mV as o,qe as p,ft as q,b as r,OY as s,TM as t,Xf as u,Yn as v,HI as w,Vr as x,Vf as y,i0 as z};