PageSourceSearch

https://xponential.ro/assets/index-ixOngHvC.js

js xponential.ro collected 2026-10-08 23:44:41 UTC 1,919,943 bytes, 4,570 lines download raw bytes

vendor: 5,949 bytes, lines 1-9
1var jF=Object.defineProperty;var NF=(t,e,r)=>e in t?jF(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var Ta=(t,e,r)=>NF(t,typeof e!="symbol"?e+"":e,r);function _F(t,e){for(var r=0;r<e.length;r++){const n=e[r];if(typeof n!="string"&&!Array.isArray(n)){for(const s in n)if(s!=="default"&&!(s in t)){const i=Object.getOwnPropertyDescriptor(n,s);i&&Object.defineProperty(t,s,i.get?i:{enumerable:!0,get:()=>n[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"]'))n(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"&&n(o)}).observe(document,{childList:!0,subtree:!0});function r(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 n(s){if(s.ep)return;s.ep=!0;const i=r(s);fetch(s.href,i)}})();var jf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function nt(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var CI={exports:{}},Ux={},II={exports:{}},Ue={};/**
2 * @license React
3 * react.production.min.js
4 *
5 * Copyright (c) Facebook, Inc. and its affiliates.
6 *
7 * This source code is licensed under the MIT license found in the
8 * LICENSE file in the root directory of this source tree.
9 */var _m=Symbol.for("react.element"),SF=Symbol.for("react.portal"),TF=Symbol.for("react.fragment"),AF=Symbol.for("react.strict_mode"),EF=Symbol.for("react.profiler"),kF=Symbol.for("react.provider"),PF=Symbol.for("react.context"),CF=Symbol.for("react.forward_ref"),IF=Symbol.for("react.suspense"),OF=Symbol.for("react.memo"),RF=Symbol.for("react.lazy"),WS=Symbol.iterator;function DF(t){return t===null||typeof t!="object"?null:(t=WS&&t[WS]||t["@@iterator"],typeof t=="function"?t:null)}var OI={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},RI=Object.assign,DI={};function gu(t,e,r){this.props=t,this.context=e,this.refs=DI,this.updater=r||OI}gu.prototype.isReactComponent={};gu.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")};gu.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function MI(){}MI.prototype=gu.prototype;function C1(t,e,r){this.props=t,this.context=e,this.refs=DI,this.updater=r||OI}var I1=C1.prototype=new MI;I1.constructor=C1;RI(I1,gu.prototype);I1.isPureReactComponent=!0;var GS=Array.isArray,$I=Object.prototype.hasOwnProperty,O1={current:null},LI={key:!0,ref:!0,__self:!0,__source:!0};function FI(t,e,r){var n,s={},i=null,o=null;if(e!=null)for(n in e.ref!==void 0&&(o=e.ref),e.key!==void 0&&(i=""+e.key),e)$I.call(e,n)&&!LI.hasOwnProperty(n)&&(s[n]=e[n]);var l=arguments.length-2;if(l===1)s.children=r;else if(1<l){for(var c=Array(l),u=0;u<l;u++)c[u]=arguments[u+2];s.children=c}if(t&&t.defaultProps)for(n in l=t.defaultProps,l)s[n]===void 0&&(s[n]=l[n]);return{$$typeof:_m,type:t,key:i,ref:o,props:s,_owner:O1.current}}function MF(t,e){return{$$typeof:_m,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function R1(t){return typeof t=="object"&&t!==null&&t.$$typeof===_m}function $F(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var KS=/\/+/g;function Hv(t,e){return typeof t=="object"&&t!==null&&t.key!=null?$F(""+t.key):e.toString(36)}function fp(t,e,r,n,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var o=!1;if(t===null)o=!0;else switch(i){case"string":case"number":o=!0;break;case"object":switch(t.$$typeof){case _m:case SF:o=!0}}if(o)return o=t,s=s(o),t=n===""?"."+Hv(o,0):n,GS(s)?(r="",t!=null&&(r=t.replace(KS,"$&/")+"/"),fp(s,e,r,"",function(u){return u})):s!=null&&(R1(s)&&(s=MF(s,r+(!s.key||o&&o.key===s.key?"":(""+s.key).replace(KS,"$&/")+"/")+t)),e.push(s)),1;if(o=0,n=n===""?".":n+":",GS(t))for(var l=0;l<t.length;l++){i=t[l];var c=n+Hv(i,l);o+=fp(i,e,r,c,s)}else if(c=DF(t),typeof c=="function")for(t=c.call(t),l=0;!(i=t.next()).done;)i=i.value,c=n+Hv(i,l++),o+=fp(i,e,r,c,s);else if(i==="object")throw e=String(t),Error("Objects are not valid as a React child (found: "+(e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)+"). If you meant to render a collection of children, use an array instead.");return o}function Nf(t,e,r){if(t==null)return t;var n=[],s=0;return fp(t,n,"","",function(i){return e.call(r,i,s++)}),n}function LF(t){if(t._status===-1){var e=t._result;e=e(),e.then(function(r){(t._status===0||t._status===-1)&&(t._status=1,t._result=r)},function(r){(t._status===0||t._status===-1)&&(t._status=2,t._result=r)}),t._status===-1&&(t._status=0,t._result=e)}if(t._status===1)return t._result.default;throw t._result}var an={current:null},pp={transition:null},FF={ReactCurrentDispatcher:an,ReactCurrentBatchConfig:pp,ReactCurrentOwner:O1};function BI(){throw Error("act(...) is not supported in production builds of React.")}Ue.Children={map:Nf,forEach:function(t,e,r){Nf(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Nf(t,function(){e++}),e},toArray:function(t){return Nf(t,function(e){return e})||[]},only:function(t){if(!R1(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};Ue.Component=gu;Ue.Fragment=TF;Ue.Profiler=EF;Ue.PureComponent=C1;Ue.StrictMode=AF;Ue.Suspense=IF;
vendor: 4,676 bytes, lines 9-25
9Ue.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=FF;Ue.act=BI;Ue.cloneElement=function(t,e,r){if(t==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+t+".");var n=RI({},t.props),s=t.key,i=t.ref,o=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,o=O1.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var l=t.type.defaultProps;for(c in e)$I.call(e,c)&&!LI.hasOwnProperty(c)&&(n[c]=e[c]===void 0&&l!==void 0?l[c]:e[c])}var c=arguments.length-2;if(c===1)n.children=r;else if(1<c){l=Array(c);for(var u=0;u<c;u++)l[u]=arguments[u+2];n.children=l}return{$$typeof:_m,type:t.type,key:s,ref:i,props:n,_owner:o}};Ue.createContext=function(t){return t={$$typeof:PF,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:kF,_context:t},t.Consumer=t};Ue.createElement=FI;Ue.createFactory=function(t){var e=FI.bind(null,t);return e.type=t,e};Ue.createRef=function(){return{current:null}};Ue.forwardRef=function(t){return{$$typeof:CF,render:t}};Ue.isValidElement=R1;Ue.lazy=function(t){return{$$typeof:RF,_payload:{_status:-1,_result:t},_init:LF}};Ue.memo=function(t,e){return{$$typeof:OF,type:t,compare:e===void 0?null:e}};Ue.startTransition=function(t){var e=pp.transition;pp.transition={};try{t()}finally{pp.transition=e}};Ue.unstable_act=BI;Ue.useCallback=function(t,e){return an.current.useCallback(t,e)};Ue.useContext=function(t){return an.current.useContext(t)};Ue.useDebugValue=function(){};Ue.useDeferredValue=function(t){return an.current.useDeferredValue(t)};Ue.useEffect=function(t,e){return an.current.useEffect(t,e)};Ue.useId=function(){return an.current.useId()};Ue.useImperativeHandle=function(t,e,r){return an.current.useImperativeHandle(t,e,r)};Ue.useInsertionEffect=function(t,e){return an.current.useInsertionEffect(t,e)};Ue.useLayoutEffect=function(t,e){return an.current.useLayoutEffect(t,e)};Ue.useMemo=function(t,e){return an.current.useMemo(t,e)};Ue.useReducer=function(t,e,r){return an.current.useReducer(t,e,r)};Ue.useRef=function(t){return an.current.useRef(t)};Ue.useState=function(t){return an.current.useState(t)};Ue.useSyncExternalStore=function(t,e,r){return an.current.useSyncExternalStore(t,e,r)};Ue.useTransition=function(){return an.current.useTransition()};Ue.version="18.3.1";II.exports=Ue;var P=II.exports;const F=nt(P),BF=_F({__proto__:null,default:F},[P]);/**
10 * @license React
11 * react-jsx-runtime.production.min.js
12 *
13 * Copyright (c) Facebook, Inc. and its affiliates.
14 *
15 * This source code is licensed under the MIT license found in the
16 * LICENSE file in the root directory of this source tree.
17 */var VF=P,UF=Symbol.for("react.element"),zF=Symbol.for("react.fragment"),HF=Object.prototype.hasOwnProperty,qF=VF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,WF={key:!0,ref:!0,__self:!0,__source:!0};function VI(t,e,r){var n,s={},i=null,o=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(o=e.ref);for(n in e)HF.call(e,n)&&!WF.hasOwnProperty(n)&&(s[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)s[n]===void 0&&(s[n]=e[n]);return{$$typeof:UF,type:t,key:i,ref:o,props:s,_owner:qF.current}}Ux.Fragment=zF;Ux.jsx=VI;Ux.jsxs=VI;CI.exports=Ux;var a=CI.exports,UI={exports:{}},Mn={},zI={exports:{}},HI={};/**
18 * @license React
19 * scheduler.production.min.js
20 *
21 * Copyright (c) Facebook, Inc. and its affiliates.
22 *
23 * This source code is licensed under the MIT license found in the
24 * LICENSE file in the root directory of this source tree.
25 */(function(t){function e(V,D){var z=V.length;V.push(D);e:for(;0<z;){var K=z-1>>>1,q=V[K];if(0<s(q,D))V[K]=D,V[z]=q,z=K;else break e}}function r(V){return V.length===0?null:V[0]}function n(V){if(V.length===0)return null;var D=V[0],z=V.pop();if(z!==D){V[0]=z;e:for(var K=0,q=V.length,H=q>>>1;K<H;){var ee=2*(K+1)-1,de=V[ee],we=ee+1,Le=V[we];if(0>s(de,z))we<q&&0>s(Le,de)?(V[K]=Le,V[we]=z,K=we):(V[K]=de,V[ee]=z,K=ee);else if(we<q&&0>s(Le,z))V[K]=Le,V[we]=z,K=we;else break e}}return D}function s(V,D){var z=V.sortIndex-D.sortIndex;return z!==0?z:V.id-D.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var o=Date,l=o.now();t.unstable_now=function(){return o.now()-l}}var c=[],u=[],d=1,h=null,m=3,p=!1,x=!1,w=!1,g=typeof setTimeout=="function"?setTimeout:null,v=typeof clearTimeout=="function"?clearTimeout:null,b=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);
vendor: 9,542 bytes, lines 25-34
25function y(V){for(var D=r(u);D!==null;){if(D.callback===null)n(u);else if(D.startTime<=V)n(u),D.sortIndex=D.expirationTime,e(c,D);else break;D=r(u)}}function T(V){if(w=!1,y(V),!x)if(r(c)!==null)x=!0,L(N);else{var D=r(u);D!==null&&U(T,D.startTime-V)}}function N(V,D){x=!1,w&&(w=!1,v(S),S=-1),p=!0;var z=m;try{for(y(D),h=r(c);h!==null&&(!(h.expirationTime>D)||V&&!E());){var K=h.callback;if(typeof K=="function"){h.callback=null,m=h.priorityLevel;var q=K(h.expirationTime<=D);D=t.unstable_now(),typeof q=="function"?h.callback=q:h===r(c)&&n(c),y(D)}else n(c);h=r(c)}if(h!==null)var H=!0;else{var ee=r(u);ee!==null&&U(T,ee.startTime-D),H=!1}return H}finally{h=null,m=z,p=!1}}var j=!1,_=null,S=-1,k=5,I=-1;function E(){return!(t.unstable_now()-I<k)}function C(){if(_!==null){var V=t.unstable_now();I=V;var D=!0;try{D=_(!0,V)}finally{D?R():(j=!1,_=null)}}else j=!1}var R;if(typeof b=="function")R=function(){b(C)};else if(typeof MessageChannel<"u"){var W=new MessageChannel,M=W.port2;W.port1.onmessage=C,R=function(){M.postMessage(null)}}else R=function(){g(C,0)};function L(V){_=V,j||(j=!0,R())}function U(V,D){S=g(function(){V(t.unstable_now())},D)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(V){V.callback=null},t.unstable_continueExecution=function(){x||p||(x=!0,L(N))},t.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):k=0<V?Math.floor(1e3/V):5},t.unstable_getCurrentPriorityLevel=function(){return m},t.unstable_getFirstCallbackNode=function(){return r(c)},t.unstable_next=function(V){switch(m){case 1:case 2:case 3:var D=3;break;default:D=m}var z=m;m=D;try{return V()}finally{m=z}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(V,D){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var z=m;m=V;try{return D()}finally{m=z}},t.unstable_scheduleCallback=function(V,D,z){var K=t.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?K+z:K):z=K,V){case 1:var q=-1;break;case 2:q=250;break;case 5:q=1073741823;break;case 4:q=1e4;break;default:q=5e3}return q=z+q,V={id:d++,callback:D,priorityLevel:V,startTime:z,expirationTime:q,sortIndex:-1},z>K?(V.sortIndex=z,e(u,V),r(c)===null&&V===r(u)&&(w?(v(S),S=-1):w=!0,U(T,z-K))):(V.sortIndex=q,e(c,V),x||p||(x=!0,L(N))),V},t.unstable_shouldYield=E,t.unstable_wrapCallback=function(V){var D=m;return function(){var z=m;m=D;try{return V.apply(this,arguments)}finally{m=z}}}})(HI);zI.exports=HI;var GF=zI.exports;/**
26 * @license React
27 * react-dom.production.min.js
28 *
29 * Copyright (c) Facebook, Inc. and its affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var KF=P,On=GF;function le(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r<arguments.length;r++)e+="&args[]="+encodeURIComponent(arguments[r]);return"Minified React error #"+t+"; visit "+e+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var qI=new Set,dh={};function dl(t,e){_c(t,e),_c(t+"Capture",e)}function _c(t,e){for(dh[t]=e,t=0;t<e.length;t++)qI.add(e[t])}var js=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),jb=Object.prototype.hasOwnProperty,XF=/^[: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]*$/,XS={},YS={};function YF(t){return jb.call(YS,t)?!0:jb.call(XS,t)?!1:XF.test(t)?YS[t]=!0:(XS[t]=!0,!1)}function QF(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function JF(t,e,r,n){if(e===null||typeof e>"u"||QF(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.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 sn(t,e,r,n,s,i,o){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=s,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=o}var Cr={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){Cr[t]=new sn(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];Cr[e]=new sn(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){Cr[t]=new sn(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){Cr[t]=new sn(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){Cr[t]=new sn(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){Cr[t]=new sn(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){Cr[t]=new sn(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){Cr[t]=new sn(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){Cr[t]=new sn(t,5,!1,t.toLowerCase(),null,!1,!1)});var D1=/[\-:]([a-z])/g;function M1(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(D1,M1);Cr[e]=new sn(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(D1,M1);Cr[e]=new sn(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(D1,M1);Cr[e]=new sn(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){Cr[t]=new sn(t,1,!1,t.toLowerCase(),null,!1,!1)});Cr.xlinkHref=new sn("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){Cr[t]=new sn(t,1,!1,t.toLowerCase(),null,!0,!0)});function $1(t,e,r,n){var s=Cr.hasOwnProperty(e)?Cr[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(JF(e,r,s,n)&&(r=null),n||s===null?YF(e)&&(r===null?t.removeAttribute(e):t.setAttribute(e,""+r)):s.mustUseProperty?t[s.propertyName]=r===null?s.type===3?!1:"":r:(e=s.attributeName,n=s.attributeNamespace,r===null?t.removeAttribute(e):(s=s.type,r=s===3||s===4&&r===!0?"":""+r,n?t.setAttributeNS(n,e,r):t.setAttribute(e,r))))}var Rs=KF.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,_f=Symbol.for("react.element"),Ul=Symbol.for("react.portal"),zl=Symbol.for("react.fragment"),L1=Symbol.for("react.strict_mode"),Nb=Symbol.for("react.profiler"),WI=Symbol.for("react.provider"),GI=Symbol.for("react.context"),F1=Symbol.for("react.forward_ref"),_b=Symbol.for("react.suspense"),Sb=Symbol.for("react.suspense_list"),B1=Symbol.for("react.memo"),Ys=Symbol.for("react.lazy"),KI=Symbol.for("react.offscreen"),QS=Symbol.iterator;function rd(t){return t===null||typeof t!="object"?null:(t=QS&&t[QS]||t["@@iterator"],typeof t=="function"?t:null)}var $t=Object.assign,qv;function Pd(t){if(qv===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);qv=e&&e[1]||""}return`
34`+qv+t}var Wv=!1;function Gv(t,e){if(!t||Wv)return"";Wv=!0;var r=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(e)if(e=function(){throw Error()},Object.defineProperty(e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(e,[])}catch(u){var n=u}Reflect.construct(t,[],e)}else{try{e.call()}catch(u){n=u}t.call(e.prototype)}else{try{throw Error()}catch(u){n=u}t()}}
vendor: 18,193 bytes, lines 34-37
34catch(u){if(u&&n&&typeof u.stack=="string"){for(var s=u.stack.split(`
35`),i=n.stack.split(`
36`),o=s.length-1,l=i.length-1;1<=o&&0<=l&&s[o]!==i[l];)l--;for(;1<=o&&0<=l;o--,l--)if(s[o]!==i[l]){if(o!==1||l!==1)do if(o--,l--,0>l||s[o]!==i[l]){var c=`
37`+s[o].replace(" at new "," at ");return t.displayName&&c.includes("<anonymous>")&&(c=c.replace("<anonymous>",t.displayName)),c}while(1<=o&&0<=l);break}}}finally{Wv=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Pd(t):""}function ZF(t){switch(t.tag){case 5:return Pd(t.type);case 16:return Pd("Lazy");case 13:return Pd("Suspense");case 19:return Pd("SuspenseList");case 0:case 2:case 15:return t=Gv(t.type,!1),t;case 11:return t=Gv(t.type.render,!1),t;case 1:return t=Gv(t.type,!0),t;default:return""}}function Tb(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 zl:return"Fragment";case Ul:return"Portal";case Nb:return"Profiler";case L1:return"StrictMode";case _b:return"Suspense";case Sb:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case GI:return(t.displayName||"Context")+".Consumer";case WI:return(t._context.displayName||"Context")+".Provider";case F1:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case B1:return e=t.displayName||null,e!==null?e:Tb(t.type)||"Memo";case Ys:e=t._payload,t=t._init;try{return Tb(t(e))}catch{}}return null}function e8(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 Tb(e);case 8:return e===L1?"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 Ii(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function XI(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function t8(t){var e=XI(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var s=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return s.call(this)},set:function(o){n=""+o,i.call(this,o)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(o){n=""+o},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Sf(t){t._valueTracker||(t._valueTracker=t8(t))}function YI(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=XI(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Up(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 Ab(t,e){var r=e.checked;return $t({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function JS(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Ii(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function QI(t,e){e=e.checked,e!=null&&$1(t,"checked",e,!1)}function Eb(t,e){QI(t,e);var r=Ii(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?kb(t,e.type,r):e.hasOwnProperty("defaultValue")&&kb(t,e.type,Ii(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function ZS(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function kb(t,e,r){(e!=="number"||Up(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Cd=Array.isArray;function ic(t,e,r,n){if(t=t.options,e){e={};for(var s=0;s<r.length;s++)e["$"+r[s]]=!0;for(r=0;r<t.length;r++)s=e.hasOwnProperty("$"+t[r].value),t[r].selected!==s&&(t[r].selected=s),s&&n&&(t[r].defaultSelected=!0)}else{for(r=""+Ii(r),e=null,s=0;s<t.length;s++){if(t[s].value===r){t[s].selected=!0,n&&(t[s].defaultSelected=!0);return}e!==null||t[s].disabled||(e=t[s])}e!==null&&(e.selected=!0)}}function Pb(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(le(91));return $t({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function eT(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(le(92));if(Cd(r)){if(1<r.length)throw Error(le(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Ii(r)}}function JI(t,e){var r=Ii(e.value),n=Ii(e.defaultValue);r!=null&&(r=""+r,r!==t.value&&(t.value=r),e.defaultValue==null&&t.defaultValue!==r&&(t.defaultValue=r)),n!=null&&(t.defaultValue=""+n)}function tT(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function ZI(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Cb(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?ZI(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Tf,eO=function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(e,r,n,s){MSApp.execUnsafeLocalFunction(function(){return t(e,r,n,s)})}:t}(function(t,e){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=e;else{for(Tf=Tf||document.createElement("div"),Tf.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=Tf.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function hh(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ud={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},r8=["Webkit","ms","Moz","O"];Object.keys(Ud).forEach(function(t){r8.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ud[e]=Ud[t]})});function tO(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ud.hasOwnProperty(t)&&Ud[t]?(""+e).trim():e+"px"}function rO(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=tO(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var n8=$t({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 Ib(t,e){if(e){if(n8[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(le(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(le(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(le(61))}if(e.style!=null&&typeof e.style!="object")throw Error(le(62))}}function Ob(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 Rb=null;function V1(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Db=null,oc=null,lc=null;function rT(t){if(t=Am(t)){if(typeof Db!="function")throw Error(le(280));var e=t.stateNode;e&&(e=Gx(e),Db(t.stateNode,t.type,e))}}function nO(t){oc?lc?lc.push(t):lc=[t]:oc=t}function aO(){if(oc){var t=oc,e=lc;if(lc=oc=null,rT(t),e)for(t=0;t<e.length;t++)rT(e[t])}}function sO(t,e){return t(e)}function iO(){}var Kv=!1;function oO(t,e,r){if(Kv)return t(e,r);Kv=!0;try{return sO(t,e,r)}finally{Kv=!1,(oc!==null||lc!==null)&&(iO(),aO())}}function mh(t,e){var r=t.stateNode;if(r===null)return null;var n=Gx(r);if(n===null)return null;r=n[e];e:switch(e){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(t=t.type,n=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!n;break e;default:t=!1}if(t)return null;if(r&&typeof r!="function")throw Error(le(231,e,typeof r));return r}var Mb=!1;if(js)try{var nd={};Object.defineProperty(nd,"passive",{get:function(){Mb=!0}}),window.addEventListener("test",nd,nd),window.removeEventListener("test",nd,nd)}catch{Mb=!1}function a8(t,e,r,n,s,i,o,l,c){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(d){this.onError(d)}}var zd=!1,zp=null,Hp=!1,$b=null,s8={onError:function(t){zd=!0,zp=t}};function i8(t,e,r,n,s,i,o,l,c){zd=!1,zp=null,a8.apply(s8,arguments)}function o8(t,e,r,n,s,i,o,l,c){if(i8.apply(this,arguments),zd){if(zd){var u=zp;zd=!1,zp=null}else throw Error(le(198));Hp||(Hp=!0,$b=u)}}function hl(t){var e=t,r=t;if(t.alternate)for(;e.return;)e=e.return;else{t=e;do e=t,e.flags&4098&&(r=e.return),t=e.return;while(t)}return e.tag===3?r:null}function lO(t){if(t.tag===13){var e=t.memoizedState;if(e===null&&(t=t.alternate,t!==null&&(e=t.memoizedState)),e!==null)return e.dehydrated}return null}function nT(t){if(hl(t)!==t)throw Error(le(188))}function l8(t){var e=t.alternate;if(!e){if(e=hl(t),e===null)throw Error(le(188));return e!==t?null:t}for(var r=t,n=e;;){var s=r.return;if(s===null)break;var i=s.alternate;if(i===null){if(n=s.return,n!==null){r=n;continue}break}if(s.child===i.child){for(i=s.child;i;){if(i===r)return nT(s),t;if(i===n)return nT(s),e;i=i.sibling}throw Error(le(188))}if(r.return!==n.return)r=s,n=i;else{for(var o=!1,l=s.child;l;){if(l===r){o=!0,r=s,n=i;break}if(l===n){o=!0,n=s,r=i;break}l=l.sibling}if(!o){for(l=i.child;l;){if(l===r){o=!0,r=i,n=s;break}if(l===n){o=!0,n=i,r=s;break}l=l.sibling}if(!o)throw Error(le(189))}}if(r.alternate!==n)throw Error(le(190))}if(r.tag!==3)throw Error(le(188));return r.stateNode.current===r?t:e}function cO(t){return t=l8(t),t!==null?uO(t):null}function uO(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=uO(t);if(e!==null)return e;t=t.sibling}return null}var dO=On.unstable_scheduleCallback,aT=On.unstable_cancelCallback,c8=On.unstable_shouldYield,u8=On.unstable_requestPaint,Wt=On.unstable_now,d8=On.unstable_getCurrentPriorityLevel,U1=On.unstable_ImmediatePriority,hO=On.unstable_UserBlockingPriority,qp=On.unstable_NormalPriority,h8=On.unstable_LowPriority,mO=On.unstable_IdlePriority,zx=null,Da=null;function m8(t){if(Da&&typeof Da.onCommitFiberRoot=="function")try{Da.onCommitFiberRoot(zx,t,void 0,(t.current.flags&128)===128)}catch{}}var ha=Math.clz32?Math.clz32:g8,f8=Math.log,p8=Math.LN2;function g8(t){return t>>>=0,t===0?32:31-(f8(t)/p8|0)|0}var Af=64,Ef=4194304;function Id(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 Wp(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,s=t.suspendedLanes,i=t.pingedLanes,o=r&268435455;if(o!==0){var l=o&~s;l!==0?n=Id(l):(i&=o,i!==0&&(n=Id(i)))}else o=r&~s,o!==0?n=Id(o):i!==0&&(n=Id(i));if(n===0)return 0;if(e!==0&&e!==n&&!(e&s)&&(s=n&-n,i=e&-e,s>=i||s===16&&(i&4194240)!==0))return e;if(n&4&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0<e;)r=31-ha(e),s=1<<r,n|=t[r],e&=~s;return n}function x8(t,e){switch(t){case 1:case 2:case 4:return e+250;case 8:case 16:case 32:case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return e+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function y8(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var o=31-ha(i),l=1<<o,c=s[o];c===-1?(!(l&r)||l&n)&&(s[o]=x8(l,e)):c<=e&&(t.expiredLanes|=l),i&=~l}}function Lb(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function fO(){var t=Af;return Af<<=1,!(Af&4194240)&&(Af=64),t}function Xv(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function Sm(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-ha(e),t[e]=r}function v8(t,e){var r=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 n=t.eventTimes;for(t=t.expirationTimes;0<r;){var s=31-ha(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function z1(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-ha(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var ct=0;function pO(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var gO,H1,xO,yO,vO,Fb=!1,kf=[],pi=null,gi=null,xi=null,fh=new Map,ph=new Map,Zs=[],b8="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset submit".split(" ");function sT(t,e){switch(t){case"focusin":case"focusout":pi=null;break;case"dragenter":case"dragleave":gi=null;break;case"mouseover":case"mouseout":xi=null;break;case"pointerover":case"pointerout":fh.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":ph.delete(e.pointerId)}}function ad(t,e,r,n,s,i){return t===null||t.nativeEvent!==i?(t={blockedOn:e,domEventName:r,eventSystemFlags:n,nativeEvent:i,targetContainers:[s]},e!==null&&(e=Am(e),e!==null&&H1(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function w8(t,e,r,n,s){switch(e){case"focusin":return pi=ad(pi,t,e,r,n,s),!0;case"dragenter":return gi=ad(gi,t,e,r,n,s),!0;case"mouseover":return xi=ad(xi,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return fh.set(i,ad(fh.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,ph.set(i,ad(ph.get(i)||null,t,e,r,n,s)),!0}return!1}function bO(t){var e=go(t.target);if(e!==null){var r=hl(e);if(r!==null){if(e=r.tag,e===13){if(e=lO(r),e!==null){t.blockedOn=e,vO(t.priority,function(){xO(r)});return}}else if(e===3&&r.stateNode.current.memoizedState.isDehydrated){t.blockedOn=r.tag===3?r.stateNode.containerInfo:null;return}}}t.blockedOn=null}function gp(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=Bb(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);Rb=n,r.target.dispatchEvent(n),Rb=null}else return e=Am(r),e!==null&&H1(e),t.blockedOn=r,!1;e.shift()}return!0}function iT(t,e,r){gp(t)&&r.delete(e)}function j8(){Fb=!1,pi!==null&&gp(pi)&&(pi=null),gi!==null&&gp(gi)&&(gi=null),xi!==null&&gp(xi)&&(xi=null),fh.forEach(iT),ph.forEach(iT)}function sd(t,e){t.blockedOn===e&&(t.blockedOn=null,Fb||(Fb=!0,On.unstable_scheduleCallback(On.unstable_NormalPriority,j8)))}function gh(t){function e(s){return sd(s,t)}if(0<kf.length){sd(kf[0],t);for(var r=1;r<kf.length;r++){var n=kf[r];n.blockedOn===t&&(n.blockedOn=null)}}for(pi!==null&&sd(pi,t),gi!==null&&sd(gi,t),xi!==null&&sd(xi,t),fh.forEach(e),ph.forEach(e),r=0;r<Zs.length;r++)n=Zs[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<Zs.length&&(r=Zs[0],r.blockedOn===null);)bO(r),r.blockedOn===null&&Zs.shift()}var cc=Rs.ReactCurrentBatchConfig,Gp=!0;function N8(t,e,r,n){var s=ct,i=cc.transition;cc.transition=null;try{ct=1,q1(t,e,r,n)}finally{ct=s,cc.transition=i}}function _8(t,e,r,n){var s=ct,i=cc.transition;cc.transition=null;try{ct=4,q1(t,e,r,n)}finally{ct=s,cc.transition=i}}function q1(t,e,r,n){if(Gp){var s=Bb(t,e,r,n);if(s===null)s0(t,e,n,Kp,r),sT(t,n);else if(w8(s,t,e,r,n))n.stopPropagation();else if(sT(t,n),e&4&&-1<b8.indexOf(t)){for(;s!==null;){var i=Am(s);if(i!==null&&gO(i),i=Bb(t,e,r,n),i===null&&s0(t,e,n,Kp,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else s0(t,e,n,null,r)}}var Kp=null;function Bb(t,e,r,n){if(Kp=null,t=V1(n),t=go(t),t!==null)if(e=hl(t),e===null)t=null;else if(r=e.tag,r===13){if(t=lO(e),t!==null)return t;t=null}else if(r===3){if(e.stateNode.current.memoizedState.isDehydrated)return e.tag===3?e.stateNode.containerInfo:null;t=null}else e!==t&&(t=null);return Kp=t,null}
vendor: 10,401 bytes, line 37
37function wO(t){switch(t){case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 1;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(d8()){case U1:return 1;case hO:return 4;case qp:case h8:return 16;case mO:return 536870912;default:return 16}default:return 16}}var ci=null,W1=null,xp=null;function jO(){if(xp)return xp;var t,e=W1,r=e.length,n,s="value"in ci?ci.value:ci.textContent,i=s.length;for(t=0;t<r&&e[t]===s[t];t++);var o=r-t;for(n=1;n<=o&&e[r-n]===s[i-n];n++);return xp=s.slice(t,1<n?1-n:void 0)}function yp(t){var e=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&e===13&&(t=13)):t=e,t===10&&(t=13),32<=t||t===13?t:0}function Pf(){return!0}function oT(){return!1}function $n(t){function e(r,n,s,i,o){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=o,this.currentTarget=null;for(var l in t)t.hasOwnProperty(l)&&(r=t[l],this[l]=r?r(i):i[l]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Pf:oT,this.isPropagationStopped=oT,this}return $t(e.prototype,{preventDefault:function(){this.defaultPrevented=!0;var r=this.nativeEvent;r&&(r.preventDefault?r.preventDefault():typeof r.returnValue!="unknown"&&(r.returnValue=!1),this.isDefaultPrevented=Pf)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Pf)},persist:function(){},isPersistent:Pf}),e}var xu={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},G1=$n(xu),Tm=$t({},xu,{view:0,detail:0}),S8=$n(Tm),Yv,Qv,id,Hx=$t({},Tm,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:K1,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==id&&(id&&t.type==="mousemove"?(Yv=t.screenX-id.screenX,Qv=t.screenY-id.screenY):Qv=Yv=0,id=t),Yv)},movementY:function(t){return"movementY"in t?t.movementY:Qv}}),lT=$n(Hx),T8=$t({},Hx,{dataTransfer:0}),A8=$n(T8),E8=$t({},Tm,{relatedTarget:0}),Jv=$n(E8),k8=$t({},xu,{animationName:0,elapsedTime:0,pseudoElement:0}),P8=$n(k8),C8=$t({},xu,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),I8=$n(C8),O8=$t({},xu,{data:0}),cT=$n(O8),R8={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},D8={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},M8={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function $8(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=M8[t])?!!e[t]:!1}function K1(){return $8}var L8=$t({},Tm,{key:function(t){if(t.key){var e=R8[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=yp(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?D8[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:K1,charCode:function(t){return t.type==="keypress"?yp(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?yp(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),F8=$n(L8),B8=$t({},Hx,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),uT=$n(B8),V8=$t({},Tm,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:K1}),U8=$n(V8),z8=$t({},xu,{propertyName:0,elapsedTime:0,pseudoElement:0}),H8=$n(z8),q8=$t({},Hx,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),W8=$n(q8),G8=[9,13,27,32],X1=js&&"CompositionEvent"in window,Hd=null;js&&"documentMode"in document&&(Hd=document.documentMode);var K8=js&&"TextEvent"in window&&!Hd,NO=js&&(!X1||Hd&&8<Hd&&11>=Hd),dT=" ",hT=!1;function _O(t,e){switch(t){case"keyup":return G8.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function SO(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Hl=!1;function X8(t,e){switch(t){case"compositionend":return SO(e);case"keypress":return e.which!==32?null:(hT=!0,dT);case"textInput":return t=e.data,t===dT&&hT?null:t;default:return null}}function Y8(t,e){if(Hl)return t==="compositionend"||!X1&&_O(t,e)?(t=jO(),xp=W1=ci=null,Hl=!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.char.length)return e.char;if(e.which)return String.fromCharCode(e.which)}return null;case"compositionend":return NO&&e.locale!=="ko"?null:e.data;default:return null}}var Q8={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function mT(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!Q8[t.type]:e==="textarea"}function TO(t,e,r,n){nO(n),e=Xp(e,"onChange"),0<e.length&&(r=new G1("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var qd=null,xh=null;function J8(t){$O(t,0)}function qx(t){var e=Gl(t);if(YI(e))return t}function Z8(t,e){if(t==="change")return e}var AO=!1;if(js){var Zv;if(js){var e0="oninput"in document;if(!e0){var fT=document.createElement("div");fT.setAttribute("oninput","return;"),e0=typeof fT.oninput=="function"}Zv=e0}else Zv=!1;AO=Zv&&(!document.documentMode||9<document.documentMode)}function pT(){qd&&(qd.detachEvent("onpropertychange",EO),xh=qd=null)}function EO(t){if(t.propertyName==="value"&&qx(xh)){var e=[];TO(e,xh,t,V1(t)),oO(J8,e)}}function e7(t,e,r){t==="focusin"?(pT(),qd=e,xh=r,qd.attachEvent("onpropertychange",EO)):t==="focusout"&&pT()}function t7(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return qx(xh)}function r7(t,e){if(t==="click")return qx(e)}function n7(t,e){if(t==="input"||t==="change")return qx(e)}function a7(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var pa=typeof Object.is=="function"?Object.is:a7;function yh(t,e){if(pa(t,e))return!0;if(typeof t!="object"||t===null||typeof e!="object"||e===null)return!1;var r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(n=0;n<r.length;n++){var s=r[n];if(!jb.call(e,s)||!pa(t[s],e[s]))return!1}return!0}function gT(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function xT(t,e){var r=gT(t);t=0;for(var n;r;){if(r.nodeType===3){if(n=t+r.textContent.length,t<=e&&n>=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=gT(r)}}function kO(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?kO(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function PO(){for(var t=window,e=Up();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Up(t.document)}return e}function Y1(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 s7(t){var e=PO(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&kO(r.ownerDocument.documentElement,r)){if(n!==null&&Y1(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var s=r.textContent.length,i=Math.min(n.start,s);n=n.end===void 0?i:Math.min(n.end,s),!t.extend&&i>n&&(s=n,n=i,i=s),s=xT(r,i);var o=xT(r,n);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>n?(t.addRange(e),t.extend(o.node,o.offset)):(e.setEnd(o.node,o.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r<e.length;r++)t=e[r],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var i7=js&&"documentMode"in document&&11>=document.documentMode,ql=null,Vb=null,Wd=null,Ub=!1;function yT(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;Ub||ql==null||ql!==Up(n)||(n=ql,"selectionStart"in n&&Y1(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focu
vendor: 4,383 bytes, line 37
37sNode:n.focusNode,focusOffset:n.focusOffset}),Wd&&yh(Wd,n)||(Wd=n,n=Xp(Vb,"onSelect"),0<n.length&&(e=new G1("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=ql)))}function Cf(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Wl={animationend:Cf("Animation","AnimationEnd"),animationiteration:Cf("Animation","AnimationIteration"),animationstart:Cf("Animation","AnimationStart"),transitionend:Cf("Transition","TransitionEnd")},t0={},CO={};js&&(CO=document.createElement("div").style,"AnimationEvent"in window||(delete Wl.animationend.animation,delete Wl.animationiteration.animation,delete Wl.animationstart.animation),"TransitionEvent"in window||delete Wl.transitionend.transition);function Wx(t){if(t0[t])return t0[t];if(!Wl[t])return t;var e=Wl[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in CO)return t0[t]=e[r];return t}var IO=Wx("animationend"),OO=Wx("animationiteration"),RO=Wx("animationstart"),DO=Wx("transitionend"),MO=new Map,vT="abort auxClick cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");function Li(t,e){MO.set(t,e),dl(e,[t])}for(var r0=0;r0<vT.length;r0++){var n0=vT[r0],o7=n0.toLowerCase(),l7=n0[0].toUpperCase()+n0.slice(1);Li(o7,"on"+l7)}Li(IO,"onAnimationEnd");Li(OO,"onAnimationIteration");Li(RO,"onAnimationStart");Li("dblclick","onDoubleClick");Li("focusin","onFocus");Li("focusout","onBlur");Li(DO,"onTransitionEnd");_c("onMouseEnter",["mouseout","mouseover"]);_c("onMouseLeave",["mouseout","mouseover"]);_c("onPointerEnter",["pointerout","pointerover"]);_c("onPointerLeave",["pointerout","pointerover"]);dl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));dl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));dl("onBeforeInput",["compositionend","keypress","textInput","paste"]);dl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));dl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));dl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Od="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),c7=new Set("cancel close invalid load scroll toggle".split(" ").concat(Od));function bT(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,o8(n,e,void 0,t),t.currentTarget=null}function $O(t,e){e=(e&4)!==0;for(var r=0;r<t.length;r++){var n=t[r],s=n.event;n=n.listeners;e:{var i=void 0;if(e)for(var o=n.length-1;0<=o;o--){var l=n[o],c=l.instance,u=l.currentTarget;if(l=l.listener,c!==i&&s.isPropagationStopped())break e;bT(s,l,u),i=c}else for(o=0;o<n.length;o++){if(l=n[o],c=l.instance,u=l.currentTarget,l=l.listener,c!==i&&s.isPropagationStopped())break e;bT(s,l,u),i=c}}}if(Hp)throw t=$b,Hp=!1,$b=null,t}function _t(t,e){var r=e[Gb];r===void 0&&(r=e[Gb]=new Set);var n=t+"__bubble";r.has(n)||(LO(e,t,2,!1),r.add(n))}function a0(t,e,r){var n=0;e&&(n|=4),LO(r,t,n,e)}var If="_reactListening"+Math.random().toString(36).slice(2);function vh(t){if(!t[If]){t[If]=!0,qI.forEach(function(r){r!=="selectionchange"&&(c7.has(r)||a0(r,!1,t),a0(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[If]||(e[If]=!0,a0("selectionchange",!1,e))}}function LO(t,e,r,n){switch(wO(e)){case 1:var s=N8;break;case 4:s=_8;break;default:s=q1}r=s.bind(null,e,r,t),s=void 0,!Mb||e!=="touchstart"&&e!=="touchmove"&&e!=="wheel"||(s=!0),n?s!==void 0?t.addEventListener(e,r,{capture:!0,passive:s}):t.addEventListener(e,r,!0):s!==void 0?t.addEventListener(e,r,{passive:s}):t.addEventListener(e,r,!1)}function s0(t,e,r,n,s){var i=n;
vendor: 5,435 bytes, lines 37-38
37if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var o=n.tag;if(o===3||o===4){var l=n.stateNode.containerInfo;if(l===s||l.nodeType===8&&l.parentNode===s)break;if(o===4)for(o=n.return;o!==null;){var c=o.tag;if((c===3||c===4)&&(c=o.stateNode.containerInfo,c===s||c.nodeType===8&&c.parentNode===s))return;o=o.return}for(;l!==null;){if(o=go(l),o===null)return;if(c=o.tag,c===5||c===6){n=i=o;continue e}l=l.parentNode}}n=n.return}oO(function(){var u=i,d=V1(r),h=[];e:{var m=MO.get(t);if(m!==void 0){var p=G1,x=t;switch(t){case"keypress":if(yp(r)===0)break e;case"keydown":case"keyup":p=F8;break;case"focusin":x="focus",p=Jv;break;case"focusout":x="blur",p=Jv;break;case"beforeblur":case"afterblur":p=Jv;break;case"click":if(r.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":p=lT;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":p=A8;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":p=U8;break;case IO:case OO:case RO:p=P8;break;case DO:p=H8;break;case"scroll":p=S8;break;case"wheel":p=W8;break;case"copy":case"cut":case"paste":p=I8;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":p=uT}var w=(e&4)!==0,g=!w&&t==="scroll",v=w?m!==null?m+"Capture":null:m;w=[];for(var b=u,y;b!==null;){y=b;var T=y.stateNode;if(y.tag===5&&T!==null&&(y=T,v!==null&&(T=mh(b,v),T!=null&&w.push(bh(b,T,y)))),g)break;b=b.return}0<w.length&&(m=new p(m,x,null,r,d),h.push({event:m,listeners:w}))}}if(!(e&7)){e:{if(m=t==="mouseover"||t==="pointerover",p=t==="mouseout"||t==="pointerout",m&&r!==Rb&&(x=r.relatedTarget||r.fromElement)&&(go(x)||x[Ns]))break e;if((p||m)&&(m=d.window===d?d:(m=d.ownerDocument)?m.defaultView||m.parentWindow:window,p?(x=r.relatedTarget||r.toElement,p=u,x=x?go(x):null,x!==null&&(g=hl(x),x!==g||x.tag!==5&&x.tag!==6)&&(x=null)):(p=null,x=u),p!==x)){if(w=lT,T="onMouseLeave",v="onMouseEnter",b="mouse",(t==="pointerout"||t==="pointerover")&&(w=uT,T="onPointerLeave",v="onPointerEnter",b="pointer"),g=p==null?m:Gl(p),y=x==null?m:Gl(x),m=new w(T,b+"leave",p,r,d),m.target=g,m.relatedTarget=y,T=null,go(d)===u&&(w=new w(v,b+"enter",x,r,d),w.target=y,w.relatedTarget=g,T=w),g=T,p&&x)t:{for(w=p,v=x,b=0,y=w;y;y=Il(y))b++;for(y=0,T=v;T;T=Il(T))y++;for(;0<b-y;)w=Il(w),b--;for(;0<y-b;)v=Il(v),y--;for(;b--;){if(w===v||v!==null&&w===v.alternate)break t;w=Il(w),v=Il(v)}w=null}else w=null;p!==null&&wT(h,m,p,w,!1),x!==null&&g!==null&&wT(h,g,x,w,!0)}}e:{if(m=u?Gl(u):window,p=m.nodeName&&m.nodeName.toLowerCase(),p==="select"||p==="input"&&m.type==="file")var N=Z8;else if(mT(m))if(AO)N=n7;else{N=t7;var j=e7}else(p=m.nodeName)&&p.toLowerCase()==="input"&&(m.type==="checkbox"||m.type==="radio")&&(N=r7);if(N&&(N=N(t,u))){TO(h,N,r,d);break e}j&&j(t,m,u),t==="focusout"&&(j=m._wrapperState)&&j.controlled&&m.type==="number"&&kb(m,"number",m.value)}switch(j=u?Gl(u):window,t){case"focusin":(mT(j)||j.contentEditable==="true")&&(ql=j,Vb=u,Wd=null);break;case"focusout":Wd=Vb=ql=null;break;case"mousedown":Ub=!0;break;case"contextmenu":case"mouseup":case"dragend":Ub=!1,yT(h,r,d);break;case"selectionchange":if(i7)break;case"keydown":case"keyup":yT(h,r,d)}var _;if(X1)e:{switch(t){case"compositionstart":var S="onCompositionStart";break e;case"compositionend":S="onCompositionEnd";break e;case"compositionupdate":S="onCompositionUpdate";break e}S=void 0}else Hl?_O(t,r)&&(S="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(S="onCompositionStart");S&&(NO&&r.locale!=="ko"&&(Hl||S!=="onCompositionStart"?S==="onCompositionEnd"&&Hl&&(_=jO()):(ci=d,W1="value"in ci?ci.value:ci.textContent,Hl=!0)),j=Xp(u,S),0<j.length&&(S=new cT(S,t,null,r,d),h.push({event:S,listeners:j}),_?S.data=_:(_=SO(r),_!==null&&(S.data=_)))),(_=K8?X8(t,r):Y8(t,r))&&(u=Xp(u,"onBeforeInput"),0<u.length&&(d=new cT("onBeforeInput","beforeinput",null,r,d),h.push({event:d,listeners:u}),d.data=_))}$O(h,e)})}function bh(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Xp(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=mh(t,r),i!=null&&n.unshift(bh(t,i,s)),i=mh(t,e),i!=null&&n.push(bh(t,i,s))),t=t.return}return n}function Il(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function wT(t,e,r,n,s){for(var i=e._reactName,o=[];r!==null&&r!==n;){var l=r,c=l.alternate,u=l.stateNode;if(c!==null&&c===n)break;l.tag===5&&u!==null&&(l=u,s?(c=mh(r,i),c!=null&&o.unshift(bh(r,c,l))):s||(c=mh(r,i),c!=null&&o.push(bh(r,c,l)))),r=r.return}o.length!==0&&t.push({event:e,listeners:o})}var u7=/\r\n?/g,d7=/\u0000|\uFFFD/g;function jT(t){return(typeof t=="string"?t:""+t).replace(u7,`
38`).replace(d7,"")}function Of(t,e,r){if(e=jT(e),jT(t)!==e&&r)throw Error(le(425))}function Yp(){}var zb=null,Hb=null;function qb(t,e){return t==="textarea"||t==="noscript"||typeof e.children=="string"||typeof e.children=="number"||typeof e.dangerouslySetInnerHTML=="object"&&e.dangerouslySetInnerHTML!==null&&e.dangerouslySetInnerHTML.__html!=null}var Wb=typeof setTimeout=="function"?setTimeout:void 0,h7=typeof clearTimeout=="function"?clearTimeout:void 0,NT=typeof Promise=="function"?Promise:void 0,m7=typeof queueMicrotask=="function"?queueMicrotask:typeof NT<"u"?function(t){return NT.resolve(null).then(t).cat
vendor: 4,832 bytes, line 38
38ch(f7)}:Wb;function f7(t){setTimeout(function(){throw t})}function i0(t,e){var r=e,n=0;do{var s=r.nextSibling;if(t.removeChild(r),s&&s.nodeType===8)if(r=s.data,r==="/$"){if(n===0){t.removeChild(s),gh(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);gh(e)}function yi(t){for(;t!=null;t=t.nextSibling){var e=t.nodeType;if(e===1||e===3)break;if(e===8){if(e=t.data,e==="$"||e==="$!"||e==="$?")break;if(e==="/$")return null}}return t}function _T(t){t=t.previousSibling;for(var e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="$"||r==="$!"||r==="$?"){if(e===0)return t;e--}else r==="/$"&&e++}t=t.previousSibling}return null}var yu=Math.random().toString(36).slice(2),Pa="__reactFiber$"+yu,wh="__reactProps$"+yu,Ns="__reactContainer$"+yu,Gb="__reactEvents$"+yu,p7="__reactListeners$"+yu,g7="__reactHandles$"+yu;function go(t){var e=t[Pa];if(e)return e;for(var r=t.parentNode;r;){if(e=r[Ns]||r[Pa]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=_T(t);t!==null;){if(r=t[Pa])return r;t=_T(t)}return e}t=r,r=t.parentNode}return null}function Am(t){return t=t[Pa]||t[Ns],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Gl(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(le(33))}function Gx(t){return t[wh]||null}var Kb=[],Kl=-1;function Fi(t){return{current:t}}function Et(t){0>Kl||(t.current=Kb[Kl],Kb[Kl]=null,Kl--)}function bt(t,e){Kl++,Kb[Kl]=t.current,t.current=e}var Oi={},Gr=Fi(Oi),dn=Fi(!1),$o=Oi;function Sc(t,e){var r=t.type.contextTypes;if(!r)return Oi;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var s={},i;for(i in r)s[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=s),s}function hn(t){return t=t.childContextTypes,t!=null}function Qp(){Et(dn),Et(Gr)}function ST(t,e,r){if(Gr.current!==Oi)throw Error(le(168));bt(Gr,e),bt(dn,r)}function FO(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var s in n)if(!(s in e))throw Error(le(108,e8(t)||"Unknown",s));return $t({},r,n)}function Jp(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Oi,$o=Gr.current,bt(Gr,t),bt(dn,dn.current),!0}function TT(t,e,r){var n=t.stateNode;if(!n)throw Error(le(169));r?(t=FO(t,e,$o),n.__reactInternalMemoizedMergedChildContext=t,Et(dn),Et(Gr),bt(Gr,t)):Et(dn),bt(dn,r)}var is=null,Kx=!1,o0=!1;function BO(t){is===null?is=[t]:is.push(t)}function x7(t){Kx=!0,BO(t)}function Bi(){if(!o0&&is!==null){o0=!0;var t=0,e=ct;try{var r=is;for(ct=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}is=null,Kx=!1}catch(s){throw is!==null&&(is=is.slice(t+1)),dO(U1,Bi),s}finally{ct=e,o0=!1}}return null}var Xl=[],Yl=0,Zp=null,eg=0,Un=[],zn=0,Lo=null,os=1,ls="";function oo(t,e){Xl[Yl++]=eg,Xl[Yl++]=Zp,Zp=t,eg=e}function VO(t,e,r){Un[zn++]=os,Un[zn++]=ls,Un[zn++]=Lo,Lo=t;var n=os;t=ls;var s=32-ha(n)-1;n&=~(1<<s),r+=1;var i=32-ha(e)+s;if(30<i){var o=s-s%5;i=(n&(1<<o)-1).toString(32),n>>=o,s-=o,os=1<<32-ha(e)+s|r<<s|n,ls=i+t}else os=1<<i|r<<s|n,ls=t}function Q1(t){t.return!==null&&(oo(t,1),VO(t,1,0))}function J1(t){for(;t===Zp;)Zp=Xl[--Yl],Xl[Yl]=null,eg=Xl[--Yl],Xl[Yl]=null;for(;t===Lo;)Lo=Un[--zn],Un[zn]=null,ls=Un[--zn],Un[zn]=null,os=Un[--zn],Un[zn]=null}var kn=null,Tn=null,Pt=!1,ca=null;function UO(t,e){var r=qn(5,null,null,0);r.elementType="DELETED",r.stateNode=e,r.return=t,e=t.deletions,e===null?(t.deletions=[r],t.flags|=16):e.push(r)}function AT(t,e){switch(t.tag){case 5:var r=t.type;return e=e.nodeType!==1||r.toLowerCase()!==e.nodeName.toLowerCase()?null:e,e!==null?(t.stateNode=e,kn=t,Tn=yi(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,kn=t,Tn=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=Lo!==null?{id:os,overflow:ls}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=qn(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,kn=t,Tn=null,!0):!1;default:return!1}}function Xb(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Yb(t){if(Pt){var e=Tn;if(e){var r=e;if(!AT(t,e)){if(Xb(t))throw Error(le(418));e=yi(r.nextSibling);var n=kn;e&&AT(t,e)?UO(n,r):(t.flags=t.flags&-4097|2,Pt=!1,kn=t)}}else{if(Xb(t))throw Error(le(418));t.flags=t.flags&-4097|2,Pt=!1,kn=t}}}function ET(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;kn=t}function Rf(t){if(t!==kn)return!1;if(!Pt)return ET(t),Pt=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!qb(t.type,t.memoizedProps)),e&&(e=Tn)){if(Xb(t))throw zO(),Error(le(418));for(;e;)UO(t,e),e=yi(e.nextSibling)}if(ET(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(le(317));e:{for(t=t.nextSibling,e=0;t;
vendor: 12,492 bytes, line 38
38){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){Tn=yi(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}Tn=null}}else Tn=kn?yi(t.stateNode.nextSibling):null;return!0}function zO(){for(var t=Tn;t;)t=yi(t.nextSibling)}function Tc(){Tn=kn=null,Pt=!1}function Z1(t){ca===null?ca=[t]:ca.push(t)}var y7=Rs.ReactCurrentBatchConfig;function od(t,e,r){if(t=r.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(r._owner){if(r=r._owner,r){if(r.tag!==1)throw Error(le(309));var n=r.stateNode}if(!n)throw Error(le(147,t));var s=n,i=""+t;return e!==null&&e.ref!==null&&typeof e.ref=="function"&&e.ref._stringRef===i?e.ref:(e=function(o){var l=s.refs;o===null?delete l[i]:l[i]=o},e._stringRef=i,e)}if(typeof t!="string")throw Error(le(284));if(!r._owner)throw Error(le(290,t))}return t}function Df(t,e){throw t=Object.prototype.toString.call(e),Error(le(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function kT(t){var e=t._init;return e(t._payload)}function HO(t){function e(v,b){if(t){var y=v.deletions;y===null?(v.deletions=[b],v.flags|=16):y.push(b)}}function r(v,b){if(!t)return null;for(;b!==null;)e(v,b),b=b.sibling;return null}function n(v,b){for(v=new Map;b!==null;)b.key!==null?v.set(b.key,b):v.set(b.index,b),b=b.sibling;return v}function s(v,b){return v=ji(v,b),v.index=0,v.sibling=null,v}function i(v,b,y){return v.index=y,t?(y=v.alternate,y!==null?(y=y.index,y<b?(v.flags|=2,b):y):(v.flags|=2,b)):(v.flags|=1048576,b)}function o(v){return t&&v.alternate===null&&(v.flags|=2),v}function l(v,b,y,T){return b===null||b.tag!==6?(b=f0(y,v.mode,T),b.return=v,b):(b=s(b,y),b.return=v,b)}function c(v,b,y,T){var N=y.type;return N===zl?d(v,b,y.props.children,T,y.key):b!==null&&(b.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ys&&kT(N)===b.type)?(T=s(b,y.props),T.ref=od(v,b,y),T.return=v,T):(T=Sp(y.type,y.key,y.props,null,v.mode,T),T.ref=od(v,b,y),T.return=v,T)}function u(v,b,y,T){return b===null||b.tag!==4||b.stateNode.containerInfo!==y.containerInfo||b.stateNode.implementation!==y.implementation?(b=p0(y,v.mode,T),b.return=v,b):(b=s(b,y.children||[]),b.return=v,b)}function d(v,b,y,T,N){return b===null||b.tag!==7?(b=ko(y,v.mode,T,N),b.return=v,b):(b=s(b,y),b.return=v,b)}function h(v,b,y){if(typeof b=="string"&&b!==""||typeof b=="number")return b=f0(""+b,v.mode,y),b.return=v,b;if(typeof b=="object"&&b!==null){switch(b.$$typeof){case _f:return y=Sp(b.type,b.key,b.props,null,v.mode,y),y.ref=od(v,null,b),y.return=v,y;case Ul:return b=p0(b,v.mode,y),b.return=v,b;case Ys:var T=b._init;return h(v,T(b._payload),y)}if(Cd(b)||rd(b))return b=ko(b,v.mode,y,null),b.return=v,b;Df(v,b)}return null}function m(v,b,y,T){var N=b!==null?b.key:null;if(typeof y=="string"&&y!==""||typeof y=="number")return N!==null?null:l(v,b,""+y,T);if(typeof y=="object"&&y!==null){switch(y.$$typeof){case _f:return y.key===N?c(v,b,y,T):null;case Ul:return y.key===N?u(v,b,y,T):null;case Ys:return N=y._init,m(v,b,N(y._payload),T)}if(Cd(y)||rd(y))return N!==null?null:d(v,b,y,T,null);Df(v,y)}return null}function p(v,b,y,T,N){if(typeof T=="string"&&T!==""||typeof T=="number")return v=v.get(y)||null,l(b,v,""+T,N);if(typeof T=="object"&&T!==null){switch(T.$$typeof){case _f:return v=v.get(T.key===null?y:T.key)||null,c(b,v,T,N);case Ul:return v=v.get(T.key===null?y:T.key)||null,u(b,v,T,N);case Ys:var j=T._init;return p(v,b,y,j(T._payload),N)}if(Cd(T)||rd(T))return v=v.get(y)||null,d(b,v,T,N,null);Df(b,T)}return null}function x(v,b,y,T){for(var N=null,j=null,_=b,S=b=0,k=null;_!==null&&S<y.length;S++){_.index>S?(k=_,_=null):k=_.sibling;var I=m(v,_,y[S],T);if(I===null){_===null&&(_=k);break}t&&_&&I.alternate===null&&e(v,_),b=i(I,b,S),j===null?N=I:j.sibling=I,j=I,_=k}if(S===y.length)return r(v,_),Pt&&oo(v,S),N;if(_===null){for(;S<y.length;S++)_=h(v,y[S],T),_!==null&&(b=i(_,b,S),j===null?N=_:j.sibling=_,j=_);return Pt&&oo(v,S),N}for(_=n(v,_);S<y.length;S++)k=p(_,v,S,y[S],T),k!==null&&(t&&k.alternate!==null&&_.delete(k.key===null?S:k.key),b=i(k,b,S),j===null?N=k:j.sibling=k,j=k);return t&&_.forEach(function(E){return e(v,E)}),Pt&&oo(v,S),N}function w(v,b,y,T){var N=rd(y);if(typeof N!="function")throw Error(le(150));if(y=N.call(y),y==null)throw Error(le(151));for(var j=N=null,_=b,S=b=0,k=null,I=y.next();_!==null&&!I.done;S++,I=y.next()){_.index>S?(k=_,_=null):k=_.sibling;var E=m(v,_,I.value,T);if(E===null){_===null&&(_=k);break}t&&_&&E.alternate===null&&e(v,_),b=i(E,b,S),j===null?N=E:j.sibling=E,j=E,_=k}if(I.done)return r(v,_),Pt&&oo(v,S),N;if(_===null){for(;!I.done;S++,I=y.next())I=h(v,I.value,T),I!==null&&(b=i(I,b,S),j===null?N=I:j.sibling=I,j=I);return Pt&&oo(v,S),N}for(_=n(v,_);!I.done;S++,I=y.next())I=p(_,v,S,I.value,T),I!==null&&(t&&I.alternate!==null&&_.delete(I.key===null?S:I.key),b=i(I,b,S),j===null?N=I:j.sibling=I,j=I);return t&&_.forEach(function(C){return e(v,C)}),Pt&&oo(v,S),N}function g(v,b,y,T){if(typeof y=="object"&&y!==null&&y.type===zl&&y.key===null&&(y=y.props.children),typeof y=="object"&&y!==null){switch(y.$$typeof){case _f:e:{for(var N=y.key,j=b;j!==null;){if(j.key===N){if(N=y.type,N===zl){if(j.tag===7){r(v,j.sibling),b=s(j,y.props.children),b.return=v,v=b;break e}}else if(j.elementType===N||typeof N=="object"&&N!==null&&N.$$typeof===Ys&&kT(N)===j.type){r(v,j.sibling),b=s(j,y.props),b.ref=od(v,j,y),b.return=v,v=b;break e}r(v,j);break}else e(v,j);j=j.sibling}y.type===zl?(b=ko(y.props.children,v.mode,T,y.key),b.return=v,v=b):(T=Sp(y.type,y.key,y.props,null,v.mode,T),T.ref=od(v,b,y),T.return=v,v=T)}return o(v);case Ul:e:{for(j=y.key;b!==null;){if(b.key===j)if(b.tag===4&&b.stateNode.containerInfo===y.containerInfo&&b.stateNode.implementation===y.implementation){r(v,b.sibling),b=s(b,y.children||[]),b.return=v,v=b;break e}else{r(v,b);break}else e(v,b);b=b.sibling}b=p0(y,v.mode,T),b.return=v,v=b}return o(v);case Ys:return j=y._init,g(v,b,j(y._payload),T)}if(Cd(y))return x(v,b,y,T);if(rd(y))return w(v,b,y,T);Df(v,y)}return typeof y=="string"&&y!==""||typeof y=="number"?(y=""+y,b!==null&&b.tag===6?(r(v,b.sibling),b=s(b,y),b.return=v,v=b):(r(v,b),b=f0(y,v.mode,T),b.return=v,v=b),o(v)):r(v,b)}return g}var Ac=HO(!0),qO=HO(!1),tg=Fi(null),rg=null,Ql=null,eN=null;function tN(){eN=Ql=rg=null}function rN(t){var e=tg.current;Et(tg),t._currentValue=e}function Qb(t,e,r){for(;t!==null;){var n=t.alternate;if((t.childLanes&e)!==e?(t.childLanes|=e,n!==null&&(n.childLanes|=e)):n!==null&&(n.childLanes&e)!==e&&(n.childLanes|=e),t===r)break;t=t.return}}function uc(t,e){rg=t,eN=Ql=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(cn=!0),t.firstContext=null)}function Xn(t){var e=t._currentValue;if(eN!==t)if(t={context:t,memoizedValue:e,next:null},Ql===null){if(rg===null)throw Error(le(308));Ql=t,rg.dependencies={lanes:0,firstContext:t}}else Ql=Ql.next=t;return e}var xo=null;function nN(t){xo===null?xo=[t]:xo.push(t)}function WO(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,nN(e)):(r.next=s.next,s.next=r),e.interleaved=r,_s(t,n)}function _s(t,e){t.lanes|=e;var r=t.alternate;for(r!==null&&(r.lanes|=e),r=t,t=t.return;t!==null;)t.childLanes|=e,r=t.alternate,r!==null&&(r.childLanes|=e),r=t,t=t.return;return r.tag===3?r.stateNode:null}var Qs=!1;function aN(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function GO(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 ps(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function vi(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,Qe&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,_s(t,r)}return s=n.interleaved,s===null?(e.next=e,nN(n)):(e.next=s.next,s.next=e),n.interleaved=e,_s(t,r)}function vp(t,e,r){if(e=e.updateQueue,e!==null&&(e=e.shared,(r&4194240)!==0)){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,z1(t,r)}}function PT(t,e){var r=t.updateQueue,n=t.alternate;if(n!==null&&(n=n.updateQueue,r===n)){var s=null,i=null;if(r=r.firstBaseUpdate,r!==null){do{var o={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=o:i=i.next=o,r=r.next}while(r!==null);i===null?s=i=e:i=i.next=e}else s=i=e;r={baseState:n.baseState,firstBaseUpdate:s,lastBaseUpdate:i,shared:n.shared,effects:n.effects},t.updateQueue=r;return}t=r.lastBaseUpdate,t===null?r.firstBaseUpdate=e:t.next=e,r.lastBaseUpdate=e}function ng(t,e,r,n){var s=t.updateQueue;Qs=!1;var i=s.firstBaseUpdate,o=s.lastBaseUpdate,l=s.shared.pending;if(l!==null){s.shared.pending=null;var c=l,u=c.next;c.next=null,o===null?i=u:o.next=u,o=c;var d=t.alternate;d!==null&&(d=d.updateQueue,l=d.lastBaseUpdate,l!==o&&(l===null?d.firstBaseUpdate=u:l.next=u,d.lastBaseUpdate=c))}if(i!==null){var h=s.baseState;o=0,d=u=c=null,l=i;do{var m=l.lane,p=l.eventTime;if((n&m)===m){d!==null&&(d=d.next={eventTime:p,lane:0,tag:l.tag,payload:l.payload,callback:l.callback,next:null});e:{var x=t,w=l;switch(m=e,p=r,w.tag){case 1:if(x=w.payload,typeof x=="function"){h=x.call(p,h,m);break e}h=x;break e;case 3:x.flags=x.flags&-65537|128;case 0:if(x=w.payload,m=typeof x=="function"?x.call(p,h,m):x,m==null)break e;h=$t({},h,m);break e;case 2:Qs=!0}}l.callback!==null&&l.lane!==0&&(t.flags|=64,m=s.effects,m===null?s.effects=[l]:m.push(l))}else p={eventTime:p,lane:m,tag:l.tag,payload:l.payload,callback:l.callback,next:null},d===null?(u=d=p,c=h):d=d.next=p,o|=m;if(l=l.next,l===null){if(l=s.shared.pending,l===null)break;m=l,l=m.next,m.next=null,s.lastBaseUpdate=m,s.shared.pending=null}}while(!0);if(d===null&&(c=h),s.baseState=c,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);Bo|=o,t.lanes=o,t.memoizedState=h}}function CT(t,e,r){if(t=e.effects,e.effects=null,t!==null)for(e=0;e<t.length;e++){var n=t[e],s=n.callback;if(s!==null){if(n.callback=null,n=r,typeof s!="function")throw Error(le(191,s));s.call(n)}}}var Em={},Ma=Fi(Em),jh=Fi(Em),Nh=Fi(Em);function yo(t){if(t===Em)throw Error(le(174));return t}function sN(t,e){switch(bt(Nh,e),bt(jh,t),bt(Ma,Em),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:Cb(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=Cb(e,t)}Et(Ma),bt(Ma,e)}function Ec(){Et(Ma),Et(jh),Et(Nh)}function KO(t){yo(Nh.current);var e=yo(Ma.current),r=Cb(e,t.type);e!==r&&(bt(jh,t),bt(Ma,r))}function iN(t){jh.current===t&&(Et(Ma),Et(jh))}var Ot=Fi(0);function ag(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if(e.flags&128)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var l0=[];function oN(){for(var t=0;t<l0.length;t++)l0[t]._workInProgressVersionPrimary=null;l0.length=0}var bp=Rs.ReactCurrentDispatcher,c0=Rs.ReactCurrentBatchConfig,Fo=0,Dt=null,sr=null,pr=null,sg=!1,Gd=!1,_h=0,v7=0;function $r(){throw Error(le(321))}function lN(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!pa(t[r],e[r]))return!1;return!0}function cN(t,e,r,n,s,i){if(Fo=i,Dt=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,bp.current=t===null||t.memoizedState===null?N7:_7,t=r(n,s),Gd){i=0;do{if(Gd=!1,_h=0,25<=i)throw Error(le(301));i+=1,pr=sr=null,e.updateQueue=null,bp.current=S7,t=r(n,s)}while(Gd)}if(bp.current=ig,e=sr!==null&&sr.next!==null,Fo=0,pr=sr=Dt=null,sg=!1,e)throw Error(le(300));return t}function uN(){var t=_h!==0;return _h=0,t}function Ea(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return pr===null?Dt.memoizedState=pr=t:pr=pr.next=t,pr}function Yn(){if(sr===null){var t=Dt.alternate;t=t!==null?t.memoizedState:null}else t=sr.next;var e=pr===null?Dt.memoizedState:pr.next;if(e!==null)pr=e,sr=t;else{if(t===null)throw Error(le(310));sr=t,t={memoizedState:sr.memoizedState,baseState:sr.baseState,baseQueue:sr.baseQueue,queue:sr.queue,next:null},pr===null?Dt.memoizedState=pr=t:pr=pr.next=t}return pr}function Sh(t,e){return typeof e=="function"?e(t):e}function u0(t){var e=Yn(),r=e.queue;if(r===null)throw Error(le(311));r.lastRenderedReducer=t;
vendor: 3,606 bytes, line 38
38var n=sr,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var o=s.next;s.next=i.next,i.next=o}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var l=o=null,c=null,u=i;do{var d=u.lane;if((Fo&d)===d)c!==null&&(c=c.next={lane:0,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),n=u.hasEagerState?u.eagerState:t(n,u.action);else{var h={lane:d,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};c===null?(l=c=h,o=n):c=c.next=h,Dt.lanes|=d,Bo|=d}u=u.next}while(u!==null&&u!==i);c===null?o=n:c.next=l,pa(n,e.memoizedState)||(cn=!0),e.memoizedState=n,e.baseState=o,e.baseQueue=c,r.lastRenderedState=n}if(t=r.interleaved,t!==null){s=t;do i=s.lane,Dt.lanes|=i,Bo|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function d0(t){var e=Yn(),r=e.queue;if(r===null)throw Error(le(311));r.lastRenderedReducer=t;var n=r.dispatch,s=r.pending,i=e.memoizedState;if(s!==null){r.pending=null;var o=s=s.next;do i=t(i,o.action),o=o.next;while(o!==s);pa(i,e.memoizedState)||(cn=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function XO(){}function YO(t,e){var r=Dt,n=Yn(),s=e(),i=!pa(n.memoizedState,s);if(i&&(n.memoizedState=s,cn=!0),n=n.queue,dN(ZO.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||pr!==null&&pr.memoizedState.tag&1){if(r.flags|=2048,Th(9,JO.bind(null,r,n,s,e),void 0,null),yr===null)throw Error(le(349));Fo&30||QO(r,e,s)}return s}function QO(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function JO(t,e,r,n){e.value=r,e.getSnapshot=n,eR(e)&&tR(t)}function ZO(t,e,r){return r(function(){eR(e)&&tR(t)})}function eR(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!pa(t,r)}catch{return!0}}function tR(t){var e=_s(t,1);e!==null&&ma(e,t,1,-1)}function IT(t){var e=Ea();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Sh,lastRenderedState:t},e.queue=t,t=t.dispatch=j7.bind(null,Dt,t),[e.memoizedState,t]}function Th(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=Dt.updateQueue,e===null?(e={lastEffect:null,stores:null},Dt.updateQueue=e,e.lastEffect=t.next=t):(r=e.lastEffect,r===null?e.lastEffect=t.next=t:(n=r.next,r.next=t,t.next=n,e.lastEffect=t)),t}function rR(){return Yn().memoizedState}function wp(t,e,r,n){var s=Ea();Dt.flags|=t,s.memoizedState=Th(1|e,r,void 0,n===void 0?null:n)}function Xx(t,e,r,n){var s=Yn();n=n===void 0?null:n;var i=void 0;if(sr!==null){var o=sr.memoizedState;if(i=o.destroy,n!==null&&lN(n,o.deps)){s.memoizedState=Th(e,r,i,n);return}}Dt.flags|=t,s.memoizedState=Th(1|e,r,i,n)}function OT(t,e){return wp(8390656,8,t,e)}function dN(t,e){return Xx(2048,8,t,e)}function nR(t,e){return Xx(4,2,t,e)}function aR(t,e){return Xx(4,4,t,e)}function sR(t,e){if(typeof e=="function")return t=t(),e(t),function(){e(null)};if(e!=null)return t=t(),e.current=t,function(){e.current=null}}function iR(t,e,r){return r=r!=null?r.concat([t]):null,Xx(4,4,sR.bind(null,e,t),r)}function hN(){}function oR(t,e){var r=Yn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&lN(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function lR(t,e){var r=Yn();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&lN(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function cR(t,e,r){return Fo&21?(pa(r,e)||(r=fO(),Dt.lanes|=r,Bo|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,
vendor: 8,008 bytes, lines 38-40
38cn=!0),t.memoizedState=r)}function b7(t,e){var r=ct;ct=r!==0&&4>r?r:4,t(!0);var n=c0.transition;c0.transition={};try{t(!1),e()}finally{ct=r,c0.transition=n}}function uR(){return Yn().memoizedState}function w7(t,e,r){var n=wi(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},dR(t))hR(e,r);else if(r=WO(t,e,r,n),r!==null){var s=tn();ma(r,t,n,s),mR(r,e,n)}}function j7(t,e,r){var n=wi(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(dR(t))hR(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,l=i(o,r);if(s.hasEagerState=!0,s.eagerState=l,pa(l,o)){var c=e.interleaved;c===null?(s.next=s,nN(e)):(s.next=c.next,c.next=s),e.interleaved=s;return}}catch{}finally{}r=WO(t,e,s,n),r!==null&&(s=tn(),ma(r,t,n,s),mR(r,e,n))}}function dR(t){var e=t.alternate;return t===Dt||e!==null&&e===Dt}function hR(t,e){Gd=sg=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function mR(t,e,r){if(r&4194240){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,z1(t,r)}}var ig={readContext:Xn,useCallback:$r,useContext:$r,useEffect:$r,useImperativeHandle:$r,useInsertionEffect:$r,useLayoutEffect:$r,useMemo:$r,useReducer:$r,useRef:$r,useState:$r,useDebugValue:$r,useDeferredValue:$r,useTransition:$r,useMutableSource:$r,useSyncExternalStore:$r,useId:$r,unstable_isNewReconciler:!1},N7={readContext:Xn,useCallback:function(t,e){return Ea().memoizedState=[t,e===void 0?null:e],t},useContext:Xn,useEffect:OT,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,wp(4194308,4,sR.bind(null,e,t),r)},useLayoutEffect:function(t,e){return wp(4194308,4,t,e)},useInsertionEffect:function(t,e){return wp(4,2,t,e)},useMemo:function(t,e){var r=Ea();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ea();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=w7.bind(null,Dt,t),[n.memoizedState,t]},useRef:function(t){var e=Ea();return t={current:t},e.memoizedState=t},useState:IT,useDebugValue:hN,useDeferredValue:function(t){return Ea().memoizedState=t},useTransition:function(){var t=IT(!1),e=t[0];return t=b7.bind(null,t[1]),Ea().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=Dt,s=Ea();if(Pt){if(r===void 0)throw Error(le(407));r=r()}else{if(r=e(),yr===null)throw Error(le(349));Fo&30||QO(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,OT(ZO.bind(null,n,i,t),[t]),n.flags|=2048,Th(9,JO.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=Ea(),e=yr.identifierPrefix;if(Pt){var r=ls,n=os;r=(n&~(1<<32-ha(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=_h++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=v7++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},_7={readContext:Xn,useCallback:oR,useContext:Xn,useEffect:dN,useImperativeHandle:iR,useInsertionEffect:nR,useLayoutEffect:aR,useMemo:lR,useReducer:u0,useRef:rR,useState:function(){return u0(Sh)},useDebugValue:hN,useDeferredValue:function(t){var e=Yn();return cR(e,sr.memoizedState,t)},useTransition:function(){var t=u0(Sh)[0],e=Yn().memoizedState;return[t,e]},useMutableSource:XO,useSyncExternalStore:YO,useId:uR,unstable_isNewReconciler:!1},S7={readContext:Xn,useCallback:oR,useContext:Xn,useEffect:dN,useImperativeHandle:iR,useInsertionEffect:nR,useLayoutEffect:aR,useMemo:lR,useReducer:d0,useRef:rR,useState:function(){return d0(Sh)},useDebugValue:hN,useDeferredValue:function(t){var e=Yn();return sr===null?e.memoizedState=t:cR(e,sr.memoizedState,t)},useTransition:function(){var t=d0(Sh)[0],e=Yn().memoizedState;return[t,e]},useMutableSource:XO,useSyncExternalStore:YO,useId:uR,unstable_isNewReconciler:!1};function sa(t,e){if(t&&t.defaultProps){e=$t({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function Jb(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:$t({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Yx={isMounted:function(t){return(t=t._reactInternals)?hl(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=tn(),s=wi(t),i=ps(n,s);i.payload=e,r!=null&&(i.callback=r),e=vi(t,i,s),e!==null&&(ma(e,t,s,n),vp(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=tn(),s=wi(t),i=ps(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=vi(t,i,s),e!==null&&(ma(e,t,s,n),vp(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=tn(),n=wi(t),s=ps(r,n);s.tag=2,e!=null&&(s.callback=e),e=vi(t,s,n),e!==null&&(ma(e,t,n,r),vp(e,t,n))}};function RT(t,e,r,n,s,i,o){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,o):e.prototype&&e.prototype.isPureReactComponent?!yh(r,n)||!yh(s,i):!0}function fR(t,e,r){var n=!1,s=Oi,i=e.contextType;return typeof i=="object"&&i!==null?i=Xn(i):(s=hn(e)?$o:Gr.current,n=e.contextTypes,i=(n=n!=null)?Sc(t,s):Oi),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Yx,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function DT(t,e,r,n){t=e.state,typeof e.componentWillReceiveProps=="function"&&e.componentWillReceiveProps(r,n),typeof e.UNSAFE_componentWillReceiveProps=="function"&&e.UNSAFE_componentWillReceiveProps(r,n),e.state!==t&&Yx.enqueueReplaceState(e,e.state,null)}function Zb(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},aN(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=Xn(i):(i=hn(e)?$o:Gr.current,s.context=Sc(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Jb(t,e,i,r),s.state=t.memoizedState),typeof e.getDerivedStateFromProps=="function"||typeof s.getSnapshotBeforeUpdate=="function"||typeof s.UNSAFE_componentWillMount!="function"&&typeof s.componentWillMount!="function"||(e=s.state,typeof s.componentWillMount=="function"&&s.componentWillMount(),typeof s.UNSAFE_componentWillMount=="function"&&s.UNSAFE_componentWillMount(),e!==s.state&&Yx.enqueueReplaceState(s,s.state,null),ng(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function kc(t,e){try{var r="",n=e;do r+=ZF(n),n=n.return;while(n);var s=r}catch(i){s=`
39Error generating stack: `+i.message+`
40`+i.stack}return{value:t,source:e,stack:s,digest:null}}function h0(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function ew(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var T7=typeof WeakMap=="function"?WeakMap:Map;function pR(t,e,r){r=ps(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){lg||(lg=!0,uw=n),ew(t,e)},r}function gR(t,e,r){r=ps(-1,r),r.tag=3;var n=t.type.getDerivedStateFromError;if(typeof n=="function"){var s=e.value;r.payload=function(){return n(s)},r.callback=function(){ew(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){ew(t,e),typeof n!="function"&&(bi===null?bi=new Set([this]):bi.add(this));var o=e.stack;this.componentDidCatch(e.value,{componentStack:o!==null?o:""})}),r}function MT(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new T7;var s=new Set;n.set(e,s)}else s=n.get(e),s===void 0&&(s=new Set,n.set(e,s));s.has(r)||(s.add(r),t=B7.bind(null,t,e,r),e.then(t,t))}function $T(t){do{var e;if((e=t.tag===13)&&(e=t.memoizedState,e=e!==null?e.dehydrated!==null:!0),e)return t;t=t.return}while(t!==null);return null}function LT(t,e,r,n,s){return t.mode&1?(t.flags|=65536,t.lanes=s,t):(t===e?t.flags|=65536:(t.flags|=128,r.flags|=131072,r.flags&=-52805,r.tag===1&&(r.alternate===null?r.tag=17:(e=ps(-1,1),e.tag=2,vi(r,e,1))),r.lanes|=1),t)}var A7=Rs.ReactCurrentOwner,cn=!1;function Qr(t,e,r,n){e.child=t===null?qO(e,null,r,n):Ac(e,t.child,r,n)}function FT(t,e,r,n,s){r=r.render;var i=e.ref;
vendor: 6,220 bytes, line 40
40return uc(e,s),n=cN(t,e,r,n,i,s),r=uN(),t!==null&&!cn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Ss(t,e,s)):(Pt&&r&&Q1(e),e.flags|=1,Qr(t,e,n,s),e.child)}function BT(t,e,r,n,s){if(t===null){var i=r.type;return typeof i=="function"&&!bN(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,xR(t,e,i,n,s)):(t=Sp(r.type,null,n,e,e.mode,s),t.ref=e.ref,t.return=e,e.child=t)}if(i=t.child,!(t.lanes&s)){var o=i.memoizedProps;if(r=r.compare,r=r!==null?r:yh,r(o,n)&&t.ref===e.ref)return Ss(t,e,s)}return e.flags|=1,t=ji(i,n),t.ref=e.ref,t.return=e,e.child=t}function xR(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(yh(i,n)&&t.ref===e.ref)if(cn=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(cn=!0);else return e.lanes=t.lanes,Ss(t,e,s)}return tw(t,e,r,n,s)}function yR(t,e,r){var n=e.pendingProps,s=n.children,i=t!==null?t.memoizedState:null;if(n.mode==="hidden")if(!(e.mode&1))e.memoizedState={baseLanes:0,cachePool:null,transitions:null},bt(Zl,Nn),Nn|=r;else{if(!(r&1073741824))return t=i!==null?i.baseLanes|r:r,e.lanes=e.childLanes=1073741824,e.memoizedState={baseLanes:t,cachePool:null,transitions:null},e.updateQueue=null,bt(Zl,Nn),Nn|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,bt(Zl,Nn),Nn|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,bt(Zl,Nn),Nn|=n;return Qr(t,e,s,r),e.child}function vR(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}function tw(t,e,r,n,s){var i=hn(r)?$o:Gr.current;return i=Sc(e,i),uc(e,s),r=cN(t,e,r,n,i,s),n=uN(),t!==null&&!cn?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,Ss(t,e,s)):(Pt&&n&&Q1(e),e.flags|=1,Qr(t,e,r,s),e.child)}function VT(t,e,r,n,s){if(hn(r)){var i=!0;Jp(e)}else i=!1;if(uc(e,s),e.stateNode===null)jp(t,e),fR(e,r,n),Zb(e,r,n,s),n=!0;else if(t===null){var o=e.stateNode,l=e.memoizedProps;o.props=l;var c=o.context,u=r.contextType;typeof u=="object"&&u!==null?u=Xn(u):(u=hn(r)?$o:Gr.current,u=Sc(e,u));var d=r.getDerivedStateFromProps,h=typeof d=="function"||typeof o.getSnapshotBeforeUpdate=="function";h||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==n||c!==u)&&DT(e,o,n,u),Qs=!1;var m=e.memoizedState;o.state=m,ng(e,n,o,s),c=e.memoizedState,l!==n||m!==c||dn.current||Qs?(typeof d=="function"&&(Jb(e,r,d,n),c=e.memoizedState),(l=Qs||RT(e,r,l,n,m,c,u))?(h||typeof o.UNSAFE_componentWillMount!="function"&&typeof o.componentWillMount!="function"||(typeof o.componentWillMount=="function"&&o.componentWillMount(),typeof o.UNSAFE_componentWillMount=="function"&&o.UNSAFE_componentWillMount()),typeof o.componentDidMount=="function"&&(e.flags|=4194308)):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=c),o.props=n,o.state=c,o.context=u,n=l):(typeof o.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{o=e.stateNode,GO(t,e),l=e.memoizedProps,u=e.type===e.elementType?l:sa(e.type,l),o.props=u,h=e.pendingProps,m=o.context,c=r.contextType,typeof c=="object"&&c!==null?c=Xn(c):(c=hn(r)?$o:Gr.current,c=Sc(e,c));var p=r.getDerivedStateFromProps;(d=typeof p=="function"||typeof o.getSnapshotBeforeUpdate=="function")||typeof o.UNSAFE_componentWillReceiveProps!="function"&&typeof o.componentWillReceiveProps!="function"||(l!==h||m!==c)&&DT(e,o,n,c),Qs=!1,m=e.memoizedState,o.state=m,ng(e,n,o,s);var x=e.memoizedState;l!==h||m!==x||dn.current||Qs?(typeof p=="function"&&(Jb(e,r,p,n),x=e.memoizedState),(u=Qs||RT(e,r,u,n,m,x,c)||!1)?(d||typeof o.UNSAFE_componentWillUpdate!="function"&&typeof o.componentWillUpdate!="function"||(typeof o.componentWillUpdate=="function"&&o.componentWillUpdate(n,x,c),typeof o.UNSAFE_componentWillUpdate=="function"&&o.UNSAFE_componentWillUpdate(n,x,c)),typeof o.componentDidUpdate=="function"&&(e.flags|=4),typeof o.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=x),o.props=n,o.state=x,o.context=c,n=u):(typeof o.componentDidUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=4),typeof o.getSnapshotBeforeUpdate!="function"||l===t.memoizedProps&&m===t.memoizedState||(e.flags|=1024),n=!1)}return rw(t,e,r,n,i,s)}function rw(t,e,r,n,s,i){vR(t,e);var o=(e.flags&128)!==0;if(!n&&!o)return s&&TT(e,r,!1),Ss(t,e,i);n=e.stateNode,A7.current=e;var l=o&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&o?(e.child=Ac(e,t.child,null,i),e.child=Ac(e,null,l,i)):Qr(t,e,l,i),e.memoizedState=n.state,s&&TT(e,r,!0),e.child}function bR(t){var e=t.stateNode;e.pendingContext?ST(t,e.pendingContext,e.pendingContext!==e.context):e.context&&ST(t,e.context,!1),sN(t,e.containerInfo)}function UT(t,e,r,n,s){return Tc(),Z1(s),e.flags|=256,Qr(t,e,r,n),e.child}var nw={dehydrated:null,treeContext:null,retryLane:0};function aw(t){return{baseLanes:t,cachePool:null,transitions:null}}function wR(t,e,r){var n=e.pendingProps,s=Ot.current,i=!1,o=(e.flags&128)!==0,l;if((l=o)||(l=t!==null&&t.memoizedState===null?!1:(s&2)!==0),l?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),bt(Ot,s&1),t===null)return Yb(e),t=e.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?(e.mode&1?t.data==="$!"?e.lanes=8:e.lanes=1073741824:e.lanes=1,null):(o=n.children,t=n.fallback,i?(n=e.mode,i=e.child,o={mode:"hidden",children:o},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=o):i=Zx(o,n,0,null),t=ko(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=aw(r),e.memoizedState=nw,t):mN(e,o));if(s=t.memoizedState,s!==null&&(l=s.dehydrated,l!==null))return E7(t,e,o,n,l,s,r);if(i){i=n.fallback,o=e.mode,s=t.child,l=s.sibling;var c={mode:"hidden",children:n.children};return!(o&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=c,e.deletions=null):(n=ji(s,c),n.subtreeFlags=s.subtreeFlags&14680064),l!==null?i=ji(l,i):(i=ko(i,o,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,o=t.child.memoizedState,o=o===null?aw(r):{base
vendor: 5,066 bytes, line 40
40Lanes:o.baseLanes|r,cachePool:null,transitions:o.transitions},i.memoizedState=o,i.childLanes=t.childLanes&~r,e.memoizedState=nw,n}return i=t.child,t=i.sibling,n=ji(i,{mode:"visible",children:n.children}),!(e.mode&1)&&(n.lanes=r),n.return=e,n.sibling=null,t!==null&&(r=e.deletions,r===null?(e.deletions=[t],e.flags|=16):r.push(t)),e.child=n,e.memoizedState=null,n}function mN(t,e){return e=Zx({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Mf(t,e,r,n){return n!==null&&Z1(n),Ac(e,t.child,null,r),t=mN(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function E7(t,e,r,n,s,i,o){if(r)return e.flags&256?(e.flags&=-257,n=h0(Error(le(422))),Mf(t,e,o,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=Zx({mode:"visible",children:n.children},s,0,null),i=ko(i,s,o,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&Ac(e,t.child,null,o),e.child.memoizedState=aw(o),e.memoizedState=nw,i);if(!(e.mode&1))return Mf(t,e,o,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var l=n.dgst;return n=l,i=Error(le(419)),n=h0(i,n,void 0),Mf(t,e,o,n)}if(l=(o&t.childLanes)!==0,cn||l){if(n=yr,n!==null){switch(o&-o){case 4:s=2;break;case 16:s=8;break;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:s=32;break;case 536870912:s=268435456;break;default:s=0}s=s&(n.suspendedLanes|o)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,_s(t,s),ma(n,t,s,-1))}return vN(),n=h0(Error(le(421))),Mf(t,e,o,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=V7.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,Tn=yi(s.nextSibling),kn=e,Pt=!0,ca=null,t!==null&&(Un[zn++]=os,Un[zn++]=ls,Un[zn++]=Lo,os=t.id,ls=t.overflow,Lo=e),e=mN(e,n.children),e.flags|=4096,e)}function zT(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Qb(t.return,e,r)}function m0(t,e,r,n,s){var i=t.memoizedState;i===null?t.memoizedState={isBackwards:e,rendering:null,renderingStartTime:0,last:n,tail:r,tailMode:s}:(i.isBackwards=e,i.rendering=null,i.renderingStartTime=0,i.last=n,i.tail=r,i.tailMode=s)}function jR(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(Qr(t,e,n.children,r),n=Ot.current,n&2)n=n&1|2,e.flags|=128;else{if(t!==null&&t.flags&128)e:for(t=e.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&zT(t,r,e);else if(t.tag===19)zT(t,r,e);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}n&=1}if(bt(Ot,n),!(e.mode&1))e.memoizedState=null;else switch(s){case"forwards":for(r=e.child,s=null;r!==null;)t=r.alternate,t!==null&&ag(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),m0(e,!1,s,r,i);break;case"backwards":for(r=null,s=e.child,e.child=null;s!==null;){if(t=s.alternate,t!==null&&ag(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}m0(e,!0,r,null,i);break;case"together":m0(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function jp(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function Ss(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Bo|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(le(153));if(e.child!==null){for(t=e.child,r=ji(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=ji(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function k7(t,e,r){switch(e.tag){case 3:bR(e),Tc();break;case 5:KO(e);break;case 1:hn(e.type)&&Jp(e);break;case 4:sN(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,s=e.memoizedProps.value;bt(tg,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(bt(Ot,Ot.current&1),e.flags|=128,null):r&e.child.childLanes?wR(t,e,r):(bt(Ot,Ot.current&1),t=Ss(t,e,r),t!==null?t.sibling:null);bt(Ot,Ot.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return jR(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),bt(Ot,Ot.current),n)break;return null;case 22:case 23:return e.lanes=0,yR(t,e,r)}return Ss(t,e,r)}var NR,sw,_R,SR;NR=function(t,e){for(var r=e.child;r!==null;){if(r.tag===5||r.tag===6)t.appendChild(r.stateNode);else if(r.tag!==4&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return;r=r.return}r.sibling.return=r.return,r=r.sibling}};sw=function(){};_R=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,yo(Ma.current);var i=null;switch(r){case"input":s=Ab(t,s),n=Ab(t,n),i=[];break;case"select":s=$t({},s,{value:void 0}),n=$t({},n,{value:void 0}),i=[];break;case"textarea":s=Pb(t,s),n=Pb(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Yp)}
vendor: 5,653 bytes, line 40
40Ib(r,n);var o;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var l=s[u];for(o in l)l.hasOwnProperty(o)&&(r||(r={}),r[o]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(dh.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var c=n[u];if(l=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&c!==l&&(c!=null||l!=null))if(u==="style")if(l){for(o in l)!l.hasOwnProperty(o)||c&&c.hasOwnProperty(o)||(r||(r={}),r[o]="");for(o in c)c.hasOwnProperty(o)&&l[o]!==c[o]&&(r||(r={}),r[o]=c[o])}else r||(i||(i=[]),i.push(u,r)),r=c;else u==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,l=l?l.__html:void 0,c!=null&&l!==c&&(i=i||[]).push(u,c)):u==="children"?typeof c!="string"&&typeof c!="number"||(i=i||[]).push(u,""+c):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(dh.hasOwnProperty(u)?(c!=null&&u==="onScroll"&&_t("scroll",t),i||l===c||(i=[])):(i=i||[]).push(u,c))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};SR=function(t,e,r,n){r!==n&&(e.flags|=4)};function ld(t,e){if(!Pt)switch(t.tailMode){case"hidden":e=t.tail;for(var r=null;e!==null;)e.alternate!==null&&(r=e),e=e.sibling;r===null?t.tail=null:r.sibling=null;break;case"collapsed":r=t.tail;for(var n=null;r!==null;)r.alternate!==null&&(n=r),r=r.sibling;n===null?e||t.tail===null?t.tail=null:t.tail.sibling=null:n.sibling=null}}function Lr(t){var e=t.alternate!==null&&t.alternate.child===t.child,r=0,n=0;if(e)for(var s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags&14680064,n|=s.flags&14680064,s.return=t,s=s.sibling;else for(s=t.child;s!==null;)r|=s.lanes|s.childLanes,n|=s.subtreeFlags,n|=s.flags,s.return=t,s=s.sibling;return t.subtreeFlags|=n,t.childLanes=r,e}function P7(t,e,r){var n=e.pendingProps;switch(J1(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Lr(e),null;case 1:return hn(e.type)&&Qp(),Lr(e),null;case 3:return n=e.stateNode,Ec(),Et(dn),Et(Gr),oN(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Rf(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,ca!==null&&(mw(ca),ca=null))),sw(t,e),Lr(e),null;case 5:iN(e);var s=yo(Nh.current);if(r=e.type,t!==null&&e.stateNode!=null)_R(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(le(166));return Lr(e),null}if(t=yo(Ma.current),Rf(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[Pa]=e,n[wh]=i,t=(e.mode&1)!==0,r){case"dialog":_t("cancel",n),_t("close",n);break;case"iframe":case"object":case"embed":_t("load",n);break;case"video":case"audio":for(s=0;s<Od.length;s++)_t(Od[s],n);break;case"source":_t("error",n);break;case"img":case"image":case"link":_t("error",n),_t("load",n);break;case"details":_t("toggle",n);break;case"input":JS(n,i),_t("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},_t("invalid",n);break;case"textarea":eT(n,i),_t("invalid",n)}Ib(r,i),s=null;for(var o in i)if(i.hasOwnProperty(o)){var l=i[o];o==="children"?typeof l=="string"?n.textContent!==l&&(i.suppressHydrationWarning!==!0&&Of(n.textContent,l,t),s=["children",l]):typeof l=="number"&&n.textContent!==""+l&&(i.suppressHydrationWarning!==!0&&Of(n.textContent,l,t),s=["children",""+l]):dh.hasOwnProperty(o)&&l!=null&&o==="onScroll"&&_t("scroll",n)}switch(r){case"input":Sf(n),ZS(n,i,!0);break;case"textarea":Sf(n),tT(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Yp)}n=s,e.updateQueue=n,n!==null&&(e.flags|=4)}else{o=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ZI(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=o.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=o.createElement(r,{is:n.is}):(t=o.createElement(r),r==="select"&&(o=t,n.multiple?o.multiple=!0:n.size&&(o.size=n.size))):t=o.createElementNS(t,r),t[Pa]=e,t[wh]=n,NR(t,e,!1,!1),e.stateNode=t;e:{switch(o=Ob(r,n),r){case"dialog":_t("cancel",t),_t("close",t),s=n;break;case"iframe":case"object":case"embed":_t("load",t),s=n;break;case"video":case"audio":for(s=0;s<Od.length;s++)_t(Od[s],t);s=n;break;case"source":_t("error",t),s=n;break;case"img":case"image":case"link":_t("error",t),_t("load",t),s=n;break;case"details":_t("toggle",t),s=n;break;case"input":JS(t,n),s=Ab(t,n),_t("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=$t({},n,{value:void 0}),_t("invalid",t);break;case"textarea":eT(t,n),s=Pb(t,n),_t("invalid",t);break;default:s=n}Ib(r,s),l=s;for(i in l)if(l.hasOwnProperty(i)){var c=l[i];i==="style"?rO(t,c):i==="dangerouslySetInnerHTML"?(c=c?c.__html:void 0,c!=null&&eO(t,c)):i==="children"?typeof c=="string"?(r!=="textarea"||c!=="")&&hh(t,c):typeof c=="number"&&hh(t,""+c):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(dh.hasOwnProperty(i)?c!=null&&i==="onScroll"&&_t("scroll",t):c!=null&&$1(t,i,c,o))}switch(r){case"input":Sf(t),ZS(t,n,!1);break;case"textarea":Sf(t),tT(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Ii(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?ic(t,!!n.multiple,i,!1):n.defaultValue!=null&&ic(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Yp)}switch(r){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}}n&&(e.flags|=4)}e.ref!==null&&(e.flags|=512,e.flags|=2097152)}
vendor: 32,266 bytes, line 40
40return Lr(e),null;case 6:if(t&&e.stateNode!=null)SR(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(le(166));if(r=yo(Nh.current),yo(Ma.current),Rf(e)){if(n=e.stateNode,r=e.memoizedProps,n[Pa]=e,(i=n.nodeValue!==r)&&(t=kn,t!==null))switch(t.tag){case 3:Of(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Of(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Pa]=e,e.stateNode=n}return Lr(e),null;case 13:if(Et(Ot),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Pt&&Tn!==null&&e.mode&1&&!(e.flags&128))zO(),Tc(),e.flags|=98560,i=!1;else if(i=Rf(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(le(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(le(317));i[Pa]=e}else Tc(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;Lr(e),i=!1}else ca!==null&&(mw(ca),ca=null),i=!0;if(!i)return e.flags&65536?e:null}return e.flags&128?(e.lanes=r,e):(n=n!==null,n!==(t!==null&&t.memoizedState!==null)&&n&&(e.child.flags|=8192,e.mode&1&&(t===null||Ot.current&1?or===0&&(or=3):vN())),e.updateQueue!==null&&(e.flags|=4),Lr(e),null);case 4:return Ec(),sw(t,e),t===null&&vh(e.stateNode.containerInfo),Lr(e),null;case 10:return rN(e.type._context),Lr(e),null;case 17:return hn(e.type)&&Qp(),Lr(e),null;case 19:if(Et(Ot),i=e.memoizedState,i===null)return Lr(e),null;if(n=(e.flags&128)!==0,o=i.rendering,o===null)if(n)ld(i,!1);else{if(or!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(o=ag(t),o!==null){for(e.flags|=128,ld(i,!1),n=o.updateQueue,n!==null&&(e.updateQueue=n,e.flags|=4),e.subtreeFlags=0,n=r,r=e.child;r!==null;)i=r,t=n,i.flags&=14680066,o=i.alternate,o===null?(i.childLanes=0,i.lanes=t,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=o.childLanes,i.lanes=o.lanes,i.child=o.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=o.memoizedProps,i.memoizedState=o.memoizedState,i.updateQueue=o.updateQueue,i.type=o.type,t=o.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return bt(Ot,Ot.current&1|2),e.child}t=t.sibling}i.tail!==null&&Wt()>Pc&&(e.flags|=128,n=!0,ld(i,!1),e.lanes=4194304)}else{if(!n)if(t=ag(o),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),ld(i,!0),i.tail===null&&i.tailMode==="hidden"&&!o.alternate&&!Pt)return Lr(e),null}else 2*Wt()-i.renderingStartTime>Pc&&r!==1073741824&&(e.flags|=128,n=!0,ld(i,!1),e.lanes=4194304);i.isBackwards?(o.sibling=e.child,e.child=o):(r=i.last,r!==null?r.sibling=o:e.child=o,i.last=o)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Wt(),e.sibling=null,r=Ot.current,bt(Ot,n?r&1|2:r&1),e):(Lr(e),null);case 22:case 23:return yN(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Nn&1073741824&&(Lr(e),e.subtreeFlags&6&&(e.flags|=8192)):Lr(e),null;case 24:return null;case 25:return null}throw Error(le(156,e.tag))}function C7(t,e){switch(J1(e),e.tag){case 1:return hn(e.type)&&Qp(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ec(),Et(dn),Et(Gr),oN(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return iN(e),null;case 13:if(Et(Ot),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(le(340));Tc()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Et(Ot),null;case 4:return Ec(),null;case 10:return rN(e.type._context),null;case 22:case 23:return yN(),null;case 24:return null;default:return null}}var $f=!1,Ur=!1,I7=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Jl(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Bt(t,e,n)}else r.current=null}function iw(t,e,r){try{r()}catch(n){Bt(t,e,n)}}var HT=!1;function O7(t,e){if(zb=Gp,t=PO(),Y1(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var s=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var o=0,l=-1,c=-1,u=0,d=0,h=t,m=null;t:for(;;){for(var p;h!==r||s!==0&&h.nodeType!==3||(l=o+s),h!==i||n!==0&&h.nodeType!==3||(c=o+n),h.nodeType===3&&(o+=h.nodeValue.length),(p=h.firstChild)!==null;)m=h,h=p;for(;;){if(h===t)break t;if(m===r&&++u===s&&(l=o),m===i&&++d===n&&(c=o),(p=h.nextSibling)!==null)break;h=m,m=h.parentNode}h=p}r=l===-1||c===-1?null:{start:l,end:c}}else r=null}r=r||{start:0,end:0}}else r=null;for(Hb={focusedElem:t,selectionRange:r},Gp=!1,ge=e;ge!==null;)if(e=ge,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,ge=t;else for(;ge!==null;){e=ge;try{var x=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(x!==null){var w=x.memoizedProps,g=x.memoizedState,v=e.stateNode,b=v.getSnapshotBeforeUpdate(e.elementType===e.type?w:sa(e.type,w),g);v.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var y=e.stateNode.containerInfo;y.nodeType===1?y.textContent="":y.nodeType===9&&y.documentElement&&y.removeChild(y.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(le(163))}}catch(T){Bt(e,e.return,T)}if(t=e.sibling,t!==null){t.return=e.return,ge=t;break}ge=e.return}return x=HT,HT=!1,x}function Kd(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var s=n=n.next;do{if((s.tag&t)===t){var i=s.destroy;s.destroy=void 0,i!==void 0&&iw(e,r,i)}s=s.next}while(s!==n)}}function Qx(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function ow(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function TR(t){var e=t.alternate;e!==null&&(t.alternate=null,TR(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Pa],delete e[wh],delete e[Gb],delete e[p7],delete e[g7])),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 AR(t){return t.tag===5||t.tag===3||t.tag===4}function qT(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||AR(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 lw(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Yp));else if(n!==4&&(t=t.child,t!==null))for(lw(t,e,r),t=t.sibling;t!==null;)lw(t,e,r),t=t.sibling}function cw(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(cw(t,e,r),t=t.sibling;t!==null;)cw(t,e,r),t=t.sibling}var Sr=null,ia=!1;function Ws(t,e,r){for(r=r.child;r!==null;)ER(t,e,r),r=r.sibling}function ER(t,e,r){if(Da&&typeof Da.onCommitFiberUnmount=="function")try{Da.onCommitFiberUnmount(zx,r)}catch{}switch(r.tag){case 5:Ur||Jl(r,e);case 6:var n=Sr,s=ia;Sr=null,Ws(t,e,r),Sr=n,ia=s,Sr!==null&&(ia?(t=Sr,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):Sr.removeChild(r.stateNode));break;case 18:Sr!==null&&(ia?(t=Sr,r=r.stateNode,t.nodeType===8?i0(t.parentNode,r):t.nodeType===1&&i0(t,r),gh(t)):i0(Sr,r.stateNode));break;case 4:n=Sr,s=ia,Sr=r.stateNode.containerInfo,ia=!0,Ws(t,e,r),Sr=n,ia=s;break;case 0:case 11:case 14:case 15:if(!Ur&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,o=i.destroy;i=i.tag,o!==void 0&&(i&2||i&4)&&iw(r,e,o),s=s.next}while(s!==n)}Ws(t,e,r);break;case 1:if(!Ur&&(Jl(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(l){Bt(r,e,l)}Ws(t,e,r);break;case 21:Ws(t,e,r);break;case 22:r.mode&1?(Ur=(n=Ur)||r.memoizedState!==null,Ws(t,e,r),Ur=n):Ws(t,e,r);break;default:Ws(t,e,r)}}function WT(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new I7),e.forEach(function(n){var s=U7.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function na(t,e){var r=e.deletions;if(r!==null)for(var n=0;n<r.length;n++){var s=r[n];try{var i=t,o=e,l=o;e:for(;l!==null;){switch(l.tag){case 5:Sr=l.stateNode,ia=!1;break e;case 3:Sr=l.stateNode.containerInfo,ia=!0;break e;case 4:Sr=l.stateNode.containerInfo,ia=!0;break e}l=l.return}if(Sr===null)throw Error(le(160));ER(i,o,s),Sr=null,ia=!1;var c=s.alternate;c!==null&&(c.return=null),s.return=null}catch(u){Bt(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)kR(e,t),e=e.sibling}function kR(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(na(e,t),Aa(t),n&4){try{Kd(3,t,t.return),Qx(3,t)}catch(w){Bt(t,t.return,w)}try{Kd(5,t,t.return)}catch(w){Bt(t,t.return,w)}}break;case 1:na(e,t),Aa(t),n&512&&r!==null&&Jl(r,r.return);break;case 5:if(na(e,t),Aa(t),n&512&&r!==null&&Jl(r,r.return),t.flags&32){var s=t.stateNode;try{hh(s,"")}catch(w){Bt(t,t.return,w)}}if(n&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,o=r!==null?r.memoizedProps:i,l=t.type,c=t.updateQueue;if(t.updateQueue=null,c!==null)try{l==="input"&&i.type==="radio"&&i.name!=null&&QI(s,i),Ob(l,o);var u=Ob(l,i);for(o=0;o<c.length;o+=2){var d=c[o],h=c[o+1];d==="style"?rO(s,h):d==="dangerouslySetInnerHTML"?eO(s,h):d==="children"?hh(s,h):$1(s,d,h,u)}switch(l){case"input":Eb(s,i);break;case"textarea":JI(s,i);break;case"select":var m=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var p=i.value;p!=null?ic(s,!!i.multiple,p,!1):m!==!!i.multiple&&(i.defaultValue!=null?ic(s,!!i.multiple,i.defaultValue,!0):ic(s,!!i.multiple,i.multiple?[]:"",!1))}s[wh]=i}catch(w){Bt(t,t.return,w)}}break;case 6:if(na(e,t),Aa(t),n&4){if(t.stateNode===null)throw Error(le(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(w){Bt(t,t.return,w)}}break;case 3:if(na(e,t),Aa(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{gh(e.containerInfo)}catch(w){Bt(t,t.return,w)}break;case 4:na(e,t),Aa(t);break;case 13:na(e,t),Aa(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(gN=Wt())),n&4&&WT(t);break;case 22:if(d=r!==null&&r.memoizedState!==null,t.mode&1?(Ur=(u=Ur)||d,na(e,t),Ur=u):na(e,t),Aa(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!d&&t.mode&1)for(ge=t,d=t.child;d!==null;){for(h=ge=d;ge!==null;){switch(m=ge,p=m.child,m.tag){case 0:case 11:case 14:case 15:Kd(4,m,m.return);break;case 1:Jl(m,m.return);var x=m.stateNode;if(typeof x.componentWillUnmount=="function"){n=m,r=m.return;try{e=n,x.props=e.memoizedProps,x.state=e.memoizedState,x.componentWillUnmount()}catch(w){Bt(n,r,w)}}break;case 5:Jl(m,m.return);break;case 22:if(m.memoizedState!==null){KT(h);continue}}p!==null?(p.return=m,ge=p):KT(h)}d=d.sibling}e:for(d=null,h=t;;){if(h.tag===5){if(d===null){d=h;try{s=h.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(l=h.stateNode,c=h.memoizedProps.style,o=c!=null&&c.hasOwnProperty("display")?c.display:null,l.style.display=tO("display",o))}catch(w){Bt(t,t.return,w)}}}else if(h.tag===6){if(d===null)try{h.stateNode.nodeValue=u?"":h.memoizedProps}catch(w){Bt(t,t.return,w)}}else if((h.tag!==22&&h.tag!==23||h.memoizedState===null||h===t)&&h.child!==null){h.child.return=h,h=h.child;continue}if(h===t)break e;for(;h.sibling===null;){if(h.return===null||h.return===t)break e;d===h&&(d=null),h=h.return}d===h&&(d=null),h.sibling.return=h.return,h=h.sibling}}break;case 19:na(e,t),Aa(t),n&4&&WT(t);break;case 21:break;default:na(e,t),Aa(t)}}function Aa(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(AR(r)){var n=r;break e}r=r.return}throw Error(le(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(hh(s,""),n.flags&=-33);var i=qT(t);cw(t,i,s);break;case 3:case 4:var o=n.stateNode.containerInfo,l=qT(t);lw(t,l,o);break;default:throw Error(le(161))}}catch(c){Bt(t,t.return,c)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function R7(t,e,r){ge=t,PR(t)}function PR(t,e,r){for(var n=(t.mode&1)!==0;ge!==null;){var s=ge,i=s.child;if(s.tag===22&&n){var o=s.memoizedState!==null||$f;if(!o){var l=s.alternate,c=l!==null&&l.memoizedState!==null||Ur;l=$f;var u=Ur;if($f=o,(Ur=c)&&!u)for(ge=s;ge!==null;)o=ge,c=o.child,o.tag===22&&o.memoizedState!==null?XT(s):c!==null?(c.return=o,ge=c):XT(s);for(;i!==null;)ge=i,PR(i),i=i.sibling;ge=s,$f=l,Ur=u}GT(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,ge=i):GT(t)}}function GT(t){for(;ge!==null;){var e=ge;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:Ur||Qx(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!Ur)if(r===null)n.componentDidMount();else{var s=e.elementType===e.type?r.memoizedProps:sa(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&CT(e,i,n);break;case 3:var o=e.updateQueue;if(o!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}CT(e,o,r)}break;case 5:var l=e.stateNode;if(r===null&&e.flags&4){r=l;var c=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":c.autoFocus&&r.focus();break;case"img":c.src&&(r.src=c.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(e.memoizedState===null){var u=e.alternate;if(u!==null){var d=u.memoizedState;if(d!==null){var h=d.dehydrated;h!==null&&gh(h)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(le(163))}Ur||e.flags&512&&ow(e)}catch(m){Bt(e,e.return,m)}}if(e===t){ge=null;break}if(r=e.sibling,r!==null){r.return=e.return,ge=r;break}ge=e.return}}function KT(t){for(;ge!==null;){var e=ge;if(e===t){ge=null;break}var r=e.sibling;if(r!==null){r.return=e.return,ge=r;break}ge=e.return}}function XT(t){for(;ge!==null;){var e=ge;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Qx(4,e)}catch(c){Bt(e,r,c)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(c){Bt(e,s,c)}}var i=e.return;try{ow(e)}catch(c){Bt(e,i,c)}break;case 5:var o=e.return;try{ow(e)}catch(c){Bt(e,o,c)}}}catch(c){Bt(e,e.return,c)}if(e===t){ge=null;break}var l=e.sibling;if(l!==null){l.return=e.return,ge=l;break}ge=e.return}}var D7=Math.ceil,og=Rs.ReactCurrentDispatcher,fN=Rs.ReactCurrentOwner,Gn=Rs.ReactCurrentBatchConfig,Qe=0,yr=null,Yt=null,kr=0,Nn=0,Zl=Fi(0),or=0,Ah=null,Bo=0,Jx=0,pN=0,Xd=null,on=null,gN=0,Pc=1/0,as=null,lg=!1,uw=null,bi=null,Lf=!1,ui=null,cg=0,Yd=0,dw=null,Np=-1,_p=0;function tn(){return Qe&6?Wt():Np!==-1?Np:Np=Wt()}function wi(t){return t.mode&1?Qe&2&&kr!==0?kr&-kr:y7.transition!==null?(_p===0&&(_p=fO()),_p):(t=ct,t!==0||(t=window.event,t=t===void 0?16:wO(t.type)),t):1}function ma(t,e,r,n){if(50<Yd)throw Yd=0,dw=null,Error(le(185));Sm(t,r,n),(!(Qe&2)||t!==yr)&&(t===yr&&(!(Qe&2)&&(Jx|=r),or===4&&ei(t,kr)),mn(t,n),r===1&&Qe===0&&!(e.mode&1)&&(Pc=Wt()+500,Kx&&Bi()))}function mn(t,e){var r=t.callbackNode;y8(t,e);var n=Wp(t,t===yr?kr:0);if(n===0)r!==null&&aT(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&aT(r),e===1)t.tag===0?x7(YT.bind(null,t)):BO(YT.bind(null,t)),m7(function(){!(Qe&6)&&Bi()}),r=null;else{switch(pO(n)){case 1:r=U1;break;case 4:r=hO;break;case 16:r=qp;break;case 536870912:r=mO;break;default:r=qp}r=LR(r,CR.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function CR(t,e){if(Np=-1,_p=0,Qe&6)throw Error(le(327));var r=t.callbackNode;if(dc()&&t.callbackNode!==r)return null;var n=Wp(t,t===yr?kr:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=ug(t,n);else{e=n;var s=Qe;Qe|=2;var i=OR();(yr!==t||kr!==e)&&(as=null,Pc=Wt()+500,Eo(t,e));do try{L7();break}catch(l){IR(t,l)}while(!0);tN(),og.current=i,Qe=s,Yt!==null?e=0:(yr=null,kr=0,e=or)}if(e!==0){if(e===2&&(s=Lb(t),s!==0&&(n=s,e=hw(t,s))),e===1)throw r=Ah,Eo(t,0),ei(t,n),mn(t,Wt()),r;if(e===6)ei(t,n);else{if(s=t.current.alternate,!(n&30)&&!M7(s)&&(e=ug(t,n),e===2&&(i=Lb(t),i!==0&&(n=i,e=hw(t,i))),e===1))throw r=Ah,Eo(t,0),ei(t,n),mn(t,Wt()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(le(345));case 2:lo(t,on,as);break;case 3:if(ei(t,n),(n&130023424)===n&&(e=gN+500-Wt(),10<e)){if(Wp(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){tn(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Wb(lo.bind(null,t,on,as),e);break}lo(t,on,as);break;case 4:if(ei(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var o=31-ha(n);i=1<<o,o=e[o],o>s&&(s=o),n&=~i}if(n=s,n=Wt()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*D7(n/1960))-n,10<n){t.timeoutHandle=Wb(lo.bind(null,t,on,as),n);break}lo(t,on,as);break;case 5:lo(t,on,as);break;default:throw Error(le(329))}}}return mn(t,Wt()),t.callbackNode===r?CR.bind(null,t):null}function hw(t,e){var r=Xd;return t.current.memoizedState.isDehydrated&&(Eo(t,e).flags|=256),t=ug(t,e),t!==2&&(e=on,on=r,e!==null&&mw(e)),t}function mw(t){on===null?on=t:on.push.apply(on,t)}function M7(t){for(var e=t;;){if(e.flags&16384){var r=e.updateQueue;if(r!==null&&(r=r.stores,r!==null))for(var n=0;n<r.length;n++){var s=r[n],i=s.getSnapshot;s=s.value;try{if(!pa(i(),s))return!1}catch{return!1}}}if(r=e.child,e.subtreeFlags&16384&&r!==null)r.return=e,e=r;else{if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return!0;e=e.return}e.sibling.return=e.return,e=e.sibling}}return!0}function ei(t,e){for(e&=~pN,e&=~Jx,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-ha(e),n=1<<r;t[r]=-1,e&=~n}}function YT(t){if(Qe&6)throw Error(le(327));dc();var e=Wp(t,0);if(!(e&1))return mn(t,Wt()),null;var r=ug(t,e);if(t.tag!==0&&r===2){var n=Lb(t);n!==0&&(e=n,r=hw(t,n))}if(r===1)throw r=Ah,Eo(t,0),ei(t,e),mn(t,Wt()),r;if(r===6)throw Error(le(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,lo(t,on,as),mn(t,Wt()),null}function xN(t,e){var r=Qe;Qe|=1;try{return t(e)}finally{Qe=r,Qe===0&&(Pc=Wt()+500,Kx&&Bi())}}function Vo(t){ui!==null&&ui.tag===0&&!(Qe&6)&&dc();var e=Qe;Qe|=1;var r=Gn.transition,n=ct;try{if(Gn.transition=null,ct=1,t)return t()}finally{ct=n,Gn.transition=r,Qe=e,!(Qe&6)&&Bi()}}function yN(){Nn=Zl.current,Et(Zl)}function Eo(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,h7(r)),Yt!==null)for(r=Yt.return;r!==null;){var n=r;switch(J1(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Qp();break;case 3:Ec(),Et(dn),Et(Gr),oN();break;case 5:iN(n);break;case 4:Ec();break;case 13:Et(Ot);break;case 19:Et(Ot);break;case 10:rN(n.type._context);break;case 22:case 23:yN()}r=r.return}if(yr=t,Yt=t=ji(t.current,null),kr=Nn=e,or=0,Ah=null,pN=Jx=Bo=0,on=Xd=null,xo!==null){for(e=0;e<xo.length;e++)if(r=xo[e],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var o=i.next;i.next=s,n.next=o}r.pending=n}xo=null}return t}function IR(t,e){do{var r=Yt;try{if(tN(),bp.current=ig,sg){for(var n=Dt.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}sg=!1}if(Fo=0,pr=sr=Dt=null,Gd=!1,_h=0,fN.current=null,r===null||r.return===null){or=1,Ah=e,Yt=null;break}e:{var i=t,o=r.return,l=r,c=e;if(e=kr,l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){var u=c,d=l,h=d.tag;if(!(d.mode&1)&&(h===0||h===11||h===15)){var m=d.alternate;m?(d.updateQueue=m.updateQueue,d.memoizedState=m.memoizedState,d.lanes=m.lanes):(d.updateQueue=null,d.memoizedState=null)}var p=$T(o);if(p!==null){p.flags&=-257,LT(p,o,l,i,e),p.mode&1&&MT(i,u,e),e=p,c=u;var x=e.updateQueue;if(x===null){var w=new Set;w.add(c),e.updateQueue=w}else x.add(c);break e}else{if(!(e&1)){MT(i,u,e),vN();break e}c=Error(le(426))}}else if(Pt&&l.mode&1){var g=$T(o);if(g!==null){!(g.flags&65536)&&(g.flags|=256),LT(g,o,l,i,e),Z1(kc(c,l));break e}}i=c=kc(c,l),or!==4&&(or=2),Xd===null?Xd=[i]:Xd.push(i),i=o;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var v=pR(i,c,e);PT(i,v);break e;case 1:l=c;var b=i.type,y=i.stateNode;if(!(i.flags&128)&&(typeof b.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(bi===null||!bi.has(y)))){i.flags|=65536,e&=-e,i.lanes|=e;var T=gR(i,l,e);PT(i,T);break e}}i=i.return}while(i!==null)}DR(r)}catch(N){e=N,Yt===r&&r!==null&&(Yt=r=r.return);continue}break}while(!0)}function OR(){var t=og.current;return og.current=ig,t===null?ig:t}function vN(){(or===0||or===3||or===2)&&(or=4),yr===null||!(Bo&268435455)&&!(Jx&268435455)||ei(yr,kr)}function ug(t,e){var r=Qe;Qe|=2;var n=OR();(yr!==t||kr!==e)&&(as=null,Eo(t,e));do try{$7();break}catch(s){IR(t,s)}while(!0);if(tN(),Qe=r,og.current=n,Yt!==null)throw Error(le(261));return yr=null,kr=0,or}function $7(){for(;Yt!==null;)RR(Yt)}function L7(){for(;Yt!==null&&!c8();)RR(Yt)}function RR(t){var e=$R(t.alternate,t,Nn);t.memoizedProps=t.pendingProps,e===null?DR(t):Yt=e,fN.current=null}function DR(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=C7(r,e),r!==null){r.flags&=32767,Yt=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{or=6,Yt=null;return}}else if(r=P7(r,e,Nn),r!==null){Yt=r;return}if(e=e.sibling,e!==null){Yt=e;return}Yt=e=t}while(e!==null);or===0&&(or=5)}function lo(t,e,r){var n=ct,s=Gn.transition;try{Gn.transition=null,ct=1,F7(t,e,r,n)}finally{Gn.transition=s,ct=n}return null}function F7(t,e,r,n){do dc();while(ui!==null);if(Qe&6)throw Error(le(327));r=t.finishedWork;var s=t.finishedLanes;if(r===null)return null;if(t.finishedWork=null,t.finishedLanes=0,r===t.current)throw Error(le(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(v8(t,i),t===yr&&(Yt=yr=null,kr=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Lf||(Lf=!0,LR(qp,function(){return dc(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=Gn.transition,Gn.transition=null;var o=ct;ct=1;var l=Qe;Qe|=4,fN.current=null,O7(t,r),kR(r,t),s7(Hb),Gp=!!zb,Hb=zb=null,t.current=r,R7(r),u8(),Qe=l,ct=o,Gn.transition=i}else t.current=r;if(Lf&&(Lf=!1,ui=t,cg=s),i=t.pendingLanes,i===0&&(bi=null),m8(r.stateNode),mn(t,Wt()),e!==null)for(n=t.onRecoverableError,r=0;r<e.length;r++)s=e[r],n(s.value,{componentStack:s.stack,digest:s.digest});if(lg)throw lg=!1,t=uw,uw=null,t;return cg&1&&t.tag!==0&&dc(),i=t.pendingLanes,i&1?t===dw?Yd++:(Yd=0,dw=t):Yd=0,Bi(),null}function dc(){if(ui!==null){var t=pO(cg),e=Gn.transition,r=ct;try{if(Gn.transition=null,ct=16>t?16:t,ui===null)var n=!1;else{if(t=ui,ui=null,cg=0,Qe&6)throw Error(le(331));var s=Qe;for(Qe|=4,ge=t.current;ge!==null;){var i=ge,o=i.child;if(ge.flags&16){var l=i.deletions;if(l!==null){for(var c=0;c<l.length;c++){var u=l[c];for(ge=u;ge!==null;){var d=ge;switch(d.tag){case 0:case 11:case 15:Kd(8,d,i)}var h=d.child;if(h!==null)h.return=d,ge=h;else for(;ge!==null;){d=ge;var m=d.sibling,p=d.return;if(TR(d),d===u){ge=null;break}if(m!==null){m.return=p,ge=m;break}ge=p}}}var x=i.alternate;if(x!==null){var w=x.child;if(w!==null){x.child=null;do{var g=w.sibling;w.sibling=null,w=g}while(w!==null)}}ge=i}}if(i.subtreeFlags&2064&&o!==null)o.return=i,ge=o;else e:for(;ge!==null;){if(i=ge,i.flags&2048)switch(i.tag){case 0:case 11:case 15:Kd(9,i,i.return)}var v=i.sibling;if(v!==null){v.return=i.return,ge=v;break e}ge=i.return}}var b=t.current;for(ge=b;ge!==null;){o=ge;var y=o.child;if(o.subtreeFlags&2064&&y!==null)y.return=o,ge=y;else e:for(o=b;ge!==null;){if(l=ge,l.flags&2048)try{switch(l.tag){case 0:case 11:case 15:Qx(9,l)}}catch(N){Bt(l,l.return,N)}if(l===o){ge=null;break e}var T=l.sibling;if(T!==null){T.return=l.return,ge=T;break e}ge=l.return}}if(Qe=s,Bi(),Da&&typeof Da.onPostCommitFiberRoot=="function")try{Da.onPostCommitFiberRoot(zx,t)}catch{}n=!0}return n}finally{ct=r,Gn.transition=e}}return!1}function QT(t,e,r){e=kc(r,e),e=pR(t,e,1),t=vi(t,e,1),e=tn(),t!==null&&(Sm(t,1,e),mn(t,e))}function Bt(t,e,r){if(t.tag===3)QT(t,t,r);else for(;e!==null;){if(e.tag===3){QT(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(bi===null||!bi.has(n))){t=kc(r,t),t=gR(e,t,1),e=vi(e,t,1),t=tn(),e!==null&&(Sm(e,1,t),mn(e,t));break}}e=e.return}}function B7(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=tn(),t.pingedLanes|=t.suspendedLanes&r,yr===t&&(kr&r)===r&&(or===4||or===3&&(kr&130023424)===kr&&500>Wt()-gN?Eo(t,0):pN|=r),mn(t,e)}function MR(t,e){e===0&&(t.mode&1?(e=Ef,Ef<<=1,!(Ef&130023424)&&(Ef=4194304)):e=1);var r=tn();t=_s(t,e),t!==null&&(Sm(t,e,r),mn(t,r))}function V7(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),MR(t,r)}function U7(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,s=t.memoizedState;s!==null&&(r=s.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(le(314))}n!==null&&n.delete(e),MR(t,r)}var $R;$R=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||dn.current)cn=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return cn=!1,k7(t,e,r);cn=!!(t.flags&131072)}else cn=!1,Pt&&e.flags&1048576&&VO(e,eg,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;jp(t,e),t=e.pendingProps;var s=Sc(e,Gr.current);uc(e,r),s=cN(null,e,n,t,s,r);var i=uN();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,hn(n)?(i=!0,Jp(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,aN(e),s.updater=Yx,e.stateNode=s,s._reactInternals=e,Zb(e,n,t,r),e=rw(null,e,n,!0,i,r)):(e.tag=0,Pt&&i&&Q1(e),Qr(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(jp(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=H7(n),t=sa(n,t),s){case 0:e=tw(null,e,n,t,r);break e;case 1:e=VT(null,e,n,t,r);break e;case 11:e=FT(null,e,n,t,r);break e;case 14:e=BT(null,e,n,sa(n.type,t),r);break e}throw Error(le(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:sa(n,s),tw(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:sa(n,s),VT(t,e,n,s,r);case 3:e:{if(bR(e),t===null)throw Error(le(387));n=e.pendingProps,i=e.memoizedState,s=i.element,GO(t,e),ng(e,n,null,r);var o=e.memoizedState;if(n=o.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:o.cache,pendingSuspenseBoundaries:o.pendingSuspenseBoundaries,transitions:o.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=kc(Error(le(423)),e),e=UT(t,e,n,r,s);break e}else if(n!==s){s=kc(Error(le(424)),e),e=UT(t,e,n,r,s);break e}else for(Tn=yi(e.stateNode.containerInfo.firstChild),kn=e,Pt=!0,ca=null,r=qO(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Tc(),n===s){e=Ss(t,e,r);break e}Qr(t,e,n,r)}e=e.child}return e;case 5:return KO(e),t===null&&Yb(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,o=s.children,qb(n,s)?o=null:i!==null&&qb(n,i)&&(e.flags|=32),vR(t,e),Qr(t,e,o,r),e.child;case 6:return t===null&&Yb(e),null;case 13:return wR(t,e,r);case 4:return sN(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=Ac(e,null,n,r):Qr(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:sa(n,s),FT(t,e,n,s,r);case 7:return Qr(t,e,e.pendingProps,r),e.child;case 8:return Qr(t,e,e.pendingProps.children,r),e.child;case 12:return Qr(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,o=s.value,bt(tg,n._currentValue),n._currentValue=o,i!==null)if(pa(i.value,o)){if(i.children===s.children&&!dn.current){e=Ss(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var l=i.dependencies;if(l!==null){o=i.child;for(var c=l.firstContext;c!==null;){if(c.context===n){if(i.tag===1){c=ps(-1,r&-r),c.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var d=u.pending;d===null?c.next=c:(c.next=d.next,d.next=c),u.pending=c}}i.lanes|=r,c=i.alternate,c!==null&&(c.lanes|=r),Qb(i.return,r,e),l.lanes|=r;break}c=c.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(le(341));o.lanes|=r,l=o.alternate,l!==null&&(l.lanes|=r),Qb(o,r,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}Qr(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,uc(e,r),s=Xn(s),n=n(s),e.flags|=1,Qr(t,e,n,r),e.child;case 14:return n=e.type,s=sa(n,e.pendingProps),s=sa(n.type,s),BT(t,e,n,s,r);case 15:return xR(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:sa(n,s),jp(t,e),e.tag=1,hn(n)?(t=!0,Jp(e)):t=!1,uc(e,r),fR(e,n,s),Zb(e,n,s,r),rw(null,e,n,!0,t,r);case 19:return jR(t,e,r);case 22:return yR(t,e,r)}throw Error(le(156,e.tag))};function LR(t,e){return dO(t,e)}function z7(t,e,r,n){this.tag=t,this.key=r,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=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function qn(t,e,r,n){return new z7(t,e,r,n)}function bN(t){return t=t.prototype,!(!t||!t.isReactComponent)}function H7(t){if(typeof t=="function")return bN(t)?1:0;if(t!=null){if(t=t.$$typeof,t===F1)return 11;if(t===B1)return 14}return 2}function ji(t,e){var r=t.alternate;return r===null?(r=qn(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Sp(t,e,r,n,s,i){var o=2;if(n=t,typeof t=="function")bN(t)&&(o=1);else if(typeof t=="string")o=5;else e:switch(t){case zl:return ko(r.children,s,i,e);case L1:o=8,s|=8;break;case Nb:return t=qn(12,r,e,s|2),t.elementType=Nb,t.lanes=i,t;case _b:return t=qn(13,r,e,s),t.elementType=_b,t.lanes=i,t;case Sb:return t=qn(19,r,e,s),t.elementType=Sb,t.lanes=i,t;case KI:return Zx(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case WI:o=10;break e;case GI:o=9;break e;case F1:o=11;break e;case B1:o=14;break e;case Ys:o=16,n=null;break e}throw Error(le(130,t==null?t:typeof t,""))}return e=qn(o,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function ko(t,e,r,n){return t=qn(7,t,n,e),t.lanes=r,t}function Zx(t,e,r,n){return t=qn(22,t,n,e),t.elementType=KI,t.lanes=r,t.stateNode={isHidden:!1},t}function f0(t,e,r){return t=qn(6,t,null,e),t.lanes=r,t}function p0(t,e,r){return e=qn(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function q7(t,e,r,n,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=Xv(0),this.expirationTimes=Xv(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xv(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function wN(t,e,r,n,s,i,o,l,c){return t=new q7(t,e,r,l,c),e===1?(e=1,i===!0&&(e|=8)):e=0,i=qn(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},aN(i),t}function W7(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,595 bytes, line 40
40return{$$typeof:Ul,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function FR(t){if(!t)return Oi;t=t._reactInternals;e:{if(hl(t)!==t||t.tag!==1)throw Error(le(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(hn(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(le(171))}if(t.tag===1){var r=t.type;if(hn(r))return FO(t,r,e)}return e}function BR(t,e,r,n,s,i,o,l,c){return t=wN(r,n,!0,t,s,i,o,l,c),t.context=FR(null),r=t.current,n=tn(),s=wi(r),i=ps(n,s),i.callback=e??null,vi(r,i,s),t.current.lanes=s,Sm(t,s,n),mn(t,n),t}function ey(t,e,r,n){var s=e.current,i=tn(),o=wi(s);return r=FR(r),e.context===null?e.context=r:e.pendingContext=r,e=ps(i,o),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=vi(s,e,o),t!==null&&(ma(t,s,o,i),vp(t,s,o)),o}function dg(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function JT(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function jN(t,e){JT(t,e),(t=t.alternate)&&JT(t,e)}function G7(){return null}var VR=typeof reportError=="function"?reportError:function(t){console.error(t)};function NN(t){this._internalRoot=t}ty.prototype.render=NN.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(le(409));ey(t,e,null,null)};ty.prototype.unmount=NN.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Vo(function(){ey(null,t,null,null)}),e[Ns]=null}};function ty(t){this._internalRoot=t}ty.prototype.unstable_scheduleHydration=function(t){if(t){var e=yO();t={blockedOn:null,target:t,priority:e};for(var r=0;r<Zs.length&&e!==0&&e<Zs[r].priority;r++);Zs.splice(r,0,t),r===0&&bO(t)}};function _N(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function ry(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function ZT(){}function K7(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=dg(o);i.call(u)}}var o=BR(e,n,t,0,null,!1,!1,"",ZT);return t._reactRootContainer=o,t[Ns]=o.current,vh(t.nodeType===8?t.parentNode:t),Vo(),o}for(;s=t.lastChild;)t.removeChild(s);if(typeof n=="function"){var l=n;n=function(){var u=dg(c);l.call(u)}}var c=wN(t,0,!1,null,null,!1,!1,"",ZT);return t._reactRootContainer=c,t[Ns]=c.current,vh(t.nodeType===8?t.parentNode:t),Vo(function(){ey(e,c,r,n)}),c}function ny(t,e,r,n,s){var i=r._reactRootContainer;if(i){var o=i;if(typeof s=="function"){var l=s;s=function(){var c=dg(o);l.call(c)}}ey(e,o,t,s)}else o=K7(r,e,t,s,n);return dg(o)}gO=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=Id(e.pendingLanes);r!==0&&(z1(e,r|1),mn(e,Wt()),!(Qe&6)&&(Pc=Wt()+500,Bi()))}break;case 13:Vo(function(){var n=_s(t,1);if(n!==null){var s=tn();ma(n,t,1,s)}}),jN(t,1)}};H1=function(t){if(t.tag===13){var e=_s(t,134217728);if(e!==null){var r=tn();ma(e,t,134217728,r)}jN(t,134217728)}};xO=function(t){if(t.tag===13){var e=wi(t),r=_s(t,e);if(r!==null){var n=tn();ma(r,t,e,n)}jN(t,e)}};yO=function(){return ct};vO=function(t,e){var r=ct;try{return ct=t,e()}finally{ct=r}};Db=function(t,e,r){switch(e){case"input":if(Eb(t,r),e=r.name,r.type==="radio"&&e!=null){for(r=t;r.parentNode;)r=r.parentNode;for(r=r.querySelectorAll("input[name="+JSON.stringify(""+e)+'][type="radio"]'),e=0;e<r.length;e++){var n=r[e];if(n!==t&&n.form===t.form){var s=Gx(n);if(!s)throw Error(le(90));YI(n),Eb(n,s)}}}break;case"textarea":JI(t,r);break;case"select":e=r.value,e!=null&&ic(t,!!r.multiple,e,!1)}};sO=xN;iO=Vo;var X7={usingClientEntryPoint:!1,Events:[Am,Gl,Gx,nO,aO,xN]},cd={findFiberByHostInstance:go,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Y7={bundleType:cd.bundleType,version:cd.version,rendererPackageName:cd.rendererPackageName,rendererConfig:cd.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:Rs.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=cO(t),t===null?null:t.stateNode},findFiberByHostInstance:cd.findFiberByHostInstance||G7,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};
40if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Ff=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Ff.isDisabled&&Ff.supportsFiber)try{zx=Ff.inject(Y7),Da=Ff}catch{}}Mn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=X7;Mn.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!_N(e))throw Error(le(200));return W7(t,e,null,r)};Mn.createRoot=function(t,e){if(!_N(t))throw Error(le(299));var r=!1,n="",s=VR;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=wN(t,1,!1,null,null,r,!1,n,s),t[Ns]=e.current,vh(t.nodeType===8?t.parentNode:t),new NN(e)};Mn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var e=t._reactInternals;if(e===void 0)throw typeof t.render=="function"?Error(le(188)):(t=Object.keys(t).join(","),Error(le(268,t)));return t=cO(e),t=t===null?null:t.stateNode,t};Mn.flushSync=function(t){return Vo(t)};Mn.hydrate=function(t,e,r){if(!ry(e))throw Error(le(200));return ny(null,t,e,!0,r)};Mn.hydrateRoot=function(t,e,r){if(!_N(t))throw Error(le(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",o=VR;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(o=r.onRecoverableError)),e=BR(e,null,t,1,r??null,s,!1,i,o),t[Ns]=e.current,vh(t),n)for(t=0;t<n.length;t++)r=n[t],s=r._getVersion,s=s(r._source),e.mutableSourceEagerHydrationData==null?e.mutableSourceEagerHydrationData=[r,s]:e.mutableSourceEagerHydrationData.push(r,s);return new ty(e)};Mn.render=function(t,e,r){if(!ry(e))throw Error(le(200));return ny(null,t,e,!1,r)};Mn.unmountComponentAtNode=function(t){if(!ry(t))throw Error(le(40));return t._reactRootContainer?(Vo(function(){ny(null,null,t,!1,function(){t._reactRootContainer=null,t[Ns]=null})}),!0):!1};Mn.unstable_batchedUpdates=xN;Mn.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!ry(r))throw Error(le(200));if(t==null||t._reactInternals===void 0)throw Error(le(38));return ny(t,e,r,!1,n)};Mn.version="18.3.1-next-f1338f8080-20240426";function UR(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(UR)}catch(t){console.error(t)}}UR(),UI.exports=Mn;var Q7=UI.exports,zR,eA=Q7;zR=eA.createRoot,eA.hydrateRoot;var J7=typeof Element<"u",Z7=typeof Map=="function",eB=typeof Set=="function",tB=typeof ArrayBuffer=="function"&&!!ArrayBuffer.isView;function Tp(t,e){if(t===e)return!0;if(t&&e&&typeof t=="object"&&typeof e=="object"){if(t.constructor!==e.constructor)return!1;var r,n,s;if(Array.isArray(t)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(!Tp(t[n],e[n]))return!1;return!0}var i;if(Z7&&t instanceof Map&&e instanceof Map){if(t.size!==e.size)return!1;for(i=t.entries();!(n=i.next()).done;)if(!e.has(n.value[0]))return!1;for(i=t.entries();!(n=i.next()).done;)if(!Tp(n.value[1],e.get(n.value[0])))return!1;return!0}if(eB&&t instanceof Set&&e instanceof Set){if(t.size!==e.size)return!1;for(i=t.entries();!(n=i.next()).done;)if(!e.has(n.value[0]))return!1;return!0}if(tB&&ArrayBuffer.isView(t)&&ArrayBuffer.isView(e)){if(r=t.length,r!=e.length)return!1;for(n=r;n--!==0;)if(t[n]!==e[n])return!1;return!0}if(t.constructor===RegExp)return t.source===e.source&&t.flags===e.flags;if(t.valueOf!==Object.prototype.valueOf&&typeof t.valueOf=="function"&&typeof e.valueOf=="function")return t.valueOf()===e.valueOf();if(t.toString!==Object.prototype.toString&&typeof t.toString=="function"&&typeof e.toString=="function")return t.toString()===e.toString();if(s=Object.keys(t),r=s.length,r!==Object.keys(e).length)return!1;for(n=r;n--!==0;)if(!Object.prototype.hasOwnProperty.call(e,s[n]))return!1;if(J7&&t instanceof Element)return!1;for(n=r;n--!==0;)if(!((s[n]==="_owner"||s[n]==="__v"||s[n]==="__o")&&t.$$typeof)&&!Tp(t[s[n]],e[s[n]]))return!1;return!0}return t!==t&&e!==e}var rB=function(e,r){try{return Tp(e,r)}catch(n){if((n.message||"").match(/stack|recursion/i))return console.warn("react-fast-compare cannot handle circular refs"),!1;throw n}};const nB=nt(rB);var aB=function(t,e,r,n,s,i,o,l){if(!t){var c;if(e===void 0)c=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var u=[r,n,s,i,o,l],d=0;c=new Error(e.replace(/%s/g,function(){return u[d++]})),c.name="Invariant Violation"}throw c.framesToPop=1,c}},sB=aB;const tA=nt(sB);var iB=function(e,r,n,s){var i=n?n.call(s,e,r):void 0;if(i!==void 0)return!!i;if(e===r)return!0;
40if(typeof e!="object"||!e||typeof r!="object"||!r)return!1;var o=Object.keys(e),l=Object.keys(r);if(o.length!==l.length)return!1;for(var c=Object.prototype.hasOwnProperty.bind(r),u=0;u<o.length;u++){var d=o[u];if(!c(d))return!1;var h=e[d],m=r[d];if(i=n?n.call(s,h,m,d):void 0,i===!1||i===void 0&&h!==m)return!1}return!0};const oB=nt(iB);var HR=(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))(HR||{}),g0={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"]}},rA=Object.values(HR),ay={accesskey:"accessKey",charset:"charSet",class:"className",contenteditable:"contentEditable",contextmenu:"contextMenu","http-equiv":"httpEquiv",itemprop:"itemProp",tabindex:"tabIndex"},qR=Object.entries(ay).reduce((t,[e,r])=>(t[r]=e,t),{}),da="data-rh",hc={DEFAULT_TITLE:"defaultTitle",DEFER:"defer",ENCODE_SPECIAL_CHARACTERS:"encodeSpecialCharacters",ON_CHANGE_CLIENT_STATE:"onChangeClientState",TITLE_TEMPLATE:"titleTemplate",PRIORITIZE_SEO_TAGS:"prioritizeSeoTags"},mc=(t,e)=>{for(let r=t.length-1;r>=0;r-=1){const n=t[r];if(Object.prototype.hasOwnProperty.call(n,e))return n[e]}return null},lB=t=>{let e=mc(t,"title");const r=mc(t,hc.TITLE_TEMPLATE);if(Array.isArray(e)&&(e=e.join("")),r&&e)return r.replace(/%s/g,()=>e);const n=mc(t,hc.DEFAULT_TITLE);return e||n||void 0},cB=t=>mc(t,hc.ON_CHANGE_CLIENT_STATE)||(()=>{}),x0=(t,e)=>e.filter(r=>typeof r[t]<"u").map(r=>r[t]).reduce((r,n)=>({...r,...n}),{}),uB=(t,e)=>e.filter(r=>typeof r.base<"u").map(r=>r.base).reverse().reduce((r,n)=>{if(!r.length){const s=Object.keys(n);for(let i=0;i<s.length;i+=1){const l=s[i].toLowerCase();if(t.indexOf(l)!==-1&&n[l])return r.concat(n)}}return r},[]),dB=t=>console&&typeof console.warn=="function"&&console.warn(t),ud=(t,e,r)=>{const n={};return r.filter(s=>Array.isArray(s[t])?!0:(typeof s[t]<"u"&&dB(`Helmet: ${t} should be of type "Array". Instead found type "${typeof s[t]}"`),!1)).map(s=>s[t]).reverse().reduce((s,i)=>{const o={};i.filter(c=>{let u;const d=Object.keys(c);for(let m=0;m<d.length;m+=1){const p=d[m],x=p.toLowerCase();e.indexOf(x)!==-1&&!(u==="rel"&&c[u].toLowerCase()==="canonical")&&!(x==="rel"&&c[x].toLowerCase()==="stylesheet")&&(u=x),e.indexOf(p)!==-1&&(p==="innerHTML"||p==="cssText"||p==="itemprop")&&(u=p)}if(!u||!c[u])return!1;const h=c[u].toLowerCase();return n[u]||(n[u]={}),o[u]||(o[u]={}),n[u][h]?!1:(o[u][h]=!0,!0)}).reverse().forEach(c=>s.push(c));const l=Object.keys(o);for(let c=0;c<l.length;c+=1){const u=l[c],d={...n[u],...o[u]};n[u]=d}return s},[]).reverse()},hB=(t,e)=>{if(Array.isArray(t)&&t.length){for(let r=0;r<t.length;r+=1)if(t[r][e])return!0}return!1},mB=t=>({baseTag:uB(["href"],t),bodyAttributes:x0("bodyAttributes",t),defer:mc(t,hc.DEFER),encode:mc(t,hc.ENCODE_SPECIAL_CHARACTERS),htmlAttributes:x0("htmlAttributes",t),linkTags:ud("link",["rel","href"],t),metaTags:ud("meta",["name","charset","http-equiv","property","itemprop"],t),noscriptTags:ud("noscript",["innerHTML"],t),onChangeClientState:cB(t),scriptTags:ud("script",["src","innerHTML"],t),styleTags:ud("style",["cssText"],t),title:lB(t),titleAttributes:x0("titleAttributes",t),prioritizeSeoTags:hB(t,hc.PRIORITIZE_SEO_TAGS)}),WR=t=>Array.isArray(t)?t.join(""):t,fB=(t,e)=>{const r=Object.keys(t);for(let n=0;n<r.length;n+=1)if(e[r[n]]&&e[r[n]].includes(t[r[n]]))return!0;return!1},y0=(t,e)=>Array.isArray(t)?t.reduce((r,n)=>(fB(n,e)?r.priority.push(n):r.default.push(n),r),{priority:[],default:[]}):{default:t,priority:[]},nA=(t,e)=>({...t,[e]:void 0}),pB=["noscript","script","style"],fw=(t,e=!0)=>e===!1?String(t):String(t).replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;"),GR=t=>Object.keys(t).reduce((e,r)=>{const n=typeof t[r]<"u"?`${r}="${t[r]}"`:`${r}`;return e?`${e} ${n}`:n},""),gB=(t,e,r,n)=>{const s=GR(r),i=WR(e);return s?`<${t} ${da}="true" ${s}>${fw(i,n)}</${t}>`:`<${t} ${da}="true">${fw(i,n)}</${t}>`},xB=(t,e,r=!0)=>e.reduce((n,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}="${fw(i[d],r)}"`;return u?`${u} ${h}`:h},""),l=i.innerHTML||i.cssText||"",c=pB.indexOf(t)===-1;return`${n}<${t} ${da}="true" ${o}${c?"/>":`>${l}</${t}>`}`},""),KR=(t,e={})=>Object.keys(t).reduce((r,n)=>{const s=ay[n];return r[s||n]=t[n],r},e),yB=(t,e,r)=>{const n={key:e,[da]:!0},s=KR(r,n);return[F.createElement("title",s,e)]},Ap=(t,e)=>e.map((r,n)=>{const s={key:n,[da]:!0};return Object.keys(r).forEach(i=>
40{const l=ay[i]||i;if(l==="innerHTML"||l==="cssText"){const c=r.innerHTML||r.cssText;s.dangerouslySetInnerHTML={__html:c}}else s[l]=r[i]}),F.createElement(t,s)}),Vn=(t,e,r=!0)=>{switch(t){case"title":return{toComponent:()=>yB(t,e.title,e.titleAttributes),toString:()=>gB(t,e.title,e.titleAttributes,r)};case"bodyAttributes":case"htmlAttributes":return{toComponent:()=>KR(e),toString:()=>GR(e)};default:return{toComponent:()=>Ap(t,e),toString:()=>xB(t,e,r)}}},vB=({metaTags:t,linkTags:e,scriptTags:r,encode:n})=>{const s=y0(t,g0.meta),i=y0(e,g0.link),o=y0(r,g0.script);return{priorityMethods:{toComponent:()=>[...Ap("meta",s.priority),...Ap("link",i.priority),...Ap("script",o.priority)],toString:()=>`${Vn("meta",s.priority,n)} ${Vn("link",i.priority,n)} ${Vn("script",o.priority,n)}`},metaTags:s.default,linkTags:i.default,scriptTags:o.default}},bB=t=>{const{baseTag:e,bodyAttributes:r,encode:n=!0,htmlAttributes:s,noscriptTags:i,styleTags:o,title:l="",titleAttributes:c,prioritizeSeoTags:u}=t;let{linkTags:d,metaTags:h,scriptTags:m}=t,p={toComponent:()=>[],toString:()=>""};return u&&({priorityMethods:p,linkTags:d,metaTags:h,scriptTags:m}=vB(t)),{priority:p,base:Vn("base",e,n),bodyAttributes:Vn("bodyAttributes",r,n),htmlAttributes:Vn("htmlAttributes",s,n),link:Vn("link",d,n),meta:Vn("meta",h,n),noscript:Vn("noscript",i,n),script:Vn("script",m,n),style:Vn("style",o,n),title:Vn("title",{title:l,titleAttributes:c},n)}},pw=bB,Bf=[],SN=!!(typeof window<"u"&&window.document&&window.document.createElement),gw=class{constructor(t,e){Ta(this,"instances",[]);Ta(this,"canUseDOM",SN);Ta(this,"context");Ta(this,"value",{setHelmet:t=>{this.context.helmet=t},helmetInstances:{get:()=>this.canUseDOM?Bf:this.instances,add:t=>{(this.canUseDOM?Bf:this.instances).push(t)},remove:t=>{const e=(this.canUseDOM?Bf:this.instances).indexOf(t);(this.canUseDOM?Bf:this.instances).splice(e,1)}}});this.context=t,this.canUseDOM=e||!1,e||(t.helmet=pw({baseTag:[],bodyAttributes:{},htmlAttributes:{},linkTags:[],metaTags:[],noscriptTags:[],scriptTags:[],styleTags:[],title:"",titleAttributes:{}}))}},wB=parseInt(F.version.split(".")[0],10),xw=wB>=19,jB={},XR=F.createContext(jB),Ao,YR=(Ao=class extends P.Component{constructor(r){super(r);Ta(this,"helmetData");xw?this.helmetData=null:this.helmetData=new gw(this.props.context||{},Ao.canUseDOM)}render(){return xw?F.createElement(F.Fragment,null,this.props.children):F.createElement(XR.Provider,{value:this.helmetData.value},this.props.children)}},Ta(Ao,"canUseDOM",SN),Ao),Ol=(t,e)=>{const r=document.head||document.querySelector("head"),n=r.querySelectorAll(`${t}[${da}]`),s=[].slice.call(n),i=[];let o;return e&&e.length&&e.forEach(l=>{const c=document.createElement(t);for(const u in l)if(Object.prototype.hasOwnProperty.call(l,u))if(u==="innerHTML")c.innerHTML=l.innerHTML;else if(u==="cssText"){const d=l.cssText;c.appendChild(document.createTextNode(d))}else{const d=u,h=typeof l[d]>"u"?"":l[d];c.setAttribute(u,h)}c.setAttribute(da,"true"),s.some((u,d)=>(o=d,c.isEqualNode(u)))?s.splice(o,1):i.push(c)}),s.forEach(l=>{var c;return(c=l.parentNode)==null?void 0:c.removeChild(l)}),i.forEach(l=>r.appendChild(l)),{oldTags:s,newTags:i}},yw=(t,e)=>{const r=document.getElementsByTagName(t)[0];if(!r)return;const n=r.getAttribute(da),s=n?n.split(","):[],i=[...s],o=Object.keys(e);for(const l of o){const c=e[l]||"";r.getAttribute(l)!==c&&r.setAttribute(l,c),s.indexOf(l)===-1&&s.push(l);const u=i.indexOf(l);u!==-1&&i.splice(u,1)}for(let l=i.length-1;l>=0;l-=1)r.removeAttribute(i[l]);s.length===i.length?r.removeAttribute(da):r.getAttribute(da)!==o.join(",")&&r.setAttribute(da,o.join(","))},NB=(t,e)=>{typeof t<"u"&&document.title!==t&&(document.title=WR(t)),yw("title",e)},aA=(t,e)=>{const{baseTag:r,bodyAttributes:n,htmlAttributes:s,linkTags:i,metaTags:o,noscriptTags:l,onChangeClientState:c,scriptTags:u,styleTags:d,title:h,titleAttributes:m}=t;yw("body",n),yw("html",s),NB(h,m);const p={baseTag:Ol("base",r),linkTags:Ol("link",i),metaTags:Ol("meta",o),noscriptTags:Ol("noscript",l),scriptTags:Ol("script",u),styleTags:Ol("style",d)},x={},w={};
40Object.keys(p).forEach(g=>{const{newTags:v,oldTags:b}=p[g];v.length&&(x[g]=v),b.length&&(w[g]=p[g].oldTags)}),e&&e(),c(t,x,w)},dd=null,_B=t=>{dd&&cancelAnimationFrame(dd),t.defer?dd=requestAnimationFrame(()=>{aA(t,()=>{dd=null})}):(aA(t),dd=null)},SB=_B,sA=class extends P.Component{constructor(){super(...arguments);Ta(this,"rendered",!1)}shouldComponentUpdate(e){return!oB(e,this.props)}componentDidUpdate(){this.emitChange()}componentWillUnmount(){const{helmetInstances:e}=this.props.context;e.remove(this),this.emitChange()}emitChange(){const{helmetInstances:e,setHelmet:r}=this.props.context;let n=null;const s=mB(e.get().map(i=>{const{context:o,...l}=i.props;return l}));YR.canUseDOM?SB(s):pw&&(n=pw(s)),r(n)}init(){if(this.rendered)return;this.rendered=!0;const{helmetInstances:e}=this.props.context;e.add(this),this.emitChange()}render(){return this.init(),null}},Ep=[],iA=t=>{const e={};for(const r of Object.keys(t))e[qR[r]||r]=t[r];return e},no=t=>{const e={};for(const r of Object.keys(t)){const n=ay[r];e[n||r]=t[r]}return e},oA=(t,e)=>{if(!SN)return;const r=document.getElementsByTagName(t)[0];if(!r)return;const n="data-rh-managed",s=r.getAttribute(n),i=s?s.split(","):[],o=Object.keys(e);for(const l of i)o.includes(l)||r.removeAttribute(l);for(const l of o){const c=e[l];c==null||c===!1?r.removeAttribute(l):c===!0?r.setAttribute(l,""):r.setAttribute(l,String(c))}o.length>0?r.setAttribute(n,o.join(",")):r.removeAttribute(n)},v0=()=>{const t={},e={};for(const r of Ep){const{htmlAttributes:n,bodyAttributes:s}=r.props;n&&Object.assign(t,iA(n)),s&&Object.assign(e,iA(s))}oA("html",t),oA("body",e)},TB=class extends P.Component{componentDidMount(){Ep.push(this),v0()}componentDidUpdate(){v0()}componentWillUnmount(){const t=Ep.indexOf(this);t!==-1&&Ep.splice(t,1),v0()}resolveTitle(){const{title:t,titleTemplate:e,defaultTitle:r}=this.props;return t&&e?e.replace(/%s/g,()=>Array.isArray(t)?t.join(""):t):t||r||void 0}renderTitle(){const t=this.resolveTitle();if(t===void 0)return null;const e=this.props.titleAttributes||{};return F.createElement("title",no(e),t)}renderBase(){const{base:t}=this.props;return t?F.createElement("base",no(t)):null}renderMeta(){const{meta:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>F.createElement("meta",{key:r,...no(e)}))}renderLink(){const{link:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>F.createElement("link",{key:r,...no(e)}))}renderScript(){const{script:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...s}=e,i=no(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),F.createElement("script",{key:r,...i})})}renderStyle(){const{style:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{cssText:n,...s}=e,i=no(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),F.createElement("style",{key:r,...i})})}renderNoscript(){const{noscript:t}=this.props;return!t||!Array.isArray(t)?null:t.map((e,r)=>{const{innerHTML:n,...s}=e,i=no(s);return n&&(i.dangerouslySetInnerHTML={__html:n}),F.createElement("noscript",{key:r,...i})})}render(){return F.createElement(F.Fragment,null,this.renderTitle(),this.renderBase(),this.renderMeta(),this.renderLink(),this.renderScript(),this.renderStyle(),this.renderNoscript())}},wb,Vi=(wb=class extends P.Component{shouldComponentUpdate(t){return!nB(nA(this.props,"helmetData"),nA(t,"helmetData"))}mapNestedChildrenToProps(t,e){if(!e)return null;switch(t.type){case"script":case"noscript":return{innerHTML:e};case"style":return{cssText:e};default:throw new Error(`<${t.type} /> elements are self-closing and can not contain children. Refer to our API for more information.`)}}flattenArrayTypeChildren(t,e,r,n){return{...e,[t.type]:[...e[t.type]||[],{...r,...this.mapNestedChildrenToProps(t,n)}]}}mapObjectTypeChildren(t,e,r,n){switch(t.type){case"title":return{...e,[t.type]:n,titleAttributes:{...r}};case"body":return{...e,bodyAttributes:{...r}};case"html":return{...e,htmlAttributes:{...r}};default:return{...e,[t.type]:{...r}}}}mapArrayTypeChildrenToProps(t,e){let r={...e};return Object.keys(t).forEach(n=>{r={...r,[n]:t[n]}}),r}
40warnOnInvalidChildren(t,e){return tA(rA.some(r=>t.type===r),typeof t.type=="function"?"You may be attempting to nest <Helmet> components within each other, which is not allowed. Refer to our API for more information.":`Only elements types ${rA.join(", ")} are allowed. Helmet does not support rendering <${t.type}> elements. Refer to our API for more information.`),tA(!e||typeof e=="string"||Array.isArray(e)&&!e.some(r=>typeof r!="string"),`Helmet expects a string as a child of <${t.type}>. Did you forget to wrap your children in braces? ( <${t.type}>{\`\`}</${t.type}> ) Refer to our API for more information.`),!0}mapChildrenToProps(t,e){let r={};return F.Children.forEach(t,n=>{if(!n||!n.props)return;const{children:s,...i}=n.props,o=Object.keys(i).reduce((c,u)=>(c[qR[u]||u]=i[u],c),{});let{type:l}=n;switch(typeof l=="symbol"?l=l.toString():this.warnOnInvalidChildren(n,s),l){case"Symbol(react.fragment)":e=this.mapChildrenToProps(s,e);break;case"link":case"meta":case"noscript":case"script":case"style":r=this.flattenArrayTypeChildren(n,r,o,s);break;default:e=this.mapObjectTypeChildren(n,e,o,s);break}}),this.mapArrayTypeChildrenToProps(r,e)}render(){const{children:t,...e}=this.props;let r={...e},{helmetData:n}=e;if(t&&(r=this.mapChildrenToProps(t,r)),n&&!(n instanceof gw)){const s=n;n=new gw(s.context,!0),delete r.helmetData}return xw?F.createElement(TB,{...r}):n?F.createElement(sA,{...r,context:n.value}):F.createElement(XR.Consumer,null,s=>F.createElement(sA,{...r,context:s}))}},Ta(wb,"defaultProps",{defer:!0,encodeSpecialCharacters:!0,prioritizeSeoTags:!1}),wb);/**
41 * @remix-run/router v1.23.0
42 *
43 * Copyright (c) Remix Software Inc.
44 *
45 * This source code is licensed under the MIT license found in the
46 * LICENSE.md file in the root directory of this source tree.
47 *
48 * @license MIT
49 */function Eh(){return Eh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Eh.apply(this,arguments)}var di;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(di||(di={}));const lA="popstate";function AB(t){t===void 0&&(t={});function e(n,s){let{pathname:i,search:o,hash:l}=n.location;return vw("",{pathname:i,search:o,hash:l},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:hg(s)}return kB(e,r,null,t)}function Jt(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function QR(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function EB(){return Math.random().toString(36).substr(2,8)}function cA(t,e){return{usr:t.state,key:t.key,idx:e}}function vw(t,e,r,n){return r===void 0&&(r=null),Eh({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?vu(e):e,{state:r,key:e&&e.key||n||EB()})}function hg(t){let{pathname:e="/",search:r="",hash:n=""}=t;return r&&r!=="?"&&(e+=r.charAt(0)==="?"?r:"?"+r),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function vu(t){let e={};if(t){let r=t.indexOf("#");r>=0&&(e.hash=t.substr(r),t=t.substr(0,r));let n=t.indexOf("?");n>=0&&(e.search=t.substr(n),t=t.substr(0,n)),t&&(e.pathname=t)}return e}function kB(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,o=s.history,l=di.Pop,c=null,u=d();u==null&&(u=0,o.replaceState(Eh({},o.state,{idx:u}),""));function d(){return(o.state||{idx:null}).idx}function h(){l=di.Pop;let g=d(),v=g==null?null:g-u;u=g,c&&c({action:l,location:w.location,delta:v})}function m(g,v){l=di.Push;let b=vw(w.location,g,v);u=d()+1;let y=cA(b,u),T=w.createHref(b);try{o.pushState(y,"",T)}catch(N){if(N instanceof DOMException&&N.name==="DataCloneError")throw N;s.location.assign(T)}i&&c&&c({action:l,location:w.location,delta:1})}function p(g,v){l=di.Replace;let b=vw(w.location,g,v);u=d();let y=cA(b,u),T=w.createHref(b);o.replaceState(y,"",T),i&&c&&c({action:l,location:w.location,delta:0})}function x(g){let v=s.location.origin!=="null"?s.location.origin:s.location.href,b=typeof g=="string"?g:hg(g);return b=b.replace(/ $/,"%20"),Jt(v,"No window.location.(origin|href) available to create URL for href: "+b),new URL(b,v)}let w={get action(){return l},get location(){return t(s,o)},listen(g){if(c)throw new Error("A history only accepts one active listener");return s.addEventListener(lA,h),c=g,()=>{s.removeEventListener(lA,h),c=null}},createHref(g){return e(s,g)},createURL:x,encodeLocation(g){let v=x(g);return{pathname:v.pathname,search:v.search,hash:v.hash}},push:m,replace:p,go(g){return o.go(g)}};return w}var uA;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(uA||(uA={}));function PB(t,e,r){return r===void 0&&(r="/"),CB(t,e,r)}function CB(t,e,r,n){let s=typeof e=="string"?vu(e):e,i=TN(s.pathname||"/",r);if(i==null)return null;let o=JR(t);IB(o);let l=null;for(let c=0;l==null&&c<o.length;++c){let u=HB(i);l=VB(o[c],u)}return l}function JR(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,o,l)=>{let c={relativePath:l===void 0?i.path||"":l,caseSensitive:i.caseSensitive===!0,childrenIndex:o,route:i};c.relativePath.startsWith("/")&&(Jt(c.relativePath.startsWith(n),'Absolute route path "'+c.relativePath+'" nested under path '+('"'+n+'" is not val
49id. An absolute child route path ')+"must start with the combined path of all its parent routes."),c.relativePath=c.relativePath.slice(n.length));let u=Ni([n,c.relativePath]),d=r.concat(c);i.children&&i.children.length>0&&(Jt(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),JR(i.children,e,d,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:FB(u,i.index),routesMeta:d})};return t.forEach((i,o)=>{var l;if(i.path===""||!((l=i.path)!=null&&l.includes("?")))s(i,o);else for(let c of ZR(i.path))s(i,o,c)}),e}function ZR(t){let e=t.split("/");if(e.length===0)return[];let[r,...n]=e,s=r.endsWith("?"),i=r.replace(/\?$/,"");if(n.length===0)return s?[i,""]:[i];let o=ZR(n.join("/")),l=[];return l.push(...o.map(c=>c===""?i:[i,c].join("/"))),s&&l.push(...o),l.map(c=>t.startsWith("/")&&c===""?"/":c)}function IB(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:BB(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const OB=/^:[\w-]+$/,RB=3,DB=2,MB=1,$B=10,LB=-2,dA=t=>t==="*";function FB(t,e){let r=t.split("/"),n=r.length;return r.some(dA)&&(n+=LB),e&&(n+=DB),r.filter(s=>!dA(s)).reduce((s,i)=>s+(OB.test(i)?RB:i===""?MB:$B),n)}function BB(t,e){return t.length===e.length&&t.slice(0,-1).every((n,s)=>n===e[s])?t[t.length-1]-e[e.length-1]:0}function VB(t,e,r){let{routesMeta:n}=t,s={},i="/",o=[];for(let l=0;l<n.length;++l){let c=n[l],u=l===n.length-1,d=i==="/"?e:e.slice(i.length)||"/",h=UB({path:c.relativePath,caseSensitive:c.caseSensitive,end:u},d),m=c.route;if(!h)return null;
vendor: 9,284 bytes, lines 49-58
49Object.assign(s,h.params),o.push({params:s,pathname:Ni([i,h.pathname]),pathnameBase:KB(Ni([i,h.pathnameBase])),route:m}),h.pathnameBase!=="/"&&(i=Ni([i,h.pathnameBase]))}return o}function UB(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=zB(t.path,t.caseSensitive,t.end),s=e.match(r);if(!s)return null;let i=s[0],o=i.replace(/(.)\/+$/,"$1"),l=s.slice(1);return{params:n.reduce((u,d,h)=>{let{paramName:m,isOptional:p}=d;if(m==="*"){let w=l[h]||"";o=i.slice(0,i.length-w.length).replace(/(.)\/+$/,"$1")}const x=l[h];return p&&!x?u[m]=void 0:u[m]=(x||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:o,pattern:t}}function zB(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),QR(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 n=[],s="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(o,l,c)=>(n.push({paramName:l,isOptional:c!=null}),c?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function HB(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return QR(!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 TN(t,e){if(e==="/")return t;if(!t.toLowerCase().startsWith(e.toLowerCase()))return null;let r=e.endsWith("/")?e.length-1:e.length,n=t.charAt(r);return n&&n!=="/"?null:t.slice(r)||"/"}function qB(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:s=""}=typeof t=="string"?vu(t):t;return{pathname:r?r.startsWith("/")?r:WB(r,e):e,search:XB(n),hash:YB(s)}}function WB(t,e){let r=e.replace(/\/+$/,"").split("/");return t.split("/").forEach(s=>{s===".."?r.length>1&&r.pop():s!=="."&&r.push(s)}),r.length>1?r.join("/"):"/"}function b0(t,e,r,n){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+e+"` field ["+JSON.stringify(n)+"].  Please separate it out to the ")+("`to."+r+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function GB(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function e3(t,e){let r=GB(t);return e?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function t3(t,e,r,n){n===void 0&&(n=!1);let s;typeof t=="string"?s=vu(t):(s=Eh({},t),Jt(!s.pathname||!s.pathname.includes("?"),b0("?","pathname","search",s)),Jt(!s.pathname||!s.pathname.includes("#"),b0("#","pathname","hash",s)),Jt(!s.search||!s.search.includes("#"),b0("#","search","hash",s)));let i=t===""||s.pathname==="",o=i?"/":s.pathname,l;if(o==null)l=r;else{let h=e.length-1;if(!n&&o.startsWith("..")){let m=o.split("/");for(;m[0]==="..";)m.shift(),h-=1;s.pathname=m.join("/")}l=h>=0?e[h]:"/"}let c=qB(s,l),u=o&&o!=="/"&&o.endsWith("/"),d=(i||o===".")&&r.endsWith("/");return!c.pathname.endsWith("/")&&(u||d)&&(c.pathname+="/"),c}const Ni=t=>t.join("/").replace(/\/\/+/g,"/"),KB=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),XB=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,YB=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function QB(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const r3=["post","put","patch","delete"];new Set(r3);const JB=["get",...r3];new Set(JB);/**
50 * React Router v6.30.1
51 *
52 * Copyright (c) Remix Software Inc.
53 *
54 * This source code is licensed under the MIT license found in the
55 * LICENSE.md file in the root directory of this source tree.
56 *
57 * @license MIT
58 */function kh(){return kh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},kh.apply(this,arguments)}const AN=P.createContext(null),ZB=P.createContext(null),ml=P.createContext(null),sy=P.createContext(null),Ui=P.createContext({outlet:null,matches:[],isDataRoute:!1}),n3=P.createContext(null);function eV(t,e){let{relative:r}=e===void 0?{}:e;km()||Jt(!1);let{basename:n,navigator:s}=P.useContext(ml),{hash:i,pathname:o,search:l}=s3(t,{relative:r}),c=o;return n!=="/"&&(c=o==="/"?n:Ni([n,o])),s.createHref({pathname:c,search:l,hash:i})}function km(){return P.useContext(sy)!=null}function Ds(){return km()||Jt(!1),P.useContext(sy).location}function a3(t){P.useContext(ml).static||P.useLayoutEffect(t)}function cr(){let{isDataRoute:t}=P.useContext(Ui);return t?fV():tV()}function tV(){km()||Jt(!1);let t=P.useContext(AN),{basename:e,future:r,navigator:n}=P.useContext(ml),{matches:s}=P.useContext(Ui),{pathname:i}=Ds(),o=JSON.stringify(e3(s,r.v7_relativeSplatPath)),l=P.useRef(!1);return a3(()=>{l.current=!0}),P.useCallback(function(u,d){if(d===void 0&&(d={}),!l.current)return;if(typeof u=="number"){n.go(u);return}let h=t3(u,JSON.parse(o),i,d.relative==="path");t==null&&e!=="/"&&(h.pathname=h.pathname==="/"?e:Ni([e,h.pathname])),(d.replace?n.replace:n.push)(h,d.state,d)},[e,n,o,i,t])}function rV(){let{matches:t}=P.useContext(Ui),e=t[t.length-1];return e?e.params:{}}function s3(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=P.useContext(ml),{matches:s}=P.useContext(Ui),{pathname:i}=Ds(),o=JSON.stringify(e3(s,n.v7_relativeSplatPath));return P.useMemo(()=>t3(t,JSON.parse(o),i,r==="path"),[t,o,i,r])}function nV(t,e){return aV(t,e)}function aV(t,e,r,n){km()||Jt(!1);let{navigator:s}=P.useContext(ml),{matches:i}=P.useContext(Ui),o=i[i.length-1],l=o?o.params:{};o&&o.pathname;let c=o?o.pathnameBase:"/";o&&o.route;let u=Ds(),d;if(e){var h;let g=typeof e=="string"?vu(e):e;c==="/"||(h=g.pathname)!=null&&h.startsWith(c)||Jt(!1),d=g}else d=u;let m=d.pathname||"/",p=m;if(c!=="/"){let g=c.replace(/^\//,"").split("/");p="/"+m.replace(/^\//,"").split("/").slice(g.length).join("/")}let x=PB(t,{pathname:p}),w=cV(x&&x.map(g=>Object.assign({},g,{params:Object.assign({},l,g.params),pathname:Ni([c,s.encodeLocation?s.encodeLocation(g.pathname).pathname:g.pathname]),pathnameBase:g.pathnameBase==="/"?c:Ni([c,s.encodeLocation?s.encodeLocation(g.pathnameBase).pathname:g.pathnameBase])})),i,r,n);return e&&w?P.createElement(sy.Provider,{value:{location:kh({pathname:"/",search:"",hash:"",state:null,key:"default"},d),navigationType:di.Pop}},w):w}function sV(){let t=mV(),e=QB(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),r=t instanceof Error?t.stack:null,s={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return P.createElement(P.Fragment,null,P.createElement("h2",null,"Unexpected Application Error!"),P.createElement("h3",{style:{fontStyle:"italic"}},e),r?P.createElement("pre",{style:s},r):null,null)}const iV=P.createElement(sV,null);class oV extends P.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,r){return r.location!==e.location||r.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:r.error,location:r.location,revalidation:e.revalidation||r.revalidation}}componentDidCatch(e,r){console.error("React Router caught the following error during render",e,r)}render(){return this.state.error!==void 0?P.createElement(Ui.Provider,{value:this.props.routeContext},P.createElement(n3.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function lV(t){let{routeContext:e,match:r,children:n}=t,s=P.useContext(AN);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(Ui.Provider,{value:e},n)}function cV(t,e,r,n){var s;if(e===void 0&&(e=[]),r===void 0&&(r=null),n===void 0&&(n=null),t==null){var i;if(!r)return null;if(r.errors)t=r.matches;else if((i=n)!=null&&i.v7_partialHydration&&e.length===0&&!r.initialized&&r.matches.length>0)t=r.matches;else return null}let o=t,l=(s=r)==null?void 0:s.errors;if(l!=null){let d=o.findIndex(h=>h.route.id&&(l==null?void 0:l[h.route.id])!==void 0);d>=0||Jt(!1),o=o.slice(0,Math.min(o.length,d+1))}let c=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let d=0;d<o.length;d++){let h=o[d];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(u=d),h.route.id){let{loaderData:m,errors:p}=r,x=h.route.loader&&m[h.route.id]===void 0&&(!p||p[h.route.id]===void 0);if(h.route.lazy||x){c=!0,u>=0?o=o.slice(0,u+1):o=[o[0]];break}}}return o.reduceRight((d,h,m)=>{let p,x=!1,w=null,g=null;r&&(p=l&&h.route.id?l[h.route.id]:void 0,w=h.route.errorElement||iV,c&&(u<0&&m===0?(pV("route-fallback"),x=!0,g=null):u===m&&(x=!0,g=h.route.hydrateFallbackElement||null)));let v=e.concat(o.slice(0,m+1)),b=()=>{let y;return p?y=w:x?y=g:h.route.Component?y=P.createElement(h.route.Component,null):h.route.element?y=h.route.element:y=d,P.createElement(lV,{match:h,routeC
58ontext:{outlet:d,matches:v,isDataRoute:r!=null},children:y})};return r&&(h.route.ErrorBoundary||h.route.errorElement||m===0)?P.createElement(oV,{location:r.location,revalidation:r.revalidation,component:w,error:p,children:b(),routeContext:{outlet:null,matches:v,isDataRoute:!0}}):b()},null)}var i3=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(i3||{}),o3=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}(o3||{});function uV(t){let e=P.useContext(AN);return e||Jt(!1),e}function dV(t){let e=P.useContext(ZB);return e||Jt(!1),e}function hV(t){let e=P.useContext(Ui);return e||Jt(!1),e}function l3(t){let e=hV(),r=e.matches[e.matches.length-1];return r.route.id||Jt(!1),r.route.id}function mV(){var t;let e=P.useContext(n3),r=dV(),n=l3();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function fV(){let{router:t}=uV(i3.UseNavigateStable),e=l3(o3.UseNavigateStable),r=P.useRef(!1);return a3(()=>{r.current=!0}),P.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,kh({fromRouteId:e},i)))},[t,e])}const hA={};function pV(t,e,r){hA[t]||(hA[t]=!0)}function gV(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function hr(t){Jt(!1)}function xV(t){let{basename:e="/",children:r=null,location:n,navigationType:s=di.Pop,navigator:i,static:o=!1,future:l}=t;km()&&Jt(!1);let c=e.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:c,navigator:i,static:o,future:kh({v7_relativeSplatPath:!1},l)}),[c,l,i,o]);typeof n=="string"&&(n=vu(n));let{pathname:d="/",search:h="",hash:m="",state:p=null,key:x="default"}=n,w=P.useMemo(()=>{let g=TN(d,c);return g==null?null:{location:{pathname:g,search:h,hash:m,state:p,key:x},navigationType:s}},[c,d,h,m,p,x,s]);return w==null?null:P.createElement(ml.Provider,{value:u},P.createElement(sy.Provider,{children:r,value:w}))}function mA(t){let{children:e,location:r}=t;return nV(bw(e),r)}new Promise(()=>{});function bw(t,e){e===void 0&&(e=[]);let r=[];return P.Children.forEach(t,(n,s)=>{if(!P.isValidElement(n))return;let i=[...e,s];if(n.type===P.Fragment){r.push.apply(r,bw(n.props.children,i));return}n.type!==hr&&Jt(!1),!n.props.index||!n.props.children||Jt(!1);let o={id:n.props.id||i.join("-"),caseSensitive:n.props.caseSensitive,element:n.props.element,Component:n.props.Component,index:n.props.index,path:n.props.path,loader:n.props.loader,action:n.props.action,errorElement:n.props.errorElement,ErrorBoundary:n.props.ErrorBoundary,hasErrorBoundary:n.props.ErrorBoundary!=null||n.props.errorElement!=null,shouldRevalidate:n.props.shouldRevalidate,handle:n.props.handle,lazy:n.props.lazy};n.props.children&&(o.children=bw(n.props.children,i)),r.push(o)}),r}/**
59 * React Router DOM v6.30.1
60 *
61 * Copyright (c) Remix Software Inc.
62 *
63 * This source code is licensed under the MIT license found in the
64 * LICENSE.md file in the root directory of this source tree.
65 *
66 * @license MIT
67 */function ww(){return ww=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ww.apply(this,arguments)}function yV(t,e){if(t==null)return{};var r={},n=Object.keys(t),s,i;for(i=0;i<n.length;i++)s=n[i],!(e.indexOf(s)>=0)&&(r[s]=t[s]);return r}function vV(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function bV(t,e){return t.button===0&&(!e||e==="_self")&&!vV(t)}const wV=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],jV="6";try{window.__reactRouterVersion=jV}catch{}const NV="startTransition",fA=BF[NV];function _V(t){let{basename:e,children:r,future:n,window:s}=t,i=P.useRef();i.current==null&&(i.current=AB({window:s,v5Compat:!0}));let o=i.current,[l,c]=P.useState({action:o.action,location:o.location}),{v7_startTransition:u}=n||{},d=P.useCallback(h=>{u&&fA?fA(()=>c(h)):c(h)},[c,u]);return P.useLayoutEffect(()=>o.listen(d),[o,d]),P.useEffect(()=>gV(n),[n]),P.createElement(xV,{basename:e,children:r,location:l.location,navigationType:l.action,navigator:o,future:n})}const SV=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",TV=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,st=P.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:o,state:l,target:c,to:u,preventScrollReset:d,viewTransition:h}=e,m=yV(e,wV),{basename:p}=P.useContext(ml),x,w=!1;if(typeof u=="string"&&TV.test(u)&&(x=u,SV))try{let y=new URL(window.location.href),T=u.startsWith("//")?new URL(y.protocol+u):new URL(u),N=TN(T.pathname,p);T.origin===y.origin&&N!=null?u=N+T.search+T.hash:w=!0}catch{}let g=eV(u,{relative:s}),v=AV(u,{replace:o,state:l,target:c,preventScrollReset:d,relative:s,viewTransition:h});function b(y){n&&n(y),y.defaultPrevented||v(y)}return P.createElement("a",ww({},m,{href:x||g,onClick:w||i?n:b,ref:r,target:c}))});var pA;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(pA||(pA={}));var gA;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(gA||(gA={}));function AV(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:o,viewTransition:l}=e===void 0?{}:e,c=cr(),u=Ds(),d=s3(t,{relative:o});return P.useCallback(h=>{if(bV(h,r)){h.preventDefault();let m=n!==void 0?n:hg(u)===hg(d);c(t,{replace:m,state:s,preventScrollReset:i,relative:o,viewTransition:l})}},[u,c,d,n,s,r,t,i,o,l])}/**
68 * @license lucide-react v0.344.0 - ISC
69 *
70 * This source code is licensed under the ISC license.
71 * See the LICENSE file in the root directory of this source tree.
72 */var EV={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"};/**
73 * @license lucide-react v0.344.0 - ISC
74 *
75 * This source code is licensed under the ISC license.
76 * See the LICENSE file in the root directory of this source tree.
77 */const kV=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase().trim(),ne=(t,e)=>{const r=P.forwardRef(({color:n="currentColor",size:s=24,strokeWidth:i=2,absoluteStrokeWidth:o,className:l="",children:c,...u},d)=>P.createElement("svg",{ref:d,...EV,width:s,height:s,stroke:n,strokeWidth:o?Number(i)*24/Number(s):i,className:["lucide",`lucide-${kV(t)}`,l].join(" "),...u},[...e.map(([h,m])=>
77P.createElement(h,m)),...Array.isArray(c)?c:[c]]));return r.displayName=`${t}`,r};/**
78 * @license lucide-react v0.344.0 - ISC
79 *
80 * This source code is licensed under the ISC license.
81 * See the LICENSE file in the root directory of this source tree.
82 */const EN=ne("Activity",[["path",{d:"M22 12h-4l-3 9L9 3l-3 9H2",key:"d5dnw9"}]]);/**
83 * @license lucide-react v0.344.0 - ISC
84 *
85 * This source code is licensed under the ISC license.
86 * See the LICENSE file in the root directory of this source tree.
87 */const pt=ne("AlertCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]]);/**
88 * @license lucide-react v0.344.0 - ISC
89 *
90 * This source code is licensed under the ISC license.
91 * See the LICENSE file in the root directory of this source tree.
92 */const ka=ne("AlertTriangle",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z",key:"c3ski4"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
93 * @license lucide-react v0.344.0 - ISC
94 *
95 * This source code is licensed under the ISC license.
96 * See the LICENSE file in the root directory of this source tree.
97 */const PV=ne("Archive",[["rect",{width:"20",height:"5",x:"2",y:"3",rx:"1",key:"1wp1u1"}],["path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8",key:"1s80jp"}],["path",{d:"M10 12h4",key:"a56b0p"}]]);/**
98 * @license lucide-react v0.344.0 - ISC
99 *
100 * This source code is licensed under the ISC license.
101 * See the LICENSE file in the root directory of this source tree.
102 */const CV=ne("Armchair",[["path",{d:"M19 9V6a2 2 0 0 0-2-2H7a2 2 0 0 0-2 2v3",key:"irtipd"}],["path",{d:"M3 16a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-5a2 2 0 0 0-4 0v2H7v-2a2 2 0 0 0-4 0Z",key:"1e01m0"}],["path",{d:"M5 18v2",key:"ppbyun"}],["path",{d:"M19 18v2",key:"gy7782"}]]);/**
103 * @license lucide-react v0.344.0 - ISC
104 *
105 * This source code is licensed under the ISC license.
106 * See the LICENSE file in the root directory of this source tree.
107 */const IV=ne("ArrowDown",[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]]);/**
108 * @license lucide-react v0.344.0 - ISC
109 *
110 * This source code is licensed under the ISC license.
111 * See the LICENSE file in the root directory of this source tree.
112 */const jw=ne("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
113 * @license lucide-react v0.344.0 - ISC
114 *
115 * This source code is licensed under the ISC license.
116 * See the LICENSE file in the root directory of this source tree.
117 */const gs=ne("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
118 * @license lucide-react v0.344.0 - ISC
119 *
120 * This source code is licensed under the ISC license.
121 * See the LICENSE file in the root directory of this source tree.
122 */const xA=ne("ArrowUpDown",[["path",{d:"m21 16-4 4-4-4",key:"f6ql7i"}],["path",{d:"M17 20V4",key:"1ejh1v"}],["path",{d:"m3 8 4-4 4 4",key:"11wl7u"}],["path",{d:"M7 4v16",key:"1glfcx"}]]);/**
123 * @license lucide-react v0.344.0 - ISC
124 *
125 * This source code is licensed under the ISC license.
126 * See the LICENSE file in the root directory of this source tree.
127 */const OV=ne("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
128 * @license lucide-react v0.344.0 - ISC
129 *
130 * This source code is licensed under the ISC license.
131 * See the LICENSE file in the root directory of this source tree.
132 */const RV=ne("BarChart3",[["path",{d:"M3 3v18h18",key:"1s2lah"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
133 * @license lucide-react v0.344.0 - ISC
134 *
135 * This source code is licensed under the ISC license.
136 * See the LICENSE file in the root directory of this source tree.
137 */const yA=ne("Bell",[["path",{d:"M6 8a6 6 0 0 1 12 0c0 7 3 9 3 9H3s3-2 3-9",key:"1qo2s2"}],["path",{d:"M10.3 21a1.94 1.94 0 0 0 3.4 0",key:"qgo35s"}]]);/**
138 * @license lucide-react v0.344.0 - ISC
139 *
140 * This source code is licensed under the ISC license.
141 * See the LICENSE file in the root directory of this source tree.
142 */const DV=ne("Bike",[["circle",{cx:"18.5",cy:"17.5",r:"3.5",key:"15x4ox"}],["circle",{cx:"5.5",cy:"17.5",r:"3.5",key:"1noe27"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["path",{d:"M12 17.5V14l-3-3 4-3 2 3h2",key:"1npguv"}]]);/**
143 * @license lucide-react v0.344.0 - ISC
144 *
145 * This source code is licensed under the ISC license.
146 * See the LICENSE file in the root directory of this source tree.
147 */const MV=ne("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
148 * @license lucide-react v0.344.0 - ISC
149 *
150 * This source code is licensed under the ISC license.
151 * See the LICENSE file in the root directory of this source tree.
152 */const c3=ne("Briefcase",[["rect",{width:"20",height:"14",x:"2",y:"7",rx:"2",ry:"2",key:"eto64e"}],["path",{d:"M16 21V5a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"zwj3tp"}]]);/**
153 * @license lucide-react v0.344.0 - ISC
154 *
155 * This source code is licensed under the ISC license.
156 * See the LICENSE file in the root directory of this source tree.
157 */const xn=ne("Building2",[["path",{d:"M6 22V4a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v18Z",key:"1b4qmf"}],["path",{d:"M6 12H4a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2h2",key:"i71pzd"}],["path",{d:"M18 9h2a2 2 0 0 1 2 2v9a2 2 0 0 1-2 2h-2",key:"10jefs"}],["path",{d:"M10 6h4",key:"1itunk"}],["path",{d:"M10 10h4",key:"tcdvrf"}
157],["path",{d:"M10 14h4",key:"kelpxr"}],["path",{d:"M10 18h4",key:"1ulq68"}]]);/**
158 * @license lucide-react v0.344.0 - ISC
159 *
160 * This source code is licensed under the ISC license.
161 * See the LICENSE file in the root directory of this source tree.
162 */const mg=ne("Building",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",ry:"2",key:"76otgf"}],["path",{d:"M9 22v-4h6v4",key:"r93iot"}],["path",{d:"M8 6h.01",key:"1dz90k"}],["path",{d:"M16 6h.01",key:"1x0f13"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M16 14h.01",key:"1gbofw"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M8 14h.01",key:"6423bh"}]]);/**
163 * @license lucide-react v0.344.0 - ISC
164 *
165 * This source code is licensed under the ISC license.
166 * See the LICENSE file in the root directory of this source tree.
167 */const vA=ne("Cable",[["path",{d:"M4 9a2 2 0 0 1-2-2V5h6v2a2 2 0 0 1-2 2Z",key:"1s6oa5"}],["path",{d:"M3 5V3",key:"1k5hjh"}],["path",{d:"M7 5V3",key:"1t1388"}],["path",{d:"M19 15V6.5a3.5 3.5 0 0 0-7 0v11a3.5 3.5 0 0 1-7 0V9",key:"1ytv72"}],["path",{d:"M17 21v-2",key:"ds4u3f"}],["path",{d:"M21 21v-2",key:"eo0ou"}],["path",{d:"M22 19h-6v-2a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2Z",key:"sdz6o8"}]]);/**
168 * @license lucide-react v0.344.0 - ISC
169 *
170 * This source code is licensed under the ISC license.
171 * See the LICENSE file in the root directory of this source tree.
172 */const $V=ne("Calculator",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["line",{x1:"8",x2:"16",y1:"6",y2:"6",key:"x4nwl0"}],["line",{x1:"16",x2:"16",y1:"14",y2:"18",key:"wjye3r"}],["path",{d:"M16 10h.01",key:"1m94wz"}],["path",{d:"M12 10h.01",key:"1nrarc"}],["path",{d:"M8 10h.01",key:"19clt8"}],["path",{d:"M12 14h.01",key:"1etili"}],["path",{d:"M8 14h.01",key:"6423bh"}],["path",{d:"M12 18h.01",key:"mhygvu"}],["path",{d:"M8 18h.01",key:"lrp35t"}]]);/**
173 * @license lucide-react v0.344.0 - ISC
174 *
175 * This source code is licensed under the ISC license.
176 * See the LICENSE file in the root directory of this source tree.
177 */const u3=ne("CalendarClock",[["path",{d:"M21 7.5V6a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h3.5",key:"1osxxc"}],["path",{d:"M16 2v4",key:"4m81vk"}],["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M3 10h5",key:"r794hk"}],["path",{d:"M17.5 17.5 16 16.3V14",key:"akvzfd"}],["circle",{cx:"16",cy:"16",r:"6",key:"qoo3c4"}]]);/**
178 * @license lucide-react v0.344.0 - ISC
179 *
180 * This source code is licensed under the ISC license.
181 * See the LICENSE file in the root directory of this source tree.
182 */const De=ne("Calendar",[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]]);/**
183 * @license lucide-react v0.344.0 - ISC
184 *
185 * This source code is licensed under the ISC license.
186 * See the LICENSE file in the root directory of this source tree.
187 */const LV=ne("Car",[["path",{d:"M19 17h2c.6 0 1-.4 1-1v-3c0-.9-.7-1.7-1.5-1.9C18.7 10.6 16 10 16 10s-1.3-1.4-2.2-2.3c-.5-.4-1.1-.7-1.8-.7H5c-.6 0-1.1.4-1.4.9l-1.4 2.9A3.7 3.7 0 0 0 2 12v4c0 .6.4 1 1 1h2",key:"5owen"}],["circle",{cx:"7",cy:"17",r:"2",key:"u2ysq9"}],["path",{d:"M9 17h6",key:"r8uit2"}],["circle",{cx:"17",cy:"17",r:"2",key:"axvx0g"}]]);/**
188 * @license lucide-react v0.344.0 - ISC
189 *
190 * This source code is licensed under the ISC license.
191 * See the LICENSE file in the root directory of this source tree.
192 */const fc=ne("CheckCircle2",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
193 * @license lucide-react v0.344.0 - ISC
194 *
195 * This source code is licensed under the ISC license.
196 * See the LICENSE file in the root directory of this source tree.
197 */const qr=ne("CheckCircle",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
198 * @license lucide-react v0.344.0 - ISC
199 *
200 * This source code is licensed under the ISC license.
201 * See the LICENSE file in the root directory of this source tree.
202 */const Uo=ne("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
203 * @license lucide-react v0.344.0 - ISC
204 *
205 * This source code is licensed under the ISC license.
206 * See the LICENSE file in the root directory of this source tree.
207 */const zo=ne("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
208 * @license lucide-react v0.344.0 - ISC
209 *
210 * This source code is licensed under the ISC license.
211 * See the LICENSE file in the root directory of this source tree.
212 */const fl=ne("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
213 * @license lucide-react v0.344.0 - ISC
214 *
215 * This source code is licensed under the ISC license.
216 * See the LICENSE file in the root directory of this source tree.
217 */const _i=ne("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
218 * @license lucide-react v0.344.0 - ISC
219 *
220 * This source code is licensed under the ISC license.
221 * See the LICENSE file in the root directory of this source tree.
222 */const fg=ne("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]]);/**
223 * @license lucide-react v0.344.0 - ISC
224 *
225 * This source code is licensed under the ISC license.
226 * See the LICENSE file in the root directory of this source tree.
227 */const FV=ne("CircleDollarSign",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M16 8h-6a2 2 0 1 0 0 4h4a2 2 0 1 1 0 4H8",key:"1h4pet"}],["path",{d:"M12 18V6",key:"zqpxq5"}]]);/**
228 * @license lucide-react v0.344.0 - ISC
229 *
230 * This source code is licensed under the ISC license.
231 * See the LICENSE file in the root directory of this source tree.
232 */const d3=ne("CircleDot",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}]]);/**
233 * @license lucide-react v0.344.0 - ISC
234 *
235 * This source code is licensed under the ISC license.
236 * See the LICENSE file in the root directory of this source tree.
237 */const bA=ne("CircleUser",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}],["path",{d:"M7 20.662V19a2 2 0 0 1 2-2h6a2 2 0 0 1 2 2v1.662",key:"154egf"}]]);/**
238 * @license lucide-react v0.344.0 - ISC
239 *
240 * This source code is licensed under the ISC license.
241 * See the LICENSE file in the root directory of this source tree.
242 */const qe=ne("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
243 * @license lucide-react v0.344.0 - ISC
244 *
245 * This source code is licensed under the ISC license.
246 * See the LICENSE file in the root directory of this source tree.
247 */const BV=ne("Coffee",[["path",{d:"M17 8h1a4 4 0 1 1 0 8h-1",key:"jx4kbh"}],["path",{d:"M3 8h14v9a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4Z",key:"1bxrl0"}],["line",{x1:"6",x2:"6",y1:"2",y2:"4",key:"1cr9l3"}],["line",{x1:"10",x2:"10",y1:"2",y2:"4",key:"170wym"}],["line",{x1:"14",x2:"14",y1:"2",y2:"4",key:"1c5f70"}]]);/**
248 * @license lucide-react v0.344.0 - ISC
249 *
250 * This source code is licensed under the ISC license.
251 * See the LICENSE file in the root directory of this source tree.
252 */const h3=ne("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]);/**
253 * @license lucide-react v0.344.0 - ISC
254 *
255 * This source code is licensed under the ISC license.
256 * See the LICENSE file in the root directory of this source tree.
257 */const Kn=ne("CreditCard",[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]]);/**
258 * @license lucide-react v0.344.0 - ISC
259 *
260 * This source code is licensed under the ISC license.
261 * See the LICENSE file in the root directory of this source tree.
262 */const VV=ne("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]]);/**
263 * @license lucide-react v0.344.0 - ISC
264 *
265 * This source code is licensed under the ISC license.
266 * See the LICENSE file in the root directory of this source tree.
267 */const Ph=ne("DollarSign",[["line",{x1:"12",x2:"12",y1:"2",y2:"22",key:"7eqyqh"}],["path",{d:"M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6",key:"1b0p4s"}]]);/**
268 * @license lucide-react v0.344.0 - ISC
269 *
270 * This source code is licensed under the ISC license.
271 * See the LICENSE file in the root directory of this source tree.
272 */const Ho=ne("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
273 * @license lucide-react v0.344.0 - ISC
274 *
275 * This source code is licensed under the ISC license.
276 * See the LICENSE file in the root directory of this source tree.
277 */const bu=ne("Euro",[["path",{d:"M4 10h12",key:"1y6xl8"}],["path",{d:"M4 14h9",key:"1loblj"}],["path",{d:"M19 6a7.7 7.7 0 0 0-5.2-2A7.9 7.9 0 0 0 6 12c0 4.4 3.5 8 7.8 8 2 0 3.8-.8 5.2-2",key:"1j6lzo"}]]);/**
278 * @license lucide-react v0.344.0 - ISC
279 *
280 * This source code is licensed under the ISC license.
281 * See the LICENSE file in the root directory of this source tree.
282 */const pc=ne("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]]);/**
283 * @license lucide-react v0.344.0 - ISC
284 *
285 * This source code is licensed under the ISC license.
286 * See the LICENSE file in the root directory of this source tree.
287 */const qo=ne("EyeOff",[["path",{d:"M9.88 9.88a3 3 0 1 0 4.24 4.24",key:"1jxqfv"}],["path",{d:"M10.73 5.08A10.43 10.43 0 0 1 12 5c7 0 10 7 10 7a13.16 13.16 0 0 1-1.67 2.68",key:"9wicm4"}],["path",{d:"M6.61 6.61A13.526 13.526 0 0 0 2 12s3 7 10 7a9.74 9.74 0 0 0 5.39-1.61",key:"1jreej"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]]);/**
288 * @license lucide-react v0.344.0 - ISC
289 *
290 * This source code is licensed under the ISC license.
291 * See the LICENSE file in the root directory of this source tree.
292 */const xr=ne("Eye",[["path",{d:"M2 12s3-7 10-7 10 7 10 7-3 7-10 7-10-7-10-7Z",key:"rwhkz3"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
293 * @license lucide-react v0.344.0 - ISC
294 *
295 * This source code is licensed under the ISC license.
296 * See the LICENSE file in the root directory of this source tree.
297 */const wu=ne("Facebook",[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]]);/**
298 * @license lucide-react v0.344.0 - ISC
299 *
300 * This source code is licensed under the ISC license.
301 * See the LICENSE file in the root directory of this source tree.
302 */const vr=ne("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"}]]);/**
303 * @license lucide-react v0.344.0 - ISC
304 *
305 * This source code is licensed under the ISC license.
306 * See the LICENSE file in the root directory of this source tree.
307 */const Ch=ne("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"}]]);/**
308 * @license lucide-react v0.344.0 - ISC
309 *
310 * This source code is licensed under the ISC license.
311 * See the LICENSE file in the root directory of this source tree.
312 */const m3=ne("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]]);/**
313 * @license lucide-react v0.344.0 - ISC
314 *
315 * This source code is licensed under the ISC license.
316 * See the LICENSE file in the root directory of this source tree.
317 */const wA=ne("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}
317]]);/**
318 * @license lucide-react v0.344.0 - ISC
319 *
320 * This source code is licensed under the ISC license.
321 * See the LICENSE file in the root directory of this source tree.
322 */const f3=ne("HelpCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
323 * @license lucide-react v0.344.0 - ISC
324 *
325 * This source code is licensed under the ISC license.
326 * See the LICENSE file in the root directory of this source tree.
327 */const UV=ne("Home",[["path",{d:"m3 9 9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"y5dka4"}],["polyline",{points:"9 22 9 12 15 12 15 22",key:"e2us08"}]]);/**
328 * @license lucide-react v0.344.0 - ISC
329 *
330 * This source code is licensed under the ISC license.
331 * See the LICENSE file in the root directory of this source tree.
332 */const iy=ne("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]]);/**
333 * @license lucide-react v0.344.0 - ISC
334 *
335 * This source code is licensed under the ISC license.
336 * See the LICENSE file in the root directory of this source tree.
337 */const Ri=ne("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
338 * @license lucide-react v0.344.0 - ISC
339 *
340 * This source code is licensed under the ISC license.
341 * See the LICENSE file in the root directory of this source tree.
342 */const ju=ne("Instagram",[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]]);/**
343 * @license lucide-react v0.344.0 - ISC
344 *
345 * This source code is licensed under the ISC license.
346 * See the LICENSE file in the root directory of this source tree.
347 */const xs=ne("Key",[["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["path",{d:"m15.5 7.5 3 3L22 7l-3-3",key:"1rn1fs"}]]);/**
348 * @license lucide-react v0.344.0 - ISC
349 *
350 * This source code is licensed under the ISC license.
351 * See the LICENSE file in the root directory of this source tree.
352 */const zV=ne("LayoutDashboard",[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]]);/**
353 * @license lucide-react v0.344.0 - ISC
354 *
355 * This source code is licensed under the ISC license.
356 * See the LICENSE file in the root directory of this source tree.
357 */const HV=ne("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);/**
358 * @license lucide-react v0.344.0 - ISC
359 *
360 * This source code is licensed under the ISC license.
361 * See the LICENSE file in the root directory of this source tree.
362 */const pl=ne("Linkedin",[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]]);/**
363 * @license lucide-react v0.344.0 - ISC
364 *
365 * This source code is licensed under the ISC license.
366 * See the LICENSE file in the root directory of this source tree.
367 */const Wo=ne("Loader",[["line",{x1:"12",x2:"12",y1:"2",y2:"6",key:"gza1u7"}],["line",{x1:"12",x2:"12",y1:"18",y2:"22",key:"1qhbu9"}],["line",{x1:"4.93",x2:"7.76",y1:"4.93",y2:"7.76",key:"xae44r"}],["line",{x1:"16.24",x2:"19.07",y1:"16.24",y2:"19.07",key:"bxnmvf"}],["line",{x1:"2",x2:"6",y1:"12",y2:"12",key:"89khin"}],["line",{x1:"18",x2:"22",y1:"12",y2:"12",key:"pb8tfm"}],["line",{x1:"4.93",x2:"7.76",y1:"19.07",y2:"16.24",key:"1uxjnu"}],["line",{x1:"16.24",x2:"19.07",y1:"7.76",y2:"4.93",key:"6duxfx"}]]);/**
368 * @license lucide-react v0.344.0 - ISC
369 *
370 * This source code is licensed under the ISC license.
371 * See the LICENSE file in the root directory of this source tree.
372 */const ga=ne("Lock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]]);/**
373 * @license lucide-react v0.344.0 - ISC
374 *
375 * This source code is licensed under the ISC license.
376 * See the LICENSE file in the root directory of this source tree.
377 */const p3=ne("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"}]]);/**
378 * @license lucide-react v0.344.0 - ISC
379 *
380 * This source code is licensed under the ISC license.
381 * See the LICENSE file in the root directory of this source tree.
382 */const Or=ne("Mail",[["rect",{width:"20",height:"16",x:"2",y:"4",rx:"2",key:"18n3k1"}],["path",{d:"m22 7-8.97 5.7a1.94 1.94 0 0 1-2.06 0L2 7",key:"1ocrg3"}]]);/**
383 * @license lucide-react v0.344.0 - ISC
384 *
385 * This source code is licensed under the ISC license.
386 * See the LICENSE file in the root directory of this source tree.
387 */const ja=ne("MapPin",[["path",{d:"M20 10c0 6-8 12-8 12s-8-6-8-12a8 8 0 0 1 16 0Z",key:"2oe9fu"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]]);/**
388 * @license lucide-react v0.344.0 - ISC
389 *
390 * This source code is licensed under the ISC license.
391 * See the LICENSE file in the root directory of this source tree.
392 */const jA=ne("Map",[["polygon",{points:"3 6 9 3 15 6 21 3 21 18 15 21 9 18 3 21",key:"ok2ie8"}],["line",{x1:"9",x2:"9",y1:"3",y2:"18",key:"w34qz5"}],["line",{x1:"15",x2:"15",y1:"6",y2:"21",key:"volv9a"}]]);/**
393 * @license lucide-react v0.344.0 - ISC
394 *
395 * This source code is licensed under the ISC license.
396 * See the LICENSE file in the root directory of this source tree.
397 */const qV=ne("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
398 * @license lucide-react v0.344.0 - ISC
399 *
400 * This source code is licensed under the ISC license.
401 * See the LICENSE file in the root directory of this source tree.
402 */const oy=ne("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"}]]);/**
403 * @license lucide-react v0.344.0 - ISC
404 *
405 * This source code is licensed under the ISC license.
406 * See the LICENSE file in the root directory of this source tree.
407 */const Ih=ne("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
408 * @license lucide-react v0.344.0 - ISC
409 *
410 * This source code is licensed under the ISC license.
411 * See the LICENSE file in the root directory of this source tree.
412 */const g3=ne("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"}]]);/**
413 * @license lucide-react v0.344.0 - ISC
414 *
415 * This source code is licensed under the ISC license.
416 * See the LICENSE file in the root directory of this source tree.
417 */const WV=ne("MonitorDot",[["circle",{cx:"19",cy:"6",r:"3",key:"108a5v"}],["path",{d:"M22 12v3a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h9",key:"1fet9y"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}]]);/**
418 * @license lucide-react v0.344.0 - ISC
419 *
420 * This source code is licensed under the ISC license.
421 * See the LICENSE file in the root directory of this source tree.
422 */const pg=ne("Monitor",[["rect",{width:"20",height:"14",x:"2",y:"3",rx:"2",key:"48i651"}],["line",{x1:"8",x2:"16",y1:"21",y2:"21",key:"1svkeh"}],["line",{x1:"12",x2:"12",y1:"17",y2:"21",key:"vw1qmm"}]]);/**
423 * @license lucide-react v0.344.0 - ISC
424 *
425 * This source code is licensed under the ISC license.
426 * See the LICENSE file in the root directory of this source tree.
427 */const x3=ne("Package",[["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
428 * @license lucide-react v0.344.0 - ISC
429 *
430 * This source code is licensed under the ISC license.
431 * See the LICENSE file in the root directory of this source tree.
432 */const GV=ne("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
433 * @license lucide-react v0.344.0 - ISC
434 *
435 * This source code is licensed under the ISC license.
436 * See the LICENSE file in the root directory of this source tree.
437 */const KV=ne("Percent",[["line",{x1:"19",x2:"5",y1:"5",y2:"19",key:"1x9vlm"}],["circle",{cx:"6.5",cy:"6.5",r:"2.5",key:"4mh3h7"}],["circle",{cx:"17.5",cy:"17.5",r:"2.5",key:"1mdrzq"}]]);/**
438 * @license lucide-react v0.344.0 - ISC
439 *
440 * This source code is licensed under the ISC license.
441 * See the LICENSE file in the root directory of this source tree.
442 */const NA=ne("PhoneCall",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}],["path",{d:"M14.05 2a9 9 0 0 1 8 7.94",key:"vmijpz"}],["path",{d:"M14.05 6A5 5 0 0 1 18 10",key:"13nbpp"}]]);/**
443 * @license lucide-react v0.344.0 - ISC
444 *
445 * This source code is licensed under the ISC license.
446 * See the LICENSE file in the root directory of this source tree.
447 */const XV=ne("PhoneIncoming",[["polyline",{points:"16 2 16 8 22 8",key:"1ygljm"}],["line",{x1:"22",x2:"16",y1:"2",y2:"8",key:"1xzwqn"}],["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
448 * @license lucide-react v0.344.0 - ISC
449 *
450 * This source code is licensed under the ISC license.
451 * See the LICENSE file in the root directory of this source tree.
452 */const YV=ne("PhoneOff",[["path",{d:"M10.68 13.31a16 16 0 0 0 3.41 2.6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7 2 2 0 0 1 1.72 2v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.42 19.42 0 0 1-3.33-2.67m
452-2.67-3.34a19.79 19.79 0 0 1-3.07-8.63A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91",key:"z86iuo"}],["line",{x1:"22",x2:"2",y1:"2",y2:"22",key:"11kh81"}]]);/**
453 * @license lucide-react v0.344.0 - ISC
454 *
455 * This source code is licensed under the ISC license.
456 * See the LICENSE file in the root directory of this source tree.
457 */const Na=ne("Phone",[["path",{d:"M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z",key:"foiqr5"}]]);/**
458 * @license lucide-react v0.344.0 - ISC
459 *
460 * This source code is licensed under the ISC license.
461 * See the LICENSE file in the root directory of this source tree.
462 */const QV=ne("PieChart",[["path",{d:"M21.21 15.89A10 10 0 1 1 8 2.83",key:"k2fpak"}],["path",{d:"M22 12A10 10 0 0 0 12 2v10z",key:"1rfc4y"}]]);/**
463 * @license lucide-react v0.344.0 - ISC
464 *
465 * This source code is licensed under the ISC license.
466 * See the LICENSE file in the root directory of this source tree.
467 */const Ut=ne("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
468 * @license lucide-react v0.344.0 - ISC
469 *
470 * This source code is licensed under the ISC license.
471 * See the LICENSE file in the root directory of this source tree.
472 */const JV=ne("Presentation",[["path",{d:"M2 3h20",key:"91anmk"}],["path",{d:"M21 3v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V3",key:"2k9sn8"}],["path",{d:"m7 21 5-5 5 5",key:"bip4we"}]]);/**
473 * @license lucide-react v0.344.0 - ISC
474 *
475 * This source code is licensed under the ISC license.
476 * See the LICENSE file in the root directory of this source tree.
477 */const y3=ne("Printer",[["polyline",{points:"6 9 6 2 18 2 18 9",key:"1306q4"}],["path",{d:"M6 18H4a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2h-2",key:"143wyd"}],["rect",{width:"12",height:"8",x:"6",y:"14",key:"5ipwut"}]]);/**
478 * @license lucide-react v0.344.0 - ISC
479 *
480 * This source code is licensed under the ISC license.
481 * See the LICENSE file in the root directory of this source tree.
482 */const Si=ne("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"}]]);/**
483 * @license lucide-react v0.344.0 - ISC
484 *
485 * This source code is licensed under the ISC license.
486 * See the LICENSE file in the root directory of this source tree.
487 */const ZV=ne("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
488 * @license lucide-react v0.344.0 - ISC
489 *
490 * This source code is licensed under the ISC license.
491 * See the LICENSE file in the root directory of this source tree.
492 */const kN=ne("Save",[["path",{d:"M19 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11l5 5v11a2 2 0 0 1-2 2z",key:"1owoqh"}],["polyline",{points:"17 21 17 13 7 13 7 21",key:"1md35c"}],["polyline",{points:"7 3 7 8 15 8",key:"8nz8an"}]]);/**
493 * @license lucide-react v0.344.0 - ISC
494 *
495 * This source code is licensed under the ISC license.
496 * See the LICENSE file in the root directory of this source tree.
497 */const Pm=ne("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
498 * @license lucide-react v0.344.0 - ISC
499 *
500 * This source code is licensed under the ISC license.
501 * See the LICENSE file in the root directory of this source tree.
502 */const _A=ne("Send",[["path",{d:"m22 2-7 20-4-9-9-4Z",key:"1q3vgg"}],["path",{d:"M22 2 11 13",key:"nzbqef"}]]);/**
503 * @license lucide-react v0.344.0 - ISC
504 *
505 * This source code is licensed under the ISC license.
506 * See the LICENSE file in the root directory of this source tree.
507 */const Nw=ne("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"}]]);/**
508 * @license lucide-react v0.344.0 - ISC
509 *
510 * This source code is licensed under the ISC license.
511 * See the LICENSE file in the root directory of this source tree.
512 */const vo=ne("Shield",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",ke
512y:"oel41y"}]]);/**
513 * @license lucide-react v0.344.0 - ISC
514 *
515 * This source code is licensed under the ISC license.
516 * See the LICENSE file in the root directory of this source tree.
517 */const _w=ne("Sparkles",[["path",{d:"m12 3-1.912 5.813a2 2 0 0 1-1.275 1.275L3 12l5.813 1.912a2 2 0 0 1 1.275 1.275L12 21l1.912-5.813a2 2 0 0 1 1.275-1.275L21 12l-5.813-1.912a2 2 0 0 1-1.275-1.275L12 3Z",key:"17u4zn"}],["path",{d:"M5 3v4",key:"bklmnn"}],["path",{d:"M19 17v4",key:"iiml17"}],["path",{d:"M3 5h4",key:"nem4j1"}],["path",{d:"M17 19h4",key:"lbex7p"}]]);/**
518 * @license lucide-react v0.344.0 - ISC
519 *
520 * This source code is licensed under the ISC license.
521 * See the LICENSE file in the root directory of this source tree.
522 */const eU=ne("Speaker",[["rect",{width:"16",height:"20",x:"4",y:"2",rx:"2",key:"1nb95v"}],["path",{d:"M12 6h.01",key:"1vi96p"}],["circle",{cx:"12",cy:"14",r:"4",key:"1jruaj"}],["path",{d:"M12 14h.01",key:"1etili"}]]);/**
523 * @license lucide-react v0.344.0 - ISC
524 *
525 * This source code is licensed under the ISC license.
526 * See the LICENSE file in the root directory of this source tree.
527 */const Nu=ne("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a2.121 2.121 0 1 1 3 3L12 15l-4 1 1-4Z",key:"1lpok0"}]]);/**
528 * @license lucide-react v0.344.0 - ISC
529 *
530 * This source code is licensed under the ISC license.
531 * See the LICENSE file in the root directory of this source tree.
532 */const tU=ne("Star",[["polygon",{points:"12 2 15.09 8.26 22 9.27 17 14.14 18.18 21.02 12 17.77 5.82 21.02 7 14.14 2 9.27 8.91 8.26 12 2",key:"8f66p6"}]]);/**
533 * @license lucide-react v0.344.0 - ISC
534 *
535 * This source code is licensed under the ISC license.
536 * See the LICENSE file in the root directory of this source tree.
537 */const rU=ne("Sun",[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]]);/**
538 * @license lucide-react v0.344.0 - ISC
539 *
540 * This source code is licensed under the ISC license.
541 * See the LICENSE file in the root directory of this source tree.
542 */const Ti=ne("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]]);/**
543 * @license lucide-react v0.344.0 - ISC
544 *
545 * This source code is licensed under the ISC license.
546 * See the LICENSE file in the root directory of this source tree.
547 */const nU=ne("Target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);/**
548 * @license lucide-react v0.344.0 - ISC
549 *
550 * This source code is licensed under the ISC license.
551 * See the LICENSE file in the root directory of this source tree.
552 */const aU=ne("Timer",[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]]);/**
553 * @license lucide-react v0.344.0 - ISC
554 *
555 * This source code is licensed under the ISC license.
556 * See the LICENSE file in the root directory of this source tree.
557 */const _a=ne("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
558 * @license lucide-react v0.344.0 - ISC
559 *
560 * This source code is licensed under the ISC license.
561 * See the LICENSE file in the root directory of this source tree.
562 */const ly=ne("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
563 * @license lucide-react v0.344.0 - ISC
564 *
565 * This source code is licensed under the ISC license.
566 * See the LICENSE file in the root directory of this source tree.
567 */const sU=ne("Unlock",[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 9.9-1",key:"1mm8w8"}]]);/**
568 * @license lucide-react v0.344.0 - ISC
569 *
570 * This source code is licensed under the ISC license.
571 * See the LICENSE file in the root directory of this source tree.
572 */const v3=ne("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
573 * @license lucide-react v0.344.0 - ISC
574 *
575 * This source code is licensed under the ISC license.
576 * See the LICENSE file in the root directory of this source tree.
577 */const iU=ne("UserCheck",[["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"}],["polyline",{points:"16 11 18 13 22 9",key:"1pwet4"}]]);/**
578 * @license lucide-react v0.344.0 - ISC
579 *
580 * This source code is licensed under the ISC license.
581 * See the LICENSE file in the root directory of this source tree.
582 */const oU=ne("UserX",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["line",{x1:"17",x2:"22",y1:"8",y2:"13",key:"3nzzx3"}],["line",{x1:"22",x2:"17",y1:"8",y2:"13",key:"1swrse"}]]);/**
583 * @license lucide-react v0.344.0 - ISC
584 *
585 * This source code is licensed under the ISC license.
586 * See the LICENSE file in the root directory of this source tree.
587 */const fn=ne("User",[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]]);/**
588 * @license lucide-react v0.344.0 - ISC
589 *
590 * This source code is licensed under the ISC license.
591 * See the LICENSE file in the root directory of this source tree.
592 */const Mt=ne("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"}]]);/**
593 * @license lucide-react v0.344.0 - ISC
594 *
595 * This source code is licensed under the ISC license.
596 * See the LICENSE file in the root directory of this source tree.
597 */const lU=ne("Video",[["path",{d:"m22 8-6 4 6 4V8Z",key:"50v9me"}],["rect",{width:"14",height:"12",x:"2",y:"6",rx:"2",ry:"2",key:"1rqjg6"}]]);/**
598 * @license lucide-react v0.344.0 - ISC
599 *
600 * This source code is licensed under the ISC license.
601 * See the LICENSE file in the root directory of this source tree.
602 */const cU=ne("Volume2",[["polygon",{points:"11 5 6 9 2 9 2 15 6 15 11 19 11 5",key:"16drj5"}],["path",{d:"M15.54 8.46a5 5 0 0 1 0 7.07",key:"ltjumu"}],["path",{d:"M19.07 4.93a10 10 0 0 1 0 14.14",key:"1kegas"}]]);/**
603 * @license lucide-react v0.344.0 - ISC
604 *
605 * This source code is licensed under the ISC license.
606 * See the LICENSE file in the root directory of this source tree.
607 */const Sw=ne("Wifi",[["path",{d:"M12 20h.01",key:"zekei9"}],["path",{d:"M2 8.82a15 15 0 0 1 20 0",key:"dnpr2z"}],["path",{d:"M5 12.859a10 10 0 0 1 14 0",key:"1x1e6c"}],["path",{d:"M8.5 16.429a5 5 0 0 1 7 0",key:"1bycff"}]]);/**
608 * @license lucide-react v0.344.0 - ISC
609 *
610 * This source code is licensed under the ISC license.
611 * See the LICENSE file in the root directory of this source tree.
612 */const Cm=ne("XCircle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]]);/**
613 * @license lucide-react v0.344.0 - ISC
614 *
615 * This source code is licensed under the ISC license.
616 * See the LICENSE file in the root directory of this source tree.
617 */const Ge=ne("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);/**
618 * @license lucide-react v0.344.0 - ISC
619 *
620 * This source code is licensed under the ISC license.
621 * See the LICENSE file in the root directory of this source tree.
622 */const PN=ne("Zap",[["polygon",{points:"13 2 3 14 12 14 11 22 21 10 12 10 13 2",key:"45s27k"}]]);function uU(){const t=()=>{const r=`https://www.google.com/maps/search/?api=1&query=${encodeURIComponent("Cluj-Napoca,B-dul. 21. Decembrie 1989, No.16")}`;window.open(r,"_blank")};return a.jsx("div",{className:"bg-[#194b66] text-white py-2 px-4",children:a.jsxs("div",{className:"container mx-auto flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("a",{href:"https://www.facebook.com/xponentialtransylvania",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(wu,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"Facebook"})]}),a.jsxs("a",{href:"https://www.instagram.com/xponential.office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(ju,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"Instagram"})]}),a.jsxs("a",{href:"https://www.linkedin.com/company/xponential-transylvania-co-working-office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(pl,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"LinkedIn"})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("a",{href:"mailto:[email protected]",className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(Or,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"[email protected]"})]}),a.jsxs("a",{href:"tel:+40744659659",className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(Na,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"+40 744 659 659"})]}),a.jsxs("button",{onClick:t,className:"hover:text-brand-yellow transition-colors flex items-center p-1",children:[a.jsx(Ri,{className:"w-4 h-4"}),a.jsx("span",{className:"hidden md:inline ml-1",children:"Map"})]})]})]})})}function dU(){const t=Ds(),e=r=>t.pathname===r;return a.jsx("nav",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 z-[50]",children:a.jsxs("div",{className:"flex justify-around items-center h-16",children:[a.jsxs(st,{to:"/",className:`flex flex-col items-center ${e("/")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(Ch,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Home"})]}),a.jsxs(st,{to:"/booking",className:`flex flex-col items-center ${e("/booking")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(zV,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Dashboard"})]}),a.jsxs(st,{to:"/spaces",className:`flex flex-col items-center ${e("/spaces")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(xn,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Spaces"})]}),a.jsxs(st,{to:"/meeting-rooms",className:`flex flex-col items-center ${e("/meeting-rooms")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(De,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Rooms"})]}),a.jsxs(st,{to:"/events",className:`flex flex-col items-center ${e("/events")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(Mt,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Events"})]}),a.jsxs(st,{to:"/profile",className:`flex flex-col items-center ${e("/profile")?"text-brand-dark":"text-gray-500"}`,children:[a.jsx(fn,{className:"w-6 h-6"}),a.jsx("span",{className:"text-xs mt-1",children:"Profile"})]})]})})}function hU({onComplete:t}){return P.useEffect(()=>{const e=setTimeout(()=>{t()},500);return()=>clearTimeout(e)},[t]),a.jsx("div",{className:"fixed inset-0 bg-gradient-to-180 from-[#194b66] to-[#3ea2da] z-50 flex items-center justify-center",children:a.jsx("div",{className:"text-center",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"h-16 w-auto mx-auto mb-4 animate-bounce"})})})}var SA={};/**
623 * @license
624 * Copyright 2017 Google LLC
625 *
626 * Licensed under the Apache License, Version 2.0 (the "License");
627 * you may not use this file except in compliance with the License.
628 * You may obtain a copy of the License at
629 *
630 *   http://www.apache.org/licenses/LICENSE-2.0
631 *
632 * Unless required by applicable law or agreed to in writing, software
633 * distributed under the License is distributed on an "AS IS" BASIS,
634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
635 * See the License for the specific language governing permissions and
636 * limitations under the License.
637 */const b3=function(t){const e=[];let r=0;for(let n=0;n<t.length;n++){let s=t.charCodeAt(n);s<128?e[r++]=s:s<2048?(e[r++]=s>>6|192,e[r++]=s&63|128):(s&64512)===55296&&n+1<t.length&&(t.charCodeAt(n+1)&64512)===56320?(s=65536+((s&1023)<<10)+(t.charCodeAt(++n)&1023),e[r++]=s>>18|240,e[r++]=s>>12&63|128,e[r++]=s>>6&63|128,e[r++]=s&63|128):(e[r++]=s>>12|224,e[r++]=s>>6&63|128,e[r++]=s&63|128)}return e},mU=function(t){const e=[];let r=0,n=0;for(;r<t.length;){const s=t[r++];if(s<128)e[n++]=String.fromCharCode(s);else if(s>191&&s<224){const i=t[r++];e[n++]=String.fromCharCode((s&31)<<6|i&63)}else if(s>239&&s<365){const i=t[r++],o=t[r++],l=t[r++],c=((s&7)<<18|(i&63)<<12|(o&63)<<6|l&63)-65536;e[n++]=String.fromCharCode(55296+(c>>10)),e[n++]=String.fromCharCode(56320+(c&1023))}else{const i=t[r++],o=t[r++];e[n++]=String.fromCharCode((s&15)<<12|(i&63)<<6|o&63)}}return e.join("")},w3={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 r=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,n=[];for(let s=0;s<t.length;s+=3){const i=t[s],o=s+1<t.length,l=o?t[s+1]:0,c=s+2<t.length,u=c?t[s+2]:0,d=i>>2,h=(i&3)<<4|l>>4;let m=(l&15)<<2|u>>6,p=u&63;c||(p=64,o||(m=64)),n.push(r[d],r[h],r[m],r[p])}return n.join("")},encodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(t):this.encodeByteArray(b3(t),e)},decodeString(t,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(t):mU(this.decodeStringToByteArray(t,e))},decodeStringToByteArray(t,e){this.init_();const r=e?this.charToByteMapWebSafe_:this.charToByteMap_,n=[];for(let s=0;s<t.length;){const i=r[t.charAt(s++)],l=s<t.length?r[t.charAt(s)]:0;++s;const u=s<t.length?r[t.charAt(s)]:64;++s;const h=s<t.length?r[t.charAt(s)]:64;if(++s,i==null||l==null||u==null||h==null)throw new fU;const m=i<<2|l>>4;if(n.push(m),u!==64){const p=l<<4&240|u>>2;if(n.push(p),h!==64){const x=u<<6&192|h;n.push(x)}}}return n},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let t=0;t<this.ENCODED_VALS.length;t++)this.byteToCharMap_[t]=this.ENCODED_VALS.charAt(t),this.charToByteMap_[this.byteToCharMap_[t]]=t,this.byteToCharMapWebSafe_[t]=this.ENCODED_VALS_WEBSAFE.charAt(t),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[t]]=t,t>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(t)]=t,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(t)]=t)}}};class fU extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const pU=function(t){const e=b3(t);return w3.encodeByteArray(e,!0)},gg=function(t){return pU(t).replace(/\./g,"")},j3=function(t){try{return w3.decodeString(t,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
638 * @license
639 * Copyright 2022 Google LLC
640 *
641 * Licensed under the Apache License, Version 2.0 (the "License");
642 * you may not use this file except in compliance with the License.
643 * You may obtain a copy of the License at
644 *
645 *   http://www.apache.org/licenses/LICENSE-2.0
646 *
647 * Unless required by applicable law or agreed to in writing, software
648 * distributed under the License is distributed on an "AS IS" BASIS,
649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
650 * See the License for the specific language governing permissions and
651 * limitations under the License.
652 */function gU(){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.")}/**
653 * @license
654 * Copyright 2022 Google LLC
655 *
656 * Licensed under the Apache License, Version 2.0 (the "License");
657 * you may not use this file except in compliance with the License.
658 * You may obtain a copy of the License at
659 *
660 *   http://www.apache.org/licenses/LICENSE-2.0
661 *
662 * Unless required by applicable law or agreed to in writing, software
663 * distributed under the License is distributed on an "AS IS" BASIS,
664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
665 * See the License for the specific language governing permissions and
666 * limitations under the License.
667 */const xU=()=>gU().__FIREBASE_DEFAULTS__,yU=()=>{if(typeof process>"u"||typeof SA>"u")return;const t=SA.__FIREBASE_DEFAULTS__;if(t)return JSON.parse(t)},vU=()=>{if(typeof document>"u")return;let t;try{t=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=t&&j3(t[1]);return e&&JSON.parse(e)},cy=()=>{try{return xU()||yU()||vU()}catch(t){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${t}`);return}},N3=t=>{var e,r;return(r=(e=cy())===null||e===void 0?void 0:e.emulatorHosts)===null||r===void 0?void 0:r[t]},_3=t=>{const e=N3(t);if(!e)return;const r=e.lastIndexOf(":");if(r<=0||r+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const n=parseInt(e.substring(r+1),10);return e[0]==="["?[e.substring(1,r-1),n]:[e.substring(0,r),n]},S3=()=>{var t;return(t=cy())===null||t===void 0?void 0:t.config},T3=t=>{var e;return(e=cy())===null||e===void 0?void 0:e[`_${t}`]};/**
668 * @license
669 * Copyright 2017 Google LLC
670 *
671 * Licensed under the Apache License, Version 2.0 (the "License");
672 * you may not use this file except in compliance with the License.
673 * You may obtain a copy of the License at
674 *
675 *   http://www.apache.org/licenses/LICENSE-2.0
676 *
677 * Unless required by applicable law or agreed to in writing, software
678 * distributed under the License is distributed on an "AS IS" BASIS,
679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
680 * See the License for the specific language governing permissions and
681 * limitations under the License.
682 */class bU{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}wrapCallback(e){return(r,n)=>{r?this.reject(r):this.resolve(n),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(r):e(r,n))}}}/**
683 * @license
684 * Copyright 2021 Google LLC
685 *
686 * Licensed under the Apache License, Version 2.0 (the "License");
687 * you may not use this file except in compliance with the License.
688 * You may obtain a copy of the License at
689 *
690 *   http://www.apache.org/licenses/LICENSE-2.0
691 *
692 * Unless required by applicable law or agreed to in writing, software
693 * distributed under the License is distributed on an "AS IS" BASIS,
694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
695 * See the License for the specific language governing permissions and
696 * limitations under the License.
697 */function A3(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 r={alg:"none",type:"JWT"},n=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/${n}`,aud:n,iat:s,exp:s+3600,auth_time:s,sub:i,user_id:i,firebase:{sign_in_provider:"custom",identities:{}}},t);return[gg(JSON.stringify(r)),gg(JSON.stringify(o)),""].join(".")}/**
698 * @license
699 * Copyright 2017 Google LLC
700 *
701 * Licensed under the Apache License, Version 2.0 (the "License");
702 * you may not use this file except in compliance with the License.
703 * You may obtain a copy of the License at
704 *
705 *   http://www.apache.org/licenses/LICENSE-2.0
706 *
707 * Unless required by applicable law or agreed to in writing, software
708 * distributed under the License is distributed on an "AS IS" BASIS,
709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
710 * See the License for the specific language governing permissions and
711 * limitations under the License.
712 */function Kr(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function wU(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Kr())}function jU(){var t;const e=(t=cy())===null||t===void 0?void 0:t.forceEnvironment;if(e==="node")return!0;
712if(e==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function NU(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function E3(){const t=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof t=="object"&&t.id!==void 0}function _U(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function SU(){const t=Kr();return t.indexOf("MSIE ")>=0||t.indexOf("Trident/")>=0}function TU(){return!jU()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function k3(){try{return typeof indexedDB=="object"}catch{return!1}}function P3(){return new Promise((t,e)=>{try{let r=!0;const n="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(n);s.onsuccess=()=>{s.result.close(),r||self.indexedDB.deleteDatabase(n),t(!0)},s.onupgradeneeded=()=>{r=!1},s.onerror=()=>{var i;e(((i=s.error)===null||i===void 0?void 0:i.message)||"")}}catch(r){e(r)}})}function AU(){return!(typeof navigator>"u"||!navigator.cookieEnabled)}/**
713 * @license
714 * Copyright 2017 Google LLC
715 *
716 * Licensed under the Apache License, Version 2.0 (the "License");
717 * you may not use this file except in compliance with the License.
718 * You may obtain a copy of the License at
719 *
720 *   http://www.apache.org/licenses/LICENSE-2.0
721 *
722 * Unless required by applicable law or agreed to in writing, software
723 * distributed under the License is distributed on an "AS IS" BASIS,
724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
725 * See the License for the specific language governing permissions and
726 * limitations under the License.
727 */const EU="FirebaseError";class Zn extends Error{constructor(e,r,n){super(r),this.code=e,this.customData=n,this.name=EU,Object.setPrototypeOf(this,Zn.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,gl.prototype.create)}}class gl{constructor(e,r,n){this.service=e,this.serviceName=r,this.errors=n}create(e,...r){const n=r[0]||{},s=`${this.service}/${e}`,i=this.errors[e],o=i?kU(i,n):"Error",l=`${this.serviceName}: ${o} (${s}).`;return new Zn(s,l,n)}}function kU(t,e){return t.replace(PU,(r,n)=>{const s=e[n];return s!=null?String(s):`<${n}?>`})}const PU=/\{\$([^}]+)}/g;function CU(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}function Go(t,e){if(t===e)return!0;const r=Object.keys(t),n=Object.keys(e);for(const s of r){if(!n.includes(s))return!1;const i=t[s],o=e[s];if(TA(i)&&TA(o)){if(!Go(i,o))return!1}else if(i!==o)return!1}for(const s of n)if(!r.includes(s))return!1;return!0}function TA(t){return t!==null&&typeof t=="object"}/**
728 * @license
729 * Copyright 2017 Google LLC
730 *
731 * Licensed under the Apache License, Version 2.0 (the "License");
732 * you may not use this file except in compliance with the License.
733 * You may obtain a copy of the License at
734 *
735 *   http://www.apache.org/licenses/LICENSE-2.0
736 *
737 * Unless required by applicable law or agreed to in writing, software
738 * distributed under the License is distributed on an "AS IS" BASIS,
739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
740 * See the License for the specific language governing permissions and
741 * limitations under the License.
742 */function Im(t){const e=[];for(const[r,n]of Object.entries(t))Array.isArray(n)?n.forEach(s=>{e.push(encodeURIComponent(r)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(r)+"="+encodeURIComponent(n));return e.length?"&"+e.join("&"):""}function Rd(t){const e={};return t.replace(/^\?/,"").split("&").forEach(n=>{if(n){const[s,i]=n.split("=");e[decodeURIComponent(s)]=decodeURIComponent(i)}}),e}function Dd(t){const e=t.indexOf("?");if(!e)return"";const r=t.indexOf("#",e);return t.substring(e,r>0?r:void 0)}function IU(t,e){const r=new OU(t,e);return r.subscribe.bind(r)}class OU{constructor(e,r){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=r,this.task.then(()=>{e(this)}).catch(n=>{this.error(n)})}next(e){this.forEachObserver(r=>{r.next(e)})}error(e){this.forEachObserver(r=>{r.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,r,n){let s;if(e===void 0&&r===void 0&&n===void 0)throw new Error("Missing Observer.");RU(e,["next","error","complete"])?s=e:s={next:e,error:r,complete:n},s.next===void 0&&(s.next=w0),s.error===void 0&&(s.error=w0),s.complete===void 0&&(s.complete=w0);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 r=0;r<this.observers.length;r++)this.sendOne(r,e)}sendOne(e,r){this.task.then(()=>
742{if(this.observers!==void 0&&this.observers[e]!==void 0)try{r(this.observers[e])}catch(n){typeof console<"u"&&console.error&&console.error(n)}})}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 RU(t,e){if(typeof t!="object"||t===null)return!1;for(const r of e)if(r in t&&typeof t[r]=="function")return!0;return!1}function w0(){}/**
743 * @license
744 * Copyright 2019 Google LLC
745 *
746 * Licensed under the Apache License, Version 2.0 (the "License");
747 * you may not use this file except in compliance with the License.
748 * You may obtain a copy of the License at
749 *
750 *   http://www.apache.org/licenses/LICENSE-2.0
751 *
752 * Unless required by applicable law or agreed to in writing, software
753 * distributed under the License is distributed on an "AS IS" BASIS,
754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
755 * See the License for the specific language governing permissions and
756 * limitations under the License.
757 */const DU=1e3,MU=2,$U=4*60*60*1e3,LU=.5;function AA(t,e=DU,r=MU){const n=e*Math.pow(r,t),s=Math.round(LU*n*(Math.random()-.5)*2);return Math.min($U,n+s)}/**
758 * @license
759 * Copyright 2021 Google LLC
760 *
761 * Licensed under the Apache License, Version 2.0 (the "License");
762 * you may not use this file except in compliance with the License.
763 * You may obtain a copy of the License at
764 *
765 *   http://www.apache.org/licenses/LICENSE-2.0
766 *
767 * Unless required by applicable law or agreed to in writing, software
768 * distributed under the License is distributed on an "AS IS" BASIS,
769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
770 * See the License for the specific language governing permissions and
771 * limitations under the License.
772 */function ot(t){return t&&t._delegate?t._delegate:t}class Qn{constructor(e,r,n){this.name=e,this.instanceFactory=r,this.type=n,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}}/**
773 * @license
774 * Copyright 2019 Google LLC
775 *
776 * Licensed under the Apache License, Version 2.0 (the "License");
777 * you may not use this file except in compliance with the License.
778 * You may obtain a copy of the License at
779 *
780 *   http://www.apache.org/licenses/LICENSE-2.0
781 *
782 * Unless required by applicable law or agreed to in writing, software
783 * distributed under the License is distributed on an "AS IS" BASIS,
784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
785 * See the License for the specific language governing permissions and
786 * limitations under the License.
787 */const co="[DEFAULT]";/**
788 * @license
789 * Copyright 2019 Google LLC
790 *
791 * Licensed under the Apache License, Version 2.0 (the "License");
792 * you may not use this file except in compliance with the License.
793 * You may obtain a copy of the License at
794 *
795 *   http://www.apache.org/licenses/LICENSE-2.0
796 *
797 * Unless required by applicable law or agreed to in writing, software
798 * distributed under the License is distributed on an "AS IS" BASIS,
799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
800 * See the License for the specific language governing permissions and
801 * limitations under the License.
802 */class FU{constructor(e,r){this.name=e,this.container=r,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const r=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(r)){const n=new bU;if(this.instancesDeferred.set(r,n),this.isInitialized(r)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:r});s&&n.resolve(s)}catch{}}return this.instancesDeferred.get(r).promise}getImmediate(e){var r;const n=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),s=(r=e==null?void 0:e.optional)!==null&&r!==void 0?r:!1;if(this.isInitialized(n)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:n})}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(VU(e))try{this.getOrInitializeService({instanceIdentifier:co})}catch{}for(const[r,n]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(r);try{const i=this.getOrInitializeService({instanceIdentifier:s});n.resolve(i)}catch{}}}}clearInstance(e=co){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(r=>"INTERNAL"in r).map(r=>r.INTERNAL.delete()),...e.filter(r=>"_delete"in r).map(r=>r._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=co){return this.instances.has(e)}getOptions(e=co){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:r={}}=e,n=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(n))throw Error(`${this.name}(${n}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:n,options:r});for(const[i,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(i);n===l&&o.resolve(s)}return s}onInit(e,r){var n;const s=this.normalizeInstanceIdentifier(r),i=(n=this.onInitCallbacks.get(s))!==null&&n!==void 0?n: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,r){const n=this.onInitCallbacks.get(r);if(n)for(const s of n)try{s(e,r)}catch{}}getOrInitializeService({instanceIdentifier:e,options:r={}}){let n=this.instances.get(e);if(!n&&this.component&&(n=this.component.instanceFactory(this.container,{instanceIdentifier:BU(e),options:r}),this.instances.set(e,n),this.instancesOptions.set(e,r),this.invokeOnInitCallbacks(n,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,n)}catch{}return n||null}normalizeInstanceIdentifier(e=co){return this.component?this.component.multipleInstances?e:co:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function BU(t){return t===co?void 0:t}function VU(t){return t.instantiationMode==="EAGER"}/**
803 * @license
804 * Copyright 2019 Google LLC
805 *
806 * Licensed under the Apache License, Version 2.0 (the "License");
807 * you may not use this file except in compliance with the License.
808 * You may obtain a copy of the License at
809 *
810 *   http://www.apache.org/licenses/LICENSE-2.0
811 *
812 * Unless required by applicable law or agreed to in writing, software
813 * distributed under the License is distributed on an "AS IS" BASIS,
814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
815 * See the License for the specific language governing permissions and
816 * limitations under the License.
817 */class UU{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const r=this.getProvider(e.name);if(r.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);r.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 r=new FU(e,this);return this.providers.set(e,r),r}getProviders(){return Array.from(this.providers.values())}}/**
818 * @license
819 * Copyright 2017 Google LLC
820 *
821 * Licensed under the Apache License, Version 2.0 (the "License");
822 * you may not use this file except in compliance with the License.
823 * You may obtain a copy of the License at
824 *
825 *   http://www.apache.org/licenses/LICENSE-2.0
826 *
827 * Unless required by applicable law or agreed to in writing, software
828 * distributed under the License is distributed on an "AS IS" BASIS,
829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
830 * See the License for the specific language governing permissions and
831 * limitations under the License.
832 */var Ke;(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"})(Ke||(Ke={}));const zU={debug:Ke.DEBUG,verbose:Ke.VERBOSE,info:Ke.INFO,warn:Ke.WARN,error:Ke.ERROR,silent:Ke.SILENT},HU=Ke.INFO,qU={[Ke.DEBUG]:"log",[Ke.VERBOSE]:"log",[Ke.INFO]:"info",[Ke.WARN]:"warn",[Ke.ERROR]:"error"},WU=(t,e,...r)=>{if(e<t.logLevel)return;const n=new Date().toISOString(),s=qU[e];if(s)console[s](`[${n}]  ${t.name}:`,...r);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};class uy{constructor(e){this.name=e,this._logLevel=HU,this._logHandler=WU,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in Ke))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?zU[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,Ke.DEBUG,...e),this._logHandler(this,Ke.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,Ke.VERBOSE,...e),this._logHandler(this,Ke.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,Ke.INFO,...e),this._logHandler(this,Ke.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,Ke.WARN,...e),this._logHandler(this,Ke.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,Ke.ERROR,...e),this._logHandler(this,Ke.ERROR,...e)}}const GU=(t,e)=>e.some(r=>t instanceof r);let EA,kA;function KU(){return EA||(EA=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function XU(){return kA||(kA=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const C3=new WeakMap,Tw=new WeakMap,I3=new WeakMap,j0=new WeakMap,CN=new WeakMap;function YU(t){const e=new Promise((r,n)=>{const s=()=>{t.removeEventListener("success",i),t.removeEventListener("error",o)},i=()=>{r(Ai(t.result)),s()},o=()=>{n(t.error),s()};t.addEventListener("success",i),t.addEventListener("error",o)});return e.then(r=>{r instanceof IDBCursor&&C3.set(r,t)}).catch(()=>{}),CN.set(e,t),e}function QU(t){if(Tw.has(t))return;const e=new Promise((r,n)=>{const s=()=>{t.removeEventListener("complete",i),t.removeEventListener("error",o),t.removeEventListener("abort",o)},i=()=>{r(),s()},o=()=>{n(t.error||new DOMException("AbortError","AbortError")),s()};t.addEventListener("complete",i),t.addEventListener("error",o),t.addEventListener("abort",o)});Tw.set(t,e)}let Aw={get(t,e,r){if(t instanceof IDBTransaction){if(e==="done")return Tw.get(t);if(e==="objectStoreNames")return t.objectStoreNames||I3.get(t);if(e==="store")return r.objectStoreNames[1]?void 0:r.objectStore(r.objectStoreNames[0])}return Ai(t[e])},set(t,e,r){return t[e]=r,!0},has(t,e){return t instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in t}};function JU(t){Aw=t(Aw)}function ZU(t){return t===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...r){const n=t.call(N0(this),e,...r);return I3.set(n,e.sort?e.sort():[e]),Ai(n)}:XU().includes(t)?function(...e){return t.apply(N0(this),e),Ai(C3.get(this))}:function(...e){return Ai(t.apply(N0(this),e))}}function ez(t){return typeof t=="function"?ZU(t):(t instanceof IDBTransaction&&QU(t),GU(t,KU())?new Proxy(t,Aw):t)}function Ai(t){if(t instanceof IDBRequest)return YU(t);if(j0.has(t))return j0.get(t);const e=ez(t);return e!==t&&(j0.set(t,e),CN.set(e,t)),e}const N0=t=>CN.get(t);function O3(t,e,{blocked:r,upgrade:n,blocking:s,terminated:i}={}){const o=indexedDB.open(t,e),l=Ai(o);return n&&o.addEventListener("upgradeneeded",c=>{n(Ai(o.result),c.oldVersion,c.newVersion,Ai(o.transaction),c)}),r&&o.addEventListener("blocked",c=>r(c.oldVersion,c.newVersion,c)),l.then(c=>{i&&c.addEventListener("close",()=>i()),s&&c.addEventListener("versionchange",u=>s(u.oldVersion,u.newVersion,u))}).catch(()=>{}),l}const tz=["get","getKey","getAll","getAllKeys","count"],rz=["put","add","delete","clear"],_0=new Map;function PA(t,e){if(!(t instanceof IDBDatabase&&!(e in t)&&typeof e=="string"))return;if(_0.get(e))return _0.get(e);const r=e.replace(/FromIndex$/,""),n=e!==r,s=rz.includes(r);if(!(r in(n?IDBIndex:IDBObjectStore).prototype)||!(s||tz.includes(r)))return;const i=async function(o,...l){const c=this.transaction(o,s?"readwrite":"readonly");let u=c.store;
832return n&&(u=u.index(l.shift())),(await Promise.all([u[r](...l),s&&c.done]))[0]};return _0.set(e,i),i}JU(t=>({...t,get:(e,r,n)=>PA(e,r)||t.get(e,r,n),has:(e,r)=>!!PA(e,r)||t.has(e,r)}));/**
833 * @license
834 * Copyright 2019 Google LLC
835 *
836 * Licensed under the Apache License, Version 2.0 (the "License");
837 * you may not use this file except in compliance with the License.
838 * You may obtain a copy of the License at
839 *
840 *   http://www.apache.org/licenses/LICENSE-2.0
841 *
842 * Unless required by applicable law or agreed to in writing, software
843 * distributed under the License is distributed on an "AS IS" BASIS,
844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
845 * See the License for the specific language governing permissions and
846 * limitations under the License.
847 */class nz{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(r=>{if(az(r)){const n=r.getImmediate();return`${n.library}/${n.version}`}else return null}).filter(r=>r).join(" ")}}function az(t){const e=t.getComponent();return(e==null?void 0:e.type)==="VERSION"}const Ew="@firebase/app",CA="0.10.13";/**
848 * @license
849 * Copyright 2019 Google LLC
850 *
851 * Licensed under the Apache License, Version 2.0 (the "License");
852 * you may not use this file except in compliance with the License.
853 * You may obtain a copy of the License at
854 *
855 *   http://www.apache.org/licenses/LICENSE-2.0
856 *
857 * Unless required by applicable law or agreed to in writing, software
858 * distributed under the License is distributed on an "AS IS" BASIS,
859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
860 * See the License for the specific language governing permissions and
861 * limitations under the License.
862 */const Ts=new uy("@firebase/app"),sz="@firebase/app-compat",iz="@firebase/analytics-compat",oz="@firebase/analytics",lz="@firebase/app-check-compat",cz="@firebase/app-check",uz="@firebase/auth",dz="@firebase/auth-compat",hz="@firebase/database",mz="@firebase/data-connect",fz="@firebase/database-compat",pz="@firebase/functions",gz="@firebase/functions-compat",xz="@firebase/installations",yz="@firebase/installations-compat",vz="@firebase/messaging",bz="@firebase/messaging-compat",wz="@firebase/performance",jz="@firebase/performance-compat",Nz="@firebase/remote-config",_z="@firebase/remote-config-compat",Sz="@firebase/storage",Tz="@firebase/storage-compat",Az="@firebase/firestore",Ez="@firebase/vertexai-preview",kz="@firebase/firestore-compat",Pz="firebase",Cz="10.14.1";/**
863 * @license
864 * Copyright 2019 Google LLC
865 *
866 * Licensed under the Apache License, Version 2.0 (the "License");
867 * you may not use this file except in compliance with the License.
868 * You may obtain a copy of the License at
869 *
870 *   http://www.apache.org/licenses/LICENSE-2.0
871 *
872 * Unless required by applicable law or agreed to in writing, software
873 * distributed under the License is distributed on an "AS IS" BASIS,
874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
875 * See the License for the specific language governing permissions and
876 * limitations under the License.
877 */const kw="[DEFAULT]",Iz={[Ew]:"fire-core",[sz]:"fire-core-compat",[oz]:"fire-analytics",[iz]:"fire-analytics-compat",[cz]:"fire-app-check",[lz]:"fire-app-check-compat",[uz]:"fire-auth",[dz]:"fire-auth-compat",[hz]:"fire-rtdb",[mz]:"fire-data-connect",[fz]:"fire-rtdb-compat",[pz]:"fire-fn",[gz]:"fire-fn-compat",[xz]:"fire-iid",[yz]:"fire-iid-compat",[vz]:"fire-fcm",[bz]:"fire-fcm-compat",[wz]:"fire-perf",[jz]:"fire-perf-compat",[Nz]:"fire-rc",[_z]:"fire-rc-compat",[Sz]:"fire-gcs",[Tz]:"fire-gcs-compat",[Az]:"fire-fst",[kz]:"fire-fst-compat",[Ez]:"fire-vertex","fire-js":"fire-js",[Pz]:"fire-js-all"};/**
878 * @license
879 * Copyright 2019 Google LLC
880 *
881 * Licensed under the Apache License, Version 2.0 (the "License");
882 * you may not use this file except in compliance with the License.
883 * You may obtain a copy of the License at
884 *
885 *   http://www.apache.org/licenses/LICENSE-2.0
886 *
887 * Unless required by applicable law or agreed to in writing, software
888 * distributed under the License is distributed on an "AS IS" BASIS,
889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
890 * See the License for the specific language governing permissions and
891 * limitations under the License.
892 */const xg=new Map,Oz=new Map,Pw=new Map;function IA(t,e){try{t.container.addComponent(e)}catch(r){Ts.debug(`Component ${e.name} failed to register with FirebaseApp ${t.name}`,r)}}function xa(t){const e=t.name;if(Pw.has(e))return Ts.debug(`There were multiple attempts to register component ${e}.`),!1;Pw.set(e,t);for(const r of xg.values())IA(r,t);for(const r of Oz.values())IA(r,t);return!0}function zi(t,e){const r=t.container.getProvider("heartbeat").getImmediate({optional:!0});return r&&r.triggerHeartbeat(),t.container.getProvider(e)}function Ca(t){return t.settings!==void 0}/**
893 * @license
894 * Copyright 2019 Google LLC
895 *
896 * Licensed under the Apache License, Version 2.0 (the "License");
897 * you may not use this file except in compliance with the License.
898 * You may obtain a copy of the License at
899 *
900 *   http://www.apache.org/licenses/LICENSE-2.0
901 *
902 * Unless required by applicable law or agreed to in writing, software
903 * distributed under the License is distributed on an "AS IS" BASIS,
904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
905 * See the License for the specific language governing permissions and
906 * limitations under the License.
907 */const Rz={"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.","invali
907d-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."},Ei=new gl("app","Firebase",Rz);/**
908 * @license
909 * Copyright 2019 Google LLC
910 *
911 * Licensed under the Apache License, Version 2.0 (the "License");
912 * you may not use this file except in compliance with the License.
913 * You may obtain a copy of the License at
914 *
915 *   http://www.apache.org/licenses/LICENSE-2.0
916 *
917 * Unless required by applicable law or agreed to in writing, software
918 * distributed under the License is distributed on an "AS IS" BASIS,
919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
920 * See the License for the specific language governing permissions and
921 * limitations under the License.
922 */class Dz{constructor(e,r,n){this._isDeleted=!1,this._options=Object.assign({},e),this._config=Object.assign({},r),this._name=r.name,this._automaticDataCollectionEnabled=r.automaticDataCollectionEnabled,this._container=n,this.container.addComponent(new Qn("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 Ei.create("app-deleted",{appName:this._name})}}/**
923 * @license
924 * Copyright 2019 Google LLC
925 *
926 * Licensed under the Apache License, Version 2.0 (the "License");
927 * you may not use this file except in compliance with the License.
928 * You may obtain a copy of the License at
929 *
930 *   http://www.apache.org/licenses/LICENSE-2.0
931 *
932 * Unless required by applicable law or agreed to in writing, software
933 * distributed under the License is distributed on an "AS IS" BASIS,
934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
935 * See the License for the specific language governing permissions and
936 * limitations under the License.
937 */const xl=Cz;function R3(t,e={}){let r=t;typeof e!="object"&&(e={name:e});const n=Object.assign({name:kw,automaticDataCollectionEnabled:!1},e),s=n.name;if(typeof s!="string"||!s)throw Ei.create("bad-app-name",{appName:String(s)});if(r||(r=S3()),!r)throw Ei.create("no-options");const i=xg.get(s);if(i){if(Go(r,i.options)&&Go(n,i.config))return i;throw Ei.create("duplicate-app",{appName:s})}const o=new UU(s);for(const c of Pw.values())o.addComponent(c);const l=new Dz(r,n,o);return xg.set(s,l),l}function dy(t=kw){const e=xg.get(t);if(!e&&t===kw&&S3())return R3();if(!e)throw Ei.create("no-app",{appName:t});return e}function pn(t,e,r){var n;let s=(n=Iz[t])!==null&&n!==void 0?n:t;r&&(s+=`-${r}`);const i=s.match(/\s|\//),o=e.match(/\s|\//);if(i||o){const l=[`Unable to register library "${s}" with version "${e}":`];i&&l.push(`library name "${s}" contains illegal characters (whitespace or "/")`),i&&o&&l.push("and"),o&&l.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Ts.warn(l.join(" "));return}xa(new Qn(`${s}-version`,()=>({library:s,version:e}),"VERSION"))}/**
938 * @license
939 * Copyright 2021 Google LLC
940 *
941 * Licensed under the Apache License, Version 2.0 (the "License");
942 * you may not use this file except in compliance with the License.
943 * You may obtain a copy of the License at
944 *
945 *   http://www.apache.org/licenses/LICENSE-2.0
946 *
947 * Unless required by applicable law or agreed to in writing, softw
947are
948 * distributed under the License is distributed on an "AS IS" BASIS,
949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
950 * See the License for the specific language governing permissions and
951 * limitations under the License.
952 */const Mz="firebase-heartbeat-database",$z=1,Oh="firebase-heartbeat-store";let S0=null;function D3(){return S0||(S0=O3(Mz,$z,{upgrade:(t,e)=>{switch(e){case 0:try{t.createObjectStore(Oh)}catch(r){console.warn(r)}}}}).catch(t=>{throw Ei.create("idb-open",{originalErrorMessage:t.message})})),S0}async function Lz(t){try{const r=(await D3()).transaction(Oh),n=await r.objectStore(Oh).get(M3(t));return await r.done,n}catch(e){if(e instanceof Zn)Ts.warn(e.message);else{const r=Ei.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Ts.warn(r.message)}}}async function OA(t,e){try{const n=(await D3()).transaction(Oh,"readwrite");await n.objectStore(Oh).put(e,M3(t)),await n.done}catch(r){if(r instanceof Zn)Ts.warn(r.message);else{const n=Ei.create("idb-set",{originalErrorMessage:r==null?void 0:r.message});Ts.warn(n.message)}}}function M3(t){return`${t.name}!${t.options.appId}`}/**
953 * @license
954 * Copyright 2021 Google LLC
955 *
956 * Licensed under the Apache License, Version 2.0 (the "License");
957 * you may not use this file except in compliance with the License.
958 * You may obtain a copy of the License at
959 *
960 *   http://www.apache.org/licenses/LICENSE-2.0
961 *
962 * Unless required by applicable law or agreed to in writing, software
963 * distributed under the License is distributed on an "AS IS" BASIS,
964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
965 * See the License for the specific language governing permissions and
966 * limitations under the License.
967 */const Fz=1024,Bz=30*24*60*60*1e3;class Vz{constructor(e){this.container=e,this._heartbeatsCache=null;const r=this.container.getProvider("app").getImmediate();this._storage=new zz(r),this._heartbeatsCachePromise=this._storage.read().then(n=>(this._heartbeatsCache=n,n))}async triggerHeartbeat(){var e,r;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),i=RA();return((e=this._heartbeatsCache)===null||e===void 0?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===i||this._heartbeatsCache.heartbeats.some(o=>o.date===i)?void 0:(this._heartbeatsCache.heartbeats.push({date:i,agent:s}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(o=>{const l=new Date(o.date).valueOf();return Date.now()-l<=Bz}),this._storage.overwrite(this._heartbeatsCache))}catch(n){Ts.warn(n)}}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 r=RA(),{heartbeatsToSend:n,unsentEntries:s}=Uz(this._heartbeatsCache.heartbeats),i=gg(JSON.stringify({version:2,heartbeats:n}));return this._heartbeatsCache.lastSentHeartbeatDate=r,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),i}catch(r){return Ts.warn(r),""}}}function RA(){return new Date().toISOString().substring(0,10)}function Uz(t,e=Fz){const r=[];let n=t.slice();for(const s of t){const i=r.find(o=>o.agent===s.agent);if(i){if(i.dates.push(s.date),DA(r)>e){i.dates.pop();break}}else if(r.push({agent:s.agent,dates:[s.date]}),DA(r)>e){r.pop();break}n=n.slice(1)}return{heartbeatsToSend:r,unsentEntries:n}}class zz{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return k3()?P3().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const r=await Lz(this.app);return r!=null&&r.heartbeats?r:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){var r;if(await this._canUseIndexedDBPromise){const s=await this.read();return OA(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:s.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){var r;if(await this._canUseIndexedDBPromise){const s=await this.read();return OA(this.app,{lastSentHeartbeatDate:(r=e.lastSentHeartbeatDate)!==null&&r!==void 0?r:s.lastSentHeartbeatDate,heartbeats:[...s.heartbeats,...e.heartbeats]})}else return}}function DA(t){return gg(JSON.stringify({version:2,heartbeats:t})).length}/**
968 * @license
969 * Copyright 2019 Google LLC
970 *
971 * Licensed under the Apache License, Version 2.0 (the "License");
972 * you may not use this file except in compliance with the License.
973 * You may obtain a copy of the License at
974 *
975 *   http://www.apache.org/licenses/LICENSE-2.0
976 *
977 * Unless required by applicable law or agreed to in writing, software
978 * distributed under the License is distributed on an "AS IS" BASIS,
979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
980 * See the License for the specific language governing permissions and
981 * limitations under the License.
982 */function Hz(t){xa(new Qn("platform-logger",e=>new nz(e),"PRIVATE")),xa(new Qn("heartbeat",e=>new Vz(e),"PRIVATE")),pn(Ew,CA,t),pn(Ew,CA,"esm2017"),pn("fire-js","")}Hz("");function IN(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,n=Object.getOwnPropertySymbols(t);s<n.length;s++)e.indexOf(n[s])<0&&Object.prototype.propertyIsEnumerable.call(t,n[s])&&(r[n[s]]=t[n[s]]);return r}function $3(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const qz=$3,L3=new gl("auth","Firebase",$3());/**
983 * @license
984 * Copyright 2020 Google LLC
985 *
986 * Licensed under the Apache License, Version 2.0 (the "License");
987 * you may not use this file except in compliance with the License.
988 * You may obtain a copy of the License at
989 *
990 *   http://www.apache.org/licenses/LICENSE-2.0
991 *
992 * Unless required by applicable law or agreed to in writing, software
993 * distributed under the License is distributed on an "AS IS" BASIS,
994 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
995 * See the License for the specific language governing permissions and
996 * limitations under the License.
997 */const yg=new uy("@firebase/auth");function Wz(t,...e){yg.logLevel<=Ke.WARN&&yg.warn(`Auth (${xl}): ${t}`,...e)}function kp(t,...e){yg.logLevel<=Ke.ERROR&&yg.error(`Auth (${xl}): ${t}`,...e)}/**
998 * @license
999 * Copyright 2020 Google LLC
1000 *
1001 * Licensed under the Apache License, Version 2.0 (the "License");
1002 * you may not use this file except in compliance with the License.
1003 * You may obtain a copy of the License at
1004 *
1005 *   http://www.apache.org/licenses/LICENSE-2.0
1006 *
1007 * Unless required by applicable law or agreed to in writing, software
1008 * distributed under the License is distributed on an "AS IS" BASIS,
1009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1010 * See the License for the specific language governing permissions and
1011 * limitations under the License.
1012 */function ya(t,...e){throw ON(t,...e)}function $a(t,...e){return ON(t,...e)}function F3(t,e,r){const n=Object.assign(Object.assign({},qz()),{[e]:r});return new gl("auth","Firebase",n).create(e,{appName:t.name})}function ys(t){return F3(t,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function ON(t,...e){if(typeof t!="string"){const r=e[0],n=[...e.slice(1)];return n[0]&&(n[0].appName=t.name),t._errorFactory.create(r,...n)}return L3.create(t,...e)}function ke(t,e,...r){if(!t)throw ON(e,...r)}function cs(t){const e="INTERNAL ASSERTION FAILED: "+t;throw kp(e),new Error(e)}function As(t,e){t||cs(e)}/**
1013 * @license
1014 * Copyright 2020 Google LLC
1015 *
1016 * Licensed under the Apache License, Version 2.0 (the "License");
1017 * you may not use this file except in compliance with the License.
1018 * You may obtain a copy of the License at
1019 *
1020 *   http://www.apache.org/licenses/LICENSE-2.0
1021 *
1022 * Unless required by applicable law or agreed to in writing, software
1023 * distributed under the License is distributed on an "AS IS" BASIS,
1024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1025 * See the License for the specific language governing permissions and
1026 * limitations under the License.
1027 */function Cw(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.href)||""}function Gz(){return MA()==="http:"||MA()==="https:"}function MA(){var t;return typeof self<"u"&&((t=self.location)===null||t===void 0?void 0:t.protocol)||null}/**
1028 * @license
1029 * Copyright 2020 Google LLC
1030 *
1031 * Licensed under the Apache License, Version 2.0 (the "License");
1032 * you may not use this file except in compliance with the License.
1033 * You may obtain a copy of the License at
1034 *
1035 *   http://www.apache.org/licenses/LICENSE-2.0
1036 *
1037 * Unless required by applicable law or agreed to in writing, software
1038 * distributed under the License is distributed on an "AS IS" BASIS,
1039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1040 * See the License for the specific language governing permissions and
1041 * limitations under the License.
1042 */function Kz(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(Gz()||E3()||"connection"in navigator)?navigator.onLine:!0}function Xz(){if(typeof navigator>"u")return null;const t=navigator;return t.languages&&t.languages[0]||t.language||null}/**
1043 * @license
1044 * Copyright 2020 Google LLC
1045 *
1046 * Licensed under the Apache License, Version 2.0 (the "License");
1047 * you may not use this file except in compliance with the License.
1048 * You may obtain a copy of the License at
1049 *
1050 *   http://www.apache.org/licenses/LICENSE-2.0
1051 *
1052 * Unless required by applicable law or agreed to in writing, software
1053 * distributed under the License is distributed on an "AS IS" BASIS,
1054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1055 * See the License for the specific language governing permissions and
1056 * limitations under the License.
1057 */class Om{constructor(e,r){this.shortDelay=e,this.longDelay=r,As(r>e,"Short delay should be less than long delay!"),this.isMobile=wU()||_U()}get(){return Kz()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
1058 * @license
1059 * Copyright 2020 Google LLC
1060 *
1061 * Licensed under the Apache License, Version 2.0 (the "License");
1062 * you may not use this file except in compliance with the License.
1063 * You may obtain a copy of the License at
1064 *
1065 *   http://www.apache.org/licenses/LICENSE-2.0
1066 *
1067 * Unless required by applicable law or agreed to in writing, software
1068 * distributed under the License is distributed on an "AS IS" BASIS,
1069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1070 * See the License for the specific language governing permissions and
1071 * limitations under the License.
1072 */function RN(t,e){As(t.emulator,"Emulator should always be set here");const{url:r}=t.emulator;return e?`${r}${e.startsWith("/")?e.slice(1):e}`:r}/**
1073 * @license
1074 * Copyright 2020 Google LLC
1075 *
1076 * Licensed under the Apache License, Version 2.0 (the "License");
1077 * you may not use this file except in compliance with the License.
1078 * You may obtain a copy of the License at
1079 *
1080 *   http://www.apache.org/licenses/LICENSE-2.0
1081 *
1082 * Unless required by applicable law or agreed to in writing, software
1083 * distributed under the License is distributed on an "AS IS" BASIS,
1084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1085 * See the License for the specific language governing permissions and
1086 * limitations under the License.
1087 */class B3{static initialize(e,r,n){this.fetchImpl=e,r&&(this.headersImpl=r),n&&(this.responseImpl=n)}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;cs("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;cs("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;cs("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
1088 * @license
1089 * Copyright 2020 Google LLC
1090 *
1091 * Licensed under the Apache License, Version 2.0 (the "License");
1092 * you may not use this file except in compliance with the License.
1093 * You may obtain a copy of the License at
1094 *
1095 *   http://www.apache.org/licenses/LICENSE-2.0
1096 *
1097 * Unless required by applicable law or agreed to in writing, software
1098 * distributed under the License is distributed on an "AS IS" BASIS,
1099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1100 * See the License for the specific language governing permissions and
1101 * limitations under the License.
1102 */const Yz={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"};/**
1103 * @license
1104 * Copyright 2020 Google LLC
1105 *
1106 * Licensed under the Apache License, Version 2.0 (the "License");
1107 * you may not use this file except in compliance with the License.
1108 * You may obtain a copy of the License at
1109 *
1110 *   http://www.apache.org/licenses/LICENSE-2.0
1111 *
1112 * Unless required by applicable law or agreed to in writing, software
1113 * distributed under the License is distributed on an "AS IS" BASIS,
1114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1115 * See the License for the specific language governing permissions and
1116 * limitations under the License.
1117 */const Qz=new Om(3e4,6e4);function Ms(t,e){return t.tenantId&&!e.tenantId?Object.assign(Object.assign({},e),{tenantId:t.tenantId}):e}async function Qa(t,e,r,n,s={}){return V3(t,s,async()=>{let i={},o={};n&&(e==="GET"?o=n:i={body:JSON.stringify(n)});const l=Im(Object.assign({key:t.config.apiKey},o)).slice(1),c=await t._getAdditionalHeaders();c["Content-Type"]="application/json",t.languageCode&&(c["X-Firebase-Locale"]=t.languageCode);const u=Object.assign({method:e,headers:c},i);return NU()||(u.referrerPolicy="no-referrer"),B3.fetch()(U3(t,t.config.apiHost,r,l),u)})}async function V3(t,e,r){t._canInitEmulator=!1;const n=Object.assign(Object.assign({},Yz),e);try{const s=new Zz(t),i=await Promise.race([r(),s.promise]);s.clearNetworkTimeout();const o=await i.json();if("needConfirmation"in o)throw Vf(t,"account-exists-with-different-credential",o);if(i.ok&&!("errorMessage"in o))return o;{const l=i.ok?o.errorMessage:o.error.message,[c,u]=l.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw Vf(t,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw Vf(t,"email-already-in-use",o);if(c==="USER_DISABLED")throw Vf(t,"user-disabled",o);const d=n[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(u)throw F3(t,d,u);ya(t,d)}}catch(s){if(s instanceof Zn)throw s;ya(t,"network-request-failed",{message:String(s)})}}async function Rm(t,e,r,n,s={}){const i=await Qa(t,e,r,n,s);return"mfaPendingCredential"in i&&ya(t,"multi-factor-auth-required",{_serverResponse:i}),i}function U3(t,e,r,n){const s=`${e}${r}?${n}`;return t.config.emulator?RN(t.config,s):`${t.config.apiScheme}://${s}`}function Jz(t){switch(t){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Zz{constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((r,n)=>{this.timer=setTimeout(()=>n($a(this.auth,"network-request-failed")),Qz.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Vf(t,e,r){const n={appName:t.name};r.email&&(n.email=r.email),r.phoneNumber&&(n.phoneNumber=r.phoneNumber);const s=$a(t,e,n);return s.customData._tokenResponse=r,s}function $A(t){return t!==void 0&&t.enterprise!==void 0}class eH{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 r of this.recaptchaEnforcementState)if(r.provider&&r.provider===e)return Jz(r.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}}async function tH(t,e){return Qa(t,"GET","/v2/recaptchaConfig",Ms(t,e))}/**
1118 * @license
1119 * Copyright 2020 Google LLC
1120 *
1121 * Licensed under the Apache License, Version 2.0 (the "License");
1122 * you may not use this file except in compliance with the License.
1123 * You may obtain a copy of the License at
1124 *
1125 *   http://www.apache.org/licenses/LICENSE-2.0
1126 *
1127 * Unless required by applicable law or agreed to in writing, software
1128 * distributed under the License is distributed on an "AS IS" BASIS,
1129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1130 * See the License for the specific language governing permissions and
1131 * limitations under the License.
1132 */async function rH(t,e){return Qa(t,"POST","/v1/accounts:delete",e)}async function z3(t,e){return Qa(t,"POST","/v1/accounts:lookup",e)}/**
1133 * @license
1134 * Copyright 2020 Google LLC
1135 *
1136 * Licensed under the Apache License, Version 2.0 (the "License");
1137 * you may not use this file except in compliance with the License.
1138 * You may obtain a copy of the License at
1139 *
1140 *   http://www.apache.org/licenses/LICENSE-2.0
1141 *
1142 * Unless required by applicable law or agreed to in writing, software
1143 * distributed under the License is distributed on an "AS IS" BASIS,
1144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1145 * See the License for the specific language governing permissions and
1146 * limitations under the License.
1147 */function Qd(t){if(t)try{const e=new Date(Number(t));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function nH(t,e=!1){const r=ot(t),n=await r.getIdToken(e),s=DN(n);ke(s&&s.exp&&s.auth_time&&s.iat,r.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:n,authTime:Qd(T0(s.auth_time)),issuedAtTime:Qd(T0(s.iat)),expirationTime:Qd(T0(s.exp)),signInProvider:o||null,signInSecondFactor:(i==null?void 0:i.sign_in_second_factor)||null}}function T0(t){return Number(t)*1e3}function DN(t){const[e,r,n]=t.split(".");if(e===void 0||r===void 0||n===void 0)return kp("JWT malformed, contained fewer than 3 sections"),null;try{const s=j3(r);return s?JSON.parse(s):(kp("Failed to decode base64 JWT payload"),null)}catch(s){return kp("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function LA(t){const e=DN(t);return ke(e,"internal-error"),ke(typeof e.exp<"u","internal-error"),ke(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
1148 * @license
1149 * Copyright 2020 Google LLC
1150 *
1151 * Licensed under the Apache License, Version 2.0 (the "License");
1152 * you may not use this file except in compliance with the License.
1153 * You may obtain a copy of the License at
1154 *
1155 *   http://www.apache.org/licenses/LICENSE-2.0
1156 *
1157 * Unless required by applicable law or agreed to in writing, software
1158 * distributed under the License is distributed on an "AS IS" BASIS,
1159 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1160 * See the License for the specific language governing permissions and
1161 * limitations under the License.
1162 */async function Cc(t,e,r=!1){if(r)return e;try{return await e}catch(n){throw n instanceof Zn&&aH(n)&&t.auth.currentUser===t&&await t.auth.signOut(),n}}function aH({code:t}){return t==="auth/user-disabled"||t==="auth/user-token-expired"}/**
1163 * @license
1164 * Copyright 2020 Google LLC
1165 *
1166 * Licensed under the Apache License, Version 2.0 (the "License");
1167 * you may not use this file except in compliance with the License.
1168 * You may obtain a copy of the License at
1169 *
1170 *   http://www.apache.org/licenses/LICENSE-2.0
1171 *
1172 * Unless required by applicable law or agreed to in writing, software
1173 * distributed under the License is distributed on an "AS IS" BASIS,
1174 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1175 * See the License for the specific language governing permissions and
1176 * limitations under the License.
1177 */class sH{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 r;if(e){const n=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),n}else{this.errorBackoff=3e4;const s=((r=this.user.stsTokenManager.expirationTime)!==null&&r!==void 0?r:0)-Date.now()-3e5;return Math.max(0,s)}}schedule(e=!1){if(!this.isRunning)return;const r=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},r)}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()}}/**
1178 * @license
1179 * Copyright 2020 Google LLC
1180 *
1181 * Licensed under the Apache License, Version 2.0 (the "License");
1182 * you may not use this file except in compliance with the License.
1183 * You may obtain a copy of the License at
1184 *
1185 *   http://www.apache.org/licenses/LICENSE-2.0
1186 *
1187 * Unless required by applicable law or agreed to in writing, software
1188 * distributed under the License is distributed on an "AS IS" BASIS,
1189 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1190 * See the License for the specific language governing permissions and
1191 * limitations under the License.
1192 */class Iw{constructor(e,r){this.createdAt=e,this.lastLoginAt=r,this._initializeTime()}_initializeTime(){this.lastSignInTime=Qd(this.lastLoginAt),this.creationTime=Qd(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
1193 * @license
1194 * Copyright 2019 Google LLC
1195 *
1196 * Licensed under the Apache License, Version 2.0 (the "License");
1197 * you may not use this file except in compliance with the License.
1198 * You may obtain a copy of the License at
1199 *
1200 *   http://www.apache.org/licenses/LICENSE-2.0
1201 *
1202 * Unless required by applicable law or agreed to in writing, software
1203 * distributed under the License is distributed on an "AS IS" BASIS,
1204 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1205 * See the License for the specific language governing permissions and
1206 * limitations under the License.
1207 */async function vg(t){var e;const r=t.auth,n=await t.getIdToken(),s=await Cc(t,z3(r,{idToken:n}));ke(s==null?void 0:s.users.length,r,"internal-error");const i=s.users[0];t._notifyReloadListener(i);const o=!((e=i.providerUserInfo)===null||e===void 0)&&e.length?H3(i.providerUserInfo):[],l=oH(t.providerData,o),c=t.isAnonymous,u=!(t.email&&i.passwordHash)&&!(l!=null&&l.length),d=c?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:l,metadata:new Iw(i.createdAt,i.lastLoginAt),isAnonymous:d};Object.assign(t,h)}async function iH(t){const e=ot(t);await vg(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function oH(t,e){return[...t.filter(n=>!e.some(s=>s.providerId===n.providerId)),...e]}function H3(t){return t.map(e=>{var{providerId:r}=e,n=IN(e,["providerId"]);return{providerId:r,uid:n.rawId||"",displayName:n.displayName||null,email:n.email||null,phoneNumber:n.phoneNumber||null,photoURL:n.photoUrl||null}})}/**
1208 * @license
1209 * Copyright 2020 Google LLC
1210 *
1211 * Licensed under the Apache License, Version 2.0 (the "License");
1212 * you may not use this file except in compliance with the License.
1213 * You may obtain a copy of the License at
1214 *
1215 *   http://www.apache.org/licenses/LICENSE-2.0
1216 *
1217 * Unless required by applicable law or agreed to in writing, software
1218 * distributed under the License is distributed on an "AS IS" BASIS,
1219 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1220 * See the License for the specific language governing permissions and
1221 * limitations under the License.
1222 */async function lH(t,e){const r=await V3(t,{},async()=>{const n=Im({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:i}=t.config,o=U3(t,s,"/v1/token",`key=${i}`),l=await t._getAdditionalHeaders();return l["Content-Type"]="application/x-www-form-urlencoded",B3.fetch()(o,{method:"POST",headers:l,body:n})});return{accessToken:r.access_token,expiresIn:r.expires_in,refreshToken:r.refresh_token}}async function cH(t,e){return Qa(t,"POST","/v2/accounts:revokeToken",Ms(t,e))}/**
1223 * @license
1224 * Copyright 2020 Google LLC
1225 *
1226 * Licensed under the Apache License, Version 2.0 (the "License");
1227 * you may not use this file except in compliance with the License.
1228 * You may obtain a copy of the License at
1229 *
1230 *   http://www.apache.org/licenses/LICENSE-2.0
1231 *
1232 * Unless required by applicable law or agreed to in writing, software
1233 * distributed under the License is distributed on an "AS IS" BASIS,
1234 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1235 * See the License for the specific language governing permissions and
1236 * limitations under the License.
1237 */class gc{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){ke(e.idToken,"internal-error"),ke(typeof e.idToken<"u","internal-error"),ke(typeof e.refreshToken<"u","internal-error");
1237const r="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):LA(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,r)}updateFromIdToken(e){ke(e.length!==0,"internal-error");const r=LA(e);this.updateTokensAndExpiration(e,null,r)}async getToken(e,r=!1){return!r&&this.accessToken&&!this.isExpired?this.accessToken:(ke(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,r){const{accessToken:n,refreshToken:s,expiresIn:i}=await lH(e,r);this.updateTokensAndExpiration(n,s,Number(i))}updateTokensAndExpiration(e,r,n){this.refreshToken=r||null,this.accessToken=e||null,this.expirationTime=Date.now()+n*1e3}static fromJSON(e,r){const{refreshToken:n,accessToken:s,expirationTime:i}=r,o=new gc;return n&&(ke(typeof n=="string","internal-error",{appName:e}),o.refreshToken=n),s&&(ke(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),i&&(ke(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 gc,this.toJSON())}_performRefresh(){return cs("not implemented")}}/**
1238 * @license
1239 * Copyright 2020 Google LLC
1240 *
1241 * Licensed under the Apache License, Version 2.0 (the "License");
1242 * you may not use this file except in compliance with the License.
1243 * You may obtain a copy of the License at
1244 *
1245 *   http://www.apache.org/licenses/LICENSE-2.0
1246 *
1247 * Unless required by applicable law or agreed to in writing, software
1248 * distributed under the License is distributed on an "AS IS" BASIS,
1249 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1250 * See the License for the specific language governing permissions and
1251 * limitations under the License.
1252 */function Gs(t,e){ke(typeof t=="string"||typeof t>"u","internal-error",{appName:e})}class us{constructor(e){var{uid:r,auth:n,stsTokenManager:s}=e,i=IN(e,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new sH(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=r,this.auth=n,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 Iw(i.createdAt||void 0,i.lastLoginAt||void 0)}async getIdToken(e){const r=await Cc(this,this.stsTokenManager.getToken(this.auth,e));return ke(r,this.auth,"internal-error"),this.accessToken!==r&&(this.accessToken=r,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),r}getIdTokenResult(e){return nH(this,e)}reload(){return iH(this)}_assign(e){this!==e&&(ke(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(r=>Object.assign({},r)),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const r=new us(Object.assign(Object.assign({},this),{auth:e,stsTokenManager:this.stsTokenManager._clone()}));return r.metadata._copy(this.metadata),r}_onReload(e){ke(!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,r=!1){let n=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),n=!0),r&&await vg(this),await this.auth._persistUserIfCurrent(this),n&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(Ca(this.auth.app))return Promise.reject(ys(this.auth));const e=await this.getIdToken();return await Cc(this,rH(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,isA
1252nonymous: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,r){var n,s,i,o,l,c,u,d;const h=(n=r.displayName)!==null&&n!==void 0?n:void 0,m=(s=r.email)!==null&&s!==void 0?s:void 0,p=(i=r.phoneNumber)!==null&&i!==void 0?i:void 0,x=(o=r.photoURL)!==null&&o!==void 0?o:void 0,w=(l=r.tenantId)!==null&&l!==void 0?l:void 0,g=(c=r._redirectEventId)!==null&&c!==void 0?c:void 0,v=(u=r.createdAt)!==null&&u!==void 0?u:void 0,b=(d=r.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:y,emailVerified:T,isAnonymous:N,providerData:j,stsTokenManager:_}=r;ke(y&&_,e,"internal-error");const S=gc.fromJSON(this.name,_);ke(typeof y=="string",e,"internal-error"),Gs(h,e.name),Gs(m,e.name),ke(typeof T=="boolean",e,"internal-error"),ke(typeof N=="boolean",e,"internal-error"),Gs(p,e.name),Gs(x,e.name),Gs(w,e.name),Gs(g,e.name),Gs(v,e.name),Gs(b,e.name);const k=new us({uid:y,auth:e,email:m,emailVerified:T,displayName:h,isAnonymous:N,photoURL:x,phoneNumber:p,tenantId:w,stsTokenManager:S,createdAt:v,lastLoginAt:b});return j&&Array.isArray(j)&&(k.providerData=j.map(I=>Object.assign({},I))),g&&(k._redirectEventId=g),k}static async _fromIdTokenResponse(e,r,n=!1){const s=new gc;s.updateFromServerResponse(r);const i=new us({uid:r.localId,auth:e,stsTokenManager:s,isAnonymous:n});return await vg(i),i}static async _fromGetAccountInfoResponse(e,r,n){const s=r.users[0];ke(s.localId!==void 0,"internal-error");const i=s.providerUserInfo!==void 0?H3(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!(i!=null&&i.length),l=new gc;l.updateFromIdToken(n);const c=new us({uid:s.localId,auth:e,stsTokenManager:l,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 Iw(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(i!=null&&i.length)};return Object.assign(c,u),c}}/**
1253 * @license
1254 * Copyright 2020 Google LLC
1255 *
1256 * Licensed under the Apache License, Version 2.0 (the "License");
1257 * you may not use this file except in compliance with the License.
1258 * You may obtain a copy of the License at
1259 *
1260 *   http://www.apache.org/licenses/LICENSE-2.0
1261 *
1262 * Unless required by applicable law or agreed to in writing, software
1263 * distributed under the License is distributed on an "AS IS" BASIS,
1264 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1265 * See the License for the specific language governing permissions and
1266 * limitations under the License.
1267 */const FA=new Map;function ds(t){As(t instanceof Function,"Expected a class definition");let e=FA.get(t);return e?(As(e instanceof t,"Instance stored in cache mismatched with class"),e):(e=new t,FA.set(t,e),e)}/**
1268 * @license
1269 * Copyright 2019 Google LLC
1270 *
1271 * Licensed under the Apache License, Version 2.0 (the "License");
1272 * you may not use this file except in compliance with the License.
1273 * You may obtain a copy of the License at
1274 *
1275 *   http://www.apache.org/licenses/LICENSE-2.0
1276 *
1277 * Unless required by applicable law or agreed to in writing, software
1278 * distributed under the License is distributed on an "AS IS" BASIS,
1279 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1280 * See the License for the specific language governing permissions and
1281 * limitations under the License.
1282 */class q3{constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,r){this.storage[e]=r}async _get(e){const r=this.storage[e];return r===void 0?null:r}async _remove(e){delete this.storage[e]}_addListener(e,r){}_removeListener(e,r){}}q3.type="NONE";const BA=q3;/**
1283 * @license
1284 * Copyright 2019 Google LLC
1285 *
1286 * Licensed under the Apache License, Version 2.0 (the "License");
1287 * you may not use this file except in compliance with the License.
1288 * You may obtain a copy of the License at
1289 *
1290 *   http://www.apache.org/licenses/LICENSE-2.0
1291 *
1292 * Unless required by applicable law or agreed to in writing, software
1293 * distributed under the License is distributed on an "AS IS" BASIS,
1294 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1295 * See the License for the specific language governing permissions and
1296 * limitations under the License.
1297 */function Pp(t,e,r){return`firebase:${t}:${e}:${r}`}class xc{constructor(e,r,n){this.persistence=e,this.auth=r,this.userKey=n;const{config:s,name:i}=this.auth;this.fullUserKey=Pp(this.userKey,s.apiKey,i),this.fullPersistenceKey=Pp("persistence",s.apiKey,i),this.boundEventHandler=r._onStorageEvent.bind(r),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);return e?us._fromJSON(this.auth,e):null}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const r=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,r)return this.setCurrentUser(r)}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static async create(e,r,n="authUser"){if(!r.length)return new xc(ds(BA),e,n);const s=(await Promise.all(r.map(async u=>{if(await u._isAvailable())return u}))).filter(u=>u);let i=s[0]||ds(BA);const o=Pp(n,e.config.apiKey,e.name);let l=null;for(const u of r)try{const d=await u._get(o);if(d){const h=us._fromJSON(e,d);u!==i&&(l=h),i=u;break}}catch{}const c=s.filter(u=>u._shouldAllowMigration);return!i._shouldAllowMigration||!c.length?new xc(i,e,n):(i=c[0],l&&await i._set(o,l.toJSON()),await Promise.all(r.map(async u=>{if(u!==i)try{await u._remove(o)}catch{}})),new xc(i,e,n))}}/**
1298 * @license
1299 * Copyright 2020 Google LLC
1300 *
1301 * Licensed under the Apache License, Version 2.0 (the "License");
1302 * you may not use this file except in compliance with the License.
1303 * You may obtain a copy of the License at
1304 *
1305 *   http://www.apache.org/licenses/LICENSE-2.0
1306 *
1307 * Unless required by applicable law or agreed to in writing, software
1308 * distributed under the License is distributed on an "AS IS" BASIS,
1309 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1310 * See the License for the specific language governing permissions and
1311 * limitations under the License.
1312 */function VA(t){const e=t.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(X3(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(W3(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(Q3(e))return"Blackberry";if(J3(e))return"Webos";if(G3(e))return"Safari";if((e.includes("chrome/")||K3(e))&&!e.includes("edge/"))return"Chrome";if(Y3(e))return"Android";{const r=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,n=t.match(r);if((n==null?void 0:n.length)===2)return n[1]}return"Other"}function W3(t=Kr()){return/firefox\//i.test(t)}function G3(t=Kr()){const e=t.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function K3(t=Kr()){return/crios\//i.test(t)}function X3(t=Kr()){return/iemobile/i.test(t)}function Y3(t=Kr()){return/android/i.test(t)}function Q3(t=Kr()){return/blackberry/i.test(t)}function J3(t=Kr()){return/webos/i.test(t)}function MN(t=Kr()){return/iphone|ipad|ipod/i.test(t)||/macintosh/i.test(t)&&/mobile/i.test(t)}function uH(t=Kr()){var e;return MN(t)&&!!(!((e=window.navigator)===null||e===void 0)&&e.standalone)}function dH(){return SU()&&document.documentMode===10}function Z3(t=Kr()){return MN(t)||Y3(t)||J3(t)||Q3(t)||/windows phone/i.test(t)||X3(t)}/**
1313 * @license
1314 * Copyright 2020 Google LLC
1315 *
1316 * Licensed under the Apache License, Version 2.0 (the "License");
1317 * you may not use this file except in compliance with the License.
1318 * You may obtain a copy of the License at
1319 *
1320 *   http://www.apache.org/licenses/LICENSE-2.0
1321 *
1322 * Unless required by applicable law or agreed to in writing, software
1323 * distributed under the License is distributed on an "AS IS" BASIS,
1324 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1325 * See the License for the specific language governing permissions and
1326 * limitations under the License.
1327 */function e5(t,e=[]){let r;switch(t){case"Browser":r=VA(Kr());break;case"Worker":r=`${VA(Kr())}-${t}`;break;default:r=t}const n=e.length?e.join(","):"FirebaseCore-web";return`${r}/JsCore/${xl}/${n}`}/**
1328 * @license
1329 * Copyright 2022 Google LLC
1330 *
1331 * Licensed under the Apache License, Version 2.0 (the "License");
1332 * you may not use this file except in compliance with the License.
1333 * You may obtain a copy of the License at
1334 *
1335 *   http://www.apache.org/licenses/LICENSE-2.0
1336 *
1337 * Unless required by applicable law or agreed to in writing, software
1338 * distributed under the License is distributed on an "AS IS" BASIS,
1339 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1340 * See the License for the specific language governing permissions and
1341 * limitations under the License.
1342 */class hH{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,r){const n=i=>new Promise((o,l)=>{try{const c=e(i);o(c)}catch(c){l(c)}});n.onAbort=r,this.queue.push(n);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const r=[];try{for(const n of this.queue)await n(e),n.onAbort&&r.push(n.onAbort)}catch(n){r.reverse();for(const s of r)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:n==null?void 0:n.message})}}}/**
1343 * @license
1344 * Copyright 2023 Google LLC
1345 *
1346 * Licensed under the Apache License, Version 2.0 (the "License");
1347 * you may not use this file except in compliance with the License.
1348 * You may obtain a copy of the License at
1349 *
1350 *   http://www.apache.org/licenses/LICENSE-2.0
1351 *
1352 * Unless required by applicable law or agreed to in writing, software
1353 * distributed under the License is distributed on an "AS IS" BASIS,
1354 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1355 * See the License for the specific language governing permissions and
1356 * limitations under the License.
1357 */async function mH(t,e={}){return Qa(t,"GET","/v2/passwordPolicy",Ms(t,e))}/**
1358 * @license
1359 * Copyright 2023 Google LLC
1360 *
1361 * Licensed under the Apache License, Version 2.0 (the "License");
1362 * you may not use this file except in compliance with the License.
1363 * You may obtain a copy of the License at
1364 *
1365 *   http://www.apache.org/licenses/LICENSE-2.0
1366 *
1367 * Unless required by applicable law or agreed to in writing, software
1368 * distributed under the License is distributed on an "AS IS" BASIS,
1369 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1370 * See the License for the specific language governing permissions and
1371 * limitations under the License.
1372 */const fH=6;class pH{constructor(e){var r,n,s,i;const o=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(r=o.minPasswordLength)!==null&&r!==void 0?r:fH,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=(n=e.allowedNonAlphanumericCharacters)===null||n===void 0?void 0:n.join(""))!==null&&s!==void 0?s:"",this.forceUpgradeOnSignin=(i=e.forceUpgradeOnSignin)!==null&&i!==void 0?i:!1,this.schemaVersion=e.schemaVersion}validatePassword(e){var r,n,s,i,o,l;const c={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,c),this.validatePasswordCharacterOptions(e,c),c.isValid&&
1372(c.isValid=(r=c.meetsMinPasswordLength)!==null&&r!==void 0?r:!0),c.isValid&&(c.isValid=(n=c.meetsMaxPasswordLength)!==null&&n!==void 0?n:!0),c.isValid&&(c.isValid=(s=c.containsLowercaseLetter)!==null&&s!==void 0?s:!0),c.isValid&&(c.isValid=(i=c.containsUppercaseLetter)!==null&&i!==void 0?i:!0),c.isValid&&(c.isValid=(o=c.containsNumericCharacter)!==null&&o!==void 0?o:!0),c.isValid&&(c.isValid=(l=c.containsNonAlphanumericCharacter)!==null&&l!==void 0?l:!0),c}validatePasswordLengthOptions(e,r){const n=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;n&&(r.meetsMinPasswordLength=e.length>=n),s&&(r.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,r){this.updatePasswordCharacterOptionsStatuses(r,!1,!1,!1,!1);let n;for(let s=0;s<e.length;s++)n=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(r,n>="a"&&n<="z",n>="A"&&n<="Z",n>="0"&&n<="9",this.allowedNonAlphanumericCharacters.includes(n))}updatePasswordCharacterOptionsStatuses(e,r,n,s,i){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=r)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=n)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=i))}}/**
1373 * @license
1374 * Copyright 2020 Google LLC
1375 *
1376 * Licensed under the Apache License, Version 2.0 (the "License");
1377 * you may not use this file except in compliance with the License.
1378 * You may obtain a copy of the License at
1379 *
1380 *   http://www.apache.org/licenses/LICENSE-2.0
1381 *
1382 * Unless required by applicable law or agreed to in writing, software
1383 * distributed under the License is distributed on an "AS IS" BASIS,
1384 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1385 * See the License for the specific language governing permissions and
1386 * limitations under the License.
1387 */class gH{constructor(e,r,n,s){this.app=e,this.heartbeatServiceProvider=r,this.appCheckServiceProvider=n,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new UA(this),this.idTokenSubscription=new UA(this),this.beforeStateQueue=new hH(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=L3,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion}_initializeWithPersistence(e,r){return r&&(this._popupRedirectResolver=ds(r)),this._initializationPromise=this.queue(async()=>{var n,s;if(!this._deleted&&(this.persistenceManager=await xc.create(this,e),!this._deleted)){if(!((n=this._popupRedirectResolver)===null||n===void 0)&&n._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}await this.initializeCurrentUser(r),this.lastNotifiedUid=((s=this.currentUser)===null||s===void 0?void 0:s.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 r=await z3(this,{idToken:e}),n=await us._fromGetAccountInfoResponse(this,r,e);await this.directlySetCurrentUser(n)}catch(r){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",r),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var r;if(Ca(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(l=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(l,l))}):this.directlySetCurrentUser(null)}const n=await this.assertedPersistence.getCurrentUser();let s=n,i=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId,l=s==null?void 0:s._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===l)&&(c!=null&&c.user)&&(s=c.user,i=!0)}if(!s)return this.directlySetCurrentUser(null);
1387if(!s._redirectEventId){if(i)try{await this.beforeStateQueue.runMiddleware(s)}catch(o){s=n,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return s?this.reloadAndSetCurrentUserOrClear(s):this.directlySetCurrentUser(null)}return ke(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 r=null;try{r=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return r}async reloadAndSetCurrentUserOrClear(e){try{await vg(e)}catch(r){if((r==null?void 0:r.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Xz()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(Ca(this.app))return Promise.reject(ys(this));const r=e?ot(e):null;return r&&ke(r.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(r&&r._clone(this))}async _updateCurrentUser(e,r=!1){if(!this._deleted)return e&&ke(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),r||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return Ca(this.app)?Promise.reject(ys(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return Ca(this.app)?Promise.reject(ys(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(ds(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const r=this._getPasswordPolicyInternal();return r.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):r.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await mH(this),r=new pH(e);this.tenantId===null?this._projectPasswordPolicy=r:this._tenantPasswordPolicies[this.tenantId]=r}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new gl("auth","Firebase",e())}onAuthStateChanged(e,r,n){return this.registerStateListener(this.authStateSubscription,e,r,n)}beforeAuthStateChanged(e,r){return this.beforeStateQueue.pushCallback(e,r)}onIdTokenChanged(e,r,n){return this.registerStateListener(this.idTokenSubscription,e,r,n)}authStateReady(){return new Promise((e,r)=>{if(this.currentUser)e();else{const n=this.onAuthStateChanged(()=>{n(),e()},r)}})}async revokeAccessToken(e){if(this.currentUser){const r=await this.currentUser.getIdToken(),n={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:r};this.tenantId!=null&&(n.tenantId=this.tenantId),await cH(this,n)}}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,r){const n=await this.getOrInitRedirectPersistenceManager(r);return e===null?n.removeCurrentUser():n.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const r=e&&ds(e)||this._popupRedirectResolver;ke(r,this,"argument-error"),this.redirectPersistenceManager=await xc.create(this,[ds(r._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var r,n;return this._isInitialized&&await this.queue(async()=>{}),((r=this._currentUser)===null||r===void 0?void 0:r._redirectEventId)===e?this._currentUser:((n=this.redirectUser)===null||n===void 0?void 0:n._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,r;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const n=(r=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&r!==void 0?r:null;this.lastNotifiedUid!==n&&(this.lastNotifiedUid=n,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,r,n,s){if(this._deleted)return()=>{};const i=typeof r=="function"?r:r.next.bind(r);let o=!1;const l=this._isInitialized?Promise.resolve():this._initializationPromise;if(ke(l,this,"internal-error"),l.then(()=>{o||i(this.currentUser)}),typeof r=="function"){const c=e.addObserver(r,n,s);return()=>{o=!0,c()}}else{const c=e.addObserver(r);return()=>{o=!0,c()}}}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 ke(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=e5(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var e;const r={"X-Client-Version":this.clientVersion};this.app.options.appId&&(r["X-Firebase-gmpid"]=this.app.options.appId);const n=await((e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader());n&&(r["X-Firebase-Client"]=n);const s=await this._getAppCheckToken();return s&&(r["X-Firebase-AppCheck"]=s),r}async _getAppCheckToken(){var e;const r=await((e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken());return r!=null&&r.error&&Wz(`Error while retrieving App Check token: ${r.error}`),r==null?void 0:r.token}}function Hi(t){return ot(t)}class UA{constructor(e){this.auth=e,this.observer=null,this.addObserver=IU(r=>this.observer=r)}get next(){return ke(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
1388 * @license
1389 * Copyright 2020 Google LLC
1390 *
1391 * Licensed under the Apache License, Version 2.0 (the "License");
1392 * you may not use this file except in compliance with the License.
1393 * You may obtain a copy of the License at
1394 *
1395 *   http://www.apache.org/licenses/LICENSE-2.0
1396 *
1397 * Unless required by applicable law or agreed to in writing, software
1398 * distributed under the License is distributed on an "AS IS" BASIS,
1399 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1400 * See the License for the specific language governing permissions and
1401 * limitations under the License.
1402 */let hy={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function xH(t){hy=t}function t5(t){return hy.loadJS(t)}function yH(){return hy.recaptchaEnterpriseScript}function vH(){return hy.gapiScript}function bH(t){return`__${t}${Math.floor(Math.random()*1e6)}`}const wH="recaptcha-enterprise",jH="NO_RECAPTCHA";class NH{constructor(e){this.type=wH,this.auth=Hi(e)}async verify(e="verify",r=!1){async function n(i){if(!r){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,l)=>{tH(i,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)l(new Error("recaptcha Enterprise site key undefined"));else{const u=new eH(c);return i.tenantId==null?i._agentRecaptchaConfig=u:i._tenantRecaptchaConfigs[i.tenantId]=u,o(u.siteKey)}}).catch(c=>{l(c)})})}function s(i,o,l){const c=window.grecaptcha;$A(c)?c.enterprise.ready(()=>{c.enterprise.execute(i,{action:e}).then(u=>{o(u)}).catch(()=>{o(jH)})}):l(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((i,o)=>{n(this.auth).then(l=>{if(!r&&$A(window.grecaptcha))s(l,i,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=yH();c.length!==0&&(c+=l),t5(c).then(()=>{s(l,i,o)}).catch(u=>{o(u)})}}).catch(l=>{o(l)})})}}async function zA(t,e,r,n=!1){const s=new NH(t);let i;try{i=await s.verify(r)}catch{i=await s.verify(r,!0)}const o=Object.assign({},e);return n?Object.assign(o,{captchaResp:i}):Object.assign(o,{captchaResponse:i}),Object.assign(o,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(o,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),o}async function bg(t,e,r,n){var s;if(!((s=t._getRecaptchaConfig())===null||s===void 0)&&s.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const i=await zA(t,e,r,r==="getOobCode");return n(t,i)}else return n(t,e).catch(async i=>{if(i.code==="auth/missing-recaptcha-token"){console.log(`${r} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const o=await zA(t,e,r,r==="getOobCode");return n(t,o)}else return Promise.reject(i)})}/**
1403 * @license
1404 * Copyright 2020 Google LLC
1405 *
1406 * Licensed under the Apache License, Version 2.0 (the "License");
1407 * you may not use this file except in compliance with the License.
1408 * You may obtain a copy of the License at
1409 *
1410 *   http://www.apache.org/licenses/LICENSE-2.0
1411 *
1412 * Unless required by applicable law or agreed to in writing, software
1413 * distributed under the License is distributed on an "AS IS" BASIS,
1414 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1415 * See the License for the specific language governing permissions and
1416 * limitations under the License.
1417 */function _H(t,e){const r=zi(t,"auth");if(r.isInitialized()){const s=r.getImmediate(),i=r.getOptions();if(Go(i,e??{}))return s;ya(s,"already-initialized")}return r.initialize({options:e})}function SH(t,e){const r=(e==null?void 0:e.persistence)||[],n=(Array.isArray(r)?r:[r]).map(ds);e!=null&&e.errorMap&&t._updateErrorMap(e.errorMap),t._initializeWithPersistence(n,e==null?void 0:e.popupRedirectResolver)}function TH(t,e,r){const n=Hi(t);ke(n._canInitEmulator,n,"emulator-config-failed"),ke(/^https?:\/\//.test(e),n,"invalid-emulator-scheme");const s=!1,i=r5(e),{host:o,port:l}=AH(e),c=l===null?"":`:${l}`;n.config.emulator={url:`${i}//${o}${c}/`},n.settings.appVerificationDisabledForTesting=!0,n.emulatorConfig=Object.freeze({host:o,port:l,protocol:i.replace(":",""),options:Object.freeze({disableWarnings:s})}),EH()}function r5(t){const e=t.indexOf(":");return e<0?"":t.substr(0,e+1)}function AH(t){const e=r5(t),r=/(\/\/)?([^?#/]+)/.exec(t.substr(e.length));if(!r)return{host:"",port:null};const n=r[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(n);if(s){const i=s[1];return{host:i,port:HA(n.substr(i.length+1))}}else{const[i,o]=n.split(":");return{host:i,port:HA(o)}}}function HA(t){if(!t)return null;const e=Number(t);return isNaN(e)?null:e}function EH(){function t(){const e=document.createElement("p"),r=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",r.position="fixed",r.width="100%",r.backgroundColor="#ffffff",r.border=".1em solid #000000",r.color="#b50000",r.bottom="0px",r.left="0px",r.margin="0px",r.zIndex="10000",r.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())}/**
1418 * @license
1419 * Copyright 2020 Google LLC
1420 *
1421 * Licensed under the Apache License, Version 2.0 (the "License");
1422 * you may not use this file except in compliance with the License.
1423 * You may obtain a copy of the License at
1424 *
1425 *   http://www.apache.org/licenses/LICENSE-2.0
1426 *
1427 * Unless required by applicable law or agreed to in writing, software
1428 * distributed under the License is distributed on an "AS IS" BASIS,
1429 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1430 * See the License for the specific language governing permissions and
1431 * limitations under the License.
1432 */class $N{constructor(e,r){this.providerId=e,this.signInMethod=r}toJSON(){return cs("not implemented")}_getIdTokenResponse(e){return cs("not implemented")}_linkToIdToken(e,r){return cs("not implemented")}_getReauthenticationResolver(e){return cs("not implemented")}}async function kH(t,e){return Qa(t,"POST","/v1/accounts:signUp",e)}/**
1433 * @license
1434 * Copyright 2020 Google LLC
1435 *
1436 * Licensed under the Apache License, Version 2.0 (the "License");
1437 * you may not use this file except in compliance with the License.
1438 * You may obtain a copy of the License at
1439 *
1440 *   http://www.apache.org/licenses/LICENSE-2.0
1441 *
1442 * Unless required by applicable law or agreed to in writing, software
1443 * distributed under the License is distributed on an "AS IS" BASIS,
1444 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1445 * See the License for the specific language governing permissions and
1446 * limitations under the License.
1447 */async function PH(t,e){return Rm(t,"POST","/v1/accounts:signInWithPassword",Ms(t,e))}async function CH(t,e){return Qa(t,"POST","/v1/accounts:sendOobCode",Ms(t,e))}async function IH(t,e){return CH(t,e)}/**
1448 * @license
1449 * Copyright 2020 Google LLC
1450 *
1451 * Licensed under the Apache License, Version 2.0 (the "License");
1452 * you may not use this file except in compliance with the License.
1453 * You may obtain a copy of the License at
1454 *
1455 *   http://www.apache.org/licenses/LICENSE-2.0
1456 *
1457 * Unless required by applicable law or agreed to in writing, software
1458 * distributed under the License is distributed on an "AS IS" BASIS,
1459 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1460 * See the License for the specific language governing permissions and
1461 * limitations under the License.
1462 */async function OH(t,e){return Rm(t,"POST","/v1/accounts:signInWithEmailLink",Ms(t,e))}async function RH(t,e){return Rm(t,"POST","/v1/accounts:signInWithEmailLink",Ms(t,e))}/**
1463 * @license
1464 * Copyright 2020 Google LLC
1465 *
1466 * Licensed under the Apache License, Version 2.0 (the "License");
1467 * you may not use this file except in compliance with the License.
1468 * You may obtain a copy of the License at
1469 *
1470 *   http://www.apache.org/licenses/LICENSE-2.0
1471 *
1472 * Unless required by applicable law or agreed to in writing, software
1473 * distributed under the License is distributed on an "AS IS" BASIS,
1474 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1475 * See the License for the specific language governing permissions and
1476 * limitations under the License.
1477 */class Rh extends $N{constructor(e,r,n,s=null){super("password",n),this._email=e,this._password=r,this._tenantId=s}static _fromEmailAndPassword(e,r){return new Rh(e,r,"password")}static _fromEmailAndCode(e,r,n=null){return new Rh(e,r,"emailLink",n)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e;if(r!=null&&r.email&&(r!=null&&r.password)){if(r.signInMethod==="password")return this._fromEmailAndPassword(r.email,r.password);if(r.signInMethod==="emailLink")return this._fromEmailAndCode(r.email,r.password,r.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const r={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return bg(e,r,"signInWithPassword",PH);case"emailLink":return OH(e,{email:this._email,oobCode:this._password});default:ya(e,"internal-error")}}async _linkToIdToken(e,r){switch(this.signInMethod){case"password":const n={idToken:r,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return bg(e,n,"signUpPassword",kH);case"emailLink":return RH(e,{idToken:r,email:this._email,oobCode:this._password});default:ya(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
1478 * @license
1479 * Copyright 2020 Google LLC
1480 *
1481 * Licensed under the Apache License, Version 2.0 (the "License");
1482 * you may not use this file except in compliance with the License.
1483 * You may obtain a copy of the License at
1484 *
1485 *   http://www.apache.org/licenses/LICENSE-2.0
1486 *
1487 * Unless required by applicable law or agreed to in writing, software
1488 * distributed under the License is distributed on an "AS IS" BASIS,
1489 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1490 * See the License for the specific language governing permissions and
1491 * limitations under the License.
1492 */async function yc(t,e){return Rm(t,"POST","/v1/accounts:signInWithIdp",Ms(t,e))}/**
1493 * @license
1494 * Copyright 2020 Google LLC
1495 *
1496 * Licensed under the Apache License, Version 2.0 (the "License");
1497 * you may not use this file except in compliance with the License.
1498 * You may obtain a copy of the License at
1499 *
1500 *   http://www.apache.org/licenses/LICENSE-2.0
1501 *
1502 * Unless required by applicable law or agreed to in writing, software
1503 * distributed under the License is distributed on an "AS IS" BASIS,
1504 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1505 * See the License for the specific language governing permissions and
1506 * limitations under the License.
1507 */const DH="http://localhost";class Ko extends $N{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const r=new Ko(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(r.idToken=e.idToken),e.accessToken&&(r.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(r.nonce=e.nonce),e.pendingToken&&(r.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(r.accessToken=e.oauthToken,r.secret=e.oauthTokenSecret):ya("argument-error"),r}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
1507once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const r=typeof e=="string"?JSON.parse(e):e,{providerId:n,signInMethod:s}=r,i=IN(r,["providerId","signInMethod"]);if(!n||!s)return null;const o=new Ko(n,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 r=this.buildRequest();return yc(e,r)}_linkToIdToken(e,r){const n=this.buildRequest();return n.idToken=r,yc(e,n)}_getReauthenticationResolver(e){const r=this.buildRequest();return r.autoCreate=!1,yc(e,r)}buildRequest(){const e={requestUri:DH,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const r={};this.idToken&&(r.id_token=this.idToken),this.accessToken&&(r.access_token=this.accessToken),this.secret&&(r.oauth_token_secret=this.secret),r.providerId=this.providerId,this.nonce&&!this.pendingToken&&(r.nonce=this.nonce),e.postBody=Im(r)}return e}}/**
1508 * @license
1509 * Copyright 2020 Google LLC
1510 *
1511 * Licensed under the Apache License, Version 2.0 (the "License");
1512 * you may not use this file except in compliance with the License.
1513 * You may obtain a copy of the License at
1514 *
1515 *   http://www.apache.org/licenses/LICENSE-2.0
1516 *
1517 * Unless required by applicable law or agreed to in writing, software
1518 * distributed under the License is distributed on an "AS IS" BASIS,
1519 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1520 * See the License for the specific language governing permissions and
1521 * limitations under the License.
1522 */function MH(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 $H(t){const e=Rd(Dd(t)).link,r=e?Rd(Dd(e)).deep_link_id:null,n=Rd(Dd(t)).deep_link_id;return(n?Rd(Dd(n)).link:null)||n||r||e||t}class LN{constructor(e){var r,n,s,i,o,l;const c=Rd(Dd(e)),u=(r=c.apiKey)!==null&&r!==void 0?r:null,d=(n=c.oobCode)!==null&&n!==void 0?n:null,h=MH((s=c.mode)!==null&&s!==void 0?s:null);ke(u&&d&&h,"argument-error"),this.apiKey=u,this.operation=h,this.code=d,this.continueUrl=(i=c.continueUrl)!==null&&i!==void 0?i:null,this.languageCode=(o=c.languageCode)!==null&&o!==void 0?o:null,this.tenantId=(l=c.tenantId)!==null&&l!==void 0?l:null}static parseLink(e){const r=$H(e);try{return new LN(r)}catch{return null}}}/**
1523 * @license
1524 * Copyright 2020 Google LLC
1525 *
1526 * Licensed under the Apache License, Version 2.0 (the "License");
1527 * you may not use this file except in compliance with the License.
1528 * You may obtain a copy of the License at
1529 *
1530 *   http://www.apache.org/licenses/LICENSE-2.0
1531 *
1532 * Unless required by applicable law or agreed to in writing, software
1533 * distributed under the License is distributed on an "AS IS" BASIS,
1534 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1535 * See the License for the specific language governing permissions and
1536 * limitations under the License.
1537 */class _u{constructor(){this.providerId=_u.PROVIDER_ID}static credential(e,r){return Rh._fromEmailAndPassword(e,r)}static credentialWithLink(e,r){const n=LN.parseLink(r);return ke(n,"argument-error"),Rh._fromEmailAndCode(e,n.code,n.tenantId)}}_u.PROVIDER_ID="password";_u.EMAIL_PASSWORD_SIGN_IN_METHOD="password";_u.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
1538 * @license
1539 * Copyright 2020 Google LLC
1540 *
1541 * Licensed under the Apache License, Version 2.0 (the "License");
1542 * you may not use this file except in compliance with the License.
1543 * You may obtain a copy of the License at
1544 *
1545 *   http://www.apache.org/licenses/LICENSE-2.0
1546 *
1547 * Unless required by applicable law or agreed to in writing, software
1548 * distributed under the License is distributed on an "AS IS" BASIS,
1549 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1550 * See the License for the specific language governing permissions and
1551 * limitations under the License.
1552 */class n5{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}}/**
1553 * @license
1554 * Copyright 2019 Google LLC
1555 *
1556 * Licensed under the Apache License, Version 2.0 (the "License");
1557 * you may not use this file except in compliance with the License.
1558 * You may obtain a copy of the License at
1559 *
1560 *   http://www.apache.org/licenses/LICENSE-2.0
1561 *
1562 * Unless required by applicable law or agreed to in writing, software
1563 * distributed under the License is distributed on an "AS IS" BASIS,
1564 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1565 * See the License for the specific language governing permissions and
1566 * limitations under the License.
1567 */class Dm extends n5{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
1568 * @license
1569 * Copyright 2020 Google LLC
1570 *
1571 * Licensed under the Apache License, Version 2.0 (the "License");
1572 * you may not use this file except in compliance with the License.
1573 * You may obtain a copy of the License at
1574 *
1575 *   http://www.apache.org/licenses/LICENSE-2.0
1576 *
1577 * Unless required by applicable law or agreed to in writing, software
1578 * distributed under the License is distributed on an "AS IS" BASIS,
1579 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1580 * See the License for the specific language governing permissions and
1581 * limitations under the License.
1582 */class ti extends Dm{constructor(){super("facebook.com")}static credential(e){return Ko._fromParams({providerId:ti.PROVIDER_ID,signInMethod:ti.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ti.credentialFromTaggedObject(e)}static credentialFromError(e){return ti.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ti.credential(e.oauthAccessToken)}catch{return null}}}ti.FACEBOOK_SIGN_IN_METHOD="facebook.com";ti.PROVIDER_ID="facebook.com";/**
1583 * @license
1584 * Copyright 2020 Google LLC
1585 *
1586 * Licensed under the Apache License, Version 2.0 (the "License");
1587 * you may not use this file except in compliance with the License.
1588 * You may obtain a copy of the License at
1589 *
1590 *   http://www.apache.org/licenses/LICENSE-2.0
1591 *
1592 * Unless required by applicable law or agreed to in writing, software
1593 * distributed under the License is distributed on an "AS IS" BASIS,
1594 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1595 * See the License for the specific language governing permissions and
1596 * limitations under the License.
1597 */class ri extends Dm{constructor(){super("google.com"),this.addScope("profile")}static credential(e,r){return Ko._fromParams({providerId:ri.PROVIDER_ID,signInMethod:ri.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:r})}static credentialFromResult(e){return ri.credentialFromTaggedObject(e)}static credentialFromError(e){return ri.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:r,oauthAccessToken:n}=e;if(!r&&!n)return null;try{return ri.credential(r,n)}catch{return null}}}ri.GOOGLE_SIGN_IN_METHOD="google.com";ri.PROVIDER_ID="google.com";/**
1598 * @license
1599 * Copyright 2020 Google LLC
1600 *
1601 * Licensed under the Apache License, Version 2.0 (the "License");
1602 * you may not use this file except in compliance with the License.
1603 * You may obtain a copy of the License at
1604 *
1605 *   http://www.apache.org/licenses/LICENSE-2.0
1606 *
1607 * Unless required by applicable law or agreed to in writing, software
1608 * distributed under the License is distributed on an "AS IS" BASIS,
1609 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1610 * See the License for the specific language governing permissions and
1611 * limitations under the License.
1612 */class ni extends Dm{constructor(){super("github.com")}static credential(e){return Ko._fromParams({providerId:ni.PROVIDER_ID,signInMethod:ni.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return ni.credentialFromTaggedObject(e)}static credentialFromError(e){return ni.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return ni.credential(e.oauthAccessToken)}catch{return null}}}ni.GITHUB_SIGN_IN_METHOD="github.com";ni.PROVIDER_ID="github.com";/**
1613 * @license
1614 * Copyright 2020 Google LLC
1615 *
1616 * Licensed under the Apache License, Version 2.0 (the "License");
1617 * you may not use this file except in compliance with the License.
1618 * You may obtain a copy of the License at
1619 *
1620 *   http://www.apache.org/licenses/LICENSE-2.0
1621 *
1622 * Unless required by applicable law or agreed to in writing, software
1623 * distributed under the License is distributed on an "AS IS" BASIS,
1624 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1625 * See the License for the specific language governing permissions and
1626 * limitations under the License.
1627 */class ai extends Dm{constructor(){super("twitter.com")}static credential(e,r){return Ko._fromParams({providerId:ai.PROVIDER_ID,signInMethod:ai.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:r})}static credentialFromResult(e){return ai.credentialFromTaggedObject(e)}static credentialFromError(e){return ai.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:r,oauthTokenSecret:n}=e;if(!r||!n)return null;try{return ai.credential(r,n)}catch{return null}}}ai.TWITTER_SIGN_IN_METHOD="twitter.com";ai.PROVIDER_ID="twitter.com";/**
1628 * @license
1629 * Copyright 2020 Google LLC
1630 *
1631 * Licensed under the Apache License, Version 2.0 (the "License");
1632 * you may not use this file except in compliance with the License.
1633 * You may obtain a copy of the License at
1634 *
1635 *   http://www.apache.org/licenses/LICENSE-2.0
1636 *
1637 * Unless required by applicable law or agreed to in writing, software
1638 * distributed under the License is distributed on an "AS IS" BASIS,
1639 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1640 * See the License for the specific language governing permissions and
1641 * limitations under the License.
1642 */async function LH(t,e){return Rm(t,"POST","/v1/accounts:signUp",Ms(t,e))}/**
1643 * @license
1644 * Copyright 2020 Google LLC
1645 *
1646 * Licensed under the Apache License, Version 2.0 (the "License");
1647 * you may not use this file except in compliance with the License.
1648 * You may obtain a copy of the License at
1649 *
1650 *   http://www.apache.org/licenses/LICENSE-2.0
1651 *
1652 * Unless required by applicable law or agreed to in writing, software
1653 * distributed under the License is distributed on an "AS IS" BASIS,
1654 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1655 * See the License for the specific language governing permissions and
1656 * limitations under the License.
1657 */class Xo{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,r,n,s=!1){const i=await us._fromIdTokenResponse(e,n,s),o=qA(n);return new Xo({user:i,providerId:o,_tokenResponse:n,operationType:r})}static async _forOperation(e,r,n){await e._updateTokensIfNecessary(n,!0);const s=qA(n);return new Xo({user:e,providerId:s,_tokenResponse:n,operationType:r})}}function qA(t){return t.providerId?t.providerId:"phoneNumber"in t?"phone":null}/**
1658 * @license
1659 * Copyright 2020 Google LLC
1660 *
1661 * Licensed under the Apache License, Version 2.0 (the "License");
1662 * you may not use this file except in compliance with the License.
1663 * You may obtain a copy of the License at
1664 *
1665 *   http://www.apache.org/licenses/LICENSE-2.0
1666 *
1667 * Unless required by applicable law or agreed to in writing, software
1668 * distributed under the License is distributed on an "AS IS" BASIS,
1669 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1670 * See the License for the specific language governing permissions and
1671 * limitations under the License.
1672 */class wg extends Zn{constructor(e,r,n,s){var i;super(r.code,r.message),this.operationType=n,this.user=s,Object.setPrototypeOf(this,wg.prototype),this.customData={appName:e.name,tenantId:(i=e.tenantId)!==null&&i!==void 0?i:void 0,_serverResponse:r.customData._serverResponse,operationType:n}}static _fromErrorAndOperation(e,r,n,s){return new wg(e,r,n,s)}}function a5(t,e,r,n){return(e==="reauthenticate"?r._getReauthenticationResolver(t):r._getIdTokenResponse(t)).catch(i=>{throw i.code==="auth/multi-factor-auth-required"?wg._fromErrorAndOperation(t,i,e,n):i})}async function FH(t,e,r=!1){const n=await Cc(t,e._linkToIdToken(t.auth,await t.getIdToken()),r);return Xo._forOperation(t,"link",n)}/**
1673 * @license
1674 * Copyright 2019 Google LLC
1675 *
1676 * Licensed under the Apache License, Version 2.0 (the "License");
1677 * you may not use this file except in compliance with the License.
1678 * You may obtain a copy of the License at
1679 *
1680 *   http://www.apache.org/licenses/LICENSE-2.0
1681 *
1682 * Unless required by applicable law or agreed to in writing, software
1683 * distributed under the License is distributed on an "AS IS" BASIS,
1684 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1685 * See the License for the specific language governing permissions and
1686 * limitations under the License.
1687 */async function BH(t,e,r=!1){const{auth:n}=t;if(Ca(n.app))return Promise.reject(ys(n));const s="reauthenticate";try{const i=await Cc(t,a5(n,s,e,t),r);ke(i.idToken,n,"internal-error");const o=DN(i.idToken);ke(o,n,"internal-error");const{sub:l}=o;return ke(t.uid===l,n,"user-mismatch"),Xo._forOperation(t,s,i)}catch(i){throw(i==null?void 0:i.code)==="auth/user-not-found"&&ya(n,"user-mismatch"),i}}/**
1688 * @license
1689 * Copyright 2020 Google LLC
1690 *
1691 * Licensed under the Apache License, Version 2.0 (the "License");
1692 * you may not use this file except in compliance with the License.
1693 * You may obtain a copy of the License at
1694 *
1695 *   http://www.apache.org/licenses/LICENSE-2.0
1696 *
1697 * Unless required by applicable law or agreed to in writing, software
1698 * distributed under the License is distributed on an "AS IS" BASIS,
1699 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1700 * See the License for the specific language governing permissions and
1701 * limitations under the License.
1702 */async function s5(t,e,r=!1){if(Ca(t.app))return Promise.reject(ys(t));const n="signIn",s=await a5(t,n,e),i=await Xo._fromIdTokenResponse(t,n,s);return r||await t._updateCurrentUser(i.user),i}async function VH(t,e){return s5(Hi(t),e)}/**
1703 * @license
1704 * Copyright 2020 Google LLC
1705 *
1706 * Licensed under the Apache License, Version 2.0 (the "License");
1707 * you may not use this file except in compliance with the License.
1708 * You may obtain a copy of the License at
1709 *
1710 *   http://www.apache.org/licenses/LICENSE-2.0
1711 *
1712 * Unless required by applicable law or agreed to in writing, software
1713 * distributed under the License is distributed on an "AS IS" BASIS,
1714 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1715 * See the License for the specific language governing permissions and
1716 * limitations under the License.
1717 */async function i5(t){const e=Hi(t);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function UH(t,e,r){const n=Hi(t);await bg(n,{requestType:"PASSWORD_RESET",email:e,clientType:"CLIENT_TYPE_WEB"},"getOobCode",IH)}async function zH(t,e,r){if(Ca(t.app))return Promise.reject(ys(t));const n=Hi(t),o=await bg(n,{returnSecureToken:!0,email:e,password:r,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",LH).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&i5(t),c}),l=await Xo._fromIdTokenResponse(n,"signIn",o);return await n._updateCurrentUser(l.user),l}function HH(t,e,r){return Ca(t.app)?Promise.reject(ys(t)):VH(ot(t),_u.credential(e,r)).catch(async n=>{throw n.code==="auth/password-does-not-meet-requirements"&&i5(t),n})}/**
1718 * @license
1719 * Copyright 2020 Google LLC
1720 *
1721 * Licensed under the Apache License, Version 2.0 (the "License");
1722 * you may not use this file except in compliance with the License.
1723 * You may obtain a copy of the License at
1724 *
1725 *   http://www.apache.org/licenses/LICENSE-2.0
1726 *
1727 * Unless required by applicable law or agreed to in writing, software
1728 * distributed under the License is distributed on an "AS IS" BASIS,
1729 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1730 * See the License for the specific language governing permissions and
1731 * limitations under the License.
1732 */async function qH(t,e){return Qa(t,"POST","/v1/accounts:update",e)}/**
1733 * @license
1734 * Copyright 2020 Google LLC
1735 *
1736 * Licensed under the Apache License, Version 2.0 (the "License");
1737 * you may not use this file except in compliance with the License.
1738 * You may obtain a copy of the License at
1739 *
1740 *   http://www.apache.org/licenses/LICENSE-2.0
1741 *
1742 * Unless required by applicable law or agreed to in writing, softw
1742are
1743 * distributed under the License is distributed on an "AS IS" BASIS,
1744 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1745 * See the License for the specific language governing permissions and
1746 * limitations under the License.
1747 */async function WA(t,{displayName:e,photoURL:r}){if(e===void 0&&r===void 0)return;const n=ot(t),i={idToken:await n.getIdToken(),displayName:e,photoUrl:r,returnSecureToken:!0},o=await Cc(n,qH(n.auth,i));n.displayName=o.displayName||null,n.photoURL=o.photoUrl||null;const l=n.providerData.find(({providerId:c})=>c==="password");l&&(l.displayName=n.displayName,l.photoURL=n.photoURL),await n._updateTokensIfNecessary(o)}function WH(t,e,r,n){return ot(t).onIdTokenChanged(e,r,n)}function GH(t,e,r){return ot(t).beforeAuthStateChanged(e,r)}function KH(t,e,r,n){return ot(t).onAuthStateChanged(e,r,n)}function XH(t){return ot(t).signOut()}async function o5(t){return ot(t).delete()}const jg="__sak";/**
1748 * @license
1749 * Copyright 2019 Google LLC
1750 *
1751 * Licensed under the Apache License, Version 2.0 (the "License");
1752 * you may not use this file except in compliance with the License.
1753 * You may obtain a copy of the License at
1754 *
1755 *   http://www.apache.org/licenses/LICENSE-2.0
1756 *
1757 * Unless required by applicable law or agreed to in writing, software
1758 * distributed under the License is distributed on an "AS IS" BASIS,
1759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1760 * See the License for the specific language governing permissions and
1761 * limitations under the License.
1762 */class l5{constructor(e,r){this.storageRetriever=e,this.type=r}_isAvailable(){try{return this.storage?(this.storage.setItem(jg,"1"),this.storage.removeItem(jg),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,r){return this.storage.setItem(e,JSON.stringify(r)),Promise.resolve()}_get(e){const r=this.storage.getItem(e);return Promise.resolve(r?JSON.parse(r):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1763 * @license
1764 * Copyright 2020 Google LLC
1765 *
1766 * Licensed under the Apache License, Version 2.0 (the "License");
1767 * you may not use this file except in compliance with the License.
1768 * You may obtain a copy of the License at
1769 *
1770 *   http://www.apache.org/licenses/LICENSE-2.0
1771 *
1772 * Unless required by applicable law or agreed to in writing, software
1773 * distributed under the License is distributed on an "AS IS" BASIS,
1774 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1775 * See the License for the specific language governing permissions and
1776 * limitations under the License.
1777 */const YH=1e3,QH=10;class c5 extends l5{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,r)=>this.onStorageEvent(e,r),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Z3(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const r of Object.keys(this.listeners)){const n=this.storage.getItem(r),s=this.localCache[r];n!==s&&e(r,s,n)}}onStorageEvent(e,r=!1){if(!e.key){this.forAllChangedKeys((o,l,c)=>{this.notifyListeners(o,c)});return}const n=e.key;r?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(n);!r&&this.localCache[n]===o||this.notifyListeners(n,o)},i=this.storage.getItem(n);dH()&&i!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,QH):s()}notifyListeners(e,r){this.localCache[e]=r;const n=this.listeners[e];if(n)for(const s of Array.from(n))s(r&&JSON.parse(r))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,r,n)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:r,newValue:n}),!0)})},YH)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,r){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(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1777ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,r){await super._set(e,r),this.localCache[e]=JSON.stringify(r)}async _get(e){const r=await super._get(e);return this.localCache[e]=JSON.stringify(r),r}async _remove(e){await super._remove(e),delete this.localCache[e]}}c5.type="LOCAL";const JH=c5;/**
1778 * @license
1779 * Copyright 2020 Google LLC
1780 *
1781 * Licensed under the Apache License, Version 2.0 (the "License");
1782 * you may not use this file except in compliance with the License.
1783 * You may obtain a copy of the License at
1784 *
1785 *   http://www.apache.org/licenses/LICENSE-2.0
1786 *
1787 * Unless required by applicable law or agreed to in writing, software
1788 * distributed under the License is distributed on an "AS IS" BASIS,
1789 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1790 * See the License for the specific language governing permissions and
1791 * limitations under the License.
1792 */class u5 extends l5{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,r){}_removeListener(e,r){}}u5.type="SESSION";
1792const d5=u5;/**
1793 * @license
1794 * Copyright 2019 Google LLC
1795 *
1796 * Licensed under the Apache License, Version 2.0 (the "License");
1797 * you may not use this file except in compliance with the License.
1798 * You may obtain a copy of the License at
1799 *
1800 *   http://www.apache.org/licenses/LICENSE-2.0
1801 *
1802 * Unless required by applicable law or agreed to in writing, software
1803 * distributed under the License is distributed on an "AS IS" BASIS,
1804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1805 * See the License for the specific language governing permissions and
1806 * limitations under the License.
1807 */function ZH(t){return Promise.all(t.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(r){return{fulfilled:!1,reason:r}}}))}/**
1808 * @license
1809 * Copyright 2019 Google LLC
1810 *
1811 * Licensed under the Apache License, Version 2.0 (the "License");
1812 * you may not use this file except in compliance with the License.
1813 * You may obtain a copy of the License at
1814 *
1815 *   http://www.apache.org/licenses/LICENSE-2.0
1816 *
1817 * Unless required by applicable law or agreed to in writing, software
1818 * distributed under the License is distributed on an "AS IS" BASIS,
1819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1820 * See the License for the specific language governing permissions and
1821 * limitations under the License.
1822 */class my{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const r=this.receivers.find(s=>s.isListeningto(e));if(r)return r;const n=new my(e);return this.receivers.push(n),n}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const r=e,{eventId:n,eventType:s,data:i}=r.data,o=this.handlersMap[s];if(!(o!=null&&o.size))return;r.ports[0].postMessage({status:"ack",eventId:n,eventType:s});const l=Array.from(o).map(async u=>u(r.origin,i)),c=await ZH(l);r.ports[0].postMessage({status:"done",eventId:n,eventType:s,response:c})}_subscribe(e,r){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(r)}_unsubscribe(e,r){this.handlersMap[e]&&r&&this.handlersMap[e].delete(r),(!r||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}my.receivers=[];/**
1823 * @license
1824 * Copyright 2020 Google LLC
1825 *
1826 * Licensed under the Apache License, Version 2.0 (the "License");
1827 * you may not use this file except in compliance with the License.
1828 * You may obtain a copy of the License at
1829 *
1830 *   http://www.apache.org/licenses/LICENSE-2.0
1831 *
1832 * Unless required by applicable law or agreed to in writing, software
1833 * distributed under the License is distributed on an "AS IS" BASIS,
1834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1835 * See the License for the specific language governing permissions and
1836 * limitations under the License.
1837 */function FN(t="",e=10){let r="";for(let n=0;n<e;n++)r+=Math.floor(Math.random()*10);return t+r}/**
1838 * @license
1839 * Copyright 2019 Google LLC
1840 *
1841 * Licensed under the Apache License, Version 2.0 (the "License");
1842 * you may not use this file except in compliance with the License.
1843 * You may obtain a copy of the License at
1844 *
1845 *   http://www.apache.org/licenses/LICENSE-2.0
1846 *
1847 * Unless required by applicable law or agreed to in writing, software
1848 * distributed under the License is distributed on an "AS IS" BASIS,
1849 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1850 * See the License for the specific language governing permissions and
1851 * limitations under the License.
1852 */class eq{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,r,n=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let i,o;return new Promise((l,c)=>{const u=FN("",20);s.port1.start();const d=setTimeout(()=>{c(new Error("unsupported_event"))},n);o={messageChannel:s,onMessage(h){const m=h;if(m.data.eventId===u)switch(m.data.status){case"ack":clearTimeout(d),i=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(i),l(m.data.response);break;default:clearTimeout(d),clearTimeout(i),c(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:u,data:r},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1853 * @license
1854 * Copyright 2020 Google LLC
1855 *
1856 * Licensed under the Apache License, Version 2.0 (the "License");
1857 * you may not use this file except in compliance with the License.
1858 * You may obtain a copy of the License at
1859 *
1860 *   http://www.apache.org/licenses/LICENSE-2.0
1861 *
1862 * Unless required by applicable law or agreed to in writing, software
1863 * distributed under the License is distributed on an "AS IS" BASIS,
1864 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1865 * See the License for the specific language governing permissions and
1866 * limitations under the License.
1867 */function La(){return window}function tq(t){La().location.href=t}/**
1868 * @license
1869 * Copyright 2020 Google LLC.
1870 *
1871 * Licensed under the Apache License, Version 2.0 (the "License");
1872 * you may not use this file except in compliance with the License.
1873 * You may obtain a copy of the License at
1874 *
1875 *   http://www.apache.org/licenses/LICENSE-2.0
1876 *
1877 * Unless required by applicable law or agreed to in writing, software
1878 * distributed under the License is distributed on an "AS IS" BASIS,
1879 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1880 * See the License for the specific language governing permissions and
1881 * limitations under the License.
1882 */function h5(){return typeof La().WorkerGlobalScope<"u"&&typeof La().importScripts=="function"}async function rq(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function nq(){var t;return((t=navigator==null?void 0:navigator.serviceWorker)===null||t===void 0?void 0:t.controller)||null}function aq(){return h5()?self:null}/**
1883 * @license
1884 * Copyright 2019 Google LLC
1885 *
1886 * Licensed under the Apache License, Version 2.0 (the "License");
1887 * you may not use this file except in compliance with the License.
1888 * You may obtain a copy of the License at
1889 *
1890 *   http://www.apache.org/licenses/LICENSE-2.0
1891 *
1892 * Unless required by applicable law or agreed to in writing, software
1893 * distributed under the License is distributed on an "AS IS" BASIS,
1894 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1895 * See the License for the specific language governing permissions and
1896 * limitations under the License.
1897 */const m5="firebaseLocalStorageDb",sq=1,Ng="firebaseLocalStorage",f5="fbase_key";class Mm{constructor(e){this.request=e}toPromise(){return new Promise((e,r)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{r(this.request.error)})})}}function fy(t,e){return t.transaction([Ng],e?"readwrite":"readonly").objectStore(Ng)}function iq(){const t=indexedDB.deleteDatabase(m5);return new Mm(t).toPromise()}function Ow(){const t=indexedDB.open(m5,sq);return new Promise((e,r)=>{t.addEventListener("error",()=>{r(t.error)}),t.addEventListener("upgradeneeded",()=>{const n=t.result;try{n.createObjectStore(Ng,{keyPath:f5})}catch(s){r(s)}}),t.addEventListener("success",async()=>{const n=t.result;n.objectStoreNames.contains(Ng)?e(n):(n.close(),await iq(),e(await Ow()))})})}async function GA(t,e,r){const n=fy(t,!0).put({[f5]:e,value:r});return new Mm(n).toPromise()}async function oq(t,e){const r=fy(t,!1).get(e),n=await new Mm(r).toPromise();return n===void 0?null:n.value}function KA(t,e){const r=fy(t,!0).delete(e);return new Mm(r).toPromise()}const lq=800,cq=3;class p5{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 Ow(),this.db)}async _withRetries(e){let r=0;for(;;)try{const n=await this._openDb();return await e(n)}catch(n){if(r++>cq)throw n;this.db&&(this.db.close(),this.db=void 0)}}async initializeServiceWorkerMessaging(){return h5()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=my._getInstance(aq()),this.receiver._subscribe("keyChanged",async(e,r)=>({keyProcessed:(await this._poll()).includes(r.key)})),this.receiver._subscribe("ping",async(e,r)=>["keyChanged"])}async initializeSender(){var e,r;if(this.activeServiceWorker=await rq(),!this.activeServiceWorker)return;this.sender=new eq(this.activeServiceWorker);const n=await this.sender._send("ping",{},800);n&&!((e=n[0])===null||e===void 0)&&e.fulfilled&&!((r=n[0])===null||r===void 0)&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||nq()!==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 Ow();return await GA(e,jg,"1"),await KA(e,jg),!0}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,r){return this._withPendingWrite(async()=>(await this._withRetries(n=>GA(n,e,r)),this.localCache[e]=r,this.notifyServiceWorker(e)))}async _get(e){const r=await this._withRetries(n=>oq(n,e));return this.localCache[e]=r,r}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(r=>KA(r,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){const e=await this._withRetries(s=>{const i=fy(s,!1).getAll();return new Mm(i).toPromise()});if(!e)return[];if(this.pendingWrites!==0)return[];const r=[],n=new Set;if(e.length!==0)for(const{fbase_key:s,value:i}of e)n.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(i)&&(this.notifyListeners(s,i),r.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!n.has(s)&&(this.notifyListeners(s,null),r.push(s));return r}notifyListeners(e,r){this.localCache[e]=r;
1897const n=this.listeners[e];if(n)for(const s of Array.from(n))s(r)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),lq)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,r){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(r)}_removeListener(e,r){this.listeners[e]&&(this.listeners[e].delete(r),this.listeners[e].size===0&&delete this.listeners[e]),Object.keys(this.listeners).length===0&&this.stopPolling()}}p5.type="LOCAL";const uq=p5;new Om(3e4,6e4);/**
1898 * @license
1899 * Copyright 2021 Google LLC
1900 *
1901 * Licensed under the Apache License, Version 2.0 (the "License");
1902 * you may not use this file except in compliance with the License.
1903 * You may obtain a copy of the License at
1904 *
1905 *   http://www.apache.org/licenses/LICENSE-2.0
1906 *
1907 * Unless required by applicable law or agreed to in writing, software
1908 * distributed under the License is distributed on an "AS IS" BASIS,
1909 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1910 * See the License for the specific language governing permissions and
1911 * limitations under the License.
1912 */function dq(t,e){return e?ds(e):(ke(t._popupRedirectResolver,t,"argument-error"),t._popupRedirectResolver)}/**
1913 * @license
1914 * Copyright 2019 Google LLC
1915 *
1916 * Licensed under the Apache License, Version 2.0 (the "License");
1917 * you may not use this file except in compliance with the License.
1918 * You may obtain a copy of the License at
1919 *
1920 *   http://www.apache.org/licenses/LICENSE-2.0
1921 *
1922 * Unless required by applicable law or agreed to in writing, software
1923 * distributed under the License is distributed on an "AS IS" BASIS,
1924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1925 * See the License for the specific language governing permissions and
1926 * limitations under the License.
1927 */class BN extends $N{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return yc(e,this._buildIdpRequest())}_linkToIdToken(e,r){return yc(e,this._buildIdpRequest(r))}_getReauthenticationResolver(e){return yc(e,this._buildIdpRequest())}_buildIdpRequest(e){const r={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&&(r.idToken=e),r}}function hq(t){return s5(t.auth,new BN(t),t.bypassAuthState)}function mq(t){const{auth:e,user:r}=t;return ke(r,e,"internal-error"),BH(r,new BN(t),t.bypassAuthState)}async function fq(t){const{auth:e,user:r}=t;return ke(r,e,"internal-error"),FH(r,new BN(t),t.bypassAuthState)}/**
1928 * @license
1929 * Copyright 2020 Google LLC
1930 *
1931 * Licensed under the Apache License, Version 2.0 (the "License");
1932 * you may not use this file except in compliance with the License.
1933 * You may obtain a copy of the License at
1934 *
1935 *   http://www.apache.org/licenses/LICENSE-2.0
1936 *
1937 * Unless required by applicable law or agreed to in writing, software
1938 * distributed under the License is distributed on an "AS IS" BASIS,
1939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1940 * See the License for the specific language governing permissions and
1941 * limitations under the License.
1942 */class g5{constructor(e,r,n,s,i=!1){this.auth=e,this.resolver=n,this.user=s,this.bypassAuthState=i,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(r)?r:[r]}execute(){return new Promise(async(e,r)=>{this.pendingPromise={resolve:e,reject:r};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(n){this.reject(n)}})}async onAuthEvent(e){const{urlResponse:r,sessionId:n,postBody:s,tenantId:i,error:o,type:l}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:r,sessionId:n,tenantId:i||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(l)(c))}catch(u){this.reject(u)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return hq;case"linkViaPopup":case"linkViaRedirect":return fq;
1942case"reauthViaPopup":case"reauthViaRedirect":return mq;default:ya(this.auth,"internal-error")}}resolve(e){As(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){As(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()}}/**
1943 * @license
1944 * Copyright 2020 Google LLC
1945 *
1946 * Licensed under the Apache License, Version 2.0 (the "License");
1947 * you may not use this file except in compliance with the License.
1948 * You may obtain a copy of the License at
1949 *
1950 *   http://www.apache.org/licenses/LICENSE-2.0
1951 *
1952 * Unless required by applicable law or agreed to in writing, software
1953 * distributed under the License is distributed on an "AS IS" BASIS,
1954 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1955 * See the License for the specific language governing permissions and
1956 * limitations under the License.
1957 */const pq=new Om(2e3,1e4);class ec extends g5{constructor(e,r,n,s,i){super(e,r,s,i),this.provider=n,this.authWindow=null,this.pollId=null,ec.currentPopupAction&&ec.currentPopupAction.cancel(),ec.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return ke(e,this.auth,"internal-error"),e}async onExecution(){As(this.filter.length===1,"Popup operations only handle one event");const e=FN();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(r=>{this.reject(r)}),this.resolver._isIframeWebStorageSupported(this.auth,r=>{r||this.reject($a(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($a(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,ec.currentPopupAction=null}pollUserCancellation(){const e=()=>{var r,n;if(!((n=(r=this.authWindow)===null||r===void 0?void 0:r.window)===null||n===void 0)&&n.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject($a(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,pq.get())};e()}}ec.currentPopupAction=null;/**
1958 * @license
1959 * Copyright 2020 Google LLC
1960 *
1961 * Licensed under the Apache License, Version 2.0 (the "License");
1962 * you may not use this file except in compliance with the License.
1963 * You may obtain a copy of the License at
1964 *
1965 *   http://www.apache.org/licenses/LICENSE-2.0
1966 *
1967 * Unless required by applicable law or agreed to in writing, software
1968 * distributed under the License is distributed on an "AS IS" BASIS,
1969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1970 * See the License for the specific language governing permissions and
1971 * limitations under the License.
1972 */const gq="pendingRedirect",Cp=new Map;class xq extends g5{constructor(e,r,n=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],r,void 0,n),this.eventId=null}async execute(){let e=Cp.get(this.auth._key());if(!e){try{const n=await yq(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(n)}catch(r){e=()=>Promise.reject(r)}Cp.set(this.auth._key(),e)}return this.bypassAuthState||Cp.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 r=await this.auth._redirectUserForId(e.eventId);if(r)return this.user=r,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function yq(t,e){const r=wq(e),n=bq(t);if(!await n._isAvailable())return!1;const s=await n._get(r)==="true";return await n._remove(r),s}function vq(t,e){Cp.set(t._key(),e)}function bq(t){return ds(t._redirectPersistence)}function wq(t){return Pp(gq,t.config.apiKey,t.name)}
1972async function jq(t,e,r=!1){if(Ca(t.app))return Promise.reject(ys(t));const n=Hi(t),s=dq(n,e),o=await new xq(n,s,r).execute();return o&&!r&&(delete o.user._redirectEventId,await n._persistUserIfCurrent(o.user),await n._setRedirectUser(null,e)),o}/**
1973 * @license
1974 * Copyright 2020 Google LLC
1975 *
1976 * Licensed under the Apache License, Version 2.0 (the "License");
1977 * you may not use this file except in compliance with the License.
1978 * You may obtain a copy of the License at
1979 *
1980 *   http://www.apache.org/licenses/LICENSE-2.0
1981 *
1982 * Unless required by applicable law or agreed to in writing, software
1983 * distributed under the License is distributed on an "AS IS" BASIS,
1984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1985 * See the License for the specific language governing permissions and
1986 * limitations under the License.
1987 */const Nq=10*60*1e3;class _q{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 r=!1;return this.consumers.forEach(n=>{this.isEventForConsumer(e,n)&&(r=!0,this.sendToConsumer(e,n),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!Sq(e)||(this.hasHandledPotentialRedirect=!0,r||(this.queuedRedirectEvent=e,r=!0)),r}sendToConsumer(e,r){var n;if(e.error&&!x5(e)){const s=((n=e.error.code)===null||n===void 0?void 0:n.split("auth/")[1])||"internal-error";r.onError($a(this.auth,s))}else r.onAuthEvent(e)}isEventForConsumer(e,r){const n=r.eventId===null||!!e.eventId&&e.eventId===r.eventId;return r.filter.includes(e.type)&&n}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=Nq&&this.cachedEventUids.clear(),this.cachedEventUids.has(XA(e))}saveEventToCache(e){this.cachedEventUids.add(XA(e)),this.lastProcessedEventTime=Date.now()}}function XA(t){return[t.type,t.eventId,t.sessionId,t.tenantId].filter(e=>e).join("-")}function x5({type:t,error:e}){return t==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function Sq(t){switch(t.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return x5(t);default:return!1}}/**
1988 * @license
1989 * Copyright 2020 Google LLC
1990 *
1991 * Licensed under the Apache License, Version 2.0 (the "License");
1992 * you may not use this file except in compliance with the License.
1993 * You may obtain a copy of the License at
1994 *
1995 *   http://www.apache.org/licenses/LICENSE-2.0
1996 *
1997 * Unless required by applicable law or agreed to in writing, software
1998 * distributed under the License is distributed on an "AS IS" BASIS,
1999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2000 * See the License for the specific language governing permissions and
2001 * limitations under the License.
2002 */async function Tq(t,e={}){return Qa(t,"GET","/v1/projects",e)}/**
2003 * @license
2004 * Copyright 2020 Google LLC
2005 *
2006 * Licensed under the Apache License, Version 2.0 (the "License");
2007 * you may not use this file except in compliance with the License.
2008 * You may obtain a copy of the License at
2009 *
2010 *   http://www.apache.org/licenses/LICENSE-2.0
2011 *
2012 * Unless required by applicable law or agreed to in writing, software
2013 * distributed under the License is distributed on an "AS IS" BASIS,
2014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2015 * See the License for the specific language governing permissions and
2016 * limitations under the License.
2017 */const Aq=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,Eq=/^https?/;async function kq(t){if(t.config.emulator)return;const{authorizedDomains:e}=await Tq(t);for(const r of e)try{if(Pq(r))return}catch{}ya(t,"unauthorized-domain")}function Pq(t){const e=Cw(),{protocol:r,hostname:n}=new URL(e);if(t.startsWith("chrome-extension://")){const o=new URL(t);return o.hostname===""&&n===""?r==="chrome-extension:"&&t.replace("chrome-extension://","")===e.replace("chrome-extension://",""):r==="chrome-extension:"&&o.hostname===n}if(!Eq.test(r))return!1;if(Aq.test(t))return n===t;const s=t.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(n)}/**
2018 * @license
2019 * Copyright 2020 Google LLC.
2020 *
2021 * Licensed under the Apache License, Version 2.0 (the "License");
2022 * you may not use this file except in compliance with the License.
2023 * You may obtain a copy of the License at
2024 *
2025 *   http://www.apache.org/licenses/LICENSE-2.0
2026 *
2027 * Unless required by applicable law or agreed to in writing, software
2028 * distributed under the License is distributed on an "AS IS" BASIS,
2029 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2030 * See the License for the specific language governing permissions and
2031 * limitations under the License.
2032 */const Cq=new Om(3e4,6e4);function YA(){const t=La().___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 r=0;r<t.CP.length;r++)t.CP[r]=null}}function Iq(t){return new Promise((e,r)=>{var n,s,i;function o(){YA(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{YA(),r($a(t,"network-request-failed"))},timeout:Cq.get()})}if(!((s=(n=La().gapi)===null||n===void 0?void 0:n.iframes)===null||s===void 0)&&s.Iframe)e(gapi.iframes.getContext());else if(!((i=La().gapi)===null||i===void 0)&&i.load)o();else{const l=bH("iframefcb");return La()[l]=()=>{gapi.load?o():r($a(t,"network-request-failed"))},t5(`${vH()}?onload=${l}`).catch(c=>r(c))}}).catch(e=>{throw Ip=null,e})}let Ip=null;function Oq(t){return Ip=Ip||Iq(t),Ip}/**
2033 * @license
2034 * Copyright 2020 Google LLC.
2035 *
2036 * Licensed under the Apache License, Version 2.0 (the "License");
2037 * you may not use this file except in compliance with the License.
2038 * You may obtain a copy of the License at
2039 *
2040 *   http://www.apache.org/licenses/LICENSE-2.0
2041 *
2042 * Unless required by applicable law or agreed to in writing, software
2043 * distributed under the License is distributed on an "AS IS" BASIS,
2044 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2045 * See the License for the specific language governing permissions and
2046 * limitations under the License.
2047 */const Rq=new Om(5e3,15e3),Dq="__/auth/iframe",Mq="emulator/auth/iframe",$q={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Lq=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Fq(t){const e=t.config;ke(e.authDomain,t,"auth-domain-config-required");const r=e.emulator?RN(e,Mq):`https://${t.config.authDomain}/${Dq}`,n={apiKey:e.apiKey,appName:t.name,v:xl},s=Lq.get(t.config.apiHost);s&&(n.eid=s);const i=t._getFrameworks();return i.length&&(n.fw=i.join(",")),`${r}?${Im(n).slice(1)}`}async function Bq(t){const e=await Oq(t),r=La().gapi;return ke(r,t,"internal-error"),e.open({where:document.body,url:Fq(t),messageHandlersFilter:r.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:$q,dontclear:!0},n=>new Promise(async(s,i)=>{await n.restyle({setHideOnLeave:!1});const o=$a(t,"network-request-failed"),l=La().setTimeout(()=>{i(o)},Rq.get());function c(){La().clearTimeout(l),s(n)}n.ping(c).then(c,()=>{i(o)})}))}/**
2048 * @license
2049 * Copyright 2020 Google LLC.
2050 *
2051 * Licensed under the Apache License, Version 2.0 (the "License");
2052 * you may not use this file except in compliance with the License.
2053 * You may obtain a copy of the License at
2054 *
2055 *   http://www.apache.org/licenses/LICENSE-2.0
2056 *
2057 * Unless required by applicable law or agreed to in writing, software
2058 * distributed under the License is distributed on an "AS IS" BASIS,
2059 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2060 * See the License for the specific language governing permissions and
2061 * limitations under the License.
2062 */const Vq={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Uq=500,zq=600,Hq="_blank",qq="http://localhost";class QA{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Wq(t,e,r,n=Uq,s=zq){const i=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-n)/2,0).toString();let l="";const c=Object.assign(Object.assign({},Vq),{width:n.toString(),height:s.toString(),top:i,left:o}),u=Kr().toLowerCase();r&&(l=K3(u)?Hq:r),W3(u)&&(e=e||qq,c.scrollbars="yes");const d=Object.entries(c).reduce((m,[p,x])=>`${m}${p}=${x},`,"");if(uH(u)&&l!=="_self")return Gq(e||"",l),new QA(null);const h=window.open(e||"",l,d);ke(h,t,"popup-blocked");try{h.focus()}catch{}return new QA(h)}function Gq(t,e){const r=document.createElement("a");r.href=t,r.target=e;const n=document.createEvent("MouseEvent");
2062n.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),r.dispatchEvent(n)}/**
2063 * @license
2064 * Copyright 2021 Google LLC
2065 *
2066 * Licensed under the Apache License, Version 2.0 (the "License");
2067 * you may not use this file except in compliance with the License.
2068 * You may obtain a copy of the License at
2069 *
2070 *   http://www.apache.org/licenses/LICENSE-2.0
2071 *
2072 * Unless required by applicable law or agreed to in writing, software
2073 * distributed under the License is distributed on an "AS IS" BASIS,
2074 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2075 * See the License for the specific language governing permissions and
2076 * limitations under the License.
2077 */const Kq="__/auth/handler",Xq="emulator/auth/handler",Yq=encodeURIComponent("fac");async function JA(t,e,r,n,s,i){ke(t.config.authDomain,t,"auth-domain-config-required"),ke(t.config.apiKey,t,"invalid-api-key");const o={apiKey:t.config.apiKey,appName:t.name,authType:r,redirectUrl:n,v:xl,eventId:s};if(e instanceof n5){e.setDefaultLanguage(t.languageCode),o.providerId=e.providerId||"",CU(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[d,h]of Object.entries({}))o[d]=h}if(e instanceof Dm){const d=e.getScopes().filter(h=>h!=="");d.length>0&&(o.scopes=d.join(","))}t.tenantId&&(o.tid=t.tenantId);const l=o;for(const d of Object.keys(l))l[d]===void 0&&delete l[d];const c=await t._getAppCheckToken(),u=c?`#${Yq}=${encodeURIComponent(c)}`:"";return`${Qq(t)}?${Im(l).slice(1)}${u}`}function Qq({config:t}){return t.emulator?RN(t,Xq):`https://${t.authDomain}/${Kq}`}/**
2078 * @license
2079 * Copyright 2020 Google LLC
2080 *
2081 * Licensed under the Apache License, Version 2.0 (the "License");
2082 * you may not use this file except in compliance with the License.
2083 * You may obtain a copy of the License at
2084 *
2085 *   http://www.apache.org/licenses/LICENSE-2.0
2086 *
2087 * Unless required by applicable law or agreed to in writing, software
2088 * distributed under the License is distributed on an "AS IS" BASIS,
2089 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2090 * See the License for the specific language governing permissions and
2091 * limitations under the License.
2092 */const A0="webStorageSupport";class Jq{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=d5,this._completeRedirectFn=jq,this._overrideRedirectResult=vq}async _openPopup(e,r,n,s){var i;As((i=this.eventManagers[e._key()])===null||i===void 0?void 0:i.manager,"_initialize() not called before _openPopup()");const o=await JA(e,r,n,Cw(),s);return Wq(e,o,FN())}async _openRedirect(e,r,n,s){await this._originValidation(e);const i=await JA(e,r,n,Cw(),s);return tq(i),new Promise(()=>{})}_initialize(e){const r=e._key();if(this.eventManagers[r]){const{manager:s,promise:i}=this.eventManagers[r];return s?Promise.resolve(s):(As(i,"If manager is not set, promise should be"),i)}const n=this.initAndGetManager(e);return this.eventManagers[r]={promise:n},n.catch(()=>{delete this.eventManagers[r]}),n}async initAndGetManager(e){const r=await Bq(e),n=new _q(e);return r.register("authEvent",s=>(ke(s==null?void 0:s.authEvent,e,"invalid-auth-event"),{status:n.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:n},this.iframes[e._key()]=r,n}_isIframeWebStorageSupported(e,r){this.iframes[e._key()].send(A0,{type:A0},s=>{var i;const o=(i=s==null?void 0:s[0])===null||i===void 0?void 0:i[A0];o!==void 0&&r(!!o),ya(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const r=e._key();return this.originValidationPromises[r]||(this.originValidationPromises[r]=kq(e)),this.originValidationPromises[r]}get _shouldInitProactively(){return Z3()||G3()||MN()}}const Zq=Jq;var ZA="@firebase/auth",eE="1.7.9";/**
2093 * @license
2094 * Copyright 2020 Google LLC
2095 *
2096 * Licensed under the Apache License, Version 2.0 (the "License");
2097 * you may not use this file except in compliance with the License.
2098 * You may obtain a copy of the License at
2099 *
2100 *   http://www.apache.org/licenses/LICENSE-2.0
2101 *
2102 * Unless required by applicable law or agreed to in writing, softw
2102are
2103 * distributed under the License is distributed on an "AS IS" BASIS,
2104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2105 * See the License for the specific language governing permissions and
2106 * limitations under the License.
2107 */class eW{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 r=this.auth.onIdTokenChanged(n=>{e((n==null?void 0:n.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,r),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const r=this.internalListeners.get(e);r&&(this.internalListeners.delete(e),r(),this.updateProactiveRefresh())}assertAuthConfigured(){ke(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
2108 * @license
2109 * Copyright 2020 Google LLC
2110 *
2111 * Licensed under the Apache License, Version 2.0 (the "License");
2112 * you may not use this file except in compliance with the License.
2113 * You may obtain a copy of the License at
2114 *
2115 *   http://www.apache.org/licenses/LICENSE-2.0
2116 *
2117 * Unless required by applicable law or agreed to in writing, software
2118 * distributed under the License is distributed on an "AS IS" BASIS,
2119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2120 * See the License for the specific language governing permissions and
2121 * limitations under the License.
2122 */function tW(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 rW(t){xa(new Qn("auth",(e,{options:r})=>{const n=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),i=e.getProvider("app-check-internal"),{apiKey:o,authDomain:l}=n.options;ke(o&&!o.includes(":"),"invalid-api-key",{appName:n.name});const c={apiKey:o,authDomain:l,clientPlatform:t,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:e5(t)},u=new gH(n,s,i,c);return SH(u,r),u},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,r,n)=>{e.getProvider("auth-internal").initialize()})),xa(new Qn("auth-internal",e=>{const r=Hi(e.getProvider("auth").getImmediate());return(n=>new eW(n))(r)},"PRIVATE").setInstantiationMode("EXPLICIT")),pn(ZA,eE,tW(t)),pn(ZA,eE,"esm2017")}/**
2123 * @license
2124 * Copyright 2021 Google LLC
2125 *
2126 * Licensed under the Apache License, Version 2.0 (the "License");
2127 * you may not use this file except in compliance with the License.
2128 * You may obtain a copy of the License at
2129 *
2130 *   http://www.apache.org/licenses/LICENSE-2.0
2131 *
2132 * Unless required by applicable law or agreed to in writing, software
2133 * distributed under the License is distributed on an "AS IS" BASIS,
2134 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2135 * See the License for the specific language governing permissions and
2136 * limitations under the License.
2137 */const nW=5*60,aW=T3("authIdTokenMaxAge")||nW;let tE=null;const sW=t=>async e=>{const r=e&&await e.getIdTokenResult(),n=r&&(new Date().getTime()-Date.parse(r.issuedAtTime))/1e3;if(n&&n>aW)return;const s=r==null?void 0:r.token;tE!==s&&(tE=s,await fetch(t,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function iW(t=dy()){const e=zi(t,"auth");if(e.isInitialized())return e.getImmediate();const r=_H(t,{popupRedirectResolver:Zq,persistence:[uq,JH,d5]}),n=T3("authTokenSyncURL");if(n&&typeof isSecureContext=="boolean"&&isSecureContext){const i=new URL(n,location.origin);if(location.origin===i.origin){const o=sW(i.toString());GH(r,o,()=>o(r.currentUser)),WH(r,l=>o(l))}}const s=N3("auth");return s&&TH(r,`http://${s}`),r}function oW(){var t,e;return(e=(t=document.getElementsByTagName("head"))===null||t===void 0?void 0:t[0])!==null&&e!==void 0?e:document}xH({loadJS(t){return new Promise((e,r)=>{const n=document.createElement("script");n.setAttribute("src",t),n.onload=e,n.onerror=s=>{const i=$a("internal-error");i.customData=s,r(i)},n.type="text/javascript",n.charset="UTF-8",oW().appendChild(n)})},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="});rW("Browser");var lW="firebase",cW="10.14.1";/**
2138 * @license
2139 * Copyright 2020 Google LLC
2140 *
2141 * Licensed under the Apache License, Version 2.0 (the "License");
2142 * you may not use this file except in compliance with the License.
2143 * You may obtain a copy of the License at
2144 *
2145 *   http://www.apache.org/licenses/LICENSE-2.0
2146 *
2147 * Unless required by applicable law or agreed to in writing, software
2148 * distributed under the License is distributed on an "AS IS" BASIS,
2149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2150 * See the License for the specific language governing permissions and
2151 * limitations under the License.
2152 */pn(lW,cW,"app");var rE=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
2153Copyright The Closure Library Authors.
2154SPDX-License-Identifier: Apache-2.0
2155*/var Po,y5;(function(){var t;/** @license
2156
2157 Copyright The Closure Library Authors.
2158 SPDX-License-Identifier: Apache-2.0
2159*/function e(_,S){function k(){}k.prototype=S.prototype,_.D=S.prototype,_.prototype=new k,_.prototype.constructor=_,_.C=function(I,E,C){for(var R=Array(arguments.length-2),W=2;W<arguments.length;W++)R[W-2]=arguments[W];return S.prototype[E].apply(I,R)}}function r(){this.blockSize=-1}function n(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.B=Array(this.blockSize),this.o=this.h=0,this.s()}e(n,r),n.prototype.s=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function s(_,S,k){k||(k=0);var I=Array(16);if(typeof S=="string")for(var E=0;16>E;++E)I[E]=S.charCodeAt(k++)|S.charCodeAt(k++)<<8|S.charCodeAt(k++)<<16|S.charCodeAt(k++)<<24;else for(E=0;16>E;++E)I[E]=S[k++]|S[k++]<<8|S[k++]<<16|S[k++]<<24;S=_.g[0],k=_.g[1],E=_.g[2];var C=_.g[3],R=S+(C^k&(E^C))+I[0]+3614090360&4294967295;S=k+(R<<7&4294967295|R>>>
vendor: 51,374 bytes, lines 2159-2178
215925),R=C+(E^S&(k^E))+I[1]+3905402710&4294967295,C=S+(R<<12&4294967295|R>>>20),R=E+(k^C&(S^k))+I[2]+606105819&4294967295,E=C+(R<<17&4294967295|R>>>15),R=k+(S^E&(C^S))+I[3]+3250441966&4294967295,k=E+(R<<22&4294967295|R>>>10),R=S+(C^k&(E^C))+I[4]+4118548399&4294967295,S=k+(R<<7&4294967295|R>>>25),R=C+(E^S&(k^E))+I[5]+1200080426&4294967295,C=S+(R<<12&4294967295|R>>>20),R=E+(k^C&(S^k))+I[6]+2821735955&4294967295,E=C+(R<<17&4294967295|R>>>15),R=k+(S^E&(C^S))+I[7]+4249261313&4294967295,k=E+(R<<22&4294967295|R>>>10),R=S+(C^k&(E^C))+I[8]+1770035416&4294967295,S=k+(R<<7&4294967295|R>>>25),R=C+(E^S&(k^E))+I[9]+2336552879&4294967295,C=S+(R<<12&4294967295|R>>>20),R=E+(k^C&(S^k))+I[10]+4294925233&4294967295,E=C+(R<<17&4294967295|R>>>15),R=k+(S^E&(C^S))+I[11]+2304563134&4294967295,k=E+(R<<22&4294967295|R>>>10),R=S+(C^k&(E^C))+I[12]+1804603682&4294967295,S=k+(R<<7&4294967295|R>>>25),R=C+(E^S&(k^E))+I[13]+4254626195&4294967295,C=S+(R<<12&4294967295|R>>>20),R=E+(k^C&(S^k))+I[14]+2792965006&4294967295,E=C+(R<<17&4294967295|R>>>15),R=k+(S^E&(C^S))+I[15]+1236535329&4294967295,k=E+(R<<22&4294967295|R>>>10),R=S+(E^C&(k^E))+I[1]+4129170786&4294967295,S=k+(R<<5&4294967295|R>>>27),R=C+(k^E&(S^k))+I[6]+3225465664&4294967295,C=S+(R<<9&4294967295|R>>>23),R=E+(S^k&(C^S))+I[11]+643717713&4294967295,E=C+(R<<14&4294967295|R>>>18),R=k+(C^S&(E^C))+I[0]+3921069994&4294967295,k=E+(R<<20&4294967295|R>>>12),R=S+(E^C&(k^E))+I[5]+3593408605&4294967295,S=k+(R<<5&4294967295|R>>>27),R=C+(k^E&(S^k))+I[10]+38016083&4294967295,C=S+(R<<9&4294967295|R>>>23),R=E+(S^k&(C^S))+I[15]+3634488961&4294967295,E=C+(R<<14&4294967295|R>>>18),R=k+(C^S&(E^C))+I[4]+3889429448&4294967295,k=E+(R<<20&4294967295|R>>>12),R=S+(E^C&(k^E))+I[9]+568446438&4294967295,S=k+(R<<5&4294967295|R>>>27),R=C+(k^E&(S^k))+I[14]+3275163606&4294967295,C=S+(R<<9&4294967295|R>>>23),R=E+(S^k&(C^S))+I[3]+4107603335&4294967295,E=C+(R<<14&4294967295|R>>>18),R=k+(C^S&(E^C))+I[8]+1163531501&4294967295,k=E+(R<<20&4294967295|R>>>12),R=S+(E^C&(k^E))+I[13]+2850285829&4294967295,S=k+(R<<5&4294967295|R>>>27),R=C+(k^E&(S^k))+I[2]+4243563512&4294967295,C=S+(R<<9&4294967295|R>>>23),R=E+(S^k&(C^S))+I[7]+1735328473&4294967295,E=C+(R<<14&4294967295|R>>>18),R=k+(C^S&(E^C))+I[12]+2368359562&4294967295,k=E+(R<<20&4294967295|R>>>12),R=S+(k^E^C)+I[5]+4294588738&4294967295,S=k+(R<<4&4294967295|R>>>28),R=C+(S^k^E)+I[8]+2272392833&4294967295,C=S+(R<<11&4294967295|R>>>21),R=E+(C^S^k)+I[11]+1839030562&4294967295,E=C+(R<<16&4294967295|R>>>16),R=k+(E^C^S)+I[14]+4259657740&4294967295,k=E+(R<<23&4294967295|R>>>9),R=S+(k^E^C)+I[1]+2763975236&4294967295,S=k+(R<<4&4294967295|R>>>28),R=C+(S^k^E)+I[4]+1272893353&4294967295,C=S+(R<<11&4294967295|R>>>21),R=E+(C^S^k)+I[7]+4139469664&4294967295,E=C+(R<<16&4294967295|R>>>16),R=k+(E^C^S)+I[10]+3200236656&4294967295,k=E+(R<<23&4294967295|R>>>9),R=S+(k^E^C)+I[13]+681279174&4294967295,S=k+(R<<4&4294967295|R>>>28),R=C+(S^k^E)+I[0]+3936430074&4294967295,C=S+(R<<11&4294967295|R>>>21),R=E+(C^S^k)+I[3]+3572445317&4294967295,E=C+(R<<16&4294967295|R>>>16),R=k+(E^C^S)+I[6]+76029189&4294967295,k=E+(R<<23&4294967295|R>>>9),R=S+(k^E^C)+I[9]+3654602809&4294967295,S=k+(R<<4&4294967295|R>>>28),R=C+(S^k^E)+I[12]+3873151461&4294967295,C=S+(R<<11&4294967295|R>>>21),R=E+(C^S^k)+I[15]+530742520&4294967295,E=C+(R<<16&4294967295|R>>>16),R=k+(E^C^S)+I[2]+3299628645&4294967295,k=E+(R<<23&4294967295|R>>>9),R=S+(E^(k|~C))+I[0]+4096336452&4294967295,S=k+(R<<6&4294967295|R>>>26),R=C+(k^(S|~E))+I[7]+1126891415&4294967295,C=S+(R<<10&4294967295|R>>>22),R=E+(S^(C|~k))+I[14]+2878612391&4294967295,E=C+(R<<15&4294967295|R>>>17),R=k+(C^(E|~S))+I[5]+4237533241&4294967295,k=E+(R<<21&4294967295|R>>>11),R=S+(E^(k|~C))+I[12]+1700485571&4294967295,S=k+(R<<6&4294967295|R>>>26),R=C+(k^(S|~E))+I[3]+2399980690&4294967295,C=S+(R<<10&4294967295|R>>>22),R=E+(S^(C|~k))+I[10]+4293915773&4294967295,E=C+(R<<15&4294967295|R>>>17),R=k+(C^(E|~S))+I[1]+2240044497&4294967295,k=E+(R<<21&4294967295|R>>>11),R=S+(E^(k|~C))+I[8]+1873313359&4294967295,S=k+(R<<6&4294967295|R>>>26),R=C+(k^(S|~E))+I[15]+4264355552&4294967295,C=S+(R<<10&4294967295|R>>>22),R=E+(S^(C|~k))+I[6]+2734768916&4294967295,E=C+(R<<15&4294967295|R>>>17),R=k+(C^(E|~S))+I[13]+1309151649&4294967295,k=E+(R<<21&4294967295|R>>>11),R=S+(E^(k|~C))+I[4]+4149444226&4294967295,S=k+(R<<6&4294967295|R>>>26),R=C+(k^(S|~E))+I[11]+3174756917&4294967295,C=S+(R<<10&4294967295|R>>>22),R=E+(S^(C|~k))+I[2]+718787259&4294967295,E=C+(R<<15&4294967295|R>>>17),R=k+(C^(E|~S))+I[9]+3951481745&4294967295,_.g[0]=_.g[0]+S&4294967295,_.g[1]=_.g[1]+(E+(R<<21&4294967295|R>>>11))&4294967295,_.g[2]=_.g[2]+E&4294967295,_.g[3]=_.g[3]+C&4294967295}n.prototype.u=function(_,S){S===void 0&&(S=_.length);for(var k=S-this.blockSize,I=this.B,E=this.h,C=0;C<S;){if(E==0)for(;C<=k;)s(this,_,C),C+=this.blockSize;if(typeof _=="string"){for(;C<S;)if(I[E++]=_.charCodeAt(C++),E==this.blockSize){s(this,I),E=0;break}}else for(;C<S;)if(I[E++]=_[C++],E==this.blockSize){s(this,I),E=0;break}}this.h=E,this.o+=S},n.prototype.v=function(){var _=Array((56>this.h?this.blockSize:2*this.blockSize)-this.h);_[0]=128;for(var S=1;S<_.length-8;++S)_[S]=0;var k=8*this.o;for(S=_.length-8;S<_.length;++S)_[S]=k&255,k/=256;for(this.u(_),_=Array(16),S=k=0;4>S;++S)for(var I=0;32>I;I+=8)_[k++]=this.g[S]>>>I&255;return _};function i(_,S){var k=l;return Object.prototype.hasOwnProperty.call(k,_)?k[_]:k[_]=S(_)}function o(_,S){this.h=S;for(var k=[],I=!0,E=_.length-1;0<=E;E--){var C=_[E]|0;I&&C==S||(k[E]=C,I=!1)}this.g=k}var l={};function c(_){return-128<=_&&128>_?i(_,function(S){return new o([S|0],0>S?-1:0)}):new o([_|0],0>_?-1:0)}function u(_){if(isNaN(_)||!isFinite(_))return h;if(0>_)return g(u(-_));for(var S=[],k=1,I=0;_>=k;I++)S[I]=_/k|0,k*=4294967296;return new o(S,0)}function d(_,S){if(_.length==0)throw Error("number format error: empty string");if(S=S||10,2>S||36<S)throw Error("radix out of range: "+S);if(_.charAt(0)=="-")return g(d(_.substring(1),S));if(0<=_.indexOf("-"))throw Error('number format error: interior "-" character');for(var k=u(Math.pow(S,8)),I=h,E=0;E<_.length;E+=8){var C=Math.min(8,_.length-E),R=parseInt(_.substring(E,E+C),S);8>C?(C=u(Math.pow(S,C)),I=I.j(C).add(u(R))):(I=I.j(k),I=I.add(u(R)))}return I}var h=c(0),m=c(1),p=c(16777216);t=o.prototype,t.m=function(){if(w(this))return-g(this).m();for(var _=0,S=1,k=0;k<this.g.length;k++){var I=this.i(k);_+=(0<=I?I:4294967296+I)*S,S*=4294967296}return _},t.toString=function(_){if(_=_||10,2>_||36<_)throw Error("radix out of range: "+_);if(x(this))return"0";if(w(this))return"-"+g(this).toString(_);for(var S=u(Math.pow(_,6)),k=this,I="";;){var E=T(k,S).g;k=v(k,E.j(S));var C=((0<k.g.length?k.g[0]:k.h)>>>0).toString(_);if(k=E,x(k))return C+I;for(;6>C.length;)C="0"+C;I=C+I}},t.i=function(_){return 0>_?0:_<this.g.length?this.g[_]:this.h};function x(_){if(_.h!=0)return!1;for(var S=0;S<_.g.length;S++)if(_.g[S]!=0)return!1;return!0}function w(_){return _.h==-1}t.l=function(_){return _=v(this,_),w(_)?-1:x(_)?0:1};function g(_){for(var S=_.g.length,k=[],I=0;I<S;I++)k[I]=~_.g[I];return new o(k,~_.h).add(m)}t.abs=function(){return w(this)?g(this):this},t.add=function(_){for(var S=Math.max(this.g.length,_.g.length),k=[],I=0,E=0;E<=S;E++){var C=I+(this.i(E)&65535)+(_.i(E)&65535),R=(C>>>16)+(this.i(E)>>>16)+(_.i(E)>>>16);I=R>>>16,C&=65535,R&=65535,k[E]=R<<16|C}return new o(k,k[k.length-1]&-2147483648?-1:0)};function v(_,S){return _.add(g(S))}t.j=function(_){if(x(this)||x(_))return h;if(w(this))return w(_)?g(this).j(g(_)):g(g(this).j(_));if(w(_))return g(this.j(g(_)));if(0>this.l(p)&&0>_.l(p))return u(this.m()*_.m());for(var S=this.g.length+_.g.length,k=[],I=0;I<2*S;I++)k[I]=0;for(I=0;I<this.g.length;I++)for(var E=0;E<_.g.length;E++){var C=this.i(I)>>>16,R=this.i(I)&65535,W=_.i(E)>>>16,M=_.i(E)&65535;k[2*I+2*E]+=R*M,b(k,2*I+2*E),k[2*I+2*E+1]+=C*M,b(k,2*I+2*E+1),k[2*I+2*E+1]+=R*W,b(k,2*I+2*E+1),k[2*I+2*E+2]+=C*W,b(k,2*I+2*E+2)}for(I=0;I<S;I++)k[I]=k[2*I+1]<<16|k[2*I];for(I=S;I<2*S;I++)k[I]=0;return new o(k,0)};function b(_,S){for(;(_[S]&65535)!=_[S];)_[S+1]+=_[S]>>>16,_[S]&=65535,S++}function y(_,S){this.g=_,this.h=S}function T(_,S){if(x(S))throw Error("division by zero");if(x(_))return new y(h,h);if(w(_))return S=T(g(_),S),new y(g(S.g),g(S.h));if(w(S))return S=T(_,g(S)),new y(g(S.g),S.h);if(30<_.g.length){if(w(_)||w(S))throw Error("slowDivide_ only works with positive integers.");for(var k=m,I=S;0>=I.l(_);)k=N(k),I=N(I);var E=j(k,1),C=j(I,1);for(I=j(I,2),k=j(k,2);!x(I);){var R=C.add(I);0>=R.l(_)&&(E=E.add(k),C=R),I=j(I,1),k=j(k,1)}return S=v(_,E.j(S)),new y(E,S)}for(E=h;0<=_.l(S);){for(k=Math.max(1,Math.floor(_.m()/S.m())),I=Math.ceil(Math.log(k)/Math.LN2),I=48>=I?1:Math.pow(2,I-48),C=u(k),R=C.j(S);w(R)||0<R.l(_);)k-=I,C=u(k),R=C.j(S);x(C)&&(C=m),E=E.add(C),_=v(_,R)}return new y(E,_)}t.A=function(_){return T(this,_).h},t.and=function(_){for(var S=Math.max(this.g.length,_.g.length),k=[],I=0;I<S;I++)k[I]=this.i(I)&_.i(I);return new o(k,this.h&_.h)},t.or=function(_){for(var S=Math.max(this.g.length,_.g.length),k=[],I=0;I<S;I++)k[I]=this.i(I)|_.i(I);return new o(k,this.h|_.h)},t.xor=function(_){for(var S=Math.max(this.g.length,_.g.length),k=[],I=0;I<S;I++)k[I]=this.i(I)^_.i(I);return new o(k,this.h^_.h)};function N(_){for(var S=_.g.length+1,k=[],I=0;I<S;I++)k[I]=_.i(I)<<1|_.i(I-1)>>>31;return new o(k,_.h)}function j(_,S){var k=S>>5;S%=32;for(var I=_.g.length-k,E=[],C=0;C<I;C++)E[C]=0<S?_.i(C+k)>>>S|_.i(C+k+1)<<32-S:_.i(C+k);return new o(E,_.h)}n.prototype.digest=n.prototype.v,n.prototype.reset=n.prototype.s,n.prototype.update=n.prototype.u,y5=n,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,Po=o}).apply(typeof rE<"u"?rE:typeof self<"u"?self:typeof window<"u"?window:{});var Uf=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
2160Copyright The Closure Library Authors.
2161SPDX-License-Identifier: Apache-2.0
2162*/var v5,Md,b5,Op,Rw,w5,j5,N5;(function(){var t,e=typeof Object.defineProperties=="function"?Object.defineProperty:function(f,A,O){return f==Array.prototype||f==Object.prototype||(f[A]=O.value),f};function r(f){f=[typeof globalThis=="object"&&globalThis,f,typeof window=="object"&&window,typeof self=="object"&&self,typeof Uf=="object"&&Uf];for(var A=0;A<f.length;++A){var O=f[A];if(O&&O.Math==Math)return O}throw Error("Cannot find global object")}var n=r(this);function s(f,A){if(A)e:{var O=n;f=f.split(".");for(var $=0;$<f.length-1;$++){var G=f[$];if(!(G in O))break e;O=O[G]}f=f[f.length-1],$=O[f],A=A($),A!=$&&A!=null&&e(O,f,{configurable:!0,writable:!0,value:A})}}function i(f,A){f instanceof String&&(f+="");var O=0,$=!1,G={next:function(){if(!$&&O<f.length){var Y=O++;return{value:A(Y,f[Y]),done:!1}}return $=!0,{done:!0,value:void 0}}};return G[Symbol.iterator]=function(){return G},G}s("Array.prototype.values",function(f){return f||function(){return i(this,function(A,O){return O})}});/** @license
2163
2164 Copyright The Closure Library Authors.
2165 SPDX-License-Identifier: Apache-2.0
2166*/var o=o||{},l=this||self;function c(f){var A=typeof f;return A=A!="object"?A:f?Array.isArray(f)?"array":A:"null",A=="array"||A=="object"&&typeof f.length=="number"}function u(f){var A=typeof f;return A=="object"&&f!=null||A=="function"}function d(f,A,O){return f.call.apply(f.bind,arguments)}function h(f,A,O){if(!f)throw Error();if(2<arguments.length){var $=Array.prototype.slice.call(arguments,2);return function(){var G=Array.prototype.slice.call(arguments);return Array.prototype.unshift.apply(G,$),f.apply(A,G)}}return function(){return f.apply(A,arguments)}}function m(f,A,O){return m=Function.prototype.bind&&Function.prototype.bind.toString().indexOf("native code")!=-1?d:h,m.apply(null,arguments)}function p(f,A){var O=Array.prototype.slice.call(arguments,1);return function(){var $=O.slice();return $.push.apply($,arguments),f.apply(this,$)}}function x(f,A){function O(){}O.prototype=A.prototype,f.aa=A.prototype,f.prototype=new O,f.prototype.constructor=f,f.Qb=function($,G,Y){for(var ce=Array(arguments.length-2),gt=2;gt<arguments.length;gt++)ce[gt-2]=arguments[gt];return A.prototype[G].apply($,ce)}}function w(f){const A=f.length;if(0<A){const O=Array(A);for(let $=0;$<A;$++)O[$]=f[$];return O}return[]}function g(f,A){for(let O=1;O<arguments.length;O++){const $=arguments[O];if(c($)){const G=f.length||0,Y=$.length||0;f.length=G+Y;for(let ce=0;ce<Y;ce++)f[G+ce]=$[ce]}else f.push($)}}class v{constructor(A,O){this.i=A,this.j=O,this.h=0,this.g=null}get(){let A;return 0<this.h?(this.h--,A=this.g,this.g=A.next,A.next=null):A=this.i(),A}}function b(f){return/^[\s\xa0]*$/.test(f)}function y(){var f=l.navigator;return f&&(f=f.userAgent)?f:""}function T(f){return T[" "](f),f}T[" "]=function(){};var N=y().indexOf("Gecko")!=-1&&!(y().toLowerCase().indexOf("webkit")!=-1&&y().indexOf("Edge")==-1)&&!(y().indexOf("Trident")!=-1||y().indexOf("MSIE")!=-1)&&y().indexOf("Edge")==-1;function j(f,A,O){for(const $ in f)A.call(O,f[$],$,f)}function _(f,A){for(const O in f)A.call(void 0,f[O],O,f)}function S(f){const A={};for(const O in f)A[O]=f[O];return A}const k="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function I(f,A){let O,$;for(let G=1;G<arguments.length;G++){$=arguments[G];for(O in $)f[O]=$[O];for(let Y=0;Y<k.length;Y++)O=k[Y],Object.prototype.hasOwnProperty.call($,O)&&(f[O]=$[O])}}function E(f){var A=1;f=f.split(":");const O=[];for(;0<A&&f.length;)O.push(f.shift()),A--;return f.length&&O.push(f.join(":")),O}function C(f){l.setTimeout(()=>{throw f},0)}function R(){var f=D;let A=null;return f.g&&(A=f.g,f.g=f.g.next,f.g||(f.h=null),A.next=null),A}class W{constructor(){this.h=this.g=null}add(A,O){const $=M.get();$.set(A,O),this.h?this.h.next=$:this.g=$,this.h=$}}var M=new v(()=>new L,f=>f.reset());class L{constructor(){this.next=this.g=this.h=null}set(A,O){this.h=A,this.g=O,this.next=null}reset(){this.next=this.g=this.h=null}}let U,V=!1,D=new W,z=()=>{const f=l.Promise.resolve(void 0);U=()=>{f.then(K)}};var K=()=>{for(var f;f=R();){try{f.h.call(f.g)}catch(O){C(O)}var A=M;A.j(f),100>A.h&&(A.h++,f.next=A.g,A.g=f)}V=!1};function q(){this.s=this.s,this.C=this.C}q.prototype.s=!1,q.prototype.ma=function(){this.s||(this.s=!0,this.N())},q.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function H(f,A){this.type=f,this.g=this.target=A,this.defaultPrevented=!1}H.prototype.h=function(){this.defaultPrevented=!0};var ee=function(){if(!l.addEventListener||!Object.defineProperty)return!1;var f=!1,A=Object.defineProperty({},"passive",{get:function(){f=!0}});try{const O=()=>{};l.addEventListener("test",O,A),l.removeEventListener("test",O,A)}catch{}return f}();function de(f,A){if(H.call(this,f?f.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,f){var O=this.type=f.type,$=f.changedTouches&&f.changedTouches.length?f.changedTouches[0]:null;if(this.target=f.target||f.srcElement,this.g=A,A=f.relatedTarget){if(N){e:{try{T(A.nodeName);var G=!0;break e}catch{}G=!1}G||(A=null)}}else O=="mouseover"?A=f.fromElement:O=="mouseout"&&(A=f.toElement);this.relatedTarget=A,$?(this.clientX=$.clientX!==void 0?$.clientX:$.pageX,this.clientY=$.clientY!==void 0?$.clientY:$.pageY,this.screenX=$.screenX||0,this.screenY=$.screenY||0):(this.clientX=f.clientX!==void 0?f.clientX:f.pageX,this.clientY=f.clientY!==void 0?f.clientY:f.pageY,this.screenX=f.screenX||0,this.screenY=f.screenY||0),this.button=f.button,this.key=f.key||"",this.ctrlKey=f.ctrlKey,this.altKey=f.altKey,this.shiftKey=f.shiftKey,this.metaKey=f.metaKey,this.pointerId=f.pointerId||0,this.pointerType=typeof f.pointerType=="string"?f.pointerType:we[f.pointerType]||"",this.state=f.state,this.i=f,f.defaultPrevented&&de.aa.h.call(this)}}x(de,H);var we={2:"touch",3:"pen",4:"mouse"};de.prototype.h=function(){de.aa.h.call(this);var f=this.i;f.preventDefault?f.preventDefault():f.returnValue=!1};var Le="closure_listenable_"+(1e6*Math.random()|0),ze=0;function Q(f,A,O,$,G){this.listener=f,this.proxy=null,this.src=A,this.type=O,this.capture=!!$,this.ha=G,this.key=++ze,this.da=this.fa=!1}function me(f){f.da=!0,f.listener=null,f.proxy=null,f.src=null,f.ha=null}function ve(f){this.src=f,this.g={},this.h=0}ve.prototype.add=function(f,A,O,$,G){var Y=f.toString();f=this.g[Y],f||(f=this.g[Y]=[],this.h++);var ce=X(f,A,$,G);return-1<ce?(A=f[ce],O||(A.fa=!1)):(A=new Q(A,this.src,Y,!!$,G),A.fa=O,f.push(A)),A};function Z(f,A){var O=A.type;if(O in f.g){var $=f.g[O],G=Array.prototype.indexOf.call($,A,void 0),Y;(Y=0<=G)&&Array.prototype.splice.call($,G,1),Y&&(me(A),f.g[O].length==0&&(delete f.g[O],f.h--))}}function X(f,A,O,$){for(var G=0;G<f.length;++G){var Y=f[G];if(!Y.da&&Y.listener==A&&Y.capture==!!O&&Y.ha==$)return G}return-1}var ue="closure_lm_"+(1e6*Math.random()|0),ye={};function B(f,A,O,$,G){if(Array.isArray(A)){for(var Y=0;Y<A.length;Y++)B(f,A[Y],O,$,G);return null}return O=it(O),f&&f[Le]?f.K(A,O,u($)?!!$.capture:!1,G):re(f,A,O,!1,$,G)}function re(f,A,O,$,G,Y){if(!A)throw Error("Invalid event type");var ce=u(G)?!!G.capture:!!G,gt=Ye(f);if(gt||(f[ue]=gt=new ve(f)),O=gt.add(A,O,$,ce,Y),O.proxy)return O;if($=ae(),O.proxy=$,$.src=f,$.listener=O,f.addEventListener)ee||(G=ce),G===void 0&&(G=!1),f.addEventListener(A.toString(),$,G);else if(f.attachEvent)f.attachEvent(Pe(A.toString()),$);else if(f.addListener&&f.removeListener)f.addListener($);else throw Error("addEventListener and attachEvent are unavailable.");return O}function ae(){function f(O){return A.call(f.src,f.listener,O)}const A=Fe;return f}function pe(f,A,O,$,G){if(Array.isArray(A))for(var Y=0;Y<A.length;Y++)pe(f,A[Y],O,$,G);else $=u($)?!!$.capture:!!$,O=it(O),f&&f[Le]?(f=f.i,A=String(A).toString(),A in f.g&&(Y=f.g[A],O=X(Y,O,$,G),-1<O&&(me(Y[O]),Array.prototype.splice.call(Y,O,1),Y.length==0&&(delete f.g[A],f.h--)))):f&&(f=Ye(f))&&(A=f.g[A.toString()],f=-1,A&&(f=X(A,O,$,G)),(O=-1<f?A[f]:null)&&Ne(O))}function Ne(f){if(typeof f!="number"&&f&&!f.da){var A=f.src;if(A&&A[Le])Z(A.i,f);else{var O=f.type,$=f.proxy;A.removeEventListener?A.removeEventListener(O,$,f.capture):A.detachEvent?A.detachEvent(Pe(O),$):A.addListener&&A.removeListener&&A.removeListener($),(O=Ye(A))?(Z(O,f),O.h==0&&(O.src=null,A[ue]=null)):me(f)}}}function Pe(f){return f in ye?ye[f]:ye[f]="on"+f}function Fe(f,A){if(f.da)f=!0;else{A=new de(A,this);var O=f.listener,$=f.ha||f.src;f.fa&&Ne(f),f=O.call($,A)}return f}function Ye(f){return f=f[ue],f instanceof ve?f:null}var jt="__closure_events_fn_"+(1e9*Math.random()>>>0);function it(f){return typeof f=="function"?f:(f[jt]||(f[jt]=function(A){return f.handleEvent(A)}),f[jt])}function at(){q.call(this),this.i=new ve(this),this.M=this,this.F=null}x(at,q),at.prototype[Le]=!0,at.prototype.removeEventListener=function(f,A,O,$){pe(this,f,A,O,$)};function $e(f,A){var O,$=f.F;if($)for(O=[];$;$=$.F)O.push($);if(f=f.M,$=A.type||A,typeof A=="string")A=new H(A,f);else if(A instanceof H)A.target=A.target||f;else{var G=A;A=new H($,f),I(A,G)}if(G=!0,O)for(var Y=O.length-1;0<=Y;Y--){var ce=A.g=O[Y];G=dr(ce,$,!0,A)&&G}if(ce=A.g=f,G=dr(ce,$,!0,A)&&G,G=dr(ce,$,!1,A)&&G,O)for(Y=0;Y<O.length;Y++)ce=A.g=O[Y],G=dr(ce,$,!1,A)&&G}at.prototype.N=function(){if(at.aa.N.call(this),this.i){var f=this.i,A;for(A in f.g){for(var O=f.g[A],$=0;$<O.length;$++)me(O[$]);delete f.g[A],f.h--}}this.F=null},at.prototype.K=function(f,A,O,$){return this.i.add(String(f),A,!1,O,$)},at.prototype.L=function(f,A,O,$){return this.i.add(String(f),A,!0,O,$)};function dr(f,A,O,$){if(A=f.i.g[String(A)],!A)return!0;A=A.concat();for(var G=!0,Y=0;Y<A.length;++Y){var ce=A[Y];if(ce&&!ce.da&&ce.capture==O){var gt=ce.listener,jr=ce.ha||ce.src;ce.fa&&Z(f.i,ce),G=gt.call(jr,$)!==!1&&G}}return G&&!$.defaultPrevented}function Qi(f,A,O){if(typeof f=="function")O&&(f=m(f,O));else if(f&&typeof f.handleEvent=="function")f=m(f.handleEvent,f);else throw Error("Invalid listener argument");return 2147483647<Number(A)?-1:l.setTimeout(f,A||0)}function Al(f){f.g=Qi(()=>{f.g=null,f.i&&(f.i=!1,Al(f))},f.l);const A=f.h;f.h=null,f.m.apply(null,A)}class eS extends q{constructor(A,O){super(),this.m=A,this.l=O,this.h=null,this.i=!1,this.g=null}j(A){this.h=arguments,this.g?this.i=!0:Al(this)}N(){super.N(),this.g&&(l.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function Ji(f){q.call(this),this.h=f,this.g={}}x(Ji,q);var af=[];function sf(f){j(f.g,function(A,O){this.g.hasOwnProperty(O)&&Ne(A)},f),f.g={}}Ji.prototype.N=function(){Ji.aa.N.call(this),sf(this)},Ji.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Us=l.JSON.stringify,Q9=l.JSON.parse,J9=class{stringify(f){return l.JSON.stringify(f,void 0)}parse(f){return l.JSON.parse(f,void 0)}};function kv(){}kv.prototype.h=null;function tS(f){return f.h||(f.h=f.i())}function rS(){}var Hu={OPEN:"a",kb:"b",Ja:"c",wb:"d"};function Pv(){H.call(this,"d")}x(Pv,H);function Cv(){H.call(this,"c")}x(Cv,H);var Zi={},nS=null;function of(){return nS=nS||new at}Zi.La="serverreachability";function aS(f){H.call(this,Zi.La,f)}x(aS,H);function qu(f){const A=of();$e(A,new aS(A))}Zi.STAT_EVENT="statevent";function sS(f,A){H.call(this,Zi.STAT_EVENT,f),this.stat=A}x(sS,H);function Xr(f){const A=of();$e(A,new sS(A,f))}Zi.Ma="timingevent";function iS(f,A){H.call(this,Zi.Ma,f),this.size=A}x(iS,H);function Wu(f,A){if(typeof f!="function")throw Error("Fn must not be null and must be a function");return l.setTimeout(function(){f()},A)}function Gu(){this.g=!0}Gu.prototype.xa=function(){this.g=!1};function Z9(f,A,O,$,G,Y){f.info(function(){if(f.g)if(Y)for(var ce="",gt=Y.split("&"),jr=0;jr<gt.length;jr++){var Ze=gt[jr].split("=");if(1<Ze.length){var Dr=Ze[0];Ze=Ze[1];var Mr=Dr.split("_");ce=2<=Mr.length&&Mr[1]=="type"?ce+(Dr+"="+Ze+"&"):ce+(Dr+"=redacted&")}}else ce=null;else ce=Y;return"XMLHTTP REQ ("+$+") [attempt "+G+"]: "+A+`
2167`+O+`
2168`+ce})}function eF(f,A,O,$,G,Y,ce){f.info(function(){return"XMLHTTP RESP ("+$+") [ attempt "+G+"]: "+A+`
2169`+O+`
2170`+Y+" "+ce})}function El(f,A,O,$){f.info(function(){return"XMLHTTP TEXT ("+A+"): "+rF(f,O)+($?" "+$:"")})}function tF(f,A){f.info(function(){return"TIMEOUT: "+A})}Gu.prototype.info=function(){};function rF(f,A){if(!f.g)return A;if(!A)return null;try{var O=JSON.parse(A);if(O){for(f=0;f<O.length;f++)if(Array.isArray(O[f])){var $=O[f];if(!(2>$.length)){var G=$[1];if(Array.isArray(G)&&!(1>G.length)){var Y=G[0];if(Y!="noop"&&Y!="stop"&&Y!="close")for(var ce=1;ce<G.length;ce++)G[ce]=""}}}}return Us(O)}catch{return A}}var lf={NO_ERROR:0,gb:1,tb:2,sb:3,nb:4,rb:5,ub:6,Ia:7,TIMEOUT:8,xb:9},oS={lb:"complete",Hb:"success",Ja:"error",Ia:"abort",zb:"ready",Ab:"readystatechange",TIMEOUT:"timeout",vb:"incrementaldata",yb:"progress",ob:"downloadprogress",Pb:"uploadprogress"},Iv;function cf(){}x(cf,kv),cf.prototype.g=function(){return new XMLHttpRequest},cf.prototype.i=function(){return{}},Iv=new cf;function zs(f,A,O,$){this.j=f,this.i=A,this.l=O,this.R=$||1,this.U=new Ji(this),this.I=45e3,this.H=null,this.o=!1,this.m=this.A=this.v=this.L=this.F=this.S=this.B=null,this.D=[],this.g=null,this.C=0,this.s=this.u=null,this.X=-1,this.J=!1,this.O=0,this.M=null,this.W=this.K=this.T=this.P=!1,this.h=new lS}function lS(){this.i=null,this.g="",this.h=!1}var cS={},Ov={};function Rv(f,A,O){f.L=1,f.v=mf(es(A)),f.m=O,f.P=!0,uS(f,null)}function uS(f,A){f.F=Date.now(),uf(f),f.A=es(f.v);var O=f.A,$=f.R;Array.isArray($)||($=[String($)]),_S(O.i,"t",$),f.C=0,O=f.j.J,f.h=new lS,f.g=US(f.j,O?A:null,!f.m),0<f.O&&(f.M=new eS(m(f.Y,f,f.g),f.O)),A=f.U,O=f.g,$=f.ca;var G="readystatechange";Array.isArray(G)||(G&&(af[0]=G.toString()),G=af);for(var Y=0;Y<G.length;Y++){var ce=B(O,G[Y],$||A.handleEvent,!1,A.h||A);if(!ce)break;A.g[ce.key]=ce}A=f.H?S(f.H):{},f.m?(f.u||(f.u="POST"),A["Content-Type"]="application/x-www-form-urlencoded",f.g.ea(f.A,f.u,f.m,A)):(f.u="GET",f.g.ea(f.A,f.u,null,A)),qu(),Z9(f.i,f.u,f.A,f.l,f.R,f.m)}zs.prototype.ca=function(f){f=f.target;const A=this.M;A&&ts(f)==3?A.j():this.Y(f)},zs.prototype.Y=function(f){try{if(f==this.g)e:{const Mr=ts(this.g);var A=this.g.Ba();const Cl=this.g.Z();if(!(3>Mr)&&(Mr!=3||this.g&&(this.h.h||this.g.oa()||CS(this.g)))){this.J||Mr!=4||A==7||(A==8||0>=Cl?qu(3):qu(2)),Dv(this);var O=this.g.Z();this.X=O;t:if(dS(this)){var $=CS(this.g);f="";var G=$.length,Y=ts(this.g)==4;if(!this.h.i){if(typeof TextDecoder>"u"){eo(this),Ku(this);var ce="";break t}this.h.i=new l.TextDecoder}for(A=0;A<G;A++)this.h.h=!0,f+=this.h.i.decode($[A],{stream:!(Y&&A==G-1)});$.length=0,this.h.g+=f,this.C=0,ce=this.h.g}else ce=this.g.oa();if(this.o=O==200,eF(this.i,this.u,this.A,this.l,this.R,Mr,O),this.o){if(this.T&&!this.K){t:{if(this.g){var gt,jr=this.g;if((gt=jr.g?jr.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!b(gt)){var Ze=gt;break t}}Ze=null}if(O=Ze)El(this.i,this.l,O,"Initial handshake response via X-HTTP-Initial-Response"),this.K=!0,Mv(this,O);else{this.o=!1,this.s=3,Xr(12),eo(this),Ku(this);break e}}if(this.P){O=!0;let ra;for(;!this.J&&this.C<ce.length;)if(ra=nF(this,ce),ra==Ov){Mr==4&&(this.s=4,Xr(14),O=!1),El(this.i,this.l,null,"[Incomplete Response]");break}else if(ra==cS){this.s=4,Xr(15),El(this.i,this.l,ce,"[Invalid Chunk]"),O=!1;break}else El(this.i,this.l,ra,null),Mv(this,ra);if(dS(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Mr!=4||ce.length!=0||this.h.h||(this.s=1,Xr(16),O=!1),this.o=this.o&&O,!O)El(this.i,this.l,ce,"[Invalid Chunked Response]"),eo(this),Ku(this);else if(0<ce.length&&!this.W){this.W=!0;var Dr=this.j;Dr.g==this&&Dr.ba&&!Dr.M&&(Dr.j.info("Great, no buffering proxy detected. Bytes received: "+ce.length),Uv(Dr),Dr.M=!0,Xr(11))}}else El(this.i,this.l,ce,null),Mv(this,ce);Mr==4&&eo(this),this.o&&!this.J&&(Mr==4?LS(this.j,this):(this.o=!1,uf(this)))}else bF(this.g),O==400&&0<ce.indexOf("Unknown SID")?(this.s=3,Xr(12)):(this.s=0,Xr(13)),eo(this),Ku(this)}}}catch{}finally{}};function dS(f){return f.g?f.u=="GET"&&f.L!=2&&f.j.Ca:!1}function nF(f,A){var O=f.C,$=A.indexOf(`
2171`,O);return $==-1?Ov:(O=Number(A.substring(O,$)),isNaN(O)?cS:($+=1,$+O>A.length?Ov:(A=A.slice($,$+O),f.C=$+O,A)))}zs.prototype.cancel=function(){this.J=!0,eo(this)};function uf(f){f.S=Date.now()+f.I,hS(f,f.I)}function hS(f,A){if(f.B!=null)throw Error("WatchDog timer not null");f.B=Wu(m(f.ba,f),A)}function Dv(f){f.B&&(l.clearTimeout(f.B),f.B=null)}zs.prototype.ba=function(){this.B=null;const f=Date.now();0<=f-this.S?(tF(this.i,this.A),this.L!=2&&(qu(),Xr(17)),eo(this),this.s=2,Ku(this)):hS(this,this.S-f)};function Ku(f){f.j.G==0||f.J||LS(f.j,f)}function eo(f){Dv(f);var A=f.M;A&&typeof A.ma=="function"&&A.ma(),f.M=null,sf(f.U),f.g&&(A=f.g,f.g=null,A.abort(),A.ma())}function Mv(f,A){try{var O=f.j;if(O.G!=0&&(O.g==f||$v(O.h,f))){if(!f.K&&$v(O.h,f)&&O.G==3){try{var $=O.Da.g.parse(A)}catch{$=null}if(Array.isArray($)&&$.length==3){var G=$;if(G[0]==0){e:if(!O.u){if(O.g)if(O.g.F+3e3<f.F)vf(O),xf(O);else break e;Vv(O),Xr(18)}}else O.za=G[1],0<O.za-O.T&&37500>G[2]&&O.F&&O.v==0&&!O.C&&(O.C=Wu(m(O.Za,O),6e3));if(1>=pS(O.h)&&O.ca){try{O.ca()}catch{}O.ca=void 0}}else ro(O,11)}else if((f.K||O.g==f)&&vf(O),!b(A))for(G=O.Da.g.parse(A),A=0;A<G.length;A++){let Ze=G[A];if(O.T=Ze[0],Ze=Ze[1],O.G==2)if(Ze[0]=="c"){O.K=Ze[1],O.ia=Ze[2];const Dr=Ze[3];Dr!=null&&(O.la=Dr,O.j.info("VER="+O.la));const Mr=Ze[4];Mr!=null&&(O.Aa=Mr,O.j.info("SVER="+O.Aa));const Cl=Ze[5];Cl!=null&&typeof Cl=="number"&&0<Cl&&($=1.5*Cl,O.L=$,O.j.info("backChannelRequestTimeoutMs_="+$)),$=O;const ra=f.g;if(ra){const wf=ra.g?ra.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(wf){var Y=$.h;Y.g||wf.indexOf("spdy")==-1&&wf.indexOf("quic")==-1&&wf.indexOf("h2")==-1||(Y.j=Y.l,Y.g=new Set,Y.h&&(Lv(Y,Y.h),Y.h=null))}if($.D){const zv=ra.g?ra.g.getResponseHeader("X-HTTP-Session-Id"):null;zv&&($.ya=zv,Nt($.I,$.D,zv))}}O.G=3,O.l&&O.l.ua(),O.ba&&(O.R=Date.now()-f.F,O.j.info("Handshake RTT: "+O.R+"ms")),$=O;var ce=f;if($.qa=VS($,$.J?$.ia:null,$.W),ce.K){gS($.h,ce);var gt=ce,jr=$.L;jr&&(gt.I=jr),gt.B&&(Dv(gt),uf(gt)),$.g=ce}else MS($);0<O.i.length&&yf(O)}else Ze[0]!="stop"&&Ze[0]!="close"||ro(O,7);else O.G==3&&(Ze[0]=="stop"||Ze[0]=="close"?Ze[0]=="stop"?ro(O,7):Bv(O):Ze[0]!="noop"&&O.l&&O.l.ta(Ze),O.v=0)}}qu(4)}catch{}}var aF=class{constructor(f,A){this.g=f,this.map=A}};function mS(f){this.l=f||10,l.PerformanceNavigationTiming?(f=l.performance.getEntriesByType("navigation"),f=0<f.length&&(f[0].nextHopProtocol=="hq"||f[0].nextHopProtocol=="h2")):f=!!(l.chrome&&l.chrome.loadTimes&&l.chrome.loadTimes()&&l.chrome.loadTimes().wasFetchedViaSpdy),this.j=f?this.l:1,this.g=null,1<this.j&&(this.g=new Set),this.h=null,this.i=[]}function fS(f){return f.h?!0:f.g?f.g.size>=f.j:!1}function pS(f){return f.h?1:f.g?f.g.size:0}function $v(f,A){return f.h?f.h==A:f.g?f.g.has(A):!1}function Lv(f,A){f.g?f.g.add(A):f.h=A}function gS(f,A){f.h&&f.h==A?f.h=null:f.g&&f.g.has(A)&&f.g.delete(A)}mS.prototype.cancel=function(){if(this.i=xS(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const f of this.g.values())f.cancel();this.g.clear()}};function xS(f){if(f.h!=null)return f.i.concat(f.h.D);if(f.g!=null&&f.g.size!==0){let A=f.i;for(const O of f.g.values())A=A.concat(O.D);return A}return w(f.i)}function sF(f){if(f.V&&typeof f.V=="function")return f.V();if(typeof Map<"u"&&f instanceof Map||typeof Set<"u"&&f instanceof Set)return Array.from(f.values());if(typeof f=="string")return f.split("");if(c(f)){for(var A=[],O=f.length,$=0;$<O;$++)A.push(f[$]);return A}A=[],O=0;for($ in f)A[O++]=f[$];return A}function iF(f){if(f.na&&typeof f.na=="function")return f.na();if(!f.V||typeof f.V!="function"){if(typeof Map<"u"&&f instanceof Map)return Array.from(f.keys());if(!(typeof Set<"u"&&f instanceof Set)){if(c(f)||typeof f=="string"){var A=[];f=f.length;for(var O=0;O<f;O++)A.push(O);return A}A=[],O=0;for(const $ in f)A[O++]=$;return A}}}function yS(f,A){if(f.forEach&&typeof f.forEach=="function")f.forEach(A,void 0);else if(c(f)||typeof f=="string")Array.prototype.forEach.call(f,A,void 0);else for(var O=iF(f),$=sF(f),G=$.length,Y=0;Y<G;Y++)A.call(void 0,$[Y],O&&O[Y],f)}var vS=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function oF(f,A){if(f){f=f.split("&");for(var O=0;O<f.length;O++){var $=f[O].indexOf("="),G=null;if(0<=$){var Y=f[O].substring(0,$);G=f[O].substring($+1)}else Y=f[O];A(Y,G?decodeURIComponent(G.replace(/\+/g," ")):"")}}}function to(f){if(this.g=this.o=this.j="",this.s=null,this.m=this.l="",this.h=!1,f instanceof to){this.h=f.h,df(this,f.j),this.o=f.o,this.g=f.g,hf(this,f.s),this.l=f.l;var A=f.i,O=new Qu;O.i=A.i,A.g&&(O.g=new Map(A.g),O.h=A.h),bS(this,O),this.m=f.m}else f&&(A=String(f).match(vS))?(this.h=!1,df(this,A[1]||"",!0),this.o=Xu(A[2]||""),this.g=Xu(A[3]||"",!0),hf(this,A[4]),this.l=Xu(A[5]||"",!0),bS(this,A[6]||"",!0),this.m=Xu(A[7]||"")):(this.h=!1,this.i=new Qu(null,this.h))}to.prototype.toString=function(){var f=[],A=this.j;A&&f.push(Yu(A,wS,!0),":");var O=this.g;return(O||A=="file")&&(f.push("//"),(A=this.o)&&f.push(Yu(A,wS,!0),"@"),f.push(encodeURIComponent(String(O)).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),O=this.s,O!=null&&f.push(":",String(O))),(O=this.l)&&(this.g&&O.charAt(0)!="/"&&f.push("/"),f.push(Yu(O,O.charAt(0)=="/"?uF:cF,!0))),(O=this.i.toString())&&f.push("?",O),(O=this.m)&&f.push("#",Yu(O,hF)),f.join("")};function es(f){return new to(f)}function df(f,A,O){f.j=O?Xu(A,!0):A,f.j&&(f.j=f.j.replace(/:$/,""))}function hf(f,A){if(A){if(A=Number(A),isNaN(A)||0>A)throw Error("Bad port number "+A);f.s=A}else f.s=null}function bS(f,A,O){A instanceof Qu?(f.i=A,mF(f.i,f.h)):(O||(A=Yu(A,dF)),f.i=new Qu(A,f.h))}function Nt(f,A,O){f.i.set(A,O)}function mf(f){return Nt(f,"zx",Math.floor(2147483648*Math.random()).toString(36)+Math.abs(Math.floor(2147483648*Math.random())^Date.now()).toString(36)),f}function Xu(f,A){return f?A?decodeURI(f.replace(/%25/g,"%2525")):decodeURIComponent(f):""}function Yu(f,A,O){return typeof f=="string"?(f=encodeURI(f).replace(A,lF),O&&(f=f.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),f):null}function lF(f){return f=f.charCodeAt(0),"%"+(f>>4&15).toString(16)+(f&15).toString(16)}var wS=/[#\/\?@]/g,cF=/[#\?:]/g,uF=/[#\?]/g,dF=/[#\?@]/g,hF=/#/g;function Qu(f,A){this.h=this.g=null,this.i=f||null,this.j=!!A}function Hs(f){f.g||(f.g=new Map,f.h=0,f.i&&oF(f.i,function(A,O){f.add(decodeURIComponent(A.replace(/\+/g," ")),O)}))}t=Qu.prototype,t.add=function(f,A){Hs(this),this.i=null,f=kl(this,f);var O=this.g.get(f);return O||this.g.set(f,O=[]),O.push(A),this.h+=1,this};function jS(f,A){Hs(f),A=kl(f,A),f.g.has(A)&&(f.i=null,f.h-=f.g.get(A).length,f.g.delete(A))}function NS(f,A){return Hs(f),A=kl(f,A),f.g.has(A)}t.forEach=function(f,A){Hs(this),this.g.forEach(function(O,$){O.forEach(function(G){f.call(A,G,$,this)},this)},this)},t.na=function(){Hs(this);const f=Array.from(this.g.values()),A=Array.from(this.g.keys()),O=[];for(let $=0;$<A.length;$++){const G=f[$];for(let Y=0;Y<G.length;Y++)O.push(A[$])}return O},t.V=function(f){Hs(this);let A=[];if(typeof f=="string")NS(this,f)&&(A=A.concat(this.g.get(kl(this,f))));else{f=Array.from(this.g.values());for(let O=0;O<f.length;O++)A=A.concat(f[O])}return A},t.set=function(f,A){return Hs(this),this.i=null,f=kl(this,f),NS(this,f)&&(this.h-=this.g.get(f).length),this.g.set(f,[A]),this.h+=1,this},t.get=function(f,A){return f?(f=this.V(f),0<f.length?String(f[0]):A):A};function _S(f,A,O){jS(f,A),0<O.length&&(f.i=null,f.g.set(kl(f,A),w(O)),f.h+=O.length)}t.toString=function(){if(this.i)return this.i;if(!this.g)return"";const f=[],A=Array.from(this.g.keys());for(var O=0;O<A.length;O++){var $=A[O];const Y=encodeURIComponent(String($)),ce=this.V($);for($=0;$<ce.length;$++){var G=Y;ce[$]!==""&&(G+="="+encodeURIComponent(String(ce[$]))),f.push(G)}}return this.i=f.join("&")};function kl(f,A){return A=String(A),f.j&&(A=A.toLowerCase()),A}function mF(f,A){A&&!f.j&&(Hs(f),f.i=null,f.g.forEach(function(O,$){var G=$.toLowerCase();$!=G&&(jS(this,$),_S(this,G,O))},f)),f.j=A}function fF(f,A){const O=new Gu;if(l.Image){const $=new Image;$.onload=p(qs,O,"TestLoadImage: loaded",!0,A,$),$.onerror=p(qs,O,"TestLoadImage: error",!1,A,$),$.onabort=p(qs,O,"TestLoadImage: abort",!1,A,$),$.ontimeout=p(qs,O,"TestLoadImage: timeout",!1,A,$),l.setTimeout(function(){$.ontimeout&&$.ontimeout()},1e4),$.src=f}else A(!1)}function pF(f,A){const O=new Gu,$=new AbortController,G=setTimeout(()=>{$.abort(),qs(O,"TestPingServer: timeout",!1,A)},1e4);fetch(f,{signal:$.signal}).then(Y=>{clearTimeout(G),Y.ok?qs(O,"TestPingServer: ok",!0,A):qs(O,"TestPingServer: server error",!1,A)}).catch(()=>{clearTimeout(G),qs(O,"TestPingServer: error",!1,A)})}function qs(f,A,O,$,G){try{G&&(G.onload=null,G.onerror=null,G.onabort=null,G.ontimeout=null),$(O)}catch{}}function gF(){this.g=new J9}function xF(f,A,O){const $=O||"";try{yS(f,function(G,Y){let ce=G;u(G)&&(ce=Us(G)),A.push($+Y+"="+encodeURIComponent(ce))})}catch(G){throw A.push($+"type="+encodeURIComponent("_badmap")),G}}function ff(f){this.l=f.Ub||null,this.j=f.eb||!1}x(ff,kv),ff.prototype.g=function(){return new pf(this.l,this.j)},ff.prototype.i=function(f){return function(){return f}}({});function pf(f,A){at.call(this),this.D=f,this.o=A,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}x(pf,at),t=pf.prototype,t.open=function(f,A){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.B=f,this.A=A,this.readyState=1,Zu(this)},t.send=function(f){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");this.g=!0;const A={headers:this.u,method:this.B,credentials:this.m,cache:void 0};f&&(A.body=f),(this.D||l).fetch(new Request(this.A,A)).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,Ju(this)),this.readyState=0},t.Sa=function(f){if(this.g&&(this.l=f,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=f.headers,this.readyState=2,Zu(this)),this.g&&(this.readyState=3,Zu(this),this.g)))if(this.responseType==="arraybuffer")f.arrayBuffer().then(this.Qa.bind(this),this.ga.bind(this));else if(typeof l.ReadableStream<"u"&&"body"in f){if(this.j=f.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.v=new TextDecoder;SS(this)}else f.text().then(this.Ra.bind(this),this.ga.bind(this))};function SS(f){f.j.read().then(f.Pa.bind(f)).catch(f.ga.bind(f))}t.Pa=function(f){if(this.g){if(this.o&&f.value)this.response.push(f.value);else if(!this.o){var A=f.value?f.value:new Uint8Array(0);(A=this.v.decode(A,{stream:!f.done}))&&(this.response=this.responseText+=A)}f.done?Ju(this):Zu(this),this.readyState==3&&SS(this)}},t.Ra=function(f){this.g&&(this.response=this.responseText=f,Ju(this))},t.Qa=function(f){this.g&&(this.response=f,Ju(this))},t.ga=function(){this.g&&Ju(this)};function Ju(f){f.readyState=4,f.l=null,f.j=null,f.v=null,Zu(f)}t.setRequestHeader=function(f,A){this.u.append(f,A)},t.getResponseHeader=function(f){return this.h&&this.h.get(f.toLowerCase())||""},t.getAllResponseHeaders=function(){if(!this.h)return"";const f=[],A=this.h.entries();for(var O=A.next();!O.done;)O=O.value,f.push(O[0]+": "+O[1]),O=A.next();return f.join(`\r
2172`)};function Zu(f){f.onreadystatechange&&f.onreadystatechange.call(f)}Object.defineProperty(pf.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(f){this.m=f?"include":"same-origin"}});function TS(f){let A="";return j(f,function(O,$){A+=$,A+=":",A+=O,A+=`\r
2173`}),A}function Fv(f,A,O){e:{for($ in O){var $=!1;break e}$=!0}$||(O=TS(O),typeof f=="string"?O!=null&&encodeURIComponent(String(O)):Nt(f,A,O))}function Ft(f){at.call(this),this.headers=new Map,this.o=f||null,this.h=!1,this.v=this.g=null,this.D="",this.m=0,this.l="",this.j=this.B=this.u=this.A=!1,this.I=null,this.H="",this.J=!1}x(Ft,at);var yF=/^https?$/i,vF=["POST","PUT"];t=Ft.prototype,t.Ha=function(f){this.J=f},t.ea=function(f,A,O,$){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+f);A=A?A.toUpperCase():"GET",this.D=f,this.l="",this.m=0,this.A=!1,this.h=!0,this.g=this.o?this.o.g():Iv.g(),this.v=this.o?tS(this.o):tS(Iv),this.g.onreadystatechange=m(this.Ea,this);try{this.B=!0,this.g.open(A,String(f),!0),this.B=!1}catch(Y){AS(this,Y);return}if(f=O||"",O=new Map(this.headers),$)if(Object.getPrototypeOf($)===Object.prototype)for(var G in $)O.set(G,$[G]);else if(typeof $.keys=="function"&&typeof $.get=="function")for(const Y of $.keys())O.set(Y,$.get(Y));else throw Error("Unknown input type for opt_headers: "+String($));$=Array.from(O.keys()).find(Y=>Y.toLowerCase()=="content-type"),G=l.FormData&&f instanceof l.FormData,!(0<=Array.prototype.indexOf.call(vF,A,void 0))||$||G||O.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Y,ce]of O)this.g.setRequestHeader(Y,ce);this.H&&(this.g.responseType=this.H),"withCredentials"in this.g&&this.g.withCredentials!==this.J&&(this.g.withCredentials=this.J);try{PS(this),this.u=!0,this.g.send(f),this.u=!1}catch(Y){AS(this,Y)}};function AS(f,A){f.h=!1,f.g&&(f.j=!0,f.g.abort(),f.j=!1),f.l=A,f.m=5,ES(f),gf(f)}function ES(f){f.A||(f.A=!0,$e(f,"complete"),$e(f,"error"))}t.abort=function(f){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.m=f||7,$e(this,"complete"),$e(this,"abort"),gf(this))},t.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),gf(this,!0)),Ft.aa.N.call(this)},t.Ea=function(){this.s||(this.B||this.u||this.j?kS(this):this.bb())},t.bb=function(){kS(this)};function kS(f){if(f.h&&typeof o<"u"&&(!f.v[1]||ts(f)!=4||f.Z()!=2)){if(f.u&&ts(f)==4)Qi(f.Ea,0,f);else if($e(f,"readystatechange"),ts(f)==4){f.h=!1;try{const ce=f.Z();e:switch(ce){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var A=!0;break e;default:A=!1}var O;if(!(O=A)){var $;if($=ce===0){var G=String(f.D).match(vS)[1]||null;!G&&l.self&&l.self.location&&(G=l.self.location.protocol.slice(0,-1)),$=!yF.test(G?G.toLowerCase():"")}O=$}if(O)$e(f,"complete"),$e(f,"success");else{f.m=6;try{var Y=2<ts(f)?f.g.statusText:""}catch{Y=""}f.l=Y+" ["+f.Z()+"]",ES(f)}}finally{gf(f)}}}}function gf(f,A){if(f.g){PS(f);const O=f.g,$=f.v[0]?()=>{}:null;f.g=null,f.v=null,A||$e(f,"ready");try{O.onreadystatechange=$}catch{}}}function PS(f){f.I&&(l.clearTimeout(f.I),f.I=null)}t.isActive=function(){return!!this.g};function ts(f){return f.g?f.g.readyState:0}t.Z=function(){try{return 2<ts(this)?this.g.status:-1}catch{return-1}},t.oa=function(){try{return this.g?this.g.responseText:""}catch{return""}},t.Oa=function(f){if(this.g){var A=this.g.responseText;return f&&A.indexOf(f)==0&&(A=A.substring(f.length)),Q9(A)}};function CS(f){try{if(!f.g)return null;if("response"in f.g)return f.g.response;switch(f.H){case"":case"text":return f.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in f.g)return f.g.mozResponseArrayBuffer}return null}catch{return null}}function bF(f){const A={};f=(f.g&&2<=ts(f)&&f.g.getAllResponseHeaders()||"").split(`\r
2174`);for(let $=0;$<f.length;$++){if(b(f[$]))continue;var O=E(f[$]);const G=O[0];if(O=O[1],typeof O!="string")continue;O=O.trim();const Y=A[G]||[];A[G]=Y,Y.push(O)}_(A,function($){return $.join(", ")})}t.Ba=function(){return this.m},t.Ka=function(){return typeof this.l=="string"?this.l:String(this.l)};function ed(f,A,O){return O&&O.internalChannelParams&&O.internalChannelParams[f]||A}function IS(f){this.Aa=0,this.i=[],this.j=new Gu,this.ia=this.qa=this.I=this.W=this.g=this.ya=this.D=this.H=this.m=this.S=this.o=null,this.Ya=this.U=0,this.Va=ed("failFast",!1,f),this.F=this.C=this.u=this.s=this.l=null,this.X=!0,this.za=this.T=-1,this.Y=this.v=this.B=0,this.Ta=ed("baseRetryDelayMs",5e3,f),this.cb=ed("retryDelaySeedMs",1e4,f),this.Wa=ed("forwardChannelMaxRetries",2,f),this.wa=ed("forwardChannelRequestTimeoutMs",2e4,f),this.pa=f&&f.xmlHttpFactory||void 0,this.Xa=f&&f.Tb||void 0,this.Ca=f&&f.useFetchStreams||!1,this.L=void 0,this.J=f&&f.supportsCrossDomainXhr||!1,this.K="",this.h=new mS(f&&f.concurrentRequestLimit),this.Da=new gF,this.P=f&&f.fastHandshake||!1,this.O=f&&f.encodeInitMessageHeaders||!1,this.P&&this.O&&(this.O=!1),this.Ua=f&&f.Rb||!1,f&&f.xa&&this.j.xa(),f&&f.forceLongPolling&&(this.X=!1),this.ba=!this.P&&this.X&&f&&f.detectBufferingProxy||!1,this.ja=void 0,f&&f.longPollingTimeout&&0<f.longPollingTimeout&&(this.ja=f.longPollingTimeout),this.ca=void 0,this.R=0,this.M=!1,this.ka=this.A=null}t=IS.prototype,t.la=8,t.G=1,t.connect=function(f,A,O,$){Xr(0),this.W=f,this.H=A||{},O&&$!==void 0&&(this.H.OSID=O,this.H.OAID=$),this.F=this.X,this.I=VS(this,null,this.W),yf(this)};function Bv(f){if(OS(f),f.G==3){var A=f.U++,O=es(f.I);if(Nt(O,"SID",f.K),Nt(O,"RID",A),Nt(O,"TYPE","terminate"),td(f,O),A=new zs(f,f.j,A),A.L=2,A.v=mf(es(O)),O=!1,l.navigator&&l.navigator.sendBeacon)try{O=l.navigator.sendBeacon(A.v.toString(),"")}catch{}!O&&l.Image&&(new Image().src=A.v,O=!0),O||(A.g=US(A.j,null),A.g.ea(A.v)),A.F=Date.now(),uf(A)}BS(f)}function xf(f){f.g&&(Uv(f),f.g.cancel(),f.g=null)}function OS(f){xf(f),f.u&&(l.clearTimeout(f.u),f.u=null),vf(f),f.h.cancel(),f.s&&(typeof f.s=="number"&&l.clearTimeout(f.s),f.s=null)}function yf(f){if(!fS(f.h)&&!f.s){f.s=!0;var A=f.Ga;U||z(),V||(U(),V=!0),D.add(A,f),f.B=0}}function wF(f,A){return pS(f.h)>=f.h.j-(f.s?1:0)?!1:f.s?(f.i=A.D.concat(f.i),!0):f.G==1||f.G==2||f.B>=(f.Va?0:f.Wa)?!1:(f.s=Wu(m(f.Ga,f,A),FS(f,f.B)),f.B++,!0)}t.Ga=function(f){if(this.s)if(this.s=null,this.G==1){if(!f){this.U=Math.floor(1e5*Math.random()),f=this.U++;const G=new zs(this,this.j,f);let Y=this.o;if(this.S&&(Y?(Y=S(Y),I(Y,this.S)):Y=this.S),this.m!==null||this.O||(G.H=Y,Y=null),this.P)e:{for(var A=0,O=0;O<this.i.length;O++){t:{var $=this.i[O];if("__data__"in $.map&&($=$.map.__data__,typeof $=="string")){$=$.length;break t}$=void 0}if($===void 0)break;if(A+=$,4096<A){A=O;break e}if(A===4096||O===this.i.length-1){A=O+1;break e}}A=1e3}else A=1e3;A=DS(this,G,A),O=es(this.I),Nt(O,"RID",f),Nt(O,"CVER",22),this.D&&Nt(O,"X-HTTP-Session-Id",this.D),td(this,O),Y&&(this.O?A="headers="+encodeURIComponent(String(TS(Y)))+"&"+A:this.m&&Fv(O,this.m,Y)),Lv(this.h,G),this.Ua&&Nt(O,"TYPE","init"),this.P?(Nt(O,"$req",A),Nt(O,"SID","null"),G.T=!0,Rv(G,O,null)):Rv(G,O,A),this.G=2}}else this.G==3&&(f?RS(this,f):this.i.length==0||fS(this.h)||RS(this))};function RS(f,A){var O;A?O=A.l:O=f.U++;const $=es(f.I);Nt($,"SID",f.K),Nt($,"RID",O),Nt($,"AID",f.T),td(f,$),f.m&&f.o&&Fv($,f.m,f.o),O=new zs(f,f.j,O,f.B+1),f.m===null&&(O.H=f.o),A&&(f.i=A.D.concat(f.i)),A=DS(f,O,1e3),O.I=Math.round(.5*f.wa)+Math.round(.5*f.wa*Math.random()),Lv(f.h,O),Rv(O,$,A)}function td(f,A){f.H&&j(f.H,function(O,$){Nt(A,$,O)}),f.l&&yS({},function(O,$){Nt(A,$,O)})}function DS(f,A,O){O=Math.min(f.i.length,O);var $=f.l?m(f.l.Na,f.l,f):null;e:{var G=f.i;let Y=-1;for(;;){const ce=["count="+O];Y==-1?0<O?(Y=G[0].g,ce.push("ofs="+Y)):Y=0:ce.push("ofs="+Y);let gt=!0;for(let jr=0;jr<O;jr++){let Ze=G[jr].g;const Dr=G[jr].map;if(Ze-=Y,0>Ze)Y=Math.max(0,G[jr].g-100),gt=!1;else try{xF(Dr,ce,"req"+Ze+"_")}catch{$&&$(Dr)}}if(gt){$=ce.join("&");break e}}}return f=f.i.splice(0,O),A.D=f,$}function MS(f){if(!f.g&&!f.u){f.Y=1;var A=f.Fa;U||z(),V||(U(),V=!0),D.add(A,f),f.v=0}}function Vv(f){return f.g||f.u||3<=f.v?!1:(f.Y++,f.u=Wu(m(f.Fa,f),FS(f,f.v)),f.v++,!0)}t.Fa=function(){if(this.u=null,$S(this),this.ba&&!(this.M||this.g==null||0>=this.R)){var f=2*this.R;this.j.info("BP detection timer enabled: "+f),this.A=Wu(m(this.ab,this),f)}},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,Xr(10),xf(this),$S(this))};function Uv(f){f.A!=null&&(l.clearTimeout(f.A),f.A=null)}function $S(f){f.g=new zs(f,f.j,"rpc",f.Y),f.m===null&&(f.g.H=f.o),f.g.O=0;var A=es(f.qa);Nt(A,"RID","rpc"),Nt(A,"SID",f.K),Nt(A,"AID",f.T),Nt(A,"CI",f.F?"0":"1"),!f.F&&f.ja&&Nt(A,"TO",f.ja),Nt(A,"TYPE","xmlhttp"),td(f,A),f.m&&f.o&&Fv(A,f.m,f.o),f.L&&(f.g.I=f.L);var O=f.g;f=f.ia,O.L=1,O.v=mf(es(A)),O.m=null,O.P=!0,uS(O,f)}t.Za=function(){this.C!=null&&(this.C=null,xf(this),Vv(this),Xr(19))};function vf(f){f.C!=null&&(l.clearTimeout(f.C),f.C=null)}function LS(f,A){var O=null;if(f.g==A){vf(f),Uv(f),f.g=null;var $=2}else if($v(f.h,A))O=A.D,gS(f.h,A),$=1;else return;if(f.G!=0){if(A.o)if($==1){O=A.m?A.m.length:0,A=Date.now()-A.F;var G=f.B;$=of(),$e($,new iS($,O)),yf(f)}else MS(f);else if(G=A.s,G==3||G==0&&0<A.X||!($==1&&wF(f,A)||$==2&&Vv(f)))switch(O&&0<O.length&&(A=f.h,A.i=A.i.concat(O)),G){case 1:ro(f,5);break;case 4:ro(f,10);break;case 3:ro(f,6);break;default:ro(f,2)}}}function FS(f,A){let O=f.Ta+Math.floor(Math.random()*f.cb);return f.isActive()||(O*=2),O*A}function ro(f,A){if(f.j.info("Error code "+A),A==2){var O=m(f.fb,f),$=f.Xa;const G=!$;$=new to($||"//www.google.com/images/cleardot.gif"),l.location&&l.location.protocol=="http"||df($,"https"),mf($),G?fF($.toString(),O):pF($.toString(),O)}else Xr(2);f.G=0,f.l&&f.l.sa(A),BS(f),OS(f)}t.fb=function(f){f?(this.j.info("Successfully pinged google.com"),Xr(2)):(this.j.info("Failed to ping google.com"),Xr(1))};function BS(f){if(f.G=0,f.ka=[],f.l){const A=xS(f.h);(A.length!=0||f.i.length!=0)&&(g(f.ka,A),g(f.ka,f.i),f.h.i.length=0,w(f.i),f.i.length=0),f.l.ra()}}function VS(f,A,O){var $=O instanceof to?es(O):new to(O);if($.g!="")A&&($.g=A+"."+$.g),hf($,$.s);else{var G=l.location;$=G.protocol,A=A?A+"."+G.hostname:G.hostname,G=+G.port;var Y=new to(null);$&&df(Y,$),A&&(Y.g=A),G&&hf(Y,G),O&&(Y.l=O),$=Y}return O=f.D,A=f.ya,O&&A&&Nt($,O,A),Nt($,"VER",f.la),td(f,$),$}function US(f,A,O){if(A&&!f.J)throw Error("Can't create secondary domain capable XhrIo object.");return A=f.Ca&&!f.pa?new Ft(new ff({eb:O})):new Ft(f.pa),A.Ha(f.J),A}t.isActive=function(){return!!this.l&&this.l.isActive(this)};function zS(){}t=zS.prototype,t.ua=function(){},t.ta=function(){},t.sa=function(){},t.ra=function(){},t.isActive=function(){return!0},t.Na=function(){};function bf(){}bf.prototype.g=function(f,A){return new vn(f,A)};function vn(f,A){at.call(this),this.g=new IS(A),this.l=f,this.h=A&&A.messageUrlParams||null,f=A&&A.messageHeaders||null,A&&A.clientProtocolHeaderRequired&&(f?f["X-Client-Protocol"]="webchannel":f={"X-Client-Protocol":"webchannel"}),this.g.o=f,f=A&&A.initMessageHeaders||null,A&&A.messageContentType&&(f?f["X-WebChannel-Content-Type"]=A.messageContentType:f={"X-WebChannel-Content-Type":A.messageContentType}),A&&A.va&&(f?f["X-WebChannel-Client-Profile"]=A.va:f={"X-WebChannel-Client-Profile":A.va}),this.g.S=f,(f=A&&A.Sb)&&!b(f)&&(this.g.m=f),this.v=A&&A.supportsCrossDomainXhr||!1,this.u=A&&A.sendRawJson||!1,(A=A&&A.httpSessionIdParam)&&!b(A)&&(this.g.D=A,f=this.h,f!==null&&A in f&&(f=this.h,A in f&&delete f[A])),this.j=new Pl(this)}x(vn,at),vn.prototype.m=function(){this.g.l=this.j,this.v&&(this.g.J=!0),this.g.connect(this.l,this.h||void 0)},vn.prototype.close=function(){Bv(this.g)},vn.prototype.o=function(f){var A=this.g;if(typeof f=="string"){var O={};O.__data__=f,f=O}else this.u&&(O={},O.__data__=Us(f),f=O);A.i.push(new aF(A.Ya++,f)),A.G==3&&yf(A)},vn.prototype.N=function(){this.g.l=null,delete this.j,Bv(this.g),delete this.g,vn.aa.N.call(this)};function HS(f){Pv.call(this),f.__headers__&&(this.headers=f.__headers__,this.statusCode=f.__status__,delete f.__headers__,delete f.__status__);var A=f.__sm__;if(A){e:{for(const O in A){f=O;break e}f=void 0}(this.i=f)&&(f=this.i,A=A!==null&&f in A?A[f]:void 0),this.data=A}else this.data=f}x(HS,Pv);function qS(){Cv.call(this),this.status=1}x(qS,Cv);function Pl(f){this.g=f}x(Pl,zS),Pl.prototype.ua=function(){$e(this.g,"a")},Pl.prototype.ta=function(f){$e(this.g,new HS(f))},Pl.prototype.sa=function(f){$e(this.g,new qS)},Pl.prototype.ra=function(){$e(this.g,"b")},bf.prototype.createWebChannel=bf.prototype.g,vn.prototype.send=vn.prototype.o,vn.prototype.open=vn.prototype.m,vn.prototype.close=vn.prototype.close,N5=function(){return new bf},j5=function(){return of()},w5=Zi,Rw={mb:0,pb:1,qb:2,Jb:3,Ob:4,Lb:5,Mb:6,Kb:7,Ib:8,Nb:9,PROXY:10,NOPROXY:11,Gb:12,Cb:13,Db:14,Bb:15,Eb:16,Fb:17,ib:18,hb:19,jb:20},lf.NO_ERROR=0,lf.TIMEOUT=8,lf.HTTP_ERROR=6,Op=lf,oS.COMPLETE="complete",b5=oS,rS.EventType=Hu,Hu.OPEN="a",Hu.CLOSE="b",Hu.ERROR="c",Hu.MESSAGE="d",at.prototype.listen=at.prototype.K,Md=rS,Ft.prototype.listenOnce=Ft.prototype.L,Ft.prototype.getLastError=Ft.prototype.Ka,Ft.prototype.getLastErrorCode=Ft.prototype.Ba,Ft.prototype.getStatus=Ft.prototype.Z,Ft.prototype.getResponseJson=Ft.prototype.Oa,Ft.prototype.getResponseText=Ft.prototype.oa,Ft.prototype.send=Ft.prototype.ea,Ft.prototype.setWithCredentials=Ft.prototype.Ha,v5=Ft}).apply(typeof Uf<"u"?Uf:typeof self<"u"?self:typeof window<"u"?window:{});const nE="@firebase/firestore";/**
2175 * @license
2176 * Copyright 2017 Google LLC
2177 *
2178 * Licensed under the Apache License, Version 2.0 (the "License");
2179 * you may not use this file except in compliance with the License.
2180 * You may obtain a copy of the License at
2181 *
2182 *   http://www.apache.org/licenses/LICENSE-2.0
2183 *
2184 * Unless required by applicable law or agreed to in writing, software
2185 * distributed under the License is distributed on an "AS IS" BASIS,
2186 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2187 * See the License for the specific language governing permissions and
2188 * limitations under the License.
2189 */class Vr{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}}Vr.UNAUTHENTICATED=new Vr(null),Vr.GOOGLE_CREDENTIALS=new Vr("google-credentials-uid"),Vr.FIRST_PARTY=new Vr("first-party-uid"),Vr.MOCK_USER=new Vr("mock-user");/**
2190 * @license
2191 * Copyright 2017 Google LLC
2192 *
2193 * Licensed under the Apache License, Version 2.0 (the "License");
2194 * you may not use this file except in compliance with the License.
2195 * You may obtain a copy of the License at
2196 *
2197 *   http://www.apache.org/licenses/LICENSE-2.0
2198 *
2199 * Unless required by applicable law or agreed to in writing, software
2200 * distributed under the License is distributed on an "AS IS" BASIS,
2201 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2202 * See the License for the specific language governing permissions and
2203 * limitations under the License.
2204 */let Su="10.14.0";/**
2205 * @license
2206 * Copyright 2017 Google LLC
2207 *
2208 * Licensed under the Apache License, Version 2.0 (the "License");
2209 * you may not use this file except in compliance with the License.
2210 * You may obtain a copy of the License at
2211 *
2212 *   http://www.apache.org/licenses/LICENSE-2.0
2213 *
2214 * Unless required by applicable law or agreed to in writing, software
2215 * distributed under the License is distributed on an "AS IS" BASIS,
2216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2217 * See the License for the specific language governing permissions and
2218 * limitations under the License.
2219 */const Yo=new uy("@firebase/firestore");function hd(){return Yo.logLevel}function be(t,...e){if(Yo.logLevel<=Ke.DEBUG){const r=e.map(VN);Yo.debug(`Firestore (${Su}): ${t}`,...r)}}function Es(t,...e){if(Yo.logLevel<=Ke.ERROR){const r=e.map(VN);Yo.error(`Firestore (${Su}): ${t}`,...r)}}function Ic(t,...e){if(Yo.logLevel<=Ke.WARN){const r=e.map(VN);Yo.warn(`Firestore (${Su}): ${t}`,...r)}}function VN(t){if(typeof t=="string")return t;try{/**
2220* @license
2221* Copyright 2020 Google LLC
2222*
2223* Licensed under the Apache License, Version 2.0 (the "License");
2224* you may not use this file except in compliance with the License.
2225* You may obtain a copy of the License at
2226*
2227*   http://www.apache.org/licenses/LICENSE-2.0
2228*
2229* Unless required by applicable law or agreed to in writing, software
2230* distributed under the License is distributed on an "AS IS" BASIS,
2231* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2232* See the License for the specific language governing permissions and
2233* limitations under the License.
2234*/return function(r){return JSON.stringify(r)}(t)}catch{return t}}/**
2235 * @license
2236 * Copyright 2017 Google LLC
2237 *
2238 * Licensed under the Apache License, Version 2.0 (the "License");
2239 * you may not use this file except in compliance with the License.
2240 * You may obtain a copy of the License at
2241 *
2242 *   http://www.apache.org/licenses/LICENSE-2.0
2243 *
2244 * Unless required by applicable law or agreed to in writing, software
2245 * distributed under the License is distributed on an "AS IS" BASIS,
2246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2247 * See the License for the specific language governing permissions and
2248 * limitations under the License.
2249 */function Ce(t="Unexpected state"){const e=`FIRESTORE (${Su}) INTERNAL ASSERTION FAILED: `+t;throw Es(e),new Error(e)}function ut(t,e){t||Ce()}function Re(t,e){return t}/**
2250 * @license
2251 * Copyright 2017 Google LLC
2252 *
2253 * Licensed under the Apache License, Version 2.0 (the "License");
2254 * you may not use this file except in compliance with the License.
2255 * You may obtain a copy of the License at
2256 *
2257 *   http://www.apache.org/licenses/LICENSE-2.0
2258 *
2259 * Unless required by applicable law or agreed to in writing, softw
2259are
2260 * distributed under the License is distributed on an "AS IS" BASIS,
2261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2262 * See the License for the specific language governing permissions and
2263 * limitations under the License.
2264 */const te={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class fe extends Zn{constructor(e,r){super(e,r),this.code=e,this.message=r,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
2265 * @license
2266 * Copyright 2017 Google LLC
2267 *
2268 * Licensed under the Apache License, Version 2.0 (the "License");
2269 * you may not use this file except in compliance with the License.
2270 * You may obtain a copy of the License at
2271 *
2272 *   http://www.apache.org/licenses/LICENSE-2.0
2273 *
2274 * Unless required by applicable law or agreed to in writing, software
2275 * distributed under the License is distributed on an "AS IS" BASIS,
2276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2277 * See the License for the specific language governing permissions and
2278 * limitations under the License.
2279 */class vs{constructor(){this.promise=new Promise((e,r)=>{this.resolve=e,this.reject=r})}}/**
2280 * @license
2281 * Copyright 2017 Google LLC
2282 *
2283 * Licensed under the Apache License, Version 2.0 (the "License");
2284 * you may not use this file except in compliance with the License.
2285 * You may obtain a copy of the License at
2286 *
2287 *   http://www.apache.org/licenses/LICENSE-2.0
2288 *
2289 * Unless required by applicable law or agreed to in writing, software
2290 * distributed under the License is distributed on an "AS IS" BASIS,
2291 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2292 * See the License for the specific language governing permissions and
2293 * limitations under the License.
2294 */class _5{constructor(e,r){this.user=r,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class uW{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,r){e.enqueueRetryable(()=>r(Vr.UNAUTHENTICATED))}shutdown(){}}class dW{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,r){this.changeListener=r,e.enqueueRetryable(()=>r(this.token.user))}shutdown(){this.changeListener=null}}class hW{constructor(e){this.t=e,this.currentUser=Vr.UNAUTHENTICATED,this.i=0,this.forceRefresh=!1,this.auth=null}start(e,r){ut(this.o===void 0);let n=this.i;const s=c=>this.i!==n?(n=this.i,r(c)):Promise.resolve();let i=new vs;this.o=()=>{this.i++,this.currentUser=this.u(),i.resolve(),i=new vs,e.enqueueRetryable(()=>s(this.currentUser))};const o=()=>{const c=i;e.enqueueRetryable(async()=>{await c.promise,await s(this.currentUser)})},l=c=>{be("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.o&&(this.auth.addAuthTokenListener(this.o),o())};this.t.onInit(c=>l(c)),setTimeout(()=>{if(!this.auth){const c=this.t.getImmediate({optional:!0});c?l(c):(be("FirebaseAuthCredentialsProvider","Auth not yet detected"),i.resolve(),i=new vs)}},0),o()}getToken(){const e=this.i,r=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(r).then(n=>this.i!==e?(be("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):n?(ut(typeof n.accessToken=="string"),new _5(n.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 ut(e===null||typeof e=="string"),new Vr(e)}}class mW{constructor(e,r,n){this.l=e,this.h=r,this.P=n,this.type="FirstParty",this.user=Vr.FIRST_PARTY,this.I=new Map}T(){return this.P?this.P():null}get headers(){this.I.set("X-Goog-AuthUser",this.l);const e=this.T();return e&&this.I.set("Authorization",e),this.h&&this.I.set("X-Goog-Iam-Authorization-Token",this.h),this.I}}class fW{constructor(e,r,n){this.l=e,this.h=r,this.P=n}getToken(){return Promise.resolve(new mW(this.l,this.h,this.P))}start(e,r){e.enqueueRetryable(()=>r(Vr.FIRST_PARTY))}shutdown(){}invalidateToken(){}}class pW{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 gW{constructor(e){this.A=e,this.forceRefresh=!1,this.appCheck=null,this.R=null}start(e,r){ut(this.o===void 0);const n=i=>{i.error!=null&&be("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${i.error.message}`);const o=i.token!==this.R;return this.R=i.token,be("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?r(i.token):Promise.resolve()};this.o=i=>{e.enqueueRetryable(()=>n(i))};const s=i=>{be("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=i,this.o&&this.appCheck.addTokenListener(this.o)};this.A.onInit(i=>s(i)),setTimeout(()=>{if(!this.appCheck){const i=this.A.getImmediate({optional:!0});i?s(i):be("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}},0)}getToken(){const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then(r=>r?(ut(typeof r.token=="string"),this.R=r.token,new pW(r.token)):null):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.o&&this.appCheck.removeTokenListener(this.o),this.o=void 0}}/**
2295 * @license
2296 * Copyright 2020 Google LLC
2297 *
2298 * Licensed under the Apache License, Version 2.0 (the "License");
2299 * you may not use this file except in compliance with the License.
2300 * You may obtain a copy of the License at
2301 *
2302 *   http://www.apache.org/licenses/LICENSE-2.0
2303 *
2304 * Unless required by applicable law or agreed to in writing, software
2305 * distributed under the License is distributed on an "AS IS" BASIS,
2306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2307 * See the License for the specific language governing permissions and
2308 * limitations under the License.
2309 */function xW(t){const e=typeof self<"u"&&(self.crypto||self.msCrypto),r=new Uint8Array(t);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(r);else for(let n=0;n<t;n++)r[n]=Math.floor(256*Math.random());return r}/**
2310 * @license
2311 * Copyright 2017 Google LLC
2312 *
2313 * Licensed under the Apache License, Version 2.0 (the "License");
2314 * you may not use this file except in compliance with the License.
2315 * You may obtain a copy of the License at
2316 *
2317 *   http://www.apache.org/licenses/LICENSE-2.0
2318 *
2319 * Unless required by applicable law or agreed to in writing, software
2320 * distributed under the License is distributed on an "AS IS" BASIS,
2321 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2322 * See the License for the specific language governing permissions and
2323 * limitations under the License.
2324 */class S5{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",r=Math.floor(256/e.length)*e.length;let n="";for(;n.length<20;){const s=xW(40);for(let i=0;i<s.length;++i)n.length<20&&s[i]<r&&(n+=e.charAt(s[i]%e.length))}return n}}function tt(t,e){return t<e?-1:t>e?1:0}function Oc(t,e,r){return t.length===e.length&&t.every((n,s)=>r(n,e[s]))}/**
2325 * @license
2326 * Copyright 2017 Google LLC
2327 *
2328 * Licensed under the Apache License, Version 2.0 (the "License");
2329 * you may not use this file except in compliance with the License.
2330 * You may obtain a copy of the License at
2331 *
2332 *   http://www.apache.org/licenses/LICENSE-2.0
2333 *
2334 * Unless required by applicable law or agreed to in writing, software
2335 * distributed under the License is distributed on an "AS IS" BASIS,
2336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2337 * See the License for the specific language governing permissions and
2338 * limitations under the License.
2339 */class We{constructor(e,r){if(this.seconds=e,this.nanoseconds=r,r<0)throw new fe(te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(r>=1e9)throw new fe(te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+r);if(e<-62135596800)throw new fe(te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new fe(te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}static now(){return We.fromMillis(Date.now())}static fromDate(e){return We.fromMillis(e.getTime())}static fromMillis(e){const r=Math.floor(e/1e3),n=Math.floor(1e6*(e-1e3*r));return new We(r,n)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/1e6}_compareTo(e){return this.seconds===e.seconds?tt(this.nanoseconds,e.nanoseconds):tt(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- -62135596800;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}/**
2340 * @license
2341 * Copyright 2017 Google LLC
2342 *
2343 * Licensed under the Apache License, Version 2.0 (the "License");
2344 * you may not use this file except in compliance with the License.
2345 * You may obtain a copy of the License at
2346 *
2347 *   http://www.apache.org/licenses/LICENSE-2.0
2348 *
2349 * Unless required by applicable law or agreed to in writing, software
2350 * distributed under the License is distributed on an "AS IS" BASIS,
2351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2352 * See the License for the specific language governing permissions and
2353 * limitations under the License.
2354 */class Oe{constructor(e){this.timestamp=e}static fromTimestamp(e){return new Oe(e)}static min(){return new Oe(new We(0,0))}static max(){return new Oe(new We(253402300799,999999999))}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}}/**
2355 * @license
2356 * Copyright 2017 Google LLC
2357 *
2358 * Licensed under the Apache License, Version 2.0 (the "License");
2359 * you may not use this file except in compliance with the License.
2360 * You may obtain a copy of the License at
2361 *
2362 *   http://www.apache.org/licenses/LICENSE-2.0
2363 *
2364 * Unless required by applicable law or agreed to in writing, software
2365 * distributed under the License is distributed on an "AS IS" BASIS,
2366 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2367 * See the License for the specific language governing permissions and
2368 * limitations under the License.
2369 */class Dh{constructor(e,r,n){r===void 0?r=0:r>e.length&&Ce(),n===void 0?n=e.length-r:n>e.length-r&&Ce(),this.segments=e,this.offset=r,this.len=n}get length(){return this.len}isEqual(e){return Dh.comparator(this,e)===0}child(e){const r=this.segments.slice(this.offset,this.limit());return e instanceof Dh?e.forEach(n=>{r.push(n)}):r.push(e),this.construct(r)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let r=0;r<this.length;r++)if(this.get(r)!==e.get(r))return!1;return!0}forEach(e){for(let r=this.offset,n=this.limit();r<n;r++)e(this.segments[r])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,r){const n=Math.min(e.length,r.length);for(let s=0;s<n;s++){const i=e.get(s),o=r.get(s);if(i<o)return-1;if(i>o)return 1}return e.length<r.length?-1:e.length>r.length?1:0}}class At extends Dh{construct(e,r,n){return new At(e,r,n)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const r=[];for(const n of e){if(n.indexOf("//")>=0)throw new fe(te.INVALID_ARGUMENT,`Invalid segment (${n}). Paths must not contain // in them.`);r.push(...n.split("/").filter(s=>s.length>0))}return new At(r)}static emptyPath(){return new At([])}}const yW=/^[_a-zA-Z][_a-zA-Z0-9]*$/;class Er extends Dh{construct(e,r,n){return new Er(e,r,n)}static isValidIdentifier(e){return yW.test(e)}canonicalString(){return this.toArray().map(e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),Er.isValidIdentifier(e)||(e="`"+e+"`"),e)).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)==="__name__"}static keyField(){return new Er(["__name__"])}static fromServerFormat(e){const r=[];let n="",s=0;const i=()=>{if(n.length===0)throw new fe(te.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);r.push(n),n=""};let o=!1;for(;s<e.length;){const l=e[s];if(l==="\\"){if(s+1===e.length)throw new fe(te.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const c=e[s+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new fe(te.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);n+=c,s+=2}else l==="`"?(o=!o,s++):l!=="."||o?(n+=l,s++):(i(),s++)}if(i(),o)throw new fe(te.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new Er(r)}static emptyPath(){return new Er([])}}/**
2370 * @license
2371 * Copyright 2017 Google LLC
2372 *
2373 * Licensed under the Apache License, Version 2.0 (the "License");
2374 * you may not use this file except in compliance with the License.
2375 * You may obtain a copy of the License at
2376 *
2377 *   http://www.apache.org/licenses/LICENSE-2.0
2378 *
2379 * Unless required by applicable law or agreed to in writing, software
2380 * distributed under the License is distributed on an "AS IS" BASIS,
2381 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2382 * See the License for the specific language governing permissions and
2383 * limitations under the License.
2384 */class _e{constructor(e){this.path=e}static fromPath(e){return new _e(At.fromString(e))}static fromName(e){return new _e(At.fromString(e).popFirst(5))}static empty(){return new _e(At.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&At.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,r){return At.comparator(e.path,r.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new _e(new At(e.slice()))}}function vW(t,e){const r=t.toTimestamp().seconds,n=t.toTimestamp().nanoseconds+1,s=Oe.fromTimestamp(n===1e9?new We(r+1,0):new We(r,n));return new Di(s,_e.empty(),e)}function bW(t){return new Di(t.readTime,t.key,-1)}class Di{constructor(e,r,n){this.readTime=e,this.documentKey=r,this.largestBatchId=n}static min(){return new Di(Oe.min(),_e.empty(),-1)}static max(){return new Di(Oe.max(),_e.empty(),-1)}}function wW(t,e){let r=t.readTime.compareTo(e.readTime);return r!==0?r:(r=_e.comparator(t.documentKey,e.documentKey),r!==0?r:tt(t.largestBatchId,e.largestBatchId))}/**
2385 * @license
2386 * Copyright 2020 Google LLC
2387 *
2388 * Licensed under the Apache License, Version 2.0 (the "License");
2389 * you may not use this file except in compliance with the License.
2390 * You may obtain a copy of the License at
2391 *
2392 *   http://www.apache.org/licenses/LICENSE-2.0
2393 *
2394 * Unless required by applicable law or agreed to in writing, software
2395 * distributed under the License is distributed on an "AS IS" BASIS,
2396 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2397 * See the License for the specific language governing permissions and
2398 * limitations under the License.
2399 */const jW="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class NW{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach(e=>e())}}/**
2400 * @license
2401 * Copyright 2017 Google LLC
2402 *
2403 * Licensed under the Apache License, Version 2.0 (the "License");
2404 * you may not use this file except in compliance with the License.
2405 * You may obtain a copy of the License at
2406 *
2407 *   http://www.apache.org/licenses/LICENSE-2.0
2408 *
2409 * Unless required by applicable law or agreed to in writing, software
2410 * distributed under the License is distributed on an "AS IS" BASIS,
2411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2412 * See the License for the specific language governing permissions and
2413 * limitations under the License.
2414 */async function $m(t){if(t.code!==te.FAILED_PRECONDITION||t.message!==jW)throw t;be("LocalStore","Unexpectedly lost primary lease")}/**
2415 * @license
2416 * Copyright 2017 Google LLC
2417 *
2418 * Licensed under the Apache License, Version 2.0 (the "License");
2419 * you may not use this file except in compliance with the License.
2420 * You may obtain a copy of the License at
2421 *
2422 *   http://www.apache.org/licenses/LICENSE-2.0
2423 *
2424 * Unless required by applicable law or agreed to in writing, software
2425 * distributed under the License is distributed on an "AS IS" BASIS,
2426 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2427 * See the License for the specific language governing permissions and
2428 * limitations under the License.
2429 */class se{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e(r=>{this.isDone=!0,this.result=r,this.nextCallback&&this.nextCallback(r)},r=>{this.isDone=!0,this.error=r,this.catchCallback&&this.catchCallback(r)})}catch(e){return this.next(void 0,e)}next(e,r){return this.callbackAttached&&Ce(),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(r,this.error):this.wrapSuccess(e,this.result):new se((n,s)=>{this.nextCallback=i=>{this.wrapSuccess(e,i).next(n,s)},this.catchCallback=i=>{this.wrapFailure(r,i).next(n,s)}})}toPromise(){return new Promise((e,r)=>{this.next(e,r)})}wrapUserFunction(e){try{const r=e();return r instanceof se?r:se.resolve(r)}catch(r){return se.reject(r)}}wrapSuccess(e,r){return e?this.wrapUserFunction(()=>e(r)):se.resolve(r)}wrapFailure(e,r){return e?this.wrapUserFunction(()=>e(r)):se.reject(r)}static resolve(e){return new se((r,n)=>{r(e)})}static reject(e){return new se((r,n)=>{n(e)})}static waitFor(e){return new se((r,n)=>{let s=0,i=0,o=!1;e.forEach(l=>{++s,l.next(()=>{++i,o&&i===s&&r()},c=>n(c))}),o=!0,i===s&&r()})}static or(e){let r=se.resolve(!1);for(const n of e)r=r.next(s=>s?se.resolve(s):n());return r}static forEach(e,r){const n=[];return e.forEach((s,i)=>{n.push(r.call(this,s,i))}),this.waitFor(n)}static mapArray(e,r){return new se((n,s)=>{const i=e.length,o=new Array(i);let l=0;for(let c=0;c<i;c++){const u=c;r(e[u]).next(d=>{o[u]=d,++l,l===i&&n(o)},d=>s(d))}})}static doWhile(e,r){return new se((n,s)=>{const i=()=>{e()===!0?r().next(()=>{i()},s):n()};i()})}}function _W(t){const e=t.match(/Android ([\d.]+)/i),r=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(r)}function Lm(t){return t.name==="IndexedDbTransactionError"}/**
2430 * @license
2431 * Copyright 2018 Google LLC
2432 *
2433 * Licensed under the Apache License, Version 2.0 (the "License");
2434 * you may not use this file except in compliance with the License.
2435 * You may obtain a copy of the License at
2436 *
2437 *   http://www.apache.org/licenses/LICENSE-2.0
2438 *
2439 * Unless required by applicable law or agreed to in writing, softw
2439are
2440 * distributed under the License is distributed on an "AS IS" BASIS,
2441 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2442 * See the License for the specific language governing permissions and
2443 * limitations under the License.
2444 */class UN{constructor(e,r){this.previousValue=e,r&&(r.sequenceNumberHandler=n=>this.ie(n),this.se=n=>r.writeSequenceNumber(n))}ie(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.se&&this.se(e),e}}UN.oe=-1;function py(t){return t==null}function _g(t){return t===0&&1/t==-1/0}function SW(t){return typeof t=="number"&&Number.isInteger(t)&&!_g(t)&&t<=Number.MAX_SAFE_INTEGER&&t>=Number.MIN_SAFE_INTEGER}/**
2445 * @license
2446 * Copyright 2017 Google LLC
2447 *
2448 * Licensed under the Apache License, Version 2.0 (the "License");
2449 * you may not use this file except in compliance with the License.
2450 * You may obtain a copy of the License at
2451 *
2452 *   http://www.apache.org/licenses/LICENSE-2.0
2453 *
2454 * Unless required by applicable law or agreed to in writing, software
2455 * distributed under the License is distributed on an "AS IS" BASIS,
2456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2457 * See the License for the specific language governing permissions and
2458 * limitations under the License.
2459 */function aE(t){let e=0;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}function yl(t,e){for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&e(r,t[r])}function T5(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}/**
2460 * @license
2461 * Copyright 2017 Google LLC
2462 *
2463 * Licensed under the Apache License, Version 2.0 (the "License");
2464 * you may not use this file except in compliance with the License.
2465 * You may obtain a copy of the License at
2466 *
2467 *   http://www.apache.org/licenses/LICENSE-2.0
2468 *
2469 * Unless required by applicable law or agreed to in writing, software
2470 * distributed under the License is distributed on an "AS IS" BASIS,
2471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2472 * See the License for the specific language governing permissions and
2473 * limitations under the License.
2474 */class Lt{constructor(e,r){this.comparator=e,this.root=r||Tr.EMPTY}insert(e,r){return new Lt(this.comparator,this.root.insert(e,r,this.comparator).copy(null,null,Tr.BLACK,null,null))}remove(e){return new Lt(this.comparator,this.root.remove(e,this.comparator).copy(null,null,Tr.BLACK,null,null))}get(e){let r=this.root;for(;!r.isEmpty();){const n=this.comparator(e,r.key);if(n===0)return r.value;n<0?r=r.left:n>0&&(r=r.right)}return null}indexOf(e){let r=0,n=this.root;for(;!n.isEmpty();){const s=this.comparator(e,n.key);if(s===0)return r+n.left.size;s<0?n=n.left:(r+=n.left.size+1,n=n.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((r,n)=>(e(r,n),!1))}toString(){const e=[];return this.inorderTraversal((r,n)=>(e.push(`${r}:${n}`),!1)),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new zf(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new zf(this.root,e,this.comparator,!1)}getReverseIterator(){return new zf(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new zf(this.root,e,this.comparator,!0)}}class zf{constructor(e,r,n,s){this.isReverse=s,this.nodeStack=[];let i=1;for(;!e.isEmpty();)if(i=r?n(e.key,r):1,r&&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 r={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 r}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 Tr{constructor(e,r,n,s,i){this.key=e,this.value=r,this.color=n??Tr.RED,this.left=s??Tr.EMPTY,this.right=i??Tr.EMPTY,this.size=this.left.size+1+this.right.size}
vendor: 5,036 bytes, lines 2474-2489
2474copy(e,r,n,s,i){return new Tr(e??this.key,r??this.value,n??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,r,n){let s=this;const i=n(e,s.key);return s=i<0?s.copy(null,null,null,s.left.insert(e,r,n),null):i===0?s.copy(null,r,null,null,null):s.copy(null,null,null,null,s.right.insert(e,r,n)),s.fixUp()}removeMin(){if(this.left.isEmpty())return Tr.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,r){let n,s=this;if(r(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,r),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),r(e,s.key)===0){if(s.right.isEmpty())return Tr.EMPTY;n=s.right.min(),s=s.copy(n.key,n.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,r))}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,Tr.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,Tr.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),r=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,r)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed()||this.right.isRed())throw Ce();const e=this.left.check();if(e!==this.right.check())throw Ce();return e+(this.isRed()?0:1)}}Tr.EMPTY=null,Tr.RED=!0,Tr.BLACK=!1;Tr.EMPTY=new class{constructor(){this.size=0}get key(){throw Ce()}get value(){throw Ce()}get color(){throw Ce()}get left(){throw Ce()}get right(){throw Ce()}copy(e,r,n,s,i){return this}insert(e,r,n){return new Tr(e,r)}remove(e,r){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}};/**
2475 * @license
2476 * Copyright 2017 Google LLC
2477 *
2478 * Licensed under the Apache License, Version 2.0 (the "License");
2479 * you may not use this file except in compliance with the License.
2480 * You may obtain a copy of the License at
2481 *
2482 *   http://www.apache.org/licenses/LICENSE-2.0
2483 *
2484 * Unless required by applicable law or agreed to in writing, software
2485 * distributed under the License is distributed on an "AS IS" BASIS,
2486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2487 * See the License for the specific language governing permissions and
2488 * limitations under the License.
2489 */class Pr{constructor(e){this.comparator=e,this.data=new Lt(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((r,n)=>(e(r),!1))}forEachInRange(e,r){const n=this.data.getIteratorFrom(e[0]);for(;n.hasNext();){const s=n.getNext();if(this.comparator(s.key,e[1])>=0)return;r(s.key)}}forEachWhile(e,r){let n;for(n=r!==void 0?this.data.getIteratorFrom(r):this.data.getIterator();n.hasNext();)if(!e(n.getNext().key))return}firstAfterOrEqual(e){const r=this.data.getIteratorFrom(e);return r.hasNext()?r.getNext().key:null}getIterator(){return new sE(this.data.getIterator())}getIteratorFrom(e){return new sE(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 r=this;return r.size<e.size&&(r=e,e=this),e.forEach(n=>{r=r.add(n)}),r}isEqual(e){if(!(e instanceof Pr)||this.size!==e.size)return!1;const r=this.data.getIterator(),n=e.data.getIterator();for(;r.hasNext();){const s=r.getNext().key,i=n.getNext().key;if(this.comparator(s,i)!==0)return!1}return!0}toArray(){const e=[];return this.forEach(r=>{e.push(r)}),e}toString(){const e=[];return this.forEach(r=>e.push(r)),"SortedSet("+e.toString()+")"}copy(e){const r=new Pr(this.comparator);return r.data=e,r}}
vendor: 1,065 bytes, lines 2489-2504
2489class sE{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}/**
2490 * @license
2491 * Copyright 2020 Google LLC
2492 *
2493 * Licensed under the Apache License, Version 2.0 (the "License");
2494 * you may not use this file except in compliance with the License.
2495 * You may obtain a copy of the License at
2496 *
2497 *   http://www.apache.org/licenses/LICENSE-2.0
2498 *
2499 * Unless required by applicable law or agreed to in writing, software
2500 * distributed under the License is distributed on an "AS IS" BASIS,
2501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2502 * See the License for the specific language governing permissions and
2503 * limitations under the License.
2504 */class An{constructor(e){this.fields=e,e.sort(Er.comparator)}static empty(){return new An([])}unionWith(e){let r=new Pr(Er.comparator);for(const n of this.fields)r=r.add(n);for(const n of e)r=r.add(n);return new An(r.toArray())}covers(e){for(const r of this.fields)if(r.isPrefixOf(e))return!0;return!1}isEqual(e){return Oc(this.fields,e.fields,(r,
2504n)=>r.isEqual(n))}}/**
2505 * @license
2506 * Copyright 2023 Google LLC
2507 *
2508 * Licensed under the Apache License, Version 2.0 (the "License");
2509 * you may not use this file except in compliance with the License.
2510 * You may obtain a copy of the License at
2511 *
2512 *   http://www.apache.org/licenses/LICENSE-2.0
2513 *
2514 * Unless required by applicable law or agreed to in writing, software
2515 * distributed under the License is distributed on an "AS IS" BASIS,
2516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2517 * See the License for the specific language governing permissions and
2518 * limitations under the License.
2519 */class A5 extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
2520 * @license
2521 * Copyright 2020 Google LLC
2522 *
2523 * Licensed under the Apache License, Version 2.0 (the "License");
2524 * you may not use this file except in compliance with the License.
2525 * You may obtain a copy of the License at
2526 *
2527 *   http://www.apache.org/licenses/LICENSE-2.0
2528 *
2529 * Unless required by applicable law or agreed to in writing, software
2530 * distributed under the License is distributed on an "AS IS" BASIS,
2531 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2532 * See the License for the specific language governing permissions and
2533 * limitations under the License.
2534 */class Ir{constructor(e){this.binaryString=e}static fromBase64String(e){const r=function(s){try{return atob(s)}catch(i){throw typeof DOMException<"u"&&i instanceof DOMException?new A5("Invalid base64 string: "+i):i}}(e);return new Ir(r)}static fromUint8Array(e){const r=function(s){let i="";for(let o=0;o<s.length;++o)i+=String.fromCharCode(s[o]);return i}(e);return new Ir(r)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return function(r){return btoa(r)}(this.binaryString)}toUint8Array(){return function(r){const n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return n}(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return tt(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Ir.EMPTY_BYTE_STRING=new Ir("");const TW=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function Mi(t){if(ut(!!t),typeof t=="string"){let e=0;const r=TW.exec(t);if(ut(!!r),r[1]){let s=r[1];s=(s+"000000000").substr(0,9),e=Number(s)}const n=new Date(t);return{seconds:Math.floor(n.getTime()/1e3),nanos:e}}return{seconds:qt(t.seconds),nanos:qt(t.nanos)}}function qt(t){return typeof t=="number"?t:typeof t=="string"?Number(t):0}function Qo(t){return typeof t=="string"?Ir.fromBase64String(t):Ir.fromUint8Array(t)}/**
2535 * @license
2536 * Copyright 2020 Google LLC
2537 *
2538 * Licensed under the Apache License, Version 2.0 (the "License");
2539 * you may not use this file except in compliance with the License.
2540 * You may obtain a copy of the License at
2541 *
2542 *   http://www.apache.org/licenses/LICENSE-2.0
2543 *
2544 * Unless required by applicable law or agreed to in writing, software
2545 * distributed under the License is distributed on an "AS IS" BASIS,
2546 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2547 * See the License for the specific language governing permissions and
2548 * limitations under the License.
2549 */function zN(t){var e,r;return((r=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="server_timestamp"}function HN(t){const e=t.mapValue.fields.__previous_value__;return zN(e)?HN(e):e}function Mh(t){const e=Mi(t.mapValue.fields.__local_write_time__.timestampValue);return new We(e.seconds,e.nanos)}/**
2550 * @license
2551 * Copyright 2017 Google LLC
2552 *
2553 * Licensed under the Apache License, Version 2.0 (the "License");
2554 * you may not use this file except in compliance with the License.
2555 * You may obtain a copy of the License at
2556 *
2557 *   http://www.apache.org/licenses/LICENSE-2.0
2558 *
2559 * Unless required by applicable law or agreed to in writing, software
2560 * distributed under the License is distributed on an "AS IS" BASIS,
2561 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2562 * See the License for the specific language governing permissions and
2563 * limitations under the License.
2564 */class AW{constructor(e,r,n,s,i,o,l,c,u){this.databaseId=e,this.appId=r,this.persistenceKey=n,this.host=s,this.ssl=i,this.forceLongPolling=o,this.autoDetectLongPolling=l,this.longPollingOptions=c,this.useFetchStreams=u}}class $h{constructor(e,r){this.projectId=e,this.database=r||"(default)"}static empty(){return new $h("","")}get isDefaultDatabase(){return this.database==="(default)"}isEqual(e){return e instanceof $h&&e.projectId===this.projectId&&e.database===this.database}}/**
2565 * @license
2566 * Copyright 2020 Google LLC
2567 *
2568 * Licensed under the Apache License, Version 2.0 (the "License");
2569 * you may not use this file except in compliance with the License.
2570 * You may obtain a copy of the License at
2571 *
2572 *   http://www.apache.org/licenses/LICENSE-2.0
2573 *
2574 * Unless required by applicable law or agreed to in writing, software
2575 * distributed under the License is distributed on an "AS IS" BASIS,
2576 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2577 * See the License for the specific language governing permissions and
2578 * limitations under the License.
2579 */const Hf={mapValue:{}};function Jo(t){return"nullValue"in t?0:"booleanValue"in t?1:"integerValue"in t||"doubleValue"in t?2:"timestampValue"in t?3:"stringValue"in t?5:"bytesValue"in t?6:"referenceValue"in t?7:"geoPointValue"in t?8:"arrayValue"in t?9:"mapValue"in t?zN(t)?4:kW(t)?9007199254740991:EW(t)?10:11:Ce()}function Ga(t,e){if(t===e)return!0;const r=Jo(t);if(r!==Jo(e))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return t.booleanValue===e.booleanValue;case 4:return Mh(t).isEqual(Mh(e));case 3:return function(s,i){if(typeof s.timestampValue=="string"&&typeof i.timestampValue=="string"&&s.timestampValue.length===i.timestampValue.length)return s.timestampValue===i.timestampValue;const o=Mi(s.timestampValue),l=Mi(i.timestampValue);return o.seconds===l.seconds&&o.nanos===l.nanos}(t,e);case 5:return t.stringValue===e.stringValue;case 6:return function(s,i){return Qo(s.bytesValue).isEqual(Qo(i.bytesValue))}(t,e);case 7:return t.referenceValue===e.referenceValue;case 8:return function(s,i){return qt(s.geoPointValue.latitude)===qt(i.geoPointValue.latitude)&&qt(s.geoPointValue.longitude)===qt(i.geoPointValue.longitude)}(t,e);case 2:return function(s,i){if("integerValue"in s&&"integerValue"in i)return qt(s.integerValue)===qt(i.integerValue);if("doubleValue"in s&&"doubleValue"in i){const o=qt(s.doubleValue),l=qt(i.doubleValue);return o===l?_g(o)===_g(l):isNaN(o)&&isNaN(l)}return!1}(t,e);case 9:return Oc(t.arrayValue.values||[],e.arrayValue.values||[],Ga);case 10:case 11:return function(s,i){const o=s.mapValue.fields||{},l=i.mapValue.fields||{};if(aE(o)!==aE(l))return!1;for(const c in o)if(o.hasOwnProperty(c)&&(l[c]===void 0||!Ga(o[c],l[c])))return!1;return!0}(t,e);default:return Ce()}}function Lh(t,e){return(t.values||[]).find(r=>Ga(r,e))!==void 0}function Rc(t,e){if(t===e)return 0;const r=Jo(t),n=Jo(e);if(r!==n)return tt(r,n);switch(r){case 0:case 9007199254740991:return 0;case 1:return tt(t.booleanValue,e.booleanValue);case 2:return function(i,o){const l=qt(i.integerValue||i.doubleValue),c=qt(o.integerValue||o.doubleValue);return l<c?-1:l>c?1:l===c?0:isNaN(l)?isNaN(c)?0:-1:1}(t,e);case 3:return iE(t.timestampValue,e.timestampValue);case 4:return iE(Mh(t),Mh(e));case 5:return tt(t.stringValue,e.stringValue);case 6:return function(i,o){const l=Qo(i),c=Qo(o);return l.compareTo(c)}(t.bytesValue,e.bytesValue);case 7:return function(i,o){const l=i.split("/"),c=o.split("/");for(let u=0;u<l.length&&u<c.length;u++){const d=tt(l[u],c[u]);if(d!==0)return d}return tt(l.length,c.length)}(t.referenceValue,e.referenceValue);case 8:return function(i,o){const l=tt(qt(i.latitude),qt(o.latitude));return l!==0?l:tt(qt(i.longitude),qt(o.longitude))}(t.geoPointValue,e.geoPointValue);case 9:return oE(t.arrayValue,e.arrayValue);case 10:return function(i,o){var l,c,u,d;const h=i.fields||{},m=o.fields||{},p=(l=h.value)===null||l===void 0?void 0:l.arrayValue,x=(c=m.value)===null||c===void 0?void 0:c.arrayValue,w=tt(((u=p==null?void 0:p.values)===null||u===void 0?void 0:u.length)||0,((d=x==null?void 0:x.values)===null||d===void 0?void 0:d.length)||0);return w!==0?w:oE(p,x)}(t.mapValue,e.mapValue);case 11:return function(i,o){if(i===Hf.mapValue&&o===Hf.mapValue)return 0;if(i===Hf.mapValue)return 1;if(o===Hf.mapValue)return-1;const l=i.fields||{},c=Object.keys(l),u=o.fields||{},d=Object.keys(u);c.sort(),d.sort();for(let h=0;h<c.length&&h<d.length;++h){const m=tt(c[h],d[h]);if(m!==0)return m;const p=Rc(l[c[h]],u[d[h]]);if(p!==0)return p}return tt(c.length,d.length)}(t.mapValue,e.mapValue);default:throw Ce()}}function iE(t,e){if(typeof t=="string"&&typeof e=="string"&&t.length===e.length)return tt(t,e);const r=Mi(t),n=Mi(e),s=tt(r.seconds,n.seconds);return s!==0?s:tt(r.nanos,n.nanos)}function oE(t,e){const r=t.values||[],n=e.values||[];for(let s=0;s<r.length&&s<n.length;++s){const i=Rc(r[s],n[s]);if(i)return i}return tt(r.length,n.length)}function Dc(t){return Dw(t)}function Dw(t){return"nullValue"in t?"null":"booleanValue"in t?""+t.booleanValue:"integerValue"in t?""+t.integerValue:"doubleValue"in t?""+t.doubleValue:"timestampValue"in t?function(r){const n=Mi(r);return`time(${n.seconds},${n.nanos})`}(t.timestampValue):"stringValue"in t?t.stringValue:"bytesValue"in t?function(r){return Qo(r).toBase64()}(t.bytesValue):"referenceValue"in t?function(r){return _e.fromName(r).toString()}(t.referenceValue):"geoPointValue"in t?function(r){return`geo(${r.latitude},${r.longitude})`}(t.geoPointValue):"arrayValue"in t?function(r){let n="[",s=!0;for(const i of r.values||[])s?s=!1:n+=",",n+=Dw(i);return n+"]"}(t.arrayValue):"mapValue"in t?function(r){const n=Object.keys(r.fields||{}).sort();let s="{",i=!0;for(const o of n)i?i=!1:s+=",",s+=`${o}:${Dw(r.fields[o])}`;return s+"}"}(t.mapValue):Ce()}function lE(t,e){return{referenceValue:`projects/${t.projectId}/databases/${t.database}/documents/${e.path.canonicalString()}`}}function Mw(t){return!!t&&"integerValue"in t}function qN(t){return!!t&&"arrayValue"in t}function cE(t){return!!t&&"nullValue"in t}function uE(t){return!!t&&"doubleValue"in t&&isNaN(Number(t.doubleValue))}function Rp(t){return!!t&&"mapValue"in t}function EW(t){var e,r;return((r=(((e=t==null?void 0:t.mapValue)===null||e===void 0?void 0:e.fields)||{}).__type__)===null||r===void 0?void 0:r.stringValue)==="__vector__"}function Jd(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:{}}};
vendor: 6,373 bytes, lines 2579-2634
2579return yl(t.mapValue.fields,(r,n)=>e.mapValue.fields[r]=Jd(n)),e}if(t.arrayValue){const e={arrayValue:{values:[]}};for(let r=0;r<(t.arrayValue.values||[]).length;++r)e.arrayValue.values[r]=Jd(t.arrayValue.values[r]);return e}return Object.assign({},t)}function kW(t){return(((t.mapValue||{}).fields||{}).__type__||{}).stringValue==="__max__"}/**
2580 * @license
2581 * Copyright 2017 Google LLC
2582 *
2583 * Licensed under the Apache License, Version 2.0 (the "License");
2584 * you may not use this file except in compliance with the License.
2585 * You may obtain a copy of the License at
2586 *
2587 *   http://www.apache.org/licenses/LICENSE-2.0
2588 *
2589 * Unless required by applicable law or agreed to in writing, software
2590 * distributed under the License is distributed on an "AS IS" BASIS,
2591 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2592 * See the License for the specific language governing permissions and
2593 * limitations under the License.
2594 */class ln{constructor(e){this.value=e}static empty(){return new ln({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let r=this.value;for(let n=0;n<e.length-1;++n)if(r=(r.mapValue.fields||{})[e.get(n)],!Rp(r))return null;return r=(r.mapValue.fields||{})[e.lastSegment()],r||null}}set(e,r){this.getFieldsMap(e.popLast())[e.lastSegment()]=Jd(r)}setAll(e){let r=Er.emptyPath(),n={},s=[];e.forEach((o,l)=>{if(!r.isImmediateParentOf(l)){const c=this.getFieldsMap(r);this.applyChanges(c,n,s),n={},s=[],r=l.popLast()}o?n[l.lastSegment()]=Jd(o):s.push(l.lastSegment())});const i=this.getFieldsMap(r);this.applyChanges(i,n,s)}delete(e){const r=this.field(e.popLast());Rp(r)&&r.mapValue.fields&&delete r.mapValue.fields[e.lastSegment()]}isEqual(e){return Ga(this.value,e.value)}getFieldsMap(e){let r=this.value;r.mapValue.fields||(r.mapValue={fields:{}});for(let n=0;n<e.length;++n){let s=r.mapValue.fields[e.get(n)];Rp(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},r.mapValue.fields[e.get(n)]=s),r=s}return r.mapValue.fields}applyChanges(e,r,n){yl(r,(s,i)=>e[s]=i);for(const s of n)delete e[s]}clone(){return new ln(Jd(this.value))}}function E5(t){const e=[];return yl(t.fields,(r,n)=>{const s=new Er([r]);if(Rp(n)){const i=E5(n.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 An(e)}/**
2595 * @license
2596 * Copyright 2017 Google LLC
2597 *
2598 * Licensed under the Apache License, Version 2.0 (the "License");
2599 * you may not use this file except in compliance with the License.
2600 * You may obtain a copy of the License at
2601 *
2602 *   http://www.apache.org/licenses/LICENSE-2.0
2603 *
2604 * Unless required by applicable law or agreed to in writing, software
2605 * distributed under the License is distributed on an "AS IS" BASIS,
2606 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2607 * See the License for the specific language governing permissions and
2608 * limitations under the License.
2609 */class zr{constructor(e,r,n,s,i,o,l){this.key=e,this.documentType=r,this.version=n,this.readTime=s,this.createTime=i,this.data=o,this.documentState=l}static newInvalidDocument(e){return new zr(e,0,Oe.min(),Oe.min(),Oe.min(),ln.empty(),0)}static newFoundDocument(e,r,n,s){return new zr(e,1,r,Oe.min(),n,s,0)}static newNoDocument(e,r){return new zr(e,2,r,Oe.min(),Oe.min(),ln.empty(),0)}static newUnknownDocument(e,r){return new zr(e,3,r,Oe.min(),Oe.min(),ln.empty(),2)}convertToFoundDocument(e,r){return!this.createTime.isEqual(Oe.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=r,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=ln.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=ln.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=Oe.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 zr&&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 zr(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}})`}}/**
2610 * @license
2611 * Copyright 2022 Google LLC
2612 *
2613 * Licensed under the Apache License, Version 2.0 (the "License");
2614 * you may not use this file except in compliance with the License.
2615 * You may obtain a copy of the License at
2616 *
2617 *   http://www.apache.org/licenses/LICENSE-2.0
2618 *
2619 * Unless required by applicable law or agreed to in writing, software
2620 * distributed under the License is distributed on an "AS IS" BASIS,
2621 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2622 * See the License for the specific language governing permissions and
2623 * limitations under the License.
2624 */class Sg{constructor(e,r){this.position=e,this.inclusive=r}}function dE(t,e,r){let n=0;for(let s=0;s<t.position.length;s++){const i=e[s],o=t.position[s];if(i.field.isKeyField()?n=_e.comparator(_e.fromName(o.referenceValue),r.key):n=Rc(o,r.data.field(i.field)),i.dir==="desc"&&(n*=-1),n!==0)break}return n}function hE(t,e){if(t===null)return e===null;if(e===null||t.inclusive!==e.inclusive||t.position.length!==e.position.length)return!1;for(let r=0;r<t.position.length;r++)if(!Ga(t.position[r],e.position[r]))return!1;return!0}/**
2625 * @license
2626 * Copyright 2022 Google LLC
2627 *
2628 * Licensed under the Apache License, Version 2.0 (the "License");
2629 * you may not use this file except in compliance with the License.
2630 * You may obtain a copy of the License at
2631 *
2632 *   http://www.apache.org/licenses/LICENSE-2.0
2633 *
2634 * Unless required by applicable law or agreed to in writing, softw
2634are
2635 * distributed under the License is distributed on an "AS IS" BASIS,
2636 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2637 * See the License for the specific language governing permissions and
2638 * limitations under the License.
2639 */class Fh{constructor(e,r="asc"){this.field=e,this.dir=r}}function PW(t,e){return t.dir===e.dir&&t.field.isEqual(e.field)}/**
2640 * @license
2641 * Copyright 2022 Google LLC
2642 *
2643 * Licensed under the Apache License, Version 2.0 (the "License");
2644 * you may not use this file except in compliance with the License.
2645 * You may obtain a copy of the License at
2646 *
2647 *   http://www.apache.org/licenses/LICENSE-2.0
2648 *
2649 * Unless required by applicable law or agreed to in writing, software
2650 * distributed under the License is distributed on an "AS IS" BASIS,
2651 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2652 * See the License for the specific language governing permissions and
2653 * limitations under the License.
2654 */class k5{}class Qt extends k5{constructor(e,r,n){super(),this.field=e,this.op=r,this.value=n}static create(e,r,n){return e.isKeyField()?r==="in"||r==="not-in"?this.createKeyFieldInFilter(e,r,n):new IW(e,r,n):r==="array-contains"?new DW(e,n):r==="in"?new MW(e,n):r==="not-in"?new $W(e,n):r==="array-contains-any"?new LW(e,n):new Qt(e,r,n)}static createKeyFieldInFilter(e,r,n){return r==="in"?new OW(e,n):new RW(e,n)}matches(e){const r=e.data.field(this.field);return this.op==="!="?r!==null&&this.matchesComparison(Rc(r,this.value)):r!==null&&Jo(this.value)===Jo(r)&&this.matchesComparison(Rc(r,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return Ce()}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class va extends k5{constructor(e,r){super(),this.filters=e,this.op=r,this.ae=null}static create(e,r){return new va(e,r)}matches(e){return P5(this)?this.filters.find(r=>!r.matches(e))===void 0:this.filters.find(r=>r.matches(e))!==void 0}getFlattenedFilters(){return this.ae!==null||(this.ae=this.filters.reduce((e,r)=>e.concat(r.getFlattenedFilters()),[])),this.ae}getFilters(){return Object.assign([],this.filters)}}function P5(t){return t.op==="and"}function C5(t){return CW(t)&&P5(t)}function CW(t){for(const e of t.filters)if(e instanceof va)return!1;return!0}function $w(t){if(t instanceof Qt)return t.field.canonicalString()+t.op.toString()+Dc(t.value);if(C5(t))return t.filters.map(e=>$w(e)).join(",");{const e=t.filters.map(r=>$w(r)).join(",");return`${t.op}(${e})`}}function I5(t,e){return t instanceof Qt?function(n,s){return s instanceof Qt&&n.op===s.op&&n.field.isEqual(s.field)&&Ga(n.value,s.value)}(t,e):t instanceof va?function(n,s){return s instanceof va&&n.op===s.op&&n.filters.length===s.filters.length?n.filters.reduce((i,o,l)=>i&&I5(o,s.filters[l]),!0):!1}(t,e):void Ce()}function O5(t){return t instanceof Qt?function(r){return`${r.field.canonicalString()} ${r.op} ${Dc(r.value)}`}(t):t instanceof va?function(r){return r.op.toString()+" {"+r.getFilters().map(O5).join(" ,")+"}"}(t):"Filter"}class IW extends Qt{constructor(e,r,n){super(e,r,n),this.key=_e.fromName(n.referenceValue)}matches(e){const r=_e.comparator(e.key,this.key);return this.matchesComparison(r)}}class OW extends Qt{constructor(e,r){super(e,"in",r),this.keys=R5("in",r)}matches(e){return this.keys.some(r=>r.isEqual(e.key))}}class RW extends Qt{constructor(e,r){super(e,"not-in",r),this.keys=R5("not-in",r)}matches(e){return!this.keys.some(r=>r.isEqual(e.key))}}function R5(t,e){var r;return(((r=e.arrayValue)===null||r===void 0?void 0:r.values)||[]).map(n=>_e.fromName(n.referenceValue))}class DW extends Qt{constructor(e,r){super(e,"array-contains",r)}matches(e){const r=e.data.field(this.field);return qN(r)&&Lh(r.arrayValue,this.value)}}class MW extends Qt{constructor(e,r){super(e,"in",r)}matches(e){const r=e.data.field(this.field);return r!==null&&Lh(this.value.arrayValue,r)}}class $W extends Qt{constructor(e,r){super(e,"not-in",r)}matches(e){if(Lh(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const r=e.data.field(this.field);return r!==null&&!Lh(this.value.arrayValue,r)}}class LW extends Qt{constructor(e,r){super(e,"array-contains-any",r)}matches(e){const r=e.data.field(this.field);return!(!qN(r)||!r.arrayValue.values)&&r.arrayValue.values.some(n=>Lh(this.value.arrayValue,n))}}/**
2655 * @license
2656 * Copyright 2019 Google LLC
2657 *
2658 * Licensed under the Apache License, Version 2.0 (the "License");
2659 * you may not use this file except in compliance with the License.
2660 * You may obtain a copy of the License at
2661 *
2662 *   http://www.apache.org/licenses/LICENSE-2.0
2663 *
2664 * Unless required by applicable law or agreed to in writing, software
2665 * distributed under the License is distributed on an "AS IS" BASIS,
2666 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2667 * See the License for the specific language governing permissions and
2668 * limitations under the License.
2669 */class FW{constructor(e,r=null,n=[],s=[],i=null,o=null,l=null){this.path=e,this.collectionGroup=r,this.orderBy=n,this.filters=s,this.limit=i,this.startAt=o,this.endAt=l,this.ue=null}}function mE(t,e=null,r=[],n=[],s=null,i=null,o=null){return new FW(t,e,r,n,s,i,o)}function WN(t){const e=Re(t);if(e.ue===null){let r=e.path.canonicalString();e.collectionGroup!==null&&(r+="|cg:"+e.collectionGroup),r+="|f:",r+=e.filters.map(n=>$w(n)).join(","),r+="|ob:",r+=e.orderBy.map(n=>function(i){return i.field.canonicalString()+i.dir}(n)).join(","),py(e.limit)||(r+="|l:",r+=e.limit),e.startAt&&(r+="|lb:",r+=e.startAt.inclusive?"b:":"a:",r+=e.startAt.position.map(n=>Dc(n)).join(",")),e.endAt&&(r+="|ub:",r+=e.endAt.inclusive?"a:":"b:",r+=e.endAt.position.map(n=>Dc(n)).join(",")),e.ue=r}return e.ue}function GN(t,e){if(t.limit!==e.limit||t.orderBy.length!==e.orderBy.length)return!1;for(let r=0;r<t.orderBy.length;r++)if(!PW(t.orderBy[r],e.orderBy[r]))return!1;if(t.filters.length!==e.filters.length)return!1;for(let r=0;r<t.filters.length;r++)if(!I5(t.filters[r],e.filters[r]))return!1;return t.collectionGroup===e.collectionGroup&&!!t.path.isEqual(e.path)&&!!hE(t.startAt,e.startAt)&&hE(t.endAt,e.endAt)}function Lw(t){return _e.isDocumentKey(t.path)&&t.collectionGroup===null&&t.filters.length===0}/**
2670 * @license
2671 * Copyright 2017 Google LLC
2672 *
2673 * Licensed under the Apache License, Version 2.0 (the "License");
2674 * you may not use this file except in compliance with the License.
2675 * You may obtain a copy of the License at
2676 *
2677 *   http://www.apache.org/licenses/LICENSE-2.0
2678 *
2679 * Unless required by applicable law or agreed to in writing, software
2680 * distributed under the License is distributed on an "AS IS" BASIS,
2681 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2682 * See the License for the specific language governing permissions and
2683 * limitations under the License.
2684 */class Tu{constructor(e,r=null,n=[],s=[],i=null,o="F",l=null,c=null){this.path=e,this.collectionGroup=r,this.explicitOrderBy=n,this.filters=s,this.limit=i,this.limitType=o,this.startAt=l,this.endAt=c,this.ce=null,this.le=null,this.he=null,this.startAt,this.endAt}}function BW(t,e,r,n,s,i,o,l){return new Tu(t,e,r,n,s,i,o,l)}function gy(t){return new Tu(t)}function fE(t){return t.filters.length===0&&t.limit===null&&t.startAt==null&&t.endAt==null&&(t.explicitOrderBy.length===0||t.explicitOrderBy.length===1&&t.explicitOrderBy[0].field.isKeyField())}function D5(t){return t.collectionGroup!==null}function Zd(t){const e=Re(t);if(e.ce===null){e.ce=[];const r=new Set;for(const i of e.explicitOrderBy)e.ce.push(i),r.add(i.field.canonicalString());const n=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let l=new Pr(Er.comparator);return o.filters.forEach(c=>{c.getFlattenedFilters().forEach(u=>{u.isInequality()&&(l=l.add(u.field))})}),l})(e).forEach(i=>{r.has(i.canonicalString())||i.isKeyField()||e.ce.push(new Fh(i,n))}),r.has(Er.keyField().canonicalString())||e.ce.push(new Fh(Er.keyField(),n))}return e.ce}function Fa(t){const e=Re(t);return e.le||(e.le=VW(e,Zd(t))),e.le}function VW(t,e){if(t.limitType==="F")return mE(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 Fh(s.field,i)});const r=t.endAt?new Sg(t.endAt.position,t.endAt.inclusive):null,n=t.startAt?new Sg(t.startAt.position,t.startAt.inclusive):null;return mE(t.path,t.collectionGroup,e,t.filters,t.limit,r,n)}}function Fw(t,e){const r=t.filters.concat([e]);return new Tu(t.path,t.collectionGroup,t.explicitOrderBy.slice(),r,t.limit,t.limitType,t.startAt,t.endAt)}function Tg(t,e,r){return new Tu(t.path,t.collectionGroup,t.explicitOrderBy.slice(),t.filters.slice(),e,r,t.startAt,t.endAt)}function xy(t,e){return GN(Fa(t),Fa(e))&&t.limitType===e.limitType}function M5(t){return`${WN(Fa(t))}|lt:${t.limitType}`}function Fl(t){return`Query(target=${function(r){let n=r.path.canonicalString();return r.collectionGroup!==null&&(n+=" collectionGroup="+r.collectionGroup),r.filters.length>0&&(n+=`, filters: [${r.filters.map(s=>O5(s)).join(", ")}]`),py(r.limit)||(n+=", limit: "+r.limit),r.orderBy.length>0&&(n+=`, orderBy: [${r.orderBy.map(s=>function(o){return`${o.field.canonicalString()} (${o.dir})`}(s)).join(", ")}]`),r.startAt&&(n+=", startAt: ",n+=r.startAt.inclusive?"b:":"a:",n+=r.startAt.position.map(s=>Dc(s)).join(",")),r.endAt&&(n+=", endAt: ",n+=r.endAt.inclusive?"a:":"b:",n+=r.endAt.position.map(s=>Dc(s)).join(",")),`Target(${n})`}(Fa(t))}; limitType=${t.limitType})`}function yy(t,e){return e.isFoundDocument()&&function(n,s){const i=s.key.path;return n.collectionGroup!==null?s.key.hasCollectionId(n.collectionGroup)&&n.path.isPrefixOf(i):_e.isDocumentKey(n.path)?n.path.isEqual(i):n.path.isImmediateParentOf(i)}(t,e)&&function(n,s){for(const i of Zd(n))if(!i.field.isKeyField()&&s.data.field(i.field)===null)return!1;return!0}(t,e)&&function(n,s){for(const i of n.filters)if(!i.matches(s))return!1;return!0}(t,e)&&function(n,s){return!(n.startAt&&!function(o,l,c){const u=dE(o,l,c);return o.inclusive?u<=0:u<0}(n.startAt,Zd(n),s)||n.endAt&&!function(o,l,c){const u=dE(o,l,c);return o.inclusive?u>=0:u>0}(n.endAt,Zd(n),s))}(t,e)}function UW(t){return t.collectionGroup||(t.path.length%2==1?t.path.lastSegment():t.path.get(t.path.length-2))}function $5(t){return(e,r)=>{let n=!1;for(const s of Zd(t)){const i=zW(s,e,r);if(i!==0)return i;n=n||s.field.isKeyField()}return 0}}function zW(t,e,r){const n=t.field.isKeyField()?_e.comparator(e.key,r.key):function(i,o,l){const c=o.data.field(i),u=l.data.field(i);return c!==null&&u!==null?Rc(c,u):Ce()}(t.field,e,r);switch(t.dir){case"asc":return n;
2684case"desc":return-1*n;default:return Ce()}}/**
2685 * @license
2686 * Copyright 2017 Google LLC
2687 *
2688 * Licensed under the Apache License, Version 2.0 (the "License");
2689 * you may not use this file except in compliance with the License.
2690 * You may obtain a copy of the License at
2691 *
2692 *   http://www.apache.org/licenses/LICENSE-2.0
2693 *
2694 * Unless required by applicable law or agreed to in writing, software
2695 * distributed under the License is distributed on an "AS IS" BASIS,
2696 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2697 * See the License for the specific language governing permissions and
2698 * limitations under the License.
2699 */class Au{constructor(e,r){this.mapKeyFn=e,this.equalsFn=r,this.inner={},this.innerSize=0}get(e){const r=this.mapKeyFn(e),n=this.inner[r];if(n!==void 0){for(const[s,i]of n)if(this.equalsFn(s,e))return i}}has(e){return this.get(e)!==void 0}set(e,r){const n=this.mapKeyFn(e),s=this.inner[n];if(s===void 0)return this.inner[n]=[[e,r]],void this.innerSize++;for(let i=0;i<s.length;i++)if(this.equalsFn(s[i][0],e))return void(s[i]=[e,r]);s.push([e,r]),this.innerSize++}delete(e){const r=this.mapKeyFn(e),n=this.inner[r];if(n===void 0)return!1;for(let s=0;s<n.length;s++)if(this.equalsFn(n[s][0],e))return n.length===1?delete this.inner[r]:n.splice(s,1),this.innerSize--,!0;return!1}forEach(e){yl(this.inner,(r,n)=>{for(const[s,i]of n)e(s,i)})}isEmpty(){return T5(this.inner)}size(){return this.innerSize}}/**
2700 * @license
2701 * Copyright 2017 Google LLC
2702 *
2703 * Licensed under the Apache License, Version 2.0 (the "License");
2704 * you may not use this file except in compliance with the License.
2705 * You may obtain a copy of the License at
2706 *
2707 *   http://www.apache.org/licenses/LICENSE-2.0
2708 *
2709 * Unless required by applicable law or agreed to in writing, software
2710 * distributed under the License is distributed on an "AS IS" BASIS,
2711 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2712 * See the License for the specific language governing permissions and
2713 * limitations under the License.
2714 */const HW=new Lt(_e.comparator);function ks(){return HW}const L5=new Lt(_e.comparator);function $d(...t){let e=L5;for(const r of t)e=e.insert(r.key,r);return e}function F5(t){let e=L5;return t.forEach((r,n)=>e=e.insert(r,n.overlayedDocument)),e}function bo(){return eh()}function B5(){return eh()}function eh(){return new Au(t=>t.toString(),(t,e)=>t.isEqual(e))}const qW=new Lt(_e.comparator),WW=new Pr(_e.comparator);function He(...t){let e=WW;for(const r of t)e=e.add(r);return e}const GW=new Pr(tt);function KW(){return GW}/**
2715 * @license
2716 * Copyright 2020 Google LLC
2717 *
2718 * Licensed under the Apache License, Version 2.0 (the "License");
2719 * you may not use this file except in compliance with the License.
2720 * You may obtain a copy of the License at
2721 *
2722 *   http://www.apache.org/licenses/LICENSE-2.0
2723 *
2724 * Unless required by applicable law or agreed to in writing, software
2725 * distributed under the License is distributed on an "AS IS" BASIS,
2726 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2727 * See the License for the specific language governing permissions and
2728 * limitations under the License.
2729 */function KN(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:_g(e)?"-0":e}}function V5(t){return{integerValue:""+t}}function XW(t,e){return SW(e)?V5(e):KN(t,e)}/**
2730 * @license
2731 * Copyright 2018 Google LLC
2732 *
2733 * Licensed under the Apache License, Version 2.0 (the "License");
2734 * you may not use this file except in compliance with the License.
2735 * You may obtain a copy of the License at
2736 *
2737 *   http://www.apache.org/licenses/LICENSE-2.0
2738 *
2739 * Unless required by applicable law or agreed to in writing, software
2740 * distributed under the License is distributed on an "AS IS" BASIS,
2741 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2742 * See the License for the specific language governing permissions and
2743 * limitations under the License.
2744 */class vy{constructor(){this._=void 0}}function YW(t,e,r){return t instanceof Bh?function(s,i){const o={fields:{__type__:{stringValue:"server_timestamp"},__local_write_time__:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return i&&zN(i)&&(i=HN(i)),i&&(o.fields.__previous_value__=i),{mapValue:o}}(r,e):t instanceof Mc?z5(t,e):t instanceof $c?H5(t,e):function(s,i){const o=U5(s,i),l=pE(o)+pE(s.Pe);return Mw(o)&&Mw(s.Pe)?V5(l):KN(s.serializer,l)}(t,e)}function QW(t,e,r){return t instanceof Mc?z5(t,e):t instanceof $c?H5(t,e):r}function U5(t,e){return t instanceof Ag?function(n){return Mw(n)||function(i){return!!i&&"doubleValue"in i}(n)}(e)?e:{integerValue:0}:null}class Bh extends vy{}class Mc extends vy{constructor(e){super(),this.elements=e}}function z5(t,e){const r=q5(e);for(const n of t.elements)r.some(s=>Ga(s,n))||r.push(n);return{arrayValue:{values:r}}}class $c extends vy{constructor(e){super(),this.elements=e}}function H5(t,e){let r=q5(e);for(const n of t.elements)r=r.filter(s=>!Ga(s,n));return{arrayValue:{values:r}}}
2744class Ag extends vy{constructor(e,r){super(),this.serializer=e,this.Pe=r}}function pE(t){return qt(t.integerValue||t.doubleValue)}function q5(t){return qN(t)&&t.arrayValue.values?t.arrayValue.values.slice():[]}/**
2745 * @license
2746 * Copyright 2017 Google LLC
2747 *
2748 * Licensed under the Apache License, Version 2.0 (the "License");
2749 * you may not use this file except in compliance with the License.
2750 * You may obtain a copy of the License at
2751 *
2752 *   http://www.apache.org/licenses/LICENSE-2.0
2753 *
2754 * Unless required by applicable law or agreed to in writing, software
2755 * distributed under the License is distributed on an "AS IS" BASIS,
2756 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2757 * See the License for the specific language governing permissions and
2758 * limitations under the License.
2759 */class XN{constructor(e,r){this.field=e,this.transform=r}}function JW(t,e){return t.field.isEqual(e.field)&&function(n,s){return n instanceof Mc&&s instanceof Mc||n instanceof $c&&s instanceof $c?Oc(n.elements,s.elements,Ga):n instanceof Ag&&s instanceof Ag?Ga(n.Pe,s.Pe):n instanceof Bh&&s instanceof Bh}(t.transform,e.transform)}class ZW{constructor(e,r){this.version=e,this.transformResults=r}}class rn{constructor(e,r){this.updateTime=e,this.exists=r}static none(){return new rn}static exists(e){return new rn(void 0,e)}static updateTime(e){return new rn(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 Dp(t,e){return t.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(t.updateTime):t.exists===void 0||t.exists===e.isFoundDocument()}class by{}function W5(t,e){if(!t.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return t.isNoDocument()?new wy(t.key,rn.none()):new Fm(t.key,t.data,rn.none());{const r=t.data,n=ln.empty();let s=new Pr(Er.comparator);for(let i of e.fields)if(!s.has(i)){let o=r.field(i);o===null&&i.length>1&&(i=i.popLast(),o=r.field(i)),o===null?n.delete(i):n.set(i,o),s=s.add(i)}return new qi(t.key,n,new An(s.toArray()),rn.none())}}function eG(t,e,r){t instanceof Fm?function(s,i,o){const l=s.value.clone(),c=xE(s.fieldTransforms,i,o.transformResults);l.setAll(c),i.convertToFoundDocument(o.version,l).setHasCommittedMutations()}(t,e,r):t instanceof qi?function(s,i,o){if(!Dp(s.precondition,i))return void i.convertToUnknownDocument(o.version);const l=xE(s.fieldTransforms,i,o.transformResults),c=i.data;c.setAll(G5(s)),c.setAll(l),i.convertToFoundDocument(o.version,c).setHasCommittedMutations()}(t,e,r):function(s,i,o){i.convertToNoDocument(o.version).setHasCommittedMutations()}(0,e,r)}function th(t,e,r,n){return t instanceof Fm?function(i,o,l,c){if(!Dp(i.precondition,o))return l;const u=i.value.clone(),d=yE(i.fieldTransforms,c,o);return u.setAll(d),o.convertToFoundDocument(o.version,u).setHasLocalMutations(),null}(t,e,r,n):t instanceof qi?function(i,o,l,c){if(!Dp(i.precondition,o))return l;const u=yE(i.fieldTransforms,c,o),d=o.data;return d.setAll(G5(i)),d.setAll(u),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),l===null?null:l.unionWith(i.fieldMask.fields).unionWith(i.fieldTransforms.map(h=>h.field))}(t,e,r,n):function(i,o,l){return Dp(i.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):l}(t,e,r)}function tG(t,e){let r=null;for(const n of t.fieldTransforms){const s=e.data.field(n.field),i=U5(n.transform,s||null);i!=null&&(r===null&&(r=ln.empty()),r.set(n.field,i))}return r||null}function gE(t,e){return t.type===e.type&&!!t.key.isEqual(e.key)&&!!t.precondition.isEqual(e.precondition)&&!!function(n,s){return n===void 0&&s===void 0||!(!n||!s)&&Oc(n,s,(i,o)=>JW(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 Fm extends by{constructor(e,r,n,s=[]){super(),this.key=e,this.value=r,this.precondition=n,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class qi extends by{constructor(e,r,n,s,i=[]){super(),this.key=e,this.data=r,this.fieldMask=n,this.prec
2759ondition=s,this.fieldTransforms=i,this.type=1}getFieldMask(){return this.fieldMask}}function G5(t){const e=new Map;return t.fieldMask.fields.forEach(r=>{if(!r.isEmpty()){const n=t.data.field(r);e.set(r,n)}}),e}function xE(t,e,r){const n=new Map;ut(t.length===r.length);for(let s=0;s<r.length;s++){const i=t[s],o=i.transform,l=e.data.field(i.field);n.set(i.field,QW(o,l,r[s]))}return n}function yE(t,e,r){const n=new Map;for(const s of t){const i=s.transform,o=r.data.field(s.field);n.set(s.field,YW(i,o,e))}return n}class wy extends by{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class rG extends by{constructor(e,r){super(),this.key=e,this.precondition=r,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2760 * @license
2761 * Copyright 2017 Google LLC
2762 *
2763 * Licensed under the Apache License, Version 2.0 (the "License");
2764 * you may not use this file except in compliance with the License.
2765 * You may obtain a copy of the License at
2766 *
2767 *   http://www.apache.org/licenses/LICENSE-2.0
2768 *
2769 * Unless required by applicable law or agreed to in writing, software
2770 * distributed under the License is distributed on an "AS IS" BASIS,
2771 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2772 * See the License for the specific language governing permissions and
2773 * limitations under the License.
2774 */class nG{constructor(e,r,n,s){this.batchId=e,this.localWriteTime=r,this.baseMutations=n,this.mutations=s}applyToRemoteDocument(e,r){const n=r.mutationResults;for(let s=0;s<this.mutations.length;s++){const i=this.mutations[s];i.key.isEqual(e.key)&&eG(i,e,n[s])}}applyToLocalView(e,r){for(const n of this.baseMutations)n.key.isEqual(e.key)&&(r=th(n,e,r,this.localWriteTime));for(const n of this.mutations)n.key.isEqual(e.key)&&(r=th(n,e,r,this.localWriteTime));return r}applyToLocalDocumentSet(e,r){const n=B5();return this.mutations.forEach(s=>{const i=e.get(s.key),o=i.overlayedDocument;let l=this.applyToLocalView(o,i.mutatedFields);l=r.has(s.key)?null:l;const c=W5(o,l);c!==null&&n.set(s.key,c),o.isValidDocument()||o.convertToNoDocument(Oe.min())}),n}keys(){return this.mutations.reduce((e,r)=>e.add(r.key),He())}isEqual(e){return this.batchId===e.batchId&&Oc(this.mutations,e.mutations,(r,n)=>gE(r,n))&&Oc(this.baseMutations,e.baseMutations,(r,n)=>gE(r,n))}}class YN{constructor(e,r,n,s){this.batch=e,this.commitVersion=r,this.mutationResults=n,this.docVersions=s}static from(e,r,n){ut(e.mutations.length===n.length);let s=function(){return qW}();const i=e.mutations;for(let o=0;o<i.length;o++)s=s.insert(i[o].key,n[o].version);return new YN(e,r,n,s)}}/**
2775 * @license
2776 * Copyright 2022 Google LLC
2777 *
2778 * Licensed under the Apache License, Version 2.0 (the "License");
2779 * you may not use this file except in compliance with the License.
2780 * You may obtain a copy of the License at
2781 *
2782 *   http://www.apache.org/licenses/LICENSE-2.0
2783 *
2784 * Unless required by applicable law or agreed to in writing, software
2785 * distributed under the License is distributed on an "AS IS" BASIS,
2786 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2787 * See the License for the specific language governing permissions and
2788 * limitations under the License.
2789 */class aG{constructor(e,r){this.largestBatchId=e,this.mutation=r}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
2790      largestBatchId: ${this.largestBatchId},
2791      mutation: ${this.mutation.toString()}
2792    }`}}/**
2793 * @license
2794 * Copyright 2017 Google LLC
2795 *
2796 * Licensed under the Apache License, Version 2.0 (the "License");
2797 * you may not use this file except in compliance with the License.
2798 * You may obtain a copy of the License at
2799 *
2800 *   http://www.apache.org/licenses/LICENSE-2.0
2801 *
2802 * Unless required by applicable law or agreed to in writing, software
2803 * distributed under the License is distributed on an "AS IS" BASIS,
2804 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2805 * See the License for the specific language governing permissions and
2806 * limitations under the License.
2807 */class sG{constructor(e,r){this.count=e,this.unchangedNames=r}}/**
2808 * @license
2809 * Copyright 2017 Google LLC
2810 *
2811 * Licensed under the Apache License, Version 2.0 (the "License");
2812 * you may not use this file except in compliance with the License.
2813 * You may obtain a copy of the License at
2814 *
2815 *   http://www.apache.org/licenses/LICENSE-2.0
2816 *
2817 * Unless required by applicable law or agreed to in writing, software
2818 * distributed under the License is distributed on an "AS IS" BASIS,
2819 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2820 * See the License for the specific language governing permissions and
2821 * limitations under the License.
2822 */var Kt,Xe;function iG(t){switch(t){default:return Ce();case te.CANCELLED:case te.UNKNOWN:case te.DEADLINE_EXCEEDED:case te.RESOURCE_EXHAUSTED:case te.INTERNAL:case te.UNAVAILABLE:case te.UNAUTHENTICATED:return!1;case te.INVALID_ARGUMENT:case te.NOT_FOUND:case te.ALREADY_EXISTS:case te.PERMISSION_DENIED:case te.FAILED_PRECONDITION:case te.ABORTED:case te.OUT_OF_RANGE:case te.UNIMPLEMENTED:case te.DATA_LOSS:return!0}}function K5(t){if(t===void 0)return Es("GRPC error has no .code"),te.UNKNOWN;switch(t){case Kt.OK:return te.OK;case Kt.CANCELLED:return te.CANCELLED;case Kt.UNKNOWN:return te.UNKNOWN;case Kt.DEADLINE_EXCEEDED:return te.DEADLINE_EXCEEDED;case Kt.RESOURCE_EXHAUSTED:return te.RESOURCE_EXHAUSTED;case Kt.INTERNAL:return te.INTERNAL;case Kt.UNAVAILABLE:return te.UNAVAILABLE;case Kt.UNAUTHENTICATED:return te.UNAUTHENTICATED;case Kt.INVALID_ARGUMENT:return te.INVALID_ARGUMENT;case Kt.NOT_FOUND:return te.NOT_FOUND;case Kt.ALREADY_EXISTS:return te.ALREADY_EXISTS;case Kt.PERMISSION_DENIED:return te.PERMISSION_DENIED;case Kt.FAILED_PRECONDITION:return te.FAILED_PRECONDITION;case Kt.ABORTED:return te.ABORTED;case Kt.OUT_OF_RANGE:return te.OUT_OF_RANGE;case Kt.UNIMPLEMENTED:return te.UNIMPLEMENTED;case Kt.DATA_LOSS:return te.DATA_LOSS;default:return Ce()}}(Xe=Kt||(Kt={}))[Xe.OK=0]="OK",Xe[Xe.CANCELLED=1]="CANCELLED",Xe[Xe.UNKNOWN=2]="UNKNOWN",Xe[Xe.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",Xe[Xe.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",Xe[Xe.NOT_FOUND=5]="NOT_FOUND",Xe[Xe.ALREADY_EXISTS=6]="ALREADY_EXISTS",Xe[Xe.PERMISSION_DENIED=7]="PERMISSION_DENIED",Xe[Xe.UNAUTHENTICATED=16]="UNAUTHENTICATED",Xe[Xe.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",Xe[Xe.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",Xe[Xe.ABORTED=10]="ABORTED",Xe[Xe.OUT_OF_RANGE=11]="OUT_OF_RANGE",Xe[Xe.UNIMPLEMENTED=12]="UNIMPLEMENTED",Xe[Xe.INTERNAL=13]="INTERNAL",Xe[Xe.UNAVAILABLE=14]="UNAVAILABLE",Xe[Xe.DATA_LOSS=15]="DATA_LOSS";/**
2823 * @license
2824 * Copyright 2023 Google LLC
2825 *
2826 * Licensed under the Apache License, Version 2.0 (the "License");
2827 * you may not use this file except in compliance with the License.
2828 * You may obtain a copy of the License at
2829 *
2830 *   http://www.apache.org/licenses/LICENSE-2.0
2831 *
2832 * Unless required by applicable law or agreed to in writing, software
2833 * distributed under the License is distributed on an "AS IS" BASIS,
2834 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2835 * See the License for the specific language governing permissions and
2836 * limitations under the License.
2837 */function oG(){return new TextEncoder}/**
2838 * @license
2839 * Copyright 2022 Google LLC
2840 *
2841 * Licensed under the Apache License, Version 2.0 (the "License");
2842 * you may not use this file except in compliance with the License.
2843 * You may obtain a copy of the License at
2844 *
2845 *   http://www.apache.org/licenses/LICENSE-2.0
2846 *
2847 * Unless required by applicable law or agreed to in writing, software
2848 * distributed under the License is distributed on an "AS IS" BASIS,
2849 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2850 * See the License for the specific language governing permissions and
2851 * limitations under the License.
2852 */const lG=new Po([4294967295,4294967295],0);function vE(t){const e=oG().encode(t),r=new y5;return r.update(e),new Uint8Array(r.digest())}function bE(t){const e=new DataView(t.buffer),r=e.getUint32(0,!0),n=e.getUint32(4,!0),s=e.getUint32(8,!0),i=e.getUint32(12,!0);return[new Po([r,n],0),new Po([s,i],0)]}class QN{constructor(e,r,n){if(this.bitmap=e,this.padding=r,this.hashCount=n,r<0||r>=8)throw new Ld(`Invalid padding: ${r}`);if(n<0)throw new Ld(`Invalid hash count: ${n}`);if(e.length>0&&this.hashCount===0)throw new Ld(`Invalid hash count: ${n}`);if(e.length===0&&r!==0)throw new Ld(`Invalid padding when bitmap length is 0: ${r}`);this.Ie=8*e.length-r,this.Te=Po.fromNumber(this.Ie)}Ee(e,r,n){let s=e.add(r.multiply(Po.fromNumber(n)));return s.compare(lG)===1&&(s=new Po([s.getBits(0),s.getBits(1)],0)),s.modulo(this.Te).toNumber()}de(e){return(this.bitmap[Math.floor(e/8)]&1<<e%8)!=0}mightContain(e){if(this.Ie===0)return!1;const r=vE(e),[n,s]=bE(r);for(let i=0;i<this.hashCount;i++){const o=this.Ee(n,s,i);if(!this.de(o))return!1}return!0}static create(e,r,n){const s=e%8==0?0:8-e%8,i=new Uint8Array(Math.ceil(e/8)),o=new QN(i,s,r);
2852return n.forEach(l=>o.insert(l)),o}insert(e){if(this.Ie===0)return;const r=vE(e),[n,s]=bE(r);for(let i=0;i<this.hashCount;i++){const o=this.Ee(n,s,i);this.Ae(o)}}Ae(e){const r=Math.floor(e/8),n=e%8;this.bitmap[r]|=1<<n}}class Ld extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2853 * @license
2854 * Copyright 2017 Google LLC
2855 *
2856 * Licensed under the Apache License, Version 2.0 (the "License");
2857 * you may not use this file except in compliance with the License.
2858 * You may obtain a copy of the License at
2859 *
2860 *   http://www.apache.org/licenses/LICENSE-2.0
2861 *
2862 * Unless required by applicable law or agreed to in writing, software
2863 * distributed under the License is distributed on an "AS IS" BASIS,
2864 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2865 * See the License for the specific language governing permissions and
2866 * limitations under the License.
2867 */class jy{constructor(e,r,n,s,i){this.snapshotVersion=e,this.targetChanges=r,this.targetMismatches=n,this.documentUpdates=s,this.resolvedLimboDocuments=i}static createSynthesizedRemoteEventForCurrentChange(e,r,n){const s=new Map;return s.set(e,Bm.createSynthesizedTargetChangeForCurrentChange(e,r,n)),new jy(Oe.min(),s,new Lt(tt),ks(),He())}}class Bm{constructor(e,r,n,s,i){this.resumeToken=e,this.current=r,this.addedDocuments=n,this.modifiedDocuments=s,this.removedDocuments=i}static createSynthesizedTargetChangeForCurrentChange(e,r,n){return new Bm(n,r,He(),He(),He())}}/**
2868 * @license
2869 * Copyright 2017 Google LLC
2870 *
2871 * Licensed under the Apache License, Version 2.0 (the "License");
2872 * you may not use this file except in compliance with the License.
2873 * You may obtain a copy of the License at
2874 *
2875 *   http://www.apache.org/licenses/LICENSE-2.0
2876 *
2877 * Unless required by applicable law or agreed to in writing, software
2878 * distributed under the License is distributed on an "AS IS" BASIS,
2879 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2880 * See the License for the specific language governing permissions and
2881 * limitations under the License.
2882 */class Mp{constructor(e,r,n,s){this.Re=e,this.removedTargetIds=r,this.key=n,this.Ve=s}}class X5{constructor(e,r){this.targetId=e,this.me=r}}class Y5{constructor(e,r,n=Ir.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=r,this.resumeToken=n,this.cause=s}}class wE{constructor(){this.fe=0,this.ge=NE(),this.pe=Ir.EMPTY_BYTE_STRING,this.ye=!1,this.we=!0}get current(){return this.ye}get resumeToken(){return this.pe}get Se(){return this.fe!==0}get be(){return this.we}De(e){e.approximateByteSize()>0&&(this.we=!0,this.pe=e)}ve(){let e=He(),r=He(),n=He();return this.ge.forEach((s,i)=>{switch(i){case 0:e=e.add(s);break;case 2:r=r.add(s);break;case 1:n=n.add(s);break;default:Ce()}}),new Bm(this.pe,this.ye,e,r,n)}Ce(){this.we=!1,this.ge=NE()}Fe(e,r){this.we=!0,this.ge=this.ge.insert(e,r)}Me(e){this.we=!0,this.ge=this.ge.remove(e)}xe(){this.fe+=1}Oe(){this.fe-=1,ut(this.fe>=0)}Ne(){this.we=!0,this.ye=!0}}class cG{constructor(e){this.Le=e,this.Be=new Map,this.ke=ks(),this.qe=jE(),this.Qe=new Lt(tt)}Ke(e){for(const r of e.Re)e.Ve&&e.Ve.isFoundDocument()?this.$e(r,e.Ve):this.Ue(r,e.key,e.Ve);for(const r of e.removedTargetIds)this.Ue(r,e.key,e.Ve)}We(e){this.forEachTarget(e,r=>{const n=this.Ge(r);switch(e.state){case 0:this.ze(r)&&n.De(e.resumeToken);break;case 1:n.Oe(),n.Se||n.Ce(),n.De(e.resumeToken);break;case 2:n.Oe(),n.Se||this.removeTarget(r);break;case 3:this.ze(r)&&(n.Ne(),n.De(e.resumeToken));break;case 4:this.ze(r)&&(this.je(r),n.De(e.resumeToken));break;default:Ce()}})}forEachTarget(e,r){e.targetIds.length>0?e.targetIds.forEach(r):this.Be.forEach((n,s)=>{this.ze(s)&&r(s)})}He(e){const r=e.targetId,n=e.me.count,s=this.Je(r);if(s){const i=s.target;if(Lw(i))if(n===0){const o=new _e(i.path);this.Ue(r,o,zr.newNoDocument(o,Oe.min()))}else ut(n===1);else{const o=this.Ye(r);if(o!==n){const l=this.Ze(e),c=l?this.Xe(l,e,o):1;if(c!==0){this.je(r);const u=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.Qe=this.Qe.insert(r,u)}}}}}Ze(e){const r=e.me.unchangedNames;if(!r||!r.bits)return null;const{bits:{bitmap:n="",padding:s=0},hashCount:i=0}=r;let o,l;try{o=Qo(n).toUint8Array()}catch(c){if(c instanceof A5)return Ic("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{l=new QN(o,s,i)}catch(c){return Ic(c instanceof Ld?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return l.Ie===0?null:l}Xe(e,r,n){return r.me.count===n-this.nt(e,r.targetId)?0:2}nt(e,r){const n=this.Le.getRemoteKeysForTarget(r);let s=0;
2882return n.forEach(i=>{const o=this.Le.tt(),l=`projects/${o.projectId}/databases/${o.database}/documents/${i.path.canonicalString()}`;e.mightContain(l)||(this.Ue(r,i,null),s++)}),s}rt(e){const r=new Map;this.Be.forEach((i,o)=>{const l=this.Je(o);if(l){if(i.current&&Lw(l.target)){const c=new _e(l.target.path);this.ke.get(c)!==null||this.it(o,c)||this.Ue(o,c,zr.newNoDocument(c,e))}i.be&&(r.set(o,i.ve()),i.Ce())}});let n=He();this.qe.forEach((i,o)=>{let l=!0;o.forEachWhile(c=>{const u=this.Je(c);return!u||u.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)}),l&&(n=n.add(i))}),this.ke.forEach((i,o)=>o.setReadTime(e));const s=new jy(e,r,this.Qe,this.ke,n);return this.ke=ks(),this.qe=jE(),this.Qe=new Lt(tt),s}$e(e,r){if(!this.ze(e))return;const n=this.it(e,r.key)?2:0;this.Ge(e).Fe(r.key,n),this.ke=this.ke.insert(r.key,r),this.qe=this.qe.insert(r.key,this.st(r.key).add(e))}Ue(e,r,n){if(!this.ze(e))return;const s=this.Ge(e);this.it(e,r)?s.Fe(r,1):s.Me(r),this.qe=this.qe.insert(r,this.st(r).delete(e)),n&&(this.ke=this.ke.insert(r,n))}removeTarget(e){this.Be.delete(e)}Ye(e){const r=this.Ge(e).ve();return this.Le.getRemoteKeysForTarget(e).size+r.addedDocuments.size-r.removedDocuments.size}xe(e){this.Ge(e).xe()}Ge(e){let r=this.Be.get(e);return r||(r=new wE,this.Be.set(e,r)),r}st(e){let r=this.qe.get(e);return r||(r=new Pr(tt),this.qe=this.qe.insert(e,r)),r}ze(e){const r=this.Je(e)!==null;return r||be("WatchChangeAggregator","Detected inactive target",e),r}Je(e){const r=this.Be.get(e);return r&&r.Se?null:this.Le.ot(e)}je(e){this.Be.set(e,new wE),this.Le.getRemoteKeysForTarget(e).forEach(r=>{this.Ue(e,r,null)})}it(e,r){return this.Le.getRemoteKeysForTarget(e).has(r)}}function jE(){return new Lt(_e.comparator)}function NE(){return new Lt(_e.comparator)}const uG={asc:"ASCENDING",desc:"DESCENDING"},dG={"<":"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"},hG={and:"AND",or:"OR"};class mG{constructor(e,r){this.databaseId=e,this.useProto3Json=r}}function Bw(t,e){return t.useProto3Json||py(e)?e:{value:e}}function Eg(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 Q5(t,e){return t.useProto3Json?e.toBase64():e.toUint8Array()}function fG(t,e){return Eg(t,e.toTimestamp())}function Ba(t){return ut(!!t),Oe.fromTimestamp(function(r){const n=Mi(r);return new We(n.seconds,n.nanos)}(t))}function JN(t,e){return Vw(t,e).canonicalString()}function Vw(t,e){const r=function(s){return new At(["projects",s.projectId,"databases",s.database])}(t).child("documents");return e===void 0?r:r.child(e)}function J5(t){const e=At.fromString(t);return ut(nD(e)),e}function Uw(t,e){return JN(t.databaseId,e.path)}function E0(t,e){const r=J5(e);if(r.get(1)!==t.databaseId.projectId)throw new fe(te.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+r.get(1)+" vs "+t.databaseId.projectId);if(r.get(3)!==t.databaseId.database)throw new fe(te.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+r.get(3)+" vs "+t.databaseId.database);return new _e(eD(r))}function Z5(t,e){return JN(t.databaseId,e)}function pG(t){const e=J5(t);return e.length===4?At.emptyPath():eD(e)}function zw(t){return new At(["projects",t.databaseId.projectId,"databases",t.databaseId.database]).canonicalString()}function eD(t){return ut(t.length>4&&t.get(4)==="documents"),t.popFirst(5)}function _E(t,e,r){return{name:Uw(t,e),fields:r.value.mapValue.fields}}function gG(t,e){let r;if("targetChange"in e){e.targetChange;const n=function(u){return u==="NO_CHANGE"?0:u==="ADD"?1:u==="REMOVE"?2:u==="CURRENT"?3:u==="RESET"?4:Ce()}(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],i=function(u,d){return u.useProto3Json?(ut(d===void 0||typeof d=="string"),Ir.fromBase64String(d||"")):(ut(d===void 0||d instanceof Buffer||d instanceof Uint8Array),Ir.fromUint8Array(d||new Uint8Array))}(t,e.targetChange.resumeToken),o=e.targetChange.cause,l=o&&function(u){const d=u.code===void 0?te.UNKNOWN:K5(u.code);return new fe(d,u.message||"")}(o);r=new Y5(n,s,i,l||null)}else if("documentChange"in e){e.documentChange;const n=e.documentChange;n.document,n.document.name,n.document.updateTime;const s=E0(t,n.document.name),i=Ba(n.document.updateTime),o=n.document.createTime?Ba(n.document.createTime):Oe.min(),l=new ln({mapValue:{fields:n.document.fields}}),c=zr.newFoundDocument(s,i,o,l),u=n.targetIds||[],d=n.removedTargetIds||[];r=new Mp(u,d,c.key,c)}else if("documentDelete"in e){e.documentDelete;const n=e.documentDelete;n.document;const s=E0(t,n.document),i=n.readTime?Ba(n.readTime):Oe.min(),o=zr.newNoDocument(s,i),l=n.removedTargetIds||[];r=new Mp([],l,o.key,o)}else if("documentRemove"in e){e.documentRemove;const n=e.documentRemove;n.document;const s=E0(t,n.document),i=n.removedTargetIds||[];r=new Mp([],i,s,null)}else{if(!("filter"in e))return Ce();{e.filter;const n=e.filter;n.targetId;const{count:s=0,unchangedNames:i}=n,o=new sG(s,i),l=n.targetId;r=new X5(l,o)}}return r}function xG(t,e){let r;if(e instanceof Fm)r={update:_E(t,e.key,e.value)};else if(e instanceof wy)r={delete:Uw(t,e.key)};else if(e instanceof qi)r={update:_E(t,e.key,e.data),updateMask:TG(e.fieldMask)};else{if(!(e instanceof rG))return Ce();r={verify:Uw(t,e.key)}}return e.fieldTransforms.length>0&&(r.updateTransforms=e.fieldTransforms.map(n=>function(i,o){const l=o.transform;if(l instanceof Bh)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof Mc)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof $c)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof Ag)return{fieldPath:o.field.canonicalString(),increment:l.Pe};throw Ce()}(0,n))),e.precondition.isNone||(r.currentDocument=function(s,i){return i.updateTime!==void 0?{updateTime:fG(s,i.updateTime)}:i.exists!==void 0?{exists:i.exists}:Ce()}(t,e.precondition)),r}function yG(t,e){return t&&t.length>0?(ut(e!==void 0),t.map(r=>function(s,i){let o=s.updateTime?Ba(s.updateTime):Ba(i);return o.isEqual(Oe.min())&&(o=Ba(i)),new ZW(o,s.transformResults||[])}(r,e))):[]}function vG(t,e){return{documents:[Z5(t,e.path)]}}function bG(t,e){const r={structuredQuery:{}},n=e.path;let s;e.collectionGroup!==null?(s=n,r.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=n.popLast(),r.structuredQuery.from=[{collectionId:n.lastSegment()}]),r.parent=Z5(t,s);const i=function(u){if(u.length!==0)return rD(va.create(u,"and"))}(e.filters);i&&(r.structuredQuery.where=i);const o=function(u){if(u.length!==0)return u.map(d=>function(m){return{field:Bl(m.field),direction:NG(m.dir)}}(d))}(e.orderBy);o&&(r.structuredQuery.orderBy=o);const l=Bw(t,e.limit);return l!==null&&(r.structuredQuery.limit=l),e.startAt&&(r.structuredQuery.startAt=function(u){return{before:u.inclusive,values:u.position}}(e.startAt)),e.endAt&&(r.structuredQuery.endAt=function(u){return{before:!u.inclusive,values:u.position}}(e.endAt)),{_t:r,parent:s}}function wG(t){let e=pG(t.parent);const r=t.structuredQuery,n=r.from?r.from.length:0;let s=null;if(n>0){ut(n===1);const d=r.from[0];d.allDescendants?s=d.collectionId:e=e.child(d.collectionId)}let i=[];r.where&&(i=function(h){const m=tD(h);return m instanceof va&&C5(m)?m.getFilters():[m]}(r.where));let o=[];r.orderBy&&(o=function(h){return h.map(m=>function(x){return new Fh(Vl(x.field),function(g){switch(g){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}}(x.direction))}(m))}(r.orderBy));let l=null;r.limit&&(l=function(h){let m;return m=typeof h=="object"?h.value:h,py(m)?null:m}(r.limit));let c=null;r.startAt&&(c=function(h){const m=!!h.before,p=h.values||[];return new Sg(p,m)}(r.startAt));let u=null;return r.endAt&&(u=function(h){const m=!h.before,p=h.values||[];return new Sg(p,m)}(r.endAt)),BW(e,s,o,i,l,"F",c,u)}function jG(t,e){const r=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 Ce()}}(e.purpose);return r==null?null:{"goog-listen-tags":r}}function tD(t){return t.unaryFilter!==void 0?function(r){switch(r.unaryFilter.op){case"IS_NAN":const n=Vl(r.unaryFilter.field);return Qt.create(n,"==",{doubleValue:NaN});case"IS_NULL":const s=Vl(r.unaryFilter.field);return Qt.create(s,"==",{nullValue:"NULL_VALUE"});
2882case"IS_NOT_NAN":const i=Vl(r.unaryFilter.field);return Qt.create(i,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=Vl(r.unaryFilter.field);return Qt.create(o,"!=",{nullValue:"NULL_VALUE"});default:return Ce()}}(t):t.fieldFilter!==void 0?function(r){return Qt.create(Vl(r.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";default:return Ce()}}(r.fieldFilter.op),r.fieldFilter.value)}(t):t.compositeFilter!==void 0?function(r){return va.create(r.compositeFilter.filters.map(n=>tD(n)),function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return Ce()}}(r.compositeFilter.op))}(t):Ce()}function NG(t){return uG[t]}function _G(t){return dG[t]}function SG(t){return hG[t]}function Bl(t){return{fieldPath:t.canonicalString()}}function Vl(t){return Er.fromServerFormat(t.fieldPath)}function rD(t){return t instanceof Qt?function(r){if(r.op==="=="){if(uE(r.value))return{unaryFilter:{field:Bl(r.field),op:"IS_NAN"}};if(cE(r.value))return{unaryFilter:{field:Bl(r.field),op:"IS_NULL"}}}else if(r.op==="!="){if(uE(r.value))return{unaryFilter:{field:Bl(r.field),op:"IS_NOT_NAN"}};if(cE(r.value))return{unaryFilter:{field:Bl(r.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:Bl(r.field),op:_G(r.op),value:r.value}}}(t):t instanceof va?function(r){const n=r.getFilters().map(s=>rD(s));return n.length===1?n[0]:{compositeFilter:{op:SG(r.op),filters:n}}}(t):Ce()}function TG(t){const e=[];return t.fields.forEach(r=>e.push(r.canonicalString())),{fieldPaths:e}}function nD(t){return t.length>=4&&t.get(0)==="projects"&&t.get(2)==="databases"}/**
2883 * @license
2884 * Copyright 2017 Google LLC
2885 *
2886 * Licensed under the Apache License, Version 2.0 (the "License");
2887 * you may not use this file except in compliance with the License.
2888 * You may obtain a copy of the License at
2889 *
2890 *   http://www.apache.org/licenses/LICENSE-2.0
2891 *
2892 * Unless required by applicable law or agreed to in writing, software
2893 * distributed under the License is distributed on an "AS IS" BASIS,
2894 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2895 * See the License for the specific language governing permissions and
2896 * limitations under the License.
2897 */class hi{constructor(e,r,n,s,i=Oe.min(),o=Oe.min(),l=Ir.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=r,this.purpose=n,this.sequenceNumber=s,this.snapshotVersion=i,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=l,this.expectedCount=c}withSequenceNumber(e){return new hi(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,r){return new hi(this.target,this.targetId,this.purpose,this.sequenceNumber,r,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new hi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new hi(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
2898 * @license
2899 * Copyright 2017 Google LLC
2900 *
2901 * Licensed under the Apache License, Version 2.0 (the "License");
2902 * you may not use this file except in compliance with the License.
2903 * You may obtain a copy of the License at
2904 *
2905 *   http://www.apache.org/licenses/LICENSE-2.0
2906 *
2907 * Unless required by applicable law or agreed to in writing, software
2908 * distributed under the License is distributed on an "AS IS" BASIS,
2909 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2910 * See the License for the specific language governing permissions and
2911 * limitations under the License.
2912 */class AG{constructor(e){this.ct=e}}function EG(t){const e=wG({parent:t.parent,structuredQuery:t.structuredQuery});return t.limitType==="LAST"?Tg(e,e.limit,"L"):e}/**
2913 * @license
2914 * Copyright 2019 Google LLC
2915 *
2916 * Licensed under the Apache License, Version 2.0 (the "License");
2917 * you may not use this file except in compliance with the License.
2918 * You may obtain a copy of the License at
2919 *
2920 *   http://www.apache.org/licenses/LICENSE-2.0
2921 *
2922 * Unless required by applicable law or agreed to in writing, software
2923 * distributed under the License is distributed on an "AS IS" BASIS,
2924 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2925 * See the License for the specific language governing permissions and
2926 * limitations under the License.
2927 */class kG{constructor(){this.un=new PG}addToCollectionParentIndex(e,r){return this.un.add(r),se.resolve()}getCollectionParents(e,r){return se.resolve(this.un.getEntries(r))}addFieldIndex(e,r){return se.resolve()}deleteFieldIndex(e,r){return se.resolve()}deleteAllFieldIndexes(e){return se.resolve()}createTargetIndexes(e,r){return se.resolve()}getDocumentsMatchingTarget(e,r){return se.resolve(null)}getIndexType(e,r){return se.resolve(0)}getFieldIndexes(e,r){return se.resolve([])}getNextCollectionGroupToUpdate(e){return se.resolve(null)}getMinOffset(e,r){return se.resolve(Di.min())}getMinOffsetFromCollectionGroup(e,r){return se.resolve(Di.min())}updateCollectionGroup(e,r,n){return se.resolve()}updateIndexEntries(e,r){return se.resolve()}}class PG{constructor(){this.index={}}add(e){const r=e.lastSegment(),n=e.popLast(),s=this.index[r]||new Pr(At.comparator),i=!s.has(n);return this.index[r]=s.add(n),i}has(e){const r=e.lastSegment(),n=e.popLast(),s=this.index[r];return s&&s.has(n)}getEntries(e){return(this.index[e]||new Pr(At.comparator)).toArray()}}/**
2928 * @license
2929 * Copyright 2017 Google LLC
2930 *
2931 * Licensed under the Apache License, Version 2.0 (the "License");
2932 * you may not use this file except in compliance with the License.
2933 * You may obtain a copy of the License at
2934 *
2935 *   http://www.apache.org/licenses/LICENSE-2.0
2936 *
2937 * Unless required by applicable law or agreed to in writing, software
2938 * distributed under the License is distributed on an "AS IS" BASIS,
2939 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2940 * See the License for the specific language governing permissions and
2941 * limitations under the License.
2942 */class Lc{constructor(e){this.Ln=e}next(){return this.Ln+=2,this.Ln}static Bn(){return new Lc(0)}static kn(){return new Lc(-1)}}/**
2943 * @license
2944 * Copyright 2017 Google LLC
2945 *
2946 * Licensed under the Apache License, Version 2.0 (the "License");
2947 * you may not use this file except in compliance with the License.
2948 * You may obtain a copy of the License at
2949 *
2950 *   http://www.apache.org/licenses/LICENSE-2.0
2951 *
2952 * Unless required by applicable law or agreed to in writing, software
2953 * distributed under the License is distributed on an "AS IS" BASIS,
2954 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2955 * See the License for the specific language governing permissions and
2956 * limitations under the License.
2957 */class CG{constructor(){this.changes=new Au(e=>e.toString(),(e,r)=>e.isEqual(r)),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,r){this.assertNotApplied(),this.changes.set(e,zr.newInvalidDocument(e).setReadTime(r))}getEntry(e,r){this.assertNotApplied();const n=this.changes.get(r);return n!==void 0?se.resolve(n):this.getFromCache(e,r)}getEntries(e,r){return this.getAllFromCache(e,r)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
2958 * @license
2959 * Copyright 2017 Google LLC
2960 *
2961 * Licensed under the Apache License, Version 2.0 (the "License");
2962 * you may not use this file except in compliance with the License.
2963 * You may obtain a copy of the License at
2964 *
2965 *   http://www.apache.org/licenses/LICENSE-2.0
2966 *
2967 * Unless required by applicable law or agreed to in writing, software
2968 * distributed under the License is distributed on an "AS IS" BASIS,
2969 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2970 * See the License for the specific language governing permissions and
2971 * limitations under the License.
2972 *//**
2973 * @license
2974 * Copyright 2022 Google LLC
2975 *
2976 * Licensed under the Apache License, Version 2.0 (the "License");
2977 * you may not use this file except in compliance with the License.
2978 * You may obtain a copy of the License at
2979 *
2980 *   http://www.apache.org/licenses/LICENSE-2.0
2981 *
2982 * Unless required by applicable law or agreed to in writing, software
2983 * distributed under the License is distributed on an "AS IS" BASIS,
2984 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2985 * See the License for the specific language governing permissions and
2986 * limitations under the License.
2987 */class IG{constructor(e,r){this.overlayedDocument=e,this.mutatedFields=r}}/**
2988 * @license
2989 * Copyright 2017 Google LLC
2990 *
2991 * Licensed under the Apache License, Version 2.0 (the "License");
2992 * you may not use this file except in compliance with the License.
2993 * You may obtain a copy of the License at
2994 *
2995 *   http://www.apache.org/licenses/LICENSE-2.0
2996 *
2997 * Unless required by applicable law or agreed to in writing, software
2998 * distributed under the License is distributed on an "AS IS" BASIS,
2999 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3000 * See the License for the specific language governing permissions and
3001 * limitations under the License.
3002 */class OG{constructor(e,r,n,s){this.remoteDocumentCache=e,this.mutationQueue=r,this.documentOverlayCache=n,this.indexManager=s}getDocument(e,r){let n=null;return this.documentOverlayCache.getOverlay(e,r).next(s=>(n=s,this.remoteDocumentCache.getEntry(e,r))).next(s=>(n!==null&&th(n.mutation,s,An.empty(),We.now()),s))}getDocuments(e,r){return this.remoteDocumentCache.getEntries(e,r).next(n=>this.getLocalViewOfDocuments(e,n,He()).next(()=>n))}getLocalViewOfDocuments(e,r,n=He()){const s=bo();return this.populateOverlays(e,s,r).next(()=>this.computeViews(e,r,s,n).next(i=>{let o=$d();return i.forEach((l,c)=>{o=o.insert(l,c.overlayedDocument)}),o}))}getOverlayedDocuments(e,r){const n=bo();return this.populateOverlays(e,n,r).next(()=>this.computeViews(e,r,n,He()))}populateOverlays(e,r,n){const s=[];return n.forEach(i=>{r.has(i)||s.push(i)}),this.documentOverlayCache.getOverlays(e,s).next(i=>{i.forEach((o,l)=>{r.set(o,l)})})}computeViews(e,r,n,s){let i=ks();const o=eh(),l=function(){return eh()}();return r.forEach((c,u)=>{const d=n.get(u.key);s.has(u.key)&&(d===void 0||d.mutation instanceof qi)?i=i.insert(u.key,u):d!==void 0?(o.set(u.key,d.mutation.getFieldMask()),th(d.mutation,u,d.mutation.getFieldMask(),We.now())):o.set(u.key,An.empty())}),this.recalculateAndSaveOverlays(e,i).next(c=>(c.forEach((u,d)=>o.set(u,d)),r.forEach((u,d)=>{var h;return l.set(u,new IG(d,(h=o.get(u))!==null&&h!==void 0?h:null))}),l))}recalculateAndSaveOverlays(e,r){const n=eh();let s=new Lt((o,l)=>o-l),i=He();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,r).next(o=>{for(const l of o)l.keys().forEach(c=>{const u=r.get(c);if(u===null)return;let d=n.get(c)||An.empty();d=l.applyToLocalView(u,d),n.set(c,d);const h=(s.get(l.batchId)||He()).add(c);s=s.insert(l.batchId,h)})}).next(()=>{const o=[],l=s.getReverseIterator();for(;l.hasNext();){const c=l.getNext(),u=c.key,d=c.value,h=B5();d.forEach(m=>{if(!i.has(m)){const p=W5(r.get(m),n.get(m));p!==null&&h.set(m,p),i=i.add(m)}}),o.push(this.documentOverlayCache.saveOverlays(e,u,h))}return se.waitFor(o)}).next(()=>n)}recalculateAndSaveOverlaysForDocumentKeys(e,r){return this.remoteDocumentCache.getEntries(e,r).next(n=>this.recalculateAndSaveOverlays(e,n))}getDocumentsMatchingQuery(e,r,n,s){return function(o){return _e.isDocumentKey(o.path)&&o.collectionGroup===null&&o.filters.length===0}(r)?this.getDocumentsMatchingDocumentQuery(e,r.path):D5(r)?this.getDocumentsMatchingCollectionGroupQuery(e,r,n,s):this.getDocumentsMatchingCollectionQuery(e,r,n,s)}getNextDocuments(e,r,n,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,r,n,s).next(i=>{const o=s-i.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,r,n.largestBatchId,s-i.size):se.resolve(bo());let l=-1,c=i;return o.next(u=>se.forEach(u,(d,h)=>(l<h.largestBatchId&&(l=h.largestBatchId),i.get(d)?se.resolve():this.remoteDocumentCache.getEntry(e,d).next(m=>{c=c.insert(d,m)}))).next(()=>this.populateOverlays(e,u,i)).next(()=>this.computeViews(e,c,u,He())).next(d=>({batchId:l,changes:F5(d)})))})}getDocumentsMatchingDocumentQuery(e,r){return this.getDocument(e,new _e(r)).next(n=>{let s=$d();
vendor: 4,215 bytes, lines 3002-3036
3002return n.isFoundDocument()&&(s=s.insert(n.key,n)),s})}getDocumentsMatchingCollectionGroupQuery(e,r,n,s){const i=r.collectionGroup;let o=$d();return this.indexManager.getCollectionParents(e,i).next(l=>se.forEach(l,c=>{const u=function(h,m){return new Tu(m,null,h.explicitOrderBy.slice(),h.filters.slice(),h.limit,h.limitType,h.startAt,h.endAt)}(r,c.child(i));return this.getDocumentsMatchingCollectionQuery(e,u,n,s).next(d=>{d.forEach((h,m)=>{o=o.insert(h,m)})})}).next(()=>o))}getDocumentsMatchingCollectionQuery(e,r,n,s){let i;return this.documentOverlayCache.getOverlaysForCollection(e,r.path,n.largestBatchId).next(o=>(i=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,r,n,i,s))).next(o=>{i.forEach((c,u)=>{const d=u.getKey();o.get(d)===null&&(o=o.insert(d,zr.newInvalidDocument(d)))});let l=$d();return o.forEach((c,u)=>{const d=i.get(c);d!==void 0&&th(d.mutation,u,An.empty(),We.now()),yy(r,u)&&(l=l.insert(c,u))}),l})}}/**
3003 * @license
3004 * Copyright 2020 Google LLC
3005 *
3006 * Licensed under the Apache License, Version 2.0 (the "License");
3007 * you may not use this file except in compliance with the License.
3008 * You may obtain a copy of the License at
3009 *
3010 *   http://www.apache.org/licenses/LICENSE-2.0
3011 *
3012 * Unless required by applicable law or agreed to in writing, software
3013 * distributed under the License is distributed on an "AS IS" BASIS,
3014 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3015 * See the License for the specific language governing permissions and
3016 * limitations under the License.
3017 */class RG{constructor(e){this.serializer=e,this.hr=new Map,this.Pr=new Map}getBundleMetadata(e,r){return se.resolve(this.hr.get(r))}saveBundleMetadata(e,r){return this.hr.set(r.id,function(s){return{id:s.id,version:s.version,createTime:Ba(s.createTime)}}(r)),se.resolve()}getNamedQuery(e,r){return se.resolve(this.Pr.get(r))}saveNamedQuery(e,r){return this.Pr.set(r.name,function(s){return{name:s.name,query:EG(s.bundledQuery),readTime:Ba(s.readTime)}}(r)),se.resolve()}}/**
3018 * @license
3019 * Copyright 2022 Google LLC
3020 *
3021 * Licensed under the Apache License, Version 2.0 (the "License");
3022 * you may not use this file except in compliance with the License.
3023 * You may obtain a copy of the License at
3024 *
3025 *   http://www.apache.org/licenses/LICENSE-2.0
3026 *
3027 * Unless required by applicable law or agreed to in writing, software
3028 * distributed under the License is distributed on an "AS IS" BASIS,
3029 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3030 * See the License for the specific language governing permissions and
3031 * limitations under the License.
3032 */class DG{constructor(){this.overlays=new Lt(_e.comparator),this.Ir=new Map}getOverlay(e,r){return se.resolve(this.overlays.get(r))}getOverlays(e,r){const n=bo();return se.forEach(r,s=>this.getOverlay(e,s).next(i=>{i!==null&&n.set(s,i)})).next(()=>n)}saveOverlays(e,r,n){return n.forEach((s,i)=>{this.ht(e,r,i)}),se.resolve()}removeOverlaysForBatchId(e,r,n){const s=this.Ir.get(n);return s!==void 0&&(s.forEach(i=>this.overlays=this.overlays.remove(i)),this.Ir.delete(n)),se.resolve()}getOverlaysForCollection(e,r,n){const s=bo(),i=r.length+1,o=new _e(r.child("")),l=this.overlays.getIteratorFrom(o);for(;l.hasNext();){const c=l.getNext().value,u=c.getKey();if(!r.isPrefixOf(u.path))break;u.path.length===i&&c.largestBatchId>n&&s.set(c.getKey(),c)}return se.resolve(s)}getOverlaysForCollectionGroup(e,r,n,s){let i=new Lt((u,d)=>u-d);const o=this.overlays.getIterator();for(;o.hasNext();){const u=o.getNext().value;if(u.getKey().getCollectionGroup()===r&&u.largestBatchId>n){let d=i.get(u.largestBatchId);d===null&&(d=bo(),i=i.insert(u.largestBatchId,d)),d.set(u.getKey(),u)}}const l=bo(),c=i.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach((u,d)=>l.set(u,d)),!(l.size()>=s)););return se.resolve(l)}ht(e,r,n){const s=this.overlays.get(n.key);if(s!==null){const o=this.Ir.get(s.largestBatchId).delete(n.key);this.Ir.set(s.largestBatchId,o)}this.overlays=this.overlays.insert(n.key,new aG(r,n));let i=this.Ir.get(r);i===void 0&&(i=He(),this.Ir.set(r,i)),this.Ir.set(r,i.add(n.key))}}/**
3033 * @license
3034 * Copyright 2024 Google LLC
3035 *
3036 * Licensed under the Apache License, Version 2.0 (the "License");
3037 * you may not use this file except in compliance with the License.
3038 * You may obtain a copy of the License at
3039 *
3040 *   http://www.apache.org/licenses/LICENSE-2.0
3041 *
3042 * Unless required by applicable law or agreed to in writing, software
3043 * distributed under the License is distributed on an "AS IS" BASIS,
3044 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3045 * See the License for the specific language governing permissions and
3046 * limitations under the License.
3047 */class MG{constructor(){this.sessionToken=Ir.EMPTY_BYTE_STRING}getSessionToken(e){return se.resolve(this.sessionToken)}setSessionToken(e,r){return this.sessionToken=r,se.resolve()}}/**
3048 * @license
3049 * Copyright 2017 Google LLC
3050 *
3051 * Licensed under the Apache License, Version 2.0 (the "License");
3052 * you may not use this file except in compliance with the License.
3053 * You may obtain a copy of the License at
3054 *
3055 *   http://www.apache.org/licenses/LICENSE-2.0
3056 *
3057 * Unless required by applicable law or agreed to in writing, software
3058 * distributed under the License is distributed on an "AS IS" BASIS,
3059 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3060 * See the License for the specific language governing permissions and
3061 * limitations under the License.
3062 */class ZN{constructor(){this.Tr=new Pr(mr.Er),this.dr=new Pr(mr.Ar)}isEmpty(){return this.Tr.isEmpty()}addReference(e,r){const n=new mr(e,r);this.Tr=this.Tr.add(n),this.dr=this.dr.add(n)}Rr(e,r){e.forEach(n=>this.addReference(n,r))}removeReference(e,r){this.Vr(new mr(e,r))}mr(e,r){e.forEach(n=>this.removeReference(n,r))}gr(e){const r=new _e(new At([])),n=new mr(r,e),s=new mr(r,e+1),i=[];return this.dr.forEachInRange([n,s],o=>{this.Vr(o),i.push(o.key)}),i}pr(){this.Tr.forEach(e=>this.Vr(e))}Vr(e){this.Tr=this.Tr.delete(e),this.dr=this.dr.delete(e)}yr(e){const r=new _e(new At([])),n=new mr(r,e),s=new mr(r,e+1);let i=He();return this.dr.forEachInRange([n,s],o=>{i=i.add(o.key)}),i}containsKey(e){const r=new mr(e,0),n=this.Tr.firstAfterOrEqual(r);return n!==null&&e.isEqual(n.key)}}class mr{constructor(e,r){this.key=e,this.wr=r}static Er(e,r){return _e.comparator(e.key,r.key)||tt(e.wr,r.wr)}static Ar(e,r){return tt(e.wr,r.wr)||_e.comparator(e.key,r.key)}}/**
3063 * @license
3064 * Copyright 2017 Google LLC
3065 *
3066 * Licensed under the Apache License, Version 2.0 (the "License");
3067 * you may not use this file except in compliance with the License.
3068 * You may obtain a copy of the License at
3069 *
3070 *   http://www.apache.org/licenses/LICENSE-2.0
3071 *
3072 * Unless required by applicable law or agreed to in writing, software
3073 * distributed under the License is distributed on an "AS IS" BASIS,
3074 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3075 * See the License for the specific language governing permissions and
3076 * limitations under the License.
3077 */class $G{constructor(e,r){this.indexManager=e,this.referenceDelegate=r,this.mutationQueue=[],this.Sr=1,this.br=new Pr(mr.Er)}checkEmpty(e){return se.resolve(this.mutationQueue.length===0)}addMutationBatch(e,r,n,s){const i=this.Sr;this.Sr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new nG(i,r,n,s);this.mutationQueue.push(o);for(const l of s)this.br=this.br.add(new mr(l.key,i)),this.indexManager.addToCollectionParentIndex(e,l.key.path.popLast());return se.resolve(o)}lookupMutationBatch(e,r){return se.resolve(this.Dr(r))}getNextMutationBatchAfterBatchId(e,r){const n=r+1,s=this.vr(n),i=s<0?0:s;return se.resolve(this.mutationQueue.length>i?this.mutationQueue[i]:null)}getHighestUnacknowledgedBatchId(){return se.resolve(this.mutationQueue.length===0?-1:this.Sr-1)}getAllMutationBatches(e){return se.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,r){const n=new mr(r,0),s=new mr(r,Number.POSITIVE_INFINITY),i=[];return this.br.forEachInRange([n,s],o=>{const l=this.Dr(o.wr);i.push(l)}),se.resolve(i)}getAllMutationBatchesAffectingDocumentKeys(e,r){let n=new Pr(tt);return r.forEach(s=>{const i=new mr(s,0),o=new mr(s,Number.POSITIVE_INFINITY);this.br.forEachInRange([i,o],l=>{n=n.add(l.wr)})}),se.resolve(this.Cr(n))}getAllMutationBatchesAffectingQuery(e,r){const n=r.path,s=n.length+1;let i=n;_e.isDocumentKey(i)||(i=i.child(""));const o=new mr(new _e(i),0);let l=new Pr(tt);return this.br.forEachWhile(c=>{const u=c.key.path;return!!n.isPrefixOf(u)&&(u.length===s&&(l=l.add(c.wr)),!0)},o),se.resolve(this.Cr(l))}Cr(e){const r=[];return e.forEach(n=>{const s=this.Dr(n);s!==null&&r.push(s)}),r}removeMutationBatch(e,r){ut(this.Fr(r.batchId,"removed")===0),this.mutation
3077Queue.shift();let n=this.br;return se.forEach(r.mutations,s=>{const i=new mr(s.key,r.batchId);return n=n.delete(i),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)}).next(()=>{this.br=n})}On(e){}containsKey(e,r){const n=new mr(r,0),s=this.br.firstAfterOrEqual(n);return se.resolve(r.isEqual(s&&s.key))}performConsistencyCheck(e){return this.mutationQueue.length,se.resolve()}Fr(e,r){return this.vr(e)}vr(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}Dr(e){const r=this.vr(e);return r<0||r>=this.mutationQueue.length?null:this.mutationQueue[r]}}/**
3078 * @license
3079 * Copyright 2017 Google LLC
3080 *
3081 * Licensed under the Apache License, Version 2.0 (the "License");
3082 * you may not use this file except in compliance with the License.
3083 * You may obtain a copy of the License at
3084 *
3085 *   http://www.apache.org/licenses/LICENSE-2.0
3086 *
3087 * Unless required by applicable law or agreed to in writing, software
3088 * distributed under the License is distributed on an "AS IS" BASIS,
3089 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3090 * See the License for the specific language governing permissions and
3091 * limitations under the License.
3092 */class LG{constructor(e){this.Mr=e,this.docs=function(){return new Lt(_e.comparator)}(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,r){const n=r.key,s=this.docs.get(n),i=s?s.size:0,o=this.Mr(r);return this.docs=this.docs.insert(n,{document:r.mutableCopy(),size:o}),this.size+=o-i,this.indexManager.addToCollectionParentIndex(e,n.path.popLast())}removeEntry(e){const r=this.docs.get(e);r&&(this.docs=this.docs.remove(e),this.size-=r.size)}getEntry(e,r){const n=this.docs.get(r);return se.resolve(n?n.document.mutableCopy():zr.newInvalidDocument(r))}getEntries(e,r){let n=ks();return r.forEach(s=>{const i=this.docs.get(s);n=n.insert(s,i?i.document.mutableCopy():zr.newInvalidDocument(s))}),se.resolve(n)}getDocumentsMatchingQuery(e,r,n,s){let i=ks();const o=r.path,l=new _e(o.child("")),c=this.docs.getIteratorFrom(l);for(;c.hasNext();){const{key:u,value:{document:d}}=c.getNext();if(!o.isPrefixOf(u.path))break;u.path.length>o.length+1||wW(bW(d),n)<=0||(s.has(d.key)||yy(r,d))&&(i=i.insert(d.key,d.mutableCopy()))}return se.resolve(i)}getAllFromCollectionGroup(e,r,n,s){Ce()}Or(e,r){return se.forEach(this.docs,n=>r(n))}newChangeBuffer(e){return new FG(this)}getSize(e){return se.resolve(this.size)}}class FG extends CG{constructor(e){super(),this.cr=e}applyChanges(e){const r=[];
vendor: 10,428 bytes, lines 3092-3171
3092return this.changes.forEach((n,s)=>{s.isValidDocument()?r.push(this.cr.addEntry(e,s)):this.cr.removeEntry(n)}),se.waitFor(r)}getFromCache(e,r){return this.cr.getEntry(e,r)}getAllFromCache(e,r){return this.cr.getEntries(e,r)}}/**
3093 * @license
3094 * Copyright 2017 Google LLC
3095 *
3096 * Licensed under the Apache License, Version 2.0 (the "License");
3097 * you may not use this file except in compliance with the License.
3098 * You may obtain a copy of the License at
3099 *
3100 *   http://www.apache.org/licenses/LICENSE-2.0
3101 *
3102 * Unless required by applicable law or agreed to in writing, software
3103 * distributed under the License is distributed on an "AS IS" BASIS,
3104 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3105 * See the License for the specific language governing permissions and
3106 * limitations under the License.
3107 */class BG{constructor(e){this.persistence=e,this.Nr=new Au(r=>WN(r),GN),this.lastRemoteSnapshotVersion=Oe.min(),this.highestTargetId=0,this.Lr=0,this.Br=new ZN,this.targetCount=0,this.kr=Lc.Bn()}forEachTarget(e,r){return this.Nr.forEach((n,s)=>r(s)),se.resolve()}getLastRemoteSnapshotVersion(e){return se.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return se.resolve(this.Lr)}allocateTargetId(e){return this.highestTargetId=this.kr.next(),se.resolve(this.highestTargetId)}setTargetsMetadata(e,r,n){return n&&(this.lastRemoteSnapshotVersion=n),r>this.Lr&&(this.Lr=r),se.resolve()}Kn(e){this.Nr.set(e.target,e);const r=e.targetId;r>this.highestTargetId&&(this.kr=new Lc(r),this.highestTargetId=r),e.sequenceNumber>this.Lr&&(this.Lr=e.sequenceNumber)}addTargetData(e,r){return this.Kn(r),this.targetCount+=1,se.resolve()}updateTargetData(e,r){return this.Kn(r),se.resolve()}removeTargetData(e,r){return this.Nr.delete(r.target),this.Br.gr(r.targetId),this.targetCount-=1,se.resolve()}removeTargets(e,r,n){let s=0;const i=[];return this.Nr.forEach((o,l)=>{l.sequenceNumber<=r&&n.get(l.targetId)===null&&(this.Nr.delete(o),i.push(this.removeMatchingKeysForTargetId(e,l.targetId)),s++)}),se.waitFor(i).next(()=>s)}getTargetCount(e){return se.resolve(this.targetCount)}getTargetData(e,r){const n=this.Nr.get(r)||null;return se.resolve(n)}addMatchingKeys(e,r,n){return this.Br.Rr(r,n),se.resolve()}removeMatchingKeys(e,r,n){this.Br.mr(r,n);const s=this.persistence.referenceDelegate,i=[];return s&&r.forEach(o=>{i.push(s.markPotentiallyOrphaned(e,o))}),se.waitFor(i)}removeMatchingKeysForTargetId(e,r){return this.Br.gr(r),se.resolve()}getMatchingKeysForTargetId(e,r){const n=this.Br.yr(r);return se.resolve(n)}containsKey(e,r){return se.resolve(this.Br.containsKey(r))}}/**
3108 * @license
3109 * Copyright 2017 Google LLC
3110 *
3111 * Licensed under the Apache License, Version 2.0 (the "License");
3112 * you may not use this file except in compliance with the License.
3113 * You may obtain a copy of the License at
3114 *
3115 *   http://www.apache.org/licenses/LICENSE-2.0
3116 *
3117 * Unless required by applicable law or agreed to in writing, software
3118 * distributed under the License is distributed on an "AS IS" BASIS,
3119 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3120 * See the License for the specific language governing permissions and
3121 * limitations under the License.
3122 */class VG{constructor(e,r){this.qr={},this.overlays={},this.Qr=new UN(0),this.Kr=!1,this.Kr=!0,this.$r=new MG,this.referenceDelegate=e(this),this.Ur=new BG(this),this.indexManager=new kG,this.remoteDocumentCache=function(s){return new LG(s)}(n=>this.referenceDelegate.Wr(n)),this.serializer=new AG(r),this.Gr=new RG(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.Kr=!1,Promise.resolve()}get started(){return this.Kr}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let r=this.overlays[e.toKey()];return r||(r=new DG,this.overlays[e.toKey()]=r),r}getMutationQueue(e,r){let n=this.qr[e.toKey()];return n||(n=new $G(r,this.referenceDelegate),this.qr[e.toKey()]=n),n}getGlobalsCache(){return this.$r}getTargetCache(){return this.Ur}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.Gr}runTransaction(e,r,n){be("MemoryPersistence","Starting transaction:",e);const s=new UG(this.Qr.next());return this.referenceDelegate.zr(),n(s).next(i=>this.referenceDelegate.jr(s).next(()=>i)).toPromise().then(i=>(s.raiseOnCommittedEvent(),i))}Hr(e,r){return se.or(Object.values(this.qr).map(n=>()=>n.containsKey(e,r)))}}class UG extends NW{constructor(e){super(),this.currentSequenceNumber=e}}class e2{constructor(e){this.persistence=e,this.Jr=new ZN,this.Yr=null}static Zr(e){return new e2(e)}get Xr(){if(this.Yr)return this.Yr;throw Ce()}addReference(e,r,n){return this.Jr.addReference(n,r),this.Xr.delete(n.toString()),se.resolve()}removeReference(e,r,n){return this.Jr.removeReference(n,r),this.Xr.add(n.toString()),se.resolve()}markPotentiallyOrphaned(e,r){return this.Xr.add(r.toString()),se.resolve()}removeTarget(e,r){this.Jr.gr(r.targetId).forEach(s=>this.Xr.add(s.toString()));const n=this.persistence.getTargetCache();return n.getMatchingKeysForTargetId(e,r.targetId).next(s=>{s.forEach(i=>this.Xr.add(i.toString()))}).next(()=>n.removeTargetData(e,r))}zr(){this.Yr=new Set}jr(e){const r=this.persistence.getRemoteDocumentCache().newChangeBuffer();return se.forEach(this.Xr,n=>{const s=_e.fromPath(n);return this.ei(e,s).next(i=>{i||r.removeEntry(s,Oe.min())})}).next(()=>(this.Yr=null,r.apply(e)))}updateLimboDocument(e,r){return this.ei(e,r).next(n=>{n?this.Xr.delete(r.toString()):this.Xr.add(r.toString())})}Wr(e){return 0}ei(e,r){return se.or([()=>se.resolve(this.Jr.containsKey(r)),()=>this.persistence.getTargetCache().containsKey(e,r),()=>this.persistence.Hr(e,r)])}}/**
3123 * @license
3124 * Copyright 2017 Google LLC
3125 *
3126 * Licensed under the Apache License, Version 2.0 (the "License");
3127 * you may not use this file except in compliance with the License.
3128 * You may obtain a copy of the License at
3129 *
3130 *   http://www.apache.org/licenses/LICENSE-2.0
3131 *
3132 * Unless required by applicable law or agreed to in writing, software
3133 * distributed under the License is distributed on an "AS IS" BASIS,
3134 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3135 * See the License for the specific language governing permissions and
3136 * limitations under the License.
3137 */class t2{constructor(e,r,n,s){this.targetId=e,this.fromCache=r,this.$i=n,this.Ui=s}static Wi(e,r){let n=He(),s=He();for(const i of r.docChanges)switch(i.type){case 0:n=n.add(i.doc.key);break;case 1:s=s.add(i.doc.key)}return new t2(e,r.fromCache,n,s)}}/**
3138 * @license
3139 * Copyright 2023 Google LLC
3140 *
3141 * Licensed under the Apache License, Version 2.0 (the "License");
3142 * you may not use this file except in compliance with the License.
3143 * You may obtain a copy of the License at
3144 *
3145 *   http://www.apache.org/licenses/LICENSE-2.0
3146 *
3147 * Unless required by applicable law or agreed to in writing, software
3148 * distributed under the License is distributed on an "AS IS" BASIS,
3149 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3150 * See the License for the specific language governing permissions and
3151 * limitations under the License.
3152 */class zG{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
3153 * @license
3154 * Copyright 2019 Google LLC
3155 *
3156 * Licensed under the Apache License, Version 2.0 (the "License");
3157 * you may not use this file except in compliance with the License.
3158 * You may obtain a copy of the License at
3159 *
3160 *   http://www.apache.org/licenses/LICENSE-2.0
3161 *
3162 * Unless required by applicable law or agreed to in writing, software
3163 * distributed under the License is distributed on an "AS IS" BASIS,
3164 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3165 * See the License for the specific language governing permissions and
3166 * limitations under the License.
3167 */class HG{constructor(){this.Gi=!1,this.zi=!1,this.ji=100,this.Hi=function(){return TU()?8:_W(Kr())>0?6:4}()}initialize(e,r){this.Ji=e,this.indexManager=r,this.Gi=!0}getDocumentsMatchingQuery(e,r,n,s){const i={result:null};return this.Yi(e,r).next(o=>{i.result=o}).next(()=>{if(!i.result)return this.Zi(e,r,s,n).next(o=>{i.result=o})}).next(()=>{if(i.result)return;const o=new zG;return this.Xi(e,r,o).next(l=>{if(i.result=l,this.zi)return this.es(e,r,o,l.size)})}).next(()=>i.result)}es(e,r,n,s){return n.documentReadCount<this.ji?(hd()<=Ke.DEBUG&&be("QueryEngine","SDK will not create cache indexes for query:",Fl(r),"since it only creates cache indexes for collection contains","more than or equal to",this.ji,"documents"),se.resolve()):(hd()<=Ke.DEBUG&&be("QueryEngine","Query:",Fl(r),"scans",n.documentReadCount,"local documents and returns",s,"documents as results."),n.documentReadCount>this.Hi*s?(hd()<=Ke.DEBUG&&be("QueryEngine","The SDK decides to create cache indexes for query:",Fl(r),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Fa(r))):se.resolve())}Yi(e,r){if(fE(r))return se.resolve(null);let n=Fa(r);return this.indexManager.getIndexType(e,n).next(s=>s===0?null:(r.limit!==null&&s===1&&(r=Tg(r,null,"F"),n=Fa(r)),this.indexManager.getDocumentsMatchingTarget(e,n).next(i=>{const o=He(...i);return this.Ji.getDocuments(e,o).next(l=>this.indexManager.getMinOffset(e,n).next(c=>{const u=this.ts(r,l);return this.ns(r,u,o,c.readTime)?this.Yi(e,Tg(r,null,"F")):this.rs(e,u,r,c)}))})))}Zi(e,r,n,s){return fE(r)||s.isEqual(Oe.min())?se.resolve(null):this.Ji.getDocuments(e,n).next(i=>{const o=this.ts(r,i);return this.ns(r,o,n,s)?se.resolve(null):(hd()<=Ke.DEBUG&&be("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),Fl(r)),this.rs(e,o,r,vW(s,-1)).next(l=>l))})}ts(e,r){let n=new Pr($5(e));return r.forEach((s,i)=>{yy(e,i)&&(n=n.add(i))}),n}ns(e,r,n,s){if(e.limit===null)return!1;if(n.size!==r.size)return!0;const i=e.limitType==="F"?r.last():r.first();return!!i&&(i.hasPendingWrites||i.version.compareTo(s)>0)}Xi(e,r,n){return hd()<=Ke.DEBUG&&be("QueryEngine","Using full collection scan to execute query:",Fl(r)),this.Ji.getDocumentsMatchingQuery(e,r,Di.min(),n)}rs(e,r,n,s){return this.Ji.getDocumentsMatchingQuery(e,n,s).next(i=>(r.forEach(o=>{i=i.insert(o.key,o)}),i))}}/**
3168 * @license
3169 * Copyright 2020 Google LLC
3170 *
3171 * Licensed under the Apache License, Version 2.0 (the "License");
3172 * you may not use this file except in compliance with the License.
3173 * You may obtain a copy of the License at
3174 *
3175 *   http://www.apache.org/licenses/LICENSE-2.0
3176 *
3177 * Unless required by applicable law or agreed to in writing, software
3178 * distributed under the License is distributed on an "AS IS" BASIS,
3179 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3180 * See the License for the specific language governing permissions and
3181 * limitations under the License.
3182 */class qG{constructor(e,r,n,s){this.persistence=e,this.ss=r,this.serializer=s,this.os=new Lt(tt),this._s=new Au(i=>WN(i),GN),this.us=new Map,this.cs=e.getRemoteDocumentCache(),this.Ur=e.getTargetCache(),this.Gr=e.getBundleCache(),this.ls(n)}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 OG(this.cs,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.cs.setIndexManager(this.indexManager),this.ss.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",r=>e.collect(r,this.os))}}function WG(t,e,r,n){return new qG(t,e,r,n)}async function aD(t,e){const r=Re(t);return await r.persistence.runTransaction("Handle user change","readonly",n=>{let s;return r.mutationQueue.getAllMutationBatches(n).next(i=>(s=i,r.ls(e),r.mutationQueue.getAllMutationBatches(n))).next(i=>{const o=[],l=[];let c=He();for(const u of s){o.push(u.batchId);for(const d of u.mutations)c=c.add(d.key)}for(const u of i){l.push(u.batchId);for(const d of u.mutations)c=c.add(d.key)}return r.localDocuments.getDocuments(n,c).next(u=>({hs:u,removedBatchIds:o,addedBatchIds:l}))})})}function GG(t,e){const r=Re(t);return r.persistence.runTransaction("Acknowledge batch","readwrite-primary",n=>{const s=e.batch.keys(),i=r.cs.newChangeBuffer({trackRemovals:!0});return function(l,c,u,d){const h=u.batch,m=h.keys();let p=se.resolve();return m.forEach(x=>{p=p.next(()=>d.getEntry(c,x)).next(w=>{const g=u.docVersions.get(x);ut(g!==null),w.version.compareTo(g)<0&&(h.applyToRemoteDocument(w,u),w.isValidDocument()&&(w.setReadTime(u.commitVersion),d.addEntry(w)))})}),p.next(()=>l.mutationQueue.removeMutationBatch(c,h))}(r,n,e,i).next(()=>i.apply(n)).next(()=>r.mutationQueue.performConsistencyCheck(n)).next(()=>r.documentOverlayCache.removeOverlaysForBatchId(n,s,e.batch.batchId)).next(()=>r.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(n,function(l){let c=He();for(let u=0;u<l.mutationResults.length;++u)l.mutationResults[u].transformResults.length>0&&(c=c.add(l.batch.mutations[u].key));return c}(e))).next(()=>r.localDocuments.getDocuments(n,s))})}function sD(t){const e=Re(t);return e.persistence.runTransaction("Get last remote snapshot version","readonly",r=>e.Ur.getLastRemoteSnapshotVersion(r))}function KG(t,e){const r=Re(t),n=e.snapshotVersion;let s=r.os;return r.persistence.runTransaction("Apply remote event","readwrite-primary",i=>{const o=r.cs.newChangeBuffer({trackRemovals:!0});s=r.os;const l=[];
vendor: 4,430 bytes, lines 3182-3186
3182e.targetChanges.forEach((d,h)=>{const m=s.get(h);if(!m)return;l.push(r.Ur.removeMatchingKeys(i,d.removedDocuments,h).next(()=>r.Ur.addMatchingKeys(i,d.addedDocuments,h)));let p=m.withSequenceNumber(i.currentSequenceNumber);e.targetMismatches.get(h)!==null?p=p.withResumeToken(Ir.EMPTY_BYTE_STRING,Oe.min()).withLastLimboFreeSnapshotVersion(Oe.min()):d.resumeToken.approximateByteSize()>0&&(p=p.withResumeToken(d.resumeToken,n)),s=s.insert(h,p),function(w,g,v){return w.resumeToken.approximateByteSize()===0||g.snapshotVersion.toMicroseconds()-w.snapshotVersion.toMicroseconds()>=3e8?!0:v.addedDocuments.size+v.modifiedDocuments.size+v.removedDocuments.size>0}(m,p,d)&&l.push(r.Ur.updateTargetData(i,p))});let c=ks(),u=He();if(e.documentUpdates.forEach(d=>{e.resolvedLimboDocuments.has(d)&&l.push(r.persistence.referenceDelegate.updateLimboDocument(i,d))}),l.push(XG(i,o,e.documentUpdates).next(d=>{c=d.Ps,u=d.Is})),!n.isEqual(Oe.min())){const d=r.Ur.getLastRemoteSnapshotVersion(i).next(h=>r.Ur.setTargetsMetadata(i,i.currentSequenceNumber,n));l.push(d)}return se.waitFor(l).next(()=>o.apply(i)).next(()=>r.localDocuments.getLocalViewOfDocuments(i,c,u)).next(()=>c)}).then(i=>(r.os=s,i))}function XG(t,e,r){let n=He(),s=He();return r.forEach(i=>n=n.add(i)),e.getEntries(t,n).next(i=>{let o=ks();return r.forEach((l,c)=>{const u=i.get(l);c.isFoundDocument()!==u.isFoundDocument()&&(s=s.add(l)),c.isNoDocument()&&c.version.isEqual(Oe.min())?(e.removeEntry(l,c.readTime),o=o.insert(l,c)):!u.isValidDocument()||c.version.compareTo(u.version)>0||c.version.compareTo(u.version)===0&&u.hasPendingWrites?(e.addEntry(c),o=o.insert(l,c)):be("LocalStore","Ignoring outdated watch update for ",l,". Current version:",u.version," Watch version:",c.version)}),{Ps:o,Is:s}})}function YG(t,e){const r=Re(t);return r.persistence.runTransaction("Get next mutation batch","readonly",n=>(e===void 0&&(e=-1),r.mutationQueue.getNextMutationBatchAfterBatchId(n,e)))}function QG(t,e){const r=Re(t);return r.persistence.runTransaction("Allocate target","readwrite",n=>{let s;return r.Ur.getTargetData(n,e).next(i=>i?(s=i,se.resolve(s)):r.Ur.allocateTargetId(n).next(o=>(s=new hi(e,o,"TargetPurposeListen",n.currentSequenceNumber),r.Ur.addTargetData(n,s).next(()=>s))))}).then(n=>{const s=r.os.get(n.targetId);return(s===null||n.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(r.os=r.os.insert(n.targetId,n),r._s.set(e,n.targetId)),n})}async function Hw(t,e,r){const n=Re(t),s=n.os.get(e),i=r?"readwrite":"readwrite-primary";try{r||await n.persistence.runTransaction("Release target",i,o=>n.persistence.referenceDelegate.removeTarget(o,s))}catch(o){if(!Lm(o))throw o;be("LocalStore",`Failed to update sequence numbers for target ${e}: ${o}`)}n.os=n.os.remove(e),n._s.delete(s.target)}function SE(t,e,r){const n=Re(t);let s=Oe.min(),i=He();return n.persistence.runTransaction("Execute query","readwrite",o=>function(c,u,d){const h=Re(c),m=h._s.get(d);return m!==void 0?se.resolve(h.os.get(m)):h.Ur.getTargetData(u,d)}(n,o,Fa(e)).next(l=>{if(l)return s=l.lastLimboFreeSnapshotVersion,n.Ur.getMatchingKeysForTargetId(o,l.targetId).next(c=>{i=c})}).next(()=>n.ss.getDocumentsMatchingQuery(o,e,r?s:Oe.min(),r?i:He())).next(l=>(JG(n,UW(e),l),{documents:l,Ts:i})))}function JG(t,e,r){let n=t.us.get(e)||Oe.min();r.forEach((s,i)=>{i.readTime.compareTo(n)>0&&(n=i.readTime)}),t.us.set(e,n)}class TE{constructor(){this.activeTargetIds=KW()}fs(e){this.activeTargetIds=this.activeTargetIds.add(e)}gs(e){this.activeTargetIds=this.activeTargetIds.delete(e)}Vs(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class ZG{constructor(){this.so=new TE,this.oo={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,r,n){}addLocalQueryTarget(e,r=!0){return r&&this.so.fs(e),this.oo[e]||"not-current"}updateQueryState(e,r,n){this.oo[e]=r}removeLocalQueryTarget(e){this.so.gs(e)}isLocalQueryTarget(e){return this.so.activeTargetIds.has(e)}clearQueryState(e){delete this.oo[e]}getAllActiveQueryTargets(){return this.so.activeTargetIds}isActiveQueryTarget(e){return this.so.activeTargetIds.has(e)}start(){return this.so=new TE,Promise.resolve()}handleUserChange(e,r,n){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
3183 * @license
3184 * Copyright 2019 Google LLC
3185 *
3186 * Licensed under the Apache License, Version 2.0 (the "License");
3187 * you may not use this file except in compliance with the License.
3188 * You may obtain a copy of the License at
3189 *
3190 *   http://www.apache.org/licenses/LICENSE-2.0
3191 *
3192 * Unless required by applicable law or agreed to in writing, software
3193 * distributed under the License is distributed on an "AS IS" BASIS,
3194 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3195 * See the License for the specific language governing permissions and
3196 * limitations under the License.
3197 */class eK{_o(e){}shutdown(){}}/**
3198 * @license
3199 * Copyright 2019 Google LLC
3200 *
3201 * Licensed under the Apache License, Version 2.0 (the "License");
3202 * you may not use this file except in compliance with the License.
3203 * You may obtain a copy of the License at
3204 *
3205 *   http://www.apache.org/licenses/LICENSE-2.0
3206 *
3207 * Unless required by applicable law or agreed to in writing, software
3208 * distributed under the License is distributed on an "AS IS" BASIS,
3209 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3210 * See the License for the specific language governing permissions and
3211 * limitations under the License.
3212 */class AE{constructor(){this.ao=()=>this.uo(),this.co=()=>this.lo(),this.ho=[],this.Po()}_o(e){this.ho.push(e)}shutdown(){window.removeEventListener("online",this.ao),window.removeEventListener("offline",this.co)}Po(){window.addEventListener("online",this.ao),window.addEventListener("offline",this.co)}uo(){be("ConnectivityMonitor","Network connectivity changed: AVAILABLE");for(const e of this.ho)e(0)}lo(){be("ConnectivityMonitor","Network connectivity changed: UNAVAILABLE");for(const e of this.ho)e(1)}static D(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
3213 * @license
3214 * Copyright 2023 Google LLC
3215 *
3216 * Licensed under the Apache License, Version 2.0 (the "License");
3217 * you may not use this file except in compliance with the License.
3218 * You may obtain a copy of the License at
3219 *
3220 *   http://www.apache.org/licenses/LICENSE-2.0
3221 *
3222 * Unless required by applicable law or agreed to in writing, software
3223 * distributed under the License is distributed on an "AS IS" BASIS,
3224 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3225 * See the License for the specific language governing permissions and
3226 * limitations under the License.
3227 */let qf=null;function k0(){return qf===null?qf=function(){return 268435456+Math.round(2147483648*Math.random())}():qf++,"0x"+qf.toString(16)}/**
3228 * @license
3229 * Copyright 2020 Google LLC
3230 *
3231 * Licensed under the Apache License, Version 2.0 (the "License");
3232 * you may not use this file except in compliance with the License.
3233 * You may obtain a copy of the License at
3234 *
3235 *   http://www.apache.org/licenses/LICENSE-2.0
3236 *
3237 * Unless required by applicable law or agreed to in writing, software
3238 * distributed under the License is distributed on an "AS IS" BASIS,
3239 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3240 * See the License for the specific language governing permissions and
3241 * limitations under the License.
3242 */const tK={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery"};/**
3243 * @license
3244 * Copyright 2017 Google LLC
3245 *
3246 * Licensed under the Apache License, Version 2.0 (the "License");
3247 * you may not use this file except in compliance with the License.
3248 * You may obtain a copy of the License at
3249 *
3250 *   http://www.apache.org/licenses/LICENSE-2.0
3251 *
3252 * Unless required by applicable law or agreed to in writing, software
3253 * distributed under the License is distributed on an "AS IS" BASIS,
3254 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3255 * See the License for the specific language governing permissions and
3256 * limitations under the License.
3257 */class rK{constructor(e){this.Io=e.Io,this.To=e.To}Eo(e){this.Ao=e}Ro(e){this.Vo=e}mo(e){this.fo=e}onMessage(e){this.po=e}close(){this.To()}send(e){this.Io(e)}yo(){this.Ao()}wo(){this.Vo()}So(e){this.fo(e)}bo(e){this.po(e)}}/**
3258 * @license
3259 * Copyright 2017 Google LLC
3260 *
3261 * Licensed under the Apache License, Version 2.0 (the "License");
3262 * you may not use this file except in compliance with the License.
3263 * You may obtain a copy of the License at
3264 *
3265 *   http://www.apache.org/licenses/LICENSE-2.0
3266 *
3267 * Unless required by applicable law or agreed to in writing, software
3268 * distributed under the License is distributed on an "AS IS" BASIS,
3269 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3270 * See the License for the specific language governing permissions and
3271 * limitations under the License.
3272 */const Fr="WebChannelConnection";class nK extends class{constructor(r){this.databaseInfo=r,this.databaseId=r.databaseId;const n=r.ssl?"https":"http",s=encodeURIComponent(this.databaseId.projectId),i=encodeURIComponent(this.databaseId.database);this.Do=n+"://"+r.host,this.vo=`projects/${s}/databases/${i}`,this.Co=this.databaseId.database==="(default)"?`project_id=${s}`:`project_id=${s}&database_id=${i}`}get Fo(){return!1}Mo(r,n,s,i,o){const l=k0(),c=this.xo(r,n.toUriEncodedString());be("RestConnection",`Sending RPC '${r}' ${l}:`,c,s);const u={"google-cloud-resource-prefix":this.vo,"x-goog-request-params":this.Co};return this.Oo(u,i,o),this.No(r,c,u,s).then(d=>(be("RestConnection",`Received RPC '${r}' ${l}: `,d),d),d=>{throw Ic("RestConnection",`RPC '${r}' ${l} failed with error: `,d,"url: ",c,"request:",s),d})}Lo(r,n,s,i,o,l){return this.Mo(r,n,s,i,o)}Oo(r,n,s){r["X-Goog-Api-Client"]=function(){return"gl-js/ fire/"+Su}(),r["Content-Type"]="text/plain",this.databaseInfo.appId&&(r["X-Firebase-GMPID"]=this.databaseInfo.appId),n&&n.headers.forEach((i,o)=>r[o]=i),s&&s.headers.forEach((i,o)=>r[o]=i)}xo(r,n){const s=tK[r];return`${this.Do}/v1/${n}:${s}`}terminate(){}}{constructor(e){super(e),this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}No(e,r,n,s){const i=k0();return new Promise((o,l)=>{const c=new v5;c.setWithCredentials(!0),c.listenOnce(b5.COMPLETE,()=>{try{switch(c.getLastErrorCode()){case Op.NO_ERROR:const d=c.getResponseJson();be(Fr,`XHR for RPC '${e}' ${i} received:`,JSON.stringify(d)),o(d);break;case Op.TIMEOUT:be(Fr,`RPC '${e}' ${i} timed out`),l(new fe(te.DEADLINE_EXCEEDED,"Request time out"));break;case Op.HTTP_ERROR:const h=c.getStatus();if(be(Fr,`RPC '${e}' ${i} failed with status:`,h,"response text:",c.getResponseText()),h>0){let m=c.getResponseJson();Array.isArray(m)&&(m=m[0]);const p=m==null?void 0:m.error;if(p&&p.status&&p.message){const x=function(g){const v=g.toLowerCase().replace(/_/g,"-");return Object.values(te).indexOf(v)>=0?v:te.UNKNOWN}(p.status);l(new fe(x,p.message))}else l(new fe(te.UNKNOWN,"Server responded with status "+c.getStatus()))}else l(new fe(te.UNAVAILABLE,"Connection failed."));break;default:Ce()}}finally{be(Fr,`RPC '${e}' ${i} completed.`)}});const u=JSON.stringify(s);be(Fr,`RPC '${e}' ${i} sending request:`,s),c.send(r,"POST",u,n,15)})}Bo(e,r,n){const s=k0(),i=[this.Do,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=N5(),l=j5(),c={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&&(c.longPollingTimeout=Math.round(1e3*u)),this.useFetchStreams&&(c.useFetchStreams=!0),this.Oo(c.initMessageHeaders,r,n),c.encodeInitMessageHeaders=!0;const d=i.join("");be(Fr,`Creating RPC '${e}' stream ${s}: ${d}`,c);const h=o.createWebChannel(d,c);let m=!1,p=!1;const x=new rK({Io:g=>{p?be(Fr,`Not sending because RPC '${e}' stream ${s} is closed:`,g):(m||(be(Fr,`Opening RPC '${e}' stream ${s} transport.`),h.open(),m=!0),be(Fr,`RPC '${e}' stream ${s} sending:`,g),h.send(g))},To:()=>h.close()}),w=(g,v,b)=>{g.listen(v,y=>{try{b(y)}catch(T){setTimeout(()=>{throw T},0)}})};return w(h,Md.EventType.OPEN,()=>{p||(be(Fr,`RPC '${e}' stream ${s} transport opened.`),x.yo())}),w(h,Md.EventType.CLOSE,()=>{p||(p=!0,be(Fr,`RPC '${e}' stream ${s} transport closed`),x.So())}
3272),w(h,Md.EventType.ERROR,g=>{p||(p=!0,Ic(Fr,`RPC '${e}' stream ${s} transport errored:`,g),x.So(new fe(te.UNAVAILABLE,"The operation could not be completed")))}),w(h,Md.EventType.MESSAGE,g=>{var v;if(!p){const b=g.data[0];ut(!!b);const y=b,T=y.error||((v=y[0])===null||v===void 0?void 0:v.error);if(T){be(Fr,`RPC '${e}' stream ${s} received error:`,T);const N=T.status;let j=function(k){const I=Kt[k];if(I!==void 0)return K5(I)}(N),_=T.message;j===void 0&&(j=te.INTERNAL,_="Unknown error status: "+N+" with message "+T.message),p=!0,x.So(new fe(j,_)),h.close()}else be(Fr,`RPC '${e}' stream ${s} received:`,b),x.bo(b)}}),w(l,w5.STAT_EVENT,g=>{g.stat===Rw.PROXY?be(Fr,`RPC '${e}' stream ${s} detected buffering proxy`):g.stat===Rw.NOPROXY&&be(Fr,`RPC '${e}' stream ${s} detected no buffering proxy`)}),setTimeout(()=>{x.wo()},0),x}}function P0(){return typeof document<"u"?document:null}/**
3273 * @license
3274 * Copyright 2020 Google LLC
3275 *
3276 * Licensed under the Apache License, Version 2.0 (the "License");
3277 * you may not use this file except in compliance with the License.
3278 * You may obtain a copy of the License at
3279 *
3280 *   http://www.apache.org/licenses/LICENSE-2.0
3281 *
3282 * Unless required by applicable law or agreed to in writing, software
3283 * distributed under the License is distributed on an "AS IS" BASIS,
3284 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3285 * See the License for the specific language governing permissions and
3286 * limitations under the License.
3287 */function Ny(t){return new mG(t,!0)}/**
3288 * @license
3289 * Copyright 2017 Google LLC
3290 *
3291 * Licensed under the Apache License, Version 2.0 (the "License");
3292 * you may not use this file except in compliance with the License.
3293 * You may obtain a copy of the License at
3294 *
3295 *   http://www.apache.org/licenses/LICENSE-2.0
3296 *
3297 * Unless required by applicable law or agreed to in writing, software
3298 * distributed under the License is distributed on an "AS IS" BASIS,
3299 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3300 * See the License for the specific language governing permissions and
3301 * limitations under the License.
3302 */class iD{constructor(e,r,n=1e3,s=1.5,i=6e4){this.ui=e,this.timerId=r,this.ko=n,this.qo=s,this.Qo=i,this.Ko=0,this.$o=null,this.Uo=Date.now(),this.reset()}reset(){this.Ko=0}Wo(){this.Ko=this.Qo}Go(e){this.cancel();const r=Math.floor(this.Ko+this.zo()),n=Math.max(0,Date.now()-this.Uo),s=Math.max(0,r-n);s>0&&be("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Ko} ms, delay with jitter: ${r} ms, last attempt: ${n} ms ago)`),this.$o=this.ui.enqueueAfterDelay(this.timerId,s,()=>(this.Uo=Date.now(),e())),this.Ko*=this.qo,this.Ko<this.ko&&(this.Ko=this.ko),this.Ko>this.Qo&&(this.Ko=this.Qo)}jo(){this.$o!==null&&(this.$o.skipDelay(),this.$o=null)}cancel(){this.$o!==null&&(this.$o.cancel(),this.$o=null)}zo(){return(Math.random()-.5)*this.Ko}}/**
3303 * @license
3304 * Copyright 2017 Google LLC
3305 *
3306 * Licensed under the Apache License, Version 2.0 (the "License");
3307 * you may not use this file except in compliance with the License.
3308 * You may obtain a copy of the License at
3309 *
3310 *   http://www.apache.org/licenses/LICENSE-2.0
3311 *
3312 * Unless required by applicable law or agreed to in writing, software
3313 * distributed under the License is distributed on an "AS IS" BASIS,
3314 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3315 * See the License for the specific language governing permissions and
3316 * limitations under the License.
3317 */class oD{constructor(e,r,n,s,i,o,l,c){this.ui=e,this.Ho=n,this.Jo=s,this.connection=i,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=l,this.listener=c,this.state=0,this.Yo=0,this.Zo=null,this.Xo=null,this.stream=null,this.e_=0,this.t_=new iD(e,r)}n_(){return this.state===1||this.state===5||this.r_()}r_(){return this.state===2||this.state===3}start(){this.e_=0,this.state!==4?this.auth():this.i_()}async stop(){this.n_()&&await this.close(0)}s_(){this.state=0,this.t_.reset()}o_(){this.r_()&&this.Zo===null&&(this.Zo=this.ui.enqueueAfterDelay(this.Ho,6e4,()=>this.__()))}a_(e){this.u_(),this.stream.send(e)}async __(){if(this.r_())return this.close(0)}u_(){this.Zo&&(this.Zo.cancel(),this.Zo=null)}
3317c_(){this.Xo&&(this.Xo.cancel(),this.Xo=null)}async close(e,r){this.u_(),this.c_(),this.t_.cancel(),this.Yo++,e!==4?this.t_.reset():r&&r.code===te.RESOURCE_EXHAUSTED?(Es(r.toString()),Es("Using maximum backoff delay to prevent overloading the backend."),this.t_.Wo()):r&&r.code===te.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this.l_(),this.stream.close(),this.stream=null),this.state=e,await this.listener.mo(r)}l_(){}auth(){this.state=1;const e=this.h_(this.Yo),r=this.Yo;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then(([n,s])=>{this.Yo===r&&this.P_(n,s)},n=>{e(()=>{const s=new fe(te.UNKNOWN,"Fetching auth token failed: "+n.message);return this.I_(s)})})}P_(e,r){const n=this.h_(this.Yo);this.stream=this.T_(e,r),this.stream.Eo(()=>{n(()=>this.listener.Eo())}),this.stream.Ro(()=>{n(()=>(this.state=2,this.Xo=this.ui.enqueueAfterDelay(this.Jo,1e4,()=>(this.r_()&&(this.state=3),Promise.resolve())),this.listener.Ro()))}),this.stream.mo(s=>{n(()=>this.I_(s))}),this.stream.onMessage(s=>{n(()=>++this.e_==1?this.E_(s):this.onNext(s))})}i_(){this.state=5,this.t_.Go(async()=>{this.state=0,this.start()})}I_(e){return be("PersistentStream",`close with error: ${e}`),this.stream=null,this.close(4,e)}h_(e){return r=>{this.ui.enqueueAndForget(()=>this.Yo===e?r():(be("PersistentStream","stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve()))}}}class aK extends oD{constructor(e,r,n,s,i,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",r,n,s,o),this.serializer=i}T_(e,r){return this.connection.Bo("Listen",e,r)}E_(e){return this.onNext(e)}onNext(e){this.t_.reset();const r=gG(this.serializer,e),n=function(i){if(!("targetChange"in i))return Oe.min();const o=i.targetChange;return o.targetIds&&o.targetIds.length?Oe.min():o.readTime?Ba(o.readTime):Oe.min()}(e);return this.listener.d_(r,n)}A_(e){const r={};r.database=zw(this.serializer),r.addTarget=function(i,o){let l;const c=o.target;if(l=Lw(c)?{documents:vG(i,c)}:{query:bG(i,c)._t},l.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){l.resumeToken=Q5(i,o.resumeToken);const u=Bw(i,o.expectedCount);u!==null&&(l.expectedCount=u)}else if(o.snapshotVersion.compareTo(Oe.min())>0){l.readTime=Eg(i,o.snapshotVersion.toTimestamp());const u=Bw(i,o.expectedCount);u!==null&&(l.expectedCount=u)}return l}(this.serializer,e);const n=jG(this.serializer,e);n&&(r.labels=n),this.a_(r)}R_(e){const r={};r.database=zw(this.serializer),r.removeTarget=e,this.a_(r)}}class sK extends oD{constructor(e,r,n,s,i,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",r,n,s,o),this.serializer=i}get V_(){return this.e_>0}start(){this.lastStreamToken=void 0,super.start()}l_(){this.V_&&this.m_([])}T_(e,r){return this.connection.Bo("Write",e,r)}E_(e){return ut(!!e.streamToken),this.lastStreamToken=e.streamToken,ut(!e.writeResults||e.writeResults.length===0),this.listener.f_()}onNext(e){ut(!!e.streamToken),this.lastStreamToken=e.streamToken,this.t_.reset();const r=yG(e.writeResults,e.commitTime),n=Ba(e.commitTime);return this.listener.g_(n,r)}p_(){const e={};e.database=zw(this.serializer),this.a_(e)}m_(e){const r={streamToken:this.lastStreamToken,writes:e.map(n=>xG(this.serializer,n))};this.a_(r)}}/**
3318 * @license
3319 * Copyright 2017 Google LLC
3320 *
3321 * Licensed under the Apache License, Version 2.0 (the "License");
3322 * you may not use this file except in compliance with the License.
3323 * You may obtain a copy of the License at
3324 *
3325 *   http://www.apache.org/licenses/LICENSE-2.0
3326 *
3327 * Unless required by applicable law or agreed to in writing, software
3328 * distributed under the License is distributed on an "AS IS" BASIS,
3329 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3330 * See the License for the specific language governing permissions and
3331 * limitations under the License.
3332 */class iK extends class{}{constructor(e,r,n,s){super(),this.authCredentials=e,this.appCheckCredentials=r,this.connection=n,this.serializer
3332=s,this.y_=!1}w_(){if(this.y_)throw new fe(te.FAILED_PRECONDITION,"The client has already been terminated.")}Mo(e,r,n,s){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([i,o])=>this.connection.Mo(e,Vw(r,n),s,i,o)).catch(i=>{throw i.name==="FirebaseError"?(i.code===te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),i):new fe(te.UNKNOWN,i.toString())})}Lo(e,r,n,s,i){return this.w_(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then(([o,l])=>this.connection.Lo(e,Vw(r,n),s,o,l,i)).catch(o=>{throw o.name==="FirebaseError"?(o.code===te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new fe(te.UNKNOWN,o.toString())})}terminate(){this.y_=!0,this.connection.terminate()}}class oK{constructor(e,r){this.asyncQueue=e,this.onlineStateHandler=r,this.state="Unknown",this.S_=0,this.b_=null,this.D_=!0}v_(){this.S_===0&&(this.C_("Unknown"),this.b_=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,()=>(this.b_=null,this.F_("Backend didn't respond within 10 seconds."),this.C_("Offline"),Promise.resolve())))}M_(e){this.state==="Online"?this.C_("Unknown"):(this.S_++,this.S_>=1&&(this.x_(),this.F_(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.C_("Offline")))}set(e){this.x_(),this.S_=0,e==="Online"&&(this.D_=!1),this.C_(e)}C_(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}F_(e){const r=`Could not reach Cloud Firestore backend. ${e}
3333This 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.D_?(Es(r),this.D_=!1):be("OnlineStateTracker",r)}x_(){this.b_!==null&&(this.b_.cancel(),this.b_=null)}}/**
3334 * @license
3335 * Copyright 2017 Google LLC
3336 *
3337 * Licensed under the Apache License, Version 2.0 (the "License");
3338 * you may not use this file except in compliance with the License.
3339 * You may obtain a copy of the License at
3340 *
3341 *   http://www.apache.org/licenses/LICENSE-2.0
3342 *
3343 * Unless required by applicable law or agreed to in writing, software
3344 * distributed under the License is distributed on an "AS IS" BASIS,
3345 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3346 * See the License for the specific language governing permissions and
3347 * limitations under the License.
3348 */class lK{constructor(e,r,n,s,i){this.localStore=e,this.datastore=r,this.asyncQueue=n,this.remoteSyncer={},this.O_=[],this.N_=new Map,this.L_=new Set,this.B_=[],this.k_=i,this.k_._o(o=>{n.enqueueAndForget(async()=>{vl(this)&&(be("RemoteStore","Restarting streams for network reachability change."),await async function(c){const u=Re(c);u.L_.add(4),await Vm(u),u.q_.set("Unknown"),u.L_.delete(4),await _y(u)}(this))})}),this.q_=new oK(n,s)}}async function _y(t){if(vl(t))for(const e of t.B_)await e(!0)}async function Vm(t){for(const e of t.B_)await e(!1)}function lD(t,e){const r=Re(t);r.N_.has(e.targetId)||(r.N_.set(e.targetId,e),s2(r)?a2(r):Eu(r).r_()&&n2(r,e))}function r2(t,e){const r=Re(t),n=Eu(r);r.N_.delete(e),n.r_()&&cD(r,e),r.N_.size===0&&(n.r_()?n.o_():vl(r)&&r.q_.set("Unknown"))}function n2(t,e){if(t.Q_.xe(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(Oe.min())>0){const r=t.remoteSyncer.getRemoteKeysForTarget(e.targetId).size;e=e.withExpectedCount(r)}Eu(t).A_(e)}function cD(t,e){t.Q_.xe(e),Eu(t).R_(e)}function a2(t){t.Q_=new cG({getRemoteKeysForTarget:e=>t.remoteSyncer.getRemoteKeysForTarget(e),ot:e=>t.N_.get(e)||null,tt:()=>t.datastore.serializer.databaseId}),Eu(t).start(),t.q_.v_()}function s2(t){return vl(t)&&!Eu(t).n_()&&t.N_.size>0}function vl(t){return Re(t).L_.size===0}function uD(t){t.Q_=void 0}async function cK(t){t.q_.set("Online")}async function uK(t){t.N_.forEach((e,r)=>{n2(t,e)})}async function dK(t,e){uD(t),s2(t)?(t.q_.M_(e),a2(t)):t.q_.set("Unknown")}async function hK(t,e,r){if(t.q_.set("Online"),e instanceof Y5&&e.state===2&&e.cause)try{await async function(s,i){const o=i.cause;for(const l of i.targetIds)s.N_.has(l)&&(await s.remoteSyncer.rejectListen(l,o),s.N_.delete(l),s.Q_.removeTarget(l))}(t,e)}catch(n){be("RemoteStore","Failed to remove targets %s: %s ",e.targetIds.join(","),n),await kg(t,n)}else if(e instanceof Mp?t.Q_.Ke(e):e instanceof X5?t.Q_.He(e):t.Q_.We(e),!r.isEqual(Oe.min()))try{const n=await sD(t.localStore);r.compareTo(n)>=0&&await function(i,o){const l=i.Q_.rt(o);
3348return l.targetChanges.forEach((c,u)=>{if(c.resumeToken.approximateByteSize()>0){const d=i.N_.get(u);d&&i.N_.set(u,d.withResumeToken(c.resumeToken,o))}}),l.targetMismatches.forEach((c,u)=>{const d=i.N_.get(c);if(!d)return;i.N_.set(c,d.withResumeToken(Ir.EMPTY_BYTE_STRING,d.snapshotVersion)),cD(i,c);const h=new hi(d.target,c,u,d.sequenceNumber);n2(i,h)}),i.remoteSyncer.applyRemoteEvent(l)}(t,r)}catch(n){be("RemoteStore","Failed to raise snapshot:",n),await kg(t,n)}}async function kg(t,e,r){if(!Lm(e))throw e;t.L_.add(1),await Vm(t),t.q_.set("Offline"),r||(r=()=>sD(t.localStore)),t.asyncQueue.enqueueRetryable(async()=>{be("RemoteStore","Retrying IndexedDB access"),await r(),t.L_.delete(1),await _y(t)})}function dD(t,e){return e().catch(r=>kg(t,r,e))}async function Sy(t){const e=Re(t),r=$i(e);let n=e.O_.length>0?e.O_[e.O_.length-1].batchId:-1;for(;mK(e);)try{const s=await YG(e.localStore,n);if(s===null){e.O_.length===0&&r.o_();break}n=s.batchId,fK(e,s)}catch(s){await kg(e,s)}hD(e)&&mD(e)}function mK(t){return vl(t)&&t.O_.length<10}function fK(t,e){t.O_.push(e);const r=$i(t);r.r_()&&r.V_&&r.m_(e.mutations)}function hD(t){return vl(t)&&!$i(t).n_()&&t.O_.length>0}function mD(t){$i(t).start()}async function pK(t){$i(t).p_()}async function gK(t){const e=$i(t);for(const r of t.O_)e.m_(r.mutations)}async function xK(t,e,r){const n=t.O_.shift(),s=YN.from(n,e,r);await dD(t,()=>t.remoteSyncer.applySuccessfulWrite(s)),await Sy(t)}async function yK(t,e){e&&$i(t).V_&&await async function(n,s){if(function(o){return iG(o)&&o!==te.ABORTED}(s.code)){const i=n.O_.shift();$i(n).s_(),await dD(n,()=>n.remoteSyncer.rejectFailedWrite(i.batchId,s)),await Sy(n)}}(t,e),hD(t)&&mD(t)}async function EE(t,e){const r=Re(t);r.asyncQueue.verifyOperationInProgress(),be("RemoteStore","RemoteStore received new credentials");const n=vl(r);r.L_.add(3),await Vm(r),n&&r.q_.set("Unknown"),await r.remoteSyncer.handleCredentialChange(e),r.L_.delete(3),await _y(r)}async function vK(t,e){const r=Re(t);e?(r.L_.delete(2),await _y(r)):e||(r.L_.add(2),await Vm(r),r.q_.set("Unknown"))}function Eu(t){return t.K_||(t.K_=function(r,n,s){const i=Re(r);return i.w_(),new aK(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)}(t.datastore,t.asyncQueue,{Eo:cK.bind(null,t),Ro:uK.bind(null,t),mo:dK.bind(null,t),d_:hK.bind(null,t)}),t.B_.push(async e=>{e?(t.K_.s_(),s2(t)?a2(t):t.q_.set("Unknown")):(await t.K_.stop(),uD(t))})),t.K_}function $i(t){return t.U_||(t.U_=function(r,n,s){const i=Re(r);return i.w_(),new sK(n,i.connection,i.authCredentials,i.appCheckCredentials,i.serializer,s)}(t.datastore,t.asyncQueue,{Eo:()=>Promise.resolve(),Ro:pK.bind(null,t),mo:yK.bind(null,t),f_:gK.bind(null,t),g_:xK.bind(null,t)}),t.B_.push(async e=>{e?(t.U_.s_(),await Sy(t)):(await t.U_.stop(),t.O_.length>0&&(be("RemoteStore",`Stopping write stream with ${t.O_.length} pending writes`),t.O_=[]))})),t.U_}/**
3349 * @license
3350 * Copyright 2017 Google LLC
3351 *
3352 * Licensed under the Apache License, Version 2.0 (the "License");
3353 * you may not use this file except in compliance with the License.
3354 * You may obtain a copy of the License at
3355 *
3356 *   http://www.apache.org/licenses/LICENSE-2.0
3357 *
3358 * Unless required by applicable law or agreed to in writing, software
3359 * distributed under the License is distributed on an "AS IS" BASIS,
3360 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3361 * See the License for the specific language governing permissions and
3362 * limitations under the License.
3363 */class i2{constructor(e,r,n,s,i){this.asyncQueue=e,this.timerId=r,this.targetTimeMs=n,this.op=s,this.removalCallback=i,this.deferred=new vs,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch(o=>{})}get promise(){return this.deferred.promise}static createAndSchedule(e,r,n,s,i){const o=Date.now()+n,l=new i2(e,r,o,s,i);return l.start(n),l}start(e){this.timerHandle=setTimeout(()=>this.handleDelayElapsed(),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new fe(te.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 o2(t,e){if(Es("AsyncQueue",`${e}: ${t}`),Lm(t))return new fe(te.UNAVAILABLE,`${e}: ${t}`);throw t}/**
3364 * @license
3365 * Copyright 2017 Google LLC
3366 *
3367 * Licensed under the Apache License, Version 2.0 (the "License");
3368 * you may not use this file except in compliance with the License.
3369 * You may obtain a copy of the License at
3370 *
3371 *   http://www.apache.org/licenses/LICENSE-2.0
3372 *
3373 * Unless required by applicable law or agreed to in writing, software
3374 * distributed under the License is distributed on an "AS IS" BASIS,
3375 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3376 * See the License for the specific language governing permissions and
3377 * limitations under the License.
3378 */class vc{constructor(e){this.comparator=e?(r,n)=>e(r,n)||_e.comparator(r.key,n.key):(r,n)=>_e.comparator(r.key,n.key),this.keyedMap=$d(),this.sortedSet=new Lt(this.comparator)}static emptySet(e){return new vc(e.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 r=this.keyedMap.get(e);return r?this.sortedSet.indexOf(r):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal((r,n)=>(e(r),!1))}add(e){const r=this.delete(e.key);return r.copy(r.keyedMap.insert(e.key,e),r.sortedSet.insert(e,null))}delete(e){const r=this.get(e);return r?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(r)):this}isEqual(e){if(!(e instanceof vc)||this.size!==e.size)return!1;const r=this.sortedSet.getIterator(),n=e.sortedSet.getIterator();for(;r.hasNext();){const s=r.getNext().key,i=n.getNext().key;if(!s.isEqual(i))return!1}return!0}toString(){const e=[];return this.forEach(r=>{e.push(r.toString())}),e.length===0?"DocumentSet ()":`DocumentSet (
3379  `+e.join(`  
3380`)+`
3381)`}copy(e,r){const n=new vc;return n.comparator=this.comparator,n.keyedMap=e,n.sortedSet=r,n}}/**
3382 * @license
3383 * Copyright 2017 Google LLC
3384 *
3385 * Licensed under the Apache License, Version 2.0 (the "License");
3386 * you may not use this file except in compliance with the License.
3387 * You may obtain a copy of the License at
3388 *
3389 *   http://www.apache.org/licenses/LICENSE-2.0
3390 *
3391 * Unless required by applicable law or agreed to in writing, software
3392 * distributed under the License is distributed on an "AS IS" BASIS,
3393 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3394 * See the License for the specific language governing permissions and
3395 * limitations under the License.
3396 */class kE{constructor(){this.W_=new Lt(_e.comparator)}track(e){const r=e.doc.key,n=this.W_.get(r);n?e.type!==0&&n.type===3?this.W_=this.W_.insert(r,e):e.type===3&&n.type!==1?this.W_=this.W_.insert(r,{type:n.type,doc:e.doc}):e.type===2&&n.type===2?this.W_=this.W_.insert(r,{type:2,doc:e.doc}):e.type===2&&n.type===0?this.W_=this.W_.insert(r,{type:0,doc:e.doc}):e.type===1&&n.type===0?this.W_=this.W_.remove(r):e.type===1&&n.type===2?this.W_=this.W_.insert(r,{type:1,doc:n.doc}):e.type===0&&n.type===1?this.W_=this.W_.insert(r,{type:2,doc:e.doc}):Ce():this.W_=this.W_.insert(r,e)}G_(){const e=[];return this.W_.inorderTraversal((r,n)=>{e.push(n)}),e}}class Fc{constructor(e,r,n,s,i,o,l,c,u){this.query=e,this.docs=r,this.oldDocs=n,this.docChanges=s,this.mutatedKeys=i,this.fromCache=o,this.syncStateChanged=l,this.excludesMetadataChanges=c,this.hasCachedResults=u}static fromInitialDocuments(e,r,n,s,i){const o=[];return r.forEach(l=>{o.push({type:0,doc:l})}),new Fc(e,r,vc.emptySet(r),o,n,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)&&xy(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const r=this.docChanges,n=e.docChanges;if(r.length!==n.length)return!1;for(let s=0;s<r.length;s++)if(r[s].type!==n[s].type||!r[s].doc.isEqual(n[s].doc))return!1;return!0}}/**
3397 * @license
3398 * Copyright 2017 Google LLC
3399 *
3400 * Licensed under the Apache License, Version 2.0 (the "License");
3401 * you may not use this file except in compliance with the License.
3402 * You may obtain a copy of the License at
3403 *
3404 *   http://www.apache.org/licenses/LICENSE-2.0
3405 *
3406 * Unless required by applicable law or agreed to in writing, softw
3406are
3407 * distributed under the License is distributed on an "AS IS" BASIS,
3408 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3409 * See the License for the specific language governing permissions and
3410 * limitations under the License.
3411 */class bK{constructor(){this.z_=void 0,this.j_=[]}H_(){return this.j_.some(e=>e.J_())}}class wK{constructor(){this.queries=PE(),this.onlineState="Unknown",this.Y_=new Set}terminate(){(function(r,n){const s=Re(r),i=s.queries;s.queries=PE(),i.forEach((o,l)=>{for(const c of l.j_)c.onError(n)})})(this,new fe(te.ABORTED,"Firestore shutting down"))}}function PE(){return new Au(t=>M5(t),xy)}async function l2(t,e){const r=Re(t);let n=3;const s=e.query;let i=r.queries.get(s);i?!i.H_()&&e.J_()&&(n=2):(i=new bK,n=e.J_()?0:1);try{switch(n){case 0:i.z_=await r.onListen(s,!0);break;case 1:i.z_=await r.onListen(s,!1);break;case 2:await r.onFirstRemoteStoreListen(s)}}catch(o){const l=o2(o,`Initialization of query '${Fl(e.query)}' failed`);return void e.onError(l)}r.queries.set(s,i),i.j_.push(e),e.Z_(r.onlineState),i.z_&&e.X_(i.z_)&&u2(r)}async function c2(t,e){const r=Re(t),n=e.query;let s=3;const i=r.queries.get(n);if(i){const o=i.j_.indexOf(e);o>=0&&(i.j_.splice(o,1),i.j_.length===0?s=e.J_()?0:1:!i.H_()&&e.J_()&&(s=2))}switch(s){case 0:return r.queries.delete(n),r.onUnlisten(n,!0);case 1:return r.queries.delete(n),r.onUnlisten(n,!1);case 2:return r.onLastRemoteStoreUnlisten(n);default:return}}function jK(t,e){const r=Re(t);let n=!1;for(const s of e){const i=s.query,o=r.queries.get(i);if(o){for(const l of o.j_)l.X_(s)&&(n=!0);o.z_=s}}n&&u2(r)}function NK(t,e,r){const n=Re(t),s=n.queries.get(e);if(s)for(const i of s.j_)i.onError(r);n.queries.delete(e)}function u2(t){t.Y_.forEach(e=>{e.next()})}var qw,CE;(CE=qw||(qw={})).ea="default",CE.Cache="cache";class d2{constructor(e,r,n){this.query=e,this.ta=r,this.na=!1,this.ra=null,this.onlineState="Unknown",this.options=n||{}}X_(e){if(!this.options.includeMetadataChanges){const n=[];for(const s of e.docChanges)s.type!==3&&n.push(s);e=new Fc(e.query,e.docs,e.oldDocs,n,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let r=!1;return this.na?this.ia(e)&&(this.ta.next(e),r=!0):this.sa(e,this.onlineState)&&(this.oa(e),r=!0),this.ra=e,r}onError(e){this.ta.error(e)}Z_(e){this.onlineState=e;let r=!1;return this.ra&&!this.na&&this.sa(this.ra,e)&&(this.oa(this.ra),r=!0),r}sa(e,r){if(!e.fromCache||!this.J_())return!0;const n=r!=="Offline";return(!this.options._a||!n)&&(!e.docs.isEmpty()||e.hasCachedResults||r==="Offline")}ia(e){if(e.docChanges.length>0)return!0;const r=this.ra&&this.ra.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!r)&&this.options.includeMetadataChanges===!0}oa(e){e=Fc.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.na=!0,this.ta.next(e)}J_(){return this.options.source!==qw.Cache}}/**
3412 * @license
3413 * Copyright 2017 Google LLC
3414 *
3415 * Licensed under the Apache License, Version 2.0 (the "License");
3416 * you may not use this file except in compliance with the License.
3417 * You may obtain a copy of the License at
3418 *
3419 *   http://www.apache.org/licenses/LICENSE-2.0
3420 *
3421 * Unless required by applicable law or agreed to in writing, software
3422 * distributed under the License is distributed on an "AS IS" BASIS,
3423 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3424 * See the License for the specific language governing permissions and
3425 * limitations under the License.
3426 */class fD{constructor(e){this.key=e}}class pD{constructor(e){this.key=e}}class _K{constructor(e,r){this.query=e,this.Ta=r,this.Ea=null,this.hasCachedResults=!1,this.current=!1,this.da=He(),this.mutatedKeys=He(),this.Aa=$5(e),this.Ra=new vc(this.Aa)}get Va(){return this.Ta}ma(e,r){const n=r?r.fa:new kE,s=r?r.Ra:this.Ra;let i=r?r.mutatedKeys:this.mutatedKeys,o=s,l=!1;const c=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 m=s.get(d),p=yy(this.query,h)?h:null,x=!!m&&this.mutatedKeys.has(m.ke
3426y),w=!!p&&(p.hasLocalMutations||this.mutatedKeys.has(p.key)&&p.hasCommittedMutations);let g=!1;m&&p?m.data.isEqual(p.data)?x!==w&&(n.track({type:3,doc:p}),g=!0):this.ga(m,p)||(n.track({type:2,doc:p}),g=!0,(c&&this.Aa(p,c)>0||u&&this.Aa(p,u)<0)&&(l=!0)):!m&&p?(n.track({type:0,doc:p}),g=!0):m&&!p&&(n.track({type:1,doc:m}),g=!0,(c||u)&&(l=!0)),g&&(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),n.track({type:1,doc:d})}return{Ra:o,fa:n,ns:l,mutatedKeys:i}}ga(e,r){return e.hasLocalMutations&&r.hasCommittedMutations&&!r.hasLocalMutations}applyChanges(e,r,n,s){const i=this.Ra;this.Ra=e.Ra,this.mutatedKeys=e.mutatedKeys;const o=e.fa.G_();o.sort((d,h)=>function(p,x){const w=g=>{switch(g){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return Ce()}};return w(p)-w(x)}(d.type,h.type)||this.Aa(d.doc,h.doc)),this.pa(n),s=s!=null&&s;const l=r&&!s?this.ya():[],c=this.da.size===0&&this.current&&!s?1:0,u=c!==this.Ea;return this.Ea=c,o.length!==0||u?{snapshot:new Fc(this.query,e.Ra,i,o,e.mutatedKeys,c===0,u,!1,!!n&&n.resumeToken.approximateByteSize()>0),wa:l}:{wa:l}}Z_(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Ra:this.Ra,fa:new kE,mutatedKeys:this.mutatedKeys,ns:!1},!1)):{wa:[]}}Sa(e){return!this.Ta.has(e)&&!!this.Ra.has(e)&&!this.Ra.get(e).hasLocalMutations}pa(e){e&&(e.addedDocuments.forEach(r=>this.Ta=this.Ta.add(r)),e.modifiedDocuments.forEach(r=>{}),e.removedDocuments.forEach(r=>this.Ta=this.Ta.delete(r)),this.current=e.current)}ya(){if(!this.current)return[];const e=this.da;this.da=He(),this.Ra.forEach(n=>{this.Sa(n.key)&&(this.da=this.da.add(n.key))});const r=[];return e.forEach(n=>{this.da.has(n)||r.push(new pD(n))}),this.da.forEach(n=>{e.has(n)||r.push(new fD(n))}),r}ba(e){this.Ta=e.Ts,this.da=He();const r=this.ma(e.documents);return this.applyChanges(r,!0)}Da(){return Fc.fromInitialDocuments(this.query,this.Ra,this.mutatedKeys,this.Ea===0,this.hasCachedResults)}}class SK{constructor(e,r,n){this.query=e,this.targetId=r,this.view=n}}class TK{constructor(e){this.key=e,this.va=!1}}class AK{constructor(e,r,n,s,i,o){this.localStore=e,this.remoteStore=r,this.eventManager=n,this.sharedClientState=s,this.currentUser=i,this.maxConcurrentLimboResolutions=o,this.Ca={},this.Fa=new Au(l=>M5(l),xy),this.Ma=new Map,this.xa=new Set,this.Oa=new Lt(_e.comparator),this.Na=new Map,this.La=new ZN,this.Ba={},this.ka=new Map,this.qa=Lc.kn(),this.onlineState="Unknown",this.Qa=void 0}get isPrimaryClient(){return this.Qa===!0}}async function EK(t,e,r=!0){const n=wD(t);let s;const i=n.Fa.get(e);return i?(n.sharedClientState.addLocalQueryTarget(i.targetId),s=i.view.Da()):s=await gD(n,e,r,!0),s}async function kK(t,e){const r=wD(t);await gD(r,e,!0,!1)}async function gD(t,e,r,n){const s=await QG(t.localStore,Fa(e)),i=s.targetId,o=t.sharedClientState.addLocalQueryTarget(i,r);let l;return n&&(l=await PK(t,e,i,o==="current",s.resumeToken)),t.isPrimaryClient&&r&&lD(t.remoteStore,s),l}async function PK(t,e,r,n,s){t.Ka=(h,m,p)=>async function(w,g,v,b){let y=g.view.ma(v);y.ns&&(y=await SE(w.localStore,g.query,!1).then(({documents:_})=>g.view.ma(_,y)));const T=b&&b.targetChanges.get(g.targetId),N=b&&b.targetMismatches.get(g.targetId)!=null,j=g.view.applyChanges(y,w.isPrimaryClient,T,N);return OE(w,g.targetId,j.wa),j.snapshot}(t,h,m,p);const i=await SE(t.localStore,e,!0),o=new _K(e,i.Ts),l=o.ma(i.documents),c=Bm.createSynthesizedTargetChangeForCurrentChange(r,n&&t.onlineState!=="Offline",s),u=o.applyChanges(l,t.isPrimaryClient,c);OE(t,r,u.wa);const d=new SK(e,r,o);return t.Fa.set(e,d),t.Ma.has(r)?t.Ma.get(r).push(e):t.Ma.set(r,[e]),u.snapshot}async function CK(t,e,r){const n=Re(t),s=n.Fa.get(e),i=n.Ma.get(s.targetId);if(i.length>1)return n.Ma.set(s.targetId,i.filter(o=>!xy(o,e))),void n.Fa.delete(e);n.isPrimaryClient?(n.sharedClientState.removeLocalQueryTarget(s.targetId),n.sharedClientState.isActiveQueryTarget(s.targetId)||await Hw(n.localStore,s.targetId,!1).then(()=>
3426{n.sharedClientState.clearQueryState(s.targetId),r&&r2(n.remoteStore,s.targetId),Ww(n,s.targetId)}).catch($m)):(Ww(n,s.targetId),await Hw(n.localStore,s.targetId,!0))}async function IK(t,e){const r=Re(t),n=r.Fa.get(e),s=r.Ma.get(n.targetId);r.isPrimaryClient&&s.length===1&&(r.sharedClientState.removeLocalQueryTarget(n.targetId),r2(r.remoteStore,n.targetId))}async function OK(t,e,r){const n=BK(t);try{const s=await function(o,l){const c=Re(o),u=We.now(),d=l.reduce((p,x)=>p.add(x.key),He());let h,m;return c.persistence.runTransaction("Locally write mutations","readwrite",p=>{let x=ks(),w=He();return c.cs.getEntries(p,d).next(g=>{x=g,x.forEach((v,b)=>{b.isValidDocument()||(w=w.add(v))})}).next(()=>c.localDocuments.getOverlayedDocuments(p,x)).next(g=>{h=g;const v=[];for(const b of l){const y=tG(b,h.get(b.key).overlayedDocument);y!=null&&v.push(new qi(b.key,y,E5(y.value.mapValue),rn.exists(!0)))}return c.mutationQueue.addMutationBatch(p,u,v,l)}).next(g=>{m=g;const v=g.applyToLocalDocumentSet(h,w);return c.documentOverlayCache.saveOverlays(p,g.batchId,v)})}).then(()=>({batchId:m.batchId,changes:F5(h)}))}(n.localStore,e);n.sharedClientState.addPendingMutation(s.batchId),function(o,l,c){let u=o.Ba[o.currentUser.toKey()];u||(u=new Lt(tt)),u=u.insert(l,c),o.Ba[o.currentUser.toKey()]=u}(n,s.batchId,r),await Um(n,s.changes),await Sy(n.remoteStore)}catch(s){const i=o2(s,"Failed to persist write");r.reject(i)}}async function xD(t,e){const r=Re(t);try{const n=await KG(r.localStore,e);
3426e.targetChanges.forEach((s,i)=>{const o=r.Na.get(i);o&&(ut(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1),s.addedDocuments.size>0?o.va=!0:s.modifiedDocuments.size>0?ut(o.va):s.removedDocuments.size>0&&(ut(o.va),o.va=!1))}),await Um(r,n,e)}catch(n){await $m(n)}}function IE(t,e,r){const n=Re(t);if(n.isPrimaryClient&&r===0||!n.isPrimaryClient&&r===1){const s=[];n.Fa.forEach((i,o)=>{const l=o.view.Z_(e);l.snapshot&&s.push(l.snapshot)}),function(o,l){const c=Re(o);c.onlineState=l;let u=!1;c.queries.forEach((d,h)=>{for(const m of h.j_)m.Z_(l)&&(u=!0)}),u&&u2(c)}(n.eventManager,e),s.length&&n.Ca.d_(s),n.onlineState=e,n.isPrimaryClient&&n.sharedClientState.setOnlineState(e)}}async function RK(t,e,r){const n=Re(t);n.sharedClientState.updateQueryState(e,"rejected",r);const s=n.Na.get(e),i=s&&s.key;if(i){let o=new Lt(_e.comparator);o=o.insert(i,zr.newNoDocument(i,Oe.min()));const l=He().add(i),c=new jy(Oe.min(),new Map,new Lt(tt),o,l);await xD(n,c),n.Oa=n.Oa.remove(i),n.Na.delete(e),h2(n)}else await Hw(n.localStore,e,!1).then(()=>Ww(n,e,r)).catch($m)}async function DK(t,e){const r=Re(t),n=e.batch.batchId;try{const s=await GG(r.localStore,e);
3426vD(r,n,null),yD(r,n),r.sharedClientState.updateMutationState(n,"acknowledged"),await Um(r,s)}catch(s){await $m(s)}}async function MK(t,e,r){const n=Re(t);try{const s=await function(o,l){const c=Re(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",u=>{let d;return c.mutationQueue.lookupMutationBatch(u,l).next(h=>(ut(h!==null),d=h.keys(),c.mutationQueue.removeMutationBatch(u,h))).next(()=>c.mutationQueue.performConsistencyCheck(u)).next(()=>c.documentOverlayCache.removeOverlaysForBatchId(u,d,l)).next(()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(u,d)).next(()=>c.localDocuments.getDocuments(u,d))})}(n.localStore,e);vD(n,e,r),yD(n,e),n.sharedClientState.updateMutationState(e,"rejected",r),await Um(n,s)}catch(s){await $m(s)}}function yD(t,e){(t.ka.get(e)||[]).forEach(r=>{r.resolve()}),t.ka.delete(e)}function vD(t,e,r){const n=Re(t);let s=n.Ba[n.currentUser.toKey()];if(s){const i=s.get(e);i&&(r?i.reject(r):i.resolve(),s=s.remove(e)),n.Ba[n.currentUser.toKey()]=s}}function Ww(t,e,r=null){t.sharedCl
3426ientState.removeLocalQueryTarget(e);for(const n of t.Ma.get(e))t.Fa.delete(n),r&&t.Ca.$a(n,r);t.Ma.delete(e),t.isPrimaryClient&&t.La.gr(e).forEach(n=>{t.La.containsKey(n)||bD(t,n)})}function bD(t,e){t.xa.delete(e.path.canonicalString());const r=t.Oa.get(e);r!==null&&(r2(t.remoteStore,r),t.Oa=t.Oa.remove(e),t.Na.delete(r),h2(t))}function OE(t,e,r){for(const n of r)n instanceof fD?(t.La.addReference(n.key,e),$K(t,n)):n instanceof pD?(be("SyncEngine","Document no longer in limbo: "+n.key),t.La.removeReference(n.key,e),t.La.containsKey(n.key)||bD(t,n.key)):Ce()}function $K(t,e){const r=e.key,n=r.path.canonicalString();t.Oa.get(r)||t.xa.has(n)||(be("SyncEngine","New document in limbo: "+r),t.xa.add(n),h2(t))}function h2(t){for(;t.xa.size>0&&t.Oa.size<t.maxConcurrentLimboResolutions;){const e=t.xa.values().next().value;t.xa.delete(e);const r=new _e(At.fromString(e)),n=t.qa.next();t.Na.set(n,new TK(r)),t.Oa=t.Oa.insert(r,n),lD(t.remoteStore,new hi(Fa(gy(r.path)),n,"TargetPurposeLimboResolution",UN.oe))}}async function Um(t,e,r){const n=Re(t),s=[],i=[],o=[];n.Fa.isEmpty()||(n.Fa.forEach((l,c)=>{o.push(n.Ka(c,e,r).then(u=>{var d;if((u||r)&&n.isPrimaryClient){const h=u?!u.fromCache:(d=r==null?void 0:r.targetChanges.get(c.targetId))===null||d===void 0?void 0:d.current;n.sharedClientState.updateQueryState(c.targetId,h?"current":"not-current")}if(u){s.push(u);const h=t2.Wi(c.targetId,u);i.push(h)}}))}),await Promise.all(o),n.Ca.d_(s),await async function(c,u){const d=Re(c);try{await d.persistence.runTransaction("notifyLocalViewChanges","readwrite",h=>se.forEach(u,m=>se.forEach(m.$i,p=>d.persistence.referenceDelegate.addReference(h,m.targetId,p)).next(()=>se.forEach(m.Ui,p=>d.persistence.referenceDelegate.removeReference(h,m.targetId,p)))))}catch(h){if(!Lm(h))throw h;be("LocalStore","Failed to update sequence numbers: "+h)}for(const h of u){const m=h.targetId;if(!h.fromCache){const p=d.os.get(m),x=p.snapshotVersion,w=p.withLastLimboFreeSnapshotVersion(x);d.os=d.os.insert(m,w)}}}(n.localStore,i))}async function LK(t,e){const r=Re(t);if(!r.currentUser.isEqual(e)){be("SyncEngine","User change. New user:",e.toKey());const n=await aD(r.localStore,e);r.currentUser=e,function(i,o){i.ka.forEach(l=>{l.forEach(c=>{c.reject(new fe(te.CANCELLED,o))})}),i.ka.clear()}(r,"'waitForPendingWrites' promise is rejected due to a user change."),r.sharedClientState.handleUserChange(e,n.removedBatchIds,n.addedBatchIds),await Um(r,n.hs)}}function FK(t,e){const r=Re(t),n=r.Na.get(e);if(n&&n.va)return He().add(n.key);{let s=He();const i=r.Ma.get(e);if(!i)return s;for(const o of i){const l=r.Fa.get(o);s=s.unionWith(l.view.Va)}return s}}function wD(t){const e=Re(t);return e.remoteStore.remoteSyncer.applyRemoteEvent=xD.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=FK.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=RK.bind(null,e),e.Ca.d_=jK.bind(null,e.eventManager),e.Ca.$a=NK.bind(null,e.eventManager),e}function BK(t){const e=Re(t);return e.remoteStore.remoteSyncer.applySuccessfulWrite=DK.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=MK.bind(null,e),e}class Pg{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=Ny(e.databaseInfo.databaseId),this.sharedClientState=this.Wa(e),this.persistence=this.Ga(e),await this.persistence.start(),this.localStore=this.za(e),this.gcScheduler=this.ja(e,this.localStore),this.indexBackfillerScheduler=this.Ha(e,this.localStore)}ja(e,r){return null}Ha(e,r){return null}za(e){return WG(this.persistence,new HG,e.initialUser,this.serializer)}Ga(e){return new VG(e2.Zr,this.serializer)}Wa(e){return new ZG}async terminate(){var e,r;(e=this.gcScheduler)===null||e===void 0||e.stop(),(r=this.indexBackfillerScheduler)===null||r===void 0||r.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}Pg.provider={build:()=>new Pg};class Gw{async initialize(e,r){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(r),this.remoteStore=this.createRemoteStore(r),this.eventManager=this.createEventManager(r),this.syncEngine=this.createSyncEngine(r,!e.synchronizeTabs),this.sharedCl
3426ientState.onlineStateHandler=n=>IE(this.syncEngine,n,1),this.remoteStore.remoteSyncer.handleCredentialChange=LK.bind(null,this.syncEngine),await vK(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return function(){return new wK}()}createDatastore(e){const r=Ny(e.databaseInfo.databaseId),n=function(i){return new nK(i)}(e.databaseInfo);return function(i,o,l,c){return new iK(i,o,l,c)}(e.authCredentials,e.appCheckCredentials,n,r)}createRemoteStore(e){return function(n,s,i,o,l){return new lK(n,s,i,o,l)}(this.localStore,this.datastore,e.asyncQueue,r=>IE(this.syncEngine,r,0),function(){return AE.D()?new AE:new eK}())}createSyncEngine(e,r){return function(s,i,o,l,c,u,d){const h=new AK(s,i,o,l,c,u);return d&&(h.Qa=!0),h}(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,r)}async terminate(){var e,r;await async function(s){const i=Re(s);be("RemoteStore","RemoteStore shutting down."),i.L_.add(5),await Vm(i),i.k_.shutdown(),i.q_.set("Unknown")}(this.remoteStore),(e=this.datastore)===null||e===void 0||e.terminate(),(r=this.eventManager)===null||r===void 0||r.terminate()}}Gw.provider={build:()=>new Gw};/**
3427 * @license
3428 * Copyright 2020 Google LLC
3429 *
3430 * Licensed under the Apache License, Version 2.0 (the "License");
3431 * you may not use this file except in compliance with the License.
3432 * You may obtain a copy of the License at
3433 *
3434 *   http://www.apache.org/licenses/LICENSE-2.0
3435 *
3436 * Unless required by applicable law or agreed to in writing, software
3437 * distributed under the License is distributed on an "AS IS" BASIS,
3438 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3439 * See the License for the specific language governing permissions and
3440 * limitations under the License.
3441 *//**
3442 * @license
3443 * Copyright 2017 Google LLC
3444 *
3445 * Licensed under the Apache License, Version 2.0 (the "License");
3446 * you may not use this file except in compliance with the License.
3447 * You may obtain a copy of the License at
3448 *
3449 *   http://www.apache.org/licenses/LICENSE-2.0
3450 *
3451 * Unless required by applicable law or agreed to in writing, software
3452 * distributed under the License is distributed on an "AS IS" BASIS,
3453 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3454 * See the License for the specific language governing permissions and
3455 * limitations under the License.
3456 */class m2{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Ya(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Ya(this.observer.error,e):Es("Uncaught Error in snapshot listener:",e.toString()))}Za(){this.muted=!0}Ya(e,r){setTimeout(()=>{this.muted||e(r)},0)}}/**
3457 * @license
3458 * Copyright 2017 Google LLC
3459 *
3460 * Licensed under the Apache License, Version 2.0 (the "License");
3461 * you may not use this file except in compliance with the License.
3462 * You may obtain a copy of the License at
3463 *
3464 *   http://www.apache.org/licenses/LICENSE-2.0
3465 *
3466 * Unless required by applicable law or agreed to in writing, software
3467 * distributed under the License is distributed on an "AS IS" BASIS,
3468 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3469 * See the License for the specific language governing permissions and
3470 * limitations under the License.
3471 */class VK{constructor(e,r,n,s,i){this.authCredentials=e,this.appCheckCredentials=r,this.asyncQueue=n,this.databaseInfo=s,this.user=Vr.UNAUTHENTICATED,this.clientId=S5.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=i,this.authCredentials.start(n,async o=>{be("FirestoreClient","Received user=",o.uid),await this.authCredentialListener(o),this.user=o}),this.appCheckCredentials.start(n,o=>(be("FirestoreClient","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 vs;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(r){const n=o2(r,"Failed to shutdown persistence");e.reject(n)}}),e.promise}}async function C0(t,e){t.asyncQueue.verifyOperationInProgress(),be("FirestoreClient","Initializing OfflineComponentProvider");const r=t.configuration;await e.initialize(r);let n=r.initialUser;t.setCredentialChangeListener(async s=>{n.isEqual(s)||(await aD(e.localStore,s),n=s)}),e.persistence.setDatabaseDeletedListener(()=>t.terminate()),t._offlineComponents=e}async function RE(t,e){t.asyncQueue.verifyOperationInProgress();const r=await UK(t);be("FirestoreClient","Initializing OnlineComponentProvider"),await e.initialize(r,t.configuration),t.setCredentialChangeListener(n=>EE(e.remoteStore,n)),t.setAppCheckTokenChangeListener((n,s)=>EE(e.remoteStore,s)),t._onlineComponents=e}async function UK(t){if(!t._offlineComponents)if(t._uninitializedComponentsProvider){be("FirestoreClient","Using user provided OfflineComponentProvider");try{await C0(t,t._uninitializedComponentsProvider._offline)}catch(e){const r=e;if(!function(s){return s.name==="FirebaseError"?s.code===te.FAILED_PRECONDITION||s.code===te.UNIMPLEMENT
3471ED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11}(r))throw r;Ic("Error using user provided cache. Falling back to memory cache: "+r),await C0(t,new Pg)}}else be("FirestoreClient","Using default OfflineComponentProvider"),await C0(t,new Pg);return t._offlineComponents}async function jD(t){return t._onlineComponents||(t._uninitializedComponentsProvider?(be("FirestoreClient","Using user provided OnlineComponentProvider"),await RE(t,t._uninitializedComponentsProvider._online)):(be("FirestoreClient","Using default OnlineComponentProvider"),await RE(t,new Gw))),t._onlineComponents}function zK(t){return jD(t).then(e=>e.syncEngine)}async function Cg(t){const e=await jD(t),r=e.eventManager;return r.onListen=EK.bind(null,e.syncEngine),r.onUnlisten=CK.bind(null,e.syncEngine),r.onFirstRemoteStoreListen=kK.bind(null,e.syncEngine),r.onLastRemoteStoreUnlisten=IK.bind(null,e.syncEngine),r}function HK(t,e,r={}){const n=new vs;return t.asyncQueue.enqueueAndForget(async()=>function(i,o,l,c,u){const d=new m2({next:m=>{d.Za(),o.enqueueAndForget(()=>c2(i,h));const p=m.docs.has(l);!p&&m.fromCache?u.reject(new fe(te.UNAVAILABLE,"Failed to get document because the client is offline.")):p&&m.fromCache&&c&&c.source==="server"?u.reject(new fe(te.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):u.resolve(m)},error:m=>u.reject(m)}),h=new d2(gy(l.path),d,{includeMetadataChanges:!0,_a:!0});return l2(i,h)}(await Cg(t),t.asyncQueue,e,r,n)),n.promise}function qK(t,e,r={}){const n=new vs;return t.asyncQueue.enqueueAndForget(async()=>function(i,o,l,c,u){const d=new m2({next:m=>{d.Za(),o.enqueueAndForget(()=>c2(i,h)),m.fromCache&&c.source==="server"?u.reject(new fe(te.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):u.resolve(m)},error:m=>u.reject(m)}),h=new d2(l,d,{includeMetadataChanges:!0,_a:!0});return l2(i,h)}(await Cg(t),t.asyncQueue,e,r,n)),n.promise}/**
3472 * @license
3473 * Copyright 2023 Google LLC
3474 *
3475 * Licensed under the Apache License, Version 2.0 (the "License");
3476 * you may not use this file except in compliance with the License.
3477 * You may obtain a copy of the License at
3478 *
3479 *   http://www.apache.org/licenses/LICENSE-2.0
3480 *
3481 * Unless required by applicable law or agreed to in writing, software
3482 * distributed under the License is distributed on an "AS IS" BASIS,
3483 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3484 * See the License for the specific language governing permissions and
3485 * limitations under the License.
3486 */function ND(t){const e={};return t.timeoutSeconds!==void 0&&(e.timeoutSeconds=t.timeoutSeconds),e}/**
3487 * @license
3488 * Copyright 2020 Google LLC
3489 *
3490 * Licensed under the Apache License, Version 2.0 (the "License");
3491 * you may not use this file except in compliance with the License.
3492 * You may obtain a copy of the License at
3493 *
3494 *   http://www.apache.org/licenses/LICENSE-2.0
3495 *
3496 * Unless required by applicable law or agreed to in writing, software
3497 * distributed under the License is distributed on an "AS IS" BASIS,
3498 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3499 * See the License for the specific language governing permissions and
3500 * limitations under the License.
3501 */const DE=new Map;/**
3502 * @license
3503 * Copyright 2017 Google LLC
3504 *
3505 * Licensed under the Apache License, Version 2.0 (the "License");
3506 * you may not use this file except in compliance with the License.
3507 * You may obtain a copy of the License at
3508 *
3509 *   http://www.apache.org/licenses/LICENSE-2.0
3510 *
3511 * Unless required by applicable law or agreed to in writing, software
3512 * distributed under the License is distributed on an "AS IS" BASIS,
3513 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3514 * See the License for the specific language governing permissions and
3515 * limitations under the License.
3516 */function _D(t,e,r){if(!r)throw new fe(te.INVALID_ARGUMENT,`Function ${t}() cannot be called with an empty ${e}.`)}function WK(t,e,r,n){if(e===!0&&n===!0)throw new fe(te.INVALID_ARGUMENT,`${t} and ${r} cannot be used together.`)}function ME(t){if(!_e.isDocumentKey(t))throw new fe(te.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${t} has ${t.length}.`)}function $E(t){if(_e.isDocumentKey(t))throw new fe(te.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${t} has ${t.length}.`)}function Ty(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(n){return n.constructor?n.constructor.name:null}(t);return e?`a custom ${e} object`:"an object"}}return typeof t=="function"?"a function":Ce()}function nn(t,e){if("_delegate"in t&&(t=t._delegate),!(t instanceof e)){if(e.name===t.constructor.name)throw new fe(te.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const r=Ty(t);throw new fe(te.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${r}`)}}return t}function GK(t,e){if(e<=0)throw new fe(te.INVALID_ARGUMENT,`Function ${t}() requires a positive number, but it was: ${e}.`)}/**
3517 * @license
3518 * Copyright 2020 Google LLC
3519 *
3520 * Licensed under the Apache License, Version 2.0 (the "License");
3521 * you may not use this file except in compliance with the License.
3522 * You may obtain a copy of the License at
3523 *
3524 *   http://www.apache.org/licenses/LICENSE-2.0
3525 *
3526 * Unless required by applicable law or agreed to in writing, software
3527 * distributed under the License is distributed on an "AS IS" BASIS,
3528 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3529 * See the License for the specific language governing permissions and
3530 * limitations under the License.
3531 */class LE{constructor(e){var r,n;if(e.host===void 0){if(e.ssl!==void 0)throw new fe(te.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host="firestore.googleapis.com",this.ssl=!0}else this.host=e.host,this.ssl=(r=e.ssl)===null||r===void 0||r;if(this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e.cacheSizeBytes===void 0)this.cacheSizeBytes=41943040;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<1048576)throw new fe(te.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}WK("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=ND((n=e.experimentalLongPollingOptions)!==null&&n!==void 0?n:{}),function(i){if(i.timeoutSeconds!==void 0){if(isNaN(i.timeoutSeconds))throw new fe(te.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (must not be NaN)`);if(i.timeoutSeconds<5)throw new fe(te.INVALID_ARGUMENT,`invalid long polling timeout: ${i.timeoutSeconds} (minimum allowed value is 5)`);if(i.timeoutSeconds>30)throw new fe(te.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(n,s){return n.timeoutSeconds===s.timeoutSeconds}(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams}}class Ay{constructor(e,r,n,s){this._authCredentials=e,this._appCheckCredentials=r,this._databaseId=n,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new LE({}),this._settingsFrozen=!1,this._terminateTask="notTerminated"}get app(){if(!this._app)throw new fe(te.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 fe(te.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 LE(e),e.credentials!==void 0&&(this._authCredentials=function(n){if(!n)return new uW;switch(n.type){case"firstParty":return new fW(n.sessionIndex||"0",n.iamToken||null,n.authTokenFactory||null);case"provider":return n.client;default:throw new fe(te.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invalid credential type")}}(e.credentials))}_getSettings(){return this._settings}_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(r){const n=DE.get(r);
3531n&&(be("ComponentProvider","Removing Datastore"),DE.delete(r),n.terminate())}(this),Promise.resolve()}}function KK(t,e,r,n={}){var s;const i=(t=nn(t,Ay))._getSettings(),o=`${e}:${r}`;if(i.host!=="firestore.googleapis.com"&&i.host!==o&&Ic("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used."),t._setSettings(Object.assign(Object.assign({},i),{host:o,ssl:!1})),n.mockUserToken){let l,c;if(typeof n.mockUserToken=="string")l=n.mockUserToken,c=Vr.MOCK_USER;else{l=A3(n.mockUserToken,(s=t._app)===null||s===void 0?void 0:s.options.projectId);const u=n.mockUserToken.sub||n.mockUserToken.user_id;if(!u)throw new fe(te.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");c=new Vr(u)}t._authCredentials=new dW(new _5(l,c))}}/**
3532 * @license
3533 * Copyright 2020 Google LLC
3534 *
3535 * Licensed under the Apache License, Version 2.0 (the "License");
3536 * you may not use this file except in compliance with the License.
3537 * You may obtain a copy of the License at
3538 *
3539 *   http://www.apache.org/licenses/LICENSE-2.0
3540 *
3541 * Unless required by applicable law or agreed to in writing, software
3542 * distributed under the License is distributed on an "AS IS" BASIS,
3543 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3544 * See the License for the specific language governing permissions and
3545 * limitations under the License.
3546 */class $s{constructor(e,r,n){this.converter=r,this._query=n,this.type="query",this.firestore=e}withConverter(e){return new $s(this.firestore,e,this._query)}}class Wr{constructor(e,r,n){this.converter=r,this._key=n,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 ki(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Wr(this.firestore,e,this._key)}}class ki extends $s{constructor(e,r,n){super(e,r,gy(n)),this._path=n,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 Wr(this.firestore,null,new _e(e))}withConverter(e){return new ki(this.firestore,e,this._path)}}function Be(t,e,...r){if(t=ot(t),_D("collection","path",e),t instanceof Ay){const n=At.fromString(e,...r);return $E(n),new ki(t,null,n)}{if(!(t instanceof Wr||t instanceof ki))throw new fe(te.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=t._path.child(At.fromString(e,...r));return $E(n),new ki(t.firestore,null,n)}}function Te(t,e,...r){if(t=ot(t),arguments.length===1&&(e=S5.newId()),_D("doc","path",e),t instanceof Ay){const n=At.fromString(e,...r);return ME(n),new Wr(t,null,new _e(n))}{if(!(t instanceof Wr||t instanceof ki))throw new fe(te.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const n=t._path.child(At.fromString(e,...r));return ME(n),new Wr(t.firestore,t instanceof ki?t.converter:null,new _e(n))}}/**
3547 * @license
3548 * Copyright 2020 Google LLC
3549 *
3550 * Licensed under the Apache License, Version 2.0 (the "License");
3551 * you may not use this file except in compliance with the License.
3552 * You may obtain a copy of the License at
3553 *
3554 *   http://www.apache.org/licenses/LICENSE-2.0
3555 *
3556 * Unless required by applicable law or agreed to in writing, software
3557 * distributed under the License is distributed on an "AS IS" BASIS,
3558 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3559 * See the License for the specific language governing permissions and
3560 * limitations under the License.
3561 */class FE{constructor(e=Promise.resolve()){this.Pu=[],this.Iu=!1,this.Tu=[],this.Eu=null,this.du=!1,this.Au=!1,this.Ru=[],this.t_=new iD(this,"async_queue_retry"),this.Vu=()=>{const n=P0();n&&be("AsyncQueue","Visibility state changed to "+n.visibilityState),this.t_.jo()},this.mu=e;const r=P0();r&&typeof r.addEventListener=="function"&&r.addEventListener("visibilitychange",this.Vu)}get isShuttingDown(){return this.Iu}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.fu(),this.gu(e)}enterRestrictedMode(e){if(!this.Iu){this.Iu=!0,this.Au=e||!1;const r=P0();r&&typeof r.removeEventListener=="function"&&r.removeEventListener("visibilitychange",this.Vu)}}enqueue(e){if(this.fu(),this.Iu)return new Promise(()=>{});const r=new vs;return this.gu(()=>this.Iu&&this.Au?Promise.resolve():(e().then(r.resolve,r.reject),r.promise)).then(()=>r.promise)}enqueueRetryable(e){this.enqueueAndForget(()=>(this.Pu.push(e),this.pu()))}async pu(){if(this.Pu.length!==0){try{await this.Pu[0](),this.Pu.shift(),this.t_.reset()}catch(e){if(!Lm(e))throw e;be("AsyncQueue","Operation failed with retryable error: "+e)}this.Pu.length>0&&this.t_.Go(()=>this.pu())}}gu(e){const r=this.mu.then(()=>(this.du=!0,e().catch(n=>{this.Eu=n,this.du=!1;const s=function(o){let l=o.message||"";return o.stack&&(l=o.stack.includes(o.message)?o.stack:o.message+`
3562`+o.stack),l}(n);throw Es("INTERNAL UNHANDLED ERROR: ",s),n}).then(n=>(this.du=!1,n))));return this.mu=r,r}enqueueAfterDelay(e,r,n){this.fu(),this.Ru.indexOf(e)>-1&&(r=0);const s=i2.createAndSchedule(this,e,r,n,i=>this.yu(i));return this.Tu.push(s),s}fu(){this.Eu&&Ce()}verifyOperationInProgress(){}async wu(){let e;do e=this.mu,await e;while(e!==this.mu)}Su(e){for(const r of this.Tu)if(r.timerId===e)return!0;return!1}bu(e){return this.wu().then(()=>{this.Tu.sort((r,n)=>r.targetTimeMs-n.targetTimeMs);for(const r of this.Tu)if(r.skipDelay(),e!=="all"&&r.timerId===e)break;return this.wu()})}Du(e){this.Ru.push(e)}yu(e){const r=this.Tu.indexOf(e);this.Tu.splice(r,1)}}function BE(t){return function(r,n){if(typeof r!="object"||r===null)return!1;const s=r;for(const i of n)if(i in s&&typeof s[i]=="function")return!0;return!1}(t,["next","error","complete"])}class Ka extends Ay{constructor(e,r,n,s){super(e,r,n,s),this.type="firestore",this._queue=new FE,this._persistenceKey=(s==null?void 0:s.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new FE(e),this._firestoreClient=void 0,await e}}}function XK(t,e){const r=typeof t=="object"?t:dy(),n=typeof t=="string"?t:"(default)",s=zi(r,"firestore").getImmediate({identifier:n});if(!s._initialized){const i=_3("firestore");i&&KK(s,...i)}return s}function zm(t){if(t._terminated)throw new fe(te.FAILED_PRECONDITION,"The client has already been terminated.");return t._firestoreClient||YK(t),t._firestoreClient}function YK(t){var e,r,n;const s=t._freezeSettings(),i=function(l,c,u,d){return new AW(l,c,u,d.host,d.ssl,d.experimentalForceLongPolling,d.experimentalAutoDetectLongPolling,ND(d.experimentalLongPollingOptions),d.useFetchStreams)}(t._databaseId,((e=t._app)===null||e===void 0?void 0:e.options.appId)||"",t._persistenceKey,s);t._componentsProvider||!((r=s.localCache)===null||r===void 0)&&r._offlineComponentProvider&&(!((n=s.localCache)===null||n===void 0)&&n._onlineComponentProvider)&&(t._componentsProvider={_offline:s.localCache._offlineComponentProvider,_online:s.localCache._onlineComponentProvider}),t._firestoreClient=new VK(t._authCredentials,t._appCheckCredentials,t._queue,i,t._componentsProvider&&function(l){const c=l==null?void 0:l._online.build();return{_offline:l==null?void 0:l._offline.build(c),_online:c}}(t._componentsProvider))}/**
3563 * @license
3564 * Copyright 2020 Google LLC
3565 *
3566 * Licensed under the Apache License, Version 2.0 (the "License");
3567 * you may not use this file except in compliance with the License.
3568 * You may obtain a copy of the License at
3569 *
3570 *   http://www.apache.org/licenses/LICENSE-2.0
3571 *
3572 * Unless required by applicable law or agreed to in writing, software
3573 * distributed under the License is distributed on an "AS IS" BASIS,
3574 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3575 * See the License for the specific language governing permissions and
3576 * limitations under the License.
3577 */class Bc{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Bc(Ir.fromBase64String(e))}catch(r){throw new fe(te.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+r)}}static fromUint8Array(e){return new Bc(Ir.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)}}/**
3578 * @license
3579 * Copyright 2020 Google LLC
3580 *
3581 * Licensed under the Apache License, Version 2.0 (the "License");
3582 * you may not use this file except in compliance with the License.
3583 * You may obtain a copy of the License at
3584 *
3585 *   http://www.apache.org/licenses/LICENSE-2.0
3586 *
3587 * Unless required by applicable law or agreed to in writing, software
3588 * distributed under the License is distributed on an "AS IS" BASIS,
3589 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3590 * See the License for the specific language governing permissions and
3591 * limitations under the License.
3592 */class Hm{constructor(...e){for(let r=0;r<e.length;++r)if(e[r].length===0)throw new fe(te.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Er(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}/**
3593 * @license
3594 * Copyright 2020 Google LLC
3595 *
3596 * Licensed under the Apache License, Version 2.0 (the "License");
3597 * you may not use this file except in compliance with the License.
3598 * You may obtain a copy of the License at
3599 *
3600 *   http://www.apache.org/licenses/LICENSE-2.0
3601 *
3602 * Unless required by applicable law or agreed to in writing, software
3603 * distributed under the License is distributed on an "AS IS" BASIS,
3604 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3605 * See the License for the specific language governing permissions and
3606 * limitations under the License.
3607 */class ku{constructor(e){this._methodName=e}}/**
3608 * @license
3609 * Copyright 2017 Google LLC
3610 *
3611 * Licensed under the Apache License, Version 2.0 (the "License");
3612 * you may not use this file except in compliance with the License.
3613 * You may obtain a copy of the License at
3614 *
3615 *   http://www.apache.org/licenses/LICENSE-2.0
3616 *
3617 * Unless required by applicable law or agreed to in writing, software
3618 * distributed under the License is distributed on an "AS IS" BASIS,
3619 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3620 * See the License for the specific language governing permissions and
3621 * limitations under the License.
3622 */class f2{constructor(e,r){if(!isFinite(e)||e<-90||e>90)throw new fe(te.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(r)||r<-180||r>180)throw new fe(te.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+r);this._lat=e,this._long=r}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 tt(this._lat,e._lat)||tt(this._long,e._long)}}/**
3623 * @license
3624 * Copyright 2024 Google LLC
3625 *
3626 * Licensed under the Apache License, Version 2.0 (the "License");
3627 * you may not use this file except in compliance with the License.
3628 * You may obtain a copy of the License at
3629 *
3630 *   http://www.apache.org/licenses/LICENSE-2.0
3631 *
3632 * Unless required by applicable law or agreed to in writing, software
3633 * distributed under the License is distributed on an "AS IS" BASIS,
3634 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3635 * See the License for the specific language governing permissions and
3636 * limitations under the License.
3637 */class p2{constructor(e){this._values=(e||[]).map(r=>r)}toArray(){return this._values.map(e=>e)}isEqual(e){return function(n,s){if(n.length!==s.length)return!1;for(let i=0;i<n.length;++i)if(n[i]!==s[i])return!1;return!0}(this._values,e._values)}}/**
3638 * @license
3639 * Copyright 2017 Google LLC
3640 *
3641 * Licensed under the Apache License, Version 2.0 (the "License");
3642 * you may not use this file except in compliance with the License.
3643 * You may obtain a copy of the License at
3644 *
3645 *   http://www.apache.org/licenses/LICENSE-2.0
3646 *
3647 * Unless required by applicable law or agreed to in writing, software
3648 * distributed under the License is distributed on an "AS IS" BASIS,
3649 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3650 * See the License for the specific language governing permissions and
3651 * limitations under the License.
3652 */const QK=/^__.*__$/;class JK{constructor(e,r,n){this.data=e,this.fieldMask=r,this.fieldTransforms=n}toMutation(e,r){return this.fieldMask!==null?new qi(e,this.data,this.fieldMask,r,this.fieldTransforms):new Fm(e,this.data,r,this.fieldTransforms)}}class SD{constructor(e,r,n){this.data=e,this.fieldMask=r,this.fieldTransforms=n}toMutation(e,r){return new qi(e,this.data,this.fieldMask,r,this.fieldTransforms)}}function TD(t){switch(t){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw Ce()}}class Ey{constructor(e,r,n,s,i,o){this.settings=e,this.databaseId=r,this.serializer=n,this.ignoreUndefinedProperties=s,i===void 0&&this.vu(),this.fieldTransforms=i||[],this.fieldMask=o||[]}get path(){return this.settings.path}get Cu(){return this.settings.Cu}Fu(e){return new Ey(Object.assign(Object.assign({},this.settings),e),this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}Mu(e){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(e),s=this.Fu({path:n,xu:!1});return s.Ou(e),s}Nu(e){var r;const n=(r=this.path)===null||r===void 0?void 0:r.child(e),s=this.Fu({path:n,xu:!1});return s.vu(),s}Lu(e){return this.Fu({path:void 0,xu:!0})}Bu(e){return Ig(e,this.settings.methodName,this.settings.ku||!1,this.path,this.settings.qu)}contains(e){return this.fieldMask.find(r=>e.isPrefixOf(r))!==void 0||this.fieldTransforms.find(r=>e.isPrefixOf(r.field))!==void 0}vu(){if(this.path)for(let e=0;e<this.path.length;e++)this.Ou(this.path.get(e))}Ou(e){if(e.length===0)throw this.Bu("Document fields must not be empty");if(TD(this.Cu)&&QK.test(e))throw this.Bu('Document fields cannot begin and end with "__"')}}class ZK{constructor(e,r,n){this.databaseId=e,this.ignoreUndefinedProperties=r,this.serializer=n||Ny(e)}Qu(e,r,n,s=!1){return new Ey({Cu:e,methodName:r,qu:n,path:Er.emptyPath(),xu:!1,ku:s},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function qm(t){const e=t._freezeSettings(),r=Ny(t._databaseId);return new ZK(t._databaseId,!!e.ignoreUndefinedProperties,r)}function g2(t,e,r,n,s,i={}){const o=t.Qu(i.merge||i.mergeFields?2:0,e,r,s);b2("Data must be an object, but it was:",o,n);const l=PD(n,o);let c,u;if(i.merge)c=new An(o.fieldMask),u=o.fieldTransforms;else if(i.mergeFields){const d=[];for(const h of i.mergeFields){const m=Kw(e,h,r);if(!o.contains(m))throw new fe(te.INVALID_ARGUMENT,`Field '${m}' is specified in your field mask but missing from your input data.`);ID(d,m)||d.push(m)}c=new An(d),u=o.fieldTransforms.filter(h=>c.covers(h.field))}else c=null,u=o.fieldTransforms;return new JK(new ln(l),c,u)}class ky extends ku{_toFieldTransform(e){if(e.Cu!==2)throw e.Cu===1?e.Bu(`${this._methodName}() can only appear at the top level of your update data`):e.Bu(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof ky}}function AD(t,e,r){return new Ey({Cu:3,qu:e.settings.qu,methodName:t._methodName,xu:r},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class x2 extends ku{_toFieldTransform(e){return new XN(e.path,new Bh)}isEqual(e){return e instanceof x2}}class y2 extends ku{constructor(e,r){super(e),this.Ku=r}_toFieldTransform(e){const r=AD(this,e,!0),n=this.Ku.map(i=>bl(i,r)),s=new Mc(n);return new XN(e.path,s)}isEqual(e){return e instanceof y2&&Go(this.Ku,e.Ku)}}class v2 extends ku{constructor(e,r){super(e),this.Ku=r}_toFieldTransform(e){const r=AD(this,e,!0),n=this.Ku.map(i=>bl(i,r)),s=new $c(n);return new XN(e.path,s)}isEqual(e){return e instanceof v2&&Go(this.Ku,e.Ku)}}function ED(t,e,r,n){const s=t.Qu(1,e,r);b2("Data must be an object, but it was:",s,n);const i=[],o=ln.empty();yl(n,(c,u)=>{const d=w2(e,c,r);u=ot(u);const h=s.Nu(d);if(u instanceof ky)i.push(d);else{const m=bl(u,h);m!=null&&(i.push(d),o.set(d,m))}});const l=new An(i);return new SD(o,l,s.fieldTransforms)}function kD(t,e,r,n,s,i){const o=t.Qu(1,e,r),l=[Kw(e,n,r)],c=[s];if(i.length%2!=0)throw new fe(te.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let m=0;m<i.length;m+=2)l.push(Kw(e,i[m])),c.push(i[m+1]);const u=[],d=ln.empty();for(let m=l.length-1;m>=0;--m)if(!ID(u,l[m])){const p=l[m];let x=c[m];x=ot(x);const w=o.Nu(p);if(x instanceof ky)u.push(p);else{const g=bl(x,w);g!=null&&(u.push(p),d.set(p,g))}}const h=new An(u);return new SD(d,h,o.fieldTransforms)}function eX(t,e,r,n=!1){return bl(r,t.Qu(n?4:3,e))}function bl(t,e){if(CD(t=ot(t)))return b2("Unsupported field value:",e,t),PD(t,e);if(t instanceof ku)return function(n,s){if(!TD(s.Cu))throw s.Bu(`${n._methodName}
3652() can only be used with update() and set()`);if(!s.path)throw s.Bu(`${n._methodName}() is not currently supported inside arrays`);const i=n._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.xu&&e.Cu!==4)throw e.Bu("Nested arrays are not supported");return function(n,s){const i=[];let o=0;for(const l of n){let c=bl(l,s.Lu(o));c==null&&(c={nullValue:"NULL_VALUE"}),i.push(c),o++}return{arrayValue:{values:i}}}(t,e)}return function(n,s){if((n=ot(n))===null)return{nullValue:"NULL_VALUE"};if(typeof n=="number")return XW(s.serializer,n);if(typeof n=="boolean")return{booleanValue:n};if(typeof n=="string")return{stringValue:n};if(n instanceof Date){const i=We.fromDate(n);return{timestampValue:Eg(s.serializer,i)}}if(n instanceof We){const i=new We(n.seconds,1e3*Math.floor(n.nanoseconds/1e3));return{timestampValue:Eg(s.serializer,i)}}if(n instanceof f2)return{geoPointValue:{latitude:n.latitude,longitude:n.longitude}};if(n instanceof Bc)return{bytesValue:Q5(s.serializer,n._byteString)};if(n instanceof Wr){const i=s.databaseId,o=n.firestore._databaseId;if(!o.isEqual(i))throw s.Bu(`Document reference is for database ${o.projectId}/${o.database} but should be for database ${i.projectId}/${i.database}`);return{referenceValue:JN(n.firestore._databaseId||s.databaseId,n._key.path)}}if(n instanceof p2)return function(o,l){return{mapValue:{fields:{__type__:{stringValue:"__vector__"},value:{arrayValue:{values:o.toArray().map(c=>{if(typeof c!="number")throw l.Bu("VectorValues must only contain numeric values.");return KN(l.serializer,c)})}}}}}}(n,s);throw s.Bu(`Unsupported field value: ${Ty(n)}`)}(t,e)}function PD(t,e){const r={};return T5(t)?e.path&&e.path.length>0&&e.fieldMask.push(e.path):yl(t,(n,s)=>{const i=bl(s,e.Mu(n));i!=null&&(r[n]=i)}),{mapValue:{fields:r}}}function CD(t){return!(typeof t!="object"||t===null||t instanceof Array||t instanceof Date||t instanceof We||t instanceof f2||t instanceof Bc||t instanceof Wr||t instanceof ku||t instanceof p2)}function b2(t,e,r){if(!CD(r)||!function(s){return typeof s=="object"&&s!==null&&(Object.getPrototypeOf(s)===Object.prototype||Object.getPrototypeOf(s)===null)}(r)){const n=Ty(r);throw n==="an object"?e.Bu(t+" a custom object"):e.Bu(t+" "+n)}}function Kw(t,e,r){if((e=ot(e))instanceof Hm)return e._internalPath;if(typeof e=="string")return w2(t,e);throw Ig("Field path arguments must be of type string or ",t,!1,void 0,r)}const tX=new RegExp("[~\\*/\\[\\]]");function w2(t,e,r){if(e.search(tX)>=0)throw Ig(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,t,!1,void 0,r);try{return new Hm(...e.split("."))._internalPath}catch{throw Ig(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,t,!1,void 0,r)}}function Ig(t,e,r,n,s){const i=n&&!n.isEmpty(),o=s!==void 0;let l=`Function ${e}() called with invalid data`;r&&(l+=" (via `toFirestore()`)"),l+=". ";let c="";return(i||o)&&(c+=" (found",i&&(c+=` in field ${n}`),o&&(c+=` in document ${s}`),c+=")"),new fe(te.INVALID_ARGUMENT,l+t+c)}function ID(t,e){return t.some(r=>r.isEqual(e))}/**
3653 * @license
3654 * Copyright 2020 Google LLC
3655 *
3656 * Licensed under the Apache License, Version 2.0 (the "License");
3657 * you may not use this file except in compliance with the License.
3658 * You may obtain a copy of the License at
3659 *
3660 *   http://www.apache.org/licenses/LICENSE-2.0
3661 *
3662 * Unless required by applicable law or agreed to in writing, software
3663 * distributed under the License is distributed on an "AS IS" BASIS,
3664 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3665 * See the License for the specific language governing permissions and
3666 * limitations under the License.
3667 */class OD{constructor(e,r,n,s,i){this._firestore=e,this._userDataWriter=r,this._key=n,this._document=s,this._converter=i}get id(){return this._key.path.lastSegment()}get ref(){return new Wr(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new rX(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 r=this._document.data.field(Py("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r)}}}class rX extends OD{data(){return super.data()}}function Py(t,e){return typeof e=="string"?w2(t,e):e instanceof Hm?e._internalPath:e._delegate._internalPath}/**
3668 * @license
3669 * Copyright 2020 Google LLC
3670 *
3671 * Licensed under the Apache License, Version 2.0 (the "License");
3672 * you may not use this file except in compliance with the License.
3673 * You may obtain a copy of the License at
3674 *
3675 *   http://www.apache.org/licenses/LICENSE-2.0
3676 *
3677 * Unless required by applicable law or agreed to in writing, software
3678 * distributed under the License is distributed on an "AS IS" BASIS,
3679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3680 * See the License for the specific language governing permissions and
3681 * limitations under the License.
3682 */function RD(t){if(t.limitType==="L"&&t.explicitOrderBy.length===0)throw new fe(te.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class j2{}class N2 extends j2{}function dt(t,e,...r){let n=[];e instanceof j2&&n.push(e),n=n.concat(r),function(i){const o=i.filter(c=>c instanceof _2).length,l=i.filter(c=>c instanceof Cy).length;if(o>1||o>0&&l>0)throw new fe(te.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(...)))`.")}(n);for(const s of n)t=s._apply(t);return t}class Cy extends N2{constructor(e,r,n){super(),this._field=e,this._op=r,this._value=n,this.type="where"}static _create(e,r,n){return new Cy(e,r,n)}_apply(e){const r=this._parse(e);return DD(e._query,r),new $s(e.firestore,e.converter,Fw(e._query,r))}_parse(e){const r=qm(e.firestore);return function(i,o,l,c,u,d,h){let m;if(u.isKeyField()){if(d==="array-contains"||d==="array-contains-any")throw new fe(te.INVALID_ARGUMENT,`Invalid Query. You can't perform '${d}' queries on documentId().`);if(d==="in"||d==="not-in"){UE(h,d);const p=[];for(const x of h)p.push(VE(c,i,x));m={arrayValue:{values:p}}}else m=VE(c,i,h)}else d!=="in"&&d!=="not-in"&&d!=="array-contains-any"||UE(h,d),m=eX(l,o,h,d==="in"||d==="not-in");return Qt.create(u,d,m)}(e._query,"where",r,e.firestore._databaseId,this._field,this._op,this._value)}}function ht(t,e,r){const n=e,s=Py("where",t);return Cy._create(s,n,r)}class _2 extends j2{constructor(e,r){super(),this.type=e,this._queryConstraints=r}static _create(e,r){return new _2(e,r)}_parse(e){const r=this._queryConstraints.map(n=>n._parse(e)).filter(n=>n.getFilters().length>0);return r.length===1?r[0]:va.create(r,this._getOperator())}_apply(e){const r=this._parse(e);return r.getFilters().length===0?e:(function(s,i){let o=s;const l=i.getFlattenedFilters();
3682for(const c of l)DD(o,c),o=Fw(o,c)}(e._query,r),new $s(e.firestore,e.converter,Fw(e._query,r)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}class S2 extends N2{constructor(e,r){super(),this._field=e,this._direction=r,this.type="orderBy"}static _create(e,r){return new S2(e,r)}_apply(e){const r=function(s,i,o){if(s.startAt!==null)throw new fe(te.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new fe(te.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new Fh(i,o)}(e._query,this._field,this._direction);return new $s(e.firestore,e.converter,function(s,i){const o=s.explicitOrderBy.concat([i]);return new Tu(s.path,s.collectionGroup,o,s.filters.slice(),s.limit,s.limitType,s.startAt,s.endAt)}(e._query,r))}}function T2(t,e="asc"){const r=e,n=Py("orderBy",t);return S2._create(n,r)}class A2 extends N2{constructor(e,r,n){super(),this.type=e,this._limit=r,this._limitType=n}static _create(e,r,n){return new A2(e,r,n)}_apply(e){return new $s(e.firestore,e.converter,Tg(e._query,this._limit,this._limitType))}}function nX(t){return GK("limit",t),A2._create("limit",t,"F")}function VE(t,e,r){if(typeof(r=ot(r))=="string"){if(r==="")throw new fe(te.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!D5(e)&&r.indexOf("/")!==-1)throw new fe(te.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${r}' contains a '/' character.`);const n=e.path.child(At.fromString(r));if(!_e.isDocumentKey(n))throw new fe(te.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${n}' is not because it has an odd number of segments (${n.length}).`);return lE(t,new _e(n))}if(r instanceof Wr)return lE(t,r._key);throw new fe(te.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${Ty(r)}.`)}function UE(t,e){if(!Array.isArray(t)||t.length===0)throw new fe(te.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function DD(t,e){const r=function(s,i){for(const o of s)for(const l of o.getFlattenedFilters())if(i.indexOf(l.op)>=0)return l.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(r!==null)throw r===e.op?new fe(te.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new fe(te.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${r.toString()}' filters.`)}class aX{convertValue(e,r="none"){switch(Jo(e)){case 0:return null;case 1:return e.booleanValue;case 2:return qt(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,r);case 5:return e.stringValue;case 6:return this.convertBytes(Qo(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,r);case 11:return this.convertObject(e.mapValue,r);case 10:return this.convertVectorValue(e.mapValue);default:throw Ce()}}convertObject(e,r){return this.convertObjectMap(e.fields,r)}convertObjectMap(e,r="none"){const n={};return yl(e,(s,i)=>{n[s]=this.convertValue(i,r)}),n}convertVectorValue(e){var r,n,s;const i=(s=(n=(r=e.fields)===null||r===void 0?void 0:r.value.arrayValue)===null||n===void 0?void 0:n.values)===null||s===void 0?void 0:s.map(o=>qt(o.doubleValue));return new p2(i)}convertGeoPoint(e){return new f2(qt(e.latitude),qt(e.longitude))}convertArray(e,r){return(e.values||[]).map(n=>this.convertValue(n,r))}convertServerTimestamp(e,r){switch(r){case"previous":const n=HN(e);return n==null?null:this.convertValue(n,r);case"estimate":return this.convertTimestamp(Mh(e));default:return null}}convertTimestamp(e){const r=Mi(e);return new We(r.seconds,r.nanos)}convertDocumentKey(e,r){const n=At.fromString(e);ut(nD(n));const s=new $h(n.get(1),n.get(3)),i=new _e(n.popFirst(5));return s.isEqual(r)||Es(`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 (${r.projectId}/${r.database}) instead.`),i}}/**
3683 * @license
3684 * Copyright 2020 Google LLC
3685 *
3686 * Licensed under the Apache License, Version 2.0 (the "License");
3687 * you may not use this file except in compliance with the License.
3688 * You may obtain a copy of the License at
3689 *
3690 *   http://www.apache.org/licenses/LICENSE-2.0
3691 *
3692 * Unless required by applicable law or agreed to in writing, software
3693 * distributed under the License is distributed on an "AS IS" BASIS,
3694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3695 * See the License for the specific language governing permissions and
3696 * limitations under the License.
3697 */function E2(t,e,r){let n;return n=t?r&&(r.merge||r.mergeFields)?t.toFirestore(e,r):t.toFirestore(e):e,n}/**
3698 * @license
3699 * Copyright 2020 Google LLC
3700 *
3701 * Licensed under the Apache License, Version 2.0 (the "License");
3702 * you may not use this file except in compliance with the License.
3703 * You may obtain a copy of the License at
3704 *
3705 *   http://www.apache.org/licenses/LICENSE-2.0
3706 *
3707 * Unless required by applicable law or agreed to in writing, software
3708 * distributed under the License is distributed on an "AS IS" BASIS,
3709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3710 * See the License for the specific language governing permissions and
3711 * limitations under the License.
3712 */class Fd{constructor(e,r){this.hasPendingWrites=e,this.fromCache=r}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class MD extends OD{constructor(e,r,n,s,i,o){super(e,r,n,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=i}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const r=new $p(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(r,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,r={}){if(this._document){const n=this._document.data.field(Py("DocumentSnapshot.get",e));if(n!==null)return this._userDataWriter.convertValue(n,r.serverTimestamps)}}}class $p extends MD{data(e={}){return super.data(e)}}class $D{constructor(e,r,n,s){this._firestore=e,this._userDataWriter=r,this._snapshot=s,this.metadata=new Fd(s.hasPendingWrites,s.fromCache),this.query=n}get docs(){const e=[];return this.forEach(r=>e.push(r)),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,r){this._snapshot.docs.forEach(n=>{e.call(r,new $p(this._firestore,this._userDataWriter,n.key,n,new Fd(this._snapshot.mutatedKeys.has(n.key),this._snapshot.fromCache),this.query.converter))})}docChanges(e={}){const r=!!e.includeMetadataChanges;if(r&&this._snapshot.excludesMetadataChanges)throw new fe(te.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===r||(this._cachedChanges=function(s,i){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map(l=>{const c=new $p(s._firestore,s._userDataWriter,l.doc.key,l.doc,new Fd(s._snapshot.mutatedKeys.has(l.doc.key),s._snapshot.fromCache),s.query.converter);return l.doc,{type:"added",doc:c,oldIndex:-1,newIndex:o++}})}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter(l=>i||l.type!==3).map(l=>{const c=new $p(s._firestore,s._userDataWriter,l.doc.key,l.doc,new Fd(s._snapshot.mutatedKeys.has(l.doc.key),s._snapshot.fromCache),s.query.converter);let u=-1,d=-1;return l.type!==0&&(u=o.indexOf(l.doc.key),o=o.delete(l.doc.key)),l.type!==1&&(o=o.add(l.doc),d=o.indexOf(l.doc.key)),{type:sX(l.type),doc:c,oldIndex:u,newIndex:d}})}}(this,r),this._cachedChangesIncludeMetadataChanges=r),this._cachedChanges}}function sX(t){switch(t){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return Ce()}}/**
3713 * @license
3714 * Copyright 2020 Google LLC
3715 *
3716 * Licensed under the Apache License, Version 2.0 (the "License");
3717 * you may not use this file except in compliance with the License.
3718 * You may obtain a copy of the License at
3719 *
3720 *   http://www.apache.org/licenses/LICENSE-2.0
3721 *
3722 * Unless required by applicable law or agreed to in writing, softw
3722are
3723 * distributed under the License is distributed on an "AS IS" BASIS,
3724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3725 * See the License for the specific language governing permissions and
3726 * limitations under the License.
3727 */function Vh(t){t=nn(t,Wr);const e=nn(t.firestore,Ka);return HK(zm(e),t._key).then(r=>FD(e,t,r))}class k2 extends aX{constructor(e){super(),this.firestore=e}convertBytes(e){return new Bc(e)}convertReference(e){const r=this.convertDocumentKey(e,this.firestore._databaseId);return new Wr(this.firestore,null,r)}}function Zt(t){t=nn(t,$s);const e=nn(t.firestore,Ka),r=zm(e),n=new k2(e);return RD(t._query),qK(r,t._query).then(s=>new $D(e,n,t,s))}function LD(t,e,r){t=nn(t,Wr);const n=nn(t.firestore,Ka),s=E2(t.converter,e,r);return Wm(n,[g2(qm(n),"setDoc",t._key,s,t.converter!==null,r).toMutation(t._key,rn.none())])}function Je(t,e,r,...n){t=nn(t,Wr);const s=nn(t.firestore,Ka),i=qm(s);let o;return o=typeof(e=ot(e))=="string"||e instanceof Hm?kD(i,"updateDoc",t._key,e,r,n):ED(i,"updateDoc",t._key,e),Wm(s,[o.toMutation(t._key,rn.exists(!0))])}function Rn(t){return Wm(nn(t.firestore,Ka),[new wy(t._key,rn.none())])}function wl(t,e){const r=nn(t.firestore,Ka),n=Te(t),s=E2(t.converter,e);return Wm(r,[g2(qm(t.firestore),"addDoc",n._key,s,t.converter!==null,{}).toMutation(n._key,rn.exists(!1))]).then(()=>n)}function Dn(t,...e){var r,n,s;t=ot(t);let i={includeMetadataChanges:!1,source:"default"},o=0;typeof e[o]!="object"||BE(e[o])||(i=e[o],o++);const l={includeMetadataChanges:i.includeMetadataChanges,source:i.source};if(BE(e[o])){const h=e[o];e[o]=(r=h.next)===null||r===void 0?void 0:r.bind(h),e[o+1]=(n=h.error)===null||n===void 0?void 0:n.bind(h),e[o+2]=(s=h.complete)===null||s===void 0?void 0:s.bind(h)}let c,u,d;if(t instanceof Wr)u=nn(t.firestore,Ka),d=gy(t._key.path),c={next:h=>{e[o]&&e[o](FD(u,t,h))},error:e[o+1],complete:e[o+2]};else{const h=nn(t,$s);u=nn(h.firestore,Ka),d=h._query;const m=new k2(u);c={next:p=>{e[o]&&e[o](new $D(u,m,h,p))},error:e[o+1],complete:e[o+2]},RD(t._query)}return function(m,p,x,w){const g=new m2(w),v=new d2(p,g,x);return m.asyncQueue.enqueueAndForget(async()=>l2(await Cg(m),v)),()=>{g.Za(),m.asyncQueue.enqueueAndForget(async()=>c2(await Cg(m),v))}}(zm(u),d,l,c)}function Wm(t,e){return function(n,s){const i=new vs;return n.asyncQueue.enqueueAndForget(async()=>OK(await zK(n),s,i)),i.promise}(zm(t),e)}function FD(t,e,r){const n=r.docs.get(e._key),s=new k2(t);return new MD(t,s,e._key,n,new Fd(r.hasPendingWrites,r.fromCache),e.converter)}/**
3728 * @license
3729 * Copyright 2020 Google LLC
3730 *
3731 * Licensed under the Apache License, Version 2.0 (the "License");
3732 * you may not use this file except in compliance with the License.
3733 * You may obtain a copy of the License at
3734 *
3735 *   http://www.apache.org/licenses/LICENSE-2.0
3736 *
3737 * Unless required by applicable law or agreed to in writing, software
3738 * distributed under the License is distributed on an "AS IS" BASIS,
3739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3740 * See the License for the specific language governing permissions and
3741 * limitations under the License.
3742 */class iX{constructor(e,r){this._firestore=e,this._commitHandler=r,this._mutations=[],this._committed=!1,this._dataReader=qm(e)}set(e,r,n){this._verifyNotCommitted();const s=I0(e,this._firestore),i=E2(s.converter,r,n),o=g2(this._dataReader,"WriteBatch.set",s._key,i,s.converter!==null,n);return this._mutations.push(o.toMutation(s._key,rn.none())),this}update(e,r,n,...s){this._verifyNotCommitted();const i=I0(e,this._firestore);let o;return o=typeof(r=ot(r))=="string"||r instanceof Hm?kD(this._dataReader,"WriteBatch.update",i._key,r,n,s):ED(this._dataReader,"WriteBatch.update",i._key,r),this._mutations.push(o.toMutation(i._key,rn.exists(!0))),this}delete(e){this._verifyNotCommitted();const r=I0(e,this._firestore);return this._mutations=this._mutations.concat(new wy(r._key,rn.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 fe(te.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function I0(t,e){if((t=ot(t)).firestore!==e)throw new fe(te.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return t}function Ct(){return new x2("serverTimestamp")}function zE(...t){return new y2("arrayUnion",t)}function HE(...t){return new v2("arrayRemove",t)}/**
3743 * @license
3744 * Copyright 2020 Google LLC
3745 *
3746 * Licensed under the Apache License, Version 2.0 (the "License");
3747 * you may not use this file except in compliance with the License.
3748 * You may obtain a copy of the License at
3749 *
3750 *   http://www.apache.org/licenses/LICENSE-2.0
3751 *
3752 * Unless required by applicable law or agreed to in writing, software
3753 * distributed under the License is distributed on an "AS IS" BASIS,
3754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3755 * See the License for the specific language governing permissions and
3756 * limitations under the License.
3757 */function BD(t){return zm(t=nn(t,Ka)),new iX(t,e=>Wm(t,e))}(function(e,r=!0){(function(s){Su=s})(xl),xa(new Qn("firestore",(n,{instanceIdentifier:s,options:i})=>{const o=n.getProvider("app").getImmediate(),l=new Ka(new hW(n.getProvider("auth-internal")),new gW(n.getProvider("app-check-internal")),function(u,d){if(!Object.prototype.hasOwnProperty.apply(u.options,["projectId"]))throw new fe(te.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new $h(u.options.projectId,d)}(o,s),o);return i=Object.assign({useFetchStreams:r},i),l._setSettings(i),l},"PUBLIC").setMultipleInstances(!0)),pn(nE,"4.7.3",e),pn(nE,"4.7.3","esm2017")})();const VD="@firebase/installations",P2="0.6.9";/**
3758 * @license
3759 * Copyright 2019 Google LLC
3760 *
3761 * Licensed under the Apache License, Version 2.0 (the "License");
3762 * you may not use this file except in compliance with the License.
3763 * You may obtain a copy of the License at
3764 *
3765 *   http://www.apache.org/licenses/LICENSE-2.0
3766 *
3767 * Unless required by applicable law or agreed to in writing, software
3768 * distributed under the License is distributed on an "AS IS" BASIS,
3769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3770 * See the License for the specific language governing permissions and
3771 * limitations under the License.
3772 */const UD=1e4,zD=`w:${P2}`,HD="FIS_v2",oX="https://firebaseinstallations.googleapis.com/v1",lX=60*60*1e3,cX="installations",uX="Installations";/**
3773 * @license
3774 * Copyright 2019 Google LLC
3775 *
3776 * Licensed under the Apache License, Version 2.0 (the "License");
3777 * you may not use this file except in compliance with the License.
3778 * You may obtain a copy of the License at
3779 *
3780 *   http://www.apache.org/licenses/LICENSE-2.0
3781 *
3782 * Unless required by applicable law or agreed to in writing, software
3783 * distributed under the License is distributed on an "AS IS" BASIS,
3784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3785 * See the License for the specific language governing permissions and
3786 * limitations under the License.
3787 */const dX={"missing-app-config-values":'Missing App configuration value: "{$valueName}"',"not-registered":"Firebase Installation is not registered.","installation-not-found":"Firebase Installation not found.","request-failed":'{$requestName} request failed with error "{$serverCode} {$serverStatus}: {$serverMessage}"',"app-offline":"Could not process request. Application offline.","delete-pending-registration":"Can't delete installation while there is a pending registration request."},Zo=new gl(cX,uX,dX);function qD(t){return t instanceof Zn&&t.code.includes("request-failed")}/**
3788 * @license
3789 * Copyright 2019 Google LLC
3790 *
3791 * Licensed under the Apache License, Version 2.0 (the "License");
3792 * you may not use this file except in compliance with the License.
3793 * You may obtain a copy of the License at
3794 *
3795 *   http://www.apache.org/licenses/LICENSE-2.0
3796 *
3797 * Unless required by applicable law or agreed to in writing, software
3798 * distributed under the License is distributed on an "AS IS" BASIS,
3799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3800 * See the License for the specific language governing permissions and
3801 * limitations under the License.
3802 */function WD({projectId:t}){return`${oX}/projects/${t}/installations`}function GD(t){return{token:t.token,requestStatus:2,expiresIn:mX(t.expiresIn),creationTime:Date.now()}}async function KD(t,e){const n=(await e.json()).error;return Zo.create("request-failed",{requestName:t,serverCode:n.code,serverMessage:n.message,serverStatus:n.status})}function XD({apiKey:t}){return new Headers({"Content-Type":"application/json",Accept:"application/json","x-goog-api-key":t})}function hX(t,{refreshToken:e}){const r=XD(t);return r.append("Authorization",fX(e)),r}async function YD(t){const e=await t();return e.status>=500&&e.status<600?t():e}function mX(t){return Number(t.replace("s","000"))}function fX(t){return`${HD} ${t}`}/**
3803 * @license
3804 * Copyright 2019 Google LLC
3805 *
3806 * Licensed under the Apache License, Version 2.0 (the "License");
3807 * you may not use this file except in compliance with the License.
3808 * You may obtain a copy of the License at
3809 *
3810 *   http://www.apache.org/licenses/LICENSE-2.0
3811 *
3812 * Unless required by applicable law or agreed to in writing, software
3813 * distributed under the License is distributed on an "AS IS" BASIS,
3814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3815 * See the License for the specific language governing permissions and
3816 * limitations under the License.
3817 */async function pX({appConfig:t,heartbeatServiceProvider:e},{fid:r}){const n=WD(t),s=XD(t),i=e.getImmediate({optional:!0});if(i){const u=await i.getHeartbeatsHeader();u&&s.append("x-firebase-client",u)}const o={fid:r,authVersion:HD,appId:t.appId,sdkVersion:zD},l={method:"POST",headers:s,body:JSON.stringify(o)},c=await YD(()=>fetch(n,l));if(c.ok){const u=await c.json();return{fid:u.fid||r,registrationStatus:2,refreshToken:u.refreshToken,authToken:GD(u.authToken)}}else throw await KD("Create Installation",c)}/**
3818 * @license
3819 * Copyright 2019 Google LLC
3820 *
3821 * Licensed under the Apache License, Version 2.0 (the "License");
3822 * you may not use this file except in compliance with the License.
3823 * You may obtain a copy of the License at
3824 *
3825 *   http://www.apache.org/licenses/LICENSE-2.0
3826 *
3827 * Unless required by applicable law or agreed to in writing, software
3828 * distributed under the License is distributed on an "AS IS" BASIS,
3829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3830 * See the License for the specific language governing permissions and
3831 * limitations under the License.
3832 */function QD(t){return new Promise(e=>{setTimeout(e,t)})}/**
3833 * @license
3834 * Copyright 2019 Google LLC
3835 *
3836 * Licensed under the Apache License, Version 2.0 (the "License");
3837 * you may not use this file except in compliance with the License.
3838 * You may obtain a copy of the License at
3839 *
3840 *   http://www.apache.org/licenses/LICENSE-2.0
3841 *
3842 * Unless required by applicable law or agreed to in writing, software
3843 * distributed under the License is distributed on an "AS IS" BASIS,
3844 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3845 * See the License for the specific language governing permissions and
3846 * limitations under the License.
3847 */function gX(t){return btoa(String.fromCharCode(...t)).replace(/\+/g,"-").replace(/\//g,"_")}/**
3848 * @license
3849 * Copyright 2019 Google LLC
3850 *
3851 * Licensed under the Apache License, Version 2.0 (the "License");
3852 * you may not use this file except in compliance with the License.
3853 * You may obtain a copy of the License at
3854 *
3855 *   http://www.apache.org/licenses/LICENSE-2.0
3856 *
3857 * Unless required by applicable law or agreed to in writing, software
3858 * distributed under the License is distributed on an "AS IS" BASIS,
3859 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3860 * See the License for the specific language governing permissions and
3861 * limitations under the License.
3862 */const xX=/^[cdef][\w-]{21}$/,Xw="";function yX(){try{const t=new Uint8Array(17);(self.crypto||self.msCrypto).getRandomValues(t),t[0]=112+t[0]%16;const r=vX(t);return xX.test(r)?r:Xw}catch{return Xw}}function vX(t){return gX(t).substr(0,22)}/**
3863 * @license
3864 * Copyright 2019 Google LLC
3865 *
3866 * Licensed under the Apache License, Version 2.0 (the "License");
3867 * you may not use this file except in compliance with the License.
3868 * You may obtain a copy of the License at
3869 *
3870 *   http://www.apache.org/licenses/LICENSE-2.0
3871 *
3872 * Unless required by applicable law or agreed to in writing, software
3873 * distributed under the License is distributed on an "AS IS" BASIS,
3874 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3875 * See the License for the specific language governing permissions and
3876 * limitations under the License.
3877 */function Iy(t){return`${t.appName}!${t.appId}`}/**
3878 * @license
3879 * Copyright 2019 Google LLC
3880 *
3881 * Licensed under the Apache License, Version 2.0 (the "License");
3882 * you may not use this file except in compliance with the License.
3883 * You may obtain a copy of the License at
3884 *
3885 *   http://www.apache.org/licenses/LICENSE-2.0
3886 *
3887 * Unless required by applicable law or agreed to in writing, softw
3887are
3888 * distributed under the License is distributed on an "AS IS" BASIS,
3889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3890 * See the License for the specific language governing permissions and
3891 * limitations under the License.
3892 */const JD=new Map;function ZD(t,e){const r=Iy(t);eM(r,e),bX(r,e)}function eM(t,e){const r=JD.get(t);if(r)for(const n of r)n(e)}function bX(t,e){const r=wX();r&&r.postMessage({key:t,fid:e}),jX()}let wo=null;function wX(){return!wo&&"BroadcastChannel"in self&&(wo=new BroadcastChannel("[Firebase] FID Change"),wo.onmessage=t=>{eM(t.data.key,t.data.fid)}),wo}function jX(){JD.size===0&&wo&&(wo.close(),wo=null)}/**
3893 * @license
3894 * Copyright 2019 Google LLC
3895 *
3896 * Licensed under the Apache License, Version 2.0 (the "License");
3897 * you may not use this file except in compliance with the License.
3898 * You may obtain a copy of the License at
3899 *
3900 *   http://www.apache.org/licenses/LICENSE-2.0
3901 *
3902 * Unless required by applicable law or agreed to in writing, software
3903 * distributed under the License is distributed on an "AS IS" BASIS,
3904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3905 * See the License for the specific language governing permissions and
3906 * limitations under the License.
3907 */const NX="firebase-installations-database",_X=1,el="firebase-installations-store";let O0=null;function C2(){return O0||(O0=O3(NX,_X,{upgrade:(t,e)=>{switch(e){case 0:t.createObjectStore(el)}}})),O0}async function Og(t,e){const r=Iy(t),s=(await C2()).transaction(el,"readwrite"),i=s.objectStore(el),o=await i.get(r);return await i.put(e,r),await s.done,(!o||o.fid!==e.fid)&&ZD(t,e.fid),e}async function tM(t){const e=Iy(t),n=(await C2()).transaction(el,"readwrite");await n.objectStore(el).delete(e),await n.done}async function Oy(t,e){const r=Iy(t),s=(await C2()).transaction(el,"readwrite"),i=s.objectStore(el),o=await i.get(r),l=e(o);return l===void 0?await i.delete(r):await i.put(l,r),await s.done,l&&(!o||o.fid!==l.fid)&&ZD(t,l.fid),l}/**
3908 * @license
3909 * Copyright 2019 Google LLC
3910 *
3911 * Licensed under the Apache License, Version 2.0 (the "License");
3912 * you may not use this file except in compliance with the License.
3913 * You may obtain a copy of the License at
3914 *
3915 *   http://www.apache.org/licenses/LICENSE-2.0
3916 *
3917 * Unless required by applicable law or agreed to in writing, software
3918 * distributed under the License is distributed on an "AS IS" BASIS,
3919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3920 * See the License for the specific language governing permissions and
3921 * limitations under the License.
3922 */async function I2(t){let e;const r=await Oy(t.appConfig,n=>{const s=SX(n),i=TX(t,s);return e=i.registrationPromise,i.installationEntry});return r.fid===Xw?{installationEntry:await e}:{installationEntry:r,registrationPromise:e}}function SX(t){const e=t||{fid:yX(),registrationStatus:0};return rM(e)}function TX(t,e){if(e.registrationStatus===0){if(!navigator.onLine){const s=Promise.reject(Zo.create("app-offline"));return{installationEntry:e,registrationPromise:s}}const r={fid:e.fid,registrationStatus:1,registrationTime:Date.now()},n=AX(t,r);return{installationEntry:r,registrationPromise:n}}else return e.registrationStatus===1?{installationEntry:e,registrationPromise:EX(t)}:{installationEntry:e}}async function AX(t,e){try{const r=await pX(t,e);return Og(t.appConfig,r)}catch(r){throw qD(r)&&r.customData.serverCode===409?await tM(t.appConfig):await Og(t.appConfig,{fid:e.fid,registrationStatus:0}),r}}async function EX(t){let e=await qE(t.appConfig);for(;e.registrationStatus===1;)await QD(100),e=await qE(t.appConfig);if(e.registrationStatus===0){const{installationEntry:r,registrationPromise:n}=await I2(t);return n||r}return e}function qE(t){return Oy(t,e=>{if(!e)throw Zo.create("installation-not-found");return rM(e)})}function rM(t){return kX(t)?{fid:t.fid,registrationStatus:0}:t}function kX(t){return t.registrationStatus===1&&t.registrationTime+UD<Date.now()}/**
3923 * @license
3924 * Copyright 2019 Google LLC
3925 *
3926 * Licensed under the Apache License, Version 2.0 (the "License");
3927 * you may not use this file except in compliance with the License.
3928 * You may obtain a copy of the License at
3929 *
3930 *   http://www.apache.org/licenses/LICENSE-2.0
3931 *
3932 * Unless required by applicable law or agreed to in writing, software
3933 * distributed under the License is distributed on an "AS IS" BASIS,
3934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3935 * See the License for the specific language governing permissions and
3936 * limitations under the License.
3937 */async function PX({appConfig:t,heartbeatServiceProvider:e},r){const n=CX(t,r),s=hX(t,r),i=e.getImmediate({optional:!0});if(i){const u=await i.getHeartbeatsHeader();u&&s.append("x-firebase-client",u)}const o={installation:{sdkVersion:zD,appId:t.appId}},l={method:"POST",headers:s,body:JSON.stringify(o)},c=await YD(()=>fetch(n,l));if(c.ok){const u=await c.json();return GD(u)}else throw await KD("Generate Auth Token",c)}function CX(t,{fid:e}){return`${WD(t)}/${e}/authTokens:generate`}/**
3938 * @license
3939 * Copyright 2019 Google LLC
3940 *
3941 * Licensed under the Apache License, Version 2.0 (the "License");
3942 * you may not use this file except in compliance with the License.
3943 * You may obtain a copy of the License at
3944 *
3945 *   http://www.apache.org/licenses/LICENSE-2.0
3946 *
3947 * Unless required by applicable law or agreed to in writing, software
3948 * distributed under the License is distributed on an "AS IS" BASIS,
3949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3950 * See the License for the specific language governing permissions and
3951 * limitations under the License.
3952 */async function O2(t,e=!1){let r;const n=await Oy(t.appConfig,i=>{if(!nM(i))throw Zo.create("not-registered");const o=i.authToken;if(!e&&RX(o))return i;if(o.requestStatus===1)return r=IX(t,e),i;{if(!navigator.onLine)throw Zo.create("app-offline");const l=MX(i);return r=OX(t,l),l}});return r?await r:n.authToken}async function IX(t,e){let r=await WE(t.appConfig);for(;r.authToken.requestStatus===1;)await QD(100),r=await WE(t.appConfig);const n=r.authToken;return n.requestStatus===0?O2(t,e):n}function WE(t){return Oy(t,e=>{if(!nM(e))throw Zo.create("not-registered");const r=e.authToken;return $X(r)?Object.assign(Object.assign({},e),{authToken:{requestStatus:0}}):e})}async function OX(t,e){try{const r=await PX(t,e),n=Object.assign(Object.assign({},e),{authToken:r});return await Og(t.appConfig,n),r}catch(r){if(qD(r)&&(r.customData.serverCode===401||r.customData.serverCode===404))await tM(t.appConfig);else{const n=Object.assign(Object.assign({},e),{authToken:{requestStatus:0}});await Og(t.appConfig,n)}throw r}}function nM(t){return t!==void 0&&t.registrationStatus===2}function RX(t){return t.requestStatus===2&&!DX(t)}function DX(t){const e=Date.now();return e<t.creationTime||t.creationTime+t.expiresIn<e+lX}function MX(t){const e={requestStatus:1,requestTime:Date.now()};return Object.assign(Object.assign({},t),{authToken:e})}function $X(t){return t.requestStatus===1&&t.requestTime+UD<Date.now()}/**
3953 * @license
3954 * Copyright 2019 Google LLC
3955 *
3956 * Licensed under the Apache License, Version 2.0 (the "License");
3957 * you may not use this file except in compliance with the License.
3958 * You may obtain a copy of the License at
3959 *
3960 *   http://www.apache.org/licenses/LICENSE-2.0
3961 *
3962 * Unless required by applicable law or agreed to in writing, software
3963 * distributed under the License is distributed on an "AS IS" BASIS,
3964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3965 * See the License for the specific language governing permissions and
3966 * limitations under the License.
3967 */async function LX(t){const e=t,{installationEntry:r,registrationPromise:n}=await I2(e);return n?n.catch(console.error):O2(e).catch(console.error),r.fid}/**
3968 * @license
3969 * Copyright 2019 Google LLC
3970 *
3971 * Licensed under the Apache License, Version 2.0 (the "License");
3972 * you may not use this file except in compliance with the License.
3973 * You may obtain a copy of the License at
3974 *
3975 *   http://www.apache.org/licenses/LICENSE-2.0
3976 *
3977 * Unless required by applicable law or agreed to in writing, software
3978 * distributed under the License is distributed on an "AS IS" BASIS,
3979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3980 * See the License for the specific language governing permissions and
3981 * limitations under the License.
3982 */async function FX(t,e=!1){const r=t;return await BX(r),(await O2(r,e)).token}async function BX(t){const{registrationPromise:e}=await I2(t);e&&await e}/**
3983 * @license
3984 * Copyright 2019 Google LLC
3985 *
3986 * Licensed under the Apache License, Version 2.0 (the "License");
3987 * you may not use this file except in compliance with the License.
3988 * You may obtain a copy of the License at
3989 *
3990 *   http://www.apache.org/licenses/LICENSE-2.0
3991 *
3992 * Unless required by applicable law or agreed to in writing, software
3993 * distributed under the License is distributed on an "AS IS" BASIS,
3994 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3995 * See the License for the specific language governing permissions and
3996 * limitations under the License.
3997 */function VX(t){if(!t||!t.options)throw R0("App Configuration");if(!t.name)throw R0("App Name");const e=["projectId","apiKey","appId"];for(const r of e)if(!t.options[r])throw R0(r);return{appName:t.name,projectId:t.options.projectId,apiKey:t.options.apiKey,appId:t.options.appId}}function R0(t){return Zo.create("missing-app-config-values",{valueName:t})}/**
3998 * @license
3999 * Copyright 2020 Google LLC
4000 *
4001 * Licensed under the Apache License, Version 2.0 (the "License");
4002 * you may not use this file except in compliance with the License.
4003 * You may obtain a copy of the License at
4004 *
4005 *   http://www.apache.org/licenses/LICENSE-2.0
4006 *
4007 * Unless required by applicable law or agreed to in writing, software
4008 * distributed under the License is distributed on an "AS IS" BASIS,
4009 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4010 * See the License for the specific language governing permissions and
4011 * limitations under the License.
4012 */const aM="installations",UX="installations-internal",zX=t=>{const e=t.getProvider("app").getImmediate(),r=VX(e),n=zi(e,"heartbeat");return{app:e,appConfig:r,heartbeatServiceProvider:n,_delete:()=>Promise.resolve()}},HX=t=>{const e=t.getProvider("app").getImmediate(),r=zi(e,aM).getImmediate();return{getId:()=>LX(r),getToken:s=>FX(r,s)}};function qX(){xa(new Qn(aM,zX,"PUBLIC")),xa(new Qn(UX,HX,"PRIVATE"))}qX();pn(VD,P2);pn(VD,P2,"esm2017");/**
4013 * @license
4014 * Copyright 2019 Google LLC
4015 *
4016 * Licensed under the Apache License, Version 2.0 (the "License");
4017 * you may not use this file except in compliance with the License.
4018 * You may obtain a copy of the License at
4019 *
4020 *   http://www.apache.org/licenses/LICENSE-2.0
4021 *
4022 * Unless required by applicable law or agreed to in writing, software
4023 * distributed under the License is distributed on an "AS IS" BASIS,
4024 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4025 * See the License for the specific language governing permissions and
4026 * limitations under the License.
4027 */const Rg="analytics",WX="firebase_id",GX="origin",KX=60*1e3,XX="https://firebase.googleapis.com/v1alpha/projects/-/apps/{app-id}/webConfig",R2="https://www.googletagmanager.com/gtag/js";/**
4028 * @license
4029 * Copyright 2019 Google LLC
4030 *
4031 * Licensed under the Apache License, Version 2.0 (the "License");
4032 * you may not use this file except in compliance with the License.
4033 * You may obtain a copy of the License at
4034 *
4035 *   http://www.apache.org/licenses/LICENSE-2.0
4036 *
4037 * Unless required by applicable law or agreed to in writing, software
4038 * distributed under the License is distributed on an "AS IS" BASIS,
4039 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4040 * See the License for the specific language governing permissions and
4041 * limitations under the License.
4042 */const gn=new uy("@firebase/analytics");/**
4043 * @license
4044 * Copyright 2019 Google LLC
4045 *
4046 * Licensed under the Apache License, Version 2.0 (the "License");
4047 * you may not use this file except in compliance with the License.
4048 * You may obtain a copy of the License at
4049 *
4050 *   http://www.apache.org/licenses/LICENSE-2.0
4051 *
4052 * Unless required by applicable law or agreed to in writing, software
4053 * distributed under the License is distributed on an "AS IS" BASIS,
4054 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4055 * See the License for the specific language governing permissions and
4056 * limitations under the License.
4057 */const YX={"already-exists":"A Firebase Analytics instance with the appId {$id}  already exists. Only one Firebase Analytics instance can be created for each appId.","already-initialized":"initializeAnalytics() cannot be called again with different options than those it was initially called with. It can be called again with the same options to return the existing instance, or getAnalytics() can be used to get a reference to the already-initialized instance.","already-initialized-settings":"Firebase Analytics has already been initialized.settings() must be called before initializing any Analytics instanceor it will have no effect.","interop-component-reg-failed":"Firebase Analytics Interop Component failed to instantiate: {$reason}
4057","invalid-analytics-context":"Firebase Analytics is not supported in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","indexeddb-unavailable":"IndexedDB unavailable or restricted in this environment. Wrap initialization of analytics in analytics.isSupported() to prevent initialization in unsupported environments. Details: {$errorInfo}","fetch-throttle":"The config fetch request timed out while in an exponential backoff state. Unix timestamp in milliseconds when fetch request throttling ends: {$throttleEndTimeMillis}.","config-fetch-failed":"Dynamic config fetch failed: [{$httpStatus}] {$responseMessage}","no-api-key":'The "apiKey" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid API key.',"no-app-id":'The "appId" field is empty in the local Firebase config. Firebase Analytics requires this field tocontain a valid app ID.',"no-client-id":'The "client_id" field is empty.',"invalid-gtag-resource":"Trusted Types detected an invalid gtag resource: {$gtagURL}."},Pn=new gl("analytics","Analytics",YX);/**
4058 * @license
4059 * Copyright 2019 Google LLC
4060 *
4061 * Licensed under the Apache License, Version 2.0 (the "License");
4062 * you may not use this file except in compliance with the License.
4063 * You may obtain a copy of the License at
4064 *
4065 *   http://www.apache.org/licenses/LICENSE-2.0
4066 *
4067 * Unless required by applicable law or agreed to in writing, software
4068 * distributed under the License is distributed on an "AS IS" BASIS,
4069 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4070 * See the License for the specific language governing permissions and
4071 * limitations under the License.
4072 */function QX(t){if(!t.startsWith(R2)){const e=Pn.create("invalid-gtag-resource",{gtagURL:t});return gn.warn(e.message),""}return t}function sM(t){return Promise.all(t.map(e=>e.catch(r=>r)))}function JX(t,e){let r;return window.trustedTypes&&(r=window.trustedTypes.createPolicy(t,e)),r}function ZX(t,e){const r=JX("firebase-js-sdk-policy",{createScriptURL:QX}),n=document.createElement("script"),s=`${R2}?l=${t}&id=${e}`;n.src=r?r==null?void 0:r.createScriptURL(s):s,n.async=!0,document.head.appendChild(n)}function eY(t){let e=[];return Array.isArray(window[t])?e=window[t]:window[t]=e,e}async function tY(t,e,r,n,s,i){const o=n[s];try{if(o)await e[o];else{const c=(await sM(r)).find(u=>u.measurementId===s);c&&await e[c.appId]}}catch(l){gn.error(l)}t("config",s,i)}async function rY(t,e,r,n,s){try{let i=[];if(s&&s.send_to){let o=s.send_to;Array.isArray(o)||(o=[o]);const l=await sM(r);for(const c of o){const u=l.find(h=>h.measurementId===c),d=u&&e[u.appId];if(d)i.push(d);else{i=[];break}}}i.length===0&&(i=Object.values(e)),await Promise.all(i),t("event",n,s||{})}catch(i){gn.error(i)}}function nY(t,e,r,n){async function s(i,...o){try{if(i==="event"){const[l,c]=o;await rY(t,e,r,l,c)}else if(i==="config"){const[l,c]=o;await tY(t,e,r,n,l,c)}else if(i==="consent"){const[l,c]=o;t("consent",l,c)}else if(i==="get"){const[l,c,u]=o;t("get",l,c,u)}else if(i==="set"){const[l]=o;t("set",l)}else t(i,...o)}catch(l){gn.error(l)}}return s}function aY(t,e,r,n,s){let i=function(...o){window[n].push(arguments)};return window[s]&&typeof window[s]=="function"&&(i=window[s]),window[s]=nY(i,t,e,r),{gtagCore:i,wrappedGtag:window[s]}}function sY(t){const e=window.document.getElementsByTagName("script");for(const r of Object.values(e))if(r.src&&r.src.includes(R2)&&r.src.includes(t))return r;return null}/**
4073 * @license
4074 * Copyright 2020 Google LLC
4075 *
4076 * Licensed under the Apache License, Version 2.0 (the "License");
4077 * you may not use this file except in compliance with the License.
4078 * You may obtain a copy of the License at
4079 *
4080 *   http://www.apache.org/licenses/LICENSE-2.0
4081 *
4082 * Unless required by applicable law or agreed to in writing, software
4083 * distributed under the License is distributed on an "AS IS" BASIS,
4084 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4085 * See the License for the specific language governing permissions and
4086 * limitations under the License.
4087 */const iY=30,oY=1e3;class lY{constructor(e={},r=oY){this.throttleMetadata=e,this.intervalMillis=r}getThrottleMetadata(e){return this.throttleMetadata[e]}setThrottleMetadata(e,r){this.throttleMetadata[e]=r}deleteThrottleMetadata(e){delete this.throttleMetadata[e]}}const iM=new lY;function cY(t){return new Headers({Accept:"application/json","x-goog-api-key":t})}async function uY(t){var e;const{appId:r,apiKey:n}=t,s={method:"GET",headers:cY(n)},i=XX.replace("{app-id}",r),o=await fetch(i,s);if(o.status!==200&&o.status!==304){let l="";try{const c=await o.json();!((e=c.error)===null||e===void 0)&&e.message&&(l=c.error.message)}catch{}throw Pn.create("config-fetch-failed",{httpStatus:o.status,responseMessage:l})}return o.json()}async function dY(t,e=iM,r){const{appId:n,apiKey:s,measurementId:i}=t.options;if(!n)throw Pn.create("no-app-id");
4087if(!s){if(i)return{measurementId:i,appId:n};throw Pn.create("no-api-key")}const o=e.getThrottleMetadata(n)||{backoffCount:0,throttleEndTimeMillis:Date.now()},l=new fY;return setTimeout(async()=>{l.abort()},KX),oM({appId:n,apiKey:s,measurementId:i},o,l,e)}async function oM(t,{throttleEndTimeMillis:e,backoffCount:r},n,s=iM){var i;const{appId:o,measurementId:l}=t;try{await hY(n,e)}catch(c){if(l)return gn.warn(`Timed out fetching this Firebase app's measurement ID from the server. Falling back to the measurement ID ${l} provided in the "measurementId" field in the local Firebase config. [${c==null?void 0:c.message}]`),{appId:o,measurementId:l};throw c}try{const c=await uY(t);return s.deleteThrottleMetadata(o),c}catch(c){const u=c;if(!mY(u)){if(s.deleteThrottleMetadata(o),l)return gn.warn(`Failed to fetch this Firebase app's measurement ID from the server. Falling back to the measurement ID ${l} provided in the "measurementId" field in the local Firebase config. [${u==null?void 0:u.message}]`),{appId:o,measurementId:l};throw c}const d=Number((i=u==null?void 0:u.customData)===null||i===void 0?void 0:i.httpStatus)===503?AA(r,s.intervalMillis,iY):AA(r,s.intervalMillis),h={throttleEndTimeMillis:Date.now()+d,backoffCount:r+1};return s.setThrottleMetadata(o,h),gn.debug(`Calling attemptFetch again in ${d} millis`),oM(t,h,n,s)}}function hY(t,e){return new Promise((r,n)=>{const s=Math.max(e-Date.now(),0),i=setTimeout(r,s);t.addEventListener(()=>{clearTimeout(i),n(Pn.create("fetch-throttle",{throttleEndTimeMillis:e}))})})}function mY(t){if(!(t instanceof Zn)||!t.customData)return!1;const e=Number(t.customData.httpStatus);return e===429||e===500||e===503||e===504}class fY{constructor(){this.listeners=[]}addEventListener(e){this.listeners.push(e)}abort(){this.listeners.forEach(e=>e())}}async function pY(t,e,r,n,s){if(s&&s.global){t("event",r,n);return}else{const i=await e,o=Object.assign(Object.assign({},n),{send_to:i});t("event",r,o)}}/**
4088 * @license
4089 * Copyright 2020 Google LLC
4090 *
4091 * Licensed under the Apache License, Version 2.0 (the "License");
4092 * you may not use this file except in compliance with the License.
4093 * You may obtain a copy of the License at
4094 *
4095 *   http://www.apache.org/licenses/LICENSE-2.0
4096 *
4097 * Unless required by applicable law or agreed to in writing, software
4098 * distributed under the License is distributed on an "AS IS" BASIS,
4099 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4100 * See the License for the specific language governing permissions and
4101 * limitations under the License.
4102 */async function gY(){if(k3())try{await P3()}catch(t){return gn.warn(Pn.create("indexeddb-unavailable",{errorInfo:t==null?void 0:t.toString()}).message),!1}else return gn.warn(Pn.create("indexeddb-unavailable",{errorInfo:"IndexedDB is not available in this environment."}).message),!1;return!0}async function xY(t,e,r,n,s,i,o){var l;const c=dY(t);c.then(p=>{r[p.measurementId]=p.appId,t.options.measurementId&&p.measurementId!==t.options.measurementId&&gn.warn(`The measurement ID in the local Firebase config (${t.options.measurementId}) does not match the measurement ID fetched from the server (${p.measurementId}). To ensure analytics events are always sent to the correct Analytics property, update the measurement ID field in the local config or remove it from the local config.`)}).catch(p=>gn.error(p)),e.push(c);const u=gY().then(p=>{if(p)return n.getId()}),[d,h]=await Promise.all([c,u]);sY(i)||ZX(i,d.measurementId),s("js",new Date);const m=(l=o==null?void 0:o.config)!==null&&l!==void 0?l:{};return m[GX]="firebase",m.update=!0,h!=null&&(m[WX]=h),s("config",d.measurementId,m),d.measurementId}/**
4103 * @license
4104 * Copyright 2019 Google LLC
4105 *
4106 * Licensed under the Apache License, Version 2.0 (the "License");
4107 * you may not use this file except in compliance with the License.
4108 * You may obtain a copy of the License at
4109 *
4110 *   http://www.apache.org/licenses/LICENSE-2.0
4111 *
4112 * Unless required by applicable law or agreed to in writing, software
4113 * distributed under the License is distributed on an "AS IS" BASIS,
4114 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4115 * See the License for the specific language governing permissions and
4116 * limitations under the License.
4117 */class yY{constructor(e){this.app=e}_delete(){return delete rh[this.app.options.appId],Promise.resolve()}}let rh={},GE=[];const KE={};let D0="dataLayer",vY="gtag",XE,lM,YE=!1;function bY(){const t=[];
4117if(E3()&&t.push("This is a browser extension environment."),AU()||t.push("Cookies are not available."),t.length>0){const e=t.map((n,s)=>`(${s+1}) ${n}`).join(" "),r=Pn.create("invalid-analytics-context",{errorInfo:e});gn.warn(r.message)}}function wY(t,e,r){bY();const n=t.options.appId;if(!n)throw Pn.create("no-app-id");if(!t.options.apiKey)if(t.options.measurementId)gn.warn(`The "apiKey" field is empty in the local Firebase config. This is needed to fetch the latest measurement ID for this Firebase app. Falling back to the measurement ID ${t.options.measurementId} provided in the "measurementId" field in the local Firebase config.`);else throw Pn.create("no-api-key");if(rh[n]!=null)throw Pn.create("already-exists",{id:n});if(!YE){eY(D0);const{wrappedGtag:i,gtagCore:o}=aY(rh,GE,KE,D0,vY);lM=i,XE=o,YE=!0}return rh[n]=xY(t,GE,KE,e,XE,D0,r),new yY(t)}function jY(t=dy()){t=ot(t);const e=zi(t,Rg);return e.isInitialized()?e.getImmediate():NY(t)}function NY(t,e={}){const r=zi(t,Rg);if(r.isInitialized()){const s=r.getImmediate();if(Go(e,r.getOptions()))return s;throw Pn.create("already-initialized")}return r.initialize({options:e})}function _Y(t,e,r,n){t=ot(t),pY(lM,rh[t.app.options.appId],e,r,n).catch(s=>gn.error(s))}const QE="@firebase/analytics",JE="0.10.8";function SY(){xa(new Qn(Rg,(e,{options:r})=>{const n=e.getProvider("app").getImmediate(),s=e.getProvider("installations-internal").getImmediate();return wY(n,s,r)},"PUBLIC")),xa(new Qn("analytics-internal",t,"PRIVATE")),pn(QE,JE),pn(QE,JE,"esm2017");function t(e){try{const r=e.getProvider(Rg).getImmediate();return{logEvent:(n,s,i)=>_Y(r,n,s,i)}}catch(r){throw Pn.create("interop-component-reg-failed",{reason:r})}}}SY();/**
4118 * @license
4119 * Copyright 2017 Google LLC
4120 *
4121 * Licensed under the Apache License, Version 2.0 (the "License");
4122 * you may not use this file except in compliance with the License.
4123 * You may obtain a copy of the License at
4124 *
4125 *   http://www.apache.org/licenses/LICENSE-2.0
4126 *
4127 * Unless required by applicable law or agreed to in writing, software
4128 * distributed under the License is distributed on an "AS IS" BASIS,
4129 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4130 * See the License for the specific language governing permissions and
4131 * limitations under the License.
4132 */const cM="firebasestorage.googleapis.com",uM="storageBucket",TY=2*60*1e3,AY=10*60*1e3;/**
4133 * @license
4134 * Copyright 2017 Google LLC
4135 *
4136 * Licensed under the Apache License, Version 2.0 (the "License");
4137 * you may not use this file except in compliance with the License.
4138 * You may obtain a copy of the License at
4139 *
4140 *   http://www.apache.org/licenses/LICENSE-2.0
4141 *
4142 * Unless required by applicable law or agreed to in writing, software
4143 * distributed under the License is distributed on an "AS IS" BASIS,
4144 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4145 * See the License for the specific language governing permissions and
4146 * limitations under the License.
4147 */class Ht extends Zn{constructor(e,r,n=0){super(M0(e),`Firebase Storage: ${r} (${M0(e)})`),this.status_=n,this.customData={serverResponse:null},this._baseMessage=this.message,Object.setPrototypeOf(this,Ht.prototype)}get status(){return this.status_}set status(e){this.status_=e}_codeEquals(e){return M0(e)===this.code}get serverResponse(){return this.customData.serverResponse}set serverResponse(e){this.customData.serverResponse=e,this.customData.serverResponse?this.message=`${this._baseMessage}
4148${this.customData.serverResponse}`:this.message=this._baseMessage}}var zt;(function(t){t.UNKNOWN="unknown",t.OBJECT_NOT_FOUND="object-not-found",t.BUCKET_NOT_FOUND="bucket-not-found",t.PROJECT_NOT_FOUND="project-not-found",t.QUOTA_EXCEEDED="quota-exceeded",t.UNAUTHENTICATED="unauthenticated",t.UNAUTHORIZED="unauthorized",t.UNAUTHORIZED_APP="unauthorized-app",t.RETRY_LIMIT_EXCEEDED="retry-limit-exceeded",t.INVALID_CHECKSUM="invalid-checksum",t.CANCELED="canceled",t.INVALID_EVENT_NAME="invalid-event-name",t.INVALID_URL="invalid-url",t.INVALID_DEFAULT_BUCKET="invalid-default-bucket",t.NO_DEFAULT_BUCKET="no-default-bucket",t.CANNOT_SLICE_BLOB="cannot-slice-blob",t.SERVER_FILE_WRONG_SIZE="server-file-wrong-size",t.NO_DOWNLOAD_URL="no-download-url",t.INVA
4148LID_ARGUMENT="invalid-argument",t.INVALID_ARGUMENT_COUNT="invalid-argument-count",t.APP_DELETED="app-deleted",t.INVALID_ROOT_OPERATION="invalid-root-operation",t.INVALID_FORMAT="invalid-format",t.INTERNAL_ERROR="internal-error",t.UNSUPPORTED_ENVIRONMENT="unsupported-environment"})(zt||(zt={}));function M0(t){return"storage/"+t}function D2(){const t="An unknown error occurred, please check the error payload for server response.";return new Ht(zt.UNKNOWN,t)}function EY(t){return new Ht(zt.OBJECT_NOT_FOUND,"Object '"+t+"' does not exist.")}function kY(t){return new Ht(zt.QUOTA_EXCEEDED,"Quota for bucket '"+t+"' exceeded, please view quota on https://firebase.google.com/pricing/.")}function PY(){const t="User is not authenticated, please authenticate using Firebase Authentication and try again.";return new Ht(zt.UNAUTHENTICATED,t)}function CY(){return new Ht(zt.UNAUTHORIZED_APP,"This app does not have permission to access Firebase Storage on this project.")}function IY(t){return new Ht(zt.UNAUTHORIZED,"User does not have permission to access '"+t+"'.")}function OY(){return new Ht(zt.RETRY_LIMIT_EXCEEDED,"Max retry time for operation exceeded, please try again.")}function RY(){return new Ht(zt.CANCELED,"User canceled the upload/download.")}function DY(t){return new Ht(zt.INVALID_URL,"Invalid URL '"+t+"'.")}function MY(t){return new Ht(zt.INVALID_DEFAULT_BUCKET,"Invalid default bucket '"+t+"'.")}function $Y(){return new Ht(zt.NO_DEFAULT_BUCKET,"No default bucket found. Did you set the '"+uM+"' property when initializing the app?")}function LY(){return new Ht(zt.CANNOT_SLICE_BLOB,"Cannot slice blob for upload. Please retry the upload.")}function FY(){return new Ht(zt.NO_DOWNLOAD_URL,"The given file does not have any download URLs.")}function BY(t){return new Ht(zt.UNSUPPORTED_ENVIRONMENT,`${t} is missing. Make sure to install the required polyfills. See https://firebase.google.com/docs/web/environments-js-sdk#polyfills for more information.`)}function Yw(t){return new Ht(zt.INVALID_ARGUMENT,t)}function dM(){return new Ht(zt.APP_DELETED,"The Firebase app was deleted.")}function VY(t){return new Ht(zt.INVALID_ROOT_OPERATION,"The operation '"+t+"' cannot be performed on a root reference, create a non-root reference using child, such as .child('file.png').")}function nh(t,e){return new Ht(zt.INVALID_FORMAT,"String does not match format '"+t+"': "+e)}function md(t){throw new Ht(zt.INTERNAL_ERROR,"Internal error: "+t)}/**
4149 * @license
4150 * Copyright 2017 Google LLC
4151 *
4152 * Licensed under the Apache License, Version 2.0 (the "License");
4153 * you may not use this file except in compliance with the License.
4154 * You may obtain a copy of the License at
4155 *
4156 *   http://www.apache.org/licenses/LICENSE-2.0
4157 *
4158 * Unless required by applicable law or agreed to in writing, software
4159 * distributed under the License is distributed on an "AS IS" BASIS,
4160 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4161 * See the License for the specific language governing permissions and
4162 * limitations under the License.
4163 */class En{constructor(e,r){this.bucket=e,this.path_=r}get path(){return this.path_}get isRoot(){return this.path.length===0}fullServerUrl(){const e=encodeURIComponent;return"/b/"+e(this.bucket)+"/o/"+e(this.path)}bucketOnlyServerUrl(){return"/b/"+encodeURIComponent(this.bucket)+"/o"}static makeFromBucketSpec(e,r){let n;try{n=En.makeFromUrl(e,r)}catch{return new En(e,"")}if(n.path==="")return n;throw MY(e)}static makeFromUrl(e,r){let n=null;const s="([A-Za-z0-9.\\-_]+)";function i(T){T.path.charAt(T.path.length-1)==="/"&&(T.path_=T.path_.slice(0,-1))}const o="(/(.*))?$",l=new RegExp("^gs://"+s+o,"i"),c={bucket:1,path:3};function u(T){T.path_=decodeURIComponent(T.path)}const d="v[A-Za-z0-9_]+",h=r.replace(/[.]/g,"\\."),m="(/([^?#]*).*)?$",p=new RegExp(`^https?://${h}/${d}/b/${s}/o${m}`,"i"),x={bucket:1,path:3},w=r===cM?"(?:storage.googleapis.com|storage.cloud.google.com)":r,g="([^?#]*)",v=new RegExp(`^https?://${w}/${s}/${g}`,"i"),y=[{regex:l,indices:c,postModify:i},{regex:p,indices:x,postModify:u},{regex:v,indices:{bucket:1,path:2},postModify:u}];for(let T=0;T<y.length;T++){const N=y[T],j=N.regex.exec(e);if(j){const _=j[N.indices.bucket];let S=j[N.indices.path];S||(S=""),n=new En(_,S),N.postModify(n);break}}if(n==null)throw DY(e);return n}}class UY{constructor(e){this.promise_=Promise.reject(e)}getPromise(){return this.promise_}cancel(e=!1){}}/**
4164 * @license
4165 * Copyright 2017 Google LLC
4166 *
4167 * Licensed under the Apache License, Version 2.0 (the "License");
4168 * you may not use this file except in compliance with the License.
4169 * You may obtain a copy of the License at
4170 *
4171 *   http://www.apache.org/licenses/LICENSE-2.0
4172 *
4173 * Unless required by applicable law or agreed to in writing, software
4174 * distributed under the License is distributed on an "AS IS" BASIS,
4175 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4176 * See the License for the specific language governing permissions and
4177 * limitations under the License.
4178 */function zY(t,e,r){let n=1,s=null,i=null,o=!1,l=0;function c(){return l===2}let u=!1;function d(...g){u||(u=!0,e.apply(null,g))}function h(g){s=setTimeout(()=>{s=null,t(p,c())},g)}function m(){i&&clearTimeout(i)}function p(g,...v){if(u){m();return}if(g){m(),d.call(null,g,...v);return}if(c()||o){m(),d.call(null,g,...v);return}n<64&&(n*=2);let y;l===1?(l=2,y=0):y=(n+Math.random())*1e3,h(y)}let x=!1;function w(g){x||(x=!0,m(),!u&&(s!==null?(g||(l=2),clearTimeout(s),h(0)):g||(l=1)))}return h(0),i=setTimeout(()=>{o=!0,w(!0)},r),w}function HY(t){t(!1)}/**
4179 * @license
4180 * Copyright 2017 Google LLC
4181 *
4182 * Licensed under the Apache License, Version 2.0 (the "License");
4183 * you may not use this file except in compliance with the License.
4184 * You may obtain a copy of the License at
4185 *
4186 *   http://www.apache.org/licenses/LICENSE-2.0
4187 *
4188 * Unless required by applicable law or agreed to in writing, software
4189 * distributed under the License is distributed on an "AS IS" BASIS,
4190 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4191 * See the License for the specific language governing permissions and
4192 * limitations under the License.
4193 */function qY(t){return t!==void 0}function WY(t){return typeof t=="object"&&!Array.isArray(t)}function M2(t){return typeof t=="string"||t instanceof String}function ZE(t){return $2()&&t instanceof Blob}function $2(){return typeof Blob<"u"}function ek(t,e,r,n){if(n<e)throw Yw(`Invalid value for '${t}'. Expected ${e} or greater.`);if(n>r)throw Yw(`Invalid value for '${t}'. Expected ${r} or less.`)}/**
4194 * @license
4195 * Copyright 2017 Google LLC
4196 *
4197 * Licensed under the Apache License, Version 2.0 (the "License");
4198 * you may not use this file except in compliance with the License.
4199 * You may obtain a copy of the License at
4200 *
4201 *   http://www.apache.org/licenses/LICENSE-2.0
4202 *
4203 * Unless required by applicable law or agreed to in writing, software
4204 * distributed under the License is distributed on an "AS IS" BASIS,
4205 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4206 * See the License for the specific language governing permissions and
4207 * limitations under the License.
4208 */function Ry(t,e,r){let n=e;return r==null&&(n=`https://${e}`),`${r}://${n}/v0${t}`}function hM(t){const e=encodeURIComponent;let r="?";for(const n in t)if(t.hasOwnProperty(n)){const s=e(n)+"="+e(t[n]);r=r+s+"&"}return r=r.slice(0,-1),r}var Co;(function(t){t[t.NO_ERROR=0]="NO_ERROR",t[t.NETWORK_ERROR=1]="NETWORK_ERROR",t[t.ABORT=2]="ABORT"})(Co||(Co={}));/**
4209 * @license
4210 * Copyright 2022 Google LLC
4211 *
4212 * Licensed under the Apache License, Version 2.0 (the "License");
4213 * you may not use this file except in compliance with the License.
4214 * You may obtain a copy of the License at
4215 *
4216 *   http://www.apache.org/licenses/LICENSE-2.0
4217 *
4218 * Unless required by applicable law or agreed to in writing, software
4219 * distributed under the License is distributed on an "AS IS" BASIS,
4220 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4221 * See the License for the specific language governing permissions and
4222 * limitations under the License.
4223 */function GY(t,e){const r=t>=500&&t<600,s=[408,429].indexOf(t)!==-1,i=e.indexOf(t)!==-1;return r||s||i}/**
4224 * @license
4225 * Copyright 2017 Google LLC
4226 *
4227 * Licensed under the Apache License, Version 2.0 (the "License");
4228 * you may not use this file except in compliance with the License.
4229 * You may obtain a copy of the License at
4230 *
4231 *   http://www.apache.org/licenses/LICENSE-2.0
4232 *
4233 * Unless required by applicable law or agreed to in writing, software
4234 * distributed under the License is distributed on an "AS IS" BASIS,
4235 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4236 * See the License for the specific language governing permissions and
4237 * limitations under the License.
4238 */class KY{constructor(e,r,n,s,i,o,l,c,u,d,h,m=!0){this.url_=e,this.method_=r,this.headers_=n,this.body_=s,this.successCodes_=i,this.additionalRetryCodes_=o,this.callback_=l,this.errorCallback_=c,this.timeout_=u,this.progressCallback_=d,this.connectionFactory_=h,this.retry=m,this.pendingConnection_=null,this.backoffId_=null,this.canceled_=!1,this.appDelete_=!1,this.promise_=new Promise((p,x)=>{this.resolve_=p,this.reject_=x,this.start_()})}start_(){const e=(n,s)=>{if(s){n(!1,new Wf(!1,null,!0));return}const i=this.connectionFactory_();this.pendingConnection_=i;const o=l=>{const c=l.loaded,u=l.lengthComputable?l.total:-1;this.progressCallback_!==null&&this.progressCallback_(c,u)};this.progressCallback_!==null&&i.addUploadProgressListener(o),i.send(this.url_,this.method_,this.body_,this.headers_).then(()=>{this.progressCallback_!==null&&i.removeUploadProgressListener(o),this.pendingConnection_=null;const l=i.getErrorCode()===Co.NO_ERROR,c=i.getStatus();if(!l||GY(c,this.additionalRetryCodes_)&&this.retry){const d=i.getErrorCode()===Co.ABORT;n(!1,new Wf(!1,null,d));return}const u=this.successCodes_.indexOf(c)!==-1;n(!0,new Wf(u,i))})},r=(n,s)=>{const i=this.resolve_,o=this.reject_,l=s.connection;if(s.wasSuccessCode)try{const c=this.callback_(l,l.getResponse());
4238qY(c)?i(c):i()}catch(c){o(c)}else if(l!==null){const c=D2();c.serverResponse=l.getErrorText(),this.errorCallback_?o(this.errorCallback_(l,c)):o(c)}else if(s.canceled){const c=this.appDelete_?dM():RY();o(c)}else{const c=OY();o(c)}};this.canceled_?r(!1,new Wf(!1,null,!0)):this.backoffId_=zY(e,r,this.timeout_)}getPromise(){return this.promise_}cancel(e){this.canceled_=!0,this.appDelete_=e||!1,this.backoffId_!==null&&HY(this.backoffId_),this.pendingConnection_!==null&&this.pendingConnection_.abort()}}class Wf{constructor(e,r,n){this.wasSuccessCode=e,this.connection=r,this.canceled=!!n}}function XY(t,e){e!==null&&e.length>0&&(t.Authorization="Firebase "+e)}function YY(t,e){t["X-Firebase-Storage-Version"]="webjs/"+(e??"AppManager")}function QY(t,e){e&&(t["X-Firebase-GMPID"]=e)}function JY(t,e){e!==null&&(t["X-Firebase-AppCheck"]=e)}function ZY(t,e,r,n,s,i,o=!0){const l=hM(t.urlParams),c=t.url+l,u=Object.assign({},t.headers);return QY(u,e),XY(u,r),YY(u,i),JY(u,n),new KY(c,t.method,u,t.body,t.successCodes,t.additionalRetryCodes,t.handler,t.errorHandler,t.timeout,t.progressCallback,s,o)}/**
4239 * @license
4240 * Copyright 2017 Google LLC
4241 *
4242 * Licensed under the Apache License, Version 2.0 (the "License");
4243 * you may not use this file except in compliance with the License.
4244 * You may obtain a copy of the License at
4245 *
4246 *   http://www.apache.org/licenses/LICENSE-2.0
4247 *
4248 * Unless required by applicable law or agreed to in writing, software
4249 * distributed under the License is distributed on an "AS IS" BASIS,
4250 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4251 * See the License for the specific language governing permissions and
4252 * limitations under the License.
4253 */function eQ(){return typeof BlobBuilder<"u"?BlobBuilder:typeof WebKitBlobBuilder<"u"?WebKitBlobBuilder:void 0}function tQ(...t){const e=eQ();if(e!==void 0){const r=new e;for(let n=0;n<t.length;n++)r.append(t[n]);return r.getBlob()}else{if($2())return new Blob(t);throw new Ht(zt.UNSUPPORTED_ENVIRONMENT,"This browser doesn't seem to support creating Blobs")}}function rQ(t,e,r){return t.webkitSlice?t.webkitSlice(e,r):t.mozSlice?t.mozSlice(e,r):t.slice?t.slice(e,r):null}/**
4254 * @license
4255 * Copyright 2021 Google LLC
4256 *
4257 * Licensed under the Apache License, Version 2.0 (the "License");
4258 * you may not use this file except in compliance with the License.
4259 * You may obtain a copy of the License at
4260 *
4261 *   http://www.apache.org/licenses/LICENSE-2.0
4262 *
4263 * Unless required by applicable law or agreed to in writing, software
4264 * distributed under the License is distributed on an "AS IS" BASIS,
4265 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4266 * See the License for the specific language governing permissions and
4267 * limitations under the License.
4268 */function nQ(t){if(typeof atob>"u")throw BY("base-64");return atob(t)}/**
4269 * @license
4270 * Copyright 2017 Google LLC
4271 *
4272 * Licensed under the Apache License, Version 2.0 (the "License");
4273 * you may not use this file except in compliance with the License.
4274 * You may obtain a copy of the License at
4275 *
4276 *   http://www.apache.org/licenses/LICENSE-2.0
4277 *
4278 * Unless required by applicable law or agreed to in writing, software
4279 * distributed under the License is distributed on an "AS IS" BASIS,
4280 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4281 * See the License for the specific language governing permissions and
4282 * limitations under the License.
4283 */const Ia={RAW:"raw",BASE64:"base64",BASE64URL:"base64url",DATA_URL:"data_url"};class $0{constructor(e,r){this.data=e,this.contentType=r||null}}function aQ(t,e){switch(t){case Ia.RAW:return new $0(mM(e));case Ia.BASE64:case Ia.BASE64URL:return new $0(fM(t,e));case Ia.DATA_URL:return new $0(iQ(e),oQ(e))}throw D2()}function mM(t){const e=[];for(let r=0;r<t.length;r++){let n=t.charCodeAt(r);if(n<=127)e.push(n);else if(n<=2047)e.push(192|n>>6,128|n&63);else if((n&64512)===55296)if(!(r<t.length-1&&(t.charCodeAt(r+1)&64512)===56320))e.push(239,191,189);else{const i=n,o=t.charCodeAt(++r);n=65536|(i&1023)<<10|o&1023,e.push(240|n>>18,128|n>>12&63,128|n>>6&63,128|n&63)}else(n&64512)===56320?e.push(239,191,189):e.push(224|n>>12,128|n>>6&63,128|n&63)}return new Uint8Array(e)}function sQ(t){let e;try{e=decodeURIComponent(t)}catch{throw nh(Ia.DATA_URL,"Malformed data URL.")}return mM(e)}function fM(t,e){switch(t){case Ia.BASE64:{const s=e.indexOf("-")!==-1,i=e.indexOf("_")!==-1;if(s||i)throw nh(t,"Invalid character '"+(s?"-":"_")+"' found: is it base64url encoded?");break}case Ia.BASE64URL:{const s=e.indexOf("+")!==-1,i=e.indexOf("/")!==-1;if(s||i)throw nh(t,"Invalid character '"+(s?"+":"/")+"' found: is it base64 encoded?");e=e.replace(/-/g,"+").replace(/_/g,"/");break}}let r;try{r=nQ(e)}
4283catch(s){throw s.message.includes("polyfill")?s:nh(t,"Invalid character found")}const n=new Uint8Array(r.length);for(let s=0;s<r.length;s++)n[s]=r.charCodeAt(s);return n}class pM{constructor(e){this.base64=!1,this.contentType=null;const r=e.match(/^data:([^,]+)?,/);if(r===null)throw nh(Ia.DATA_URL,"Must be formatted 'data:[<mediatype>][;base64],<data>");const n=r[1]||null;n!=null&&(this.base64=lQ(n,";base64"),this.contentType=this.base64?n.substring(0,n.length-7):n),this.rest=e.substring(e.indexOf(",")+1)}}function iQ(t){const e=new pM(t);return e.base64?fM(Ia.BASE64,e.rest):sQ(e.rest)}function oQ(t){return new pM(t).contentType}function lQ(t,e){return t.length>=e.length?t.substring(t.length-e.length)===e:!1}/**
4284 * @license
4285 * Copyright 2017 Google LLC
4286 *
4287 * Licensed under the Apache License, Version 2.0 (the "License");
4288 * you may not use this file except in compliance with the License.
4289 * You may obtain a copy of the License at
4290 *
4291 *   http://www.apache.org/licenses/LICENSE-2.0
4292 *
4293 * Unless required by applicable law or agreed to in writing, software
4294 * distributed under the License is distributed on an "AS IS" BASIS,
4295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4296 * See the License for the specific language governing permissions and
4297 * limitations under the License.
4298 */class si{constructor(e,r){let n=0,s="";ZE(e)?(this.data_=e,n=e.size,s=e.type):e instanceof ArrayBuffer?(r?this.data_=new Uint8Array(e):(this.data_=new Uint8Array(e.byteLength),this.data_.set(new Uint8Array(e))),n=this.data_.length):e instanceof Uint8Array&&(r?this.data_=e:(this.data_=new Uint8Array(e.length),this.data_.set(e)),n=e.length),this.size_=n,this.type_=s}size(){return this.size_}type(){return this.type_}slice(e,r){if(ZE(this.data_)){const n=this.data_,s=rQ(n,e,r);return s===null?null:new si(s)}else{const n=new Uint8Array(this.data_.buffer,e,r-e);return new si(n,!0)}}static getBlob(...e){if($2()){const r=e.map(n=>n instanceof si?n.data_:n);return new si(tQ.apply(null,r))}else{const r=e.map(o=>M2(o)?aQ(Ia.RAW,o).data:o.data_);let n=0;r.forEach(o=>{n+=o.byteLength});const s=new Uint8Array(n);let i=0;return r.forEach(o=>{for(let l=0;l<o.length;l++)s[i++]=o[l]}),new si(s,!0)}}uploadData(){return this.data_}}/**
4299 * @license
4300 * Copyright 2017 Google LLC
4301 *
4302 * Licensed under the Apache License, Version 2.0 (the "License");
4303 * you may not use this file except in compliance with the License.
4304 * You may obtain a copy of the License at
4305 *
4306 *   http://www.apache.org/licenses/LICENSE-2.0
4307 *
4308 * Unless required by applicable law or agreed to in writing, software
4309 * distributed under the License is distributed on an "AS IS" BASIS,
4310 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4311 * See the License for the specific language governing permissions and
4312 * limitations under the License.
4313 */function gM(t){let e;try{e=JSON.parse(t)}catch{return null}return WY(e)?e:null}/**
4314 * @license
4315 * Copyright 2017 Google LLC
4316 *
4317 * Licensed under the Apache License, Version 2.0 (the "License");
4318 * you may not use this file except in compliance with the License.
4319 * You may obtain a copy of the License at
4320 *
4321 *   http://www.apache.org/licenses/LICENSE-2.0
4322 *
4323 * Unless required by applicable law or agreed to in writing, software
4324 * distributed under the License is distributed on an "AS IS" BASIS,
4325 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4326 * See the License for the specific language governing permissions and
4327 * limitations under the License.
4328 */function cQ(t){if(t.length===0)return null;const e=t.lastIndexOf("/");return e===-1?"":t.slice(0,e)}function uQ(t,e){const r=e.split("/").filter(n=>n.length>0).join("/");return t.length===0?r:t+"/"+r}function xM(t){const e=t.lastIndexOf("/",t.length-2);return e===-1?t:t.slice(e+1)}/**
4329 * @license
4330 * Copyright 2017 Google LLC
4331 *
4332 * Licensed under the Apache License, Version 2.0 (the "License");
4333 * you may not use this file except in compliance with the License.
4334 * You may obtain a copy of the License at
4335 *
4336 *   http://www.apache.org/licenses/LICENSE-2.0
4337 *
4338 * Unless required by applicable law or agreed to in writing, softw
4338are
4339 * distributed under the License is distributed on an "AS IS" BASIS,
4340 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4341 * See the License for the specific language governing permissions and
4342 * limitations under the License.
4343 */function dQ(t,e){return e}class Yr{constructor(e,r,n,s){this.server=e,this.local=r||e,this.writable=!!n,this.xform=s||dQ}}let Gf=null;function hQ(t){return!M2(t)||t.length<2?t:xM(t)}function yM(){if(Gf)return Gf;const t=[];t.push(new Yr("bucket")),t.push(new Yr("generation")),t.push(new Yr("metageneration")),t.push(new Yr("name","fullPath",!0));function e(i,o){return hQ(o)}const r=new Yr("name");r.xform=e,t.push(r);function n(i,o){return o!==void 0?Number(o):o}const s=new Yr("size");return s.xform=n,t.push(s),t.push(new Yr("timeCreated")),t.push(new Yr("updated")),t.push(new Yr("md5Hash",null,!0)),t.push(new Yr("cacheControl",null,!0)),t.push(new Yr("contentDisposition",null,!0)),t.push(new Yr("contentEncoding",null,!0)),t.push(new Yr("contentLanguage",null,!0)),t.push(new Yr("contentType",null,!0)),t.push(new Yr("metadata","customMetadata",!0)),Gf=t,Gf}function mQ(t,e){function r(){const n=t.bucket,s=t.fullPath,i=new En(n,s);return e._makeStorageReference(i)}Object.defineProperty(t,"ref",{get:r})}function fQ(t,e,r){const n={};n.type="file";const s=r.length;for(let i=0;i<s;i++){const o=r[i];n[o.local]=o.xform(n,e[o.server])}return mQ(n,t),n}function vM(t,e,r){const n=gM(e);return n===null?null:fQ(t,n,r)}function pQ(t,e,r,n){const s=gM(e);if(s===null||!M2(s.downloadTokens))return null;const i=s.downloadTokens;if(i.length===0)return null;const o=encodeURIComponent;return i.split(",").map(u=>{const d=t.bucket,h=t.fullPath,m="/b/"+o(d)+"/o/"+o(h),p=Ry(m,r,n),x=hM({alt:"media",token:u});return p+x})[0]}function gQ(t,e){const r={},n=e.length;for(let s=0;s<n;s++){const i=e[s];i.writable&&(r[i.server]=t[i.local])}return JSON.stringify(r)}class L2{constructor(e,r,n,s){this.url=e,this.method=r,this.handler=n,this.timeout=s,this.urlParams={},this.headers={},this.body=null,this.errorHandler=null,this.progressCallback=null,this.successCodes=[200],this.additionalRetryCodes=[]}}/**
4344 * @license
4345 * Copyright 2017 Google LLC
4346 *
4347 * Licensed under the Apache License, Version 2.0 (the "License");
4348 * you may not use this file except in compliance with the License.
4349 * You may obtain a copy of the License at
4350 *
4351 *   http://www.apache.org/licenses/LICENSE-2.0
4352 *
4353 * Unless required by applicable law or agreed to in writing, software
4354 * distributed under the License is distributed on an "AS IS" BASIS,
4355 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4356 * See the License for the specific language governing permissions and
4357 * limitations under the License.
4358 */function bM(t){if(!t)throw D2()}function xQ(t,e){function r(n,s){const i=vM(t,s,e);return bM(i!==null),i}return r}function yQ(t,e){function r(n,s){const i=vM(t,s,e);return bM(i!==null),pQ(i,s,t.host,t._protocol)}return r}function wM(t){function e(r,n){let s;return r.getStatus()===401?r.getErrorText().includes("Firebase App Check token is invalid")?s=CY():s=PY():r.getStatus()===402?s=kY(t.bucket):r.getStatus()===403?s=IY(t.path):s=n,s.status=r.getStatus(),s.serverResponse=n.serverResponse,s}return e}function jM(t){const e=wM(t);function r(n,s){let i=e(n,s);return n.getStatus()===404&&(i=EY(t.path)),i.serverResponse=s.serverResponse,i}return r}function vQ(t,e,r){const n=e.fullServerUrl(),s=Ry(n,t.host,t._protocol),i="GET",o=t.maxOperationRetryTime,l=ne
4358w L2(s,i,yQ(t,r),o);return l.errorHandler=jM(e),l}function bQ(t,e){const r=e.fullServerUrl(),n=Ry(r,t.host,t._protocol),s="DELETE",i=t.maxOperationRetryTime;function o(c,u){}const l=new L2(n,s,o,i);return l.successCodes=[200,204],l.errorHandler=jM(e),l}function wQ(t,e){return t&&t.contentType||e&&e.type()||"application/octet-stream"}function jQ(t,e,r){const n=Object.assign({},r);return n.fullPath=t.path,n.size=e.size(),n.contentType||(n.contentType=wQ(null,e)),n}function NQ(t,e,r,n,s){const i=e.bucketOnlyServerUrl(),o={"X-Goog-Upload-Protocol":"multipart"};function l(){let y="";for(let T=0;T<2;T++)y=y+Math.random().toString().slice(2);return y}const c=l();o["Content-Type"]="multipart/related; boundary="+c;const u=jQ(e,n,s),d=gQ(u,r),h="--"+c+`\r
4359Content-Type: application/json; charset=utf-8\r
4360\r
4361`+d+`\r
4362--`+c+`\r
4363Content-Type: `+u.contentType+`\r
4364\r
4365`,m=`\r
4366--`+c+"--",p=si.getBlob(h,n,m);if(p===null)throw LY();const x={name:u.fullPath},w=Ry(i,t.host,t._protocol),g="POST",v=t.maxUploadRetryTime,b=new L2(w,g,xQ(t,r),v);return b.urlParams=x,b.headers=o,b.body=p.uploadData(),b.errorHandler=wM(e),b}class _Q{constructor(){this.sent_=!1,this.xhr_=new XMLHttpRequest,this.initXhr(),this.errorCode_=Co.NO_ERROR,this.sendPromise_=new Promise(e=>{this.xhr_.addEventListener("abort",()=>{this.errorCode_=Co.ABORT,e()}),this.xhr_.addEventListener("error",()=>{this.errorCode_=Co.NETWORK_ERROR,e()}),this.xhr_.addEventListener("load",()=>{e()})})}send(e,r,n,s){if(this.sent_)throw md("cannot .send() more than once");if(this.sent_=!0,this.xhr_.open(r,e,!0),s!==void 0)for(const i in s)s.hasOwnProperty(i)&&this.xhr_.setRequestHeader(i,s[i].toString());return n!==void 0?this.xhr_.send(n):this.xhr_.send(),this.sendPromise_}getErrorCode(){if(!this.sent_)throw md("cannot .getErrorCode() before sending");return this.errorCode_}getStatus(){if(!this.sent_)throw md("cannot .getStatus() before sending");try{return this.xhr_.status}catch{return-1}}getResponse(){if(!this.sent_)throw md("cannot .getResponse() before sending");return this.xhr_.response}getErrorText(){if(!this.sent_)throw md("cannot .getErrorText() before sending");return this.xhr_.statusText}abort(){this.xhr_.abort()}getResponseHeader(e){return this.xhr_.getResponseHeader(e)}addUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.addEventListener("progress",e)}removeUploadProgressListener(e){this.xhr_.upload!=null&&this.xhr_.upload.removeEventListener("progress",e)}}class SQ extends _Q{initXhr(){this.xhr_.responseType="text"}}function F2(){return new SQ}/**
4367 * @license
4368 * Copyright 2019 Google LLC
4369 *
4370 * Licensed under the Apache License, Version 2.0 (the "License");
4371 * you may not use this file except in compliance with the License.
4372 * You may obtain a copy of the License at
4373 *
4374 *   http://www.apache.org/licenses/LICENSE-2.0
4375 *
4376 * Unless required by applicable law or agreed to in writing, software
4377 * distributed under the License is distributed on an "AS IS" BASIS,
4378 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4379 * See the License for the specific language governing permissions and
4380 * limitations under the License.
4381 */class tl{constructor(e,r){this._service=e,r instanceof En?this._location=r:this._location=En.makeFromUrl(r,e.host)}toString(){return"gs://"+this._location.bucket+"/"+this._location.path}_newRef(e,r){return new tl(e,r)}get root(){const e=new En(this._location.bucket,"");return this._newRef(this._service,e)}get bucket(){return this._location.bucket}get fullPath(){return this._location.path}get name(){return xM(this._location.path)}get storage(){return this._service}get parent(){const e=cQ(this._location.path);if(e===null)return null;const r=new En(this._location.bucket,e);return new tl(this._service,r)}_throwIfRoot(e){if(this._location.path==="")throw VY(e)}}function TQ(t,e,r){t._throwIfRoot("uploadBytes");const n=NQ(t.storage,t._location,yM(),new si(e,!0),r);return t.storage.makeRequestWithTokens(n,F2).then(s=>({metadata:s,ref:t}))}function AQ(t){t._throwIfRoot("getDownloadURL");const e=vQ(t.storage,t._location,yM());return t.storage.makeRequestWithTokens(e,F2).then(r=>{if(r===null)throw FY();return r})}function EQ(t){t._throwIfRoot("deleteObject");const e=bQ(t.storage,t._location);return t.storage.makeRequestWithTokens(e,F2)}function kQ(t,e){const r=uQ(t._location.path,e),n=new En(t._location.bucket,r);return new tl(t.storage,n)}/**
4382 * @license
4383 * Copyright 2017 Google LLC
4384 *
4385 * Licensed under the Apache License, Version 2.0 (the "License");
4386 * you may not use this file except in compliance with the License.
4387 * You may obtain a copy of the License at
4388 *
4389 *   http://www.apache.org/licenses/LICENSE-2.0
4390 *
4391 * Unless required by applicable law or agreed to in writing, software
4392 * distributed under the License is distributed on an "AS IS" BASIS,
4393 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4394 * See the License for the specific language governing permissions and
4395 * limitations under the License.
4396 */function PQ(t){return/^[A-Za-z]+:\/\//.test(t)}function CQ(t,e){return new tl(t,e)}function NM(t,e){if(t instanceof B2){const r=t;if(r._bucket==null)throw $Y();const n=new tl(r,r._bucket);return e!=null?NM(n,e):n}else return e!==void 0?kQ(t,e):t}function IQ(t,e){if(e&&PQ(e)){if(t instanceof B2)return CQ(t,e);throw Yw("To use ref(service, url), the first argument must be a Storage instance.")}else return NM(t,e)}function tk(t,e){const r=e==null?void 0:e[uM];return r==null?null:En.makeFromBucketSpec(r,t)}function OQ(t,e,r,n={}){t.host=`${e}:${r}`,t._protocol="http";const{mockUserToken:s}=n;s&&(t._overrideAuthToken=typeof s=="string"?s:A3(s,t.app.options.projectId))}class B2{constructor(e,r,n,s,i){this.app=e,this._authProvider=r,this._appCheckProvider=n,this._url=s,this._firebaseVersion=i,this._bucket=null,this._host=cM,this._protocol="https",this._appId=null,this._deleted=!1,this._maxOperationRetryTime=TY,this._maxUploadRetryTime=AY,this._requests=new Set,s!=null?this._bucket=En.makeFromBucketSpec(s,this._host):this._bucket=tk(this._host,this.app.options)}get host(){return this._host}set host(e){this._host=e,this._url!=null?this._bucket=En.makeFromBucketSpec(this._url,e):this._bucket=tk(e,this.app.options)}get maxUploadRetryTime(){return this._maxUploadRetryTime}set maxUploadRetryTime(e){ek("time",0,Number.POSITIVE_INFINITY,e),this._maxUploadRetryTime=e}get maxOperationRetryTime(){return this._maxOperationRetryTime}set maxOperationRetryTime(e){ek("time",0,Number.POSITIVE_INFINITY,e),this._maxOperationRetryTime=e}async _getAuthToken(){if(this._overrideAuthToken)return this._overrideAuthToken;const e=this._authProvider.getImmediate({optional:!0});if(e){const r=await e.getToken();if(r!==null)return r.accessToken}return null}async _getAppCheckToken(){const e=this._appCheckProvider.getImmediate({optional:!0});return e?(await e.getToken()).token:null}_delete(){return this._deleted||(this._deleted=!0,this._requests.forEach(e=>e.cancel()),this._requests.clear()),Promise.resolve()}_makeStorageReference(e){return new tl(this,e)}_makeRequest(e,r,n,s,i=!0){if(this._deleted)return new UY(dM());{const o=ZY(e,this._appId,n,s,r,this._firebaseVersion,i);return this._requests.add(o),o.getPromise().then(()=>this._requests.delete(o),()=>this._requests.delete(o)),o}}async makeRequestWithTokens(e,r){const[n,s]=await Promise.all([this._getAuthToken(),this._getAppCheckToken()]);return this._makeRequest(e,r,n,s).getPromise()}}const rk="@firebase/storage",nk="0.13.2";/**
4397 * @license
4398 * Copyright 2020 Google LLC
4399 *
4400 * Licensed under the Apache License, Version 2.0 (the "License");
4401 * you may not use this file except in compliance with the License.
4402 * You may obtain a copy of the License at
4403 *
4404 *   http://www.apache.org/licenses/LICENSE-2.0
4405 *
4406 * Unless required by applicable law or agreed to in writing, software
4407 * distributed under the License is distributed on an "AS IS" BASIS,
4408 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4409 * See the License for the specific language governing permissions and
4410 * limitations under the License.
4411 */const _M="storage";function RQ(t,e,r){return t=ot(t),TQ(t,e,r)}function DQ(t){return t=ot(t),AQ(t)}function MQ(t){return t=ot(t),EQ(t)}function ak(t,e){return t=ot(t),IQ(t,e)}function $Q(t=dy(),e){t=ot(t);const n=zi(t,_M).getImmediate({identifier:e}),s=_3("storage");return s&&LQ(n,...s),n}function LQ(t,e,r,n={}){OQ(t,e,r,n)}function FQ(t,{instanceIdentifier:e}){const r=t.getProvider("app").getImmediate(),n=t.getProvider("auth-internal"),s=t.getProvider("app-check-internal");return new B2(r,n,s,e,xl)}function BQ(){xa(new Qn(_M,FQ,"PUBLIC").setMultipleInstances(!0)),pn(rk,nk,""),pn(rk,nk,"esm2017")}BQ();const VQ={apiKey:"AIzaSyAR04znEACnlhBx-3oJKPPM77wch8q8o24",authDomain:"xponentiaapp.firebaseapp.com",databaseURL:"https://xponentiaapp-default-rtdb.europe-west1.firebasedatabase.app",projectId:"xponentiaapp",storageBucket:"xponentiaapp.firebasestorage.app",messagingSenderId:"190391417755",appId:"1:190391417755:web:777ba877403834eab87f3e",measurementId:"G-0E56ZTTM8C"};let fd,ii,oe,Qw,UQ;try{fd=R3(VQ),ii=iW(fd),oe=XK(fd),Qw=$Q(fd),UQ=jY(fd),console.log("Firebase initialized successfully")}catch(t){throw console.error("Failed to initialize Firebase:",t),new Error("Firebase initialization failed. Please check your internet connection and try again.")}Be(oe,"blogPosts");Be(oe,"spaces");Be(oe,"rooms");Be(oe,"events");Be(oe,"bookings");Be(oe,"users");Be(oe,"promoCodes");const Ls=Be(oe,"pageViews"),Dy=Be(oe,"activeVisitors");Be(oe,"analyticsDaily");const zQ=[{id:"hot-desk",label:"Hot Desk"},{id:"dedicated-desk",label:"Dedicated Desk"},{id:"private-office",label:"Private Office"}],HQ=[{id:"day",label:"Day"},{id:"week",label:"Week"},{id:"ten-days",label:"10 Days"},{id:"half-month",label:"Half Month"},{id:"month",label:"Month"}],qQ=[{id:"business-hours",label:"8:00-17:00 on weekdays"},{id:"extended-hours",label:"7:00-22:00 on weekdays"},{id:"weekends",label:"9:00-18:00 including weekends"},{id:"24-7",label:"24/7 Access"}],Jw={"hot-desk":["Adjustable Desk","Power Outlets","Ergonomic Chair","Natural Light","Standing Desk Option","Task Lighting"],"dedicated-desk":["Ergonomic Chair","Adjustable Desk","Storage Locker","Monitor Support","Natural Light","Power Outlets","Whiteboard Access","Soundproof Space","Standing Desk Option","Privacy Screens","Cable Management","Task Lighting"],"private-office":["Ergonomic Chairs","Adjustable Desks","Private Storage","Monitor Support","Natural Light","Power Outlets","Whiteboard","Soundproof Walls","Meeting Area","Privacy Blinds","Cable Management","Custom Lighting"]},Zw={"hot-desk":["High-speed WiFi connection","Shared kitchen with water, coffee, and tea","Office supplies and printer access","Lounge Area","Phone Booths","Bike Storage"],"dedicated-desk":["High-speed WiFi connection","Office supplies, stationery, and printer access","Cleaning, utilities, and maintenance services","Shared kitchen with water, coffee, and tea","Reception Services","Security System","Mail Handling","Natural Light","Lockers","Outdoor Terrace","Bike Storage","Business Address Service"],"private-office":["High-speed WiFi connection","Dedicated printer and office supplies","Daily cleaning service","Kitchen access","Reception Services","24/7 Security","Mail Handling","Meeting Room Credits","Storage Space","Outdoor Terrace Access","Parking Options","Business Address"]};Array.from(new Set(Object.values(Jw).flat()));Array.from(new Set(Object.values(Zw).flat()));const SM=P.createContext(void 0);function WQ({children:t}){const[e,r]=P.useState(null),[n,s]=P.useState(null),[i,o]=P.useState(!0),l=async()=>
4411{if(e)try{const g=await Vh(Te(oe,"users",e.uid));if(g.exists()){const v=g.data();s(v),console.log("🔄 User profile refreshed:",{meetingRoomHours:v.meetingRoomHours,usedMeetingRoomHours:v.usedMeetingRoomHours,totalMeetingRoomHours:v.totalMeetingRoomHours})}}catch(g){console.error("Error refreshing user profile:",g)}};P.useEffect(()=>KH(ii,async v=>{if(r(v),v){const b=await Vh(Te(oe,"users",v.uid));b.exists()&&s(b.data())}else s(null);o(!1)}),[]);const c=async(g,v)=>{await HH(ii,g,v)},u=async(g,v,b)=>{const y=await zH(ii,g,v),{user:T}=y;if(b){let N="";b.accountType==="individual"?N=`${b.firstName} ${b.lastName}`:N=b.companyName||"Company User",await WA(T,{displayName:N});const j={accountType:b.accountType,displayName:N,email:T.email||"",phone:b.phone||"",linkedinProfile:"",status:"active",joinDate:new Date().toISOString(),subscription:"none",hasPaymentMethod:!1,meetingRoomHours:0,totalMeetingRoomHours:0,usedMeetingRoomHours:0,company:{name:"",type:"",position:"",industry:"",size:"",website:"",country:"",county:"",cui:"",linkedinProfile:""}};b.accountType==="individual"?(j.firstName=b.firstName,j.lastName=b.lastName,j.cnp=b.cnp,j.city=b.city,j.county=b.county):j.company={name:b.companyName||"",type:b.companyType||"",position:b.position||"",industry:b.industry||"",size:b.companySize||"",website:b.website||"",country:b.country||"",county:b.county||"",cui:b.cui||"",linkedinProfile:b.linkedinProfile||""},await LD(Te(oe,"users",T.uid),j),s(j)}},d=async()=>{await XH(ii),s(null)},h=async g=>{await UH(ii,g)},m=async g=>{if(!e)throw new Error("No user logged in");const v=Te(oe,"users",e.uid);if(await Je(v,g),g.firstName&&g.lastName&&(n==null?void 0:n.accountType)==="individual"){const b=`${g.firstName} ${g.lastName}`;await WA(e,{displayName:b}),await Je(v,{displayName:b})}s(b=>b?{...b,...g}:null)},p=async g=>{if(!e)throw new Error("No user logged in");const v=Te(oe,"users",e.uid);await Je(v,{company:g}),s(b=>b?{...b,company:{...b.company,...g}}:null)},x=async g=>{if(!e||!n)throw new Error("No user logged in");const v=n.totalMeetingRoomHours+g,b=n.meetingRoomHours+g,y={totalMeetingRoomHours:v,meetingRoomHours:b},T=Te(oe,"users",e.uid);await Je(T,y),s(N=>N?{...N,...y}:null)},w=async g=>{if(!e||!n)throw new Error("No user logged in");if(n.meetingRoomHours<g)return!1;const v=n.meetingRoomHours-g,b=n.usedMeetingRoomHours+g,y={meetingRoomHours:v,usedMeetingRoomHours:b};console.log("🔄 Using meeting room hours:",{hoursToUse:g,oldRemaining:n.meetingRoomHours,oldUsed:n.usedMeetingRoomHours,newRemaining:v,newUsed:b});const T=Te(oe,"users",e.uid);return await Je(T,y),s(N=>N?{...N,...y}:null),setTimeout(()=>l(),1e3),!0};return a.jsx(SM.Provider,{value:{user:e,userProfile:n,loading:i,signIn:c,signUp:u,signOut:d,resetPassword:h,updateUserProfile:m,updateCompanyInfo:p,addMeetingRoomHours:x,useMeetingRoomHours:w,refreshUserProfile:l},children:t})}function br(){const t=P.useContext(SM);if(t===void 0)throw new Error("useAuth must be used within an AuthProvider");return t}const sk=[{label:"Home",href:"#home",route:"/"},{label:"Xponential",href:"#about",route:"/about"},{label:"Services",href:"#services",route:"/services"},{label:"Virtual Tour",href:"#virtual-tour",route:"/virtual-tour"},{label:"Blog",href:"#blog",route:"/blog"},{label:"Contact",href:"#contact",route:"/contact"}];function GQ({className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.33 6.33 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.69a8.14 8.14 0 0 0 4.77 1.53V6.75a4.85 4.85 0 0 1-1-.06z"})})}function Gm({onBookTour:t}){const[e,r]=P.useState(!1),[n,s]=P.useState(!1),i=cr(),{user:o}=br();return P.useEffect(()=>{const l=()=>r(window.scrollY>40);return window.addEventListener("scroll",l,{passive:!0}),()=>window.removeEventListener("scroll",l)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bg-[#194b66] text-white text-sm",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-2.5 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[a.jsx("a",{href:"https://www.facebook.com/xponentialtransylvania",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors flex items-center",children:a.jsx(wu,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.instagram.com/xponential.office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors flex items-center",children:a.jsx(ju,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.linkedin.com/company/xponential-transylvania-co-working-office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors flex items-center",children:a.jsx(pl,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.tiktok.com/@xponential.office",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors flex items-center",children:a.jsx(GQ,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"hidden md:flex items-center gap-6 text-white/80",children:[a.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#F4C533] transition-colors flex items-center leading-none",children:"[email protected]"}),a.jsx("span",{className:"w-px h-3 bg-white/40 block"}),a.jsxs("button",{onClick:()=>
4411i(o?"/profile":"/login"),className:"hover:text-[#F4C533] transition-colors flex items-center gap-1.5 leading-none text-white/80",children:[a.jsx(bA,{className:"w-4 h-4"}),a.jsx("span",{children:o?"Profile":"Sign In"})]})]}),a.jsx("button",{onClick:()=>i(o?"/profile":"/login"),className:"md:hidden text-white/80 hover:text-[#F4C533] transition-colors flex items-center",children:a.jsx(bA,{className:"w-5 h-5"})})]})}),a.jsxs("nav",{className:`sticky top-0 z-50 bg-white transition-shadow duration-300 ${e?"shadow-md":""}`,children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsx(st,{to:"/",className:"flex items-center gap-2 flex-shrink-0",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential Transylvania | Coworking Cluj-Napoca",className:"h-10 w-auto"})}),a.jsx("div",{className:"hidden lg:flex items-center gap-1",children:sk.map(l=>a.jsx(st,{to:l.route,className:"px-4 py-2 text-sm font-semibold text-[#194b66] hover:text-[#3ea2da] transition-colors uppercase tracking-wide",children:l.label},l.href))}),a.jsxs("div",{className:"flex items-center gap-2 sm:gap-3",children:[a.jsx(st,{to:"/spaces",className:"inline-flex items-center px-4 py-2 sm:px-5 sm:py-2 bg-[#3ea2da] hover:bg-[#194b66] text-white text-xs sm:text-sm font-semibold rounded-lg transition-colors duration-200 uppercase tracking-wide whitespace-nowrap",children:"Book Now"}),a.jsx("button",{onClick:()=>s(!n),className:"lg:hidden p-2 text-[#194b66]",children:n?a.jsx(Ge,{className:"w-6 h-6"}):a.jsx(oy,{className:"w-6 h-6"})})]})]})}),n&&a.jsx("div",{className:"lg:hidden bg-white border-t border-gray-100 shadow-lg max-h-[80vh] overflow-y-auto",children:a.jsxs("div",{className:"px-4 py-3 space-y-1",children:[sk.map(l=>a.jsx(st,{to:l.route,onClick:()=>s(!1),className:"block w-full text-left px-4 py-3.5 text-sm font-semibold text-[#194b66] hover:bg-[#f0f7fc] hover:text-[#3ea2da] rounded-lg transition-colors uppercase tracking-wide",children:l.label},l.href)),a.jsx(st,{to:"/spaces",onClick:()=>s(!1),className:"block w-full mt-2 text-center px-4 py-3.5 bg-[#3ea2da] text-white font-semibold rounded-lg uppercase tracking-wide",children:"Book Now"}),a.jsxs("div",{className:"pt-3 mt-2 border-t border-gray-100 space-y-2",children:[a.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 px-4 py-2 text-sm text-gray-500 hover:text-[#3ea2da] transition-colors",children:[a.jsx("span",{className:"text-[#3ea2da]",children:"@"})," [email protected]"]}),a.jsxs("a",{href:"tel:+40744659659",className:"flex items-center gap-2 px-4 py-2 text-sm text-gray-500 hover:text-[#3ea2da] transition-colors",children:[a.jsx("span",{className:"text-[#3ea2da]",children:"✆"})," +40 744 659 659"]})]})]})})]})]})}const L0=[{url:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Ffokepenyok%2F1.jpg?alt=media&token=c5f492b9-582a-4b9a-ac29-4f0b07326346",alt:"Xponential coworking space in central Cluj-Napoca"},{url:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Ffokepenyok%2F2.jpg?alt=media&token=abf9a6a0-2c45-460f-b897-47f4440a4bc9",alt:"Private office at Xponential Transylvania Cluj-Napoca"},{url:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Ffokepenyok%2F3.jpg?alt=media&token=78847314-fa9b-4375-8be1-8d19ae94cf12",alt:"Collaborative workspace at Xponential coworking Cluj-Napoca"}];function KQ({onBookTour:t}){const[e,r]=P.useState(0),n=cr();P.useEffect(()=>{const i=setInterval(()=>{r(o=>(o+1)%L0.length)},5e3);return()=>clearInterval(i)},[]);const s=()=>{const i=document.getElementById("workspaces");i&&i.scrollIntoView({behavior:"smooth"})};return a.jsxs("section",{id:"home",className:"relative h-screen min-h-[500px] sm:min-h-[600px] lg:min-h-[640px] flex items-center overflow-hidden",children:[L0.map((i,o)=>a.jsx("div",{className:`absolute inset-0 transition-opacity duration-1500 ${o===e?"opacity-100":"opacity-0"}`,children:a.jsx("img",{src:i.url,alt:i.alt,loading:o===0?"eager":"lazy",className:"w-full h-full object-cover scale-105",style:{transform:o===e?"scale(1)":"scale(1.05)",transition:"transform 6s ease-out"}})},o)),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-r from-[#0d3347]/95 via-[#194b66]/80 to-[#194b66]/30"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/60 via-trans
4411parent to-transparent"}),a.jsx("div",{className:"relative z-10 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 w-full",children:a.jsxs("div",{className:"max-w-3xl",children:[a.jsxs("div",{className:"flex items-center gap-4 mb-5 sm:mb-8",children:[a.jsx("div",{className:"h-px w-8 sm:w-10 bg-[#F4C533]"}),a.jsx("span",{className:"text-[#F4C533] text-xs font-bold uppercase tracking-[0.25em]",children:"Xponential Transylvania"})]}),a.jsxs("h1",{className:"leading-none mb-5 sm:mb-8",children:[a.jsx("span",{className:"block font-black text-white",style:{fontSize:"clamp(2.5rem, 10vw, 7rem)",letterSpacing:"-0.02em"},children:"Xponential"}),a.jsx("span",{className:"block font-light text-[#3ea2da] uppercase tracking-widest",style:{fontSize:"clamp(1.25rem, 5vw, 3.5rem)"},children:"Office & Coworking | Cluj-Napoca"})]}),a.jsx("p",{className:"text-white/75 text-sm sm:text-base lg:text-lg leading-relaxed mb-7 sm:mb-10 max-w-lg font-light",children:"A modern coworking space in the heart of Cluj-Napoca, built for entrepreneurs, freelancers, and growing teams."}),a.jsxs("div",{className:"flex flex-wrap gap-3 sm:gap-4",children:[a.jsxs("button",{onClick:()=>n("/booking"),className:"group px-5 py-3 sm:px-8 sm:py-4 bg-[#3ea2da] hover:bg-white text-white hover:text-[#194b66] font-bold rounded-xl transition-all duration-300 uppercase tracking-wide text-sm flex items-center gap-2",children:["Book Now",a.jsx("span",{className:"group-hover:translate-x-1 transition-transform duration-200 inline-block",children:"→"})]}),a.jsx("button",{onClick:()=>{const i=document.getElementById("virtual-tour");i&&i.scrollIntoView({behavior:"smooth"})},className:"px-5 py-3 sm:px-8 sm:py-4 border border-white/30 hover:border-white/70 hover:bg-white/10 text-white font-semibold rounded-xl transition-all duration-300 uppercase tracking-wide text-sm backdrop-blur-sm",children:"Virtual Tour"})]})]})}),a.jsx("div",{className:"absolute bottom-6 sm:bottom-10 left-1/2 -translate-x-1/2 z-10",children:a.jsxs("button",{onClick:s,className:"flex flex-col items-center gap-2 text-white/50 hover:text-white transition-colors group",children:[a.jsx("span",{className:"text-xs uppercase tracking-widest font-medium opacity-0 group-hover:opacity-100 transition-opacity",children:"Scroll"}),a.jsx(zo,{className:"w-6 h-6 animate-bounce"})]})}),a.jsx("div",{className:"absolute bottom-5 right-4 sm:bottom-8 sm:right-8 z-10 flex items-center gap-3",children:L0.map((i,o)=>a.jsx("button",{onClick:()=>r(o),className:`transition-all duration-500 rounded-full ${o===e?"w-8 h-1.5 bg-[#F4C533]":"w-1.5 h-1.5 bg-white/30 hover:bg-white/60"}`},o))})]})}const XQ=[{value:34,suffix:"+",label:"Coworking Desks"},{value:4,suffix:"",label:"Meeting Rooms"},{value:1,suffix:"",label:"Conference Hall"},{value:2,suffix:"",label:"Phone Booths"}];function YQ({target:t,suffix:e}){const[r,n]=P.useState(0),s=P.useRef(null),i=P.useRef(!1);return P.useEffect(()=>{const o=new IntersectionObserver(([l])=>{if(l.isIntersecting&&!i.current){i.current=!0;const c=1600,u=Date.now(),d=()=>{const h=Date.now()-u,m=Math.min(h/c,1),p=1-Math.pow(1-m,3);n(Math.floor(p*t)),m<1&&requestAnimationFrame(d)};requestAnimationFrame(d)}},{threshold:.3});return s.current&&o.observe(s.current),()=>o.disconnect()},[t]),a.jsxs("span",{ref:s,children:[r,e]})}function QQ(t){return t===0?"border-r border-white/10":t===1?"border-r-0 lg:border-r border-white/10 border-t-0 lg:border-t-0":t===2?"border-r border-white/10 border-t border-white/10 lg:border-t-0":"border-t border-white/10 lg:border-t-0"}function JQ(){return a.jsx("section",{className:"bg-[#0d3347] py-10 sm:py-14 lg:py-16",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsx("div",{className:"grid grid-cols-2 lg:grid-cols-4",children:XQ.map((t,e)=>a.jsxs("div",{className:`flex flex-col items-center justify-center py-6 px-4 sm:py-8 sm:px-6 text-center ${QQ(e)}`,children:[a.jsx("div",{className:"font-black text-white leading-none mb-2 sm:mb-3",style:{fontSize:"clamp(2.25rem, 7vw, 5rem)",letterSpacing:"-0.03em"},children:a.jsx(YQ,{target:t.value,suffix:t.suffix})}),a.jsx("div",{className:"text-white/40 text-[10px] sm:text-xs uppercase tracking-[0.15em] sm:tracking-[0.2em] font-semibold",children:t.label})]},t.label))})})})}function rl({src:t,alt:e,className:r="",style:n,...s}){const[i,o]=P.useState(!1);return a.jsx("img",{src:t,alt:e,loading:"lazy",decoding:"async",onLoad:()=>o(!0),className:`transition-opacity duration-700 ${i?"opacity-100":"opacity-0"} ${r}`,style:n,...s})}const ZQ=[{title:"Private Offices",alt:"Private office space at Xponential Cluj-Napoca",image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fhelysigek%2FIroda.jpg?alt=media&token=50f470bf-2004-4665-9097-82bc3e8b76c2",tabIndex:0},{title:"Coworking",alt:"Coworking desk space in central Cluj-Napoca",image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fhelysigek%2FDD.jpg?alt=media&token=6e695701-50a8-4adf-a362-3746baec2f46",tabIndex:1},{title:"Meeting Rooms",alt:"Meeting room rental at Xponential Cluj-Napoca",image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fhelysigek%2FMeeting%20room_.jpg?alt=media&token=1bd42069
4411-ca4d-4419-8bca-a9b2133f41d1",tabIndex:2},{title:"Event Hall",alt:"Event hall and conference space in Cluj-Napoca",image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fhelysigek%2FEvent.jpg?alt=media&token=bc449035-6129-42be-aeb5-8eb24692af87",tabIndex:3}],eJ=[{name:"Szőcs Endre",role:"Executive Director",bio:"I focus on shaping the strategic direction and long-term development of our community and workspace. My goal is to create an environment where entrepreneurs, freelancers, and companies can connect, collaborate, and grow. I'm passionate about building meaningful partnerships and continuously developing Xponential into a hub for innovation and professional collaboration.",linkedin:"https://www.linkedin.com/in/szocsendre/",index:"01",photo:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Femberek%2FXpo-76.jpg?alt=media&token=cda7259b-a83e-47b0-b645-3dd385236814"},{name:"Fodor Attila",role:"Sales Manager",bio:"I help individuals, startups, and companies find the workspace that suits them best. From the first visit to building long-term partnerships, I enjoy guiding people through what our community has to offer. My goal is to make sure every client feels welcome and finds the right place to work, collaborate, and grow.",linkedin:"https://www.linkedin.com/in/attila-fodor-aa9200b5/",index:"02",photo:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Femberek%2FXpo-98.jpg?alt=media&token=5d644b53-f87a-49f7-9610-d4827a2fd67b"},{name:"Mihály Anna",role:"Back Office Manager",bio:"I work as the Back Office Manager, making sure the daily operations run smoothly behind the scenes. From managing contracts and administrative tasks to supporting the team's workflow, I focus on keeping everything organized and efficient. I enjoy creating a structured environment where both our team and our members can work comfortably and productively.",linkedin:"https://www.linkedin.com/in/anna-mih%C3%A1ly-823057290/",index:"03",photo:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Femberek%2FXpo-23%20(1).jpg?alt=media&token=0208be80-3746-40b1-9b9e-31eaa19cea7d"},{name:"Kocsis Csongor",role:"Community Manager",bio:"My role is to build and support the community that makes this space special. I help connect members, manage our communication channels, and contribute to creating a welcoming and active atmosphere. Whether it's through events, conversations, or social media, my goal is to make sure everyone feels part of a supportive and inspiring community.",linkedin:"https://www.linkedin.com/in/csongor-kocsis-942545345/",index:"04",photo:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Femberek%2FCsongi.jpg?alt=media&token=a41d22b1-9814-4484-b653-eed1c24aa07d"}];function TM({onServiceTabClick:t}={}){const[e,r]=P.useState(null),n=s=>{if(t)t(s);else{window.dispatchEvent(new CustomEvent("selectServiceTab",{detail:{tabIndex:s}}));const i=document.getElementById("services");i&&i.scrollIntoView({behavior:"smooth"})}};return a.jsx("section",{id:"workspaces",className:"py-14 sm:py-20 lg:py-24 bg-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsx("div",{className:"flex flex-col lg:flex-row lg:items-end justify-between mb-8 sm:mb-10 lg:mb-14 gap-4 sm:gap-6",children:a.jsxs("div",{children:[a.jsx("div",{className:"h-px w-12 bg-[#F4C533] mb-5"}),a.jsx("h2",{className:"font-black text-[#0d3347] leading-none",style:{fontSize:"clamp(1.75rem, 6vw, 4.5rem)",letterSpacing:"-0.02em"},children:"Our Workspaces"})]})}),a.jsx("div",{className:"grid grid-cols-2 gap-4 mb-4",children:ZQ.map(s=>a.jsxs("div",{className:"group relative rounded-2xl overflow-hidden cursor-pointer min-h-48 sm:min-h-64 lg:min-h-[300px] bg-gray-200",onClick:()=>n(s.tabIndex),children:[a.jsx("div",{className:"absolute inset-0 scale-[1.6] group-hover:scale-[1.7] transition-transform duration-700",style:{transformOrigin:"50% 15%"},children:a.jsx(rl,{src:s.image,alt:s.alt,className:"w-full h-full object-cover",style:{objectPosition:"50% 15%"}})}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/85 via-[#0d3347]/30 to-transparent"}),a.jsxs("div",{className:"absolute inset-0 flex flex-col justify-end p-4 sm:p-5 lg:p-7",children:[a.jsx("h3",{className:"text-white font-black text-lg sm:text-xl lg:text-2xl leading-tight mb-2 sm:mb-3",style:{letterSpacing:"-0.02em"},children:s.title}),a.jsxs("button",{className:"self-start flex items-center gap-1.5 text-white/70 hover:text-[#F4C533] text-xs font-semibold uppercase tracking-wider transition-colors group/btn",children:["Details ",a.jsx(gs,{className:"w-3 h-3 group-hover/btn:translate-x-1 transition-transform"})]})]})]},s.title))}),a.jsxs("div",{className:"mt-16 sm:mt-24 lg:mt-32",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-end justify-between mb-8 sm:mb-12 lg:mb-16 gap-4 sm:gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"h-px w-12 bg-[#F4C533] mb
4411-5"}),a.jsx("h2",{className:"font-black text-[#0d3347] leading-none",style:{fontSize:"clamp(1.75rem, 6vw, 4.5rem)",letterSpacing:"-0.02em"},children:"Meet the Team"})]}),a.jsx("p",{className:"text-gray-400 text-base lg:max-w-sm leading-relaxed font-light",children:"Behind Xponential Transylvania is a team dedicated to creating a professional and inspiring workspace for entrepreneurs, freelancers, and companies in central Cluj-Napoca."})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:eJ.map(s=>a.jsxs("div",{className:"group relative py-5 sm:py-7 lg:py-8 pl-4 md:pl-0 grid grid-cols-[auto_auto_1fr_auto] md:grid-cols-12 gap-x-3 gap-y-1 md:gap-x-8 md:gap-y-0 items-center cursor-default",onMouseEnter:()=>r(s.name),onMouseLeave:()=>r(null),children:[a.jsx("div",{className:"absolute left-0 top-0 bottom-0 w-0.5 transition-all duration-300 rounded-full",style:{backgroundColor:e===s.name?"#F4C533":"#f3f4f6"}}),a.jsx("div",{className:"order-1 md:order-none md:col-span-1 text-gray-200 font-black text-lg md:text-3xl select-none",style:{letterSpacing:"-0.02em"},children:s.index}),a.jsx("div",{className:"order-2 md:order-none md:col-span-1 flex items-center",children:a.jsx("div",{className:"w-20 h-20 sm:w-24 sm:h-24 rounded-full overflow-hidden border-2 border-gray-100 group-hover:border-[#F4C533] transition-colors duration-300 flex-shrink-0 bg-gray-200",children:a.jsx(rl,{src:s.photo,alt:s.name,className:"w-full h-full object-cover object-top"})})}),a.jsx("div",{className:"order-3 md:order-none md:col-span-3",children:a.jsx("h3",{className:"font-black text-[#0d3347] leading-tight transition-colors duration-200 group-hover:text-[#194b66]",style:{fontSize:"clamp(1.1rem, 2.5vw, 1.875rem)",letterSpacing:"-0.02em"},children:s.name})}),a.jsx("div",{className:"order-4 md:order-none md:col-span-1 flex md:justify-end",children:a.jsx("a",{href:s.linkedin,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-full border border-gray-200 flex items-center justify-center hover:bg-[#194b66] hover:border-[#194b66] transition-all duration-200 group/link",children:a.jsx(pl,{className:"w-4 h-4 text-gray-400 group-hover/link:text-white transition-colors"})})}),a.jsx("div",{className:"order-5 md:order-none col-span-4 md:col-span-2",children:a.jsx("span",{className:"text-xs font-bold text-[#3ea2da] uppercase tracking-widest",children:s.role})}),a.jsx("div",{className:"order-6 md:order-none col-span-4 md:col-span-4",children:a.jsx("p",{className:"text-gray-400 text-sm leading-relaxed font-light",children:s.bio})})]},s.name))})]})]})})}const tJ=[{label:"Location",value:"Central Cluj-Napoca",detail:"Bulevardul 21 Decembrie 1989, No. 16 — in the heart of the city."},{label:"Flexibility",value:"Any plan, any size",detail:"Daily passes, monthly memberships, private offices — built around you."},{label:"Community",value:"More than a desk",detail:"A professional network of entrepreneurs, freelancers, and startups."}],rJ=["Private Offices","Coworking Desks","Meeting Rooms","Conference Hall","Event Spaces","Phone Booths"];function AM({onBookTour:t,onContact:e}){const r=()=>{if(e)e();else{const n=document.getElementById("contact");n&&n.scrollIntoView({behavior:"smooth"})}};return a.jsxs("section",{id:"about",className:"bg-white",children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-14 sm:py-20 lg:py-24",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-10 md:gap-14 lg:gap-16 xl:gap-24 items-center mb-12 sm:mb-16 lg:mb-20",children:[a.jsxs("div",{children:[a.jsx("div",{className:"h-px w-12 bg-[#F4C533] mb-6"}),a.jsxs("h2",{className:"font-black text-[#0d3347] leading-tight mb-8",style:{fontSize:"clamp(2.25rem, 5vw, 3.75rem)",letterSpacing:"-0.02em"},children:["Why Choose"," ",a.jsx("br",{}),"Xponential"]}),a.jsx("p",{className:"text-gray-400 text-base leading-relaxed font-light mb-7 sm:mb-10 max-w-md",children:"Located in the heart of Cluj-Napoca, Xponential Transylvania combines private offices, coworking, meeting rooms, and event spaces within a dynamic professional community."}),a.jsx("div",{className:"space-y-0 divide-y divide-gray-100 mb-7 sm:mb-10",children:tJ.map(n=>a.jsxs("div",{className:"py-5 flex items-start gap-5 group",children:[a.jsx("div",{className:"flex-shrink-0 mt-1",children:a.jsx("div",{className:"w-1.5 h-1.5 rounded-full bg-[#F4C533]"})}),a.jsxs("div",{children:[a.jsx("span",{className:"text-xs font-bold text-[#3ea2da] uppercase tracking-widest block mb-1",children:n.label}),a.jsx("span",{className:"font-bold text-[#0d3347] text-lg block mb-0.5",children:n.value}),a.jsx("span",{className:"text-gray-400 text-sm font-light",children:n.detail})]})]},n.label))}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs("button",{onClick:t,className:"group px-6 py-3 bg-[#194b66] hover:bg-[#0d3347] text-white font-bold rounded-xl transition-all duration-300 text-sm uppercase tracking-wide flex items-center gap-2",children:["Book a Tour",a.jsx(gs,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]}),a.jsx("button",{onClick:r,className:"px-6 py-3 border border-gray-200 hover:border-[#194b66] text-gray-500 hover:text-[#194b66] font-semibold rounded-xl transition-all duration-300 text-sm uppercase tracking-wide",children:"Contact Us"})]})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{className:"rounded-2xl overflow-hidden bg-gray-200",children:a.jsx(rl,{src:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2FIMG_1032%20(1).jpg?alt=media&token=8ed2fe18-c058-4a91-917c-d3b0f9e0e757",alt:"Xponential Transylvania workspace interior in Cluj-Napoca",className:"w-full h-64 sm:h-80 lg:h-[520px] object-cover"})}),a.jsx("div",{className:"absolute -bottom-4 -left-4 sm:-bottom-6 sm:-left-6 bg-white rounded-2xl shadow-elevated p-4 sm:p-5 border border-gray-100",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-11 h-11 bg-[#F4C533]/20 rounded-xl flex items-center justify-center",children:a.jsx(ja,{className:"w-5 h-5 text-[#0d3347]"})}),a.jsxs("div",{children:[a.jsx("div",{className:"font-black text-[#0d3347] text-sm",children:"Central Cluj-Napoca"}),a.jsx("div",{className:"text-gray-400 text-xs font-light",children:"Bulevardul 21 Decembrie 1989, No. 16"})]})]})}),a.jsx("div",{className:"absolute -top-3 -right-3 sm:-top-4 sm:-right-4 w-16 h-16 sm:w-20 sm:h-20 lg:w-24 lg:h-24 rounded-2xl bg-[#F4C533] opacity-20"})]})]})}),a.jsx("div",{className:"bg-[#0d3347]",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12 sm:py-16 lg:py-20",children:a.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 md:gap-12 lg:gap-16 items-center",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-[#F4C533] text-xs font-bold uppercase tracking-[0.25em] block mb-5",children:"Our C
4411ommunity"}),a.jsxs("h3",{className:"font-black text-white leading-tight mb-6",style:{fontSize:"clamp(2rem, 4vw, 3rem)",letterSpacing:"-0.02em"},children:["More Than",a.jsx("br",{}),"a Workspace"]}),a.jsx("p",{className:"text-white/50 text-base leading-relaxed font-light mb-8",children:"A professional community where members connect, collaborate, and grow. Whether you need a desk for a day or an office for your team — we have the right space for you."}),a.jsx("div",{className:"flex flex-wrap gap-2",children:rJ.map(n=>a.jsx("span",{className:"px-3 py-1.5 border border-white/15 text-white/60 text-xs font-semibold rounded-full uppercase tracking-wide hover:border-[#F4C533]/50 hover:text-white/90 transition-colors cursor-default",children:n},n))})]}),a.jsx("div",{className:"space-y-4",children:a.jsxs("div",{className:"bg-white/5 border border-white/10 rounded-2xl p-5 sm:p-6 lg:p-8",children:[a.jsx("h4",{className:"text-white font-black text-xl mb-3",style:{letterSpacing:"-0.01em"},children:"Come and Experience the Space"}),a.jsx("p",{className:"text-white/50 text-sm leading-relaxed font-light mb-6",children:"The best way to understand what Xponential offers is to see it for yourself. Book a free tour — no commitment required."}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-3",children:[a.jsxs("button",{onClick:t,className:"group inline-flex items-center justify-center gap-2 px-6 py-3 bg-[#F4C533] hover:bg-white text-[#0d3347] font-bold rounded-xl transition-all duration-300 text-sm uppercase tracking-wide",children:["Book a Free Tour",a.jsx(gs,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]}),a.jsx("button",{onClick:r,className:"inline-flex items-center justify-center gap-2 px-6 py-3 border border-white/20 hover:border-white/50 text-white font-semibold rounded-xl transition-all duration-300 text-sm uppercase tracking-wide",children:"Contact Us"})]})]})})]})})})]})}function nJ(){return a.jsx("section",{className:"bg-[#F4C533] py-12 sm:py-16 lg:py-20",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[a.jsx("p",{className:"font-black text-[#0d3347] leading-tight mb-3",style:{fontSize:"clamp(1.6rem, 5vw, 3.5rem)",letterSpacing:"-0.02em"},children:"Work an entire day for free."}),a.jsx("p",{className:"font-light text-[#194b66] mb-7 sm:mb-10",style:{fontSize:"clamp(1.15rem, 3.5vw, 2.5rem)"},children:"Come try it — no commitment."}),a.jsxs("a",{href:"https://wa.me/40744659659?text=Hello%2C%20I%27d%20like%20to%20try%20a%20free%20day%20at%20Xponential.",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-3 px-6 py-3 sm:px-8 sm:py-4 lg:px-10 bg-[#0d3347] hover:bg-[#194b66] text-white font-bold rounded-xl transition-all duration-300 uppercase tracking-wide text-sm group",children:[a.jsx("svg",{className:"w-5 h-5",fill:"currentColor",viewBox:"0 0 24 24",children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})}),"Contact us on WhatsApp",a.jsx("span",{className:"group-hover:translate-x-1 transition-transform duration-200 inline-block",children:"→"})]})]})})}const aJ=[{label:"Private Offices",index:"01",icon:ga},{label:"Coworking",index:"02",icon:Mt},{label:"Meeting Rooms",index:"03",icon:lU},{label:"Event Hall",index:"04",icon:De}];function Vc({items:t}){return a.jsx("ul",{className:"space-y-2",children:t.map(e=>a.jsxs("li",{className:"flex items-start gap-2 text-sm text-gray-500",children:[a.jsx(qr,{className:"w-4 h-4 text-[#3ea2da] mt-0.5 flex-shrink-0"}),e]},e))})}function sJ(){return a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 md:gap-8 lg:gap-10",children:[a.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-gray-200",children:[a.jsx(rl,{src:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?w=700&q=80",alt:"Coworking space at Xponential Transylvania Cluj-Napoca",className:"w-full h-56 sm:h-72 lg:h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/80 to-transparent flex items-end p-8",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-black text-3xl",style:{letterSpacing:"-0.02em"},children:"Coworking Space"}),a.jsx("p",{className:"text-white/60 text-sm mt-1",children:"Central Cluj-Napoca"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-gray-400 leading-relaxed font-light",children:"Flexible coworking desks designed for freelancers, remote workers, and entrepreneurs who need a productive and professional workspace in the heart of Cluj-Napoca."}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl border border-gray-100 bg-gray-50/50",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-3 sm:mb-4",children:[a.jsx("div",{className:"w-8 h-8 bg-[#3ea2da]/10 rounded-lg flex items-center justify-center",children:a.jsx(qe,{className:"w-4 h-4 text-[#3ea2da]"})}),a.jsx("h4",{className:"font-black text-[#0d3347] text-base",style:{letterSpacing:"-0.01em"},children:"Hot Desk"})]}),a.jsx("p",{className:"text-gray-400 text-sm mb-3 sm:mb-4 font-light leading-relaxed",children:"Maximum flexibility — any available desk. Ideal for freelancers and digital nomads."}),a.jsx(Vc,{items:["High-speed internet","Community areas","Coffee & kitchen","Professional environment"]}),a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:["Daily","Weekly","Monthly"].map(t=>a.jsx("span",{className:"text-xs px-2.5 py-1 bg-[#3ea2da]/10 text-[#3ea2da] rounded-full font-semibold",children:t},t))}),a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-100 flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 font-medium uppercase tracking-wide mb-0.5",children:"Starting from"}),a.jsxs("p",{className:"text-xl font-black text-[#0d3347] leading-none",children:["19 € ",a.jsx("span",{className:"text-xs font-semibold text-red-500 normal-case tracking-normal",children:"tva inclus"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("a",{href:"https://wa.me/40744659659?text=Buna%2C%20sunt%20interesat%20de%20Hot%20Desk",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-9 h-9 bg-[#25D366] text-white rounded-xl hover:bg-[#1ebe5d] active:scale-95 transition-all shadow-sm",title:"WhatsApp",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"w-4.5 h-4.5 fill-current",style:{width:"18px",height:"18px"},children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.
4411198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),a.jsx("a",{href:"/spaces",onClick:()=>sessionStorage.setItem("selectedSpaceType","hot-desk"),className:"flex items-center gap-1.5 px-4 py-2 bg-[#3ea2da] text-white rounded-xl text-sm font-bold hover:bg-[#2d8fc4] active:scale-95 transition-all shadow-sm whitespace-nowrap uppercase tracking-wide",children:"Book Now"})]})]})]}),a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl border border-[#F4C533]/40 bg-[#F4C533]/5",children:[a.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[a.jsx("div",{className:"w-8 h-8 bg-[#0d3347]/10 rounded-lg flex items-center justify-center",children:a.jsx(tU,{className:"w-4 h-4 text-[#0d3347]"})}),a.jsx("h4",{className:"font-black text-[#0d3347] text-base",style:{letterSpacing:"-0.01em"},children:"Dedicated Desk"})]}),a.jsx("p",{className:"text-gray-400 text-sm mb-4 font-light leading-relaxed",children:"Your reserved workspace in the coworking area. For professionals who need consistency."}),a.jsx(Vc,{items:["Personal desk","High-speed internet","Meeting room access","Kitchen access"]}),a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5",children:a.jsx("span",{className:"text-xs px-2.5 py-1 bg-[#0d3347]/10 text-[#0d3347] rounded-full font-semibold",children:"Monthly"})}),a.jsxs("div",{className:"mt-3 pt-3 border-t border-[#F4C533]/30 flex items-center justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-xs text-gray-400 font-medium uppercase tracking-wide mb-0.5",children:"Starting from"}),a.jsxs("p",{className:"text-xl font-black text-[#0d3347] leading-none",children:["199 € ",a.jsx("span",{className:"text-xs font-semibold text-red-500 normal-case tracking-normal",children:"tva inclus"})]})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("a",{href:"https://wa.me/40744659659?text=Buna%2C%20sunt%20interesat%20de%20Dedicated%20Desk",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-9 h-9 bg-[#25D366] text-white rounded-xl hover:bg-[#1ebe5d] active:scale-95 transition-all shadow-sm",title:"WhatsApp",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"fill-current",style:{width:"18px",height:"18px"},children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),a.jsx("a",{href:"/spaces",onClick:()=>sessionStorage.setItem("selectedSpaceType","dedicated-desk"),className:"flex items-center gap-1.5 px-4 py-2 bg-[#0d3347] text-white rounded-xl text-sm font-bold hover:bg-[#0a2535] active:scale-95 transition-all shadow-sm whitespace-nowrap uppercase tracking-wide",children:"Book Now"})]})]})]})]})]})]})}function iJ({onBookTour:t,onContact:e}){const r=()=>{if(e)e();else{const n=document.getElementById("contact");n&&n.scrollIntoView({behavior:"smooth"})}};return a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 md:gap-8 lg:gap-10",children:[a.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-gray-200",children:[a.jsx(rl,{src:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fhelysigek%2FIroda.jpg?alt=media&token=50f470bf-2004-4665-9097-82bc3e8b76c2",alt:"Private office space in central Cluj-Napoca",className:"w-full h-56 sm:h-72 lg:h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/80 to-transparent flex items-end p-8",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-black text-3xl",style:{letterSpacing:"-0.02em"},children:"Private Offices"}),a.jsx("p",{className:"text-white/60 text-sm mt-1",children:"Central Cluj-Napoca"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-gray-400 leading-relaxed font-light",children:"Modern private office
4411s in central Cluj-Napoca ideal for startups, small teams, and growing companies looking for a quiet and focused workspace."}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl border border-gray-100 bg-gray-50/50",children:[a.jsx("h4",{className:"font-black text-[#0d3347] text-base mb-3",style:{letterSpacing:"-0.01em"},children:"Xponential Office"}),a.jsx("p",{className:"text-gray-400 text-sm mb-4 font-light leading-relaxed",children:"Designed for startups and small teams that need a professional, flexible workspace."}),a.jsx(Vc,{items:["Fully furnished","High-speed internet","Community access","Meeting room access"]})]}),a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl border border-gray-100 bg-gray-50/50",children:[a.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[a.jsx("h4",{className:"font-black text-[#0d3347] text-base",style:{letterSpacing:"-0.01em"},children:"Premium Office"}),a.jsx("span",{className:"text-xs px-2 py-0.5 bg-[#F4C533] text-[#0d3347] rounded-full font-black",children:"PRO"})]}),a.jsx("p",{className:"text-gray-400 text-sm mb-4 font-light leading-relaxed",children:"Spacious office with enhanced comfort for companies that need more room to grow."}),a.jsx(Vc,{items:["Spacious private office","High-speed internet","Meeting room access","Kitchen & community"]})]})]}),a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl bg-[#0d3347] text-white",children:[a.jsx("h4",{className:"font-black text-base mb-2",style:{letterSpacing:"-0.01em"},children:"Get a Custom Offer"}),a.jsx("p",{className:"text-white/50 text-sm font-light mb-4",children:"Every business is different. Contact us for a personalized workspace solution."}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsx("a",{href:"https://wa.me/40744659659?text=Buna%2C%20sunt%20interesat%20de%20un%20Private%20Office",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-10 h-10 bg-[#25D366] text-white rounded-xl hover:bg-[#1ebe5d] active:scale-95 transition-all",title:"WhatsApp",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"fill-current",style:{width:"18px",height:"18px"},children:a.jsx("path",{d:"M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51-.173-.008-.371-.01-.57-.01-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"})})}),a.jsx("button",{onClick:r,className:"px-5 py-2.5 border border-white/20 text-white text-sm font-semibold rounded-xl hover:bg-white/10 transition-colors uppercase tracking-wide",children:"Request Offer"})]})]})]})]})}const oJ=[{name:"White Meeting Room",capacity:"7–9 seats",desc:"A modern meeting space with clean, minimal design — ideal for focused discussions and client presentations.",includes:["Smart TV / presentation screen","High-speed Wi-Fi","Whiteboard","Air conditioning","Lounge & kitchen access"],ideal:["Business meetings","Client presentations","Team discussions","Strategy sessions"],image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fmeetingroom%2F1.jpg?alt=media&token=768e2b91-e97a-4920-9504-9ed79cdf6512"},{name:"Gallery Room",capacity:"Flexible",desc:"A creative, open workshop space ideal for brainstorming sessions, collaborative meetings, and startup events.",includes:["High-speed Wi-Fi","Presentation equipment","Whiteboard","Comfortable seating","Lounge access"],ideal:["Workshops","Brainstorming","Startup meetings","Collaborative work"],image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fmeetingroom%2F2.jpg?alt=media&token=06874c32-1019-4ef6-a537-593ab2f8f40d"},{name:"Vault Room",capacity:"Private",desc:"A private, quiet conference room designed for focused conversations and productive professional meetings.",includes:["High-speed Wi-Fi","Presentation screen","Comfortable seating","Professional environment","Community access"],ideal:["Client meetings","Negotiations","Strategic planning","Private team meetings"],image:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2Fmeetingroom%2F3.jpg?alt=media&token=61e121b1-95fc-43ee-8b1c-44bca696c6d8"}];function lJ(){return a.jsxs("div",{className:"space-y-8",children:[a.jsx("p",{className:"text-gray-400 leading-relaxed font-light max-w-2xl",children:"Fully equipped meeting rooms perfect for business meetings, workshops, presentations, and team sessions."}),a.jsx("div",{className:"grid sm:grid-cols-2 lg:grid-cols-3 gap-4 sm:gap-5",children:oJ.map(t=>a.jsxs("a",{href:"/meeting-rooms",className:"group rounded-2xl border border-gray-100 overflow-hidden bg-white hover:shadow-elevated transition-all duration-300 flex flex-col",children:[a.jsxs("div",{className:"relative overflow-hidden bg-gray-200",children:[a.jsx(rl,{src:t.image,alt:t.name,className:"w-full h-40 sm:h-44 object-cover group-hover:scale-105 transition-transform duration-500"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/60 to-transparent flex items-end p-4",children:a.jsx("span",{className:"text-xs px-2.5 py-1 bg-white/20 backdrop-blur-sm text-white rounded-full font-semibold border border-white/20",children:t.capacity})})]}),a.jsxs("div",{className:"p-4 sm:p-5 flex flex-col flex-1",children:[a.jsx("h4",{className:"font-black text-[#0d3347] mb-2",style:{letterSpacing:"-0.01em"},children:t.name}),a.jsx("p",{className:"text-gray-400 text-sm mb-4 leading-relaxed font-light",children:t.desc}),a.jsxs("div",{className:"mb-3",children:[a.jsx("p",{className:"text-xs font-bold text-[#0d3347] uppercase tracking-widest mb-2",children:"Includes"}),a.jsx(Vc,{items:t.includes.slice(0,3)})]}),a.jsx("div",{className:"flex flex-wrap gap-1.5 pt-3 border-t border-gray-50 mt-auto",children:t.ideal.slice(0,2).map(e=>a.jsx("span",{className:"text-xs px-2.5 py-1 bg-gray-50 text-gray-400 rounded-full border border-gray-100",children:e},e))}),a.jsx("div",{className:"mt-3 pt-3 border-t border-gray-50",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-sm font-bold text-[#0d3347] group-hover:text-[#3ea2da] transition-colors uppercase tracking-wide",children:[a.jsx(De,{className:"w-4 h-4"})," Book Now"]})})]})]},t.name))}),a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl bg-[#0d3347] flex flex-wrap items-center justify-between gap-4 sm:gap-5",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-black text-white text-base mb-1",style:{letterSpacing:"-0.01em"},children:"Book a Meeting Room"}),a.jsx("p",{className:"text-white/50 text-sm font-light",children:"Hourly, half-day, and full-day rentals. Contact us for pricing."})]}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs("a",{href:"/meeting-rooms",className:"flex items-center gap-2 px-5 py-2.5 bg-[#F4C533] text-[#0d3347] text-sm font-bold rounded-xl hover:bg-white transition-colors uppercase tracking-wide",children:[a.jsx(De,{className:"w-4 h-4"})," Book Now"]}),a.jsxs("a",{href:"tel:+40744659659",className:"flex items-center gap-2 px-5 py-2.5 border border-white/20 text-white text-sm font-semibold rounded-xl hover:bg-white/10 transition-colors uppercase tracking-wide",children:[a.jsx(Na,{className:"w-4 h-4"})," Call Us"]})]})]})]})}function cJ(){const t=["Workshops & training","Business presentations","Networking events","Startup meetups","Team building","Professional seminars"];return a.jsxs("div",{className:"grid lg:grid-cols-2 gap-6 md:gap-8 lg:gap-10",children:[a.jsxs("div",{className:"relative rounded-2xl overflow-hidden bg-gray-200",children:[a.jsx(rl,{src:"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Weboldal%20kepek%2F_MG_6068%20(1)%20(1).jpg?alt=media&token=fbe1a0b9-fac1-4ebf-957a-09025811339e",alt:"Event hall and conference space at Xponential Cluj-Napoca",className:"w-full h-56 sm:h-72 lg:h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-[#0d3347]/80 to-transparent flex items-end p-8",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-white font-black text-3xl",style:{letterSpacing:"-0.02em"},children:"Conference Hall"}),a.jsx("p",{className:"text-white/60 text-sm mt-1",children:"Flexible event space — Central Cluj-Napoca"})]})})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx("p",{className:"text-gray-400 leading-relaxed font-light",children:"A versatile space suitable for business events, workshops, networking events, and professional gatherings."}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-[#0d3347] uppercase tracking-widest mb-4",children:"Space Includes"}),a.jsx(Vc,{items:["High-speed Wi-Fi internet","Presentation screen / Smart TV","Flexible seating arrangement","Whiteboard & presentation tools","Air conditioning","Lounge & kitchen access"]})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-bold text-[#0d3347] uppercase tracking-widest mb-4",children:"Ideal For"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:t.map(e=>a.jsx("span",{className:"text-xs px-3 py-1.5 bg-gray-50 text-gray-500 rounded-full border border-gray-100 font-medium hover:border-[#3ea2da]/30 hover:text-[#194b66] transition-colors",children:e},e))})]}),a.jsxs("div",{className:"p-4 sm:p-5 lg:p-6 rounded-2xl bg-[#0d3347] text-white",children:[a.jsx("h4",{className:"font-black text-base mb-2",style:{letterSpacing:"-0.01em"},children:"Host Your Next Event Here"}),a.jsx("p",{className:"text-white/50 text-sm font-light mb-4",children:"Hourly, half-day, and full-day rentals. Contact us to check availability."}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs("a",{href:"mailto:[email protected]",className:"flex items-center gap-2 px-5 py-2.5 bg-[#F4C533] text-[#0d3347] text-sm font-bold rounded-xl hover:bg-white transition-colors",children:[a.jsx(Or,{className:"w-4 h-4"})," [email protected]"]}),a.jsxs("a",{href:"tel:+40744659659",className:"flex items-center gap-2 px-5 py-2.5 border border-white/20 text-white text-sm font-semibold rounded-xl hover:bg-white/10 transition-colors",children:[a.jsx(Na,{className:"w-4 h-4"})," +40 744 659 659"]})]})]})]})]})}function EM({onBookTour:t,onContact:e}){const[r,n]=P.useState(0);return P.useEffect(()=>{const s=i=>{const o=i.detail;n(o.tabIndex)};
4411return window.addEventListener("selectServiceTab",s),()=>window.removeEventListener("selectServiceTab",s)},[]),a.jsx("section",{id:"services",className:"py-14 sm:py-20 lg:py-24 bg-[#f8fafc]",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"flex flex-col lg:flex-row lg:items-end justify-between mb-8 sm:mb-10 lg:mb-14 gap-4 sm:gap-6",children:[a.jsxs("div",{children:[a.jsx("div",{className:"h-px w-12 bg-[#F4C533] mb-5"}),a.jsx("h2",{className:"font-black text-[#0d3347] leading-none",style:{fontSize:"clamp(2.5rem, 6vw, 4.5rem)",letterSpacing:"-0.02em"},children:"Our Services"})]}),a.jsx("p",{className:"text-gray-400 text-base lg:max-w-sm leading-relaxed font-light",children:"From flexible coworking desks to private offices, meeting rooms, and event spaces — designed for productivity and collaboration."})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-2 sm:gap-3 mb-6 sm:mb-8 lg:mb-10",children:aJ.map((s,i)=>{const o=s.icon;return a.jsxs("button",{onClick:()=>n(i),className:`group relative flex flex-col items-start p-3 sm:p-4 lg:p-5 rounded-2xl text-left transition-all duration-300 ${r===i?"bg-[#0d3347] text-white":"bg-white text-[#0d3347] border border-gray-100 hover:border-[#3ea2da]/30 hover:shadow-soft"}`,children:[a.jsx("span",{className:`text-xl sm:text-2xl lg:text-3xl font-black leading-none mb-2 sm:mb-3 select-none ${r===i?"text-white/20":"text-gray-100"}`,style:{letterSpacing:"-0.03em"},children:s.index}),a.jsx(o,{className:`w-4 h-4 sm:w-5 sm:h-5 mb-1.5 sm:mb-2 ${r===i?"text-[#F4C533]":"text-[#3ea2da]"}`}),a.jsx("span",{className:`font-bold text-xs sm:text-sm leading-tight ${r===i?"text-white":"text-[#0d3347]"}`,children:s.label}),r===i&&a.jsx("div",{className:"absolute bottom-0 left-1/2 -translate-x-1/2 translate-y-1/2 w-3 h-3 bg-[#0d3347] rotate-45 rounded-sm"})]},s.label)})}),a.jsxs("div",{className:"bg-white rounded-2xl p-4 sm:p-6 lg:p-8 shadow-soft border border-gray-100",children:[a.jsx("div",{className:r===0?"":"hidden",children:a.jsx(iJ,{onBookTour:t,onContact:e})}),a.jsx("div",{className:r===1?"":"hidden",children:a.jsx(sJ,{})}),a.jsx("div",{className:r===2?"":"hidden",children:a.jsx(lJ,{})}),a.jsx("div",{className:r===3?"":"hidden",children:a.jsx(cJ,{})})]})]})})}function kM(){return a.jsx("section",{id:"virtual-tour",className:"py-12 sm:py-16 lg:py-20 bg-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-7 sm:mb-10",children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"Virtual Tour"}),a.jsx("h2",{className:"mt-2 text-3xl sm:text-4xl font-bold text-[#194b66]",children:"Explore Xponential"}),a.jsx("p",{className:"mt-3 text-gray-500 max-w-xl mx-auto",children:"Take a virtual tour of Xponential Transylvania and discover our modern office spaces, coworking desks, meeting rooms, and community areas — before visiting us in person."})]}),a.jsxs("div",{className:"relative rounded-2xl overflow-hidden shadow-elevated border border-gray-100",children:[a.jsxs("div",{className:"bg-[#194b66] flex items-center justify-between px-3 py-2 sm:px-5 sm:py-3",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-full bg-red-400"}),a.jsx("div",{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-full bg-yellow-400"}),a.jsx("div",{className:"w-2.5 h-2.5 sm:w-3 sm:h-3 rounded-full bg-green-400"})]}),a.jsx("span",{className:"text-white/70 text-[10px] sm:text-xs font-medium hidden xs:block sm:block",children:"Xponential Transylvania — 360° Virtual Tour"}),a.jsxs("a",{href:"https://realsee.ai/2VPPRJpj",target:"_blank",rel:"noopener noreferrer",className:"flex items-center gap-1 text-white/70 hover:text-white text-xs transition-colors",children:[a.jsx(qV,{className:"w-3 h-3"}),"Full Screen"]})]}),a.jsx("div",{className:"relative w-full aspect-[4/3] sm:aspect-video",children:a.jsx("iframe",{src:"https://realsee.ai/2VPPRJpj",className:"absolute inset-0 w-full h-full",frameBorder:"0",allowFullScreen:!0,title:"Xponential Transylvania Virtual Tour"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs("a",{href:"https://realsee.ai/2VPPRJpj",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 text-[#3ea2da] font-semibold hover:text-[#194b66] transition-colors text-sm",children:[a.jsx(pc,{className:"w-4 h-4"}
4411),"Open full virtual tour in a new tab"]})})]})})}function V2(t=!1){const[e,r]=P.useState([]),[n,s]=P.useState(!0),[i,o]=P.useState(null);return P.useEffect(()=>{const d=dt(Be(oe,"blogPosts")),h=Dn(d,m=>{let p=m.docs.map(x=>({id:x.id,...x.data()}));t?(p=p.filter(x=>x.status==="published"),p.sort((x,w)=>{var b,y,T,N;const g=(y=(b=x.publishedAt)==null?void 0:b.toDate)!=null&&y.call(b)||x.publishedAt?new Date(x.publishedAt):new Date(0);return((N=(T=w.publishedAt)==null?void 0:T.toDate)!=null&&N.call(T)||w.publishedAt?new Date(w.publishedAt):new Date(0)).getTime()-g.getTime()})):p.sort((x,w)=>{var b,y,T,N;const g=(y=(b=x.createdAt)==null?void 0:b.toDate)!=null&&y.call(b)||x.createdAt?new Date(x.createdAt):new Date(0);return((N=(T=w.createdAt)==null?void 0:T.toDate)!=null&&N.call(T)||w.createdAt?new Date(w.createdAt):new Date(0)).getTime()-g.getTime()}),r(p),s(!1)},m=>{console.error("Error fetching blog posts:",m),o("Failed to fetch blog posts"),s(!1)});return()=>h()},[t]),{posts:e,loading:n,error:i,addPost:async d=>{try{await wl(Be(oe,"blogPosts"),{...d,createdAt:Ct(),updatedAt:Ct(),publishedAt:d.status==="published"?Ct():null})}catch(h){throw console.error("Error adding blog post:",h),new Error("Failed to add blog post")}},updatePost:async(d,h)=>{try{const m=Te(oe,"blogPosts",d),p={...h,updatedAt:Ct()};h.status==="published"&&(p.publishedAt=Ct()),await Je(m,p)}catch(m){throw console.error("Error updating blog post:",m),new Error("Failed to update blog post")}},deletePost:async d=>{try{await Rn(Te(oe,"blogPosts",d))}catch(h){throw console.error("Error deleting blog post:",h),new Error("Failed to delete blog post")}}}}function kt(t){const e=Object.prototype.toString.call(t);return t instanceof Date||typeof t=="object"&&e==="[object Date]"?new t.constructor(+t):typeof t=="number"||e==="[object Number]"||typeof t=="string"||e==="[object String]"?new Date(t):new Date(NaN)}function Xa(t,e){return t instanceof Date?new t.constructor(e):new Date(e)}function Rt(t,e){const r=kt(t);return isNaN(e)?Xa(t,NaN):(e&&r.setDate(r.getDate()+e),r)}function nl(t,e){const r=kt(t);if(isNaN(e))return Xa(t,NaN);if(!e)return r;const n=r.getDate(),s=Xa(t,r.getTime());s.setMonth(r.getMonth()+e+1,0);const i=s.getDate();return n>=i?s:(r.setFullYear(s.getFullYear(),s.getMonth(),n),r)}const PM=6048e5,uJ=864e5,CM=6e4,IM=36e5;let dJ={};function My(){return dJ}function Uc(t,e){var l,c,u,d;const r=My(),n=(e==null?void 0:e.weekStartsOn)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.weekStartsOn)??r.weekStartsOn??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.weekStartsOn)??0,s=kt(t),i=s.getDay(),o=(i<n?7:0)+i-n;return s.setDate(s.getDate()-o),s.setHours(0,0,0,0),s}function Dg(t){return Uc(t,{weekStartsOn:1})}function OM(t){const e=kt(t),r=e.getFullYear(),n=Xa(t,0);n.setFullYear(r+1,0,4),n.setHours(0,0,0,0);const s=Dg(n),i=Xa(t,0);i.setFullYear(r,0,4),i.setHours(0,0,0,0);const o=Dg(i);return e.getTime()>=s.getTime()?r+1:e.getTime()>=o.getTime()?r:r-1}function Uh(t){const e=kt(t);return e.setHours(0,0,0,0),e}function ik(t){const e=kt(t),r=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return r.setUTCFullYear(e.getFullYear()),+t-+r}function RM(t,e){const r=Uh(t),n=Uh(e),s=+r-ik(r),i=+n-ik(n);return Math.round((s-i)/uJ)}function hJ(t){const e=OM(t),r=Xa(t,0);return r.setFullYear(e,0,4),r.setHours(0,0,0,0),Dg(r)}function Mg(t,e){const r=e*7;return Rt(t,r)}function mJ(t,e){const r=Uh(t),n=Uh(e);return+r==+n}function fJ(t){return t instanceof Date||typeof t=="object"&&Object.prototype.toString.call(t)==="[object Date]"}function pJ(t){if(!fJ(t)&&typeof t!="number")return!1;const e=kt(t);return!isNaN(Number(e))}function DM(t,e){const r=kt(t),n=kt(e),s=ok(r,n),i=Math.abs(RM(r,n));r.setDate(r.getDate()-s*i);const o=+(ok(r,n)===-s),l=s*(i-o);return l===0?0:l}function ok(t,e){const r=t.getFullYear()-e.getFullYear()||t.getMonth()-e.getMonth()||t.getDate()-e.getDate()||t.getHours()-e.getHours()||t.getMinutes()-e.getMinutes()||t.getSeconds()-e.getSeconds()||t.getMilliseconds()-e.getMilliseconds();return r<0?-1:r>0?1:r}function gJ(t){const e=kt(t);return e.setHours(23,59,59,999),e}function xJ(t){const e=kt(t),r=e.getMonth();return e.setFullYear(e.getFullYear(),r+1,0),e.setHours(23,59,59,999),e}function yJ(t){const e=kt(t);return e.setDate(1),e.setHours(0,0,0,0),e}function vJ(t){const e=kt(t),r=Xa(t,0);return r.setFullYear(e.getFullYear(),0,1),r.setHours(0,0,0,0),r}const bJ={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}},wJ=(t,e,r)=>{let n;const s=bJ[t];return typeof s=="string"?n=s:e===1?n=s.one:n=s.other.replace("{{count}}",e.toString()),r!=null&&r.addSuffix?r.comparison&&r.comparison>0?"in "+n:n+" ago":n};function F0(t){return(e={})=>{const r=e.width?String(e.width):t.defaultWidth;return t.formats[r]||t.formats[t.defaultWidth]}}const jJ={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},NJ={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},_J={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},SJ={date:F0({formats:jJ,defaultWidth:"full"}),time:F0({formats:NJ,defaultWidth:"full"}),dateTime:F0({formats:_J,defaultWidth:"full"})},TJ={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"},AJ=(t,e,r,n)=>TJ[t];function pd(t){return(e,r)=>{const n=r!=null&&r.context?String(r.context):"standalone";let s;if(n==="formatting"&&t.formattingValues){const o=t.defaultFormattingWidth||t.defaultWidth,l=r!=null&&r.width?String(r.width):o;s=t.formattingValues[l]||t.formattingValues[o]}else{const o=t.defaultWidth,l=r!=null&&r.width?String(r.width):t.defaultWidth;s=t.values[l]||t.values[o]}const i=t.argumentCallback?t.argumentCallback(e):e;return s[i]}}const EJ={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},kJ={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},PJ={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},CJ={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Frid
4411ay","Saturday"]},IJ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},OJ={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},RJ=(t,e)=>{const r=Number(t),n=r%100;if(n>20||n<10)switch(n%10){case 1:return r+"st";case 2:return r+"nd";case 3:return r+"rd"}return r+"th"},DJ={ordinalNumber:RJ,era:pd({values:EJ,defaultWidth:"wide"}),quarter:pd({values:kJ,defaultWidth:"wide",argumentCallback:t=>t-1}),month:pd({values:PJ,defaultWidth:"wide"}),day:pd({values:CJ,defaultWidth:"wide"}),dayPeriod:pd({values:IJ,defaultWidth:"wide",formattingValues:OJ,defaultFormattingWidth:"wide"})};function gd(t){return(e,r={})=>{const n=r.width,s=n&&t.matchPatterns[n]||t.matchPatterns[t.defaultMatchWidth],i=e.match(s);if(!i)return null;const o=i[0],l=n&&t.parsePatterns[n]||t.parsePatterns[t.defaultParseWidth],c=Array.isArray(l)?$J(l,h=>h.test(o)):MJ(l,h=>h.test(o));let u;u=t.valueCallback?t.valueCallback(c):c,u=r.valueCallback?r.valueCallback(u):u;const d=e.slice(o.length);return{value:u,rest:d}}}function MJ(t,e){for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)&&e(t[r]))return r}function $J(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return r}function LJ(t){return(e,r={})=>{const n=e.match(t.matchPattern);if(!n)return null;const s=n[0],i=e.match(t.parsePattern);if(!i)return null;let o=t.valueCallback?t.valueCallback(i[0]):i[0];o=r.valueCallback?r.valueCallback(o):o;const l=e.slice(s.length);return{value:o,rest:l}}}const FJ=/^(\d+)(th|st|nd|rd)?/i,BJ=/\d+/i,VJ={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},UJ={any:[/^b/i,/^(a|c)/i]},zJ={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},HJ={any:[/1/i,/2/i,/3/i,/4/i]},qJ={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},WJ={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},GJ={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},KJ={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},XJ={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},YJ={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},QJ={ordinalNumber:LJ({matchPattern:FJ,parsePattern:BJ,valueCallback:t=>parseInt(t,10)}),era:gd({matchPatterns:VJ,defaultMatchWidth:"wide",parsePatterns:UJ,defaultParseWidth:"any"}),quarter:gd({matchPatterns:zJ,defaultMatchWidth:"wide",parsePatterns:HJ,defaultParseWidth:"any",valueCallback:t=>t+1}),month:gd({matchPatterns:qJ,defaultMatchWidth:"wide",parsePatterns:WJ,defaultParseWidth:"any"}),day:gd({matchPatterns:GJ,defaultMatchWidth:"wide",parsePatterns:KJ,defaultParseWidth:"any"}),dayPeriod:gd({matchPatterns:XJ,defaultMatchWidth:"any",parsePatterns:YJ,defaultParseWidth:"any"})},JJ={code:"en-US",formatDistance:wJ,formatLong:SJ,formatRelative:AJ,localize:DJ,match:QJ,options:{weekStartsOn:0,firstWeekContainsDate:1}};function ZJ(t){const e=kt(t);return RM(e,vJ(e))+1}function eZ(t){const e=kt(t),r=+Dg(e)-+hJ(e);return Math.round(r/PM)+1}function MM(t,e){var d,h,m,p;const r=kt(t),n=r.getFullYear(),s=My(),i=(e==null?void 0:e.firstWeekContainsDate)??((h=(d=e==null?void 0:e.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??s.firstWeekContainsDate??((p=(m=s.locale)==null?void 0:m.options)==null?void 0:p.firstWeekContainsDate)??1,o=Xa(t,0);o.setFullYear(n+1,0,i),o.setHours(0,0,0,0);const l=Uc(o,e),c=Xa(t,0);c.setFullYear(n,0,i),c.setHours(0,0,0,0);const u=Uc(c,e);return r.getTime()>=l.getTime()?n+1:r.getTime()>=u.getTime()?n:n-1}function tZ(t,e){var l,c,u,d;const r=My(),n=(e==null?void 0:e.firstWeekContainsDate)??((c=(l=e==null?void 0:e.locale)==null?void 0:l.options)==null?void 0:c.firstWeekContainsDate)??r.firstWeekContainsDate??((d=(u=r.locale)==null?void 0:u.options)==null?void 0:d.firstWeekContainsDate)??1,s=MM(t,e),i=Xa(t,0);return i.setFullYear(s,0,n),i.setHours(0,0,0,0),Uc(i,e)}function rZ(t,e){const r=kt(t),n=+Uc(r,e)-+tZ(r,e);return Math.round(n/PM)+1}function lt(t,e){const r=t<0?"-":"",n=Math.abs(t).toString().padStart(e,"0");return r+n}const Ks={y(t,e){const r=t.getFullYear(),n=r>0?r:1-r;return lt(e==="yy"?n%100:n,e.length)},M(t,e){const r=t.getMonth();return e==="M"?String(r+1):lt(r+1,2)},d(t,e){return lt(t.getDate(),e.length)},a(t,e){const r=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.toUpperCase();case"aaa":return r;case"aaaaa":return r[0];case"aaaa":default:return r==="am"?"a.m.":"p.m."}},h(t,e){return lt(t.getHours()%12||12,e.length)},H(t,e){return lt(t.getHours(),e.length)},m(t,e){return lt(t.getMinutes(),e.length)},s(t,e){return lt(t.getSeconds(),e.length)},S(t,e){const r=e.length,n=t.getMilliseconds(),s=Math.trunc(n*Math.pow(10,r-3));return lt(s,e.length)}},Rl={midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},lk={G:function(t,e,r){const n=t.getFullYear()>0?1:0;switch(e){case"G":case"GG":case"GGG":return r.era(n,{width:"abbreviated"});case"GGGGG":return r.era(n,{width:"narrow"});case"GGGG":default:return r.era(n,{width:"wide"})}},y:function(t,e,r){if(e==="yo"){const n=t.getFullYear(),s=n>0?n:1-n;return r.ordinalNumber(s,{unit:"year"})}return Ks.y(t,e)},Y:function(t,e,r,n){const s=MM(t,n),i=s>0?s:1-s;if(e==="YY"){const o=i%100;return lt(o,2)}return e==="Yo"?r.ordinalNumber(i,{unit:"year"}):lt(i,e.length)},R:function(t,e){const r=OM(t);return lt(r,e.length)},u:function(t,e){const r=t.getFullYear();return lt(r,e.length)},Q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"Q":return String(n);case"QQ":return lt(n,2);case"Qo":return r.ordinalNumber(n,{unit:"quarter"});case"QQQ":return r.quarter(n,{width:"abbreviated",context:"formatting"});case"QQQQQ":return r.quarter(n,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(n,{width:"wide",context:"formatting"})}},q:function(t,e,r){const n=Math.ceil((t.getMonth()+1)/3);switch(e){case"q":return String(n);case"qq":return lt(n,2);case"qo":return r.ordinalNumber(n,{unit:"quarter"});case"qqq":return r.quarter(n,{width:"abbreviated",context:"standalone"});case"qqqqq":return r.quarter(n,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(n,{width:"wide",context:"standalone"})}},M:function(t,e,r){const n=t.getMonth();switch(e){case"M":case"MM":return Ks.M(t,e);case"Mo":return r.ordinalNumber(n+1,{unit:"month"});case"MMM":return r.month(n,{width:"abbreviated",context:"formatting"});case"MMMMM":return r.month(n,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(n,{width:"wide",context:"formatting"})}},L:function(t,e,r){const n=t.getMonth();switch(e){case"L":return String(n+1);case"LL":return lt(n+1,2);case"Lo":return r.ordinalNumber(n+1,{unit:"month"});case"LLL":return r.month(n,{width:"abbreviated",context:"standalone"});case"LLLLL":return r.month(n,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(n,{width:"wide",context:"standalone"})}},w:function(t,e,r,n){const s=rZ(t,n);return e==="wo"?r.ordinalNumber(s,{unit:"week"}):lt(s,e.length)},I:function(t,e,r){const n=eZ(t);return e==="Io"?r.ordinalNumber(n,{unit:"week"}):lt(n,e.length)},d:function(t,e,r){return e==="do"?r.ordinalNumber(t.getDate(),{unit:"date"}):Ks.d(t,e)},D:function(t,e,r){const n=ZJ(t);return e==="Do"?r.ordinalNumber(n,{unit:"dayOfYear"}):lt(n,e.length)},E:function(t,e,r){const n=t.getDay();switch(e){case"E":case"EE":case"EEE":return r.day(n,{width:"abbreviated",context:"formatting"});case"EEEEE":return r.day(n,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(n,{width:"short",context:"formatting"});case"EEEE":default:return r.day(n,{width:"wide",context:"formatting"})}},e:function(t,e,r,n){const s=t.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(e){case"e":return String(i);case"ee":return lt(i,2);case"eo":return r.ordinalNumber(i,{unit:"day"});case"eee":return r.day(s,{width:"abbreviated",context:"formatting"});case"eeeee":return r.day(s,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(s,{width:"short",context:"formatting"});case"eeee":default:return r.day(s,{width:"wide",context:"formatting"})}},c:function(t,e,r,n){const s=t.getDay(),i=(s-n.weekStartsOn+8)%7||7;switch(e){case"c":return String(i);case"cc":return lt(i,e.length);case"co":return r.ordinalNumber(i,{unit:"day"});case"ccc":return r.day(s,{width:"abbreviated",context:"standalone"});case"ccccc":return r.day(s,{width:"narrow",context:"standalone"});case"cccccc":return r.day(s,{width:"short",context:"standalone"});case"cccc":default:return r.day(s,{width:"wide",context:"standalone"})}},i:function(t,e,r){const n=t.getDay(),s=n===0?7:n;switch(e){case"i":return String(s);case"ii":return lt(s,e.length);case"io":return r.ordinalNumber(s,{unit:"day"});case"iii":return r.day(n,{width:"abbreviated",context:"formatting"});case"iiiii":return r.day(n,{width:"narrow",context:"formatting"});case"iiiiii":return r.day(n,{width:"short",context:"formatting"});case"iiii":default:return r.day(n,{width:"wide",context:"formatting"})}},a:function(t,e,r){const s=t.getHours()/12>=1?"pm":"am";switch(e){case"a":case"aa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"aaa":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},b:function(t,e,r){const n=t.getHours();let s;switch(n===12?s=Rl.noon:n===0?s=Rl.midnight:s=n/12>
vendor: 3,668 bytes, line 4411
4411=1?"pm":"am",e){case"b":case"bb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"bbb":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},B:function(t,e,r){const n=t.getHours();let s;switch(n>=17?s=Rl.evening:n>=12?s=Rl.afternoon:n>=4?s=Rl.morning:s=Rl.night,e){case"B":case"BB":case"BBB":return r.dayPeriod(s,{width:"abbreviated",context:"formatting"});case"BBBBB":return r.dayPeriod(s,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(s,{width:"wide",context:"formatting"})}},h:function(t,e,r){if(e==="ho"){let n=t.getHours()%12;return n===0&&(n=12),r.ordinalNumber(n,{unit:"hour"})}return Ks.h(t,e)},H:function(t,e,r){return e==="Ho"?r.ordinalNumber(t.getHours(),{unit:"hour"}):Ks.H(t,e)},K:function(t,e,r){const n=t.getHours()%12;return e==="Ko"?r.ordinalNumber(n,{unit:"hour"}):lt(n,e.length)},k:function(t,e,r){let n=t.getHours();return n===0&&(n=24),e==="ko"?r.ordinalNumber(n,{unit:"hour"}):lt(n,e.length)},m:function(t,e,r){return e==="mo"?r.ordinalNumber(t.getMinutes(),{unit:"minute"}):Ks.m(t,e)},s:function(t,e,r){return e==="so"?r.ordinalNumber(t.getSeconds(),{unit:"second"}):Ks.s(t,e)},S:function(t,e){return Ks.S(t,e)},X:function(t,e,r){const n=t.getTimezoneOffset();if(n===0)return"Z";switch(e){case"X":return uk(n);case"XXXX":case"XX":return uo(n);case"XXXXX":case"XXX":default:return uo(n,":")}},x:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"x":return uk(n);case"xxxx":case"xx":return uo(n);case"xxxxx":case"xxx":default:return uo(n,":")}},O:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"O":case"OO":case"OOO":return"GMT"+ck(n,":");case"OOOO":default:return"GMT"+uo(n,":")}},z:function(t,e,r){const n=t.getTimezoneOffset();switch(e){case"z":case"zz":case"zzz":return"GMT"+ck(n,":");case"zzzz":default:return"GMT"+uo(n,":")}},t:function(t,e,r){const n=Math.trunc(t.getTime()/1e3);return lt(n,e.length)},T:function(t,e,r){const n=t.getTime();return lt(n,e.length)}};function ck(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),s=Math.trunc(n/60),i=n%60;return i===0?r+String(s):r+String(s)+e+lt(i,2)}function uk(t,e){return t%60===0?(t>0?"-":"+")+lt(Math.abs(t)/60,2):uo(t,e)}function uo(t,e=""){const r=t>0?"-":"+",n=Math.abs(t),s=lt(Math.trunc(n/60),2),i=lt(n%60,2);return r+s+e+i}const dk=(t,e)=>{switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"})}},$M=(t,e)=>{switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"})}},nZ=(t,e)=>{const r=t.match(/(P+)(p+)?/)||[],n=r[1],s=r[2];if(!s)return dk(t,e);let i;switch(n){case"P":i=e.dateTime({width:"short"});break;case"PP":i=e.dateTime({width:"medium"});break;case"PPP":i=e.dateTime({width:"long"});break;case"PPPP":default:i=e.dateTime({width:"full"});break}return i.replace("{{date}}",dk(n,e)).replace("{{time}}",$M(s,e))},aZ={p:$M,P:nZ},sZ=/^D+$/,iZ=/^Y+$/,oZ=["D","DD","YY","YYYY"];function lZ(t){return sZ.test(t)}function cZ(t){return iZ.test(t)}function uZ(t,e,r){const n=dZ(t,e,r);if(console.warn(n),oZ.includes(t))throw new RangeError(n)}function dZ(t,e,r){const n=t[0]==="Y"?"years":"days of the month";return`Use \`${t.toLowerCase()}\` instead of \`${t}\` (in \`${e}\`) for formatting ${n} to the input \`${r}\`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md`}
vendor: 4,154 bytes, line 4411
4411const hZ=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,mZ=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,fZ=/^'([^]*?)'?$/,pZ=/''/g,gZ=/[a-zA-Z]/;function he(t,e,r){var d,h,m,p;const n=My(),s=n.locale??JJ,i=n.firstWeekContainsDate??((h=(d=n.locale)==null?void 0:d.options)==null?void 0:h.firstWeekContainsDate)??1,o=n.weekStartsOn??((p=(m=n.locale)==null?void 0:m.options)==null?void 0:p.weekStartsOn)??0,l=kt(t);if(!pJ(l))throw new RangeError("Invalid time value");let c=e.match(mZ).map(x=>{const w=x[0];if(w==="p"||w==="P"){const g=aZ[w];return g(x,s.formatLong)}return x}).join("").match(hZ).map(x=>{if(x==="''")return{isToken:!1,value:"'"};const w=x[0];if(w==="'")return{isToken:!1,value:xZ(x)};if(lk[w])return{isToken:!0,value:x};if(w.match(gZ))throw new RangeError("Format string contains an unescaped latin alphabet character `"+w+"`");return{isToken:!1,value:x}});s.localize.preprocessor&&(c=s.localize.preprocessor(l,c));const u={firstWeekContainsDate:i,weekStartsOn:o,locale:s};return c.map(x=>{if(!x.isToken)return x.value;const w=x.value;(cZ(w)||lZ(w))&&uZ(w,e,String(t));const g=lk[w[0]];return g(l,w,s.localize,u)}).join("")}function xZ(t){const e=t.match(fZ);return e?e[1].replace(pZ,"'"):t}function Pi(t,e){const r=kt(t),n=kt(e);return r.getTime()>n.getTime()}function LM(t,e){const r=kt(t),n=kt(e);return+r<+n}function yZ(t,e){const r=+kt(t),[n,s]=[+kt(e.start),+kt(e.end)].sort((i,o)=>i-o);return r>=n&&r<=s}function B0(t,e){return Rt(t,-e)}function et(t,e){const n=jZ(t);let s;if(n.date){const c=NZ(n.date,2);s=_Z(c.restDateString,c.year)}if(!s||isNaN(s.getTime()))return new Date(NaN);const i=s.getTime();let o=0,l;if(n.time&&(o=SZ(n.time),isNaN(o)))return new Date(NaN);if(n.timezone){if(l=TZ(n.timezone),isNaN(l))return new Date(NaN)}else{const c=new Date(i+o),u=new Date(0);return u.setFullYear(c.getUTCFullYear(),c.getUTCMonth(),c.getUTCDate()),u.setHours(c.getUTCHours(),c.getUTCMinutes(),c.getUTCSeconds(),c.getUTCMilliseconds()),u}return new Date(i+o+l)}const Kf={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},vZ=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,bZ=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,wZ=/^([+-])(\d{2})(?::?(\d{2}))?$/;function jZ(t){const e={},r=t.split(Kf.dateTimeDelimiter);let n;if(r.length>2)return e;if(/:/.test(r[0])?n=r[0]:(e.date=r[0],n=r[1],Kf.timeZoneDelimiter.test(e.date)&&(e.date=t.split(Kf.timeZoneDelimiter)[0],n=t.substr(e.date.length,t.length))),n){const s=Kf.timezone.exec(n);s?(e.time=n.replace(s[1],""),e.timezone=s[1]):e.time=n}return e}function NZ(t,e){const r=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+e)+"})|(\\d{2}|[+-]\\d{"+(2+e)+"})$)"),n=t.match(r);if(!n)return{year:NaN,restDateString:""};const s=n[1]?parseInt(n[1]):null,i=n[2]?parseInt(n[2]):null;return{year:i===null?s:i*100,restDateString:t.slice((n[1]||n[2]).length)}}function _Z(t,e){if(e===null)return new Date(NaN);const r=t.match(vZ);if(!r)return new Date(NaN);const n=!!r[4],s=xd(r[1]),i=xd(r[2])-1,o=xd(r[3]),l=xd(r[4]),c=xd(r[5])-1;if(n)return CZ(e,l,c)?AZ(e,l,c):new Date(NaN);{const u=new Date(0);return!kZ(e,i,o)||!PZ(e,s)?new Date(NaN):(u.setUTCFullYear(e,i,Math.max(s,o)),u)}}function xd(t){return t?parseInt(t):1}function SZ(t){const e=t.match(bZ);if(!e)return NaN;const r=V0(e[1]),n=V0(e[2]),s=V0(e[3]);return IZ(r,n,s)?r*IM+n*CM+s*1e3:NaN}function V0(t){return t&&parseFloat(t.replace(",","."))||0}function TZ(t){if(t==="Z")return 0;const e=t.match(wZ);if(!e)return 0;const r=e[1]==="+"?-1:1,n=parseInt(e[2]),s=e[3]&&parseInt(e[3])||0;return OZ(n,s)?r*(n*IM+s*CM):NaN}function AZ(t,e,r){const n=new Date(0);n.setUTCFullYear(t,0,4);const s=n.getUTCDay()||7,i=(e-1)*7+r+1-s;return n.setUTCDate(n.getUTCDate()+i),n}const EZ=[31,null,31,30,31,30,31,31,30,31,30,31];function FM(t){return t%400===0||t%4===0&&t%100!==0}function kZ(t,e,r){return e>=0&&e<=11&&r>=1&&r<=(EZ[e]||(FM(t)?29:28))}function PZ(t,e){return e>=1&&e<=(FM(t)?366:365)}function CZ(t,e,r){return e>=1&&e<=53&&r>=0&&r<=6}function IZ(t,e,r){return t===24?e===0&&r===0:r>=0&&r<60&&e>=0&&e<60&&t>=0&&t<25}function OZ(t,e){return e>=0&&e<=59}function U0(t,e){return nl(t,-e)}
4411const RZ=[{icon:Mt,title:"Coworking & Office Spaces",desc:"Tips, insights, and trends about modern coworking environments and the future of workspaces.",color:"#3ea2da"},{icon:PN,title:"Productivity & Work Environments",desc:"Practical advice on how to optimize your work routine and create a productive environment.",color:"#194b66"},{icon:ly,title:"Startup & Business Insights",desc:"Stories, lessons, and resources for entrepreneurs and growing companies in Cluj-Napoca.",color:"#26A559"},{icon:c3,title:"Community Events",desc:"Updates about professional events, networking sessions, and gatherings at Xponential.",color:"#F4C533"}],DZ={coworking:"bg-blue-100 text-blue-700",productivity:"bg-[#194b66]/10 text-[#194b66]",startup:"bg-green-100 text-green-700",community:"bg-yellow-100 text-yellow-800"},MZ={coworking:"Coworking",productivity:"Productivity",startup:"Startup",community:"Community"};function $Z(t){if(!t)return"";try{return he(t.toDate?t.toDate():new Date(t),"MMM d, yyyy")}catch{return""}}function LZ({post:t}){const e=cr();return a.jsxs("article",{onClick:()=>e(`/blog/${t.slug}`),className:"bg-white rounded-xl overflow-hidden shadow-card hover:shadow-elevated transition-all duration-300 cursor-pointer group border border-gray-100",children:[a.jsxs("div",{className:"relative h-40 overflow-hidden bg-gray-100",children:[t.coverImage?a.jsx("img",{src:t.coverImage,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-[#194b66]/10 to-[#3ea2da]/10",children:a.jsx(vr,{className:"w-8 h-8 text-[#3ea2da]/40"})}),a.jsx("span",{className:`absolute top-3 left-3 px-2 py-0.5 rounded-full text-xs font-semibold ${DZ[t.category]||"bg-gray-100 text-gray-700"}`,children:MZ[t.category]||t.category})]}),a.jsxs("div",{className:"p-4",children:[a.jsx("h4",{className:"font-bold text-[#194b66] text-sm mb-1 line-clamp-2 group-hover:text-[#3ea2da] transition-colors",children:t.title}),a.jsx("p",{className:"text-gray-400 text-xs leading-relaxed line-clamp-2 mb-3",children:t.excerpt}),a.jsxs("div",{className:"flex items-center justify-between text-xs text-gray-400",children:[a.jsx("span",{children:$Z(t.publishedAt||t.createdAt)}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx(qe,{className:"w-3 h-3"}),a.jsxs("span",{children:[t.readTime," min"]})]})]})]})]})}function FZ(){const t=cr(),{posts:e,loading:r}=V2(!0),n=e.slice(0,3),s=!r&&n.length>0;return a.jsx("section",{id:"blog",className:"py-12 sm:py-16 lg:py-20 bg-[#f8fafc]",children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:s?a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-end justify-between mb-10",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"XPO Blog"}),a.jsx("h2",{className:"mt-2 text-3xl sm:text-4xl font-bold text-[#194b66]",children:"Latest Articles"}),a.jsx("p",{className:"mt-3 text-gray-500 max-w-xl",children:"Ideas, insights, and stories from the Xponential coworking community."})]}),a.jsxs("button",{onClick:()=>t("/blog"),className:"hidden sm:flex items-center gap-2 px-5 py-2.5 border-2 border-[#194b66] text-[#194b66] font-semibold rounded-xl hover:bg-[#194b66] hover:text-white transition-colors text-sm",children:["All Posts",a.jsx(gs,{className:"w-4 h-4"})]})]}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-5",children:n.map(i=>a.jsx(LZ,{post:i},i.id))}),a.jsx("div",{className:"mt-8 text-center sm:hidden",children:a.jsxs("button",{onClick:()=>t("/blog"),className:"inline-flex items-center gap-2 px-6 py-3 bg-[#194b66] text-white font-semibold rounded-xl hover:bg-[#3ea2da] transition-colors",children:["View All Posts",a.jsx(gs,{className:"w-4 h-4"})]})})]}):a.jsxs("div",{className:"grid lg:grid-cols-2 gap-8 md:gap-10 lg:gap-12 items-center",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"XPO Blog"}),a.jsx("h2",{className:"mt-2 text-3xl sm:text-4xl font-bold text-[#194b66]",children:"Ideas, Insights & Community Stories"}),a.jsx("p",{className:"mt-4 text-gray-500 leading-relaxed",children:"News, ideas, and insights from the Xponential community — articles about coworking, productivity, startups, and professional events in Cluj-Napoca."}),a.jsx("div",{className:"mt-6 flex flex-wrap gap-3",children:a.jsxs("button",{onClick:()=>t("/blog"),className:"inline-flex items-center gap-2 px-6 py-3 bg-[#194b66] text-white font-semibold rounded-xl hover:bg-[#3ea2da] transition-colors",children:["Explore the Blog",a.jsx(gs,{className:"w-4 h-4"})]})}),a.jsx("div",{className:"mt-6 grid grid-cols-3 gap-3",children:[{label:"Coworking tips",color:"#3ea2da"},{label:"Startup stories",color:"#26A559"},{label:"Community events",color:"#F4C533"}].map(i=>a.jsx("button",{onClick:()=>t("/blog"),className:"px-3 py-2 rounded-lg text-xs font-semibold border transition-colors hover:opacity-80",style:{borderColor:`${i.color}40`,color:i.color,backgroundColor:`${i.color}10`},children:i.label},i.label))})]}),a.jsx("div",{className:"grid grid-cols-2 gap-4",children:RZ.map(i=>{const o=i.icon;return a.jsxs("button",{onClick:()=>t("/blog"),className:"p-5 rounded-xl bg-white border border-gray-100 shadow-card hover:shadow-elevated transition-all duration-200 text-left group cursor-pointer",children:[a.jsx("div",{className:"w-10 h-10 rounded-xl flex items-center justify-center mb-3 group-hover:scale-110 transition-transform",style:{backgroundColor:`${i.color}18`},children:a.jsx(o,{className:"w-5 h-5",style:{color:i.color}})}),a.jsx("h4",{className:"font-bold text-[#194b66] text-sm mb-1 group-hover:text-[#3ea2da] transition-colors",children:i.title}),a.jsx("p",{className:"text-gray-400 text-xs leading-relaxed",children:i.desc})]},i.title)})})]})})})}const BM=[{q:"What types of office spaces does Xponential Transylvania offer?",a:"Xponential Transylvania offers modern private office
4411s in central Cluj-Napoca, ideal for startups, freelancers, and companies looking for a professional and flexible workspace."},{q:"Do you offer coworking spaces as well?",a:"Yes. Besides private offices, we also offer coworking desks for freelancers and remote workers who prefer a flexible working environment in a professional office space."},{q:"How flexible are your office rental options?",a:"Our workspace solutions are highly flexible. Companies and professionals can choose between private offices or coworking desks, depending on their needs, with adaptable rental options designed to support growing businesses."},{q:"Are your office prices VAT exempt?",a:"Yes. One of our advantages is that our office and coworking prices are VAT exempt, which makes renting a workspace at Xponential Transylvania more cost-efficient for many companies and professionals."},{q:"Is parking available near the office?",a:"Yes. We offer parking subscription options close to Xponential Transylvania, providing a convenient and secure parking solution for members who commute by car."},{q:"Where is Xponential Transylvania located?",a:"Our office and coworking space is located in central Cluj-Napoca, with easy access to public transport, restaurants, and the city's business district."},{q:"Can I visit the office before renting?",a:"Yes. You can schedule a visit or office tour to explore our private offices and coworking desks, and discover the workspace that best fits your needs."},{q:"What is included in the office rental price?",a:"Our office rental includes high-speed internet, access to meeting rooms, shared community areas, utilities, and professional workspace infrastructure, allowing companies to focus on their work without worrying about additional operational costs."},{q:"Do you offer flexible office solutions for small teams?",a:"Yes. Xponential Transylvania offers flexible office spaces for small teams, startups, and companies, allowing businesses to scale their workspace according to their needs."},{q:"Can I organize business events or workshops at Xponential Transylvania?",a:"Yes. Our space is suitable for workshops, networking events, business meetings, and small conferences. Located in central Cluj-Napoca, Xponential provides a professional environment for hosting events, bringing together entrepreneurs, companies, and the local business community."}];function VM(){const[t,e]=P.useState(null);return a.jsx("section",{className:"py-12 sm:py-16 lg:py-20 bg-[#f8fafc]",children:a.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"FAQ"}),a.jsx("h2",{className:"mt-2 text-3xl sm:text-4xl font-bold text-[#194b66]",children:"Frequently Asked Questions"})]}),a.jsx("div",{className:"space-y-3",children:BM.map((r,n)=>a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm overflow-hidden",children:[a.jsxs("button",{onClick:()=>e(t===n?null:n),className:"w-full flex items-center justify-between p-5 text-left",children:[a.jsx("span",{className:"font-semibold text-[#194b66] pr-4 text-sm sm:text-base",children:r.q}),a.jsx(zo,{className:`w-5 h-5 text-[#3ea2da] flex-shrink-0 transition-transform duration-200 ${t===n?"rotate-180":""}`})]}),a.jsx("div",{className:`overflow-hidden transition-all duration-200 ${t===n?"max-h-96":"max-h-0"}`,children:a.jsx("div",{className:"px-5 pb-5 text-gray-500 text-sm leading-relaxed border-t border-gray-50 pt-4",children:r.a})})]},n))})]})})}const BZ=[{label:"Facebook",href:"https://www.facebook.com/xponentialtransylvania",icon:wu,color:"#1877F2"},{label:"Instagram",href:"https://www.instagram.com/xponential.transylvania/",icon:ju,color:"#E1306C"},{label:"LinkedIn",href:"https://www.linkedin.com/company/xponential-transylvania/",icon:pl,color:"#0A66C2"}];function UM(){return a.jsx("section",{id:"contact",className:"py-12 sm:py-16 lg:py-20 bg-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsxs("div",{className:"text-center mb-8 sm:mb-12",children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"Contact"}),a.jsx("h2",{className:"mt-2 text-3xl sm:text-4xl font-bold text-[#194b66]",children:"Get in Touch"}),a.jsx("p",{className:"mt-3 text-gray-500 max-w-xl mx-auto",children:"Have a question or want to visit our space? Write to us and our team will get back to you."})]}),a.jsx("div",{className:"max-w-2xl mx-auto",children:a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"p-5 rounded-xl bg-[#194b66] text-white",children:[a.jsx("h4",{className:"font-bold text-lg mb-1",children:"Book a Free Trial"}),a.jsx("p",{className:"text-white/70 text-sm",children:"Contact us and work an entire day at our facility for free. Experience the workspace before committing."}),a.jsxs("a",{href:"https://wa.me/40744659659",target:"_blank",rel:"noopener noreferrer",className:"mt-4 inline-flex items-center gap-2 px-5 py-2.5 bg-[#25D366] text-white text-sm font-semibold rounded-xl hover:bg-[#1fba59] transition-colors",children:[a.jsx(Ih,{className:"w-4 h-4"}),"WhatsApp Us"]})]}),a.jsxs("div",{className:"grid sm:grid-cols-2 gap-4",children:[a.jsx("div",{className:"p-5 rounded-xl border border-gray-100 bg-[#f8fafc]",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-9 h-9 bg-[#3ea2da]/15 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(ja,{className:"w-5 h-5 text-[#3ea2da]"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-[#194b66] text-sm",children:"Address"}),a.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"Bulevardul 21 Decembrie 1989, No. 16, Cluj-Napoca, Romania"}),a.jsxs("a",{href:"https://maps.app.goo.gl/Uf8UnCU6Yb8FKJUi9",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1 text-xs text-[#3ea2da] font-semibold mt-2 hover:text-[#194b66] transition-colors",children:[a.jsx(pc,{className:"w-3 h-3"})," View on Maps"]})]})]})}),a.jsx("div",{className:"p-5 rounded-xl border border-gray-100 bg-[#f8fafc]",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 bg-[#3ea2da]/15 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(Na,{className:"w-5 h-5 text-[#3ea2da]"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-[#194b66] text-sm",children:"Phone"}),a.jsx("a",{href:"tel:+40744659659",className:"text-gray-500 text-sm hover:text-[#3ea2da] transition-colors mt-1 block",children:"+40 744 659 659"})]})]})}),a.jsx("div",{className:"p-5 rounded-xl border border-gray-100 bg-[#f8fafc]",children:a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-9 h-9 bg-[#3ea2da]/15 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(Or,{className:"w-5 h-5 text-[#3ea2da]"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-[#194b66] text-sm",children:"Email"}),a.jsx("a",{href:"mailto:[email protected]",className:"text-gray-500 text-sm hover:text-[#3ea2da] transition-colors mt-1 block",children:"[email protected]"})]})]})}),a.jsx("div",{className:"p-5 rounded-xl border border-gray-100 bg-[#f8fafc]",children:a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx("div",{className:"w-9 h-9 bg-[#3ea2da]/15 rounded-lg flex items-center justify-center flex-shrink-0 mt-0.5",children:a.jsx(qe,{className:"w-5 h-5 text-[#3ea2da]"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-semibold text-[#194b66] text-sm",children:"Opening Hours"}),a.jsx("p",{className:"text-gray-500 text-sm mt-1",children:"0/24"})]})]})})]}),a.jsx("div",{className:"rounded-xl overflow-hidden border border-gray-100 shadow-sm",children:a.jsx("iframe",{src:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d2732.5566!2d23.5993!3d46.7714!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x47490e9db29fa2d3%3A0x0!2sBulevardul+21+Decembrie+1989+16%2C+Cluj-Napoca!5e0!3m2!1sen!2sro!4v1",width:"100%",className:"h-48 sm:h-56 md:h-64 w-full block",style:{border:0},allowFullScreen:!0,loading:"lazy",referrerPolicy:"no-referrer-when-downgrade",title:"Xponential Transylvania location"})})]})}),a.jsxs("div",{className:"mt-10 sm:mt-14 lg:mt-16 pt-8 sm:pt-10 lg:pt-12 border-t border-gray-100",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("span",{className:"text-[#3ea2da] text-sm font-semibold uppercase tracking-widest",children:"Follow Us"}),a.jsx("h3",{className:"mt-2 text-2xl font-bold text-[#194b66]",children:"Stay Connected"}),a.jsx("p",{className:"mt-2 text-gray-400 text-sm max-w-md mx-auto",children:"Follow Xponential Transylvania on social media for workspace updates, community news, and upcoming events."})]}),a.jsxs("div",{className:"flex flex-wrap justify-center gap-4",children:[BZ.map(t=>{const e=t.icon;return a.jsxs("a",{href:t.href,target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-3 px-4 py-3 sm:px-5 sm:py-3 lg:px-6 lg:py-3.5 rounded-xl border border-gray-100 bg-white shadow-sm hover:shadow-card transition-all duration-200 hover:-translate-y-0.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center",style:{backgroundColor:`${t.color}15`},children:a.jsx(e,{className:"w-4 h-4",style:{color:t.color}})}),a.jsx("span",{className:"text-sm font-semibold text-[#194b66] group-hover:text-[#3ea2da] transition-colors",children:t.label})]},t.label)}),a.jsxs("a",{href:"https://www.tiktok.com/@xponential.transylvania",target:"_blank",rel:"noopener noreferrer",className:"group flex items-center gap-3 px-4 py-3 sm:px-5 sm:py-3 lg:px-6 lg:py-3.5 rounded-xl border border-gray-100 bg-white shadow-sm hover:shadow-card transition-all duration-200 hover:-translate-y-0.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg flex items-center justify-center bg-black/8",children:a.jsx("svg",{viewBox:"0 0 24 24",className:"w-4 h-4 fill-black",xmlns:"http://www.w3.org/2000/svg",children:a.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.33 6.33 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.69a8.17 8.17 0 0 0 4.78 1.53V6.77a4.85 4.85 0 0 1-1.01-.08Z"})})}),a.jsx("span",{className:"text-sm font-semibold text-[#194b66] group-hover:text-[#3ea2da] transition-colors",children:"TikTok"})]})]})]})]})})}function zM({isOpen:t,onClose:e}){return t?a.jsxs("div",{className:"fixed inset-0 bg-black/50 z-[100] overflow-y-auto",children:[a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:e}),a.jsx("div",{className:"flex min-h-screen items-center justify-center p-4",children:a.jsxs("div",{className:"relative w-full max-w-4xl transform overflow-hidden rounded-xl bg-white shadow-xl transition-all animate-slide-up",onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b sticky top-0 bg-white z-10",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-brand-premium/10 rounded-lg flex items-center justify-center",children:a.jsx(vr,{className:"w-5 h-5 text-brand-premium"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Termeni și Condiții Generale"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Terms and Conditions"})]})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors p-2",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"overflow-y-auto max-h-[calc(100vh-200px)] p-6",children:a.jsxs("div",{className:"prose max-w-none text-sm text-gray-700",children:[a.jsxs("p",{className:"text-gray-600 mb-6",children:[a.jsx("strong",{children:"Ultima actualizare:"})," 27 august 2025"]}),a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:a.jsx("p",{className:"text-blue-800",children:'Acești Termeni și Condiții Generale ("Termeni") guvernează utilizarea aplicației mobile și web "Xponential Coworking" (denumită în continuare "Aplicația"), precum și serviciile oferite de XPONENTIAL TRANSYLVANIA SRL prin intermediul acesteia.'})}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"1. Părțile Contractante"}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 mb-4",children:[a.jsx("p",{className:"font-semibold text-gray-800 mb
4411-2",children:"Furnizor de Servicii / Licențiat / Beneficiar:"}),a.jsxs("p",{children:[a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),a.jsx("br",{}),"Sediu: Bulevardul 21 Decembrie 1989 16, Cluj-Napoca 400094",a.jsx("br",{}),"Reprezentată de: Szocs Endre",a.jsx("br",{}),"Cod Unic de Înregistrare (CUI): 40158957",a.jsx("br",{}),"Număr în Registrul Comerțului: J12/5109/2018",a.jsx("br",{}),"EUID: ROONRC.J12/5109/2018",a.jsx("br",{}),"Data înființării: 2018",a.jsx("br",{}),'(denumită în continuare "Xponential" sau "Noi")']}),a.jsx("p",{className:"font-semibold text-gray-800 mt-4 mb-2",children:"Utilizator:"}),a.jsx("p",{children:'Orice persoană fizică sau juridică care accesează sau utilizează Aplicația și serviciile oferite de Xponential (denumită în continuare "Utilizatorul" sau "Dumneavoastră").'})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"2. Acceptarea Termenilor"}),a.jsx("p",{className:"mb-4",children:"Prin accesarea, navigarea sau utilizarea Aplicației și a serviciilor noastre, confirmați că ați citit, înțeles și sunteți de acord să respectați acești Termeni, precum și Politica noastră de Confidențialitate. Dacă nu sunteți de acord cu acești Termeni, vă rugăm să nu utilizați Aplicația."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"3. Serviciile Oferite"}),a.jsx("p",{className:"mb-2",children:"Aplicația Xponential Coworking permite Utilizatorilor să:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-4",children:[a.jsx("li",{children:"Creeze și să gestioneze un cont de utilizator (individual sau companie)."}),a.jsx("li",{children:"Exploreze și să rezerve spații de lucru (hot desk, dedicated desk, birouri private)."}),a.jsx("li",{children:"Exploreze și să rezerve săli de ședință."}),a.jsx("li",{children:"Înregistreze la evenimente organizate de Xponential sau parteneri."}),a.jsx("li",{children:"Gestioneze abonamentele și plățile."}),a.jsx("li",{children:"Vizualizeze istoricul rezervărilor și facturilor."}),a.jsx("li",{children:"Solicite tururi personalizate ale spațiilor."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"4. Contul de Utilizator"}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Crearea Contului:"})," Pentru a accesa majoritatea serviciilor, este necesară crearea unui cont. Veți furniza informații exacte, complete și actualizate, inclusiv tipul de cont (individual sau companie), nume, prenume, CNP (pentru persoane fizice), denumirea companiei, CUI (pentru companii), adresă, e-mail și parolă."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Responsabilitatea Contului:"})," Sunteți responsabil pentru menținerea confidențialității datelor de autentificare ale contului dumneavoastră și pentru toate activitățile care au loc sub contul dumneavoastră. Vă rugăm să ne notificați imediat în cazul oricărei utilizări neautorizate a contului."]}),a.jsxs("p",{className:"mb-4",children:[a.jsx("strong",{children:"Informații de Companie:"})," Utilizatorii cu cont de companie sunt responsabili pentru acuratețea datelor companiei furnizate (nume, CUI, tip, adresă, etc.), acestea fiind utilizate pentru facturare."]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"5. Rezervări și Plăți"}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Procesul de Rezervare:"})," Rezervările se fac exclusiv prin intermediul Aplicației. Toate rezervările sunt supuse disponibilității."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Prețuri și Plăți:"})," Prețurile serviciilor sunt afișate în Aplicație și pot varia în funcție de tipul spațiului, durată, perioadă și alte opțiuni suplimentare. Plățile se efectuează online, prin intermediul procesatorului de plăți Stripe. Xponential nu stochează datele cardului dumneavoastră."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Abonamente:"})," Anumite spații pot fi rezervate pe bază de abonament lunar. Detaliile abonamentelor, inclusiv prețul, durata și beneficiile (ex: ore de sală de ședință incluse), sunt specificate în Aplicație."]}
4411),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Coduri Promoționale:"})," Codurile promoționale pot fi aplicate la rezervări conform termenilor specifici ai fiecărui cod."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Ore Sală de Ședință:"})," Utilizatorii pot folosi orele de sală de ședință incluse în abonamentele lor sau achiziționate separat pentru a rezerva săli de ședință."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Facturare:"})," Facturile sunt generate automat prin SmartBill, utilizând datele furnizate la înregistrare (CNP pentru persoane fizice, CUI pentru companii). Facturile sunt disponibile în contul dumneavoastră."]}),a.jsxs("p",{className:"mb-4",children:[a.jsx("strong",{children:"Politica de Anulare și Rambursare:"})," Politica de anulare și rambursare este specificată pentru fiecare tip de serviciu (spațiu de lucru, sală de ședință, eveniment) în parte și este disponibilă în Aplicație și în contractele specifice."]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"6. Conduita Utilizatorului"}),a.jsxs("ul",{className:"list-disc pl-6 mb-4",children:[a.jsx("li",{children:"Sunteți de acord să utilizați Aplicația și serviciile Xponential într-un mod legal, etic și în conformitate cu acești Termeni."}),a.jsx("li",{children:"Este interzisă utilizarea Aplicației în scopuri ilegale, frauduloase sau dăunătoare."}),a.jsx("li",{children:"Este interzisă perturbarea funcționării Aplicației sau a serviciilor Xponential."}),a.jsx("li",{children:"Utilizatorii spațiilor fizice sunt obligați să respecte regulamentul intern al Xponential, normele de siguranță și bună conduită."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"7. Proprietatea Intelectuală"}),a.jsx("p",{className:"mb-4",children:"Toate drepturile de proprietate intelectuală asupra Aplicației, conținutului acesteia (texte, imagini, grafică, logo-uri, software) aparțin Xponential Transylvania SRL sau licențiatorilor săi. Este interzisă copierea, reproducerea, distribuirea sau utilizarea neautorizată a oricărui conținut din Aplicație."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"8. Limitarea Răspunderii"}),a.jsx("p",{className:"mb-2",children:'Aplicația și serviciile sunt furnizate "ca atare". Xponential nu oferă garanții de niciun fel, exprese sau impl
4411icite, privind funcționarea Aplicației sau acuratețea informațiilor.'}),a.jsx("p",{className:"mb-2",children:"Xponential nu va fi răspunzătoare pentru niciun fel de daune directe, indirecte, incidentale, speciale sau punitive, rezultate din utilizarea sau imposibilitatea de a utiliza Aplicația sau serviciile noastre."}),a.jsx("p",{className:"mb-4",children:"Răspunderea Xponential este limitată la valoarea sumelor plătite de Utilizator pentru serviciile specifice care au generat pretenția."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"9. Despăgubiri"}),a.jsx("p",{className:"mb-4",children:"Sunteți de acord să despăgubiți și să exonerați Xponential, afiliații săi, directorii, angajații și agenții de orice pretenții, daune, obligații, pierderi, costuri sau datorii (inclusiv, dar fără a se limita la, onorarii rezonabile ale avocaților) care decurg din: (i) utilizarea și accesul dumneavoastră la Aplicație și servicii; (ii) încălcarea oricărui termen al acestor Termeni; (iii) încălcarea oricărui drept al unei terțe părți, inclusiv, fără limitare, orice drept de proprietate intelectuală sau drept la confidențialitate; sau (iv) orice pretenție că una dintre informațiile dumneavoastră a cauzat daune unei terțe părți."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"10. Încetarea"}),a.jsx("p",{className:"mb-4",children:"Xponential își rezervă dreptul de a suspenda sau înceta accesul dumneavoastră la Aplicație și servicii, cu sau fără notificare prealabilă, în cazul încălcării acestor Termeni sau a oricăror legi aplicabile."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"11. Legea Aplicabilă și Jurisdicția"}),a.jsx("p",{className:"mb-4",children:"Acești Termeni vor fi guvernați și interpretați în conformitate cu legile din România. Orice litigiu care decurge din sau în legătură cu acești Termeni va fi soluționat de instanțele competente din Cluj-Napoca, România."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"12. Modificări ale Termenilor"}),a.jsx("p",{className:"mb-4",children:"Xponential își rezervă dreptul de a modifica acești Termeni în orice moment. Orice modificare va fi publicată în Aplicație și va intra în vigoare imediat după publicare. Continuarea utilizării Aplicației după publicarea modificărilor constituie acceptarea acestora."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"13. Contact"}),a.jsxs("div",{className:"bg-brand-premium/5 rounded-lg p-4",children:[a.jsx("p",{className:"mb-2",children:"Pentru orice întrebări sau nelămuriri legate de acești Termeni, vă rugăm să ne contactați la:"}),a.jsxs("p",{children:[a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),a.jsx("br",{}),"E-mail: [email protected]",a.jsx("br",{}),"Telefon: +40 744 659 659"]})]})]})}),a.jsx("div",{className:"sticky bottom-0 bg-white border-t p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{}),a.jsx("button",{onClick:e,className:"bg-brand-premium text-white px-6 py-2 rounded-lg hover:bg-opacity-90 transition-colors font-medium",children:"Închide"})]})})]})})]}):null}function HM({isOpen:t,onClose:e}){return t?a.jsxs("div",{className:"fixed inset-0 bg-black/50 z-[100] overflow-y-auto",children:[a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:e}),a.jsx("div",{className:"flex min-h-screen items-center justify-center p-4",children:a.jsxs("div",{className:"relative w-full max-w-4xl transform overflow-hidden rounded-xl bg-white shadow-xl transition-all animate-slide-up",onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b sticky top-0 bg-white z-10",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-blue-100 rounded-lg flex items-center justify-center",children:a.jsx(vo,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Politica de Confidențialitate"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Privacy Policy"})]})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors p-2",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"overflow-y-auto max-h-[calc(100vh-200px)] p-6",children:a.jsxs("div",{className:"prose max-w-none text-sm text-gray-700",children:[a.jsxs("p",{className:"text-gray-600 mb-6",children:[a.jsx("strong",{children:"Ultima actualizare:"})," 27 august 2025"]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[a.jsxs("p",{className:"text-blue-800",children:["Această Politică de Confidențialitate descrie modul în care ",a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),' ("Xponential", "Noi") colectează, utilizează, stochează și protejează datele dumneavoastră cu caracter personal Ã
4411®n legătură cu utilizarea aplicației mobile și web "Xponential Coworking" (denumită în continuare "Aplicația") și a serviciilor noastre.']}),a.jsx("p",{className:"text-blue-800 mt-3",children:'Ne angajăm să protejăm confidențialitatea datelor dumneavoastră și să respectăm prevederile Regulamentului (UE) 2016/679 ("GDPR") și ale legislației naționale în vigoare privind protecția datelor cu caracter personal.'})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"1. Operatorul de Date cu Caracter Personal"}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4 mb-6",children:a.jsxs("p",{children:[a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),a.jsx("br",{}),"Sediu: Bulevardul 21 Decembrie 1989 16, Cluj-Napoca 400094",a.jsx("br",{}),"Reprezentată de: Szocs Endre",a.jsx("br",{}),"CUI: 40158957",a.jsx("br",{}),"Număr în Registrul Comerțului: J12/5109/2018",a.jsx("br",{}),"EUID: ROONRC.J12/5109/2018",a.jsx("br",{}),"E-mail: [email protected]",a.jsx("br",{}),"Telefon: +40 744 659 659"]})}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"2. Definiții Cheie (conform GDPR)"}),a.jsxs("div",{className:"space-y-3 mb-6",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Date cu Caracter Personal:"}),' Orice informații privind o persoană fizică identificată sau identificabilă ("persoana vizată").']}),a.jsxs("p",{children:[a.jsx("strong",{children:"Prelucrare:"})," Orice operațiune sau set de operațiuni efectuate asupra datelor cu caracter personal (ex: colectare, înregistrare, stocare, utilizare, ștergere)."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Operator:"})," Persoana fizică sau juridică (în cazul nostru, Xponential) care stabilește scopurile și mijloacele de prelucrare a datelor cu caracter personal."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Persoană Împuternicită de Operator:"})," Persoana fizică sau juridică (ex: Stripe, SmartBill) care prelucrează date cu caracter personal în numele Operatorului."]})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"3. Principii de Prelucrare a Datelor cu Caracter Personal"}),a.jsx("p",{className:"mb-3",children:"Xponential respectă următoarele principii în prelucrarea datelor cu caracter personal:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-6 space-y-1",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Legalitate, echitate și transparență:"})," Datele sunt prelucrate legal, echitabil și transparent față de persoana vizată."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Limitări legate de scop:"})," Datele sunt colectate în scopuri determinate, explicite și legitime și nu sunt prelucrate ulterior într-un mod incompatibil cu aceste scopuri."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Minimizarea datelor:"})," Colectăm doar date adecvate, relevante și limitate la ceea ce este necesar în raport cu scopurile pentru care sunt prelucrate."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Acuratețe:"})," Datele sunt exacte și, dacă este necesar, actualizate."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Limitări legate de stocare:"})," Datele sunt păstrate într-o formă care permite identificarea persoanelor vizate pe o perioadă care nu depășește perioada necesară îndeplinirii scopurilor pentru care sunt prelucrate."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Integritate și confidențialitate:"})," Datele sunt prelucrate într-un mod care asigură securitatea adecvată a datelor cu caracter personal, inclusiv protecția împotriva prelucrării neautorizate sau ilegale și împotriva pierderii, a distrugerii sau a deteriorării accidentale."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Responsabilitate:"})," Xponential este responsabilă pentru respectarea principiilor de mai sus și trebuie să poată demonstra acest lucru."]})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"4. Ce Date cu Caracter Personal Colectăm și Cum le Utilizăm (Scopuri și Temei Juridic)"}),a.jsx("p",{className:"mb-3",children:"Colectăm și prelucrăm date cu caracter personal Ã
4411®n următoarele scopuri și pe baza următoarelor temeiuri juridice:"}),a.jsx("div",{className:"overflow-x-auto mb-6",children:a.jsxs("table",{className:"min-w-full border border-gray-300 text-xs",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"border border-gray-300 px-3 py-2 text-left font-medium",children:"Categoria de Date Colectate"}),a.jsx("th",{className:"border border-gray-300 px-3 py-2 text-left font-medium",children:"Scopul Prelucrării"}),a.jsx("th",{className:"border border-gray-300 px-3 py-2 text-left font-medium",children:"Temeiul Juridic (GDPR Art. 6)"}),a.jsx("th",{className:"border border-gray-300 px-3 py-2 text-left font-medium",children:"Perioada de Păstrare"})]})}),a.jsxs("tbody",{children:[a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date de Identificare și Contact (Nume, Prenume, E-mail, Telefon, CNP, Nume Companie, CUI, Tip Companie, Poziție, Industrie, Mărime Companie, Țară, Județ, Website, Profil LinkedIn)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Crearea și gestionarea contului de utilizator; Furnizarea serviciilor (rezervări, înregistrări evenimente); Comunicarea cu Utilizatorul; Facturare."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Executarea unui contract (Art. 6(1)b); Obligație legală (Art. 6(1)c) pentru facturare."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Pe durata existenței contului și 10 ani de la ultima tranzacție pentru datele fiscale."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date de Rezervare și Tranzacție (Tip spațiu/sală, Dată, Oră, Număr persoane, Durată, Preț, Status plată, ID sesiune Stripe, ID abonament Stripe, ID factură SmartBill, ID rezervare, Detalii extra opțiuni, PIN acces)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Procesarea rezervărilor și plăților; Generarea facturilor; Gestionarea abonamentelor și orelor de sală de ședință; Gestionarea rambursărilor."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Executarea unui contract (Art. 6(1)b); Obligație legală (Art. 6(1)c)."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"10 ani de la data tranzacției/rezervării."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date de Înregistrare Evenimente (ID eveniment, Nume Utilizator, E-mail Utilizator, Status plată, Data înregistrării, Status participare, Notițe)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Gestionarea înregistrărilor la evenimente; Monitorizarea participării."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Executarea unui contract (Art. 6(1)b); Interes legitim (Art. 6(1)f) pentru organizarea evenimentului."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"5 ani de la data evenimentului."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date Solicitare Tur Personalizat (Nume, E-mail, Telefon, Companie, Dată și Oră preferată, Interese, Mesaj, Notițe)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Programarea și gestionarea tururilor personalizate."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Consimțământ (Art. 6(1)a); Interes legitim (Art. 6(1)f) pentru dezvoltarea afacerii."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"2 ani de la data solicitării."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date de Utilizare și Tehnice (Adresă IP, Tip browser, Sistem de operare, Pagini vizitate, Durata vizitei, Referințe URL, Identificatori de dispozitiv, Date de logare, Informații despre erori)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Îmbunătățirea funcționalității și securității Aplicației; Analiza performanței și a experienței utilizatorului; Diagnosticarea problemelor tehnice."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Interes legitim (Art. 6(1)f) pentru funcționarea și îmbunătățirea serviciilor."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Până la 2 ani pentru datele analitice; Perioade mai scurte pentru log-uri de erori."})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Date de Autentificare (ID utilizator Firebase, Status cont, Data înregistrării, Status abonament, Ore sală de ședință)"}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Autentificarea utilizatorilor; Gestionarea accesului la servicii; Monitorizarea statusului abonamentelor și a orelor de sală de ședință."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Executarea unui contract (Art. 6(1)b)."}),a.jsx("td",{className:"border border-gray-300 px-3 py-2",children:"Pe durata existenței contului."})]})]})]})}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"5. Cui Dezvăluim Datele Dumneavoastră (Destinatari ai Datelor)"}),a.jsx("p",{className:"mb-3",children:"Pentru a furniza serviciile noastre, putem partaja datele dumneavoastră cu caracter personal cu următoarele categorii de destinatari:"}),a.jsxs("div",{className:"mb-4",children:[a.jsx("h5",{className:"font-medium text-gray-800 mb
4411-2",children:"Furnizori de Servicii Tehnice:"}),a.jsxs("ul",{className:"list-disc pl-6 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Firebase (Google LLC):"})," Pentru autentificare, baza de date (Firestore), stocare fișiere (Storage) și analiză (Analytics). Datele pot fi transferate în SUA, conform clauzelor contractuale standard (SCCs) sau a altor mecanisme de transfer aprobate de UE."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Stripe, Inc.:"})," Procesator de plăți pentru tranzacții și abonamente. Xponential nu stochează direct datele cardului dumneavoastră. Stripe prelucrează datele de plată conform propriei politici de confidențialitate. Datele pot fi transferate în SUA, conform SCCs."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"SmartBill (SmartBill SRL):"})," Pentru generarea și emiterea facturilor."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Netlify, Inc.:"})," Pentru găzduirea funcțiilor backend (Netlify Functions) și a webhook-urilor."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Google Fonts:"})," Pentru încărcarea fonturilor."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Pexels:"})," Pentru imagini de stoc (doar link-uri, nu descărcăm imagini)."]})]})]}),a.jsx("div",{className:"mb-4",children:a.jsxs("p",{children:[a.jsx("strong",{children:"Autorități Publice:"})," Putem dezvălui datele dumneavoastră dacă suntem obligați prin lege sau dacă este necesar pentru a proteja drepturile, proprietatea sau siguranța Xponential, a utilizatorilor noștri sau a publicului."]})}),a.jsx("div",{className:"mb-6",children:a.jsxs("p",{children:[a.jsx("strong",{children:"Transferuri de Afaceri:"})," În cazul unei fuziuni, achiziții sau vânzări de active, datele dumneavoastră pot fi transferate către terța parte implicată."]})}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"6. Transferul Internațional de Date"}),a.jsx("p",{className:"mb-4",children:"Deoarece utilizăm servicii precum Firebase (Google) și Stripe, datele dumneavoastră pot fi transferate și stocate în țări din afara Spațiului Economic European (SEE), inclusiv în Statele Unite ale Americii. Ne asigurăm că aceste transferuri se realizează în conformitate cu cerințele GDPR, bazându-ne pe:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-6",children:[a.jsx("li",{children:"Decizii de adecvare ale Comisiei Europene (dacă există)."}),a.jsx("li",{children:"Clauze Contractuale Standard (SCCs) aprobate de Comisia Europeană."}),a.jsx("li",{children:"Alte mecanisme de transfer aprobate de GDPR."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"7. Securitatea Datelor"}),a.jsx("p",{className:"mb-3",children:"Implementăm măsuri tehnice și organizaționale adecvate pentru a proteja datele dumneavoastră cu caracter personal împotriva accesului neautorizat, pierderii, distrugerii sau modificării. Aceste măsuri includ, dar nu se limitează la:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-6",children:[a.jsx("li",{children:"Criptarea datelor în tranzit (SSL/TLS)."}),a.jsx("li",{children:"Controlul accesului la sistemele noastre."}),a.jsx("li",{children:"Utilizarea de parole puternice și autentificare multi-factor."}),a.jsx("li",{children:"Monitorizarea constantă a sistemelor pentru vulnerabilități."}),a.jsx("li",{children:"Politici interne de securitate a datelor."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"8. Perioada de Păstrare a Datelor"}),a.jsx("p",{className:"mb-6",children:"Păstrăm datele dumneavoastră cu caracter personal doar atât timp cât este necesar pentru îndeplinirea scopurilor pentru care au fost colectate, conform tabelului de la secțiunea 4, sau pentru a respecta obligațiile legale (ex: legislația fiscală și contabilă impune păstrarea documentelor financiare timp de 10 ani). După expirarea perioadei de păstrare, datele vor fi șterse sau anonimizate."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"9. Drepturile Dumneavoastră (Drepturile Persoanei Vizate)"}
4411),a.jsx("p",{className:"mb-3",children:"Conform GDPR, aveți următoarele drepturi în legătură cu datele dumneavoastră cu caracter personal:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-6 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul la informare (Art. 13, 14 GDPR):"})," Dreptul de a primi informații clare, transparente și ușor de înțeles despre modul în care vă prelucrăm datele."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul de acces (Art. 15 GDPR):"})," Dreptul de a obține o confirmare că datele dumneavoastră sunt prelucrate și, dacă da, acces la aceste date și informații despre prelucrare."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul la rectificare (Art. 16 GDPR):"})," Dreptul de a solicita corectarea datelor inexacte sau completarea datelor incomplete."]}),a.jsxs("li",{children:[a.jsx("strong",{children:'Dreptul la ștergerea datelor ("dreptul de a fi uitat") (Art. 17 GDPR):'})," Dreptul de a solicita ștergerea datelor dumneavoastră în anumite circumstanțe (ex: datele nu mai sunt necesare, v-ați retras consimțământul)."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul la restricționarea prelucrării (Art. 18 GDPR):"})," Dreptul de a solicita restricționarea prelucrării datelor dumneavoastră în anumite situații (ex: contestați exactitatea datelor)."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul la portabilitatea datelor (Art. 20 GDPR):"})," Dreptul de a primi datele dumneavoastră într-un format structurat, utilizat în mod curent și care poate fi citit automat, și de a le transmite altui operator."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul la opoziție (Art. 21 GDPR):"})," Dreptul de a vă opune prelucrării datelor dumneavoastră în anumite scopuri (ex: marketing direct)."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul de a retrage consimțământul (Art. 7 GDPR):"})," Dacă prelucrarea se bazează pe consimțământul dumneavoastră, aveți dreptul de a-l retrage în orice moment, fără a afecta legalitatea prelucrării efectuate înainte de retragere."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Dreptul de a depune o plângere (Art. 77 GDPR):"})," Dreptul de a depune o plângere la Autoritatea Națională de Supraveghere a Prelucrării Datelor cu Caracter Personal (ANSPDCP) dacă considerați că drepturile dumneavoastră au fost încălcate."]})]}),a.jsxs("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-6",children:[a.jsx("h5",{className:"font-medium text-red-800 mb-2",children:"Autoritatea Națională de Supraveghere a Prelucrării Datelor cu Caracter Personal (ANSPDCP)"}),a.jsxs("p",{className:"text-red-700 text-xs",children:["B-dul G-ral. Gheorghe Magheru 28-30, Sector 1, cod poștal 010336, București, România",a.jsx("br",{}),"Telefon: +40.318.059.211; +40.318.059.212",a.jsx("br",{}),"E-mail: [email protected]",a.jsx("br",{}),"Web: www.dataprotection.ro"]})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"10. Module Cookie și Tehnologii Similare"}),a.jsx("p",{className:"mb-3",children:"Aplicația noastră utilizează doar tehnologii de stocare locală esențiale pentru funcționarea de bază a serviciilor."}),a.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4 mb-4",children:[a.jsx("h5",{className:"font-medium text-green-800 mb-2",children:"Ce NU utilizăm:"}),a.jsxs("ul",{className:"list-disc pl-6 text-green-700",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Google Analytics"})," sau alte sisteme de analiză a traficului"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Module cookie de marketing"})," sau de urmărire"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Sisteme de tracking"})," pentru comportamentul utilizatorilor"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Cookie-uri terțe părți"})," pentru publicitate"]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Identificatori de dispozitiv"})," pentru urmărire"]})]})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mb-6",children:[a.jsx("h5",{className:"font-medium text-blue-800 mb-2",children:"Ce utilizăm doar pentru funcționare:"}),a.jsxs("ul",{className:"list-disc pl-6 text-blue-700",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Stocare locală (Local Storage):"})," Pentru salvarea sesiunii de autentificare și a preferințelor utilizatorilor (ex: preferințe de valută)."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Cookie-uri de sesiune esențiale:"})," Doar pentru menținerea autentificării în timpul utilizării Aplicației."]})]}),a.jsx("p",{className:"mt-3 text-blue-700 text-sm",children:"Aceste tehnologii sunt strict necesare pentru funcționarea Aplicației și nu sunt utilizate pentru urmărire, analiză sau marketing."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"11. Confidențialitatea Minorilor"}),a.jsx("p",{className:"mb-6",children:"Serviciile noastre nu se adresează persoanelor sub vârsta de 16 ani. Nu colectăm cu bună știință date cu caracter personal de la minori. Dacă aflăm că am colectat date de la un minor fără c
4411onsimțământul părinților, vom lua măsuri pentru a șterge acele informații."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"12. Modificări ale Politicii de Confidențialitate"}),a.jsx("p",{className:"mb-6",children:"Ne rezervăm dreptul de a actualiza această Politică de Confidențialitate în orice moment. Orice modificare va fi publicată în Aplicație și va intra în vigoare imediat după publicare. Vă încurajăm să revizuiți periodic această pagină pentru a fi la curent cu cele mai recente informații privind practicile noastre de confidențialitate."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"13. Contact"}),a.jsxs("div",{className:"bg-brand-premium/5 rounded-lg p-4",children:[a.jsx("p",{className:"mb-2",children:"Pentru orice întrebări sau solicitări privind prelucrarea datelor dumneavoastră cu caracter personal sau exercitarea drepturilor dumneavoastră, vă rugăm să ne contactați la:"}),a.jsxs("p",{children:[a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),a.jsx("br",{}),"E-mail: [email protected]",a.jsx("br",{}),"Telefon: +40 744 659 659"]})]})]})}),a.jsx("div",{className:"sticky bottom-0 bg-white border-t p-6",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("div",{}),a.jsx("button",{onClick:e,className:"bg-brand-premium text-white px-6 py-2 rounded-lg hover:bg-opacity-90 transition-colors font-medium",children:"Închide"})]})})]})})]}):null}function VZ({isOpen:t,onClose:e}){return t?a.jsxs("div",{className:"fixed inset-0 bg-black/50 z-[100] overflow-y-auto",children:[a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 transition-opacity",onClick:e}),a.jsx("div",{className:"flex min-h-screen items-center justify-center p-4",children:a.jsxs("div",{className:"relative w-full max-w-4xl transform overflow-hidden rounded-xl bg-white shadow-xl transition-all animate-slide-up",onClick:r=>r.stopPropagation(),children:[a.jsxs("div",{className:"flex items-center justify-between p-6 border-b sticky top-0 bg-white z-10",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-brand-premium/10 rounded-lg flex items-center justify-center",children:a.jsx(vo,{className:"w-5 h-5 text-brand-premium"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Regulamentul Intern de Funcționare"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Internal Regulations"})]})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors p-2",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"overflow-y-auto max-h-[calc(100vh-200px)] p-6",children:a.jsxs("div",{className:"prose max-w-none text-sm text-gray-700",children:[a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. I - DISPOZIȚII GENERALE"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 1. Cadrul Legal"}),a.jsx("p",{className:"mb-4",children:"Normele privind organizarea și disciplina muncii în cadrul SC Xponential Transylvania SRL, cu sediul în Cluj-Napoca, Bld. 21 Decembrie 1989, Nr.16, Jud. Cluj, sunt stabilite prin prezentul Regulament Intern, întocmit în baza prevederilor Legii nr. 53/2003 – Codul Muncii, republicată. Dispozițiile acestuia respectă integral prevederile legislației muncii în vigoare la data întocmirii."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 2. Obligativitatea Regulamentului"}),a.jsx("p",{className:"mb-2",children:"Prevederile prezentului Regulament Intern sunt obligatorii pentru toți salariații și clienții care lucrează în incinta clădirii Xponential Transylvania și intră în vigoare din momentul înștiințării acestora."}),a.jsx("p",{className:"mb-2",children:"Regulamentul se aplică tuturor salariaților și clienților, indiferent de durata contractului de muncă (determinată/nedeterminată) sau de modalitatea în care este prestată munca."}),a.jsx("p",{className:"mb-2",children:"Obligativitatea respectării normelor revine și salariaților detașați de la alți angajatori pe peri
4411oada detașării lor în cadrul societății."}),a.jsx("p",{className:"mb-4",children:"Persoanele delegate au obligația de a respecta, pe lângă normele de disciplină stabilite de propriul angajator, și normele specifice procesului de muncă din cadrul societății pe parcursul delegării."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 3. Modificarea Regulamentului"}),a.jsx("p",{className:"mb-6",children:"Prevederile prezentului Regulament Intern se modifică de drept în conformitate cu actele normative ulterioare. Noile prevederi legislative vor urma procedura de informare și consultare internă corespunzător regulilor stabilite de părți."}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. II - PRINCIPII FUNDAMENTALE. NEDISCRIMINAREA ȘI RESPECTAREA DEMNITĂȚII"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 4. Egalitatea de Tratament și Nediscriminarea"}),a.jsx("p",{className:"mb-2",children:"În cadrul relațiilor de muncă funcționează principiul egalității de tratament față de toți salariații."}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Interdicție:"})," Este interzisă orice discriminare bazată pe criterii de sex, orientare sexuală, caracteristici genetice, vârstă, apartenență națională, rasă, culoare, etnie, religie, opțiune politică, origine socială, handicap, situație sau responsabilitate familială, apartenență ori activitate sindicală."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Discriminarea directă:"})," Este interzisă orice diferență de tratament a unei persoane în defavoarea acesteia din cauza sexului, gravidității, nașterii, maternității sau a concediului paternal."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Practici interzise:"})," Este interzisă utilizarea de către angajator a unor practici care dezavantajează persoanele în legătură cu:"]}),a.jsxs("ol",{className:"list-decimal pl-6 mb-4 space-y-1",children:[a.jsx("li",{children:"Anunțarea, organizarea concursurilor/examenelor și selecția candidaților."}),a.jsx("li",{children:"Încheierea, suspendarea, modificarea și/sau încetarea contractului de muncă."}),a.jsx("li",{children:"Stabilirea sau modificarea atribuțiilor din fișa postului."}),a.jsx("li",{children:"Stabilirea remunerației și a beneficiilor extrasalariale."}),a.jsx("li",{children:"Evaluarea performanțelor profesionale și promovarea."}),a.jsx("li",{children:"Aplicarea măsurilor disciplinare."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 5. Hărțuirea Sexuală și Încălcarea Demnității"}),a.jsx("p",{className:"mb-2",children:"Nu se tolerează manifestările de hărțuire sexuală. Constituie hărțuire și abatere disciplinară gravă orice comportament care are ca scop:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-4 space-y-1",children:[a.jsx("li",{children:"Crearea la locul de muncă a unei atmosfere de intimidare, ostilitate sau descurajare pentru persoana afectată."}),a.jsx("li",{children:"Influențarea negativă a situației angajatului (promovare, remunerație, formare profesională) în cazul refuzului acestuia de a accepta un comportament nedorit aferent vieții sexuale."})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 6. Drepturile Salariaților"}),a.jsx("p",{className:"mb-6",children:"Salariații beneficiază de condiții de muncă adecvate activității desfășurate, de protecție socială, securitate și sănătate în muncă, precum și de dreptul la plată pentru munca depusă, negocieri colective/individuale și protecția datelor cu caracter personal. Relațiile de muncă se bazează pe principiul bunei-credințe."}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. III - ACCES, SECURITATE ȘI ORARUL DE FUNCȚIONARE"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 7. Accesul și Securitatea în Clădire"}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Acces personal:"})," Intrarea în clădirea de birouri și în spațiile individuale se face exclusiv pe baza codurilor de acces unice (sau cardurilor)."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Regimul 24/7:"})," Conform contractului de închiriere, chiriașii și angajații acestora au acces în clădire 24 de ore din 24, 7 zile din 7."]}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Utilizarea codurilor:"})," Fiecare angajat este obligat să folosească doar propriul cod/card la intrare și ieșire. Este str
4411ict interzisă înstrăinarea, împrumutarea codului sau permiterea accesului persoanelor străine fără utilizarea codului. Registrul de acces este verificat periodic de serviciul de securitate."]}),a.jsx("p",{className:"mb-2",children:a.jsx("strong",{children:"Regimul de funcționare și operare al sistemului de alarmă:"})}),a.jsxs("ul",{className:"list-disc pl-6 mb-4 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Activarea automată:"})," În timpul săptămânii (de luni până vineri), sistemul de alarmă se activează automat în fiecare seară la ora 22:00 și se dezactivează automat în fiecare dimineață la ora 08:00."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Părăsirea clădirii după ora 22:00:"})," Dacă un angajat rămâne la birou peste ora 22:00, acesta are obligația ca, în momentul plecării, să activeze manual sistemul de alarmă."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Sosirea înainte de ora 08:00:"})," Dacă un angajat sosește la birou dimineața înainte de deschiderea recepției (ora 08:00), acesta este obligat să dezactiveze manual sistemul de alarmă imediat după intrarea în clădire."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Regimul de Weekend:"})," În zilele de weekend (sâmbătă și duminică), alarma clădirii rămâne activă în permanență (tot timpul). În acest interval, primul angajat care sosește la clădire trebuie să dezactiveze manual alarma, iar ultimul angajat care părăsește clădirea este absolut obligat să o reactiveze manual."]})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 8. Primirea Vizitatorilor"}),a.jsx("p",{className:"mb-2",children:"Vizitatorii și oaspeții pot fi primiți în clădire exclusiv în intervalul orar 08:00 – 17:00, cu respectarea condițiilor contractuale."}),a.jsx("p",{className:"mb-4",children:"În afara acestui interval, staționarea persoanelor străine în clădire este strict interzisă."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 9. Programul de Lucru și Prezența în Clădire"}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Program oficial:"})," Programul oficial de funcționare al clădirii de birouri este de luni până vineri, între orele 08:00 și 17:00."]}),a.jsxs("p",{className:"mb-6",children:[a.jsx("strong",{children:"Restricții de noapte/weekend:"})," Rămânerea în incinta clădirii după ora 22:00 sau în zilele de weekend (sâmbătă și duminică) este permisă exclusiv în scopuri justificate de muncă."]}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. IV - UTILIZAREA SPAȚIILOR COMUNE ȘI IGIENĂ"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 10. Reguli Privind Bucătăria Comună"}),a.jsx("p",{className:"mb-2",children:"Menținerea curățeniei în bucătărie este o responsabilitate comună. Se vor respecta următoarele reguli:"}),a.jsxs("ul",{className:"list-disc pl-6 mb-4 space-y-2",children:[a.jsxs("li",{children:[a.jsx("strong",{children:"Vesela:"})," Este interzisă lăsarea vaselor, paharelor sau tacâmurilor folosite în chiuvetă sau pe blat. Acestea trebuie introduse imediat în mașina de spălat vase."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Golitirea mașinii de spălat vase:"}
4411)," Dacă programul mașinii s-a încheiat, utilizatorii bucătăriei sunt rugați să ajute la strângerea vaselor curate pentru a elibera spațiul."]}),a.jsxs("li",{children:[a.jsx("strong",{children:"Păstrarea curățeniei:"})," Orice pată sau murdărie apărută în timpul preparării hranei pe blaturi, mese sau aparate electrocasnice (cuptor cu microunde, espressor) trebuie ștersă imediat."]})]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 11. Utilizarea Frigiderului și Curățenia de Vineri"}),a.jsx("p",{className:"mb-2",children:"Toate alimentele sau caserolele depozitate în frigiderul comun trebuie să fie marcate cu numele proprietarului."}),a.jsx("div",{className:"bg-amber-50 border border-amber-200 rounded-lg p-4 mb-6",children:a.jsx("p",{className:"text-amber-800",children:"Pentru prevenirea alterării alimentelor, serviciul de curățenie va goli complet frigiderul în fiecare zi de vineri, exact la ora 16:00. Caserolele personale trebuie luate înainte de această oră. Tot ce rămâne în frigider după ora 16:00 va fi aruncat integral la gunoi, inclusiv recipientele."})}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. V - ORDINE, CURĂȚENIE ȘI GOSPODĂRIREA CLĂDIRII"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 12. Colectarea Selectivă a Deșeurilor"}),a.jsx("p",{className:"mb-4",children:"În clădire se aplică colectarea selectivă a deșeurilor. Angajații sunt obligați să arunce deșeurile (hârtie/carton, plastic/metal, sticlă, deșeuri menajere) exclusiv în pubelele speciale, marcate corespunzător."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 13. Utilizarea Echipamentelor Comune"}),a.jsx("p",{className:"mb-4",children:"Echipamentele comune (imprimante/copiatoare, mobilierul din sălile de ședințe, zone de relaxare) trebuie folosite cu grijă și conform destinației lor. Orice defecțiune sau deteriorare observată trebuie raportată imediat departamentului de administrație."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 14. Curățenia în Zonele de Tranzit"}),a.jsx("p",{className:"mb-4",children:"Se va păstra ordinea pe holuri, în toalete și la recepție. Este interzisă lăsarea ambalajelor sau cutiilor mari provenite din colete pe holurile comune. Acestea trebuie depozitate în zona special amenajată de lângă ieșirea din spate."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 15. Fumatul"}),a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-6",children:a.jsxs("p",{className:"text-red-800",children:[a.jsx("strong",{children:"Interdicție Absolută:"})," Fumatul, inclusiv utilizarea țigărilor electronice sau a altor dispozitive alternative de vapat, este strict interzis în toate spațiile interioare ale clădirii (inclusiv toalete, casa scării sau în apropierea ferestrelor deschise). Fumatul este permis exclusiv în curtea interioară, în spațiul exterior special amenajat."]})}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. VI - ACTIVITĂȚI INTERZISE ȘI RĂSPUNDEREA INDIVIDUALĂ"}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 16. Activități Ilegale și Jocuri de Noroc"}),a.jsx("p",{className:"mb-4",children:"Este strict interzisă organizarea sau participarea la jocuri de noroc, precum și desfășurarea oricăror activități care încalcă legislația în vigoare sau bunele moravuri în incinta clădirii."}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 17. Regimul Răspunderii pentru Bunuri Materiale"}),a.jsxs("p",{className:"mb-2",children:[a.jsx("strong",{children:"Birouri închiriate:"})," Administrația își asumă răspunderea pentru siguranța bunurilor lăsate în birourile oficial închiriate și în punctele de lucru desemnate, conform protocoalelor normale de pază și securitate."]}),a.jsxs("p",{className:"mb-4",children:[a.jsx("strong",{children:"Spații comune:"})," Administrația nu își asumă nicio răspundere pentru obiectele personale sau valorile lăsate nesupravegheate în spațiile c
4411omune (holuri, bucătărie, toalete, săli de ședințe, terasă). Siguranța acestora revine integral proprietarului."]}),a.jsx("h4",{className:"text-lg font-semibold mb-3 text-gray-900",children:"Art. 18. Răspunderea pentru Vizitatori"}),a.jsx("p",{className:"mb-6",children:"Fiecare chiriaș/angajat răspunde direct de comportamentul vizitatorilor pe care îi primește și este direct răspunzător pentru eventualele daune sau distrugeri provocate de aceștia clădirii sau echipamentelor."}),a.jsx("h3",{className:"text-xl font-bold text-gray-900 mb-6",children:"CAP. VII - NUMERE DE URGENȚĂ (SĂNĂTATE ȘI SECURITATE)"}),a.jsx("p",{className:"mb-4",children:"În caz de accident, incendiu sau avarii tehnice grave, se vor apela de urgență următoarele numere:"}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4 mb-6",children:a.jsxs("table",{className:"w-full text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-gray-200",children:[a.jsx("th",{className:"text-left py-2 pr-4 font-semibold text-gray-900",children:"Serviciu / Departament"}),a.jsx("th",{className:"text-left py-2 font-semibold text-gray-900",children:"Număr de contact"})]})}),a.jsxs("tbody",{className:"divide-y divide-gray-100",children:[a.jsxs("tr",{children:[a.jsx("td",{className:"py-2 pr-4",children:"Număr Unic de Urgență (Poliție, Pompieri, Salvare)"}),a.jsx("td",{className:"py-2 font-semibold",children:"112"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"py-2 pr-4",children:"Recepție Clădire de Birouri"}),a.jsx("td",{className:"py-2",children:"+40 744 659 659"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"py-2 pr-4",children:"Administrație Clădire"}),a.jsx("td",{className:"py-2",children:"+40 748 659 659"})]}),a.jsxs("tr",{children:[a.jsx("td",{className:"py-2 pr-4",children:"Spitalul Clinic Județean de Urgență (UPU Cluj)"}),a.jsx("td",{className:"py-2",children:"Str. Clinicilor nr. 3-5, Tel: 0264 597 852"})]})]})]})}),a.jsx("div",{className:"mt-8 pt-6 border-t border-gray-200",children:a.jsxs("p",{className:"text-gray-500 text-xs",children:[a.jsx("strong",{children:"XPONENTIAL TRANSYLVANIA SRL"}),a.jsx("br",{}),"Bulevardul 21 Decembrie 1989, Nr. 16, Cluj-Napoca 400094",a.jsx("br",{}),"CUI: 40158957 | J12/5109/2018"]})})]})})]})})]}):null}function UZ({className:t}){return a.jsx("svg",{className:t,viewBox:"0 0 24 24",fill:"currentColor",children:a.jsx("path",{d:"M19.59 6.69a4.83 4.83 0 0 1-3.77-4.25V2h-3.45v13.67a2.89 2.89 0 0 1-2.88 2.5 2.89 2.89 0 0 1-2.89-2.89 2.89 2.89 0 0 1 2.89-2.89c.28 0 .54.04.79.1V9.01a6.33 6.33 0 0 0-.79-.05 6.34 6.34 0 0 0-6.34 6.34 6.34 6.34 0 0 0 6.34 6.34 6.34 6.34 0 0 0 6.33-6.34V8.69a8.14 8.14 0 0 0 4.77 1.53V6.75a4.85 4.85 0 0 1-1-.06z"})})}const zZ=[{label:"Home",route:"/"},{label:"About Xponential",route:"/about"},{label:"Services",route:"/services"},{label:"Virtual Tour",route:"/virtual-tour"},{label:"Blog",route:"/blog"},{label:"Contact",route:"/contact"}],HZ=[{icon:wu,href:"https://www.facebook.com/xponentialtransylvania",label:"Facebook"},{icon:ju,href:"https://www.instagram.com/xponential.office/",label:"Instagram"},{icon:pl,href:"https://www.linkedin.com/company/xponential-transylvania-co-working-office/",label:"LinkedIn"},{icon:UZ,href:"https://www.tiktok.com/@xponential.office",label:"TikTok"}];function Km(){const[t,e]=P.useState(!1),[r,n]=P.useState(!1),[s,i]=P.useState(!1);return a.jsxs("footer",{className:"bg-[#0d3347] text-white",children:[a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10 sm:py-12 lg:py-14",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-7 md:gap-8 lg:gap-10",children:[a.jsxs("div",{className:"lg:col-span-2",children:[a.jsx("div",{className:"flex items-center gap-3 mb-4",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential Transylvania - Coworking Cluj-Napoca",loading:"lazy",className:"h-10 w-auto"})}),a.jsx("p",{className:"text-white/60 text-sm leading-relaxed max-w-sm",children:"A modern office and coworking space in central Cluj-Napoca, created to support entrepreneurs, freelancers, startups, and companies looking for flexible workspace solutions."}),a.jsxs("div",{className:"mt-6 space-y-2",children:[a.jsxs("div",{className:"flex items-start gap-3",children:[a.jsx(ja,{className:"w-4 h-4 text-[#3ea2da] mt-0.5 flex-shrink-0"}),a.jsx("span",{className:"text-white/60 text-sm",children:"Bulevardul 21 Decembrie 1989, No. 16, Cluj-Napoca, Romania"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Or,{className:"w-4 h-4 text-[#3ea2da] flex-shrink-0"}),a.jsx("a",{href:"mailto:[email protected]",className:"text-white/60 text-sm hover:text-white transition-colors inline-block translate-y-[2px]",children:"[email protected]"})]}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx(Na,{className:"w-4 h-4 text-[#3ea2da] flex-shrink-0"}),a.jsx("a",{href:"tel:+40744659659",className:"text-white/60 text-sm hover:text-white transition-colors inline-block translate-y-[2px]",children:"+40 744 659 659"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-white text-sm uppercase tracking-wide mb-4",children:"Navigation"}),a.jsx("ul",{className:"space-y-2",children:zZ.map(o=>a.jsx("li",{children:a.jsx(st,{to:o.route,className:"text-white/60 text-sm hover:text-white transition-colors",children:o.label})},o.route))})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-bold text-white text-sm uppercase tracking-wide mb-4",children:"Worksp
4411aces"}),a.jsx("ul",{className:"space-y-2 mb-6",children:["Coworking Desks","Private Offices","Meeting Rooms","Event Hall"].map(o=>a.jsx("li",{children:a.jsx(st,{to:"/services",className:"text-white/60 text-sm hover:text-white transition-colors",children:o})},o))}),a.jsx("h4",{className:"font-bold text-white text-sm uppercase tracking-wide mb-3",children:"Follow Us"}),a.jsx("div",{className:"flex items-center gap-3",children:HZ.map(o=>{const l=o.icon;return a.jsx("a",{href:o.href,target:"_blank",rel:"noopener noreferrer",className:"w-9 h-9 rounded-lg bg-white/10 hover:bg-[#3ea2da] flex items-center justify-center transition-colors","aria-label":o.label,children:a.jsx(l,{className:"w-4 h-4"})},o.label)})})]})]}),a.jsxs("div",{className:"mt-12 pt-6 border-t border-white/10 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[a.jsxs("p",{className:"text-white/40 text-sm",children:["© ",new Date().getFullYear()," Xponential Transylvania. All rights reserved."]}),a.jsxs("div",{className:"flex items-center gap-4 text-sm",children:[a.jsx("button",{onClick:()=>i(!0),className:"inline-flex items-center text-white/70 hover:text-white transition-colors leading-none",children:"Internal Regulations"}),a.jsx("span",{className:"text-white/30 leading-none",children:"|"}),a.jsx("button",{onClick:()=>n(!0),className:"inline-flex items-center text-white/70 hover:text-white transition-colors leading-none",children:"Privacy Policy"}),a.jsx("span",{className:"text-white/30 leading-none",children:"|"}),a.jsx("button",{onClick:()=>e(!0),className:"inline-flex items-center text-white/70 hover:text-white transition-colors leading-none",children:"Terms & Conditions"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("img",{src:"/start4ai-logo.png",alt:"Start4AI",className:"h-5 w-auto opacity-40"}),a.jsxs("p",{className:"text-white/30 text-xs",children:["AI solution developed in partnership with"," ",a.jsx("a",{href:"https://start4ai.ro/",target:"_blank",rel:"noopener noreferrer",className:"text-white/50 hover:text-[#3ea2da] transition-colors",children:"Start4AI"}),", an AI development company based in Cluj-Napoca, Romania."]})]})]})]}),a.jsx(HM,{isOpen:r,onClose:()=>n(!1)}),a.jsx(zM,{isOpen:t,onClose:()=>e(!1)}),a.jsx(VZ,{isOpen:s,onClose:()=>i(!1)})]})}function qM(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null);return P.useEffect(()=>{const u=dt(Be(oe,"tourRequests"),T2("createdAt","desc")),d=Dn(u,h=>{const m=h.docs.map(p=>({id:p.id,...p.data()}));e(m),n(!1)},h=>{console.error("Error fetching tour requests:",h),i("Failed to fetch tour requests"),n(!1)});return()=>d()},[]),{tourRequests:t,loading:r,error:s,addTourRequest:async u=>{try{await wl(Be(oe,"tourRequests"),{...u,status:"pending",createdAt:Ct(),updatedAt:Ct()})}catch(d){throw console.error("Error adding tour request:",d),new Error("Failed to add tour request")}},updateTourRequestStatus:async(u,d,h)=>{try{const m=Te(oe,"tourRequests",u),p={status:d,updatedAt:Ct()};h!==void 0&&(p.notes=h),await Je(m,p)}catch(m){throw console.error("Error updating tour request status:",m),new Error("Failed to update tour request status")}},deleteTourRequest:async u=>{try{await Rn(Te(oe,"tourRequests",u))}catch(d){throw console.error("Error deleting tour request:",d),new Error("Failed to delete tour request")}}}}function Pu({isOpen:t,onClose:e}){const{addTourRequest:r}=qM(),[n,s]=P.useState({name:"",email:"",phone:"",company:"",preferredDate:"",preferredTime:"",interests:[],message:""}),[i,o]=P.useState(!1),[l,c]=P.useState(!1),u=["Hot Desk Solutions","Dedicated Desk","Private Office","Meeting Rooms","Event Hosting","Virtual Office Services","Networking Opportunities","Flexible Membership Plans"],d=["09:00","09:30","10:00","10:30","11:00","11:30","12:00","12:30","13:00","13:30","14:00","14:30","15:00","15:30","16:00","16:30","17:00"],h=p=>{s(x=>({...x,interests:x.interests.includes(p)?x.interests.filter(w=>w!==p):[...x.interests,p]}))},m=async p=>{p.preventDefault(),o(!0);try{await r(n),c(!0),setTimeout(()=>{c(!1),s({name:"",email:"",phone:"",company:"",preferredDate:"",preferredTime:"",interests:[],message:""}),e()},3e3)}catch(x){console.error("Error submitting tour request:",x),alert("Failed to submit tour request. Please try again.")}finally{o(!1)}};return t?a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[100]",children:a.jsxs("div",{className:"bg-white w-full h-auto max-w-2xl max-h-[90vh] rounded-xl overflow-hidden shadow-elevated flex flex-col",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-4 py-3 sm:px-6 sm:py-4 flex justify-between items-center flex-shrink-0",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg sm:text-xl font-semibold text-gray-900",children:"Request Personal Tour"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Schedule a personalized visit during business hours"})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors p-1",children:a.jsx(Ge,{className:"w-5 h-5 sm:w-6 sm:h-6"})})]}),a.jsx("div",{className:"flex-1 overflow-y-auto pb-32 sm:pb-6",style:{WebkitOverflowScrolling:"touch"},children:a.jsx("div",{className:"p-4 sm:p-6",children:l?a.jsxs("div",{className:"text-center py-8",children:[a.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(_A,{className:"w-8 h-8 text-green-500"})}),a.jsx("h3",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Request Sent!"}
4411),a.jsx("p",{className:"text-gray-600 mb-4",children:"Thank you for your interest! We'll contact you within 24 hours to confirm your personal tour."}),a.jsx("div",{className:"bg-brand-yellow/10 border border-brand-yellow/20 rounded-lg p-4",children:a.jsxs("p",{className:"text-sm text-brand-premium",children:[a.jsx("strong",{children:"Business Hours:"})," Monday - Friday, 8:00 AM - 6:00 PM"]})})]}):a.jsxs("form",{onSubmit:m,className:"space-y-6",children:[a.jsxs("div",{className:"bg-gray-50 rounded-xl p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Personal Information"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Full Name *"}),a.jsxs("div",{className:"relative",children:[a.jsx(fn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",value:n.name,onChange:p=>s(x=>({...x,name:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",placeholder:"John Doe",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email Address *"}),a.jsxs("div",{className:"relative",children:[a.jsx(Or,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"email",value:n.email,onChange:p=>s(x=>({...x,email:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",placeholder:"[email protected]",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Phone Number *"}),a.jsxs("div",{className:"relative",children:[a.jsx(Na,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"tel",value:n.phone,onChange:p=>s(x=>({...x,phone:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",placeholder:"+40 123 456 789",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Company (Optional)"}),a.jsxs("div",{className:"relative",children:[a.jsx(xn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",value:n.company,onChange:p=>s(x=>({...x,company:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",placeholder:"Your Company"})]})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-4",children:"Preferred Visit Time"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Preferred Date *"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"date",value:n.preferredDate,onChange:p=>s(x=>({...x,preferredDate:p.target.value})),min:new Date().toISOString().split("T")[0],className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Preferred Time *"}),a.jsxs("div",{className:"relative",children:[a.jsx(qe,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsxs("select",{value:n.preferredTime,onChange:p=>s(x=>({...x,preferredTime:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent appearance-none bg-white text-base",required:!0,children:[a.jsx("option",{value:"",children:"Select time"}),d.map(p=>a.jsx("option",{value:p,children:p},p))]})]})]}),a.jsx("div",{className:"bg-brand-yellow/10 border border-brand-yellow/20 rounded-lg p-3",children:a.jsxs("p",{className:"text-sm text-brand-premium",children:[a.jsx("strong",{children:"Business Hours:"})," Monday - Friday, 8:00 AM - 6:00 PM",a.jsx("br",{}),"Tours typically last 30-45 minutes"]})})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"What are you interested in?"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:u.map(p=>a.jsxs("label",{className:"flex items-center p-3 bg-gray-50 rounded-lg hover:bg-gray-100 transition-colors cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:n.interests.includes(p),onChange:()=>h(p),className:"rounded border-gray-300 text-brand-premium focus:ring-brand-premium mr-3"}),a.jsx("span",{className:"text-sm",children:p})]},p))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Additional Message (Optional)"}),a.jsxs("div",{className:"relative",children:[a.jsx(g3,{className:"w-5 h-5 absolute left-3 top-3 text-gray-400"}),a.jsx("textarea",{value:n.message,onChange:p=>s(x=>({...x,message:p.target.value})),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent text-base",rows:3,placeholder:"Tell us about your specific needs or questions..."})]})]}),a.jsx("div",{className:"h-4 sm:h-8"})]})})}),!l&&a.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4 sm:relative sm:border-t-0 sm:bg-transparent sm:p-6 shadow-lg sm:shadow-none flex-shrink-0 z-[999]",children:a.jsxs("div",{className:"flex space-x-4",children:[a.jsx("button",{type:"button",onClick:e,className:"flex-1 px-4 py-3 border border-gray-300 rounded-lg text-gray-700 font-medium hover:bg-gray-50 transition-colors min-h-[48px]",disabled:i,children:"Cancel"}),a.jsx("button",{onClick:m,className:"flex-1 px-4 py-3 bg-brand-premium text-white rounded-lg font-medium hover:bg-opacity-90 transition-colors disabled:opacity-50 flex items-center justify-center min-h-[48px]",disabled:i,children:i?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Sending..."]}):a.jsxs(a.Fragment,{children:[a.jsx(_A,{className:"w-4 h-4 mr-2"}),"Request Tour"]})})]})})]})}):null}const z0="Xponential Transylvania",Bd="https://xponential.ro",qZ=`${Bd}/xponential_logo100px.png`,WZ="Coworking space in Cluj-Napoca city center. Flexible desks, private office
4411s, meeting rooms, and event spaces near you. VAT-exempt pricing for businesses.";function Rr({title:t,description:e=WZ,canonical:r,image:n=qZ,type:s="website",publishedAt:i,author:o,noIndex:l=!1}){const c=t?`${t} | ${z0}`:`${z0} | Coworking Cluj-Napoca`,u=r?`${Bd}${r}`:Bd;return a.jsxs(Vi,{children:[a.jsx("title",{children:c}),a.jsx("meta",{name:"description",content:e}),l?a.jsx("meta",{name:"robots",content:"noindex, nofollow"}):a.jsx("meta",{name:"robots",content:"index, follow"}),a.jsx("link",{rel:"canonical",href:u}),a.jsx("meta",{property:"og:title",content:c}),a.jsx("meta",{property:"og:description",content:e}),a.jsx("meta",{property:"og:image",content:n.startsWith("http")?n:`${Bd}${n}`}),a.jsx("meta",{property:"og:url",content:u}),a.jsx("meta",{property:"og:type",content:s}),a.jsx("meta",{property:"og:site_name",content:z0}),a.jsx("meta",{name:"twitter:card",content:"summary_large_image"}),a.jsx("meta",{name:"twitter:title",content:c}),a.jsx("meta",{name:"twitter:description",content:e}),a.jsx("meta",{name:"twitter:image",content:n.startsWith("http")?n:`${Bd}${n}`}),i&&a.jsx("meta",{property:"article:published_time",content:i}),o&&a.jsx("meta",{property:"article:author",content:o})]})}function GZ(){const t={"@context":"https://schema.org","@type":["LocalBusiness","CoworkingSpace"],name:"Xponential Transylvania",url:"https://xponential.ro",logo:"https://xponential.ro/xponential_logo100px.png",image:"https://xponential.ro/xponential_logo100px.png",description:"Coworking space in Cluj-Napoca city center. Flexible desks, private offices, meeting rooms, and event spaces near you. VAT-exempt pricing for businesses.",telephone:"+40744659659",email:"[email protected]",address:{"@type":"PostalAddress",streetAddress:"Bulevardul 21 Decembrie 1989, No. 16",addressLocality:"Cluj-Napoca",addressRegion:"Cluj",postalCode:"400124",addressCountry:"RO"},geo:{"@type":"GeoCoordinates",latitude:46.7712,longitude:23.5937},openingHoursSpecification:[{"@type":"OpeningHoursSpecification",dayOfWeek:["Monday","Tuesday","Wednesday","Thursday","Friday"],opens:"09:00",closes:"18:00"}],sameAs:["https://www.facebook.com/xponentialtransylvania","https://www.instagram.com/xponential.office/","https://www.linkedin.com/company/xponential-transylvania-co-working-office/","https://www.tiktok.com/@xponential.office"],priceRange:"$$",currenciesAccepted:"RON, EUR",paymentAccepted:"Cash, Credit Card, Bank Transfer",hasMap:"https://maps.app.goo.gl/xponential-transylvania-cluj",areaServed:{"@type":"City",name:"Cluj-Napoca"},keywords:"coworking Cluj-Napoca, private office Cluj, meeting room Cluj, coworking space Transylvania, office rental Cluj"};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function KZ(){const t={"@context":"https://schema.org","@type":"Organization",name:"Xponential Transylvania",url:"https://xponential.ro",logo:"https://xponential.ro/xponential_logo100px.png",contactPoint:{"@type":"ContactPoint",telephone:"+40744659659",contactType:"customer service",email:"[email protected]",availableLanguage:["English","Romanian"]},sameAs:["https://www.facebook.com/xponentialtransylvania","https://www.instagram.com/xponential.office/","https://www.linkedin.com/company/xponential-transylvania-co-working-office/"],contributor:{"@type":"Organization",name:"Start4AI",url:"https://start4ai.ro"}};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function XZ(){const t={"@context":"https://schema.org","@type":"SoftwareApplication",name:"Xponential Coworking Platform",applicationCategory:"BusinessApplication",operatingSystem:"Web",provider:{"@type":"Organization",name:"Xponential Transylvania",url:"https://xponential.ro"},creator:{"@type":"Organization",name:"Start4AI",url:"https://start4ai.ro",description:"Start4AI is an AI development company based in Cluj-Napoca, Romania, specializing in AI agents, AI automation and voice AI, extending to custom AI software and ERP/CRM integrations.",address:{"@type":"PostalAddress",addressLocality:"Cluj-Napoca",addressRegion:"Cluj",addressCountry:"RO"}}};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function YZ({title:t,description:e,slug:r,coverImage:n,publishedAt:s,author:i,category:o}){const l={"@context":"https://schema.org","@type":"BlogPosting",headline:t,description:e,url:`https://xponential.ro/blog/${r}`,image:n||"https://xponential.ro/xponential_logo100px.png",datePublished:s||void 0,author:i?{"@type":"Person",name:i}:{"@type":"Organization",name:"Xponential Transylvania"},publisher:{"@type":"Organization",name:"Xponential Transylvania",logo:{"@type":"ImageObject",url:"https://xponential.ro/xponential_logo100px.png"}},mainEntityOfPage:{"@type":"WebPage","@id":`https://xponential.ro/blog/${r}`},articleSection:o||"Coworking",inLanguage:"en"};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(l)})})}function QZ({faqs:t}){const e={"@context":"https://schema.org","@type":"FAQPage",mainEntity:t.map(r=>
4411({"@type":"Question",name:r.q,acceptedAnswer:{"@type":"Answer",text:r.a}}))};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(e)})})}function JZ(){const t={"@context":"https://schema.org","@type":"WebPage","@id":"https://xponential.ro/#webpage",url:"https://xponential.ro/",name:"Xponential Transylvania | Coworking Cluj-Napoca",description:"Coworking space in Cluj-Napoca city center. Flexible desks, private offices, meeting rooms, and event spaces near you. VAT-exempt pricing for businesses.",inLanguage:"en",datePublished:"2024-01-01",dateModified:"2026-04-01",isPartOf:{"@type":"WebSite","@id":"https://xponential.ro/#website",url:"https://xponential.ro/",name:"Xponential Transylvania"},about:{"@type":"CoworkingSpace",name:"Xponential Transylvania"}};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(t)})})}function ZZ({items:t}){const e={"@context":"https://schema.org","@type":"BreadcrumbList",itemListElement:t.map((r,n)=>({"@type":"ListItem",position:n+1,name:r.name,item:r.url}))};return a.jsx(Vi,{children:a.jsx("script",{type:"application/ld+json",children:JSON.stringify(e)})})}function eee(){const[t,e]=P.useState(!1),r=()=>e(!0);return a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx(Rr,{canonical:"/"}),a.jsx(GZ,{}),a.jsx(KZ,{}),a.jsx(QZ,{faqs:BM}),a.jsx(JZ,{}),a.jsx(XZ,{}),a.jsx(Pu,{isOpen:t,onClose:()=>e(!1)}),a.jsx(Gm,{onBookTour:r}),a.jsx(KQ,{onBookTour:r}),a.jsx(JQ,{}),a.jsx(TM,{}),a.jsx(AM,{onBookTour:r}),a.jsx(nJ,{}),a.jsx(EM,{onBookTour:r}),a.jsx(kM,{}),a.jsx(FZ,{}),a.jsx(VM,{}),a.jsx(UM,{}),a.jsx(Km,{})]})}function tee(){const t=cr(),[e,r]=P.useState(!1),n=[{icon:xn,title:"Hot Desk",path:"/spaces",type:"hot-desk"},{icon:WV,title:"Dedicated Desk",path:"/spaces",type:"dedicated-desk"},{icon:Mt,title:"Private Office",path:"/spaces",type:"private-office"},{icon:De,title:"Meeting Room",path:"/meeting-rooms"}
4411,{icon:u3,title:"Events",path:"/events"},{icon:f3,title:"Need Suggestion?",action:"tour"}],s=i=>{if(i.action==="tour"){r(!0);return}i.type&&sessionStorage.setItem("selectedSpaceType",i.type),t(i.path)};return a.jsxs("div",{className:"relative min-h-screen flex items-center justify-center px-4 py-8",children:[a.jsx("div",{className:"w-full max-w-2xl",children:a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4 md:gap-6",children:n.map((i,o)=>{const l=i.icon;return a.jsxs("button",{onClick:()=>s(i),className:"bg-white bg-opacity-95 backdrop-blur-lg rounded-xl p-6 text-center hover:shadow-elevated transition-all duration-300 group hover:bg-opacity-100 hover:-translate-y-1",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-4 bg-gradient-to-br from-brand-premium to-brand-blue text-white rounded-lg flex items-center justify-center group-hover:from-brand-yellow group-hover:to-yellow-400 group-hover:text-brand-premium transition-all duration-300",children:a.jsx(l,{className:"w-6 h-6"})}),a.jsx("h3",{className:"font-semibold",children:i.title})]},o)})})}),a.jsx(Pu,{isOpen:e,onClose:()=>r(!1)})]})}function ree(){return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsx("div",{className:"bg-gradient-to-180 from-[#194b66] to-[#3ea2da] min-h-screen",children:a.jsx(tee,{})})]})}function $y(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),[o,l]=P.useState(!1);P.useEffect(()=>{n(!0);const m=dt(Be(oe,"spaces")),p=Dn(m,x=>{const w=x.docs.map(v=>({id:v.id,...v.data()}));l(!1);const g=[...w].sort((v,b)=>{const y=v.order??999,T=b.order??999;return y-T});e(g),n(!1)},x=>{console.error("Error fetching spaces:",x),x.code==="unavailable"||x.message.includes("offline")?(i("You are currently offline. Some features may be limited."),l(!0)):i("Failed to load spaces. Please check your internet connection."),n(!1)});return()=>p()},[]);const c=async m=>{try{const p=t.filter(g=>g.type===m.type),x=p.length>0?Math.max(...p.map(g=>g.order||0)):-1,w=Object.fromEntries(Object.entries(m).filter(([g,v])=>v!==void 0));await wl(Be(oe,"spaces"),{...w,order:x+1,createdAt:Ct(),updatedAt:Ct()})}catch(p){throw console.error("Error adding space:",p),new Error("Failed to add space")}},u=async(m,p)=>{try{const x=Te(oe,"spaces",m),w=Object.fromEntries(Object.entries(p).filter(([g,v])=>v!==void 0));await Je(x,{...w,updatedAt:Ct()})}catch(x){throw console.error("Error updating space:",x),new Error("Failed to update space")}};return{spaces:t,loading:r,error:s,isOffline:o,addSpace:c,updateSpace:u,deleteSpace:async m=>{try{await Rn(Te(oe,"spaces",m))}catch(p){throw console.error("Error deleting space:",p),new Error("Failed to delete space")}},updateSpacesOrder:async m=>{try{const p=oe.batch?oe.batch():null;p?(m.forEach(({id:x,order:w})=>{const g=Te(oe,"spaces",x);p.update(g,{order:w,updatedAt:Ct()})}),await p.commit()):await Promise.all(m.map(({id:x,order:w})=>u(x,{order:w})))}catch(p){throw console.error("Error updating spaces order:",p),new Error("Failed to update spaces order")}}}}var WM={exports:{}},nee="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",aee=nee,see=aee;function GM(){}function KM(){}KM.resetWarningCache=GM;var iee=function(){function t(n,s,i,o,l,c){if(c!==see){var u=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw u.name="Invariant Violation",u}}t.isRequired=t;function e(){return t}var r={array:t,bigint:t,bool:t,func:t,number:t,object:t,string:t,symbol:t,any:t,arrayOf:e,element:t,elementType:t,instanceOf:e,node:t,objectOf:e,oneOf:e,oneOfType:e,shape:e,exact:e,checkPropTypes:KM,resetWarningCache:GM};return r.PropTypes=r,r};WM.exports=iee();var oee=WM.exports;const Se=nt(oee);function hk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function mk(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
vendor: 4,230 bytes, lines 4411-4412
4411e%2?hk(Object(r),!0).forEach(function(n){XM(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Lp(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Lp=function(e){return typeof e}:Lp=function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Lp(t)}function XM(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lee(t,e){return cee(t)||uee(t,e)||dee(t,e)||hee()}function cee(t){if(Array.isArray(t))return t}function uee(t,e){var r=t&&(typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"]);if(r!=null){var n=[],s=!0,i=!1,o,l;try{for(r=r.call(t);!(s=(o=r.next()).done)&&(n.push(o.value),!(e&&n.length===e));s=!0);}catch(c){i=!0,l=c}finally{try{!s&&r.return!=null&&r.return()}finally{if(i)throw l}}return n}}function dee(t,e){if(t){if(typeof t=="string")return fk(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return fk(t,e)}}function fk(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hee(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4412In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bn=function(e,r,n){var s=!!n,i=F.useRef(n);F.useEffect(function(){i.current=n},[n]),F.useEffect(function(){if(!s||!e)return function(){};var o=function(){i.current&&i.current.apply(i,arguments)};return e.on(r,o),function(){e.off(r,o)}},[s,r,e,i])},mee=function(e){var r=F.useRef(e);return F.useEffect(function(){r.current=e},[e]),r.current},$g=function(e){return e!==null&&Lp(e)==="object"},pk="[object Object]",fee=function t(e,r){if(!$g(e)||!$g(r))return e===r;var n=Array.isArray(e),s=Array.isArray(r);if(n!==s)return!1;var i=Object.prototype.toString.call(e)===pk,o=Object.prototype.toString.call(r)===pk;if(i!==o)return!1;if(!i&&!n)return e===r;var l=Object.keys(e),c=Object.keys(r);if(l.length!==c.length)return!1;for(var u={},d=0;d<l.length;d+=1)u[l[d]]=!0;for(var h=0;h<c.length;h+=1)u[c[h]]=!0;var m=Object.keys(u);if(m.length!==l.length)return!1;var p=e,x=r,w=function(v){return t(p[v],x[v])};return m.every(w)},pee=function(e,r,n){return $g(e)?Object.keys(e).reduce(function(s,i){var o=!$g(r)||!fee(e[i],r[i]);return n.includes(i)?(o&&console.warn("Unsupported prop change: options.".concat(i," is not a mutable property.")),s):o?mk(mk({},s||{}),{},XM({},i,e[i])):s},null):null},YM=F.createContext(null);YM.displayName="ElementsContext";var gee=function(e,r){if(!e)throw new Error("Could not find Elements context; You need to wrap the part of your app that ".concat(r," in an <Elements> provider."));return e};Se.any,Se.object;Se.func.isRequired;var QM=F.createContext(null);QM.displayName="CustomCheckoutSdkContext";var xee=function(e,r){if(!e)throw new Error("Could not find CustomCheckoutProvider context; You need to wrap the part of your app that ".concat(r," in an <CustomCheckoutProvider> provider."));return e},yee=F.createContext(null);yee.displayName="CustomCheckoutContext";Se.any,Se.shape({clientSecret:Se.string.isRequired,elementsOptions:Se.object}).isRequired;var gk=function(e){var r=F.useContext(QM),n=F.useContext(YM);if(r&&n)throw new Error("You cannot wrap the part of your app that ".concat(e," in both <CustomCheckoutProvider> and <Elements> providers."));return r?xee(r,e):gee(n,e)},vee=function(e){return e.charAt(0).toUpperCase()+e.slice(1)},tr=function(e,r){var n="".concat(vee(e),"Element"),s=function(c){var u=c.id,d=c.className,h=c.options,m=h===void 0?{}:h,p=c.onBlur,x=c.onFocus,w=c.onReady,g=c.onChange,v=c.onEscape,b=c.onClick,y=c.onLoadError,T=c.onLoaderStart,N=c.onNetworksChange,j=c.onConfirm,_=c.onCancel,S=c.onShippingAddressChange,k=c.onShippingRateChange,I=gk("mounts <".concat(n,">")),E="elements"in I?I.elements:null,C="customCheckoutSdk"in I?I.
4412customCheckoutSdk:null,R=F.useState(null),W=lee(R,2),M=W[0],L=W[1],U=F.useRef(null),V=F.useRef(null);bn(M,"blur",p),bn(M,"focus",x),bn(M,"escape",v),bn(M,"click",b),bn(M,"loaderror",y),bn(M,"loaderstart",T),bn(M,"networkschange",N),bn(M,"confirm",j),bn(M,"cancel",_),bn(M,"shippingaddresschange",S),bn(M,"shippingratechange",k),bn(M,"change",g);var D;w&&(e==="expressCheckout"?D=w:D=function(){w(M)}),bn(M,"ready",D),F.useLayoutEffect(function(){if(U.current===null&&V.current!==null&&(E||C)){var K=null;C?K=C.createElement(e,m):E&&(K=E.create(e,m)),U.current=K,L(K),K&&K.mount(V.current)}},[E,C,m]);var z=mee(m);return F.useEffect(function(){if(U.current){var K=pee(m,z,["paymentRequest"]);K&&"update"in U.current&&U.current.update(K)}},[m,z]),F.useLayoutEffect(function(){return function(){if(U.current&&typeof U.current.destroy=="function")try{U.current.destroy(),U.current=null}catch{}}},[]),F.createElement("div",{id:u,className:d,ref:V})},i=function(c){gk("mounts <".concat(n,">"));var u=c.id,d=c.className;return F.createElement("div",{id:u,className:d})},o=r?i:s;return o.propTypes={id:Se.string,className:Se.string,onChange:Se.func,onBlur:Se.func,onFocus:Se.func,onReady:Se.func,onEscape:Se.func,onClick:Se.func,onLoadError:Se.func,onLoaderStart:Se.func,onNetworksChange:Se.func,onConfirm:Se.func,onCancel:Se.func,onShippingAddressChange:Se.func,onShippingRateChange:Se.func,options:Se.object},o.displayName=n,o.__elementType=e,o},rr=typeof window>"u",bee=F.createContext(null);bee.displayName="EmbeddedCheckoutProviderContext";tr("auBankAccount",rr);tr("card",rr);tr("cardNumber",rr);tr("cardExpiry",rr);tr("cardCvc",rr);tr("fpxBank",rr);tr("iban",rr);tr("idealBank",rr);tr("p24Bank",rr);tr("epsBank",rr);tr("payment",rr);tr("expressCheckout",rr);tr("currencySelector",rr);tr("paymentRequestButton",rr);tr("linkAuthentication",rr);tr("address",rr);tr("shippingAddress",rr);tr("paymentMethodMessaging",rr);tr("affirmMessage",rr);tr("afterpayClearpayMessage",rr);var JM="https://js.stripe.com/v3",wee=/^https:\/\/js\.stripe\.com\/v3\/?(\?.*)?$/;var jee=function(){for(var e=document.querySelectorAll('script[src^="'.concat(JM,'"]')),r=0;r<e.length;r++){var n=e[r];if(wee.test(n.src))return n}return null},xk=function(e){var r="",n=document.createElement("script");n.src="".concat(JM).concat(r);var s=document.head||document.body;if(!s)throw new Error("Expected document.body not to be null. Stripe.js requires a <body> element.");return s.appendChild(n),n},Nee=function(e,r){!e||!e._registerWrapper||e._registerWrapper({name:"stripe-js",version:"3.4.1",startTime:r})},yd=null,Xf=null,Yf=null,_ee=function(e){return function(){e(new Error("Failed to load Stripe.js"))}},See=function(e,r){return function(){window.Stripe?e(window.Stripe):r(new Error("Stripe.js not available"))}},Tee=function(e){return yd!==null?yd:(yd=new Promise(function(r,n){if(typeof window>"u"||typeof document>"u"){r(null);return}if(window.Stripe){r(window.Stripe);return}try{var s=jee();if(!(s&&e)){if(!s)s=xk(e);else if(s&&Yf!==null&&Xf!==null){var i;s.removeEventListener("load",Yf),s.removeEventListener("error",Xf),(i=s.parentNode)===null||i===void 0||i.removeChild(s),s=xk(e)}}Yf=See(r,n),Xf=_ee(n),s.addEventListener("load",Yf),s.addEventListener("error",Xf)}catch(o){n(o);return}}),yd.catch(function(r){return yd=null,Promise.reject(r)}))},Aee=function(e,r,n){if(e===null)return null;var s=e.apply(void 0,r);return Nee(s,n),s},vd,ZM=!1,e6=function(){return vd||(vd=Tee(null).catch(function(e){return vd=null,Promise.reject(e)}),vd)};Promise.resolve().then(function(){return e6()}).catch(function(t){ZM||console.warn(t)});var Eee=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];ZM=!0;var s=Date.now();return e6().then(function(i){return Aee(i,r,s)})};function Xm(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),[o,l]=P.useState(!1);P.useEffect(()=>{const m=dt(Be(oe,"rooms")),p=Dn(m,x=>{const w=x.docs.map(v=>({id:v.id,...v.data()}));l(!1);const g=[...w].sort((v,b)=>{const y=v.order??999,T=b.order??999;return y-T});e(g),n(!1)},x=>{console.error("Error fetching rooms:",x),x.code==="unavailable"||x.message.includes("offline")?(i("You are currently offline. Some features may be limited."),l(!0)):i("Failed to load meeting rooms. Please check your internet connection."),n(!1)});return()=>p()},[]);const c=async m=>{try{const p=t.length>0?Math.max(...t.map(x=>x.order||0)):-1;await wl(Be(oe,"rooms"),{...m,order:p+1,createdAt:Ct(),updatedAt:Ct()})}catch(p){throw console.error("Error adding room:",p),new Error("Failed to add room")}},u=async(m,p)=>{try{const x=Te(oe,"rooms",m);await Je(x,{...p,updatedAt:Ct()})}catch(x){throw console.error("Error updating room:",x),new Error("Failed to update room")}};return{rooms:t,loading:r,error:s,addRoom:c,updateRoom:u,deleteRoom:async m=>{try{await Rn(Te(oe,"rooms",m))}catch(p){throw console.error("Error deleting room:",p),new Error("Failed to delete room")}},updateRoomsOrder:async m=>{try{const p=oe.batch?oe.batch():null;p?(m.forEach(({id:x,order:w})=>{const g=Te(oe,"rooms",x);p.update(g,{order:w,updatedAt:Ct()})}),await p.commit()):await Promise.all(m.map(({id:x,order:w})=>u(x,{order:w})))}catch(p){throw console.error("Error updating rooms order:",p),new Error("Failed to update rooms order")}}}}function U2(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null);return P.useEffect(()=>{const u=dt(Be(oe,"bookings")),d=Dn(u,h=>{const m=h.docs.map(p=>({id:p.id,...p.data()}));e(m),n(!1)},h=>{console.error("Error fetching bookings:",h),i("Failed to fetch bookings"),n(!1)});return()=>d()},[]),{bookings:t,loading:r,error:s,updateBookingStatus:async(u,d)=>{try{const h=Te(oe,"bookings",u);await Je(h,{status:d})}catch(h){throw console.error("Error updating booking status:",h),new Error("Failed to update booking status")}},updateBookingPin:async(u,d)=>{try{const h=Te(oe,"bookings",u);await Je(h,{accessPin:d})}catch(h){throw console.error("Error updating booking access pin:",h),new Error("Failed to update booking access pin")}},deleteBooking:async u=>{try{await Rn(Te(oe,"bookings",u))}catch(d){throw console.error("Error deleting booking:",d),new Error("Failed to delete booking")}}}}function t6({roomId:t,onTimeSelect:e,onSlotSelect:r,isAdmin:n=!1}){const[s,i]=P.useState(new Date),{bookings:o}=U2(),[l,c]=P.useState(null),[u,d]=P.useState(null),[h,m]=P.useState(null),[p,x]=P.useState([]),[w,g]=P.useState(null),[v,b]=P.useState(null);P.useEffect(()=>{const M=Dn(Te(oe,"rooms",t),L=>{L.exists()&&x(L.data().blockedSlots||[])});return()=>M()},[t]);const y=Uc(s,{weekStartsOn:1}
4412),T=Array.from({length:7},(M,L)=>Rt(y,L)),N=Array.from({length:31},(M,L)=>{const U=Math.floor(L/2)+7,V=L%2*30;return`${U.toString().padStart(2,"0")}:${V.toString().padStart(2,"0")}`}),j=M=>{const[L,U]=M.split(":").map(Number);return L*60+U},_=(M,L)=>{const U=he(M,"yyyy-MM-dd"),V=j(L);return o.find(z=>{if(z.date!==U||z.spaceId!==t||z.status==="cancelled"||z.status==="refunded")return!1;const K=j(z.startTime),q=j(z.endTime);return V>=K&&V<q})||null},S=(M,L)=>{const U=he(M,"yyyy-MM-dd");return p.some(V=>V.date===U&&V.time===L)},k=(M,L)=>{const U=he(M,"yyyy-MM-dd");return p.find(V=>V.date===U&&V.time===L)},I=(M,L)=>{const U=he(M,"yyyy-MM-dd");if(n){g({date:U,time:L}),r==null||r(U,L);return}if(!(_(M,L)||S(M,L)))if(!l||l&&u)m(M),c(L),d(null);else{const V=j(l),D=j(L);D<=V||N.some(K=>{const q=j(K);return q>V&&q<D?_(M,K)||S(M,K):!1})?(c(L),d(null)):(d(L),e==null||e(he(M,"yyyy-MM-dd"),l,L))}},E=(M,L)=>{const U=he(M,"yyyy-MM-dd");if(n&&w)return w.date===U&&w.time===L;if(!h||!mJ(M,h)||!l)return!1;const V=j(L),D=j(l),z=u?j(u):D+30;return V>=D&&V<z},C=(M,L)=>{const U=he(M,"yyyy-MM-dd");return(v==null?void 0:v.date)===U&&v.time===L},R=M=>{const L=parseInt(M.split(":")[0]);return L<8||L>=17},W=M=>{i(L=>Rt(L,M==="prev"?-7:7))};return a.jsxs("div",{className:"bg-white rounded-xl shadow-card overflow-hidden",children:[a.jsxs("div",{className:"p-3 border-b flex justify-between items-center bg-gradient-to-r from-gray-50 to-gray-100",children:[a.jsx("button",{onClick:()=>W("prev"),className:"p-2 hover:bg-white rounded-lg transition-all duration-200 hover:shadow-sm",children:a.jsx(fl,{className:"w-5 h-5 text-gray-600"})}),a.jsxs("h3",{className:"text-sm font-semibold text-gray-800",children:[he(y,"MMM d")," - ",he(Rt(y,6),"MMM d, yyyy")]}),a.jsx("button",{onClick:()=>W("next"),className:"p-2 hover:bg-white rounded-lg transition-all duration-200 hover:shadow-sm",children:a.jsx(_i,{className:"w-5 h-5 text-gray-600"})})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("div",{className:"min-w-full",children:[a.jsxs("div",{className:"grid grid-cols-8 border-b bg-gradient-to-r from-gray-50 to-white",children:[a.jsx("div",{className:"p-3 border-r bg-gray-50 w-16"}),T.map(M=>a.jsxs("div",{className:"p-3 text-center border-r",children:[a.jsx("div",{className:"text-xs font-semibold text-gray-700",children:he(M,"EEE")}),a.jsx("div",{className:"text-xs text-gray-500 mt-1",children:he(M,"MMM d")})]},M.toString()))]}),N.map(M=>a.jsxs("div",{className:"grid grid-cols-8 border-b hover:bg-gray-50/50 transition-colors",children:[a.jsxs("div",{className:`p-2 border-r text-xs font-medium w-16 flex items-center justify-center ${R(M)?"bg-amber-50 text-amber-700":"bg-gray-50 text-gray-700"}`,children:[a.jsx(qe,{className:"w-3 h-3 mr-1"}),M]}),T.map(L=>{const U=_(L,M),V=!!U,D=S(L,M),z=k(L,M),K=E(L,M),q=C(L,M),H=R(M),ee=he(L,"yyyy-MM-dd");return a.jsxs("button",{onClick:()=>I(L,M),onMouseEnter:()=>b({date:ee,time:M}),onMouseLeave:()=>b(null),disabled:!n&&(V||D),title:D&&(z!=null&&z.blockedBy)?`Blocked for: ${z.blockedBy}`:"",className:`p-2 border-r h-12 relative transition-all duration-300 ease-out group ${D?"bg-red-50 cursor-pointer hover:bg-red-100 border-red-100":V?"bg-gray-100 cursor-not-allowed opacity-60":K?n?"bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500 text-white shadow-xl border-2 border-yellow-400 transform scale-110 z-20 rounded-lg mx-1 my-1":"bg-gradient-to-br from-blue-400 to-blue-600 text-white shadow-lg border-2 border-blue-300 transform scale-105 z-10 rounded-lg mx-1 my-1":q?"bg-gradient-to-br from-blue-50 to-indigo-50 border-blue-200 transform scale-105 shadow-md rounded-lg mx-1 my-1":H?"bg-amber-50/50 hover:bg-amber-100/70 hover:shadow-sm":"hover:bg-blue-50 hover:shadow-sm hover:border-blue-100"}`,children:[D&&!K&&a.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center",children:[a.jsx(ga,{className:"w-4 h-4 text-red-500"}),(z==null?void 0:z.blockedBy)&&a.jsx("span",{className:"text-[8px] text-red-600 font-medium mt-0.5 truncate max-w-full px-1",children:z.blockedBy})]}),V&&!n&&!K&&a.jsx("div",{className:"absolute inset-1 bg-gray-200 rounded flex items-center justify-center text-[10px] text-gray-500 font-medium",children:"Booked"}),V&&!K&&a.jsx("div",{className:"absolute inset-1 bg-gray-200 rounded flex items-center justify-center text-[8px] text-gray-700 font-medium leading-tight text-center px-1",children:n&&(U!=null&&U.userName)?a.jsxs("div",{className:"flex flex-col",children:[a.jsx("span",{className:"font-semibold",children:"Booked"}),a.jsx("span",{className:"opacity-80 mt-0.5",children:U.userName})]}):"Booked"}),K&&n&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsxs("div",{className:"relative",children:[a.jsx(nU,{className:"w-5 h-5 text-yellow-300"}),a.jsx(_w,{className:"w-3 h-3 text-yellow-200 absolute -top-1 -right-1"})]})}),K&&!n&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center",children:a.jsx(fc,{className:"w-5 h-5 text-white drop-shadow-md"})}),q&&!K&&!V&&!D&&a.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-60",children:a.jsx("div",{className:"w-2 h-2 bg-blue-400 rounded-full"})}),!V&&!D&&!K&&!q&&a.jsx("div",{className:"absolute top-1 right-1 w-1 h-1 bg-green-400 rounded-full opacity-50 group-hover:opacity-100 transition-opacity"})]},L.toString())})]},M))]})}),a.jsx("div",{className:"p-4 border-t bg-gradient-to-r from-gray-50 to-white",children:a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-gray-200 rounded flex items-center justify-center",children:a.jsx("div",{className:"w-2 h-2 bg-gray-400 rounded"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Booked"})]}),n?a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-gradient-to-br from-indigo-500 via-purple-500 to-pink-500 rounded border border-yellow-400 flex items-center justify-center",children:a.jsx(_w,{className:"w-2 h-2 text-yellow-200"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Selected for Action"})]}):a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-gradient-to-br from-blue-400 to-blue-600 rounded border border-blue-300 flex items-center justify-center",children:a.jsx(fc,{className:"w-2 h-2 text-white"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Selected"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-amber-50 rounded border border-amber-200 flex items-center justify-center",children:a.jsx(qe,{className:"w-2 h-2 text-amber-600"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"After Hours"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-red-50 rounded border border-red-200 flex items-center justify-center",children:a.jsx(ga,{className:"w-2 h-2 text-red-500"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Blocked"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-white border border-gray-200 rounded relative",children:a.jsx("div",{className:"absolute top-0.5 right-0.5 w-1 h-1 bg-green-400 rounded-full"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Available"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("div",{className:"w-4 h-4 bg-gradient-to-br from-blue-50 to-indigo-50 rounded border border-blue-200 flex items-center justify-center",children:a.jsx("div",{className:"w-1 h-1 bg-blue-400 rounded-full"})}),a.jsx("span",{className:"text-xs text-gray-600 font-medium",children:"Hover"})]})]})}),!n&&l&&a.jsx("div",{className:"p-4 border-t bg-gradient-to-r from-blue-50 to-indigo-50",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-blue-400 to-blue-600 rounded-full flex items-center justify-center",children:a.jsx(fc,{className:"w-4 h-4 text-white"})}),a.jsxs("div",{children:[a.jsxs("p",{className:"text-sm font-semibold text-blue-900",children:["Selected: ",l," - ",u||"pending"]}),u&&a.jsxs("p",{className:"text-xs text-blue-700",children:["Duration: ",(j(u)-j(l))/60," hours",R(l)&&a.jsx("span",{className:"ml-2 px-2 py-0.5 bg-amber-100 text-amber-700 rounded-full text-xs font-medium",children:"After hours rates apply"})]})]})]}),u&&a.jsx("div",{className:"text-right",children:a.jsx("div",{className:"text-lg font-bold text-blue-600",children:"Ready to book!"})})]})})]})}function kee({spacePrice:t,spacePeriod:e,minDuration:r,maxDuration:n,isSubscriptionEnabled:s,onPaymentSelect:i}){const[o,l]=P.useState(r),c=h=>{let m=h;return e==="day"?m=h/30:e==="week"?m=h/4:e==="ten-days"?m=h/3:e==="half-month"&&(m=h/2),m<=1?"one-time":m>1&&s?"subscription":"one-time"},u=c(o),d=t*o;return P.useEffect(()=>{i({duration:o,paymentType:u,totalPrice:u==="subscription"?t:d,monthlyPrice:u==="subscription"?t:void 0})},[o,u,t,d]),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Select Duration"}),a.jsxs("div",{className:"mb-6",children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:["Duration (",e,"s)"]}),a.jsxs("div",{className:"relative",children:[a.jsx(qe,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("select",{value:o,onChange:h=>l(parseInt(h.target.value)),className:"w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent appearance-none bg-white",children:Array.from({length:n-r+1},(h,m)=>{const p=r+m,x=c(p);return a.jsxs("option",{value:p,children:[p," ",e,p>1?"s":""," - ",x==="subscription"?"Monthly Subscription":"One-time Payment"]},p)})})]})]}),a.jsxs("div",{className:`p-4 rounded-lg border-2 ${u==="subscription"?"border-blue-200 bg-blue-50":"border-green-200 bg-green-50"}`,children:[a.jsxs("div",{className:"flex items-center mb-3",children:[u==="subscription"?a.jsx(De,{className:"w-5 h-5 text-blue-600 mr-2"}):a.jsx(Kn,{className:"w-5 h-5 text-green-600 mr-2"}),a.jsx("h4",{className:`font-semibold ${u==="subscription"?"text-blue-900":"text-green-900"}`,children:u==="subscription"?"🔄 Monthly Subscription":"💳 One-time Payment"})]}),a.jsx("div",{className:"space-y-2",children:u==="subscription"?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-blue-700",children:"Monthly Price:"}),a.jsxs("span",{className:"font-bold text-blue-900",children:["€",t]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-blue-700",children:"Total Duration:"}),a.jsxs("span",{className:"font-medium text-blue-800",children:[o," months"]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-blue-700",children:"Total Cost:"}),a.jsxs("span",{className:"font-bold text-blue-900",children:["€",d]})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-green-700",children:"Duration:"}),a.jsxs("span",{className:"font-medium text-green-800",children:[o," ",e,o>1?"s":""]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsxs("span",{className:"text-green-700",children:["Price per ",e,":"]}),a.jsxs("span",{className:"font-medium text-green-800",children:["€",t]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-green-700",children:"Total Price:"}),a.jsxs("span",{className:"font-bold text-green-900",children:["€",d]})]})]})})]})]})}function z2(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null);return P.useEffect(()=>{n(!0);const m=dt(Be(oe,"promoCodes")),p=Dn(m,x=>{const w=x.docs.map(g=>({id:g.id,...g.data()}));e(w),n(!1)},x=>{console.error("Error fetching promo codes:",x),i("Failed to fetch promo codes"),n(!1)});return()=>p()},[]),{promoCodes:t,loading:r,error:s,addPromoCode:async m=>{try{if(t.filter(x=>x.code.toLowerCase()===m.code.toLowerCase()).length>0)throw new Error("A promo code with this code already exists");await wl(Be(oe,"promoCodes"),{...m,code:m.code.toUpperCase(),usedCount:0,showOnCards:m.showOnCards??!1,createdAt:Ct(),updatedAt:Ct()})}catch(p){throw console.error("Error adding promo code:",p),p}},updatePromoCode:async(m,p)=>{try{if(p.code&&t.filter(g=>g.code.toLowerCase()===p.code.toLowerCase()&&g.id!==m).length>0)throw new Error("A promo code with this code already exists");const x=Te(oe,"promoCodes",m);await Je(x,{...p,code:p.code?p.code.toUpperCase():void 0,updatedAt:Ct()})}catch(x){throw console.error("Error updating promo code:",x),x}},deletePromoCode:async m=>{try{await Rn(Te(oe,"promoCodes",m))}catch(p){throw console.error("Error deleting promo code:",p),p}},togglePromoCodeStatus:async(m,p)=>{try{const x=Te(oe,"promoCodes",m);await Je(x,{isActive:p,updatedAt:Ct()})}catch(x){throw console.error("Error toggling promo code status:",x),x}},validatePromoCode:(m,p,x,w)=>{const g=m.trim().toUpperCase(),v=t.find(j=>j.code===g);if(!v)return{isValid:!1,error:"Invalid promo code"};if(!v.isActive)return{isValid:!1,error:"This promo code is not active"};const b=new Date,y=new Date(v.validFrom),T=new Date(v.validUntil);if(T.setHours(23,59,59,999),b<y)return{isValid:!1,error:"This promo code is not val
4412id yet"};if(b>T)return{isValid:!1,error:"This promo code has expired"};if(v.usageLimit&&v.usedCount>=v.usageLimit)return{isValid:!1,error:"This promo code has reached its usage limit"};if(v.applicableFor==="spaces"&&p!=="space")return{isValid:!1,error:"This promo code is only valid for workspaces"};if(v.applicableFor==="rooms"&&p!=="room")return{isValid:!1,error:"This promo code is only valid for meeting rooms"};if(v.applicableFor==="specific"&&v.specificItems&&!v.specificItems.includes(w||""))return{isValid:!1,error:"This promo code is not valid for this item"};if(v.minAmount&&x<v.minAmount)return{isValid:!1,error:`This promo code requires a minimum purchase of €${v.minAmount}`};let N;return v.type==="percentage"?(N=x*v.value/100,v.maxDiscount&&N>v.maxDiscount&&(N=v.maxDiscount)):v.type==="fixed_amount"&&(N=v.value,N>x&&(N=x)),{isValid:!0,code:v.code,discount:{type:v.type,value:v.value,appliedAmount:N}}},applyPromoCode:async m=>{var p;try{const x=Te(oe,"promoCodes",m);await Je(x,{usedCount:((p=t.find(w=>w.id===m))==null?void 0:p.usedCount)+1||1,updatedAt:Ct()})}catch(x){throw console.error("Error applying promo code:",x),x}}}}function yk({bookingType:t,itemId:e,totalAmount:r,onValidCode:n}){var v,b,y,T;const{promoCodes:s,validatePromoCode:i,loading:o}=z2(),[l,c]=P.useState(""),[u,d]=P.useState(null),[h,m]=P.useState(!1),[p,x]=P.useState(!1);P.useEffect(()=>{if(o)return;const N=new Date,j=s.filter(_=>{var W;const S=new Date(_.validFrom),k=new Date(_.validUntil);k.setHours(23,59,59,999);const I=_.isActive,E=N>=S&&N<=k,C=_.applicableFor==="all"||_.applicableFor==="spaces"&&t==="space"||_.applicableFor==="rooms"&&t==="room"||_.applicableFor==="specific"&&((W=_.specificItems)==null?void 0:W.includes(e)),R=!_.usageLimit||_.usedCount<_.usageLimit;return I&&E&&C&&R});x(j.length>0)},[s,t,e,o]);const w=()=>{if(!l.trim())return;m(!0);const N=i(l,t,r,e);d(N),N.isValid&&n(N),m(!1)},g=()=>{c(""),d(null),n({isValid:!1})};return!p&&!(u!=null&&u.isValid)?null:a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 mt-4",children:[a.jsxs("h3",{className:"font-medium text-gray-800 mb-3 flex items-center",children:[a.jsx(Ti,{className:"w-4 h-4 mr-2 text-purple-500"}),"Promo Code"]}),u!=null&&u.isValid?a.jsx("div",{className:"bg-green-50 border border-green-200 rounded-lg p-3 mb-3",children:a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-green-100 flex items-center justify-center mr-2",children:a.jsx(Uo,{className:"w-4 h-4 text-green-600"})}),a.jsxs("div",{children:[a.jsxs("div",{className:"font-semibold text-green-800",children:[l," applied!"]}),a.jsxs("div",{className:"text-sm text-green-700",children:[((v=u.discount)==null?void 0:v.type)==="percentage"&&`${u.discount.value}% off (€${(b=u.discount.appliedAmount)==null?void 0:b.toFixed(2)})`,((y=u.discount)==null?void 0:y.type)==="fixed_amount"&&`€${(T=u.discount.appliedAmount)==null?void 0:T.toFixed(2)} off`]})]})]}),a.jsx("button",{onClick:g,className:"text-red-600 hover:text-red-700 p-1","aria-label":"Remove promo code",children:a.jsx(Ge,{className:"w-4 h-4"})})]})}):a.jsxs("div",{className:"flex items-center space-x-2 mb-3",children:[a.jsx("input",{type:"text",value:l,onChange:N=>{c(N.target.value.toUpperCase()),d(null)},placeholder:"Enter promo code",className:"flex-1 p-2 border rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent uppercase"}),a.jsxs("button",{onClick:w,disabled:!l.trim()||h,className:"px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors disabled:opacity-50 disabled:cursor-not-allowed flex items-center",children:[h?a.jsx(Wo,{className:"w-4 h-4 mr-1 animate-spin"}):a.jsx(Uo,{className:"w-4 h-4 mr-1"}),"Apply"]})]}),u&&!u.isValid&&u.error&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-4 h-4 text-red-500 mr-2 mt-0.5"}),a.jsx("div",{className:"text-sm text-red-700",children:u.error})]})}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:"Enter a valid promo code to get a discount on your booking"})]})}function vk({onAcceptChange:t}){const[e,r]=P.useState(!1),s=Ds().pathname==="/meeting-rooms",i=s?"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/xpo%20esemeny.pdf?alt=media&token=5f1c2d4d-8ded-4
44120c1-8b90-792f86d1469d":"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/contract%20xpo.pdf?alt=media&token=ede96662-a071-499a-bfcd-5fa9ae1f7b64",o=l=>{r(l.target.checked),t(l.target.checked)};return a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-200 my-4 text-sm",children:[s?a.jsx("h4",{className:"font-medium text-lg mb-2",children:"Terms and Conditions"}):a.jsx("h4",{className:"font-medium text-lg mb-2",children:"Termeni și Condiții"}),a.jsx("div",{className:"max-h-60 overflow-y-auto pr-2 mb-4",children:s?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"font-medium mb-2",children:"Terms & Conditions for Conference Room and Event Services Rental"}),a.jsx("p",{className:"mb-2",children:"1. Scope and Acceptance"}),a.jsx("p",{className:"mb-3",children:'These Terms & Conditions ("T&C") govern the booking and use of the conference rooms and complementary event services provided by Xponential Transylvania S.R.L. ("Lessor") at its headquarters located at Str. 21 Decembrie 1989, nr. 16, Cluj‑Napoca, Romania. By confirming a reservation or purchasing any event‑related service, the customer ("Tenant" or "Lessee") acknowledges and agrees to be bound by these T&C and undertakes to sign the full Lease Agreement before the commencement of the event.'}),a.jsx("p",{className:"mb-2",children:"2. Booking, Duration & Access"}),a.jsx("p",{className:"mb-3",children:"Bookings are confirmed only upon written acceptance by the Lessor and receipt of the Rent. The right of use is granted strictly for the period and hours stated in the Lease Agreement. Early access for set‑up and post‑event dismantling must be agreed in advance."}),a.jsx("p",{className:"mb-2",children:"3. Fees & Payment"}),a.jsx("p",{className:"mb-3",children:"The Tenant shall pay the rent indicated in the Lease Agreement immediately at the time of booking, through the Xponential Transylvania mobile or web application using the integrated electronic payment methods (e.g., credit/debit card). The reservation is confirmed only after successful payment."}),a.jsx("p",{className:"mb-2",children:"4. Permitted Use & Restrictions"}),a.jsx("p",{className:"mb-3",children:"The Leased Premises may be used solely for workshops, conferences, meetings, interviews, presentations, or similar corporate/educational gatherings. Sub‑leasing, assignment, or any transfer of usage rights to third parties is prohibited without prior written consent from the Lessor."}),a.jsx("p",{className:"mb-2",children:"5. Liability"}),a.jsx("p",{className:"mb-3",children:"The Tenant is liable for any damage to the Leased Premises, equipment, or furnishings, including damage caused by guests, participants, employees, or contractors engaged by the Tenant. The Lessor is liable only for damages resulting from its own failure to perform obligations under the Lease Agreement."})]}):a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"font-medium mb-2",children:"Părțile contractante"}),a.jsx("p",{className:"mb-2",children:'Contractul va fi încheiat între Xponential Transylvania SRL, cu sediul în Cluj-Napoca, Str. 21 Decembrie 1989, nr. 16, Cluj (CUI: 40158957, J12/5109/2018), reprezentată de Szőcs Endre ("Locator") și utilizatorul care efectuează rezervarea ("Locatar").'}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"1.1 Semnarea contractului"}),a.jsx("p",{className:"mb-3",children:"Prin finalizarea rezervării și bifarea Termenilor și Condițiilor, Locatarul recunoaște și acceptă că va semna contractul complet la prima sosire la birou, sau va primi contractul pe e-mail pentru semnare electronică, la alegere."}),a.jsxs("p",{className:"mb-3",children:["Contractul integral este disponibil spre consultare"," ",a.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-brand-premium hover:underline inline-flex items-center",children:["aici",a.jsx(pc,{className:"w-3 h-3 ml-1"})]}),"."]}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Obiectul contractului"}),a.jsx("p",{className:"mb-3",children:"Locatarul închiriază un birou dedicat sau spațiu pentru eveniment la Xponential Transylvania, cu acces la spații comune, pentru perioada și prețul selectate în platformă. Accesul la facilități (săli de ședință, printer, bucătărie, vizitatori etc.) se face conform pachetului selectat la rezervare."}
4412),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Plată"}),a.jsx("p",{className:"mb-3",children:"Plata se face online, instant, prin Stripe pe platforma noastră. Factura se generează automat și este disponibilă imediat în profilul tău. Nu există termen de plată sau penalități de întârziere, plata fiind finalizată la rezervare."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Utilizare și restricții"}),a.jsx("p",{className:"mb-3",children:"Spațiul se folosește exclusiv pentru activitate de birou sau pentru scopul rezervat (ex: eveniment). Subînchirierea sau cedarea către terți este interzisă fără acordul scris al Locatorului. Locatarul răspunde pentru orice pagubă cauzată și trebuie să respecte regulamentul intern afișat și normele de sănătate și securitate."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Servicii incluse"}),a.jsx("p",{className:"mb-3",children:"Curățenia, utilitățile, accesul la săli și facilități comune, participarea la evenimente și serviciile detaliate în ofertă sau în pachetul selectat sunt incluse în chirie, excepție făcând parcarea (dacă nu e menționată explicit)."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Durată, prelungire, încetare"}),a.jsx("p",{className:"mb-3",children:"Contractul este valabil pentru perioada rezervată. Prelungirea este posibilă prin acord comun. Locatorul poate rezilia în caz de încălcări grave sau utilizare neconformă a spațiului. La expirare, spațiul trebuie predat în stare inițială."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Modificări de preț"}),a.jsx("p",{className:"mb-3",children:"Chiria poate fi ajustată anual în funcție de indicele de inflație sau de costurile energiei, cu notificare prealabilă conform contractului principal."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Date personale"}),a.jsx("p",{className:"mb-3",children:"Prin rezervare, Locatarul își dă acordul pentru prelucrarea datelor personale în scop contractual și legal."}),a.jsx("p",{className:"font-medium mt-3 mb-1",children:"Litigii"}),a.jsx("p",{className:"mb-3",children:"Orice litigiu se va soluționa pe cale amiabilă, iar dacă nu este posibil, de instanțele competente din Cluj-Napoca."})]})}),a.jsxs("div",{className:"flex items-center mt-4",children:[a.jsx("input",{type:"checkbox",id:"accept-terms",checked:e,onChange:o,className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium"}),a.jsx("label",{htmlFor:"accept-terms",className:"ml-2 text-sm",children:s?"I accept the Terms and Conditions":"Accept Termenii și Condițiile"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-2",children:s?a.jsxs(a.Fragment,{children:["(By checking this box, I confirm that I have read, understood and accept these Terms & Conditions for Conference Room and Event Services Rental, and that I will sign the full Lease Agreement as instructed by Xponential. The complete contract is accessible"," ",a.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-brand-premium hover:underline",children:"here"}),".)"]}
4412):a.jsxs(a.Fragment,{children:["(Prin bifarea acestei căsuțe, confirm că am citit, am înțeles și accept prezentul rezumat al Termenilor și Condițiilor, și că voi semna contractul complet la sosirea la birou sau electronic, conform instrucțiunilor Xponential. Contractul complet e accesibil"," ",a.jsx("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"text-brand-premium hover:underline",children:"aici"}),".)"]})})]})}const Pee=(()=>{try{const t="pk_live_51RETA2BDqg4CGnblpI8mDiPYvj6CD11Q37TpAdRG7CD10KdVvhyMS2tts4HAIchFelXvIUxHEA8Ab5ocO4TEtCz300r9fbM0CE";return Eee(t).catch(e=>(console.error("Failed to load Stripe:",e),null))}catch(t){return console.error("Error initializing Stripe:",t),Promise.resolve(null)}})();function r6({isOpen:t,onClose:e,bookingType:r,itemId:n,item:s}){var ye;const{user:i,userProfile:o,useMeetingRoomHours:l}=br(),{spaces:c}=$y(),{rooms:u}=Xm(),[d,h]=P.useState(1),[m,p]=P.useState({startTime:"",endTime:"",date:he(new Date,"yyyy-MM-dd"),numberOfPeople:"1",durationInPeriods:1}),[x,w]=P.useState(!1),[g,v]=P.useState(null),[b,y]=P.useState(!1),[T,N]=P.useState(null),[j,_]=P.useState(null),[S,k]=P.useState(0),[I,E]=P.useState([]),[C,R]=P.useState(!1),[W,M]=P.useState(!1),[L,U]=P.useState(null),[V,D]=P.useState(!1),[z,K]=P.useState(null),q=s||(r==="space"?c.find(B=>B.id===n):u.find(B=>B.id===n)),H=B=>{D(B)};P.useEffect(()=>{Pee.then(B=>{K(B?null:"Payment system is temporarily unavailable. Please check your internet connection and try again.")})},[]);const ee=()=>{const B=he(new Date,"yyyy-MM-dd");return q!=null&&q.availableFrom&&q.availableFrom>B?q.availableFrom:B};P.useEffect(()=>{h(1);const B=ee();p({startTime:"",endTime:"",date:B,numberOfPeople:"1",durationInPeriods:1}),E([]),R(!1),M(!1),U(null),D(!1)},[n,r]);const de=(B,re)=>{p(ae=>({...ae,[B]:re}))},we=()=>{if(!q||r!=="room"||!m.startTime||!m.endTime)return 0;const B=()=>{const jt=parseInt(m.startTime.split(":")[0]),it=new Date(m.date).getDay();return jt<8||jt>=17||it===0||it===6},re=m.startTime.split(":").map(Number),ae=m.endTime.split(":").map(Number),pe=re[0]*60+re[1],Pe=(ae[0]*60+ae[1]-pe)/60,Fe=q.prices,Ye=B();return Ye?Fe.afterHours:Fe.weekday,Pe>4?Ye?Fe.afterHours.daily:Fe.weekday.daily:Pe*(Ye?Fe.afterHours.hourly:Fe.weekday.hourly)},Le=()=>!q||r!=="space"?0:q.price*m.durationInPeriods,ze=()=>I.reduce((B,re)=>B+re.price*re.quantity,0),Q=()=>{if(C&&r==="room")return 0;const B=r==="room"?we():Le(),re=ze();let ae=B+re;if(L!=null&&L.isValid&&(L!=null&&L.discount)){if(L.discount.type==="percentage"){const pe=ae*(L.discount.value/100);ae-=pe}else L.discount.type==="fixed_amount"&&(ae-=L.discount.value);ae<0&&(ae=0)}return ae};P.useEffect(()=>{k(Q())},[m,I,C,L]);const me=(B,re,ae)=>{p(pe=>({...pe,date:B,startTime:re,endTime:ae}))},ve=(B,re)=>{if(re===0){E(pe=>pe.filter(Ne=>Ne.id!==B.id));return}const ae=I.findIndex(pe=>pe.id===B.id);if(ae>=0){const pe=[...I];pe[ae]={...B,quantity:re},E(pe)}else E([...I,{...B,quantity:re}])},Z=async()=>{var B,re;if(r==="room"){if(!m.date||!m.startTime||!m.endTime||!m.numberOfPeople){v("Please fill in all required fields");return}}else if(!m.date||!m.durationInPeriods){v("Please select a date and duration");return}if(!C&&!V){v("Please accept the Terms and Conditions to continue");return}w(!0),v(null);try{if(C&&r==="room"){const Pe=m.startTime.split(":").map(Number),Fe=m.endTime.split(":").map(Number),Ye=Pe[0]*60+Pe[1],jt=Fe[0]*60+Fe[1];let it=Math.ceil((jt-Ye)/60);const at=(B=q==null?void 0:q.title)==null?void 0:B.toLowerCase().includes("gallery");at&&(it=it*2),console.log(`Using ${it} meeting room hours${at?" (Gallery 2x multiplier)":""}`);const $e=await fetch("/.netlify/functions/bookMeetingRoomWithHours",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await(i==null?void 0:i.getIdToken())}`},body:JSON.stringify({roomId:n,roomName:q==null?void 0:q.title,date:m.date,startTime:m.startTime,endTime:m.endTime,numberOfPeople:parseInt(m.numberOfPeople),hoursUsed:it})}),dr=await $e.json();if(!$e.ok)throw new Error(dr.error||"Failed to book room using meeting room hours");y(!0);return}let ae=!1;if(r==="space"&&(q!=null&&q.isSubscription)){let Pe=m.durationInPeriods;q.period==="day"?Pe=m.durationInPeriods/30:q.period==="week"&&(Pe=m.durationInPeriods/4),ae=Pe>1,console.log(`🔍 Checking if subscription: ${Pe} months, isSubscription: ${ae}`)}console.log("📊 Creating checkout session with data:",{bookingType:r,itemId:n,date:m.date,durationInPeriods:m.durationInPeriods,period:q==null?void 0:q.period,isSubscriptionEnabled:q==null?void 0:q.isSubscription,totalPrice:S,monthlyPrice:r==="space"?q==null?void 0:q.price:0,selectedExtrasCount:I.length,promoCode:L!=null&&L.isValid?L.code:"none"});const pe=await fetch("/.netlify/functions/createStripeCheckoutSession",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bookingType:r,itemId:n,userId:i==null?void 0:i.uid,spaceName:q==null?void 0:q.title,userName:(o==null?void 0:o.displayName)||((re=i==null?void 0:i.email)==null?void 0:re.split("@")[0]),date:m.date,startTime:r==="room"?m.startTime:void 0,endTime:r==="room"?m.endTime:void 0,numberOfPeople:r==="room"?m.numberOfPeople:void 0,durationInPeriods:r==="space"?m.durationInPeriods:void 0,selectedExtras:I,period:r==="space"?q==null?void 0:q.period:void 0,isSubscriptionEnabled:r==="space"?q==null?void 0:q.isSubscription:!1,totalPrice:S,finalDiscountedAmount:Q(),monthlyPrice:r==="space"?q==null?void 0:q.price:0,accessHours:q==null?void 0:q.accessHours,meetingRoomHours:r==="space"&&(q!=null&&q.meetingRoomHours)?q.meetingRoomHours:0,promoCode:L!=null&&L.isValid?{code:L.code}:void 0})}),Ne=await pe.json();if(!pe.ok){const Pe=Ne.details||Ne.error||"Failed to create checkout session";throw console.error("Checkout error details:",Ne),new Error(Pe)}window.location.href=Ne.sessionUrl}catch(ae){console.error("Payment error:",ae),v(ae instanceof Error?ae.message:"Something went wrong"),w(!1)}},X=()=>{var Pe;const B=m.startTime.split(":").map(Number),re=m.endTime.split(":").map(Number),ae=B[0]*60+B[1],pe=re[0]*60+re[1];let Ne=Math.ceil((pe-ae)/60);(Pe=q==null?void 0:q.title)!=null&&Pe.toLowerCase().includes("gallery")&&(Ne=Ne*2),o&&o.meetingRoomHours>=Ne?(R(!0),M(!1)):M(!0)},ue=B=>{U(B.isValid?B:null)};return t?q?b?a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[100]",children:a.jsx("div",{className:"bg-white rounded-xl p-6 max-w-md w-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx(qr,{className:"w-12 h-12 text-green-500 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Booking Successful!"}),a.jsx("p",{className:"mb-4",children:"Your booking has been confirmed."}),a.jsx("button",{onClick:e,className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Done"})]})})}):a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-end sm:items-center justify-center p-0 sm:p-4 z-[100]",children:a.jsxs("div",{className:"bg-white w-full h-full sm:h-auto sm:max-w-4xl sm:max-h-[90vh] sm:rou
4412nded-xl overflow-hidden shadow-elevated animate-slide-up sm:animate-none flex flex-col",children:[a.jsx("div",{className:"sticky top-0 bg-white z-10 px-4 py-3 sm:p-6 border-b border-gray-200 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg sm:text-2xl font-bold text-gray-900 truncate",children:q.title}),a.jsxs("p",{className:"text-sm text-gray-600",children:[r==="space"?"Workspace":"Meeting Room"," Booking"]})]}),a.jsx("button",{onClick:e,className:"p-2 hover:bg-gray-100 rounded-full transition-colors",children:a.jsx(Ge,{className:"w-5 h-5 sm:w-6 sm:h-6"})})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto pb-40 sm:pb-6",style:{WebkitOverflowScrolling:"touch"},children:a.jsxs("div",{className:"p-4 sm:p-6",children:[r==="room"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Select Date & Time"}),a.jsx("div",{className:"mb-3",children:a.jsxs("div",{className:"relative",children:[a.jsx(De,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"date",value:m.date,onChange:B=>de("date",B.target.value),min:ee(),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg",required:!0})]})}),a.jsx(t6,{roomId:n,onTimeSelect:me})]}),m.startTime&&a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Selected Time"}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qe,{className:"w-5 h-5 mr-2 text-brand-premium"}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium",children:[m.startTime," - ",m.endTime]}),a.jsx("p",{className:"text-sm text-gray-600",children:he(et(m.date),"EEEE, MMMM d, yyyy")})]})]}),a.jsx("span",{className:"text-brand-premium font-semibold",children:m.startTime&&m.endTime&&a.jsxs(a.Fragment,{children:[we()," €"]})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Number of People"}),a.jsxs("div",{className:"relative",children:[a.jsx(Mt,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("select",{value:m.numberOfPeople,onChange:B=>de("numberOfPeople",B.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg appearance-none bg-white",required:!0,children:Array.from({length:q.capacity.max},(B,re)=>{const ae=re+1;return ae>=q.capacity.min?a.jsxs("option",{value:ae,children:[ae," ",ae===1?"person":"people"]},ae):null})})]})]}),o&&o.meetingRoomHours>0&&a.jsxs("div",{className:"bg-brand-premium/10 border border-brand-premium/20 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qe,{className:"w-5 h-5 mr-2 text-brand-premium"}),a.jsx("h4",{className:"font-medium text-brand-premium",children:"Use Meeting Room Hours"})]}),a.jsxs("span",{className:"text-brand-premium font-semibold",children:[o.meetingRoomHours," hours available"]})]}),W&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-3 mb-3",children:a.jsx("p",{className:"text-sm text-red-700",children:"You don't have enough meeting room hours for this booking."})}),a.jsx("button",{onClick:X,disabled:!m.startTime||!m.endTime||C,className:"w-full py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50",children:C?"Using Meeting Room Hours":"Use My Meeting Room Hours"})]}),!C&&a.jsx(vk,{onAcceptChange:H})]}),a.jsx("div",{className:"space-y-6",children:a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm border border-gray-200",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Booking Summary"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Date:"}),a.jsx("span",{className:"font-medium",children:m.date?he(et(m.date),"MMMM d, yyyy"):"Not selected"})]}),a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Time:"}),a.jsx("span",{className:"font-medium",children:m.startTime&&m.endTime?`${m.startTime} - ${m.endTime}`:"Not selected"})]}),a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Capacity:"}),a.jsxs("span",{className:"font-medium",children:[m.numberOfPeople," ",parseInt(m.numberOfPeople)===1?"person":"people"]})]}),!C&&a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Room Rate:"}),a.jsxs("span",{className:"font-medium",children:["€",we()]})]}),C&&a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Payment Method:"}),a.jsx("span",{className:"font-medium text-brand-premium",children:"Using Meeting Room Hours"})]}),C&&((ye=q==null?void 0:q.title)==null?void 0:ye.toLowerCase().includes("gallery"))&&a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:a.jsx("p",{className:"text-sm text-yellow-800",children:"The Gallery room uses 2x credits per hour booked."})}),a.jsxs("div",{className:"flex justify-between pt-2 text-lg font-semibold",children:[a.jsx("span",{children:"Total:"}),a.jsx("span",{className:"text-brand-premium",children:C?"0 € (Using Meeting Room Hours)":`€${Q()}`})]}),!C&&a.jsx(yk,{bookingType:"room",itemId:n,totalAmount:Q(),onValidCode:ue})]}),z&&a.jsx("div",{className:"mt-4 bg-yellow-50 border border-yellow-200 text-yellow-700 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:z})]})}),g&&a.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:g})]})}),a.jsx("button",{onClick:Z,disabled:x||!m.date||!m.startTime||!m.endTime||!C&&!V||z,className:"w-full mt-6 flex justify-center py-3 px-4 border border-transparent roun
4412ded-lg shadow-sm text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium disabled:opacity-50 transition-colors",children:x?a.jsxs(a.Fragment,{children:[a.jsx(Wo,{className:"animate-spin w-5 h-5 mr-2"}),"Processing..."]}):a.jsxs(a.Fragment,{children:[C?"Confirm Booking":"Proceed to Payment",a.jsx(gs,{className:"ml-2 w-5 h-5"})]})})]})})]}),r==="space"&&a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Start Date"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"date",value:m.date,onChange:B=>de("date",B.target.value),min:ee(),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg",required:!0})]})]}),q.minDuration&&q.maxDuration&&a.jsx(kee,{spacePrice:q.price,spacePeriod:q.period,minDuration:q.minDuration,maxDuration:q.maxDuration,isSubscriptionEnabled:q.isSubscription||!1,onPaymentSelect:B=>{de("durationInPeriods",B.duration),k(B.totalPrice)}}),q.extraOptions&&q.extraOptions.length>0&&a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Add-ons & Extras"}),a.jsx("div",{className:"space-y-4",children:q.extraOptions.map(B=>{var re;return a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex-1 mr-4",children:[a.jsx("h4",{className:"font-medium",children:B.name}),a.jsx("p",{className:"text-sm text-gray-600",children:B.description}),a.jsxs("p",{className:"text-sm font-medium text-brand-premium mt-1",children:["€",B.price,"/",B.period]})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{onClick:()=>{const ae=I.find(Ne=>Ne.id===B.id),pe=ae?ae.quantity:0;ve(B,Math.max(0,pe-1))},className:"w-8 h-8 flex items-center justify-center border border-gray-300 rounded-lg",disabled:!I.find(ae=>ae.id===B.id),children:"-"}),a.jsx("span",{className:"w-8 text-center",children:((re=I.find(ae=>ae.id===B.id))==null?void 0:re.quantity)||0}),a.jsx("button",{onClick:()=>{const ae=I.find(Ne=>Ne.id===B.id),pe=ae?ae.quantity:0;ve(B,pe+1)},className:"w-8 h-8 flex items-center justify-center border border-gray-300 rounded-lg bg-brand-premium text-white",children:"+"})]})]},B.id)})})]}),!C&&a.jsx(vk,{onAcceptChange:H})]}),a.jsx("div",{className:"space-y-6",children:a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm border border-gray-200",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Booking Summary"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Space:"}),a.jsx("span",{className:"font-medium",children:q.title})]}),a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Start Date:"}),a.jsx("span",{className:"font-medium",children:m.date?he(et(m.date),"MMMM d, yyyy"):"Not selected"})]}),a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Duration:"}),a.jsxs("span",{className:"font-medium",children:[m.durationInPeriods," ",q.period,m.durationInPeriods>1?"s":""]})]}),a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Space Rate:"}),a.jsxs("span",{className:"font-medium text-brand-premium",children:["€",q.price,"/",q.period]})]}),q.meetingRoomHours>0&&a.jsxs("div",{className:"flex justify-between pb-4 border-b",children:[a.jsx("span",{className:"text-gray-600",children:"Meeting Room Hours:"}),a.jsxs("span",{className:"font-medium text-brand-premium",children:[q.meetingRoomHours,"h per ",q.period]})]}),I.length>0&&a.jsxs("div",{className:"pb-4 border-b",children:[a.jsxs("div",{className:"flex justify-between mb-2",children:[a.jsx("span",{className:"text-gray-600",children:"Selected Extras:"}),a.jsxs("span",{className:"font-medium",children:["€",ze()]})]}),a.jsx("div",{className:"space-y-1",children:I.map(B=>a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsxs("span",{children:[B.name," × ",B.quantity]}),a.jsxs("span",{children:["€",B.price*B.quantity]})]},B.id))})]}),(L==null?void 0:L.isValid)&&(L==null?void 0:L.discount)&&a.jsxs("div",{className:"flex justify-between pb-4 border-b text-green-600",children:[a.jsx("span",{children:"Discount:"}),a.jsx("span",{children:L.discount.type==="percentage"?`-${L.discount.value}%`:`-€${L.discount.value}`})]}),a.jsxs("div",{className:"flex justify-between pt-2",children:[a.jsx("span",{className:"text-lg font-semibold",children:"Total:"}),a.jsxs("div",{className:"text-right",children:[a.jsxs("span",{className:"text-lg font-semibold text-brand-premium",children:["€",
4412S]}),a.jsx("div",{className:"text-xs text-gray-500",children:"(total for entire duration)"})]})]})]}),a.jsxs("div",{className:"mt-6 p-4 bg-blue-50 rounded-lg",children:[a.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Access Information"}),a.jsx("p",{className:"text-sm text-blue-800",children:q.accessHours})]}),a.jsx(yk,{bookingType:"space",itemId:n,totalAmount:Q(),onValidCode:ue}),g&&a.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:g})]})}),z&&a.jsx("div",{className:"mt-4 bg-yellow-50 border border-yellow-200 text-yellow-700 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:z})]})}),a.jsx("button",{onClick:Z,disabled:x||!m.date||!C&&!V||z,className:"w-full mt-6 flex justify-center items-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium disabled:opacity-50 transition-colors",children:x?a.jsxs(a.Fragment,{children:[a.jsx(Wo,{className:"animate-spin w-5 h-5 mr-2"}),"Processing..."]}):a.jsxs(a.Fragment,{children:["Proceed to Payment",a.jsx(gs,{className:"ml-2 w-5 h-5"})]})})]})})]})]})})]})}):a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[100]",children:a.jsx("div",{className:"bg-white rounded-xl p-6 max-w-md w-full",children:a.jsxs("div",{className:"text-center",children:[a.jsx(pt,{className:"w-12 h-12 text-red-500 mx-auto mb-4"}),a.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Item Not Found"}),a.jsx("p",{className:"mb-4",children:"The selected item could not be found."}),a.jsx("button",{onClick:e,className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Close"})]})})}):null}const Lg={"Monitor Support":pg,"Ergonomic Chair":CV,"Whiteboard Access":JV,"Privacy Screens":vo,"Cable Management":vA,"Natural Light":rU,"Adjustable Desk":xA,"Soundproof Space":eU,"Task Lighting":HV,"Standing Desk Option":xA,"Power Outlets":vA,"Storage Locker":ga,default:pg},bk={"High-speed WiFi connection":Sw,"Shared kitchen":BV,"Office supplies":y3,"Meeting Rooms":Mt,"Phone Booths":Na,"Bike Storage":DV,"Security System":ga,"Mail Handling":Or,"Business Address":mg,Parking:LV,"Reception Services":Mt,"Cleaning services":FV,default:mg};function Cee({isOpen:t,onClose:e,space:r,onBook:n}){const[s,i]=P.useState(0),[o,l]=P.useState(!1),[c,u]=P.useState(!1);if(!t)return null;const d=[r.mainImage,...r.images.filter(g=>g!==r.mainImage)],h=()=>{i(g=>(g+1)%d.length),l(!1),u(!1)},m=()=>{i(g=>(g-1+d.length)%d.length),l(!1),u(!1)},p=g=>{i(g),l(!1),u(!1)},x=()=>{l(!0),u(!1)},w=()=>{u(!0),l(!0)};return a.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4",children:a.jsxs("div",{className:"bg-white w-full h-full sm:h-auto sm:max-h-[90vh] sm:max-w-4xl sm:rounded-xl overflow-hidden shadow-elevated animate-slide-up sm:animate-none flex flex-col",children:[a.jsx("div",{className:"sticky top-0 bg-white z-10 px-4 py-3 sm:p-6 border-b border-gray-200 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("h2",{className:"text-lg sm:text-2xl font-bold text-gray-900 truncate",children:r.title}),a.jsx("p",{className:"text-sm sm:text-base text-gray-600 italic",children:r.motto})]}),a.jsx("button",{onClick:e,className:"ml-4 p-2 hover:bg-gray-100 rounded-full transition-colors","aria-label":"Close modal",children:a.jsx(Ge,{className:"w-5 h-5 sm:w-6 sm:h-6"})})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto pb-32 sm:pb-6",style:{WebkitOverflowScrolling:"touch"},children:[a.jsxs("div",{className:"relative aspect-video sm:aspect-[16/10] bg-gray-100 flex-shrink-0",children:[!
4412o&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium rounded-full animate-spin"})}),a.jsx("img",{src:d[s],alt:`${r.title} - Image ${s+1}`,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${o&&!c?"opacity-100":"opacity-0"}`,onLoad:x,onError:w,loading:"lazy",decoding:"async"}),c&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),r.availableSpots===0&&o&&!c&&a.jsx("div",{className:"absolute top-3 left-3 z-20 bg-red-600 text-white text-sm font-bold py-2 px-4 rounded-lg shadow-lg uppercase tracking-wide",children:"Sold Out"}),r.availableSpots>0&&r.availableFrom&&o&&!c&&a.jsxs("div",{className:"absolute top-3 left-3 z-20 bg-teal-600 text-white text-sm font-bold py-2 px-4 rounded-lg shadow-lg tracking-wide",children:["Available from ",new Date(r.availableFrom+"T00:00:00").toLocaleDateString("en-US",{month:"short",year:"numeric"})]}),d.length>1&&o&&!c&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:m,className:"absolute left-2 sm:left-4 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 sm:p-3 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(fl,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),a.jsx("button",{onClick:h,className:"absolute right-2 sm:right-4 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 sm:p-3 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(_i,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),a.jsx("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex space-x-2 z-10",children:d.map((g,v)=>a.jsx("button",{onClick:()=>p(v),className:`w-2 h-2 rounded-full transition-all ${v===s?"bg-white scale-110":"bg-white/50 hover:bg-white/70"}`},v))})]}),d.length>1&&o&&!c&&a.jsxs("div",{className:"absolute top-3 right-3 bg-black/50 text-white text-xs px-2 py-1 rounded-full z-10",children:[s+1," / ",d.length]})]}),a.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[a.jsx(bu,{className:"w-5 h-5 text-brand-premium mx-auto mb-1"}),a.jsxs("div",{className:"text-lg font-bold text-gray-900",children:["€",r.price]}),a.jsxs("div",{className:"text-xs text-gray-500",children:["/",r.period]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[a.jsx(Mt,{className:"w-5 h-5 text-brand-premium mx-auto mb-1"}),a.jsx("div",{className:"text-sm font-medium text-gray-900",children:r.capacity}),a.jsx("div",{className:"text-xs text-gray-500",children:"capacity"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[a.jsx(ja,{className:"w-5 h-5 text-brand-premium mx-auto mb-1"}),a.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:r.location}),a.jsx("div",{className:"text-xs text-gray-500",children:"location"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[a.jsx(qe,{className:"w-5 h-5 text-brand-premium mx-auto mb-1"}),a.jsx("div",{className:"text-sm font-medium text-gray-900 truncate",children:r.accessHours.split(" ")[0]}),a.jsx("div",{className:"text-xs text-gray-500",children:"access"})]})]}),r.meetingRoomHours>0&&a.jsx("div",{className:"bg-brand-premium/10 border border-brand-premium/20 rounded-xl p-4",children:a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(qe,{className:"w-6 h-6 text-brand-premium"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-brand-premium",children:"Meeting Room Access Included"}),a.jsxs("p",{className:"text-sm text-brand-premium/80",children:[r.meetingRoomHours," hours of meeting room access per ",r.period]})]})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Features"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:r.features.map((g,v)=>{const b=Lg[g]||Lg.default;return a.jsxs("div",{className:"flex items-center gap-3 bg-gray-50 rounded-lg p-3 hover:bg-gray-100 transition-colors",children:[a.jsx("div",{className:"w-8 h-8 bg-brand-premium/10 rounded-lg flex items-center justify-center",children:a.jsx(b,{className:"w-4 h-4 text-brand-premium"})}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:g})]},v)})})]}),r.amenities&&r.amenities.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Amenities"}),a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:r.amenities.map((g,v)=>{const b=bk[g]||bk.default;return a.jsxs("div",{className:"flex items-center gap-3 bg-gray-50 rounded-lg p-3 hover:bg-gray-100 transition-colors",children:[a.jsx("div",{className:"w-8 h-8 bg-green-100 rounded-lg flex items-center justify-center",children:a.jsx(b,{className:"w-4 h-4 text-green-600"})}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:g})]},v)})})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"About This Space"}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:a.jsx("p",{className:"text-gray-700 leading-relaxed",children:r.description})})]}),r.extraOptions&&r.extraOptions.length>0&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Available Add-ons"}),a.jsx("div",{className:"space-y-3",children:r.extraOptions.map((g,v)=>a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("h4",{className:"font-medium text-gray-900",children:g.name}),a.jsxs("span",{className:"text-sm font-semibold text-brand-premium",children:["€",g.price,"/",g.period]})]}),g.description&&a.jsx("p",{className:"text-sm text-gray-600",children:g.description})]},v))})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Access Information"}),a.jsxs("div",{className:"space-y-1 text-sm text-blue-800",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Hours:"})," ",r.accessHours]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Available Spots:"})," ",r.availableSpots===0?a.jsx("span",{className:"text-red-600 font-semibold",children:"SOLD OUT - Contact us for waitlist"}):r.availableFrom?a.jsxs("span",{className:"text-teal-700 font-semibold",children:[r.availableSpots," — Available from ",new Date(r.availableFrom+"T00:00:00").toLocaleDateString("en-US",{month:"long",year:"numeric"})," (Book ahead!)"]}):r.availableSpots]}),r.minDuration&&a.jsxs("p",{children:[a.jsx("strong",{children:"Minimum Duration:"})," ",r.minDuration," ",r.period,"s"]}),r.maxDuration&&a.jsxs("p",{children:[a.jsx("strong",{children:"Maximum Duration:"})," ",r.maxDuration," ",r.period,"s"]})]})]}),a.jsx("div",{className:"h-8"})]})]}),a.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4 sm:relative sm:border-t-0 sm:bg-transparent sm:p-6 shadow-2xl sm:shadow-none flex-shrink-0 z-[999]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-2xl sm:text-3xl font-bold text-brand-premium",children:["€",r.price,a.jsxs("span",{className:"text-base sm:text-lg text-gray-500 font-normal",children:["/",r.period]})]}),r.isSubscription&&a.jsx("span",{className:"inline-block mt-1 text-xs bg-brand-premium/10 text-brand-premium px-2 py-1 rounded-full",children:"Subscription"})]}),r.type==="private-office"||r.availableSpots===0?a.jsxs("div",{className:"ml-4 flex gap-2",children:[a.jsxs("a",{href:`https://wa.me/${r.contactWhatsApp||"40744659659"}?text=${encodeURIComponent(r.availableSpots===0?`Hello! I'm interested in the ${r.title}. I see it's currently full - could I be added to the waitlist?`:`Hello! I'm interested in the ${r.title} private office.`)}`,target:"_blank",rel:"noopener noreferrer",className:"bg-green-500 text-white px-4 py-3 rounded-lg hover:bg-green-600 transition-colors font-medium shadow-lg min-h-[48px] flex items-center gap-2",children:[a.jsx(Ih,{className:"w-5 h-5 flex-shrink-0"}),a.jsx("span",{children:"WhatsApp"})]}),a.jsxs("a",{href:`mailto:${r.contactEmail||"[email protected]"}?subject=${encodeURIComponent(r.availableSpots===0?`Waitlist Request: ${r.title}`:`Private Office Inquiry: ${r.title}`)}`,className:"bg-gray-800 text-white px-4 py-3 rounded-lg hover:bg-gray-700 transition-colors font-medium shadow-lg min-h-[48px] flex items-center gap-2",children:[a.jsx(Or,{className:"w-5 h-5 flex-shrink-0"}),a.jsx("span",{children:"Email"})]})]}):r.availableFrom?a.jsxs("div",{className:"ml-4 flex gap-2",children:[a.jsx("button",{onClick:()=>
4412{n(r),e()},className:"bg-brand-premium text-white px-5 py-3 rounded-lg hover:bg-opacity-90 transition-colors font-medium shadow-lg min-h-[48px]",children:"Book Ahead"}),a.jsxs("a",{href:`https://wa.me/${r.contactWhatsApp||"40744659659"}?text=${encodeURIComponent(`Hello! I'm interested in the ${r.title}. I see it becomes available from ${new Date(r.availableFrom+"T00:00:00").toLocaleDateString("en-US",{month:"long",year:"numeric"})} - I'd like to reserve it.`)}`,target:"_blank",rel:"noopener noreferrer",className:"bg-green-500 text-white px-4 py-3 rounded-lg hover:bg-green-600 transition-colors font-medium shadow-lg min-h-[48px] flex items-center gap-2",children:[a.jsx(Ih,{className:"w-5 h-5 flex-shrink-0"}),a.jsx("span",{children:"WhatsApp"})]})]}):a.jsx("button",{onClick:()=>{n(r),e()},className:"ml-4 bg-brand-premium text-white px-6 py-3 rounded-lg hover:bg-opacity-90 transition-colors font-medium shadow-lg min-h-[48px]",children:"Book Now"})]})})]})})}function Iee({space:t,onBook:e}){const[r,n]=P.useState(0),[s,i]=P.useState(null),[o,l]=P.useState(null),[c,u]=P.useState(!1),[d,h]=P.useState(!1),[m,p]=P.useState(!1),x=P.useRef(null),[w,g]=P.useState(!1),[v,b]=P.useState(null),{promoCodes:y,loading:T}=z2(),N=[t.mainImage,...t.images.filter(D=>D!==t.mainImage)],j=50,_=D=>{D==null||D.stopPropagation(),n(z=>(z+1)%N.length),h(!1)},S=D=>{D==null||D.stopPropagation(),n(z=>(z-1+N.length)%N.length),h(!1)},k=D=>{l(null),i(D.targetTouches[0].clientX)},I=D=>{l(D.targetTouches[0].clientX)},E=()=>{if(!s||!o)return;const D=s-o,z=D>j,K=D<-j;z&&_(),K&&S()},C=()=>{h(!0),p(!1)},R=()=>{p(!0),h(!0)},M=(()=>{if(T||!y)return[];const D=new Date;return y.filter(z=>{var Le;const K=new Date(z.validFrom),q=new Date(z.validUntil);q.setHours(23,59,59,999);const H=z.isActive,ee=D>=K&&D<=q,de=z.applicableFor==="all"||z.applicableFor==="spaces"||z.applicableFor==="specific"&&((Le=z.specificItems)==null?void 0:Le.includes(t.id)),we=z.showOnCards;return H&&ee&&de&&we})})(),L=M.length>0,U=D=>D.type==="percentage"?`${D.value}%`:D.type==="fixed"?`€${D.value}`:"",V=D=>{navigator.clipboard.writeText(D).then(()=>{b(D),setTimeout(()=>b(null),2e3)}).catch(z=>{console.error("Could not copy text: ",z)})};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-white rounded-xl overflow-hidden shadow-card hover:shadow-elevated transition-all duration-200",children:[a.jsxs("div",{ref:x,className:"relative aspect-[16/10] touch-pan-y bg-gray-100",onTouchStart:k,onTouchMove:I,onTouchEnd:E,children:[!d&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium rounded-full animate-spin"})}),a.jsx("img",{src:N[r],alt:t.title,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${d&&!m?"opacity-100":"opacity-0"}`,onLoad:C,onError:R,loading:"lazy",decoding:"async"}),m&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),N.length>1&&d&&!m&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:S,className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white p-1.5 rounded-full hover:bg-black/70 transition-colors active:scale-95 md:p-1 z-10","aria-label":"Previous image",children:a.jsx(fl,{className:"w-4 h-4"})}),a.jsx("button",{onClick:_,className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white p-1.5 rounded-full hover:bg-black/70 transition-colors active:scale-95 md:p-1 z-10","aria-label":"Next image",children:a.jsx(_i,{className:"w-4 h-4"})}),a.jsx("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 flex space-x-1.5 z-10",children:N.map((D,z)=>a.jsx("button",{onClick:K=>{K.stopPropagation(),n(z),h(!1)},className:`w-2 h-2 rounded-full transition-all ${z===r?"bg-white scale-110":"bg-white/50 hover:bg-white/70"}`,"aria-label":`Go to image ${z+1}`},z))})]}),a.jsx("button",{onClick:()=>u(!0),className:"absolute top-3 right-3 bg-white/90 hover:bg-white text-gray-700 p-2 rounded-full transition-colors shadow-sm flex items-center justify-center z-10",title:"View Details",children:a.jsx(xr,{className:"w-4 h-4"})}),t.availableSpots===0&&d&&!m&&a.jsx("div",{className:"absolute top-3 left-3 z-20 bg-red-600 text-white text-xs font-bold py-1.5 px-3 rounded-md shadow-md uppercase tracking-wide",children:"Sold Out"}),t.availableSpots>0&&t.availableFrom&&d&&!m&&a.jsxs("div",{className:"absolute top-3 left-3 z-20 bg-teal-600 text-white text-xs font-bold py-1.5 px-3 rounded-md shadow-md tracking-wide",children:["Available from ",new Date(t.availableFrom+"T00:00:00").toLocaleDateString("en-US",{month:"short",year:"numeric"})]}),L&&t.availableSpots!==0&&d&&!m&&a.jsxs("div",{className:"absolute top-3 left-3 z-20 bg-gradient-to-r from-yellow-500 to-amber-500 text-white text-xs font-medium py-1 px-2.5 rounded-md shadow-md flex items-center",children:[a.jsx(Ti,{className:"w-3 h-3 mr-1.5"}),a.jsx("span",{children:"Promo Available"})]})]}),a.jsxs("div",{className:"p-3",children:[a.jsx("h3",{className:"text-base font-semibold mb-1",children:t.title}),a.jsx("p",{className:"text-sm text-gray-600 italic mb-1.5 line-clamp-1",children:t.motto}),a.jsx("div",{className:"grid grid-cols-3 gap-1.5 mb-2",children:t.features.slice(0,6).map((D,z)=>{const K=Lg[D]||Lg.default;return a.jsxs("div",{className:"flex flex-col items-center bg-gray-50 rounded p-1.5 text-center hover:bg-gray-100 transition-colors",title:D,children:[a.jsx(K,{className:"w-4 h-4 text-brand-premium mb-1"}),a.jsx("span",{className:"text-xs text-gray-600 truncate w-full",children:D})]},z)})}),t.meetingRoomHours>0&&a.jsxs("div",{className:"flex items-center space-x-2 mb-2 bg-brand-premium/10 text-brand-premium px-3 py-1.5 rounded-lg",children:[a.jsx(qe,{className:"w-4 h-4"}),a.jsxs("span",{className:"text-sm font-medium",children:["Includes ",t.meetingRoomHours," hrs meeting room access"]})]}),a.jsxs("div",{className:"space-y-2 pt-2 border-t",children:[a.jsx("div",{className:"flex items-center justify-between",children:a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("span",{className:"text-xl font-bold",children:["€",t.price]}),a.jsxs("span",{className:"text-gray-500 text-sm",children:["/",t.period]}),t.isSubscription&&a.jsx("div",{className:"mt-1",children:a.jsx("span",{className:"text-xs bg-brand-premium/10 text-brand-premium px-2 py-1 rounded-full",children:"Subscription"})})]})}),L&&a.jsx("div",{className:"mb-2",children:w?a.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-3",children:[a.jsxs("div",{className:"flex justify-between items-start mb-2",children:[a.jsx("p",{className:"text-xs text-yellow-700 font-medium",children:"Your promo codes:"}),a.jsx("button",{onClick:()=>g(!1),className:"text-gray-400 hover:text-gray-600 p-0.5 -mt-1",children:a.jsx(_i,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"space-y-2",children:M.map(D=>a.jsxs("div",{className:"flex items-center justify-between bg-yellow-100 rounded-lg p-2",children:[a.jsxs("div",{className:"flex items-center space-x-2 flex-1 min-w-0",children:[a.jsx("span",{className:"font-mono text-sm font-semibold text-yellow-800 truncate",children:D.code}),a.jsx("button",{onClick:()=>V(D.code),className:"text-yellow-600 p-1 hover:bg-yellow-200 rounded flex-shrink-0",title:"Copy code",children:v===D.code?a.jsx(Uo,{className:"w-4 h-4 text-green-600"}):a.jsx(h3,{className:"w-4 h-4"})})]}),a.jsx("span",{className:"text-sm font-bold text-yellow-800 ml-2 flex-shrink-0",children:U(D)})]},D.id))})]}):a.jsxs("button",{onClick:()=>g(!0),className:"w-full flex justify-between items-center px-2 py-1 bg-yellow-100 text-yellow-800 rounded-lg text-xs font-medium hover:bg-yellow-200 transition-colors",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ti,{className:"w-3 h-3 mr-1.5"}),a.jsxs("span",{children:[M.length," Discount",M.length>
44121?"s":""," Available"]})]}),a.jsx(_i,{className:"w-4 h-4"})]})}),a.jsxs("div",{className:"flex space-x-1.5",children:[a.jsx("button",{onClick:()=>u(!0),className:"flex-1 bg-gray-100 text-gray-700 px-2 py-1.5 text-xs rounded-lg hover:bg-gray-200 transition-colors font-medium min-h-[34px] flex items-center justify-center",children:"Details"}),t.type==="private-office"||t.availableSpots===0?a.jsxs(a.Fragment,{children:[a.jsxs("a",{href:`https://wa.me/${t.contactWhatsApp||"40744659659"}?text=${encodeURIComponent(t.availableSpots===0?`Hello! I'm interested in the ${t.title}. I see it's currently full - could I be added to the waitlist?`:`Hello! I'm interested in the ${t.title} private office.`)}`,target:"_blank",rel:"noopener noreferrer",onClick:D=>D.stopPropagation(),className:"flex-1 bg-green-500 text-white px-2 py-1.5 text-xs rounded-lg hover:bg-green-600 transition-colors active:scale-95 font-medium min-h-[34px] flex items-center justify-center gap-1",children:[a.jsx(Ih,{className:"w-3.5 h-3.5 flex-shrink-0"}),"WhatsApp"]}),a.jsxs("a",{href:`mailto:${t.contactEmail||"[email protected]"}?subject=${encodeURIComponent(t.availableSpots===0?`Waitlist Request: ${t.title}`:`Private Office Inquiry: ${t.title}`)}`,onClick:D=>D.stopPropagation(),className:"flex-1 bg-gray-800 text-white px-2 py-1.5 text-xs rounded-lg hover:bg-gray-700 transition-colors active:scale-95 font-medium min-h-[34px] flex items-center justify-center gap-1",children:[a.jsx(Or,{className:"w-3.5 h-3.5 flex-shrink-0"}),"Email"]})]}):t.availableFrom?a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:D=>{D.stopPropagation(),e(t)},className:"flex-1 bg-brand-premium text-white px-2 py-1.5 text-xs rounded-lg hover:bg-opacity-90 transition-colors active:scale-95 font-medium min-h-[34px] flex items-center justify-center",children:"Book Ahead"}),a.jsxs("a",{href:`https://wa.me/${t.contactWhatsApp||"40744659659"}?text=${encodeURIComponent(`Hello! I'm interested in the ${t.title}. I see it becomes available from ${new Date(t.availableFrom+"T00:00:00").toLocaleDateString("en-US",{month:"long",year:"numeric"})} - I'd like to reserve it.`)}`,target:"_blank",rel:"noopener noreferrer",onClick:D=>D.stopPropagation(),className:"flex-1 bg-green-500 text-white px-2 py-1.5 text-xs rounded-lg hover:bg-green-600 transition-colors active:scale-95 font-medium min-h-[34px] flex items-center justify-center gap-1",children:[a.jsx(Ih,{className:"w-3.5 h-3.5 flex-shrink-0"}),"WhatsApp"]})]}):a.jsx("button",{onClick:D=>{D.stopPropagation(),e(t)},className:"flex-1 bg-brand-premium text-white px-2 py-1.5 text-xs rounded-lg hover:bg-opacity-90 transition-colors active:scale-95 font-medium min-h-[34px] flex items-center justify-center",children:"Book Now"})]})]})]})]}),a.jsx(Cee,{isOpen:c,onClose:()=>u(!1),space:t,onBook:e})]})}function Oee(){const t=cr(),{user:e}=br(),{spaces:r,loading:n,error:s,isOffline:i}=$y(),[o,l]=P.useState(null),[c,u]=P.useState(!1),[d,h]=P.useState("hot-desk");if(P.useEffect(()=>{const w=sessionStorage.getItem("selectedSpaceType");w&&(h(w),sessionStorage.removeItem("selectedSpaceType"))},[]),s)return a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-card max-w-md w-full text-center",children:[a.jsx("p",{className:"text-red-600",children:s}),a.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 bg-brand-premium text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition-colors",children:"Try Again"})]})});const m=w=>{if(!e){confirm("Please sign in to book a space. Would you like to sign in now?")&&t("/login");return}l(w),u(!0)},p=r.filter(w=>w.type===d),x=[{id:"hot-desk",label:"Hot Desk",count:r.filter(w=>w.type==="hot-desk").length},{id:"dedicated-desk",label:"Dedicated",count:r.filter(w=>w.type==="dedicated-desk").length},{id:"private-office",label:"Private Office",count:r.filter(w=>w.type==="private-office").length}];return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{title:"Workspaces",description:"Browse and book flexible coworking desks, dedicated desks, and private office
4412s at Xponential Transylvania in Cluj-Napoca. Monthly or daily plans available.",canonical:"/spaces"}),a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] pb-20",children:[a.jsx("div",{className:"pt-6 pb-4",children:a.jsx("div",{className:"max-w-7xl mx-auto",children:a.jsx("div",{className:"flex gap-3 overflow-x-auto scrollbar-hide px-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:x.map(w=>a.jsx("button",{onClick:()=>h(w.id),className:`flex-shrink-0 whitespace-nowrap py-3 px-6 rounded-full text-sm font-medium transition-all duration-200 ${d===w.id?"bg-white text-brand-premium shadow-lg":"bg-white/20 text-white hover:bg-white/30 backdrop-blur-sm"}`,children:a.jsxs("div",{className:"text-center",children:[a.jsx("div",{className:"font-medium",children:w.label}),a.jsxs("div",{className:"text-xs opacity-75",children:["(",w.count,")"]})]})},w.id))})})}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-6",children:n?a.jsx("div",{className:"flex justify-center items-center py-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):p.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4 md:gap-6",children:p.map(w=>a.jsx(Iee,{space:w,onBook:m},w.id))}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("div",{className:"w-8 h-8 text-white",children:"📍"})}),a.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No spaces found"}),a.jsxs("p",{className:"text-white/80 mb-4",children:["No ",d.replace("-"," ")," spaces available"]}),d!=="hot-desk"&&a.jsx("button",{onClick:()=>h("hot-desk"),className:"bg-white text-brand-premium px-4 py-2 rounded-lg hover:bg-gray-100 transition-colors",children:"View Hot Desks"})]})}),c&&o&&a.jsx(r6,{isOpen:c,onClose:()=>{u(!1),l(null)},bookingType:"space",itemId:o.id,item:o}),s&&a.jsxs("div",{className:`border px-4 py-3 rounded-lg ${i?"bg-yellow-50 border-yellow-200 text-yellow-700":"bg-red-50 border-red-200 text-red-600"}`,children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(AlertCircle,{className:"w-5 h-5 mr-2 flex-shrink-0"}),a.jsx("span",{children:s})]}),i&&a.jsx("p",{className:"text-sm mt-2",children:"You can still browse cached content, but some features may not work until you're back online."})]})]})]})}function Ree({isOpen:t,onClose:e,room:r,onBook:n}){const[s,i]=P.useState(0),[o,l]=P.useState(!1),[c,u]=P.useState(!1);if(!t)return null;const d=[r.mainImage,...r.images.filter(y=>y!==r.mainImage)],h=()=>{i(y=>(y+1)%d.length),l(!1),u(!1)},m=()=>{i(y=>(y-1+d.length)%d.length),l(!1),u(!1)},p=y=>{i(y),l(!1),u(!1)},x=()=>{l(!0),u(!1)},w=()=>{u(!0),l(!0)},g=y=>{switch(y){case"smartTv":return pg;case"whiteboard":return vo;case"projector":return pg;case"soundSystem":return Sw;default:return vo}},v=y=>{switch(y){case"smartTv":return"Smart TV";case"whiteboard":return"Whiteboard";case"flipchart":return"Flipchart";case"soundSystem":return"Sound System";case"projector":return"Projector";case"airConditioning":return"Air Conditioning";case"ventilation":return"Ventilation";default:return y}},b=Object.entries(r.equipment).filter(([y,T])=>T).map(([y,T])=>y);return a.jsx("div",{className:"fixed inset-0 bg-black/50 z-[100] flex items-end sm:items-center justify-center p-0 sm:p-4",children:a.jsxs("div",{className:"bg-white w-full h-full sm:h-auto sm:max-h-[90vh] sm:max-w-4xl sm:rounded-xl overflow-hidden shadow-elevated animate-slide-up sm:animate-none flex flex-col",children:[a.jsx("div",{className:"sticky top-0 bg-white z-10 px-4 py-3 sm:p-6 border-b border-gray-200 flex-shrink-0",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("h2",{className:"text-lg sm:text-2xl font-bold text-gray-900 truncate",children:r.title}),r.isInfoOnly&&a.jsx("span",{className:"bg-yellow-100 text-yellow-800 px-2 py-1 rounded-full text-xs font-medium",children:"Info Only"})]}),a.jsxs("div",{className:"flex items-center space-x-4 mt-1",children:[a.jsxs("div",{className:"flex items-center text-gray-600",children:[a.jsx(Mt,{className:"w-4 h-4 mr-1"}),a.jsxs("span",{className:"text-sm",children:[r.capacity.min,"-",r.capacity.max," people"]})]}),a.jsxs("div",{className:"flex items-center text-gray-600",children:[a.jsx(ja,{className:"w-4 h-4 mr-1"}),a.jsxs("span",{className:"text-sm",children:[r.size,"m²"]})]})]})]}),a.jsx("button",{onClick:e,className:"ml-4 p-2 hover:bg-gray-100 rounded-full transition-colors","aria-label":"Close modal",children:a.jsx(Ge,{className:"w-5 h-5 sm:w-6 sm:h-6"})})]})}),a.jsxs("div",{className:"flex-1 overflow-y-auto pb-40 sm:pb-6",style:{WebkitOverflowScrolling:"touch"},children:[a.jsxs("div",{className:"relative aspect-video sm:aspect-[16/10] bg-gray-100 flex-shrink-0",children:[!
4412o&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium rounded-full animate-spin"})}),a.jsx("img",{src:d[s],alt:`${r.title} - Image ${s+1}`,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${o&&!c?"opacity-100":"opacity-0"}`,onLoad:x,onError:w,loading:"lazy",decoding:"async"}),c&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),d.length>1&&o&&!c&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:m,className:"absolute left-2 sm:left-4 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 sm:p-3 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(fl,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),a.jsx("button",{onClick:h,className:"absolute right-2 sm:right-4 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 sm:p-3 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(_i,{className:"w-4 h-4 sm:w-5 sm:h-5"})}),a.jsx("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 flex space-x-2 z-10",children:d.map((y,T)=>a.jsx("button",{onClick:()=>p(T),className:`w-2 h-2 rounded-full transition-all ${T===s?"bg-white scale-110":"bg-white/50 hover:bg-white/70"}`},T))})]}),d.length>1&&o&&!c&&a.jsxs("div",{className:"absolute top-3 right-3 bg-black/50 text-white text-xs px-2 py-1 rounded-full z-10",children:[s+1," / ",d.length]})]}),a.jsxs("div",{className:"p-4 sm:p-6 space-y-6",children:[r.isInfoOnly&&a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ri,{className:"w-5 h-5 text-yellow-600 mr-2"}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-yellow-800",children:"Information Only"}),a.jsx("p",{className:"text-sm text-yellow-700",children:"This room is for display purposes. Please contact our office for booking inquiries."})]})]})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Pricing"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"bg-gray-50 rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h4",{className:"font-medium text-gray-900",children:"Business Hours"}),a.jsx(qe,{className:"w-5 h-5 text-green-600"})]}),a.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Monday - Friday, 8:00 - 17:00"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Hourly"}),a.jsxs("span",{className:"text-lg font-bold text-gray-900",children:["€",r.prices.weekday.hourly]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Daily (4+ hours)"}),a.jsxs("span",{className:"text-lg font-bold text-gray-900",children:["€",r.prices.weekday.daily]})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-3",children:[a.jsx("h4",{className:"font-medium text-gray-900",children:"After Hours"}),a.jsx(qe,{className:"w-5 h-5 text-orange-600"})]}),a.jsx("div",{className:"text-xs text-gray-500 mb-2",children:"Evenings, weekends & holidays"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Hourly"}),a.jsxs("span",{className:"text-lg font-bold text-gray-900",children:["€",r.prices.afterHours.hourly]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Daily (4+ hours)"}),a.jsxs("span",{className:"text-lg font-bold text-gray-900",children:["€",r.prices.afterHours.daily]})]})]})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Equipment & Features"}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[b.map((y,T)=>{const N=g(y);return a.jsxs("div",{className:"flex items-center gap-3 bg-gray-50 rounded-lg p-3 hover:bg-gray-100 transition-colors",children:[a.jsx("div",{className:"w-8 h-8 bg-brand-premium/10 rounded-lg flex items-center justify-center",children:a.jsx(N,{className:"w-4 h-4 text-brand-premium"})}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:v(y)})]},T)}),r.features.map((y,T)=>a.jsxs("div",{className:"flex items-center gap-3 bg-gray-50 rounded-lg p-3 hover:bg-gray-100 transition-colors",children:[a.jsx("div",{className:"w-8 h-8 bg-green-100 rounded-lg flex items-center justify-center",children:a.jsx(vo,{className:"w-4 h-4 text-green-600"})}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:y})]},`feature-${T}`))]})]}),(r.kitchenAccess||r.flexibleFurniture)&&a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Additional Features"}),a.jsxs("div",{className:"space-y-3",children:[r.kitchenAccess&&a.jsxs("div",{className:"flex items-center gap-3 bg-blue-50 rounded-lg p-3",children:[a.jsx("div",{className:"w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center",children:a.jsx(Sw,{className:"w-4 h-4 text-blue-600"})}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Direct Kitchen Access"}),a.jsx("p",{className:"text-xs text-gray-600",children:"Easy access to kitchen facilities"})]})]}),r.flexibleFurniture&&a.jsxs("div",{className:"flex items-center gap-3 bg-purple-50 rounded-lg p-3",children:[a.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center",children:a.jsx(vo,{className:"w-4 h-4 text-purple-600"})}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm font-medium text-gray-900",children:"Flexible Furniture"}),a.jsx("p",{className:"text-xs text-gray-600",children:"Configurable room layout"})]})]})]})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"About This Room"}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:a.jsx("p",{className:"text-gray-700 leading-relaxed",children:r.description})})]}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold mb-4 text-gray-900",children:"Booking Policies"}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsx("ul",{className:"space-y-2",children:r.policy.map((y,T)=>a.jsxs("li",{className:"flex items-start text-sm text-yellow-800",children:[a.jsx("span",{className:"w-1.5 h-1.5 bg-yellow-600 rounded-full mr-3 mt-2"}),a.jsx("span",{children:y})]},T))})})]}),a.jsxs("div",{className:"bg-green-50 border border-green-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-green-900 mb-2",children:"Availability"}),a.jsxs("div",{className:"space-y-1 text-sm text-green-800",children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Available Spots:"})," ",r.availableSpots]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Capacity:"})," ",r.capacity.min,"-",r.capacity.max," people"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Room Size:"})," ",r.size,"m²"]})]})]}),r.isInfoOnly&&a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-blue-900 mb-3",children:"Contact Information"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Na,{className:"w-4 h-4 text-blue-600 mr-3"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-blue-900",children:"Phone"}),a.jsx("div",{className:"text-sm text-blue-700",children:"+40 744 659 659"})]})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Or,{className:"w-4 h-4 text-blue-600 mr-3"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-blue-900",children:"Email"}),a.jsx("div",{className:"text-sm text-blue-700",children:"[email protected]"})]})]})]}),a.jsx("div",{className:"mt-3 pt-3 border-t border-blue-200",children:a.jsxs("p",{className:"text-xs text-blue-700",children:[a.jsx("strong",{children:"Business Hours:"})," Monday - Friday, 8:00 AM - 6:00 PM"]})})]}),a.jsx("div",{className:"h-8"})]})]}),a.jsx("div",{className:"fixed bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4 sm:relative sm:border-t-0 sm:bg-transparent sm:p-6 shadow-2xl sm:shadow-none flex-shrink-0 z-[999]",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"text-lg sm:text-xl font-bold text-brand-premium",children:["From €",r.prices.weekday.hourly,"/hour"]}),a.jsxs("div",{className:"text-xs sm:text-sm text-gray-500",children:["Business hours • Daily rates available",r.isInfoOnly&&a.jsx("span",{className:"text-yellow-600 font-medium",children:" • C
4412ontact for booking"})]})]}),a.jsx("button",{onClick:()=>n(r),className:`ml-4 px-6 py-3 rounded-lg hover:bg-opacity-90 transition-colors font-medium shadow-lg min-h-[48px] ${r.isInfoOnly?"bg-yellow-500 text-white hover:bg-yellow-600":"bg-brand-premium text-white"}`,children:r.isInfoOnly?a.jsxs(a.Fragment,{children:[a.jsx(Ri,{className:"w-4 h-4 mr-2 inline"}),"Contact Info"]}):"Book Now"})]})})]})})}function Dee(){const t=cr(),{user:e}=br(),{rooms:r,loading:n,error:s}=Xm(),[i,o]=P.useState(null),[l,c]=P.useState(!1),[u,d]=P.useState(!1),[h,m]=P.useState(!1),[p,x]=P.useState({}),[w,g]=P.useState({}),[v,b]=P.useState({}),[y,T]=P.useState("all");if(n)return a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})});if(s)return a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-card max-w-md w-full text-center",children:[a.jsx("p",{className:"text-red-600",children:s}),a.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 bg-brand-premium text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition-colors",children:"Try Again"})]})});const N=M=>{if(!e){confirm("Please sign in to book a room. Would you like to sign in now?")&&t("/login");return}o(M),c(!0)},j=M=>{o(M),d(!0)},_=M=>{o(M),m(!0)},S=(M,L)=>{x(U=>({...U,[M]:((U[M]||0)+1)%L})),g(U=>({...U,[M]:!1}))},k=(M,L)=>{x(U=>({...U,[M]:((U[M]||0)-1+L)%L})),g(U=>({...U,[M]:!1}))},I=(M,L)=>{x(U=>({...U,[M]:L})),g(U=>({...U,[M]:!1}))},E=M=>{g(L=>({...L,[M]:!0})),b(L=>({...L,[M]:!1}))},C=M=>{b(L=>({...L,[M]:!0})),g(L=>({...L,[M]:!0}))},R=r.filter(M=>y==="all"||y==="small"&&M.capacity.max<=6||y==="medium"&&M.capacity.max>6&&M.capacity.max<=12||y==="large"&&M.capacity.max>12),W=[{id:"all",label:"All Sizes"},{id:"small",label:"Small (≤6)"},{id:"medium",label:"Medium (7-12)"},{id:"large",label:"Large (13+)"}];return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{title:"Meeting Rooms",description:"Book modern, fully-equipped meeting rooms at Xponential Transylvania in Cluj-Napoca. Hourly bookings, AV equipment included, central location.",canonical:"/meeting-rooms"}),a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] pb-20",children:[a.jsx("div",{className:"pt-6 pb-4",children:a.jsx("div",{className:"max-w-7xl mx-auto",children:a.jsx("div",{className:"flex gap-3 overflow-x-auto scrollbar-hide px-4",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:W.map(M=>a.jsx("button",{onClick:()=>T(M.id),className:`flex-shrink-0 whitespace-nowrap py-3 px-6 rounded-full text-sm font-medium transition-all duration-200 ${y===M.id?"bg-white text-brand-premium shadow-lg":"bg-white/20 text-white hover:bg-white/30 backdrop-blur-sm"}`,children:M.label},M.id))})})}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-6",children:R.length>0?a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6",children:R.map(M=>{const L=[M.mainImage,...M.images.filter(z=>z!==M.mainImage)],U=p[M.id]||0,V=w[M.id]||!1,D=v[M.id]||!1;return a.jsxs("div",{className:"bg-white rounded-xl overflow-hidden shadow-card",children:[a.jsxs("div",{className:"relative aspect-video bg-gray-100",children:[!V&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium rounded-full animate-spin"})}),a.jsx("img",{src:L[U],alt:M.title,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${V&&!D?"opacity-100":"opacity-0"}`,onLoad:()=>E(M.id),onError:()=>C(M.id),loading:"lazy",decoding:"async"}),D&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),L.length>1&&V&&!D&&a.jsxs(a.Fragment,{children:[a.jsx("button",{onClick:z=>{z.stopPropagation(),k(M.id,L.length)},className:"absolute left-2 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(fl,{className:"w-4 h-4"})}),a.jsx("button",{onClick:z=>{z.stopPropagation(),S(M.id,L.length)},className:"absolute right-2 top-1/2 -translate-y-1/2 bg-black/50 text-white p-2 rounded-full hover:bg-black/70 transition-colors z-10",children:a.jsx(_i,{className:"w-4 h-4"})}),a.jsx("div",{className:"absolute bottom-2 left-1/2 -translate-x-1/2 flex space-x-1 z-10",children:L.map((z,K)=>a.jsx("button",{onClick:q=>{q.stopPropagation(),I(M.id,K)},className:`w-2 h-2 rounded-full transition-all ${K===U?"bg-white scale-110":"bg-white/50 hover:bg-white/70"}`},K))})]}),a.jsx("button",{onClick:()=>j(M),className:"absolute top-3 right-3 bg-white/90 hover:bg-white text-gray-700 p-2 rounded-full transition-colors shadow-sm flex items-center justify-center z-10",title:"View Details",children:a.jsx(xr,{className:"w-4 h-4"})}),M.isInfoOnly&&a.jsx("div",{className:"absolute top-3 left-3 bg-yellow-500 text-white px-3 py-1 rounded-full text-xs font-medium z-10",children:"Info Only"})]}),a.jsxs("div",{className:"p-4 md:p-6",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg md:text-xl font-semibold",children:M.title}),a.jsxs("div",{className:"flex items-center text-gray-600 mt-1",children:[a.jsx(Mt,{className:"w-4 h-4 mr-1"}),a.jsxs("span",{className:"text-sm",children:[M.capacity.min,"-",M.capacity.max," people"]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-sm text-gray-500",children:"from"}),a.jsxs("div",{className:"flex items-center text-brand-premium font-semibold",children:[a.jsx(bu,{className:"w-4 h-4"}),a.jsxs("span",{children:[M.prices.weekday.hourly,"/hr"]})]}),M.isInfoOnly&&a.jsx("div",{className:"text-xs text-yellow-600 font-medium mt
4412-1",children:"Contact for booking"})]})]}),a.jsxs("div",{className:"mb-4",children:[a.jsx("h4",{className:"font-medium mb-2 text-sm",children:"Features"}),a.jsxs("div",{className:"grid grid-cols-2 gap-1 text-xs",children:[M.features.slice(0,6).map((z,K)=>a.jsxs("div",{className:"flex items-center text-gray-600",children:[a.jsx("span",{className:"w-1 h-1 bg-brand-premium rounded-full mr-2"}),z]},K)),M.features.length>6&&a.jsxs("div",{className:"text-gray-500",children:["+",M.features.length-6," more"]})]})]}),a.jsxs("div",{className:"border-t pt-4 mb-4",children:[a.jsx("h4",{className:"font-medium mb-2 text-sm",children:"Pricing"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-xs",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-gray-600 mb-1",children:"Business Hours"}),a.jsxs("div",{className:"font-medium",children:["€",M.prices.weekday.hourly,"/hour"]}),a.jsxs("div",{className:"text-gray-500",children:["€",M.prices.weekday.daily,"/day"]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsx("div",{className:"text-gray-600 mb-1",children:"After Hours"}),a.jsxs("div",{className:"font-medium",children:["€",M.prices.afterHours.hourly,"/hour"]}),a.jsxs("div",{className:"text-gray-500",children:["€",M.prices.afterHours.daily,"/day"]})]})]})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsx("button",{onClick:()=>j(M),className:"flex-1 py-2 px-4 border border-brand-premium text-brand-premium rounded-lg hover:bg-brand-premium/5 transition-colors font-medium text-sm",children:"View Details"}),M.isInfoOnly?a.jsxs("button",{onClick:()=>_(M),className:"flex-1 py-2 px-4 bg-yellow-500 text-white rounded-lg hover:bg-yellow-600 transition-colors font-medium text-sm flex items-center justify-center",children:[a.jsx(Ri,{className:"w-4 h-4 mr-2"}),"Contact Info"]}):a.jsx("button",{onClick:()=>N(M),className:"flex-1 py-2 px-4 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors font-medium text-sm",children:"Book Now"})]})]})]},M.id)})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx("div",{className:"w-8 h-8 text-white",children:"🏢"})}),a.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No rooms found"}),a.jsx("p",{className:"text-white/80 mb-4",children:"No meeting rooms match your filters"}),y!=="all"&&a.jsx("button",{onClick:()=>T("all"),className:"bg-white text-brand-premium px-4 py-2 rounded-lg hover:bg-gray-100 transition-colors",children:"Clear Filters"})]})}),i&&l&&!i.isInfoOnly&&a.jsx(r6,{isOpen:l,onClose:()=>{c(!1),o(null)},bookingType:"room",itemId:i.id}),i&&u&&a.jsx(Ree,{isOpen:u,onClose:()=>{d(!1),o(null)},room:i,onBook:M=>{d(!1),M.isInfoOnly?_(M):N(M)}}),i&&h&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-md",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Contact Information"}),a.jsx("button",{onClick:()=>m(!1),className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"text-center mb-6",children:[a.jsx("div",{className:"w-16 h-16 bg-yellow-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ri,{className:"w-8 h-8 text-yellow-600"})}),a.jsx("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:i.title}),a.jsx("p",{className:"text-gray-600",children:"For booking this room, please contact our office directly."})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center p-4 bg-gray-50 rounded-lg",children:[a.jsx(Na,{className:"w-5 h-5 text-brand-premium mr-3"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-gray-900",children:"Phone"}),a.jsx("div",{className:"text-sm text-gray-600",children:"+40 744 659 659"})]})]}),a.jsxs("div",{className:"flex items-center p-4 bg-gray-50 rounded-lg",children:[a.jsx(Or,{className:"w-5 h-5 text-brand-premium mr-3"}),a.jsxs("div",{children:[a.jsx("div",{className:"font-medium text-gray-900",children:"Email"}),a.jsx("div",{className:"text-sm text-gray-600",children:"[email protected]"})]})]})]}),a.jsx("div",{className:"mt-6 bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("p",{className:"text-sm text-yellow-800",children:[a.jsx("strong",{children:"Business Hours:"})," Monday - Friday, 8:00 AM - 6:00 PM"]})}),a.jsxs("div",{className:"flex space-x-3 mt-6",children:[a.jsx("button",{onClick:()=>m(!1),className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Close"}),a.jsx("a",{href:"tel:+40744659659",className:"flex-1 px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors text-center",children:"Call Now"})]})]})]})})]})]})}function n6(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null);return P.useEffect(()=>{const u=dt(Be(oe,"events")),d=Dn(u,h=>{const m=h.docs.map(p=>({id:p.id,...p.data()}));e(m),n(!1)},h=>{console.error("Error fetching events:",h),i("Failed to fetch events"),n(!1)});return()=>d()},[]),{events:t,loading:r,error:s,addEvent:async u=>{try{await wl(Be(oe,"events"),{...u,createdAt:Ct(),updatedAt:Ct()})}catch(d){throw console.error("Error adding event:",d),new Error("Failed to add event")}},updateEvent:async(u,d)=>{try{const h=Te(oe,"events",u);await Je(h,{...d,updatedAt:Ct()})}catch(h){throw console.error("Error updating event:",h),new Error("Failed to update event")}},deleteEvent:async u=>{try{await Rn(Te(oe,"events",u))}catch(d){throw console.error("Error deleting event:",d),new Error("Failed to delete event")}}}}function Mee(){const t=cr(),{user:e}=br(),{events:r,loading:n,error:s}=n6(),[i,o]=P.useState(!1),[l,c]=P.useState(null),[u,d]=P.useState(!1),[h,m]=P.useState(!1),[p,x]=P.useState(null),[w,g]=P.useState(!1);if(n)return a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})});if(s)return a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-white p-6 rounded-lg shadow-card max-w-md w-full text-center",children:[a.jsx("p",{className:"text-red-600",children:s}),a.jsx("button",{onClick:()=>window.location.reload(),className:"mt-4 bg-brand-premium text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition-colors",children:"Try Again"})]})});const v=y=>{if(!e){confirm("Please sign in to register for events. Would you like to sign in now?")&&t("/login");return}m(!1),x(null),g(!1),c(y),o(!0)},b=async()=>{const y=l;if(!(!y||!w)){d(!0),x(null);try{const T=await fetch("/.netlify/functions/registerForEvent",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await(e==null?void 0:e.getIdToken())}`},body:JSON.stringify({eventId:y.id})}),N=await T.json();if(!T.ok)throw new Error(N.error||"Failed to register for event");m(!0),setTimeout(()=>{o(!1),c(null)},3e3)}catch(T){console.error("Registration error:",T),x(T.message||"Failed to register for event")}finally{d(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{title:"Events",description:"Join networking events, workshops, and community gatherings at Xponential Transylvania coworking space in Cluj-Napoca.",canonical:"/events"}),a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] pb-20",children:[a.jsx("div",{className:"pt-8 pb-6",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4",children:[a.jsx("h1",{className:"text-3xl font-bold text-white text-center",children:"Events"}),a.jsx("p",{className:"text-white/80 text-center mt-2",children:"Discover upcoming events and workshops"})]})}),a.jsx("div",{className:"max-w-7xl mx-auto px-4 py-6",children:r.length>0?a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 md:gap-6",children:r.map(y=>{var T;return a.jsxs("div",{className:"bg-white rounded-xl overflow-hidden shadow-card",children:[a.jsxs("div",{className:"relative aspect-video",children:[a.jsx("img",{src:y.mainImage||((T=y.images)==null?void 0:T[0]),alt:y.title,className:"w-full h-full object-cover",onError:N=>{N.currentTarget.src="https://images.pexels.com/photos/976866/pexels-photo-976866.jpeg?auto=compress&cs=tinysrgb&w=1260&h=750&dpr=1"}}),a.jsx("div",{className:"absolute top-3 right-3",children:a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${y.category==="internal"?"bg-brand-premium text-white":"bg-gray-900 text-white"}`,children:y.category==="internal"?"Xponential Event":"Partner Event"})}),y.isPaid&&a.jsx("div",{className:"absolute top-3 left-3",children:a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${y.onSitePayment?"bg-blue-500 text-white":"bg-green-500 text-white"}`,children:y.onSitePayment?"Pay On-site":"Online Payment"})})]}),a.jsxs("div",{className:"p-4 md:p-6",children:[a.jsxs("div",{className:"flex items-start justify-between mb-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg md:text-xl font-semibold flex-1 mr-3",children:y.title}),a.jsx("p",{className:"text-sm text-gray-600",children:y.category==="internal"?"Organized by Xponential":`Organized by ${y.organizer}`})]}),a.jsx("div",{className:"text-right",children:a.jsx("div",{className:`text-lg font-bold ${y.isPaid?"text-brand-premium":"text-green-600"}`,children:y.isPaid?`€${y.price}`:"Free"})})]}),a.jsx("p",{className:"text-gray-600 mb-4 text-sm line-clamp-2",children:y.description}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-4",children:[a.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[a.jsx(De,{className:"w-4 h-4 mr-2 text-brand-premium"}),a.jsx("span",{children:he(et(y.date),"MMM d, yyyy")})]}),a.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[a.jsx(qe,{className:"w-4 h-4 mr-2 text-brand-premium"}
4412),a.jsxs("span",{children:[y.time," (",y.duration,")"]})]}),a.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[a.jsx(ja,{className:"w-4 h-4 mr-2 text-brand-premium"}),a.jsx("span",{className:"truncate",children:y.location})]}),a.jsxs("div",{className:"flex items-center text-sm text-gray-600",children:[a.jsx(Mt,{className:"w-4 h-4 mr-2 text-brand-premium"}),a.jsxs("span",{children:[y.capacity," spots"]})]})]}),(y.requirements||y.benefits)&&a.jsxs("div",{className:"mb-4 space-y-3",children:[y.requirements&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2 text-sm",children:"Requirements"}),a.jsxs("ul",{className:"space-y-1",children:[y.requirements.slice(0,2).map((N,j)=>a.jsxs("li",{className:"text-xs text-gray-600 flex items-start",children:[a.jsx("span",{className:"w-1 h-1 bg-brand-premium rounded-full mr-2 mt-2"}),a.jsx("span",{className:"flex-1",children:N})]},j)),y.requirements.length>2&&a.jsxs("li",{className:"text-xs text-gray-500",children:["+",y.requirements.length-2," more requirements"]})]})]}),y.benefits&&a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2 text-sm",children:"Benefits"}),a.jsxs("ul",{className:"space-y-1",children:[y.benefits.slice(0,2).map((N,j)=>a.jsxs("li",{className:"text-xs text-gray-600 flex items-start",children:[a.jsx("span",{className:"w-1 h-1 bg-green-500 rounded-full mr-2 mt-2"}),a.jsx("span",{className:"flex-1",children:N})]},j)),y.benefits.length>2&&a.jsxs("li",{className:"text-xs text-gray-500",children:["+",y.benefits.length-2," more benefits"]})]})]})]}),a.jsxs("div",{className:"flex items-center justify-between pt-4 border-t",children:[a.jsxs("div",{className:"text-xs text-gray-500",children:["by ",y.organizer]}),a.jsx("button",{onClick:()=>v(y),className:"bg-brand-premium text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition-colors text-sm font-medium",children:y.isPaid?"Book Ticket":"Register"})]})]})]},y.id)})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-16 h-16 bg-white/10 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(De,{className:"w-8 h-8 text-white"})}),a.jsx("h3",{className:"text-xl font-semibold text-white mb-2",children:"No events available"}),a.jsx("p",{className:"text-white/80",children:"Check back later for upcoming events and workshops"})]})}),i&&l&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[100]",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-xl max-h-[90vh] overflow-hidden",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Event Participation Terms"}),a.jsx("button",{onClick:()=>o(!1),className:"text-gray-400 hover:text-gray-500",children:"×"})]}),a.jsx("div",{className:"p-6 overflow-y-auto max-h-[calc(90vh-70px)]",children:h?a.jsxs("div",{className:"text-center py-6",children:[a.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Uo,{className:"w-8 h-8 text-green-500"})}),a.jsx("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Registration Successful!"}),a.jsx("p",{className:"text-gray-600 mb-4",children:l.isPaid&&l.onSitePayment?"You've registered successfully. Please pay at the venue on the event date.":"You've registered successfully. We look forward to seeing you!"})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h4",{className:"font-medium mb-3 flex items-center",children:[a.jsx(Ri,{className:"w-5 h-5 text-brand-premium mr-2"}),"Participation Agreement"]}),a.jsxs("div",{className:"space-y-4 text-sm",children:[a.jsx("p",{children:"By registering for this event, you agree to the following terms:"}),a.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[a.jsx("p",{className:"font-medium mb-2",children:"1. Photography, Video & Audio Recordings"}),a.jsx("p",{className:"text-gray-700",children:"By entering the event premises, participants acknowledge and consent to the capture and publication of images, videos, and audio by Xponential, its contractors, media, and other attendees. Xponential acquires unlimited, transferable, and exclusive rights to such recordings without obligation to provide compensation. Participants waive any claims related to the use of these materials. The participant's name will only be published with express consent, except for public figures."})]}),a.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[a.jsx("p",{className:"font-medium mb-2",children:"2. Health, Safety & Conduct"}),a.jsx("p",{className:"text-gray-700",children:"Participants must not engage in behaviour that endangers the privacy, life, bodily integrity, or health of others. All venue regulations, fire‑safety rules, and health & safety guidelines must be observed at all times."})]}),a.jsxs("div",{className:"bg-gray-50 p-4 rounded-lg",children:[a.jsx("p",{className:"font-medium mb-2",children:"3. Cancellation Policy"}),a.jsx("p",{className:"text-gray-700",children:"For free events, please notify us of cancellation at least 24 hours in advance. For paid events, refunds are available up to 48 hours before the event. After this time, no refunds will be issued."})]})]})]}),l.isPaid&&a.jsx("div",{className:"mb-6",children:a.jsxs("div",{className:`p-4 rounded-lg ${l.onSitePayment?"bg-blue-50 border border-blue-200":"bg-green-50 border border-green-200"}`,children:[a.jsx("h4",{className:`font-medium mb-2 ${l.onSitePayment?"text-blue-800":"text-green-800"}`,children:l.onSitePayment?"Payment Information (On-site)":"Payment Information (Online)"}),a.jsx("p",{className:l.onSitePayment?"text-blue-700":"text-green-700",children:l.onSitePayment?`This is a paid event (€${l.price}). Payment will be collected at the venue on the event date. Please arrive at least 15 minutes early to complete your payment.`:`This is a paid event (€${l.price}). You will need to complete your payment after registration.`})]})}),p&&a.jsx("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-2 mt-0.5"}),a.jsx("span",{className:"text-sm text-red-700",children:p})]})}),a.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 p-4 rounded-lg flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-yellow-600 mr-3 mt-0.5"}),a.jsx("p",{className:"text-sm text-yellow-700",children:"Note: For some events, additional terms may apply. These will be communicated to you prior to the event."})]}),a.jsxs("div",{className:"flex items-center mt-6",children:[a.jsx("input",{type:"checkbox",id:"accept-terms",checked:w,onChange:y=>g(y.target.checked),className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium"}),a.jsx("label",{htmlFor:"accept-terms",className:"ml-2 text-sm",children:"I accept the Participation Agreement and Terms"})]}),a.jsxs("div",{className:"flex justify-end space-x-4 mt-6",children:[a.jsx("button",{onClick:()=>o(!1),className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700",children:"Cancel"}),a.jsx("button",{onClick:b,disabled:!w||u,className:"px-4 py-2 bg-brand-premium text-white rounded-lg disabled:opacity-50 flex items-center",children:u?a.jsxs(a.Fragment,{children:[a.jsx(Wo,{className:"animate-spin w-4 h-4 mr-2"}),"Processing..."]}):"Accept & Continue"})]})]})})]})})]})]})}function $ee(){const{user:t}=br(),[e,r]=P.useState([]),[n,s]=P.useState([]),[i,o]=P.useState(!0),[l,c]=P.useState(null),[u,d]=P.useState([]);P.useEffect(()=>{if(!t){o(!1);return}const g=dt(Be(oe,"userAccess"),ht("userId","==",t.uid)),v=Dn(g,async T=>{const N=T.docs.map(j=>({id:j.id,...j.data()}));N.sort((j,_)=>!j.startDate||!_.startDate?0:_.startDate.toMillis()-j.startDate.toMillis()),r(N);try{if(N.filter(_=>_.bookingId).map(_=>_.bookingId).length>0){const _=dt(Be(oe,"bookings"),ht("userId","==",t.uid)),k=(await Zt(_)).docs.map(I=>({id:I.id,...I.data()}));console.log(`Fetched ${k.length} related bookings for access status calculation`),d(k)}}catch(j){console.error("Error fetching related bookings:",j)}},T=>{console.error("Error fetching user access:",T),c("Failed to fetch access information")}),b=dt(Be(oe,"subscriptions"),ht("userId","==",t.uid)),y=Dn(b,T=>{const N=T.docs.map(j=>({id:j.id,...j.data()}));N.sort((j,_)=>!j.startDate||!_.startDate?0:_.startDate.toMillis()-j.startDate.toMillis()),s(N),o(!1)},T=>{console.error("Error fetching subscriptions:",T),c("Failed to fetch subscription information"),o(!1)});return()=>
4412{v(),y()}},[t]);const h=()=>{const g=e.find(b=>b.status==="active"),v=n.find(b=>b.status==="active");if(g&&g.bookingId){const b=u.find(y=>y.id===g.bookingId);if(b&&(b.status==="refunded"||b.refunded))return console.log("Found refunded booking for active access:",{bookingId:b.id,status:b.status,refunded:b.refunded}),v||null;if(b&&b.date){const y=new Date(b.date),T=new Date,N=Pi(y,T);return N&&console.log("Found future booking:",{bookingDate:b.date,now:T.toISOString(),isFutureBooking:N}),{...g,actualBookingDate:b.date,actualBookingPeriod:b.period,actualBookingDuration:b.durationInPeriods,isFutureBooking:N}}}return g||v||null};return{userAccess:e,subscriptions:n,loading:i,error:l,getCurrentAccess:h,hasActiveAccess:()=>{const g=u.filter(y=>y.status==="refunded"||y.refunded).map(y=>y.id),v=e.find(y=>y.status==="active"&&(!y.bookingId||!g.includes(y.bookingId))),b=n.find(y=>y.status==="active");return v!==void 0||b!==void 0},getDaysUntilExpiration:()=>{const g=h();if(!g)return null;try{if(g.actualBookingDate){const N=et(g.actualBookingDate),j=new Date;if(Pi(N,j))return console.log("Future booking detected, not calculating days until expiration"),null;let _;g.actualBookingPeriod==="month"?_=nl(N,g.actualBookingDuration):g.actualBookingPeriod==="week"?_=Mg(N,g.actualBookingDuration):g.actualBookingPeriod==="day"?_=Rt(N,g.actualBookingDuration):_=typeof g.expiresAt.toDate=="function"?g.expiresAt.toDate():new Date(g.expiresAt);const S=_.getTime()-j.getTime(),k=Math.ceil(S/(1e3*60*60*24));return console.log("Expiration date calculated from booking start date:",{startDate:N,expirationDate:_,diffDays:k,actualBookingDate:g.actualBookingDate,actualBookingPeriod:g.actualBookingPeriod,actualBookingDuration:g.actualBookingDuration}),k>0?k:0}const v=typeof g.expiresAt.toDate=="function"?g.expiresAt.toDate():new Date(g.expiresAt),b=new Date,y=v.getTime()-b.getTime(),T=Math.ceil(y/(1e3*60*60*24));return T>0?T:0}catch(v){return console.error("Error calculating days until expiration:",v),null}},isFutureBooking:()=>{const g=h();if(!g||!g.actualBookingDate)return!1;try{const v=et(g.actualBookingDate);return Pi(v,new Date)}catch(v){return console.error("Error checking if booking is in future:",v),!1}},createPayment:async g=>{try{const v=await fetch("/.netlify/functions/createSubscription",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({userId:t==null?void 0:t.uid,...g})});if(!v.ok)throw new Error("Failed to create payment");return await v.json()}catch(v){throw console.error("Error creating payment:",v),v}}}}function Lee(){const{userAccess:t,subscriptions:e,loading:r,error:n,getCurrentAccess:s,hasActiveAccess:i,getDaysUntilExpiration:o}=$ee(),{user:l}=br(),[c,u]=P.useState(!1),[d,h]=P.useState({}),[m,p]=P.useState(!1),[x,w]=P.useState({expirationDate:null,expirationFormatted:"",startDate:null,startDateFormatted:"",isFutureBooking:!1});if(P.useEffect(()=>{const T=s();if(!T){w({expirationDate:null,expirationFormatted:"",startDate:null,startDateFormatted:"",isFutureBooking:!1});return}try{if(T.actualBookingDate){const E=et(T.actualBookingDate);let C;T.actualBookingPeriod==="month"?C=nl(E,T.actualBookingDuration||1):C=typeof T.expiresAt.toDate=="function"?T.expiresAt.toDate():new Date(T.expiresAt);const R=he(C,"MMM d, yyyy"),W=he(E,"MMM d, yyyy"),M=new Date,L=Pi(E,M);console.log("Booking details for access calculation:",{actualBookingDate:T.actualBookingDate,startDate:E,startDateFormatted:W,expirationDate:C,expirationFormatted:R,isFutureBooking:L,now:M.toISOString()}),w({expirationDate:C,expirationFormatted:R,startDate:E,startDateFormatted:W,isFutureBooking:L});return}const N=typeof T.expiresAt.toDate=="function"?T.expiresAt.toDate():new Date(T.expiresAt),j=T.startDate?typeof T.startDate.toDate=="function"?T.startDate.toDate():new Date(T.startDate):new Date,_=new Date,S=!1,k=he(N,"MMM d, yyyy"),I=he(j,"MMM d, yyyy");w({expirationDate:N,expirationFormatted:k,startDate:j,startDateFormatted:I,isFutureBooking:S})}catch(N){console.error("Error formatting expiration date:",N),w({expirationDate:null,expirationFormatted:"Error formatting date",startDate:null,startDateFormatted:"",isFutureBooking:!1})}},[s]),P.useEffect(()=>{if(!l)return;(async()=>{p(!0);try{const N=Be(oe,"bookings"),j=dt(N,ht("userId","==",l.uid),ht("status","==","confirmed"),ht("type","==","
4412space")),_=await Zt(j),S={};_.forEach(k=>{const I=k.data();I.accessPin&&(S[I.spaceId]=I.accessPin)}),h(S)}catch(N){console.error("Error fetching access PINs:",N)}finally{p(!1)}})()},[l]),r)return a.jsx("div",{className:"flex justify-center py-4",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-brand-premium"})});if(n)return a.jsx("div",{className:"text-red-600 py-4",children:a.jsx("p",{children:n})});const g=s(),v=o(),b=i(),y=Object.keys(d).length>0;return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Access Status"}),b?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qr,{className:"w-5 h-5 text-green-500 mr-2"}),a.jsx("span",{className:"font-medium text-green-700",children:"Active Access"})]}),a.jsx("span",{className:`px-3 py-1 rounded-full text-xs font-medium ${(g==null?void 0:g.paymentType)==="subscription"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:(g==null?void 0:g.paymentType)==="subscription"?"Subscription":"One-time"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Duration:"}),a.jsxs("p",{className:"font-medium",children:[(g==null?void 0:g.actualBookingDuration)||(g==null?void 0:g.duration)," ",(g==null?void 0:g.actualBookingPeriod)||(g==null?void 0:g.durationType),((g==null?void 0:g.actualBookingDuration)||(g==null?void 0:g.duration))>1?"s":""]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Expires:"}),a.jsx("p",{className:"font-medium",children:x.expirationFormatted||"N/A"})]})]}),x.isFutureBooking&&x.startDate&&a.jsxs("div",{className:"col-span-2",children:[a.jsx("span",{className:"text-gray-500",children:"Start Date:"}),a.jsx("p",{className:"font-medium text-brand-premium",children:x.startDateFormatted})]}),x.isFutureBooking?a.jsx("div",{className:"p-3 rounded-lg bg-blue-50 border border-blue-200",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(De,{className:"w-4 h-4 mr-2 text-blue-500"}),a.jsxs("span",{className:"text-sm font-medium text-blue-700",children:["Package starts on ",x.startDateFormatted]})]})}):v!==null&&a.jsx("div",{className:`p-3 rounded-lg ${v<=7?"bg-red-50 border border-red-200":v<=30?"bg-yellow-50 border border-yellow-200":"bg-green-50 border border-green-200"}`,children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(qe,{className:`w-4 h-4 mr-2 ${v<=7?"text-red-500":v<=30?"text-yellow-500":"text-green-500"}`}),a.jsx("span",{className:`text-sm font-medium ${v<=7?"text-red-700":v<=30?"text-yellow-700":"text-green-700"}`,children:v===0?"Expires today":`${v} days remaining`})]})}),y&&a.jsx("div",{children:Object.entries(d).map(([T,N])=>a.jsxs("div",{children:[a.jsxs("div",{className:"flex items-center mb-1",children:[a.jsx(xs,{className:"w-4 h-4 text-brand-premium mr-1"}),a.jsx("span",{className:"text-sm text-brand-premium",children:"Access PIN"})]}),a.jsx("div",{className:"font-mono text-brand-premium",children:N})]},T))}),m&&a.jsx("div",{className:"flex justify-center py-2",children:a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-2 border-brand-premium border-t-transparent"})})]}):a.jsxs("div",{className:"text-center py-6",children:[a.jsx(Cm,{className:"w-12 h-12 text-gray-400 mx-auto mb-3"}),a.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"No Active Access"}),a.jsx("p",{className:"text-gray-500 mb-4",children:"Purchase a plan to access the workspace"}),a.jsx("button",{onClick:()=>window.location.href="/spaces",className:"bg-brand-premium text-white px-4 py-2 rounded-lg hover:bg-opacity-90 transition-colors",children:"Browse Plans"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Payment History"}),a.jsxs("button",{onClick:()=>u(!c),className:"text-brand-premium hover:text-brand-blue transition-colors text-sm",children:[c?"Hide":"Show"," History"]})]}),c&&a.jsxs("div",{className:"space-y-3",children:[t.map(T=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Kn,{className:"w-4 h-4 text-gray-400 mr-3"}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium text-sm",children:[T.duration," ",T.durationType,T.duration>1?"s":""," Access"]}),a.jsx("p",{className:"text-xs text-gray-500",children:T.startDate?he(T.startDate.toDate(),"MMM d, yyyy"):"N/A"})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${T.status==="active"?"bg-green-100 text-green-800":T.status==="expired"?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:T.status.charAt(0).toUpperCase()+T.status.slice(1)})})]},T.id)),e.map(T=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-blue-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(De,{className:"w-4 h-4 text-blue-500 mr-3"}),a.jsxs("div",{children:[a.jsxs("p",{className:"font-medium text-sm",children:["Monthly Subscription (",T.totalDuration," months)"]}),a.jsxs("p",{className:"text-xs text-gray-500",children:[T.monthlyPrice," RON/month"]})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${T.status==="active"?"bg-blue-100 text-blue-800":T.status==="cancelled"?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:T.status.charAt(0).toUpperCase()+T.status.slice(1)})})]},T.id)),t.length===0&&e.length===0&&a.jsx("div",{className:"text-center py-4 text-gray-500",children:"No payment history found"})]})]})]})}function Fee({isOpen:t,onClose:e,pdfUrl:r,title:n}){const i=r||"https://firebasestorage.googleapis.com/v0/b/xponentiaapp.firebasestorage.app/o/Office%20good-to-knows%20(1).pdf?alt=media&token=bcf06061-0ef6-4e1a-a75a-26bc5b27ab0e";if(!t)return null;const o=()=>{const c=document.createElement("a");c.href=i,c.download="Office-Good-to-Knows.pdf",document.body.appendChild(c),c.click(),document.body.removeChild(c)},l=()=>{window.open(i,"_blank")};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-end sm:items-center justify-center p-0 sm:p-4 z-[100]",children:a.jsxs("div",{className:"bg-white w-full h-full sm:h-auto sm:max-h-[90vh] sm:max-w-5xl sm:rounded-xl overflow-hidden shadow-elevated animate-slide-up sm:animate-none flex flex-col",children:[a.jsxs("div",{className:"flex justify-between items-center p-4 sm:p-6 border-b border-gray-200 sticky top-0 bg-white z-20",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-brand-yellow/10 rounded-lg flex items-center justify-center",children:a.jsx(pc,{className:"w-5 h-5 text-brand-premium"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:n}),a.jsx("p",{className:"text-sm text-gray-500",children:"Office Guidelines & Information"})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsxs("button",{onClick:o,className:"hidden sm:flex items-center px-3 py-2 text-sm bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors",title:"Download PDF",children:[a.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Download"]}),a.jsxs("button",{onClick:l,className:"hidden sm:flex items-center px-3 py-2 text-sm bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",title:"Open in new tab",children:[a.jsx(pc,{className:"w-4 h-4 mr-2"}),"Open External"]}
4412),a.jsx("button",{onClick:e,className:"p-2 text-gray-400 hover:text-gray-500 hover:bg-gray-100 rounded-lg transition-colors",title:"Close",children:a.jsx(Ge,{className:"w-5 h-5"})})]})]}),a.jsx("div",{className:"flex-1 overflow-auto",children:a.jsx("div",{className:"w-full h-full",style:{height:"calc(100vh - 170px)",WebkitOverflowScrolling:"touch"},children:a.jsx("iframe",{src:`${i}#zoom=FitW&scrollbar=1&toolbar=1&view=FitH`,className:"w-full h-full border-0",title:n,style:{width:"100%",height:"100%",minHeight:"500px"},loading:"lazy",allow:"fullscreen",onError:c=>{console.error("PDF loading failed:",i)}})})}),a.jsx("div",{className:"sticky bottom-0 left-0 right-0 bg-white border-t border-gray-200 p-4 sm:p-4 shadow-lg sm:shadow-none z-10",children:a.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between space-y-3 sm:space-y-0",children:[a.jsxs("div",{className:"text-sm text-gray-600 text-center sm:text-left",children:[a.jsx("span",{className:"font-medium",children:"Tip:"})," Use pinch gestures to zoom or tap the PDF controls"]}),a.jsxs("div",{className:"flex items-center space-x-4 w-full sm:w-auto",children:[a.jsxs("button",{onClick:o,className:"flex-1 sm:flex-none flex items-center justify-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors text-sm min-h-[44px]",children:[a.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Download"]}),a.jsxs("button",{onClick:l,className:"flex-1 sm:flex-none flex items-center justify-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors text-sm min-h-[44px]",children:[a.jsx(pc,{className:"w-4 h-4 mr-2"}),"Open External"]}
4412)]})]})})]})})}function Bee(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),{user:o}=br();return P.useEffect(()=>{if(!o){e([]),n(!1);return}console.log("Fetching invoices for user:",o.uid);const l=dt(Be(oe,"invoices"),ht("userId","==",o.uid)),c=Dn(l,u=>{const d=u.docs.map(h=>({id:h.id,...h.data(),status:h.data().status||"active"}));d.sort((h,m)=>{var w,g,v,b;const p=((g=(w=h.issuedAt)==null?void 0:w.toDate)==null?void 0:g.call(w))||new Date(0);return(((b=(v=m.issuedAt)==null?void 0:v.toDate)==null?void 0:b.call(v))||new Date(0)).getTime()-p.getTime()}),console.log(`Found ${d.length} invoices`),e(d),n(!1)},u=>{console.error("Error fetching invoices:",u),i("Failed to fetch invoices"),n(!1)});return()=>c()},[o]),{invoices:t,loading:r,error:s}}function Vee(){const{invoices:t,loading:e,error:r}=Bee(),[n,s]=P.useState(!1);if(e)return a.jsx("div",{className:"flex justify-center py-4",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-brand-premium"})});if(r)return a.jsx("div",{className:"text-red-600 py-4",children:a.jsx("p",{children:r})});const i=n||t.length<=3?t:t.slice(0,3);return a.jsx("div",{className:"space-y-3",children:t.length===0?a.jsx("div",{className:"text-center py-4 text-gray-500",children:a.jsx("p",{children:"No invoices available"})}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"space-y-2",children:i.map(o=>{const l=o.status==="cancelled",c=l&&o.canceledPdfUrl?o.canceledPdfUrl:o.pdfUrl;return a.jsxs("div",{className:`flex items-center justify-between p-3 ${l?"bg-red-50":"bg-gray-50"} rounded-lg hover:bg-gray-100 transition-colors`,children:[a.jsxs("div",{className:"flex items-center space-x-3 min-w-0 flex-1",children:[a.jsx("div",{className:`w-10 h-10 flex-shrink-0 ${l?"bg-red-100":"bg-brand-premium/10"} rounded-lg flex items-center justify-center`,children:l?a.jsx(Si,{className:"w-5 h-5 text-red-500"}):a.jsx(vr,{className:"w-5 h-5 text-brand-premium"})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex items-center space-x-2 flex-wrap",children:[a.jsxs("p",{className:"font-medium text-sm truncate",children:["Invoice ",o.sbSeries,o.sbNumber]}),l&&a.jsx("span",{className:"inline-flex items-center px-1.5 py-0.5 bg-red-100 text-red-700 rounded text-xs",children:"Refunded"})]}),a.jsxs("div",{className:"flex items-center text-xs text-gray-500 mt-1 flex-wrap",children:[a.jsxs("span",{className:"flex items-center",children:[a.jsx(De,{className:"w-3.5 h-3.5 mr-1 flex-shrink-0"}),o.issuedAt&&typeof o.issuedAt.toDate=="function"?he(o.issuedAt.toDate(),"MMM d, yyyy"):"N/A"]}),l&&o.cancelledAt&&a.jsxs("span",{className:"flex items-center ml-2",children:[a.jsx(qe,{className:"w-3.5 h-3.5 mr-1 text-red-400 flex-shrink-0"}),a.jsx("span",{className:"text-red-400",children:typeof o.cancelledAt.toDate=="function"?`Refunded: ${he(o.cancelledAt.toDate(),"MMM d")}`:"Refunded"})]})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3 ml-2 flex-shrink-0",children:[a.jsx("div",{className:"text-right",children:a.jsx("p",{className:`font-medium ${l?"line-through text-gray-500":"text-brand-premium"} flex items-center`,children:o.currency==="RON"?a.jsxs("span",{children:["RON ",o.amount.toFixed(2)]}):a.jsxs(a.Fragment,{children:[a.jsx(bu,{className:"w-3.5 h-3.5 mr-1"}),a.jsx("span",{children:o.amount.toFixed(2)})]})})}),c&&a.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:`p-2 ${l?"bg-gray-500 hover:bg-gray-600":"bg-brand-premium hover:bg-opacity-90"} text-white rounded-lg transition-colors`,"aria-label":"Download invoice",title:l?"Download refunded invoice":"Download invoice",children:a.jsx(Ho,{className:"w-4 h-4"})})]})]},o.id)})}),t.length>3&&a.jsx("button",{onClick:()=>s(!n),className:"w-full text-sm text-center p-2 bg-gray-50 hover:bg-gray-100 rounded-lg transition-colors text-gray-700 flex items-center justify-center",children:n?a.jsxs(a.Fragment,{children:["Show Less ",a.jsx(fg,{className:"ml-1 w-4 h-4"})]}):a.jsxs(a.Fragment,{children:["Show All (",t.length,") ",a.jsx(zo,{className:"ml-1 w-4 h-4"})]})})]})})}function Uee(){var U,V,D,z,K,q,H,ee,de,we,Le,ze,Q,me,ve,Z;const t=cr(),{user:e,userProfile:r,signOut:n,refreshUserProfile:s,updateCompanyInfo:i}=br(),[o,l]=P.useState(!1),[c,u]=P.useState([]),[d,h]=P.useState([]),[m,p]=P.useState([]),[x,w]=P.useState(!0),[g,v]=P.useState(!1),[b,y]=P.useState(!1),[T,N]=P.useState(""),[j,_]=P.useState(!1),[S,k]=P.useState(!1),[I,E]=P.useState(null);P.useEffect(()=>{var ye;if(!e){t("/login");return}(ye=r==null?void 0:r.company)!=null&&ye.name&&N(r.company.name);const X=async()=>{try{const B=Be(oe,"bookings"),re=dt(B,ht("userId","==",e.uid),ht("status","==","confirmed")),ae=await Zt(re),pe=new Date,Ne=[],Pe=[];ae.forEach(Fe=>{const Ye={id:Fe.id,...Fe.data()},jt=et(Ye.date);let it;if(Ye.type==="room")it=jt;else{const at=Ye.durationInPeriods||1,$e=Ye.period||"day";$e==="day"?it=Rt(jt,at):$e==="week"?it=Mg(jt,at):$e==="month"?it=nl(jt,at):$e==="ten-days"?it=Rt(jt,at*10):$e==="half-month"?it=Rt(jt,at*15):it=Rt(jt,at)}Pi(it,pe)||it.toDateString()===pe.toDateString()?Ne.push(Ye):Pe.push(Ye)}),Ne.sort((Fe,Ye)=>new Date(Ye.date).getTime()-new Date(Fe.date).getTime()),Pe.sort((Fe,Ye)=>new Date(Ye.date).getTime()-new Date(Fe.date).getTime()),u(Ne),h(Pe)}catch(B){console.error("Error fetching bookings:",B)}},ue=async()=>{try{const B=Be(oe,"eventRegistrations"),re=dt(B,ht("userId","==",e.uid)),ae=await Zt(re);if(ae.empty){p([]);return}const pe=ae.docs.map($e=>$e.data().eventId),Ne=Be(oe,"events"),jt=(await Zt(Ne)).docs.map($e=>({id:$e.id,...$e.data()})).filter($e=>
4412pe.includes($e.id)).map($e=>{const dr=ae.docs.find(Qi=>Qi.data().eventId===$e.id);return{...$e,registration:dr?{id:dr.id,...dr.data()}:null}}),it=new Date,at=jt.filter($e=>{try{const dr=et($e.date);return Pi(dr,it)||dr.toDateString()===it.toDateString()}catch{return!1}});at.sort(($e,dr)=>{const Qi=et($e.date),Al=et(dr.date);return Qi.getTime()-Al.getTime()}),p(at)}catch(B){console.error("Error fetching upcoming events:",B)}};Promise.all([X(),ue()]).then(()=>w(!1)).catch(()=>w(!1)),s()},[e,t,s,(U=r==null?void 0:r.company)==null?void 0:U.name]);const C=async()=>{try{await n(),t("/")}catch(X){console.error("Error signing out:",X)}},R=async()=>{if(T.trim())try{_(!0),await i({...r==null?void 0:r.company,name:T.trim()}),y(!1),await s()}catch(X){console.error("Error updating company name:",X),alert("Failed to update company name")}finally{_(!1)}},W=()=>{var X;N(((X=r==null?void 0:r.company)==null?void 0:X.name)||""),y(!1)},M=async X=>{if(confirm("Are you sure you want to cancel this booking? Your meeting room hours will be returned.")){E(X);try{const ue=await fetch("/.netlify/functions/cancelMeetingRoomBooking",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await(e==null?void 0:e.getIdToken())}`},body:JSON.stringify({bookingId:X})}),ye=await ue.json();if(!ue.ok)throw new Error(ye.error||"Failed to cancel booking");alert(ye.message),u(B=>B.filter(re=>re.id!==X)),s()}catch(ue){alert(ue.message||"Failed to cancel booking")}finally{E(null)}}},L=X=>{if(X.type==="room")return new Date(X.date);const ue=new Date(X.date),ye=X.durationInPeriods||1,B=X.period||"day";let re=new Date(ue);switch(B){case"day":re=Rt(ue,ye);break;case"week":re=Mg(ue,ye);break;case"month":re=nl(ue,ye);break;case"ten-days":re=Rt(ue,ye*10);break;case"half-month":re=Rt(ue,ye*15);break;default:re=Rt(ue,ye)}return re};return!e||!r?a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-white"})}):a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] pb-20",children:[a.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-8",children:[a.jsx("div",{className:"bg-white rounded-xl p-6 shadow-sm mb-6",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-16 h-16 bg-gradient-to-br from-brand-yellow to-yellow-400 rounded-full flex items-center justify-center text-2xl font-bold text-brand-premium",children:((V=r.displayName)==null?void 0:V.slice(0,1))||((z=(D=r.email)==null?void 0:D.slice(0,1))==null?void 0:z.toUpperCase())||"?"}),a.jsxs("div",{children:[a.jsx("h1",{className:"text-2xl font-bold",children:r.displayName||"User"}),a.jsx("p",{className:"text-gray-600",children:r.email}),a.jsxs("div",{className:"flex items-center mt-1",children:[a.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${r.status==="active"?"bg-green-100 text-green-800":r.status==="suspended"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800"}`,children:((q=(K=r.status)==null?void 0:K.charAt(0))==null?void 0:q.toUpperCase())+((H=r.status)==null?void 0:H.slice(1))||"Unknown"}),a.jsx("span",{className:"text-sm text-gray-500 ml-2",children:r.subscription||"No active subscription"})]})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-3",children:[a.jsxs("button",{onClick:()=>l(!0),className:"flex items-center px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors",children:[a.jsx(vr,{className:"w-4 h-4 mr-2"}),"Office Guide"]}),a.jsxs("button",{onClick:C,className:"flex items-center px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-opacity-90 transition-colors",children:[a.jsx(p3,{className:"w-4 h-4 mr-2"}),"Sign Out"]})]})]})}),r.isOfflineClient&&a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm border-2 border-orange-200 mb-6",children:[a.jsxs("h2",{className:"text-lg font-semibold mb-4 flex items-center text-orange-600",children:[a.jsx(xs,{className:"w-5 h-5 mr-2"}
4412),"Offline Access & Contract"]}),a.jsxs("div",{className:"space-y-4",children:[r.doorPinCode&&a.jsxs("div",{className:"bg-orange-50 p-4 rounded-lg",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("span",{className:"text-sm font-medium text-orange-800",children:"Door PIN Code"}),a.jsx("button",{onClick:()=>k(!S),className:"text-orange-600 hover:text-orange-800 transition-colors",children:S?a.jsx(qo,{className:"w-4 h-4"}):a.jsx(xr,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"font-mono text-2xl font-bold text-orange-900 tracking-wider",children:S?r.doorPinCode:"••••••"})]}),(r.contractStartDate||r.contractEndDate)&&a.jsxs("div",{className:"space-y-2",children:[r.contractStartDate&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Contract Start:"}),a.jsx("span",{className:"font-medium text-gray-900",children:he(et(r.contractStartDate),"MMM d, yyyy")})]}),r.contractEndDate&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Contract End:"}),a.jsx("span",{className:"font-medium text-gray-900",children:he(et(r.contractEndDate),"MMM d, yyyy")})]}),r.contractEndDate&&(()=>{const X=et(r.contractEndDate),ue=new Date,ye=Math.ceil((X.getTime()-ue.getTime())/(1e3*60*60*24));return ye<=7&&ye>0?a.jsx("div",{className:"mt-2 p-3 bg-yellow-50 border border-yellow-200 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-4 h-4 text-yellow-600 mr-2 mt-0.5"}),a.jsxs("div",{className:"text-xs text-yellow-800",children:[a.jsx("span",{className:"font-medium",children:"Contract expiring soon!"}),a.jsxs("p",{className:"mt-1",children:["Your contract will expire in ",ye," day",ye!==1?"s":"",". Please contact the office for renewal."]})]})]})}):ye<=0?a.jsx("div",{className:"mt-2 p-3 bg-red-50 border border-red-200 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-4 h-4 text-red-600 mr-2 mt-0.5"}),a.jsxs("div",{className:"text-xs text-red-800",children:[a.jsx("span",{className:"font-medium",children:"Contract expired"}),a.jsx("p",{className:"mt-1",children:"Please contact the office to renew your contract."})]})]})}):null})()]}),r.packageType&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Package Type:"}),a.jsx("span",{className:"font-medium text-gray-900",children:r.packageType})]}),r.paymentMethod&&a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-sm text-gray-600",children:"Payment Method:"}),a.jsx("span",{className:"font-medium text-gray-900",children:r.paymentMethod})]}),r.offlineClientNotes&&a.jsxs("div",{className:"mt-4 pt-4 border-t border-orange-100",children:[a.jsx("span",{className:"text-sm text-gray-600 block mb-2",children:"Notes:"}),a.jsx("p",{className:"text-sm text-gray-700 bg-gray-50 p-3 rounded-lg whitespace-pre-wrap",children:r.offlineClientNotes})]}),r.accessLog&&r.accessLog.length>0&&a.jsxs("div",{className:"mt-6 pt-6 border-t border-orange-200",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"flex items-center justify-center w-10 h-10 bg-gradient-to-br from-blue-500 to-blue-600 rounded-xl shadow-md mr-3",children:a.jsx(qe,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Access History"}),a.jsx("div",{className:"flex items-center mt-1",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gradient-to-r from-blue-500 to-blue-600 text-white shadow-sm",children:[a.jsx("span",{className:"mr-1 text-sm font-bold",children:(()=>{const X=new Date,ue=new Date(X.getFullYear(),X.getMonth(),1),ye=new Date(X.getFullYear(),X.getMonth()+1,0);return r.accessLog.filter(re=>{try{const ae=et(re.date);return ae>=ue&&ae<=ye}catch{return!1}}).length})()}),"this month"]})})]})]})}),a.jsx("div",{className:"space-y-2.5 max-h-80 overflow-y-auto pr-1",children:r.accessLog.sort((X,ue)=>new Date(ue.date).getTime()-new Date(X.date).getTime()).map((X,ue)=>a.jsxs("div",{className:"flex items-center space-x-3 p-3.5 bg-gradient-to-r from-orange-50 to-yellow-50 rounded-xl border-2 border-orange-100 hover:border-orange-200 hover:shadow-md transition-all duration-200",children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-gradient-to-br from-orange-100 to-orange-50 rounded-lg flex items-center justify-center",children:a.jsx(De,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-semibold text-gray-900",children:he(et(X.date),"EEEE, MMM d, yyyy")}),X.note&&a.jsxs("div",{className:"text-xs text-gray-600 mt-0.5 flex items-center",children:[a.jsx(vr,{className:"w-3 h-3 mr-1 text-gray-400"}),X.note]})]})]},ue))})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"md:col-span-2 space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Active Bookings"}),x?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-premium"})}):c.length>0?a.jsx("div",{className:"space-y-4",children:c.map(X=>{const ue=L(X);return a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:shadow-sm transition-shadow",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium",children:X.spaceName}),a.jsx("p",{className:"text-sm text-gray-600",children:X.type==="space"?"Workspace":"Meeting Room"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-lg font-semibold text-brand-premium",children:X.type==="room"?`${X.startTime} - ${X.endTime}`:`${X.durationInPeriods} ${X.period}${X.durationInPeriods>1?"s":""}`}),a.jsxs("div",{className:"flex flex-col text-xs",children:[a.jsxs("span",{className:"text-gray-500",children:["Start: ",he(et(X.date),"MMM d, yyyy")]}),X.type==="space"&&a.jsxs("span",{className:"text-gray-500",children:["Expires: ",he(ue,"MMM d, yyyy")]})]})]})]}),a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${X.paymentType==="subscription"?"bg-blue-100 text-blue-800":X.paymentType==="meeting_room_hours"?"bg-purple-100 text-purple-800":"bg-green-100 text-green-800"}`,children:X.paymentType==="subscription"?"🔄 Subscription":X.paymentType==="meeting_room_hours"?"⏱️ Meeting Room Hours":"💳 One-time Payment"}),X.price>0&&X.paymentType!=="meeting_room_hours"&&a.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:[X.price," RON"]})]}),X.type==="space"&&X.accessPin&&a.jsxs("div",{className:"mt-2 flex items-center justify-between bg-brand-premium/5 p-2 rounded",children:[a.jsxs("div",{className:"flex items-center text-sm text-brand-premium",children:[a.jsx(xs,{className:"w-4 h-4 mr-1"}),a.jsx("span",{children:"Access PIN:"})]}),a.jsx("div",{className:"font-mono font-medium text-brand-premium",children:X.accessPin})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[X.accessHours&&a.jsxs("div",{className:"text-xs bg-blue-50 text-blue-700 px-2 py-1 rounded flex items-center",children:[a.jsx(qe,{className:"w-3 h-3 mr-1"}),X.accessHours]}),X.numberOfPeople&&a.jsxs("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded flex items-center",children:[a.jsx(Mt,{className:"w-3 h-3 mr-1"}),X.numberOfPeople," people"]}),X.hoursUsed&&a.jsxs("div",{className:"text-xs bg-purple-50 text-purple-700 px-2 py-1 rounded flex items-center",children:[a.jsx(qe,{className:"w-3 h-3 mr-1"}),X.hoursUsed,"h used"]})]}),X.selectedExtras&&X.selectedExtras.length>0&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-100",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Selected Extras:"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:X.selectedExtras.map((ye,B)=>a.jsx("span",{className:"text-xs bg-blue-50 text-blue-700 px-2 py-1 rounded",children:ye.name||`Extra ${B+1}`},B))})]}),X.type==="room"&&a.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100",children:a.jsx("button",{onClick:()=>M(X.id),disabled:I===X.id,className:"flex items-center px-3 py-2 text-sm text-red-600 bg-red-50 rounded-lg hover:bg-red-100 transition-colors disabled:opacity-50",children:I===X.id?a.jsxs(a.Fragment,{children:[a.jsx(Wo,{className:"w-4 h-4 mr-2 animate-spin"}),"Cancelling..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Cm,{className:"w-4 h-4 mr-2"}),"Cancel Booking"]})})})]},X.id)})}):a.jsxs("div",{className:"text-center py-8 bg-gray-50 rounded-lg",children:[a.jsx(De,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Active Bookings"}),a.jsx("p",{className:"text-gray-500 mb-4",children:"You don't have any active bookings at the moment"}),a.jsx("button",{onClick:()=>t("/spaces"),className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Book a Space"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Upcoming Events"}),x?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-premium"})}):m.length>0?a.jsx("div",{className:"space-y-4",children:m.map(X=>{var ue,ye,B,re,ae,pe,Ne;return a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:shadow-sm transition-shadow",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium",children:X.title}),a.jsx("p",{className:"text-sm text-gray-600",children:X.category==="internal"?"Xponential Event":`By ${X.organizer}`})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-sm font-semibold",children:he(et(X.date),"MMM d, yyyy")}),a.jsxs("div",{className:"text-xs text-gray-500",children:[X.time," 
4412(",X.duration,")"]})]})]}),a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${((ue=X.registration)==null?void 0:ue.paymentStatus)==="free"?"bg-gray-100 text-gray-800":((ye=X.registration)==null?void 0:ye.paymentStatus)==="paid_on_site"?"bg-blue-100 text-blue-800":((B=X.registration)==null?void 0:B.paymentStatus)==="paid"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:((re=X.registration)==null?void 0:re.paymentStatus)==="free"?"Free Event":((ae=X.registration)==null?void 0:ae.paymentStatus)==="paid_on_site"?"Pay On-site":((pe=X.registration)==null?void 0:pe.paymentStatus)==="paid"?"Paid":"Payment Pending"}),X.isPaid&&a.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:["€",X.price]})]}),a.jsxs("div",{className:"mt-2 flex flex-wrap gap-2",children:[a.jsxs("div",{className:"text-xs bg-blue-50 text-blue-700 px-2 py-1 rounded flex items-center",children:[a.jsx(ja,{className:"w-3 h-3 mr-1"}),X.location]}),X.capacity&&a.jsxs("div",{className:"text-xs bg-green-50 text-green-700 px-2 py-1 rounded flex items-center",children:[a.jsx(Mt,{className:"w-3 h-3 mr-1"}),X.capacity," capacity"]})]}),((Ne=X.registration)==null?void 0:Ne.registeredAt)&&a.jsx("div",{className:"mt-3 pt-3 border-t border-gray-100",children:a.jsxs("p",{className:"text-xs text-gray-500",children:["Registered on: ",he(X.registration.registeredAt.toDate(),"MMM d, yyyy")]})})]},X.id)})}):a.jsxs("div",{className:"text-center py-8 bg-gray-50 rounded-lg",children:[a.jsx(u3,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Upcoming Events"}),a.jsx("p",{className:"text-gray-500 mb-4",children:"You haven't registered for any upcoming events"}),a.jsx("button",{onClick:()=>t("/events"),className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Browse Events"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsxs("div",{className:"flex justify-between items-center mb-4",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Past Bookings"}),d.length>0&&a.jsxs("button",{onClick:()=>v(!g),className:"text-brand-premium hover:text-brand-blue transition-colors text-sm",children:[g?"Hide":"Show"," History"]})]}),x?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-premium"})}):d.length>0?g?a.jsx("div",{className:"space-y-4",children:d.map(X=>a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 hover:shadow-sm transition-shadow bg-gray-50",children:[a.jsxs("div",{className:"flex items-start justify-between mb-2",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"font-medium",children:X.spaceName}),a.jsx("p",{className:"text-sm text-gray-600",children:X.type==="space"?"Workspace":"Meeting Room"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-sm font-medium text-gray-700",children:X.type==="room"?`${X.startTime} - ${X.endTime}`:`${X.durationInPeriods} ${X.period}${X.durationInPeriods>1?"s":""}`}),a.jsx("p",{className:"text-xs text-gray-500",children:he(et(X.date),"MMMM d, yyyy")})]})]}),a.jsxs("div",{className:"mb-2",children:[a.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-full text-xs font-medium ${X.paymentType==="subscription"?"bg-blue-100 text-blue-800":X.paymentType==="meeting_room_hours"?"bg-purple-100 text-purple-800":"bg-green-100 text-green-800"}`,children:X.paymentType==="subscription"?"🔄 Subscription":X.paymentType==="meeting_room_hours"?"⏱️ Meeting Room Hours":"💳 One-time Payment"}),X.price>0&&X.paymentType!=="meeting_room_hours"&&a.jsxs("span",{className:"ml-2 text-xs text-gray-500",children:[X.price," RON"]})]})]},X.id))}):a.jsx("div",{className:"text-center py-4 text-gray-500",children:'Click "Show History" to view your past bookings'}):a.jsxs("div",{className:"text-center py-8 bg-gray-50 rounded-lg",children:[a.jsx(De,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Past Bookings"}),a.jsx("p",{className:"text-gray-500",children:"Your booking history will appear here"})]})]})]}),a.jsxs("div",{className:"space-y-6",children:[a.jsx(Lee,{}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsxs("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[a.jsx(vr,{className:"w-5 h-5 mr-2 text-brand-premium"}),"Invoices"]}),a.jsx(Vee,{})]}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsxs("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:[a.jsx(qe,{className:"w-5 h-5 mr-2 text-brand-premium"}),"Meeting Room Hours"]}),r.meetingRoomHours>0||r.totalMeetingRoomHours>0?a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-2xl font-bold text-brand-premium",children:r.meetingRoomHours}),a.jsx("span",{className:"text-gray-500 ml-1",children:"hours remaining"})]}),a.jsx("button",{onClick:()=>t("/meeting-rooms"),className:"px-3 py-1.5 bg-brand-premium text-white text-sm rounded-lg hover:bg-opacity-90 transition-colors",children:"Book Room"})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between text-sm",children:[a.jsx("span",{className:"text-gray-600",children:"Used"}),a.jsxs("span",{className:"font-medium",children:[r.usedMeetingRoomHours||0," hours"]})]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:"bg-brand-premium h-2 rounded-full",style:{width:r.totalMeetingRoomHours>0?`${(r.usedMeetingRoomHours||0)/r.totalMeetingRoomHours*100}%`:"0%"}})}),a.jsxs("div",{className:"flex justify-between text-xs text-gray-500",children:[a.jsx("span",{children:"0h"}),a.jsxs("span",{children:["Total: ",r.totalMeetingRoomHours,"h"]})]})]})]}):a.jsxs("div",{className:"text-center py-6",children:[a.jsx(qe,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),a.jsx("h3",{className:"text-gray-700 font-medium mb-2",children:"No Meeting Room Hours"}),a.jsx("p",{className:"text-sm text-gray-500 mb-4",children:"Get meeting room hours with workspace subscriptions"}),a.jsx("button",{onClick:()=>t("/spaces"),className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors text-sm",children:"View Workspaces"})]})]}),a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h2",{className:"text-lg font-semibold mb-4 flex items-center",children:r.accountType==="individual"?a.jsxs(a.Fragment,{children:[a.jsx(fn,{className:"w-5 h-5 mr-2 text-brand-premium"}),"Personal Account"]}):a.jsxs(a.Fragment,{children:[a.jsx(xn,{className:"w-5 h-5 mr-2 text-brand-premium"}),"Company Account"]})}),a.jsxs("div",{className:"space-y-4",children:[r.accountType==="individual"?a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Name:"}),a.jsxs("span",{className:"font-medium",children:[r.firstName," ",r.lastName]})]}),r.phone&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Phone:"}),a.jsx("span",{className:"font-medium",children:r.phone})]})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsx("span",{className:"text-gray-600 font-medium",children:"Company:"}),b?a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"text",value:T,onChange:X=>N(X.target.value),className:"px-2 py-1 border rounded text-sm"}),a.jsx("button",{onClick:R,disabled:j,className:"p-1 text-green-600 hover:bg-green-50 rounded",children:j?a.jsx("div",{className:"animate-spin h-4 w-4 border-2 border-green-600 border-t-transparent roun
4412ded-full"}):a.jsx(kN,{className:"w-4 h-4"})}),a.jsx("button",{onClick:W,className:"p-1 text-red-600 hover:bg-red-50 rounded",children:a.jsx(Ge,{className:"w-4 h-4"})})]}):a.jsxs("div",{className:"flex items-center",children:[a.jsx("span",{className:"font-medium",children:((ee=r.company)==null?void 0:ee.name)||"Not set"}),a.jsx("button",{onClick:()=>y(!0),className:"ml-2 p-1 text-brand-premium hover:bg-gray-100 rounded",children:a.jsx(Kn,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"CUI:"}),a.jsx("span",{className:"font-medium",children:((de=r.company)==null?void 0:de.cui)||"Not provided"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Type:"}),a.jsx("span",{className:"font-medium",children:((we=r.company)==null?void 0:we.type)||"Not specified"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Position:"}),a.jsx("span",{className:"font-medium",children:((Le=r.company)==null?void 0:Le.position)||"Not specified"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Industry:"}),a.jsx("span",{className:"font-medium",children:((ze=r.company)==null?void 0:ze.industry)||"Not specified"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Size:"}),a.jsx("span",{className:"font-medium",children:((Q=r.company)==null?void 0:Q.size)||"Not specified"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Country:"}),a.jsx("span",{className:"font-medium",children:((me=r.company)==null?void 0:me.country)||"Not specified"})]}),((ve=r.company)==null?void 0:ve.website)&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Website:"}),a.jsx("a",{href:r.company.website,target:"_blank",rel:"noopener noreferrer",className:"text-brand-premium hover:underline font-medium",children:r.company.website.replace(/^https?:\/\//,"")})]}),((Z=r.company)==null?void 0:Z.linkedinProfile)&&a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"LinkedIn:"}),a.jsx("a",{href:r.company.linkedinProfile,target:"_blank",rel:"noopener noreferrer",className:"text-brand-premium hover:underline font-medium",children:"Company Profile"})]})]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(Ri,{className:"w-5 h-5 text-yellow-600 mr-3 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-yellow-800",children:"Profile Editing"}),a.jsx("p",{className:"text-sm text-yellow-700 mt-1",children:"To update your complete profile information, please contact our office directly."})]})]})})]})]})]})]})]}),a.jsx(Fee,{isOpen:o,onClose:()=>l(!1),title:"Office Guidelines"})]})]})}function a6(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null);return P.useEffect(()=>{const c=dt(Be(oe,"users")),u=Dn(c,d=>{const m=d.docs.map(p=>({id:p.id,accountType:p.data().accountType||"individual",displayName:p.data().displayName||"",email:p.data().email||"",phone:p.data().phone||"",firstName:p.data().firstName||"",lastName:p.data().lastName||"",linkedinProfile:p.data().linkedinProfile||"",company:p.data().company||{name:"",type:"",position:"",industry:"",size:"",website:"",country:"",cui:"",linkedinProfile:""},subscription:p.data().subscription||"none",status:p.data().status||"active",joinDate:p.data().joinDate||null,meetingRoomHours:p.data().meetingRoomHours||0,totalMeetingRoomHours:p.data().totalMeetingRoomHours||0,usedMeetingRoomHours:p.data().usedMeetingRoomHours||0,doorPinCode:p.data().doorPinCode||"",contractStartDate:p.data().contractStartDate||"",contractEndDate:p.data().contractEndDate||"",packageType:p.data().packageType||"",offlineClientNotes:p.data().offlineClientNotes||"",isOfflineClient:p.data().isOfflineClient||!1,paymentMethod:p.data().paymentMethod||"app",accessLog:p.data().accessLog||[]})).reduce((p,x)=>(p.some(w=>w.email===x.email)||p.push(x),p),[]);e(m),n(!1)},d=>{console.error("Error fetching users:",d),i("Failed to fetch users"),n(!1)});return()=>u()},[]),{users:t,loading:r,error:s,updateUserStatus:async(c,u)=>{try{const d=Te(oe,"users",c);await Je(d,{status:u})}catch(d){throw console.error("Error updating user status:",d),new Error("Failed to update user status")}},deleteUser:async c=>{try{await Rn(Te(oe,"users",c));try{const u=await ii.currentUser;u&&u.uid===c&&await o5(u)}catch(u){console.error("Error deleting user from Authentication:",u)}e(u=>u.filter(d=>d.id!==c))}catch(u){throw console.error("Error deleting user:",u),new Error("Failed to delete user")}}}}function zee(){const{bookings:t}=U2(),{users:e}=a6(),r={totalMembers:e.length,activeSubscriptions:e.filter(o=>o.status==="active").length,roomBookings:t.length,monthlyRevenue:t.reduce((o,l)=>o+l.price,0)},n=o=>
4412{if(o.type==="room"){const l=o.startTime||"",c=o.endTime||"";if(l&&c){const u=new Date(`2000-01-01T${l}`);return`${(new Date(`2000-01-01T${c}`).getTime()-u.getTime())/(1e3*60*60)}h`}return`${l}-${c}`}else{const l=o.durationInPeriods||1,c=o.period||"day";return`${l} ${c}${l>1?"s":""}`}},s=o=>{if(o.type==="room")return new Date(o.date);const l=new Date(o.date),c=o.durationInPeriods||1,u=o.period||"day";let d=new Date(l);switch(u){case"day":d=Rt(l,c);break;case"week":d=addWeeks(l,c);break;case"month":d=nl(l,c);break;case"ten-days":d=Rt(l,c*10);break;case"half-month":d=Rt(l,c*15);break;default:d=Rt(l,c)}return d},i=o=>{const l=s(o),u=DM(l,new Date);return u<0?{status:"expired",color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",icon:ka,text:`Expired ${Math.abs(u)}d ago`}:u===0?{status:"expires-today",color:"text-red-600",bgColor:"bg-red-50",borderColor:"border-red-200",icon:ka,text:"Expires today"}:u<=7?{status:"expires-soon",color:"text-yellow-600",bgColor:"bg-yellow-50",borderColor:"border-yellow-200",icon:ka,text:`${u}d remaining`}:u<=30?{status:"expires-month",color:"text-blue-600",bgColor:"bg-blue-50",borderColor:"border-blue-200",icon:qr,text:`${u}d remaining`}:{status:"active",color:"text-green-600",bgColor:"bg-green-50",borderColor:"border-green-200",icon:qr,text:`${u}d remaining`}};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:[a.jsx("div",{className:"bg-gradient-to-br from-brand-premium to-brand-blue rounded-2xl p-6 text-white",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white/80 font-medium",children:"Total Members"}),a.jsx("h3",{className:"text-3xl font-bold mt-2",children:r.totalMembers})]}),a.jsx("div",{className:"bg-white/10 p-3 rounded-xl",children:a.jsx(Mt,{className:"w-6 h-6"})})]})}),a.jsxs("div",{className:"bg-gradient-to-br from-emerald-500 to-teal-600 rounded-2xl p-6 text-white",children:[a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white/80 font-medium",children:"Active Subscriptions"}),a.jsxs("h3",{className:"text-3xl font-bold mt-2 group relative",children:[r.activeSubscriptions,a.jsxs("span",{className:"inline-flex ml-2 cursor-help",children:[a.jsx(f3,{className:"w-5 h-5 text-white/70 hover:text-white"}),a.jsxs("span",{className:"absolute left-full bottom-0 ml-2 w-64 px-3 py-2 bg-black/75 backdrop-blur-sm text-xs font-normal text-white rounded-md opacity-0 group-hover:opacity-100 transition-opacity duration-300 pointer-events-none z-10",children:['Users with status = "active" (total: ',e.length," members)"]})]})]})]}),a.jsx("div",{className:"bg-white/10 p-3 rounded-xl",children:a.jsx(EN,{className:"w-6 h-6"})})]}),r.totalMembers>0&&a.jsx("div",{className:"mt-4 flex items-center space-x-2",children:a.jsxs("div",{className:"bg-white/10 rounded-full px-3 py-1 text-sm",children:[(r.activeSubscriptions/r.totalMembers*100).toFixed(1),"% active rate"]})})]}),a.jsx("div",{className:"bg-gradient-to-br from-amber-500 to-orange-600 rounded-2xl p-6 text-white",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white/80 font-medium",children:"Room Bookings"}),a.jsx("h3",{className:"text-3xl font-bold mt-2",children:r.roomBookings})]}),a.jsx("div",{className:"bg-white/10 p-3 rounded-xl",children:a.jsx(De,{className:"w-6 h-6"})})]})}),a.jsx("div",{className:"bg-gradient-to-br from-violet-500 to-purple-600 rounded-2xl p-6 text-white",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-white/80 font-medium",children:"Monthly Revenue"}),a.jsxs("h3",{className:"text-3xl font-bold mt-2",children:["RON ",r.monthlyRevenue]})]}),a.jsx("div",{className:"bg-white/10 p-3 rounded-xl",children:a.jsx(Kn,{className:"w-6 h-6"})})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-2xl shadow-sm",children:[a.jsxs("div",{className:"p-6 border-b border-gray-100",children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Recent Bookings"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Latest reservations overview"})]}),a.jsx("div",{className:"divide-y divide-gray-100",children:t.length>0?t.slice(0,5).map(o=>(i(o),a.jsx("div",{className:"p-4 hover:bg-gray-50/50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[a.jsx("div",{className:"w-8 h-8 bg-brand-premium/10 rounded-lg flex items-center justify-center flex-shrink-0",children:o.type==="room"?a.jsx(De,{className:"w-4 h-4 text-brand-premium"}):a.jsx(xn,{className:"w-4 h-4 text-brand-premium"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"font-medium text-gray-900 truncate",children:o.userName}),a.jsxs("p",{className:"text-sm text-gray-500 truncate",children:[o.spaceName," • ",n(o)]})]})]}),a.jsxs("div",{className:"flex items-center space-x-3 flex-shrink-0",children:[a.jsxs("span",{className:"font-bold text-brand-premium",children:["RON ",o.price]}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${o.status==="confirmed"?"bg-green-100 text-green-800":o.status==="pending"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800"}`,children:o.status})]})]})},o.id))):a.jsx("div",{className:"p-6 text-center text-gray-500",children:"No bookings yet"})})]}),a.jsxs("div",{className:"bg-white rounded-2xl shadow-sm",children:[a.jsx("div",{className:"p-6 border-b border-gray-100",children:a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Recent Members"})}),a.jsx("div",{className:"divide-y divide-gray-100",children:e.length>0?e.slice(0,5).map(o=>{var l,c,u;return a.jsx("div",{className:"p-6 hover:bg-gray-50 transition-colors",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-brand-yellow to-yellow-400 rounded-full flex items-center justify-center",children:a.jsx("span",{className:"text-brand-premium font-medium",children:((l=o.displayName)==null?void 0:l.charAt(0))||((c=o.email)==null?void 0:c.charAt(0).toUpperCase())||"?"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:o.displayName||((u=o.email)==null?void 0:u.split("@")[0])||"Unknown User"}),a.jsx("p",{className:"text-sm text-gray-500",children:o.subscription||"No subscription"})]})]}),a.jsx("span",{className:`inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium ${o.status==="active"?"bg-green-100 text-green-800":o.status==="suspended"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800"}`,children:o.status})]})},o.id)}):a.jsx("div",{className:"p-6 text-center text-gray-500",children:"No members yet"})})]})]})]})}function Hee({isOpen:t,onClose:e,userId:r,userName:n,currentHours:s}){const[i,o]=P.useState(1),[l,c]=P.useState(!1),[u,d]=P.useState(!1),[h,m]=P.useState(""),[p,x]=P.useState(null);if(!t)return null;const w=async()=>
4412{if(i<=0){x("Please enter a positive number of hours");return}c(!0),x(null);try{const v=Te(oe,"users",r),b=await Vh(v);if(!b.exists())throw new Error("User not found");const y=b.data(),T=y.meetingRoomHours||0,N=y.totalMeetingRoomHours||0;await Je(v,{meetingRoomHours:T+i,totalMeetingRoomHours:N+i,lastUpdated:new Date}),d(!0),m(`${i} meeting room ${i===1?"hour":"hours"} have been added to ${n}'s account.`),setTimeout(()=>{d(!1),m(""),o(1),e()},2e3)}catch(v){console.error("Error adding meeting room hours:",v),x("Failed to add meeting room hours. Please try again.")}finally{c(!1)}},g=async()=>{if(window.confirm(`Are you sure you want to reset all meeting room hours for ${n} to 0? This cannot be undone.`)){c(!0),x(null);try{const v=Te(oe,"users",r);await Je(v,{meetingRoomHours:0,usedMeetingRoomHours:0,totalMeetingRoomHours:0,lastUpdated:new Date}),d(!0),m(`All meeting room hours for ${n} have been reset to 0.`),setTimeout(()=>{d(!1),m(""),e()},2e3)}catch(v){console.error("Error resetting meeting room hours:",v),x("Failed to reset meeting room hours. Please try again.")}finally{c(!1)}}};return a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-md",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Add Meeting Room Hours"}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"p-6",children:u?a.jsxs("div",{className:"text-center py-6",children:[a.jsx("div",{className:"w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(qr,{className:"w-8 h-8 text-green-500"})}),a.jsx("h4",{className:"text-xl font-semibold text-gray-900 mb-2",children:"Success"}),a.jsx("p",{className:"text-gray-600",children:h})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(qe,{className:"w-5 h-5 text-brand-premium mr-2"}),a.jsx("h4",{className:"font-medium text-gray-900",children:"User Information"})]})}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-gray-500",children:"User:"}),a.jsx("p",{className:"font-medium",children:n})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-sm text-gray-500",children:"Current Hours:"}),a.jsx("p",{className:"font-medium",children:s})]})]})})]}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Meeting Room Hours to Add"}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("button",{type:"button",onClick:()=>o(Math.max(1,i-1)),className:"p-2 bg-gray-100 rounded-l-lg border border-gray-300",children:"-"}),a.jsx("input",{type:"number",value:i,onChange:v=>o(Math.max(1,parseInt(v.target.value)||0)),className:"p-2 border-t border-b border-gray-300 text-center w-20",min:"1"}),a.jsx("button",{type:"button",onClick:()=>o(i+1),className:"p-2 bg-gray-100 rounded-r-lg border border-gray-300",children:"+"})]})]}),p&&a.jsx("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsx("p",{className:"text-sm text-red-600",children:p})}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("button",{type:"button",onClick:g,disabled:l||s===0,className:"px-4 py-2 bg-red-50 text-red-600 border border-red-200 rounded-lg hover:bg-red-100 disabled:opacity-50 flex items-center transition-colors",children:[a.jsx(ZV,{className:"w-4 h-4 mr-2"}),"Reset to 0"]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50",children:"Cancel"}),a.jsx("button",{type:"button",onClick:w,disabled:l,className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 disabled:opacity-50 flex items-center",children:l?a.jsxs(a.Fragment,{children:[a.jsx(Wo,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ut,{className:"w-4 h-4 mr-2"}),"Add Hours"]})})]})]})]})})]})})}function qee({isOpen:t,onClose:e,user:r,onUpdate:n}){var d,h,m,p,x,w,g,v,b;const[s,i]=P.useState(!1),[o,l]=P.useState({firstName:r.firstName||"",lastName:r.lastName||"",email:r.email||"",phone:r.phone||"",linkedinProfile:r.linkedinProfile||"",companyName:((d=r.company)==null?void 0:d.name)||"",companyType:((h=r.company)==null?void 0:h.type)||"",position:((m=r.company)==null?void 0:m.position)||"",industry:((p=r.company)==null?void 0:p.industry)||"",companySize:((x=r.company)==null?void 0:x.size)||"",website:((w=r.company)==null?void 0:w.website)||"",country:((g=r.company)==null?void 0:g.country)||"",cui:((v=r.company)==null?void 0:v.cui)||"",companyLinkedin:((b=r.company)==null?void 0:b.linkedinProfile)||""}),c=r.accountType==="individual",u=async y=>{y.preventDefault(),i(!0);try{const T=Te(oe,"users",r.id);c?await Je(T,{firstName:o.firstName,lastName:o.lastName,displayName:`${o.firstName} ${o.lastName}`,email:o.email,phone:o.phone,linkedinProfile:o.linkedinProfile}
4412):await Je(T,{email:o.email,phone:o.phone,displayName:o.companyName,company:{name:o.companyName,type:o.companyType,position:o.position,industry:o.industry,size:o.companySize,website:o.website,country:o.country,cui:o.cui,linkedinProfile:o.companyLinkedin}}),n(),e()}catch(T){console.error("Error updating user:",T),alert("Failed to update user. Please try again.")}finally{i(!1)}};return t?a.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:a.jsxs("div",{className:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:e}),a.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full",children:a.jsxs("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-6",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[c?a.jsx("div",{className:"h-10 w-10 rounded-full bg-blue-100 flex items-center justify-center",children:a.jsx(fn,{className:"w-5 h-5 text-blue-600"})}):a.jsx("div",{className:"h-10 w-10 rounded-full bg-purple-100 flex items-center justify-center",children:a.jsx(xn,{className:"w-5 h-5 text-purple-600"})}),a.jsxs("div",{children:[a.jsxs("h3",{className:"text-lg font-semibold text-gray-900",children:["Edit ",c?"Individual":"Company"," Profile"]}),a.jsx("p",{className:"text-sm text-gray-500",children:r.email})]})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:u,className:"space-y-6",children:[c?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"First Name"}),a.jsx("input",{type:"text",value:o.firstName,onChange:y=>l({...o,firstName:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Last Name"}),a.jsx("input",{type:"text",value:o.lastName,onChange:y=>l({...o,lastName:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),a.jsx("input",{type:"email",value:o.email,onChange:y=>l({...o,email:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone"}),a.jsx("input",{type:"tel",value:o.phone,onChange:y=>l({...o,phone:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"LinkedIn Profile URL"}),a.jsx("input",{type:"url",value:o.linkedinProfile,onChange:y=>l({...o,linkedinProfile:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"https://linkedin.com/in/..."})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Name"}),a.jsx("input",{type:"text",value:o.companyName,onChange:y=>l({...o,companyName:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Type"}
4412),a.jsx("input",{type:"text",value:o.companyType,onChange:y=>l({...o,companyType:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"e.g., LLC, Corporation"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Your Position"}),a.jsx("input",{type:"text",value:o.position,onChange:y=>l({...o,position:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"e.g., CEO, Manager"})]})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Industry"}),a.jsx("input",{type:"text",value:o.industry,onChange:y=>l({...o,industry:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"e.g., Technology, Finance"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Size"}),a.jsx("input",{type:"text",value:o.companySize,onChange:y=>l({...o,companySize:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"e.g., 1-10, 10-50"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Email"}),a.jsx("input",{type:"email",value:o.email,onChange:y=>l({...o,email:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone"}),a.jsx("input",{type:"tel",value:o.phone,onChange:y=>l({...o,phone:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Website"}),a.jsx("input",{type:"url",value:o.website,onChange:y=>l({...o,website:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"https://..."})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Country"}),a.jsx("input",{type:"text",value:o.country,onChange:y=>l({...o,country:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"CUI / Tax ID"}),a.jsx("input",{type:"text",value:o.cui,onChange:y=>l({...o,cui:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Company LinkedIn Profile URL"}),a.jsx("input",{type:"url",value:o.companyLinkedin,onChange:y=>l({...o,companyLinkedin:y.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"https://linkedin.com/company/..."})]})]}),a.jsxs("div",{className:"flex justify-end space-x-3 pt-4 border-t",children:[a.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",disabled:s,children:"Cancel"}),a.jsxs("button",{type:"submit",disabled:s,className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50 flex items-center space-x-2",children:[a.jsx(kN,{className:"w-4 h-4"}),a.jsx("span",{children:s?"Saving...":"Save Changes"})]})]})]})]})})]})}):null}function Wee({message:t,type:e,onClose:r,duration:n=4e3}){P.useEffect(()=>{const l=setTimeout(()=>{r()},n);return()=>clearTimeout(l)},[n,r]);const s={success:a.jsx(qr,{className:"w-6 h-6 text-green-500"}),error:a.jsx(Cm,{className:"w-6 h-6 text-red-500"}),warning:a.jsx(pt,{className:"w-6 h-6 text-yellow-500"})},i={success:"from-green-50 to-green-100 border-green-200",error:"from-red-50 to-red-100 border-red-200",warning:"from-yellow-50 to-yellow-100 border-yellow-200"},o={success:"text-green-900",error:"text-red-900",warning:"text-yellow-900"};return a.jsx("div",{className:"fixed top-4 right-4 z-[60] animate-slideInRight",children:a.jsxs("div",{className:`bg-gradient-to-br ${i[e]} border-2 rounded-xl shadow-lg p-4 pr-12 max-w-md min-w-[280px] relative`,children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx("div",{className:"flex-shrink-0 mt-0.5",children:s[e]}),a.jsx("p",{className:`text-sm font-medium ${o[e]} flex-1`,children:t})]}),a.jsx("button",{onClick:r,className:"absolute top-3 right-3 text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(Ge,{className:"w-4 h-4"})}),a.jsx("div",{className:`absolute bottom-0 left-0 h-1 bg-gradient-to-r ${e==="success"?"from-green-500 to-green-600":e==="error"?"from-red-500 to-red-600":"from-yellow-500 to-yellow-600"} rounded-bl-xl animate-progressBar`,style:{width:"100%"}})]})})}function Gee({isOpen:t,onClose:e,onConfirm:r,title:n,message:s,confirmText:i="Confirm",cancelText:o="Cancel",type:l="warning"}){if(!t)return null;const c={danger:"text-red-500 bg-red-100",warning:"text-yellow-500 bg-yellow-100",info:"text-blue-500 bg-blue-100"},u={danger:"from-red-600 to-red-700 hover:from-red-700 hover:to-red-800",warning:"from-yellow-600 to-yellow-700 hover:from-yellow-700 hover:to-yellow-800",info:"from-blue-600 to-blue-700 hover:from-blue-700 hover:to-blue-800"};return a.jsxs("div",{className:"fixed inset-0 z-[60] flex items-center justify-center px-4 animate-fadeIn",children:[a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50",onClick:e}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl max-w-md w-full p-6 animate-scaleIn",children:[a.jsx("button",{onClick:e,className:"absolute top-4 right-4 text-gray-400 hover:text-gray-600 transition-colors",children:a.jsx(Ge,{className:"w-5 h-5"})}),a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:`flex-shrink-0 w-12 h-12 rounded-xl ${c[l]} flex items-center justify-center`,children:a.jsx(ka,{className:"w-6 h-6"})}),a.jsxs("div",{className:"flex-1 pt-1",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-2",children:n}),a.jsx("p",{className:"text-sm text-gray-600 whitespace-pre-line leading-relaxed",children:s})]})]}),a.jsxs("div",{className:"flex space-x-3 mt-6",children:[a.jsx("button",{onClick:e,className:"flex-1 px-4 py-2.5 text-sm font-medium border-2 border-gray-200 rounded-lg text-gray-700 hover:bg-gray-50 hover:border-gray-300 transition-all",children:o}),a.jsx("button",{onClick:()=>{r(),e()},className:`flex-1 px-4 py-2.5 text-sm font-medium bg-gradient-to-r ${u[l]} text-white rounded-lg shadow-md hover:shadow-lg transition-all`,children:i})]})]})]})}function Kee({isOpen:t,onClose:e,user:r,onUpdate:n}){const[s,i]=P.useState(!1),[o,l]=P.useState(!1),[c,u]=P.useState(""),[d,h]=P.useState(r.accessLog||[]),[m,p]=P.useState(!1),[x,w]=P.useState(""),[g,v]=P.useState(""),[b,y]=P.useState(null),[T,N]=P.useState(!1),[j,_]=P.useState({doorPinCode:r.doorPinCode||"",contractStartDate:r.contractStartDate||"",contractEndDate:r.contractEndDate||"",packageType:r.packageType||"",offlineClientNotes:r.offlineClientNotes||"",paymentMethod:r.paymentMethod||"bank_transfer"});P.useEffect(()=>{_({doorPinCode:r.doorPinCode||"",contractStartDate:r.contractStartDate||"",contractEndDate:r.contractEndDate||"",packageType:r.packageType||"",offlineClientNotes:r.offlineClientNotes||"",paymentMethod:r.paymentMethod||"bank_transfer"}),h(r.accessLog||[])},[r]);const S=M=>M?/^\d{4,6}$/.test(M)?(u(""),!0):(u("PIN code must be 4-6 digits"),!1):!0,k=async M=>{if(!M)return!0;const L=Be(oe,"users"),U=dt(L,ht("doorPinCode","==",M));return(await Zt(U)).docs.filter(z=>z.id!==r.id).length>0?(u("This PIN code is already in use"),!1):!0},I=()=>{const M=new Date,L=yJ(M),U=xJ(M);return d.filter(V=>{try{const D=et(V.date);return yZ(D,{start:L,end:U})}catch{return!1}}).length},E=async()=>
4412{if(!x){y({message:"Please select a date",type:"warning"});return}const M={date:x,...g&&{note:g}},L=[...d,M].sort((U,V)=>new Date(V.date).getTime()-new Date(U.date).getTime());i(!0);try{const U=Te(oe,"users",r.id);console.log("Adding access entry for user:",r.id),console.log("Updated log:",L),await Je(U,{accessLog:L,isOfflineClient:!0}),h(L),w(""),v(""),p(!1),y({message:"Access entry added successfully",type:"success"}),n()}catch(U){console.error("Error adding access entry:",U),console.error("Error code:",U==null?void 0:U.code),console.error("Error message:",U==null?void 0:U.message);const V=(U==null?void 0:U.message)||"Failed to add access entry. Please try again.";y({message:`Error: ${V}`,type:"error"})}finally{i(!1)}},C=async M=>{const L=d.filter((U,V)=>V!==M);i(!0);try{const U=Te(oe,"users",r.id);console.log("Removing access entry for user:",r.id),console.log("Updated log:",L),await Je(U,{accessLog:L}),h(L),y({message:"Access entry removed successfully",type:"success"}),n()}catch(U){console.error("Error removing access entry:",U),console.error("Error code:",U==null?void 0:U.code),console.error("Error message:",U==null?void 0:U.message);const V=(U==null?void 0:U.message)||"Failed to remove access entry. Please try again.";y({message:`Error: ${V}`,type:"error"})}finally{i(!1)}},R=async()=>{i(!0);try{const M=Te(oe,"users",r.id);await Je(M,{doorPinCode:"",contractStartDate:"",contractEndDate:"",packageType:"",offlineClientNotes:"",paymentMethod:"app",isOfflineClient:!1,accessLog:[]}),y({message:"Offline access removed successfully",type:"success"}),n(),setTimeout(()=>e(),1500)}catch(M){console.error("Error removing offline access:",M),y({message:"Failed to remove offline access. Please try again.",type:"error"})}finally{i(!1)}},W=async M=>{if(M.preventDefault(),!!S(j.doorPinCode)){i(!0);try{if(j.doorPinCode&&!await k(j.doorPinCode)){i(!1);return}const L=Te(oe,"users",r.id),U=!!(j.doorPinCode||j.contractStartDate||j.contractEndDate||j.packageType||j.offlineClientNotes);await Je(L,{doorPinCode:j.doorPinCode,contractStartDate:j.contractStartDate,contractEndDate:j.contractEndDate,packageType:j.packageType,offlineClientNotes:j.offlineClientNotes,paymentMethod:j.paymentMethod,isOfflineClient:U,accessLog:d}),y({message:"Offline client information updated successfully",type:"success"}),n(),setTimeout(()=>e(),1500)}catch(L){console.error("Error updating offline client info:",L),y({message:"Failed to update offline client information. Please try again.",type:"error"})}finally{i(!1)}}};return t?a.jsxs("div",{className:"fixed inset-0 z-50 overflow-y-auto",children:[a.jsxs("div",{className:"flex min-h-screen items-center justify-center px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[a.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:e}),a.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-2xl sm:w-full",children:a.jsxs("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"h-10 w-10 rounded-full bg-orange-100 flex items-center justify-center",children:a.jsx(xs,{className:"w-5 h-5 text-orange-600"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Manage Offline Access"}),a.jsx("p",{className:"text-sm text-gray-500",children:r.displayName||r.email})]})]}),a.jsx("button",{onClick:e,className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:`mb-6 p-3 rounded-lg border ${r.isOfflineClient?"bg-green-50 border-green-200":"bg-gray-50 border-gray-200"}`,children:a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(pt,{className:`w-4 h-4 ${r.isOfflineClient?"text-green-600":"text-gray-500"}`}),a.jsx("span",{className:`text-sm font-medium ${r.isOfflineClient?"text-green-800":"text-gray-700"}`,children:r.isOfflineClient?"This user currently has offline access":"This user does not have offline access"})]})}),a.jsxs("form",{onSubmit:W,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(xs,{className:"w-4 h-4 mr-2"}),"Door PIN Code"]})}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{type:o?"text":"password",value:j.doorPinCode,onChange:M=>{_({...j,doorPinCode:M.target.value}),S(M.target.value)},className:`w-full px-4 py-2 border rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent ${c?"border-red-500":"border-gray-300"}`,placeholder:"Enter 4-6 digit PIN code",maxLength:6}),a.jsx("button",{type:"button",onClick:()=>l(!o),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",children:o?a.jsx(qo,{className:"w-5 h-5"}):a.jsx(xr,{className:"w-5 h-5"})})]}),c&&a.jsx("p",{className:"mt-1 text-sm text-red-600",children:c}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Optional: Leave empty if client doesn't need door access"})]}),a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(De,{className:"w-4 h-4 mr-2"}),"Contract Start Date"]})}),a.jsx("input",{type:"date",value:j.contractStartDate,onChange:M=>_({...j,contractStartDate:M.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(De,{className:"w-4 h-4 mr-2"}),"Contract End Date"]})}),a.jsx("input",{type:"date",value:j.contractEndDate,onChange:M=>_({...j,contractEndDate:M.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",min:j.contractStartDate})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(x3,{className:"w-4 h-4 mr-2"}),"Package Type"]})}
4412),a.jsxs("select",{value:j.packageType,onChange:M=>_({...j,packageType:M.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",children:[a.jsx("option",{value:"",children:"Select package type"}),a.jsx("option",{value:"Hot Desk",children:"Hot Desk"}),a.jsx("option",{value:"Dedicated Desk",children:"Dedicated Desk"}),a.jsx("option",{value:"Private Office",children:"Private Office"}),a.jsx("option",{value:"Meeting Room Only",children:"Meeting Room Only"}),a.jsx("option",{value:"Custom",children:"Custom"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(Kn,{className:"w-4 h-4 mr-2"}),"Payment Method"]})}),a.jsxs("select",{value:j.paymentMethod,onChange:M=>_({...j,paymentMethod:M.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",children:[a.jsx("option",{value:"bank_transfer",children:"Bank Transfer"}),a.jsx("option",{value:"cash",children:"Cash"}),a.jsx("option",{value:"other",children:"Other"}),a.jsx("option",{value:"app",children:"App Payment"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx(vr,{className:"w-4 h-4 mr-2"}),"Notes"]})}),a.jsx("textarea",{value:j.offlineClientNotes,onChange:M=>_({...j,offlineClientNotes:M.target.value}),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",rows:4,placeholder:"Any additional information about this client..."})]}),a.jsxs("div",{className:"border-t pt-6 mt-6 bg-gradient-to-br from-blue-50/50 to-transparent -mx-6 px-6 -mb-6 pb-6 rounded-b-xl",children:[a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-3 mb-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"flex items-center justify-center w-10 h-10 bg-gradient-to-br from-blue-500 to-blue-600 rounded-xl shadow-md mr-3",children:a.jsx(qe,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900",children:"Access Tracking"}),a.jsx("div",{className:"flex items-center mt-1",children:a.jsxs("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gradient-to-r from-blue-500 to-blue-600 text-white shadow-sm",children:[a.jsx("span",{className:"mr-1 text-sm font-bold",children:I()})," this month"]})})]})]}),a.jsxs("button",{type:"button",onClick:()=>p(!m),className:"inline-flex items-center justify-center px-4 py-2.5 text-sm font-medium text-white bg-gradient-to-r from-brand-premium to-brand-blue rounded-lg hover:shadow-lg hover:scale-105 transition-all duration-200 shadow-md",children:[a.jsx(Ut,{className:"w-4 h-4 mr-1.5"}),a.jsx("span",{children:"Add Access"})]})]}),m&&a.jsxs("div",{className:"mb-4 p-4 bg-white rounded-xl border-2 border-blue-200 shadow-sm animate-fadeIn",children:[a.jsxs("h4",{className:"text-sm font-semibold text-gray-700 mb-3 flex items-center",children:[a.jsx(Ut,{className:"w-4 h-4 mr-1.5 text-blue-600"}),"New Access Entry"]}),a.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs font-medium text-gray-700 mb-1.5 flex items-center",children:[a.jsx(De,{className:"w-3.5 h-3.5 mr-1.5 text-gray-500"}),"Date"]}),a.jsx("input",{type:"date",value:x,onChange:M=>w(M.target.value),className:"w-full px-4 py-2.5 text-sm border-2 border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"block text-xs font-medium text-gray-700 mb-1.5 flex items-center",children:[a.jsx(vr,{className:"w-3.5 h-3.5 mr-1.5 text-gray-500"}),"Note (optional)"]}),a.jsx("input",{type:"text",value:g,onChange:M=>v(M.target.value),placeholder:"e.g., Morning visit, Event attendance...",className:"w-full px-4 py-2.5 text-sm border-2 border-gray-200 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-blue-500 transition-colors"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-2 mt-4 pt-3 border-t border-gray-100",children:[a.jsx("button",{type:"button",onClick:()=>{p(!1),w(""),v("")},className:"px-4 py-2 text-sm font-medium border-2 border-gray-200 rounded-lg text-gray-700 hover:bg-gray-50 hover:border-gray-300 transition-all",children:"Cancel"}),a.jsxs("button",{type:"button",onClick:E,disabled:s,className:"px-4 py-2 text-sm font-medium bg-gradient-to-r from-blue-600 to-blue-700 text-white rounded-lg hover:shadow-lg hover:scale-105 transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",children:[a.jsx(Ut,{className:"w-4 h-4 inline mr-1"}),s?"Adding...":"Add Entry"]})]})]}),a.jsx("div",{className:"space-y-2.5 max-h-64 overflow-y-auto pr-1",children:d.length===0?a.jsxs("div",{className:"text-center py-8 px-4",children:[a.jsx("div",{className:"inline-flex items-center justify-center w-16 h-16 bg-gray-100 rounded-full mb-3",children:a.jsx(qe,{className:"w-8 h-8 text-gray-400"})}),a.jsx("p",{className:"text-sm text-gray-500",children:"No access records yet"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Add the first entry to start tracking"})]}):d.map((M,L)=>a.jsxs("div",{className:"group flex items-center justify-between p-3.5 bg-white rounded-xl border-2 border-gray-100 hover:border-blue-200 hover:shadow-md transition-all duration-200",children:[a.jsxs("div",{className:"flex items-center space-x-3 flex-1 min-w-0",children:[a.jsx("div",{className:"flex-shrink-0 w-10 h-10 bg-gradient-to-br from-blue-100 to-blue-50 rounded-lg flex items-center justify-center group-hover:from-blue-200 group-hover:to-blue-100 transition-colors",children:a.jsx(De,{className:"w-5 h-5 text-blue-600"})}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsx("div",{className:"text-sm font-semibold text-gray-900",children:he(et(M.date),"MMM d, yyyy")}),M.note&&a.jsx("div",{className:"text-xs text-gray-500 mt-0.5 truncate",children:M.note})]})]}),a.jsx("button",{type:"button",onClick:()=>C(L),disabled:s,className:"flex-shrink-0 ml-2 text-gray-400 hover:text-red-500 hover:bg-red-50 p-2 rounded-lg transition-all duration-200 disabled:opacity-50 disabled:cursor-not-allowed",title:"Remove entry",children:a.jsx(Ge,{className:"w-4 h-4"})})]},L))})]}),a.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[r.isOfflineClient&&a.jsxs("button",{type:"button",onClick:()=>N(!0),disabled:s,className:"px-4 py-2 bg-red-600 text-white rounded-lg hover:bg-red-700 transition-colors disabled:opacity-50 flex items-center space-x-2",children:[a.jsx(_a,{className:"w-4 h-4"}),a.jsx("span",{children:"Remove All Access"})]}),a.jsxs("div",{className:`flex space-x-3 ${r.isOfflineClient?"":"ml-auto"}`,children:[a.jsx("button",{type:"button",onClick:e,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",disabled:s,children:"Cancel"}),a.jsxs("button",{type:"submit",disabled:s||!!c,className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50 flex items-center space-x-2",children:[a.jsx(kN,{className:"w-4 h-4"}),a.jsx("span",{children:s?"Saving...":"Save Changes"})]})]})]})]})]})})]}),b&&a.jsx(Wee,{message:b.message,type:b.type,onClose:()=>y(null)}),a.jsx(Gee,{isOpen:T,onClose:()=>N(!1),onConfirm:R,title:"Remove All Offline Access",message:`Are you sure you want to remove all offline access for this user?
4413
4414This will:
4415• Remove door PIN code
4416• Clear contract dates
4417• Remove package type
4418• Clear all notes
4419• Clear access log
4420• Disable offline client status
4421
4422This action cannot be undone.`,confirmText:"Remove Access",cancelText:"Cancel",type:"danger"})]}):null}function Xee(){const{users:t,updateUserStatus:e,deleteUser:r}=a6(),[n,s]=P.useState(""),[i,o]=P.useState("all"),[l,c]=P.useState("all"),[u,d]=P.useState(new Set),[h,m]=P.useState(!1),[p,x]=P.useState(!1),[w,g]=P.useState(!1),[v,b]=P.useState(null),[y,T]=P.useState(!1),[N,j]=P.useState(null),[_,S]=P.useState(!1),[k,I]=P.useState(null),E=D=>{if(!D)return"No date";try{return he(et(D),"MMM d, yyyy")}catch{return"Invalid date"}},C=D=>{const z=new Set(u);z.has(D)?z.delete(D):z.add(D),d(z)},R=async D=>{if(window.confirm("Are you sure you want to delete this user? This action cannot be undone.")){m(!0);try{await Rn(Te(oe,"users",D));const z=Be(oe,"bookings"),K=dt(z,ht("userId","==",D)),H=(await Zt(K)).docs.map(ee=>Rn(ee.ref));await Promise.all(H);try{const ee=ii.currentUser;ee&&await o5(ee)}catch(ee){console.error("Error deleting user from Authentication:",ee)}r(D)}catch(z){console.error("Error deleting user:",z),alert("Failed to delete user. Please try again.")}finally{m(!1)}}},W=()=>{const D=V.map(z=>z.email).join(", ");navigator.clipboard.writeText(D).then(()=>{x(!0),setTimeout(()=>x(!1),2e3)}
4422).catch(z=>{console.error("Error copying emails to clipboard:",z),alert("Failed to copy emails to clipboard")})},M=D=>{b(D),g(!0)},L=D=>{j(D),T(!0)},U=D=>{I(D),S(!0)},V=t.filter(D=>{var H,ee,de,we,Le,ze;const z=i==="all"||D.status===i,K=l==="all"||D.accountType===l,q=(((H=D.displayName)==null?void 0:H.toLowerCase())||"").includes(n.toLowerCase())||(((ee=D.email)==null?void 0:ee.toLowerCase())||"").includes(n.toLowerCase())||(((we=(de=D.company)==null?void 0:de.name)==null?void 0:we.toLowerCase())||"").includes(n.toLowerCase())||(((Le=D.firstName)==null?void 0:Le.toLowerCase())||"").includes(n.toLowerCase())||(((ze=D.lastName)==null?void 0:ze.toLowerCase())||"").includes(n.toLowerCase());return z&&K&&q});return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Members"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Manage all user accounts and profiles"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Pm,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),a.jsx("input",{type:"text",placeholder:"Search members...",value:n,onChange:D=>s(D.target.value),className:"pl-10 pr-4 py-2 border rounded-lg text-sm w-full"})]}),a.jsxs("select",{value:l,onChange:D=>c(D.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Types"}),a.jsx("option",{value:"individual",children:"Individual"}),a.jsx("option",{value:"company",children:"Company"})]}),a.jsxs("select",{value:i,onChange:D=>o(D.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Status"}),a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"suspended",children:"Suspended"}),a.jsx("option",{value:"cancelled",children:"Cancelled"})]}),a.jsx("button",{onClick:W,disabled:V.length===0||p,className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50",children:p?a.jsxs(a.Fragment,{children:[a.jsx(Uo,{className:"w-4 h-4 mr-2"}),"Emails Copied!"]}):a.jsxs(a.Fragment,{children:[a.jsx(h3,{className:"w-4 h-4 mr-2"}),"Copy All Emails"]})})]})]})}),a.jsx("div",{className:"divide-y divide-gray-200",children:V.map(D=>{var q,H,ee,de,we,Le,ze,Q,me,ve,Z;const z=u.has(D.id),K=D.accountType==="individual";return a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-4 flex-1",children:[a.jsx("div",{className:"flex-shrink-0 h-12 w-12",children:a.jsx("div",{className:`h-12 w-12 rounded-full flex items-center justify-center ${K?"bg-blue-100":"bg-purple-100"}`,children:K?a.jsx(fn,{className:"w-6 h-6 text-blue-600"}):a.jsx(xn,{className:"w-6 h-6 text-purple-600"})})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:K?D.displayName||`${D.firstName} ${D.lastName}`||"Unknown User":((q=D.company)==null?void 0:q.name)||D.displayName||"Unknown Company"}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${K?"bg-blue-100 text-blue-800":"bg-purple-100 text-purple-800"}`,children:K?"Individual":"Company"})]}),a.jsx("div",{className:"text-sm text-gray-500",children:D.email}),!K&&((H=D.company)==null?void 0:H.position)&&a.jsx("div",{className:"text-xs text-gray-400",children:D.company.position})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("div",{className:"text-right hidden sm:block",children:[a.jsx("div",{className:"text-sm text-gray-900",children:D.subscription||"No subscription"}),a.jsxs("div",{className:"text-xs text-gray-500",children:[D.meetingRoomHours||0,"h / ",D.totalMeetingRoomHours||0,"h meetings"]})]}),a.jsxs("select",{value:D.status,onChange:X=>e(D.id,X.target.value),className:`px-2.5 py-1 rounded-full text-xs font-medium border-0 ${D.status==="active"?"bg-green-100 text-green-800":D.status==="suspended"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800"}`,children:[a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"suspended",children:"Suspended"}),a.jsx("option",{value:"cancelled",children:"Cancelled"})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("button",{onClick:()=>M(D),className:"text-brand-premium hover:text-brand-blue transition-colors p-1",title:"Add Meeting Hours",children:a.jsx(qe,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>U(D),className:`transition-colors p-1 ${D.isOfflineClient?"text-orange-600 hover:text-orange-700":"text-gray-400 hover:text-gray-600"}`,title:"Manage Offline Access",children:a.jsx(xs,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>C(D.id),className:"text-brand-premium hover:text-brand-blue transition-colors p-1",title:"View Details",children:z?a.jsx(fg,{className:"w-5 h-5"}):a.jsx(zo,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>L(D),className:"text-brand-premium hover:text-brand-blue transition-colors",title:"Edit User",children:a.jsx(Nu,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>R(D.id),disabled:h,className:"text-red-500 hover:text-red-600 transition-colors disabled:opacity-50",children:a.jsx(_a,{className:"w-5 h-5"})})]})]})]}),z&&a.jsxs("div",{className:"mt-6 pt-6 border-t border-gray-100",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(Or,{className:"w-4 h-4 mr-2 text-gray-600"}),"Contact Information"]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Email:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.email})]}),D.phone&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Phone:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.phone})]}),D.linkedinProfile&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"LinkedIn:"}),a.jsx("a",{href:D.linkedinProfile,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-brand-premium hover:underline",children:"View Profile"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Join Date:"}),a.jsx("span",{className:"ml-2 font-medium",children:E(D.joinDate)})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:K?a.jsxs(a.Fragment,{children:[a.jsx(fn,{className:"w-4 h-4 mr-2 text-gray-600"}),"Personal Information"]}):a.jsxs(a.Fragment,{children:[a.jsx(xn,{className:"w-4 h-4 mr-2 text-gray-600"}),"Company Information"]})}),a.jsx("div",{className:"space-y-2 text-sm",children:K?a.jsxs(a.Fragment,{children:[D.firstName&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"First Name:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.firstName})]}),D.lastName&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Last Name:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.lastName})]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Company:"}),a.jsx("span",{className:"ml-2 font-medium",children:((ee=D.company)==null?void 0:ee.name)||"Not set"})]}),((de=D.company)==null?void 0:de.type)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Type:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.type})]}),((we=D.company)==null?void 0:we.position)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Position:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.position})]}),((Le=D.company)==null?void 0:Le.industry)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Industry:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.industry})]}),((ze=D.company)==null?void 0:ze.size)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Size:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.size})]}),((Q=D.company)==null?void 0:Q.country)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Country:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.country})]}),((me=D.company)==null?void 0:me.cui)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"CUI:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.company.cui})]}),((ve=D.company)==null?void 0:ve.website)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Website:"}),a.jsx("a",{href:D.company.website,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-brand-premium hover:underline",children:"Visit Website"})]}),((Z=D.company)==null?void 0:Z.linkedinProfile)&&a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"LinkedIn:"}),a.jsx("a",{href:D.company.linkedinProfile,target:"_blank",rel:"noopener noreferrer",className:"ml-2 text-brand-premium hover:underline",children:"Company Page"})]})]})})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(Mt,{className:"w-4 h-4 mr-2 text-gray-600"}),"Subscription & Usage"]}),a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Subscription:"}),a.jsx("span",{className:"ml-2 font-medium",children:D.subscription||"None"})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Status:"}),a.jsx("span",{className:`ml-2 px-2 py-1 rounded-full text-xs font-medium ${D.status==="active"?"bg-green-100 text-green-800":D.status==="suspended"?"bg-yellow-100 text-yellow-800":"bg-red-100 text-red-800"}`,children:D.status.charAt(0).toUpperCase()+D.status.slice(1)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Meeting Room Hours:"}),a.jsxs("div",{className:"mt-1",children:[a.jsxs("div",{className:"flex justify-between text-xs mb-1",children:[a.jsxs("span",{children:["Used: ",D.usedMeetingRoomHours||0,"h"]}),a.jsxs("span",{children:["Remaining: ",D.meetingRoomHours||0,"h"]})]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:"bg-brand-premium h-2 rounded-full",style:{width:D.totalMeetingRoomHours>0?`${(D.usedMeetingRoomHours||0)/D.totalMeetingRoomHours*100}%`:"0%"}})}),a.jsxs("div",{className:"flex justify-between items-center text-xs text-gray-500 mt-1",children:[a.jsxs("span",{children:["Total: ",D.totalMeetingRoomHours||0,"h"]}),a.jsxs("button",{onClick:()=>M(D),className:"flex items-center text-brand-premium hover:text-brand-blue text-xs",children:[a.jsx(Ut,{className:"w-3 h-3 mr-1"}),"Add Hours"]})]})]})]})]})]})]}),D.isOfflineClient&&a.jsx("div",{className:"mt-6 pt-6 border-t border-gray-200",children:a.jsxs("div",{className:"bg-orange-50 border border-orange-200 rounded-lg p-4",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(xs,{className:"w-4 h-4 mr-2 text-orange-600"}
4422),"Offline Access & Contract"]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",children:[D.doorPinCode&&a.jsxs("div",{className:"text-sm",children:[a.jsxs("span",{className:"text-gray-600 flex items-center",children:[a.jsx(xs,{className:"w-3 h-3 mr-1"}),"Door PIN:"]}),a.jsx("span",{className:"ml-2 font-medium font-mono",children:D.doorPinCode})]}),D.contractStartDate&&a.jsxs("div",{className:"text-sm",children:[a.jsxs("span",{className:"text-gray-600 flex items-center",children:[a.jsx(De,{className:"w-3 h-3 mr-1"}),"Contract Start:"]}),a.jsx("span",{className:"ml-2 font-medium",children:E(D.contractStartDate)})]}),D.contractEndDate&&a.jsxs("div",{className:"text-sm",children:[a.jsxs("span",{className:"text-gray-600 flex items-center",children:[a.jsx(De,{className:"w-3 h-3 mr-1"}),"Contract End:"]}),a.jsx("span",{className:"ml-2 font-medium",children:E(D.contractEndDate)})]}),D.packageType&&a.jsxs("div",{className:"text-sm",children:[a.jsxs("span",{className:"text-gray-600 flex items-center",children:[a.jsx(x3,{className:"w-3 h-3 mr-1"}),"Package:"]}),a.jsx("span",{className:"ml-2 font-medium",children:D.packageType})]}),D.paymentMethod&&D.paymentMethod!=="app"&&a.jsxs("div",{className:"text-sm",children:[a.jsxs("span",{className:"text-gray-600 flex items-center",children:[a.jsx(Kn,{className:"w-3 h-3 mr-1"}),"Payment:"]}),a.jsx("span",{className:"ml-2 font-medium capitalize",children:D.paymentMethod.replace("_"," ")})]})]}),D.offlineClientNotes&&a.jsxs("div",{className:"mt-4 pt-4 border-t border-orange-200",children:[a.jsxs("span",{className:"text-gray-600 text-sm flex items-center mb-2",children:[a.jsx(vr,{className:"w-3 h-3 mr-1"}),"Notes:"]}),a.jsx("p",{className:"text-sm text-gray-700 whitespace-pre-wrap",children:D.offlineClientNotes})]})]})})]})]},D.id)})}),V.length===0&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx(Mt,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No users found"}),a.jsx("p",{className:"text-gray-500",children:n||i!=="all"||l!=="all"?"No users match your current filters":"Users will appear here when they sign up"})]}),w&&v&&a.jsx(Hee,{isOpen:w,onClose:()=>{g(!1),b(null)},userId:v.id,userName:v.displayName||v.email,currentHours:v.meetingRoomHours||0}),y&&N&&a.jsx(qee,{isOpen:y,onClose:()=>{T(!1),j(null)},user:N,onUpdate:()=>{window.location.reload()}}),_&&k&&a.jsx(Kee,{isOpen:_,onClose:()=>{S(!1),I(null)},user:k,onUpdate:()=>{window.location.reload()}})]})}function Yee({booking:t,isOpen:e,onClose:r}){const[n,s]=P.useState({contractNumber:`${new Date().getFullYear()}-D`,contractDate:new Date().toISOString().split("T")[0],tenantName:(t==null?void 0:t.userName)||"",tenantHeadquarters:"",tenantStreet:"",tenantRegistrationCode:"",tenantRegistrationNumber:"",tenantIban:"",tenantBic:"",tenantBank:"",tenantEmail:"",tenantPhone:"",tenantRepresentative:"",tenantPosition:"",startDate:(t==null?void 0:t.date)||new Date().toISOString().split("T")[0],endDate:x(t==null?void 0:t.date,t==null?void 0:t.durationInPeriods,t==null?void 0:t.period),durationMonths:w(t==null?void 0:t.durationInPeriods,t==null?void 0:t.period),price:(t==null?void 0:t.price)||0}),[i,o]=P.useState(!1),[l,c]=P.useState(!0),[u,d]=P.useState(!1),[h,m]=P.useState(""),p=P.useRef(null);P.useEffect(()=>{async function N(){var j,_,S,k,I;if(!(t!=null&&t.userId)){c(!1);return}try{const E=await Vh(Te(oe,"users",t.userId));if(E.exists()){const C=E.data();let R={tenantEmail:C.email||"",tenantPhone:C.phone||""};C.accountType==="individual"?R={...R,tenantName:`${C.firstName||""} ${C.lastName||""}`.trim(),tenantRegistrationCode:C.cnp||"",tenantRepresentative:`${C.firstName||""} ${C.lastName||""}`.trim(),tenantPosition:"Individual",tenantHeadquarters:C.city||"",tenantStreet:C.city?`${C.city}, ${C.county||""}`:""}:C.accountType==="company"&&(R={...R,tenantName:((j=C.company)==null?void 0:j.name)||C.displayName||"",tenantRegistrationCode:((_=C.company)==null?void 0:_.cui)||"",tenantRepresentative:C.displayName||"",tenantPosition:((S=C.company)==null?void 0:S.position)||"",tenantHeadquarters:((k=C.company)==null?void 0:k.city)||"",tenantStreet:((I=C.company)==null?void 0:I.address)||""}),s(W=>({...W,...R}))}}catch(E){console.error("Error fetching user data:",E)}finally{c(!1)}}N()},[t==null?void 0:t.userId]);function x(N,j,_){if(!N||!j)return"";const S=new Date(N);if(isNaN(S.getTime()))return"";switch(_){case"day":S.setDate(S.getDate()+j);break;case"week":S.setDate(S.getDate()+j*7);break;case"month":S.setMonth(S.getMonth()+j);break;case"ten-days":S.setDate(S.getDate()+j*10);break;case"half-month":S.setDate(S.getDate()+j*15);break;default:S.setMonth(S.getMonth()+(j||1))}return S.toISOString().split("T")[0]}function w(N,j){if(!N||!j)return 1;switch(j){case"day":return Math.max(1,Math.ceil(N/30));case"week":return Math.max(1,Math.ceil(N*7/30));case"ten-days":return Math.max(1,Math.ceil(N*10/30));case"half-month":return Math.max(1,Math.ceil(N*15/30));case"month":return N;default:return N||1}}const g=N=>{const{name:j,value:_}=N.target;s(S=>({...S,[j]:_})),m("")},v=()=>{const N=["contractNumber","contractDate","tenantName","startDate","endDate","durationMonths","price"];for(const j of N)if(!n[j])return m(`Please fill in all required fields. Missing: ${j.replace(/([A-Z])/g," $1").toLowerCase()}`),!1;return!0},b=()=>
4422{v()&&(o(!0),setTimeout(()=>{d(!0),o(!1)},800))},y=()=>{if(!p.current)return;const N=window.open("","_blank");if(!N)return;const j=p.current.innerHTML,_=`
4423      <!DOCTYPE html>
4424      <html>
4425        <head>
4426          <title>Lease Agreement - ${n.contractNumber}</title>
4427          <style>
4428            body { font-family: Arial, sans-serif; margin: 40px; }
4429            .contract { max-width: 800px; margin: 0 auto; }
4430            table { width: 100%; border-collapse: collapse; }
4431            td { vertical-align: top; padding: 10px; }
4432            h1, h2, h3 { margin-top: 20px; }
4433            .header { text-align: center; margin-bottom: 30px; }
4434            .section { margin-bottom: 20px; }
4435            .signature { margin-top: 40px; }
4436            .footer { margin-top: 60px; text-align: center; }
4437            @media print {
4438              body { margin: 0; }
4439              .no-print { display: none; }
4440              button { display: none; }
4441            }
4442          </style>
4443        </head>
4444        <body>
4445          <div class="contract">
4446            ${j}
4447            <div class="footer">
4448              <p>Xponential Transylvania SRL - Lease Agreement ${n.contractNumber}</p>
4449            </div>
4450          </div>
4451          <script>
4452            window.onload = function() { window.print(); }
4453          <\/script>
4454        </body>
4455      </html>
4456    `;N.document.open(),N.document.write(_),N.document.close()},T=()=>{if(!p.current)return;const N=p.current.innerHTML,j=`
4457      <!DOCTYPE html>
4458      <html>
4459        <head>
4460          <title>Lease Agreement - ${n.contractNumber}</title>
4461          <style>
4462            body { font-family: Arial, sans-serif; margin: 40px; }
4463            .contract { max-width: 800px; margin: 0 auto; }
4464            table { width: 100%; border-collapse: collapse; }
4465            td { vertical-align: top; padding: 10px; }
4466            h1, h2, h3 { margin-top: 20px; }
4467            .header { text-align: center; margin-bottom: 30px; }
4468            .section { margin-bottom: 20px; }
4469            .signature { margin-top: 40px; }
4470            .footer { margin-top: 60px; text-align: center; }
4471            @media print {
4472              body { margin: 0; }
4473              .no-print { display: none; }
4474              button { display: none; }
4475            }
4476          </style>
4477        </head>
4478        <body>
4479          <div class="contract">
4480            ${N}
4481            <div class="footer">
4482              <p>Xponential Transylvania SRL - Lease Agreement ${n.contractNumber}</p>
4483            </div>
4484          </div>
4485        </body>
4486      </html>
4487    `,_=new Blob([j],{type:"text/html"}),S=URL.createObjectURL(_),k=document.createElement("a");k.href=S,k.download=`Lease_Agreement_${n.contractNumber.replace(/\//g,"_")}.pdf`,document.body.appendChild(k),k.click(),document.body.removeChild(k),URL.revokeObjectURL(S)};return e?l?a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50",children:a.jsx("div",{className:"bg-white p-8 rounded-lg shadow-lg",children:a.jsxs("div",{className:"flex items-center justify-center space-x-3",children:[a.jsx(Wo,{className:"w-6 h-6 text-brand-premium animate-spin"}),a.jsx("span",{children:"Loading user data..."})]})})}):a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 overflow-y-auto p-4",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-6xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center z-10",children:[a.jsx("h2",{className:"text-xl font-semibold",children:"Contract Generator"}),a.jsx("button",{onClick:r,className:"text-gray-500 hover:text-gray-700",children:"×"})]}),a.jsx("div",{className:"p-6",children:u?a.jsxs("div",{children:[a.jsxs("div",{className:"flex justify-between mb-6",children:[a.jsxs("div",{className:"flex space-x-4",children:[a.jsxs("button",{onClick:y,className:"flex items-center px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors",children:[a.jsx(y3,{className:"w-4 h-4 mr-2"}),"Print"]}),a.jsxs("button",{onClick:T,className:"flex items-center px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors",children:[a.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Download PDF"]})]}),a.jsxs("div",{className:"flex items-center text-green-600",children:[a.jsx(Uo,{className:"w-5 h-5 mr-2"}),a.jsx("span",{children:"Contract generated successfully"})]})]}),a.jsxs("div",{ref:p,className:"border rounded-lg p-6 bg-white",style:{fontFamily:"Times New Roman, serif"},children:[a.jsxs("div",{style:{display:"flex",justifyContent:"space-between"},children:[a.jsxs("div",{style:{width:"48%",textAlign:"center"},children:[a.jsx("h2",{children:"English/Engleză"}),a.jsx("h3",{children:"Lease Agreement for Dedicated desk"}),a.jsxs("p",{children:["Nr. ",n.contractNumber," / ",n.contractDate.split("-").join(".")]})]}),a.jsxs("div",{style:{width:"48%",textAlign:"center"},children:[a.jsx("h2",{children:"Român/Romanian"}),a.jsx("h3",{children:"Contract de închiriere de spațiu de birou tip Dedicated desk"}),a.jsxs("p",{children:[n.contractNumber," / ",n.contractDate.split("-").join(".")]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("p",{children:"concluded between"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Xponential Transylvania SRL"}),", headquartered in Cluj-Napoca, street Bulevardul 21 Decembrie 1989, nr. 16, județul Cluj [Cluj county], sole registration code: 40158957, registered under no. J12/5109/2018 IBAN: RO80 BTRL RONCRT 0T122BE201, account opened at Banca Transilvania, duly represented by Szőcs Endre as Director, hereinafter referred to as the ",a.jsx("strong",{children:"LANDLORD"})," (Landlord)"]}),a.jsx("p",{children:"and"}),a.jsxs("p",{children:[a.jsx("strong",{children:n.tenantName}),", headquartered in ",n.tenantHeadquarters,", street ",n.tenantStreet,", sole registration code: ",n.tenantRegistrationCode,", registered under no ",n.tenantRegistrationNumber,", bank account number IBAN: ",n.tenantIban,", BIC = ",n.tenantBic,", account opened at ",n.tenantBank,", e-mail: ",n.tenantEmail,", phone number ",n.tenantPhone,", duly represented by ",n.tenantRepresentative,", as ",n.tenantPosition,", hereinafter referred to as the ",a.jsx("strong",{children:"TENANT"})," (Tenant)."]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("p",{children:"încheiat între"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Xponential Transylvania SRL"}),", cu sediul în Cluj-Napoca, strada 21 Decembrie 1989, nr. 16, județul Cluj, cod fiscal: 40158957, CIF RO42147520, Nr. de înmatriculare J12/5109/2018, IBAN: RO80 BTRL RONCRT 0T122BE201, cont deschis la Banca Transilvania, reprezentată de Szőcs Endre în calitate de administrator, ca ",a.jsx("strong",{children:"LOCATOR"})," (în continuare Locatorul)"]}),a.jsx("p",{children:"și"}),a.jsxs("p",{children:[a.jsx("strong",{children:n.tenantName}),", cu sediul în ",n.tenantHeadquarters,", strada ",n.tenantStreet," cod fiscal ",n.tenantRegistrationCode,", numărul contului IBAN: ",n.tenantIban,", BIC = ",n.tenantBic," cont deschis la banca ",n.tenantBank,", adresa de e-mail: ",n.tenantEmail,", tel.: ",n.tenantPhone,", reprezentată de ",n.tenantRepresentative,", în calitate de ",n.tenantPosition,", ca și ",a.jsx("strong",{children:"Locatar"})," (în continuare Locatarul)."]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Definitions"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Workstation within coworking office (common office):"})," it is a workspace (coworking office), where different people (working on different devices, e.g.: laptop) can carry out their work in the same space, but independently."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Coworking service:"}
4487)," it is the office space and the infrastructure of the coworking space, shared with other Tenants."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Common space:"})," it is the space used by tenants free of charge, regardless of the value of the Rent paid."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Workstation:"})," The workstation consists of a table, chair and power supply. The person renting a workstation will carry out his activity at the station in question, during the entire rental period, respectively during the period of validity of the lease. Thus, the person concerned enjoys the possibility of storing his objects at the station in question, and after the end of the operating hours."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Dedicated desk:"})," it is a workspace, which allows the Tenant to store objects, which he must not take home after the end of the reception hours. In the case of renting a dedicated desk, the landlord guarantees the Tenant the possibility of using the same workstation every day."]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Definiții"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Birou tip coworking (birou comun):"})," este un spațiu de lucru (coworking office), unde diferite persoane (care lucrează pe diferite dispozitive, ex.: laptop) își pot desfășura activitatea în același spațiu, dar în mod independent."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Serviciu coworking:"})," este spațiul de birou și infrastructura spațiului de coworking, împărțite cu alți Locatari."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Spațiu comun:"})," este spațiul folosit de Locatari în mod gratuit, indiferent de valoarea Chiriei plătite."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Stație de lucru:"})," Stația de lucru constă din masă, scaun și sursă de alimentare cu energie electrică. Persoana care închiriază o stație de lucru își va desfășura activitatea la stația în cauză, pe durata întregii perioade de închiriere, respectiv pe durata valabilității contractului de închiriere. Astfel, persoana în cauză beneficiază de posibilitatea de a-și depozita obiectele la stația în cauză, și după sfârșitul programului de funcționare."]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Dedicated desk:"})," este un spațiu de lucru, care permite Locatarului depozitarea obiectelor, pe care nu trebuie să le ducă acasă după sfârșitul programului de funcționare. În cazul închirierii unui dedicated desk, Locatorul garantează Locatarului posibilitatea utilizării aceleiași stații de lucru în fiecare zi."]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Object of the Agreement"}),a.jsx("p",{children:'The object of the Agreement is the lease by the Landlord within the Xponential Transylvania office building, located at Cluj-Napoca, str. 21 Decembrie 1989, nr. 16, Cluj county, of the enclosed space mentioned in Annex no. 1 as DEDICATED DESK (hereinafter the "Leased Space"), for the amount defined in Annex no. 1 as Rent.'}),a.jsx("p",{children:"The Landlord offers the Tenant the Leased Space for rent and the Tenant accepts the Leased Space for rent, subject to the following terms and conditions. The parties declare that the subject matter of the Lease has been inspected by the Tenant."}),a.jsx("p",{children:"The Rent shall also include the services referred to in Annex no. 1."}),a.jsx("p",{children:"The Tenant declares that it will use the Leased Premises exclusively for office purposes."}),a.jsx("p",{children:"This Lease Agreement also includes the right to use the Common Premises as detailed in Article 5."}),a.jsx("p",{children:"The parties agree that the Leased Premises does not include parking space, kitchenette, separate toilet facilities."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Obiectul Contractului"}),a.jsx("p",{children:'Obiectul Contractului este închirierea de către Locator în cadrul clădirii de birouri Xponential Transylvania, aflată la adresa: Cluj-Napoca, str. 21 Decembrie 1989, nr. 16. județul Cluj a spațiului închis menționat în Anexa nr. 1 ca stație de lucru sau DEDICATED desk (în continuare „Spațiul închiriat"), pentru suma definită în Anexa nr. 1 ca și Chirie.'}),a.jsx("p",{children:"Locatorul acordă în chirie către Locatar și Locatarul acceptă în chirie Spațiul închiriat, cu aplicarea clauzelor menționate în continuare. Părțile declară faptul că obiectul Contractului de închiriere a fost inspectat de Locatar."}),a.jsx("p",{children:"Chiria include și serviciile menționate în Anexa nr.1."}),a.jsx("p",{children:"Locatarul declară că va folosi Spațiul închiriat exclusiv în scopuri de activități de birou."}),a.jsx("p",{children:"Prezentul Contract de închiriere include și dreptul de utilizare a spațiilor comune, precum este detaliat în Articolul 5 al prezentului Contract."}),a.jsx("p",{children:"Părțile convin faptul că Spațiul închiriat nu include loc de parcare, chicinetă, grup sanitar separat."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Lease Period"}),a.jsx("p",{children:"The lease period is set out in Annex no.1 to this Agreement. The Parties agree that the extension of the Lease Period shall take place on the basis of mutual agreement between the Parties, based on the payment of the value of the one-day ticket/weekly or monthly subscription. For the purpose of preventing any misunderstanding, the Parties agree that the Lessor is not obliged to extend the Agreement."}),a.jsx("p",{children:"In the event that, by 07:00 on the day following the expiry of the Lease Period, the Tenant does not return the Leased Premises in the condition in which it was leased, the Landlord shall be entitled to evict the Tenant, using all applicable legal means."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Perioada de închiriere"}),a.jsx("p",{children:"Perioada de închiriere este menționată în Anexa nr.1 a prezentului Contract. Părțile convin faptul că prelungirea Perioadei de închiriere va avea loc pe bază de comun acord între Părți, în urma achitării contravalorii biletului de o zi/săptămână/lună. În scopul prevenirii oricăror neînțelegeri, Părțile convin faptul că Locatorul nu are obligația de a prelungi Contractul."}),a.jsx("p",{children:"În eventualitatea în care, până la ora 07:00 a zilei următoare expirării Perioadei de închiriere Locatarul nu returnează Spațiul închiriat în starea în care a fost închiriat, Locatorul este îndreptățit la evacuarea Locatarului, cu folosirea tuturor mijloacelor legale aplicabile."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Lease Amount"}),a.jsx("p",{children:"The amount of the Lease is set out in Annex no.1 to this Agreement."}),a.jsx("p",{children:"The Landlord is not VAT payer. If the Landlord becomes liable to pay VAT, the amount of VAT shall be added to the above amount."}),a.jsx("p",{children:"In the event of late payment, the Tenant shall be obliged to pay interest to the Landlord for late payment from the first day of delay. The amount of late payment interest shall be 0.2%/day of the Rent."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Valoarea Chiriei"}),a.jsx("p",{children:"Valoarea Chiriei este menționată în Anexa nr.1 a prezentului Contract."}),a.jsx("p",{children:"Locatorul nu este plătitor de TVA. În cazul în care Locatorul devine plătitor de TVA, la suma menționată mai sus va fi adăugată valoarea TVA."}),a.jsx("p",{children:"În caz de întârziere de plată, Locatarul are obligația de a plăti Locatorului o dobândă de întârziere, începând cu prima zi de întârziere. Valoarea dobânzii de întârziere este de 0,2%/zi de întârziere din valoarea Chiriei."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Indexation"}),a.jsx("p",{children:'The Rent, due by the Tenant under this Agreement are subject to annual increases as of 1st January of each year with the index adjustment, based on the notice by the Landlord. The first indexation shall occur on 1st January 2023 ("Review Date"), whereas the following indexations shall be applied upon anniversary of each year from the Review Date.'}),a.jsx("p",{children:"The index adjustment shall be added to the Rent and the amount resulted shall become the new Rent, that will be applicable for a period of 1 year until the subsequent index adjustment. Such adjustment shall not result in lower amounts of Rent than those for the preceding year."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Indexarea Chiriei"}),a.jsx("p",{children:'Chiria va fi indexată anual la data de 1 ianuarie prin aplicarea Indicelui de Inflație, pe baza notificării Locatorului. Prima indexare va avea loc la data de 1 ianuarie 2023 ("Data de Indexare"), urmând ca indexările ulterioare să aibă loc anual, la aniversarea Datei de Indexare.'}),a.jsx("p",{children:"Valoarea indexată va fi adăugată la Chirie și suma astfel rezultate va deveni noua Chirie aplicabilă pentru o perioadă de 1 an de la Data Indexării, până la următoarea Indexare. Indexarea nu va putea avea ca rezultat scăderea valorii Chiriei comparativ cu valorile aplicabile în anul precedent."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Obligations of the Landlord"}),a.jsx("p",{children:"The Landlord warrants that during the Lease Period the Leased Premises may be used in accordance with the provisions of the Agreement and shall not be subject to any rights of a third party which w
4487ould obstruct or restrict the Tenant in the exclusive and undisturbed conduct of its business."}),a.jsx("p",{children:'The Landlord shall be responsible for ensuring that the offices are in good working order and that all Tenants comply with the posted "Internal Rules of Operation".'}),a.jsx("p",{children:"The carrying out of renovation and alteration works shall be the obligation of the Landlord, unless the damage or deterioration has arisen due to the Tenant's improper use or misuse of the Facilities in accordance with the Agreement."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Obligațiile Locatorului"}),a.jsx("p",{children:"Locatorul garantează faptul că pe durata Perioadei de închiriere, Spațiul închiriat poate fi utilizat conform prevederilor contractuale, neconstituind obiectul niciunui drept din partea unei terțe entități, care ar obstrucționa sau limita Locatarul în desfășurarea exclusivă și neperturbată a activităților sale."}),a.jsx("p",{children:'Locatorul are obligația de a se asigura de buna funcționare a birourilor și de faptul că toți Locatarii respectă „Regulamentul intern de funcționare" afișat.'}),a.jsx("p",{children:"Efectuarea lucrărilor de renovare și de modificare constituie obligația Locatorului, cu excepția cazului în care pagubele și deteriorările au survenit din cauza utilizării neconforme cu Contractul sau necorespunzătoare a facilităților de către Locatar."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Obligations of the Tenant"}),a.jsx("p",{children:"The Tenant shall be obliged to use the Leased Premises referred to in Article 1.4 in accordance with the purpose of use and to use its facilities with care."}),a.jsx("p",{children:"The Landlord shall be entitled to check the proper use without unnecessary disturbance to the Tenant."}),a.jsx("p",{children:"The Tenant is prohibited from subletting, lending or using the Leased Premises to third parties without the written consent of the Landlord."}),a.jsx("p",{children:"Tenant shall be liable for any damage resulting from the improper use of the Leased Premises."})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Obligațiile Locatarului"}),a.jsx("p",{children:"Locatarul are obligația de a folosi conform scopului de utilizare Spațiul închiriat menționat în Articolul 1.4., utilizând cu grijă și dotările acestuia."}),a.jsx("p",{children:"Locatorul este îndreptățit la verificarea utilizării corespunzătoare, fără deranjarea inutilă a Locatarului."}),a.jsx("p",{children:"Locatarului sunt interzise subînchirierea, darea în comodat sau în utilizare a Spațiului închiriat către terțe entități."}),a.jsx("p",{children:"Locatarul este responsabil pentru orice pagubă survenită în urma utilizării necorespunzătoare sau neconforme cu prezentul Contract a Spațiului închiriat."})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Contact Details of the Contracting Parties"}),a.jsxs("p",{children:[a.jsx("strong",{children:"On behalf of the Landlord:"}),a.jsx("br",{}),"Name: Fodor Attila",a.jsx("br",{}),"Email address: [email protected]",a.jsx("br",{}),"Postal code: Cluj-Napoca, B-dul. 21 Decembrie 1989, nr. 16",a.jsx("br",{}),"Phone: +40 722 300566"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"On behalf of the Tenant:"}),a.jsx("br",{}),"Name: ",n.tenantRepresentative,a.jsx("br",{}),"Email address: ",n.tenantEmail,a.jsx("br",{}),"Postal code: ",n.tenantHeadquarters,a.jsx("br",{}),"Phone: ",n.tenantPhone]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Datele de contact ale Părților contractuale"}),a.jsxs("p",{children:[a.jsx("strong",{children:"Din partea Locatorului:"}),a.jsx("br",{}),"Numele: Fodor Attila",a.jsx("br",{}),"Adresa de e-mail: [email protected]",a.jsx("br",{}),"Adresa poștală: Cluj-Napoca, B-dul. 21 Decembrie 1989, nr. 16",a.jsx("br",{}),"Telefon: +40 722 300566"]}),a.jsxs("p",{children:[a.jsx("strong",{children:"Din partea Locatarului:"}),a.jsx("br",{}),"Numele: ",n.tenantRepresentative,a.jsx("br",{}),"Adresa de e-mail: ",n.tenantEmail,a.jsx("br",{}),"Adresa poștală: ",n.tenantHeadquarters,a.jsx("br",{}),"Telefon: ",n.tenantPhone]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Termination of the Agreement"}),a.jsx("p",{children:"The Landlord shall be entitled to terminate this Agreement in the following cases:"}),a.jsxs("ul",{children:[a.jsx("li",{children:"The Tenant violates the provisions of the Agreement so seriously that the continuation of the Agreement becomes impossible (e.g. damage to the objects owned by the Landlord or another person, theft, use of the Leased Space under the influence of alcohol or other intoxicating substances); or"}),a.jsx("li",{children:"The Leased Premises is misused by the Tenant or by persons acting on behalf of the Tenant, and if such persons or the Tenant exhibits the same behavior, contrary to the oral notice given by the Landlord; or"}),a.jsx("li",{children:"The Tenant intentionally causes damage to or pollution of the Leased Premises' facilities and does not cease such conduct contrary to the Landlord's oral notice; or"}),a.jsx("li",{children:"The Tenant is in default of payment, has filed for insolvency proceedings or is subject to insolvency proceedings at the request of a third party."})]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Încetarea Contractului"}),a.jsx("p",{children:"Locatorul este îndreptățit la denunțarea specială a prezentului Contract în următoarele cazuri:"}),a.jsxs("ul",{children:[a.jsx("li",{children:"Locatarul încalcă prevederile Contractuale într-un mod atât de grav, încât continuarea derulării Contractului devine imposibilă (de ex. deteriorarea obiectelor proprietatea Locatorului sau a altei persoane, furt, folosirea Spațiului închiriat sub influența alcoolului sau a altor substanțe de influențare a conștiinței); sau"}),a.jsx("li",{children:"Spațiul închiriat este utilizat în mod necorespunzător de către Locatar sau de către persoanele care acționează în interesul Locatarului, și dacă aceste persoane sau Locatarul prezintă același comportament, contrar somației verbale comunicată de Locator; sau"}
4487),a.jsx("li",{children:"Locatarul cauzează în mod intenționat deteriorarea sau poluarea dotărilor Spațiului închiriat și nu încetează acest comportament, contrar somației verbale comunicată de Locator; sau"}),a.jsx("li",{children:"Locatarul se află în incapacitate de plată, a solicitat declanșarea procedurii de insolvență sau este supus procedurii de insolvență la solicitarea unei terțe părți."})]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"30px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Other Provisions"}),a.jsx("p",{children:"Amendments to this Agreement may only be made in writing. The Parties agree that in the event of changes in the company or contact details, this does not imply a change in the Agreement, and that it is sufficient to send a written notice to the other Party to communicate such changes."}),a.jsx("p",{children:"The Parties agree to settle disputes arising in connection with this Agreement, including disputes concerning the duration, interpretation, implementation or termination of this Agreement, by negotiation. If settlement of disputes in this way is not possible, the Parties agree to appeal to the competent courts in Cluj-Napoca."}),a.jsx("p",{children:"In the case of matters not regulated by this Agreement and its annexes, the provisions of the Romanian Civil Code shall be applicable."}),a.jsx("p",{children:"By signing this Agreement and its annexes, the Parties certify that they fully correspond to their will."}),a.jsxs("p",{children:["This Agreement was concluded today, on ",n.contractDate.split("-").join(".")," in 2 original copies."]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Alte prevederi"}),a.jsx("p",{children:"Modificarea prezentului Contract este posibilă doar în formă scrisă. Părțile convin faptul că în cazul în care survin modificări în datele de firmă sau în datele de contact, acest fapt nu implică modificarea Contractului, pentru comunicarea unor astfel de modificări fiind suficientă trimiterea unei notificări scrise către cealaltă Parte."}),a.jsx("p",{children:"Părțile convin soluționarea prin negocieri a litigiilor survenite în legătură cu prezentul Contract, inclusiv litigiile privind durata, interpretarea, implementarea sau desfacerea prezentului Contract. Dacă soluționarea litigiilor în acest fel nu este posibilă, Părțile convin apelarea la instanțele de judecată competente din Cluj-Napoca."}),a.jsx("p",{children:"În cazul aspectelor nereglementate prin prezentul Contract și prin anexele acestuia, sunt aplicabile prevederile Codului Civil Român."}),a.jsx("p",{children:"Prin semnarea prezentului Contract și al anexelor acestuia, Părțile certifică faptul că acestea corespund în totalitate voințelor lor."}),a.jsxs("p",{children:["Prezentul Contract a fost încheiat azi, în data de ",n.contractDate.split("-").join(".")," în doua copii originale."]})]})]}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"60px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Landlord:"}),a.jsx("br",{}),"Xponential Transylvania SRL",a.jsx("br",{}),"_________________",a.jsx("br",{}),"represented by Szőcs Endre"]}),a.jsx("br",{}),a.jsx("br",{}),a.jsx("br",{}),a.jsxs("p",{children:[a.jsx("strong",{children:"Tenant:"}),a.jsx("br",{}),n.tenantName,a.jsx("br",{}),"_________________",a.jsx("br",{}),"represented by ",n.tenantRepresentative]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Locator:"}),a.jsx("br",{}),"Xponential Transylvania SRL",a.jsx("br",{}),"_________________",a.jsx("br",{}),"reprezentat prin Szőcs Endre"]}),a.jsx("br",{}),a.jsx("br",{}),a.jsx("br",{}),a.jsxs("p",{children:[a.jsx("strong",{children:"Locatar:"}),a.jsx("br",{}),n.tenantName,a.jsx("br",{}),"_________________",a.jsx("br",{}),"reprezentat prin ",n.tenantRepresentative]})]})]}),a.jsxs("div",{style:{textAlign:"center",marginTop:"60px"},children:[a.jsx("h2",{children:"Annex no. 1 / Anexa nr. 1"}),a.jsxs("div",{style:{display:"flex",justifyContent:"space-between",marginTop:"20px"},children:[a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Lease Agreement for Dedicated desk"}),a.jsxs("p",{children:["Nr. ",n.contractNumber," / ",n.contractDate.split("-").join(".")]}),a.jsxs("div",{style:{marginTop:"30px"},children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Subject of the Agreement:"})," The landlord rents to the Tenant a workstation or dedicated desk with access to common areas (kitchen, toilet, meeting room, etc.)."]}),a.jsxs("p",{style:{marginTop:"20px"}
4487,children:[a.jsx("strong",{children:"Contractual period:"})," ",n.durationMonths," months, i.e. from ",n.startDate.split("-").join(".")," - ",n.endDate.split("-").join(".")," the parties can extend the contract period by agreement."]}),a.jsxs("p",{style:{marginTop:"20px"},children:[a.jsx("strong",{children:"Price and payment terms"}),a.jsx("br",{}),"The amount of the agreement is EUR ",n.price,"/month. Payment shall be made in RON at the BNR exchange rate valid on the date of invoicing. The payment deadline is 15 days from the date of issue of the invoice."]}),a.jsxs("p",{style:{marginTop:"40px"},children:[a.jsx("strong",{children:"Landlord:"}),a.jsx("br",{}),"Xponential Transylvania SRL",a.jsx("br",{}),"_________________",a.jsx("br",{}),"represented by Szőcs Endre"]}),a.jsxs("p",{style:{marginTop:"40px"},children:[a.jsx("strong",{children:"Tenant:"}),a.jsx("br",{}),n.tenantName,a.jsx("br",{}),"_________________",a.jsx("br",{}),"represented by ",n.tenantRepresentative]})]})]}),a.jsxs("div",{style:{width:"48%"},children:[a.jsx("h3",{children:"Contract de închiriere de birou tip Dedicated desk"}),a.jsxs("p",{children:["Nr. ",n.contractNumber," / ",n.contractDate.split("-").join(".")]}),a.jsxs("div",{style:{marginTop:"30px"},children:[a.jsxs("p",{children:[a.jsx("strong",{children:"Obiectul Contractului:"}),' Locatorul închiriază Locatarului stație de lucru sau dedicated desk (în continuare „Spațiul închiriat") cu acces în spațiile comune (bucătărie, toaletă, meeting room etc.).']}),a.jsxs("p",{style:{marginTop:"20px"},children:[a.jsx("strong",{children:"Perioada contractuală:"})," ",n.durationMonths," luni, adică din ",n.startDate.split("-").join(".")," – ",n.endDate.split("-").join("."),". Părțile pot prelungi perioada contractului prin înțelegere."]}),a.jsxs("p",{style:{marginTop:"20px"},children:[a.jsx("strong",{children:"Prețul și modalități de plată"}),a.jsx("br",{}),"Valoarea contractului este ",n.price," EUR/luna. Plata se face în lei la cursul BNR valabil la data facturării. Termenul de plată este de 15 zile de la data emiterii facturii."]}),a.jsxs("p",{style:{marginTop:"40px"},children:[a.jsx("strong",{children:"Locator:"}),a.jsx("br",{}),"Xponential Transylvania SRL",a.jsx("br",{}),"_________________",a.jsx("br",{}),"reprezentat prin Szőcs Endre"]}),a.jsxs("p",{style:{marginTop:"40px"},children:[a.jsx("strong",{children:"Locatar:"}),a.jsx("br",{}),n.tenantName,a.jsx("br",{}),"_________________",a.jsx("br",{}),"reprezentat prin ",n.tenantRepresentative]})]})]})]})]})]}),a.jsx("div",{className:"flex justify-between mt-6",children:a.jsx("button",{onClick:r,className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg",children:"Close"})})]}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6",children:[a.jsx("h3",{className:"font-medium text-yellow-800 mb-2",children:"Contract Information"}),a.jsx("p",{className:"text-yellow-700 text-sm",children:"Fill in the tenant details to generate a bilingual contract for the booking."})]}),h&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4 mb-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-2 mt-0.5"}),a.jsx("p",{className:"text-red-700",children:h})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Contract Number *"}),a.jsx("input",{type:"text",name:"contractNumber",value:n.contractNumber,onChange:g,className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Contract Date *"}),a.jsx("input",{type:"date",name:"contractDate",value:n.contractDate,onChange:g,className:"w-full p-2 border rounded-lg",required:!0})]})]}),a.jsx("h3",{className:"font-semibold text-lg border-b pb-2 mt-6",children:"Tenant Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Company/Tenant Name *"}),a.jsx("input",{type:"text",name:"tenantName",value:n.tenantName,onChange:g,className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Headquarters Location"}),a.jsx("input",{type:"text",name:"tenantHeadquarters",value:n.tenantHeadquarters,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Street Address"}),a.jsx("input",{type:"text",name:"tenantStreet",value:n.tenantStreet,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Registration Code (CUI/CNP)"}),a.jsx("input",{type:"text",name:"tenantRegistrationCode",value:n.tenantRegistrationCode,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Registration Number"}),a.jsx("input",{type:"text",name:"tenantRegistrationNumber",value:n.tenantRegistrationNumber,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Bank Account (IBAN)"}),a.jsx("input",{type:"text",name:"tenantIban",value:n.tenantIban,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"BIC/SWIFT Code"}),a.jsx("input",{type:"text",name:"tenantBic",value:n.tenantBic,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Bank Name"}),a.jsx("input",{type:"text",name:"tenantBank",value:n.tenantBank,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Email"}),a.jsx("input",{type:"email",name:"tenantEmail",value:n.tenantEmail,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Phone Number"}),a.jsx("input",{type:"text",name:"tenantPhone",value:n.tenantPhone,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Representative Name"}),a.jsx("input",{type:"text",name:"tenantRepresentative",value:n.tenantRepresentative,onChange:g,className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Representative Position"}),a.jsx("input",{type:"text",name:"tenantPosition",value:n.tenantPosition,onChange:g,className:"w-full p-2 border rounded-lg"})]})]}),a.jsx("h3",{className:"font-semibold text-lg border-b pb-2 mt-6",children:"Lease Details"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Start Date *"}),a.jsx("input",{type:"date",name:"startDate",value:n.startDate,onChange:g,className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End Date *"}),a.jsx("input",{type:"date",name:"endDate",value:n.endDate,onChange:g,className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Duration (Months) *"}),a.jsx("input",{type:"number",name:"durationMonths",value:n.durationMonths,onChange:g,className:"w-full p-2 border rounded-lg",min:"1",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Monthly Price (EUR) *"}),a.jsx("input",{type:"number",name:"price",value:n.price,onChange:g,className:"w-full p-2 border rounded-lg",min:"0",step:"0.01",required:!0})]})]}),a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4 mt-4",children:[a.jsx("h3",{className:"font-medium text-blue-800 mb-2",children:"Booking Details"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Space:"}),a.jsx("div",{className:"text-blue-800",children:t.spaceName})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Period:"}),a.jsxs("div",{className:"text-blue-800",children:[t.durationInPeriods," ",t.period,t.durationInPeriods>1?"s":""]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Access:"}),a.jsx("div",{className:"text-blue-800",children:t.accessHours})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Meeting Room Hours:"}),a.jsxs("div",{className:"text-blue-800",children:[t.meetingRoomHours||0," hours per ",t.period]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Start Date:"}
4487),a.jsx("div",{className:"text-blue-800",children:he(new Date(t.date),"MMM d, yyyy")})]}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-blue-700",children:"Payment Type:"}),a.jsx("div",{className:"text-blue-800",children:t.paymentType==="subscription"?"Subscription":"One-time Payment"})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 mt-8",children:[a.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg",children:"Cancel"}),a.jsx("button",{type:"button",onClick:b,className:"px-4 py-2 bg-brand-premium text-white rounded-lg flex items-center",disabled:i,children:i?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Generating..."]}):a.jsxs(a.Fragment,{children:[a.jsx(vr,{className:"w-4 h-4 mr-2"}),"Generate Contract"]})})]})]})})]})}):null}function Qee(){const{bookings:t,updateBookingStatus:e,deleteBooking:r}=U2(),{user:n}=br(),[s,i]=P.useState(""),[o,l]=P.useState("all"),[c,u]=P.useState("all"),[d,h]=P.useState("all"),[m,p]=P.useState({}),[x,w]=P.useState({}),[g,v]=P.useState(!1),[b,y]=P.useState(null),[T,N]=P.useState(null),[j,_]=P.useState(!1),[S,k]=P.useState(!1),[I,E]=P.useState(null),[C,R]=P.useState(!1),[W,M]=P.useState(""),[L,U]=P.useState(""),[V,D]=P.useState(""),z=async B=>{if(window.confirm("Are you sure you want to delete this booking?"))try{await r(B)}catch{alert("Failed to delete booking")}},K=B=>{N(B),_(!0)},q=B=>B.includes("24/7")||B.includes("24-7")?"24/7 Access":B.includes("8:00-17:00")||B.includes("business")?"Business Hours":B.includes("extended")||B.includes("7:00-22:00")?"Extended Hours":"Limited Access",H=B=>B.paymentType==="subscription"?"🔄 Subscription":B.paymentType==="meeting_room_hours"?"⏰ Meeting Hours":"💳 One-time",ee=B=>{if(B.type==="room"){const re=B.startTime||"",ae=B.endTime||"";if(re&&ae){const pe=new Date(`2000-01-01T${re}`);return`${(new Date(`2000-01-01T${ae}`).getTime()-pe.getTime())/(1e3*60*60)}h (${re}-${ae})`}return`${re}-${ae}`}else{const re=B.durationInPeriods||1,ae=B.period||"day";return`${re} ${ae}${re>1?"s":""}`}},de=B=>{if(B.type==="room")return new Date(B.date);if(!B.date)return new Date;try{const re=et(B.date),ae=B.durationInPeriods||1,pe=B.period||"day";let Ne;switch(pe){case"day":Ne=Rt(re,ae);break;case"week":Ne=Mg(re,ae);break;case"month":Ne=nl(re,ae);break;case"ten-days":Ne=Rt(re,ae*10);break;case"half-month":Ne=Rt(re,ae*15);break;default:Ne=Rt(re,ae)}return Ne}catch(re){return console.error("Error calculating expiration date:",re,B),new Date}},we=B=>{try{const re=et(B.date);return Pi(re,new Date)}catch(re){return console.error("Error checking if booking is future:",re,B),!1}},Le=B=>{if(B.status==="refunded"||B.refunded)return{status:"refunded",label:"Refunded",color:"bg-purple-100 text-purple-800 border-purple-200",icon:Si,daysText:B.refundedAt?`Refunded on ${he(B.refundedAt.toDate(),"MMM d, yyyy")}`:"Refunded"};if(we(B))return{status:"future",label:"Future Booking",color:"bg-blue-100 text-blue-800 border-blue-200",icon:_i,daysText:`Starts on ${he(et(B.date),"MMM d, yyyy")}`};const re=de(B),pe=DM(re,new Date);return pe<0?{status:"expired",label:"Expired",color:"bg-red-100 text-red-800 border-red-200",icon:ka,daysText:`Expired ${Math.abs(pe)} days ago`}:pe===0?{status:"expires-today",label:"Expires Today",color:"bg-red-100 text-red-800 border-red-200",icon:ka,daysText:"Expires today"}:pe<=7?{status:"expires-soon",label:"Expires Soon",color:"bg-yellow-100 text-yellow-800 border-yellow-200",icon:ka,daysText:`${pe} days remaining`}:pe<=30?{status:"expires-month",label:"Active",color:"bg-blue-100 text-blue-800 border-blue-200",icon:qr,daysText:`${pe} days remaining`}:{status:"active",label:"Active",color:"bg-green-100 text-green-800 border-green-200",icon:qr,daysText:`${pe} days remaining`}},ze=async B=>{const re=m[B];if(!/^\d{6}$/.test(re)){alert("PIN must be exactly 6 digits");return}try{const ae=Te(oe,"bookings",B);await Je(ae,{accessPin:re}),w(pe=>({...pe,[B]:!1})),alert(`Access PIN saved: ${re}`)}catch(ae){console.error("Error saving access PIN:",ae),alert("Failed to save access PIN")}},Q=(B,re)=>{p(re?ae=>({...ae,[B]:re}):ae=>({...ae,[B]:""})),w(ae=>({...ae,[B]:!ae[B]}))},me=B=>{y(B),v(!0)},ve=B=>{B.status==="confirmed"&&B.stripeSessionId||B.paymentType==="meeting_room_hours"&&B.status==="confirmed"?(E(B),R(!0),U(""),D(""),M("")):alert("Only confirmed bookings with payments can be refunded.")},Z=async()=>
4487{if(I){if(!W.trim()){U("Please provide a reason for the refund");return}k(!0),U("");try{const B=await fetch("/.netlify/functions/refundBookingPayment",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${await(n==null?void 0:n.getIdToken())}`},body:JSON.stringify({bookingId:I.id,reason:W})}),re=await B.json();if(!B.ok)throw new Error(re.error||"Failed to process refund");console.log("Refund processed successfully:",re),D(re.message||"Refund processed successfully"),setTimeout(()=>{R(!1),E(null)},3e3)}catch(B){console.error("Error processing refund:",B),U(B.message||"Failed to process refund")}finally{k(!1)}}},X=B=>B.status==="confirmed"&&!B.refunded&&(B.stripeSessionId||B.paymentType==="meeting_room_hours"),ue=async(B,re)=>{const ae=B.status;if((re==="cancelled"||re==="refunded")&&(ae==="confirmed"||ae==="pending")&&B.paymentType==="meeting_room_hours"&&B.hoursUsed>0){if(!window.confirm(`This will return ${B.hoursUsed} meeting room hour(s) to the user. Continue?`))return;try{const Pe=Te(oe,"users",B.userId),Fe=await Vh(Pe);
4487if(Fe.exists()){const Ye=Fe.data(),jt=Ye.meetingRoomHours||0,it=Ye.usedMeetingRoomHours||0;await Je(Pe,{meetingRoomHours:jt+B.hoursUsed,usedMeetingRoomHours:Math.max(0,it-B.hoursUsed)})}}catch(Pe){console.error("Error returning hours:",Pe),alert("Failed to return meeting room hours to user")}}await e(B.id,re)},ye=t.filter(B=>{var Fe,Ye;const re=o==="all"||B.type===o,ae=c==="all"||B.status===c,pe=Le(B);let Ne=d==="all";d==="expired"?Ne=pe.status==="expired"||pe.status==="expires-today":d==="expires-soon"?Ne=pe.status==="expires-soon":d==="expires-month"?Ne=pe.status==="expires-month":d==="active"?Ne=pe.status==="active":d==="future"&&(Ne=pe.status==="future");const Pe=((Fe=B.userName)==null?void 0:Fe.toLowerCase().includes(s.toLowerCase()))||((Ye=B.spaceName)==null?void 0:Ye.toLowerCase().includes(s.toLowerCase()));return re&&ae&&Ne&&Pe});return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Bookings Management"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Manage all bookings and track expiration dates"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Pm,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),a.jsx("input",{type:"text",placeholder:"Search bookings...",value:s,onChange:B=>i(B.target.value),className:"pl-10 pr-4 py-2 border rounded-lg text-sm w-full"})]}),a.jsxs("select",{value:o,onChange:B=>l(B.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Types"}),a.jsx("option",{value:"space",children:"Spaces"}),a.jsx("option",{value:"room",children:"Meeting Rooms"})]}),a.jsxs("select",{value:c,onChange:B=>u(B.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Status"}),a.jsx("option",{value:"confirmed",children:"Confirmed"}),a.jsx("option",{value:"pending",children:"Pending"}),a.jsx("option",{value:"cancelled",children:"Cancelled"}),a.jsx("option",{value:"refunded",children:"Refunded"})]}),a.jsxs("select",{value:d,onChange:B=>h(B.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Bookings"}),a.jsx("option",{value:"future",children:"Future Bookings"}),a.jsx("option",{value:"expired",children:"Expired / Expires Today"}),a.jsx("option",{value:"expires-soon",children:"Expires Within 7 Days"}),a.jsx("option",{value:"expires-month",children:"Expires Within 30 Days"}),a.jsx("option",{value:"active",children:"Active (30+ Days)"})]})]})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsx("div",{className:"grid gap-4 p-6",children:ye.map(B=>{const re=Le(B),ae=de(B),pe=re.icon,Ne=we(B);return a.jsxs("div",{className:"border border-gray-200 rounded-xl p-6 hover:shadow-md transition-shadow",children:[a.jsxs("div",{className:"flex items-start justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"w-12 h-12 bg-brand-premium/10 rounded-xl flex items-center justify-center",children:B.type==="room"?a.jsx(De,{className:"w-6 h-6 text-brand-premium"}):a.jsx(xn,{className:"w-6 h-6 text-brand-premium"})}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-lg",children:B.spaceName}),a.jsxs("p",{className:"text-sm text-gray-600",children:[B.type==="space"?"Workspace":"Meeting Room"," • ",B.userName]})]})]}),a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("div",{className:"text-right",children:a.jsx("div",{className:"text-lg font-bold text-brand-premium",children:B.paymentType==="meeting_room_hours"?`${B.hoursUsed||0}h`:`RON ${B.price}`})}),a.jsxs("select",{value:B.status,onChange:Pe=>ue(B,Pe.target.value),className:`px-3 py-1 rounded-full text-xs font-medium border-0 ${B.status==="confirmed"?"bg-green-100 text-green-800":B.status==="pending"?"bg-yellow-100 text-yellow-800":B.status==="refunded"?"bg-purple-100 text-purple-800":"bg-red-100 text-red-800"}`,children:[a.jsx("option",{value:"confirmed",children:"Confirmed"}),a.jsx("option",{value:"pending",children:"Pending"}),a.jsx("option",{value:"cancelled",children:"Cancelled"}),a.jsx("option",{value:"refunded",children:"Refunded"})]})]})]}),a.jsx("div",{className:`mb-4 p-3 rounded-lg border ${re.color}`,children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(pe,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"font-medium text-sm",children:re.label})]}),a.jsx("div",{className:"text-right",children:Ne?a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm font-medium",children:["Start Date: ",he(et(B.date),"MMM d, yyyy")]}),a.jsxs("p",{className:"text-sm",children:["Expires: ",he(ae,"MMM d, yyyy")]})]}):a.jsxs(a.Fragment,{children:[a.jsxs("p",{className:"text-sm font-medium",children:["Expires: ",he(ae,"MMM d, yyyy")]}),a.jsx("p",{className:"text-xs",children:re.daysText})]})})]})}),B.refunded&&a.jsx("div",{className:"mb-4 p-3 rounded-lg border border-purple-200 bg-purple-50 text-purple-800",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(Si,{className:"w-4 h-4 mr-2 text-purple-600"}),a.jsx("span",{className:"font-medium text-sm",children:"Refunded"})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("p",{className:"text-sm font-medium",children:B.refundAmount?`RON ${B.refundAmount}`:"Full Refund"}),a.jsx("p",{className:"text-xs",children:B.refundedAt?he(B.refundedAt.toDate(),"MMM d, yyyy"):"Date unavailable"})]})]})}),B.type==="space"&&a.jsx("div",{className:"mb-4 p-3 rounded-lg border border-brand-premium/20 bg-brand-premium/5",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(xs,{className:"w-4 h-4 mr-2 text-brand-premium"}),a.jsx("span",{className:"font-medium text-sm text-brand-premium",children:"Access PIN"})]}),x[B.id]?a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"text",value:m[B.id]||"",onChange:Pe=>p({...m,[B.id]:Pe.target.value}),placeholder:"Enter 6-digit PIN",className:"w-32 px-3 py-1 border rounded-lg text-sm",maxLength:6,pattern:"\\d{6}"}),a.jsx("button",{onClick:()=>ze(B.id),className:"bg-brand-premium text-white px-3 py-1 rounded-lg text-xs hover:bg-opacity-90 transition-colors",children:"Save"}),a.jsx("button",{onClick:()=>w({...x,[B.id]:!1}),className:"bg-gray-200 text-gray-700 px-3 py-1 rounded-lg text-xs hover:bg-gray-300 transition-colors",children:"Cancel"})]}):a.jsxs("div",{className:"flex items-center space-x-2",children:[B.accessPin?a.jsx("div",{className:"bg-brand-premium text-white px-3 py-1 rounded-lg font-mono text-sm",children:B.accessPin}):a.jsx("div",{className:"text-gray-500 text-sm",children:"No PIN assigned"}),a.jsx("button",{onClick:()=>Q(B.id,B.accessPin),className:"bg-brand-premium text-white px-3 py-1 rounded-lg text-xs hover:bg-opacity-90 transition-colors flex items-center",children:B.accessPin?a.jsxs(a.Fragment,{children:[a.jsx(Kn,{className:"w-3 h-3 mr-1"}),"Edit PIN"]}):a.jsxs(a.Fragment,{children:[a.jsx(Ut,{className:"w-3 h-3 mr-1"}),"Add PIN"]})})]})]})}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center text-gray-600 mb-1",children:[a.jsx(De,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-xs font-medium",children:"START DATE"})]}),a.jsx("p",{className:"font-medium",children:he(et(B.date),"MMM d, yyyy")}),a.jsx("p",{className:"text-xs text-gray-500",children:he(et(B.date),"EEEE")})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center text-gray-600 mb-1",children:[a.jsx(qe,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-xs font-medium",children:"DURATION"})]}
4487),a.jsx("p",{className:"font-medium",children:ee(B)}),a.jsx("p",{className:"text-xs text-gray-500",children:H(B)})]}),B.type==="room"&&a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center text-gray-600 mb-1",children:[a.jsx(Mt,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-xs font-medium",children:"PEOPLE"})]}),a.jsxs("p",{className:"font-medium",children:[B.numberOfPeople," people"]}),a.jsx("p",{className:"text-xs text-gray-500",children:"Capacity used"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3",children:[a.jsxs("div",{className:"flex items-center text-gray-600 mb-1",children:[a.jsx(ja,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-xs font-medium",children:"ACCESS"})]}),a.jsx("p",{className:"font-medium text-xs",children:q(B.accessHours||"8:00-17:00")}),a.jsx("p",{className:"text-xs text-gray-500",children:B.accessHours||"8:00-17:00 on weekdays"})]})]}),a.jsx("div",{className:"border-t pt-4",children:a.jsx("div",{className:"flex items-center justify-end",children:a.jsxs("div",{className:"flex items-center space-x-2",children:[B.type==="space"&&a.jsxs("button",{onClick:()=>me(B),className:"flex items-center text-brand-premium hover:bg-brand-premium/10 transition-colors px-3 py-1 rounded-lg",children:[a.jsx(vr,{className:"w-4 h-4 mr-1"}),"Generate Contract"]}),X(B)&&a.jsxs("button",{onClick:()=>ve(B),className:"flex items-center text-red-500 hover:bg-red-50 transition-colors px-3 py-1 rounded-lg",children:[a.jsx(Ph,{className:"w-4 h-4 mr-1"}),"Refund"]}),a.jsx("button",{onClick:()=>K(B),className:"text-brand-premium hover:text-brand-blue transition-colors p-2",children:a.jsx(Kn,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>z(B.id),className:"text-red-500 hover:text-red-600 transition-colors p-2",children:a.jsx(_a,{className:"w-4 h-4"})})]})})}),B.selectedExtras&&B.selectedExtras.length>0&&a.jsxs("div",{className:"mt-3 pt-3 border-t",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Selected Extras:"}),a.jsx("div",{className:"flex flex-wrap gap-1",children:B.selectedExtras.map((Pe,Fe)=>a.jsx("span",{className:"text-xs bg-blue-100 text-blue-800 px-2 py-1 rounded",children:Pe.name||`Extra ${Fe+1}`},Fe))})]}),B.refunded&&B.refundReason&&a.jsxs("div",{className:"mt-3 pt-3 border-t",children:[a.jsx("p",{className:"text-xs text-gray-500 mb-1",children:"Refund Reason:"}),a.jsx("p",{className:"text-sm",children:B.refundReason})]})]},B.id)})})}),ye.length===0&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx(De,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No bookings found"}),a.jsx("p",{className:"text-gray-500",children:s||o!=="all"||c!=="all"||d!=="all"?"No bookings match your current filters":"Bookings will appear here when customers make reservations"})]}),a.jsx("div",{className:"p-4 border-t bg-gray-50",children:a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Access Types"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-gray-600",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-green-100 rounded mr-2"}),a.jsx("span",{children:"Business Hours (8:00-17:00)"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-blue-100 rounded mr-2"}),a.jsx("span",{children:"Extended Hours (7:00-22:00)"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-purple-100 rounded mr-2"}),a.jsx("span",{children:"24/7 Access"})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-2",children:"Expiration Status"}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-gray-600",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-blue-100 rounded mr-2"}),a.jsx("span",{children:"Future Booking (Not Started)"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-red-100 rounded mr-2"}),a.jsx("span",{children:"Expired / Expires Today"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-yellow-100 rounded mr-2"}),a.jsx("span",{children:"Expires Within 7 Days"})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 bg-green-100 rounded mr-2"}),a.jsx("span",{children:"Active (30+ Days)"})]})]})]})]})}),g&&b&&a.jsx(Yee,{booking:b,isOpen:g,onClose:()=>
4487{v(!1),y(null)}}),j&&T&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"relative w-full max-w-md transform overflow-hidden rounded-xl bg-white shadow-xl transition-all",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Edit Booking"}),a.jsx("button",{onClick:()=>{_(!1),N(null)},className:"text-gray-400 hover:text-gray-500",children:"×"})]}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6 text-center",children:[a.jsxs("div",{className:"flex items-center justify-center mb-2",children:[a.jsx(ka,{className:"w-5 h-5 text-yellow-600 mr-2"}),a.jsx("h4",{className:"font-medium text-yellow-800",children:"Editing Coming Soon"})]}),a.jsx("p",{className:"text-sm text-yellow-700",children:"The booking edit functionality is currently under development and will be available soon."})]}),a.jsx("div",{className:"text-center",children:a.jsx("button",{onClick:()=>_(!1),className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors",children:"Close"})})]})]})}),C&&I&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"relative w-full max-w-md transform overflow-hidden rounded-xl bg-white shadow-xl transition-all",children:[a.jsxs("div",{className:"px-6 py-4 border-b border-gray-200 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Process Refund"}),a.jsx("button",{onClick:()=>{R(!1),E(null),M(""),U(""),D("")},className:"text-gray-400 hover:text-gray-500",children:"×"})]}),a.jsx("div",{className:"p-6",children:V?a.jsxs("div",{className:"text-center mb-6",children:[a.jsx("div",{className:"w-12 h-12 mx-auto bg-green-100 rounded-full flex items-center justify-center mb-4",children:a.jsx(qr,{className:"w-6 h-6 text-green-600"})}),a.jsx("h4",{className:"text-lg font-medium text-gray-900 mb-2",children:"Refund Successful"}),a.jsx("p",{className:"text-green-600",children:V})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"mb-6",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(De,{className:"w-5 h-5 mr-2"}),"Booking Details"]}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:a.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Customer:"}),a.jsx("p",{className:"font-medium",children:I.userName})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Service:"}),a.jsx("p",{className:"font-medium",children:I.spaceName})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Date:"}),a.jsx("p",{className:"font-medium",children:he(et(I.date),"MMM d, yyyy")})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Amount:"}),a.jsx("p",{className:"font-medium",children:I.paymentType==="meeting_room_hours"?`${I.hoursUsed||0} hours`:`RON ${I.price}`})]})]})})]}),L&&a.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(ka,{className:"w-5 h-5 mr-2 mt-0.5 flex-shrink-0"}),a.jsx("span",{children:L})]})}),a.jsxs("div",{className:"mb-6",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",htmlFor:"refundReason",children:"Refund Reason"}),a.jsx("textarea",{id:"refundReason",value:W,onChange:B=>M(B.target.value),rows:3,className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Provide a reason for this refund..."})]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4 mb-6",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(ka,{className:"w-5 h-5 text-yellow-600 mr-2 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-yellow-800 mb
4487-1",children:"Important"}),a.jsx("p",{className:"text-sm text-yellow-700",children:I.paymentType==="meeting_room_hours"?`This will refund ${I.hoursUsed||0} meeting room hours back to the user.`:"This action will immediately process a full refund through Stripe and cannot be undone."}),a.jsx("p",{className:"text-sm text-yellow-700 mt-2",children:a.jsx("strong",{children:"Meeting room hours will be reset to 0."})}),a.jsx("p",{className:"text-sm text-yellow-700 mt-2",children:a.jsx("strong",{children:"The corresponding invoice will be cancelled in SmartBill."})})]})]})}),a.jsxs("div",{className:"flex justify-end space-x-3",children:[a.jsx("button",{type:"button",onClick:()=>{R(!1),E(null)},className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",disabled:S,children:"Cancel"}),a.jsx("button",{type:"button",onClick:Z,className:"px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors disabled:opacity-50 flex items-center",disabled:S,children:S?a.jsxs(a.Fragment,{children:[a.jsx(Si,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):a.jsxs(a.Fragment,{children:[a.jsx(Ph,{className:"w-4 h-4 mr-2"}),"Process Refund"]})})]})]})})]})})]})}function H2(){const[t,e]=P.useState(!1),[r,n]=P.useState(null);return{uploading:t,error:r,uploadImages:async(l,c)=>{e(!0),n(null);try{const u=l.map(async h=>{const m=ak(Qw,`${c}/${Date.now()}-${h.name}`),p={contentType:h.type,cacheControl:"public,max-age=31536000,immutable",customMetadata:{originalName:h.name,uploadedAt:new Date().toISOString(),folder:c}},x=await RQ(m,h,p),w=await DQ(x.ref);return console.log(`✅ Uploaded with optimal cache metadata: ${h.name}`),w});return await Promise.all(u)}catch(u){throw console.error("Error uploading images:",u),n("Failed to upload images"),new Error("Failed to upload images")}finally{e(!1)}},deleteImage:async l=>{try{const c=ak(Qw,l);await MQ(c)}catch(c){throw console.error("Error deleting image:",c),new Error("Failed to delete image")}},updateAllImageMetadata:async()=>{try{e(!0);const l=await fetch("/.netlify/functions/updateImageMetadata",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({})});if(!l.ok)throw new Error("Failed to update metadata");const c=await l.json();return console.log("✅ Bulk metadata update result:",c),{success:!0,message:c.message||"Successfully updated image metadata"}}catch(l){return console.error("Error updating metadata:",l),{success:!1,message:"Failed to update image metadata"}}finally{e(!1)}}}}function q2({images:t,mainImage:e,onImagesChange:r,onMainImageChange:n,folder:s}){const i=P.useRef(null),{uploading:o,uploadImages:l,deleteImage:c}=H2(),[u,d]=P.useState(null),h=async g=>{const v=Array.from(g.target.files||[]);if(v.length!==0){try{const b=await l(v,s),y=[...t,...b];r(y),t.length===0&&n(b[0])}catch{alert("Failed to upload images")}i.current&&(i.current.value="")}},m=async g=>{try{await c(g);const v=t.filter(b=>b!==g);r(v),g===e&&v.length>0&&n(v[0])}catch{alert("Failed to delete image")}},p=g=>{d(g)},x=(g,v)=>{if(g.preventDefault(),u===null||u===v)return;const b=[...t],y=b[u];b.splice(u,1),b.splice(v,0,y),r(b),d(v)},w=()=>{d(null)};return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Images"}),a.jsxs("button",{type:"button",onClick:()=>{var g;return(g=i.current)==null?void 0:g.click()},className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",disabled:o,children:[a.jsx(v3,{className:"w-4 h-4 mr-2"}),o?"Uploading...":"Upload Images"]})]}),a.jsx("input",{ref:i,type:"file",accept:"image/*",multiple:!0,onChange:h,className:"hidden"}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:t.map((g,v)=>a.jsxs("div",{draggable:!0,onDragStart:()=>p(v),onDragOver:b=>x(b,v),onDragEnd:w,className:`relative aspect-square rounded-lg overflow-hidden border-2 cursor-move transition-transform ${g===e?"border-brand-premium":"border-gray-200"} ${u===v?"opacity-50":""}`,children:[a.jsx("img",{src:g,alt:`Image ${v+1}`,className:"w-full h-full object-cover"}),a.jsxs("div",{className:"absolute inset-0 bg-black bg-opacity-50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center space-x-2",children:[g!==e&&a.jsx("button",{type:"button",onClick:()=>n(g),className:"p-2 bg-white rounded-full text-brand-premium hover:bg-gray-100",title:"Set as main image",children:a.jsx(iy,{className:"w-4 h-4"})}),a.jsx("button",{type:"button",onClick:()=>m(g),className:"p-2 bg-white rounded-full text-red-500 hover:bg-gray-100",title:"Delete image",children:a.jsx(Ge,{className:"w-4 h-4"})})]}),g===e&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-brand-premium text-white text-xs py-1 text-center",children:"Main Image"})]},g))})]})}const Nr=[];for(let t=0;t<256;++t)Nr.push((t+256).toString(16).slice(1));function Jee(t,e=0){return(Nr[t[e+0]]+Nr[t[e+1]]+Nr[t[e+2]]+Nr[t[e+3]]+"-"+Nr[t[e+4]]+Nr[t[e+5]]+"-"+Nr[t[e+6]]+Nr[t[e+7]]+"-"+Nr[t[e+8]]+Nr[t[e+9]]+"-"+Nr[t[e+10]]+Nr[t[e+11]]+Nr[t[e+12]]+Nr[t[e+13]]+Nr[t[e+14]]+Nr[t[e+15]]).toLowerCase()}let H0;const Zee=new Uint8Array(16);function ete(){if(!H0){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");H0=crypto.getRandomValues.bind(crypto)}return H0(Zee)}const tte=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wk={randomUUID:tte};function W2(t,e,r){var s;if(wk.randomUUID&&!t)return wk.randomUUID();t=t||{};const n=t.random??((s=t.rng)==null?void 0:s.call(t))??ete();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=n[6]&15|64,n[8]=n[8]&63|128,Jee(n)}const rte=[];function nte({initialData:t,onSubmit:e,onCancel:r}){const[n,s]=P.useState(()=>
4487({type:"hot-desk",title:"",motto:"",description:"",price:0,period:"day",capacity:"1",minCapacity:null,maxCapacity:null,location:"",images:[],mainImage:"",features:[],amenities:[],availableSpots:1,minDuration:void 0,maxDuration:void 0,accessHours:"8:00-17:00 on weekdays",meetingRoomHours:0,isSubscription:!1,extraOptions:Array.isArray(t==null?void 0:t.extraOptions)?t.extraOptions:rte,contactWhatsApp:"",contactEmail:"",...t})),[i,o]=P.useState(""),[l,c]=P.useState(""),[u,d]=P.useState({name:"",price:0,period:"month",description:""}),h=j=>{j.preventDefault(),e(n)},m=()=>{i.trim()&&(s(j=>({...j,features:[...j.features,i.trim()]})),o(""))},p=()=>{l.trim()&&(s(j=>({...j,amenities:[...j.amenities,l.trim()]})),c(""))},x=j=>{s(_=>({..._,features:_.features.filter((S,k)=>k!==j)}))},w=j=>{s(_=>({..._,amenities:_.amenities.filter((S,k)=>k!==j)}))},g=()=>{if(u.name&&u.price){const j={id:W2(),name:u.name,price:u.price,period:u.period||"month",description:u.description};s(_=>({..._,extraOptions:[...Array.isArray(_.extraOptions)?_.extraOptions:[],j]})),d({name:"",price:0,period:"month",description:""})}},v=j=>{s(_=>({..._,extraOptions:Array.isArray(_.extraOptions)?_.extraOptions.filter(S=>S.id!==j):[]}))},b=Jw[n.type]||[],y=Zw[n.type]||[],T=n.type==="private-office",N=(j,_,S)=>{let k=j;return _==="day"?k=j/30:_==="week"?k=j/4:_==="ten-days"?k=j/3:_==="half-month"&&(k=j/2),k<=1?"one-time":k>1&&S?"subscription":"one-time"};return a.jsxs("form",{onSubmit:h,className:"space-y-8",children:[a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Space Images"}),a.jsx(q2,{images:n.images,mainImage:n.mainImage,onImagesChange:j=>s(_=>({..._,images:j})),onMainImageChange:j=>s(_=>({..._,mainImage:j})),folder:"spaces"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Basic Information"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Type"}),a.jsx("select",{value:n.type,onChange:j=>{const _=j.target.value;s(S=>({...S,type:_,features:Jw[_]||[],amenities:Zw[_]||[]}))},className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",required:!0,children:zQ.map(j=>a.jsx("option",{value:j.id,children:j.label},j.id))})]}),T&&a.jsxs("div",{className:"md:col-span-2 flex items-start gap-3 bg-blue-50 border border-blue-200 rounded-lg p-4",children:[a.jsx(Ri,{className:"w-5 h-5 text-blue-500 flex-shrink-0 mt-0.5"}),a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-blue-800",children:"Private Office — Contact Mode"}),a.jsx("p",{className:"text-sm text-blue-700 mt-0.5",children:'This space will display WhatsApp and Email contact buttons on the public site instead of a "Book Now" button. Online booking and subscription options do not apply.'})]})]}),!T&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Subscription Available"}),a.jsxs("div",{className:"flex items-center space-x-4 mt-2",children:[a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"radio",name:"subscriptionAvailable",checked:!n.isSubscription,onChange:()=>s({...n,isSubscription:!1}),className:"mr-2"}),a.jsx("span",{className:"text-sm",children:"One-time Only"})]}),a.jsxs("label",{className:"flex items-center",children:[a.jsx("input",{type:"radio",name:"subscriptionAvailable",checked:n.isSubscription,onChange:()=>s({...n,isSubscription:!0}),className:"mr-2"}),a.jsx("span",{className:"text-sm",children:"Subscription Available"})]})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:n.isSubscription?"Customers can choose subscription for 2+ months":"All purchases will be one-time payments"})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Title"}),a.jsx("input",{type:"text",value:n.title,onChange:j=>s({...n,title:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focu
4487s:border-brand-premium transition-colors",placeholder:"Enter space title",required:!0})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Motto"}),a.jsx("input",{type:"text",value:n.motto,onChange:j=>s({...n,motto:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",placeholder:"Enter a catchy motto",required:!0})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),a.jsx("textarea",{value:n.description,onChange:j=>s({...n,description:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",rows:4,placeholder:"Describe the space",required:!0})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Pricing & Duration"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Location"}),a.jsx("input",{type:"text",value:n.location,onChange:j=>s({...n,location:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",placeholder:"Space location",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Price"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-500",children:"€"}),a.jsx("input",{type:"number",value:n.price,onChange:j=>s({...n,price:parseFloat(j.target.value)}),className:"w-full pl-8 p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",min:"0",step:"0.01",required:!0})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Period"}),a.jsx("select",{value:n.period,onChange:j=>s({...n,period:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",required:!0,children:HQ.map(j=>a.jsx("option",{value:j.id,children:j.label},j.id))})]}),!T&&a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Min Duration (",n.period,"s)"]}),a.jsx("input",{type:"number",value:n.minDuration||"",onChange:j=>s({...n,minDuration:parseInt(j.target.value)||null}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",min:"1",placeholder:"Optional"})]}),!T&&a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:["Max Duration (",n.period,"s)"]}),a.jsx("input",{type:"number",value:n.maxDuration||"",onChange:j=>s({...n,maxDuration:parseInt(j.target.value)||null}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",min:"1",placeholder:"Optional"})]}),!T&&n.minDuration&&n.maxDuration&&a.jsx("div",{className:"md:col-span-2",children:a.jsxs("div",{className:"bg-white rounded-lg p-4 border border-gray-200",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"💡 Smart Payment Logic Preview"}),a.jsxs("div",{className:"space-y-2 text-sm",children:[Array.from({length:Math.min(n.maxDuration-n.minDuration+1,5)},(j,_)=>{const S=n.minDuration+_,k=N(S,n.period,n.isSubscription);return a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("span",{className:"text-gray-600",children:[S," ",n.period,S>1?"s":"",":"]}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${k==="subscription"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:k==="subscription"?"🔄 Subscription":"💳 One-time"})]},S)}),n.maxDuration-n.minDuration>4&&a.jsxs("div",{className:"text-gray-500 text-xs",children:["... and ",n.maxDuration-n.minDuration-4," more options"]})]})]})}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Min Capacity"}),a.jsx("input",{type:"text",value:n.minCapacity||"",onChange:j=>s({...n,minCapacity:j.target.value||null}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focu
4487s:border-brand-premium transition-colors",placeholder:"Optional"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max Capacity"}),a.jsx("input",{type:"text",value:n.maxCapacity||"",onChange:j=>s({...n,maxCapacity:j.target.value||null}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",placeholder:"Optional"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Available Spots"}),a.jsx("input",{type:"number",value:n.availableSpots,onChange:j=>s({...n,availableSpots:parseInt(j.target.value)}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",min:"0",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Available From"}),a.jsx("input",{type:"date",value:n.availableFrom||"",onChange:j=>s({...n,availableFrom:j.target.value||void 0}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors"}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:'Optional. If set with spots available, visitors see "Available from [date]" and can only book starting from this date.'})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Access Hours"}),a.jsx("select",{value:n.accessHours,onChange:j=>s({...n,accessHours:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",required:!0,children:qQ.map(j=>a.jsx("option",{value:j.label,children:j.label},j.id))})]}),T&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"WhatsApp Number"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute left-3 top-1/2 -translate-y-1/2 text-gray-400 text-sm",children:"+"}),a.jsx("input",{type:"text",value:n.contactWhatsApp||"",onChange:j=>s({...n,contactWhatsApp:j.target.value}),className:"w-full pl-7 p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",placeholder:"40744659659"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Phone number without + prefix (e.g. 40744659659)"})]}),T&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Contact Email"}),a.jsx("input",{type:"email",value:n.contactEmail||"",onChange:j=>s({...n,contactEmail:j.target.value}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",placeholder:"[email protected]"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Meeting Room Hours"}),a.jsx("input",{type:"number",value:n.meetingRoomHours,onChange:j=>s({...n,meetingRoomHours:parseInt(j.target.value)}),className:"w-full p-2.5 rounded-lg border border-gray-300 focus:ring-2 focus:ring-brand-premium/20 focus:border-brand-premium transition-colors",min:"0"})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Features & Amenities"}),a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"Features"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:b.map(j=>a.jsxs("label",{className:"flex items-center p-3 bg-white rounded-lg hover:bg-gray-50 transition-colors",children:[a.jsx("input",{type:"checkbox",checked:n.features.includes(j),onChange:()=>{s(_=>({..._,features:_.features.includes(j)?_.features.filter(S=>S!==j):[..._.features,j]}))},className:"rounded border-gray-300 text-brand-premium focus:ring-brand-premium/20"}),a.jsx("span",{className:"ml-2 text-sm",children:j})]},j))}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-sm font-medium text-gray-700",children:"Custom Features"}),n.features.filter(j=>!b.includes(j)).map((j,_)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg",children:[a.jsx("span",{children:j}),a.jsx("button",{type:"button",onClick:()=>x(n.features.indexOf(j)),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},_)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:i,onChange:j=>o(j.target.value),placeholder:"Add new feature",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:m,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"Amenities"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-3",children:y.map(j=>a.jsxs("label",{className:"flex items-center p-3 bg-white rounded-lg hover:bg-gray-50 transition-colors",children:[a.jsx("input",{type:"checkbox",checked:n.amenities.includes(j),onChange:()=>{s(_=>({..._,amenities:_.amenities.includes(j)?_.amenities.filter(S=>S!==j):[..._.amenities,j]}))},className:"rounded border-gray-300 text-brand-premium focus:ring-brand-premium/20"}),a.jsx("span",{className:"ml-2 text-sm",children:j})]},j))}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h5",{className:"text-sm font-medium text-gray-700",children:"Custom Amenities"}),n.amenities.filter(j=>!y.includes(j)).map((j,_)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-white rounded-lg",children:[a.jsx("span",{children:j}),a.jsx("button",{type:"button",onClick:()=>w(n.amenities.indexOf(j)),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},_)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:l,onCh
4487ange:j=>c(j.target.value),placeholder:"Add new amenity",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:p,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Extra Options"}),a.jsxs("div",{className:"space-y-4",children:[(Array.isArray(n.extraOptions)?n.extraOptions:[]).map(j=>a.jsx("div",{className:"flex items-center justify-between p-4 bg-white rounded-lg",children:a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h4",{className:"font-medium",children:j.name}),a.jsx("button",{type:"button",onClick:()=>v(j.id),className:"text-red-500 hover:text-red-700",children:a.jsx(_a,{className:"w-4 h-4"})})]}),a.jsx("p",{className:"text-sm text-gray-500",children:j.description}),a.jsxs("p",{className:"text-sm font-medium mt-1",children:["€",j.price,"/",j.period]})]})},j.id)),a.jsxs("div",{className:"border-t pt-4",children:[a.jsx("h4",{className:"font-medium mb-2",children:"Add New Extra Option"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsx("div",{className:"col-span-2",children:a.jsx("input",{type:"text",value:u.name,onChange:j=>d({...u,name:j.target.value}),placeholder:"Option name",className:"w-full p-2 border rounded-lg"})}),a.jsx("div",{children:a.jsx("input",{type:"number",value:u.price,onChange:j=>d({...u,price:parseFloat(j.target.value)}),placeholder:"Price",className:"w-full p-2 border rounded-lg",min:"0",step:"0.01"})}),a.jsx("div",{children:a.jsxs("select",{value:u.period,onChange:j=>d({...u,period:j.target.value}),className:"w-full p-2 border rounded-lg",children:[a.jsx("option",{value:"hour",children:"Per Hour"}),a.jsx("option",{value:"day",children:"Per Day"}),a.jsx("option",{value:"week",children:"Per Week"}),a.jsx("option",{value:"month",children:"Per Month"})]})}),a.jsx("div",{className:"col-span-2",children:a.jsx("input",{type:"text",value:u.description,onChange:j=>d({...u,description:j.target.value}),placeholder:"Description (optional)",className:"w-full p-2 border rounded-lg"})}),a.jsx("div",{className:"col-span-2",children:a.jsxs("button",{type:"button",onClick:g,className:"w-full flex items-center justify-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:[a.jsx(Ut,{className:"w-4 h-4 mr-2"}),"Add Option"]})})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 pt-4",children:[a.jsx("button",{type:"button",onClick:r,className:"px-6 py-2.5 border border-gray-300 rounded-lg text-gray-700 font-medium hover:bg-gray-50 transition-colors",children:"Cancel"}),a.jsx("button",{type:"submit",className:"px-6 py-2.5 bg-brand-premium text-white rounded-lg font-medium hover:bg-opacity-90 transition-colors",children:t?"Update Space":"Create Space"})]})]})}function ate(){const{spaces:t,loading:e,error:r,addSpace:n,updateSpace:s,deleteSpace:i}=$y(),[o,l]=P.useState(!1),[c,u]=P.useState(null),[d,h]=P.useState({}),[m,p]=P.useState({}),[x,w]=P.useState(null),[g,v]=P.useState(t);F.useEffect(()=>{const E=[...t].sort((C,R)=>{const W=C.order??999,M=R.order??999;return W-M});v(E)},[t]);const b=(E,C)=>{w(C),E.dataTransfer.effectAllowed="move"},y=E=>{E.preventDefault(),E.dataTransfer.dropEffect="move"},T=()=>{w(null)},N=async(E,C)=>{if(E.preventDefault(),!x||x===C)return;const R=[...g],W=R.findIndex(V=>V.id===x),M=R.findIndex(V=>V.id===C);if(W===-1||M===-1)return;const[L]=R.splice(W,1);R.splice(M,0,L);const U=R.map((V,D)=>({...V,order:D}));v(U);try{await Promise.all(U.map((V,D)=>s(V.id,{...V,order:D}))),console.log("✅ Spaces order updated successfully")}catch(V){console.error("❌ Failed to update spaces order:",V),v(t)}w(null)},j=async E=>{if(window.confirm("Are you sure you want to delete this space?"))try{await i(E)}catch{alert("Failed to delete space")}},_=E=>{h(C=>({...C,[E]:!0})),p(C=>({...C,[E]:!1}))},S=E=>{p(C=>({...C,[E]:!0})),h(C=>({...C,[E]:!0}))};if(e)return a.jsx("div",{className:"text-center py-8",children:"Loading space
4487s..."});if(r)return a.jsx("div",{className:"text-red-500 text-center py-8",children:r});const k={"hot-desk":g.filter(E=>E.type==="hot-desk"),"dedicated-desk":g.filter(E=>E.type==="dedicated-desk"),"private-office":g.filter(E=>E.type==="private-office")},I={"hot-desk":"Hot Desk Spaces","dedicated-desk":"Dedicated Desk Spaces","private-office":"Private Office Spaces"};return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Spaces Management"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Drag and drop to reorder spaces within each category"})]}),a.jsxs("button",{onClick:()=>{u(null),l(!0)},className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:[a.jsx(Ut,{className:"w-5 h-5 mr-2"}),"Add Space"]})]}),o&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[200]",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:c?"Edit Space":"Add New Space"}),a.jsx("button",{onClick:()=>l(!1),children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"p-6",children:a.jsx(nte,{initialData:c||void 0,onSubmit:async E=>{try{c?await s(c.id,E):await n(E),l(!1)}catch{alert("Failed to save space")}},onCancel:()=>l(!1)})})]})}),Object.entries(k).map(([E,C])=>a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:I[E]}),a.jsxs("span",{className:"text-sm text-gray-500",children:[C.length," spaces"]})]})}),a.jsx("div",{className:"p-6",children:C.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:C.map(R=>{const W=d[R.id]||!1,M=m[R.id]||!1,L=x===R.id;return a.jsxs("div",{draggable:!0,onDragStart:U=>b(U,R.id),onDragOver:y,onDrop:U=>N(U,R.id),onDragEnd:T,className:`bg-white rounded-xl overflow-hidden shadow-card transition-all duration-200 cursor-move ${L?"opacity-50 transform rotate-2 scale-105":"hover:shadow-elevated"}`,children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 border-b",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(m3,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Drag to reorder"})]}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>{u(R),l(!0)},className:"p-2 text-brand-premium hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(Nu,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>j(R.id),className:"p-2 text-red-500 hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(_a,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"relative aspect-video bg-gray-100",children:[!W&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium rounded-full animate-spin"})}),R.mainImage?a.jsx("img",{src:R.mainImage,alt:R.title,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${W&&!M?"opacity-100":"opacity-0"}`,onLoad:()=>_(R.id),onError:()=>S(R.id),loading:"lazy",decoding:"async"}):a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"No image available"})]})}),M&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),R.images&&R.images.length>1&&W&&!M&&a.jsxs("div",{className:"absolute bottom-2 right-2 bg-black bg-opacity-50 text-white text-xs px-2 py-1 rounded-full",children:["+",R.images.length-1," more"]})]}),a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex justify-between items-start mb-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-semibold",children:R.title}),a.jsx("p",{className:"text-gray-600",children:R.type})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 mb-4",children:[a.jsxs("div",{className:"text-sm text-gray-600",children:[a.jsx("span",{className:"font-medium",children:"Capacity:"})," ",R.capacity]}),a.jsxs("div",{className:"text-sm text-gray-600",children:[a.jsx("span",{className:"font-medium",children:"Access:"})," ",R.accessHours]})]}),a.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[a.jsxs("div",{className:"text-lg font-semibold",children:["€",R.price,"/",R.period]}),a.jsxs("div",{className:"text-sm text-gray-500",children:[R.availableSpots," spots left"]})]})]})]},R.id)})}):a.jsxs("div",{className:"text-center py-8 text-gray-500",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ut,{className:"w-8 h-8 text-gray-400"})}),a.jsxs("p",{children:["No ",I[E].toLowerCase()," yet"]}),a.jsx("p",{className:"text-sm",children:"Add the first space to get started"})]})})]},E))]})}const ste={smartTv:!1,whiteboard:!1,flipchart:!1,soundSystem:!1,projector:!1,airConditioning:!1,ventilation:!1};function ite({initialData:t,onSubmit:e,onCancel:r}){const[n,s]=P.useState(t||{title:"",description:"",capacity:{min:1,max:1},size:0,images:[],mainImage:"",features:[],prices:{weekday:{hourly:0,daily:0},afterHours:{hourly:0,daily:0}},equipment:ste,policy:["Right of passage maintained for private office clients","Prices exclude VAT","Less than 4 hours: hourly rate applies","More than 4 hours: daily rate applies","Standard hours: 8:00-17:00 weekdays","After hours require prior notice"],availableSpots:1,kitchenAccess:!1,flexibleFurniture:!1,isInfoOnly:!1}),[i,o]=P.useState(""),[l,c]=P.useState(""),[u,d]=P.useState(null),h=v
4487=>{v.preventDefault(),e(n)},m=()=>{i.trim()&&(s(v=>({...v,features:[...v.features,i.trim()]})),o(""))},p=()=>{l.trim()&&(s(v=>({...v,policy:[...v.policy,l.trim()]})),c(""))},x=v=>{d(v)},w=(v,b)=>{if(v.preventDefault(),u===null||u===b)return;const y=[...n.images],T=y[u];y.splice(u,1),y.splice(b,0,T),s(N=>({...N,images:y})),d(b)},g=()=>{d(null)};return a.jsxs("form",{onSubmit:h,className:"space-y-8",children:[a.jsxs("div",{className:"bg-gray-50 rounded-xl p-6",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Room Images"}),a.jsxs("div",{className:"space-y-4",children:[a.jsx(q2,{images:n.images,mainImage:n.mainImage,onImagesChange:v=>s(b=>({...b,images:v})),onMainImageChange:v=>s(b=>({...b,mainImage:v})),folder:"rooms"}),a.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 gap-4",children:n.images.map((v,b)=>a.jsxs("div",{draggable:!0,onDragStart:()=>x(b),onDragOver:y=>w(y,b),onDragEnd:g,className:`relative aspect-square rounded-lg overflow-hidden border-2 cursor-move transition-transform ${v===n.mainImage?"border-brand-premium":"border-gray-200"} ${u===b?"opacity-50":""}`,children:[a.jsx("img",{src:v,alt:`Image ${b+1}`,className:"w-full h-full object-cover"}),a.jsx("div",{className:"absolute inset-0 bg-black bg-opacity-0 hover:bg-opacity-20 transition-opacity flex items-center justify-center",children:a.jsx("button",{type:"button",onClick:()=>s(y=>({...y,mainImage:v})),className:"opacity-0 group-hover:opacity-100 bg-white rounded-full p-2 shadow-lg hover:bg-gray-100 transition-all",children:v===n.mainImage?a.jsx("span",{className:"text-brand-premium",children:"★"}):a.jsx("span",{className:"text-gray-400",children:"☆"})})}),v===n.mainImage&&a.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-brand-premium text-white text-xs py-1 text-center",children:"Main Image"})]},v))})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Title"}),a.jsx("input",{type:"text",value:n.title,onChange:v=>s({...n,title:v.target.value}),className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),a.jsx("textarea",{value:n.description,onChange:v=>s({...n,description:v.target.value}),className:"w-full p-2 border rounded-lg",rows:3,required:!0})]}),a.jsx("div",{className:"md:col-span-2",children:a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("label",{className:"flex items-center space-x-3",children:[a.jsx("input",{type:"checkbox",checked:n.isInfoOnly,onChange:v=>s({...n,isInfoOnly:v.target.checked}),className:"rounded text-yellow-600 focus:ring-yellow-500"}),a.jsxs("div",{children:[a.jsx("span",{className:"font-medium text-yellow-800",children:"Information Only"}),a.jsx("p",{className:"text-sm text-yellow-700 mt-1",children:'Check this if this room is for display purposes only. Users will see an "Info" button instead of "Book Now" and will be directed to contact the office.'})]})]})})}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Minimum Capacity"}),a.jsx("input",{type:"number",value:n.capacity.min,onChange:v=>s({...n,capacity:{...n.capacity,min:parseInt(v.target.value)}}),className:"w-full p-2 border rounded-lg",min:"1",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Maximum Capacity"}),a.jsx("input",{type:"number",value:n.capacity.max,onChange:v=>s({...n,capacity:{...n.capacity,max:parseInt(v.target.value)}}),className:"w-full p-2 border rounded-lg",min:"1",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Size (m²)"}),a.jsx("input",{type:"number",value:n.size,onChange:v=>s({...n,size:parseInt(v.target.value)}),className:"w-full p-2 border rounded-lg",min:"0",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Available Spots"}),a.jsx("input",{type:"number",value:n.availableSpots,onChange:v=>s({...n,availableSpots:parseInt(v.target.value)}),className:"w-full p-2 border rounded-lg",min:"1",required:!0})]}),!n.isInfoOnly&&a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Pricing"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 bg-gray-50 p-4 rounded-lg",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2",children:"Week
4487day (8:00-17:00)"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm text-gray-600",children:"Hourly Rate (€)"}),a.jsx("input",{type:"number",value:n.prices.weekday.hourly,onChange:v=>s({...n,prices:{...n.prices,weekday:{...n.prices.weekday,hourly:parseFloat(v.target.value)}}}),className:"w-full p-2 border rounded-lg",min:"0",step:"0.01",required:!n.isInfoOnly})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm text-gray-600",children:"Daily Rate (€)"}),a.jsx("input",{type:"number",value:n.prices.weekday.daily,onChange:v=>s({...n,prices:{...n.prices,weekday:{...n.prices.weekday,daily:parseFloat(v.target.value)}}}),className:"w-full p-2 border rounded-lg",min:"0",step:"0.01",required:!n.isInfoOnly})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium mb-2",children:"After Hours & Weekends"}),a.jsxs("div",{className:"space-y-2",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm text-gray-600",children:"Hourly Rate (€)"}),a.jsx("input",{type:"number",value:n.prices.afterHours.hourly,onChange:v=>s({...n,prices:{...n.prices,afterHours:{...n.prices.afterHours,hourly:parseFloat(v.target.value)}}}),className:"w-full p-2 border rounded-lg",min:"0",step:"0.01",required:!n.isInfoOnly})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm text-gray-600",children:"Daily Rate (€)"}),a.jsx("input",{type:"number",value:n.prices.afterHours.daily,onChange:v=>s({...n,prices:{...n.prices,afterHours:{...n.prices.afterHours,daily:parseFloat(v.target.value)}}}),className:"w-full p-2 border rounded-lg",min:"0",step:"0.01",required:!n.isInfoOnly})]})]})]})]})]}),n.isInfoOnly&&a.jsx("div",{className:"md:col-span-2",children:a.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-blue-900 mb-2",children:"Information Only Mode"}),a.jsx("p",{className:"text-sm text-blue-800",children:'This room is set to information only. Users will see an "Info" button and will be directed to contact the office for booking inquiries. Pricing fields are not required.'})]})}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Equipment"}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.smartTv,onChange:v=>s({...n,equipment:{...n.equipment,smartTv:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Smart TV"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.whiteboard,onChange:v=>s({...n,equipment:{...n.equipment,whiteboard:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Whiteboard"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.flipchart,onChange:v=>s({...n,equipment:{...n.equipment,flipchart:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Flipchart"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.soundSystem,onChange:v=>s({...n,equipment:{...n.equipment,soundSystem:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Sound System"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.projector,onChange:v=>s({...n,equipment:{...n.equipment,projector:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Projector"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.airConditioning,onChange:v=>s({...n,equipment:{...n.equipment,airConditioning:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Air Conditioning"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.equipment.ventilation,onChange:v=>s({...n,equipment:{...n.equipment,ventilation:v.target.checked}}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Ventilation"})]})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-4",children:"Additional Features"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.kitchenAccess,onChange:v=>s({...n,kitchenAccess:v.target.checked}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Direct Kitchen Access"})]}),a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:n.flexibleFurniture,onChange:v=>s({...n,flexibleFurniture:v.target.checked}),className:"rounded text-brand-premium focus:ring-brand-premium"}),a.jsx("span",{children:"Flexible Furniture"})]})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Features"}),a.jsxs("div",{className:"space-y-2",children:[n.features.map((v,b)=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"flex-1",children:v}),a.jsx("button",{type:"button",onClick:()=>s(y=>({...y,features:y.features.filter((T,N)=>N!==b)})),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},b)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:i,onChange:v=>o(v.target.value),placeholder:"Add new feature",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:m,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Policies"}),a.jsxs("div",{className:"space-y-2",children:[n.policy.map((v,b)=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"flex-1",children:v}),a.jsx("button",{type:"button",onClick:()=>s(y=>({...y,policy:y.policy.filter((T,N)=>N!==b)})),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},b)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:l,onCh
4487ange:v=>c(v.target.value),placeholder:"Add new policy",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:p,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 pt-4",children:[a.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 font-medium hover:bg-gray-50 transition-colors",children:"Cancel"}),a.jsx("button",{type:"submit",className:"px-4 py-2 bg-brand-premium text-white rounded-lg font-medium hover:bg-opacity-90 transition-colors",children:t?"Update Room":"Create Room"})]})]})}function ote(){const{rooms:t,loading:e,error:r,addRoom:n,updateRoom:s,deleteRoom:i}=Xm(),[o,l]=P.useState(!1),[c,u]=P.useState(null),[d,h]=P.useState({}),[m,p]=P.useState({}),[x,w]=P.useState(null),[g,v]=P.useState(t);F.useEffect(()=>{const k=[...t].sort((I,E)=>{const C=I.order??999,R=E.order??999;return C-R});v(k)},[t]);const b=(k,I)=>{w(I),k.dataTransfer.effectAllowed="move"},y=k=>{k.preventDefault(),k.dataTransfer.dropEffect="move"},T=()=>{w(null)},N=async(k,I)=>{if(k.preventDefault(),!x||x===I)return;const E=[...g],C=E.findIndex(L=>L.id===x),R=E.findIndex(L=>L.id===I);if(C===-1||R===-1)return;const[W]=E.splice(C,1);E.splice(R,0,W);const M=E.map((L,U)=>({...L,order:U}));v(M);try{await Promise.all(M.map((L,U)=>s(L.id,{...L,order:U}))),console.log("✅ Rooms order updated successfully")}catch(L){console.error("❌ Failed to update rooms order:",L),v(t)}w(null)},j=async k=>{if(window.confirm("Are you sure you want to delete this room?"))try{await i(k)}catch{alert("Failed to delete room")}},_=k=>{h(I=>({...I,[k]:!0})),p(I=>({...I,[k]:!1}))},S=k=>{p(I=>({...I,[k]:!0})),h(I=>({...I,[k]:!0}))};return e?a.jsx("div",{className:"text-center py-8",children:"Loading rooms..."}):r?a.jsx("div",{className:"text-red-500 text-center py-8",children:r}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Meeting Rooms Management"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Drag and drop to reorder meeting rooms"})]}),a.jsxs("button",{onClick:()=>{u(null),l(!0)},className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:[a.jsx(Ut,{className:"w-5 h-5 mr-2"}),"Add Room"]})]}),o&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[200]",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:c?"Edit Room":"Add New Room"}),a.jsx("button",{onClick:()=>l(!1),children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"p-6",children:a.jsx(ite,{initialData:c||void 0,onSubmit:async k=>{try{c?await s(c.id,k):await n(k),l(!1)}catch{alert("Failed to save room")}},onCancel:()=>l(!1)})})]})}),a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"All Meeting Rooms"}),a.jsxs("span",{className:"text-sm text-gray-500",children:[g.length," rooms"]})]})}),a.jsx("div",{className:"p-6",children:g.length>0?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:g.map(k=>{const I=d[k.id]||!1,E=m[k.id]||!1,C=x===k.id;return a.jsxs("div",{draggable:!0,onDragStart:R=>b(R,k.id),onDragOver:y,onDrop:R=>N(R,k.id),onDragEnd:T,className:`bg-white rounded-xl overflow-hidden shadow-card transition-all duration-200 cursor-move ${C?"opacity-50 transform rotate-2 scale-105":"hover:shadow-elevated"}`,children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 border-b",children:[a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx(m3,{className:"w-4 h-4 text-gray-400"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Drag to reorder"})]}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>{u(k),l(!0)},className:"p-2 text-brand-premium hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(Nu,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>j(k.id),className:"p-2 text-red-500 hover:bg-gray-100 rounded-lg transition-colors",children:a.jsx(_a,{className:"w-4 h-4"})})]})]}),a.jsxs("div",{className:"relative aspect-video bg-gray-100",children:[!I&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 animate-pulse flex items-center justify-center",children:a.jsx("div",{className:"w-8 h-8 border-2 border-gray-300 border-t-brand-premium roun
4487ded-full animate-spin"})}),k.mainImage?a.jsx("img",{src:k.mainImage,alt:k.title,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${I&&!E?"opacity-100":"opacity-0"}`,onLoad:()=>_(k.id),onError:()=>S(k.id),loading:"lazy",decoding:"async"}):k.images&&k.images.length>0?a.jsx("img",{src:k.images[0],alt:k.title,className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-300 ${I&&!E?"opacity-100":"opacity-0"}`,onLoad:()=>_(k.id),onError:()=>S(k.id),loading:"lazy",decoding:"async"}):a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"No image available"})]})}),E&&a.jsx("div",{className:"absolute inset-0 bg-gray-200 flex items-center justify-center",children:a.jsxs("div",{className:"text-center text-gray-500",children:[a.jsx("div",{className:"w-12 h-12 mx-auto mb-2 bg-gray-300 rounded-lg flex items-center justify-center",children:"📷"}),a.jsx("p",{className:"text-xs",children:"Image unavailable"})]})}),k.images&&k.images.length>1&&I&&!E&&a.jsxs("div",{className:"absolute bottom-2 right-2 bg-black bg-opacity-50 text-white text-xs px-2 py-1 rounded-full",children:["+",k.images.length-1," more"]})]}),a.jsxs("div",{className:"p-6",children:[a.jsx("div",{className:"flex justify-between items-start mb-4",children:a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-semibold",children:k.title}),a.jsxs("p",{className:"text-gray-600",children:[k.capacity.min,"-",k.capacity.max," people"]})]})}),a.jsxs("div",{className:"border-t pt-4 mb-6",children:[a.jsx("h4",{className:"font-medium mb-2",children:"Pricing"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600 mb-1",children:"Weekday (8:00-17:00)"}),a.jsxs("div",{children:["€",k.prices.weekday.hourly,"/hour"]}),a.jsxs("div",{children:["€",k.prices.weekday.daily,"/day"]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600 mb-1",children:"After Hours"}),a.jsxs("div",{children:["€",k.prices.afterHours.hourly,"/hour"]}),a.jsxs("div",{children:["€",k.prices.afterHours.daily,"/day"]})]})]})]}),a.jsxs("div",{className:"text-sm text-gray-500",children:[k.availableSpots," spots available"]})]})]},k.id)})}):a.jsxs("div",{className:"text-center py-8 text-gray-500",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ut,{className:"w-8 h-8 text-gray-400"})}),a.jsx("p",{children:"No meeting rooms yet"}),a.jsx("p",{className:"text-sm",children:"Add the first room to get started"})]})})]})]})}function lte({initialData:t,onSubmit:e,onCancel:r}){var g,v;const[n,s]=P.useState(t||{title:"",description:"",date:"",time:"",duration:"",location:"",capacity:1,price:"Free",images:[],mainImage:"",category:"internal",requirements:[],benefits:[],organizer:"",registrationDeadline:"",isPaid:!1,onSitePayment:!0}),[i,o]=P.useState(""),[l,c]=P.useState(""),[u,d]=P.useState({}),h=b=>{b.preventDefault();const y={};if(n.title.trim()||(y.title="Title is required"),n.date||(y.date="Date is required"),n.time||(y.time="Time is required"),n.location.trim()||(y.location="Location is required"),n.capacity<1&&(y.capacity="Capacity must be at least 1"),n.isPaid&&(!n.price||n.price==="Free")&&(y.price="Price must be set for paid events"),Object.keys(y).length>0){d(y);return}e(n)},m=()=>{i.trim()&&(s(b=>({...b,requirements:[...b.requirements||[],i.trim()]})),o(""))},p=()=>{l.trim()&&(s(b=>({...b,benefits:[...b.benefits||[],l.trim()]})),c(""))},x=b=>{s(y=>({...y,price:y.isPaid?b.target.value:"Free"}))},w=b=>{const y=b.target.checked;s(T=>({...T,isPaid:y,price:y?T.price==="Free"?"15":T.price:"Free",onSitePayment:y?T.onSitePayment:!0}))};return a.jsxs("form",{onSubmit:h,className:"space-y-6",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"md:col-span-2",children:a.jsx(q2,{images:n.images,mainImage:n.mainImage,onImagesChange:b=>s(y=>({...y,images:b})),onMainImageChange:b=>s(y=>({...y,mainImage:b})),folder:"events"})}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Title"}),a.jsx("input",{type:"text",value:n.title,onChange:b=>s({...n,title:b.target.value}),className:`w-full p-2 border rounded-lg ${u.title?"border-red-500":""}`,required:!0}),u.title&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.title})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description"}),a.jsx("textarea",{value:n.description,onChange:b=>s({...n,description:b.target.value}),className:"w-full p-2 border rounded-lg",rows:3,required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Date"}),a.jsx("input",{type:"date",value:n.date,onChange:b=>s({...n,date:b.target.value}),className:`w-full p-2 border rounded-lg ${u.date?"border-red-500":""}`,required:!0}),u.date&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.date})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Time"}),a.jsx("input",{type:"time",value:n.time,onChange:b=>s({...n,time:b.target.value}),className:`w-full p-2 border rounded-lg ${u.time?"border-red-500":""}`,required:!0}),u.time&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.time})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Duration"}),a.jsx("input",{type:"text",value:n.duration,onChange:b=>s({...n,duration:b.target.value}),className:"w-full p-2 border rounded-lg",placeholder:"e.g., 2 hours",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Category"}),a.jsxs("select",{value:n.category,onChange:b=>s({...n,category:b.target.value}),className:"w-full p-2 border rounded-lg",required:!0,children:[a.jsx("option",{value:"internal",children:"Internal Event"}
4487),a.jsx("option",{value:"external",children:"External Event"})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Location"}),a.jsx("input",{type:"text",value:n.location,onChange:b=>s({...n,location:b.target.value}),className:`w-full p-2 border rounded-lg ${u.location?"border-red-500":""}`,required:!0}),u.location&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.location})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Capacity"}),a.jsx("input",{type:"number",value:n.capacity,onChange:b=>s({...n,capacity:parseInt(b.target.value)}),className:`w-full p-2 border rounded-lg ${u.capacity?"border-red-500":""}`,min:"1",required:!0}),u.capacity&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.capacity})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Registration Deadline"}),a.jsx("input",{type:"date",value:n.registrationDeadline,onChange:b=>s({...n,registrationDeadline:b.target.value}),className:"w-full p-2 border rounded-lg"})]}),a.jsxs("div",{className:"md:col-span-2 bg-gray-50 p-4 rounded-lg",children:[a.jsx("h3",{className:"text-md font-medium text-gray-800 mb-4",children:"Payment Settings"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",id:"isPaid",checked:n.isPaid,onChange:w,className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium"}),a.jsx("label",{htmlFor:"isPaid",className:"ml-2 block text-sm text-gray-700",children:"This is a paid event"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Price"}),a.jsxs("div",{className:"relative",children:[a.jsx("span",{className:"absolute inset-y-0 left-0 pl-3 flex items-center text-gray-500",children:n.isPaid?"€":""}),a.jsx("input",{type:"text",value:n.price,onChange:x,className:`w-full p-2 ${n.isPaid?"pl-8":"pl-3"} border rounded-lg ${u.price?"border-red-500":""} ${n.isPaid?"":"bg-gray-100 cursor-not-allowed"}`,placeholder:n.isPaid?"e.g., 15":"Free",disabled:!n.isPaid,required:!0})]}),u.price&&a.jsx("p",{className:"text-red-500 text-xs mt-1",children:u.price})]}),n.isPaid&&a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{type:"checkbox",id:"onSitePayment",checked:n.onSitePayment,onChange:b=>s({...n,onSitePayment:b.target.checked}),className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium"}),a.jsx("label",{htmlFor:"onSitePayment",className:"ml-2 block text-sm text-gray-700",children:"Payment is collected on-site (not online)"})]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-100 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-4 h-4 text-yellow-600 mr-2 mt-0.5"}),a.jsx("div",{className:"text-sm text-yellow-700",children:n.isPaid?n.onSitePayment?"Attendees will be asked to pay at the venue. No online payment will be processed.":"Attendees will need to pay online. Make sure your payment system is configured.":"This event is free. No payment will be required from attendees."})]})})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Organizer"}),a.jsx("input",{type:"text",value:n.organizer,onChange:b=>s({...n,organizer:b.target.value}),className:"w-full p-2 border rounded-lg",required:!0})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Requirements"}),a.jsxs("div",{className:"space-y-2",children:[(g=n.requirements)==null?void 0:g.map((b,y)=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"flex-1",children:b}),a.jsx("button",{type:"button",onClick:()=>s(T=>{var N;return{...T,requirements:(N=T.requirements)==null?void 0:N.filter((j,_)=>_!==y)}}),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},y)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:i,onChange:b=>o(b.target.value),placeholder:"Add new requirement",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:m,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]}),a.jsxs("div",{className:"md:col-span-2",children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Benefits"}),a.jsxs("div",{className:"space-y-2",children:[(v=n.benefits)==null?void 0:v.map((b,y)=>a.jsxs("div",{className:"flex items-center space-x-2",children:[a.jsx("span",{className:"flex-1",children:b}),a.jsx("button",{type:"button",onClick:()=>s(T=>{var N;return{...T,benefits:(N=T.benefits)==null?void 0:N.filter((j,_)=>_!==y)}}),className:"text-red-500 hover:text-red-700",children:a.jsx(Ge,{className:"w-4 h-4"})})]},y)),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:l,onCh
4487ange:b=>c(b.target.value),placeholder:"Add new benefit",className:"flex-1 p-2 border rounded-lg"}),a.jsx("button",{type:"button",onClick:p,className:"p-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:a.jsx(Ut,{className:"w-5 h-5"})})]})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 pt-4",children:[a.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50",children:"Cancel"}),a.jsx("button",{type:"submit",className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90",children:t?"Update Event":"Create Event"})]})]})}function cte({eventId:t,eventTitle:e}){const[r,n]=P.useState([]),[s,i]=P.useState(!0),[o,l]=P.useState(null),[c,u]=P.useState(""),[d,h]=P.useState("all"),[m,p]=P.useState("all"),[x,w]=P.useState({});P.useEffect(()=>{t&&(async()=>{try{i(!0);const _=Be(oe,"eventRegistrations"),S=dt(_,ht("eventId","==",t)),I=(await Zt(S)).docs.map(C=>({id:C.id,...C.data()}));I.sort((C,R)=>{var L,U,V,D;const W=((U=(L=C.registeredAt)==null?void 0:L.toDate)==null?void 0:U.call(L))||new Date(0);return(((D=(V=R.registeredAt)==null?void 0:V.toDate)==null?void 0:D.call(V))||new Date(0)).getTime()-W.getTime()});const E={};I.forEach(C=>{E[C.id]=C.notes||""}),w(E),n(I)}catch(_){console.error("Error fetching event registrations:",_),l("Failed to load registrations. Please try again.")}finally{i(!1)}})()},[t]);const g=async(j,_)=>{try{const S=Te(oe,"eventRegistrations",j);await Je(S,{attended:!_}),n(k=>k.map(I=>I.id===j?{...I,attended:!_}:I))}catch(S){console.error("Error updating attendance status:",S),alert("Failed to update attendance status")}},v=async j=>{try{const _=x[j],S=Te(oe,"eventRegistrations",j);await Je(S,{notes:_}),n(k=>k.map(I=>I.id===j?{...I,notes:_}:I)),alert("Notes updated successfully")}catch(_){console.error("Error updating notes:",_),alert("Failed to update notes")}},b=async j=>{if(window.confirm("Are you sure you want to delete this registration?"))try{await Rn(Te(oe,"eventRegistrations",j)),n(_=>_.filter(S=>S.id!==j))}catch(_){console.error("Error deleting registration:",_),alert("Failed to delete registration")}},y=()=>{if(r.length===0)return;const _=[["Name","Email","Phone","Status","Registered Date","Attended","Notes"].join(","),...r.map(E=>{var R,W;const C=(W=(R=E.registeredAt)==null?void 0:R.toDate)!=null&&W.call(R)?he(E.registeredAt.toDate(),"yyyy-MM-dd HH:mm"):"Unknown";return[`"${E.userName.replace(/"/g,'""')}"`,`"${E.userEmail.replace(/"/g,'""')}"`,`"${(E.userPhone||"").replace(/"/g,'""')}"`,`"${E.paymentStatus}"`,`"${C}"`,E.attended?"Yes":"No",`"${(E.notes||"").replace(/"/g,'""')}"`].join(",")})].join(`
4488`),S=new Blob([_],{type:"text/csv;charset=utf-8;"}),k=URL.createObjectURL(S),I=document.createElement("a");I.setAttribute("href",k),I.setAttribute("download",`${e.replace(/\s+/g,"-")}-registrations.csv`),I.style.visibility="hidden",document.body.appendChild(I),I.click(),document.body.removeChild(I)},T=r.filter(j=>{const _=j.userName.toLowerCase().includes(c.toLowerCase())||j.userEmail.toLowerCase().includes(c.toLowerCase())||j.notes&&j.notes.toLowerCase().includes(c.toLowerCase()),S=d==="all"||d==="attended"&&j.attended||d==="not-attended"&&!j.attended,k=m==="all"||m==="free"&&j.paymentStatus==="free"||m==="paid"&&(j.paymentStatus==="paid"||j.paymentStatus==="paid_on_site")||m==="pending"&&j.paymentStatus==="pending";return _&&S&&k}),N=j=>{switch(j){case"free":return"bg-gray-100 text-gray-800";case"paid":return"bg-green-100 text-green-800";case"paid_on_site":return"bg-blue-100 text-blue-800";
4488case"pending":return"bg-yellow-100 text-yellow-800";default:return"bg-gray-100 text-gray-800"}};return s?a.jsx("div",{className:"flex justify-center items-center h-40",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-premium"})}):a.jsxs("div",{className:"bg-white rounded-xl shadow-sm",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsxs("h2",{className:"text-lg font-semibold text-gray-900",children:["Registrations for ",e]}),a.jsxs("p",{className:"text-sm text-gray-500 mt-1",children:[r.length," ",r.length===1?"person":"people"," registered"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Pm,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-4 h-4"}),a.jsx("input",{type:"text",placeholder:"Search...",value:c,onChange:j=>u(j.target.value),className:"pl-9 pr-4 py-2 border rounded-lg text-sm w-full sm:w-auto"})]}),a.jsxs("select",{value:d,onChange:j=>h(j.target.value),className:"px-3 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Attendance"}),a.jsx("option",{value:"attended",children:"Attended"}),a.jsx("option",{value:"not-attended",children:"Not Attended"})]}),a.jsxs("select",{value:m,onChange:j=>p(j.target.value),className:"px-3 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Payment"}),a.jsx("option",{value:"free",children:"Free"}),a.jsx("option",{value:"paid",children:"Paid"}),a.jsx("option",{value:"pending",children:"Pending"})]}),a.jsxs("button",{onClick:y,disabled:r.length===0,className:"flex items-center px-3 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50 text-sm",children:[a.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Export CSV"]})]})]})}),o&&a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("span",{className:"text-sm text-red-700",children:o}),a.jsx("button",{onClick:()=>window.location.reload(),className:"text-sm text-brand-premium ml-4 hover:underline",children:"Try Again"})]})]})})}),!o&&a.jsx("div",{className:"overflow-x-auto",children:T.length>0?a.jsxs("table",{className:"min-w-full divide-y divide-gray-200",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Attendee"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Registered On"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Attended"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Notes"}),a.jsx("th",{className:"px-6 py-3 text-center text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-200",children:T.map(j=>{var _;return a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"flex-shrink-0 h-10 w-10",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center",children:a.jsx(fn,{className:"h-5 w-5 text-gray-500"})})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:j.userName}),a.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[a.jsx(Or,{className:"w-3 h-3 mr-1"}),j.userEmail]}),j.userPhone&&a.jsxs("div",{className:"flex items-center text-sm text-gray-500",children:[a.jsx(Na,{className:"w-3 h-3 mr-1"}),j.userPhone]})]})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("span",{className:`px-2 py-1 inline-flex text-xs leading-5 font-medium rounded-full ${N(j.paymentStatus)}`,children:[j.paymentStatus==="free"&&"Free Registration",j.paymentStatus==="paid"&&"Paid Online",j.paymentStatus==="paid_on_site"&&"Paid On-site",j.paymentStatus==="pending"&&"Payment Pending"]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:(_=j.registeredAt)!=null&&_.toDate?he(j.registeredAt.toDate(),"MMM d, yyyy HH:mm"):"Unknown"}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-center",children:a.jsx("button",{onClick:()=>g(j.id,j.attended),className:`inline-flex items-center justify-center w-8 h-8 rounded-full ${j.attended?"bg-green-100 text-green-700 hover:bg-green-200":"bg-gray-100 text-gray-400 hover:bg-gray-200"}`,title:j.attended?"Mark as not attended":"Mark as attended",children:j.attended?a.jsx(qr,{className:"w-5 h-5"}):a.jsx(Ge,{className:"w-5 h-5"})})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("input",{type:"text",value:x[j.id]||"",onChange:S=>w({...x,[j.id]:S.target.value}),className:"text-sm p-2 border border-gray-300 rounded w-full",placeholder:"Add notes..."}),a.jsx("button",{onClick:()=>v(j.id),className:"bg-gray-100 px-2 py-1 rounded hover:bg-gray-200",children:a.jsx(Uo,{className:"w-4 h-4 text-gray-600"})})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-center",children:a.jsx("button",{onClick:()=>b(j.id),className:"text-red-500 hover:text-red-700",title:"Remove registration",children:a.jsx(Ge,{className:"w-5 h-5"})})})]},j.id)})})]}):a.jsxs("div",{className:"text-center py-8",children:[a.jsx(De,{className:"w-12 h-12 text-gray-300 mx-auto mb-3"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-1",children:"No registrations foun
4488d"}),a.jsx("p",{className:"text-gray-500 mb-4",children:c||d!=="all"||m!=="all"?"Try changing your search or filter criteria":"No one has registered for this event yet"})]})})]})}function ute(){const{events:t,loading:e,error:r,addEvent:n,updateEvent:s,deleteEvent:i}=n6(),[o,l]=P.useState(!1),[c,u]=P.useState(null),[d,h]=P.useState("all"),[m,p]=P.useState(!1),[x,w]=P.useState(null),g=async y=>{if(window.confirm("Are you sure you want to delete this event?"))try{await i(y)}catch{alert("Failed to delete event")}},v=y=>{w(y),p(!0)};if(e)return a.jsx("div",{className:"text-center py-8",children:"Loading events..."});if(r)return a.jsx("div",{className:"text-red-500 text-center py-8",children:r});const b=t.filter(y=>d==="all"||y.category===d);return a.jsxs("div",{className:"space-y-6",children:[m?a.jsx("div",{className:"flex justify-between items-center",children:a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsxs("button",{onClick:()=>p(!1),className:"flex items-center text-brand-premium hover:text-brand-blue transition-colors",children:[a.jsx(fl,{className:"w-5 h-5 mr-2"}),"Back to Events"]}),a.jsx("h2",{className:"text-lg font-semibold",children:"Event Registrations"})]})}):a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center space-x-4",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Events Management"}),a.jsxs("select",{value:d,onChange:y=>h(y.target.value),className:"px-3 py-1 border rounded-lg text-sm",children:[a.jsx("option",{value:"all",children:"All Events"}),a.jsx("option",{value:"internal",children:"Internal Events"}),a.jsx("option",{value:"external",children:"External Events"})]})]}),a.jsxs("button",{onClick:()=>{u(null),l(!0)},className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:[a.jsx(Ut,{className:"w-5 h-5 mr-2"}),"Add Event"]})]}),o&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-[200]",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-4xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:c?"Edit Event":"Add New Event"}),a.jsx("button",{onClick:()=>l(!1),children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"p-6",children:a.jsx(lte,{initialData:c||void 0,onSubmit:async y=>{try{c?await s(c.id,y):await n(y),l(!1)}catch{alert("Failed to save event")}},onCancel:()=>l(!1)})})]})}),m&&x?a.jsx(cte,{eventId:x.id,eventTitle:x.title}):a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:b.map(y=>{var T;return a.jsxs("div",{className:"bg-white rounded-xl overflow-hidden shadow-card",children:[a.jsx("img",{src:y.mainImage||((T=y.images)==null?void 0:T[0]),alt:y.title,className:"w-full h-48 object-cover"}),a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"flex justify-between items-start mb-4",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-xl font-semibold",children:y.title}),a.jsxs("div",{className:"flex items-center mt-1 space-x-2",children:[a.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs font-medium ${y.category==="internal"?"bg-brand-premium text-white":"bg-gray-100 text-gray-800"}`,children:y.category==="internal"?"Internal Event":"External Event"}),y.isPaid?a.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs font-medium ${y.onSitePayment?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:y.onSitePayment?"Paid On-site":"Paid Online"}):a.jsx("span",{className:"inline-block px-2 py-1 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:"Free Event"})]})]}),a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>v(y),className:"p-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",title:"View Registrations",children:a.jsx(Mt,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>{u(y),l(!0)},className:"p-2 text-brand-premium hover:bg-brand-premium/10 rounded-lg transition-colors",title:"Edit Event",children:a.jsx(Nu,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>g(y.id),className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"Delete Event",children:a.jsx(_a,{className:"w-5 h-5"})})]})]}),a.jsxs("div",{className:"space-y-2 mb-4",children:[a.jsx("p",{className:"text-gray-600 line-clamp-2",children:y.description}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Date:"})," ",he(et(y.date),"MMM d, yyyy")]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Time:"})," ",y.time]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Duration:"})," ",y.duration]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Capacity:"})," ",y.capacity," people"]})]})]}),a.jsxs("div",{className:"flex justify-between items-center pt-4 border-t",children:[a.jsxs("div",{className:"text-sm text-gray-500",children:["Organized by: ",y.organizer]}),a.jsx("div",{className:"text-lg font-semibold",children:y.isPaid?`€${y.price}`:"Free"})]})]})]},y.id)})}),b.length===0&&!m&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ut,{className:"w-8 h-8 text-gray-400"})}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No events found"}),a.jsx("p",{className:"text-gray-500",children:d!=="all"?`No ${d} events found. Try changing your filter.`:"Add your first event to get started!"})]})]})}function dte(){var S,k;const{rooms:t,loading:e}=Xm(),{user:r}=br(),[n,s]=P.useState(null),[i,o]=P.useState(null),[l,c]=P.useState(null),[u,d]=P.useState(!1),[h,m]=P.useState(!1),[p,x]=P.useState(""),[w,g]=P.useState(!1),[v,b]=P.useState({date:he(new Date,"yyyy-MM-dd"),startTime:"09:00",endTime:"17:00"}),y=Array.from({length:31},(I,E)=>{const C=Math.floor(E/2)+7,R=E%2*30;return`${C.toString().padStart(2,"0")}:${R.toString().padStart(2,"0")}`}),T=I=>{const[E,C]=I.split(":").map(Number);return E*60+C},N=async(I,E,C,R)=>
4488{if(n){d(!0),c(null);try{const W=Te(oe,"rooms",n);if(C)await Je(W,{blockedSlots:HE(R)});else{const M={date:I,time:E,blockedBy:p||(r==null?void 0:r.email)||"Admin",blockedAt:new Date().toISOString()};await Je(W,{blockedSlots:zE(M)})}o(null),m(!1),x("")}catch(W){console.error("Error updating blocked slots:",W),c("Failed to update time slot availability")}finally{d(!1)}}},j=async()=>{if(n){d(!0),c(null);try{const I=t.find(D=>D.id===n);if(!I)throw new Error("Room not found");const E=T(v.startTime),C=T(v.endTime);if(E>=C){c("End time must be after start time"),d(!1);return}const R=y.filter(D=>{const z=T(D);return z>=E&&z<C}),W=I.blockedSlots||[],M=R.filter(D=>W.some(z=>z.date===v.date&&z.time===D)),L=R.filter(D=>!W.some(z=>z.date===v.date&&z.time===D));if(M.length>0){const D=`${M.length} time slots are already blocked in this range. Do you want to continue blocking the remaining ${L.length} slots?`;if(!confirm(D)){d(!1);return}}if(L.length===0){c("All time slots in this range are already blocked"),d(!1);return}const U=Te(oe,"rooms",n),V=L.map(D=>({date:v.date,time:D,blockedBy:p||(r==null?void 0:r.email)||"Admin",blockedAt:new Date().toISOString()}));await Je(U,{blockedSlots:zE(...V)}),g(!1),b({date:he(new Date,"yyyy-MM-dd"),startTime:"09:00",endTime:"17:00"})}catch(I){console.error("Error blocking time range:",I),c("Failed to block time range")}finally{d(!1)}}},_=async()=>{if(n){d(!0),c(null);try{const I=t.find(U=>U.id===n);if(!I)throw new Error("Room not found");const E=T(v.startTime),C=T(v.endTime);if(E>=C){c("End time must be after start time"),d(!1);return}const R=y.filter(U=>{const V=T(U);return V>=E&&V<C}),M=(I.blockedSlots||[]).filter(U=>U.date===v.date&&R.includes(U.time));if(M.length===0){c("No blocked time slots found in this range"),d(!1);return}const L=Te(oe,"rooms",n);await Je(L,{blockedSlots:HE(...M)}),g(!1),b({date:he(new Date,"yyyy-MM-dd"),startTime:"09:00",endTime:"17:00"})}catch(I){console.error("Error unblocking time range:",I),c("Failed to unblock time range")}finally{d(!1)}}};return e?a.jsx("div",{className:"bg-white rounded-xl p-6 shadow-card",children:a.jsxs("div",{className:"animate-pulse",children:[a.jsx("div",{className:"h-8 bg-gray-200 rounded w-1/4 mb-4"}),a.jsx("div",{className:"h-64 bg-gray-200 rounded"})]})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-card",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("h2",{className:"text-lg font-semibold mb-4",children:"Room Calendar"}),a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center gap-4",children:[a.jsxs("select",{value:n||"",onChange:I=>{s(I.target.value||null),o(null)},className:"w-full md:w-64 p-2 border rounded-lg",children:[a.jsx("option",{value:"",children:"Select a room"}),t.map(I=>a.jsx("option",{value:I.id,children:I.title},I.id))]}),n&&a.jsxs("button",{onClick:()=>g(!0),className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:[a.jsx(ga,{className:"w-4 h-4 mr-2"}),"Block Time Range"]}),i&&n&&a.jsx("button",{onClick:()=>{var C;const I=t.find(R=>R.id===n),E=(C=I==null?void 0:I.blockedSlots)==null?void 0:C.find(R=>R.date===i.date&&R.time===i.time);E?N(i.date,i.time,!0,E):m(!0)},disabled:u,className:"flex items-center px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50",children:u?"Updating...":a.jsx(a.Fragment,{children:(k=(S=t.find(I=>I.id===n))==null?void 0:S.blockedSlots)!=null&&k.some(I=>I.date===i.date&&I.time===i.time)?a.jsxs(a.Fragment,{children:[a.jsx(sU,{className:"w-4 h-4 mr-2"}),"Open Time Slot"]}):a.jsxs(a.Fragment,{children:[a.jsx(ga,{className:"w-4 h-4 mr-2"}),"Block Time Slot"]})})})]}),l&&a.jsx("div",{className:"mt-4 bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5"}),a.jsx("span",{className:"text-sm",children:l})]})}),i&&a.jsx("div",{className:"mt-4 bg-gradient-to-r from-brand-premium to-brand-blue text-white p-4 rounded-lg shadow-lg border-2 border-brand-premium",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qr,{className:"w-6 h-6 mr-3 text-brand-yellow"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-lg",children:"Selected Time Slot"}),a.jsxs("p",{className:"text-white/90",children:["📅 ",i.date," at ⏰ ",i.time]})]})]}),a.jsx("div",{className:"text-right",children:a.jsx("div",{className:"bg-white/20 backdrop-blur-sm px-3 py-1 rounded-full",children:a.jsx("span",{className:"text-sm font-medium",children:"Ready to Block/Unblock"})})})]})})]}),n?a.jsx(t6,{roomId:n,onSlotSelect:(I,E)=>o({date:I,time:E}),isAdmin:!0}):a.jsx("div",{className:"text-center py-12 text-gray-500",children:"Please select a room to view its calendar"})]}),h&&i&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-md",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Block Time Slot"}),a.jsx("button",{onClick:()=>{m(!1),x("")},className:"text-gray-400 hover:text-gray-500 transition-colors",children:"×"})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 mb-4",children:a.jsxs("p",{className:"text-sm text-blue-800",children:[a.jsx("strong",{children:"Date:"})," ",i.date,a.jsx("br",{}),a.jsx("strong",{children:"Time:"})," ",i.time]})}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Blocked for (optional)"}),a.jsxs("div",{className:"relative",children:[a.jsx(fn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",value:p,onChange:I=>x(I.target.value),placeholder:"Enter name or leave empty",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"If left empty, it will show your email"})]}),a.jsxs("div",{className:"flex space-x-3 pt-4",children:[a.jsx("button",{onClick:()=>{m(!1),x("")},className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",disabled:u,children:"Cancel"}),a.jsx("button",{onClick:()=>N(i.date,i.time,!1),className:"flex-1 px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors disabled:opacity-50",disabled:u,children:u?"Blocking...":"Block Slot"})]})]})]})}),w&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-md",children:[a.jsxs("div",{className:"flex justify-between items-center p-6 border-b",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Block Time Range"}),a.jsx("button",{onClick:()=>{g(!1),x("")},className:"text-gray-400 hover:text-gray-500 transition-colors",children:"×"})]}),a.jsxs("div",{className:"p-6 space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Blocked for (optional)"}),a.jsxs("div",{className:"relative",children:[a.jsx(fn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",value:p,onChange:I=>x(I.target.value),placeholder:"Enter name or leave empty",className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"If left empty, it will show your email"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Date"}),a.jsxs("div",{className:"relative",children:[a.jsx(De,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"date",value:v.date,onChange:I=>b(E=>({...E,date:I.target.value})),min:he(new Date,"yyyy-MM-dd"),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Start Time"}),a.jsxs("div",{className:"relative",children:[a.jsx(qe,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("select",{value:v.startTime,onChange:I=>b(E=>({...E,startTime:I.target.value})),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent appearance-none bg-white",children:y.slice(0,-1).map(I=>a.jsx("option",{value:I,children:I},I))})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"End Time"}),a.jsxs("div",{className:"relative",children:[a.jsx(qe,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("select",{value:v.endTime,onChange:I=>b(E=>({...E,endTime:I.target.value})),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent appearance-none bg-white",children:y.filter(I=>T(I)>T(v.startTime)).map(I=>a.jsx("option",{value:I,children:I},I))})]})]})]}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-3",children:a.jsxs("p",{className:"text-sm text-gray-600",children:[a.jsx("strong",{children:"Time Range:"})," ",v.startTime," - ",v.endTime,a.jsx("br",{}),a.jsx("strong",{children:"Duration:"})," ",((T(v.endTime)-T(v.startTime))/60).toFixed(1)," hours",a.jsx("br",{}),a.jsx("strong",{children:"Slots to affect:"})," ",y.filter(I=>{const E=T(I);return E>=T(v.startTime)&&E<T(v.endTime)}).length," time slots"]})}),l&&a.jsx("div",{className:"bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 mr-2 mt-0.5"}),a.jsx("span",{className:"text-sm",children:l})]})}),a.jsxs("div",{className:"flex space-x-3 pt-4",children:[a.jsx("button",{onClick:()=>g(!1),className:"flex-1 px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",disabled:u,children:"Cancel"}),a.jsx("button",{onClick:_,className:"flex-1 px-4 py-2 bg-green-500 text-white rounded-lg hover:bg-green-600 transition-colors disabled:opacity-50",disabled:u,children:u?"Processing...":"Unblock Range"}),a.jsx("button",{onClick:j,className:"flex-1 px-4 py-2 bg-red-500 text-white rounded-lg hover:bg-red-600 transition-colors disabled:opacity-50",disabled:u,children:u?"Processing...":"Block Range"})]})]})]})})]})}function hte(){const{tourRequests:t,updateTourRequestStatus:e,deleteTourRequest:r}=qM(),[n,s]=P.useState(""),[i,o]=P.useState("all"),[l,c]=P.useState(null),[u,d]=P.useState(!1),[h,m]=P.useState(""),p=async(b,y)=>{try{await e(b,y,h),m("")}catch{alert("Failed to update status")}},x=async b=>{if(window.confirm("Are you sure you want to delete this tour request?"))try{await r(b)}catch{alert("Failed to delete tour request")}},w=b=>{c(b),m(b.notes||""),d(!0)},g=t.filter(b=>(i==="all"||b.status===i)&&(b.name.toLowerCase().includes(n.toLowerCase())||b.email.toLowerCase().includes(n.toLowerCase())||b.company&&b.company.toLowerCase().includes(n.toLowerCase()))),v=b=>
4488{switch(b){case"pending":return"bg-yellow-100 text-yellow-800";case"confirmed":return"bg-blue-100 text-blue-800";case"completed":return"bg-green-100 text-green-800";case"cancelled":return"bg-red-100 text-red-800";default:return"bg-gray-100 text-gray-800"}};return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Tour Requests"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Manage personal tour requests from visitors"})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[a.jsxs("div",{className:"relative",children:[a.jsx(Pm,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 w-5 h-5"}),a.jsx("input",{type:"text",placeholder:"Search requests...",value:n,onChange:b=>s(b.target.value),className:"pl-10 pr-4 py-2 border rounded-lg text-sm w-full"})]}),a.jsxs("select",{value:i,onChange:b=>o(b.target.value),className:"px-4 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Status"}),a.jsx("option",{value:"pending",children:"Pending"}),a.jsx("option",{value:"confirmed",children:"Confirmed"}),a.jsx("option",{value:"completed",children:"Completed"}),a.jsx("option",{value:"cancelled",children:"Cancelled"})]})]})]})}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"bg-gray-50",children:[a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Visitor"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Preferred Date & Time"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Interests"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Requested"}),a.jsx("th",{className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-200",children:g.map(b=>a.jsxs("tr",{className:"hover:bg-gray-50",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"flex-shrink-0 h-10 w-10",children:a.jsx("div",{className:"h-10 w-10 rounded-full bg-brand-yellow flex items-center justify-center",children:a.jsx("span",{className:"text-brand-premium font-medium",children:b.name.charAt(0).toUpperCase()})})}),a.jsxs("div",{className:"ml-4",children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:b.name}),a.jsx("div",{className:"text-sm text-gray-500",children:b.email}),b.company&&a.jsx("div",{className:"text-xs text-gray-400",children:b.company})]})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("div",{className:"flex items-center text-sm text-gray-900",children:[a.jsx(De,{className:"w-4 h-4 mr-2 text-gray-400"}),a.jsxs("div",{children:[a.jsx("div",{children:he(et(b.preferredDate),"MMM d, yyyy")}),a.jsxs("div",{className:"text-xs text-gray-500 flex items-center",children:[a.jsx(qe,{className:"w-3 h-3 mr-1"}),b.preferredTime]})]})]})}),a.jsx("td",{className:"px-6 py-4",children:a.jsx("div",{className:"text-sm text-gray-900",children:b.interests.length>0?a.jsxs("div",{className:"space-y-1",children:[b.interests.slice(0,2).map((y,T)=>a.jsx("div",{className:"text-xs bg-gray-100 px-2 py-1 rounded",children:y},T)),b.interests.length>2&&a.jsxs("div",{className:"text-xs text-gray-500",children:["+",b.interests.length-2," more"]})]}):a.jsx("span",{className:"text-gray-400",children:"No specific interests"})})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsxs("select",{value:b.status,onChange:y=>p(b.id,y.target.value),className:`px-2.5 py-1 rounded-full text-xs font-medium border-0 ${v(b.status)}`,children:[a.jsx("option",{value:"pending",children:"Pending"}),a.jsx("option",{value:"confirmed",children:"Confirmed"}),a.jsx("option",{value:"completed",children:"Completed"}),a.jsx("option",{value:"cancelled",children:"Cancelled"})]})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:he(b.createdAt.toDate(),"MMM d, yyyy")}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:a.jsxs("div",{className:"flex space-x-2",children:[a.jsx("button",{onClick:()=>w(b),className:"text-brand-premium hover:text-brand-blue transition-colors",title:"View Details",children:a.jsx(xr,{className:"w-5 h-5"})}),a.jsx("button",{onClick:()=>x(b.id),className:"text-red-500 hover:text-red-600 transition-colors",title:"Delete Request",children:a.jsx(_a,{className:"w-5 h-5"})})]})})]},b.id))})]})}),g.length===0&&a.jsxs("div",{className:"text-center py-12",children:[a.jsx(De,{className:"w-12 h-12 text-gray-400 mx-auto mb-4"}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No Tour Requests"}),a.jsx("p",{className:"text-gray-500",children:n||i!=="all"?"No requests match your current filters":"Tour requests will appear here when visitors request personal tours"})]}),u&&l&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Tour Request Details"}),a.jsx("button",{onClick:()=>d(!1),className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Cm,{className:"w-6 h-6"})})]}),a.jsxs("div",{className:"p-6 space-y-6",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(fn,{className:"w-5 h-5 mr-2"}),"Contact Information"]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Name"}),a.jsx("p",{className:"mt-1",children:l.name})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Email"}),a.jsx("p",{className:"mt-1",children:l.email})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Phone"}),a.jsx("p",{className:"mt-1",children:l.phone})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Company"}),a.jsx("p",{className:"mt-1",children:l.company||"Not provided"})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(De,{className:"w-5 h-5 mr-2"}),"Visit Details"]}
4488),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Preferred Date"}),a.jsx("p",{className:"mt-1",children:he(et(l.preferredDate),"EEEE, MMMM d, yyyy")})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-500",children:"Preferred Time"}),a.jsx("p",{className:"mt-1",children:l.preferredTime})]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"Areas of Interest"}),l.interests.length>0?a.jsx("div",{className:"grid grid-cols-2 gap-2",children:l.interests.map((b,y)=>a.jsx("div",{className:"bg-brand-premium/10 text-brand-premium px-3 py-2 rounded-lg text-sm",children:b},y))}):a.jsx("p",{className:"text-gray-500",children:"No specific interests mentioned"})]}),l.message&&a.jsxs("div",{children:[a.jsxs("h4",{className:"font-medium text-gray-900 mb-3 flex items-center",children:[a.jsx(g3,{className:"w-5 h-5 mr-2"}),"Additional Message"]}),a.jsx("div",{className:"bg-gray-50 rounded-lg p-4",children:a.jsx("p",{className:"text-gray-700",children:l.message})})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"Status & Notes"}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Status"}),a.jsxs("select",{value:l.status,onChange:b=>{const y=b.target.value;c(T=>({...T,status:y}))},className:`px-3 py-2 rounded-lg text-sm font-medium border-0 ${v(l.status)}`,children:[a.jsx("option",{value:"pending",children:"Pending"}),a.jsx("option",{value:"confirmed",children:"Confirmed"}),a.jsx("option",{value:"completed",children:"Completed"}),a.jsx("option",{value:"cancelled",children:"Cancelled"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Internal Notes"}),a.jsx("textarea",{value:h,onChange:b=>m(b.target.value),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-brand-premium focus:border-transparent",rows:3,placeholder:"Add internal notes about this tour request..."})]})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 pt-4 border-t",children:[a.jsx("button",{onClick:()=>d(!1),className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Close"}),a.jsx("button",{onClick:()=>{p(l.id,l.status),d(!1)},className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Update Status & Notes"})]})]})]})})]})}class ns{static async fetchExchangeRate(){try{const e=await fetch("/.netlify/functions/getExchangeRate");if(!e.ok)throw new Error("API request failed");const r=await e.json();if(!r.exchangeRate||typeof r.exchangeRate!="number")throw new Error("Invalid rate data");return console.log(`💱 Fetched EUR to RON rate: ${r.exchangeRate}`),this.saveCurrencySettings({exchangeRate:r.exchangeRate,isAutomatic:r.isAutomatic,lastUpdated:r.lastUpdated,source:r.source}),r.exchangeRate}catch(e){return console.error("❌ Failed to fetch exchange rate:",e),console.log(`💱 Using fallback rate: ${this.FALLBACK_RATE}`),this.FALLBACK_RATE}}static convertEurToRon(e,r){const n=e*r;return Math.round(n*100)/100}static convertEurToRonCents(e,r){const n=this.convertEurToRon(e,r);return Math.round(n*100)}static formatRonAmount(e){return new Intl.NumberFormat("ro-RO",{style:"currency",currency:"RON",minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}static formatEurAmount(e){return new Intl.NumberFormat("en-EU",{style:"currency",currency:"EUR",minimumFractionDigits:2,maximumFractionDigits:2}).format(e)}static getCurrencySettings(){try{const e=localStorage.getItem("currencySettings");if(e)return JSON.parse(e)}catch(e){console.error("Error reading currency settings:",e)}return{exchangeRate:this.FALLBACK_RATE,isAutomatic:!0,lastUpdated:new Date().toISOString(),source:"manual"}}static saveCurrencySettings(e){try{localStorage.setItem("currencySettings",JSON.stringify(e)),console.log("💾 Currency settings saved:",e)}catch(r){console.error("Error saving currency settings:",r)}}static async updateExchangeRate(e,r){let n,s;e?(n=await this.fetchExchangeRate(),s="api"):(n=r||this.FALLBACK_RATE,s="manual");const i={exchangeRate:n,isAutomatic:e,lastUpdated:new Date().toISOString(),source:s};this.saveCurrencySettings(i);try{const o=await fetch("/.netlify/functions/updateExchangeRate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({exchangeRate:n,isAutomatic:e,source:s})});o.ok||console.error("Failed to update exchange rate in database:",await o.text())}catch(o){console.error("Error updating exchange rate in database:",o)}return i}}Ta(ns,"FALLBACK_RATE",5.08);function mte(){const[t,e]=P.useState(ns.getCurrencySettings()),[r,n]=P.useState(!1),[s,i]=P.useState(null);return P.useEffect(()=>{(async()=>{try{n(!0);const m=await fetch("/.netlify/functions/getExchangeRate");if(!m.ok)throw new Error("Failed to fetch exchange rate");const p=await m.json(),x={exchangeRate:p.exchangeRate,isAutomatic:p.isAutomatic,lastUpdated:p.lastUpdated,source:p.source};ns.saveCurrencySettings(x),e(x)}catch(m){console.error("Error loading currency settings:",m);const p=ns.getCurrencySettings();e(p)}finally{n(!1)}})()},[]),{settings:t,loading:r,error:s,updateExchangeRate:async(h,m)=>{n(!0),i(null);try{const p=await ns.updateExchangeRate(h,m);e(p)}catch(p){i(p instanceof Error?p.message:"Failed to update exchange rate")}finally{n(!1)}},convertEurToRon:h=>ns.convertEurToRon(h,t.exchangeRate),convertEurToRonCents:h=>ns.convertEurToRonCents(h,t.exchangeRate),formatRonAmount:h=>ns.formatRonAmount(h),formatEurAmount:h=>ns.formatEurAmount(h)}}function fte(){const{settings:t,loading:e,error:r,updateExchangeRate:n,convertEurToRon:s,formatRonAmount:i,formatEurAmount:o}=mte(),[l,c]=P.useState(t.exchangeRate.toString()),[u,d]=P.useState(!1),h=async()=>{await n(!t.isAutomatic,t.isAutomatic?parseFloat(l):void 0)},m=async()=>{const w=parseFloat(l);
4488if(isNaN(w)||w<=0){alert("Please enter a valid exchange rate");return}await n(!1,w),d(!1)},p=async()=>{await n(!0)},x=[50,100,250,500];return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-green-500 to-emerald-600 rounded-lg flex items-center justify-center",children:a.jsx(bu,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Currency Settings"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Manage EUR to RON conversion for Stripe payments"})]})]}),t.isAutomatic&&a.jsxs("button",{onClick:p,disabled:e,className:"flex items-center px-3 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors disabled:opacity-50",children:[a.jsx(Si,{className:`w-4 h-4 mr-2 ${e?"animate-spin":""}`}),"Refresh Rate"]})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[r&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-red-800",children:"Error"}),a.jsx("p",{className:"text-sm text-red-700 mt-1",children:r})]})]})}),a.jsxs("div",{className:"bg-gradient-to-br from-green-50 to-emerald-50 border border-green-200 rounded-xl p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(ly,{className:"w-6 h-6 text-green-600"}),a.jsxs("div",{children:[a.jsx("h3",{className:"font-semibold text-green-900",children:"Current Exchange Rate"}),a.jsxs("p",{className:"text-sm text-green-700",children:["1 EUR = ",t.exchangeRate.toFixed(4)," RON"]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-2xl font-bold text-green-600",children:t.exchangeRate.toFixed(4)}),a.jsx("div",{className:"text-xs text-green-600",children:"RON per EUR"})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx(qe,{className:"w-4 h-4 text-green-600 mr-2"}),a.jsxs("span",{className:"text-green-700",children:["Updated: ",he(new Date(t.lastUpdated),"MMM d, HH:mm")]})]}),a.jsxs("div",{className:"flex items-center",children:[a.jsx(Ch,{className:"w-4 h-4 text-green-600 mr-2"}),a.jsxs("span",{className:"text-green-700",children:["Source: ",t.source==="api"?"Live API":"Manual"]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Si,{className:"w-5 h-5 text-blue-500"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900",children:"Automatic Rate"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Live exchange rate from API"})]})]}),a.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:t.isAutomatic,onChange:h,disabled:e,className:"sr-only peer"}),a.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-blue-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-blue-600"})]})]}),t.isAutomatic&&a.jsx("div",{className:"bg-blue-50 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center text-blue-700",children:[a.jsx(qr,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-sm font-medium",children:"Auto-updates every hour"})]})})]}),a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx(Nw,{className:"w-5 h-5 text-gray-500"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-900",children:"Manual Rate"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Set custom exchange rate"})]})]}),a.jsx("button",{onClick:()=>d(!u),disabled:t.isAutomatic,className:"text-sm text-blue-600 hover:text-blue-800 disabled:text-gray-400 disabled:cursor-not-allowed",children:u?"Cancel":"Edit"})]}),u&&!t.isAutomatic&&a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Exchange Rate (RON per EUR)"}),a.jsx("input",{type:"number",step:"0.0001",min:"0",value:l,onCh
4488ange:w=>c(w.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-blue-500 focus:border-transparent",placeholder:"4.9500"})]}),a.jsx("div",{className:"flex space-x-2",children:a.jsx("button",{onClick:m,disabled:e,className:"flex-1 bg-blue-500 text-white px-3 py-2 rounded-lg hover:bg-blue-600 transition-colors disabled:opacity-50",children:"Update Rate"})})]}),!t.isAutomatic&&!u&&a.jsx("div",{className:"bg-gray-50 rounded-lg p-3",children:a.jsxs("div",{className:"flex items-center text-gray-700",children:[a.jsx(Nw,{className:"w-4 h-4 mr-2"}),a.jsx("span",{className:"text-sm font-medium",children:"Manual rate active"})]})})]})]}),a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4",children:[a.jsxs("div",{className:"flex items-center space-x-3 mb-4",children:[a.jsx($V,{className:"w-5 h-5 text-purple-500"}),a.jsx("h4",{className:"font-medium text-gray-900",children:"Example Conversions"})]}),a.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:x.map(w=>{const g=s(w);return a.jsxs("div",{className:"bg-gray-50 rounded-lg p-3 text-center",children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:o(w)}),a.jsx("div",{className:"text-xs text-gray-500 mt-1",children:"↓"}),a.jsx("div",{className:"text-sm font-semibold text-purple-600",children:i(g)})]},w)})})]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-yellow-600 mr-3 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-yellow-800",children:"Important Notice"}),a.jsx("p",{className:"text-sm text-yellow-700 mt-1",children:"Prices are displayed in EUR to customers, but Stripe will charge in RON using the current exchange rate. Automatic rates update hourly to ensure accuracy."})]})]})})]})]})}function pte(){const{updateAllImageMetadata:t,uploading:e}=H2(),[r,n]=P.useState(null),[s,i]=P.useState(!1),o=async()=>{n(null);const l=await t();n(l),i(!0)};return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-blue-500 to-indigo-600 rounded-lg flex items-center justify-center",children:a.jsx(iy,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Image Cache Optimization"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Automatically set optimal cache headers for all images"})]})]}),a.jsxs("button",{onClick:o,disabled:e,className:"flex items-center px-4 py-2 bg-blue-500 text-white rounded-lg hover:bg-blue-600 transition-colors disabled:opacity-50",children:[a.jsx(Si,{className:`w-4 h-4 mr-2 ${e?"animate-spin":""}`}),e?"Updating...":"Update All Images"]})]})}),a.jsxs("div",{className:"p-6 space-y-6",children:[r&&a.jsx("div",{className:`border-2 rounded-lg p-4 ${r.success?"border-green-200 bg-green-50":"border-red-200 bg-red-50"}`,children:a.jsxs("div",{className:"flex items-start",children:[r.success?a.jsx(qr,{className:"w-5 h-5 text-green-500 mr-3 mt-0.5"}):a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:`font-medium ${r.success?"text-green-800":"text-red-800"}`,children:r.success?"Success!":"Error"}),a.jsx("p",{className:`text-sm mt-1 ${r.success?"text-green-700":"text-red-700"}`,children:r.message})]})]})}),e&&a.jsx("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-5 w-5 border-b-2 border-blue-500 mr-3"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-blue-800",children:"Processing Images..."}),a.jsx("p",{className:"text-sm text-blue-700 mt-1",children:"Updating cache metadata for all images in Firebase Storage. This may take a few minutes."})]})]})}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h3",{className:"font-medium text-gray-900 mb-3",children:"🚀 What This Optimization Does"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(qe,{className:"w-5 h-5 text-blue-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800",children:"1 Year Browser Cache"}),a.jsx("p",{className:"text-sm text-gray-600",children:"Sets Cache-Control to cache images for 1 year"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(PN,{className:"w-5 h-5 text-yellow-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800",children:"Instant Loading"}),a.jsx("p",{className:"text-sm text-gray-600",children:"Images load instantly on repeat visits"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(VV,{className:"w-5 h-5 text-green-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800",children:"Reduced Bandwidth"}),a.jsx("p",{className:"text-sm text-gray-600",children:"Saves Firebase Storage bandwidth costs"})]})]}),a.jsxs("div",{className:"flex items-start space-x-3",children:[a.jsx(Ch,{className:"w-5 h-5 text-purple-500 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-gray-800",children:"CDN Optimization"}),a.jsx("p",{className:"text-sm text-gray-600",children:"Enables Google CDN caching worldwide"})]})]})]})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4",children:[a.jsx("h3",{className:"font-medium text-gray-900 mb-3",children:"📋 Cache Headers Applied"}),a.jsxs("div",{className:"bg-gray-800 text-gray-100 p-3 rounded font-mono text-sm",children:[a.jsx("div",{className:"text-green-400",children:"# Before (slow loading)"}),a.jsx("div",{className:"text-gray-300",children:"Cache-Control: no-cache"}),a.jsx("div",{className:"mt-2 text-green-400",children:"# After (lightning fast! ⚡)"}),a.jsx("div",{className:"text-yellow-300",children:"Cache-Control: public,max-age=31536000,immutable"})]})]}),s&&(r==null?void 0:r.success)&&a.jsxs("div",{className:"bg-gradient-to-r from-green-50 to-blue-50 border border-green-200 rounded-lg p-4",children:[a.jsx("h3",{className:"font-medium text-gray-900 mb-3",children:"✅ Performance Impact"}),a.jsxs("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600",children:"First Visit:"}),a.jsx("div",{className:"font-medium",children:"Normal loading speed"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600",children:"Return Visits:"}),a.jsx("div",{className:"font-medium text-green-600",children:"⚡ INSTANT loading!"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600",children:"Bandwidth Usage:"}),a.jsx("div",{className:"font-medium text-blue-600",children:"📉 Reduced by 80-90%"})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-gray-600",children:"User Experience:"}),a.jsx("div",{className:"font-medium text-purple-600",children:"🚀 Dramatically improved"})]})]})]}),a.jsx("div",{className:"bg-yellow-50 border border-yellow-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-yellow-600 mr-3 mt-0.5"}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-medium text-yellow-800",children:"Technical Note"}),a.jsx("p",{className:"text-sm text-yellow-700 mt-1",children:"This operation is safe and only adds cache headers to images. It doesn't modify the actual image files. You only need to run this once, and all future uploaded images will automatically have optimal cache settings."})]})]})})]})]})}function gte(){const{promoCodes:t,loading:e,error:r,addPromoCode:n,updatePromoCode:s,deletePromoCode:i,togglePromoCodeStatus:o}=z2(),{spaces:l,loading:c}=$y(),{rooms:u,loading:d}=Xm(),[h,m]=P.useState(!1),[p,x]=P.useState(null),[w,g]=P.useState("all"),[v,b]=P.useState([]),[y,T]=P.useState(!0),[N,j]=P.useState(!0),[_,S]=P.useState({code:"",description:"",type:"percentage",value:0,minAmount:"",maxDiscount:"",validFrom:he(new Date,"yyyy-MM-dd"),validUntil:he(new Date(new Date().setMonth(new Date().getMonth()+3)),"yyyy-MM-dd"),usageLimit:"",isActive:!0,showOnCards:!1,applicableFor:"all",specificItems:[]}),[k,I]=P.useState(null),E=async H=>{H.preventDefault(),I(null);try{if(_.applicableFor==="specific"&&v.length===0){I("Please select at least one space or room");return}const ee={code:_.code.toUpperCase(),description:_.description,type:_.type,value:_.type==="percentage"?Math.min(100,_.value):_.value,minAmount:_.minAmount?parseFloat(_.minAmount):null,maxDiscount:_.maxDiscount?parseFloat(_.maxDiscount):null,validFrom:_.validFrom,validUntil:_.validUntil,usageLimit:_.usageLimit?parseInt(_.usageLimit):null,isActive:_.isActive,showOnCards:_.showOnCards,applicableFor:_.applicableFor,specificItems:_.applicableFor==="specific"?v:[],usedCount:0};p?await s(p.id,{...ee,usedCount:p.usedCount}):await n(ee),S({code:"",description:"",type:"percentage",value:0,minAmount:"",maxDiscount:"",validFrom:he(new Date,"yyyy-MM-dd"),validUntil:he(new Date(new Date().setMonth(new Date().getMonth()+3)),"yyyy-MM-dd"),usageLimit:"",isActive:!0,showOnCards:!1,applicableFor:"all",specificItems:[]}),b([]),m(!1),x(null)}catch(ee){I(ee instanceof Error?ee.message:"Failed to save promo code")}},C=H=>{var ee,de,we;x(H),S({code:H.code,description:H.description,type:H.type,value:H.value,minAmount:((ee=H.minAmount)==null?void 0:ee.toString())||"",maxDiscount:((de=H.maxDiscount)==null?void 0:de.toString())||"",validFrom:H.validFrom,validUntil:H.validUntil,usageLimit:((we=H.usageLimit)==null?void 0:we.toString())||"",isActive:H.isActive,showOnCards:H.showOnCards||!1,applicableFor:H.applicableFor,specificItems:H.specificItems||[]}),b(H.specificItems||[]),m(!0)},R=async H=>{if(confirm("Are you sure you want to delete this promo code?"))try{await i(H)}catch{alert("Failed to delete promo code")}},W=async(H,ee)=>{try{await o(H,!ee)}catch{alert("Failed to update promo code status")}},M=H=>{switch(H){case"percentage":return KV;case"fixed_amount":return bu;default:return Ti}},L=H=>{switch(H){case"percentage":return"Percentage Discount";case"fixed_amount":return"Fixed Amount Discount";default:return"Unknown"}},U=H=>{switch(H.type){case"percentage":return`${H.value}%`;case"fixed_amount":return`€${H.value}`;default:return H.value}},V=H=>Pi(new Date,new Date(H.validUntil)),D=H=>LM(new Date,new Date(H.validFrom)),z=H=>
4488V(H)?"expired":D(H)?"upcoming":H.isActive?"active":"inactive",K=H=>{const ee=l.find(we=>we.id===H);if(ee)return{name:ee.title,type:"space"};const de=u.find(we=>we.id===H);return de?{name:de.title,type:"room"}:{name:"Unknown Item",type:"unknown"}},q=t.filter(H=>{switch(w){case"active":return H.isActive&&!V(H)&&!D(H);case"inactive":return!H.isActive&&!V(H);case"expired":return V(H);default:return!0}});return a.jsxs("div",{className:"bg-white rounded-xl shadow-card",children:[a.jsx("div",{className:"p-6 border-b border-gray-200",children:a.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center sm:justify-between gap-4",children:[a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-500 to-pink-600 rounded-lg flex items-center justify-center",children:a.jsx(Ti,{className:"w-5 h-5 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold text-gray-900",children:"Promo Codes"}),a.jsx("p",{className:"text-sm text-gray-500",children:"Manage discount codes"})]})]}),a.jsxs("div",{className:"flex space-x-3",children:[a.jsxs("select",{value:w,onChange:H=>g(H.target.value),className:"px-3 py-2 border rounded-lg text-sm bg-white",children:[a.jsx("option",{value:"all",children:"All Codes"}),a.jsx("option",{value:"active",children:"Active"}),a.jsx("option",{value:"inactive",children:"Inactive"}),a.jsx("option",{value:"expired",children:"Expired"})]}),a.jsxs("button",{onClick:()=>{x(null),S({code:"",description:"",type:"percentage",value:0,minAmount:"",maxDiscount:"",validFrom:he(new Date,"yyyy-MM-dd"),validUntil:he(new Date(new Date().setMonth(new Date().getMonth()+3)),"yyyy-MM-dd"),usageLimit:"",isActive:!0,showOnCards:!1,applicableFor:"all",specificItems:[]}),b([]),I(null),m(!0)},className:"flex items-center px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors",children:[a.jsx(Ut,{className:"w-4 h-4 mr-2"}),"Add Promo Code"]})]})]})}),e&&a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-10 w-10 border-b-2 border-purple-500 mx-auto mb-4"}),a.jsx("p",{className:"text-gray-500",children:"Loading promo codes..."})]}),r&&a.jsx("div",{className:"p-6",children:a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsx("span",{className:"text-sm text-red-700",children:r})]})})}),!e&&!r&&a.jsx("div",{className:"p-6",children:q.length>0?a.jsx("div",{className:"grid gap-4",children:q.map(H=>{const ee=M(H.type),de=z(H),we=H.usageLimit?H.usedCount/H.usageLimit*100:0;return a.jsx("div",{className:`border-2 rounded-xl p-6 transition-all ${de==="active"?"border-green-200 bg-green-50":de==="upcoming"?"border-blue-200 bg-blue-50":de==="expired"?"border-red-200 bg-red-50":"border-gray-200 bg-gray-50"}`,children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{className:"flex items-start space-x-4",children:[a.jsx("div",{className:`w-12 h-12 rounded-lg flex items-center justify-center ${H.type==="percentage"?"bg-blue-100 text-blue-600":"bg-green-100 text-green-600"}`,children:a.jsx(ee,{className:"w-6 h-6"})}),a.jsxs("div",{className:"flex-1",children:[a.jsxs("div",{className:"flex items-center space-x-3 mb-2",children:[a.jsx("h3",{className:"text-lg font-bold text-gray-900",children:H.code}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium ${de==="active"?"bg-green-100 text-green-800":de==="upcoming"?"bg-blue-100 text-blue-800":de==="expired"?"bg-red-100 text-red-800":"bg-gray-100 text-gray-800"}`,children:de==="active"?"Active":de==="upcoming"?"Upcoming":de==="expired"?"Expired":"Inactive"}),a.jsx("span",{className:`px-2 py-1 rounded-full text-xs font-medium flex items-center space-x-1 ${H.showOnCards?"bg-blue-100 text-blue-800":"bg-gray-100 text-gray-600"}`,title:H.showOnCards?"Visible on cards":"Hidden from cards",children:H.showOnCards?a.jsxs(a.Fragment,{children:[a.jsx(xr,{className:"w-3 h-3"}),a.jsx("span",{children:"Visible"})]}):a.jsxs(a.Fragment,{children:[a.jsx(qo,{className:"w-3 h-3"}),a.jsx("span",{children:"Hidden"})]})}),a.jsx("span",{className:"text-lg font-semibold text-purple-600",children:U(H
4488)})]}),a.jsx("p",{className:"text-gray-600 mb-3",children:H.description}),a.jsxs("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 text-sm",children:[a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Type:"}),a.jsx("p",{className:"font-medium",children:L(H.type)})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Valid Until:"}),a.jsx("p",{className:"font-medium",children:he(new Date(H.validUntil),"MMM d, yyyy")})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Usage:"}),a.jsxs("p",{className:"font-medium",children:[H.usedCount,H.usageLimit?` / ${H.usageLimit}`:" uses"]})]}),a.jsxs("div",{children:[a.jsx("span",{className:"text-gray-500",children:"Applies To:"}),a.jsx("p",{className:"font-medium capitalize",children:H.applicableFor})]})]}),H.applicableFor==="specific"&&H.specificItems&&H.specificItems.length>0&&a.jsxs("div",{className:"mt-3 pt-3 border-t border-gray-200",children:[a.jsx("h4",{className:"text-sm font-medium text-gray-700 mb-2",children:"Applied to:"}),a.jsx("div",{className:"flex flex-wrap gap-2",children:H.specificItems.map(Le=>{const ze=K(Le);return a.jsx("span",{className:`inline-flex items-center px-2 py-1 rounded-md text-xs font-medium ${ze.type==="space"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:ze.name},Le)})})]}),H.usageLimit&&a.jsxs("div",{className:"mt-3",children:[a.jsxs("div",{className:"flex justify-between text-xs text-gray-500 mb-1",children:[a.jsx("span",{children:"Usage Progress"}),a.jsxs("span",{children:[we.toFixed(1),"%"]})]}),a.jsx("div",{className:"w-full bg-gray-200 rounded-full h-2",children:a.jsx("div",{className:`h-2 rounded-full transition-all ${we>=90?"bg-red-500":we>=70?"bg-yellow-500":"bg-green-500"}`,style:{width:`${Math.min(we,100)}%`}})})]})]})]}),a.jsxs("div",{className:"flex items-center space-x-2",children:[de!=="expired"&&a.jsxs("label",{className:"relative inline-flex items-center cursor-pointer",children:[a.jsx("input",{type:"checkbox",checked:H.isActive,onChange:()=>W(H.id,H.isActive),disabled:de==="expired",className:"sr-only peer"}),a.jsx("div",{className:"w-11 h-6 bg-gray-200 peer-focus:outline-none peer-focus:ring-4 peer-focus:ring-purple-300 rounded-full peer peer-checked:after:translate-x-full peer-checked:after:border-white after:content-[''] after:absolute after:top-[2px] after:left-[2px] after:bg-white after:border-gray-300 after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-purple-600"})]}),a.jsx("button",{onClick:()=>C(H),className:"p-2 text-blue-600 hover:bg-blue-50 rounded-lg transition-colors",children:a.jsx(Nu,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>R(H.id),className:"p-2 text-red-600 hover:bg-red-50 rounded-lg transition-colors",children:a.jsx(_a,{className:"w-4 h-4"})})]})]})},H.id)})}):a.jsxs("div",{className:"text-center py-12",children:[a.jsx("div",{className:"w-16 h-16 bg-purple-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(Ti,{className:"w-8 h-8 text-purple-500"})}),w!=="all"?a.jsxs(a.Fragment,{children:[a.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:["No ",w," promo codes"]}),a.jsx("p",{className:"text-gray-500",children:"Try selecting a different filter or create a new promo code"})]}):a.jsxs(a.Fragment,{children:[a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No promo codes yet"}),a.jsx("p",{className:"text-gray-500 mb-4",children:"Create your first promo code to offer discounts"}),a.jsxs("button",{onClick:()=>m(!0),className:"px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors inline-flex items-center",children:[a.jsx(Ut,{className:"w-4 h-4 mr-2"}),"Create Promo Code"]})]})]})}),h&&a.jsx("div",{className:"fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center p-4 z-50",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-2xl max-h-[90vh] overflow-y-auto",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center",children:[a.jsx("h3",{className:"text-lg font-semibold",children:p?"Edit Promo Code":"Add New Promo Code"}),a.jsx("button",{onClick:()=>{m(!1),I(null)},className:"text-gray-400 hover:text-gray-500 transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsxs("form",{onSubmit:E,className:"p-6 space-y-6",children:[k&&a.jsx("div",{className:"bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsx("span",{className:"text-sm text-red-700",children:k})]})}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Promo Code *"}),a.jsx("input",{type:"text",value:_.code,onChange:H=>S(ee=>({...ee,code:H.target.value.toUpperCase()})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"WELCOME20",required:!0}),a.jsx("p",{className:"text-xs text-gray-500 mt-1",children:"Uppercase letters and numbers only"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Type *"}
4488),a.jsxs("select",{value:_.type,onChange:H=>S(ee=>({...ee,type:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white",required:!0,children:[a.jsx("option",{value:"percentage",children:"Percentage Discount"}),a.jsx("option",{value:"fixed_amount",children:"Fixed Amount Discount"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Description *"}),a.jsx("input",{type:"text",value:_.description,onChange:H=>S(ee=>({...ee,description:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"20% off first month",required:!0})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:[_.type==="percentage"?"Percentage (%)":"Amount (€)"," *"]}),a.jsx("input",{type:"number",value:_.value,onChange:H=>S(ee=>({...ee,value:parseFloat(H.target.value)})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",min:"0",max:_.type==="percentage"?100:void 0,step:_.type==="percentage"?"1":"0.01",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Applies To *"}),a.jsxs("select",{value:_.applicableFor,onChange:H=>S(ee=>({...ee,applicableFor:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent bg-white",required:!0,children:[a.jsx("option",{value:"all",children:"All Services"}),a.jsx("option",{value:"spaces",children:"Workspaces Only"}),a.jsx("option",{value:"rooms",children:"Meeting Rooms Only"}),a.jsx("option",{value:"specific",children:"Specific Items"})]})]})]}),_.applicableFor==="specific"&&a.jsxs("div",{className:"border border-gray-200 rounded-lg p-4 bg-gray-50",children:[a.jsx("h4",{className:"text-sm font-medium text-gray-800 mb-3",children:"Select Specific Items *"}),(c||d)&&a.jsx("div",{className:"flex justify-center py-4",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-purple-500"})}),!c&&!d&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border border-gray-200 rounded-lg bg-white overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer",onClick:()=>T(!y),children:[a.jsxs("h4",{className:"font-medium text-gray-700",children:["Workspaces (",l.length,")"]}),a.jsx("button",{type:"button",className:"text-gray-500",children:y?a.jsx(fg,{className:"w-4 h-4"}):a.jsx(zo,{className:"w-4 h-4"})})]}),y&&a.jsx("div",{className:"p-3 max-h-48 overflow-y-auto",children:l.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:l.map(H=>a.jsxs("label",{className:"flex items-center space-x-2 p-2 border rounded-lg hover:bg-gray-50",children:[a.jsx("input",{type:"checkbox",checked:v.includes(H.id),onChange:ee=>{b(de=>ee.target.checked?[...de,H.id]:de.filter(we=>we!==H.id))},className:"rounded text-purple-500 focus:ring-purple-500"}),a.jsx("span",{className:"text-sm",children:H.title})]},H.id))}):a.jsx("p",{className:"text-sm text-gray-500 text-center py-2",children:"No workspaces available"})})]}),a.jsxs("div",{className:"border border-gray-200 rounded-lg bg-white overflow-hidden",children:[a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 cursor-pointer",onClick:()=>j(!N),children:[a.jsxs("h4",{className:"font-medium text-gray-700",children:["Meeting Rooms (",u.length,")"]}),a.jsx("button",{type:"button",className:"text-gray-500",children:N?a.jsx(fg,{className:"w-4 h-4"}):a.jsx(zo,{className:"w-4 h-4"})})]}),N&&a.jsx("div",{className:"p-3 max-h-48 overflow-y-auto",children:u.length>0?a.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:u.map(H=>a.jsxs("label",{className:"flex items-center space-x-2 p-2 border rounded-lg hover:bg-gray-50",children:[a.jsx("input",{type:"checkbox",checked:v.includes(H.id),onChange:ee=>{b(de=>ee.target.checked?[...de,H.id]:de.filter(we=>we!==H.id))},className:"rounded text-purple-500 focus:ring-purple-500"}),a.jsx("span",{className:"text-sm",children:H.title})]},H.id))}):a.jsx("p",{className:"text-sm text-gray-500 text-center py-2",children:"No meeting rooms available"})})]}),a.jsxs("div",{className:"bg-purple-50 p-3 rounded-lg",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("span",{className:"text-sm font-medium text-purple-700",children:[v.length," item",v.length!==1?"s":""," selected"]}),v.length>0&&a.jsx("button",{type:"button",onClick:()=>b([]),className:"text-xs text-purple-600 hover:text-purple-800",children:"Clear All"})]}),v.length===0&&a.jsx("p",{className:"text-xs text-purple-600 mt-1",children:"Please select at least one space or room"})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Valid From *"}),a.jsx("input",{type:"date",value:_.validFrom,onChange:H=>S(ee=>({...ee,validFrom:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",required:!0})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Valid Until *"}
4488),a.jsx("input",{type:"date",value:_.validUntil,onChange:H=>S(ee=>({...ee,validUntil:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",required:!0,min:_.validFrom})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Usage Limit"}),a.jsx("input",{type:"number",value:_.usageLimit,onChange:H=>S(ee=>({...ee,usageLimit:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"Leave empty for unlimited",min:"1"})]}),_.type==="percentage"&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Max Discount (€)"}),a.jsx("input",{type:"number",value:_.maxDiscount,onChange:H=>S(ee=>({...ee,maxDiscount:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"Optional",min:"0",step:"0.01"})]}),_.type==="fixed_amount"&&a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Min Purchase Amount (€)"}),a.jsx("input",{type:"number",value:_.minAmount,onChange:H=>S(ee=>({...ee,minAmount:H.target.value})),className:"w-full p-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-purple-500 focus:border-transparent",placeholder:"Optional",min:"0",step:"0.01"})]})]}),a.jsxs("div",{className:"pt-2 space-y-3",children:[a.jsxs("div",{children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:_.isActive,onChange:H=>S(ee=>({...ee,isActive:H.target.checked})),className:"rounded text-purple-500 focus:ring-purple-500"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Active"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:"Inactive codes will not be usable even if they are within their valid date range"})]}),a.jsxs("div",{children:[a.jsxs("label",{className:"flex items-center space-x-2",children:[a.jsx("input",{type:"checkbox",checked:_.showOnCards,onChange:H=>S(ee=>({...ee,showOnCards:H.target.checked})),className:"rounded text-purple-500 focus:ring-purple-500"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Show on Cards"})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-1 ml-6",children:"Display this promo code badge on space/room cards in the frontend"})]})]}),a.jsxs("div",{className:"flex justify-end space-x-4 pt-4 border-t",children:[a.jsx("button",{type:"button",onClick:()=>{m(!1),I(null)},className:"px-4 py-2 border border-gray-300 rounded-lg text-gray-700 hover:bg-gray-50 transition-colors",children:"Cancel"}),a.jsx("button",{type:"submit",className:"px-4 py-2 bg-purple-500 text-white rounded-lg hover:bg-purple-600 transition-colors",children:p?"Update Code":"Create Code"})]})]})]})})]})}function s6(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var s=t.length;for(e=0;e<s;e++)t[e]&&(r=s6(t[e]))&&(n&&(n+=" "),n+=r)}else for(r in t)t[r]&&(n&&(n+=" "),n+=r);return n}function Me(){for(var t,e,r=0,n="",s=arguments.length;r<s;r++)(t=arguments[r])&&(e=s6(t))&&(n&&(n+=" "),n+=e);return n}var xte=Array.isArray,yn=xte,yte=typeof jf=="object"&&jf&&jf.Object===Object&&jf,i6=yte,vte=i6,bte=typeof self=="object"&&self&&self.Object===Object&&self,wte=vte||bte||Function("return this")(),Ja=wte,jte=Ja,Nte=jte.Symbol,Ym=Nte,jk=Ym,o6=Object.prototype,_te=o6.hasOwnProperty,Ste=o6.toString,bd=jk?jk.toStringTag:void 0;function Tte(t){var e=_te.call(t,bd),r=t[bd];try{t[bd]=void 0;var n=!0}catch{}var s=Ste.call(t);return n&&(e?t[bd]=r:delete t[bd]),s}var Ate=Tte,Ete=Object.prototype,kte=Ete.toString;function Pte(t){return kte.call(t)}var Cte=Pte,Nk=Ym,Ite=Ate,Ote=Cte,Rte="[object Null]",Dte="[object Undefined]",_k=Nk?Nk.toStringTag:void 0;function Mte(t){return t==null?t===void 0?Dte:Rte:_k&&_k in Object(t)?Ite(t):Ote(t)}var Fs=Mte;function $te(t){return t!=null&&typeof t=="object"}var Bs=$te,Lte=Fs,Fte=Bs,Bte="[object Symbol]";function Vte(t){return typeof t=="symbol"||Fte(t)&&Lte(t)==Bte}var Cu=Vte,Ute=yn,zte=Cu,Hte=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qte=/^\w*$/;function Wte(t,e){if(Ute(t))return!1;var r=typeof t;
vendor: 4,476 bytes, line 4488
4488return r=="number"||r=="symbol"||r=="boolean"||t==null||zte(t)?!0:qte.test(t)||!Hte.test(t)||e!=null&&t in Object(e)}var G2=Wte;function Gte(t){var e=typeof t;return t!=null&&(e=="object"||e=="function")}var Wi=Gte;const Iu=nt(Wi);var Kte=Fs,Xte=Wi,Yte="[object AsyncFunction]",Qte="[object Function]",Jte="[object GeneratorFunction]",Zte="[object Proxy]";function ere(t){if(!Xte(t))return!1;var e=Kte(t);return e==Qte||e==Jte||e==Yte||e==Zte}var K2=ere;const Ee=nt(K2);var tre=Ja,rre=tre["__core-js_shared__"],nre=rre,q0=nre,Sk=function(){var t=/[^.]+$/.exec(q0&&q0.keys&&q0.keys.IE_PROTO||"");return t?"Symbol(src)_1."+t:""}();function are(t){return!!Sk&&Sk in t}var sre=are,ire=Function.prototype,ore=ire.toString;function lre(t){if(t!=null){try{return ore.call(t)}catch{}try{return t+""}catch{}}return""}var l6=lre,cre=K2,ure=sre,dre=Wi,hre=l6,mre=/[\\^$.*+?()[\]{}|]/g,fre=/^\[object .+?Constructor\]$/,pre=Function.prototype,gre=Object.prototype,xre=pre.toString,yre=gre.hasOwnProperty,vre=RegExp("^"+xre.call(yre).replace(mre,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function bre(t){if(!dre(t)||ure(t))return!1;var e=cre(t)?vre:fre;return e.test(hre(t))}var wre=bre;function jre(t,e){return t==null?void 0:t[e]}var Nre=jre,_re=wre,Sre=Nre;function Tre(t,e){var r=Sre(t,e);return _re(r)?r:void 0}var jl=Tre,Are=jl,Ere=Are(Object,"create"),Ly=Ere,Tk=Ly;function kre(){this.__data__=Tk?Tk(null):{},this.size=0}var Pre=kre;function Cre(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e}var Ire=Cre,Ore=Ly,Rre="__lodash_hash_undefined__",Dre=Object.prototype,Mre=Dre.hasOwnProperty;function $re(t){var e=this.__data__;if(Ore){var r=e[t];return r===Rre?void 0:r}return Mre.call(e,t)?e[t]:void 0}var Lre=$re,Fre=Ly,Bre=Object.prototype,Vre=Bre.hasOwnProperty;function Ure(t){var e=this.__data__;return Fre?e[t]!==void 0:Vre.call(e,t)}var zre=Ure,Hre=Ly,qre="__lodash_hash_undefined__";function Wre(t,e){var r=this.__data__;return this.size+=this.has(t)?0:1,r[t]=Hre&&e===void 0?qre:e,this}var Gre=Wre,Kre=Pre,Xre=Ire,Yre=Lre,Qre=zre,Jre=Gre;function Ou(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ou.prototype.clear=Kre;Ou.prototype.delete=Xre;Ou.prototype.get=Yre;Ou.prototype.has=Qre;Ou.prototype.set=Jre;var Zre=Ou;function ene(){this.__data__=[],this.size=0}var tne=ene;function rne(t,e){return t===e||t!==t&&e!==e}var X2=rne,nne=X2;function ane(t,e){for(var r=t.length;r--;)if(nne(t[r][0],e))return r;return-1}var Fy=ane,sne=Fy,ine=Array.prototype,one=ine.splice;function lne(t){var e=this.__data__,r=sne(e,t);if(r<0)return!1;var n=e.length-1;return r==n?e.pop():one.call(e,r,1),--this.size,!0}var cne=lne,une=Fy;function dne(t){var e=this.__data__,r=une(e,t);return r<0?void 0:e[r][1]}var hne=dne,mne=Fy;function fne(t){return mne(this.__data__,t)>-1}var pne=fne,gne=Fy;function xne(t,e){var r=this.__data__,n=gne(r,t);return n<0?(++this.size,r.push([t,e])):r[n][1]=e,this}var yne=xne,vne=tne,bne=cne,wne=hne,jne=pne,Nne=yne;function Ru(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Ru.prototype.clear=vne;Ru.prototype.delete=bne;Ru.prototype.get=wne;Ru.prototype.has=jne;Ru.prototype.set=Nne;var By=Ru,_ne=jl,Sne=Ja,Tne=_ne(Sne,"Map"),Y2=Tne,Ak=Zre,Ane=By,Ene=Y2;function kne(){this.size=0,this.__data__={hash:new Ak,map:new(Ene||Ane),string:new Ak}}var Pne=kne;function Cne(t){var e=typeof t;return e=="string"||e=="number"||e=="symbol"||e=="boolean"?t!=="__proto__":t===null}var Ine=Cne,One=Ine;function Rne(t,e){var r=t.__data__;return One(e)?r[typeof e=="string"?"string":"hash"]:r.map}var Vy=Rne,Dne=Vy;function Mne(t){var e=Dne(this,t).delete(t);return this.size-=e?1:0,e}var $ne=Mne,Lne=Vy;function Fne(t){return Lne(this,t).get(t)}var Bne=Fne,Vne=Vy;function Une(t){return Vne(this,t).has(t)}var zne=Une,Hne=Vy;function qne(t,e){var r=Hne(this,t),n=r.size;return r.set(t,e),this.size+=r.size==n?0:1,this}var Wne=qne,Gne=Pne,Kne=$ne,Xne=Bne,Yne=zne,Qne=Wne;function Du(t){var e=-1,r=t==null?0:t.length;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}Du.prototype.clear=Gne;Du.prototype.delete=Kne;Du.prototype.get=Xne;Du.prototype.has=Yne;Du.prototype.set=Qne;var Q2=Du,c6=Q2,Jne="Expected a function";function J2(t,e){if(typeof t!="function"||e!=null&&typeof e!="function")throw new TypeError(Jne);var r=function(){var n=arguments,s=e?e.apply(this,n):n[0],i=r.cache;if(i.has(s))return i.get(s);
vendor: 6,954 bytes, lines 4488-4496
4488var o=t.apply(this,n);return r.cache=i.set(s,o)||i,o};return r.cache=new(J2.Cache||c6),r}J2.Cache=c6;var u6=J2;const Zne=nt(u6);var eae=u6,tae=500;function rae(t){var e=eae(t,function(n){return r.size===tae&&r.clear(),n}),r=e.cache;return e}var nae=rae,aae=nae,sae=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,iae=/\\(\\)?/g,oae=aae(function(t){var e=[];return t.charCodeAt(0)===46&&e.push(""),t.replace(sae,function(r,n,s,i){e.push(s?i.replace(iae,"$1"):n||r)}),e}),lae=oae;function cae(t,e){for(var r=-1,n=t==null?0:t.length,s=Array(n);++r<n;)s[r]=e(t[r],r,t);return s}var Z2=cae,Ek=Ym,uae=Z2,dae=yn,hae=Cu,kk=Ek?Ek.prototype:void 0,Pk=kk?kk.toString:void 0;function d6(t){if(typeof t=="string")return t;if(dae(t))return uae(t,d6)+"";if(hae(t))return Pk?Pk.call(t):"";var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var mae=d6,fae=mae;function pae(t){return t==null?"":fae(t)}var h6=pae,gae=yn,xae=G2,yae=lae,vae=h6;function bae(t,e){return gae(t)?t:xae(t,e)?[t]:yae(vae(t))}var m6=bae,wae=Cu;function jae(t){if(typeof t=="string"||wae(t))return t;var e=t+"";return e=="0"&&1/t==-1/0?"-0":e}var Uy=jae,Nae=m6,_ae=Uy;function Sae(t,e){e=Nae(e,t);for(var r=0,n=e.length;t!=null&&r<n;)t=t[_ae(e[r++])];return r&&r==n?t:void 0}var e_=Sae,Tae=e_;function Aae(t,e,r){var n=t==null?void 0:Tae(t,e);return n===void 0?r:n}var f6=Aae;const Cn=nt(f6);function Eae(t){return t==null}var kae=Eae;const Ie=nt(kae);var Pae=Fs,Cae=yn,Iae=Bs,Oae="[object String]";function Rae(t){return typeof t=="string"||!Cae(t)&&Iae(t)&&Pae(t)==Oae}var Dae=Rae;const al=nt(Dae);var p6={exports:{}},mt={};/**
4489 * @license React
4490 * react-is.production.min.js
4491 *
4492 * Copyright (c) Facebook, Inc. and its affiliates.
4493 *
4494 * This source code is licensed under the MIT license found in the
4495 * LICENSE file in the root directory of this source tree.
4496 */var t_=Symbol.for("react.element"),r_=Symbol.for("react.portal"),zy=Symbol.for("react.fragment"),Hy=Symbol.for("react.strict_mode"),qy=Symbol.for("react.profiler"),Wy=Symbol.for("react.provider"),Gy=Symbol.for("react.context"),Mae=Symbol.for("react.server_context"),Ky=Symbol.for("react.forward_ref"),Xy=Symbol.for("react.suspense"),Yy=Symbol.for("react.suspense_list"),Qy=Symbol.for("react.memo"),Jy=Symbol.for("react.lazy"),$ae=Symbol.for("react.offscreen"),g6;g6=Symbol.for("react.module.reference");function ea(t){if(typeof t=="object"&&t!==null){var e=t.$$typeof;switch(e){case t_:switch(t=t.type,t){case zy:case qy:case Hy:case Xy:case Yy:return t;default:switch(t=t&&t.$$typeof,t){case Mae:case Gy:case Ky:case Jy:case Qy:case Wy:return t;default:return e}}case r_:return e}}}mt.ContextConsumer=Gy;mt.ContextProvider=Wy;mt.Element=t_;mt.ForwardRef=Ky;mt.Fragment=zy;mt.Lazy=Jy;mt.Memo=Qy;mt.Portal=r_;mt.Profiler=qy;mt.StrictMode=Hy;mt.Suspense=Xy;mt.SuspenseList=Yy;mt.isAsyncMode=function(){return!1};mt.isConcurrentMode=function(){return!1};mt.isContextConsumer=function(t){return ea(t)===Gy};mt.isContextProvider=function(t){return ea(t)===Wy};mt.isElement=function(t){return typeof t=="object"&&t!==null&&t.$$typeof===t_};mt.isForwardRef=function(t){return ea(t)===Ky};mt.isFragment=function(t){return ea(t)===zy};mt.isLazy=function(t){return ea(t)===Jy};mt.isMemo=function(t){return ea(t)===Qy};mt.isPortal=function(t){return ea(t)===r_};mt.isProfiler=function(t){return ea(t)===qy};mt.isStrictMode=function(t){return ea(t)===Hy};mt.isSuspense=function(t){return ea(t)===Xy};mt.isSuspenseList=function(t){return ea(t)===Yy};mt.isValidElementType=function(t){return typeof t=="string"||typeof t=="function"||t===zy||t===qy||t===Hy||t===Xy||t===Yy||t===$ae||typeof t=="object"&&t!==null&&(t.$$typeof===Jy||t.$$typeof===Qy||t.$$typeof===Wy||t.$$typeof===Gy||t.$$typeof===Ky||t.$$typeof===g6||t.getModuleId!==void 0)};mt.typeOf=ea;p6.exports=mt;var Lae=p6.exports,Fae=Fs,Bae=Bs,Vae="[object Number]";function Uae(t){return typeof t=="number"||Bae(t)&&Fae(t)==Vae}var x6=Uae;const zae=nt(x6);var Hae=x6;function qae(t){return Hae(t)&&t!=+t}var Wae=qae;const Mu=nt(Wae);var Jr=function(e){return e===0?0:e>0?1:-1},jo=function(e){return al(e)&&e.indexOf("%")===e.length-1},ie=function(e){return zae(e)&&!Mu(e)},Gae=function(e){return Ie(e)},lr=function(e){return ie(e)||al(e)},Kae=0,Nl=function(e){var r=++Kae;return"".concat(e||"").concat(r)},Zr=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!ie(e)&&!al(e))return n;var i;if(jo(e)){var o=e.indexOf("%");i=r*parseFloat(e.slice(0,o))/100}else i=+e;return Mu(i)&&(i=n),s&&i>r&&(i=r),i},oi=function(e){if(!e)return null;var r=Object.keys(e);return r&&r.length?e[r[0]]:null},Xae=function(e){if(!Array.isArray(e))return!1;for(var r=e.length,n={},s=0;s<r;s++)if(!n[e[s]])n[e[s]]=!0;else return!0;return!1},ir=function(e,r){return ie(e)&&ie(r)?function(n){return e+n*(r-e)}:function(){return r}};function Fg(t,e,r){return!t||!t.length?null:t.find(function(n){return n&&(typeof e=="function"?e(n):Cn(n,e))===r})}var Yae=function(e,r){return ie(e)&&ie(r)?e-r:al(e)&&al(r)?e.localeCompare(r):e instanceof Date&&r instanceof Date?e.getTime()-r.getTime():String(e).localeCompare(String(r))};function bc(t,e){for(var r in t)if({}.hasOwnProperty.call(t,r)&&(!{}.hasOwnProperty.call(e,r)||t[r]!==e[r]))return!1;for(var n in e)if({}.hasOwnProperty.call(e,n)&&!{}.hasOwnProperty.call(t,n))return!1;return!0}function ej(t){"@babel/helpers - typeof";return ej=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ej(t)}var Qae=["viewBox","children"],Jae=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRen
4496dering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Ck=["points","pathLength"],W0={svg:Qae,polygon:Ck,polyline:Ck},n_=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onFocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDrag
4496Capture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"],Bg=function(e,r){if(!e||typeof e=="function"||typeof e=="boolean")return null;var n=e;if(P.isValidElement(e)&&(n=e.props),!Iu(n))return null;var s={};return Object.keys(n).forEach(function(i){n_.includes(i)&&(s[i]=r||function(o){return n[i](n,o)})}),s},Zae=function(e,r,n){return function(s){return e(r,n,s),null}},sl=function(e,r,n){if(!Iu(e)||ej(e)!=="object")return null;var s=null;return Object.keys(e).forEach(function(i){var o=e[i];n_.includes(i)&&typeof o=="function"&&(s||(s={}),s[i]=Zae(o,r,n))}),s},ese=["children"],tse=["children"];function Ik(t,e){if(t==null)return{};var r=rse(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function rse(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function tj(t){"@babel/helpers - typeof";return tj=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tj(t)}var Ok={click:"onClick",mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",mouseout:"onMouseOut",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",touchcancel:"onTouchCancel",touchend:"onTouchEnd",touchmove:"onTouchMove",touchstart:"onTouchStart",contextmenu:"onContextMenu",dblclick:"onDoubleClick"},bs=function(e){return typeof e=="string"?e:e?e.displayName||e.name||"Component":""},Rk=null,G0=null,a_=function t(e){if(e===Rk&&Array.isArray(G0))return G0;var r=[];return P.Children.forEach(e,function(n){Ie(n)||(Lae.isFragment(n)?r=r.concat(t(n.props.children)):r.push(n))}),G0=r,Rk=e,r};function In(t,e){var r=[],n=[];return Array.isArray(e)?n=e.map(function(s){return bs(s)}):n=[bs(e)],a_(t).forEach(function(s){var i=Cn(s,"type.displayName")||Cn(s,"type.name");n.indexOf(i)!==-1&&r.push(s)}),r}function _n(t,e){var r=In(t,e);return r&&r[0]}var Dk=function(e){if(!e||!e.props)return!1;var r=e.props,n=r.width,s=r.height;return!(!ie(n)||n<=0||!ie(s)||s<=0)},nse=["a","altGlyph","altGlyphDef","altGlyphItem","animate","animateColor","animateMotion","animateTransform","circle","clipPath","color-profile","cursor","defs","desc","ellipse","feBlend","feColormatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence","filter","font","font-face","font-face-format","font-face-name","font-face-url","foreignObject","g","glyph","glyphRef","hkern","image","line","lineGradient","marker","mask","metadata","missing-glyph","mpath","path","pattern","polygon","polyline","radialGradient","rect","script","set","stop","style","svg","switch","symbol","text","textPath","title","tref","tspan","use","view","vkern"],ase=function(e){return e&&e.type&&al(e.type)&&nse.indexOf(e.type)>=0},y6=function(e){return e&&tj(e)==="object"&&"clipDot"in e},sse=function(e,r,n,s){var i,o=(i=W0==null?void 0:W0[s])!==null&&i!==void 0?i:[];return r.startsWith("data-")||!Ee(e)&&(s&&o.includes(r)||Jae.includes(r))||n&&n_.includes(r)},je=function(e,r,n){if(!e||typeof e=="function"||typeof e=="boolean")return null;var s=e;if(P.isValidElement(e)&&(s=e.props),!Iu(s))return null;var i={};
4496return Object.keys(s).forEach(function(o){var l;sse((l=s)===null||l===void 0?void 0:l[o],o,r,n)&&(i[o]=s[o])}),i},rj=function t(e,r){if(e===r)return!0;var n=P.Children.count(e);if(n!==P.Children.count(r))return!1;if(n===0)return!0;if(n===1)return Mk(Array.isArray(e)?e[0]:e,Array.isArray(r)?r[0]:r);for(var s=0;s<n;s++){var i=e[s],o=r[s];if(Array.isArray(i)||Array.isArray(o)){if(!t(i,o))return!1}else if(!Mk(i,o))return!1}return!0},Mk=function(e,r){if(Ie(e)&&Ie(r))return!0;if(!Ie(e)&&!Ie(r)){var n=e.props||{},s=n.children,i=Ik(n,ese),o=r.props||{},l=o.children,c=Ik(o,tse);return s&&l?bc(i,c)&&rj(s,l):!s&&!l?bc(i,c):!1}return!1},$k=function(e,r){var n=[],s={};return a_(e).forEach(function(i,o){if(ase(i))n.push(i);else if(i){var l=bs(i.type),c=r[l]||{},u=c.handler,d=c.once;if(u&&(!d||!s[l])){var h=u(i,l,o);n.push(h),s[l]=!0}}}),n},ise=function(e){var r=e&&e.type;return r&&Ok[r]?Ok[r]:null},ose=function(e,r){return a_(r).indexOf(e)},lse=["children","width","height","viewBox","className","style","title","desc"];function nj(){return nj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nj.apply(this,arguments)}function cse(t,e){if(t==null)return{};var r=use(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function use(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function aj(t){var e=t.children,r=t.width,n=t.height,s=t.viewBox,i=t.className,o=t.style,l=t.title,c=t.desc,u=cse(t,lse),d=s||{width:r,height:n,x:0,y:0},h=Me("recharts-surface",i);return F.createElement("svg",nj({},je(u,!0,"svg"),{className:h,width:r,height:n,style:o,viewBox:"".concat(d.x," ").concat(d.y," ").concat(d.width," ").concat(d.height)}),F.createElement("title",null,l),F.createElement("desc",null,c),e)}var dse=["children","className"];function sj(){return sj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sj.apply(this,arguments)}function hse(t,e){if(t==null)return{};var r=mse(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function mse(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var Ve=F.forwardRef(function(t,e){var r=t.children,n=t.className,s=hse(t,dse),i=Me("recharts-layer",n);return F.createElement("g",sj({className:i},je(s,!0),{ref:e}),r)}),fa=function(e,r){for(var n=arguments.length,s=new Array(n>2?n-2:0),i=2;i<n;i++)s[i-2]=arguments[i]};function fse(t,e,r){var n=-1,s=t.length;e<0&&(e=-e>s?0:s+e),r=r>s?s:r,r<0&&(r+=s),s=e>r?0:r-e>>>0,e>>>=0;for(var i=Array(s);++n<s;)i[n]=t[n+e];return i}var pse=fse,gse=pse;function xse(t,e,r){var n=t.length;return r=r===void 0?n:r,!e&&r>=n?t:gse(t,e,r)}var yse=xse,vse="\\ud800-\\udfff",bse="\\u0300-\\u036f",wse="\\ufe20-\\ufe2f",jse="\\u20d0-\\u20ff",Nse=bse+wse+jse,_se="\\ufe0e\\ufe0f",Sse="\\u200d",Tse=RegExp("["+Sse+vse+Nse+_se+"]");function Ase(t){return Tse.test(t)}var v6=Ase;function Ese(t){return t.split("")}var kse=Ese,b6="\\ud800-\\udfff",Pse="\\u0300-\\u036f",Cse="\\ufe20-\\ufe2f",Ise="\\u20d0-\\u20ff",Ose=Pse+Cse+Ise,Rse="\\ufe0e\\ufe0f",Dse="["+b6+"]",ij="["+Ose+"]",oj="\\ud83c[\\udffb-\\udfff]",Mse="(?:"+ij+"|"+oj+")",w6="[^"+b6+"]",j6="(?:\\ud83c[\\udde6-\\uddff]){2}",N6="[\\ud800-\\udbff][\\udc00-\\udfff]",$se="\\u200d",_6=Mse+"?",S6="["+Rse+"]?",Lse="(?:"+$se+"(?:"+[w6,j6,N6].join("|")+")"+S6+_6+")*",Fse=S6+_6+Lse,Bse="(?:"+[w6+ij+"?",ij,j6,N6,Dse].join("|")+")",Vse=RegExp(oj+"(?="+oj+")|"+Bse+Fse,"g");function Use(t){return t.match(Vse)||[]}var zse=Use,Hse=kse,qse=v6,Wse=zse;function Gse(t){return qse(t)?Wse(t):Hse(t)}var Kse=Gse,Xse=yse,Yse=v6,Qse=Kse,Jse=h6;function Zse(t){return function(e){e=Jse(e);var r=Yse(e)?Qse(e):void 0,n=r?r[0]:e.charAt(0),s=r?Xse(r,1).join(""):e.slice(1);return n[t]()+s}}var eie=Zse,tie=eie,rie=tie("toUpperCase"),nie=rie;const Zy=nt(nie);function vt(t){return function(){return t}}const T6=Math.cos,Vg=Math.sin,Sa=Math.sqrt,Ug=Math.PI,ev=2*Ug,lj=Math.PI,cj=2*lj,ho=1e-6,aie=cj-ho;function A6(t){this._+=t[0];for(let e=1,r=t.length;e<r;++e)this._+=arguments[e]+t[e]}function sie(t){let e=Math.floor(t);if(!(e>=0))throw new Error(`invalid digits: ${t}`);if(e>15)return A6;const r=10**e;return function(n){this._+=n[0];for(let s=1,i=n.length;s<i;++s)this._+=Math.round(arguments[s]*r)/r+n[s]}}class iie{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?A6:sie(e)}moveTo(e,r){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,r){this._append`L${this._x1=+e},${this._y1=+r}`}quadraticCurveTo(e,r,n,s){this._append`Q${+e},${+r},${this._x1=+n},${this._y1=+s}`}bezierCurveTo(e,r,n,s,i,o){this._append`C${+e},${+r},${+n}
4496,${+s},${this._x1=+i},${this._y1=+o}`}arcTo(e,r,n,s,i){if(e=+e,r=+r,n=+n,s=+s,i=+i,i<0)throw new Error(`negative radius: ${i}`);let o=this._x1,l=this._y1,c=n-e,u=s-r,d=o-e,h=l-r,m=d*d+h*h;if(this._x1===null)this._append`M${this._x1=e},${this._y1=r}`;else if(m>ho)if(!(Math.abs(h*c-u*d)>ho)||!i)this._append`L${this._x1=e},${this._y1=r}`;else{let p=n-o,x=s-l,w=c*c+u*u,g=p*p+x*x,v=Math.sqrt(w),b=Math.sqrt(m),y=i*Math.tan((lj-Math.acos((w+m-g)/(2*v*b)))/2),T=y/b,N=y/v;Math.abs(T-1)>ho&&this._append`L${e+T*d},${r+T*h}`,this._append`A${i},${i},0,0,${+(h*p>d*x)},${this._x1=e+N*c},${this._y1=r+N*u}`}}arc(e,r,n,s,i,o){if(e=+e,r=+r,n=+n,o=!!o,n<0)throw new Error(`negative radius: ${n}`);let l=n*Math.cos(s),c=n*Math.sin(s),u=e+l,d=r+c,h=1^o,m=o?s-i:i-s;this._x1===null?this._append`M${u},${d}`:(Math.abs(this._x1-u)>ho||Math.abs(this._y1-d)>ho)&&this._append`L${u},${d}`,n&&(m<0&&(m=m%cj+cj),m>aie?this._append`A${n},${n},0,1,${h},${e-l},${r-c}A${n},${n},0,1,${h},${this._x1=u},${this._y1=d}`:m>ho&&this._append`A${n},${n},0,${+(m>=lj)},${h},${this._x1=e+n*Math.cos(i)},${this._y1=r+n*Math.sin(i)}`)}rect(e,r,n,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+r}h${n=+n}v${+s}h${-n}Z`}toString(){return this._}}function s_(t){let e=3;return t.digits=function(r){if(!arguments.length)return e;if(r==null)e=null;else{const n=Math.floor(r);if(!(n>=0))throw new RangeError(`invalid digits: ${r}`);e=n}return t},()=>new iie(e)}function i_(t){return typeof t=="object"&&"length"in t?t:Array.from(t)}function E6(t){this._context=t}E6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:this._context.lineTo(t,e);break}}};function tv(t){return new E6(t)}function k6(t){return t[0]}function P6(t){return t[1]}function C6(t,e){var r=vt(!0),n=null,s=tv,i=null,o=s_(l);t=typeof t=="function"?t:t===void 0?k6:vt(t),e=typeof e=="function"?e:e===void 0?P6:vt(e);function l(c){var u,d=(c=i_(c)).length,h,m=!1,p;for(n==null&&(i=s(p=o())),u=0;u<=d;++u)!(u<d&&r(h=c[u],u,c))===m&&((m=!m)?i.lineStart():i.lineEnd()),m&&i.point(+t(h,u,c),+e(h,u,c));if(p)return i=null,p+""||null}return l.x=function(c){return arguments.length?(t=typeof c=="function"?c:vt(+c),l):t},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:vt(+c),l):e},l.defined=function(c){return arguments.length?(r=typeof c=="function"?c:vt(!!c),l):r},l.curve=function(c){return arguments.length?(s=c,n!=null&&(i=s(n)),l):s},l.context=function(c){return arguments.length?(c==null?n=i=null:i=s(n=c),l):n},l}function Qf(t,e,r){var n=null,s=vt(!0),i=null,o=tv,l=null,c=s_(u);t=typeof t=="function"?t:t===void 0?k6:vt(+t),e=typeof e=="function"?e:vt(e===void 0?0:+e),r=typeof r=="function"?r:r===void 0?P6:vt(+r);function u(h){var m,p,x,w=(h=i_(h)).length,g,v=!1,b,y=new Array(w),T=new Array(w);for(i==null&&(l=o(b=c())),m=0;m<=w;++m){if(!(m<w&&s(g=h[m],m,h))===v)if(v=!v)p=m,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),x=m-1;x>=p;--x)l.point(y[x],T[x]);l.lineEnd(),l.areaEnd()}v&&(y[m]=+t(g,m,h),T[m]=+e(g,m,h),l.point(n?+n(g,m,h):y[m],r?+r(g,m,h):T[m]))}if(b)return l=null,b+""||null}function d(){return C6().defined(s).curve(o).context(i)}return u.x=function(h){return arguments.length?(t=typeof h=="function"?h:vt(+h),n=null,u):t},u.x0=function(h){return arguments.length?(t=typeof h=="function"?h:vt(+h),u):t},u.x1=function(h){return arguments.length?(n=h==null?null:typeof h=="function"?h:vt(+h),u):n},u.y=function(h){return arguments.length?(e=typeof h=="function"?h:vt(+h),r=null,u):e},u.y0=function(h){return arguments.length?(e=typeof h=="function"?h:vt(+h),u):e},u.y1=function(h){return arguments.length?(r=h==null?null:typeof h=="function"?h:vt(+h),u):r},u.lineX0=u.lineY0=function(){return d().x(t).y(e)},u.lineY1=function(){return d().x(t).y(r)},u.lineX1=function(){return d().x(n).y(e)},u.defined=function(h){return arguments.length?(s=typeof h=="function"?h:vt(!!h),u):s},u.curve=function(h){return arguments.length?(o=h,i!=null&&(l=o(i)),u):o},u.context=function(h){return arguments.length?(h==null?i=l=null:l=o(i=h),u):i},u}class I6{constructor(e,r){this._context=e,this._x=r}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,r){switch(e=+e,r=+r,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,r):this._context.moveTo(e,r);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,r,e,r):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+r)/2,e,this._y0,e,r);break}}this._x0=e,this._y0=r}}function oie(t){return new I6(t,!0)}function lie(t){return new I6(t,!1)}const o_={draw(t,e){const r=Sa(e/Ug);t.moveTo(r,0),t.arc(0,0,r,0,ev)}}
vendor: 6,778 bytes, line 4496
4496,cie={draw(t,e){const r=Sa(e/5)/2;t.moveTo(-3*r,-r),t.lineTo(-r,-r),t.lineTo(-r,-3*r),t.lineTo(r,-3*r),t.lineTo(r,-r),t.lineTo(3*r,-r),t.lineTo(3*r,r),t.lineTo(r,r),t.lineTo(r,3*r),t.lineTo(-r,3*r),t.lineTo(-r,r),t.lineTo(-3*r,r),t.closePath()}},O6=Sa(1/3),uie=O6*2,die={draw(t,e){const r=Sa(e/uie),n=r*O6;t.moveTo(0,-r),t.lineTo(n,0),t.lineTo(0,r),t.lineTo(-n,0),t.closePath()}},hie={draw(t,e){const r=Sa(e),n=-r/2;t.rect(n,n,r,r)}},mie=.8908130915292852,R6=Vg(Ug/10)/Vg(7*Ug/10),fie=Vg(ev/10)*R6,pie=-T6(ev/10)*R6,gie={draw(t,e){const r=Sa(e*mie),n=fie*r,s=pie*r;t.moveTo(0,-r),t.lineTo(n,s);for(let i=1;i<5;++i){const o=ev*i/5,l=T6(o),c=Vg(o);t.lineTo(c*r,-l*r),t.lineTo(l*n-c*s,c*n+l*s)}t.closePath()}},K0=Sa(3),xie={draw(t,e){const r=-Sa(e/(K0*3));t.moveTo(0,r*2),t.lineTo(-K0*r,-r),t.lineTo(K0*r,-r),t.closePath()}},Ln=-.5,Fn=Sa(3)/2,uj=1/Sa(12),yie=(uj/2+1)*3,vie={draw(t,e){const r=Sa(e/yie),n=r/2,s=r*uj,i=n,o=r*uj+r,l=-i,c=o;t.moveTo(n,s),t.lineTo(i,o),t.lineTo(l,c),t.lineTo(Ln*n-Fn*s,Fn*n+Ln*s),t.lineTo(Ln*i-Fn*o,Fn*i+Ln*o),t.lineTo(Ln*l-Fn*c,Fn*l+Ln*c),t.lineTo(Ln*n+Fn*s,Ln*s-Fn*n),t.lineTo(Ln*i+Fn*o,Ln*o-Fn*i),t.lineTo(Ln*l+Fn*c,Ln*c-Fn*l),t.closePath()}};function bie(t,e){let r=null,n=s_(s);t=typeof t=="function"?t:vt(t||o_),e=typeof e=="function"?e:vt(e===void 0?64:+e);function s(){let i;if(r||(r=i=n()),t.apply(this,arguments).draw(r,+e.apply(this,arguments)),i)return r=null,i+""||null}return s.type=function(i){return arguments.length?(t=typeof i=="function"?i:vt(i),s):t},s.size=function(i){return arguments.length?(e=typeof i=="function"?i:vt(+i),s):e},s.context=function(i){return arguments.length?(r=i??null,s):r},s}function zg(){}function Hg(t,e,r){t._context.bezierCurveTo((2*t._x0+t._x1)/3,(2*t._y0+t._y1)/3,(t._x0+2*t._x1)/3,(t._y0+2*t._y1)/3,(t._x0+4*t._x1+e)/6,(t._y0+4*t._y1+r)/6)}function D6(t){this._context=t}D6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:Hg(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:Hg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function wie(t){return new D6(t)}function M6(t){this._context=t}M6.prototype={areaStart:zg,areaEnd:zg,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._x2=t,this._y2=e;break;case 1:this._point=2,this._x3=t,this._y3=e;break;case 2:this._point=3,this._x4=t,this._y4=e,this._context.moveTo((this._x0+4*this._x1+t)/6,(this._y0+4*this._y1+e)/6);break;default:Hg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function jie(t){return new M6(t)}function $6(t){this._context=t}$6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var r=(this._x0+4*this._x1+t)/6,n=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(r,n):this._context.moveTo(r,n);break;case 3:this._point=4;default:Hg(this,t,e);break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e}};function Nie(t){return new $6(t)}function L6(t){this._context=t}L6.prototype={areaStart:zg,areaEnd:zg,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(t,e){t=+t,e=+e,this._point?this._context.lineTo(t,e):(this._point=1,this._context.moveTo(t,e))}};function _ie(t){return new L6(t)}function Lk(t){return t<0?-1:1}function Fk(t,e,r){var n=t._x1-t._x0,s=e-t._x1,i=(t._y1-t._y0)/(n||s<0&&-0),o=(r-t._y1)/(s||n<0&&-0),l=(i*s+o*n)/(n+s);return(Lk(i)+Lk(o))*Math.min(Math.abs(i),Math.abs(o),.5*Math.abs(l))||0}function Bk(t,e){var r=t._x1-t._x0;return r?(3*(t._y1-t._y0)/r-e)/2:e}function X0(t,e,r){var n=t._x0,s=t._y0,i=t._x1,o=t._y1,l=(i-n)/3;t._context.bezierCurveTo(n+l,s+l*e,i-l,o-l*r,i,o)}function qg(t){this._context=t}qg.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:X0(this,this._t0,Bk(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(t,e){var r=NaN;if(t=+t,e=+e,!(t===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;break;case 2:this._point=3,X0(this,Bk(this,r=Fk(this,t,e)),r);break;default:X0(this,this._t0,r=Fk(this,t,e));break}this._x0=this._x1,this._x1=t,this._y0=this._y1,this._y1=e,this._t0=r}}};function F6(t){this._context=new B6(t)}(F6.prototype=Object.create(qg.prototype)).point=function(t,e){qg.prototype.point.call(this,e,t)};function B6(t){this._context=t}B6.prototype={moveTo:function(t,e){this._context.moveTo(e,t)},closePath:function(){this._context.closePath()},lineTo:function(t,e){this._context.lineTo(e,t)},bezierCurveTo:function(t,e,r,n,s,i){this._context.bezierCurveTo(e,t,n,r,i,s)}};function Sie(t){return new qg(t)}function Tie(t){return new F6(t)}function V6(t){this._context=t}V6.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var t=this._x,e=this._y,r=t.length;if(r)if(this._line?this._context.lineTo(t[0],e[0]):this._context.moveTo(t[0],e[0]),r===2)this._context.lineTo(t[1],e[1]);else for(var n=Vk(t),s=Vk(e),i=0,o=1;o<r;++i,++o)this._context.bezierCurveTo(n[0][i],s[0][i],n[1][i],s[1][i],t[o],e[o
4496]);(this._line||this._line!==0&&r===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(t,e){this._x.push(+t),this._y.push(+e)}};function Vk(t){var e,r=t.length-1,n,s=new Array(r),i=new Array(r),o=new Array(r);for(s[0]=0,i[0]=2,o[0]=t[0]+2*t[1],e=1;e<r-1;++e)s[e]=1,i[e]=4,o[e]=4*t[e]+2*t[e+1];for(s[r-1]=2,i[r-1]=7,o[r-1]=8*t[r-1]+t[r],e=1;e<r;++e)n=s[e]/i[e-1],i[e]-=n,o[e]-=n*o[e-1];for(s[r-1]=o[r-1]/i[r-1],e=r-2;e>=0;--e)s[e]=(o[e]-s[e+1])/i[e];for(i[r-1]=(t[r]+s[r-1])/2,e=0;e<r-1;++e)i[e]=2*t[e+1]-s[e+1];return[s,i]}function Aie(t){return new V6(t)}function rv(t,e){this._context=t,this._t=e}rv.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(t,e){switch(t=+t,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(t,e):this._context.moveTo(t,e);break;case 1:this._point=2;default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(t,e);else{var r=this._x*(1-this._t)+t*this._t;this._context.lineTo(r,this._y),this._context.lineTo(r,e)}break}}this._x=t,this._y=e}};function Eie(t){return new rv(t,.5)}function kie(t){return new rv(t,0)}function Pie(t){return new rv(t,1)}function zc(t,e){if((o=t.length)>1)for(var r=1,n,s,i=t[e[0]],o,l=i.length;r<o;++r)for(s=i,i=t[e[r]],n=0;n<l;++n)i[n][1]+=i[n][0]=isNaN(s[n][1])?s[n][0]:s[n][1]}function dj(t){for(var e=t.length,r=new Array(e);--e>=0;)r[e]=e;return r}function Cie(t,e){return t[e]}function Iie(t){const e=[];return e.key=t,e}function Oie(){var t=vt([]),e=dj,r=zc,n=Cie;function s(i){var o=Array.from(t.apply(this,arguments),Iie),l,c=o.length,u=-1,d;for(const h of i)for(l=0,++u;l<c;++l)(o[l][u]=[0,+n(h,o[l].key,u,i)]).data=h;for(l=0,d=i_(e(o));l<c;++l)o[d[l]].index=l;return r(o,d),o}return s.keys=function(i){return arguments.length?(t=typeof i=="function"?i:vt(Array.from(i)),s):t},s.value=function(i){return arguments.length?(n=typeof i=="function"?i:vt(+i),s):n},s.order=function(i){return arguments.length?(e=i==null?dj:typeof i=="function"?i:vt(Array.from(i)),s):e},s.offset=function(i){return arguments.length?(r=i??zc,s):r},s}function Rie(t,e){if((n=t.length)>0){for(var r,n,s=0,i=t[0].length,o;s<i;++s){for(o=r=0;r<n;++r)o+=t[r][s][1]||0;if(o)for(r=0;r<n;++r)t[r][s][1]/=o}zc(t,e)}}function Die(t,e){if((s=t.length)>0){for(var r=0,n=t[e[0]],s,i=n.length;r<i;++r){for(var o=0,l=0;o<s;++o)l+=t[o][r][1]||0;n[r][1]+=n[r][0]=-l/2}zc(t,e)}}function Mie(t,e){if(!(!((o=t.length)>0)||!((i=(s=t[e[0]]).length)>0))){for(var r=0,n=1,s,i,o;n<i;++n){for(var l=0,c=0,u=0;l<o;++l){for(var d=t[e[l]],h=d[n][1]||0,m=d[n-1][1]||0,p=(h-m)/2,x=0;x<l;++x){var w=t[e[x]],g=w[n][1]||0,v=w[n-1][1]||0;p+=g-v}c+=h,u+=p*h}s[n-1][1]+=s[n-1][0]=r,c&&(r-=u/c)}s[n-1][1]+=s[n-1][0]=r,zc(t,e)}}function zh(t){"@babel/helpers - typeof";return zh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},zh(t)}var $ie=["type","size","sizeType"];function hj(){return hj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},hj.apply(this,arguments)}function Uk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function zk(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Uk(Object(r),!0).forEach(function(n){Lie(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Uk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Lie(t,e,r){return e=Fie(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Fie(t){var e=Bie(t,"string");return zh(e)=="symbol"?e:e+""}function Bie(t,e){if(zh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(zh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Vie(t,e){if(t==null)return{};var r=Uie(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Uie(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var U6={symbolCircle:o_,symbolCross:cie,symbolDiamond:die,symbolSquare:hie,symbolStar:gie,symbolTriangle:xie,symbolWye:vie},zie=Math.PI/180,Hie=function(e){var r="symbol".concat(Zy(e));return U6[r]||o_},qie=function(e,r,n){if(r==="area")return e;switch(n){case"cross":return 5*e*e/9;case"diamond":return .5*e*e/Math.sqrt(3);case"square":return e*e;case"star":{var s=18*zie;return 1.25*e*e*(Math.tan(s)-Math.tan(s*2)*Math.pow(Math.tan(s),2))}case"triangle":return Math.sqrt(3)*e*e/4;case"wye":return(21-10*Math.sqrt(3))*e*e/8;default:return Math.PI*e*e/4}},Wie=function(e,r){U6["symbol".concat(Zy(e))]=r},l_=function(e){var r=e.type,n=r===void 0?"circle":r,s=e.size,i=s===void 0?64:s,o=e.sizeType,l=o===void 0?"area":o,c=Vie(e,$ie),u=zk(zk({},c),{},{type:n,size:i,sizeType:l}),d=function(){var g=Hie(n),v=bie().type(g).size(qie(i,l,n));return v()},h=u.className,m=u.cx,p=u.cy,x=je(u,!0);return m===+m&&p===+p&&i===+i?F.createElement("path",hj({}
vendor: 4,382 bytes, lines 4496-4499
4496,x,{className:Me("recharts-symbols",h),transform:"translate(".concat(m,", ").concat(p,")"),d:d()})):null};l_.registerSymbol=Wie;function Hc(t){"@babel/helpers - typeof";return Hc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Hc(t)}function mj(){return mj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},mj.apply(this,arguments)}function Hk(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Gie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Hk(Object(r),!0).forEach(function(n){Hh(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Hk(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Kie(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Xie(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H6(n.key),n)}}function Yie(t,e,r){return e&&Xie(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Qie(t,e,r){return e=Wg(e),Jie(t,z6()?Reflect.construct(e,r||[],Wg(t).constructor):e.apply(t,r))}function Jie(t,e){if(e&&(Hc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Zie(t)}function Zie(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function z6(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(z6=function(){return!!t})()}function Wg(t){return Wg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Wg(t)}function eoe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&fj(t,e)}function fj(t,e){return fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},fj(t,e)}function Hh(t,e,r){return e=H6(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H6(t){var e=toe(t,"string");return Hc(e)=="symbol"?e:e+""}function toe(t,e){if(Hc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Hc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Bn=32,c_=function(t){function e(){return Kie(this,e),Qie(this,e,arguments)}return eoe(e,t),Yie(e,[{key:"renderIcon",value:function(n){var s=this.props.inactiveColor,i=Bn/2,o=Bn/6,l=Bn/3,c=n.inactive?s:n.color;if(n.type==="plainline")return F.createElement("line",{strokeWidth:4,fill:"none",stroke:c,strokeDasharray:n.payload.strokeDasharray,x1:0,y1:i,x2:Bn,y2:i,className:"recharts-legend-icon"});if(n.type==="line")return F.createElement("path",{strokeWidth:4,fill:"none",stroke:c,d:"M0,".concat(i,"h").concat(l,`
4497            A`).concat(o,",").concat(o,",0,1,1,").concat(2*l,",").concat(i,`
4498            H`).concat(Bn,"M").concat(2*l,",").concat(i,`
4499            A`).concat(o,",").concat(o,",0,1,1,").concat(l,",").concat(i),className:"recharts-legend-icon"});if(n.type==="rect")return F.createElement("path",{stroke:"none",fill:c,d:"M0,".concat(Bn/8,"h").concat(Bn,"v").concat(Bn*3/4,"h").concat(-Bn,"z"),className:"recharts-legend-icon"});if(F.isValidElement(n.legendIcon)){var u=Gie({},n);return delete u.legendIcon,F.cloneElement(n.legendIcon,u)}return F.createElement(l_,{fill:c,cx:i,cy:i,size:Bn,sizeType:"diameter",type:n.type})}},{key:"renderItems",value:function(){var n=this,s=this.props,i=s.payload,o=s.iconSize,l=s.layout,c=s.formatter,u=s.inactiveColor,d={x:0,y:0,width:Bn,height:Bn}
4499,h={display:l==="horizontal"?"inline-block":"block",marginRight:10},m={display:"inline-block",verticalAlign:"middle",marginRight:4};return i.map(function(p,x){var w=p.formatter||c,g=Me(Hh(Hh({"recharts-legend-item":!0},"legend-item-".concat(x),!0),"inactive",p.inactive));if(p.type==="none")return null;var v=Ee(p.value)?null:p.value;fa(!Ee(p.value),`The name property is also required when using a function for the dataKey of a chart's cartesian components. Ex: <Bar name="Name of my Data"/>`);var b=p.inactive?u:p.color;return F.createElement("li",mj({className:g,style:h,key:"legend-item-".concat(x)},sl(n.props,p,x)),F.createElement(aj,{width:o,height:o,viewBox:d,style:m},n.renderIcon(p)),F.createElement("span",{className:"recharts-legend-item-text",style:{color:b}},w?w(v,p,x):v))})}},{key:"render",value:function(){var n=this.props,s=n.payload,i=n.layout,o=n.align;if(!s||!s.length)return null;var l={padding:0,margin:0,textAlign:i==="horizontal"?o:"left"};return F.createElement("ul",{className:"recharts-default-legend",style:l},this.renderItems())}}])}(P.PureComponent);Hh(c_,"displayName","Legend");Hh(c_,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"middle",inactiveColor:"#ccc"});var roe=By;function noe(){this.__data__=new roe,this.size=0}var aoe=noe;function soe(t){var e=this.__data__,r=e.delete(t);return this.size=e.size,r}var ioe=soe;function ooe(t){return this.__data__.get(t)}var loe=ooe;function coe(t){return this.__data__.has(t)}var uoe=coe,doe=By,hoe=Y2,moe=Q2,foe=200;function poe(t,e){var r=this.__data__;if(r instanceof doe){var n=r.__data__;if(!hoe||n.length<foe-1)return n.push([t,e]),this.size=++r.size,this;r=this.__data__=new moe(n)}return r.set(t,e),this.size=r.size,this}var goe=poe,xoe=By,yoe=aoe,voe=ioe,boe=loe,woe=uoe,joe=goe;function $u(t){var e=this.__data__=new xoe(t);this.size=e.size}$u.prototype.clear=yoe;$u.prototype.delete=voe;$u.prototype.get=boe;$u.prototype.has=woe;$u.prototype.set=joe;var q6=$u,Noe="__lodash_hash_undefined__";function _oe(t){return this.__data__.set(t,Noe),this}var Soe=_oe;function Toe(t){return this.__data__.has(t)}var Aoe=Toe,Eoe=Q2,koe=Soe,Poe=Aoe;function Gg(t){var e=-1,r=t==null?0:t.length;for(this.__data__=new Eoe;++e<r;)this.add(t[e])}Gg.prototype.add=Gg.prototype.push=koe;Gg.prototype.has=Poe;var W6=Gg;function Coe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(e(t[r],r,t))return!0;return!1}var G6=Coe;function Ioe(t,e){return t.has(e)}var K6=Ioe,Ooe=W6,Roe=G6,Doe=K6,Moe=1,$oe=2;function Loe(t,e,r,n,s,i){var o=r&Moe,l=t.length,c=e.length;if(l!=c&&!(o&&c>l))return!1;var u=i.get(t),d=i.get(e);if(u&&d)return u==e&&d==t;var h=-1,m=!0,p=r&$oe?new Ooe:void 0;for(i.set(t,e),i.set(e,t);++h<l;){var x=t[h],w=e[h];if(n)var g=o?n(w,x,h,e,t,i):n(x,w,h,t,e,i);if(g!==void 0){if(g)continue;m=!1;break}if(p){if(!Roe(e,function(v,b){if(!Doe(p,b)&&(x===v||s(x,v,r,n,i)))return p.push(b)})){m=!1;break}}else if(!(x===w||s(x,w,r,n,i))){m=!1;break}}return i.delete(t),i.delete(e),m}var X6=Loe,Foe=Ja,Boe=Foe.Uint8Array,Voe=Boe;function Uoe(t){var e=-1,r=Array(t.size);return t.forEach(function(n,s){r[++e]=[s,n]}),r}var zoe=Uoe;function Hoe(t){var e=-1,r=Array(t.size);return t.forEach(function(n){r[++e]=n}),r}var u_=Hoe,qk=Ym,Wk=Voe,qoe=X2,Woe=X6,Goe=zoe,Koe=u_,Xoe=1,Yoe=2,Qoe="[object Boolean]",Joe="[object Date]",Zoe="[object Error]",ele="[object Map]",tle="[object Number]",rle="[object RegExp]",nle="[object Set]",ale="[object String]",sle="[object Symbol]",ile="[object ArrayBuffer]",ole="[object DataView]",Gk=qk?qk.prototype:void 0,Y0=Gk?Gk.valueOf:void 0;function lle(t,e,r,n,s,i,o){switch(r){case ole:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case ile:return!(t.byteLength!=e.byteLength||!i(new Wk(t),new Wk(e)));case Qoe:case Joe:case tle:return qoe(+t,+e);case Zoe:return t.name==e.name&&t.message==e.message;case rle:case ale:return t==e+"";case ele:var l=Goe;case nle:var c=n&Xoe;if(l||(l=Koe),t.size!=e.size&&!c)return!1;var u=o.get(t);if(u)return u==e;n|=Yoe,o.set(t,e);var d=Woe(l(t),l(e),n,s,i,o);return o.delete(t),d;case sle:if(Y0)return Y0.call(t)==Y0.call(e)}return!1}var cle=lle;function ule(t,e){for(var r=-1,n=e.length,s=t.length;++r<n;)t[s+r]=e[r];return t}var Y6=ule,dle=Y6,hle=yn;function mle(t,e,r){var n=e(t);return hle(t)?n:dle(n,r(t))}var fle=mle;function ple(t,e){for(var r=-1,n=t==null?0:t.length,s=0,i=[];++r<n;){var o=t[r];e(o,r,t)&&(i[s++]=o)}return i}var gle=ple;function xle(){return[]}var yle=xle,vle=gle,ble=yle,wle=Object.prototype,jle=wle.propertyIsEnumerable,Kk=Object.getOwnPropertySymbols,Nle=Kk?function(t){return t==null?[]:(t=Object(t),vle(Kk(t),function(e){return jle.call(t,e)}))}:ble,_le=Nle;function Sle(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}var Tle=Sle,Ale=Fs,Ele=Bs,kle="[object Arguments]";function Ple(t){return Ele(t)&&Ale(t)==kle}var Cle=Ple,Xk=Cle,Ile=Bs,Q6=Object.prototype,Ole=Q6.hasOwnProperty,Rle=Q6.propertyIsEnumerable,Dle=Xk(function(){return arguments}())?Xk:function(t){return Ile(t)&&Ole.call(t,"callee")&&!Rle.call(t,"callee")},d_=Dle,Kg={exports:{}};function Mle(){return!1}var $le=Mle;Kg.exports;(function(t,e){var r=Ja,n=$le,s=e&&!e.nodeType&&e,i=s&&!0&&t&&!t.nodeType&&t,o=i&&i.exports===s,l=o?r.Buffer:void 0,c=l?l.isBuffer:void 0,u=c||n;t.exports=u})(Kg,Kg.exports);var J6=Kg.exports,Lle=9007199254740991,Fle=/^(?:0|[1-9]\d*)$/;function Ble(t,e){var r=typeof t;return e=e??Lle,!!e&&(r=="number"||r!="symbol"&&Fle.test(t))&&t>-1&&t%1==0&&t<e}var h_=Ble,Vle=9007199254740991;function Ule(t){return typeof t=="number"&&t>-1&&t%1==0&&t<=Vle}var m_=Ule,zle=Fs,Hle=m_,qle=Bs,Wle="[object Arguments]",Gle="[object Array]",Kle="[object Boolean]",Xle="[object Date]",Yle="[object Error]",Qle="[object Function]",Jle="[object Map]",Zle="[object Number]",ece="[object Object]",tce="[object RegExp]",rce="[object Set]",nce="[object String]",ace="[object WeakMap]",sce="[object ArrayBuffer]",ice="[object DataView]",oce="[object Float32Array]",lce="[object Float64Array
4499]",cce="[object Int8Array]",uce="[object Int16Array]",dce="[object Int32Array]",hce="[object Uint8Array]",mce="[object Uint8ClampedArray]",fce="[object Uint16Array]",pce="[object Uint32Array]",St={};St[oce]=St[lce]=St[cce]=St[uce]=St[dce]=St[hce]=St[mce]=St[fce]=St[pce]=!0;St[Wle]=St[Gle]=St[sce]=St[Kle]=St[ice]=St[Xle]=St[Yle]=St[Qle]=St[Jle]=St[Zle]=St[ece]=St[tce]=St[rce]=St[nce]=St[ace]=!1;function gce(t){return qle(t)&&Hle(t.length)&&!!St[zle(t)]}var xce=gce;function yce(t){return function(e){return t(e)}}var Z6=yce,Xg={exports:{}};Xg.exports;(function(t,e){var r=i6,n=e&&!e.nodeType&&e,s=n&&!0&&t&&!t.nodeType&&t,i=s&&s.exports===n,o=i&&r.process,l=function(){try{var c=s&&s.require&&s.require("util").types;return c||o&&o.binding&&o.binding("util")}catch{}}();t.exports=l})(Xg,Xg.exports);var vce=Xg.exports,bce=xce,wce=Z6,Yk=vce,Qk=Yk&&Yk.isTypedArray,jce=Qk?wce(Qk):bce,e$=jce,Nce=Tle,_ce=d_,Sce=yn,Tce=J6,Ace=h_,Ece=e$,kce=Object.prototype,Pce=kce.hasOwnProperty;function Cce(t,e){var r=Sce(t),n=!r&&_ce(t),s=!r&&!n&&Tce(t),i=!r&&!n&&!s&&Ece(t),o=r||n||s||i,l=o?Nce(t.length,String):[],c=l.length;for(var u in t)(e||Pce.call(t,u))&&!(o&&(u=="length"||s&&(u=="offset"||u=="parent")||i&&(u=="buffer"||u=="byteLength"||u=="byteOffset")||Ace(u,c)))&&l.push(u);return l}var Ice=Cce,Oce=Object.prototype;function Rce(t){var e=t&&t.constructor,r=typeof e=="function"&&e.prototype||Oce;return t===r}var Dce=Rce;function Mce(t,e){return function(r){return t(e(r))}}var t$=Mce,$ce=t$,Lce=$ce(Object.keys,Object),Fce=Lce,Bce=Dce,Vce=Fce,Uce=Object.prototype,zce=Uce.hasOwnProperty;function Hce(t){if(!Bce(t))return Vce(t);var e=[];for(var r in Object(t))zce.call(t,r)&&r!="constructor"&&e.push(r);return e}var qce=Hce,Wce=K2,Gce=m_;function Kce(t){return t!=null&&Gce(t.length)&&!Wce(t)}var Qm=Kce,Xce=Ice,Yce=qce,Qce=Qm;function Jce(t){return Qce(t)?Xce(t):Yce(t)}var nv=Jce,Zce=fle,eue=_le,tue=nv;function rue(t){return Zce(t,tue,eue)}var nue=rue,Jk=nue,aue=1,sue=Object.prototype,iue=sue.hasOwnProperty;function oue(t,e,r,n,s,i){var o=r&aue,l=Jk(t),c=l.length,u=Jk(e),d=u.length;if(c!=d&&!o)return!1;for(var h=c;h--;){var m=l[h];if(!(o?m in e:iue.call(e,m)))return!1}var p=i.get(t),x=i.get(e);if(p&&x)return p==e&&x==t;var w=!0;i.set(t,e),i.set(e,t);for(var g=o;++h<c;){m=l[h];var v=t[m],b=e[m];if(n)var y=o?n(b,v,m,e,t,i):n(v,b,m,t,e,i);if(!(y===void 0?v===b||s(v,b,r,n,i):y)){w=!1;break}g||(g=m=="constructor")}if(w&&!g){var T=t.constructor,N=e.constructor;T!=N&&"constructor"in t&&"constructor"in e&&!(typeof T=="function"&&T instanceof T&&typeof N=="function"&&N instanceof N)&&(w=!1)}return i.delete(t),i.delete(e),w}var lue=oue,cue=jl,uue=Ja,due=cue(uue,"DataView"),hue=due,mue=jl,fue=Ja,pue=mue(fue,"Promise"),gue=pue,xue=jl,yue=Ja,vue=xue(yue,"Set"),r$=vue,bue=jl,wue=Ja,jue=bue(wue,"WeakMap"),Nue=jue,pj=hue,gj=Y2,xj=gue,yj=r$,vj=Nue,n$=Fs,Lu=l6,Zk="[object Map]",_ue="[object Object]",eP="[object Promise]",tP="[object Set]",rP="[object WeakMap]",nP="[object DataView]",Sue=Lu(pj),Tue=Lu(gj),Aue=Lu(xj),Eue=Lu(yj),kue=Lu(vj),mo=n$;(pj&&mo(new pj(new ArrayBuffer(1)))!=nP||gj&&mo(new gj)!=Zk||xj&&mo(xj.resolve())!=eP||yj&&mo(new yj)!=tP||vj&&mo(new vj)!=rP)&&(mo=function(t){var e=n$(t),r=e==_ue?t.constructor:void 0,n=r?Lu(r):"";if(n)switch(n){case Sue:return nP;case Tue:return Zk;case Aue:return eP;case Eue:return tP;case kue:return rP}return e});var Pue=mo,Q0=q6,Cue=X6,Iue=cle,Oue=lue,aP=Pue,sP=yn,iP=J6,Rue=e$,Due=1,oP="[object Arguments]",lP="[object Array]",Jf="[object Object]",Mue=Object.prototype,cP=Mue.hasOwnProperty;function $ue(t,e,r,n,s,i){var o=sP(t),l=sP(e),c=o?lP:aP(t),u=l?lP:aP(e);c=c==oP?Jf:c,u=u==oP?Jf:u;var d=c==Jf,h=u==Jf,m=c==u;if(m&&iP(t)){if(!iP(e))return!1;o=!0,d=!1}if(m&&!d)return i||(i=new Q0),o||Rue(t)?Cue(t,e,r,n,s,i):Iue(t,e,c,r,n,s,i);if(!(r&Due)){var p=d&&cP.call(t,"__wrapped__"),x=h&&cP.call(e,"__wrapped__");
vendor: 4,112 bytes, line 4499
4499if(p||x){var w=p?t.value():t,g=x?e.value():e;return i||(i=new Q0),s(w,g,r,n,i)}}return m?(i||(i=new Q0),Oue(t,e,r,n,s,i)):!1}var Lue=$ue,Fue=Lue,uP=Bs;function a$(t,e,r,n,s){return t===e?!0:t==null||e==null||!uP(t)&&!uP(e)?t!==t&&e!==e:Fue(t,e,r,n,a$,s)}var f_=a$,Bue=q6,Vue=f_,Uue=1,zue=2;function Hue(t,e,r,n){var s=r.length,i=s,o=!n;if(t==null)return!i;for(t=Object(t);s--;){var l=r[s];if(o&&l[2]?l[1]!==t[l[0]]:!(l[0]in t))return!1}for(;++s<i;){l=r[s];var c=l[0],u=t[c],d=l[1];if(o&&l[2]){if(u===void 0&&!(c in t))return!1}else{var h=new Bue;if(n)var m=n(u,d,c,t,e,h);if(!(m===void 0?Vue(d,u,Uue|zue,n,h):m))return!1}}return!0}var que=Hue,Wue=Wi;function Gue(t){return t===t&&!Wue(t)}var s$=Gue,Kue=s$,Xue=nv;function Yue(t){for(var e=Xue(t),r=e.length;r--;){var n=e[r],s=t[n];e[r]=[n,s,Kue(s)]}return e}var Que=Yue;function Jue(t,e){return function(r){return r==null?!1:r[t]===e&&(e!==void 0||t in Object(r))}}var i$=Jue,Zue=que,ede=Que,tde=i$;function rde(t){var e=ede(t);return e.length==1&&e[0][2]?tde(e[0][0],e[0][1]):function(r){return r===t||Zue(r,t,e)}}var nde=rde;function ade(t,e){return t!=null&&e in Object(t)}var sde=ade,ide=m6,ode=d_,lde=yn,cde=h_,ude=m_,dde=Uy;function hde(t,e,r){e=ide(e,t);for(var n=-1,s=e.length,i=!1;++n<s;){var o=dde(e[n]);if(!(i=t!=null&&r(t,o)))break;t=t[o]}return i||++n!=s?i:(s=t==null?0:t.length,!!s&&ude(s)&&cde(o,s)&&(lde(t)||ode(t)))}var mde=hde,fde=sde,pde=mde;function gde(t,e){return t!=null&&pde(t,e,fde)}var xde=gde,yde=f_,vde=f6,bde=xde,wde=G2,jde=s$,Nde=i$,_de=Uy,Sde=1,Tde=2;function Ade(t,e){return wde(t)&&jde(e)?Nde(_de(t),e):function(r){var n=vde(r,t);return n===void 0&&n===e?bde(r,t):yde(e,n,Sde|Tde)}}var Ede=Ade;function kde(t){return t}var Fu=kde;function Pde(t){return function(e){return e==null?void 0:e[t]}}var Cde=Pde,Ide=e_;function Ode(t){return function(e){return Ide(e,t)}}var Rde=Ode,Dde=Cde,Mde=Rde,$de=G2,Lde=Uy;function Fde(t){return $de(t)?Dde(Lde(t)):Mde(t)}var Bde=Fde,Vde=nde,Ude=Ede,zde=Fu,Hde=yn,qde=Bde;function Wde(t){return typeof t=="function"?t:t==null?zde:typeof t=="object"?Hde(t)?Ude(t[0],t[1]):Vde(t):qde(t)}var Za=Wde;function Gde(t,e,r,n){for(var s=t.length,i=r+(n?1:-1);n?i--:++i<s;)if(e(t[i],i,t))return i;return-1}var o$=Gde;function Kde(t){return t!==t}var Xde=Kde;function Yde(t,e,r){for(var n=r-1,s=t.length;++n<s;)if(t[n]===e)return n;return-1}var Qde=Yde,Jde=o$,Zde=Xde,ehe=Qde;function the(t,e,r){return e===e?ehe(t,e,r):Jde(t,Zde,r)}var rhe=the,nhe=rhe;function ahe(t,e){var r=t==null?0:t.length;return!!r&&nhe(t,e,0)>-1}var she=ahe;function ihe(t,e,r){for(var n=-1,s=t==null?0:t.length;++n<s;)if(r(e,t[n]))return!0;return!1}var ohe=ihe;function lhe(){}var che=lhe,J0=r$,uhe=che,dhe=u_,hhe=1/0,mhe=J0&&1/dhe(new J0([,-0]))[1]==hhe?function(t){return new J0(t)}:uhe,fhe=mhe,phe=W6,ghe=she,xhe=ohe,yhe=K6,vhe=fhe,bhe=u_,whe=200;function jhe(t,e,r){var n=-1,s=ghe,i=t.length,o=!0,l=[],c=l;if(r)o=!1,s=xhe;else if(i>=whe){var u=e?null:vhe(t);if(u)return bhe(u);o=!1,s=yhe,c=new phe}else c=e?[]:l;e:for(;++n<i;){var d=t[n],h=e?e(d):d;if(d=r||d!==0?d:0,o&&h===h){for(var m=c.length;m--;)if(c[m]===h)continue e;e&&c.push(h),l.push(d)}else s(c,h,r)||(c!==l&&c.push(h),l.push(d))}return l}var Nhe=jhe,_he=Za,She=Nhe;function The(t,e){return t&&t.length?She(t,_he(e)):[]}var Ahe=The;const dP=nt(Ahe);function l$(t,e,r){return e===!0?dP(t,r):Ee(e)?dP(t,e):t}function qc(t){"@babel/helpers - typeof";return qc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qc(t)}var Ehe=["ref"];function hP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function rs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hP(Object(r),!0).forEach(function(n){av(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hP(Object(r)).forEac
vendor: 4,250 bytes, line 4499
4499h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function khe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mP(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,u$(n.key),n)}}function Phe(t,e,r){return e&&mP(t.prototype,e),r&&mP(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Che(t,e,r){return e=Yg(e),Ihe(t,c$()?Reflect.construct(e,r||[],Yg(t).constructor):e.apply(t,r))}function Ihe(t,e){if(e&&(qc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Ohe(t)}function Ohe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(c$=function(){return!!t})()}function Yg(t){return Yg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Yg(t)}function Rhe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&bj(t,e)}function bj(t,e){return bj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},bj(t,e)}function av(t,e,r){return e=u$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function u$(t){var e=Dhe(t,"string");return qc(e)=="symbol"?e:e+""}function Dhe(t,e){if(qc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(qc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function Mhe(t,e){if(t==null)return{};var r=$he(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function $he(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Lhe(t){return t.value}function Fhe(t,e){if(F.isValidElement(t))return F.cloneElement(t,e);if(typeof t=="function")return F.createElement(t,e);e.ref;var r=Mhe(e,Ehe);return F.createElement(c_,r)}var fP=1,Io=function(t){function e(){var r;khe(this,e);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=Che(this,e,[].concat(s)),av(r,"lastBoundingBox",{width:-1,height:-1}),r}return Rhe(e,t),Phe(e,[{key:"componentDidMount",value:function(){this.updateBBox()}},{key:"componentDidUpdate",value:function(){this.updateBBox()}},{key:"getBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();return n.height=this.wrapperNode.offsetHeight,n.width=this.wrapperNode.offsetWidth,n}return null}},{key:"updateBBox",value:function(){var n=this.props.onBBoxUpdate,s=this.getBBox();s?(Math.abs(s.width-this.lastBoundingBox.width)>fP||Math.abs(s.height-this.lastBoundingBox.height)>fP)&&(this.lastBoundingBox.width=s.width,this.lastBoundingBox.height=s.height,n&&n(s)):(this.lastBoundingBox.width!==-1||this.lastBoundingBox.height!==-1)&&(this.lastBoundingBox.width=-1,this.lastBoundingBox.height=-1,n&&n(null))}},{key:"getBBoxSnapshot",value:function(){return this.lastBoundingBox.width>=0&&this.lastBoundingBox.height>=0?rs({},this.lastBoundingBox):{width:0,height:0}}},{key:"getDefaultPosition",value:function(n){var s=this.props,i=s.layout,o=s.align,l=s.verticalAlign,c=s.margin,u=s.chartWidth,d=s.chartHeight,h,m;if(!n||(n.left===void 0||n.left===null)&&(n.right===void 0||n.right===null))if(o==="center"&&i==="vertical"){var p=this.getBBoxSnapshot();h={left:((u||0)-p.width)/2}}else h=o==="right"?{right:c&&c.right||0}:{left:c&&c.left||0};if(!n||(n.top===void 0||n.top===null)&&(n.bottom===void 0||n.bottom===null))if(l==="middle"){var x=this.getBBoxSnapsh
4499ot();m={top:((d||0)-x.height)/2}}else m=l==="bottom"?{bottom:c&&c.bottom||0}:{top:c&&c.top||0};return rs(rs({},h),m)}},{key:"render",value:function(){var n=this,s=this.props,i=s.content,o=s.width,l=s.height,c=s.wrapperStyle,u=s.payloadUniqBy,d=s.payload,h=rs(rs({position:"absolute",width:o||"auto",height:l||"auto"},this.getDefaultPosition(c)),c);return F.createElement("div",{className:"recharts-legend-wrapper",style:h,ref:function(p){n.wrapperNode=p}},Fhe(i,rs(rs({},this.props),{},{payload:l$(d,u,Lhe)})))}}],[{key:"getWithHeight",value:function(n,s){var i=rs(rs({},this.defaultProps),n.props),o=i.layout;return o==="vertical"&&ie(n.props.height)?{height:n.props.height}:o==="horizontal"?{width:n.props.width||s}:null}}])}(P.PureComponent);av(Io,"displayName","Legend");av(Io,"defaultProps",{iconSize:14,layout:"horizontal",align:"center",verticalAlign:"bottom"});var pP=Ym,Bhe=d_,Vhe=yn,gP=pP?pP.isConcatSpreadable:void 0;function Uhe(t){return Vhe(t)||Bhe(t)||!!(gP&&t&&t[gP])}var zhe=Uhe,Hhe=Y6,qhe=zhe;function d$(t,e,r,n,s){var i=-1,o=t.length;for(r||(r=qhe),s||(s=[]);++i<o;){var l=t[i];e>0&&r(l)?e>1?d$(l,e-1,r,n,s):Hhe(s,l):n||(s[s.length]=l)}return s}var h$=d$;function Whe(t){return function(e,r,n){for(var s=-1,i=Object(e),o=n(e),l=o.length;l--;){var c=o[t?l:++s];if(r(i[c],c,i)===!1)break}return e}}var Ghe=Whe,Khe=Ghe,Xhe=Khe(),Yhe=Xhe,Qhe=Yhe,Jhe=nv;function Zhe(t,e){return t&&Qhe(t,e,Jhe)}var m$=Zhe,eme=Qm;function tme(t,e){return function(r,n){if(r==null)return r;if(!eme(r))return t(r,n);for(var s=r.length,i=e?s:-1,o=Object(r);(e?i--:++i<s)&&n(o[i],i,o)!==!1;);return r}}var rme=tme,nme=m$,ame=rme,sme=ame(nme),p_=sme,ime=p_,ome=Qm;function lme(t,e){var r=-1,n=ome(t)?Array(t.length):[];return ime(t,function(s,i,o){n[++r]=e(s,i,o)}),n}var f$=lme;function cme(t,e){var r=t.length;for(t.sort(e);r--;)t[r]=t[r].value;return t}var ume=cme,xP=Cu;function dme(t,e){if(t!==e){var r=t!==void 0,n=t===null,s=t===t,i=xP(t),o=e!==void 0,l=e===null,c=e===e,u=xP(e);if(!l&&!u&&!i&&t>e||i&&o&&c&&!l&&!u||n&&o&&c||!r&&c||!s)return 1;if(!n&&!i&&!u&&t<e||u&&r&&s&&!n&&!i||l&&r&&s||!o&&s||!c)return-1}return 0}var hme=dme,mme=hme;function fme(t,e,r){for(var n=-1,s=t.criteria,i=e.criteria,o=s.length,l=r.length;++n<o;){var c=mme(s[n],i[n]);if(c){if(n>=l)return c;var u=r[n];return c*(u=="desc"?-1:1)}}return t.index-e.index}var pme=fme,Z0=Z2,gme=e_,xme=Za,yme=f$,vme=ume,bme=Z6,wme=pme,jme=Fu,Nme=yn;function _me(t,e,r){e.length?e=Z0(e,function(i){return Nme(i)?function(o){return gme(o,i.length===1?i[0]:i)}:i}):e=[jme];var n=-1;e=Z0(e,bme(xme));var s=yme(t,function(i,o,l){var c=Z0(e,function(u){return u(i)});return{criteria:c,index:++n,value:i}});return vme(s,function(i,o){return wme(i,o,r)})}var Sme=_me;function Tme(t,e,r){switch(r.length){case 0:return t.call(e);case 1:return t.call(e,r[0]);case 2:return t.call(e,r[0],r[1]);case 3:return t.call(e,r[0],r[1],r[2])}return t.apply(e,r)}var Ame=Tme,Eme=Ame,yP=Math.max;function kme(t,e,r){return e=yP(e===void 0?t.length-1:e,0),function(){for(var n=arguments,s=-1,i=yP(n.length-e,0),o=Array(i);++s<i;)o[s]=n[e+s];s=-1;for(var l=Array(e+1);++s<e;)l[s]=n[s];return l[e]=r(o),Eme(t,this,l)}}var Pme=kme;function Cme(t){return function(){return t}}var Ime=Cme,Ome=jl,Rme=function(){try{var t=Ome(Object,"defineProperty");return t({},"",{}),t}catch{}}(),p$=Rme,Dme=Ime,vP=p$,Mme=Fu,$me=vP?function(t,e){return vP(t,"toString",{configurable:!0,enumerable:!1,value:Dme(e),writable:!0})}:Mme,Lme=$me,Fme=800,Bme=16,Vme=Date.now;function Ume(t){var e=0,r=0;return function(){var n=Vme(),s=Bme-(n-r);if(r=n,s>0){if(++e>=Fme)return arguments[0]}else e=0;return t.apply(void 0,arguments)}}var zme=Ume,Hme=Lme,qme=zme,Wme=qme(Hme),Gme=Wme,Kme=Fu,Xme=Pme,Yme=Gme;function Qme(t,e){return Yme(Xme(t,e,Kme),t+"")}var Jme=Qme,Zme=X2,efe=Qm,tfe=h_,rfe=Wi;function nfe(t,e,r){if(!rfe(r))return!1;var n=typeof e;return(n=="number"?efe(r)&&tfe(e,r.length):n=="string"&&e in r)?Zme(r[e],t):!1}var sv=nfe,afe=h$,sfe=Sme,ife=Jme,bP=sv,ofe=ife(function(t,e){if(t==null)return[];var r=e.length;return r>1&&bP(t,e[0],e[1])?e=[]:r>2&&bP(e[0],e[1],e[2])&&(e=[e[0]]),sfe(t,afe(e,1),[])}),lfe=ofe;const g_=nt(lfe);function qh(t){"@babel/helpers - typeof";return qh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},qh(t)}function wj(){return wj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
vendor: 28,889 bytes, lines 4499-4506
4499for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},wj.apply(this,arguments)}function cfe(t,e){return mfe(t)||hfe(t,e)||dfe(t,e)||ufe()}function ufe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4500In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dfe(t,e){if(t){if(typeof t=="string")return wP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return wP(t,e)}}function wP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hfe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function mfe(t){if(Array.isArray(t))return t}function jP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function eb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?jP(Object(r),!0).forEach(function(n){ffe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):jP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function ffe(t,e,r){return e=pfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pfe(t){var e=gfe(t,"string");return qh(e)=="symbol"?e:e+""}function gfe(t,e){if(qh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(qh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function xfe(t){return Array.isArray(t)&&lr(t[0])&&lr(t[1])?t.join(" ~ "):t}var yfe=function(e){var r=e.separator,n=r===void 0?" : ":r,s=e.contentStyle,i=s===void 0?{}:s,o=e.itemStyle,l=o===void 0?{}:o,c=e.labelStyle,u=c===void 0?{}:c,d=e.payload,h=e.formatter,m=e.itemSorter,p=e.wrapperClassName,x=e.labelClassName,w=e.label,g=e.labelFormatter,v=e.accessibilityLayer,b=v===void 0?!1:v,y=function(){if(d&&d.length){var C={padding:0,margin:0},R=(m?g_(d,m):d).map(function(W,M){if(W.type==="none")return null;var L=eb({display:"block",paddingTop:4,paddingBottom:4,color:W.color||"#000"},l),U=W.formatter||h||xfe,V=W.value,D=W.name,z=V,K=D;if(U&&z!=null&&K!=null){var q=U(V,D,W,M,d);if(Array.isArray(q)){var H=cfe(q,2);z=H[0],K=H[1]}else z=q}return F.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:L},lr(K)?F.createElement("span",{className:"recharts-tooltip-item-name"},K):null,lr(K)?F.createElement("span",{className:"recharts-tooltip-item-separator"},n):null,F.createElement("span",{className:"recharts-tooltip-item-value"},z),F.createElement("span",{className:"recharts-tooltip-item-unit"},W.unit||""))});return F.createElement("ul",{className:"recharts-tooltip-item-list",style:C},R)}return null},T=eb({margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},i),N=eb({margin:0},u),j=!Ie(w),_=j?w:"",S=Me("recharts-default-tooltip",p),k=Me("recharts-tooltip-label",x);j&&g&&d!==void 0&&d!==null&&(_=g(w,d));var I=b?{role:"status","aria-live":"assertive"}:{};return F.createElement("div",wj({className:S,style:T},I),F.createElement("p",{className:k,style:N},F.isValidElement(_)?_:"".concat(_)),y())};function Wh(t){"@babel/helpers - typeof";return Wh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wh(t)}function Zf(t,e,r){return e=vfe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function vfe(t){var e=bfe(t,"string");return Wh(e)=="symbol"?e:e+""}function bfe(t,e){if(Wh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Wh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var wd="recharts-tooltip-wrapper",wfe={visibility:"hidden"};function jfe(t){var e=t.coordinate,r=t.translateX,n=t.translateY;return Me(wd,Zf(Zf(Zf(Zf({},"".concat(wd,"-right"),ie(r)&&e&&ie(e.x)&&r>=e.x),"".concat(wd,"-left"),ie(r)&&e&&ie(e.x)&&r<e.x),"".concat(wd,"-bottom"),ie(n)&&e&&ie(e.y)&&n>=e.y),"".concat(wd,"-top"),ie(n)&&e&&ie(e.y)&&n<e.y))}function NP(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.key,s=t.offsetTopLeft,i=t.position,o=t.reverseDirection,l=t.tooltipDimension,c=t.viewBox,u=t.viewBoxDimension;if(i&&ie(i[n]))return i[n];var d=r[n]-l-s,h=r[n]+s;if(e[n])return o[n]?d:h;if(o[n]){var m=d,p=c[n];return m<p?Math.max(h,c[n]):Math.max(d,c[n])}var x=h+l,w=c[n]+u;return x>w?Math.max(d,c[n]):Math.max(h,c[n])}function Nfe(t){var e=t.translateX,r=t.translateY,n=t.useTranslate3d;return{transform:n?"translate3d(".concat(e,"px, ").concat(r,"px, 0)"):"translate(".concat(e,"px, ").concat(r,"px)")}}function _fe(t){var e=t.allowEscapeViewBox,r=t.coordinate,n=t.offsetTopLeft,s=t.position,i=t.reverseDirection,o=t.tooltipBox,l=t.useTranslate3d,c=t.viewBox,u,d,h;return o.height>0&&o.width>0&&r?(d=NP({allowEscapeViewBox:e,coordinate:r,key:"x",offsetTopLeft:n,position:s,reverseDirection:i,tooltipDimension:o.width,viewBox:c,viewBoxDimension:c.width}),h=NP({allowEscapeViewBox:e,coordinate:r,key:"y",offsetTopLeft:n,position:s,reverseDirection:i,tooltipDimension:o.height,viewBox:c,viewBoxDimension:c.height}),u=Nfe({translateX:d,translateY:h,useTranslate3d:l})):u=wfe,{cssProperties:u,cssClasses:jfe({translateX:d,translateY:h,coordinate:r})}}function Wc(t){"@babel/helpers - typeof";return Wc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wc(t)}function _P(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function SP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_P(Object(r),!0).forEach(function(n){Nj(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_P(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Sfe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Tfe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,x$(n.key),n)}}function Afe(t,e,r){return e&&Tfe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Efe(t,e,r){return e=Qg(e),kfe(t,g$()?Reflect.construct(e,r||[],Qg(t).constructor):e.apply(t,r))}function kfe(t,e){if(e&&(Wc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Pfe(t)}function Pfe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function g$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(g$=function(){return!!t})()}function Qg(t){return Qg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Qg(t)}function Cfe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&jj(t,e)}function jj(t,e){return jj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},jj(t,e)}function Nj(t,e,r){return e=x$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function x$(t){var e=Ife(t,"string");return Wc(e)=="symbol"?e:e+""}function Ife(t,e){if(Wc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Wc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var TP=1,Ofe=function(t){function e(){var r;Sfe(this,e);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=Efe(this,e,[].concat(s)),Nj(r,"state",{dismissed:!1,dismissedAtCoordinate:{x:0,y:0},lastBoundingBox:{width:-1,height:-1}}),Nj(r,"handleKeyDown",function(o){if(o.key==="Escape"){var l,c,u,d;r.setState({dismissed:!0,dismissedAtCoordinate:{x:(l=(c=r.props.coordinate)===null||c===void 0?void 0:c.x)!==null&&l!==void 0?l:0,y:(u=(d=r.props.coordinate)===null||d===void 0?void 0:d.y)!==null&&u!==void 0?u:0}})}}),r}return Cfe(e,t),Afe(e,[{key:"updateBBox",value:function(){if(this.wrapperNode&&this.wrapperNode.getBoundingClientRect){var n=this.wrapperNode.getBoundingClientRect();(Math.abs(n.width-this.state.lastBoundingBox.width)>TP||Math.abs(n.height-this.state.lastBoundingBox.height)>TP)&&this.setState({lastBoundingBox:{width:n.width,height:n.height}})}else(this.state.lastBoundingBox.width!==-1||this.state.lastBoundingBox.height!==-1)&&this.setState({lastBoundingBox:{width:-1,height:-1}})}},{key:"componentDidMount",value:function(){document.addEventListener("keydown",this.handleKeyDown),this.updateBBox()}},{key:"componentWillUnmount",value:function(){document.removeEventListener("keydown",this.handleKeyDown)}},{key:"componentDidUpdate",value:function(){var n,s;this.props.active&&this.updateBBox(),this.state.dismissed&&(((n=this.props.coordinate)===null||n===void 0?void 0:n.x)!==this.state.dismissedAtCoordinate.x||((s=this.props.coordinate)===null||s===void 0?void 0:s.y)!==this.state.dismissedAtCoordinate.y)&&(this.state.dismissed=!1)}},{key:"render",value:function(){var n=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.children,d=s.coordinate,h=s.hasPayload,m=s.isAnimationActive,p=s.offset,x=s.position,w=s.reverseDirection,g=s.useTranslate3d,v=s.viewBox,b=s.wrapperStyle,y=_fe({allowEscapeViewBox:o,coordinate:d,offsetTopLeft:p,position:x,reverseDirection:w,tooltipBox:this.state.lastBoundingBox,useTranslate3d:g,viewBox:v}),T=y.cssClasses,N=y.cssProperties,j=SP(SP({transition:m&&i?"transform ".concat(l,"ms ").concat(c):void 0},N),{},{pointerEvents:"none",visibility:!this.state.dismissed&&i&&h?"visible":"hidden",position:"absolute",top:0,left:0},b);return F.createElement("div",{tabIndex:-1,className:T,style:j,ref:function(S){n.wrapperNode=S}},u)}}])}(P.PureComponent),Rfe=function(){return!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout)},Gi={isSsr:Rfe()};function Gc(t){"@babel/helpers - typeof";return Gc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gc(t)}function AP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function EP(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?AP(Object(r),!0).forEach(function(n){x_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):AP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Dfe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Mfe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,v$(n.key),n)}}function $fe(t,e,r){return e&&Mfe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function Lfe(t,e,r){return e=Jg(e),Ffe(t,y$()?Reflect.construct(e,r||[],Jg(t).constructor):e.apply(t,r))}function Ffe(t,e){if(e&&(Gc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Bfe(t)}function Bfe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function y$(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(y$=function(){return!!t})()}function Jg(t){return Jg=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Jg(t)}function Vfe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&_j(t,e)}function _j(t,e){return _j=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},_j(t,e)}function x_(t,e,r){return e=v$(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function v$(t){var e=Ufe(t,"string");return Gc(e)=="symbol"?e:e+""}function Ufe(t,e){if(Gc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function zfe(t){return t.dataKey}function Hfe(t,e){return F.isValidElement(t)?F.cloneElement(t,e):typeof t=="function"?F.createElement(t,e):F.createElement(yfe,e)}var Ar=function(t){function e(){return Dfe(this,e),Lfe(this,e,arguments)}return Vfe(e,t),$fe(e,[{key:"render",value:function(){var n=this,s=this.props,i=s.active,o=s.allowEscapeViewBox,l=s.animationDuration,c=s.animationEasing,u=s.content,d=s.coordinate,h=s.filterNull,m=s.isAnimationActive,p=s.offset,x=s.payload,w=s.payloadUniqBy,g=s.position,v=s.reverseDirection,b=s.useTranslate3d,y=s.viewBox,T=s.wrapperStyle,N=x??[];h&&N.length&&(N=l$(x.filter(function(_){return _.value!=null&&(_.hide!==!0||n.props.includeHidden)}),w,zfe));var j=N.length>0;return F.createElement(Ofe,{allowEscapeViewBox:o,animationDuration:l,animationEasing:c,isAnimationActive:m,active:i,coordinate:d,hasPayload:j,offset:p,position:g,reverseDirection:v,useTranslate3d:b,viewBox:y,wrapperStyle:T},Hfe(u,EP(EP({},this.props),{},{payload:N})))}}])}(P.PureComponent);x_(Ar,"displayName","Tooltip");x_(Ar,"defaultProps",{accessibilityLayer:!1,allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",contentStyle:{},coordinate:{x:0,y:0},cursor:!0,cursorStyle:{},filterNull:!0,isAnimationActive:!Gi.isSsr,itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,viewBox:{x:0,y:0,height:0,width:0},wrapperStyle:{}});var qfe=Ja,Wfe=function(){return qfe.Date.now()},Gfe=Wfe,Kfe=/\s/;function Xfe(t){for(var e=t.length;e--&&Kfe.test(t.charAt(e)););return e}var Yfe=Xfe,Qfe=Yfe,Jfe=/^\s+/;function Zfe(t){return t&&t.slice(0,Qfe(t)+1).replace(Jfe,"")}var epe=Zfe,tpe=epe,kP=Wi,rpe=Cu,PP=NaN,npe=/^[-+]0x[0-9a-f]+$/i,ape=/^0b[01]+$/i,spe=/^0o[0-7]+$/i,ipe=parseInt;function ope(t){if(typeof t=="number")return t;if(rpe(t))return PP;if(kP(t)){var e=typeof t.valueOf=="function"?t.valueOf():t;t=kP(e)?e+"":e}if(typeof t!="string")return t===0?t:+t;t=tpe(t);var r=ape.test(t);return r||spe.test(t)?ipe(t.slice(2),r?2:8):npe.test(t)?PP:+t}var b$=ope,lpe=Wi,tb=Gfe,CP=b$,cpe="Expected a function",upe=Math.max,dpe=Math.min;function hpe(t,e,r){var n,s,i,o,l,c,u=0,d=!1,h=!1,m=!0;if(typeof t!="function")throw new TypeError(cpe);e=CP(e)||0,lpe(r)&&(d=!!r.leading,h="maxWait"in r,i=h?upe(CP(r.maxWait)||0,e):i,m="trailing"in r?!!r.trailing:m);function p(j){var _=n,S=s;return n=s=void 0,u=j,o=t.apply(S,_),o}function x(j){return u=j,l=setTimeout(v,e),d?p(j):o}function w(j){var _=j-c,S=j-u,k=e-_;return h?dpe(k,i-S):k}function g(j){var _=j-c,S=j-u;return c===void 0||_>=e||_<0||h&&S>=i}function v(){var j=tb();if(g(j))return b(j);l=setTimeout(v,w(j))}function b(j){return l=void 0,m&&n?p(j):(n=s=void 0,o)}function y(){l!==void 0&&clearTimeout(l),u=0,n=c=s=l=void 0}function T(){return l===void 0?o:b(tb())}function N(){var j=tb(),_=g(j);if(n=arguments,s=this,c=j,_){if(l===void 0)return x(c);if(h)return clearTimeout(l),l=setTimeout(v,e),p(c)}return l===void 0&&(l=setTimeout(v,e)),o}return N.cancel=y,N.flush=T,N}var mpe=hpe,fpe=mpe,ppe=Wi,gpe="Expected a function";function xpe(t,e,r){var n=!0,s=!0;if(typeof t!="function")throw new TypeError(gpe);return ppe(r)&&(n="leading"in r?!!r.leading:n,s="trailing"in r?!!r.trailing:s),fpe(t,e,{leading:n,maxWait:e,trailing:s})}var ype=xpe;const w$=nt(ype);function Gh(t){"@babel/helpers - typeof";return Gh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Gh(t)}function IP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ep(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?IP(Object(r),!0).forEach(function(n){vpe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):IP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vpe(t,e,r){return e=bpe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bpe(t){var e=wpe(t,"string");return Gh(e)=="symbol"?e:e+""}function wpe(t,e){if(Gh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Gh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jpe(t,e){return Tpe(t)||Spe(t,e)||_pe(t,e)||Npe()}function Npe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4501In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _pe(t,e){if(t){if(typeof t=="string")return OP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OP(t,e)}}function OP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Spe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Tpe(t){if(Array.isArray(t))return t}var li=P.forwardRef(function(t,e){var r=t.aspect,n=t.initialDimension,s=n===void 0?{width:-1,height:-1}:n,i=t.width,o=i===void 0?"100%":i,l=t.height,c=l===void 0?"100%":l,u=t.minWidth,d=u===void 0?0:u,h=t.minHeight,m=t.maxHeight,p=t.children,x=t.debounce,w=x===void 0?0:x,g=t.id,v=t.className,b=t.onResize,y=t.style,T=y===void 0?{}:y,N=P.useRef(null),j=P.useRef();j.current=b,P.useImperativeHandle(e,function(){return Object.defineProperty(N.current,"current",{get:function(){return console.warn("The usage of ref.current.current is deprecated and will no longer be supported."),N.current},configurable:!0})});var _=P.useState({containerWidth:s.width,containerHeight:s.height}),S=jpe(_,2),k=S[0],I=S[1],E=P.useCallback(function(R,W){I(function(M){var L=Math.round(R),U=Math.round(W);return M.containerWidth===L&&M.containerHeight===U?M:{containerWidth:L,containerHeight:U}})},[]);P.useEffect(function(){var R=function(D){var z,K=D[0].contentRect,q=K.width,H=K.height;E(q,H),(z=j.current)===null||z===void 0||z.call(j,q,H)};w>0&&(R=w$(R,w,{trailing:!0,leading:!1}));var W=new ResizeObserver(R),M=N.current.getBoundingClientRect(),L=M.width,U=M.height;return E(L,U),W.observe(N.current),function(){W.disconnect()}},[E,w]);var C=P.useMemo(function(){var R=k.containerWidth,W=k.containerHeight;if(R<0||W<0)return null;fa(jo(o)||jo(c),`The width(%s) and height(%s) are both fixed numbers,
4502       maybe you don't need to use a ResponsiveContainer.`,o,c),fa(!r||r>0,"The aspect(%s) must be greater than zero.",r);var M=jo(o)?R:o,L=jo(c)?W:c;r&&r>0&&(M?L=M/r:L&&(M=L*r),m&&L>m&&(L=m)),fa(M>0||L>0,`The width(%s) and height(%s) of chart should be greater than 0,
4503       please check the style of container, or the props width(%s) and height(%s),
4504       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
4505       height and width.`,M,L,o,c,d,h,r);var U=!Array.isArray(p)&&bs(p.type).endsWith("Chart");return F.Children.map(p,function(V){return F.isValidElement(V)?P.cloneElement(V,ep({width:M,height:L},U?{style:ep({height:"100%",width:"100%",maxHeight:L,maxWidth:M},V.props.style)}:{})):V})},[r,p,c,m,h,d,k,o]);return F.createElement("div",{id:g?"".concat(g):void 0,className:Me("recharts-responsive-container",v),style:ep(ep({},T),{},{width:o,height:c,minWidth:d,minHeight:h,maxHeight:m}),ref:N},C)}),Kc=function(e){return null};Kc.displayName="Cell";function Kh(t){"@babel/helpers - typeof";return Kh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Kh(t)}function RP(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Sj(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RP(Object(r),!0).forEach(function(n){Ape(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RP(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ape(t,e,r){return e=Epe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Epe(t){var e=kpe(t,"string");return Kh(e)=="symbol"?e:e+""}function kpe(t,e){if(Kh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Kh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var Dl={widthCache:{},cacheCount:0},Ppe=2e3,Cpe={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},DP="recharts_measurement_span";function Ipe(t){var e=Sj({},t);return Object.keys(e).forEach(function(r){e[r]||delete e[r]}),e}var ah=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||Gi.isSsr)return{width:0,height:0};var n=Ipe(r),s=JSON.stringify({text:e,copyStyle:n});if(Dl.widthCache[s])return Dl.widthCache[s];try{var i=document.getElementById(DP);i||(i=document.createElement("span"),i.setAttribute("id",DP),i.setAttribute("aria-hidden","true"),document.body.appendChild(i));var o=Sj(Sj({},Cpe),n);Object.assign(i.style,o),i.textContent="".concat(e);var l=i.getBoundingClientRect(),c={width:l.width,height:l.height};return Dl.widthCache[s]=c,++Dl.cacheCount>Ppe&&(Dl.cacheCount=0,Dl.widthCache={}),c}catch{return{width:0,height:0}}},Ope=function(e){return{top:e.top+window.scrollY-document.documentElement.clientTop,left:e.left+window.scrollX-document.documentElement.clientLeft}};function Xh(t){"@babel/helpers - typeof";return Xh=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Xh(t)}function Zg(t,e){return $pe(t)||Mpe(t,e)||Dpe(t,e)||Rpe()}function Rpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4506In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dpe(t,e){if(t){if(typeof t=="string")return MP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return MP(t,e)}}function MP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Mpe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function $pe(t){if(Array.isArray(t))return t}function Lpe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function $P(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,Bpe(n.key),n)}}function Fpe(t,e,r){return e&&$P(t.prototype,e),r&&$P(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Bpe(t){var e=Vpe(t,"string");return Xh(e)=="symbol"?e:e+""}function Vpe(t,e){if(Xh(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xh(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var LP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,FP=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,Upe=/^px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q$/,zpe=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,j$={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},Hpe=Object.keys(j$),tc="NaN";function qpe(t,e){return t*j$[e]}var tp=function(){function t(e,r){Lpe(this,t),this.num=e,this.unit=r,this.num=e,this.unit=r,Number.isNaN(e)&&(this.unit=""),r!==""&&!Upe.test(r)&&(this.num=NaN,this.unit=""),Hpe.includes(r)&&(this.num=qpe(e,r),this.unit="px")}return Fpe(t,[{key:"add",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num+r.num,this.unit)}},{key:"subtract",value:function(r){return this.unit!==r.unit?new t(NaN,""):new t(this.num-r.num,this.unit)}},{key:"multiply",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num*r.num,this.unit||r.unit)}},{key:"divide",value:function(r){return this.unit!==""&&r.unit!==""&&this.unit!==r.unit?new t(NaN,""):new t(this.num/r.num,this.unit||r.unit)}},{key:"toString",value:function(){return"".concat(this.num).concat(this.unit)}},{key:"isNaN",value:function(){return Number.isNaN(this.num)}}],[{key:"parse",value:function(r){var n,s=(n=zpe.exec(r))!==null&&n!==void 0?n:[],i=Zg(s,3),o=i[1],l=i[2];return new t(parseFloat(o),l??"")}}])}();function N$(t){if(t.includes(tc))return tc;for(var e=t;e.includes("*")||e.includes("/");){var r,n=(r=LP.exec(e))!==null&&r!==void 0?r:[],s=Zg(n,4),i=s[1],o=s[2],l=s[3],c=tp.parse(i??""),u=tp.parse(l??""),d=o==="*"?c.multiply(u):c.divide(u);if(d.isNaN())return tc;e=e.replace(LP,d.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var h,m=(h=FP.exec(e))!==null&&h!==void 0?h:[],p=Zg(m,4),x=p[1],w=p[2],g=p[3],v=tp.parse(x??""),b=tp.parse(g??""),y=w==="+"?v.add(b):v.subtract(b);if(y.isNaN())return tc;e=e.replace(FP,y.toString())}return e}var BP=/\(([^()]*)\)/;function Wpe(t){for(var e=t;e.includes("(");){var r=BP.exec(e),n=Zg(r,2),s=n[1];e=e.replace(BP,N$(s))}return e}function Gpe(t){var e=t.replace(/\s+/g,"");return e=Wpe(e),e=N$(e),e}function Kpe(t){try{return Gpe(t)}catch{return tc}}function rb(t){var e=Kpe(t.slice(5,-1));return e===tc?"":e}var Xpe=["x","y","lineHeight","capHeight","scaleToFit","textAnchor","verticalAnchor","fill"],Ype=["dx","dy","angle","className","breakAll"];function Tj(){return Tj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];
4506for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Tj.apply(this,arguments)}function VP(t,e){if(t==null)return{};var r=Qpe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Qpe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function UP(t,e){return tge(t)||ege(t,e)||Zpe(t,e)||Jpe()}function Jpe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4507In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zpe(t,e){if(t){if(typeof t=="string")return zP(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zP(t,e)}}function zP(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function ege(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e===0){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function tge(t){if(Array.isArray(t))return t}var _$=/[ \f\n\r\t\v\u2028\u2029]+/,S$=function(e){var r=e.children,n=e.breakAll,s=e.style;try{var i=[];Ie(r)||(n?i=r.toString().split(""):i=r.toString().split(_$));var o=i.map(function(c){return{word:c,width:ah(c,s).width}}),l=n?0:ah(" ",s).width;return{wordsWithComputedWidth:o,spaceWidth:l}}catch{return null}},rge=function(e,r,n,s,i){var o=e.maxLines,l=e.children,c=e.style,u=e.breakAll,d=ie(o),h=l,m=function(){var M=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return M.reduce(function(L,U){var V=U.word,D=U.width,z=L[L.length-1];if(z&&(s==null||i||z.width+D+n<Number(s)))z.words.push(V),z.width+=D+n;else{var K={words:[V],width:D};L.push(K)}return L},[])},p=m(r),x=function(M){return M.reduce(function(L,U){return L.width>U.width?L:U})};if(!d)return p;for(var w="…",g=function(M){var L=h.slice(0,M),U=S$({breakAll:u,style:c,children:L+w}).wordsWithComputedWidth,V=m(U),D=V.length>o||x(V).width>Number(s);return[D,V]},v=0,b=h.length-1,y=0,T;v<=b&&y<=h.length-1;){var N=Math.floor((v+b)/2),j=N-1,_=g(j),S=UP(_,2),k=S[0],I=S[1],E=g(N),C=UP(E,1),R=C[0];if(!k&&!R&&(v=N+1),k&&R&&(b=N-1),!k&&R){T=I;break}y++}return T||p},HP=function(e){var r=Ie(e)?[]:e.toString().split(_$);return[{words:r}]},nge=function(e){var r=e.width,n=e.scaleToFit,s=e.children,i=e.style,o=e.breakAll,l=e.maxLines;if((r||n)&&!Gi.isSsr){var c,u,d=S$({breakAll:o,children:s,style:i});if(d){var h=d.wordsWithComputedWidth,m=d.spaceWidth;c=h,u=m}else return HP(s);return rge({breakAll:o,children:s,maxLines:l,style:i},c,u,r,n)}return HP(s)},qP="#808080",il=function(e){var r=e.x,n=r===void 0?0:r,s=e.y,i=s===void 0?0:s,o=e.lineHeight,l=o===void 0?"1em":o,c=e.capHeight,u=c===void 0?"0.71em":c,d=e.scaleToFit,h=d===void 0?!1:d,m=e.textAnchor,p=m===void 0?"start":m,x=e.verticalAnchor,w=x===void 0?"end":x,g=e.fill,v=g===void 0?qP:g,b=VP(e,Xpe),y=P.useMemo(function(){return nge({breakAll:b.breakAll,children:b.children,maxLines:b.maxLines,scaleToFit:h,style:b.style,width:b.width})},[b.breakAll,b.children,b.maxLines,h,b.style,b.width]),T=b.dx,N=b.dy,j=b.angle,_=b.className,S=b.breakAll,k=VP(b,Ype);if(!lr(n)||!lr(i))return null;var I=n+(ie(T)?T:0),E=i+(ie(N)?N:0),C;switch(w){case"start":C=rb("calc(".concat(u,")"));break;case"middle":C=rb("calc(".concat((y.length-1)/2," * -").concat(l," + (").concat(u," / 2))"));break;default:C=rb("calc(".concat(y.length-1," * -").concat(l,")"));break}var R=[];if(h){var W=y[0].width,M=b.width;R.push("scale(".concat((ie(M)?M/W:1)/W,")"))}return j&&R.push("rotate(".concat(j,", ").concat(I,", ").concat(E,")")),R.length&&(k.transform=R.join(" ")),F.createElement("text",Tj({},je(k,!0),{x:I,y:E,className:Me("recharts-text",_),textAnchor:p,fill:v.includes("url")?qP:v}),y.map(function(L,U){var V=L.words.join(S?"":" ");return F.createElement("tspan",{x:I,dy:U===0?C:l,key:"".concat(V,"-").concat(U)},V)}))};function Ci(t,e){return t==null||e==null?NaN:t<e?-1:t>e?1:t>=e?0:NaN}function age(t,e){return t==null||e==null?NaN:e<t?-1:e>t?1:e>=t?0:NaN}function y_(t){let e,r,n;t.length!==2?(e=Ci,r=(l,c)=>Ci(t(l),c),n=(l,c)=>t(l)-c):(e=t===Ci||t===age?t:sge,r=t,n=t);function s(l,c,u=0,d=l.length){if(u<d){if(e(c,c)!==0)return d;do{const h=u+d>>>1;r(l[h],c)<0?u=h+1:d=h}while(u<d)}return u}function i(l,c,u=0,d=l.length){if(u<d){if(e(c,c)!==0)return d;do{const h=u+d>>>1;r(l[h],c)<=0?u=h+1:d=h}while(u<d)}return u}function o(l,c,u=0,d=l.length){const h=s(l,c,u,d-1);return h>u&&n(l[h-1],c)>-n(l[h],c)?h-1:h}return{left:s,center:o,right:i}}function sge(){return 0}function T$(t){return t===null?NaN:+t}function*ige(t,e){for(let r of t)r!=null&&(r=+r)>=r&&(yield r)}const oge=y_(Ci),Jm=oge.right;y_(T$).center;class WP extends Map{constructor(e,r=uge){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:r}}),e!=null)for(const[n,s]of e)this.set(n,s)}get(e){return super.get(GP(this,e))}has(e){return super.has(GP(this,e))}set(e,r){return super.set(lge(this,e),r)}delete(e){return super.delete(cge(this,e))}}function GP({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):r}function lge({_intern:t,_key:e},r){const n=e(r);return t.has(n)?t.get(n):(t.set(n,r),r)}function cge({_intern:t,_key:e},r){const n=e(r);return t.has(n)&&(r=t.get(n),t.delete(n)),r}function uge(t){return t!==null&&typeof t=="object"?t.valueOf():t}function dge(t=Ci){if(t===Ci)return A$;if(typeof t!="function")throw new TypeError("compare is not a function");return(e,r)=>{const n=t(e,r);return n||n===0?n:(t(r,r)===0)-(t(e,e)===0)}}function A$(t,e){return(t==null||!(t>=t))-(e==null||!(e>=e))||(t<e?-1:t>e?1:0)}const hge=Math.sqrt(50),mge=Math.sqrt(10),fge=Math.sqrt(2);function ex(t,e,r){const n=(e-t)/Math.max(0,r),s=Math.floor(Math.log10(n)),i=n/Math.pow(10,s),o=i>=hge?10:i>=mge?5:i>=fge?2:1;let l,c,u;return s<0?(u=Math.pow(10,-s)/o,l=Math.round(t*u),c=Math.round(e*u),l/u<t&&++l,c/u>e&&--c,u=-u):(u=Math.pow(10,s)*o,l=Math.round(t/u),c=Math.round(e/u),l*u<t&&++l,c*u>e&&--c),c<l&&.5<=r&&r<2?ex(t,e,r*2):[l,c,u]}function Aj(t,e,r){if(e=+e,t=+t,r=+r,!(r>0))return[];if(t===e)return[t];const n=e<t,[s,i,o]=n?ex(e,t,r):ex(t,e,r);
4507if(!(i>=s))return[];const l=i-s+1,c=new Array(l);if(n)if(o<0)for(let u=0;u<l;++u)c[u]=(i-u)/-o;else for(let u=0;u<l;++u)c[u]=(i-u)*o;else if(o<0)for(let u=0;u<l;++u)c[u]=(s+u)/-o;else for(let u=0;u<l;++u)c[u]=(s+u)*o;return c}function Ej(t,e,r){return e=+e,t=+t,r=+r,ex(t,e,r)[2]}function kj(t,e,r){e=+e,t=+t,r=+r;const n=e<t,s=n?Ej(e,t,r):Ej(t,e,r);return(n?-1:1)*(s<0?1/-s:s)}function KP(t,e){let r;for(const n of t)n!=null&&(r<n||r===void 0&&n>=n)&&(r=n);return r}function XP(t,e){let r;for(const n of t)n!=null&&(r>n||r===void 0&&n>=n)&&(r=n);return r}function E$(t,e,r=0,n=1/0,s){if(e=Math.floor(e),r=Math.floor(Math.max(0,r)),n=Math.floor(Math.min(t.length-1,n)),!(r<=e&&e<=n))return t;for(s=s===void 0?A$:dge(s);n>r;){if(n-r>600){const c=n-r+1,u=e-r+1,d=Math.log(c),h=.5*Math.exp(2*d/3),m=.5*Math.sqrt(d*h*(c-h)/c)*(u-c/2<0?-1:1),p=Math.max(r,Math.floor(e-u*h/c+m)),x=Math.min(n,Math.floor(e+(c-u)*h/c+m));E$(t,e,p,x,s)}const i=t[e];let o=r,l=n;for(jd(t,r,e),s(t[n],i)>0&&jd(t,r,n);o<l;){for(jd(t,o,l),++o,--l;s(t[o],i)<0;)++o;for(;s(t[l],i)>0;)--l}s(t[r],i)===0?jd(t,r,l):(++l,jd(t,l,n)),l<=e&&(r=l+1),e<=l&&(n=l-1)}return t}function jd(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function pge(t,e,r){if(t=Float64Array.from(ige(t)),!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return XP(t);if(e>=1)return KP(t);var n,s=(n-1)*e,i=Math.floor(s),o=KP(E$(t,i).subarray(0,i+1)),l=XP(t.subarray(i+1));return o+(l-o)*(s-i)}}function gge(t,e,r=T$){if(!(!(n=t.length)||isNaN(e=+e))){if(e<=0||n<2)return+r(t[0],0,t);if(e>=1)return+r(t[n-1],n-1,t);var n,s=(n-1)*e,i=Math.floor(s),o=+r(t[i],i,t),l=+r(t[i+1],i+1,t);return o+(l-o)*(s-i)}}function xge(t,e,r){t=+t,e=+e,r=(s=arguments.length)<2?(e=t,t=0,1):s<3?1:+r;for(var n=-1,s=Math.max(0,Math.ceil((e-t)/r))|0,i=new Array(s);++n<s;)i[n]=t+n*r;return i}function ta(t,e){switch(arguments.length){case 0:break;case 1:this.range(t);break;default:this.range(e).domain(t);break}return this}function Vs(t,e){switch(arguments.length){case 0:break;case 1:{typeof t=="function"?this.interpolator(t):this.range(t);break}default:{this.domain(t),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}const Pj=Symbol("implicit");function v_(){var t=new WP,e=[],r=[],n=Pj;function s(i){let o=t.get(i);if(o===void 0){if(n!==Pj)return n;t.set(i,o=e.push(i)-1)}return r[o%r.length]}return s.domain=function(i){if(!arguments.length)return e.slice();e=[],t=new WP;for(const o of i)t.has(o)||t.set(o,e.push(o)-1);return s},s.range=function(i){return arguments.length?(r=Array.from(i),s):r.slice()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return v_(e,r).unknown(n)},ta.apply(s,arguments),s}function Yh(){var t=v_().unknown(void 0),e=t.domain,r=t.range,n=0,s=1,i,o,l=!1,c=0,u=0,d=.5;delete t.unknown;function h(){var m=e().length,p=s<n,x=p?s:n,w=p?n:s;i=(w-x)/Math.max(1,m-c+u*2),l&&(i=Math.floor(i)),x+=(w-x-i*(m-c))*d,o=i*(1-c),l&&(x=Math.round(x),o=Math.round(o));var g=xge(m).map(function(v){return x+i*v});return r(p?g.reverse():g)}return t.domain=function(m){return arguments.length?(e(m),h()):e()},t.range=function(m){return arguments.length?([n,s]=m,n=+n,s=+s,h()):[n,s]},t.rangeRound=function(m){return[n,s]=m,n=+n,s=+s,l=!0,h()},t.bandwidth=function(){return o},t.step=function(){return i},t.round=function(m){return arguments.length?(l=!!m,h()):l},t.padding=function(m){return arguments.length?(c=Math.min(1,u=+m),h()):c},t.paddingInner=function(m){return arguments.length?(c=Math.min(1,m),h()):c},t.paddingOuter=function(m){return arguments.length?(u=+m,h()):u},t.align=function(m){return arguments.length?(d=Math.max(0,Math.min(1,m)),h()):d},t.copy=function(){return Yh(e(),[n,s]).round(l).paddingInner(c).paddingOuter(u).align(d)},ta.apply(h(),arguments)}function k$(t){var e=t.copy;return t.padding=t.paddingOuter,delete t.paddingInner,delete t.paddingOuter,t.copy=function(){return k$(e())},t}function sh(){return k$(Yh.apply(null,arguments).paddingInner(1))}function b_(t,e,r){t.prototype=e.prototype=r,r.constructor=t}function P$(t,e){var r=Object.create(t.prototype);for(var n in e)r[n]=e[n];return r}function Zm(){}var Qh=.7,tx=1/Qh,wc="\\s*([+-]?\\d+)\\s*",Jh="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Va="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",yge=/^#([0-9a-f]{3,8})$/,vge=new RegExp(`^rgb\\(${wc},${wc},${wc}\\)$`),bge=new RegExp(`^rgb\\(${Va},${Va},${Va}\\)$`),wge=new RegExp(`^rgba\\(${wc},${wc},${wc},${Jh}\\)$`),jge=new RegExp(`^rgba\\(${Va},${Va},${Va},${Jh}\\)$`),Nge=new RegExp(`^hsl\\(${Jh},${Va},${Va}\\)$`),_ge=new RegExp(`^hsla\\(${Jh},${Va},${Va},${Jh}\\)$`),YP={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};
vendor: 6,688 bytes, line 4507
4507b_(Zm,Zh,{copy(t){return Object.assign(new this.constructor,this,t)},displayable(){return this.rgb().displayable()},hex:QP,formatHex:QP,formatHex8:Sge,formatHsl:Tge,formatRgb:JP,toString:JP});function QP(){return this.rgb().formatHex()}function Sge(){return this.rgb().formatHex8()}function Tge(){return C$(this).formatHsl()}function JP(){return this.rgb().formatRgb()}function Zh(t){var e,r;return t=(t+"").trim().toLowerCase(),(e=yge.exec(t))?(r=e[1].length,e=parseInt(e[1],16),r===6?ZP(e):r===3?new un(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):r===8?rp(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):r===4?rp(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=vge.exec(t))?new un(e[1],e[2],e[3],1):(e=bge.exec(t))?new un(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=wge.exec(t))?rp(e[1],e[2],e[3],e[4]):(e=jge.exec(t))?rp(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=Nge.exec(t))?rC(e[1],e[2]/100,e[3]/100,1):(e=_ge.exec(t))?rC(e[1],e[2]/100,e[3]/100,e[4]):YP.hasOwnProperty(t)?ZP(YP[t]):t==="transparent"?new un(NaN,NaN,NaN,0):null}function ZP(t){return new un(t>>16&255,t>>8&255,t&255,1)}function rp(t,e,r,n){return n<=0&&(t=e=r=NaN),new un(t,e,r,n)}function Age(t){return t instanceof Zm||(t=Zh(t)),t?(t=t.rgb(),new un(t.r,t.g,t.b,t.opacity)):new un}function Cj(t,e,r,n){return arguments.length===1?Age(t):new un(t,e,r,n??1)}function un(t,e,r,n){this.r=+t,this.g=+e,this.b=+r,this.opacity=+n}b_(un,Cj,P$(Zm,{brighter(t){return t=t==null?tx:Math.pow(tx,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},darker(t){return t=t==null?Qh:Math.pow(Qh,t),new un(this.r*t,this.g*t,this.b*t,this.opacity)},rgb(){return this},clamp(){return new un(Oo(this.r),Oo(this.g),Oo(this.b),rx(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:eC,formatHex:eC,formatHex8:Ege,formatRgb:tC,toString:tC}));function eC(){return`#${No(this.r)}${No(this.g)}${No(this.b)}`}function Ege(){return`#${No(this.r)}${No(this.g)}${No(this.b)}${No((isNaN(this.opacity)?1:this.opacity)*255)}`}function tC(){const t=rx(this.opacity);return`${t===1?"rgb(":"rgba("}${Oo(this.r)}, ${Oo(this.g)}, ${Oo(this.b)}${t===1?")":`, ${t})`}`}function rx(t){return isNaN(t)?1:Math.max(0,Math.min(1,t))}function Oo(t){return Math.max(0,Math.min(255,Math.round(t)||0))}function No(t){return t=Oo(t),(t<16?"0":"")+t.toString(16)}function rC(t,e,r,n){return n<=0?t=e=r=NaN:r<=0||r>=1?t=e=NaN:e<=0&&(t=NaN),new ua(t,e,r,n)}function C$(t){if(t instanceof ua)return new ua(t.h,t.s,t.l,t.opacity);if(t instanceof Zm||(t=Zh(t)),!t)return new ua;if(t instanceof ua)return t;t=t.rgb();var e=t.r/255,r=t.g/255,n=t.b/255,s=Math.min(e,r,n),i=Math.max(e,r,n),o=NaN,l=i-s,c=(i+s)/2;return l?(e===i?o=(r-n)/l+(r<n)*6:r===i?o=(n-e)/l+2:o=(e-r)/l+4,l/=c<.5?i+s:2-i-s,o*=60):l=c>0&&c<1?0:o,new ua(o,l,c,t.opacity)}function kge(t,e,r,n){return arguments.length===1?C$(t):new ua(t,e,r,n??1)}function ua(t,e,r,n){this.h=+t,this.s=+e,this.l=+r,this.opacity=+n}b_(ua,kge,P$(Zm,{brighter(t){return t=t==null?tx:Math.pow(tx,t),new ua(this.h,this.s,this.l*t,this.opacity)},darker(t){return t=t==null?Qh:Math.pow(Qh,t),new ua(this.h,this.s,this.l*t,this.opacity)},rgb(){var t=this.h%360+(this.h<0)*360,e=isNaN(t)||isNaN(this.s)?0:this.s,r=this.l,n=r+(r<.5?r:1-r)*e,s=2*r-n;return new un(nb(t>=240?t-240:t+120,s,n),nb(t,s,n),nb(t<120?t+240:t-120,s,n),this.opacity)},clamp(){return new ua(nC(this.h),np(this.s),np(this.l),rx(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const t=rx(this.opacity);return`${t===1?"hsl(":"hsla("}${nC(this.h)}, ${np(this.s)*100}%, ${np(this.l)*100}%${t===1?")":`, ${t})`}`}}));function nC(t){return t=(t||0)%360,t<0?t+360:t}function np(t){return Math.max(0,Math.min(1,t||0))}function nb(t,e,r){return(t<60?e+(r-e)*t/60:t<180?r:t<240?e+(r-e)*(240-t)/60:e)*255}const w_=t=>()=>t;function Pge(t,e){return function(r){return t+r*e}}function Cge(t,e,r){return t=Math.pow(t,r),e=Math.pow(e,r)-t,r=1/r,function(n){return Math.pow(t+n*e,r)}}function Ige(t){return(t=+t)==1?I$:function(e,r){return r-e?Cge(e,r,t):w_(isNaN(e)?r:e)}}function I$(t,e){var r=e-t;return r?Pge(t,r):w_(isNaN(t)?e:t)}const aC=function t(e){var r=Ige(e);function n(s,i){var o=r((s=Cj(s)).r,(i=Cj(i)).r),l=r(s.g,i.g),c=r(s.b,i.b),u=I$(s.opacity,i.opacity);return function(d){return s.r=o(d),s.g=l(d),s.b=c(d),s.opacity=u(d),s+""}}return n.gamma=t,n}(1);function Oge(t,e){e||(e=[]);var r=t?Math.min(e.length,t.length):0,n=e.slice(),s;return function(i){for(s=0;s<r;++s)n[s]=t[s]*(1-i)+e[s]*i;return n}}function Rge(t){return ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Dge(t,e){var r=e?e.length:0,n=t?Math.min(r,t.length):0,s=new Array(n),i=new Array(r),o;for(o=0;o<n;++o)s[o]=Bu(t[o],e[o]);for(;o<r;++o)i[o]=e[o];return function(l){for(o=0;o<n;++o)i[o]=s[o](l);return i}}function Mge(t,e){var r=new Date;return t=+t,e=+e,function(n){return r.setTime(t*(1-n)+e*n),r}}function nx(t,e){return t=+t,e=+e,function(r){return t*(1-r)+e*r}}function $ge(t,e){var r={},n={},s;(t===null||typeof t!="object")&&(t={}),(e===null||typeof e!="object")&&(e={});for(s in e)s in t?r[s]=Bu(t[s],e[s]):n[s]=e[s];return function(i){for(s in r)n[s]=r[s](i);return n}}var Ij=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,ab=new RegExp(Ij.source,"g");function Lge(t){return function(){return t}}function Fge(t){return function(e){return t(e)+""}}function Bge(t,e){var r=Ij.lastIndex=ab.lastIndex=0,n,s,i,o=-1,l=[],c=[];for(t=t+"",e=e+"";(n=Ij.exec(t))&&(s=ab.exec(e));)(i=s.index)>r&&(i=e.slice(r,i),l[o]?l[o]+=i:l[++o]=i),(n=n[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:nx(n,s)})),r=ab.lastIndex;return r<e.length&&(i=e.slice(r),l[o]?l[o]+=i:l[++o]=i),l.length<2?c[0]?Fge(c[0].x):Lge(e):(e=c.length,function(u){for(var d=0,h;d<e;++d)l[(h=c[d]).i]=h.x(u);return l.join("")})}function Bu(t,e){var r=typeof e,n;return e==null||r==="boolean"?w_(e):(r==="number"?nx:r==="string"?(n=Zh(e))?(e=n,aC):Bge:e instanceof Zh?aC:e instanceof Date?Mge:Rge(e)?Oge:Array.isArray(e)?Dge:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?$ge:nx)(t,e)}function j_(t,e){return t=+t,e=+e,function(r){return Math.round(t*(1-r)+e*r)}}function Vge(t,e){e===void 0&&(e=t,t=Bu);for(var r=0,n=e.length-1,s=e[0],i=new Array(n<0?0:n);r<n;)i[r]=t(s,s=e[++r]);return function(o){var l=Math.max(0,Math.min(n-1,Math.floor(o*=n)));return i[l](o-l)}}function Uge(t){return function(){return t}}function ax(t){return+t}var sC=[0,1];function en(t){return t}function Oj(t,e){return(e-=t=+t)?function(r){return(r-t)/e}:Uge(isNaN(e)?NaN:.5)}
vendor: 4,591 bytes, line 4507
4507function zge(t,e){var r;return t>e&&(r=t,t=e,e=r),function(n){return Math.max(t,Math.min(e,n))}}function Hge(t,e,r){var n=t[0],s=t[1],i=e[0],o=e[1];return s<n?(n=Oj(s,n),i=r(o,i)):(n=Oj(n,s),i=r(i,o)),function(l){return i(n(l))}}function qge(t,e,r){var n=Math.min(t.length,e.length)-1,s=new Array(n),i=new Array(n),o=-1;for(t[n]<t[0]&&(t=t.slice().reverse(),e=e.slice().reverse());++o<n;)s[o]=Oj(t[o],t[o+1]),i[o]=r(e[o],e[o+1]);return function(l){var c=Jm(t,l,1,n)-1;return i[c](s[c](l))}}function ef(t,e){return e.domain(t.domain()).range(t.range()).interpolate(t.interpolate()).clamp(t.clamp()).unknown(t.unknown())}function iv(){var t=sC,e=sC,r=Bu,n,s,i,o=en,l,c,u;function d(){var m=Math.min(t.length,e.length);return o!==en&&(o=zge(t[0],t[m-1])),l=m>2?qge:Hge,c=u=null,h}function h(m){return m==null||isNaN(m=+m)?i:(c||(c=l(t.map(n),e,r)))(n(o(m)))}return h.invert=function(m){return o(s((u||(u=l(e,t.map(n),nx)))(m)))},h.domain=function(m){return arguments.length?(t=Array.from(m,ax),d()):t.slice()},h.range=function(m){return arguments.length?(e=Array.from(m),d()):e.slice()},h.rangeRound=function(m){return e=Array.from(m),r=j_,d()},h.clamp=function(m){return arguments.length?(o=m?!0:en,d()):o!==en},h.interpolate=function(m){return arguments.length?(r=m,d()):r},h.unknown=function(m){return arguments.length?(i=m,h):i},function(m,p){return n=m,s=p,d()}}function N_(){return iv()(en,en)}function Wge(t){return Math.abs(t=Math.round(t))>=1e21?t.toLocaleString("en").replace(/,/g,""):t.toString(10)}function sx(t,e){if((r=(t=e?t.toExponential(e-1):t.toExponential()).indexOf("e"))<0)return null;var r,n=t.slice(0,r);return[n.length>1?n[0]+n.slice(2):n,+t.slice(r+1)]}function Xc(t){return t=sx(Math.abs(t)),t?t[1]:NaN}function Gge(t,e){return function(r,n){for(var s=r.length,i=[],o=0,l=t[0],c=0;s>0&&l>0&&(c+l+1>n&&(l=Math.max(1,n-c)),i.push(r.substring(s-=l,s+l)),!((c+=l+1)>n));)l=t[o=(o+1)%t.length];return i.reverse().join(e)}}function Kge(t){return function(e){return e.replace(/[0-9]/g,function(r){return t[+r]})}}var Xge=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function em(t){if(!(e=Xge.exec(t)))throw new Error("invalid format: "+t);var e;return new __({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}em.prototype=__.prototype;function __(t){this.fill=t.fill===void 0?" ":t.fill+"",this.align=t.align===void 0?">":t.align+"",this.sign=t.sign===void 0?"-":t.sign+"",this.symbol=t.symbol===void 0?"":t.symbol+"",this.zero=!!t.zero,this.width=t.width===void 0?void 0:+t.width,this.comma=!!t.comma,this.precision=t.precision===void 0?void 0:+t.precision,this.trim=!!t.trim,this.type=t.type===void 0?"":t.type+""}__.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function Yge(t){e:for(var e=t.length,r=1,n=-1,s;r<e;++r)switch(t[r]){case".":n=s=r;break;case"0":n===0&&(n=r),s=r;break;default:if(!+t[r])break e;n>0&&(n=0);break}return n>0?t.slice(0,n)+t.slice(s+1):t}var O$;function Qge(t,e){var r=sx(t,e);if(!r)return t+"";var n=r[0],s=r[1],i=s-(O$=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=n.length;return i===o?n:i>o?n+new Array(i-o+1).join("0"):i>0?n.slice(0,i)+"."+n.slice(i):"0."+new Array(1-i).join("0")+sx(t,Math.max(0,e+i-1))[0]}function iC(t,e){var r=sx(t,e);if(!r)return t+"";var n=r[0],s=r[1];return s<0?"0."+new Array(-s).join("0")+n:n.length>s+1?n.slice(0,s+1)+"."+n.slice(s+1):n+new Array(s-n.length+2).join("0")}const oC={"%":(t,e)=>(t*100).toFixed(e),b:t=>Math.round(t).toString(2),c:t=>t+"",d:Wge,e:(t,e)=>t.toExponential(e),f:(t,e)=>t.toFixed(e),g:(t,e)=>t.toPrecision(e),o:t=>Math.round(t).toString(8),p:(t,e)=>iC(t*100,e),r:iC,s:Qge,X:t=>Math.round(t).toString(16).toUpperCase(),x:t=>Math.round(t).toString(16)};function lC(t){return t}var cC=Array.prototype.map,uC=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function Jge(t){var e=t.grouping===void 0||t.thousands===void 0?lC:Gge(cC.call(t.grouping,Number),t.thousands+""),r=t.currency===void 0?"":t.currency[0]+"",n=t.currency===void 0?"":t.currency[1]+"",s=t.decimal===void 0?".":t.decimal+"",i=t.numerals===void 0?lC:Kge(cC.call(t.numerals,String)),o=t.percent===void 0?"%":t.percent+"",l=t.minus===void 0?"−":t.minus+"",c=t.nan===void 0?"NaN":t.nan+"";function u(h){h=em(h);var m=h.fill,p=h.align,x=h.sign,w=h.symbol,g=h.zero,v=h.width,b=h.c
vendor: 5,677 bytes, line 4507
4507omma,y=h.precision,T=h.trim,N=h.type;N==="n"?(b=!0,N="g"):oC[N]||(y===void 0&&(y=12),T=!0,N="g"),(g||m==="0"&&p==="=")&&(g=!0,m="0",p="=");var j=w==="$"?r:w==="#"&&/[boxX]/.test(N)?"0"+N.toLowerCase():"",_=w==="$"?n:/[%p]/.test(N)?o:"",S=oC[N],k=/[defgprs%]/.test(N);y=y===void 0?6:/[gprs]/.test(N)?Math.max(1,Math.min(21,y)):Math.max(0,Math.min(20,y));function I(E){var C=j,R=_,W,M,L;if(N==="c")R=S(E)+R,E="";else{E=+E;var U=E<0||1/E<0;if(E=isNaN(E)?c:S(Math.abs(E),y),T&&(E=Yge(E)),U&&+E==0&&x!=="+"&&(U=!1),C=(U?x==="("?x:l:x==="-"||x==="("?"":x)+C,R=(N==="s"?uC[8+O$/3]:"")+R+(U&&x==="("?")":""),k){for(W=-1,M=E.length;++W<M;)if(L=E.charCodeAt(W),48>L||L>57){R=(L===46?s+E.slice(W+1):E.slice(W))+R,E=E.slice(0,W);break}}}b&&!g&&(E=e(E,1/0));var V=C.length+E.length+R.length,D=V<v?new Array(v-V+1).join(m):"";switch(b&&g&&(E=e(D+E,D.length?v-R.length:1/0),D=""),p){case"<":E=C+E+R+D;break;case"=":E=C+D+E+R;break;case"^":E=D.slice(0,V=D.length>>1)+C+E+R+D.slice(V);break;default:E=D+C+E+R;break}return i(E)}return I.toString=function(){return h+""},I}function d(h,m){var p=u((h=em(h),h.type="f",h)),x=Math.max(-8,Math.min(8,Math.floor(Xc(m)/3)))*3,w=Math.pow(10,-x),g=uC[8+x/3];return function(v){return p(w*v)+g}}return{format:u,formatPrefix:d}}var ap,S_,R$;Zge({thousands:",",grouping:[3],currency:["$",""]});function Zge(t){return ap=Jge(t),S_=ap.format,R$=ap.formatPrefix,ap}function exe(t){return Math.max(0,-Xc(Math.abs(t)))}function txe(t,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Xc(e)/3)))*3-Xc(Math.abs(t)))}function rxe(t,e){return t=Math.abs(t),e=Math.abs(e)-t,Math.max(0,Xc(e)-Xc(t))+1}function D$(t,e,r,n){var s=kj(t,e,r),i;switch(n=em(n??",f"),n.type){case"s":{var o=Math.max(Math.abs(t),Math.abs(e));return n.precision==null&&!isNaN(i=txe(s,o))&&(n.precision=i),R$(n,o)}case"":case"e":case"g":case"p":case"r":{n.precision==null&&!isNaN(i=rxe(s,Math.max(Math.abs(t),Math.abs(e))))&&(n.precision=i-(n.type==="e"));break}case"f":case"%":{n.precision==null&&!isNaN(i=exe(s))&&(n.precision=i-(n.type==="%")*2);break}}return S_(n)}function Ki(t){var e=t.domain;return t.ticks=function(r){var n=e();return Aj(n[0],n[n.length-1],r??10)},t.tickFormat=function(r,n){var s=e();return D$(s[0],s[s.length-1],r??10,n)},t.nice=function(r){r==null&&(r=10);var n=e(),s=0,i=n.length-1,o=n[s],l=n[i],c,u,d=10;for(l<o&&(u=o,o=l,l=u,u=s,s=i,i=u);d-- >0;){if(u=Ej(o,l,r),u===c)return n[s]=o,n[i]=l,e(n);if(u>0)o=Math.floor(o/u)*u,l=Math.ceil(l/u)*u;else if(u<0)o=Math.ceil(o*u)/u,l=Math.floor(l*u)/u;else break;c=u}return t},t}function ix(){var t=N_();return t.copy=function(){return ef(t,ix())},ta.apply(t,arguments),Ki(t)}function M$(t){var e;function r(n){return n==null||isNaN(n=+n)?e:n}return r.invert=r,r.domain=r.range=function(n){return arguments.length?(t=Array.from(n,ax),r):t.slice()},r.unknown=function(n){return arguments.length?(e=n,r):e},r.copy=function(){return M$(t).unknown(e)},t=arguments.length?Array.from(t,ax):[0,1],Ki(r)}function $$(t,e){t=t.slice();var r=0,n=t.length-1,s=t[r],i=t[n],o;return i<s&&(o=r,r=n,n=o,o=s,s=i,i=o),t[r]=e.floor(s),t[n]=e.ceil(i),t}function dC(t){return Math.log(t)}function hC(t){return Math.exp(t)}function nxe(t){return-Math.log(-t)}function axe(t){return-Math.exp(-t)}function sxe(t){return isFinite(t)?+("1e"+t):t<0?0:t}function ixe(t){return t===10?sxe:t===Math.E?Math.exp:e=>Math.pow(t,e)}function oxe(t){return t===Math.E?Math.log:t===10&&Math.log10||t===2&&Math.log2||(t=Math.log(t),e=>Math.log(e)/t)}function mC(t){return(e,r)=>-t(-e,r)}function T_(t){const e=t(dC,hC),r=e.domain;let n=10,s,i;function o(){return s=oxe(n),i=ixe(n),r()[0]<0?(s=mC(s),i=mC(i),t(nxe,axe)):t(dC,hC),e}return e.base=function(l){return arguments.length?(n=+l,o()):n},e.domain=function(l){return arguments.length?(r(l),o()):r()},e.ticks=l=>{const c=r();let u=c[0],d=c[c.length-1];const h=d<u;h&&([u,d]=[d,u]);let m=s(u),p=s(d),x,w;const g=l==null?10:+l;let v=[];if(!(n%1)&&p-m<g){if(m=Math.floor(m),p=Math.ceil(p),u>0){for(;m<=p;++m)for(x=1;x<n;++x)if(w=m<0?x/i(-m):x*i(m),!(w<u)){if(w>d)break;v.push(w)}}else for(;m<=p;++m)for(x=n-1;x>=1;--x)if(w=m>0?x/i(-m):x*i(m),!(w<u)){if(w>d)break;v.push(w)}v.length*2<g&&(v=Aj(u,d,g))}else v=Aj(m,p,Math.min(p-m,g)).map(i);return h?v.reverse():v},e.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=n===10?"s":","),typeof c!="function"&&(!(n%1)&&(c=em(c)).precision==null&&(c.trim=!0),c=S_(c)),l===1/0)return c;const u=Math.max(1,n*l/e.ticks().length);return d=>{let h=d/i(Math.round(s(d)));return h*n<n-.5&&(h*=n),h<=u?c(d):""}},e.nice=()=>r($$(r(),{floor:l=>i(Math.floor(s(l))),ceil:l=>i(Math.ceil(s(l)))})),e}function L$(){const t=T_(iv()).domain([1,10]);return t.copy=()=>ef(t,L$()).base(t.base()),ta.apply(t,arguments),t}function fC(t){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/t))}}function pC(t){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*t}}function A_(t){var e=1,r=t(fC(e),pC(e));return r.constant=function(n){return arguments.length?t(fC(e=+n),pC(e)):e},Ki(r)}function F$(){var t=A_(iv());return t.copy=function(){return ef(t,F$()).constant(t.constant())},ta.apply(t,arguments)}function gC(t){return function(e){return e<0?-Math.pow(-e,t):Math.pow(e,t)}}function lxe(t){return t<0?-Math.sqrt(-t):Math.sqrt(t)}function cxe(t){return t<0?-t*t:t*t}function E_(t){var e=t(en,en),r=1;function n(){return r===1?t(en,en):r===.5?t(lxe,cxe):t(gC(r),gC(1/r))}return e.exponent=function(s){return arguments.length?(r=+s,n()):r},Ki(e)}function k_(){var t=E_(iv());return t.copy=function(){return ef(t,k_()).exponent(t.exponent())},ta.apply(t,arguments),t}function uxe(){return k_.apply(null,arguments).exponent(.5)}function xC(t){return Math.sign(t)*t*t}
4507function dxe(t){return Math.sign(t)*Math.sqrt(Math.abs(t))}function B$(){var t=N_(),e=[0,1],r=!1,n;function s(i){var o=dxe(t(i));return isNaN(o)?n:r?Math.round(o):o}return s.invert=function(i){return t.invert(xC(i))},s.domain=function(i){return arguments.length?(t.domain(i),s):t.domain()},s.range=function(i){return arguments.length?(t.range((e=Array.from(i,ax)).map(xC)),s):e.slice()},s.rangeRound=function(i){return s.range(i).round(!0)},s.round=function(i){return arguments.length?(r=!!i,s):r},s.clamp=function(i){return arguments.length?(t.clamp(i),s):t.clamp()},s.unknown=function(i){return arguments.length?(n=i,s):n},s.copy=function(){return B$(t.domain(),e).round(r).clamp(t.clamp()).unknown(n)},ta.apply(s,arguments),Ki(s)}function V$(){var t=[],e=[],r=[],n;function s(){var o=0,l=Math.max(1,e.length);for(r=new Array(l-1);++o<l;)r[o-1]=gge(t,o/l);return i}function i(o){return o==null||isNaN(o=+o)?n:e[Jm(r,o)]}return i.invertExtent=function(o){var l=e.indexOf(o);return l<0?[NaN,NaN]:[l>0?r[l-1]:t[0],l<r.length?r[l]:t[t.length-1]]},i.domain=function(o){if(!arguments.length)return t.slice();t=[];for(let l of o)l!=null&&!isNaN(l=+l)&&t.push(l);return t.sort(Ci),s()},i.range=function(o){return arguments.length?(e=Array.from(o),s()):e.slice()},i.unknown=function(o){return arguments.length?(n=o,i):n},i.quantiles=function(){return r.slice()},i.copy=function(){return V$().domain(t).range(e).unknown(n)},ta.apply(i,arguments)}function U$(){var t=0,e=1,r=1,n=[.5],s=[0,1],i;function o(c){return c!=null&&c<=c?s[Jm(n,c,0,r)]:i}function l(){var c=-1;for(n=new Array(r);++c<r;)n[c]=((c+1)*e-(c-r)*t)/(r+1);return o}return o.domain=function(c){return arguments.length?([t,e]=c,t=+t,e=+e,l()):[t,e]},o.range=function(c){return arguments.length?(r=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var u=s.indexOf(c);return u<0?[NaN,NaN]:u<1?[t,n[0]]:u>=r?[n[r-1],e]:[n[u-1],n[u]]},o.unknown=function(c){return arguments.length&&(i=c),o},o.thresholds=function(){return n.slice()},o.copy=function(){return U$().domain([t,e]).range(s).unknown(i)},ta.apply(Ki(o),arguments)}function z$(){var t=[.5],e=[0,1],r,n=1;function s(i){return i!=null&&i<=i?e[Jm(t,i,0,n)]:r}return s.domain=function(i){return arguments.length?(t=Array.from(i),n=Math.min(t.length,e.length-1),s):t.slice()},s.range=function(i){return arguments.length?(e=Array.from(i),n=Math.min(t.length,e.length-1),s):e.slice()},s.invertExtent=function(i){var o=e.indexOf(i);return[t[o-1],t[o]]},s.unknown=function(i){return arguments.length?(r=i,s):r},s.copy=function(){return z$().domain(t).range(e).unknown(r)},ta.apply(s,arguments)}const sb=new Date,ib=new Date;function ur(t,e,r,n){function s(i){return t(i=arguments.length===0?new Date:new Date(+i)),i}return s.floor=i=>(t(i=new Date(+i)),i),s.ceil=i=>(t(i=new Date(i-1)),e(i,1),t(i),i),s.round=i=>{const o=s(i),l=s.ceil(i);return i-o<l-i?o:l},s.offset=(i,o)=>(e(i=new Date(+i),o==null?1:Math.floor(o)),i),s.range=(i,o,l)=>{const c=[];if(i=s.ceil(i),l=l==null?1:Math.floor(l),!(i<o)||!(l>0))return c;let u;do c.push(u=new Date(+i)),e(i,l),t(i);while(u<i&&i<o);return c},s.filter=i=>ur(o=>{if(o>=o)for(;t(o),!i(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;e(o,-1),!i(o););else for(;--l>=0;)for(;e(o,1),!i(o););}),r&&(s.count=(i,o)=>(sb.setTime(+i),ib.setTime(+o),t(sb),t(ib),Math.floor(r(sb,ib))),s.every=i=>(i=Math.floor(i),!isFinite(i)||!(i>0)?null:i>1?s.filter(n?o=>n(o)%i===0:o=>s.count(0,o)%i===0):s)),s}const ox=ur(()=>{},(t,e)=>{t.setTime(+t+e)},(t,e)=>e-t);ox.every=t=>(t=Math.floor(t),!isFinite(t)||!(t>0)?null:t>1?ur(e=>{e.setTime(Math.floor(e/t)*t)},(e,r)=>{e.setTime(+e+r*t)},(e,r)=>(r-e)/t):ox);ox.range;const hs=1e3,Wn=hs*60,ms=Wn*60,Ps=ms*24,P_=Ps*7,yC=Ps*30,ob=Ps*365,_o=ur(t=>{t.setTime(t-t.getMilliseconds())},(t,e)=>{t.setTime(+t+e*hs)},(t,e)=>(e-t)/hs,t=>t.getUTCSeconds());_o.range;const C_=ur(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*hs)},(t,e)=>{t.setTime(+t+e*Wn)},(t,e)=>(e-t)/Wn,t=>t.getMinutes());C_.range;const I_=ur(t=>{t.setUTCSeconds(0,0)},(t,e)=>{t.setTime(+t+e*Wn)},(t,e)=>(e-t)/Wn,t=>t.getUTCMinutes());I_.range;const O_=ur(t=>{t.setTime(t-t.getMilliseconds()-t.getSeconds()*hs-t.getMinutes()*Wn)},(t,e)=>{t.setTime(+t+e*ms)},(t,e)=>(e-t)/ms,t=>t.getHours());O_.range;const R_=ur(t=>{t.setUTCMinutes(0,0,0)},(t,e)=>{t.setTime(+t+e*ms)},(t,e)=>(e-t)/ms,t=>t.getUTCHours());R_.range;const tf=ur(t=>t.setHours(0,0,0,0),(t,e)=>t.setDate(t.getDate()+e),(t,e)=>(e-t-(e.getTimezoneOffset()-t.getTimezoneOffset())*Wn)/Ps,t=>t.getDate()-1);tf.range;const ov=ur(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ps,t=>t.getUTCDate()-1);ov.range;const H$=ur(t=>{t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCDate(t.getUTCDate()+e)},(t,e)=>(e-t)/Ps,t=>Math.floor(t/Ps));H$.range;function _l(t){return ur(e=>{e.setDate(e.getDate()-(e.getDay()+7-t)%7),e.setHours(0,0,0,0)},(e,r)=>{e.setDate(e.getDate()+r*7)},(e,r)=>(r-e-(r.getTimezoneOffset()-e.getTimezoneOffset())*Wn)/P_)}const lv=_l(0),lx=_l(1),hxe=_l(2),mxe=_l(3),Yc=_l(4),fxe=_l(5),pxe=_l(6);lv.range;lx.range;hxe.range;mxe.range;Yc.range;fxe.range;pxe.range;function Sl(t){return ur(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-t)%7),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCDate(e.getUTCDate()+r*7)},(e,r)=>(r-e)/P_)}const cv=Sl(0),cx=Sl(1),gxe=Sl(2),xxe=Sl(3),Qc=Sl(4),yxe=Sl(5),vxe=Sl(6);cv.range;cx.range;gxe.range;xxe.range;Qc.range;yxe.range;vxe.range;const D_=ur(t=>{t.setDate(1),t.setHours(0,0,0,0)},(t,e)=>{t.setMonth(t.getMonth()+e)},(t,e)=>e.getMonth()-t.getMonth()+(e.getFullYear()-t.getFullYear())*12,t=>t.getMonth());D_.range;const M_=ur(t=>{t.setUTCDate(1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCMonth(t.getUTCMonth()+e)},(t,e)=>e.getUTCMonth()-t.getUTCMonth()+(e.getUTCFullYear()-t.getUTCFullYear())*12,t=>t.getUTCMonth());M_.range;const Cs=ur(t=>{t.setMonth(0,1),t.setHours(0,0,0,0)},(t,e)=>{t.setFullYear(t.getFullYear()+e)},(t,e)=>e.getFullYear()-t.getFullYear(),t=>t.getFullYear());Cs.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ur(e=>{e.setFullYear(Math.floor(e.getFullYear()/t)*t),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,r)=>{e.setFullYear(e.getFullYear()+r*t)});Cs.range;const Is=ur(t=>{t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0)},(t,e)=>{t.setUTCFullYear(t.getUTCFullYear()+e)},(t,e)=>e.getUTCFullYear()-t.getUTCFullYear(),t=>t.getUTCFullYear());Is.every=t=>!isFinite(t=Math.floor(t))||!(t>0)?null:ur(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/t)*t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,r)=>{e.setUTCFullYear(e.getUTCFullYear()+r*t)});Is.range;function q$(t,e,r,n,s,i){const o=[[_o,1,hs],[_o,5,5*hs],[_o,15,15*hs],[_o,30,30*hs],[i,1,Wn],[i,5,5*Wn],[i,15,15*Wn],[i,30,30*Wn],[s,1,ms],[s,3,3*ms],[s,6,6*ms],[s,12,12*ms],[n,1,Ps],[n,2,2*Ps],[r,1,P_],[e,1,yC],[e,3,3*yC],[t,1,ob]];function l(u,d,h){const m=d<u;m&&([u,d]=[d,u]);const p=h&&typeof h.range=="function"?h:c(u,d,h),x=p?p.range(u,+d+1):[];return m?x.reverse():x}function c(u,d,h){const m=Math.abs(d-u)/h,p=y_(([,,g])=>g).right(o,m);if(p===o.length)return t.every(kj(u/ob,d/ob,h));if(p===0)return ox.every(Math.max(kj(u,d,h),1));const[x,w]=o[m/o[p-1][2]<o[p][2]/m?p-1:p];return x.every(w)}return[l,c]}const[bxe,wxe]=q$(Is,M_,cv,H$,R_,I_),[jxe,Nxe]=q$(Cs,D_,lv,tf,O_,C_);function lb(t){if(0<=t.y&&t.y<100){var e=new Date(-1,t.m,t.d,t.H,t.M,t.S,t.L);return e.setFullYear(t.y),e}return new Date(t.y,t.m,t.d,t.H,t.M,t.S,t.L)}function cb(t){if(0<=t.y&&t.y<100){var e=new Date(Date.UTC(-1,t.m,t.d,t.H,t.M,t.S,t.L));return e.setUTCFullYear(t.y),e}return new Date(Date.UTC(t.y,t.m,t.d,t.H,t.M,t.S,t.L))}function Nd(t,e,r){return{y:t,m:e,d:r,H:0,M:0,S:0,L:0}}function _xe(t){var e=t.dateTime,r=t.date,n=t.time,s=t.periods,i=t.days,o=t.shortDays,l=t.months,c=t.shortMonths,u=_d(s),d=Sd(s),h=_d(i),m=Sd(i),p=_d(o),x=Sd(o),w=_d(l),g=Sd(l),v=_d(c),b=Sd(c),y={a:U,A:V,b:D,B:z,c:null,d:_C,e:_C,f:Gxe,g:nye,G:sye,H:Hxe,I:qxe,j:Wxe,L:W$,m:Kxe,M:Xxe,p:K,q,Q:AC,s:EC,S:Yxe,u:Qxe,U:Jxe,V:Zxe,w:eye,W:tye,x:null,X:null,y:rye,Y:aye,Z:iye,"%":TC},T={a:H,A:ee,b:de,B:we,c:null,d:SC,e:SC,f:uye,g:bye,G:jye,H:oye,I:lye,j:cye,L:K$,m:dye,M:
vendor: 7,218 bytes, line 4507
4507hye,p:Le,q:ze,Q:AC,s:EC,S:mye,u:fye,U:pye,V:gye,w:xye,W:yye,x:null,X:null,y:vye,Y:wye,Z:Nye,"%":TC},N={a:I,A:E,b:C,B:R,c:W,d:jC,e:jC,f:Bxe,g:wC,G:bC,H:NC,I:NC,j:Mxe,L:Fxe,m:Dxe,M:$xe,p:k,q:Rxe,Q:Uxe,s:zxe,S:Lxe,u:kxe,U:Pxe,V:Cxe,w:Exe,W:Ixe,x:M,X:L,y:wC,Y:bC,Z:Oxe,"%":Vxe};y.x=j(r,y),y.X=j(n,y),y.c=j(e,y),T.x=j(r,T),T.X=j(n,T),T.c=j(e,T);function j(Q,me){return function(ve){var Z=[],X=-1,ue=0,ye=Q.length,B,re,ae;for(ve instanceof Date||(ve=new Date(+ve));++X<ye;)Q.charCodeAt(X)===37&&(Z.push(Q.slice(ue,X)),(re=vC[B=Q.charAt(++X)])!=null?B=Q.charAt(++X):re=B==="e"?" ":"0",(ae=me[B])&&(B=ae(ve,re)),Z.push(B),ue=X+1);return Z.push(Q.slice(ue,X)),Z.join("")}}function _(Q,me){return function(ve){var Z=Nd(1900,void 0,1),X=S(Z,Q,ve+="",0),ue,ye;if(X!=ve.length)return null;if("Q"in Z)return new Date(Z.Q);if("s"in Z)return new Date(Z.s*1e3+("L"in Z?Z.L:0));if(me&&!("Z"in Z)&&(Z.Z=0),"p"in Z&&(Z.H=Z.H%12+Z.p*12),Z.m===void 0&&(Z.m="q"in Z?Z.q:0),"V"in Z){if(Z.V<1||Z.V>53)return null;"w"in Z||(Z.w=1),"Z"in Z?(ue=cb(Nd(Z.y,0,1)),ye=ue.getUTCDay(),ue=ye>4||ye===0?cx.ceil(ue):cx(ue),ue=ov.offset(ue,(Z.V-1)*7),Z.y=ue.getUTCFullYear(),Z.m=ue.getUTCMonth(),Z.d=ue.getUTCDate()+(Z.w+6)%7):(ue=lb(Nd(Z.y,0,1)),ye=ue.getDay(),ue=ye>4||ye===0?lx.ceil(ue):lx(ue),ue=tf.offset(ue,(Z.V-1)*7),Z.y=ue.getFullYear(),Z.m=ue.getMonth(),Z.d=ue.getDate()+(Z.w+6)%7)}else("W"in Z||"U"in Z)&&("w"in Z||(Z.w="u"in Z?Z.u%7:"W"in Z?1:0),ye="Z"in Z?cb(Nd(Z.y,0,1)).getUTCDay():lb(Nd(Z.y,0,1)).getDay(),Z.m=0,Z.d="W"in Z?(Z.w+6)%7+Z.W*7-(ye+5)%7:Z.w+Z.U*7-(ye+6)%7);return"Z"in Z?(Z.H+=Z.Z/100|0,Z.M+=Z.Z%100,cb(Z)):lb(Z)}}function S(Q,me,ve,Z){for(var X=0,ue=me.length,ye=ve.length,B,re;X<ue;){if(Z>=ye)return-1;if(B=me.charCodeAt(X++),B===37){if(B=me.charAt(X++),re=N[B in vC?me.charAt(X++):B],!re||(Z=re(Q,ve,Z))<0)return-1}else if(B!=ve.charCodeAt(Z++))return-1}return Z}function k(Q,me,ve){var Z=u.exec(me.slice(ve));return Z?(Q.p=d.get(Z[0].toLowerCase()),ve+Z[0].length):-1}function I(Q,me,ve){var Z=p.exec(me.slice(ve));return Z?(Q.w=x.get(Z[0].toLowerCase()),ve+Z[0].length):-1}function E(Q,me,ve){var Z=h.exec(me.slice(ve));return Z?(Q.w=m.get(Z[0].toLowerCase()),ve+Z[0].length):-1}function C(Q,me,ve){var Z=v.exec(me.slice(ve));return Z?(Q.m=b.get(Z[0].toLowerCase()),ve+Z[0].length):-1}function R(Q,me,ve){var Z=w.exec(me.slice(ve));return Z?(Q.m=g.get(Z[0].toLowerCase()),ve+Z[0].length):-1}function W(Q,me,ve){return S(Q,e,me,ve)}function M(Q,me,ve){return S(Q,r,me,ve)}function L(Q,me,ve){return S(Q,n,me,ve)}function U(Q){return o[Q.getDay()]}function V(Q){return i[Q.getDay()]}function D(Q){return c[Q.getMonth()]}function z(Q){return l[Q.getMonth()]}function K(Q){return s[+(Q.getHours()>=12)]}function q(Q){return 1+~~(Q.getMonth()/3)}function H(Q){return o[Q.getUTCDay()]}function ee(Q){return i[Q.getUTCDay()]}function de(Q){return c[Q.getUTCMonth()]}function we(Q){return l[Q.getUTCMonth()]}function Le(Q){return s[+(Q.getUTCHours()>=12)]}function ze(Q){return 1+~~(Q.getUTCMonth()/3)}return{format:function(Q){var me=j(Q+="",y);return me.toString=function(){return Q},me},parse:function(Q){var me=_(Q+="",!1);return me.toString=function(){return Q},me},utcFormat:function(Q){var me=j(Q+="",T);return me.toString=function(){return Q},me},utcParse:function(Q){var me=_(Q+="",!0);return me.toString=function(){return Q},me}}}var vC={"-":"",_:" ",0:"0"},wr=/^\s*\d+/,Sxe=/^%/,Txe=/[\\^$*+?|[\]().{}]/g;function rt(t,e,r){var n=t<0?"-":"",s=(n?-t:t)+"",i=s.length;return n+(i<r?new Array(r-i+1).join(e)+s:s)}function Axe(t){return t.replace(Txe,"\\$&")}function _d(t){return new RegExp("^(?:"+t.map(Axe).join("|")+")","i")}function Sd(t){return new Map(t.map((e,r)=>[e.toLowerCase(),r]))}function Exe(t,e,r){var n=wr.exec(e.slice(r,r+1));return n?(t.w=+n[0],r+n[0].length):-1}function kxe(t,e,r){var n=wr.exec(e.slice(r,r+1));return n?(t.u=+n[0],r+n[0].length):-1}function Pxe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.U=+n[0],r+n[0].length):-1}function Cxe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.V=+n[0],r+n[0].length):-1}function Ixe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.W=+n[0],r+n[0].length):-1}function bC(t,e,r){var n=wr.exec(e.slice(r,r+4));return n?(t.y=+n[0],r+n[0].length):-1}function wC(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.y=+n[0]+(+n[0]>68?1900:2e3),r+n[0].length):-1}function Oxe(t,e,r){var n=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(r,r+6));return n?(t.Z=n[1]?0:-(n[2]+(n[3]||"00")),r+n[0].length):-1}function Rxe(t,e,r){var n=wr.exec(e.slice(r,r+1));return n?(t.q=n[0]*3-3,r+n[0].length):-1}function Dxe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.m=n[0]-1,r+n[0].length):-1}function jC(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.d=+n[0],r+n[0].length):-1}function Mxe(t,e,r){var n=wr.exec(e.slice(r,r+3));return n?(t.m=0,t.d=+n[0],r+n[0].length):-1}function NC(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.H=+n[0],r+n[0].length):-1}function $xe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.M=+n[0],r+n[0].length):-1}function Lxe(t,e,r){var n=wr.exec(e.slice(r,r+2));return n?(t.S=+n[0],r+n[0].length):-1}function Fxe(t,e,r){var n=wr.exec(e.slice(r,r+3));return n?(t.L=+n[0],r+n[0].length):-1}function Bxe(t,e,r){var n=wr.exec(e.slice(r,r+6));return n?(t.L=Math.floor(n[0]/1e3),r+n[0].length):-1}function Vxe(t,e,r){var n=Sxe.exec(e.slice(r,r+1));return n?r+n[0].length:-1}function Uxe(t,e,r){var n=wr.exec(e.slice(r));return n?(t.Q=+n[0],r+n[0].length):-1}function zxe(t,e,r){var n=wr.exec(e.slice(r));return n?(t.s=+n[0],r+n[0].length):-1}function _C(t,e){return rt(t.getDate(),e,2)}function Hxe(t,e){return rt(t.getHours(),e,2)}function qxe(t,e){return rt(t.getHours()%12||12,e,2)}function Wxe(t,e){return rt(1+tf.count(Cs(t),t),e,3)}function W$(t,e){return rt(t.getMilliseconds(),e,3)}function Gxe(t,e){return W$(t,e)+"000"}function Kxe(t,e){return rt(t.getMonth()+1,e,2)}function Xxe(t,e){return rt(t.getMinutes(),e,2)}function Yxe(t,e){return rt(t.getSeconds(),e,2)}function Qxe(t){var e=t.getDay();return e===0?7:e}function Jxe(t,e){return rt(lv.count(Cs(t)-1,t),e,2)}function G$(t){var e=t.getDay();return e>=4||e===0?Yc(t):Yc.ceil(t)}function Zxe(t,e){return t=G$(t),rt(Yc.count(Cs(t),t)+(Cs(t).getDay()===4),e,2)}function eye(t){return t.getDay()}function tye(t,e){return rt(lx.count(Cs(t)-1,t),e,2)}function rye(t,e){return rt(t.getFullYear()%100,e,2)}function nye(t,e){return t=G$(t),rt(t.getFullYear()%100,e,2)}function aye(t,e){return rt(t.getFullYear()%1e4,e,4)}function sye(t,e){var r=t.getDay();return t=r>=4||r===0?Yc(t):Yc.ceil(t),rt(t.getFullYear()%1e4,e,4)}function iye(t){var e=t.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+rt(e/60|0,"0",2)+rt(e%60,"0",2)}function SC(t,e){return rt(t.getUTCDate(),e,2)}function oye(t,e){return rt(t.getUTCHours(),e,2)}function lye(t,e){return rt(t.getUTCHours()%12||12,e,2)}function cye(t,e){return rt(1+ov.count(Is(t),t),e,3)}function K$(t,e){return rt(t.getUTCMilliseconds(),e,3)}function uye(t,e){return K$(t,e)+"000"}function dye(t,e){return rt(t.getUTCMonth()+1,e,2)}function hye(t,e){return rt(t.getUTCMinutes(),e,2)}function mye(t,e){return rt(t.getUTCSeconds(),e,2)}function fye(t){var e=t.getUTCDay();return e===0?7:e}function pye(t,e){return rt(cv.count(Is(t)-1,t),e,2)}
4507function X$(t){var e=t.getUTCDay();return e>=4||e===0?Qc(t):Qc.ceil(t)}function gye(t,e){return t=X$(t),rt(Qc.count(Is(t),t)+(Is(t).getUTCDay()===4),e,2)}function xye(t){return t.getUTCDay()}function yye(t,e){return rt(cx.count(Is(t)-1,t),e,2)}function vye(t,e){return rt(t.getUTCFullYear()%100,e,2)}function bye(t,e){return t=X$(t),rt(t.getUTCFullYear()%100,e,2)}function wye(t,e){return rt(t.getUTCFullYear()%1e4,e,4)}function jye(t,e){var r=t.getUTCDay();return t=r>=4||r===0?Qc(t):Qc.ceil(t),rt(t.getUTCFullYear()%1e4,e,4)}function Nye(){return"+0000"}function TC(){return"%"}function AC(t){return+t}function EC(t){return Math.floor(+t/1e3)}var Ml,Y$,Q$;_ye({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function _ye(t){return Ml=_xe(t),Y$=Ml.format,Ml.parse,Q$=Ml.utcFormat,Ml.utcParse,Ml}function Sye(t){return new Date(t)}function Tye(t){return t instanceof Date?+t:+new Date(+t)}function $_(t,e,r,n,s,i,o,l,c,u){var d=N_(),h=d.invert,m=d.domain,p=u(".%L"),x=u(":%S"),w=u("%I:%M"),g=u("%I %p"),v=u("%a %d"),b=u("%b %d"),y=u("%B"),T=u("%Y");function N(j){return(c(j)<j?p:l(j)<j?x:o(j)<j?w:i(j)<j?g:n(j)<j?s(j)<j?v:b:r(j)<j?y:T)(j)}return d.invert=function(j){return new Date(h(j))},d.domain=function(j){return arguments.length?m(Array.from(j,Tye)):m().map(Sye)},d.ticks=function(j){var _=m();return t(_[0],_[_.length-1],j??10)},d.tickFormat=function(j,_){return _==null?N:u(_)},d.nice=function(j){var _=m();return(!j||typeof j.range!="function")&&(j=e(_[0],_[_.length-1],j??10)),j?m($$(_,j)):d},d.copy=function(){return ef(d,$_(t,e,r,n,s,i,o,l,c,u))},d}function Aye(){return ta.apply($_(jxe,Nxe,Cs,D_,lv,tf,O_,C_,_o,Y$).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function Eye(){return ta.apply($_(bxe,wxe,Is,M_,cv,ov,R_,I_,_o,Q$).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function uv(){var t=0,e=1,r,n,s,i,o=en,l=!1,c;function u(h){return h==null||isNaN(h=+h)?c:o(s===0?.5:(h=(i(h)-r)*s,l?Math.max(0,Math.min(1,h)):h))}u.domain=function(h){return arguments.length?([t,e]=h,r=i(t=+t),n=i(e=+e),s=r===n?0:1/(n-r),u):[t,e]},u.clamp=function(h){return arguments.length?(l=!!h,u):l},u.interpolator=function(h){return arguments.length?(o=h,u):o};function d(h){return function(m){var p,x;return arguments.length?([p,x]=m,o=h(p,x),u):[o(0),o(1)]}}return u.range=d(Bu),u.rangeRound=d(j_),u.unknown=function(h){return arguments.length?(c=h,u):c},function(h){return i=h,r=h(t),n=h(e),s=r===n?0:1/(n-r),u}}function Xi(t,e){return e.domain(t.domain()).interpolator(t.interpolator()).clamp(t.clamp()).unknown(t.unknown())}function J$(){var t=Ki(uv()(en));return t.copy=function(){return Xi(t,J$())},Vs.apply(t,arguments)}function Z$(){var t=T_(uv()).domain([1,10]);return t.copy=function(){return Xi(t,Z$()).base(t.base())},Vs.apply(t,arguments)}function eL(){var t=A_(uv());return t.copy=function(){return Xi(t,eL()).constant(t.constant())},Vs.apply(t,arguments)}function L_(){var t=E_(uv());return t.copy=function(){return Xi(t,L_()).exponent(t.exponent())},Vs.apply(t,arguments)}function kye(){return L_.apply(null,arguments).exponent(.5)}function tL(){var t=[],e=en;function r(n){if(n!=null&&!isNaN(n=+n))return e((Jm(t,n,1)-1)/(t.length-1))}return r.domain=function(n){if(!arguments.length)return t.slice();t=[];for(let s of n)s!=null&&!isNaN(s=+s)&&t.push(s);return t.sort(Ci),r},r.interpolator=function(n){return arguments.length?(e=n,r):e},r.range=function(){return t.map((n,s)=>e(s/(t.length-1)))},r.quantiles=function(n){return Array.from({length:n+1},(s,i)=>pge(t,i/n))},r.copy=function(){return tL(e).domain(t)},Vs.apply(r,arguments)}function dv(){var t=0,e=.5,r=1,n=1,s,i,o,l,c,u=en,d,h=!1,m;function p(w){return isNaN(w=+w)?m:(w=.5+((w=+d(w))-i)*(n*w<n*i?l:c),u(h?Math.max(0,Math.min(1,w)):w))}p.domain=function(w){return arguments.length?([t,e,r]=w,s=d(t=+t),i=d(e=+e),o=d(r=+r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p):[t,e,r]},p.clamp=function(w){return arguments.length?(h=!!w,p):h},p.interpolator=function(w){return arguments.length?(u=w,p):u};function x(w){return function(g){var v,b,y;return arguments.length?([v,b,y]=g,u=Vge(w,[v,b,y]),p):[u(0),u(.5),u(1)]}}return p.range=x(Bu),p.rangeRound=x(j_),p.unknown=function(w){return arguments.length?(m=w,p):m},function(w){return d=w,s=w(t),i=w(e),o=w(r),l=s===i?0:.5/(i-s),c=i===o?0:.5/(o-i),n=i<s?-1:1,p}}function rL(){var t=Ki(dv()(en));return t.copy=function(){return Xi(t,rL())},Vs.apply(t,arguments)}function nL(){var t=T_(dv()).domain([.1,1,10]);return t.copy=function(){return Xi(t,nL()).base(t.base())},Vs.apply(t,arguments)}function aL(){var t=A_(dv());return t.copy=function(){return Xi(t,aL()).constant(t.constant())},Vs.apply(t,arguments)}function F_(){var t=E_(dv());return t.copy=function(){return Xi(t,F_()).exponent(t.exponent())},Vs.apply(t,arguments)}function Pye(){return F_.apply(null,arguments).exponent(.5)}const kC=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:Yh,scaleDiverging:rL,scaleDivergingLog:nL,scaleDivergingPow:F_,scaleDivergingSqrt:Pye,scaleDivergingSymlog:aL,scaleIdentity:M$,scaleImplicit:Pj,scaleLinear:ix,scaleLog:L$,scaleOrdinal:v_,scalePoint:sh,scalePow:k_,scaleQuantile:V$,scaleQuantize:U$,scaleRadial:B$,scaleSequential:J$,scaleSequentialLog:Z$,scaleSequentialPow:L_,scaleSequentialQuantile:tL,scaleSequentialSqrt:kye,scaleSequentialSymlog:eL,scaleSqrt:uxe,scaleSymlog:F$,scaleThreshold:z$,scaleTime:Aye,scaleUtc:Eye,tickFormat:D$},Symbol.toStringTag,{value:"Module"}));var Cye=Cu;function Iye(t,e,r){for(var n=-1,s=t.length;++n<s;){var i=t[n],o=e(i);if(o!=null&&(l===void 0?o===o&&!Cye(o):r(o,l)))var l=o,c=i}return c}var hv=Iye;function Oye(t,e){return t>e}var sL=Oye,Rye=hv,Dye=sL,Mye=Fu;function $ye(t){return t&&t.length?Rye(t,Mye,Dye):void 0}var Lye=$ye;const mi=nt(Lye);function Fye(t,e){return t<e}var iL=Fye,Bye=hv,Vye=iL,Uye=Fu;function zye(t){return t&&t.length?Bye(t,Uye,Vye):void 0}var Hye=zye;const mv=nt(Hye);var qye=Z2,Wye=Za,Gye=f$,Kye=yn;function Xye(t,e){var r=Kye(t)?qye:Gye;return r(t,Wye(e))}var Yye=Xye,Qye=h$,Jye=Yye;function Zye(t,e){return Qye(Jye(t,e),1)}var eve=Zye;const tve=nt(eve);var rve=f_;function nve(t,e){return rve(t,e)}var ave=nve;const ol=nt(ave);
vendor: 62,757 bytes, lines 4507-4534
4507var Vu=1e9,sve={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},V_,It=!0,Jn="[DecimalError] ",Ro=Jn+"Invalid argument: ",B_=Jn+"Exponent out of range: ",Uu=Math.floor,fo=Math.pow,ive=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Sn,fr=1e7,Tt=7,oL=9007199254740991,ux=Uu(oL/Tt),xe={};xe.absoluteValue=xe.abs=function(){var t=new this.constructor(this);return t.s&&(t.s=1),t};xe.comparedTo=xe.cmp=function(t){var e,r,n,s,i=this;if(t=new i.constructor(t),i.s!==t.s)return i.s||-t.s;if(i.e!==t.e)return i.e>t.e^i.s<0?1:-1;for(n=i.d.length,s=t.d.length,e=0,r=n<s?n:s;e<r;++e)if(i.d[e]!==t.d[e])return i.d[e]>t.d[e]^i.s<0?1:-1;return n===s?0:n>s^i.s<0?1:-1};xe.decimalPlaces=xe.dp=function(){var t=this,e=t.d.length-1,r=(e-t.e)*Tt;if(e=t.d[e],e)for(;e%10==0;e/=10)r--;return r<0?0:r};xe.dividedBy=xe.div=function(t){return ws(this,new this.constructor(t))};xe.dividedToIntegerBy=xe.idiv=function(t){var e=this,r=e.constructor;return xt(ws(e,new r(t),0,1),r.precision)};xe.equals=xe.eq=function(t){return!this.cmp(t)};xe.exponent=function(){return er(this)};xe.greaterThan=xe.gt=function(t){return this.cmp(t)>0};xe.greaterThanOrEqualTo=xe.gte=function(t){return this.cmp(t)>=0};xe.isInteger=xe.isint=function(){return this.e>this.d.length-2};xe.isNegative=xe.isneg=function(){return this.s<0};xe.isPositive=xe.ispos=function(){return this.s>0};xe.isZero=function(){return this.s===0};xe.lessThan=xe.lt=function(t){return this.cmp(t)<0};xe.lessThanOrEqualTo=xe.lte=function(t){return this.cmp(t)<1};xe.logarithm=xe.log=function(t){var e,r=this,n=r.constructor,s=n.precision,i=s+5;if(t===void 0)t=new n(10);else if(t=new n(t),t.s<1||t.eq(Sn))throw Error(Jn+"NaN");if(r.s<1)throw Error(Jn+(r.s?"NaN":"-Infinity"));return r.eq(Sn)?new n(0):(It=!1,e=ws(tm(r,i),tm(t,i),i),It=!0,xt(e,s))};xe.minus=xe.sub=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?uL(e,t):lL(e,(t.s=-t.s,t))};xe.modulo=xe.mod=function(t){var e,r=this,n=r.constructor,s=n.precision;if(t=new n(t),!t.s)throw Error(Jn+"NaN");return r.s?(It=!1,e=ws(r,t,0,1).times(t),It=!0,r.minus(e)):xt(new n(r),s)};xe.naturalExponential=xe.exp=function(){return cL(this)};xe.naturalLogarithm=xe.ln=function(){return tm(this)};xe.negated=xe.neg=function(){var t=new this.constructor(this);return t.s=-t.s||0,t};xe.plus=xe.add=function(t){var e=this;return t=new e.constructor(t),e.s==t.s?lL(e,t):uL(e,(t.s=-t.s,t))};xe.precision=xe.sd=function(t){var e,r,n,s=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Ro+t);if(e=er(s)+1,n=s.d.length-1,r=n*Tt+1,n=s.d[n],n){for(;n%10==0;n/=10)r--;for(n=s.d[0];n>=10;n/=10)r++}return t&&e>r?e:r};xe.squareRoot=xe.sqrt=function(){var t,e,r,n,s,i,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(Jn+"NaN")}for(t=er(l),It=!1,s=Math.sqrt(+l),s==0||s==1/0?(e=Oa(l.d),(e.length+t)%2==0&&(e+="0"),s=Math.sqrt(e),t=Uu((t+1)/2)-(t<0||t%2),s==1/0?e="5e"+t:(e=s.toExponential(),e=e.slice(0,e.indexOf("e")+1)+t),n=new c(e)):n=new c(s.toString()),r=c.precision,s=o=r+3;;)if(i=n,n=i.plus(ws(l,i,o+2)).times(.5),Oa(i.d).slice(0,o)===(e=Oa(n.d)).slice(0,o)){if(e=e.slice(o-3,o+1),s==o&&e=="4999"){if(xt(i,r+1,0),i.times(i).eq(l)){n=i;break}}else if(e!="9999")break;o+=4}return It=!0,xt(n,r)};xe.times=xe.mul=function(t){var e,r,n,s,i,o,l,c,u,d=this,h=d.constructor,m=d.d,p=(t=new h(t)).d;if(!d.s||!t.s)return new h(0);for(t.s*=d.s,r=d.e+t.e,c=m.length,u=p.length,c<u&&(i=m,m=p,p=i,o=c,c=u,u=o),i=[],o=c+u,n=o;n--;)i.push(0);for(n=u;--n>=0;){for(e=0,s=c+n;s>n;)l=i[s]+p[n]*m[s-n-1]+e,i[s--]=l%fr|0,e=l/fr|0;i[s]=(i[s]+e)%fr|0}for(;!i[--o];)i.pop();return e?++r:i.shift(),t.d=i,t.e=r,It?xt(t,h.precision):t};xe.toDecimalPlaces=xe.todp=function(t,e){var r=this,n=r.constructor;return r=new n(r),t===void 0?r:(Ya(t,0,Vu),e===void 0?e=n.rounding:Ya(e,0,8),xt(r,t+er(r)+1,e))};xe.toExponential=function(t,e){var r,n=this,s=n.constructor;return t===void 0?r=ll(n,!0):(Ya(t,0,Vu),e===void 0?e=s.rounding:Ya(e,0,8),n=xt(new s(n),t+1,e),r=ll(n,!0,t+1)),r};xe.toFixed=function(t,e){var r,n,s=this,i=s.constructor;return t===void 0?ll(s):(Ya(t,0,Vu),e===void 0?e=i.rounding:Ya(e,0,8),n=xt(new i(s),t+er(s)+1,e),r=ll(n.abs(),!1,t+er(n)+1),s.isneg()&&!s.isZero()?"-"+r:r)};xe.toInteger=xe.toint=function(){var t=this,e=t.constructor;return xt(new e(t),er(t)+1,e.rounding)};xe.toNumber=function(){return+this};xe.toPower=xe.pow=function(t){var e,r,n,s,i,o,l=this,c=l.constructor,u=12,d=+(t=new c(t));if(!t.s)return new c(Sn);if(l=new c(l),!l.s){if(t.s<1)throw Error(Jn+"Infinity");return l}if(l.eq(Sn))return l;if(n=c.precision,t.eq(Sn))return xt(l,n);if(e=t.e,r=t.d.length-1,o=e>=r,i=l.s,o){if((r=d<0?-d:d)<=oL){for(s=new c(Sn),e=Math.ceil(n/Tt+4),It=!1;r%2&&(s=s.times(l),CC(s.d,e)),r=Uu(r/2),r!==0;)l=l.times(l),CC(l.d,e);return It=!0,t.s<0?new c(Sn).div(s):xt(s,n)}}else if(i<0)throw Error(Jn+"NaN");return i=i<0&&t.d[Math.max(e,r)]&1?-1:1,l.s=1,It=!1,s=t.times(tm(l,n+u)),It=!0,s=cL(s),s.s=i,s};xe.toPrecision=function(t,e){var r,n,s=this,i=s.constructor;return t===void 0?(r=er(s),n=ll(s,r<=i.toExpNeg||r>=i.toExpPos)):(Ya(t,1,Vu),e===void 0?e=i.rounding:Ya(e,0,8),s=xt(new i(s),t,e),r=er(s),n=ll(s,t<=r||r<=i.toExpNeg,t)),n};xe.toSignificantDigits=xe.tosd=function(t,e){var r=this,n=r.constructor;return t===void 0?(t=n.precision,e=n.rounding):(Ya(t,1,Vu),e===void 0?e=n.rounding:Ya(e,0,8)),xt(new n(r),t,e)};xe.toString=xe.valueOf=xe.val=xe.toJSON=xe[Symbol.for("nodejs.util.inspect.custom")]=function(){var t=this,e=er(t),r=t.constructor;return ll(t,e<=r.toExpNeg||e>=r.toExpPos)};function lL(t,e){var r,n,s,i,o,l,c,u,d=t.constructor,h=d.precision;if(!t.s||!e.s)return e.s||(e=new d(t)),It?xt(e,h):e;if(c=t.d,u=e.d,o=t.e,s=e.e,c=c.slice(),i=o-s,i){for(i<0?(n=c,i=-i,l=u.length):(n=u,s=o,l=c.length),o=Math.ceil(h/Tt),l=o>l?o+1:l+1,i>l&&(i=l,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(l=c.length,i=u.length,l-i<0&&(i=l,n=u,u=c,c=n),r=0;i;)r=(c[--i]=c[i]+u[i]+r)/fr|0,c[i]%=fr;for(r&&(c.unshift(r),++s),l=c.length;c[--l]==0;)c.pop();return e.d=c,e.e=s,It?xt(e,h):e}function Ya(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Ro+t)}function Oa(t){var e,r,n,s=t.length-1,i="",o=t[0];if(s>0){for(i+=o,e=1;e<s;e++)n=t[e]+"",r=Tt-n.length,r&&(i+=Js(r)),i+=n;o=t[e],n=o+"",r=Tt-n.length,r&&(i+=Js(r))}else if(o===0)return"0";for(;o%10===0;)o/=10;return i+o}var ws=function(){function t(n,s){var i,o=0,l=n.length;for(n=n.slice();l--;)i=n[l]*s+o,n[l]=i%fr|0,o=i/fr|0;return o&&n.unshift(o),n}function e(n,s,i,o){var l,c;if(i!=o)c=i>o?1:-1;else for(l=c=0;l<i;l++)if(n[l]!=s[l]){c=n[l]>s[l]?1:-1;break}return c}function r(n,s,i){for(var o=0;i--;)n[i]-=o,o=n[i]<s[i]?1:0,n[i]=o*fr+n[i]-s[i];for(;!n[0]&&n.length>1;)n.shift()}return function(n,s,i,o){var l,c,u,d,h,m,p,x,w,g,v,b,y,T,N,j,_,S,k=n.constructor,I=n.s==s.s?1:-1,E=n.d,C=s.d;if(!n.s)return new k(n);if(!s.s)throw Error(Jn+"Division by zero");for(c=n.e-s.e,_=C.length,N=E.length,p=new k(I),x=p.d=[],u=0;C[u]==(E[u]||0);)++u;if(C[u]>(E[u]||0)&&--c,i==null?b=i=k.precision:o?b=i+(er(n)-er(s))+1:b=i,b<0)return new k(0);if(b=b/Tt+2|0,u=0,_==1)for(d=0,C=C[0],b++;(u<N||d)&&b--;u++)y=d*fr+(E[u]||0),x[u]=y/C|0,d=y%C|0;else{for(d=fr/(C[0]+1)|0,d>1&&(C=t(C,d),E=t(E,d),_=C.length,N=E.length),T=_,w=E.slice(0,_),g=w.length;g<_;)w[g++]=0;S=C.slice(),S.unshift(0),j=C[0],C[1]>=fr/2&&++j;do d=0,l=e(C,w,_,g),l<0?(v=w[0],_!=g&&(v=v*fr+(w[1]||0)),d=v/j|0,d>1?(d>=fr&&(d=fr-1),h=t(C,d),m=h.length,g=w.length,l=e(h,w,m,g),l==1&&(d--,r(h,_<m?S:C,m))):(d==0&&(l=d=1),h=C.slice()),m=h.length,m<g&&h.unshift(0),r(w,h,g),l==-1&&(g=w.length,l=e(C,w,_,g),l<1&&(d++,r(w,_<g?S:C,g))),g=w.length):l===0&&(d++,w=[0]),x[u++]=d,l&&w[0]?w[g++]=E[T]||0:(w=[E[T]],g=1);while((T++<N||w[0]!==void 0)&&b--)}return x[0]||x.shift(),p.e=c,xt(p,o?i+er(p)+1:i)}}();function cL(t,e){var r,n,s,i,o,l,c=0,u=0,d=t.constructor,h=d.precision;if(er(t)>16)throw Error(B_+er(t));if(!t.s)return new d(Sn);for(It=!1,l=h,o=new d(.03125);t.abs().gte(.1);)t=t.times(o),u+=5;for(n=Math.log(fo(2,u))/Math.LN10*2+5|0,l+=n,r=s=i=new d(Sn),d.precision=l;;){if(s=xt(s.times(t),l),r=r.times(++c),o=i.plus(ws(s,r,l)),Oa(o.d).slice(0,l)===Oa(i.d).slice(0,l)){for(;u--;)i=xt(i.times(i),l);return d.precision=h,e==null?(It=!0,xt(i,h)):i}i=o}}function er(t){for(var e=t.e*Tt,r=t.d[0];r>=10;r/=10)e++;return e}function ub(t,e,r){if(e>t.LN10.sd())throw It=!0,r&&(t.precision=r),Error(Jn+"LN10 precision limit exceeded");return xt(new t(t.LN10),e)}function Js(t){for(var e="";t--;)e+="0";return e}function tm(t,e){var r,n,s,i,o,l,c,u,d,h=1,m=10,p=t,x=p.d,w=p.constructor,g=w.precision;if(p.s<1)throw Error(Jn+(p.s?"NaN":"-Infinity"));if(p.eq(Sn))return new w(0);if(e==null?(It=!1,u=g):u=e,p.eq(10))return e==null&&(It=!0),ub(w,u);if(u+=m,w.precision=u,r=Oa(x),n=r.charAt(0),i=er(p),Math.abs(i)<15e14){for(;n<7&&n!=1||n==1&&r.charAt(1)>3;)p=p.times(t),r=Oa(p.d),n=r.charAt(0),h++;i=er(p),n>1?(p=new w("0."+r),i++):p=new w(n+"."+r.slice(1))}else return c=ub(w,u+2,g).times(i+""),p=tm(new w(n+"."+r.slice(1)),u-m).plus(c),w.precision=g,e==null?(It=!0,xt(p,g)):p;for(l=o=p=ws(p.minus(Sn),p.plus(Sn),u),d=xt(p.times(p),u),s=3;;){if(o=xt(o.times(d),u),c=l.plus(ws(o,new w(s),u)),Oa(c.d).slice(0,u)===Oa(l.d).slice(0,u))return l=l.times(2),i!==0&&(l=l.plus(ub(w,u+2,g).times(i+""))),l=ws(l,new w(h),u),w.precision=g,e==null?(It=!0,xt(l,g)):l;l=c,s+=2}}function PC(t,e){var r,n,s;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(n=e.search(/e/i))>0?(r<0&&(r=n),r+=+e.slice(n+1),e=e.substring(0,n)):r<0&&(r=e.length),n=0;e.charCodeAt(n)===48;)++n;for(s=e.length;e.charCodeAt(s-1)===48;)--s;if(e=e.slice(n,s),e){if(s-=n,r=r-n-1,t.e=Uu(r/Tt),t.d=[],n=(r+1)%Tt,r<0&&(n+=Tt),n<s){for(n&&t.d.push(+e.slice(0,n)),s-=Tt;n<s;)t.d.push(+e.slice(n,n+=Tt));e=e.slice(n),n=Tt-e.length}else n-=s;for(;n--;)e+="0";if(t.d.push(+e),It&&(t.e>ux||t.e<-ux))throw Error(B_+r)}else t.s=0,t.e=0,t.d=[0];return t}function xt(t,e,r){var n,s,i,o,l,c,u,d,h=t.d;for(o=1,i=h[0];i>=10;i/=10)o++;if(n=e-o,n<0)n+=Tt,s=e,u=h[d=0];else{if(d=Math.ceil((n+1)/Tt),i=h.length,d>=i)return t;for(u=i=h[d],o=1;i>=10;i/=10)o++;n%=Tt,s=n-Tt+o}if(r!==void 0&&(i=fo(10,o-s-1),l=u/i%10|0,c=e<0||h[d+1]!==void 0||u%i,c=r<4?(l||c)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||c||r==6&&(n>0?s>0?u/fo(10,o-s):0:h[d-1])%10&1||r==(t.s<0?8:7))),e<1||!h[0])return c?(i=er(t),h.length=1,e=e-i-1,h[0]=fo(10,(Tt-e%Tt)%Tt),t.e=Uu(-e/Tt)||0):(h.length=1,h[0]=t.e=t.s=0),t;if(n==0?(h.length=d,i=1,d--):(h.length=d+1,i=fo(10,Tt-n),h[d]=s>0?(u/fo(10,o-s)%fo(10,s)|0)*i:0),c)for(;;)if(d==0){(h[0]+=i)==fr&&(h[0]=1,++t.e);break}else{if(h[d]+=i,h[d]!=fr)break;h[d--]=0,i=1}for(n=h.length;h[--n]===0;)h.pop();if(It&&(t.e>ux||t.e<-ux))throw Error(B_+er(t));return t}function uL(t,e){var r,n,s,i,o,l,c,u,d,h,m=t.constructor,p=m.precision;if(!t.s||!e.s)return e.s?e.s=-e.s:e=new m(t),It?xt(e,p):e;if(c=t.d,h=e.d,n=e.e,u=t.e,c=c.slice(),o=u-n,o){for(d=o<0,d?(r=c,o=-o,l=h.length):(r=h,n=u,l=c.length),s=Math.max(Math.ceil(p/Tt),l)+2,o>s&&(o=s,r.length=1),r.reverse(),s=o;s--;)r.push(0);r.reverse()}else{for(s=c.length,l=h.length,d=s<l,d&&(l=s),s=0;s<l;s++)if(c[s]!=h[s]){d=c[s]<h[s];break}o=0}for(d&&(r=c,c=h,h=r,e.s=-e.s),l=c.length,s=h.length-l;s>0;--s)c[l++]=0;for(s=h.length;s>o;){if(c[--s]<h[s]){for(i=s;i&&c[--i]===0;)c[i]=fr-1;--c[i],c[s]+=fr}c[s]-=h[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--n;return c[0]?(e.d=c,e.e=n,It?xt(e,p):e):new m(0)}function ll(t,e,r){var n,s=er(t),i=Oa(t.d),o=i.length;return e?(r&&(n=r-o)>0?i=i.charAt(0)+"."+i.slice(1)+Js(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(s<0?"e":"e+")+s):s<0?(i="0."+Js(-s-1)+i,r&&(n=r-o)>0&&(i+=Js(n))):s>=o?(i+=Js(s+1-o),r&&(n=r-s-1)>0&&(i=i+"."+Js(n))):((n=s+1)<o&&(i=i.slice(0,n)+"."+i.slice(n)),r&&(n=r-o)>0&&(s+1===o&&(i+="."),i+=Js(n))),t.s<0?"-"+i:i}function CC(t,e){if(t.length>e)return t.length=e,!0}function dL(t){var e,r,n;function s(i){var o=this;if(!(o instanceof s))return new s(i);if(o.constructor=s,i instanceof s){o.s=i.s,o.e=i.e,o.d=(i=i.d)?i.slice():i;return}if(typeof i=="number"){if(i*0!==0)throw Error(Ro+i);if(i>0)o.s=1;else if(i<0)i=-i,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(i===~~i&&i<1e7){o.e=0,o.d=[i];return}return PC(o,i.toString())}else if(typeof i!="string")throw Error(Ro+i);if(i.charCodeAt(0)===45?(i=i.slice(1),o.s=-1):o.s=1,ive.test(i))PC(o,i);else throw Error(Ro+i)}if(s.prototype=xe,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=dL,s.config=s.set=ove,t===void 0&&(t={}),t)for(n=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<n.length;)t.hasOwnProperty(r=n[e++])||(t[r]=this[r]);return s.config(t),s}function ove(t){if(!t||typeof t!="object")throw Error(Jn+"Object expected");var e,r,n,s=["precision",1,Vu,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<s.length;e+=3)if((n=t[r=s[e]])!==void 0)if(Uu(n)===n&&n>=s[e+1]&&n<=s[e+2])this[r]=n;else throw Error(Ro+r+": "+n);if((n=t[r="LN10"])!==void 0)if(n==Math.LN10)this[r]=new this(n);else throw Error(Ro+r+": "+n);return this}var V_=dL(sve);Sn=new V_(1);const ft=V_;function lve(t){return hve(t)||dve(t)||uve(t)||cve()}function cve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4508In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function uve(t,e){if(t){if(typeof t=="string")return Rj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Rj(t,e)}}function dve(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function hve(t){if(Array.isArray(t))return Rj(t)}function Rj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var mve=function(e){return e},hL={},mL=function(e){return e===hL},IC=function(e){return function r(){return arguments.length===0||arguments.length===1&&mL(arguments.length<=0?void 0:arguments[0])?r:e.apply(void 0,arguments)}},fve=function t(e,r){return e===1?r:IC(function(){for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];var o=s.filter(function(l){return l!==hL}).length;return o>=e?r.apply(void 0,s):t(e-o,IC(function(){for(var l=arguments.length,c=new Array(l),u=0;u<l;u++)c[u]=arguments[u];var d=s.map(function(h){return mL(h)?c.shift():h});return r.apply(void 0,lve(d).concat(c))}))})},fv=function(e){return fve(e.length,e)},Dj=function(e,r){for(var n=[],s=e;s<r;++s)n[s-e]=s;return n},pve=fv(function(t,e){return Array.isArray(e)?e.map(t):Object.keys(e).map(function(r){return e[r]}).map(t)}),gve=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];if(!r.length)return mve;var s=r.reverse(),i=s[0],o=s.slice(1);return function(){return o.reduce(function(l,c){return c(l)},i.apply(void 0,arguments))}},Mj=function(e){return Array.isArray(e)?e.reverse():e.split("").reverse.join("")},fL=function(e){var r=null,n=null;return function(){for(var s=arguments.length,i=new Array(s),o=0;o<s;o++)i[o]=arguments[o];return r&&i.every(function(l,c){return l===r[c]})||(r=i,n=e.apply(void 0,i)),n}};function xve(t){var e;return t===0?e=1:e=Math.floor(new ft(t).abs().log(10).toNumber())+1,e}function yve(t,e,r){for(var n=new ft(t),s=0,i=[];n.lt(e)&&s<1e5;)i.push(n.toNumber()),n=n.add(r),s++;return i}var vve=fv(function(t,e,r){var n=+t,s=+e;return n+r*(s-n)}),bve=fv(function(t,e,r){var n=e-+t;return n=n||1/0,(r-t)/n}),wve=fv(function(t,e,r){var n=e-+t;return n=n||1/0,Math.max(0,Math.min(1,(r-t)/n))});const pv={rangeStep:yve,getDigitCount:xve,interpolateNumber:vve,uninterpolateNumber:bve,uninterpolateTruncation:wve};function $j(t){return _ve(t)||Nve(t)||pL(t)||jve()}function jve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4509In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Nve(t){if(typeof Symbol<"u"&&Symbol.iterator in Object(t))return Array.from(t)}function _ve(t){if(Array.isArray(t))return Lj(t)}function rm(t,e){return Ave(t)||Tve(t,e)||pL(t,e)||Sve()}function Sve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4510In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function pL(t,e){if(t){if(typeof t=="string")return Lj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Lj(t,e)}}function Lj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Tve(t,e){if(!(typeof Symbol>"u"||!(Symbol.iterator in Object(t)))){var r=[],n=!0,s=!1,i=void 0;try{for(var o=t[Symbol.iterator](),l;!(n=(l=o.next()).done)&&(r.push(l.value),!(e&&r.length===e));n=!0);}catch(c){s=!0,i=c}finally{try{!n&&o.return!=null&&o.return()}finally{if(s)throw i}}return r}}function Ave(t){if(Array.isArray(t))return t}function gL(t){var e=rm(t,2),r=e[0],n=e[1],s=r,i=n;return r>n&&(s=n,i=r),[s,i]}function xL(t,e,r){if(t.lte(0))return new ft(0);var n=pv.getDigitCount(t.toNumber()),s=new ft(10).pow(n),i=t.div(s),o=n!==1?.05:.1,l=new ft(Math.ceil(i.div(o).toNumber())).add(r).mul(o),c=l.mul(s);return e?c:new ft(Math.ceil(c))}function Eve(t,e,r){var n=1,s=new ft(t);if(!s.isint()&&r){var i=Math.abs(t);i<1?(n=new ft(10).pow(pv.getDigitCount(t)-1),s=new ft(Math.floor(s.div(n).toNumber())).mul(n)):i>1&&(s=new ft(Math.floor(t)))}else t===0?s=new ft(Math.floor((e-1)/2)):r||(s=new ft(Math.floor(t)));var o=Math.floor((e-1)/2),l=gve(pve(function(c){return s.add(new ft(c-o).mul(n)).toNumber()}),Dj);return l(0,e)}function yL(t,e,r,n){var s=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0;if(!Number.isFinite((e-t)/(r-1)))return{step:new ft(0),tickMin:new ft(0),tickMax:new ft(0)};var i=xL(new ft(e).sub(t).div(r-1),n,s),o;t<=0&&e>=0?o=new ft(0):(o=new ft(t).add(e).div(2),o=o.sub(new ft(o).mod(i)));var l=Math.ceil(o.sub(t).div(i).toNumber()),c=Math.ceil(new ft(e).sub(o).div(i).toNumber()),u=l+c+1;return u>r?yL(t,e,r,n,s+1):(u<r&&(c=e>0?c+(r-u):c,l=e>0?l:l+(r-u)),{step:i,tickMin:o.sub(new ft(l).mul(i)),tickMax:o.add(new ft(c).mul(i))})}function kve(t){var e=rm(t,2),r=e[0],n=e[1],s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=Math.max(s,2),l=gL([r,n]),c=rm(l,2),u=c[0],d=c[1];if(u===-1/0||d===1/0){var h=d===1/0?[u].concat($j(Dj(0,s-1).map(function(){return 1/0}))):[].concat($j(Dj(0,s-1).map(function(){return-1/0})),[d]);return r>n?Mj(h):h}if(u===d)return Eve(u,s,i);var m=yL(u,d,o,i),p=m.step,x=m.tickMin,w=m.tickMax,g=pv.rangeStep(x,w.add(new ft(.1).mul(p)),p);return r>n?Mj(g):g}function Pve(t,e){var r=rm(t,2),n=r[0],s=r[1],i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,o=gL([n,s]),l=rm(o,2),c=l[0],u=l[1];if(c===-1/0||u===1/0)return[n,s];if(c===u)return[c];var d=Math.max(e,2),h=xL(new ft(u).sub(c).div(d-1),i,0),m=[].concat($j(pv.rangeStep(new ft(c),new ft(u).sub(new ft(.99).mul(h)),h)),[u]);return n>s?Mj(m):m}var Cve=fL(kve),Ive=fL(Pve),Ove="Invariant failed";function cl(t,e){throw new Error(Ove)}var Rve=["offset","layout","width","dataKey","data","dataPointFormatter","xAxis","yAxis"];function Jc(t){"@babel/helpers - typeof";return Jc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Jc(t)}function dx(){return dx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},dx.apply(this,arguments)}function Dve(t,e){return Fve(t)||Lve(t,e)||$ve(t,e)||Mve()}function Mve(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4511In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $ve(t,e){if(t){if(typeof t=="string")return OC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return OC(t,e)}}function OC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lve(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Fve(t){if(Array.isArray(t))return t}function Bve(t,e){if(t==null)return{};var r=Vve(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Vve(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Uve(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zve(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,wL(n.key),n)}}function Hve(t,e,r){return e&&zve(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function qve(t,e,r){return e=hx(e),Wve(t,vL()?Reflect.construct(e,r||[],hx(t).constructor):e.apply(t,r))}function Wve(t,e){if(e&&(Jc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Gve(t)}function Gve(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function vL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(vL=function(){return!!t})()}function hx(t){return hx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},hx(t)}function Kve(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Fj(t,e)}function Fj(t,e){return Fj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Fj(t,e)}function bL(t,e,r){return e=wL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function wL(t){var e=Xve(t,"string");return Jc(e)=="symbol"?e:e+""}function Xve(t,e){if(Jc(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Jc(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var rf=function(t){function e(){return Uve(this,e),qve(this,e,arguments)}return Kve(e,t),Hve(e,[{key:"render",value:function(){var n=this.props,s=n.offset,i=n.layout,o=n.width,l=n.dataKey,c=n.data,u=n.dataPointFormatter,d=n.xAxis,h=n.yAxis,m=Bve(n,Rve),p=je(m,!1);this.props.direction==="x"&&d.type!=="number"&&cl();var x=c.map(function(w){var g=u(w,l),v=g.x,b=g.y,y=g.value,T=g.errorVal;if(!T)return null;var N=[],j,_;if(Array.isArray(T)){var S=Dve(T,2);j=S[0],_=S[1]}else j=_=T;if(i==="vertical"){var k=d.scale,I=b+s,E=I+o,C=I-o,R=k(y-j),W=k(y+_);N.push({x1:W,y1:E,x2:W,y2:C}),N.push({x1:R,y1:I,x2:W,y2:I}),N.push({x1:R,y1:E,x2:R,y2:C})}else if(i==="horizontal"){var M=h.scale,L=v+s,U=L-o,V=L+o,D=M(y-j),z=M(y+_);N.push({x1:U,y1:z,x2:V,y2:z}),N.push({x1:L,y1:D,x2:L,y2:z}),N.push({x1:U,y1:D,x2:V,y2:D})}return F.createElement(Ve,dx({className:"recharts-errorBar",key:"bar-".concat(N.map(function(K){return"".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))},p),N.map(function(K){return F.createElement("line",dx({},K,{key:"line-".concat(K.x1,"-").concat(K.x2,"-").concat(K.y1,"-").concat(K.y2)}))}))});return F.createElement(Ve,{className:"recharts-errorBars"},x)}}])}(F.Component);bL(rf,"defaultProps",{stroke:"black",strokeWidth:1.5,width:5,offset:0,layout:"horizontal"});bL(rf,"displayName","ErrorBar");function nm(t){"@babel/helpers - typeof";return nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nm(t)}function RC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ao(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?RC(Object(r),!0).forEach(function(n){Yve(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):RC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Yve(t,e,r){return e=Qve(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qve(t){var e=Jve(t,"string");return nm(e)=="symbol"?e:e+""}function Jve(t,e){if(nm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var jL=function(e){var r=e.children,n=e.formattedGraphicalItems,s=e.legendWidth,i=e.legendContent,o=_n(r,Io);if(!o)return null;var l=Io.defaultProps,c=l!==void 0?ao(ao({},l),o.props):{},u;return o.props&&o.props.payload?u=o.props&&o.props.payload:i==="children"?u=(n||[]).reduce(function(d,h){var m=h.item,p=h.props,x=p.sectors||p.data||[];return d.concat(x.map(function(w){return{type:o.props.iconType||m.props.legendType,value:w.name,color:w.fill,payload:w}}))},[]):u=(n||[]).map(function(d){var h=d.item,m=h.type.defaultProps,p=m!==void 0?ao(ao({},m),h.props):{},x=p.dataKey,w=p.name,g=p.legendType,v=p.hide;return{inactive:v,dataKey:x,type:c.iconType||g||"square",color:U_(h),value:w||x,payload:p}}),ao(ao(ao({},c),Io.getWithHeight(o,s)),{},{payload:u,item:o})};function am(t){"@babel/helpers - typeof";return am=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},am(t)}function DC(t){return r0e(t)||t0e(t)||e0e(t)||Zve()}function Zve(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4512In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function e0e(t,e){if(t){if(typeof t=="string")return Bj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Bj(t,e)}}function t0e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function r0e(t){if(Array.isArray(t))return Bj(t)}function Bj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function MC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Vt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?MC(Object(r),!0).forEach(function(n){jc(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):MC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jc(t,e,r){return e=n0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function n0e(t){var e=a0e(t,"string");return am(e)=="symbol"?e:e+""}function a0e(t,e){if(am(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(am(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Gt(t,e,r){return Ie(t)||Ie(e)?r:lr(e)?Cn(t,e,r):Ee(e)?e(t):r}function ih(t,e,r,n){var s=tve(t,function(l){return Gt(l,e)});if(r==="number"){var i=s.filter(function(l){return ie(l)||parseFloat(l)});return i.length?[mv(i),mi(i)]:[1/0,-1/0]}var o=n?s.filter(function(l){return!Ie(l)}):s;return o.map(function(l){return lr(l)||l instanceof Date?l:""})}var s0e=function(e){var r,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=-1,l=(r=n==null?void 0:n.length)!==null&&r!==void 0?r:0;if(l<=1)return 0;if(i&&i.axisType==="angleAxis"&&Math.abs(Math.abs(i.range[1]-i.range[0])-360)<=1e-6)for(var c=i.range,u=0;u<l;u++){var d=u>0?s[u-1].coordinate:s[l-1].coordinate,h=s[u].coordinate,m=u>=l-1?s[0].coordinate:s[u+1].coordinate,p=void 0;if(Jr(h-d)!==Jr(m-h)){var x=[];if(Jr(m-h)===Jr(c[1]-c[0])){p=m;var w=h+c[1]-c[0];x[0]=Math.min(w,(w+d)/2),x[1]=Math.max(w,(w+d)/2)}else{p=d;var g=m+c[1]-c[0];x[0]=Math.min(h,(g+h)/2),x[1]=Math.max(h,(g+h)/2)}var v=[Math.min(h,(p+h)/2),Math.max(h,(p+h)/2)];if(e>v[0]&&e<=v[1]||e>=x[0]&&e<=x[1]){o=s[u].index;break}}else{var b=Math.min(d,m),y=Math.max(d,m);if(e>(b+h)/2&&e<=(y+h)/2){o=s[u].index;break}}}else for(var T=0;T<l;T++)if(T===0&&e<=(n[T].coordinate+n[T+1].coordinate)/2||T>0&&T<l-1&&e>(n[T].coordinate+n[T-1].coordinate)/2&&e<=(n[T].coordinate+n[T+1].coordinate)/2||T===l-1&&e>(n[T].coordinate+n[T-1].coordinate)/2){o=n[T].index;break}return o},U_=function(e){var r,n=e,s=n.type.displayName,i=(r=e.type)!==null&&r!==void 0&&r.defaultProps?Vt(Vt({},e.type.defaultProps),e.props):e.props,o=i.stroke,l=i.fill,c;switch(s){case"Line":c=o;break;case"Area":case"Radar":c=o&&o!=="none"?o:l;break;default:c=l;break}return c},i0e=function(e){var r=e.barSize,n=e.totalSize,s=e.stackGroups,i=s===void 0?{}:s;if(!i)return{};for(var o={},l=Object.keys(i),c=0,u=l.length;c<u;c++)for(var d=i[l[c]].stackGroups,h=Object.keys(d),m=0,p=h.length;m<p;m++){var x=d[h[m]],w=x.items,g=x.cateAxisId,v=w.filter(function(_){return bs(_.type).indexOf("Bar")>=0});if(v&&v.length){var b=v[0].type.defaultProps,y=b!==void 0?Vt(Vt({},b),v[0].props):v[0].props,T=y.barSize,N=y[g];o[N]||(o[N]=[]);var j=Ie(T)?r:T;o[N].push({item:v[0],stackList:v.slice(1),barSize:Ie(j)?void 0:Zr(j,n,0)})}}return o},o0e=function(e){var r=e.barGap,n=e.barCategoryGap,s=e.bandSize,i=e.sizeList,o=i===void 0?[]:i,l=e.maxBarSize,c=o.length;if(c<1)return null;var u=Zr(r,s,0,!0),d,h=[];if(o[0].barSize===+o[0].barSize){var m=!1,p=s/c,x=o.reduce(function(T,N){return T+N.barSize||0},0);x+=(c-1)*u,x>=s&&(x-=(c-1)*u,u=0),x>=s&&p>0&&(m=!0,p*=.9,x=c*p);var w=(s-x)/2>>0,g={offset:w-u,size:0};d=o.reduce(function(T,N){var j={item:N.item,position:{offset:g.offset+g.size+u,size:m?p:N.barSize}},_=[].concat(DC(T),[j]);return g=_[_.length-1].position,N.stackList&&N.stackList.length&&N.stackList.forEach(function(S){_.push({item:S,position:g})}),_},h)}else{var v=Zr(n,s,0,!0);s-2*v-(c-1)*u<=0&&(u=0);var b=(s-2*v-(c-1)*u)/c;b>1&&(b>>=0);var y=l===+l?Math.min(b,l):b;d=o.reduce(function(T,N,j){var _=[].concat(DC(T),[{item:N.item,position:{offset:v+(b+u)*j+(b-y)/2,size:y}}]);return N.stackList&&N.stackList.length&&N.stackList.forEach(function(S){_.push({item:S,position:_[_.length-1].position})}),_},h)}return d},l0e=function(e,r,n,s){var i=n.children,o=n.width,l=n.margin,c=o-(l.left||0)-(l.right||0),u=jL({children:i,legendWidth:c});if(u){var d=s||{},h=d.width,m=d.height,p=u.align,x=u.verticalAlign,w=u.layout;if((w==="vertical"||w==="horizontal"&&x==="middle")&&p!=="center"&&ie(e[p]))return Vt(Vt({},e),{},jc({},p,e[p]+(h||0)));if((w==="horizontal"||w==="vertical"&&p==="center")&&x!=="middle"&&ie(e[x]))return Vt(Vt({},e),{},jc({},x,e[x]+(m||0)))}return e},c0e=function(e,r,n){return Ie(r)?!0:e==="horizontal"?r==="yAxis":e==="vertical"||n==="x"?r==="xAxis":n==="y"?r==="yAxis":!0},NL=function(e,r,n,s,i){var o=r.props.children,l=In(o,rf).filter(function(u){return c0e(s,i,u.props.direction)});if(l&&l.length){var c=l.map(function(u){return u.props.dataKey});return e.reduce(function(u,d){var h=Gt(d,n);if(Ie(h))return u;var m=Array.isArray(h)?[mv(h),mi(h)]:[h,h],p=c.reduce(function(x,w){var g=Gt(d,w,0),v=m[0]-Math.abs(Array.isArray(g)?g[0]:g),b=m[1]+Math.abs(Array.isArray(g)?g[1]:g);return[Math.min(v,x[0]),Math.max(b,x[1])]},[1/0,-1/0]);return[Math.min(p[0],u[0]),Math.max(p[1],u[1])]},[1/0,-1/0])}return null},u0e=function(e,r,n,s,i){var o=r.map(function(l){return NL(e,l,n,i,s)}).filter(function(l){return!Ie(l)});return o&&o.length?o.reduce(function(l,c){return[Math.min(l[0],c[0]),Math.max(l[1],c[1])]},[1/0,-1/0]):null},_L=function(e,r,n,s,i){var o=r.map(function(c){var u=c.props.dataKey;return n==="number"&&u&&NL(e,c,u,s)||ih(e,u,n,i)});if(n==="number")return o.reduce(function(c,u){return[Math.min(c[0],u[0]),Math.max(c[1],u[1])]},[1/0,-1/0]);var l={};return o.reduce(function(c,u){for(var d=0,h=u.length;d<h;d++)l[u[d]]||(l[u[d]]=!0,c.push(u[d]));return c},[])},SL=function(e,r){return e==="horizontal"&&r==="xAxis"||e==="vertical"&&r==="yAxis"||e==="centric"&&r==="angleAxis"||e==="radial"&&r==="radiusAxis"},TL=function(e,r,n,s){if(s)return e.map(function(c){return c.coordinate});var i,o,l=e.map(function(c){return c.coordinate===r&&(i=!0),c.coordinate===n&&(o=!0),c.coordinate});return i||l.push(r),o||l.push(n),l},fs=function(e,r,n){if(!e)return null;var s=e.scale,i=e.duplicateDomain,o=e.type,l=e.range,c=e.realScaleType==="scaleBand"?s.bandwidth()/2:2,u=(r||n)&&o==="category"&&s.bandwidth?s.bandwidth()/c:0;if(u=e.axisType==="angleAxis"&&(l==null?void 0:l.length)>=2?Jr(l[0]-l[1])*2*u:u,r&&(e.ticks||e.niceTicks)){var d=(e.ticks||e.niceTicks).map(function(h){var m=i?i.indexOf(h):h;return{coordinate:s(m)+u,value:h,offset:u}});return d.filter(function(h){return!Mu(h.coordinate)})}return e.isCategorical&&e.categoricalDomain?e.categoricalDomain.map(function(h,m){return{coordinate:s(h)+u,value:h,index:m,offset:u}}):s.ticks&&!n?s.ticks(e.tickCount).map(function(h){return{coordinate:s(h)+u,value:h,offset:u}}):s.domain().map(function(h,m){return{coordinate:s(h)+u,value:i?i[h]:h,index:m,offset:u}})},db=new WeakMap,sp=function(e,r){if(typeof r!="function")return e;db.has(e)||db.set(e,new WeakMap);var n=db.get(e);if(n.has(r))return n.get(r);var s=function(){e.apply(void 0,arguments),r.apply(void 0,arguments)};return n.set(r,s),s},AL=function(e,r,n){var s=e.scale,i=e.type,o=e.layout,l=e.axisType;if(s==="auto")return o==="radial"&&l==="radiusAxis"?{scale:Yh(),realScaleType:"band"}:o==="radial"&&l==="angleAxis"?{scale:ix(),realScaleType:"linear"}:i==="category"&&r&&(r.indexOf("LineChart")>=0||r.indexOf("AreaChart")>=0||r.indexOf("ComposedChart")>=0&&!n)?{scale:sh(),realScaleType:"point"}:i==="category"?{scale:Yh(),realScaleType:"band"}:{scale:ix(),realScaleType:"linear"};if(al(s)){var c="scale".concat(Zy(s));return{scale:(kC[c]||sh)(),realScaleType:kC[c]?c:"point"}}return Ee(s)?{scale:s}:{scale:sh(),realScaleType:"point"}},$C=1e-4,EL=function(e){var r=e.domain();if(!(!r||r.length<=2)){var n=r.length,s=e.range(),i=Math.min(s[0],s[1])-$C,o=Math.max(s[0],s[1])+$C,l=e(r[0]),c=e(r[n-1]);(l<i||l>o||c<i||c>o)&&e.domain([r[0],r[n-1]])}},d0e=function(e,r){if(!e)return null;for(var n=0,s=e.length;n<s;n++)if(e[n].item===r)return e[n].position;return null},h0e=function(e,r){if(!r||r.length!==2||!ie(r[0])||!ie(r[1]))return e;var n=Math.min(r[0],r[1]),s=Math.max(r[0],r[1]),i=[e[0],e[1]];return(!ie(e[0])||e[0]<n)&&(i[0]=n),(!ie(e[1])||e[1]>s)&&(i[1]=s),i[0]>s&&(i[0]=s),i[1]<n&&(i[1]=n),i},m0e=function(e){var r=e.length;if(!(r<=0))for(var n=0,s=e[0].length;n<s;++n)for(var i=0,o=0,l=0;l<r;++l){var c=Mu(e[l][n][1])?e[l][n][0]:e[l][n][1];c>=0?(e[l][n][0]=i,e[l][n][1]=i+c,i=e[l][n][1]):(e[l][n][0]=o,e[l][n][1]=o+c,o=e[l][n][1])}},f0e=function(e){var r=e.length;if(!(r<=0))for(var n=0,s=e[0].length;n<s;++n)for(var i=0,o=0;o<r;++o){var l=Mu(e[o][n][1])?e[o][n][0]:e[o][n][1];l>=0?(e[o][n][0]=i,e[o][n][1]=i+l,i=e[o][n][1]):(e[o][n][0]=0,e[o][n][1]=0)}},p0e={sign:m0e,expand:Rie,none:zc,silhouette:Die,wiggle:Mie,positive:f0e},g0e=function(e,r,n){var s=r.map(function(l){return l.props.dataKey}),i=p0e[n],o=Oie().keys(s).value(function(l,c){return+Gt(l,c,0)}).order(dj).offset(i);return o(e)},x0e=function(e,r,n,s,i,o){if(!e)return null;var l=o?r.reverse():r,c={},u=l.reduce(function(h,m){var p,x=(p=m.type)!==null&&p!==void 0&&p.defaultProps?Vt(Vt({},m.type.defaultProps),m.props):m.props,w=x.stackId,g=x.hide;if(g)return h;var v=x[n],b=h[v]||{hasStack:!1,stackGroups:{}};if(lr(w)){var y=b.stackGroups[w]||{numericAxisId:n,cateAxisId:s,items:[]};y.items.push(m),b.hasStack=!0,b.stackGroups[w]=y}else b.stackGroups[Nl("_stackId_")]={numericAxisId:n,cateAxisId:s,items:[m]};return Vt(Vt({},h),{},jc({},v,b))},c),d={};return Object.keys(u).reduce(function(h,m){var p=u[m];if(p.hasStack){var x={};p.stackGroups=Object.keys(p.stackGroups).reduce(function(w,g){var v=p.stackGroups[g];return Vt(Vt({},w),{},jc({},g,{numericAxisId:n,cateAxisId:s,items:v.items,stackedData:g0e(e,v.items,i)}))},x)}return Vt(Vt({},h),{},jc({},m,p))},d)},kL=function(e,r){var n=r.realScaleType,s=r.type,i=r.tickCount,o=r.originalDomain,l=r.allowDecimals,c=n||r.scale;if(c!=="auto"&&c!=="linear")return null;if(i&&s==="number"&&o&&(o[0]==="auto"||o[1]==="auto")){var u=e.domain();if(!u.length)return null;var d=Cve(u,i,l);return e.domain([mv(d),mi(d)]),{niceTicks:d}}if(i&&s==="number"){var h=e.domain(),m=Ive(h,i,l);return{niceTicks:m}}return null};function mx(t){var e=t.axis,r=t.ticks,n=t.bandSize,s=t.entry,i=t.index,o=t.dataKey;if(e.type==="category"){if(!e.allowDuplicatedCategory&&e.dataKey&&!Ie(s[e.dataKey])){var l=Fg(r,"value",s[e.dataKey]);if(l)return l.coordinate+n/2}return r[i]?r[i].coordinate+n/2:null}var c=Gt(s,Ie(o)?e.dataKey:o);return Ie(c)?null:e.scale(c)}var LC=function(e){var r=e.axis,n=e.ticks,s=e.offset,i=e.bandSize,o=e.entry,l=e.index;if(r.type==="category")return n[l]?n[l].coordinate+s:null;var c=Gt(o,r.dataKey,r.domain[l]);return Ie(c)?null:r.scale(c)-i/2+s},y0e=function(e){var r=e.numericAxis,n=r.scale.domain();if(r.type==="number"){var s=Math.min(n[0],n[1]),i=Math.max(n[0],n[1]);return s<=0&&i>=0?0:i<0?i:s}return n[0]},v0e=function(e,r){var n,s=(n=e.type)!==null&&n!==void 0&&n.defaultProps?Vt(Vt({},e.type.defaultProps),e.props):e.props,i=s.stackId;if(lr(i)){var o=r[i];if(o){var l=o.items.indexOf(e);return l>=0?o.stackedData[l]:null}}return null},b0e=function(e){return e.reduce(function(r,n){return[mv(n.concat([r[0]]).filter(ie)),mi(n.concat([r[1]]).filter(ie))]},[1/0,-1/0])},PL=function(e,r,n){return Object.keys(e).reduce(function(s,i){var o=e[i],l=o.stackedData,c=l.reduce(function(u,d){var h=b0e(d.slice(r,n+1));return[Math.min(u[0],h[0]),Math.max(u[1],h[1])]},[1/0,-1/0]);return[Math.min(c[0],s[0]),Math.max(c[1],s[1])]},[1/0,-1/0]).map(function(s){return s===1/0||s===-1/0?0:s})},FC=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,BC=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,Vj=function(e,r,n){if(Ee(e))return e(r,n);if(!Array.isArray(e))return r;var s=[];if(ie(e[0]))s[0]=n?e[0]:Math.min(e[0],r[0]);else if(FC.test(e[0])){var i=+FC.exec(e[0])[1];s[0]=r[0]-i}else Ee(e[0])?s[0]=e[0](r[0]):s[0]=r[0];if(ie(e[1]))s[1]=n?e[1]:Math.max(e[1],r[1]);else if(BC.test(e[1])){var o=+BC.exec(e[1])[1];s[1]=r[1]+o}else Ee(e[1])?s[1]=e[1](r[1]):s[1]=r[1];return s},fx=function(e,r,n){if(e&&e.scale&&e.scale.bandwidth){var s=e.scale.bandwidth();if(!n||s>0)return s}if(e&&r&&r.length>=2){for(var i=g_(r,function(h){return h.coordinate}),o=1/0,l=1,c=i.length;l<c;l++){var u=i[l],d=i[l-1];o=Math.min((u.coordinate||0)-(d.coordinate||0),o)}return o===1/0?0:o}return n?void 0:0},VC=function(e,r,n){return!e||!e.length||ol(e,Cn(n,"type.defaultProps.domain"))?r:e},CL=function(e,r){var n=e.type.defaultProps?Vt(Vt({},e.type.defaultProps),e.props):e.props,s=n.dataKey,i=n.name,o=n.unit,l=n.formatter,c=n.tooltipType,u=n.chartType,d=n.hide;return Vt(Vt({},je(e,!1)),{},{dataKey:s,unit:o,formatter:l,name:i||s,color:U_(e),value:Gt(r,s),type:c,payload:r,chartType:u,hide:d})};function sm(t){"@babel/helpers - typeof";return sm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},sm(t)}function UC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ss(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?UC(Object(r),!0).forEach(function(n){IL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):UC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function IL(t,e,r){return e=w0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function w0e(t){var e=j0e(t,"string");return sm(e)=="symbol"?e:e+""}function j0e(t,e){if(sm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(sm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function N0e(t,e){return A0e(t)||T0e(t,e)||S0e(t,e)||_0e()}function _0e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4513In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function S0e(t,e){if(t){if(typeof t=="string")return zC(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zC(t,e)}}function zC(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function T0e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function A0e(t){if(Array.isArray(t))return t}var px=Math.PI/180,E0e=function(e){return e*180/Math.PI},wt=function(e,r,n,s){return{x:e+Math.cos(-px*s)*n,y:r+Math.sin(-px*s)*n}},OL=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(n.left||0)-(n.right||0)),Math.abs(r-(n.top||0)-(n.bottom||0)))/2},k0e=function(e,r,n,s,i){var o=e.width,l=e.height,c=e.startAngle,u=e.endAngle,d=Zr(e.cx,o,o/2),h=Zr(e.cy,l,l/2),m=OL(o,l,n),p=Zr(e.innerRadius,m,0),x=Zr(e.outerRadius,m,m*.8),w=Object.keys(r);return w.reduce(function(g,v){var b=r[v],y=b.domain,T=b.reversed,N;if(Ie(b.range))s==="angleAxis"?N=[c,u]:s==="radiusAxis"&&(N=[p,x]),T&&(N=[N[1],N[0]]);else{N=b.range;var j=N,_=N0e(j,2);c=_[0],u=_[1]}var S=AL(b,i),k=S.realScaleType,I=S.scale;I.domain(y).range(N),EL(I);var E=kL(I,ss(ss({},b),{},{realScaleType:k})),C=ss(ss(ss({},b),E),{},{range:N,radius:x,realScaleType:k,scale:I,cx:d,cy:h,innerRadius:p,outerRadius:x,startAngle:c,endAngle:u});return ss(ss({},g),{},IL({},v,C))},{})},P0e=function(e,r){var n=e.x,s=e.y,i=r.x,o=r.y;return Math.sqrt(Math.pow(n-i,2)+Math.pow(s-o,2))},C0e=function(e,r){var n=e.x,s=e.y,i=r.cx,o=r.cy,l=P0e({x:n,y:s},{x:i,y:o});if(l<=0)return{radius:l};var c=(n-i)/l,u=Math.acos(c);return s>o&&(u=2*Math.PI-u),{radius:l,angle:E0e(u),angleInRadian:u}},I0e=function(e){var r=e.startAngle,n=e.endAngle,s=Math.floor(r/360),i=Math.floor(n/360),o=Math.min(s,i);return{startAngle:r-o*360,endAngle:n-o*360}},O0e=function(e,r){var n=r.startAngle,s=r.endAngle,i=Math.floor(n/360),o=Math.floor(s/360),l=Math.min(i,o);return e+l*360},HC=function(e,r){var n=e.x,s=e.y,i=C0e({x:n,y:s},r),o=i.radius,l=i.angle,c=r.innerRadius,u=r.outerRadius;if(o<c||o>u)return!1;if(o===0)return!0;var d=I0e(r),h=d.startAngle,m=d.endAngle,p=l,x;if(h<=m){for(;p>m;)p-=360;for(;p<h;)p+=360;x=p>=h&&p<=m}else{for(;p>h;)p-=360;for(;p<m;)p+=360;x=p>=m&&p<=h}return x?ss(ss({},r),{},{radius:o,angle:O0e(p,r)}):null},RL=function(e){return!P.isValidElement(e)&&!Ee(e)&&typeof e!="boolean"?e.className:""};function im(t){"@babel/helpers - typeof";return im=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},im(t)}var R0e=["offset"];function D0e(t){return F0e(t)||L0e(t)||$0e(t)||M0e()}function M0e(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4514In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $0e(t,e){if(t){if(typeof t=="string")return Uj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Uj(t,e)}}function L0e(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function F0e(t){if(Array.isArray(t))return Uj(t)}function Uj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function B0e(t,e){if(t==null)return{};var r=V0e(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function V0e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function qC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function ar(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?qC(Object(r),!0).forEach(function(n){U0e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):qC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function U0e(t,e,r){return e=z0e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z0e(t){var e=H0e(t,"string");return im(e)=="symbol"?e:e+""}function H0e(t,e){if(im(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(im(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function om(){return om=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},om.apply(this,arguments)}var q0e=function(e){var r=e.value,n=e.formatter,s=Ie(e.children)?r:e.children;return Ee(n)?n(s):s},W0e=function(e,r){var n=Jr(r-e),s=Math.min(Math.abs(r-e),360);return n*s},G0e=function(e,r,n){var s=e.position,i=e.viewBox,o=e.offset,l=e.className,c=i,u=c.cx,d=c.cy,h=c.innerRadius,m=c.outerRadius,p=c.startAngle,x=c.endAngle,w=c.clockWise,g=(h+m)/2,v=W0e(p,x),b=v>=0?1:-1,y,T;s==="insideStart"?(y=p+b*o,T=w):s==="insideEnd"?(y=x-b*o,T=!w):s==="end"&&(y=x+b*o,T=w),T=v<=0?T:!T;var N=wt(u,d,g,y),j=wt(u,d,g,y+(T?1:-1)*359),_="M".concat(N.x,",").concat(N.y,`
4515    A`).concat(g,",").concat(g,",0,1,").concat(T?0:1,`,
4516    `).concat(j.x,",").concat(j.y),S=Ie(e.id)?Nl("recharts-radial-line-"):e.id;return F.createElement("text",om({},n,{dominantBaseline:"central",className:Me("recharts-radial-bar-label",l)}),F.createElement("defs",null,F.createElement("path",{id:S,d:_})),F.createElement("textPath",{xlinkHref:"#".concat(S)},r))},K0e=function(e){var r=e.viewBox,n=e.offset,s=e.position,i=r,o=i.cx,l=i.cy,c=i.innerRadius,u=i.outerRadius,d=i.startAngle,h=i.endAngle,m=(d+h)/2;if(s==="outside"){var p=wt(o,l,u+n,m),x=p.x,w=p.y;return{x,y:w,textAnchor:x>=o?"start":"end",verticalAnchor:"middle"}}if(s==="center")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"middle"};if(s==="centerTop")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"start"};if(s==="centerBottom")return{x:o,y:l,textAnchor:"middle",verticalAnchor:"end"};var g=(c+u)/2,v=wt(o,l,g,m),b=v.x,y=v.y;return{x:b,y,textAnchor:"middle",verticalAnchor:"middle"}},X0e=function(e){var r=e.viewBox,n=e.parentViewBox,s=e.offset,i=e.position,o=r,l=o.x,c=o.y,u=o.width,d=o.height,h=d>=0?1:-1,m=h*s,p=h>0?"end":"start",x=h>0?"start":"end",w=u>=0?1:-1,g=w*s,v=w>0?"end":"start",b=w>0?"start":"end";if(i==="top"){var y={x:l+u/2,y:c-h*s,textAnchor:"middle",verticalAnchor:p};return ar(ar({},y),n?{height:Math.max(c-n.y,0),width:u}:{})}if(i==="bottom"){var T={x:l+u/2,y:c+d+m,textAnchor:"middle",verticalAnchor:x};return ar(ar({},T),n?{height:Math.max(n.y+n.height-(c+d),0),width:u}:{})}if(i==="left"){var N={x:l-g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"};return ar(ar({},N),n?{width:Math.max(N.x-n.x,0),height:d}:{})}if(i==="right"){var j={x:l+u+g,y:c+d/2,textAnchor:b,verticalAnchor:"middle"};return ar(ar({},j),n?{width:Math.max(n.x+n.width-j.x,0),height:d}:{})}var _=n?{width:u,height:d}:{};return i==="insideLeft"?ar({x:l+g,y:c+d/2,textAnchor:b,verticalAnchor:"middle"},_):i==="insideRight"?ar({x:l+u-g,y:c+d/2,textAnchor:v,verticalAnchor:"middle"},_):i==="insideTop"?ar({x:l+u/2,y:c+m,textAnchor:"middle",verticalAnchor:x},_):i==="insideBottom"?ar({x:l+u/2,y:c+d-m,textAnchor:"middle",verticalAnchor:p},_):i==="insideTopLeft"?ar({x:l+g,y:c+m,textAnchor:b,verticalAnchor:x},_):i==="insideTopRight"?ar({x:l+u-g,y:c+m,textAnchor:v,verticalAnchor:x},_):i==="insideBottomLeft"?ar({x:l+g,y:c+d-m,textAnchor:b,verticalAnchor:p},_):i==="insideBottomRight"?ar({x:l+u-g,y:c+d-m,textAnchor:v,verticalAnchor:p},_):Iu(i)&&(ie(i.x)||jo(i.x))&&(ie(i.y)||jo(i.y))?ar({x:l+Zr(i.x,u),y:c+Zr(i.y,d),textAnchor:"end",verticalAnchor:"end"},_):ar({x:l+u/2,y:c+d/2,textAnchor:"middle",verticalAnchor:"middle"},_)},Y0e=function(e){return"cx"in e&&ie(e.cx)};function gr(t){var e=t.offset,r=e===void 0?5:e,n=B0e(t,R0e),s=ar({offset:r},n),i=s.viewBox,o=s.position,l=s.value,c=s.children,u=s.content,d=s.className,h=d===void 0?"":d,m=s.textBreakAll;if(!i||Ie(l)&&Ie(c)&&!P.isValidElement(u)&&!Ee(u))return null;if(P.isValidElement(u))return P.cloneElement(u,s);var p;if(Ee(u)){if(p=P.createElement(u,s),P.isValidElement(p))return p}else p=q0e(s);var x=Y0e(i),w=je(s,!0);if(x&&(o==="insideStart"||o==="insideEnd"||o==="end"))return G0e(s,p,w);var g=x?K0e(s):X0e(s);return F.createElement(il,om({className:Me("recharts-label",h)},w,g,{breakAll:m}),p)}gr.displayName="Label";var DL=function(e){var r=e.cx,n=e.cy,s=e.angle,i=e.startAngle,o=e.endAngle,l=e.r,c=e.radius,u=e.innerRadius,d=e.outerRadius,h=e.x,m=e.y,p=e.top,x=e.left,w=e.width,g=e.height,v=e.clockWise,b=e.labelViewBox;if(b)return b;if(ie(w)&&ie(g)){if(ie(h)&&ie(m))return{x:h,y:m,width:w,height:g};if(ie(p)&&ie(x))return{x:p,y:x,width:w,height:g}}return ie(h)&&ie(m)?{x:h,y:m,width:0,height:0}:ie(r)&&ie(n)?{cx:r,cy:n,startAngle:i||s||0,endAngle:o||s||0,innerRadius:u||0,outerRadius:d||c||l||0,clockWise:v}:e.viewBox?e.viewBox:{}},Q0e=function(e,r){return e?e===!0?F.createElement(gr,{key:"label-implicit",viewBox:r}):lr(e)?F.createElement(gr,{key:"label-implicit",viewBox:r,value:e}):P.isValidElement(e)?e.type===gr?P.cloneElement(e,{key:"label-implicit",viewBox:r}):F.createElement(gr,{key:"label-implicit",content:e,viewBox:r}):Ee(e)?F.createElement(gr,{key:"label-implicit",content:e,viewBox:r}):Iu(e)?F.createElement(gr,om({viewBox:r},e,{key:"label-implicit"})):null:null},J0e=function(e,r){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!e||!e.children&&n&&!e.label)return null;var s=e.children,i=DL(e),o=In(s,gr).map(function(c,u){return P.cloneElement(c,{viewBox:r||i,key:"label-".concat(u)})});if(!n)return o;var l=Q0e(e.label,r||i);return[l].concat(D0e(o))};gr.parseViewBox=DL;gr.renderCallByParent=J0e;function Z0e(t){var e=t==null?0:t.length;return e?t[e-1]:void 0}var ebe=Z0e;const tbe=nt(ebe);function lm(t){"@babel/helpers - typeof";return lm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lm(t)}var rbe=["valueAccessor"],nbe=["data","dataKey","clockWise","id","textBreakAll"];function abe(t){return lbe(t)||obe(t)||ibe(t)||sbe()}function sbe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4517In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ibe(t,e){if(t){if(typeof t=="string")return zj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return zj(t,e)}}function obe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lbe(t){if(Array.isArray(t))return zj(t)}function zj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function gx(){return gx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},gx.apply(this,arguments)}function WC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function GC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?WC(Object(r),!0).forEach(function(n){cbe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):WC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function cbe(t,e,r){return e=ube(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ube(t){var e=dbe(t,"string");return lm(e)=="symbol"?e:e+""}function dbe(t,e){if(lm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function KC(t,e){if(t==null)return{};var r=hbe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function hbe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var mbe=function(e){return Array.isArray(e.value)?tbe(e.value):e.value};function Ua(t){var e=t.valueAccessor,r=e===void 0?mbe:e,n=KC(t,rbe),s=n.data,i=n.dataKey,o=n.clockWise,l=n.id,c=n.textBreakAll,u=KC(n,nbe);return!s||!s.length?null:F.createElement(Ve,{className:"recharts-label-list"},s.map(function(d,h){var m=Ie(i)?r(d,h):Gt(d&&d.payload,i),p=Ie(l)?{}:{id:"".concat(l,"-").concat(h)};return F.createElement(gr,gx({},je(d,!0),u,p,{parentViewBox:d.parentViewBox,value:m,textBreakAll:c,viewBox:gr.parseViewBox(Ie(o)?d:GC(GC({},d),{},{clockWise:o})),key:"label-".concat(h),index:h}))}))}Ua.displayName="LabelList";function fbe(t,e){return t?t===!0?F.createElement(Ua,{key:"labelList-implicit",data:e}):F.isValidElement(t)||Ee(t)?F.createElement(Ua,{key:"labelList-implicit",data:e,content:t}):Iu(t)?F.createElement(Ua,gx({data:e},t,{key:"labelList-implicit"})):null:null}function pbe(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(!t||!t.children&&r&&!t.label)return null;var n=t.children,s=In(n,Ua).map(function(o,l){return P.cloneElement(o,{data:e,key:"labelList-".concat(l)})});if(!r)return s;var i=fbe(t.label,e);return[i].concat(abe(s))}Ua.renderCallByParent=pbe;function cm(t){"@babel/helpers - typeof";return cm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cm(t)}function Hj(){return Hj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Hj.apply(this,arguments)}function XC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function YC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?XC(Object(r),!0).forEach(function(n){gbe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):XC(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function gbe(t,e,r){return e=xbe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function xbe(t){var e=ybe(t,"string");return cm(e)=="symbol"?e:e+""}function ybe(t,e){if(cm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var vbe=function(e,r){var n=Jr(r-e),s=Math.min(Math.abs(r-e),359.999);return n*s},ip=function(e){var r=e.cx,n=e.cy,s=e.radius,i=e.angle,o=e.sign,l=e.isExternal,c=e.cornerRadius,u=e.cornerIsExternal,d=c*(l?1:-1)+s,h=Math.asin(c/d)/px,m=u?i:i+o*h,p=wt(r,n,d,m),x=wt(r,n,s,m),w=u?i-o*h:i,g=wt(r,n,d*Math.cos(h*px),w);return{center:p,circleTangency:x,lineTangency:g,theta:h}},ML=function(e){var r=e.cx,n=e.cy,s=e.innerRadius,i=e.outerRadius,o=e.startAngle,l=e.endAngle,c=vbe(o,l),u=o+c,d=wt(r,n,i,o),h=wt(r,n,i,u),m="M ".concat(d.x,",").concat(d.y,`
4518    A `).concat(i,",").concat(i,`,0,
4519    `).concat(+(Math.abs(c)>180),",").concat(+(o>u),`,
4520    `).concat(h.x,",").concat(h.y,`
4521  `);if(s>0){var p=wt(r,n,s,o),x=wt(r,n,s,u);m+="L ".concat(x.x,",").concat(x.y,`
4522            A `).concat(s,",").concat(s,`,0,
4523            `).concat(+(Math.abs(c)>180),",").concat(+(o<=u),`,
4524            `).concat(p.x,",").concat(p.y," Z")}else m+="L ".concat(r,",").concat(n," Z");return m},bbe=function(e){var r=e.cx,n=e.cy,s=e.innerRadius,i=e.outerRadius,o=e.cornerRadius,l=e.forceCornerRadius,c=e.cornerIsExternal,u=e.startAngle,d=e.endAngle,h=Jr(d-u),m=ip({cx:r,cy:n,radius:i,angle:u,sign:h,cornerRadius:o,cornerIsExternal:c}),p=m.circleTangency,x=m.lineTangency,w=m.theta,g=ip({cx:r,cy:n,radius:i,angle:d,sign:-h,cornerRadius:o,cornerIsExternal:c}),v=g.circleTangency,b=g.lineTangency,y=g.theta,T=c?Math.abs(u-d):Math.abs(u-d)-w-y;if(T<0)return l?"M ".concat(x.x,",").concat(x.y,`
4525        a`).concat(o,",").concat(o,",0,0,1,").concat(o*2,`,0
4526        a`).concat(o,",").concat(o,",0,0,1,").concat(-o*2,`,0
4527      `):ML({cx:r,cy:n,innerRadius:s,outerRadius:i,startAngle:u,endAngle:d});var N="M ".concat(x.x,",").concat(x.y,`
4528    A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(p.x,",").concat(p.y,`
4529    A`).concat(i,",").concat(i,",0,").concat(+(T>180),",").concat(+(h<0),",").concat(v.x,",").concat(v.y,`
4530    A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(b.x,",").concat(b.y,`
4531  `);if(s>0){var j=ip({cx:r,cy:n,radius:s,angle:u,sign:h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),_=j.circleTangency,S=j.lineTangency,k=j.theta,I=ip({cx:r,cy:n,radius:s,angle:d,sign:-h,isExternal:!0,cornerRadius:o,cornerIsExternal:c}),E=I.circleTangency,C=I.lineTangency,R=I.theta,W=c?Math.abs(u-d):Math.abs(u-d)-k-R;if(W<0&&o===0)return"".concat(N,"L").concat(r,",").concat(n,"Z");N+="L".concat(C.x,",").concat(C.y,`
4532      A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(E.x,",").concat(E.y,`
4533      A`).concat(s,",").concat(s,",0,").concat(+(W>180),",").concat(+(h>0),",").concat(_.x,",").concat(_.y,`
4534      A`).concat(o,",").concat(o,",0,0,").concat(+(h<0),",").concat(S.x,",").concat(S.y,"Z")}else N+="L".concat(r,",").concat(n,"Z");return N},wbe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},$L=function(e){var r=YC(YC({},wbe),e),n=r.cx,s=r.cy,i=r.innerRadius,o=r.outerRadius,l=r.cornerRadius,c=r.forceCornerRadius,u=r.cornerIsExternal,d=r.startAngle,h=r.endAngle,m=r.className;if(o<i||d===h)return null;var p=Me("recharts-sector",m),x=o-i,w=Zr(l,x,0,!0),g;return w>0&&Math.abs(d-h)<360?g=bbe({cx:n,cy:s,innerRadius:i,outerRadius:o,cornerRadius:Math.min(w,x/2),forceCornerRadius:c,cornerIsExternal:u,startAngle:d,endAngle:h}):g=ML({cx:n,cy:s,innerRadius:i,outerRadius:o,startAngle:d,endAngle:h}),F.createElement("path",Hj({},je(r,!0),{className:p,d:g,role:"img"}))};function um(t){"@babel/helpers - typeof";return um=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},um(t)}function qj(){return qj=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},qj.apply(this,arguments)}function QC(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function JC(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?QC(Object(r),!0).forEach(function(n){jbe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):QC(Object(r)).forEac
4534h(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jbe(t,e,r){return e=Nbe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Nbe(t){var e=_be(t,"string");return um(e)=="symbol"?e:e+""}function _be(t,e){if(um(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(um(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var ZC={curveBasisClosed:jie,curveBasisOpen:Nie,curveBasis:wie,curveBumpX:oie,curveBumpY:lie,curveLinearClosed:_ie,curveLinear:tv,curveMonotoneX:Sie,curveMonotoneY:Tie,curveNatural:Aie,curveStep:Eie,curveStepAfter:Pie,curveStepBefore:kie},op=function(e){return e.x===+e.x&&e.y===+e.y},Td=function(e){return e.x},Ad=function(e){return e.y},Sbe=function(e,r){if(Ee(e))return e;var n="curve".concat(Zy(e));return(n==="curveMonotone"||n==="curveBump")&&r?ZC["".concat(n).concat(r==="vertical"?"Y":"X")]:ZC[n]||tv},Tbe=function(e){var r=e.type,n=r===void 0?"linear":r,s=e.points,i=s===void 0?[]:s,o=e.baseLine,l=e.layout,c=e.connectNulls,u=c===void 0?!1:c,d=Sbe(n,l),h=u?i.filter(function(w){return op(w)}):i,m;if(Array.isArray(o)){var p=u?o.filter(function(w){return op(w)}):o,x=h.map(function(w,g){return JC(JC({},w),{},{base:p[g]})});return l==="vertical"?m=Qf().y(Ad).x1(Td).x0(function(w){return w.base.x}):m=Qf().x(Td).y1(Ad).y0(function(w){return w.base.y}),m.defined(op).curve(d),m(x)}return l==="vertical"&&ie(o)?m=Qf().y(Ad).x1(Td).x0(o):ie(o)?m=Qf().x(Td).y1(Ad).y0(o):m=C6().x(Td).y(Ad),m.defined(op).curve(d),m(h)},Do=function(e){var r=e.className,n=e.points,s=e.path,i=e.pathRef;if((!n||!n.length)&&!s)return null;var o=n&&n.length?Tbe(e):s;return P.createElement("path",qj({},je(e,!1),Bg(e),{className:Me("recharts-curve",r),d:o,ref:i}))},Abe=Object.getOwnPropertyNames,Ebe=Object.getOwnPropertySymbols,kbe=Object.prototype.hasOwnProperty;function e4(t,e){return function(n,s,i){return t(n,s,i)&&e(n,s,i)}}function lp(t){return function(r,n,s){if(!r||!n||typeof r!="object"||typeof n!="object")return t(r,n,s);var i=s.cache,o=i.get(r),l=i.get(n);if(o&&l)return o===n&&l===r;i.set(r,n),i.set(n,r);var c=t(r,n,s);return i.delete(r),i.delete(n),c}}function t4(t){return Abe(t).concat(Ebe(t))}var Pbe=Object.hasOwn||function(t,e){return kbe.call(t,e)};function Tl(t,e){return t===e||!t&&!e&&t!==t&&e!==e}var Cbe="__v",Ibe="__o",Obe="_owner",r4=Object.getOwnPropertyDescriptor,n4=Object.keys;function Rbe(t,e,r){var n=t.length;if(e.length!==n)return!1;for(;n-- >0;)if(!r.equals(t[n],e[n],n,n,t,e,r))return!1;return!0}function Dbe(t,e){return Tl(t.getTime(),e.getTime())}function Mbe(t,e){return t.name===e.name&&t.message===e.message&&t.cause===e.cause&&t.stack===e.stack}function $be(t,e){return t===e}function a4(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var s=new Array(n),i=t.entries(),o,l,c=0;(o=i.next())&&!o.done;){for(var u=e.entries(),d=!1,h=0;(l=u.next())&&!l.done;){if(s[h]){h++;continue}var m=o.value,p=l.value;if(r.equals(m[0],p[0],c,h,t,e,r)&&r.equals(m[1],p[1],m[0],p[0],t,e,r)){d=s[h]=!0;break}h++}if(!d)return!1;c++}return!0}var Lbe=Tl;function Fbe(t,e,r){var n=n4(t),s=n.length;if(n4(e).length!==s)return!1;for(;s-- >0;)if(!LL(t,e,r,n[s]))return!1;return!0}function Ed(t,e,r){var n=t4(t),s=n.length;if(t4(e).length!==s)return!1;for(var i,o,l;s-- >0;)if(i=n[s],!LL(t,e,r,i)||(o=r4(t,i),l=r4(e,i),(o||l)&&(!o||!l||o.configurable!==l.configurable||o.enumerable!==l.enumerable||o.writable!==l.writable)))return!1;return!0}function Bbe(t,e){return Tl(t.valueOf(),e.valueOf())}function Vbe(t,e){return t.source===e.source&&t.flags===e.flags}function s4(t,e,r){var n=t.size;if(n!==e.size)return!1;if(!n)return!0;for(var s=new Array(n),i=t.values(),o,l;(o=i.next())&&!o.done;){for(var c=e.values(),u=!1,d=0;(l=c.next())&&!l.done;){if(!s[d]&&r.equals(o.value,l.value,o.value,l.value,t,e,r)){u=s[d]=!0;break}d++}if(!u)return!1}return!0}function Ube(t,e){var r=t.length;if(e.length!==r)return!1;for(;r-- >0;)if(t[r]!==e[r])return!1;return!0}function zbe(t,e){return t.hostname===e.hostname&&t.pathname===e.pathname&&t.protocol===e.protocol&&t.port===e.port&&t.hash===e.hash&&t.username===e.username&&t.password===e.password}function LL(t,e,r,n){return(n===Obe||n===Ibe||n===Cbe)&&(t.$$typeof||e.$$typeof)?!0:Pbe(e,n)&&r.equals(t[n],e[n],n,n,t,e,r)}var Hbe="[object Arguments]",qbe="[object Boolean]",Wbe="[object Date]",Gbe="[object Error]",Kbe="[object Map]",Xbe="[object Number]",Ybe="[object Object]",Qbe="[object RegExp]",Jbe="[object Set]",Zbe="[object String]",ewe="[object URL]",twe=Array.isArray,i4=typeof ArrayBuffer=="function"&&ArrayBuffer.isView?ArrayBuffer.isView:null,o4=Object.assign,rwe=Object.prototype.toString.call.bind(Object.prototype.toString);function nwe(t){var e=t.areArraysEqual,r=t.areDatesEqual,n=t.areErrorsEqual,s=t.areFunctionsEqual,i=t.areMapsEqual,o=t.areNumbersEqual,l=t.areObjectsEqual,c=t.arePrimitiveWrappersEqual,u=t.areRegExpsEqual,d=t.areSetsEqual,h=t.areTypedArraysEqual,m=t.areUrlsEqual;return function(x,w,g){if(x===w)return!0;
4534if(x==null||w==null)return!1;var v=typeof x;if(v!==typeof w)return!1;if(v!=="object")return v==="number"?o(x,w,g):v==="function"?s(x,w,g):!1;var b=x.constructor;if(b!==w.constructor)return!1;if(b===Object)return l(x,w,g);if(twe(x))return e(x,w,g);if(i4!=null&&i4(x))return h(x,w,g);if(b===Date)return r(x,w,g);if(b===RegExp)return u(x,w,g);if(b===Map)return i(x,w,g);if(b===Set)return d(x,w,g);var y=rwe(x);return y===Wbe?r(x,w,g):y===Qbe?u(x,w,g):y===Kbe?i(x,w,g):y===Jbe?d(x,w,g):y===Ybe?typeof x.then!="function"&&typeof w.then!="function"&&l(x,w,g):y===ewe?m(x,w,g):y===Gbe?n(x,w,g):y===Hbe?l(x,w,g):y===qbe||y===Xbe||y===Zbe?c(x,w,g):!1}}function awe(t){var e=t.circular,r=t.createCustomConfig,n=t.strict,s={areArraysEqual:n?Ed:Rbe,areDatesEqual:Dbe,areErrorsEqual:Mbe,areFunctionsEqual:$be,areMapsEqual:n?e4(a4,Ed):a4,areNumbersEqual:Lbe,areObjectsEqual:n?Ed:Fbe,arePrimitiveWrappersEqual:Bbe,areRegExpsEqual:Vbe,areSetsEqual:n?e4(s4,Ed):s4,areTypedArraysEqual:n?Ed:Ube,areUrlsEqual:zbe};if(r&&(s=o4({},s,r(s))),e){var i=lp(s.areArraysEqual),o=lp(s.areMapsEqual),l=lp(s.areObjectsEqual),c=lp(s.areSetsEqual);s=o4({},s,{areArraysEqual:i,areMapsEqual:o,areObjectsEqual:l,areSetsEqual:c})}return s}function swe(t){return function(e,r,n,s,i,o,l){return t(e,r,l)}}function iwe(t){var e=t.circular,r=t.comparator,n=t.createState,s=t.equals,i=t.strict;if(n)return function(c,u){var d=n(),h=d.cache,m=h===void 0?e?new WeakMap:void 0:h,p=d.meta;return r(c,u,{cache:m,equals:s,meta:p,strict:i})};if(e)return function(c,u){return r(c,u,{cache:new WeakMap,equals:s,meta:void 0,strict:i})};var o={cache:void 0,equals:s,meta:void 0,strict:i};return function(c,u){return r(c,u,o)}}var owe=Yi();Yi({strict:!0});Yi({circular:!0});Yi({circular:!0,strict:!0});Yi({createInternalComparator:function(){return Tl}});Yi({strict:!0,createInternalComparator:function(){return Tl}});Yi({circular:!0,createInternalComparator:function(){return Tl}});Yi({circular:!0,createInternalComparator:function(){return Tl},strict:!0});function Yi(t){t===void 0&&(t={});var e=t.circular,r=e===void 0?!1:e,n=t.createInternalComparator,s=t.createState,i=t.strict,o=i===void 0?!1:i,l=awe(t),c=nwe(l),u=n?n(c):swe(c);return iwe({circular:r,comparator:c,createState:s,equals:u,strict:o})}function lwe(t){typeof requestAnimationFrame<"u"&&requestAnimationFrame(t)}function l4(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=-1,n=function s(i){r<0&&(r=i),i-r>e?(t(i),r=-1):lwe(s)};requestAnimationFrame(n)}function Wj(t){"@babel/helpers - typeof";return Wj=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Wj(t)}function cwe(t){return mwe(t)||hwe(t)||dwe(t)||uwe()}function uwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4535In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dwe(t,e){if(t){if(typeof t=="string")return c4(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return c4(t,e)}}function c4(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function hwe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function mwe(t){if(Array.isArray(t))return t}function fwe(){var t={},e=function(){return null},r=!1,n=function s(i){if(!r){if(Array.isArray(i)){if(!i.length)return;var o=i,l=cwe(o),c=l[0],u=l.slice(1);if(typeof c=="number"){l4(s.bind(null,u),c);return}s(c),l4(s.bind(null,u));return}Wj(i)==="object"&&(t=i,e(t)),typeof i=="function"&&i()}};return{stop:function(){r=!0},start:function(i){r=!1,n(i)},subscribe:function(i){return e=i,function(){e=function(){return null}}}}}function dm(t){"@babel/helpers - typeof";return dm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},dm(t)}function u4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function d4(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};
vendor: 58,529 bytes, lines 4535-4553
4535e%2?u4(Object(r),!0).forEach(function(n){FL(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):u4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function FL(t,e,r){return e=pwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function pwe(t){var e=gwe(t,"string");return dm(e)==="symbol"?e:String(e)}function gwe(t,e){if(dm(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(dm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var xwe=function(e,r){return[Object.keys(e),Object.keys(r)].reduce(function(n,s){return n.filter(function(i){return s.includes(i)})})},ywe=function(e){return e},vwe=function(e){return e.replace(/([A-Z])/g,function(r){return"-".concat(r.toLowerCase())})},oh=function(e,r){return Object.keys(r).reduce(function(n,s){return d4(d4({},n),{},FL({},s,e(s,r[s])))},{})},h4=function(e,r,n){return e.map(function(s){return"".concat(vwe(s)," ").concat(r,"ms ").concat(n)}).join(",")};function bwe(t,e){return Nwe(t)||jwe(t,e)||BL(t,e)||wwe()}function wwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4536In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jwe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Nwe(t){if(Array.isArray(t))return t}function _we(t){return Awe(t)||Twe(t)||BL(t)||Swe()}function Swe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4537In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function BL(t,e){if(t){if(typeof t=="string")return Gj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Gj(t,e)}}function Twe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Awe(t){if(Array.isArray(t))return Gj(t)}function Gj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var xx=1e-4,VL=function(e,r){return[0,3*e,3*r-6*e,3*e-3*r+1]},UL=function(e,r){return e.map(function(n,s){return n*Math.pow(r,s)}).reduce(function(n,s){return n+s})},m4=function(e,r){return function(n){var s=VL(e,r);return UL(s,n)}},Ewe=function(e,r){return function(n){var s=VL(e,r),i=[].concat(_we(s.map(function(o,l){return o*l}).slice(1)),[0]);return UL(i,n)}},f4=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var s=r[0],i=r[1],o=r[2],l=r[3];if(r.length===1)switch(r[0]){case"linear":s=0,i=0,o=1,l=1;break;case"ease":s=.25,i=.1,o=.25,l=1;break;case"ease-in":s=.42,i=0,o=1,l=1;break;case"ease-out":s=.42,i=0,o=.58,l=1;break;case"ease-in-out":s=0,i=0,o=.58,l=1;break;default:{var c=r[0].split("(");if(c[0]==="cubic-bezier"&&c[1].split(")")[0].split(",").length===4){var u=c[1].split(")")[0].split(",").map(function(g){return parseFloat(g)}),d=bwe(u,4);s=d[0],i=d[1],o=d[2],l=d[3]}}}var h=m4(s,o),m=m4(i,l),p=Ewe(s,o),x=function(v){return v>1?1:v<0?0:v},w=function(v){for(var b=v>1?1:v,y=b,T=0;T<8;++T){var N=h(y)-b,j=p(y);if(Math.abs(N-b)<xx||j<xx)return m(y);y=x(y-N/j)}return m(y)};return w.isStepper=!1,w},kwe=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=e.stiff,n=r===void 0?100:r,s=e.damping,i=s===void 0?8:s,o=e.dt,l=o===void 0?17:o,c=function(d,h,m){var p=-(d-h)*n,x=m*i,w=m+(p-x)*l/1e3,g=m*l/1e3+d;return Math.abs(g-h)<xx&&Math.abs(w)<xx?[h,0]:[g,w]};return c.isStepper=!0,c.dt=l,c},Pwe=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];var s=r[0];if(typeof s=="string")switch(s){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return f4(s);case"spring":return kwe();default:if(s.split("(")[0]==="cubic-bezier")return f4(s)}return typeof s=="function"?s:null};function hm(t){"@babel/helpers - typeof";return hm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hm(t)}function p4(t){return Owe(t)||Iwe(t)||zL(t)||Cwe()}function Cwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4538In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Iwe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Owe(t){if(Array.isArray(t))return Xj(t)}function g4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function _r(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?g4(Object(r),!0).forEach(function(n){Kj(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):g4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Kj(t,e,r){return e=Rwe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Rwe(t){var e=Dwe(t,"string");return hm(e)==="symbol"?e:String(e)}function Dwe(t,e){if(hm(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hm(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Mwe(t,e){return Fwe(t)||Lwe(t,e)||zL(t,e)||$we()}function $we(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4539In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zL(t,e){if(t){if(typeof t=="string")return Xj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Xj(t,e)}}function Xj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function Lwe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function Fwe(t){if(Array.isArray(t))return t}var yx=function(e,r,n){return e+(r-e)*n},Yj=function(e){var r=e.from,n=e.to;return r!==n},Bwe=function t(e,r,n){var s=oh(function(i,o){if(Yj(o)){var l=e(o.from,o.to,o.velocity),c=Mwe(l,2),u=c[0],d=c[1];return _r(_r({},o),{},{from:u,velocity:d})}return o},r);return n<1?oh(function(i,o){return Yj(o)?_r(_r({},o),{},{velocity:yx(o.velocity,s[i].velocity,n),from:yx(o.from,s[i].from,n)}):o},r):t(e,s,n-1)};const Vwe=function(t,e,r,n,s){var i=xwe(t,e),o=i.reduce(function(g,v){return _r(_r({},g),{},Kj({},v,[t[v],e[v]]))},{}),l=i.reduce(function(g,v){return _r(_r({},g),{},Kj({},v,{from:t[v],velocity:0,to:e[v]}))},{}),c=-1,u,d,h=function(){return null},m=function(){return oh(function(v,b){return b.from},l)},p=function(){return!Object.values(l).filter(Yj).length},x=function(v){u||(u=v);var b=v-u,y=b/r.dt;l=Bwe(r,l,y),s(_r(_r(_r({},t),e),m())),u=v,p()||(c=requestAnimationFrame(h))},w=function(v){d||(d=v);var b=(v-d)/n,y=oh(function(N,j){return yx.apply(void 0,p4(j).concat([r(b)]))},o);if(s(_r(_r(_r({},t),e),y)),b<1)c=requestAnimationFrame(h);else{var T=oh(function(N,j){return yx.apply(void 0,p4(j).concat([r(1)]))},o);s(_r(_r(_r({},t),e),T))}};return h=r.isStepper?x:w,function(){return requestAnimationFrame(h),function(){cancelAnimationFrame(c)}}};function Zc(t){"@babel/helpers - typeof";return Zc=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Zc(t)}var Uwe=["children","begin","duration","attributeName","easing","isActive","steps","from","to","canBegin","onAnimationEnd","shouldReAnimate","onAnimationReStart"];function zwe(t,e){if(t==null)return{};var r=Hwe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Hwe(t,e){if(t==null)return{};var r={},n=Object.keys(t),s,i;for(i=0;i<n.length;i++)s=n[i],!(e.indexOf(s)>=0)&&(r[s]=t[s]);return r}function hb(t){return Kwe(t)||Gwe(t)||Wwe(t)||qwe()}function qwe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4540In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Wwe(t,e){if(t){if(typeof t=="string")return Qj(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Qj(t,e)}}function Gwe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function Kwe(t){if(Array.isArray(t))return Qj(t)}function Qj(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function x4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function aa(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?x4(Object(r),!0).forEach(function(n){Vd(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Vd(t,e,r){return e=HL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Xwe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ywe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,HL(n.key),n)}}function Qwe(t,e,r){return e&&Ywe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function HL(t){var e=Jwe(t,"string");return Zc(e)==="symbol"?e:String(e)}function Jwe(t,e){if(Zc(t)!=="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Zc(n)!=="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Zwe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&Jj(t,e)}function Jj(t,e){return Jj=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},Jj(t,e)}function eje(t){var e=tje();return function(){var n=vx(t),s;if(e){var i=vx(this).constructor;s=Reflect.construct(n,arguments,i)}else s=n.apply(this,arguments);return Zj(this,s)}}function Zj(t,e){if(e&&(Zc(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return e1(t)}function e1(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function tje(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function vx(t){return vx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},vx(t)}var ba=function(t){Zwe(r,t);var e=eje(r);function r(n,s){var i;Xwe(this,r),i=e.call(this,n,s);var o=i.props,l=o.isActive,c=o.attributeName,u=o.from,d=o.to,h=o.steps,m=o.children,p=o.duration;if(i.handleStyleChange=i.handleStyleChange.bind(e1(i)),i.changeStyle=i.changeStyle.bind(e1(i)),!l||p<=0)return i.state={style:{}},typeof m=="function"&&(i.state={style:d}),Zj(i);if(h&&h.length)i.state={style:h[0].style};else if(u){if(typeof m=="function")return i.state={style:u},Zj(i);i.state={style:c?Vd({},c,u):u}}else i.state={style:{}};return i}return Qwe(r,[{key:"componentDidMount",value:function(){var s=this.props,i=s.isActive,o=s.canBegin;this.mounted=!0,!(!i||!o)&&this.runAnimation(this.props)}},{key:"componentDidUpdate",value:function(s){var i=this.props,o=i.isActive,l=i.canBegin,c=i.attributeName,u=i.shouldReAnimate,d=i.to,h=i.from,m=this.state.style;if(l){if(!o){var p={style:c?Vd({},c,d):d};this.state&&m&&(c&&m[c]!==d||!c&&m!==d)&&this.setState(p);return}if(!(owe(s.to,d)&&s.canBegin&&s.isActive)){var x=!s.canBegin||!s.isActive;this.manager&&this.manager.stop(),this.stopJSAnimation&&this.stopJSAnimation();var w=x||u?h:s.to;if(this.state&&m){var g={style:c?Vd({},c,w):w};(c&&m[c]!==w||!c&&m!==w)&&this.setState(g)}this.runAnimation(aa(aa({},this.props),{},{from:w,begin:0}))}}}},{key:"componentWillUnmount",value:function(){this.mounted=!1;var s=this.props.onAnimationEnd;this.unSubscribe&&this.unSubscribe(),this.manager&&(this.manager.stop(),this.manager=null),this.stopJSAnimation&&this.stopJSAnimation(),s&&s()}},{key:"handleStyleChange",value:function(s){this.changeStyle(s)}},{key:"changeStyle",value:function(s){this.mounted&&this.setState({style:s})}},{key:"runJSAnimation",value:function(s){var i=this,o=s.from,l=s.to,c=s.duration,u=s.easing,d=s.begin,h=s.onAnimationEnd,m=s.onAnimationStart,p=Vwe(o,l,Pwe(u),c,this.changeStyle),x=function(){i.stopJSAnimation=p()};this.manager.start([m,d,x,c,h])}},{key:"runStepAnimation",value:function(s){var i=this,o=s.steps,l=s.begin,c=s.onAnimationStart,u=o[0],d=u.style,h=u.duration,m=h===void 0?0:h,p=function(w,g,v){if(v===0)return w;var b=g.duration,y=g.easing,T=y===void 0?"ease":y,N=g.style,j=g.properties,_=g.onAnimationEnd,S=v>0?o[v-1]:g,k=j||Object.keys(N);if(typeof T=="function"||T==="spring")return[].concat(hb(w),[i.runJSAnimation.bind(i,{from:S.style,to:N,duration:b,easing:T}),b]);var I=h4(k,b,T),E=aa(aa(aa({},S.style),N),{},{transition:I});return[].concat(hb(w),[E,b,_]).filter(ywe)};return this.manager.start([c].concat(hb(o.reduce(p,[d,Math.max(m,l)])),[s.onAnimationEnd]))}},{key:"runAnimation",value:function(s){this.manager||(this.manager=fwe());var i=s.begin,o=s.duration,l=s.attributeName,c=s.to,u=s.easing,d=s.onAnimationStart,h=s.onAnimationEnd,m=s.steps,p=s.children,x=this.manager;if(this.unSubscribe=x.subscribe(this.handleStyleChange),typeof u=="function"||typeof p=="function"||u==="spring"){this.runJSAnimation(s);return}if(m.length>1){this.runStepAnimation(s);return}var w=l?Vd({},l,c):c,g=h4(Object.keys(w),o,u);x.start([d,i,aa(aa({},w),{},{transition:g}),o,h])}},{key:"render",value:function(){var s=this.props,i=s.children;s.begin;var o=s.duration;s.attributeName,s.easing;var l=s.isActive;s.steps,s.from,s.to,s.canBegin,s.onAnimationEnd,s.shouldReAnimate,s.onAnimationReStart;var c=zwe(s,Uwe),u=P.Children.count(i),d=this.state.style;if(typeof i=="function")return i(d);if(!l||u===0||o<=0)return i;var h=function(p){var x=p.props,w=x.style,g=w===void 0?{}:w,v=x.className,b=P.cloneElement(p,aa(aa({},c),{},{style:aa(aa({},g),d),className:v}));return b};return u===1?h(P.Children.only(i)):F.createElement("div",null,P.Children.map(i,function(m){return h(m)}))}}]),r}(P.PureComponent);ba.displayName="Animate";ba.defaultProps={begin:0,duration:1e3,from:"",to:"",attributeName:"",easing:"ease",isActive:!0,canBegin:!0,steps:[],onAnimationEnd:function(){},onAnimationStart:function(){}};ba.propTypes={from:Se.oneOfType([Se.object,Se.string]),to:Se.oneOfType([Se.object,Se.string]),attributeName:Se.string,duration:Se.number,begin:Se.number,easing:Se.oneOfType([Se.string,Se.func]),steps:Se.arrayOf(Se.shape({duration:Se.number.isRequired,style:Se.object.isRequired,easing:Se.oneOfType([Se.oneOf(["ease","ease-in","ease-out","ease-in-out","linear"]),Se.func]),properties:Se.arrayOf("string"),onAnimationEnd:Se.func})),children:Se.oneOfType([Se.node,Se.func]),isActive:Se.bool,canBegin:Se.bool,onAnimationEnd:Se.func,shouldReAnimate:Se.bool,onAnimationStart:Se.func,onAnimationReStart:Se.func};function mm(t){"@babel/helpers - typeof";return mm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mm(t)}function bx(){return bx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},bx.apply(this,arguments)}function rje(t,e){return ije(t)||sje(t,e)||aje(t,e)||nje()}function nje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4541In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function aje(t,e){if(t){if(typeof t=="string")return y4(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return y4(t,e)}}function y4(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function sje(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function ije(t){if(Array.isArray(t))return t}function v4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function b4(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?v4(Object(r),!0).forEach(function(n){oje(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):v4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function oje(t,e,r){return e=lje(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function lje(t){var e=cje(t,"string");return mm(e)=="symbol"?e:e+""}function cje(t,e){if(mm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var w4=function(e,r,n,s,i){var o=Math.min(Math.abs(n)/2,Math.abs(s)/2),l=s>=0?1:-1,c=n>=0?1:-1,u=s>=0&&n>=0||s<0&&n<0?1:0,d;if(o>0&&i instanceof Array){for(var h=[0,0,0,0],m=0,p=4;m<p;m++)h[m]=i[m]>o?o:i[m];d="M".concat(e,",").concat(r+l*h[0]),h[0]>0&&(d+="A ".concat(h[0],",").concat(h[0],",0,0,").concat(u,",").concat(e+c*h[0],",").concat(r)),d+="L ".concat(e+n-c*h[1],",").concat(r),h[1]>0&&(d+="A ".concat(h[1],",").concat(h[1],",0,0,").concat(u,`,
4542        `).concat(e+n,",").concat(r+l*h[1])),d+="L ".concat(e+n,",").concat(r+s-l*h[2]),h[2]>0&&(d+="A ".concat(h[2],",").concat(h[2],",0,0,").concat(u,`,
4543        `).concat(e+n-c*h[2],",").concat(r+s)),d+="L ".concat(e+c*h[3],",").concat(r+s),h[3]>0&&(d+="A ".concat(h[3],",").concat(h[3],",0,0,").concat(u,`,
4544        `).concat(e,",").concat(r+s-l*h[3])),d+="Z"}else if(o>0&&i===+i&&i>0){var x=Math.min(o,i);d="M ".concat(e,",").concat(r+l*x,`
4545            A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+c*x,",").concat(r,`
4546            L `).concat(e+n-c*x,",").concat(r,`
4547            A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+n,",").concat(r+l*x,`
4548            L `).concat(e+n,",").concat(r+s-l*x,`
4549            A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e+n-c*x,",").concat(r+s,`
4550            L `).concat(e+c*x,",").concat(r+s,`
4551            A `).concat(x,",").concat(x,",0,0,").concat(u,",").concat(e,",").concat(r+s-l*x," Z")}else d="M ".concat(e,",").concat(r," h ").concat(n," v ").concat(s," h ").concat(-n," Z");return d},uje=function(e,r){if(!e||!r)return!1;var n=e.x,s=e.y,i=r.x,o=r.y,l=r.width,c=r.height;if(Math.abs(l)>0&&Math.abs(c)>0){var u=Math.min(i,i+l),d=Math.max(i,i+l),h=Math.min(o,o+c),m=Math.max(o,o+c);return n>=u&&n<=d&&s>=h&&s<=m}return!1},dje={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},z_=function(e){var r=b4(b4({},dje),e),n=P.useRef(),s=P.useState(-1),i=rje(s,2),o=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var T=n.current.getTotalLength();T&&l(T)}catch{}},[]);var c=r.x,u=r.y,d=r.width,h=r.height,m=r.radius,p=r.className,x=r.animationEasing,w=r.animationDuration,g=r.animationBegin,v=r.isAnimationActive,b=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||d===0||h===0)return null;var y=Me("recharts-rectangle",p);return b?F.createElement(ba,{canBegin:o>0,from:{width:d,height:h,x:c,y:u},to:{width:d,height:h,x:c,y:u},duration:w,animationEasing:x,isActive:b},function(T){var N=T.width,j=T.height,_=T.x,S=T.y;return F.createElement(ba,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:w,isActive:v,easing:x},F.createElement("path",bx({},je(r,!0),{className:y,d:w4(_,S,N,j,m),ref:n})))}):F.createElement("path",bx({},je(r,!0),{className:y,d:w4(c,u,d,h,m)}))},hje=["points","className","baseLinePoints","connectNulls"];function rc(){return rc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},rc.apply(this,arguments)}function mje(t,e){if(t==null)return{};var r=fje(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function fje(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function j4(t){return yje(t)||xje(t)||gje(t)||pje()}function pje(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4552In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gje(t,e){if(t){if(typeof t=="string")return t1(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return t1(t,e)}}function xje(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function yje(t){if(Array.isArray(t))return t1(t)}function t1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var N4=function(e){return e&&e.x===+e.x&&e.y===+e.y},vje=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=[[]];return e.forEach(function(n){N4(n)?r[r.length-1].push(n):r[r.length-1].length>0&&r.push([])}),N4(e[0])&&r[r.length-1].push(e[0]),r[r.length-1].length<=0&&(r=r.slice(0,-1)),r},lh=function(e,r){var n=vje(e);r&&(n=[n.reduce(function(i,o){return[].concat(j4(i),j4(o))},[])]);var s=n.map(function(i){return i.reduce(function(o,l,c){return"".concat(o).concat(c===0?"M":"L").concat(l.x,",").concat(l.y)},"")}).join("");return n.length===1?"".concat(s,"Z"):s},bje=function(e,r,n){var s=lh(e,n);return"".concat(s.slice(-1)==="Z"?s.slice(0,-1):s,"L").concat(lh(r.reverse(),n).slice(1))},wje=function(e){var r=e.points,n=e.className,s=e.baseLinePoints,i=e.connectNulls,o=mje(e,hje);if(!r||!r.length)return null;var l=Me("recharts-polygon",n);if(s&&s.length){var c=o.stroke&&o.stroke!=="none",u=bje(r,s,i);return F.createElement("g",{className:l},F.createElement("path",rc({},je(o,!0),{fill:u.slice(-1)==="Z"?o.fill:"none",stroke:"none",d:u})),c?F.createElement("path",rc({},je(o,!0),{fill:"none",d:lh(r,i)})):null,c?F.createElement("path",rc({},je(o,!0),{fill:"none",d:lh(s,i)})):null)}var d=lh(r,i);return F.createElement("path",rc({},je(o,!0),{fill:d.slice(-1)==="Z"?o.fill:"none",className:l,d}))};function r1(){return r1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},r1.apply(this,arguments)}var nf=function(e){var r=e.cx,n=e.cy,s=e.r,i=e.className,o=Me("recharts-dot",i);return r===+r&&n===+n&&s===+s?P.createElement("circle",r1({},je(e,!1),Bg(e),{className:o,cx:r,cy:n,r:s})):null};function fm(t){"@babel/helpers - typeof";return fm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fm(t)}var jje=["x","y","top","left","width","height","className"];function n1(){return n1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},n1.apply(this,arguments)}function _4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Nje(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?_4(Object(r),!0).forEach(function(n){_je(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):_4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _je(t,e,r){return e=Sje(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Sje(t){var e=Tje(t,"string");return fm(e)=="symbol"?e:e+""}function Tje(t,e){if(fm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function Aje(t,e){if(t==null)return{};var r=Eje(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Eje(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var kje=function(e,r,n,s,i,o){return"M".concat(e,",").concat(i,"v").concat(s,"M").concat(o,",").concat(r,"h").concat(n)},Pje=function(e){var r=e.x,n=r===void 0?0:r,s=e.y,i=s===void 0?0:s,o=e.top,l=o===void 0?0:o,c=e.left,u=c===void 0?0:c,d=e.width,h=d===void 0?0:d,m=e.height,p=m===void 0?0:m,x=e.className,w=Aje(e,jje),g=Nje({x:n,y:i,top:l,left:u,width:h,height:p},w);return!ie(n)||!ie(i)||!ie(h)||!ie(p)||!ie(l)||!ie(u)?null:F.createElement("path",n1({},je(g,!0),{className:Me("recharts-cross",x),d:kje(n,i,h,p,l,u)}))},Cje=hv,Ije=sL,Oje=Za;function Rje(t,e){return t&&t.length?Cje(t,Oje(e),Ije):void 0}var Dje=Rje;const Mje=nt(Dje);var $je=hv,Lje=Za,Fje=iL;function Bje(t,e){return t&&t.length?$je(t,Lje(e),Fje):void 0}var Vje=Bje;const Uje=nt(Vje);var zje=["cx","cy","angle","ticks","axisLine"],Hje=["ticks","tick","angle","tickFormatter","stroke"];function eu(t){"@babel/helpers - typeof";return eu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},eu(t)}function ch(){return ch=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ch.apply(this,arguments)}function S4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function so(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?S4(Object(r),!0).forEach(function(n){gv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):S4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function T4(t,e){if(t==null)return{};var r=qje(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function qje(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Wje(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function A4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,WL(n.key),n)}}function Gje(t,e,r){return e&&A4(t.prototype,e),r&&A4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Kje(t,e,r){return e=wx(e),Xje(t,qL()?Reflect.construct(e,r||[],wx(t).constructor):e.apply(t,r))}function Xje(t,e){if(e&&(eu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return Yje(t)}function Yje(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function qL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(qL=function(){return!!t})()}function wx(t){return wx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},wx(t)}function Qje(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&a1(t,e)}function a1(t,e){return a1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},a1(t,e)}function gv(t,e,r){return e=WL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function WL(t){var e=Jje(t,"string");return eu(e)=="symbol"?e:e+""}function Jje(t,e){if(eu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(eu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var xv=function(t){function e(){return Wje(this,e),Kje(this,e,arguments)}return Qje(e,t),Gje(e,[{key:"getTickValueCoord",value:function(n){var s=n.coordinate,i=this.props,o=i.angle,l=i.cx,c=i.cy;return wt(l,c,s,o)}},{key:"getTickTextAnchor",value:function(){var n=this.props.orientation,s;switch(n){case"left":s="end";break;case"right":s="start";break;default:s="middle";break}return s}},{key:"getViewBox",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=Mje(l,function(d){return d.coordinate||0}),u=Uje(l,function(d){return d.coordinate||0});return{cx:s,cy:i,startAngle:o,endAngle:o,innerRadius:u.coordinate||0,outerRadius:c.coordinate||0}}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.angle,l=n.ticks,c=n.axisLine,u=T4(n,zje),d=l.reduce(function(x,w){return[Math.min(x[0],w.coordinate),Math.max(x[1],w.coordinate)]},[1/0,-1/0]),h=wt(s,i,d[0],o),m=wt(s,i,d[1],o),p=so(so(so({},je(u,!1)),{},{fill:"none"},je(c,!1)),{},{x1:h.x,y1:h.y,x2:m.x,y2:m.y});return F.createElement("line",ch({className:"recharts-polar-radius-axis-line"},p))}},{key:"renderTicks",value:function(){var n=this,s=this.props,i=s.ticks,o=s.tick,l=s.angle,c=s.tickFormatter,u=s.stroke,d=T4(s,Hje),h=this.getTickTextAnchor(),m=je(d,!1),p=je(o,!1),x=i.map(function(w,g){var v=n.getTickValueCoord(w),b=so(so(so(so({textAnchor:h,transform:"rotate(".concat(90-l,", ").concat(v.x,", ").concat(v.y,")")},m),{},{stroke:"none",fill:u},p),{},{index:g},v),{},{payload:w});return F.createElement(Ve,ch({className:Me("recharts-polar-radius-axis-tick",RL(o)),key:"tick-".concat(w.coordinate)},sl(n.props,w,g)),e.renderTickItem(o,b,c?c(w.value,g):w.value))});return F.createElement(Ve,{className:"recharts-polar-radius-axis-ticks"},x)}},{key:"render",value:function(){var n=this.props,s=n.ticks,i=n.axisLine,o=n.tick;return!s||!s.length?null:F.createElement(Ve,{className:Me("recharts-polar-radius-axis",this.props.className)},i&&this.renderAxisLine(),o&&this.renderTicks(),gr.renderCallByParent(this.props,this.getViewBox()))}}],[{key:"renderTickItem",value:function(n,s,i){var o;return F.isValidElement(n)?o=F.cloneElement(n,s):Ee(n)?o=n(s):o=F.createElement(il,ch({},s,{className:"recharts-polar-radius-axis-tick-value"}),i),o}}])}(P.PureComponent);gv(xv,"displayName","PolarRadiusAxis");gv(xv,"axisType","radiusAxis");gv(xv,"defaultProps",{type:"number",radiusAxisId:0,cx:0,cy:0,angle:0,orientation:"right",stroke:"#ccc",axisLine:!0,tick:!0,tickCount:5,allowDataOverflow:!1,scale:"auto",allowDuplicatedCategory:!0});function tu(t){"@babel/helpers - typeof";return tu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},tu(t)}function po(){return po=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},po.apply(this,arguments)}function E4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function io(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?E4(Object(r),!0).forEach(function(n){yv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):E4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Zje(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,KL(n.key),n)}}function e1e(t,e,r){return e&&k4(t.prototype,e),r&&k4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function t1e(t,e,r){return e=jx(e),r1e(t,GL()?Reflect.construct(e,r||[],jx(t).constructor):e.apply(t,r))}function r1e(t,e){if(e&&(tu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return n1e(t)}function n1e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function GL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(GL=function(){return!!t})()}function jx(t){return jx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},jx(t)}function a1e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&s1(t,e)}function s1(t,e){return s1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},s1(t,e)}function yv(t,e,r){return e=KL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function KL(t){var e=s1e(t,"string");return tu(e)=="symbol"?e:e+""}function s1e(t,e){if(tu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(tu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var i1e=Math.PI/180,P4=1e-5,vv=function(t){function e(){return Zje(this,e),t1e(this,e,arguments)}return a1e(e,t),e1e(e,[{key:"getTickLineCoord",value:function(n){var s=this.props,i=s.cx,o=s.cy,l=s.radius,c=s.orientation,u=s.tickSize,d=u||8,h=wt(i,o,l,n.coordinate),m=wt(i,o,l+(c==="inner"?-1:1)*d,n.coordinate);return{x1:h.x,y1:h.y,x2:m.x,y2:m.y}}},{key:"getTickTextAnchor",value:function(n){var s=this.props.orientation,i=Math.cos(-n.coordinate*i1e),o;return i>P4?o=s==="outer"?"start":"end":i<-P4?o=s==="outer"?"end":"start":o="middle",o}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.cx,i=n.cy,o=n.radius,l=n.axisLine,c=n.axisLineType,u=io(io({},je(this.props,!1)),{},{fill:"none"},je(l,!1));if(c==="circle")return F.createElement(nf,po({className:"recharts-polar-angle-axis-line"},u,{cx:s,cy:i,r:o}));var d=this.props.ticks,h=d.map(function(m){return wt(s,i,o,m.coordinate)});return F.createElement(wje,po({className:"recharts-polar-angle-axis-line"},u,{points:h}))}},{key:"renderTicks",value:function(){var n=this,s=this.props,i=s.ticks,o=s.tick,l=s.tickLine,c=s.tickFormatter,u=s.stroke,d=je(this.props,!1),h=je(o,!1),m=io(io({},d),{},{fill:"none"},je(l,!1)),p=i.map(function(x,w){var g=n.getTickLineCoord(x),v=n.getTickTextAnchor(x),b=io(io(io({textAnchor:v},d),{},{stroke:"none",fill:u},h),{},{index:w,payload:x,x:g.x2,y:g.y2});return F.createElement(Ve,po({className:Me("recharts-polar-angle-axis-tick",RL(o)),key:"tick-".concat(x.coordinate)},sl(n.props,x,w)),l&&F.createElement("line",po({className:"recharts-polar-angle-axis-tick-line"},m,g)),o&&e.renderTickItem(o,b,c?c(x.value,w):x.value))});return F.createElement(Ve,{className:"recharts-polar-angle-axis-ticks"},p)}},{key:"render",value:function(){var n=this.props,s=n.ticks,i=n.radius,o=n.axisLine;return i<=0||!s||!s.length?null:F.createElement(Ve,{className:Me("recharts-polar-angle-axis",this.props.className)},o&&this.renderAxisLine(),this.renderTicks())}}],[{key:"renderTickItem",value:function(n,s,i){var o;return F.isValidElement(n)?o=F.cloneElement(n,s):Ee(n)?o=n(s):o=F.createElement(il,po({},s,{className:"recharts-polar-angle-axis-tick-value"}),i),o}}])}(P.PureComponent);yv(vv,"displayName","PolarAngleAxis");yv(vv,"axisType","angleAxis");yv(vv,"defaultProps",{type:"category",angleAxisId:0,scale:"auto",cx:0,cy:0,orientation:"outer",axisLine:!0,tickLine:!0,tickSize:8,tick:!0,hide:!1,allowDuplicatedCategory:!0});var o1e=t$,l1e=o1e(Object.getPrototypeOf,Object),c1e=l1e,u1e=Fs,d1e=c1e,h1e=Bs,m1e="[object Object]",f1e=Function.prototype,p1e=Object.prototype,XL=f1e.toString,g1e=p1e.hasOwnProperty,x1e=XL.call(Object);function y1e(t){if(!h1e(t)||u1e(t)!=m1e)return!1;var e=d1e(t);if(e===null)return!0;var r=g1e.call(e,"constructor")&&e.constructor;return typeof r=="function"&&r instanceof r&&XL.call(r)==x1e}var v1e=y1e;const b1e=nt(v1e);var w1e=Fs,j1e=Bs,N1e="[object Boolean]";function _1e(t){return t===!0||t===!1||j1e(t)&&w1e(t)==N1e}var S1e=_1e;const T1e=nt(S1e);function pm(t){"@babel/helpers - typeof";return pm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},pm(t)}function Nx(){return Nx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Nx.apply(this,arguments)}function A1e(t,e){return C1e(t)||P1e(t,e)||k1e(t,e)||E1e()}function E1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4553In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function k1e(t,e){if(t){if(typeof t=="string")return C4(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return C4(t,e)}}function C4(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function P1e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function C1e(t){if(Array.isArray(t))return t}function I4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function O4(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?I4(Object(r),!0).forEach(function(n){I1e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):I4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function I1e(t,e,r){return e=O1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function O1e(t){var e=R1e(t,"string");return pm(e)=="symbol"?e:e+""}function R1e(t,e){if(pm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(pm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var R4=function(e,r,n,s,i){var o=n-s,l;return l="M ".concat(e,",").concat(r),l+="L ".concat(e+n,",").concat(r),l+="L ".concat(e+n-o/2,",").concat(r+i),l+="L ".concat(e+n-o/2-s,",").concat(r+i),l+="L ".concat(e,",").concat(r," Z"),l},D1e={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},M1e=function(e){var r=O4(O4({},D1e),e),n=P.useRef(),s=P.useState(-1),i=A1e(s,2),o=i[0],l=i[1];P.useEffect(function(){if(n.current&&n.current.getTotalLength)try{var y=n.current.getTotalLength();y&&l(y)}catch{}},[]);var c=r.x,u=r.y,d=r.upperWidth,h=r.lowerWidth,m=r.height,p=r.className,x=r.animationEasing,w=r.animationDuration,g=r.animationBegin,v=r.isUpdateAnimationActive;if(c!==+c||u!==+u||d!==+d||h!==+h||m!==+m||d===0&&h===0||m===0)return null;var b=Me("recharts-trapezoid",p);return v?F.createElement(ba,{canBegin:o>0,from:{upperWidth:0,lowerWidth:0,height:m,x:c,y:u},to:{upperWidth:d,lowerWidth:h,height:m,x:c,y:u},duration:w,animationEasing:x,isActive:v},function(y){var T=y.upperWidth,N=y.lowerWidth,j=y.height,_=y.x,S=y.y;return F.createElement(ba,{canBegin:o>0,from:"0px ".concat(o===-1?1:o,"px"),to:"".concat(o,"px 0px"),attributeName:"strokeDasharray",begin:g,duration:w,easing:x},F.createElement("path",Nx({},je(r,!0),{className:b,d:R4(_,S,T,N,j),ref:n})))}):F.createElement("g",null,F.createElement("path",Nx({},je(r,!0),{className:b,d:R4(c,u,d,h,m)})))},$1e=["option","shapeType","propTransformer","activeClassName","isActive"];function gm(t){"@babel/helpers - typeof";return gm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},gm(t)}function L1e(t,e){if(t==null)return{};var r=F1e(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function F1e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function D4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function _x(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?D4(Object(r),!0).forEach(function(n){B1e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):D4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function B1e(t,e,r){return e=V1e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function V1e(t){var e=U1e(t,"string");return gm(e)=="symbol"?e:e+""}function U1e(t,e){if(gm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(gm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function z1e(t,e){return _x(_x({},e),t)}function H1e(t,e){return t==="symbols"}function M4(t){var e=t.shapeType,r=t.elementProps;switch(e){case"rectangle":return F.createElement(z_,r);case"trapezoid":return F.createElement(M1e,r);case"sector":return F.createElement($L,r);case"symbols":if(H1e(e))return F.createElement(l_,r);break;default:return null}}function q1e(t){return P.isValidElement(t)?t.props:t}function YL(t){var e=t.option,r=t.shapeType,n=t.propTransformer,s=n===void 0?z1e:n,i=t.activeClassName,o=i===void 0?"recharts-active-shape":i,l=t.isActive,c=L1e(t,$1e),u;if(P.isValidElement(e))u=P.cloneElement(e,_x(_x({},c),q1e(e)));else if(Ee(e))u=e(c);else if(b1e(e)&&!T1e(e)){var d=s(e,c);u=F.createElement(M4,{shapeType:r,elementProps:d})}else{var h=c;u=F.createElement(M4,{shapeType:r,elementProps:h})}return l?F.createElement(Ve,{className:o},u):u}function bv(t,e){return e!=null&&"trapezoids"in t.props}function wv(t,e){return e!=null&&"sectors"in t.props}function xm(t,e){return e!=null&&"points"in t.props}function W1e(t,e){var r,n,s=t.x===(e==null||(r=e.labelViewBox)===null||r===void 0?void 0:r.x)||t.x===e.x,i=t.y===(e==null||(n=e.labelViewBox)===null||n===void 0?void 0:n.y)||t.y===e.y;return s&&i}function G1e(t,e){var r=t.endAngle===e.endAngle,n=t.startAngle===e.startAngle;return r&&n}function K1e(t,e){var r=t.x===e.x,n=t.y===e.y,s=t.z===e.z;return r&&n&&s}function X1e(t,e){var r;return bv(t,e)?r=W1e:wv(t,e)?r=G1e:xm(t,e)&&(r=K1e),r}function Y1e(t,e){var r;return bv(t,e)?r="trapezoids":wv(t,e)?r="sectors":xm(t,e)&&(r="points"),r}function Q1e(t,e){if(bv(t,e)){var r;return(r=e.tooltipPayload)===null||r===void 0||(r=r[0])===null||r===void 0||(r=r.payload)===null||r===void 0?void 0:r.payload}if(wv(t,e)){var n;return(n=e.tooltipPayload)===null||n===void 0||(n=n[0])===null||n===void 0||(n=n.payload)===null||n===void 0?void 0:n.payload}return xm(t,e)?e.payload:{}}function J1e(t){var e=t.activeTooltipItem,r=t.graphicalItem,n=t.itemData,s=Y1e(r,e),i=Q1e(r,e),o=n.filter(function(c,u){var d=ol(i,c),h=r.props[s].filter(function(x){var w=X1e(r,e);return w(x,e)}),m=r.props[s].indexOf(h[h.length-1]),p=u===m;return d&&p}),l=n.indexOf(o[o.length-1]);return l}var Fp;function ru(t){"@babel/helpers - typeof";return ru=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ru(t)}function nc(){return nc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},nc.apply(this,arguments)}function $4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function yt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?$4(Object(r),!0).forEach(function(n){Hn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):$4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Z1e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function L4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,JL(n.key),n)}}function eNe(t,e,r){return e&&L4(t.prototype,e),r&&L4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function tNe(t,e,r){return e=Sx(e),rNe(t,QL()?Reflect.construct(e,r||[],Sx(t).constructor):e.apply(t,r))}function rNe(t,e){if(e&&(ru(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return nNe(t)}function nNe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function QL(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(QL=function(){return!!t})()}function Sx(t){return Sx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Sx(t)}function aNe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&i1(t,e)}function i1(t,e){return i1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},i1(t,e)}function Hn(t,e,r){return e=JL(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function JL(t){var e=sNe(t,"string");return ru(e)=="symbol"?e:e+""}function sNe(t,e){if(ru(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ru(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var wa=function(t){function e(r){var n;return Z1e(this,e),n=tNe(this,e,[r]),Hn(n,"pieRef",null),Hn(n,"sectorRefs",[]),Hn(n,"id",Nl("recharts-pie-")),Hn(n,"handleAnimationEnd",function(){var s=n.props.onAnimationEnd;n.setState({isAnimationFinished:!0}),Ee(s)&&s()}),Hn(n,"handleAnimationStart",function(){var s=n.props.onAnimationStart;n.setState({isAnimationFinished:!1}),Ee(s)&&s()}),n.state={isAnimationFinished:!r.isAnimationActive,prevIsAnimationActive:r.isAnimationActive,prevAnimationId:r.animationId,sectorToFocus:0},n}return aNe(e,t),eNe(e,[{key:"isActiveIndex",value:function(n){var s=this.props.activeIndex;return Array.isArray(s)?s.indexOf(n)!==-1:n===s}},{key:"hasActiveIndex",value:function(){var n=this.props.activeIndex;return Array.isArray(n)?n.length!==0:n||n===0}},{key:"renderLabels",value:function(n){var s=this.props.isAnimationActive;if(s&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.label,l=i.labelLine,c=i.dataKey,u=i.valueKey,d=je(this.props,!1),h=je(o,!1),m=je(l,!1),p=o&&o.offsetRadius||20,x=n.map(function(w,g){var v=(w.startAngle+w.endAngle)/2,b=wt(w.cx,w.cy,w.outerRadius+p,v),y=yt(yt(yt(yt({},d),w),{},{stroke:"none"},h),{},{index:g,textAnchor:e.getTextAnchor(b.x,w.cx)},b),T=yt(yt(yt(yt({},d),w),{},{fill:"none",stroke:w.fill},m),{},{index:g,points:[wt(w.cx,w.cy,w.outerRadius,v),b]}),N=c;return Ie(c)&&Ie(u)?N="value":Ie(c)&&(N=u),F.createElement(Ve,{key:"label-".concat(w.startAngle,"-").concat(w.endAngle,"-").concat(w.midAngle,"-").concat(g)},l&&e.renderLabelLineItem(l,T,"line"),e.renderLabelItem(o,y,Gt(w,N)))});return F.createElement(Ve,{className:"recharts-pie-labels"},x)}},{key:"renderSectorsStatically",value:function(n){var s=this,i=this.props,o=i.activeShape,l=i.blendStroke,c=i.inactiveShape;return n.map(function(u,d){if((u==null?void 0:u.startAngle)===0&&(u==null?void 0:u.endAngle)===0&&n.length!==1)return null;var h=s.isActiveIndex(d),m=c&&s.hasActiveIndex()?c:null,p=h?o:m,x=yt(yt({},u),{},{stroke:l?u.fill:u.stroke,tabIndex:-1});return F.createElement(Ve,nc({ref:function(g){g&&!s.sectorRefs.includes(g)&&s.sectorRefs.push(g)},tabIndex:-1,className:"recharts-pie-sector"},sl(s.props,u,d),{key:"sector-".concat(u==null?void 0:u.startAngle,"-").concat(u==null?void 0:u.endAngle,"-").concat(u.midAngle,"-").concat(d)}),F.createElement(YL,nc({option:p,isActive:h,shapeType:"sector"},x)))})}},{key:"renderSectorsWithAnimation",value:function(){var n=this,s=this.props,i=s.sectors,o=s.isAnimationActive,l=s.animationBegin,c=s.animationDuration,u=s.animationEasing,d=s.animationId,h=this.state,m=h.prevSectors,p=h.prevIsAnimationActive;return F.createElement(ba,{begin:l,duration:c,isActive:o,easing:u,from:{t:0},to:{t:1},key:"pie-".concat(d,"-").concat(p),onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},function(x){var w=x.t,g=[],v=i&&i[0],b=v.startAngle;return i.forEach(function(y,T){var N=m&&m[T],j=T>0?Cn(y,"paddingAngle",0):0;if(N){var _=ir(N.endAngle-N.startAngle,y.endAngle-y.startAngle),S=yt(yt({},y),{},{startAngle:b+j,endAngle:b+_(w)+j});g.push(S),b=S.endAngle}else{var k=y.endAngle,I=y.startAngle,E=ir(0,k-I),C=E(w),R=yt(yt({},y),{},{startAngle:b+j,endAngle:b+C+j});g.push(R),b=R.endAngle}}),F.createElement(Ve,null,n.renderSectorsStatically(g))})}},{key:"attachKeyboardHandlers",value:function(n){var s=this;n.onkeydown=function(i){if(!i.altKey)switch(i.key){case"ArrowLeft":{var o=++s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[o].focus(),s.setState({sectorToFocus:o});break}case"ArrowRight":{var l=--s.state.sectorToFocus<0?s.sectorRefs.length-1:s.state.sectorToFocus%s.sectorRefs.length;s.sectorRefs[l].focus(),s.setState({sectorToFocus:l});break}case"Escape":{s.sectorRefs[s.state.sectorToFocus].blur(),s.setState({sectorToFocus:0});break}}}}},{key:"renderSectors",value:function(){var n=this.props,s=n.sectors,i=n.isAnimationActive,o=this.state.prevSectors;return i&&s&&s.length&&(!o||!ol(o,s))?this.renderSectorsWithAnimation():this.renderSectorsStatically(s)}},{key:"componentDidMount",value:function(){this.pieRef&&this.attachKeyboardHandlers(this.pieRef)}},{key:"render",value:function(){var n=this,s=this.props,i=s.hide,o=s.sectors,l=s.className,c=s.label,u=s.cx,d=s.cy,h=s.innerRadius,m=s.outerRadius,p=s.isAnimationActive,x=this.state.isAnimationFinished;if(i||!o||!o.length||!ie(u)||!ie(d)||!ie(h)||!ie(m))return null;var w=Me("recharts-pie",l);return F.createElement(Ve,{tabIndex:this.props.rootTabIndex,className:w,ref:function(v){n.pieRef=v}},this.renderSectors(),c&&this.renderLabels(o),gr.renderCallByParent(this.props,null,!1),(!p||x)&&Ua.renderCallByParent(this.props,o,!1))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return s.prevIsAnimationActive!==n.isAnimationActive?{prevIsAnimationActive:n.isAnimationActive,prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:[],isAnimationFinished:!0}:n.isAnimationActive&&n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curSectors:n.sectors,prevSectors:s.curSectors,isAnimationFinished:!0}:n.sectors!==s.curSectors?{curSectors:n.sectors,isAnimationFinished:!0}:null}},{key:"getTextAnchor",value:function(n,s){return n>s?"start":n<s?"end":"middle"}},{key:"renderLabelLineItem",value:function(n,s,i){if(F.isValidElement(n))return F.cloneElement(n,s);if(Ee(n))return n(s);var o=Me("recharts-pie-label-line",typeof n!="boolean"?n.className:"");return F.createElement(Do,nc({},s,{key:i,type:"linear",className:o}))}},{key:"renderLabelItem",value:function(n,s,i){if(F.isValidElement(n))return F.cloneElement(n,s);var o=i;if(Ee(n)&&(o=n(s),F.isValidElement(o)))return o;var l=Me("recharts-pie-label-text",typeof n!="boolean"&&!Ee(n)?n.className:"");return F.createElement(il,nc({},s,{alignmentBaseline:"middle",className:l}),o)}}])}(P.PureComponent);Fp=wa;Hn(wa,"displayName","Pie");Hn(wa,"defaultProps",{stroke:"#fff",fill:"#808080",legendType:"rect",cx:"50%",cy:"50%",startAngle:0,endAngle:360,innerRadius:0,outerRadius:"80%",paddingAngle:0,labelLine:!0,hide:!1,minAngle:0,isAnimationActive:!Gi.isSsr,animationBegin:400,animationDuration:1500,animationEasing:"ease",nameKey:"name",blendStroke:!1,rootTabIndex:0});Hn(wa,"parseDeltaAngle",function(t,e){var r=Jr(e-t),n=Math.min(Math.abs(e-t),360);return r*n});Hn(wa,"getRealPieData",function(t){var e=t.data,r=t.children,n=je(t,!1),s=In(r,Kc);return e&&e.length?e.map(function(i,o){return yt(yt(yt({payload:i},n),i),s&&s[o]&&s[o].props)}):s&&s.length?s.map(function(i){return yt(yt({},n),i.props)}):[]});Hn(wa,"parseCoordinateOfPie",function(t,e){var r=e.top,n=e.left,s=e.width,i=e.height,o=OL(s,i),l=n+Zr(t.cx,s,s/2),c=r+Zr(t.cy,i,i/2),u=Zr(t.innerRadius,o,0),d=Zr(t.outerRadius,o,o*.8),h=t.maxRadius||Math.sqrt(s*s+i*i)/2;return{cx:l,cy:c,innerRadius:u,outerRadius:d,maxRadius:h}});Hn(wa,"getComposedData",function(t){var e=t.item,r=t.offset,n=e.type.defaultProps!==void 0?yt(yt({},e.type.defaultProps),e.props):e.props,s=Fp.getRealPieData(n);if(!s||!s.length)return null;var i=n.cornerRadius,o=n.startAngle,l=n.endAngle,c=n.paddingAngle,u=n.dataKey,d=n.nameKey,h=n.valueKey,m=n.tooltipType,p=Math.abs(n.minAngle),x=Fp.parseCoordinateOfPie(n,r),w=Fp.parseDeltaAngle(o,l),g=Math.abs(w),v=u;Ie(u)&&Ie(h)?(fa(!1,`Use "dataKey" to specify the value of pie,
4554      the props "valueKey" will be deprecated in 1.1.0`),v="value"):Ie(u)&&(fa(!1,`Use "dataKey" to specify the value of pie,
4555      the props "valueKey" will be deprecated in 1.1.0`),v=h);var b=s.filter(function(S){return Gt(S,v,0)!==0}).length,y=(g>=360?b:b-1)*c,T=g-b*p-y,N=s.reduce(function(S,k){var I=Gt(k,v,0);return S+(ie(I)?I:0)},0),j;if(N>0){var _;j=s.map(function(S,k){var I=Gt(S,v,0),E=Gt(S,d,k),C=(ie(I)?I:0)/N,R;k?R=_.endAngle+Jr(w)*c*(I!==0?1:0):R=o;var W=R+Jr(w)*((I!==0?p:0)+C*T),M=(R+W)/2,L=(x.innerRadius+x.outerRadius)/2,U=[{name:E,value:I,payload:S,dataKey:v,type:m}],V=wt(x.cx,x.cy,L,M);return _=yt(yt(yt({percent:C,cornerRadius:i,name:E,tooltipPayload:U,midAngle:M,middleRadius:L,tooltipPosition:V},S),x),{},{value:Gt(S,v),startAngle:R,endAngle:W,payload:S,paddingAngle:Jr(w)*c}),_})}return yt(yt({},x),{},{sectors:j,data:s})});var iNe=Math.ceil,oNe=Math.max;function lNe(t,e,r,n){for(var s=-1,i=oNe(iNe((e-t)/(r||1)),0),o=Array(i);i--;)o[n?i:++s]=t,t+=r;return o}var cNe=lNe,uNe=b$,F4=1/0,dNe=17976931348623157e292;function hNe(t){if(!t)return t===0?t:0;if(t=uNe(t),t===F4||t===-F4){var e=t<0?-1:1;return e*dNe}return t===t?t:0}var ZL=hNe,mNe=cNe,fNe=sv,mb=ZL;function pNe(t){return function(e,r,n){return n&&typeof n!="number"&&fNe(e,r,n)&&(r=n=void 0),e=mb(e),r===void 0?(r=e,e=0):r=mb(r),n=n===void 0?e<r?1:-1:mb(n),mNe(e,r,n,t)}}var gNe=pNe,xNe=gNe,yNe=xNe(),vNe=yNe;const Tx=nt(vNe);function ym(t){"@babel/helpers - typeof";return ym=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ym(t)}function B4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function V4(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?B4(Object(r),!0).forEach(function(n){e9(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):B4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function e9(t,e,r){return e=bNe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bNe(t){var e=wNe(t,"string");return ym(e)=="symbol"?e:e+""}function wNe(t,e){if(ym(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ym(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var jNe=["Webkit","Moz","O","ms"],NNe=function(e,r){var n=e.replace(/(\w)/,function(i){return i.toUpperCase()}),s=jNe.reduce(function(i,o){return V4(V4({},i),{},e9({},o+n,r))},{});return s[e]=r,s};function nu(t){"@babel/helpers - typeof";return nu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},nu(t)}function Ax(){return Ax=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ax.apply(this,arguments)}function U4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function fb(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?U4(Object(r),!0).forEach(function(n){jn(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):U4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function _Ne(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function z4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,r9(n.key),n)}}function SNe(t,e,r){return e&&z4(t.prototype,e),r&&z4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function TNe(t,e,r){return e=Ex(e),ANe(t,t9()?Reflect.construct(e,r||[],Ex(t).constructor):e.apply(t,r))}function ANe(t,e){if(e&&(nu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ENe(t)}function ENe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function t9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(t9=function(){return!!t})()}
vendor: 133,066 bytes, lines 4555-4560
4555function Ex(t){return Ex=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ex(t)}function kNe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&o1(t,e)}function o1(t,e){return o1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},o1(t,e)}function jn(t,e,r){return e=r9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function r9(t){var e=PNe(t,"string");return nu(e)=="symbol"?e:e+""}function PNe(t,e){if(nu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(nu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var CNe=function(e){var r=e.data,n=e.startIndex,s=e.endIndex,i=e.x,o=e.width,l=e.travellerWidth;if(!r||!r.length)return{};var c=r.length,u=sh().domain(Tx(0,c)).range([i,i+o-l]),d=u.domain().map(function(h){return u(h)});return{isTextActive:!1,isSlideMoving:!1,isTravellerMoving:!1,isTravellerFocused:!1,startX:u(n),endX:u(s),scale:u,scaleValues:d}},H4=function(e){return e.changedTouches&&!!e.changedTouches.length},au=function(t){function e(r){var n;return _Ne(this,e),n=TNe(this,e,[r]),jn(n,"handleDrag",function(s){n.leaveTimer&&(clearTimeout(n.leaveTimer),n.leaveTimer=null),n.state.isTravellerMoving?n.handleTravellerMove(s):n.state.isSlideMoving&&n.handleSlideDrag(s)}),jn(n,"handleTouchMove",function(s){s.changedTouches!=null&&s.changedTouches.length>0&&n.handleDrag(s.changedTouches[0])}),jn(n,"handleDragEnd",function(){n.setState({isTravellerMoving:!1,isSlideMoving:!1},function(){var s=n.props,i=s.endIndex,o=s.onDragEnd,l=s.startIndex;o==null||o({endIndex:i,startIndex:l})}),n.detachDragEndListener()}),jn(n,"handleLeaveWrapper",function(){(n.state.isTravellerMoving||n.state.isSlideMoving)&&(n.leaveTimer=window.setTimeout(n.handleDragEnd,n.props.leaveTimeOut))}),jn(n,"handleEnterSlideOrTraveller",function(){n.setState({isTextActive:!0})}),jn(n,"handleLeaveSlideOrTraveller",function(){n.setState({isTextActive:!1})}),jn(n,"handleSlideDragStart",function(s){var i=H4(s)?s.changedTouches[0]:s;n.setState({isTravellerMoving:!1,isSlideMoving:!0,slideMoveStartX:i.pageX}),n.attachDragEndListener()}),n.travellerDragStartHandlers={startX:n.handleTravellerDragStart.bind(n,"startX"),endX:n.handleTravellerDragStart.bind(n,"endX")},n.state={},n}return kNe(e,t),SNe(e,[{key:"componentWillUnmount",value:function(){this.leaveTimer&&(clearTimeout(this.leaveTimer),this.leaveTimer=null),this.detachDragEndListener()}},{key:"getIndex",value:function(n){var s=n.startX,i=n.endX,o=this.state.scaleValues,l=this.props,c=l.gap,u=l.data,d=u.length-1,h=Math.min(s,i),m=Math.max(s,i),p=e.getIndexInRange(o,h),x=e.getIndexInRange(o,m);return{startIndex:p-p%c,endIndex:x===d?d:x-x%c}}},{key:"getTextOfTick",value:function(n){var s=this.props,i=s.data,o=s.tickFormatter,l=s.dataKey,c=Gt(i[n],l,n);return Ee(o)?o(c,n):c}},{key:"attachDragEndListener",value:function(){window.addEventListener("mouseup",this.handleDragEnd,!0),window.addEventListener("touchend",this.handleDragEnd,!0),window.addEventListener("mousemove",this.handleDrag,!0)}},{key:"detachDragEndListener",value:function(){window.removeEventListener("mouseup",this.handleDragEnd,!0),window.removeEventListener("touchend",this.handleDragEnd,!0),window.removeEventListener("mousemove",this.handleDrag,!0)}},{key:"handleSlideDrag",value:function(n){var s=this.state,i=s.slideMoveStartX,o=s.startX,l=s.endX,c=this.props,u=c.x,d=c.width,h=c.travellerWidth,m=c.startIndex,p=c.endIndex,x=c.onChange,w=n.pageX-i;w>0?w=Math.min(w,u+d-h-l,u+d-h-o):w<0&&(w=Math.max(w,u-o,u-l));var g=this.getIndex({startX:o+w,endX:l+w});(g.startIndex!==m||g.endIndex!==p)&&x&&x(g),this.setState({startX:o+w,endX:l+w,slideMoveStartX:n.pageX})}},{key:"handleTravellerDragStart",value:function(n,s){var i=H4(s)?s.changedTouches[0]:s;this.setState({isSlideMoving:!1,isTravellerMoving:!0,movingTravellerId:n,brushMoveStartX:i.pageX}),this.attachDragEndListener()}},{key:"handleTravellerMove",value:function(n){var s=this.state,i=s.brushMoveStartX,o=s.movingTravellerId,l=s.endX,c=s.startX,u=this.state[o],d=this.props,h=d.x,m=d.width,p=d.travellerWidth,x=d.onChange,w=d.gap,g=d.data,v={startX:this.state.startX,endX:this.state.endX},b=n.pageX-i;b>0?b=Math.min(b,h+m-p-u):b<0&&(b=Math.max(b,h-u)),v[o]=u+b;var y=this.getIndex(v),T=y.startIndex,N=y.endIndex,j=function(){var S=g.length-1;return o==="startX"&&(l>c?T%w===0:N%w===0)||l<c&&N===S||o==="endX"&&(l>c?N%w===0:T%w===0)||l>c&&N===S};this.setState(jn(jn({},o,u+b),"brushMoveStartX",n.pageX),function(){x&&j()&&x(y)})}},{key:"handleTravellerMoveKeyboard",value:function(n,s){var i=this,o=this.state,l=o.scaleValues,c=o.startX,u=o.endX,d=this.state[s],h=l.indexOf(d);if(h!==-1){var m=h+n;if(!(m===-1||m>=l.length)){var p=l[m];s==="startX"&&p>=u||s==="endX"&&p<=c||this.setState(jn({},s,p),function(){i.props.onChange(i.getIndex({startX:i.state.startX,endX:i.state.endX}))})}}}},{key:"renderBackground",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.fill,u=n.stroke;return F.createElement("rect",{stroke:u,fill:c,x:s,y:i,width:o,height:l})}},{key:"renderPanorama",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.data,u=n.children,d=n.padding,h=P.Children.only(u);return h?F.cloneElement(h,{x:s,y:i,width:o,height:l,margin:d,compact:!0,data:c}):null}},{key:"renderTravellerLayer",value:function(n,s){var i,o,l=this,c=this.props,u=c.y,d=c.travellerWidth,h=c.height,m=c.traveller,p=c.ariaLabel,x=c.data,w=c.startIndex,g=c.endIndex,v=Math.max(n,this.props.x),b=fb(fb({},je(this.props,!1)),{},{x:v,y:u,width:d,height:h}),y=p||"Min value: ".concat((i=x[w])===null||i===void 0?void 0:i.name,", Max value: ").concat((o=x[g])===null||o===void 0?void 0:o.name);return F.createElement(Ve,{tabIndex:0,role:"slider","aria-label":y,"aria-valuenow":n,className:"recharts-brush-traveller",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.travellerDragStartHandlers[s],onTouchStart:this.travellerDragStartHandlers[s],onKeyDown:function(N){["ArrowLeft","ArrowRight"].includes(N.key)&&(N.preventDefault(),N.stopPropagation(),l.handleTravellerMoveKeyboard(N.key==="ArrowRight"?1:-1,s))},onFocus:function(){l.setState({isTravellerFocused:!0})},onBlur:function(){l.setState({isTravellerFocused:!1})},style:{cursor:"col-resize"}},e.renderTraveller(m,b))}},{key:"renderSlide",value:function(n,s){var i=this.props,o=i.y,l=i.height,c=i.stroke,u=i.travellerWidth,d=Math.min(n,s)+u,h=Math.max(Math.abs(s-n)-u,0);return F.createElement("rect",{className:"recharts-brush-slide",onMouseEnter:this.handleEnterSlideOrTraveller,onMouseLeave:this.handleLeaveSlideOrTraveller,onMouseDown:this.handleSlideDragStart,onTouchStart:this.handleSlideDragStart,style:{cursor:"move"},stroke:"none",fill:c,fillOpacity:.2,x:d,y:o,width:h,height:l})}},{key:"renderText",value:function(){var n=this.props,s=n.startIndex,i=n.endIndex,o=n.y,l=n.height,c=n.travellerWidth,u=n.stroke,d=this.state,h=d.startX,m=d.endX,p=5,x={pointerEvents:"none",fill:u};return F.createElement(Ve,{className:"recharts-brush-texts"},F.createElement(il,Ax({textAnchor:"end",verticalAnchor:"middle",x:Math.min(h,m)-p,y:o+l/2},x),this.getTextOfTick(s)),F.createElement(il,Ax({textAnchor:"start",verticalAnchor:"middle",x:Math.max(h,m)+c+p,y:o+l/2},x),this.getTextOfTick(i)))}},{key:"render",value:function(){var n=this.props,s=n.data,i=n.className,o=n.children,l=n.x,c=n.y,u=n.width,d=n.height,h=n.alwaysShowText,m=this.state,p=m.startX,x=m.endX,w=m.isTextActive,g=m.isSlideMoving,v=m.isTravellerMoving,b=m.isTravellerFocused;if(!s||!s.length||!ie(l)||!ie(c)||!ie(u)||!ie(d)||u<=0||d<=0)return null;var y=Me("recharts-brush",i),T=F.Children.count(o)===1,N=NNe("userSelect","none");return F.createElement(Ve,{className:y,onMouseLeave:this.handleLeaveWrapper,onTouchMove:this.handleTouchMove,style:N},this.renderBackground(),T&&this.renderPanorama(),this.renderSlide(p,x),this.renderTravellerLayer(p,"startX"),this.renderTravellerLayer(x,"endX"),(w||g||v||b||h)&&this.renderText())}}],[{key:"renderDefaultTraveller",value:function(n){var s=n.x,i=n.y,o=n.width,l=n.height,c=n.stroke,u=Math.floor(i+l/2)-1;return F.createElement(F.Fragment,null,F.createElement("rect",{x:s,y:i,width:o,height:l,fill:c,stroke:"none"}),F.createElement("line",{x1:s+1,y1:u,x2:s+o-1,y2:u,fill:"none",stroke:"#fff"}),F.createElement("line",{x1:s+1,y1:u+2,x2:s+o-1,y2:u+2,fill:"none",stroke:"#fff"}))}},{key:"renderTraveller",value:function(n,s){var i;return F.isValidElement(n)?i=F.cloneElement(n,s):Ee(n)?i=n(s):i=e.renderDefaultTraveller(s),i}},{key:"getDerivedStateFromProps",value:function(n,s){var i=n.data,o=n.width,l=n.x,c=n.travellerWidth,u=n.updateId,d=n.startIndex,h=n.endIndex;if(i!==s.prevData||u!==s.prevUpdateId)return fb({prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o},i&&i.length?CNe({data:i,width:o,x:l,travellerWidth:c,startIndex:d,endIndex:h}):{scale:null,scaleValues:null});if(s.scale&&(o!==s.prevWidth||l!==s.prevX||c!==s.prevTravellerWidth)){s.scale.range([l,l+o-c]);var m=s.scale.domain().map(function(p){return s.scale(p)});return{prevData:i,prevTravellerWidth:c,prevUpdateId:u,prevX:l,prevWidth:o,startX:s.scale(n.startIndex),endX:s.scale(n.endIndex),scaleValues:m}}return null}},{key:"getIndexInRange",value:function(n,s){for(var i=n.length,o=0,l=i-1;l-o>1;){var c=Math.floor((o+l)/2);n[c]>s?l=c:o=c}return s>=n[l]?l:o}}])}(P.PureComponent);jn(au,"displayName","Brush");jn(au,"defaultProps",{height:40,travellerWidth:5,gap:1,fill:"#fff",stroke:"#666",padding:{top:1,right:1,bottom:1,left:1},leaveTimeOut:1e3,alwaysShowText:!1});var INe=p_;function ONe(t,e){var r;return INe(t,function(n,s,i){return r=e(n,s,i),!r}),!!r}var RNe=ONe,DNe=G6,MNe=Za,$Ne=RNe,LNe=yn,FNe=sv;function BNe(t,e,r){var n=LNe(t)?DNe:$Ne;return r&&FNe(t,e,r)&&(e=void 0),n(t,MNe(e))}var VNe=BNe;const UNe=nt(VNe);var za=function(e,r){var n=e.alwaysShow,s=e.ifOverflow;return n&&(s="extendDomain"),s===r},q4=p$;function zNe(t,e,r){e=="__proto__"&&q4?q4(t,e,{configurable:!0,enumerable:!0,value:r,writable:!0}):t[e]=r}var HNe=zNe,qNe=HNe,WNe=m$,GNe=Za;function KNe(t,e){var r={};return e=GNe(e),WNe(t,function(n,s,i){qNe(r,s,e(n,s,i))}),r}var XNe=KNe;const YNe=nt(XNe);function QNe(t,e){for(var r=-1,n=t==null?0:t.length;++r<n;)if(!e(t[r],r,t))return!1;return!0}var JNe=QNe,ZNe=p_;function e2e(t,e){var r=!0;return ZNe(t,function(n,s,i){return r=!!e(n,s,i),r}),r}var t2e=e2e,r2e=JNe,n2e=t2e,a2e=Za,s2e=yn,i2e=sv;function o2e(t,e,r){var n=s2e(t)?r2e:n2e;return r&&i2e(t,e,r)&&(e=void 0),n(t,a2e(e))}var l2e=o2e;const n9=nt(l2e);var c2e=["x","y"];function vm(t){"@babel/helpers - typeof";return vm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},vm(t)}function l1(){return l1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},l1.apply(this,arguments)}function W4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function kd(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?W4(Object(r),!0).forEach(function(n){u2e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):W4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function u2e(t,e,r){return e=d2e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function d2e(t){var e=h2e(t,"string");return vm(e)=="symbol"?e:e+""}function h2e(t,e){if(vm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(vm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function m2e(t,e){if(t==null)return{};var r=f2e(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function f2e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function p2e(t,e){var r=t.x,n=t.y,s=m2e(t,c2e),i="".concat(r),o=parseInt(i,10),l="".concat(n),c=parseInt(l,10),u="".concat(e.height||s.height),d=parseInt(u,10),h="".concat(e.width||s.width),m=parseInt(h,10);return kd(kd(kd(kd(kd({},e),s),o?{x:o}:{}),c?{y:c}:{}),{},{height:d,width:m,name:e.name,radius:e.radius})}function G4(t){return F.createElement(YL,l1({shapeType:"rectangle",propTransformer:p2e,activeClassName:"recharts-active-bar"},t))}var g2e=function(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return function(n,s){if(typeof e=="number")return e;var i=ie(n)||Gae(n);return i?e(n,s):(i||cl(),r)}},x2e=["value","background"],a9;function su(t){"@babel/helpers - typeof";return su=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},su(t)}function y2e(t,e){if(t==null)return{};var r=v2e(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function v2e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function kx(){return kx=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},kx.apply(this,arguments)}function K4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Xt(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?K4(Object(r),!0).forEach(function(n){fi(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):K4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function b2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function X4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i9(n.key),n)}}function w2e(t,e,r){return e&&X4(t.prototype,e),r&&X4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function j2e(t,e,r){return e=Px(e),N2e(t,s9()?Reflect.construct(e,r||[],Px(t).constructor):e.apply(t,r))}function N2e(t,e){if(e&&(su(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return _2e(t)}function _2e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(s9=function(){return!!t})()}function Px(t){return Px=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Px(t)}function S2e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&c1(t,e)}function c1(t,e){return c1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},c1(t,e)}function fi(t,e,r){return e=i9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function i9(t){var e=T2e(t,"string");return su(e)=="symbol"?e:e+""}function T2e(t,e){if(su(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(su(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Ha=function(t){function e(){var r;b2e(this,e);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=j2e(this,e,[].concat(s)),fi(r,"state",{isAnimationFinished:!1}),fi(r,"id",Nl("recharts-bar-")),fi(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),o&&o()}),fi(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),o&&o()}),r}return S2e(e,t),w2e(e,[{key:"renderRectanglesStatically",value:function(n){var s=this,i=this.props,o=i.shape,l=i.dataKey,c=i.activeIndex,u=i.activeBar,d=je(this.props,!1);return n&&n.map(function(h,m){var p=m===c,x=p?u:o,w=Xt(Xt(Xt({},d),h),{},{isActive:p,option:x,index:m,dataKey:l,onAnimationStart:s.handleAnimationStart,onAnimationEnd:s.handleAnimationEnd});return F.createElement(Ve,kx({className:"recharts-bar-rectangle"},sl(s.props,h,m),{key:"rectangle-".concat(h==null?void 0:h.x,"-").concat(h==null?void 0:h.y,"-").concat(h==null?void 0:h.value,"-").concat(m)}),F.createElement(G4,w))})}},{key:"renderRectanglesWithAnimation",value:function(){var n=this,s=this.props,i=s.data,o=s.layout,l=s.isAnimationActive,c=s.animationBegin,u=s.animationDuration,d=s.animationEasing,h=s.animationId,m=this.state.prevData;return F.createElement(ba,{begin:c,duration:u,isActive:l,easing:d,from:{t:0},to:{t:1},key:"bar-".concat(h),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(p){var x=p.t,w=i.map(function(g,v){var b=m&&m[v];if(b){var y=ir(b.x,g.x),T=ir(b.y,g.y),N=ir(b.width,g.width),j=ir(b.height,g.height);return Xt(Xt({},g),{},{x:y(x),y:T(x),width:N(x),height:j(x)})}if(o==="horizontal"){var _=ir(0,g.height),S=_(x);return Xt(Xt({},g),{},{y:g.y+g.height-S,height:S})}var k=ir(0,g.width),I=k(x);return Xt(Xt({},g),{},{width:I})});return F.createElement(Ve,null,n.renderRectanglesStatically(w))})}},{key:"renderRectangles",value:function(){var n=this.props,s=n.data,i=n.isAnimationActive,o=this.state.prevData;return i&&s&&s.length&&(!o||!ol(o,s))?this.renderRectanglesWithAnimation():this.renderRectanglesStatically(s)}},{key:"renderBackground",value:function(){var n=this,s=this.props,i=s.data,o=s.dataKey,l=s.activeIndex,c=je(this.props.background,!1);return i.map(function(u,d){u.value;var h=u.background,m=y2e(u,x2e);if(!h)return null;var p=Xt(Xt(Xt(Xt(Xt({},m),{},{fill:"#eee"},h),c),sl(n.props,u,d)),{},{onAnimationStart:n.handleAnimationStart,onAnimationEnd:n.handleAnimationEnd,dataKey:o,index:d,className:"recharts-bar-background-rectangle"});return F.createElement(G4,kx({key:"background-bar-".concat(d),option:n.props.background,isActive:d===l},p))})}},{key:"renderErrorBar",value:function(n,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.data,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,h=In(d,rf);if(!h)return null;var m=u==="vertical"?o[0].height/2:o[0].width/2,p=function(g,v){var b=Array.isArray(g.value)?g.value[1]:g.value;return{x:g.x,y:g.y,value:b,errorVal:Gt(g,v)}},x={clipPath:n?"url(#clipPath-".concat(s,")"):null};return F.createElement(Ve,x,h.map(function(w){return F.cloneElement(w,{key:"error-bar-".concat(s,"-").concat(w.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,offset:m,dataPointFormatter:p})}))}},{key:"render",value:function(){var n=this.props,s=n.hide,i=n.data,o=n.className,l=n.xAxis,c=n.yAxis,u=n.left,d=n.top,h=n.width,m=n.height,p=n.isAnimationActive,x=n.background,w=n.id;if(s||!i||!i.length)return null;var g=this.state.isAnimationFinished,v=Me("recharts-bar",o),b=l&&l.allowDataOverflow,y=c&&c.allowDataOverflow,T=b||y,N=Ie(w)?this.id:w;return F.createElement(Ve,{className:v},b||y?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(N)},F.createElement("rect",{x:b?u:u-h/2,y:y?d:d-m/2,width:b?h:h*2,height:y?m:m*2}))):null,F.createElement(Ve,{className:"recharts-bar-rectangles",clipPath:T?"url(#clipPath-".concat(N,")"):null},x?this.renderBackground():null,this.renderRectangles()),this.renderErrorBar(T,N),(!p||g)&&Ua.renderCallByParent(this.props,i))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curData:n.data,prevData:s.curData}:n.data!==s.curData?{curData:n.data}:null}}])}(P.PureComponent);a9=Ha;fi(Ha,"displayName","Bar");fi(Ha,"defaultProps",{xAxisId:0,yAxisId:0,legendType:"rect",minPointSize:0,hide:!1,data:[],layout:"vertical",activeBar:!1,isAnimationActive:!Gi.isSsr,animationBegin:0,animationDuration:400,animationEasing:"ease"});fi(Ha,"getComposedData",function(t){var e=t.props,r=t.item,n=t.barPosition,s=t.bandSize,i=t.xAxis,o=t.yAxis,l=t.xAxisTicks,c=t.yAxisTicks,u=t.stackedData,d=t.dataStartIndex,h=t.displayedData,m=t.offset,p=d0e(n,r);if(!p)return null;var x=e.layout,w=r.type.defaultProps,g=w!==void 0?Xt(Xt({},w),r.props):r.props,v=g.dataKey,b=g.children,y=g.minPointSize,T=x==="horizontal"?o:i,N=u?T.scale.domain():null,j=y0e({numericAxis:T}),_=In(b,Kc),S=h.map(function(k,I){var E,C,R,W,M,L;u?E=h0e(u[d+I],N):(E=Gt(k,v),Array.isArray(E)||(E=[j,E]));var U=g2e(y,a9.defaultProps.minPointSize)(E[1],I);if(x==="horizontal"){var V,D=[o.scale(E[0]),o.scale(E[1])],z=D[0],K=D[1];C=LC({axis:i,ticks:l,bandSize:s,offset:p.offset,entry:k,index:I}),R=(V=K??z)!==null&&V!==void 0?V:void 0,W=p.size;var q=z-K;if(M=Number.isNaN(q)?0:q,L={x:C,y:o.y,width:W,height:o.height},Math.abs(U)>0&&Math.abs(M)<Math.abs(U)){var H=Jr(M||U)*(Math.abs(U)-Math.abs(M));R-=H,M+=H}}else{var ee=[i.scale(E[0]),i.scale(E[1])],de=ee[0],we=ee[1];if(C=de,R=LC({axis:o,ticks:c,bandSize:s,offset:p.offset,entry:k,index:I}),W=we-de,M=p.size,L={x:i.x,y:R,width:i.width,height:M},Math.abs(U)>0&&Math.abs(W)<Math.abs(U)){var Le=Jr(W||U)*(Math.abs(U)-Math.abs(W));W+=Le}}return Xt(Xt(Xt({},k),{},{x:C,y:R,width:W,height:M,value:u?E:E[1],payload:k,background:L},_&&_[I]&&_[I].props),{},{tooltipPayload:[CL(r,k)],tooltipPosition:{x:C+W/2,y:R+M/2}})});return Xt({data:S,layout:x},m)});function bm(t){"@babel/helpers - typeof";return bm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},bm(t)}function A2e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Y4(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,o9(n.key),n)}}function E2e(t,e,r){return e&&Y4(t.prototype,e),r&&Y4(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Q4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function oa(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Q4(Object(r),!0).forEach(function(n){jv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Q4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function jv(t,e,r){return e=o9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function o9(t){var e=k2e(t,"string");return bm(e)=="symbol"?e:e+""}function k2e(t,e){if(bm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(bm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var H_=function(e,r,n,s,i){var o=e.width,l=e.height,c=e.layout,u=e.children,d=Object.keys(r),h={left:n.left,leftMirror:n.left,right:o-n.right,rightMirror:o-n.right,top:n.top,topMirror:n.top,bottom:l-n.bottom,bottomMirror:l-n.bottom},m=!!_n(u,Ha);return d.reduce(function(p,x){var w=r[x],g=w.orientation,v=w.domain,b=w.padding,y=b===void 0?{}:b,T=w.mirror,N=w.reversed,j="".concat(g).concat(T?"Mirror":""),_,S,k,I,E;if(w.type==="number"&&(w.padding==="gap"||w.padding==="no-gap")){var C=v[1]-v[0],R=1/0,W=w.categoricalDomain.sort(Yae);if(W.forEach(function(ee,de){de>0&&(R=Math.min((ee||0)-(W[de-1]||0),R))}),Number.isFinite(R)){var M=R/C,L=w.layout==="vertical"?n.height:n.width;if(w.padding==="gap"&&(_=M*L/2),w.padding==="no-gap"){var U=Zr(e.barCategoryGap,M*L),V=M*L/2;_=V-U-(V-U)/L*U}}}s==="xAxis"?S=[n.left+(y.left||0)+(_||0),n.left+n.width-(y.right||0)-(_||0)]:s==="yAxis"?S=c==="horizontal"?[n.top+n.height-(y.bottom||0),n.top+(y.top||0)]:[n.top+(y.top||0)+(_||0),n.top+n.height-(y.bottom||0)-(_||0)]:S=w.range,N&&(S=[S[1],S[0]]);var D=AL(w,i,m),z=D.scale,K=D.realScaleType;z.domain(v).range(S),EL(z);var q=kL(z,oa(oa({},w),{},{realScaleType:K}));s==="xAxis"?(E=g==="top"&&!T||g==="bottom"&&T,k=n.left,I=h[j]-E*w.height):s==="yAxis"&&(E=g==="left"&&!T||g==="right"&&T,k=h[j]-E*w.width,I=n.top);var H=oa(oa(oa({},w),q),{},{realScaleType:K,x:k,y:I,scale:z,width:s==="xAxis"?n.width:w.width,height:s==="yAxis"?n.height:w.height});return H.bandSize=fx(H,q),!w.hide&&s==="xAxis"?h[j]+=(E?-1:1)*H.height:w.hide||(h[j]+=(E?-1:1)*H.width),oa(oa({},p),{},jv({},x,H))},{})},l9=function(e,r){var n=e.x,s=e.y,i=r.x,o=r.y;return{x:Math.min(n,i),y:Math.min(s,o),width:Math.abs(i-n),height:Math.abs(o-s)}},P2e=function(e){var r=e.x1,n=e.y1,s=e.x2,i=e.y2;return l9({x:r,y:n},{x:s,y:i})},c9=function(){function t(e){A2e(this,t),this.scale=e}return E2e(t,[{key:"domain",get:function(){return this.scale.domain}},{key:"range",get:function(){return this.scale.range}},{key:"rangeMin",get:function(){return this.range()[0]}},{key:"rangeMax",get:function(){return this.range()[1]}},{key:"bandwidth",get:function(){return this.scale.bandwidth}},{key:"apply",value:function(r){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=n.bandAware,i=n.position;if(r!==void 0){if(i)switch(i){case"start":return this.scale(r);case"middle":{var o=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+o}case"end":{var l=this.bandwidth?this.bandwidth():0;return this.scale(r)+l}default:return this.scale(r)}if(s){var c=this.bandwidth?this.bandwidth()/2:0;return this.scale(r)+c}return this.scale(r)}}},{key:"isInRange",value:function(r){var n=this.range(),s=n[0],i=n[n.length-1];return s<=i?r>=s&&r<=i:r>=i&&r<=s}}],[{key:"create",value:function(r){return new t(r)}}])}();jv(c9,"EPS",1e-4);var q_=function(e){var r=Object.keys(e).reduce(function(n,s){return oa(oa({},n),{},jv({},s,c9.create(e[s])))},{});return oa(oa({},r),{},{apply:function(s){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},o=i.bandAware,l=i.position;return YNe(s,function(c,u){return r[u].apply(c,{bandAware:o,position:l})})},isInRange:function(s){return n9(s,function(i,o){return r[o].isInRange(i)})}})};function C2e(t){return(t%180+180)%180}var I2e=function(e){var r=e.width,n=e.height,s=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,i=C2e(s),o=i*Math.PI/180,l=Math.atan(n/r),c=o>l&&o<Math.PI-l?n/Math.sin(o):r/Math.cos(o);return Math.abs(c)},O2e=Za,R2e=Qm,D2e=nv;function M2e(t){return function(e,r,n){var s=Object(e);if(!R2e(e)){var i=O2e(r);e=D2e(e),r=function(l){return i(s[l],l,s)}}var o=t(e,r,n);return o>-1?s[i?e[o]:o]:void 0}}var $2e=M2e,L2e=ZL;function F2e(t){var e=L2e(t),r=e%1;return e===e?r?e-r:e:0}var B2e=F2e,V2e=o$,U2e=Za,z2e=B2e,H2e=Math.max;function q2e(t,e,r){var n=t==null?0:t.length;if(!n)return-1;var s=r==null?0:z2e(r);return s<0&&(s=H2e(n+s,0)),V2e(t,U2e(e),s)}var W2e=q2e,G2e=$2e,K2e=W2e,X2e=G2e(K2e),Y2e=X2e;const Q2e=nt(Y2e);var J2e=Zne(function(t){return{x:t.left,y:t.top,width:t.width,height:t.height}},function(t){return["l",t.left,"t",t.top,"w",t.width,"h",t.height].join("")}),W_=P.createContext(void 0),G_=P.createContext(void 0),u9=P.createContext(void 0),d9=P.createContext({}),h9=P.createContext(void 0),m9=P.createContext(0),f9=P.createContext(0),J4=function(e){var r=e.state,n=r.xAxisMap,s=r.yAxisMap,i=r.offset,o=e.clipPathId,l=e.children,c=e.width,u=e.height,d=J2e(i);return F.createElement(W_.Provider,{value:n},F.createElement(G_.Provider,{value:s},F.createElement(d9.Provider,{value:i},F.createElement(u9.Provider,{value:d},F.createElement(h9.Provider,{value:o},F.createElement(m9.Provider,{value:u},F.createElement(f9.Provider,{value:c},l)))))))},Z2e=function(){return P.useContext(h9)},p9=function(e){var r=P.useContext(W_);r==null&&cl();var n=r[e];return n==null&&cl(),n},e_e=function(){var e=P.useContext(W_);return oi(e)},t_e=function(){var e=P.useContext(G_),r=Q2e(e,function(n){return n9(n.domain,Number.isFinite)});return r||oi(e)},g9=function(e){var r=P.useContext(G_);r==null&&cl();var n=r[e];return n==null&&cl(),n},r_e=function(){var e=P.useContext(u9);return e},n_e=function(){return P.useContext(d9)},K_=function(){return P.useContext(f9)},X_=function(){return P.useContext(m9)};function iu(t){"@babel/helpers - typeof";return iu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},iu(t)}function a_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function s_e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,y9(n.key),n)}}function i_e(t,e,r){return e&&s_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function o_e(t,e,r){return e=Cx(e),l_e(t,x9()?Reflect.construct(e,r||[],Cx(t).constructor):e.apply(t,r))}function l_e(t,e){if(e&&(iu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return c_e(t)}function c_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function x9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(x9=function(){return!!t})()}function Cx(t){return Cx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Cx(t)}function u_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&u1(t,e)}function u1(t,e){return u1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},u1(t,e)}function Z4(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function eI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Z4(Object(r),!0).forEach(function(n){Y_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Z4(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Y_(t,e,r){return e=y9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function y9(t){var e=d_e(t,"string");return iu(e)=="symbol"?e:e+""}function d_e(t,e){if(iu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(iu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function h_e(t,e){return g_e(t)||p_e(t,e)||f_e(t,e)||m_e()}function m_e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4556In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function f_e(t,e){if(t){if(typeof t=="string")return tI(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return tI(t,e)}}function tI(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function p_e(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function g_e(t){if(Array.isArray(t))return t}function d1(){return d1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},d1.apply(this,arguments)}var x_e=function(e,r){var n;return F.isValidElement(e)?n=F.cloneElement(e,r):Ee(e)?n=e(r):n=F.createElement("line",d1({},r,{className:"recharts-reference-line-line"})),n},y_e=function(e,r,n,s,i,o,l,c,u){var d=i.x,h=i.y,m=i.width,p=i.height;if(n){var x=u.y,w=e.y.apply(x,{position:o});if(za(u,"discard")&&!e.y.isInRange(w))return null;var g=[{x:d+m,y:w},{x:d,y:w}];return c==="left"?g.reverse():g}if(r){var v=u.x,b=e.x.apply(v,{position:o});if(za(u,"discard")&&!e.x.isInRange(b))return null;var y=[{x:b,y:h+p},{x:b,y:h}];return l==="top"?y.reverse():y}if(s){var T=u.segment,N=T.map(function(j){return e.apply(j,{position:o})});return za(u,"discard")&&UNe(N,function(j){return!e.isInRange(j)})?null:N}return null};function v_e(t){var e=t.x,r=t.y,n=t.segment,s=t.xAxisId,i=t.yAxisId,o=t.shape,l=t.className,c=t.alwaysShow,u=Z2e(),d=p9(s),h=g9(i),m=r_e();if(!u||!m)return null;fa(c===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var p=q_({x:d.scale,y:h.scale}),x=lr(e),w=lr(r),g=n&&n.length===2,v=y_e(p,x,w,g,m,t.position,d.orientation,h.orientation,t);if(!v)return null;var b=h_e(v,2),y=b[0],T=y.x,N=y.y,j=b[1],_=j.x,S=j.y,k=za(t,"hidden")?"url(#".concat(u,")"):void 0,I=eI(eI({clipPath:k},je(t,!0)),{},{x1:T,y1:N,x2:_,y2:S});return F.createElement(Ve,{className:Me("recharts-reference-line",l)},x_e(o,I),gr.renderCallByParent(t,P2e({x1:T,y1:N,x2:_,y2:S})))}var Q_=function(t){function e(){return a_e(this,e),o_e(this,e,arguments)}return u_e(e,t),i_e(e,[{key:"render",value:function(){return F.createElement(v_e,this.props)}}])}(F.Component);Y_(Q_,"displayName","ReferenceLine");Y_(Q_,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});function h1(){return h1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},h1.apply(this,arguments)}function ou(t){"@babel/helpers - typeof";return ou=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ou(t)}function rI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function nI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?rI(Object(r),!0).forEach(function(n){Nv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):rI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function b_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w_e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,b9(n.key),n)}}function j_e(t,e,r){return e&&w_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function N_e(t,e,r){return e=Ix(e),__e(t,v9()?Reflect.construct(e,r||[],Ix(t).constructor):e.apply(t,r))}function __e(t,e){if(e&&(ou(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return S_e(t)}function S_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function v9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(v9=function(){return!!t})()}function Ix(t){return Ix=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ix(t)}function T_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&m1(t,e)}function m1(t,e){return m1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},m1(t,e)}function Nv(t,e,r){return e=b9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function b9(t){var e=A_e(t,"string");return ou(e)=="symbol"?e:e+""}function A_e(t,e){if(ou(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ou(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var E_e=function(e){var r=e.x,n=e.y,s=e.xAxis,i=e.yAxis,o=q_({x:s.scale,y:i.scale}),l=o.apply({x:r,y:n},{bandAware:!0});return za(e,"discard")&&!o.isInRange(l)?null:l},_v=function(t){function e(){return b_e(this,e),N_e(this,e,arguments)}return T_e(e,t),j_e(e,[{key:"render",value:function(){var n=this.props,s=n.x,i=n.y,o=n.r,l=n.alwaysShow,c=n.clipPathId,u=lr(s),d=lr(i);if(fa(l===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.'),!u||!d)return null;var h=E_e(this.props);if(!h)return null;var m=h.x,p=h.y,x=this.props,w=x.shape,g=x.className,v=za(this.props,"hidden")?"url(#".concat(c,")"):void 0,b=nI(nI({clipPath:v},je(this.props,!0)),{},{cx:m,cy:p});return F.createElement(Ve,{className:Me("recharts-reference-dot",g)},e.renderDot(w,b),gr.renderCallByParent(this.props,{x:m-o,y:p-o,width:2*o,height:2*o}))}}])}(F.Component);Nv(_v,"displayName","ReferenceDot");Nv(_v,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#fff",stroke:"#ccc",fillOpacity:1,strokeWidth:1});Nv(_v,"renderDot",function(t,e){var r;return F.isValidElement(t)?r=F.cloneElement(t,e):Ee(t)?r=t(e):r=F.createElement(nf,h1({},e,{cx:e.cx,cy:e.cy,className:"recharts-reference-dot-dot"})),r});function f1(){return f1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},f1.apply(this,arguments)}function lu(t){"@babel/helpers - typeof";return lu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},lu(t)}function aI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function sI(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?aI(Object(r),!0).forEach(function(n){Sv(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):aI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function k_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P_e(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,j9(n.key),n)}}function C_e(t,e,r){return e&&P_e(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function I_e(t,e,r){return e=Ox(e),O_e(t,w9()?Reflect.construct(e,r||[],Ox(t).constructor):e.apply(t,r))}function O_e(t,e){if(e&&(lu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return R_e(t)}function R_e(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function w9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(w9=function(){return!!t})()}function Ox(t){return Ox=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Ox(t)}function D_e(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&p1(t,e)}function p1(t,e){return p1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},p1(t,e)}function Sv(t,e,r){return e=j9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function j9(t){var e=M_e(t,"string");return lu(e)=="symbol"?e:e+""}function M_e(t,e){if(lu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(lu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var $_e=function(e,r,n,s,i){var o=i.x1,l=i.x2,c=i.y1,u=i.y2,d=i.xAxis,h=i.yAxis;if(!d||!h)return null;var m=q_({x:d.scale,y:h.scale}),p={x:e?m.x.apply(o,{position:"start"}):m.x.rangeMin,y:n?m.y.apply(c,{position:"start"}):m.y.rangeMin},x={x:r?m.x.apply(l,{position:"end"}):m.x.rangeMax,y:s?m.y.apply(u,{position:"end"}):m.y.rangeMax};return za(i,"discard")&&(!m.isInRange(p)||!m.isInRange(x))?null:l9(p,x)},Tv=function(t){function e(){return k_e(this,e),I_e(this,e,arguments)}return D_e(e,t),C_e(e,[{key:"render",value:function(){var n=this.props,s=n.x1,i=n.x2,o=n.y1,l=n.y2,c=n.className,u=n.alwaysShow,d=n.clipPathId;fa(u===void 0,'The alwaysShow prop is deprecated. Please use ifOverflow="extendDomain" instead.');var h=lr(s),m=lr(i),p=lr(o),x=lr(l),w=this.props.shape;if(!h&&!m&&!p&&!x&&!w)return null;var g=$_e(h,m,p,x,this.props);if(!g&&!w)return null;var v=za(this.props,"hidden")?"url(#".concat(d,")"):void 0;return F.createElement(Ve,{className:Me("recharts-reference-area",c)},e.renderRect(w,sI(sI({clipPath:v},je(this.props,!0)),g)),gr.renderCallByParent(this.props,g))}}])}(F.Component);Sv(Tv,"displayName","ReferenceArea");Sv(Tv,"defaultProps",{isFront:!1,ifOverflow:"discard",xAxisId:0,yAxisId:0,r:10,fill:"#ccc",fillOpacity:.5,stroke:"none",strokeWidth:1});Sv(Tv,"renderRect",function(t,e){var r;return F.isValidElement(t)?r=F.cloneElement(t,e):Ee(t)?r=t(e):r=F.createElement(z_,f1({},e,{className:"recharts-reference-area-rect"})),r});function N9(t,e,r){if(e<1)return[];if(e===1&&r===void 0)return t;for(var n=[],s=0;s<t.length;s+=e)n.push(t[s]);return n}function L_e(t,e,r){var n={width:t.width+e.width,height:t.height+e.height};return I2e(n,r)}function F_e(t,e,r){var n=r==="width",s=t.x,i=t.y,o=t.width,l=t.height;return e===1?{start:n?s:i,end:n?s+o:i+l}:{start:n?s+o:i+l,end:n?s:i}}function Rx(t,e,r,n,s){if(t*e<t*n||t*e>t*s)return!1;var i=r();return t*(e-t*i/2-n)>=0&&t*(e+t*i/2-s)<=0}function B_e(t,e){return N9(t,e+1)}function V_e(t,e,r,n,s){for(var i=(n||[]).slice(),o=e.start,l=e.end,c=0,u=1,d=o,h=function(){var x=n==null?void 0:n[c];if(x===void 0)return{v:N9(n,u)};var w=c,g,v=function(){return g===void 0&&(g=r(x,w)),g},b=x.coordinate,y=c===0||Rx(t,b,v,d,l);y||(c=0,d=o,u+=1),y&&(d=b+t*(v()/2+s),c+=u)},m;u<=i.length;)if(m=h(),m)return m.v;return[]}function wm(t){"@babel/helpers - typeof";return wm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},wm(t)}function iI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Br(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?iI(Object(r),!0).forEach(function(n){U_e(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):iI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function U_e(t,e,r){return e=z_e(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function z_e(t){var e=H_e(t,"string");return wm(e)=="symbol"?e:e+""}function H_e(t,e){if(wm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(wm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function q_e(t,e,r,n,s){for(var i=(n||[]).slice(),o=i.length,l=e.start,c=e.end,u=function(m){var p=i[m],x,w=function(){return x===void 0&&(x=r(p,m)),x};if(m===o-1){var g=t*(p.coordinate+t*w()/2-c);i[m]=p=Br(Br({},p),{},{tickCoord:g>0?p.coordinate-g*t:p.coordinate})}else i[m]=p=Br(Br({},p),{},{tickCoord:p.coordinate});var v=Rx(t,p.tickCoord,w,l,c);v&&(c=p.tickCoord-t*(w()/2+s),i[m]=Br(Br({},p),{},{isShow:!0}))},d=o-1;d>=0;d--)u(d);return i}function W_e(t,e,r,n,s,i){var o=(n||[]).slice(),l=o.length,c=e.start,u=e.end;if(i){var d=n[l-1],h=r(d,l-1),m=t*(d.coordinate+t*h/2-u);o[l-1]=d=Br(Br({},d),{},{tickCoord:m>0?d.coordinate-m*t:d.coordinate});var p=Rx(t,d.tickCoord,function(){return h},c,u);p&&(u=d.tickCoord-t*(h/2+s),o[l-1]=Br(Br({},d),{},{isShow:!0}))}for(var x=i?l-1:l,w=function(b){var y=o[b],T,N=function(){return T===void 0&&(T=r(y,b)),T};if(b===0){var j=t*(y.coordinate-t*N()/2-c);o[b]=y=Br(Br({},y),{},{tickCoord:j<0?y.coordinate-j*t:y.coordinate})}else o[b]=y=Br(Br({},y),{},{tickCoord:y.coordinate});var _=Rx(t,y.tickCoord,N,c,u);_&&(c=y.tickCoord+t*(N()/2+s),o[b]=Br(Br({},y),{},{isShow:!0}))},g=0;g<x;g++)w(g);return o}function J_(t,e,r){var n=t.tick,s=t.ticks,i=t.viewBox,o=t.minTickGap,l=t.orientation,c=t.interval,u=t.tickFormatter,d=t.unit,h=t.angle;if(!s||!s.length||!n)return[];if(ie(c)||Gi.isSsr)return B_e(s,typeof c=="number"&&ie(c)?c:0);var m=[],p=l==="top"||l==="bottom"?"width":"height",x=d&&p==="width"?ah(d,{fontSize:e,letterSpacing:r}):{width:0,height:0},w=function(y,T){var N=Ee(u)?u(y.value,T):y.value;return p==="width"?L_e(ah(N,{fontSize:e,letterSpacing:r}),x,h):ah(N,{fontSize:e,letterSpacing:r})[p]},g=s.length>=2?Jr(s[1].coordinate-s[0].coordinate):1,v=F_e(i,g,p);return c==="equidistantPreserveStart"?V_e(g,v,w,s,o):(c==="preserveStart"||c==="preserveStartEnd"?m=W_e(g,v,w,s,o,c==="preserveStartEnd"):m=q_e(g,v,w,s,o),m.filter(function(b){return b.isShow}))}var G_e=["viewBox"],K_e=["viewBox"],X_e=["ticks"];function cu(t){"@babel/helpers - typeof";return cu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},cu(t)}function ac(){return ac=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},ac.apply(this,arguments)}function oI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function nr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?oI(Object(r),!0).forEach(function(n){Z_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):oI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function pb(t,e){if(t==null)return{};var r=Y_e(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function Y_e(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function Q_e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lI(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,S9(n.key),n)}}function J_e(t,e,r){return e&&lI(t.prototype,e),r&&lI(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function Z_e(t,e,r){return e=Dx(e),eSe(t,_9()?Reflect.construct(e,r||[],Dx(t).constructor):e.apply(t,r))}function eSe(t,e){if(e&&(cu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tSe(t)}function tSe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function _9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(_9=function(){return!!t})()}function Dx(t){return Dx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Dx(t)}function rSe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&g1(t,e)}function g1(t,e){return g1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},g1(t,e)}function Z_(t,e,r){return e=S9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function S9(t){var e=nSe(t,"string");return cu(e)=="symbol"?e:e+""}function nSe(t,e){if(cu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(cu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var zu=function(t){function e(r){var n;return Q_e(this,e),n=Z_e(this,e,[r]),n.state={fontSize:"",letterSpacing:""},n}return rSe(e,t),J_e(e,[{key:"shouldComponentUpdate",value:function(n,s){var i=n.viewBox,o=pb(n,G_e),l=this.props,c=l.viewBox,u=pb(l,K_e);return!bc(i,c)||!bc(o,u)||!bc(s,this.state)}},{key:"componentDidMount",value:function(){var n=this.layerReference;if(n){var s=n.getElementsByClassName("recharts-cartesian-axis-tick-value")[0];s&&this.setState({fontSize:window.getComputedStyle(s).fontSize,letterSpacing:window.getComputedStyle(s).letterSpacing})}}},{key:"getTickLineCoord",value:function(n){var s=this.props,i=s.x,o=s.y,l=s.width,c=s.height,u=s.orientation,d=s.tickSize,h=s.mirror,m=s.tickMargin,p,x,w,g,v,b,y=h?-1:1,T=n.tickSize||d,N=ie(n.tickCoord)?n.tickCoord:n.coordinate;switch(u){case"top":p=x=n.coordinate,g=o+ +!h*c,w=g-y*T,b=w-y*m,v=N;break;case"left":w=g=n.coordinate,x=i+ +!h*l,p=x-y*T,v=p-y*m,b=N;break;case"right":w=g=n.coordinate,x=i+ +h*l,p=x+y*T,v=p+y*m,b=N;break;default:p=x=n.coordinate,g=o+ +h*c,w=g+y*T,b=w+y*m,v=N;break}return{line:{x1:p,y1:w,x2:x,y2:g},tick:{x:v,y:b}}}},{key:"getTickTextAnchor",value:function(){var n=this.props,s=n.orientation,i=n.mirror,o;switch(s){case"left":o=i?"start":"end";break;case"right":o=i?"end":"start";break;default:o="middle";break}return o}},{key:"getTickVerticalAnchor",value:function(){var n=this.props,s=n.orientation,i=n.mirror,o="end";switch(s){case"left":case"right":o="middle";break;case"top":o=i?"start":"end";break;default:o=i?"end":"start";break}return o}},{key:"renderAxisLine",value:function(){var n=this.props,s=n.x,i=n.y,o=n.width,l=n.height,c=n.orientation,u=n.mirror,d=n.axisLine,h=nr(nr(nr({},je(this.props,!1)),je(d,!1)),{},{fill:"none"});if(c==="top"||c==="bottom"){var m=+(c==="top"&&!u||c==="bottom"&&u);h=nr(nr({},h),{},{x1:s,y1:i+m*l,x2:s+o,y2:i+m*l})}else{var p=+(c==="left"&&!u||c==="right"&&u);h=nr(nr({},h),{},{x1:s+p*o,y1:i,x2:s+p*o,y2:i+l})}return F.createElement("line",ac({},h,{className:Me("recharts-cartesian-axis-line",Cn(d,"className"))}))}},{key:"renderTicks",value:function(n,s,i){var o=this,l=this.props,c=l.tickLine,u=l.stroke,d=l.tick,h=l.tickFormatter,m=l.unit,p=J_(nr(nr({},this.props),{},{ticks:n}),s,i),x=this.getTickTextAnchor(),w=this.getTickVerticalAnchor(),g=je(this.props,!1),v=je(d,!1),b=nr(nr({},g),{},{fill:"none"},je(c,!1)),y=p.map(function(T,N){var j=o.getTickLineCoord(T),_=j.line,S=j.tick,k=nr(nr(nr(nr({textAnchor:x,verticalAnchor:w},g),{},{stroke:"none",fill:u},v),S),{},{index:N,payload:T,visibleTicksCount:p.length,tickFormatter:h});return F.createElement(Ve,ac({className:"recharts-cartesian-axis-tick",key:"tick-".concat(T.value,"-").concat(T.coordinate,"-").concat(T.tickCoord)},sl(o.props,T,N)),c&&F.createElement("line",ac({},b,_,{className:Me("recharts-cartesian-axis-tick-line",Cn(c,"className"))})),d&&e.renderTickItem(d,k,"".concat(Ee(h)?h(T.value,N):T.value).concat(m||"")))});return F.createElement("g",{className:"recharts-cartesian-axis-ticks"},y)}},{key:"render",value:function(){var n=this,s=this.props,i=s.axisLine,o=s.width,l=s.height,c=s.ticksGenerator,u=s.className,d=s.hide;if(d)return null;var h=this.props,m=h.ticks,p=pb(h,X_e),x=m;return Ee(c)&&(x=m&&m.length>0?c(this.props):c(p)),o<=0||l<=0||!x||!x.length?null:F.createElement(Ve,{className:Me("recharts-cartesian-axis",u),ref:function(g){n.layerReference=g}},i&&this.renderAxisLine(),this.renderTicks(x,this.state.fontSize,this.state.letterSpacing),gr.renderCallByParent(this.props))}}],[{key:"renderTickItem",value:function(n,s,i){var o,l=Me(s.className,"recharts-cartesian-axis-tick-value");return F.isValidElement(n)?o=F.cloneElement(n,nr(nr({},s),{},{className:l})):Ee(n)?o=n(nr(nr({},s),{},{className:l})):o=F.createElement(il,ac({},s,{className:"recharts-cartesian-axis-tick-value"}),i),o}}])}(P.Component);Z_(zu,"displayName","CartesianAxis");Z_(zu,"defaultProps",{x:0,y:0,width:0,height:0,viewBox:{x:0,y:0,width:0,height:0},orientation:"bottom",ticks:[],stroke:"#666",tickLine:!0,axisLine:!0,tick:!0,mirror:!1,minTickGap:5,tickSize:6,tickMargin:2,interval:"preserveEnd"});var aSe=["x1","y1","x2","y2","key"],sSe=["offset"];function ul(t){"@babel/helpers - typeof";return ul=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},ul(t)}function cI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Hr(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cI(Object(r),!0).forEach(function(n){iSe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function iSe(t,e,r){return e=oSe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function oSe(t){var e=lSe(t,"string");return ul(e)=="symbol"?e:e+""}function lSe(t,e){if(ul(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(ul(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function So(){return So=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},So.apply(this,arguments)}function uI(t,e){if(t==null)return{};var r=cSe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function cSe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}var uSe=function(e){var r=e.fill;if(!r||r==="none")return null;var n=e.fillOpacity,s=e.x,i=e.y,o=e.width,l=e.height,c=e.ry;return F.createElement("rect",{x:s,y:i,ry:c,width:o,height:l,stroke:"none",fill:r,fillOpacity:n,className:"recharts-cartesian-grid-bg"})};function T9(t,e){var r;if(F.isValidElement(t))r=F.cloneElement(t,e);else if(Ee(t))r=t(e);else{var n=e.x1,s=e.y1,i=e.x2,o=e.y2,l=e.key,c=uI(e,aSe),u=je(c,!1);u.offset;var d=uI(u,sSe);r=F.createElement("line",So({},d,{x1:n,y1:s,x2:i,y2:o,fill:"none",key:l}))}return r}function dSe(t){var e=t.x,r=t.width,n=t.horizontal,s=n===void 0?!0:n,i=t.horizontalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var u=Hr(Hr({},t),{},{x1:e,y1:l,x2:e+r,y2:l,key:"line-".concat(c),index:c});return T9(s,u)});return F.createElement("g",{className:"recharts-cartesian-grid-horizontal"},o)}function hSe(t){var e=t.y,r=t.height,n=t.vertical,s=n===void 0?!0:n,i=t.verticalPoints;if(!s||!i||!i.length)return null;var o=i.map(function(l,c){var u=Hr(Hr({},t),{},{x1:l,y1:e,x2:l,y2:e+r,key:"line-".concat(c),index:c});return T9(s,u)});return F.createElement("g",{className:"recharts-cartesian-grid-vertical"},o)}function mSe(t){var e=t.horizontalFill,r=t.fillOpacity,n=t.x,s=t.y,i=t.width,o=t.height,l=t.horizontalPoints,c=t.horizontal,u=c===void 0?!0:c;if(!u||!e||!e.length)return null;var d=l.map(function(m){return Math.round(m+s-s)}).sort(function(m,p){return m-p});s!==d[0]&&d.unshift(0);var h=d.map(function(m,p){var x=!d[p+1],w=x?s+o-m:d[p+1]-m;if(w<=0)return null;var g=p%e.length;return F.createElement("rect",{key:"react-".concat(p),y:m,x:n,height:w,width:i,stroke:"none",fill:e[g],fillOpacity:r,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-horizontal"},h)}function fSe(t){var e=t.vertical,r=e===void 0?!0:e,n=t.verticalFill,s=t.fillOpacity,i=t.x,o=t.y,l=t.width,c=t.height,u=t.verticalPoints;if(!r||!n||!n.length)return null;var d=u.map(function(m){return Math.round(m+i-i)}).sort(function(m,p){return m-p});i!==d[0]&&d.unshift(0);var h=d.map(function(m,p){var x=!d[p+1],w=x?i+l-m:d[p+1]-m;if(w<=0)return null;var g=p%n.length;return F.createElement("rect",{key:"react-".concat(p),x:m,y:o,width:w,height:c,stroke:"none",fill:n[g],fillOpacity:s,className:"recharts-cartesian-grid-bg"})});return F.createElement("g",{className:"recharts-cartesian-gridstripes-vertical"},h)}var pSe=function(e,r){var n=e.xAxis,s=e.width,i=e.height,o=e.offset;return TL(J_(Hr(Hr(Hr({},zu.defaultProps),n),{},{ticks:fs(n,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.left,o.left+o.width,r)},gSe=function(e,r){var n=e.yAxis,s=e.width,i=e.height,o=e.offset;return TL(J_(Hr(Hr(Hr({},zu.defaultProps),n),{},{ticks:fs(n,!0),viewBox:{x:0,y:0,width:s,height:i}})),o.top,o.top+o.height,r)},$l={horizontal:!0,vertical:!0,stroke:"#ccc",fill:"none",verticalFill:[],horizontalFill:[]};function Nc(t){var e,r,n,s,i,o,l=K_(),c=X_(),u=n_e(),d=Hr(Hr({},t),{},{stroke:(e=t.stroke)!==null&&e!==void 0?e:$l.stroke,fill:(r=t.fill)!==null&&r!==void 0?r:$l.fill,horizontal:(n=t.horizontal)!==null&&n!==void 0?n:$l.horizontal,horizontalFill:(s=t.horizontalFill)!==null&&s!==void 0?s:$l.horizontalFill,vertical:(i=t.vertical)!==null&&i!==void 0?i:$l.vertical,verticalFill:(o=t.verticalFill)!==null&&o!==void 0?o:$l.verticalFill,x:ie(t.x)?t.x:u.left,y:ie(t.y)?t.y:u.top,width:ie(t.width)?t.width:u.width,height:ie(t.height)?t.height:u.height}),h=d.x,m=d.y,p=d.width,x=d.height,w=d.syncWithTicks,g=d.horizontalValues,v=d.verticalValues,b=e_e(),y=t_e();if(!ie(p)||p<=0||!ie(x)||x<=0||!ie(h)||h!==+h||!ie(m)||m!==+m)return null;var T=d.verticalCoordinatesGenerator||pSe,N=d.horizontalCoordinatesGenerator||gSe,j=d.horizontalPoints,_=d.verticalPoints;if((!j||!j.length)&&Ee(N)){var S=g&&g.length,k=N({yAxis:y?Hr(Hr({},y),{},{ticks:S?g:y.ticks}):void 0,width:l,height:c,offset:u},S?!0:w);fa(Array.isArray(k),"horizontalCoordinatesGenerator should return Array but instead it returned [".concat(ul(k),"]")),Array.isArray(k)&&(j=k)}if((!_||!_.length)&&Ee(T)){var I=v&&v.length,E=T({xAxis:b?Hr(Hr({},b),{},{ticks:I?v:b.ticks}):void 0,width:l,height:c,offset:u},I?!0:w);fa(Array.isArray(E),"verticalCoordinatesGenerator should return Array but instead it returned [".concat(ul(E),"]")),Array.isArray(E)&&(_=E)}return F.createElement("g",{className:"recharts-cartesian-grid"},F.createElement(uSe,{fill:d.fill,fillOpacity:d.fillOpacity,x:d.x,y:d.y,width:d.width,height:d.height,ry:d.ry}),F.createElement(dSe,So({},d,{offset:u,horizontalPoints:j,xAxis:b,yAxis:y})),F.createElement(hSe,So({},d,{offset:u,verticalPoints:_,xAxis:b,yAxis:y})),F.createElement(mSe,So({},d,{horizontalPoints:j})),F.createElement(fSe,So({},d,{verticalPoints:_})))}Nc.displayName="CartesianGrid";var xSe=["type","layout","connectNulls","ref"],ySe=["key"];function uu(t){"@babel/helpers - typeof";return uu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},uu(t)}function dI(t,e){if(t==null)return{};var r=vSe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function vSe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function uh(){return uh=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},uh.apply(this,arguments)}function hI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function wn(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?hI(Object(r),!0).forEach(function(n){la(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):hI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ll(t){return NSe(t)||jSe(t)||wSe(t)||bSe()}function bSe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4557In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wSe(t,e){if(t){if(typeof t=="string")return x1(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return x1(t,e)}}function jSe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function NSe(t){if(Array.isArray(t))return x1(t)}function x1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function _Se(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function mI(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,E9(n.key),n)}}function SSe(t,e,r){return e&&mI(t.prototype,e),r&&mI(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function TSe(t,e,r){return e=Mx(e),ASe(t,A9()?Reflect.construct(e,r||[],Mx(t).constructor):e.apply(t,r))}function ASe(t,e){if(e&&(uu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return ESe(t)}function ESe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function A9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(A9=function(){return!!t})()}function Mx(t){return Mx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Mx(t)}function kSe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&y1(t,e)}function y1(t,e){return y1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},y1(t,e)}function la(t,e,r){return e=E9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function E9(t){var e=PSe(t,"string");return uu(e)=="symbol"?e:e+""}function PSe(t,e){if(uu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(uu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Mo=function(t){function e(){var r;_Se(this,e);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=TSe(this,e,[].concat(s)),la(r,"state",{isAnimationFinished:!0,totalLength:0}),la(r,"generateSimpleStrokeDasharray",function(o,l){return"".concat(l,"px ").concat(o-l,"px")}),la(r,"getStrokeDasharray",function(o,l,c){var u=c.reduce(function(v,b){return v+b});if(!u)return r.generateSimpleStrokeDasharray(l,o);for(var d=Math.floor(o/u),h=o%u,m=l-o,p=[],x=0,w=0;x<c.length;w+=c[x],++x)if(w+c[x]>h){p=[].concat(Ll(c.slice(0,x)),[h-w]);break}var g=p.length%2===0?[0,m]:[m];return[].concat(Ll(e.repeat(c,d)),Ll(p),g).map(function(v){return"".concat(v,"px")}).join(", ")}),la(r,"id",Nl("recharts-line-")),la(r,"pathRef",function(o){r.mainCurve=o}),la(r,"handleAnimationEnd",function(){r.setState({isAnimationFinished:!0}),r.props.onAnimationEnd&&r.props.onAnimationEnd()}),la(r,"handleAnimationStart",function(){r.setState({isAnimationFinished:!1}),r.props.onAnimationStart&&r.props.onAnimationStart()}),r}return kSe(e,t),SSe(e,[{key:"componentDidMount",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();this.setState({totalLength:n})}}},{key:"componentDidUpdate",value:function(){if(this.props.isAnimationActive){var n=this.getTotalLength();n!==this.state.totalLength&&this.setState({totalLength:n})}}},{key:"getTotalLength",value:function(){var n=this.mainCurve;try{return n&&n.getTotalLength&&n.getTotalLength()||0}catch{return 0}}},{key:"renderErrorBar",value:function(n,s){if(this.props.isAnimationActive&&!this.state.isAnimationFinished)return null;var i=this.props,o=i.points,l=i.xAxis,c=i.yAxis,u=i.layout,d=i.children,h=In(d,rf);if(!h)return null;var m=function(w,g){return{x:w.x,y:w.y,value:w.value,errorVal:Gt(w.payload,g)}},p={clipPath:n?"url(#clipPath-".concat(s,")"):null};return F.createElement(Ve,p,h.map(function(x){return F.cloneElement(x,{key:"bar-".concat(x.props.dataKey),data:o,xAxis:l,yAxis:c,layout:u,dataPointFormatter:m})}))}},{key:"renderDots",value:function(n,s,i){var o=this.props.isAnimationActive;if(o&&!this.state.isAnimationFinished)return null;var l=this.props,c=l.dot,u=l.points,d=l.dataKey,h=je(this.props,!1),m=je(c,!0),p=u.map(function(w,g){var v=wn(wn(wn({key:"dot-".concat(g),r:3},h),m),{},{index:g,cx:w.x,cy:w.y,value:w.value,dataKey:d,payload:w.payload,points:u});return e.renderDotItem(c,v)}),x={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return F.createElement(Ve,uh({className:"recharts-line-dots",key:"dots"},x),p)}},{key:"renderCurveStatically",value:function(n,s,i,o){var l=this.props,c=l.type,u=l.layout,d=l.connectNulls;l.ref;var h=dI(l,xSe),m=wn(wn(wn({},je(h,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:s?"url(#clipPath-".concat(i,")"):null,points:n},o),{},{type:c,layout:u,connectNulls:d});return F.createElement(Do,uh({},m,{pathRef:this.pathRef}))}},{key:"renderCurveWithAnimation",value:function(n,s){var i=this,o=this.props,l=o.points,c=o.strokeDasharray,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,m=o.animationEasing,p=o.animationId,x=o.animateNewValues,w=o.width,g=o.height,v=this.state,b=v.prevPoints,y=v.totalLength;return F.createElement(ba,{begin:d,duration:h,isActive:u,easing:m,from:{t:0},to:{t:1},key:"line-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(T){var N=T.t;if(b){var j=b.length/l.length,_=l.map(function(C,R){var W=Math.floor(R*j);if(b[W]){var M=b[W],L=ir(M.x,C.x),U=ir(M.y,C.y);return wn(wn({},C),{},{x:L(N),y:U(N)})}if(x){var V=ir(w*2,C.x),D=ir(g/2,C.y);return wn(wn({},C),{},{x:V(N),y:D(N)})}return wn(wn({},C),{},{x:C.x,y:C.y})});return i.renderCurveStatically(_,n,s)}var S=ir(0,y),k=S(N),I;if(c){var E="".concat(c).split(/[,\s]+/gim).map(function(C){return parseFloat(C)});I=i.getStrokeDasharray(k,y,E)}else I=i.generateSimpleStrokeDasharray(y,k);return i.renderCurveStatically(l,n,s,{strokeDasharray:I})})}},{key:"renderCurve",value:function(n,s){var i=this.props,o=i.points,l=i.isAnimationActive,c=this.state,u=c.prevPoints,d=c.totalLength;return l&&o&&o.length&&(!u&&d>0||!ol(u,o))?this.renderCurveWithAnimation(n,s):this.renderCurveStatically(o,n,s)}},{key:"render",value:function(){var n,s=this.props,i=s.hide,o=s.dot,l=s.points,c=s.className,u=s.xAxis,d=s.yAxis,h=s.top,m=s.left,p=s.width,x=s.height,w=s.isAnimationActive,g=s.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,b=l.length===1,y=Me("recharts-line",c),T=u&&u.allowDataOverflow,N=d&&d.allowDataOverflow,j=T||N,_=Ie(g)?this.id:g,S=(n=je(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=S.r,I=k===void 0?3:k,E=S.strokeWidth,C=E===void 0?2:E,R=y6(o)?o:{},W=R.clipDot,M=W===void 0?!0:W,L=I*2+C;return F.createElement(Ve,{className:y},T||N?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(_)},F.createElement("rect",{x:T?m:m-p/2,y:N?h:h-x/2,width:T?p:p*2,height:N?x:x*2})),!M&&F.createElement("clipPath",{id:"clipPath-dots-".concat(_)},F.createElement("rect",{x:m-L/2,y:h-L/2,width:p+L,height:x+L}))):null,!b&&this.renderCurve(j,_),this.renderErrorBar(j,_),(b||o)&&this.renderDots(j,M,_),(!w||v)&&Ua.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,prevPoints:s.curPoints}:n.points!==s.curPoints?{curPoints:n.points}:null}},{key:"repeat",value:function(n,s){for(var i=n.length%2!==0?[].concat(Ll(n),[0]):n,o=[],l=0;l<s;++l)o=[].concat(Ll(o),Ll(i));return o}},{key:"renderDotItem",value:function(n,s){var i;if(F.isValidElement(n))i=F.cloneElement(n,s);else if(Ee(n))i=n(s);else{var o=s.key,l=dI(s,ySe),c=Me("recharts-line-dot",typeof n!="boolean"?n.className:"");i=F.createElement(nf,uh({key:o},l,{className:c}))}return i}}])}(P.PureComponent);la(Mo,"displayName","Line");la(Mo,"defaultProps",{xAxisId:0,yAxisId:0,connectNulls:!1,activeDot:!0,dot:!0,legendType:"line",stroke:"#3182bd",strokeWidth:1,fill:"#fff",points:[],isAnimationActive:!Gi.isSsr,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",hide:!1,label:!1});la(Mo,"getComposedData",function(t){var e=t.props,r=t.xAxis,n=t.yAxis,s=t.xAxisTicks,i=t.yAxisTicks,o=t.dataKey,l=t.bandSize,c=t.displayedData,u=t.offset,d=e.layout,h=c.map(function(m,p){var x=Gt(m,o);return d==="horizontal"?{x:mx({axis:r,ticks:s,bandSize:l,entry:m,index:p}),y:Ie(x)?null:n.scale(x),value:x,payload:m}:{x:Ie(x)?null:r.scale(x),y:mx({axis:n,ticks:i,bandSize:l,entry:m,index:p}),value:x,payload:m}});return wn({points:h,layout:d},u)});var CSe=["layout","type","stroke","connectNulls","isRange","ref"],ISe=["key"],k9;function du(t){"@babel/helpers - typeof";return du=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},du(t)}function P9(t,e){if(t==null)return{};var r=OSe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function OSe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function To(){return To=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},To.apply(this,arguments)}function fI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function Xs(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fI(Object(r),!0).forEach(function(n){Ra(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function RSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pI(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,I9(n.key),n)}}function DSe(t,e,r){return e&&pI(t.prototype,e),r&&pI(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function MSe(t,e,r){return e=$x(e),$Se(t,C9()?Reflect.construct(e,r||[],$x(t).constructor):e.apply(t,r))}function $Se(t,e){if(e&&(du(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return LSe(t)}function LSe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function C9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(C9=function(){return!!t})()}function $x(t){return $x=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},$x(t)}function FSe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&v1(t,e)}function v1(t,e){return v1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},v1(t,e)}function Ra(t,e,r){return e=I9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function I9(t){var e=BSe(t,"string");return du(e)=="symbol"?e:e+""}function BSe(t,e){if(du(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(du(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var Os=function(t){function e(){var r;RSe(this,e);for(var n=arguments.length,s=new Array(n),i=0;i<n;i++)s[i]=arguments[i];return r=MSe(this,e,[].concat(s)),Ra(r,"state",{isAnimationFinished:!0}),Ra(r,"id",Nl("recharts-area-")),Ra(r,"handleAnimationEnd",function(){var o=r.props.onAnimationEnd;r.setState({isAnimationFinished:!0}),Ee(o)&&o()}),Ra(r,"handleAnimationStart",function(){var o=r.props.onAnimationStart;r.setState({isAnimationFinished:!1}),Ee(o)&&o()}),r}return FSe(e,t),DSe(e,[{key:"renderDots",value:function(n,s,i){var o=this.props.isAnimationActive,l=this.state.isAnimationFinished;if(o&&!l)return null;var c=this.props,u=c.dot,d=c.points,h=c.dataKey,m=je(this.props,!1),p=je(u,!0),x=d.map(function(g,v){var b=Xs(Xs(Xs({key:"dot-".concat(v),r:3},m),p),{},{index:v,cx:g.x,cy:g.y,dataKey:h,value:g.value,payload:g.payload,points:d});return e.renderDotItem(u,b)}),w={clipPath:n?"url(#clipPath-".concat(s?"":"dots-").concat(i,")"):null};return F.createElement(Ve,To({className:"recharts-area-dots"},w),x)}},{key:"renderHorizontalRect",value:function(n){var s=this.props,i=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].x,u=o[o.length-1].x,d=n*Math.abs(c-u),h=mi(o.map(function(m){return m.y||0}));return ie(i)&&typeof i=="number"?h=Math.max(i,h):i&&Array.isArray(i)&&i.length&&(h=Math.max(mi(i.map(function(m){return m.y||0})),h)),ie(h)?F.createElement("rect",{x:c<u?c:c-d,y:0,width:d,height:Math.floor(h+(l?parseInt("".concat(l),10):1))}):null}},{key:"renderVerticalRect",value:function(n){var s=this.props,i=s.baseLine,o=s.points,l=s.strokeWidth,c=o[0].y,u=o[o.length-1].y,d=n*Math.abs(c-u),h=mi(o.map(function(m){return m.x||0}));return ie(i)&&typeof i=="number"?h=Math.max(i,h):i&&Array.isArray(i)&&i.length&&(h=Math.max(mi(i.map(function(m){return m.x||0})),h)),ie(h)?F.createElement("rect",{x:0,y:c<u?c:c-d,width:h+(l?parseInt("".concat(l),10):1),height:Math.floor(d)}):null}},{key:"renderClipRect",value:function(n){var s=this.props.layout;return s==="vertical"?this.renderVerticalRect(n):this.renderHorizontalRect(n)}},{key:"renderAreaStatically",value:function(n,s,i,o){var l=this.props,c=l.layout,u=l.type,d=l.stroke,h=l.connectNulls,m=l.isRange;l.ref;var p=P9(l,CSe);return F.createElement(Ve,{clipPath:i?"url(#clipPath-".concat(o,")"):null},F.createElement(Do,To({},je(p,!0),{points:n,connectNulls:h,type:u,baseLine:s,layout:c,stroke:"none",className:"recharts-area-area"})),d!=="none"&&F.createElement(Do,To({},je(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:n})),d!=="none"&&m&&F.createElement(Do,To({},je(this.props,!1),{className:"recharts-area-curve",layout:c,type:u,connectNulls:h,fill:"none",points:s})))}},{key:"renderAreaWithAnimation",value:function(n,s){var i=this,o=this.props,l=o.points,c=o.baseLine,u=o.isAnimationActive,d=o.animationBegin,h=o.animationDuration,m=o.animationEasing,p=o.animationId,x=this.state,w=x.prevPoints,g=x.prevBaseLine;return F.createElement(ba,{begin:d,duration:h,isActive:u,easing:m,from:{t:0},to:{t:1},key:"area-".concat(p),onAnimationEnd:this.handleAnimationEnd,onAnimationStart:this.handleAnimationStart},function(v){var b=v.t;if(w){var y=w.length/l.length,T=l.map(function(S,k){var I=Math.floor(k*y);if(w[I]){var E=w[I],C=ir(E.x,S.x),R=ir(E.y,S.y);return Xs(Xs({},S),{},{x:C(b),y:R(b)})}return S}),N;if(ie(c)&&typeof c=="number"){var j=ir(g,c);N=j(b)}else if(Ie(c)||Mu(c)){var _=ir(g,0);N=_(b)}else N=c.map(function(S,k){var I=Math.floor(k*y);if(g[I]){var E=g[I],C=ir(E.x,S.x),R=ir(E.y,S.y);return Xs(Xs({},S),{},{x:C(b),y:R(b)})}return S});return i.renderAreaStatically(T,N,n,s)}return F.createElement(Ve,null,F.createElement("defs",null,F.createElement("clipPath",{id:"animationClipPath-".concat(s)},i.renderClipRect(b))),F.createElement(Ve,{clipPath:"url(#animationClipPath-".concat(s,")")},i.renderAreaStatically(l,c,n,s)))})}},{key:"renderArea",value:function(n,s){var i=this.props,o=i.points,l=i.baseLine,c=i.isAnimationActive,u=this.state,d=u.prevPoints,h=u.prevBaseLine,m=u.totalLength;return c&&o&&o.length&&(!d&&m>0||!ol(d,o)||!ol(h,l))?this.renderAreaWithAnimation(n,s):this.renderAreaStatically(o,l,n,s)}},{key:"render",value:function(){var n,s=this.props,i=s.hide,o=s.dot,l=s.points,c=s.className,u=s.top,d=s.left,h=s.xAxis,m=s.yAxis,p=s.width,x=s.height,w=s.isAnimationActive,g=s.id;if(i||!l||!l.length)return null;var v=this.state.isAnimationFinished,b=l.length===1,y=Me("recharts-area",c),T=h&&h.allowDataOverflow,N=m&&m.allowDataOverflow,j=T||N,_=Ie(g)?this.id:g,S=(n=je(o,!1))!==null&&n!==void 0?n:{r:3,strokeWidth:2},k=S.r,I=k===void 0?3:k,E=S.strokeWidth,C=E===void 0?2:E,R=y6(o)?o:{},W=R.clipDot,M=W===void 0?!0:W,L=I*2+C;return F.createElement(Ve,{className:y},T||N?F.createElement("defs",null,F.createElement("clipPath",{id:"clipPath-".concat(_)},F.createElement("rect",{x:T?d:d-p/2,y:N?u:u-x/2,width:T?p:p*2,height:N?x:x*2})),!M&&F.createElement("clipPath",{id:"clipPath-dots-".concat(_)},F.createElement("rect",{x:d-L/2,y:u-L/2,width:p+L,height:x+L}))):null,b?null:this.renderArea(j,_),(o||b)&&this.renderDots(j,M,_),(!w||v)&&Ua.renderCallByParent(this.props,l))}}],[{key:"getDerivedStateFromProps",value:function(n,s){return n.animationId!==s.prevAnimationId?{prevAnimationId:n.animationId,curPoints:n.points,curBaseLine:n.baseLine,prevPoints:s.curPoints,prevBaseLine:s.curBaseLine}:n.points!==s.curPoints||n.baseLine!==s.curBaseLine?{curPoints:n.points,curBaseLine:n.baseLine}:null}}])}(P.PureComponent);k9=Os;Ra(Os,"displayName","Area");Ra(Os,"defaultProps",{stroke:"#3182bd",fill:"#3182bd",fillOpacity:.6,xAxisId:0,yAxisId:0,legendType:"line",connectNulls:!1,points:[],dot:!1,activeDot:!0,hide:!1,isAnimationActive:!Gi.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"});Ra(Os,"getBaseValue",function(t,e,r,n){var s=t.layout,i=t.baseValue,o=e.props.baseValue,l=o??i;if(ie(l)&&typeof l=="number")return l;var c=s==="horizontal"?n:r,u=c.scale.domain();if(c.type==="number"){var d=Math.max(u[0],u[1]),h=Math.min(u[0],u[1]);return l==="dataMin"?h:l==="dataMax"||d<0?d:Math.max(Math.min(u[0],u[1]),0)}return l==="dataMin"?u[0]:l==="dataMax"?u[1]:u[0]});Ra(Os,"getComposedData",function(t){var e=t.props,r=t.item,n=t.xAxis,s=t.yAxis,i=t.xAxisTicks,o=t.yAxisTicks,l=t.bandSize,c=t.dataKey,u=t.stackedData,d=t.dataStartIndex,h=t.displayedData,m=t.offset,p=e.layout,x=u&&u.length,w=k9.getBaseValue(e,r,n,s),g=p==="horizontal",v=!1,b=h.map(function(T,N){var j;x?j=u[d+N]:(j=Gt(T,c),Array.isArray(j)?v=!0:j=[w,j]);var _=j[1]==null||x&&Gt(T,c)==null;return g?{x:mx({axis:n,ticks:i,bandSize:l,entry:T,index:N}),y:_?null:s.scale(j[1]),value:j,payload:T}:{x:_?null:n.scale(j[1]),y:mx({axis:s,ticks:o,bandSize:l,entry:T,index:N}),value:j,payload:T}}),y;return x||v?y=b.map(function(T){var N=Array.isArray(T.value)?T.value[0]:null;return g?{x:T.x,y:N!=null&&T.y!=null?s.scale(N):null}:{x:N!=null?n.scale(N):null,y:T.y}}):y=g?s.scale(w):n.scale(w),Xs({points:b,baseLine:y,layout:p,isRange:v},m)});Ra(Os,"renderDotItem",function(t,e){var r;if(F.isValidElement(t))r=F.cloneElement(t,e);else if(Ee(t))r=t(e);else{var n=Me("recharts-area-dot",typeof t!="boolean"?t.className:""),s=e.key,i=P9(e,ISe);r=F.createElement(nf,To({},i,{key:s,className:n}))}return r});function hu(t){"@babel/helpers - typeof";return hu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},hu(t)}function VSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function USe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,D9(n.key),n)}}function zSe(t,e,r){return e&&USe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function HSe(t,e,r){return e=Lx(e),qSe(t,O9()?Reflect.construct(e,r||[],Lx(t).constructor):e.apply(t,r))}function qSe(t,e){if(e&&(hu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return WSe(t)}function WSe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function O9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(O9=function(){return!!t})()}function Lx(t){return Lx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Lx(t)}function GSe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&b1(t,e)}function b1(t,e){return b1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},b1(t,e)}function R9(t,e,r){return e=D9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function D9(t){var e=KSe(t,"string");return hu(e)=="symbol"?e:e+""}function KSe(t,e){if(hu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(hu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function w1(){return w1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},w1.apply(this,arguments)}function XSe(t){var e=t.xAxisId,r=K_(),n=X_(),s=p9(e);return s==null?null:P.createElement(zu,w1({},s,{className:Me("recharts-".concat(s.axisType," ").concat(s.axisType),s.className),viewBox:{x:0,y:0,width:r,height:n},ticksGenerator:function(o){return fs(o,!0)}}))}var qa=function(t){function e(){return VSe(this,e),HSe(this,e,arguments)}return GSe(e,t),zSe(e,[{key:"render",value:function(){return P.createElement(XSe,this.props)}}])}(P.Component);R9(qa,"displayName","XAxis");R9(qa,"defaultProps",{allowDecimals:!0,hide:!1,orientation:"bottom",width:0,height:30,mirror:!1,xAxisId:0,tickCount:5,type:"category",padding:{left:0,right:0},allowDataOverflow:!1,scale:"auto",reversed:!1,allowDuplicatedCategory:!0});function mu(t){"@babel/helpers - typeof";return mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},mu(t)}function YSe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function QSe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,L9(n.key),n)}}function JSe(t,e,r){return e&&QSe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ZSe(t,e,r){return e=Fx(e),eTe(t,M9()?Reflect.construct(e,r||[],Fx(t).constructor):e.apply(t,r))}function eTe(t,e){if(e&&(mu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return tTe(t)}function tTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function M9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(M9=function(){return!!t})()}function Fx(t){return Fx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Fx(t)}function rTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&j1(t,e)}function j1(t,e){return j1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},j1(t,e)}function $9(t,e,r){return e=L9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function L9(t){var e=nTe(t,"string");return mu(e)=="symbol"?e:e+""}function nTe(t,e){if(mu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(mu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}function N1(){return N1=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},N1.apply(this,arguments)}var aTe=function(e){var r=e.yAxisId,n=K_(),s=X_(),i=g9(r);return i==null?null:P.createElement(zu,N1({},i,{className:Me("recharts-".concat(i.axisType," ").concat(i.axisType),i.className),viewBox:{x:0,y:0,width:n,height:s},ticksGenerator:function(l){return fs(l,!0)}}))},Wa=function(t){function e(){return YSe(this,e),ZSe(this,e,arguments)}return rTe(e,t),JSe(e,[{key:"render",value:function(){return P.createElement(aTe,this.props)}}])}(P.Component);$9(Wa,"displayName","YAxis");$9(Wa,"defaultProps",{allowDuplicatedCategory:!0,allowDecimals:!0,hide:!1,orientation:"left",width:60,height:0,mirror:!1,yAxisId:0,tickCount:5,type:"number",padding:{top:0,bottom:0},allowDataOverflow:!1,scale:"auto",reversed:!1});function gI(t){return lTe(t)||oTe(t)||iTe(t)||sTe()}function sTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4558In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function iTe(t,e){if(t){if(typeof t=="string")return _1(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return _1(t,e)}}function oTe(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function lTe(t){if(Array.isArray(t))return _1(t)}function _1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var S1=function(e,r,n,s,i){var o=In(e,Q_),l=In(e,_v),c=[].concat(gI(o),gI(l)),u=In(e,Tv),d="".concat(s,"Id"),h=s[0],m=r;if(c.length&&(m=c.reduce(function(w,g){if(g.props[d]===n&&za(g.props,"extendDomain")&&ie(g.props[h])){var v=g.props[h];return[Math.min(w[0],v),Math.max(w[1],v)]}return w},m)),u.length){var p="".concat(h,"1"),x="".concat(h,"2");m=u.reduce(function(w,g){if(g.props[d]===n&&za(g.props,"extendDomain")&&ie(g.props[p])&&ie(g.props[x])){var v=g.props[p],b=g.props[x];return[Math.min(w[0],v,b),Math.max(w[1],v,b)]}return w},m)}return i&&i.length&&(m=i.reduce(function(w,g){return ie(g)?[Math.min(w[0],g),Math.max(w[1],g)]:w},m)),m},F9={exports:{}};(function(t){var e=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function s(c,u,d){this.fn=c,this.context=u,this.once=d||!1}function i(c,u,d,h,m){if(typeof d!="function")throw new TypeError("The listener must be a function");var p=new s(d,h||c,m),x=r?r+u:u;return c._events[x]?c._events[x].fn?c._events[x]=[c._events[x],p]:c._events[x].push(p):(c._events[x]=p,c._eventsCount++),c}function o(c,u){--c._eventsCount===0?c._events=new n:delete c._events[u]}function l(){this._events=new n,this._eventsCount=0}l.prototype.eventNames=function(){var u=[],d,h;if(this._eventsCount===0)return u;for(h in d=this._events)e.call(d,h)&&u.push(r?h.slice(1):h);return Object.getOwnPropertySymbols?u.concat(Object.getOwnPropertySymbols(d)):u},l.prototype.listeners=function(u){var d=r?r+u:u,h=this._events[d];if(!h)return[];if(h.fn)return[h.fn];for(var m=0,p=h.length,x=new Array(p);m<p;m++)x[m]=h[m].fn;return x},l.prototype.listenerCount=function(u){var d=r?r+u:u,h=this._events[d];return h?h.fn?1:h.length:0},l.prototype.emit=function(u,d,h,m,p,x){var w=r?r+u:u;if(!this._events[w])return!1;var g=this._events[w],v=arguments.length,b,y;if(g.fn){switch(g.once&&this.removeListener(u,g.fn,void 0,!0),v){case 1:return g.fn.call(g.context),!0;case 2:return g.fn.call(g.context,d),!0;case 3:return g.fn.call(g.context,d,h),!0;case 4:return g.fn.call(g.context,d,h,m),!0;case 5:return g.fn.call(g.context,d,h,m,p),!0;case 6:return g.fn.call(g.context,d,h,m,p,x),!0}for(y=1,b=new Array(v-1);y<v;y++)b[y-1]=arguments[y];g.fn.apply(g.context,b)}else{var T=g.length,N;for(y=0;y<T;y++)switch(g[y].once&&this.removeListener(u,g[y].fn,void 0,!0),v){case 1:g[y].fn.call(g[y].context);break;case 2:g[y].fn.call(g[y].context,d);break;case 3:g[y].fn.call(g[y].context,d,h);break;case 4:g[y].fn.call(g[y].context,d,h,m);break;default:if(!b)for(N=1,b=new Array(v-1);N<v;N++)b[N-1]=arguments[N];g[y].fn.apply(g[y].context,b)}}return!0},l.prototype.on=function(u,d,h){return i(this,u,d,h,!1)},l.prototype.once=function(u,d,h){return i(this,u,d,h,!0)},l.prototype.removeListener=function(u,d,h,m){var p=r?r+u:u;if(!this._events[p])return this;if(!d)return o(this,p),this;var x=this._events[p];if(x.fn)x.fn===d&&(!m||x.once)&&(!h||x.context===h)&&o(this,p);else{for(var w=0,g=[],v=x.length;w<v;w++)(x[w].fn!==d||m&&!x[w].once||h&&x[w].context!==h)&&g.push(x[w]);g.length?this._events[p]=g.length===1?g[0]:g:o(this,p)}return this},l.prototype.removeAllListeners=function(u){var d;return u?(d=r?r+u:u,this._events[d]&&o(this,d)):(this._events=new n,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=r,l.EventEmitter=l,t.exports=l})(F9);var cTe=F9.exports;const uTe=nt(cTe);var gb=new uTe,xb="recharts.syncMouseEvents";function jm(t){"@babel/helpers - typeof";return jm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},jm(t)}function dTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function hTe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,B9(n.key),n)}}function mTe(t,e,r){return e&&hTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function yb(t,e,r){return e=B9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function B9(t){var e=fTe(t,"string");return jm(e)=="symbol"?e:e+""}function fTe(t,e){if(jm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(jm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}var pTe=function(){function t(){dTe(this,t),yb(this,"activeIndex",0),yb(this,"coordinateList",[]),yb(this,"layout","horizontal")}return mTe(t,[{key:"setDetails",value:function(r){var n,s=r.coordinateList,i=s===void 0?null:s,o=r.container,l=o===void 0?null:o,c=r.layout,u=c===void 0?null:c,d=r.offset,h=d===void 0?null:d,m=r.mouseHandlerCallback,p=m===void 0?null:m;this.coordinateList=(n=i??this.coordinateList)!==null&&n!==void 0?n:[],this.container=l??this.container,this.layout=u??this.layout,this.offset=h??this.offset,this.mouseHandlerCallback=p??this.mouseHandlerCallback,this.activeIndex=Math.min(Math.max(this.activeIndex,0),this.coordinateList.length-1)}},{key:"focus",value:function(){this.spoofMouse()}},{key:"keyboardEvent",value:function(r){if(this.coordinateList.length!==0)switch(r.key){case"ArrowRight":{if(this.layout!=="horizontal")return;this.activeIndex=Math.min(this.activeIndex+1,this.coordinateList.length-1),this.spoofMouse();break}case"ArrowLeft":{if(this.layout!=="horizontal")return;this.activeIndex=Math.max(this.activeIndex-1,0),this.spoofMouse();break}}}},{key:"setIndex",value:function(r){this.activeIndex=r}},{key:"spoofMouse",value:function(){var r,n;if(this.layout==="horizontal"&&this.coordinateList.length!==0){var s=this.container.getBoundingClientRect(),i=s.x,o=s.y,l=s.height,c=this.coordinateList[this.activeIndex].coordinate,u=((r=window)===null||r===void 0?void 0:r.scrollX)||0,d=((n=window)===null||n===void 0?void 0:n.scrollY)||0,h=i+c+u,m=o+this.offset.top+l/2+d;this.mouseHandlerCallback({pageX:h,pageY:m})}}}])}();function gTe(t,e,r){if(r==="number"&&e===!0&&Array.isArray(t)){var n=t==null?void 0:t[0],s=t==null?void 0:t[1];if(n&&s&&ie(n)&&ie(s))return!0}return!1}function xTe(t,e,r,n){var s=n/2;return{stroke:"none",fill:"#ccc",x:t==="horizontal"?e.x-s:r.left+.5,y:t==="horizontal"?r.top+.5:e.y-s,width:t==="horizontal"?n:r.width-1,height:t==="horizontal"?r.height-1:n}}function V9(t){var e=t.cx,r=t.cy,n=t.radius,s=t.startAngle,i=t.endAngle,o=wt(e,r,n,s),l=wt(e,r,n,i);return{points:[o,l],cx:e,cy:r,radius:n,startAngle:s,endAngle:i}}function yTe(t,e,r){var n,s,i,o;if(t==="horizontal")n=e.x,i=n,s=r.top,o=r.top+r.height;else if(t==="vertical")s=e.y,o=s,n=r.left,i=r.left+r.width;else if(e.cx!=null&&e.cy!=null)if(t==="centric"){var l=e.cx,c=e.cy,u=e.innerRadius,d=e.outerRadius,h=e.angle,m=wt(l,c,u,h),p=wt(l,c,d,h);n=m.x,s=m.y,i=p.x,o=p.y}else return V9(e);return[{x:n,y:s},{x:i,y:o}]}function Nm(t){"@babel/helpers - typeof";return Nm=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Nm(t)}function xI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function cp(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?xI(Object(r),!0).forEach(function(n){vTe(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):xI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function vTe(t,e,r){return e=bTe(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function bTe(t){var e=wTe(t,"string");return Nm(e)=="symbol"?e:e+""}function wTe(t,e){if(Nm(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Nm(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function jTe(t){var e,r,n=t.element,s=t.tooltipEventType,i=t.isActive,o=t.activeCoordinate,l=t.activePayload,c=t.offset,u=t.activeTooltipIndex,d=t.tooltipAxisBandSize,h=t.layout,m=t.chartName,p=(e=n.props.cursor)!==null&&e!==void 0?e:(r=n.type.defaultProps)===null||r===void 0?void 0:r.cursor;if(!n||!p||!i||!o||m!=="ScatterChart"&&s!=="axis")return null;var x,w=Do;if(m==="ScatterChart")x=o,w=Pje;else if(m==="BarChart")x=xTe(h,o,c,d),w=z_;else if(h==="radial"){var g=V9(o),v=g.cx,b=g.cy,y=g.radius,T=g.startAngle,N=g.endAngle;x={cx:v,cy:b,startAngle:T,endAngle:N,innerRadius:y,outerRadius:y},w=$L}else x={points:yTe(h,o,c)},w=Do;var j=cp(cp(cp(cp({stroke:"#ccc",pointerEvents:"none"},c),x),je(p,!1)),{},{payload:l,payloadIndex:u,className:Me("recharts-tooltip-cursor",p.className)});return P.isValidElement(p)?P.cloneElement(p,j):P.createElement(w,j)}var NTe=["item"],_Te=["children","className","width","height","style","compact","title","desc"];function fu(t){"@babel/helpers - typeof";return fu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},fu(t)}function sc(){return sc=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},sc.apply(this,arguments)}function yI(t,e){return ATe(t)||TTe(t,e)||z9(t,e)||STe()}function STe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4559In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function TTe(t,e){var r=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(r!=null){var n,s,i,o,l=[],c=!0,u=!1;try{if(i=(r=r.call(t)).next,e!==0)for(;!(c=(n=i.call(r)).done)&&(l.push(n.value),l.length!==e);c=!0);}catch(d){u=!0,s=d}finally{try{if(!c&&r.return!=null&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw s}}return l}}function ATe(t){if(Array.isArray(t))return t}function vI(t,e){if(t==null)return{};var r=ETe(t,e),n,s;if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);for(s=0;s<i.length;s++)n=i[s],!(e.indexOf(n)>=0)&&Object.prototype.propertyIsEnumerable.call(t,n)&&(r[n]=t[n])}return r}function ETe(t,e){if(t==null)return{};var r={};for(var n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(e.indexOf(n)>=0)continue;r[n]=t[n]}return r}function kTe(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function PTe(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,H9(n.key),n)}}function CTe(t,e,r){return e&&PTe(t.prototype,e),Object.defineProperty(t,"prototype",{writable:!1}),t}function ITe(t,e,r){return e=Bx(e),OTe(t,U9()?Reflect.construct(e,r||[],Bx(t).constructor):e.apply(t,r))}function OTe(t,e){if(e&&(fu(e)==="object"||typeof e=="function"))return e;if(e!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return RTe(t)}function RTe(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function U9(){try{var t=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch{}return(U9=function(){return!!t})()}function Bx(t){return Bx=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(r){return r.__proto__||Object.getPrototypeOf(r)},Bx(t)}function DTe(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),e&&T1(t,e)}function T1(t,e){return T1=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,s){return n.__proto__=s,n},T1(t,e)}function pu(t){return LTe(t)||$Te(t)||z9(t)||MTe()}function MTe(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
4560In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z9(t,e){if(t){if(typeof t=="string")return A1(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);if(r==="Object"&&t.constructor&&(r=t.constructor.name),r==="Map"||r==="Set")return Array.from(t);if(r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return A1(t,e)}}function $Te(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function LTe(t){if(Array.isArray(t))return A1(t)}function A1(t,e){(e==null||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}function bI(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(s){return Object.getOwnPropertyDescriptor(t,s).enumerable})),r.push.apply(r,n)}return r}function J(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?bI(Object(r),!0).forEach(function(n){Ae(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):bI(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function Ae(t,e,r){return e=H9(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function H9(t){var e=FTe(t,"string");return fu(e)=="symbol"?e:e+""}function FTe(t,e){if(fu(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(fu(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var BTe={xAxis:["bottom","top"],yAxis:["left","right"]},VTe={width:"100%",height:"100%"},q9={x:0,y:0};function up(t){return t}var UTe=function(e,r){return r==="horizontal"?e.x:r==="vertical"?e.y:r==="centric"?e.angle:e.radius},zTe=function(e,r,n,s){var i=r.find(function(d){return d&&d.index===n});if(i){if(e==="horizontal")return{x:i.coordinate,y:s.y};if(e==="vertical")return{x:s.x,y:i.coordinate};if(e==="centric"){var o=i.coordinate,l=s.radius;return J(J(J({},s),wt(s.cx,s.cy,l,o)),{},{angle:o,radius:l})}var c=i.coordinate,u=s.angle;return J(J(J({},s),wt(s.cx,s.cy,c,u)),{},{angle:u,radius:c})}return q9},Av=function(e,r){var n=r.graphicalItems,s=r.dataStartIndex,i=r.dataEndIndex,o=(n??[]).reduce(function(l,c){var u=c.props.data;return u&&u.length?[].concat(pu(l),pu(u)):l},[]);return o.length>0?o:e&&e.length&&ie(s)&&ie(i)?e.slice(s,i+1):[]};function W9(t){return t==="number"?[0,"auto"]:void 0}var E1=function(e,r,n,s){var i=e.graphicalItems,o=e.tooltipAxis,l=Av(r,e);return n<0||!i||!i.length||n>=l.length?null:i.reduce(function(c,u){var d,h=(d=u.props.data)!==null&&d!==void 0?d:r;h&&e.dataStartIndex+e.dataEndIndex!==0&&e.dataEndIndex-e.dataStartIndex>=n&&(h=h.slice(e.dataStartIndex,e.dataEndIndex+1));var m;if(o.dataKey&&!o.allowDuplicatedCategory){var p=h===void 0?l:h;m=Fg(p,o.dataKey,s)}else m=h&&h[n]||l[n];return m?[].concat(pu(c),[CL(u,m)]):c},[])},wI=function(e,r,n,s){var i=s||{x:e.chartX,y:e.chartY},o=UTe(i,n),l=e.orderedTooltipTicks,c=e.tooltipAxis,u=e.tooltipTicks,d=s0e(o,l,u,c);if(d>=0&&u){var h=u[d]&&u[d].value,m=E1(e,r,d,h),p=zTe(n,l,d,i);return{activeTooltipIndex:d,activeLabel:h,activePayload:m,activeCoordinate:p}}return null},HTe=function(e,r){var n=r.axes,s=r.graphicalItems,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,h=e.children,m=e.stackOffset,p=SL(d,i);return n.reduce(function(x,w){var g,v=w.type.defaultProps!==void 0?J(J({},w.type.defaultProps),w.props):w.props,b=v.type,y=v.dataKey,T=v.allowDataOverflow,N=v.allowDuplicatedCategory,j=v.scale,_=v.ticks,S=v.includeHidden,k=v[o];if(x[k])return x;var I=Av(e.data,{graphicalItems:s.filter(function(q){var H,ee=o in q.props?q.props[o]:(H=q.type.defaultProps)===null||H===void 0?void 0:H[o];return ee===k}),dataStartIndex:c,dataEndIndex:u}),E=I.length,C,R,W;gTe(v.domain,T,b)&&(C=Vj(v.domain,null,T),p&&(b==="number"||j!=="auto")&&(W=ih(I,y,"category")));var M=W9(b);if(!C||C.length===0){var L,U=(L=v.domain)!==null&&L!==void 0?L:M;if(y){if(C=ih(I,y,b),b==="category"&&p){var V=Xae(C);N&&V?(R=C,C=Tx(0,E)):N||(C=VC(U,C,w).reduce(function(q,H){return q.indexOf(H)>=0?q:[].concat(pu(q),[H])},[]))}else if(b==="category")N?C=C.filter(function(q){return q!==""&&!Ie(q)}):C=VC(U,C,w).reduce(function(q,H){return q.indexOf(H)>=0||H===""||Ie(H)?q:[].concat(pu(q),[H])},[]);else if(b==="number"){var D=u0e(I,s.filter(function(q){var H,ee,de=o in q.props?q.props[o]:(H=q.type.defaultProps)===null||H===void 0?void 0:H[o],we="hide"in q.props?q.props.hide:(ee=q.type.defaultProps)===null||ee===void 0?void 0:ee.hide;return de===k&&(S||!we)}),y,i,d);D&&(C=D)}p&&(b==="number"||j!=="auto")&&(W=ih(I,y,"category"))}else p?C=Tx(0,E):l&&l[k]&&l[k].hasStack&&b==="number"?C=m==="expand"?[0,1]:PL(l[k].stackGroups,c,u):C=_L(I,s.filter(function(q){var H=o in q.props?q.props[o]:q.type.defaultProps[o],ee="hide"in q.props?q.props.hide:q.type.defaultProps.hide;return H===k&&(S||!ee)}),b,d,!0);if(b==="number")C=S1(h,C,k,i,_),U&&(C=Vj(U,C,T));else if(b==="category"&&U){var z=U,K=C.every(function(q){return z.indexOf(q)>=0});K&&(C=z)}}return J(J({},x),{},Ae({},k,J(J({},v),{},{axisType:i,domain:C,categoricalDomain:W,duplicateDomain:R,originalDomain:(g=v.domain)!==null&&g!==void 0?g:M,isCategorical:p,layout:d})))},{})},qTe=function(e,r){var n=r.graphicalItems,s=r.Axis,i=r.axisType,o=r.axisIdKey,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.layout,h=e.children,m=Av(e.data,{graphicalItems:n,dataStartIndex:c,dataEndIndex:u}),p=m.length,x=SL(d,i),w=-1;return n.reduce(function(g,v){var b=v.type.defaultProps!==void 0?J(J({},v.type.defaultProps),v.props):v.props,y=b[o],T=W9("number");if(!g[y]){w++;var N;return x?N=Tx(0,p):l&&l[y]&&l[y].hasStack?(N=PL(l[y].stackGroups,c,u),N=S1(h,N,y,i)):(N=Vj(T,_L(m,n.filter(function(j){var _,S,k=o in j.props?j.props[o]:(_=j.type.defaultProps)===null||_===void 0?void 0:_[o],I="hide"in j.props?j.props.hide:(S=j.type.defaultProps)===null||S===void 0?void 0:S.hide;return k===y&&!I}),"number",d),s.defaultProps.allowDataOverflow),N=S1(h,N,y,i)),J(J({},g),{},Ae({},y,J(J({axisType:i},s.defaultProps),{},{hide:!0,orientation:Cn(BTe,"".concat(i,".").concat(w%2),null),domain:N,originalDomain:T,isCategorical:x,layout:d})))}return g},{})},WTe=function(e,r){var n=r.axisType,s=n===void 0?"xAxis":n,i=r.AxisComp,o=r.graphicalItems,l=r.stackGroups,c=r.dataStartIndex,u=r.dataEndIndex,d=e.children,h="".concat(s,"Id"),m=In(d,i),p={};return m&&m.length?p=HTe(e,{axes:m,graphicalItems:o,axisType:s,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u}):o&&o.length&&(p=qTe(e,{Axis:i,graphicalItems:o,axisType:s,axisIdKey:h,stackGroups:l,dataStartIndex:c,dataEndIndex:u})),p},GTe=function(e){var r=oi(e),n=fs(r,!1,!0);return{tooltipTicks:n,orderedTooltipTicks:g_(n,function(s){return s.coordinate}),tooltipAxis:r,tooltipAxisBandSize:fx(r,n)}},jI=function(e){var r=e.children,n=e.defaultShowTooltip,s=_n(r,au),i=0,o=0;return e.data&&e.data.length!==0&&(o=e.data.length-1),s&&s.props&&(s.props.startIndex>=0&&(i=s.props.startIndex),s.props.endIndex>=0&&(o=s.props.endIndex)),{chartX:0,chartY:0,dataStartIndex:i,dataEndIndex:o,activeTooltipIndex:-1,isTooltipActive:!!n}},KTe=function(e){return!e||!e.length?!1:e.some(function(r){var n=bs(r&&r.type);return n&&n.indexOf("Bar")>=0})},NI=function(e){return e==="horizontal"?{numericAxisName:"yAxis",cateAxisName:"xAxis"}:e==="vertical"?{numericAxisName:"xAxis",cateAxisName:"yAxis"}:e==="centric"?{numericAxisName:"radiusAxis",cateAxisName:"angleAxis"}:{numericAxisName:"angleAxis",cateAxisName:"radiusAxis"}},XTe=function(e,r){var n=e.props,s=e.graphicalItems,i=e.xAxisMap,o=i===void 0?{}:i,l=e.yAxisMap,c=l===void 0?{}:l,u=n.width,d=n.height,h=n.children,m=n.margin||{},p=_n(h,au),x=_n(h,Io),w=Object.keys(c).reduce(function(N,j){var _=c[j],S=_.orientation;return!_.mirror&&!_.hide?J(J({},N),{},Ae({},S,N[S]+_.width)):N},{left:m.left||0,right:m.right||0}),g=Object.keys(o).reduce(function(N,j){var _=o[j],S=_.orientation;return!_.mirror&&!_.hide?J(J({},N),{},Ae({},S,Cn(N,"".concat(S))+_.height)):N},{top:m.top||0,bottom:m.bottom||0}),v=J(J({},g),w),b=v.bottom;p&&(v.bottom+=p.props.height||au.defaultProps.height),x&&r&&(v=l0e(v,s,n,r));var y=u-v.left-v.right,T=d-v.top-v.bottom;return J(J({brushBottom:b},v),{},{width:Math.max(y,0),height:Math.max(T,0)})},YTe=function(e,r){if(r==="xAxis")return e[r].width;if(r==="yAxis")return e[r].height},Ev=function(e){var r=e.chartName,n=e.GraphicalChild,s=e.defaultTooltipEventType,i=s===void 0?"axis":s,o=e.validateTooltipEventTypes,l=o===void 0?["axis"]:o,c=e.axisComponents,u=e.legendContent,d=e.formatAxisMap,h=e.defaultProps,m=function(v,b){var y=b.graphicalItems,T=b.stackGroups,N=b.offset,j=b.updateId,_=b.dataStartIndex,S=b.dataEndIndex,k=v.barSize,I=v.layout,E=v.barGap,C=v.barCategoryGap,R=v.maxBarSize,W=NI(I),M=W.numericAxisName,L=W.cateAxisName,U=KTe(y),V=[];return y.forEach(function(D,z){var K=Av(v.data,{graphicalItems:[D],dataStartIndex:_,dataEndIndex:S}),q=D.type.defaultProps!==void 0?J(J({},D.type.defaultProps),D.props):D.props,H=q.dataKey,ee=q.maxBarSize,de=q["".concat(M,"Id")],we=q["".concat(L,"Id")],Le={},ze=c.reduce(function(Pe,Fe){var Ye=b["".concat(Fe.axisType,"Map")],jt=q["".concat(Fe.axisType,"Id")];Ye&&Ye[jt]||Fe.axisType==="zAxis"||cl();var it=Ye[jt];return J(J({},Pe),{},Ae(Ae({},Fe.axisType,it),"".concat(Fe.axisType,"Ticks"),fs(it)))},Le),Q=ze[L],me=ze["".concat(L,"Ticks")],ve=T&&T[de]&&T[de].hasStack&&v0e(D,T[de].stackGroups),Z=bs(D.type).indexOf("Bar")>=0,X=fx(Q,me),ue=[],ye=U&&i0e({barSize:k,stackGroups:T,totalSize:YTe(ze,L)});if(Z){var B,re,ae=Ie(ee)?R:ee,pe=(B=(re=fx(Q,me,!0))!==null&&re!==void 0?re:ae)!==null&&B!==void 0?B:0;ue=o0e({barGap:E,barCategoryGap:C,bandSize:pe!==X?pe:X,sizeList:ye[we],maxBarSize:ae}),pe!==X&&(ue=ue.map(function(Pe){return J(J({},Pe),{},{position:J(J({},Pe.position),{},{offset:Pe.position.offset-pe/2})})}))}var Ne=D&&D.type&&D.type.getComposedData;Ne&&V.push({props:J(J({},Ne(J(J({},ze),{},{displayedData:K,props:v,dataKey:H,item:D,bandSize:X,barPosition:ue,offset:N,stackedData:ve,layout:I,dataStartIndex:_,dataEndIndex:S}))),{},Ae(Ae(Ae({key:D.key||"item-".concat(z)},M,ze[M]),L,ze[L]),"animationId",j)),childIndex:ose(D,v.children),item:D})}),V},p=function(v,b){var y=v.props,T=v.dataStartIndex,N=v.dataEndIndex,j=v.updateId;if(!Dk({props:y}))return null;var _=y.children,S=y.layout,k=y.stackOffset,I=y.data,E=y.reverseStackOrder,C=NI(S),R=C.numericAxisName,W=C.cateAxisName,M=In(_,n),L=x0e(I,M,"".concat(R,"Id"),"".concat(W,"Id"),k,E),U=c.reduce(function(q,H){var ee="".concat(H.axisType,"Map");return J(J({},q),{},Ae({},ee,WTe(y,J(J({},H),{},{graphicalItems:M,stackGroups:H.axisType===R&&L,dataStartIndex:T,dataEndIndex:N}))))},{}),V=XTe(J(J({},U),{},{props:y,graphicalItems:M}),b==null?void 0:b.legendBBox);Object.keys(U).forEach(function(q){U[q]=d(y,U[q],V,q.replace("Map",""),r)});var D=U["".concat(W,"Map")],z=GTe(D),K=m(y,J(J({},U),{},{dataStartIndex:T,dataEndIndex:N,updateId:j,graphicalItems:M,stackGroups:L,offset:V}));return J(J({formattedGraphicalItems:K,graphicalItems:M,offset:V,stackGroups:L},z),U)},x=function(g){function v(b){var y,T,N;return kTe(this,v),N=ITe(this,v,[b]),Ae(N,"eventEmitterSymbol",Symbol("rechartsEventEmitter")),Ae(N,"accessibilityManager",new pTe),Ae(N,"handleLegendBBoxUpdate",function(j){if(j){var _=N.state,S=_.dataStartIndex,k=_.dataEndIndex,I=_.updateId;N.setState(J({legendBBox:j},p({props:N.props,dataStartIndex:S,dataEndIndex:k,updateId:I},J(J({},N.state),{},{legendBBox:j}))))}}),Ae(N,"handleReceiveSyncEvent",function(j,_,S){if(N.props.syncId===j){if(S===N.eventEmitterSymbol&&typeof N.props.syncMethod!="function")return;N.applySyncEvent(_)}}),Ae(N,"handleBrushChange",function(j){var _=j.startIndex,S=j.endIndex;if(_!==N.state.dataStartIndex||S!==N.state.dataEndIndex){var k=N.state.updateId;N.setState(function(){return J({dataStartIndex:_,dataEndIndex:S},p({props:N.props,dataStartIndex:_,dataEndIndex:S,updateId:k},N.state))}),N.triggerSyncEvent({dataStartIndex:_,dataEndIndex:S})}}),Ae(N,"handleMouseEnter",function(j){var _=N.getMouseInfo(j);if(_){var S=J(J({},_),{},{isTooltipActive:!0});N.setState(S),N.triggerSyncEvent(S);var k=N.props.onMouseEnter;Ee(k)&&k(S,j)}}),Ae(N,"triggeredAfterMouseMove",function(j){var _=N.getMouseInfo(j),S=_?J(J({},_),{},{isTooltipActive:!0}):{isTooltipActive:!1};N.setState(S),N.triggerSyncEvent(S);var k=N.props.onMouseMove;Ee(k)&&k(S,j)}),Ae(N,"handleItemMouseEnter",function(j){N.setState(function(){return{isTooltipActive:!0,activeItem:j,activePayload:j.tooltipPayload,activeCoordinate:j.tooltipPosition||{x:j.cx,y:j.cy}}})}),Ae(N,"handleItemMouseLeave",function(){N.setState(function(){return{isTooltipActive:!1}})}),Ae(N,"handleMouseMove",function(j){j.persist(),N.throttleTriggeredAfterMouseMove(j)}),Ae(N,"handleMouseLeave",function(j){N.throttleTriggeredAfterMouseMove.cancel();var _={isTooltipActive:!1};N.setState(_),N.triggerSyncEvent(_);var S=N.props.onMouseLeave;Ee(S)&&S(_,j)}),Ae(N,"handleOuterEvent",function(j){var _=ise(j),S=Cn(N.props,"".concat(_));if(_&&Ee(S)){var k,I;/.*touch.*/i.test(_)?I=N.getMouseInfo(j.changedTouches[0]):I=N.getMouseInfo(j),S((k=I)!==null&&k!==void 0?k:{},j)}}),Ae(N,"handleClick",function(j){var _=N.getMouseInfo(j);if(_){var S=J(J({},_),{},{isTooltipActive:!0});N.setState(S),N.triggerSyncEvent(S);var k=N.props.onClick;Ee(k)&&k(S,j)}}),Ae(N,"handleMouseDown",function(j){var _=N.props.onMouseDown;if(Ee(_)){var S=N.getMouseInfo(j);_(S,j)}}),Ae(N,"handleMouseUp",function(j){var _=N.props.onMouseUp;if(Ee(_)){var S=N.getMouseInfo(j);_(S,j)}}),Ae(N,"handleTouchMove",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.throttleTriggeredAfterMouseMove(j.changedTouches[0])}),Ae(N,"handleTouchStart",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.handleMouseDown(j.changedTouches[0])}),Ae(N,"handleTouchEnd",function(j){j.changedTouches!=null&&j.changedTouches.length>0&&N.handleMouseUp(j.changedTouches[0])}),Ae(N,"handleDoubleClick",function(j){var _=N.props.onDoubleClick;if(Ee(_)){var S=N.getMouseInfo(j);_(S,j)}}),Ae(N,"handleContextMenu",function(j){var _=N.props.onContextMenu;if(Ee(_)){var S=N.getMouseInfo(j);_(S,j)}}),Ae(N,"triggerSyncEvent",function(j){N.props.syncId!==void 0&&gb.emit(xb,N.props.syncId,j,N.eventEmitterSymbol)}),Ae(N,"applySyncEvent",function(j){var _=N.props,S=_.layout,k=_.syncMethod,I=N.state.updateId,E=j.dataStartIndex,C=j.dataEndIndex;if(j.dataStartIndex!==void 0||j.dataEndIndex!==void 0)N.setState(J({dataStartIndex:E,dataEndIndex:C},p({props:N.props,dataStartIndex:E,dataEndIndex:C,updateId:I},N.state)));else if(j.activeTooltipIndex!==void 0){var R=j.chartX,W=j.chartY,M=j.activeTooltipIndex,L=N.state,U=L.offset,V=L.tooltipTicks;if(!U)return;if(typeof k=="function")M=k(V,j);else if(k==="value"){M=-1;for(var D=0;D<V.length;D++)if(V[D].value===j.activeLabel){M=D;break}}var z=J(J({},U),{},{x:U.left,y:U.top}),K=Math.min(R,z.x+z.width),q=Math.min(W,z.y+z.height),H=V[M]&&V[M].value,ee=E1(N.state,N.props.data,M),de=V[M]?{x:S==="horizontal"?V[M].coordinate:K,y:S==="horizontal"?q:V[M].coordinate}:q9;N.setState(J(J({},j),{},{activeLabel:H,activeCoordinate:de,activePayload:ee,activeTooltipIndex:M}))}else N.setState(j)}),Ae(N,"renderCursor",function(j){var _,S=N.state,k=S.isTooltipActive,I=S.activeCoordinate,E=S.activePayload,C=S.offset,R=S.activeTooltipIndex,W=S.tooltipAxisBandSize,M=N.getTooltipEventType(),L=(_=j.props.active)!==null&&_!==void 0?_:k,U=N.props.layout,V=j.key||"_recharts-cursor";return F.createElement(jTe,{key:V,activeCoordinate:I,activePayload:E,activeTooltipIndex:R,chartName:r,element:j,isActive:L,layout:U,offset:C,tooltipAxisBandSize:W,tooltipEventType:M})}),Ae(N,"renderPolarAxis",function(j,_,S){var k=Cn(j,"type.axisType"),I=Cn(N.state,"".concat(k,"Map")),E=j.type.defaultProps,C=E!==void 0?J(J({},E),j.props):j.props,R=I&&I[C["".concat(k,"Id")]];return P.cloneElement(j,J(J({},R),{},{className:Me(k,R.className),key:j.key||"".concat(_,"-").concat(S),ticks:fs(R,!0)}))}),Ae(N,"renderPolarGrid",function(j){var _=j.props,S=_.radialLines,k=_.polarAngles,I=_.polarRadius,E=N.state,C=E.radiusAxisMap,R=E.angleAxisMap,W=oi(C),M=oi(R),L=M.cx,U=M.cy,V=M.innerRadius,D=M.outerRadius;return P.cloneElement(j,{polarAngles:Array.isArray(k)?k:fs(M,!0).map(function(z){return z.coordinate}),polarRadius:Array.isArray(I)?I:fs(W,!0).map(function(z){return z.coordinate}),cx:L,cy:U,innerRadius:V,outerRadius:D,key:j.key||"polar-grid",radialLines:S})}),Ae(N,"renderLegend",function(){var j=N.state.formattedGraphicalItems,_=N.props,S=_.children,k=_.width,I=_.height,E=N.props.margin||{},C=k-(E.left||0)-(E.right||0),R=jL({children:S,formattedGraphicalItems:j,legendWidth:C,legendContent:u});if(!R)return null;var W=R.item,M=vI(R,NTe);return P.cloneElement(W,J(J({},M),{},{chartWidth:k,chartHeight:I,margin:E,onBBoxUpdate:N.handleLegendBBoxUpdate}))}),Ae(N,"renderTooltip",function(){var j,_=N.props,S=_.children,k=_.accessibilityLayer,I=_n(S,Ar);if(!I)return null;var E=N.state,C=E.isTooltipActive,R=E.activeCoordinate,W=E.activePayload,M=E.activeLabel,L=E.offset,U=(j=I.props.active)!==null&&j!==void 0?j:C;return P.cloneElement(I,{viewBox:J(J({},L),{},{x:L.left,y:L.top}),active:U,label:M,payload:U?W:[],coordinate:R,accessibilityLayer:k})}),Ae(N,"renderBrush",function(j){var _=N.props,S=_.margin,k=_.data,I=N.state,E=I.offset,C=I.dataStartIndex,R=I.dataEndIndex,W=I.updateId;return P.cloneElement(j,{key:j.key||"_recharts-brush",onChange:sp(N.handleBrushChange,j.props.onChange),data:k,x:ie(j.props.x)?j.props.x:E.left,y:ie(j.props.y)?j.props.y:E.top+E.height+E.brushBottom-(S.bottom||0),width:ie(j.props.width)?j.props.width:E.width,startIndex:C,endIndex:R,updateId:"brush-".concat(W)})}),Ae(N,"renderReferenceElement",function(j,_,S){if(!j)return null;var k=N,I=k.clipPathId,E=N.state,C=E.xAxisMap,R=E.yAxisMap,W=E.offset,M=j.type.defaultProps||{},L=j.props,U=L.xAxisId,V=U===void 0?M.xAxisId:U,D=L.yAxisId,z=D===void 0?M.yAxisId:D;return P.cloneElement(j,{key:j.key||"".concat(_,"-").concat(S),xAxis:C[V],yAxis:R[z],viewBox:{x:W.left,y:W.top,width:W.width,height:W.height},clipPathId:I})}),Ae(N,"renderActivePoints",function(j){var _=j.item,S=j.activePoint,k=j.basePoint,I=j.childIndex,E=j.isRange,C=[],R=_.props.key,W=_.item.type.defaultProps!==void 0?J(J({},_.item.type.defaultProps),_.item.props):_.item.props,M=W.activeDot,L=W.dataKey,U=J(J({index:I,dataKey:L,cx:S.x,cy:S.y,r:4,fill:U_(_.item),strokeWidth:2,stroke:"#fff",payload:S.payload,value:S.value},je(M,!1)),Bg(M));return C.push(v.renderActiveDot(M,U,"".concat(R,"-activePoint-").concat(I))),k?C.push(v.renderActiveDot(M,J(J({},U),{},{cx:k.x,cy:k.y}),"".concat(R,"-basePoint-").concat(I))):E&&C.push(null),C}),Ae(N,"renderGraphicChild",function(j,_,S){var k=N.filterFormatItem(j,_,S);if(!k)return null;var I=N.getTooltipEventType(),E=N.state,C=E.isTooltipActive,R=E.tooltipAxis,W=E.activeTooltipIndex,M=E.activeLabel,L=N.props.children,U=_n(L,Ar),V=k.props,D=V.points,z=V.isRange,K=V.baseLine,q=k.item.type.defaultProps!==void 0?J(J({},k.item.type.defaultProps),k.item.props):k.item.props,H=q.activeDot,ee=q.hide,de=q.activeBar,we=q.activeShape,Le=!!(!ee&&C&&U&&(H||de||we)),ze={};I!=="axis"&&U&&U.props.trigger==="click"?ze={onClick:sp(N.handleItemMouseEnter,j.props.onClick)}:I!=="axis"&&(ze={onMouseLeave:sp(N.handleItemMouseLeave,j.props.onMouseLeave),onMouseEnter:sp(N.handleItemMouseEnter,j.props.onMouseEnter)});var Q=P.cloneElement(j,J(J({},k.props),ze));function me(Fe){return typeof R.dataKey=="function"?R.dataKey(Fe.payload):null}if(Le)if(W>=0){var ve,Z;if(R.dataKey&&!R.allowDuplicatedCategory){var X=typeof R.dataKey=="function"?me:"payload.".concat(R.dataKey.toString());ve=Fg(D,X,M),Z=z&&K&&Fg(K,X,M)}else ve=D==null?void 0:D[W],Z=z&&K&&K[W];if(we||de){var ue=j.props.activeIndex!==void 0?j.props.activeIndex:W;return[P.cloneElement(j,J(J(J({},k.props),ze),{},{activeIndex:ue})),null,null]}if(!Ie(ve))return[Q].concat(pu(N.renderActivePoints({item:k,activePoint:ve,basePoint:Z,childIndex:W,isRange:z})))}else{var ye,B=(ye=N.getItemByXY(N.state.activeCoordinate))!==null&&ye!==void 0?ye:{graphicalItem:Q},re=B.graphicalItem,ae=re.item,pe=ae===void 0?j:ae,Ne=re.childIndex,Pe=J(J(J({},k.props),ze),{},{activeIndex:Ne});return[P.cloneElement(pe,Pe),null,null]}return z?[Q,null,null]:[Q,null]}),Ae(N,"renderCustomized",function(j,_,S){return P.cloneElement(j,J(J({key:"recharts-customized-".concat(S)},N.props),N.state))}),Ae(N,"renderMap",{CartesianGrid:{handler:up,once:!0},ReferenceArea:{handler:N.renderReferenceElement},ReferenceLine:{handler:up},ReferenceDot:{handler:N.renderReferenceElement},XAxis:{handler:up},YAxis:{handler:up},Brush:{handler:N.renderBrush,once:!0},Bar:{handler:N.renderGraphicChild},Line:{handler:N.renderGraphicChild},Area:{handler:N.renderGraphicChild},Radar:{handler:N.renderGraphicChild},RadialBar:{handler:N.renderGraphicChild},Scatter:{handler:N.renderGraphicChild},Pie:{handler:N.renderGraphicChild},Funnel:{handler:N.renderGraphicChild},Tooltip:{handler:N.renderCursor,once:!0},PolarGrid:{handler:N.renderPolarGrid,once:!0},PolarAngleAxis:{handler:N.renderPolarAxis},PolarRadiusAxis:{handler:N.renderPolarAxis},Customized:{handler:N.renderCustomized}}),N.clipPathId="".concat((y=b.id)!==null&&y!==void 0?y:Nl("recharts"),"-clip"),N.throttleTriggeredAfterMouseMove=w$(N.triggeredAfterMouseMove,(T=b.throttleDelay)!==null&&T!==void 0?T:1e3/60),N.state={},N}return DTe(v,g),CTe(v,[{key:"componentDidMount",value:function(){var y,T;this.addListener(),this.accessibilityManager.setDetails({container:this.container,offset:{left:(y=this.props.margin.left)!==null&&y!==void 0?y:0,top:(T=this.props.margin.top)!==null&&T!==void 0?T:0},coordinateList:this.state.tooltipTicks,mouseHandlerCallback:this.triggeredAfterMouseMove,layout:this.props.layout}),this.displayDefaultTooltip()}},{key:"displayDefaultTooltip",value:function(){var y=this.props,T=y.children,N=y.data,j=y.height,_=y.layout,S=_n(T,Ar);if(S){var k=S.props.defaultIndex;if(!(typeof k!="number"||k<0||k>this.state.tooltipTicks.length-1)){var I=this.state.tooltipTicks[k]&&this.state.tooltipTicks[k].value,E=E1(this.state,N,k,I),C=this.state.tooltipTicks[k].coordinate,R=(this.state.offset.top+j)/2,W=_==="horizontal",M=W?{x:C,y:R}:{y:C,x:R},L=this.state.formattedGraphicalItems.find(function(V){var D=V.item;return D.type.name==="Scatter"});L&&(M=J(J({},M),L.props.points[k].tooltipPosition),E=L.props.points[k].tooltipPayload);var U={activeTooltipIndex:k,isTooltipActive:!0,activeLabel:I,activePayload:E,activeCoordinate:M};this.setState(U),this.renderCursor(S),this.accessibilityManager.setIndex(k)}}}},{key:"getSnapshotBeforeUpdate",value:function(y,T){if(!this.props.accessibilityLayer)return null;if(this.state.tooltipTicks!==T.tooltipTicks&&this.accessibilityManager.setDetails({coordinateList:this.state.tooltipTicks}),this.props.layout!==y.layout&&this.accessibilityManager.setDetails({layout:this.props.layout}),this.props.margin!==y.margin){var N,j;this.accessibilityManager.setDetails({offset:{left:(N=this.props.margin.left)!==null&&N!==void 0?N:0,top:(j=this.props.margin.top)!==null&&j!==void 0?j:0}})}return null}},{key:"componentDidUpdate",value:function(y){rj([_n(y.children,Ar)],[_n(this.props.children,Ar)])||this.displayDefaultTooltip()}},{key:"componentWillUnmount",value:function(){this.removeListener(),this.throttleTriggeredAfterMouseMove.cancel()}},{key:"getTooltipEventType",value:function(){var y=_n(this.props.children,Ar);if(y&&typeof y.props.shared=="boolean"){var T=y.props.shared?"axis":"item";return l.indexOf(T)>=0?T:i}return i}},{key:"getMouseInfo",value:function(y){if(!this.container)return null;var T=this.container,N=T.getBoundingClientRect(),j=Ope(N),_={chartX:Math.round(y.pageX-j.left),chartY:Math.round(y.pageY-j.top)},S=N.width/T.offsetWidth||1,k=this.inRange(_.chartX,_.chartY,S);if(!k)return null;var I=this.state,E=I.xAxisMap,C=I.yAxisMap,R=this.getTooltipEventType(),W=wI(this.state,this.props.data,this.props.layout,k);if(R!=="axis"&&E&&C){var M=oi(E).scale,L=oi(C).scale,U=M&&M.invert?M.invert(_.chartX):null,V=L&&L.invert?L.invert(_.chartY):null;return J(J({},_),{},{xValue:U,yValue:V},W)}return W?J(J({},_),W):null}},{key:"inRange",value:function(y,T){var N=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=this.props.layout,_=y/N,S=T/N;if(j==="horizontal"||j==="vertical"){var k=this.state.offset,I=_>=k.left&&_<=k.left+k.width&&S>=k.top&&S<=k.top+k.height;return I?{x:_,y:S}:null}var E=this.state,C=E.angleAxisMap,R=E.radiusAxisMap;if(C&&R){var W=oi(C);return HC({x:_,y:S},W)}return null}},{key:"parseEventsOfWrapper",value:function(){var y=this.props.children,T=this.getTooltipEventType(),N=_n(y,Ar),j={};N&&T==="axis"&&(N.props.trigger==="click"?j={onClick:this.handleClick}:j={onMouseEnter:this.handleMouseEnter,onDoubleClick:this.handleDoubleClick,onMouseMove:this.handleMouseMove,onMouseLeave:this.handleMouseLeave,onTouchMove:this.handleTouchMove,onTouchStart:this.handleTouchStart,onTouchEnd:this.handleTouchEnd,onContextMenu:this.handleContextMenu});var _=Bg(this.props,this.handleOuterEvent);return J(J({},_),j)}},{key:"addListener",value:function(){gb.on(xb,this.handleReceiveSyncEvent)}},{key:"removeListener",value:function(){gb.removeListener(xb,this.handleReceiveSyncEvent)}},{key:"filterFormatItem",value:function(y,T,N){for(var j=this.state.formattedGraphicalItems,_=0,S=j.length;_<S;_++){var k=j[_];if(k.item===y||k.props.key===y.key||T===bs(k.item.type)&&N===k.childIndex)return k}return null}},{key:"renderClipPath",value:function(){var y=this.clipPathId,T=this.state.offset,N=T.left,j=T.top,_=T.height,S=T.width;return F.createElement("defs",null,F.createElement("clipPath",{id:y},F.createElement("rect",{x:N,y:j,height:_,width:S})))}},{key:"getXScales",value:function(){var y=this.state.xAxisMap;return y?Object.entries(y).reduce(function(T,N){var j=yI(N,2),_=j[0],S=j[1];return J(J({},T),{},Ae({},_,S.scale))},{}):null}},{key:"getYScales",value:function(){var y=this.state.yAxisMap;return y?Object.entries(y).reduce(function(T,N){var j=yI(N,2),_=j[0],S=j[1];return J(J({},T),{},Ae({},_,S.scale))},{}):null}},{key:"getXScaleByAxisId",value:function(y){var T;return(T=this.state.xAxisMap)===null||T===void 0||(T=T[y])===null||T===void 0?void 0:T.scale}},{key:"getYScaleByAxisId",value:function(y){var T;return(T=this.state.yAxisMap)===null||T===void 0||(T=T[y])===null||T===void 0?void 0:T.scale}},{key:"getItemByXY",value:function(y){var T=this.state,N=T.formattedGraphicalItems,j=T.activeItem;if(N&&N.length)for(var _=0,S=N.length;_<S;_++){var k=N[_],I=k.props,E=k.item,C=E.type.defaultProps!==void 0?J(J({},E.type.defaultProps),E.props):E.props,R=bs(E.type);if(R==="Bar"){var W=(I.data||[]).find(function(V){return uje(y,V)});if(W)return{graphicalItem:k,payload:W}}else if(R==="RadialBar"){var M=(I.data||[]).find(function(V){return HC(y,V)});if(M)return{graphicalItem:k,payload:M}}else if(bv(k,j)||wv(k,j)||xm(k,j)){var L=J1e({graphicalItem:k,activeTooltipItem:j,itemData:C.data}),U=C.activeIndex===void 0?L:C.activeIndex;return{graphicalItem:J(J({},k),{},{childIndex:U}),payload:xm(k,j)?C.data[L]:k.props.data[L]}}}return null}},{key:"render",value:function(){var y=this;if(!Dk(this))return null;var T=this.props,N=T.children,j=T.className,_=T.width,S=T.height,k=T.style,I=T.compact,E=T.title,C=T.desc,R=vI(T,_Te),W=je(R,!1);if(I)return F.createElement(J4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement(aj,sc({},W,{width:_,height:S,title:E,desc:C}),this.renderClipPath(),$k(N,this.renderMap)));if(this.props.accessibilityLayer){var M,L;W.tabIndex=(M=this.props.tabIndex)!==null&&M!==void 0?M:0,W.role=(L=this.props.role)!==null&&L!==void 0?L:"application",W.onKeyDown=function(V){y.accessibilityManager.keyboardEvent(V)},W.onFocus=function(){y.accessibilityManager.focus()}}var U=this.parseEventsOfWrapper();return F.createElement(J4,{state:this.state,width:this.props.width,height:this.props.height,clipPathId:this.clipPathId},F.createElement("div",sc({className:Me("recharts-wrapper",j),style:J({position:"relative",cursor:"default",width:_,height:S},k)},U,{ref:function(D){y.container=D}}),F.createElement(aj,sc({},W,{width:_,height:S,title:E,desc:C,style:VTe}),this.renderClipPath(),$k(N,this.renderMap)),this.renderLegend(),this.renderTooltip()))}}])}(P.Component);Ae(x,"displayName",r),Ae(x,"defaultProps",J({layout:"horizontal",stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index"},h)),Ae(x,"getDerivedStateFromProps",function(g,v){var b=g.dataKey,y=g.data,T=g.children,N=g.width,j=g.height,_=g.layout,S=g.stackOffset,k=g.margin,I=v.dataStartIndex,E=v.dataEndIndex;if(v.updateId===void 0){var C=jI(g);return J(J(J({},C),{},{updateId:0},p(J(J({props:g},C),{},{updateId:0}),v)),{},{prevDataKey:b,prevData:y,prevWidth:N,prevHeight:j,prevLayout:_,prevStackOffset:S,prevMargin:k,prevChildren:T})}if(b!==v.prevDataKey||y!==v.prevData||N!==v.prevWidth||j!==v.prevHeight||_!==v.prevLayout||S!==v.prevStackOffset||!bc(k,v.prevMargin)){var R=jI(g),W={chartX:v.chartX,chartY:v.chartY,isTooltipActive:v.isTooltipActive},M=J(J({},wI(v,y,_)),{},{updateId:v.updateId+1}),L=J(J(J({},R),W),M);return J(J(J({},L),p(J({props:g},L),v)),{},{prevDataKey:b,prevData:y,prevWidth:N,prevHeight:j,prevLayout:_,prevStackOffset:S,prevMargin:k,prevChildren:T})}if(!rj(T,v.prevChildren)){var U,V,D,z,K=_n(T,au),q=K&&(U=(V=K.props)===null||V===void 0?void 0:V.startIndex)!==null&&U!==void 0?U:I,H=K&&(D=(z=K.props)===null||z===void 0?void 0:z.endIndex)!==null&&D!==void 0?D:E,ee=q!==I||H!==E,de=!Ie(y),we=de&&!ee?v.updateId:v.updateId+1;return J(J({updateId:we},p(J(J({props:g},v),{},{updateId:we,dataStartIndex:q,dataEndIndex:H}),v)),{},{prevChildren:T,dataStartIndex:q,dataEndIndex:H})}return null}),Ae(x,"renderActiveDot",function(g,v,b){var y;return P.isValidElement(g)?y=P.cloneElement(g,v):Ee(g)?y=g(v):y=F.createElement(nf,v),F.createElement(Ve,{className:"recharts-active-dot",ke
4560y:b},y)});var w=P.forwardRef(function(v,b){return F.createElement(x,sc({},v,{ref:b}))});return w.displayName=x.displayName,w},QTe=Ev({chartName:"LineChart",GraphicalChild:Mo,axisComponents:[{axisType:"xAxis",AxisComp:qa},{axisType:"yAxis",AxisComp:Wa}],formatAxisMap:H_}),k1=Ev({chartName:"BarChart",GraphicalChild:Ha,defaultTooltipEventType:"axis",validateTooltipEventTypes:["axis","item"],axisComponents:[{axisType:"xAxis",AxisComp:qa},{axisType:"yAxis",AxisComp:Wa}],formatAxisMap:H_}),P1=Ev({chartName:"PieChart",GraphicalChild:wa,validateTooltipEventTypes:["item"],defaultTooltipEventType:"item",legendContent:"children",axisComponents:[{axisType:"angleAxis",AxisComp:vv},{axisType:"radiusAxis",AxisComp:xv}],formatAxisMap:k0e,defaultProps:{layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"}}),JTe=Ev({chartName:"AreaChart",GraphicalChild:Os,axisComponents:[{axisType:"xAxis",AxisComp:qa},{axisType:"yAxis",AxisComp:Wa}],formatAxisMap:H_});function ZTe(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),[o,l]=P.useState("6months"),[c,u]=P.useState("confirmed"),[d,h]=P.useState("monthly"),[m,p]=P.useState(0),[x,w]=P.useState([]),[g,v]=P.useState([]),[b,y]=P.useState([]),[T,N]=P.useState(0),j=["#024053","#3EA1DA","#83c5f5","#2d9cdb","#f2994a","#6fcf97","#9b51e0","#f2c94c"];P.useEffect(()=>{(async()=>{n(!0);try{let C=dt(Be(oe,"bookings"),ht("status","==",c==="all"?"confirmed":c));const R=await Zt(C),W=[];let M=0;R.forEach(L=>{const U=L.data();U.id=L.id,!(c==="confirmed"&&U.refunded)&&U.paymentType!=="meeting_room_hours"&&(W.push(U),M+=U.refunded?0:U.price)}),W.sort((L,U)=>{var z,K;const V=((z=L.createdAt)==null?void 0:z.toDate())||new Date(L.date);return(((K=U.createdAt)==null?void 0:K.toDate())||new Date(U.date)).getTime()-V.getTime()}),e(W),p(M),N(12.5),_(W)}catch(C){console.error("Error fetching bookings for financial reports:",C),i("Failed to load financial data. Please try again later.")}finally{n(!1)}})()},[c,o]);const _=E=>{let C=[...E];const R=new Date;if(o==="3months"){const z=U0(R,3);C=E.filter(K=>{var H;return(((H=K.createdAt)==null?void 0:H.toDate())||new Date(K.date))>=z})}else if(o==="6months"){const z=U0(R,6);C=E.filter(K=>{var H;return(((H=K.createdAt)==null?void 0:H.toDate())||new Date(K.date))>=z})}else if(o==="1year"){const z=U0(R,12);C=E.filter(K=>{var H;return(((H=K.createdAt)==null?void 0:H.toDate())||new Date(K.date))>=z})}const W={},M={},L={Subscription:{value:0,count:0},"One-time Payment":{value:0,count:0}};C.forEach(z=>{var de;if(z.refunded)return;const K=((de=z.createdAt)==null?void 0:de.toDate())||new Date(z.date),q=he(K,"yyyy-MM"),H=he(K,"MMM yyyy");W[q]||(W[q]={month:H,revenue:0,spaces:0,rooms:0,subscriptions:0,oneTime:0}),W[q].revenue+=z.price,z.type==="space"?W[q].spaces+=z.price:z.type==="room"&&(W[q].rooms+=z.price),z.paymentType==="subscription"?W[q].subscriptions+=z.price:z.paymentType==="one-time"&&(W[q].oneTime+=z.price);const ee=z.spaceName;M[ee]||(M[ee]={name:ee,value:0,count:0}),M[ee].value+=z.price,M[ee].count+=1,z.paymentType==="subscription"?(L.Subscription.value+=z.price,L.Subscription.count+=1):z.paymentType==="one-time"&&(L["One-time Payment"].value+=z.price,L["One-time Payment"].count+=1)});const U=Object.values(W).sort((z,K)=>new Date(z.month).getTime()-new Date(K.month).getTime()),V=Object.values(M).sort((z,K)=>K.value-z.value).map(z=>({...z,value:Math.round(z.value*100)/100})),D=Object.entries(L).map(([z,K])=>({name:z,value:Math.round(K.value*100)/100,count:K.count}));w(U),v(V),y(D)},S=E=>`RON ${E.toFixed(2)}`,k=({active:E,payload:C,label:R})=>E&&C&&C.length?a.jsxs("div",{className:"bg-white p-3 border border-gray-200 shadow-lg rounded-md",children:[a.jsx("p",{className:"font-medium text-sm",children:R}),C.map((W,M)=>a.jsxs("p",{className:"text-sm",style:{color:W.color},children:[W.name,": ",S(W.value)]},M))]}):null,I=()=>{let E=[],C="";d==="monthly"?(E=x.map(D=>({Month:D.month,"Total Revenue":D.revenue.toFixed(2),"Spaces Revenue":D.spaces.toFixed(2),"Rooms Revenue":D.rooms.toFixed(2),"Subscription Revenue":D.subscriptions.toFixed(2),"One-Time Revenue":D.oneTime.toFixed(2)})),C="monthly-revenue.csv"):d==="product"?(E=g.map(D=>({Product:D.name,Revenue:D.value.toFixed(2),"Booking Count":D.count})),C="product-revenue.csv"):d==="payment-type"&&(E=b.map(D=>({"Payment Type":D.name,Revenue:D.value.toFixed(2),"Transaction Count":D.count})),C="payment-type-revenue.csv");const R=Object.keys(E[0]||{}).join(","),W=E.map(D=>Object.values(D).map(z=>typeof z=="string"&&z.includes(",")?`"${z}"`:z).join(",")),M=[R,...W].join(`
4561`),L=new Blob([M],{type:"text/csv;charset=utf-8;"}),U=URL.createObjectURL(L),V=document.createElement("a");V.href=U,V.setAttribute("download",C),document.body.appendChild(V),V.click(),document.body.removeChild(V)};return a.jsxs("div",{className:"bg-white rounded-xl shadow-sm",children:[a.jsx("div",{className:"p-6 border-b border-gray-100",children:a.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Financial Analytics"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Revenue insights and payment analysis"})]}),a.jsxs("div",{className:"flex flex-col md:flex-row gap-3",children:[a.jsxs("div",{className:"inline-flex rounded-md shadow-sm",children:[a.jsxs("button",{onClick:()=>h("monthly"),className:`px-3 py-2 text-sm font-medium rounded-l-lg border ${d==="monthly"?"bg-brand-premium text-white border-brand-premium":"bg-white text-gray-700 border-gray-200 hover:bg-gray-50"}`,children:[a.jsx(De,{className:"w-4 h-4 inline mr-1"}),"Monthly"]}),a.jsxs("button",{onClick:()=>h("product"),className:`px-3 py-2 text-sm font-medium border-t border-b ${d==="product"?"bg-brand-premium text-white border-brand-premium":"bg-white text-gray-700 border-gray-200 hover:bg-gray-50"}`,children:[a.jsx(QV,{className:"w-4 h-4 inline mr-1"}),"By Product"]}),a.jsxs("button",{onClick:()=>h("payment-type"),className:`px-3 py-2 text-sm font-medium border-t border-b ${d==="payment-type"?"bg-brand-premium text-white border-brand-premium":"bg-white text-gray-700 border-gray-200 hover:bg-gray-50"}`,children:[a.jsx(Kn,{className:"w-4 h-4 inline mr-1"}),"By Payment"]}),a.jsxs("button",{onClick:()=>h("transactions"),className:`px-3 py-2 text-sm font-medium rounded-r-lg border ${d==="transactions"?"bg-brand-premium text-white border-brand-premium":"bg-white text-gray-700 border-gray-200 hover:bg-gray-50"}`,children:[a.jsx(xr,{className:"w-4 h-4 inline mr-1"}),"All Transactions"]})]}),a.jsxs("select",{value:o,onChange:E=>l(E.target.value),className:"px-3 py-2 border rounded-lg text-sm bg-white border-gray-200 text-gray-700",children:[a.jsx("option",{value:"3months",children:"Last 3 months"}),a.jsx("option",{value:"6months",children:"Last 6 months"}),a.jsx("option",{value:"1year",children:"Last year"}),a.jsx("option",{value:"all",children:"All time"})]}),a.jsxs("select",{value:c,onChange:E=>u(E.target.value),className:"px-3 py-2 border rounded-lg text-sm bg-white border-gray-200 text-gray-700",children:[a.jsx("option",{value:"confirmed",children:"Confirmed only"}),a.jsx("option",{value:"refunded",children:"Refunded only"}),a.jsx("option",{value:"all",children:"All statuses"})]}),a.jsxs("button",{onClick:I,className:"flex items-center px-3 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors",children:[a.jsx(Ho,{className:"w-4 h-4 mr-2"}),"Export CSV"]})]})]})}),r?a.jsx("div",{className:"flex justify-center items-center p-12",children:a.jsx("div",{className:"animate-spin rounded-full h-8 w-8 border-b-2 border-brand-premium"})}):s?a.jsxs("div",{className:"p-6 text-center",children:[a.jsx("div",{className:"text-red-500 mb-4",children:s}),a.jsx("button",{onClick:()=>window.location.reload(),className:"px-4 py-2 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors",children:"Try Again"})]}):a.jsxs("div",{className:"p-6",children:[a.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[a.jsx("div",{className:"bg-white rounded-xl p-6 border border-gray-100 shadow-sm hover:shadow-md transition-all",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:"Total Revenue"}),a.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:S(m)}),T>0?a.jsxs("div",{className:"flex items-center mt-1 text-green-600 text-xs font-medium",children:[a.jsx(OV,{className:"w-3 h-3 mr-1"}),T,"% from last year"]}):T<0?a.jsxs("div",{className:"flex items-center mt-1 text-red-600 text-xs font-medium",children:[a.jsx(IV,{className:"w-3 h-3 mr-1"}),Math.abs(T),"% from last year"]}):null]}),a.jsx("div",{className:"w-10 h-10 rounded-lg bg-brand-premium/10 flex items-center justify-center",children:a.jsx(Ph,{className:"w-5 h-5 text-brand-premium"})})]})}),a.jsx("div",{className:"bg-white rounded-xl p-6 border border-gray-100 shadow-sm hover:shadow-md transition-all",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:"Total Bookings"}),a.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t.length}),a.jsxs("div",{className:"flex items-center mt-1 text-xs text-gray-500",children:[a.jsx(De,{className:"w-3 h-3 mr-1"}),"All periods"]})]}),a.jsx("div",{className:"w-10 h-10 rounded-lg bg-blue-50 flex items-center justify-center",children:a.jsx(oy,{className:"w-5 h-5 text-blue-600"})})]})}),a.jsx("div",{className:"bg-white rounded-xl p-6 border border-gray-100 shadow-sm hover:shadow-md transition-all",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:"Avg. Revenue / Booking"}),a.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:t.length>0?S(m/t.length):S(0)}),a.jsxs("div",{className:"flex items-center mt-1 text-xs text-gray-500",children:[a.jsx(ly,{className:"w-3 h-3 mr-1"}),"Per transaction"]})]}),a.jsx("div",{className:"w-10 h-10 rounded-lg bg-emerald-50 flex items-center justify-center",children:a.jsx(_w,{className:"w-5 h-5 text-emerald-600"})})]})}),a.jsx("div",{className:"bg-white rounded-xl p-6 border border-gray-100 shadow-sm hover:shadow-md transition-all",children:a.jsxs("div",{className:"flex items-start justify-between",children:[a.jsxs("div",{children:[a.jsx("p",{className:"text-sm font-medium text-gray-500 mb-1",children:d==="monthly"?"Monthly Average":d==="product"?"Unique Products":"Payment Methods"}),a.jsx("h3",{className:"text-2xl font-bold text-gray-900",children:d==="monthly"?x.length>0?S(m/x.length):S(0):d==="product"?g.length:b.length}),a.jsxs("div",{className:"flex items-center mt-1 text-xs text-gray-500",children:[a.jsx(xr,{className:"w-3 h-3 mr-1"}),"Current view"]})]}),a.jsx("div",{className:"w-10 h-10 rounded-lg bg-indigo-50 flex items-center justify-center",children:d==="monthly"?a.jsx(De,{className:"w-5 h-5 text-indigo-600"}):d==="product"?a.jsx(xn,{className:"w-5 h-5 text-indigo-600"}):a.jsx(Kn,{className:"w-5 h-5 text-indigo-600"})})]})})]}),a.jsxs("div",{className:"space-y-8",children:[d==="monthly"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm p-5",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Monthly Revenue"}),a.jsx("div",{className:"h-[320px]",children:a.jsx(li,{width:"100%",height:"100%",children:a.jsxs(JTe,{data:x,margin:{top:10,right:30,left:2
45610,bottom:30},children:[a.jsxs("defs",{children:[a.jsxs("linearGradient",{id:"colorSpaces",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#024053",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#024053",stopOpacity:.1})]}),a.jsxs("linearGradient",{id:"colorRooms",x1:"0",y1:"0",x2:"0",y2:"1",children:[a.jsx("stop",{offset:"5%",stopColor:"#3EA1DA",stopOpacity:.8}),a.jsx("stop",{offset:"95%",stopColor:"#3EA1DA",stopOpacity:.1})]})]}),a.jsx(Nc,{strokeDasharray:"3 3",stroke:"#f0f0f0"}),a.jsx(qa,{dataKey:"month",tick:{fontSize:12},axisLine:!1,tickLine:!1}),a.jsx(Wa,{tickFormatter:E=>`RON ${E}`,tick:{fontSize:12},axisLine:!1,tickLine:!1}),a.jsx(Ar,{content:a.jsx(k,{})}),a.jsx(Os,{type:"monotone",dataKey:"spaces",name:"Spaces",stackId:"1",stroke:"#024053",fillOpacity:1,fill:"url(#colorSpaces)"}),a.jsx(Os,{type:"monotone",dataKey:"rooms",name:"Rooms",stackId:"1",stroke:"#3EA1DA",fillOpacity:1,fill:"url(#colorRooms)"})]})})})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm p-5",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Payment Method Distribution"}),a.jsx("div",{className:"h-[280px]",children:a.jsx(li,{width:"100%",height:"100%",children:a.jsxs(k1,{data:x,margin:{top:10,right:30,left:20,bottom:30},barSize:24,children:[a.jsx(Nc,{strokeDasharray:"3 3",stroke:"#f0f0f0",vertical:!1}),a.jsx(qa,{dataKey:"month",tick:{fontSize:12},axisLine:!1,tickLine:!1}),a.jsx(Wa,{tickFormatter:E=>`RON ${E}`,tick:{fontSize:12},axisLine:!1,tickLine:!1}),a.jsx(Ar,{content:a.jsx(k,{})}),a.jsx(Ha,{dataKey:"subscriptions",name:"Subscriptions",fill:"#f2c94c",radius:[4,4,0,0]}),a.jsx(Ha,{dataKey:"oneTime",name:"One-Time Payments",fill:"#6fcf97",radius:[4,4,0,0]})]})})})]})]}),d==="product"&&a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm p-5",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Revenue by Product"}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsx("div",{className:"h-[340px]",children:a.jsx(li,{width:"100%",height:"100%",children:a.jsxs(P1,{children:[a.jsx(wa,{data:g.slice(0,5),cx:"50%",cy:"50%",innerRadius:75,outerRadius:110,paddingAngle:2,fill:"#8884d8",dataKey:"value",nameKey:"name",label:({name:E,percent:C})=>`${E}: ${(C*100).toFixed(0)}%`,labelLine:!1,children:g.slice(0,5).map((E,C)=>a.jsx(Kc,{fill:j[C%j.length]},`cell-${C}`))}),a.jsx(Ar,{formatter:E=>S(E)})]})})}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"border rounded-lg",children:[a.jsx("div",{className:"bg-gray-50 border-b py-3 px-4",children:a.jsx("div",{className:"text-sm font-semibold text-gray-700",children:"Top Products by Revenue"})}),a.jsx("div",{className:"divide-y divide-gray-100",children:g.slice(0,5).map((E,C)=>a.jsxs("div",{className:"px-4 py-3 flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-3 h-3 rounded-sm mr-3",style:{background:j[C%j.length]}}),a.jsx("span",{className:"text-sm font-medium text-gray-700 truncate max-w-[150px]",children:E.name})]}),a.jsx("div",{className:"text-sm font-semibold",children:S(E.value)})]},C))})]}),a.jsxs("div",{className:"bg-brand-premium/5 p-4 rounded-lg",children:[a.jsx("h4",{className:"text-sm font-semibold text-brand-premium mb-2",children:"Key Insights"}),a.jsxs("div",{className:"space-y-2 text-sm",children:[a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Top product revenue"}),a.jsx("span",{className:"font-medium text-gray-900",children:g.length>0?S(g[0].value):"N/A"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Avg. revenue per product"}),a.jsx("span",{className:"font-medium text-gray-900",children:g.length>0?S(m/g.length):"N/A"})]}),a.jsxs("div",{className:"flex justify-between",children:[a.jsx("span",{className:"text-gray-600",children:"Total products"}),a.jsx("span",{className:"font-medium text-gray-900",children:g.length})]})]})]})]})]})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm p-5",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Product Performance"}),a.jsx("div",{className:"h-[300px]",children:a.jsx(li,{width:"100%",height:"100%",children:a.jsxs(k1,{data:g.slice(0,8),layout:"vertical",margin:{top:5,right:30,left:2
45610,bottom:5},barSize:16,children:[a.jsx(Nc,{strokeDasharray:"3 3",horizontal:!0,vertical:!1}),a.jsx(qa,{type:"number",tickFormatter:E=>`RON ${E}`,axisLine:!1,tickLine:!1}),a.jsx(Wa,{type:"category",dataKey:"name",tick:{fontSize:12},width:150,axisLine:!1,tickLine:!1}),a.jsx(Ar,{content:a.jsx(k,{})}),a.jsx(Ha,{dataKey:"value",name:"Revenue",fill:"#024053",radius:[0,4,4,0]})]})})})]})]}),d==="payment-type"&&a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm p-5",children:[a.jsx("h3",{className:"text-lg font-semibold mb-4",children:"Payment Type Distribution"}),a.jsx("div",{className:"h-[300px]",children:a.jsx(li,{width:"100%",height:"100%",children:a.jsxs(P1,{children:[a.jsx(wa,{data:b,cx:"50%",cy:"50%",innerRadius:60,outerRadius:100,paddingAngle:5,dataKey:"value",nameKey:"name",label:({name:E,percent:C})=>`${E}: ${(C*100).toFixed(0)}%`,labelLine:{stroke:"#e2e8f0",strokeWidth:1},children:b.map((E,C)=>a.jsx(Kc,{fill:j[C%j.length]},`cell-${C}`))}),a.jsx(Ar,{formatter:E=>S(E)})]})})})]}),a.jsx("div",{className:"grid grid-cols-1 gap-4",children:b.map((E,C)=>a.jsxs("div",{className:"bg-white border border-gray-100 rounded-xl shadow-sm p-5",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"w-10 h-10 rounded-lg mr-4 flex items-center justify-center",style:{background:`${j[C%j.length]}15`},children:C===0?a.jsx(De,{className:"w-5 h-5",style:{color:j[C%j.length]}}):a.jsx(Kn,{className:"w-5 h-5",style:{color:j[C%j.length]}})}),a.jsxs("div",{children:[a.jsx("h4",{className:"font-semibold text-gray-900",children:E.name}),a.jsxs("p",{className:"text-sm text-gray-500",children:[E.count," transactions"]})]})]}),a.jsxs("div",{className:"text-right",children:[a.jsx("div",{className:"text-lg font-bold text-gray-900",children:S(E.value)}),a.jsx("div",{className:"text-sm text-gray-500",children:m>0?`${(E.value/m*100).toFixed(1)}% of total`:"0%"})]})]}),a.jsx("div",{className:"mt-3",children:a.jsx("div",{className:"w-full bg-gray-100 rounded-full h-2 mt-2",children:a.jsx("div",{className:"h-2 rounded-full transition-all",style:{width:`${m>0?E.value/m*100:0}%`,background:j[C%j.length]}})})}),a.jsxs("div",{className:"mt-4 grid grid-cols-2 gap-3",children:[a.jsxs("div",{className:"bg-gray-50 p-2 rounded text-center",children:[a.jsx("div",{className:"text-xs text-gray-500",children:"Avg. Transaction"}),a.jsx("div",{className:"font-semibold text-gray-900",children:E.count>0?S(E.value/E.count):S(0)})]}),a.jsxs("div",{className:"bg-gray-50 p-2 rounded text-center",children:[a.jsx("div",{className:"text-xs text-gray-500",children:"Conversion Rate"}),a.jsx("div",{className:"font-semibold text-gray-900",children:t.length>0?`${(E.count/t.length*100).toFixed(1)}%`:"0%"})]})]})]},C))})]}),a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm mt-6",children:[a.jsxs("div",{className:"p-5 border-b border-gray-100 flex items-center justify-between",children:[a.jsx("h3",{className:"text-lg font-semibold",children:"Recent Transactions"}),a.jsxs("span",{className:"text-sm text-gray-500",children:["Showing ",Math.min(t.length,5)," of ",t.length," transactions"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-100",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Product"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Payment"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-100",children:t.slice(0,5).map(E=>{var C;return a.jsxs("tr",{className:E.refunded?"bg-red-50/30":"",children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:he(((C=E.createdAt)==null?void 0:C.toDate())||new Date(E.date),"MMM d, yyyy")}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("div",{className:"text-sm font-medium text-gray-900",children:E.spaceName})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:E.type==="space"?"Workspace":"Meeting Room"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium ${E.paymentType==="subscription"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:E.paymentType==="subscription"?"Subscription":"One-time"})}),a.jsxs("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:[a.jsx("span",{className:E.refunded?"line-through text-red-500":"text-brand-premium font-medium",children:S(E.price)}),E.refunded&&a.jsx("span",{className:"ml-2 text-xs text-red-500",children:"Refunded"})]})]},E.id)})})]})}),a.jsx("div",{className:"p-4 border-t border-gray-100",children:a.jsxs("button",{className:"text-sm text-brand-premium hover:text-brand-blue flex items-center transition-colors",onClick:()=>h("transactions"),children:[a.jsx(xr,{className:"w-4 h-4 mr-1"}),"View Full Transaction History",a.jsx(zo,{className:"w-4 h-4 ml-1"})]})})]})]})]}),d==="transactions"&&a.jsx("div",{className:"space-y-6",children:a.jsxs("div",{className:"bg-white rounded-xl border border-gray-100 shadow-sm",children:[a.jsxs("div",{className:"p-5 border-b border-gray-100 flex items-center justify-between",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-lg font-semibold",children:"All Transactions"}),a.jsx("p",{className:"text-sm text-gray-500 mt-1",children:"Complete transaction history"})]}),a.jsxs("span",{className:"text-sm text-gray-500",children:["Total: ",t.length," transactions"]})]}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"min-w-full divide-y divide-gray-100",children:[a.jsx("thead",{className:"bg-gray-50",children:a.jsxs("tr",{children:[a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Date"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Product"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Type"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Payment"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{scope:"col",className:"px-6 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider",children:"Amount"})]})}),a.jsx("tbody",{className:"bg-white divide-y divide-gray-100",children:t.map(E=>{var C;return a.jsxs("tr",{className:`hover:bg-gray-50 transition-colors ${E.refunded?"bg-red-50/30":""}`,children:[a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm text-gray-500",children:he(((C=E.createdAt)==null?void 0:C.toDate())||new Date(E.date),"MMM d, yyyy HH:mm")}
4561),a.jsxs("td",{className:"px-6 py-4",children:[a.jsx("div",{className:"text-sm font-medium text-gray-900",children:E.spaceName}),E.period&&E.durationInPeriods&&a.jsxs("div",{className:"text-xs text-gray-500",children:[E.durationInPeriods," ",E.period,"(s)"]})]}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:"inline-flex items-center px-2.5 py-0.5 rounded-full text-xs font-medium bg-gray-100 text-gray-800",children:E.type==="space"?"Workspace":"Meeting Room"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium ${E.paymentType==="subscription"?"bg-blue-100 text-blue-800":"bg-green-100 text-green-800"}`,children:E.paymentType==="subscription"?"Subscription":"One-time"})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap",children:a.jsx("span",{className:`inline-flex px-2.5 py-0.5 rounded-full text-xs font-medium ${E.refunded?"bg-red-100 text-red-800":E.status==="confirmed"?"bg-green-100 text-green-800":"bg-yellow-100 text-yellow-800"}`,children:E.refunded?"Refunded":E.status})}),a.jsx("td",{className:"px-6 py-4 whitespace-nowrap text-sm",children:a.jsx("span",{className:E.refunded?"line-through text-red-500":"text-brand-premium font-medium",children:S(E.price)})})]},E.id)})})]})}),t.length===0&&a.jsxs("div",{className:"p-12 text-center",children:[a.jsx("div",{className:"text-gray-400 mb-2",children:a.jsx(Ph,{className:"w-12 h-12 mx-auto"})}),a.jsx("p",{className:"text-gray-500",children:"No transactions found"})]})]})})]})}const _I="analytics_session_id",SI="analytics_visitor_id",TI="analytics_session_expiry",eAe=5e3,tAe=30*60*1e3;let Bp=[],Vp=null;function G9(){const t=Date.now(),e=localStorage.getItem(TI),r=e?parseInt(e,10):0;let n=localStorage.getItem(_I);return(!n||t>r)&&(n=W2(),localStorage.setItem(_I,n),localStorage.setItem(TI,(t+tAe).toString())),n}function rAe(t){if(t)return t;let e=localStorage.getItem(SI);return e||(e=W2(),localStorage.setItem(SI,e)),e}async function nAe(){if(Bp.length===0)return;BD(oe);const t=[...Bp];Bp=[];try{for(const e of t)await e()}catch(e){console.error("Error executing analytics batch:",e)}Vp=null}function aAe(t){Bp.push(t),Vp&&clearTimeout(Vp),Vp=setTimeout(nAe,eAe)}async function sAe(t){aAe(async()=>{try{await wl(Ls,{...t,timestamp:We.now()})}catch(r){console.error("Error tracking page view:",r)}})}async function iAe(t){try{const e=Te(Dy,t.sessionId);await LD(e,{...t,lastSeen:We.now()})}catch(e){console.error("Error updating active visitor:",e)}}async function AI(t){try{const e=Te(Dy,t);await Rn(e)}catch(e){console.error("Error removing active visitor:",e)}}async function oAe(){try{const t=new Date(Date.now()-12e4),e=dt(Dy,ht("lastSeen","<",We.fromDate(t))),r=await Zt(e),n=BD(oe);r.docs.forEach(s=>{n.delete(s.ref)}),r.empty||(await n.commit(),console.log(`Cleaned up ${r.size} stale visitors`))}catch(t){console.error("Error cleaning up stale visitors:",t)}}function lAe(t){return Dn(Dy,r=>{const n=r.docs.map(s=>({...s.data(),sessionId:s.id}));t(n.length,n)})}async function dp(t,e,r){try{let n=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e)));return r!=null&&r.pagePath,r==null||r.isAuthenticated,(await Zt(n)).docs.filter(o=>o.data().isSessionStart===!0).length}catch(n){return console.error("Error getting page views count:",n),0}}async function cAe(t,e,r){try{let n=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e)));return r!=null&&r.pagePath,r==null||r.isAuthenticated,(await Zt(n)).size}catch(n){return console.error("Error getting total page views count:",n),0}}async function hp(t,e,r){try{let n=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e)));r!=null&&r.pagePath,r==null||r.isAuthenticated;const s=await Zt(n),i=new Set;return s.docs.forEach(o=>{const l=o.data();i.add(l.visitorId)}),i.size}catch(n){return console.error("Error getting unique visitors count:",n),0}}async function mp(t,e,r){try{let n=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e)));r!=null&&r.pagePath,r==null||r.isAuthenticated;const s=await Zt(n),i=new Set;return s.docs.forEach(o=>{const l=o.data();i.add(l.sessionId)}),i.size}catch(n){return console.error("Error getting unique sessions count:",n),0}}async function uAe(t=50){try{const e=dt(Ls,T2("timestamp","desc"),nX(t));return(await Zt(e)).docs.map(n=>n.data())}catch(e){return console.error("Error getting recent page views:",e),[]}}async function dAe(t,e,r=10){try{const n=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e))),s=await Zt(n),i=new Map;return s.docs.forEach(o=>{const l=o.data(),c=i.get(l.pagePath)||0;i.set(l.pagePath,c+1)}),Array.from(i.entries()).map(([o,l])=>
4561({page:o,count:l})).sort((o,l)=>l.count-o.count).slice(0,r)}catch(n){return console.error("Error getting top pages:",n),[]}}async function hAe(t,e){try{const r=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e))),n=await Zt(r),s=new Map;return n.docs.forEach(i=>{const o=i.data();if(o.isSessionStart===!0){const l=o.timestamp.toDate().toISOString().split("T")[0],c=s.get(l)||{views:0,authenticated:0,anonymous:0};c.views++,o.isAuthenticated?c.authenticated++:c.anonymous++,s.set(l,c)}}),Array.from(s.entries()).map(([i,o])=>({date:i,...o})).sort((i,o)=>i.date.localeCompare(o.date))}catch(r){return console.error("Error getting daily stats:",r),[]}}async function mAe(t,e){try{const r=dt(Ls,ht("timestamp",">=",We.fromDate(t)),ht("timestamp","<=",We.fromDate(e))),n=await Zt(r),s=new Set,i=new Set;return n.docs.forEach(o=>{const l=o.data(),c=l.visitorId||l.sessionId;l.isAuthenticated?s.add(c):i.add(c)}),{authenticated:s.size,anonymous:i.size,total:s.size+i.size}}catch(r){return console.error("Error getting visitor type stats:",r),{authenticated:0,anonymous:0,total:0}}}function fAe(){const[t,e]=P.useState(0),[r,n]=P.useState([]),[s,i]=P.useState(0),[o,l]=P.useState(0),[c,u]=P.useState(0),[d,h]=P.useState(0),[m,p]=P.useState(0),[x,w]=P.useState(0),[g,v]=P.useState(0),[b,y]=P.useState(0),[T,N]=P.useState(0),[j,_]=P.useState(0),[S,k]=P.useState(0),[I,E]=P.useState(0),[C,R]=P.useState(0),[W,M]=P.useState({authenticated:0,anonymous:0,total:0}),[L,U]=P.useState([]),[V,D]=P.useState([]),[z,K]=P.useState([]),[q,H]=P.useState(!0),[ee,de]=P.useState("7days");P.useEffect(()=>{we();const Q=lAe((ve,Z)=>{e(ve),n(Z)}),me=setInterval(()=>{oAe()},6e4);return()=>{Q(),clearInterval(me)}},[]),P.useEffect(()=>{we()},[ee]);const we=async()=>{try{H(!0);const Q=new Date,me=Uh(Q),ve=gJ(Q),Z=B0(Q,7),X=B0(Q,30),ue=new Date("2024-01-01"),[ye,B,re,ae,pe,Ne,Pe,Fe,Ye,jt,it,at,$e,dr]=await Promise.all([dp(me,ve),dp(Z,Q),dp(X,Q),dp(ue,Q),hp(me,ve),hp(Z,Q),hp(X,Q),hp(ue,Q),mp(me,ve),mp(Z,Q),mp(X,Q),mp(ue,Q),mAe(ue,Q),cAe(ue,Q)]);i(ye),l(B),u(re),h(ae),w(pe),v(Ne),y(Pe),N(Fe),_(Ye),k(jt),E(it),R(at),M($e),p(dr);const Al=B0(Q,ee==="7days"?7:30),Ji=(await hAe(Al,Q)).map(Us=>({date:he(new Date(Us.date),"MMM dd"),views:Us.views,authenticated:Us.authenticated,anonymous:Us.anonymous}));U(Ji);const af=await dAe(X,Q,10);D(af);const sf=await uAe(50);K(sf),H(!1)}catch(Q){console.error("Error loading analytics:",Q),H(!1)}},Le=()=>{const Q=["Date","Page","User","Session ID"],me=z.map(ye=>[he(ye.timestamp.toDate(),"yyyy-MM-dd HH:mm:ss"),ye.pagePath,ye.userName,ye.sessionId]),ve=[Q,...me].map(ye=>ye.join(",")).join(`
4562`),Z=new Blob([ve],{type:"text/csv"}),X=window.URL.createObjectURL(Z),ue=document.createElement("a");ue.href=X,ue.download=`analytics-${he(new Date,"yyyy-MM-dd")}.csv`,ue.click()},ze=[{name:"Authenticated",value:W.authenticated,color:"#3b82f6"},{name:"Anonymous",value:W.anonymous,color:"#94a3b8"}];return q?a.jsx("div",{className:"flex items-center justify-center h-64",children:a.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-blue-600"})}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsx("h2",{className:"text-2xl font-bold text-gray-900",children:"Analytics Dashboard"}),a.jsxs("button",{onClick:Le,className:"flex items-center gap-2 px-4 py-2 bg-blue-600 text-white rounded-lg hover:bg-blue-700 transition-colors",children:[a.jsx(Ho,{className:"w-4 h-4"}),"Export CSV"]})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-2",children:[a.jsx("div",{className:"p-2 bg-green-100 rounded-lg",children:a.jsx(EN,{className:"w-6 h-6 text-green-600"})}),a.jsxs("div",{className:"flex items-center gap-1",children:[a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"}),a.jsx("span",{className:"text-xs text-green-600",children:"Live"})]})]}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:t}),a.jsx("p",{className:"text-sm text-gray-600",children:"Active Visitors"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Currently browsing"})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-blue-100 rounded-lg",children:a.jsx(xr,{className:"w-6 h-6 text-blue-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:s}),a.jsx("p",{className:"text-sm text-gray-600",children:"Visits Today"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[j," sessions"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-indigo-100 rounded-lg",children:a.jsx(Mt,{className:"w-6 h-6 text-indigo-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:j}),a.jsx("p",{className:"text-sm text-gray-600",children:"Sessions Today"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[x," unique visitors"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-emerald-100 rounded-lg",children:a.jsx(xr,{className:"w-6 h-6 text-emerald-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:o}),a.jsx("p",{className:"text-sm text-gray-600",children:"Visits This Week"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[S," sessions"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-violet-100 rounded-lg",children:a.jsx(ly,{className:"w-6 h-6 text-violet-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:S}),a.jsx("p",{className:"text-sm text-gray-600",children:"Sessions This Week"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[g," unique visitors"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-amber-100 rounded-lg",children:a.jsx(xr,{className:"w-6 h-6 text-amber-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:c}),a.jsx("p",{className:"text-sm text-gray-600",children:"Visits This Month"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[I," sessions"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-orange-100 rounded-lg",children:a.jsx(De,{className:"w-6 h-6 text-orange-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:I}),a.jsx("p",{className:"text-sm text-gray-600",children:"Sessions This Month"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[b," unique visitors"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-slate-100 rounded-lg",children:a.jsx(xr,{className:"w-6 h-6 text-slate-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:d}),a.jsx("p",{className:"text-sm text-gray-600",children:"All Time Visits"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[C," sessions"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-gray-100 rounded-lg",children:a.jsx(Mt,{className:"w-6 h-6 text-gray-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:T}),a.jsx("p",{className:"text-sm text-gray-600",children:"All Time Unique Visitors"}),a.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:[C," total sessions"]})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("div",{className:"flex items-center justify-between mb-2",children:a.jsx("div",{className:"p-2 bg-teal-100 rounded-lg",children:a.jsx(xr,{className:"w-6 h-6 text-teal-600"})})}),a.jsx("p",{className:"text-2xl font-bold text-gray-900",children:(m/T||0).toFixed(1)}),a.jsx("p",{className:"text-sm text-gray-600",children:"Avg Pages Per Visitor"}),a.jsx("p",{className:"text-xs text-gray-400 mt-1",children:"Average pages viewed"})]})]}),r.length>0&&a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Active Visitors Right Now"}),a.jsx("div",{className:"space-y-2",children:r.slice(0,10).map((Q,me)=>a.jsxs("div",{className:"flex items-center justify-between p-3 bg-gray-50 rounded-lg",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:`p-2 rounded-lg ${Q.isAuthenticated?"bg-blue-100":"bg-gray-100"}`,children:Q.isAuthenticated?a.jsx(iU,{className:"w-4 h-4 text-blue-600"}):a.jsx(oU,{className:"w-4 h-4 text-gray-600"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900",children:Q.userName}),a.jsx("p",{className:"text-sm text-gray-600",children:Q.currentPage})]})]}),a.jsx("div",{className:"w-2 h-2 bg-green-500 rounded-full animate-pulse"})]},me))})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsxs("div",{className:"flex items-center justify-between mb-4",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900",children:"Daily Visits"}),a.jsxs("select",{value:ee,onChange:Q=>de(Q.target.value),className:"px-3 py-1 border border-gray-300 rounded-lg text-sm",children:[a.jsx("option",{value:"7days",children:"Last 7 Days"}),a.jsx("option",{value:"30days",children:"Last 30 Days"})]})]}),a.jsx(li,{width:"100%",height:300,children:a.jsxs(QTe,{data:L,children:[a.jsx(Nc,{strokeDasharray:"3 3"}),a.jsx(qa,{dataKey:"date"}),a.jsx(Wa,{}),a.jsx(Ar,{}),a.jsx(Io,{}),a.jsx(Mo,{type:"monotone",dataKey:"views",stroke:"#3b82f6",strokeWidth:2,name:"Total Visits"}),a.jsx(Mo,{type:"monotone",dataKey:"authenticated",stroke:"#10b981",strokeWidth:2,name:"Authenticated"}),a.jsx(Mo,{type:"monotone",dataKey:"anonymous",stroke:"#94a3b8",strokeWidth:2,name:"Anonymous"})]})})]}),a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Top Pages"}),a.jsx(li,{width:"100%",height:300,children:a.jsxs(k1,{data:V,layout:"vertical",children:[a.jsx(Nc,{strokeDasharray:"3 3"}),a.jsx(qa,{type:"number"}),a.jsx(Wa,{dataKey:"page",type:"category",width:100}),a.jsx(Ar,{}),a.jsx(Ha,{dataKey:"count",fill:"#3b82f6"})]})})]})]}),a.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-6",children:[a.jsxs("div",{className:"bg-white rounded-lg shadow p-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Visitor Types"}),a.jsx(li,{width:"100%",height:250,children:a.jsxs(P1,{children:[a.jsx(wa,{data:ze,cx:"50%",cy:"50%",labelLine:!1,label:({name:Q,percent:me})=>`${Q}: ${(me*100).toFixed(0)}%`,outerRadius:80,fill:"#8884d8",dataKey:"value",children:ze.map((Q,me)=>a.jsx(Kc,{fill:Q.color},`cell-${me}`))}),a.jsx(Ar,{})]})}),a.jsxs("div",{className:"mt-4 space-y-3",children:[a.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 bg-blue-500 rounded-full"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Authenticated"})]}),a.jsx("span",{className:"font-bold text-gray-900",children:W.authenticated})]}),a.jsxs("div",{className:"flex items-center justify-between p-2 bg-gray-50 rounded",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-3 h-3 bg-gray-400 rounded-full"}),a.jsx("span",{className:"text-sm font-medium text-gray-700",children:"Anonymous"})]}),a.jsx("span",{className:"font-bold text-gray-900",children:W.anonymous})]}),a.jsxs("div",{className:"flex items-center justify-between p-2 bg-blue-50 rounded border border-blue-200",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Mt,{className:"w-4 h-4 text-blue-600"}),a.jsx("span",{className:"text-sm font-semibold text-blue-900",children:"Total Unique"})]}),a.jsx("span",{className:"font-bold text-blue-900",children:W.total})]})]})]}),a.jsxs("div",{className:"lg:col-span-2 bg-white rounded-lg shadow p-6",children:[a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-4",children:"Recent Visits"}),a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-gray-200",children:[a.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-gray-600",children:"Time"}),a.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-gray-600",children:"Page"}),a.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-gray-600",children:"User"}),a.jsx("th",{className:"text-left py-3 px-4 text-sm font-semibold text-gray-600",children:"Type"})]})}),a.jsx("tbody",{children:z.slice(0,10).map((Q,me)=>a.jsxs("tr",{className:"border-b border-gray-100 hover:bg-gray-50",children:[a.jsx("td",{className:"py-3 px-4 text-sm text-gray-900",children:he(Q.timestamp.toDate(),"HH:mm:ss")}),a.jsx("td",{className:"py-3 px-4 text-sm text-gray-900",children:Q.pagePath}),a.jsx("td",{className:"py-3 px-4 text-sm text-gray-900",children:Q.userName}),a.jsx("td",{className:"py-3 px-4",children:a.jsx("span",{className:`px-2 py-1 text-xs rounded-full ${Q.isAuthenticated?"bg-blue-100 text-blue-700":"bg-gray-100 text-gray-700"}`,children:Q.isAuthenticated?"User":"Guest"})})]},me))})]})})]})]})]})}const K9=[{id:"coworking",label:"Coworking & Office Spaces"},{id:"productivity",label:"Productivity & Work Environments"},{id:"startup",label:"Startup & Business Insights"},{id:"community",label:"Community Events"}],pAe={coworking:"bg-blue-100 text-blue-800",productivity:"bg-[#194b66]/10 text-[#194b66]",startup:"bg-green-100 text-green-800",community:"bg-yellow-100 text-yellow-800"};function EI(t){return t.toLowerCase().replace(/[^a-z0-9\s-]/g,"").trim().replace(/\s+/g,"-")}const gAe={title:"",slug:"",excerpt:"",content:"",coverImage:"",author:"Xponential Team",category:"coworking",tags:[],status:"draft",readTime:3};function xAe({initialData:t,onSubmit:e,onCancel:r}){const[n,s]=P.useState(t?{title:t.title,slug:t.slug,excerpt:t.excerpt,content:t.content,coverImage:t.coverImage,author:t.author,category:t.category,tags:t.tags,status:t.status,readTime:t.readTime}:gAe),[i,o]=P.useState(""),[l,c]=P.useState(!1),u=P.useRef(null),{uploading:d,uploadImages:h,deleteImage:m}=H2(),p=async y=>{const T=Array.from(y.target.files||[]);if(T.length!==0){try{const N=await h(T.slice(0,1),"blog-covers");s(j=>({...j,coverImage:N[0]}))}catch{alert("Failed to upload image")}u.current&&(u.current.value="")}},x=async()=>
4562{if(n.coverImage)try{await m(n.coverImage)}catch{}s(y=>({...y,coverImage:""}))},w=y=>{s(T=>({...T,title:y,slug:T.slug===EI(T.title)||T.slug===""?EI(y):T.slug}))},g=()=>{const y=i.trim().toLowerCase();y&&!n.tags.includes(y)&&s(T=>({...T,tags:[...T.tags,y]})),o("")},v=y=>{s(T=>({...T,tags:T.tags.filter(N=>N!==y)}))},b=async y=>{y.preventDefault(),c(!0);try{await e(n)}finally{c(!1)}};return a.jsxs("form",{onSubmit:b,className:"space-y-5",children:[a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Title *"}),a.jsx("input",{type:"text",required:!0,value:n.title,onChange:y=>w(y.target.value),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66]",placeholder:"Blog post title..."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Slug *"}),a.jsx("input",{type:"text",required:!0,value:n.slug,onChange:y=>s(T=>({...T,slug:y.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66] font-mono text-sm",placeholder:"url-friendly-slug"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Excerpt *"}),a.jsx("textarea",{required:!0,rows:2,value:n.excerpt,onChange:y=>s(T=>({...T,excerpt:y.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66] resize-none",placeholder:"Short summary of the post (shown in listings)..."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Content *"}),a.jsx("textarea",{required:!0,rows:12,value:n.content,onChange:y=>s(T=>({...T,content:y.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66] resize-y font-mono text-sm",placeholder:"Full blog post content..."})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Cover Image"}),a.jsx("input",{ref:u,type:"file",accept:"image/*",onChange:p,className:"hidden"}),n.coverImage?a.jsxs("div",{className:"relative rounded-xl overflow-hidden border border-gray-200 group",children:[a.jsx("img",{src:n.coverImage,alt:"Cover",className:"w-full h-48 object-cover"}),a.jsxs("div",{className:"absolute inset-0 bg-black/40 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-3",children:[a.jsxs("button",{type:"button",onClick:()=>{var y;return(y=u.current)==null?void 0:y.click()},disabled:d,className:"flex items-center gap-2 px-4 py-2 bg-white text-[#194b66] text-sm font-semibold rounded-lg hover:bg-gray-100 transition-colors",children:[a.jsx(v3,{className:"w-4 h-4"}),d?"Uploading...":"Change"]}),a.jsxs("button",{type:"button",onClick:x,className:"flex items-center gap-2 px-4 py-2 bg-red-500 text-white text-sm font-semibold rounded-lg hover:bg-red-600 transition-colors",children:[a.jsx(Ge,{className:"w-4 h-4"}),"Remove"]})]})]}):a.jsx("button",{type:"button",onClick:()=>{var y;return(y=u.current)==null?void 0:y.click()},disabled:d,className:"w-full h-40 border-2 border-dashed border-gray-300 rounded-xl flex flex-col items-center justify-center gap-3 hover:border-[#194b66] hover:bg-[#194b66]/5 transition-all cursor-pointer",children:d?a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-8 h-8 border-2 border-[#194b66] border-t-transparent rounded-full animate-spin"}),a.jsx("span",{className:"text-sm text-gray-500",children:"Uploading..."})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"w-12 h-12 rounded-xl bg-[#194b66]/10 flex items-center justify-center",children:a.jsx(iy,{className:"w-6 h-6 text-[#194b66]"})}),a.jsxs("div",{className:"text-center",children:[a.jsx("p",{className:"text-sm font-semibold text-[#194b66]",children:"Click to upload cover image"}),a.jsx("p",{className:"text-xs text-gray-400 mt-0.5",children:"PNG, JPG, WebP up to 10MB"})]})]})})]}),a.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Category *"}),a.jsx("select",{required:!0,value:n.category,onChange:y=>s(T=>({...T,category:y.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66]",children:K9.map(y=>a.jsx("option",{value:y.id,children:y.label},y.id))})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Author"}),a.jsx("input",{type:"text",value:n.author,onChange:y=>s(T=>({...T,author:y.target.value})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66]"})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Read Time (min)"}),a.jsx("input",{type:"number",min:1,max:60,value:n.readTime,onChange:y=>s(T=>({...T,readTime:Number(y.target.value)})),className:"w-full px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66]"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-1",children:"Tags"}),a.jsx("div",{className:"flex gap-2 mb-2 flex-wrap",children:n.tags.map(y=>a.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-1 bg-gray-100 text-gray-700 rounded text-sm",children:["#",y,a.jsx("button",{type:"button",onClick:()=>v(y),children:a.jsx(Ge,{className:"w-3 h-3"})})]},y))}),a.jsxs("div",{className:"flex gap-2",children:[a.jsx("input",{type:"text",value:i,onChange:y=>o(y.target.value),onKeyDown:y=>{y.key==="Enter"&&(y.preventDefault(),g())},className:"flex-1 px-3 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#194b66]/30 focus:border-[#194b66] text-sm",placeholder:"Add a tag and press Enter"}),a.jsx("button",{type:"button",onClick:g,className:"px-4 py-2 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors text-sm",children:"Add"})]})]}),a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Status"}),a.jsx("div",{className:"flex gap-4",children:["draft","published"].map(y=>a.jsxs("label",{className:"flex items-center gap-2 cursor-pointer",children:[a.jsx("input",{type:"radio",name:"status",value:y,checked:n.status===y,onChange:()=>s(T=>({...T,status:y})),className:"text-[#194b66]"}),a.jsx("span",{className:"text-sm capitalize",children:y})]},y))})]}),a.jsxs("div",{className:"flex justify-end gap-3 pt-2 border-t",children:[a.jsx("button",{type:"button",onClick:r,className:"px-4 py-2 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors",children:"Cancel"}),a.jsx("button",{type:"submit",disabled:l,className:"px-6 py-2 bg-[#194b66] text-white rounded-lg hover:bg-[#3ea2da] transition-colors disabled:opacity-60",children:l?"Saving...":t?"Update Post":"Create Post"})]})]})}function yAe(){const{posts:t,loading:e,error:r,addPost:n,updatePost:s,deletePost:i}=V2(),[o,l]=P.useState(!1),[c,u]=P.useState(null),[d,h]=P.useState("all"),m=async g=>{if(window.confirm("Are you sure you want to delete this post?"))try{await i(g)}catch{alert("Failed to delete post")}},p=async g=>{try{await s(g.id,{status:g.status==="published"?"draft":"published"})}catch{alert("Failed to update post status")}},x=t.filter(g=>d==="all"||g.status===d),w=g=>{if(!g)return"-";try{const v=g.toDate?g.toDate():new Date(g);return he(v,"MMM d, yyyy")}catch{return"-"}};return e?a.jsx("div",{className:"text-center py-12",children:"Loading posts..."}):r?a.jsx("div",{className:"text-red-500 text-center py-12",children:r}):a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"flex justify-between items-center",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Blog Management"}),a.jsxs("select",{value:d,onChange:g=>h(g.target.value),className:"px-3 py-1 border rounded-lg text-sm",children:[a.jsx("option",{value:"all",children:"All Posts"}),a.jsx("option",{value:"published",children:"Published"}),a.jsx("option",{value:"draft",children:"Drafts"})]})]}),a.jsxs("button",{onClick:()=>{u(null),l(!0)},className:"flex items-center px-4 py-2 bg-[#194b66] text-white rounded-lg hover:bg-[#3ea2da] transition-colors",children:[a.jsx(Ut,{className:"w-5 h-5 mr-2"}),"New Post"]})]}),o&&a.jsx("div",{className:"fixed inset-0 bg-black/50 flex items-start justify-center p-4 z-[200] overflow-y-auto",children:a.jsxs("div",{className:"bg-white rounded-xl w-full max-w-4xl my-8",children:[a.jsxs("div",{className:"sticky top-0 bg-white border-b px-6 py-4 flex justify-between items-center rounded-t-xl",children:[a.jsx("h3",{className:"text-lg font-semibold",children:c?"Edit Post":"New Blog Post"}),a.jsx("button",{onClick:()=>l(!1),className:"p-1 hover:bg-gray-100 rounded transition-colors",children:a.jsx(Ge,{className:"w-6 h-6"})})]}),a.jsx("div",{className:"p-6",children:a.jsx(xAe,{initialData:c||void 0,onSubmit:async g=>{try{c?await s(c.id,g):await n(g),l(!1)}catch{alert("Failed to save post")}},onCancel:()=>l(!1)})})]})}),x.length===0?a.jsxs("div",{className:"text-center py-16 bg-white rounded-xl shadow-sm",children:[a.jsx("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center mx-auto mb-4",children:a.jsx(vr,{className:"w-8 h-8 text-gray-400"})}),a.jsx("h3",{className:"text-lg font-medium text-gray-900 mb-2",children:"No posts found"}),a.jsx("p",{className:"text-gray-500",children:"Create your first blog post to get started."})]}):a.jsx("div",{className:"bg-white rounded-xl shadow-sm overflow-hidden",children:a.jsxs("table",{className:"w-full",children:[a.jsx("thead",{className:"bg-gray-50 border-b border-gray-200",children:a.jsxs("tr",{children:[a.jsx("th",{className:"text-left px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Post"}),a.jsx("th",{className:"text-left px-4 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider hidden md:table-cell",children:"Category"}),a.jsx("th",{className:"text-left px-4 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider hidden lg:table-cell",children:"Date"}),a.jsx("th",{className:"text-center px-4 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Status"}),a.jsx("th",{className:"text-right px-6 py-3 text-xs font-semibold text-gray-500 uppercase tracking-wider",children:"Actions"})]})}),a.jsx("tbody",{className:"divide-y divide-gray-100",children:x.map(g=>{var v;return a.jsxs("tr",{className:"hover:bg-gray-50 transition-colors",children:[a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center gap-3",children:[g.coverImage?a.jsx("img",{src:g.coverImage,alt:"",className:"w-12 h-12 object-cover rounded-lg flex-shrink-0"}):a.jsx("div",{className:"w-12 h-12 bg-gray-100 rounded-lg flex items-center justify-center flex-shrink-0",children:a.jsx(vr,{className:"w-5 h-5 text-gray-400"})}),a.jsxs("div",{children:[a.jsx("p",{className:"font-medium text-gray-900 line-clamp-1",children:g.title}),a.jsx("p",{className:"text-sm text-gray-500 line-clamp-1",children:g.excerpt}),a.jsxs("div",{className:"flex items-center gap-2 mt-1",children:[a.jsx(qe,{className:"w-3 h-3 text-gray-400"}),a.jsxs("span",{className:"text-xs text-gray-400",children:[g.readTime," min read"]})]})]})]})}),a.jsx("td",{className:"px-4 py-4 hidden md:table-cell",children:a.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs font-medium ${pAe[g.category]||"bg-gray-100 text-gray-700"}`,children:((v=K9.find(b=>b.id===g.category))==null?void 0:v.label.split(" ")[0])||g.category})}),a.jsx("td",{className:"px-4 py-4 hidden lg:table-cell",children:a.jsx("span",{className:"text-sm text-gray-600",children:w(g.createdAt)})}),a.jsx("td",{className:"px-4 py-4 text-center",children:a.jsx("span",{className:`inline-block px-2 py-1 rounded-full text-xs font-semibold ${g.status==="published"?"bg-green-100 text-green-700":"bg-yellow-100 text-yellow-700"}`,children:g.status==="published"?"Published":"Draft"})}),a.jsx("td",{className:"px-6 py-4",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[a.jsx("button",{onClick:()=>p(g),title:g.status==="published"?"Unpublish":"Publish",className:`p-2 rounded-lg transition-colors ${g.status==="published"?"text-green-600 hover:bg-green-50":"text-gray-400 hover:bg-gray-100"}`,children:g.status==="published"?a.jsx(xr,{className:"w-4 h-4"}):a.jsx(qo,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>{u(g),l(!0)},className:"p-2 text-[#194b66] hover:bg-[#194b66]/10 rounded-lg transition-colors",title:"Edit",children:a.jsx(Kn,{className:"w-4 h-4"})}),a.jsx("button",{onClick:()=>m(g.id),className:"p-2 text-red-500 hover:bg-red-50 rounded-lg transition-colors",title:"Delete",children:a.jsx(_a,{className:"w-4 h-4"})})]})})]},g.id)})})]})}),a.jsx("div",{className:"grid grid-cols-3 gap-4",children:[{label:"Total Posts",value:t.length,color:"bg-blue-50 text-blue-700"},{label:"Published",value:t.filter(g=>g.status==="published").length,color:"bg-green-50 text-green-700"},{label:"Drafts",value:t.filter(g=>g.status==="draft").length,color:"bg-yellow-50 text-yellow-700"}].map(g=>a.jsxs("div",{className:`rounded-xl p-4 ${g.color}`,children:[a.jsx("p",{className:"text-2xl font-bold",children:g.value}),a.jsx("p",{className:"text-sm font-medium opacity-80",children:g.label})]},g.label))})]})}const Vx=[{value:"new",label:"Nou",icon:d3,color:"text-blue-700",bg:"bg-blue-50 border-blue-200"},{value:"picked_up",label:"Felvéve",icon:XV,color:"text-amber-700",bg:"bg-amber-50 border-amber-200"},{value:"closed",label:"Lezárva",icon:PV,color:"text-emerald-700",bg:"bg-emerald-50 border-emerald-200"},{value:"missed",label:"Missed",icon:YV,color:"text-red-700",bg:"bg-red-50 border-red-200"}
4562];function kI(t){const e=(t||"").toLowerCase();return e==="successful"||e==="success"?{label:"OK",color:"text-emerald-600",icon:fc}:e==="failed"||e==="failure"?{label:"Fail",color:"text-red-600",icon:Cm}:{label:t||"?",color:"text-gray-400",icon:pt}}function vAe(t){return Vx.find(e=>e.value===t)||Vx[0]}function vb(t){if(!t)return"-";const e=Math.floor(t/60),r=t%60;return`${e}:${r.toString().padStart(2,"0")}`}function bAe(t){if(!t)return"";const e=t!=null&&t.toDate?t.toDate():new Date(t),n=Math.floor((new Date().getTime()-e.getTime())/1e3);return n<60?"now":n<3600?`${Math.floor(n/60)}m`:n<86400?`${Math.floor(n/3600)}h`:n<604800?`${Math.floor(n/86400)}d`:e.toLocaleDateString("ro-RO",{month:"short",day:"numeric"})}function wAe(t){return t?(t!=null&&t.toDate?t.toDate():new Date(t)).toLocaleDateString("ro-RO",{year:"numeric",month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"-"}function jAe(){const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),[o,l]=P.useState(""),[c,u]=P.useState(null),[d,h]=P.useState("all"),[m,p]=P.useState(null),x=async()=>{n(!0),i(null);try{const N=dt(Be(oe,"conversations"),T2("created_at","desc")),_=(await Zt(N)).docs.map(S=>({id:S.id,title:null,summary_preview:null,status:"unknown",action_label:null,duration_seconds:null,message_count:null,handling_status:"new",...S.data()}));e(_)}catch(N){i(N.message)}n(!1)};P.useEffect(()=>{x()},[]);const w=async(N,j)=>{try{await Je(Te(oe,"conversations",N),{handling_status:j}),e(_=>_.map(S=>S.id===N?{...S,handling_status:j}:S)),(c==null?void 0:c.id)===N&&u(_=>_?{..._,handling_status:j}:null)}catch(_){i("Status update failed: "+_.message)}},g=async N=>{try{await Rn(Te(oe,"conversations",N)),e(j=>j.filter(_=>_.id!==N)),p(null),u(null)}catch(j){i("Delete failed: "+j.message)}},v=t.filter(N=>{const j=o.toLowerCase();return(N.client_name&&N.client_name.toLowerCase().includes(j)||N.phone_number&&N.phone_number.includes(j)||N.summary&&N.summary.toLowerCase().includes(j)||N.title&&N.title.toLowerCase().includes(j))&&(d==="all"||N.handling_status===d)}),b=t.reduce((N,j)=>N+(j.duration_seconds||0),0),y=t.filter(N=>["successful","success"].includes((N.status||"").toLowerCase())).length,T=t.filter(N=>!N.handling_status||N.handling_status==="new").length;return a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx("div",{className:"w-8 h-8 rounded-lg bg-gradient-to-br from-[#194b66] to-[#2a7a9e] flex items-center justify-center",children:a.jsx(NA,{className:"w-4 h-4 text-white"})}),a.jsxs("div",{children:[a.jsx("h2",{className:"text-base font-semibold text-gray-900 leading-tight",children:"AI Reception"}),a.jsx("p",{className:"text-[11px] text-gray-400",children:"Call history"})]})]}),a.jsxs("button",{onClick:x,disabled:r,className:"flex items-center gap-1.5 px-3 py-1.5 bg-[#194b66] text-white rounded-lg hover:bg-[#194b66]/90 transition-all text-xs font-medium disabled:opacity-50",children:[a.jsx(Si,{className:`w-3.5 h-3.5 ${r?"animate-spin":""}`}),"Refresh"]})]}),a.jsxs("div",{className:"flex items-center gap-4 bg-white rounded-lg px-4 py-2.5 shadow-sm border border-gray-100 text-xs",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-gray-600",children:[a.jsx(NA,{className:"w-3.5 h-3.5 text-blue-500"}),a.jsx("strong",{className:"text-gray-900",children:t.length})," calls"]}),a.jsx("span",{className:"w-px h-4 bg-gray-200"}),a.jsxs("span",{className:"flex items-center gap-1.5 text-gray-600",children:[a.jsx(fc,{className:"w-3.5 h-3.5 text-emerald-500"}),a.jsx("strong",{className:"text-gray-900",children:y})," ok"]}),a.jsx("span",{className:"w-px h-4 bg-gray-200"}),a.jsxs("span",{className:"flex items-center gap-1.5 text-gray-600",children:[a.jsx(aU,{className:"w-3.5 h-3.5 text-amber-500"}),a.jsx("strong",{className:"text-gray-900",children:vb(b)})]}),a.jsx("span",{className:"w-px h-4 bg-gray-200"}),a.jsxs("span",{className:"flex items-center gap-1.5 text-gray-600",children:[a.jsx(d3,{className:"w-3.5 h-3.5 text-blue-500"}),a.jsx("strong",{className:"text-gray-900",children:T})," new"]})]}),a.jsxs("div",{className:"flex flex-col sm:flex-row gap-2",children:[a.jsxs("div",{className:"relative flex-1",children:[a.jsx(Pm,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 text-gray-400"}),a.jsx("input",{type:"text",placeholder:"Search...",value:o,onChange:N=>l(N.target.value),className:"w-full pl-8 pr-3 py-2 bg-white border border-gray-200 rounded-lg text-xs focus:ring-2 focus:ring-[#194b66]/20 focus:border-[#194b66] outline-none"})]}),a.jsxs("div",{className:"flex gap-0.5 p-0.5 bg-gray-100 rounded-lg",children:[a.jsx("button",{onClick:()=>h("all"),className:`px-2.5 py-1.5 rounded-md text-[11px] font-medium transition-all ${d==="all"?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:"All"}),Vx.map(N=>a.jsx("button",{onClick:()=>
4562h(N.value),className:`px-2.5 py-1.5 rounded-md text-[11px] font-medium transition-all ${d===N.value?"bg-white text-gray-900 shadow-sm":"text-gray-500 hover:text-gray-700"}`,children:N.label},N.value))]})]}),s&&a.jsx("div",{className:"bg-red-50 text-red-700 px-3 py-2 rounded-lg text-xs border border-red-100",children:s}),r?a.jsx("div",{className:"flex justify-center py-8",children:a.jsx("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#194b66]"})}):v.length===0?a.jsx("div",{className:"bg-white rounded-lg p-8 text-center border border-gray-100",children:a.jsx("p",{className:"text-gray-400 text-xs",children:o||d!=="all"?"No matches.":"No conversations yet."})}):a.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-2.5",children:v.map(N=>{const j=kI(N.status),_=j.icon,S=vAe(N.handling_status||"new"),k=S.icon;return a.jsx("div",{onClick:()=>u(N),className:`bg-white rounded-xl border border-gray-100 shadow-sm px-3.5 py-2.5 cursor-pointer hover:shadow-md hover:border-gray-200 transition-all ${N.handling_status==="closed"?"opacity-60":""}`,children:a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(_,{className:`w-4 h-4 flex-shrink-0 ${j.color}`}),a.jsxs("div",{className:"flex-1 min-w-0",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-gray-900 truncate",children:N.client_name}),a.jsx("span",{className:"text-[10px] text-gray-400",children:bAe(N.conversation_timestamp||N.created_at)})]}),a.jsx("p",{className:"text-[11px] text-gray-500 truncate",children:N.title||N.summary_preview||"-"})]}),a.jsxs("div",{className:"flex items-center gap-1.5 flex-shrink-0",children:[a.jsxs("span",{className:`inline-flex items-center gap-0.5 px-1.5 py-0.5 rounded text-[10px] font-medium border ${S.bg} ${S.color}`,children:[a.jsx(k,{className:"w-2.5 h-2.5"}),S.label]}),N.duration_seconds!=null&&a.jsx("span",{className:"text-[10px] text-gray-400",children:vb(N.duration_seconds)})]})]})},N.id)})}),c&&a.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",onClick:()=>{u(null),p(null)},children:[a.jsx("div",{className:"absolute inset-0 bg-black/40 backdrop-blur-sm"}),a.jsxs("div",{className:"relative bg-white rounded-2xl shadow-2xl w-full max-w-lg max-h-[85vh] overflow-y-auto",onClick:N=>N.stopPropagation(),children:[a.jsxs("div",{className:"sticky top-0 bg-white z-10 px-5 py-4 border-b border-gray-100 flex items-center justify-between rounded-t-2xl",children:[a.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[(()=>{const N=kI(c.status),j=N.icon;return a.jsx(j,{className:`w-5 h-5 flex-shrink-0 ${N.color}`})})(),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h3",{className:"text-base font-semibold text-gray-900 truncate",children:c.client_name}),c.phone_number&&a.jsx("a",{href:`tel:${c.phone_number}`,className:"text-xs text-gray-500 hover:text-[#194b66]",children:c.phone_number})]})]}),a.jsx("button",{onClick:()=>{u(null),p(null)},className:"w-8 h-8 rounded-lg flex items-center justify-center text-gray-400 hover:text-gray-600 hover:bg-gray-100 transition-colors",children:a.jsx(Ge,{className:"w-4 h-4"})})]}),a.jsxs("div",{className:"px-5 py-4 space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-3 gap-3",children:[a.jsxs("div",{className:"bg-gray-50 rounded-lg px-3 py-2 text-center",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider",children:"Duration"}),a.jsx("p",{className:"text-sm font-medium text-gray-900 mt-0.5",children:vb(c.duration_seconds)})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg px-3 py-2 text-center",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider",children:"Messages"}),a.jsx("p",{className:"text-sm font-medium text-gray-900 mt-0.5",children:c.message_count??"-"})]}),a.jsxs("div",{className:"bg-gray-50 rounded-lg px-3 py-2 text-center",children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider",children:"Date"}),a.jsx("p",{className:"text-sm font-medium text-gray-900 mt-0.5",children:wAe(c.conversation_timestamp)})]})]}),c.action_label&&a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(PN,{className:"w-3.5 h-3.5 text-blue-500"}),a.jsx("span",{className:"text-xs font-medium text-blue-700 bg-blue-50 px-2 py-0.5 rounded",children:c.action_label})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5",children:"Summary"}),a.jsx("div",{className:"bg-gray-50 rounded-lg px-3.5 py-3 text-sm text-gray-700 leading-relaxed border border-gray-100",children:c.summary||c.summary_preview||"No summary available."})]}),c.audio_url&&a.jsxs("div",{children:[a.jsxs("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-1.5 flex items-center gap-1",children:[a.jsx(cU,{className:"w-3 h-3"})," Recording"]}),a.jsx("audio",{controls:!0,className:"w-full h-10 rounded-lg",preload:"metadata",children:a.jsx("source",{src:c.audio_url})})]}),c.transcript&&a.jsxs("details",{children:[a.jsxs("summary",{className:"text-[11px] font-semibold text-gray-500 cursor-pointer hover:text-gray-700 transition-colors flex items-center gap-1",children:[a.jsx(vr,{className:"w-3 h-3"})," Transcript"]}),a.jsx("div",{className:"mt-1.5 bg-gray-50 rounded-lg px-3.5 py-3 text-xs text-gray-600 leading-relaxed border border-gray-100 max-h-52 overflow-y-auto whitespace-pre-wrap",children:c.transcript})]}),a.jsxs("div",{children:[a.jsx("p",{className:"text-[10px] font-semibold text-gray-400 uppercase tracking-wider mb-2",children:"Status"}),a.jsx("div",{className:"flex gap-1.5 flex-wrap",children:Vx.map(N=>{const j=N.icon,_=(c.handling_status||"new")===N.value;return a.jsxs("button",{onClick:()=>
4562w(c.id,N.value),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg text-xs font-medium border transition-all ${_?`${N.bg} ${N.color} ring-2 ring-offset-1 ring-gray-200`:"border-gray-200 text-gray-500 hover:text-gray-700 hover:bg-gray-50"}`,children:[a.jsx(j,{className:"w-3.5 h-3.5"}),N.label]},N.value)})})]}),c.raw_payload&&a.jsxs("details",{children:[a.jsx("summary",{className:"text-[11px] text-gray-400 cursor-pointer hover:text-gray-600 transition-colors",children:"Raw data"}),a.jsx("pre",{className:"mt-1.5 text-[10px] bg-gray-900 text-gray-100 p-3 rounded-lg overflow-auto max-h-48 font-mono",children:JSON.stringify(c.raw_payload,null,2)})]})]}),a.jsxs("div",{className:"sticky bottom-0 bg-white px-5 py-3 border-t border-gray-100 flex items-center justify-between rounded-b-2xl",children:[a.jsx("button",{onClick:()=>{u(null),p(null)},className:"px-4 py-2 text-xs font-medium text-gray-600 bg-gray-100 rounded-lg hover:bg-gray-200 transition-colors",children:"Close"}),m===c.id?a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("span",{className:"text-xs text-red-600 font-medium",children:"Permanently delete?"}),a.jsx("button",{onClick:()=>g(c.id),className:"px-3 py-2 bg-red-600 text-white text-xs rounded-lg font-medium hover:bg-red-700 transition-colors",children:"Yes, delete"}),a.jsx("button",{onClick:()=>p(null),className:"px-3 py-2 bg-white text-gray-600 text-xs rounded-lg font-medium border border-gray-200 hover:bg-gray-50 transition-colors",children:"Cancel"})]}):a.jsxs("button",{onClick:()=>p(c.id),className:"inline-flex items-center gap-1.5 px-4 py-2 rounded-lg text-xs font-medium text-red-600 border border-red-200 hover:bg-red-50 transition-all",children:[a.jsx(_a,{className:"w-3.5 h-3.5"}),"Törlés"]})]})]})]})]})}function NAe(){var x;const t=cr(),[e,r]=P.useState(!1),[n,s]=P.useState({username:"",password:""}),[i,o]=P.useState(null),[l,c]=P.useState("overview"),[u,d]=P.useState(!0),h=w=>{w.preventDefault(),n.username==="admin"&&n.password==="admin123"?(r(!0),o(null),localStorage.setItem("adminAuth","true")):o("Invalid credentials")},m=()=>{r(!1),localStorage.removeItem("adminAuth"),t("/")};F.useEffect(()=>{localStorage.getItem("adminAuth")==="true"&&r(!0)},[]);const p=[{id:"overview",icon:RV,label:"Overview"},{id:"ai-reception",icon:MV,label:"AI Reception"},{id:"analytics",icon:EN,label:"Analytics"},{id:"users",icon:Mt,label:"Members"},{id:"bookings",icon:De,label:"Bookings"},{id:"spaces",icon:xn,label:"Spaces"},{id:"rooms",icon:xn,label:"Meeting Rooms"},{id:"calendar",icon:De,label:"Room Calendar"},{id:"events",icon:yA,label:"Events"},{id:"tours",icon:ja,label:"Tour Requests"},{id:"finances",icon:Ph,label:"Finances"},{id:"promo-codes",icon:Ti,label:"Promo Codes"},{id:"currency",icon:bu,label:"Currency Settings"},{id:"images",icon:iy,label:"Image Cache"},{id:"blog",icon:Nu,label:"Blog"},{id:"settings",icon:Nw,label:"Settings"}];return e?a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsxs("div",{className:"min-h-screen flex bg-gray-100",children:[a.jsxs("div",{className:`bg-[#194b66] text-white h-screen fixed z-40 transition-all duration-300 ${u?"w-64":"w-16"}`,children:[a.jsxs("div",{className:"p-4 flex items-center justify-between border-b border-white/10",children:[u?a.jsx("div",{className:"flex items-center",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"h-8 w-auto"})}):a.jsx("img",{src:"/x-rosu.png",alt:"X",className:"h-8 w-auto mx-auto"}),u&&a.jsx("button",{onClick:()=>d(!1),className:"p-1 hover:bg-white/10 rounded transition-colors",title:"Collapse sidebar",children:a.jsx(fl,{className:"w-5 h-5"})})]}),a.jsxs("div",{className:"py-4 flex flex-col h-[calc(100%-80px)] overflow-y-auto",children:[a.jsx("div",{className:"flex-1",children:p.map(w=>{const g=w.icon;return a.jsxs("button",{onClick:()=>c(w.id),className:`
4563                    w-full flex items-center ${u?"px-4":"justify-center"} py-3 transition-all duration-200
4564                    ${l===w.id?"bg-white/10 text-white border-l-4 border-white":"text-white/70 hover:bg-white/5 border-l-4 border-transparent"}
4565                  `,children:[a.jsx(g,{className:"w-5 h-5 min-w-5"}),u&&a.jsx("span",{className:"ml-3 text-sm",children:w.label})]},w.id)})}),a.jsxs("button",{onClick:m,className:`
4566              flex items-center ${u?"px-4 justify-start":"justify-center"} py-3 mt-auto text-red-300 hover:bg-red-900/30
4567              transition-colors border-l-4 border-transparent
4568            `,children:[a.jsx(p3,{className:"w-5 h-5"}),u&&a.jsx("span",{className:"ml-3 text-sm",children:"Logout"})]})]})]}),a.jsxs("div",{className:`flex-1 transition-all duration-300 ${u?"ml-64":"ml-16"}`,children:[a.jsx("div",{className:"bg-white shadow-sm border-b border-gray-200 sticky top-0 z-30",children:a.jsxs("div",{className:"px-4 py-4 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[!u&&a.jsx("button",{onClick:()=>d(!0),className:"p-2 mr-3 hover:bg-gray-100 rounded-lg transition-colors",title:"Expand sidebar",children:a.jsx(GV,{className:"w-5 h-5 text-gray-700"})}),a.jsx("button",{onClick:()=>d(!u),className:"p-2 mr-3 hover:bg-gray-100 rounded-lg lg:hidden",children:a.jsx(oy,{className:"w-5 h-5"})}),a.jsx("h1",{className:"text-xl font-semibold text-gray-900",children:((x=p.find(w=>w.id===l))==null?void 0:x.label)||"Dashboard"})]}),a.jsxs("div",{className:"flex items-center space-x-3",children:[a.jsx("button",{className:"p-2 hover:bg-gray-100 rounded-full transition-colors",children:a.jsx(yA,{className:"w-5 h-5 text-gray-600"})}),a.jsx("div",{className:"w-8 h-8 bg-gradient-to-br from-brand-yellow to-yellow-400 rounded-full flex items-center justify-center",children:a.jsx("span",{className:"text-brand-premium font-medium",children:"A"})})]})]})}),a.jsx("div",{className:"p-6",children:a.jsxs("div",{className:"space-y-6 pb-24",children:[l==="overview"&&a.jsx(zee,{}),l==="analytics"&&a.jsx(fAe,{}),l==="users"&&a.jsx(Xee,{}),l==="bookings"&&a.jsx(Qee,{}
4568),l==="spaces"&&a.jsx(ate,{}),l==="rooms"&&a.jsx(ote,{}),l==="calendar"&&a.jsx(dte,{}),l==="events"&&a.jsx(ute,{}),l==="tours"&&a.jsx(hte,{}),l==="promo-codes"&&a.jsx(gte,{}),l==="currency"&&a.jsx(fte,{}),l==="images"&&a.jsx(pte,{}),l==="finances"&&a.jsx(ZTe,{}),l==="blog"&&a.jsx(yAe,{}),l==="ai-reception"&&a.jsx(jAe,{}),l==="settings"&&a.jsxs("div",{className:"bg-white rounded-xl p-6 shadow-sm",children:[a.jsx("h2",{className:"text-lg font-semibold",children:"Settings"}),a.jsx("p",{className:"text-gray-600",children:"Configure system settings and preferences."})]})]})})]})]})]}):a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center py-12 px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"max-w-md w-full space-y-8 bg-white p-8 rounded-xl shadow-card",children:[a.jsxs("div",{children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"mx-auto h-12 w-auto"}),a.jsx("h2",{className:"mt-6 text-center text-3xl font-bold text-gray-900",children:"Admin Login"})]}),i&&a.jsx("div",{className:"bg-red-50 border border-red-200 text-red-600 px-4 py-3 rounded-lg",children:i}),a.jsxs("form",{className:"mt-8 space-y-6",onSubmit:h,children:[a.jsxs("div",{className:"rounded-md shadow-sm space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"username",className:"sr-only",children:"Username"}),a.jsxs("div",{className:"relative",children:[a.jsx(Or,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),a.jsx("input",{id:"username",name:"username",type:"text",required:!0,value:n.username,onChange:w=>s({...n,username:w.target.value}),className:"appearance-none rounded-lg relative block w-full pl-10 pr-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-brand-premium focus:border-brand-premium focus:z-10 sm:text-sm",placeholder:"Username"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"sr-only",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(ga,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-5 w-5 text-gray-400"}),a.jsx("input",{id:"password",name:"password",type:"password",required:!0,value:n.password,onChange:w=>s({...n,password:w.target.value}),className:"appearance-none rounded-lg relative block w-full pl-10 pr-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 focus:outline-none focus:ring-brand-premium focus:border-brand-premium focus:z-10 sm:text-sm",placeholder:"Password"})]})]})]}),a.jsx("div",{children:a.jsx("button",{type:"submit",className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-lg text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium",children:"Sign in"})})]})]})})}function _Ae(){const t=cr(),{signIn:e}=br(),[r,n]=P.useState(""),[s,i]=P.useState(""),[o,l]=P.useState(""),[c,u]=P.useState(!1),[d,h]=P.useState(!1),m=async p=>{p.preventDefault(),l(""),u(!0);try{await e(r,s),t("/profile")}catch(x){console.error("Login error:",x),x.code==="auth/user-not-found"?l("First please sign up - this email is not registered yet."):x.code==="auth/wrong-password"?l("Incorrect password. Please try again."):x.code==="auth/invalid-email"?l("Invalid email address. Please check and try again."):x.code==="auth/too-many-requests"?l("Too many failed attempts. Please try again later."):x.code==="auth/user-disabled"?l("This account has been disabled. Please contact support."):x.code==="auth/invalid-credential"?l("First please sign up - invalid credentials."):l("First please sign up - account not found or invalid credentials.")}finally{u(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex flex-col justify-center py-8 px-4",children:a.jsxs("div",{className:"w-full max-w-md mx-auto",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"mx-auto h-12 w-auto mb-4"}),a.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white",children:"Welcome Back"}),a.jsx("p",{className:"text-white/80 mt-2",children:"Sign in to your account"})]}),a.jsxs("div",{className:"bg-white rounded-xl shadow-elevated p-6 md:p-8",children:[o&&a.jsx("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsxs("div",{className:"flex-1",children:[a.jsx("span",{className:"text-sm text-red-700",children:o}),o.includes("First please sign up")&&a.jsx("div",{className:"mt-2",children:a.jsx(st,{to:"/signup",className:"text-sm font-medium text-brand-premium hover:text-brand-blue transition-colors",children:"→ Create an account here"})})]})]})}),a.jsxs("form",{onSubmit:m,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email address"}),a.jsxs("div",{className:"relative",children:[a.jsx(Or,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:r,onChange:p=>n(p.target.value),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Enter your email"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Password"}),a.jsxs("div",{className:"relative",children:[a.jsx(ga,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"password",name:"password",type:d?"text":"password",autoComplete:"current-password",required:!0,value:s,onChange:p=>i(p.target.value),className:"appearance-none block w-full pl-10 pr-12 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Enter your password"}),a.jsx("button",{type:"button",onClick:()=>h(!d),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",children:d?a.jsx(qo,{className:"w-5 h-5"}):a.jsx(xr,{className:"w-5 h-5"})})]})]}),a.jsxs("div",{className:"flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center",children:[a.jsx("input",{id:"remember-me",name:"remember-me",type:"checkbox",className:"h-4 w-4 text-brand-premium focus:ring-brand-premium border-gray-300 rounded"}),a.jsx("label",{htmlFor:"remember-me",className:"ml-2 block text-sm text-gray-900",children:"Remember me"})]}),a.jsx("div",{className:"text-sm",children:a.jsx(st,{to:"/forgot-password",className:"font-medium text-brand-premium hover:text-brand-blue transition-colors",children:"Forgot password?"})})]}),a.jsx("div",{children:a.jsx("button",{type:"submit",disabled:c,
4568className:"w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium disabled:opacity-50 transition-colors",children:c?a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Signing in..."]}):"Sign in"})})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs("p",{className:"text-sm text-gray-600",children:["Don't have an account?"," ",a.jsx(st,{to:"/signup",className:"font-medium text-brand-premium hover:text-brand-blue transition-colors",children:"Sign up"})]})})]})]})})]})}function SAe(){const t=cr(),{signUp:e}=br(),[r,n]=P.useState("individual"),[s,i]=P.useState({email:"",password:"",confirmPassword:"",phone:"",firstName:"",lastName:"",cnp:"",city:"",county:"",companyName:"",companyType:"",position:"",industry:"",companySize:"",country:"",companyCounty:"",cui:"",website:"",linkedinProfile:""}),[o,l]=P.useState(""),[c,u]=P.useState(!1),[d,h]=P.useState(!1),[m,p]=P.useState(!1),[x,w]=P.useState(!1),[g,v]=P.useState(!1),[b,y]=P.useState(!1),[T,N]=P.useState(!1),j=["Limited Liability Company","Sole Proprietorship","Association","Joint Stock Company - JSC","Cooperative","Individual Enterprise","Family Business","Foundation","Freelancer","Branch (Subsidiary Office)"],_=["Micro (1-9 employees)","Small (10-49 employees)","Medium (50-249 employees)","Large (250+ employees)"],S=["Romania","Hungary","Germany","Austria","United Kingdom","France","Italy","Spain","Netherlands","Belgium","Other"],k=async C=>{if(C.preventDefault(),l(""),s.password!==s.confirmPassword)return l("Passwords do not match");if(s.password.length<6)return l("Password must be at least 6 characters long");if(!x)return l("Please accept the Terms and Conditions to continue");if(!g)return l("Please accept the Privacy Policy to continue");if(r==="individual"){if(!s.firstName||!s.lastName||!s.cnp||!s.city||!s.county||!s.phone)return l("Please fill in all required fields (marked with *)")}else if(!s.companyName||!s.companyType||!s.country||!s.county||!s.phone)return l("Please fill in all required company information (marked with *)");u(!0);try{const R={accountType:r,phone:s.phone,...r==="individual"?{firstName:s.firstName,lastName:s.lastName,cnp:s.cnp,city:s.city,county:s.county}:{companyName:s.companyName,companyType:s.companyType,position:s.position,industry:s.industry,companySize:s.companySize,country:s.country,county:s.county,cui:s.cui,website:s.website,linkedinProfile:s.linkedinProfile}};await e(s.email,s.password,R),t("/profile")}catch(R){console.error("Signup error:",R),R.code==="auth/email-already-in-use"?l("This email is already registered. Please use a different email or sign in."):R.code==="auth/invalid-email"?l("Invalid email address. Please check and try again."):R.code==="auth/weak-password"?l("Password is too weak. Please use a stronger password."):l("Failed to create account. Please try again.")}finally{u(!1)}},E=(C=>C.length===0?{strength:0,label:"",color:""}:C.length<6?{strength:1,label:"Too short",color:"text-red-500"}:C.length<8?{strength:2,label:"Weak",color:"text-orange-500"}:C.length<12?{strength:3,label:"Good",color:"text-yellow-500"}:{strength:4,label:"Strong",color:"text-green-500"})(s.password);return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex flex-col justify-center py-4 px-4",children:[a.jsxs("div",{className:"w-full max-w-md mx-auto flex flex-col max-h-screen",children:[a.jsxs("div",{className:"text-center mb-6 flex-shrink-0",children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"mx-auto h-10 w-auto mb-3"}),a.jsx("h2",{className:"text-xl md:text-2xl font-bold text-white",children:"Join Xponential"}),a.jsx("p",{className:"text-white/80 mt-1 text-sm",children:"Create your account to get started"})]}),a.jsxs("div",{className:"bg-white rounded-xl shadow-elevated flex-1 min-h-0 flex flex-col",children:[o&&a.jsx("div",{className:"m-4 mb-0 bg-red-50 border border-red-200 rounded-lg p-4 flex-shrink-0",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsx("span",{className:"text-sm text-red-700",children:o})]})}),a.jsx("div",{className:"flex-1 overflow-y-auto p-4 sm:p-6",style:{WebkitOverflowScrolling:"touch"},children:a.jsxs("form",{onSubmit:k,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-3",children:"Account Type"}),a.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[a.jsxs("button",{type:"button",onClick:()=>n("individual"),className:`p-4 border-2 rounded-lg text-left transition-all ${r==="individual"?"border-brand-premium bg-brand-premium/5 text-brand-premium":"border-gray-200 hover:border-gray-300"}`,children:[a.jsx(fn,{className:"w-6 h-6 mb-2"}),a.jsx("div",{className:"font-medium",children:"Individual"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Personal account"})]}),a.jsxs("button",{type:"button",onClick:()=>n("company"),className:`p-4 border-2 rounded-lg text-left transition-all ${r==="company"?"border-brand-premium bg-brand-premium/5 text-brand-premium":"border-gray-200 hover:border-gray-300"}`,children:[a.jsx(xn,{className:"w-6 h-6 mb-2"}),a.jsx("div",{className:"font-medium",children:"Company"}),a.jsx("div",{className:"text-xs text-gray-500",children:"Business account"})]})]})]}),r==="individual"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"firstName",className:"block text-sm font-medium text-gray-700 mb-2",children:"First Name *"}),a.jsxs("div",{className:"relative",children:[a.jsx(fn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"firstName",name:"firstName",type:"text",required:!0,value:s.firstName,onChange:C=>i({...s,firstName:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"John"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"lastName",className:"block text-sm font-medium text-gray-700 mb-2",children:"Last Name *"}),a.jsxs("div",{className:"relative",children:[a.jsx(fn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"lastName",name:"lastName",type:"text",required:!0,value:s.lastName,onChange:C=>i({...s,lastName:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Doe"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"cnp",className:"block text-sm font-medium text-gray-700 mb-2",children:"CNP (Personal Identification Number) *"}),a.jsxs("div",{className:"relative",children:[a.jsx(wA,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"cnp",name:"cnp",type:"text",required:!0,value:s.cnp,onChange:C=>i({...s,cnp:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"1234567890123"})]}),a.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Required for invoice purposes"})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"individualCity",className:"block text-sm font-medium text-gray-700 mb-2",children:"City *"}),a.jsxs("div",{className:"relative",children:[a.jsx(ja,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"individualCity",name:"individualCity",type:"text",required:!0,value:s.city,onChange:C=>i({...s,city:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Cluj-Napoca"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"individualCounty",className:"block text-sm font-medium text-gray-700 mb-2",children:"County/Region/State *"}),a.jsxs("div",{className:"relative",children:[a.jsx(jA,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",id:"individualCounty",name:"individualCounty",required:!0,value:s.county,onChange:C=>i({...s,county:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Cluj, California, Berlin, etc."})]})]})]})]}),r==="company"&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"companyName",className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Name *"}),a.jsxs("div",{className:"relative",children:[a.jsx(xn,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"companyName",name:"companyName",type:"text",required:!0,value:s.companyName,onChange:C=>i({...s,companyName:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Your Company Ltd."})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"companyType",className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Type *"}),a.jsxs("div",{className:"relative",children:[a.jsx(mg,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsxs("select",{id:"companyType",name:"companyType",required:!0,value:s.companyType,onCh
4568ange:C=>i({...s,companyType:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent bg-white",children:[a.jsx("option",{value:"",children:"Select type"}),j.map(C=>a.jsx("option",{value:C,children:C},C))]})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"country",className:"block text-sm font-medium text-gray-700 mb-2",children:"Country *"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ch,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsxs("select",{id:"country",name:"country",required:!0,value:s.country,onChange:C=>i({...s,country:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent bg-white",children:[a.jsx("option",{value:"",children:"Select country"}),S.map(C=>a.jsx("option",{value:C,children:C},C))]})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"companyCounty",className:"block text-sm font-medium text-gray-700 mb-2",children:"County/Region/State *"}),a.jsxs("div",{className:"relative",children:[a.jsx(jA,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{type:"text",id:"companyCounty",name:"companyCounty",required:!0,value:s.county,onChange:C=>i({...s,county:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Cluj, California, Berlin, etc."})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"position",className:"block text-sm font-medium text-gray-700 mb-2",children:"Your Position"}),a.jsxs("div",{className:"relative",children:[a.jsx(c3,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"position",name:"position",type:"text",value:s.position,onChange:C=>i({...s,position:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"CEO, Manager, etc."})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"companySize",className:"block text-sm font-medium text-gray-700 mb-2",children:"Company Size"}),a.jsxs("div",{className:"relative",children:[a.jsx(Mt,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsxs("select",{id:"companySize",name:"companySize",value:s.companySize,onChange:C=>i({...s,companySize:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent bg-white",children:[a.jsx("option",{value:"",children:"Select size"}),_.map(C=>a.jsx("option",{value:C,children:C},C))]})]})]})]}),a.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"industry",className:"block text-sm font-medium text-gray-700 mb-2",children:"Industry"}),a.jsxs("div",{className:"relative",children:[a.jsx(mg,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"industry",name:"industry",type:"text",value:s.industry,onChange:C=>i({...s,industry:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Technology, Finance, etc."})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"cui",className:"block text-sm font-medium text-gray-700 mb-2",children:"CUI Number"}),a.jsxs("div",{className:"relative",children:[a.jsx(wA,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"cui",name:"cui",type:"text",value:s.cui,onChange:C=>i({...s,cui:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"RO12345678"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"website",className:"block text-sm font-medium text-gray-700 mb-2",children:"Website or LinkedIn Profile"}),a.jsxs("div",{className:"relative",children:[a.jsx(Ch,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"website",name:"website",type:"url",value:s.website,onChange:C=>i({...s,website:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"https://company.com or LinkedIn URL"})]})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"phone",className:"block text-sm font-medium text-gray-700 mb-2",children:"Phone Number *"}),a.jsxs("div",{className:"relative",children:[a.jsx(Na,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"phone",name:"phone",type:"tel",required:!0,value:s.phone,onChange:C=>i({...s,phone:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"+40 7XX XXX XXX"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email address *"}),a.jsxs("div",{className:"relative",children:[a.jsx(Or,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:s.email,onChange:C=>i({...s,email:C.target.value}),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:r==="individual"?"[email protected]":"[email protected]"})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"password",className:"block text-sm font-medium text-gray-700 mb-2",children:"Password *"}),a.jsxs("div",{className:"relative",children:[a.jsx(ga,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"password",name:"password",type:d?"text":"password",required:!0,value:s.password,onChange:C=>i({...s,password:C.target.value}),className:"appearance-none block w-full pl-10 pr-12 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Create a strong password"}),a.jsx("button",{type:"button",onClick:()=>h(!d),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",children:d?a.jsx(qo,{className:"w-5 h-5"}):a.jsx(xr,{className:"w-5 h-5"})})]}),s.password&&a.jsxs("div",{className:"mt-2",children:[a.jsxs("div",{className:"flex items-center justify-between text-xs",children:[a.jsx("span",{className:E.color,children:E.label}),a.jsx("span",{className:"text-gray-500",children:"Min. 6 characters"})]}),a.jsx("div",{className:"mt-1 w-full bg-gray-200 rounded-full h-1",children:a.jsx("div",{className:`h-1 rounded-full transition-all ${E.strength===1?"bg-red-500 w-1/4":E.strength===2?"bg-orange-500 
4568w-2/4":E.strength===3?"bg-yellow-500 w-3/4":E.strength===4?"bg-green-500 w-full":"w-0"}`})})]})]}),a.jsxs("div",{children:[a.jsx("label",{htmlFor:"confirmPassword",className:"block text-sm font-medium text-gray-700 mb-2",children:"Confirm Password *"}),a.jsxs("div",{className:"relative",children:[a.jsx(ga,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"confirmPassword",name:"confirmPassword",type:m?"text":"password",required:!0,value:s.confirmPassword,onChange:C=>i({...s,confirmPassword:C.target.value}),className:"appearance-none block w-full pl-10 pr-12 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Confirm your password"}),a.jsx("button",{type:"button",onClick:()=>p(!m),className:"absolute right-3 top-1/2 transform -translate-y-1/2 text-gray-400 hover:text-gray-600",children:m?a.jsx(qo,{className:"w-5 h-5"}):a.jsx(xr,{className:"w-5 h-5"})})]}),s.confirmPassword&&a.jsx("div",{className:"mt-2 flex items-center text-xs",children:s.password===s.confirmPassword?a.jsxs("div",{className:"flex items-center text-green-600",children:[a.jsx(qr,{className:"w-4 h-4 mr-1"}),"Passwords match"]}):a.jsxs("div",{className:"flex items-center text-red-600",children:[a.jsx(pt,{className:"w-4 h-4 mr-1"}),"Passwords don't match"]})})]}),a.jsx("div",{className:"h-4"}),a.jsxs("div",{className:"bg-gray-50 rounded-lg p-4 border border-gray-200",children:[a.jsx("h4",{className:"font-medium text-gray-900 mb-3",children:"Legal Agreement"}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start",children:[a.jsx("input",{id:"terms-checkbox",type:"checkbox",checked:x,onChange:C=>w(C.target.checked),className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium mt-0.5"}),a.jsxs("label",{htmlFor:"terms-checkbox",className:"ml-2 text-sm text-gray-700",children:["I accept the"," ",a.jsx("button",{type:"button",onClick:()=>y(!0),className:"text-brand-premium hover:text-brand-blue underline font-medium",children:"Terms and Conditions"})," ","(Termeni și Condiții)"]})]}),a.jsxs("div",{className:"flex items-start",children:[a.jsx("input",{id:"privacy-checkbox",type:"checkbox",checked:g,onChange:C=>v(C.target.checked),className:"w-4 h-4 text-brand-premium border-gray-300 rounded focus:ring-brand-premium mt-0.5"}),a.jsxs("label",{htmlFor:"privacy-checkbox",className:"ml-2 text-sm text-gray-700",children:["I accept the"," ",a.jsx("button",{type:"button",onClick:()=>N(!0),className:"text-brand-premium hover:text-brand-blue underline font-medium",children:"Privacy Policy"})," ","(Politica de Confidențialitate)"]})]})]}),a.jsx("p",{className:"text-xs text-gray-500 mt-3",children:"By checking these boxes, you confirm that you have read and agree to our legal documents."})]})]})}),a.jsxs("div",{className:"flex-shrink-0 p-4 sm:p-6 border-t bg-gray-50",children:[a.jsx("button",{onClick:k,disabled:c,className:"w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium disabled:opacity-50 transition-colors",children:c?a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Creating account..."]}):`Create ${r==="individual"?"Personal":"Company"} Account`}),a.jsx("div",{className:"mt-4 text-center",children:a.jsxs("p",{className:"text-sm text-gray-600",children:["Already have an account?"," ",a.jsx(st,{to:"/login",className:"font-medium text-brand-premium hover:text-brand-blue transition-colors",children:"Sign in"})]})})]})]})]}),a.jsx(zM,{isOpen:b,onClose:()=>y(!1)}),a.jsx(HM,{isOpen:T,onClose:()=>N(!1)})]})]})}function TAe(){const{resetPassword:t}=br(),[e,r]=P.useState(""),[n,s]=P.useState(""),[i,o]=P.useState(!1),[l,c]=P.useState(!1),u=async d=>{d.preventDefault(),s(""),c(!0);try{await t(e),o(!0)}catch(h){console.error("Reset password error:",h),h.code==="auth/user-not-found"?s("No account found with this email address."):h.code==="auth/invalid-email"?s("Invalid email address. Please check and try again."):h.code==="auth/too-many-requests"?s("Too many attempts. Please try again later."):h.code==="auth/missing-email"?s("Please enter your email address."):s("Failed to send reset email. Please try again.")}finally{c(!1)}};return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex flex-col justify-center py-8 px-4",children:a.jsxs("div",{className:"w-full max-w-md mx-auto",children:[a.jsxs("div",{className:"text-center mb-8",children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"mx-auto h-12 w-auto mb-4"}),a.jsx("h2",{className:"text-2xl md:text-3xl font-bold text-white",children:"Reset Your Password"}),a.jsx("p",{className:"text-white/80 mt-2",children:"Enter your email and we'll send you a reset link"})]}),a.jsx("div",{className:"bg-white rounded-xl shadow-elevated p-6 md:p-8",children:i?a.jsxs("div",{className:"text-center py-4",children:[a.jsx("div",{className:"mx-auto w-16 h-16 bg-green-100 rounded-full flex items-center justify-center mb-4",children:a.jsx(fc,{className:"w-8 h-8 text-green-600"})}),a.jsx("h3",{className:"text-lg font-semibold text-gray-900 mb-2",children:"Check your inbox"}),a.jsxs("p",{className:"text-sm text-gray-600 mb-6",children:["We sent a password reset link to"," ",a.jsx("span",{className:"font-medium text-gray-900",children:e}),". Click the link to set a new password."]}),a.jsx("p",{className:"text-xs text-gray-500 mb-6",children:"Didn't receive it? Check your spam folder or try again in a few minutes."}),a.jsxs(st,{to:"/login",className:"inline-flex items-center justify-center w-full py-3 px-4 border border-transparent roun
4568ded-lg shadow-sm text-sm font-medium text-white bg-brand-premium hover:bg-opacity-90 transition-colors",children:[a.jsx(jw,{className:"w-4 h-4 mr-2"}),"Back to sign in"]})]}):a.jsxs(a.Fragment,{children:[n&&a.jsx("div",{className:"mb-6 bg-red-50 border border-red-200 rounded-lg p-4",children:a.jsxs("div",{className:"flex items-start",children:[a.jsx(pt,{className:"w-5 h-5 text-red-500 mr-3 mt-0.5"}),a.jsx("span",{className:"text-sm text-red-700",children:n})]})}),a.jsxs("form",{onSubmit:u,className:"space-y-6",children:[a.jsxs("div",{children:[a.jsx("label",{htmlFor:"email",className:"block text-sm font-medium text-gray-700 mb-2",children:"Email address"}),a.jsxs("div",{className:"relative",children:[a.jsx(Or,{className:"w-5 h-5 absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400"}),a.jsx("input",{id:"email",name:"email",type:"email",autoComplete:"email",required:!0,value:e,onChange:d=>r(d.target.value),className:"appearance-none block w-full pl-10 pr-4 py-3 border border-gray-300 rounded-lg shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-brand-premium focus:border-transparent",placeholder:"Enter your email"})]})]}),a.jsx("button",{type:"submit",disabled:l,className:"w-full flex justify-center py-3 px-4 border border-transparent rounded-lg shadow-sm text-sm font-medium text-white bg-brand-premium hover:bg-opacity-90 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-premium disabled:opacity-50 transition-colors",children:l?a.jsxs("div",{className:"flex items-center",children:[a.jsx("div",{className:"animate-spin rounded-full h-4 w-4 border-b-2 border-white mr-2"}),"Sending..."]}):"Send reset link"})]}),a.jsx("div",{className:"mt-6 text-center",children:a.jsxs(st,{to:"/login",className:"inline-flex items-center text-sm font-medium text-brand-premium hover:text-brand-blue transition-colors",children:[a.jsx(jw,{className:"w-4 h-4 mr-1"}),"Back to sign in"]})})]})})]})})]})}function AAe(){const t=cr();return a.jsxs(a.Fragment,{children:[a.jsx(Rr,{noIndex:!0}),a.jsx("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex items-center justify-center p-4",children:a.jsxs("div",{className:"bg-white rounded-xl shadow-elevated p-8 w-full max-w-md text-center",children:[a.jsx("div",{className:"w-20 h-20 bg-green-100 rounded-full flex items-center justify-center mx-auto mb-6",children:a.jsx(qr,{className:"w-10 h-10 text-green-500"})}),a.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-3",children:"Payment Successful!"}),a.jsx("p",{className:"text-gray-600 mb-8",children:"Thank you for your payment. Your booking has been confirmed and you'll receive a confirmation email shortly."}),a.jsxs("div",{className:"space-y-3",children:[a.jsxs("button",{onClick:()=>t("/profile"),className:"w-full flex items-center justify-center px-6 py-3 bg-brand-premium text-white rounded-lg hover:bg-opacity-90 transition-colors font-medium",children:[a.jsx(fn,{className:"w-5 h-5 mr-2"}),"View My Bookings"]}),a.jsxs("button",{onClick:()=>t("/spaces"),className:"w-full flex items-center justify-center px-6 py-3 bg-gray-100 text-gray-700 rounded-lg hover:bg-gray-200 transition-colors font-medium",children:[a.jsx(De,{className:"w-5 h-5 mr-2"}),"Book Another Space"]}),a.jsxs("button",{onClick:()=>t("/"),className:"w-full flex items-center justify-center px-6 py-3 border border-gray-300 text-gray-700 rounded-lg hover:bg-gray-50 transition-colors font-medium",children:[a.jsx(UV,{className:"w-5 h-5 mr-2"}),"Back to Home"]})]}),a.jsx("div",{className:"mt-8 p-4 bg-gray-50 rounded-lg",children:a.jsxs("p",{className:"text-sm text-gray-600",children:[a.jsx("strong",{children:"What's next?"}),a.jsx("br",{}),"Check your email for booking details and access instructions. You can also view your booking in your profile."]})})]})})]})}const X9=[{id:"all",label:"All Posts"},{id:"coworking",label:"Coworking"},{id:"productivity",label:"Productivity"},{id:"startup",label:"Startup"},{id:"community",label:"Community"}],EAe={coworking:"bg-blue-100 text-blue-700",productivity:"bg-[#194b66]/10 text-[#194b66]",startup:"bg-green-100 text-green-700",community:"bg-yellow-100 text-yellow-800"};function kAe(){cr();const{user:t}=br(),[e,r]=P.useState(!1),[n,s]=P.useState(!1);return F.useEffect(()=>{const i=()=>s(window.scrollY>40);return window.addEventListener("scroll",i,{passive:!0}),()=>window.removeEventListener("scroll",i)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bg-[#194b66] text-white text-sm",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-2.5 flex items-center justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3 sm:gap-4",children:[a.jsx("a",{href:"https://www.facebook.com/xponentialtransylvania",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(wu,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.instagram.com/xponential.office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(ju,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.linkedin.com/company/xponential-transylvania-co-working-office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(pl,{className:"w-4 h-4"})})]}),a.jsx("div",{className:"hidden md:flex items-center gap-6 text-white/80 text-xs",children:a.jsx("a",{href:"mailto:[email protected]",className:"hover:text-[#F4C533] transition-colors",children:"[email protected]"})})]})}),a.jsxs("nav",{className:`sticky top-0 z-50 bg-white transition-shadow duration-300 ${n?"shadow-md":""}`,children:[a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsx(st,{to:"/",className:"flex items-center gap-2 flex-shrink-0",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential Transylvania",className:"h-10 w-auto"})}),a.jsxs("div",{className:"hidden lg:flex items-center gap-1",children:[a.jsx(st,{to:"/",className:"px-4 py-2 text-sm font-semibold text-[#194b66] hover:text-[#3ea2da] transition-colors uppercase tracking-wide",children:"Home"}),a.jsx(st,{to:"/blog",className:"px-4 py-2 text-sm font-semibold text-[#3ea2da] border-b-2 border-[#3ea2da] transition-colors uppercase tracking-wide",children:"Blog"}),a.jsx(st,{to:"/spaces",className:"px-4 py-2 text-sm font-semibold text-[#194b66] hover:text-[#3ea2da] transition-colors uppercase tracking-wide",children:"Book Now"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(st,{to:"/spaces",className:"hidden sm:inline-flex items-center px-4 py-2 bg-[#3ea2da] hover:bg-[#194b66] text-white text-sm font-semibold rounded-lg transition-colors uppercase tracking-wide",children:"Book Now"}),a.jsx("button",{onClick:()=>r(!e),className:"lg:hidden p-2 text-[#194b66]",children:e?a.jsx(Ge,{className:"w-6 h-6"}):a.jsx(oy,{className:"w-6 h-6"})})]})]})}),e&&a.jsx("div",{className:"lg:hidden bg-white border-t border-gray-100 shadow-lg",children:a.jsxs("div",{className:"px-4 py-3 space-y-1",children:[a.jsx(st,{to:"/",onClick:()=>r(!1),className:"block w-full text-left px-4 py-3 text-sm font-semibold text-[#194b66] hover:bg-[#f0f7fc] rounded-lg uppercase tracking-wide",children:"Home"}),a.jsx(st,{to:"/blog",onClick:()=>r(!1),className:"block w-full text-left px-4 py-3 text-sm font-semibold text-[#3ea2da] bg-[#f0f7fc] rounded-lg uppercase tracking-wide",children:"Blog"}),a.jsx(st,{to:"/spaces",onClick:()=>r(!1),className:"block w-full mt-2 text-center px-4 py-3 bg-[#3ea2da] text-white font-semibold rounded-lg uppercase tracking-wide",children:"Book Now"})]})})]})]})}function PAe({post:t}){var r;const e=n=>{if(!n)return"";try{return he(n.toDate?n.toDate():new Date(n),"MMM d, yyyy")}catch{return""}};return a.jsx(st,{to:`/blog/${t.slug}`,className:"block group",children:a.jsxs("article",{className:"bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 border border-gray-100",children:[a.jsxs("div",{className:"relative h-52 overflow-hidden bg-gray-100",children:[t.coverImage?a.jsx("img",{src:t.coverImage,alt:t.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"}):a.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gradient-to-br from-[#194b66]/10 to-[#3ea2da]/10",children:a.jsx(vr,{className:"w-12 h-12 text-[#3ea2da]/40"})}),a.jsx("span",{className:`absolute top-4 left-4 px-3 py-1 rounded-full text-xs font-semibold ${EAe[t.category]||"bg-gray-100 text-gray-700"}`,children:((r=X9.find(n=>n.id===t.category))==null?void 0:r.label)||t.category})]}),a.jsxs("div",{className:"p-6",children:[a.jsx("h3",{className:"text-lg font-bold text-[#194b66] mb-2 line-clamp-2 group-hover:text-[#3ea2da] transition-colors",children:t.title}),a.jsx("p",{className:"text-gray-500 text-sm leading-relaxed line-clamp-3 mb-4",children:t.excerpt}),a.jsxs("div",{className:"flex items-center justify-between pt-4 border-t border-gray-100",children:[a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-[#194b66] to-[#3ea2da] flex items-center justify-center text-white text-xs font-bold",children:t.author.charAt(0)}),a.jsxs("div",{children:[a.jsx("p",{className:"text-xs font-semibold text-gray-700",children:t.author}),a.jsx("p",{className:"text-xs text-gray-400",children:e(t.publishedAt||t.createdAt)})]})]}),a.jsxs("div",{className:"flex items-center gap-1 text-xs text-gray-400",children:[a.jsx(qe,{className:"w-3 h-3"}),a.jsxs("span",{children:[t.readTime," min"]})]})]})]})]})})}function CAe(){const{posts:t,loading:e}=V2(!0),[r,n]=P.useState("all"),[s,i]=P.useState(6),o=r==="all"?t:t.filter(c=>c.category===r),l=o.slice(0,s);return a.jsxs("div",{className:"min-h-screen bg-[#f8fafc]",children:[a.jsx(Rr,{title:"Blog",description:"Insights, tips, and stories about coworking, productivity, startups, and the business community in Cluj-Napoca from Xponential Transylvania.",canonical:"/blog"}),a.jsx(kAe,{}),a.jsxs("header",{className:"bg-gradient-to-br from-[#194b66] to-[#3ea2da] py-20 px-4 text-center",children:[a.jsx("span",{className:"inline-block px-4 py-1.5 bg-white/10 text-white/80 rounded-full text-sm font-semibold uppercase tracking-widest mb-4",children:"XPO Blog"}),a.jsx("h1",{className:"text-4xl sm:text-5xl font-bold text-white mb-4",children:"Ideas, Insights & Stories"}),a.jsx("p",{className:"text-white/70 max-w-xl mx-auto text-lg",children:"News, tips, and community stories from the Xponential coworking space in Cluj-Napoca."})]}),a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[a.jsx("div",{className:"flex flex-wrap gap-2 mb-10 justify-center",children:X9.map(c=>a.jsx("button",{onClick:()=>{n(c.id),i(6)},className:`px-5 py-2 rounded-full text-sm font-semibold transition-all duration-200 ${r===c.id?"bg-[#194b66] text-white shadow-sm":"bg-white text-gray-600 hover:bg-gray-100 border border-gray-200"}`,children:c.label},c.id))}),e?a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3,4,5,6].map(c=>a.jsx("div",{className:"bg-white rounded-2xl h-80 animate-pulse"},c))}):l.length===0?a.jsxs("div",{className:"text-center py-24",children:[a.jsx("div",{className:"w-20 h-20 bg-white rounded-full flex items-center justify-center mx-auto mb-6 shadow-sm",children:a.jsx(vr,{className:"w-10 h-10 text-gray-300"})}),a.jsx("h3",{className:"text-xl font-semibold text-gray-700 mb-2",children:"No posts yet"}),a.jsx("p",{className:"text-gray-400",children:"Check back soon for fresh content from the Xponential community."})]}):a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:l.map(c=>a.jsx(PAe,{post:c},c.id))}),o.length>s&&a.jsx("div",{className:"text-center mt-10",children:a.jsxs("button",{onClick:()=>i(c=>c+6),className:"inline-flex items-center gap-2 px-8 py-3 bg-[#194b66] text-white rounded-xl font-semibold hover:bg-[#3ea2da] transition-colors",children:["Load More",a.jsx(gs,{className:"w-4 h-4"})]})})]})]}),a.jsx("footer",{className:"bg-[#0d3347] text-white mt-16",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10",children:[a.jsxs("div",{className:"flex flex-col md:flex-row items-center justify-between gap-6",children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"h-10 w-auto"}),a.jsxs("div",{className:"flex items-center gap-4 text-white/60 text-sm flex-wrap justify-center",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(ja,{className:"w-4 h-4 text-[#3ea2da]"}),a.jsx("span",{children:"Bulevardul 21 Decembrie 1989, No. 16, Cluj-Napoca"})]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Or,{className:"w-4 h-4 text-[#3ea2da]"}),a.jsx("a",{href:"mailto:[email protected]",className:"hover:text-white transition-colors",children:"[email protected]"})]})]})]}),a.jsxs("div",{className:"mt-6 pt-6 border-t border-white/10 flex flex-wrap items-center justify-between gap-3",children:[a.jsxs("p",{className:"text-white/40 text-sm",children:["© ",new Date().getFullYear()," Xponential Transylvania. All rights reserved."]}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("img",{src:"/start4ai-logo.png",alt:"Start4AI",className:"h-5 w-auto opacity-40"}),a.jsxs("p",{className:"text-white/30 text-xs",children:["AI solution developed in partnership with"," ",a.jsx("a",{href:"https://start4ai.ro/",target:"_blank",rel:"noopener noreferrer",className:"text-white/50 hover:text-[#3ea2da] transition-colors",children:"Start4AI"}),", an AI development company based in Cluj-Napoca, Romania."]})]})]})]})})]})}function IAe(t){return/<[a-z][\s\S]*>/i.test(t)?t:t.split(`
4569
4570`).map(e=>(e=e.trim(),e?e.startsWith("### ")?`<h3>${e.slice(4)}</h3>`:e.startsWith("## ")?`<h2>${e.slice(3)}</h2>`:e.startsWith("# ")?`<h1>${e.slice(2)}</h1>`:`<p>${e.replace(/\*\*(.+?)\*\*/g,"<strong>$1</strong>").replace(/\*(.+?)\*/g,"<em>$1</em>").replace(/\[(.+?)\]\((.+?)\)/g,'<a href="$2" target="_blank" rel="noopener noreferrer">$1</a>').replace(/\n/g,"<br />")}</p>`:"")).join("")}const OAe={coworking:"Coworking & Office Spaces",productivity:"Productivity & Work Environments",startup:"Startup & Business Insights",community:"Community Events"},RAe={coworking:"bg-blue-100 text-blue-700",productivity:"bg-[#194b66]/10 text-[#194b66]",startup:"bg-green-100 text-green-700",community:"bg-yellow-100 text-yellow-800"};function DAe(t){if(!t)return"";try{return he(t.toDate?t.toDate():new Date(t),"MMMM d, yyyy")}catch{return""}}function bb(){cr();const[t,e]=P.useState(!1);return F.useEffect(()=>{const r=()=>e(window.scrollY>40);return window.addEventListener("scroll",r,{passive:!0}),()=>window.removeEventListener("scroll",r)},[]),a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"bg-[#194b66] text-white text-sm",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-2.5 flex items-center gap-4",children:[a.jsx("a",{href:"https://www.facebook.com/xponentialtransylvania",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(wu,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.instagram.com/xponential.office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(ju,{className:"w-4 h-4"})}),a.jsx("a",{href:"https://www.linkedin.com/company/xponential-transylvania-co-working-office/",target:"_blank",rel:"noopener noreferrer",className:"hover:text-[#F4C533] transition-colors",children:a.jsx(pl,{className:"w-4 h-4"})})]})}),a.jsx("nav",{className:`sticky top-0 z-50 bg-white transition-shadow duration-300 ${t?"shadow-md":""}`,children:a.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:a.jsxs("div",{className:"flex items-center justify-between h-16",children:[a.jsx(st,{to:"/",className:"flex items-center gap-2 flex-shrink-0",children:a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential Transylvania",className:"h-10 w-auto"})}),a.jsxs("div",{className:"flex items-center gap-3",children:[a.jsxs(st,{to:"/blog",className:"flex items-center gap-2 text-sm font-semibold text-[#194b66] hover:text-[#3ea2da] 
4570transition-colors",children:[a.jsx(jw,{className:"w-4 h-4"}),"Back to Blog"]}),a.jsx(st,{to:"/spaces",className:"hidden sm:inline-flex px-4 py-2 bg-[#3ea2da] hover:bg-[#194b66] text-white text-sm font-semibold rounded-lg transition-colors uppercase tracking-wide",children:"Book Now"})]})]})})})]})}function MAe(){const{slug:t}=rV(),e=cr(),[r,n]=P.useState(null),[s,i]=P.useState([]),[o,l]=P.useState(!0),[c,u]=P.useState(!1);if(P.useEffect(()=>{if(!t)return;(async()=>{try{const p=(await Zt(Be(oe,"blogPosts"))).docs.map(g=>({id:g.id,...g.data()})),x=p.find(g=>g.slug===t&&g.status==="published");if(!x){u(!0),l(!1);return}n(x);const w=p.filter(g=>g.status==="published"&&g.category===x.category&&g.id!==x.id).sort((g,v)=>{var T,N,j,_;const b=(N=(T=g.publishedAt)==null?void 0:T.toDate)!=null&&N.call(T)?g.publishedAt.toDate():new Date(g.publishedAt||0);return((_=(j=v.publishedAt)==null?void 0:j.toDate)!=null&&_.call(j)?v.publishedAt.toDate():new Date(v.publishedAt||0)).getTime()-b.getTime()}).slice(0,3);i(w)}catch(m){console.error(m),u(!0)}finally{l(!1)}})()},[t]),o)return a.jsxs("div",{className:"min-h-screen bg-[#f8fafc]",children:[a.jsx(bb,{}),a.jsx("div",{className:"max-w-3xl mx-auto px-4 py-20 text-center",children:a.jsxs("div",{className:"animate-pulse space-y-4",children:[a.jsx("div",{className:"h-8 bg-gray-200 rounded w-3/4 mx-auto"}),a.jsx("div",{className:"h-4 bg-gray-200 rounded w-1/2 mx-auto"}),a.jsx("div",{className:"h-64 bg-gray-200 rounded-2xl mt-8"})]})})]});if(c||!r)return a.jsxs("div",{className:"min-h-screen bg-[#f8fafc]",children:[a.jsx(bb,{}),a.jsxs("div",{className:"max-w-3xl mx-auto px-4 py-32 text-center",children:[a.jsx(vr,{className:"w-16 h-16 text-gray-300 mx-auto mb-6"}),a.jsx("h1",{className:"text-2xl font-bold text-gray-700 mb-3",children:"Post not found"}),a.jsx("p",{className:"text-gray-500 mb-8",children:"This article may have been removed or the link is incorrect."}),a.jsx("button",{onClick:()=>e("/blog"),className:"px-6 py-3 bg-[#194b66] text-white rounded-xl font-semibold hover:bg-[#3ea2da] transition-colors",children:"Back to Blog"})]})]});const d=r.publishedAt?(()=>{try{return(r.publishedAt.toDate?r.publishedAt.toDate():new Date(r.publishedAt)).toISOString()}catch{return}})():void 0;return a.jsxs("div",{className:"min-h-screen bg-[#f8fafc]",children:[a.jsx(Rr,{title:r.title,description:r.excerpt||r.title,canonical:`/blog/${r.slug}`,image:r.coverImage,type:"article",publishedAt:d,author:r.author}),a.jsx(YZ,{title:r.title,description:r.excerpt||r.title,slug:r.slug,coverImage:r.coverImage,publishedAt:d,author:r.author,category:r.category}),a.jsx(ZZ,{items:[{name:"Home",url:"https://xponential.ro/"},{name:"Blog",url:"https://xponential.ro/blog"}
4570,{name:r.title,url:`https://xponential.ro/blog/${r.slug}`}]}),a.jsx(bb,{}),r.coverImage&&a.jsx("div",{className:"w-full h-64 sm:h-80 lg:h-96 overflow-hidden",children:a.jsx("img",{src:r.coverImage,alt:r.title,className:"w-full h-full object-cover"})}),a.jsxs("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 py-12",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("span",{className:`inline-block px-3 py-1 rounded-full text-xs font-semibold mb-4 ${RAe[r.category]||"bg-gray-100 text-gray-700"}`,children:OAe[r.category]||r.category}),a.jsx("h1",{className:"text-3xl sm:text-4xl font-bold text-[#194b66] leading-tight mb-4",children:r.title}),a.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-500",children:[a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx("div",{className:"w-8 h-8 rounded-full bg-gradient-to-br from-[#194b66] to-[#3ea2da] flex items-center justify-center text-white text-xs font-bold",children:r.author.charAt(0)}),a.jsx("span",{className:"font-medium text-gray-700",children:r.author})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(De,{className:"w-4 h-4"}),a.jsx("span",{children:DAe(r.publishedAt||r.createdAt)})]}),a.jsxs("div",{className:"flex items-center gap-1.5",children:[a.jsx(qe,{className:"w-4 h-4"}),a.jsxs("span",{children:[r.readTime," min read"]})]})]})]}),a.jsx("div",{className:"h-px bg-gray-200 mb-8"}),a.jsx("div",{className:"prose prose-lg max-w-none prose-headings:text-[#194b66] prose-a:text-[#3ea2da] prose-strong:text-gray-900",dangerouslySetInnerHTML:{__html:IAe(r.content)}}),r.tags&&r.tags.length>0&&a.jsx("div",{className:"mt-10 pt-6 border-t border-gray-200",children:a.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[a.jsx(Ti,{className:"w-4 h-4 text-gray-400"}),r.tags.map(h=>a.jsxs("span",{className:"px-3 py-1 bg-gray-100 text-gray-600 rounded-full text-sm",children:["#",h]},h))]})}),a.jsx("div",{className:"mt-10 pt-8 border-t border-gray-200",children:a.jsxs("div",{className:"bg-gradient-to-br from-[#194b66] to-[#3ea2da] rounded-2xl p-8 text-center text-white",children:[a.jsx("h3",{className:"text-xl font-bold mb-2",children:"Work where inspiration happens"}),a.jsx("p",{className:"text-white/80 mb-6 text-sm",children:"Discover Xponential's flexible workspace options in Cluj-Napoca."}),a.jsx("button",{onClick:()=>e("/spaces"),className:"px-6 py-3 bg-white text-[#194b66] font-semibold rounded-xl hover:bg-[#F4C533] transition-colors",children:"View Spaces"})]})})]}),s.length>0&&a.jsx("div",{className:"bg-white border-t border-gray-100 py-14",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[a.jsx("h2",{className:"text-2xl font-bold text-[#194b66] mb-8",children:"Related Articles"}),a.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:s.map(h=>a.jsxs("article",{onClick:()=>{e(`/blog/${h.slug}`),window.scrollTo(0,0)},className:"cursor-pointer group bg-[#f8fafc] rounded-2xl overflow-hidden hover:shadow-md transition-all duration-300 border border-gray-100",children:[h.coverImage?a.jsx("img",{src:h.coverImage,alt:h.title,className:"w-full h-40 object-cover group-hover:scale-105 transition-transform duration-500"}):a.jsx("div",{className:"w-full h-40 bg-gradient-to-br from-[#194b66]/10 to-[#3ea2da]/10 flex items-center justify-center",children:a.jsx(vr,{className:"w-8 h-8 text-[#3ea2da]/40"})}),a.jsxs("div",{className:"p-5",children:[a.jsx("h4",{className:"font-bold text-[#194b66] line-clamp-2 group-hover:text-[#3ea2da] transition-colors text-sm",children:h.title}),a.jsx("p",{className:"text-gray-500 text-xs mt-1 line-clamp-2",children:h.excerpt}),a.jsxs("div",{className:"flex items-center gap-1 mt-3 text-xs text-gray-400",children:[a.jsx(qe,{className:"w-3 h-3"}),a.jsxs("span",{children:[h.readTime," min read"]})]})]})]},h.id))})]})}),a.jsx("footer",{className:"bg-[#0d3347] text-white",children:a.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-10 text-center",children:[a.jsx("img",{src:"/xponential_logo100px.png",alt:"Xponential",className:"h-10 w-auto mx-auto mb-4"}),a.jsxs("p",{className:"text-white/40 text-sm mb-3",children:["© ",new Date().getFullYear()," Xponential Transylvania. All rights reserved."]}),a.jsxs("div",{className:"flex items-center justify-center gap-2",children:[a.jsx("img",{src:"/start4ai-logo.png",alt:"Start4AI",className:"h-5 w-auto opacity-40"}),a.jsxs("p",{className:"text-white/30 text-xs",children:["AI solution developed in partnership with"," ",a.jsx("a",{href:"https://start4ai.ro/",target:"_blank",rel:"noopener noreferrer",className:"text-white/50 hover:text-[#3ea2da] transition-colors",children:"Start4AI"}),", an AI development company based in Cluj-Napoca, Romania."]})]})]})})]})}function $Ae(){const[t,e]=P.useState(!1),r=cr();P.useEffect(()=>{window.scrollTo(0,0)},[]);const n=s=>{sessionStorage.setItem("servicesActiveTab",String(s)),r("/services")};return a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx(Rr,{title:"About Us",description:"Learn about Xponential Transylvania — a modern coworking space in central Cluj-Napoca built for entrepreneurs, freelancers, and growing companies.",canonical:"/about"}),a.jsx(Pu,{isOpen:t,onClose:()=>e(!1)}
4570),a.jsx(Gm,{onBookTour:()=>e(!0)}),a.jsx(AM,{onBookTour:()=>e(!0),onContact:()=>r("/contact")}),a.jsx(TM,{onServiceTabClick:n}),a.jsx(Km,{})]})}function LAe(){const[t,e]=P.useState(!1),r=cr();return P.useEffect(()=>{window.scrollTo(0,0);const n=sessionStorage.getItem("servicesActiveTab");n!==null&&(sessionStorage.removeItem("servicesActiveTab"),window.dispatchEvent(new CustomEvent("selectServiceTab",{detail:{tabIndex:Number(n)}})))},[]),a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx(Rr,{title:"Workspace Services",description:"Explore workspace services at Xponential Transylvania — private offices, coworking desks, meeting rooms, and event hall in central Cluj-Napoca.",canonical:"/services"}),a.jsx(Pu,{isOpen:t,onClose:()=>e(!1)}),a.jsx(Gm,{onBookTour:()=>e(!0)}),a.jsx(EM,{onBookTour:()=>e(!0),onContact:()=>r("/contact")}),a.jsx(Km,{})]})}function FAe(){const[t,e]=P.useState(!1);return P.useEffect(()=>{window.scrollTo(0,0)},[]),a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx(Rr,{title:"Virtual Tour",description:"Take a 360° virtual tour of Xponential Transylvania and explore our modern coworking spaces, private offices, meeting rooms, and event areas in Cluj-Napoca.",canonical:"/virtual-tour"}),a.jsx(Pu,{isOpen:t,onClose:()=>e(!1)}),a.jsx(Gm,{onBookTour:()=>e(!0)}),a.jsx(kM,{}),a.jsx(Km,{})]})}function BAe(){const[t,e]=P.useState(!1);return P.useEffect(()=>{window.scrollTo(0,0)},[]),a.jsxs("div",{className:"min-h-screen bg-white",children:[a.jsx(Rr,{title:"Contact",description:"Get in touch with Xponential Transylvania. Find our address, phone, email, and opening hours. Located at Bulevardul 21 Decembrie 1989, No. 16, Cluj-Napoca.",canonical:"/contact"}),a.jsx(Pu,{isOpen:t,onClose:()=>e(!1)}),a.jsx(Gm,{onBookTour:()=>e(!0)}),a.jsx(UM,{}),a.jsx(VM,{}),a.jsx(Km,{})]})}const Y9=P.createContext(void 0);function VAe({children:t}){const{userProfile:e,updateUserProfile:r}=br(),[n,s]=P.useState({type:"none",name:"",price:0,period:"month",status:"active",meetingRoomHours:(e==null?void 0:e.meetingRoomHours)||2,totalMeetingRoomHours:(e==null?void 0:e.totalMeetingRoomHours)||2,usedMeetingRoomHours:(e==null?void 0:e.usedMeetingRoomHours)||0});F.useEffect(()=>{e&&s(h=>({...h,meetingRoomHours:e.meetingRoomHours||2,totalMeetingRoomHours:e.totalMeetingRoomHours||2,usedMeetingRoomHours:e.usedMeetingRoomHours||0}))},[e]);const i=()=>{const h=new Date,m=Rt(h,30);s(p=>({...p,status:"cancellation-pending",cancellationRequestedDate:h.toISOString(),effectiveCancellationDate:m.toISOString()}))},o=()=>{s(h=>({...h,status:"active",cancellationRequestedDate:void 0,effectiveCancellationDate:void 0}))},l=h=>{s(m=>({...m,status:"suspended",suspendedUntil:h}))},c=()=>{s(h=>({...h,status:"active",suspendedUntil:void 0}))},u=h=>{if(n.meetingRoomHours>=h){const m=n.meetingRoomHours-h,p=n.usedMeetingRoomHours+h;return s(x=>({...x,meetingRoomHours:m,usedMeetingRoomHours:p})),r({meetingRoomHours:m,usedMeetingRoomHours:p}),!0}return!1},d=h=>{const m=n.meetingRoomHours+h,p=n.totalMeetingRoomHours+h;s(x=>({...x,meetingRoomHours:m,totalMeetingRoomHours:p})),r({meetingRoomHours:m,totalMeetingRoomHours:p})};return F.useEffect(()=>{n.status==="cancellation-pending"&&n.effectiveCancellationDate&&!LM(new Date,new Date(n.effectiveCancellationDate))&&s(h=>({...h,status:"cancelled"}))},[n.status,n.effectiveCancellationDate]),a.jsx(Y9.Provider,{value:{subscription:n,cancelSubscription:i,revokeCancellation:o,suspendSubscription:l,resumeSubscription:c,useMeetingRoomHours:u,addMeetingRoomHours:d},children:t})}function UAe(){const t=P.useContext(Y9);if(t===void 0)throw new Error("useSubscription must be used within a SubscriptionProvider");return t}const zAe=P.createContext(void 0);function HAe({children:t}){const[e,r]=P.useState([]),{subscription:n,addMeetingRoomHours:s}=UAe(),i=async h=>{h.type==="space"&&h.meetingRoomHoursGranted&&h.meetingRoomHoursGranted>0&&s(h.meetingRoomHoursGranted);const m={...h,id:Math.random().toString(36).substring(2,9)};r(p=>[...p,m])},o=h=>{r(m=>m.filter(p=>p.id!==h))},l=(h,m)=>{r(p=>p.map(x=>x.id===h?{...x,status:m}:x))},c=h=>e.filter(m=>m.userId===h),u=(h,m)=>e.filter(p=>p.spaceId===h&&p.date===m),d=()=>n.meetingRoomHours;return a.jsx(zAe.Provider,{value:{bookings:e,addBooking:i,removeBooking:o,updateBookingStatus:l,getUserBookings:c,get
4570SpaceBookings:u,getRemainingMeetingRoomHours:d},children:t})}const PI="analytics_session_has_pageview";function qAe(){const t=Ds(),{user:e,userProfile:r}=br(),n=P.useRef(""),s=P.useRef(!0);P.useEffect(()=>{const i=t.pathname;if(i==="/admin"||i===n.current&&!s.current)return;n.current=i;const o=document.title||"Xponential Coworking",l=document.referrer||"direct",c=navigator.userAgent,u=G9(),d=(e==null?void 0:e.uid)||"anonymous",h=(r==null?void 0:r.displayName)||(e==null?void 0:e.displayName)||"Anonymous User",m=!!e,p=rAe(e==null?void 0:e.uid),w=!sessionStorage.getItem(`${PI}_${u}`);w&&sessionStorage.setItem(`${PI}_${u}`,"true");const g=s.current&&performance.getEntriesByType("navigation").some(b=>b.type==="reload"),v=w||g;sAe({pagePath:i,pageTitle:o,userId:d,userName:h,sessionId:u,visitorId:p,referrer:l,userAgent:c,isAuthenticated:m,isSessionStart:v}),console.log("📊 Page navigation tracked:",{page:i,user:h,session:u,visitor:p,isSessionStart:w?"YES (new session)":"NO (existing session)",isPageReload:g?"YES":"NO",countedAsVisit:v?"YES":"NO"}),s.current=!1},[t.pathname,e,r])}const WAe=45e3;function GAe(){const t=Ds(),{user:e,userProfile:r}=br(),n=P.useRef(null),s=P.useRef(G9()),i=()=>{const o=t.pathname;if(o==="/admin")return;const l=(e==null?void 0:e.uid)||"anonymous",c=(r==null?void 0:r.displayName)||(e==null?void 0:e.displayName)||"Anonymous User",u=!!e;iAe({sessionId:s.current,userId:l,userName:c,currentPage:o,isAuthenticated:u})};P.useEffect(()=>{i(),n.current=setInterval(i,WAe);const o=()=>{AI(s.current)};return window.addEventListener("beforeunload",o),()=>{n.current&&clearInterval(n.current),window.removeEventListener("beforeunload",o),AI(s.current)}},[t.pathname,e,r])}function KAe(){const t=Ds(),e=t.pathname==="/admin",r=["/","/about","/services","/virtual-tour","/contact"].includes(t.pathname),n=t.pathname==="/blog"||t.pathname.startsWith("/blog/");return qAe(),GAe(),r||n?a.jsxs(mA,{children:[a.jsx(hr,{path:"/",element:a.jsx(eee,{})}),a.jsx(hr,{path:"/about",element:a.jsx($Ae,{})}),a.jsx(hr,{path:"/services",element:a.jsx(LAe,{})}),a.jsx(hr,{path:"/virtual-tour",element:a.jsx(FAe,{})}),a.jsx(hr,{path:"/contact",element:a.jsx(BAe,{})}),a.jsx(hr,{path:"/blog",element:a.jsx(CAe,{})}),a.jsx(hr,{path:"/blog/:slug",element:a.jsx(MAe,{})})]}):a.jsxs("div",{className:"min-h-screen bg-gradient-to-180 from-[#194b66] to-[#3ea2da] flex flex-col",children:[!e&&a.jsx(uU,{}),a.jsx("main",{className:"flex-1",children:a.jsxs(mA,{children:[a.jsx(hr,{path:"/booking",element:a.jsx(ree,{})}),a.jsx(hr,{path:"/spaces",element:a.jsx(Oee,{})}),a.jsx(hr,{path:"/meeting-rooms",element:a.jsx(Dee,{})}),a.jsx(hr,{path:"/events",element:a.jsx(Mee,{})}),a.jsx(hr,{path:"/profile",element:a.jsx(Uee,{})}),a.jsx(hr,{path:"/admin",element:a.jsx(NAe,{})}),a.jsx(hr,{path:"/login",element:a.jsx(_Ae,{})}),a.jsx(hr,{path:"/signup",element:a.jsx(SAe,{})}),a.jsx(hr,{path:"/forgot-password",element:a.jsx(TAe,{})}),a.jsx(hr,{path:"/payment-success",element:a.jsx(AAe,{})})]})}),!e&&a.jsx("div",{className:"pb-16",children:a.jsxs("div",{className:"flex items-center justify-center gap-2 py-3 px-4",children:[a.jsx("img",{src:"/start4ai-logo.png",alt:"Start4AI",className:"h-5 w-auto opacity-40"}),a.jsxs("p",{className:"text-white/30 text-xs",children:["AI solution developed in partnership with"," ",a.jsx("a",{href:"https://start4ai.ro/",target:"_blank",rel:"noopener noreferrer",className:"text-white/50 hover:text-white transition-colors",children:"Start4AI"}),", an AI development company based in Cluj-Napoca, Romania."]})]})}),!e&&a.jsx(dU,{})]})}function XAe(){const[t,e]=P.useState(!0);return t?a.jsx(hU,{onComplete:()=>e(!1)}):a.jsx(WQ,{children:a.jsx(VAe,{children:a.jsx(HAe,{children:a.jsx(_V,{children:a.jsx(KAe,{})})})})})}zR(document.getElementById("root")).render(a.jsx(F.StrictMode,{children:a.jsx(YR,{children:a.jsx(XAe,{})})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.