PageSourceSearch

https://www.migusto.com.ar/cartadigital/assets/index-D8NkkKj2.js

js migusto.com.ar collected 2026-10-05 07:31:14 UTC 769,862 bytes, 414 lines download raw bytes

vendor: 5,521 bytes, lines 1-9
1var D1=Object.defineProperty;var $1=(t,e,r)=>e in t?D1(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var rc=(t,e,r)=>$1(t,typeof e!="symbol"?e+"":e,r);function z1(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 a of i.addedNodes)a.tagName==="LINK"&&a.rel==="modulepreload"&&n(a)}).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 U1=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function j0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var M0={exports:{}},ku={},D0={exports:{}},he={};/**
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 yo=Symbol.for("react.element"),B1=Symbol.for("react.portal"),F1=Symbol.for("react.fragment"),V1=Symbol.for("react.strict_mode"),W1=Symbol.for("react.profiler"),H1=Symbol.for("react.provider"),G1=Symbol.for("react.context"),q1=Symbol.for("react.forward_ref"),K1=Symbol.for("react.suspense"),J1=Symbol.for("react.memo"),Z1=Symbol.for("react.lazy"),Cp=Symbol.iterator;function Y1(t){return t===null||typeof t!="object"?null:(t=Cp&&t[Cp]||t["@@iterator"],typeof t=="function"?t:null)}var $0={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},z0=Object.assign,U0={};function $i(t,e,r){this.props=t,this.context=e,this.refs=U0,this.updater=r||$0}$i.prototype.isReactComponent={};$i.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")};$i.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function B0(){}B0.prototype=$i.prototype;function Uh(t,e,r){this.props=t,this.context=e,this.refs=U0,this.updater=r||$0}var Bh=Uh.prototype=new B0;Bh.constructor=Uh;z0(Bh,$i.prototype);Bh.isPureReactComponent=!0;var Pp=Array.isArray,F0=Object.prototype.hasOwnProperty,Fh={current:null},V0={key:!0,ref:!0,__self:!0,__source:!0};function W0(t,e,r){var n,s={},i=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)F0.call(e,n)&&!V0.hasOwnProperty(n)&&(s[n]=e[n]);var o=arguments.length-2;if(o===1)s.children=r;else if(1<o){for(var l=Array(o),u=0;u<o;u++)l[u]=arguments[u+2];s.children=l}if(t&&t.defaultProps)for(n in o=t.defaultProps,o)s[n]===void 0&&(s[n]=o[n]);return{$$typeof:yo,type:t,key:i,ref:a,props:s,_owner:Fh.current}}function X1(t,e){return{$$typeof:yo,type:t.type,key:e,ref:t.ref,props:t.props,_owner:t._owner}}function Vh(t){return typeof t=="object"&&t!==null&&t.$$typeof===yo}function Q1(t){var e={"=":"=0",":":"=2"};return"$"+t.replace(/[=:]/g,function(r){return e[r]})}var Ap=/\/+/g;function nc(t,e){return typeof t=="object"&&t!==null&&t.key!=null?Q1(""+t.key):e.toString(36)}function nl(t,e,r,n,s){var i=typeof t;(i==="undefined"||i==="boolean")&&(t=null);var a=!1;if(t===null)a=!0;else switch(i){case"string":case"number":a=!0;break;case"object":switch(t.$$typeof){case yo:case B1:a=!0}}if(a)return a=t,s=s(a),t=n===""?"."+nc(a,0):n,Pp(s)?(r="",t!=null&&(r=t.replace(Ap,"$&/")+"/"),nl(s,e,r,"",function(u){return u})):s!=null&&(Vh(s)&&(s=X1(s,r+(!s.key||a&&a.key===s.key?"":(""+s.key).replace(Ap,"$&/")+"/")+t)),e.push(s)),1;if(a=0,n=n===""?".":n+":",Pp(t))for(var o=0;o<t.length;o++){i=t[o];var l=n+nc(i,o);a+=nl(i,e,r,l,s)}else if(l=Y1(t),typeof l=="function")for(t=l.call(t),o=0;!(i=t.next()).done;)i=i.value,l=n+nc(i,o++),a+=nl(i,e,r,l,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 a}function Ro(t,e,r){if(t==null)return t;var n=[],s=0;return nl(t,n,"","",function(i){return e.call(r,i,s++)}),n}function ex(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 Tt={current:null},sl={transition:null},tx={ReactCurrentDispatcher:Tt,ReactCurrentBatchConfig:sl,ReactCurrentOwner:Fh};function H0(){throw Error("act(...) is not supported in production builds of React.")}
vendor: 4,187 bytes, lines 9-25
9he.Children={map:Ro,forEach:function(t,e,r){Ro(t,function(){e.apply(this,arguments)},r)},count:function(t){var e=0;return Ro(t,function(){e++}),e},toArray:function(t){return Ro(t,function(e){return e})||[]},only:function(t){if(!Vh(t))throw Error("React.Children.only expected to receive a single React element child.");return t}};he.Component=$i;he.Fragment=F1;he.Profiler=W1;he.PureComponent=Uh;he.StrictMode=V1;he.Suspense=K1;he.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=tx;he.act=H0;he.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=z0({},t.props),s=t.key,i=t.ref,a=t._owner;if(e!=null){if(e.ref!==void 0&&(i=e.ref,a=Fh.current),e.key!==void 0&&(s=""+e.key),t.type&&t.type.defaultProps)var o=t.type.defaultProps;for(l in e)F0.call(e,l)&&!V0.hasOwnProperty(l)&&(n[l]=e[l]===void 0&&o!==void 0?o[l]:e[l])}var l=arguments.length-2;if(l===1)n.children=r;else if(1<l){o=Array(l);for(var u=0;u<l;u++)o[u]=arguments[u+2];n.children=o}return{$$typeof:yo,type:t.type,key:s,ref:i,props:n,_owner:a}};he.createContext=function(t){return t={$$typeof:G1,_currentValue:t,_currentValue2:t,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},t.Provider={$$typeof:H1,_context:t},t.Consumer=t};he.createElement=W0;he.createFactory=function(t){var e=W0.bind(null,t);return e.type=t,e};he.createRef=function(){return{current:null}};he.forwardRef=function(t){return{$$typeof:q1,render:t}};he.isValidElement=Vh;he.lazy=function(t){return{$$typeof:Z1,_payload:{_status:-1,_result:t},_init:ex}};he.memo=function(t,e){return{$$typeof:J1,type:t,compare:e===void 0?null:e}};he.startTransition=function(t){var e=sl.transition;sl.transition={};try{t()}finally{sl.transition=e}};he.unstable_act=H0;he.useCallback=function(t,e){return Tt.current.useCallback(t,e)};he.useContext=function(t){return Tt.current.useContext(t)};he.useDebugValue=function(){};he.useDeferredValue=function(t){return Tt.current.useDeferredValue(t)};he.useEffect=function(t,e){return Tt.current.useEffect(t,e)};he.useId=function(){return Tt.current.useId()};he.useImperativeHandle=function(t,e,r){return Tt.current.useImperativeHandle(t,e,r)};he.useInsertionEffect=function(t,e){return Tt.current.useInsertionEffect(t,e)};he.useLayoutEffect=function(t,e){return Tt.current.useLayoutEffect(t,e)};he.useMemo=function(t,e){return Tt.current.useMemo(t,e)};he.useReducer=function(t,e,r){return Tt.current.useReducer(t,e,r)};he.useRef=function(t){return Tt.current.useRef(t)};he.useState=function(t){return Tt.current.useState(t)};he.useSyncExternalStore=function(t,e,r){return Tt.current.useSyncExternalStore(t,e,r)};he.useTransition=function(){return Tt.current.useTransition()};he.version="18.3.1";D0.exports=he;var P=D0.exports;const $=j0(P),rx=z1({__proto__:null,default:$},[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 nx=P,sx=Symbol.for("react.element"),ix=Symbol.for("react.fragment"),ax=Object.prototype.hasOwnProperty,ox=nx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,lx={key:!0,ref:!0,__self:!0,__source:!0};function G0(t,e,r){var n,s={},i=null,a=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)ax.call(e,n)&&!lx.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:sx,type:t,key:i,ref:a,props:s,_owner:ox.current}}ku.Fragment=ix;ku.jsx=G0;ku.jsxs=G0;M0.exports=ku;var S=M0.exports,td={},q0={exports:{}},rr={},K0={exports:{}},J0={};/**
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(D,K){var U=D.length;D.push(K);e:for(;0<U;){var W=U-1>>>1,re=D[W];if(0<s(re,K))D[W]=K,D[U]=re,U=W;else break e}}function r(D){return D.length===0?null:D[0]}
vendor: 1,377 bytes, line 25
25function n(D){if(D.length===0)return null;var K=D[0],U=D.pop();if(U!==K){D[0]=U;e:for(var W=0,re=D.length,oe=re>>>1;W<oe;){var ce=2*(W+1)-1,xe=D[ce],nt=ce+1,ae=D[nt];if(0>s(xe,U))nt<re&&0>s(ae,xe)?(D[W]=ae,D[nt]=U,W=nt):(D[W]=xe,D[ce]=U,W=ce);else if(nt<re&&0>s(ae,U))D[W]=ae,D[nt]=U,W=nt;else break e}}return K}function s(D,K){var U=D.sortIndex-K.sortIndex;return U!==0?U:D.id-K.id}if(typeof performance=="object"&&typeof performance.now=="function"){var i=performance;t.unstable_now=function(){return i.now()}}else{var a=Date,o=a.now();t.unstable_now=function(){return a.now()-o}}var l=[],u=[],c=1,d=null,f=3,m=!1,y=!1,g=!1,b=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,v=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function w(D){for(var K=r(u);K!==null;){if(K.callback===null)n(u);else if(K.startTime<=D)n(u),K.sortIndex=K.expirationTime,e(l,K);else break;K=r(u)}}function h(D){if(g=!1,w(D),!y)if(r(l)!==null)y=!0,X(p);else{var K=r(u);K!==null&&q(h,K.startTime-D)}}function p(D,K){y=!1,g&&(g=!1,_(T),T=-1),m=!0;var U=f;try{for(w(K),d=r(l);d!==null&&(!(d.expirationTime>K)||D&&!j());){var W=d.callback;if(typeof W=="function"){d.callback=null,f=d.priorityLevel;
vendor: 9,111 bytes, lines 25-34
25var re=W(d.expirationTime<=K);K=t.unstable_now(),typeof re=="function"?d.callback=re:d===r(l)&&n(l),w(K)}else n(l);d=r(l)}if(d!==null)var oe=!0;else{var ce=r(u);ce!==null&&q(h,ce.startTime-K),oe=!1}return oe}finally{d=null,f=U,m=!1}}var x=!1,k=null,T=-1,E=5,R=-1;function j(){return!(t.unstable_now()-R<E)}function L(){if(k!==null){var D=t.unstable_now();R=D;var K=!0;try{K=k(!0,D)}finally{K?O():(x=!1,k=null)}}else x=!1}var O;if(typeof v=="function")O=function(){v(L)};else if(typeof MessageChannel<"u"){var N=new MessageChannel,M=N.port2;N.port1.onmessage=L,O=function(){M.postMessage(null)}}else O=function(){b(L,0)};function X(D){k=D,x||(x=!0,O())}function q(D,K){T=b(function(){D(t.unstable_now())},K)}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(D){D.callback=null},t.unstable_continueExecution=function(){y||m||(y=!0,X(p))},t.unstable_forceFrameRate=function(D){0>D||125<D?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):E=0<D?Math.floor(1e3/D):5},t.unstable_getCurrentPriorityLevel=function(){return f},t.unstable_getFirstCallbackNode=function(){return r(l)},t.unstable_next=function(D){switch(f){case 1:case 2:case 3:var K=3;break;default:K=f}var U=f;f=K;try{return D()}finally{f=U}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(D,K){switch(D){case 1:case 2:case 3:case 4:case 5:break;default:D=3}var U=f;f=D;try{return K()}finally{f=U}},t.unstable_scheduleCallback=function(D,K,U){var W=t.unstable_now();switch(typeof U=="object"&&U!==null?(U=U.delay,U=typeof U=="number"&&0<U?W+U:W):U=W,D){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=U+re,D={id:c++,callback:K,priorityLevel:D,startTime:U,expirationTime:re,sortIndex:-1},U>W?(D.sortIndex=U,e(u,D),r(l)===null&&D===r(u)&&(g?(_(T),T=-1):g=!0,q(h,U-W))):(D.sortIndex=re,e(l,D),y||m||(y=!0,X(p))),D},t.unstable_shouldYield=j,t.unstable_wrapCallback=function(D){var K=f;return function(){var U=f;f=K;try{return D.apply(this,arguments)}finally{f=U}}}})(J0);K0.exports=J0;var ux=K0.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 cx=P,Xt=ux;function z(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 Z0=new Set,Na={};function Os(t,e){xi(t,e),xi(t+"Capture",e)}function xi(t,e){for(Na[t]=e,t=0;t<e.length;t++)Z0.add(e[t])}var rn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),rd=Object.prototype.hasOwnProperty,dx=/^[: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]*$/,Rp={},Op={};function hx(t){return rd.call(Op,t)?!0:rd.call(Rp,t)?!1:dx.test(t)?Op[t]=!0:(Rp[t]=!0,!1)}function fx(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 px(t,e,r,n){if(e===null||typeof e>"u"||fx(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 Ct(t,e,r,n,s,i,a){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=a}var ft={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ft[t]=new Ct(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ft[e]=new Ct(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ft[t]=new Ct(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ft[t]=new Ct(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){ft[t]=new Ct(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ft[t]=new Ct(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ft[t]=new Ct(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ft[t]=new Ct(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ft[t]=new Ct(t,5,!1,t.toLowerCase(),null,!1,!1)});var Wh=/[\-:]([a-z])/g;function Hh(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(Wh,Hh);ft[e]=new Ct(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(Wh,Hh);ft[e]=new Ct(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(Wh,Hh);ft[e]=new Ct(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ft[t]=new Ct(t,1,!1,t.toLowerCase(),null,!1,!1)});ft.xlinkHref=new Ct("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ft[t]=new Ct(t,1,!1,t.toLowerCase(),null,!0,!0)});function Gh(t,e,r,n){var s=ft.hasOwnProperty(e)?ft[e]:null;(s!==null?s.type!==0:n||!(2<e.length)||e[0]!=="o"&&e[0]!=="O"||e[1]!=="n"&&e[1]!=="N")&&(px(e,r,s,n)&&(r=null),n||s===null?hx(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 cn=cx.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,Oo=Symbol.for("react.element"),Ks=Symbol.for("react.portal"),Js=Symbol.for("react.fragment"),qh=Symbol.for("react.strict_mode"),nd=Symbol.for("react.profiler"),Y0=Symbol.for("react.provider"),X0=Symbol.for("react.context"),Kh=Symbol.for("react.forward_ref"),sd=Symbol.for("react.suspense"),id=Symbol.for("react.suspense_list"),Jh=Symbol.for("react.memo"),fn=Symbol.for("react.lazy"),Q0=Symbol.for("react.offscreen"),Ip=Symbol.iterator;function Hi(t){return t===null||typeof t!="object"?null:(t=Ip&&t[Ip]||t["@@iterator"],typeof t=="function"?t:null)}var $e=Object.assign,sc;function na(t){if(sc===void 0)try{throw Error()}catch(r){var e=r.stack.trim().match(/\n( *(at )?)/);sc=e&&e[1]||""}return`
34`+sc+t}var ic=!1;function ac(t,e){if(!t||ic)return"";ic=!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: 16,737 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`),a=s.length-1,o=i.length-1;1<=a&&0<=o&&s[a]!==i[o];)o--;for(;1<=a&&0<=o;a--,o--)if(s[a]!==i[o]){if(a!==1||o!==1)do if(a--,o--,0>o||s[a]!==i[o]){var l=`
37`+s[a].replace(" at new "," at ");return t.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",t.displayName)),l}while(1<=a&&0<=o);break}}}finally{ic=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?na(t):""}function mx(t){switch(t.tag){case 5:return na(t.type);case 16:return na("Lazy");case 13:return na("Suspense");case 19:return na("SuspenseList");case 0:case 2:case 15:return t=ac(t.type,!1),t;case 11:return t=ac(t.type.render,!1),t;case 1:return t=ac(t.type,!0),t;default:return""}}function ad(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 Js:return"Fragment";case Ks:return"Portal";case nd:return"Profiler";case qh:return"StrictMode";case sd:return"Suspense";case id:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case X0:return(t.displayName||"Context")+".Consumer";case Y0:return(t._context.displayName||"Context")+".Provider";case Kh:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Jh:return e=t.displayName||null,e!==null?e:ad(t.type)||"Memo";case fn:e=t._payload,t=t._init;try{return ad(t(e))}catch{}}return null}function gx(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 ad(e);case 8:return e===qh?"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 Bn(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function ev(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function vx(t){var e=ev(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(a){n=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function Io(t){t._valueTracker||(t._valueTracker=vx(t))}function tv(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=ev(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Sl(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 od(t,e){var r=e.checked;return $e({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function Np(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=Bn(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 rv(t,e){e=e.checked,e!=null&&Gh(t,"checked",e,!1)}function ld(t,e){rv(t,e);var r=Bn(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")?ud(t,e.type,r):e.hasOwnProperty("defaultValue")&&ud(t,e.type,Bn(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function Lp(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 ud(t,e,r){(e!=="number"||Sl(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var sa=Array.isArray;function ci(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=""+Bn(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 cd(t,e){if(e.dangerouslySetInnerHTML!=null)throw Error(z(91));return $e({},e,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function jp(t,e){var r=e.value;if(r==null){if(r=e.children,e=e.defaultValue,r!=null){if(e!=null)throw Error(z(92));if(sa(r)){if(1<r.length)throw Error(z(93));r=r[0]}e=r}e==null&&(e=""),r=e}t._wrapperState={initialValue:Bn(r)}}function nv(t,e){var r=Bn(e.value),n=Bn(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 Mp(t){var e=t.textContent;e===t._wrapperState.initialValue&&e!==""&&e!==null&&(t.value=e)}function sv(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 dd(t,e){return t==null||t==="http://www.w3.org/1999/xhtml"?sv(e):t==="http://www.w3.org/2000/svg"&&e==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var No,iv=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(No=No||document.createElement("div"),No.innerHTML="<svg>"+e.valueOf().toString()+"</svg>",e=No.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function La(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var pa={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},yx=["Webkit","ms","Moz","O"];Object.keys(pa).forEach(function(t){yx.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),pa[e]=pa[t]})});function av(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||pa.hasOwnProperty(t)&&pa[t]?(""+e).trim():e+"px"}function ov(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,s=av(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,s):t[r]=s}}var wx=$e({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 hd(t,e){if(e){if(wx[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(z(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(z(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(z(61))}if(e.style!=null&&typeof e.style!="object")throw Error(z(62))}}function fd(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 pd=null;function Zh(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var md=null,di=null,hi=null;function Dp(t){if(t=xo(t)){if(typeof md!="function")throw Error(z(280));var e=t.stateNode;e&&(e=Au(e),md(t.stateNode,t.type,e))}}function lv(t){di?hi?hi.push(t):hi=[t]:di=t}function uv(){if(di){var t=di,e=hi;if(hi=di=null,Dp(t),e)for(t=0;t<e.length;t++)Dp(e[t])}}function cv(t,e){return t(e)}function dv(){}var oc=!1;function hv(t,e,r){if(oc)return t(e,r);oc=!0;try{return cv(t,e,r)}finally{oc=!1,(di!==null||hi!==null)&&(dv(),uv())}}function ja(t,e){var r=t.stateNode;if(r===null)return null;var n=Au(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(z(231,e,typeof r));return r}var gd=!1;if(rn)try{var Gi={};Object.defineProperty(Gi,"passive",{get:function(){gd=!0}}),window.addEventListener("test",Gi,Gi),window.removeEventListener("test",Gi,Gi)}catch{gd=!1}function _x(t,e,r,n,s,i,a,o,l){var u=Array.prototype.slice.call(arguments,3);try{e.apply(r,u)}catch(c){this.onError(c)}}var ma=!1,kl=null,El=!1,vd=null,xx={onError:function(t){ma=!0,kl=t}};function bx(t,e,r,n,s,i,a,o,l){ma=!1,kl=null,_x.apply(xx,arguments)}function Sx(t,e,r,n,s,i,a,o,l){if(bx.apply(this,arguments),ma){if(ma){var u=kl;ma=!1,kl=null}else throw Error(z(198));El||(El=!0,vd=u)}}function Is(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 fv(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 $p(t){if(Is(t)!==t)throw Error(z(188))}function kx(t){var e=t.alternate;if(!e){if(e=Is(t),e===null)throw Error(z(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 $p(s),t;if(i===n)return $p(s),e;i=i.sibling}throw Error(z(188))}if(r.return!==n.return)r=s,n=i;else{for(var a=!1,o=s.child;o;){if(o===r){a=!0,r=s,n=i;break}if(o===n){a=!0,n=s,r=i;break}o=o.sibling}if(!a){for(o=i.child;o;){if(o===r){a=!0,r=i,n=s;break}if(o===n){a=!0,n=i,r=s;break}o=o.sibling}if(!a)throw Error(z(189))}}if(r.alternate!==n)throw Error(z(190))}if(r.tag!==3)throw Error(z(188));return r.stateNode.current===r?t:e}function pv(t){return t=kx(t),t!==null?mv(t):null}function mv(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var e=mv(t);if(e!==null)return e;t=t.sibling}return null}var gv=Xt.unstable_scheduleCallback,zp=Xt.unstable_cancelCallback,Ex=Xt.unstable_shouldYield,Tx=Xt.unstable_requestPaint,Ge=Xt.unstable_now,Cx=Xt.unstable_getCurrentPriorityLevel,Yh=Xt.unstable_ImmediatePriority,vv=Xt.unstable_UserBlockingPriority,Tl=Xt.unstable_NormalPriority,Px=Xt.unstable_LowPriority,yv=Xt.unstable_IdlePriority,Eu=null,zr=null;function Ax(t){if(zr&&typeof zr.onCommitFiberRoot=="function")try{zr.onCommitFiberRoot(Eu,t,void 0,(t.current.flags&128)===128)}catch{}}var Pr=Math.clz32?Math.clz32:Ix,Rx=Math.log,Ox=Math.LN2;function Ix(t){return t>>>=0,t===0?32:31-(Rx(t)/Ox|0)|0}var Lo=64,jo=4194304;function ia(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 Cl(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,s=t.suspendedLanes,i=t.pingedLanes,a=r&268435455;if(a!==0){var o=a&~s;o!==0?n=ia(o):(i&=a,i!==0&&(n=ia(i)))}else a=r&~s,a!==0?n=ia(a):i!==0&&(n=ia(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-Pr(e),s=1<<r,n|=t[r],e&=~s;return n}function Nx(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 Lx(t,e){for(var r=t.suspendedLanes,n=t.pingedLanes,s=t.expirationTimes,i=t.pendingLanes;0<i;){var a=31-Pr(i),o=1<<a,l=s[a];l===-1?(!(o&r)||o&n)&&(s[a]=Nx(o,e)):l<=e&&(t.expiredLanes|=o),i&=~o}}function yd(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function wv(){var t=Lo;return Lo<<=1,!(Lo&4194240)&&(Lo=64),t}function lc(t){for(var e=[],r=0;31>r;r++)e.push(t);return e}function wo(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-Pr(e),t[e]=r}function jx(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-Pr(r),i=1<<s;e[s]=0,n[s]=-1,t[s]=-1,r&=~i}}function Xh(t,e){var r=t.entangledLanes|=e;for(t=t.entanglements;r;){var n=31-Pr(r),s=1<<n;s&e|t[n]&e&&(t[n]|=e),r&=~s}}var _e=0;function _v(t){return t&=-t,1<t?4<t?t&268435455?16:536870912:4:1}var xv,Qh,bv,Sv,kv,wd=!1,Mo=[],An=null,Rn=null,On=null,Ma=new Map,Da=new Map,vn=[],Mx="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 Up(t,e){switch(t){case"focusin":case"focusout":An=null;break;case"dragenter":case"dragleave":Rn=null;break;case"mouseover":case"mouseout":On=null;break;case"pointerover":case"pointerout":Ma.delete(e.pointerId);break;case"gotpointercapture":case"lostpointercapture":Da.delete(e.pointerId)}}function qi(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=xo(e),e!==null&&Qh(e)),t):(t.eventSystemFlags|=n,e=t.targetContainers,s!==null&&e.indexOf(s)===-1&&e.push(s),t)}function Dx(t,e,r,n,s){switch(e){case"focusin":return An=qi(An,t,e,r,n,s),!0;case"dragenter":return Rn=qi(Rn,t,e,r,n,s),!0;case"mouseover":return On=qi(On,t,e,r,n,s),!0;case"pointerover":var i=s.pointerId;return Ma.set(i,qi(Ma.get(i)||null,t,e,r,n,s)),!0;case"gotpointercapture":return i=s.pointerId,Da.set(i,qi(Da.get(i)||null,t,e,r,n,s)),!0}return!1}function Ev(t){var e=ds(t.target);if(e!==null){var r=Is(e);if(r!==null){if(e=r.tag,e===13){if(e=fv(r),e!==null){t.blockedOn=e,kv(t.priority,function(){bv(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 il(t){if(t.blockedOn!==null)return!1;for(var e=t.targetContainers;0<e.length;){var r=_d(t.domEventName,t.eventSystemFlags,e[0],t.nativeEvent);if(r===null){r=t.nativeEvent;var n=new r.constructor(r.type,r);pd=n,r.target.dispatchEvent(n),pd=null}else return e=xo(r),e!==null&&Qh(e),t.blockedOn=r,!1;e.shift()}return!0}function Bp(t,e,r){il(t)&&r.delete(e)}function $x(){wd=!1,An!==null&&il(An)&&(An=null),Rn!==null&&il(Rn)&&(Rn=null),On!==null&&il(On)&&(On=null),Ma.forEac
vendor: 11,841 bytes, line 37
37h(Bp),Da.forEach(Bp)}function Ki(t,e){t.blockedOn===e&&(t.blockedOn=null,wd||(wd=!0,Xt.unstable_scheduleCallback(Xt.unstable_NormalPriority,$x)))}function $a(t){function e(s){return Ki(s,t)}if(0<Mo.length){Ki(Mo[0],t);for(var r=1;r<Mo.length;r++){var n=Mo[r];n.blockedOn===t&&(n.blockedOn=null)}}for(An!==null&&Ki(An,t),Rn!==null&&Ki(Rn,t),On!==null&&Ki(On,t),Ma.forEach(e),Da.forEach(e),r=0;r<vn.length;r++)n=vn[r],n.blockedOn===t&&(n.blockedOn=null);for(;0<vn.length&&(r=vn[0],r.blockedOn===null);)Ev(r),r.blockedOn===null&&vn.shift()}var fi=cn.ReactCurrentBatchConfig,Pl=!0;function zx(t,e,r,n){var s=_e,i=fi.transition;fi.transition=null;try{_e=1,ef(t,e,r,n)}finally{_e=s,fi.transition=i}}function Ux(t,e,r,n){var s=_e,i=fi.transition;fi.transition=null;try{_e=4,ef(t,e,r,n)}finally{_e=s,fi.transition=i}}function ef(t,e,r,n){if(Pl){var s=_d(t,e,r,n);if(s===null)yc(t,e,n,Al,r),Up(t,n);else if(Dx(s,t,e,r,n))n.stopPropagation();else if(Up(t,n),e&4&&-1<Mx.indexOf(t)){for(;s!==null;){var i=xo(s);if(i!==null&&xv(i),i=_d(t,e,r,n),i===null&&yc(t,e,n,Al,r),i===s)break;s=i}s!==null&&n.stopPropagation()}else yc(t,e,n,null,r)}}var Al=null;function _d(t,e,r,n){if(Al=null,t=Zh(n),t=ds(t),t!==null)if(e=Is(t),e===null)t=null;else if(r=e.tag,r===13){if(t=fv(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 Al=t,null}function Tv(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(Cx()){case Yh:return 1;case vv:return 4;case Tl:case Px:return 16;case yv:return 536870912;default:return 16}default:return 16}}var xn=null,tf=null,al=null;function Cv(){if(al)return al;var t,e=tf,r=e.length,n,s="value"in xn?xn.value:xn.textContent,i=s.length;for(t=0;t<r&&e[t]===s[t];t++);var a=r-t;for(n=1;n<=a&&e[r-n]===s[i-n];n++);return al=s.slice(t,1<n?1-n:void 0)}function ol(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 Do(){return!0}function Fp(){return!1}function nr(t){function e(r,n,s,i,a){this._reactName=r,this._targetInst=s,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null;for(var o in t)t.hasOwnProperty(o)&&(r=t[o],this[o]=r?r(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented!=null?i.defaultPrevented:i.returnValue===!1)?Do:Fp,this.isPropagationStopped=Fp,this}return $e(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=Do)},stopPropagation:function(){var r=this.nativeEvent;r&&(r.stopPropagation?r.stopPropagation():typeof r.cancelBubble!="unknown"&&(r.cancelBubble=!0),this.isPropagationStopped=Do)},persist:function(){},isPersistent:Do}),e}var zi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},rf=nr(zi),_o=$e({},zi,{view:0,detail:0}),Bx=nr(_o),uc,cc,Ji,Tu=$e({},_o,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:nf,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!==Ji&&(Ji&&t.type==="mousemove"?(uc=t.screenX-Ji.screenX,cc=t.screenY-Ji.screenY):cc=uc=0,Ji=t),uc)},movementY:function(t){return"movementY"in t?t.movementY:cc}}),Vp=nr(Tu),Fx=$e({},Tu,{dataTransfer:0}),Vx=nr(Fx),Wx=$e({},_o,{relatedTarget:0}),dc=nr(Wx),Hx=$e({},zi,{animationName:0,elapsedTime:0,pseudoElement:0}),Gx=nr(Hx),qx=$e({},zi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Kx=nr(qx),Jx=$e({},zi,{data:0}),Wp=nr(Jx),Zx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Yx={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"},Xx={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Qx(t){var e=this.nativeEvent;return e.getModifierState?e.getModifierState(t):(t=Xx[t])?!!e[t]:!1}function nf(){return Qx}var eb=$e({},_o,{key:function(t){if(t.key){var e=Zx[t.key]||t.key;if(e!=="Unidentified")return e}return t.type==="keypress"?(t=ol(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Yx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:nf,charCode:function(t){return t.type==="keypress"?ol(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?ol(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),tb=nr(eb),rb=$e({},Tu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Hp=nr(rb),nb=$e({},_o,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:nf}),sb=nr(nb),ib=$e({},zi,{propertyName:0,elapsedTime:0,pseudoElement:0}),ab=nr(ib),ob=$e({},Tu,{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}),lb=nr(ob),ub=[9,13,27,32],sf=rn&&"CompositionEvent"in window,ga=null;rn&&"documentMode"in document&&(ga=document.documentMode);var cb=rn&&"TextEvent"in window&&!ga,Pv=rn&&(!sf||ga&&8<ga&&11>=ga),Gp=" ",qp=!1;function Av(t,e){switch(t){case"keyup":return ub.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rv(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Zs=!1;function db(t,e){switch(t){case"compositionend":return Rv(e);case"keypress":return e.which!==32?null:(qp=!0,Gp);case"textInput":return t=e.data,t===Gp&&qp?null:t;default:return null}}function hb(t,e){if(Zs)return t==="compositionend"||!sf&&Av(t,e)?(t=Cv(),al=tf=xn=null,Zs=!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 Pv&&e.locale!=="ko"?null:e.data;default:return null}}var fb={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 Kp(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e==="input"?!!fb[t.type]:e==="textarea"}function Ov(t,e,r,n){lv(n),e=Rl(e,"onChange"),0<e.length&&(r=new rf("onChange","change",null,r,n),t.push({event:r,listeners:e}))}var va=null,za=null;function pb(t){Fv(t,0)}function Cu(t){var e=Qs(t);if(tv(e))return t}function mb(t,e){if(t==="change")return e}var Iv=!1;if(rn){var hc;if(rn){var fc="oninput"in document;if(!fc){var Jp=document.createElement("div");Jp.setAttribute("oninput","return;"),fc=typeof Jp.oninput=="function"}hc=fc}else hc=!1;Iv=hc&&(!document.documentMode||9<document.documentMode)}function Zp(){va&&(va.detachEvent("onpropertychange",Nv),za=va=null)}function Nv(t){if(t.propertyName==="value"&&Cu(za)){var e=[];Ov(e,za,t,Zh(t)),hv(pb,e)}}function gb(t,e,r){t==="focusin"?(Zp(),va=e,za=r,va.attachEvent("onpropertychange",Nv)):t==="focusout"&&Zp()}function vb(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Cu(za)}function yb(t,e){if(t==="click")return Cu(e)}function wb(t,e){if(t==="input"||t==="change")return Cu(e)}function _b(t,e){return t===e&&(t!==0||1/t===1/e)||t!==t&&e!==e}var Rr=typeof Object.is=="function"?Object.is:_b;function Ua(t,e){if(Rr(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(!rd.call(e,s)||!Rr(t[s],e[s]))return!1}return!0}function Yp(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Xp(t,e){var r=Yp(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=Yp(r)}}function Lv(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?Lv(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function jv(){for(var t=window,e=Sl();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Sl(t.document)}return e}function af(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 xb(t){var e=jv(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&Lv(r.ownerDocument.documentElement,r)){if(n!==null&&af(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=Xp(r,i);var a=Xp(r,n);s&&a&&(t.rangeCount!==1||t.anchorNode!==s.node||t.anchorOffset!==s.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(s.node,s.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.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 bb=rn&&"documentMode"in document&&11>=document.documentMode,Ys=null,xd=null,ya=null,bd=!1;function Qp(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;bd||Ys==null||Ys!==Sl(n)||(n=Ys,"selectionStart"in n&&af(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}),ya&&Ua(ya,n)||(ya=n,n=Rl(xd,"onSelect"),0<n.length&&(e=new rf("onSelect","select",null,e,r),t.push({event:e,listeners:n}),e.target=Ys)))}function $o(t,e){var r={};return r[t.toLowerCase()]=e.toLowerCase(),r["Webkit"+t]="webkit"+e,r["Moz"+t]="moz"+e,r}var Xs={animationend:$o("Animation","AnimationEnd"),animationiteration:$o("Animation","AnimationIteration"),animationstart:$o("Animation","AnimationStart"),transitionend:$o("Transition","TransitionEnd")},pc={},Mv={};rn&&(Mv=document.createElement("div").style,"AnimationEvent"in window||(delete Xs.animationend.animation,delete Xs.animationiteration.animation,delete Xs.animationstart.animation),"TransitionEvent"in window||delete Xs.transitionend.transition);function Pu(t){if(pc[t])return pc[t];if(!Xs[t])return t;var e=Xs[t],r;for(r in e)if(e.hasOwnProperty(r)&&r in Mv)return pc[t]=e[r];return t}var Dv=Pu("animationend"),$v=Pu("animationiteration"),zv=Pu("animationstart"),Uv=Pu("transitionend"),Bv=new Map,em="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 Jn(t,e){Bv.set(t,e),Os(e,[t])}for(var mc=0;mc<em.length;mc++){var gc=em[mc],Sb=gc.toLowerCase(),kb=gc[0].toUpperCase()+gc.slice(1);Jn(Sb,"on"+kb)}Jn(Dv,"onAnimationEnd");Jn($v,"onAnimationIteration");Jn(zv,"onAnimationStart");Jn("dblclick","onDoubleClick");Jn("focusin","onFocus");Jn("focusout","onBlur");Jn(Uv,"onTransitionEnd");xi("onMouseEnter",["mouseout","mouseover"]);xi("onMouseLeave",["mouseout","mouseover"]);xi("onPointerEnter",["pointerout","pointerover"]);xi("onPointerLeave",["pointerout","pointerover"]);Os("onChange","change click focusin focusout input keydown keyup selectionchange".split(" "));Os("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" "));Os("onBeforeInput",["compositionend","keypress","textInput","paste"]);Os("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" "));Os("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" "));Os("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var aa="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(" "),Eb=new Set("cancel close invalid load scroll toggle".split(" ").concat(aa));function tm(t,e,r){var n=t.type||"unknown-event";t.currentTarget=r,Sx(n,e,void 0,t),t.currentTarget=null}function Fv(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 a=n.length-1;0<=a;a--){var o=n[a],l=o.instance,u=o.currentTarget;if(o=o.listener,l!==i&&s.isPropagationStopped())break e;tm(s,o,u),i=l}else for(a=0;a<n.length;a++){if(o=n[a],l=o.instance,u=o.currentTarget,o=o.listener,l!==i&&s.isPropagationStopped())break e;tm(s,o,u),i=l}}}if(El)throw t=vd,El=!1,vd=null,t}function Ce(t,e){var r=e[Cd];r===void 0&&(r=e[Cd]=new Set);var n=t+"__bubble";r.has(n)||(Vv(e,t,2,!1),r.add(n))}function vc(t,e,r){var n=0;e&&(n|=4),Vv(r,t,n,e)}var zo="_reactListening"+Math.random().toString(36).slice(2);function Ba(t){if(!t[zo]){t[zo]=!0,Z0.forEach(function(r){r!=="selectionchange"&&(Eb.has(r)||vc(r,!1,t),vc(r,!0,t))});var e=t.nodeType===9?t:t.ownerDocument;e===null||e[zo]||(e[zo]=!0,vc("selectionchange",!1,e))}}function Vv(t,e,r,n){switch(Tv(e)){case 1:var s=zx;break;case 4:s=Ux;break;default:s=ef}r=s.bind(null,e,r,t),s=void 0,!gd||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 yc(t,e,r,n,s){var i=n;
vendor: 2,645 bytes, line 37
37if(!(e&1)&&!(e&2)&&n!==null)e:for(;;){if(n===null)return;var a=n.tag;if(a===3||a===4){var o=n.stateNode.containerInfo;if(o===s||o.nodeType===8&&o.parentNode===s)break;if(a===4)for(a=n.return;a!==null;){var l=a.tag;if((l===3||l===4)&&(l=a.stateNode.containerInfo,l===s||l.nodeType===8&&l.parentNode===s))return;a=a.return}for(;o!==null;){if(a=ds(o),a===null)return;if(l=a.tag,l===5||l===6){n=i=a;continue e}o=o.parentNode}}n=n.return}hv(function(){var u=i,c=Zh(r),d=[];e:{var f=Bv.get(t);if(f!==void 0){var m=rf,y=t;switch(t){case"keypress":if(ol(r)===0)break e;case"keydown":case"keyup":m=tb;break;case"focusin":y="focus",m=dc;break;case"focusout":y="blur",m=dc;break;case"beforeblur":case"afterblur":m=dc;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":m=Vp;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":m=Vx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":m=sb;break;case Dv:case $v:case zv:m=Gx;break;case Uv:m=ab;break;case"scroll":m=Bx;break;case"wheel":m=lb;break;case"copy":case"cut":case"paste":m=Kx;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":m=Hp}var g=(e&4)!==0,b=!g&&t==="scroll",_=g?f!==null?f+"Capture":null:f;g=[];for(var v=u,w;v!==null;){w=v;var h=w.stateNode;if(w.tag===5&&h!==null&&(w=h,_!==null&&(h=ja(v,_),h!=null&&g.push(Fa(v,h,w)))),b)break;v=v.return}0<g.length&&(f=new m(f,y,null,r,c),d.push({event:f,listeners:g}))}}if(!(e&7)){e:{if(f=t==="mouseover"||t==="pointerover",m=t==="mouseout"||t==="pointerout",f&&r!==pd&&(y=r.relatedTarget||r.fromElement)&&(ds(y)||y[nn]))break e;if((m||f)&&(f=c.window===c?c:(f=c.ownerDocument)?f.defaultView||f.parentWindow:window,m?(y=r.relatedTarget||r.toElement,m=u,y=y?ds(y):null,y!==null&&(b=Is(y),y!==b||y.tag!==5&&y.tag!==6)&&(y=null)):(m=null,y=u),m!==y)){if(g=Vp,h="onMouseLeave",_="onMouseEnter",v="mouse",(t==="pointerout"||t==="pointerover")&&(g=Hp,h="onPointerLeave",_="onPointerEnter",v="pointer"),b=m==null?f:Qs(m),w=y==null?f:Qs(y),f=new g(h,v+"leave",m,r,c),f.target=b,f.relatedTarget=w,h=null,ds(c)===u&&(g=new g(_,v+"enter",y,r,c),g.target=w,g.relatedTarget=b,h=g),b=h,m&&y)t:{for(g=m,_=y,v=0,w=g;w;w=Ms(w))v++;for(w=0,h=_;h;h=Ms(h))w++;for(;0<v-w;)g=Ms(g),v--;for(;0<w-v;)_=Ms(_),w--;for(;v--;){if(g===_||_!==null&&g===_.alternate)break t;g=Ms(g),_=Ms(_)}g=null}else g=null;m!==null&&rm(d,f,m,g,!1),y!==null&&b!==null&&rm(d,b,y,g,!0)}}
vendor: 7,420 bytes, lines 37-38
37e:{if(f=u?Qs(u):window,m=f.nodeName&&f.nodeName.toLowerCase(),m==="select"||m==="input"&&f.type==="file")var p=mb;else if(Kp(f))if(Iv)p=wb;else{p=vb;var x=gb}else(m=f.nodeName)&&m.toLowerCase()==="input"&&(f.type==="checkbox"||f.type==="radio")&&(p=yb);if(p&&(p=p(t,u))){Ov(d,p,r,c);break e}x&&x(t,f,u),t==="focusout"&&(x=f._wrapperState)&&x.controlled&&f.type==="number"&&ud(f,"number",f.value)}switch(x=u?Qs(u):window,t){case"focusin":(Kp(x)||x.contentEditable==="true")&&(Ys=x,xd=u,ya=null);break;case"focusout":ya=xd=Ys=null;break;case"mousedown":bd=!0;break;case"contextmenu":case"mouseup":case"dragend":bd=!1,Qp(d,r,c);break;case"selectionchange":if(bb)break;case"keydown":case"keyup":Qp(d,r,c)}var k;if(sf)e:{switch(t){case"compositionstart":var T="onCompositionStart";break e;case"compositionend":T="onCompositionEnd";break e;case"compositionupdate":T="onCompositionUpdate";break e}T=void 0}else Zs?Av(t,r)&&(T="onCompositionEnd"):t==="keydown"&&r.keyCode===229&&(T="onCompositionStart");T&&(Pv&&r.locale!=="ko"&&(Zs||T!=="onCompositionStart"?T==="onCompositionEnd"&&Zs&&(k=Cv()):(xn=c,tf="value"in xn?xn.value:xn.textContent,Zs=!0)),x=Rl(u,T),0<x.length&&(T=new Wp(T,t,null,r,c),d.push({event:T,listeners:x}),k?T.data=k:(k=Rv(r),k!==null&&(T.data=k)))),(k=cb?db(t,r):hb(t,r))&&(u=Rl(u,"onBeforeInput"),0<u.length&&(c=new Wp("onBeforeInput","beforeinput",null,r,c),d.push({event:c,listeners:u}),c.data=k))}Fv(d,e)})}function Fa(t,e,r){return{instance:t,listener:e,currentTarget:r}}function Rl(t,e){for(var r=e+"Capture",n=[];t!==null;){var s=t,i=s.stateNode;s.tag===5&&i!==null&&(s=i,i=ja(t,r),i!=null&&n.unshift(Fa(t,i,s)),i=ja(t,e),i!=null&&n.push(Fa(t,i,s))),t=t.return}return n}function Ms(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function rm(t,e,r,n,s){for(var i=e._reactName,a=[];r!==null&&r!==n;){var o=r,l=o.alternate,u=o.stateNode;if(l!==null&&l===n)break;o.tag===5&&u!==null&&(o=u,s?(l=ja(r,i),l!=null&&a.unshift(Fa(r,l,o))):s||(l=ja(r,i),l!=null&&a.push(Fa(r,l,o)))),r=r.return}a.length!==0&&t.push({event:e,listeners:a})}var Tb=/\r\n?/g,Cb=/\u0000|\uFFFD/g;function nm(t){return(typeof t=="string"?t:""+t).replace(Tb,`
38`).replace(Cb,"")}function Uo(t,e,r){if(e=nm(e),nm(t)!==e&&r)throw Error(z(425))}function Ol(){}var Sd=null,kd=null;function Ed(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 Td=typeof setTimeout=="function"?setTimeout:void 0,Pb=typeof clearTimeout=="function"?clearTimeout:void 0,sm=typeof Promise=="function"?Promise:void 0,Ab=typeof queueMicrotask=="function"?queueMicrotask:typeof sm<"u"?function(t){return sm.resolve(null).then(t).catch(Rb)}:Td;function Rb(t){setTimeout(function(){throw t})}function wc(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),$a(e);return}n--}else r!=="$"&&r!=="$?"&&r!=="$!"||n++;r=s}while(r);$a(e)}function In(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 im(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 Ui=Math.random().toString(36).slice(2),Mr="__reactFiber$"+Ui,Va="__reactProps$"+Ui,nn="__reactContainer$"+Ui,Cd="__reactEvents$"+Ui,Ob="__reactListeners$"+Ui,Ib="__reactHandles$"+Ui;function ds(t){var e=t[Mr];if(e)return e;for(var r=t.parentNode;r;){if(e=r[nn]||r[Mr]){if(r=e.alternate,e.child!==null||r!==null&&r.child!==null)for(t=im(t);t!==null;){if(r=t[Mr])return r;t=im(t)}return e}t=r,r=t.parentNode}return null}function xo(t){return t=t[Mr]||t[nn],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Qs(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(z(33))}function Au(t){return t[Va]||null}var Pd=[],ei=-1;function Zn(t){return{current:t}}function Ae(t){0>ei||(t.current=Pd[ei],Pd[ei]=null,ei--)}function Ee(t,e){ei++,Pd[ei]=t.current,t.current=e}var Fn={},bt=Zn(Fn),It=Zn(!1),Ss=Fn;function bi(t,e){var r=t.type.contextTypes;if(!r)return Fn;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 Nt(t){return t=t.childContextTypes,t!=null}function Il(){Ae(It),Ae(bt)}function am(t,e,r){if(bt.current!==Fn)throw Error(z(168));Ee(bt,e),Ee(It,r)}function Wv(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(z(108,gx(t)||"Unknown",s));return $e({},r,n)}function Nl(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Fn,Ss=bt.current,Ee(bt,t),Ee(It,It.current),!0}function om(t,e,r){var n=t.stateNode;if(!n)throw Error(z(169));r?(t=Wv(t,e,Ss),n.__reactInternalMemoizedMergedChildContext=t,Ae(It),Ae(bt),Ee(bt,t)):Ae(It),Ee(It,r)}var Zr=null,Ru=!1,_c=!1;function Hv(t){Zr===null?Zr=[t]:Zr.push(t)}function Nb(t){Ru=!0,Hv(t)}function Yn(){if(!_c&&Zr!==null){_c=!0;var t=0,e=_e;try{var r=Zr;for(_e=1;t<r.length;t++){var n=r[t];do n=n(!0);while(n!==null)}Zr=null,Ru=!1}catch(s){throw Zr!==null&&(Zr=Zr.slice(t+1)),gv(Yh,Yn),s}finally{_e=e,_c=!1}}return null}var ti=[],ri=0,Ll=null,jl=0,or=[],lr=0,ks=null,Xr=1,Qr="";function as(t,e){ti[ri++]=jl,ti[ri++]=Ll,Ll=t,jl=e}function Gv(t,e,r){or[lr++]=Xr,or[lr++]=Qr,or[lr++]=ks,ks=t;var n=Xr;t=Qr;var s=32-Pr(n)-1;n&=~(1<<s),r+=1;var i=32-Pr(e)+s;if(30<i){var a=s-s%5;i=(n&(1<<a)-1).toString(32),n>>=a,s-=a,Xr=1<<32-Pr(e)+s|r<<s|n,Qr=i+t}else Xr=1<<i|r<<s|n,Qr=t}function of(t){t.return!==null&&(as(t,1),Gv(t,1,0))}function lf(t){for(;t===Ll;)Ll=ti[--ri],ti[ri]=null,jl=ti[--ri],ti[ri]=null;for(;t===ks;)ks=or[--lr],or[lr]=null,Qr=or[--lr],or[lr]=null,Xr=or[--lr],or[lr]=null}var Zt=null,qt=null,Re=!1,Er=null;function qv(t,e){var r=ur(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 lm(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,Zt=t,qt=In(e.firstChild),!0):!1;case 6:return e=t.pendingProps===""||e.nodeType!==3?null:e,e!==null?(t.stateNode=e,Zt=t,qt=null,!0):!1;case 13:return e=e.nodeType!==8?null:e,e!==null?(r=ks!==null?{id:Xr,overflow:Qr}:null,t.memoizedState={dehydrated:e,treeContext:r,retryLane:1073741824},r=ur(18,null,null,0),r.stateNode=e,r.return=t,t.child=r,Zt=t,qt=null,!0):!1;default:return!1}}function Ad(t){return(t.mode&1)!==0&&(t.flags&128)===0}function Rd(t){if(Re){var e=qt;if(e){var r=e;if(!lm(t,e)){if(Ad(t))throw Error(z(418));e=In(r.nextSibling);var n=Zt;e&&lm(t,e)?qv(n,r):(t.flags=t.flags&-4097|2,Re=!1,Zt=t)}}else{if(Ad(t))throw Error(z(418));t.flags=t.flags&-4097|2,Re=!1,Zt=t}}}function um(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Zt=t}function Bo(t){if(t!==Zt)return!1;if(!Re)return um(t),Re=!0,!1;var e;if((e=t.tag!==3)&&!(e=t.tag!==5)&&(e=t.type,e=e!=="head"&&e!=="body"&&!Ed(t.type,t.memoizedProps)),e&&(e=qt)){
vendor: 12,670 bytes, line 38
38if(Ad(t))throw Kv(),Error(z(418));for(;e;)qv(t,e),e=In(e.nextSibling)}if(um(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(z(317));e:{for(t=t.nextSibling,e=0;t;){if(t.nodeType===8){var r=t.data;if(r==="/$"){if(e===0){qt=In(t.nextSibling);break e}e--}else r!=="$"&&r!=="$!"&&r!=="$?"||e++}t=t.nextSibling}qt=null}}else qt=Zt?In(t.stateNode.nextSibling):null;return!0}function Kv(){for(var t=qt;t;)t=In(t.nextSibling)}function Si(){qt=Zt=null,Re=!1}function uf(t){Er===null?Er=[t]:Er.push(t)}var Lb=cn.ReactCurrentBatchConfig;function Zi(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(z(309));var n=r.stateNode}if(!n)throw Error(z(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(a){var o=s.refs;a===null?delete o[i]:o[i]=a},e._stringRef=i,e)}if(typeof t!="string")throw Error(z(284));if(!r._owner)throw Error(z(290,t))}return t}function Fo(t,e){throw t=Object.prototype.toString.call(e),Error(z(31,t==="[object Object]"?"object with keys {"+Object.keys(e).join(", ")+"}":t))}function cm(t){var e=t._init;return e(t._payload)}function Jv(t){function e(_,v){if(t){var w=_.deletions;w===null?(_.deletions=[v],_.flags|=16):w.push(v)}}function r(_,v){if(!t)return null;for(;v!==null;)e(_,v),v=v.sibling;return null}function n(_,v){for(_=new Map;v!==null;)v.key!==null?_.set(v.key,v):_.set(v.index,v),v=v.sibling;return _}function s(_,v){return _=Mn(_,v),_.index=0,_.sibling=null,_}function i(_,v,w){return _.index=w,t?(w=_.alternate,w!==null?(w=w.index,w<v?(_.flags|=2,v):w):(_.flags|=2,v)):(_.flags|=1048576,v)}function a(_){return t&&_.alternate===null&&(_.flags|=2),_}function o(_,v,w,h){return v===null||v.tag!==6?(v=Cc(w,_.mode,h),v.return=_,v):(v=s(v,w),v.return=_,v)}function l(_,v,w,h){var p=w.type;return p===Js?c(_,v,w.props.children,h,w.key):v!==null&&(v.elementType===p||typeof p=="object"&&p!==null&&p.$$typeof===fn&&cm(p)===v.type)?(h=s(v,w.props),h.ref=Zi(_,v,w),h.return=_,h):(h=pl(w.type,w.key,w.props,null,_.mode,h),h.ref=Zi(_,v,w),h.return=_,h)}function u(_,v,w,h){return v===null||v.tag!==4||v.stateNode.containerInfo!==w.containerInfo||v.stateNode.implementation!==w.implementation?(v=Pc(w,_.mode,h),v.return=_,v):(v=s(v,w.children||[]),v.return=_,v)}function c(_,v,w,h,p){return v===null||v.tag!==7?(v=ys(w,_.mode,h,p),v.return=_,v):(v=s(v,w),v.return=_,v)}function d(_,v,w){if(typeof v=="string"&&v!==""||typeof v=="number")return v=Cc(""+v,_.mode,w),v.return=_,v;if(typeof v=="object"&&v!==null){switch(v.$$typeof){case Oo:return w=pl(v.type,v.key,v.props,null,_.mode,w),w.ref=Zi(_,null,v),w.return=_,w;case Ks:return v=Pc(v,_.mode,w),v.return=_,v;case fn:var h=v._init;return d(_,h(v._payload),w)}if(sa(v)||Hi(v))return v=ys(v,_.mode,w,null),v.return=_,v;Fo(_,v)}return null}function f(_,v,w,h){var p=v!==null?v.key:null;if(typeof w=="string"&&w!==""||typeof w=="number")return p!==null?null:o(_,v,""+w,h);if(typeof w=="object"&&w!==null){switch(w.$$typeof){case Oo:return w.key===p?l(_,v,w,h):null;case Ks:return w.key===p?u(_,v,w,h):null;case fn:return p=w._init,f(_,v,p(w._payload),h)}if(sa(w)||Hi(w))return p!==null?null:c(_,v,w,h,null);Fo(_,w)}return null}function m(_,v,w,h,p){if(typeof h=="string"&&h!==""||typeof h=="number")return _=_.get(w)||null,o(v,_,""+h,p);if(typeof h=="object"&&h!==null){switch(h.$$typeof){case Oo:return _=_.get(h.key===null?w:h.key)||null,l(v,_,h,p);case Ks:return _=_.get(h.key===null?w:h.key)||null,u(v,_,h,p);case fn:var x=h._init;return m(_,v,w,x(h._payload),p)}if(sa(h)||Hi(h))return _=_.get(w)||null,c(v,_,h,p,null);Fo(v,h)}return null}function y(_,v,w,h){for(var p=null,x=null,k=v,T=v=0,E=null;k!==null&&T<w.length;T++){k.index>T?(E=k,k=null):E=k.sibling;var R=f(_,k,w[T],h);if(R===null){k===null&&(k=E);break}t&&k&&R.alternate===null&&e(_,k),v=i(R,v,T),x===null?p=R:x.sibling=R,x=R,k=E}if(T===w.length)return r(_,k),Re&&as(_,T),p;if(k===null){for(;T<w.length;T++)k=d(_,w[T],h),k!==null&&(v=i(k,v,T),x===null?p=k:x.sibling=k,x=k);return Re&&as(_,T),p}for(k=n(_,k);T<w.length;T++)E=m(k,_,T,w[T],h),E!==null&&(t&&E.alternate!==null&&k.delete(E.key===null?T:E.key),v=i(E,v,T),x===null?p=E:x.sibling=E,x=E);return t&&k.forEach(function(j){return e(_,j)}),Re&&as(_,T),p}function g(_,v,w,h){var p=Hi(w);if(typeof p!="function")throw Error(z(150));if(w=p.call(w),w==null)throw Error(z(151));for(var x=p=null,k=v,T=v=0,E=null,R=w.next();k!==null&&!R.done;T++,R=w.next()){k.index>T?(E=k,k=null):E=k.sibling;var j=f(_,k,R.value,h);if(j===null){k===null&&(k=E);break}t&&k&&j.alternate===null&&e(_,k),v=i(j,v,T),x===null?p=j:x.sibling=j,x=j,k=E}if(R.done)return r(_,k),Re&&as(_,T),p;if(k===null){for(;!R.done;T++,R=w.next())R=d(_,R.value,h),R!==null&&(v=i(R,v,T),x===null?p=R:x.sibling=R,x=R);return Re&&as(_,T),p}for(k=n(_,k);!R.done;T++,R=w.next())R=m(k,_,T,R.value,h),R!==null&&(t&&R.alternate!==null&&k.delete(R.key===null?T:R.key),v=i(R,v,T),x===null?p=R:x.sibling=R,x=R);return t&&k.forEach(function(L){return e(_,L)}),Re&&as(_,T),p}function b(_,v,w,h){if(typeof w=="object"&&w!==null&&w.type===Js&&w.key===null&&(w=w.props.children),typeof w=="object"&&w!==null){switch(w.$$typeof){case Oo:e:{for(var p=w.key,x=v;x!==null;){if(x.key===p){if(p=w.type,p===Js){if(x.tag===7){r(_,x.sibling),v=s(x,w.props.children),v.return=_,_=v;break e}}else if(x.elementType===p||typeof p=="object"&&p!==null&&p.$$typeof===fn&&cm(p)===x.type){r(_,x.sibling),v=s(x,w.props),v.ref=Zi(_,x,w),v.return=_,_=v;break e}r(_,x);break}else e(_,x);x=x.sibling}w.type===Js?(v=ys(w.props.children,_.mode,h,w.key),v.return=_,_=v):(h=pl(w.type,w.key,w.props,null,_.mode,h),h.ref=Zi(_,v,w),h.return=_,_=h)}return a(_);case Ks:e:{for(x=w.key;v!==null;){if(v.key===x)if(v.tag===4&&v.stateNode.containerInfo===w.containerInfo&&v.stateNode.implementation===w.implementation){r(_,v.sibling),v=s(v,w.children||[]),v.return=_,_=v;break e}else{r(_,v);break}else e(_,v);v=v.sibling}v=Pc(w,_.mode,h),v.return=_,_=v}return a(_);case fn:return x=w._init,b(_,v,x(w._payload),h)}if(sa(w))return y(_,v,w,h);if(Hi(w))return g(_,v,w,h);Fo(_,w)}return typeof w=="string"&&w!==""||typeof w=="number"?(w=""+w,v!==null&&v.tag===6?(r(_,v.sibling),v=s(v,w),v.return=_,_=v):(r(_,v),v=Cc(w,_.mode,h),v.return=_,_=v),a(_)):r(_,v)}return b}var ki=Jv(!0),Zv=Jv(!1),Ml=Zn(null),Dl=null,ni=null,cf=null;function df(){cf=ni=Dl=null}function hf(t){var e=Ml.current;Ae(Ml),t._currentValue=e}function Od(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 pi(t,e){Dl=t,cf=ni=null,t=t.dependencies,t!==null&&t.firstContext!==null&&(t.lanes&e&&(Ot=!0),t.firstContext=null)}function fr(t){var e=t._currentValue;if(cf!==t)if(t={context:t,memoizedValue:e,next:null},ni===null){if(Dl===null)throw Error(z(308));ni=t,Dl.dependencies={lanes:0,firstContext:t}}else ni=ni.next=t;return e}var hs=null;function ff(t){hs===null?hs=[t]:hs.push(t)}function Yv(t,e,r,n){var s=e.interleaved;return s===null?(r.next=r,ff(e)):(r.next=s.next,s.next=r),e.interleaved=r,sn(t,n)}function sn(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 pn=!1;function pf(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Xv(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 tn(t,e){return{eventTime:t,lane:e,tag:0,payload:null,callback:null,next:null}}function Nn(t,e,r){var n=t.updateQueue;if(n===null)return null;if(n=n.shared,me&2){var s=n.pending;return s===null?e.next=e:(e.next=s.next,s.next=e),n.pending=e,sn(t,r)}return s=n.interleaved,s===null?(e.next=e,ff(n)):(e.next=s.next,s.next=e),n.interleaved=e,sn(t,r)}function ll(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,Xh(t,r)}}function dm(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 a={eventTime:r.eventTime,lane:r.lane,tag:r.tag,payload:r.payload,callback:r.callback,next:null};i===null?s=i=a:i=i.next=a,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 $l(t,e,r,n){var s=t.updateQueue;pn=!1;var i=s.firstBaseUpdate,a=s.lastBaseUpdate,o=s.shared.pending;if(o!==null){s.shared.pending=null;var l=o,u=l.next;l.next=null,a===null?i=u:a.next=u,a=l;var c=t.alternate;c!==null&&(c=c.updateQueue,o=c.lastBaseUpdate,o!==a&&(o===null?c.firstBaseUpdate=u:o.next=u,c.lastBaseUpdate=l))}if(i!==null){var d=s.baseState;a=0,c=u=l=null,o=i;do{var f=o.lane,m=o.eventTime;if((n&f)===f){c!==null&&(c=c.next={eventTime:m,lane:0,tag:o.tag,payload:o.payload,callback:o.callback,next:null});e:{var y=t,g=o;switch(f=e,m=r,g.tag){case 1:if(y=g.payload,typeof y=="function"){d=y.call(m,d,f);break e}d=y;break e;case 3:y.flags=y.flags&-65537|128;case 0:if(y=g.payload,f=typeof y=="function"?y.call(m,d,f):y,f==null)break e;d=$e({},d,f);break e;case 2:pn=!0}}o.callback!==null&&o.lane!==0&&(t.flags|=64,f=s.effects,f===null?s.effects=[o]:f.push(o))}else m={eventTime:m,lane:f,tag:o.tag,payload:o.payload,callback:o.callback,next:null},c===null?(u=c=m,l=d):c=c.next=m,a|=f;if(o=o.next,o===null){if(o=s.shared.pending,o===null)break;f=o,o=f.next,f.next=null,s.lastBaseUpdate=f,s.shared.pending=null}}while(!0);if(c===null&&(l=d),s.baseState=l,s.firstBaseUpdate=u,s.lastBaseUpdate=c,e=s.shared.interleaved,e!==null){s=e;do a|=s.lane,s=s.next;while(s!==e)}else i===null&&(s.shared.lanes=0);Ts|=a,t.lanes=a,t.memoizedState=d}}function hm(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(z(191,s));s.call(n)}}}var bo={},Ur=Zn(bo),Wa=Zn(bo),Ha=Zn(bo);function fs(t){if(t===bo)throw Error(z(174));return t}function mf(t,e){switch(Ee(Ha,e),Ee(Wa,t),Ee(Ur,bo),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:dd(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=dd(e,t)}Ae(Ur),Ee(Ur,e)}function Ei(){Ae(Ur),Ae(Wa),Ae(Ha)}function Qv(t){fs(Ha.current);var e=fs(Ur.current),r=dd(e,t.type);e!==r&&(Ee(Wa,t),Ee(Ur,r))}function gf(t){Wa.current===t&&(Ae(Ur),Ae(Wa))}var Ne=Zn(0);function zl(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 xc=[];function vf(){for(var t=0;t<xc.length;t++)xc[t]._workInProgressVersionPrimary=null;xc.length=0}var ul=cn.ReactCurrentDispatcher,bc=cn.ReactCurrentBatchConfig,Es=0,De=null,tt=null,it=null,Ul=!1,wa=!1,Ga=0,jb=0;function pt(){throw Error(z(321))}function yf(t,e){if(e===null)return!1;for(var r=0;r<e.length&&r<t.length;r++)if(!Rr(t[r],e[r]))return!1;return!0}function wf(t,e,r,n,s,i){if(Es=i,De=e,e.memoizedState=null,e.updateQueue=null,e.lanes=0,ul.current=t===null||t.memoizedState===null?zb:Ub,t=r(n,s),wa){i=0;do{if(wa=!1,Ga=0,25<=i)throw Error(z(301));i+=1,it=tt=null,e.updateQueue=null,ul.current=Bb,t=r(n,s)}while(wa)}if(ul.current=Bl,e=tt!==null&&tt.next!==null,Es=0,it=tt=De=null,Ul=!1,e)throw Error(z(300));return t}function _f(){var t=Ga!==0;return Ga=0,t}function Ir(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return it===null?De.memoizedState=it=t:it=it.next=t,it}function pr(){if(tt===null){var t=De.alternate;t=t!==null?t.memoizedState:null}else t=tt.next;var e=it===null?De.memoizedState:it.next;if(e!==null)it=e,tt=t;else{if(t===null)throw Error(z(310));tt=t,t={memoizedState:tt.memoizedState,baseState:tt.baseState,baseQueue:tt.baseQueue,queue:tt.queue,next:null},it===null?De.memoizedState=it=t:it=it.next=t}return it}function qa(t,e){return typeof e=="function"?e(t):e}function Sc(t){var e=pr(),r=e.queue;if(r===null)throw Error(z(311));r.lastRenderedReducer=t;
vendor: 4,649 bytes, line 38
38var n=tt,s=n.baseQueue,i=r.pending;if(i!==null){if(s!==null){var a=s.next;s.next=i.next,i.next=a}n.baseQueue=s=i,r.pending=null}if(s!==null){i=s.next,n=n.baseState;var o=a=null,l=null,u=i;do{var c=u.lane;if((Es&c)===c)l!==null&&(l=l.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 d={lane:c,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null};l===null?(o=l=d,a=n):l=l.next=d,De.lanes|=c,Ts|=c}u=u.next}while(u!==null&&u!==i);l===null?a=n:l.next=o,Rr(n,e.memoizedState)||(Ot=!0),e.memoizedState=n,e.baseState=a,e.baseQueue=l,r.lastRenderedState=n}if(t=r.interleaved,t!==null){s=t;do i=s.lane,De.lanes|=i,Ts|=i,s=s.next;while(s!==t)}else s===null&&(r.lanes=0);return[e.memoizedState,r.dispatch]}function kc(t){var e=pr(),r=e.queue;if(r===null)throw Error(z(311));r.lastRenderedReducer=t;var n=r.dispatch,s=r.pending,i=e.memoizedState;if(s!==null){r.pending=null;var a=s=s.next;do i=t(i,a.action),a=a.next;while(a!==s);Rr(i,e.memoizedState)||(Ot=!0),e.memoizedState=i,e.baseQueue===null&&(e.baseState=i),r.lastRenderedState=i}return[i,n]}function ey(){}function ty(t,e){var r=De,n=pr(),s=e(),i=!Rr(n.memoizedState,s);if(i&&(n.memoizedState=s,Ot=!0),n=n.queue,xf(sy.bind(null,r,n,t),[t]),n.getSnapshot!==e||i||it!==null&&it.memoizedState.tag&1){if(r.flags|=2048,Ka(9,ny.bind(null,r,n,s,e),void 0,null),at===null)throw Error(z(349));Es&30||ry(r,e,s)}return s}function ry(t,e,r){t.flags|=16384,t={getSnapshot:e,value:r},e=De.updateQueue,e===null?(e={lastEffect:null,stores:null},De.updateQueue=e,e.stores=[t]):(r=e.stores,r===null?e.stores=[t]:r.push(t))}function ny(t,e,r,n){e.value=r,e.getSnapshot=n,iy(e)&&ay(t)}function sy(t,e,r){return r(function(){iy(e)&&ay(t)})}function iy(t){var e=t.getSnapshot;t=t.value;try{var r=e();return!Rr(t,r)}catch{return!0}}function ay(t){var e=sn(t,1);e!==null&&Ar(e,t,1,-1)}function fm(t){var e=Ir();return typeof t=="function"&&(t=t()),e.memoizedState=e.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:qa,lastRenderedState:t},e.queue=t,t=t.dispatch=$b.bind(null,De,t),[e.memoizedState,t]}function Ka(t,e,r,n){return t={tag:t,create:e,destroy:r,deps:n,next:null},e=De.updateQueue,e===null?(e={lastEffect:null,stores:null},De.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 oy(){return pr().memoizedState}function cl(t,e,r,n){var s=Ir();De.flags|=t,s.memoizedState=Ka(1|e,r,void 0,n===void 0?null:n)}function Ou(t,e,r,n){var s=pr();n=n===void 0?null:n;var i=void 0;if(tt!==null){var a=tt.memoizedState;if(i=a.destroy,n!==null&&yf(n,a.deps)){s.memoizedState=Ka(e,r,i,n);return}}De.flags|=t,s.memoizedState=Ka(1|e,r,i,n)}function pm(t,e){return cl(8390656,8,t,e)}function xf(t,e){return Ou(2048,8,t,e)}function ly(t,e){return Ou(4,2,t,e)}function uy(t,e){return Ou(4,4,t,e)}function cy(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 dy(t,e,r){return r=r!=null?r.concat([t]):null,Ou(4,4,cy.bind(null,e,t),r)}function bf(){}function hy(t,e){var r=pr();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&yf(e,n[1])?n[0]:(r.memoizedState=[t,e],t)}function fy(t,e){var r=pr();e=e===void 0?null:e;var n=r.memoizedState;return n!==null&&e!==null&&yf(e,n[1])?n[0]:(t=t(),r.memoizedState=[t,e],t)}function py(t,e,r){return Es&21?(Rr(r,e)||(r=wv(),De.lanes|=r,Ts|=r,t.baseState=!0),e):(t.baseState&&(t.baseState=!1,Ot=!0),t.memoizedState=r)}function Mb(t,e){var r=_e;_e=r!==0&&4>r?r:4,t(!0);var n=bc.transition;bc.transition={};try{t(!1),e()}finally{_e=r,bc.transition=n}}function my(){return pr().memoizedState}function Db(t,e,r){var n=jn(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},gy(t))vy(e,r);else if(r=Yv(t,e,r,n),r!==null){var s=Et();Ar(r,t,n,s),yy(r,e,n)}}function $b(t,e,r){var n=jn(t),s={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(gy(t))vy(e,s);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,o=i(a,r);if(s.hasEagerState=!0,s.eagerState=o,Rr(o,a)){var l=e.interleaved;l===null?(s.next=s,ff(e)):(s.next=l.next,l.next=s),e.interleaved=s;return}}catch{}finally{}r=Yv(t,e,s,n),r!==null&&(s=Et(),Ar(r,t,n,s),yy(r,e,n))}}function gy(t){var e=t.alternate;return t===De||e!==null&&e===De}function vy(t,e){wa=Ul=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function yy(t,e,r){if(r&4194240){var n=e.lanes;
vendor: 8,470 bytes, lines 38-40
38n&=t.pendingLanes,r|=n,e.lanes=r,Xh(t,r)}}var Bl={readContext:fr,useCallback:pt,useContext:pt,useEffect:pt,useImperativeHandle:pt,useInsertionEffect:pt,useLayoutEffect:pt,useMemo:pt,useReducer:pt,useRef:pt,useState:pt,useDebugValue:pt,useDeferredValue:pt,useTransition:pt,useMutableSource:pt,useSyncExternalStore:pt,useId:pt,unstable_isNewReconciler:!1},zb={readContext:fr,useCallback:function(t,e){return Ir().memoizedState=[t,e===void 0?null:e],t},useContext:fr,useEffect:pm,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,cl(4194308,4,cy.bind(null,e,t),r)},useLayoutEffect:function(t,e){return cl(4194308,4,t,e)},useInsertionEffect:function(t,e){return cl(4,2,t,e)},useMemo:function(t,e){var r=Ir();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=Ir();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=Db.bind(null,De,t),[n.memoizedState,t]},useRef:function(t){var e=Ir();return t={current:t},e.memoizedState=t},useState:fm,useDebugValue:bf,useDeferredValue:function(t){return Ir().memoizedState=t},useTransition:function(){var t=fm(!1),e=t[0];return t=Mb.bind(null,t[1]),Ir().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=De,s=Ir();if(Re){if(r===void 0)throw Error(z(407));r=r()}else{if(r=e(),at===null)throw Error(z(349));Es&30||ry(n,e,r)}s.memoizedState=r;var i={value:r,getSnapshot:e};return s.queue=i,pm(sy.bind(null,n,i,t),[t]),n.flags|=2048,Ka(9,ny.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=Ir(),e=at.identifierPrefix;if(Re){var r=Qr,n=Xr;r=(n&~(1<<32-Pr(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Ga++,0<r&&(e+="H"+r.toString(32)),e+=":"}else r=jb++,e=":"+e+"r"+r.toString(32)+":";return t.memoizedState=e},unstable_isNewReconciler:!1},Ub={readContext:fr,useCallback:hy,useContext:fr,useEffect:xf,useImperativeHandle:dy,useInsertionEffect:ly,useLayoutEffect:uy,useMemo:fy,useReducer:Sc,useRef:oy,useState:function(){return Sc(qa)},useDebugValue:bf,useDeferredValue:function(t){var e=pr();return py(e,tt.memoizedState,t)},useTransition:function(){var t=Sc(qa)[0],e=pr().memoizedState;return[t,e]},useMutableSource:ey,useSyncExternalStore:ty,useId:my,unstable_isNewReconciler:!1},Bb={readContext:fr,useCallback:hy,useContext:fr,useEffect:xf,useImperativeHandle:dy,useInsertionEffect:ly,useLayoutEffect:uy,useMemo:fy,useReducer:kc,useRef:oy,useState:function(){return kc(qa)},useDebugValue:bf,useDeferredValue:function(t){var e=pr();return tt===null?e.memoizedState=t:py(e,tt.memoizedState,t)},useTransition:function(){var t=kc(qa)[0],e=pr().memoizedState;return[t,e]},useMutableSource:ey,useSyncExternalStore:ty,useId:my,unstable_isNewReconciler:!1};function br(t,e){if(t&&t.defaultProps){e=$e({},e),t=t.defaultProps;for(var r in t)e[r]===void 0&&(e[r]=t[r]);return e}return e}function Id(t,e,r,n){e=t.memoizedState,r=r(n,e),r=r==null?e:$e({},e,r),t.memoizedState=r,t.lanes===0&&(t.updateQueue.baseState=r)}var Iu={isMounted:function(t){return(t=t._reactInternals)?Is(t)===t:!1},enqueueSetState:function(t,e,r){t=t._reactInternals;var n=Et(),s=jn(t),i=tn(n,s);i.payload=e,r!=null&&(i.callback=r),e=Nn(t,i,s),e!==null&&(Ar(e,t,s,n),ll(e,t,s))},enqueueReplaceState:function(t,e,r){t=t._reactInternals;var n=Et(),s=jn(t),i=tn(n,s);i.tag=1,i.payload=e,r!=null&&(i.callback=r),e=Nn(t,i,s),e!==null&&(Ar(e,t,s,n),ll(e,t,s))},enqueueForceUpdate:function(t,e){t=t._reactInternals;var r=Et(),n=jn(t),s=tn(r,n);s.tag=2,e!=null&&(s.callback=e),e=Nn(t,s,n),e!==null&&(Ar(e,t,n,r),ll(e,t,n))}};function mm(t,e,r,n,s,i,a){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(n,i,a):e.prototype&&e.prototype.isPureReactComponent?!Ua(r,n)||!Ua(s,i):!0}function wy(t,e,r){var n=!1,s=Fn,i=e.contextType;return typeof i=="object"&&i!==null?i=fr(i):(s=Nt(e)?Ss:bt.current,n=e.contextTypes,i=(n=n!=null)?bi(t,s):Fn),e=new e(r,i),t.memoizedState=e.state!==null&&e.state!==void 0?e.state:null,e.updater=Iu,t.stateNode=e,e._reactInternals=t,n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=s,t.__reactInternalMemoizedMaskedChildContext=i),e}function gm(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&&Iu.enqueueReplaceState(e,e.state,null)}function Nd(t,e,r,n){var s=t.stateNode;s.props=r,s.state=t.memoizedState,s.refs={},pf(t);var i=e.contextType;typeof i=="object"&&i!==null?s.context=fr(i):(i=Nt(e)?Ss:bt.current,s.context=bi(t,i)),s.state=t.memoizedState,i=e.getDerivedStateFromProps,typeof i=="function"&&(Id(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&&Iu.enqueueReplaceState(s,s.state,null),$l(t,r,s,n),s.state=t.memoizedState),typeof s.componentDidMount=="function"&&(t.flags|=4194308)}function Ti(t,e){try{var r="",n=e;do r+=mx(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 Ec(t,e,r){return{value:t,source:null,stack:r??null,digest:e??null}}function Ld(t,e){try{console.error(e.value)}catch(r){setTimeout(function(){throw r})}}var Fb=typeof WeakMap=="function"?WeakMap:Map;function _y(t,e,r){r=tn(-1,r),r.tag=3,r.payload={element:null};var n=e.value;return r.callback=function(){Vl||(Vl=!0,Wd=n),Ld(t,e)},r}function xy(t,e,r){r=tn(-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(){Ld(t,e)}}var i=t.stateNode;return i!==null&&typeof i.componentDidCatch=="function"&&(r.callback=function(){Ld(t,e),typeof n!="function"&&(Ln===null?Ln=new Set([this]):Ln.add(this));var a=e.stack;this.componentDidCatch(e.value,{componentStack:a!==null?a:""})}),r}function vm(t,e,r){var n=t.pingCache;if(n===null){n=t.pingCache=new Fb;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=rS.bind(null,t,e,r),e.then(t,t))}function ym(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 wm(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=tn(-1,1),e.tag=2,Nn(r,e,1))),r.lanes|=1),t)}var Vb=cn.ReactCurrentOwner,Ot=!1;function St(t,e,r,n){e.child=t===null?Zv(e,null,r,n):ki(e,t.child,r,n)}function _m(t,e,r,n,s){r=r.render;var i=e.ref;return pi(e,s),n=wf(t,e,r,n,i,s),r=_f(),t!==null&&!Ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,an(t,e,s)):(Re&&r&&of(e),e.flags|=1,St(t,e,n,s),e.child)}function xm(t,e,r,n,s){if(t===null){var i=r.type;return typeof i=="function"&&!Rf(i)&&i.defaultProps===void 0&&r.compare===null&&r.defaultProps===void 0?(e.tag=15,e.type=i,by(t,e,i,n,s)):(t=pl(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 a=i.memoizedProps;if(r=r.compare,r=r!==null?r:Ua,r(a,n)&&t.ref===e.ref)return an(t,e,s)}return e.flags|=1,t=Mn(i,n),t.ref=e.ref,t.return=e,e.child=t}function by(t,e,r,n,s){if(t!==null){var i=t.memoizedProps;if(Ua(i,n)&&t.ref===e.ref)if(Ot=!1,e.pendingProps=n=i,(t.lanes&s)!==0)t.flags&131072&&(Ot=!0);else return e.lanes=t.lanes,an(t,e,s)}return jd(t,e,r,n,s)}function Sy(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},Ee(ii,Ut),Ut|=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,Ee(ii,Ut),Ut|=t,null;e.memoizedState={baseLanes:0,cachePool:null,transitions:null},n=i!==null?i.baseLanes:r,Ee(ii,Ut),Ut|=n}else i!==null?(n=i.baseLanes|r,e.memoizedState=null):n=r,Ee(ii,Ut),Ut|=n;return St(t,e,s,r),e.child}function ky(t,e){var r=e.ref;(t===null&&r!==null||t!==null&&t.ref!==r)&&(e.flags|=512,e.flags|=2097152)}
vendor: 4,711 bytes, line 40
40function jd(t,e,r,n,s){var i=Nt(r)?Ss:bt.current;return i=bi(e,i),pi(e,s),r=wf(t,e,r,n,i,s),n=_f(),t!==null&&!Ot?(e.updateQueue=t.updateQueue,e.flags&=-2053,t.lanes&=~s,an(t,e,s)):(Re&&n&&of(e),e.flags|=1,St(t,e,r,s),e.child)}function bm(t,e,r,n,s){if(Nt(r)){var i=!0;Nl(e)}else i=!1;if(pi(e,s),e.stateNode===null)dl(t,e),wy(e,r,n),Nd(e,r,n,s),n=!0;else if(t===null){var a=e.stateNode,o=e.memoizedProps;a.props=o;var l=a.context,u=r.contextType;typeof u=="object"&&u!==null?u=fr(u):(u=Nt(r)?Ss:bt.current,u=bi(e,u));var c=r.getDerivedStateFromProps,d=typeof c=="function"||typeof a.getSnapshotBeforeUpdate=="function";d||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==n||l!==u)&&gm(e,a,n,u),pn=!1;var f=e.memoizedState;a.state=f,$l(e,n,a,s),l=e.memoizedState,o!==n||f!==l||It.current||pn?(typeof c=="function"&&(Id(e,r,c,n),l=e.memoizedState),(o=pn||mm(e,r,o,n,f,l,u))?(d||typeof a.UNSAFE_componentWillMount!="function"&&typeof a.componentWillMount!="function"||(typeof a.componentWillMount=="function"&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount=="function"&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount=="function"&&(e.flags|=4194308)):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),e.memoizedProps=n,e.memoizedState=l),a.props=n,a.state=l,a.context=u,n=o):(typeof a.componentDidMount=="function"&&(e.flags|=4194308),n=!1)}else{a=e.stateNode,Xv(t,e),o=e.memoizedProps,u=e.type===e.elementType?o:br(e.type,o),a.props=u,d=e.pendingProps,f=a.context,l=r.contextType,typeof l=="object"&&l!==null?l=fr(l):(l=Nt(r)?Ss:bt.current,l=bi(e,l));var m=r.getDerivedStateFromProps;(c=typeof m=="function"||typeof a.getSnapshotBeforeUpdate=="function")||typeof a.UNSAFE_componentWillReceiveProps!="function"&&typeof a.componentWillReceiveProps!="function"||(o!==d||f!==l)&&gm(e,a,n,l),pn=!1,f=e.memoizedState,a.state=f,$l(e,n,a,s);var y=e.memoizedState;o!==d||f!==y||It.current||pn?(typeof m=="function"&&(Id(e,r,m,n),y=e.memoizedState),(u=pn||mm(e,r,u,n,f,y,l)||!1)?(c||typeof a.UNSAFE_componentWillUpdate!="function"&&typeof a.componentWillUpdate!="function"||(typeof a.componentWillUpdate=="function"&&a.componentWillUpdate(n,y,l),typeof a.UNSAFE_componentWillUpdate=="function"&&a.UNSAFE_componentWillUpdate(n,y,l)),typeof a.componentDidUpdate=="function"&&(e.flags|=4),typeof a.getSnapshotBeforeUpdate=="function"&&(e.flags|=1024)):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),e.memoizedProps=n,e.memoizedState=y),a.props=n,a.state=y,a.context=l,n=u):(typeof a.componentDidUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=4),typeof a.getSnapshotBeforeUpdate!="function"||o===t.memoizedProps&&f===t.memoizedState||(e.flags|=1024),n=!1)}return Md(t,e,r,n,i,s)}function Md(t,e,r,n,s,i){ky(t,e);var a=(e.flags&128)!==0;if(!n&&!a)return s&&om(e,r,!1),an(t,e,i);n=e.stateNode,Vb.current=e;var o=a&&typeof r.getDerivedStateFromError!="function"?null:n.render();return e.flags|=1,t!==null&&a?(e.child=ki(e,t.child,null,i),e.child=ki(e,null,o,i)):St(t,e,o,i),e.memoizedState=n.state,s&&om(e,r,!0),e.child}function Ey(t){var e=t.stateNode;e.pendingContext?am(t,e.pendingContext,e.pendingContext!==e.context):e.context&&am(t,e.context,!1),mf(t,e.containerInfo)}function Sm(t,e,r,n,s){return Si(),uf(s),e.flags|=256,St(t,e,r,n),e.child}var Dd={dehydrated:null,treeContext:null,retryLane:0};function $d(t){return{baseLanes:t,cachePool:null,transitions:null}}function Ty(t,e,r){var n=e.pendingProps,s=Ne.current,i=!1,a=(e.flags&128)!==0,o;if((o=a)||(o=t!==null&&t.memoizedState===null?!1:(s&2)!==0),o?(i=!0,e.flags&=-129):(t===null||t.memoizedState!==null)&&(s|=1),Ee(Ne,s&1),t===null)return Rd(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):(a=n.children,t=n.fallback,i?(n=e.mode,i=e.child,a={mode:"hidden",children:a},!(n&1)&&i!==null?(i.childLanes=0,i.pendingProps=a):i=ju(a,n,0,null),t=ys(t,n,r,null),i.return=e,t.return=e,i.sibling=t,e.child=i,e.child.memoizedState=$d(r),e.memoizedState=Dd,t):Sf(e,a));if(s=t.memoizedState,s!==null&&(o=s.dehydrated,o!==null))return Wb(t,e,a,n,o,s,r);if(i){i=n.fallback,a=e.mode,s=t.child,o=s.sibling;var l={mode:"hidden",children:n.children};return!(a&1)&&e.child!==s?(n=e.child,n.childLanes=0,n.pendingProps=l,e.deletions=null):(n=Mn(s,l),n.subtreeFlags=s.subtreeFlags&14680064),o!==null?i=Mn(o,i):(i=ys(i,a,r,null),i.flags|=2),i.return=e,n.return=e,n.sibling=i,e.child=n,n=i,i=e.child,a=t.child.memoizedState,a=a===null?$d(r):{base
vendor: 8,213 bytes, line 40
40Lanes:a.baseLanes|r,cachePool:null,transitions:a.transitions},i.memoizedState=a,i.childLanes=t.childLanes&~r,e.memoizedState=Dd,n}return i=t.child,t=i.sibling,n=Mn(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 Sf(t,e){return e=ju({mode:"visible",children:e},t.mode,0,null),e.return=t,t.child=e}function Vo(t,e,r,n){return n!==null&&uf(n),ki(e,t.child,null,r),t=Sf(e,e.pendingProps.children),t.flags|=2,e.memoizedState=null,t}function Wb(t,e,r,n,s,i,a){if(r)return e.flags&256?(e.flags&=-257,n=Ec(Error(z(422))),Vo(t,e,a,n)):e.memoizedState!==null?(e.child=t.child,e.flags|=128,null):(i=n.fallback,s=e.mode,n=ju({mode:"visible",children:n.children},s,0,null),i=ys(i,s,a,null),i.flags|=2,n.return=e,i.return=e,n.sibling=i,e.child=n,e.mode&1&&ki(e,t.child,null,a),e.child.memoizedState=$d(a),e.memoizedState=Dd,i);if(!(e.mode&1))return Vo(t,e,a,null);if(s.data==="$!"){if(n=s.nextSibling&&s.nextSibling.dataset,n)var o=n.dgst;return n=o,i=Error(z(419)),n=Ec(i,n,void 0),Vo(t,e,a,n)}if(o=(a&t.childLanes)!==0,Ot||o){if(n=at,n!==null){switch(a&-a){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|a)?0:s,s!==0&&s!==i.retryLane&&(i.retryLane=s,sn(t,s),Ar(n,t,s,-1))}return Af(),n=Ec(Error(z(421))),Vo(t,e,a,n)}return s.data==="$?"?(e.flags|=128,e.child=t.child,e=nS.bind(null,t),s._reactRetry=e,null):(t=i.treeContext,qt=In(s.nextSibling),Zt=e,Re=!0,Er=null,t!==null&&(or[lr++]=Xr,or[lr++]=Qr,or[lr++]=ks,Xr=t.id,Qr=t.overflow,ks=e),e=Sf(e,n.children),e.flags|=4096,e)}function km(t,e,r){t.lanes|=e;var n=t.alternate;n!==null&&(n.lanes|=e),Od(t.return,e,r)}function Tc(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 Cy(t,e,r){var n=e.pendingProps,s=n.revealOrder,i=n.tail;if(St(t,e,n.children,r),n=Ne.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&&km(t,r,e);else if(t.tag===19)km(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(Ee(Ne,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&&zl(t)===null&&(s=r),r=r.sibling;r=s,r===null?(s=e.child,e.child=null):(s=r.sibling,r.sibling=null),Tc(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&&zl(t)===null){e.child=s;break}t=s.sibling,s.sibling=r,r=s,s=t}Tc(e,!0,r,null,i);break;case"together":Tc(e,!1,null,null,void 0);break;default:e.memoizedState=null}return e.child}function dl(t,e){!(e.mode&1)&&t!==null&&(t.alternate=null,e.alternate=null,e.flags|=2)}function an(t,e,r){if(t!==null&&(e.dependencies=t.dependencies),Ts|=e.lanes,!(r&e.childLanes))return null;if(t!==null&&e.child!==t.child)throw Error(z(153));if(e.child!==null){for(t=e.child,r=Mn(t,t.pendingProps),e.child=r,r.return=e;t.sibling!==null;)t=t.sibling,r=r.sibling=Mn(t,t.pendingProps),r.return=e;r.sibling=null}return e.child}function Hb(t,e,r){switch(e.tag){case 3:Ey(e),Si();break;case 5:Qv(e);break;case 1:Nt(e.type)&&Nl(e);break;case 4:mf(e,e.stateNode.containerInfo);break;case 10:var n=e.type._context,s=e.memoizedProps.value;Ee(Ml,n._currentValue),n._currentValue=s;break;case 13:if(n=e.memoizedState,n!==null)return n.dehydrated!==null?(Ee(Ne,Ne.current&1),e.flags|=128,null):r&e.child.childLanes?Ty(t,e,r):(Ee(Ne,Ne.current&1),t=an(t,e,r),t!==null?t.sibling:null);Ee(Ne,Ne.current&1);break;case 19:if(n=(r&e.childLanes)!==0,t.flags&128){if(n)return Cy(t,e,r);e.flags|=128}if(s=e.memoizedState,s!==null&&(s.rendering=null,s.tail=null,s.lastEffect=null),Ee(Ne,Ne.current),n)break;return null;case 22:case 23:return e.lanes=0,Sy(t,e,r)}return an(t,e,r)}var Py,zd,Ay,Ry;Py=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}};zd=function(){};Ay=function(t,e,r,n){var s=t.memoizedProps;if(s!==n){t=e.stateNode,fs(Ur.current);var i=null;switch(r){case"input":s=od(t,s),n=od(t,n),i=[];break;case"select":s=$e({},s,{value:void 0}),n=$e({},n,{value:void 0}),i=[];break;case"textarea":s=cd(t,s),n=cd(t,n),i=[];break;default:typeof s.onClick!="function"&&typeof n.onClick=="function"&&(t.onclick=Ol)}hd(r,n);var a;r=null;for(u in s)if(!n.hasOwnProperty(u)&&s.hasOwnProperty(u)&&s[u]!=null)if(u==="style"){var o=s[u];for(a in o)o.hasOwnProperty(a)&&(r||(r={}),r[a]="")}else u!=="dangerouslySetInnerHTML"&&u!=="children"&&u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&u!=="autoFocus"&&(Na.hasOwnProperty(u)?i||(i=[]):(i=i||[]).push(u,null));for(u in n){var l=n[u];if(o=s!=null?s[u]:void 0,n.hasOwnProperty(u)&&l!==o&&(l!=null||o!=null))if(u==="style")if(o){for(a in o)!o.hasOwnProperty(a)||l&&l.hasOwnProperty(a)||(r||(r={}),r[a]="");for(a in l)l.hasOwnProperty(a)&&o[a]!==l[a]&&(r||(r={}),r[a]=l[a])}else r||(i||(i=[]),i.push(u,r)),r=l;else u==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,o=o?o.__html:void 0,l!=null&&o!==l&&(i=i||[]).push(u,l)):u==="children"?typeof l!="string"&&typeof l!="number"||(i=i||[]).push(u,""+l):u!=="suppressContentEditableWarning"&&u!=="suppressHydrationWarning"&&(Na.hasOwnProperty(u)?(l!=null&&u==="onScroll"&&Ce("scroll",t),i||o===l||(i=[])):(i=i||[]).push(u,l))}r&&(i=i||[]).push("style",r);var u=i;(e.updateQueue=u)&&(e.flags|=4)}};Ry=function(t,e,r,n){r!==n&&(e.flags|=4)};function Yi(t,e){if(!Re)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 mt(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 Gb(t,e,r){var n=e.pendingProps;switch(lf(e),e.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return mt(e),null;case 1:return Nt(e.type)&&Il(),mt(e),null;case 3:return n=e.stateNode,Ei(),Ae(It),Ae(bt),vf(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(t===null||t.child===null)&&(Bo(e)?e.flags|=4:t===null||t.memoizedState.isDehydrated&&!(e.flags&256)||(e.flags|=1024,Er!==null&&(qd(Er),Er=null))),zd(t,e),mt(e),null;case 5:gf(e);var s=fs(Ha.current);if(r=e.type,t!==null&&e.stateNode!=null)Ay(t,e,r,n,s),t.ref!==e.ref&&(e.flags|=512,e.flags|=2097152);else{if(!n){if(e.stateNode===null)throw Error(z(166));return mt(e),null}if(t=fs(Ur.current),Bo(e)){n=e.stateNode,r=e.type;var i=e.memoizedProps;switch(n[Mr]=e,n[Va]=i,t=(e.mode&1)!==0,r){case"dialog":Ce("cancel",n),Ce("close",n);break;case"iframe":case"object":case"embed":Ce("load",n);break;case"video":case"audio":for(s=0;s<aa.length;s++)Ce(aa[s],n);break;case"source":Ce("error",n);break;case"img":case"image":case"link":Ce("error",n),Ce("load",n);break;case"details":Ce("toggle",n);break;case"input":Np(n,i),Ce("invalid",n);break;case"select":n._wrapperState={wasMultiple:!!i.multiple},Ce("invalid",n);break;case"textarea":jp(n,i),Ce("invalid",n)}hd(r,i),s=null;for(var a in i)if(i.hasOwnProperty(a)){var o=i[a];
vendor: 30,121 bytes, line 40
40a==="children"?typeof o=="string"?n.textContent!==o&&(i.suppressHydrationWarning!==!0&&Uo(n.textContent,o,t),s=["children",o]):typeof o=="number"&&n.textContent!==""+o&&(i.suppressHydrationWarning!==!0&&Uo(n.textContent,o,t),s=["children",""+o]):Na.hasOwnProperty(a)&&o!=null&&a==="onScroll"&&Ce("scroll",n)}switch(r){case"input":Io(n),Lp(n,i,!0);break;case"textarea":Io(n),Mp(n);break;case"select":case"option":break;default:typeof i.onClick=="function"&&(n.onclick=Ol)}n=s,e.updateQueue=n,n!==null&&(e.flags|=4)}else{a=s.nodeType===9?s:s.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=sv(r)),t==="http://www.w3.org/1999/xhtml"?r==="script"?(t=a.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[Mr]=e,t[Va]=n,Py(t,e,!1,!1),e.stateNode=t;e:{switch(a=fd(r,n),r){case"dialog":Ce("cancel",t),Ce("close",t),s=n;break;case"iframe":case"object":case"embed":Ce("load",t),s=n;break;case"video":case"audio":for(s=0;s<aa.length;s++)Ce(aa[s],t);s=n;break;case"source":Ce("error",t),s=n;break;case"img":case"image":case"link":Ce("error",t),Ce("load",t),s=n;break;case"details":Ce("toggle",t),s=n;break;case"input":Np(t,n),s=od(t,n),Ce("invalid",t);break;case"option":s=n;break;case"select":t._wrapperState={wasMultiple:!!n.multiple},s=$e({},n,{value:void 0}),Ce("invalid",t);break;case"textarea":jp(t,n),s=cd(t,n),Ce("invalid",t);break;default:s=n}hd(r,s),o=s;for(i in o)if(o.hasOwnProperty(i)){var l=o[i];i==="style"?ov(t,l):i==="dangerouslySetInnerHTML"?(l=l?l.__html:void 0,l!=null&&iv(t,l)):i==="children"?typeof l=="string"?(r!=="textarea"||l!=="")&&La(t,l):typeof l=="number"&&La(t,""+l):i!=="suppressContentEditableWarning"&&i!=="suppressHydrationWarning"&&i!=="autoFocus"&&(Na.hasOwnProperty(i)?l!=null&&i==="onScroll"&&Ce("scroll",t):l!=null&&Gh(t,i,l,a))}switch(r){case"input":Io(t),Lp(t,n,!1);break;case"textarea":Io(t),Mp(t);break;case"option":n.value!=null&&t.setAttribute("value",""+Bn(n.value));break;case"select":t.multiple=!!n.multiple,i=n.value,i!=null?ci(t,!!n.multiple,i,!1):n.defaultValue!=null&&ci(t,!!n.multiple,n.defaultValue,!0);break;default:typeof s.onClick=="function"&&(t.onclick=Ol)}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)}return mt(e),null;case 6:if(t&&e.stateNode!=null)Ry(t,e,t.memoizedProps,n);else{if(typeof n!="string"&&e.stateNode===null)throw Error(z(166));if(r=fs(Ha.current),fs(Ur.current),Bo(e)){if(n=e.stateNode,r=e.memoizedProps,n[Mr]=e,(i=n.nodeValue!==r)&&(t=Zt,t!==null))switch(t.tag){case 3:Uo(n.nodeValue,r,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Uo(n.nodeValue,r,(t.mode&1)!==0)}i&&(e.flags|=4)}else n=(r.nodeType===9?r:r.ownerDocument).createTextNode(n),n[Mr]=e,e.stateNode=n}return mt(e),null;case 13:if(Ae(Ne),n=e.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(Re&&qt!==null&&e.mode&1&&!(e.flags&128))Kv(),Si(),e.flags|=98560,i=!1;else if(i=Bo(e),n!==null&&n.dehydrated!==null){if(t===null){if(!i)throw Error(z(318));if(i=e.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(z(317));i[Mr]=e}else Si(),!(e.flags&128)&&(e.memoizedState=null),e.flags|=4;mt(e),i=!1}else Er!==null&&(qd(Er),Er=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||Ne.current&1?rt===0&&(rt=3):Af())),e.updateQueue!==null&&(e.flags|=4),mt(e),null);case 4:return Ei(),zd(t,e),t===null&&Ba(e.stateNode.containerInfo),mt(e),null;case 10:return hf(e.type._context),mt(e),null;case 17:return Nt(e.type)&&Il(),mt(e),null;case 19:if(Ae(Ne),i=e.memoizedState,i===null)return mt(e),null;if(n=(e.flags&128)!==0,a=i.rendering,a===null)if(n)Yi(i,!1);else{if(rt!==0||t!==null&&t.flags&128)for(t=e.child;t!==null;){if(a=zl(t),a!==null){for(e.flags|=128,Yi(i,!1),n=a.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,a=i.alternate,a===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=a.childLanes,i.lanes=a.lanes,i.child=a.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=a.memoizedProps,i.memoizedState=a.memoizedState,i.updateQueue=a.updateQueue,i.type=a.type,t=a.dependencies,i.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),r=r.sibling;return Ee(Ne,Ne.current&1|2),e.child}t=t.sibling}i.tail!==null&&Ge()>Ci&&(e.flags|=128,n=!0,Yi(i,!1),e.lanes=4194304)}else{if(!n)if(t=zl(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Yi(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!Re)return mt(e),null}else 2*Ge()-i.renderingStartTime>Ci&&r!==1073741824&&(e.flags|=128,n=!0,Yi(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(r=i.last,r!==null?r.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Ge(),e.sibling=null,r=Ne.current,Ee(Ne,n?r&1|2:r&1),e):(mt(e),null);case 22:case 23:return Pf(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&e.mode&1?Ut&1073741824&&(mt(e),e.subtreeFlags&6&&(e.flags|=8192)):mt(e),null;case 24:return null;case 25:return null}throw Error(z(156,e.tag))}function qb(t,e){switch(lf(e),e.tag){case 1:return Nt(e.type)&&Il(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return Ei(),Ae(It),Ae(bt),vf(),t=e.flags,t&65536&&!(t&128)?(e.flags=t&-65537|128,e):null;case 5:return gf(e),null;case 13:if(Ae(Ne),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(z(340));Si()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return Ae(Ne),null;case 4:return Ei(),null;case 10:return hf(e.type._context),null;case 22:case 23:return Pf(),null;case 24:return null;default:return null}}var Wo=!1,vt=!1,Kb=typeof WeakSet=="function"?WeakSet:Set,Q=null;function si(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){Be(t,e,n)}else r.current=null}function Ud(t,e,r){try{r()}catch(n){Be(t,e,n)}}var Em=!1;function Jb(t,e){if(Sd=Pl,t=jv(),af(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 a=0,o=-1,l=-1,u=0,c=0,d=t,f=null;t:for(;;){for(var m;d!==r||s!==0&&d.nodeType!==3||(o=a+s),d!==i||n!==0&&d.nodeType!==3||(l=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(m=d.firstChild)!==null;)f=d,d=m;for(;;){if(d===t)break t;if(f===r&&++u===s&&(o=a),f===i&&++c===n&&(l=a),(m=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=m}r=o===-1||l===-1?null:{start:o,end:l}}else r=null}r=r||{start:0,end:0}}else r=null;for(kd={focusedElem:t,selectionRange:r},Pl=!1,Q=e;Q!==null;)if(e=Q,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,Q=t;else for(;Q!==null;){e=Q;try{var y=e.alternate;if(e.flags&1024)switch(e.tag){case 0:case 11:case 15:break;case 1:if(y!==null){var g=y.memoizedProps,b=y.memoizedState,_=e.stateNode,v=_.getSnapshotBeforeUpdate(e.elementType===e.type?g:br(e.type,g),b);_.__reactInternalSnapshotBeforeUpdate=v}break;case 3:var w=e.stateNode.containerInfo;w.nodeType===1?w.textContent="":w.nodeType===9&&w.documentElement&&w.removeChild(w.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(z(163))}}catch(h){Be(e,e.return,h)}if(t=e.sibling,t!==null){t.return=e.return,Q=t;break}Q=e.return}return y=Em,Em=!1,y}function _a(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&&Ud(e,r,i)}s=s.next}while(s!==n)}}function Nu(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 Bd(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 Oy(t){var e=t.alternate;e!==null&&(t.alternate=null,Oy(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[Mr],delete e[Va],delete e[Cd],delete e[Ob],delete e[Ib])),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 Iy(t){return t.tag===5||t.tag===3||t.tag===4}function Tm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Iy(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 Fd(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=Ol));else if(n!==4&&(t=t.child,t!==null))for(Fd(t,e,r),t=t.sibling;t!==null;)Fd(t,e,r),t=t.sibling}function Vd(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(Vd(t,e,r),t=t.sibling;t!==null;)Vd(t,e,r),t=t.sibling}var ut=null,kr=!1;function hn(t,e,r){for(r=r.child;r!==null;)Ny(t,e,r),r=r.sibling}function Ny(t,e,r){if(zr&&typeof zr.onCommitFiberUnmount=="function")try{zr.onCommitFiberUnmount(Eu,r)}catch{}switch(r.tag){case 5:vt||si(r,e);case 6:var n=ut,s=kr;ut=null,hn(t,e,r),ut=n,kr=s,ut!==null&&(kr?(t=ut,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):ut.removeChild(r.stateNode));break;case 18:ut!==null&&(kr?(t=ut,r=r.stateNode,t.nodeType===8?wc(t.parentNode,r):t.nodeType===1&&wc(t,r),$a(t)):wc(ut,r.stateNode));break;case 4:n=ut,s=kr,ut=r.stateNode.containerInfo,kr=!0,hn(t,e,r),ut=n,kr=s;break;case 0:case 11:case 14:case 15:if(!vt&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){s=n=n.next;do{var i=s,a=i.destroy;i=i.tag,a!==void 0&&(i&2||i&4)&&Ud(r,e,a),s=s.next}while(s!==n)}hn(t,e,r);break;case 1:if(!vt&&(si(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(o){Be(r,e,o)}hn(t,e,r);break;case 21:hn(t,e,r);break;case 22:r.mode&1?(vt=(n=vt)||r.memoizedState!==null,hn(t,e,r),vt=n):hn(t,e,r);break;default:hn(t,e,r)}}function Cm(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Kb),e.forEach(function(n){var s=sS.bind(null,t,n);r.has(n)||(r.add(n),n.then(s,s))})}}function yr(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,a=e,o=a;e:for(;o!==null;){switch(o.tag){case 5:ut=o.stateNode,kr=!1;break e;case 3:ut=o.stateNode.containerInfo,kr=!0;break e;case 4:ut=o.stateNode.containerInfo,kr=!0;break e}o=o.return}if(ut===null)throw Error(z(160));Ny(i,a,s),ut=null,kr=!1;var l=s.alternate;l!==null&&(l.return=null),s.return=null}catch(u){Be(s,e,u)}}if(e.subtreeFlags&12854)for(e=e.child;e!==null;)Ly(e,t),e=e.sibling}function Ly(t,e){var r=t.alternate,n=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(yr(e,t),Or(t),n&4){try{_a(3,t,t.return),Nu(3,t)}catch(g){Be(t,t.return,g)}try{_a(5,t,t.return)}catch(g){Be(t,t.return,g)}}break;case 1:yr(e,t),Or(t),n&512&&r!==null&&si(r,r.return);break;case 5:if(yr(e,t),Or(t),n&512&&r!==null&&si(r,r.return),t.flags&32){var s=t.stateNode;try{La(s,"")}catch(g){Be(t,t.return,g)}}if(n&4&&(s=t.stateNode,s!=null)){var i=t.memoizedProps,a=r!==null?r.memoizedProps:i,o=t.type,l=t.updateQueue;if(t.updateQueue=null,l!==null)try{o==="input"&&i.type==="radio"&&i.name!=null&&rv(s,i),fd(o,a);var u=fd(o,i);for(a=0;a<l.length;a+=2){var c=l[a],d=l[a+1];c==="style"?ov(s,d):c==="dangerouslySetInnerHTML"?iv(s,d):c==="children"?La(s,d):Gh(s,c,d,u)}switch(o){case"input":ld(s,i);break;case"textarea":nv(s,i);break;case"select":var f=s._wrapperState.wasMultiple;s._wrapperState.wasMultiple=!!i.multiple;var m=i.value;m!=null?ci(s,!!i.multiple,m,!1):f!==!!i.multiple&&(i.defaultValue!=null?ci(s,!!i.multiple,i.defaultValue,!0):ci(s,!!i.multiple,i.multiple?[]:"",!1))}s[Va]=i}catch(g){Be(t,t.return,g)}}break;case 6:if(yr(e,t),Or(t),n&4){if(t.stateNode===null)throw Error(z(162));s=t.stateNode,i=t.memoizedProps;try{s.nodeValue=i}catch(g){Be(t,t.return,g)}}break;case 3:if(yr(e,t),Or(t),n&4&&r!==null&&r.memoizedState.isDehydrated)try{$a(e.containerInfo)}catch(g){Be(t,t.return,g)}break;case 4:yr(e,t),Or(t);break;case 13:yr(e,t),Or(t),s=t.child,s.flags&8192&&(i=s.memoizedState!==null,s.stateNode.isHidden=i,!i||s.alternate!==null&&s.alternate.memoizedState!==null||(Tf=Ge())),n&4&&Cm(t);break;case 22:if(c=r!==null&&r.memoizedState!==null,t.mode&1?(vt=(u=vt)||c,yr(e,t),vt=u):yr(e,t),Or(t),n&8192){if(u=t.memoizedState!==null,(t.stateNode.isHidden=u)&&!c&&t.mode&1)for(Q=t,c=t.child;c!==null;){for(d=Q=c;Q!==null;){switch(f=Q,m=f.child,f.tag){case 0:case 11:case 14:case 15:_a(4,f,f.return);break;case 1:si(f,f.return);var y=f.stateNode;if(typeof y.componentWillUnmount=="function"){n=f,r=f.return;try{e=n,y.props=e.memoizedProps,y.state=e.memoizedState,y.componentWillUnmount()}catch(g){Be(n,r,g)}}break;case 5:si(f,f.return);break;case 22:if(f.memoizedState!==null){Am(d);continue}}m!==null?(m.return=f,Q=m):Am(d)}c=c.sibling}e:for(c=null,d=t;;){if(d.tag===5){if(c===null){c=d;try{s=d.stateNode,u?(i=s.style,typeof i.setProperty=="function"?i.setProperty("display","none","important"):i.display="none"):(o=d.stateNode,l=d.memoizedProps.style,a=l!=null&&l.hasOwnProperty("display")?l.display:null,o.style.display=av("display",a))}catch(g){Be(t,t.return,g)}}}else if(d.tag===6){if(c===null)try{d.stateNode.nodeValue=u?"":d.memoizedProps}catch(g){Be(t,t.return,g)}}else if((d.tag!==22&&d.tag!==23||d.memoizedState===null||d===t)&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;c===d&&(c=null),d=d.return}c===d&&(c=null),d.sibling.return=d.return,d=d.sibling}}break;case 19:yr(e,t),Or(t),n&4&&Cm(t);break;case 21:break;default:yr(e,t),Or(t)}}function Or(t){var e=t.flags;if(e&2){try{e:{for(var r=t.return;r!==null;){if(Iy(r)){var n=r;break e}r=r.return}throw Error(z(160))}switch(n.tag){case 5:var s=n.stateNode;n.flags&32&&(La(s,""),n.flags&=-33);var i=Tm(t);Vd(t,i,s);break;case 3:case 4:var a=n.stateNode.containerInfo,o=Tm(t);Fd(t,o,a);break;default:throw Error(z(161))}}catch(l){Be(t,t.return,l)}t.flags&=-3}e&4096&&(t.flags&=-4097)}function Zb(t,e,r){Q=t,jy(t)}function jy(t,e,r){for(var n=(t.mode&1)!==0;Q!==null;){var s=Q,i=s.child;if(s.tag===22&&n){var a=s.memoizedState!==null||Wo;if(!a){var o=s.alternate,l=o!==null&&o.memoizedState!==null||vt;o=Wo;var u=vt;if(Wo=a,(vt=l)&&!u)for(Q=s;Q!==null;)a=Q,l=a.child,a.tag===22&&a.memoizedState!==null?Rm(s):l!==null?(l.return=a,Q=l):Rm(s);for(;i!==null;)Q=i,jy(i),i=i.sibling;Q=s,Wo=o,vt=u}Pm(t)}else s.subtreeFlags&8772&&i!==null?(i.return=s,Q=i):Pm(t)}}function Pm(t){for(;Q!==null;){var e=Q;if(e.flags&8772){var r=e.alternate;try{if(e.flags&8772)switch(e.tag){case 0:case 11:case 15:vt||Nu(5,e);break;case 1:var n=e.stateNode;if(e.flags&4&&!vt)if(r===null)n.componentDidMount();else{var s=e.elementType===e.type?r.memoizedProps:br(e.type,r.memoizedProps);n.componentDidUpdate(s,r.memoizedState,n.__reactInternalSnapshotBeforeUpdate)}var i=e.updateQueue;i!==null&&hm(e,i,n);break;case 3:var a=e.updateQueue;if(a!==null){if(r=null,e.child!==null)switch(e.child.tag){case 5:r=e.child.stateNode;break;case 1:r=e.child.stateNode}hm(e,a,r)}break;case 5:var o=e.stateNode;if(r===null&&e.flags&4){r=o;var l=e.memoizedProps;switch(e.type){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break;case"img":l.src&&(r.src=l.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 c=u.memoizedState;if(c!==null){var d=c.dehydrated;d!==null&&$a(d)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(z(163))}vt||e.flags&512&&Bd(e)}catch(f){Be(e,e.return,f)}}if(e===t){Q=null;break}if(r=e.sibling,r!==null){r.return=e.return,Q=r;break}Q=e.return}}function Am(t){for(;Q!==null;){var e=Q;if(e===t){Q=null;break}var r=e.sibling;if(r!==null){r.return=e.return,Q=r;break}Q=e.return}}function Rm(t){for(;Q!==null;){var e=Q;try{switch(e.tag){case 0:case 11:case 15:var r=e.return;try{Nu(4,e)}catch(l){Be(e,r,l)}break;case 1:var n=e.stateNode;if(typeof n.componentDidMount=="function"){var s=e.return;try{n.componentDidMount()}catch(l){Be(e,s,l)}}var i=e.return;try{Bd(e)}catch(l){Be(e,i,l)}break;case 5:var a=e.return;try{Bd(e)}catch(l){Be(e,a,l)}}}catch(l){Be(e,e.return,l)}if(e===t){Q=null;break}var o=e.sibling;if(o!==null){o.return=e.return,Q=o;break}Q=e.return}}var Yb=Math.ceil,Fl=cn.ReactCurrentDispatcher,kf=cn.ReactCurrentOwner,hr=cn.ReactCurrentBatchConfig,me=0,at=null,Qe=null,dt=0,Ut=0,ii=Zn(0),rt=0,Ja=null,Ts=0,Lu=0,Ef=0,xa=null,At=null,Tf=0,Ci=1/0,Hr=null,Vl=!1,Wd=null,Ln=null,Ho=!1,bn=null,Wl=0,ba=0,Hd=null,hl=-1,fl=0;function Et(){return me&6?Ge():hl!==-1?hl:hl=Ge()}function jn(t){return t.mode&1?me&2&&dt!==0?dt&-dt:Lb.transition!==null?(fl===0&&(fl=wv()),fl):(t=_e,t!==0||(t=window.event,t=t===void 0?16:Tv(t.type)),t):1}function Ar(t,e,r,n){if(50<ba)throw ba=0,Hd=null,Error(z(185));wo(t,r,n),(!(me&2)||t!==at)&&(t===at&&(!(me&2)&&(Lu|=r),rt===4&&yn(t,dt)),Lt(t,n),r===1&&me===0&&!(e.mode&1)&&(Ci=Ge()+500,Ru&&Yn()))}function Lt(t,e){var r=t.callbackNode;Lx(t,e);var n=Cl(t,t===at?dt:0);if(n===0)r!==null&&zp(r),t.callbackNode=null,t.callbackPriority=0;else if(e=n&-n,t.callbackPriority!==e){if(r!=null&&zp(r),e===1)t.tag===0?Nb(Om.bind(null,t)):Hv(Om.bind(null,t)),Ab(function(){!(me&6)&&Yn()}),r=null;else{switch(_v(n)){case 1:r=Yh;break;case 4:r=vv;break;case 16:r=Tl;break;case 536870912:r=yv;break;default:r=Tl}r=Vy(r,My.bind(null,t))}t.callbackPriority=e,t.callbackNode=r}}function My(t,e){if(hl=-1,fl=0,me&6)throw Error(z(327));var r=t.callbackNode;if(mi()&&t.callbackNode!==r)return null;var n=Cl(t,t===at?dt:0);if(n===0)return null;if(n&30||n&t.expiredLanes||e)e=Hl(t,n);else{e=n;var s=me;me|=2;var i=$y();(at!==t||dt!==e)&&(Hr=null,Ci=Ge()+500,vs(t,e));do try{eS();break}catch(o){Dy(t,o)}while(!0);df(),Fl.current=i,me=s,Qe!==null?e=0:(at=null,dt=0,e=rt)}if(e!==0){if(e===2&&(s=yd(t),s!==0&&(n=s,e=Gd(t,s))),e===1)throw r=Ja,vs(t,0),yn(t,n),Lt(t,Ge()),r;if(e===6)yn(t,n);else{if(s=t.current.alternate,!(n&30)&&!Xb(s)&&(e=Hl(t,n),e===2&&(i=yd(t),i!==0&&(n=i,e=Gd(t,i))),e===1))throw r=Ja,vs(t,0),yn(t,n),Lt(t,Ge()),r;switch(t.finishedWork=s,t.finishedLanes=n,e){case 0:case 1:throw Error(z(345));case 2:os(t,At,Hr);break;case 3:if(yn(t,n),(n&130023424)===n&&(e=Tf+500-Ge(),10<e)){if(Cl(t,0)!==0)break;if(s=t.suspendedLanes,(s&n)!==n){Et(),t.pingedLanes|=t.suspendedLanes&s;break}t.timeoutHandle=Td(os.bind(null,t,At,Hr),e);break}os(t,At,Hr);break;case 4:if(yn(t,n),(n&4194240)===n)break;for(e=t.eventTimes,s=-1;0<n;){var a=31-Pr(n);i=1<<a,a=e[a],a>s&&(s=a),n&=~i}if(n=s,n=Ge()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Yb(n/1960))-n,10<n){t.timeoutHandle=Td(os.bind(null,t,At,Hr),n);break}os(t,At,Hr);break;case 5:os(t,At,Hr);break;default:throw Error(z(329))}}}return Lt(t,Ge()),t.callbackNode===r?My.bind(null,t):null}function Gd(t,e){var r=xa;return t.current.memoizedState.isDehydrated&&(vs(t,e).flags|=256),t=Hl(t,e),t!==2&&(e=At,At=r,e!==null&&qd(e)),t}function qd(t){At===null?At=t:At.push.apply(At,t)}function Xb(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(!Rr(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 yn(t,e){for(e&=~Ef,e&=~Lu,t.suspendedLanes|=e,t.pingedLanes&=~e,t=t.expirationTimes;0<e;){var r=31-Pr(e),n=1<<r;t[r]=-1,e&=~n}}function Om(t){if(me&6)throw Error(z(327));mi();var e=Cl(t,0);if(!(e&1))return Lt(t,Ge()),null;var r=Hl(t,e);if(t.tag!==0&&r===2){var n=yd(t);n!==0&&(e=n,r=Gd(t,n))}if(r===1)throw r=Ja,vs(t,0),yn(t,e),Lt(t,Ge()),r;if(r===6)throw Error(z(345));return t.finishedWork=t.current.alternate,t.finishedLanes=e,os(t,At,Hr),Lt(t,Ge()),null}function Cf(t,e){var r=me;me|=1;try{return t(e)}finally{me=r,me===0&&(Ci=Ge()+500,Ru&&Yn())}}function Cs(t){bn!==null&&bn.tag===0&&!(me&6)&&mi();var e=me;me|=1;var r=hr.transition,n=_e;try{if(hr.transition=null,_e=1,t)return t()}finally{_e=n,hr.transition=r,me=e,!(me&6)&&Yn()}}function Pf(){Ut=ii.current,Ae(ii)}function vs(t,e){t.finishedWork=null,t.finishedLanes=0;var r=t.timeoutHandle;if(r!==-1&&(t.timeoutHandle=-1,Pb(r)),Qe!==null)for(r=Qe.return;r!==null;){var n=r;switch(lf(n),n.tag){case 1:n=n.type.childContextTypes,n!=null&&Il();break;case 3:Ei(),Ae(It),Ae(bt),vf();break;case 5:gf(n);break;case 4:Ei();break;case 13:Ae(Ne);break;case 19:Ae(Ne);break;case 10:hf(n.type._context);break;case 22:case 23:Pf()}r=r.return}if(at=t,Qe=t=Mn(t.current,null),dt=Ut=e,rt=0,Ja=null,Ef=Lu=Ts=0,At=xa=null,hs!==null){for(e=0;e<hs.length;e++)if(r=hs[e],n=r.interleaved,n!==null){r.interleaved=null;var s=n.next,i=r.pending;if(i!==null){var a=i.next;i.next=s,n.next=a}r.pending=n}hs=null}return t}function Dy(t,e){do{var r=Qe;try{if(df(),ul.current=Bl,Ul){for(var n=De.memoizedState;n!==null;){var s=n.queue;s!==null&&(s.pending=null),n=n.next}Ul=!1}if(Es=0,it=tt=De=null,wa=!1,Ga=0,kf.current=null,r===null||r.return===null){rt=1,Ja=e,Qe=null;break}e:{var i=t,a=r.return,o=r,l=e;if(e=dt,o.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){var u=l,c=o,d=c.tag;if(!(c.mode&1)&&(d===0||d===11||d===15)){var f=c.alternate;f?(c.updateQueue=f.updateQueue,c.memoizedState=f.memoizedState,c.lanes=f.lanes):(c.updateQueue=null,c.memoizedState=null)}var m=ym(a);if(m!==null){m.flags&=-257,wm(m,a,o,i,e),m.mode&1&&vm(i,u,e),e=m,l=u;var y=e.updateQueue;if(y===null){var g=new Set;g.add(l),e.updateQueue=g}else y.add(l);break e}else{if(!(e&1)){vm(i,u,e),Af();break e}l=Error(z(426))}}else if(Re&&o.mode&1){var b=ym(a);if(b!==null){!(b.flags&65536)&&(b.flags|=256),wm(b,a,o,i,e),uf(Ti(l,o));break e}}i=l=Ti(l,o),rt!==4&&(rt=2),xa===null?xa=[i]:xa.push(i),i=a;do{switch(i.tag){case 3:i.flags|=65536,e&=-e,i.lanes|=e;var _=_y(i,l,e);dm(i,_);break e;case 1:o=l;var v=i.type,w=i.stateNode;if(!(i.flags&128)&&(typeof v.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ln===null||!Ln.has(w)))){i.flags|=65536,e&=-e,i.lanes|=e;var h=xy(i,o,e);dm(i,h);break e}}i=i.return}while(i!==null)}Uy(r)}catch(p){e=p,Qe===r&&r!==null&&(Qe=r=r.return);continue}break}while(!0)}function $y(){var t=Fl.current;return Fl.current=Bl,t===null?Bl:t}function Af(){(rt===0||rt===3||rt===2)&&(rt=4),at===null||!(Ts&268435455)&&!(Lu&268435455)||yn(at,dt)}function Hl(t,e){var r=me;me|=2;var n=$y();(at!==t||dt!==e)&&(Hr=null,vs(t,e));do try{Qb();break}catch(s){Dy(t,s)}while(!0);if(df(),me=r,Fl.current=n,Qe!==null)throw Error(z(261));return at=null,dt=0,rt}function Qb(){for(;Qe!==null;)zy(Qe)}function eS(){for(;Qe!==null&&!Ex();)zy(Qe)}function zy(t){var e=Fy(t.alternate,t,Ut);t.memoizedProps=t.pendingProps,e===null?Uy(t):Qe=e,kf.current=null}function Uy(t){var e=t;do{var r=e.alternate;if(t=e.return,e.flags&32768){if(r=qb(r,e),r!==null){r.flags&=32767,Qe=r;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{rt=6,Qe=null;return}}else if(r=Gb(r,e,Ut),r!==null){Qe=r;return}if(e=e.sibling,e!==null){Qe=e;return}Qe=e=t}while(e!==null);rt===0&&(rt=5)}function os(t,e,r){var n=_e,s=hr.transition;try{hr.transition=null,_e=1,tS(t,e,r,n)}finally{hr.transition=s,_e=n}return null}function tS(t,e,r,n){do mi();while(bn!==null);if(me&6)throw Error(z(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(z(177));t.callbackNode=null,t.callbackPriority=0;var i=r.lanes|r.childLanes;if(jx(t,i),t===at&&(Qe=at=null,dt=0),!(r.subtreeFlags&2064)&&!(r.flags&2064)||Ho||(Ho=!0,Vy(Tl,function(){return mi(),null})),i=(r.flags&15990)!==0,r.subtreeFlags&15990||i){i=hr.transition,hr.transition=null;var a=_e;_e=1;var o=me;me|=4,kf.current=null,Jb(t,r),Ly(r,t),xb(kd),Pl=!!Sd,kd=Sd=null,t.current=r,Zb(r),Tx(),me=o,_e=a,hr.transition=i}else t.current=r;if(Ho&&(Ho=!1,bn=t,Wl=s),i=t.pendingLanes,i===0&&(Ln=null),Ax(r.stateNode),Lt(t,Ge()),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(Vl)throw Vl=!1,t=Wd,Wd=null,t;return Wl&1&&t.tag!==0&&mi(),i=t.pendingLanes,i&1?t===Hd?ba++:(ba=0,Hd=t):ba=0,Yn(),null}function mi(){if(bn!==null){var t=_v(Wl),e=hr.transition,r=_e;try{if(hr.transition=null,_e=16>t?16:t,bn===null)var n=!1;else{if(t=bn,bn=null,Wl=0,me&6)throw Error(z(331));var s=me;for(me|=4,Q=t.current;Q!==null;){var i=Q,a=i.child;if(Q.flags&16){var o=i.deletions;if(o!==null){for(var l=0;l<o.length;l++){var u=o[l];for(Q=u;Q!==null;){var c=Q;switch(c.tag){case 0:case 11:case 15:_a(8,c,i)}var d=c.child;if(d!==null)d.return=c,Q=d;else for(;Q!==null;){c=Q;var f=c.sibling,m=c.return;if(Oy(c),c===u){Q=null;break}if(f!==null){f.return=m,Q=f;break}Q=m}}}var y=i.alternate;if(y!==null){var g=y.child;if(g!==null){y.child=null;do{var b=g.sibling;g.sibling=null,g=b}while(g!==null)}}Q=i}}if(i.subtreeFlags&2064&&a!==null)a.return=i,Q=a;else e:for(;Q!==null;){if(i=Q,i.flags&2048)switch(i.tag){case 0:case 11:case 15:_a(9,i,i.return)}var _=i.sibling;if(_!==null){_.return=i.return,Q=_;break e}Q=i.return}}var v=t.current;for(Q=v;Q!==null;){a=Q;var w=a.child;if(a.subtreeFlags&2064&&w!==null)w.return=a,Q=w;else e:for(a=v;Q!==null;){if(o=Q,o.flags&2048)try{switch(o.tag){case 0:case 11:case 15:Nu(9,o)}}catch(p){Be(o,o.return,p)}if(o===a){Q=null;break e}var h=o.sibling;if(h!==null){h.return=o.return,Q=h;break e}Q=o.return}}if(me=s,Yn(),zr&&typeof zr.onPostCommitFiberRoot=="function")try{zr.onPostCommitFiberRoot(Eu,t)}catch{}n=!0}return n}finally{_e=r,hr.transition=e}}return!1}function Im(t,e,r){e=Ti(r,e),e=_y(t,e,1),t=Nn(t,e,1),e=Et(),t!==null&&(wo(t,1,e),Lt(t,e))}function Be(t,e,r){if(t.tag===3)Im(t,t,r);else for(;e!==null;){if(e.tag===3){Im(e,t,r);break}else if(e.tag===1){var n=e.stateNode;if(typeof e.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(Ln===null||!Ln.has(n))){t=Ti(r,t),t=xy(e,t,1),e=Nn(e,t,1),t=Et(),e!==null&&(wo(e,1,t),Lt(e,t));break}}e=e.return}}function rS(t,e,r){var n=t.pingCache;n!==null&&n.delete(e),e=Et(),t.pingedLanes|=t.suspendedLanes&r,at===t&&(dt&r)===r&&(rt===4||rt===3&&(dt&130023424)===dt&&500>Ge()-Tf?vs(t,0):Ef|=r),Lt(t,e)}function By(t,e){e===0&&(t.mode&1?(e=jo,jo<<=1,!(jo&130023424)&&(jo=4194304)):e=1);var r=Et();t=sn(t,e),t!==null&&(wo(t,e,r),Lt(t,r))}function nS(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),By(t,r)}function sS(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(z(314))}n!==null&&n.delete(e),By(t,r)}var Fy;Fy=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||It.current)Ot=!0;else{if(!(t.lanes&r)&&!(e.flags&128))return Ot=!1,Hb(t,e,r);Ot=!!(t.flags&131072)}else Ot=!1,Re&&e.flags&1048576&&Gv(e,jl,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;dl(t,e),t=e.pendingProps;var s=bi(e,bt.current);pi(e,r),s=wf(null,e,n,t,s,r);var i=_f();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,Nt(n)?(i=!0,Nl(e)):i=!1,e.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,pf(e),s.updater=Iu,e.stateNode=s,s._reactInternals=e,Nd(e,n,t,r),e=Md(null,e,n,!0,i,r)):(e.tag=0,Re&&i&&of(e),St(null,e,s,r),e=e.child),e;case 16:n=e.elementType;e:{switch(dl(t,e),t=e.pendingProps,s=n._init,n=s(n._payload),e.type=n,s=e.tag=aS(n),t=br(n,t),s){case 0:e=jd(null,e,n,t,r);break e;case 1:e=bm(null,e,n,t,r);break e;case 11:e=_m(null,e,n,t,r);break e;case 14:e=xm(null,e,n,br(n.type,t),r);break e}throw Error(z(306,n,""))}return e;case 0:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:br(n,s),jd(t,e,n,s,r);case 1:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:br(n,s),bm(t,e,n,s,r);case 3:e:{if(Ey(e),t===null)throw Error(z(387));n=e.pendingProps,i=e.memoizedState,s=i.element,Xv(t,e),$l(e,n,null,r);var a=e.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){s=Ti(Error(z(423)),e),e=Sm(t,e,n,r,s);break e}else if(n!==s){s=Ti(Error(z(424)),e),e=Sm(t,e,n,r,s);break e}else for(qt=In(e.stateNode.containerInfo.firstChild),Zt=e,Re=!0,Er=null,r=Zv(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(Si(),n===s){e=an(t,e,r);break e}St(t,e,n,r)}e=e.child}return e;case 5:return Qv(e),t===null&&Rd(e),n=e.type,s=e.pendingProps,i=t!==null?t.memoizedProps:null,a=s.children,Ed(n,s)?a=null:i!==null&&Ed(n,i)&&(e.flags|=32),ky(t,e),St(t,e,a,r),e.child;case 6:return t===null&&Rd(e),null;case 13:return Ty(t,e,r);case 4:return mf(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=ki(e,null,n,r):St(t,e,n,r),e.child;case 11:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:br(n,s),_m(t,e,n,s,r);case 7:return St(t,e,e.pendingProps,r),e.child;case 8:return St(t,e,e.pendingProps.children,r),e.child;case 12:return St(t,e,e.pendingProps.children,r),e.child;
vendor: 4,549 bytes, line 40
40case 10:e:{if(n=e.type._context,s=e.pendingProps,i=e.memoizedProps,a=s.value,Ee(Ml,n._currentValue),n._currentValue=a,i!==null)if(Rr(i.value,a)){if(i.children===s.children&&!It.current){e=an(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){a=i.child;for(var l=o.firstContext;l!==null;){if(l.context===n){if(i.tag===1){l=tn(-1,r&-r),l.tag=2;var u=i.updateQueue;if(u!==null){u=u.shared;var c=u.pending;c===null?l.next=l:(l.next=c.next,c.next=l),u.pending=l}}i.lanes|=r,l=i.alternate,l!==null&&(l.lanes|=r),Od(i.return,r,e),o.lanes|=r;break}l=l.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(z(341));a.lanes|=r,o=a.alternate,o!==null&&(o.lanes|=r),Od(a,r,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}St(t,e,s.children,r),e=e.child}return e;case 9:return s=e.type,n=e.pendingProps.children,pi(e,r),s=fr(s),n=n(s),e.flags|=1,St(t,e,n,r),e.child;case 14:return n=e.type,s=br(n,e.pendingProps),s=br(n.type,s),xm(t,e,n,s,r);case 15:return by(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,s=e.pendingProps,s=e.elementType===n?s:br(n,s),dl(t,e),e.tag=1,Nt(n)?(t=!0,Nl(e)):t=!1,pi(e,r),wy(e,n,s),Nd(e,n,s,r),Md(null,e,n,!0,t,r);case 19:return Cy(t,e,r);case 22:return Sy(t,e,r)}throw Error(z(156,e.tag))};function Vy(t,e){return gv(t,e)}function iS(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 ur(t,e,r,n){return new iS(t,e,r,n)}function Rf(t){return t=t.prototype,!(!t||!t.isReactComponent)}function aS(t){if(typeof t=="function")return Rf(t)?1:0;if(t!=null){if(t=t.$$typeof,t===Kh)return 11;if(t===Jh)return 14}return 2}function Mn(t,e){var r=t.alternate;return r===null?(r=ur(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 pl(t,e,r,n,s,i){var a=2;if(n=t,typeof t=="function")Rf(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case Js:return ys(r.children,s,i,e);case qh:a=8,s|=8;break;case nd:return t=ur(12,r,e,s|2),t.elementType=nd,t.lanes=i,t;case sd:return t=ur(13,r,e,s),t.elementType=sd,t.lanes=i,t;case id:return t=ur(19,r,e,s),t.elementType=id,t.lanes=i,t;case Q0:return ju(r,s,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Y0:a=10;break e;case X0:a=9;break e;case Kh:a=11;break e;case Jh:a=14;break e;case fn:a=16,n=null;break e}throw Error(z(130,t==null?t:typeof t,""))}return e=ur(a,r,e,s),e.elementType=t,e.type=n,e.lanes=i,e}function ys(t,e,r,n){return t=ur(7,t,n,e),t.lanes=r,t}function ju(t,e,r,n){return t=ur(22,t,n,e),t.elementType=Q0,t.lanes=r,t.stateNode={isHidden:!1},t}function Cc(t,e,r){return t=ur(6,t,null,e),t.lanes=r,t}function Pc(t,e,r){return e=ur(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function oS(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=lc(0),this.expirationTimes=lc(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=lc(0),this.identifierPrefix=n,this.onRecoverableError=s,this.mutableSourceEagerHydrationData=null}function Of(t,e,r,n,s,i,a,o,l){return t=new oS(t,e,r,o,l),e===1?(e=1,i===!0&&(e|=8)):e=0,i=ur(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},pf(i),t}function lS(t,e,r){var n=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;
vendor: 4,591 bytes, line 40
40return{$$typeof:Ks,key:n==null?null:""+n,children:t,containerInfo:e,implementation:r}}function Wy(t){if(!t)return Fn;t=t._reactInternals;e:{if(Is(t)!==t||t.tag!==1)throw Error(z(170));var e=t;do{switch(e.tag){case 3:e=e.stateNode.context;break e;case 1:if(Nt(e.type)){e=e.stateNode.__reactInternalMemoizedMergedChildContext;break e}}e=e.return}while(e!==null);throw Error(z(171))}if(t.tag===1){var r=t.type;if(Nt(r))return Wv(t,r,e)}return e}function Hy(t,e,r,n,s,i,a,o,l){return t=Of(r,n,!0,t,s,i,a,o,l),t.context=Wy(null),r=t.current,n=Et(),s=jn(r),i=tn(n,s),i.callback=e??null,Nn(r,i,s),t.current.lanes=s,wo(t,s,n),Lt(t,n),t}function Mu(t,e,r,n){var s=e.current,i=Et(),a=jn(s);return r=Wy(r),e.context===null?e.context=r:e.pendingContext=r,e=tn(i,a),e.payload={element:t},n=n===void 0?null:n,n!==null&&(e.callback=n),t=Nn(s,e,a),t!==null&&(Ar(t,s,a,i),ll(t,s,a)),a}function Gl(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 Nm(t,e){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var r=t.retryLane;t.retryLane=r!==0&&r<e?r:e}}function If(t,e){Nm(t,e),(t=t.alternate)&&Nm(t,e)}function uS(){return null}var Gy=typeof reportError=="function"?reportError:function(t){console.error(t)};function Nf(t){this._internalRoot=t}Du.prototype.render=Nf.prototype.render=function(t){var e=this._internalRoot;if(e===null)throw Error(z(409));Mu(t,e,null,null)};Du.prototype.unmount=Nf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var e=t.containerInfo;Cs(function(){Mu(null,t,null,null)}),e[nn]=null}};function Du(t){this._internalRoot=t}Du.prototype.unstable_scheduleHydration=function(t){if(t){var e=Sv();t={blockedOn:null,target:t,priority:e};for(var r=0;r<vn.length&&e!==0&&e<vn[r].priority;r++);vn.splice(r,0,t),r===0&&Ev(t)}};function Lf(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function $u(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function Lm(){}function cS(t,e,r,n,s){if(s){if(typeof n=="function"){var i=n;n=function(){var u=Gl(a);i.call(u)}}var a=Hy(e,n,t,0,null,!1,!1,"",Lm);return t._reactRootContainer=a,t[nn]=a.current,Ba(t.nodeType===8?t.parentNode:t),Cs(),a}for(;s=t.lastChild;)t.removeChild(s);if(typeof n=="function"){var o=n;n=function(){var u=Gl(l);o.call(u)}}var l=Of(t,0,!1,null,null,!1,!1,"",Lm);return t._reactRootContainer=l,t[nn]=l.current,Ba(t.nodeType===8?t.parentNode:t),Cs(function(){Mu(e,l,r,n)}),l}function zu(t,e,r,n,s){var i=r._reactRootContainer;if(i){var a=i;if(typeof s=="function"){var o=s;s=function(){var l=Gl(a);o.call(l)}}Mu(e,a,t,s)}else a=cS(r,e,t,s,n);return Gl(a)}xv=function(t){switch(t.tag){case 3:var e=t.stateNode;if(e.current.memoizedState.isDehydrated){var r=ia(e.pendingLanes);r!==0&&(Xh(e,r|1),Lt(e,Ge()),!(me&6)&&(Ci=Ge()+500,Yn()))}break;case 13:Cs(function(){var n=sn(t,1);if(n!==null){var s=Et();Ar(n,t,1,s)}}),If(t,1)}};Qh=function(t){if(t.tag===13){var e=sn(t,134217728);if(e!==null){var r=Et();Ar(e,t,134217728,r)}If(t,134217728)}};bv=function(t){if(t.tag===13){var e=jn(t),r=sn(t,e);if(r!==null){var n=Et();Ar(r,t,e,n)}If(t,e)}};Sv=function(){return _e};kv=function(t,e){var r=_e;try{return _e=t,e()}finally{_e=r}};md=function(t,e,r){switch(e){case"input":if(ld(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=Au(n);if(!s)throw Error(z(90));tv(n),ld(n,s)}}}break;case"textarea":nv(t,r);break;case"select":e=r.value,e!=null&&ci(t,!!r.multiple,e,!1)}};cv=Cf;dv=Cs;var dS={usingClientEntryPoint:!1,Events:[xo,Qs,Au,lv,uv,Cf]},Xi={findFiberByHostInstance:ds,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},hS={bundleType:Xi.bundleType,version:Xi.version,rendererPackageName:Xi.rendererPackageName,rendererConfig:Xi.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:cn.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=pv(t),t===null?null:t.stateNode},findFiberByHostInstance:Xi.findFiberByHostInstance||uS,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 Go=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Go.isDisabled&&Go.supportsFiber)try{Eu=Go.inject(hS),zr=Go}catch{}}rr.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=dS;rr.createPortal=function(t,e){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Lf(e))throw Error(z(200));return lS(t,e,null,r)};rr.createRoot=function(t,e){if(!Lf(t))throw Error(z(299));var r=!1,n="",s=Gy;return e!=null&&(e.unstable_strictMode===!0&&(r=!0),e.identifierPrefix!==void 0&&(n=e.identifierPrefix),e.onRecoverableError!==void 0&&(s=e.onRecoverableError)),e=Of(t,1,!1,null,null,r,!1,n,s),t[nn]=e.current,Ba(t.nodeType===8?t.parentNode:t),new Nf(e)};rr.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(z(188)):(t=Object.keys(t).join(","),Error(z(268,t)));return t=pv(e),t=t===null?null:t.stateNode,t};rr.flushSync=function(t){return Cs(t)};rr.hydrate=function(t,e,r){if(!$u(e))throw Error(z(200));return zu(null,t,e,!0,r)};rr.hydrateRoot=function(t,e,r){if(!Lf(t))throw Error(z(405));var n=r!=null&&r.hydratedSources||null,s=!1,i="",a=Gy;if(r!=null&&(r.unstable_strictMode===!0&&(s=!0),r.identifierPrefix!==void 0&&(i=r.identifierPrefix),r.onRecoverableError!==void 0&&(a=r.onRecoverableError)),e=Hy(e,null,t,1,r??null,s,!1,i,a),t[nn]=e.current,Ba(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 Du(e)};rr.render=function(t,e,r){if(!$u(e))throw Error(z(200));return zu(null,t,e,!1,r)};rr.unmountComponentAtNode=function(t){if(!$u(t))throw Error(z(40));return t._reactRootContainer?(Cs(function(){zu(null,null,t,!1,function(){t._reactRootContainer=null,t[nn]=null})}),!0):!1};rr.unstable_batchedUpdates=Cf;rr.unstable_renderSubtreeIntoContainer=function(t,e,r,n){if(!$u(r))throw Error(z(200));if(t==null||t._reactInternals===void 0)throw Error(z(38));return zu(t,e,r,!1,n)};rr.version="18.3.1-next-f1338f8080-20240426";function qy(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(qy)}catch(t){console.error(t)}}qy(),q0.exports=rr;var Ky=q0.exports;const fS=j0(Ky);var jm=Ky;td.createRoot=jm.createRoot,td.hydrateRoot=jm.hydrateRoot;/**
41 * @remix-run/router v1.23.3
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 Za(){return Za=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Za.apply(null,arguments)}var Sn;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(Sn||(Sn={}));const Mm="popstate";function pS(t){t===void 0&&(t={});function e(n,s){let{pathname:i,search:a,hash:o}=n.location;return Kd("",{pathname:i,search:a,hash:o},s.state&&s.state.usr||null,s.state&&s.state.key||"default")}function r(n,s){return typeof s=="string"?s:ql(s)}return gS(e,r,null,t)}function qe(t,e){if(t===!1||t===null||typeof t>"u")throw new Error(e)}function jf(t,e){if(!t){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function mS(){return Math.random().toString(36).substr(2,8)}function Dm(t,e){return{usr:t.state,key:t.key,idx:e}}function Kd(t,e,r,n){return r===void 0&&(r=null),Za({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof e=="string"?Bi(e):e,{state:r,key:e&&e.key||n||mS()})}function ql(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 Bi(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 gS(t,e,r,n){n===void 0&&(n={});let{window:s=document.defaultView,v5Compat:i=!1}=n,a=s.history,o=Sn.Pop,l=null,u=c();u==null&&(u=0,a.replaceState(Za({},a.state,{idx:u}),""));function c(){return(a.state||{idx:null}).idx}function d(){o=Sn.Pop;let b=c(),_=b==null?null:b-u;u=b,l&&l({action:o,location:g.location,delta:_})}function f(b,_){o=Sn.Push;let v=Kd(g.location,b,_);u=c()+1;let w=Dm(v,u),h=g.createHref(v);try{a.pushState(w,"",h)}catch(p){if(p instanceof DOMException&&p.name==="DataCloneError")throw p;s.location.assign(h)}i&&l&&l({action:o,location:g.location,delta:1})}function m(b,_){o=Sn.Replace;let v=Kd(g.location,b,_);u=c();let w=Dm(v,u),h=g.createHref(v);a.replaceState(w,"",h),i&&l&&l({action:o,location:g.location,delta:0})}function y(b){let _=s.location.origin!=="null"?s.location.origin:s.location.href,v=typeof b=="string"?b:ql(b);return v=v.replace(/ $/,"%20"),qe(_,"No window.location.(origin|href) available to create URL for href: "+v),new URL(v,_)}let g={get action(){return o},get location(){return t(s,a)},listen(b){if(l)throw new Error("A history only accepts one active listener");return s.addEventListener(Mm,d),l=b,()=>{s.removeEventListener(Mm,d),l=null}},createHref(b){return e(s,b)},createURL:y,encodeLocation(b){let _=y(b);return{pathname:_.pathname,search:_.search,hash:_.hash}},push:f,replace:m,go(b){return a.go(b)}};return g}var $m;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})($m||($m={}));function vS(t,e,r){return r===void 0&&(r="/"),yS(t,e,r)}function yS(t,e,r,n){let s=typeof e=="string"?Bi(e):e,i=Mf(s.pathname||"/",r);if(i==null)return null;let a=Jy(t);
vendor: 11,437 bytes, lines 49-58
49wS(a);let o=null,l=OS(i);for(let u=0;o==null&&u<a.length;++u)o=PS(a[u],l);return o}function Jy(t,e,r,n){e===void 0&&(e=[]),r===void 0&&(r=[]),n===void 0&&(n="");let s=(i,a,o)=>{let l={relativePath:o===void 0?i.path||"":o,caseSensitive:i.caseSensitive===!0,childrenIndex:a,route:i};l.relativePath.startsWith("/")&&(qe(l.relativePath.startsWith(n),'Absolute route path "'+l.relativePath+'" nested under path '+('"'+n+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),l.relativePath=l.relativePath.slice(n.length));let u=Dn([n,l.relativePath]),c=r.concat(l);i.children&&i.children.length>0&&(qe(i.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+u+'".')),Jy(i.children,e,c,u)),!(i.path==null&&!i.index)&&e.push({path:u,score:TS(u,i.index),routesMeta:c})};return t.forEach((i,a)=>{var o;if(i.path===""||!((o=i.path)!=null&&o.includes("?")))s(i,a);else for(let l of Zy(i.path))s(i,a,l)}),e}function Zy(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 a=Zy(n.join("/")),o=[];return o.push(...a.map(l=>l===""?i:[i,l].join("/"))),s&&o.push(...a),o.map(l=>t.startsWith("/")&&l===""?"/":l)}function wS(t){t.sort((e,r)=>e.score!==r.score?r.score-e.score:CS(e.routesMeta.map(n=>n.childrenIndex),r.routesMeta.map(n=>n.childrenIndex)))}const _S=/^:[\w-]+$/,xS=3,bS=2,SS=1,kS=10,ES=-2,zm=t=>t==="*";function TS(t,e){let r=t.split("/"),n=r.length;return r.some(zm)&&(n+=ES),e&&(n+=bS),r.filter(s=>!zm(s)).reduce((s,i)=>s+(_S.test(i)?xS:i===""?SS:kS),n)}function CS(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 PS(t,e,r){let{routesMeta:n}=t,s={},i="/",a=[];for(let o=0;o<n.length;++o){let l=n[o],u=o===n.length-1,c=i==="/"?e:e.slice(i.length)||"/",d=AS({path:l.relativePath,caseSensitive:l.caseSensitive,end:u},c),f=l.route;if(!d)return null;Object.assign(s,d.params),a.push({params:s,pathname:Dn([i,d.pathname]),pathnameBase:MS(Dn([i,d.pathnameBase])),route:f}),d.pathnameBase!=="/"&&(i=Dn([i,d.pathnameBase]))}return a}function AS(t,e){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[r,n]=RS(t.path,t.caseSensitive,t.end),s=e.match(r);if(!s)return null;let i=s[0],a=i.replace(/(.)\/+$/,"$1"),o=s.slice(1);return{params:n.reduce((u,c,d)=>{let{paramName:f,isOptional:m}=c;if(f==="*"){let g=o[d]||"";a=i.slice(0,i.length-g.length).replace(/(.)\/+$/,"$1")}const y=o[d];return m&&!y?u[f]=void 0:u[f]=(y||"").replace(/%2F/g,"/"),u},{}),pathname:i,pathnameBase:a,pattern:t}}function RS(t,e,r){e===void 0&&(e=!1),r===void 0&&(r=!0),jf(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,(a,o,l)=>(n.push({paramName:o,isOptional:l!=null}),l?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(n.push({paramName:"*"}),s+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):r?s+="\\/*$":t!==""&&t!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),n]}function OS(t){try{return t.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return jf(!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 Mf(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)||"/"}const IS=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,NS=t=>IS.test(t);function LS(t,e){e===void 0&&(e="/");let{pathname:r,search:n="",hash:s=""}=typeof t=="string"?Bi(t):t,i;if(r)if(NS(r))i=r;else{if(r.includes("//")){let a=r;r=Yy(r),jf(!1,"Pathnames cannot have embedded double slashes - normalizing "+(a+" -> "+r))}r.startsWith("/")?i=Um(r.substring(1),"/"):i=Um(r,e)}else i=e;return{pathname:i,search:DS(n),hash:$S(s)}}function Um(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 Ac(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 jS(t){return t.filter((e,r)=>r===0||e.route.path&&e.route.path.length>0)}function Df(t,e){let r=jS(t);return e?r.map((n,s)=>s===r.length-1?n.pathname:n.pathnameBase):r.map(n=>n.pathnameBase)}function $f(t,e,r,n){n===void 0&&(n=!1);let s;typeof t=="string"?s=Bi(t):(s=Za({},t),qe(!s.pathname||!s.pathname.includes("?"),Ac("?","pathname","search",s)),qe(!s.pathname||!s.pathname.includes("#"),Ac("#","pathname","hash",s)),qe(!s.search||!s.search.includes("#"),Ac("#","search","hash",s)));let i=t===""||s.pathname==="",a=i?"/":s.pathname,o;if(a==null)o=r;else{let d=e.length-1;if(!n&&a.startsWith("..")){let f=a.split("/");for(;f[0]==="..";)f.shift(),d-=1;s.pathname=f.join("/")}o=d>=0?e[d]:"/"}let l=LS(s,o),u=a&&a!=="/"&&a.endsWith("/"),c=(i||a===".")&&r.endsWith("/");return!l.pathname.endsWith("/")&&(u||c)&&(l.pathname+="/"),l}const Yy=t=>t.replace(/\/\/+/g,"/"),Dn=t=>Yy(t.join("/")),MS=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),DS=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,$S=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function zS(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const Xy=["post","put","patch","delete"];new Set(Xy);const US=["get",...Xy];new Set(US);/**
50 * React Router v6.30.4
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 Ya(){return Ya=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Ya.apply(null,arguments)}const zf=P.createContext(null),BS=P.createContext(null),Xn=P.createContext(null),Uu=P.createContext(null),Qn=P.createContext({outlet:null,matches:[],isDataRoute:!1}),Qy=P.createContext(null);function FS(t,e){let{relative:r}=e===void 0?{}:e;Fi()||qe(!1);let{basename:n,navigator:s}=P.useContext(Xn),{hash:i,pathname:a,search:o}=tw(t,{relative:r}),l=a;return n!=="/"&&(l=a==="/"?n:Dn([n,a])),s.createHref({pathname:l,search:o,hash:i})}function Fi(){return P.useContext(Uu)!=null}function Ns(){return Fi()||qe(!1),P.useContext(Uu).location}function ew(t){P.useContext(Xn).static||P.useLayoutEffect(t)}function So(){let{isDataRoute:t}=P.useContext(Qn);return t?tk():VS()}function VS(){Fi()||qe(!1);let t=P.useContext(zf),{basename:e,future:r,navigator:n}=P.useContext(Xn),{matches:s}=P.useContext(Qn),{pathname:i}=Ns(),a=JSON.stringify(Df(s,r.v7_relativeSplatPath)),o=P.useRef(!1);return ew(()=>{o.current=!0}),P.useCallback(function(u,c){if(c===void 0&&(c={}),!o.current)return;if(typeof u=="number"){n.go(u);return}let d=$f(u,JSON.parse(a),i,c.relative==="path");t==null&&e!=="/"&&(d.pathname=d.pathname==="/"?e:Dn([e,d.pathname])),(c.replace?n.replace:n.push)(d,c.state,c)},[e,n,a,i,t])}function tw(t,e){let{relative:r}=e===void 0?{}:e,{future:n}=P.useContext(Xn),{matches:s}=P.useContext(Qn),{pathname:i}=Ns(),a=JSON.stringify(Df(s,n.v7_relativeSplatPath));return P.useMemo(()=>$f(t,JSON.parse(a),i,r==="path"),[t,a,i,r])}function WS(t,e){return HS(t,e)}function HS(t,e,r,n){Fi()||qe(!1);let{navigator:s}=P.useContext(Xn),{matches:i}=P.useContext(Qn),a=i[i.length-1],o=a?a.params:{};a&&a.pathname;let l=a?a.pathnameBase:"/";a&&a.route;let u=Ns(),c;if(e){var d;let b=typeof e=="string"?Bi(e):e;l==="/"||(d=b.pathname)!=null&&d.startsWith(l)||qe(!1),c=b}else c=u;let f=c.pathname||"/",m=f;if(l!=="/"){let b=l.replace(/^\//,"").split("/");m="/"+f.replace(/^\//,"").split("/").slice(b.length).join("/")}let y=vS(t,{pathname:m}),g=ZS(y&&y.map(b=>Object.assign({},b,{params:Object.assign({},o,b.params),pathname:Dn([l,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?l:Dn([l,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),i,r,n);return e&&g?P.createElement(Uu.Provider,{value:{location:Ya({pathname:"/",search:"",hash:"",state:null,key:"default"},c),navigationType:Sn.Pop}},g):g}function GS(){let t=ek(),e=zS(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 qS=P.createElement(GS,null);class KS 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(Qn.Provider,{value:this.props.routeContext},P.createElement(Qy.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function JS(t){let{routeContext:e,match:r,children:n}=t,s=P.useContext(zf);return s&&s.static&&s.staticContext&&(r.route.errorElement||r.route.ErrorBoundary)&&(s.staticContext._deepestRenderedBoundaryId=r.route.id),P.createElement(Qn.Provider,{value:e},n)}function ZS(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 a=t,o=(s=r)==null?void 0:s.errors;if(o!=null){let c=a.findIndex(d=>d.route.id&&(o==null?void 0:o[d.route.id])!==void 0);c>=0||qe(!1),a=a.slice(0,Math.min(a.length,c+1))}let l=!1,u=-1;if(r&&n&&n.v7_partialHydration)for(let c=0;c<a.length;c++){let d=a[c];if((d.route.HydrateFallback||d.route.hydrateFallbackElement)&&(u=c),d.route.id){let{loaderData:f,errors:m}=r,y=d.route.loader&&f[d.route.id]===void 0&&(!m||m[d.route.id]===void 0);if(d.route.lazy||y){l=!0,u>=0?a=a.slice(0,u+1):a=[a[0]];break}}}return a.reduceRight((c,d,f)=>{let m,y=!1,g=null,b=null;r&&(m=o&&d.route.id?o[d.route.id]:void 0,g=d.route.errorElement||qS,l&&(u<0&&f===0?(rk("route-fallback"),y=!0,b=null):u===f&&(y=!0,b=d.route.hydrateFallbackElement||null)));let _=e.concat(a.slice(0,f+1)),v=()=>{let w;return m?w=g:y?w=b:d.route.Component?w=P.createElement(d.route.Component,null):d.route.element?w=d.route.element:w=c,P.createElement(JS,{match:d,routeC
58ontext:{outlet:c,matches:_,isDataRoute:r!=null},children:w})};return r&&(d.route.ErrorBoundary||d.route.errorElement||f===0)?P.createElement(KS,{location:r.location,revalidation:r.revalidation,component:g,error:m,children:v(),routeContext:{outlet:null,matches:_,isDataRoute:!0}}):v()},null)}var rw=function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t}(rw||{}),nw=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}(nw||{});function YS(t){let e=P.useContext(zf);return e||qe(!1),e}function XS(t){let e=P.useContext(BS);return e||qe(!1),e}function QS(t){let e=P.useContext(Qn);return e||qe(!1),e}function sw(t){let e=QS(),r=e.matches[e.matches.length-1];return r.route.id||qe(!1),r.route.id}function ek(){var t;let e=P.useContext(Qy),r=XS(),n=sw();return e!==void 0?e:(t=r.errors)==null?void 0:t[n]}function tk(){let{router:t}=YS(rw.UseNavigateStable),e=sw(nw.UseNavigateStable),r=P.useRef(!1);return ew(()=>{r.current=!0}),P.useCallback(function(s,i){i===void 0&&(i={}),r.current&&(typeof s=="number"?t.navigate(s):t.navigate(s,Ya({fromRouteId:e},i)))},[t,e])}const Bm={};function rk(t,e,r){Bm[t]||(Bm[t]=!0)}function nk(t,e){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function sk(t){let{to:e,replace:r,state:n,relative:s}=t;Fi()||qe(!1);let{future:i,static:a}=P.useContext(Xn),{matches:o}=P.useContext(Qn),{pathname:l}=Ns(),u=So(),c=$f(e,Df(o,i.v7_relativeSplatPath),l,s==="path"),d=JSON.stringify(c);return P.useEffect(()=>u(JSON.parse(d),{replace:r,state:n,relative:s}),[u,d,s,r,n]),null}function oa(t){qe(!1)}function ik(t){let{basename:e="/",children:r=null,location:n,navigationType:s=Sn.Pop,navigator:i,static:a=!1,future:o}=t;Fi()&&qe(!1);let l=e.replace(/^\/*/,"/"),u=P.useMemo(()=>({basename:l,navigator:i,static:a,future:Ya({v7_relativeSplatPath:!1},o)}),[l,o,i,a]);typeof n=="string"&&(n=Bi(n));let{pathname:c="/",search:d="",hash:f="",state:m=null,key:y="default"}=n,g=P.useMemo(()=>{let b=Mf(c,l);return b==null?null:{location:{pathname:b,search:d,hash:f,state:m,key:y},navigationType:s}},[l,c,d,f,m,y,s]);return g==null?null:P.createElement(Xn.Provider,{value:u},P.createElement(Uu.Provider,{children:r,value:g}))}function ak(t){let{children:e,location:r}=t;return WS(Jd(e),r)}new Promise(()=>{});function Jd(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,Jd(n.props.children,i));return}n.type!==oa&&qe(!1),!n.props.index||!n.props.children||qe(!1);let a={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&&(a.children=Jd(n.props.children,i)),r.push(a)}),r}/**
59 * React Router DOM v6.30.4
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 Zd(){return Zd=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},Zd.apply(null,arguments)}function ok(t,e){if(t==null)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(e.indexOf(n)!==-1)continue;r[n]=t[n]}return r}function lk(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function uk(t,e){return t.button===0&&(!e||e==="_self")&&!lk(t)}function Yd(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((e,r)=>{let n=t[r];return e.concat(Array.isArray(n)?n.map(s=>[r,s]):[[r,n]])},[]))}function ck(t,e){let r=Yd(t);return e&&e.forEach((n,s)=>
67{r.has(s)||e.getAll(s).forEach(i=>{r.append(s,i)})}),r}const dk=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],hk="6";try{window.__reactRouterVersion=hk}catch{}const fk="startTransition",Fm=rx[fk];function pk(t){let{basename:e,children:r,future:n,window:s}=t,i=P.useRef();i.current==null&&(i.current=pS({window:s,v5Compat:!0}));let a=i.current,[o,l]=P.useState({action:a.action,location:a.location}),{v7_startTransition:u}=n||{},c=P.useCallback(d=>{u&&Fm?Fm(()=>l(d)):l(d)},[l,u]);return P.useLayoutEffect(()=>a.listen(c),[a,c]),P.useEffect(()=>nk(n),[n]),P.createElement(ik,{basename:e,children:r,location:o.location,navigationType:o.action,navigator:a,future:n})}const mk=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gk=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,iw=P.forwardRef(function(e,r){let{onClick:n,relative:s,reloadDocument:i,replace:a,state:o,target:l,to:u,preventScrollReset:c,viewTransition:d}=e,f=ok(e,dk),{basename:m}=P.useContext(Xn),y,g=!1;if(typeof u=="string"&&gk.test(u)&&(y=u,mk))try{let w=new URL(window.location.href),h=u.startsWith("//")?new URL(w.protocol+u):new URL(u),p=Mf(h.pathname,m);h.origin===w.origin&&p!=null?u=p+h.search+h.hash:g=!0}catch{}let b=FS(u,{relative:s}),_=vk(u,{replace:a,state:o,target:l,preventScrollReset:c,relative:s,viewTransition:d});function v(w){n&&n(w),w.defaultPrevented||_(w)}return P.createElement("a",Zd({},f,{href:y||b,onClick:g||i?n:v,ref:r,target:l}))});var Vm;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Vm||(Vm={}));var Wm;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Wm||(Wm={}));function vk(t,e){let{target:r,replace:n,state:s,preventScrollReset:i,relative:a,viewTransition:o}=e===void 0?{}:e,l=So(),u=Ns(),c=tw(t,{relative:a});return P.useCallback(d=>{if(uk(d,r)){d.preventDefault();let f=n!==void 0?n:ql(u)===ql(c);l(t,{replace:f,state:s,preventScrollReset:i,relative:a,viewTransition:o})}},[u,l,c,n,s,r,t,i,a,o])}function aw(t){let e=P.useRef(Yd(t)),r=P.useRef(!1),n=Ns(),s=P.useMemo(()=>ck(n.search,r.current?null:e.current),[n.search]),i=So(),a=P.useCallback((o,l)=>{const u=Yd(typeof o=="function"?o(s):o);r.current=!0,i("?"+u,l)},[i,s]);return[s,a]}const yk=t=>{if(!t)return"";try{return new Date(t+"T00:00:00").toLocaleDateString("es-AR",{day:"2-digit",month:"2-digit",year:"numeric"})}catch{return t}},Rc=()=>new Date().toISOString().split("T")[0],wk=()=>`${Date.now()}_${Math.random().toString(36).substr(2,9)}`,_k=t=>{if(t===0)return"0 Bytes";const e=1024,r=["Bytes","KB","MB","GB"],n=Math.floor(Math.log(t)/Math.log(e));return`${parseFloat((t/Math.pow(e,n)).toFixed(2))} ${r[n]}`},Uf=t=>{if(!t)return"";if(t.startsWith("http://")||t.startsWith("https://")||t.startsWith("data:"))return t;const e="/cartadigital/",r=t.startsWith("/")?t.slice(1):t;return`${e.endsWith("/")?e:`${e}/`}${r}`},ow=P.createContext(null),xk=({children:t})=>{const[e,r]=P.useState([]),n=P.useCallback((l,u="info",c=4e3)=>{const d=wk();return r(f=>[...f,{id:d,message:l,type:u,duration:c}]),setTimeout(()=>{r(f=>f.filter(m=>m.id!==d))},c),d},[]),s=P.useCallback(l=>{r(u=>u.filter(c=>c.id!==l))},[]),i=P.useCallback((l,u)=>n(l,"success",u),[n]),a=P.useCallback((l,u)=>n(l,"error",u),[n]),o=P.useCallback((l,u)=>n(l,"info",u),[n]);return S.jsx(ow.Provider,{value:{toasts:e,addToast:n,removeToast:s,success:i,error:a,info:o},children:t})},lw=()=>{const t=P.useContext(ow);if(!t)throw new Error("useToast must be used within ToastProvider");return t};/**
68 * @license lucide-react v0.383.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 */const bk=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),uw=(...t)=>t.filter((e,r,n)=>!!e&&n.indexOf(e)===r).join(" ");/**
73 * @license lucide-react v0.383.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 */var Sk={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"};/**
78 * @license lucide-react v0.383.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 kk=P.forwardRef(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:s="",children:i,iconNode:a,...o},l)=>P.createElement("svg",{ref:l,...Sk,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:uw("lucide",s),...o},[...a.map(([u,c])=>P.createElement(u,c)),...Array.isArray(i)?i:[i]]));/**
83 * @license lucide-react v0.383.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 Te=(t,e)=>{const r=P.forwardRef(({className:n,...s},i)=>P.createElement(kk,{ref:i,iconNode:e,className:uw(`lucide-${bk(t)}`,n),...s}));return r.displayName=`${t}`,r};/**
88 * @license lucide-react v0.383.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 Ek=Te("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"}]]);/**
93 * @license lucide-react v0.383.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 Tk=Te("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"}]]);/**
98 * @license lucide-react v0.383.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 Ck=Te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
103 * @license lucide-react v0.383.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 Kl=Te("CircleAlert",[["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"}]]);/**
108 * @license lucide-react v0.383.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 cw=Te("CircleCheckBig",[["path",{d:"M22 11.08V12a10 10 0 1 1-5.93-9.14",key:"g774vq"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]);/**
113 * @license lucide-react v0.383.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 Pk=Te("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"}]]);/**
118 * @license lucide-react v0.383.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 dw=Te("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"}]]);/**
123 * @license lucide-react v0.383.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 hw=Te("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"}]]);/**
128 * @license lucide-react v0.383.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 Ak=Te("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
133 * @license lucide-react v0.383.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 Bf=Te("ImageOff",[["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}],["path",{d:"M10.41 10.41a2 2 0 1 1-2.83-2.83",key:"1bzlo9"}],["line",{x1:"13.5",x2:"6",y1:"13.5",y2:"21",key:"1q0aeu"}],["line",{x1:"18",x2:"21",y1:"12",y2:"15",key:"5mozeu"}],["path",{d:"M3.59 3.59A1.99 1.99 0 0 0 3 5v14a2 2 0 0 0 2 2h14c.55 0 1.052-.22 1.41-.59",key:"mmje98"}],["path",{d:"M21 15V5a2 2 0 0 0-2-2H9",key:"43el77"}]]);/**
138 * @license lucide-react v0.383.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 Rk=Te("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"}]]);/**
143 * @license lucide-react v0.383.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 Ok=Te("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
148 * @license lucide-react v0.383.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 fw=Te("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
153 * @license lucide-react v0.383.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 Ik=Te("Link",[["path",{d:"M10 13a5 5 0 0 0 7.54.54l3-3a5 5 0 0 0-7.07-7.07l-1.72 1.71",key:"1cjeqo"}],["path",{d:"M14 11a5 5 0 0 0-7.54-.54l-3 3a5 5 0 0 0 7.07 7.07l1.71-1.71",key:"19qd67"}]]);/**
158 * @license lucide-react v0.383.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 ko=Te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
163 * @license lucide-react v0.383.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 Nk=Te("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"}]]);/**
168 * @license lucide-react v0.383.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 Lk=Te("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"}]]);/**
173 * @license lucide-react v0.383.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 jk=Te("Pencil",[["path",{d:"M17 3a2.85 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z",key:"5qss01"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]]);/**
178 * @license lucide-react v0.383.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 Mk=Te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
183 * @license lucide-react v0.383.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 Hm=Te("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"}]]);/**
188 * @license lucide-react v0.383.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 Dk=Te("Save",[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]]);/**
193 * @license lucide-react v0.383.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 $k=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
198 * @license lucide-react v0.383.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 zk=Te("ShieldCheck",[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
203 * @license lucide-react v0.383.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 Uk=Te("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"}]]);/**
208 * @license lucide-react v0.383.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 Gm=Te("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"}]]);/**
213 * @license lucide-react v0.383.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 Ps=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]),pw=[{nombre:"Ballester",direccion:"Bv. Ballester 4816",localidad:"Villa Ballester",provincia:"Buenos Aires",telefono:"2095-0008 / 2131-7945",horario:"Lunes a Miércoles 11:00 a 23:00 | Jueves a Domingo 11:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3286.217863434467!2d-58.55517312353312!3d-34.54803885456104!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcc926c384b9f9%3A0xc8cb6641f8f42f50!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749051375079!5m2!1ses!2sar"},{nombre:"Balvanera",direccion:"Av. Callao 474",localidad:"Balvanera",provincia:"Ciudad Autónoma de Buenas Aires",telefono:"+54 11 2058-5310",horario:"Lunes a Sábado 11:00 a 17:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3284.0282959455308!2d-58.39235935263005!3d-34.60344598689457!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bccb3ebe0ebe61%3A0x5c916dabbe4b4557!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749041987481!5m2!1ses!2sar"},{nombre:"Barrancas de Belgrano",direccion:"Monroe 1801",localidad:"Barrancas de Belgrano",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 7189-2222 / 4782-4138 / 4785-0002 / 4785-5307 / 4782-6510",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:00 a 23:00 | Jueves a Sábado 11:00 a 15:30 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d6571.584390267806!2d-58.46480970282218!3d-34.55881650618978!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb52cc7c10f8b%3A0x88b0e133e593f197!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749052339943!5m2!1ses!2sar"},{nombre:"Caballito",direccion:"Av. Rivadavia 6193",localidad:"Caballito",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4631-0000",horario:"Lunes a Domingo 11:00 a 23:30",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3283.847424564567!2d-58.4512411!3d-34.6212456!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcca1b4f4e7e6d%3A0x2f4e4e4e4e4e4e4e!2sMi%20Gusto%20Caballito!5e0!3m2!1ses!2sar!4v1686600000000!5m2!1ses!2sar"},{nombre:"Belgrano",direccion:"Av. Dr. Ricardo Balbín 2395",localidad:"Belgrano",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 2514-9026 / 7531-3413 / 7513-3905 / 2099-7191 / 15 2637-5288",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:00 a 23:00 | Jueves a Sábado 11:00 a 15:30 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d6571.26460760979!2d-58.46484744155664!3d-34.56286409294471!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb7f7f02d7f85%3A0xde542b9c8455a037!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749044660292!5m2!1ses!2sar"},{nombre:"Bella Vista",direccion:"Av. Senador Morón 903",localidad:"San Miguel",provincia:"Provincia de Buenos Aires",telefono:"+54 11 2820-3369",horario:"Lunes a Miércoles 11:00 a 15:00 y 19:00 a 23:00 | Jueves a Domingo 11:00 a 15:00 y 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3285.739589024184!2d-58.68123152353252!3d-34.560148255199756!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbc464abbd27b%3A0x214517a4773346b1!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749053154296!5m2!1ses!2sar"},{nombre:"Campana",direccion:"Av. Mitre 974",localidad:"Campana",provincia:"Provincia de Buenos Aires",telefono:"03489 44-6223 / 03489 46-8602 / 03489 43-7601 / 03489 29-8070",horario:"Lunes a Miércoles 11:30 a 14:30 y 19:00 a 23:30 | Jueves a Domingo 11:00 a 15:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3301.3444201406396!2d-58.96566362354834!3d-34.16311083436409!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bb722ea4799fe3%3A0x621583e70d282306!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749053384800!5m2!1ses!2sar"},{nombre:"Cañitas",direccion:"Báez 436",localidad:"Palermo",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4777-0000",horario:"Lunes a Domingo 11:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3284.923456789012!2d-58.4356789!3d-34.5678901!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb59a2b2b2b2b%3A0x2f4e4e4e4e4e4e4f!2sMi%20Gusto%20Ca%C3%B1itas!5e0!3m2!1ses!2sar!4v1686600000000!5m2!1ses!2sar"},{nombre:"Del Viso",direccion:"Colectora 12 de Octubre 3252",localidad:"Del Viso",provincia:"Provincia de Buenos Aires",telefono:"+54 11 7700-0663 / 02320 40-8777",horario:"Lunes a Miércoles 11:00 a 15:00 y 19:00 a 23:00 | Jueves a Domingo 11:00 a 15:00 y 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3290.5462055313906!2d-58.79306102353754!3d-34.43828024878114!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc9edc4274d6df%3A0x316244662a62f517!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749053622527!5m2!1ses!2sar"},{nombre:"Devoto",direccion:"Av. Francisco Beiró 4523",localidad:"Devoto",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 5631-3181 / 54 11 7530-2518 / 54 11 7540- 0060 / 54 11 7539-5956",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3283.8631319324686!2d-58.51466053336684!3d-34.60762232154594!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb707542c673b%3A0x60bcf9ab69a2b2b4!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749043992094!5m2!1ses!2sar"},{nombre:"Don Torcuato",direccion:"Av. Marcelo Torcuato de Avear 2556",localidad:"Caseros",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4543-7974 / 54 11 4748-3599",horario:"Lunes a Domingo 11:00 a 16:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3288.5662113781736!2d-58.62383612353561!3d-34.48852715142504
2176!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbb350c65e0f3%3A0x4568102bf092633f!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749053997704!5m2!1ses!2sar"},{nombre:"Escobar",direccion:"Av. 25 de Mayo 501",localidad:"Belén de Escobar",provincia:"Provincia de Buenos Aires",telefono:"0348 442-7249 / 0348 442-4825 / 0348 442-7639",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:00 a 23:00 | Jueves a Sábado 11:00 a 15:30 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3294.0767648254528!2d-58.79281652354106!3d-34.348524344066966!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bb61b147db9d2f%3A0xe463ebff30bd0a5!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749054211518!5m2!1ses!2sar"},{nombre:"Floresta",direccion:"Av. Rivadavia 9025",localidad:"Floresta",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 2100-7507 / 54 11 2100-9945 / 54 11 2110-8376",horario:"Lunes a Miércoles 11:00 a 15:00 y 19:00 a 23:00 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3282.741577926045!2d-58.494063523529576!3d-34.635970259203305!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcc9bc7870264d%3A0x1bb62ff6f7a573e0!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749041388694!5m2!1ses!2sar"},{nombre:"Florida",direccion:"Av. Gral. José de San Martín 1904",localidad:"Vicente López",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4797-4069 / 54 11 4795-7781",horario:"Lunes a Miércoles 11:00 a 15:00 y 18:00 a 23:00 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.064595955403!2d-58.49098864364759!3d-34.52659136451083!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb1504f60a29f%3A0x56b43fffb858a6a8!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749044480327!5m2!1ses!2sar"},{nombre:"Gral. Pacheco",direccion:"Av. Constituyentes 167",localidad:"Gral. Pacheco",provincia:"Provincia de Buenos Aires",telefono:"+54 11 2471-8669 / 54 11 3052-7544",horario:"Lunes a Miércoles 11:30 a 14:30 y 18:00 a 23:00 | Jueves a Domingo 11:30 a 14:30 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3289.734518069439!2d-58.639044723536756!3d-34.458886449864956!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bca48505c8bb49%3A0x558c933215a34275!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749054449936!5m2!1ses!2sar"},{nombre:"Hurlingham",direccion:"Av. Gdor. Vergara 4114",localidad:"Buenos Aires",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4662-0530 / 54 11 4452-7796",horario:"Lunes a Domingo 11:00 a 17:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3284.468594146822!2d-58.639217823531254!3d-34.59231045689714!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb937ba1bbf01%3A0x63f8f2a4d32096b9!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749057657357!5m2!1ses!2sar"},{nombre:"Ituzaingó",direccion:"Sta. Rosa 1164",localidad:"Castelar",provincia:"Provincia de Buenos Aires",telefono:"+54 11 6072-7185 / 54 11 6072-6638 / 54 11 6072-7205",horario:"Lunes a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3282.3453793263757!2d-58.66008992352926!3d-34.645979559732794!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbfd3611e7841%3A0x621a793792c2eb06!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749057858320!5m2!1ses!2sar"},{nombre:"José C. Paz",direccion:"Av. Gaspar Campos 6420",localidad:"Buenos Aires",provincia:"Provincia de Buenos Aires",telefono:"02320 42-4586 / 02320 42-5401 / 02320 42-5076",horario:"Lunes a Miércoles 11:00 a 14:30 y 18:00 a 23:30 | Jueves a Sábado 11:00 a 14:30 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.1762135207214!2d-58.75771102353412!3d-34.52376325328142!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc981e0fb53839%3A0x4f660eecaebe7ea6!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749058096204!5m2!1ses!2sar"},{nombre:"Los Polvorines",direccion:"Av. Pdte, Av. Pres. Juan Domingo Perón 2596",localidad:"Los Polvorines",provincia:"Buenos Aires",telefono:"+54 11 4663-4460 / 54 11 4660-3425",horario:"Lunes a Domingo 11:00 a 17:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.9389193502875!2d-58.68993752353501!3d-34.50443275226284!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bccb9797db4aa1%3A0xabc8bf118d6ff1b!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749058301276!5m2!1ses!2sar"},{nombre:"Martínez",direccion:"Hipólito Yrigoyen 1834",localidad:"Martínez",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4717-1700 / 54 11 4717-0494",horario:"Lunes a Domingo 11:00 a 15:00 y 19:00 a 23:30",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3288.135521456207!2d-58.52192022303335!3d-34.49944840549076!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb0f7bea6653b%3A0xc6e026296053980e!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749044162399!5m2!1ses!2sar"},{nombre:"Maschwitz",direccion:"Av. Villanueva 1782",localidad:"Ingeniero Maschwitz",provincia:"Provincia de Buenos Aires",telefono:"0348 444-6134 / 54 11 3639-1354 / 0348 444-0410 / 0348 444-4546",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:30 a 23:00 | Jueves a Sábado 11:00 a 15:30 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3292.254700893118!2d-58.741769223539286!3d-34.39487154649992!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc9f80d2a5e6cd%3A0x2013d879bf7e55ef!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749058463935!5m2!1ses!2sar"},{nombre:"Mataderos",direccion:"Av. Juan Bautista Alberdi 6450",localidad:"Mataderos",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4687-5789 / 54 11 4687-1697",horario:"Lunes a Miércoles 11:00 a 15:00 y 19:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3281.954331248552!2d-58.50989582352883!3d-34.6558562602548!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcc9071e39b487%3A0x1fce8f2fb1409c96!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749058639225!5m2!1ses!2sar"},{nombre:"Merlo",direccion:"Av. Calle Real 223",localidad:"Merlo",provincia:"Provincia de Buenos Aires",telefono:"0220 489-9433 / 54 11 3369-0074 / 220 492-7311",horario:"Lunes a Miércoles 11:30 a 14:30 y 19:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00.00 | Domingo 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3281.2163968939103!2d-58.72335032352817!3d-34.674487561240355!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbf7045cf2da7%3A0x45bd736d5136e66f!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749058811613!5m2!1ses!2sar"},{nombre:"Moreno",direccion:"Av. del Libertador 899",localidad:"Moreno",provincia:"Provincia de Buenos Aires",telefono:"0237 466-5557 / 0237 488-3818 / 0237 419-0392 / 237 488-3284",horario:"Lunes a Miércoles 11:30 a 14:30 y 19:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3282.590904984888!2d-58.78998592352938!3d-34.639777059404686!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc95aade9fe6a7%3A0x907950bbdea3cba8!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749059934258!5m2!1ses!2sar"},{nombre:"Muñiz",direccion:"Av. León Gallardo 333",localidad:"Muñiz",provincia:"Provincia de Buenos Aires",telefono:"+54 11 2863-7758 / 54 11 4667-7765",horario:"Lunes a Miércoles 11:30 a 14:30 y 19:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3286.0746263767096!2d-58.70193
2170023533116!3d-34.55166585475227!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbd9ec8b0fdd9%3A0x8a8b682bf2a9fc23!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749060124672!5m2!1ses!2sar"},{nombre:"Munro",direccion:"Av. Bartolomé Mitre 2510",localidad:"Munro",provincia:"Provincia de Buenos Aires",telefono:"2119-2802 / 2143-0661 / 2129-9625",horario:"Lunes a Domingo 11:30 a 15:00 y 19:00 a 23:30",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.0463582382745!2d-58.51821244677988!3d-34.52705344357361!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb1f18d4a7ab9%3A0x229a666c434e8a92!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749047094796!5m2!1ses!2sar"},{nombre:"Palermo",direccion:"Av. Cnel. Niceto Vega 5795",localidad:"Palermo",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4775-3575 / 775-3500 / 54 11 4775-2810",horario:"Lunes a Domingo 11:00 a 16:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m14!1m8!1m3!1d13123.124!2d-58.441266!3d-34.585107!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb5ab1e5c8aef%3A0x95693dcd264542f2!2sMi%20Gusto%20Palermo!5e0!3m2!1ses!2sar!4v1686600000000!5m2!1ses!2sar"},{nombre:"Paternal",direccion:"Av. Juan Bautista Justo 4551",localidad:"Paternal",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4087-5864 / 2091-9076",horario:"Lunes a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3283.835868662577!2d-58.46702612353073!3d-34.60831165774216!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcc9ace54cc337%3A0xfdf5912983165619!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749060358539!5m2!1ses!2sar"},{nombre:"Pilar Centro",direccion:"Lorenzo López 523",localidad:"Pilar Centro",provincia:"Provincia de Buenos Aires",telefono:"0230 442-6568 / 0230 442-5099 / 0230 442-8714",horario:"Lunes a Jueves 11:30 a 14:30 y 18:00 a 23:00 | Viernes a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3289.7197122673088!2d-58.912191606179!3d-34.45926222248421!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc9cce2d681a67%3A0x5456d6b432605f3b!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749047751932!5m2!1ses!2sar"},{nombre:"Pilar Cruce Derqui",direccion:"Lorenzo López 523",localidad:"Pilar Cruce Derqui",provincia:"Provincia de Buenos Aires",telefono:"+54 11 5841-8120",horario:"Lunes a Sábado 11:00 a 14:45 y 18:30 a 23:00 | Domingo 18:30 a 23:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3289.7197122673088!2d-58.912191606179!3d-34.45926222248421!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc9cce2d681a67%3A0x5456d6b432605f3b!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749047751932!5m2!1ses!2sar"},{nombre:"Puerto Madero",direccion:"Pierina Dealessi 1176",localidad:"Puerto Madero",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 3221-0966 / 54 11 2153-1999 / 54 11 2155-1927",horario:"Lunes a Miércoles 11:00 a 16:00 y 18:00 a 00:00 | Jueves a Domingo 11:00 a 17:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3283.7175848208317!2d-58.36624292353056!3d-34.61130225790004!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95a335855873aeb7%3A0x340ce52372b8e0b4!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749060581545!5m2!1ses!2sar"},{nombre:"San Fernando",direccion:"Av. Pres. Perón 2240",localidad:"San Fernando",provincia:"Provincia de Buenos Aires",telefono:"+54 11 3476-7320",horario:"Lunes a Miércoles 11:30 a 15:00 y 19:00 a 23:00 | Jueves a Sábado 11:30 a 15:00 y 19:00 a 00:00 | Domingo 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3290.1987831283905!2d-58.54714282166623!3d-34.4471015374212!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x1b54c6a2f2237f3%3A0x90ae5be096ff8934!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749044794446!5m2!1ses!2sar"},{nombre:"San Martín",direccion:"Int. Alberto M. Campos 1876",localidad:"San Martín",provincia:" Provincia de Buenos Aires",telefono:"4753-6673 / 4754-0278 / 4754-0282 / 54 11 5631-3185",horario:"Lunes a Jueves 11:00 a 14:30 y 18:30 a 23:30 | Viernes a Sábado 11:00 a 15:00 y 18:30 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3285.0153536857765!2d-58.53818672353198!3d-34.57847805616711!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb76e4535ddaf%3A0xdcfcf9c4507dc549!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749060771405!5m2!1ses!2sar"},{nombre:"San Miguel",direccion:"Serrano 1665",localidad:"San Miguel",provincia:"Provincia de Buenos Aires",telefono:"6089-0291",horario:"Lunes a Miércoles 11:00 a 14:30 y 19:00 a 23:30 | Jueves a Sábado 11:00 a 15:00 y 18:00 a 00:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3286.598428447525!2d-58.70949026457841!3d-34.53840069595772!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcbd13cf959d3d%3A0xc8e067c1535a6355!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749042479542!5m2!1ses!2sar"},{nombre:"Tigre",direccion:"Av. Cazón 699",localidad:"Tigre",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4506-9535",horario:"Lunes a Miércoles 11:00 a 15:00 y 19:00 a 23.00 | Jueves a Domingo 11:00 a 15:00 y 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3290.891318989988!2d-58.57180432585024!3d-34.42951562439839!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bca59e8143a943%3A0xd6cf52e8ebb26d00!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749047386868!5m2!1ses!2sar"},{nombre:"Tortugas Norte",direccion:"Golf Club San Antonio De Areco 1715",localidad:"Manuel Alberdi",provincia:"Provincia de Buenos Aires",telefono:"0348 421-8724 / 0348 421-8733 / 0348 421-8774",horario:"Lunes a Miércoles 11:00 a 15:30 y 18:30 a 23:00 | Jueves a Sábado 11:00 a 15:30 y 18:00 a 23:00 | Domingo 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3290.398794774701!2d-58.75813462353735!3d-34.442023348978196!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bc9f46af34c133%3A0x6c42af30ffcb48b8!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749060958080!5m2!1ses!2sar"},{nombre:"Villa Adelina",direccion:"Av. de Mayo 99",localidad:"Villa Adelina",provincia:"Provincia de Buenos Aires",telefono:"4765-2553",horario:"Domingo a Jueves 11:00 a 15:00 y 19:00 a 23:30 | Viernes a Sábado 11:00 a 16:00 y 19:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.7278628089402!2d-58.542755023534525!3d-34.509782852544575!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb08faee6e669%3A0xb6100019305ec808!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749061115273!5m2!1ses!2sar"},{nombre:"Villa Crespo",direccion:"Av. Córdoba 4102",localidad:"Villa Crespo",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4735-8704 / 54 11 4581-7000",horario:"Lunes a Domingo 11:00 a 17:00 y 18:00 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3284.275701940941!2d-58.42754912353115!3d-34.597189257154746!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bccb01d2c10897%3A0xedbe064
21714016cf54!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749061324888!5m2!1ses!2sar"},{nombre:"Villa Urquiza",direccion:"Av. de los Constituyentes 4599",localidad:"Villa Urquiza",provincia:"Ciudad Autónoma de Buenos Aires",telefono:"+54 11 4574-4043 / 54 11 4874-9966 / 54 11 4574-2407",horario:"Lunes a Miércoles 11:00 a 23:30 | Jueves 11:00 a 00:00 | Viernes y Sábado 11:00 a 00:00 | Domingo 17:45 a 00:00",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3284.892744322835!2d-58.49491812353177!3d-34.58158035633073!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb70a2d8361f3%3A0xdc78073fd174c7a1!2sMi%20Gusto!5e0!3m2!1ses!2sar!4v1749061480658!5m2!1ses!2sar"},{nombre:"Vicente Lopez",direccion:"Av. Maipú 1100",localidad:"Vicente López",provincia:"Provincia de Buenos Aires",telefono:"+54 11 4791-0000",horario:"Lunes a Domingo 11:00 a 23:30",mapaEmbedUrl:"https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d3287.064595955403!2d-58.4809886!3d-34.5265913!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x95bcb1504f60a29f%3A0x56b43fffb858a6a8!2sMi%20Gusto%20Vicente%20Lopez!5e0!3m2!1ses!2sar!4v1686600000000!5m2!1ses!2sar"}],Ff="/cartadigital/assets/logo-migusto-2025-CnNULOYA.png",Bk=()=>{const t=Ns(),[e,r]=aw(),n=e.get("sucursal")||"",s=t.pathname.startsWith("/admin"),[i,a]=P.useState(!1),[o,l]=P.useState(""),u=P.useRef(null);P.useEffect(()=>{const m=y=>{u.current&&!u.current.contains(y.target)&&a(!1)};return document.addEventListener("mousedown",m),()=>document.removeEventListener("mousedown",m)},[]);const c=pw.filter(m=>m.nombre.toLowerCase().includes(o.toLowerCase())),d=m=>{r({sucursal:m}),a(!1),l("")},f=e.get("view")||"promotions";return S.jsx("header",{className:"sticky top-0 z-40 bg-white/90 backdrop-blur-md border-b border-gray-100 shadow-sm",children:S.jsxs("div",{className:"max-w-feed md:max-w-none mx-auto px-4 md:px-8 h-16 flex items-center justify-between",children:[S.jsx("a",{href:"https://migusto.com.ar/",className:"flex items-center gap-2.5 group",children:S.jsx("img",{src:Ff,alt:"Mi Gusto Logo",className:"w-12 h-12 object-contain rounded-btn"})}),S.jsxs("nav",{className:"flex items-center gap-2 sm:gap-4",children:[!s&&S.jsxs(S.Fragment,{children:[S.jsxs("div",{className:"relative",ref:u,children:[S.jsxs("button",{onClick:()=>a(!i),className:"flex items-center gap-1.5 text-sm font-semibold text-text-secondary hover:text-primary transition-colors px-3 py-2 rounded-btn",children:[S.jsx("span",{children:n||"Sucursales"}),S.jsx(Ck,{size:14,className:`transition-transform duration-200 ${i?"rotate-180":""}`})]}),i&&S.jsxs("div",{className:"absolute right-0 mt-2 w-64 bg-background-secondary border border-slate-800 rounded-card shadow-lg z-50 overflow-hidden",children:[S.jsxs("div",{className:"p-2 border-b border-slate-800 flex items-center gap-2",children:[S.jsx($k,{size:14,className:"text-text-secondary opacity-50"}),S.jsx("input",{type:"text",placeholder:"Buscar sucursal...",value:o,onChange:m=>l(m.target.value),className:"w-full bg-transparent text-xs text-text outline-none placeholder-text-secondary",autoFocus:!0}),o&&S.jsx("button",{onClick:()=>l(""),children:S.jsx(Ps,{size:14,className:"text-text-secondary hover:text-text"})})]}),S.jsx("ul",{className:"max-h-60 overflow-y-auto scrollbar-thin py-1",children:c.length>0?c.map(m=>S.jsx("li",{children:S.jsx("button",{onClick:()=>d(m.nombre),className:`w-full text-left px-4 py-2 text-xs transition-colors hover:bg-primary/10 hover:text-primary ${n===m.nombre?"bg-primary/5 text-primary font-semibold":"text-text-secondary"}`,children:m.nombre})},m.nombre)):S.jsx("li",{className:"px-4 py-3 text-xs text-text-secondary text-center",children:"No se encontraron sucursales"})})]})]}),S.jsxs("div",{className:"relative inline-grid grid-cols-2 bg-background-secondary p-0.5 rounded-full border border-gray-200/80 shadow-sm overflow-hidden select-none",children:[S.jsx("div",{className:`absolute top-0.5 bottom-0.5 w-[calc(50%-2px)] bg-primary rounded-full transition-all duration-300 ease-out shadow-sm ${f==="interactive"?"left-[calc(50%+1px)]":"left-0.5"}`}),S.jsx("button",{type:"button",onClick:()=>{const m=new URLSearchParams(e);m.delete("view"),m.delete("sucursal"),r(m)},className:`relative z-10 px-4 py-1.5 rounded-full text-xs font-semibold whitespace-nowrap transition-colors duration-300 flex items-center justify-center text-center ${f!=="interactive"?"text-white font-bold":"text-text-secondary hover:text-text"}`,children:"Carta digital"}),S.jsx("button",{type:"button",onClick:()=>{const m=new URLSearchParams(e);m.set("view","interactive"),m.delete("sucursal"),r(m)},className:`relative z-10 px-4 py-1.5 rounded-full text-xs font-semibold whitespace-nowrap transition-colors duration-300 flex items-center justify-center text-center ${f==="interactive"?"text-white font-bold":"text-text-secondary hover:text-text"}`,children:"Revista"})]})]}),s&&S.jsx(iw,{to:"/",className:"flex items-center gap-1.5 text-sm font-semibold text-text-secondary hover:text-primary transition-colors px-3 py-2 rounded-btn hover:bg-primary/5",children:"Ver Feed"})]})]})})},Fk={success:cw,error:Kl,info:fw},Vk={success:"toast-success",error:"toast-error",info:"toast-info"},Wk={success:"text-secondary",error:"text-error",info:"text-primary"},Hk=({id:t,type:e,message:r,onRemove:n})=>{const s=Fk[e];return S.jsxs("div",{className:`toast ${Vk[e]}`,children:[S.jsx(s,{size:18,className:`flex-shrink-0 mt-0.5 ${Wk[e]}`}),S.jsx("p",{className:"flex-1 text-sm",children:r}),S.jsx("button",{onClick:()=>n(t),className:"flex-shrink-0 text-text-secondary hover:text-text transition-colors",children:S.jsx(Ps,{size:14})})]})},mw=()=>{const{toasts:t,removeToast:e}=lw();return S.jsx("div",{className:"toast-container",children:t.map(r=>S.jsx(Hk,{...r,onRemove:e},r.id))})},Gk=({children:t})=>S.jsxs("div",{className:"min-h-screen flex flex-col bg-background text-text",children:[S.jsx(Bk,{}),S.jsx("main",{className:"flex-1 mt-0 pt-0",children:t}),S.jsx(mw,{})]});function Bu(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 qk(t,e,r,n){function s(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(d){a(d)}}function l(c){try{u(n.throw(c))}catch(d){a(d)}}function u(c){c.done?i(c.value):s(c.value).then(o,l)}u((n=n.apply(t,e||[])).next())})}const Kk=t=>t?(...e)=>t(...e):(...e)=>fetch(...e);
217class Vf extends Error{constructor(e,r="FunctionsError",n){super(e),this.name=r,this.context=n}toJSON(){return{name:this.name,message:this.message,context:this.context}}}class Jk extends Vf{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class qm extends Vf{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Km extends Vf{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Xd;(function(t){t.Any="any",t.ApNortheast1="ap-northeast-1",t.ApNortheast2="ap-northeast-2",t.ApSouth1="ap-south-1",t.ApSoutheast1="ap-southeast-1",t.ApSoutheast2="ap-southeast-2",t.CaCentral1="ca-central-1",t.EuCentral1="eu-central-1",t.EuWest1="eu-west-1",t.EuWest2="eu-west-2",t.EuWest3="eu-west-3",t.SaEast1="sa-east-1",t.UsEast1="us-east-1",t.UsWest1="us-west-1",t.UsWest2="us-west-2"})(Xd||(Xd={}));class Zk{constructor(e,{headers:r={},customFetch:n,region:s=Xd.Any}={}){this.url=e,this.headers=r,this.region=s,this.fetch=Kk(n)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e){return qk(this,arguments,void 0,function*(r,n={}){var s;let i,a;try{const{headers:o,method:l,body:u,signal:c,timeout:d}=n;let f={},{region:m}=n;m||(m=this.region);const y=new URL(`${this.url}/${r}`);m&&m!=="any"&&(f["x-region"]=m,y.searchParams.set("forceFunctionRegion",m));let g;const b=!!o&&Object.keys(o).some(x=>x.toLowerCase()==="content-type");u&&!b?typeof Blob<"u"&&u instanceof Blob||u instanceof ArrayBuffer?(f["Content-Type"]="application/octet-stream",g=u):typeof u=="string"?(f["Content-Type"]="text/plain",g=u):typeof FormData<"u"&&u instanceof FormData?g=u:(f["Content-Type"]="application/json",g=JSON.stringify(u)):u&&typeof u!="string"&&!(typeof Blob<"u"&&u instanceof Blob)&&!(u instanceof ArrayBuffer)&&!(typeof FormData<"u"&&u instanceof FormData)?g=JSON.stringify(u):g=u;let _=c;d&&(a=new AbortController,i=setTimeout(()=>a.abort(),d),c?(_=a.signal,c.addEventListener("abort",()=>a.abort())):_=a.signal);const v=yield this.fetch(y.toString(),{method:l||"POST",headers:Object.assign(Object.assign(Object.assign({},f),this.headers),o),body:g,signal:_}).catch(x=>{throw new Jk(x)}),w=v.headers.get("x-relay-error");if(w&&w==="true")throw new qm(v);if(!v.ok)throw new Km(v);let h=((s=v.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),p;return h==="application/json"?p=yield v.json():h==="application/octet-stream"||h==="application/pdf"?p=yield v.blob():h==="text/event-stream"?p=v:h==="multipart/form-data"?p=yield v.formData():p=yield v.text(),{data:p,error:null,response:v}}catch(o){return{data:null,error:o,response:o instanceof Km||o instanceof qm?o.context:void 0}}finally{i&&clearTimeout(i)}})}}const gw=3,Jm=t=>Math.min(1e3*2**t,3e4),Yk=[520,503],vw=["GET","HEAD","OPTIONS"];var Zm=class extends Error{constructor(t){super(t.message),this.name="PostgrestError",this.details=t.details,this.hint=t.hint,this.co
217de=t.code}toJSON(){return{name:this.name,message:this.message,details:this.details,hint:this.hint,code:this.code}}};function Ym(t,e){return new Promise(r=>{if(e!=null&&e.aborted){r();return}const n=setTimeout(()=>{e==null||e.removeEventListener("abort",s),r()},t);function s(){clearTimeout(n),r()}e==null||e.addEventListener("abort",s)})}function Xk(t,e,r,n){return!(!n||r>=gw||!vw.includes(t)||!Yk.includes(e))}var Qk=class{constructor(t){var e,r,n,s,i;this.shouldThrowOnError=!1,this.retryEnabled=!0,this.method=t.method,this.url=t.url,this.headers=new Headers(t.headers),this.schema=t.schema,this.body=t.body,this.shouldThrowOnError=(e=t.shouldThrowOnError)!==null&&e!==void 0?e:!1,this.signal=t.signal,this.isMaybeSingle=(r=t.isMaybeSingle)!==null&&r!==void 0?r:!1,this.shouldStripNulls=(n=t.shouldStripNulls)!==null&&n!==void 0?n:!1,this.urlLengthLimit=(s=t.urlLengthLimit)!==null&&s!==void 0?s:8e3,this.retryEnabled=(i=t.retry)!==null&&i!==void 0?i:!0,t.fetch?this.fetch=t.fetch:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}stripNulls(){if(this.headers.get("Accept")==="text/csv")throw new Error("stripNulls() cannot be used with csv()");return this.shouldStripNulls=!0,this}setHeader(t,e){return this.headers=new Headers(this.headers),this.headers.set(t,e),this}retry(t){return this.retryEnabled=t,this}then(t,e){var r=this;if(this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers.set("Accept-Profile",this.schema):this.headers.set("Content-Profile",this.schema)),this.method!=="GET"&&this.method!=="HEAD"&&this.headers.set("Content-Type","application/json"),this.shouldStripNulls){const a=this.headers.get("Accept");a==="application/vnd.pgrst.object+json"?this.headers.set("Accept","application/vnd.pgrst.object+json;nulls=stripped"):(!a||a==="application/json")&&this.headers.set("Accept","application/vnd.pgrst.array+json;nulls=stripped")}const n=this.fetch;let i=(async()=>{let a=0;for(;;){const u={};r.headers.forEach((d,f)=>{u[f]=d}),a>0&&(u["X-Retry-Count"]=String(a));let c;try{c=await n(r.url.toString(),{method:r.method,headers:u,body:JSON.stringify(r.body,(d,f)=>typeof f=="bigint"?f.toString():f),signal:r.signal})}catch(d){if((d==null?void 0:d.name)==="AbortError"||(d==null?void 0:d.code)==="ABORT_ERR"||!vw.includes(r.method))throw d;if(r.retryEnabled&&a<gw){const f=Jm(a);a++,await Ym(f,r.signal);continue}throw d}if(Xk(r.method,c.status,a,r.retryEnabled)){var o,l;const d=(o=(l=c.headers)===null||l===void 0?void 0:l.get("Retry-After"))!==null&&o!==void 0?o:null,f=d!==null?Math.max(0,parseInt(d,10)||0)*1e3:Jm(a);await c.text(),a++,await Ym(f,r.signal);continue}return await r.processResponse(c)}})();return this.shouldThrowOnError||(i=i.catch(a=>{var o;let l="",u="",c="";const d=a==null?void 0:a.cause;if(d){var f,m,y,g;const v=(f=d==null?void 0:d.message)!==null&&f!==void 0?f:"",w=(m=d==null?void 0:d.code)!==null&&m!==void 0?m:"";l=`${(y=a==null?void 0:a.name)!==null&&y!==void 0?y:"FetchError"}: ${a==null?void 0:a.message}`,l+=`
218
219Caused by: ${(g=d==null?void 0:d.name)!==null&&g!==void 0?g:"Error"}: ${v}`,w&&(l+=` (${w})`),d!=null&&d.stack&&(l+=`
220${d.stack}`)}else{var b;l=(b=a==null?void 0:a.stack)!==null&&b!==void 0?b:""}const _=this.url.toString().length;return(a==null?void 0:a.name)==="AbortError"||(a==null?void 0:a.code)==="ABORT_ERR"?(c="",u="Request was aborted (timeout or manual cancellation)",_>this.urlLengthLimit&&(u+=`. Note: Your request URL is ${_} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)):((d==null?void 0:d.name)==="HeadersOverflowError"||(d==null?void 0:d.code)==="UND_ERR_HEADERS_OVERFLOW")&&(c="",u="HTTP headers exceeded server limits (typically 16KB)",_>this.urlLengthLimit&&(u+=`. Your request URL is ${_} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)),{success:!1,error:{message:`${(o=a==null?void 0:a.name)!==null&&o!==void 0?o:"FetchError"}: ${a==null?void 0:a.message}`,details:l,hint:u,code:c},data:null,count:null,status:0,statusText:""}}
220)),i.then(t,e)}async processResponse(t){var e=this;let r=null,n=null,s=null,i=t.status,a=t.statusText;if(t.ok){var o,l;if(e.method!=="HEAD"){var u;const f=await t.text();if(f!=="")if(e.headers.get("Accept")==="text/csv")n=f;else if(e.headers.get("Accept")&&(!((u=e.headers.get("Accept"))===null||u===void 0)&&u.includes("application/vnd.pgrst.plan+text")))n=f;else try{n=JSON.parse(f)}catch{if(r={message:f},n=null,e.shouldThrowOnError)throw new Zm({message:f,details:"",hint:"",code:""})}}const c=(o=e.headers.get("Prefer"))===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),d=(l=t.headers.get("content-range"))===null||l===void 0?void 0:l.split("/");c&&d&&d.length>1&&(s=parseInt(d[1])),e.isMaybeSingle&&Array.isArray(n)&&(n.length>1?(r={code:"PGRST116",details:`Results contain ${n.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},n=null,s=null,i=406,a="Not Acceptable"):n.length===1?n=n[0]:n=null)}else{const c=await t.text();try{r=JSON.parse(c),Array.isArray(r)&&t.status===404&&(n=[],r=null,i=200,a="OK")}catch{t.status===404&&c===""?(i=204,a="No Content"):r={message:c}}if(r&&e.shouldThrowOnError)throw new Zm(r)}return{success:r===null,error:r,data:n,count:s,status:i,statusText:a}}returns(){return this}overrideTypes(){return this}},eE=class extends Qk{throwOnError(){return super.throwOnError()}select(t){let e=!1;const r=(t??"*").split("").map(n=>/\s/.test(n)&&!e?"":(n==='"'&&(e=!e),n)).join("");return this.url.searchParams.set("select",r),this.headers.append("Prefer","return=representation"),this}order(t,{ascending:e=!0,nullsFirst:r,foreignTable:n,referencedTable:s=n}={}){const i=s?`${s}.order`:"order",a=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${a?`${a},`:""}${t}.${e?"asc":"desc"}${r===void 0?"":r?".nullsfirst":".nullslast"}`),this}limit(t,{foreignTable:e,referencedTable:r=e}={}){const n=typeof r>"u"?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${t}`),this}range(t,e,{foreignTable:r,referencedTable:n=r}={}){const s=typeof n>"u"?"offset":`${n}.offset`,i=typeof n>"u"?"limit":`${n}.limit`;return this.url.searchParams.set(s,`${t}`),this.url.searchParams.set(i,`${e-t+1}`),this}abortSignal(t){return this.signal=t,this}single(){return this.headers.set("Accept","application/vnd.pgrst.object+json"),this}maybeSingle(){return this.isMaybeSingle=!0,this}csv(){return this.headers.set("Accept","text/csv"),this}geojson(){return this.headers.set("Accept","application/geo+json"),this}explain({analyze:t=!1,verbose:e=!1,settings:r=!1,buffers:n=!1,wal:s=!1,format:i="text"}={}){var a;const o=[t?"analyze":null,e?"verbose":null,r?"settings":null,n?"buffers":null,s?"wal":null].filter(Boolean).join("|"),l=(a=this.headers.get("Accept"))!==null&&a!==void 0?a:"application/json";return this.headers.set("Accept",`application/vnd.pgrst.plan+${i}; for="${l}"; options=${o};`),i==="json"?this:this}rollback(){return this.headers.append("Prefer","tx=rollback"),this}returns(){return this}maxAffected(t){return this.headers.append("Prefer","handling=strict"),this.headers.append("Prefer",`max-affected=${t}`),this}};const Xm=new RegExp("[,()]");var Ws=class extends eE{throwOnError(){return super.throwOnError()}eq(t,e){return this.url.searchParams.append(t,`eq.${e}`),this}neq(t,e){return this.url.searchParams.append(t,`neq.${e}`),this}gt(t,e){return this.url.searchParams.append(t,`gt.${e}`),this}gte(t,e){return this.url.searchParams.append(t,`gte.${e}`),this}lt(t,e){return this.url.searchParams.append(t,`lt.${e}`),this}lte(t,e){return this.url.searchParams.append(t,`lte.${e}`),this}like(t,e){return this.url.searchParams.append(t,`like.${e}`),this}likeAllOf(t,e){return this.url.searchParams.append(t,`like(all).{${e.join(",")}}`),this}likeAnyOf(t,e){return this.url.searchParams.append(t,`like(any).{${e.join(",")}}`),this}ilike(t,e){return this.url.searchParams.append(t,`ilike.${e}`),this}ilikeAllOf(t,e){return this.url.searchParams.append(t,`ilike(all).{${e.join(",")}}`),this}ilikeAnyOf(t,e){return this.url.searchParams.append(t,`ilike(any).{${e.join(",")}}`),this}regexMatch(t,e){return this.url.searchParams.append(t,`match.${e}`),this}regexIMatch(t,e){return this.url.searchParams.append(t,`imatch.${e}`),this}is(t,e){return this.url.searchParams.append(t,`is.${e}`),this}isDistinct(t,e){return this.url.searchParams.append(t,`isdistinct.${e}`),this}in(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Xm.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`in.(${r})`),this}notIn(t,e){const r=Array.from(new Set(e)).map(n=>typeof n=="string"&&Xm.test(n)?`"${n}"`:`${n}`).join(",");return this.url.searchParams.append(t,`not.in.(${r})`),this}contains(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cs.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cs.{${e.join(",")}}`):this.url.searchParams.append(t,`cs.${JSON.stringify(e)}`),this}containedBy(t,e){return typeof e=="string"?this.url.searchParams.append(t,`cd.${e}`):Array.isArray(e)?this.url.searchParams.append(t,`cd.{${e.join(",")}}`):this.url.searchParams.append(t,`cd.${JSON.stringify(e)}`),this}rangeGt(t,e){return this.url.searchParams.append(t,`sr.${e}`),this}rangeGte(t,e){return this.url.searchParams.append(t,`nxl.${e}`),this}rangeLt(t,e){return this.url.searchParams.append(t,`sl.${e}`),this}rangeLte(t,e){return this.url.searchParams.append(t,`nxr.${e}`),this}rangeAdjacent(t,e){return this.url.searchParams.append(t,`adj.${e}`),this}overlaps(t,e){return typeof e=="string"?this.url.searchParams.append(t,`ov.${e}`):this.url.searchParams.append(t,`ov.{${e.join(",")}}`),this}textSearch(t,e,{config:r,type:n}={}){let s="";n==="plain"?s="pl":n==="phrase"?s="ph":n==="websearch"&&(s="w");const i=r===void 0?"":`(${r})`;return this.url.searchParams.append(t,`${s}fts${i}.${e}`),this}match(t){return Object.entries(t).filter(([e,r])=>
220r!==void 0).forEach(([e,r])=>{this.url.searchParams.append(e,`eq.${r}`)}),this}not(t,e,r){return this.url.searchParams.append(t,`not.${e}.${r}`),this}or(t,{foreignTable:e,referencedTable:r=e}={}){const n=r?`${r}.or`:"or";return this.url.searchParams.append(n,`(${t})`),this}filter(t,e,r){return this.url.searchParams.append(t,`${e}.${r}`),this}},tE=class{constructor(t,{headers:e={},schema:r,fetch:n,urlLengthLimit:s=8e3,retry:i}){this.url=t,this.headers=new Headers(e),this.schema=r,this.fetch=n,this.urlLengthLimit=s,this.retry=i}cloneRequestState(){return{url:new URL(this.url.toString()),headers:new Headers(this.headers)}}select(t,e){const{head:r=!1,count:n}=e??{},s=r?"HEAD":"GET";let i=!1;const a=(t??"*").split("").map(u=>/\s/.test(u)&&!i?"":(u==='"'&&(i=!i),u)).join(""),{url:o,headers:l}=this.cloneRequestState();return o.searchParams.set("select",a),n&&l.append("Prefer",`count=${n}`),new Ws({method:s,url:o,headers:l,schema:this.schema,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}insert(t,{count:e,defaultToNull:r=!0}={}){var n;const s="POST",{url:i,headers:a}=this.cloneRequestState();if(e&&a.append("Prefer",`count=${e}`),r||a.append("Prefer","missing=default"),Array.isArray(t)){const o=t.reduce((l,u)=>l.concat(Object.keys(u)),[]);if(o.length>0){const l=[...new Set(o)].map(u=>`"${u}"`);i.searchParams.set("columns",l.join(","))}}return new Ws({method:s,url:i,headers:a,schema:this.schema,body:t,fetch:(n=this.fetch)!==null&&n!==void 0?n:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}upsert(t,{onConflict:e,ignoreDuplicates:r=!1,count:n,defaultToNull:s=!0}={}){var i;const a="POST",{url:o,headers:l}=this.cloneRequestState();if(l.append("Prefer",`resolution=${r?"ignore":"merge"}-duplicates`),e!==void 0&&o.searchParams.set("on_conflict",e),n&&l.append("Prefer",`count=${n}`),s||l.append("Prefer","missing=default"),Array.isArray(t)){const u=t.reduce((c,d)=>c.concat(Object.keys(d)),[]);if(u.length>0){const c=[...new Set(u)].map(d=>`"${d}"`);o.searchParams.set("columns",c.join(","))}}return new Ws({method:a,url:o,headers:l,schema:this.schema,body:t,fetch:(i=this.fetch)!==null&&i!==void 0?i:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}update(t,{count:e}={}){var r;const n="PATCH",{url:s,headers:i}=this.cloneRequestState();return e&&i.append("Prefer",`count=${e}`),new Ws({method:n,url:s,headers:i,schema:this.schema,body:t,fetch:(r=this.fetch)!==null&&r!==void 0?r:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}delete({count:t}={}){var e;const r="DELETE",{url:n,headers:s}=this.cloneRequestState();return t&&s.append("Prefer",`count=${t}`),new Ws({method:r,url:n,headers:s,schema:this.schema,fetch:(e=this.fetch)!==null&&e!==void 0?e:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};function Xa(t){"@babel/helpers - typeof";return Xa=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},Xa(t)}function rE(t,e){if(Xa(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(Xa(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function nE(t){var e=rE(t,"string");return Xa(e)=="symbol"?e:e+""}function sE(t,e,r){return(e=nE(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Qm(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 qo(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Qm(Object(r),!0).forEach(function(n){sE(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Qm(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var iE=class yw{constructor(e,{headers:r={},schema:n,fetch:s,timeout:i,urlLengthLimit:a=8e3,retry:o}={}){this.url=e,this.headers=new Headers(r),this.schemaName=n,this.urlLengthLimit=a;const l=s??globalThis.fetch;i!==void 0&&i>0?this.fetch=(u,c)=>{const d=new AbortController,f=setTimeout(()=>d.abort(),i),m=c==null?void 0:c.signal;if(m){if(m.aborted)return clearTimeout(f),l(u,c);const y=()=>{clearTimeout(f),d.abort()};return m.addEventListener("abort",y,{once:!0}),l(u,qo(qo({},c),{},{signal:d.signal})).finally(()=>{clearTimeout(f),m.removeEventListener("abort",y)})}return l(u,qo(qo({},c),{},{signal:d.signal})).finally(()=>clearTimeout(f))}:this.fetch=l,this.retry=o}from(e){if(!e||typeof e!="string"||e.trim()==="")throw new Error("Invalid relation name: relation must be a non-empty string.");return new tE(new URL(`${this.url}/${e}`),{headers:new Headers(this.headers),schema:this.schemaName,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}schema(e){return new yw(this.url,{headers:this.headers,schema:e,fetch:this.fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}rpc(e,r={},{head:n=!1,get:s=!1,count:i}={}){var a;let o;const l=new URL(`${this.url}/rpc/${e}`);let u;const c=m=>m!==null&&typeof m=="object"&&(!Array.isArray(m)||m.some(c)),d=n&&Object.values(r).some(c);d?(o="POST",u=r):n||s?(o=n?"HEAD":"GET",Object.entries(r).filter(([m,y])=>y!==void 0).map(([m,y])=>[m,Array.isArray(y)?`{${y.join(",")}}`:`${y}
220`]).forEach(([m,y])=>{l.searchParams.append(m,y)})):(o="POST",u=r);const f=new Headers(this.headers);return d?f.set("Prefer",i?`count=${i},return=minimal`:"return=minimal"):i&&f.set("Prefer",`count=${i}`),new Ws({method:o,url:l,headers:f,schema:this.schemaName,body:u,fetch:(a=this.fetch)!==null&&a!==void 0?a:fetch,urlLengthLimit:this.urlLengthLimit,retry:this.retry})}};class aE{constructor(){}static detectEnvironment(){var e;if(typeof WebSocket<"u")return{type:"native",wsConstructor:WebSocket};const r=globalThis;if(typeof globalThis<"u"&&typeof r.WebSocket<"u")return{type:"native",wsConstructor:r.WebSocket};const n=typeof global<"u"?global:void 0;if(n&&typeof n.WebSocket<"u")return{type:"native",wsConstructor:n.WebSocket};if(typeof globalThis<"u"&&typeof r.WebSocketPair<"u"&&typeof globalThis.WebSocket>"u")return{type:"cloudflare",error:"Cloudflare Workers detected. WebSocket clients are not supported in Cloudflare Workers.",workaround:"Use Cloudflare Workers WebSocket API for server-side WebSocket handling, or deploy to a different runtime."};if(typeof globalThis<"u"&&r.EdgeRuntime||typeof navigator<"u"&&(!((e=navigator.userAgent)===null||e===void 0)&&e.includes("Vercel-Edge")))return{type:"unsupported",error:"Edge runtime detected (Vercel Edge/Netlify Edge). WebSockets are not supported in edge functions.",workaround:"Use serverless functions or a different deployment target for WebSocket functionality."};const s=globalThis.process;if(s){const i=s.versions;if(i&&i.node)return{type:"unsupported",error:"Node.js detected but native WebSocket not found.",workaround:"Ensure you are running Node.js 22+ or provide a WebSocket implementation via the transport option."}}return{type:"unsupported",error:"Unknown JavaScript runtime without WebSocket support.",workaround:"Ensure you're running in a supported environment (browser, Node.js, Deno) or provide a custom WebSocket implementation."}}static getWebSocketConstructor(){const e=this.detectEnvironment();if(e.wsConstructor)return e.wsConstructor;let r=e.error||"WebSocket not supported in this environment.";throw e.workaround&&(r+=`
221
222Suggested solution: ${e.workaround}`),new Error(r)}static isWebSocketSupported(){try{return this.detectEnvironment().type==="native"}catch{return!1}}}const oE="2.110.0",lE=`realtime-js/${oE}`,uE="1.0.0",ww="2.0.0",cE=ww,dE=1e4,hE=100,wn={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},_w={close:"phx_close",error:"phx_error",join:"phx_join",leave:"phx_leave",access_token:"access_token"},Qd={connecting:"connecting",closing:"closing",closed:"closed"};class fE{constructor(e){this.HEADER_LENGTH=1,this.USER_BROADCAST_PUSH_META_LENGTH=6,this.KINDS={userBroadcastPush:3,userBroadcast:4},this.BINARY_ENCODING=0,this.JSON_ENCODING=1,this.BROADCAST_EVENT="broadcast",this.allowedMetadataKeys=[],this.allowedMetadataKeys=e??[]}encode(e,r){if(e.event===this.BROADCAST_EVENT&&!(e.payload instanceof ArrayBuffer)&&typeof e.payload.event=="string")return r(this._binaryEncodeUserBroadcastPush(e));let n=[e.join_ref,e.ref,e.topic,e.event,e.payload];return r(JSON.stringify(n))}_binaryEncodeUserBroadcastPush(e){var r;return this._isArrayBuffer((r=e.payload)===null||r===void 0?void 0:r.payload)?this._encodeBinaryUserBroadcastPush(e):this._encodeJsonUserBroadcastPush(e)}_encodeBinaryUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:new ArrayBuffer(0);return this._encodeUserBroadcastPush(e,this.BINARY_ENCODING,s)}_encodeJsonUserBroadcastPush(e){var r,n;const s=(n=(r=e.payload)===null||r===void 0?void 0:r.payload)!==null&&n!==void 0?n:{},a=new TextEncoder().encode(JSON.stringify(s)).buffer;return this._encodeUserBroadcastPush(e,this.JSON_ENCODING,a)}_encodeUserBroadcastPush(e,r,n){var s,i;const a=e.topic,o=(s=e.ref)!==null&&s!==void 0?s:"",l=(i=e.join_ref)!==null&&i!==void 0?i:"",u=e.payload.event,c=this.allowedMetadataKeys?this._pick(e.payload,this.allowedMetadataKeys):{},d=Object.keys(c).length===0?"":JSON.stringify(c);if(l.length>255)throw new Error(`joinRef length ${l.length} exceeds maximum of 255`);if(o.length>255)throw new Error(`ref length ${o.length} exceeds maximum of 255`);if(a.length>255)throw new Error(`topic length ${a.length} exceeds maximum of 255`);if(u.length>255)throw new Error(`userEvent length ${u.length} exceeds maximum of 255`);if(d.length>255)throw new Error(`metadata length ${d.length} exceeds maximum of 255`);const f=this.USER_BROADCAST_PUSH_META_LENGTH+l.length+o.length+a.length+u.length+d.length,m=new ArrayBuffer(this.HEADER_LENGTH+f);let y=new DataView(m),g=0;y.setUint8(g++,this.KINDS.userBroadcastPush),y.setUint8(g++,l.length),y.setUint8(g++,o.length),y.setUint8(g++,a.length),y.setUint8(g++,u.length),y.setUint8(g++,d.length),y.setUint8(g++,r),Array.from(l,_=>y.setUint8(g++,_.charCodeAt(0))),Array.from(o,_=>y.setUint8(g++,_.charCodeAt(0))),Array.from(a,_=>y.setUint8(g++,_.charCodeAt(0))),Array.from(u,_=>y.setUint8(g++,_.charCodeAt(0))),Array.from(d,_=>y.setUint8(g++,_.charCodeAt(0)));var b=new Uint8Array(m.byteLength+n.byteLength);return b.set(new Uint8Array(m),0),b.set(new Uint8Array(n),m.byteLength),b.buffer}decode(e,r){if(this._isArrayBuffer(e)){let n=this._binaryDecode(e);return r(n)}if(typeof e=="string"){const n=JSON.parse(e),[s,i,a,o,l]=n;return r({join_ref:s,ref:i,topic:a,event:o,payload:l})}return r({})}_binaryDecode(e){const r=new DataView(e),n=r.getUint8(0),s=new TextDecoder;switch(n){case this.KINDS.userBroadcast:return this._decodeUserBroadcast(e,r,s)}}_decodeUserBroadcast(e,r,n){const s=r.getUint8(1),i=r.getUint8(2),a=r.getUint8(3),o=r.getUint8(4);let l=this.HEADER_LENGTH+4;const u=n.decode(e.slice(l,l+s));l=l+s;const c=n.decode(e.slice(l,l+i));l=l+i;const d=n.decode(e.slice(l,l+a));l=l+a;const f=e.slice(l,e.byteLength),m=o===this.JSON_ENCODING?JSON.parse(n.decode(f)):f,y={type:this.BROADCAST_EVENT,event:c,payload:m};return a>0&&(y.meta=JSON.parse(d)),{join_ref:null,ref:null,topic:u,event:this.BROADCAST_EVENT,payload:y}}_isArrayBuffer(e){var r;return e instanceof ArrayBuffer||((r=e==null?void 0:e.constructor)===null||r===void 0?void 0:r.name)==="ArrayBuffer"}_pick(e,r){return!e||typeof e!="object"?{}:Object.fromEntries(Object.entries(e).filter(([n])=>r.includes(n)))}}var ke;(function(t){t.abstime="abstime",t.bool="bool",t.date="date",t.daterange="daterange",t.float4="float4",t.float8="float8",t.int2="int2",t.int4="int4",t.int4range="int4range",t.int8="int8",t.int8range="int8range",t.json="json",t.jsonb="jsonb",t.money="money",t.numeric="numeric",t.oid="oid",t.reltime="reltime",t.text="text",t.time="time",t.timestamp="timestamp",t.timestamptz="timestamptz",t.timetz="timetz",t.t
vendor: 9,945 bytes, line 222
222srange="tsrange",t.tstzrange="tstzrange"})(ke||(ke={}));const eg=(t,e,r={})=>{var n;const s=(n=r.skipTypes)!==null&&n!==void 0?n:[];return e?Object.keys(e).reduce((i,a)=>(i[a]=pE(a,t,e,s),i),{}):{}},pE=(t,e,r,n)=>{const s=e.find(o=>o.name===t),i=s==null?void 0:s.type,a=r[t];return i&&!n.includes(i)?xw(i,a):eh(a)},xw=(t,e)=>{if(t.charAt(0)==="_"){const r=t.slice(1,t.length);return yE(e,r)}switch(t){case ke.bool:return mE(e);case ke.float4:case ke.float8:case ke.int2:case ke.int4:case ke.int8:case ke.numeric:case ke.oid:return gE(e);case ke.json:case ke.jsonb:return vE(e);case ke.timestamp:return wE(e);case ke.abstime:case ke.date:case ke.daterange:case ke.int4range:case ke.int8range:case ke.money:case ke.reltime:case ke.text:case ke.time:case ke.timestamptz:case ke.timetz:case ke.tsrange:case ke.tstzrange:return eh(e);default:return eh(e)}},eh=t=>t,mE=t=>{switch(t){case"t":return!0;case"f":return!1;default:return t}},gE=t=>{if(typeof t=="string"){const e=parseFloat(t);if(!Number.isNaN(e))return e}return t},vE=t=>{if(typeof t=="string")try{return JSON.parse(t)}catch{return t}return t},yE=(t,e)=>{if(typeof t!="string")return t;const r=t.length-1,n=t[r];if(t[0]==="{"&&n==="}"){let i;const a=t.slice(1,r);try{i=JSON.parse("["+a+"]")}catch{i=a?a.split(","):[]}return i.map(o=>xw(e,o))}return t},wE=t=>typeof t=="string"?t.replace(" ","T"):t,bw=t=>{const e=new URL(t);return e.protocol=e.protocol.replace(/^ws/i,"http"),e.pathname=e.pathname.replace(/\/+$/,"").replace(/\/socket\/websocket$/i,"").replace(/\/socket$/i,"").replace(/\/websocket$/i,""),e.pathname===""||e.pathname==="/"?e.pathname="/api/broadcast":e.pathname=e.pathname+"/api/broadcast",e.href};var Sa=t=>typeof t=="function"?t:function(){return t},_E=typeof self<"u"?self:null,Hs=typeof window<"u"?window:null,Nr=_E||Hs||globalThis,xE="2.0.0",bE=1e4,SE=1e3,jr={connecting:0,open:1,closing:2,closed:3},Pt={closed:"closed",errored:"errored",joined:"joined",joining:"joining",leaving:"leaving"},Gr={close:"phx_close",error:"phx_error",join:"phx_join",reply:"phx_reply",leave:"phx_leave"},th={longpoll:"longpoll",websocket:"websocket"},kE={complete:4},rh="base64url.bearer.phx.",Ko=class{constructor(t,e,r,n){this.channel=t,this.event=e,this.payload=r||function(){return{}},this.receivedResp=null,this.timeout=n,this.timeoutTimer=null,this.recHooks=[],this.sent=!1,this.ref=void 0}resend(t){this.timeout=t,this.reset(),this.send()}send(){this.hasReceived("timeout")||(this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload(),ref:this.ref,join_ref:this.channel.joinRef()}))}receive(t,e){return this.hasReceived(t)&&e(this.receivedResp.response),this.recHooks.push({status:t,callback:e}),this}reset(){this.cancelRefEvent(),this.ref=null,this.refEvent=null,this.receivedResp=null,this.sent=!1}destroy(){this.cancelRefEvent(),this.cancelTimeout()}matchReceive({status:t,response:e,_ref:r}){this.recHooks.filter(n=>n.status===t).forEach(n=>n.callback(e))}cancelRefEvent(){this.refEvent&&this.channel.off(this.refEvent)}cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=null}startTimeout(){this.timeoutTimer&&this.cancelTimeout(),this.ref=this.channel.socket.makeRef(),this.refEvent=this.channel.replyEventName(this.ref),this.channel.on(this.refEvent,t=>{this.cancelRefEvent(),this.cancelTimeout(),this.receivedResp=t,this.matchReceive(t)}),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}hasReceived(t){return this.receivedResp&&this.receivedResp.status===t}trigger(t,e){this.channel.trigger(this.refEvent,{status:t,response:e})}},Sw=class{constructor(t,e){this.callback=t,this.timerCalc=e,this.timer=void 0,this.tries=0}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}},EE=class{constructor(t,e,r){this.state=Pt.closed,this.topic=t,this.params=Sa(e||{}),this.socket=r,this.bindings=[],this.bindingRef=0,this.timeout=this.socket.timeout,this.joinedOnce=!1,this.joinPush=new Ko(this,Gr.join,this.params,this.timeout),this.pushBuffer=[],this.stateChangeRefs=[],this.rejoinTimer=new Sw(()=>{this.socket.isConnected()&&this.rejoin()},this.socket.rejoinAfterMs),this.stateChangeRefs.push(this.socket.onError(()=>this.rejoinTimer.reset())),this.stateChangeRefs.push(this.socket.onOpen(()=>{this.rejoinTimer.reset(),this.isErrored()&&this.rejoin()})),this.joinPush.receive("ok",()=>{this.state=Pt.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(n=>n.send()),this.pushBuffer=[]}),this.joinPush.receive("error",n=>{this.state=Pt.errored,this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.onClose(()=>{this.rejoinTimer.reset(),this.socket.hasLogger()&&this.socket.log("channel",`close ${this.topic}`),this.state=Pt.closed,this.socket.remove(this)}),this.onError(n=>{this.socket.hasLogger()&&this.socket.log("channel",`error ${this.topic}`,n),this.isJoining()&&this.joinPush.reset(),this.state=Pt.errored,this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.joinPush.receive("timeout",()=>{this.socket.hasLogger()&&this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),new Ko(this,Gr.leave,Sa({}),this.timeout).send(),this.state=Pt.errored,this.joinPush.reset(),this.socket.isConnected()&&this.rejoinTimer.scheduleTimeout()}),this.on(Gr.reply,(n,s)=>{this.trigger(this.replyEventName(s),n)})}join(t=this.timeout){if(this.joinedOnce)throw new Error("tried to join multiple times. 'join' can only be called a single time per channel instance");return this.timeout=t,this.joinedOnce=!0,this.rejoin(),this.joinPush}teardown(){this.pushBuffer.forEach(t=>t.destroy()),this.pushBuffer=[],this.rejoinTimer.reset(),this.joinPush.destroy(),this.state=Pt.closed,this.bindings=[]}onClose(t){this.on(Gr.close,t)}onError(t){return this.on(Gr.error,e=>t(e))}on(t,e){let r=this.bindingRef++;return this.bindings.push({event:t,ref:r,callback:e}),r}off(t,e){this.bindings=this.bindings.filter(r=>!(r.event===t&&(typeof e>"u"||e===r.ref)))}canPush(){return this.socket.isConnected()&&this.isJoined()}push(t,e,r=this.timeout){if(e=e||{},!this.joinedOnce)throw new Error(`tried to push '${t}' to '${this.topic}' before joining. Use channel.join() before pushing events`);let n=new Ko(this,t,function(){return e},r);return this.canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}leave(t=this.timeout){this.rejoinTimer.reset(),this.joinPush.cancelTimeout(),this.state=Pt.leaving;let e=()=>{this.socket.hasLogger()&&this.socket.log("channel",`leave ${this.topic}`),this.trigger(Gr.close,"leave")},r=new Ko(this,Gr.leave,Sa({}),t);return r.receive("ok",()=>e()).receive("timeout",()=>e()),r.send(),this.canPush()||r.trigger("ok",{}),r}onMessage(t,e,r){return e}filterBindings(t,e,r){return!0}isMember(t,e,r,n){return this.topic!==t?!1:n&&n!==this.joinRef()?(this.socket.hasLogger()&&this.socket.log("channel","dropping outdated message",{topic:t,event:e,payload:r,joinRef:n}),!1):!0}joinRef(){return this.joinPush.ref}rejoin(t=this.timeout){this.isLeaving()||(this.socket.leaveOpenTopic(this.topic),this.state=Pt.joining,this.joinPush.resend(t))}trigger(t,e,r,n){let s=this.onMessage(t,e,r,n);if(e&&!s)throw new Error("channel onMessage callbacks must return the payload, modified or unmodified");let i=this.bindings.filter(a=>a.event===t&&this.filterBindings(a,e,r));for(let a=0;a<i.length;a++)i[a].callback(s,r,n||this.joinRef())}replyEventName(t){return`chan_reply_${t}`}isClosed(){return this.state===Pt.closed}isErrored(){return this.state===Pt.errored}isJoined(){return this.state===Pt.joined}isJoining(){return this.state===Pt.joining}isLeaving(){return this.state===Pt.leaving}},Jl=class{static request(t,e,r,n,s,i,a){if(Nr.XDomainRequest){let o=new Nr.XDomainRequest;return this.xdomainRequest(o,t,e,n,s,i,a)}else if(Nr.XMLHttpRequest){let o=new Nr.XMLHttpRequest;return this.xhrRequest(o,t,e,r,n,s,i,a)}else{if(Nr.fetch&&Nr.AbortController)return this.fetchRequest(t,e,r,n,s,i,a);throw new Error("No suitable XMLHttpRequest implementation found")}}static fetchRequest(t,e,r,n,s,i,a){let o={method:t,headers:r,body:n},l=null;return s&&(l=new AbortController,setTimeout(()=>l.abort(),s),o.signal=l.signal),Nr.fetch(e,o).then(u=>u.text()).then(u=>this.parseJSON(u)).then(u=>a&&a(u)).catch(u=>{u.name==="AbortError"&&i?i():a&&a(null)}),l}static xdomainRequest(t,e,r,n,s,i,a){return t.timeout=s,t.open(e,r),t.onload=()=>{let o=this.parseJSON(t.responseText);a&&a(o)},i&&(t.ontimeout=i),t.onprogress=()=>{},t.send(n),t}static xhrRequest(t,e,r,n,s,i,a,o){t.open(e,r,!0),t.timeout=i;for(let[l,u]of Object.entries(n))t.setRequestHeader(l,u);return t.onerror=()=>o&&o(null),t.onreadystatechange=()=>{if(t.readyState===kE.complete&&o){let l=this.parseJSON(t.responseText);o(l)}},a&&(t.ontimeout=a),t.send(s),t}static parseJSON(t){if(!t||t==="")return null;try{return JSON.parse(t)}catch{return console&&console.log("failed to parse JSON response",t),null}}static serialize(t,e){let r=[];for(var n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;let s=e?`${e}[${n}]`:n,i=t[n];typeof i=="object"?r.push(this.serialize(i,s)):r.push(encodeURIComponent(s)+"="+encodeURIComponent(i))}return r.join("&")}static appendParams(t,e){if(Object.keys(e).length===0)return t;let r=t.match(/\?/)?"&":"?";return`${t}${r}${this.serialize(e)}`}},TE=t=>{let e="",r=new Uint8Array(t),n=r.byteLength;for(let s=0;s<n;s++)e+=String.fromCharCode(r[s]);return btoa(e)},Ds=class{constructor(t,e){e&&e.length===2&&e[1].startsWith(rh)&&(this.authToken=atob(e[1].slice(rh.length))),this.endPoint=null,this.token=null,this.skipHeartbeat=!0,this.reqs=new Set,this.awaitingBatchAck=!1,this.currentBatch=null,this.currentBatchTimer=null,this.batchBuffer=[],this.onopen=function(){},this.onerror=function(){},this.onmessage=function(){}
vendor: 14,097 bytes, lines 222-223
222,this.onclose=function(){},this.pollEndpoint=this.normalizeEndpoint(t),this.readyState=jr.connecting,setTimeout(()=>this.poll(),0)}normalizeEndpoint(t){return t.replace("ws://","http://").replace("wss://","https://").replace(new RegExp("(.*)/"+th.websocket),"$1/"+th.longpoll)}endpointURL(){return Jl.appendParams(this.pollEndpoint,{token:this.token})}closeAndRetry(t,e,r){this.close(t,e,r),this.readyState=jr.connecting}ontimeout(){this.onerror("timeout"),this.closeAndRetry(1005,"timeout",!1)}isActive(){return this.readyState===jr.open||this.readyState===jr.connecting}poll(){const t={Accept:"application/json"};this.authToken&&(t["X-Phoenix-AuthToken"]=this.authToken),this.ajax("GET",t,null,()=>this.ontimeout(),e=>{if(e){var{status:r,token:n,messages:s}=e;if(r===410&&this.token!==null){this.onerror(410),this.closeAndRetry(3410,"session_gone",!1);return}this.token=n}else r=0;switch(r){case 200:s.forEach(i=>{setTimeout(()=>this.onmessage({data:i}),0)}),this.poll();break;case 204:this.poll();break;case 410:this.readyState=jr.open,this.onopen({}),this.poll();break;case 403:this.onerror(403),this.close(1008,"forbidden",!1);break;case 0:case 500:this.onerror(500),this.closeAndRetry(1011,"internal server error",500);break;default:throw new Error(`unhandled poll status ${r}`)}})}send(t){typeof t!="string"&&(t=TE(t)),this.currentBatch?this.currentBatch.push(t):this.awaitingBatchAck?this.batchBuffer.push(t):(this.currentBatch=[t],this.currentBatchTimer=setTimeout(()=>{this.batchSend(this.currentBatch),this.currentBatch=null},0))}batchSend(t){this.awaitingBatchAck=!0,this.ajax("POST",{"Content-Type":"application/x-ndjson"},t.join(`
223`),()=>this.onerror("timeout"),e=>{this.awaitingBatchAck=!1,!e||e.status!==200?(this.onerror(e&&e.status),this.closeAndRetry(1011,"internal server error",!1)):this.batchBuffer.length>0&&(this.batchSend(this.batchBuffer),this.batchBuffer=[])})}close(t,e,r){for(let s of this.reqs)s.abort();this.readyState=jr.closed;let n=Object.assign({code:1e3,reason:void 0,wasClean:!0},{code:t,reason:e,wasClean:r});this.batchBuffer=[],clearTimeout(this.currentBatchTimer),this.currentBatchTimer=null,typeof CloseEvent<"u"?this.onclose(new CloseEvent("close",n)):this.onclose(n)}ajax(t,e,r,n,s){let i,a=()=>{this.reqs.delete(i),n()};i=Jl.request(t,this.endpointURL(),e,r,this.timeout,a,o=>{this.reqs.delete(i),this.isActive()&&s(o)}),this.reqs.add(i)}},CE=class la{constructor(e,r={}){let n=r.events||{state:"presence_state",diff:"presence_diff"};this.state={},this.pendingDiffs=[],this.channel=e,this.joinRef=null,this.caller={onJoin:function(){},onLeave:function(){},onSync:function(){}},this.channel.on(n.state,s=>{let{onJoin:i,onLeave:a,onSync:o}=this.caller;this.joinRef=this.channel.joinRef(),this.state=la.syncState(this.state,s,i,a),this.pendingDiffs.forEach(l=>{this.state=la.syncDiff(this.state,l,i,a)}),this.pendingDiffs=[],o()}),this.channel.on(n.diff,s=>{let{onJoin:i,onLeave:a,onSync:o}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(s):(this.state=la.syncDiff(this.state,s,i,a),o())})}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}list(e){return la.list(this.state,e)}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel.joinRef()}static syncState(e,r,n,s){let i=this.clone(e),a={},o={};return this.map(i,(l,u)=>{r[l]||(o[l]=u)}),this.map(r,(l,u)=>{let c=i[l];if(c){let d=u.metas.map(g=>g.phx_ref),f=c.metas.map(g=>g.phx_ref),m=u.metas.filter(g=>f.indexOf(g.phx_ref)<0),y=c.metas.filter(g=>d.indexOf(g.phx_ref)<0);m.length>0&&(a[l]=u,a[l].metas=m),y.length>0&&(o[l]=this.clone(c),o[l].metas=y)}else a[l]=u}),this.syncDiff(i,{joins:a,leaves:o},n,s)}static syncDiff(e,r,n,s){let{joins:i,leaves:a}=this.clone(r);return n||(n=function(){}),s||(s=function(){}),this.map(i,(o,l)=>{let u=e[o];if(e[o]=this.clone(l),u){let c=e[o].metas.map(f=>f.phx_ref),d=u.metas.filter(f=>c.indexOf(f.phx_ref)<0);e[o].metas.unshift(...d)}n(o,u,l)}),this.map(a,(o,l)=>{let u=e[o];if(!u)return;let c=l.metas.map(d=>d.phx_ref);u.metas=u.metas.filter(d=>c.indexOf(d.phx_ref)<0),s(o,u,l),u.metas.length===0&&delete e[o]}),e}static list(e,r){return r||(r=function(n,s){return s}),this.map(e,(n,s)=>r(n,s))}static map(e,r){return Object.getOwnPropertyNames(e).map(n=>r(n,e[n]))}static clone(e){return JSON.parse(JSON.stringify(e))}},Jo={HEADER_LENGTH:1,META_LENGTH:4,KINDS:{push:0,reply:1,broadcast:2},encode(t,e){if(t.payload.constructor===ArrayBuffer)return e(this.binaryEncode(t));{let r=[t.join_ref,t.ref,t.topic,t.event,t.payload];return e(JSON.stringify(r))}},decode(t,e){if(t.constructor===ArrayBuffer)return e(this.binaryDecode(t));{let[r,n,s,i,a]=JSON.parse(t);return e({join_ref:r,ref:n,topic:s,event:i,payload:a})}},binaryEncode(t){let{join_ref:e,ref:r,event:n,topic:s,payload:i}=t,a=this.META_LENGTH+e.length+r.length+s.length+n.length,o=new ArrayBuffer(this.HEADER_LENGTH+a),l=new DataView(o),u=0;l.setUint8(u++,this.KINDS.push),l.setUint8(u++,e.length),l.setUint8(u++,r.length),l.setUint8(u++,s.length),l.setUint8(u++,n.length),Array.from(e,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(r,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(s,d=>l.setUint8(u++,d.charCodeAt(0))),Array.from(n,d=>l.setUint8(u++,d.charCodeAt(0)));var c=new Uint8Array(o.byteLength+i.byteLength);return c.set(new Uint8Array(o),0),c.set(new Uint8Array(i),o.byteLength),c.buffer},binaryDecode(t){let e=new DataView(t),r=e.getUint8(0),n=new TextDecoder;switch(r){case this.KINDS.push:return this.decodePush(t,e,n);case this.KINDS.reply:return this.decodeReply(t,e,n);case this.KINDS.broadcast:return this.decodeBroadcast(t,e,n)}},decodePush(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),a=this.HEADER_LENGTH+this.META_LENGTH-1,o=r.decode(t.slice(a,a+n));a=a+n;let l=r.decode(t.slice(a,a+s));a=a+s;let u=r.decode(t.slice(a,a+i));a=a+i;let c=t.slice(a,t.byteLength);return{join_ref:o,ref:null,topic:l,event:u,payload:c}},decodeReply(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=e.getUint8(3),a=e.getUint8(4),o=this.HEADER_LENGTH+this.META_LENGTH,l=r.decode(t.slice(o,o+n));o=o+n;let u=r.decode(t.slice(o,o+s));o=o+s;let c=r.decode(t.slice(o,o+i));o=o+i;let d=r.decode(t.slice(o,o+a));o=o+a;let f=t.slice(o,t.byteLength),m={status:d,response:f};return{join_ref:l,ref:u,topic:c,event:Gr.reply,payload:m}},decodeBroadcast(t,e,r){let n=e.getUint8(1),s=e.getUint8(2),i=this.HEADER_LENGTH+2,a=r.decode(t.slice(i,i+n));i=i+n;let o=r.decode(t.slice(i,i+s));i=i+s;let l=t.slice(i,t.byteLength);return{join_ref:null,ref:null,topic:a,event:o,payload:l}}},PE=class{constructor(t,e={}){this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.channels=[],this.sendBuffer=[],this.ref=0,this.fallbackRef=null,this.timeout=e.timeout||bE,this.transport=e.transport||Nr.WebSocket||Ds,this.conn=void 0,this.primaryPassedHealthCheck=!1,this.longPollFallbackMs=e.longPollFallbackMs,this.fallbackTimer=null;let r=null;try{r=Nr&&Nr.sessionStorage}catch{}this.sessionStore=e.sessionStorage||r,this.establishedConnections=0,this.defaultEncoder=Jo.encode.bind(Jo),this.defaultDecoder=Jo.decode.bind(Jo),this.closeWasClean=!0,this.disconnecting=!1,this.binaryType=e.binaryType||"arraybuffer",this.connectClock=1,this.pageHidden=!1,this.encode=void 0,this.decode=void 0,this.transport!==Ds?(this.encode=e.encode||this.defaultEncoder,this.decode=e.decode||this.defaultDecoder):(this.encode=this.defaultEncoder,this.decode=this.defaultDecoder);let n=null;Hs&&Hs.addEventListener&&(Hs.addEventListener("pagehide",s=>{this.conn&&(this.disconnect(),n=this.connectClock)}),Hs.addEventListener("pageshow",s=>{n===this.connectClock&&(n=null,this.connect())}),Hs.addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"?this.pageHidden=!0:(this.pageHidden=!1,!this.isConnected()&&!this.closeWasClean&&this.teardown(()=>this.connect()))})),this.heartbeatIntervalMs=e.heartbeatIntervalMs||3e4,this.autoSendHeartbeat=e.autoSendHeartbeat??!0,this.heartbeatCallback=e.heartbeatCallback??(()=>{}),this.rejoinAfterMs=s=>e.rejoinAfterMs?e.rejoinAfterMs(s):[1e3,2e3,5e3][s-1]||1e4,this.reconnectAfterMs=s=>e.reconnectAfterMs?e.reconnectAfterMs(s):[10,50,100,150,200,250,500,1e3,2e3][s-1]||5e3,this.logger=e.logger||null,!this.logger&&e.debug&&(this.logger=(s,i,a)=>{console.log(`${s}: ${i}`,a)}),this.longpollerTimeout=e.longpollerTimeout||2e4,this.params=Sa(e.params||{}),this.endPoint=`${t}/${th.websocket}`,this.vsn=e.vsn||xE,this.heartbeatTimeoutTimer=null,this.heartbeatTimer=null,this.heartbeatSentAt=null,this.pendingHeartbeatRef=null,this.reconnectTimer=new Sw(()=>{if(this.pageHidden){this.log("Not reconnecting as page is hidden!"),this.teardown();return}this.teardown(async()=>{e.beforeReconnect&&await e.beforeReconnect(),this.connect()})},this.reconnectAfterMs),this.authToken=e.authToken}getLongPollTransport(){return Ds}replaceTransport(t){this.connectClock++,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.conn&&(this.conn.close(),this.conn=null),this.transport=t}protocol(){return location.protocol.match(/^https/)?"wss":"ws"}endPointURL(){let t=Jl.appendParams(Jl.appendParams(this.endPoint,this.params()),{vsn:this.vsn});return t.charAt(0)!=="/"?t:t.charAt(1)==="/"?`${this.protocol()}:${t}`:`${this.protocol()}://${location.host}${t}`}disconnect(t,e,r){this.connectClock++,this.disconnecting=!0,this.closeWasClean=!0,clearTimeout(this.fallbackTimer),this.reconnectTimer.reset(),this.teardown(()=>{this.disconnecting=!1,t&&t()},e,r)}connect(t){t&&(console&&console.log("passing params to connect is deprecated. Instead pass :params to the Socket constructor"),this.params=Sa(t)),!(this.conn&&!this.disconnecting)&&(this.longPollFallbackMs&&this.transport!==Ds?this.connectWithFallback(Ds,this.longPollFallbackMs):this.transportConnect())}log(t,e,r){this.logger&&this.logger(t,e,r)}hasLogger(){return this.logger!==null}onOpen(t){let e=this.makeRef();return this.stateChangeCallbacks.open.push([e,t]),e}onClose(t){let e=this.makeRef();return this.stateChangeCallbacks.close.push([e,t]),e}onError(t){let e=this.makeRef();return this.stateChangeCallbacks.error.push([e,t]),e}onMessage(t){let e=this.makeRef();return this.stateChangeCallbacks.message.push([e,t]),e}onHeartbeat(t){this.heartbeatCallback=t}ping(t){if(!this.isConnected())return!1;let e=this.makeRef(),r=Date.now();this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:e});let n=this.onMessage(s=>{s.ref===e&&(this.off([n]),t(Date.now()-r))});return!0}transportName(t){switch(t){case Ds:return"LongPoll";default:return t.name}}transportConnect(){this.connectClock++,this.closeWasClean=!1;let t;this.authToken&&(t=["phoenix",`${rh}${btoa(this.authToken).replace(/=/g,"")}`]),this.conn=new this.transport(this.endPointURL(),t),this.conn.binaryType=this.binaryType,this.conn.timeout=this.longpollerTimeout,this.conn.onopen=()=>this.onConnOpen(),this.conn.onerror=e=>this.onConnError(e),this.conn.onmessage=e=>this.onConnMessage(e),this.conn.onclose=e=>this.onConnClose(e)}getSession(t){return this.sessionStore&&this.sessionStore.getItem(t)}storeSession(t,e){this.sessionStore&&this.sessionStore.setItem(t,e)}connectWithFallback(t,e=2500){clearTimeout(this.fallbackTimer);let r=!1,n=!0,s,i,a=this.transportName(t),o=l=>{this.log("transport",`falling back to ${a}...`,l),this.off([s,i]),n=!1,this.replaceTransport(t),this.transportConnect()};if(this.getSession(`phx:fallback:${a}`))return o("memorized");this.fallbackTimer=setTimeout(o,e),i=this.onError(l=>{this.log("transport","error",l),n&&!r&&(clearTimeout(this.fallbackTimer),o(l))}),this.fallbackRef&&this.off([this.fallbackRef]),this.fallbackRef=this.onOpen(()=>{if(r=!0,!n){let l=this.transportName(t);return this.primaryPassedHealthCheck||this.storeSession(`phx:fallback:${l}`,"true"),this.log("transport",`established ${l} fallback`)}clearTimeout(this.fallbackTimer),this.fallbackTimer=setTimeout(o,e),this.ping(l=>{this.log("transport","connected to primary after",l),this.primaryPassedHealthCheck=!0,clearTimeout(this.fallbackTimer)})}),this.transportConnect()}clearHeartbeats(){clearTimeout(this.heartbeatTimer),clearTimeout(this.heartbeatTimeoutTimer)}onConnOpen(){this.hasLogger()&&this.log("transport",`connected to ${this.endPointURL()}`),this.closeWasClean=!1,this.disconnecting=!1,this.establishedConnections++,this.flushSendBuffer(),this.reconnectTimer.reset(),this.autoSendHeartbeat&&this.resetHeartbeat(),this.triggerStateCallbacks("open")}heartbeatTimeout(){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.hasLogger()&&this.log("transport","heartbeat timeout. Attempting to re-establish connection");try{this.heartbeatCallback("timeout")}catch(t){this.log("error","error in heartbeat callback",t)}this.triggerChanError(new Error("heartbeat timeout")),this.closeWasClean=!1,this.teardown(()=>this.reconnectTimer.scheduleTimeout(),SE,"heartbeat timeout")}}resetHeartbeat(){this.conn&&this.conn.skipHeartbeat||(this.pendingHeartbeatRef=null,this.clearHeartbeats(),this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}teardown(t,e,r){if(!this.conn)return t&&t();const n=this.conn;this.waitForBufferDone(n,()=>{e?n.close(e,r||""):n.close(),this.waitForSocketClosed(n,()=>{this.conn===n&&(this.conn.onopen=function(){},this.conn.onerror=function(){},this.conn.onmessage=function(){},this.conn.onclose=function(){},this.conn=null),t&&t()})})}waitForBufferDone(t,e,r=1){if(r===5||!t.bufferedAmount){e();return}setTimeout(()=>{this.waitForBufferDone(t,e,r+1)},150*r)}waitForSocketClosed(t,e,r=1){if(r===5||t.readyState===jr.closed){e();return}setTimeout(()=>{this.waitForSocketClosed(t,e,r+1)},150*r)}onConnClose(t){this.conn&&(this.conn.onclose=()=>{}),this.hasLogger()&&this.log("transport","close",t),this.triggerChanError(t),this.clearHeartbeats(),this.closeWasClean||this.reconnectTimer.scheduleTimeout(),this.triggerStateCallbacks("close",t)}onConnError(t){this.hasLogger()&&this.log("transport","error",t);let e=this.transport,r=this.establishedConnections;this.triggerStateCallbacks("error",t,e,r),(e===this.transport||r>0)&&this.triggerChanError(t)}
223triggerChanError(t){this.channels.forEach(e=>{e.isErrored()||e.isLeaving()||e.isClosed()||e.trigger(Gr.error,t)})}connectionState(){switch(this.conn&&this.conn.readyState){case jr.connecting:return"connecting";case jr.open:return"open";case jr.closing:return"closing";default:return"closed"}}isConnected(){return this.connectionState()==="open"}remove(t){this.off(t.stateChangeRefs),this.channels=this.channels.filter(e=>e!==t)}off(t){for(let e in this.stateChangeCallbacks)this.stateChangeCallbacks[e]=this.stateChangeCallbacks[e].filter(([r])=>t.indexOf(r)===-1)}channel(t,e={}){let r=new EE(t,e,this);return this.channels.push(r),r}push(t){if(this.hasLogger()){let{topic:e,event:r,payload:n,ref:s,join_ref:i}=t;this.log("push",`${e} ${r} (${i}, ${s})`,n)}this.isConnected()?this.encode(t,e=>this.conn.send(e)):this.sendBuffer.push(()=>this.encode(t,e=>this.conn.send(e)))}makeRef(){let t=this.ref+1;return t===this.ref?this.ref=0:this.ref=t,this.ref.toString()}sendHeartbeat(){if(!this.isConnected()){try{this.heartbeatCallback("disconnected")}catch(t){this.log("error","error in heartbeat callback",t)}return}if(this.pendingHeartbeatRef){this.heartbeatTimeout();return}this.pendingHeartbeatRef=this.makeRef(),this.heartbeatSentAt=Date.now(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef});try{this.heartbeatCallback("sent")}catch(t){this.log("error","error in heartbeat callback",t)}this.heartbeatTimeoutTimer=setTimeout(()=>this.heartbeatTimeout(),this.heartbeatIntervalMs)}flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(t=>t()),this.sendBuffer=[])}onConnMessage(t){this.decode(t.data,e=>{let{topic:r,event:n,payload:s,ref:i,join_ref:a}=e;if(i&&i===this.pendingHeartbeatRef){const o=this.heartbeatSentAt?Date.now()-this.heartbeatSentAt:void 0;this.clearHeartbeats();try{this.heartbeatCallback(s.status==="ok"?"ok":"error",o)}catch(l){this.log("error","error in heartbeat callback",l)}this.pendingHeartbeatRef=null,this.heartbeatSentAt=null,this.autoSendHeartbeat&&(this.heartbeatTimer=setTimeout(()=>this.sendHeartbeat(),this.heartbeatIntervalMs))}this.hasLogger()&&this.log("receive",`${s.status||""} ${r} ${n} ${i&&"("+i+")"||""}`.trim(),s);for(let o=0;o<this.channels.length;o++){const l=this.channels[o];l.isMember(r,n,s,a)&&l.trigger(n,s,i,a)}this.triggerStateCallbacks("message",e)})}triggerStateCallbacks(t,...e){try{this.stateChangeCallbacks[t].forEach(([r,n])=>{try{n(...e)}catch(s){this.log("error",`error in ${t} callback`,s)}})}catch(r){this.log("error",`error triggering ${t} callbacks`,r)}}leaveOpenTopic(t){let e=this.channels.find(r=>r.topic===t&&(r.isJoined()||r.isJoining()));e&&(this.hasLogger()&&this.log("transport",`leaving duplicate topic "${t}"`),e.leave())}};class ka{constructor(e,r){const n=RE(r);this.presence=new CE(e.getChannel(),n),this.presence.onJoin((s,i,a)=>{const o=ka.onJoinPayload(s,i,a);e.getChannel().trigger("presence",o)}),this.presence.onLeave((s,i,a)=>{const o=ka.onLeavePayload(s,i,a);e.getChannel().trigger("presence",o)}),this.presence.onSync(()=>{e.getChannel().trigger("presence",{event:"sync"})})}get state(){return ka.transformState(this.presence.state)}static transformState(e){return e=AE(e),Object.getOwnPropertyNames(e).reduce((r,n)=>{const s=e[n];return r[n]=ml(s),r},{})}static onJoinPayload(e,r,n){const s=tg(r),i=ml(n);return{event:"join",key:e,currentPresences:s,newPresences:i}}static onLeavePayload(e,r,n){const s=tg(r),i=ml(n);return{event:"leave",key:e,currentPresences:s,leftPresences:i}}}function ml(t){return t.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e))}function AE(t){return JSON.parse(JSON.stringify(t))}function RE(t){return(t==null?void 0:t.events)&&{events:t.events}}function tg(t){return t!=null&&t.metas?ml(t):[]}var rg;(function(t){t.SYNC="sync",t.JOIN="join",t.LEAVE="leave"})(rg||(rg={}));class OE{get state(){return this.presenceAdapter.state}constructor(e,r){this.channel=e,this.presenceAdapter=new ka(this.channel.channelAdapter,r)}}function IE(t){if(t instanceof Error)return t;if(typeof t=="string")return new Error(t);if(t&&typeof t=="object"){const e=t;
223if(typeof e.code=="number"){const r=typeof e.reason=="string"&&e.reason?` (${e.reason})`:"";return new Error(`socket closed: ${e.code}${r}`,{cause:t})}return new Error("channel error: transport failure",{cause:t})}return new Error("channel error: connection lost")}class NE{constructor(e,r,n){const s=LE(n);this.channel=e.getSocket().channel(r,s),this.socket=e}get state(){return this.channel.state}set state(e){this.channel.state=e}get joinedOnce(){return this.channel.joinedOnce}get joinPush(){return this.channel.joinPush}get rejoinTimer(){return this.channel.rejoinTimer}on(e,r){return this.channel.on(e,r)}off(e,r){this.channel.off(e,r)}subscribe(e){return this.channel.join(e)}unsubscribe(e){return this.channel.leave(e)}teardown(){this.channel.teardown()}onClose(e){this.channel.onClose(e)}onError(e){return this.channel.onError(e)}push(e,r,n){let s;try{s=this.channel.push(e,r,n)}catch{throw new Error(`tried to push '${e}' to '${this.channel.topic}' before joining. Use channel.subscribe() before pushing events`)}if(this.channel.pushBuffer.length>hE){const i=this.channel.pushBuffer.shift();i.cancelTimeout(),this.socket.log("channel",`discarded push due to buffer overflow: ${i.event}`,i.payload())}return s}updateJoinPayload(e){const r=this.channel.joinPush.payload();this.channel.joinPush.payload=()=>Object.assign(Object.assign({},r),e)}canPush(){return this.socket.isConnected()&&this.state===wn.joined}isJoined(){return this.state===wn.joined}isJoining(){return this.state===wn.joining}isClosed(){return this.state===wn.closed}isLeaving(){return this.state===wn.leaving}updateFilterBindings(e){this.channel.filterBindings=e}updatePayloadTransform(e){this.channel.onMessage=e}getChannel(){return this.channel}}function LE(t){return{config:Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},t.config)}}const jE=/[,()"\\]/,ME=t=>jE.test(t)||t!==t.trim(),DE=t=>`"${t.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`,ng=t=>{const e=t===null?"null":String(t);return ME(e)?DE(e):e},$E=t=>t===null?"null":String(t),zE=(t,e)=>{if(t==="in"){const r=Array.isArray(e)?e:[e];if(r.length===0)throw new Error("Realtime `in` filter requires at least one value.");return`in.(${Array.from(new Set(r)).map(s=>ng(s)).join(",")})`}return t==="is"?`is.${$E(e)}`:`${t}.${ng(e)}`};class UE{constructor(){this.filters=[]}add(e,r,n,s=!1){const i=s?"not.":"";return this.filters.push(`${e}=${i}${zE(r,n)}`),this}eq(e,r){return this.add(e,"eq",r)}neq(e,r){return this.add(e,"neq",r)}gt(e,r){return this.add(e,"gt",r)}gte(e,r){return this.add(e,"gte",r)}lt(e,r){return this.add(e,"lt",r)}lte(e,r){return this.add(e,"lte",r)}in(e,r){return this.add(e,"in",r)}like(e,r){return this.add(e,"like",r)}ilike(e,r){return this.add(e,"ilike",r)}match(e,r){return this.add(e,"match",r)}imatch(e,r){return this.add(e,"imatch",r)}is(e,r){return this.add(e,"is",r)}isDistinct(e,r){return this.add(e,"isdistinct",r)}not(e,r,n){return this.add(e,r,n,!0)}build(){return this.filters.join(",")}toString(){return this.build()}}var sg;(function(t){t.ALL="*",t.INSERT="INSERT",t.UPDATE="UPDATE",t.DELETE="DELETE"})(sg||(sg={}));var ai;(function(t){t.BROADCAST="broadcast",t.PRESENCE="presence",t.POSTGRES_CHANGES="postgres_changes",t.SYSTEM="system"})(ai||(ai={}));var qr;(function(t){t.SUBSCRIBED="SUBSCRIBED",t.TIMED_OUT="TIMED_OUT",t.CLOSED="CLOSED",t.CHANNEL_ERROR="CHANNEL_ERROR"})(qr||(qr={}));class Ea{get state(){return this.channelAdapter.state}set state(e){this.channelAdapter.state=e}get joinedOnce(){return this.channelAdapter.joinedOnce}get timeout(){return this.socket.timeout}get joinPush(){return this.channelAdapter.joinPush}get rejoinTimer(){return this.channelAdapter.rejoinTimer}constructor(e,r={config:{}},n){var s,i;if(this.topic=e,this.params=r,this.socket=n,this.bindings={},this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:"",enabled:!1},private:!1},r.config),this.channelAdapter=new NE(this.socket.socketAdapter,e,this.params),this.presence=new OE(this),this._onClose(()=>{this.socket._remove(this)}),this._updateFilterTransform(),this.broadcastEndpointURL=bw(this.socket.socketAdapter.endPointURL()),this.private=this.params.config.private||!1,!this.private&&(!((i=(s=this.params.config)===null||s===void 0?void 0:s.broadcast)===null||i===void 0)&&i.replay))throw new Error(`tried to use replay on public channel '${this.topic}'. It must be a private channel.`)}subscribe(e,r=this.timeout){var n,s,i;if(this.socket.isConnected()||this.socket.connect(),this.channelAdapter.isClosed()){const{config:{broadcast:a,presence:o,private:l}}=this.params,u=(s=(n=this.bindings.postgres_changes)===null||n===void 0?void 0:n.map(m=>m.filter))!==null&&s!==void 0?s:[],c=!!this.bindings[ai.PRESENCE]&&this.bindings[ai.PRESENCE].length>0||((i=this.params.config.presence)===null||i===void 0?void 0:i.enabled)===!0,d={},f={broadcast:a,presence:Object.assign(Object.assign({},o),{enabled:c}),postgres_changes:u,private:l};this.socket.accessTokenValue&&(d.access_token=this.socket.accessTokenValue),this._onError(m=>{e==null||e(qr.CHANNEL_ERROR,IE(m))}),this._onClose(()=>e==null?void 0:e(qr.CLOSED)),this.updateJoinPayload(Object.assign({config:f},d)),this._updateFilterMessage(),this.channelAdapter.subscribe(r).receive("ok",async({postgres_changes:m})=>
223{if(this.socket._isManualToken()||this.socket.setAuth(),m===void 0){e==null||e(qr.SUBSCRIBED);return}this._updatePostgresBindings(m,e)}).receive("error",m=>{this.state=wn.errored;const y=Object.values(m).join(", ")||"error";e==null||e(qr.CHANNEL_ERROR,new Error(y,{cause:m}))}).receive("timeout",()=>{e==null||e(qr.TIMED_OUT)})}return this}_updatePostgresBindings(e,r){var n;const s=this.bindings.postgres_changes,i=(n=s==null?void 0:s.length)!==null&&n!==void 0?n:0,a=[];for(let o=0;o<i;o++){const l=s[o],{filter:{event:u,schema:c,table:d,filter:f}}=l,m=e&&e[o];if(m&&m.event===u&&Ea.isFilterValueEqual(m.schema,c)&&Ea.isFilterValueEqual(m.table,d)&&Ea.isFilterValueEqual(m.filter,f))a.push(Object.assign(Object.assign({},l),{id:m.id}));else{this.unsubscribe(),this.state=wn.errored,r==null||r(qr.CHANNEL_ERROR,new Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=a,this.state!=wn.errored&&r&&r(qr.SUBSCRIBED)}presenceState(){return this.presence.state}async track(e,r={}){return await this.send({type:"presence",event:"track",payload:e},r.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,r,n){const s=this.channelAdapter.isJoined()||this.channelAdapter.isJoining(),i=e===ai.PRESENCE||e===ai.POSTGRES_CHANGES;if(s&&i)throw this.socket.log("channel",`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`),new Error(`cannot add \`${e}\` callbacks for ${this.topic} after \`subscribe()\`.`);return this._on(e,r,n)}async httpSend(e,r,n={}){var s;if(r==null)return Promise.reject(new Error("Payload is required for httpSend()"));const i=r instanceof ArrayBuffer||ArrayBuffer.isView(r),a={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":i?"application/octet-stream":"application/json"};this.socket.accessTokenValue&&(a.Authorization=`Bearer ${this.socket.accessTokenValue}`);const o=new URL(this.broadcastEndpointURL);o.pathname+=`/${encodeURIComponent(this.subTopic)}/events/${encodeURIComponent(e)}`,this.private&&o.searchParams.set("private","true");const l={method:"POST",headers:a,body:i?r:JSON.stringify(r)},u=await this._fetchWithTimeout(o.toString(),l,(s=n.timeout)!==null&&s!==void 0?s:this.timeout);if(u.status===202)return{success:!0};if(u.status===404)return Promise.reject(new Error("httpSend() requires Realtime server v2.97.0 or newer; the endpoint returned 404. Update your Supabase CLI to a recent version, or upgrade the Realtime server in your self-hosted setup. See https://github.com/supabase/supabase-js/blob/master/packages/core/realtime-js/migrations/httpsend-server-version.md"));let c=u.statusText;try{const d=await u.json();c=d.error||d.message||c}catch{}return Promise.reject(new Error(c))}async send(e,r={}){var n,s;if(!this.channelAdapter.canPush()&&e.type==="broadcast"){console.warn("Realtime send() is automatically falling back to REST API. This behavior will be deprecated 
223in the future. Please use httpSend() explicitly for REST delivery.");const{event:i,payload:a}=e,o={apikey:this.socket.apiKey?this.socket.apiKey:"","Content-Type":"application/json"};this.socket.accessTokenValue&&(o.Authorization=`Bearer ${this.socket.accessTokenValue}`);const l={method:"POST",headers:o,body:JSON.stringify({messages:[{topic:this.subTopic,event:i,payload:a,private:this.private}]})};try{const u=await this._fetchWithTimeout(this.broadcastEndpointURL,l,(n=r.timeout)!==null&&n!==void 0?n:this.timeout);return await((s=u.body)===null||s===void 0?void 0:s.cancel()),u.ok?"ok":"error"}catch(u){return u instanceof Error&&u.name==="AbortError"?"timed out":"error"}}else return new Promise(i=>{var a,o,l;const u=this.channelAdapter.push(e.type,e,r.timeout||this.timeout);e.type==="broadcast"&&!(!((l=(o=(a=this.params)===null||a===void 0?void 0:a.config)===null||o===void 0?void 0:o.broadcast)===null||l===void 0)&&l.ack)&&i("ok"),u.receive("ok",()=>i("ok")),u.receive("error",()=>i("error")),u.receive("timeout",()=>i("timed out"))})}updateJoinPayload(e){this.channelAdapter.updateJoinPayload(e)}async unsubscribe(e=this.timeout){return new Promise(r=>{this.channelAdapter.unsubscribe(e).receive("ok",()=>r("ok")).receive("timeout",()=>r("timed out")).receive("error",()=>r("error"))})}teardown(){this.channelAdapter.teardown()}async _fetchWithTimeout(e,r,n){const s=new AbortController,i=setTimeout(()=>s.abort(),n),a=await this.socket.fetch(e,Object.assign(Object.assign({},r),{signal:s.signal}));return clearTimeout(i),a}_on(e,r,n){const s=e.toLocaleLowerCase(),i=r==null?void 0:r.filter;(i instanceof UE||typeof i=="object"&&i!==null&&typeof i.build=="function")&&(r=Object.assign(Object.assign({},r),{filter:i.build()}));const a=this.channelAdapter.on(e,n),o={type:s,filter:r,callback:n,ref:a};return this.bindings[s]?this.bindings[s].push(o):this.bindings[s]=[o],this._updateFilterMessage(),this}_onClose(e){this.channelAdapter.onClose(e)}_onError(e){this.channelAdapter.onError(e)}_updateFilterMessage(){this.channelAdapter.updateFilterBindings((e,r,n)=>{var s,i,a,o,l,u,c;const d=e.event.toLocaleLowerCase();if(this._notThisChannelEvent(d,n))return!1;const f=(s=this.bindings[d])===null||s===void 0?void 0:s.find(m=>m.ref===e.ref);if(!f)return!0;if(["broadcast","presence","postgres_changes"].includes(d))if("id"in f){const m=f.id,y=(i=f.filter)===null||i===void 0?void 0:i.event;return m&&((a=r.ids)===null||a===void 0?void 0:a.includes(m))&&(y==="*"||(y==null?void 0:y.toLocaleLowerCase())===((o=r.data)===null||o===void 0?void 0:o.type.toLocaleLowerCase()))}else{const m=(u=(l=f==null?void 0:f.filter)===null||l===void 0?void 0:l.event)===null||u===void 0?void 0:u.toLocaleLowerCase();return m==="*"||m===((c=r==null?void 0:r.event)===null||c===void 0?void 0:c.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===d})}_notThisChannelEvent(e,r){const{close:n,error:s,leave:i,join:a}=_w;return r&&[n,s,i,a].includes(e)&&r!==this.joinPush.ref}_updateFilterTransform(){this.channelAdapter.updatePayloadTransform((e,r,n)=>{if(typeof r=="object"&&"ids"in r){const s=r.data,{schema:i,table:a,commit_timestamp:o,type:l,errors:u}=s;return Object.assign(Object.assign({},{schema:i,table:a,commit_timestamp:o,eventType:l,new:{},old:{},errors:u}),this._getPayloadRecords(s))}return r})}copyBindings(e){if(this.joinedOnce)throw new Error("cannot copy bindings into joined channel");for(const r in e.bindings)for(const n of e.bindings[r])this._on(n.type,n.filter,n.callback)}static isFilterValueEqual(e,r){return(e??void 0)===(r??void 0)}_getPayloadRecords(e){const r={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(r.new=eg(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(r.old=eg(e.columns,e.old_record)),r}}class BE{constructor(e,r){this.socket=new PE(e,r)}get timeout(){return this.socket.timeout}get endPoint(){return this.socket.endPoint}get transport(){return this.socket.transport}get heartbeatIntervalMs(){return this.socket.heartbeatIntervalMs}get heartbeatCallback(){return this.socket.heartbeatCallback}set heartbeatCallback(e){this.socket.heartbeatCallback=e}get heartbeatTimer(){return this.socket.heartbeatTimer}get pendingHeartbeatRef(){return this.socket.pendingHeartbeatRef}get reconnectTimer(){return this.socket.reconnectTimer}get vsn(){return this.socket.vsn}get encode(){return this.socket.encode}get decode(){return this.socket.decode}get reconnectAfterMs(){return this.socket.reconnectAfterMs}get sendBuffer(){return this.socket.sendBuffer}get stateChangeCallbacks(){return this.socket.stateChangeCallbacks}connect(){this.socket.connect()}disconnect(e,r,n,s=1e4){return new Promise(i=>{setTimeout(()=>i("timeout"),s),this.socket.disconnect(()=>{e(),i("ok")},r,n)})}push(e){this.socket.push(e)}log(e,r,n){this.socket.log(e,r,n)}makeRef(){return this.socket.makeRef()}onOpen(e){this.socket.onOpen(e)}onClose(e){this.socket.onClose(e)}onError(e){this.socket.onError(e)}onMessage(e){this.socket.onMessage(e)}isConnected(){return this.socket.isConnected()}isConnecting(){return this.socket.connectionState()==Qd.connecting}isDisconnecting(){return this.socket.connectionState()==Qd.closing}connectionState(){return this.socket.connectionState()}endPointURL(){return this.socket.endPointURL()}sendHeartbeat(){this.socket.sendHeartbeat()}getSocket(){return this.socket}}const ig={HEARTBEAT_INTERVAL:25e3},FE=[1e3,2e3,5e3,1e4],VE=1e4;function WE(){const t=new Map;return{get length(){return t.size},clear(){t.clear()},getItem(e){return t.has(e)?t.get(e):null},key(e){var r;return(r=Array.from(t.keys())[e])!==null&&r!==void 0?r:null},removeItem(e){t.delete(e)},setItem(e,r){t.set(e,String(r))}}}function HE(){try{if(typeof globalThis<"u"&&globalThis.sessionStorage)return globalThis.sessionStorage}catch{}return WE()}const GE=`
224  addEventListener("message", (e) => {
225    if (e.data.event === "start") {
226      setInterval(() => postMessage({ event: "keepAlive" }), e.data.interval);
227    }
228  });`;class qE{get endPoint(){return this.socketAdapter.endPoint}get timeout(){return this.socketAdapter.timeout}get transport(){return this.socketAdapter.transport}get heartbeatCallback(){return this.socketAdapter.heartbeatCallback}get heartbeatIntervalMs(){return this.socketAdapter.heartbeatIntervalMs}get heartbeatTimer(){return this.worker?this._workerHeartbeatTimer:this.socketAdapter.heartbeatTimer}get pendingHeartbeatRef(){return this.worker?this._pendingWorkerHeartbeatRef:this.socketAdapter.pendingHeartbeatRef}get reconnectTimer(){return this.socketAdapter.reconnectTimer}get vsn(){return this.socketAdapter.vsn}get encode(){return this.socketAdapter.encode}get decode(){return this.socketAdapter.decode}get reconnectAfterMs(){return this.socketAdapter.reconnectAfterMs}get sendBuffer(){return this.socketAdapter.sendBuffer}get stateChangeCallbacks(){return this.socketAdapter.stateChangeCallbacks}constructor(e,r){var n;if(this.channels=new Array,this.accessTokenValue=null,this.accessToken=null,this.apiKey=null,this.httpEndpoint="",this.headers={},this.params={}
228,this.ref=0,this.serializer=new fE,this._manuallySetToken=!1,this._authPromise=null,this._workerHeartbeatTimer=void 0,this._pendingWorkerHeartbeatRef=null,this._pendingDisconnectTimer=null,this._disconnectOnEmptyChannelsAfterMs=0,this._resolveFetch=i=>i?(...a)=>i(...a):(...a)=>fetch(...a),!(!((n=r==null?void 0:r.params)===null||n===void 0)&&n.apikey))throw new Error("API key is required to connect to Realtime");this.apiKey=r.params.apikey;const s=this._initializeOptions(r);this.socketAdapter=new BE(e,s),this.httpEndpoint=bw(e),this.fetch=this._resolveFetch(r==null?void 0:r.fetch)}connect(){if(!(this.isConnecting()||this.isDisconnecting()||this.isConnected())){this.accessToken&&!this._authPromise&&this._setAuthSafely("connect"),this._setupConnectionHandlers();try{this.socketAdapter.connect()}catch(e){const r=e.message;throw new Error(`WebSocket not available: ${r}`)}this._handleNodeJsRaceCondition()}}endpointURL(){return this.socketAdapter.endPointURL()}async disconnect(e,r){return this._cancelPendingDisconnect(),this.isDisconnecting()?"ok":await this.socketAdapter.disconnect(()=>{clearInterval(this._workerHeartbeatTimer),this._terminateWorker()},e,r)}getChannels(){return this.channels}async removeChannel(e){const r=await e.unsubscribe();return r==="ok"&&e.teardown(),r}async removeAllChannels(){const e=this.channels.map(async n=>{const s=await n.unsubscribe();return n.teardown(),s}),r=await Promise.all(e);return await this.disconnect(),r}log(e,r,n){this.socketAdapter.log(e,r,n)}connectionState(){return this.socketAdapter.connectionState()||Qd.closed}isConnected(){return this.socketAdapter.isConnected()}isConnecting(){return this.socketAdapter.isConnecting()}isDisconnecting(){return this.socketAdapter.isDisconnecting()}channel(e,r={config:{}}){const n=`realtime:${e}`,s=this.getChannels().find(i=>i.topic===n);if(s)return s;{const i=new Ea(`realtime:${e}`,r,this);return this._cancelPendingDisconnect(),this.channels.push(i),i}}push(e){this.socketAdapter.push(e)}async setAuth(e=null){this._authPromise=this._performAuth(e);try{await this._authPromise}finally{this._authPromise=null}}_isManualToken(){return this._manuallySetToken}async sendHeartbeat(){this.socketAdapter.sendHeartbeat()}onHeartbeat(e){this.socketAdapter.heartbeatCallback=this._wrapHeartbeatCallback(e)}_makeRef(){return this.socketAdapter.makeRef()}_remove(e){this.channels=this.channels.filter(r=>r.topic!==e.topic),this.channels.length===0&&(this.log("transport","no channels remaining, scheduling disconnect"),this._schedulePendingDisconnect())}_schedulePendingDisconnect(){if(this._cancelPendingDisconnect(),this._disconnectOnEmptyChannelsAfterMs===0){this.log("transport","disconnecting immediately - no channels"),this.disconnect();return}
228this._pendingDisconnectTimer=setTimeout(()=>{this._pendingDisconnectTimer=null,this.channels.length===0&&(this.log("transport","deferred disconnect fired - no channels, disconnecting"),this.disconnect())},this._disconnectOnEmptyChannelsAfterMs),this.log("transport",`deferred disconnect scheduled in ${this._disconnectOnEmptyChannelsAfterMs}ms`)}_cancelPendingDisconnect(){this._pendingDisconnectTimer!==null&&(this.log("transport","pending disconnect cancelled - channel activity detected"),clearTimeout(this._pendingDisconnectTimer),this._pendingDisconnectTimer=null)}async _performAuth(e=null){let r,n=!1;if(e)r=e,n=!0;else if(this.accessToken)try{r=await this.accessToken()}catch(s){this.log("error","Error fetching access token from callback",s),r=this.accessTokenValue}else r=this.accessTokenValue;n?this._manuallySetToken=!0:this.accessToken&&(this._manuallySetToken=!1),this.accessTokenValue!=r&&(this.accessTokenValue=r,this.channels.forEach(s=>{const i={access_token:r,version:lE};r&&s.updateJoinPayload(i),s.joinedOnce&&s.channelAdapter.isJoined()&&s.channelAdapter.push(_w.access_token,{access_token:r})}))}async _waitForAuthIfNeeded(){this._authPromise&&await this._authPromise}_setAuthSafely(e="general"){this._isManualToken()||this.setAuth().catch(r=>{this.log("error",`Error setting auth in ${e}`,r)})}_setupConnectionHandlers(){this.socketAdapter.onOpen(()=>{(this._authPromise||(this.accessToken&&!this.accessTokenValue?this.setAuth():Promise.resolve())).catch(r=>{this.log("error","error waiting for auth on connect",r)}),this.worker&&!this.workerRef&&this._startWorkerHeartbeat()}),this.socketAdapter.onClose(()=>{this.worker&&this.workerRef&&this._terminateWorker()}),this.socketAdapter.onMessage(e=>{e.ref&&e.ref===this._pendingWorkerHeartbeatRef&&(this._pendingWorkerHeartbeatRef=null)})}_handleNodeJsRaceCondition(){this.socketAdapter.isConnected()&&this.socketAdapter.getSocket().onConnOpen()}_wrapHeartbeatCallback(e){return(r,n)=>{r=="sent"&&this._setAuthSafely(),e&&e(r,n)}}_startWorkerHeartbeat(){this.workerUrl?this.log("worker",`starting worker for from ${this.workerUrl}`):this.log("worker","starting default worker");const e=this._workerObjectUrl(this.workerUrl);this.workerRef=new Worker(e),this.workerRef.onerror=r=>{this.log("worker","worker error",r.message),this._terminateWorker(),this.disconnect()},this.workerRef.onmessage=r=>{r.data.event==="keepAlive"&&this.sendHeartbeat()},this.workerRef.postMessage({event:"start",interval:this.heartbeatIntervalMs})}_terminateWorker(){this.workerRef&&(this.log("worker","terminating worker"),this.workerRef.terminate(),this.workerRef=void 0)}_workerObjectUrl(e){let r;if(e)r=e;else{const n=new Blob([GE],{type:"application/javascript"});r=URL.createObjectURL(n)}return r}_initializeOptions(e){var r,n,s,i,a,o,l,u,c,d,f,m;this.worker=(r=e==null?void 0:e.worker)!==null&&r!==void 0?r:!1,this.accessToken=(n=e==null?void 0:e.accessToken)!==null&&n!==void 0?n:null;const y={};y.timeout=(s=e==null?void 0:e.timeout)!==null&&s!==void 0?s:dE,y.heartbeatIntervalMs=(i=e==null?void 0:e.heartbeatIntervalMs)!==null&&i!==void 0?i:ig.HEARTBEAT_INTERVAL,this._disconnectOnEmptyChannelsAfterMs=(a=e==null?void 0:e.disconnectOnEmptyChannelsAfterMs)!==null&&a!==void 0?a:2*((o=e==null?void 0:e.heartbeatIntervalMs)!==null&&o!==void 0?o:ig.HEARTBEAT_INTERVAL),y.transport=(l=e==null?void 0:e.transport)!==null&&l!==void 0?l:aE.getWebSocketConstructor(),y.params=e==null?void 0:e.params,y.logger=e==null?void 0:e.logger,y.heartbeatCallback=this._wrapHeartbeatCallback(e==null?void 0:e.heartbeatCallback),y.sessionStorage=(u=e==null?void 0:e.sessionStorage)!==null&&u!==void 0?u:HE(),y.reconnectAfterMs=(c=e==null?void 0:e.reconnectAfterMs)!==null&&c!==void 0?c:v=>FE[v-1]||VE;let g,b;const _=(d=e==null?void 0:e.vsn)!==null&&d!==void 0?d:cE;switch(_){case uE:g=(v,w)=>w(JSON.stringify(v)),b=(v,w)=>w(JSON.parse(v));break;case ww:g=this.serializer.encode.bind(this.serializer),b=this.serializer.decode.bind(this.serializer);break;default:throw new Error(`Unsupported serializer version: ${y.vsn}`)}if(y.vsn=_,y.encode=(f=e==null?void 0:e.encode)!==null&&f!==void 0?f:g,y.decode=(m=e==null?void 0:e.decode)!==null&&m!==void 0?m:b,y.beforeReconnect=this._reconnectAuth.bind(this),(e!=null&&e.logLevel||e!=null&&e.log_level)&&(this.logLevel=e.logLevel||e.log_level,y.params=Object.assign(Object.assign({},y.params),{log_level:this.logLevel})),this.worker){if(typeof window<"u"&&!window.Worker)throw new Error("Web Worker is not supported");this.workerUrl=e==null?void 0:e.workerUrl,y.autoSendHeartbeat=!this.worker}return y}async _reconnectAuth(){await this._waitForAuthIfNeeded(),this.isConnected()||this.connect()}}
228var Qa=class extends Error{constructor(t,e){var r;super(t),this.name="IcebergError",this.status=e.status,this.icebergType=e.icebergType,this.icebergCode=e.icebergCode,this.details=e.details,this.isCommitStateUnknown=e.icebergType==="CommitStateUnknownException"||[500,502,504].includes(e.status)&&((r=e.icebergType)==null?void 0:r.includes("CommitState"))===!0}isNotFound(){return this.status===404}isConflict(){return this.status===409}isAuthenticationTimeout(){return this.status===419}};function KE(t,e,r){const n=new URL(e,t);if(r)for(const[s,i]of Object.entries(r))i!==void 0&&n.searchParams.set(s,i);return n.toString()}async function JE(t){return!t||t.type==="none"?{}:t.type==="bearer"?{Authorization:`Bearer ${t.token}`}:t.type==="header"?{[t.name]:t.value}:t.type==="custom"?await t.getHeaders():{}}function ZE(t){const e=t.fetchImpl??globalThis.fetch;return{async request({method:r,path:n,query:s,body:i,headers:a}){const o=KE(t.baseUrl,n,s),l=await JE(t.auth),u=await e(o,{method:r,headers:{...i?{"Content-Type":"application/json"}:{},...l,...a},body:i?JSON.stringify(i):void 0}),c=await u.text(),d=(u.headers.get("content-type")||"").includes("application/json"),f=d&&c?JSON.parse(c):c;if(!u.ok){const m=d?f:void 0,y=m==null?void 0:m.error;throw new Qa((y==null?void 0:y.message)??`Request failed with status ${u.status}`,{status:u.status,icebergType:y==null?void 0:y.type,icebergCode:y==null?void 0:y.code,details:m})}return{status:u.status,headers:u.headers,data:f}}}}function Zo(t){return t.join("�")}var YE=class{constructor(t,e=""){this.client=t,this.prefix=e}async listNamespaces(t){const e=t?{parent:Zo(t.namespace)}:void 0;return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces`,query:e})).data.namespaces.map(n=>({namespace:n}))}async createNamespace(t,e){const r={namespace:t.namespace,properties:e==null?void 0:e.properties};return(await this.client.request({method:"POST",path:`${this.prefix}/namespaces`,body:r})).data}async dropNamespace(t){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${Zo(t.namespace)}`})}async loadNamespaceMetadata(t){return{properties:(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${Zo(t.namespace)}`})).data.properties}}async namespaceExists(t){try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${Zo(t.namespace)}`}),!0}catch(e){if(e instanceof Qa&&e.status===404)return!1;throw e}}async createNamespaceIfNotExists(t,e){try{return await this.createNamespace(t,e)}catch(r){if(r instanceof Qa&&r.status===409)return;throw r}}};function $s(t){return t.join("�")}var XE=class{constructor(t,e="",r){this.client=t,this.prefix=e,this.accessDelegation=r}async listTables(t){return(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables`})).data.identifiers}async createTable(t,e){const r={};return this.accessDelegation&&(r["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables`,body:e,headers:r})).data.metadata}async updateTable(t,e){const r=await this.client.request({method:"POST",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables/${t.name}`,body:e});return{"metadata-location":r.data["metadata-location"],metadata:r.data.metadata}}async dropTable(t,e){await this.client.request({method:"DELETE",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables/${t.name}`,query:{purgeRequested:String((e==null?void 0:e.purge)??!1)}})}async loadTable(t){const e={};return this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation),(await this.client.request({method:"GET",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables/${t.name}`,headers:e})).data.metadata}async tableExists(t){const e={};this.accessDelegation&&(e["X-Iceberg-Access-Delegation"]=this.accessDelegation);try{return await this.client.request({method:"HEAD",path:`${this.prefix}/namespaces/${$s(t.namespace)}/tables/${t.name}`,headers:e}),!0}catch(r){if(r instanceof Qa&&r.status===404)return!1;throw r}}async createTableIfNotExists(t,e){try{return await this.createTable(t,e)}catch(r){if(r instanceof Qa&&r.status===409)return await this.loadTable({namespace:t.namespace,name:e.name});throw r}}},QE=class{constructor(t){var n;let e="v1";t.catalogName&&(e+=`/${t.catalogName}`);const r=t.baseUrl.endsWith("/")?t.baseUrl:`${t.baseUrl}/`;this.client=ZE({baseUrl:r,auth:t.auth,fetchImpl:t.fetch}),this.accessDelegation=(n=t.accessDelegation)==null?void 0:n.join(","),this.namespaceOps=new YE(this.client,e),this.tableOps=new XE(this.client,e,this.accessDelegation)}async listNamespaces(t){return this.namespaceOps.listNamespaces(t)}async createNamespace(t,e){return this.namespaceOps.createNamespace(t,e)}async dropNamespace(t){await this.namespaceOps.dropNamespace(t)}async loadNamespaceMetadata(t){return this.namespaceOps.loadNamespaceMetadata(t)}async listTables(t){return this.tableOps.listTables(t)}
228async createTable(t,e){return this.tableOps.createTable(t,e)}async updateTable(t,e){return this.tableOps.updateTable(t,e)}async dropTable(t,e){await this.tableOps.dropTable(t,e)}async loadTable(t){return this.tableOps.loadTable(t)}async namespaceExists(t){return this.namespaceOps.namespaceExists(t)}async tableExists(t){return this.tableOps.tableExists(t)}async createNamespaceIfNotExists(t,e){return this.namespaceOps.createNamespaceIfNotExists(t,e)}async createTableIfNotExists(t,e){return this.tableOps.createTableIfNotExists(t,e)}};function eo(t){"@babel/helpers - typeof";return eo=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},eo(t)}function e2(t,e){if(eo(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(eo(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function t2(t){var e=e2(t,"string");return eo(e)=="symbol"?e:e+""}function r2(t,e,r){return(e=t2(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function ag(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 ie(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ag(Object(r),!0).forEach(function(n){r2(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ag(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}var Fu=class extends Error{constructor(t,e="storage",r,n){super(t),this.__isStorageError=!0,this.namespace=e,this.name=e==="vectors"?"StorageVectorsError":"StorageError",this.status=r,this.statusCode=n}toJSON(){return{name:this.name,message:this.message,status:this.status,statusCode:this.statusCode}}};function Vu(t){return typeof t=="object"&&t!==null&&"__isStorageError"in t}var nh=class extends Fu{constructor(t,e,r,n="storage"){super(t,n,e,r),this.name=n==="vectors"?"StorageVectorsApiError":"StorageApiError",this.status=e,this.statusCode=r}toJSON(){return ie({},super.toJSON())}},kw=class extends Fu{constructor(t,e,r="storage"){super(t,r),this.name=r==="vectors"?"StorageVectorsUnknownError":"StorageUnknownError",this.originalError=e}};function Zl(t,e,r){const n=ie({},t),s=e.toLowerCase();for(const i of Object.keys(n))i.toLowerCase()===s&&delete n[i];return n[s]=r,n}function n2(t){const e={};for(const[r,n]of Object.entries(t))e[r.toLowerCase()]=n;return e}const s2=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),i2=t=>{if(typeof t!="object"||t===null)return!1;const e=Object.getPrototypeOf(t);return(e===null||e===Object.prototype||Object.getPrototypeOf(e)===null)&&!(Symbol.toStringTag in t)&&!(Symbol.iterator in t)},sh=t=>{if(Array.isArray(t))return t.map(r=>sh(r));if(typeof t=="function"||t!==Object(t))return t;const e={};return Object.entries(t).forEach(([r,n])=>{const s=r.replace(/([-_][a-z])/gi,i=>i.toUpperCase().replace(/[-_]/g,""));e[s]=sh(n)}),e},a2=t=>!t||typeof t!="string"||t.length===0||t.length>100||t.trim()!==t||t.includes("/")||t.includes("\\")?!1:/^[\w!.\*'() &$@=;:+,?-]+$/.test(t),og=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error;if(typeof e.error=="object"&&e.error!==null){const r=e.error;if(typeof r.message=="string")return r.message}}return JSON.stringify(t)},o2=async(t,e,r,n)=>{if(t!==null&&typeof t=="object"&&"json"in t&&typeof t.json=="function"){const s=t;let i=parseInt(String(s.status),10);Number.isFinite(i)||(i=500),s.json().then(a=>{const o=(a==null?void 0:a.statusCode)||(a==null?void 0:a.code)||i+"";e(new nh(og(a),i,o,n))}).catch(()=>{const a=i+"";e(new nh(s.statusText||`HTTP ${i} error`,i,a,n))})}else e(new kw(og(t),t,n))},l2=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};if(t==="GET"||t==="HEAD"||!n)return ie(ie({},s),r);if(i2(n)){var i;const a=(e==null?void 0:e.headers)||{};let o;for(const[l,u]of Object.entries(a))l.toLowerCase()==="content-type"&&(o=u);s.headers=Zl(a,"Content-Type",(i=o)!==null&&i!==void 0?i:"application/json"),s.body=JSON.stringify(n)}else s.body=n;return e!=null&&e.duplex&&(s.duplex=e.duplex),ie(ie({},s),r)};async function Qi(t,e,r,n,s,i,a){return new Promise((o,l)=>{t(r,l2(e,n,s,i)).then(u=>{if(!u.ok)throw u;if(n!=null&&n.noResolveJson)return u;if(a==="vectors"){const c=u.headers.get("content-type");if(u.headers.get("content-length")==="0"||u.status===204)return{};if(!c||!c.includes("application/json"))return{}}return u.json()}).then(u=>o(u)).catch(u=>o2(u,l,n,a))})}function Ew(t="storage"){return{get:async(e,r,n,s)=>Qi(e,"GET",r,n,s,void 0,t),post:async(e,r,n,s,i)=>Qi(e,"POST",r,s,i,n,t),put:async(e,r,n,s,i)=>Qi(e,"PUT",r,s,i,n,t),head:async(e,r,n,s)=>Qi(e,"HEAD",r,ie(ie({},n),{},{noResolveJson:!0}),s,void 0,t),remove:async(e,r,n,s,i)=>Qi(e,"DELETE",r,s,i,n,t)}}const u2=Ew("storage"),{get:to,post:Sr,put:ih,head:c2,remove:ro}=u2,Ht=Ew("vectors");var Vi=class{constructor(t,e={},r,n="storage"){this.shouldThrowOnError=!1,this.url=t,this.headers=n2(e),this.fetch=s2(r),this.namespace=n}throwOnError(){return this.shouldThrowOnError=!0,this}setHeader(t,e){return this.headers=Zl(this.headers,t,e),this}async handleOperation(t){var e=this;try{return{data:await t(),error:null}}catch(r){if(e.shouldThrowOnError)throw r;if(Vu(r))return{data:null,error:r};throw r}}};let Tw;Tw=Symbol.toStringTag;var d2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Tw]="StreamDownloadBuilder",this.promise=null}
228then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:(await t.downloadFn()).body,error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Vu(e))return{data:null,error:e};throw e}}};let Cw;Cw=Symbol.toStringTag;var h2=class{constructor(t,e){this.downloadFn=t,this.shouldThrowOnError=e,this[Cw]="BlobDownloadBuilder",this.promise=null}asStream(){return new d2(this.downloadFn,this.shouldThrowOnError)}then(t,e){return this.getPromise().then(t,e)}catch(t){return this.getPromise().catch(t)}finally(t){return this.getPromise().finally(t)}getPromise(){return this.promise||(this.promise=this.execute()),this.promise}async execute(){var t=this;try{return{data:await(await t.downloadFn()).blob(),error:null}}catch(e){if(t.shouldThrowOnError)throw e;if(Vu(e))return{data:null,error:e};throw e}}};const Oc={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},lg={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};var f2=class extends Vi{constructor(t,e={},r,n){super(t,e,n,"storage"),this.bucketId=r}async uploadOrUpdate(t,e,r,n){var s=this;return s.handleOperation(async()=>{let i;const a=ie(ie({},lg),n);let o=ie(ie({},s.headers),t==="POST"&&{"x-upsert":String(a.upsert)});const l=a.metadata;if(typeof Blob<"u"&&r instanceof Blob?(i=new FormData,i.append("cacheControl",a.cacheControl),l&&i.append("metadata",s.encodeMetadata(l)),i.append("",r)):typeof FormData<"u"&&r instanceof FormData?(i=r,i.has("cacheControl")||i.append("cacheControl",a.cacheControl),l&&!i.has("metadata")&&i.append("metadata",s.encodeMetadata(l))):(i=r,o["cache-control"]=`max-age=${a.cacheControl}`,o["content-type"]=a.contentType,l&&(o["x-metadata"]=s.toBase64(s.encodeMetadata(l))),(typeof ReadableStream<"u"&&i instanceof ReadableStream||i&&typeof i=="object"&&"pipe"in i&&typeof i.pipe=="function")&&!a.duplex&&(a.duplex="half")),n!=null&&n.headers)for(const[f,m]of Object.entries(n.headers))o=Zl(o,f,m);const u=s._removeEmptyFolders(e),c=s._getFinalPath(u),d=await(t=="PUT"?ih:Sr)(s.fetch,`${s.url}/object/${c}`,i,ie({headers:o},a!=null&&a.duplex?{duplex:a.duplex}:{}));return{path:u,id:d.Id,fullPath:d.Key}})}async upload(t,e,r){return this.uploadOrUpdate("POST",t,e,r)}async uploadToSignedUrl(t,e,r,n){var s=this;const i=s._removeEmptyFolders(t),a=s._getFinalPath(i),o=new URL(s.url+`/object/upload/sign/${a}`);return o.searchParams.set("token",e),s.handleOperation(async()=>{let l;const u=ie(ie({},lg),n);let c=ie(ie({},s.headers),{"x-upsert":String(u.upsert)});const d=u.metadata;if(typeof Blob<"u"&&r instanceof Blob?(l=new FormData,l.append("cacheControl",u.cacheControl),d&&l.append("metadata",s.encodeMetadata(d)),l.append("",r)):typeof FormData<"u"&&r instanceof FormData?(l=r,l.has("cacheControl")||l.append("cacheControl",u.cacheControl),d&&!l.has("metadata")&&l.append("metadata",s.encodeMetadata(d))):(l=r,c["cache-control"]=`max-age=${u.cacheControl}`,c["content-type"]=u.contentType,d&&(c["x-metadata"]=s.toBase64(s.encodeMetadata(d))),(typeof ReadableStream<"u"&&l instanceof ReadableStream||l&&typeof l=="object"&&"pipe"in l&&typeof l.pipe=="function")&&!u.duplex&&(u.duplex="half")),n!=null&&n.headers)for(const[f,m]of Object.entries(n.headers))c=Zl(c,f,m);return{path:i,fullPath:(await ih(s.fetch,o.toString(),l,ie({headers:c},u!=null&&u.duplex?{duplex:u.duplex}:{}))).Key}})}async createSignedUploadUrl(t,e){var r=this;return r.handleOperation(async()=>{let n=r._getFinalPath(t);const s=ie({},r.headers);e!=null&&e.upsert&&(s["x-upsert"]="true");const i=await Sr(r.fetch,`${r.url}/object/upload/sign/${n}`,{},{headers:s}),a=new URL(r.url+i.url),o=a.searchParams.get("token");if(!o)throw new Fu("No token returned by API");return{signedUrl:a.toString(),path:t,token:o}})}async update(t,e,r){return this.uploadOrUpdate("PUT",t,e,r)}async move(t,e,r){var n=this;return n.handleOperation(async()=>await Sr(n.fetch,`${n.url}/object/move`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers}))}async copy(t,e,r){var n=this;return n.handleOperation(async()=>({path:(await Sr(n.fetch,`${n.url}/object/copy`,{bucketId:n.bucketId,sourceKey:t,destinationKey:e,destinationBucket:r==null?void 0:r.destinationBucket},{headers:n.headers})).Key}))}async createSignedUrl(t,e,r){var n=this;return n.handleOperation(async()=>{let s=n._getFinalPath(t);const i=typeof(r==null?void 0:r.transform)=="object"&&r.transform!==null&&Object.keys(r.transform).length>0;let a=await Sr(n.fetch,`${n.url}/object/sign/${s}
228`,ie({expiresIn:e},i?{transform:r.transform}:{}),{headers:n.headers});const o=new URLSearchParams;r!=null&&r.download&&o.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&o.set("cacheNonce",String(r.cacheNonce));const l=o.toString();return{signedUrl:encodeURI(`${n.url}${a.signedURL}${l?`&${l}`:""}`)}})}async createSignedUrls(t,e,r){var n=this;return n.handleOperation(async()=>{const s=await Sr(n.fetch,`${n.url}/object/sign/${n.bucketId}`,{expiresIn:e,paths:t},{headers:n.headers}),i=new URLSearchParams;r!=null&&r.download&&i.set("download",r.download===!0?"":r.download),(r==null?void 0:r.cacheNonce)!=null&&i.set("cacheNonce",String(r.cacheNonce));const a=i.toString();return s.map(o=>ie(ie({},o),{},{signedUrl:o.signedURL?encodeURI(`${n.url}${o.signedURL}${a?`&${a}`:""}`):null}))})}download(t,e,r){const n=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image/authenticated":"object",s=new URLSearchParams;e!=null&&e.transform&&this.applyTransformOptsToQuery(s,e.transform),(e==null?void 0:e.cacheNonce)!=null&&s.set("cacheNonce",String(e.cacheNonce));const i=s.toString(),a=this._getFinalPath(t),o=()=>to(this.fetch,`${this.url}/${n}/${a}${i?`?${i}`:""}`,{headers:this.headers,noResolveJson:!0},r);return new h2(o,this.shouldThrowOnError)}async info(t){var e=this;const r=e._getFinalPath(t);return e.handleOperation(async()=>sh(await to(e.fetch,`${e.url}/object/info/${r}`,{headers:e.headers})))}async exists(t){var e=this;const r=e._getFinalPath(t);try{return await c2(e.fetch,`${e.url}/object/${r}`,{headers:e.headers}),{data:!0,error:null}}catch(s){if(e.shouldThrowOnError)throw s;if(Vu(s)){var n;const i=s instanceof nh?s.status:s instanceof kw?(n=s.originalError)===null||n===void 0?void 0:n.status:void 0;if(i!==void 0&&[400,404].includes(i))return{data:!1,error:s}}throw s}}getPublicUrl(t,e){const r=this._getFinalPath(t),n=new URLSearchParams;e!=null&&e.download&&n.set("download",e.download===!0?"":e.download),e!=null&&e.transform&&this.applyTransformOptsToQuery(n,e.transform),(e==null?void 0:e.cacheNonce)!=null&&n.set("cacheNonce",String(e.cacheNonce));const s=n.toString(),i=typeof(e==null?void 0:e.transform)=="object"&&e.transform!==null&&Object.keys(e.transform).length>0?"render/image":"object";return{data:{publicUrl:encodeURI(`${this.url}/${i}/public/${r}`)+(s?`?${s}`:"")}}}async remove(t){var e=this;return e.handleOperation(async()=>await ro(e.fetch,`${e.url}/object/${e.bucketId}`,{prefixes:t},{headers:e.headers}))}async purgeCache(t,e,r){var n=this;return n.handleOperation(async()=>{const s=n._getFinalPath(t),i=new URLSearchParams;e!=null&&e.transformations&&i.set("transformations","true");const a=i.toString();return await ro(n.fetch,`${n.url}/cdn/${s}${a?`?${a}`:""}`,{},{headers:n.headers},r)})}async list(t,e,r){var n=this;return n.handleOperation(async()=>{const s=e!=null&&e.sortBy?ie(ie({},Oc.sortBy),e.sortBy):Oc.sortBy,i=ie(ie(ie({},Oc),e),{},{sortBy:s,prefix:t||""});return await Sr(n.fetch,`${n.url}/object/list/${n.bucketId}`,i,{headers:n.headers},r)})}async listV2(t,e){var r=this;return r.handleOperation(async()=>{const n=ie({},t);return await Sr(r.fetch,`${r.url}/object/list-v2/${r.bucketId}`,n,{headers:r.headers},e)})}encodeMetadata(t){return JSON.stringify(t)}toBase64(t){return typeof Buffer<"u"?Buffer.from(t).toString("base64"):btoa(t)}_getFinalPath(t){return`${this.bucketId}/${t.replace(/^\/+/,"")}`}_removeEmptyFolders(t){return t.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}applyTransformOptsToQuery(t,e){return e.width&&t.set("width",e.width.toString()),e.height&&t.set("height",e.height.toString()),e.resize&&t.set("resize",e.resize),e.format&&t.set("format",e.format),e.quality&&t.set("quality",e.quality.toString()),t}};const p2="2.110.0",Eo={"X-Client-Info":`storage-js/${p2}`};var m2=class extends Vi{constructor(t,e={},r,n){const s=new URL(t);n!=null&&n.useNewHostname&&/supabase\.(co|in|red)$/.test(s.hostname)&&!s.hostname.includes("storage.supabase.")&&(s.hostname=s.hostname.replace("supabase.","storage.supabase."));const i=s.href.replace(/\/$/,""),a=ie(ie({},Eo),e);super(i,a,r,"storage")}async listBuckets(t){var e=this;return e.handleOperation(async()=>{const r=e.listBucketOptionsToQueryString(t);return await to(e.fetch,`${e.url}/bucket${r}`,{headers:e.headers})})}async getBucket(t){var e=this;return e.handleOperation(async()=>await to(e.fetch,`${e.url}/bucket/${t}`,{headers:e.headers}))}async createBucket(t,e={public:!1}){var r=this;return r.handleOperation(async()=>await Sr(r.fetch,`${r.url}/bucket`,{id:t,name:t,type:e.type,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async updateBucket(t,e){var r=this;return r.handleOperation(async()=>await ih(r.fetch,`${r.url}/bucket/${t}`,{id:t,name:t,public:e.public,file_size_limit:e.fileSizeLimit,allowed_mime_types:e.allowedMimeTypes},{headers:r.headers}))}async emptyBucket(t){var e=this;return e.handleOperation(async()=>await Sr(e.fetch,`${e.url}/bucket/${t}/empty`,{},{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await ro(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}async purgeBucketCache(t,e,r){var n=this;return n.handleOperation(async()=>{const s=new URLSearchParams;e!=null&&e.transformations&&s.set("transformations","true");const i=s.toString();return await ro(n.fetch,`${n.url}/cdn/${t}${i?`?${i}`:""}`,{},{headers:n.headers},r)})}listBucketOptionsToQueryString(t){const e={};return t&&("limit"in t&&(e.limit=String(t.limit)),"offset"in t&&(e.offset=String(t.offset)),t.search&&(e.search=t.search),t.sortColumn&&(e.sortColumn=t.sortColumn),t.sortOrder&&(e.sortOrder=t.sortOrder)),Object.keys(e).length>0?"?"+new URLSearchParams(e).toString():""}},g2=class extends Vi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ie(ie({},Eo),e);super(n,s,r,"storage")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Sr(e.fetch,`${e.url}/bucket`,{name:t},{headers:e.headers}))}async listBuckets(t){var e=this;return e.handleOperation(async()=>
228{const r=new URLSearchParams;(t==null?void 0:t.limit)!==void 0&&r.set("limit",t.limit.toString()),(t==null?void 0:t.offset)!==void 0&&r.set("offset",t.offset.toString()),t!=null&&t.sortColumn&&r.set("sortColumn",t.sortColumn),t!=null&&t.sortOrder&&r.set("sortOrder",t.sortOrder),t!=null&&t.search&&r.set("search",t.search);const n=r.toString(),s=n?`${e.url}/bucket?${n}`:`${e.url}/bucket`;return await to(e.fetch,s,{headers:e.headers})})}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await ro(e.fetch,`${e.url}/bucket/${t}`,{},{headers:e.headers}))}from(t){var e=this;if(!a2(t))throw new Fu("Invalid bucket name: File, folder, and bucket names must follow AWS object key naming guidelines and should avoid the use of any other characters.");const r=new QE({baseUrl:this.url,catalogName:t,auth:{type:"custom",getHeaders:async()=>e.headers},fetch:this.fetch}),n=this.shouldThrowOnError;return new Proxy(r,{get(s,i){const a=s[i];return typeof a!="function"?a:async(...o)=>{try{return{data:await a.apply(s,o),error:null}}catch(l){if(n)throw l;return{data:null,error:l}}}}})}},v2=class extends Vi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ie(ie({},Eo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createIndex(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/CreateIndex`,t,{headers:e.headers})||{})}async getIndex(t,e){var r=this;return r.handleOperation(async()=>await Ht.post(r.fetch,`${r.url}/GetIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers}))}async listIndexes(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/ListIndexes`,t,{headers:e.headers}))}async deleteIndex(t,e){var r=this;return r.handleOperation(async()=>await Ht.post(r.fetch,`${r.url}/DeleteIndex`,{vectorBucketName:t,indexName:e},{headers:r.headers})||{})}},y2=class extends Vi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ie(ie({},Eo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async putVectors(t){var e=this;if(t.vectors.length<1||t.vectors.length>500)throw new Error("Vector batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/PutVectors`,t,{headers:e.headers})||{})}async getVectors(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/GetVectors`,t,{headers:e.headers}))}async listVectors(t){var e=this;if(t.segmentCount!==void 0){if(t.segmentCount<1||t.segmentCount>16)throw new Error("segmentCount must be between 1 and 16");if(t.segmentIndex!==void 0&&(t.segmentIndex<0||t.segmentIndex>=t.segmentCount))throw new Error(`segmentIndex must be between 0 and ${t.segmentCount-1}`)}return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/ListVectors`,t,{headers:e.headers}))}async queryVectors(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/QueryVectors`,t,{headers:e.headers}))}async deleteVectors(t){var e=this;if(t.keys.length<1||t.keys.length>500)throw new Error("Keys batch size must be between 1 and 500 items");return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/DeleteVectors`,t,{headers:e.headers})||{})}},w2=class extends Vi{constructor(t,e={},r){const n=t.replace(/\/$/,""),s=ie(ie({},Eo),{},{"Content-Type":"application/json"},e);super(n,s,r,"vectors")}async createBucket(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/CreateVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}async getBucket(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/GetVectorBucket`,{vectorBucketName:t},{headers:e.headers}))}async listBuckets(t={}){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/ListVectorBuckets`,t,{headers:e.headers}))}async deleteBucket(t){var e=this;return e.handleOperation(async()=>await Ht.post(e.fetch,`${e.url}/DeleteVectorBucket`,{vectorBucketName:t},{headers:e.headers})||{})}},_2=class extends w2{constructor(t,e={}){super(t,e.headers||{},e.fetch)}from(t){return new x2(this.url,this.headers,t,this.fetch)}async createBucket(t){var e=()=>super.createBucket,r=this;return e().call(r,t)}async getBucket(t){var e=()=>super.getBucket,r=this;return e().call(r,t)}async listBuckets(t={}){var e=()=>super.listBuckets,r=this;return e().call(r,t)}async deleteBucket(t){var e=()=>super.deleteBucket,r=this;return e().call(r,t)}},x2=class extends v2{constructor(t,e,r,n){super(t,e,n),this.vectorBucketName=r}async createIndex(t){var e=()=>super.createIndex,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName}))}async listIndexes(t={}){var e=()=>super.listIndexes,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName}))}async getIndex(t){var e=()=>super.getIndex,r=this;return e().call(r,r.vectorBucketName,t)}async deleteIndex(t){var e=()=>super.deleteIndex,r=this;return e().call(r,r.vectorBucketName,t)}index(t){return new b2(this.url,this.headers,this.vectorBucketName,t,this.fetch)}},b2=class extends y2{constructor(t,e,r,n,s){super(t,e,s),this.vectorBucketName=r,this.indexName=n}async putVectors(t){var e=()=>super.putVectors,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async getVectors(t){var e=()=>super.getVectors,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async listVectors(t={}){var e=()=>super.listVectors,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async queryVectors(t){var e=()=>super.queryVectors,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}async deleteVectors(t){var e=()=>super.deleteVectors,r=this;return e().call(r,ie(ie({},t),{},{vectorBucketName:r.vectorBucketName,indexName:r.indexName}))}},S2=class extends m2{constructor(t,e={},r,n){super(t,e,r,n)}from(t){return new f2(this.url,this.headers,t,this.fetch)}get vectors(){return new _2(this.url+"/vector",{headers:this.headers,fetch:this.fetch})}get analytics(){return new g2(this.url+"/iceberg",this.headers,this.fetch)}};const Pw="2.110.0",Kr=30*1e3,ua=3,Ic=ua*Kr,k2=2*Kr,E2="http://localhost:9999",T2="supabase.auth.token",C2={"X-Client-Info":`gotrue-js/${Pw}`},ah="X-Supabase-Api-Version",Aw={"2024-01-01":{timestamp:Date.parse("2024-01-01T00:00:00.0Z"),name:"2024-01-01"}},P2=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}$|[a-z0-9_-]{2}$)$/i,A2=10*60*1e3;
228class no extends Error{constructor(e,r,n){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=r,this.code=n}toJSON(){return{name:this.name,message:this.message,status:this.status,code:this.code}}}function J(t){return typeof t=="object"&&t!==null&&"__isAuthError"in t}class R2 extends no{constructor(e,r,n){super(e,r,n),this.name="AuthApiError",this.status=r,this.code=n}}function O2(t){return J(t)&&t.name==="AuthApiError"}class Tr extends no{constructor(e,r){super(e),this.name="AuthUnknownError",this.originalError=r}}class Vr extends no{constructor(e,r,n,s){super(e,n,s),this.name=r,this.status=n}}class st extends Vr{constructor(){super("Auth session missing!","AuthSessionMissingError",400,void 0)}}function Yo(t){return J(t)&&t.name==="AuthSessionMissingError"}class zs extends Vr{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500,void 0)}}class Xo extends Vr{constructor(e){super(e,"AuthInvalidCredentialsError",400,void 0)}}class Qo extends Vr{constructor(e,r=null){super(e,"AuthImplicitGrantRedirectError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}function I2(t){return J(t)&&t.name==="AuthImplicitGrantRedirectError"}class ug extends Vr{constructor(e,r=null){super(e,"AuthPKCEGrantCodeExchangeError",500,void 0),this.details=null,this.details=r}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{details:this.details})}}class N2 extends Vr{constructor(){super("PKCE code verifier not found in storage. This can happen if the auth flow was initiated in a different browser or device, or if the storage was cleared. For SSR frameworks (Next.js, SvelteKit, etc.), use @supabase/ssr on both the server and client to store the code verifier in cookies.","AuthPKCECodeVerifierMissingError",400,"pkce_code_verifier_not_found")}}class oh extends Vr{constructor(e,r){super(e,"AuthRetryableFetchError",r,void 0)}}function cg(t){return J(t)&&t.name==="AuthRetryableFetchError"}class dg extends Vr{constructor(e="Refresh result discarded: session state changed mid-flight (e.g., concurrent signOut)"){super(e,"AuthRefreshDiscardedError",409,void 0)}}function L2(t){return J(t)&&t.name==="AuthRefreshDiscardedError"}class hg extends Vr{constructor(e,r,n){super(e,"AuthWeakPasswordError",r,"weak_password"),this.reasons=n}toJSON(){return Object.assign(Object.assign({},super.toJSON()),{reasons:this.reasons})}}class Yl extends Vr{constructor(e){super(e,"AuthInvalidJwtError",400,"invalid_jwt")}}const Xl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_".split(""),fg=` 	
229\r=`.split(""),j2=(()=>{const t=new Array(128);for(let e=0;e<t.length;e+=1)t[e]=-1;for(let e=0;e<fg.length;e+=1)t[fg[e].charCodeAt(0)]=-2;for(let e=0;e<Xl.length;e+=1)t[Xl[e].charCodeAt(0)]=e;return t})();function pg(t,e,r){if(t!==null)for(e.queue=e.queue<<8|t,e.queuedBits+=8;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Xl[n]),e.queuedBits-=6}else if(e.queuedBits>0)for(e.queue=e.queue<<6-e.queuedBits,e.queuedBits=6;e.queuedBits>=6;){const n=e.queue>>e.queuedBits-6&63;r(Xl[n]),e.queuedBits-=6}}function Rw(t,e,r){const n=j2[t];if(n>-1)for(e.queue=e.queue<<6|n,e.queuedBits+=6;e.queuedBits>=8;)r(e.queue>>e.queuedBits-8&255),e.queuedBits-=8;else{if(n===-2)return;throw new Error(`Invalid Base64-URL character "${String.fromCharCode(t)}"`)}}function mg(t){const e=[],r=a=>{e.push(String.fromCodePoint(a))},n={utf8seq:0,codepoint:0},s={queue:0,queuedBits:0},i=a=>{$2(a,n,r)};for(let a=0;a<t.length;a+=1)Rw(t.charCodeAt(a),s,i);return e.join("")}function M2(t,e){if(t<=127){e(t);return}else if(t<=2047){e(192|t>>6),e(128|t&63);return}else if(t<=65535){e(224|t>>12),e(128|t>>6&63),e(128|t&63);return}else if(t<=1114111){e(240|t>>18),e(128|t>>12&63),e(128|t>>6&63),e(128|t&63);return}throw new Error(`Unrecognized Unicode codepoint: ${t.toString(16)}`)}function D2(t,e){for(let r=0;r<t.length;r+=1){let n=t.charCodeAt(r);if(n>55295&&n<=56319){const s=(n-55296)*1024&65535;n=(t.charCodeAt(r+1)-56320&65535|s)+65536,r+=1}M2(n,e)}}function $2(t,e,r){if(e.utf8seq===0){if(t<=127){r(t);return}for(let n=1;n<6;n+=1)if(!(t>>7-n&1)){e.utf8seq=n;break}if(e.utf8seq===2)e.codepoint=t&31;else if(e.utf8seq===3)e.codepoint=t&15;else if(e.utf8seq===4)e.codepoint=t&7;else throw new Error("Invalid UTF-8 sequence");e.utf8seq-=1}else if(e.utf8seq>0){if(t<=127)throw new Error("Invalid UTF-8 sequence");e.codepoint=e.codepoint<<6|t&63,e.utf8seq-=1,e.utf8seq===0&&r(e.codepoint)}}function gi(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};for(let s=0;s<t.length;
229s+=1)Rw(t.charCodeAt(s),r,n);return new Uint8Array(e)}function z2(t){const e=[];return D2(t,r=>e.push(r)),new Uint8Array(e)}function ps(t){const e=[],r={queue:0,queuedBits:0},n=s=>{e.push(s)};return t.forEach(s=>pg(s,r,n)),pg(null,r,n),e.join("")}function U2(t){return Math.round(Date.now()/1e3)+t}function B2(){return Symbol("auth-callback")}const gt=()=>typeof window<"u"&&typeof document<"u",rs={tested:!1,writable:!1},Ow=()=>{if(!gt())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(rs.tested)return rs.writable;const t=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(t,t),globalThis.localStorage.removeItem(t),rs.tested=!0,rs.writable=!0}catch{rs.tested=!0,rs.writable=!1}return rs.writable};function F2(t){const e={},r=new URL(t);if(r.hash&&r.hash[0]==="#")try{new URLSearchParams(r.hash.substring(1)).forEach((s,i)=>{e[i]=s})}catch{}return r.searchParams.forEach((n,s)=>{e[s]=n}),e}const Iw=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),V2=t=>typeof t=="object"&&t!==null&&"status"in t&&"ok"in t&&"json"in t&&typeof t.json=="function",Gs=async(t,e,r)=>{await t.setItem(e,JSON.stringify(r))},wr=async(t,e)=>{const r=await t.getItem(e);if(!r)return null;try{return JSON.parse(r)}catch{return null}},Ve=async(t,e)=>{await t.removeItem(e)};class Wu{constructor(){this.promise=new Wu.promiseConstructor((e,r)=>{this.resolve=e,this.reject=r})}}Wu.promiseConstructor=Promise;function el(t){const e=t.split(".");if(e.length!==3)throw new Yl("Invalid JWT structure");for(let n=0;n<e.length;n++)if(!P2.test(e[n]))throw new Yl("JWT not in base64url format");return{header:JSON.parse(mg(e[0])),payload:JSON.parse(mg(e[1])),signature:gi(e[2]),raw:{header:e[0],payload:e[1]}}}async function W2(t){return await new Promise(e=>{setTimeout(()=>e(null),t)})}function H2(t,e){return new Promise((n,s)=>{(async()=>{for(let i=0;i<1/0;i++)try{const a=await t(i);if(!e(i,null,a)){n(a);return}}catch(a){if(!e(i,a)){s(a);return}}})()})}function G2(t){return("0"+t.toString(16)).substr(-2)}function q2(){const e=new Uint32Array(56);if(typeof crypto>"u"){const r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",n=r.length;let s="";for(let i=0;i<56;i++)s+=r.charAt(Math.floor(Math.random()*n));return s}return crypto.getRandomValues(e),Array.from(e,G2).join("")}async function K2(t){const r=new TextEncoder().encode(t),n=await crypto.subtle.digest("SHA-256",r),s=new Uint8Array(n);return Array.from(s).map(i=>String.fromCharCode(i)).join("")}async function J2(t){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),t;const r=await K2(t);return btoa(r).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function ns(t,e,r=!1){const n=q2();let s=n;r&&(s+="/recovery"),await Gs(t,`${e}-code-verifier`,s);const i=await J2(n);return[i,n===i?"plain":"s256"]}const Z2=/^2[0-9]{3}-(0[1-9]|1[0-2])-(0[1-9]|1[0-9]|2[0-9]|3[0-1])$/i;function Y2(t){const e=t.headers.get(ah);if(!e||!e.match(Z2))return null;try{return new Date(`${e}T00:00:00.0Z`)}catch{return null}}function X2(t){if(!t)throw new Error("Missing exp claim");const e=Math.floor(Date.now()/1e3);if(t<=e)throw new Error("JWT has expired")}function Q2(t){switch(t){case"RS256":return{name:"RSASSA-PKCS1-v1_5",hash:{name:"SHA-256"}};case"ES256":return{name:"ECDSA",namedCurve:"P-256",hash:{name:"SHA-256"}};default:throw new Error("Invalid alg claim")}}const eT=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;function Wr(t){if(!eT.test(t))throw new Error("@supabase/auth-js: Expected parameter to be UUID but is not")}function _r(t){if(!t.passkey)throw new Error("@supabase/auth-js: the passkey API is experimental and disabled by default. Enable it by passing `auth: { experimental: { passkey: true } }` to createClient (or to the GoTrueClient constructor).")}function Nc(){const t={};return new Proxy(t,{get:(e,r)=>{if(r==="__isUserNotAvailableProxy")return!0;if(typeof r=="symbol"){const n=r.toString();if(n==="Symbol(Symbol.toPrimitive)"||n==="Symbol(Symbol.toStringTag)"||n==="Symbol(util.inspect.custom)")return}throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Accessing the "${r}" property of the session object is not supported. Please use getUser() instead.`)},set:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Setting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)},deleteProperty:(e,r)=>{throw new Error(`@supabase/auth-js: client was created with userStorage option and there was no user stored in the user storage. Deleting the "${r}" property of the session object is not supported. Please use getUser() to fetch a user object you can manipulate.`)}})}function tT(t,e){return new Proxy(t,{get:(r,n,s)=>{if(n==="__isInsecureUserWarningProxy")return!0;
229if(typeof n=="symbol"){const i=n.toString();if(i==="Symbol(Symbol.toPrimitive)"||i==="Symbol(Symbol.toStringTag)"||i==="Symbol(util.inspect.custom)"||i==="Symbol(nodejs.util.inspect.custom)")return Reflect.get(r,n,s)}return!e.value&&typeof n=="string"&&(console.warn("Using the user object as returned from supabase.auth.getSession() or from some supabase.auth.onAuthStateChange() events could be insecure! This value comes directly from the storage medium (usually cookies on the server) and may not be authentic. Use supabase.auth.getUser() instead which authenticates the data by contacting the Supabase Auth server."),e.value=!0),Reflect.get(r,n,s)}})}function gg(t){return JSON.parse(JSON.stringify(t))}const ls=t=>{if(typeof t=="object"&&t!==null){const e=t;if(typeof e.msg=="string")return e.msg;if(typeof e.message=="string")return e.message;if(typeof e.error_description=="string")return e.error_description;if(typeof e.error=="string")return e.error}return JSON.stringify(t)},rT=[500,501,502,503,504,520,521,522,523,524,525,526,527,528,529,530];async function vg(t){var e;if(!V2(t))throw new oh(ls(t),0);if(rT.includes(t.status))throw new oh(ls(t),t.status);let r;try{r=await t.json()}catch(i){throw new Tr(ls(i),i)}let n;const s=Y2(t);if(s&&s.getTime()>=Aw["2024-01-01"].timestamp&&typeof r=="object"&&r&&typeof r.code=="string"?n=r.code:typeof r=="object"&&r&&typeof r.error_code=="string"&&(n=r.error_code),n){if(n==="weak_password")throw new hg(ls(r),t.status,((e=r.weak_password)===null||e===void 0?void 0:e.reasons)||[]);if(n==="session_not_found")throw new st}else if(typeof r=="object"&&r&&typeof r.weak_password=="object"&&r.weak_password&&Array.isArray(r.weak_password.reasons)&&r.weak_password.reasons.length&&r.weak_password.reasons.reduce((i,a)=>i&&typeof a=="string",!0))throw new hg(ls(r),t.status,r.weak_password.reasons);throw new R2(ls(r),t.status||500,n)}const nT=(t,e,r,n)=>{const s={method:t,headers:(e==null?void 0:e.headers)||{}};return t==="GET"?s:(s.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),s.body=JSON.stringify(n),Object.assign(Object.assign({},s),r))};async function ee(t,e,r,n){var s;const i=Object.assign({},n==null?void 0:n.headers);i[ah]||(i[ah]=Aw["2024-01-01"].name),n!=null&&n.jwt&&(i.Authorization=`Bearer ${n.jwt}`);const a=(s=n==null?void 0:n.query)!==null&&s!==void 0?s:{};n!=null&&n.redirectTo&&(a.redirect_to=n.redirectTo);const o=Object.keys(a).length?"?"+new URLSearchParams(a).toString():"",l=await sT(t,e,r+o,{headers:i,noResolveJson:n==null?void 0:n.noResolveJson},{},n==null?void 0:n.body);return n!=null&&n.xform?n==null?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function sT(t,e,r,n,s,i){const a=nT(e,n,s,i);let o;try{o=await t(r,Object.assign({},a))}catch(l){throw console.error(l),new oh(ls(l),0)}if(o.ok||await vg(o),n!=null&&n.noResolveJson)return o;try{return await o.json()}catch(l){await vg(l)}}function ir(t){var e;let r=null;oT(t)&&(r=Object.assign({},t),t.expires_at||(r.expires_at=U2(t.expires_in)));const n=(e=t.user)!==null&&e!==void 0?e:typeof(t==null?void 0:t.id)=="string"?t:null;return{data:{session:r,user:n},error:null}}function yg(t){const e=ir(t);return!e.error&&t.weak_password&&typeof t.weak_password=="object"&&Array.isArray(t.weak_password.reasons)&&t.weak_password.reasons.length&&t.weak_password.message&&typeof t.weak_password.message=="string"&&t.weak_password.reasons.reduce((r,n)=>r&&typeof n=="string",!0)&&(e.data.weak_password=t.weak_password),e}function _n(t){var e;return{data:{user:(e=t.user)!==null&&e!==void 0?e:t},error:null}}function iT(t){return{data:t,error:null}}function aT(t){const{action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i}=t,a=Bu(t,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),o={action_link:e,email_otp:r,hashed_token:n,redirect_to:s,verification_type:i},l=Object.assign({},a);return{data:{properties:o,user:l},error:null}}function wg(t){return t}function oT(t){return!!t.access_token&&!!t.refresh_token&&!!t.expires_in}const Lc=["global","local","others"];class lT{constructor({url:e="",headers:r={},fetch:n,experimental:s}){this.url=e,this.headers=r,this.fetch=Iw(n),this.experimental=s??{},this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)},this.oauth={listClients:this._listOAuthClients.bind(this),createClient:this._createOAuthClient.bind(this),getClient:this._getOAuthClient.bind(this),updateClient:this._updateOAuthClient.bind(this),deleteClient:this._deleteOAuthClient.bind(this),regenerateClientSecret:this._regenerateOAuthClientSecret.bind(this)},this.customProviders={listProviders:this._listCustomProviders.bind(this),createProvider:this._createCustomProvider.bind(this),getProvider:this._getCustomProvider.bind(this),updateProvider:this._updateCustomProvider.bind(this),deleteProvider:this._deleteCustomProvider.bind(this)},this.passkey={listPasskeys:this._adminListPasskeys.bind(this),deletePasskey:this._adminDeletePasskey.bind(this)}}async signOut(e,r=Lc[0]){if(Lc.indexOf(r)<0)throw new Error(`@supabase/auth-js: Parameter scope must be one of ${Lc.join(", ")}`);try{return await ee(this.fetch,"POST",`${this.url}/logout?scope=${r}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(n){if(J(n))return{data:null,error:n};throw n}}async inviteUserByEmail(e,r={}){try{return await ee(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:r.data},headers:this.headers,redirectTo:r.redirectTo,xform:_n})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async generateLink(e){try{const{options:r}=e,n=Bu(e,["options"]),s=Object.assign(Object.assign({},n),r);return"newEmail"in n&&(s.new_email=n==null?void 0:n.newEmail,delete s.newEmail),await ee(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:s,headers:this.headers,xform:aT,redirectTo:r==null?void 0:r.redirectTo})}catch(r){if(J(r))return{data:{properties:null,user:null},error:r};throw r}}async createUser(e){try{return await ee(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:_n})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async listUsers(e){var r,n,s,i,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},c=await ee(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:wg});if(c.error)throw c.error;const d=await c.json(),f=(a=c.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=c.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(y.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(J(u))return{data:{users:[]},error:u};throw u}}async getUserById(e){Wr(e);try{return await ee(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:_n})}catch(r){if(J(r))return{data:{user:null},error:r};throw r}}async updateUserById(e,r){Wr(e);try{return await ee(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:r,headers:this.headers,xform:_n})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async deleteUser(e,r=!1){Wr(e);
229try{return await ee(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:r},xform:_n})}catch(n){if(J(n))return{data:{user:null},error:n};throw n}}async _listFactors(e){Wr(e.userId);try{const{data:r,error:n}=await ee(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:s=>({data:{factors:s},error:null})});return{data:r,error:n}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _deleteFactor(e){Wr(e.userId),Wr(e.id);try{return{data:await ee(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _listOAuthClients(e){var r,n,s,i,a,o,l;try{const u={nextPage:null,lastPage:0,total:0},c=await ee(this.fetch,"GET",`${this.url}/admin/oauth/clients`,{headers:this.headers,noResolveJson:!0,query:{page:(n=(r=e==null?void 0:e.page)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:"",per_page:(i=(s=e==null?void 0:e.perPage)===null||s===void 0?void 0:s.toString())!==null&&i!==void 0?i:""},xform:wg});if(c.error)throw c.error;const d=await c.json(),f=(a=c.headers.get("x-total-count"))!==null&&a!==void 0?a:0,m=(l=(o=c.headers.get("link"))===null||o===void 0?void 0:o.split(","))!==null&&l!==void 0?l:[];return m.length>0&&(m.forEach(y=>{const g=parseInt(y.split(";")[0].split("=")[1].substring(0,1)),b=JSON.parse(y.split(";")[1].split("=")[1]);u[`${b}Page`]=g}),u.total=parseInt(f)),{data:Object.assign(Object.assign({},d),u),error:null}}catch(u){if(J(u))return{data:{clients:[]},error:u};throw u}}async _createOAuthClient(e){try{return await ee(this.fetch,"POST",`${this.url}/admin/oauth/clients`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _getOAuthClient(e){try{return await ee(this.fetch,"GET",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _updateOAuthClient(e,r){try{return await ee(this.fetch,"PUT",`${this.url}/admin/oauth/clients/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(J(n))return{data:null,error:n};throw n}}async _deleteOAuthClient(e){try{return await ee(this.fetch,"DELETE",`${this.url}/admin/oauth/clients/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _regenerateOAuthClientSecret(e){try{return await ee(this.fetch,"POST",`${this.url}/admin/oauth/clients/${e}/regenerate_secret`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _listCustomProviders(e){try{const r={};return e!=null&&e.type&&(r.type=e.type),await ee(this.fetch,"GET",`${this.url}/admin/custom-providers`,{headers:this.headers,query:r,xform:n=>{var s;return{data:{providers:(s=n==null?void 0:n.providers)!==null&&s!==void 0?s:[]},error:null}}})}catch(r){if(J(r))return{data:{providers:[]},error:r};throw r}}async _createCustomProvider(e){try{return await ee(this.fetch,"POST",`${this.url}/admin/custom-providers`,{body:e,headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _getCustomProvider(e){try{return await ee(this.fetch,"GET",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _updateCustomProvider(e,r){try{return await ee(this.fetch,"PUT",`${this.url}/admin/custom-providers/${e}`,{body:r,headers:this.headers,xform:n=>({data:n,error:null})})}catch(n){if(J(n))return{data:null,error:n};throw n}}async _deleteCustomProvider(e){try{return await ee(this.fetch,"DELETE",`${this.url}/admin/custom-providers/${e}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}async _adminListPasskeys(e){_r(this.experimental),Wr(e.userId);try{return await ee(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/passkeys`,{headers:this.headers,xform:r=>({data:r,error:null})})}catch(r){if(J(r))return{data:null,error:r};throw r}}async _adminDeletePasskey(e){_r(this.experimental),Wr(e.userId),Wr(e.passkeyId);
229try{return await ee(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/passkeys/${e.passkeyId}`,{headers:this.headers,noResolveJson:!0}),{data:null,error:null}}catch(r){if(J(r))return{data:null,error:r};throw r}}}function _g(t={}){return{getItem:e=>t[e]||null,setItem:(e,r)=>{t[e]=r},removeItem:e=>{delete t[e]}}}globalThis&&Ow()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class uT extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}function cT(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}function Nw(t){if(!/^0x[a-fA-F0-9]{40}$/.test(t))throw new Error(`@supabase/auth-js: Address "${t}" is invalid.`);return t.toLowerCase()}function dT(t){return parseInt(t,16)}function hT(t){const e=new TextEncoder().encode(t);return"0x"+Array.from(e,n=>n.toString(16).padStart(2,"0")).join("")}function fT(t){var e;const{chainId:r,domain:n,expirationTime:s,issuedAt:i=new Date,nonce:a,notBefore:o,requestId:l,resources:u,scheme:c,uri:d,version:f}=t;{if(!Number.isInteger(r))throw new Error(`@supabase/auth-js: Invalid SIWE message field "chainId". Chain ID must be a EIP-155 chain ID. Provided value: ${r}`);if(!n)throw new Error('@supabase/auth-js: Invalid SIWE message field "domain". Domain must be provided.');if(a&&a.length<8)throw new Error(`@supabase/auth-js: Invalid SIWE message field "nonce". Nonce must be at least 8 characters. Provided value: ${a}`);if(!d)throw new Error('@supabase/auth-js: Invalid SIWE message field "uri". URI must be provided.');if(f!=="1")throw new Error(`@supabase/auth-js: Invalid SIWE message field "version". Version must be '1'. Provided value: ${f}`);if(!((e=t.statement)===null||e===void 0)&&e.includes(`
230`))throw new Error(`@supabase/auth-js: Invalid SIWE message field "statement". Statement must not include '\\n'. Provided value: ${t.statement}`)}const m=Nw(t.address),y=c?`${c}://${n}`:n,g=t.statement?`${t.statement}
231`:"",b=`${y}
231 wants you to sign in with your Ethereum account:
232${m}
233
234${g}`;let _=`URI: ${d}
235Version: ${f}
236Chain ID: ${r}${a?`
237Nonce: ${a}`:""}
238Issued At: ${i.toISOString()}`;if(s&&(_+=`
239Expiration Time: ${s.toISOString()}`),o&&(_+=`
240Not Before: ${o.toISOString()}`),l&&(_+=`
241Request ID: ${l}`),u){let v=`
242Resources:`;for(const w of u){if(!w||typeof w!="string")throw new Error(`@supabase/auth-js: Invalid SIWE message field "resources". Every resource must be a valid string. Provided value: ${w}`);v+=`
243- ${w}`}_+=v}return`${b}
244${_}`}class Ze extends Error{constructor({message:e,code:r,cause:n,name:s}){var i;super(e,{cause:n}),this.__isWebAuthnError=!0,this.name=(i=s??(n instanceof Error?n.name:void 0))!==null&&i!==void 0?i:"Unknown Error",this.code=r}toJSON(){return{name:this.name,message:this.message,code:this.code}}}class Ql extends Ze{constructor(e,r){super({code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:r,message:e}),this.name="WebAuthnUnknownError",this.originalError=r}}function pT({error:t,options:e}){var r,n,s;const{publicKey:i}=e;if(!i)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Ze({message:"Registration ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else if(t.name==="ConstraintError"){if(((r=i.authenticatorSelection)===null||r===void 0?void 0:r.requireResidentKey)===!0)return new Ze({message:"Discoverable credentials were required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",cause:t});if(e.mediation==="conditional"&&((n=i.authenticatorSelection)===null||n===void 0?void 0:n.userVerification)==="required")return new Ze({message:"User verification was required during automatic registration but it could not be performed",code:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",cause:t});if(((s=i.authenticatorSelection)===null||s===void 0?void 0:s.userVerification)==="required")return new Ze({message:"User verification was required but no available authenticator supported it",code:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",cause:t})}else{if(t.name==="InvalidStateError")return new Ze({message:"The authenticator was previously registered",code:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",cause:t});if(t.name==="NotAllowedError")return new Ze({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="NotSupportedError")return i.pubKeyCredParams.filter(o=>o.type==="public-key").length===0?new Ze({message:'No entry in pubKeyCredParams was of type "public-key"',code:"ERROR_MALFORMED_PUBKEYCREDPARAMS",cause:t}):new Ze({message:"No available authenticator supported any of the specified pubKeyCredParams algorithms",code:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",cause:t});if(t.name==="SecurityError"){const a=window.location.hostname;if(Lw(a)){if(i.rp.id!==a)return new Ze({message:`The RP ID "${i.rp.id}" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ze({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="TypeError"){if(i.user.id.byteLength<1||i.user.id.byteLength>64)return new Ze({message:"User ID was not between 1 and 64 characters",code:"ERROR_INVALID_USER_ID_LENGTH",cause:t})}else if(t.name==="UnknownError")return new Ze({message:"The authenticator was unable to process the specified options, or could not create a new credential",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Ze({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}function mT({error:t,options:e}){const{publicKey:r}=e;if(!r)throw Error("options was missing required publicKey property");if(t.name==="AbortError"){if(e.signal instanceof AbortSignal)return new Ze({message:"Authentication ceremony was sent an abort signal",code:"ERROR_CEREMONY_ABORTED",cause:t})}else{if(t.name==="NotAllowedError")return new Ze({message:t.message,code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t});if(t.name==="SecurityError"){const n=window.location.hostname;if(Lw(n)){if(r.rpId!==n)return new Ze({message:`The RP ID "${r.rpId}
244" is invalid for this domain`,code:"ERROR_INVALID_RP_ID",cause:t})}else return new Ze({message:`${window.location.hostname} is an invalid domain`,code:"ERROR_INVALID_DOMAIN",cause:t})}else if(t.name==="UnknownError")return new Ze({message:"The authenticator was unable to process the specified options, or could not create a new assertion signature",code:"ERROR_AUTHENTICATOR_GENERAL_ERROR",cause:t})}return new Ze({message:"a Non-Webauthn related error has occurred",code:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",cause:t})}class gT{createNewAbortSignal(){if(this.controller){const r=new Error("Cancelling existing WebAuthn API call for new one");r.name="AbortError",this.controller.abort(r)}const e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){const e=new Error("Manually cancelling existing WebAuthn API call");e.name="AbortError",this.controller.abort(e),this.controller=void 0}}}const lh=new gT;function xg(t){if(!t)throw new Error("Credential creation options are required");if(typeof PublicKeyCredential<"u"&&"parseCreationOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseCreationOptionsFromJSON=="function")return PublicKeyCredential.parseCreationOptionsFromJSON(t);const{challenge:e,user:r,excludeCredentials:n}=t,s=Bu(t,["challenge","user","excludeCredentials"]),i=gi(e).buffer,a=Object.assign(Object.assign({},r),{id:gi(r.id).buffer}),o=Object.assign(Object.assign({},s),{challenge:i,user:a});if(n&&n.length>0){o.excludeCredentials=new Array(n.length);for(let l=0;l<n.length;l++){const u=n[l];o.excludeCredentials[l]=Object.assign(Object.assign({},u),{id:gi(u.id).buffer,type:u.type||"public-key",transports:u.transports})}}return o}function bg(t){if(!t)throw new Error("Credential request options are required");if(typeof PublicKeyCredential<"u"&&"parseRequestOptionsFromJSON"in PublicKeyCredential&&typeof PublicKeyCredential.parseRequestOptionsFromJSON=="function")return PublicKeyCredential.parseRequestOptionsFromJSON(t);const{challenge:e,allowCredentials:r}=t,n=Bu(t,["challenge","allowCredentials"]),s=gi(e).buffer,i=Object.assign(Object.assign({},n),{challenge:s});if(r&&r.length>0){i.allowCredentials=new Array(r.length);for(let a=0;a<r.length;a++){const o=r[a];i.allowCredentials[a]=Object.assign(Object.assign({},o),{id:gi(o.id).buffer,type:o.type||"public-key",transports:o.transports})}}return i}function Sg(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t;return{id:t.id,rawId:t.id,response:{attestationObject:ps(new Uint8Array(t.response.attestationObject)),clientDataJSON:ps(new Uint8Array(t.response.clientDataJSON))},type:"public-key",clientExtensionResults:t.getClientExtensionResults(),authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function kg(t){var e;if("toJSON"in t&&typeof t.toJSON=="function")return t.toJSON();const r=t,n=t.getClientExtensionResults(),s=t.response;return{id:t.id,rawId:t.id,response:{authenticatorData:ps(new Uint8Array(s.authenticatorData)),clientDataJSON:ps(new Uint8Array(s.clientDataJSON)),signature:ps(new Uint8Array(s.signature)),userHandle:s.userHandle?ps(new Uint8Array(s.userHandle)):void 0},type:"public-key",clientExtensionResults:n,authenticatorAttachment:(e=r.authenticatorAttachment)!==null&&e!==void 0?e:void 0}}function Lw(t){return t==="localhost"||/^([a-z0-9]+(-[a-z0-9]+)*\.)+[a-z]{2,}$/i.test(t)}function eu(){var t,e;return!!(gt()&&"PublicKeyCredential"in window&&window.PublicKeyCredential&&"credentials"in navigator&&typeof((t=navigator==null?void 0:navigator.credentials)===null||t===void 0?void 0:t.create)=="function"&&typeof((e=navigator==null?void 0:navigator.credentials)===null||e===void 0?void 0:e.get)=="function")}async function jw(t){try{const e=await navigator.credentials.create(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ql("Browser returned unexpected credential type",e)}:{data:null,error:new Ql("Empty credential response",e)}}catch(e){return{data:null,error:pT({error:e,options:t})}}}async function Mw(t){try{const e=await navigator.credentials.get(t);return e?e instanceof PublicKeyCredential?{data:e,error:null}:{data:null,error:new Ql("Browser returned unexpected credential type",e)}:{data:null,error:new Ql("Empty credential response",e)}}catch(e){return{data:null,error:mT({error:e,options:t})}}}const vT={hints:["security-key"],authenticatorSelection:{authenticatorAttachment:"cross-platform",requireResidentKey:!1,userVerification:"preferred",residentKey:"discouraged"},attestation:"direct"},yT={userVerification:"preferred",hints:["security-key"],attestation:"direct"};function tu(...t){const e=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),r=s=>s instanceof ArrayBuffer||ArrayBuffer.isView(s),n={};for(const s of t)if(s)for(const i in s){const a=s[i];if(a!==void 0)if(Array.isArray(a))n[i]=a;
244else if(r(a))n[i]=a;else if(e(a)){const o=n[i];e(o)?n[i]=tu(o,a):n[i]=tu(a)}else n[i]=a}return n}function wT(t,e){return tu(vT,t,e||{})}function _T(t,e){return tu(yT,t,e||{})}class xT{constructor(e){this.client=e,this.enroll=this._enroll.bind(this),this.challenge=this._challenge.bind(this),this.verify=this._verify.bind(this),this.authenticate=this._authenticate.bind(this),this.register=this._register.bind(this)}async _enroll(e){return this.client.mfa.enroll(Object.assign(Object.assign({},e),{factorType:"webauthn"}))}async _challenge({factorId:e,webauthn:r,friendlyName:n,signal:s},i){var a;try{const{data:o,error:l}=await this.client.mfa.challenge({factorId:e,webauthn:r});if(!o)return{data:null,error:l};const u=s??lh.createNewAbortSignal();if(o.webauthn.type==="create"){const{user:c}=o.webauthn.credential_options.publicKey;if(!c.name){const d=n;if(d)c.name=`${c.id}:${d}`;else{const m=(await this.client.getUser()).data.user,y=((a=m==null?void 0:m.user_metadata)===null||a===void 0?void 0:a.name)||(m==null?void 0:m.email)||(m==null?void 0:m.id)||"User";c.name=`${c.id}:${y}`}}c.displayName||(c.displayName=c.name)}switch(o.webauthn.type){case"create":{const c=wT(o.webauthn.credential_options.publicKey,i==null?void 0:i.create),{data:d,error:f}=await jw({publicKey:c,signal:u});return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}case"request":{const c=_T(o.webauthn.credential_options.publicKey,i==null?void 0:i.request),{data:d,error:f}=await Mw(Object.assign(Object.assign({},o.webauthn.credential_options),{publicKey:c,signal:u}));return d?{data:{factorId:e,challengeId:o.id,webauthn:{type:o.webauthn.type,credential_response:d}},error:null}:{data:null,error:f}}}}catch(o){return J(o)?{data:null,error:o}:{data:null,error:new Tr("Unexpected error in challenge",o)}}}async _verify({challengeId:e,factorId:r,webauthn:n}){return this.client.mfa.verify({factorId:r,challengeId:e,webauthn:n})}async _authenticate({factorId:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new no("rpId is required for WebAuthn authentication")};try{if(!eu())return{data:null,error:new Tr("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this.challenge({factorId:e,webauthn:{rpId:r,rpOrigins:n},signal:s},{request:i});if(!a)return{data:null,error:o};const{webauthn:l}=a;return this._verify({factorId:e,challengeId:a.challengeId,webauthn:{type:l.type,rpId:r,rpOrigins:n,credential_response:l.credential_response}})}catch(a){return J(a)?{data:null,error:a}:{data:null,error:new Tr("Unexpected error in authenticate",a)}}}async _register({friendlyName:e,webauthn:{rpId:r=typeof window<"u"?window.location.hostname:void 0,rpOrigins:n=typeof window<"u"?[window.location.origin]:void 0,signal:s}={}},i){if(!r)return{data:null,error:new no("rpId is required for WebAuthn registration")};try{if(!eu())return{data:null,error:new Tr("Browser does not support WebAuthn",null)};const{data:a,error:o}=await this._enroll({friendlyName:e});if(!a)return await this.client.mfa.listFactors().then(c=>{var d;return(d=c.data)===null||d===void 0?void 0:d.all.find(f=>f.factor_type==="webauthn"&&f.friendly_name===e&&f.status!=="unverified")}).then(c=>c?this.client.mfa.unenroll({factorId:c==null?void 0:c.id}):void 0),{data:null,error:o};const{data:l,error:u}=await this._challenge({factorId:a.id,friendlyName:a.friendly_name,webauthn:{rpId:r,rpOrigins:n},signal:s},{create:i});return l?this._verify({factorId:a.id,challengeId:l.challengeId,webauthn:{rpId:r,rpOrigins:n,type:l.webauthn.type,credential_response:l.webauthn.credential_response}}):{data:null,error:u}}catch(a){return J(a)?{data:null,error:a}:{data:null,error:new Tr("Unexpected error in register",a)}}}}cT();const bT={url:E2,storageKey:T2,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:C2,flowType:"implicit",debug:!1,hasCustomAuthorizationHeader:!1,throwOnError:!1,lockAcquireTimeout:5e3,skipAutoInitialize:!1,experimental:{}},Us={};class so{get jwks(){var e,r;return(r=(e=Us[this.storageKey])===null||e===void 0?void 0:e.jwks)!==null&&r!==void 0?r:{keys:[]}}set jwks(e){Us[this.storageKey]=Object.assign(Object.assign({},Us[this.storageKey]),{jwks:e})}get jwks_cached_at(){var e,r;return(r=(e=Us[this.storageKey])===null||e===void 0?void 0:e.cachedAt)!==null&&r!==void 0?r:Number.MIN_SAFE_INTEGER}set jwks_cached_at(e){Us[this.storageKey]=Object.assign(Object.assign({},Us[this.storageKey]),{cachedAt:e})}constructor(e){var r,n,s;this.userStorage=null,this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.autoRefreshTickTimeout=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.lastRefreshFailure=null,this._sessionRemovalEpoch=0,this.initializePromise=null,this.detectSessionInUrl=!0,this.hasCustomAuthorizationHeader=!1,this.suppressGetSessionWarning=!1,this.lock=null,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log;const i=Object.assign(Object.assign({},bT),e);if(this.storageKey=i.storageKey,this.instanceID=(r=so.nextInstanceID[this.storageKey])!==null&&r!==void 0?r:0,so.nextInstanceID[this.storageKey]=this.instanceID+1,this.logDebugMessages=!!i.debug,typeof i.debug=="function"&&(this.logger=i.debug),this.instanceID>0&&gt()){const a=`${this._logPrefix()} Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.`;console.warn(a),this.logDebugMessages&&console.trace(a)}if(this.persistSession=i.persistSession,this.autoRefreshToken=i.autoRefreshToken,this.experimental=(n=i.experimental)!==null&&n!==void 0?n:{},this.admin=new lT({url:i.url,headers:i.headers,fetch:i.fetch,experimental:this.experimental}),this.url=i.url,this.headers=i.headers,this.fetch=Iw(i.fetch),this.detectSessionInUrl=i.detectSessionInUrl,this.flowType=i.flowType,this.hasCustomAuthorizationHeader=i.hasCustomAuthorizationHeader,this.throwOnError=i.throwOnError,this.lockAcquireTimeout=i.lockAcquireTimeout,i.lock!=null&&(this.lock=i.lock),this.jwks||(this.jwks={keys:[]},this.jwks_cached_at=Number.MIN_SAFE_INTEGER),this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this),webauthn:new xT(this)}
244,this.oauth={getAuthorizationDetails:this._getAuthorizationDetails.bind(this),approveAuthorization:this._approveAuthorization.bind(this),denyAuthorization:this._denyAuthorization.bind(this),listGrants:this._listOAuthGrants.bind(this),revokeGrant:this._revokeOAuthGrant.bind(this)},this.passkey={startRegistration:this._startPasskeyRegistration.bind(this),verifyRegistration:this._verifyPasskeyRegistration.bind(this),startAuthentication:this._startPasskeyAuthentication.bind(this),verifyAuthentication:this._verifyPasskeyAuthentication.bind(this),list:this._listPasskeys.bind(this),update:this._updatePasskey.bind(this),delete:this._deletePasskey.bind(this)},this.persistSession?(i.storage?this.storage=i.storage:Ow()?this.storage=globalThis.localStorage:(this.memoryStorage={},this.storage=_g(this.memoryStorage)),i.userStorage&&(this.userStorage=i.userStorage)):(this.memoryStorage={},this.storage=_g(this.memoryStorage)),gt()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(a){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",a)}(s=this.broadcastChannel)===null||s===void 0||s.addEventListener("message",async a=>{this._debug("received broadcast notification from other tab or client",a),(a.data.event==="TOKEN_REFRESHED"||a.data.event==="SIGNED_IN")&&(this.lastRefreshFailure=null);try{await this._notifyAllSubscribers(a.data.event,a.data.session,!1)}catch(o){this._debug("#broadcastChannel","error",o)}})}i.skipAutoInitialize||this.initialize().catch(a=>{this._debug("#initialize()","error",a)})}isThrowOnErrorEnabled(){return this.throwOnError}_returnResult(e){if(this.throwOnError&&e&&e.error)throw e.error;return e}_logPrefix(){return`GoTrueClient@${this.storageKey}:${this.instanceID} (${Pw}) ${new Date().toISOString()}`}_debug(...e){return this.logDebugMessages&&this.logger(this._logPrefix(),...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._initialize()):await this._initialize())(),await this.initializePromise)}async _initialize(){var e;try{let r={},n="none";if(gt()&&(r=F2(window.location.href),this._isImplicitGrantCallback(r)?n="implicit":await this._isPKCECallback(r)&&(n="pkce")),gt()&&this.detectSessionInUrl&&n!=="none"){const{data:s,error:i}=await this._getSessionFromURL(r,n);if(i){if(this._debug("#_initialize()","error detecting session from URL",i),I2(i)){const l=(e=i.details)===null||e===void 0?void 0:e.code;if(l==="identity_already_exists"||l==="identity_not_found"||l==="single_identity_not_deletable")return{error:i}}return{error:i}}const{session:a,redirectType:o}=s;return this._debug("#_initialize()","detected session in URL",a,"redirect type",o),await this._saveSession(a),setTimeout(async()=>{o==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",a):await this._notifyAllSubscribers("SIGNED_IN",a)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(r){return J(r)?this._returnResult({error:r}):this._returnResult({error:new Tr("Unexpected error during initialization",r)})}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signInAnonymously(e){var r,n,s;try{const i=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{data:(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.data)!==null&&n!==void 0?n:{},gotrue_meta_security:{captcha_token:(s=e==null?void 0:e.options)===null||s===void 0?void 0:s.captchaToken}},xform:ir}),{data:a,error:o}=i;if(o||!a)return this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(J(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signUp(e){var r,n,s;try{let i;if("email"in e){const{email:c,password:d,options:f}=e;let m=null,y=null;this.flowType==="pkce"&&([m,y]=await ns(this.storage,this.storageKey)),i=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:f==null?void 0:f.emailRedirectTo,body:{email:c,password:d,data:(r=f==null?void 0:f.data)!==null&&r!==void 0?r:{},gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken},code_challenge:m,code_challenge_method:y},xform:ir})}else if("phone"in e){const{phone:c,password:d,options:f}=e;i=await ee(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:c,password:d,data:(n=f==null?void 0:f.data)!==null&&n!==void 0?n:{},channel:(s=f==null?void 0:f.channel)!==null&&s!==void 0?s:"sms",gotrue_meta_security:{captcha_token:f==null?void 0:f.captchaToken}},xform:ir})}else throw new Xo("You must provide either an email or phone number and a password");const{data:a,error:o}=i;if(o||!a)return await Ve(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:o});const l=a.session,u=a.user;return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(i){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:{user:null,session:null},error:i});throw i}}async signInWithPassword(e){try{let r;if("email"in e){const{email:i,password:a,options:o}=e;r=await ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:yg})}else if("phone"in e){const{phone:i,password:a,options:o}=e;r=await ee(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:i,password:a,gotrue_meta_security:{captcha_token:o==null?void 0:o.captchaToken}},xform:yg})}else throw new Xo("You must provide either an email or phone number and a password");const{data:n,error:s}=r;if(s)return this._returnResult({data:{user:null,session:null},error:s});if(!n||!n.session||!n.user){const i=new zs;return this._returnResult({data:{user:null,session:null},error:i})}return n.session&&(await this._saveSession(n.session),await this._notifyAllSubscribers("SIGNED_IN",n.session)),this._returnResult({data:Object.assign({user:n.user,session:n.session},n.weak_password?{weakPassword:n.weak_password}:null),error:s})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOAuth(e){var r,n,s,i;return await this._handleProviderSignIn(e.provider,{redirectTo:(r=e.options)===null||r===void 0?void 0:r.redirectTo,scopes:(n=e.options)===null||n===void 0?void 0:n.scopes,queryParams:(s=e.options)===null||s===void 0?void 0:s.queryParams,skipBrowserRedirect:(i=e.options)===null||i===void 0?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this.lock!=null?this._acquireLock(this.lockAcquireTimeout,async()=>this._exchangeCodeForSession(e)):this._exchangeCodeForSession(e)}async signInWithWeb3(e){const{chain:r}=e;switch(r){case"ethereum":return await this.signInWithEthereum(e);case"solana":return await this.signInWithSolana(e);default:throw new Error(`@supabase/auth-js: Unsupported chain "${r}"`)}}async signInWithEthereum(e){var r,n,s,i,a,o,l,u,c,d,f;let m,y;if("message"in e)m=e.message,y=e.signature;else{const{chain:g,wallet:b,statement:_,options:v}=e;let w;if(gt())if(typeof b=="object")w=b;else{const E=window;if("ethereum"in E&&typeof E.ethereum=="object"&&"request"in E.ethereum&&typeof E.ethereum.request=="function")w=E.ethereum;else throw new Error("@supabase/auth-js: No compatible Ethereum wallet interface on the window object (window.ethereum) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'ethereum', wallet: resolvedUserWallet }) instead.")}else{if(typeof b!="object"||!(v!=null&&v.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");w=b}const h=new URL((r=v==null?void 0:v.url)!==null&&r!==void 0?r:window.location.href),p=await w.request({method:"eth_requestAccounts"}).then(E=>E).catch(()=>{throw new Error("@supabase/auth-js: Wallet method eth_requestAccounts is missing or invalid")});if(!p||p.length===0)throw new Error("@supabase/auth-js: No accounts available. Please ensure the wallet is connected.");const x=Nw(p[0]);let k=(n=v==null?void 0:v.signInWithEthereum)===null||n===void 0?void 0:n.chainId;if(!k){const E=await w.request({method:"eth_chainId"});k=dT(E)}const T={domain:h.host,address:x,statement:_,uri:h.href,version:"1",chainId:k,nonce:(s=v==null?void 0:v.signInWithEthereum)===null||s===void 0?void 0:s.nonce,issuedAt:(a=(i=v==null?void 0:v.signInWithEthereum)===null||i===void 0?void 0:i.issuedAt)!==null&&a!==void 0?a:new Date,expirationTime:(o=v==null?void 0:v.signInWithEthereum)===null||o===void 0?void 0:o.expirationTime,notBefore:(l=v==null?void 0:v.signInWithEthereum)===null||l===void 0?void 0:l.notBefore,requestId:(u=v==null?void 0:v.signInWithEthereum)===null||u===void 0?void 0:u.requestId,resources:(c=v==null?void 0:v.signInWithEthereum)===null||c===void 0?void 0:c.resources};m=fT(T),y=await w.request({method:"personal_sign",params:[hT(m),x]})}try{const{data:g,error:b}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"ethereum",message:m,signature:y},!((d=e.options)===null||d===void 0)&&d.captchaToken?{gotrue_meta_security:{captcha_token:(f=e.options)===null||f===void 0?void 0:f.captchaToken}}:null),xform:ir});if(b)throw b;if(!g||!g.session||!g.user){const _=new zs;return this._returnResult({data:{user:null,session:null},error:_})}return g.session&&(await this._saveSession(g.session),await this._notifyAllSubscribers("SIGNED_IN",g.session)),this._returnResult({data:Object.assign({},g),error:b})}catch(g){if(J(g))return this._returnResult({data:{user:null,session:null},error:g});throw g}}async signInWithSolana(e){var r,n,s,i,a,o,l,u,c,d,f,m;let y,g;if("message"in e)y=e.message,g=e.signature;else{const{chain:b,wallet:_,statement:v,options:w}=e;let h;if(gt())if(typeof _=="object")h=_;else{const x=window;if("solana"in x&&typeof x.solana=="object"&&("signIn"in x.solana&&typeof x.solana.signIn=="function"||"signMessage"in x.solana&&typeof x.solana.signMessage=="function"))h=x.solana;else throw new Error("@supabase/auth-js: No compatible Solana wallet interface on the window object (window.solana) detected. Make sure the user already has a wallet installed and connected for this app. Prefer passing the wallet interface object directly to signInWithWeb3({ chain: 'solana', wallet: resolvedUserWallet }) instead.")}else{if(typeof _!="object"||!(w!=null&&w.url))throw new Error("@supabase/auth-js: Both wallet and url must be specified in non-browser environments.");h=_}const p=new URL((r=w==null?void 0:w.url)!==null&&r!==void 0?r:window.location.href);if("signIn"in h&&h.signIn){const x=await h.signIn(Object.assign(Object.assign(Object.assign({issuedAt:new Date().toISOString()},w==null?void 0:w.signInWithSolana),{version:"1",domain:p.host,uri:p.href}),v?{statement:v}:null));let k;if(Array.isArray(x)&&x[0]&&typeof x[0]=="object")k=x[0];else if(x&&typeof x=="object"&&"signedMessage"in x&&"signature"in x)k=x;else throw new Error("@supabase/auth-js: Wallet method signIn() returned unrecognized value");if("signedMessage"in k&&"signature"in k&&(typeof k.signedMessage=="string"||k.signedMessage instanceof Uint8Array)&&k.signature instanceof Uint8Array)y=typeof k.signedMessage=="string"?k.signedMessage:new TextDecoder().decode(k.signedMessage),g=k.signature;else throw new Error("@supabase/auth-js: Wallet method signIn() API returned object without signedMessage and signature fields")}else{if(!("signMessage"in h)||typeof h.signMessage!="function"||!("publicKey"in h)||typeof h!="object"||!h.publicKey||!("toBase58"in h.publicKey)||typeof h.publicKey.toBase58!="function")throw new Error("@supabase/auth-js: Wallet does not have a compatible signMessage() and publicKey.toBase58() API");y=[`${p.host} wants you to sign in with your Solana account:`,h.publicKey.toBase58(),...v?["",v,""]:[""],"Version: 1",`URI: ${p.href}`,`Issued At: ${(s=(n=w==null?void 0:w.signInWithSolana)===null||n===void 0?void 0:n.issuedAt)!==null&&s!==void 0?s:new Date().toISOString()}`,...!((i=w==null?void 0:w.signInWithSolana)===null||i===void 0)&&i.notBefore?[`Not Before: ${w.signInWithSolana.notBefore}`]:[],...!((a=w==null?void 0:w.signInWithSolana)===null||a===void 0)&&a.expirationTime?[`Expiration Time: ${w.signInWithSolana.expirationTime}`]:[],...!((o=w==null?void 0:w.signInWithSolana)===null||o===void 0)&&o.chainId?[`Chain ID: ${w.signInWithSolana.chainId}`]:[],...!((l=w==null?void 0:w.signInWithSolana)===null||l===void 0)&&l.nonce?[`Nonce: ${w.signInWithSolana.nonce}`]:[],...!((u=w==null?void 0:w.signInWithSolana)===null||u===void 0)&&u.requestId?[`Request ID: ${w.signInWithSolana.requestId}`]:[],...!((d=(c=w==null?void 0:w.signInWithSolana)===null||c===void 0?void 0:c.resources)===null||d===void 0)&&d.length?["Resources",...w.sign
244InWithSolana.resources.map(k=>`- ${k}`)]:[]].join(`
245`);const x=await h.signMessage(new TextEncoder().encode(y),"utf8");if(!x||!(x instanceof Uint8Array))throw new Error("@supabase/auth-js: Wallet signMessage() API returned an recognized value");g=x}}try{const{data:b,error:_}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=web3`,{headers:this.headers,body:Object.assign({chain:"solana",message:y,signature:ps(g)},!((f=e.options)===null||f===void 0)&&f.captchaToken?{gotrue_meta_security:{captcha_token:(m=e.options)===null||m===void 0?void 0:m.captchaToken}}:null),xform:ir});if(_)throw _;if(!b||!b.session||!b.user){const v=new zs;return this._returnResult({data:{user:null,session:null},error:v})}return b.session&&(await this._saveSession(b.session),await this._notifyAllSubscribers("SIGNED_IN",b.session)),this._returnResult({data:Object.assign({},b),error:_})}catch(b){if(J(b))return this._returnResult({data:{user:null,session:null},error:b});throw b}}async _exchangeCodeForSession(e){const r=await wr(this.storage,`${this.storageKey}-code-verifier`),[n,s]=(r??"").split("/");try{if(!n&&this.flowType==="pkce")throw new N2;const{data:i,error:a}=await ee(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:n},xform:ir});if(await Ve(this.storage,`${this.storageKey}-code-verifier`),a)throw a;if(!i||!i.session||!i.user){const o=new zs;return this._returnResult({data:{user:null,session:null,redirectType:null},error:o})}return i.session&&(await this._saveSession(i.session),await this._notifyAllSubscribers(s==="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",i.session)),this._returnResult({data:Object.assign(Object.assign({},i),{redirectType:s??null}),error:a})}catch(i){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:{user:null,session:null,redirectType:null},error:i});throw i}}async signInWithIdToken(e){try{const{options:r,provider:n,token:s,access_token:i,nonce:a}=e,o=await ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:n,id_token:s,access_token:i,nonce:a,gotrue_meta_security:{captcha_token:r==null?void 0:r.captchaToken}},xform:ir}),{data:l,error:u}=o;if(u)return this._returnResult({data:{user:null,session:null},error:u});if(!l||!l.session||!l.user){const c=new zs;return this._returnResult({data:{user:null,session:null},error:c})}return l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),this._returnResult({data:l,error:u})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async signInWithOtp(e){var r,n,s,i,a;try{if("email"in e){const{email:o,options:l}=e;let u=null,c=null;this.flowType==="pkce"&&([u,c]=await ns(this.storage,this.storageKey));const{error:d}=await ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:o,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:u,code_challenge_method:c},redirectTo:l==null?void 0:l.emailRedirectTo});return this._returnResult({data:{user:null,session:null},error:d})}if("phone"in e){const{phone:o,options:l}=e,{data:u,error:c}=await ee(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:o,data:(s=l==null?void 0:l.data)!==null&&s!==void 0?s:{},create_user:(i=l==null?void 0:l.shouldCreateUser)!==null&&i!==void 0?i:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(a=l==null?void 0:l.channel)!==null&&a!==void 0?a:"sms"}});return this._returnResult({data:{user:null,session:null,messageId:u==null?void 0:u.message_id},error:c})}throw new Xo("You must provide either an email or phone number.")}catch(o){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(o))return this._returnResult({data:{user:null,session:null},error:o});throw o}}async verifyOtp(e){var r,n;try{let s,i;"options"in e&&(s=(r=e.options)===null||r===void 0?void 0:r.redirectTo,i=(n=e.options)===null||n===void 0?void 0:n.captchaToken);const{data:a,error:o}=await ee(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:s,xform:ir});if(o)throw o;if(!a)throw new Error("An error occurred on token verification.");const l=a.session,u=a.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers(e.type=="recovery"?"PASSWORD_RECOVERY":"SIGNED_IN",l)),this._returnResult({data:{user:u,session:l},error:null})}catch(s){if(J(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}}async signInWithSSO(e){var r,n,s,i,a;try{let o=null,l=null;this.flowType==="pkce"&&([o,l]=await ns(this.storage,this.storageKey));const u=await ee(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(n=(r=e.options)===null||r===void 0?void 0:r.redirectTo)!==null&&n!==void 0?n:void 0}),!((s=e==null?void 0:e.options)===null||s===void 0)&&s.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}
245:null),{skip_http_redirect:!0,code_challenge:o,code_challenge_method:l}),headers:this.headers,xform:iT});return!((i=u.data)===null||i===void 0)&&i.url&&gt()&&!(!((a=e.options)===null||a===void 0)&&a.skipBrowserRedirect)&&window.location.assign(u.data.url),this._returnResult(u)}catch(o){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(o))return this._returnResult({data:null,error:o});throw o}}async reauthenticate(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._reauthenticate()):await this._reauthenticate()}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)throw n;if(!r)throw new st;const{error:s}=await ee(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:r.access_token});return this._returnResult({data:{user:null,session:null},error:s})})}catch(e){if(J(e))return this._returnResult({data:{user:null,session:null},error:e});throw e}}async resend(e){try{const r=`${this.url}/resend`;if("email"in e){const{email:n,type:s,options:i}=e;let a=null,o=null;this.flowType==="pkce"&&([a,o]=await ns(this.storage,this.storageKey));const{error:l}=await ee(this.fetch,"POST",r,{headers:this.headers,body:{email:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken},code_challenge:a,code_challenge_method:o},redirectTo:i==null?void 0:i.emailRedirectTo});return l&&await Ve(this.storage,`${this.storageKey}-code-verifier`),this._returnResult({data:{user:null,session:null},error:l})}else if("phone"in e){const{phone:n,type:s,options:i}=e,{data:a,error:o}=await ee(this.fetch,"POST",r,{headers:this.headers,body:{phone:n,type:s,gotrue_meta_security:{captcha_token:i==null?void 0:i.captchaToken}}});return this._returnResult({data:{user:null,session:null,messageId:a==null?void 0:a.message_id},error:o})}throw new Xo("You must provide either an email or phone number and a type")}catch(r){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async getSession(){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>this._useSession(async e=>e)):await this._useSession(async e=>e)}async _acquireLock(e,r){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const n=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),s=(async()=>(await n,await r()))();return this.pendingInLock.push((async()=>{try{await s}catch{}})()),s}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const n=r();for(this.pendingInLock.push((async()=>{try{await n}catch{}})()),await n;this.pendingInLock.length;){const s=[...this.pendingInLock];await Promise.all(s),this.pendingInLock.splice(0,s.length)}return await n}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const r=await this.__loadSession();return await e(r)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lock!=null&&!this.lockAcquired&&this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const r=await wr(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",r),r!==null&&(this._isValidSession(r)?e=r:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const n=e.expires_at?e.expires_at*1e3-Date.now()<Ic:!1;if(this._debug("#__loadSession()",`session has${n?"":" not"} expired`,"expires_at",e.expires_at),!n){if(this.userStorage){const a=await wr(this.userStorage,this.storageKey+"-user");a!=null&&a.user?e.user=a.user:e.user=Nc()}if(this.storage.isServer&&e.user&&!e.user.__isUserNotAvailableProxy){const a={value:this.suppressGetSessionWarning};e.user=tT(e.user,a),a.value&&(this.suppressGetSessionWarning=!0)}return{data:{session:e},error:null}}const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);if(i){if(!!(e.expires_at&&e.expires_at*1e3>Date.now())){const o=await wr(this.storage,this.storageKey);if(o&&o.refresh_token===e.refresh_token)return this._returnResult({data:{session:e},error:null})}return this._returnResult({data:{session:null},error:i})}return this._returnResult({data:{session:s},error:null})}finally{this._debug("#__loadSession()","end")}}async getUser(e){if(e)return await this._getUser(e);await this.initializePromise;let r;return this.lock!=null?r=await this._acquireLock(this.lockAcquireTimeout,async()=>await this._getUser()):r=await this._getUser(),r.data.user&&(this.suppressGetSessionWarning=!0),r}async _getUser(e){try{return e?await ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:_n}):await this._useSession(async r=>{var n,s,i;const{data:a,error:o}=r;if(o)throw o;return!(!((n=a.session)===null||n===void 0)&&n.access_token)&&!this.hasCustomAuthorizationHeader?{data:{user:null},error:new st}:await ee(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(i=(s=a.session)===null||s===void 0?void 0:s.access_token)!==null&&i!==void 0?i:void 0,xform:_n})})}catch(r){if(J(r))return Yo(r)&&(await this._removeSession(),await Ve(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({data:{user:null},error:r});throw r}}async updateUser(e,r={}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._updateUser(e,r)):await this._updateUser(e,r)}async _updateUser(e,r={}){try{return await this._useSession(async n=>{const{data:s,error:i}=n;if(i)throw i;if(!s.session)throw new st;const a=s.session;let o=null,l=null;this.flowType==="pkce"&&e.email!=null&&([o,l]=await ns(this.storage,this.storageKey));const{data:u,error:c}=await ee(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:r==null?void 0:r.emailRedirectTo,body:Object.assign(Object.assign({}
245,e),{code_challenge:o,code_challenge_method:l}),jwt:a.access_token,xform:_n});if(c)throw c;return a.user=u.user,await this._saveSession(a),await this._notifyAllSubscribers("USER_UPDATED",a),this._returnResult({data:{user:a.user},error:null})})}catch(n){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(n))return this._returnResult({data:{user:null},error:n});throw n}}async setSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._setSession(e)):await this._setSession(e)}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new st;const r=Date.now()/1e3;let n=r,s=!0,i=null;const{payload:a}=el(e.access_token);if(a.exp&&(n=a.exp,s=n<=r),s){const{data:o,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});if(!o)return{data:{user:null,session:null},error:null};i=o}else{const{data:o,error:l}=await this._getUser(e.access_token);if(l)return this._returnResult({data:{user:null,session:null},error:l});i={access_token:e.access_token,refresh_token:e.refresh_token,user:o.user,token_type:"bearer",expires_in:n-r,expires_at:n},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return this._returnResult({data:{user:i.user,session:i},error:null})}catch(r){if(J(r))return this._returnResult({data:{session:null,user:null},error:r});throw r}}async refreshSession(e){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._refreshSession(e)):await this._refreshSession(e)}async _refreshSession(e){try{return await this._useSession(async r=>{var n;if(!e){const{data:a,error:o}=r;if(o)throw o;e=(n=a.session)!==null&&n!==void 0?n:void 0}if(!(e!=null&&e.refresh_token))throw new st;const{data:s,error:i}=await this._callRefreshToken(e.refresh_token);return i?this._returnResult({data:{user:null,session:null},error:i}):s?this._returnResult({data:{user:s.user,session:s},error:null}):this._returnResult({data:{user:null,session:null},error:null})})}catch(r){if(J(r))return this._returnResult({data:{user:null,session:null},error:r});throw r}}async _getSessionFromURL(e,r){var n;try{if(!gt())throw new Qo("No browser detected.");if(e.error||e.error_description||e.error_code)throw new Qo(e.error_description||"Error in URL with unspecified error_description",{error:e.error||"unspecified_error",code:e.error_code||"unspecified_code"});switch(r){case"implicit":if(this.flowType==="pkce")throw new ug("Not a valid PKCE flow url.");break;case"pkce":if(this.flowType==="implicit")throw new Qo("Not a valid implicit grant flow url.");break;default:}if(r==="pkce"){if(this._debug("#_initialize()","begin","is PKCE flow",!0),!e.code)throw new ug("No code detected.");const{data:w,error:h}=await this._exchangeCodeForSession(e.code);if(h)throw h;const p=new URL(window.location.href);return p.searchParams.delete("code"),window.history.replaceState(window.history.state,"",p.toString()),{data:{session:w.session,redirectType:(n=w.redirectType)!==null&&n!==void 0?n:null},error:null}}const{provider_token:s,provider_refresh_token:i,access_token:a,refresh_token:o,expires_in:l,expires_at:u,token_type:c}=e;if(!a||!l||!o||!c)throw new Qo("No session defined in URL");const d=Math.round(Date.now()/1e3),f=parseInt(l);let m=d+f;u&&(m=parseInt(u));const y=m-d;y*1e3<=Kr&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${y}s, should have been closer to ${f}s`);const g=m-f;d-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,m,d):d-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clock for skew",g,m,d);const{data:b,error:_}=await this._getUser(a);if(_)throw _;const v={provider_token:s,provider_refresh_token:i,access_token:a,expires_in:f,expires_at:m,refresh_token:o,token_type:c,user:b.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),this._returnResult({data:{session:v,redirectType:e.type},error:null})}catch(s){if(J(s))return this._returnResult({data:{session:null,redirectType:null},error:s});throw s}}_isImplicitGrantCallback(e){return typeof this.detectSessionInUrl=="function"?this.detectSessionInUrl(new URL(window.location.href),e):!!(e.access_token||e.error||e.error_description||e.error_code)}
245async _isPKCECallback(e){const r=await wr(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&r)}async signOut(e={scope:"global"}){return await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>await this._signOut(e)):await this._signOut(e)}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async r=>{var n;const{data:s,error:i}=r;if(i&&!Yo(i))return this._returnResult({error:i});const a=(n=s.session)===null||n===void 0?void 0:n.access_token;if(a){const{error:o}=await this.admin.signOut(a,e);if(o&&!(O2(o)&&(o.status===404||o.status===401||o.status===403)||Yo(o)))return this._returnResult({error:o})}return e!=="others"&&(await this._removeSession(),await Ve(this.storage,`${this.storageKey}-code-verifier`)),this._returnResult({error:null})})}onAuthStateChange(e){const r=B2(),n={id:r,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",r),this.stateChangeEmitters.delete(r)}};return this._debug("#onAuthStateChange()","registered callback with id",r),this.stateChangeEmitters.set(r,n),(async()=>(await this.initializePromise,this.lock!=null?await this._acquireLock(this.lockAcquireTimeout,async()=>{this._emitInitialSession(r)}):await this._emitInitialSession(r)))(),{data:{subscription:n}}}async _emitInitialSession(e){return await this._useSession(async r=>{var n,s;try{const{data:{session:i},error:a}=r;if(a)throw a;await((n=this.stateChangeEmitters.get(e))===null||n===void 0?void 0:n.callback("INITIAL_SESSION",i)),this._debug("INITIAL_SESSION","callback id",e,"session",i)}catch(i){await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",i),Yo(i)?console.warn(i):console.error(i)}})}async resetPasswordForEmail(e,r={}){let n=null,s=null;this.flowType==="pkce"&&([n,s]=await ns(this.storage,this.storageKey,!0));try{return await ee(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:n,code_challenge_method:s,gotrue_meta_security:{captcha_token:r.captchaToken}},headers:this.headers,redirectTo:r.redirectTo})}catch(i){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(i))return this._returnResult({data:null,error:i});throw i}}async getUserIdentities(){var e;try{const{data:r,error:n}=await this.getUser();if(n)throw n;return this._returnResult({data:{identities:(e=r.user.identities)!==null&&e!==void 0?e:[]},error:null})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async linkIdentity(e){return"token"in e?this.linkIdentityIdToken(e):this.linkIdentityOAuth(e)}async linkIdentityOAuth(e){var r;try{const{data:n,error:s}=await this._useSession(async i=>{var a,o,l,u,c;const{data:d,error:f}=i;if(f)throw f;const m=await this._getUrlForProvider(`${this.url}/user/identities/authorize`,e.provider,{redirectTo:(a=e.options)===null||a===void 0?void 0:a.redirectTo,scopes:(o=e.options)===null||o===void 0?void 0:o.scopes,queryParams:(l=e.options)===null||l===void 0?void 0:l.queryParams,skipBrowserRedirect:!0});return await ee(this.fetch,"GET",m,{headers:this.headers,jwt:(c=(u=d.session)===null||u===void 0?void 0:u.access_token)!==null&&c!==void 0?c:void 0})});if(s)throw s;return gt()&&!(!((r=e.options)===null||r===void 0)&&r.skipBrowserRedirect)&&window.location.assign(n==null?void 0:n.url),this._returnResult({data:{provider:e.provider,url:n==null?void 0:n.url},error:null})}catch(n){if(J(n))return this._returnResult({data:{provider:e.provider,url:null},error:n});throw n}}async linkIdentityIdToken(e){return await this._useSession(async r=>{var n;try{const{error:s,data:{session:i}}=r;if(s)throw s;const{options:a,provider:o,token:l,access_token:u,nonce:c}=e,d=await ee(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,jwt:(n=i==null?void 0:i.access_token)!==null&&n!==void 0?n:void 0,body:{provider:o,id_token:l,access_token:u,nonce:c,link_identity:!0,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:ir}),{data:f,error:m}=d;return m?this._returnResult({data:{user:null,session:null},error:m}):!f||!f.session||!f.user?this._returnResult({data:{user:null,session:null},error:new zs}):(f.session&&(await this._saveSession(f.session),await this._notifyAllSubscribers("USER_UPDATED",f.session)),this._returnResult({data:f,error:m}))}catch(s){if(await Ve(this.storage,`${this.storageKey}-code-verifier`),J(s))return this._returnResult({data:{user:null,session:null},error:s});throw s}})}async unlinkIdentity(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:a}=r;if(a)throw a;
245return await ee(this.fetch,"DELETE",`${this.url}/user/identities/${e.identity_id}`,{headers:this.headers,jwt:(s=(n=i.session)===null||n===void 0?void 0:n.access_token)!==null&&s!==void 0?s:void 0})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _refreshAccessToken(e){const r="#_refreshAccessToken()";this._debug(r,"begin");try{const n=Date.now();return await H2(async s=>(s>0&&await W2(200*Math.pow(2,s-1)),this._debug(r,"refreshing attempt",s),await ee(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:ir})),(s,i)=>{const a=200*Math.pow(2,s);return i&&cg(i)&&Date.now()+a-n<Kr})}catch(n){if(this._debug(r,"error",n),J(n))return this._returnResult({data:{session:null,user:null},error:n});throw n}finally{this._debug(r,"end")}}_isValidSession(e){return typeof e=="object"&&e!==null&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,r){const n=await this._getUrlForProvider(`${this.url}/authorize`,e,{redirectTo:r.redirectTo,scopes:r.scopes,queryParams:r.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",r,"url",n),gt()&&!r.skipBrowserRedirect&&window.location.assign(n),{data:{provider:e,url:n},error:null}}async _recoverAndRefresh(){var e,r;const n="#_recoverAndRefresh()";this._debug(n,"begin");try{const s=await wr(this.storage,this.storageKey);if(s&&this.userStorage){let a=await wr(this.userStorage,this.storageKey+"-user");!this.storage.isServer&&Object.is(this.storage,this.userStorage)&&!a&&(a={user:s.user},await Gs(this.userStorage,this.storageKey+"-user",a)),s.user=(e=a==null?void 0:a.user)!==null&&e!==void 0?e:Nc()}else if(s&&!s.user&&!s.user){const a=await wr(this.storage,this.storageKey+"-user");a&&(a!=null&&a.user)?(s.user=a.user,await Ve(this.storage,this.storageKey+"-user"),await Gs(this.storage,this.storageKey,s)):s.user=Nc()}if(this._debug(n,"session from storage",s),!this._isValidSession(s)){this._debug(n,"session is not valid"),s!==null&&await this._removeSession();return}const i=((r=s.expires_at)!==null&&r!==void 0?r:1/0)*1e3-Date.now()<Ic;if(this._debug(n,`session has${i?"":" not"} expired with margin of ${Ic}s`),i){if(this.autoRefreshToken&&s.refresh_token){const{error:a}=await this._callRefreshToken(s.refresh_token);a&&(L2(a)?this._debug(n,"refresh discarded by commit guard",a):this._debug(n,"refresh failed",a))}}else if(s.user&&s.user.__isUserNotAvailableProxy===!0)try{const{data:a,error:o}=await this._getUser(s.access_token);!o&&(a!=null&&a.user)?(s.user=a.user,await this._saveSession(s),await this._notifyAllSubscribers("SIGNED_IN",s)):this._debug(n,"could not get user data, skipping SIGNED_IN notification")}catch(a){console.error("Error getting user data:",a),this._debug(n,"error getting user data, skipping SIGNED_IN notification",a)}else await this._notifyAllSubscribers("SIGNED_IN",s)}catch(s){this._debug(n,"error",s),console.error(s);return}finally{this._debug(n,"end")}}async _callRefreshToken(e){var r,n;if(!e)throw new st;if(this.refreshingDeferred)return this.refreshingDeferred.promise;if(this.lastRefreshFailure&&this.lastRefreshFailure.refreshToken===e&&Date.now()<this.lastRefreshFailure.expiresAt)return this._debug("#_callRefreshToken()","returning cached failure (cooldown active)"),this.lastRefreshFailure.result;const s="#_callRefreshToken()";this._debug(s,"begin");try{this.refreshingDeferred=new Wu;const i=await wr(this.storage,this.storageKey),{data:a,error:o}=await this._refreshAccessToken(e);if(o)throw o;if(!a.session)throw new st;const l=await wr(this.storage,this.storageKey);if(i!==null&&(l===null||l.refresh_token!==i.refresh_token)){this._debug(s,"commit guard: storage changed since refresh started, discarding rotated tokens",{startedWith:"present",nowHolds:l?"replaced":"cleared"});const f={data:null,error:new dg};return this.refreshingDeferred.resolve(f),f}const c=this._sessionRemovalEpoch;if(await this._saveSession(a.session),this._sessionRemovalEpoch!==c){this._debug(s,"commit guard (post-save): _removeSession ran during _saveSession, und
245oing write"),await Ve(this.storage,this.storageKey),this.userStorage&&await Ve(this.userStorage,this.storageKey+"-user");const f={data:null,error:new dg};return this.refreshingDeferred.resolve(f),f}await this._notifyAllSubscribers("TOKEN_REFRESHED",a.session);const d={data:a.session,error:null};return this.lastRefreshFailure=null,this.refreshingDeferred.resolve(d),d}catch(i){if(this._debug(s,"error",i),J(i)){const a={data:null,error:i};if(!cg(i)){const o=await wr(this.storage,this.storageKey);!!(o!=null&&o.expires_at&&o.expires_at*1e3>Date.now())?this._debug(s,"proactive refresh failed, access token still valid — preserving session"):await this._removeSession()}return this.lastRefreshFailure={refreshToken:e,result:a,expiresAt:Date.now()+k2},(r=this.refreshingDeferred)===null||r===void 0||r.resolve(a),a}throw(n=this.refreshingDeferred)===null||n===void 0||n.reject(i),i}finally{this.refreshingDeferred=null,this._debug(s,"end")}}async _notifyAllSubscribers(e,r,n=!0){const s=`#_notifyAllSubscribers(${e})`;this._debug(s,"begin",r,`broadcast = ${n}`);try{this.broadcastChannel&&n&&this.broadcastChannel.postMessage({event:e,session:r});const i=[],a=Array.from(this.stateChangeEmitters.values()).map(async o=>{try{await o.callback(e,r)}catch(l){i.push(l)}});if(await Promise.all(a),i.length>0){for(let o=0;o<i.length;o+=1)console.error(i[o]);throw i[0]}}finally{this._debug(s,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.suppressGetSessionWarning=!0,await Ve(this.storage,`${this.storageKey}-code-verifier`);const r=Object.assign({},e),n=r.user&&r.user.__isUserNotAvailableProxy===!0;if(this.userStorage){!n&&r.user&&await Gs(this.userStorage,this.storageKey+"-user",{user:r.user});const s=Object.assign({},r);delete s.user;const i=gg(s);await Gs(this.storage,this.storageKey,i)}else{const s=gg(r);await Gs(this.storage,this.storageKey,s)}}async _removeSession(){this._sessionRemovalEpoch+=1,this._debug("#_removeSession()"),this.lastRefreshFailure=null,this.suppressGetSessionWarning=!1,await Ve(this.storage,this.storageKey),await Ve(this.storage,this.storageKey+"-code-verifier"),await Ve(this.storage,this.storageKey+"-user"),this.userStorage&&await Ve(this.userStorage,this.storageKey+"-user"),await this._notifyAllSubscribers("SIGNED_OUT",null)}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");const e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&gt()&&(window!=null&&window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(r){console.error("removing visibilitychange callback failed",r)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");const e=setInterval(()=>this._autoRefreshTokenTick(),Kr);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e);const r=setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0);this.autoRefreshTickTimeout=r,r&&typeof r=="object"&&typeof r.unref=="function"?r.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(r)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e);const r=this.autoRefreshTickTimeout;this.autoRefreshTickTimeout=null,r&&clearTimeout(r)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async dispose(){var e;this._removeVisibilityChangedCallback(),await this._stopAutoRefresh(),(e=this.broadcastChannel)===null||e===void 0||e.close(),this.broadcastChannel=null,this.stateChangeEmitters.clear()}async _autoRefreshTokenTick(){if(this._debug("#_autoRefreshTokenTick()","begin"),this.lock!=null){try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Kr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Kr}ms, refresh threshold is ${ua} ticks`),s<=ua&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e instanceof uT)this._debug("auto refresh token tick lock not available");else throw e}return}if(this.refreshingDeferred!==null){this._debug("#_autoRefreshTokenTick()","refresh already in flight, skipping");return}try{const e=Date.now();try{await this._useSession(async r=>{const{data:{session:n}}=r;if(!n||!n.refresh_token||!n.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const s=Math.floor((n.expires_at*1e3-e)/Kr);this._debug("#_autoRefreshTokenTick()",`access token expires in ${s} ticks, a tick lasts ${Kr}ms, refresh threshold is ${ua} ticks`),s<=ua&&await this._callRefreshToken(n.refresh_token)})}catch(r){console.error("Auto refresh tick failed with error. This is likely a transient error.",r)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!gt()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>{try{await this._onVisibilityChanged(!1)}catch(e){this._debug("#visibilityChangedCallback","error",e)}},window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const r=`#_onVisibilityChanged(${e})`;if(this._debug(r,"visibilityState",document.visibilityState),document.visibilityState==="visible"){if(this.autoRefreshToken&&this._startAutoRefresh(),!e)if(await this.initializePromise,this.lock!=null)await this._acquireLock(this.lockAcquireTimeout,async()=>
245{if(document.visibilityState!=="visible"){this._debug(r,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()});else{if(document.visibilityState!=="visible"){this._debug(r,"visibilityState is no longer visible, skipping recovery");return}await this._recoverAndRefresh()}}else document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,r,n){const s=[`provider=${encodeURIComponent(r)}`];if(n!=null&&n.redirectTo&&s.push(`redirect_to=${encodeURIComponent(n.redirectTo)}`),n!=null&&n.scopes&&s.push(`scopes=${encodeURIComponent(n.scopes)}`),this.flowType==="pkce"){const[i,a]=await ns(this.storage,this.storageKey),o=new URLSearchParams({code_challenge:`${encodeURIComponent(i)}`,code_challenge_method:`${encodeURIComponent(a)}`});s.push(o.toString())}if(n!=null&&n.queryParams){const i=new URLSearchParams(n.queryParams);s.push(i.toString())}return n!=null&&n.skipBrowserRedirect&&s.push(`skip_http_redirect=${n.skipBrowserRedirect}`),`${e}?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async r=>{var n;const{data:s,error:i}=r;return i?this._returnResult({data:null,error:i}):await ee(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(n=s==null?void 0:s.session)===null||n===void 0?void 0:n.access_token})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _enroll(e){try{return await this._useSession(async r=>{var n,s;const{data:i,error:a}=r;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({friendly_name:e.friendlyName,factor_type:e.factorType},e.factorType==="phone"?{phone:e.phone}:e.factorType==="totp"?{issuer:e.issuer}:{}),{data:l,error:u}=await ee(this.fetch,"POST",`${this.url}/factors`,{body:o,headers:this.headers,jwt:(n=i==null?void 0:i.session)===null||n===void 0?void 0:n.access_token});return u?this._returnResult({data:null,error:u}):(e.factorType==="totp"&&l.type==="totp"&&(!((s=l==null?void 0:l.totp)===null||s===void 0)&&s.qr_code)&&(l.totp.qr_code=`data:image/svg+xml;utf-8,${l.totp.qr_code}`),this._returnResult({data:l,error:null}))})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _verify(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=Object.assign({challenge_id:e.challengeId},"webauthn"in e?{webauthn:Object.assign(Object.assign({},e.webauthn),{credential_response:e.webauthn.type==="create"?Sg(e.webauthn.credential_response):kg(e.webauthn.credential_response)})}:{code:e.code}),{data:l,error:u}=await ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:o,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});return u?this._returnResult({data:null,error:u}):(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+l.expires_in},l)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",l),this._returnResult({data:l,error:u}))})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challenge(e){const r=async()=>{try{return await this._useSession(async n=>{var s;const{data:i,error:a}=n;if(a)return this._returnResult({data:null,error:a});const o=await ee(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{body:e,headers:this.headers,jwt:(s=i==null?void 0:i.session)===null||s===void 0?void 0:s.access_token});if(o.error)return o;const{data:l}=o;if(l.type!=="webauthn")return{data:l,error:null};switch(l.webauthn.type){case"create":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:xg(l.webauthn.credential_options.publicKey)})})}),error:null};case"request":return{data:Object.assign(Object.assign({},l),{webauthn:Object.assign(Object.assign({},l.webauthn),{credential_options:Object.assign(Object.assign({},l.webauthn.credential_options),{publicKey:bg(l.webauthn.credential_options.publicKey)})})}),error:null}}})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}};return this.lock!=null?this._acquireLock(this.lockAcquireTimeout,r):r()}async _challengeAndVerify(e){const{data:r,error:n}=await this._challenge({factorId:e.factorId});return n?this._returnResult({data:null,error:n}):await this._verify({factorId:e.factorId,challengeId:r.id,code:e.code})}async _listFactors(){var e;const{data:{user:r},error:n}=await this.getUser();if(n)return{data:null,error:n};const s={all:[],phone:[],totp:[],webauthn:[]};for(const i of(e=r==null?void 0:r.factors)!==null&&e!==void 0?e:[])s.all.push(i),i.status==="verified"&&s[i.factor_type].push(i);return{data:s,error:null}}async _getAuthenticatorAssuranceLevel(e){var r,n,s,i;if(e)try{const{payload:m}=el(e);let y=null;m.aal&&(y=m.aal);let g=y;const{data:{user:b},error:_}=await this.getUser(e);if(_)return this._returnResult({data:null,error:_});((n=(r=b==null?void 0:b.factors)===null||r===void 0?void 0:r.filter(h=>h.status==="verified"))!==null&&n!==void 0?n:[]).length>0&&(g="aal2");const w=m.amr||[];return{data:{currentLevel:y,nextLevel:g,currentAuthenticationMethods:w},error:null}}catch(m){if(J(m))return this._returnResult({data:null,error:m});throw m}const{data:{session:a},error:o}
245=await this.getSession();if(o)return this._returnResult({data:null,error:o});if(!a)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const{payload:l}=el(a.access_token);let u=null;l.aal&&(u=l.aal);let c=u;((i=(s=a.user.factors)===null||s===void 0?void 0:s.filter(m=>m.status==="verified"))!==null&&i!==void 0?i:[]).length>0&&(c="aal2");const f=l.amr||[];return{data:{currentLevel:u,nextLevel:c,currentAuthenticationMethods:f},error:null}}async _getAuthorizationDetails(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?await ee(this.fetch,"GET",`${this.url}/oauth/authorizations/${e}`,{headers:this.headers,jwt:n.access_token,xform:i=>({data:i,error:null})}):this._returnResult({data:null,error:new st})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _approveAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new st});const a=await ee(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"approve"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&gt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async _denyAuthorization(e,r){try{return await this._useSession(async n=>{const{data:{session:s},error:i}=n;if(i)return this._returnResult({data:null,error:i});if(!s)return this._returnResult({data:null,error:new st});const a=await ee(this.fetch,"POST",`${this.url}/oauth/authorizations/${e}/consent`,{headers:this.headers,jwt:s.access_token,body:{action:"deny"},xform:o=>({data:o,error:null})});return a.data&&a.data.redirect_url&&gt()&&!(r!=null&&r.skipBrowserRedirect)&&window.location.assign(a.data.redirect_url),a})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async _listOAuthGrants(){try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;return n?this._returnResult({data:null,error:n}):r?await ee(this.fetch,"GET",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:r.access_token,xform:s=>({data:s,error:null})}):this._returnResult({data:null,error:new st})})}catch(e){if(J(e))return this._returnResult({data:null,error:e});throw e}}async _revokeOAuthGrant(e){try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;return s?this._returnResult({data:null,error:s}):n?(await ee(this.fetch,"DELETE",`${this.url}/user/oauth/grants`,{headers:this.headers,jwt:n.access_token,query:{client_id:e.clientId},noResolveJson:!0}),{data:{},error:null}):this._returnResult({data:null,error:new st})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async fetchJwk(e,r={keys:[]}){let n=r.keys.find(o=>o.kid===e);if(n)return n;const s=Date.now();if(n=this.jwks.keys.find(o=>o.kid===e),n&&this.jwks_cached_at+A2>s)return n;const{data:i,error:a}=await ee(this.fetch,"GET",`${this.url}/.well-known/jwks.json`,{headers:this.headers});if(a)throw a;return!i.keys||i.keys.length===0||(this.jwks=i,this.jwks_cached_at=s,n=i.keys.find(o=>o.kid===e),!n)?null:n}async getClaims(e,r={}){try{let n=e;if(!n){const{data:m,error:y}
245=await this.getSession();if(y||!m.session)return this._returnResult({data:null,error:y});n=m.session.access_token}const{header:s,payload:i,signature:a,raw:{header:o,payload:l}}=el(n);if(!(r!=null&&r.allowExpired))try{X2(i.exp)}catch(m){throw new Yl(m instanceof Error?m.message:"JWT validation failed")}const u=!s.alg||s.alg.startsWith("HS")||!s.kid||!("crypto"in globalThis&&"subtle"in globalThis.crypto)?null:await this.fetchJwk(s.kid,r!=null&&r.keys?{keys:r.keys}:r==null?void 0:r.jwks);if(!u){const{error:m}=await this.getUser(n);if(m)throw m;return{data:{claims:i,header:s,signature:a},error:null}}const c=Q2(s.alg),d=await crypto.subtle.importKey("jwk",u,c,!0,["verify"]);if(!await crypto.subtle.verify(c,d,a,z2(`${o}.${l}`)))throw new Yl("Invalid JWT signature");return{data:{claims:i,header:s,signature:a},error:null}}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async signInWithPasskey(e){var r,n,s;_r(this.experimental);try{if(!eu())return this._returnResult({data:null,error:new Tr("Browser does not support WebAuthn",null)});const{data:i,error:a}=await this._startPasskeyAuthentication({options:{captchaToken:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}});if(a||!i)return this._returnResult({data:null,error:a});const o=bg(i.options),l=(s=(n=e==null?void 0:e.options)===null||n===void 0?void 0:n.signal)!==null&&s!==void 0?s:lh.createNewAbortSignal(),{data:u,error:c}=await Mw({publicKey:o,signal:l});if(c||!u)return this._returnResult({data:null,error:c??new Tr("WebAuthn ceremony failed",null)});const d=kg(u);return this._verifyPasskeyAuthentication({challengeId:i.challenge_id,credential:d})}catch(i){if(J(i))return this._returnResult({data:null,error:i});throw i}}async registerPasskey(e){var r,n;_r(this.experimental);try{if(!eu())return this._returnResult({data:null,error:new Tr("Browser does not support WebAuthn",null)});const{data:s,error:i}=await this._startPasskeyRegistration();if(i||!s)return this._returnResult({data:null,error:i});const a=xg(s.options),o=(n=(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.signal)!==null&&n!==void 0?n:lh.createNewAbortSignal(),{data:l,error:u}=await jw({publicKey:a,signal:o});if(u||!l)return this._returnResult({data:null,error:u??new Tr("WebAuthn ceremony failed",null)});const c=Sg(l);return this._verifyPasskeyRegistration({challengeId:s.challenge_id,credential:c})}catch(s){if(J(s))return this._returnResult({data:null,error:s});throw s}}async _startPasskeyRegistration(){_r(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new st});const{data:s,error:i}=await ee(this.fetch,"POST",`${this.url}/passkeys/registration/options`,{headers:this.headers,jwt:r.access_token,body:{}});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(J(e))return this._returnResult({data:null,error:e});throw e}}async _verifyPasskeyRegistration(e){_r(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new st});const{data:i,error:a}=await ee(this.fetch,"POST",`${this.url}/passkeys/registration/verify`,{headers:this.headers,jwt:n.access_token,body:{challenge_id:e.challengeId,credential:e.credential}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _startPasskeyAuthentication(e){var r;_r(this.experimental);try{const{data:n,error:s}=await ee(this.fetch,"POST",`${this.url}/passkeys/authentication/options`,{headers:this.headers,body:{gotrue_meta_security:{captcha_token:(r=e==null?void 0:e.options)===null||r===void 0?void 0:r.captchaToken}}});return s?this._returnResult({data:null,error:s}):this._returnResult({data:n,error:null})}catch(n){if(J(n))return this._returnResult({data:null,error:n});throw n}}async _verifyPasskeyAuthentication(e){_r(this.experimental);try{const{data:r,error:n}=await ee(this.fetch,"POST",`${this.url}/passkeys/authentication/verify`,{headers:this.headers,body:{challenge_id:e.challengeId,credential:e.credential},xform:ir});return n?this._returnResult({data:null,error:n}):(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),this._returnResult({data:r,error:null}))}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _listPasskeys(){_r(this.experimental);try{return await this._useSession(async e=>{const{data:{session:r},error:n}=e;if(n)return this._returnResult({data:null,error:n});if(!r)return this._returnResult({data:null,error:new st});const{data:s,error:i}=await ee(this.fetch,"GET",`${this.url}/passkeys`,{headers:this.headers,jwt:r.access_token,xform:a=>({data:a,error:null})});return i?this._returnResult({data:null,error:i}):this._returnResult({data:s,error:null})})}catch(e){if(J(e))return this._returnResult({data:null,error:e});throw e}}async _updatePasskey(e){_r(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new st});const{data:i,error:a}=await ee(this.fetch,"PATCH",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,body:{friendly_name:e.friendlyName}});return a?this._returnResult({data:null,error:a}):this._returnResult({data:i,error:null})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}async _deletePasskey(e){_r(this.experimental);try{return await this._useSession(async r=>{const{data:{session:n},error:s}=r;if(s)return this._returnResult({data:null,error:s});if(!n)return this._returnResult({data:null,error:new st});const{error:i}
245=await ee(this.fetch,"DELETE",`${this.url}/passkeys/${e.passkeyId}`,{headers:this.headers,jwt:n.access_token,noResolveJson:!0});return i?this._returnResult({data:null,error:i}):this._returnResult({data:null,error:null})})}catch(r){if(J(r))return this._returnResult({data:null,error:r});throw r}}}so.nextInstanceID={};const ST=so,kT="2.110.0";let ca="",ru;if(typeof Deno<"u"){var jc;ca="deno",ru=(jc=Deno.version)===null||jc===void 0?void 0:jc.deno}else if(typeof document<"u")ca="web";else if(typeof navigator<"u"&&navigator.product==="ReactNative")ca="react-native";else{var Mc;ca="node",ru=typeof process<"u"?(Mc=process.version)===null||Mc===void 0?void 0:Mc.replace(/^v/,""):void 0}const Dw=[`runtime=${ca}`];ru&&Dw.push(`runtime-version=${ru}`);const ET={"X-Client-Info":`supabase-js/${kT}; ${Dw.join("; ")}`},TT={headers:ET},CT={schema:"public"},PT={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},AT={},RT={enabled:!1,respectSamplingDecision:!0};function OT(t,e,r,n){function s(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function o(c){try{u(n.next(c))}catch(d){a(d)}}function l(c){try{u(n.throw(c))}catch(d){a(d)}}function u(c){c.done?i(c.value):s(c.value).then(o,l)}u((n=n.apply(t,[])).next())})}let Dc=null;const IT="@opentelemetry/api";function NT(){return Dc===null&&(Dc=import(IT).catch(()=>null)),Dc}function LT(){return OT(this,void 0,void 0,function*(){try{const t=yield NT();if(!t||!t.propagation||!t.context)return null;const e={};t.propagation.inject(t.context.active(),e);const r=e.traceparent;return r?{traceparent:r,tracestate:e.tracestate,baggage:e.baggage}:null}catch{return null}})}function jT(t){if(!t||typeof t!="string")return null;const e=t.split("-");if(e.length!==4)return null;const[r,n,s,i]=e;if(r.length!==2||n.length!==32||s.length!==16||i.length!==2)return null;const a=/^[0-9a-f]+$/i;return!a.test(r)||!a.test(n)||!a.test(s)||!a.test(i)||n==="00000000000000000000000000000000"||s==="0000000000000000"?null:{version:r,traceId:n,parentId:s,traceFlags:i,isSampled:(parseInt(i,16)&1)===1}}function MT(t,e){if(!t||!e||e.length===0)return!1;let r;if(t instanceof URL)r=t;else try{r=new URL(t)}catch{return!1}for(const n of e)try{if(typeof n=="string"){if(DT(r.hostname,n))return!0}else if(n instanceof RegExp){if(n.test(r.hostname))return!0}else if(typeof n=="function"&&n(r))return!0}catch{continue}return!1}function DT(t,e){if(e===t)return!0;if(e.startsWith("*.")){const r=e.slice(2);if(t.endsWith(r)&&(t===r||t.endsWith("."+r)))return!0}return!1}function $T(t){const e=[];try{const r=new URL(t);e.push(r.hostname)}catch{}return e.push("*.supabase.co","*.supabase.in"),e.push("localhost","127.0.0.1","[::1]"),e}function io(t){"@babel/helpers - typeof";return io=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},io(t)}function zT(t,e){if(io(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e);if(io(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function UT(t){var e=zT(t,"string");return io(e)=="symbol"?e:e+""}function BT(t,e,r){return(e=UT(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function Eg(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 Ue(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Eg(Object(r),!0).forEach(function(n){BT(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Eg(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}const FT=t=>t?(...e)=>t(...e):(...e)=>fetch(...e),VT=()=>Headers,WT=(t,e,r,n,s)=>{const i=FT(n),a=VT(),o=(s==null?void 0:s.enabled)===!0,l=(s==null?void 0:s.respectSamplingDecision)!==!1,u=o?$T(e):null;return async(c,d)=>{var f;const m=(f=await r())!==null&&f!==void 0?f:t;let y=new a(d==null?void 0:d.headers);if(y.has("apikey")||y.set("apikey",t),y.has("Authorization")||y.set("Authorization",`Bearer ${m}`),u){const g=await HT(c,u,l);g&&(g.traceparent&&!y.has("traceparent")&&y.set("traceparent",g.traceparent),g.tracestate&&!y.has("tracestate")&&y.set("tracestate",g.tracestate),g.baggage&&!y.has("baggage")&&y.set("baggage",g.baggage))}return i(c,Ue(Ue({},d),{},{headers:y}))}};async function HT(t,e,r){if(!MT(typeof t=="string"||t instanceof URL?t:t.url,e))return null;const n=await LT();if(!n||!n.traceparent)return null;if(r){const s=jT(n.traceparent);if(s&&!s.isSampled)return null}return n}function Tg(t){return typeof t=="boolean"?{enabled:t}:t}function GT(t){return t.endsWith("/")?t:t+"/"}function qT(t,e){var r,n,s,i,a,o;const{db:l,auth:u,realtime:c,global:d}=t,{db:f,auth:m,realtime:y,global:g}=e,b=Tg(t.tracePropagation),_=Tg(e.tracePropagation),v={db:Ue(Ue({},f),l),auth:Ue(Ue({},m),u),realtime:Ue(Ue({},y),c),storage:{},global:Ue(Ue(Ue({},g),d),{},{headers:Ue(Ue({},(r=g==null?void 0:g.headers)!==null&&r!==void 0?r:{}),(n=d==null?void 0:d.headers)!==null&&n!==void 0?n:{})}),tracePropagation:{enabled:(s=(i=b==null?void 0:b.enabled)!==null&&i!==void 0?i:_==null?void 0:_.enabled)!==null&&s!==void 0?s:!1,respectSamplingDecision:(a=(o=b==null?void 0:b.respectSamplingDecision)!==null&&o!==void 0?o:_==null?void 0:_.respectSamplingDecision)!==null&&a!==void 0?a:!0},accessToken:async()=>""};return t.accessToken?v.accessToken=t.accessToken:delete v.accessToken,v}function KT(t){const e=t==null?void 0:t.trim();if(!e)throw new Error("supabaseUrl is required.");
245if(!e.match(/^https?:\/\//i))throw new Error("Invalid supabaseUrl: Must be a valid HTTP or HTTPS URL.");try{return new URL(GT(e))}catch{throw Error("Invalid supabaseUrl: Provided URL is malformed.")}}var JT=class extends ST{constructor(t){super(t)}},ZT=class{constructor(t,e,r){var n,s;this.supabaseUrl=t,this.supabaseKey=e;const i=KT(t);if(!e)throw new Error("supabaseKey is required.");this.realtimeUrl=new URL("realtime/v1",i),this.realtimeUrl.protocol=this.realtimeUrl.protocol.replace("http","ws"),this.authUrl=new URL("auth/v1",i),this.storageUrl=new URL("storage/v1",i),this.functionsUrl=new URL("functions/v1",i);const a=`sb-${i.hostname.split(".")[0]}-auth-token`,o={db:CT,realtime:AT,auth:Ue(Ue({},PT),{},{storageKey:a}),global:TT,tracePropagation:RT},l=qT(r??{},o);if(this.settings=l,this.storageKey=(n=l.auth.storageKey)!==null&&n!==void 0?n:"",this.headers=(s=l.global.headers)!==null&&s!==void 0?s:{},l.accessToken)this.accessToken=l.accessToken,this.auth=new Proxy({},{get:(c,d)=>{throw new Error(`@supabase/supabase-js: Supabase Client is configured with the accessToken option, accessing supabase.auth.${String(d)} is not possible`)}});else{var u;this.auth=this._initSupabaseAuthClient((u=l.auth)!==null&&u!==void 0?u:{},this.headers,l.global.fetch)}this.fetch=WT(e,t,this._getAccessToken.bind(this),l.global.fetch,l.tracePropagation),this.realtime=this._initRealtimeClient(Ue({headers:this.headers,accessToken:this._getAccessToken.bind(this),fetch:this.fetch},l.realtime)),this.accessToken&&Promise.resolve(this.accessToken()).then(c=>this.realtime.setAuth(c)).catch(c=>console.warn("Failed to set initial Realtime auth token:",c)),this.rest=new iE(new URL("rest/v1",i).href,{headers:this.headers,schema:l.db.schema,fetch:this.fetch,timeout:l.db.timeout,urlLengthLimit:l.db.urlLengthLimit}),this.storage=new S2(this.storageUrl.href,this.headers,this.fetch,r==null?void 0:r.storage),l.accessToken||this._listenForAuthEvents()}get functions(){return new Zk(this.functionsUrl.href,{headers:this.headers,customFetch:this.fetch})}from(t){return this.rest.from(t)}schema(t){return this.rest.schema(t)}rpc(t,e={},r={head:!1,get:!1,count:void 0}){return this.rest.rpc(t,e,r)}channel(t,e={config:{}}){return this.realtime.channel(t,e)}getChannels(){return this.realtime.getChannels()}removeChannel(t){return this.realtime.removeChannel(t)}removeAllChannels(){return this.realtime.removeAllChannels()}async _getAccessToken(){var t=this,e,r;if(t.accessToken)return await t.accessToken();const{data:n}=await t.auth.getSession();return(e=(r=n.session)===null||r===void 0?void 0:r.access_token)!==null&&e!==void 0?e:t.supabaseKey}_initSupabaseAuthClient({autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,storageKey:i,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,lockAcquireTimeout:d,skipAutoInitialize:f},m,y){const g={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new JT({url:this.authUrl.href,headers:Ue(Ue({},g),m),storageKey:i,autoRefreshToken:t,persistSession:e,detectSessionInUrl:r,storage:n,userStorage:s,flowType:a,lock:o,debug:l,throwOnError:u,experimental:c,fetch:y,lockAcquireTimeout:d,skipAutoInitialize:f,hasCustomAuthorizationHeader:Object.keys(this.headers).some(b=>b.toLowerCase()==="authorization")})}_initRealtimeClient(t){return new qE(this.realtimeUrl.href,Ue(Ue({},t),{},{params:Ue(Ue({},{apikey:this.supabaseKey}),t==null?void 0:t.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,e)=>{this._handleTokenChanged(t,"CLIENT",e==null?void 0:e.access_token)})}_handleTokenChanged(t,e,r){(t==="TOKEN_REFRESHED"||t==="SIGNED_IN")&&this.changedAccessToken!==r?(this.changedAccessToken=r,this.realtime.setAuth(r)):t==="SIGNED_OUT"&&(this.realtime.setAuth(),e=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}};const YT=(t,e,r)=>new ZT(t,e,r);function XT(){if(typeof window<"u")return!1;const t=globalThis.process;if(!t)return!1;const e=t.version;if(e==null)return!1;const r=e.match(/^v(\d+)\./);return r?parseInt(r[1],10)<=20:!1}XT()&&console.warn("⚠️  Node.js 20 and below are deprecated and will no longer be supported in future versions of @supabase/supabase-js. Please upgrade to N
245ode.js 22 or later. For more information, visit: https://github.com/orgs/supabase/discussions/45715");const $w="https://qywviysetikpxwxgkzyj.supabase.co",QT="sb_publishable_S-E2NBxrn-woAbpumpz7ag_cKKIwjsS",dn=!$w.startsWith("VITE_SUPABASE_");dn||console.warn("Supabase no está configurado. Se utilizará LocalStorage como respaldo.");const Ls=dn?YT($w,QT):null,ea=10,nu="site_promociones_data",Hu=t=>t?{id:t.id,title:t.title||"",description:t.description||"",imageUrl:t.imageurl||"",imageStoragePath:t.imagestoragepath||"",date:t.date||"",active:t.active??!0,createdAt:t.createdat||new Date().toISOString(),updatedAt:t.updatedat||new Date().toISOString()}:null,zw=t=>t?{title:t.title,description:t.description||"",imageurl:t.imageUrl,imagestoragepath:t.imageStoragePath||"",date:t.date,active:t.active}:null,eC="CartaDigitalPromotionsDB",tC=1,Pi="promotions_store",Uw="all_promotions_key",Bw=()=>new Promise((t,e)=>{if(typeof window>"u"||!window.indexedDB)return e(new Error("IndexedDB not supported"));const r=indexedDB.open(eC,tC);r.onupgradeneeded=n=>{const s=n.target.result;s.objectStoreNames.contains(Pi)||s.createObjectStore(Pi)},r.onsuccess=()=>t(r.result),r.onerror=n=>e(n.target.error)}),rC=async()=>{try{const t=await Bw();return new Promise(e=>{const s=t.transaction(Pi,"readonly").objectStore(Pi).get(Uw);s.onsuccess=()=>e(s.result||null),s.onerror=()=>e(null)})}catch(t){return console.warn("IndexedDB read error:",t),null}},uh=async t=>{try{const e=await Bw();return new Promise(r=>{const i=e.transaction(Pi,"readwrite").objectStore(Pi).put(t,Uw);i.onsuccess=()=>r(!0),i.onerror=()=>r(!1)})}catch(e){return console.warn("IndexedDB save error:",e),!1}},Vn=async()=>{const t=await rC();if(t&&Array.isArray(t)&&t.length>0)return t;const e=localStorage.getItem(nu);if(e)try{const n=JSON.parse(e);if(Array.isArray(n)&&n.length>0)return await uh(n),n}catch(n){console.error("Error parsing local promotions:",n)}const r=[{id:"local-1",title:"Promoción 1",description:"Imagen de promoción 1",imageUrl:"promociones/1.jpg",active:!0,date:new Date(Date.now()-0*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{id:"local-2",title:"Promoción 2",description:"Imagen de promoción 2",imageUrl:"promociones/2.jpg",active:!0,date:new Date(Date.now()-1*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{id:"local-3",title:"Promoción 3",description:"Imagen de promoción 3",imageUrl:"promociones/3.jpg",active:!0,date:new Date(Date.now()-2*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{id:"local-4",title:"Promoción 4",description:"Imagen de promoción 4",imageUrl:"promociones/4.jpg",active:!0,date:new Date(Date.now()-3*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{id:"local-5",title:"Promoción 5",description:"Imagen de promoción 5",imageUrl:"promociones/5.jpg",active:!0,date:new Date(Date.now()-4*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()},{id:"local-6",title:"Promoción 6",description:"Imagen de promoción 6",imageUrl:"promociones/6.jpg",active:!0,date:new Date(Date.now()-5*24*3600*1e3).toISOString().split("T")[0],createdAt:new Date().toISOString(),updatedAt:new Date().toISOString()}];await uh(r);try{localStorage.setItem(nu,JSON.stringify(r))}catch{}return r},Wf=async t=>{await uh(t);try{localStorage.setItem(nu,JSON.stringify(t))}catch(e){console.warn("localStorage quota exceeded. Data stored safely in IndexedDB.",e);try{localStorage.removeItem(nu)}catch{}}},Cg=async(t=null)=>{var e,r;if(!dn)try{const s=(await Vn()).filter(u=>u.active);s.sort((u,c)=>new Date(c.date)-new Date(u.date));const i=t?s.findIndex(u=>u.id===t)+1:0;if(i<0||i>=s.length)return{promotions:[],lastVisible:null,hasMore:!1,error:null};const a=s.slice(i,i+ea),o=((e=a[a.length-1])==null?void 0:e.id)||null,l=i+ea<s.length;return{promotions:a,lastVisible:o,hasMore:l,error:null}}catch(n){return console.error("Error fetching local active promotions:",n),{promotions:[],lastVisible:null,hasMore:!1,error:"Error al cargar las promociones locales."}}try{const n=t&&!isNaN(t)?Number(t):0,{data:s,error:i}=await Ls.from("promotions").select("*").eq("active",!0).order("date",{ascending:!1}).order("id",{ascending:!1}).range(n,n+ea-1);if(i)throw i;const a=n+s.length,o=s.length===ea;return{promotions:s.map(Hu),lastVisible:a,hasMore:o,error:null}}catch(n){console.error("Error fetching active promotions from Supabase, falling back to local:",n);try{const s=t&&!isNaN(t)?Number(t):0,a=(await Vn()).filter(c=>c&&c.active),o=a.slice(s,s+ea),l=((r=o[o.length-1])==null?void 0:r.id)||null,u=s+o.length<a.length;return{promotions:o,lastVisible:l,hasMore:u,error:null}}catch{return{promotions:[],lastVisible:null,hasMore:!1,error:"Error al cargar las promociones."}}}},nC=async(t="all",e="newest")=>{if(!dn)try{let r=await Vn();return t==="active"?r=r.filter(n=>n.active):t==="inactive"&&(r=r.filter(n=>!n.active)),r.sort((n,s)=>{const i=new Date(n.date||n.createdAt),a=new Date(s.date||s.createdAt);return e==="newest"?a-i:i-a}),{promotions:r,error:null}}catch(r){return console.error("Error fetching all local promotions:",r),{promotions:[],error:"Error al cargar las promociones locales."}}try{const r=e!=="newest";let n=Ls.from("promotions").select("*").order("date",{ascending:r}).order("id",{ascending:r});t==="active"?n=n.eq("active",!0):t==="inactive"&&(n=n.eq("active",!1));const{data:s,error:i}=await n;if(i)throw i;return{promotions:s.map(Hu),error:null}}catch(r){console.error("Error fetching all promotions from Supabase, falling back to local:",r);try{let n=await Vn();return t==="active"?n=n.filter(s=>s.active):t==="inactive"&&(n=n.filter(s=>!s.active)),n.sort((s,i)=>{const a=new Date(s.date||s.createdAt),o=new Date(i.date||i.createdAt);return e==="newest"?o-a:a-o}),{promotions:n,error:null}}catch{return{promotions:[],error:"Error al cargar las promociones."}}}},Fw=async t=>{if(!dn)try{const r=(await Vn()).find(n=>n.id===t);return r?{promotion:r,error:null}:{promotion:null,error:"Promoción no encontrada."}}catch{return{promotion:null,error:"Error al cargar la promoción."}}try{const{data:e,error:r}=await Ls.from("promotions").select("*").eq("id",t).single();if(r)throw r;return{promotion:Hu(e),error:null}}catch{return{promotion:null,error:"Error al cargar la promoción."}}},sC=async(t,e,r)=>{if(!dn)try{let n=t.imageUrl||"";if(e){const o=await Hf(e);n=await new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(o)})}if(!n)return{promotion:null,error:"Se requiere una imagen."};const s=new Date().toISOString(),i={id:`local-${Date.now()}
245`,title:t.title,description:t.description||"",imageUrl:n,imageStoragePath:"",date:t.date||new Date().toISOString().split("T")[0],active:t.active??!0,createdAt:s,updatedAt:s},a=await Vn();return a.unshift(i),await Wf(a),{promotion:i,error:null}}catch(n){return console.error("Error creating local promotion:",n),{promotion:null,error:"Error al crear la promoción local."}}try{let n=t.imageUrl||"",s="";if(e){const l=await Vw(e,r,t.title);if(l.error)return{promotion:null,error:l.error};n=l.url,s=l.path}if(!n)return{promotion:null,error:"Se requiere una imagen."};const i={title:t.title,description:t.description||"",imageUrl:n,imageStoragePath:s,date:t.date,active:t.active??!0},{data:a,error:o}=await Ls.from("promotions").insert([zw(i)]).select().single();if(o)throw o;return{promotion:Hu(a),error:null}}catch(n){return console.error("Error creating promotion:",n),{promotion:null,error:"Error al crear la promoción."}}},iC=async(t,e,r,n)=>{if(!dn)try{const s=await Vn(),i=s.findIndex(o=>o.id===t);if(i===-1)return{error:"Promoción no encontrada."};let a=e.imageUrl||s[i].imageUrl;if(r){const o=await Hf(r);a=await new Promise((l,u)=>{const c=new FileReader;c.onloadend=()=>l(c.result),c.onerror=u,c.readAsDataURL(o)})}return s[i]={...s[i],title:e.title,description:e.description||"",imageUrl:a,date:e.date||new Date().toISOString().split("T")[0],active:e.active,updatedAt:new Date().toISOString()},await Wf(s),{error:null}}catch(s){return console.error("Error updating local promotion:",s),{error:"Error al actualizar la promoción local."}}try{const{promotion:s}=await Fw(t);if(!s)return{error:"Promoción no encontrada."};let i=e.imageUrl||s.imageUrl,a=s.imageStoragePath||"";if(r){s.imageStoragePath&&await ch(s.imageStoragePath);const u=await Vw(r,n,e.title);if(u.error)return{error:u.error};i=u.url,a=u.path}else e.imageUrl&&e.imageUrl!==s.imageUrl&&(s.imageStoragePath&&await ch(s.imageStoragePath),i=e.imageUrl,a="");const o={title:e.title,description:e.description||"",imageUrl:i,imageStoragePath:a,date:e.date,active:e.active},{error:l}=await Ls.from("promotions").update(zw(o)).eq("id",t);if(l)throw l;return{error:null}}catch(s){return console.error("Error updating promotion:",s),{error:"Error al actualizar la promoción."}}},aC=async t=>{if(!dn)try{const r=(await Vn()).filter(n=>n.id!==t);return await Wf(r),{error:null}}catch(e){return console.error("Error deleting local promotion:",e),{error:"Error al eliminar la promoción local."}}try{const{promotion:e}=await Fw(t);e!=null&&e.imageStoragePath&&await ch(e.imageStoragePath);const{error:r}=await Ls.from("promotions").delete().eq("id",t);if(r)throw r;return{error:null}}catch(e){return console.error("Error deleting promotion:",e),{error:"Error al eliminar la promoción."}}},Hf=(t,e=900,r=1200,n=.78)=>new Promise(s=>{if(!t.type||!t.type.startsWith("image/"))return s(t);const i=new FileReader;i.readAsDataURL(t),i.onload=a=>{const o=new Image;o.src=a.target.result,o.onload=()=>{let l=o.width,u=o.height;(l>e||u>r)&&(l/e>u/r?(u=Math.round(u*e/l),l=e):(l=Math.round(l*r/u),u=r));const c=document.createElement("canvas");c.width=l,c.height=u;const d=c.getContext("2d");d.imageSmoothingEnabled=!0,d.imageSmoothingQuality="high",d.drawImage(o,0,0,l,u);const f=t.name?t.name.replace(/\.[^/.]+$/,""):"image";c.toBlob(m=>{if(!m){c.toBlob(g=>{if(!g)return s(t);const b=new File([g],`${f}.jpg`,{type:"image/jpeg",lastModified:Date.now()});s(b)},"image/jpeg",n);return}const y=new File([m],`${f}.webp`,{type:"image/webp",lastModified:Date.now()});s(y)},"image/webp",n)},o.onerror=()=>s(t)},i.onerror=()=>s(t)}),Vw=async(t,e,r="")=>{const n=await Hf(t),s=n.type==="image/webp"?"webp":n.type.split("/")[1]||"jpg";return console.log(`Original: ${(t.size/1024/1024).toFixed(2)}MB, Comprimido: ${(n.size/1024).toFixed(2)}KB (${s.toUpperCase()})`),new Promise(i=>{let a=0;const o=setInterval(()=>{a+=Math.round(Math.random()*15)+10,a>=90&&(a=90,clearInterval(o)),e==null||e(a)},80),l=new FormData;l.append("image",n),r&&l.append("title",r),fetch("https://migusto.com.ar/1A_assets/upload.php",{method:"POST",body:l}).then(u=>u.json()).then(u=>{clearInterval(o),u.success?(e==null||e(100),i({url:u.url,path:"",error:null})):(console.error("Ferozo upload error:",u.error),i({url:null,path:null,error:u.error||"Error al subir la imagen a Ferozo."}))}).catch(u=>{clearInterval(o),console.error("Ferozo upload exception:",u),i({url:null,path:null,error:"Error de conexión al subir la imagen."})})})},ch=async t=>{if(dn)try{const{error:e}=await Ls.storage.from("promotions").remove([t]);e&&console.warn("Could not delete image from Supabase storage:",e)}catch(e){console.warn("Could not delete image from storage:",e)}},oC=()=>{const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(!1),[a,o]=P.useState(null),[l,u]=P.useState(!0),c=P.useRef(null),d=P.useCallback(async()=>{n(!0),o(null),c.current=null;const y=await Cg(null);y.error?o(y.error):(e(y.promotions),c.current=y.lastVisible,u(y.hasMore)),n(!1)},[]),f=P.useCallback(async()=>
245{if(s||!l)return;i(!0);const y=await Cg(c.current);y.error||(e(g=>[...g,...y.promotions]),c.current=y.lastVisible,u(y.hasMore)),i(!1)},[s,l]);return{promotions:t,loading:r,loadingMore:s,error:a,hasMore:l,fetchInitial:d,fetchMore:f,retry:d}},lC=()=>{const[t,e]=P.useState([]),[r,n]=P.useState(!0),[s,i]=P.useState(null),[a,o]=P.useState("all"),[l,u]=P.useState("newest"),c=P.useCallback(async(b=a,_=l)=>{n(!0),i(null);const v=await nC(b,_);v.error?i(v.error):e(v.promotions),n(!1)},[a,l]),d=P.useCallback(b=>{o(b),c(b,l)},[c,l]),f=P.useCallback(b=>{u(b),c(a,b)},[c,a]),m=P.useCallback(async(b,_,v)=>{const w=await sC(b,_,v);return w.error||await c(),w},[c]),y=P.useCallback(async(b,_,v,w)=>{const h=await iC(b,_,v,w);return h.error||await c(),h},[c]),g=P.useCallback(async b=>{const _=await aC(b);return _.error||e(v=>v.filter(w=>w.id!==b)),_},[]);return{promotions:t,loading:r,error:s,filterStatus:a,sortOrder:l,fetchAll:c,handleFilterChange:d,handleSortChange:f,create:m,update:y,remove:g}},Ww=P.memo(({promotion:t})=>{var i;const[e,r]=P.useState(!1),[n,s]=P.useState(!1);return S.jsx("article",{className:"feed-card !opacity-100 bg-background-secondary rounded-none sm:rounded-card overflow-hidden mt-0 mb-6 border-x-0 border-y sm:border border-slate-800/40 shadow-md",children:S.jsxs("div",{className:"relative w-full min-h-[150px] bg-background-secondary flex items-center justify-center",children:[!n&&!e&&S.jsx("div",{className:"absolute inset-0 skeleton animate-pulse"}),e?S.jsxs("div",{className:"flex flex-col items-center justify-center text-text-secondary p-8 gap-2",children:[S.jsx(Bf,{size:32,className:"opacity-30"}),S.jsx("span",{className:"text-sm opacity-50",children:"Imagen no disponible"})]}):S.jsx("img",{src:(i=t.imageUrl)!=null&&i.startsWith("/")?`/cartadigital/${t.imageUrl.slice(1)}`:t.imageUrl,alt:t.title,loading:"lazy",decoding:"async",onLoad:()=>s(!0),onError:()=>{r(!0),s(!0)},className:`
246              w-full h-auto transition-opacity duration-300
247              ${n?"opacity-100":"opacity-0"}
248            `})]})})});Ww.displayName="PromotionCard";const uC=()=>S.jsxs("div",{className:"bg-white rounded-none sm:rounded-card border-x-0 border-y sm:border border-slate-800/40 mt-0 mb-6 overflow-hidden",children:[S.jsx("div",{className:"skeleton w-full aspect-video"}),S.jsxs("div",{className:"p-4 space-y-3",children:[S.jsxs("div",{className:"flex items-center gap-2",children:[S.jsx("div",{className:"skeleton h-5 w-16 rounded-full"}),S.jsx("div",{className:"skeleton h-4 w-24 rounded"})]}),S.jsx("div",{className:"skeleton h-6 w-3/4 rounded"}),S.jsx("div",{className:"skeleton h-4 w-full rounded"}),S.jsx("div",{className:"skeleton h-4 w-2/3 rounded"})]})]}),cC=({count:t=3})=>S.jsx("div",{className:"w-full max-w-feed mx-auto px-0 sm:px-4 mt-0",children:Array.from({length:t}).map((e,r)=>S.jsx(uC,{},r))}),Pg={primary:"btn-primary",secondary:"btn-secondary",outline:"btn-outline",ghost:"btn-ghost",danger:"btn-danger"},dC={sm:"py-2 px-4 text-sm",md:"py-3 px-6 text-base",lg:"py-4 px-8 text-lg"},As=({children:t,variant:e="primary",size:r="md",loading:n=!1,disabled:s=!1,fullWidth:i=!1,icon:a,iconPosition:o="left",className:l="",type:u="button",onClick:c,...d})=>{const f=Pg[e]||Pg.primary,m=dC[r];return S.jsxs("button",{type:u,onClick:c,disabled:s||n,className:`
249        inline-flex items-center justify-center gap-2
250        ${f}
251        ${m}
252        ${i?"w-full":""}
253        ${l}
254      `,...d,children:[n?S.jsx(ko,{size:16,className:"animate-spin"}):a&&o==="left"?S.jsx(a,{size:16}):null,t,!n&&a&&o==="right"&&S.jsx(a,{size:16})]})},hC=({promotions:t,loading:e,loadingMore:r,error:n,hasMore:s,onRetry:i,onLoadMore:a})=>{const o=P.useRef(null),l=P.useCallback(u=>{const[c]=u;c.isIntersecting&&s&&!r&&!e&&a()},[s,r,e,a]);return P.useEffect(()=>{const u=o.current,c=new IntersectionObserver(l,{root:null,rootMargin:"200px",threshold:0});return u&&c.observe(u),()=>{u&&c.unobserve(u)}},[l]),e?S.jsx(cC,{count:4}):n?S.jsxs("div",{className:"max-w-feed mx-auto px-4 py-16 flex flex-col items-center gap-4 text-center",children:[S.jsx("div",{className:"w-16 h-16 rounded-full bg-red-50 flex items-center justify-center",children:S.jsx(Hm,{size:24,className:"text-error"})}),S.jsx("h3",{className:"font-bold text-text text-lg",children:"Algo salió mal"}),S.jsx("p",{className:"text-text-secondary text-sm max-w-xs",children:n}),S.jsx(As,{onClick:i,variant:"outline",icon:Hm,size:"sm",children:"Intentar de nuevo"})]}):t.length?S.jsxs("div",{className:"max-w-feed mx-auto px-0 sm:px-4 mt-0 pt-0 pb-6 sm:py-6",children:[t.map(u=>S.jsx(Ww,{promotion:u},u.id)),S.jsx("div",{ref:o,className:"h-4"}),r&&S.jsx("div",{className:"flex justify-center py-6",children:S.jsx(ko,{size:24,className:"animate-spin text-primary"})}),!s&&t.length>0&&S.jsx("div",{className:"text-center py-8 text-text-secondary text-sm",children:S.jsxs("div",{className:"inline-flex items-center gap-2",children:[S.jsx("span",{className:"w-8 h-px bg-gray-200"}),S.jsx("span",{children:"Fin de las promociones"}),S.jsx("span",{className:"w-8 h-px bg-gray-200"})]})})]}):S.jsxs("div",{className:"max-w-feed mx-auto px-4 py-20 flex flex-col items-center gap-4 text-center",children:[S.jsx("div",{className:"w-20 h-20 rounded-full bg-background-secondary flex items-center justify-center",children:S.jsx(Ok,{size:32,className:"text-text-secondary opacity-50"})}),S.jsx("h3",{className:"font-display font-bold text-text text-xl",children:"Sin promociones"}),S.jsx("p",{className:"text-text-secondary text-sm max-w-xs",children:"Todavía no hay promociones activas. ¡Volvé pronto!"})]})};var dh={exports:{}};(function(t,e){(function(r,n){n(e)}
vendor: 1,242 bytes, line 254
254)(U1,function(r){class n{constructor(h,p){this.state={angle:0,area:[],position:{x:0,y:0},hardAngle:0,hardDrawingAngle:0},this.createdDensity=p,this.nowDrawingDensity=this.createdDensity,this.render=h}setDensity(h){this.createdDensity=h,this.nowDrawingDensity=h}setDrawingDensity(h){this.nowDrawingDensity=h}setPosition(h){this.state.position=h}setAngle(h){this.state.angle=h}setArea(h){this.state.area=h}setHardDrawingAngle(h){this.state.hardDrawingAngle=h}setHardAngle(h){this.state.hardAngle=h,this.state.hardDrawingAngle=h}setOrientation(h){this.orientation=h}getDrawingDensity(){return this.nowDrawingDensity}getDensity(){return this.createdDensity}getHardAngle(){return this.state.hardAngle}}class s extends n{constructor(h,p,x){super(h,x),this.image=null,this.isLoad=!1,this.loadingAngle=0,this.image=new Image,this.image.src=p}draw(h){const p=this.render.getContext(),x=this.render.convertToGlobal(this.state.position),k=this.render.getRect().pageWidth,T=this.render.getRect().height;p.save(),p.translate(x.x,x.y),p.beginPath();for(let E of this.state.area)E!==null&&(E=this.render.convertToGlobal(E),p.lineTo(E.x-x.x,E.y-x.y));p.rotate(this.state.angle),p.clip(),this.isLoad?p.drawImage(this.image,0,0,k,T):this.drawLoader(p,{x:0,y:0}
254,k,T),p.restore()}simpleDraw(h){const p=this.render.getRect(),x=this.render.getContext(),k=p.pageWidth,T=p.height,E=h===1?p.left+p.pageWidth:p.left,R=p.top;this.isLoad?x.drawImage(this.image,E,R,k,T):this.drawLoader(x,{x:E,y:R},k,T)}drawLoader(h,p,x,k){h.beginPath(),h.strokeStyle="rgb(200, 200, 200)",h.fillStyle="rgb(255, 255, 255)",h.lineWidth=1,h.rect(p.x+1,p.y+1,x-1,k-1),h.stroke(),h.fill();const T={x:p.x+x/2,y:p.y+k/2};h.beginPath(),h.lineWidth=10,h.arc(T.x,T.y,20,this.loadingAngle,3*Math.PI/2+this.loadingAngle),h.stroke(),h.closePath(),this.loadingAngle+=.07,this.loadingAngle>=2*Math.PI&&(this.loadingAngle=0)}load(){this.isLoad||(this.image.onload=()=>{this.isLoad=!0})}newTemporaryCopy(){return this}getTemporaryCopy(){return this}hideTemporaryCopy(){}}class i{constructor(h,p){this.pages=[],this.currentPageIndex=0,this.currentSpreadIndex=0,this.landscapeSpread=[],this.portraitSpread=[],this.render=p,this.app=h,this.currentPageIndex=0,this.isShowCover=this.app.getSettings().showCover}destroy(){this.pages=[]}createSpread(){this.landscapeSpread=[],this.portraitSpread=[];for(let p=0;p<this.pages.length;p++)this.portraitSpread.push([p]);let h=0;this.isShowCover&&(this.pages[0].setDensity("hard"),this.landscapeSpread.push([h]),h++);for(let p=h;p<this.pages.length;p+=2)p<this.pages.length-1?this.landscapeSpread.push([p,p+1]):(this.landscapeSpread.push([p]),this.pages[p].setDensity("hard"))}getSpread(){return this.render.getOrientation()==="landscape"?this.landscapeSpread:this.portraitSpread}getSpreadIndexByPage(h){const p=this.getSpread();for(let x=0;x<p.length;x++)if(h===p[x][0]||h===p[x][1])return x;return null}getPageCount(){return this.pages.length}getPages(){return this.pages}getPage(h){if(h>=0&&h<this.pages.length)return this.pages[h];throw new Error("Invalid page number")}nextBy(h){const p=this.pages.indexOf(h);return p<this.pages.length-1?this.pages[p+1]:null}prevBy(h){const p=this.pages.indexOf(h);return p>0?this.pages[p-1]:null}getFlippingPage(h){const p=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return h===0?this.pages[p].newTemporaryCopy():this.pages[p-1];{const x=h===0?this.getSpread()[p+1]:this.getSpread()[p-1];return x.length===1||h===0?this.pages[x[0]]:this.pages[x[1]]}}getBottomPage(h){const p=this.currentSpreadIndex;if(this.render.getOrientation()==="portrait")return h===0?this.pages[p+1]:this.pages[p-1];{const x=h===0?this.getSpread()[p+1]:this.getSpread()[p-1];return x.length===1?this.pages[x[0]]:h===0?this.pages[x[1]]:this.pages[x[0]]}}showNext(){this.currentSpreadIndex<this.getSpread().length&&(this.currentSpreadIndex++,this.showSpread())}showPrev(){this.currentSpreadIndex>0&&(this.currentSpreadIndex--,this.showSpread())}getCurrentPageIndex(){return this.currentPageIndex}show(h=null){if(h===null&&(h=this.currentPageIndex),h<0||h>=this.pages.length)return;const p=this.getSpreadIndexByPage(h);p!==null&&(this.currentSpreadIndex=p,this.showSpread())}getCurrentSpreadIndex(){return this.currentSpreadIndex}setCurrentSpreadIndex(h){if(!(h>=0&&h<this.getSpread().length))throw new Error("Invalid page");this.currentSpreadIndex=h}showSpread(){const h=this.getSpread()[this.currentSpreadIndex];h.length===2?(this.render.setLeftPage(this.pages[h[0]]),this.render.setRightPage(this.pages[h[1]])):this.render.getOrientation()==="landscape"&&h[0]===this.pages.length-1?(this.render.setLeftPage(this.pages[h[0]]),this.render.setRightPage(null)):(this.render.setLeftPage(null),this.render.setRightPage(this.pages[h[0]])),this.currentPageIndex=h[0],this.app.updatePageIndex(this.currentPageIndex)}}class a extends i{constructor(h,p,x){super(h,p),this.imagesHref=x}load(){for(const h of this.imagesHref){const p=new s(this.render,h,"soft");p.load(),this.pages.push(p)}this.createSpread()}}class o{static GetDistanceBetweenTwoPoint(h,p){return h===null||p===null?1/0:Math.sqrt(Math.pow(p.x-h.x,2)+Math.pow(p.y-h.y,2))}static GetSegmentLength(h){return o.GetDistanceBetweenTwoPoint(h[0],h[1])}static GetAngleBetweenTwoLine(h,p){const x=h[0].y-h[1].y,k=p[0].y-p[1].y,T=h[1].x-h[0].x,E=p[1].x-p[0].x;return Math.acos((x*k+T*E)/(Math.sqrt(x*x+T*T)*Math.sqrt(k*k+E*E)))}static PointInRect(h,p){return p===null?null:p.x>=h.left&&p.x<=h.width+h.left&&p.y>=h.top&&p.y<=h.top+h.height?p:null}static GetRotatedPoint(h,p,x){return{x:h.x*Math.cos(x)+h.y*Math.sin(x)+p.x,y:h.y*M
254ath.cos(x)-h.x*Math.sin(x)+p.y}}static LimitPointToCircle(h,p,x){if(o.GetDistanceBetweenTwoPoint(h,x)<=p)return x;const k=h.x,T=h.y,E=x.x,R=x.y;let j=Math.sqrt(Math.pow(p,2)*Math.pow(k-E,2)/(Math.pow(k-E,2)+Math.pow(T-R,2)))+k;x.x<0&&(j*=-1);let L=(j-k)*(T-R)/(k-E)+T;return k-E+T===0&&(L=p),{x:j,y:L}}static GetIntersectBetweenTwoSegment(h,p,x){return o.PointInRect(h,o.GetIntersectBeetwenTwoLine(p,x))}static GetIntersectBeetwenTwoLine(h,p){const x=h[0].y-h[1].y,k=p[0].y-p[1].y,T=h[1].x-h[0].x,E=p[1].x-p[0].x,R=h[0].x*h[1].y-h[1].x*h[0].y,j=p[0].x*p[1].y-p[1].x*p[0].y,L=x*j-k*R,O=T*j-E*R,N=-(R*E-j*T)/(x*E-k*T),M=-(x*j-k*R)/(x*E-k*T);if(isFinite(N)&&isFinite(M))return{x:N,y:M};if(Math.abs(L-O)<.1)throw new Error("Segment included");return null}static GetCordsFromTwoPoint(h,p){const x=Math.abs(h.x-p.x),k=Math.abs(h.y-p.y),T=Math.max(x,k),E=[h];function R(j,L,O,N,M){return L>j?j+M*(O/N):L<j?j-M*(O/N):j}for(let j=1;j<=T;j+=1)E.push({x:R(h.x,p.x,x,T,j),y:R(h.y,p.y,k,T,j)});return E}}class l extends n{constructor(h,p,x){super(h,x),this.copiedElement=null,this.temporaryCopy=null,this.isLoad=!1,this.element=p,this.element.classList.add("stf__item"),this.element.classList.add("--"+x)}newTemporaryCopy(){return this.nowDrawingDensity==="hard"?this:(this.temporaryCopy===null&&(this.copiedElement=this.element.cloneNode(!0),this.element.parentElement.appendChild(this.copiedElement),this.temporaryCopy=new l(this.render,this.copiedElement,this.nowDrawingDensity)),this.getTemporaryCopy())}getTemporaryCopy(){return this.temporaryCopy}hideTemporaryCopy(){this.temporaryCopy!==null&&(this.copiedElement.remove(),this.copiedElement=null,this.temporaryCopy=null)}draw(h){const p=h||this.nowDrawingDensity,x=this.render.convertToGlobal(this.state.position),k=this.render.getRect().pageWidth,T=this.render.getRect().height;this.element.classList.remove("--simple");const E=`
255            display: block;
256            z-index: ${this.element.style.zIndex};
257            left: 0;
258            top: 0;
259            width: ${k}px;
260            height: ${T}px;
261        `;p==="hard"?this.drawHard(E):this.drawSoft(x,E)}drawHard(h=""){const p=this.render.getRect().left+this.render.getRect().width/2,x=this.state.hardDrawingAngle,k=h+`
262                backface-visibility: hidden;
263                -webkit-backface-visibility: hidden;
264                clip-path: none;
265                -webkit-clip-path: none;
266            `+(this.orientation===0?`transform-origin: ${this.render.getRect().pageWidth}px 0; 
267                   transform: translate3d(0, 0, 0) rotateY(${x}deg);`:`transform-origin: 0 0; 
268                   transform: translate3d(${p}px, 0, 0) rotateY(${x}deg);`);this.element.style.cssText=k}drawSoft(h,p=""){let x="polygon( ";for(const T of this.state.area)if(T!==null){let E=this.render.getDirection()===1?{x:-T.x+this.state.position.x,y:T.y-this.state.position.y}:{x:T.x-this.state.position.x,y:T.y-this.state.position.y};E=o.GetRotatedPoint(E,{x:0,y:0},this.state.angle),x+=E.x+"px "+E.y+"px, "}x=x.slice(0,-2),x+=")";const k=p+`transform-origin: 0 0; clip-path: ${x}; -webkit-clip-path: ${x};`+(this.render.isSafari()&&this.state.angle===0?`transform: translate(${h.x}px, ${h.y}px);`:`transform: translate3d(${h.x}px, ${h.y}px, 0) rotate(${this.state.angle}rad);`);this.element.style.cssText=k}simpleDraw(h){const p=this.render.getRect(),x=p.pageWidth,k=p.height,T=h===1?p.left+p.pageWidth:p.left,E=p.top;this.element.classList.add("--simple"),this.element.style.cssText=`
269            position: absolute; 
270            display: block; 
271            height: ${k}px; 
272            left: ${T}px; 
273            top: ${E}px; 
274            width: ${x}px; 
275            z-index: ${this.render.getSettings().startZIndex+1};`}getElement(){return this.element}load(){this.isLoad=!0}setOrientation(h){super.setOrientation(h),this.element.classList.remove("--left","--right"),this.element.classList.add(h===1?"--right":"--left")}setDrawingDensity(h){this.element.classList.remove("--soft","--hard"),this.element.classList.add("--"+h),super.setDrawingDensity(h)}}class u extends i{constructor(h,p,x,k){super(h,p),this.element=x,this.pagesElement=k}load(){for(const h of this.pagesElement){const p=new l(this.render,h,h.dataset.density==="hard"?"hard":"soft");p.load(),this.pages.push(p)}this.createSpread()}}class c{constructor(h,p,x,k){this.direction=h,this.corner=p,this.topIntersectPoint=null,this.sideIntersectPoint=null,this.bottomIntersectPoint=null,this.pageWidth=parseInt(x,10),this.pageHeight=parseInt(k,10)}calc(h){try{return this.position=this.calcAngleAndPosition(h),this.calculateIntersectPoint(this.position),!0}catch{return!1}}getFlippingClipArea(){const h=[];let p=!1;return h.push(this.rect.topLeft),h.push(this.topIntersectPoint),this.sideIntersectPoint===null?p=!0:(h.push(this.sideIntersectPoint),this.bottomIntersectPoint===null&&(p=!1)),h.push(this.bottomIntersectPoint),(p||this.corner==="bottom")&&h.push(this.rect.bottomLeft),h}getBottomClipArea(){const h=[];return h.push(this.topIntersectPoint),this.corner==="top"?h.push({x:this.pageWidth,y:0}):(this.topIntersectPoint!==null&&h.push({x:this.pageWidth,y:0}),h.push({x:this.pageWidth,y:this.pageHeight})),this.sideIntersectPoint!==null?o.GetDistanceBetweenTwoPoint(this.sideIntersectPoint,this.topIntersectPoint)>=10&&h.push(this.sideIntersectPoint):this.corner==="top"&&h.push({x:this.pageWidth,y:this.pageHeight}),h.push(this.bottomIntersectPoint),h.push(this.topIntersectPoint),h}getAngle(){return this.direction===0?-this.angle:this.angle}getRect(){return this.rect}getPosition(){return this.position}getActiveCorner(){return this.direction===0?this.rect.topLeft:this.rect.topRight}getDirection(){return this.direction}getFlippingProgress(){return Math.abs((this.position.x-this.pageWidth)/(2*this.pageWidth)*100)}getCorner(){return this.corner}getBottomPagePosition(){return this.direction===1?{x:this.pageWidth,y:0}:{x:0,y:0}}getShadowStartPoint(){return this.corner==="top"?this.topIntersectPoint:this.sideIntersectPoint!==null?this.sideIntersectPoint:this.topIntersectPoint}
275getShadowAngle(){const h=o.GetAngleBetweenTwoLine(this.getSegmentToShadowLine(),[{x:0,y:0},{x:this.pageWidth,y:0}]);return this.direction===0?h:Math.PI-h}calcAngleAndPosition(h){let p=h;if(this.updateAngleAndGeometry(p),p=this.corner==="top"?this.checkPositionAtCenterLine(p,{x:0,y:0},{x:0,y:this.pageHeight}):this.checkPositionAtCenterLine(p,{x:0,y:this.pageHeight},{x:0,y:0}),Math.abs(p.x-this.pageWidth)<1&&Math.abs(p.y)<1)throw new Error("Point is too small");return p}updateAngleAndGeometry(h){this.angle=this.calculateAngle(h),this.rect=this.getPageRect(h)}calculateAngle(h){const p=this.pageWidth-h.x+1,x=this.corner==="bottom"?this.pageHeight-h.y:h.y;let k=2*Math.acos(p/Math.sqrt(x*x+p*p));x<0&&(k=-k);const T=Math.PI-k;if(!isFinite(k)||T>=0&&T<.003)throw new Error("The G point is too small");return this.corner==="bottom"&&(k=-k),k}getPageRect(h){return this.corner==="top"?this.getRectFromBasePoint([{x:0,y:0},{x:this.pageWidth,y:0},{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}],h):this.getRectFromBasePoint([{x:0,y:-this.pageHeight},{x:this.pageWidth,y:-this.pageHeight},{x:0,y:0},{x:this.pageWidth,y:0}],h)}getRectFromBasePoint(h,p){return{topLeft:this.getRotatedPoint(h[0],p),topRight:this.getRotatedPoint(h[1],p),bottomLeft:this.getRotatedPoint(h[2],p),bottomRight:this.getRotatedPoint(h[3],p)}}getRotatedPoint(h,p){return{x:h.x*Math.cos(this.angle)+h.y*Math.sin(this.angle)+p.x,y:h.y*Math.cos(this.angle)-h.x*Math.sin(this.angle)+p.y}}calculateIntersectPoint(h){const p={left:-1,top:-1,width:this.pageWidth+2,height:this.pageHeight+2};this.corner==="top"?(this.topIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[h,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[h,this.rect.bottomLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}])):(this.topIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[this.rect.topLeft,this.rect.topRight],[{x:0,y:0},{x:this.pageWidth,y:0}]),this.sideIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[h,this.rect.topLeft],[{x:this.pageWidth,y:0},{x:this.pageWidth,y:this.pageHeight}]),this.bottomIntersectPoint=o.GetIntersectBetweenTwoSegment(p,[this.rect.bottomLeft,this.rect.bottomRight],[{x:0,y:this.pageHeight},{x:this.pageWidth,y:this.pageHeight}]))}checkPositionAtCenterLine(h,p,x){let k=h;const T=o.LimitPointToCircle(p,this.pageWidth,k);k!==T&&(k=T,this.updateAngleAndGeometry(k));const E=Math.sqrt(Math.pow(this.pageWidth,2)+Math.pow(this.pageHeight,2));let R=this.rect.bottomRight,j=this.rect.topLeft;if(this.corner==="bottom"&&(R=this.rect.topRight,j=this.rect.bottomLeft),R.x<=0){const L=o.LimitPointToCircle(x,E,j);L!==k&&(k=L,this.updateAngleAndGeometry(k))}return k}getSegmentToShadowLine(){const h=this.getShadowStartPoint();return[h,h!==this.sideIntersectPoint&&this.sideIntersectPoint!==null?this.sideIntersectPoint:this.bottomIntersectPoint]}}class d{constructor(h,p){this.flippingPage=null,this.bottomPage=null,this.calc=null,this.state="read",this.render=h,this.app=p}fold(h){this.setState("user_fold"),this.calc===null&&this.start(h),this.do(this.render.convertToPage(h))}flip(h){if(this.app.getSettings().disableFlipByClick&&!this.isPointOnCorners(h)||(this.calc!==null&&this.render.finishAnimation(),!this.start(h)))return;const p=this.getBoundsRect();this.setState("flipping");const x=p.height/10,k=this.calc.getCorner()==="bottom"?p.height-x:x,T=this.calc.getCorner()==="bottom"?p.height:0;this.calc.calc({x:p.pageWidth-x,y:k}),this.animateFlippingTo({x:p.pageWidth-x,y:k},{x:-p.pageWidth,y:T},!0)}start(h){this.reset();const p=this.render.convertToBook(h),x=this.getBoundsRect(),k=this.getDirectionByPoint(p),T=p.y>=x.height/2?"bottom":"top";if(!this.checkDirection(k))return!1;try{if(this.flippingPage=this.app.getPageCollection().getFlippingPage(k),this.bottomPage=this.app.getPageCollection().getBottomPage(k),this.render.getOrientation()==="landscape")if(k===1){const E=this.app.getPageCollection().nextBy(this.flippingPage);E!==null&&this.flippingPage.getDensity()!==E.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),E.setDrawingDensity("hard"))}else{const E=this.app.getPageCollection().prevBy(this.flippingPage);E!==null&&this.flippingPage.getDensity()!==E.getDensity()&&(this.flippingPage.setDrawingDensity("hard"),E.setDrawingDensity("hard"))}return this.render.setDirection(k),this.calc=new c(k,T,x.pageWidth.toString(10),x.height.toString(10)),!0}catch{return!1}}do(h){if(this.calc!==null&&this.calc.calc(h)){const p=this.calc.getFlippingProgress();this.bottomPage.setArea(this.calc.getBottomClipArea()),this.bottomPage.setPosition(this.calc.getBottomPagePosition()),this.bottomPage.setAngle(0),this.bottomPage.setHardA
275ngle(0),this.flippingPage.setArea(this.calc.getFlippingClipArea()),this.flippingPage.setPosition(this.calc.getActiveCorner()),this.flippingPage.setAngle(this.calc.getAngle()),this.calc.getDirection()===0?this.flippingPage.setHardAngle(90*(200-2*p)/100):this.flippingPage.setHardAngle(-90*(200-2*p)/100),this.render.setPageRect(this.calc.getRect()),this.render.setBottomPage(this.bottomPage),this.render.setFlippingPage(this.flippingPage),this.render.setShadowData(this.calc.getShadowStartPoint(),this.calc.getShadowAngle(),p,this.calc.getDirection())}}flipToPage(h,p){const x=this.app.getPageCollection().getCurrentSpreadIndex(),k=this.app.getPageCollection().getSpreadIndexByPage(h);try{k>x&&(this.app.getPageCollection().setCurrentSpreadIndex(k-1),this.flipNext(p)),k<x&&(this.app.getPageCollection().setCurrentSpreadIndex(k+1),this.flipPrev(p))}catch{}}flipNext(h){this.flip({x:this.render.getRect().left+2*this.render.getRect().pageWidth-10,y:h==="top"?1:this.render.getRect().height-2})}flipPrev(h){this.flip({x:10,y:h==="top"?1:this.render.getRect().height-2})}stopMove(){if(this.calc===null)return;const h=this.calc.getPosition(),p=this.getBoundsRect(),x=this.calc.getCorner()==="bottom"?p.height:0;h.x<=0?this.animateFlippingTo(h,{x:-p.pageWidth,y:x},!0):this.animateFlippingTo(h,{x:p.pageWidth,y:x},!1)}showCorner(h){if(!this.checkState("read","fold_corner"))return;const p=this.getBoundsRect(),x=p.pageWidth;if(this.isPointOnCorners(h))if(this.calc===null){if(!this.start(h))return;this.setState("fold_corner"),this.calc.calc({x:x-1,y:1});const k=50,T=this.calc.getCorner()==="bottom"?p.height-1:1,E=this.calc.getCorner()==="bottom"?p.height-k:k;this.animateFlippingTo({x:x-1,y:T},{x:x-k,y:E},!1,!1)}else this.do(this.render.convertToPage(h));else this.setState("read"),this.render.finishAnimation(),this.stopMove()}animateFlippingTo(h,p,x,k=!0){const T=o.GetCordsFromTwoPoint(h,p),E=[];for(const j of T)E.push(()=>this.do(j));const R=this.getAnimationDuration(T.length);this.render.startAnimation(E,R,()=>{this.calc&&(x&&(this.calc.getDirection()===1?this.app.turnToPrevPage():this.app.turnToNextPage()),k&&(this.render.setBottomPage(null),this.render.setFlippingPage(null),this.render.clearShadow(),this.setState("read"),this.reset()))})}getCalculation(){return this.calc}getState(){return this.state}setState(h){this.state!==h&&(this.app.updateState(h),this.state=h)}getDirectionByPoint(h){const p=this.getBoundsRect();if(this.render.getOrientation()==="portrait"){if(h.x-p.pageWidth<=p.width/5)return 1}else if(h.x<p.width/2)return 1;return 0}getAnimationDuration(h){const p=this.app.getSettings().flippingTime;return h>=1e3?p:h/1e3*p}checkDirection(h){return h===0?this.app.getCurrentPageIndex()<this.app.getPageCount()-1:this.app.getCurrentPageIndex()>=1}reset(){this.calc=null,this.flippingPage=null,this.bottomPage=null}getBoundsRect(){return this.render.getRect()}checkState(...h){for(const p of h)if(this.state===p)return!0;return!1}isPointOnCorners(h){const p=this.getBoundsRect(),x=p.pageWidth,k=Math.sqrt(Math.pow(x,2)+Math.pow(p.height,2))/5,T=this.render.convertToBook(h);return T.x>0&&T.y>0&&T.x<p.width&&T.y<p.height&&(T.x<k||T.x>p.width-k)&&(T.y<k||T.y>p.height-k)}}class f{constructor(h,p){this.leftPage=null,this.rightPage=null,this.flippingPage=null,this.bottomPage=null,this.direction=null,this.orientation=null,this.shadow=null,this.animation=null,this.pageRect=null,this.boundsRect=null,this.timer=0,this.safari=!1,this.setting=p,this.app=h;const x=new RegExp("Version\\/[\\d\\.]+.*Safari/");this.safari=x.exec(window.navigator.userAgent)!==null}render(h){if(this.animation!==null){const p=Math.round((h-this.animation.startedAt)/this.animation.durationFrame);p<this.animation.frames.length?this.animation.frames[p]():(this.animation.onAnimateEnd(),this.animation=null)}this.timer=h,this.drawFrame()}start(){this.update();const h=p=>{this.render(p),requestAnimationFrame(h)};requestAnimationFrame(h)}startAnimation(h,p,x){this.finishAnimation(),this.animation={frames:h,duration:p,durationFrame:p/h.length,onAnimateEnd:x,startedAt:this.timer}}finishAnimation(){this.animation!==null&&(this.animation.frames[this.animation.frames.length-1](),this.animation.onAnimateEnd!==null&&this.animation.onAnimateEnd()),this.animation=null}update(){this.boundsRect=null;const h=this.calculateBoundsRect();this.orientation!==h&&(this.orientation=h,this.app.updateOrientation(h))}calculateBoundsRect(){let h="landscape";const p=this.getBlockWidth(),x=p/2,k=this.getBlockHeight()/2,T=this.setting.width/this.setting.height;let E=this.setting.width,R=this.setting.height,j=x-E;return this.setting.size==="stretch"?(p<2*this.setting.minWidth&&this.app.getSettings().usePortrait&&(h="portrait"),E=h==="portrait"?this.getBlockWidth():this.getBlockWidth()/2,E>this.setting.maxWidth&&(E=this.setting.maxWidth),R=E/T,R>this.getBlockHeight()&&(R=this.getBlockHeight(),E=R*T),j=h==="portrait"?x-E/2-E:x-E):p<2*E&&this.app.getSettings().usePortrait&&(h="portrait",j=x-E/2-E),this.boundsRect={left:j,top:k-R/2,width:2*E,height:R,pageWidth:E},h}setShadowData(h,p,x,k){if(!this.app.getSettings().drawShadow)return;const T=100*this.getSettings().maxShadowOpacity;this.shadow={pos:h,angle:p,width:3*this.getRect().pageWidth/4*x/100,opacity:(100-x)*T/100/100,direction:k,progress:2*x}}clearShadow(){this.shadow=null}getBlockWidth(){return this.app.getUI().getDistElement().offsetWidth}getBlockHeight(){return this.app.getUI().getDistElement().offsetHeight}getDirection(){return this.direction}getRect(){return this.boundsRect===null&&this.calculateBoundsRect(),this.boundsRect}getSettings(){return this.app.getSettings()}getOrientation(){return this.orientation}setPageRect(h){this.pageRect=h}setDirection(h){this.direction=h}setRightPage(h){h!==null&&h.setOrientation(1),this.rightPage=h}setLeftPage(h){h!==null&&h.setOrientation(0),this.leftPage=h}setBottomPage(h){h!==null&&h.setOrientation(this.direction===1?0:1),this.bottomPage=h}setFlippingPage(h){h!==null&&h.setOrientation(this.direction===0&&this.orientation!=="portrait"?0:1),this.flippingPage=h}convertToBook(h){const p=this.getRect();return{x:h.x-p.left,y:h.y-p.top}}isSafari(){return this.safari}convertToPage(h,p){p||(p=this.direction);const x=this.getRect();return{x:p===0?h.x-x.left-x.width/2:x.width/2-h.x+x.left,y:h.y-x.top}}convertToGlobal(h,p){if(p||(p=this.direction),h==null)return null;const x=this.getRect();return{x:p===0?h.x+x.left+x.width/2:x.width/2-h.x+x.left,y:h.y+x.top}}convertRectToGlobal(h,p){return p||(p=this.direction),{topLeft:this.convertToGlobal(h.topLeft,p),topRight:this.convertToGlobal(h.topRight,p),bottomLeft:this.convertToGlobal(h.bottomLeft,p),bottomRight:this.convertToGlobal(h.bottomRight,p)}}}class m extends f{constructor(h,p,x){super(h,p),this.canvas=x,this.ctx=x.getContext("2d")}getContext(){return this.ctx}reload(){}drawFrame(){this.clear(),this.orientation!=="portrait"&&this.leftPage!=null&&this.leftPage.simpleDraw(0),this.rightPage!=null&&this.rightPage.simpleDraw(1),this.bottomPage!=null&&this.bottomPage.draw(),this.drawBookShadow(),this.flippingPage!=null&&this.flippingPage.draw(),this.shadow!=null&&(this.drawOuterShadow(),this.drawInnerShadow());const h=this.getRect();this.orientation==="portrait"&&(this.ctx.beginPath(),this.ctx.rect(h.left+h.pageWidth,h.top,h.width,h.height),this.ctx.clip())}drawBookShadow(){const h=this.getRect();this.ctx.save(),this.ctx.beginPath();const p=h.width/20;this.ctx.rect(h.left,h.top,h.width,h.height);const x={x:h.left+h.width/2-p/2,y:0};this.ctx.translate(x.x,x.y);const k=this.ctx.createLinearGradient(0,0,p,0);k.addColorStop(0,"rgba(0, 0, 0, 0)"),k.addColorStop(.4,"rgba(0, 0, 0, 0.2)"),k.addColorStop(.49,"rgba(0, 0, 0, 0.1)"),k.addColorStop(.5,"rgba(0, 0, 0, 0.5)"),k.addColorStop(.51,"rgba(0, 0, 0, 0.4)"),k.addColorStop(1,"rgba(0, 0, 0, 0)"),this.ctx.clip(),this.ctx.fillStyle=k,this.ctx.fillRect(0,0,p,2*h.height),this.ctx.restore(
vendor: 9,579 bytes, lines 275-296
275)}drawOuterShadow(){const h=this.getRect();this.ctx.save(),this.ctx.beginPath(),this.ctx.rect(h.left,h.top,h.width,h.height);const p=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y});this.ctx.translate(p.x,p.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const x=this.ctx.createLinearGradient(0,0,this.shadow.width,0);this.shadow.direction===0?(this.ctx.translate(0,-100),x.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),x.addColorStop(1,"rgba(0, 0, 0, 0)")):(this.ctx.translate(-this.shadow.width,-100),x.addColorStop(0,"rgba(0, 0, 0, 0)"),x.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")")),this.ctx.clip(),this.ctx.fillStyle=x,this.ctx.fillRect(0,0,this.shadow.width,2*h.height),this.ctx.restore()}drawInnerShadow(){const h=this.getRect();this.ctx.save(),this.ctx.beginPath();const p=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),x=this.convertRectToGlobal(this.pageRect);this.ctx.moveTo(x.topLeft.x,x.topLeft.y),this.ctx.lineTo(x.topRight.x,x.topRight.y),this.ctx.lineTo(x.bottomRight.x,x.bottomRight.y),this.ctx.lineTo(x.bottomLeft.x,x.bottomLeft.y),this.ctx.translate(p.x,p.y),this.ctx.rotate(Math.PI+this.shadow.angle+Math.PI/2);const k=3*this.shadow.width/4,T=this.ctx.createLinearGradient(0,0,k,0);this.shadow.direction===0?(this.ctx.translate(-k,-100),T.addColorStop(1,"rgba(0, 0, 0, "+this.shadow.opacity+")"),T.addColorStop(.9,"rgba(0, 0, 0, 0.05)"),T.addColorStop(.7,"rgba(0, 0, 0, "+this.shadow.opacity+")"),T.addColorStop(0,"rgba(0, 0, 0, 0)")):(this.ctx.translate(0,-100),T.addColorStop(0,"rgba(0, 0, 0, "+this.shadow.opacity+")"),T.addColorStop(.1,"rgba(0, 0, 0, 0.05)"),T.addColorStop(.3,"rgba(0, 0, 0, "+this.shadow.opacity+")"),T.addColorStop(1,"rgba(0, 0, 0, 0)")),this.ctx.clip(),this.ctx.fillStyle=T,this.ctx.fillRect(0,0,k,2*h.height),this.ctx.restore()}clear(){this.ctx.fillStyle="white",this.ctx.fillRect(0,0,this.canvas.width,this.canvas.height)}}class y{constructor(h,p,x){this.touchPoint=null,this.swipeTimeout=250,this.onResize=()=>{this.update()},this.onMouseDown=T=>{if(this.checkTarget(T.target)){const E=this.getMousePos(T.clientX,T.clientY);this.app.startUserTouch(E),T.preventDefault()}},this.onTouchStart=T=>{if(this.checkTarget(T.target)&&T.changedTouches.length>0){const E=T.changedTouches[0],R=this.getMousePos(E.clientX,E.clientY);this.touchPoint={point:R,time:Date.now()},setTimeout(()=>{this.touchPoint!==null&&this.app.startUserTouch(R)},this.swipeTimeout),this.app.getSettings().mobileScrollSupport||T.preventDefault()}},this.onMouseUp=T=>{const E=this.getMousePos(T.clientX,T.clientY);this.app.userStop(E)},this.onMouseMove=T=>{const E=this.getMousePos(T.clientX,T.clientY);this.app.userMove(E,!1)},this.onTouchMove=T=>{if(T.changedTouches.length>0){const E=T.changedTouches[0],R=this.getMousePos(E.clientX,E.clientY);this.app.getSettings().mobileScrollSupport?(this.touchPoint!==null&&(Math.abs(this.touchPoint.point.x-R.x)>10||this.app.getState()!=="read")&&T.cancelable&&this.app.userMove(R,!0),this.app.getState()!=="read"&&T.preventDefault()):this.app.userMove(R,!0)}},this.onTouchEnd=T=>{if(T.changedTouches.length>0){const E=T.changedTouches[0],R=this.getMousePos(E.clientX,E.clientY);let j=!1;if(this.touchPoint!==null){const L=R.x-this.touchPoint.point.x,O=Math.abs(R.y-this.touchPoint.point.y);Math.abs(L)>this.swipeDistance&&O<2*this.swipeDistance&&Date.now()-this.touchPoint.time<this.swipeTimeout&&(L>0?this.app.flipPrev(this.touchPoint.point.y<this.app.getRender().getRect().height/2?"top":"bottom"):this.app.flipNext(this.touchPoint.point.y<this.app.getRender().getRect().height/2?"top":"bottom"),j=!0),this.touchPoint=null}this.app.userStop(R,j)}},this.parentElement=h,h.classList.add("stf__parent"),h.insertAdjacentHTML("afterbegin",'<div class="stf__wrapper"></div>'),this.wrapper=h.querySelector(".stf__wrapper"),this.app=p;const k=this.app.getSettings().usePortrait?1:2;h.style.minWidth=x.minWidth*k+"px",h.style.minHeight=x.minHeight+"px",x.size==="fixed"&&(h.style.minWidth=x.width*k+"px",h.style.minHeight=x.height+"px"),x.autoSize&&(h.style.width="100%",h.style.maxWidth=2*x.maxWidth+"px"),h.style.display="block",window.addEventListener("resize",this.onResize,!1),this.swipeDistance=x.swipeDistance}destroy(){this.app.getSettings().useMouseEvents&&this.removeHandlers(),this.distElement.remove(),this.wrapper.remove()}getDistElement(){return this.distElement}getWrapper(){return this.wrapper}setOrientationStyle(h){this.wrapper.classList.remove("--portrait","--landscape"),h==="portrait"?(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/this.app.getSettings().width*100+"%"),this.wrapper.classList.add("--portrait")):(this.app.getSettings().autoSize&&(this.wrapper.style.paddingBottom=this.app.getSettings().height/(2*this.app.getSettings().width)*100+"%"),this.wrapper.classList.add("--landscape")),this.update()}removeHandlers(){window.removeEventListener("resize",this.onResize),this.distElement.removeEventListener("mousedown",this.onMouseDown),this.distElement.removeEventListener("touchstart",this.onTouchStart),window.removeEventListener("mousemove",this.onMouseMove),window.removeEventListener("touchmove",this.onTouchMove),window.removeEventListener("mouseup",this.onMouseUp),window.removeEventListener("touchend",this.onTouchEnd)}setHandlers(){window.addEventListener("resize",this.onResize,!1),this.app.getSettings().useMouseEvents&&(this.distElement.addEventListener("mousedown",this.onMouseDown),this.distElement.addEventListener("touchstart",this.onTouchStart),window.addEventListener("mousemove",this.onMouseMove),window.addEventListener("touchmove",this.onTouchMove,{passive:!this.app.getSettings().mobileScrollSupport}),window.addEventListener("mouseup",this.onMouseUp),window.addEventListener("touchend",this.onTouchEnd))}getMousePos(h,p){const x=this.distElement.getBoundingClientRect();return{x:h-x.left,y:p-x.top}}checkTarget(h){return!this.app.getSettings().clickEventForward||!["a","button"].includes(h.tagName.toLowerCase())}}class g extends y{constructor(h,p,x,k){super(h,p,x),this.wrapper.insertAdjacentHTML("afterbegin",'<div class="stf__block"></div>'),this.distElement=h.querySelector(".stf__block"),this.items=k;for(const T of k)this.distElement.appendChild(T);this.setHandlers()}clear(){for(const h of this.items)this.parentElement.appendChild(h)}updateItems(h){this.removeHandlers(),this.distElement.innerHTML="";for(const p of h)this.distElement.appendChild(p);this.items=h,this.setHandlers()}update(){this.app.getRender().update()}}class b extends y{constructor(h,p,x){super(h,p,x),this.wrapper.innerHTML='<canvas class="stf__canvas"></canvas>',this.canvas=h.querySelectorAll("canvas")[0],this.distElement=this.canvas,this.resizeCanvas(),this.setHandlers()}resizeCanvas(){const h=getComputedStyle(this.canvas),p=parseInt(h.getPropertyValue("width"),10),x=parseInt(h.getPropertyValue("height"),10);this.canvas.width=p,this.canvas.height=x}getCanvas(){return this.canvas}update(){this.resizeCanvas(),this.app.getRender().update()}}class _ extends f{constructor(h,p,x){super(h,p),this.outerShadow=null,this.innerShadow=null,this.hardShadow=null,this.hardInnerShadow=null,this.element=x,this.createShadows()}createShadows(){this.element.insertAdjacentHTML("beforeend",`<div class="stf__outerShadow"></div>
276             <div class="stf__innerShadow"></div>
277             <div class="stf__hardShadow"></div>
278             <div class="stf__hardInnerShadow"></div>`),this.outerShadow=this.element.querySelector(".stf__outerShadow"),this.innerShadow=this.element.querySelector(".stf__innerShadow"),this.hardShadow=this.element.querySelector(".stf__hardShadow"),this.hardInnerShadow=this.element.querySelector(".stf__hardInnerShadow")}clearShadow(){super.clearShadow(),this.outerShadow.style.cssText="display: none",this.innerShadow.style.cssText="display: none",this.hardShadow.style.cssText="display: none",this.hardInnerShadow.style.cssText="display: none"}reload(){this.element.querySelector(".stf__outerShadow")||this.createShadows()}drawHardInnerShadow(){const h=this.getRect(),p=this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress;let x=(100-p)*(2.5*h.pageWidth)/100+20;x>h.pageWidth&&(x=h.pageWidth);let k=`
279            display: block;
280            z-index: ${(this.getSettings().startZIndex+5).toString(10)};
281            width: ${x}px;
282            height: ${h.height}px;
283            background: linear-gradient(to right,
284                rgba(0, 0, 0, ${this.shadow.opacity*p/100}) 5%,
285                rgba(0, 0, 0, 0) 100%);
286            left: ${h.left+h.width/2}px;
287            transform-origin: 0 0;
288        `;k+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0);":"transform: translate3d(0, 0, 0) rotateY(180deg);",this.hardInnerShadow.style.cssText=k}drawHardOuterShadow(){const h=this.getRect();let p=(100-(this.shadow.progress>100?200-this.shadow.progress:this.shadow.progress))*(2.5*h.pageWidth)/100+20;p>h.pageWidth&&(p=h.pageWidth);let x=`
289            display: block;
290            z-index: ${(this.getSettings().startZIndex+4).toString(10)};
291            width: ${p}px;
292            height: ${h.height}px;
293            background: linear-gradient(to left, rgba(0, 0, 0, ${this.shadow.opacity}) 5%, rgba(0, 0, 0, 0) 100%);
294            left: ${h.left+h.width/2}px;
295            transform-origin: 0 0;
296        `;x+=this.getDirection()===0&&this.shadow.progress>100||this.getDirection()===1&&this.shadow.progress<=100?"transform: translate3d(0, 0, 0) rotateY(180deg);
296":"transform: translate3d(0, 0, 0);",this.hardShadow.style.cssText=x}drawInnerShadow(){const h=this.getRect(),p=3*this.shadow.width/4,x=this.getDirection()===0?p:0,k=this.getDirection()===0?"to left":"to right",T=this.convertToGlobal(this.shadow.pos),E=this.shadow.angle+3*Math.PI/2,R=[this.pageRect.topLeft,this.pageRect.topRight,this.pageRect.bottomRight,this.pageRect.bottomLeft];let j="polygon( ";for(const O of R){let N=this.getDirection()===1?{x:-O.x+this.shadow.pos.x,y:O.y-this.shadow.pos.y}:{x:O.x-this.shadow.pos.x,y:O.y-this.shadow.pos.y};N=o.GetRotatedPoint(N,{x,y:100},E),j+=N.x+"px "+N.y+"px, "}j=j.slice(0,-2),j+=")";const L=`
297            display: block;
298            z-index: ${(this.getSettings().startZIndex+10).toString(10)};
299            width: ${p}px;
300            height: ${2*h.height}px;
301            background: linear-gradient(${k},
302                rgba(0, 0, 0, ${this.shadow.opacity}) 5%,
303                rgba(0, 0, 0, 0.05) 15%,
304                rgba(0, 0, 0, ${this.shadow.opacity}) 35%,
305                rgba(0, 0, 0, 0) 100%);
306            transform-origin: ${x}px 100px;
307            transform: translate3d(${T.x-x}px, ${T.y-100}px, 0) rotate(${E}rad);
308            clip-path: ${j};
309            -webkit-clip-path: ${j};
310        `;this.innerShadow.style.cssText=L}drawOuterShadow(){const h=this.getRect(),p=this.convertToGlobal({x:this.shadow.pos.x,y:this.shadow.pos.y}),x=this.shadow.angle+3*Math.PI/2,k=this.getDirection()===1?this.shadow.width:0,T=this.getDirection()===0?"to right":"to left",E=[{x:0,y:0},{x:h.pageWidth,y:0},{x:h.pageWidth,y:h.height},{x:0,y:h.height}];let R="polygon( ";for(const L of E)if(L!==null){let O=this.getDirection()===1?{x:-L.x+this.shadow.pos.x,y:L.y-this.shadow.pos.y}:{x:L.x-this.shadow.pos.x,y:L.y-this.shadow.pos.y};O=o.GetRotatedPoint(O,{x:k,y:100},x),R+=O.x+"px "+O.y+"px, "}R=R.slice(0,-2),R+=")";const j=`
311            display: block;
312            z-index: ${(this.getSettings().startZIndex+10).toString(10)};
313            width: ${this.shadow.width}px;
314            height: ${2*h.height}px;
315            background: linear-gradient(${T}, rgba(0, 0, 0, ${this.shadow.opacity}), rgba(0, 0, 0, 0));
316            transform-origin: ${k}px 100px;
317            transform: translate3d(${p.x-k}px, ${p.y-100}px, 0) rotate(${x}rad);
318            clip-path: ${R};
319            -webkit-clip-path: ${R};
320        `;this.outerShadow.style.cssText=j}drawLeftPage(){this.orientation!=="portrait"&&this.leftPage!==null&&(this.direction===1&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(this.leftPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.leftPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.leftPage.draw(this.flippingPage.getDrawingDensity())):this.leftPage.simpleDraw(0))}drawRightPage(){this.rightPage!==null&&(this.direction===0&&this.flippingPage!==null&&this.flippingPage.getDrawingDensity()==="hard"?(this.rightPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.rightPage.setHardDrawingAngle(180+this.flippingPage.getHardAngle()),this.rightPage.draw(this.flippingPage.getDrawingDensity())):this.rightPage.simpleDraw(1))}drawBottomPage(){if(this.bottomPage===null)return;const h=this.flippingPage!=null?this.flippingPage.getDrawingDensity():null;this.orientation==="portrait"&&this.direction===1||(this.bottomPage.getElement().style.zIndex=(this.getSettings().startZIndex+3).toString(10),this.bottomPage.draw(h))}drawFrame(){this.clear(),this.drawLeftPage(),this.drawRightPage(),this.drawBottomPage(),this.flippingPage!=null&&(this.flippingPage.getElement().style.zIndex=(this.getSettings().startZIndex+5).toString(10),this.flippingPage.draw()),this.shadow!=null&&this.flippingPage!==null&&(this.flippingPage.getDrawingDensity()==="soft"?(this.drawOuterShadow(),this.drawInnerShadow()):(this.drawHardOuterShadow(),this.drawHardInnerShadow()))}clear(){for(const h of this.app.getPageCollection().getPages())h!==this.leftPage&&h!==this.rightPage&&h!==this.flippingPage&&h!==this.bottomPage&&(h.getElement().style.cssText="display: none"),h.getTemporaryCopy()!==this.flippingPage&&h.hideTemporaryCopy()}
320update(){super.update(),this.rightPage!==null&&this.rightPage.setOrientation(1),this.leftPage!==null&&this.leftPage.setOrientation(0)}}class v{constructor(){this._default={startPage:0,size:"fixed",width:0,height:0,minWidth:0,maxWidth:0,minHeight:0,maxHeight:0,drawShadow:!0,flippingTime:1e3,usePortrait:!0,startZIndex:0,autoSize:!0,maxShadowOpacity:1,showCover:!1,mobileScrollSupport:!0,swipeDistance:30,clickEventForward:!0,useMouseEvents:!0,showPageCorners:!0,disableFlipByClick:!1}}getSettings(h){const p=this._default;if(Object.assign(p,h),p.size!=="stretch"&&p.size!=="fixed")throw new Error('Invalid size type. Available only "fixed" and "stretch" value');if(p.width<=0||p.height<=0)throw new Error("Invalid width or height");if(p.flippingTime<=0)throw new Error("Invalid flipping time");return p.size==="stretch"?(p.minWidth<=0&&(p.minWidth=100),p.maxWidth<p.minWidth&&(p.maxWidth=2e3),p.minHeight<=0&&(p.minHeight=100),p.maxHeight<p.minHeight&&(p.maxHeight=2e3)):(p.minWidth=p.width,p.maxWidth=p.width,p.minHeight=p.height,p.maxHeight=p.height),p}}(function(w,h){h===void 0&&(h={});var p=h.insertAt;if(typeof document<"u"){var x=document.head||document.getElementsByTagName("head")[0],k=document.createElement("style");k.type="text/css",p==="top"&&x.firstChild?x.insertBefore(k,x.firstChild):x.appendChild(k),k.styleSheet?k.styleSheet.cssText=w:k.appendChild(document.createTextNode(w))}})(`.stf__parent {
321  position: relative;
322  display: block;
323  box-sizing: border-box;
324  transform: translateZ(0);
325
326  -ms-touch-action: pan-y;
327  touch-action: pan-y;
328}
329
330.sft__wrapper {
331  position: relative;
332  width: 100%;
333  box-sizing: border-box;
334}
335
336.stf__parent canvas {
337  position: absolute;
338  width: 100%;
339  height: 100%;
340  left: 0;
341  top: 0;
342}
343
344.stf__block {
345  position: absolute;
346  width: 100%;
347  height: 100%;
348  box-sizing: border-box;
349  perspective: 2000px;
350}
351
352.stf__item {
353  display: none;
354  position: absolute;
355  transform-style: preserve-3d;
356}
357
358.stf__outerShadow {
359  position: absolute;
360  left: 0;
361  top: 0;
362}
363
364.stf__innerShadow {
365  position: absolute;
366  left: 0;
367  top: 0;
368}
369
370.stf__hardShadow {
371  position: absolute;
372  left: 0;
373  top: 0;
374}
375
376.stf__hardInnerShadow {
377  position: absolute;
378  left: 0;
379  top: 0;
380}`),r.PageFlip=class extends class{constructor(){this.events=new Map}on(w,h){return this.events.has(w)?this.events.get(w).push(h):this.events.set(w,[h]),this}off(w){this.events.delete(w)}trigger(w,h,p=null){if(this.events.has(w))for(const x of this.events.get(w))x({data:p,object:h})}}{constructor(w,h){super(),this.isUserTouch=!1,this.isUserMove=!1,this.setting=null,this.pages=null,this.setting=new v().getSettings(h),this.block=w}destroy(){this.ui.destroy(),this.block.remove()}update(){this.render.update(),this.pages.show()}loadFromImages(w){this.ui=new b(this.block,this,this.setting);const h=this.ui.getCanvas();this.render=new m(this,this.setting,h),this.flipController=new d(this.render,this),this.pages=new a(this,this.render,w),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout(()=>{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}loadFromHTML(w){this.ui=new g(this.block,this,this.setting,w),this.render=new _(this,this.setting,this.ui.getDistElement()),this.flipController=new d(this.render,this),this.pages=new u(this,this.render,this.ui.getDistElement(),w),this.pages.load(),this.render.start(),this.pages.show(this.setting.startPage),setTimeout(()=>{this.ui.update(),this.trigger("init",this,{page:this.setting.startPage,mode:this.render.getOrientation()})},1)}updateFromImages(w){const h=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new a(this,this.render,w),this.pages.load(),this.pages.show(h),this.trigger("update",this,{page:h,mode:this.render.getOrientation()})}updateFromHtml(w){const h=this.pages.getCurrentPageIndex();this.pages.destroy(),this.pages=new u(this,this.render,this.ui.getDistElement(),w),this.pages.load(),this.ui.updateItems(w),this.render.reload(),this.pages.show(h),this.trigger("update",this,{page:h,mode:this.render.getOrientation()})}clear(){this.pages.destroy(),this.ui.clear()}turnToPrevPage(){this.pages.showPrev()}turnToNextPage(){this.pages.showNext()}turnToPage(w){this.pages.show(w)}flipNext(w="top"){this.flipController.flipNext(w)}flipPrev(w="top"){this.flipController.flipPrev(w)}flip(w,h="top"){this.flipController.flipToPage(w,h)}updateState(w){this.trigger("changeState",this,w)}updatePageIndex(w){this.trigger("flip",this,w)}updateOrientation(w){this.ui.setOrientationStyle(w),this.update(),this.trigger("changeOrientation",this,w)}getPageCount(){return this.pages.getPageCount()}getCurrentPageIndex(){return this.pages.getCurrentPageIndex()}getPage(w){return this.pages.getPage(w)}getRender(){return this.render}getFlipController(){return this.flipController}getOrientation(){return this.render.getOrientation()}getBoundsRect(){return this.render.getRect()}getSettings(){return this.setting}getUI(){return this.ui}getState(){return this.flipController.getState()}getPageCollection(){return this.pages}startUserTouch(w){this.mousePosition=w,this.isUserTouch=!0,this.isUserMove=!1}userMove(w,h){this.isUserTouch||h||!this.setting.showPageCorners?this.isUserTouch&&o.GetDistanceBetweenTwoPoint(this.mousePosition,w)>5&&(this.isUserMove=!0,this.flipController.fold(w)):this.flipController.showCorner(w)}userStop(w,h=!1){this.isUserTouch&&(this.isUserTouch=!1,h||(this.isUserMove?this.flipController.stopMove():this.flipController.flip(w)))}}
380,Object.defineProperty(r,"__esModule",{value:!0})})})(dh,dh.exports);var fC=dh.exports;const pC=$.forwardRef((t,e)=>{const r=P.useRef(null),n=P.useRef([]),s=P.useRef(),[i,a]=P.useState([]);P.useImperativeHandle(e,()=>({pageFlip:()=>s.current}));const o=P.useCallback(()=>{s.current&&s.current.clear()},[]),l=P.useCallback(()=>{const u=s.current;u&&(u.off("flip"),u.off("changeOrientation"),u.off("changeState"),u.off("init"),u.off("update"))},[]);return P.useEffect(()=>{if(n.current=[],t.children){const u=$.Children.map(t.children,c=>$.cloneElement(c,{ref:d=>{d&&n.current.push(d)}}));(!t.renderOnlyPageLengthChange||i.length!==u.length)&&(u.length<i.length&&o(),a(u))}},[t.children]),P.useEffect(()=>{const u=()=>{const c=s.current;c&&(t.onFlip&&c.on("flip",d=>t.onFlip(d)),t.onChangeOrientation&&c.on("changeOrientation",d=>t.onChangeOrientation(d)),t.onChangeState&&c.on("changeState",d=>t.onChangeState(d)),t.onInit&&c.on("init",d=>t.onInit(d)),t.onUpdate&&c.on("update",d=>t.onUpdate(d)))};i.length>0&&n.current.length>0&&(l(),r.current&&!s.current&&(s.current=new fC.PageFlip(r.current,t)),s.current.getFlipController()?s.current.updateFromHtml(n.current):s.current.loadFromHTML(n.current),u())},[i]),$.createElement("div",{ref:r,className:t.className,style:t.style},i)}),mC=$.memo(pC);function gC(t=""){return t.trim().split(" ").filter(e=>!!e.trim())}function vC(t){Object.keys(t).forEach(e=>{try{t[e]=null}catch{}try{delete t[e]}catch{}})}function Hw(t,e=0){return setTimeout(t,e)}function su(){return Date.now()}function yC(t){return window.getComputedStyle(t,null)}function wC(t,e="x"){const r=yC(t),n=r.transform||r.webkitTransform;if(!n||n==="none")return 0;const s=new DOMMatrixReadOnly(n);return e==="x"?s.m41:s.m42}function tl(t){return typeof t=="object"&&t!==null&&!!t.constructor&&Object.prototype.toString.call(t).slice(8,-1)==="Object"}function _C(t){return typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:!!t&&typeof t=="object"&&(t.nodeType===1||t.nodeType===11)}function Bt(t,...e){const r=Object(t);for(let n=0;n<e.length;n+=1){const s=e[n];if(s==null||_C(s))continue;const i=s,a=Object.keys(Object(i));for(let o=0,l=a.length;o<l;o+=1){const u=a[o];if(u==="__proto__"||u==="constructor"||u==="prototype")continue;const c=Object.getOwnPropertyDescriptor(i,u);if(!c||!c.enumerable)continue;const d=i[u];tl(r[u])&&tl(d)?d.__swiper__?r[u]=d:Bt(r[u],d):!tl(r[u])&&tl(d)?(r[u]={},d.__swiper__?r[u]=d:Bt(r[u],d)):r[u]=d}}return r}function Bs(t,e,r){t.style.setProperty(e,r)}function Gf(t){const e=t.querySelector(".swiper-slide-transform");if(e)return e;if(t.shadowRoot){const r=t.shadowRoot.querySelector(".swiper-slide-transform");if(r)return r}return t}function en(t,e=""){const r=[...t.children];return t instanceof HTMLSlotElement&&r.push(...t.assignedElements()),e?r.filter(n=>n.matches(e)):r}function xC(t,e){const r=[e];for(;r.length>0;){const n=r.shift();if(t===n)return!0;r.push(...n.children,...n.shadowRoot?n.shadowRoot.children:[],...n.assignedElements?n.assignedElements():[])}return!1}function bC(t,e){let r=e.contains(t);return!r&&e instanceof HTMLSlotElement&&(r=[...e.assignedElements()].includes(t),r||(r=xC(t,e))),r}function iu(t){try{console.warn(t)}catch{}}function au(t,e=[]){const r=document.createElement(t);return r.classList.add(...Array.isArray(e)?e:gC(e)),r}function SC(t,e){const r=[];let n=t.previousElementSibling;for(;n;)(!e||n.matches(e))&&r.push(n),n=n.previousElementSibling;return r}function kC(t,e){const r=[];let n=t.nextElementSibling;for(;n;)(!e||n.matches(e))&&r.push(n),n=n.nextElementSibling;return r}function kn(t,e){return window.getComputedStyle(t,null).getPropertyValue(e)}function Ag(t){if(!(!t||!t.parentNode))return[...t.parentNode.children].indexOf(t)}function EC(t,e){const r=[];let n=t.parentElement;for(;n;)r.push(n),n=n.parentElement;return r}function TC(t,e){e&&t.addEventListener("transitionend",function(n){n.target===t&&e.call(t,n)},{once:!0})}function Rg(t,e,r){{const n=window.getComputedStyle(t,null);return t[e==="width"?"offsetWidth":"offsetHeight"]+parseFloat(n.getPropertyValue(e==="width"?"margin-right":"margin-top"))+parseFloat(n.getPropertyValue(e==="width"?"margin-left":"margin-bottom"))}}function CC(t){return e=>Math.abs(e)>0&&t.browser&&t.browser.need3dFix&&Math.abs(e)%90===0?e+.001:e}function Og(t,e=""){const r=globalThis.trustedTypes;typeof r<"u"?t.innerHTML=r.createPolicy("html",{createHTML:n=>n}).createHTML(e):t.innerHTML=e}const Gw=["eventsPrefix","injectStyles","injectStylesUrls","modules","init","_direction","oneWayMovement","swiperElementNodeName","touchEventsTarget","initialSlide","_speed","cssMode","updateOnWindowResize","resizeObserver","nested","focusableElements","_enabled","_width","_height","preventInteractionOnTransition","userAgent","url","_edgeSwipeDetection","_edgeSwipeThreshold","_freeMode","_autoHeight","setWrapperSize","virtualTranslate","_effect","breakpoints","breakpointsBase","_spaceBetween","_slidesPerView","maxBackfaceHiddenSlides","_grid","_slidesPerGroup","_slidesPerGroupSkip","_slidesPerGroupAuto","_centeredSlides","_centeredSlidesB
380ounds","_slidesOffsetBefore","_slidesOffsetAfter","normalizeSlideIndex","_centerInsufficientSlides","_snapToSlideEdge","_watchOverflow","roundLengths","touchRatio","touchAngle","simulateTouch","_shortSwipes","_longSwipes","longSwipesRatio","longSwipesMs","_followFinger","allowTouchMove","_threshold","touchMoveStopPropagation","touchStartPreventDefault","touchStartForcePreventDefault","touchReleaseOnEdges","uniqueNavElements","_resistance","_resistanceRatio","_watchSlidesProgress","_grabCursor","preventClicks","preventClicksPropagation","_slideToClickedSlide","_loop","loopAdditionalSlides","loopAddBlankSlides","loopPreventsSliding","_rewind","_allowSlidePrev","_allowSlideNext","_swipeHandler","_noSwiping","noSwipingClass","noSwipingSelector","passiveListeners","containerModifierClass","slideClass","slideActiveClass","slideVisibleClass","slideFullyVisibleClass","slideNextClass","slidePrevClass","slideBlankClass","wrapperClass","lazyPreload","lazyPreloaderClass","lazyPreloadPrevNext","runCallbacksOnInit","observer","observeParents","observeSlideChildren","a11y","_autoplay","_controller","coverflowEffect","cubeEffect","fadeEffect","flipEffect","creativeEffect","cardsEffect","hashNavigation","history","keyboard","mousewheel","_navigation","_pagination","parallax","_scrollbar","_thumbs","virtual","zoom","control"];function We(t){if(typeof t!="object"||t===null)return!1;const e=t;return!!e.constructor&&Object.prototype.toString.call(e).slice(8,-1)==="Object"&&!e.__swiper__}function vi(t,e){const r=t,n=e,s=Object.keys(n);for(let i=0,a=s.length;i<a;i+=1){const o=s[i];if(o==="__proto__"||o==="constructor"||o==="prototype")continue;const l=n[o],u=r[o];typeof u>"u"?r[o]=l:We(l)&&We(u)&&Object.keys(l).length>0?l.__swiper__?r[o]=l:vi(u,l):r[o]=l}return t}function qw(t={}){const e=t.navigation;return e?e===!0?!0:typeof e.nextEl>"u"&&typeof e.prevEl>"u":!1}function Kw(t={}){const e=t.pagination;return e?e===!0?!0:typeof e.el>"u":!1}function Jw(t={}){const e=t.scrollbar;return e?e===!0?!0:typeof e.el>"u":!1}function Zw(t=""){const e=t.split(" ").map(n=>n.trim()).filter(n=>!!n),r=[];return e.forEach(n=>{r.indexOf(n)<0&&r.push(n)}),r.join(" ")}function PC(t=""){return t?t.includes("swiper-wrapper")?t:`swiper-wrapper ${t}`:"swiper-wrapper"}function AC(t){var D,K;let{nextEl:e,prevEl:r,scrollbarEl:n,paginationEl:s}=t;const{swiper:i,slides:a,passedParams:o,changedParams:l}=t,u=l.filter(U=>U!=="children"&&U!=="direction"&&U!=="wrapperClass"),{params:c,pagination:d,navigation:f,scrollbar:m,virtual:y,thumbs:g}=i,b=o,_=c;let v,w,h,p,x,k,T,E;const R=b.thumbs,j=_.thumbs;l.includes("thumbs")&&We(R)&&R.swiper&&!R.swiper.destroyed&&We(j)&&(!j.swiper||j.swiper.destroyed)&&(v=!0);const L=b.controller,O=_.controller;l.includes("controller")&&We(L)&&L.control&&We(O)&&!O.control&&(w=!0);const N=b.pagination;l.includes("pagination")&&We(N)&&(N.el||s)&&(_.pagination||_.pagination===!1)&&d&&!d.el&&(h=!0);const M=b.scrollbar;l.includes("scrollbar")&&We(M)&&(M.el||n)&&(_.scrollbar||_.scrollbar===!1)&&m&&!m.el&&(p=!0);const X=b.navigation;l.includes("navigation")&&We(X)&&(X.prevEl||r)&&(X.nextEl||e)&&(_.navigation||_.navigation===!1)&&f&&!f.prevEl&&!f.nextEl&&(x=!0);const q=U=>{var ce,xe,nt;const W=i[U];if(!W)return;W.destroy();const re=_[U],oe=We(re)?re:void 0;U==="navigation"?(i.isElement&&((ce=W.prevEl)==null||ce.remove(),(xe=W.nextEl)==null||xe.remove()),oe&&(oe.prevEl=void 0,oe.nextEl=void 0),W.prevEl=void 0,W.nextEl=void 0):(i.isElement&&((nt=W.el)==null||nt.remove()),oe&&(oe.el=void 0),W.el=void 0)};if(l.includes("loop")&&i.isElement&&(c.loop&&!o.loop?k=!0:!c.loop&&o.loop?T=!0:E=!0),u.forEach(U=>{const W=_[U],re=b[U];We(W)&&We(re)?(Object.assign(W,re),(U==="navigation"||U==="pagination"||U==="scrollbar")&&"enabled"in re&&!re.enabled&&q(U)):(re===!0||re===!1)&&(U==="navigation"||U==="pagination"||U==="scrollbar")?re===!1&&q(U):_[U]=re}),u.includes("controller")&&!w&&i.controller&&i.controller.control&&We(O)&&O.control&&(i.controller.control=O.control),l.includes("children")&&a&&y&&((D=c.virtual)!=null&&D.enabled)?(y.slides=a,y.update(!0)):l.includes("virtual")&&y&&((K=c.virtual)!=null&&K.enabled)&&(a&&(y.slides=a),y.update(!0)),l.includes("children")&&a&&c.loop&&(E=!0),v&&g&&g.init()&&g.update(!0),w&&i.controller&&We(O)&&(i.controller.control=O.control),h&&d){if(i.isElement&&(!s||typeof s=="string")){const W=document.createElement("div");W.classList.add("swiper-pagination"),W.part.add("pagination"),i.el.appendChild(W),s=W}const U=_.pagination;s&&We(U)&&(U.el=s),d.init(),d.render(),d.update()}if(p&&m){if(i.isElement&&(!n||typeof n=="string")){const W=document.createElement("div");W.classList.add("swiper-scrollbar"),W.part.add("scrollbar"),i.el.appendChild(W),n=W}const U=_.scrollbar;
vendor: 25,429 bytes, line 380
380n&&We(U)&&(U.el=n),m.init(),m.updateSize(),m.setTranslate()}if(x&&f){if(i.isElement){if(!e||typeof e=="string"){const W=document.createElement("div");W.classList.add("swiper-button-next"),Og(W,f.arrowSvg),W.part.add("button-next"),i.el.appendChild(W),e=W}if(!r||typeof r=="string"){const W=document.createElement("div");W.classList.add("swiper-button-prev"),Og(W,f.arrowSvg),W.part.add("button-prev"),i.el.appendChild(W),r=W}}const U=_.navigation;e&&We(U)&&(U.nextEl=e),r&&We(U)&&(U.prevEl=r),f.init(),f.update()}l.includes("allowSlideNext")&&(i.allowSlideNext=b.allowSlideNext),l.includes("allowSlidePrev")&&(i.allowSlidePrev=b.allowSlidePrev),l.includes("direction")&&i.changeDirection(b.direction,!1),(k||E)&&i.loopDestroy(),(T||E)&&i.loopCreate(),i.update()}let $c;function RC(){return typeof window>"u"?{touch:!1}:{touch:"ontouchstart"in window||navigator.maxTouchPoints>0}}function Yw(){return $c||($c=RC()),$c}let zc;function OC({userAgent:t}={}){if(typeof window>"u")return{ios:!1,android:!1};const e=Yw(),r=navigator.platform,n=t||navigator.userAgent,s={ios:!1,android:!1},i=/(Android);?[\s/]+([\d.]+)?/.test(n),a=/(iPhone\sOS|iOS|iPod)/.test(n),o=/iPad/.test(n),l=r==="MacIntel"&&e.touch&&navigator.maxTouchPoints>1,u=o||l;return i&&!(r==="Win32")&&(s.os="android",s.android=!0),(u||a)&&(s.os="ios",s.ios=!0),s}function Xw(t={}){return zc||(zc=OC(t)),zc}let Uc;function IC(){if(typeof window>"u")return{isSafari:!1,isWebView:!1,need3dFix:!1};const t=Xw(),e=navigator.userAgent,r=e.toLowerCase(),n=r.includes("safari")&&!r.includes("chrome")&&!r.includes("android"),s=/(iPhone|iPod|iPad).*AppleWebKit(?!.*Safari)/i.test(e),i=n||s&&t.ios;return{isSafari:n,isWebView:s,need3dFix:i}}function Qw(){return Uc||(Uc=IC()),Uc}const gl=(t,e)=>{if(!t||t.destroyed||!t.params||!t.params.lazyPreload)return;const r=()=>t.isElement?"swiper-slide":`.${t.params.slideClass}`,n=e.closest(r());if(n){let s=n.querySelector(`.${t.params.lazyPreloaderClass}`);!s&&t.isElement&&(n.shadowRoot?s=n.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`):requestAnimationFrame(()=>{if(n.shadowRoot){const i=n.shadowRoot.querySelector(`.${t.params.lazyPreloaderClass}`);i&&!i.lazyPreloaderManaged&&i.remove()}})),s&&!s.lazyPreloaderManaged&&s.remove()}},Bc=(t,e)=>{if(!t.slides[e])return;const r=t.slides[e].querySelector('[loading="lazy"]');r&&r.removeAttribute("loading")},e_=t=>{if(!t||t.destroyed||!t.params||!t.params.lazyPreload)return;let e=t.params.lazyPreloadPrevNext;const r=t.slides.length;if(!r||!e||e<0)return;e=Math.min(e,r);const n=t.params.slidesPerView==="auto"?t.slidesPerViewDynamic():Math.ceil(t.params.slidesPerView),s=t.activeIndex;if(t.params.grid&&(t.params.grid.rows??1)>1){const a=s,o=[a-e];o.push(...Array.from({length:e}).map((l,u)=>a+n+u)),t.slides.forEach((l,u)=>{l.column!==void 0&&o.includes(l.column)&&Bc(t,u)});return}const i=s+n-1;if(t.params.rewind||t.params.loop)for(let a=s-e;a<=i+e;a+=1){const o=(a%r+r)%r;(o<s||o>i)&&Bc(t,o)}else for(let a=Math.max(s-e,0);a<=Math.min(i+e,r-1);a+=1)a!==s&&(a>i||a<s)&&Bc(t,a)};function NC(t,e="window",r){if(!t||e==="container"&&!r)return;let n=!1;const s=e==="window"?window.innerHeight:r.clientHeight,i=Object.keys(t).map(a=>{if(typeof a=="string"&&a.indexOf("@")===0){const o=parseFloat(a.substr(1));return{value:s*o,point:a}}return{value:a,point:a}});i.sort((a,o)=>parseInt(String(a.value),10)-parseInt(String(o.value),10));for(let a=0;a<i.length;a+=1){const{point:o,value:l}=i[a];e==="window"?window.matchMedia(`(min-width: ${l}px)`).matches&&(n=o):l<=r.clientWidth&&(n=o)}return n||"max"}const Ig=(t,e)=>!!(t.grid&&e.grid&&e.grid.rows>1);function LC(){const t=this,{realIndex:e,initialized:r,params:n,el:s}=t,i=n.breakpoints;if(!i||i&&Object.keys(i).length===0)return;const a=n.breakpointsBase==="window"||!n.breakpointsBase?n.breakpointsBase:"container",o=["window","container"].includes(n.breakpointsBase)||!n.breakpointsBase?t.el:document.querySelector(n.breakpointsBase),l=t.getBreakpoint(i,a,o);if(!l||t.currentBreakpoint===l)return;const u=i,d=(l in u?u[l]:void 0)||t.originalParams,f=Ig(t,n),m=Ig(t,d),y=t.params.grabCursor,g=d.grabCursor,b=n.enabled;f&&!m?(s.classList.remove(`${n.containerModifierClass}grid`,`${n.containerModifierClass}grid-column`),t.emitContainerClasses()):!f&&m&&(s.classList.add(`${n.containerModifierClass}grid`),(d.grid.fill&&d.grid.fill==="column"||!d.grid.fill&&n.grid.fill==="column")&&s.classList.add(`${n.containerModifierClass}grid-column`),t.emitContainerClasses()),y&&!g?t.unsetGrabCursor():!y&&g&&t.setGrabCursor();const _=(k,T)=>k[T];["navigation","pagination","scrollbar"].forEach(k=>{var O,N;const T=_(d,k);if(typeof T>"u")return;const E=_(n,k),R=typeof E=="object"&&E!==null&&E.enabled,j=typeof T=="object"&&T!==null&&T.enabled,L=t[k];R&&!j&&((O=L==null?void 0:L.disable)==null||O.call(L)),!R&&j&&((N=L==null?void 0:L.enable)==null||N.call(L))});const v=d.direction&&d.direction!==n.direction,w=n.loop&&(d.slidesPerView!==n.slidesPerView||v),h=n.loop;v&&r&&t.changeDirection(),Bt(t.params,d);const p=t.params.enabled,x=t.params.loop;Object.assign(t,{allowTouchMove:t.params.allowTouchMove,allowSlideNext:t.params.allowSlideNext,allowSlidePrev:t.params.allowSlidePrev}),b&&!p?t.disable():!b&&p&&t.enable(),t.currentBreakpoint=l,t.emit("_beforeBreakpoint",d),r&&(w?(t.loopDestroy(),t.loopCreate(e),t.updateSlides()):!h&&x?(t.loopCreate(e),t.updateSlides()):h&&!x&&t.loopDestroy()),t.emit("breakpoint",d)}var jC={setBreakpoint:LC,getBreakpoint:NC};function MC(){const t=this,{isLocked:e,params:r}=t,{slidesOffsetBefore:n}=r;if(n){const s=t.slides.length-1,i=t.slidesGrid[s]+t.slidesSizesGrid[s]+n*2;t.isLocked=t.size>i}else t.isLocked=t.snapGrid.length===1;r.allowSlideNext===!0&&(t.allowSlideNext=!t.isLocked),r.allowSlidePrev===!0&&(t.allowSlidePrev=!t.isLocked),e&&e!==t.isLocked&&(t.isEnd=!1),e!==t.isLocked&&t.emit(t.isLocked?"lock":"unlock")}var DC={checkOverflow:MC};function $C(t,e){const r=[];return t.forEach(n=>{typeof n=="object"?Object.keys(n).forEach(s=>{n[s]&&r.push(e+s)}):typeof n=="string"&&r.push(e+n)}),r}function zC(){const t=this,{classNames:e,params:r,rtl:n,el:s,device:i}=t,a=$C(["initialized",r.direction,{"free-mode":t.params.freeMode&&r.freeMode.enabled},{autoheight:r.autoHeight},{rtl:n},{grid:r.grid&&r.grid.rows>1},{"grid-column":r.grid&&r.grid.rows>1&&r.grid.fill==="column"},{android:i.android},{ios:i.ios},{"css-mode":r.cssMode},{centered:r.cssMode&&r.centeredSlides},{"watch-progress":r.watchSlidesProgress}],r.containerModifierClass);e.push(...a),s.classList.add(...e),t.emitContainerClasses()}function UC(){const t=this,{el:e,classNames:r}=t;!e||typeof e=="string"||(e.classList.remove(...r),t.emitContainerClasses())}var BC={addClasses:zC,removeClasses:UC};const qf={init:!0,direction:"horizontal",oneWayMovement:!1,swiperElementNodeName:"SWIPER-CONTAINER",touchEventsTarget:"wrapper",initialSlide:0,speed:300,cssMode:!1,updateOnWindowResize:!0,resizeObserver:!0,nested:!1,createElements:!1,eventsPrefix:"swiper",enabled:!0,focusableElements:"input, select, option, textarea, button, video, label",width:null,height:null,preventInteractionOnTransition:!1,userAgent:null,url:null,edgeSwipeDetection:!1,edgeSwipeThreshold:20,autoHeight:!1,setWrapperSize:!1,virtualTranslate:!1,effect:"slide",breakpoints:void 0,breakpointsBase:"window",spaceBetween:0,slidesPerView:1,slidesPerGroup:1,slidesPerGroupSkip:0,slidesPerGroupAuto:!1,centeredSlides:!1,centeredSlidesBounds:!1,slidesOffsetBefore:0,slidesOffsetAfter:0,normalizeSlideIndex:!0,centerInsufficientSlides:!1,snapToSlideEdge:!1,watchOverflow:!0,roundLengths:!1,touchRatio:1,touchAngle:45,simulateTouch:!0,shortSwipes:!0,longSwipes:!0,longSwipesRatio:.5,longSwipesMs:300,followFinger:!0,allowTouchMove:!0,threshold:5,touchMoveStopPropagation:!1,touchStartPreventDefault:!0,touchStartForcePreventDefault:!1,touchReleaseOnEdges:!1,uniqueNavElements:!0,resistance:!0,resistanceRatio:.85,watchSlidesProgress:!1,grabCursor:!1,preventClicks:!0,preventClicksPropagation:!0,slideToClickedSlide:!1,loop:!1,loopAddBlankSlides:!0,loopAdditionalSlides:0,loopPreventsSliding:!0,rewind:!1,allowSlidePrev:!0,allowSlideNext:!0,swipeHandler:null,noSwiping:!0,noSwipingClass:"swiper-no-swiping",noSwipingSelector:null,passiveListeners:!0,maxBackfaceHiddenSlides:10,containerModifierClass:"swiper-",slideClass:"swiper-slide",slideBlankClass:"swiper-slide-blank",slideActiveClass:"swiper-slide-active",slideVisibleClass:"swiper-slide-visible",slideFullyVisibleClass:"swiper-slide-fully-visible",slideNextClass:"swiper-slide-next",slidePrevClass:"swiper-slide-prev",wrapperClass:"swiper-wrapper",lazyPreload:!0,lazyPreloaderClass:"swiper-lazy-preloader",lazyPreloadPrevNext:0,runCallbacksOnInit:!0,_emitClasses:!1};var FC={on(t,e,r){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const s=r?"unshift":"push";return t.split(" ").forEach(i=>{n.eventsListeners[i]||(n.eventsListeners[i]=[]),n.eventsListeners[i][s](e)}),n},once(t,e,r){const n=this;if(!n.eventsListeners||n.destroyed||typeof e!="function")return n;const s=function(...a){n.off(t,s),s.__emitterProxy&&delete s.__emitterProxy,e.apply(n,a)};return s.__emitterProxy=e,n.on(t,s,r)},onAny(t,e){const r=this;if(!r.eventsListeners||r.destroyed||typeof t!="function")return r;const n=e?"unshift":"push";return r.eventsAnyListeners.indexOf(t)<0&&r.eventsAnyListeners[n](t),r},offAny(t){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsAnyListeners)return e;const r=e.eventsAnyListeners.indexOf(t);return r>=0&&e.eventsAnyListeners.splice(r,1),e},off(t,e){const r=this;return!r.eventsListeners||r.destroyed||!r.eventsListeners||t.split(" ").forEach(n=>{typeof e>"u"?r.eventsListeners[n]=[]:r.eventsListeners[n]&&r.eventsListeners[n].forEach((s,i)=>{(s===e||s.__emitterProxy&&s.__emitterProxy===e)&&r.eventsListeners[n].splice(i,1)})}),r},emit(...t){const e=this;if(!e.eventsListeners||e.destroyed||!e.eventsListeners)return e;let r,n,s;if(typeof t[0]=="string"||Array.isArray(t[0]))r=t[0],n=t.slice(1,t.length),s=e;else{const a=t[0];r=a.events,n=a.data??[],s=a.context||e}return n.unshift(s),(Array.isArray(r)?r:r.split(" ")).forEach(a=>{e.eventsAnyListeners&&e.eventsAnyListeners.length&&e.eventsAnyListeners.forEach(o=>{o.apply(s,[a,...n])}),e.eventsListeners&&e.eventsListeners[a]&&e.eventsListeners[a].forEach(o=>{o.apply(s,n)})}),e}};function VC(t){const e=this;e.destroyed||e.enabled&&(e.allowClick||(e.params.preventClicks&&t.preventDefault(),e.params.preventClicksPropagation&&e.animating&&(t.stopPropagation(),t.stopImmediatePropagation())))}function WC(){const t=this;t.destroyed||t.documentTouchHandlerProceeded||(t.documentTouchHandlerProceeded=!0,t.params.touchReleaseOnEdges&&(t.el.style.touchAction="auto"))}function HC(t){const e=this;e.destroyed||(gl(e,t.target),!(e.params.cssMode||e.params.slidesPerView!=="auto"&&!e.params.autoHeight)&&e.update())}function GC(){var l;const t=this,{params:e,el:r}=t;if(r&&r.offsetWidth===0)return;e.breakpoints&&t.setBreakpoint();const{allowSlideNext:n,allowSlidePrev:s,snapGrid:i}=t,a=t.virtual&&((l=t.params.virtual)==null?void 0:l.enabled);t.allowSlideNext=!0,t.allowSlidePrev=!0,t.updateSize(),t.updateSlides(),t.updateSlidesClasses();const o=a&&e.loop;if((e.slidesPerView==="auto"||e.slidesPerView>1)&&t.isEnd&&!t.isBeginning&&!t.params.centeredSlides&&!o){const u=a?t.virtual.slides.length:t.slides.length;t.slideTo(u-1,0,!1,!0)}else t.params.loop&&!a?t.slideToLoop(t.realIndex,0,!1,!0):t.slideTo(t.activeIndex,0,!1,!0);if(t.autoplay&&t.autoplay.running&&t.autoplay.paused){const u=t.autoplay;clearTimeout(u.resizeTimeout),u.resizeTimeout=setTimeout(()=>{t.autoplay&&t.autoplay.running&&t.autoplay.paused&&t.autoplay.resume()},500)}t.allowSlidePrev=s,t.allowSlideNext=n,t.params.watchOverflow&&i!==t.snapGrid&&t.checkOverflow()}function qC(){const t=this;if(t.destroyed)return;const{wrapperEl:e,rtlTranslate:r,enabled:n}=t;if(!n)return;t.previousTranslate=t.translate,t.isHorizontal()?t.translate=-e.scrollLeft:t.translate=-e.scrollTop,t.translate===0&&(t.translate=0),t.updateActiveIndex(),t.updateSlidesClasses();let s;const i=t.maxTranslate()-t.minTranslate();i===0?s=0:s=(t.translate-t.minTranslate())/i,s!==t.progress&&t.updateProgress(r?-t.translate:t.translate),t.emit("setTranslate",t.translate,!1)}function KC(t){var h;const e=this;if(e.destroyed)return;const r=e.touchEventsData;let n=t.originalEvent??t;if(n.type==="touchend"||n.type==="touchcancel"){const x=[...n.changedTouches].find(k=>k.identifier===r.touchId);if(!x||x.identifier!==r.touchId)return}else if(r.touchId!==null||n.pointerId!==r.pointerId)return;if(["pointercancel","pointerout","pointerleave","contextmenu"].includes(n.type)&&!(["pointercancel","contextmenu"].includes(n.type)&&(e.browser.isSafari||e.browser.isWebView)))return;r.pointerId=null,r.touchId=null;const{params:i,touches:a,rtlTranslate:o,slidesGrid:l,enabled:u}=e;if(!u||!i.simulateTouch&&n.pointerType==="mouse")return;if(r.allowTouchCallbacks&&e.emit("touchEnd",n),r.allowTouchCallbacks=!1,!r.isTouched){r.isMoved&&i.grabCursor&&e.setGrabCursor(!1),r.isMoved=!1,r.startMoving=!1;return}i.grabCursor&&r.isMoved&&r.isTouched&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!1);const c=su(),d=c-r.touchStartTime;if(e.allowClick){const p=n.path??(n.composedPath&&n.composedPath());e.updateClickedSlide(p&&p[0],p),e.emit("tap click",n),d<300&&c-r.lastClickTime<300&&e.emit("doubleTap doubleClick",n)}if(r.lastClickTime=su(),Hw(()=>{e.destroyed||(e.allowClick=!0)}),!r.isTouched||!r.isMoved||!e.swipeDirection||a.diff===0&&!r.loopSwapReset||r.currentTranslate===r.startTranslate&&!r.loopSwapReset){r.isTouched=!1,r.isMoved=!1,r.startMoving=!1;return}r.isTouched=!1,r.isMoved=!1,r.startMoving=!1;let f;if(i.followFinger?f=o?e.translate:-e.translate:f=-(r.currentTranslate??0),i.cssMode)return;if(i.freeMode&&i.freeMode.enabled){e.freeMode.onTouchEnd({currentPos:f});return}const m=f>=-e.maxTranslate()&&!e.params.loop;let y=0,g=e.slidesSizesGrid[0];for(let p=0;p<l.length;p+=p<i.slidesPerGroupSkip?1:i.slidesPerGroup){const x=p<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;typeof l[p+x]<"u"?(m||f>=l[p]&&f<l[p+x])&&(y=p,g=l[p+x]-l[p]):(m||f>=l[p])&&(y=p,g=l[l.length-1]-l[l.length-2])}let b=null,_=null;i.rewind&&(e.isBeginning?_=(h=i.virtual)!=null&&h.enabled&&e.virtual?e.virtual.slides.length-1:e.slides.length-1:e.isEnd&&(b=0));const v=(f-l[y])/g,w=y<i.slidesPerGroupSkip-1?1:i.slidesPerGroup;if(d>i.longSwipesMs){if(!i.longSwipes){e.slideTo(e.activeIndex);return}e.swipeDirection==="next"&&(v>=i.longSwipesRatio?e.slideTo(i.rewind&&e.isEnd?b:y+w):e.slideTo(y)),e.swipeDirection==="prev"&&(v>1-i.longSwipesRatio?e.slideTo(y+w):_!==null&&v<0&&Math.abs(v)>i.longSwipesRatio?e.slideTo(_):e.slideTo(y))}else{if(!i.shortSwipes){e.slideTo(e.activeIndex);return}e.navigation&&(n.target===e.navigation.nextEl||n.target===e.navigation.prevEl)?n.target===e.navigation.nextEl?e.slideTo(y+w):e.slideTo(y):(e.swipeDirection==="next"&&e.slideTo(b!==null?b:y+w),e.swipeDirection==="prev"&&e.slideTo(_!==null?_:y))}}function JC(t){const e=this;if(e.destroyed)return;const r=e.touchEventsData,{params:n,touches:s,rtlTranslate:i,enabled:a}=e;if(!a||!n.simulateTouch&&t.pointerType==="mouse")return;const o=t,l=o.originalEvent??o;if(l.type==="pointermove"&&(r.touchId!==null||l.pointerId!==r.pointerId))return;let u;if(l.type==="touchmove"){const k=[...l.changedTouches].find(T=>T.identifier===r.touchId);if(!k||k.identifier!==r.touchId)return;u=k}else u=l;if(!r.isTouched){r.startMoving&&r.isScrolling&&e.emit("touchMoveOpposite",l);return}const c=u.pageX,d=u.pageY;if(l.preventedByNestedSwiper){s.startX=c,s.startY=d;return}if(!e.allowTouchMove){l.target.matches(r.focusableElements)||(e.allowClick=!1),r.isTouched&&(Object.assign(s,{startX:c,startY:d,currentX:c,currentY:d}),r.touchStartTime=su());return}if(n.touchReleaseOnEdges&&!n.loop)if(e.isVertical()){if(d<s.startY&&e.translate<=e.maxTranslate()||d>s.startY&&e.translate>=e.minTranslate()){r.isTouched=!1,r.isMoved=!1;return}}else{if(i&&(c>s.startX&&-e.translate<=e.maxTranslate()||c<s.startX&&-e.translate>=e.minTranslate()))return;if(!i&&(c<s.startX&&e.translate<=e.maxTranslate()||c>s.startX&&e.translate>=e.minTranslate()))return}if(document.activeElement&&document.activeElement.matches(r.focusableElements)&&document.activeElement!==l.target&&l.pointerType!=="mouse"&&document.activeElement.blur(),document.activeElement&&l.target===document.activeElement&&l.target.matches(r.focusableElements)){r.isMoved=!0,e.allowClick=!1;return}r.allowTouchCallbacks&&e.emit("touchMove",l),s.previousX=s.currentX,s.previousY=s.currentY,s.currentX=c,s.currentY=d;const f=s.currentX-s.startX,m=s.currentY-s.startY;if(e.params.threshold&&Math.sqrt(f**2+m**2)<e.params.threshold)return;if(typeof r.isScrolling>"u"){let x;e.isHorizontal()&&s.currentY===s.startY||e.isVertical()&&s.currentX===s.startX?r.isScrolling=!1:f*f+m*m>=25&&(x=Math.atan2(Math.abs(m),Math.abs(f))*180/Math.PI,r.isScrolling=e.isHorizontal()?x>n.touchAngle:90-x>n.touchAngle)}if(r.isScrolling&&e.emit("touchMoveOpposite",l),typeof r.startMoving>"u"&&(s.currentX!==s.startX||s.currentY!==s.startY)&&(r.startMoving=!0),r.isScrolling||l.type==="touchmove"&&r.preventTouchMoveFromPointerMove){r.isTouched=!1;return}if(!r.startMoving)return;e.allowClick=!1,!n.cssMode&&l.cancelable&&l.preventDefault(),n.touchMoveStopPropagation&&!n.nested&&l.stopPropagation();let y=e.isHorizontal()?f:m,g=e.isHorizontal()?s.currentX-s.previousX:s.currentY-s.previousY;n.oneWayMovement&&(y=Math.abs(y)*(i?1:-1),g=Math.abs(g)*(i?1:-1)),s.diff=y,y*=n.touchRatio,i&&(y=-y,g=-g);const b=e.touchesDirection;e.swipeDirection=y>0?"prev":"next",e.touchesDirection=g>0?"prev":"next";const _=e.params.loop&&!n.cssMode,v=e.touchesDirection==="next"&&e.allowSlideNext||e.touchesDirection==="prev"&&e.allowSlidePrev;if(!r.isMoved){if(_&&v&&e.loopFix({direction:e.swipeDirection}),r.startTranslate=e.getTranslate(),e.setTransition(0),e.animating){const x=new window.CustomEvent("transitionend",{bubbles:!0,cancelable:!0,detail:{bySwiperTouchMove:!0}});e.wrapperEl.dispatchEvent(x)}r.allowMomentumBounce=!1,n.grabCursor&&(e.allowSlideNext===!0||e.allowSlidePrev===!0)&&e.setGrabCursor(!0),e.emit("sliderFirstMove",l)}if(new Date().getTime(),n._loopSwapReset!==!1&&r.isMoved&&r.allowThresholdMove&&b!==e.touchesDirection&&_&&v&&Math.abs(y)>=1){Object.assign(s,{startX:c,startY:d,currentX:c,currentY:d,startTranslate:r.currentTranslate}),r.loopSwapReset=!0,r.startTranslate=r.currentTranslate;return}e.emit("sliderMove",l),r.isMoved=!0;const w=r.startTranslate??0;r.currentTranslate=y+w;let h=!0,p=n.resistanceRatio;if(n.touchReleaseOnEdges&&(p=0),y>0?(_&&v&&r.allowThresholdMove&&r.currentTranslate>(n.centeredSlides?e.minTranslate()-e.slidesSizesGrid[e.activeIndex+1]-(n.slidesPerView!=="auto"&&e.slides.length-n.slidesPerView>=2?e.slidesSizesGrid[e.activeIndex+1]+e.params.spaceBetween:0)-e.params.spaceBetween:e.minTranslate())&&e.loopFix({direction:"prev",setTranslate:!0,activeSlideIndex:0}),r.currentTranslate>e.minTranslate()&&(h=!1,n.resistance&&(r.currentTranslate=e.minTranslate()-1+(-e.minTranslate()+w+y)**p))):y<0&&(_&&v&&r.allowThresholdMove&&r.currentTranslate<(n.centeredSlides?e.maxTranslate()+e.slidesSizesGrid[e.slidesSizesGrid.length-1]+e.params.spaceBetween+(n.slidesPerView!=="auto"&&e.slides.length-n.slidesPerView>=2?e.slidesSizesGrid[e.slidesSizesGrid.length-1]+e.params.spaceBetween:0):e.maxTranslate())&&e.loopFix({direction:"next",setTranslate:!0,activeSlideIndex:e.slides.length-(n.slidesPerView==="auto"?e.slidesPerViewDynamic():Math.ceil(parseFloat(String(n.slidesPerView))))}),r.currentTranslate<e.maxTranslate()&&(h=!1,n.resistance&&(r.currentTranslate=e.maxTranslate()+1-(e.maxTranslate()-w-y)**p))),h&&(l.preventedByNestedSwiper=!0),!e.allowSlideNext&&e.swipeDirection==="next"&&(r.currentTranslate??0)<w&&(r.currentTranslate=w),!e.allowSlidePrev&&e.swipeDirection==="prev"&&(r.currentTranslate??0)>w&&(r.currentTranslate=w),!e.allowSlidePrev&&!e.allowSlideNext&&(r.currentTranslate=w),n.threshold>0)if(Math.abs(y)>n.threshold||r.allowThresholdMove){if(!r.allowThresholdMove){r.allowThresholdMove=!0,s.startX=s.currentX,s.startY=s.currentY,r.currentTranslate=r.startTranslate,s.diff=e.isHorizontal()?s.currentX-s.startX:s.currentY-s.startY;return}}else{r.currentTranslate=r.startTranslate;return}!n.followFinger||n.cssMode||((n.freeMode&&n.freeMode.enabled&&e.freeMode||n.watchSlidesProgress)&&(e.updateActiveIndex(),e.updateSlidesClasses()),n.freeMode&&n.freeMode.enabled&&e.freeMode&&e.freeMode.onTouchMove(),e.updateProgress(r.currentTranslate),e.setTranslate(r.currentTranslate??0))}function ZC(t,e){function r(n){if(!n||n===document||n===window)return null;let s=n;s.assignedSlot&&(s=s.assignedSlot);const i=s.closest(t);if(!i&&!s.getRootNode)return null;const a=s.getRootNode();return i||r(a.host)}return r(e)}function Ng(t,e,r){const{params:n}=t,s=n.edgeSwipeDetection,i=n.edgeSwipeThreshold;return s&&(r<=i||r>=window.innerWidth-i)?s==="prevent"?(e.preventDefault(),!0):!1:!0}function YC(t){const e=this;if(e.destroyed)return;const r=t.originalEvent??t,n=e.touchEventsData;if(r.type==="pointerdown"){const v=r;if(n.pointerId!==null&&n.pointerId!==v.pointerId)return;n.pointerId=v.pointerId}else r.type==="touchstart"&&r.targetTouches.length===1&&(n.touchId=r.targetTouches[0].identifier);if(r.type==="touchstart"){Ng(e,r,r.targetTouches[0].pageX);return}const{params:s,touches:i,enabled:a}=e;if(!a||!s.simulateTouch&&r.pointerType==="mouse"||e.animating&&s.preventInteractionOnTransition)return;!e.animating&&s.cssMode&&s.loop&&e.loopFix();let o=r.target;if(s.touchEventsTarget==="wrapper"&&!bC(o,e.wrapperEl))return;const l=r;if(typeof l.which=="number"&&l.which===3||typeof l.button=="number"&&l.button>0||n.isTouched&&n.isMoved)return;const u=!!s.noSwipingClass&&s.noSwipingClass!=="",c=r.composedPath?r.composedPath():r.path;u&&r.target&&r.target.shadowRoot&&c&&(o=c[0]);const d=s.noSwipingSelector?s.noSwipingSelector:`.${s.noSwipingClass}`,f=!!(r.target&&r.target.shadowRoot);if(s.noSwiping&&(f?ZC(d,o):o.closest(d))){e.allowClick=!0;return}if(s.swipeHandler&&typeof s.swipeHandler=="string"&&!o.closest(s.swipeHandler))return;const m=r;i.currentX=m.pageX,i.currentY=m.pageY;const y=i.currentX,g=i.currentY;if(!Ng(e,r,y))return;Object.assign(n,{isTouched:!0,isMoved:!1,allowTouchCallbacks:!0,isScrolling:void 0,startMoving:void 0}),i.startX=y,i.startY=g,n.touchStartTime=su(),e.allowClick=!0,e.updateSize(),e.swipeDirection=void 0,s.threshold>0&&(n.allowThresholdMove=!1);let b=!0;o.matches(n.focusableElements)&&(b=!1,o.nodeName==="SELECT"&&(n.isTouched=!1)),document.activeElement&&document.activeElement.matches(n.focusableElements)&&document.activeElement!==o&&(m.pointerType==="mouse"||m.pointerType!=="mouse"&&!o.matches(n.focusableElements))&&document.activeElement.blur();const _=b&&e.allowTouchMove&&s.touchStartPreventDefault;(s.touchStartForcePreventDefault||_)&&!o.isContentEditable&&r.preventDefault(),s.freeMode&&s.freeMode.enabled&&e.freeMode&&e.animating&&!s.cssMode&&e.freeMode.onTouchStart(),e.emit("touchStart",r)}const t_=(t,e)=>{const{params:r,el:n,wrapperEl:s,device:i}=t,a=!!r.nested,o=e==="on"?"addEventListener":"removeEventListener",l=e;if(!n||typeof n=="string")return;document[o]("touchstart",t.onDocumentTouchStart,{passive:!1,capture:a}),n[o]("touchstart",t.onTouchStart,{passive:!1}),n[o]("pointerdown",t.onTouchStart,{passive:!1}),document[o]("touchmove",t.onTouchMove,{passive:!1,capture:a}),document[o]("pointermove",t.onTouchMove,{passive:!1,capture:a}),document[o]("touchend",t.onTouchEnd,{passive:!0}),document[o]("pointerup",t.onTouchEnd,{passive:!0}),document[o]("pointercancel",t.onTouchEnd,{passive:!0}),document[o]("touchcancel",t.onTouchEnd,{passive:!0}),document[o]("pointerout",t.onTouchEnd,{passive:!0}),document[o]("pointerleave",t.onTouchEnd,{passive:!0}),document[o]("contextmenu",t.onTouchEnd,{passive:!0}),(r.preventClicks||r.preventClicksPropagation)&&n[o]("click",t.onClick,!0),r.cssMode&&s[o]("scroll",t.onScroll);const u=c=>{t[l](c,GC,!0)};r.updateOnWindowResize?u(i.ios||i.android?"resize orientationchange observerUpdate":"resize observerUpdate"):u("observerUpdate"),r.lazyPreload&&n[o]("load",t.onLoad,{capture:!0})};function XC(){const t=this,{params:e}=t;t.onTouchStart=YC.bind(t),t.onTouchMove=JC.bind(t),t.onTouchEnd=KC.bind(t),t.onDocumentTouchStart=WC.bind(t),e.cssMode&&(t.onScroll=qC.bind(t)),t.onClick=VC.bind(t),t.onLoad=HC.bind(t),t_(t,"on")}function QC(){t_(this,"off")}var eP={attachEvents:XC,detachEvents:QC};function tP(t){const e=this;if(!e.params.simulateTouch||e.params.watchOverflow&&e.isLocked||e.params.cssMode)return;const r=e.params.touchEventsTarget==="container"?e.el:e.wrapperEl;e.isElement&&(e.__preventObserver__=!0),r.style.cursor="move",r.style.cursor=t?"grabbing":"grab",e.isElement&&requestAnimationFrame(()=>{e.__preventObserver__=!1})}function rP(){const t=this;t.params.watchOverflow&&t.isLocked||t.params.cssMode||(t.isElement&&(t.__preventObserver__=!0),t[t.params.touchEventsTarget==="container"?"el":"wrapperEl"].style.cursor="",t.isElement&&requestAnimationFrame(()=>{t.__preventObserver__=!1}))}var nP={setGrabCursor:tP,unsetGrabCursor:rP};function sP(t,e){var m;const r=this,{params:n,slidesEl:s}=r;if(!n.loop||r.virtual&&((m=r.params.virtual)!=null&&m.enabled))return;const i=()=>{en(s,`.${n.slideClass}, swiper-slide`).forEach((g,b)=>{g.setAttribute("data-swiper-slide-index",String(b))})},a=()=>{const y=en(s,`.${n.slideBlankClass}`);
380y.forEach(g=>{g.remove()}),y.length>0&&(r.recalcSlides(),r.updateSlides())},o=r.grid&&n.grid&&n.grid.rows>1;n.loopAddBlankSlides&&(n.slidesPerGroup>1||o)&&a();const l=n.slidesPerGroup*(o?n.grid.rows:1),u=r.slides.length%l!==0,c=o&&r.slides.length%n.grid.rows!==0,d=y=>{for(let g=0;g<y;g+=1){const b=r.isElement?au("swiper-slide",[n.slideBlankClass]):au("div",[n.slideClass,n.slideBlankClass]);r.slidesEl.append(b)}};if(u){if(n.loopAddBlankSlides){const y=l-r.slides.length%l;d(y),r.recalcSlides(),r.updateSlides()}else iu("Swiper Loop Warning: The number of slides is not even to slidesPerGroup, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else if(c){if(n.loopAddBlankSlides){const y=n.grid.rows-r.slides.length%n.grid.rows;d(y),r.recalcSlides(),r.updateSlides()}else iu("Swiper Loop Warning: The number of slides is not even to grid.rows, loop mode may not function properly. You need to add more slides (or make duplicates, or empty slides)");i()}else i();const f=n.centeredSlides||!!n.slidesOffsetBefore||!!n.slidesOffsetAfter;r.loopFix({slideRealIndex:t,direction:f?void 0:"next",initial:e})}function iP(){var s;const t=this,{params:e,slidesEl:r}=t;if(!e.loop||!r||t.virtual&&((s=t.params.virtual)!=null&&s.enabled))return;t.recalcSlides();const n=[];t.slides.forEach(i=>{const a=i,o=typeof a.swiperSlideIndex>"u"?Number(i.getAttribute("data-swiper-slide-index")):a.swiperSlideIndex;n[o]=i}),t.slides.forEach(i=>{i.removeAttribute("data-swiper-slide-index")}),n.forEach(i=>{r.append(i)}),t.recalcSlides(),t.slideTo(t.realIndex,0)}function aP(t={}){var xe,nt;const{slideRealIndex:e,slideTo:r=!0,direction:n,setTranslate:s,activeSlideIndex:i,initial:a,byController:o,byMousewheel:l}=t;let u=i;const c=this;if(!c.params.loop)return;c.emit("beforeLoopFix"),c.__loopFixInProgress__=!0;const{slides:d,allowSlidePrev:f,allowSlideNext:m,slidesEl:y,params:g}=c,{centeredSlides:b,slidesOffsetBefore:_,slidesOffsetAfter:v,initialSlide:w}=g,h=b||!!_||!!v;if(c.allowSlidePrev=!0,c.allowSlideNext=!0,c.virtual&&((xe=g.virtual)!=null&&xe.enabled)){if(r){const ae=c.virtual.slides.length,we=c.virtual.slidesBefore??0;!h&&c.snapIndex===0?c.slideTo(ae,0,!1,!0):h&&c.snapIndex<g.slidesPerView?c.slideTo(ae+c.snapIndex,0,!1,!0):c.snapIndex===c.snapGrid.length-1&&c.slideTo(we,0,!1,!0)}c.allowSlidePrev=f,c.allowSlideNext=m,c.__loopFixInProgress__=!1,c.emit("loopFix");return}let p=g.slidesPerView;p==="auto"?p=c.slidesPerViewDynamic():(p=Math.ceil(parseFloat(String(g.slidesPerView))),h&&p%2===0&&(p=p+1));const x=g.slidesPerGroupAuto?p:g.slidesPerGroup,k=ae=>(typeof ae=="function"?ae.call(c):ae)||0,T=c.slidesGrid.length>1?(c.slidesGrid[c.slidesGrid.length-1]-c.slidesGrid[0])/(c.slidesGrid.length-1):c.size,E=T>0?k(_)/T:0,R=T>0?k(v)/T:0;let j=h?Math.max(x,(b?Math.ceil(p/2):0)+Math.ceil(Math.max(E,R))):x;j%x!==0&&(j+=x-j%x),j+=g.loopAdditionalSlides,c.loopedSlides=j;const L=c.grid&&g.grid&&g.grid.rows>1;d.length<p+j||c.params.effect==="cards"&&d.length<p+j*2?iu("Swiper Loop Warning: The number of slides is not enough for loop mode, it will be disabled or not function properly. You need to add more slides (or make duplicates) or lower the values of slidesPerView and slidesPerGroup parameters"):L&&g.grid.fill==="row"&&iu("Swiper Loop Warning: Loop mode is not compatible with grid.fill = `row`");const O=[],N=[],M=L?Math.ceil(d.length/g.grid.rows):d.length,X=a&&M-w<p&&!h;let q=X?w:c.activeIndex;typeof u>"u"?u=c.getSlideIndex(d.find(ae=>ae.classList.contains(g.slideActiveClass))):q=u;const D=n==="next"||!n,K=n==="prev"||!n;let U=0,W=0;const oe=(L?d[u].column??0:u)+(h&&typeof s>"u"?(b?-p/2+.5:0)-E:0);if(oe<j){U=Math.max(j-oe,x);for(let ae=0;ae<j-oe;ae+=1){const we=ae-Math.floor(ae/M)*M;if(L){const et=M-we-1;for(let gr=d.length-1;gr>=0;gr-=1)d[gr].column===et&&O.push(gr)}else O.push(M-we-1)}}else if(oe+p>M-j){W=Math.max(oe-(M-j*2),x),X&&(W=Math.max(W,p-M+w+1));for(let ae=0;ae<W;ae+=1){const we=ae-Math.floor(ae/M)*M;L?d.forEach((et,gr)=>{et.column===we&&N.push(gr)}):N.push(we)}}if(c.__preventObserver__=!0,requestAnimationFrame(()=>{c.__preventObserver__=!1}),c.params.effect==="cards"&&d.length<p+j*2&&(N.includes(u)&&N.splice(N.indexOf(u),1),O.includes(u)&&O.splice(O.indexOf(u),1)),K&&O.forEach(ae=>{const we=d[ae];we.swiperLoopMoveDOM=!0,y.prepend(we),we.swiperLoopMoveDOM=!1}
vendor: 14,484 bytes, line 380
380),D&&N.forEach(ae=>{const we=d[ae];we.swiperLoopMoveDOM=!0,y.append(we),we.swiperLoopMoveDOM=!1}),c.recalcSlides(),g.slidesPerView==="auto"?c.updateSlides():L&&(O.length>0&&K||N.length>0&&D)&&c.slides.forEach((ae,we)=>{c.grid.updateSlide(we,ae,c.slides)}),g.watchSlidesProgress&&c.updateSlidesOffset(),r){if(O.length>0&&K){if(typeof e>"u"){const ae=c.slidesGrid[q],et=c.slidesGrid[q+U]-ae;l?c.setTranslate(c.translate-et):(c.slideTo(q+Math.ceil(U),0,!1,!0),s&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-et,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-et))}else if(s){const ae=L?O.length/g.grid.rows:O.length;c.slideTo(c.activeIndex+ae,0,!1,!0),c.touchEventsData.currentTranslate=c.translate}}else if(N.length>0&&D)if(typeof e>"u"){const ae=c.slidesGrid[q],et=c.slidesGrid[q-W]-ae;l?c.setTranslate(c.translate-et):(c.slideTo(q-W,0,!1,!0),s&&(c.touchEventsData.startTranslate=c.touchEventsData.startTranslate-et,c.touchEventsData.currentTranslate=c.touchEventsData.currentTranslate-et))}else{const ae=L?N.length/g.grid.rows:N.length;c.slideTo(c.activeIndex-ae,0,!1,!0)}}c.allowSlidePrev=f,c.allowSlideNext=m;const ce=(nt=c.controller)==null?void 0:nt.control;if(ce&&!o){const ae={slideRealIndex:e,direction:n,setTranslate:s,activeSlideIndex:u,byController:!0};Array.isArray(ce)?ce.forEach(we=>{!we.destroyed&&we.params.loop&&we.loopFix({...ae,slideTo:we.params.slidesPerView===g.slidesPerView?r:!1})}):ce instanceof c.constructor&&ce.params.loop&&ce.loopFix({...ae,slideTo:ce.params.slidesPerView===g.slidesPerView?r:!1})}c.__loopFixInProgress__=!1,c.emit("loopFix")}var oP={loopCreate:sP,loopFix:aP,loopDestroy:iP};function lP(t,e){return function(n={}){const s=Object.keys(n)[0],i=n[s];if(typeof i!="object"||i===null){Bt(e,n);return}if(t[s]===!0&&(t[s]={enabled:!0}),s==="navigation"&&t[s]&&t[s].enabled&&!t[s].prevEl&&!t[s].nextEl&&(t[s].auto=!0),["pagination","scrollbar"].indexOf(s)>=0&&t[s]&&t[s].enabled&&!t[s].el&&(t[s].auto=!0),!(s in t&&"enabled"in i)){Bt(e,n);return}typeof t[s]=="object"&&!("enabled"in t[s])&&(t[s].enabled=!0),t[s]||(t[s]={enabled:!1}),Bt(e,n)}}const uP=({swiper:t,extendParams:e,on:r})=>{const n=[],s=(o,l={})=>{const u=window.MutationObserver||window.WebkitMutationObserver;if(!u)return;const c=new u(d=>{if(t.__preventObserver__)return;if(d.length===1){t.emit("observerUpdate",d[0]);return}const f=function(){t.emit("observerUpdate",d[0])};window.requestAnimationFrame?window.requestAnimationFrame(f):window.setTimeout(f,0)});c.observe(o,{attributes:typeof l.attributes>"u"?!0:l.attributes,childList:t.isElement||(typeof l.childList>"u"?!0:l.childList),characterData:typeof l.characterData>"u"?!0:l.characterData}),n.push(c)},i=()=>{if(t.params.observer){if(t.params.observeParents){const o=EC(t.hostEl);for(let l=0;l<o.length;l+=1)s(o[l])}s(t.hostEl,{childList:t.params.observeSlideChildren}),s(t.wrapperEl,{attributes:!1})}},a=()=>{n.forEach(o=>{o.disconnect()}),n.splice(0,n.length)};e({observer:!1,observeParents:!1,observeSlideChildren:!1}),r("init",i),r("destroy",a)},cP=({swiper:t,on:e,emit:r})=>{let n=null,s=null;const i=()=>{!t||t.destroyed||!t.initialized||(r("beforeResize"),r("resize"))},a=()=>{!t||t.destroyed||!t.initialized||(n=new ResizeObserver(u=>{s=window.requestAnimationFrame(()=>{const{width:c,height:d}=t;let f=c,m=d;u.forEach(({contentBoxSize:y,contentRect:g,target:b})=>{if(b&&b!==t.el)return;const _=Array.isArray(y)?y[0]:y;f=g?g.width:_.inlineSize,m=g?g.height:_.blockSize}),(f!==c||m!==d)&&i()})}),n.observe(t.el))},o=()=>{s&&window.cancelAnimationFrame(s),n&&n.unobserve&&t.el&&(n.unobserve(t.el),n=null)},l=()=>{!t||t.destroyed||!t.initialized||r("orientationchange")};e("init",()=>{if(t.params.resizeObserver&&typeof window.ResizeObserver<"u"){a();return}window.addEventListener("resize",i),window.addEventListener("orientationchange",l)}),e("destroy",()=>{o(),window.removeEventListener("resize",i),window.removeEventListener("orientationchange",l)})};function dP(t,e=!0,r){var c;const n=this,{enabled:s,params:i,animating:a}=n;if(!s||n.destroyed)return n;typeof t>"u"&&(t=n.params.speed);let o=i.slidesPerGroup;i.slidesPerView==="auto"&&i.slidesPerGroup===1&&i.slidesPerGroupAuto&&(o=Math.max(n.slidesPerViewDynamic("current",!0),1));const l=n.activeIndex<i.slidesPerGroupSkip?1:o,u=n.virtual&&((c=i.virtual)==null?void 0:c.enabled);if(i.loop){if(a&&!u&&i.loopPreventsSliding)return!1;if(n.loopFix({direction:"next"}),n._clientLeft=n.wrapperEl.clientLeft,n.activeIndex===n.slides.length-1&&i.cssMode)return requestAnimationFrame(()=>{n.slideTo(n.activeIndex+l,t,e,r)}),!0}return i.rewind&&n.isEnd?n.slideTo(0,t,e,r):n.slideTo(n.activeIndex+l,t,e,r)}function hP(t,e=!0,r){var v,w;const n=this,{params:s,snapGrid:i,slidesGrid:a,rtlTranslate:o,enabled:l,animating:u}=n;if(!l||n.destroyed)return n;typeof t>"u"&&(t=n.params.speed);const c=n.virtual&&((v=s.virtual)==null?void 0:v.enabled);if(s.loop){if(u&&!c&&s.loopPreventsSliding)return!1;n.loopFix({direction:"prev"}),n._clientLeft=n.wrapperEl.clientLeft}const d=o?n.translate:-n.translate;function f(h){return h<0?-Math.floor(Math.abs(h)):Math.floor(h)}const m=f(d),y=i.map(h=>f(h)),g=s.freeMode&&s.freeMode.enabled;let b=i[y.indexOf(m)-1];if(typeof b>"u"&&(s.cssMode||g)){let h;i.forEach((p,x)=>{m>=p&&(h=x)}),typeof h<"u"&&(b=g?i[h]:i[h>0?h-1:h])}let _=0;if(typeof b<"u"&&(_=a.indexOf(b),_<0&&(_=n.activeIndex-1),s.slidesPerView==="auto"&&s.slidesPerGroup===1&&s.slidesPerGroupAuto&&(_=_-n.slidesPerViewDynamic("previous",!0)+1,_=Math.max(_,0))),s.rewind&&n.isBeginning){const h=(w=n.params.virtual)!=null&&w.enabled&&n.virtual?n.virtual.slides.length-1:n.slides.length-1;return n.slideTo(h,t,e,r)}else if(s.loop&&n.activeIndex===0&&s.cssMode)return requestAnimationFrame(()=>{n.slideTo(_,t,e,r)}),!0;return n.slideTo(_,t,e,r)}function fP(t,e=!0,r){const n=this;if(!n.destroyed)return typeof t>"u"&&(t=n.params.speed),n.slideTo(n.activeIndex,t,e,r)}function pP(t=0,e,r=!0,n,s){var k;typeof t=="string"&&(t=parseInt(t,10));const i=this;let a=t;a<0&&(a=0);const{params:o,snapGrid:l,slidesGrid:u,previousIndex:c,activeIndex:d,rtlTranslate:f,wrapperEl:m,enabled:y}=i;if(!y&&!n&&!s||i.destroyed||i.animating&&o.preventInteractionOnTransition)return!1;typeof e>"u"&&(e=i.params.speed);const g=Math.min(i.params.slidesPerGroupSkip,a);let b=g+Math.floor((a-g)/i.params.slidesPerGroup);b>=l.length&&(b=l.length-1);const _=-l[b];if(o.normalizeSlideIndex)for(let T=0;T<u.length;T+=1){const E=-Math.floor(_*100),R=Math.floor(u[T]*100),j=Math.floor(u[T+1]*100);typeof u[T+1]<"u"?E>=R&&E<j-(j-R)/2?a=T:E>=R&&E<j&&(a=T+1):E>=R&&(a=T)}if(i.initialized&&a!==d&&(!i.allowSlideNext&&(f?_>i.translate&&_>i.minTranslate():_<i.translate&&_<i.minTranslate())||!i.allowSlidePrev&&_>i.translate&&_>i.maxTranslate()&&(d||0)!==a))return!1;a!==(c||0)&&r&&i.emit("beforeSlideChangeStart"),i.updateProgress(_);let v;a>d?v="next":a<d?v="prev":v="reset";const w=i.virtual&&((k=i.params.virtual)==null?void 0:k.enabled);if(!(w&&s)&&(f&&-_===i.translate||!f&&_===i.translate))return i.updateActiveIndex(a),o.autoHeight&&i.updateAutoHeight(),i.updateSlidesClasses(),o.effect!=="slide"&&i.setTranslate(_),v!=="reset"&&(i.transitionStart(r,v),i.transitionEnd(r,v)),!1;if(o.cssMode){const T=i.isHorizontal(),E=f?_:-_;return e===0?(w&&(i.wrapperEl.style.scrollSnapType="none",i._immediateVirtual=!0),w&&!i._cssModeVirtualInitialSet&&(i.params.initialSlide??0)>0?(i._cssModeVirtualInitialSet=!0,requestAnimationFrame(()=>{m[T?"scrollLeft":"scrollTop"]=E})):m[T?"scrollLeft":"scrollTop"]=E,w&&requestAnimationFrame(()=>{i.wrapperEl.style.scrollSnapType="",i._immediateVirtual=!1})):m.scrollTo({[T?"left":"top"]:E,behavior:"smooth"}),!0}const x=Qw().isSafari;return w&&!s&&x&&i.isElement&&i.virtual.update(!1,!1,a),i.setTransition(e),i.setTranslate(_),i.updateActiveIndex(a),i.updateSlidesClasses(),i.emit("beforeTransitionStart",e,n),i.transitionStart(r,v),e===0?i.transitionEnd(r,v):i.animating||(i.animating=!0,i.onSlideToWrapperTransitionEnd||(i.onSlideToWrapperTransitionEnd=function(E){!i||i.destroyed||E.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onSlideToWrapperTransitionEnd),i.onSlideToWrapperTransitionEnd=null,delete i.onSlideToWrapperTransitionEnd,i.transitionEnd(r,v))}),i.wrapperEl.addEventListener("transitionend",i.onSlideToWrapperTransitionEnd)),!0}function mP(){const t=this;if(t.destroyed)return;const{params:e,slidesEl:r,clickedSlide:n,clickedIndex:s}=t;if(n===void 0||s===void 0)return;const i=e.slidesPerView==="auto"?t.slidesPerViewDynamic():e.slidesPerView;let a=t.getSlideIndexWhenGrid(s),o;const l=t.isElement?"swiper-slide":`.${e.slideClass}`,u=t.grid&&t.params.grid&&t.params.grid.rows>1;if(e.loop){if(t.animating)return;o=parseInt(n.getAttribute("data-swiper-slide-index"),10),e.centeredSlides?t.slideToLoop(o):a>(u?(t.slides.length-i)/2-(t.params.grid.rows-1):t.slides.length-i)?(t.loopFix(),a=t.getSlideIndex(en(r,`${l}[data-swiper-slide-index="${o}"]`)[0]),Hw(()=>{t.slideTo(a)})):t.slideTo(a)}else t.slideTo(a)}function gP(t,e=!0,r,n=.5){const s=this;if(s.destroyed)return;typeof t>"u"&&(t=s.params.speed);let i=s.activeIndex;const a=Math.min(s.params.slidesPerGroupSkip,i),o=a+Math.floor((i-a)/s.params.slidesPerGroup),l=s.rtlTranslate?s.translate:-s.translate;if(l>=s.snapGrid[o]){const u=s.snapGrid[o],c=s.snapGrid[o+1];l-u>(c-u)*n&&(i+=s.params.slidesPerGroup)}else{const u=s.snapGrid[o-1],c=s.snapGrid[o];l-u<=(c-u)*n&&(i-=s.params.slidesPerGroup)}return i=Math.max(i,0),i=Math.min(i,s.slidesGrid.length-1),s.slideTo(i,t,e,r)}function vP(t=0,e,r=!0,n){var o;typeof t=="string"&&(t=parseInt(t,10));const s=this;if(s.destroyed)return;typeof e>"u"&&(e=s.params.speed);const i=s.grid&&s.params.grid&&s.params.grid.rows>1;let a=t;if(s.params.loop)if(s.virtual&&((o=s.params.virtual)!=null&&o.enabled))a=a+(s.virtual.slidesBefore??0);else{let l;if(i){const b=a*s.params.grid.rows,_=s.slides.find(v=>Number(v.getAttribute("data-swiper-slide-index"))===b);l=(_==null?void 0:_.column)??0}else l=s.getSlideIndexByData(a);const u=i?Math.ceil(s.slides.length/s.params.grid.rows):s.slides.length,{centeredSlides:c,slidesOffsetBefore:d,slidesOffsetAfter:f}=s.params,m=c||!!d||!!f;let y;s.params.slidesPerView==="auto"?y=s.slidesPerViewDynamic():(y=Math.ceil(parseFloat(String(s.params.slidesPerView))),m&&y%2===0&&(y=y+1));let g=u-l<y;if(m&&(g=g||l<Math.ceil(y/2)),n&&m&&s.params.slidesPerView!=="auto"&&!i&&(g=!1),g){const b=m?l<s.activeIndex?"prev":"next":l-s.activeIndex-1<s.params.slidesPerView?"next":"prev";s.loopFix({direction:b,slideTo:!0,activeSlideIndex:b==="next"?l+1:l-u+1,slideRealIndex:b==="next"?s.realIndex:void 0})}if(i){const b=a*s.params.grid.rows,_=s.slides.find(v=>Number(v.getAttribute("data-swiper-slide-index"))===b);a=(_==null?void 0:_.column)??0}else a=s.getSlideIndexByData(a)}return requestAnimationFrame(()=>{s.slideTo(a,e,r,n)}),s}var yP={slideTo:pP,slideToLoop:vP,slideNext:dP,slidePrev:hP,slideReset:fP,slideToClosest:gP,slideToClickedSlide:mP};function wP(t,e){const r=this;r.params.cssMode||(r.wrapperEl.style.transitionDuration=`${t}ms`,r.wrapperEl.style.transitionDelay=t===0?"0ms":""),r.emit("setTransition",t,e)}function r_({swiper:t,runCallbacks:e,direction:r,step:n}){const{activeIndex:s,previousIndex:i}=t;let a=r;a||(s>i?a="next":s<i?a="prev":a="reset"),t.emit(`transition${n}`),e&&a==="reset"?t.emit(`slideResetTransition${n}`):e&&s!==i&&(t.emit(`slideChangeTransition${n}`),a==="next"?t.emit(`slideNextTransition${n}`):t.emit(`slidePrevTransition${n}`))}function _P(t=!0,e){const r=this,{params:n}=r;r.animating=!1,!n.cssMode&&(r.setTransition(0),r_({swiper:r,runCallbacks:t,direction:e,step:"End"}))}function xP(t=!0,e){const r=this,{params:n}=r;n.cssMode||(n.autoHeight&&r.updateAutoHeight(),r_({swiper:r,runCallbacks:t,direction:e,step:"Start"}))}var bP={setTransition:wP,transitionStart:xP,transitionEnd:_P};function SP(t=this.isHorizontal()?"x":"y"){const e=this,{params:r,rtlTranslate:n,translate:s,wrapperEl:i}=e;if(r.virtualTranslate)return n?-s:s;if(r.cssMode)return s;let a=wC(i,t);return a+=e.cssOverflowAdjustment(),n&&(a=-a),a||0}function kP(){return-this.snapGrid[this.snapGrid.length-1]}function EP(){return-this.snapGrid[0]}function TP(t,e){const r=this,{rtlTranslate:n,params:s,wrapperEl:i,progress:a}=r;let o=0,l=0;const u=0;r.isHorizontal()?o=n?-t:t:l=t,s.roundLengths&&(o=Math.floor(o),l=Math.floor(l)),r.previousTranslate=r.translate,r.translate=r.isHorizontal()?o:l,s.cssMode?i[r.isHorizontal()?"scrollLeft":"scrollTop"]=r.isHorizontal()?-o:-l:s.virtualTranslate||(r.isHorizontal()?o-=r.cssOverflowAdjustment():l-=r.cssOverflowAdjustment(),i.style.transform=`translate3d(${o}px, ${l}px, ${u}px)`);let c;const d=r.maxTranslate()-r.minTranslate();d===0?c=0:c=(t-r.minTranslate())/d,c!==a&&r.updateProgress(t),r.emit("setTranslate",r.translate,e)}function CP(t=0,e=this.params.speed,r=!0,n=!0,s){const i=this,{params:a,wrapperEl:o}=i;if(i.animating&&a.preventInteractionOnTransition)return!1;const l=i.minTranslate(),u=i.maxTranslate();let c;if(n&&t>l?c=l:n&&t<u?c=u:c=t,i.updateProgress(c),a.cssMode){const d=i.isHorizontal();return e===0?o[d?"scrollLeft":"scrollTop"]=-c:o.scrollTo({[d?"left":"top"]:-c,behavior:"smooth"}),!0}return e===0?(i.setTransition(0),i.setTranslate(c),r&&(i.emit("beforeTransitionStart",e,s),i.emit("transitionEnd"))):(i.setTransition(e),i.setTranslate(c),r&&(i.emit("beforeTransitionStart",e,s),i.emit("transitionStart")),i.animating||(i.animating=!0,i.onTranslateToWrapperTransitionEnd||(i.onTranslateToWrapperTransitionEnd=function(f){!i||i.destroyed||f.target===this&&(i.wrapperEl.removeEventListener("transitionend",i.onTranslateToWrapperTransitionEnd),i.onTranslateToWrapperTransitionEnd=null,delete i.onTranslateToWrapperTransitionEnd,i.animating=!1,r&&i.emit("transitionEnd"))}),i.wrapperEl.addEventListener("transitionend",i.onTranslateToWrapperTransitionEnd))),!0}var PP={getTranslate:SP,setTranslate:TP,minTranslate:EP,maxTranslate:kP,translateTo:CP};function AP(t){const{slidesGrid:e,params:r}=t,n=t.rtlTranslate?t.translate:-t.translate;let s;for(let i=0;i<e.length;i+=1)typeof e[i+1]<"u"?n>=e[i]&&n<e[i+1]-(e[i+1]-e[i])/2?s=i:n>=e[i]&&n<e[i+1]&&(s=i+1):n>=e[i]&&(s=i);return r.normalizeSlideIndex&&(s<0||typeof s>"u")&&(s=0),s}function RP(t){var m,y;const e=this,r=e.rtlTranslate?e.translate:-e.translate,{snapGrid:n,params:s,activeIndex:i,realIndex:a,snapIndex:o}=e;let l=t,u;const c=g=>{const b=e.virtual.slides;let _=g-(e.virtual.slidesBefore??0);return _<0&&(_=b.length+_),_>=b.length&&(_-=b.length),_};
380if(typeof l>"u"&&(l=AP(e)),n.indexOf(r)>=0)u=n.indexOf(r);else{const g=Math.min(s.slidesPerGroupSkip,l);u=g+Math.floor((l-g)/s.slidesPerGroup)}if(u>=n.length&&(u=n.length-1),l===i&&!e.params.loop){u!==o&&(e.snapIndex=u,e.emit("snapIndexChange"));return}if(l===i&&e.params.loop&&e.virtual&&((m=e.params.virtual)!=null&&m.enabled)){e.realIndex=c(l);return}const d=e.grid&&s.grid&&s.grid.rows>1;let f;if(e.virtual&&((y=s.virtual)!=null&&y.enabled))s.loop?f=c(l):f=l;else if(d){const g=e.slides.find(_=>_.column===l);let b=parseInt(g.getAttribute("data-swiper-slide-index"),10);Number.isNaN(b)&&(b=Math.max(e.slides.indexOf(g),0)),f=Math.floor(b/s.grid.rows)}else if(e.slides[l]){const g=e.slides[l].getAttribute("data-swiper-slide-index");g?f=parseInt(g,10):f=l}else f=l;Object.assign(e,{previousSnapIndex:o,snapIndex:u,previousRealIndex:a,realIndex:f,previousIndex:i,activeIndex:l}),e.initialized&&e_(e),!e.__loopFixInProgress__&&(e.emit("activeIndexChange"),e.emit("snapIndexChange"),(e.initialized||e.params.runCallbacksOnInit)&&((e.__lastEmittedRealIndex__??a)!==f&&e.emit("realIndexChange"),e.emit("slideChange")),e.__lastEmittedRealIndex__=f)}function OP(t){var o;const e=this,r=[],n=e.virtual&&((o=e.params.virtual)==null?void 0:o.enabled);let s=0,i;typeof t=="number"?e.setTransition(t):t===!0&&e.setTransition(e.params.speed);const a=l=>n?e.slides[e.getSlideIndexByData(l)]:e.slides[l];if(e.params.slidesPerView!=="auto"&&e.params.slidesPerView>1)if(e.params.centeredSlides)(e.visibleSlides||[]).forEach(l=>{r.push(l)});else for(i=0;i<Math.ceil(e.params.slidesPerView);i+=1){const l=e.activeIndex+i;if(l>e.slides.length&&!n)break;const u=a(l);u&&r.push(u)}else{const l=a(e.activeIndex);l&&r.push(l)}for(i=0;i<r.length;i+=1)if(typeof r[i]<"u"){const l=r[i].offsetHeight;s=l>s?l:s}(s||s===0)&&(e.wrapperEl.style.height=`${s}px`)}function IP(t,e){var o;const r=this,n=r.params;let s=t.closest(`.${n.slideClass}, swiper-slide`);!s&&r.isElement&&e&&e.length>
vendor: 17,604 bytes, line 380
3801&&e.includes(t)&&[...e.slice(e.indexOf(t)+1,e.length)].forEach(l=>{!s&&l.matches&&l.matches(`.${n.slideClass}, swiper-slide`)&&(s=l)});let i=!1,a;if(s){for(let l=0;l<r.slides.length;l+=1)if(r.slides[l]===s){i=!0,a=l;break}}if(s&&i)r.clickedSlide=s,r.virtual&&((o=r.params.virtual)!=null&&o.enabled)?r.clickedIndex=parseInt(s.getAttribute("data-swiper-slide-index"),10):r.clickedIndex=a;else{r.clickedSlide=void 0,r.clickedIndex=void 0;return}n.slideToClickedSlide&&r.clickedIndex!==void 0&&r.clickedIndex!==r.activeIndex&&r.slideToClickedSlide()}function NP(t){const e=this;if(typeof t>"u"){const c=e.rtlTranslate?-1:1;t=e&&e.translate&&e.translate*c||0}const r=e.params,n=e.maxTranslate()-e.minTranslate();let{progress:s,isBeginning:i,isEnd:a}=e,o=e.progressLoop;const l=i,u=a;if(n===0)s=0,i=!0,a=!0;else{s=(t-e.minTranslate())/n;const c=Math.abs(t-e.minTranslate())<1,d=Math.abs(t-e.maxTranslate())<1;i=c||s<=0,a=d||s>=1,c&&(s=0),d&&(s=1)}if(r.loop){const c=e.getSlideIndexByData(0),d=e.getSlideIndexByData(e.slides.length-1),f=e.slidesGrid[c],m=e.slidesGrid[d],y=e.slidesGrid[e.slidesGrid.length-1],g=Math.abs(t);g>=f?o=(g-f)/y:o=(g+y-m)/y,o>1&&(o-=1)}Object.assign(e,{progress:s,progressLoop:o,isBeginning:i,isEnd:a}),(r.watchSlidesProgress||r.centeredSlides&&r.autoHeight)&&e.updateSlidesProgress(t),i&&!l&&e.emit("reachBeginning toEdge"),a&&!u&&e.emit("reachEnd toEdge"),(l&&!i||u&&!a)&&e.emit("fromEdge"),e.emit("progress",s)}function LP(){const t=this;let e,r;const n=t.el;typeof t.params.width<"u"&&t.params.width!==null?e=t.params.width:e=n.clientWidth,typeof t.params.height<"u"&&t.params.height!==null?r=t.params.height:r=n.clientHeight,!(e===0&&t.isHorizontal()||r===0&&t.isVertical())&&(e=e-parseInt(kn(n,"padding-left")||"0",10)-parseInt(kn(n,"padding-right")||"0",10),r=r-parseInt(kn(n,"padding-top")||"0",10)-parseInt(kn(n,"padding-bottom")||"0",10),Number.isNaN(e)&&(e=0),Number.isNaN(r)&&(r=0),Object.assign(t,{width:e,height:r,size:t.isHorizontal()?e:r}))}function jP(){var j,L;const t=this;function e(O,N){return parseFloat(O.getPropertyValue(t.getDirectionLabel(N))||"0")}const r=t.params,{wrapperEl:n,slidesEl:s,rtlTranslate:i,wrongRTL:a}=t,o=!!(t.virtual&&((j=r.virtual)!=null&&j.enabled)),l=o?t.virtual.slides.length:t.slides.length,u=en(s,`.${t.params.slideClass}, swiper-slide`),c=o?t.virtual.slides.length:u.length;let d=[];const f=[],m=[],y=O=>typeof O=="function"?O.call(t):O,g=y(r.slidesOffsetBefore),b=y(r.slidesOffsetAfter),_=t.snapGrid.length,v=t.slidesGrid.length,w=t.size-g-b;let h=r.spaceBetween,p=-g,x=0,k=0;if(typeof w>"u")return;typeof h=="string"&&h.indexOf("%")>=0?h=parseFloat(h.replace("%",""))/100*w:typeof h=="string"&&(h=parseFloat(h)),t.virtualSize=-h-g-b,u.forEach(O=>{i?O.style.marginLeft="":O.style.marginRight="",O.style.marginBottom="",O.style.marginTop=""}),r.centeredSlides&&r.cssMode&&(Bs(n,"--swiper-centered-offset-before",""),Bs(n,"--swiper-centered-offset-after","")),r.cssMode&&(Bs(n,"--swiper-slides-offset-before",`${g}px`),Bs(n,"--swiper-slides-offset-after",`${b}px`));const T=r.grid&&r.grid.rows>1&&t.grid;T?t.grid.initSlides(u):t.grid&&t.grid.unsetSlides();let E=0;const R=r.slidesPerView==="auto"&&r.breakpoints&&Object.keys(r.breakpoints).filter(O=>{const N=r.breakpoints[O];return typeof(N==null?void 0:N.slidesPerView)<"u"}).length>0;for(let O=0;O<c;O+=1){E=0;const N=u[O];if(!(N&&(T&&t.grid.updateSlide(O,N,u),kn(N,"display")==="none"))){if(o&&r.slidesPerView==="auto")(L=r.virtual)!=null&&L.slidesPerViewAutoSlideSize&&(E=r.virtual.slidesPerViewAutoSlideSize),E&&N&&(r.roundLengths&&(E=Math.floor(E)),N.style[t.getDirectionLabel("width")]=`${E}px`);else if(r.slidesPerView==="auto"){R&&(N.style[t.getDirectionLabel("width")]="");const M=getComputedStyle(N),X=N.style.transform,q=N.style.webkitTransform;if(X&&(N.style.transform="none"),q&&(N.style.webkitTransform="none"),r.roundLengths)E=t.isHorizontal()?Rg(N,"width"):Rg(N,"height");else{const D=e(M,"width"),K=e(M,"padding-left"),U=e(M,"padding-right"),W=e(M,"margin-left"),re=e(M,"margin-right"),oe=M.getPropertyValue("box-sizing");if(oe&&oe==="border-box")E=D+W+re;else{const{clientWidth:ce,offsetWidth:xe}=N;E=D+K+U+W+re+(xe-ce)}}X&&(N.style.transform=X),q&&(N.style.webkitTransform=q),r.roundLengths&&(E=Math.floor(E))}else E=(w-(r.slidesPerView-1)*h)/r.slidesPerView,r.roundLengths&&(E=Math.floor(E)),N&&(N.style[t.getDirectionLabel("width")]=`${E}px`);N&&(N.swiperSlideSize=E),m.push(E),r.centeredSlides?(p=p+E/2+x/2+h,x===0&&O!==0&&(p=p-w/2-h),O===0&&(p=p-w/2-h),Math.abs(p)<1/1e3&&(p=0),r.roundLengths&&(p=Math.floor(p)),k%r.slidesPerGroup===0&&d.push(p),f.push(p)):(r.roundLengths&&(p=Math.floor(p)),(k-Math.min(t.params.slidesPerGroupSkip,k))%t.params.slidesPerGroup===0&&d.push(p),f.push(p),p=p+E+h),t.virtualSize+=E+h,x=E,k+=1}}if(t.virtualSize=Math.max(t.virtualSize,w)+b,i&&a&&(r.effect==="slide"||r.effect==="coverflow")&&(n.style.width=`${t.virtualSize+h}px`),r.setWrapperSize&&(n.style[t.getDirectionLabel("width")]=`${t.virtualSize+h}px`),T&&t.grid.updateWrapperSize(E,d),!r.centeredSlides){const O=r.slidesPerView!=="auto"&&r.slidesPerView%1!==0,N=r.snapToSlideEdge&&!r.loop&&(r.slidesPerView==="auto"||O);let M=d.length;if(N){let q;if(r.slidesPerView==="auto"){q=1;let D=0;for(let K=m.length-1;K>=0&&(D+=m[K]+(K<m.length-1?h:0),D<=w);K-=1)q=m.length-K}else q=Math.floor(r.slidesPerView);M=Math.max(c-q,0)}const X=[];for(let q=0;q<d.length;q+=1){let D=d[q];r.roundLengths&&(D=Math.floor(D)),N?q<=M&&X.push(D):d[q]<=t.virtualSize-w&&X.push(D)}d=X,Math.floor(t.virtualSize-w)-Math.floor(d[d.length-1])>1&&(N||d.push(t.virtualSize-w))}if(o&&r.loop){const O=m[0]+h,N=t.virtual.slidesBefore??0,M=t.virtual.slidesAfter??0,X=N+M;if(r.slidesPerGroup>1){const q=Math.ceil(X/r.slidesPerGroup),D=O*r.slidesPerGroup;for(let K=0;K<q;K+=1)d.push(d[d.length-1]+D)}for(let q=0;q<X;q+=1)r.slidesPerGroup===1&&d.push(d[d.length-1]+O),f.push(f[f.length-1]+O),t.virtualSize+=O}if(d.length===0&&(d=[0]),h!==0){const O=t.isHorizontal()&&i?"marginLeft":t.getDirectionLabel("marginRight");u.filter((N,M)=>!r.cssMode||r.loop?!0:M!==u.length-1).forEach(N=>{N.style[O]=`${h}px`})}if(r.centeredSlides&&r.centeredSlidesBounds){let O=0;m.forEach(M=>{O+=M+(h||0)}),O-=h;const N=O>w?O-w:0;d=d.map(M=>M<=0?-g:M>N?N+b:M)}if(r.centerInsufficientSlides){let O=0;if(m.forEach(N=>{O+=N+(h||0)}),O-=h,O<w){const N=(w-O)/2;d.forEach((M,X)=>{d[X]=M-N}),f.forEach((M,X)=>{f[X]=M+N})}}if(Object.assign(t,{slides:u,snapGrid:d,slidesGrid:f,slidesSizesGrid:m}),r.centeredSlides&&r.cssMode&&!r.centeredSlidesBounds){Bs(n,"--swiper-centered-offset-before",`${-d[0]}px`),Bs(n,"--swiper-centered-offset-after",`${t.size/2-m[m.length-1]/2}px`);const O=-t.snapGrid[0],N=-t.slidesGrid[0];t.snapGrid=t.snapGrid.map(M=>M+O),t.slidesGrid=t.slidesGrid.map(M=>M+N)}if(c!==l&&t.emit("slidesLengthChange"),d.length!==_&&(t.params.watchOverflow&&t.checkOverflow(),t.emit("snapGridLengthChange")),f.length!==v&&t.emit("slidesGridLengthChange"),r.watchSlidesProgress&&t.updateSlidesOffset(),t.emit("slidesUpdated"),!o&&!r.cssMode&&(r.effect==="slide"||r.effect==="fade")){const O=`${r.containerModifierClass}backface-hidden`,N=t.el.classList.contains(O);c<=r.maxBackfaceHiddenSlides?N||t.el.classList.add(O):N&&t.el.classList.remove(O)}}const Fc=(t,e,r)=>{e&&!t.classList.contains(r)?t.classList.add(r):!e&&t.classList.contains(r)&&t.classList.remove(r)};function MP(){var d;const t=this,{slides:e,params:r,slidesEl:n,activeIndex:s}=t,i=!!(t.virtual&&((d=r.virtual)!=null&&d.enabled)),a=t.grid&&r.grid&&r.grid.rows>1,o=f=>en(n,`.${r.slideClass}${f}, swiper-slide${f}`)[0];let l,u,c;if(i)if(r.loop){const f=t.virtual.slides;let m=s-(t.virtual.slidesBefore??0);m<0&&(m=f.length+m),m>=f.length&&(m-=f.length),l=o(`[data-swiper-slide-index="${m}"]`)}else l=o(`[data-swiper-slide-index="${s}"]`);else a?(l=e.find(f=>f.column===s),c=e.find(f=>f.column===s+1),u=e.find(f=>f.column===s-1)):l=e[s];l&&(a||(c=kC(l,`.${r.slideClass}, swiper-slide`)[0],r.loop&&!c&&(c=e[0]),u=SC(l,`.${r.slideClass}, swiper-slide`)[0],r.loop&&!u===0&&(u=e[e.length-1]))),e.forEach(f=>{Fc(f,f===l,r.slideActiveClass),Fc(f,f===c,r.slideNextClass),Fc(f,f===u,r.slidePrevClass)}),t.emitSlidesClasses()}function DP(){const t=this,e=t.slides,r=t.isElement?t.isHorizontal()?t.wrapperEl.offsetLeft:t.wrapperEl.offsetTop:0;for(let n=0;n<e.length;n+=1)e[n].swiperSlideOffset=(t.isHorizontal()?e[n].offsetLeft:e[n].offsetTop)-r-t.cssOverflowAdjustment()}const Lg=(t,e,r)=>{e&&!t.classList.contains(r)?t.classList.add(r):!e&&t.classList.contains(r)&&t.classList.remove(r)};function $P(t=this&&this.translate||0){const e=this,r=e.params,{slides:n,rtlTranslate:s,snapGrid:i}=e;if(n.length===0)return;typeof n[0].swiperSlideOffset>"u"&&e.updateSlidesOffset();let a=-t;s&&(a=t),e.visibleSlidesIndexes=[],e.visibleSlides=[];let o=r.spaceBetween;typeof o=="string"&&o.indexOf("%")>=0?o=parseFloat(o.replace("%",""))/100*e.size:typeof o=="string"&&(o=parseFloat(o));for(let l=0;l<n.length;l+=1){const u=n[l];let c=u.swiperSlideOffset??0;r.cssMode&&r.centeredSlides&&(c-=n[0].swiperSlideOffset??0);const d=u.swiperSlideSize??0,f=(a+(r.centeredSlides?e.minTranslate():0)-c)/(d+o),m=(a-i[0]+(r.centeredSlides?e.minTranslate():0)-c)/(d+o),y=-(a-c),g=y+e.slidesSizesGrid[l],b=y>=0&&y<=e.size-e.slidesSizesGrid[l],_=y>=0&&y<e.size-1||g>1&&g<=e.size||y<=0&&g>=e.size;_&&(e.visibleSlides.push(u),e.visibleSlidesIndexes.push(l)),Lg(u,_,r.slideVisibleClass),Lg(u,b,r.slideFullyVisibleClass),u.progress=s?-f:f,u.originalProgress=s?-m:m}}var zP={updateSize:LP,updateSlides:jP,updateAutoHeight:OP,updateSlidesOffset:DP,updateSlidesProgress:$P,updateProgress:NP,updateSlidesClasses:MP,updateActiveIndex:RP,updateClickedSlide:IP};const UP={eventsEmitter:FC,update:zP,translate:PP,transition:bP,slide:yP,loop:oP,grabCursor:nP,events:eP,breakpoints:jC,checkOverflow:DC,classes:BC},hh={};var kt;let To=(kt=class{constructor(...e){let r,n;if(e.length===1&&e[0]!==null&&typeof e[0]=="object"&&Object.prototype.toString.call(e[0]).slice(8,-1)==="Object"?n=e[0]:[r,n]=e,n||(n={}),n=Bt({},n),r&&!n.el&&(n.el=r),n.el&&typeof n.el=="string"&&typeof document<"u"&&document.querySelectorAll(n.el).length>1){const o=[];return document.querySelectorAll(n.el).forEach(l=>{const u=Bt({},n,{el:l});o.push(new kt(u))}),o}const s=this;s.__swiper__=!0,s.support=Yw(),s.device=Xw({userAgent:n.userAgent??void 0}),s.browser=Qw(),s.eventsListeners={},s.eventsAnyListeners=[],s.modules=[...s.__modules__||[]],n.modules&&Array.isArray(n.modules)&&n.modules.forEach(o=>{const l=o;typeof l=="function"&&s.modules.indexOf(l)<0&&s.modules.push(l)});const i={};s.modules.forEach(o=>{o({params:n,swiper:s,extendParams:lP(n,i),on:s.on.bind(s),once:s.once.bind(s),off:s.off.bind(s),emit:s.emit.bind(s)})});const a=Bt({},qf,i);if(s.params=Bt({},a,hh,n),s.originalParams=Bt({},s.params),s.passedParams=Bt({},n),s.params&&s.params.on){const o=s.params.on;Object.keys(o).forEach(l=>{const u=o[l];u&&s.on(l,u)})}return s.params&&s.params.onAny&&s.onAny(s.params.onAny),Object.assign(s,{enabled:s.params.enabled,el:r,classNames:[],slides:[],slidesGrid:[],snapGrid:[],slidesSizesGrid:[],isHorizontal(){return s.params.direction==="horizontal"},isVertical(){return s.params.direction==="vertical"},activeIndex:0,realIndex:0,isBeginning:!0,isEnd:!1,translate:0,previousTranslate:0,progress:0,velocity:0,animating:!1,cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23},allowSlideNext:s.params.allowSlideNext,allowSlidePrev:s.params.allowSlidePrev,touchEventsData:{isTouched:void 0,isMoved:void 0,allowTouchCallbacks:void 0,touchStartTime:void 0,isScrolling:void 0,currentTranslate:void 0,startTranslate:void 0,allowThresholdMove:void 0,focusableElements:s.params.focusableElements,lastClickTime:0,clickTimeout:void 0,velocities:[],allowMomentumBounce:void 0,startMoving:void 0,pointerId:null,touchId:null},allowClick:!0,allowTouchMove:s.params.allowTouchMove,touches:{startX:0,startY:0,currentX:0,currentY:0,diff:0},imagesToLoad:[],imagesLoaded:0}),s.emit("_swiper"),s.params.init&&s.init(),s}getDirectionLabel(e){return this.isHorizontal()?e:{width:"height","margin-top":"margin-left","margin-bottom ":"margin-right","margin-left":"margin-top","margin-right":"margin-bottom","padding-left":"padding-top","padding-right":"padding-bottom",marginRight:"marginBottom"}[e]}isHorizontal(){return this.params.direction==="horizontal"}isVertical(){return this.params.direction==="vertical"}cssOverflowAdjustment(){return Math.trunc(this.translate/2**23)*2**23}getSlideIndex(e){const{slidesEl:r,params:n}=this,s=en(r,`.${n.slideClass}, swiper-slide`),i=Ag(s[0]);return Ag(e)-(i??0)}getSlideIndexByData(e){return this.getSlideIndex(this.slides.find(r=>Number(r.getAttribute("data-swiper-slide-index"))===e))}getSlideIndexWhenGrid(e){return this.grid&&this.params.grid&&this.params.grid.rows>1&&(this.params.grid.fill==="column"?e=Math.floor(e/this.params.grid.rows):this.params.grid.fill==="row"&&(e=e%Math.ceil(this.slides.length/this.params.grid.rows))),e}recalcSlides(){const{slidesEl:e,params:r}=this;this.slides=en(e,`.${r.slideClass}, swiper-slide`)}enable(){this.enabled||(this.enabled=!0,this.params.grabCursor&&this.setGrabCursor(),this.emit("enable"))}disable(){this.enabled&&(this.enabled=!1,this.params.grabCursor&&this.unsetGrabCursor(),this.emit("disable"))}setProgress(e,r){e=Math.min(Math.max(e,0),1);const n=this.minTranslate(),i=(this.maxTranslate()-n)*e+n;this.translateTo(i,typeof r>"u"?0:r),this.updateActiveIndex(),this.updateSlidesClasses()}emitContainerClasses(){if(!this.params._emitClasses||!this.el)return;const e=this.el.className.split(" ").filter(r=>r.indexOf("swiper")===0||r.indexOf(this.params.containerModifierClass)===0);this.emit("_containerClasses",e.join(" "))}getSlideClasses(e){return this.destroyed?"":e.className.split(" ").filter(r=>r.indexOf("swiper-slide")===0||r.indexOf(this.params.slideClass)===0).join(" ")}emitSlidesClasses(){if(!this.params._emitClasses||!this.el)return;const e=[];this.slides.forEach(r=>{const n=this.getSlideClasses(r);e.push({slideEl:r,classNames:n}),this.emit("_slideClass",r,n)}),this.emit("_slideClasses",e)}slidesPerViewDynamic(e="current",r=!1){const{params:n,slides:s,slidesGrid:i,slidesSizesGrid:a,size:o,activeIndex:l}=this;let u=1;if(typeof n.slidesPerView=="number")return n.slidesPerView;if(!o)return u;if(n.centeredSlides){let c=s[l]?Math.ceil(s[l].swiperSlideSize??0):0,d=!1;for(let f=l+1;f<s.length;f+=1)s[f]&&!d&&(c+=Math.ceil(s[f].swiperSlideSize??0),u+=1,c>o&&(d=!0));for(let f=l-1;f>=0;f-=1)s[f]&&!d&&(c+=s[f].swiperSlideSize??0,u+=1,c>o&&(d=!0))}else if(e==="current")for(let c=l+1;c<s.length;c+=1)(r?i[c]+a[c]-i[l]<o:i[c]-i[l]<o)&&(u+=1);else for(let c=l-1;c>=0;c-=1)i[l]-i[c]<o&&(u+=1);return u}update(){var a,o;const e=this;if(!e||e.destroyed)return;const{snapGrid:r,params:n}=e;n.breakpoints&&e.setBreakpoint(),n.lazyPreload&&[...e.el.querySelectorAll('[loading="lazy"]')].forEach(l=>{l.complete&&gl(e,l)}),e.updateSize(),e.updateSlides(),e.updateProgress(),e.updateSlidesClasses();function s(){const l=e.rtlTranslate?e.translate*-1:e.translate,u=Math.min(Math.max(l,e.maxTranslate()),e.minTranslate());e.setTranslate(u),e.updateActiveIndex(),e.updateSlidesClasses()}let i;if((a=n.freeMode)!=null&&a.enabled&&!n.cssMode)s(),n.autoHeight&&e.updateAutoHeight();else{if((n.slidesPerView==="auto"||n.slidesPerView>1)&&e.isEnd&&!n.centeredSlides){const l=e.virtual&&((o=n.virtual)!=null&&o.enabled)?e.virtual.slides.length:e.slides.length;i=e.slideTo(l-1,0,!1,!0)}else i=e.slideTo(e.activeIndex,0,!1,!0);i||s()}n.watchOverflow&&r!==e.snapGrid&&e.checkOverflow(),e.emit("update")}changeDirection(e,r=!0){const n=this,s=n.params.direction;return e||(e=s==="horizontal"?"vertical":"horizontal"),e===s||e!=="horizontal"&&e!=="vertical"||(n.el.classList.remove(`${n.params.containerModifierClass}${s}`),n.el.classList.add(`${n.params.containerModifierClass}${e}`),n.emitContainerClasses(),n.params.direction=e,n.rtlTranslate=e==="horizontal"&&n.rtl,n.slides.forEach(i=>{e==="vertical"?i.style.width="":i.style.height=""}),n.emit("changeDirection"),r&&n.update()),n}changeLanguageDirection(e){const r=this;r.rtl&&e==="rtl"||!r.rtl&&e==="ltr"||(r.rtl=e==="rtl",r.rtlTranslate=r.params.direction==="horizontal"&&r.rtl,r.rtl?(r.el.classList.add(`${r.params.containerModifierClass}rtl`),r.el.dir="rtl"):(r.el.classList.remove(`${r.params.containerModifierClass}rtl`),r.el.dir="ltr"),r.update())}mount(e){const r=this;if(r.mounted)return!0;if(typeof document>"u")return!1;const n=e??r.params.el;let s=null;if(typeof n=="string"?s=document.querySelector(n):n instanceof HTMLElement&&(s=n),!s)return!1;s.swiper=r;const i=s.parentNode;i&&i.host&&i.host.nodeName===r.params.swiperElementNodeName.toUpperCase()&&(r.isElement=!0);const a=()=>`.${(r.params.wrapperClass||"").trim().split(" ").join(".")}`;let l=s&&s.shadowRoot?s.shadowRoot.querySelector(a()):en(s,a())[0];!l&&r.params.createElements&&(l=au("div",r.params.wrapperClass),s.append(l),en(s,`.${r.params.slideClass}`).forEach(c=>{l.append(c)}));const u=r.isElement?s.parentNode.host:null;return Object.assign(r,{el:s,wrapperEl:l,slidesEl:r.isElement&&!u.slideSlots?u:l,hostEl:r.isElement?u:s,mounted:!0,rtl:s.dir.toLowerCase()==="rtl"||kn(s,"direction")==="rtl",rtlTranslate:r.params.direction==="horizontal"&&(s.dir.toLowerCase()==="rtl"||kn(s,"direction")==="rtl"),wrongRTL:kn(l,"display")==="-webkit-box"}),!0}init(e){var s;const r=this;if(r.initialized||r.mount(e)===!1)return r;if(r.emit("beforeInit"),r.params.breakpoints&&r.setBreakpoint(),r.addClasses(),r.updateSize(),r.updateSlides(),r.params.watchOverflow&&r.checkOverflow(),r.params.grabCursor&&r.enabled&&r.setGrabCursor(
380),r.params.loop&&r.virtual&&((s=r.params.virtual)!=null&&s.enabled)?r.slideTo((r.params.initialSlide??0)+(r.virtual.slidesBefore??0),0,r.params.runCallbacksOnInit,!1,!0):r.slideTo(r.params.initialSlide,0,r.params.runCallbacksOnInit,!1,!0),r.params.loop&&r.loopCreate(void 0,!0),r.attachEvents(),r.params.lazyPreload){const i=[...r.el.querySelectorAll('[loading="lazy"]')];r.isElement&&i.push(...r.hostEl.querySelectorAll('[loading="lazy"]')),i.forEach(a=>{a.complete?gl(r,a):a.addEventListener("load",o=>{gl(r,o.target)})})}return r.initialized=!0,e_(r),r.emit("init"),r.emit("afterInit"),r}destroy(e=!0,r=!0){const n=this,{params:s,el:i,wrapperEl:a,slides:o}=n;return typeof n.params>"u"||n.destroyed||(n.emit("beforeDestroy"),n.initialized=!1,n.detachEvents(),s.loop&&n.loopDestroy(),r&&(n.removeClasses(),i&&typeof i!="string"&&i.removeAttribute("style"),a&&a.removeAttribute("style"),o&&o.length&&o.forEach(l=>{l.classList.remove(s.slideVisibleClass,s.slideFullyVisibleClass,s.slideActiveClass,s.slideNextClass,s.slidePrevClass),l.removeAttribute("style"),l.removeAttribute("data-swiper-slide-index")})),n.emit("destroy"),Object.keys(n.eventsListeners).forEach(l=>{n.off(l)}),e!==!1&&(n.el&&typeof n.el!="string"&&(n.el.swiper=null),vC(n)),n.destroyed=!0),null}static extendDefaults(e){Bt(hh,e)}static installModule(e){kt.prototype.__modules__||(kt.prototype.__modules__=[]);const r=kt.prototype.__modules__;typeof e=="function"&&r.indexOf(e)<0&&r.push(e)}static use(e){return Array.isArray(e)?(e.forEach(r=>kt.installModule(r)),kt):(kt.installModule(e),kt)}},rc(kt,"extendedDefaults"),rc(kt,"defaults"),kt);Object.defineProperty(To,"extendedDefaults",{get(){return hh}});Object.defineProperty(To,"defaults",{get(){return qf}});const jg=UP,BP=To.prototype;Object.keys(jg).forEach(t=>{const e=jg[t];Object.keys(e).forEach(r=>{BP[r]=e[r]})});To.use([cP,uP]);function FP(t,e,r,n,s){const i=[];if(!e)return i;const a=l=>{i.indexOf(l)<0&&i.push(l)};if(r&&n){const l=n.map(s),u=r.map(s);l.join("")!==u.join("")&&a("children"),n.length!==r.length&&a("children")}return Gw.filter(l=>l[0]==="_").map(l=>l.replace(/_/,"")).forEach(l=>{if(l in t&&l in e){const u=t[l],c=e[l];if(We(u)&&We(c)){const d=Object.keys(u),f=Object.keys(c);d.length!==f.length?a(l):(d.forEach(m=>{u[m]!==c[m]&&a(l)}),f.forEach(m=>{u[m]!==c[m]&&a(l)}))}else u!==c&&a(l)}}),i}function VP(t={},e=!0){const r={on:{}},n={},s={};vi(r,qf),r._emitClasses=!0,r.init=!1;const i={},a=Gw.map(l=>l.replace(/_/,"")),o={...t};return Object.keys(o).forEach(l=>{const u=t[l];if(!(typeof u>"u"))if(a.indexOf(l)>=0)We(u)?(r[l]={},s[l]={},vi(r[l],u),vi(s[l],u)):(r[l]=u,s[l]=u);else if(l.search(/on[A-Z]/)===0&&typeof u=="function"){const c=`${l[2].toLowerCase()}${l.substring(3)}`,d=u;e?n[c]=d:r.on[c]=d}else i[l]=u}),["navigation","pagination","scrollbar"].forEach(l=>{r[l]===!0&&(r[l]={}),r[l]===!1&&delete r[l]}),{params:r,passedParams:s,rest:i,events:n}}function WP(t,e){const{el:r,nextEl:n,prevEl:s,paginationEl:i,scrollbarEl:a,swiper:o}=t;if(qw(e)&&n&&s){const l=o.params.navigation,u=o.originalParams.navigation;l.nextEl=n,u.nextEl=n,l.prevEl=s,u.prevEl=s}Kw(e)&&i&&(o.params.pagination.el=i,o.originalParams.pagination.el=i),Jw(e)&&a&&(o.params.scrollbar.el=a,o.originalParams.scrollbar.el=a),o.init(r)}const HP=t=>{var e,r;!t||t.destroyed||!t.params.virtual||t.params.virtual&&!t.params.virtual.enabled||(t.updateSlides(),t.updateProgress(),t.updateSlidesClasses(),t.emit("_virtualUpdated"),t.parallax&&t.params.parallax&&t.params.parallax.enabled&&((r=(e=t.parallax).setTranslate)==null||r.call(e)))},Mg=P.createContext(null),GP=P.createContext(null);function Ta(t){return typeof t=="object"&&t!==null&&"type"in t&&"props"in t}function n_(t){if(!Ta(t))return!1;const{type:e}=t;if(typeof e!="function"&&typeof e!="object")return!1;const r=e.displayName;return!!r&&r.includes("SwiperSlide")}function s_(t){const e=[];return $.Children.toArray(t).forEach(r=>{n_(r)?e.push(r):Ta(r)&&r.props&&r.props.children&&s_(r.props.children).forEach(n=>e.push(n))}),e}function qP(t){const e=[],r={"container-start":[],"container-end":[],"wrapper-start":[],"wrapper-end":[]};return $.Children.toArray(t).forEach(n=>{if(n_(n))e.push(n);else if(Ta(n)&&n.props&&n.props.slot&&n.props.slot in r)r[n.props.slot].push(n);else if(Ta(n)&&n.props&&n.props.children){const s=s_(n.props.children);s.length>
3800?s.forEach(i=>e.push(i)):r["container-end"].push(n)}else Ta(n)&&r["container-end"].push(n)}),{slides:e,slots:r}}function Ca(t,e){return typeof window>"u"?P.useEffect(t,e):P.useLayoutEffect(t,e)}function KP(t,e,r){if(!r||!t)return null;const n=c=>{let d=c;return c<0?d=e.length+c:d>=e.length&&(d-=e.length),d},s=t.isHorizontal()?{[t.rtlTranslate?"right":"left"]:`${r.offset}px`}:{top:`${r.offset}px`},{from:i,to:a}=r,o=t.params.loop?-e.length:0,l=t.params.loop?e.length*2:e.length,u=[];for(let c=o;c<l;c+=1)if(c>=i&&c<=a){const d=e[n(c)];d&&u.push(d)}return u.map((c,d)=>{const f=c.props.virtualIndex;return $.cloneElement(c,{swiper:t,style:s,key:f||c.key||`slide-${d}`})})}const i_=P.forwardRef(function(e,r){const{className:n,tag:s="div",wrapperTag:i="div",children:a,onSwiper:o,...l}=e??{};let u=!1;const[c,d]=P.useState("swiper"),[f,m]=P.useState(null),[y,g]=P.useState(!1),b=P.useRef(!1),_=P.useRef(null),v=P.useRef(null),w=P.useRef(null),h=P.useRef(null),p=P.useRef(null),x=P.useRef(null),k=P.useRef(null),T=P.useRef(null),{params:E,passedParams:R,rest:j,events:L}=VP(l),{slides:O,slots:N}=qP(a),M=()=>{g(!y)};Object.assign(E.on,{_containerClasses(re,oe){d(oe)}});const X=()=>{var ce;Object.assign(E.on,L),u=!0;const re={...E};delete re.wrapperClass,v.current=new To(re);const oe=v.current;if(oe.virtual&&((ce=oe.params.virtual)!=null&&ce.enabled)){oe.virtual.slides=O;const xe={cache:!1,slides:O,renderExternal:m,renderExternalUpdate:!1};vi(oe.params.virtual,xe),oe.originalParams.virtual&&vi(oe.originalParams.virtual,xe)}};_.current||X(),v.current&&v.current.on("_beforeBreakpoint",M);const q=()=>{u||!L||!v.current||Object.keys(L).forEach(re=>{v.current.on(re,L[re])})},D=()=>{!L||!v.current||Object.keys(L).forEach(re=>{v.current.off(re,L[re])})};P.useEffect(()=>()=>{v.current&&v.current.off("_beforeBreakpoint",M)}),P.useEffect(()=>{!b.current&&v.current&&(v.current.emitSlidesClasses(),b.current=!0)}),Ca(()=>{if(r&&(typeof r=="function"?r(_.current):r.current=_.current),!!_.current)return v.current&&v.current.destroyed&&X(),WP({el:_.current,nextEl:p.current,prevEl:x.current,paginationEl:k.current,scrollbarEl:T.current,swiper:v.current},E),o&&v.current&&!v.current.destroyed&&o(v.current),()=>{v.current&&!v.current.destroyed&&v.current.destroy(!0,!1)}},[]),Ca(()=>{q();const re=FP(R,w.current,O,h.current,oe=>oe.key);return w.current=R,h.current=O,re.length&&v.current&&!v.current.destroyed&&AC({swiper:v.current,slides:O,passedParams:R,changedParams:re,nextEl:p.current,prevEl:x.current,scrollbarEl:T.current,paginationEl:k.current}),()=>{D()}}),Ca(()=>{HP(v.current)},[f]);function K(){return E.virtual?KP(v.current,O,f):O.map((re,oe)=>$.cloneElement(re,{swiper:v.current,swiperSlideIndex:oe}))}const U=s,W=i;return $.createElement(U,{ref:_,className:Zw(`${c}${n?` ${n}`:""}`),...j},$.createElement(GP.Provider,{value:v.current},N["container-start"],$.createElement(W,{className:PC(E.wrapperClass)},N["wrapper-start"],K(),N["wrapper-end"]),qw(E)&&$.createElement($.Fragment,null,$.createElement("div",{ref:x,className:"swiper-button-prev"}),$.createElement("div",{ref:p,className:"swiper-button-next"})),Jw(E)&&$.createElement("div",{ref:T,className:"swiper-scrollbar"}),Kw(E)&&$.createElement("div",{ref:k,className:"swiper-pagination"}),N["container-end"]))});i_.displayName="Swiper";const a_=P.forwardRef(function(e,r){const{tag:n="div",children:s,className:i="",swiper:a,zoom:o,lazy:l,virtualIndex:u,swiperSlideIndex:c,...d}=e,f=P.useRef(null),[m,y]=P.useState("swiper-slide"),[g,b]=P.useState(!1);function _(k,T,E){T===f.current&&y(E)}Ca(()=>{if(typeof c<"u"&&f.current&&(f.current.swiperSlideIndex=c),r&&(typeof r=="function"?r(f.current):r.current=f.current),!(!f.current||!a)){if(a.destroyed){m!=="swiper-slide"&&y("swiper-slide");return}return a.on("_slideClass",_),()=>{a&&a.off("_slideClass",_)}}}),Ca(()=>{a&&f.current&&!a.destroyed&&y(a.getSlideClasses(f.current))},[a]);const v={isActive:m.indexOf("swiper-slide-active")>=0,isVisible:m.indexOf("swiper-slide-visible")>=0,isFullyVisible:m.indexOf("swiper-slide-fully-visible")>=0,isPrev:m.indexOf("swiper-slide-prev")>=0,isNext:m.indexOf("swiper-slide-next")>=0},w=()=>typeof s=="function"?s(v):s,h=()=>{b(!0)},p=k=>{k&&(k.lazyPreloaderManaged=!0)},x=n;return $.createElement(x,{ref:f,className:Zw(`${m}${i?` ${i}`:""}`),"data-swiper-slide-index":u,onLoad:h,...d},o&&$.createElement(Mg.Provider,{value:v},$.createElement("div",{className:"swiper-zoom-container","data-swiper-zoom":typeof o=="number"?o:void 0},w(),l&&!g&&$.createElement("div",{className:"swiper-lazy-preloader",ref:p}))),!o&&$.createElement(Mg.Provider,{value:v},w(),l&&!g&&$.createElement("div",{className:"swiper-lazy-preloader",ref:p})))});a_.displayName="SwiperSlide";function JP(t){const{effect:e,swiper:r,on:n,setTranslate:s,setTransition:i,overwriteParams:a,perspective:o,recreateShadows:l,getEffectParams:u}=t;n("beforeInit",()=>{if(r.params.effect!==e)return;r.classNames.push(`${r.params.containerModifierClass}${e}`),o&&o()&&r.classNames.push(`${r.params.containerModifierClass}3d`);const d=a?a():{};Object.assign(r.params,d),Object.assign(r.originalParams,d)}),n("setTranslate _virtualUpdated",()=>{r.params.effect===e&&s()}),n("setTransition",(d,f)=>{r.params.effect===e&&i(f)}),n("transitionEnd",()=>{if(r.params.effect===e&&l){const d=u?u():void 0;if(!d||!d.slideShadows)return;
380r.slides.forEach(f=>{f.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(m=>m.remove())}),l()}});let c=!1;n("virtualUpdate",()=>{r.params.effect===e&&(r.slides.length||(c=!0),requestAnimationFrame(()=>{c&&r.slides&&r.slides.length&&(s(),c=!1)}))})}function ZP(t,e){const r=Gf(e);return r!==e&&(r.style.backfaceVisibility="hidden",r.style.setProperty("-webkit-backface-visibility","hidden")),r}function YP({swiper:t,duration:e,transformElements:r,allSlides:n}){const{activeIndex:s}=t,i=a=>{if(!a.parentElement)return t.slides.find(o=>o.shadowRoot&&o.shadowRoot===a.parentNode);if(a.parentElement instanceof HTMLElement)return a.parentElement};if(t.params.virtualTranslate&&e!==0){let a=!1,o;n?o=r:o=r.filter(l=>{const u=l.classList.contains("swiper-slide-transform")?i(l):l;return!!u&&t.getSlideIndex(u)===s}),o.forEach(l=>{TC(l,()=>{if(a||!t||t.destroyed)return;a=!0,t.animating=!1;const u=new CustomEvent("transitionend",{bubbles:!0,cancelable:!0});t.wrapperEl.dispatchEvent(u)})})}}function Dg(t,e,r){const n=`swiper-slide-shadow${r?`-${r}`:""}${` swiper-slide-shadow-${t}`}`,s=Gf(e),i=`.${n.split(" ").join(".")}`,a=s.querySelector(i);if(a)return a;const o=au("div",n.split(" "));return s.append(o),o}const XP=({swiper:t,extendParams:e,on:r})=>{e({flipEffect:{slideShadows:!0,limitRotation:!0}});function n(){return t.params.flipEffect}const s=(l,u)=>{let c=t.isHorizontal()?l.querySelector(".swiper-slide-shadow-left"):l.querySelector(".swiper-slide-shadow-top"),d=t.isHorizontal()?l.querySelector(".swiper-slide-shadow-right"):l.querySelector(".swiper-slide-shadow-bottom");c||(c=Dg("flip",l,t.isHorizontal()?"left":"top")),d||(d=Dg("flip",l,t.isHorizontal()?"right":"bottom")),c&&(c.style.opacity=String(Math.max(-u,0))),d&&(d.style.opacity=String(Math.max(u,0)))};JP({effect:"flip",swiper:t,on:r,setTranslate:()=>{const{slides:l,rtlTranslate:u}=t,c=n(),d=CC(t);for(let f=0;f<l.length;f+=1){const m=l[f];let y=m.progress??0;c.limitRotation&&(y=Math.max(Math.min(y,1),-1));const g=m.swiperSlideOffset??0;let _=-180*y,v=0,w=t.params.cssMode?-g-t.translate:-g,h=0;t.isHorizontal()?u&&(_=-_):(h=w,w=0,v=-_,_=0),m.style.zIndex=String(-Math.abs(Math.round(y))+l.length),c.slideShadows&&s(m,y);const p=`translate3d(${w}px, ${h}px, 0px) rotateX(${d(v)}deg) rotateY(${d(_)}deg)`,x=ZP(c,m);x.style.transform=p}},setTransition:l=>{const u=t.slides.map(c=>Gf(c));u.forEach(c=>{c.style.transitionDuration=`${l}ms`,c.querySelectorAll(".swiper-slide-shadow-top, .swiper-slide-shadow-right, .swiper-slide-shadow-bottom, .swiper-slide-shadow-left").forEach(d=>{d.style.transitionDuration=`${l}ms`})}),YP({swiper:t,duration:l,transformElements:u})},recreateShadows:()=>{const l=n();t.slides.forEach(u=>{let c=u.progress??0;l.limitRotation&&(c=Math.max(Math.min(c,1),-1)),s(u,c)})},getEffectParams:()=>t.params.flipEffect,perspective:()=>!0,overwriteParams:()=>({slidesPerView:1,slidesPerGroup:1,watchSlidesProgress:!0,spaceBetween:0,virtualTranslate:!t.params.cssMode})})},QP=t=>{const e="-zoom",r=["clip-path","fill","mask","marker-start","marker-mid","marker-end"],n=new Map;if(t.hasAttribute("id")){const{id:i}=t,a=i+e;n.set(i,a);const o=t;o.id=a}t.querySelectorAll("[id]").forEach(i=>{const{id:a}=i,o=a+e;n.set(a,o);const l=i;l.id=o});const s=r.map(i=>`[${i}]`).join(", ");t.querySelectorAll(s).forEach(i=>{for(const a of r){const o=i.getAttribute(a);if((o==null?void 0:o.startsWith("url(#"))===!0){const l=o.slice(5,-1),u=n.get(l);u!==void 0&&i.setAttribute(a,`url(#${u})`)}}}),t.querySelectorAll("style").forEach(i=>{const{textContent:a}=i;if(a!==""){let o=a;if(n.forEach((l,u)=>{o=o.replaceAll(`#${u}`,`#${l}`)}),o!==a){const l=i;l.textContent=o}}})};function eA(t){return typeof Element>"u"?!1:t instanceof Element}const ou=(t,e)=>eA(e)&&e.tagName.toUpperCase()===t,Kf=t=>ou("DIV",t)||ou("SPAN",t),lu=t=>ou("IMG",t),$g=t=>t.complete&&t.naturalHeight!==0,vl=t=>ou("SVG",t),tA=t=>{if(t!==null)return lu(t)?t.alt:t.getAttribute("aria-label")??void 0},rA=/url(?:\(['"]?)(?<url>.*?)(?:['"]?\))/,zg=t=>{var e;if(t!==null){if(lu(t))return t.currentSrc===""?void 0:t.currentSrc;if(Kf(t)){const{backgroundImage:r}=window.getComputedStyle(t);if(r!=="")return(e=rA.exec(r))==null?void 0:e[1]}}},Vc=t=>{if(t==null)return{};if(vl(t)){const{parentElement:e}=t,r=t.getBoundingClientRect();if(e==null)return{height:r.height,left:r.left,width:r.width,top:r.top};{const n=e.getBoundingClientRect();return{height:r.height,left:n.left-r.left,top:n.top-r.top,width:r.width}}}else return{height:t.offsetHeight,left:t.offsetLeft,width:t.offsetWidth,top:t.offsetTop}},o_=({height:t,offset:e,width:r})=>Math.min((window.innerWidth-e*2)/r,(window.innerHeight-e*2)/t),nA=({containerHeight:t,containerWidth:e,offset:r,targetHeight:n,targetWidth:s})=>{const i=o_({height:n,offset:r,width:s}),a=s>n?s/e:n/t;return i>1?a:i*a},Jf=({containerHeight:t,containerWidth:e,hasScalableSrc:r,offset:n,targetHeight:s,targetWidth:i})=>t===0||e===0?1:!r&&s!==0&&i!==0?nA({containerHeight:t,containerWidth:e,offset:n,targetHeight:s,targetWidth:i}):o_({height:t,offset:n,width:e}),sA=({containerHeight:t,containerLeft:e,containerTop:r,containerWidth:n,hasScalableSrc:s,offset:i,targetHeight:a,targetWidth:o})=>{const l=Jf({containerHeight:t,containerWidth:n,hasScalableSrc:s,offset:i,targetHeight:a,targetWidth:o});return{top:r,left:e,width:n*l,height:t*l,initialTransform:`translate(0,0) scale(${1/l})`}},uu=(t,e)=>{const r=parseFloat(t);return t.endsWith("%")?e*r/100:r},Pa=({containerHeight:t,containerLeft:e,containerTop:r,containerWidth:n,hasScalableSrc:s,offset:i,position:a,targetHeight:o,targetWidth:l,visibleHeight:u,visibleWidth:c})=>{const[d="50%",f="50%"]=a.split(" "),m=uu(d,n-c),y=uu(f,t-u),g=Jf({containerHeight:u,containerWidth:c,hasScalableSrc:s,offset:i,targetHeight:o,targetWidth:l});return{top:r+y,left:e+m,width:c*g,height:u*g,initialTransform:`translate(0,0) scale(${1/g})`}},iA=({containerHeight:t,containerLeft:e,containerTop:r,containerWidth:n,hasScalableSrc:s,objectFit:i,objectPosition:a,offset:o,targetHeight:l,targetWidth:u})=>{let c=i;c==="scale-down"&&(u<=n&&l<=t?c="none":c="contain");const d={containerHeight:t,containerLeft:e,containerTop:r,containerWidth:n,hasScalableSrc:s,offset:o,position:a,targetHeight:l,targetWidth:u};
380if(c==="cover"||c==="contain"){const f=n/u,m=t/l,y=c==="cover"?Math.max(f,m):Math.min(f,m);return Pa({...d,visibleWidth:u*y,visibleHeight:l*y})}else{if(c==="none")return Pa({...d,visibleWidth:u,visibleHeight:l});{const f=n/u,m=t/l,y=Math.max(f,m),g=Jf({containerHeight:l*y,containerWidth:u*y,hasScalableSrc:s,offset:o,targetHeight:l,targetWidth:u});return{top:r,left:e,width:n*g,height:t*g,initialTransform:`translate(0,0) scale(${1/g})`}}}},aA=({backgroundPosition:t,backgroundSize:e,containerHeight:r,containerLeft:n,containerTop:s,containerWidth:i,hasScalableSrc:a,offset:o,targetHeight:l,targetWidth:u})=>{const c={containerHeight:r,containerLeft:n,containerTop:s,containerWidth:i,hasScalableSrc:a,offset:o,position:t,targetHeight:l,targetWidth:u};if(e==="cover"||e==="contain"){const d=i/u,f=r/l,m=e==="cover"?Math.max(d,f):Math.min(d,f);return Pa({...c,visibleWidth:u*m,visibleHeight:l*m})}else{if(e==="auto")return Pa({...c,visibleWidth:u,visibleHeight:l});{const[d="50%",f="50%"]=e.split(" "),m=uu(d,i),y=uu(f,r),g=m/u,b=y/l,_=Math.min(g,b);return Pa({...c,visibleWidth:u*_,visibleHeight:l*_})}}},oA=({height:t,initialTransform:e,isZoomed:r,left:n,top:s,userTransform:i,width:a})=>{let o="";if(i!=="none"&&i!==""){const g=a/2,b=t/2;o=`translate(${g}px,${b}px) ${i} translate(${-g}px,${-b}px)`}if(!r)return o===""?e:`${e} ${o}`;const l=window.innerWidth/2,u=window.innerHeight/2,c=n+a/2,d=s+t/2,f=l-c,m=u-d,y=`translate(${f}px,${m}px) scale(1)`;return o===""?y:`${y} ${o}`},Ug=({fallback:t,natural:e})=>e!==void 0&&e!==0?e:t,lA=/\.svg$/i,uA=({hasZoomImg:t,imgSrc:e,isSvg:r})=>r||(e==null?void 0:e.slice(0,18))==="data:image/svg+xml"||t||e!==void 0&&lA.test(e),cA=({hasZoomImg:t,imgSrc:e,isSvg:r,isZoomed:n,loadedImgEl:s,offset:i,shouldRefresh:a,targetEl:o})=>{const l=uA({hasZoomImg:t,imgSrc:e,isSvg:r}),u=o.getBoundingClientRect(),c=window.getComputedStyle(o),d=s!=null&&Kf(o),f=s!=null&&!d,m=Ug({fallback:u.height,natural:s==null?void 0:s.naturalHeight}),y=Ug({fallback:u.width,natural:s==null?void 0:s.naturalWidth}),{height:g,left:b,top:_,width:v}=u,w=d?aA({backgroundPosition:c.backgroundPosition,backgroundSize:c.backgroundSize,containerHeight:g,containerLeft:b,containerTop:_,containerWidth:v,hasScalableSrc:l,offset:i,targetHeight:m,targetWidth:y}):f?iA({containerHeight:g,containerLeft:b,containerTop:_,containerWidth:v,hasScalableSrc:l,objectFit:c.objectFit,objectPosition:c.objectPosition,offset:i,targetHeight:m,targetWidth:y}):sA({containerHeight:g,containerLeft:b,containerTop:_,containerWidth:v,hasScalableSrc:l,offset:i,targetHeight:m,targetWidth:y}),h={top:w.top,left:w.left,width:w.width,height:w.height,transform:oA({...w,isZoomed:n,userTransform:c.transform})};return n&&a&&(h.transitionDuration="0.01ms"),h},dA=["img","svg",'[role="img"]',"[data-zoom]"].map(t=>`${t}:not([aria-hidden="true"])`).join(","),Bg={overflow:"",width:""};function hA(){const t=document.querySelector("[data-rmiz-portal]");if(t!=null)return t;const e=document.createElement("div");return e.setAttribute("data-rmiz-portal",""),document.body.appendChild(e),e}function fA(t){t.preventDefault()}function pA(t){return $.createElement(l_,{...t})}class l_ extends $.Component{constructor(){super(...arguments),this.state={id:"",isZoomImgLoaded:!1,loadedImgEl:void 0,modalState:"UNLOADED",shouldRefresh:!1,styleGhost:{}},this.refContent=$.createRef(),this.refDialog=$.createRef(),this.refModalContent=$.createRef(),this.refModalImg=$.createRef(),this.refWrap=$.createRef(),this.imgEl=null,this.isScaling=!1,this.prevBodyAttrs=Bg,this.styleModalImg={},this.handleModalStateChange=e=>{var n;const{state:{modalState:r}}=this;e!=="LOADING"&&r==="LOADING"?(this.isScaling=!1,this.loadZoomImg(),window.addEventListener("resize",this.handleResize,{passive:!0}),window.addEventListener("touchstart",this.handleTouchStart,{passive:!0}),window.addEventListener("touchmove",this.handleTouchMove,{passive:!0}),window.addEventListener("touchend",this.handleTouchEnd,{passive:!0}),window.addEventListener("touchcancel",this.handleTouchCancel,{passive:!0}),document.addEventListener("keydown",this.handleKeyDown,!0)):e!=="LOADED"&&r==="LOADED"?window.addEventListener("wheel",this.handleWheel,{passive:!0}):e!=="UNLOADING"&&r==="UNLOADING"?(this.ensureImgTransitionEnd(),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),document.removeEventListener("keydown",this.handleKeyDown,!0)):e!=="UNLOADED"&&r==="UNLOADED"&&(this.bodyScrollEnable(),window.removeEventListener("resize",this.handleResize),(n=this.refDialog.current)==null||n.close())},this.setId=()=>{const e=()=>Math.random().toString(16).slice(-4);this.setState({id:e()+e()+e()})},this.setAndTrackImg=()=>{var r;const{refContent:{current:e}}=this;
380e!=null&&(this.imgEl=e.querySelector(dA),this.imgEl!==null?((r=this.contentNotFoundChangeObserver)==null||r.disconnect(),this.imgEl.addEventListener("load",this.handleImgLoad),this.imgEl.addEventListener("click",this.handleZoom),this.state.loadedImgEl==null&&this.handleImgLoad(),this.imgElResizeObserver=new ResizeObserver(n=>{const[s]=n;(s==null?void 0:s.target)!==void 0&&(this.imgEl=s.target,this.setState({styleGhost:Vc(this.imgEl)}))}),this.imgElResizeObserver.observe(this.imgEl),this.contentChangeObserver==null&&(this.contentChangeObserver=new MutationObserver(()=>{this.setState({styleGhost:Vc(this.imgEl)})}),this.contentChangeObserver.observe(e,{attributes:!0,childList:!0,subtree:!0}))):this.contentNotFoundChangeObserver==null&&(this.contentNotFoundChangeObserver=new MutationObserver(this.setAndTrackImg),this.contentNotFoundChangeObserver.observe(e,{childList:!0,subtree:!0})))},this.handleIfZoomChanged=e=>{const{props:{isZoomed:r}}=this;!e&&r?this.zoom():e&&!r&&this.unzoom()},this.handleImgLoad=()=>{const e=zg(this.imgEl);if(e==null||e==="")return;const r=new Image,{imgEl:n}=this;if(lu(n)){const{sizes:i,srcset:a,crossOrigin:o}=n;r.sizes=i,r.srcset=a,r.crossOrigin=o}r.src=e;const s=()=>{this.setState({loadedImgEl:r,styleGhost:Vc(this.imgEl)})};r.decode().then(s).catch(()=>{if($g(r)){s();return}r.onload=s})},this.handleZoom=e=>{var r,n;this.props.isDisabled!==!0&&this.hasImage()&&((n=(r=this.props).onZoomChange)==null||n.call(r,!0,{event:e}))},this.handleUnzoom=e=>{var r,n;this.props.isDisabled!==!0&&((n=(r=this.props).onZoomChange)==null||n.call(r,!1,{event:e}))},this.handleBtnUnzoomClick=e=>{e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e)},this.handleDialogClick=e=>{(e.target===this.refModalContent.current||e.target===this.refModalImg.current)&&(e.stopPropagation(),this.handleUnzoom(e))},this.handleDialogClose=e=>{e.stopPropagation(),this.handleUnzoom(e)},this.handleKeyDown=e=>{e.key==="Escape"&&(e.preventDefault(),e.stopPropagation(),this.handleUnzoom(e))},this.handleWheel=e=>{var n;e.ctrlKey||this.isScaling||(((n=window.visualViewport)==null?void 0:n.scale)??1)>1||(e.stopPropagation(),queueMicrotask(()=>{this.handleUnzoom(e)}))},this.handleTouchStart=e=>{if(e.touches.length>1){this.isScaling=!0;return}const{changedTouches:r}=e,[n]=r;if(r.length===1&&n!==void 0){const{screenY:s}=n;this.touchYStart=s}},this.handleTouchMove=e=>{var i;const r=((i=window.visualViewport)==null?void 0:i.scale)??1,{changedTouches:n}=e,[s]=n;if(this.props.canSwipeToUnzoom&&!this.isScaling&&r<=1&&this.touchYStart!=null&&s!==void 0){const{screenY:a}=s;this.touchYEnd=a;const o=Math.max(this.touchYStart,this.touchYEnd),l=Math.min(this.touchYStart,this.touchYEnd);Math.abs(o-l)>this.props.swipeToUnzoomThreshold&&(this.touchYStart=void 0,this.touchYEnd=void 0,this.handleUnzoom(e))}},this.handleTouchEnd=()=>{this.touchYStart=void 0,this.touchYEnd=void 0},this.handleTouchCancel=()=>{this.touchYStart=void 0,this.touchYEnd=void 0},this.handleResize=()=>{this.setState({shouldRefresh:!0})},this.hasImage=()=>this.imgEl!==null&&(this.state.loadedImgEl!==void 0||vl(this.imgEl))&&window.getComputedStyle(this.imgEl).display!=="none",this.zoom=()=>{var e;this.bodyScrollDisable(),(e=this.refDialog.current)==null||e.showModal(),this.setState({modalState:"LOADING"})},this.unzoom=()=>{this.setState({modalState:"UNLOADING"})},this.handleImgTransitionEnd=()=>{clearTimeout(this.timeoutTransitionEnd),this.state.modalState==="LOADING"?this.setState({modalState:"LOADED"}):this.state.modalState==="UNLOADING"&&this.setState({shouldRefresh:!1,modalState:"UNLOADED"})},this.ensureImgTransitionEnd=()=>
380{if(this.refModalImg.current!==null){const{transitionDuration:e}=window.getComputedStyle(this.refModalImg.current),r=parseFloat(e);if(r!==0&&!Number.isNaN(r)){const n=r*(e.endsWith("ms")?1:1e3)+50;this.timeoutTransitionEnd=setTimeout(this.handleImgTransitionEnd,n)}}},this.bodyScrollDisable=()=>{const e=document.body.style;this.prevBodyAttrs={overflow:e.overflow,width:e.width};const r=document.body.clientWidth;e.overflow="hidden",e.width=`${r}px`},this.bodyScrollEnable=()=>{const e=document.body.style,r=this.prevBodyAttrs;e.width=r.width,e.overflow=r.overflow,this.prevBodyAttrs=Bg},this.loadZoomImg=()=>{const{props:{zoomImg:e}}=this;if(e==null)return;const{src:r}=e;if(r!==void 0&&r!==""){const n=new Image;n.sizes=e.sizes??"",n.srcset=e.srcSet??"",n.crossOrigin=e.crossOrigin??void 0,n.src=r;const s=()=>{this.setState({isZoomImgLoaded:!0})};n.decode().then(s).catch(()=>{if($g(n)){s();return}n.onload=s})}},this.UNSAFE_handleSvg=()=>{var s,i,a;const{imgEl:e,refModalImg:r,styleModalImg:n}=this;if(vl(e)){const o=e.cloneNode(!0);QP(o),o.style.width=`${n.width??0}px`,o.style.height=`${n.height??0}px`,o.addEventListener("click",this.handleUnzoom),(i=(s=r.current)==null?void 0:s.firstChild)==null||i.remove(),(
380a=r.current)==null||a.appendChild(o)}}}render(){const{handleBtnUnzoomClick:e,handleDialogClick:r,handleDialogClose:n,handleUnzoom:s,handleZoom:i,imgEl:a,props:{a11yNameButtonUnzoom:o,a11yNameButtonZoom:l,children:u,classDialog:c,IconUnzoom:d,IconZoom:f,wrapElement:m,ZoomContent:y,zoomImg:g,zoomMargin:b},refContent:_,refDialog:v,refModalContent:w,refModalImg:h,refWrap:p,state:{id:x,isZoomImgLoaded:k,loadedImgEl:T,modalState:E,shouldRefresh:R,styleGhost:j}}=this,L=`rmiz-modal-${x}`,O=`rmiz-modal-img-${x}`,N=Kf(a),M=lu(a),X=vl(a),q=tA(a),D=zg(a),K=M?a.sizes:void 0,U=M?a.srcset:void 0,W=M?a.crossOrigin:void 0,re=(g==null?void 0:g.src)!==void 0&&g.src!=="",oe=this.hasImage(),ce=q!==void 0&&q!==""?`${l}: ${q}`:l,xe=E==="LOADING"||E==="LOADED",nt=oe?"found":"not-found",ae=E==="UNLOADED"||E==="UNLOADING"?"hidden":"visible",we={visibility:E==="UNLOADED"?"visible":"hidden"};this.styleModalImg=oe&&a!==null?cA({hasZoomImg:re,imgSrc:D,isSvg:X,isZoomed:xe,loadedImgEl:T,offset:b,shouldRefresh:R,targetEl:a}):{};let et=null;if(oe){const gr=M||N?$.createElement("img",{alt:q,crossOrigin:W,sizes:K,src:D,srcSet:U,...k&&E==="LOADED"?g:{},"data-rmiz-modal-img":"",height:this.styleModalImg.height??void 0,id:O,onTransitionEnd:this.handleImgTransitionEnd,ref:h,style:this.styleModalImg,width:this.styleModalImg.width??void 0}):X?$.createElement("div",{"data-rmiz-modal-img":!0,onTransitionEnd:this.handleImgTransitionEnd,ref:h,style:this.styleModalImg}):null,Wi=$.createElement("button",{"aria-label":o,"data-rmiz-btn-unzoom":"",onClick:e,type:"button"},$.createElement(d,null));et=y==null?$.createElement($.Fragment,null,gr,Wi):$.createElement(y,{buttonUnzoom:Wi,modalState:E,img:gr,isZoomImgLoaded:k,onUnzoom:s})}return $.createElement(m,{"data-rmiz":"",ref:p},$.createElement(m,{"data-rmiz-content":nt,ref:_,style:we},u),oe&&$.createElement(m,{"data-rmiz-ghost":"",style:j},$.createElement("button",{"aria-label":ce,"data-rmiz-btn-zoom":"",onClick:i,type:"button"},$.createElement(f,null))),oe&&fS.createPortal($.createElement("dialog",{"aria-labelledby":O,"aria-modal":"true",className:c,"data-rmiz-modal":"",id:L,onClick:r,onClose:n,onCancel:fA,ref:v,role:"dialog"},$.createElement("div",{"data-rmiz-modal-overlay":ae}),$.createElement("div",{"data-rmiz-modal-content":"",ref:w},et)),hA()))}componentDidMount(){this.setId(),this.setAndTrackImg(),this.handleImgLoad(),this.UNSAFE_handleSvg()}componentWillUnmount(){var e,r,n,s,i;this.state.modalState!=="UNLOADED"&&this.bodyScrollEnable(),(e=this.contentChangeObserver)==null||e.disconnect(),(r=this.contentNotFoundChangeObserver)==null||r.disconnect(),(n=this.imgElResizeObserver)==null||n.disconnect(),(s=this.imgEl)==null||s.removeEventListener("load",this.handleImgLoad),(i=this.imgEl)==null||i.removeEventListener("click",this.handleZoom),clearTimeout(this.timeoutTransitionEnd),window.removeEventListener("wheel",this.handleWheel),window.removeEventListener("touchstart",this.handleTouchStart),window.removeEventListener("touchmove",this.handleTouchMove),window.removeEventListener("touchend",this.handleTouchEnd),window.removeEventListener("touchcancel",this.handleTouchCancel),window.removeEventListener("resize",this.handleResize),document.removeEventListener("keydown",this.handleKeyDown,!0)}componentDidUpdate(e,r){this.handleModalStateChange(r.modalState),this.UNSAFE_handleSvg(),this.handleIfZoomChanged(e.isZoomed)}}l_.defaultProps={a11yNameButtonUnzoom:"Minimize image",a11yNameButtonZoom:"Expand image",canSwipeToUnzoom:!0,IconUnzoom:mA,IconZoom:gA,isDisabled:!1,swipeToUnzoomThreshold:10,wrapElement:"div",zoomMargin:0};function mA(){return $.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-unzoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M 14.144531 1.148438 L 9 6.292969 L 9 3 L 8 3 L 8 8 L 13 8 L 13 7 L 9.707031 7 L 14.855469 1.851563 Z M 8 8 L 3 8 L 3 9 L 6.292969 9 L 1.148438 14.144531 L 1.851563 14.855469 L 7 9.707031 L 7 13 L 8 13 Z"}))}function gA(){return $.createElement("svg",{"aria-hidden":"true","data-rmiz-btn-zoom-icon":!0,fill:"currentColor",focusable:"false",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg"},$.createElement("path",{d:"M 9 1 L 9 2 L 12.292969 2 L 2 12.292969 L 2 9 L 1 9 L 1 14 L 6 14 L 6 13 L 2.707031 13 L 13 2.707031 L 13 6 L 14 6 L 14 1 Z"}))}function vA({onZoomChange:t,...e}){const[r,n]=$.useState(!1),s=$.useCallback((i,{event:a})=>{n(i),t==null||t(i,{event:a})},[t]);return $.createElement(pA,{...e,isZoomed:r,onZoomChange:s})}const yA="/cartadigital/assets/tapa1-DHdZhAXP.jpg",u_=P.forwardRef(({number:t,src:e},r)=>S.jsx("div",{className:"revista-pagina",ref:r,children:S.jsx("img",{src:e,alt:t===0?"Portada de la revista":`Página ${t}`,className:"revista-img"})}));u_.displayName="Page";const wA=({promotions:t=[],loading:e=!1})=>{const[r,n]=P.useState(0),[s,i]=P.useState(!1),[a]=P.useState({width:500,height:700}),o=P.useRef(null),l=P.useRef(null),u=yA,c=t.filter(_=>_&&_.imageUrl).map(_=>Uf(_.imageUrl)),d=[u,...c];P.useEffect(()=>{const _=()=>i(window.innerWidth<=900);return _(),window.addEventListener("resize",_),()=>window.removeEventListener("resize",_)},[]);const f=d.length,m=r>0,y=r<f-1,g=()=>{var _,v,w;s?(_=l.current)==null||_.slidePrev():(w=(v=o.current)==null?void 0:v.pageFlip())==null||w.flipPrev()},b=()=>{var _,v,w;s?(_=l.current)==null||_.slideNext():(w=(v=o.current)==null?void 0:v.pageFlip())==null||w.flipNext()};return e?S.jsxs("div",{className:"flex flex-col items-center justify-center py-24 gap-3",children:[S.jsx(ko,{size:36,className:"animate-spin text-primary"}),S.jsx("span",{className:"text-sm font-semibold text-text-secondary",children:"Cargando revista..."})]}):d.length===0?S.jsxs("div",{className:"flex flex-col items-center justify-center py-20 gap-3 text-center px-4",children:[S.jsx("div",{className:"w-16 h-16 rounded-full bg-background-secondary flex items-center justify-center text-text-secondary",children:S.jsx(Bf,{size:28})}),S.jsx("p",{className:"text-base font-bold text-text",children:"No hay imágenes disponibles"}),S.jsx("p",{className:"text-xs text-text-secondary max-w-xs",children:"Cargá promociones desde el panel de administración para verlas en la revista interactiva."})]}):S.jsx("div",{className:"revista-section",children:S.jsx("div",{className:"revista-container max-w-[94vw] xl:max-w-[90vw] mx-auto w-full h-full",children:S.jsxs("div",{className:"revista-content-wrapper",children:[s?S.jsx("div",{className:"revista-swiper-wrapper max-w-sm sm:max-w-md mx-auto",children:S.jsx(i_,{modules:[XP],effect:"flip",spaceBetween:0,slidesPerView:1,initialSlide:0,onSwiper:_=>{l.current=_},onSlideChange:_=>n(_.activeIndex),className:"revista-swiper",children:d.map((_,v)=>S.jsx(a_,{children:S.jsx("div",{className:"revista-pagina",children:S.jsx(vA,{children:S.jsx("img",{src:_,alt:v===0?"Portada de la revista":`Página ${v}`,className:"revista-img"})})})},v))},`swiper-${d.length}`)}):S.jsx("div",{className:"flipbook-wrapper",children:S.jsx(mC,{ref:o,width:580,height:820,size:"stretch",minWidth:360,maxWidth:800,minHeight:500,maxHeight:1e3,drawShadow:!0,showCover:!0,mobileScrollSupport:!0,className:"revista-flipbook",startPage:0,flippingTime:450,usePortrait:!0,maxShadowOpacity:.6,useMouseEvents:!0,disableFlipByClick:!1,onFlip:_=>n(_.data),autoSize:!0,swipeDistance:20,showPageCorners:!1,style:{},startZIndex:0,children:d.map((_,v)=>S.jsx(u_,{number:v,src:_},v))},`flipbook-${d.length}`)}),d.length>1&&S.jsxs(S.Fragment,{children:[S.jsx("button",{type:"button",className:`revista-nav-button left ${m?"":"disabled"}`,onClick:g,disabled:!m,"aria-label":"Página anterior",children:"❮"}),S.jsx("button",{type:"button",className:`revista-nav-button right ${y?"":"disabled"}`,onClick:b,disabled:!y,"aria-label":"Página siguiente",children:"❯"})]})]})})})},_A=()=>{const[t]=aw(),e=t.get("sucursal")||"",r=t.get("view")||"promotions",{promotions:n,loading:s,loadingMore:i,error:a,hasMore:o,fetchInitial:l,fetch
380More:u,retry:c}=oC();P.useEffect(()=>{l()},[l]);const d=pw.find(f=>f.nombre.toLowerCase()===e.toLowerCase());return d?S.jsxs("div",{className:"min-h-screen bg-background py-10",children:[S.jsxs("div",{className:"max-w-xl mx-auto px-4 flex flex-col items-center text-center",children:[S.jsx("h1",{className:"font-display text-2xl sm:text-4xl md:text-5xl font-black text-text tracking-wide sm:tracking-widest uppercase mb-6 sm:mb-10 border-b-2 border-primary pb-2 sm:pb-3 inline-block max-w-full break-words",children:d.nombre}),S.jsxs("div",{className:"w-full mb-8",children:[S.jsx("h2",{className:"text-xs font-extrabold tracking-widest text-text uppercase mb-2",children:"DIRECCIÓN:"}),S.jsx("p",{className:"text-text-secondary text-sm uppercase mb-4",children:d.direccion}),S.jsx("div",{className:"w-full h-64 sm:h-80 rounded-card overflow-hidden border border-slate-800 shadow-lg",children:S.jsx("iframe",{src:d.mapaEmbedUrl,width:"100%",height:"100%",style:{border:0},allowFullScreen:"",loading:"lazy",title:`Mapa de ${d.nombre}`})})]}),S.jsxs("div",{className:"w-full mb-8",children:[S.jsx("h2",{className:"text-xs font-extrabold tracking-widest text-text uppercase mb-2",children:"TELÉFONOS:"}),S.jsxs("p",{className:"text-text-secondary text-sm uppercase tracking-wide",children:[d.telefono," / ",S.jsx("span",{className:"font-bold text-green-500",children:"WHATSAPP"})]})]}),S.jsxs("div",{className:"w-full mb-8",children:[S.jsx("h2",{className:"text-xs font-extrabold tracking-widest text-text uppercase mb-4",children:"HORARIOS:"}),S.jsx("div",{className:"flex flex-col gap-4",children:d.horario.split("|").map(f=>{const m=f.trim(),y=m.match(/(?:\d{2}:\d{2})/);if(y){const g=y.index,b=m.substring(0,g).trim(),_=m.substring(g).trim();return S.jsxs("div",{children:[S.jsx("span",{className:"font-bold text-text text-sm block mb-0.5 tracking-wider",children:b.toUpperCase()}),S.jsx("span",{className:"text-text-secondary text-sm tracking-wide",children:_.toUpperCase()})]},m)}return S.jsx("div",{children:S.jsx("span",{className:"text-text-secondary text-sm tracking-wide uppercase",children:m.toUpperCase()})},m)})})]})]}),S.jsx("div",{className:"w-full bg-black py-4 my-8 border-y border-slate-900",children:S.jsx("a",{href:"https://www.tepido.com.ar/restaurantes?q=migusto",target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center gap-2 text-yellow-400 hover:text-yellow-300 font-extrabold text-lg sm:text-xl tracking-widest transition-transform hover:scale-105",children:S.jsx("span",{children:"👉 HACE TU PEDIDO ONLINE ACÁ 👈"})})}),S.jsx("div",{className:"max-w-xl mx-auto px-4 text-center",children:S.jsx("div",{className:"text-[10px] sm:text-xs text-yellow-500/80 font-semibold tracking-wider uppercase mb-10",children:"⚡ CONSULTA DE CUPONES Y PROMOCIONES EXCLUSIVAS EN NUESTRA APP ⚡"})})]}):S.jsx("div",{className:"min-h-screen bg-background mt-0 pt-0 pb-6 sm:py-6",children:S.jsx("div",{className:"animate-view-fade-in",children:r==="interactive"?S.jsx(wA,{promotions:n,loading:s}):S.jsx(hC,{promotions:n,loading:s,loadingMore:i,error:a,hasMore:o,onRetry:c,onLoadMore:u})},r)})},fh="admin_auth_code",ph="1419",xA=()=>localStorage.getItem(fh)===ph?{uid:"admin-bypass",email:"[email protected]",displayName:"Administrador"}:null,c_=()=>{const[t,e]=P.useState(xA),[r]=P.useState(!1),[n,s]=P.useState(null),i=P.useCallback(async o=>String(o).trim()===ph?(localStorage.setItem(fh,ph),e({uid:"admin-bypass",email:"[email protected]",displayName:"Administrador"}),s(null),!0):(s("Clave incorrecta. Intente nuevamente."),!1),[]),a=P.useCallback(async()=>{localStorage.removeItem(fh),e(null)},[]);return{user:t,loading:r,error:n,login:i,logout:a,clearError:()=>s(null)}};function Jr(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function d_(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}/*!
381 * GSAP 3.15.0
382 * https://gsap.com
383 *
384 * @license Copyright 2008-2026, GreenSock. All rights reserved.
385 * Subject to the terms at https://gsap.com/standard-license
386 * @author: Jack Doyle, [email protected]
387*/var Yt={autoSleep:120,force3D:"auto",nullTargetWarn:1,units:{lineHeight:""}},ao={duration:.5,overwrite:!1,delay:0},Zf,ht,Oe,cr=1e8,Se=1/cr,mh=Math.PI*2,bA=mh/4,SA=0,h_=Math.sqrt,kA=Math.cos,EA=Math.sin,ot=function(e){return typeof e=="string"},Fe=function(e){return typeof e=="function"},on=function(e){return typeof e=="number"},Yf=function(e){return typeof e>"u"},Fr=function(e){return typeof e=="object"},jt=function(e){return e!==!1},Xf=function(){return typeof window<"u"},rl=function(e){return Fe(e)||ot(e)},f_=typeof ArrayBuffer=="function"&&ArrayBuffer.isView||function(){},xt=Array.isArray,TA=/random\([^)]+\)/g,CA=/,\s*/g,Fg=/(?:-?\.?\d|\.)+/gi,p_=/[-+=.]*\d+[.e\-+]*\d*[e\-+]*\d*/g,oi=/[-+=.]*\d+[.e-]*\d*[a-z%]*/g,Wc=/[-+=.]*\d+\.?\d*(?:e-|e\+)?\d*/gi,m_=/[+-]=-?[.\d]+/,PA=/[^,'"\[\]\s]+/gi,AA=/^[+\-=e\s\d]*\d+[.\d]*([a-z]*|%)\s*$/i,Le,Lr,gh,Qf,Qt={},cu={}
vendor: 4,930 bytes, line 387
387,g_,v_=function(e){return(cu=Ai(e,Qt))&&zt},ep=function(e,r){return console.warn("Invalid property",e,"set to",r,"Missing plugin? gsap.registerPlugin()")},oo=function(e,r){return!r&&console.warn(e)},y_=function(e,r){return e&&(Qt[e]=r)&&cu&&(cu[e]=r)||Qt},lo=function(){return 0},RA={suppressEvents:!0,isStart:!0,kill:!1},yl={suppressEvents:!0,kill:!1},OA={suppressEvents:!0},tp={},$n=[],vh={},w_,Ft={},Hc={},Vg=30,wl=[],rp="",np=function(e){var r=e[0],n,s;if(Fr(r)||Fe(r)||(e=[e]),!(n=(r._gsap||{}).harness)){for(s=wl.length;s--&&!wl[s].targetTest(r););n=wl[s]}for(s=e.length;s--;)e[s]&&(e[s]._gsap||(e[s]._gsap=new B_(e[s],n)))||e.splice(s,1);return e},ws=function(e){return e._gsap||np(dr(e))[0]._gsap},__=function(e,r,n){return(n=e[r])&&Fe(n)?e[r]():Yf(n)&&e.getAttribute&&e.getAttribute(r)||n},Mt=function(e,r){return(e=e.split(",")).forEach(r)||e},He=function(e){return Math.round(e*1e5)/1e5||0},Ie=function(e){return Math.round(e*1e7)/1e7||0},yi=function(e,r){var n=r.charAt(0),s=parseFloat(r.substr(2));return e=parseFloat(e),n==="+"?e+s:n==="-"?e-s:n==="*"?e*s:e/s},IA=function(e,r){for(var n=r.length,s=0;e.indexOf(r[s])<0&&++s<n;);return s<n},du=function(){var e=$n.length,r=$n.slice(0),n,s;for(vh={},$n.length=0,n=0;n<e;n++)s=r[n],s&&s._lazy&&(s.render(s._lazy[0],s._lazy[1],!0)._lazy=0)},sp=function(e){return!!(e._initted||e._startAt||e.add)},x_=function(e,r,n,s){$n.length&&!ht&&du(),e.render(r,n,!!(ht&&r<0&&sp(e))),$n.length&&!ht&&du()},b_=function(e){var r=parseFloat(e);return(r||r===0)&&(e+"").match(PA).length<2?r:ot(e)?e.trim():e},S_=function(e){return e},er=function(e,r){for(var n in r)n in e||(e[n]=r[n]);return e},NA=function(e){return function(r,n){for(var s in n)s in r||s==="duration"&&e||s==="ease"||(r[s]=n[s])}},Ai=function(e,r){for(var n in r)e[n]=r[n];return e},Wg=function t(e,r){for(var n in r)n!=="__proto__"&&n!=="constructor"&&n!=="prototype"&&(e[n]=Fr(r[n])?t(e[n]||(e[n]={}),r[n]):r[n]);return e},hu=function(e,r){var n={},s;for(s in e)s in r||(n[s]=e[s]);return n},Aa=function(e){var r=e.parent||Le,n=e.keyframes?NA(xt(e.keyframes)):er;if(jt(e.inherit))for(;r;)n(e,r.vars.defaults),r=r.parent||r._dp;return e},LA=function(e,r){for(var n=e.length,s=n===r.length;s&&n--&&e[n]===r[n];);return n<0},k_=function(e,r,n,s,i){var a=e[s],o;if(i)for(o=r[i];a&&a[i]>o;)a=a._prev;return a?(r._next=a._next,a._next=r):(r._next=e[n],e[n]=r),r._next?r._next._prev=r:e[s]=r,r._prev=a,r.parent=r._dp=e,r},Gu=function(e,r,n,s){n===void 0&&(n="_first"),s===void 0&&(s="_last");var i=r._prev,a=r._next;i?i._next=a:e[n]===r&&(e[n]=a),a?a._prev=i:e[s]===r&&(e[s]=i),r._next=r._prev=r.parent=null},Wn=function(e,r){e.parent&&(!r||e.parent.autoRemoveChildren)&&e.parent.remove&&e.parent.remove(e),e._act=0},_s=function(e,r){if(e&&(!r||r._end>e._dur||r._start<0))for(var n=e;n;)n._dirty=1,n=n.parent;return e},jA=function(e){for(var r=e.parent;r&&r.parent;)r._dirty=1,r.totalDuration(),r=r.parent;return e},yh=function(e,r,n,s){return e._startAt&&(ht?e._startAt.revert(yl):e.vars.immediateRender&&!e.vars.autoRevert||e._startAt.render(r,!0,s))},MA=function t(e){return!e||e._ts&&t(e.parent)},Hg=function(e){return e._repeat?Ri(e._tTime,e=e.duration()+e._rDelay)*e:0},Ri=function(e,r){var n=Math.floor(e=Ie(e/r));return e&&n===e?n-1:n},fu=function(e,r){return(e-r._start)*r._ts+(r._ts>=0?0:r._dirty?r.totalDuration():r._tDur)},qu=function(e){return e._end=Ie(e._start+(e._tDur/Math.abs(e._ts||e._rts||Se)||0))},Ku=function(e,r){var n=e._dp;return n&&n.smoothChildTiming&&e._ts&&(e._start=Ie(n._time-(e._ts>0?r/e._ts:((e._dirty?e.totalDuration():e._tDur)-r)/-e._ts)),qu(e),n._dirty||_s(n,e)),e},E_=function(e,r){var n;if((r._time||!r._dur&&r._initted||r._start<e._time&&(r._dur||!r.add))&&(n=fu(e.rawTime(),r),(!r._dur||Co(0,r.totalDuration(),n)-r._tTime>Se)&&r.render(n,!0)),_s(e,r)._dp&&e._initted&&e._time>=e._dur&&e._ts){if(e._dur<e.duration())for(n=e;n._dp;)n.rawTime()>=0&&n.totalTime(n._tTime),n=n._dp;e._zTime=-Se}},Dr=function(e,r,n,s){return r.parent&&Wn(r),r._start=Ie((on(n)?n:n||e!==Le?ar(e,n,r):e._time)+r._delay),r._end=Ie(r._start+(r.totalDuration()/Math.abs(r.timeScale())||0)),k_(e,r,"_first","_last",e._sort?"_start":0),wh(r)||(e._recent=r),s||E_(e,r),e._ts<0&&Ku(e,e._tTime),e},T_=function(e,r){return(Qt.ScrollTrigger||ep("scrollTrigger",r))&&Qt.ScrollTrigger.create(r,e)},C_=function(e,r,n,s,i){if(ap(e,r,i),!e._initted)return 1;if(!n&&e._pt&&!ht&&(e._dur&&e.vars.lazy!==!1||!e._dur&&e.vars.lazy)&&w_!==Gt.frame)return $n.push(e),e._lazy=[i,s],1},DA=function t(e){var r=e.parent;return r&&r._ts&&r._initted&&!r._lock&&(r.rawTime()<0||t(r))},wh=function(e){var r=e.data;return r==="isFromStart"||r==="isStart"},$A=function(e,r,n,s){var i=e.ratio,a=r<0||!r&&(!e._start&&DA(e)&&!(!e._initted&&wh(e))||(e._ts<0||e._dp._ts<0)&&!wh(e))?0:1,o=e._rDelay,l=0,u,c,d;if(o&&e._repeat&&(l=Co(0,e._tDur,r),c=Ri(l,o),e._yoyo&&c&1&&(a=1-a),c!==Ri(e._tTime,o)&&(i=1-a,e.vars.repeatRefresh&&e._initted&&e.invali
vendor: 8,074 bytes, line 387
387date())),a!==i||ht||s||e._zTime===Se||!r&&e._zTime){if(!e._initted&&C_(e,r,s,n,l))return;for(d=e._zTime,e._zTime=r||(n?Se:0),n||(n=r&&!d),e.ratio=a,e._from&&(a=1-a),e._time=0,e._tTime=l,u=e._pt;u;)u.r(a,u.d),u=u._next;r<0&&yh(e,r,n,!0),e._onUpdate&&!n&&Kt(e,"onUpdate"),l&&e._repeat&&!n&&e.parent&&Kt(e,"onRepeat"),(r>=e._tDur||r<0)&&e.ratio===a&&(a&&Wn(e,1),!n&&!ht&&(Kt(e,a?"onComplete":"onReverseComplete",!0),e._prom&&e._prom()))}else e._zTime||(e._zTime=r)},zA=function(e,r,n){var s;if(n>r)for(s=e._first;s&&s._start<=n;){if(s.data==="isPause"&&s._start>r)return s;s=s._next}else for(s=e._last;s&&s._start>=n;){if(s.data==="isPause"&&s._start<r)return s;s=s._prev}},Oi=function(e,r,n,s){var i=e._repeat,a=Ie(r)||0,o=e._tTime/e._tDur;return o&&!s&&(e._time*=a/e._dur),e._dur=a,e._tDur=i?i<0?1e10:Ie(a*(i+1)+e._rDelay*i):a,o>0&&!s&&Ku(e,e._tTime=e._tDur*o),e.parent&&qu(e),n||_s(e.parent,e),e},Gg=function(e){return e instanceof Rt?_s(e):Oi(e,e._dur)},UA={_start:0,endTime:lo,totalDuration:lo},ar=function t(e,r,n){var s=e.labels,i=e._recent||UA,a=e.duration()>=cr?i.endTime(!1):e._dur,o,l,u;return ot(r)&&(isNaN(r)||r in s)?(l=r.charAt(0),u=r.substr(-1)==="%",o=r.indexOf("="),l==="<"||l===">"?(o>=0&&(r=r.replace(/=/,"")),(l==="<"?i._start:i.endTime(i._repeat>=0))+(parseFloat(r.substr(1))||0)*(u?(o<0?i:n).totalDuration()/100:1)):o<0?(r in s||(s[r]=a),s[r]):(l=parseFloat(r.charAt(o-1)+r.substr(o+1)),u&&n&&(l=l/100*(xt(n)?n[0]:n).totalDuration()),o>1?t(e,r.substr(0,o-1),n)+l:a+l)):r==null?a:+r},Ra=function(e,r,n){var s=on(r[1]),i=(s?2:1)+(e<2?0:1),a=r[i],o,l;if(s&&(a.duration=r[1]),a.parent=n,e){for(o=a,l=n;l&&!("immediateRender"in o);)o=l.vars.defaults||{},l=jt(l.vars.inherit)&&l.parent;a.immediateRender=jt(o.immediateRender),e<2?a.runBackwards=1:a.startAt=r[i-1]}return new Xe(r[0],a,r[i+1])},es=function(e,r){return e||e===0?r(e):r},Co=function(e,r,n){return n<e?e:n>r?r:n},wt=function(e,r){return!ot(e)||!(r=AA.exec(e))?"":r[1]},BA=function(e,r,n){return es(n,function(s){return Co(e,r,s)})},_h=[].slice,P_=function(e,r){return e&&Fr(e)&&"length"in e&&(!r&&!e.length||e.length-1 in e&&Fr(e[0]))&&!e.nodeType&&e!==Lr},FA=function(e,r,n){return n===void 0&&(n=[]),e.forEach(function(s){var i;return ot(s)&&!r||P_(s,1)?(i=n).push.apply(i,dr(s)):n.push(s)})||n},dr=function(e,r,n){return Oe&&!r&&Oe.selector?Oe.selector(e):ot(e)&&!n&&(gh||!Ii())?_h.call((r||Qf).querySelectorAll(e),0):xt(e)?FA(e,n):P_(e)?_h.call(e,0):e?[e]:[]},xh=function(e){return e=dr(e)[0]||oo("Invalid scope")||{},function(r){var n=e.current||e.nativeElement||e;return dr(r,n.querySelectorAll?n:n===e?oo("Invalid scope")||Qf.createElement("div"):e)}},A_=function(e){return e.sort(function(){return .5-Math.random()})},R_=function(e){if(Fe(e))return e;var r=Fr(e)?e:{each:e},n=xs(r.ease),s=r.from||0,i=parseFloat(r.base)||0,a={},o=s>0&&s<1,l=isNaN(s)||o,u=r.axis,c=s,d=s;return ot(s)?c=d={center:.5,edges:.5,end:1}[s]||0:!o&&l&&(c=s[0],d=s[1]),function(f,m,y){var g=(y||r).length,b=a[g],_,v,w,h,p,x,k,T,E;if(!b){if(E=r.grid==="auto"?0:(r.grid||[1,cr])[1],!E){for(k=-cr;k<(k=y[E++].getBoundingClientRect().left)&&E<g;);E<g&&E--}for(b=a[g]=[],_=l?Math.min(E,g)*c-.5:s%E,v=E===cr?0:l?g*d/E-.5:s/E|0,k=0,T=cr,x=0;x<g;x++)w=x%E-_,h=v-(x/E|0),b[x]=p=u?Math.abs(u==="y"?h:w):h_(w*w+h*h),p>k&&(k=p),p<T&&(T=p);s==="random"&&A_(b),b.max=k-T,b.min=T,b.v=g=(parseFloat(r.amount)||parseFloat(r.each)*(E>g?g-1:u?u==="y"?g/E:E:Math.max(E,g/E))||0)*(s==="edges"?-1:1),b.b=g<0?i-g:i,b.u=wt(r.amount||r.each)||0,n=n&&g<0?tR(n):n}return g=(b[f]-b.min)/b.max||0,Ie(b.b+(n?n(g):g)*b.v)+b.u}},bh=function(e){var r=Math.pow(10,((e+"").split(".")[1]||"").length);return function(n){var s=Ie(Math.round(parseFloat(n)/e)*e*r);return(s-s%1)/r+(on(n)?0:wt(n))}},O_=function(e,r){var n=xt(e),s,i;return!n&&Fr(e)&&(s=n=e.radius||cr,e.values?(e=dr(e.values),(i=!on(e[0]))&&(s*=s)):e=bh(e.increment)),es(r,n?Fe(e)?function(a){return i=e(a),Math.abs(i-a)<=s?i:a}:function(a){for(var o=parseFloat(i?a.x:a),l=parseFloat(i?a.y:0),u=cr,c=0,d=e.length,f,m;d--;)i?(f=e[d].x-o,m=e[d].y-l,f=f*f+m*m):f=Math.abs(e[d]-o),f<u&&(u=f,c=d);return c=!s||u<=s?e[c]:a,i||c===a||on(a)?c:c+wt(a)}:bh(e))},I_=function(e,r,n,s){return es(xt(e)?!r:n===!0?!!(n=0):!s,function(){return xt(e)?e[~~(Math.random()*e.length)]:(n=n||1e-5)&&(s=n<1?Math.pow(10,(n+"").length-2):1)&&Math.floor(Math.round((e-n/2+Math.random()*(r-e+n*.99))/n)*n*s)/s})},VA=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return function(s){return r.reduce(function(i,a){return a(i)},s)}},WA=function(e,r){return function(n){return e(parseFloat(n))+(r||wt(n))}},HA=function(e,r,n){return L_(e,r,0,1,n)},N_=function(e,r,n){return es(n,function(s){return e[~~r(s)]})},GA=function t(e,r,n){var s=r-e;return xt(e)?N_(e,t(0,e.length),r):es(n,function(i){return(s+(i-e)%s)%s+e})},qA=function t(e,r,n){var s=r-e,i=s*2;return xt(e)?N_(e,t(0,e.length-1),r):es(n,function(a){return a=(i+(a-e)%i)%i||0,e+(a>s?i-a:a)})},uo=function(e){return e.replace(TA,function(r){var n=r.indexOf("[")+1,s=r.substring(n||7,n?r.indexOf("]"):r.length-1).split(CA);return I_(n?s:+s[0],n?0:+s[1],+s[2]||1e-5)})},L_=function(e,r,n,s,i){var a=r-e,o=s-n;return es(i,function(l){return n+((l-e)/a*o||0)})},KA=function t(e,r,n,s){var i=isNaN(e+r)?0:function(m){return(1-m)*e+m*r};if(!i){var a=ot(e),o={},l,u,c,d,f;if(n===!0&&(s=1)&&(n=null),a)e={p:e},r={p:r};else if(xt(e)&&!xt(r)){for(c=[],d=e.length,f=d-2,u=1;u<d;u++)c.push(t(e[u-1],e[u]));d--,i=function(y){y*=d;var g=Math.min(f,~~y);return c[g](y-g)},n=r}else s||(e=Ai(xt(e)?[]:{},e));if(!c){for(l in r)ip.call(o,e,l,"get",r[l]);i=function(y){return up(y,o)||(a?e.p:e)}}}return es(n,i)},qg=function(e,r,n){var s=e.labels,i=cr,a,o,l;for(a in s)o=s[a]-r,o<0==!!n&&o&&i>(o=Math.abs(o))&&(l=a,i=o);return l},Kt=function(e,r,n){var s=e.vars,i=s[r],a=Oe,o=e._ctx,l,u,c;if(i)return l=s[r+"Params"],u=s.callbackScope||e,n&&$n.length&&du(),o&&(Oe=o),c=l?i.apply(u,l):i.call(u),Oe=a,c},da=function(e){return Wn(e),e.scrollTrigger&&e.scrollTrigger.kill(!!ht),e.progress()<1&&Kt(e,"onInterrupt"),e},li,j_=[],M_=function(e){if(e)if(e=!e.name&&e.default||e,Xf()||e.headless){var r=e.name,n=Fe(e),s=r&&!n&&e.init?function(){this._props=[]}:e,i={init:lo,render:up,add:ip,kill:dR,modifier:cR,rawVars:0},a={targetTest:0,get:0,getSetter:lp,aliases:{},register:0};if(Ii(),e!==s){if(Ft[r])return;er(s,er(hu(e,i),a)),Ai(s.prototype,Ai(i,hu(e,a))),Ft[s.prop=r]=s,e.targetTest&&(wl.push(s),tp[r]=1),r=(r==="css"?"CSS":r.charAt(0).toUpperCase()+r.substr(1))+"Plugin"}y_(r,s),e.register&&e.register(zt,s,Dt)}else j_.push(e)},be=255,ha={aqua:[0,be,be],lime:[0,be,0],silver:[192,192,192],black:[0,0,0],maroon:[128,0,0],teal:[0,128,128],blue:[0,0,be],navy:[0,0,128],white:[be,be,be],olive:[128,128,0],yellow:[be,be,0],orange:[be,165,0],gray:[128,128,128],purple:[128,0,128],green:[0,128,0],red:[be,0,0],pink:[be,192,203],cyan:[0,be,be],transparent:[be,be,be,0]},Gc=function(e,r,n){return e+=e<0?1:e>1?-1:0,(e*6<1?r+(n-r)*e*6:e<.5?n:e*3<2?r+(n-r)*(2/3-e)*6:r)*be+.5|0},D_=function(e,r,n){var s=e?on(e)?[e>>16,e>>8&be,e&be]:0:ha.black,i,a,o,l,u,c,d,f,m,y;if(!s){if(e.substr(-1)===","&&(e=e.substr(0,e.length-1)),ha[e])s=ha[e];else if(e.charAt(0)==="#"){if(e.length<6&&(i=e.charAt(1),a=e.charAt(2),o=e.charAt(3),e="#"+i+i+a+a+o+o+(e.length===5?e.charAt(4)+e.charAt(4):"")),e.length===9)return s=parseInt(e.substr(1,6),16),[s>>16,s>>8&be,s&be,parseInt(e.substr(7),16)/255];e=parseInt(e.substr(1),16),s=[e>>16,e>>8&be,e&be]}else if(e.substr(0,3)==="hsl"){if(s=y=e.match(Fg),!r)l=+s[0]%360/360,u=+s[1]/100,c=+s[2]/100,a=c<=.5?c*(u+1):c+u-c*u,i=c*2-a,s.length>3&&(s[3]*=1),s[0]=Gc(l+1/3,i,a),s[1]=Gc(l,i,a),s[2]=Gc(l-1/3,i,a);else if(~e.indexOf("="))return s=e.match(p_),n&&s.length<4&&(s[3]=1),s}else s=e.match(Fg)||ha.transparent;s=s.map(Number)}return r&&!y&&(i=s[0]/be,a=s[1]/be,o=s[2]/be,d=Math.max(i,a,o),f=Math.min(i,a,o),c=(d+f)/2,d===f?l=u=0:(m=d-f,u=c>.5?m/(2-d-f):m/(d+f),l=d===i?(a-o)/m+(a<o?6:0):d===a?(o-i)/m+2:(i-a)/m+4,l*=60),s[0]=~~(l+.5),s[1]=~~(u*100+.5),s[2]=~~(c*100+.5)),n&&s.length<4&&(s[3]=1),s},$_=function(e){var r=[],n=[],s=-1;
vendor: 1,251 bytes, line 387
387return e.split(zn).forEach(function(i){var a=i.match(oi)||[];r.push.apply(r,a),n.push(s+=a.length+1)}),r.c=n,r},Kg=function(e,r,n){var s="",i=(e+s).match(zn),a=r?"hsla(":"rgba(",o=0,l,u,c,d;if(!i)return e;if(i=i.map(function(f){return(f=D_(f,r,1))&&a+(r?f[0]+","+f[1]+"%,"+f[2]+"%,"+f[3]:f.join(","))+")"}),n&&(c=$_(e),l=n.c,l.join(s)!==c.c.join(s)))for(u=e.replace(zn,"1").split(oi),d=u.length-1;o<d;o++)s+=u[o]+(~l.indexOf(o)?i.shift()||a+"0,0,0,0)":(c.length?c:i.length?i:n).shift());if(!u)for(u=e.split(zn),d=u.length-1;o<d;o++)s+=u[o]+i[o];return s+u[d]},zn=function(){var t="(?:\\b(?:(?:rgb|rgba|hsl|hsla)\\(.+?\\))|\\B#(?:[0-9a-f]{3,4}){1,2}\\b",e;for(e in ha)t+="|"+e+"\\b";return new RegExp(t+")","gi")}(),JA=/hsl[a]?\(/,z_=function(e){var r=e.join(" "),n;if(zn.lastIndex=0,zn.test(r))return n=JA.test(r),e[1]=Kg(e[1],n),e[0]=Kg(e[0],n,$_(e[1])),!0},co,Gt=function(){var t=Date.now,e=500,r=33,n=t(),s=n,i=1e3/240,a=i,o=[],l,u,c,d,f,m,y=function g(b){var _=t()-s,v=b===!0,w,h,p,x;if((_>e||_<0)&&(n+=_-r),s+=_,p=s-n,w=p-a,(w>0||v)&&(x=++d.frame,f=p-d.time*1e3,d.time=p=p/1e3,a+=w+(w>=i?4:i-w),h=1),v||(l=u(g)),h)for(m=0;m<o.length;m++)o[m](p,f,x,b)};return d={time:0,frame:0,tick:function(){y(!0)},deltaRatio:function(b){return f/(1e3/(b||60))}
vendor: 4,843 bytes, line 387
387,wake:function(){g_&&(!gh&&Xf()&&(Lr=gh=window,Qf=Lr.document||{},Qt.gsap=zt,(Lr.gsapVersions||(Lr.gsapVersions=[])).push(zt.version),v_(cu||Lr.GreenSockGlobals||!Lr.gsap&&Lr||{}),j_.forEach(M_)),c=typeof requestAnimationFrame<"u"&&requestAnimationFrame,l&&d.sleep(),u=c||function(b){return setTimeout(b,a-d.time*1e3+1|0)},co=1,y(2))},sleep:function(){(c?cancelAnimationFrame:clearTimeout)(l),co=0,u=lo},lagSmoothing:function(b,_){e=b||1/0,r=Math.min(_||33,e)},fps:function(b){i=1e3/(b||240),a=d.time*1e3+i},add:function(b,_,v){var w=_?function(h,p,x,k){b(h,p,x,k),d.remove(w)}:b;return d.remove(b),o[v?"unshift":"push"](w),Ii(),w},remove:function(b,_){~(_=o.indexOf(b))&&o.splice(_,1)&&m>=_&&m--},_listeners:o},d}(),Ii=function(){return!co&&Gt.wake()},pe={},ZA=/^[\d.\-M][\d.\-,\s]/,YA=/["']/g,XA=function(e){for(var r={},n=e.substr(1,e.length-3).split(":"),s=n[0],i=1,a=n.length,o,l,u;i<a;i++)l=n[i],o=i!==a-1?l.lastIndexOf(","):l.length,u=l.substr(0,o),r[s]=isNaN(u)?u.replace(YA,"").trim():+u,s=l.substr(o+1).trim();return r},QA=function(e){var r=e.indexOf("(")+1,n=e.indexOf(")"),s=e.indexOf("(",r);return e.substring(r,~s&&s<n?e.indexOf(")",n+1):n)},eR=function(e){var r=(e+"").split("("),n=pe[r[0]];return n&&r.length>1&&n.config?n.config.apply(null,~e.indexOf("{")?[XA(r[1])]:QA(e).split(",").map(b_)):pe._CE&&ZA.test(e)?pe._CE("",e):n},tR=function(e){return function(r){return 1-e(1-r)}},xs=function(e,r){return e&&(Fe(e)?e:pe[e]||eR(e))||r},js=function(e,r,n,s){n===void 0&&(n=function(l){return 1-r(1-l)}),s===void 0&&(s=function(l){return l<.5?r(l*2)/2:1-r((1-l)*2)/2});var i={easeIn:r,easeOut:n,easeInOut:s},a;return Mt(e,function(o){pe[o]=Qt[o]=i,pe[a=o.toLowerCase()]=n;for(var l in i)pe[a+(l==="easeIn"?".in":l==="easeOut"?".out":".inOut")]=pe[o+"."+l]=i[l]}),i},U_=function(e){return function(r){return r<.5?(1-e(1-r*2))/2:.5+e((r-.5)*2)/2}},qc=function t(e,r,n){var s=r>=1?r:1,i=(n||(e?.3:.45))/(r<1?r:1),a=i/mh*(Math.asin(1/s)||0),o=function(c){return c===1?1:s*Math.pow(2,-10*c)*EA((c-a)*i)+1},l=e==="out"?o:e==="in"?function(u){return 1-o(1-u)}:U_(o);return i=mh/i,l.config=function(u,c){return t(e,u,c)},l},Kc=function t(e,r){r===void 0&&(r=1.70158);var n=function(a){return a?--a*a*((r+1)*a+r)+1:0},s=e==="out"?n:e==="in"?function(i){return 1-n(1-i)}:U_(n);return s.config=function(i){return t(e,i)},s};Mt("Linear,Quad,Cubic,Quart,Quint,Strong",function(t,e){var r=e<5?e+1:e;js(t+",Power"+(r-1),e?function(n){return Math.pow(n,r)}:function(n){return n},function(n){return 1-Math.pow(1-n,r)},function(n){return n<.5?Math.pow(n*2,r)/2:1-Math.pow((1-n)*2,r)/2})});pe.Linear.easeNone=pe.none=pe.Linear.easeIn;js("Elastic",qc("in"),qc("out"),qc());(function(t,e){var r=1/e,n=2*r,s=2.5*r,i=function(o){return o<r?t*o*o:o<n?t*Math.pow(o-1.5/e,2)+.75:o<s?t*(o-=2.25/e)*o+.9375:t*Math.pow(o-2.625/e,2)+.984375};js("Bounce",function(a){return 1-i(1-a)},i)})(7.5625,2.75);js("Expo",function(t){return Math.pow(2,10*(t-1))*t+t*t*t*t*t*t*(1-t)});js("Circ",function(t){return-(h_(1-t*t)-1)});js("Sine",function(t){return t===1?1:-kA(t*bA)+1});js("Back",Kc("in"),Kc("out"),Kc());pe.SteppedEase=pe.steps=Qt.SteppedEase={config:function(e,r){e===void 0&&(e=1);var n=1/e,s=e+(r?0:1),i=r?1:0,a=1-Se;return function(o){return((s*Co(0,a,o)|0)+i)*n}}};ao.ease=pe["quad.out"];Mt("onComplete,onUpdate,onStart,onRepeat,onReverseComplete,onInterrupt",function(t){return rp+=t+","+t+"Params,"});var B_=function(e,r){this.id=SA++,e._gsap=this,this.target=e,this.harness=r,this.get=r?r.get:__,this.set=r?r.getSetter:lp},ho=function(){function t(r){this.vars=r,this._delay=+r.delay||0,(this._repeat=r.repeat===1/0?-2:r.repeat||0)&&(this._rDelay=r.repeatDelay||0,this._yoyo=!!r.yoyo||!!r.yoyoEase),this._ts=1,Oi(this,+r.duration,1,1),this.data=r.data,Oe&&(this._ctx=Oe,Oe.data.push(this)),co||Gt.wake()}var e=t.prototype;return e.delay=function(n){return n||n===0?(this.parent&&this.parent.smoothChildTiming&&this.startTime(this._start+n-this._delay),this._delay=n,this):this._delay},e.duration=function(n){return arguments.length?this.totalDuration(this._repeat>0?n+(n+this._rDelay)*this._repeat:n):this.totalDuration()&&this._dur},e.totalDuration=function(n){return arguments.length?(this._dirty=0,Oi(this,this._repeat<0?n:(n-this._repeat*this._rDelay)/(this._repeat+1))):this._tDur},e.totalTime=function(n,s){if(Ii(),!arguments.length)return this._tTime;var i=this._dp;if(i&&i.smoothChildTiming&&this._ts){for(Ku(this,n),!i._dp||i.parent||E_(i,this);i&&i.parent;)i.parent._time!==i._start+(i._ts>=0?i._tTime/i._ts:(i.totalDuration()-i._tTime)/-i._ts)&&i.totalTime(i._tTime,!0),i=i.parent;!this.parent&&this._dp.autoRemoveChildren&&(this._ts>0&&n<this._tDur||this._ts<0&&n>0||!this._tDur&&!n)&&Dr(this._dp,this,this._start-this._delay)}return(this._tTime!==n||!this._dur&&!s||this._initted&&Math.abs(this._zTime)===Se||!this._initted&&this._dur&&n||
vendor: 21,314 bytes, line 387
387!n&&!this._initted&&(this.add||this._ptLookup))&&(this._ts||(this._pTime=n),x_(this,n,s)),this},e.time=function(n,s){return arguments.length?this.totalTime(Math.min(this.totalDuration(),n+Hg(this))%(this._dur+this._rDelay)||(n?this._dur:0),s):this._time},e.totalProgress=function(n,s){return arguments.length?this.totalTime(this.totalDuration()*n,s):this.totalDuration()?Math.min(1,this._tTime/this._tDur):this.rawTime()>=0&&this._initted?1:0},e.progress=function(n,s){return arguments.length?this.totalTime(this.duration()*(this._yoyo&&!(this.iteration()&1)?1-n:n)+Hg(this),s):this.duration()?Math.min(1,this._time/this._dur):this.rawTime()>0?1:0},e.iteration=function(n,s){var i=this.duration()+this._rDelay;return arguments.length?this.totalTime(this._time+(n-1)*i,s):this._repeat?Ri(this._tTime,i)+1:1},e.timeScale=function(n,s){if(!arguments.length)return this._rts===-Se?0:this._rts;if(this._rts===n)return this;var i=this.parent&&this._ts?fu(this.parent._time,this):this._tTime;return this._rts=+n||0,this._ts=this._ps||n===-Se?0:this._rts,this.totalTime(Co(-Math.abs(this._delay),this.totalDuration(),i),s!==!1),qu(this),jA(this)},e.paused=function(n){return arguments.length?(this._ps!==n&&(this._ps=n,n?(this._pTime=this._tTime||Math.max(-this._delay,this.rawTime()),this._ts=this._act=0):(Ii(),this._ts=this._rts,this.totalTime(this.parent&&!this.parent.smoothChildTiming?this.rawTime():this._tTime||this._pTime,this.progress()===1&&Math.abs(this._zTime)!==Se&&(this._tTime-=Se)))),this):this._ps},e.startTime=function(n){if(arguments.length){this._start=Ie(n);var s=this.parent||this._dp;return s&&(s._sort||!this.parent)&&Dr(s,this,this._start-this._delay),this}return this._start},e.endTime=function(n){return this._start+(jt(n)?this.totalDuration():this.duration())/Math.abs(this._ts||1)},e.rawTime=function(n){var s=this.parent||this._dp;return s?n&&(!this._ts||this._repeat&&this._time&&this.totalProgress()<1)?this._tTime%(this._dur+this._rDelay):this._ts?fu(s.rawTime(n),this):this._tTime:this._tTime},e.revert=function(n){n===void 0&&(n=OA);var s=ht;return ht=n,sp(this)&&(this.timeline&&this.timeline.revert(n),this.totalTime(-.01,n.suppressEvents)),this.data!=="nested"&&n.kill!==!1&&this.kill(),ht=s,this},e.globalTime=function(n){for(var s=this,i=arguments.length?n:s.rawTime();s;)i=s._start+i/(Math.abs(s._ts)||1),s=s._dp;return!this.parent&&this._sat?this._sat.globalTime(n):i},e.repeat=function(n){return arguments.length?(this._repeat=n===1/0?-2:n,Gg(this)):this._repeat===-2?1/0:this._repeat},e.repeatDelay=function(n){if(arguments.length){var s=this._time;return this._rDelay=n,Gg(this),s?this.time(s):this}return this._rDelay},e.yoyo=function(n){return arguments.length?(this._yoyo=n,this):this._yoyo},e.seek=function(n,s){return this.totalTime(ar(this,n),jt(s))},e.restart=function(n,s){return this.play().totalTime(n?-this._delay:0,jt(s)),this._dur||(this._zTime=-Se),this},e.play=function(n,s){return n!=null&&this.seek(n,s),this.reversed(!1).paused(!1)},e.reverse=function(n,s){return n!=null&&this.seek(n||this.totalDuration(),s),this.reversed(!0).paused(!1)},e.pause=function(n,s){return n!=null&&this.seek(n,s),this.paused(!0)},e.resume=function(){return this.paused(!1)},e.reversed=function(n){return arguments.length?(!!n!==this.reversed()&&this.timeScale(-this._rts||(n?-Se:0)),this):this._rts<0},e.invalidate=function(){return this._initted=this._act=0,this._zTime=-Se,this},e.isActive=function(){var n=this.parent||this._dp,s=this._start,i;return!!(!n||this._ts&&this._initted&&n.isActive()&&(i=n.rawTime(!0))>=s&&i<this.endTime(!0)-Se)},e.eventCallback=function(n,s,i){var a=this.vars;return arguments.length>1?(s?(a[n]=s,i&&(a[n+"Params"]=i),n==="onUpdate"&&(this._onUpdate=s)):delete a[n],this):a[n]},e.then=function(n){var s=this,i=s._prom;return new Promise(function(a){var o=Fe(n)?n:S_,l=function(){var c=s.then;s.then=null,i&&i(),Fe(o)&&(o=o(s))&&(o.then||o===s)&&(s.then=c),a(o),s.then=c};s._initted&&s.totalProgress()===1&&s._ts>=0||!s._tTime&&s._ts<0?l():s._prom=l})},e.kill=function(){da(this)},t}();er(ho.prototype,{_time:0,_start:0,_end:0,_tTime:0,_tDur:0,_dirty:0,_repeat:0,_yoyo:!1,parent:null,_initted:!1,_rDelay:0,_ts:1,_dp:0,ratio:0,_zTime:-Se,_prom:0,_ps:!1,_rts:1});var Rt=function(t){d_(e,t);function e(n,s){var i;return n===void 0&&(n={}),i=t.call(this,n)||this,i.labels={},i.smoothChildTiming=!!n.smoothChildTiming,i.autoRemoveChildren=!!n.autoRemoveChildren,i._sort=jt(n.sortChildren),Le&&Dr(n.parent||Le,Jr(i),s),n.reversed&&i.reverse(),n.paused&&i.paused(!0),n.scrollTrigger&&T_(Jr(i),n.scrollTrigger),i}var r=e.prototype;return r.to=function(s,i,a){return Ra(0,arguments,this),this},r.from=function(s,i,a){return Ra(1,arguments,this),this},r.fromTo=function(s,i,a,o){return Ra(2,arguments,this),this},r.set=function(s,i,a){return i.duration=0,i.parent=this,Aa(i).repeatDelay||(i.repeat=0),i.immediateRender=!!i.immediateRender,new Xe(s,i,ar(this,a),1),this},r.call=function(s,i,a){return Dr(this,Xe.delayedCall(0,s,i),a)},r.staggerTo=function(s,i,a,o,l,u,c){return a.duration=i,a.stagger=a.stagger||o,a.onComplete=u,a.onCompleteParams=c,a.parent=this,new Xe(s,a,ar(this,l)),this},r.staggerFrom=function(s,i,a,o,l,u,c){return a.runBackwards=1,Aa(a).immediateRender=jt(a.immediateRender),this.staggerTo(s,i,a,o,l,u,c)},r.staggerFromTo=function(s,i,a,o,l,u,c,d){return o.startAt=a,Aa(o).immediateRender=jt(o.immediateRender),this.staggerTo(s,i,o,l,u,c,d)},r.render=function(s,i,a){var o=this._time,l=this._dirty?this.totalDuration():this._tDur,u=this._dur,c=s<=0?0:Ie(s),d=this._zTime<0!=s<0&&(this._initted||!u),f,m,y,g,b,_,v,w,h,p,x,k;if(this!==Le&&c>l&&s>=0&&(c=l),c!==this._tTime||a||d){if(o!==this._time&&u&&(c+=this._time-o,s+=this._time-o),f=c,h=this._start,w=this._ts,_=!w,d&&(u||(o=this._zTime),(s||!i)&&(this._zTime=s)),this._repeat){if(x=this._yoyo,b=u+this._rDelay,this._repeat<-1&&s<0)return this.totalTime(b*100+s,i,a);if(f=Ie(c%b),c===l?(g=this._repeat,f=u):(p=Ie(c/b),g=~~p,g&&g===p&&(f=u,g--),f>u&&(f=u)),p=Ri(this._tTime,b),!o&&this._tTime&&p!==g&&this._tTime-p*b-this._dur<=0&&(p=g),x&&g&1&&(f=u-f,k=1),g!==p&&!this._lock){var T=x&&p&1,E=T===(x&&g&1);if(g<p&&(T=!T),o=T?0:c%u?u:c,this._lock=1,this.render(o||(k?0:Ie(g*b)),i,!u)._lock=0,this._tTime=c,!i&&this.parent&&Kt(this,"onRepeat"),this.vars.repeatRefresh&&!k&&(this.invalidate()._lock=1,p=g),o&&o!==this._time||_!==!this._ts||this.vars.onRepeat&&!this.parent&&!this._act)return this;if(u=this._dur,l=this._tDur,E&&(this._lock=2,o=T?u:-1e-4,this.render(o,!0),this.vars.repeatRefresh&&!k&&this.invalidate()),this._lock=0,!this._ts&&!_)return this}}if(this._hasPause&&!this._forcing&&this._lock<2&&(v=zA(this,Ie(o),Ie(f)),v&&(c-=f-(f=v._start))),this._tTime=c,this._time=f,this._act=!!w,this._initted||(this._onUpdate=this.vars.onUpdate,this._initted=1,this._zTime=s,o=0),!o&&c&&u&&!i&&!p&&(Kt(this,"onStart"),this._tTime!==c))return this;if(f>=o&&s>=0)for(m=this._first;m;){if(y=m._next,(m._act||f>=m._start)&&m._ts&&v!==m){if(m.parent!==this)return this.render(s,i,a);if(m.render(m._ts>0?(f-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(f-m._start)*m._ts,i,a),f!==this._time||!this._ts&&!_){v=0,y&&(c+=this._zTime=-Se);break}}m=y}else{m=this._last;for(var R=s<0?s:f;m;){if(y=m._prev,(m._act||R<=m._end)&&m._ts&&v!==m){if(m.parent!==this)return this.render(s,i,a);if(m.render(m._ts>0?(R-m._start)*m._ts:(m._dirty?m.totalDuration():m._tDur)+(R-m._start)*m._ts,i,a||ht&&sp(m)),f!==this._time||!this._ts&&!_){v=0,y&&(c+=this._zTime=R?-Se:Se);break}}m=y}}if(v&&!i&&(this.pause(),v.render(f>=o?0:-Se)._zTime=f>=o?1:-1,this._ts))return this._start=h,qu(this),this.render(s,i,a);this._onUpdate&&!i&&Kt(this,"onUpdate",!0),(c===l&&this._tTime>=this.totalDuration()||!c&&o)&&(h===this._start||Math.abs(w)!==Math.abs(this._ts))&&(this._lock||((s||!u)&&(c===l&&this._ts>0||!c&&this._ts<0)&&Wn(this,1),!i&&!(s<0&&!o)&&(c||o||!l)&&(Kt(this,c===l&&s>=0?"onComplete":"onReverseComplete",!0),this._prom&&!(c<l&&this.timeScale()>0)&&this._prom())))}return this},r.add=function(s,i){var a=this;if(on(i)||(i=ar(this,i,s)),!(s instanceof ho)){if(xt(s))return s.forEach(function(o){return a.add(o,i)}),this;if(ot(s))return this.addLabel(s,i);if(Fe(s))s=Xe.delayedCall(0,s);else return this}return this!==s?Dr(this,s,i):this},r.getChildren=function(s,i,a,o){s===void 0&&(s=!0),i===void 0&&(i=!0),a===void 0&&(a=!0),o===void 0&&(o=-cr);for(var l=[],u=this._first;u;)u._start>=o&&(u instanceof Xe?i&&l.push(u):(a&&l.push(u),s&&l.push.apply(l,u.getChildren(!0,i,a)))),u=u._next;return l},r.getById=function(s){for(var i=this.getChildren(1,1,1),a=i.length;a--;)if(i[a].vars.id===s)return i[a]},r.remove=function(s){return ot(s)?this.removeLabel(s):Fe(s)?this.killTweensOf(s):(s.parent===this&&Gu(this,s),s===this._recent&&(this._recent=this._last),_s(this))},r.totalTime=function(s,i){return arguments.length?(this._forcing=1,!this._dp&&this._ts&&(this._start=Ie(Gt.time-(this._ts>0?s/this._ts:(this.totalDuration()-s)/-this._ts))),t.prototype.totalTime.call(this,s,i),this._forcing=0,this):this._tTime},r.addLabel=function(s,i){return this.labels[s]=ar(this,i),this},r.removeLabel=function(s){return delete this.labels[s],this},r.addPause=function(s,i,a){var o=Xe.delayedCall(0,i||lo,a);return o.data="isPause",this._hasPause=1,Dr(this,o,ar(this,s))},r.removePause=function(s){var i=this._first;for(s=ar(this,s);i;)i._start===s&&i.data==="isPause"&&Wn(i),i=i._next},r.killTweensOf=function(s,i,a){for(var o=this.getTweensOf(s,a),l=o.length;l--;)En!==o[l]&&o[l].kill(s,i);return this},r.getTweensOf=function(s,i){for(var a=[],o=dr(s),l=this._first,u=on(i),c;l;)l instanceof Xe?IA(l._targets,o)&&(u?(!En||l._initted&&l._ts)&&l.globalTime(0)<=i&&l.globalTime(l.totalDuration())>i:!i||l.isActive())&&a.push(l):(c=l.getTweensOf(o,i)).length&&a.push.apply(a,c),l=l._next;return a},r.tweenTo=function(s,i){i=i||{};var a=this,o=ar(a,s),l=i,u=l.startAt,c=l.onStart,d=l.onStartParams,f=l.immediateRender,m,y=Xe.to(a,er({ease:i.ease||"none",lazy:!1,immediateRender:!1,time:o,overwrite:"auto",duration:i.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale())||Se,onStart:function(){if(a.pause(),!m){var b=i.duration||Math.abs((o-(u&&"time"in u?u.time:a._time))/a.timeScale());y._dur!==b&&Oi(y,b,0,1).render(y._time,!0,!0),m=1}c&&c.apply(y,d||[])}},i));return f?y.render(0):y},r.tweenFromTo=function(s,i,a){return this.tweenTo(i,er({startAt:{time:ar(this,s)}},a))},r.recent=function(){return this._recent},r.nextLabel=function(s){return s===void 0&&(s=this._time),qg(this,ar(this,s))},r.previousLabel=function(s){return s===void 0&&(s=this._time),qg(this,ar(this,s),1)},r.currentLabel=function(s){return arguments.length?this.seek(s,!0):this.previousLabel(this._time+Se)},r.shiftChildren=function(s,i,a){a===void 0&&(a=0);var o=this._first,l=this.labels,u;for(s=Ie(s);o;)o._start>=a&&(o._start+=s,o._end+=s),o=o._next;if(i)for(u in l)l[u]>=a&&(l[u]+=s);return _s(this)},r.invalidate=function(s){var i=this._first;for(this._lock=0;i;)i.invalidate(s),i=i._next;return t.prototype.invalidate.call(this,s)},r.clear=function(s){s===void 0&&(s=!0);for(var i=this._first,a;i;)a=i._next,this.remove(i),i=a;return this._dp&&(this._time=this._tTime=this._pTime=0),s&&(this.labels={}),_s(this)},r.totalDuration=function(s){var i=0,a=this,o=a._last,l=cr,u,c,d;if(arguments.length)return a.timeScale((a._repeat<0?a.duration():a.totalDuration())/(a.reversed()?-s:s));if(a._dirty){for(d=a.parent;o;)u=o._prev,o._dirty&&o.totalDuration(),c=o._start,c>l&&a._sort&&o._ts&&!a._lock?(a._lock=1,Dr(a,o,c-o._delay,1)._lock=0):l=c,c<0&&o._ts&&(i-=c,(!d&&!a._dp||d&&d.smoothChildTiming)&&(a._start+=Ie(c/a._ts),a._time-=c,a._tTime-=c),a.shiftChildren(-c,!1,-1/0),l=0),o._end>i&&o._ts&&(i=o._end),o=u;Oi(a,a===Le&&a._time>i?a._time:i,1,1),a._dirty=0}return a._tDur},e.updateRoot=function(s){if(Le._ts&&(x_(Le,fu(s,Le)),w_=Gt.frame),Gt.frame>=Vg){Vg+=Yt.autoSleep||120;var i=Le._first;if((!i||!i._ts)&&Yt.autoSleep&&Gt._listeners.length<2){for(;i&&!i._ts;)i=i._next;i||Gt.sleep()}}},e}(ho);er(Rt.prototype,{_lock:0,_hasPause:0,_forcing:0});var rR=function(e,r,n,s,i,a,o){var l=new Dt(this._pt,e,r,0,1,q_,null,i),u=0,c=0,d,f,m,y,g,b,_,v;for(l.b=n,l.e=s,n+="",s+="",(_=~s.indexOf("random("))&&(s=uo(s)),a&&(v=[n,s],a(v,e,r),n=v[0],s=v[1]),f=n.match(Wc)||[];d=Wc.exec(s);)y=d[0],g=s.substring(u,d.index),m?m=(m+1)%5:g.substr(-5)==="rgba("&&(m=1),y!==f[c++]&&(b=parseFloat(f[c-1])||0,l._pt={_next:l._pt,p:g||c===1?g:",",s:b,c:y.charAt(1)==="="?yi(b,y)-b:parseFloat(y)-b,m:m&&m<4?Math.round:0},u=Wc.lastIndex);return l.c=u<s.length?s.substring(u,s.length):"",l.fp=o,(m_.test(s)||_)&&(l.e=0),this._pt=l,l},ip=function(e,r,n,s,i,a,o,l,u,c){Fe(s)&&(s=s(i||0,e,a));var d=e[r],f=n!=="get"?n:Fe(d)?u?e[r.indexOf("set")||!Fe(e["get"+r.substr(3)])?r:"get"+r.substr(3)](u):e[r]():d,m=Fe(d)?u?oR:H_:op,y;if(ot(s)&&(~s.indexOf("random(")&&(s=uo(s)),s.charAt(1)==="="&&(y=yi(f,s)+(wt(f)||0),(y||y===0)&&(s=y))),!c||f!==s||Sh)return!isNaN(f*s)&&s!==""?(y=new Dt(this._pt,e,r,+f||0,s-(f||0),typeof d=="boolean"?uR:G_,0,m),u&&(y.fp=u),o&&y.modifier(o,this,e),this._pt=y):(!d&&!(r in e)&&ep(r,s),rR.call(this,e,r,f,s,m,l||Yt.stringFilter,u))},nR=function(e,r,n,s,i){if(Fe(e)&&(e=Oa(e,i,r,n,s)),!Fr(e)||e.style&&e.nodeType||xt(e)||f_(e))return ot(e)?Oa(e,i,r,n,s):e;var a={},o;for(o in e)a[o]=Oa(e[o],i,r,n,s);return a},F_=function(e,r,n,s,i,a){var o,l,u,c;if(Ft[e]&&(o=new Ft[e]).init(i,o.rawVars?r[e]:nR(r[e],s,i,a,n),n,s,a)!==!1&&(n._pt=l=new Dt(n._pt,i,e,0,1,o.render,o,0,o.priority),n!==li))for(u=n._ptLookup[n._targets.indexOf(i)],c=o._props.length;c--;)u[o._props[c]]=l;return o},En,Sh,ap=function t(e,r,n){var s=e.vars,i=s.ease,a=s.startAt,o=s.immediateRender,l=s.lazy,u=s.onUpdate,c=s.runBackwards,d=s.yoyoEase,f=s.keyframes,m=s.autoRevert,y=e._dur,g=e._startAt,b=e._targets,_=e.parent,v=_&&_.data==="nested"?_.vars.targets:b,w=e._overwrite==="auto"&&!Zf,h=e.timeline,p=s.easeReverse||d,x,k,T,E,R,j,L,O,N,M,X,q,D;if(h&&(!f||!i)&&(i="none"),e._ease=xs(i,ao.ease),e._rEase=p&&(xs(p)||e._ease),e._from=!h&&!!s.runBackwards,e._from&&(e.ratio=1),!h||f&&!s.stagger){if(O=b[0]?ws(b[0]).harness:0,q=O&&s[O.prop],x=hu(s,tp),g&&(g._zTime<0&&g.progress(1),r<0&&c&&o&&!m?g.render(-1,!0):g.revert(c&&y?yl:RA),g._lazy=0),a){if(Wn(e._startAt=Xe.set(b,er({data:"isStart",overwrite:!1,parent:_,immediateRender:!0,lazy:!g&&jt(l),startAt:null,delay:0,onUpdate:u&&function(){return Kt(e,"onUpdate")},stagger:0},a))),e._startAt._dp=0,e._startAt._sat=e,r<0&&(ht||!o&&!m)&&e._startAt.revert(yl),o&&y&&r<=0&&n<=0){r&&(e._zTime=r);return}}else if(c&&y&&!g){if(r&&(o=!1),T=er({overwrite:!1,data:"isFromStart",lazy:o&&!g&&jt(l),immediateRender:o,stagger:0,parent:_},x),q&&(T[O.prop]=q),Wn(e._startAt=Xe.set(b,T)),e._startAt._dp=0,e._startAt._sat=e,r<0&&(ht?e._startAt.revert(yl):e._startAt.render(-1,!0)),e._zTime=r,!o)t(e._startAt,Se,Se);else if(!r)return}for(e._pt=e._ptCache=0,l=y&&jt(l)||l&&!y,k=0;k<b.length;k++){if(R=b[k],L=R._gsap||np(b)[k]._gsap,e._ptLookup[k]=M={},vh[L.id]&&$n.length&&du(),X=v===b?k:v.indexOf(R),O&&(N=new O).init(R,q||x,e,X,v)!==!1&&(e._pt=E=new Dt(e._pt,R,N.name,0,1,N.render,N,0,N.priority),N._props.forEach(function(K){M[K]=E}),N.priority&&(j=1)),!O||q)for(T in x)Ft[T]&&(N=F_(T,x,e,X,R,v))?N.priority&&(j=1):M[T]=E=ip.call(e,R,T,"get",x[T],X,v,0,s.stringFilter);e._op&&e._op[k]&&e.kill(R,e._op[k]),w&&e._pt&&(En=e,Le.killTweensOf(R,M,e.globalTime(r)),D=!e.parent,En=0),e._pt&&l&&(vh[L.id]=1)}j&&K_(e),e._onInit&&e._onInit(e)}e._onUpdate=u,e._initted=(!e._op||e._pt)&&!D,f&&r<=0&&h.render(cr,!0,!0)},sR=function(e,r,n,s,i,a,o,l){var u=(e._pt&&e._ptCache||(e._ptCache={}))[r],c,d,f,m;if(!u)for(u=e._ptCache[r]=[],f=e._ptLookup,m=e._targets.length;m--;){if(c=f[m][r],c&&c.d&&c.d._pt)for(c=c.d._pt;c&&c.p!==r&&c.fp!==r;)c=c._next;if(!c)return Sh=1,e.vars[r]="+=0",ap(e,o),Sh=0,l?oo(r+" not eligible for reset. Try splitting into individual properties"):1;u.push(c)}for(m=u.length;m--;)d=u[m],c=d._pt||d,c.s=(s||s===0)&&!i?s:c.s+(s||0)+a*c.c,c.c=n-c.s,d.e&&(d.e=He(n)+wt(d.e)),d.b&&(d.b=c.s+wt(d.b))},iR=function(e,r){var n=e[0]?ws(e[0]).harness:0,s=n&&n.aliases,i,a,o,l;if(!s)return r;i=Ai({},r);for(a in s)if(a in i)for(l=s[a].split(","),o=l.length;o--;)i[l[o]]=i[a];return i},aR=function(e,r,n,s){var i=r.ease||s||"power1.inOut",a,o;if(xt(r))o=n[e]||(n[e]=[]),r.forEach(function(l,u){return o.push({t:u/(r.length-1)*100,v:l,e:i})});else for(a in r)o=n[a]||(n[a]=[]),a==="ease"||o.push({t:parseFloat(e),v:r[a],e:i})},Oa=function(e,r,n,s,i){return Fe(e)?e.call(r,n,s,i):ot(e)&&~e.indexOf("random(")?uo(e):e},V_=rp+"repeat,repeatDelay,yoyo,repeatRefresh,yoyoEase,easeReverse,autoRevert",W_={};Mt(V_+",id,stagger,delay,duration,paused,scrollTrigger",function(t){return W_[t]=1});var Xe=function(t){d_(e,t);function e(n,s,i,a){var o;typeof s=="number"&&(i.duration=s,s=i,i=null),o=t.call(this,a?s:Aa(s))||this;var l=o.vars,u=l.duration,c=l.delay,d=l.immediateRender,f=l.stagger,m=l.overwrite,y=l.keyframes,g=l.defaults,b=l.scrollTrigger,_=s.parent||Le,v=(xt(n)||f_(n)?on(n[0]):"length"in s)?[n]:dr(n),w,h,p,x,k,T,E,R;if(o._targets=v.length?np(v):oo("GSAP target "+n+" not found. https://gsap.com",!Yt.nullTargetWarn)||[],o._ptLookup=[],o._overwrite=m,y||f||rl(u)||rl(c)){s=o.vars;var j=s.easeReverse||s.yoyoEase;if(w=o.timeline=new Rt({data:"nested",defaults:g||{},targets:_&&_.data==="nested"?_.vars.targets:v}),w.kill(),w.parent=w._dp=Jr(o),w._start=0,f||rl(u)||rl(c)){if(x=v.length,E=f&&R_(f),Fr(f))for(k in f)~V_.indexOf(k)&&(R||(R={}),R[k]=f[k]);for(h=0;h<x;h++)p=hu(s,W_),p.stagger=0,j&&(p.easeReverse=j),R&&Ai(p,R),T=v[h],p.duration=+Oa(u,Jr(o),h,T,v),p.delay=(+Oa(c,Jr(o),h,T,v)||0)-o._delay,!f&&x===1&&p.delay&&(o._delay=c=p.delay,o._start+=c,p.delay=0),w.to(T,p,E?E(h,T,v):0),w._ease=pe.none;w.duration()?u=c=0:o.timeline=0}else if(y){Aa(er(w.vars.defaults,{ease:"none"})),w._ease=xs(y.ease||s.ease||"none");var L=0,O,N,M;if(xt(y))y.forEach(function(X){return w.to(v,X,">")}),w.duration();else{p={};for(k in y)k==="ease"||k==="easeEach"||aR(k,y[k],p,y.easeEach);for(k in p)for(O=p[k].sort(function(X,q){return X.t-q.t}),L=0,h=0;h<O.length;h++)N=O[h],M={ease:N.e,duration:(N.t-(h?O[h-1].t:0))/100*u},M[k]=N.v,w.to(v,M,L),L+=M.duration;w.duration()<u&&w.to({},{duration:u-w.duration()})}}u||o.duration(u=w.duration())}else o.timeline=0;return m===!0&&!Zf&&(En=Jr(o),Le.killTweensOf(v),En=0),Dr(_,Jr(o),i),s.reversed&&o.reverse(),s.paused&&o.paused(!0),(d||!u&&!y&&o._start===Ie(_._time)&&jt(d)&&MA(Jr(o))&&_.data!=="nested")&&(o._tTime=-Se,o.render(Math.max(0,-c)||0)),b&&T_(Jr(o),b),o}var r=e.prototype;return r.render=function(s,i,a){var o=this._time,l=this._tDur,u=this._dur,c=s<0,d=s>l-Se&&!c?l:s<Se?0:s,f,m,y,g,b,_,v,w;if(!u)$A(this,s,i,a);else if(d!==this._tTime||!s||a||!this._initted&&this._tTime||this._startAt&&this._zTime<0!==c||this._lazy){if(f=d,w=this.timeline,this._repeat){if(g=u+this._rDelay,this._repeat<-1&&c)return this.totalTime(g*100+s,i,a);if(f=Ie(d%g),d===l?(y=this._repeat,f=u):(b=Ie(d/g),y=~~b,y&&y===b?(f=u,y--):f>u&&(f=u)),_=this._yoyo&&y&1,_&&(f=u-f),b=Ri(this._tTime,g),f===o&&!a&&this._initted&&y===b)return this._tTime=d,this;y!==b&&this.vars.repeatRefresh&&!_&&!this._lock&&f!==g&&this._initted&&(this._lock=a=1,this.render(Ie(g*y),!0).invalidate()._lock=0)}if(!this._initted){if(C_(this,c?s:f,a,i,d))return this._tTime=0,this;if(o!==this._time&&!(a&&this.vars.repeatRefresh&&y!==b))return this;if(u!==this._dur)return this.render(s,i,a)}if(this._rEase){var h=f<o;if(h!==this._inv){var p=h?o:u-o;this._inv=h,this._from&&(this.ratio=1-this.ratio),this._invRatio=this.ratio,this._invTime=o,this._invRecip=p?(h?-1:1)/p:0,this._invScale=h?-this.ratio:1-this.ratio,this._invEase=h?this._rEase:this._ease}this.ratio=v=this._invRatio+this._invScale*this._invEase((f-this._invTime)*this._invRecip)}else this.ratio=v=this._ease(f/u);if(this._from&&(this.ratio=v=1-v),this._tTime=d,this._time=f,!this._act&&this._ts&&(this._act=1,this._lazy=0),!o&&d&&!i&&!b&&(Kt(this,"onStart"),this._tTime!==d))return this;for(m=this._pt;m;)m.r(v,m.d),m=m._next;w&&w.render(s<0?s:w._dur*w._ease(f/this._dur),i,a)||this._startAt&&(this._zTime=s),this._onUpdate&&!i&&(c&&yh(this,s,i,a),Kt(this,"onUpdate")),this._repeat&&y!==b&&this.vars.onRepeat&&!i&&this.parent&&Kt(this,"onRepeat"),(d===this._tDur||!d)&&this._tTime===d&&(c&&!this._onUpdate&&yh(this,s,!0,!0),(s||!u)&&(d===this._tDur&&this._ts>0||!d&&this._ts<0)&&Wn(this,1),!i&&!(c&&!o)&&(d||o||_)&&(Kt(this,d===l?"onComplete":"onReverseComplete",!0),this._prom&&!(d<l&&this.timeScale()>0)&&this._prom()))}return this},r.targets=function(){return this._targets},r.invalidate=function(s){return(!s||!this.vars.runBackwards)&&(this._startAt=0),this._pt=this._op=this._onUpdate=this._lazy=this.ratio=0,this._ptLookup=[],this.timeline&&this.timeline.invalidate(s),t.prototype.invalidate.call(this,s)},r.resetTo=function(s,i,a,o,l){co||Gt.wake(),this._ts||this.play();var u=Math.min(this._dur,(this._dp._time-this._start)*this._ts),c;return this._initted||ap(this,u),c=this._ease(u/this._dur),sR(this,s,i,a,o,c,u,l)?this.resetTo(s,i,a,o,1):(Ku(this,0),this.parent||k_(this._dp,this,"_first","_last",this._dp._sort?"_start":0),this.render(0))},r.kill=function(s,i){if(i===void 0&&(i="all"),!s&&(!i||i==="all"))return this._lazy=this._pt=0,this.parent?da(this):this.scrollTrigger&&this.scrollTrigger.kill(!!ht),this;if(this.timeline){var a=this.timeline.totalDuration();
vendor: 5,781 bytes, line 387
387return this.timeline.killTweensOf(s,i,En&&En.vars.overwrite!==!0)._first||da(this),this.parent&&a!==this.timeline.totalDuration()&&Oi(this,this._dur*this.timeline._tDur/a,0,1),this}var o=this._targets,l=s?dr(s):o,u=this._ptLookup,c=this._pt,d,f,m,y,g,b,_;if((!i||i==="all")&&LA(o,l))return i==="all"&&(this._pt=0),da(this);for(d=this._op=this._op||[],i!=="all"&&(ot(i)&&(g={},Mt(i,function(v){return g[v]=1}),i=g),i=iR(o,i)),_=o.length;_--;)if(~l.indexOf(o[_])){f=u[_],i==="all"?(d[_]=i,y=f,m={}):(m=d[_]=d[_]||{},y=i);for(g in y)b=f&&f[g],b&&((!("kill"in b.d)||b.d.kill(g)===!0)&&Gu(this,b,"_pt"),delete f[g]),m!=="all"&&(m[g]=1)}return this._initted&&!this._pt&&c&&da(this),this},e.to=function(s,i){return new e(s,i,arguments[2])},e.from=function(s,i){return Ra(1,arguments)},e.delayedCall=function(s,i,a,o){return new e(i,0,{immediateRender:!1,lazy:!1,overwrite:!1,delay:s,onComplete:i,onReverseComplete:i,onCompleteParams:a,onReverseCompleteParams:a,callbackScope:o})},e.fromTo=function(s,i,a){return Ra(2,arguments)},e.set=function(s,i){return i.duration=0,i.repeatDelay||(i.repeat=0),new e(s,i)},e.killTweensOf=function(s,i,a){return Le.killTweensOf(s,i,a)},e}(ho);er(Xe.prototype,{_targets:[],_lazy:0,_startAt:0,_op:0,_onInit:0});Mt("staggerTo,staggerFrom,staggerFromTo",function(t){Xe[t]=function(){var e=new Rt,r=_h.call(arguments,0);return r.splice(t==="staggerFromTo"?5:4,0,0),e[t].apply(e,r)}});var op=function(e,r,n){return e[r]=n},H_=function(e,r,n){return e[r](n)},oR=function(e,r,n,s){return e[r](s.fp,n)},lR=function(e,r,n){return e.setAttribute(r,n)},lp=function(e,r){return Fe(e[r])?H_:Yf(e[r])&&e.setAttribute?lR:op},G_=function(e,r){return r.set(r.t,r.p,Math.round((r.s+r.c*e)*1e6)/1e6,r)},uR=function(e,r){return r.set(r.t,r.p,!!(r.s+r.c*e),r)},q_=function(e,r){var n=r._pt,s="";if(!e&&r.b)s=r.b;else if(e===1&&r.e)s=r.e;else{for(;n;)s=n.p+(n.m?n.m(n.s+n.c*e):Math.round((n.s+n.c*e)*1e4)/1e4)+s,n=n._next;s+=r.c}r.set(r.t,r.p,s,r)},up=function(e,r){for(var n=r._pt;n;)n.r(e,n.d),n=n._next},cR=function(e,r,n,s){for(var i=this._pt,a;i;)a=i._next,i.p===s&&i.modifier(e,r,n),i=a},dR=function(e){for(var r=this._pt,n,s;r;)s=r._next,r.p===e&&!r.op||r.op===e?Gu(this,r,"_pt"):r.dep||(n=1),r=s;return!n},hR=function(e,r,n,s){s.mSet(e,r,s.m.call(s.tween,n,s.mt),s)},K_=function(e){for(var r=e._pt,n,s,i,a;r;){for(n=r._next,s=i;s&&s.pr>r.pr;)s=s._next;(r._prev=s?s._prev:a)?r._prev._next=r:i=r,(r._next=s)?s._prev=r:a=r,r=n}e._pt=i},Dt=function(){function t(r,n,s,i,a,o,l,u,c){this.t=n,this.s=i,this.c=a,this.p=s,this.r=o||G_,this.d=l||this,this.set=u||op,this.pr=c||0,this._next=r,r&&(r._prev=this)}var e=t.prototype;return e.modifier=function(n,s,i){this.mSet=this.mSet||this.set,this.set=hR,this.m=n,this.mt=i,this.tween=s},t}();Mt(rp+"parent,duration,ease,delay,overwrite,runBackwards,startAt,yoyo,immediateRender,repeat,repeatDelay,data,paused,reversed,lazy,callbackScope,stringFilter,id,yoyoEase,stagger,inherit,repeatRefresh,keyframes,autoRevert,scrollTrigger,easeReverse",function(t){return tp[t]=1});Qt.TweenMax=Qt.TweenLite=Xe;Qt.TimelineLite=Qt.TimelineMax=Rt;Le=new Rt({sortChildren:!1,defaults:ao,autoRemoveChildren:!0,id:"root",smoothChildTiming:!0});Yt.stringFilter=z_;var bs=[],_l={},fR=[],Jg=0,pR=0,Jc=function(e){return(_l[e]||fR).map(function(r){return r()})},kh=function(){var e=Date.now(),r=[];e-Jg>2&&(Jc("matchMediaInit"),bs.forEach(function(n){var s=n.queries,i=n.conditions,a,o,l,u;for(o in s)a=Lr.matchMedia(s[o]).matches,a&&(l=1),a!==i[o]&&(i[o]=a,u=1);u&&(n.revert(),l&&r.push(n))}),Jc("matchMediaRevert"),r.forEach(function(n){return n.onMatch(n,function(s){return n.add(null,s)})}),Jg=e,Jc("matchMedia"))},J_=function(){function t(r,n){this.selector=n&&xh(n),this.data=[],this._r=[],this.isReverted=!1,this.id=pR++,r&&this.add(r)}var e=t.prototype;return e.add=function(n,s,i){Fe(n)&&(i=s,s=n,n=Fe);var a=this,o=function(){var u=Oe,c=a.selector,d;return u&&u!==a&&u.data.push(a),i&&(a.selector=xh(i)),Oe=a,d=s.apply(a,arguments),Fe(d)&&a._r.push(d),Oe=u,a.selector=c,a.isReverted=!1,d};return a.last=o,n===Fe?o(a,function(l){return a.add(null,l)}):n?a[n]=o:o},e.ignore=function(n){var s=Oe;Oe=null,n(this),Oe=s},e.getTweens=function(){var n=[];return this.data.forEach(function(s){return s instanceof t?n.push.apply(n,s.getTweens()):s instanceof Xe&&!(s.parent&&s.parent.data==="nested")&&n.push(s)}),n},e.clear=function(){this._r.length=this.data.length=0},e.kill=function(n,s){var i=this;if(n?function(){for(var o=i.getTweens(),l=i.data.length,u;l--;)u=i.data[l],u.data==="isFlip"&&(u.revert(),u.getChildren(!0,!0,!1).forEach(function(c){return o.splice(o.indexOf(c),1)}));for(o.map(function(c){return{g:c._dur||c._delay||c._sat&&!c._sat.vars.immediateRender?c.globalTime(0):-1/0,t:c}}).sort(function(c,d){return d.g-c.g||-1/0}).forEach(function(c){return c.t.revert(n)}),l=i.data.length;l--;)u=i.data[l],u instanceof Rt?u.data!=="nested"&&(u.scrollTrigger&&u.scrollTrigger.revert(),u.kill()):!(u instanceof Xe)&&u.revert&&u.revert(n);i._r.forEach(function(c){return c(n,i)}),i.isReverted=!0}():this.data.forEach(function(o){return o.kill&&o.kill()}),this.clear(),s)for(var a=bs.length;a--;)bs[a].id===this.id&&bs.splice(a,1)},e.revert=function(n){this.kill(n||{})},t}(),mR=function(){function t(r){this.contexts=[],this.scope=r,Oe&&Oe.data.push(this)}var e=t.prototype;return e.add=function(n,s,i){Fr(n)||(n={matches:n});var a=new J_(0,i||this.scope),o=a.conditions={},l,u,c;Oe&&!a.selector&&(a.selector=Oe.selector),this.contexts.push(a),s=a.add("onMatch",s),a.queries=n;for(u in n)u==="all"?c=1:(l=Lr.matchMedia(n[u]),l&&(bs.indexOf(a)<0&&bs.push(a),(o[u]=l.matches)&&(c=1),l.addListener?l.addListener(kh):l.addEventListener("change",kh)));return c&&s(a,function(d){return a.add(null,d)}),this},e.revert=function(n){this.kill(n||{})}
vendor: 5,675 bytes, lines 387-394
387,e.kill=function(n){this.contexts.forEach(function(s){return s.kill(n,!0)})},t}(),pu={registerPlugin:function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];r.forEach(function(s){return M_(s)})},timeline:function(e){return new Rt(e)},getTweensOf:function(e,r){return Le.getTweensOf(e,r)},getProperty:function(e,r,n,s){ot(e)&&(e=dr(e)[0]);var i=ws(e||{}).get,a=n?S_:b_;return n==="native"&&(n=""),e&&(r?a((Ft[r]&&Ft[r].get||i)(e,r,n,s)):function(o,l,u){return a((Ft[o]&&Ft[o].get||i)(e,o,l,u))})},quickSetter:function(e,r,n){if(e=dr(e),e.length>1){var s=e.map(function(c){return zt.quickSetter(c,r,n)}),i=s.length;return function(c){for(var d=i;d--;)s[d](c)}}e=e[0]||{};var a=Ft[r],o=ws(e),l=o.harness&&(o.harness.aliases||{})[r]||r,u=a?function(c){var d=new a;li._pt=0,d.init(e,n?c+n:c,li,0,[e]),d.render(1,d),li._pt&&up(1,li)}:o.set(e,l);return a?u:function(c){return u(e,l,n?c+n:c,o,1)}},quickTo:function(e,r,n){var s,i=zt.to(e,er((s={},s[r]="+=0.1",s.paused=!0,s.stagger=0,s),n||{})),a=function(l,u,c){return i.resetTo(r,l,u,c)};return a.tween=i,a},isTweening:function(e){return Le.getTweensOf(e,!0).length>0},defaults:function(e){return e&&e.ease&&(e.ease=xs(e.ease,ao.ease)),Wg(ao,e||{})},config:function(e){return Wg(Yt,e||{})},registerEffect:function(e){var r=e.name,n=e.effect,s=e.plugins,i=e.defaults,a=e.extendTimeline;(s||"").split(",").forEach(function(o){return o&&!Ft[o]&&!Qt[o]&&oo(r+" effect requires "+o+" plugin.")}),Hc[r]=function(o,l,u){return n(dr(o),er(l||{},i),u)},a&&(Rt.prototype[r]=function(o,l,u){return this.add(Hc[r](o,Fr(l)?l:(u=l)&&{},this),u)})},registerEase:function(e,r){pe[e]=xs(r)},parseEase:function(e,r){return arguments.length?xs(e,r):pe},getById:function(e){return Le.getById(e)},exportRoot:function(e,r){e===void 0&&(e={});var n=new Rt(e),s,i;for(n.smoothChildTiming=jt(e.smoothChildTiming),Le.remove(n),n._dp=0,n._time=n._tTime=Le._time,s=Le._first;s;)i=s._next,(r||!(!s._dur&&s instanceof Xe&&s.vars.onComplete===s._targets[0]))&&Dr(n,s,s._start-s._delay),s=i;return Dr(Le,n,0),n},context:function(e,r){return e?new J_(e,r):Oe},matchMedia:function(e){return new mR(e)},matchMediaRefresh:function(){return bs.forEach(function(e){var r=e.conditions,n,s;for(s in r)r[s]&&(r[s]=!1,n=1);n&&e.revert()})||kh()},addEventListener:function(e,r){var n=_l[e]||(_l[e]=[]);~n.indexOf(r)||n.push(r)},removeEventListener:function(e,r){var n=_l[e],s=n&&n.indexOf(r);s>=0&&n.splice(s,1)},utils:{wrap:GA,wrapYoyo:qA,distribute:R_,random:I_,snap:O_,normalize:HA,getUnit:wt,clamp:BA,splitColor:D_,toArray:dr,selector:xh,mapRange:L_,pipe:VA,unitize:WA,interpolate:KA,shuffle:A_},install:v_,effects:Hc,ticker:Gt,updateRoot:Rt.updateRoot,plugins:Ft,globalTimeline:Le,core:{PropTween:Dt,globals:y_,Tween:Xe,Timeline:Rt,Animation:ho,getCache:ws,_removeLinkedListItem:Gu,reverting:function(){return ht},context:function(e){return e&&Oe&&(Oe.data.push(e),e._ctx=Oe),Oe},suppressOverwrites:function(e){return Zf=e}}};Mt("to,from,fromTo,delayedCall,set,killTweensOf",function(t){return pu[t]=Xe[t]});Gt.add(Rt.updateRoot);li=pu.to({},{duration:0});var gR=function(e,r){for(var n=e._pt;n&&n.p!==r&&n.op!==r&&n.fp!==r;)n=n._next;return n},vR=function(e,r){var n=e._targets,s,i,a;for(s in r)for(i=n.length;i--;)a=e._ptLookup[i][s],a&&(a=a.d)&&(a._pt&&(a=gR(a,s)),a&&a.modifier&&a.modifier(r[s],e,n[i],s))},Zc=function(e,r){return{name:e,headless:1,rawVars:1,init:function(s,i,a){a._onInit=function(o){var l,u;if(ot(i)&&(l={},Mt(i,function(c){return l[c]=1}),i=l),r){l={};for(u in i)l[u]=r(i[u]);i=l}vR(o,i)}}}},zt=pu.registerPlugin({name:"attr",init:function(e,r,n,s,i){var a,o,l;this.tween=n;for(a in r)l=e.getAttribute(a)||"",o=this.add(e,"setAttribute",(l||0)+"",r[a],s,i,0,0,a),o.op=a,o.b=l,this._props.push(a)},render:function(e,r){for(var n=r._pt;n;)ht?n.set(n.t,n.p,n.b,n):n.r(e,n.d),n=n._next}},{name:"endArray",headless:1,init:function(e,r){for(var n=r.length;n--;)this.add(e,n,e[n]||0,r[n],0,0,0,0,0,1)}},Zc("roundProps",bh),Zc("modifiers"),Zc("snap",O_))||pu;Xe.version=Rt.version=zt.version="3.15.0";g_=1;Xf()&&Ii();pe.Power0;pe.Power1;pe.Power2;pe.Power3;pe.Power4;pe.Linear;pe.Quad;pe.Cubic;pe.Quart;pe.Quint;pe.Strong;pe.Elastic;pe.Back;pe.SteppedEase;pe.Bounce;pe.Sine;pe.Expo;pe.Circ;/*!
388 * CSSPlugin 3.15.0
389 * https://gsap.com
390 *
391 * Copyright 2008-2026, GreenSock. All rights reserved.
392 * Subject to the terms at https://gsap.com/standard-license
393 * @author: Jack Doyle, [email protected]
394*/var Zg,Tn,wi,cp,ms,Yg,dp,yR=function(){return typeof window<"u"},ln={},us=180/Math.PI,_i=Math.PI/180,Fs=Math.atan2,Xg=1e8,hp=/([A-Z])/g,wR=/(left|right|width|margin|padding|x)/i,_R=/[\s,\(]\S/,$r={autoAlpha:"opacity,visibility",scale:"scaleX,scaleY",alpha:"opacity"},Eh=function(e,r){return r.set(r.t,r.p,Math.round((r.s+r.c*e)*1e4)/1e4+r.u,r)},xR=function(e,r){return r.set(r.t,r.p,e===1?r.e:Math.round((r.s+r.c*e)*1e4)/1e4+r.u,r)},bR=function(e,r){return r.set(r.t,r.p,e?Math.round((r.s+r.c*e)*1e4)/1e4+r.u:r.b,r)},SR=function(e,r){return r.set(r.t,r.p,e===1?r.e:e?Math.round((r.s+r.c*e)*1e4)/1e4+r.u:r.b,r)},kR=function(e,r){var n=r.s+r.c*e;r.set(r.t,r.p,~~(n+(n<0?-.5:.5))+r.u,r)},Z_=function(e,r){return r.set(r.t,r.p,e?r.e:r.b,r)},Y_=function(e,r){return r.set(r.t,r.p,e!==1?r.b:r.e,r)},ER=function(e,r,n){return e.style[r]=n},TR=function(e,r,n){return e.style.setProperty(r,n)},CR=function(e,r,n){return e._gsap[r]=n},PR=function(e,r,n){return e._gsap.scaleX=e._gsap.scaleY=n},AR=function(e,r,n,s,i){var a=e._gsap;a.scaleX=a.scaleY=n,a.renderTransform(i,a)},RR=function(e,r,n,s,i){var a=e._gsap;a[r]=n,a.renderTransform(i,a)},je="transform",$t=je+"Origin",OR=function t(e,r){var n=this,s=this.target,i=s.style,a=s._gsap;
vendor: 4,285 bytes, line 394
394if(e in ln&&i){if(this.tfm=this.tfm||{},e!=="transform")e=$r[e]||e,~e.indexOf(",")?e.split(",").forEach(function(o){return n.tfm[o]=Yr(s,o)}):this.tfm[e]=a.x?a[e]:Yr(s,e),e===$t&&(this.tfm.zOrigin=a.zOrigin);else return $r.transform.split(",").forEach(function(o){return t.call(n,o,r)});if(this.props.indexOf(je)>=0)return;a.svg&&(this.svgo=s.getAttribute("data-svg-origin"),this.props.push($t,r,"")),e=je}(i||r)&&this.props.push(e,r,i[e])},X_=function(e){e.translate&&(e.removeProperty("translate"),e.removeProperty("scale"),e.removeProperty("rotate"))},IR=function(){var e=this.props,r=this.target,n=r.style,s=r._gsap,i,a;for(i=0;i<e.length;i+=3)e[i+1]?e[i+1]===2?r[e[i]](e[i+2]):r[e[i]]=e[i+2]:e[i+2]?n[e[i]]=e[i+2]:n.removeProperty(e[i].substr(0,2)==="--"?e[i]:e[i].replace(hp,"-$1").toLowerCase());if(this.tfm){for(a in this.tfm)s[a]=this.tfm[a];s.svg&&(s.renderTransform(),r.setAttribute("data-svg-origin",this.svgo||"")),i=dp(),(!i||!i.isStart)&&!n[je]&&(X_(n),s.zOrigin&&n[$t]&&(n[$t]+=" "+s.zOrigin+"px",s.zOrigin=0,s.renderTransform()),s.uncache=1)}},Q_=function(e,r){var n={target:e,props:[],revert:IR,save:OR};return e._gsap||zt.core.getCache(e),r&&e.style&&e.nodeType&&r.split(",").forEach(function(s){return n.save(s)}),n},e1,Th=function(e,r){var n=Tn.createElementNS?Tn.createElementNS((r||"http://www.w3.org/1999/xhtml").replace(/^https/,"http"),e):Tn.createElement(e);return n&&n.style?n:Tn.createElement(e)},Jt=function t(e,r,n){var s=getComputedStyle(e);return s[r]||s.getPropertyValue(r.replace(hp,"-$1").toLowerCase())||s.getPropertyValue(r)||!n&&t(e,Ni(r)||r,1)||""},Qg="O,Moz,ms,Ms,Webkit".split(","),Ni=function(e,r,n){var s=r||ms,i=s.style,a=5;if(e in i&&!n)return e;for(e=e.charAt(0).toUpperCase()+e.substr(1);a--&&!(Qg[a]+e in i););return a<0?null:(a===3?"ms":a>=0?Qg[a]:"")+e},Ch=function(){yR()&&window.document&&(Zg=window,Tn=Zg.document,wi=Tn.documentElement,ms=Th("div")||{style:{}},Th("div"),je=Ni(je),$t=je+"Origin",ms.style.cssText="border-width:0;line-height:0;position:absolute;padding:0",e1=!!Ni("perspective"),dp=zt.core.reverting,cp=1)},e0=function(e){var r=e.ownerSVGElement,n=Th("svg",r&&r.getAttribute("xmlns")||"http://www.w3.org/2000/svg"),s=e.cloneNode(!0),i;s.style.display="block",n.appendChild(s),wi.appendChild(n);try{i=s.getBBox()}catch{}return n.removeChild(s),wi.removeChild(n),i},t0=function(e,r){for(var n=r.length;n--;)if(e.hasAttribute(r[n]))return e.getAttribute(r[n])},t1=function(e){var r,n;try{r=e.getBBox()}catch{r=e0(e),n=1}return r&&(r.width||r.height)||n||(r=e0(e)),r&&!r.width&&!r.x&&!r.y?{x:+t0(e,["x","cx","x1"])||0,y:+t0(e,["y","cy","y1"])||0,width:0,height:0}:r},r1=function(e){return!!(e.getCTM&&(!e.parentNode||e.ownerSVGElement)&&t1(e))},Hn=function(e,r){if(r){var n=e.style,s;r in ln&&r!==$t&&(r=je),n.removeProperty?(s=r.substr(0,2),(s==="ms"||r.substr(0,6)==="webkit")&&(r="-"+r),n.removeProperty(s==="--"?r:r.replace(hp,"-$1").toLowerCase())):n.removeAttribute(r)}},Cn=function(e,r,n,s,i,a){var o=new Dt(e._pt,r,n,0,1,a?Y_:Z_);return e._pt=o,o.b=s,o.e=i,e._props.push(n),o},r0={deg:1,rad:1,turn:1},NR={grid:1,flex:1},Gn=function t(e,r,n,s){var i=parseFloat(n)||0,a=(n+"").trim().substr((i+"").length)||"px",o=ms.style,l=wR.test(r),u=e.tagName.toLowerCase()==="svg",c=(u?"client":"offset")+(l?"Width":"Height"),d=100,f=s==="px",m=s==="%",y,g,b,_;if(s===a||!i||r0[s]||r0[a])return i;if(a!=="px"&&!f&&(i=t(e,r,n,"px")),_=e.getCTM&&r1(e),(m||a==="%")&&(ln[r]||~r.indexOf("adius")))return y=_?e.getBBox()[l?"width":"height"]:e[c],He(m?i/y*d:i/100*y);if(o[l?"width":"height"]=d+(f?a:s),g=s!=="rem"&&~r.indexOf("adius")||s==="em"&&e.appendChild&&!u?e:e.parentNode,_&&(g=(e.ownerSVGElement||{}).parentNode),(!g||g===Tn||!g.appendChild)&&(g=Tn.body),b=g._gsap,b&&m&&b.width&&l&&b.time===Gt.time&&!b.uncache)return He(i/b.width*d);if(m&&(r==="height"||r==="width")){var v=e.style[r];e.style[r]=d+s,y=e[c],v?e.style[r]=v:Hn(e,r)}else(m||a==="%")&&!NR[Jt(g,"display")]&&(o.position=Jt(e,"position")),g===e&&(o.position="static"),g.appendChild(ms),y=ms[c],g.removeChild(ms),o.position="absolute";return l&&m&&(b=ws(g),b.time=Gt.time,b.width=g[c]),He(f?y*i/d:y&&i?d/y*i:0)},Yr=function(e,r,n,s){var i;return cp||Ch(),r in $r&&r!=="transform"&&(r=$r[r],~r.indexOf(",")&&(r=r.split(",")[0])),ln[r]&&r!=="transform"?(i=po(e,s
vendor: 8,147 bytes, line 394
394),i=r!=="transformOrigin"?i[r]:i.svg?i.origin:gu(Jt(e,$t))+" "+i.zOrigin+"px"):(i=e.style[r],(!i||i==="auto"||s||~(i+"").indexOf("calc("))&&(i=mu[r]&&mu[r](e,r,n)||Jt(e,r)||__(e,r)||(r==="opacity"?1:0))),n&&!~(i+"").trim().indexOf(" ")?Gn(e,r,i,n)+n:i},LR=function(e,r,n,s){if(!n||n==="none"){var i=Ni(r,e,1),a=i&&Jt(e,i,1);a&&a!==n?(r=i,n=a):r==="borderColor"&&(n=Jt(e,"borderTopColor"))}var o=new Dt(this._pt,e.style,r,0,1,q_),l=0,u=0,c,d,f,m,y,g,b,_,v,w,h,p;if(o.b=n,o.e=s,n+="",s+="",s.substring(0,6)==="var(--"&&(s=Jt(e,s.substring(4,s.indexOf(")")))),s==="auto"&&(g=e.style[r],e.style[r]=s,s=Jt(e,r)||s,g?e.style[r]=g:Hn(e,r)),c=[n,s],z_(c),n=c[0],s=c[1],f=n.match(oi)||[],p=s.match(oi)||[],p.length){for(;d=oi.exec(s);)b=d[0],v=s.substring(l,d.index),y?y=(y+1)%5:(v.substr(-5)==="rgba("||v.substr(-5)==="hsla(")&&(y=1),b!==(g=f[u++]||"")&&(m=parseFloat(g)||0,h=g.substr((m+"").length),b.charAt(1)==="="&&(b=yi(m,b)+h),_=parseFloat(b),w=b.substr((_+"").length),l=oi.lastIndex-w.length,w||(w=w||Yt.units[r]||h,l===s.length&&(s+=w,o.e+=w)),h!==w&&(m=Gn(e,r,g,w)||0),o._pt={_next:o._pt,p:v||u===1?v:",",s:m,c:_-m,m:y&&y<4||r==="zIndex"?Math.round:0});o.c=l<s.length?s.substring(l,s.length):""}else o.r=r==="display"&&s==="none"?Y_:Z_;return m_.test(s)&&(o.e=0),this._pt=o,o},n0={top:"0%",bottom:"100%",left:"0%",right:"100%",center:"50%"},jR=function(e){var r=e.split(" "),n=r[0],s=r[1]||"50%";return(n==="top"||n==="bottom"||s==="left"||s==="right")&&(e=n,n=s,s=e),r[0]=n0[n]||n,r[1]=n0[s]||s,r.join(" ")},MR=function(e,r){if(r.tween&&r.tween._time===r.tween._dur){var n=r.t,s=n.style,i=r.u,a=n._gsap,o,l,u;if(i==="all"||i===!0)s.cssText="",l=1;else for(i=i.split(","),u=i.length;--u>-1;)o=i[u],ln[o]&&(l=1,o=o==="transformOrigin"?$t:je),Hn(n,o);l&&(Hn(n,je),a&&(a.svg&&n.removeAttribute("transform"),s.scale=s.rotate=s.translate="none",po(n,1),a.uncache=1,X_(s)))}},mu={clearProps:function(e,r,n,s,i){if(i.data!=="isFromStart"){var a=e._pt=new Dt(e._pt,r,n,0,0,MR);return a.u=s,a.pr=-10,a.tween=i,e._props.push(n),1}}},fo=[1,0,0,1,0,0],n1={},s1=function(e){return e==="matrix(1, 0, 0, 1, 0, 0)"||e==="none"||!e},s0=function(e){var r=Jt(e,je);return s1(r)?fo:r.substr(7).match(p_).map(He)},fp=function(e,r){var n=e._gsap||ws(e),s=e.style,i=s0(e),a,o,l,u;return n.svg&&e.getAttribute("transform")?(l=e.transform.baseVal.consolidate().matrix,i=[l.a,l.b,l.c,l.d,l.e,l.f],i.join(",")==="1,0,0,1,0,0"?fo:i):(i===fo&&!e.offsetParent&&e!==wi&&!n.svg&&(l=s.display,s.display="block",a=e.parentNode,(!a||!e.offsetParent&&!e.getBoundingClientRect().width)&&(u=1,o=e.nextElementSibling,wi.appendChild(e)),i=s0(e),l?s.display=l:Hn(e,"display"),u&&(o?a.insertBefore(e,o):a?a.appendChild(e):wi.removeChild(e))),r&&i.length>6?[i[0],i[1],i[4],i[5],i[12],i[13]]:i)},Ph=function(e,r,n,s,i,a){var o=e._gsap,l=i||fp(e,!0),u=o.xOrigin||0,c=o.yOrigin||0,d=o.xOffset||0,f=o.yOffset||0,m=l[0],y=l[1],g=l[2],b=l[3],_=l[4],v=l[5],w=r.split(" "),h=parseFloat(w[0])||0,p=parseFloat(w[1])||0,x,k,T,E;n?l!==fo&&(k=m*b-y*g)&&(T=h*(b/k)+p*(-g/k)+(g*v-b*_)/k,E=h*(-y/k)+p*(m/k)-(m*v-y*_)/k,h=T,p=E):(x=t1(e),h=x.x+(~w[0].indexOf("%")?h/100*x.width:h),p=x.y+(~(w[1]||w[0]).indexOf("%")?p/100*x.height:p)),s||s!==!1&&o.smooth?(_=h-u,v=p-c,o.xOffset=d+(_*m+v*g)-_,o.yOffset=f+(_*y+v*b)-v):o.xOffset=o.yOffset=0,o.xOrigin=h,o.yOrigin=p,o.smooth=!!s,o.origin=r,o.originIsAbsolute=!!n,e.style[$t]="0px 0px",a&&(Cn(a,o,"xOrigin",u,h),Cn(a,o,"yOrigin",c,p),Cn(a,o,"xOffset",d,o.xOffset),Cn(a,o,"yOffset",f,o.yOffset)),e.setAttribute("data-svg-origin",h+" "+p)},po=function(e,r){var n=e._gsap||new B_(e);if("x"in n&&!r&&!n.uncache)return n;var s=e.style,i=n.scaleX<0,a="px",o="deg",l=getComputedStyle(e),u=Jt(e,$t)||"0",c,d,f,m,y,g,b,_,v,w,h,p,x,k,T,E,R,j,L,O,N,M,X,q,D,K,U,W,re,oe,ce,xe;return c=d=f=g=b=_=v=w=h=0,m=y=1,n.svg=!!(e.getCTM&&r1(e)),l.translate&&((l.translate!=="none"||l.scale!=="none"||l.rotate!=="none")&&(s[je]=(l.translate!=="none"?"translate3d("+(l.translate+" 0 0").split(" ").slice(0,3).join(", ")+") ":"")+(l.rotate!=="none"?"rotate("+l.rotate+") ":"")+(l.scale!=="none"?"scale("+l.scale.split(" ").join(",")+") ":"")+(l[je]!=="none"?l[je]:"")),s.scale=s.rotate=s.translate="none"),k=fp(e,n.svg),n.svg&&(n.uncache?(D=e.getBBox(),u=n.xOrigin-D.x+"px "+(n.yOrigin-D.y)+"px",q=""):q=!r&&e.getAttribute("data-svg-origin"),Ph(e,q||u,!!q||n.originIsAbsolute,n.smooth!==!1,k)),p=n.xOrigin||0,x=n.yOrigin||0,k!==fo&&(j=k[0],L=k[1],O=k[2],N=k[3],c=M=k[4],d=X=k[5],k.length===6?(m=Math.sqrt(j*j+L*L),y=Math.sqrt(N*N+O*O),g=j||L?Fs(L,j)*us:0,v=O||N?Fs(O,N)*us+g:0,v&&(y*=Math.abs(Math.cos(v*_i))),n.svg&&(c-=p-(p*j+x*O),d-=x-(p*L+x*N))):(xe=k[6],oe=k[7],U=k[8],W=k[9],re=k[10],ce=k[11],c=k[12],d=k[13],f=k[14],T=Fs(xe,re),b=T*us,T&&(E=Math.cos(-T),R=Math.sin(-T),q=M*E+U*R,D=X*E+W*R,K=xe*E+re*R,U=M*-R+U*E,W=X*-R+W*E,re=xe*-R+re*E,ce=oe*-R+ce*E,M=q,X=D,xe=K),T=Fs(-O,re),_=T*us,T&&(E=Math.cos(-T),R=Math.sin(-T),q=j*E-U*R,D=L*E-W*R,K=O*E-re*R,ce=N*R+ce*E,j=q,L=D,O=K),T=Fs(L,j),g=T*us,T&&(E=Math.cos(T),R=Math.sin(T),q=j*E+L*R,D=M*E+X*R,L=L*E-j*R,X=X*E-M*R,j=q,M=D),b&&Math.abs(b)+Math.abs(g)>359.9&&(b=g=0,_=180-_),m=He(Math.sqrt(j*j+L*L+O*O)),y=He(Math.sqrt(X*X+xe*xe)),T=Fs(M,X),v=Math.abs(T)>2e-4?T*us:0,h=ce?1/(ce<0?-ce:ce):0),n.svg&&(q=e.getAttribute("transform"),n.forceCSS=e.setAttribute("transform","")||!s1(Jt(e,je)),q&&e.setAttribute("transform",q))),Math.abs(v)>90&&Math.abs(v)<270&&(i?(m*=-1,v+=g<=0?180:-180,g+=g<=0?180:-180):(y*=-1,v+=v<=0?180:-180)),r=r||n.uncache,n.x=c-((n.xPercent=c&&(!r&&n.xPercent||(Math.round(e.offsetWidth/2)===Math.round(-c)?-50:0)))?e.offsetWidth*n.xPercent/100:0)+a,n.y=d-((n.yPercent=d&&(!r&&n.yPercent||(Math.round(e.offsetHeight/2)===Math.round(-d)?-50:0)))?e.offsetHeight*n.yPercent/100:0)+a,n.z=f+a,n.scaleX=He(m),n.scaleY=He(y),n.rotation=He(g)+o,n.rotationX=He(b)+o,n.rotationY=He(_)+o,n.skewX=v+o,n.skewY=w+o,n.transformPerspective=h+a,(n.zOrigin=parseFloat(u.split(" ")[2])||!r&&n.zOrigin||0)&&(s[$t]=gu(u)),n.xOffset=n.yOffset=0,n.force3D=Yt.force3D,n.renderTransform=n.svg?$R:e1?i1:DR,n.uncache=0,n},gu=function(e){return(e=e.split(" "))[0]+" "+e[1]},Yc=function(e,r,n){var s=wt(r);return He(parseFloat(r)+parseFloat(Gn(e,"x",n+"px",s)))+s},DR=function(e,r){r.z="0px",r.rotationY=r.rotationX="0deg",r.force3D=0,i1(e,r)},ss="0deg",ta="0px",is=") ",i1=function(e,r){var n=r||this,s=n.xPercent,i=n.yPercent,a=n.x,o=n.y,l=n.z,u=n.rotation,c=n.rotationY,d=n.rotationX,f=n.skewX,m=n.skewY,y=n.scaleX,g=n.scaleY,b=n.transformPerspective,_=n.force3D,v=n.target,w=n.zOrigin,h="",p=_==="auto"&&e&&e!==1||_===!0;if(w&&(d!==ss||c!==ss)){var x=parseFloat(c)*_i,k=Math.sin(x),T=Math.cos(x),E;x=parseFloat(d)*_i,E=Math.cos(x),a=Yc(v,a,k*E*-w),o=Yc(v,o,-Math.sin(x)*-w),l=Yc(v,l,T*E*-w+w)}b!==ta&&(h+="perspective("+b+is),(s||i)&&(h+="translate("+s+"%, "+i+"%) "),(p||a!==ta||o!==ta||l!==ta)&&(h+=l!==ta||p?"translate3d("+a+", "+o+", "+l+") ":"translate("+a+", "+o+is),u!==ss&&(h+="rotate("+u+is),c!==ss&&(h+="rotateY("+c+is),d!==ss&&(h+="rotateX("+d+is),(f!==ss||m!==ss)&&(h+="skew("+f+", "+m+is),(y!==1||g!==1)&&(h+="scale("+y+", "+g+is),v.style[je]=h||"translate(0, 0)"},$R=function(e,r){var n=r||this,s=n.xPercent,i=n.yPercent,a=n.x,o=n.y,l=n.rotation,u=n.skewX,c=n.skewY,d=n.scaleX,f=n.scaleY,m=n.target,y=n.xOrigin,g=n.yOrigin,b=n.xOffset,_=n.yOffset,v=n.forceCSS,w=parseFloat(a),h=parseFloat(o),p,x,k,T,E;l=parseFloat(l),u=parseFloat(u),c=parseFloat(c),c&&(c=parseFloat(c),u+=c,l+=c),l||u?(l*=_i,u*=_i,p=Math.cos(l)*d,x=Math.sin(l)*d,k=Math.sin(l-u)*-f,T=Math.cos(l-u)*f,u&&(c*=_i,E=Math.tan(u-c),E=Math.sqrt(1+E*E),k*=E,T*=E,c&&(E=Math.tan(c),E=Math.sqrt(1+E*E),p*=E,x*=E)),p=He(p),x=He(x),k=He(k),T=He(T)):(p=d,T=f,x=k=0),(w&&!~(a+"").indexOf("px")||h&&!~(o+"").indexOf("px"))&&(w=Gn(m,"x",a,"px"),h=Gn(m,"y",o,"px")),(y||g||b||_)&&(w=He(w+y-(y*p+g*k)+b),h=He(h+g-(y*x+g*T)+_)),(s||i)&&(E=m.getBBox(),w=He(w+s/100*E.width),h=He(h+i/100*E.height)),E="matrix("+p+","+x+","+k+","+T+","+w+","+h+")",m.setAttribute("transform",E),v&&(m.style[je]=E)},zR=function(e,r,n,s,i){var a=360,o=ot(i),l=parseFloat(i)*(o&&~i.indexOf("rad")?us:1),u=l-s,c=s+u+"deg",d,f;return o&&(d=i.split("_")[1],d==="short"&&(u%=a,u!==u%(a/2)&&(u+=u<0?a:-a)
vendor: 7,549 bytes, lines 394-398
394),d==="cw"&&u<0?u=(u+a*Xg)%a-~~(u/a)*a:d==="ccw"&&u>0&&(u=(u-a*Xg)%a-~~(u/a)*a)),e._pt=f=new Dt(e._pt,r,n,s,u,xR),f.e=c,f.u="deg",e._props.push(n),f},i0=function(e,r){for(var n in r)e[n]=r[n];return e},UR=function(e,r,n){var s=i0({},n._gsap),i="perspective,force3D,transformOrigin,svgOrigin",a=n.style,o,l,u,c,d,f,m,y;s.svg?(u=n.getAttribute("transform"),n.setAttribute("transform",""),a[je]=r,o=po(n,1),Hn(n,je),n.setAttribute("transform",u)):(u=getComputedStyle(n)[je],a[je]=r,o=po(n,1),a[je]=u);for(l in ln)u=s[l],c=o[l],u!==c&&i.indexOf(l)<0&&(m=wt(u),y=wt(c),d=m!==y?Gn(n,l,u,y):parseFloat(u),f=parseFloat(c),e._pt=new Dt(e._pt,o,l,d,f-d,Eh),e._pt.u=y||0,e._props.push(l));i0(o,s)};Mt("padding,margin,Width,Radius",function(t,e){var r="Top",n="Right",s="Bottom",i="Left",a=(e<3?[r,n,s,i]:[r+i,r+n,s+n,s+i]).map(function(o){return e<2?t+o:"border"+o+t});mu[e>1?"border"+t:t]=function(o,l,u,c,d){var f,m;if(arguments.length<4)return f=a.map(function(y){return Yr(o,y,u)}),m=f.join(" "),m.split(f[0]).length===5?f[0]:m;f=(c+"").split(" "),m={},a.forEach(function(y,g){return m[y]=f[g]=f[g]||f[(g-1)/2|0]}),o.init(l,m,d)}});var a1={name:"css",register:Ch,targetTest:function(e){return e.style&&e.nodeType},init:function(e,r,n,s,i){var a=this._props,o=e.style,l=n.vars.startAt,u,c,d,f,m,y,g,b,_,v,w,h,p,x,k,T,E;cp||Ch(),this.styles=this.styles||Q_(e),T=this.styles.props,this.tween=n;for(g in r)if(g!=="autoRound"&&(c=r[g],!(Ft[g]&&F_(g,r,n,s,e,i)))){if(m=typeof c,y=mu[g],m==="function"&&(c=c.call(n,s,e,i),m=typeof c),m==="string"&&~c.indexOf("random(")&&(c=uo(c)),y)y(this,e,g,c,n)&&(k=1);else if(g.substr(0,2)==="--")u=(getComputedStyle(e).getPropertyValue(g)+"").trim(),c+="",zn.lastIndex=0,zn.test(u)||(b=wt(u),_=wt(c),_?b!==_&&(u=Gn(e,g,u,_)+_):b&&(c+=b)),this.add(o,"setProperty",u,c,s,i,0,0,g),a.push(g),T.push(g,0,o[g]);else if(m!=="undefined"){if(l&&g in l?(u=typeof l[g]=="function"?l[g].call(n,s,e,i):l[g],ot(u)&&~u.indexOf("random(")&&(u=uo(u)),wt(u+"")||u==="auto"||(u+=Yt.units[g]||wt(Yr(e,g))||""),(u+"").charAt(1)==="="&&(u=Yr(e,g))):u=Yr(e,g),f=parseFloat(u),v=m==="string"&&c.charAt(1)==="="&&c.substr(0,2),v&&(c=c.substr(2)),d=parseFloat(c),g in $r&&(g==="autoAlpha"&&(f===1&&Yr(e,"visibility")==="hidden"&&d&&(f=0),T.push("visibility",0,o.visibility),Cn(this,o,"visibility",f?"inherit":"hidden",d?"inherit":"hidden",!d)),g!=="scale"&&g!=="transform"&&(g=$r[g],~g.indexOf(",")&&(g=g.split(",")[0]))),w=g in ln,w){if(this.styles.save(g),E=c,m==="string"&&c.substring(0,6)==="var(--"){if(c=Jt(e,c.substring(4,c.indexOf(")"))),c.substring(0,5)==="calc("){var R=e.style.perspective;e.style.perspective=c,c=Jt(e,"perspective"),R?e.style.perspective=R:Hn(e,"perspective")}d=parseFloat(c)}if(h||(p=e._gsap,p.renderTransform&&!r.parseTransform||po(e,r.parseTransform),x=r.smoothOrigin!==!1&&p.smooth,h=this._pt=new Dt(this._pt,o,je,0,1,p.renderTransform,p,0,-1),h.dep=1),g==="scale")this._pt=new Dt(this._pt,p,"scaleY",p.scaleY,(v?yi(p.scaleY,v+d):d)-p.scaleY||0,Eh),this._pt.u=0,a.push("scaleY",g),g+="X";else if(g==="transformOrigin"){T.push($t,0,o[$t]),c=jR(c),p.svg?Ph(e,c,0,x,0,this):(_=parseFloat(c.split(" ")[2])||0,_!==p.zOrigin&&Cn(this,p,"zOrigin",p.zOrigin,_),Cn(this,o,g,gu(u),gu(c)));continue}else if(g==="svgOrigin"){Ph(e,c,1,x,0,this);continue}else if(g in n1){zR(this,p,g,f,v?yi(f,v+c):c);continue}else if(g==="smoothOrigin"){Cn(this,p,"smooth",p.smooth,c);continue}else if(g==="force3D"){p[g]=c;continue}else if(g==="transform"){UR(this,c,e);continue}}else g in o||(g=Ni(g)||g);if(w||(d||d===0)&&(f||f===0)&&!_R.test(c)&&g in o)b=(u+"").substr((f+"").length),d||(d=0),_=wt(c)||(g in Yt.units?Yt.units[g]:b),b!==_&&(f=Gn(e,g,u,_)),this._pt=new Dt(this._pt,w?p:o,g,f,(v?yi(f,v+d):d)-f,!w&&(_==="px"||g==="zIndex")&&r.autoRound!==!1?kR:Eh),this._pt.u=_||0,w&&E!==c?(this._pt.b=u,this._pt.e=E,this._pt.r=SR):b!==_&&_!=="%"&&(this._pt.b=u,this._pt.r=bR);else if(g in o)LR.call(this,e,g,u,v?v+c:c);else if(g in e)this.add(e,g,u||e[g],v?v+c:c,s,i);else if(g!=="parseTransform"){ep(g,c);continue}w||(g in o?T.push(g,0,o[g]):typeof e[g]=="function"?T.push(g,2,e[g]()):T.push(g,1,u||e[g])),a.push(g)}}k&&K_(this)},render:function(e,r){if(r.tween._time||!dp())for(var n=r._pt;n;)n.r(e,n.d),n=n._next;else r.styles.revert()},get:Yr,aliases:$r,getSetter:function(e,r,n){var s=$r[r];return s&&s.indexOf(",")<0&&(r=s),r in ln&&r!==$t&&(e._gsap.x||Yr(e,"x"))?n&&Yg===n?r==="scale"?PR:CR:(Yg=n||{})&&(r==="scale"?AR:RR):e.style&&!Yf(e.style[r])?ER:~r.indexOf("-")?TR:lp(e,r)},core:{_removeProperty:Hn,_getMatrix:fp}};zt.utils.checkPrefix=Ni;zt.core.getStyleSaver=Q_;(function(t,e,r,n){var s=Mt(t+","+e+","+r,function(i){ln[i]=1});Mt(e,function(i){Yt.units[i]="deg",n1[i]=1}),$r[s[13]]=t+","+e,Mt(n,function(i){var a=i.split(":");$r[a[1]]=s[a[0]]})})("x,y,z,scale,scaleX,scaleY,xPercent,yPercent","rotation,rotationX,rotationY,skewX,skewY","transform,transformOrigin,svgOrigin,force3D,smoothOrigin,transformPerspective","0:translateX,1:translateY,2:translateZ,8:rotate,8:rotationZ,8:rotateZ,9:rotateX,10:rotateY");Mt("x,y,z,top,right,bottom,left,width,height,fontSize,padding,margin,perspective",function(t){Yt.units[t]="px"});zt.registerPlugin(a1);var xl=zt.registerPlugin(a1)||zt;xl.core.Tween;const o1=({isOpen:t,onClose:e,title:r,children:n,maxWidth:s="max-w-lg"})=>{const[i,a]=P.useState(t),[o,l]=P.useState(!1),[u,c]=P.useState(!1),d=P.useRef(null),f=P.useRef(null);P.useEffect(()=>(t?(a(!0),l(!1),c(!1),document.body.style.overflow="hidden",f.current&&window.cancelAnimationFrame(f.current),f.current=window.requestAnimationFrame(()=>{c(!0)})):(document.body.style.overflow="",a(!1),l(!1),c(!1)),()=>{document.body.style.overflow=""}),[t]),P.useEffect(()=>{const g=b=>{b.key==="Escape"&&e()};return t&&window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[t,e]),P.useEffect(()=>()=>{d.current&&window.clearTimeout(d.current),f.current&&window.cancelAnimationFrame(f.current)},[]);const m=()=>{o||(l(!0),d.current&&window.clearTimeout(d.current),d.current=window.setTimeout(()=>{e()},180))};if(!t&&!i)return null;const y=P.isValidElement(n)?P.cloneElement(n,{onRequestClose:m}):n;return S.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-4",role:"dialog","aria-modal":"true","aria-label":r,children:[S.jsx("div",{className:`absolute inset-0 bg-black/50 backdrop-blur-sm transition-opacity duration-200 ease-out ${o?"opacity-0":u?"opacity-100":"opacity-0"}`,onClick:m}),S.jsxs("div",{className:`
395          relative bg-white rounded-card shadow-card-hover w-full ${s}
396          max-h-[90vh] flex flex-col transition-all duration-200 ease-out
397          ${o?"opacity-0 translate-y-2 scale-95":u?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"}
398        `,children:[S.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-gray-100",children:[S.jsx("h2",{className:"text-lg font-bold text-text",children:r}),S.jsx("button",{onClick:m,className:"p-2 rounded-btn text-text-secondary hover:text-text hover:bg-background-secondary transition-colors","aria-label":"Cerrar",children:S.jsx(Ps,{size:18})})]}),S.jsx("div",{className:"overflow-y-auto flex-1 scrollbar-thin",children:y})]})]})},BR=({promotion:t,onConfirm:e,onCancel:r,isDeleting:n})=>S.jsx(o1,{isOpen:!!t,onClose:r,title:"Eliminar promoción",children:S.jsxs("div",{className:"p-6 space-y-4",children:[S.jsxs("p",{className:"text-text-secondary",children:["¿Estás seguro que querés eliminar"," ",S.jsxs("strong",{className:"text-text",children:['"',t==null?void 0:t.t
398itle,'"']}),"? Esta acción no se puede deshacer."]}),(t==null?void 0:t.imageUrl)&&S.jsx("img",{src:Uf(t.imageUrl),alt:t.title,className:"w-full aspect-video object-cover rounded-btn"}),S.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[S.jsx(As,{variant:"danger",size:"sm",loading:n,onClick:e,children:"Sí, eliminar"}),S.jsx(As,{variant:"ghost",size:"sm",onClick:r,disabled:n,children:"Cancelar"})]})]})}),l1=P.memo(({promotion:t,onEdit:e,onDelete:r})=>{const[n,s]=P.useState(!1);return S.jsxs("div",{"data-promo-card":!0,className:"bg-white rounded-card shadow-card overflow-hidden flex flex-col",children:[S.jsxs("div",{className:"relative aspect-video bg-background-secondary overflow-hidden",children:[n?S.jsx("div",{className:"absolute inset-0 flex items-center justify-center text-text-secondary",children:S.jsx(Bf,{size:28,className:"opacity-30"})}):S.jsx("img",{src:Uf(t.imageUrl),alt:t.title,loading:"lazy",onError:()=>s(!0),className:"w-full h-full object-cover"}),S.jsx("div",{className:"absolute top-2 right-2",children:t.active?S.jsxs("span",{className:"badge-active",children:[S.jsx("span",{className:"h-2 w-2 rounded-full bg-green-500"}),"Activa"]}):S.jsxs("span",{className:"badge-inactive",children:[S.jsx(dw,{size:10}),"Inactiva"]})})]}),S.jsxs("div",{className:"p-3 flex flex-col gap-2 flex-1",children:[S.jsx("h3",{className:"font-bold text-text text-sm leading-snug line-clamp-2",children:t.title}),t.description&&S.jsx("p",{className:"text-xs text-text-secondary line-clamp-2",children:t.description}),S.jsxs("div",{className:"flex items-center gap-1 text-xs text-text-secondary mt-auto pt-1",children:[S.jsx(Tk,{size:11}),yk(t.date)]})]}),S.jsxs("div",{className:"px-3 pb-3 flex gap-2",children:[S.jsxs("button",{onClick:()=>e(t),className:`flex-1 flex items-center justify-center gap-1.5 py-2 text-xs font-semibold\r
399                     text-primary border border-primary/30 rounded-btn hover:bg-primary/5 transition-colors`,children:[S.jsx(jk,{size:12}),"Editar"]}),S.jsxs("button",{onClick:()=>r(t),className:`flex-1 flex items-center justify-center gap-1.5 py-2 text-xs font-semibold\r
400                     text-error border border-error/30 rounded-btn hover:bg-error/5 transition-colors`,children:[S.jsx(Uk,{size:12}),"Eliminar"]})]})]})});l1.displayName="PromotionListItem";const FR=({promotions:t,onEdit:e,onDelete:r,isDeleting:n,transitionKey:s})=>{const[i,a]=P.useState(null),o=P.useRef(null),l=async()=>{i&&(await r(i.id),a(null))};return P.useLayoutEffect(()=>{const u=o.current;if(!u||!t.length)return;const c=u.querySelectorAll("[data-promo-card]");xl.killTweensOf([u,c]),xl.fromTo(u,{opacity:0,y:8},{opacity:1,y:0,duration:.28,ease:"power2.out",clearProps:"opacity,transform"}),xl.fromTo(c,{opacity:0,y:14},{opacity:1,y:0,duration:.4,ease:"power2.out",stagger:.05,clearProps:"opacity,transform"})},[t,s]),t.length?S.jsxs(S.Fragment,{children:[S.jsx("div",{ref:o,className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:t.map(u=>S.jsx(l1,{promotion:u,onEdit:e,onDelete:a},u.id))}),S.jsx(BR,{promotion:i,onConfirm:l,onCancel:()=>a(null),isDeleting:n})]}):S.jsx("div",{className:"py-12 text-center text-text-secondary text-sm",children:"No hay promociones para mostrar."})};var Po=t=>t.type==="checkbox",gs=t=>t instanceof Date,ct=t=>t==null;const u1=t=>typeof t=="object";var Me=t=>!ct(t)&&!Array.isArray(t)&&u1(t)&&!gs(t),c1=t=>Me(t)&&t.target?Po(t.target)?t.target.checked:t.target.value:t,d1=(t,e)=>e.split(".").some((r,n,s)=>!isNaN(Number(r))&&t.has(s.slice(0,n).join("."))),VR=t=>{const e=t.constructor&&t.constructor.prototype;return Me(e)&&e.hasOwnProperty("isPrototypeOf")},Ju=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function ze(t){if(t instanceof Date)return new Date(t);const e=typeof FileList<"u"&&t instanceof FileList;if(Ju&&(t instanceof Blob||e))return t;const r=Array.isArray(t);if(!r&&!(Me(t)&&VR(t)))return t;const n=r?[]:Object.create(Object.getPrototypeOf(t));for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(n[s]=ze(t[s]));return n}const mn={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Cr={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},xr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Xc="form",h1="root",f1=["__proto__","constructor","prototype"];var Ao=t=>/^\w*$/.test(t),Pe=t=>t===void 0,Zu=t=>
vendor: 6,529 bytes, line 400
400t.split(/[.[\]'"]/g).filter(Boolean),H=(t,e,r)=>{if(!e||!Me(t))return r;const n=Ao(e)?[e]:Zu(e);if(n.some(i=>f1.includes(i)))return r;const s=n.reduce((i,a)=>ct(i)?void 0:i[a],t);return Pe(s)||s===t?Pe(t[e])?r:t[e]:s},Vt=t=>typeof t=="boolean",yt=t=>typeof t=="function",ye=(t,e,r)=>{let n=-1;const s=Ao(e)?[e]:Zu(e),i=s.length,a=i-1;for(;++n<i;){const o=s[n];let l=r;if(n!==a){const u=t[o];l=Me(u)||Array.isArray(u)?u:isNaN(+s[n+1])?{}:[]}if(f1.includes(o))return;t[o]=l,t=t[o]}};const p1=$.createContext(null);p1.displayName="HookFormControlContext";const pp=()=>$.useContext(p1);var m1=(t,e,r,n=!0)=>{const s={};for(const i in t)Object.defineProperty(s,i,{get:()=>{const a=i;return e._proxyFormState[a]!==Cr.all&&(e._proxyFormState[a]=!n||Cr.all),r&&(r[a]=!0),t[a]}});return s};const mp=Ju?$.useLayoutEffect:$.useEffect;function WR(t){const e=pp(),{control:r=e,disabled:n,name:s,exact:i}=t||{},[a,o]=$.useState(()=>({...r._formState,defaultValues:r._defaultValues})),l=$.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return mp(()=>r._subscribe({name:s,formState:l.current,exact:i,callback:u=>{!n&&o({...r._formState,...u,defaultValues:r._defaultValues})}}),[s,n,i]),$.useEffect(()=>{l.current.isValid&&r._setValid(!0)},[r]),$.useMemo(()=>m1(a,r,l.current,!1),[a,r])}var _t=t=>typeof t=="string",Ah=(t,e,r,n,s)=>_t(t)?(n&&e.watch.add(t),H(r,t,s)):Array.isArray(t)?t.map(i=>(n&&e.watch.add(i),H(r,i))):(n&&(e.watchAll=!0),r),Rh=t=>ct(t)||!u1(t);function Wt(t,e,r=new WeakSet){if(t===e)return!0;if(Rh(t)||Rh(e))return Object.is(t,e);if(gs(t)&&gs(e))return Object.is(t.getTime(),e.getTime());const n=Object.keys(t),s=Object.keys(e);if(n.length!==s.length)return!1;if(r.has(t)||r.has(e))return!0;r.add(t),r.add(e);for(const i of n){const a=t[i];if(!(i in e))return!1;if(i!=="ref"){const o=e[i];if(gs(a)&&gs(o)||(Me(a)||Array.isArray(a))&&(Me(o)||Array.isArray(o))?!Wt(a,o,r):!Object.is(a,o))return!1}}return!0}function HR(t){const e=pp(),{control:r=e,name:n,defaultValue:s,disabled:i,exact:a,compute:o}=t||{},l=$.useRef(s),u=$.useRef(o),c=$.useRef(void 0),d=$.useRef(r),f=$.useRef(n);u.current=o;const[m,y]=$.useState(()=>{const h=r._getWatch(n,l.current);return u.current?u.current(h):h}),g=$.useCallback(h=>{const p=Ah(n,r._names,h||r._formValues,!1,l.current);return u.current?u.current(p):p},[r._formValues,r._names,n]),b=$.useCallback(h=>{if(!i){const p=Ah(n,r._names,h||r._formValues,!1,l.current);if(u.current){const x=u.current(p);Wt(x,c.current)||(y(x),c.current=x)}else y(p)}},[r._formValues,r._names,i,n]);mp(()=>((d.current!==r||!Wt(f.current,n))&&(d.current=r,f.current=n,b()),r._subscribe({name:n,formState:{values:!0},exact:a,callback:h=>{b(h.values)}})),[r,a,n,b]),$.useEffect(()=>r._removeUnmounted());const _=d.current!==r,v=f.current,w=$.useMemo(()=>{if(i)return null;const h=!_&&!Wt(v,n);return _||h?g():null},[i,_,n,v,g]);return w!==null?w:m}function GR(t){const e=pp(),{name:r,disabled:n,control:s=e,shouldUnregister:i,defaultValue:a,exact:o=!0}=t,l=d1(s._names.array,r),u=$.useMemo(()=>H(s._formValues,r,H(s._defaultValues,r,a)),[s,r,a]),c=HR({control:s,name:r,defaultValue:u,exact:o}),d=WR({control:s,name:r,exact:o}),f=$.useRef(t),m=$.useRef(s.register(r,{...t.rules,value:c,...Vt(t.disabled)?{disabled:t.disabled}:{}}));f.current=t;const y=$.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!H(d.errors,r)},isDirty:{enumerable:!0,get:()=>!!H(d.dirtyFields,r)},isTouched:{enumerable:!0,get:()=>!!H(d.touchedFields,r)},isValidating:{enumerable:!0,get:()=>!!H(d.validatingFields,r)},error:{enumerable:!0,get:()=>H(d.errors,r)}}),[d,r]),g=$.useCallback(w=>m.current.onChange({target:{value:c1(w),name:r},type:mn.CHANGE}),[r]),b=$.useCallback(()=>m.current.onBlur({target:{value:H(s._formValues,r),name:r},type:mn.BLUR}),[r,s._formValues]),_=$.useCallback(w=>{const h=H(s._fields,r);h&&h._f&&w&&(h._f.ref={focus:()=>yt(w.focus)&&w.focus(),select:()=>yt(w.select)&&w.select(),setCustomValidity:p=>yt(w.setCustomValidity)&&w.setCustomValidity(p),reportValidity:()=>yt(w.reportValidity)&&w.reportValidity()})},[s._fields,r]),v=$.useMemo(()=>({name:r,value:c,...Vt(n)||d.disabled?{disabled:d.disabled||n}:{},onChange:g,onBlur:b,ref:_}),[r,n,d.disabled,g,b,_,c]);return $.useEffect(()=>{const w=s._options.shouldUnregister||i;s.register(r,{...f.current.rules,...Vt(f.current.disabled)?{disabled:f.current.disabled}:{}});const h=(p,x)=>{const k=H(s._fields,p);k&&k._f&&(k._f.mount=x)};if(h(r,!0),w){const p=ze(H(s._defaultValues,r,H(s._options.defaultValues,r,f.current.defaultValue)));ye(s._defaultValues,r,p),Pe(H(s._formValues,r))&&ye(s._formValues,r,p)}return!l&&s.register(r),()=>{(l?w&&!s._state.action:w)?s.unregister(r):h(r,!1)}},[r,s,l,i]),$.useEffect(()=>{s._setDisabledField({disabled:n,name:r})},[n,r,s]),$.useMemo(()=>({field:v,formState:d,fieldState:y}),[v,d,y])}const qR=t=>t.render(GR(t)),KR=$.createContext(null);KR.displayName="HookFormContext";var g1=(t,e,r,n,s)=>e?{...r[t],types:{...r[t]&&r[t].types?r[t].types:{},[n]:s||!0}}:{},v1=t=>Array.isArray(t)?t.filter(Boolean):[],bl=t=>Array.isArray(t)?t:[t],a0=()=>{let t=[];return{get observers(){return t},next:s=>{for(const i of t)i.next&&i.next(s)},subscribe:s=>(t.push(s),{unsubscribe:()=>{t=t.filter(i=>i!==s)}}),unsubscribe:()=>{t=[]}}};function y1(t,e){const r={};for(const n in t)if(t.hasOwnProperty(n)){const s=t[n],i=e[n];if(s&&Me(s)&&i){const a=y1(s,i);Me(a)&&(r[n]=a)}else t[n]&&(r[n]=i)}return r}var lt=t=>Me(t)&&!Object.keys(t).length,gp=t=>t.type==="file",vu=t=>{if(!Ju)return!1;const e=t?t.ownerDocument:0;return t instanceof(e&&e.defaultView?e.defaultView.HTMLElement:HTMLElement)},w1=t=>t.type==="select-multiple",vp=t=>t.type==="radio",JR=t=>vp(t)||Po(t),Qc=t=>vu(t)&&t.isConnected;function ZR(t,e){const r=e.slice(0,-1).length;let n=0;for(;n<r;){if(ct(t)){t=void 0;break}t=t[e[n]],n++}return t}function YR(t){for(const e in t)if(t.hasOwnProperty(e)&&!Pe(t[e]))return!1;return!0}function Je(t,e){if(_t(e)&&Object.prototype.hasOwnProperty.call(t,e))return delete t[e],t;const r=Array.isArray(e)?e:Ao(e)?[e]:Zu(e),n=r.length===1?t:ZR(t,r),s=r.length-1,i=r[s];return n&&delete n[i],s!==0&&(Me(n)&&lt(n)||Array.isArray(n)&&YR(n))&&Je(t,r.slice(0,-1)),t}var XR=t=>{for(const e in t)if(yt(t[e]))return!0;return!1};function _1(t){return Array.isArray(t)||Me(t)&&!XR(t)}function Oh(t,e={}){for(const r in t){const n=t[r];_1(n)?(e[r]=Array.isArray(n)?[]:{},Oh(n,e[r])):Pe(n)||(e[r]=!0)}return e}function Ih(t){if(t!==!1){if(t===!0)return!0;
vendor: 5,982 bytes, line 400
400if(Array.isArray(t)){const e=t.map(r=>Ih(r));return e.some(r=>r!==void 0)?e:void 0}if(Me(t)){const e={};for(const r in t){const n=Ih(t[r]);Pe(n)||(e[r]=n)}return Object.keys(e).length?e:void 0}}}function cs(t,e,r){r||(r=Oh(e));for(const n in t){const s=t[n];if(_1(s))Pe(e)||Rh(r[n])?r[n]=Oh(s,Array.isArray(s)?[]:{}):cs(s,ct(e)?{}:e[n],r[n]);else{const i=e[n];r[n]=!Wt(s,i)}}return Ih(r)||{}}const o0={value:!1,isValid:!1},l0={value:!0,isValid:!0};var x1=t=>{if(Array.isArray(t)){if(t.length>1){const e=t.filter(r=>r&&r.checked&&!r.disabled).map(r=>r.value);return{value:e,isValid:!!e.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!Pe(t[0].attributes.value)?Pe(t[0].value)||t[0].value===""?l0:{value:t[0].value,isValid:!0}:l0:o0}return o0},b1=(t,{valueAsNumber:e,valueAsDate:r,setValueAs:n})=>Pe(t)?t:e?t===""?NaN:t&&+t:r&&_t(t)?new Date(t):n?n(t):t;const u0={isValid:!1,value:null};var S1=t=>Array.isArray(t)?t.reduce((e,r)=>r&&r.checked&&!r.disabled?{isValid:!0,value:r.value}:e,u0):u0;function c0(t){const e=t.ref;return gp(e)?e.files:vp(e)?S1(t.refs).value:w1(e)?[...e.selectedOptions].map(({value:r})=>r):Po(e)?x1(t.refs).value:b1(Pe(e.value)?t.ref.value:e.value,t)}var QR=(t,e,r,n)=>{const s={};for(const i of t){const a=H(e,i);a&&ye(s,i,a._f)}return{criteriaMode:r,names:[...t],fields:s,shouldUseNativeValidation:n}},yu=t=>t instanceof RegExp,ra=t=>Pe(t)?t:yu(t)?t.source:Me(t)?yu(t.value)?t.value.source:t.value:t,d0=t=>({isOnSubmit:!t||t===Cr.onSubmit,isOnBlur:t===Cr.onBlur,isOnChange:t===Cr.onChange,isOnAll:t===Cr.all,isOnTouch:t===Cr.onTouched});const h0="AsyncFunction";var e3=t=>!!t&&!!t.validate&&!!(yt(t.validate)&&t.validate.constructor.name===h0||Me(t.validate)&&Object.values(t.validate).find(e=>e.constructor.name===h0)),t3=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),f0=(t,e,r)=>!r&&(e.watchAll||e.watch.has(t)||[...e.watch].some(n=>t.startsWith(`${n}.`)));const Ia=(t,e,r,n)=>{for(const s of r||Object.keys(t)){const i=H(t,s);if(i){const{_f:a,...o}=i;if(a){if(a.refs&&a.refs[0]&&e(a.refs[0],s)&&!n)return!0;if(a.ref&&e(a.ref,a.name)&&!n)return!0;if(Ia(o,e))break}else if(Me(o)&&Ia(o,e))break}}};function p0(t,e,r){const n=H(t,r);if(n||Ao(r))return{error:n,name:r};const s=r.split(".");for(;s.length;){const i=s.join("."),a=H(e,i),o=H(t,i);if(a&&!Array.isArray(a)&&r!==i)return{name:r};if(o&&o.type)return{name:i,error:o};if(o&&o.root&&o.root.type)return{name:`${i}.root`,error:o.root};s.pop()}return{name:r}}var r3=(t,e,r,n)=>{r(t);const{name:s,...i}=t;return lt(i)||n&&Object.keys(i).length>=Object.keys(e).length||Object.keys(i).find(a=>e[a]===(!n||Cr.all))},n3=(t,e,r)=>!t||!e||t===e||bl(t).some(n=>n&&(r?n===e:n.startsWith(e)||e.startsWith(n))),s3=(t,e,r,n,s)=>s.isOnAll?!1:!r&&s.isOnTouch?!(e||t):(r?n.isOnBlur:s.isOnBlur)?!t:(r?n.isOnChange:s.isOnChange)?t:!0,i3=(t,e)=>!v1(H(t,e)).length&&Je(t,e),m0=(t,e,r)=>{const n=H(t,r),s=Array.isArray(n)?n:[];return ye(s,h1,e[r]),ye(t,r,s),t};function g0(t,e,r="validate"){if(_t(t)||Array.isArray(t)&&t.every(_t)||Vt(t)&&!t)return{type:r,message:_t(t)?t:"",ref:e}}var Vs=t=>Me(t)&&!yu(t)?t:{value:t,message:""},v0=async(t,e,r,n,s,i)=>{const{ref:a,refs:o,required:l,maxLength:u,minLength:c,min:d,max:f,pattern:m,validate:y,name:g,valueAsNumber:b,mount:_}=t._f,v=H(r,g);if(!_||e.has(g))return{};const w=o?o[0]:a,h=L=>{s&&w.reportValidity&&(w.setCustomValidity(Vt(L)?"":L||""),w.reportValidity())},p={},x=vp(a),k=Po(a),T=x||k,E=(b||gp(a))&&Pe(a.value)&&Pe(v)||vu(a)&&a.value===""||v===""||Array.isArray(v)&&!v.length,R=g1.bind(null,g,n,p),j=(L,O,N,M=xr.maxLength,X=xr.minLength)=>{const q=L?O:N;p[g]={type:L?M:X,message:q,ref:a,...R(L?M:X,q)}};if(i?!Array.isArray(v)||!v.length:l&&(!T&&(E||ct(v))||Vt(v)&&!v||k&&!x1(o).isValid||x&&!S1(o).isValid)){const{value:L,message:O}=_t(l)?{value:!!l,message:l}:Vs(l);if(L&&(p[g]={type:xr.required,message:O,ref:w,...R(xr.required,O)},!n))return h(O),p}if(!E&&(!ct(d)||!ct(f))){let L,O;const N=Vs(f),M=Vs(d);if(!ct(v)&&!isNaN(v)){const X=a.valueAsNumber||v&&+v;ct(N.value)||(L=X>N.value),ct(M.value)||(O=X<M.value)}else{const X=a.valueAsDate||new Date(v),q=U=>new Date(new Date().toDateString()+" "+U),D=a.type=="time",K=a.type=="week";_t(N.value)&&v&&(L=D?q(v)>q(N.value):K?v>N.value:X>new Date(N.value)),_t(M.value)&&v&&(O=D?q(v)<q(M.value):K?v<M.value:X<new Date(M.value))}if((L||O)&&(j(!!L,N.message,M.message,xr.max,xr.min),!n))return h(p[g].message),p}if((u||c)&&!E&&(_t(v)||i&&Array.isArray(v))){const L=Vs(u),O=Vs(c),N=!ct(L.value)&&v.length>+L.value,M=!ct(O.value)&&v.length<+O.value;if((N||M)&&(j(N,L.message,O.message),!n))return h(p[g].message),p}if(m&&!E&&_t(v)){const{value:L,message:O}=Vs(m);if(yu(L)&&!v.match(L)&&(p[g]={type:xr.pattern,message:O,ref:a,...R(xr.pattern,O)},!n))return h(O),p}if(y){if(yt(y)){const L=await y(v,r),O=g0(L,w);if(O&&(p[g]={...O,...R(xr.validate,O.message)},!n))return h(O.message),p}else if(Me(y)){let L={};for(const O in y){if(!lt(L)&&!n)break;const N=g0(await y[O](v,r),w,O);N&&(L={...N,...R(O,N.message)},h(N.message),n&&(p[g]=L))}if(!lt(L)&&(p[g]={ref:w,...L},!n))return p}}return h(!0),p};const a3={mode:Cr.onSubmit,reValidateMode:Cr.onChange,shouldFocusError:!0},k1={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function o3(t={}){let e={...a3,...t},r={...ze(k1),isLoading:yt(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1},n={},s=Me(e.defaultValues)||Me(e.values)?ze(e.defaultValues||e.values)||{}:{},i=e.shouldUnregister?{}:ze(s),a={action:!1,mount:!1,watch:!1,keepIsValid:!1},o={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},l,u=0;const c={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},d={...c};let f={...d};const m={array:a0(),state:a0()},y=e.criteriaMode===Cr.all,g=C=>A=>{clearTimeout(u),u=setTimeout(C,A)},b=async C=>
400{if(!a.keepIsValid&&!e.disabled&&(d.isValid||f.isValid||C)){let A;e.resolver?(A=lt((await R()).errors),_()):A=await O({fields:n,onlyCheckValid:!0,eventType:mn.VALID}),A!==r.isValid&&m.state.next({isValid:A})}},_=(C,A)=>{!e.disabled&&(d.isValidating||d.validatingFields||f.isValidating||f.validatingFields)&&((C||Array.from(o.mount)).forEach(I=>{I&&(A?ye(r.validatingFields,I,A):Je(r.validatingFields,I))}),m.state.next({validatingFields:r.validatingFields,isValidating:!lt(r.validatingFields)}))},v=()=>{r.dirtyFields=cs(s,i)},w=(C,A=[],I,F,G=!0,Z=!0)=>{if(F&&I&&!e.disabled){if(a.action=!0,Z&&Array.isArray(H(n,C))){const V=I(H(n,C),F.argA,F.argB);G&&ye(n,C,V)}if(Z&&Array.isArray(H(r.errors,C))){const V=I(H(r.errors,C),F.argA,F.argB);G&&ye(r.errors,C,V),i3(r.errors,C)}if((d.touchedFields||f.touchedFields)&&Z&&Array.isArray(H(r.touchedFields,C))){const V=I(H(r.touchedFields,C),F.argA,F.argB);G&&ye(r.touchedFields,C,V)}(d.dirtyFields||f.dirtyFields)&&v(),m.state.next({name:C,isDirty:M(C,A),dirtyFields:r.dirtyFields,errors:r.errors,isValid:r.isValid})}else ye(i,C,A)},h=(C,A)=>{ye(r.errors,C,A),m.state.next({errors:r.errors})},p=C=>{r.errors=C,m.state.next({errors:r.errors,isValid:!1})},x=C=>{const A=Ao(C)?[C]:Zu(C);let I=i,F=s;for(let G=0;G<A.length-1;G++){const Z=A[G];if(I=ct(I)?I:I[Z],F=ct(F)?F:F[Z],I===null&&F!==null)return!0}return!1},k=(C,A,I,F)=>{const G=H(n,C);if(G){if(x(C))return;const Z=Pe(H(i,C)),V=H(i,C,Pe(I)?H(s,C):I);Pe(V)||F&&F.defaultChecked||A?ye(i,C,A?V:c0(G._f)):D(C,V),a.mount&&!a.action&&(b(),Z&&r.isDirty&&(d.isDirty||f.isDirty)&&(M()||(r.isDirty=!1,m.state.next({...r}))))}},T=(C,A,I,F,G)=>{let Z=!1,V=!1;const se={name:C};if(!e.disabled){if(!I||F){(d.isDirty||f.isDirty)&&(V=r.isDirty,r.isDirty=se.isDirty=M(),Z=V!==se.isDirty);const fe=Wt(H(s,C),A);V=!!H(r.dirtyFields,C),fe!==r.isDirty?r.dirtyFields=cs(s,i):fe?Je(r.dirtyFields,C):ye(r.dirtyFields,C,!0),se.dirtyFields=r.dirtyFields,Z=Z||(d.dirtyFields||f.dirtyFields)&&V!==!fe}if(I){const fe=H(r.touchedFields,C);fe||(ye(r.touchedFields,C,I),se.touchedFields=r.touchedFields,Z=Z||(d.touchedFields||f.touchedFields)&&fe!==I)}Z&&G&&m.state.next(se)}return Z?se:{}},E=(C,A,I,F)=>{const G=H(r.errors,C),Z=(d.isValid||f.isValid)&&Vt(A)&&r.isValid!==A;if(e.delayError&&I?(l=g(()=>h(C,I)),l(e.delayError)):(clearTimeout(u),l=null,I?ye(r.errors,C,I):Je(r.errors,C)),(I?!Wt(G,I):G)||!lt(F)||Z){const V={...F,...Z&&Vt(A)?{isValid:A}:{},errors:r.errors,name:C};r={...r,...V},m.state.next(V)}},R=async C=>(_(C,!0),await e.resolver(i,e.context,QR(C||o.mount,n,e.criteriaMode,e.shouldUseNativeValidation))),j=async C=>{const{errors:A}=await R(C);if(_(C),C)for(const I of C){const F=H(A,I);F?o.array.has(I)&&Me(F)&&!Object.keys(F).some(G=>!Number.isNaN(Number(G)))?m0(r.errors,{[I]:F},I):ye(r.errors,I,F):Je(r.errors,I)}else r.errors=A;return A},L=async({name:C,eventType:A})=>
vendor: 4,201 bytes, line 400
400{if(t.validate){const I=await t.validate({formValues:i,formState:r,name:C,eventType:A});if(Me(I))for(const F in I){const G=I[F];G&&et(`${Xc}.${F}`,{message:_t(G.message)?G.message:"",type:G.type||xr.validate})}else _t(I)||!I?et(Xc,{message:I||"",type:xr.validate}):we(Xc);return I}return!0},O=async({fields:C,onlyCheckValid:A,name:I,eventType:F,context:G={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(G.runRootValidation=!0,!await L({name:I,eventType:F})&&(G.valid=!1,A)))return G.valid;for(const Z in C){const V=C[Z];if(V){const{_f:se,...fe}=V;if(se){const Ke=o.array.has(se.name),sr=V._f&&e3(V._f),vr=d.validatingFields||d.isValidating||f.validatingFields||f.isValidating;sr&&vr&&_([se.name],!0);const ts=await v0(V,o.disabled,i,y,e.shouldUseNativeValidation&&!A,Ke);if(sr&&vr&&_([se.name]),ts[se.name]&&(G.valid=!1,A)||(!A&&(H(ts,se.name)?Ke?m0(r.errors,ts,se.name):ye(r.errors,se.name,ts[se.name]):Je(r.errors,se.name)),t.shouldUseNativeValidation&&ts[se.name]))break}!lt(fe)&&await O({context:G,onlyCheckValid:A,fields:fe,name:Z,eventType:F})}}return G.valid},N=()=>{for(const C of o.unMount){const A=H(n,C);A&&(A._f.refs?A._f.refs.every(I=>!Qc(I)):!Qc(A._f.ref))&&Yu(C)}o.unMount=new Set},M=(C,A)=>!e.disabled&&(C&&A&&ye(i,C,A),!Wt(nt(),s)),X=(C,A,I)=>Ah(C,o,{...a.mount?i:Pe(A)?s:_t(C)?{[C]:A}:A},I,A),q=C=>v1(H(a.mount?i:s,C,e.shouldUnregister?H(s,C,[]):[])),D=(C,A,I={},F=!1)=>{const G=H(n,C);let Z=A;if(G){const V=G._f;V&&(!V.disabled&&ye(i,C,b1(A,V)),Z=vu(V.ref)&&ct(A)?"":A,w1(V.ref)?[...V.ref.options].forEach(se=>se.selected=Z.includes(se.value)):V.refs?Po(V.ref)?V.refs.forEach(se=>{(!se.defaultChecked||!se.disabled)&&(Array.isArray(Z)?se.checked=!!Z.find(fe=>fe===se.value):se.checked=Z===se.value||!!Z)}):V.refs.forEach(se=>se.checked=se.value===Z):gp(V.ref)?V.ref.value="":(V.ref.value=Z,V.ref.type||m.state.next({name:C,values:F?i:ze(i)})))}(I.shouldDirty||I.shouldTouch)&&T(C,Z,I.shouldTouch,I.shouldDirty,!0),I.shouldValidate&&xe(C)},K=(C,A,I,F=!1)=>{for(const G in A){if(!A.hasOwnProperty(G))return;const Z=A[G],V=C+"."+G,se=H(n,V);(o.array.has(C)||Me(Z)||se&&!se._f)&&!gs(Z)?K(V,Z,I,F):D(V,Z,I,F)}},U=(C,A,I,F)=>{const G=H(n,C),Z=o.array.has(C),V=F?A:ze(A),se=H(i,C),fe=Wt(se,V);if(fe||ye(i,C,V),Z)m.array.next({name:C,values:F?i:ze(i)}),(d.isDirty||d.dirtyFields||f.isDirty||f.dirtyFields)&&I.shouldDirty&&(v(),m.state.next({name:C,dirtyFields:r.dirtyFields,isDirty:M(C,V)}));else{const Ke=Array.isArray(V)&&!V.length||lt(V);!G||G._f||ct(V)||Ke?D(C,V,I,F):K(C,V,I,F)}if(!fe){const Ke=f0(C,o),sr=F?i:ze(i);m.state.next({...Ke&&r,name:a.mount||Ke?C:void 0,values:sr})}},W=(C,A,I={})=>U(C,A,I,!1),re=(C,A={})=>{const I=yt(C)?C(i):C;if(!Wt(i,I)){i={...i,...I};for(const F of o.mount)U(F,H(I,F),A,!0);m.state.next({...r,name:void 0,type:void 0,values:i}),A.shouldValidate&&b()}},oe=async C=>{a.mount=!0;const A=C.target;let I=A.name,F=!0;const G=H(n,I),Z=fe=>{F=Number.isNaN(fe)||gs(fe)&&isNaN(fe.getTime())||Wt(fe,H(i,I,fe))},V=d0(e.mode),se=d0(e.reValidateMode);if(G){let fe,Ke;const sr=A.type?c0(G._f):c1(C),vr=C.type===mn.BLUR||C.type===mn.FOCUS_OUT,ts=!t3(G._f)&&!t.validate&&!e.resolver&&!H(r.errors,I)&&!G._f.deps||s3(vr,H(r.touchedFields,I),r.isSubmitted,se,V),ec=f0(I,o,vr);ye(i,I,sr),vr?(!A||!A.readOnly)&&(G._f.onBlur&&G._f.onBlur(C),l&&l(0)):G._f.onChange&&G._f.onChange(C);const tc=T(I,sr,vr),j1=!lt(tc)||ec;if(!vr&&m.state.next({name:I,type:C.type,values:ze(i)}),ts)return(d.isValid||f.isValid)&&(e.mode==="onBlur"?vr&&b():vr||b()),j1&&m.state.next({name:I,...ec?{}:tc});if(!e.resolver&&t.validate&&await L({name:I,eventType:C.type}),!vr&&ec&&m.state.next({...r}),e.resolver){const{errors:Ep}=await R([I]);if(_([I]),Z(sr),F){const M1=p0(r.errors,n,I),Tp=p0(Ep,n,M1.name||I);fe=Tp.error,I=Tp.name,Ke=lt(Ep)}}else _([I],!0),fe=(await v0(G,o.disabled,i,y,e.shouldUseNativeValidation))[I],_([I]),Z(sr),F&&(fe?Ke=!1:(d.isValid||f.isValid)&&(Ke=await O({fields:n,onlyCheckValid:!0,name:I,eventType:C.type})));F&&(G._f.deps&&(!Array.isArray(G._f.deps)||G._f.deps.length>0)&&xe(G._f.deps),E(I,Ke,fe,tc))}},ce=(C,A)=>{if(H(r.errors,A)&&C.focus)return C.focus(),1},xe=async(C,A={})=>{let I,F;const G=bl(C);if(e.resolver){const Z=await j(Pe(C)?C:G);I=lt(Z),F=C?!G.some(V=>
vendor: 5,938 bytes, line 400
400H(Z,V)):I}else C?(F=(await Promise.all(G.map(async Z=>{const V=H(n,Z);return await O({fields:V&&V._f?{[Z]:V}:V,eventType:mn.TRIGGER})}))).every(Boolean),!(!F&&!r.isValid)&&b()):F=I=await O({fields:n,name:C,eventType:mn.TRIGGER});return m.state.next({...!_t(C)||(d.isValid||f.isValid)&&I!==r.isValid?{}:{name:C},...e.resolver||!C?{isValid:I}:{},errors:r.errors}),A.shouldFocus&&!F&&Ia(n,ce,C?G:o.mount),F},nt=(C,A)=>{let I={...a.mount?i:s};return A&&(I=y1(A.dirtyFields?r.dirtyFields:r.touchedFields,I)),Pe(C)?I:_t(C)?H(I,C):C.map(F=>H(I,F))},ae=(C,A)=>({invalid:!!H((A||r).errors,C),isDirty:!!H((A||r).dirtyFields,C),error:H((A||r).errors,C),isValidating:!!H(r.validatingFields,C),isTouched:!!H((A||r).touchedFields,C)}),we=C=>{const A=C?bl(C):void 0;A==null||A.forEach(I=>Je(r.errors,I)),A?A.forEach(I=>{m.state.next({name:I,errors:r.errors})}):m.state.next({errors:{}})},et=(C,A,I)=>{const F=(H(n,C,{_f:{}})._f||{}).ref,G=H(r.errors,C)||{},{ref:Z,message:V,type:se,...fe}=G;ye(r.errors,C,{...fe,...A,ref:F}),m.state.next({name:C,errors:r.errors,isValid:!1}),I&&I.shouldFocus&&F&&F.focus&&F.focus()},gr=(C,A)=>yt(C)?m.state.subscribe({next:I=>"values"in I&&C(I.values||X(void 0,A),I)}):X(C,A,!0),Wi=C=>m.state.subscribe({next:A=>{if(n3(C.name,A.name,C.exact)&&r3(A,C.formState||d,L1,C.reRenderRoot)){const I={...i};C.callback({values:I,...r,...A,defaultValues:s})}}}).unsubscribe,R1=C=>(a.mount=!0,f={...f,...C.formState},Wi({...C,formState:{...c,...C.formState}})),Yu=(C,A={})=>{for(const I of C?bl(C):o.mount)o.mount.delete(I),o.array.delete(I),A.keepValue||(Je(n,I),Je(i,I)),!A.keepError&&Je(r.errors,I),!A.keepDirty&&Je(r.dirtyFields,I),!A.keepTouched&&Je(r.touchedFields,I),!A.keepIsValidating&&Je(r.validatingFields,I),!e.shouldUnregister&&!A.keepDefaultValue&&Je(s,I);m.state.next({values:ze(i)}),m.state.next({...r,...A.keepDirty?{isDirty:M()}:{}}),!A.keepIsValid&&b()},_p=({disabled:C,name:A})=>{if(Vt(C)&&a.mount||C||o.disabled.has(A)){const G=o.disabled.has(A)!==!!C;C?o.disabled.add(A):o.disabled.delete(A),G&&a.mount&&!a.action&&b()}},Xu=(C,A={})=>{let I=H(n,C);const F=Vt(A.disabled)||Vt(e.disabled),G=!o.registerName.has(C)&&I&&I._f&&!I._f.mount;return ye(n,C,{...I||{},_f:{...I&&I._f?I._f:{ref:{name:C}},name:C,mount:!0,...A}}),o.mount.add(C),I&&!G?_p({disabled:Vt(A.disabled)?A.disabled:e.disabled,name:C}):k(C,!0,A.value),{...F?{disabled:A.disabled||e.disabled}:{},...e.progressive?{required:!!A.required,min:ra(A.min),max:ra(A.max),minLength:ra(A.minLength),maxLength:ra(A.maxLength),pattern:ra(A.pattern)}:{},name:C,onChange:oe,onBlur:oe,ref:Z=>{if(Z){o.registerName.add(C),Xu(C,A),o.registerName.delete(C),I=H(n,C);const V=Pe(Z.value)&&Z.querySelectorAll&&Z.querySelectorAll("input,select,textarea")[0]||Z,se=JR(V),fe=I._f.refs||[];if(se?fe.find(Ke=>Ke===V):V===I._f.ref)return;ye(n,C,{_f:{...I._f,...se?{refs:[...fe.filter(Qc),V,...Array.isArray(H(s,C))?[{}]:[]],ref:{type:V.type,name:C}}:{ref:V}}}),k(C,!1,void 0,V)}else I=H(n,C,{}),I._f&&(I._f.mount=!1),(e.shouldUnregister||A.shouldUnregister)&&!(d1(o.array,C)&&a.action)&&o.unMount.add(C)}}},Qu=()=>e.shouldFocusError&&!e.shouldUseNativeValidation&&Ia(n,ce,o.mount),O1=C=>{Vt(C)&&(m.state.next({disabled:C}),Ia(n,(A,I)=>{const F=H(n,I);F&&(A.disabled=F._f.disabled||C,Array.isArray(F._f.refs)&&F._f.refs.forEach(G=>{G.disabled=F._f.disabled||C}))},0,!1))},xp=(C,A)=>async I=>{let F;I&&(I.preventDefault&&I.preventDefault(),I.persist&&I.persist());let G=ze(i);if(m.state.next({isSubmitting:!0}),e.resolver){const{errors:Z,values:V}=await R();_(),r.errors=Z,G=ze(V)}else await O({fields:n,eventType:mn.SUBMIT});if(o.disabled.size)for(const Z of o.disabled)Je(G,Z);if(Je(r.errors,h1),lt(r.errors)){m.state.next({errors:{}});try{await C(G,I)}catch(Z){F=Z}}else A&&await A({...r.errors},I),Qu(),setTimeout(Qu);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:lt(r.errors)&&!F,submitCount:r.submitCount+1,errors:r.errors}),F)throw F},I1=(C,A={})=>{H(n,C)&&(Pe(A.defaultValue)?W(C,ze(H(s,C))):(W(C,A.defaultValue),ye(s,C,ze(A.defaultValue))),A.keepTouched||Je(r.touchedFields,C),A.keepDirty||(Je(r.dirtyFields,C),r.isDirty=A.defaultValue?M(C,ze(H(s,C))):M()),A.keepError||(Je(r.errors,C),d.isValid&&b()),m.state.next({...r}))},bp=(C,A={})=>{const I=C?ze(C):s,F=ze(I),G=lt(C),Z=F;if(A.keepDefaultValues||(s=I),!A.keepValues){if(A.keepDirtyValues){const V=new Set([...o.mount,...Object.keys(cs(s,i))]);for(const se of Array.from(V)){const fe=H(r.dirtyFields,se),Ke=H(i,se),sr=H(Z,se);fe&&!Pe(Ke)?ye(Z,se,Ke):!fe&&!Pe(sr)&&W(se,sr)}}else{if(Ju&&Pe(C))for(const V of o.mount){const se=H(n,V);if(se&&se._f){const fe=Array.isArray(se._f.refs)?se._f.refs[0]:se._f.ref;if(vu(fe)){const Ke=fe.closest("form");if(Ke){Ke.reset();break}}}}if(A.keepFieldsRef)for(const V of o.mount)W(V,H(Z,V));else n={}}if(e.shouldUnregister){if(i=A.keepDefaultValues?ze(s):{},A.keepFieldsRef)for(const V of o.mount)ye(i,V,H(Z,V))}else i=ze(Z);m.array.next({values:{...Z}}),m.state.next({values:{...Z}})}o={mount:A.keepDirtyValues?o.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},a.mount=!d.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!e.shouldUnregister&&!lt(Z),a.watch=!!e.shouldUnregister,a.keepIsValid=!!A.keepIsValid,a.action=!1,A.keepErrors||(r.errors={}),m.state.next({submitCount:A.keepSubmitCount?r.submitCount:0,isDirty:G?!1:A.keepDirty?r.isDirty:A.keepValues?M():!!(A.keepDefaultValues&&!Wt(C,s)),isSubmitted:A.keepIsSubmitted?r.isSubmitted:!1,dirtyFields:G?{}:A.keepDirtyValues?A.keepDefaultValues&&i?cs(s,i):r.dirtyFields:A.keepDefaultValues&&C?cs(s,C):A.keepDirty?r.dirtyFields:{},touchedFields:A.keepTouched?r.touchedFields:{},errors:A.keepErrors?r.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?r.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:s})},Sp=(C,A)=>bp(yt(C)?C(i):C,{...e.resetOptions,...A}),N1=(C,A={})=>{const I=H(n,C),F=I&&I._f;if(F){const G=F.refs?F.refs[0]:F.ref;
400G.focus&&setTimeout(()=>{G.focus(),A.shouldSelect&&yt(G.select)&&G.select()})}},L1=C=>{r={...r,...C}},kp={control:{register:Xu,unregister:Yu,getFieldState:ae,handleSubmit:xp,setError:et,_subscribe:Wi,_runSchema:R,_updateIsValidating:_,_focusError:Qu,_getWatch:X,_getDirty:M,_setValid:b,_setFieldArray:w,_setDisabledField:_p,_setErrors:p,_getFieldArray:q,_reset:bp,_resetDefaultValues:()=>yt(e.defaultValues)&&e.defaultValues().then(C=>{Sp(C,e.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:N,_disableForm:O1,_subjects:m,_proxyFormState:d,get _fields(){return n},get _formValues(){return i},get _state(){return a},set _state(C){a=C},get _defaultValues(){return s},get _names(){return o},set _names(C){o=C},get _formState(){return r},get _options(){return e},set _options(C){e={...e,...C}}},subscribe:R1,trigger:xe,register:Xu,handleSubmit:xp,watch:gr,setValue:W,setValues:re,getValues:nt,reset:Sp,resetField:I1,resetDefaultValues:(C,A={})=>{if(s=ze(C),!A.keepDirty){const I=cs(s,i);r.dirtyFields=I,r.isDirty=!lt(I)}A.keepIsValid||b(),m.state.next({...r,defaultValues:s})},clearErrors:we,unregister:Yu,setError:et,setFocus:N1,getFieldState:ae};return{...kp,formControl:kp}}function l3(t={}){const e=$.useRef(void 0),r=$.useRef(void 0),[n,s]=$.useState(()=>({...ze(k1),isLoading:yt(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:yt(t.defaultValues)?void 0:t.defaultValues}));if(!e.current)if(t.formControl)e.current={...t.formControl,formState:n},t.defaultValues&&!yt(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:a,...o}=o3(t);e.current={...o,formState:n}}const i=e.current.control;return i._options=t,mp(()=>{const a=i._subscribe({formState:i._proxyFormState,callback:()=>s({...i._formState,defaultValues:i._defaultValues}),reRenderRoot:!0});return s(o=>({...o,isReady:!0})),i._formState.isReady=!0,a},[i]),$.useEffect(()=>i._disableForm(t.disabled),[i,t.disabled]),$.useEffect(()=>{t.mode&&(i._options.mode=t.mode),t.reValidateMode&&(i._options.reValidateMode=t.reValidateMode)},[i,t.mode,t.reValidateMode]),$.useEffect(()=>{t.errors&&(i._setErrors(t.errors),i._focusError())},[i,t.errors]),$.useEffect(()=>{t.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,t.shouldUnregister]),$.useEffect(()=>{if(i._proxyFormState.isDirty){const a=i._getDirty();a!==n.isDirty&&i._subjects.state.next({isDirty:a})}},[i,n.isDirty]),$.useEffect(()=>{var a;t.values&&!Wt(t.values,r.current)?(i._reset(t.values,{keepFieldsRef:!0,...i._options.resetOptions}),!((a=i._options.resetOptions)===null||a===void 0)&&a.keepIsValid||i._setValid(),r.current=t.values,s(o=>({...o}))):i._resetDefaultValues()},[i,t.values]),$.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),e.current.formState=$.useMemo(()=>m1(n,i),[i,n]),e.current}const y0=(t,e,r)=>{if(t&&"reportValidity"in t){const n=H(r,e);t.setCustomValidity(n&&n.message||""),t.reportValidity()}},E1=(t,e)=>{for(const r in e.fields){const n=e.fields[r];n&&n.ref&&"reportValidity"in n.ref?y0(n.ref,r,t):n.refs&&n.refs.forEach(s=>y0(s,r,t))}},u3=(t,e)=>{e.shouldUseNativeValidation&&E1(t,e);const r={};for(const n in t){const s=H(e.fields,n),i=Object.assign(t[n]||{},{ref:s&&s.ref});if(c3(e.names||Object.keys(t),n)){const a=Object.assign({},H(r,n));ye(a,"root",i),ye(r,n,a)}else ye(r,n,i)}return r},c3=(t,e)=>t.some(r=>r.startsWith(e+"."));var d3=function(t,e){for(var r={};t.length;){var n=t[0],s=n.code,i=n.message,a=n.path.join(".");if(!r[a])if("unionErrors"in n){var o=n.unionErrors[0].errors[0];r[a]={message:o.message,type:o.code}}else r[a]={message:i,type:s};if("unionErrors"in n&&n.unionErrors.forEach(function(c){return c.errors.forEach(function(d){return t.push(d)})}),e){var l=r[a].types,u=l&&l[n.code];r[a]=g1(a,e,r,s,u?[].concat(u,n.message):n.message)}t.shift()}return r},h3=function(t,e,r){return r===void 0&&(r={}),function(n,s,i){try{return Promise.resolve(function(a,o){try{var l=Promise.resolve(t[r.mode==="sync"?"parse":"parseAsync"](n,e)).then(function(u){return i.shouldUseNativeValidation&&E1({},i),{errors:{},values:r.raw?n:u}})}catch(u){return o(u)}return l&&l.then?l.then(void 0,o):l}
vendor: 1,958 bytes, line 400
400(0,function(a){if(function(o){return Array.isArray(o==null?void 0:o.errors)}(a))return{values:{},errors:u3(d3(a.errors,!i.shouldUseNativeValidation&&i.criteriaMode==="all"),i)};throw a}))}catch(a){return Promise.reject(a)}}},ve;(function(t){t.assertEqual=s=>{};function e(s){}t.assertIs=e;function r(s){throw new Error}t.assertNever=r,t.arrayToEnum=s=>{const i={};for(const a of s)i[a]=a;return i},t.getValidEnumValues=s=>{const i=t.objectKeys(s).filter(o=>typeof s[s[o]]!="number"),a={};for(const o of i)a[o]=s[o];return t.objectValues(a)},t.objectValues=s=>t.objectKeys(s).map(function(i){return s[i]}),t.objectKeys=typeof Object.keys=="function"?s=>Object.keys(s):s=>{const i=[];for(const a in s)Object.prototype.hasOwnProperty.call(s,a)&&i.push(a);return i},t.find=(s,i)=>{for(const a of s)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?s=>Number.isInteger(s):s=>typeof s=="number"&&Number.isFinite(s)&&Math.floor(s)===s;function n(s,i=" | "){return s.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(s,i)=>typeof i=="bigint"?i.toString():i})(ve||(ve={}));var w0;(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(w0||(w0={}));const te=ve.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),gn=t=>{switch(typeof t){case"undefined":return te.undefined;case"string":return te.string;case"number":return Number.isNaN(t)?te.nan:te.number;case"boolean":return te.boolean;case"function":return te.function;case"bigint":return te.bigint;case"symbol":return te.symbol;case"object":return Array.isArray(t)?te.array:t===null?te.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?te.promise:typeof Map<"u"&&t instanceof Map?te.map:typeof Set<"u"&&t instanceof Set?te.set:typeof Date<"u"&&t instanceof Date?te.date:te.object;default:return te.unknown}}
vendor: 5,706 bytes, line 400
400,B=ve.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class un extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};const r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){const r=e||function(i){return i.message},n={_errors:[]},s=i=>{for(const a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(s);else if(a.code==="invalid_return_type")s(a.returnTypeError);else if(a.code==="invalid_arguments")s(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let o=n,l=0;for(;l<a.path.length;){const u=a.path[l];l===a.path.length-1?(o[u]=o[u]||{_errors:[]},o[u]._errors.push(r(a))):o[u]=o[u]||{_errors:[]},o=o[u],l++}}};return s(this),n}static assert(e){if(!(e instanceof un))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ve.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){const r={},n=[];for(const s of this.issues)if(s.path.length>0){const i=s.path[0];r[i]=r[i]||[],r[i].push(e(s))}else n.push(e(s));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}}un.create=t=>new un(t);const Nh=(t,e)=>{let r;switch(t.code){case B.invalid_type:t.received===te.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case B.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,ve.jsonStringifyReplacer)}`;break;case B.unrecognized_keys:r=`Unrecognized key(s) in object: ${ve.joinValues(t.keys,", ")}`;break;case B.invalid_union:r="Invalid input";break;case B.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${ve.joinValues(t.options)}`;break;case B.invalid_enum_value:r=`Invalid enum value. Expected ${ve.joinValues(t.options)}, received '${t.received}'`;break;case B.invalid_arguments:r="Invalid function arguments";break;case B.invalid_return_type:r="Invalid function return type";break;case B.invalid_date:r="Invalid date";break;case B.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:ve.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case B.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case B.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case B.custom:r="Invalid input";break;case B.invalid_intersection_types:r="Intersection results could not be merged";break;case B.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case B.not_finite:r="Number must be finite";break;default:r=e.defaultError,ve.assertNever(t)}return{message:r}};let f3=Nh;function p3(){return f3}const m3=t=>{const{data:e,path:r,errorMaps:n,issueData:s}=t,i=[...r,...s.path||[]],a={...s,path:i};if(s.message!==void 0)return{...s,path:i,message:s.message};let o="";const l=n.filter(u=>!!u).slice().reverse();for(const u of l)o=u(a,{data:e,defaultError:o}).message;return{...s,path:i,message:o}};function Y(t,e){const r=p3(),n=m3({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===Nh?void 0:Nh].filter(s=>!!s)});t.common.issues.push(n)}class tr{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){const n=[];for(const s of r){if(s.status==="aborted")return le;s.status==="dirty"&&e.dirty(),n.push(s.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){const n=[];for(const s of r){const i=await s.key,a=await s.value;n.push({key:i,value:a})}return tr.mergeObjectSync(e,n)}static mergeObjectSync(e,r){const n={};for(const s of r){const{key:i,value:a}=s;
vendor: 28,128 bytes, line 400
400if(i.status==="aborted"||a.status==="aborted")return le;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||s.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}}const le=Object.freeze({status:"aborted"}),fa=t=>({status:"dirty",value:t}),mr=t=>({status:"valid",value:t}),_0=t=>t.status==="aborted",x0=t=>t.status==="dirty",Li=t=>t.status==="valid",wu=t=>typeof Promise<"u"&&t instanceof Promise;var ne;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e==null?void 0:e.message})(ne||(ne={}));class qn{constructor(e,r,n,s){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=s}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const b0=(t,e)=>{if(Li(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const r=new un(t.common.issues);return this._error=r,this._error}}};function de(t){if(!t)return{};const{errorMap:e,invalid_type_error:r,required_error:n,description:s}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:s}:{errorMap:(a,o)=>{const{message:l}=t;return a.code==="invalid_enum_value"?{message:l??o.defaultError}:typeof o.data>"u"?{message:l??n??o.defaultError}:a.code!=="invalid_type"?{message:o.defaultError}:{message:l??r??o.defaultError}},description:s}}class ge{get description(){return this._def.description}_getType(e){return gn(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new tr,ctx:{common:e.parent.common,data:e.data,parsedType:gn(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){const r=this._parse(e);if(wu(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){const r=this._parse(e);return Promise.resolve(r)}parse(e,r){const n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){const n={common:{issues:[],async:(r==null?void 0:r.async)??!1,contextualErrorMap:r==null?void 0:r.errorMap},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gn(e)},s=this._parseSync({data:e,path:n.path,parent:n});return b0(n,s)}"~validate"(e){var n,s;const r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gn(e)};if(!this["~standard"].async)try{const i=this._parseSync({data:e,path:[],parent:r});return Li(i)?{value:i.value}:{issues:r.common.issues}}catch(i){(s=(n=i==null?void 0:i.message)==null?void 0:n.toLowerCase())!=null&&s.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(i=>Li(i)?{value:i.value}:{issues:r.common.issues})}async parseAsync(e,r){const n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){const n={common:{issues:[],contextualErrorMap:r==null?void 0:r.errorMap,async:!0},path:(r==null?void 0:r.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:gn(e)},s=this._parse({data:e,path:n.path,parent:n}),i=await(wu(s)?s:Promise.resolve(s));return b0(n,i)}refine(e,r){const n=s=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(s):r;return this._refinement((s,i)=>{const a=e(s),o=()=>i.addIssue({code:B.custom,...n(s)});return typeof Promise<"u"&&a instanceof Promise?a.then(l=>l?!0:(o(),!1)):a?!0:(o(),!1)})}refinement(e,r){return this._refinement((n,s)=>e(n)?!0:(s.addIssue(typeof r=="function"?r(n,s):r),!1))}_refinement(e){return new Mi({schema:this,typeName:ue.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Un.create(this,this._def)}nullable(){return Di.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Br.create(this)}promise(){return Su.create(this,this._def)}or(e){return xu.create([this,e],this._def)}and(e){return bu.create(this,e,this._def)}transform(e){return new Mi({...de(this._def),schema:this,typeName:ue.ZodEffects,effect:{type:"transform",transform:e}})}default(e){const r=typeof e=="function"?e:()=>e;return new Dh({...de(this._def),innerType:this,defaultValue:r,typeName:ue.ZodDefault})}brand(){return new $3({typeName:ue.ZodBranded,type:this,...de(this._def)})}catch(e){const r=typeof e=="function"?e:()=>e;return new $h({...de(this._def),innerType:this,catchValue:r,typeName:ue.ZodCatch})}describe(e){const r=this.constructor;return new r({...this._def,description:e})}pipe(e){return yp.create(this,e)}readonly(){return zh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const g3=/^c[^\s-]{8,}$/i,v3=/^[0-9a-z]+$/,y3=/^[0-9A-HJKMNP-TV-Z]{26}$/i,w3=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,_3=/^[a-z0-9_-]{21}$/i,x3=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,b3=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,S3=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,k3="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let ed;const E3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,T3=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,C3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,P3=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,A3=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,R3=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,T1="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",O3=new RegExp(`^${T1}$`);function C1(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);const r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function I3(t){return new RegExp(`^${C1(t)}$`)}function N3(t){let e=`${T1}T${C1(t)}`;const r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function L3(t,e){return!!((e==="v4"||!e)&&E3.test(t)||(e==="v6"||!e)&&C3.test(t))}function j3(t,e){if(!x3.test(t))return!1;try{const[r]=t.split(".");if(!r)return!1;const n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),s=JSON.parse(atob(n));return!(typeof s!="object"||s===null||"typ"in s&&(s==null?void 0:s.typ)!=="JWT"||!s.alg||e&&s.alg!==e)}catch{return!1}}function M3(t,e){return!!((e==="v4"||!e)&&T3.test(t)||(e==="v6"||!e)&&P3.test(t))}class Pn extends ge{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==te.string){const i=this._getOrReturnCtx(e);return Y(i,{code:B.invalid_type,expected:te.string,received:i.parsedType}),le}const n=new tr;let s;for(const i of this._def.checks)if(i.kind==="min")e.data.length<i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:B.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="max")e.data.length>i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:B.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){const a=e.data.length>i.value,o=e.data.length<i.value;(a||o)&&(s=this._getOrReturnCtx(e,s),a?Y(s,{code:B.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):o&&Y(s,{code:B.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),n.dirty())}else if(i.kind==="email")S3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"email",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="emoji")ed||(ed=new RegExp(k3,"u")),ed.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"emoji",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="uuid")w3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"uuid",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="nanoid")_3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"nanoid",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid")g3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cuid",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="cuid2")v3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cuid2",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="ulid")y3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"ulid",code:B.invalid_string,message:i.message}),n.dirty());else if(i.kind==="url")try{new URL(e.data)}catch{s=this._getOrReturnCtx(e,s),Y(s,{validation:"url",code:B.invalid_string,message:i.message}),n.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"regex",code:B.invalid_string,message:i.message}),n.dirty())):i.kind==="trim"?e.data=e.data.trim():i.kind==="includes"?e.data.includes(i.value,i.position)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),n.dirty()):i.kind==="toLowerCase"?e.data=e.data.toLowerCase():i.kind==="toUpperCase"?e.data=e.data.toUpperCase():i.kind==="startsWith"?e.data.startsWith(i.value)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:{startsWith:i.value},message:i.message}),n.dirty()):i.kind==="endsWith"?e.data.endsWith(i.value)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:{endsWith:i.value},message:i.message}),n.dirty()):i.kind==="datetime"?N3(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:"datetime",message:i.message}),n.dirty()):i.kind==="date"?O3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:"date",message:i.message}),n.dirty()):i.kind==="time"?I3(i).test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{code:B.invalid_string,validation:"time",message:i.message}),n.dirty()):i.kind==="duration"?b3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"duration",code:B.invalid_string,message:i.message}),n.dirty()):i.kind==="ip"?L3(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"ip",code:B.invalid_string,message:i.message}),n.dirty()):i.kind==="jwt"?j3(e.data,i.alg)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"jwt",code:B.invalid_string,message:i.message}),n.dirty()):i.kind==="cidr"?M3(e.data,i.version)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"cidr",code:B.invalid_string,message:i.message}),n.dirty()):i.kind==="base64"?A3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"base64",code:B.invalid_string,message:i.message}),n.dirty()):i.kind==="base64url"?R3.test(e.data)||(s=this._getOrReturnCtx(e,s),Y(s,{validation:"base64url",code:B.invalid_string,message:i.message}),n.dirty()):ve.assertNever(i);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(s=>e.test(s),{validation:r,code:B.invalid_string,...ne.errToObj(n)})}_addCheck(e){return new Pn({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...ne.errToObj(e)})}url(e){return this._addCheck({kind:"url",...ne.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...ne.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...ne.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...ne.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...ne.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...ne.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...ne.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...ne.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...ne.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...ne.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...ne.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...ne.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,offset:(e==null?void 0:e.offset)??!1,local:(e==null?void 0:e.local)??!1,...ne.errToObj(e==null?void 0:e.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof(e==null?void 0:e.precision)>"u"?null:e==null?void 0:e.precision,...ne.errToObj(e==null?void 0:e.message)})}duration(e){return this._addCheck({kind:"duration",...ne.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...ne.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r==null?void 0:r.position,...ne.errToObj(r==null?void 0:r.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...ne.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...ne.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...ne.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...ne.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...ne.errToObj(r)})}nonempty(e){return this.min(1,ne.errToObj(e))}trim(){return new Pn({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Pn({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Pn({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}Pn.create=t=>new Pn({checks:[],typeName:ue.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...de(t)});function D3(t,e){const r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,s=r>n?r:n,i=Number.parseInt(t.toFixed(s).replace(".","")),a=Number.parseInt(e.toFixed(s).replace(".",""));return i%a/10**s}class mo extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==te.number){const i=this._getOrReturnCtx(e);return Y(i,{code:B.invalid_type,expected:te.number,received:i.parsedType}),le}let n;const s=new tr;for(const i of this._def.checks)i.kind==="int"?ve.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),Y(n,{code:B.invalid_type,expected:"integer",received:"float",message:i.message}),s.dirty()):i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),s.dirty()):i.kind==="multipleOf"?D3(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),Y(n,{code:B.not_finite,message:i.message}),s.dirty()):ve.assertNever(i);return{status:s.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,ne.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ne.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ne.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ne.toString(r))}setLimit(e,r,n,s){return new mo({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ne.toString(s)}]})}_addCheck(e){return new mo({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:ne.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ne.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:ne.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ne.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ne.toString(e)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ve.isInteger(e.value))}get isFinite(){let e=null,r=null;for(const n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}}mo.create=t=>new mo({checks:[],typeName:ue.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...de(t)});class go extends ge{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==te.bigint)return this._getInvalidInput(e);let n;const s=new tr;for(const i of this._def.checks)i.kind==="min"?(i.inclusive?e.data<i.value:e.data<=i.value)&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="max"?(i.inclusive?e.data>i.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),s.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),Y(n,{code:B.not_multiple_of,multipleOf:i.value,message:i.message}),s.dirty()):ve.assertNever(i);return{status:s.value,value:e.data}}_getInvalidInput(e){const r=this._getOrReturnCtx(e);return Y(r,{code:B.invalid_type,expected:te.bigint,received:r.parsedType}),le}gte(e,r){return this.setLimit("min",e,!0,ne.toString(r))}gt(e,r){return this.setLimit("min",e,!1,ne.toString(r))}lte(e,r){return this.setLimit("max",e,!0,ne.toString(r))}lt(e,r){return this.setLimit("max",e,!1,ne.toString(r))}setLimit(e,r,n,s){return new go({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:ne.toString(s)}]})}_addCheck(e){return new go({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ne.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ne.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:ne.toString(r)})}get minValue(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}}go.create=t=>new go({checks:[],typeName:ue.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...de(t)});class Lh extends ge{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==te.boolean){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.boolean,received:n.parsedType}),le}return mr(e.data)}}Lh.create=t=>new Lh({typeName:ue.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...de(t)});class _u extends ge{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==te.date){const i=this._getOrReturnCtx(e);return Y(i,{code:B.invalid_type,expected:te.date,received:i.parsedType}),le}if(Number.isNaN(e.data.getTime())){const i=this._getOrReturnCtx(e);return Y(i,{code:B.invalid_date}),le}const n=new tr;let s;for(const i of this._def.checks)i.kind==="min"?e.data.getTime()<i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:B.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),n.dirty()):i.kind==="max"?e.data.getTime()>i.value&&(s=this._getOrReturnCtx(e,s),Y(s,{code:B.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):ve.assertNever(i);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new _u({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:ne.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:ne.toString(r)})}get minDate(){let e=null;for(const r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(const r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}}_u.create=t=>new _u({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:ue.ZodDate,...de(t)});class S0 extends ge{_parse(e){if(this._getType(e)!==te.symbol){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.symbol,received:n.parsedType}),le}return mr(e.data)}}S0.create=t=>new S0({typeName:ue.ZodSymbol,...de(t)});class k0 extends ge{_parse(e){if(this._getType(e)!==te.undefined){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.undefined,received:n.parsedType}),le}return mr(e.data)}}k0.create=t=>new k0({typeName:ue.ZodUndefined,...de(t)});class E0 extends ge{_parse(e){if(this._getType(e)!==te.null){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.null,received:n.parsedType}),le}return mr(e.data)}}E0.create=t=>new E0({typeName:ue.ZodNull,...de(t)});class T0 extends ge{constructor(){super(...arguments),this._any=!0}_parse(e){return mr(e.data)}}T0.create=t=>new T0({typeName:ue.ZodAny,...de(t)});class C0 extends ge{constructor(){super(...arguments),this._unknown=!0}_parse(e){return mr(e.data)}}C0.create=t=>new C0({typeName:ue.ZodUnknown,...de(t)});class Kn extends ge{_parse(e){const r=this._getOrReturnCtx(e);return Y(r,{code:B.invalid_type,expected:te.never,received:r.parsedType}),le}}Kn.create=t=>new Kn({typeName:ue.ZodNever,...de(t)});class P0 extends ge{_parse(e){if(this._getType(e)!==te.undefined){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.void,received:n.parsedType}),le}return mr(e.data)}}P0.create=t=>new P0({typeName:ue.ZodVoid,...de(t)});class Br extends ge{_parse(e){const{ctx:r,status:n}=this._processInputParams(e),s=this._def;if(r.parsedType!==te.array)return Y(r,{code:B.invalid_type,expected:te.array,received:r.parsedType}),le;if(s.exactLength!==null){const a=r.data.length>s.exactLength.value,o=r.data.length<s.exactLength.value;(a||o)&&(Y(r,{code:a?B.too_big:B.too_small,minimum:o?s.exactLength.value:void 0,maximum:a?s.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:s.exactLength.message}),n.dirty())}if(s.minLength!==null&&r.data.length<s.minLength.value&&(Y(r,{code:B.too_small,minimum:s.minLength.value,type:"array",inclusive:!0,exact:!1,message:s.minLength.message}),n.dirty()),s.maxLength!==null&&r.data.length>s.maxLength.value&&(Y(r,{code:B.too_big,maximum:s.maxLength.value,type:"array",inclusive:!0,exact:!1,message:s.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,o)=>s.type._parseAsync(new qn(r,a,r.path,o)))).then(a=>tr.mergeArray(n,a));const i=[...r.data].map((a,o)=>s.type._parseSync(new qn(r,a,r.path,o)));return tr.mergeArray(n,i)}
vendor: 5,082 bytes, line 400
400get element(){return this._def.type}min(e,r){return new Br({...this._def,minLength:{value:e,message:ne.toString(r)}})}max(e,r){return new Br({...this._def,maxLength:{value:e,message:ne.toString(r)}})}length(e,r){return new Br({...this._def,exactLength:{value:e,message:ne.toString(r)}})}nonempty(e){return this.min(1,e)}}Br.create=(t,e)=>new Br({type:t,minLength:null,maxLength:null,exactLength:null,typeName:ue.ZodArray,...de(e)});function qs(t){if(t instanceof Ye){const e={};for(const r in t.shape){const n=t.shape[r];e[r]=Un.create(qs(n))}return new Ye({...t._def,shape:()=>e})}else return t instanceof Br?new Br({...t._def,type:qs(t.element)}):t instanceof Un?Un.create(qs(t.unwrap())):t instanceof Di?Di.create(qs(t.unwrap())):t instanceof Rs?Rs.create(t.items.map(e=>qs(e))):t}class Ye extends ge{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const e=this._def.shape(),r=ve.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==te.object){const u=this._getOrReturnCtx(e);return Y(u,{code:B.invalid_type,expected:te.object,received:u.parsedType}),le}const{status:n,ctx:s}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),o=[];if(!(this._def.catchall instanceof Kn&&this._def.unknownKeys==="strip"))for(const u in s.data)a.includes(u)||o.push(u);const l=[];for(const u of a){const c=i[u],d=s.data[u];l.push({key:{status:"valid",value:u},value:c._parse(new qn(s,d,s.path,u)),alwaysSet:u in s.data})}if(this._def.catchall instanceof Kn){const u=this._def.unknownKeys;if(u==="passthrough")for(const c of o)l.push({key:{status:"valid",value:c},value:{status:"valid",value:s.data[c]}});else if(u==="strict")o.length>0&&(Y(s,{code:B.unrecognized_keys,keys:o}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const u=this._def.catchall;for(const c of o){const d=s.data[c];l.push({key:{status:"valid",value:c},value:u._parse(new qn(s,d,s.path,c)),alwaysSet:c in s.data})}}return s.common.async?Promise.resolve().then(async()=>{const u=[];for(const c of l){const d=await c.key,f=await c.value;u.push({key:d,value:f,alwaysSet:c.alwaysSet})}return u}).then(u=>tr.mergeObjectSync(n,u)):tr.mergeObjectSync(n,l)}get shape(){return this._def.shape()}strict(e){return ne.errToObj,new Ye({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{var i,a;const s=((a=(i=this._def).errorMap)==null?void 0:a.call(i,r,n).message)??n.defaultError;return r.code==="unrecognized_keys"?{message:ne.errToObj(e).message??s}:{message:s}}}:{}})}strip(){return new Ye({...this._def,unknownKeys:"strip"})}passthrough(){return new Ye({...this._def,unknownKeys:"passthrough"})}extend(e){return new Ye({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new Ye({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:ue.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new Ye({...this._def,catchall:e})}pick(e){const r={};for(const n of ve.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new Ye({...this._def,shape:()=>r})}omit(e){const r={};for(const n of ve.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new Ye({...this._def,shape:()=>r})}deepPartial(){return qs(this)}partial(e){const r={};for(const n of ve.objectKeys(this.shape)){const s=this.shape[n];e&&!e[n]?r[n]=s:r[n]=s.optional()}return new Ye({...this._def,shape:()=>r})}required(e){const r={};for(const n of ve.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof Un;)i=i._def.innerType;r[n]=i}return new Ye({...this._def,shape:()=>r})}keyof(){return P1(ve.objectKeys(this.shape))}}Ye.create=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strip",catchall:Kn.create(),typeName:ue.ZodObject,...de(e)});Ye.strictCreate=(t,e)=>new Ye({shape:()=>t,unknownKeys:"strict",catchall:Kn.create(),typeName:ue.ZodObject,...de(e)});Ye.lazycreate=(t,e)=>new Ye({shape:t,unknownKeys:"strip",catchall:Kn.create(),typeName:ue.ZodObject,...de(e)});class xu extends ge{_parse(e){const{ctx:r}=this._processInputParams(e),n=this._def.options;function s(i){for(const o of i)if(o.result.status==="valid")return o.result;for(const o of i)if(o.result.status==="dirty")return r.common.issues.push(...o.ctx.common.issues),o.result;const a=i.map(o=>new un(o.ctx.common.issues));return Y(r,{code:B.invalid_union,unionErrors:a}),le}if(r.common.async)return Promise.all(n.map(async i=>{const a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(s);{let i;const a=[];for(const l of n){const u={...r,common:{...r.common,issues:[]},parent:null},c=l._parseSync({data:r.data,path:r.path,parent:u});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:u}),u.common.issues.length&&a.push(u.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;
vendor: 5,024 bytes, line 400
400const o=a.map(l=>new un(l));return Y(r,{code:B.invalid_union,unionErrors:o}),le}}get options(){return this._def.options}}xu.create=(t,e)=>new xu({options:t,typeName:ue.ZodUnion,...de(e)});function jh(t,e){const r=gn(t),n=gn(e);if(t===e)return{valid:!0,data:t};if(r===te.object&&n===te.object){const s=ve.objectKeys(e),i=ve.objectKeys(t).filter(o=>s.indexOf(o)!==-1),a={...t,...e};for(const o of i){const l=jh(t[o],e[o]);if(!l.valid)return{valid:!1};a[o]=l.data}return{valid:!0,data:a}}else if(r===te.array&&n===te.array){if(t.length!==e.length)return{valid:!1};const s=[];for(let i=0;i<t.length;i++){const a=t[i],o=e[i],l=jh(a,o);if(!l.valid)return{valid:!1};s.push(l.data)}return{valid:!0,data:s}}else return r===te.date&&n===te.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}class bu extends ge{_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=(i,a)=>{if(_0(i)||_0(a))return le;const o=jh(i.value,a.value);return o.valid?((x0(i)||x0(a))&&r.dirty(),{status:r.value,value:o.data}):(Y(n,{code:B.invalid_intersection_types}),le)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([i,a])=>s(i,a)):s(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}}bu.create=(t,e,r)=>new bu({left:t,right:e,typeName:ue.ZodIntersection,...de(r)});class Rs extends ge{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.array)return Y(n,{code:B.invalid_type,expected:te.array,received:n.parsedType}),le;if(n.data.length<this._def.items.length)return Y(n,{code:B.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),le;!this._def.rest&&n.data.length>this._def.items.length&&(Y(n,{code:B.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());const i=[...n.data].map((a,o)=>{const l=this._def.items[o]||this._def.rest;return l?l._parse(new qn(n,a,n.path,o)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>tr.mergeArray(r,a)):tr.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new Rs({...this._def,rest:e})}}Rs.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new Rs({items:t,typeName:ue.ZodTuple,rest:null,...de(e)})};class A0 extends ge{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.map)return Y(n,{code:B.invalid_type,expected:te.map,received:n.parsedType}),le;const s=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([o,l],u)=>({key:s._parse(new qn(n,o,n.path,[u,"key"])),value:i._parse(new qn(n,l,n.path,[u,"value"]))}));if(n.common.async){const o=new Map;return Promise.resolve().then(async()=>{for(const l of a){const u=await l.key,c=await l.value;if(u.status==="aborted"||c.status==="aborted")return le;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}})}else{const o=new Map;for(const l of a){const u=l.key,c=l.value;if(u.status==="aborted"||c.status==="aborted")return le;(u.status==="dirty"||c.status==="dirty")&&r.dirty(),o.set(u.value,c.value)}return{status:r.value,value:o}}}}A0.create=(t,e,r)=>new A0({valueType:e,keyType:t,typeName:ue.ZodMap,...de(r)});class vo extends ge{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==te.set)return Y(n,{code:B.invalid_type,expected:te.set,received:n.parsedType}),le;const s=this._def;s.minSize!==null&&n.data.size<s.minSize.value&&(Y(n,{code:B.too_small,minimum:s.minSize.value,type:"set",inclusive:!0,exact:!1,message:s.minSize.message}),r.dirty()),s.maxSize!==null&&n.data.size>s.maxSize.value&&(Y(n,{code:B.too_big,maximum:s.maxSize.value,type:"set",inclusive:!0,exact:!1,message:s.maxSize.message}),r.dirty());const i=this._def.valueType;function a(l){const u=new Set;for(const c of l){if(c.status==="aborted")return le;c.status==="dirty"&&r.dirty(),u.add(c.value)}return{status:r.value,value:u}}const o=[...n.data.values()].map((l,u)=>i._parse(new qn(n,l,n.path,u)));return n.common.async?Promise.all(o).then(l=>a(l)):a(o)}min(e,r){return new vo({...this._def,minSize:{value:e,message:ne.toString(r)}})}max(e,r){return new vo({...this._def,maxSize:{value:e,message:ne.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}}vo.create=(t,e)=>new vo({valueType:t,minSize:null,maxSize:null,typeName:ue.ZodSet,...de(e)});class R0 extends ge{get schema(){return this._def.getter()}_parse(e){const{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}}R0.create=(t,e)=>new R0({getter:t,typeName:ue.ZodLazy,...de(e)});class Mh extends ge{_parse(e){if(e.data!==this._def.value){const r=this._getOrReturnCtx(e);return Y(r,{received:r.data,code:B.invalid_literal,expected:this._def.value}),le}
vendor: 5,374 bytes, line 400
400return{status:"valid",value:e.data}}get value(){return this._def.value}}Mh.create=(t,e)=>new Mh({value:t,typeName:ue.ZodLiteral,...de(e)});function P1(t,e){return new ji({values:t,typeName:ue.ZodEnum,...de(e)})}class ji extends ge{_parse(e){if(typeof e.data!="string"){const r=this._getOrReturnCtx(e),n=this._def.values;return Y(r,{expected:ve.joinValues(n),received:r.parsedType,code:B.invalid_type}),le}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){const r=this._getOrReturnCtx(e),n=this._def.values;return Y(r,{received:r.data,code:B.invalid_enum_value,options:n}),le}return mr(e.data)}get options(){return this._def.values}get enum(){const e={};for(const r of this._def.values)e[r]=r;return e}get Values(){const e={};for(const r of this._def.values)e[r]=r;return e}get Enum(){const e={};for(const r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return ji.create(e,{...this._def,...r})}exclude(e,r=this._def){return ji.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}}ji.create=P1;class O0 extends ge{_parse(e){const r=ve.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==te.string&&n.parsedType!==te.number){const s=ve.objectValues(r);return Y(n,{expected:ve.joinValues(s),received:n.parsedType,code:B.invalid_type}),le}if(this._cache||(this._cache=new Set(ve.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){const s=ve.objectValues(r);return Y(n,{received:n.data,code:B.invalid_enum_value,options:s}),le}return mr(e.data)}get enum(){return this._def.values}}O0.create=(t,e)=>new O0({values:t,typeName:ue.ZodNativeEnum,...de(e)});class Su extends ge{unwrap(){return this._def.type}_parse(e){const{ctx:r}=this._processInputParams(e);if(r.parsedType!==te.promise&&r.common.async===!1)return Y(r,{code:B.invalid_type,expected:te.promise,received:r.parsedType}),le;const n=r.parsedType===te.promise?r.data:Promise.resolve(r.data);return mr(n.then(s=>this._def.type.parseAsync(s,{path:r.path,errorMap:r.common.contextualErrorMap})))}}Su.create=(t,e)=>new Su({type:t,typeName:ue.ZodPromise,...de(e)});class Mi extends ge{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===ue.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){const{status:r,ctx:n}=this._processInputParams(e),s=this._def.effect||null,i={addIssue:a=>{Y(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),s.type==="preprocess"){const a=s.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async o=>{if(r.value==="aborted")return le;const l=await this._def.schema._parseAsync({data:o,path:n.path,parent:n});return l.status==="aborted"?le:l.status==="dirty"||r.value==="dirty"?fa(l.value):l});{if(r.value==="aborted")return le;const o=this._def.schema._parseSync({data:a,path:n.path,parent:n});return o.status==="aborted"?le:o.status==="dirty"||r.value==="dirty"?fa(o.value):o}}if(s.type==="refinement"){const a=o=>{const l=s.refinement(o,i);if(n.common.async)return Promise.resolve(l);if(l instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return o};if(n.common.async===!1){const o=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value),{status:r.value,value:o.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(o=>o.status==="aborted"?le:(o.status==="dirty"&&r.dirty(),a(o.value).then(()=>({status:r.value,value:o.value}))))}if(s.type==="transform")if(n.common.async===!1){const a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Li(a))return le;const o=s.transform(a.value,i);if(o instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:o}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>Li(a)?Promise.resolve(s.transform(a.value,i)).then(o=>({status:r.value,value:o})):le);ve.assertNever(s)}}Mi.create=(t,e,r)=>new Mi({schema:t,typeName:ue.ZodEffects,effect:e,...de(r)});Mi.createWithPreprocess=(t,e,r)=>new Mi({schema:e,effect:{type:"preprocess",transform:t},typeName:ue.ZodEffects,...de(r)});class Un extends ge{_parse(e){return this._getType(e)===te.undefined?mr(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Un.create=(t,e)=>new Un({innerType:t,typeName:ue.ZodOptional,...de(e)});class Di extends ge{_parse(e){return this._getType(e)===te.null?mr(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}}Di.create=(t,e)=>new Di({innerType:t,typeName:ue.ZodNullable,...de(e)});class Dh extends ge{_parse(e){const{ctx:r}=this._processInputParams(e);let n=r.data;return r.parsedType===te.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}}Dh.create=(t,e)=>new Dh({innerType:t,typeName:ue.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...de(e)});class $h extends ge{_parse(e){const{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},s=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return wu(s)?s.then(i=>
400({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new un(n.common.issues)},input:n.data})})):{status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new un(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}}$h.create=(t,e)=>new $h({innerType:t,typeName:ue.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...de(e)});class I0 extends ge{_parse(e){if(this._getType(e)!==te.nan){const n=this._getOrReturnCtx(e);return Y(n,{code:B.invalid_type,expected:te.nan,received:n.parsedType}),le}return{status:"valid",value:e.data}}}I0.create=t=>new I0({typeName:ue.ZodNaN,...de(t)});class $3 extends ge{_parse(e){const{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}}class yp extends ge{_parse(e){const{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{const i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?le:i.status==="dirty"?(r.dirty(),fa(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{const s=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?le:s.status==="dirty"?(r.dirty(),{status:"dirty",value:s.value}):this._def.out._parseSync({data:s.value,path:n.path,parent:n})}}static create(e,r){return new yp({in:e,out:r,typeName:ue.ZodPipeline})}}class zh extends ge{_parse(e){const r=this._def.innerType._parse(e),n=s=>(Li(s)&&(s.value=Object.freeze(s.value)),s);return wu(r)?r.then(s=>n(s)):n(r)}unwrap(){return this._def.innerType}}zh.create=(t,e)=>new zh({innerType:t,typeName:ue.ZodReadonly,...de(e)});var ue;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(ue||(ue={}));const ui=Pn.create,z3=Lh.create;Kn.create;Br.create;const A1=Ye.create;xu.create;bu.create;Rs.create;const U3=Mh.create;ji.create;Su.create;Un.create;Di.create;const B3=5*1024*1024,F3=["image/jpeg","image/jpg","image/png","image/webp"],V3=A1({title:ui().min(1,"El título es requerido.").max(100,"El título no puede superar los 100 caracteres."),description:ui().max(300,"La descripción no puede superar los 300 caracteres.").optional().or(U3("")),date:ui().optional(),active:z3().default(!0),imageUrl:ui().optional()});A1({email:ui().min(1,"El email es requerido.").email("Ingrese un email válido."),password:ui().min(6,"La contraseña debe tener al menos 6 caracteres.")});const W3=t=>t?F3.includes(t.type)?t.size>B3?{valid:!1,error:"La imagen no puede superar los 5MB."}:{valid:!0,error:null}:{valid:!1,error:"Solo se permiten imágenes JPG, PNG o WebP."}:{valid:!1,error:"Seleccione una imagen."},H3=({currentImageUrl:t="",imageUrl:e="",onUrlChange:r,onFileSelect:n,uploadProgress:s=0,className:i=""})=>{const a=e||t||"",[o,l]=P.useState((a&&!a.startsWith("data:"),"file")),[u,c]=P.useState(a),[d,f]=P.useState(!1),[m,y]=P.useState(null),[g,b]=P.useState(!1),[_,v]=P.useState(null),[w,h]=P.useState(null),p=P.useRef(null);P.useEffect(()=>{e!==void 0&&e!==u&&o==="url"&&(c(e),f(!1))},[e]);const x=N=>{const M=N.target.value;c(M),f(!1),r==null||r(M),M&&(y(null),h(null),n==null||n(null),p.current&&(p.current.value=""))},k=N=>{l(N),N==="url"?(n==null||n(null),y(null),h(null),p.current&&(p.current.value=""),r==null||r(u)):r==null||r("")},T=P.useCallback(N=>{v(null);const{valid:M,error:X}=W3(N);
400if(!M){v(X);return}const q=new FileReader;q.onload=D=>y(D.target.result),q.readAsDataURL(N),h({name:N.name,size:N.size}),n==null||n(N),r==null||r("")},[n,r]),E=P.useCallback(N=>{N.preventDefault(),b(!1);const M=N.dataTransfer.files[0];M&&T(M)},[T]),R=N=>{const M=N.target.files[0];M&&T(M)},j=()=>{y(null),h(null),v(null),n==null||n(null),p.current&&(p.current.value="")},L=()=>{c(""),f(!1),r==null||r("")},O=s>0&&s<100;return S.jsxs("div",{className:`space-y-3 ${i}`,children:[S.jsxs("div",{className:"flex bg-background-secondary p-1 rounded-lg gap-1 border border-gray-200/60",children:[S.jsxs("button",{type:"button",onClick:()=>k("file"),className:`flex-1 flex items-center justify-center gap-2 py-1.5 px-3 text-xs font-semibold rounded-md transition-all ${o==="file"?"bg-white text-primary shadow-sm":"text-text-secondary hover:text-text"}`,children:[S.jsx(Gm,{size:14}),"Subir imagen al servidor (Ferozo)"]}),S.jsxs("button",{type:"button",onClick:()=>k("url"),className:`flex-1 flex items-center justify-center gap-2 py-1.5 px-3 text-xs font-semibold rounded-md transition-all ${o==="url"?"bg-white text-primary shadow-sm":"text-text-secondary hover:text-text"}`,children:[S.jsx(Ik,{size:14}),"Enlace externo URL"]})]}),o==="file"&&S.jsxs("div",{children:[m?S.jsxs("div",{className:"relative rounded-card overflow-hidden border border-gray-200",children:[S.jsx("img",{src:m,alt:"Preview",className:"w-full aspect-video object-cover"}),O&&S.jsxs("div",{className:"absolute inset-0 bg-black/50 flex flex-col items-center justify-center gap-3",children:[S.jsx("div",{className:"w-48 bg-white/20 rounded-full h-2 overflow-hidden",children:S.jsx("div",{className:"h-full bg-white rounded-full transition-all duration-300",style:{width:`${s}%`}})}),S.jsxs("span",{className:"text-white text-sm font-semibold",children:["Subiendo a Ferozo... ",s,"%"]})]}),!O&&S.jsx("button",{type:"button",onClick:j,className:"absolute top-2 right-2 w-8 h-8 bg-black/60 hover:bg-black/80 text-white rounded-full flex items-center justify-center transition-colors","aria-label":"Eliminar imagen",children:S.jsx(Ps,{size:14})}),w&&S.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-black/50 px-3 py-2",children:S.jsxs("p",{className:"text-white text-xs truncate",children:[w.name," · ",_k(w.size)]})})]}):S.jsx("div",{onClick:()=>{var N;return(N=p.current)==null?void 0:N.click()},onDragOver:N=>{N.preventDefault(),b(!0)},onDragLeave:()=>b(!1),onDrop:E,className:`upload-zone ${g?"dragging":""}`,children:S.jsxs("div",{className:"flex flex-col items-center gap-3 pointer-events-none",children:[S.jsx("div",{className:`w-12 h-12 rounded-full flex items-center justify-center transition-colors ${g?"bg-primary/10":"bg-background-secondary"}`,children:g?S.jsx(Rk,{size:22,className:"text-primary"}):S.jsx(Gm,{size:22,className:"text-text-secondary"})}),S.jsxs("div",{children:[S.jsx("p",{className:"text-sm font-semibold text-text",children:g?"Soltá la imagen":"Arrastrá la imagen de la promo o hacé clic"}),S.jsx("p",{className:"text-xs text-text-secondary mt-1",children:"JPG, PNG o WebP · Se comprimirá y guardará en Ferozo automáticamente"})]})]})}),_&&S.jsxs("div",{className:"flex items-center gap-2 mt-2 text-error text-sm",children:[S.jsx(Kl,{size:14}),S.jsx("span",{children:_})]}),S.jsx("input",{ref:p,type:"file",accept:"image/jpeg,image/jpg,image/png,image/webp",onChange:R,className:"hidden"})]}),o==="url"&&S.jsxs("div",{className:"space-y-3",children:[S.jsxs("div",{children:[S.jsxs("div",{className:"relative flex items-center",children:[S.jsx("input",{type:"url",value:u,onChange:x,placeholder:"Ej: https://migusto.com.ar/1A_assets/Carta.Digital/promo.webp",className:`input-field pr-10 ${d?"error":""}`}),u&&S.jsx("button",{type:"button",onClick:L,className:"absolute right-3 text-gray-400 hover:text-gray-600 transition-colors",title:"Limpiar URL",children:S.jsx(Ps,{size:16})})]}),S.jsx("div",{className:"flex items-center justify-between mt-1.5 text-xs text-text-secondary",children:S.jsxs("span",{className:"flex items-center gap-1",children:[S.jsx(Pk,{size:12}),"Pegá una URL de imagen pública directa."]})})]}),u.trim()&&S.jsx("div",{className:"relative rounded-card overflow-hidden border border-gray-200 bg-black/5",children:d?S.jsxs("div",{className:"p-6 flex flex-col items-center justify-center text-center text-error bg-red-50/50",children:[S.jsx(Kl,{size:28,className:"mb-2"}),S.jsx("p",{className:"text-sm font-semibold",children:"No se pudo cargar la 
400imagen desde esta URL"})]}):S.jsxs("div",{className:"relative group",children:[S.jsx("img",{src:u,alt:"Vista previa de la URL",className:"w-full aspect-video object-cover transition-opacity duration-200",onError:()=>f(!0)}),S.jsx("div",{className:"absolute top-2 left-2 bg-black/60 text-white text-[10px] font-semibold px-2 py-0.5 rounded-full backdrop-blur-sm",children:"Vista previa de la URL"})]})})]})]})},G3={error:Kl,success:cw,info:fw},q3={error:"bg-red-50 border-error text-red-800",success:"bg-secondary-50 border-secondary text-secondary-800",info:"bg-primary-50 border-primary text-primary-800"},K3={error:"text-error",success:"text-secondary",info:"text-primary"},wp=({type:t="info",message:e,onClose:r,className:n=""})=>{const s=G3[t];return S.jsxs("div",{className:`flex items-start gap-3 p-4 rounded-btn border ${q3[t]} ${n}`,children:[S.jsx(s,{size:18,className:`flex-shrink-0 mt-0.5 ${K3[t]}`}),S.jsx("p",{className:"flex-1 text-sm font-medium",children:e}),r&&S.jsx("button",{onClick:r,className:"flex-shrink-0 hover:opacity-70 transition-opacity",children:S.jsx(Ps,{size:16})})]})},N0=()=>S.jsx("span",{className:"!text-error",children:"*"}),J3=({initialData:t,onSubmit:e,onCancel:r,onRequestClose:n,isSubmitting:s})=>{const[i,a]=P.useState(null),[o,l]=P.useState((t==null?void 0:t.imageUrl)||""),[u,c]=P.useState(0),[d,f]=P.useState(null),[m,y]=P.useState(!1),g=!!t,{register:b,handleSubmit:_,control:v,reset:w,formState:{errors:h}}=l3({resolver:h3(V3),defaultValues:{title:(t==null?void 0:t.title)||"",description:(t==null?void 0:t.description)||"",date:(t==null?void 0:t.date)||Rc(),active:(t==null?void 0:t.active)??!0}});P.useEffect(()=>{t&&(w({title:t.title||"",description:t.description||"",date:t.date||Rc(),active:t.active??!0}),l(t.imageUrl||""))},[t,w]);const p=async x=>{f(null),y(!1);const k=o.trim();if(!k&&!i){y(!0);return}const T={...x,date:(t==null?void 0:t.date)||Rc(),description:x.description||"",imageUrl:k},E=await e(T,i,R=>{c(R)});E!=null&&E.error&&(f(E.error),c(0))};return S.jsxs("form",{onSubmit:_(p),noValidate:!0,children:[S.jsxs("div",{className:"p-6 space-y-5",children:[d&&S.jsx(wp,{type:"error",message:d,onClose:()=>f(null)}),S.jsxs("div",{children:[S.jsxs("label",{className:"label",children:["Imagen de la promoción ",S.jsx(N0,{})]}),S.jsx(H3,{currentImageUrl:t==null?void 0:t.imageUrl,imageUrl:o,onUrlChange:l,onFileSelect:a,uploadProgress:u}),m&&S.jsx("p",{className:"text-error text-sm mt-1.5 flex items-center gap-1",children:"Debe seleccionar una imagen para subir al servidor o ingresar una URL."})]}),S.jsxs("div",{children:[S.jsxs("label",{className:"label",htmlFor:"title",children:["Título ",S.jsx(N0,{})]}),S.jsx("input",{id:"title",...b("title"),className:`input-field ${h.title?"error":""}`,placeholder:"Ej: 2x1 en pizzas todos los martes",maxLength:100}),h.title&&S.jsx("p",{className:"text-error text-xs mt-1",children:h.title.message})]}),S.jsxs("div",{children:[S.jsx("label",{className:"label",children:"Estado"}),S.jsx(qR,{name:"active",control:v,render:({field:x})=>S.jsxs("div",{className:"flex items-center gap-3",children:[S.jsx("button",{type:"button",onClick:()=>x.onChange(!x.value),className:`
401                    relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full
402                    border-2 border-transparent transition-colors duration-200 ease-in-out
403                    focus:outline-none focus:ring-2 focus:ring-green-500/20 focus:ring-offset-2
404                    ${x.value?"bg-green-500":"bg-gray-200"}
405                  `,role:"switch","aria-checked":x.value,children:S.jsx("span",{className:`
406                      pointer-events-none inline-block h-5 w-5 transform rounded-full
407                      bg-white shadow ring-0 transition duration-200 ease-in-out
408                      ${x.value?"translate-x-5":"translate-x-0"}
409                    `})}),S.jsx("span",{className:`text-sm font-semibold ${x.value?"text-secondary":"text-text-secondary"}`,children:x.value?"Activa":"Inactiva"})]})})]})]}),S.jsxs("div",{className:"flex items-center justify-end gap-3 px-6 py-4 border-t border-gray-100 bg-background-secondary rounded-b-card",children:[S.jsx(As,{type:"submit",variant:"primary",loading:s,icon:Dk,size:"sm",children:g?"Guardar cambios":"Crear promoción"}),S.jsx(As,{type:"button",variant:"ghost",onClick:n||r,disabled:s,icon:Ps,size:"sm",children:"Cancelar"})]})]})},L0=({active:t,onClick:e,children:r})=>S.jsx("button",{onClick:e,className:`
410      px-3 py-1.5 text-sm font-semibold rounded-btn transition-colors
411      ${t?"bg-primary text-white":"bg-background-secondary text-text-secondary hover:text-text hover:bg-gray-100"}
412    `,children:r}),Z3=()=>{const t=lw(),{promotions:e,loading:r,error:n,filterStatus:s,sortOrder:i,fetchAll:a,handleFilterChange:o,handleSortChange:l,create:u,update:c,remove:d}=lC(),[f,m]=P.useState(!1),[y,g]=P.useState(null),[b,_]=P.useState(!1),[v,w]=P.useState(!1);P.useEffect(()=>{a()},[]);const h=()=>{g(null),m(!0)},p=E=>{g(E),m(!0)},x=()=>{m(!1),g(null)},k=async(E,R,j)=>{_(!0);let L;return y?(L=await c(y.id,E,R,j),L.error||(t.success("¡Promoción actualizada correctamente!"),x())):(L=await u(E,R,j),L.error||(t.success("¡Promoción creada correctamente!"),x())),L.error&&t.error(L.error),_(!1),L},T=async E=>{w(!0);const R=await d(E);R.error?t.error(R.error):t.success("Promoción eliminada."),w(!1)};return S.jsxs("div",{className:"p-6",children:[S.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6",children:[S.jsxs("div",{children:[S.jsx("h1",{className:"font-display text-2xl sm:text-3xl font-bold text-text",children:"Promociones"}),S.jsxs("p",{className:"text-text-secondary text-sm mt-1",children:[e.length," promoción",e.length!==1?"es":""," en total"]})]}),S.jsx(As,{onClick:h,icon:Mk,size:"sm",children:"Nueva promoción"})]}),S.jsxs("div",{className:"flex flex-wrap items-center gap-3 mb-6 p-4 bg-background-secondary rounded-card",children:[S.jsxs("div",{className:"flex items-center gap-1.5",children:[S.jsx(Ak,{size:14,className:"text-text-secondary"}),S.jsx("span",{className:"text-xs font-semibold text-text-secondary uppercase tracking-wide",children:"Estado:"}),S.jsx("div",{className:"flex gap-1",children:[{value:"all",label:"Todas"},{value:"active",label:"Activas"},{value:"inactive",label:"Inactivas"}].map(({value:E,label:R})=>S.jsx(L0,{active:s===E,onClick:()=>o(E),children:R},E))})]}),S.jsxs("div",{className:"flex items-center gap-1.5 ml-auto",children:[S.jsx(Ek,{size:14,className:"text-text-secondary"}),S.jsx("span",{className:"text-xs font-semibold text-text-secondary uppercase tracking-wide",children:"Orden:"}),S.jsx("div",{className:"flex gap-1",children:[{value:"newest",label:"Recientes"},{value:"oldest",label:"Antiguas"}].map(({value:E,label:R})=>S.jsx(L0,{active:i===E,onClick:()=>l(E),children:R},E))})]})]}
412),n&&S.jsx(wp,{type:"error",message:n,className:"mb-4"}),r?S.jsx("div",{className:"flex justify-center py-16",children:S.jsx(ko,{size:32,className:"animate-spin text-primary"})}):S.jsx(FR,{promotions:e,onEdit:p,onDelete:T,isDeleting:v,transitionKey:`${s}-${i}`}),S.jsx(o1,{isOpen:f,onClose:x,title:y?"Editar promoción":"Nueva promoción",maxWidth:"max-w-xl",children:S.jsx(J3,{initialData:y,onSubmit:k,onCancel:x,isSubmitting:b},(y==null?void 0:y.id)||"new")})]})},Y3=()=>{const{user:t,loading:e,logout:r}=c_(),n=So();P.useEffect(()=>{!e&&!t&&n("/login",{replace:!0})},[t,e,n]);const s=async()=>{await r(),n("/",{replace:!0})};return e?S.jsx("div",{className:"min-h-screen flex items-center justify-center bg-background-secondary",children:S.jsx(ko,{size:32,className:"animate-spin text-primary"})}):t?S.jsxs("div",{className:"min-h-screen flex flex-col bg-background-secondary",children:[S.jsx("header",{className:"sticky top-0 z-40 bg-white border-b border-gray-100 shadow-sm",children:S.jsxs("div",{className:"px-4 sm:px-6 h-16 flex items-center justify-between max-w-7xl mx-auto",children:[S.jsxs("a",{href:"https://migusto.com.ar/",className:"flex items-center gap-2.5 group",children:[S.jsx("img",{src:Ff,alt:"Mi Gusto Logo",className:"w-10 h-10 object-contain rounded-btn"}),S.jsx("div",{children:S.jsxs("span",{className:"text-[10px] text-text-secondary leading-none tracking-wide uppercase flex items-center gap-1 font-bold",children:[S.jsx(zk,{size:10}),"Admin"]})})]}),S.jsxs("div",{className:"flex items-center gap-2 sm:gap-4",children:[S.jsxs(iw,{to:"/",className:`flex items-center gap-1.5 text-sm font-semibold text-text-secondary\r
413                         hover:text-primary px-3 py-2 rounded-btn hover:bg-primary/10 transition-colors`,children:[S.jsx(hw,{size:16}),S.jsx("span",{className:"hidden sm:inline",children:"Ver Sitio"})]}),S.jsxs("button",{onClick:s,className:`flex items-center gap-1.5 text-sm font-semibold text-text-secondary\r
414                         hover:text-primary px-3 py-2 rounded-btn hover:bg-primary/10 transition-colors`,"aria-label":"Cerrar sesión",children:[S.jsx(Lk,{size:16}),S.jsx("span",{className:"hidden sm:inline",children:"Cerrar Sesión"})]})]})]})}),S.jsx("main",{className:"flex-1 max-w-7xl mx-auto w-full",children:S.jsx(Z3,{})}),S.jsx("footer",{className:"py-6 text-center text-xs text-text-secondary/50 select-none",children:"Desarrollado por el equipo de Sistemas de Mi Gusto"}),S.jsx(mw,{})]}):null},X3=()=>{const t=So(),{user:e,loading:r,error:n,login:s,clearError:i}=c_(),[a,o]=P.useState(""),[l,u]=P.useState(!1),[c,d]=P.useState(!1);P.useEffect(()=>{!r&&e&&t("/admin",{replace:!0})},[e,r,t]);const f=async m=>{m.preventDefault(),i(),d(!0),await s(a)&&t("/admin",{replace:!0}),d(!1)};return r?S.jsx("div",{className:"min-h-screen flex items-center justify-center",children:S.jsx("div",{className:"w-8 h-8 border-3 border-primary border-t-transparent rounded-full animate-spin"})}):S.jsx("div",{className:"min-h-screen bg-background-secondary flex items-center justify-center p-4",children:S.jsxs("div",{className:"w-full max-w-sm",children:[S.jsxs("div",{className:"text-center mb-6",children:[S.jsx("div",{className:"inline-flex items-center gap-2.5 mb-4",children:S.jsx("img",{src:Ff,alt:"Mi Gusto Logo",className:"w-16 h-16 object-contain rounded-card shadow-md"})}),S.jsx("h1",{className:"font-display text-2xl font-bold text-text",children:"Mi Gusto"}),S.jsx("p",{className:"text-text-secondary text-sm mt-1",children:"Panel de administración"})]}),S.jsxs("div",{className:"bg-white rounded-card shadow-card p-6",children:[S.jsx("h2",{className:"font-bold text-text text-lg mb-5",children:"Ingresar al Panel"}),n&&S.jsx(wp,{type:"error",message:n,onClose:i,className:"mb-4"}),S.jsxs("form",{onSubmit:f,className:"space-y-4",children:[S.jsxs("div",{children:[S.jsx("label",{className:"label",htmlFor:"code",children:"Clave de acceso"}),S.jsxs("div",{className:"relative",children:[S.jsx(Nk,{size:16,className:"absolute left-3.5 top-1/2 -translate-y-1/2 text-text-secondary pointer-events-none"}),S.jsx("input",{id:"code",type:l?"text":"password",inputMode:"numeric",pattern:"[0-9]*",value:a,onChange:m=>o(m.target.value),className:"input-field pl-10 pr-10",placeholder:"Ingrese clave numérica",autoF
414ocus:!0,required:!0}),S.jsx("button",{type:"button",onClick:()=>u(m=>!m),className:"absolute right-3.5 top-1/2 -translate-y-1/2 text-text-secondary hover:text-text transition-colors",tabIndex:-1,"aria-label":l?"Ocultar contraseña":"Mostrar contraseña",children:l?S.jsx(dw,{size:16}):S.jsx(hw,{size:16})})]})]}),S.jsx(As,{type:"submit",fullWidth:!0,loading:c,className:"mt-2",children:"Ingresar"})]})]}),S.jsx("p",{className:"text-center text-xs text-text-secondary mt-4",children:"Solo usuarios autorizados pueden acceder al panel."})]})})};function Q3(){return S.jsx(xk,{children:S.jsx(pk,{basename:"/cartadigital/",children:S.jsxs(ak,{children:[S.jsx(oa,{path:"/",element:S.jsx(Gk,{children:S.jsx(_A,{})})}),S.jsx(oa,{path:"/login",element:S.jsx(X3,{})}),S.jsx(oa,{path:"/admin",element:S.jsx(Y3,{})}),S.jsx(oa,{path:"*",element:S.jsx(sk,{to:"/",replace:!0})})]})})})}td.createRoot(document.getElementById("root")).render(S.jsx($.StrictMode,{children:S.jsx(Q3,{})}));

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.